@everfur/sdk 0.21.0 → 0.22.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/CHANGELOG.md +150 -0
- package/dist/{Chat.d-JDtlG_EW.d.cts → Chat.d-DDmNIlJn.d.cts} +1 -1
- package/dist/{Chat.d-CoGJrK3t.d.ts → Chat.d-DySDBc6L.d.ts} +1 -1
- package/dist/{DepthViews.d-XTv4s3ru.d.cts → DepthViews.d-BHb0Xb-C.d.cts} +1 -1
- package/dist/{DepthViews.d-CNQn-eEr.d.ts → DepthViews.d-BIfqdrvX.d.ts} +1 -1
- package/dist/{DepthViews.d-D31VlFKU.d.ts → DepthViews.d-BW3HrhnC.d.ts} +1 -1
- package/dist/{DepthViews.d-zxM_xbP9.d.cts → DepthViews.d-Dq8eWBvw.d.cts} +1 -1
- package/dist/{RecordsPage.d-D_y-ZB3S.d.ts → RecordsPage.d-Bs-dghTH.d.ts} +1 -1
- package/dist/{RecordsPage.d-CSZHrtWJ.d.cts → RecordsPage.d-CLrw-AvZ.d.cts} +1 -1
- package/dist/animations/index.cjs +2 -2
- package/dist/animations/index.d.cts +3 -3
- package/dist/animations/index.d.ts +3 -3
- package/dist/animations/index.js +2 -2
- package/dist/{attachments.d-D74wbmQU.d.cts → attachments.d-DTGYmW8Y.d.cts} +1 -1
- package/dist/{attachments.d-Dm6NUJTR.d.ts → attachments.d-DjxmIsNp.d.ts} +1 -1
- package/dist/{bookingCopy.d-DMmLKY5Q.d.ts → bookingCopy.d-CX-DMiwi.d.ts} +148 -148
- package/dist/{bookingCopy.d-iaYDPvPd.d.cts → bookingCopy.d-D952V8Tq.d.cts} +148 -148
- package/dist/{branding.d-DpNGEdDL.d.ts → branding.d-DC4imCYd.d.ts} +72 -4
- package/dist/{branding.d-BFauULV6.d.cts → branding.d-G7rpxDhI.d.cts} +72 -4
- package/dist/{casesRepository.d-CCJJQXnl.d.ts → casesRepository.d-CnJZlUZ4.d.ts} +1 -1
- package/dist/{casesRepository.d-G2dahIKO.d.cts → casesRepository.d-bWJHZD-_.d.cts} +1 -1
- package/dist/chat/index.cjs +59 -47
- package/dist/chat/index.d.cts +11 -11
- package/dist/chat/index.d.ts +11 -11
- package/dist/chat/index.js +59 -47
- package/dist/chat/lite/index.cjs +59 -47
- package/dist/chat/lite/index.d.cts +11 -11
- package/dist/chat/lite/index.d.ts +11 -11
- package/dist/chat/lite/index.js +59 -47
- package/dist/{chatHandoffToken.d-DVv9tl8h.d.ts → chatHandoffToken.d-BCEdhZpd.d.ts} +5 -5
- package/dist/{chatHandoffToken.d-xmnHrTA5.d.cts → chatHandoffToken.d-uKnSnIzN.d.cts} +5 -5
- package/dist/{chatTypes.d-CQC7GTdE.d.cts → chatTypes.d-CFyYBzps.d.cts} +4 -4
- package/dist/{chatTypes.d-hS1AilYl.d.ts → chatTypes.d-DbdF3ij5.d.ts} +4 -4
- package/dist/chunk-AT7SU763.js +14 -0
- package/dist/{chunk-2NA7TPUA.js → chunk-FFMIX6HG.js} +1 -1
- package/dist/chunk-K5NVMNI5.js +47 -0
- package/dist/chunk-ZASVU7CH.js +34 -0
- package/dist/client/index.cjs +9 -8
- package/dist/client/index.d.cts +18 -12
- package/dist/client/index.d.ts +18 -12
- package/dist/client/index.js +9 -8
- package/dist/{clinicBatch.d-BpP2NBb3.d.ts → clinicBatch.d-C_kZtYt-.d.ts} +2 -2
- package/dist/{clinicBatch.d-4PFwKJfw.d.cts → clinicBatch.d-e3Cn5HhA.d.cts} +2 -2
- package/dist/{config.d-D9igq-vT.d.ts → config.d--6siaeNg.d.ts} +14 -6
- package/dist/{config.d-cX5E6DAw.d.cts → config.d-Ba21AaZg.d.cts} +14 -6
- package/dist/consent/index.cjs +2 -2
- package/dist/consent/index.d.cts +5 -5
- package/dist/consent/index.d.ts +5 -5
- package/dist/consent/index.js +2 -2
- package/dist/{context.d-BrRRNw9I.d.cts → context.d-DLHTf-fV.d.cts} +7 -7
- package/dist/{context.d-hPfsEsNf.d.ts → context.d-TArU_9lj.d.ts} +7 -7
- package/dist/{copy.d-CDlirTR4.d.ts → copy.d-GokMma80.d.ts} +2 -2
- package/dist/{copy.d-DWjSkbrZ.d.cts → copy.d-zWWCn3wB.d.cts} +2 -2
- package/dist/core/index.cjs +4 -4
- package/dist/core/index.d.cts +17 -17
- package/dist/core/index.d.ts +17 -17
- package/dist/core/index.js +4 -4
- package/dist/{depth.d-CfBorxcQ.d.ts → depth.d-C_HL8yAz.d.ts} +2 -2
- package/dist/{depth.d-KkrGx98U.d.cts → depth.d-De5pT7vA.d.cts} +2 -2
- package/dist/{entitlementRepository.d-DpQrIgW6.d.ts → entitlementRepository.d-CoKN-Ksa.d.ts} +3 -3
- package/dist/{entitlementRepository.d-BvnWpcQH.d.cts → entitlementRepository.d-Tj7lvs4e.d.cts} +3 -3
- package/dist/{focus.d-CYwVLDvR.d.ts → focus.d-7G0BBmA9.d.ts} +3 -128
- package/dist/{focus.d-9loikWy8.d.cts → focus.d-B0qweva0.d.cts} +3 -128
- package/dist/health-plan/index.cjs +133 -92
- package/dist/health-plan/index.d.cts +33 -18
- package/dist/health-plan/index.d.ts +33 -18
- package/dist/health-plan/index.js +141 -100
- package/dist/healthPlanRepository.d-CdCyUWph.d.ts +131 -0
- package/dist/healthPlanRepository.d-fPbLceBr.d.cts +131 -0
- package/dist/{idempotency.d-DGQ_xML5.d.ts → idempotency.d-CoUlC-Yd.d.ts} +1 -1
- package/dist/{idempotency.d-CVKkUhY4.d.cts → idempotency.d-IDta7Jjj.d.cts} +1 -1
- package/dist/{identity.d-DR5YwO6E.d.ts → identity.d-B7dPRGqm.d.ts} +1 -1
- package/dist/{identity.d-Bnl5Z0MM.d.cts → identity.d-_MK9Y7a4.d.cts} +1 -1
- package/dist/inbox.d-ChNXTovj.d.cts +103 -0
- package/dist/inbox.d-CuuPTWyW.d.ts +103 -0
- package/dist/index.cjs +69 -56
- package/dist/index.d.cts +18 -18
- package/dist/index.d.ts +18 -18
- package/dist/index.js +69 -56
- package/dist/{introEvents.d-D_yL7lnE.d.ts → introEvents.d-D6Ay0ORN.d.ts} +1 -1
- package/dist/{introEvents.d-JmPqEqMQ.d.cts → introEvents.d-JvAWRKYu.d.cts} +1 -1
- package/dist/{usePresentation.d-CrobH0d_.d.cts → layout.d-ByfOEhpG.d.cts} +2 -136
- package/dist/{usePresentation.d-CDNK4MDY.d.ts → layout.d-D3d4QMeO.d.ts} +2 -136
- package/dist/notifications/inbox/index.cjs +24 -12
- package/dist/notifications/inbox/index.d.cts +87 -6
- package/dist/notifications/inbox/index.d.ts +87 -6
- package/dist/notifications/inbox/index.js +24 -12
- package/dist/notifications/index.d.cts +7 -7
- package/dist/notifications/index.d.ts +7 -7
- package/dist/{optInView.d-CZvKlq-o.d.ts → optInView.d-BpFTJaaX.d.ts} +2 -2
- package/dist/{optInView.d-BizcW_QG.d.cts → optInView.d-Bxvg0WLJ.d.cts} +2 -2
- package/dist/{pets.d-uCzgFbGi.d.ts → pets.d-Br960ekh.d.ts} +1 -1
- package/dist/{pets.d-C4CWxQPh.d.cts → pets.d-BtbJcf8T.d.cts} +1 -1
- package/dist/{petsRepository.d-DOcVv9bd.d.cts → petsRepository.d-Bj9rPnCr.d.cts} +1 -1
- package/dist/{petsRepository.d-DRW7NkKm.d.ts → petsRepository.d-CSOth5XE.d.ts} +1 -1
- package/dist/photo/index.cjs +1 -1
- package/dist/photo/index.js +1 -1
- package/dist/{presentation.d-Bs8xQ4gD.d.cts → presentation.d-BvZs_jN-.d.cts} +6 -0
- package/dist/{presentation.d-Bs8xQ4gD.d.ts → presentation.d-BvZs_jN-.d.ts} +6 -0
- package/dist/records/depth/index.cjs +10 -6
- package/dist/records/depth/index.d.cts +9 -9
- package/dist/records/depth/index.d.ts +9 -9
- package/dist/records/depth/index.js +10 -6
- package/dist/records/index.cjs +302 -207
- package/dist/records/index.d.cts +144 -17
- package/dist/records/index.d.ts +144 -17
- package/dist/records/index.js +302 -207
- package/dist/{requestFunnel.d-CQ0O8fMG.d.cts → requestFunnel.d-BwO-jFLX.d.cts} +2 -2
- package/dist/{requestFunnel.d-BYLycQMI.d.ts → requestFunnel.d-LSnmCusf.d.ts} +2 -2
- package/dist/{route.d-DFJ0gXj8.d.ts → route.d-Bzyamuxa.d.ts} +2 -2
- package/dist/{route.d-q9yndhFy.d.cts → route.d-D70-OHBc.d.cts} +2 -2
- package/dist/{runtimeTypes.d-3LRuzxr7.d.cts → runtimeTypes.d-BHdN-9aB.d.cts} +7 -7
- package/dist/{runtimeTypes.d-BJHYj2MI.d.ts → runtimeTypes.d-L_CbeCKS.d.ts} +7 -7
- package/dist/{screenProps.d-DfAmuKkr.d.cts → screenProps.d-DB5IMaGZ.d.cts} +1 -1
- package/dist/{screenProps.d-tVzlXGaN.d.ts → screenProps.d-HGSPNGHt.d.ts} +1 -1
- package/dist/server/events/index.cjs +1 -1
- package/dist/server/events/index.d.cts +2 -2
- package/dist/server/events/index.d.ts +2 -2
- package/dist/server/events/index.js +1 -1
- package/dist/server/index.cjs +1 -1
- package/dist/server/index.d.cts +3 -3
- package/dist/server/index.d.ts +3 -3
- package/dist/server/index.js +1 -1
- package/dist/shop/index.cjs +26 -13
- package/dist/shop/index.d.cts +3 -3
- package/dist/shop/index.d.ts +3 -3
- package/dist/shop/index.js +26 -13
- package/dist/slots/index.cjs +299 -0
- package/dist/slots/index.d.cts +155 -0
- package/dist/slots/index.d.ts +155 -0
- package/dist/slots/index.js +299 -0
- package/dist/slots/weather-glyphs/index.cjs +2 -0
- package/dist/slots/weather-glyphs/index.d.cts +11 -0
- package/dist/slots/weather-glyphs/index.d.ts +11 -0
- package/dist/slots/weather-glyphs/index.js +2 -0
- package/dist/tabs/index.cjs +43 -12
- package/dist/tabs/index.d.cts +79 -8
- package/dist/tabs/index.d.ts +79 -8
- package/dist/tabs/index.js +43 -12
- package/dist/televet/booking/index.cjs +54 -10
- package/dist/televet/booking/index.d.cts +51 -10
- package/dist/televet/booking/index.d.ts +51 -10
- package/dist/televet/booking/index.js +55 -11
- package/dist/televet/call/index.cjs +1 -1
- package/dist/televet/call/index.js +1 -1
- package/dist/televet/index.cjs +1 -1
- package/dist/televet/index.d.cts +2 -2
- package/dist/televet/index.d.ts +2 -2
- package/dist/televet/index.js +1 -1
- package/dist/testing/index.d.cts +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/rn/index.cjs +1 -1
- package/dist/testing/rn/index.d.cts +13 -11
- package/dist/testing/rn/index.d.ts +13 -11
- package/dist/testing/rn/index.js +1 -1
- package/dist/testing/web/index.d.cts +10 -10
- package/dist/testing/web/index.d.ts +10 -10
- package/dist/texting/index.cjs +2 -2
- package/dist/texting/index.d.cts +5 -5
- package/dist/texting/index.d.ts +5 -5
- package/dist/texting/index.js +2 -2
- package/dist/{threadOptions.d-I6G3BdlP.d.cts → threadOptions.d-CS-Qu_rR.d.cts} +6 -6
- package/dist/{threadOptions.d-DfH26dy7.d.ts → threadOptions.d-FzFN0zsK.d.ts} +6 -6
- package/dist/{timelineRows.d-uSfr2IP3.d.cts → timelineRows.d-BJRCgmdv.d.cts} +1 -1
- package/dist/{timelineRows.d-CugnCOfZ.d.ts → timelineRows.d-CPS4admm.d.ts} +1 -1
- package/dist/{tokens.d-BUVqme2D.d.cts → tokens.d-DH1mYjZl.d.cts} +43 -1
- package/dist/{tokens.d-BUVqme2D.d.ts → tokens.d-DH1mYjZl.d.ts} +43 -1
- package/dist/{typeStyle.d-Ckdh_S-t.d.cts → typeStyle.d-BIDpuYpg.d.cts} +29 -3
- package/dist/{typeStyle.d-B9Jo5mDX.d.ts → typeStyle.d-aRhFhBpG.d.ts} +29 -3
- package/dist/ui/index.cjs +26 -13
- package/dist/ui/index.js +26 -13
- package/dist/{useHealthPlanSubscription.d-CVVQIFpG.d.ts → useHealthPlanSubscription.d-SQfx-45x.d.ts} +3 -2
- package/dist/{useHealthPlanSubscription.d-DylPMm_m.d.cts → useHealthPlanSubscription.d-zjsvvlhz.d.cts} +3 -2
- package/dist/useInboxUnread.d-7p3IWs_A.d.cts +109 -0
- package/dist/useInboxUnread.d-BxFKFU4o.d.ts +109 -0
- package/dist/usePresentation.d-BHO_uZ31.d.cts +140 -0
- package/dist/usePresentation.d-Dr7iD-4Y.d.ts +140 -0
- package/dist/{useRecordsDepth.d-BvBYIPii.d.ts → useRecordsDepth.d-BinUa8W9.d.ts} +1 -1
- package/dist/{useRecordsDepth.d-Cd5Vyb7D.d.cts → useRecordsDepth.d-Bk8BSerZ.d.cts} +1 -1
- package/dist/{useUnread.d-ElAEfgl1.d.ts → useUnread.d-CAeYh82_.d.ts} +10 -7
- package/dist/{useUnread.d-B4Yqcteg.d.cts → useUnread.d-DXcRBQw8.d.cts} +10 -7
- package/dist/video/index.cjs +1 -1
- package/dist/video/index.js +1 -1
- package/dist/{view.d-2RWoY9kd.d.ts → view.d-CaH6dZPJ.d.ts} +3 -3
- package/dist/{view.d-utmOR2ee.d.cts → view.d-DV4b1cov.d.cts} +3 -3
- package/dist/web/consent/index.cjs +1 -1
- package/dist/web/consent/index.d.cts +5 -5
- package/dist/web/consent/index.d.ts +5 -5
- package/dist/web/consent/index.js +1 -1
- package/dist/web/health-plan/index.cjs +15 -13
- package/dist/web/health-plan/index.d.cts +20 -13
- package/dist/web/health-plan/index.d.ts +20 -13
- package/dist/web/health-plan/index.js +7 -7
- package/dist/web/health-plan/styles.css +6 -2
- package/dist/web/inbox/index.cjs +1 -1
- package/dist/web/inbox/index.d.cts +7 -5
- package/dist/web/inbox/index.d.ts +7 -5
- package/dist/web/inbox/index.js +1 -1
- package/dist/web/index.cjs +71 -70
- package/dist/web/index.d.cts +53 -31
- package/dist/web/index.d.ts +53 -31
- package/dist/web/index.js +28 -27
- package/dist/web/intro/index.cjs +1 -1
- package/dist/web/intro/index.d.cts +7 -6
- package/dist/web/intro/index.d.ts +7 -6
- package/dist/web/intro/index.js +1 -1
- package/dist/web/notifications/index.cjs +1 -1
- package/dist/web/notifications/index.d.cts +6 -6
- package/dist/web/notifications/index.d.ts +6 -6
- package/dist/web/notifications/index.js +1 -1
- package/dist/web/records/depth/index.cjs +1 -1
- package/dist/web/records/depth/index.d.cts +9 -9
- package/dist/web/records/depth/index.d.ts +9 -9
- package/dist/web/records/depth/index.js +1 -1
- package/dist/web/records/index.cjs +1 -1
- package/dist/web/records/index.d.cts +11 -11
- package/dist/web/records/index.d.ts +11 -11
- package/dist/web/records/index.js +1 -1
- package/dist/web/records-sheet/index.cjs +3 -3
- package/dist/web/records-sheet/index.js +3 -3
- package/dist/web/shop/index.cjs +27 -8
- package/dist/web/shop/index.d.cts +4 -3
- package/dist/web/shop/index.d.ts +4 -3
- package/dist/web/shop/index.js +3 -3
- package/dist/web/televet/booking/index.cjs +53 -53
- package/dist/web/televet/booking/index.d.cts +44 -44
- package/dist/web/televet/booking/index.d.ts +44 -44
- package/dist/web/televet/booking/index.js +53 -53
- package/dist/web/televet/call/index.cjs +3 -3
- package/dist/web/televet/call/index.d.cts +7 -6
- package/dist/web/televet/call/index.d.ts +7 -6
- package/dist/web/televet/call/index.js +3 -3
- package/dist/web/televet/index.cjs +1 -1
- package/dist/web/televet/index.js +1 -1
- package/dist/web/texting/index.cjs +1 -1
- package/dist/web/texting/index.d.cts +5 -5
- package/dist/web/texting/index.d.ts +5 -5
- package/dist/web/texting/index.js +1 -1
- package/dist/web/ui/index.cjs +29 -10
- package/dist/web/ui/index.d.cts +32 -32
- package/dist/web/ui/index.d.ts +32 -32
- package/dist/web/ui/index.js +2 -2
- package/dist/web/ui/styles.css +46 -3
- package/package.json +36 -5
- package/slots/package.json +8 -0
- package/slots/weather-glyphs/package.json +8 -0
- package/dist/chunk-IJU5TV5N.js +0 -12
- package/dist/chunk-TFX6WMDN.js +0 -30
- package/dist/chunk-WZNPR5TY.js +0 -34
- package/dist/useInboxUnread.d-DDoSII8D.d.ts +0 -206
- package/dist/useInboxUnread.d-Dq3CCAa3.d.cts +0 -206
- package/dist/{IntakeMedia.d-Dqc5V_YH.d.cts → IntakeMedia.d-CO8weVGO.d.cts} +35 -35
- package/dist/{IntakeMedia.d-DNUAks9E.d.ts → IntakeMedia.d-DnUZJsbj.d.ts} +35 -35
|
@@ -1,40 +1,39 @@
|
|
|
1
1
|
/*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
|
|
2
|
-
"use strict";var react=require("react"),reactNative=require("react-native"),jsxRuntime=require("react/jsx-runtime"),reactNativeSafeAreaContext=require("react-native-safe-area-context"),records=require("@everfur/sdk/records");var FACE_WEIGHT=/* @__PURE__ */Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});function face(theme,weight){let type=theme.type,fontFamily=type.families[weight];return weight==="mono"||type.namedFaces[weight]?{fontFamily:fontFamily}:{fontFamily:fontFamily,fontWeight:type.weight[FACE_WEIGHT[weight]]}}function headingFace(theme,fallback="bold"){let{headingFamily:headingFamily,headingWeight:headingWeight}=theme.type;if(headingFamily===null&&headingWeight===null)return face(theme,fallback);if(headingFamily!==null)return{fontFamily:headingFamily,fontWeight:headingWeight??theme.type.weight[FACE_WEIGHT[fallback]]};let base3=face(theme,fallback);return base3.fontWeight===void 0||headingWeight===null?base3:{fontFamily:base3.fontFamily,fontWeight:headingWeight}}var HEALTH_PLAN_COPY=/* @__PURE__ */Object.freeze({loading:"Loading",retry:"Try again",signedOut:"Sign in required",addToCart:"Add to cart",added:"Added",remove:"Remove",checkout:"Checkout",subtotal:"Subtotal",sample:"Sample",cartEmpty:"Your cart is empty.",choosePet:"Choose a pet",emptyTitle:"",emptyBody:"",emptyAsk:""}),COPY_ASKS=/* @__PURE__ */Object.freeze({emptyTitle:true,emptyBody:true,emptyAsk:true}),HEALTH_PLAN_REASON_LABELS=/* @__PURE__ */Object.freeze({dna:"",records:"Records",inside:"Inside",profile:""}),HEALTH_PLAN_TEMPLATES=/* @__PURE__ */Object.freeze({planTitle:petName=>`${petName}'s care plan`,cartLabel:brand=>`${brand} cart`}),HEALTH_PLAN_COPY_PLACEHOLDERS=/* @__PURE__ */Object.freeze([...Object.keys(HEALTH_PLAN_COPY).filter(key=>COPY_ASKS[key]===true&&HEALTH_PLAN_COPY[key]==="").map(key=>`HEALTH_PLAN_COPY.${key}`),...["profile"].filter(kind=>HEALTH_PLAN_REASON_LABELS[kind]==="").map(kind=>`HEALTH_PLAN_REASON_LABELS.${kind}`)]);var HEALTH_PLAN_LAYOUT_DEFAULTS=/* @__PURE__ */Object.freeze({imageVariant:"wide",reasonVariant:"pills",cartBarVisibility:"whenItems",cartBarPlacement:"sticky",addButtonSize:"full",addedVariant:"link",categoryVariant:"text",showCategory:false,cardShadow:false,cardBorder:true});function healthPlanWrites(plan,setInPlan){return{setInPlan:setInPlan,addAll:async()=>{let missing=(plan?.items??[]).filter(item=>!item.inPlan);return(await Promise.all(missing.map(item=>setInPlan(item.productId,true)))).every(Boolean)}}}function showHealthPlanCartBar(visibility,count){return(visibility??HEALTH_PLAN_LAYOUT_DEFAULTS.cartBarVisibility)==="always"||count>0}var HEALTH_PLAN_CARD_OPTION_KEYS=/* @__PURE__ */Object.freeze(["showCategory","cardShadow","cardBorder","addButtonSize","addButtonFontSize","addedVariant","categoryVariant","cardPadding","itemTitleSize","itemTitleWeight","priceSize","priceWeight","reasonTextSize","reasonLabelWidth","reasonGap"]);function pickHealthPlanCardOptions(props){let out={};for(let key of HEALTH_PLAN_CARD_OPTION_KEYS)props[key]!==void 0&&(out[key]=props[key]);return out}function healthPlanAddButtonHeight(size){let height=typeof size=="number"&&Number.isFinite(size)&&size>0?size:size==="compact"?32:44;return{height:height,hit:Math.max(44,height)}}function parseHealthPlanShadow(css){if(css.length>200||css.includes(",")&&!/rgba?\(|hsla?\(/i.test(css))return null;let color=/(rgba?\([^)]*\)|hsla?\([^)]*\)|#[0-9a-f]{3,8}\b|[a-z]+)\s*$/i.exec(css.trim())?.[1]??null;if(color===null)return null;let lengths=css.trim().slice(0,css.trim().length-color.length).trim().split(/\s+/).filter(Boolean);if(lengths.length<2||lengths.length>4)return null;let px2=lengths.map(
|
|
2
|
+
"use strict";var react=require("react"),reactNative=require("react-native"),jsxRuntime=require("react/jsx-runtime"),reactNativeSafeAreaContext=require("react-native-safe-area-context"),records=require("@everfur/sdk/records");var FACE_WEIGHT=/* @__PURE__ */Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});function face(theme,weight){let type=theme.type,fontFamily=type.families[weight];return weight==="mono"||type.namedFaces[weight]?{fontFamily:fontFamily}:{fontFamily:fontFamily,fontWeight:type.weight[FACE_WEIGHT[weight]]}}function headingFace(theme,fallback="bold"){let{headingFamily:headingFamily,headingWeight:headingWeight}=theme.type;if(headingFamily===null&&headingWeight===null)return face(theme,fallback);if(headingFamily!==null)return{fontFamily:headingFamily,fontWeight:headingWeight??theme.type.weight[FACE_WEIGHT[fallback]]};let base3=face(theme,fallback);return base3.fontWeight===void 0||headingWeight===null?base3:{fontFamily:base3.fontFamily,fontWeight:headingWeight}}function weightBucket(weight){return weight<=450?"regular":weight<=650?"medium":"bold"}var MONO_OF={regular:"mono",medium:"monoMedium",bold:"monoBold"};function textRole(theme,role){let byRole=roleCache.get(theme);byRole===void 0&&(byRole=/* @__PURE__ */new Map,roleCache.set(theme,byRole));let hit=byRole.get(role);if(hit!==void 0)return hit;let style=buildRole(theme,role);return byRole.set(role,style),style}var roleCache=/* @__PURE__ */new WeakMap;function buildRole(theme,role){let r=theme.type.roles[role],weight=r.weight==="400"&&r.face!=="mono"?theme.type.weight.regular:r.weight,bucket=weightBucket(Number(weight)),f=r.face==="mono"?face(theme,MONO_OF[bucket]):r.face==="heading"?headingFace(theme,bucket):face(theme,bucket),faceWeight=r.face==="heading"?theme.type.headingWeight??weight:weight,faceStyle=f.fontWeight===void 0?f:{fontFamily:f.fontFamily,fontWeight:faceWeight},fontSize=r.size,out={...faceStyle,fontSize:fontSize,lineHeight:Math.round(fontSize*r.lineHeight*100)/100};return r.letterSpacing!==0&&(out.letterSpacing=Math.round(fontSize*r.letterSpacing*100)/100),r.uppercase&&(out.textTransform="uppercase"),/* @__PURE__ */Object.freeze(out)}var HEALTH_PLAN_COPY=/* @__PURE__ */Object.freeze({loading:"Loading",retry:"Try again",signedOut:"Sign in required",addToCart:"Add to cart",added:"Added",remove:"Remove",checkout:"Checkout",subtotal:"Subtotal",sample:"Sample",cartEmpty:"Your cart is empty.",choosePet:"Choose a pet",emptyTitle:"",emptyBody:"",emptyAsk:""}),COPY_ASKS=/* @__PURE__ */Object.freeze({emptyTitle:true,emptyBody:true,emptyAsk:true}),HEALTH_PLAN_REASON_LABELS=/* @__PURE__ */Object.freeze({dna:"",records:"Records",inside:"Inside",profile:""}),HEALTH_PLAN_TEMPLATES=/* @__PURE__ */Object.freeze({planTitle:petName=>`${petName}'s care plan`,cartLabel:brand=>`${brand} cart`}),HEALTH_PLAN_COPY_PLACEHOLDERS=/* @__PURE__ */Object.freeze([...Object.keys(HEALTH_PLAN_COPY).filter(key=>COPY_ASKS[key]===true&&HEALTH_PLAN_COPY[key]==="").map(key=>`HEALTH_PLAN_COPY.${key}`),...["profile"].filter(kind=>HEALTH_PLAN_REASON_LABELS[kind]==="").map(kind=>`HEALTH_PLAN_REASON_LABELS.${kind}`)]);var HEALTH_PLAN_LAYOUT_DEFAULTS=/* @__PURE__ */Object.freeze({imageVariant:"wide",reasonVariant:"pills",cartBarVisibility:"whenItems",cartBarPlacement:"sticky",addButtonSize:"full",addedVariant:"link",categoryVariant:"text",showCategory:false,cardShadow:false,cardBorder:true});function healthPlanWrites(plan,setInPlan){return{setInPlan:setInPlan,addAll:async()=>{let missing=(plan?.items??[]).filter(item=>!item.inPlan);return(await Promise.all(missing.map(item=>setInPlan(item.productId,true)))).every(Boolean)}}}function showHealthPlanCartBar(visibility,count){return(visibility??HEALTH_PLAN_LAYOUT_DEFAULTS.cartBarVisibility)==="always"||count>0}var HEALTH_PLAN_CARD_OPTION_KEYS=/* @__PURE__ */Object.freeze(["showCategory","cardShadow","cardBorder","addButtonSize","addButtonFontSize","addedVariant","categoryVariant","cardPadding","itemTitleSize","itemTitleWeight","priceSize","priceWeight","reasonTextSize","reasonLabelWidth","reasonGap"]);function pickHealthPlanCardOptions(props){let out={};for(let key of HEALTH_PLAN_CARD_OPTION_KEYS)props[key]!==void 0&&(out[key]=props[key]);return out}function healthPlanAddButtonHeight(size){let height=typeof size=="number"&&Number.isFinite(size)&&size>0?size:size==="compact"?32:44;return{height:height,hit:Math.max(44,height)}}function parseHealthPlanShadow(css){if(css.length>200||css.includes(",")&&!/rgba?\(|hsla?\(/i.test(css))return null;let color=/(rgba?\([^)]*\)|hsla?\([^)]*\)|#[0-9a-f]{3,8}\b|[a-z]+)\s*$/i.exec(css.trim())?.[1]??null;if(color===null)return null;let lengths=css.trim().slice(0,css.trim().length-color.length).trim().split(/\s+/).filter(Boolean);if(lengths.length<2||lengths.length>4)return null;let px2=lengths.map(part2=>part2==="0"?0:/^-?\d*\.?\d+px$/.test(part2)?Number(part2.slice(0,-2)):Number.NaN);return px2.some(n=>!Number.isFinite(n))?null:{color:color,offsetX:px2[0]??0,offsetY:px2[1]??0,blur:Math.max(0,px2[2]??0)}}function healthPlanLength(value){return typeof value=="number"&&Number.isFinite(value)&&value>=0?value:null}function healthPlanTitleOffset(titleGap,sectionGap){let gap=healthPlanLength(titleGap);return gap===null?0:gap-sectionGap}function isHealthPlanSessionRequired(error){return error!==null&&(error.reasonCode==="session_required"||error.code==="sessionRequired")}var DOCK_CONTEXT_SYMBOL=/* @__PURE__ */Symbol.for("@everfur/sdk#HealthPlanCartDock@v1"),globalDockHost=globalThis,DockContext=globalDockHost[DOCK_CONTEXT_SYMBOL]??(globalDockHost[DOCK_CONTEXT_SYMBOL]=react.createContext(null));function HealthPlanCartScope({children:children}){let[dock,setDock]=react.useState(null),store=react.useMemo(()=>({dock:dock,publish:setDock}),[dock]);return react.createElement(DockContext.Provider,{value:store},children)}function useHealthPlanCartDock(){return react.useContext(DockContext)?.dock??null}function usePublishHealthPlanCart(enabled,cart,busy,petRef,plan,setInPlan){let publish=react.useContext(DockContext)?.publish,latest=react.useRef(setInPlan);react.useEffect(()=>{latest.current=setInPlan},[setInPlan]);let writes=react.useMemo(()=>healthPlanWrites(plan,(productId,inPlan)=>latest.current(productId,inPlan)),[plan]);react.useEffect(()=>{if(!(publish===void 0||!enabled))return publish(/* @__PURE__ */Object.freeze({cart:cart,busy:busy,petRef:petRef,plan:plan,...writes})),()=>publish(null)},[publish,enabled,cart,busy,petRef,plan,writes])}var noopTelemetry=/* @__PURE__ */Object.freeze({track(){},trackExpectedFailure(){}});function ok(value,warning){/* @__PURE__ */
|
|
3
3
|
return Object.freeze({ok:true,value:value})}function err(error){/* @__PURE__ */
|
|
4
|
-
return Object.freeze({ok:false,error:error})}var EverfurConfigError=class _EverfurConfigError extends Error{constructor(kind,message){super(message),this.name="EverfurConfigError",this.kind=kind,Object.setPrototypeOf(this,_EverfurConfigError.prototype)}};var EVERFUR_CONTEXT_SYMBOL=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurContext@v1"),globalContextHost=globalThis,EverfurContext=globalContextHost[EVERFUR_CONTEXT_SYMBOL]??(globalContextHost[EVERFUR_CONTEXT_SYMBOL]=react.createContext(null));EverfurContext.displayName??="EverfurContext";function useEverfurContext(){let ctx=react.useContext(EverfurContext);if(ctx===null)throw new EverfurConfigError("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return ctx}var HEALTH_PLAN_EVENTS=/* @__PURE__ */Object.freeze({opened:"health_plan.opened",productClicked:"health_plan.product_clicked",checkoutStarted:"health_plan.checkout_started"});function useHealthPlanTelemetry(){return react.useContext(EverfurContext)?.runtime.registry.services.telemetry??noopTelemetry}var PlanPetContext=react.createContext(null);function HealthPlanPetScope({petRef:petRef,children:children}){return react.createElement(PlanPetContext.Provider,{value:petRef},children)}function useHealthPlanBarPet(dockPet){let page=react.useContext(PlanPetContext),ctx=react.useContext(EverfurContext);return page??dockPet??ctx?.activePet??null}function useHealthPlanOpened(drawn,petRef,plan){let telemetry=useHealthPlanTelemetry(),sent=react.useRef(null);react.useEffect(()=>{if(!drawn||petRef===null||sent.current===petRef)return;sent.current=petRef;let items=plan?.items??[];telemetry.track(HEALTH_PLAN_EVENTS.opened,{petRef:petRef,itemsCount:items.length,inPlanCount:items.filter(item=>item.inPlan).length})},[drawn,petRef,plan,telemetry])}function trackProductClicked(telemetry,petRef,productId,inPlan){telemetry.track(HEALTH_PLAN_EVENTS.productClicked,{petRef:petRef,productId:productId,inPlan:inPlan})}function trackCheckoutStarted(telemetry,petRef,cart){telemetry.track(HEALTH_PLAN_EVENTS.checkoutStarted,{petRef:petRef,itemsCount:cart.count,subtotal:cart.subtotal,currency:cart.currency})}function healthPlanPageDrawsWithoutItems(design){return design!=null&&(design.wait!==void 0||design.pick.hidden===true)}function withoutProductPart(design){return{...design,pick:{...design.pick,none:true,hidden:true}}}var NO_PLAN_ITEM=/* @__PURE__ */Object.freeze({productId:"",partnerSku:null,title:"",description:null,category:null,price:null,currency:null,imageUrl:null,url:null,reasons:[],inPlan:false,sample:false});var RETRYABILITY_ROWS=[{wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"AuthorizationException",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"ConflictException",envelope:"http_envelope",httpStatus:409,retryable:true},{wireCode:"DAILY_QUOTA_EXCEEDED",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"FILE_TOO_LARGE",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"IDEMPOTENCY_KEY_IN_FLIGHT",envelope:"http_envelope",httpStatus:409,retryable:true},{wireCode:"IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"INVALID_CONTENT_TYPE",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"InternalFailureException",envelope:"http_envelope",httpStatus:500,retryable:true},{wireCode:"MethodNotAllowedException",envelope:"http_envelope",httpStatus:405,retryable:false},{wireCode:"NotImplementedException",envelope:"http_envelope",httpStatus:501,retryable:false},{wireCode:"PaymentRequiredException",envelope:"http_envelope",httpStatus:402,retryable:false},{wireCode:"ResourceNotFoundException",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"ServiceUnavailableException",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"TIER_UPGRADE_REQUIRED",envelope:"http_envelope",httpStatus:402,retryable:false},{wireCode:"ThrottlingException",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"ValidationException",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"accessDenied",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"access_denied",envelope:"oauth_error",httpStatus:302,retryable:false},{wireCode:"attachment_unreadable",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"authExpired",envelope:"http_envelope",httpStatus:401,retryable:true},{wireCode:"authRejected",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"catalog_empty_refused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"catalog_shrink_refused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"consent_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"consent_required",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"consent_scope_wrong_route",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"device_cipher_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"email_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"endpoint_not_allowed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"event_cursor_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_id_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"event_payload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_type_not_available",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_type_unknown",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_required",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_reused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"inbox_cursor_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"insufficientCapability",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"insufficient_scope",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"internal_error",envelope:"sse_frame",httpStatus:200,retryable:false},{wireCode:"invalidRequest",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"invalid_client",envelope:"oauth_error",httpStatus:401,retryable:false},{wireCode:"invalid_client_metadata",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_grant",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_redirect_uri",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_request",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_scope",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_target",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"item_id_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"linked_account_read_only",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"mcp_connection_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"mcp_request_conflict",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"mcp_request_gone",envelope:"http_envelope",httpStatus:410,retryable:false},{wireCode:"mcp_request_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"not_found",envelope:"sse_frame",httpStatus:200,retryable:false},{wireCode:"open_url_not_allowed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"partner_visit_link_conflict",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"partner_visit_owner_only",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"partner_visit_pet_already_mapped",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"payload_too_large",envelope:"http_envelope",httpStatus:413,retryable:false},{wireCode:"petRefInUse",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"pet_health_list_removals_unconfirmed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"pet_health_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"pet_not_registered",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"provider_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"rateLimited",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"read_target_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"record_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"record_subject_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"record_upload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"records_consent_required",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"sandbox_only",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"session_required",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"session_revoked",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"share_limit_reached",envelope:"http_envelope",httpStatus:429,retryable:false},{wireCode:"slow_down",envelope:"oauth_error",httpStatus:429,retryable:true},{wireCode:"species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"subscription_keys_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"tenant_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"tenant_has_no_capabilities",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"tenant_resource_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"tenant_surface_not_enabled",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"timeout",envelope:"sse_frame",httpStatus:200,retryable:true},{wireCode:"token_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"unavailable",envelope:"sse_frame",httpStatus:200,retryable:true},{wireCode:"unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"unrestrictedKeyRequired",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"unsupported_grant_type",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"unsupported_response_type",envelope:"oauth_error",httpStatus:302,retryable:false},{wireCode:"user_ref_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"verify_mint_rate_limited",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"verify_mint_refused",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"verify_mint_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"verify_user_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"web_push_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"webhook_endpoint_update_empty",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"webhook_endpoint_update_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false}],CONTRACT_RETRYABILITY=/* @__PURE__ */Object.freeze(RETRYABILITY_ROWS.map(row=>/* @__PURE__ */Object.freeze(row)));/* @__PURE__ */Object.freeze(CONTRACT_RETRYABILITY.map(row=>row.wireCode));var NORMALIZED_FOLD=/* @__PURE__ */Object.freeze({ValidationException:"validationFailed",AuthorizationException:"authRejected",PaymentRequiredException:"paymentRequired",AccessDeniedException:"accessDenied",ResourceNotFoundException:"resourceNotFound",ConflictException:"conflict",ThrottlingException:"rateLimited",InternalFailureException:"internalError",NotImplementedException:"notImplemented",ServiceUnavailableException:"serviceUnavailable",MethodNotAllowedException:"validationFailed",authExpired:"authExpired",unavailable:"serviceUnavailable",session_required:"sessionRequired",session_revoked:"authExpired",accessDenied:"accessDenied",invalidRequest:"sdkUpdateRequired",authRejected:"authRejected",rateLimited:"rateLimited",insufficientCapability:"accessDenied",unrestrictedKeyRequired:"accessDenied",user_ref_invalid:"validationFailed",event_cursor_invalid:"validationFailed",event_filter_invalid:"validationFailed",event_payload_invalid:"validationFailed",event_type_unknown:"validationFailed",idempotency_key_invalid:"validationFailed",idempotency_key_required:"validationFailed",idempotency_key_reused:"idempotencyConflict",payload_too_large:"validationFailed",webhook_url_rejected:"validationFailed",webhook_endpoint_update_empty:"validationFailed",webhook_endpoint_update_invalid:"validationFailed",event_type_not_available:"conflict",record_subject_not_found:"resourceNotFound",records_consent_required:"conflict",record_species_unsupported:"validationFailed",record_upload_invalid:"validationFailed",FILE_TOO_LARGE:"validationFailed",INVALID_CONTENT_TYPE:"validationFailed",attachment_unreadable:"validationFailed",provider_unsupported:"validationFailed",token_invalid:"validationFailed",device_cipher_unavailable:"serviceUnavailable",email_invalid:"validationFailed",consent_required:"validationFailed",consent_invalid:"validationFailed",consent_scope_wrong_route:"validationFailed",IDEMPOTENCY_KEY_IN_FLIGHT:"idempotencyInFlight",IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST:"idempotencyConflict",DAILY_QUOTA_EXCEEDED:"quotaExceeded",TIER_UPGRADE_REQUIRED:"paymentRequired",not_found:"conversationNotFound",timeout:"streamTimeout",internal_error:"internalError",invalid_request:"validationFailed",invalid_client:"authRejected",invalid_grant:"authRejected",unsupported_grant_type:"validationFailed",invalid_scope:"validationFailed",invalid_target:"validationFailed",invalid_redirect_uri:"validationFailed",invalid_client_metadata:"validationFailed",unsupported_response_type:"validationFailed",access_denied:"accessDenied",slow_down:"rateLimited",mcp_request_not_found:"resourceNotFound",mcp_request_gone:"resourceNotFound",mcp_connection_not_found:"resourceNotFound",mcp_request_conflict:"conflict",sandbox_only:"accessDenied",tenant_has_no_capabilities:"conflict",verify_mint_refused:"accessDenied",verify_mint_rate_limited:"rateLimited",verify_mint_unavailable:"serviceUnavailable",verify_user_ref_invalid:"validationFailed",insufficient_scope:"accessDenied",tenant_filter_invalid:"validationFailed",tenant_resource_not_found:"resourceNotFound",tenant_surface_not_enabled:"conflict",pet_health_species_unsupported:"validationFailed",pet_health_list_removals_unconfirmed:"validationFailed",petRefInUse:"conflict",share_limit_reached:"conflict",pet_not_registered:"resourceNotFound",species_unsupported:"validationFailed",partner_visit_owner_only:"accessDenied",partner_visit_link_conflict:"conflict",partner_visit_pet_already_mapped:"conflict",linked_account_read_only:"conflict",catalog_empty_refused:"conflict",catalog_shrink_refused:"conflict",endpoint_not_allowed:"validationFailed",event_id_invalid:"validationFailed",inbox_cursor_invalid:"validationFailed",item_id_invalid:"validationFailed",open_url_not_allowed:"validationFailed",read_target_invalid:"validationFailed",subscription_keys_invalid:"validationFailed",web_push_unavailable:"serviceUnavailable"}),CONTRACT_ERROR_ROWS=/* @__PURE__ */Object.freeze(CONTRACT_RETRYABILITY.map(generated=>/* @__PURE__ */Object.freeze({wireCode:generated.wireCode,envelope:generated.envelope,retryable:generated.retryable,normalized:NORMALIZED_FOLD[generated.wireCode]}))),BY_KEY=new Map(CONTRACT_ERROR_ROWS.map(r=>[r.envelope+r.wireCode.toUpperCase(),r])),ENVELOPE_LOOKUP_ORDER=/* @__PURE__ */Object.freeze(["http_envelope",...[...new Set(CONTRACT_ERROR_ROWS.map(r=>r.envelope))].filter(e=>e!=="http_envelope").sort()]);function contractErrorFor(wireCode,envelope){if(typeof wireCode!="string")return;let key=wireCode.trim().toUpperCase();if(key.length!==0)for(let candidate of[envelope??"http_envelope",...ENVELOPE_LOOKUP_ORDER]){let row=BY_KEY.get(candidate+key);if(row)return row}}var CATEGORY_OF=/* @__PURE__ */Object.freeze({authExpired:"authentication",authRejected:"authentication",sessionRequired:"authentication",identitySignatureRequired:"authentication",accessDenied:"authorization",paymentRequired:"entitlement",quotaExceeded:"rateLimit",rateLimited:"rateLimit",validationFailed:"invalidRequest",sdkUpdateRequired:"invalidRequest",runtimeDisposed:"invalidRequest",conversationNotFound:"notFound",petNotFound:"notFound",resourceNotFound:"notFound",conflict:"conflict",idempotencyConflict:"conflict",idempotencyInFlight:"conflict",streamTimeout:"connection",streamIncomplete:"connection",upstreamLlmTimeout:"connection",serviceUnavailable:"connection",internalError:"server",notImplemented:"server",mediaUploadFailed:"media",moderationBlocked:"policy",unknown:"unknown"});function categoryFor(code){return CATEGORY_OF[code]}function fromWire(wire){let contractRow=contractErrorFor(wire);if(contractRow)return contractRow.normalized;let upper=(wire??"").trim().toUpperCase(),canonical=upper.replace(/[^A-Z0-9]/g,"");if(canonical==="AUTHREJECTED")return"authRejected";if(upper.startsWith("AUTH"))return"authExpired";switch(canonical){case"DAILYQUOTAEXCEEDED":case"QUOTAEXCEEDED":return"quotaExceeded";case"RATELIMITED":case"TOOMANYREQUESTS":case"TELEVETRATELIMITED":return"rateLimited";case"IDEMPOTENCYKEYCONFLICT":case"IDEMPOTENCYCONFLICT":return"idempotencyConflict";case"ACCESSDENIED":case"FORBIDDEN":return"accessDenied";case"IDENTITYSIGNATUREREQUIRED":return"identitySignatureRequired";case"RUNTIMEDISPOSED":return"runtimeDisposed";case"NOTFOUND":case"CONVERSATIONNOTFOUND":return"conversationNotFound";case"PETNOTFOUND":return"petNotFound";case"TIMEOUT":case"STREAMTIMEOUT":return"streamTimeout";case"MEDIAUPLOADFAILED":case"UNRECOGNIZEDVIDEOFORMAT":case"FILETOOSMALL":return"mediaUploadFailed";case"MODERATIONBLOCKED":return"moderationBlocked";case"UPSTREAMLLMTIMEOUT":return"upstreamLlmTimeout";case"INTERNALERROR":case"INTERNALSERVERERROR":return"internalError";case"STREAMINCOMPLETE":case"CHATSTREAMINCOMPLETE":return"streamIncomplete";case"INVALIDANALYSISTYPE":case"INVALIDUPLOADPURPOSE":return"unknown";default:return"unknown"}}var AUTO_RETRYABLE_CODES=/* @__PURE__ */new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function isAutoRetryable(code){return AUTO_RETRYABLE_CODES.has(code)}var RETRYABLE_CONTRACT_CODES=/* @__PURE__ */new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function isRetryableCode(code){return isAutoRetryable(code)||RETRYABLE_CONTRACT_CODES.has(code)}var BACKOFF_BASE_MS=500,BACKOFF_CAP_MS=8e3,MAX_RETRY_ATTEMPTS=4;function backoffDelayMs(attempt,rng=Math.random){let bounded=Math.max(0,attempt),ceiling=Math.min(BACKOFF_BASE_MS*2**bounded,BACKOFF_CAP_MS);return Math.floor(rng()*ceiling)}var ACCESS_DENIED_COPY="This feature isn't available on your account right now.",VALIDATION_FAILED_COPY="Something in that request was not right. Check the details and try again.",USER_FACING_COPY=/* @__PURE__ */Object.freeze({authExpired:"Please sign in again to continue.",authRejected:"Please sign in again to continue.",sessionRequired:"This app needs to be updated to keep using Everfur.",accessDenied:ACCESS_DENIED_COPY,paymentRequired:"This is part of a paid plan.",quotaExceeded:"You have used today's messages. This resets tomorrow.",rateLimited:"You are sending messages quickly. Try again in a few seconds.",validationFailed:VALIDATION_FAILED_COPY,sdkUpdateRequired:"This app needs to be updated to keep using Everfur.",conflict:"That is already running. Wait for it to finish, then try again.",idempotencyConflict:"That message was already delivered.",idempotencyInFlight:"That is still processing. Give it a moment.",conversationNotFound:"This conversation is no longer available.",petNotFound:"We could not find that pet. Please pick a pet and try again.",resourceNotFound:"We could not find that.",streamTimeout:"The response timed out. Tap retry to try again.",mediaUploadFailed:"We could not upload that photo. Please attach it again.",moderationBlocked:"This request cannot be answered here.",upstreamLlmTimeout:"The response timed out. Tap retry to try again.",internalError:"We hit a snag on our end. Please try again.",notImplemented:"That is not available yet.",serviceUnavailable:"That service is briefly unavailable. Try again shortly.",streamIncomplete:"The connection dropped mid-answer. Tap retry to continue.",identitySignatureRequired:ACCESS_DENIED_COPY,runtimeDisposed:VALIDATION_FAILED_COPY,unknown:"Something went wrong. Please try again."}),SESSION_REVOKED_COPY="This session has ended. Please sign in again.",LINKED_ACCOUNT_READ_ONLY="linked_account_read_only";function displayFor(code,wireCode,reasonCode){return code==="conflict"&&reasonCode===LINKED_ACCOUNT_READ_ONLY?ACCESS_DENIED_COPY:(code==="authRejected"||code==="authExpired")&&typeof wireCode=="string"&&wireCode.trim().toLowerCase()==="session_revoked"?SESSION_REVOKED_COPY:userFacingError(code)}function userFacingError(code){return USER_FACING_COPY[code]}function defineHidden(target,key,value){Object.defineProperty(target,key,{value:value,enumerable:false,writable:false,configurable:false})}var REASON_CODE_SHAPE=/^[a-z][a-z0-9_]{0,63}$/;function makeEverfurError(code,opts){let row=contractErrorFor(opts?.wireCode,opts?.wireEnvelope),linkedReadOnly=code==="conflict"&&opts?.reasonCode===LINKED_ACCOUNT_READ_ONLY,error={code:code,category:categoryFor(code),retryable:opts?.retryable??(linkedReadOnly?false:isRetryableCode(code)),displayMessage:displayFor(code,opts?.wireCode,linkedReadOnly?LINKED_ACCOUNT_READ_ONLY:null)};opts?.httpStatus!==void 0&&(error.httpStatus=opts.httpStatus),opts?.requestId&&(error.requestId=opts.requestId),typeof opts?.reasonCode=="string"&&REASON_CODE_SHAPE.test(opts.reasonCode)&&(error.reasonCode=opts.reasonCode);let wait=opts?.retryAfterSeconds;if(typeof wait=="number"&&Number.isFinite(wait)&&wait>=0&&(error.retryAfterSeconds=Math.round(wait)),row);return opts?.wireMessage&&defineHidden(error,"wireMessage",opts.wireMessage),opts?.raw!==void 0&&opts.raw!==null&&defineHidden(error,"raw",opts.raw),/* @__PURE__ */Object.freeze(error)}function assertNever(x){throw new Error(`assertNever: unhandled discriminated-union member ${JSON.stringify(x)}`)}function errorFrame(fields){/* @__PURE__ */
|
|
5
|
-
return Object.freeze({kind:"error",terminal:true,code:fields.code,retryable:fields.retryable,wireMessage:fields.wireMessage,synthesized:fields.synthesized,lastEventId:fields.lastEventId,serverRequestId:null})}function mintFailedError(cause,refusal){let message=cause instanceof Error?cause.message:typeof cause=="string"?cause:null;return makeEverfurError("authRejected",{retryable:false,...refusal?.wireCode?{wireCode:refusal.wireCode}:{},...refusal?.requestId?{requestId:refusal.requestId}:{},...message?{wireMessage:message}:{},...cause!=null?{raw:cause}:{}})}function authHeaders(auth){let headers={};return auth.mode==="personalized"?headers.authorization=`Bearer ${auth.token}`:headers["x-everfur-partner-key"]=auth.publishableKey,auth.userRef&&(headers["x-everfur-user-ref"]=auth.userRef),auth.sessionId&&(headers["x-everfur-session-id"]=auth.sessionId),headers}function withAuthHeaders(req,auth){return{...req,headers:{...stripAuthHeaders(req.headers),...authHeaders(auth)}}}function stripAuthHeaders(headers){if(!headers)return{};let out={};for(let[key,value]of Object.entries(headers)){let lower=key.toLowerCase();lower==="authorization"||lower==="x-everfur-partner-key"||(out[key]=value)}return out}async function authedSend(req,ctx){if(ctx.mode==="anonymous")return ctx.transport.request(withAuthHeaders(req,{mode:"anonymous",publishableKey:ctx.publishableKey,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));let token;try{token=await ctx.identity.currentToken()}catch(cause){return ctx.identity.reportRejected?.(),err(mintFailedError(cause))}let first=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:token,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));if(first.ok||first.error.httpStatus!==401)return first;let refreshed;try{refreshed=await ctx.identity.currentToken({forceRefresh:!0})}catch(cause){return ctx.identity.reportRejected?.(),err(mintFailedError(cause,{wireCode:wireCodeOf(first.error.raw),requestId:first.error.requestId}))}let retry=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:refreshed,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));return!retry.ok&&retry.error.httpStatus===401?(ctx.identity.reportRejected?.(),err(refusedAfterRemintError(retry.error))):retry}function refusedAfterRemintError(refusal){let raw=refusal.raw,wireCode=wireCodeOf(raw);return makeEverfurError("authRejected",{retryable:false,...refusal.httpStatus!==void 0?{httpStatus:refusal.httpStatus}:{},...refusal.requestId?{requestId:refusal.requestId}:{},...wireCode?{wireCode:wireCode}:{},...refusal.reasonCode?{reasonCode:refusal.reasonCode}:{},...refusal.wireMessage?{wireMessage:refusal.wireMessage}:{},...raw!=null?{raw:raw}:{}})}function wireCodeOf(body){if(typeof body!="object"||body===null)return null;let b=body,code=(typeof b.error=="object"&&b.error!==null?b.error.code:void 0)??b.code;return typeof code=="string"&&code.length>0?code:null}function parseUrl(raw,base3){let Url=globalThis.URL;if(typeof Url=="function"){let url;try{url=base3===void 0?new Url(raw):new Url(raw,base3)}catch{return null}try{if(url.protocol)return url}catch{}}return parseByPattern(raw)}var WHOLE_URL=/^([a-z][a-z0-9+.-]*):\/\/(?:([^:@/?#]*)(?::([^@/?#]*))?@)?(\[[0-9a-f:.]+\]|[\w.~-]+)(?::(\d*))?(\/[^?#]*)?(\?[^#]*)?(#.*)?$/i,REWRITTEN_BY_STANDARD_PARSER=/[\s\u0000-\u001f\u007f\\]/,DEFAULT_PORTS={"http:":"80","https:":"443"};function parseByPattern(raw,base3){let input=raw.trim();let match=REWRITTEN_BY_STANDARD_PARSER.test(input)?null:WHOLE_URL.exec(input);if(match===null)return null;let[,scheme="",username="",password="",
|
|
4
|
+
return Object.freeze({ok:false,error:error})}var EverfurConfigError=class _EverfurConfigError extends Error{constructor(kind,message){super(message),this.name="EverfurConfigError",this.kind=kind,Object.setPrototypeOf(this,_EverfurConfigError.prototype)}};var EVERFUR_CONTEXT_SYMBOL=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurContext@v1"),globalContextHost=globalThis,EverfurContext=globalContextHost[EVERFUR_CONTEXT_SYMBOL]??(globalContextHost[EVERFUR_CONTEXT_SYMBOL]=react.createContext(null));EverfurContext.displayName??="EverfurContext";function useEverfurContext(){let ctx=react.useContext(EverfurContext);if(ctx===null)throw new EverfurConfigError("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return ctx}var HEALTH_PLAN_EVENTS=/* @__PURE__ */Object.freeze({opened:"health_plan.opened",productClicked:"health_plan.product_clicked",checkoutStarted:"health_plan.checkout_started"});function useHealthPlanTelemetry(){return react.useContext(EverfurContext)?.runtime.registry.services.telemetry??noopTelemetry}var PlanPetContext=react.createContext(null);function HealthPlanPetScope({petRef:petRef,children:children}){return react.createElement(PlanPetContext.Provider,{value:petRef},children)}function useHealthPlanBarPet(dockPet){let page=react.useContext(PlanPetContext),ctx=react.useContext(EverfurContext);return page??dockPet??ctx?.activePet??null}function useHealthPlanOpened(drawn2,petRef,plan){let telemetry=useHealthPlanTelemetry(),sent=react.useRef(null);react.useEffect(()=>{if(!drawn2||petRef===null||sent.current===petRef)return;sent.current=petRef;let items=plan?.items??[];telemetry.track(HEALTH_PLAN_EVENTS.opened,{petRef:petRef,itemsCount:items.length,inPlanCount:items.filter(item=>item.inPlan).length})},[drawn2,petRef,plan,telemetry])}function trackProductClicked(telemetry,petRef,productId,inPlan){telemetry.track(HEALTH_PLAN_EVENTS.productClicked,{petRef:petRef,productId:productId,inPlan:inPlan})}function trackCheckoutStarted(telemetry,petRef,cart){telemetry.track(HEALTH_PLAN_EVENTS.checkoutStarted,{petRef:petRef,itemsCount:cart.count,subtotal:cart.subtotal,currency:cart.currency})}function healthPlanPageDrawsWithoutItems(design){return design!=null&&(design.wait!==void 0||design.pick.hidden===true)}function withoutProductPart(design){return{...design,pick:{...design.pick,none:true,hidden:true}}}var NO_PLAN_ITEM=/* @__PURE__ */Object.freeze({productId:"",partnerSku:null,title:"",description:null,category:null,price:null,currency:null,imageUrl:null,url:null,reasons:[],inPlan:false,sample:false});var RETRYABILITY_ROWS=[{wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"AuthorizationException",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"ConflictException",envelope:"http_envelope",httpStatus:409,retryable:true},{wireCode:"DAILY_QUOTA_EXCEEDED",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"FILE_TOO_LARGE",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"IDEMPOTENCY_KEY_IN_FLIGHT",envelope:"http_envelope",httpStatus:409,retryable:true},{wireCode:"IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"INVALID_CONTENT_TYPE",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"InternalFailureException",envelope:"http_envelope",httpStatus:500,retryable:true},{wireCode:"MethodNotAllowedException",envelope:"http_envelope",httpStatus:405,retryable:false},{wireCode:"NotImplementedException",envelope:"http_envelope",httpStatus:501,retryable:false},{wireCode:"PaymentRequiredException",envelope:"http_envelope",httpStatus:402,retryable:false},{wireCode:"ResourceNotFoundException",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"ServiceUnavailableException",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"TIER_UPGRADE_REQUIRED",envelope:"http_envelope",httpStatus:402,retryable:false},{wireCode:"ThrottlingException",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"ValidationException",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"accessDenied",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"access_denied",envelope:"oauth_error",httpStatus:302,retryable:false},{wireCode:"attachment_unreadable",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"authExpired",envelope:"http_envelope",httpStatus:401,retryable:true},{wireCode:"authRejected",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"catalog_empty_refused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"catalog_shrink_refused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"consent_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"consent_required",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"consent_scope_wrong_route",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"device_cipher_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"email_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"endpoint_not_allowed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"event_cursor_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_id_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"event_payload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_type_not_available",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_type_unknown",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_required",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_reused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"inbox_cursor_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"insufficientCapability",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"insufficient_scope",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"internal_error",envelope:"sse_frame",httpStatus:200,retryable:false},{wireCode:"invalidRequest",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"invalid_client",envelope:"oauth_error",httpStatus:401,retryable:false},{wireCode:"invalid_client_metadata",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_grant",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_redirect_uri",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_request",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_scope",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_target",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"item_id_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"linked_account_read_only",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"mcp_connection_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"mcp_request_conflict",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"mcp_request_gone",envelope:"http_envelope",httpStatus:410,retryable:false},{wireCode:"mcp_request_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"not_found",envelope:"sse_frame",httpStatus:200,retryable:false},{wireCode:"open_url_not_allowed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"partner_visit_link_conflict",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"partner_visit_owner_only",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"partner_visit_pet_already_mapped",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"payload_too_large",envelope:"http_envelope",httpStatus:413,retryable:false},{wireCode:"petRefInUse",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"pet_health_list_removals_unconfirmed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"pet_health_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"pet_not_registered",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"provider_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"rateLimited",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"read_target_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"record_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"record_subject_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"record_upload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"records_consent_required",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"sandbox_only",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"session_required",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"session_revoked",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"share_limit_reached",envelope:"http_envelope",httpStatus:429,retryable:false},{wireCode:"slow_down",envelope:"oauth_error",httpStatus:429,retryable:true},{wireCode:"species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"subscription_keys_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"tenant_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"tenant_has_no_capabilities",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"tenant_resource_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"tenant_surface_not_enabled",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"timeout",envelope:"sse_frame",httpStatus:200,retryable:true},{wireCode:"token_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"unavailable",envelope:"sse_frame",httpStatus:200,retryable:true},{wireCode:"unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"unrestrictedKeyRequired",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"unsupported_grant_type",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"unsupported_response_type",envelope:"oauth_error",httpStatus:302,retryable:false},{wireCode:"user_ref_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"verify_mint_rate_limited",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"verify_mint_refused",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"verify_mint_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"verify_user_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"web_push_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"webhook_endpoint_update_empty",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"webhook_endpoint_update_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false}],CONTRACT_RETRYABILITY=/* @__PURE__ */Object.freeze(RETRYABILITY_ROWS.map(row=>/* @__PURE__ */Object.freeze(row)));/* @__PURE__ */Object.freeze(CONTRACT_RETRYABILITY.map(row=>row.wireCode));var NORMALIZED_FOLD=/* @__PURE__ */Object.freeze({ValidationException:"validationFailed",AuthorizationException:"authRejected",PaymentRequiredException:"paymentRequired",AccessDeniedException:"accessDenied",ResourceNotFoundException:"resourceNotFound",ConflictException:"conflict",ThrottlingException:"rateLimited",InternalFailureException:"internalError",NotImplementedException:"notImplemented",ServiceUnavailableException:"serviceUnavailable",MethodNotAllowedException:"validationFailed",authExpired:"authExpired",unavailable:"serviceUnavailable",session_required:"sessionRequired",session_revoked:"authExpired",accessDenied:"accessDenied",invalidRequest:"sdkUpdateRequired",authRejected:"authRejected",rateLimited:"rateLimited",insufficientCapability:"accessDenied",unrestrictedKeyRequired:"accessDenied",user_ref_invalid:"validationFailed",event_cursor_invalid:"validationFailed",event_filter_invalid:"validationFailed",event_payload_invalid:"validationFailed",event_type_unknown:"validationFailed",idempotency_key_invalid:"validationFailed",idempotency_key_required:"validationFailed",idempotency_key_reused:"idempotencyConflict",payload_too_large:"validationFailed",webhook_url_rejected:"validationFailed",webhook_endpoint_update_empty:"validationFailed",webhook_endpoint_update_invalid:"validationFailed",event_type_not_available:"conflict",record_subject_not_found:"resourceNotFound",records_consent_required:"conflict",record_species_unsupported:"validationFailed",record_upload_invalid:"validationFailed",FILE_TOO_LARGE:"validationFailed",INVALID_CONTENT_TYPE:"validationFailed",attachment_unreadable:"validationFailed",provider_unsupported:"validationFailed",token_invalid:"validationFailed",device_cipher_unavailable:"serviceUnavailable",email_invalid:"validationFailed",consent_required:"validationFailed",consent_invalid:"validationFailed",consent_scope_wrong_route:"validationFailed",IDEMPOTENCY_KEY_IN_FLIGHT:"idempotencyInFlight",IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST:"idempotencyConflict",DAILY_QUOTA_EXCEEDED:"quotaExceeded",TIER_UPGRADE_REQUIRED:"paymentRequired",not_found:"conversationNotFound",timeout:"streamTimeout",internal_error:"internalError",invalid_request:"validationFailed",invalid_client:"authRejected",invalid_grant:"authRejected",unsupported_grant_type:"validationFailed",invalid_scope:"validationFailed",invalid_target:"validationFailed",invalid_redirect_uri:"validationFailed",invalid_client_metadata:"validationFailed",unsupported_response_type:"validationFailed",access_denied:"accessDenied",slow_down:"rateLimited",mcp_request_not_found:"resourceNotFound",mcp_request_gone:"resourceNotFound",mcp_connection_not_found:"resourceNotFound",mcp_request_conflict:"conflict",sandbox_only:"accessDenied",tenant_has_no_capabilities:"conflict",verify_mint_refused:"accessDenied",verify_mint_rate_limited:"rateLimited",verify_mint_unavailable:"serviceUnavailable",verify_user_ref_invalid:"validationFailed",insufficient_scope:"accessDenied",tenant_filter_invalid:"validationFailed",tenant_resource_not_found:"resourceNotFound",tenant_surface_not_enabled:"conflict",pet_health_species_unsupported:"validationFailed",pet_health_list_removals_unconfirmed:"validationFailed",petRefInUse:"conflict",share_limit_reached:"conflict",pet_not_registered:"resourceNotFound",species_unsupported:"validationFailed",partner_visit_owner_only:"accessDenied",partner_visit_link_conflict:"conflict",partner_visit_pet_already_mapped:"conflict",linked_account_read_only:"conflict",catalog_empty_refused:"conflict",catalog_shrink_refused:"conflict",endpoint_not_allowed:"validationFailed",event_id_invalid:"validationFailed",inbox_cursor_invalid:"validationFailed",item_id_invalid:"validationFailed",open_url_not_allowed:"validationFailed",read_target_invalid:"validationFailed",subscription_keys_invalid:"validationFailed",web_push_unavailable:"serviceUnavailable"}),CONTRACT_ERROR_ROWS=/* @__PURE__ */Object.freeze(CONTRACT_RETRYABILITY.map(generated=>/* @__PURE__ */Object.freeze({wireCode:generated.wireCode,envelope:generated.envelope,retryable:generated.retryable,normalized:NORMALIZED_FOLD[generated.wireCode]}))),BY_KEY=new Map(CONTRACT_ERROR_ROWS.map(r=>[r.envelope+r.wireCode.toUpperCase(),r])),ENVELOPE_LOOKUP_ORDER=/* @__PURE__ */Object.freeze(["http_envelope",...[...new Set(CONTRACT_ERROR_ROWS.map(r=>r.envelope))].filter(e=>e!=="http_envelope").sort()]);function contractErrorFor(wireCode,envelope){if(typeof wireCode!="string")return;let key=wireCode.trim().toUpperCase();if(key.length!==0)for(let candidate of[envelope??"http_envelope",...ENVELOPE_LOOKUP_ORDER]){let row=BY_KEY.get(candidate+key);if(row)return row}}var CATEGORY_OF=/* @__PURE__ */Object.freeze({authExpired:"authentication",authRejected:"authentication",sessionRequired:"authentication",identitySignatureRequired:"authentication",accessDenied:"authorization",paymentRequired:"entitlement",quotaExceeded:"rateLimit",rateLimited:"rateLimit",validationFailed:"invalidRequest",sdkUpdateRequired:"invalidRequest",runtimeDisposed:"invalidRequest",conversationNotFound:"notFound",petNotFound:"notFound",resourceNotFound:"notFound",conflict:"conflict",idempotencyConflict:"conflict",idempotencyInFlight:"conflict",streamTimeout:"connection",streamIncomplete:"connection",upstreamLlmTimeout:"connection",serviceUnavailable:"connection",internalError:"server",notImplemented:"server",mediaUploadFailed:"media",moderationBlocked:"policy",unknown:"unknown"});function categoryFor(code){return CATEGORY_OF[code]}function fromWire(wire){let contractRow=contractErrorFor(wire);if(contractRow)return contractRow.normalized;let upper=(wire??"").trim().toUpperCase(),canonical=upper.replace(/[^A-Z0-9]/g,"");if(canonical==="AUTHREJECTED")return"authRejected";if(upper.startsWith("AUTH"))return"authExpired";switch(canonical){case"DAILYQUOTAEXCEEDED":case"QUOTAEXCEEDED":return"quotaExceeded";case"RATELIMITED":case"TOOMANYREQUESTS":case"TELEVETRATELIMITED":return"rateLimited";case"IDEMPOTENCYKEYCONFLICT":case"IDEMPOTENCYCONFLICT":return"idempotencyConflict";case"ACCESSDENIED":case"FORBIDDEN":return"accessDenied";case"IDENTITYSIGNATUREREQUIRED":return"identitySignatureRequired";case"RUNTIMEDISPOSED":return"runtimeDisposed";case"NOTFOUND":case"CONVERSATIONNOTFOUND":return"conversationNotFound";case"PETNOTFOUND":return"petNotFound";case"TIMEOUT":case"STREAMTIMEOUT":return"streamTimeout";case"MEDIAUPLOADFAILED":case"UNRECOGNIZEDVIDEOFORMAT":case"FILETOOSMALL":return"mediaUploadFailed";case"MODERATIONBLOCKED":return"moderationBlocked";case"UPSTREAMLLMTIMEOUT":return"upstreamLlmTimeout";case"INTERNALERROR":case"INTERNALSERVERERROR":return"internalError";case"STREAMINCOMPLETE":case"CHATSTREAMINCOMPLETE":return"streamIncomplete";case"INVALIDANALYSISTYPE":case"INVALIDUPLOADPURPOSE":return"unknown";default:return"unknown"}}var AUTO_RETRYABLE_CODES=/* @__PURE__ */new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function isAutoRetryable(code){return AUTO_RETRYABLE_CODES.has(code)}var RETRYABLE_CONTRACT_CODES=/* @__PURE__ */new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function isRetryableCode(code){return isAutoRetryable(code)||RETRYABLE_CONTRACT_CODES.has(code)}var BACKOFF_BASE_MS=500,BACKOFF_CAP_MS=8e3,MAX_RETRY_ATTEMPTS=4;function backoffDelayMs(attempt,rng=Math.random){let bounded=Math.max(0,attempt),ceiling=Math.min(BACKOFF_BASE_MS*2**bounded,BACKOFF_CAP_MS);return Math.floor(rng()*ceiling)}var ACCESS_DENIED_COPY="This feature isn't available on your account right now.",VALIDATION_FAILED_COPY="Something in that request was not right. Check the details and try again.",USER_FACING_COPY=/* @__PURE__ */Object.freeze({authExpired:"Please sign in again to continue.",authRejected:"Please sign in again to continue.",sessionRequired:"This app needs to be updated to keep using Everfur.",accessDenied:ACCESS_DENIED_COPY,paymentRequired:"This is part of a paid plan.",quotaExceeded:"You have used today's messages. This resets tomorrow.",rateLimited:"You are sending messages quickly. Try again in a few seconds.",validationFailed:VALIDATION_FAILED_COPY,sdkUpdateRequired:"This app needs to be updated to keep using Everfur.",conflict:"That is already running. Wait for it to finish, then try again.",idempotencyConflict:"That message was already delivered.",idempotencyInFlight:"That is still processing. Give it a moment.",conversationNotFound:"This conversation is no longer available.",petNotFound:"We could not find that pet. Please pick a pet and try again.",resourceNotFound:"We could not find that.",streamTimeout:"The response timed out. Tap retry to try again.",mediaUploadFailed:"We could not upload that photo. Please attach it again.",moderationBlocked:"This request cannot be answered here.",upstreamLlmTimeout:"The response timed out. Tap retry to try again.",internalError:"We hit a snag on our end. Please try again.",notImplemented:"That is not available yet.",serviceUnavailable:"That service is briefly unavailable. Try again shortly.",streamIncomplete:"The connection dropped mid-answer. Tap retry to continue.",identitySignatureRequired:ACCESS_DENIED_COPY,runtimeDisposed:VALIDATION_FAILED_COPY,unknown:"Something went wrong. Please try again."}),SESSION_REVOKED_COPY="This session has ended. Please sign in again.",LINKED_ACCOUNT_READ_ONLY="linked_account_read_only";function displayFor(code,wireCode,reasonCode){return code==="conflict"&&reasonCode===LINKED_ACCOUNT_READ_ONLY?ACCESS_DENIED_COPY:(code==="authRejected"||code==="authExpired")&&typeof wireCode=="string"&&wireCode.trim().toLowerCase()==="session_revoked"?SESSION_REVOKED_COPY:userFacingError(code)}function userFacingError(code){return USER_FACING_COPY[code]}function defineHidden(target,key,value){Object.defineProperty(target,key,{value:value,enumerable:false,writable:false,configurable:false})}var REASON_CODE_SHAPE=/^[a-z][a-z0-9_]{0,63}$/;function makeEverfurError(code,opts){let row=contractErrorFor(opts?.wireCode,opts?.wireEnvelope),linkedReadOnly=code==="conflict"&&opts?.reasonCode===LINKED_ACCOUNT_READ_ONLY,error={code:code,category:categoryFor(code),retryable:opts?.retryable??(linkedReadOnly?false:isRetryableCode(code)),displayMessage:displayFor(code,opts?.wireCode,linkedReadOnly?LINKED_ACCOUNT_READ_ONLY:null)};opts?.httpStatus!==void 0&&(error.httpStatus=opts.httpStatus),opts?.requestId&&(error.requestId=opts.requestId),typeof opts?.reasonCode=="string"&&REASON_CODE_SHAPE.test(opts.reasonCode)&&(error.reasonCode=opts.reasonCode);let wait=opts?.retryAfterSeconds;if(typeof wait=="number"&&Number.isFinite(wait)&&wait>=0&&(error.retryAfterSeconds=Math.round(wait)),row);return opts?.wireMessage&&defineHidden(error,"wireMessage",opts.wireMessage),opts?.raw!==void 0&&opts.raw!==null&&defineHidden(error,"raw",opts.raw),/* @__PURE__ */Object.freeze(error)}function assertNever(x){throw new Error(`assertNever: unhandled discriminated-union member ${JSON.stringify(x)}`)}function errorFrame(fields){/* @__PURE__ */
|
|
5
|
+
return Object.freeze({kind:"error",terminal:true,code:fields.code,retryable:fields.retryable,wireMessage:fields.wireMessage,synthesized:fields.synthesized,lastEventId:fields.lastEventId,serverRequestId:null})}function mintFailedError(cause,refusal){let message=cause instanceof Error?cause.message:typeof cause=="string"?cause:null;return makeEverfurError("authRejected",{retryable:false,...refusal?.wireCode?{wireCode:refusal.wireCode}:{},...refusal?.requestId?{requestId:refusal.requestId}:{},...message?{wireMessage:message}:{},...cause!=null?{raw:cause}:{}})}function authHeaders(auth){let headers={};return auth.mode==="personalized"?headers.authorization=`Bearer ${auth.token}`:headers["x-everfur-partner-key"]=auth.publishableKey,auth.userRef&&(headers["x-everfur-user-ref"]=auth.userRef),auth.sessionId&&(headers["x-everfur-session-id"]=auth.sessionId),headers}function withAuthHeaders(req,auth){return{...req,headers:{...stripAuthHeaders(req.headers),...authHeaders(auth)}}}function stripAuthHeaders(headers){if(!headers)return{};let out={};for(let[key,value]of Object.entries(headers)){let lower=key.toLowerCase();lower==="authorization"||lower==="x-everfur-partner-key"||(out[key]=value)}return out}async function authedSend(req,ctx){if(ctx.mode==="anonymous")return ctx.transport.request(withAuthHeaders(req,{mode:"anonymous",publishableKey:ctx.publishableKey,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));let token;try{token=await ctx.identity.currentToken()}catch(cause){return ctx.identity.reportRejected?.(),err(mintFailedError(cause))}let first=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:token,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));if(first.ok||first.error.httpStatus!==401)return first;let refreshed;try{refreshed=await ctx.identity.currentToken({forceRefresh:!0})}catch(cause){return ctx.identity.reportRejected?.(),err(mintFailedError(cause,{wireCode:wireCodeOf(first.error.raw),requestId:first.error.requestId}))}let retry=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:refreshed,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));return!retry.ok&&retry.error.httpStatus===401?(ctx.identity.reportRejected?.(),err(refusedAfterRemintError(retry.error))):retry}function refusedAfterRemintError(refusal){let raw=refusal.raw,wireCode=wireCodeOf(raw);return makeEverfurError("authRejected",{retryable:false,...refusal.httpStatus!==void 0?{httpStatus:refusal.httpStatus}:{},...refusal.requestId?{requestId:refusal.requestId}:{},...wireCode?{wireCode:wireCode}:{},...refusal.reasonCode?{reasonCode:refusal.reasonCode}:{},...refusal.wireMessage?{wireMessage:refusal.wireMessage}:{},...raw!=null?{raw:raw}:{}})}function wireCodeOf(body){if(typeof body!="object"||body===null)return null;let b=body,code=(typeof b.error=="object"&&b.error!==null?b.error.code:void 0)??b.code;return typeof code=="string"&&code.length>0?code:null}function parseUrl(raw,base3){let Url=globalThis.URL;if(typeof Url=="function"){let url;try{url=base3===void 0?new Url(raw):new Url(raw,base3)}catch{return null}try{if(url.protocol)return url}catch{}}return parseByPattern(raw)}var WHOLE_URL=/^([a-z][a-z0-9+.-]*):\/\/(?:([^:@/?#]*)(?::([^@/?#]*))?@)?(\[[0-9a-f:.]+\]|[\w.~-]+)(?::(\d*))?(\/[^?#]*)?(\?[^#]*)?(#.*)?$/i,REWRITTEN_BY_STANDARD_PARSER=/[\s\u0000-\u001f\u007f\\]/,DEFAULT_PORTS={"http:":"80","https:":"443"};function parseByPattern(raw,base3){let input=raw.trim();let match=REWRITTEN_BY_STANDARD_PARSER.test(input)?null:WHOLE_URL.exec(input);if(match===null)return null;let[,scheme="",username="",password="",host2="",portText="",path="",query="",fragment=""]=match,protocol=`${scheme.toLowerCase()}:`,portNumber=Number(portText);if(portNumber>65535)return null;let port=portText===""||String(portNumber)===DEFAULT_PORTS[protocol]?"":String(portNumber),special=DEFAULT_PORTS[protocol]!==void 0,hostPort=host2.toLowerCase()+(port&&`:${port}`),pathname=path||(special?"/":""),credentials=username||password?`${username}${password&&`:${password}`}@`:"";return{href:`${protocol}//${credentials}${hostPort}${pathname}${query}${fragment}`,protocol:protocol,username:username,password:password,hostname:host2.toLowerCase(),port:port,origin:special?`${protocol}//${hostPort}`:"null",pathname:pathname,search:query==="?"?"":query,hash:fragment==="#"?"":fragment}}function networkError(cause){return makeEverfurError("internalError",{retryable:true,wireMessage:describeCause(cause)})}function describeCause(cause){return cause instanceof Error?cause.message:typeof cause=="string"?cause:"network request failed"}var FUNNEL_UNARY_TIMEOUT_MS=3e4,RETRY_OVERRIDE_MAX_MS=BACKOFF_CAP_MS*2,IDEMPOTENCY_HEADER="idempotency-key",MUTATING_METHODS=/* @__PURE__ */new Set(["POST","PUT","PATCH","DELETE"]),NOOP_OBSERVER=/* @__PURE__ */Object.freeze({onEvent(){}}),defaultFunnelTimers=/* @__PURE__ */Object.freeze({setTimeout:(handler,ms)=>setTimeout(handler,ms),clearTimeout:handle=>clearTimeout(handle),now:()=>Date.now()});function seededIdempotencyKey(seed){let safe=seed.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return safe.length===0?null:`efs_${safe}`.slice(0,128)}function createRequestFunnel(deps){let observer=deps.observer??NOOP_OBSERVER,timers=deps.timers??defaultFunnelTimers,rng=deps.rng??Math.random,sleep=deps.sleep??((ms,signal)=>delayAbortable(ms,timers,signal)),ceiling=deps.maxAttempts??MAX_RETRY_ATTEMPTS,timeoutMs=deps.unaryTimeoutMs??FUNNEL_UNARY_TIMEOUT_MS,mintKey=deps.newIdempotencyKey??defaultIdempotencyKeyFactory(),emit=event=>{try{observer.onEvent(event)}catch{}};async function send(call,req,opts){let perCallMaxAttempts=opts?.maxAttempts,maxAttempts=Math.max(1,perCallMaxAttempts??ceiling),idempotent=opts?.idempotent??MUTATING_METHODS.has(req.method),seeded=opts?.idempotencyKey===void 0?null:seededIdempotencyKey(opts.idempotencyKey),idempotencyKey=idempotent?seeded??mintKey():null,base3=assembleHeaders(req,idempotencyKey),attempt=0;for(;;){let stamp=extra=>/* @__PURE__ */Object.freeze({call:call,method:req.method,path:req.path,attempt:attempt,...idempotencyKey?{idempotencyKey:idempotencyKey}:{},...extra});emit(stamp({phase:"attempt"}));let deadline=boundedSignal(timeoutMs,timers),merged=mergeSignals(deadline.signal,req.signal),settled;try{settled=await authedSend({...base3,signal:merged.signal},deps.auth)}catch(cause){settled=err(networkError(cause))}finally{merged.dispose(),deadline.cancel()}if(settled.ok)return emit(stamp({phase:"settled",ok:true,reason:"ok"})),settled;let error=settled.error,decision=decideRetry(error,attempt,{maxAttempts:maxAttempts,rng:rng,now:timers.now(),aborted:req.signal?.aborted===true,...perCallMaxAttempts!==void 0?{perCallMaxAttempts:perCallMaxAttempts}:{},...deps.errorPolicy!==void 0?{policy:deps.errorPolicy}:{}}),settledEvent={ok:false,code:error.code,reason:decision.reason,...error.httpStatus!==void 0?{httpStatus:error.httpStatus}:{},...error.requestId!==void 0?{requestId:error.requestId}:{}};if(!decision.retry)return emit(stamp({phase:"settled",...settledEvent})),err(error);if(emit(stamp({phase:"retry",...settledEvent,delayMs:decision.delayMs})),await sleep(decision.delayMs,req.signal),req.signal?.aborted===true)return emit(stamp({phase:"settled",...settledEvent,reason:"aborted"})),err(error);attempt+=1}}async function authorize(req){return withAuthHeaders(req,await resolveDeviceAuth(deps.auth))}async function*stream(call,req,signal){emit(
|
|
6
6
|
/* @__PURE__ */Object.freeze({call:call,phase:"stream.open",method:req.method,path:req.path,attempt:0}));try{yield*deps.auth.transport.stream(req,signal)}catch{yield errorFrame({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null})}}/* @__PURE__ */
|
|
7
7
|
return Object.freeze({send:send,authorize:authorize,stream:stream})}function assembleHeaders(req,idempotencyKey){let headers={};for(let[key,value]of Object.entries(req.headers??{}))key.toLowerCase()!==IDEMPOTENCY_HEADER&&(headers[key]=value);return idempotencyKey!==null&&(headers["Idempotency-Key"]=idempotencyKey),{...req,headers:headers}}function defaultIdempotencyKeyFactory(){let counter=0;return()=>`efk_${Date.now().toString(36)}_${(counter++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}var POLICY_MAX_ATTEMPTS_CAP=10;function decideRetry(error,attempt,ctx){if(ctx.aborted)return{retry:false,reason:"aborted"};let throttle=throttleKind(error);if(throttle==="quota")return{retry:false,reason:"daily-quota-exhausted"};if(throttle!=="burst"&&!isAutoRetryable(error.code))return{retry:false,reason:"terminal-code"};let reason=throttle==="burst"?"burst-throttle":"retryable-code";if((()=>{if(ctx.policy===void 0)return false;try{return!ctx.policy.shouldRetry(error.code,attempt)}catch{return false}})())return{retry:false,reason:"terminal-code"};let policyCeiling=()=>{if(ctx.policy===void 0)return null;let raw;try{raw=ctx.policy.maxAttempts(error.code)}catch{return null}return typeof raw!="number"||!Number.isFinite(raw)?null:Math.max(1,Math.min(POLICY_MAX_ATTEMPTS_CAP,Math.floor(raw)))},ceiling=ctx.perCallMaxAttempts??policyCeiling()??ctx.maxAttempts;if(attempt+1>=ceiling)return{retry:false,reason:"attempts-exhausted"};let override=retryOverrideMs(error,ctx.now);return override!==null?override>RETRY_OVERRIDE_MAX_MS?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:reason,delayMs:override}:{retry:true,reason:reason,delayMs:backoffDelayMs(attempt,ctx.rng)}}function throttleKind(error){let code=error.code==="unknown"?fromWire(rawWireCode(error.raw)):error.code;return code==="quotaExceeded"?"quota":code==="rateLimited"||error.httpStatus===429?"burst":null}function retryOverrideMs(error,now){let at=findResetsAt(error.raw);if(at!==null){let delta=at-now;return delta>0?delta:0}let wait=findRetryAfterSeconds(error.raw);return wait===null?null:Math.round(wait*1e3)}function findRetryAfterSeconds(raw){for(let scope of candidateScopes(raw)){let value=scope.retry_after_seconds;if(typeof value=="number"&&Number.isFinite(value)&&value>=0)return value}return null}function findResetsAt(raw){for(let scope of candidateScopes(raw)){let value=scope.resets_at,parsed=parseInstantMs(value);if(parsed!==null)return parsed}return null}function candidateScopes(raw){if(!isRecord(raw))return[];let out=[raw];for(let nested of["error","detail"]){let value=raw[nested];isRecord(value)&&out.push(value)}return out}function parseInstantMs(value){if(typeof value=="number"&&Number.isFinite(value))return value<1e11?Math.round(value*1e3):Math.round(value);if(typeof value=="string"&&value.trim().length>0){let parsed=Date.parse(value);return Number.isFinite(parsed)?parsed:null}return null}function rawWireCode(raw){for(let scope of candidateScopes(raw)){let code=scope.code;if(typeof code=="string"&&code.length>0)return code}return null}function isRecord(value){return typeof value=="object"&&value!==null}async function resolveDeviceAuth(auth){return auth.mode==="anonymous"?{mode:"anonymous",publishableKey:auth.publishableKey,userRef:auth.userRef,...auth.sessionId?{sessionId:auth.sessionId}:{}}:{mode:"personalized",token:await auth.identity.currentToken(),userRef:auth.userRef,...auth.sessionId?{sessionId:auth.sessionId}:{}}}function boundedSignal(ms,timers){let ctrl=new AbortController,handle=timers.setTimeout(()=>ctrl.abort(),ms);return{signal:ctrl.signal,cancel:()=>timers.clearTimeout(handle)}}function mergeSignals(deadline,caller){let noop=()=>{};if(!caller)return{signal:deadline,dispose:noop};let ctrl=new AbortController;if(deadline.aborted||caller.aborted)return ctrl.abort(),{signal:ctrl.signal,dispose:noop};let onAbort=()=>ctrl.abort();return deadline.addEventListener("abort",onAbort,{once:true}),caller.addEventListener("abort",onAbort,{once:true}),{signal:ctrl.signal,dispose:()=>{deadline.removeEventListener("abort",onAbort),caller.removeEventListener("abort",onAbort)}}}function delayAbortable(ms,timers,signal){return ms<=0||signal?.aborted===true?Promise.resolve():new Promise(resolve=>{let handle=timers.setTimeout(()=>{signal?.removeEventListener("abort",onAbort),resolve()},ms),onAbort=()=>{timers.clearTimeout(handle),resolve()};signal?.addEventListener("abort",onAbort,{once:true})})}function isNotFoundError(error){return error!=null&&(error.httpStatus===404||error.category==="notFound")}function plainNotFound(error){return error.code!=="conversationNotFound"?error:makeEverfurError("resourceNotFound",{retryable:false,...error.httpStatus===void 0?{}:{httpStatus:error.httpStatus},...error.requestId===void 0?{}:{requestId:error.requestId},...error.reasonCode===void 0?{}:{reasonCode:error.reasonCode},...error.wireMessage===void 0?{}:{wireMessage:error.wireMessage},...error.raw===void 0?{}:{raw:error.raw}})}function plainResult(res){return res.ok?res:err(plainNotFound(res.error))}function withPlainNotFound(funnel){return{send:async(...args)=>plainResult(await funnel.send(...args)),authorize:req=>funnel.authorize(req),stream:(call,req,signal)=>funnel.stream(call,req,signal)}}var HEALTH_PLAN_REASON_KINDS=/* @__PURE__ */Object.freeze(["dna","records","inside","profile"]),REF_MAX=128;function invalid(wireMessage){return makeEverfurError("validationFailed",{retryable:false,wireMessage:wireMessage})}function disposed(verb){return makeEverfurError("runtimeDisposed",{retryable:false,wireMessage:`the Everfur runtime is disposed; ${verb} was called after unmount`})}function malformed(call){return makeEverfurError("internalError",{retryable:false,httpStatus:502,wireMessage:`${call}: the response carried no plan`})}var str=(value,max=4e3)=>typeof value=="string"&&value.trim().length>0&&value.length<=max?value.trim():null;function httpsUrl(value){let s=str(value,2048);return s===null?null:/^https:\/\/[^\s]+$/i.test(s)?s:null}function priceOf(value){let n=typeof value=="number"?value:typeof value=="string"&&/^\d+(\.\d+)?$/.test(value.trim())?Number(value):Number.NaN;return Number.isFinite(n)&&n>=0?n:null}function currencyOf(value){return typeof value=="string"&&/^[A-Za-z]{3}$/.test(value)?value.toUpperCase():null}function reasonsOf(value){if(!Array.isArray(value))/* @__PURE__ */return Object.freeze([]);let out=[];for(let raw of value){if(raw===null||typeof raw!="object")continue;let o=raw,text2=str(o.text,1e3);if(text2===null)continue;let kind=typeof o.kind=="string"&&HEALTH_PLAN_REASON_KINDS.includes(o.kind)?o.kind:"profile";out.push(/* @__PURE__ */Object.freeze({kind:kind,text:text2}))}/* @__PURE__ */
|
|
8
8
|
return Object.freeze(out)}var DETAIL_ROWS=6;function boundOf(value){return typeof value=="number"&&Number.isFinite(value)&&value>=0&&value<=400?value:null}function rowsOf(value,each,max){if(!Array.isArray(value))/* @__PURE__ */return Object.freeze([]);let out=[];for(let raw of value){if(out.length>=max)break;if(raw===null||typeof raw!="object"||Array.isArray(raw))continue;let row=each(raw);row!==null&&out.push(row)}/* @__PURE__ */
|
|
9
9
|
return Object.freeze(out)}function titledOf(o){let title=str(o.title,80),body=str(o.body,600);return title===null||body===null?null:/* @__PURE__ */Object.freeze({title:title,body:body})}function healthPlanItemDetailOf(value){if(value===null||typeof value!="object"||Array.isArray(value))return;let o=value,gallery=[];if(Array.isArray(o.gallery))for(let g of o.gallery){let url=httpsUrl(g);url!==null&&gallery.length<DETAIL_ROWS&&gallery.push(url)}let doses=rowsOf(o.doses,d=>{let label=str(d.label,60),amount=str(d.amount,60);return label===null||amount===null?null:/* @__PURE__ */Object.freeze({label:label,amount:amount,minLb:boundOf(d.minLb??d.min_lb),maxLb:boundOf(d.maxLb??d.max_lb)})},DETAIL_ROWS),details=rowsOf(o.details,titledOf,DETAIL_ROWS),fitRaw=o.fit,fitRow=fitRaw!==null&&typeof fitRaw=="object"&&!Array.isArray(fitRaw)?titledOf(fitRaw):null,fit=fitRow!==null&&fitRaw.pet===true?/* @__PURE__ */Object.freeze({...fitRow,pet:true}):fitRow,detail=/* @__PURE__ */Object.freeze({kicker:str(o.kicker,80),gallery:/* @__PURE__ */Object.freeze(gallery),doses:doses,details:details,fine:str(o.fine,300),fit:fit});return detail.kicker===null&&gallery.length===0&&doses.length===0&&details.length===0&&detail.fine===null&&fit===null?void 0:detail}function factsOf(o){let rating=typeof o.rating=="number"&&Number.isFinite(o.rating)&&o.rating>=0&&o.rating<=5?Math.round(o.rating*10)/10:null,count=typeof o.review_count=="number"&&Number.isInteger(o.review_count)&&o.review_count>=0?o.review_count:null,reviews=rowsOf(o.reviews,r=>{let stars=typeof r.stars=="number"&&Number.isInteger(r.stars)&&r.stars>=1&&r.stars<=5?r.stars:null,text2=str(r.text,300),by=str(r.by,80);return stars===null||text2===null||by===null?null:/* @__PURE__ */Object.freeze({stars:stars,text:text2,by:by})},5),ingredients=[];if(Array.isArray(o.ingredients))for(let x of o.ingredients){let w=str(x,60);w!==null&&ingredients.length<12&&ingredients.push(w)}let detail=healthPlanItemDetailOf(o.detail);return{...rating===null?{}:{rating:rating},...count===null?{}:{reviewCount:count},...reviews.length===0?{}:{reviews:reviews},...ingredients.length===0?{}:{ingredients:/* @__PURE__ */Object.freeze(ingredients)},...detail===void 0?{}:{detail:detail}}}function itemOf(raw){if(raw===null||typeof raw!="object")return null;let o=raw,rawId=o.product_id,productId=typeof rawId=="number"&&Number.isInteger(rawId)?String(rawId):str(rawId,REF_MAX),title=str(o.title,300);return productId===null||title===null?null:/* @__PURE__ */Object.freeze({productId:productId,partnerSku:str(o.partner_sku,200),title:title,description:str(o.description),category:str(o.category,60),price:priceOf(o.price),currency:currencyOf(o.currency),imageUrl:httpsUrl(o.image_url),url:httpsUrl(o.url),reasons:reasonsOf(o.reasons),inPlan:o.in_plan===true,sample:o.sample===true,...factsOf(o)})}function healthPlanFromWire(raw,petRef){if(raw===null||typeof raw!="object")return null;let o=raw;if(!Array.isArray(o.items))return null;let items=[],seen=/* @__PURE__ */new Set;for(let row of o.items){let item=itemOf(row);item===null||seen.has(item.productId)||(seen.add(item.productId),items.push(item))}/* @__PURE__ */
|
|
10
10
|
return Object.freeze({petRef:str(o.pet_ref,REF_MAX)??petRef,headline:str(o.headline,300),items:/* @__PURE__ */Object.freeze(items),updatedAt:str(o.updated_at,64),...o.tracking_texts_enabled===true?{trackingTextsEnabled:true}:{}})}function validRef(value){return typeof value=="string"&&value.length>0&&value.length<=REF_MAX}function planPath(petRef){return`/widget/v1/pets/${encodeURIComponent(petRef)}/plan`}function createHealthPlanRepository(runtime){let over=()=>{let{services:services}=runtime.registry;return createHealthPlanRepositoryOver({auth:services.authFor(null),...services.errorPolicy?{errorPolicy:services.errorPolicy}:{}})};return{read:(petRef,opts)=>runtime.isDisposed?Promise.resolve(err(disposed("read"))):over().read(petRef,opts),addItem:(petRef,id)=>runtime.isDisposed?Promise.resolve(err(disposed("addItem"))):over().addItem(petRef,id),removeItem:(petRef,id)=>runtime.isDisposed?Promise.resolve(err(disposed("removeItem"))):over().removeItem(petRef,id)}}function createHealthPlanRepositoryOver(deps){let funnel=withPlainNotFound(deps.funnel??createRequestFunnel({auth:deps.auth,...deps.errorPolicy?{errorPolicy:deps.errorPolicy}:{}})),write2=async(method,petRef,productId)=>{if(!validRef(petRef))return err(invalid("petRef must be 1..128 characters"));if(!validRef(productId))return err(invalid("productId must be 1..128 characters"));let call=method==="PUT"?"healthPlan.item.add":"healthPlan.item.remove",res=await funnel.send(call,{method:method,path:`${planPath(petRef)}/items/${encodeURIComponent(productId)}`});return res.ok?res.value===null||res.value===void 0||res.value===""?ok(null):ok(healthPlanFromWire(res.value,petRef)):err(res.error)};return{async read(petRef,opts){if(!validRef(petRef))return err(invalid("petRef must be 1..128 characters"));let req={method:"GET",path:planPath(petRef),...opts?.signal?{signal:opts.signal}:{}},res=await funnel.send("healthPlan.read",req);if(!res.ok)return err(res.error);let plan=healthPlanFromWire(res.value,petRef);return plan===null?err(malformed("healthPlan.read")):ok(plan)},addItem:(petRef,productId)=>write2("PUT",petRef,productId),removeItem:(petRef,productId)=>write2("DELETE",petRef,productId)}}var IDLE=/* @__PURE__ */Object.freeze({phase:"idle",petRef:null,plan:null,pending:/* @__PURE__ */Object.freeze([]),itemErrors:/* @__PURE__ */Object.freeze({}),error:null});function withItem(plan,productId,inPlan){let items=plan.items.map(item=>item.productId===productId?/* @__PURE__ */Object.freeze({...item,inPlan:inPlan}):item);/* @__PURE__ */
|
|
11
|
-
return Object.freeze({...plan,items:/* @__PURE__ */Object.freeze(items)})}var HealthPlanController=class{constructor(repository){this.repository=repository;this.snapshot=IDLE;this.listeners=/* @__PURE__ */new Set;this.generation=0;this.writes=0;this.revalidations=0;this.refreshAfterWrites=false;this.disposed=false;this.subscribe=listener=>(this.listeners.add(listener),()=>{this.listeners.delete(listener)});this.getSnapshot=()=>this.snapshot}set(next){if(!this.disposed){this.snapshot=/* @__PURE__ */Object.freeze({...this.snapshot,...next});for(let listener of this.listeners)listener()}}async load(petRef){let gen=++this.generation;if(this.refreshAfterWrites=false,petRef===null){this.set({...IDLE});return}let samePet=this.snapshot.petRef===petRef;this.set({phase:"loading",petRef:petRef,plan:samePet?this.snapshot.plan:null,pending:/* @__PURE__ */Object.freeze([]),itemErrors:samePet?this.snapshot.itemErrors:/* @__PURE__ */Object.freeze({}),error:null});let result=await this.repository.read(petRef);if(gen===this.generation){if(!result.ok){this.set({phase:"failed",error:result.error});return}this.set({phase:"ready",plan:result.value,error:null,itemErrors:/* @__PURE__ */Object.freeze({})})}}async revalidate(){let{phase:phase,petRef:petRef,pending:pending}=this.snapshot;if(phase!=="ready"||petRef===null||pending.length>0)return;let gen=this.generation,writes=this.writes,seq=++this.revalidations,result=await this.repository.read(petRef);gen!==this.generation||writes!==this.writes||seq!==this.revalidations||this.snapshot.pending.length>0||this.snapshot.petRef!==petRef||result.ok&&this.set({plan:result.value,itemErrors:/* @__PURE__ */Object.freeze({})})}async refresh(){let{phase:phase,petRef:petRef,pending:pending}=this.snapshot;if(!(petRef===null||phase==="idle")){if(phase!=="ready")return this.load(petRef);if(pending.length>0){this.refreshAfterWrites=true;return}return this.revalidate()}}settleWrite(){!this.refreshAfterWrites||this.snapshot.pending.length>0||(this.refreshAfterWrites=false,this.revalidate())}async setInPlan(productId,inPlan){let{plan:plan,petRef:petRef,pending:pending}=this.snapshot;if(this.snapshot.phase!=="ready"||plan===null||petRef===null||pending.includes(productId))return false;let before=plan.items.find(item=>item.productId===productId);if(before===void 0||before.inPlan===inPlan)return false;this.writes+=1;let gen=this.generation,otherErrors=Object.fromEntries(Object.entries(this.snapshot.itemErrors).filter(([id])=>id!==productId));this.set({plan:withItem(plan,productId,inPlan),pending:/* @__PURE__ */Object.freeze([...pending,productId]),itemErrors:/* @__PURE__ */Object.freeze(otherErrors)});let result=inPlan?await this.repository.addItem(petRef,productId):await this.repository.removeItem(petRef,productId);if(gen!==this.generation)return result.ok;let current=this.snapshot.plan??plan,stillPending=/* @__PURE__ */Object.freeze(this.snapshot.pending.filter(id=>id!==productId));if(!result.ok)return this.set({plan:withItem(current,productId,before.inPlan),pending:stillPending,itemErrors:/* @__PURE__ */Object.freeze({...this.snapshot.itemErrors,[productId]:result.error})}),this.settleWrite(),false;let next=result.value??current;for(let id of stillPending){let mine=current.items.find(item=>item.productId===id);mine!==void 0&&(next=withItem(next,id,mine.inPlan))}return this.set({plan:next,pending:stillPending}),this.settleWrite(),true}dispose(){this.generation+=1,this.disposed=true,this.listeners.clear()}};function useScopedController(create,deps){let[controller,setController]=react.useState(create),adopted=react.useRef(false);return react.useEffect(()=>{let current=controller;return adopted.current&&(current=create(),setController(current)),adopted.current=true,()=>current.dispose()},deps),controller}function reportHostFailure(error){let globalConsole=globalThis.console;try{globalConsole?.error?.("[everfur] A host callback threw; the SDK ignored it.",error)}catch{}}function isThenable(value){return(typeof value=="object"||typeof value=="function")&&value!==null&&typeof value.then=="function"}function callHost(fn,...args){if(typeof fn=="function")try{let result=fn(...args);return isThenable(result)&&Promise.resolve(result).then(void 0,reportHostFailure),result}catch(error){reportHostFailure(error);return}}var GUARDED=/* @__PURE__ */new WeakMap;function guardHost(fn){if(typeof fn!="function")return;let cached=GUARDED.get(fn);if(cached!==void 0)return cached;let guarded=(...args)=>{callHost(fn,...args)};return GUARDED.set(fn,guarded),guarded}function guardHostProps(props,names){let guarded=null;for(let name of names){let fn=props[name];typeof fn=="function"&&(guarded??={...props},guarded[name]=guardHost(fn))}return guarded??props}var HEALTH_PLAN_STALE_MS=6e4;function useHealthPlanRevalidation({lifecycle:lifecycle,refreshKey:refreshKey,readyAt:readyAt,revalidate:revalidate,refresh:refresh,now:now=Date.now}){let latest=react.useRef({readyAt:readyAt,revalidate:revalidate,refresh:refresh??revalidate,now:now});latest.current={readyAt:readyAt,revalidate:revalidate,refresh:refresh??revalidate,now:now},react.useEffect(()=>{if(lifecycle==null)return;let stop=callHost(()=>lifecycle.onForeground(()=>{let{readyAt:at,revalidate:
|
|
11
|
+
return Object.freeze({...plan,items:/* @__PURE__ */Object.freeze(items)})}var HealthPlanController=class{constructor(repository){this.repository=repository;this.snapshot=IDLE;this.listeners=/* @__PURE__ */new Set;this.generation=0;this.writes=0;this.revalidations=0;this.refreshAfterWrites=false;this.disposed=false;this.subscribe=listener=>(this.listeners.add(listener),()=>{this.listeners.delete(listener)});this.getSnapshot=()=>this.snapshot}set(next){if(!this.disposed){this.snapshot=/* @__PURE__ */Object.freeze({...this.snapshot,...next});for(let listener of this.listeners)listener()}}async load(petRef){let gen=++this.generation;if(this.refreshAfterWrites=false,petRef===null){this.set({...IDLE});return}let samePet=this.snapshot.petRef===petRef;this.set({phase:"loading",petRef:petRef,plan:samePet?this.snapshot.plan:null,pending:/* @__PURE__ */Object.freeze([]),itemErrors:samePet?this.snapshot.itemErrors:/* @__PURE__ */Object.freeze({}),error:null});let result=await this.repository.read(petRef);if(gen===this.generation){if(!result.ok){this.set({phase:"failed",error:result.error});return}this.set({phase:"ready",plan:result.value,error:null,itemErrors:/* @__PURE__ */Object.freeze({})})}}async revalidate(){let{phase:phase,petRef:petRef,pending:pending}=this.snapshot;if(phase!=="ready"||petRef===null||pending.length>0)return;let gen=this.generation,writes=this.writes,seq=++this.revalidations,result=await this.repository.read(petRef);gen!==this.generation||writes!==this.writes||seq!==this.revalidations||this.snapshot.pending.length>0||this.snapshot.petRef!==petRef||result.ok&&this.set({plan:result.value,itemErrors:/* @__PURE__ */Object.freeze({})})}async refresh(){let{phase:phase,petRef:petRef,pending:pending}=this.snapshot;if(!(petRef===null||phase==="idle")){if(phase!=="ready")return this.load(petRef);if(pending.length>0){this.refreshAfterWrites=true;return}return this.revalidate()}}settleWrite(){!this.refreshAfterWrites||this.snapshot.pending.length>0||(this.refreshAfterWrites=false,this.revalidate())}async setInPlan(productId,inPlan){let{plan:plan,petRef:petRef,pending:pending}=this.snapshot;if(this.snapshot.phase!=="ready"||plan===null||petRef===null||pending.includes(productId))return false;let before=plan.items.find(item=>item.productId===productId);if(before===void 0||before.inPlan===inPlan)return false;this.writes+=1;let gen=this.generation,otherErrors=Object.fromEntries(Object.entries(this.snapshot.itemErrors).filter(([id])=>id!==productId));this.set({plan:withItem(plan,productId,inPlan),pending:/* @__PURE__ */Object.freeze([...pending,productId]),itemErrors:/* @__PURE__ */Object.freeze(otherErrors)});let result=inPlan?await this.repository.addItem(petRef,productId):await this.repository.removeItem(petRef,productId);if(gen!==this.generation)return result.ok;let current=this.snapshot.plan??plan,stillPending=/* @__PURE__ */Object.freeze(this.snapshot.pending.filter(id=>id!==productId));if(!result.ok)return this.set({plan:withItem(current,productId,before.inPlan),pending:stillPending,itemErrors:/* @__PURE__ */Object.freeze({...this.snapshot.itemErrors,[productId]:result.error})}),this.settleWrite(),false;let next=result.value??current;for(let id of stillPending){let mine=current.items.find(item=>item.productId===id);mine!==void 0&&(next=withItem(next,id,mine.inPlan))}return this.set({plan:next,pending:stillPending}),this.settleWrite(),true}dispose(){this.generation+=1,this.disposed=true,this.listeners.clear()}};function useScopedController(create,deps){let[controller,setController]=react.useState(create),adopted=react.useRef(false);return react.useEffect(()=>{let current=controller;return adopted.current&&(current=create(),setController(current)),adopted.current=true,()=>current.dispose()},deps),controller}function reportHostFailure(error){let globalConsole=globalThis.console;try{globalConsole?.error?.("[everfur] A host callback threw; the SDK ignored it.",error)}catch{}}function isThenable(value){return(typeof value=="object"||typeof value=="function")&&value!==null&&typeof value.then=="function"}function callHost(fn,...args){if(typeof fn=="function")try{let result=fn(...args);return isThenable(result)&&Promise.resolve(result).then(void 0,reportHostFailure),result}catch(error){reportHostFailure(error);return}}var GUARDED=/* @__PURE__ */new WeakMap;function guardHost(fn){if(typeof fn!="function")return;let cached=GUARDED.get(fn);if(cached!==void 0)return cached;let guarded=(...args)=>{callHost(fn,...args)};return GUARDED.set(fn,guarded),guarded}function guardHostProps(props,names){let guarded=null;for(let name of names){let fn=props[name];typeof fn=="function"&&(guarded??={...props},guarded[name]=guardHost(fn))}return guarded??props}var HEALTH_PLAN_STALE_MS=6e4;function useHealthPlanRevalidation({lifecycle:lifecycle,refreshKey:refreshKey,readyAt:readyAt,revalidate:revalidate,refresh:refresh,now:now=Date.now}){let latest=react.useRef({readyAt:readyAt,revalidate:revalidate,refresh:refresh??revalidate,now:now});latest.current={readyAt:readyAt,revalidate:revalidate,refresh:refresh??revalidate,now:now},react.useEffect(()=>{if(lifecycle==null)return;let stop=callHost(()=>lifecycle.onForeground(()=>{let{readyAt:at,revalidate:run3,now:clock}=latest.current;at!==null&&clock()-at>=HEALTH_PLAN_STALE_MS&&run3()}));return()=>{typeof stop=="function"&&callHost(stop)}},[lifecycle]);let seenKey=react.useRef(refreshKey);react.useEffect(()=>{Object.is(seenKey.current,refreshKey)||(seenKey.current=refreshKey,latest.current.refresh())},[refreshKey])}function healthPlanCart(plan){let items=/* @__PURE__ */Object.freeze((plan?.items??[]).filter(item=>item.inPlan));if(items.length===0)/* @__PURE__ */return Object.freeze({items:items,count:0,subtotal:null,currency:null});let currencies=new Set(items.map(item=>item.currency));if(!items.every(item=>item.price!==null)||currencies.size!==1)/* @__PURE__ */return Object.freeze({items:items,count:items.length,subtotal:null,currency:null});let cents=items.reduce((sum,item)=>sum+Math.round(item.price*100),0);/* @__PURE__ */
|
|
12
12
|
return Object.freeze({items:items,count:items.length,subtotal:cents/100,currency:items[0]?.currency??null})}function formatHealthPlanPrice(amount,currency,locale,format){if(amount===null||currency===null||!Number.isFinite(amount))return null;let whole=format?.dropZeroCents===true&&Number.isInteger(amount);try{return new Intl.NumberFormat(locale,{style:"currency",currency:currency,...whole?{minimumFractionDigits:0,maximumFractionDigits:0}:{}}).format(amount)}catch{return`${currency} ${whole?String(amount):amount.toFixed(2)}`}}function formatHealthPlanPriceWith(amount,currency,format){return formatHealthPlanPrice(amount,currency,format?.locale,format)}function useEverfurHealthPlanRepository(){let{runtime:runtime}=useEverfurContext();return react.useMemo(()=>createHealthPlanRepository(runtime),[runtime])}function useEverfurHealthPlan(options){let{userRef:userRef,activePet:activePet,scopeEpoch:scopeEpoch}=useEverfurContext(),repository=useEverfurHealthPlanRepository(),petRef=options?.petRef??activePet??null,controller=useScopedController(()=>new HealthPlanController(repository),[repository,userRef,scopeEpoch]);react.useEffect(()=>{controller.load(userRef===null?null:petRef)},[controller,userRef,petRef]);let snapshot=react.useSyncExternalStore(controller.subscribe,controller.getSnapshot,controller.getSnapshot),cart=react.useMemo(()=>healthPlanCart(snapshot.plan),[snapshot.plan]),[readyAt,setReadyAt]=react.useState(null);react.useEffect(()=>{setReadyAt(snapshot.phase==="ready"&&snapshot.plan!==null?Date.now():null)},[snapshot.phase,snapshot.plan]),useHealthPlanRevalidation({lifecycle:options?.lifecycle,refreshKey:options?.refreshKey,readyAt:readyAt,revalidate:()=>{controller.revalidate()},refresh:()=>{controller.refresh()}});let status;return userRef===null?status="signedOut":petRef===null?status="noPet":snapshot.petRef!==petRef||snapshot.phase==="idle"||snapshot.phase==="loading"?status="loading":snapshot.phase==="failed"?status=isNotFoundError(snapshot.error)?"empty":"failed":status=(snapshot.plan?.items.length??0)===0?"empty":"ready",react.useMemo(()=>({status:status,petRef:petRef,plan:snapshot.petRef===petRef?snapshot.plan:null,cart:cart,pending:snapshot.pending,itemErrors:snapshot.itemErrors,error:status==="empty"?null:snapshot.error,setInPlan:(productId,inPlan)=>controller.setInPlan(productId,inPlan),refresh:()=>controller.load(userRef===null?null:petRef)}),[status,petRef,snapshot,cart,controller,userRef])}var REF_MAX2=128,DATE=/^\d{4}-\d{2}-\d{2}$/,STEPS=/* @__PURE__ */new Set(["first_box_ships","checkin","refill_reminder","next_box_ships"]);function isHealthPlanSubscriptionUnavailable(error){return error!=null&&(error.httpStatus===404||error.category==="notFound")}var str2=(value,max=300)=>typeof value=="string"&&value.trim().length>0&&value.length<=max?value.trim():null;function money(value){let n=typeof value=="number"?value:typeof value=="string"&&/^\d+(\.\d+)?$/.test(value.trim())?Number(value):Number.NaN;return Number.isFinite(n)&&n>=0?n:null}function int(value){return typeof value=="number"&&Number.isInteger(value)&&value>0?value:null}function idOf(value){return typeof value=="number"&&Number.isInteger(value)?String(value):str2(value,REF_MAX2)}function currencyOf2(value){return typeof value=="string"&&/^[A-Za-z]{3}$/.test(value)?value.toUpperCase():null}function dateOf(value){return typeof value=="string"&&DATE.test(value)?value:null}function intervalsOf(value){return Array.isArray(value)?/* @__PURE__ */Object.freeze(value.map(int).filter(n=>n!==null)):/* @__PURE__ */Object.freeze([])}function renewalOf(value){if(value===null||typeof value!="object")return null;let o=value,amount=money(o.amount),currency=currencyOf2(o.currency),intervalDays=int(o.interval_days);return amount===null||currency===null||intervalDays===null?null:/* @__PURE__ */Object.freeze({amount:amount,currency:currency,intervalDays:intervalDays})}function timelineOf(value){if(!Array.isArray(value))/* @__PURE__ */return Object.freeze([]);let out=[];for(let raw of value){if(raw===null||typeof raw!="object")continue;let o=raw,on=dateOf(o.on);typeof o.step!="string"||!STEPS.has(o.step)||on===null||out.push(/* @__PURE__ */Object.freeze({step:o.step,on:on}))}/* @__PURE__ */
|
|
13
13
|
return Object.freeze(out)}function healthPlanSubscriptionFromWire(raw){if(raw===null||typeof raw!="object")return null;let o=raw,subscriptionId=idOf(o.subscription_id),productId=idOf(o.product_id),status=o.status==="active"||o.status==="cancelled"?o.status:null,intervalDays=int(o.interval_days),currency=currencyOf2(o.currency),boxPrice=money(o.box_price);if(subscriptionId===null||productId===null||status===null||intervalDays===null||currency===null||boxPrice===null)return null;let options=intervalsOf(o.interval_options);/* @__PURE__ */
|
|
14
|
-
return Object.freeze({subscriptionId:subscriptionId,productId:productId,title:str2(o.title),status:status,intervalDays:intervalDays,intervalOptions:options.length>0?options:/* @__PURE__ */Object.freeze([intervalDays]),currency:currency,boxPrice:boxPrice,firstBoxPrice:money(o.first_box_price)??boxPrice,offerApplied:o.offer_applied===true,nextBoxDate:status==="active"?dateOf(o.next_box_date):null,renewal:renewalOf(o.renewal),timeline:status==="active"?timelineOf(o.timeline):/* @__PURE__ */Object.freeze([])})}function healthPlanOneBoxOrderFromWire(raw){if(raw===null||typeof raw!="object")return null;let o=raw,orderId=idOf(o.order_id),productId=idOf(o.product_id),currency=currencyOf2(o.currency),
|
|
15
|
-
return Object.freeze({orderId:orderId,productId:productId,title:str2(o.title),currency:currency,boxPrice:money(o.box_price)??
|
|
14
|
+
return Object.freeze({subscriptionId:subscriptionId,productId:productId,title:str2(o.title),status:status,intervalDays:intervalDays,intervalOptions:options.length>0?options:/* @__PURE__ */Object.freeze([intervalDays]),currency:currency,boxPrice:boxPrice,firstBoxPrice:money(o.first_box_price)??boxPrice,offerApplied:o.offer_applied===true,nextBoxDate:status==="active"?dateOf(o.next_box_date):null,renewal:renewalOf(o.renewal),timeline:status==="active"?timelineOf(o.timeline):/* @__PURE__ */Object.freeze([])})}function healthPlanOneBoxOrderFromWire(raw){if(raw===null||typeof raw!="object")return null;let o=raw,orderId=idOf(o.order_id),productId=idOf(o.product_id),currency=currencyOf2(o.currency),price2=money(o.price);if(orderId===null||productId===null||currency===null||price2===null)return null;let quantity=int(o.quantity),qty=quantity!==null&&quantity<=QUANTITY_MAX?quantity:1;/* @__PURE__ */
|
|
15
|
+
return Object.freeze({orderId:orderId,productId:productId,title:str2(o.title),currency:currency,boxPrice:money(o.box_price)??price2,price:price2,discountPercent:int(o.discount_percent)??0,shipsOn:dateOf(o.ships_on),createdAt:instantOf(o.created_at),quantity:qty,total:money(o.total)??Math.round(price2*qty*100)/100,...trackingOf(o.tracking)})}var QUANTITY_MAX=10,TRACKING_STATUSES=/* @__PURE__ */new Set(["ordered","shipped","delivered"]),UNSAFE_TEXT=/[\u0000-\u001f\u007f\u202a-\u202e\u2066-\u2069]/;function trackingText(value,max){if(typeof value!="string"||UNSAFE_TEXT.test(value))return null;let v=value.trim();return v.length>0&&v.length<=max?v:null}function trackingUrlOf(value){return typeof value!="string"||value.length>2048||UNSAFE_TEXT.test(value)||/[\s@]/.test(value)||!/^https:\/\/[^/]/i.test(value)?null:parseUrl(value)?.protocol==="https:"?value:null}function healthPlanOrderTrackingFromWire(raw){if(raw===null||typeof raw!="object"||Array.isArray(raw))return null;let o=raw,status=typeof o.status=="string"&&TRACKING_STATUSES.has(o.status)?o.status:"ordered";/* @__PURE__ */
|
|
16
16
|
return Object.freeze({status:status,orderNumber:trackingText(o.order_number,64),carrier:trackingText(o.carrier,64),trackingNumber:trackingText(o.tracking_number,128),trackingUrl:trackingUrlOf(o.tracking_url),shippedAt:instantOf(o.shipped_at),estimatedDelivery:dateOf(o.estimated_delivery),updatedAt:instantOf(o.updated_at)})}function trackingOf(raw){let t=healthPlanOrderTrackingFromWire(raw);return t===null?{}:{tracking:t}}function healthPlanOneBoxOrderPageFromWire(raw){let rows=raw!==null&&typeof raw=="object"?raw.orders:null;if(!Array.isArray(rows))return null;let cursor=raw.next_cursor;/* @__PURE__ */
|
|
17
|
-
return Object.freeze({orders:/* @__PURE__ */Object.freeze(rows.map(healthPlanOneBoxOrderFromWire).filter(x=>x!==null)),nextCursor:typeof cursor=="string"&&cursor.length>0&&cursor.length<=REF_MAX2?cursor:null})}function instantOf(value){return typeof value!="string"||value.length>40||!/^\d{4}-\d{2}-\d{2}T/.test(value)||Number.isNaN(Date.parse(value))?null:value}function oneBoxOf(value,boxPrice){if(value===null||typeof value!="object")return null;let o=value,
|
|
17
|
+
return Object.freeze({orders:/* @__PURE__ */Object.freeze(rows.map(healthPlanOneBoxOrderFromWire).filter(x=>x!==null)),nextCursor:typeof cursor=="string"&&cursor.length>0&&cursor.length<=REF_MAX2?cursor:null})}function instantOf(value){return typeof value!="string"||value.length>40||!/^\d{4}-\d{2}-\d{2}T/.test(value)||Number.isNaN(Date.parse(value))?null:value}function oneBoxOf(value,boxPrice){if(value===null||typeof value!="object")return null;let o=value,price2=money(o.price);return price2===null||price2>boxPrice?null:/* @__PURE__ */Object.freeze({price:price2,discountPercent:int(o.discount_percent)??0})}function healthPlanSubscriptionQuoteFromWire(raw){if(raw===null||typeof raw!="object")return null;let o=raw,productId=idOf(o.product_id),currency=currencyOf2(o.currency),boxPrice=money(o.box_price),options=intervalsOf(o.interval_options);if(productId===null||currency===null||boxPrice===null||options.length===0)return null;let offerApplies=o.offer_applies===true,def=int(o.default_interval_days),s=o.supply,supply=null;if(s!==null&&typeof s=="object"){let so=s,unitsPerBox=int(so.units_per_box),unitsPerDay=money(so.units_per_day),supplyDays=int(so.supply_days);unitsPerBox!==null&&unitsPerDay!==null&&supplyDays!==null&&(supply=/* @__PURE__ */Object.freeze({unitsPerBox:unitsPerBox,unitLabel:str2(so.unit_label,30),unitsPerDay:unitsPerDay,supplyDays:supplyDays,doseBasis:so.dose_basis==="weight"?"weight":"assumed"}))}let pct=int(o.first_box_discount_percent)??0;/* @__PURE__ */
|
|
18
18
|
return Object.freeze({productId:productId,currency:currency,boxPrice:boxPrice,firstBoxPrice:offerApplies?money(o.first_box_price)??boxPrice:boxPrice,firstBoxDiscountPercent:offerApplies?pct:0,offerApplies:offerApplies,oneBox:oneBoxOf(o.one_box,boxPrice),intervalOptions:options,defaultIntervalDays:def!==null&&options.includes(def)?def:options[0],supply:supply,firstBoxShipsOn:dateOf(o.first_box_ships_on),subscription:healthPlanSubscriptionFromWire(o.subscription)})}function invalid2(wireMessage){return makeEverfurError("validationFailed",{retryable:false,wireMessage:wireMessage})}function malformed2(call){return makeEverfurError("internalError",{retryable:false,httpStatus:502,wireMessage:`${call}: the response carried no subscription`})}function disposed2(verb){return makeEverfurError("runtimeDisposed",{retryable:false,wireMessage:`the Everfur runtime is disposed; ${verb} was called after unmount`})}var validRef2=value=>typeof value=="string"&&value.length>0&&value.length<=REF_MAX2;function base(petRef){return`/widget/v1/pets/${encodeURIComponent(petRef)}/plan/subscriptions`}function createHealthPlanSubscriptionRepositoryOver(deps){let funnel=withPlainNotFound(deps.funnel??createRequestFunnel({auth:deps.auth,...deps.errorPolicy?{errorPolicy:deps.errorPolicy}:{}})),one2=async(call,petRef,method,suffix,body)=>{if(!validRef2(petRef))return err(invalid2("petRef must be 1..128 characters"));let res=await funnel.send(call,{method:method,path:`${base(petRef)}${suffix}`,...body===void 0?{}:{body:body}});if(!res.ok)return err(res.error);let sub=healthPlanSubscriptionFromWire(res.value);return sub===null?err(malformed2(call)):ok(sub)},idSuffix=(id,tail="")=>validRef2(id)?`/${encodeURIComponent(id)}${tail}`:null;return{async quote(petRef,productId){if(!validRef2(petRef))return err(invalid2("petRef must be 1..128 characters"));if(!validRef2(productId))return err(invalid2("productId must be 1..128 characters"));let res=await funnel.send("healthPlan.subscription.quote",{method:"GET",path:`${base(petRef)}/quote`,query:{product_id:productId}});if(!res.ok)return err(res.error);let quote=healthPlanSubscriptionQuoteFromWire(res.value);return quote===null?err(malformed2("healthPlan.subscription.quote")):ok(quote)},async list(petRef){if(!validRef2(petRef))return err(invalid2("petRef must be 1..128 characters"));let res=await funnel.send("healthPlan.subscription.list",{method:"GET",path:base(petRef)});if(!res.ok)return err(res.error);let rows=res.value!==null&&typeof res.value=="object"?res.value.subscriptions:null;return Array.isArray(rows)?ok(/* @__PURE__ */Object.freeze(rows.map(healthPlanSubscriptionFromWire).filter(s=>s!==null))):err(malformed2("healthPlan.subscription.list"))},create(petRef,productId,intervalDays){return validRef2(productId)?one2("healthPlan.subscription.create",petRef,"POST","",{product_id:productId,...intervalDays===void 0?{}:{interval_days:intervalDays}}):Promise.resolve(err(invalid2("productId must be 1..128 characters")))},changeInterval(petRef,id,intervalDays){let s=idSuffix(id);return s===null?Promise.resolve(err(invalid2("subscriptionId must be 1..128 characters"))):one2("healthPlan.subscription.interval",petRef,"PATCH",s,{interval_days:intervalDays})},skip(petRef,id){let s=idSuffix(id,"/skip");return s===null?Promise.resolve(err(invalid2("subscriptionId must be 1..128 characters"))):one2("healthPlan.subscription.skip",petRef,"POST",s,{})},cancel(petRef,id){let s=idSuffix(id,"/cancel");return s===null?Promise.resolve(err(invalid2("subscriptionId must be 1..128 characters"))):one2("healthPlan.subscription.cancel",petRef,"POST",s,{})},restart(petRef,id,intervalDays){let s=idSuffix(id,"/restart");return s===null?Promise.resolve(err(invalid2("subscriptionId must be 1..128 characters"))):one2("healthPlan.subscription.restart",petRef,"POST",s,intervalDays===void 0?{}:{interval_days:intervalDays})},async buyOneBox(petRef,productId,tapKey){if(!validRef2(petRef))return err(invalid2("petRef must be 1..128 characters"));if(!validRef2(productId))return err(invalid2("productId must be 1..128 characters"));let res=await funnel.send("healthPlan.subscription.oneBox",{method:"POST",path:`${base(petRef)}/one-box`,body:{product_id:productId}},{idempotent:true,...tapKey===void 0?{}:{idempotencyKey:`hp-one-box:${tapKey}`}});if(!res.ok)return err(res.error);let order=healthPlanOneBoxOrderFromWire(res.value);return order===null?err(malformed2("healthPlan.subscription.oneBox")):ok(order)},async listOneBoxOrders(petRef){if(!validRef2(petRef))return err(invalid2("petRef must be 1..128 characters"));let res=await funnel.send("healthPlan.subscription.oneBoxList",{method:"GET",path:`${base(petRef)}/one-box`});if(!res.ok)return err(res.error);let page=healthPlanOneBoxOrderPageFromWire(res.value);return page===null?err(malformed2("healthPlan.subscription.oneBoxList")):ok(page.orders)},async listOneBoxOrderPage(petRef,opts){if(!validRef2(petRef))return err(invalid2("petRef must be 1..128 characters"));let limit=opts?.limit;if(limit!==void 0&&!(Number.isInteger(limit)&&limit>=1&&limit<=50))return err(invalid2("limit must be a whole number 1..50"));if(opts?.cursor!==void 0&&!validRef2(opts.cursor))return err(invalid2("cursor must be 1..128 characters"));let query={...limit!==void 0?{limit:String(limit)}:{},...opts?.cursor!==void 0?{cursor:opts.cursor}:{}},res=await funnel.send("healthPlan.subscription.oneBoxList",{method:"GET",path:`${base(petRef)}/one-box`,query:query});if(!res.ok)return err(res.error);let page=healthPlanOneBoxOrderPageFromWire(res.value);return page===null?err(malformed2("healthPlan.subscription.oneBoxList")):ok(page)}}}function createHealthPlanSubscriptionRepository(runtime){let over=()=>{let{services:services}=runtime.registry;return createHealthPlanSubscriptionRepositoryOver({auth:services.authFor(null),...services.errorPolicy?{errorPolicy:services.errorPolicy}:{}})},guard=(verb,f)=>(...a)=>runtime.isDisposed?Promise.resolve(err(disposed2(verb))):f(over(),...a);return{quote:guard("quote",(r,p,id)=>r.quote(p,id)),list:guard("list",(r,p)=>r.list(p)),create:guard("create",(r,p,id,n)=>r.create(p,id,n)),changeInterval:guard("changeInterval",(r,p,id,n)=>r.changeInterval(p,id,n)),skip:guard("skip",(r,p,id)=>r.skip(p,id)),cancel:guard("cancel",(r,p,id)=>r.cancel(p,id)),restart:guard("restart",(r,p,id,n)=>r.restart(p,id,n)),buyOneBox:guard("buyOneBox",(r,p,id,k2)=>r.buyOneBox(p,id,k2)),listOneBoxOrders:guard("listOneBoxOrders",(r,p)=>r.listOneBoxOrders(p)),listOneBoxOrderPage:guard("listOneBoxOrderPage",(r,p,o)=>r.listOneBoxOrderPage(p,o))}}var REFUSALS=/* @__PURE__ */new Set(["cart_disabled","cart_has_subscription","cart_currency_mixed","sample_product","partner_endpoint_missing","checkout_pending","already_subscribed"]);function healthPlanCheckoutRefusal(error){if(error==null||error.httpStatus!==409)return null;let raw=obj(error.raw);for(let candidate of[error.reasonCode,error.wireMessage,raw?.detail,raw?.message,raw?.reason_code])if(typeof candidate=="string"&&REFUSALS.has(candidate.trim()))return candidate.trim();return null}var REF_MAX3=128,CART_MAX=10,ICONS=/* @__PURE__ */new Set(["shield","arrow","check","star","truck","refresh","card","alert","x","chat","repeat","calendar","flame","box","cart","minus","plus","chev","pulse","file","kit","dna","heart","bottle","harness","ramp"]),TONES=/* @__PURE__ */new Set(["y","c","g","r"]),TRACK_STATES=/* @__PURE__ */new Set(["done","now","next"]),obj=value=>value!==null&&typeof value=="object"&&!Array.isArray(value)?value:null,str3=(value,max=1e3)=>typeof value=="string"&&value.trim().length>0&&value.length<=max?value.trim():null,kindOf=value=>typeof value=="string"&&/^[A-Za-z0-9_-]{1,40}$/.test(value)?value:null,iconOf=value=>typeof value=="string"&&ICONS.has(value)?value:null;function imageOf(value){let s=str3(value,2048);return s===null||/\s/.test(s)?null:/^https:\/\/[^/]/i.test(s)||/^\/(?![/\\])/.test(s)?s:null}var idOf2=value=>typeof value=="number"&&Number.isInteger(value)?String(value):str3(value,REF_MAX3);function weightOf(value){return typeof value=="number"&&Number.isFinite(value)&&value>0?value:null}function clean(fields){/* @__PURE__ */
|
|
19
19
|
return Object.freeze(Object.fromEntries(Object.entries(fields).filter(([,v])=>v!=null)))}function listOf(value,each,max=20){if(!Array.isArray(value))return null;let out=[];for(let row of value){if(out.length>=max)break;let mapped2=each(row);mapped2!==null&&out.push(mapped2)}return out.length===0?null:/* @__PURE__ */Object.freeze(out)}var words=(value,max=12,len=300)=>listOf(value,v=>str3(v,len),max);function focusOf(value){let o=obj(value),kicker=str3(o?.kicker,120),title=str3(o?.title,300);if(o===null||kicker===null||title===null)return null;let risk=obj(o.risk),odds=obj(o.odds),quote=obj(o.quote),jump=obj(o.jump);return clean({kicker:kicker,title:title,sources:listOf(o.sources,r=>{let label=str3(obj(r)?.label,60);return label===null?null:clean({label:label,kind:kindOf(obj(r)?.kind)})},6),risk:str3(risk?.lead,300)===null?null:clean({lead:str3(risk?.lead,300),body:str3(risk?.body),kind:kindOf(risk?.kind)}),odds:str3(odds?.label,120)===null||str3(odds?.from,20)===null||str3(odds?.to,20)===null?null:clean({label:str3(odds?.label,120),tag:str3(odds?.tag,40),from:str3(odds?.from,20),to:str3(odds?.to,20),toLabel:str3(odds?.toLabel,120)}),quote:str3(quote?.text)===null?null:clean({kicker:str3(quote?.kicker,120),tag:str3(quote?.tag,40),text:str3(quote?.text)}),jump:str3(jump?.title,300)===null||str3(jump?.go,60)===null?null:clean({title:str3(jump?.title,300),go:str3(jump?.go,60)}),report:reportOf(o.report)})}function reportOf(value){let o=obj(value),label=str3(o?.label,120),text2=str3(o?.text,1200);return label===null||text2===null?null:clean({label:label,text:text2,actions:words(o?.actions,5,300)})}function routineOf(value){let o=obj(value),title=str3(o?.title,300),steps=listOf(o?.steps,r=>{let s=obj(r),t=str3(s?.title,300),tone=s?.tone;return t===null?null:clean({title:t,body:str3(s?.body),source:str3(s?.source,200),tone:typeof tone=="string"&&TONES.has(tone)?tone:null,icon:iconOf(s?.icon),fromVet:s?.fromVet===true?true:null})});return title===null||steps===null?null:clean({title:title,label:str3(o?.label,60),steps:steps})}function pickOf(value){let o=obj(value),title=str3(o?.title,300);if(o===null||title===null)return null;let rating=obj(o.rating),reviews=obj(o.reviews),why=obj(o.why),score=obj(why?.score),dose=obj(o.dose),ingredients=obj(o.ingredients),reviewItems=listOf(reviews?.items,r=>{let v=obj(r),stars=v?.stars,text2=str3(v?.text),by=str3(v?.by,80);return typeof stars!="number"||!Number.isFinite(stars)||stars<1||stars>5||text2===null||by===null?null:clean({stars:Math.round(stars),text:text2,by:by})},5),whyRows=listOf(why?.rows,r=>{let v=obj(r),chip=str3(v?.chip,40),t=str3(v?.title,300);return chip===null||t===null?null:clean({chip:chip,kind:kindOf(v?.kind),title:t,body:str3(v?.body)})}),stats=listOf(dose?.stats,r=>{let v=obj(r),val=str3(v?.value,40),label=str3(v?.label,120),kind=v?.kind;return val===null||label===null?null:clean({value:val,label:label,kind:kind==="weight"||kind==="dose"||kind==="days"?kind:null})},6),ingredientItems=words(ingredients?.items,12,80);return clean({title:title,none:o.none===true?true:null,hidden:o.none===true&&o.hidden===true?true:null,productId:idOf2(o.productId),partnerSku:str3(o.partnerSku,200),rating:str3(rating?.value,20)===null?null:clean({value:str3(rating?.value,20),label:str3(rating?.label,120)}),line:str3(o.line),reviews:str3(reviews?.label,200)===null||reviewItems===null?null:clean({label:str3(reviews?.label,200),items:reviewItems}),checkoutLine:str3(o.checkoutLine,300),why:str3(why?.title,200)===null||whyRows===null?null:clean({title:str3(why?.title,200),rows:whyRows,score:str3(score?.text,200)===null||str3(score?.value,20)===null?null:clean({text:str3(score?.text,200),value:str3(score?.value,20)})}),dose:str3(dose?.title,200)===null||stats===null?null:clean({title:str3(dose?.title,200),stats:stats,note:str3(dose?.note)}),doseLabel:str3(o.doseLabel,120),ingredients:ingredientItems===null?null:clean({label:str3(ingredients?.label,200),items:ingredientItems}),proof:str3(o.proof,300),trust:listOf(o.trust,r=>{let v=obj(r),icon=iconOf(v?.icon),label=str3(v?.label,120);return icon===null||label===null?null:clean({icon:icon,label:label})},6),more:str3(o.more,120),fine:str3(o.fine),checkin:str3(o.checkin,200),detail:healthPlanItemDetailOf(o.detail)??null})}function signsOf(value){let o=obj(value),title=str3(o?.title,200),items=listOf(o?.items,r=>{let v=obj(r),t=str3(v?.title,300),body=str3(v?.body);return t===null||body===null?null:clean({title:t,body:body,urgent:v?.urgent===true?true:null,callVet:v?.callVet===true?true:null})});return title===null||items===null?null:clean({title:title,items:items})}function checkupOf(value){let o=obj(value),title=str3(o?.title,200),questions=words(o?.questions,12,300),add=str3(o?.add,80),added=str3(o?.added,80);return title===null||questions===null||add===null||added===null?null:clean({title:title,questions:questions,add:add,added:added})}function extrasOf(value){let o=obj(value),title=str3(o?.title,200),items=listOf(o?.items,r=>{let v=obj(r),key=str3(v?.key,REF_MAX3),t=str3(v?.title,300),action=str3(v?.action,80),productId=idOf2(v?.productId),added=str3(v?.added,80)??(productId!==null?action:null);return key===null||t===null||action===null||added===null?null:clean({key:key,productId:productId,title:t,body:str3(v?.body),price:str3(v?.price,40),was:str3(v?.was,40),tag:str3(v?.tag,40),imageUrl:imageOf(v?.imageUrl),icon:iconOf(v?.icon),kind:kindOf(v?.kind),action:action,added:added,owned:v?.owned===true?true:null,detail:healthPlanItemDetailOf(v?.detail)??null})},6);return title===null||items===null?null:clean({title:title,items:items})}function waitOf(value){let o=obj(value),kicker=str3(o?.kicker,120),title=str3(o?.title,120);return o===null||kicker===null||title===null?null:clean({kicker:kicker,title:title,icon:iconOf(o.icon),track:listOf(o.track,r=>{let v=obj(r),t=str3(v?.title,120),state2=v?.state;return t===null?null:clean({title:t,detail:str3(v?.detail,120),state:typeof state2=="string"&&TRACK_STATES.has(state2)?state2:null,tag:str3(v?.tag,40)})},6),heading:str3(o.heading,200),rows:listOf(o.rows,r=>{let v=obj(r),icon=iconOf(v?.icon),label=str3(v?.label,120);if(icon===null||label===null)return null;if(v?.fromVet===true)return clean({icon:icon,label:label,text:"",fromVet:true});let text2=str3(v?.text,300);return text2===null?null:clean({icon:icon,label:label,text:text2})},6),note:str3(o.note,300),action:str3(o.action,80)})}function healthPlanFocusDesignFromWire(raw){let o=obj(raw),title=str3(o?.title,300),pick2=pickOf(o?.pick);if(o===null||title===null||pick2===null)return null;let byline=obj(o.byline);return clean({eyebrow:str3(o.eyebrow,120),title:title,subtitle:str3(o.subtitle,300),subtitleNoRecords:str3(o.subtitleNoRecords,300),headImageUrl:imageOf(o.headImageUrl),byline:str3(byline?.name,120)===null?null:clean({name:str3(byline?.name,120),role:str3(byline?.role,120),imageUrl:imageOf(byline?.imageUrl),shortName:str3(byline?.shortName,60)}),focus:focusOf(o.focus),routine:routineOf(o.routine),pick:pick2,signs:signsOf(o.signs),checkup:checkupOf(o.checkup),extras:extrasOf(o.extras),wait:waitOf(o.wait),fine:str3(o.fine),checkoutRows:listOf(o.checkoutRows,r=>{let v=obj(r),icon=iconOf(v?.icon),label=str3(v?.label,60),val=str3(v?.value,200);return icon===null||label===null||val===null?null:clean({icon:icon,label:label,value:val})},6)})}function healthPlanPageFromWire(raw,petRef){let o=obj(raw);if(o===null||!("page"in o))return null;let pet=obj(o.pet),sex=pet?.sex;/* @__PURE__ */
|
|
20
20
|
return Object.freeze({petRef:str3(o.pet_ref,REF_MAX3)??petRef,pet:/* @__PURE__ */Object.freeze({name:str3(pet?.name,120),species:str3(pet?.species,60),sex:sex==="female"||sex==="male"?sex:null,breed:str3(pet?.breed,120),weightKg:weightOf(pet?.weight_kg),weightLb:weightOf(pet?.weight_lb)}),checkout:o.checkout==="everfur_stripe"?"everfur_stripe":"partner",page:healthPlanFocusDesignFromWire(o.page),vetReviewed:o.vet_reviewed===true,trackingTextsEnabled:o.tracking_texts_enabled===true})}function healthPlanCheckoutSessionFromWire(raw){let o=obj(raw),checkoutId=idOf2(o?.checkout_id),url=str3(o?.url,4096);return checkoutId===null||url===null||!/^https:\/\/[^\s/][^\s]*$/i.test(url)?null:/* @__PURE__ */Object.freeze({checkoutId:checkoutId,url:url})}var STATUSES=/* @__PURE__ */new Set(["pending","paid","expired","failed"]);function healthPlanCheckoutStateFromWire(raw){let o=obj(raw),status=o?.status,purchase=o?.purchase;if(typeof status!="string"||!STATUSES.has(status)||purchase!=="one_box"&&purchase!=="subscription")return null;let order=healthPlanOneBoxOrderFromWire(o?.order),list=Array.isArray(o?.orders)?(o?.orders).map(healthPlanOneBoxOrderFromWire).filter(x=>x!==null):[];/* @__PURE__ */
|
|
21
|
-
return Object.freeze({status:status,purchase:purchase,order:order??list[0]??null,orders:/* @__PURE__ */Object.freeze(list.length>0?list:order===null?[]:[order]),subscription:healthPlanSubscriptionFromWire(o?.subscription)})}function invalid3(wireMessage){return makeEverfurError("validationFailed",{retryable:false,wireMessage:wireMessage})}function malformed3(call){return makeEverfurError("internalError",{retryable:false,httpStatus:502,wireMessage:`${call}: the response was not the expected shape`})}function disposed3(verb){return makeEverfurError("runtimeDisposed",{retryable:false,wireMessage:`the Everfur runtime is disposed; ${verb} was called after unmount`})}var validRef3=value=>typeof value=="string"&&value.length>0&&value.length<=REF_MAX3,absoluteUrl=value=>typeof value=="string"&&value.length<=2048&&/^https?:\/\/[^\s/][^\s]*$/i.test(value);function base2(petRef){return`/widget/v1/pets/${encodeURIComponent(petRef)}/plan`}async function readPage(funnel,petRef,opts){if(!validRef3(petRef))return err(invalid3("petRef must be 1..128 characters"));let res=await funnel.send("healthPlan.page.read",{method:"GET",path:`${base2(petRef)}/page`,...opts?.signal?{signal:opts.signal}:{}});if(!res.ok)return err(res.error);let page=healthPlanPageFromWire(res.value,petRef);return page===null?err(malformed3("healthPlan.page.read")):ok(page)}var readers=/* @__PURE__ */new WeakMap;function createHealthPlanPageReader(runtime){let known=readers.get(runtime);if(known!==void 0)return known;let reader=makeHealthPlanPageReader(runtime);return readers.set(runtime,reader),reader}function makeHealthPlanPageReader(runtime){return{getPage:(petRef,opts)=>{if(runtime.isDisposed)return Promise.resolve(err(disposed3("getPage")));let{services:services}=runtime.registry,funnel=withPlainNotFound(createRequestFunnel({auth:services.authFor(null),...services.errorPolicy?{errorPolicy:services.errorPolicy}:{}}));return readPage(funnel,petRef,opts)}}}function createHealthPlanPageRepositoryOver(deps){let funnel=withPlainNotFound(deps.funnel??createRequestFunnel({auth:deps.auth,...deps.errorPolicy?{errorPolicy:deps.errorPolicy}:{}}));return{getPage:(petRef,opts)=>readPage(funnel,petRef,opts),async startCheckout(petRef,body,idempotencyKey){if(!validRef3(petRef))return err(invalid3("petRef must be 1..128 characters"));if(!validRef3(body.productId))return err(invalid3("productId must be 1..128 characters"));if(body.purchase!=="one_box"&&body.purchase!=="subscription")return err(invalid3("purchase must be one_box or subscription"));if(body.intervalDays!==void 0&&(!Number.isInteger(body.intervalDays)||body.intervalDays<=0))return err(invalid3("intervalDays must be a positive whole number"));if(!absoluteUrl(body.successUrl)||!absoluteUrl(body.cancelUrl))return err(invalid3("successUrl and cancelUrl must be absolute http(s) URLs"));let res=await funnel.send("healthPlan.checkout.start",{method:"POST",path:`${base2(petRef)}/checkout`,body:{product_id:body.productId,purchase:body.purchase,...body.purchase==="subscription"&&body.intervalDays!==void 0?{interval_days:body.intervalDays}:{},success_url:body.successUrl,cancel_url:body.cancelUrl}},{idempotent:true,idempotencyKey:`hp-checkout:${idempotencyKey}`});if(!res.ok)return err(res.error);let session=healthPlanCheckoutSessionFromWire(res.value);return session===null?err(malformed3("healthPlan.checkout.start")):ok(session)},async startCartCheckout(petRef,body,idempotencyKey){if(!validRef3(petRef))return err(invalid3("petRef must be 1..128 characters"));let items=body.items;if(!Array.isArray(items)||items.length<1||items.length>CART_MAX)return err(invalid3("items must hold 1..10 lines"));let seen=/* @__PURE__ */new Set;for(let it of items){if(!validRef3(it.productId)||seen.has(it.productId))return err(invalid3("each item needs a productId, once per cart"));if(seen.add(it.productId),it.purchase!=="one_box"&&it.purchase!=="subscription")return err(invalid3("purchase must be one_box or subscription"));let q=it.quantity??1;if(!Number.isInteger(q)||q<1||q>CART_MAX)return err(invalid3("quantity must be a whole number 1..10"));if(it.purchase==="subscription"&&q!==1)return err(invalid3("a subscription line is quantity 1"));if(it.intervalDays!==void 0&&(!Number.isInteger(it.intervalDays)||it.intervalDays<=0))return err(invalid3("intervalDays must be a positive whole number"))}if(!absoluteUrl(body.successUrl)||!absoluteUrl(body.cancelUrl))return err(invalid3("successUrl and cancelUrl must be absolute http(s) URLs"));let res=await funnel.send("healthPlan.checkout.start",{method:"POST",path:`${base2(petRef)}/checkout`,body:{items:items.map(it=>({product_id:it.productId,purchase:it.purchase,...it.purchase==="subscription"&&it.intervalDays!==void 0?{interval_days:it.intervalDays}:{},quantity:it.quantity??1})),success_url:body.successUrl,cancel_url:body.cancelUrl}},{idempotent:true,idempotencyKey:`hp-checkout:${idempotencyKey}`});if(!res.ok)return err(res.error);let session=healthPlanCheckoutSessionFromWire(res.value);return session===null?err(malformed3("healthPlan.checkout.start")):ok(session)},async getCheckout(petRef,checkoutId){if(!validRef3(petRef))return err(invalid3("petRef must be 1..128 characters"));if(!validRef3(checkoutId))return err(invalid3("checkoutId must be 1..128 characters"));let res=await funnel.send("healthPlan.checkout.read",{method:"GET",path:`${base2(petRef)}/checkout/${encodeURIComponent(checkoutId)}`});if(!res.ok)return err(res.error);let state2=healthPlanCheckoutStateFromWire(res.value);return state2===null?err(malformed3("healthPlan.checkout.read")):ok(state2)}}}function createHealthPlanPageRepository(runtime){let over=()=>{let{services:services}=runtime.registry;return createHealthPlanPageRepositoryOver({auth:services.authFor(null),...services.errorPolicy?{errorPolicy:services.errorPolicy}:{}})};return{getPage:(petRef,opts)=>runtime.isDisposed?Promise.resolve(err(disposed3("getPage"))):over().getPage(petRef,opts),startCheckout:(petRef,body,key)=>runtime.isDisposed?Promise.resolve(err(disposed3("startCheckout"))):over().startCheckout(petRef,body,key),startCartCheckout:(petRef,body,key)=>runtime.isDisposed?Promise.resolve(err(disposed3("startCartCheckout"))):over().startCartCheckout?.(petRef,body,key)??Promise.resolve(err(disposed3("startCartCheckout"))),getCheckout:(petRef,id)=>runtime.isDisposed?Promise.resolve(err(disposed3("getCheckout"))):over().getCheckout(petRef,id)}}var HEALTH_PLAN_PAGE_SHARE_MS=HEALTH_PLAN_STALE_MS,SHARED_READS_SYMBOL=/* @__PURE__ */Symbol.for("@everfur/sdk#HealthPlanPageReads@v1");function sharedReads(){let host=globalThis,stored2=host[SHARED_READS_SYMBOL];if(stored2 instanceof WeakMap)return stored2;let made=/* @__PURE__ */new WeakMap;return host[SHARED_READS_SYMBOL]=made,made}function readShared(reader,runtime,userRef,petRef,fresh2){let all=sharedReads(),reads=all.get(runtime);reads===void 0&&(reads=/* @__PURE__ */new Map,all.set(runtime,reads));let map=reads,key=`${userRef}\0${petRef}`,hit=map.get(key);if(!fresh2&&hit!==void 0&&(hit.at===null||Date.now()-hit.at<HEALTH_PLAN_PAGE_SHARE_MS))return hit.promise;let entry={at:null,promise:reader.getPage(petRef).then(res=>(map.get(key)===entry&&(res.ok||isNotFoundError(res.error)?entry.at=Date.now():map.delete(key)),res))};return map.set(key,entry),entry.promise}function useHealthPlanPageRepository(){let{runtime:runtime}=useEverfurContext();return react.useMemo(()=>createHealthPlanPageRepository(runtime),[runtime])}function useHealthPlanPage(options){let{userRef:userRef,runtime:runtime}=useEverfurContext(),own=react.useMemo(()=>createHealthPlanPageReader(runtime),[runtime]),hostRepository=options.repository,repository=hostRepository??own,getPage=react.useCallback((pet,fresh2)=>hostRepository!==void 0||userRef==null?repository.getPage(pet):readShared(own,runtime,userRef,pet,fresh2),[hostRepository,repository,own,runtime,userRef]),{petRef:petRef}=options,enabled=options.enabled!==false&&userRef!=null&&petRef!==null,[state2,setState]=react.useState({phase:"idle",petRef:null,page:null,error:null}),epoch=react.useRef(0),quiet=react.useRef(0),read=react.useCallback(async fresh2=>{let mine=++epoch.current;if(!enabled||petRef===null){setState(prev=>prev.phase==="idle"&&prev.petRef===null?prev:{phase:"idle",petRef:null,page:null,error:null});return}setState(prev=>({phase:"loading",petRef:petRef,page:prev.petRef===petRef?prev.page:null,error:null}));let res=await getPage(petRef,fresh2);mine===epoch.current&&(res.ok?setState({phase:"ready",petRef:petRef,page:res.value,error:null,readyAt:Date.now()}):isNotFoundError(res.error)?setState({phase:"ready",petRef:petRef,page:null,error:null,missing:true,readyAt:Date.now()}):setState({phase:"failed",petRef:petRef,page:null,error:res.error}))},[enabled,petRef,getPage]),load=react.useCallback(()=>read(true),[read]),ready=state2.phase==="ready"&&state2.petRef===petRef,revalidate=react.useCallback(async()=>{if(!enabled||petRef===null||!ready)return;let mine=epoch.current,seq=++quiet.current,res=await getPage(petRef,true);mine!==epoch.current||seq!==quiet.current||!res.ok||setState(prev=>prev.phase==="ready"&&prev.petRef===petRef?{phase:"ready",petRef:petRef,page:res.value,error:null,readyAt:Date.now()}:prev)},[enabled,petRef,ready,getPage]);useHealthPlanRevalidation({lifecycle:options.lifecycle,refreshKey:options.refreshKey,readyAt:ready?state2.readyAt??null:null,revalidate:()=>{revalidate()},refresh:()=>{ready?revalidate():load()}}),react.useEffect(()=>(read(false),()=>{epoch.current+=1}),[read]);let stale=enabled&&state2.petRef!==petRef;return react.useMemo(()=>({phase:stale?"loading":state2.phase,page:stale?null:state2.page,error:stale?null:state2.error,missing:!stale&&state2.missing===true,refresh:load}),[stale,state2,load])}var DEFAULT_PRESENTATION=/* @__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}),PRESENTATION_WIRE_NAMES=/* @__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"}),FIELDS=Object.keys(PRESENTATION_WIRE_NAMES),PRESENTATION_LOCK="presentation",PRESENTATION_LOCK_PREFIX="presentation.";var ENUMS={chatAnswerStyle:["bubbles","cards"],chatHistoryStyle:["drawer","sheet"],chatTopCard:["none","focus"],safetyDisclaimerPlacement:["composer","answer_footer"],healthPlanLayout:["standard","focus_plan"],chatComposerStyle:["standard","compact"],chatComposerPlaceholder:["generic","pet_name"],chatHistoryBar:["pinned","scroll"],chatSendButton:["always_dark","dim_when_empty"]},BOOLS=/* @__PURE__ */new Set(["chatFollowUpsExcludeTelevet","chatComposerMic","chatComposerUpload","recordsTopRiskLine","recordsClearResultsFilter","chatGeneralBanner","chatTextingAsk"]);function parseField(field,value){if(value==null)return;let allowed=ENUMS[field];return allowed!==void 0?typeof value=="string"&&allowed.includes(value)?value:void 0:BOOLS.has(field)?typeof value=="boolean"?value:void 0:typeof value=="number"&&Number.isInteger(value)&&value>=0&&value<=3?value:void 0}function parsePresentation(raw){if(raw===null||typeof raw!="object"||Array.isArray(raw))return null;let source=raw,out={};for(let field of FIELDS){let wire=PRESENTATION_WIRE_NAMES[field],value=Object.prototype.hasOwnProperty.call(source,wire)?source[wire]:source[field],parsed=parseField(field,value);parsed!==void 0&&(out[field]=parsed)}return Object.keys(out).length===0?null:/* @__PURE__ */Object.freeze(out)}function isPresentationFieldLocked(field,locked){if(locked==null)return false;let one2=`${PRESENTATION_LOCK_PREFIX}${PRESENTATION_WIRE_NAMES[field]}`;for(let name of locked)if(name===PRESENTATION_LOCK||name===one2)return true;return false}function resolvePresentation(input){let server=parsePresentation(input?.server??null)??{},client=parsePresentation(input?.client??null)??{},locked=input?.locked?[...input.locked]:null,out={};for(let field of FIELDS){let fromServer=server[field],fromClient=isPresentationFieldLocked(field,locked)?void 0:client[field];out[field]=fromClient??fromServer??DEFAULT_PRESENTATION[field]}/* @__PURE__ */
|
|
22
|
-
return Object.freeze(out)}var NO_SNAPSHOT=/* @__PURE__ */Object.freeze({branding:null}),NO_STORE=/* @__PURE__ */Object.freeze({subscribe:()=>()=>{},getSnapshot:()=>NO_SNAPSHOT});function keyOf(input){return input?Object.keys(input).sort().map(k2=>`${k2}=${String(input[k2])}`).join("&"):""}function useEverfurPresentation(client){return useEverfurPresentationState(client).presentation}function useEverfurPresentationState(client){let{runtime:runtime}=useEverfurContext(),store=runtime?.entitlements??NO_STORE,readBranding=react.useCallback(()=>store.getSnapshot()?.branding??null,[store]),branding=react.useSyncExternalStore(store.subscribe,readBranding,readBranding),clientKey=keyOf(client);return react.useMemo(()=>{let locked=branding?.lockedFields??null;return{presentation:resolvePresentation({server:branding?.presentation??null,locked:locked,client:client??null}),isLocked:field=>isPresentationFieldLocked(field,locked)}},[branding,clientKey])}var HostRenderBoundary=class extends react.Component{constructor(){super(...arguments);this.state={failed:false,key:this.props.resetKey}}static getDerivedStateFromError(){return{failed:true}}static getDerivedStateFromProps(props,state2){return Object.is(props.resetKey,state2.key)?null:{failed:false,key:props.resetKey}}render(){return this.state.failed?this.props.fallback:this.props.children}};function RenderHost({render:render}){return render()}function HostRender({render:render,fallback:fallback,resetKey:resetKey}){return react.createElement(HostRenderBoundary,{fallback:fallback,resetKey:resetKey,children:react.createElement(RenderHost,{render:render})})}function hasLoneSurrogate(value){for(let i=0;i<value.length;i+=1){let code=value.charCodeAt(i);if(code>=55296&&code<=56319){let low=value.charCodeAt(i+1);if(!(low>=56320&&low<=57343))return true;i+=1}else if(code>=56320&&code<=57343)return true}return false}function serverLength(value){return[...value].length}var SPECIES_ALIASES=/* @__PURE__ */Object.freeze({dog:"dog",canine:"dog",k9:"dog",puppy:"dog",cat:"cat",feline:"cat",kitten:"cat"});function canonicalPetSpecies(raw){if(typeof raw!="string")return null;let key=raw.trim().toLowerCase();return Object.prototype.hasOwnProperty.call(SPECIES_ALIASES,key)?SPECIES_ALIASES[key]:null}var LIST_MAX=50,REF_MAX4=128,NAME_MAX=120,SHORT_MAX=120,NOTES_MAX=2e3,FOOD_MAX=120,MICROCHIP_MAX=80,SEXES=/* @__PURE__ */new Set(["male","female","unknown"]),PRECISIONS=/* @__PURE__ */new Set(["day","month","year"]),ACTIVITY=/* @__PURE__ */new Set(["low","medium","high","athletic"]),INDOOR_OUTDOOR=/* @__PURE__ */new Set(["indoor","outdoor","both"]),SEVERITIES=/* @__PURE__ */new Set(["mild","moderate","severe"]),ISO_DATE=/^(\d{4})-(\d{2})-(\d{2})$/,SCALAR_WIRE=[["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"]],LIST_WIRE=[["allergies","allergies"],["medications","medications"],["supplements","supplements"],["conditions","conditions"]];/* @__PURE__ */Object.freeze([...SCALAR_WIRE,...LIST_WIRE].map(([key])=>key));function isRealDate(value){let match=ISO_DATE.exec(value);if(match===null)return false;let[year,month,day]=[Number(match[1]),Number(match[2]),Number(match[3])],date2=new Date(Date.UTC(year,month-1,day));return date2.getUTCFullYear()===year&&date2.getUTCMonth()===month-1&&date2.getUTCDate()===day}var oneOf=allowed=>(field,value)=>typeof value=="string"&&allowed.has(value)?null:`${field} must be one of ${[...allowed].join(", ")}`,boolean=(field,value)=>typeof value=="boolean"?null:`${field} must be true or false`,date=(field,value)=>typeof value=="string"&&isRealDate(value)?null:`${field} must be a real date written YYYY-MM-DD`,text=(max,opts={})=>(field,value)=>{if(typeof value!="string")return`${field} must be a string`;if(hasLoneSurrogate(value))return`${field} contains an unpaired surrogate and cannot be encoded`;let measured=opts.trimmed?value.trim():value;if(opts.required&&measured.length===0)return`${field} is required and must not be blank`;let length=serverLength(measured);return length<=max?null:`${field} is ${length} characters; the server accepts at most ${max}`},SCALAR_CHECKS={sex:oneOf(SEXES),spayedNeutered:boolean,birthDate:date,birthDatePrecision:oneOf(PRECISIONS),activityLevel:oneOf(ACTIVITY),indoorOutdoor:oneOf(INDOOR_OUTDOOR),foodBrand:text(FOOD_MAX),foodType:text(FOOD_MAX),microchipId:text(MICROCHIP_MAX)},REF_FIELD=["ref","ref",false,text(REF_MAX4,{required:true,trimmed:true})],NOTES_FIELD=["notes","notes",false,text(NOTES_MAX,{trimmed:true})],MEDICATION_FIELDS=[REF_FIELD,["name","name",true,text(NAME_MAX,{required:true,trimmed:true})],["dose","dose",false,text(SHORT_MAX,{trimmed:true})],["frequency","frequency",false,text(SHORT_MAX,{trimmed:true})],["startDate","start_date",false,date],["endDate","end_date",false,date],NOTES_FIELD],ITEM_FIELDS={allergies:[REF_FIELD,["allergen","allergen",true,text(NAME_MAX,{required:true,trimmed:true})],["severity","severity",false,oneOf(SEVERITIES)],NOTES_FIELD],medications:MEDICATION_FIELDS,supplements:MEDICATION_FIELDS,conditions:[REF_FIELD,["conditionName","condition_name",true,text(NAME_MAX,{required:true,trimmed:true})],["diagnosedDate","diagnosed_date",false,date],NOTES_FIELD]};function itemToWire(list,index,raw){let at=`${list}[${index}]`;if(typeof raw!="object"||raw===null||Array.isArray(raw))return{error:`${at} must be an object`};let source=raw,item={};for(let[key,wire,isRequired,check]of ITEM_FIELDS[list]){let value=source[key];if(value==null){if(isRequired)return{error:`${at}.${key} is required`};value===null&&(item[wire]=null);continue}let bad=check(`${at}.${key}`,value);if(bad!==null)return{error:bad};item[wire]=value}let start=item.start_date,end=item.end_date;return typeof start=="string"&&typeof end=="string"&&end<start?{error:`${at}.endDate must not be before startDate`}:{item:item}}function listToWire(list,raw){if(!Array.isArray(raw))return{error:`${list} must be an array (send [] to clear it)`};if(raw.length>LIST_MAX)return{error:`${list} has ${raw.length} items; the server accepts at most ${LIST_MAX}`};let items=[],refs=/* @__PURE__ */new Set;for(let index=0;index<raw.length;index+=1){let mapped2=itemToWire(list,index,raw[index]);if("error"in mapped2)return mapped2;let ref=mapped2.item.ref;if(typeof ref=="string"){let key=ref.trim();if(refs.has(key))return{error:`${list}: ref ${JSON.stringify(key)} is used twice; a ref names one item`};refs.add(key)}items.push(mapped2.item)}return{items:items}}function petHealthToWire(input,species){let source=input,body={};for(let[key,wire]of SCALAR_WIRE){let value=source[key];if(value!==void 0){if(value!==null){let bad=SCALAR_CHECKS[key](key,value);if(bad!==null)return{error:bad}}body[wire]=value}}let dateSent=source.birthDate!==void 0,precisionSent=source.birthDatePrecision!==void 0;if(dateSent!==precisionSent||dateSent&&source.birthDate===null!=(source.birthDatePrecision===null))return{error:"birthDate and birthDatePrecision must be sent together, both set or both null"};for(let[key,wire]of LIST_WIRE){let value=source[key];if(value===void 0)continue;let mapped2=listToWire(key,value);if("error"in mapped2)return mapped2;body[wire]=mapped2.items}return Object.keys(body).length>0&&species!==void 0&&canonicalPetSpecies(species)===null?{error:"health fields need a pet Everfur reads as a dog or a cat (dog, canine, k9, puppy, cat, feline, kitten)"}:{body:body}}var str4=value=>typeof value=="string"?value:null,pick=(allowed,value)=>typeof value=="string"&&allowed.has(value)?value:null,bool=value=>typeof value=="boolean"?value:null;function itemsFromWire(raw,map){return Array.isArray(raw)?/* @__PURE__ */Object.freeze(raw.flatMap(row=>{if(typeof row!="object"||row===null||Array.isArray(row))return[];let item=map(row);return item===null?[]:[item]})):/* @__PURE__ */Object.freeze([])}function medicationFromWire(o){let name=str4(o.name);return name===null||name.length===0?null:/* @__PURE__ */Object.freeze({ref:str4(o.ref),name:name,dose:str4(o.dose),frequency:str4(o.frequency),startDate:str4(o.start_date),endDate:str4(o.end_date),notes:str4(o.notes)})}function petHealthFromWire(o){let version=o.profile_version;/* @__PURE__ */
|
|
21
|
+
return Object.freeze({status:status,purchase:purchase,order:order??list[0]??null,orders:/* @__PURE__ */Object.freeze(list.length>0?list:order===null?[]:[order]),subscription:healthPlanSubscriptionFromWire(o?.subscription)})}function invalid3(wireMessage){return makeEverfurError("validationFailed",{retryable:false,wireMessage:wireMessage})}function malformed3(call){return makeEverfurError("internalError",{retryable:false,httpStatus:502,wireMessage:`${call}: the response was not the expected shape`})}function disposed3(verb){return makeEverfurError("runtimeDisposed",{retryable:false,wireMessage:`the Everfur runtime is disposed; ${verb} was called after unmount`})}var validRef3=value=>typeof value=="string"&&value.length>0&&value.length<=REF_MAX3,absoluteUrl=value=>typeof value=="string"&&value.length<=2048&&/^https?:\/\/[^\s/][^\s]*$/i.test(value);function base2(petRef){return`/widget/v1/pets/${encodeURIComponent(petRef)}/plan`}async function readPage(funnel,petRef,opts){if(!validRef3(petRef))return err(invalid3("petRef must be 1..128 characters"));let res=await funnel.send("healthPlan.page.read",{method:"GET",path:`${base2(petRef)}/page`,...opts?.signal?{signal:opts.signal}:{}});if(!res.ok)return err(res.error);let page=healthPlanPageFromWire(res.value,petRef);return page===null?err(malformed3("healthPlan.page.read")):ok(page)}var readers=/* @__PURE__ */new WeakMap;function createHealthPlanPageReader(runtime){let known=readers.get(runtime);if(known!==void 0)return known;let reader=makeHealthPlanPageReader(runtime);return readers.set(runtime,reader),reader}function makeHealthPlanPageReader(runtime){return{getPage:(petRef,opts)=>{if(runtime.isDisposed)return Promise.resolve(err(disposed3("getPage")));let{services:services}=runtime.registry,funnel=withPlainNotFound(createRequestFunnel({auth:services.authFor(null),...services.errorPolicy?{errorPolicy:services.errorPolicy}:{}}));return readPage(funnel,petRef,opts)}}}function createHealthPlanPageRepositoryOver(deps){let funnel=withPlainNotFound(deps.funnel??createRequestFunnel({auth:deps.auth,...deps.errorPolicy?{errorPolicy:deps.errorPolicy}:{}}));return{getPage:(petRef,opts)=>readPage(funnel,petRef,opts),async startCheckout(petRef,body,idempotencyKey){if(!validRef3(petRef))return err(invalid3("petRef must be 1..128 characters"));if(!validRef3(body.productId))return err(invalid3("productId must be 1..128 characters"));if(body.purchase!=="one_box"&&body.purchase!=="subscription")return err(invalid3("purchase must be one_box or subscription"));if(body.intervalDays!==void 0&&(!Number.isInteger(body.intervalDays)||body.intervalDays<=0))return err(invalid3("intervalDays must be a positive whole number"));if(!absoluteUrl(body.successUrl)||!absoluteUrl(body.cancelUrl))return err(invalid3("successUrl and cancelUrl must be absolute http(s) URLs"));let res=await funnel.send("healthPlan.checkout.start",{method:"POST",path:`${base2(petRef)}/checkout`,body:{product_id:body.productId,purchase:body.purchase,...body.purchase==="subscription"&&body.intervalDays!==void 0?{interval_days:body.intervalDays}:{},success_url:body.successUrl,cancel_url:body.cancelUrl}},{idempotent:true,idempotencyKey:`hp-checkout:${idempotencyKey}`});if(!res.ok)return err(res.error);let session=healthPlanCheckoutSessionFromWire(res.value);return session===null?err(malformed3("healthPlan.checkout.start")):ok(session)},async startCartCheckout(petRef,body,idempotencyKey){if(!validRef3(petRef))return err(invalid3("petRef must be 1..128 characters"));let items=body.items;if(!Array.isArray(items)||items.length<1||items.length>CART_MAX)return err(invalid3("items must hold 1..10 lines"));let seen=/* @__PURE__ */new Set;for(let it of items){if(!validRef3(it.productId)||seen.has(it.productId))return err(invalid3("each item needs a productId, once per cart"));if(seen.add(it.productId),it.purchase!=="one_box"&&it.purchase!=="subscription")return err(invalid3("purchase must be one_box or subscription"));let q=it.quantity??1;if(!Number.isInteger(q)||q<1||q>CART_MAX)return err(invalid3("quantity must be a whole number 1..10"));if(it.purchase==="subscription"&&q!==1)return err(invalid3("a subscription line is quantity 1"));if(it.intervalDays!==void 0&&(!Number.isInteger(it.intervalDays)||it.intervalDays<=0))return err(invalid3("intervalDays must be a positive whole number"))}if(!absoluteUrl(body.successUrl)||!absoluteUrl(body.cancelUrl))return err(invalid3("successUrl and cancelUrl must be absolute http(s) URLs"));let res=await funnel.send("healthPlan.checkout.start",{method:"POST",path:`${base2(petRef)}/checkout`,body:{items:items.map(it=>({product_id:it.productId,purchase:it.purchase,...it.purchase==="subscription"&&it.intervalDays!==void 0?{interval_days:it.intervalDays}:{},quantity:it.quantity??1})),success_url:body.successUrl,cancel_url:body.cancelUrl}},{idempotent:true,idempotencyKey:`hp-checkout:${idempotencyKey}`});if(!res.ok)return err(res.error);let session=healthPlanCheckoutSessionFromWire(res.value);return session===null?err(malformed3("healthPlan.checkout.start")):ok(session)},async getCheckout(petRef,checkoutId){if(!validRef3(petRef))return err(invalid3("petRef must be 1..128 characters"));if(!validRef3(checkoutId))return err(invalid3("checkoutId must be 1..128 characters"));let res=await funnel.send("healthPlan.checkout.read",{method:"GET",path:`${base2(petRef)}/checkout/${encodeURIComponent(checkoutId)}`});if(!res.ok)return err(res.error);let state2=healthPlanCheckoutStateFromWire(res.value);return state2===null?err(malformed3("healthPlan.checkout.read")):ok(state2)}}}function createHealthPlanPageRepository(runtime){let over=()=>{let{services:services}=runtime.registry;return createHealthPlanPageRepositoryOver({auth:services.authFor(null),...services.errorPolicy?{errorPolicy:services.errorPolicy}:{}})};return{getPage:(petRef,opts)=>runtime.isDisposed?Promise.resolve(err(disposed3("getPage"))):over().getPage(petRef,opts),startCheckout:(petRef,body,key)=>runtime.isDisposed?Promise.resolve(err(disposed3("startCheckout"))):over().startCheckout(petRef,body,key),startCartCheckout:(petRef,body,key)=>runtime.isDisposed?Promise.resolve(err(disposed3("startCartCheckout"))):over().startCartCheckout?.(petRef,body,key)??Promise.resolve(err(disposed3("startCartCheckout"))),getCheckout:(petRef,id)=>runtime.isDisposed?Promise.resolve(err(disposed3("getCheckout"))):over().getCheckout(petRef,id)}}var HEALTH_PLAN_PAGE_SHARE_MS=HEALTH_PLAN_STALE_MS,SHARED_READS_SYMBOL=/* @__PURE__ */Symbol.for("@everfur/sdk#HealthPlanPageReads@v1");function sharedReads(){let host2=globalThis,stored2=host2[SHARED_READS_SYMBOL];if(stored2 instanceof WeakMap)return stored2;let made=/* @__PURE__ */new WeakMap;return host2[SHARED_READS_SYMBOL]=made,made}function readShared(reader,runtime,userRef,petRef,fresh2){let all=sharedReads(),reads=all.get(runtime);reads===void 0&&(reads=/* @__PURE__ */new Map,all.set(runtime,reads));let map=reads,key=`${userRef}\0${petRef}`,hit=map.get(key);if(!fresh2&&hit!==void 0&&(hit.at===null||Date.now()-hit.at<HEALTH_PLAN_PAGE_SHARE_MS))return hit.promise;let entry={at:null,promise:reader.getPage(petRef).then(res=>(map.get(key)===entry&&(res.ok||isNotFoundError(res.error)?entry.at=Date.now():map.delete(key)),res))};return map.set(key,entry),entry.promise}function useHealthPlanPageRepository(){let{runtime:runtime}=useEverfurContext();return react.useMemo(()=>createHealthPlanPageRepository(runtime),[runtime])}function useHealthPlanPage(options){let{userRef:userRef,runtime:runtime}=useEverfurContext(),own=react.useMemo(()=>createHealthPlanPageReader(runtime),[runtime]),hostRepository=options.repository,repository=hostRepository??own,getPage=react.useCallback((pet,fresh2)=>hostRepository!==void 0||userRef==null?repository.getPage(pet):readShared(own,runtime,userRef,pet,fresh2),[hostRepository,repository,own,runtime,userRef]),{petRef:petRef}=options,enabled=options.enabled!==false&&userRef!=null&&petRef!==null,[state2,setState]=react.useState({phase:"idle",petRef:null,page:null,error:null}),epoch=react.useRef(0),quiet=react.useRef(0),read=react.useCallback(async fresh2=>{let mine=++epoch.current;if(!enabled||petRef===null){setState(prev=>prev.phase==="idle"&&prev.petRef===null?prev:{phase:"idle",petRef:null,page:null,error:null});return}setState(prev=>({phase:"loading",petRef:petRef,page:prev.petRef===petRef?prev.page:null,error:null}));let res=await getPage(petRef,fresh2);mine===epoch.current&&(res.ok?setState({phase:"ready",petRef:petRef,page:res.value,error:null,readyAt:Date.now()}):isNotFoundError(res.error)?setState({phase:"ready",petRef:petRef,page:null,error:null,missing:true,readyAt:Date.now()}):setState({phase:"failed",petRef:petRef,page:null,error:res.error}))},[enabled,petRef,getPage]),load=react.useCallback(()=>read(true),[read]),ready=state2.phase==="ready"&&state2.petRef===petRef,revalidate=react.useCallback(async()=>{if(!enabled||petRef===null||!ready)return;let mine=epoch.current,seq=++quiet.current,res=await getPage(petRef,true);mine!==epoch.current||seq!==quiet.current||!res.ok||setState(prev=>prev.phase==="ready"&&prev.petRef===petRef?{phase:"ready",petRef:petRef,page:res.value,error:null,readyAt:Date.now()}:prev)},[enabled,petRef,ready,getPage]);useHealthPlanRevalidation({lifecycle:options.lifecycle,refreshKey:options.refreshKey,readyAt:ready?state2.readyAt??null:null,revalidate:()=>{revalidate()},refresh:()=>{ready?revalidate():load()}}),react.useEffect(()=>(read(false),()=>{epoch.current+=1}),[read]);let stale=enabled&&state2.petRef!==petRef;return react.useMemo(()=>({phase:stale?"loading":state2.phase,page:stale?null:state2.page,error:stale?null:state2.error,missing:!stale&&state2.missing===true,refresh:load}),[stale,state2,load])}var DEFAULT_PRESENTATION=/* @__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}),PRESENTATION_WIRE_NAMES=/* @__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"}),FIELDS=Object.keys(PRESENTATION_WIRE_NAMES),PRESENTATION_LOCK="presentation",PRESENTATION_LOCK_PREFIX="presentation.";var ENUMS={chatAnswerStyle:["bubbles","cards"],chatHistoryStyle:["drawer","sheet"],chatTopCard:["none","focus"],safetyDisclaimerPlacement:["composer","answer_footer"],healthPlanLayout:["standard","focus_plan"],chatComposerStyle:["standard","compact"],chatComposerPlaceholder:["generic","pet_name"],chatHistoryBar:["pinned","scroll"],chatSendButton:["always_dark","dim_when_empty"]},BOOLS=/* @__PURE__ */new Set(["chatFollowUpsExcludeTelevet","chatComposerMic","chatComposerUpload","recordsTopRiskLine","recordsClearResultsFilter","chatGeneralBanner","chatTextingAsk","serverSlots"]);function parseField(field,value){if(value==null)return;let allowed=ENUMS[field];return allowed!==void 0?typeof value=="string"&&allowed.includes(value)?value:void 0:BOOLS.has(field)?typeof value=="boolean"?value:void 0:typeof value=="number"&&Number.isInteger(value)&&value>=0&&value<=3?value:void 0}function parsePresentation(raw){if(raw===null||typeof raw!="object"||Array.isArray(raw))return null;let source=raw,out={};for(let field of FIELDS){let wire=PRESENTATION_WIRE_NAMES[field],value=Object.prototype.hasOwnProperty.call(source,wire)?source[wire]:source[field],parsed=parseField(field,value);parsed!==void 0&&(out[field]=parsed)}return Object.keys(out).length===0?null:/* @__PURE__ */Object.freeze(out)}function isPresentationFieldLocked(field,locked){if(locked==null)return false;let one2=`${PRESENTATION_LOCK_PREFIX}${PRESENTATION_WIRE_NAMES[field]}`;for(let name of locked)if(name===PRESENTATION_LOCK||name===one2)return true;return false}function resolvePresentation(input){let server=parsePresentation(input?.server??null)??{},client=parsePresentation(input?.client??null)??{},locked=input?.locked?[...input.locked]:null,out={};for(let field of FIELDS){let fromServer=server[field],fromClient=isPresentationFieldLocked(field,locked)?void 0:client[field];out[field]=fromClient??fromServer??DEFAULT_PRESENTATION[field]}/* @__PURE__ */
|
|
22
|
+
return Object.freeze(out)}var NO_SNAPSHOT=/* @__PURE__ */Object.freeze({branding:null}),NO_STORE=/* @__PURE__ */Object.freeze({subscribe:()=>()=>{},getSnapshot:()=>NO_SNAPSHOT});function keyOf(input){return input?Object.keys(input).sort().map(k2=>`${k2}=${String(input[k2])}`).join("&"):""}function useEverfurPresentation(client){return useEverfurPresentationState(client).presentation}function useEverfurPresentationState(client){let{runtime:runtime}=useEverfurContext(),store=runtime?.entitlements??NO_STORE,readBranding=react.useCallback(()=>store.getSnapshot()?.branding??null,[store]),branding=react.useSyncExternalStore(store.subscribe,readBranding,readBranding),clientKey=keyOf(client);return react.useMemo(()=>{let locked=branding?.lockedFields??null;return{presentation:resolvePresentation({server:branding?.presentation??null,locked:locked,client:client??null}),isLocked:field=>isPresentationFieldLocked(field,locked)}},[branding,clientKey])}function definedPresentation(input){let out={};for(let[key,value]of Object.entries(input))value!==void 0&&(out[key]=value);return out}var SLOT_SWITCH_SYMBOL=/* @__PURE__ */Symbol.for("@everfur/sdk#SlotSwitchContext@v1"),host=globalThis,SlotSwitchContext=host[SLOT_SWITCH_SYMBOL]??(host[SLOT_SWITCH_SYMBOL]=react.createContext(null));SlotSwitchContext.displayName??="EverfurSlotSwitch";function useSlotSwitch(own){let above=react.useContext(SlotSwitchContext),resolved=useEverfurPresentation(void 0).serverSlots;return above===null?resolved:above}var HostRenderBoundary=class extends react.Component{constructor(){super(...arguments);this.state={failed:false,key:this.props.resetKey}}static getDerivedStateFromError(){return{failed:true}}static getDerivedStateFromProps(props,state2){return Object.is(props.resetKey,state2.key)?null:{failed:false,key:props.resetKey}}render(){return this.state.failed?this.props.fallback:this.props.children}};function RenderHost({render:render}){return render()}function HostRender({render:render,fallback:fallback,resetKey:resetKey}){return react.createElement(HostRenderBoundary,{fallback:fallback,resetKey:resetKey,children:react.createElement(RenderHost,{render:render})})}function hasLoneSurrogate(value){for(let i=0;i<value.length;i+=1){let code=value.charCodeAt(i);if(code>=55296&&code<=56319){let low=value.charCodeAt(i+1);if(!(low>=56320&&low<=57343))return true;i+=1}else if(code>=56320&&code<=57343)return true}return false}function serverLength(value){return[...value].length}var SPECIES_ALIASES=/* @__PURE__ */Object.freeze({dog:"dog",canine:"dog",k9:"dog",puppy:"dog",cat:"cat",feline:"cat",kitten:"cat"});function canonicalPetSpecies(raw){if(typeof raw!="string")return null;let key=raw.trim().toLowerCase();return Object.prototype.hasOwnProperty.call(SPECIES_ALIASES,key)?SPECIES_ALIASES[key]:null}var LIST_MAX=50,REF_MAX4=128,NAME_MAX=120,SHORT_MAX=120,NOTES_MAX=2e3,FOOD_MAX=120,MICROCHIP_MAX=80,SEXES=/* @__PURE__ */new Set(["male","female","unknown"]),PRECISIONS=/* @__PURE__ */new Set(["day","month","year"]),ACTIVITY=/* @__PURE__ */new Set(["low","medium","high","athletic"]),INDOOR_OUTDOOR=/* @__PURE__ */new Set(["indoor","outdoor","both"]),SEVERITIES=/* @__PURE__ */new Set(["mild","moderate","severe"]),ISO_DATE=/^(\d{4})-(\d{2})-(\d{2})$/,SCALAR_WIRE=[["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"]],LIST_WIRE=[["allergies","allergies"],["medications","medications"],["supplements","supplements"],["conditions","conditions"]];/* @__PURE__ */Object.freeze([...SCALAR_WIRE,...LIST_WIRE].map(([key])=>key));function isRealDate(value){let match=ISO_DATE.exec(value);if(match===null)return false;let[year,month,day]=[Number(match[1]),Number(match[2]),Number(match[3])],date2=new Date(Date.UTC(year,month-1,day));return date2.getUTCFullYear()===year&&date2.getUTCMonth()===month-1&&date2.getUTCDate()===day}var oneOf=allowed=>(field,value)=>typeof value=="string"&&allowed.has(value)?null:`${field} must be one of ${[...allowed].join(", ")}`,boolean=(field,value)=>typeof value=="boolean"?null:`${field} must be true or false`,date=(field,value)=>typeof value=="string"&&isRealDate(value)?null:`${field} must be a real date written YYYY-MM-DD`,text=(max,opts={})=>(field,value)=>{if(typeof value!="string")return`${field} must be a string`;if(hasLoneSurrogate(value))return`${field} contains an unpaired surrogate and cannot be encoded`;let measured=opts.trimmed?value.trim():value;if(opts.required&&measured.length===0)return`${field} is required and must not be blank`;let length=serverLength(measured);return length<=max?null:`${field} is ${length} characters; the server accepts at most ${max}`},SCALAR_CHECKS={sex:oneOf(SEXES),spayedNeutered:boolean,birthDate:date,birthDatePrecision:oneOf(PRECISIONS),activityLevel:oneOf(ACTIVITY),indoorOutdoor:oneOf(INDOOR_OUTDOOR),foodBrand:text(FOOD_MAX),foodType:text(FOOD_MAX),microchipId:text(MICROCHIP_MAX)},REF_FIELD=["ref","ref",false,text(REF_MAX4,{required:true,trimmed:true})],NOTES_FIELD=["notes","notes",false,text(NOTES_MAX,{trimmed:true})],MEDICATION_FIELDS=[REF_FIELD,["name","name",true,text(NAME_MAX,{required:true,trimmed:true})],["dose","dose",false,text(SHORT_MAX,{trimmed:true})],["frequency","frequency",false,text(SHORT_MAX,{trimmed:true})],["startDate","start_date",false,date],["endDate","end_date",false,date],NOTES_FIELD],ITEM_FIELDS={allergies:[REF_FIELD,["allergen","allergen",true,text(NAME_MAX,{required:true,trimmed:true})],["severity","severity",false,oneOf(SEVERITIES)],NOTES_FIELD],medications:MEDICATION_FIELDS,supplements:MEDICATION_FIELDS,conditions:[REF_FIELD,["conditionName","condition_name",true,text(NAME_MAX,{required:true,trimmed:true})],["diagnosedDate","diagnosed_date",false,date],NOTES_FIELD]};function itemToWire(list,index,raw){let at=`${list}[${index}]`;if(typeof raw!="object"||raw===null||Array.isArray(raw))return{error:`${at} must be an object`};let source=raw,item={};for(let[key,wire,isRequired,check]of ITEM_FIELDS[list]){let value=source[key];if(value==null){if(isRequired)return{error:`${at}.${key} is required`};value===null&&(item[wire]=null);continue}let bad=check(`${at}.${key}`,value);if(bad!==null)return{error:bad};item[wire]=value}let start=item.start_date,end=item.end_date;return typeof start=="string"&&typeof end=="string"&&end<start?{error:`${at}.endDate must not be before startDate`}:{item:item}}function listToWire(list,raw){if(!Array.isArray(raw))return{error:`${list} must be an array (send [] to clear it)`};if(raw.length>LIST_MAX)return{error:`${list} has ${raw.length} items; the server accepts at most ${LIST_MAX}`};let items=[],refs=/* @__PURE__ */new Set;for(let index=0;index<raw.length;index+=1){let mapped2=itemToWire(list,index,raw[index]);if("error"in mapped2)return mapped2;let ref=mapped2.item.ref;if(typeof ref=="string"){let key=ref.trim();if(refs.has(key))return{error:`${list}: ref ${JSON.stringify(key)} is used twice; a ref names one item`};refs.add(key)}items.push(mapped2.item)}return{items:items}}function petHealthToWire(input,species){let source=input,body={};for(let[key,wire]of SCALAR_WIRE){let value=source[key];if(value!==void 0){if(value!==null){let bad=SCALAR_CHECKS[key](key,value);if(bad!==null)return{error:bad}}body[wire]=value}}let dateSent=source.birthDate!==void 0,precisionSent=source.birthDatePrecision!==void 0;if(dateSent!==precisionSent||dateSent&&source.birthDate===null!=(source.birthDatePrecision===null))return{error:"birthDate and birthDatePrecision must be sent together, both set or both null"};for(let[key,wire]of LIST_WIRE){let value=source[key];if(value===void 0)continue;let mapped2=listToWire(key,value);if("error"in mapped2)return mapped2;body[wire]=mapped2.items}return Object.keys(body).length>0&&species!==void 0&&canonicalPetSpecies(species)===null?{error:"health fields need a pet Everfur reads as a dog or a cat (dog, canine, k9, puppy, cat, feline, kitten)"}:{body:body}}var str4=value=>typeof value=="string"?value:null,pick=(allowed,value)=>typeof value=="string"&&allowed.has(value)?value:null,bool=value=>typeof value=="boolean"?value:null;function itemsFromWire(raw,map){return Array.isArray(raw)?/* @__PURE__ */Object.freeze(raw.flatMap(row=>{if(typeof row!="object"||row===null||Array.isArray(row))return[];let item=map(row);return item===null?[]:[item]})):/* @__PURE__ */Object.freeze([])}function medicationFromWire(o){let name=str4(o.name);return name===null||name.length===0?null:/* @__PURE__ */Object.freeze({ref:str4(o.ref),name:name,dose:str4(o.dose),frequency:str4(o.frequency),startDate:str4(o.start_date),endDate:str4(o.end_date),notes:str4(o.notes)})}function petHealthFromWire(o){let version=o.profile_version;/* @__PURE__ */
|
|
23
23
|
return Object.freeze({profileVersion:typeof version=="number"&&Number.isInteger(version)&&version>=0?version:0,sex:pick(SEXES,o.sex),spayedNeutered:bool(o.spayed_neutered),birthDate:str4(o.birth_date),birthDatePrecision:pick(PRECISIONS,o.birth_date_precision),activityLevel:pick(ACTIVITY,o.activity_level),indoorOutdoor:pick(INDOOR_OUTDOOR,o.indoor_outdoor),foodBrand:str4(o.food_brand),foodType:str4(o.food_type),microchipId:str4(o.microchip_id),allergies:itemsFromWire(o.allergies,row=>{let allergen=str4(row.allergen);return allergen===null||allergen.length===0?null:/* @__PURE__ */Object.freeze({ref:str4(row.ref),allergen:allergen,severity:pick(SEVERITIES,row.severity),notes:str4(row.notes)})}),medications:itemsFromWire(o.medications,medicationFromWire),supplements:itemsFromWire(o.supplements,medicationFromWire),conditions:itemsFromWire(o.conditions,row=>{let conditionName=str4(row.condition_name);return conditionName===null||conditionName.length===0?null:/* @__PURE__ */Object.freeze({ref:str4(row.ref),conditionName:conditionName,diagnosedDate:str4(row.diagnosed_date),notes:str4(row.notes)})})})}var PET_NAME_MAX=100,PET_SPECIES_MAX=50,PET_BREED_MAX=100,PET_AGE_YEARS_MAX=50,PET_WEIGHT_KG_MAX=500,PET_REF_MAX=128,ERASE_USER_DATA_TIMEOUT_MS=6e4;function invalid4(wireMessage){return makeEverfurError("validationFailed",{retryable:false,wireMessage:wireMessage})}function checkString(field,value,max){if(typeof value!="string")return invalid4(`${field} must be a string`);let length=serverLength(value);return length<=max?null:invalid4(`${field} is ${length} characters; the server accepts at most ${max}`)}function outOfRange(field,value,max){return typeof value=="number"&&Number.isFinite(value)&&value>=0&&value<=max?null:invalid4(`${field} must be a finite number between 0 and ${max}`)}function validate(petRef,profile){if(typeof petRef!="string")return invalid4("pet_ref must be a string");if(petRef.trim().length===0)return invalid4("pet_ref must not be blank");if(hasLoneSurrogate(petRef))return invalid4("pet_ref contains an unpaired surrogate and cannot be encoded");if(profile!=null&&typeof profile!="object")return invalid4("profile must be an object");let checks=[checkString("pet_ref",petRef,PET_REF_MAX)];return profile?.name!==void 0&&checks.push(checkString("name",profile.name,PET_NAME_MAX)),profile?.species!==void 0&&checks.push(checkString("species",profile.species,PET_SPECIES_MAX)),profile?.breed!==void 0&&checks.push(checkString("breed",profile.breed,PET_BREED_MAX)),profile?.ageYears!==void 0&&checks.push(outOfRange("age_years",profile.ageYears,PET_AGE_YEARS_MAX)),profile?.weightKg!==void 0&&checks.push(outOfRange("weight_kg",profile.weightKg,PET_WEIGHT_KG_MAX)),checks.find(c=>c!==null)??null}function healthToWire(source,species){let health=petHealthToWire(source,species);return"error"in health?{error:invalid4(health.error)}:health}function patchToWire(patch){if(typeof patch!="object"||patch===null)return{error:invalid4("patch must be an object")};let p=patch,fields=[["name","name",v=>checkString("name",v,PET_NAME_MAX)],["species","species",v=>checkString("species",v,PET_SPECIES_MAX)],["breed","breed",v=>checkString("breed",v,PET_BREED_MAX)],["ageYears","age_years",v=>outOfRange("age_years",v,PET_AGE_YEARS_MAX)],["weightKg","weight_kg",v=>outOfRange("weight_kg",v,PET_WEIGHT_KG_MAX)]],body={};for(let[key,wire,check]of fields){let value=p[key];if(value!==void 0){if(value!==null){let bad=check(value);if(bad!==null)return{error:bad}}body[wire]=value}}let health=healthToWire(p,p.species);return"error"in health?health:(Object.assign(body,health.body),Object.keys(body).length===0?{error:invalid4("patch must change at least one field")}:{body:body})}function toWire(profile){if(profile==null)return{body:{}};let health=healthToWire(profile,profile.species);return"error"in health?health:{body:{...profile.name!==void 0?{name:profile.name}:{},...profile.species!==void 0?{species:profile.species}:{},...profile.breed!==void 0?{breed:profile.breed}:{},...profile.ageYears!==void 0?{age_years:profile.ageYears}:{},...profile.weightKg!==void 0?{weight_kg:profile.weightKg}:{},...health.body}}}var str5=v=>typeof v=="string"?v:null,num=v=>typeof v=="number"&&Number.isFinite(v)?v:null;function fromWire2(raw,petRef){let o=typeof raw=="object"&&raw!==null?raw:{};/* @__PURE__ */
|
|
24
24
|
return Object.freeze({petRef:str5(o.pet_ref)??petRef,name:str5(o.name),species:str5(o.species),breed:str5(o.breed),ageYears:num(o.age_years),weightKg:num(o.weight_kg)})}function widgetPetFromWire(raw){if(typeof raw!="object"||raw===null)return null;let o=raw,petRef=str5(o.pet_ref);return petRef===null||petRef.length===0?null:/* @__PURE__ */Object.freeze({petId:str5(o.pet_id),petRef:petRef,name:str5(o.name),species:str5(o.species),breed:str5(o.breed),ageYears:num(o.age_years),weightKg:num(o.weight_kg),updatedAt:str5(o.updated_at)})}function widgetPetProfileFromWire(raw){let pet=widgetPetFromWire(raw);return pet===null?null:/* @__PURE__ */Object.freeze({...pet,...petHealthFromWire(raw)})}function petListFromWire(raw){let rows=Array.isArray(raw)?raw:typeof raw=="object"&&raw!==null&&Array.isArray(raw.pets)?raw.pets:[];/* @__PURE__ */
|
|
25
|
-
return Object.freeze(rows.flatMap(row=>{let pet=widgetPetFromWire(row);return pet===null?[]:[pet]}))}function createPetsRepository(auth){return createPetsRepositoryOver(createRequestFunnel({auth:auth}),createRequestFunnel({auth:auth,unaryTimeoutMs:ERASE_USER_DATA_TIMEOUT_MS}))}function createPetsRepositoryOver(funnel,eraseFunnel=funnel){let withSignal=(req,signal)=>signal?{...req,signal:signal}:req,petPath=petRef=>validate(petRef,void 0)??`/widget/v1/pets/${encodeURIComponent(petRef)}`;return{async list(opts){let res=await funnel.send("pets.list",withSignal({method:"GET",path:"/widget/v1/pets"},opts?.signal));return res.ok?ok(petListFromWire(res.value)):err(res.error)},async registerPet(petRef,profile,opts){let invalid5=validate(petRef,profile);if(invalid5!==null)return err(invalid5);let wire=toWire(profile);if("error"in wire)return err(wire.error);let base3={method:"POST",path:`/widget/v1/pets/${encodeURIComponent(petRef)}`,body:wire.body},res=await funnel.send("pets.registerPet",opts?.signal?{...base3,signal:opts.signal}:base3);return res.ok?ok(fromWire2(res.value,petRef)):err(res.error)},async updatePet(petRef,patch,opts){let path=petPath(petRef);if(typeof path!="string")return err(path);let wire=patchToWire(patch);if("error"in wire)return err(wire.error);let res=await funnel.send("pets.updatePet",withSignal({method:"PATCH",path:path,body:wire.body},opts?.signal));return res.ok?ok(fromWire2(res.value,petRef)):err(res.error)},async getPetProfile(petRef,opts){let path=petPath(petRef);if(typeof path!="string")return err(path);let res=await funnel.send("pets.getPetProfile",withSignal({method:"GET",path:`${path}/profile`},opts?.signal));if(!res.ok)return err(res.error);let profile=widgetPetProfileFromWire(res.value);return profile===null?err(makeEverfurError("internalError",{retryable:false,httpStatus:502,wireMessage:"the pet profile response carried no pet_ref"})):ok(profile)},async deletePet(petRef,opts){let path=petPath(petRef);if(typeof path!="string")return err(path);let res=await funnel.send("pets.deletePet",withSignal({method:"DELETE",path:path},opts?.signal));return res.ok?ok(void 0):err(res.error)},async eraseUserData(opts){let res=await eraseFunnel.send("pets.eraseUserData",withSignal({method:"DELETE",path:"/widget/v1/me"},opts?.signal),{maxAttempts:1});return res.ok?ok(void 0):err(res.error)}}}var listeners=/* @__PURE__ */new WeakMap;function subscribePetsChanged(runtime,listener){let set=listeners.get(runtime);return set===void 0&&(set=/* @__PURE__ */new Set,listeners.set(runtime,set)),set.add(listener),()=>{set?.delete(listener)}}function useEverfurPets(){let{runtime:runtime,userRef:userRef,activePet:activePetRef,scopeEpoch:scopeEpoch}=useEverfurContext(),repository=react.useMemo(()=>createPetsRepository(runtime.registry.services.authFor(userRef)),[runtime,userRef,scopeEpoch]),[state2,setState]=react.useState({repository:repository,pets:[],loading:true,error:null}),current=state2.repository===repository?state2:{pets:[],loading:true,error:null},generation=react.useRef(0),load=react.useCallback(async()=>{let request=++generation.current;setState(previous=>({...previous,repository:repository,loading:true,error:null,pets:previous.repository===repository?previous.pets:[]}));let result=await repository.list();request===generation.current&&setState(result.ok?{repository:repository,pets:result.value,loading:false,error:null}:previous=>({repository:repository,pets:previous.repository===repository?previous.pets:[],loading:false,error:result.error}))},[repository]);react.useEffect(()=>(load(),()=>{generation.current+=1}),[load]),react.useEffect(()=>subscribePetsChanged(runtime,()=>{load()}),[runtime,load]);let activePet=react.useMemo(()=>activePetRef===null?null:current.pets.find(pet=>pet.petRef===activePetRef)??null,[activePetRef,current.pets]);return react.useMemo(()=>({pets:current.pets,activePet:activePet,loading:current.loading,error:current.error,refresh:load}),[current.pets,current.loading,current.error,activePet,load])}var freezeInPlace=Object.freeze;function deepFreeze(value){if(value!==null&&typeof value=="object"&&!Object.isFrozen(value)){freezeInPlace(value);for(let key of Object.keys(value))deepFreeze(value[key])}return value}var TEXT_SCALE_TIER_CAPS=/* @__PURE__ */Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3}),SPACE={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},RADIUS={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},TYPE_SIZE={nano:8,small:9,micro:10,tiny:11,caption:13,bodyTight:15,body:17,subtitle:20,heading:22,verdict:24},LINE_HEIGHT={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},WEIGHT={regular:"400",medium:"500",bold:"700"},LETTER_SPACING={eyebrow:1,monoWide:.9,headerBrand:-.42,tight:-.35},DEFAULT_MAX_FONT_SCALE=0,SYSTEM_FONT_FAMILY="System",SYSTEM_MONO_FAMILY="monospace",TIERS=["content","heading","control","compact","badge"];function authoredTierSizes(size){let out={};for(let tier of TIERS)out[tier]=size;return out}var NO_FONT_SOURCES=[];function baseType(){return{family:SYSTEM_FONT_FAMILY,mono:SYSTEM_MONO_FAMILY,fontUrl:null,families:{regular:SYSTEM_FONT_FAMILY,medium:SYSTEM_FONT_FAMILY,bold:SYSTEM_FONT_FAMILY,mono:SYSTEM_MONO_FAMILY,monoMedium:SYSTEM_MONO_FAMILY,monoBold:SYSTEM_MONO_FAMILY},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:TYPE_SIZE,tierSizes:authoredTierSizes(TYPE_SIZE),lineHeight:LINE_HEIGHT,weight:WEIGHT,letterSpacing:LETTER_SPACING,scale:1,maxScale:DEFAULT_MAX_FONT_SCALE,scaleCaps:TEXT_SCALE_TIER_CAPS,headingFamily:null,headingWeight:null,fontSources:NO_FONT_SOURCES}}var NO_SLOTS={},EASING_CURVES=/* @__PURE__ */Object.freeze({standard:/* @__PURE__ */Object.freeze([.2,0,0,1]),emphasized:/* @__PURE__ */Object.freeze([.2,.8,.2,1]),exit:/* @__PURE__ */Object.freeze([.4,0,1,1])});function cssCubicBezier(curve2){return`cubic-bezier(${curve2.join(", ")})`}var MOTION={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:cssCubicBezier(EASING_CURVES.standard),emphasized:cssCubicBezier(EASING_CURVES.emphasized),exit:cssCubicBezier(EASING_CURVES.exit)},reducedMotion:false},LIGHT_COLOR={brand:"#10462E",brandSoft:"rgba(16,70,46,0.10)",brandSofter:"rgba(16,70,46,0.15)",brandBorder:"rgba(16,70,46,0.18)",borderHairlineGreen:"rgba(16,70,46,0.25)",brandBorderStrong:"rgba(16,70,46,0.55)",brandInk:"#10462E",linkInk:"#10462E",surface:"#FFFFFF",surfaceCream:"#FFFFFF",surfaceSubtle:"#F1F5F2",background:"#FFFFFF",borderRingCream:"#E4E4E4",chatGround:"#FFFFFF",composerFill:"#FFFFFF",composerBorder:"rgba(16,70,46,0.75)",shadow:"#0B3421",text:{primary:"#000000",secondary:"#0E462E",muted:"#6B6B6B",placeholder:"rgba(61,61,61,0.75)",onBrand:"#FFFFFF",metaCool:"#3D3D3D",timestamp:"rgba(61,61,61,0.75)"},primary:"#10462E",onPrimary:"#FFFFFF",accent:"#10462E",onAccent:"#FFFFFF",accentEdge:"#07C168",success:"#07C168",danger:"#C03410",onDanger:"#FFFFFF",errorRed:"#C03410",warningStrong:"#A45610",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.12)",badgeBgCaution:"rgba(217,130,29,0.14)",badgeBgCritical:"rgba(192,52,16,0.06)",badgeBgNeutral:"rgba(107,107,107,0.12)",bubbleUser:"#10462E",bubbleAssistant:"#FFFFFF",bubbleVet:"#FFC3BC",onBubbleVet:"#000000",skeleton:"#E9F1E9",scanButtonPink:"#FFC3BC",highlight:"#FFC3BC",onHighlight:"#000000",mark:"#07C168",controlEdge:"rgba(16,70,46,0.18)",structureEdge:"rgba(16,70,46,0.25)",primaryEdge:"#10462E",checkupCardLowRiskBg:"rgba(7,193,104,0.10)",checkupCardConcernBg:"rgba(239,167,0,0.10)",info:"#10462E",badgeBgInfo:"rgba(16,70,46,0.10)",infoEdge:"rgba(16,70,46,0.25)"},EVERFUR_LIGHT=deepFreeze({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:LIGHT_COLOR,space:SPACE,radius:RADIUS,type:baseType(),motion:MOTION,slots:NO_SLOTS}),DARK_COLOR={brand:"#6BD39A",brandSoft:"rgba(107,211,154,0.12)",brandSofter:"rgba(107,211,154,0.18)",brandBorder:"rgba(107,211,154,0.22)",borderHairlineGreen:"rgba(107,211,154,0.28)",brandBorderStrong:"rgba(107,211,154,0.55)",brandInk:"#6BD39A",linkInk:"#6BD39A",surface:"#1C1F23",surfaceCream:"#23272C",surfaceSubtle:"#23272C",background:"#15171A",borderRingCream:"#3A3F45",chatGround:"#1C1F23",composerFill:"#23272C",composerBorder:"rgba(107,211,154,0.75)",shadow:"#000000",text:{primary:"#F5F3F0",secondary:"#A9E4C4",muted:"#9A9A9A",placeholder:"rgba(255,255,255,0.55)",onBrand:"#0E1F17",metaCool:"#C9C9C9",timestamp:"rgba(245,243,240,0.7)"},primary:"#6BD39A",onPrimary:"#0E1F17",accent:"#6BD39A",onAccent:"#0E1F17",accentEdge:"#34D888",success:"#07C168",danger:"#F87171",onDanger:"#0E1F17",errorRed:"#FF6B5B",warningStrong:"#F0A35E",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.18)",badgeBgCaution:"rgba(217,130,29,0.20)",badgeBgCritical:"rgba(185,28,28,0.22)",badgeBgNeutral:"rgba(255,255,255,0.10)",bubbleUser:"#6BD39A",bubbleAssistant:"#1C1F23",bubbleVet:"#FFC3BC",onBubbleVet:"#000000",skeleton:"#23272C",scanButtonPink:"#FFC3BC",highlight:"#605051",onHighlight:"#F5F3F0",mark:"#07C168",controlEdge:"rgba(107,211,154,0.22)",structureEdge:"rgba(107,211,154,0.28)",primaryEdge:"#6BD39A",checkupCardLowRiskBg:"rgba(7,193,104,0.16)",checkupCardConcernBg:"rgba(239,167,0,0.16)",info:"#6BD39A",badgeBgInfo:"rgba(107,211,154,0.12)",infoEdge:"rgba(107,211,154,0.28)"},EVERFUR_DARK=deepFreeze({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:DARK_COLOR,space:SPACE,radius:RADIUS,type:baseType(),motion:MOTION,slots:NO_SLOTS});var EVERFUR_THEME_CONTEXT_SYMBOL=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),globalThemeHost=globalThis,EverfurThemeContext=globalThemeHost[EVERFUR_THEME_CONTEXT_SYMBOL]??(globalThemeHost[EVERFUR_THEME_CONTEXT_SYMBOL]=react.createContext(EVERFUR_LIGHT));EverfurThemeContext.displayName??="EverfurThemeContext";function useEverfurTheme(){return react.useContext(EverfurThemeContext)}function tierMultiplier(type,tier){let cap2=type.scaleCaps[tier];return cap2>0?cap2:void 0}function Text({tier:tier="content",...props}){let{type:type}=useEverfurTheme(),cap2=tierMultiplier(type,tier);return react.createElement(reactNative.Text,cap2===void 0?props:{maxFontSizeMultiplier:cap2,...props})}react.forwardRef(function(props,ref){return react.createElement(reactNative.TextInput,{...props,...ref===null?{}:{ref:ref}})});var REQUIRES=/* @__PURE__ */Object.freeze({chat:/* @__PURE__ */Object.freeze(["chat.message.create"]),records:/* @__PURE__ */Object.freeze(["records.upload.create","records.record.read"]),recordsClinic:/* @__PURE__ */Object.freeze(["records.clinic.create"]),video:/* @__PURE__ */Object.freeze(["video.gait.execute"]),photo:/* @__PURE__ */Object.freeze(["photo.checkup.execute"]),animations:/* @__PURE__ */Object.freeze(["animations.state.read"]),televet:/* @__PURE__ */Object.freeze(["televet.visit.create"]),texting:/* @__PURE__ */Object.freeze(["sms.identity.read","sms.identity.update"]),healthPlan:/* @__PURE__ */Object.freeze(["shop.plan.read","shop.plan.update"])});function requires(name){return REQUIRES[name]}function decideCapability(name,decisions,opts){let keys=requires(name),byResource=/* @__PURE__ */new Map;for(let decision of decisions)byResource.set(decision.resource,decision);if(opts?.isPending===true&&keys.some(key=>!byResource.has(key)))return freezeDecision({name:name,enabled:false,isPending:true,limits:{}});let limits=mergeLimits(keys,byResource);return keys.filter(key=>byResource.get(key)?.granted!==true).length===0?freezeDecision({name:name,enabled:true,isPending:false,limits:limits}):freezeDecision({name:name,enabled:false,isPending:false,limits:limits,disabled:disabledFor(keys,byResource)})}function mergeLimits(keys,byResource){let out={};for(let key of keys){let decisionLimits=byResource.get(key)?.limits;if(decisionLimits)for(let[limitKey,limitValue]of Object.entries(decisionLimits)){let existing=out[limitKey];out[limitKey]=existing===void 0?limitValue:Math.min(existing,limitValue)}}return out}function disabledFor(keys,byResource){for(let key of keys){let explicit=byResource.get(key)?.disabled;if(explicit)/* @__PURE__ */
|
|
25
|
+
return Object.freeze(rows.flatMap(row=>{let pet=widgetPetFromWire(row);return pet===null?[]:[pet]}))}function createPetsRepository(auth){return createPetsRepositoryOver(createRequestFunnel({auth:auth}),createRequestFunnel({auth:auth,unaryTimeoutMs:ERASE_USER_DATA_TIMEOUT_MS}))}function createPetsRepositoryOver(funnel,eraseFunnel=funnel){let withSignal=(req,signal)=>signal?{...req,signal:signal}:req,petPath=petRef=>validate(petRef,void 0)??`/widget/v1/pets/${encodeURIComponent(petRef)}`;return{async list(opts){let res=await funnel.send("pets.list",withSignal({method:"GET",path:"/widget/v1/pets"},opts?.signal));return res.ok?ok(petListFromWire(res.value)):err(res.error)},async registerPet(petRef,profile,opts){let invalid5=validate(petRef,profile);if(invalid5!==null)return err(invalid5);let wire=toWire(profile);if("error"in wire)return err(wire.error);let base3={method:"POST",path:`/widget/v1/pets/${encodeURIComponent(petRef)}`,body:wire.body},res=await funnel.send("pets.registerPet",opts?.signal?{...base3,signal:opts.signal}:base3);return res.ok?ok(fromWire2(res.value,petRef)):err(res.error)},async updatePet(petRef,patch,opts){let path=petPath(petRef);if(typeof path!="string")return err(path);let wire=patchToWire(patch);if("error"in wire)return err(wire.error);let res=await funnel.send("pets.updatePet",withSignal({method:"PATCH",path:path,body:wire.body},opts?.signal));return res.ok?ok(fromWire2(res.value,petRef)):err(res.error)},async getPetProfile(petRef,opts){let path=petPath(petRef);if(typeof path!="string")return err(path);let res=await funnel.send("pets.getPetProfile",withSignal({method:"GET",path:`${path}/profile`},opts?.signal));if(!res.ok)return err(res.error);let profile=widgetPetProfileFromWire(res.value);return profile===null?err(makeEverfurError("internalError",{retryable:false,httpStatus:502,wireMessage:"the pet profile response carried no pet_ref"})):ok(profile)},async deletePet(petRef,opts){let path=petPath(petRef);if(typeof path!="string")return err(path);let res=await funnel.send("pets.deletePet",withSignal({method:"DELETE",path:path},opts?.signal));return res.ok?ok(void 0):err(res.error)},async eraseUserData(opts){let res=await eraseFunnel.send("pets.eraseUserData",withSignal({method:"DELETE",path:"/widget/v1/me"},opts?.signal),{maxAttempts:1});return res.ok?ok(void 0):err(res.error)}}}var listeners=/* @__PURE__ */new WeakMap;function subscribePetsChanged(runtime,listener){let set=listeners.get(runtime);return set===void 0&&(set=/* @__PURE__ */new Set,listeners.set(runtime,set)),set.add(listener),()=>{set?.delete(listener)}}function useEverfurPets(){let{runtime:runtime,userRef:userRef,activePet:activePetRef,scopeEpoch:scopeEpoch}=useEverfurContext(),repository=react.useMemo(()=>createPetsRepository(runtime.registry.services.authFor(userRef)),[runtime,userRef,scopeEpoch]),[state2,setState]=react.useState({repository:repository,pets:[],loading:true,error:null}),current=state2.repository===repository?state2:{pets:[],loading:true,error:null},generation=react.useRef(0),load=react.useCallback(async()=>{let request=++generation.current;setState(previous=>({...previous,repository:repository,loading:true,error:null,pets:previous.repository===repository?previous.pets:[]}));let result=await repository.list();request===generation.current&&setState(result.ok?{repository:repository,pets:result.value,loading:false,error:null}:previous=>({repository:repository,pets:previous.repository===repository?previous.pets:[],loading:false,error:result.error}))},[repository]);react.useEffect(()=>(load(),()=>{generation.current+=1}),[load]),react.useEffect(()=>subscribePetsChanged(runtime,()=>{load()}),[runtime,load]);let activePet=react.useMemo(()=>activePetRef===null?null:current.pets.find(pet=>pet.petRef===activePetRef)??null,[activePetRef,current.pets]);return react.useMemo(()=>({pets:current.pets,activePet:activePet,loading:current.loading,error:current.error,refresh:load}),[current.pets,current.loading,current.error,activePet,load])}var TYPE_ROLE_DEFAULTS=/* @__PURE__ */Object.freeze({display:/* @__PURE__ */Object.freeze({size:29,lineHeight:1.06,weight:"800",face:"heading",letterSpacing:-.01,uppercase:false,tier:"heading"}),title:/* @__PURE__ */Object.freeze({size:23,lineHeight:1.12,weight:"800",face:"heading",letterSpacing:-.01,uppercase:false,tier:"heading"}),cardTitle:/* @__PURE__ */Object.freeze({size:19,lineHeight:1.22,weight:"800",face:"sans",letterSpacing:0,uppercase:false,tier:"heading"}),rowTitle:/* @__PURE__ */Object.freeze({size:15.5,lineHeight:1.4,weight:"700",face:"sans",letterSpacing:0,uppercase:false,tier:"content"}),body:/* @__PURE__ */Object.freeze({size:15,lineHeight:1.5,weight:"400",face:"sans",letterSpacing:0,uppercase:false,tier:"content"}),message:/* @__PURE__ */Object.freeze({size:15.5,lineHeight:1.5,weight:"400",face:"sans",letterSpacing:0,uppercase:false,tier:"content"}),bodySmall:/* @__PURE__ */Object.freeze({size:14.5,lineHeight:1.4,weight:"400",face:"sans",letterSpacing:0,uppercase:false,tier:"content"}),caption:/* @__PURE__ */Object.freeze({size:13,lineHeight:1.4,weight:"400",face:"sans",letterSpacing:0,uppercase:false,tier:"content"}),label:/* @__PURE__ */Object.freeze({size:10.5,lineHeight:1.4,weight:"400",face:"mono",letterSpacing:.05,uppercase:true,tier:"compact"}),eyebrow:/* @__PURE__ */Object.freeze({size:15,lineHeight:1.5,weight:"400",face:"mono",letterSpacing:.07,uppercase:true,tier:"compact"}),chip:/* @__PURE__ */Object.freeze({size:15,lineHeight:1.3,weight:"600",face:"sans",letterSpacing:0,uppercase:false,tier:"compact"}),tab:/* @__PURE__ */Object.freeze({size:16,lineHeight:1.5,weight:"600",face:"sans",letterSpacing:0,uppercase:false,tier:"compact"}),button:/* @__PURE__ */Object.freeze({size:15,lineHeight:1.5,weight:"700",face:"sans",letterSpacing:0,uppercase:false,tier:"control"}),badge:/* @__PURE__ */Object.freeze({size:12,lineHeight:1.5,weight:"700",face:"sans",letterSpacing:0,uppercase:false,tier:"badge"})});var freezeInPlace=Object.freeze;function deepFreeze(value){if(value!==null&&typeof value=="object"&&!Object.isFrozen(value)){freezeInPlace(value);for(let key of Object.keys(value))deepFreeze(value[key])}return value}var TEXT_SCALE_TIER_CAPS=/* @__PURE__ */Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3});var SPACE={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},RADIUS={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},TYPE_SIZE={nano:8,small:9,micro:10,tiny:11,caption:13,bodyTight:15,body:17,subtitle:20,heading:22,verdict:24},LINE_HEIGHT={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},WEIGHT={regular:"400",medium:"500",bold:"700"},LETTER_SPACING={eyebrow:1,monoWide:.9,headerBrand:-.42,tight:-.35},DEFAULT_MAX_FONT_SCALE=0,SYSTEM_FONT_FAMILY="System",SYSTEM_MONO_FAMILY="monospace",TIERS=["content","heading","control","compact","badge"];function authoredTierSizes(size){let out={};for(let tier of TIERS)out[tier]=size;return out}var NO_FONT_SOURCES=[];function baseType(){return{family:SYSTEM_FONT_FAMILY,mono:SYSTEM_MONO_FAMILY,fontUrl:null,families:{regular:SYSTEM_FONT_FAMILY,medium:SYSTEM_FONT_FAMILY,bold:SYSTEM_FONT_FAMILY,mono:SYSTEM_MONO_FAMILY,monoMedium:SYSTEM_MONO_FAMILY,monoBold:SYSTEM_MONO_FAMILY},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:TYPE_SIZE,tierSizes:authoredTierSizes(TYPE_SIZE),lineHeight:LINE_HEIGHT,weight:WEIGHT,letterSpacing:LETTER_SPACING,scale:1,maxScale:DEFAULT_MAX_FONT_SCALE,scaleCaps:TEXT_SCALE_TIER_CAPS,headingFamily:null,headingWeight:null,fontSources:NO_FONT_SOURCES,roles:TYPE_ROLE_DEFAULTS,typeScale:1}}var NO_SLOTS={},EASING_CURVES=/* @__PURE__ */Object.freeze({standard:/* @__PURE__ */Object.freeze([.2,0,0,1]),emphasized:/* @__PURE__ */Object.freeze([.2,.8,.2,1]),exit:/* @__PURE__ */Object.freeze([.4,0,1,1])});function cssCubicBezier(curve2){return`cubic-bezier(${curve2.join(", ")})`}var MOTION={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:cssCubicBezier(EASING_CURVES.standard),emphasized:cssCubicBezier(EASING_CURVES.emphasized),exit:cssCubicBezier(EASING_CURVES.exit)},reducedMotion:false},LIGHT_COLOR={brand:"#10462E",brandSoft:"rgba(16,70,46,0.10)",brandSofter:"rgba(16,70,46,0.15)",brandBorder:"rgba(16,70,46,0.18)",borderHairlineGreen:"rgba(16,70,46,0.25)",brandBorderStrong:"rgba(16,70,46,0.55)",brandInk:"#10462E",linkInk:"#10462E",surface:"#FFFFFF",surfaceCream:"#FFFFFF",surfaceSubtle:"#F1F5F2",background:"#FFFFFF",borderRingCream:"#E4E4E4",chatGround:"#FFFFFF",composerFill:"#FFFFFF",composerBorder:"rgba(16,70,46,0.75)",shadow:"#0B3421",text:{primary:"#000000",secondary:"#0E462E",muted:"#6B6B6B",placeholder:"rgba(61,61,61,0.75)",onBrand:"#FFFFFF",metaCool:"#3D3D3D",timestamp:"rgba(61,61,61,0.75)"},primary:"#10462E",onPrimary:"#FFFFFF",accent:"#10462E",onAccent:"#FFFFFF",accentEdge:"#07C168",success:"#07C168",danger:"#C03410",onDanger:"#FFFFFF",errorRed:"#C03410",warningStrong:"#A45610",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.12)",badgeBgCaution:"rgba(217,130,29,0.14)",badgeBgCritical:"rgba(192,52,16,0.06)",badgeBgNeutral:"rgba(107,107,107,0.12)",bubbleUser:"#10462E",bubbleAssistant:"#FFFFFF",bubbleVet:"#FFC3BC",onBubbleVet:"#000000",skeleton:"#E9F1E9",scanButtonPink:"#FFC3BC",highlight:"#FFC3BC",onHighlight:"#000000",mark:"#07C168",controlEdge:"rgba(16,70,46,0.18)",structureEdge:"rgba(16,70,46,0.25)",primaryEdge:"#10462E",checkupCardLowRiskBg:"rgba(7,193,104,0.10)",checkupCardConcernBg:"rgba(239,167,0,0.10)",info:"#10462E",badgeBgInfo:"rgba(16,70,46,0.10)",infoEdge:"rgba(16,70,46,0.25)"},EVERFUR_LIGHT=deepFreeze({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:LIGHT_COLOR,space:SPACE,radius:RADIUS,type:baseType(),motion:MOTION,slots:NO_SLOTS}),DARK_COLOR={brand:"#6BD39A",brandSoft:"rgba(107,211,154,0.12)",brandSofter:"rgba(107,211,154,0.18)",brandBorder:"rgba(107,211,154,0.22)",borderHairlineGreen:"rgba(107,211,154,0.28)",brandBorderStrong:"rgba(107,211,154,0.55)",brandInk:"#6BD39A",linkInk:"#6BD39A",surface:"#1C1F23",surfaceCream:"#23272C",surfaceSubtle:"#23272C",background:"#15171A",borderRingCream:"#3A3F45",chatGround:"#1C1F23",composerFill:"#23272C",composerBorder:"rgba(107,211,154,0.75)",shadow:"#000000",text:{primary:"#F5F3F0",secondary:"#A9E4C4",muted:"#9A9A9A",placeholder:"rgba(255,255,255,0.55)",onBrand:"#0E1F17",metaCool:"#C9C9C9",timestamp:"rgba(245,243,240,0.7)"},primary:"#6BD39A",onPrimary:"#0E1F17",accent:"#6BD39A",onAccent:"#0E1F17",accentEdge:"#34D888",success:"#07C168",danger:"#F87171",onDanger:"#0E1F17",errorRed:"#FF6B5B",warningStrong:"#F0A35E",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.18)",badgeBgCaution:"rgba(217,130,29,0.20)",badgeBgCritical:"rgba(185,28,28,0.22)",badgeBgNeutral:"rgba(255,255,255,0.10)",bubbleUser:"#6BD39A",bubbleAssistant:"#1C1F23",bubbleVet:"#FFC3BC",onBubbleVet:"#000000",skeleton:"#23272C",scanButtonPink:"#FFC3BC",highlight:"#605051",onHighlight:"#F5F3F0",mark:"#07C168",controlEdge:"rgba(107,211,154,0.22)",structureEdge:"rgba(107,211,154,0.28)",primaryEdge:"#6BD39A",checkupCardLowRiskBg:"rgba(7,193,104,0.16)",checkupCardConcernBg:"rgba(239,167,0,0.16)",info:"#6BD39A",badgeBgInfo:"rgba(107,211,154,0.12)",infoEdge:"rgba(107,211,154,0.28)"},EVERFUR_DARK=deepFreeze({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:DARK_COLOR,space:SPACE,radius:RADIUS,type:baseType(),motion:MOTION,slots:NO_SLOTS});var EVERFUR_THEME_CONTEXT_SYMBOL=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),globalThemeHost=globalThis,EverfurThemeContext=globalThemeHost[EVERFUR_THEME_CONTEXT_SYMBOL]??(globalThemeHost[EVERFUR_THEME_CONTEXT_SYMBOL]=react.createContext(EVERFUR_LIGHT));EverfurThemeContext.displayName??="EverfurThemeContext";function useEverfurTheme(){return react.useContext(EverfurThemeContext)}function tierMultiplier(type,tier){let cap2=type.scaleCaps[tier];return cap2>0?cap2:void 0}function Text({tier:tier,variant:variant,...props}){let theme=useEverfurTheme(),role=variant===void 0?void 0:theme.type.roles[variant],cap2=tierMultiplier(theme.type,tier??role?.tier??"content"),styled=variant===void 0?props:{...props,style:[{...textRole(theme,variant),color:theme.color.text.primary,flexShrink:1},props.style]};return react.createElement(reactNative.Text,cap2===void 0?styled:{maxFontSizeMultiplier:cap2,...styled})}react.forwardRef(function(props,ref){return react.createElement(reactNative.TextInput,{...props,...ref===null?{}:{ref:ref}})});var REQUIRES=/* @__PURE__ */Object.freeze({chat:/* @__PURE__ */Object.freeze(["chat.message.create"]),records:/* @__PURE__ */Object.freeze(["records.upload.create","records.record.read"]),recordsClinic:/* @__PURE__ */Object.freeze(["records.clinic.create"]),video:/* @__PURE__ */Object.freeze(["video.gait.execute"]),photo:/* @__PURE__ */Object.freeze(["photo.checkup.execute"]),animations:/* @__PURE__ */Object.freeze(["animations.state.read"]),televet:/* @__PURE__ */Object.freeze(["televet.visit.create"]),texting:/* @__PURE__ */Object.freeze(["sms.identity.read","sms.identity.update"]),healthPlan:/* @__PURE__ */Object.freeze(["shop.plan.read","shop.plan.update"])});function requires(name){return REQUIRES[name]}function decideCapability(name,decisions,opts){let keys=requires(name),byResource=/* @__PURE__ */new Map;for(let decision of decisions)byResource.set(decision.resource,decision);if(opts?.isPending===true&&keys.some(key=>!byResource.has(key)))return freezeDecision({name:name,enabled:false,isPending:true,limits:{}});let limits=mergeLimits(keys,byResource);return keys.filter(key=>byResource.get(key)?.granted!==true).length===0?freezeDecision({name:name,enabled:true,isPending:false,limits:limits}):freezeDecision({name:name,enabled:false,isPending:false,limits:limits,disabled:disabledFor(keys,byResource)})}function mergeLimits(keys,byResource){let out={};for(let key of keys){let decisionLimits=byResource.get(key)?.limits;if(decisionLimits)for(let[limitKey,limitValue]of Object.entries(decisionLimits)){let existing=out[limitKey];out[limitKey]=existing===void 0?limitValue:Math.min(existing,limitValue)}}return out}function disabledFor(keys,byResource){for(let key of keys){let explicit=byResource.get(key)?.disabled;if(explicit)/* @__PURE__ */
|
|
26
26
|
return Object.freeze({reason:explicit.reason,level:explicit.level,recoverable:explicit.recoverable})}/* @__PURE__ */
|
|
27
27
|
return Object.freeze({reason:userFacingError("accessDenied"),level:"user_entitlement",recoverable:false})}function freezeDecision(d){let base3={name:d.name,enabled:d.enabled,isPending:d.isPending,limits:/* @__PURE__ */Object.freeze({...d.limits})};return d.disabled!==void 0&&(base3.disabled=d.disabled),/* @__PURE__ */Object.freeze(base3)}function useCapability(name){let{runtime:runtime}=useEverfurContext(),store=runtime.entitlements,snapshot=react.useSyncExternalStore(store.subscribe,store.getSnapshot,store.getSnapshot);return react.useMemo(()=>decideCapability(name,snapshot.decisions,{isPending:snapshot.isPending}),[name,snapshot])}var MIN_OFFSTATE_HEIGHT=48;function selectView(decision){return decision.isPending?"pending":decision.enabled?"enabled":"disabled"}function CapabilityGate(props){let{capability:capability,children:children,renderDisabled:renderDisabled,renderPending:renderPending,style:style}=props,decision=useCapability(capability),view=react.useMemo(()=>selectView(decision),[decision]);switch(view){case"enabled":return children;case"pending":return renderPending?/* @__PURE__ */jsxRuntime.jsx(HostRender,{render:renderPending,fallback:/* @__PURE__ */jsxRuntime.jsx(PendingSkeleton,{capability:capability,style:style})}):/* @__PURE__ */jsxRuntime.jsx(PendingSkeleton,{capability:capability,style:style});case"disabled":return renderDisabled?/* @__PURE__ */jsxRuntime.jsx(HostRender,{render:()=>renderDisabled(decision),fallback:/* @__PURE__ */jsxRuntime.jsx(OffState,{decision:decision,style:style}),resetKey:decision}):/* @__PURE__ */jsxRuntime.jsx(OffState,{decision:decision,style:style});default:return assertNever(view)}}function PendingSkeleton({capability:capability,style:style}){let theme=useEverfurTheme(),styles25=react.useMemo(()=>makeStyles(theme),[theme]);/* @__PURE__ */
|
|
28
28
|
return jsxRuntime.jsx(reactNative.View,{style:[styles25.offstate,style],accessible:true,accessibilityState:{busy:true},accessibilityLabel:`Loading ${capability}`,children:/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:styles25.skeletonBar})})}function OffState({decision:decision,style:style}){let theme=useEverfurTheme(),styles25=react.useMemo(()=>makeStyles(theme),[theme]),message=decision.disabled?.reason??"";/* @__PURE__ */
|
|
29
|
-
return jsxRuntime.jsx(reactNative.View,{style:[styles25.offstate,style],accessible:true,accessibilityRole:"text",accessibilityLabel:message,children:message.length>0?/* @__PURE__ */jsxRuntime.jsx(Text,{style:styles25.offstateText,children:message}):null})}function makeStyles(theme){let{color:color,space:space,radius:radius,type:type}=theme;return reactNative.StyleSheet.create({offstate:{minHeight:MIN_OFFSTATE_HEIGHT,justifyContent:"center",paddingHorizontal:space.lg,paddingVertical:space.md,backgroundColor:color.surfaceCream,borderRadius:radius.md,borderWidth:reactNative.StyleSheet.hairlineWidth,borderColor:color.brandBorder},offstateText:{...face(theme,"regular"),fontSize:type.size.body,lineHeight:Math.round(type.size.body*type.lineHeight.normal),color:color.text.muted},skeletonBar:{height:space.md,borderRadius:radius.xs,backgroundColor:color.brandSofter}})}function toRgba(value){if(typeof value=="number")return argbIntToRgba(value);if(typeof value!="string")return null;let s=value.trim();if(s.length===0)return null;if(s.startsWith("#"))return fromHex(s.slice(1));if(s.toLowerCase().startsWith("0x"))return fromHex(s.slice(2));if(s.toLowerCase().startsWith("rgb"))return fromRgbFunc(s);if(/^[0-9a-fA-F]+$/.test(s)){let hex=fromHex(s);if(hex!==null)return hex}return/^\d+$/.test(s)?argbIntToRgba(Number.parseInt(s,10)):null}function fromHex(hex){let h=hex.trim();if(!/^[0-9a-fA-F]+$/.test(h))return null;if(h.length===3)return{r:dup(h[0]),g:dup(h[1]),b:dup(h[2]),a:1};if(h.length===6)return{r:byte(h,0),g:byte(h,2),b:byte(h,4),a:1};if(h.length===8){let a=byte(h,0);return{r:byte(h,2),g:byte(h,4),b:byte(h,6),a:a/255}}return null}function fromRgbFunc(input){let open=input.indexOf("("),close=input.indexOf(")");if(open<0||close<0||close<open)return null;let parts=input.slice(open+1,close).split(",").map(p=>p.trim());if(parts.length<3)return null;let r=clampByte(Number(parts[0])),g=clampByte(Number(parts[1])),b=clampByte(Number(parts[2]));if(r===null||g===null||b===null)return null;let a=1;if(parts.length>=4){let alpha=Number(parts[3]);if(!Number.isFinite(alpha))return null;a=Math.min(1,Math.max(0,alpha))}return{r:r,g:g,b:b,a:a}}function argbIntToRgba(n){if(!Number.isFinite(n))return null;let
|
|
29
|
+
return jsxRuntime.jsx(reactNative.View,{style:[styles25.offstate,style],accessible:true,accessibilityRole:"text",accessibilityLabel:message,children:message.length>0?/* @__PURE__ */jsxRuntime.jsx(Text,{style:styles25.offstateText,children:message}):null})}function makeStyles(theme){let{color:color,space:space,radius:radius,type:type}=theme;return reactNative.StyleSheet.create({offstate:{minHeight:MIN_OFFSTATE_HEIGHT,justifyContent:"center",paddingHorizontal:space.lg,paddingVertical:space.md,backgroundColor:color.surfaceCream,borderRadius:radius.md,borderWidth:reactNative.StyleSheet.hairlineWidth,borderColor:color.brandBorder},offstateText:{...face(theme,"regular"),fontSize:type.size.body,lineHeight:Math.round(type.size.body*type.lineHeight.normal),color:color.text.muted},skeletonBar:{height:space.md,borderRadius:radius.xs,backgroundColor:color.brandSofter}})}function toRgba(value){if(typeof value=="number")return argbIntToRgba(value);if(typeof value!="string")return null;let s=value.trim();if(s.length===0)return null;if(s.startsWith("#"))return fromHex(s.slice(1));if(s.toLowerCase().startsWith("0x"))return fromHex(s.slice(2));if(s.toLowerCase().startsWith("rgb"))return fromRgbFunc(s);if(/^[0-9a-fA-F]+$/.test(s)){let hex=fromHex(s);if(hex!==null)return hex}return/^\d+$/.test(s)?argbIntToRgba(Number.parseInt(s,10)):null}function fromHex(hex){let h=hex.trim();if(!/^[0-9a-fA-F]+$/.test(h))return null;if(h.length===3)return{r:dup(h[0]),g:dup(h[1]),b:dup(h[2]),a:1};if(h.length===6)return{r:byte(h,0),g:byte(h,2),b:byte(h,4),a:1};if(h.length===8){let a=byte(h,0);return{r:byte(h,2),g:byte(h,4),b:byte(h,6),a:a/255}}return null}function fromRgbFunc(input){let open=input.indexOf("("),close=input.indexOf(")");if(open<0||close<0||close<open)return null;let parts=input.slice(open+1,close).split(",").map(p=>p.trim());if(parts.length<3)return null;let r=clampByte(Number(parts[0])),g=clampByte(Number(parts[1])),b=clampByte(Number(parts[2]));if(r===null||g===null||b===null)return null;let a=1;if(parts.length>=4){let alpha=Number(parts[3]);if(!Number.isFinite(alpha))return null;a=Math.min(1,Math.max(0,alpha))}return{r:r,g:g,b:b,a:a}}function argbIntToRgba(n){if(!Number.isFinite(n))return null;let int3=Math.trunc(n)>>>0,a=int3>>>24&255;return{r:int3>>>16&255,g:int3>>>8&255,b:int3&255,a:a===0?1:a/255}}function byte(hex,at){return Number.parseInt(hex.slice(at,at+2),16)}function dup(nibble){return Number.parseInt(`${nibble??"0"}${nibble??"0"}`,16)}function clampByte(n){return Number.isFinite(n)?Math.min(255,Math.max(0,Math.round(n))):null}function rgbToHex(r,g,b){return`#${hex2(r)}${hex2(g)}${hex2(b)}`.toUpperCase()}function hex2(n){return n.toString(16).padStart(2,"0")}var NEAR_BLACK="#111111",WHITE="#FFFFFF",BLACK="#000000";function readableOn(background){let rgba=toRgba(background);if(rgba===null)return WHITE;let bg=relativeLuminance(rgba),black=relativeLuminance({r:17,g:17,b:17}),white=relativeLuminance({r:255,g:255,b:255});return luminanceContrast(bg,white)>=luminanceContrast(bg,black)?WHITE:NEAR_BLACK}function legibleOn(background,target){let first=readableOn(background);return contrastRatio(first,background)>=target?first:contrastRatio(WHITE,background)>=contrastRatio(BLACK,background)?WHITE:BLACK}function poleForGrounds(grounds){let worst=ink=>grounds.reduce((low,ground)=>Math.min(low,contrastRatio(ink,ground)),Number.POSITIVE_INFINITY);return worst(WHITE)>=worst(BLACK)?WHITE:BLACK}function relativeLuminance(rgba){let r=linearize(rgba.r/255),g=linearize(rgba.g/255),b=linearize(rgba.b/255);return.2126*r+.7152*g+.0722*b}function linearize(channel){return channel<=.03928?channel/12.92:Math.pow((channel+.055)/1.055,2.4)}function luminanceContrast(l1,l2){let lighter=Math.max(l1,l2),darker=Math.min(l1,l2);return(lighter+.05)/(darker+.05)}function contrastRatio(a,b){let fg=toRgba(a),bg=toRgba(b);if(fg===null||bg===null)return 1;let ground=bg.a>=1?bg:{...bg},fore=fg.a>=1?fg:composite(fg,ground);return luminanceContrast(relativeLuminance(fore),relativeLuminance(ground))}function composite(fg,bg){let a=fg.a,mix=(f,g)=>Math.round(f*a+g*(1-a));return{r:mix(fg.r,bg.r),g:mix(fg.g,bg.g),b:mix(fg.b,bg.b),a:1}}function flattenOnto(color,background){let fg=toRgba(color),bg=toRgba(background);if(fg===null||bg===null)return null;let out=fg.a>=1?fg:composite(fg,{...bg});return rgbToHex(out.r,out.g,out.b)}var PUSH_STEP=.05;function pushToContrast(color,grounds,pole,target){let first=grounds[0];if(first===void 0)return pole;let reads=candidate=>grounds.every(ground=>contrastRatio(candidate,ground)>=target);if(toRgba(color)===null)return pole;if(reads(color))return color;let flat=flattenOnto(color,first),from=flat===null?null:toRgba(flat),to=toRgba(pole);if(from===null||to===null)return pole;for(let step=1;step<1/PUSH_STEP;step+=1){let t=step*PUSH_STEP,mix=(a,b)=>Math.round(a+(b-a)*t),candidate=rgbToHex(mix(from.r,to.r),mix(from.g,to.g),mix(from.b,to.b));if(reads(candidate))return candidate}return pole}var PLAN_DS_PRESET={ink:"#10462E",go:"#07C168",alert:"#C03410",tintSage:"#E6ECE8"},DS_THEME_CONTEXT=/* @__PURE__ */Symbol.for("@everfur-health/ui-core#ThemeContext@v1");function dsThemeContext(){let host2=globalThis,ctx=host2[DS_THEME_CONTEXT];return ctx===void 0&&(ctx=react.createContext(null),ctx.displayName="EverfurThemeContext",host2[DS_THEME_CONTEXT]=ctx),ctx}var same=(a,b)=>a.toUpperCase()===b.toUpperCase();function isDark(bg){let rgba=toRgba(bg);return rgba!==null&&relativeLuminance(rgba)<.18}var cache=/* @__PURE__ */new WeakMap;function planThemeWithHost(theme,host2){if(host2===null)return theme;let byHost=cache.get(theme);byHost===void 0&&(byHost=/* @__PURE__ */new WeakMap,cache.set(theme,byHost));let out=byHost.get(host2);return out===void 0&&(out=overlay(theme,host2),byHost.set(host2,out)),out}function overlay(theme,host2){let h=host2.colors,inkMoved=!same(h.ink,PLAN_DS_PRESET.ink),goMoved=!same(h.go,PLAN_DS_PRESET.go),darkHost=theme===EVERFUR_LIGHT&&isDark(h.bg),base3=darkHost?EVERFUR_DARK:theme,c=base3.color,free=key=>darkHost||c[key]===EVERFUR_LIGHT.color[key],color={};inkMoved&&free("primary")&&(Object.assign(color,{primary:h.ink,onPrimary:h.onInk,brand:h.ink,brandInk:h.ink}),free("linkInk")&&(color.linkInk=h.ink),!goMoved&&free("accent")&&Object.assign(color,{accent:h.ink,onAccent:h.onInk})),goMoved&&free("accent")&&Object.assign(color,{accent:h.go,onAccent:h.onGo}),!same(h.alert,PLAN_DS_PRESET.alert)&&free("danger")&&(color.danger=h.alert),!same(h.tintSage,PLAN_DS_PRESET.tintSage)&&free("brandSoft")&&(color.brandSoft=h.tintSage,free("brandSofter")&&(color.brandSofter=h.tintSage)),darkHost&&Object.assign(color,{background:h.bg,surface:h.surface,text:{...c.text,primary:h.text,muted:h.muted},borderRingCream:h.line});let reduced=host2.motion?.reduced===true&&!base3.motion.reducedMotion;return!darkHost&&!reduced&&Object.keys(color).length===0?theme:{...base3,color:{...c,...color},...reduced?{motion:{...base3.motion,reducedMotion:true}}:{}}}function usePlanTheme(){let theme=useEverfurTheme(),host2=react.useContext(dsThemeContext());return react.useMemo(()=>planThemeWithHost(theme,host2),[theme,host2])}function slotBox(slot,borderWidth){if(slot===void 0)return{};let out={};return slot.backgroundColor!==void 0&&(out.backgroundColor=slot.backgroundColor),slot.borderColor!==void 0&&(out.borderColor=slot.borderColor,out.borderWidth=borderWidth??1),slot.borderRadius!==void 0&&(out.borderRadius=slot.borderRadius),out}function slotText(slot){return slot?.textColor===void 0?{}:{color:slot.textColor}}function HealthPlanCartBar(props){let{cart:cart,onCheckout:onCheckout,busy:busy=false,priceFormat:priceFormat,style:style}=guardHostProps(props,["onCheckout"]),theme=usePlanTheme(),styles25=react.useMemo(()=>makeStyles2(theme),[theme]),subtotal=formatHealthPlanPriceWith(cart.subtotal,cart.currency,priceFormat),disabled=cart.count===0||busy,telemetry=useHealthPlanTelemetry(),petRef=useHealthPlanBarPet(useHealthPlanCartDock()?.petRef);/* @__PURE__ */
|
|
30
30
|
return jsxRuntime.jsxs(reactNative.View,{style:[styles25.bar,style],accessibilityLabel:HEALTH_PLAN_TEMPLATES.cartLabel(theme.meta.displayName),children:[
|
|
31
31
|
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:styles25.copy,children:[
|
|
32
32
|
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:styles25.labelRow,children:[
|
|
33
33
|
/* @__PURE__ */jsxRuntime.jsx(Text,{style:styles25.label,children:HEALTH_PLAN_TEMPLATES.cartLabel(theme.meta.displayName)}),cart.count>0?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:styles25.count,accessibilityElementsHidden:true,importantForAccessibility:"no",children:/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"badge",style:styles25.countLabel,children:String(cart.count)})}):null]}),cart.count===0?/* @__PURE__ */jsxRuntime.jsx(Text,{style:styles25.line,children:HEALTH_PLAN_COPY.cartEmpty}):subtotal===null?null:/* @__PURE__ */jsxRuntime.jsxs(Text,{style:styles25.line,children:[HEALTH_PLAN_COPY.subtotal," ",subtotal]})]}),onCheckout===void 0?null:/* @__PURE__ */jsxRuntime.jsx(reactNative.Pressable,{onPress:()=>{trackCheckoutStarted(telemetry,petRef,cart),onCheckout(cart.items)},disabled:disabled,accessibilityRole:"button",accessibilityLabel:HEALTH_PLAN_COPY.checkout,accessibilityState:{disabled:disabled,busy:busy},style:[styles25.checkout,disabled?styles25.dimmed:null],testID:"health-plan-checkout",children:/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"control",style:styles25.checkoutLabel,children:HEALTH_PLAN_COPY.checkout})})]})}function makeStyles2(theme){let{color:color,radius:radius,space:space,type:type,slots:slots}=theme,ink=slots.cartBar?.textColor??color.text.onBrand,fill=slots.cartBar?.backgroundColor??color.brandInk,text2=(size,tint,weight)=>({...face(theme,weight),fontSize:size,lineHeight:Math.round(size*type.lineHeight.snug),color:tint});return reactNative.StyleSheet.create({bar:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:space.md,paddingHorizontal:space.lg,paddingVertical:space.md,borderRadius:radius.lg,backgroundColor:color.brand,...slotBox(slots.cartBar)},copy:{flex:1,gap:2},labelRow:{flexDirection:"row",alignItems:"center",gap:space.sm},label:text2(type.size.body,ink,"bold"),count:{minWidth:22,height:22,paddingHorizontal:space.xs,borderRadius:radius.pill,alignItems:"center",justifyContent:"center",backgroundColor:ink},countLabel:text2(type.size.caption,fill,"bold"),line:text2(type.size.caption,ink,"regular"),checkout:{minHeight:44,paddingHorizontal:space.lg,borderRadius:radius.pill,alignItems:"center",justifyContent:"center",backgroundColor:ink},checkoutLabel:text2(type.size.body,fill,"bold"),dimmed:{opacity:.5}})}var SHEET_MOTION={in:320,out:220,inCurve:"drawer",outCurve:"out"},SCRIM_MOTION={in:240,out:200,inCurve:"ease",outCurve:"ease"},PUSH_MOTION={in:300,out:220,inCurve:"drawer",outCurve:"out"},TOAST_MOTION={in:220,out:160,inCurve:"out",outCurve:"out"},FADE_MOTION={in:160,out:160,inCurve:"ease",outCurve:"ease"},curves={};function curve(name){let made=curves[name];if(made!==void 0)return made;let[a,b,c,d]=name==="drawer"?[.32,.72,0,1]:name==="out"?[.23,1,.32,1]:[.25,.1,.25,1],built=reactNative.Easing.bezier(a,b,c,d);return curves[name]=built,built}function run(values,motions,open,done){let left=motions.length,drivers=motions.map((m,i)=>reactNative.Animated.timing(values[i],{toValue:open?1:0,duration:open?m.in:m.out,easing:curve(open?m.inCurve:m.outCurve),useNativeDriver:true}));for(let d of drivers)d.start(({finished:finished})=>{left-=1,finished&&left===0&&done()});return()=>{for(let d of drivers)d.stop()}}function PlanLinger({draw:draw,motions:motions}){let open=draw!==null,[kept,setKept]=react.useState(null);open&&kept?.draw!==draw&&setKept({draw:draw});let a=react.useRef(new reactNative.Animated.Value(0)).current,b=react.useRef(new reactNative.Animated.Value(0)).current,values=[a,b];react.useEffect(()=>{if(!(!open&&kept===null))return run(values,motions,open,()=>{open||setKept(null)})},[open]);let current=draw??kept?.draw;return current===void 0?null:current(values)}function PlanPushes({id:id,depth:depth,node:node,width:width,paper:paper,still:still}){let[at,setAt]=react.useState({id:id,depth:depth,node:node,leaving:null}),moved=id!==at.id;(moved||node!==at.node)&&setAt({id:id,depth:depth,node:node,leaving:moved?depth<at.depth?at.node:null:at.leaving});let enter=react.useRef(new reactNative.Animated.Value(1)).current,exit=react.useRef(new reactNative.Animated.Value(1)).current,motion=still?FADE_MOTION:PUSH_MOTION,last=react.useRef(depth);react.useLayoutEffect(()=>{let from=last.current;if(last.current=depth,depth>from)return enter.setValue(0),run([enter],[motion],true,()=>{});if(depth!==from)return exit.setValue(1),run([exit],[motion],false,()=>setAt(s=>({...s,leaving:null})))},[id]);let look=v=>still?{opacity:v}:{transform:[{translateX:v.interpolate({inputRange:[0,1],outputRange:[width,0]})}]};/* @__PURE__ */
|
|
34
34
|
return jsxRuntime.jsxs(reactNative.View,{children:[
|
|
35
|
-
/* @__PURE__ */jsxRuntime.jsx(reactNative.Animated.View,{style:look(enter),children:node}),at.leaving===null?null:/* @__PURE__ */jsxRuntime.jsx(reactNative.Animated.View,{pointerEvents:"none",style:[{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:paper},look(exit)],children:at.leaving})]})}var everfurTokens=/* @__PURE__ */Object.freeze({color:/* @__PURE__ */Object.freeze({efDarkGreen:"#10462E",efWhite:"#FFFFFF",efBlack:"#000000",efDustyPink:"#FFC3BC",efBrightGreen:"#07C168",efYellow:"#F2C763",efDustyBlue:"#A8B9DA",efSkyBlue:"#4E98C9",efCharcoal:"#3D3D3D",efIconHoney:"#926F06",efIconLeaf:"#16864A",efIconSky:"#1E7AB7",efIconTeal:"#05827E",efIconCocoa:"#865B3F",efIconNavy:"#223E80",efIconBerry:"#B6407F",efIconAmber:"#B25E05",efIconMoss:"#5E7E1E",efIconSlate:"#5A6087",efIconRose:"#CA4463",efRedDeep:"#6D1D14",efRedBright:"#C03410",bg:"#FFFFFF",bgBrand:"#10462E",bgAccent:"#FFC3BC",bgAccentB2b:"#A8B9DA",bgWarm:"#F2C763",text:"#000000",textBrand:"#10462E",textOnBrand:"#FFFFFF",textCta:"#07C168",textMuted:"#6B6B6B",bgMist:"#F1F5F2",border:"#E4E4E4",borderStrong:"#3D3D3D",hi:"#DAF6E8",hiStrong:"#ABEACC",hiEdge:"#0B8A4E",now:"#0C844B",alert:"#C03410",alertDeep:"#6D1D14",btnPrimaryBg:"#10462E",btnPrimaryText:"#FFFFFF",btnSecondaryBg:"rgba(0, 0, 0, 0)",btnSecondaryText:"#10462E",btnSecondaryBorder:"#10462E",mixMint:"#7FE8AE",mixLegal:"#A9C4B5",mixPromptGreen:"#BFEFD8",mixPromptYellow:"#F7DC9E",mixRx:"#E0E6F2",mixShelf:"#F3F3F3",mixEar:"#F09FA3",efBone:"#FAF9F6",efTennisBall:"#DCEF5A",efFawn:"#E8CAA4",efPine:"#12301F",efPine70:"rgba(18, 48, 31, 0.72)",efLiver:"#7A4330",efMerle:"#AEB8C1",efNose:"#E9B6A6"}),font:/* @__PURE__ */Object.freeze({family:/* @__PURE__ */Object.freeze({base:'Azeret, "Helvetica Neue", Arial, sans-serif',mono:'"Azeret Mono", ui-monospace, "SF Mono", Menlo, monospace'}),size:/* @__PURE__ */Object.freeze({xs:13,sm:15,md:17,lg:20,xl:24,"2xl":32,"3xl":40,"4xl":56}),lineHeight:/* @__PURE__ */Object.freeze({body:1.55,display:1.15}),weight:/* @__PURE__ */Object.freeze({regular:400,medium:500,bold:700})}),space:/* @__PURE__ */Object.freeze({1:4,2:8,3:12,4:16,5:24,6:32,7:48,8:64,9:96}),radius:/* @__PURE__ */Object.freeze({sm:6,md:10,lg:20,xl:28,pill:999}),shadow:/* @__PURE__ */Object.freeze({sm:/* @__PURE__ */Object.freeze({x:0,y:1,blur:2,spread:0,color:"rgba(16, 70, 46, 0.06)"}),md:/* @__PURE__ */Object.freeze({x:0,y:4,blur:16,spread:0,color:"rgba(16, 70, 46, 0.08)"})}),layout:/* @__PURE__ */Object.freeze({container:1200,containerNarrow:720}),motion:/* @__PURE__ */Object.freeze({easing:/* @__PURE__ */Object.freeze({out:/* @__PURE__ */Object.freeze([.23,1,.32,1]),inOut:/* @__PURE__ */Object.freeze([.77,0,.175,1]),drawer:/* @__PURE__ */Object.freeze([.32,.72,0,1]),expo:/* @__PURE__ */Object.freeze([.16,1,.3,1]),bark:/* @__PURE__ */Object.freeze([.34,1.56,.64,1])}),duration:/* @__PURE__ */Object.freeze({press:160,fade:200,enter:300,sheet:420,sheetOut:240,draw:900})}),web:/* @__PURE__ */Object.freeze({serif:'Azeret, "Helvetica Neue", Arial, sans-serif',sans:'Azeret, "Helvetica Neue", Arial, sans-serif',tSmall:14,max:1312}),role:/* @__PURE__ */Object.freeze({color:/* @__PURE__ */Object.freeze({ink:"#10462E",go:"#07C168",muted:"#6B6B6B",line:"#E4E4E4",pink50:"#FFE1DE",tintSage:"#E6ECE8",tintPink:"#FFEAE8",tintPinkSoft:"#FFF6F5",tintBlue:"#EAEEF6",tintYellow:"#FCF0D6",tintYellowEdge:"#F6D892",tintRed:"#FBF1EE",tintGo:"#DCF6EA",icoGrey:"#6B6B6B",icoSage:"#819E90",icoBlue:"#4E98C9",icoWarm:"#D6D0C2",icoAmber:"#B67B3F",amberText:"#A05E32",wxSun:"#F2C763",wxSunEdge:"#D5AD47",wxCloud:"#FFFFFF",wxCloudEdge:"#DEDEDE",wxCloudDark:"#EAEAEA",wxCloudDarkEdge:"#C5C5C5",wxRain:"#75AFD5",wxSnow:"#AFD1E7",wxMist:"#D4D4D4",cwShelf:"#FFFFFF",cwShelfDeep:"#F1F4F2",cwRx:"#E0E6F2",cwRxInk:"#5A6087",cwEdgeC:"#C6D3CD",nItch:"#CA4463",nJoints:"#5E7E1E",nItchC:"#FFC3BC",nJointsC:"#D8E0C9",lvlGood:"#77DDAC",lvlOk:"#F4CF7A",lvlHot:"#DC8F7C",lvlStorm:"#8DA4BB",mapLand:"#F5F5F5",mapEdge:"#EAEAEA",mapPark:"#D7F5E7",mapWater:"#D8E0EE",mapSand:"#FCF3DD"}),size:/* @__PURE__ */Object.freeze({max:1440,gutter:16,sideW:220,cardPad:16,barH:48,tabH:58,dock:64,side:16,stackGap:12})})});var BLOCK_BOX={shown:true,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},BLOCK_TEXT={shown:true,color:"text",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},blockBox=p=>({...BLOCK_BOX,...p}),blockText=p=>({...BLOCK_TEXT,...p}),everfurMetrics={button:{ink:{fill:false,minHeight:52,paddingX:24,gap:8,borderWidth:1.5,ring:false,fontSize:17,fontWeight:700,lineHeight:1,iconSize:24},go:{fill:false,minHeight:52,paddingX:24,gap:8,borderWidth:1.5,ring:false,fontSize:17,fontWeight:700,lineHeight:1,iconSize:24},outline:{fill:false,minHeight:52,paddingX:24,gap:8,borderWidth:1.5,ring:false,fontSize:17,fontWeight:400,lineHeight:1,iconSize:24},pink:{fill:true,minHeight:60,paddingX:16,gap:8,borderWidth:1,ring:false,fontSize:18,fontWeight:700,lineHeight:1,iconSize:24},danger:{fill:false,minHeight:46,paddingX:16,gap:8,borderWidth:1.5,ring:false,fontSize:15,fontWeight:700,lineHeight:1.55,iconSize:20},inkSm:{fill:false,minHeight:46,paddingX:16,gap:8,borderWidth:1.5,ring:false,fontSize:15,fontWeight:700,lineHeight:1,iconSize:20},goSm:{fill:false,minHeight:46,paddingX:16,gap:8,borderWidth:1.5,ring:false,fontSize:15,fontWeight:700,lineHeight:1,iconSize:20},outlineSm:{fill:false,minHeight:46,paddingX:16,gap:8,borderWidth:1.5,ring:false,fontSize:15,fontWeight:400,lineHeight:1,iconSize:20},pinkSm:{fill:true,minHeight:46,paddingX:16,gap:8,borderWidth:1,ring:false,fontSize:15,fontWeight:700,lineHeight:1,iconSize:20},row:{fill:false,minHeight:36,paddingX:14,gap:8,borderWidth:1.5,ring:false,fontSize:14,fontWeight:400,lineHeight:1,iconSize:17},outlineInSheetWeight:700,money:{fill:false,minHeight:52,paddingX:24,gap:8,borderWidth:1,ring:false,fontSize:17,fontWeight:700,lineHeight:1,iconSize:24,bg:"pink",fg:"ink",edgeColor:"ink"},moneySm:{fill:false,minHeight:46,paddingX:16,gap:8,borderWidth:1,ring:false,fontSize:15,fontWeight:700,lineHeight:1,iconSize:20,bg:"pink",fg:"ink",edgeColor:"ink"},warn:{fill:false,minHeight:52,paddingX:24,gap:8,borderWidth:1.5,ring:false,fontSize:17,fontWeight:700,lineHeight:1,iconSize:24,bg:"none",fg:"alertDeep",edgeColor:"alert"},warnSm:{fill:false,minHeight:46,paddingX:16,gap:8,borderWidth:1.5,ring:false,fontSize:15,fontWeight:700,lineHeight:1,iconSize:20,bg:"none",fg:"alertDeep",edgeColor:"alert"},text:{fontSize:15,fontWeight:700,lineHeight:1.4,color:"ink",pressOpacity:.6}},pill:{minHeight:24,paddingX:10,fontSize:12,fontWeight:700,lineHeight:1,letterSpacing:.72,ring:{soon:1.25,overdue:1.25,clear:1.5,later:1.25,plain:1.5,new:1.5},plainRingAlpha:.2,dot:6,dotGap:6,allergyDot:{size:6,gap:6,color:"alert"},mono:true,upper:true,tones:{rx:{bg:"#E0E6F2",fg:"ink",ring:0,ringColor:"ink"},soon:{bg:"surface",fg:"ink",ring:1.25,ringColor:"tintYellowEdge"},overdue:{bg:"surface",fg:"alert",ring:1.25,ringColor:"alert"},clear:{bg:"surface",fg:"go",ring:1.5,ringColor:"go"},stable:{bg:"tintGo",fg:"ink",ring:0,ringColor:"ink"},later:{bg:"surface",fg:"muted",ring:1.25,ringColor:"line"},plain:{bg:"surface",fg:"ink",ring:1.5,ringColor:"ink/0.2"},new:{bg:"surface",fg:"ink",ring:1.5,ringColor:"go"},pink:{bg:"tintPink",fg:"ink",ring:0,ringColor:"ink"},watch:{bg:"#F9E6B9",fg:"ink",ring:0,ringColor:"ink"},high:{bg:"surface",fg:"alert",ring:1.25,ringColor:"alert"},allergy:{bg:"surface",fg:"alertDeep",ring:1.25,ringColor:"alert"}}},chip:{minHeight:42,paddingX:16,gap:8,borderWidth:1,fontSize:15,fontWeight:500,lineHeight:1.3},card:{padding:16,radius:20,borderWidth:1,titleSize:18,titleWeight:700,titleLineHeight:1.25,titleTracking:-.36,titleGap:12,leadSize:15,leadLineHeight:1.5,leadGap:12,headGapX:16,headGapY:8,headGap:12,bodySize:17,bodyLineHeight:1.55,ghost:{borderStyle:"dashed",borderColor:"#B9C9C2"}},sectionHeader:{gapX:12,gapY:8,marginTop:8},kicker:{fontSize:12,fontWeight:700,lineHeight:1.55,letterSpacing:.96,gap:8},quantityStepper:{borderWidth:1,borderColor:"line",ring:false,button:40,icon:18,valueMinWidth:28,offColor:"line",offOpacity:1,valueSize:17,valueWeight:700,valueLineHeight:1.55},tabs:{minHeight:44,gap:6,fontSize:15,fontWeight:500,currentWeight:700,lineHeight:1.55,indicator:3,hairline:1,dot:7},sheet:{radius:28,grabHeight:20,grabBarWidth:36,grabBarHeight:5,grabBarRadius:3,headPaddingTop:4,headPaddingX:16,headPaddingBottom:12,headGap:12,titlesGap:2,titleSize:18,close:36,closeIcon:20,bodyGap:12,bodyPaddingX:16,bodyPaddingBottom:24,actsGap:12,actsMarginTop:4},empty:{gap:8,titleSize:22,titleWeight:500,titleLineHeight:1.2,titleTracking:-.33,leadSize:15,leadLineHeight:1.5,actsGap:12,actsMarginTop:12,buttonMinWidth:200,linkMinHeight:44,linkPaddingX:4,linkSize:15,linkWeight:700,linkUnderlineOffset:3},skeleton:{gap:10,lineHeight:12,widths:[100,82,64]},summary:{paddingX:24,paddingY:0,radius:20,borderWidth:1,background:"surface",shadow:{color:"",x:0,y:0,blur:0,spread:0},rowDivider:1,rowMinHeight:0,rowCenter:false,rowPaddingY:14,termColor:"muted",valueColor:"ink",tabular:false,totalRowMinHeight:0,totalTermSize:15,totalTermWeight:400,totalTermColor:"muted",totalWeight:700,rowGapX:16,rowGapY:2,termSize:15,termLineHeight:1.55,valueSize:15,valueWeight:700,valueLineHeight:1.4,totalSize:20,totalLineHeight:1.4,off:{shown:true,size:15,weight:700,lineHeight:21,color:"go",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0}},icon:{size:24},timeline:{row:{shown:true,w:361,h:69.281,padding:[0,0,24,0],marginTop:0,marginBottom:0,gap:[16,16],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},done:{shown:true,w:28,h:28,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[14,14],bg:"ink",edge:{width:2,color:"ink",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"surface",fit:"cover",x:0,y:0,dy:0},now:{shown:true,w:28,h:28,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[14,14],bg:"surface",edge:{width:2,color:"ink",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"text",fit:"cover",x:0,y:0,dy:0},next:{shown:true,w:28,h:28,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[14,14],bg:"surface",edge:{width:2,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"text",fit:"cover",x:0,y:0,dy:0},nowInner:{size:10,color:"go"},check:{shown:true,w:16,h:16,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"surface",fit:"cover",x:0,y:0,dy:0},lineDoneDone:{x:13,top:30,bottom:2,width:2,color:"ink"},lineDoneNow:{x:13,top:30,bottom:2,width:2,color:"ink"},lineNowNext:{x:13,top:30,bottom:2,width:2,color:"line"},title:{shown:true,size:17,weight:700,lineHeight:22.1,color:"ink",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:3},head:{shown:true,w:317,h:27,padding:[3,0,0,0],marginTop:0,marginBottom:0,gap:[8,4],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"ink",fit:"cover",x:0,y:0,dy:0},nextTitle:{shown:true,size:17,weight:700,lineHeight:22.1,color:"muted",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:3},when:{shown:true,size:13,weight:400,lineHeight:18.2,color:"muted",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:2,paddingTop:0},text:{shown:true,size:15,weight:400,lineHeight:22.5,color:"text",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:2,paddingTop:0}},thumbnail:{xs:{frame:{shown:true,w:48,h:48,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[6,6],bg:"surface",edge:{width:1,color:"line",ring:true},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"contain",x:0,y:0,dy:0},img:{shown:false,w:48,h:48,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[6,6],bg:"surface",edge:{width:1,color:"line",ring:true},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"contain",x:0,y:0,dy:0},empty:{shown:true,w:48,h:48,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[10,10],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"#1E7AB7",fit:"cover",x:0,y:0,dy:0},icon:{shown:true,w:22,h:22,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"#1E7AB7",fit:"cover",x:0,y:0,dy:0},top:false},sm:{frame:{shown:true,w:64,h:64,padding:[8,8,8,8],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[14,14],bg:"#F3F3F3",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},img:{shown:true,w:48,h:48,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"contain",x:0,y:0,dy:0},empty:{shown:true,w:64,h:64,padding:[8,8,8,8],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[14,14],bg:"#F3F3F3",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},icon:{shown:true,w:22,h:22,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"#1E7AB7",fit:"cover",x:0,y:0,dy:0},top:false},md:{frame:{shown:true,w:156,h:156,padding:[0,0,0,0],marginTop:0,marginBottom:6,gap:[0,0],minHeight:0,radius:[20,20],bg:"#F5F5F5",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},img:{shown:true,w:156,h:156,padding:[10,10,10,10],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"contain",x:0,y:0,dy:0},empty:{shown:true,w:156,h:156,padding:[0,0,0,0],marginTop:0,marginBottom:6,gap:[0,0],minHeight:0,radius:[20,20],bg:"#F5F5F5",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},icon:{shown:true,w:22,h:22,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"#1E7AB7",fit:"cover",x:0,y:0,dy:0},top:false},lg:{frame:{shown:true,w:174.5,h:174.5,padding:[0,0,0,0],marginTop:0,marginBottom:8,gap:[0,0],minHeight:0,radius:[20,20],bg:"#F3F3F3",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},img:{shown:true,w:174.5,h:174.5,padding:[14,14,18,14],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"contain",x:0,y:0,dy:0},empty:{shown:true,w:174.5,h:174.5,padding:[0,0,0,0],marginTop:0,marginBottom:8,gap:[0,0],minHeight:0,radius:[20,20],bg:"#F3F3F3",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},icon:{shown:true,w:22,h:22,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"#1E7AB7",fit:"cover",x:0,y:0,dy:0},top:false}},text:{display:{shown:true,size:40,weight:500,lineHeight:39.2,color:"ink",tracking:-1.2,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},headline:{shown:true,size:30,weight:500,lineHeight:33,color:"ink",tracking:-.45,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},title:{shown:true,size:22,weight:500,lineHeight:26.4,color:"ink",tracking:-.33,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},heading:{shown:true,size:18,weight:700,lineHeight:22.5,color:"ink",tracking:-.36,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},body:{shown:true,size:17,weight:400,lineHeight:26.35,color:"text",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},lead:{shown:true,size:15,weight:400,lineHeight:21.75,color:"text",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},label:{shown:true,size:15,weight:700,lineHeight:21,color:"ink",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},meta:{shown:true,size:13,weight:400,lineHeight:18.85,color:"muted",tracking:0,face:"mono",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},caption:{shown:true,size:13,weight:400,lineHeight:19.5,color:"muted",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},overline:{shown:true,size:12,weight:700,lineHeight:16.8,color:"muted",tracking:.72,face:"mono",upper:true,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},kicker:{shown:true,size:12,weight:700,lineHeight:18.6,color:"muted",tracking:.96,face:"mono",upper:true,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0}},field:{gap:6,label:{shown:true,size:15,weight:700,lineHeight:21,color:"ink",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},input:{shown:true,w:361,h:52,padding:[0,16,0,16],marginTop:0,marginBottom:0,gap:[10,10],minHeight:52,radius:[10,10],bg:"surface",edge:{width:1.5,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"text",fit:"cover",x:0,y:0,dy:0},focusEdge:"ink",errorEdge:"alert",value:{shown:true,size:17,weight:400,lineHeight:26.35,color:"text",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:1},valueInset:[2,1],icon:{shown:true,w:20,h:20,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"muted",fit:"cover",x:0,y:0,dy:0},area:{shown:true,w:361,h:158,padding:[12,16,12,16],marginTop:0,marginBottom:0,gap:[10,10],minHeight:52,radius:[10,10],bg:"surface",edge:{width:1.5,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},areaValue:{shown:true,size:17,weight:400,lineHeight:25.5,color:"text",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:2},areaValueMinHeight:132,areaInset:[2,2],hint:{shown:true,size:13,weight:400,lineHeight:19.5,color:"muted",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},error:{shown:true,size:15,weight:400,lineHeight:21.75,color:"alertDeep",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},placeholder:"muted"},checkbox:{row:{shown:true,w:361,h:45,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[12,12],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},labelX:34,box:{shown:true,w:20,h:20,padding:[0,0,0,0],marginTop:1,marginBottom:0,gap:[0,0],minHeight:0,radius:[6,6],bg:"surface",edge:{width:1.5,color:"icoSage",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},on:{shown:true,w:20,h:20,padding:[0,0,0,0],marginTop:1,marginBottom:0,gap:[0,0],minHeight:0,radius:[6,6],bg:"ink",edge:{width:1.5,color:"ink",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},tick:{w:5,h:10,stroke:2,color:"surface",rotate:45,dy:-1},label:{shown:true,size:15,weight:400,lineHeight:22.5,color:"text",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},boxed:{shown:true,w:361,h:50.5,padding:[14,16,14,16],marginTop:0,marginBottom:0,gap:[12,12],minHeight:0,radius:[10,10],bg:"bgMist",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0}},choice:{row:{shown:true,w:361,h:56.344,padding:[14,16,14,16],marginTop:0,marginBottom:0,gap:[12,12],minHeight:0,radius:[10,10],bg:"surface",edge:{width:1.5,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"text",fit:"cover",x:0,y:0,dy:0},selected:{shown:true,w:361,h:56.344,padding:[14,16,14,16],marginTop:0,marginBottom:0,gap:[12,12],minHeight:0,radius:[10,10],bg:"pink",edge:{width:1.5,color:"ink",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"text",fit:"cover",x:0,y:0,dy:0},radio:{shown:true,w:20,h:20,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[10,10],bg:"surface",edge:{width:1.5,color:"icoSage",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},radioOn:{shown:true,w:20,h:20,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[10,10],bg:"surface",edge:{width:6,color:"ink",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},textX:34,title:{shown:true,size:17,weight:700,lineHeight:22.1,color:"ink",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},strut:26.35,meta:{shown:true,size:13,weight:400,lineHeight:18.2,color:"muted",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:2,paddingTop:0},end:{shown:true,size:13,weight:400,lineHeight:20.15,color:"muted",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},group:{gap:8,legend:{shown:true,size:15,weight:700,lineHeight:21,color:"ink",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},legendPaddingX:2,legendGap:0}},switch:{track:{shown:true,w:48,h:28,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[999,999],bg:"#D0D6D3",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},on:"ink",thumb:{size:22,inset:3,travel:20,color:"surface",shadow:{color:"rgba(16, 70, 46, 0.06)",x:0,y:1,blur:2,spread:0}}},iconButton:{bare:{shown:true,w:44,h:44,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[22,22],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"ink",fit:"cover",x:0,y:0,dy:0},bareIcon:22,offColor:"line",ring:{shown:true,w:36,h:36,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[18,18],bg:"surface",edge:{width:1.5,color:"ink",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"ink",fit:"cover",x:0,y:0,dy:0},ringIcon:18,ringPressed:"tintSage",ringPressScale:.94},link:{text:{shown:true,size:17,weight:400,lineHeight:22.1,color:"ink",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"underline",decoOffset:3,decoThickness:0,marginTop:0,paddingTop:0},danger:{shown:true,size:15,weight:700,lineHeight:23.25,color:"alert",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"underline",decoOffset:3,decoThickness:0,marginTop:0,paddingTop:0},inline:{shown:true,size:17,weight:400,lineHeight:26.35,color:"text",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"underline",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0}},lists:{rows:{row:{shown:true,w:327,h:94.781,padding:[16,0,16,0],marginTop:0,marginBottom:0,gap:[16,8],minHeight:0,radius:[0,0],bg:"none",edge:{width:1,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"text",fit:"cover",x:0,y:0,dy:0},title:{shown:true,size:17,weight:700,lineHeight:22.1,color:"ink",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},subtitle:{shown:true,size:13,weight:400,lineHeight:18.85,color:"muted",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:2,paddingTop:0}},tiles:{list:{shown:true,w:343,h:175.813,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[4,4],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},outdent:8,row:{shown:true,w:343,h:62.281,padding:[10,8,10,8],marginTop:0,marginBottom:0,gap:[12,12],minHeight:0,radius:[10,10],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"text",fit:"cover",x:0,y:0,dy:0},leading:22,leadingFace:40,icon:{shown:true,w:20,h:20,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"muted",fit:"cover",x:0,y:0,dy:0},text:{shown:true,w:261,h:42.281,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[2,2],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},title:{shown:true,size:17,weight:700,lineHeight:22.1,color:"ink",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},subtitle:{shown:true,size:13,weight:400,lineHeight:18.2,color:"muted",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},pressed:"#EDF2EF",alert:{bg:"tintRed",icon:"alert",title:"alertDeep",subtitle:"alert"}},end:{text:{shown:true,size:15,weight:400,lineHeight:23.25,color:"muted",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},gap:8,chevron:{shown:true,w:20,h:20,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"#819D90",fit:"cover",x:0,y:0,dy:0}},section:{title:{shown:true,size:18,weight:700,lineHeight:22.5,color:"ink",tracking:-.36,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},titleGap:12,head:{shown:true,w:361,h:22.5,padding:[0,0,0,0],marginTop:8,marginBottom:0,gap:[12,8],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"text",fit:"cover",x:0,y:0,dy:0},note:{shown:true,size:13,weight:400,lineHeight:19.5,color:"muted",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:12,paddingTop:0}},avatar:{sizes:{xs:20,sm:36,md:48,lg:64,xl:128},face:40,bg:"surface",edge:{width:1,color:"line",ring:true},initials:{shown:true,size:15,weight:700,lineHeight:23.25,color:"ink",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},initialsXs:{shown:true,size:9,weight:700,lineHeight:13.95,color:"ink",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},tints:{default:"tintPink",pink:"#FFCFC9",blue:"#C2CEE5",yellow:"#F6D78F",sage:"#C6D3CD"},ring:{width:2,offset:2,color:"go"},ringXl:{width:3,offset:4,color:"go"},dot:{size:12,edge:2,edgeColor:"surface"}},stack:{size:28,overlap:-8,initialsSize:12,halo:{width:2,color:"surface"}},banner:{box:{shown:true,w:361,h:155.391,padding:[16,16,16,16],marginTop:0,marginBottom:0,gap:[12,4],minHeight:0,radius:[20,20],bg:"#F1F5F2",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},icon:{shown:true,w:22,h:22,padding:[0,0,0,0],marginTop:1,marginBottom:0,gap:[0,0],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"ink",fit:"cover",x:0,y:0,dy:0},iconRows:3,kicker:{shown:true,size:12,weight:700,lineHeight:16.8,color:"#5B5B5B",tracking:.72,face:"mono",upper:true,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},title:{shown:true,size:17,weight:700,lineHeight:22.1,color:"ink",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},text:{shown:true,size:15,weight:400,lineHeight:21.75,color:"text",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},acts:{shown:true,w:295,h:21,padding:[0,0,0,0],marginTop:8,marginBottom:0,gap:[16,8],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"text",fit:"cover",x:0,y:0,dy:0},link:{shown:true,size:15,weight:700,lineHeight:21,color:"ink",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},tones:{info:{bg:"#F1F5F2",icon:"ink"},success:{bg:"tintGo",icon:"ink"},warn:{bg:"#FCF0D6",icon:"#926F06"},danger:{bg:"tintRed",icon:"alert"}}},toast:{box:{shown:true,w:200.281,h:40.25,padding:[10,16,10,16],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[999,999],bg:"ink",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"surface",fit:"cover",x:0,y:0,dy:0},text:{shown:true,size:15,weight:400,lineHeight:20.25,color:"onInk",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:10},inset:16,rise:8,fade:200,hold:2600},spinner:{size:16,border:2,turn:700,openSide:true,reducedOpacity:.5},progress:{track:{shown:true,w:361,h:4,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[999,999],bg:"line",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},fill:"go",move:300},divider:{width:1,color:"line",label:{shown:true,size:12,weight:400,lineHeight:18.6,color:"muted",tracking:.72,face:"mono",upper:true,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},labelGap:12,labelLine:{width:1,color:"line"}},errorInline:{text:{shown:true,size:15,weight:400,lineHeight:21,color:"alertDeep",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},acts:{shown:true,w:361,h:21,padding:[0,0,0,0],marginTop:8,marginBottom:0,gap:[16,8],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"text",fit:"cover",x:0,y:0,dy:0},link:{shown:true,size:15,weight:700,lineHeight:21,color:"ink",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0}},linkPressedOpacity:.6},variants:{drawer:{frame:{shown:true,w:393,h:226.594,padding:[10,20,40,20],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[28,0],bg:"surface",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"ink",fit:"cover",x:0,y:293.406,dy:0},maxHeight:.8,grab:{shown:true,w:40,h:5,padding:[0,0,0,0],marginTop:0,marginBottom:10,gap:[0,0],minHeight:0,radius:[2.5,2.5],bg:"#DAD7D1",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"ink",fit:"cover",x:0,y:0,dy:0},top:{shown:true,w:353,h:40,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"ink",fit:"cover",x:0,y:0,dy:0},kicker:{shown:true,size:11,weight:400,lineHeight:16.5,color:"muted",tracking:.88,face:"mono",upper:true,wrap:"auto",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},close:{shown:true,w:40,h:40,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[20,20],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"ink",fit:"cover",x:0,y:0,dy:0},closeEnd:-8,closeIcon:22,title:{shown:true,size:24,weight:800,lineHeight:27.6,color:"ink",tracking:-.24,face:"serif",upper:false,wrap:"balance",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},body:{shown:true,w:353,h:82,padding:[0,0,0,0],marginTop:12,marginBottom:0,gap:[10,10],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},text:{shown:true,size:16,weight:400,lineHeight:24,color:"text",tracking:0,face:"sans",upper:false,wrap:"auto",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},scrim:"ink/0.38",motion:{enterMs:320,enterEasing:[.32,.72,0,1],exitMs:220,exitEasing:[.23,1,.32,1],scrimEnterMs:240,scrimExitMs:200,scrimEasing:[.25,.1,.25,1]}},button:{ink:{fill:false,minHeight:48,paddingX:22,gap:8,borderWidth:0,ring:false,fontSize:16,fontWeight:700,lineHeight:1.5,iconSize:20},outline:{fill:false,minHeight:48,paddingX:22,gap:8,borderWidth:1.5,ring:true,fontSize:16,fontWeight:700,lineHeight:1.5,iconSize:20},sm:{fill:false,minHeight:40,paddingX:16,gap:8,borderWidth:1.5,ring:true,fontSize:15,fontWeight:700,lineHeight:1.5,iconSize:20},lg:{fill:false,minHeight:56,paddingX:28,gap:8,borderWidth:0,ring:false,fontSize:17,fontWeight:700,lineHeight:1.5,iconSize:20},disabledOpacity:.32,press:.97,transition:"transform 160ms cubic-bezier(0.23, 1, 0.32, 1), opacity 160ms ease"},segmented:{track:{shown:true,w:361,h:44,padding:[4,4,4,4],marginTop:0,marginBottom:0,gap:[4,4],minHeight:0,radius:[22,22],bg:"surface",edge:{width:1.5,color:"#DAD7D1",ring:true},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"ink",fit:"cover",x:0,y:0,dy:0},option:{shown:true,w:115,h:36,padding:[0,6,0,6],marginTop:0,marginBottom:0,gap:[0,0],minHeight:36,radius:[18,18],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"ink",fit:"cover",x:0,y:0,dy:0},label:{shown:true,size:14,weight:700,lineHeight:21,color:"ink",tracking:0,face:"sans",upper:false,wrap:"auto",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},chosen:{shown:true,w:115,h:36,padding:[0,6,0,6],marginTop:0,marginBottom:0,gap:[0,0],minHeight:36,radius:[18,18],bg:"ink",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"onInk",fit:"cover",x:0,y:0,dy:0},chosenLabel:{shown:true,size:14,weight:700,lineHeight:21,color:"onInk",tracking:0,face:"sans",upper:false,wrap:"auto",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},press:.96,transition:"background-color 160ms ease, transform 160ms cubic-bezier(0.23, 1, 0.32, 1)"},stepper:{track:{shown:true,w:110,h:40,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[20,20],bg:"surface",edge:{width:1.5,color:"#DAD7D1",ring:true},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"ink",fit:"cover",x:0,y:0,dy:0},button:{shown:true,w:40,h:40,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[20,20],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"ink",fit:"cover",x:0,y:0,dy:0},icon:16,value:{shown:true,size:15.5,weight:800,lineHeight:23.25,color:"ink",tracking:0,face:"sans",upper:false,wrap:"auto",tabular:true,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},valueWidth:30,disabledOpacity:.3,press:.9,transition:"transform 160ms cubic-bezier(0.23, 1, 0.32, 1)"},summary:{box:{shown:true,w:361,h:144,padding:[6,16,6,16],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[16,16],bg:"surface",edge:{width:0,color:"line",ring:false},shadow:{color:"rgba(38, 37, 35, 0.06)",x:0,y:1,blur:3,spread:0},center:false,color:"ink",fit:"cover",x:0,y:0,dy:0},row:{shown:true,w:329,h:34,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[12,12],minHeight:34,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"ink",fit:"cover",x:0,y:0,dy:0},term:{shown:true,size:15,weight:400,lineHeight:22.5,color:"#4A4845",tracking:0,face:"sans",upper:false,wrap:"auto",tabular:true,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},value:{shown:true,size:15,weight:400,lineHeight:22.5,color:"ink",tracking:0,face:"sans",upper:false,wrap:"auto",tabular:true,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},totalRow:{shown:true,w:329,h:42,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[12,12],minHeight:42,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"ink",fit:"cover",x:0,y:0,dy:0},totalTerm:{shown:true,size:17,weight:800,lineHeight:25.5,color:"ink",tracking:0,face:"sans",upper:false,wrap:"auto",tabular:true,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},total:{shown:true,size:17,weight:800,lineHeight:25.5,color:"ink",tracking:0,face:"sans",upper:false,wrap:"auto",tabular:true,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},renewRow:{shown:true,w:329,h:28,padding:[0,0,0,0],marginTop:-6,marginBottom:0,gap:[12,12],minHeight:28,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"ink",fit:"cover",x:0,y:0,dy:0},renewTerm:{shown:true,size:14,weight:400,lineHeight:21,color:"#4A4845",tracking:0,face:"sans",upper:false,wrap:"auto",tabular:true,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},renew:{shown:true,size:14,weight:400,lineHeight:21,color:"ink",tracking:0,face:"sans",upper:false,wrap:"auto",tabular:true,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},inset:{shown:true,w:361,h:88,padding:[6,16,6,16],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[16,16],bg:"bg",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"ink",fit:"cover",x:0,y:0,dy:0}},toast:{box:{shown:true,w:361,h:64.594,padding:[12,15,12,15],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[16,16],bg:"ink",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"onInk",fit:"cover",x:16,y:62,dy:0},text:{shown:true,size:14.5,weight:400,lineHeight:20.3,color:"onInk",tracking:0,face:"sans",upper:false,wrap:"auto",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:12},motion:{enterMs:220,exitMs:160,easing:[.23,1,.32,1],rise:-8}},focus:{width:2,offset:2,color:"ink"}},press:{button:.97,iconButton:.94,card:.98},colors:{grab:"#C9C9C9",scrim:"rgba(0, 0, 0, 0.32)",watch:"#F9E6B9",planInk:"#262523",planOnInk:"#FFFFFF",planAccent:"#FFCE34",planLink:"#00707C",planAccentWash:"#FFF7DC",planAccentChip:"#FFE7A1",planLinkWash:"#E0FDFF",planLinkChip:"#C8F4F8"}},everfurBlocksMetrics={order:{card:blockBox({w:361,h:163.547}),top:blockBox({w:361,h:39.547,gap:[12,12]}),title:blockText({size:16,weight:700,lineHeight:20,tracking:-.16}),meta:blockText({size:13,weight:400,lineHeight:17.55,color:"muted"}),total:blockText({size:16,weight:700,lineHeight:24.8,tabular:true}),shots:blockBox({w:361,h:64,marginTop:8,gap:[8,8]}),acts:blockBox({w:361,h:40,marginTop:12,gap:[8,8]}),go:blockBox({w:176.5,h:40,padding:[0,12,0,12],gap:[6,6],minHeight:40,radius:[999,999],bg:"go",center:true}),goText:blockText({size:14,weight:700,lineHeight:21.7}),plain:blockBox({w:176.5,h:40,padding:[0,12,0,12],gap:[6,6],minHeight:40,radius:[999,999],bg:"#F3F3F3",center:true}),plainText:blockText({size:14,weight:700,lineHeight:21.7}),note:blockText({size:13,weight:500,lineHeight:17.55,marginTop:8}),icon:blockBox({w:16,h:16}),actsColumns:2,shotPressScale:.96},orderQuiet:{top:blockBox({w:361,h:43.547,gap:[12,12]}),when:blockBox({w:300.063,h:24,gap:[8,4],center:true}),title:blockText({size:16,weight:700,lineHeight:20.8}),chip:blockBox({w:86.031,h:24,padding:[0,9,0,5],gap:[4,4],minHeight:24,radius:[999,999],bg:"tintGo",center:true,color:"ink"}),chipText:blockText({size:12,weight:700,lineHeight:15.6,color:"ink"}),chipIcon:blockBox({w:14,h:14,color:"ink"}),meta:blockText({size:13,weight:400,lineHeight:17.55,color:"muted",marginTop:2}),total:blockText({size:16,weight:700,lineHeight:24.8,tabular:true}),shots:blockBox({w:361,h:64,marginTop:8,gap:[8,8]}),shot:blockBox({w:64,h:64,radius:[14,14],bg:"#F3F3F3"}),shotImg:blockBox({w:64,h:64,padding:[6.391,6.391,6.391,6.391],fit:"contain"}),shotBlend:"multiply",acts:blockBox({w:361,h:44,marginTop:12,gap:[12,12],center:true}),plain:blockBox({w:162.109,h:44,padding:[0,16,0,16],gap:[6,6],minHeight:44,radius:[999,999],bg:"#F3F3F3",center:true}),plainText:blockText({size:14,weight:700,lineHeight:21.7}),icon:blockBox({w:16,h:16}),link:blockBox({w:62.578,h:44,padding:[0,6,0,6],minHeight:44}),linkText:blockText({size:14,weight:700,lineHeight:21.7,deco:"underline",decoOffset:3,decoThickness:1.5})},orderWeb:{card:blockBox({w:952,h:127.781,padding:[16,24,16,16],gap:[24,16],radius:[20,20],bg:"surface",shadow:{color:"rgba(0, 0, 0, 0.04)",x:0,y:1,blur:2,spread:0},center:true}),lift:{color:"rgba(0, 0, 0, 0.05)",x:0,y:6,blur:20,spread:0},shots:blockBox({w:172,h:72}),sq:blockBox({w:72,h:72,radius:[14,14],bg:"#F3F3F3"}),sqRing:3,sqOverlap:22,imgInset:.1,imgFit:"contain",imgBlend:"multiply",text:blockBox({w:446.547,h:95.781,gap:[2,2]}),when:blockBox({w:446.547,h:26,gap:[12,4],center:true}),title:blockText({size:19,weight:700,lineHeight:24.7,tabular:true}),total:blockText({size:19,weight:900,lineHeight:24.7,tabular:true}),chip:blockBox({w:94.547,h:26,padding:[0,10,0,6],gap:[4,4],minHeight:26,radius:[999,999],bg:"tintGo",center:true,color:"ink"}),chipText:blockText({size:13,weight:700,lineHeight:16.9,color:"ink",tabular:true}),chipIcon:blockBox({w:16,h:16,color:"ink"}),meta:blockText({size:16,weight:400,lineHeight:22.4}),note:blockText({size:15,weight:400,lineHeight:21}),acts:blockBox({w:245.453,h:46,gap:[24,8],center:true}),plain:blockBox({w:160.031,h:46,padding:[0,20,0,20],gap:[8,8],minHeight:46,radius:[999,999],bg:"surface",edge:{width:1.5,color:"#C6D3CD",ring:true},center:true,color:"ink"}),plainText:blockText({size:16,weight:700,lineHeight:19.2,color:"ink"}),icon:blockBox({w:18,h:18,color:"ink"}),link:blockBox({w:61.422,h:44,gap:[8,8],minHeight:44,center:true,color:"ink"}),linkText:blockText({size:17,weight:700,lineHeight:20.4,color:"ink",deco:"underline",decoOffset:4}),go:blockBox({w:228.75,h:52,padding:[0,24,0,24],gap:[8,8],minHeight:52,radius:[999,999],bg:"ink",center:true,color:"surface"}),goText:blockText({size:17,weight:700,lineHeight:20.4,color:"surface",wrap:"auto"}),pressScale:.97,hoverFill:{color:"ink",share:.06,over:"surface"},chipOff:blockBox({w:97.422,h:26,padding:[0,10,0,6],gap:[4,4],minHeight:26,radius:[999,999],center:true,color:"ink"}),metaLink:blockText({size:16,weight:400,lineHeight:22.4,deco:"underline"}),narrow:{upTo:599,card:blockBox({w:560,h:247.391,padding:[16,16,16,16],gap:[24,16],radius:[20,20],bg:"surface",center:true}),sq:blockBox({w:64,h:64,radius:[14,14],bg:"#F3F3F3",shadow:{color:"#FFFFFF",x:0,y:0,blur:0,spread:3}}),sqOverlap:16},phone:{upTo:639,card:blockBox({w:335,h:120.984,gap:[12,8],center:true}),sq:blockBox({w:48,h:48,radius:[12,12],bg:"#F3F3F3"}),sqRing:2,sqOverlap:18,when:blockBox({w:215,h:46.797,gap:[12,2],center:true}),title:blockText({size:16,weight:700,lineHeight:20.8,tabular:true}),total:blockText({size:16,weight:900,lineHeight:20.8,tabular:true}),chip:blockBox({w:90.031,h:24,padding:[0,10,0,6],gap:[4,4],minHeight:24,radius:[999,999],bg:"tintGo",center:true,color:"ink"}),chipText:blockText({size:12,weight:700,lineHeight:15.6,color:"ink",tabular:true}),whatHidden:true,note:blockText({size:13,weight:400,lineHeight:18.2}),acts:blockBox({w:335,h:46,gap:[24,8],center:true}),plain:blockBox({w:144.531,h:46,padding:[0,16,0,16],gap:[8,8],minHeight:46,radius:[999,999],bg:"surface",edge:{width:1.5,color:"#C6D3CD",ring:true},center:true,color:"ink"}),plainText:blockText({size:15,weight:700,lineHeight:18,color:"ink"}),linkText:blockText({size:15,weight:700,lineHeight:18,color:"ink",deco:"underline",decoOffset:4})}},product:{card:blockBox({w:156,h:310.969,gap:[4,4]}),kicker:blockText({size:12,weight:400,lineHeight:15.6,color:"muted",tracking:.12,face:"mono"}),name:blockText({size:15,weight:700,lineHeight:19.5,wrap:"balance"}),meta:blockText({size:13,weight:400,lineHeight:18.2,color:"muted"}),buy:blockBox({w:156,h:36,marginTop:6,gap:[8,8],center:true}),price:blockText({size:15,weight:700,lineHeight:23.25,tabular:true})},productCard:{card:blockBox({w:174.5,h:249.219,gap:[2,2]}),tag:blockBox({w:84.563,h:26,padding:[0,9,0,6],gap:[4,4],minHeight:26,radius:[999,999],bg:"surface",center:true,x:8,y:8}),tagIcon:blockBox({w:16,h:16,color:"#CA4463"}),tagText:blockText({size:12,weight:700,lineHeight:12}),price:blockBox({w:174.5,h:26.344,gap:[6,6]}),priceText:blockText({size:17,weight:700,lineHeight:26.35,tracking:-.17,tabular:true}),was:blockText({size:13,weight:400,lineHeight:20.15,color:"muted",tabular:true,deco:"strike"}),name:blockText({size:14,weight:500,lineHeight:18.2,wrap:"balance"}),meta:blockText({size:12,weight:400,lineHeight:16.2,color:"muted"}),metaAuto:blockText({size:12,weight:500,lineHeight:16.2,color:"#16864A"}),step:blockBox({w:112,h:38,radius:[19,19],bg:"surface",center:true,x:54.5,y:128.5}),stepIn:blockBox({w:112,h:38,radius:[19,19],bg:"ink",center:true,color:"surface",x:54.5,y:128.5}),stepAt:{right:8,bottom:8},stepButton:blockBox({w:38,h:38,radius:[19,19],center:true}),stepIcon:blockBox({w:18,h:18}),count:blockText({size:15,weight:700,lineHeight:23.25,color:"surface",tabular:true}),lift:{color:"rgba(0, 0, 0, 0.14)",x:0,y:2,blur:8,spread:0},per:blockText({size:12,weight:400,lineHeight:16.2,color:"muted",tabular:true}),metaAutoDark:blockText({size:12,weight:500,lineHeight:16.2,color:"ink"}),pill:blockBox({w:62.234,h:36,padding:[0,14,0,14],gap:[4,4],minHeight:36,radius:[999,999],bg:"go",center:true,x:104.266,y:130.5}),pillText:blockText({size:14,weight:700,lineHeight:21.7}),pillOn:blockBox({w:90.016,h:36,padding:[0,14,0,14],gap:[4,4],minHeight:36,radius:[999,999],bg:"surface",edge:{width:2,color:"text",ring:true},center:true,x:76.484,y:130.5}),pillOnText:blockText({size:14,weight:700,lineHeight:21.7}),pillIcon:blockBox({w:16,h:16}),pillSoft:blockBox({w:80.125,h:36,padding:[0,14,0,14],gap:[4,4],minHeight:36,radius:[999,999],bg:"surface",shadow:{color:"rgba(0, 0, 0, 0.14)",x:0,y:2,blur:8,spread:0},center:true,x:86.375,y:130.5}),pillSoftText:blockText({size:14,weight:700,lineHeight:21.7}),pillAt:{right:8,bottom:8},pillPressScale:.96},productBlend:{img:blockBox({w:174.5,h:174.5,padding:[32,14,16,14],fit:"contain"}),imgBlend:"multiply",lift:{color:"rgba(0, 0, 0, 0.08)",x:0,y:2,blur:8,spread:0},pill:blockBox({w:62.234,h:36,padding:[0,14,0,14],gap:[4,4],minHeight:36,radius:[999,999],bg:"pink",edge:{width:1,color:"ink",ring:true},center:true,color:"ink",x:104.266,y:130.5}),pillText:blockText({size:14,weight:700,lineHeight:21.7,color:"ink"}),pillOn:blockBox({w:90.016,h:36,padding:[0,14,0,14],gap:[4,4],minHeight:36,radius:[999,999],bg:"surface",edge:{width:2,color:"ink",ring:true},center:true,color:"ink",x:76.484,y:130.5}),pillOnText:blockText({size:14,weight:700,lineHeight:21.7,color:"ink"}),pillPressScale:.97},productWeb:{card:blockBox({w:306.656,h:370.641,gap:[2,2]}),square:blockBox({w:306.656,h:306.656,marginBottom:10,radius:[20,20],bg:"#F5F5F5"}),imgInsetTag:{share:[.11,.11,.1,.11],px:[26,0,0,0]},imgInset:{share:[.07,.07,.07,.07],px:[0,0,0,0]},imgFit:"contain",imgBlend:"multiply",tag:blockBox({w:112.516,h:30,padding:[0,12,0,8],gap:[5,5],minHeight:30,radius:[999,999],bg:"#F7E3E8",center:true,color:"ink",x:10,y:10}),tagText:blockText({size:13,weight:700,lineHeight:14.3,color:"ink"}),tagIcon:blockBox({w:16,h:16,color:"#CA4463"}),tagMix:.15,name:blockText({size:17,weight:500,lineHeight:22.1,wrap:"balance"}),nameLeading:1.3,coverRadius:20,price:blockBox({w:306.656,h:27.891,gap:[8,2]}),priceText:blockText({size:18,weight:700,lineHeight:27.9,tracking:-.18,tabular:true}),was:blockText({size:15,weight:400,lineHeight:23.25,tabular:true,deco:"strike"}),per:blockText({size:15,weight:400,lineHeight:23.25,tabular:true}),badge:blockBox({w:32.625,h:22,padding:[0,8,0,8],radius:[999,999],bg:"#DEE4F1",edge:{width:1.5,color:"rgba(90, 96, 135, 0.45)",ring:true},center:true}),badgeText:blockText({size:13,weight:700,lineHeight:13,tabular:true}),meta:blockText({size:15,weight:400,lineHeight:21}),add:blockBox({w:44,h:44,radius:[22,22],bg:"surface",shadow:{color:"rgba(0, 0, 0, 0.14)",x:0,y:2,blur:8,spread:0},center:true}),addIcon:blockBox({w:20,h:20}),actAt:{right:10,bottom:10},step:blockBox({w:116,h:44,radius:[22,22],bg:"ink",center:true,color:"surface"}),stepButton:blockBox({w:44,h:44,radius:[22,22],center:true,color:"surface"}),stepIcon:blockBox({w:18,h:18,color:"surface"}),count:blockText({size:15,weight:700,lineHeight:23.25,color:"surface",tabular:true}),pill:blockBox({w:68.688,h:44,padding:[0,16,0,16],gap:[6,6],minHeight:44,radius:[999,999],bg:"ink",center:true,color:"surface"}),pillText:blockText({size:15,weight:700,lineHeight:15,color:"surface"}),pillOn:blockBox({w:101.016,h:44,padding:[0,16,0,16],gap:[6,6],minHeight:44,radius:[999,999],bg:"surface",edge:{width:2,color:"ink",ring:true},center:true,color:"ink"}),pillOnText:blockText({size:15,weight:700,lineHeight:15,color:"ink"}),pillIcon:blockBox({w:18,h:18,color:"ink"}),pillSoft:blockBox({w:87.859,h:44,padding:[0,16,0,16],gap:[6,6],minHeight:44,radius:[999,999],bg:"surface",shadow:{color:"rgba(0, 0, 0, 0.14)",x:0,y:2,blur:8,spread:0},center:true}),pillSoftText:blockText({size:15,weight:700,lineHeight:15}),nameSteps:[{upTo:599,name:blockText({size:16,weight:500,lineHeight:20.8,wrap:"balance"})},{upTo:399,name:blockText({size:14,weight:500,lineHeight:18.2,wrap:"balance"})}],addPressScale:.94,stepPressScale:.88,pillPressScale:.97,imgInsetEven:{share:[.07,.07,.07,.07],px:[0,0,0,0]},imgInsetWhite:{share:[.11,.11,.14,.11],px:[0,0,0,0]},groundWhite:"surface",focusOffset:3,hover:{ring:{width:1.5,share:.45,color:"ink"},underlineOffset:3}},productRow:{card:blockBox({shown:false,w:361,h:109.328,gap:[12,12],center:true}),name:blockText({shown:false,size:17,weight:700,lineHeight:22.1,color:"ink"}),meta:blockText({shown:false,size:13,weight:400,lineHeight:18.85,color:"muted",marginTop:2})},cart:{line:blockBox({w:361,h:109.328,gap:[12,12],center:true}),name:blockBox({w:289,h:24,gap:[8,4],center:true,color:"ink"}),nameText:blockText({size:17,weight:700,lineHeight:22.1,color:"ink"}),meta:blockText({size:13,weight:400,lineHeight:18.85,color:"muted",marginTop:2}),price:blockText({size:17,weight:700,lineHeight:26.35,color:"ink",tabular:true}),was:blockText({shown:false,size:13,weight:400,lineHeight:18.85,color:"muted",marginTop:2}),acts:blockBox({w:289,h:20.141,marginTop:6,gap:[16,16]}),remove:blockText({size:13,weight:700,lineHeight:20.15,color:"ink",deco:"underline",decoOffset:3}),removeBox:blockBox({w:53.016,h:20.141,color:"ink"}),end:blockBox({w:289,h:26.344,gap:[4,4]})},cartSquare:{line:blockBox({w:361,h:95.094,gap:[12,12]}),sm:blockBox({w:48,h:48,radius:[12,12],bg:"#F3F3F3"}),md:blockBox({w:52,h:52,radius:[12,12],bg:"#F3F3F3"}),lg:blockBox({w:56,h:56,radius:[12,12],bg:"#F3F3F3"}),imgInset:.1,imgFit:"contain",imgBlend:"multiply",name:blockBox({w:239.109,h:20,gap:[6,4],center:true}),nameText:blockText({size:15,weight:700,lineHeight:19.5}),link:blockText({size:15,weight:700,lineHeight:19.5}),linkReach:4,badge:blockBox({w:29.344,h:20,padding:[0,7,0,7],radius:[999,999],bg:"#E0E6F2",edge:{width:1.5,color:"rgba(90, 96, 135, 0.45)",ring:true},center:true}),badgeText:blockText({size:12,weight:700,lineHeight:12}),meta:blockText({size:13,weight:400,lineHeight:17.55,color:"muted",marginTop:2}),acts:blockBox({w:239.109,h:32,marginTop:6,gap:[16,16]}),act:blockText({size:13,weight:700,lineHeight:20.15,color:"ink",deco:"underline",decoOffset:3}),actBox:blockBox({w:84.531,h:32,minHeight:32,color:"ink"}),price:blockText({size:15,weight:700,lineHeight:23.25,tabular:true}),was:blockText({size:13,weight:400,lineHeight:20.15,color:"muted",tabular:true,deco:"strike"})},cartWeb:{line:blockBox({w:404,h:88,gap:[16,0],center:true}),sq:blockBox({w:88,h:88,radius:[14,14],bg:"#F3F3F3"}),imgInset:.1,imgFit:"contain",imgBlend:"multiply",name:blockBox({w:225.875,h:24.688,gap:[8,4],center:true}),nameText:blockText({size:19,weight:700,lineHeight:24.7}),link:blockText({size:19,weight:700,lineHeight:24.7}),linkReach:4,badge:blockBox({w:32.625,h:22,padding:[0,8,0,8],radius:[999,999],bg:"#DEE4F1",center:true}),badgeText:blockText({size:13,weight:700,lineHeight:13}),meta:blockText({size:15,weight:400,lineHeight:21,marginTop:2}),price:blockText({size:19,weight:700,lineHeight:29.45,tabular:true}),was:blockText({size:15,weight:400,lineHeight:23.25,tabular:true,deco:"strike"}),narrow:{upTo:599,sq:blockBox({w:64,h:64,radius:[14,14],bg:"#F3F3F3"}),cost:blockBox({w:432,h:29.438,marginTop:4,gap:[8,8]}),nameText:blockText({size:17,weight:700,lineHeight:22.1}),link:blockText({size:17,weight:700,lineHeight:22.1})},narrower:{upTo:330,sq:blockBox({w:56,h:56,radius:[14,14],bg:"#F3F3F3"}),cost:blockBox({w:216,h:29.438,marginTop:4,gap:[8,8]}),nameText:blockText({size:17,weight:700,lineHeight:22.1}),link:blockText({size:17,weight:700,lineHeight:22.1})},phone:{upTo:639,line:blockBox({w:303,h:81.25,gap:[12,0],center:true}),sq:blockBox({w:56,h:56,radius:[12,12],bg:"#F3F3F3"}),cost:blockBox({w:235,h:23.25,marginTop:2,gap:[8,8]}),nameText:blockText({size:15,weight:700,lineHeight:19.5}),link:blockText({size:15,weight:700,lineHeight:19.5}),meta:blockText({size:13,weight:400,lineHeight:17.55,marginTop:2}),price:blockText({size:15,weight:700,lineHeight:23.25,tabular:true}),was:blockText({size:13,weight:400,lineHeight:20.15,tabular:true,deco:"strike"}),smallUpTo:359,smallSq:48}},price:{note:blockText({size:13,weight:400,lineHeight:19.5,color:"muted",marginTop:12}),noteStrong:blockText({size:13,weight:700,lineHeight:19.5,color:"muted"})},priceWeb:{rows:blockBox({w:536,h:166.625,gap:[10,10]}),row:blockBox({w:536,h:26.344,gap:[16,16]}),term:blockText({size:17,weight:400,lineHeight:26.35,wrap:"balance"}),value:blockText({size:17,weight:700,lineHeight:26.35,tabular:true}),off:blockText({size:17,weight:700,lineHeight:26.35,color:"ink",wrap:"balance"}),total:blockBox({w:536,h:49.594,marginTop:8,gap:[16,16]}),totalTerm:blockText({size:20,weight:700,lineHeight:31,wrap:"balance"}),totalValue:blockText({size:32,weight:700,lineHeight:49.6,tracking:-.64,tabular:true}),note:blockText({size:15,weight:400,lineHeight:22.5,marginTop:16}),noteStrong:blockText({size:15,weight:700,lineHeight:22.5,color:"ink"}),phone:{upTo:639,rows:blockBox({w:239,h:145.141,gap:[8,8]}),term:blockText({size:15,weight:400,lineHeight:23.25,wrap:"balance"}),value:blockText({size:15,weight:700,lineHeight:23.25,tabular:true}),totalTerm:blockText({size:18,weight:700,lineHeight:27.9,wrap:"balance"}),totalValue:blockText({size:28,weight:700,lineHeight:43.4,tracking:-.56,tabular:true}),note:blockText({size:15,weight:400,lineHeight:22.5,marginTop:12})},drawer:{rows:blockBox({w:360,h:154.219,marginTop:32,gap:[10,10]}),term:blockText({size:17,weight:400,lineHeight:26.35,wrap:"balance"}),value:blockText({size:17,weight:700,lineHeight:26.35,tabular:true}),totalTerm:blockText({size:20,weight:700,lineHeight:31,wrap:"balance"}),totalValue:blockText({size:24,weight:700,lineHeight:37.2,tabular:true}),note:blockText({size:15,weight:400,lineHeight:22.5,marginTop:12})}},need:{card:blockBox({w:325,h:125.25,padding:[14,16,14,16],radius:[0,20],bg:"surface",shadow:{color:"rgba(0, 0, 0, 0.06)",x:0,y:2,blur:3,spread:-1}}),kicker:blockBox({w:293,h:24,gap:[8,8],center:true}),kickerText:blockText({size:15,weight:700,lineHeight:23.25}),source:blockBox({w:116.719,h:24,padding:[0,9,0,9],radius:[999,999],bg:"#DAF6E8",center:true,color:"ink"}),sourceText:blockText({size:12,weight:700,lineHeight:18.6,color:"ink"}),title:blockText({shown:false,size:15,weight:700,lineHeight:23.25}),signal:blockBox({w:293,h:65.25,marginTop:8,gap:[9,9],color:"#4D4D4D"}),signalText:blockText({size:15,weight:400,lineHeight:21.75,color:"#4D4D4D"}),signalLead:blockText({size:15,weight:700,lineHeight:21.75}),dot:blockBox({w:9,h:9,radius:[4.5,4.5],bg:"alert",color:"#4D4D4D",dy:-1}),score:blockBox({w:293,h:99.859,padding:[10,14,10,14],marginTop:12,gap:[12,12],radius:[10,10],bg:"#FCF0D6",center:true}),scoreLabel:blockText({size:14,weight:600,lineHeight:18.9,color:"#4D4D4D"}),scoreTag:blockBox({w:63.125,h:20.188,padding:[2,6,2,6],marginTop:3,radius:[6,6],bg:"surface"}),scoreTagText:blockText({size:12,weight:600,lineHeight:16.2,tracking:.72,face:"mono",upper:true,marginTop:3,paddingTop:2}),scoreNums:blockBox({w:106.109,h:51.141,gap:[6,0],center:true}),scoreWas:blockText({size:17,weight:700,lineHeight:26.35,color:"muted",deco:"strike",decoThickness:1.5}),scoreArrow:blockBox({w:16,h:16,color:"muted"}),scoreArrowFlip:true,scoreNow:blockText({size:28,weight:700,lineHeight:28,tracking:-.84,tabular:true}),scoreOf:blockText({size:15,weight:700,lineHeight:15,color:"#4D4D4D",tabular:true}),scoreSince:blockText({size:13,weight:700,lineHeight:20.15,color:"ink",marginTop:3})},needPlan:{card:blockBox({w:329,h:380.172,padding:[16,16,16,16],marginTop:14,radius:[22,22],bg:"surface",shadow:{color:"rgba(38, 37, 35, 0.06)",x:0,y:1,blur:3,spread:0},color:"#262523"}),kicker:blockBox({w:297,h:24,gap:[8,8],center:true,color:"#262523"}),kickerText:blockText({size:15,weight:800,lineHeight:22.5,color:"#262523"}),source:blockBox({w:83.375,h:24,padding:[0,9,0,9],radius:[999,999],bg:"#F2F1EE",center:true,color:"#4A4845"}),sourceText:blockText({size:12,weight:700,lineHeight:18,color:"#4A4845"}),title:blockText({size:19,weight:800,lineHeight:23.18,color:"#262523",marginTop:12}),signal:blockBox({w:297,h:65.25,marginTop:6,gap:[9,9],color:"#4A4845"}),signalText:blockText({size:15,weight:400,lineHeight:21.75,color:"#4A4845"}),signalLead:blockText({size:15,weight:800,lineHeight:21.75,color:"#262523"}),dot:blockBox({w:9,h:9,radius:[4.5,4.5],bg:"#E5372B",color:"#4A4845",dy:-1}),score:blockBox({w:297,h:69.75,padding:[10,14,10,14],marginTop:12,gap:[12,12],radius:[14,14],bg:"planAccentWash",center:true,color:"#262523"}),scoreLabel:blockText({size:13.5,weight:600,lineHeight:18.225,color:"#4A4845",wrap:"balance"}),scoreTag:blockBox({w:51.609,h:17.5,padding:[2,6,2,6],marginTop:3,radius:[5,5],bg:"surface",color:"#262523"}),scoreTagText:blockText({size:10,weight:600,lineHeight:13.5,color:"#262523",tracking:.6,face:"mono",upper:true,wrap:"balance",marginTop:3,paddingTop:2}),scoreNums:blockBox({w:94.75,h:49.75,gap:[6,0],center:true,color:"#262523"}),scoreWas:blockText({size:17,weight:700,lineHeight:25.5,color:"#6B6863",deco:"strike"}),scoreArrow:blockBox({w:16,h:16,color:"#6B6863"}),scoreArrowFlip:true,scoreNow:blockText({size:28,weight:800,lineHeight:28,color:"#262523"}),scoreOf:blockText({size:13,weight:800,lineHeight:13,color:"muted"}),scoreSince:blockText({size:12.5,weight:700,lineHeight:18.75,color:"planLink",marginTop:3}),sources:blockBox({w:131.375,h:24,gap:[4,4],color:"#262523"}),sourceDna:blockBox({w:44,h:24,padding:[0,9,0,9],radius:[999,999],bg:"planLinkWash",center:true,color:"planLink"}),sourceDnaText:blockText({size:12,weight:700,lineHeight:18,color:"planLink"}),dotWatch:blockBox({w:9,h:9,radius:[4.5,4.5],bg:"#E5A000",color:"#4A4845",dy:-1}),dotClear:blockBox({w:9,h:9,radius:[4.5,4.5],bg:"#5FA82B",color:"#4A4845",dy:-1}),scoreLabelMax:135,says:blockBox({w:297,h:52,padding:[10,12,10,12],marginTop:12,gap:[10,10],radius:[14,14],bg:"#F8F7F4",color:"#262523"}),saysImg:blockBox({w:32,h:32,radius:[16,16],color:"#262523"}),saysText:blockText({size:14.5,weight:400,lineHeight:20.3,color:"#4A4845"}),saysBy:blockText({size:14.5,weight:800,lineHeight:20.3,color:"#262523"}),saysByGap:2,saysTag:blockBox({w:51.609,h:15,padding:[2,6,2,6],radius:[5,5],bg:"surface",color:"#262523"}),saysTagText:blockText({size:10,weight:400,lineHeight:14,color:"#262523",tracking:.6,face:"mono",upper:true,paddingTop:2}),saysBare:blockBox({w:297,h:81,padding:[10,12,10,12],marginTop:12,gap:[10,10],radius:[14,14],bg:"#F8F7F4",color:"#262523"}),saysKicker:blockText({size:17,weight:400,lineHeight:25.5,color:"#262523"}),saysSerif:blockText({size:17,weight:800,lineHeight:25.5,color:"#262523",tracking:-.17,wrap:"balance"}),jump:blockBox({w:297,h:60,padding:[8,14,8,8],marginTop:12,gap:[12,12],radius:[14,14],bg:"planInk",center:true,color:"planOnInk"}),jumpImg:blockBox({w:44,h:44,radius:[10,10],bg:"surface",color:"surface"}),jumpKicker:blockText({size:13,weight:800,lineHeight:19.5,color:"planAccent"}),jumpTitle:blockText({size:15,weight:800,lineHeight:18.75,color:"planOnInk"}),jumpGo:blockText({size:14,weight:800,lineHeight:21,color:"planOnInk"}),jumpPressScale:.98,more:blockBox({w:87.547,h:36,marginTop:6,marginBottom:-4,gap:[4,4],minHeight:36,center:true,color:"planLink"}),moreText:blockText({size:15,weight:800,lineHeight:22.5,color:"planLink"}),moreIcon:blockBox({w:16,h:16,color:"planLink"}),moreInset:16,moreTurn:{closed:90,open:-90},rep:blockBox({w:297,h:48.5,padding:[14,14,12,14],marginTop:10,radius:[16,16],bg:"#F8F7F4",color:"#262523"})},tip:{card:blockBox({w:201.5,h:275.031,padding:[8,10,10,10],radius:[20,20],bg:"#FCF0D6"}),tones:{y:"#FCF0D6",c:"tintBlue",g:"tintGo",r:"tintPink"},img:blockBox({w:181.5,h:113.438,radius:[10,10],bg:"#F3F3F3"}),n:blockBox({w:28,h:28,radius:[14,14],bg:"surface",center:true,x:8,y:8}),nText:blockText({size:14,weight:700,lineHeight:14}),title:blockText({size:16,weight:700,lineHeight:20,marginTop:10}),text:blockText({size:15,weight:400,lineHeight:21,color:"#4D4D4D",marginTop:4}),foot:blockBox({w:181.5,h:26.594,padding:[8,0,0,0],gap:[4,4],center:true,color:"ink"}),footText:blockText({size:12,weight:400,lineHeight:18.6,color:"ink",tracking:.48,face:"mono",upper:true,paddingTop:8}),footArrow:blockBox({w:14,h:14,color:"ink"}),footArrowFlip:true,pressScale:.98,bare:blockBox({w:181.5,h:42,padding:[2,0,0,0],center:true}),thumb:blockBox({w:40,h:40,radius:[10,10],bg:"surface",center:true}),thumbIcon:blockBox({w:22,h:22})},tipPhoto:{card:blockBox({w:221,h:152,padding:[8,8,12,8],radius:[20,20],bg:"#FCF0D6"}),tones:{y:"#FCF0D6",c:"#EEDCC8",g:"tintGo",r:"tintPink"},img:blockBox({w:205,h:102.5,radius:[10,10],bg:"#F3F3F3"}),imgAspect:2,n:blockBox({w:28,h:28,radius:[14,14],bg:"surface",center:true,x:8,y:8}),nText:blockText({size:14,weight:700,lineHeight:14}),title:blockText({size:15,weight:700,lineHeight:19.5,marginTop:10}),titleInset:4,pressScale:.98,bare:blockBox({w:205,h:42,padding:[2,0,0,0],center:true}),thumb:blockBox({w:40,h:40,radius:[10,10],bg:"surface",center:true}),thumbIcon:blockBox({w:22,h:22,color:"ink"})},tipWeb:{card:blockBox({w:226,h:172.047,gap:[10,10]}),img:blockBox({w:226,h:141.25,radius:[14,14]}),imgAspect:1.6,title:blockText({size:16,weight:700,lineHeight:20.8,wrap:"balance"}),coverRadius:10,row:{from:440,card:blockBox({w:400,h:80,padding:[6,0,6,0],gap:[10,10],minHeight:80,center:true}),img:blockBox({w:64,h:64,radius:[10,10]}),arrowColumn:18,arrow:blockBox({w:18,h:18,color:"ink"}),arrowTurn:180},phone:{upTo:639,card:blockBox({w:216,h:162.5,gap:[8,8]}),img:blockBox({w:216,h:135,radius:[14,14]}),imgAspect:1.6,title:blockText({size:15,weight:700,lineHeight:19.5,wrap:"balance"}),smallUpTo:359,smallW:208},mark:{tile:blockBox({w:226,h:141.25,radius:[14,14],bg:"#F5F5F5",center:true,color:"ink"}),icon:{share:.36,min:16,max:40,color:"ink"}},ring:{width:2,offset:2,color:"text"},hoverOffset:3},tipPlan:{card:blockBox({w:225.406,h:182.844,padding:[14,14,12,14],radius:[18,18],bg:"planAccentChip",color:"#262523"}),tones:{y:"planAccentChip",c:"planLinkChip",g:"#DDEFC4",r:"#FFD8D6"},top:blockBox({w:197.406,h:30,center:true,color:"#262523"}),nText:blockText({size:30,weight:900,lineHeight:30,color:"#262523"}),icon:blockBox({w:26,h:26,color:"#262523"}),title:blockText({size:17,weight:800,lineHeight:21.25,color:"#262523",marginTop:14}),text:blockText({size:14.5,weight:400,lineHeight:20.3,color:"#4A4845",marginTop:4}),foot:blockBox({w:197.406,h:25.75,padding:[10,0,0,0],color:"planLink"}),footText:blockText({size:10.5,weight:400,lineHeight:15.75,color:"planLink",tracking:.42,face:"mono",upper:true,paddingTop:10})},cartPlan:{line:blockBox({w:297,h:95.625,gap:[12,12],color:"#262523"}),img:blockBox({w:64,h:64,radius:[14,14],bg:"planLinkWash",center:true,color:"planLink"}),icon:blockBox({w:28,h:28,color:"planLink"}),name:blockText({size:16.5,weight:800,lineHeight:20.625,color:"#262523",wrap:"balance"}),prices:blockBox({w:221,h:24,marginTop:3,gap:[8,2],center:true,color:"#262523"}),price:blockText({size:16,weight:800,lineHeight:24,color:"#262523",tabular:true}),was:blockText({size:14,weight:600,lineHeight:21,color:"#6B6863",deco:"strike"}),small:blockText({size:14,weight:400,lineHeight:21,color:"#6B6863"}),acts:blockBox({w:221,h:40,marginTop:8,gap:[16,16],center:true,color:"#262523"}),step:blockBox({w:110,h:40,radius:[999,999],bg:"surface",edge:{width:1.5,color:"#DAD7D1",ring:true},center:true,color:"#262523"}),remove:blockBox({w:56.422,h:40,minHeight:40,color:"#4A4845"}),removeText:blockText({size:14.5,weight:700,lineHeight:21.75,color:"#4A4845",deco:"underline",decoOffset:3,decoThickness:1.5})}};function deepFreeze2(value){if(value!==null&&typeof value=="object"&&!Object.isFrozen(value))for(let v of Object.values(value))deepFreeze2(v);return value}var k=everfurTokens,PRESET=/* @__PURE__ */Symbol.for("@everfur-health/ui-core#preset@v1");function asPreset(theme){return Object.defineProperty(theme,PRESET,{value:theme,enumerable:true}),deepFreeze2(theme)}var SCALE_CAPS={content:0,heading:2,control:1.8,compact:1.5,badge:1.3},everfurTheme=asPreset({name:"everfur",colors:{bg:k.color.bg,surface:k.color.efWhite,text:k.color.text,ink:k.role.color.ink,onInk:k.color.efWhite,muted:k.role.color.muted,line:k.role.color.line,go:k.role.color.go,onGo:k.role.color.ink,pink:k.color.efDustyPink,onPink:k.role.color.ink,alert:k.color.alert,alertDeep:k.color.alertDeep,icoSage:k.role.color.icoSage,bgMist:k.color.bgMist,tintSage:k.role.color.tintSage,tintBlue:k.role.color.tintBlue,tintGo:k.role.color.tintGo,tintPink:k.role.color.tintPink,tintYellowEdge:k.role.color.tintYellowEdge,tintWatch:everfurMetrics.colors.watch,tintRed:k.role.color.tintRed,scrim:everfurMetrics.colors.scrim,grab:everfurMetrics.colors.grab,focus:k.role.color.ink,planInk:everfurMetrics.colors.planInk,planOnInk:everfurMetrics.colors.planOnInk,planAccent:everfurMetrics.colors.planAccent,planLink:everfurMetrics.colors.planLink,planAccentWash:everfurMetrics.colors.planAccentWash,planAccentChip:everfurMetrics.colors.planAccentChip,planLinkWash:everfurMetrics.colors.planLinkWash,planLinkChip:everfurMetrics.colors.planLinkChip},radius:{...k.radius},space:{...k.space},type:{family:k.font.family.base,mono:k.font.family.mono,faces:{regular:"Azeret-Regular",medium:"Azeret-Medium",bold:"Azeret-Bold",mono:"AzeretMono-Regular",monoBold:"AzeretMono-Bold"},namedFaces:true,size:{xs:k.font.size.xs,sm:k.font.size.sm,md:k.font.size.md,lg:k.font.size.lg,xl:k.font.size.xl},weight:{...k.font.weight},lineHeight:{...k.font.lineHeight},scaleCaps:SCALE_CAPS},motion:{duration:{press:k.motion.duration.press,fade:k.motion.duration.fade,enter:k.motion.duration.enter,sheet:k.motion.duration.sheet,sheetOut:k.motion.duration.sheetOut},easing:{out:k.motion.easing.out,drawer:k.motion.easing.drawer},pop:{duration:k.motion.duration.enter,from:.95,peakAt:.55,amplitude:.035,switchAmplitude:.06},reduced:false},metrics:everfurMetrics});function presetOf(theme){return theme[PRESET]??everfurTheme}function isObject(v){return v!==null&&typeof v=="object"&&!Array.isArray(v)}function merge(base3,over){if(!isObject(base3)||!isObject(over))return over===void 0?base3:over;let out={...base3};for(let[key,value]of Object.entries(over))value!==void 0&&(out[key]=merge(base3[key],value));return out}function resolveTheme(partial,base3=everfurTheme){if(!partial)return base3;let merged=merge(base3,partial),given=partial.colors;if(given){let colors=merged.colors;for(let[wash,from,share]of PLAN_WASHES){let c=given[from];c!==void 0&&given[wash]===void 0&&(colors[wash]=mixHex(c,share,colors.surface)??colors[wash]??c)}}return deepFreeze2(merged)}var PLAN_WASHES=[["planAccentWash","planAccent",.17],["planAccentChip","planAccent",.47],["planLinkWash","planLink",.12],["planLinkChip","planLink",.2]];function mixHex(color,share,ground){let ch=v=>{let m=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(v??"");return m?[m[1],m[2],m[3]].map(h=>parseInt(h,16)):void 0},[c,g]=[ch(color),ch(ground)];if(!(!c||!g))return`#${c.map((v,i)=>Math.round(v*share+(g[i]??0)*(1-share)).toString(16).padStart(2,"0")).join("").toUpperCase()}`}var ThemeContext=/* @__PURE__ */(()=>{let key=/* @__PURE__ */Symbol.for("@everfur-health/ui-core#ThemeContext@v1"),host=globalThis,context=host[key]??(host[key]=react.createContext(null));return context.displayName??(context.displayName="EverfurThemeContext"),context})();function ThemeProvider({theme:theme,children:children}){let outer=useTheme(),key=theme===void 0||isComplete(theme)?theme:contentKey(theme),value=react.useMemo(()=>isComplete(theme)?filled(theme):resolveTheme(theme,outer),[key,outer]);return react.createElement(ThemeContext.Provider,{value:value},children)}function contentKey(value){return JSON.stringify(value,(_,v)=>isObject(v)&&!Array.isArray(v)?Object.fromEntries(Object.keys(v).sort().map(k2=>[k2,v[k2]])):v)}function isComplete(theme){return theme!==void 0&&Object.isFrozen(theme)&&GROUPS.every(g=>g in theme)}var GROUPS=["name","colors","radius","space","type","motion","metrics"];function hasEvery(shape,value){if(shape===void 0)return true;if(!isObject(shape))return value!==void 0;if(!isObject(value))return false;for(let key of Object.keys(shape))if(!hasEvery(shape[key],value[key]))return false;return true}var fills=/* @__PURE__ */new WeakMap;function filled(theme){let hit=fills.get(theme);if(hit)return hit;if(hasEvery(everfurTheme,theme))return fills.set(theme,theme),theme;let preset=presetOf(theme),merged=merge(everfurTheme,preset===everfurTheme?theme:merge(preset,theme));merged[PRESET]=preset;let out=deepFreeze2(merged);return fills.set(theme,out),out}function useTheme(){let explicit=react.useContext(ThemeContext);return explicit?filled(explicit):everfurTheme}var px=n=>Math.round(n*1e3)/1e3;function faceOf(weight,mono=false){return mono?weight>450?"monoBold":"mono":weight>500?"bold":weight>450?"medium":"regular"}function withAlpha(color,alpha){let m=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(color);if(!m)return color;let[r,g,b]=[m[1],m[2],m[3]].map(h=>parseInt(h,16));return`rgba(${r}, ${g}, ${b}, ${alpha})`}function channelsOf(color){let hex=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(color);if(hex)return[hex[1],hex[2],hex[3]].map(h=>parseInt(h,16));let rgb2=/^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)/i.exec(color);return rgb2?[rgb2[1],rgb2[2],rgb2[3]].map(Number):void 0}function mixColor(color,share,base3,fallback){let[c,b]=[channelsOf(color),channelsOf(base3)];return!c||!b?fallback:`rgb(${c.map((v,i)=>Math.round(v*share+(b[i]??0)*(1-share))).join(", ")})`}function colorOf(t,value){let m=/^([a-zA-Z]+)(?:\/([\d.]+))?$/.exec(value),role=m?.[1];if(!m||role===void 0||!(role in t.colors))return value;let c=t.colors[role];return m[2]===void 0?c:withAlpha(c,Number(m[2]))}function textPartSpec(t,p){return{size:p.size,weight:p.weight,lineHeight:p.lineHeight,color:colorOf(t,p.color),...p.face==="mono"?{mono:true}:{},...p.face==="serif"?{serif:true}:{},...p.tracking?{tracking:p.tracking}:{},...p.upper?{upper:true}:{},...p.deco==="none"?{}:{deco:p.deco==="strike"?"strike":"underline",decoOffset:p.decoOffset,decoThickness:p.decoThickness},...p.tabular?{tabular:true}:{},...p.wrap==="auto"?{}:{wrap:p.wrap==="balance"?"balance":"pretty"}}}function partFill(t,value){return value==="none"?void 0:colorOf(t,value)}function summarySpec(t){let m=t.metrics.summary,lh=(size,ratio)=>px(size*ratio);return{paddingX:m.paddingX,paddingY:m.paddingY,radius:m.radius,borderWidth:m.borderWidth,borderColor:t.colors.line,background:colorOf(t,m.background),shadow:m.shadow,row:{paddingY:m.rowPaddingY,minHeight:m.rowMinHeight,gapX:m.rowGapX,gapY:m.rowGapY,divider:m.rowDivider,center:m.rowCenter},totalRowMinHeight:m.totalRowMinHeight,gap:m.gap??0,totalMarginTop:m.totalMarginTop??0,tabular:m.tabular,term:{size:m.termSize,weight:t.type.weight.regular,lineHeight:lh(m.termSize,m.termLineHeight),color:colorOf(t,m.termColor)},value:{size:m.valueSize,weight:m.valueWeight,lineHeight:lh(m.valueSize,m.valueLineHeight),color:colorOf(t,m.valueColor)},totalTerm:{size:m.totalTermSize,weight:m.totalTermWeight,lineHeight:lh(m.totalTermSize,m.termLineHeight),color:colorOf(t,m.totalTermColor)},total:{size:m.totalSize,weight:m.totalWeight,lineHeight:lh(m.totalSize,m.totalLineHeight),color:colorOf(t,m.valueColor)},off:textPartSpec(t,t.metrics.summary.off)}}function skeletonWidth(t,index){let widths=t.metrics.skeleton.widths;return`${widths[index%widths.length]}%`}function itemTestID(parent,key,own){return own!==void 0?own:parent===void 0?void 0:`${parent}-${key}`}var nums=group=>group,isBox=v=>"edge"in v&&"shadow"in v&&"fit"in v,isText=v=>"deco"in v&&"face"in v&&"tabular"in v;function byValue(group){let out=/* @__PURE__ */new Map;for(let[k2,v]of Object.entries(group))out.has(v)||out.set(v,k2);return out}var groups,derived=/* @__PURE__ */new WeakMap;function tokenOf(map,theme,v){let k2=map.get(v),t=k2===void 0?void 0:theme[k2];return typeof t=="number"?t:v}function blocksMetrics(theme){let base3=everfurBlocksMetrics,p=everfurTheme;if(theme.space===p.space&&theme.radius===p.radius&&theme.type.size===p.type.size&&theme.type.weight===p.type.weight)return base3;let hit=derived.get(theme);if(hit)return hit;groups??(groups={space:byValue(nums(p.space)),radius:byValue(nums(p.radius)),size:byValue(nums(p.type.size)),weight:byValue(nums(p.type.weight))});let g=groups,space=v=>tokenOf(g.space,nums(theme.space),v),radius=v=>tokenOf(g.radius,nums(theme.radius),v),walk=v=>Array.isArray(v)?v.map(walk):v===null||typeof v!="object"?v:isBox(v)?{...v,padding:v.padding.map(space),gap:v.gap.map(space),marginTop:space(v.marginTop),marginBottom:space(v.marginBottom),radius:v.radius.map(radius)}:isText(v)?{...v,size:tokenOf(g.size,nums(theme.type.size),v.size),weight:tokenOf(g.weight,nums(theme.type.weight),v.weight),marginTop:space(v.marginTop),paddingTop:space(v.paddingTop)}:Object.fromEntries(Object.entries(v).map(([k2,x])=>[k2,walk(x)])),out=walk(base3);return derived.set(theme,out),out}var TEXT_VARIANT_TIERS={display:"heading",headline:"heading",title:"heading",heading:"heading",body:"content",lead:"content",label:"control",meta:"compact",caption:"content",overline:"compact",kicker:"compact"};function textToneColor(t,tone){let c=t.colors;switch(tone){case"ink":return c.ink;case"text":return c.text;case"muted":return c.muted;case"danger":return c.alertDeep;case"inverse":return c.onInk;default:return}}function textVariantSpec(t,variant,tone,weight){let base3=textPartSpec(t,t.metrics.text[variant]),color=textToneColor(t,tone);return{...base3,...color?{color:color}:{},...weight?{weight:t.type.weight[weight]}:{}}}var TEXT_VARIANT_BREAKS={display:"balance",headline:"balance",title:"balance",heading:"balance",body:"pretty",lead:"pretty",meta:"pretty",caption:"pretty",label:"auto",overline:"auto",kicker:"auto"};function textVariantTier(t,variant){return t.type.variantTiers?.[variant]??TEXT_VARIANT_TIERS[variant]}var ReducedMotionContext=/* @__PURE__ */(()=>{let key=/* @__PURE__ */Symbol.for("@everfur-health/ui-native#ReducedMotionContext@v1"),host=globalThis,context=host[key]??(host[key]=react.createContext(null));return context.displayName??(context.displayName="EverfurReducedMotionContext"),context})();function useKnownReducedMotion(){return react.useContext(ReducedMotionContext)}function rnText(t,spec){let face2=faceOf(spec.weight,spec.mono===true);return{fontFamily:spec.serif?t.type.faces.serif??t.type.faces.bold:t.type.faces[face2],...t.type.namedFaces?{}:{fontWeight:String(spec.weight)},fontSize:spec.size,lineHeight:spec.lineHeight,color:spec.color,...spec.tracking?{letterSpacing:spec.tracking}:{},...spec.upper?{textTransform:"uppercase"}:{},...spec.deco?rnDeco(spec):{},...spec.tabular?{fontVariant:["tabular-nums"]}:{},...spec.wrap&&reactNative.Platform.OS==="web"?{textWrap:spec.wrap}:{}}}function rnDeco(spec){let base3={textDecorationLine:spec.deco==="strike"?"line-through":"underline"};return reactNative.Platform.OS!=="web"?base3:{...base3,...spec.decoOffset?{textUnderlineOffset:spec.decoOffset}:{},...spec.decoThickness?{textDecorationThickness:spec.decoThickness}:{}}}function rnBox(t,b){let[pt=0,pr=0,pb=0,pl=0]=b.padding,[rt=0,rb=0]=b.radius,fill=partFill(t,b.bg);return{paddingTop:pt,paddingRight:pr,paddingBottom:pb,paddingLeft:pl,...b.marginTop?{marginTop:b.marginTop}:{},...b.gap[0]?{columnGap:b.gap[0]}:{},...b.gap[1]?{rowGap:b.gap[1]}:{},...rt===rb?rt?{borderRadius:rt}:{}:{borderTopLeftRadius:rt,borderTopRightRadius:rt,borderBottomLeftRadius:rb,borderBottomRightRadius:rb},...fill?{backgroundColor:fill}:{},...b.edge.width>0&&!b.edge.ring?{borderWidth:b.edge.width,borderColor:colorOf(t,b.edge.color)}:{},...b.minHeight?{minHeight:b.minHeight}:{},...rnShadow(b.shadow)}}function webReducedMotion(){if(reactNative.Platform.OS!=="web")return false;let g=globalThis;return typeof g.matchMedia=="function"&&g.matchMedia("(prefers-reduced-motion: reduce)").matches}function useOsReducedMotion(known){let[reduced,setReduced]=react.useState(()=>known===null&&webReducedMotion());return react.useEffect(()=>{if(known!==null)return;let mounted=true,query=reactNative.AccessibilityInfo?.isReduceMotionEnabled;if(typeof query=="function"){let result=query.call(reactNative.AccessibilityInfo);result!=null&&typeof result.then=="function"&&result.then(value=>{mounted&&setReduced(value===true)},()=>{})}let subscription=reactNative.AccessibilityInfo?.addEventListener?.("reduceMotionChanged",value=>setReduced(value===true));return()=>{mounted=false,subscription?.remove?.()}},[known]),known??reduced}function useRnReduced(t){let os=useOsReducedMotion(useKnownReducedMotion());return t.motion.reduced||os}function slopFor(size){let pad=Math.max(0,Math.ceil((44-size)/2));return pad===0?void 0:{top:pad,bottom:pad,left:pad,right:pad}}function rnShadow(s){return s.blur===0&&s.y===0&&s.x===0?null:{shadowColor:s.color,shadowOffset:{width:s.x,height:s.y},shadowOpacity:1,shadowRadius:s.blur,elevation:1}}function breakProps(mode){return mode==="auto"?null:reactNative.Platform.OS==="ios"?{lineBreakStrategyIOS:"push-out"}:reactNative.Platform.OS==="android"&&mode==="balance"?{textBreakStrategy:"balanced"}:null}function weightStyle(t,weight){let w=t.type.weight[weight];return t.type.namedFaces?{fontFamily:t.type.faces[faceOf(w)]}:{fontWeight:String(w)}}function Text2({tier:tier,variant:variant,tone:tone,weight:weight,level:level,lineBreak:lineBreak,...props}){let t=useTheme(),cap2=t.type.scaleCaps[tier??(variant?textVariantTier(t,variant):"content")],breaks=breakProps(lineBreak??(variant?TEXT_VARIANT_BREAKS[variant]:"auto"));if(variant===void 0&&tone===void 0&&weight===void 0&&level===void 0)return breaks?react.createElement(reactNative.Text,{...cap2>0?{maxFontSizeMultiplier:cap2}:{},...breaks,...props}):react.createElement(reactNative.Text,cap2>0?{maxFontSizeMultiplier:cap2,...props}:props);let color=textToneColor(t,tone),own=variant?rnText(t,textVariantSpec(t,variant,tone,weight)):{...color?{color:color}:{},...weight?weightStyle(t,weight):{}},heading=level===void 0?{}:{accessibilityRole:"header",...reactNative.Platform.OS==="web"?{"aria-level":level}:{}};return react.createElement(reactNative.Text,{...cap2>0?{maxFontSizeMultiplier:cap2}:{},...breaks,...heading,...props,style:[own,props.style]})}var BOX=24,FINE=16,SEAM=.8,fine=dp=>Math.round(dp*FINE);function place(cx,cy,W,H,ux,uy){let left=cx-W/2,top=cy-H/2,x=Math.round(left),y=Math.round(top);return{position:"absolute",left:x,top:y,width:W,height:H,transform:[{translateX:left-x},{translateY:top-y},{rotate:`${Math.atan2(uy,ux)*180/Math.PI}deg`},{scale:1/FINE}]}}function strokePieces(icon,k2,out){for(let s of icon.strokes){let w=s.width*k2,pts=s.points,n=pts.length/2,last=s.closed?n:n-1;for(let i=0;i<last;i+=1){let j=(i+1)%n,px2=(pts[i*2]??0)*k2,py=(pts[i*2+1]??0)*k2,dx=(pts[j*2]??0)*k2-px2,dy=(pts[j*2+1]??0)*k2-py,len=Math.hypot(dx,dy);if(len===0&&!(n===2&&s.cap))continue;let ux=len===0?1:dx/len,uy=len===0?0:dy/len,e0=s.closed||i>0||s.cap?w/2:0,e1=s.closed||j!==n-1||s.cap?w/2:0,along=(len+e1-e0)/2;out.push({paint:"backgroundColor",style:{...place(px2+ux*along,py+uy*along,fine(len+e0+e1),fine(w),ux,uy),borderTopLeftRadius:e0>0?fine(w)/2:0,borderBottomLeftRadius:e0>0?fine(w)/2:0,borderTopRightRadius:e1>0?fine(w)/2:0,borderBottomRightRadius:e1>0?fine(w)/2:0,...s.opacity===void 0?{}:{opacity:s.opacity}}})}}}function boxPieces(icon,k2,out){for(let b of icon.boxes){let w=(b.w+b.width)*k2,h=(b.h+b.width)*k2;out.push({paint:"borderColor",style:{...place((b.x-b.width/2)*k2+w/2,(b.y-b.width/2)*k2+h/2,fine(w),fine(h),1,0),borderWidth:fine(b.width*k2),borderRadius:(b.radius+b.width/2)*k2*FINE,...b.opacity===void 0?{}:{opacity:b.opacity}}})}}function trianglePieces(icon,k2,out){for(let t of icon.triangles){let p=[0,1,2].map(i=>[(t[i*2]??0)*k2,(t[i*2+1]??0)*k2]),base3=0,len=-1;for(let i=0;i<3;i+=1){let a2=p[i]??[0,0],b=p[(i+1)%3]??[0,0],d=Math.hypot(b[0]-a2[0],b[1]-a2[1]);d>len&&(len=d,base3=i)}if(len<=0)continue;let b0=p[base3]??[0,0],b1=p[(base3+1)%3]??[0,0],a=p[(base3+2)%3]??[0,0],ux=(b1[0]-b0[0])/len,uy=(b1[1]-b0[1])/len,along=(a[0]-b0[0])*ux+(a[1]-b0[1])*uy,across=(a[0]-b0[0])*-uy+(a[1]-b0[1])*ux,h=Math.abs(across),up=across<0,mid=up?-h/2:h/2,bl=fine(along),br=fine(len)-bl,bh=fine(h);out.push({paint:up?"borderBottomColor":"borderTopColor",style:{...place(b0[0]+ux*(len/2)-uy*mid,b0[1]+uy*(len/2)+ux*mid,bl+br,bh,ux,uy),width:0,height:0,borderLeftWidth:bl,borderRightWidth:br,borderLeftColor:"transparent",borderRightColor:"transparent",...up?{borderBottomWidth:bh}:{borderTopWidth:bh}}})}for(let e of icon.seams){let x0=(e[0]??0)*k2,y0=(e[1]??0)*k2,dx=(e[2]??0)*k2-x0,dy=(e[3]??0)*k2-y0,d=Math.hypot(dx,dy),in0=SEAM*(e[4]??0),in1=SEAM*(e[5]??0),bar=d-in0-in1;if(d===0||bar<=0)continue;let mid=in0+bar/2;out.push({paint:"backgroundColor",style:place(x0+dx/d*mid,y0+dy/d*mid,fine(bar),fine(SEAM),dx/d,dy/d)})}}var cache2=/* @__PURE__ */new WeakMap;function piecesOf(icon,size){let sizes=cache2.get(icon);sizes===void 0&&(sizes=/* @__PURE__ */new Map,cache2.set(icon,sizes));let hit=sizes.get(size);if(hit!==void 0)return hit;let out=[],k2=size/BOX;return boxPieces(icon,k2,out),strokePieces(icon,k2,out),trianglePieces(icon,k2,out),sizes.set(size,out),out}function Glyph({icon:icon,size:size,color:color,label:label,testID:testID,style:style}){let t=useTheme(),side=size??t.metrics.icon.size,ink=color??t.colors.ink;/* @__PURE__ */
|
|
36
|
-
return jsxRuntime.jsx(reactNative.View,{testID:testID,pointerEvents:"none",style:[{width:side,height:side},style],...label?{accessible:true,accessibilityRole:"image",accessibilityLabel:label}:{accessible:false,accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants"},children:piecesOf(icon,side).map((piece,i)=>/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[piece.style,{[piece.paint]:ink}]},i))})}var REGISTRY=/* @__PURE__ */(()=>{let key=/* @__PURE__ */Symbol.for("@everfur-health/ui-native#icons@v1"),
|
|
37
|
-
return jsxRuntime.jsx(reactNative.View,{testID:testID,style:[{rowGap:m.gap,alignSelf:"stretch"},style],...label?{accessible:true,accessibilityRole:"progressbar",accessibilityLabel:label,accessibilityState:{busy:true}}:{accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants"},children:Array.from({length:Math.max(1,lines)},(_,i)=>/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:{height:m.lineHeight,width:skeletonWidth(t,i),borderRadius:t.radius.pill,backgroundColor:t.colors.tintSage}},i))})}function SummaryList({rows:given,total:total=false,trailingRows:trailingRows=[],loading:loading=false,loadingLabel:loadingLabel,variant:variant="standard",note:note,grouped:grouped=true,lineBreak:lineBreak,testID:testID,style:style}){let t=useTheme(),s=summarySpec(t);if(loading)/* @__PURE__ */
|
|
35
|
+
/* @__PURE__ */jsxRuntime.jsx(reactNative.Animated.View,{style:look(enter),children:node}),at.leaving===null?null:/* @__PURE__ */jsxRuntime.jsx(reactNative.Animated.View,{pointerEvents:"none",style:[{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:paper},look(exit)],children:at.leaving})]})}var everfurTokens=/* @__PURE__ */Object.freeze({color:/* @__PURE__ */Object.freeze({efDarkGreen:"#10462E",efWhite:"#FFFFFF",efBlack:"#000000",efDustyPink:"#FFC3BC",efBrightGreen:"#07C168",efYellow:"#F2C763",efDustyBlue:"#A8B9DA",efSkyBlue:"#4E98C9",efCharcoal:"#3D3D3D",efIconHoney:"#926F06",efIconLeaf:"#16864A",efIconSky:"#1E7AB7",efIconTeal:"#05827E",efIconCocoa:"#865B3F",efIconNavy:"#223E80",efIconBerry:"#B6407F",efIconAmber:"#B25E05",efIconMoss:"#5E7E1E",efIconSlate:"#5A6087",efIconRose:"#CA4463",efRedDeep:"#6D1D14",efRedBright:"#C03410",bg:"#FFFFFF",bgBrand:"#10462E",bgAccent:"#FFC3BC",bgAccentB2b:"#A8B9DA",bgWarm:"#F2C763",text:"#000000",textBrand:"#10462E",textOnBrand:"#FFFFFF",textCta:"#07C168",textMuted:"#6B6B6B",bgMist:"#F1F5F2",border:"#E4E4E4",borderStrong:"#3D3D3D",hi:"#DAF6E8",hiStrong:"#ABEACC",hiEdge:"#0B8A4E",now:"#0C844B",alert:"#C03410",alertDeep:"#6D1D14",btnPrimaryBg:"#10462E",btnPrimaryText:"#FFFFFF",btnSecondaryBg:"rgba(0, 0, 0, 0)",btnSecondaryText:"#10462E",btnSecondaryBorder:"#10462E",mixMint:"#7FE8AE",mixLegal:"#A9C4B5",mixPromptGreen:"#BFEFD8",mixPromptYellow:"#F7DC9E",mixRx:"#E0E6F2",mixShelf:"#F3F3F3",mixEar:"#F09FA3",efBone:"#FAF9F6",efTennisBall:"#DCEF5A",efFawn:"#E8CAA4",efPine:"#12301F",efPine70:"rgba(18, 48, 31, 0.72)",efLiver:"#7A4330",efMerle:"#AEB8C1",efNose:"#E9B6A6"}),font:/* @__PURE__ */Object.freeze({family:/* @__PURE__ */Object.freeze({base:'Azeret, "Helvetica Neue", Arial, sans-serif',mono:'"Azeret Mono", ui-monospace, "SF Mono", Menlo, monospace'}),size:/* @__PURE__ */Object.freeze({xs:13,sm:15,md:17,lg:20,xl:24,"2xl":32,"3xl":40,"4xl":56}),lineHeight:/* @__PURE__ */Object.freeze({body:1.55,display:1.15}),weight:/* @__PURE__ */Object.freeze({regular:400,medium:500,bold:700})}),space:/* @__PURE__ */Object.freeze({1:4,2:8,3:12,4:16,5:24,6:32,7:48,8:64,9:96}),radius:/* @__PURE__ */Object.freeze({sm:6,md:10,lg:20,xl:28,pill:999}),shadow:/* @__PURE__ */Object.freeze({sm:/* @__PURE__ */Object.freeze({x:0,y:1,blur:2,spread:0,color:"rgba(16, 70, 46, 0.06)"}),md:/* @__PURE__ */Object.freeze({x:0,y:4,blur:16,spread:0,color:"rgba(16, 70, 46, 0.08)"})}),layout:/* @__PURE__ */Object.freeze({container:1200,containerNarrow:720}),motion:/* @__PURE__ */Object.freeze({easing:/* @__PURE__ */Object.freeze({out:/* @__PURE__ */Object.freeze([.23,1,.32,1]),inOut:/* @__PURE__ */Object.freeze([.77,0,.175,1]),drawer:/* @__PURE__ */Object.freeze([.32,.72,0,1]),expo:/* @__PURE__ */Object.freeze([.16,1,.3,1]),bark:/* @__PURE__ */Object.freeze([.34,1.56,.64,1])}),duration:/* @__PURE__ */Object.freeze({press:160,fade:200,enter:300,sheet:420,sheetOut:240,draw:900})}),web:/* @__PURE__ */Object.freeze({serif:'Azeret, "Helvetica Neue", Arial, sans-serif',sans:'Azeret, "Helvetica Neue", Arial, sans-serif',tSmall:14,max:1312}),role:/* @__PURE__ */Object.freeze({color:/* @__PURE__ */Object.freeze({ink:"#10462E",go:"#07C168",muted:"#6B6B6B",line:"#E4E4E4",pink50:"#FFE1DE",tintSage:"#E6ECE8",tintPink:"#FFEAE8",tintPinkSoft:"#FFF6F5",tintBlue:"#EAEEF6",tintYellow:"#FCF0D6",tintYellowEdge:"#F6D892",tintRed:"#FBF1EE",tintGo:"#DCF6EA",icoGrey:"#6B6B6B",icoSage:"#819E90",icoBlue:"#4E98C9",icoWarm:"#D6D0C2",icoAmber:"#B67B3F",amberText:"#A05E32",wxSun:"#F2C763",wxSunEdge:"#D5AD47",wxCloud:"#FFFFFF",wxCloudEdge:"#DEDEDE",wxCloudDark:"#EAEAEA",wxCloudDarkEdge:"#C5C5C5",wxRain:"#75AFD5",wxSnow:"#AFD1E7",wxMist:"#D4D4D4",cwShelf:"#FFFFFF",cwShelfDeep:"#F1F4F2",cwRx:"#E0E6F2",cwRxInk:"#5A6087",cwEdgeC:"#C6D3CD",nItch:"#CA4463",nJoints:"#5E7E1E",nItchC:"#FFC3BC",nJointsC:"#D8E0C9",lvlGood:"#77DDAC",lvlOk:"#F4CF7A",lvlHot:"#DC8F7C",lvlStorm:"#8DA4BB",mapLand:"#F5F5F5",mapEdge:"#EAEAEA",mapPark:"#D7F5E7",mapWater:"#D8E0EE",mapSand:"#FCF3DD"}),size:/* @__PURE__ */Object.freeze({max:1440,gutter:16,sideW:220,cardPad:16,barH:48,tabH:58,dock:64,side:16,stackGap:12})})});var BLOCK_BOX={shown:true,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},BLOCK_TEXT={shown:true,color:"text",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},blockBox=p=>({...BLOCK_BOX,...p}),blockText=p=>({...BLOCK_TEXT,...p}),everfurMetrics={button:{ink:{fill:false,minHeight:52,paddingX:24,gap:8,borderWidth:1.5,ring:false,fontSize:17,fontWeight:700,lineHeight:1,iconSize:24},go:{fill:false,minHeight:52,paddingX:24,gap:8,borderWidth:1.5,ring:false,fontSize:17,fontWeight:700,lineHeight:1,iconSize:24},outline:{fill:false,minHeight:52,paddingX:24,gap:8,borderWidth:1.5,ring:false,fontSize:17,fontWeight:400,lineHeight:1,iconSize:24},pink:{fill:true,minHeight:60,paddingX:16,gap:8,borderWidth:1,ring:false,fontSize:18,fontWeight:700,lineHeight:1,iconSize:24},danger:{fill:false,minHeight:46,paddingX:16,gap:8,borderWidth:1.5,ring:false,fontSize:15,fontWeight:700,lineHeight:1.55,iconSize:20},inkSm:{fill:false,minHeight:46,paddingX:16,gap:8,borderWidth:1.5,ring:false,fontSize:15,fontWeight:700,lineHeight:1,iconSize:20},goSm:{fill:false,minHeight:46,paddingX:16,gap:8,borderWidth:1.5,ring:false,fontSize:15,fontWeight:700,lineHeight:1,iconSize:20},outlineSm:{fill:false,minHeight:46,paddingX:16,gap:8,borderWidth:1.5,ring:false,fontSize:15,fontWeight:400,lineHeight:1,iconSize:20},pinkSm:{fill:true,minHeight:46,paddingX:16,gap:8,borderWidth:1,ring:false,fontSize:15,fontWeight:700,lineHeight:1,iconSize:20},row:{fill:false,minHeight:36,paddingX:14,gap:8,borderWidth:1.5,ring:false,fontSize:14,fontWeight:400,lineHeight:1,iconSize:17},outlineInSheetWeight:700,money:{fill:false,minHeight:52,paddingX:24,gap:8,borderWidth:1,ring:false,fontSize:17,fontWeight:700,lineHeight:1,iconSize:24,bg:"pink",fg:"ink",edgeColor:"ink"},moneySm:{fill:false,minHeight:46,paddingX:16,gap:8,borderWidth:1,ring:false,fontSize:15,fontWeight:700,lineHeight:1,iconSize:20,bg:"pink",fg:"ink",edgeColor:"ink"},warn:{fill:false,minHeight:52,paddingX:24,gap:8,borderWidth:1.5,ring:false,fontSize:17,fontWeight:700,lineHeight:1,iconSize:24,bg:"none",fg:"alertDeep",edgeColor:"alert"},warnSm:{fill:false,minHeight:46,paddingX:16,gap:8,borderWidth:1.5,ring:false,fontSize:15,fontWeight:700,lineHeight:1,iconSize:20,bg:"none",fg:"alertDeep",edgeColor:"alert"},text:{fontSize:15,fontWeight:700,lineHeight:1.4,color:"ink",pressOpacity:.6}},pill:{minHeight:24,paddingX:10,fontSize:12,fontWeight:700,lineHeight:1,letterSpacing:.72,ring:{soon:1.25,overdue:1.25,clear:1.5,later:1.25,plain:1.5,new:1.5},plainRingAlpha:.2,dot:6,dotGap:6,allergyDot:{size:6,gap:6,color:"alert"},mono:true,upper:true,tones:{rx:{bg:"#E0E6F2",fg:"ink",ring:0,ringColor:"ink"},soon:{bg:"surface",fg:"ink",ring:1.25,ringColor:"tintYellowEdge"},overdue:{bg:"surface",fg:"alert",ring:1.25,ringColor:"alert"},clear:{bg:"surface",fg:"go",ring:1.5,ringColor:"go"},stable:{bg:"tintGo",fg:"ink",ring:0,ringColor:"ink"},later:{bg:"surface",fg:"muted",ring:1.25,ringColor:"line"},plain:{bg:"surface",fg:"ink",ring:1.5,ringColor:"ink/0.2"},new:{bg:"surface",fg:"ink",ring:1.5,ringColor:"go"},pink:{bg:"tintPink",fg:"ink",ring:0,ringColor:"ink"},watch:{bg:"#F9E6B9",fg:"ink",ring:0,ringColor:"ink"},high:{bg:"surface",fg:"alert",ring:1.25,ringColor:"alert"},allergy:{bg:"surface",fg:"alertDeep",ring:1.25,ringColor:"alert"}}},chip:{minHeight:42,paddingX:16,gap:8,borderWidth:1,fontSize:15,fontWeight:500,lineHeight:1.3},card:{padding:16,radius:20,borderWidth:1,titleSize:18,titleWeight:700,titleLineHeight:1.25,titleTracking:-.36,titleGap:12,leadSize:15,leadLineHeight:1.5,leadGap:12,headGapX:16,headGapY:8,headGap:12,bodySize:17,bodyLineHeight:1.55,ghost:{borderStyle:"dashed",borderColor:"#B9C9C2"}},sectionHeader:{gapX:12,gapY:8,marginTop:8},kicker:{fontSize:12,fontWeight:700,lineHeight:1.55,letterSpacing:.96,gap:8},quantityStepper:{borderWidth:1,borderColor:"line",ring:false,button:40,icon:18,valueMinWidth:28,offColor:"line",offOpacity:1,valueSize:17,valueWeight:700,valueLineHeight:1.55},tabs:{minHeight:44,gap:6,fontSize:15,fontWeight:500,currentWeight:700,lineHeight:1.55,indicator:3,hairline:1,dot:7},sheet:{radius:28,grabHeight:20,grabBarWidth:36,grabBarHeight:5,grabBarRadius:3,headPaddingTop:4,headPaddingX:16,headPaddingBottom:12,headGap:12,titlesGap:2,titleSize:18,close:36,closeIcon:20,bodyGap:12,bodyPaddingX:16,bodyPaddingBottom:24,actsGap:12,actsMarginTop:4},empty:{gap:8,titleSize:22,titleWeight:500,titleLineHeight:1.2,titleTracking:-.33,leadSize:15,leadLineHeight:1.5,actsGap:12,actsMarginTop:12,buttonMinWidth:200,linkMinHeight:44,linkPaddingX:4,linkSize:15,linkWeight:700,linkUnderlineOffset:3},skeleton:{gap:10,lineHeight:12,widths:[100,82,64]},summary:{paddingX:24,paddingY:0,radius:20,borderWidth:1,background:"surface",shadow:{color:"",x:0,y:0,blur:0,spread:0},rowDivider:1,rowMinHeight:0,rowCenter:false,rowPaddingY:14,termColor:"muted",valueColor:"ink",tabular:false,totalRowMinHeight:0,totalTermSize:15,totalTermWeight:400,totalTermColor:"muted",totalWeight:700,rowGapX:16,rowGapY:2,termSize:15,termLineHeight:1.55,valueSize:15,valueWeight:700,valueLineHeight:1.4,totalSize:20,totalLineHeight:1.4,off:{shown:true,size:15,weight:700,lineHeight:21,color:"go",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0}},icon:{size:24},timeline:{row:{shown:true,w:361,h:69.281,padding:[0,0,24,0],marginTop:0,marginBottom:0,gap:[16,16],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},done:{shown:true,w:28,h:28,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[14,14],bg:"ink",edge:{width:2,color:"ink",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"surface",fit:"cover",x:0,y:0,dy:0},now:{shown:true,w:28,h:28,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[14,14],bg:"surface",edge:{width:2,color:"ink",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"text",fit:"cover",x:0,y:0,dy:0},next:{shown:true,w:28,h:28,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[14,14],bg:"surface",edge:{width:2,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"text",fit:"cover",x:0,y:0,dy:0},nowInner:{size:10,color:"go"},check:{shown:true,w:16,h:16,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"surface",fit:"cover",x:0,y:0,dy:0},lineDoneDone:{x:13,top:30,bottom:2,width:2,color:"ink"},lineDoneNow:{x:13,top:30,bottom:2,width:2,color:"ink"},lineNowNext:{x:13,top:30,bottom:2,width:2,color:"line"},title:{shown:true,size:17,weight:700,lineHeight:22.1,color:"ink",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:3},head:{shown:true,w:317,h:27,padding:[3,0,0,0],marginTop:0,marginBottom:0,gap:[8,4],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"ink",fit:"cover",x:0,y:0,dy:0},nextTitle:{shown:true,size:17,weight:700,lineHeight:22.1,color:"muted",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:3},when:{shown:true,size:13,weight:400,lineHeight:18.2,color:"muted",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:2,paddingTop:0},text:{shown:true,size:15,weight:400,lineHeight:22.5,color:"text",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:2,paddingTop:0}},thumbnail:{xs:{frame:{shown:true,w:48,h:48,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[6,6],bg:"surface",edge:{width:1,color:"line",ring:true},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"contain",x:0,y:0,dy:0},img:{shown:false,w:48,h:48,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[6,6],bg:"surface",edge:{width:1,color:"line",ring:true},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"contain",x:0,y:0,dy:0},empty:{shown:true,w:48,h:48,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[10,10],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"#1E7AB7",fit:"cover",x:0,y:0,dy:0},icon:{shown:true,w:22,h:22,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"#1E7AB7",fit:"cover",x:0,y:0,dy:0},top:false},sm:{frame:{shown:true,w:64,h:64,padding:[8,8,8,8],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[14,14],bg:"#F3F3F3",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},img:{shown:true,w:48,h:48,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"contain",x:0,y:0,dy:0},empty:{shown:true,w:64,h:64,padding:[8,8,8,8],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[14,14],bg:"#F3F3F3",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},icon:{shown:true,w:22,h:22,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"#1E7AB7",fit:"cover",x:0,y:0,dy:0},top:false},md:{frame:{shown:true,w:156,h:156,padding:[0,0,0,0],marginTop:0,marginBottom:6,gap:[0,0],minHeight:0,radius:[20,20],bg:"#F5F5F5",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},img:{shown:true,w:156,h:156,padding:[10,10,10,10],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"contain",x:0,y:0,dy:0},empty:{shown:true,w:156,h:156,padding:[0,0,0,0],marginTop:0,marginBottom:6,gap:[0,0],minHeight:0,radius:[20,20],bg:"#F5F5F5",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},icon:{shown:true,w:22,h:22,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"#1E7AB7",fit:"cover",x:0,y:0,dy:0},top:false},lg:{frame:{shown:true,w:174.5,h:174.5,padding:[0,0,0,0],marginTop:0,marginBottom:8,gap:[0,0],minHeight:0,radius:[20,20],bg:"#F3F3F3",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},img:{shown:true,w:174.5,h:174.5,padding:[14,14,18,14],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"contain",x:0,y:0,dy:0},empty:{shown:true,w:174.5,h:174.5,padding:[0,0,0,0],marginTop:0,marginBottom:8,gap:[0,0],minHeight:0,radius:[20,20],bg:"#F3F3F3",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},icon:{shown:true,w:22,h:22,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"#1E7AB7",fit:"cover",x:0,y:0,dy:0},top:false}},text:{display:{shown:true,size:40,weight:500,lineHeight:39.2,color:"ink",tracking:-1.2,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},headline:{shown:true,size:30,weight:500,lineHeight:33,color:"ink",tracking:-.45,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},title:{shown:true,size:22,weight:500,lineHeight:26.4,color:"ink",tracking:-.33,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},heading:{shown:true,size:18,weight:700,lineHeight:22.5,color:"ink",tracking:-.36,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},body:{shown:true,size:17,weight:400,lineHeight:26.35,color:"text",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},lead:{shown:true,size:15,weight:400,lineHeight:21.75,color:"text",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},label:{shown:true,size:15,weight:700,lineHeight:21,color:"ink",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},meta:{shown:true,size:13,weight:400,lineHeight:18.85,color:"muted",tracking:0,face:"mono",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},caption:{shown:true,size:13,weight:400,lineHeight:19.5,color:"muted",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},overline:{shown:true,size:12,weight:700,lineHeight:16.8,color:"muted",tracking:.72,face:"mono",upper:true,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},kicker:{shown:true,size:12,weight:700,lineHeight:18.6,color:"muted",tracking:.96,face:"mono",upper:true,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0}},field:{gap:6,label:{shown:true,size:15,weight:700,lineHeight:21,color:"ink",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},input:{shown:true,w:361,h:52,padding:[0,16,0,16],marginTop:0,marginBottom:0,gap:[10,10],minHeight:52,radius:[10,10],bg:"surface",edge:{width:1.5,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"text",fit:"cover",x:0,y:0,dy:0},focusEdge:"ink",errorEdge:"alert",value:{shown:true,size:17,weight:400,lineHeight:26.35,color:"text",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:1},valueInset:[2,1],icon:{shown:true,w:20,h:20,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"muted",fit:"cover",x:0,y:0,dy:0},area:{shown:true,w:361,h:158,padding:[12,16,12,16],marginTop:0,marginBottom:0,gap:[10,10],minHeight:52,radius:[10,10],bg:"surface",edge:{width:1.5,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},areaValue:{shown:true,size:17,weight:400,lineHeight:25.5,color:"text",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:2},areaValueMinHeight:132,areaInset:[2,2],hint:{shown:true,size:13,weight:400,lineHeight:19.5,color:"muted",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},error:{shown:true,size:15,weight:400,lineHeight:21.75,color:"alertDeep",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},placeholder:"muted"},checkbox:{row:{shown:true,w:361,h:45,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[12,12],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},labelX:34,box:{shown:true,w:20,h:20,padding:[0,0,0,0],marginTop:1,marginBottom:0,gap:[0,0],minHeight:0,radius:[6,6],bg:"surface",edge:{width:1.5,color:"icoSage",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},on:{shown:true,w:20,h:20,padding:[0,0,0,0],marginTop:1,marginBottom:0,gap:[0,0],minHeight:0,radius:[6,6],bg:"ink",edge:{width:1.5,color:"ink",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},tick:{w:5,h:10,stroke:2,color:"surface",rotate:45,dy:-1},label:{shown:true,size:15,weight:400,lineHeight:22.5,color:"text",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},boxed:{shown:true,w:361,h:50.5,padding:[14,16,14,16],marginTop:0,marginBottom:0,gap:[12,12],minHeight:0,radius:[10,10],bg:"bgMist",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0}},choice:{row:{shown:true,w:361,h:56.344,padding:[14,16,14,16],marginTop:0,marginBottom:0,gap:[12,12],minHeight:0,radius:[10,10],bg:"surface",edge:{width:1.5,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"text",fit:"cover",x:0,y:0,dy:0},selected:{shown:true,w:361,h:56.344,padding:[14,16,14,16],marginTop:0,marginBottom:0,gap:[12,12],minHeight:0,radius:[10,10],bg:"pink",edge:{width:1.5,color:"ink",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"text",fit:"cover",x:0,y:0,dy:0},radio:{shown:true,w:20,h:20,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[10,10],bg:"surface",edge:{width:1.5,color:"icoSage",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},radioOn:{shown:true,w:20,h:20,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[10,10],bg:"surface",edge:{width:6,color:"ink",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},textX:34,title:{shown:true,size:17,weight:700,lineHeight:22.1,color:"ink",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},strut:26.35,meta:{shown:true,size:13,weight:400,lineHeight:18.2,color:"muted",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:2,paddingTop:0},end:{shown:true,size:13,weight:400,lineHeight:20.15,color:"muted",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},group:{gap:8,legend:{shown:true,size:15,weight:700,lineHeight:21,color:"ink",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},legendPaddingX:2,legendGap:0}},switch:{track:{shown:true,w:48,h:28,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[999,999],bg:"#D0D6D3",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},on:"ink",thumb:{size:22,inset:3,travel:20,color:"surface",shadow:{color:"rgba(16, 70, 46, 0.06)",x:0,y:1,blur:2,spread:0}}},iconButton:{bare:{shown:true,w:44,h:44,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[22,22],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"ink",fit:"cover",x:0,y:0,dy:0},bareIcon:22,offColor:"line",ring:{shown:true,w:36,h:36,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[18,18],bg:"surface",edge:{width:1.5,color:"ink",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"ink",fit:"cover",x:0,y:0,dy:0},ringIcon:18,ringPressed:"tintSage",ringPressScale:.94},link:{text:{shown:true,size:17,weight:400,lineHeight:22.1,color:"ink",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"underline",decoOffset:3,decoThickness:0,marginTop:0,paddingTop:0},danger:{shown:true,size:15,weight:700,lineHeight:23.25,color:"alert",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"underline",decoOffset:3,decoThickness:0,marginTop:0,paddingTop:0},inline:{shown:true,size:17,weight:400,lineHeight:26.35,color:"text",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"underline",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0}},lists:{rows:{row:{shown:true,w:327,h:94.781,padding:[16,0,16,0],marginTop:0,marginBottom:0,gap:[16,8],minHeight:0,radius:[0,0],bg:"none",edge:{width:1,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"text",fit:"cover",x:0,y:0,dy:0},title:{shown:true,size:17,weight:700,lineHeight:22.1,color:"ink",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},subtitle:{shown:true,size:13,weight:400,lineHeight:18.85,color:"muted",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:2,paddingTop:0}},tiles:{list:{shown:true,w:343,h:175.813,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[4,4],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},outdent:8,row:{shown:true,w:343,h:62.281,padding:[10,8,10,8],marginTop:0,marginBottom:0,gap:[12,12],minHeight:0,radius:[10,10],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"text",fit:"cover",x:0,y:0,dy:0},leading:22,leadingFace:40,icon:{shown:true,w:20,h:20,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"muted",fit:"cover",x:0,y:0,dy:0},text:{shown:true,w:261,h:42.281,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[2,2],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},title:{shown:true,size:17,weight:700,lineHeight:22.1,color:"ink",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},subtitle:{shown:true,size:13,weight:400,lineHeight:18.2,color:"muted",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},pressed:"#EDF2EF",alert:{bg:"tintRed",icon:"alert",title:"alertDeep",subtitle:"alert"}},end:{text:{shown:true,size:15,weight:400,lineHeight:23.25,color:"muted",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},gap:8,chevron:{shown:true,w:20,h:20,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"#819D90",fit:"cover",x:0,y:0,dy:0}},section:{title:{shown:true,size:18,weight:700,lineHeight:22.5,color:"ink",tracking:-.36,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},titleGap:12,head:{shown:true,w:361,h:22.5,padding:[0,0,0,0],marginTop:8,marginBottom:0,gap:[12,8],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"text",fit:"cover",x:0,y:0,dy:0},note:{shown:true,size:13,weight:400,lineHeight:19.5,color:"muted",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:12,paddingTop:0}},avatar:{sizes:{xs:20,sm:36,md:48,lg:64,xl:128},face:40,bg:"surface",edge:{width:1,color:"line",ring:true},initials:{shown:true,size:15,weight:700,lineHeight:23.25,color:"ink",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},initialsXs:{shown:true,size:9,weight:700,lineHeight:13.95,color:"ink",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},tints:{default:"tintPink",pink:"#FFCFC9",blue:"#C2CEE5",yellow:"#F6D78F",sage:"#C6D3CD"},ring:{width:2,offset:2,color:"go"},ringXl:{width:3,offset:4,color:"go"},dot:{size:12,edge:2,edgeColor:"surface"}},stack:{size:28,overlap:-8,initialsSize:12,halo:{width:2,color:"surface"}},banner:{box:{shown:true,w:361,h:155.391,padding:[16,16,16,16],marginTop:0,marginBottom:0,gap:[12,4],minHeight:0,radius:[20,20],bg:"#F1F5F2",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},icon:{shown:true,w:22,h:22,padding:[0,0,0,0],marginTop:1,marginBottom:0,gap:[0,0],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"ink",fit:"cover",x:0,y:0,dy:0},iconRows:3,kicker:{shown:true,size:12,weight:700,lineHeight:16.8,color:"#5B5B5B",tracking:.72,face:"mono",upper:true,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},title:{shown:true,size:17,weight:700,lineHeight:22.1,color:"ink",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},text:{shown:true,size:15,weight:400,lineHeight:21.75,color:"text",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},acts:{shown:true,w:295,h:21,padding:[0,0,0,0],marginTop:8,marginBottom:0,gap:[16,8],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"text",fit:"cover",x:0,y:0,dy:0},link:{shown:true,size:15,weight:700,lineHeight:21,color:"ink",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},tones:{info:{bg:"#F1F5F2",icon:"ink"},success:{bg:"tintGo",icon:"ink"},warn:{bg:"#FCF0D6",icon:"#926F06"},danger:{bg:"tintRed",icon:"alert"}}},toast:{box:{shown:true,w:200.281,h:40.25,padding:[10,16,10,16],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[999,999],bg:"ink",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"surface",fit:"cover",x:0,y:0,dy:0},text:{shown:true,size:15,weight:400,lineHeight:20.25,color:"onInk",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:10},inset:16,rise:8,fade:200,hold:2600},spinner:{size:16,border:2,turn:700,openSide:true,reducedOpacity:.5},offbar:{box:{shown:true,w:361,h:56,padding:[6,16,6,16],marginTop:0,marginBottom:0,gap:[10,10],minHeight:44,radius:[0,0],bg:"#FCF0D6",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"ink",fit:"cover",x:0,y:48,dy:0},text:{shown:true,size:15,weight:500,lineHeight:19.5,color:"ink",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},icon:{shown:true,w:20,h:20,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"ink",fit:"cover",x:0,y:0,dy:0},action:{shown:true,w:69.859,h:44,padding:[0,2,0,2],marginTop:0,marginBottom:0,gap:[6,6],minHeight:44,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"ink",fit:"cover",x:0,y:0,dy:0},actionText:{shown:true,size:15,weight:700,lineHeight:19.5,color:"ink",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"underline",decoOffset:3,decoThickness:0,marginTop:0,paddingTop:0},online:{bg:"ink",color:"onInk"},fade:200},progress:{track:{shown:true,w:361,h:4,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[999,999],bg:"line",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},fill:"go",move:300},divider:{width:1,color:"line",label:{shown:true,size:12,weight:400,lineHeight:18.6,color:"muted",tracking:.72,face:"mono",upper:true,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},labelGap:12,labelLine:{width:1,color:"line"}},errorInline:{text:{shown:true,size:15,weight:400,lineHeight:21,color:"alertDeep",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},acts:{shown:true,w:361,h:21,padding:[0,0,0,0],marginTop:8,marginBottom:0,gap:[16,8],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"text",fit:"cover",x:0,y:0,dy:0},link:{shown:true,size:15,weight:700,lineHeight:21,color:"ink",tracking:0,face:"sans",upper:false,wrap:"pretty",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0}},linkPressedOpacity:.6},variants:{drawer:{frame:{shown:true,w:393,h:226.594,padding:[10,20,40,20],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[28,0],bg:"surface",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"ink",fit:"cover",x:0,y:293.406,dy:0},maxHeight:.8,grab:{shown:true,w:40,h:5,padding:[0,0,0,0],marginTop:0,marginBottom:10,gap:[0,0],minHeight:0,radius:[2.5,2.5],bg:"#DAD7D1",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"ink",fit:"cover",x:0,y:0,dy:0},top:{shown:true,w:353,h:40,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"ink",fit:"cover",x:0,y:0,dy:0},kicker:{shown:true,size:11,weight:400,lineHeight:16.5,color:"muted",tracking:.88,face:"mono",upper:true,wrap:"auto",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},close:{shown:true,w:40,h:40,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[20,20],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"ink",fit:"cover",x:0,y:0,dy:0},closeEnd:-8,closeIcon:22,title:{shown:true,size:24,weight:800,lineHeight:27.6,color:"ink",tracking:-.24,face:"serif",upper:false,wrap:"balance",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},body:{shown:true,w:353,h:82,padding:[0,0,0,0],marginTop:12,marginBottom:0,gap:[10,10],minHeight:0,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"text",fit:"cover",x:0,y:0,dy:0},text:{shown:true,size:16,weight:400,lineHeight:24,color:"text",tracking:0,face:"sans",upper:false,wrap:"auto",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},scrim:"ink/0.38",motion:{enterMs:320,enterEasing:[.32,.72,0,1],exitMs:220,exitEasing:[.23,1,.32,1],scrimEnterMs:240,scrimExitMs:200,scrimEasing:[.25,.1,.25,1]}},button:{ink:{fill:false,minHeight:48,paddingX:22,gap:8,borderWidth:0,ring:false,fontSize:16,fontWeight:700,lineHeight:1.5,iconSize:20},outline:{fill:false,minHeight:48,paddingX:22,gap:8,borderWidth:1.5,ring:true,fontSize:16,fontWeight:700,lineHeight:1.5,iconSize:20},sm:{fill:false,minHeight:40,paddingX:16,gap:8,borderWidth:1.5,ring:true,fontSize:15,fontWeight:700,lineHeight:1.5,iconSize:20},lg:{fill:false,minHeight:56,paddingX:28,gap:8,borderWidth:0,ring:false,fontSize:17,fontWeight:700,lineHeight:1.5,iconSize:20},disabledOpacity:.32,press:.97,transition:"transform 160ms cubic-bezier(0.23, 1, 0.32, 1), opacity 160ms ease"},segmented:{track:{shown:true,w:361,h:44,padding:[4,4,4,4],marginTop:0,marginBottom:0,gap:[4,4],minHeight:0,radius:[22,22],bg:"surface",edge:{width:1.5,color:"#DAD7D1",ring:true},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"ink",fit:"cover",x:0,y:0,dy:0},option:{shown:true,w:115,h:36,padding:[0,6,0,6],marginTop:0,marginBottom:0,gap:[0,0],minHeight:36,radius:[18,18],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"ink",fit:"cover",x:0,y:0,dy:0},label:{shown:true,size:14,weight:700,lineHeight:21,color:"ink",tracking:0,face:"sans",upper:false,wrap:"auto",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},chosen:{shown:true,w:115,h:36,padding:[0,6,0,6],marginTop:0,marginBottom:0,gap:[0,0],minHeight:36,radius:[18,18],bg:"ink",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"onInk",fit:"cover",x:0,y:0,dy:0},chosenLabel:{shown:true,size:14,weight:700,lineHeight:21,color:"onInk",tracking:0,face:"sans",upper:false,wrap:"auto",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},press:.96,transition:"background-color 160ms ease, transform 160ms cubic-bezier(0.23, 1, 0.32, 1)"},stepper:{track:{shown:true,w:110,h:40,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[20,20],bg:"surface",edge:{width:1.5,color:"#DAD7D1",ring:true},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"ink",fit:"cover",x:0,y:0,dy:0},button:{shown:true,w:40,h:40,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[20,20],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"ink",fit:"cover",x:0,y:0,dy:0},icon:16,value:{shown:true,size:15.5,weight:800,lineHeight:23.25,color:"ink",tracking:0,face:"sans",upper:false,wrap:"auto",tabular:true,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},valueWidth:30,disabledOpacity:.3,press:.9,transition:"transform 160ms cubic-bezier(0.23, 1, 0.32, 1)"},summary:{box:{shown:true,w:361,h:144,padding:[6,16,6,16],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[16,16],bg:"surface",edge:{width:0,color:"line",ring:false},shadow:{color:"rgba(38, 37, 35, 0.06)",x:0,y:1,blur:3,spread:0},center:false,color:"ink",fit:"cover",x:0,y:0,dy:0},row:{shown:true,w:329,h:34,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[12,12],minHeight:34,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"ink",fit:"cover",x:0,y:0,dy:0},term:{shown:true,size:15,weight:400,lineHeight:22.5,color:"#4A4845",tracking:0,face:"sans",upper:false,wrap:"auto",tabular:true,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},value:{shown:true,size:15,weight:400,lineHeight:22.5,color:"ink",tracking:0,face:"sans",upper:false,wrap:"auto",tabular:true,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},totalRow:{shown:true,w:329,h:42,padding:[0,0,0,0],marginTop:0,marginBottom:0,gap:[12,12],minHeight:42,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"ink",fit:"cover",x:0,y:0,dy:0},totalTerm:{shown:true,size:17,weight:800,lineHeight:25.5,color:"ink",tracking:0,face:"sans",upper:false,wrap:"auto",tabular:true,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},total:{shown:true,size:17,weight:800,lineHeight:25.5,color:"ink",tracking:0,face:"sans",upper:false,wrap:"auto",tabular:true,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},renewRow:{shown:true,w:329,h:28,padding:[0,0,0,0],marginTop:-6,marginBottom:0,gap:[12,12],minHeight:28,radius:[0,0],bg:"none",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:true,color:"ink",fit:"cover",x:0,y:0,dy:0},renewTerm:{shown:true,size:14,weight:400,lineHeight:21,color:"#4A4845",tracking:0,face:"sans",upper:false,wrap:"auto",tabular:true,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},renew:{shown:true,size:14,weight:400,lineHeight:21,color:"ink",tracking:0,face:"sans",upper:false,wrap:"auto",tabular:true,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:0},inset:{shown:true,w:361,h:88,padding:[6,16,6,16],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[16,16],bg:"bg",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"ink",fit:"cover",x:0,y:0,dy:0}},toast:{box:{shown:true,w:361,h:64.594,padding:[12,15,12,15],marginTop:0,marginBottom:0,gap:[0,0],minHeight:0,radius:[16,16],bg:"ink",edge:{width:0,color:"line",ring:false},shadow:{color:"",x:0,y:0,blur:0,spread:0},center:false,color:"onInk",fit:"cover",x:16,y:62,dy:0},text:{shown:true,size:14.5,weight:400,lineHeight:20.3,color:"onInk",tracking:0,face:"sans",upper:false,wrap:"auto",tabular:false,deco:"none",decoOffset:0,decoThickness:0,marginTop:0,paddingTop:12},motion:{enterMs:220,exitMs:160,easing:[.23,1,.32,1],rise:-8}},focus:{width:2,offset:2,color:"ink"}},press:{button:.97,iconButton:.94,card:.98},colors:{grab:"#C9C9C9",scrim:"rgba(0, 0, 0, 0.32)",watch:"#F9E6B9",planInk:"#262523",planOnInk:"#FFFFFF",planAccent:"#FFCE34",planLink:"#00707C",planAccentWash:"#FFF7DC",planAccentChip:"#FFE7A1",planLinkWash:"#E0FDFF",planLinkChip:"#C8F4F8"}},everfurBlocksMetrics={order:{card:blockBox({w:361,h:163.547}),top:blockBox({w:361,h:39.547,gap:[12,12]}),title:blockText({size:16,weight:700,lineHeight:20,tracking:-.16}),meta:blockText({size:13,weight:400,lineHeight:17.55,color:"muted"}),total:blockText({size:16,weight:700,lineHeight:24.8,tabular:true}),shots:blockBox({w:361,h:64,marginTop:8,gap:[8,8]}),acts:blockBox({w:361,h:40,marginTop:12,gap:[8,8]}),go:blockBox({w:176.5,h:40,padding:[0,12,0,12],gap:[6,6],minHeight:40,radius:[999,999],bg:"go",center:true}),goText:blockText({size:14,weight:700,lineHeight:21.7}),plain:blockBox({w:176.5,h:40,padding:[0,12,0,12],gap:[6,6],minHeight:40,radius:[999,999],bg:"#F3F3F3",center:true}),plainText:blockText({size:14,weight:700,lineHeight:21.7}),note:blockText({size:13,weight:500,lineHeight:17.55,marginTop:8}),icon:blockBox({w:16,h:16}),actsColumns:2,shotPressScale:.96},orderQuiet:{top:blockBox({w:361,h:43.547,gap:[12,12]}),when:blockBox({w:300.063,h:24,gap:[8,4],center:true}),title:blockText({size:16,weight:700,lineHeight:20.8}),chip:blockBox({w:86.031,h:24,padding:[0,9,0,5],gap:[4,4],minHeight:24,radius:[999,999],bg:"tintGo",center:true,color:"ink"}),chipText:blockText({size:12,weight:700,lineHeight:15.6,color:"ink"}),chipIcon:blockBox({w:14,h:14,color:"ink"}),meta:blockText({size:13,weight:400,lineHeight:17.55,color:"muted",marginTop:2}),total:blockText({size:16,weight:700,lineHeight:24.8,tabular:true}),shots:blockBox({w:361,h:64,marginTop:8,gap:[8,8]}),shot:blockBox({w:64,h:64,radius:[14,14],bg:"#F3F3F3"}),shotImg:blockBox({w:64,h:64,padding:[6.391,6.391,6.391,6.391],fit:"contain"}),shotBlend:"multiply",acts:blockBox({w:361,h:44,marginTop:12,gap:[12,12],center:true}),plain:blockBox({w:162.109,h:44,padding:[0,16,0,16],gap:[6,6],minHeight:44,radius:[999,999],bg:"#F3F3F3",center:true}),plainText:blockText({size:14,weight:700,lineHeight:21.7}),icon:blockBox({w:16,h:16}),link:blockBox({w:62.578,h:44,padding:[0,6,0,6],minHeight:44}),linkText:blockText({size:14,weight:700,lineHeight:21.7,deco:"underline",decoOffset:3,decoThickness:1.5})},orderWeb:{card:blockBox({w:952,h:127.781,padding:[16,24,16,16],gap:[24,16],radius:[20,20],bg:"surface",shadow:{color:"rgba(0, 0, 0, 0.04)",x:0,y:1,blur:2,spread:0},center:true}),lift:{color:"rgba(0, 0, 0, 0.05)",x:0,y:6,blur:20,spread:0},shots:blockBox({w:172,h:72}),sq:blockBox({w:72,h:72,radius:[14,14],bg:"#F3F3F3"}),sqRing:3,sqOverlap:22,imgInset:.1,imgFit:"contain",imgBlend:"multiply",text:blockBox({w:446.547,h:95.781,gap:[2,2]}),when:blockBox({w:446.547,h:26,gap:[12,4],center:true}),title:blockText({size:19,weight:700,lineHeight:24.7,tabular:true}),total:blockText({size:19,weight:900,lineHeight:24.7,tabular:true}),chip:blockBox({w:94.547,h:26,padding:[0,10,0,6],gap:[4,4],minHeight:26,radius:[999,999],bg:"tintGo",center:true,color:"ink"}),chipText:blockText({size:13,weight:700,lineHeight:16.9,color:"ink",tabular:true}),chipIcon:blockBox({w:16,h:16,color:"ink"}),meta:blockText({size:16,weight:400,lineHeight:22.4}),note:blockText({size:15,weight:400,lineHeight:21}),acts:blockBox({w:245.453,h:46,gap:[24,8],center:true}),plain:blockBox({w:160.031,h:46,padding:[0,20,0,20],gap:[8,8],minHeight:46,radius:[999,999],bg:"surface",edge:{width:1.5,color:"#C6D3CD",ring:true},center:true,color:"ink"}),plainText:blockText({size:16,weight:700,lineHeight:19.2,color:"ink"}),icon:blockBox({w:18,h:18,color:"ink"}),link:blockBox({w:61.422,h:44,gap:[8,8],minHeight:44,center:true,color:"ink"}),linkText:blockText({size:17,weight:700,lineHeight:20.4,color:"ink",deco:"underline",decoOffset:4}),go:blockBox({w:228.75,h:52,padding:[0,24,0,24],gap:[8,8],minHeight:52,radius:[999,999],bg:"ink",center:true,color:"surface"}),goText:blockText({size:17,weight:700,lineHeight:20.4,color:"surface",wrap:"auto"}),pressScale:.97,hoverFill:{color:"ink",share:.06,over:"surface"},chipOff:blockBox({w:97.422,h:26,padding:[0,10,0,6],gap:[4,4],minHeight:26,radius:[999,999],center:true,color:"ink"}),metaLink:blockText({size:16,weight:400,lineHeight:22.4,deco:"underline"}),narrow:{upTo:599,card:blockBox({w:560,h:247.391,padding:[16,16,16,16],gap:[24,16],radius:[20,20],bg:"surface",center:true}),sq:blockBox({w:64,h:64,radius:[14,14],bg:"#F3F3F3",shadow:{color:"#FFFFFF",x:0,y:0,blur:0,spread:3}}),sqOverlap:16},phone:{upTo:639,card:blockBox({w:335,h:120.984,gap:[12,8],center:true}),sq:blockBox({w:48,h:48,radius:[12,12],bg:"#F3F3F3"}),sqRing:2,sqOverlap:18,when:blockBox({w:215,h:46.797,gap:[12,2],center:true}),title:blockText({size:16,weight:700,lineHeight:20.8,tabular:true}),total:blockText({size:16,weight:900,lineHeight:20.8,tabular:true}),chip:blockBox({w:90.031,h:24,padding:[0,10,0,6],gap:[4,4],minHeight:24,radius:[999,999],bg:"tintGo",center:true,color:"ink"}),chipText:blockText({size:12,weight:700,lineHeight:15.6,color:"ink",tabular:true}),whatHidden:true,note:blockText({size:13,weight:400,lineHeight:18.2}),acts:blockBox({w:335,h:46,gap:[24,8],center:true}),plain:blockBox({w:144.531,h:46,padding:[0,16,0,16],gap:[8,8],minHeight:46,radius:[999,999],bg:"surface",edge:{width:1.5,color:"#C6D3CD",ring:true},center:true,color:"ink"}),plainText:blockText({size:15,weight:700,lineHeight:18,color:"ink"}),linkText:blockText({size:15,weight:700,lineHeight:18,color:"ink",deco:"underline",decoOffset:4})}},product:{card:blockBox({w:156,h:310.969,gap:[4,4]}),kicker:blockText({size:12,weight:400,lineHeight:15.6,color:"muted",tracking:.12,face:"mono"}),name:blockText({size:15,weight:700,lineHeight:19.5,wrap:"balance"}),meta:blockText({size:13,weight:400,lineHeight:18.2,color:"muted"}),buy:blockBox({w:156,h:36,marginTop:6,gap:[8,8],center:true}),price:blockText({size:15,weight:700,lineHeight:23.25,tabular:true})},productCard:{card:blockBox({w:174.5,h:249.219,gap:[2,2]}),tag:blockBox({w:84.563,h:26,padding:[0,9,0,6],gap:[4,4],minHeight:26,radius:[999,999],bg:"surface",center:true,x:8,y:8}),tagIcon:blockBox({w:16,h:16,color:"#CA4463"}),tagText:blockText({size:12,weight:700,lineHeight:12}),price:blockBox({w:174.5,h:26.344,gap:[6,6]}),priceText:blockText({size:17,weight:700,lineHeight:26.35,tracking:-.17,tabular:true}),was:blockText({size:13,weight:400,lineHeight:20.15,color:"muted",tabular:true,deco:"strike"}),name:blockText({size:14,weight:500,lineHeight:18.2,wrap:"balance"}),meta:blockText({size:12,weight:400,lineHeight:16.2,color:"muted"}),metaAuto:blockText({size:12,weight:500,lineHeight:16.2,color:"#16864A"}),step:blockBox({w:112,h:38,radius:[19,19],bg:"surface",center:true,x:54.5,y:128.5}),stepIn:blockBox({w:112,h:38,radius:[19,19],bg:"ink",center:true,color:"surface",x:54.5,y:128.5}),stepAt:{right:8,bottom:8},stepButton:blockBox({w:38,h:38,radius:[19,19],center:true}),stepIcon:blockBox({w:18,h:18}),count:blockText({size:15,weight:700,lineHeight:23.25,color:"surface",tabular:true}),lift:{color:"rgba(0, 0, 0, 0.14)",x:0,y:2,blur:8,spread:0},per:blockText({size:12,weight:400,lineHeight:16.2,color:"muted",tabular:true}),metaAutoDark:blockText({size:12,weight:500,lineHeight:16.2,color:"ink"}),pill:blockBox({w:62.234,h:36,padding:[0,14,0,14],gap:[4,4],minHeight:36,radius:[999,999],bg:"go",center:true,x:104.266,y:130.5}),pillText:blockText({size:14,weight:700,lineHeight:21.7}),pillOn:blockBox({w:90.016,h:36,padding:[0,14,0,14],gap:[4,4],minHeight:36,radius:[999,999],bg:"surface",edge:{width:2,color:"text",ring:true},center:true,x:76.484,y:130.5}),pillOnText:blockText({size:14,weight:700,lineHeight:21.7}),pillIcon:blockBox({w:16,h:16}),pillSoft:blockBox({w:80.125,h:36,padding:[0,14,0,14],gap:[4,4],minHeight:36,radius:[999,999],bg:"surface",shadow:{color:"rgba(0, 0, 0, 0.14)",x:0,y:2,blur:8,spread:0},center:true,x:86.375,y:130.5}),pillSoftText:blockText({size:14,weight:700,lineHeight:21.7}),pillAt:{right:8,bottom:8},pillPressScale:.96},productBlend:{img:blockBox({w:174.5,h:174.5,padding:[32,14,16,14],fit:"contain"}),imgBlend:"multiply",lift:{color:"rgba(0, 0, 0, 0.08)",x:0,y:2,blur:8,spread:0},pill:blockBox({w:62.234,h:36,padding:[0,14,0,14],gap:[4,4],minHeight:36,radius:[999,999],bg:"pink",edge:{width:1,color:"ink",ring:true},center:true,color:"ink",x:104.266,y:130.5}),pillText:blockText({size:14,weight:700,lineHeight:21.7,color:"ink"}),pillOn:blockBox({w:90.016,h:36,padding:[0,14,0,14],gap:[4,4],minHeight:36,radius:[999,999],bg:"surface",edge:{width:2,color:"ink",ring:true},center:true,color:"ink",x:76.484,y:130.5}),pillOnText:blockText({size:14,weight:700,lineHeight:21.7,color:"ink"}),pillPressScale:.97},productWeb:{card:blockBox({w:306.656,h:370.641,gap:[2,2]}),square:blockBox({w:306.656,h:306.656,marginBottom:10,radius:[20,20],bg:"#F5F5F5"}),imgInsetTag:{share:[.11,.11,.1,.11],px:[26,0,0,0]},imgInset:{share:[.07,.07,.07,.07],px:[0,0,0,0]},imgFit:"contain",imgBlend:"multiply",tag:blockBox({w:112.516,h:30,padding:[0,12,0,8],gap:[5,5],minHeight:30,radius:[999,999],bg:"#F7E3E8",center:true,color:"ink",x:10,y:10}),tagText:blockText({size:13,weight:700,lineHeight:14.3,color:"ink"}),tagIcon:blockBox({w:16,h:16,color:"#CA4463"}),tagMix:.15,name:blockText({size:17,weight:500,lineHeight:22.1,wrap:"balance"}),nameLeading:1.3,coverRadius:20,price:blockBox({w:306.656,h:27.891,gap:[8,2]}),priceText:blockText({size:18,weight:700,lineHeight:27.9,tracking:-.18,tabular:true}),was:blockText({size:15,weight:400,lineHeight:23.25,tabular:true,deco:"strike"}),per:blockText({size:15,weight:400,lineHeight:23.25,tabular:true}),badge:blockBox({w:32.625,h:22,padding:[0,8,0,8],radius:[999,999],bg:"#DEE4F1",edge:{width:1.5,color:"rgba(90, 96, 135, 0.45)",ring:true},center:true}),badgeText:blockText({size:13,weight:700,lineHeight:13,tabular:true}),meta:blockText({size:15,weight:400,lineHeight:21}),add:blockBox({w:44,h:44,radius:[22,22],bg:"surface",shadow:{color:"rgba(0, 0, 0, 0.14)",x:0,y:2,blur:8,spread:0},center:true}),addIcon:blockBox({w:20,h:20}),actAt:{right:10,bottom:10},step:blockBox({w:116,h:44,radius:[22,22],bg:"ink",center:true,color:"surface"}),stepButton:blockBox({w:44,h:44,radius:[22,22],center:true,color:"surface"}),stepIcon:blockBox({w:18,h:18,color:"surface"}),count:blockText({size:15,weight:700,lineHeight:23.25,color:"surface",tabular:true}),pill:blockBox({w:68.688,h:44,padding:[0,16,0,16],gap:[6,6],minHeight:44,radius:[999,999],bg:"ink",center:true,color:"surface"}),pillText:blockText({size:15,weight:700,lineHeight:15,color:"surface"}),pillOn:blockBox({w:101.016,h:44,padding:[0,16,0,16],gap:[6,6],minHeight:44,radius:[999,999],bg:"surface",edge:{width:2,color:"ink",ring:true},center:true,color:"ink"}),pillOnText:blockText({size:15,weight:700,lineHeight:15,color:"ink"}),pillIcon:blockBox({w:18,h:18,color:"ink"}),pillSoft:blockBox({w:87.859,h:44,padding:[0,16,0,16],gap:[6,6],minHeight:44,radius:[999,999],bg:"surface",shadow:{color:"rgba(0, 0, 0, 0.14)",x:0,y:2,blur:8,spread:0},center:true}),pillSoftText:blockText({size:15,weight:700,lineHeight:15}),nameSteps:[{upTo:599,name:blockText({size:16,weight:500,lineHeight:20.8,wrap:"balance"})},{upTo:399,name:blockText({size:14,weight:500,lineHeight:18.2,wrap:"balance"})}],addPressScale:.94,stepPressScale:.88,pillPressScale:.97,imgInsetEven:{share:[.07,.07,.07,.07],px:[0,0,0,0]},imgInsetWhite:{share:[.11,.11,.14,.11],px:[0,0,0,0]},groundWhite:"surface",focusOffset:3,hover:{ring:{width:1.5,share:.45,color:"ink"},underlineOffset:3}},productRow:{card:blockBox({shown:false,w:361,h:109.328,gap:[12,12],center:true}),name:blockText({shown:false,size:17,weight:700,lineHeight:22.1,color:"ink"}),meta:blockText({shown:false,size:13,weight:400,lineHeight:18.85,color:"muted",marginTop:2})},cart:{line:blockBox({w:361,h:109.328,gap:[12,12],center:true}),name:blockBox({w:289,h:24,gap:[8,4],center:true,color:"ink"}),nameText:blockText({size:17,weight:700,lineHeight:22.1,color:"ink"}),meta:blockText({size:13,weight:400,lineHeight:18.85,color:"muted",marginTop:2}),price:blockText({size:17,weight:700,lineHeight:26.35,color:"ink",tabular:true}),was:blockText({shown:false,size:13,weight:400,lineHeight:18.85,color:"muted",marginTop:2}),acts:blockBox({w:289,h:20.141,marginTop:6,gap:[16,16]}),remove:blockText({size:13,weight:700,lineHeight:20.15,color:"ink",deco:"underline",decoOffset:3}),removeBox:blockBox({w:53.016,h:20.141,color:"ink"}),end:blockBox({w:289,h:26.344,gap:[4,4]})},cartSquare:{line:blockBox({w:361,h:95.094,gap:[12,12]}),sm:blockBox({w:48,h:48,radius:[12,12],bg:"#F3F3F3"}),md:blockBox({w:52,h:52,radius:[12,12],bg:"#F3F3F3"}),lg:blockBox({w:56,h:56,radius:[12,12],bg:"#F3F3F3"}),imgInset:.1,imgFit:"contain",imgBlend:"multiply",name:blockBox({w:239.109,h:20,gap:[6,4],center:true}),nameText:blockText({size:15,weight:700,lineHeight:19.5}),link:blockText({size:15,weight:700,lineHeight:19.5}),linkReach:4,badge:blockBox({w:29.344,h:20,padding:[0,7,0,7],radius:[999,999],bg:"#E0E6F2",edge:{width:1.5,color:"rgba(90, 96, 135, 0.45)",ring:true},center:true}),badgeText:blockText({size:12,weight:700,lineHeight:12}),meta:blockText({size:13,weight:400,lineHeight:17.55,color:"muted",marginTop:2}),acts:blockBox({w:239.109,h:32,marginTop:6,gap:[16,16]}),act:blockText({size:13,weight:700,lineHeight:20.15,color:"ink",deco:"underline",decoOffset:3}),actBox:blockBox({w:84.531,h:32,minHeight:32,color:"ink"}),price:blockText({size:15,weight:700,lineHeight:23.25,tabular:true}),was:blockText({size:13,weight:400,lineHeight:20.15,color:"muted",tabular:true,deco:"strike"})},cartWeb:{line:blockBox({w:404,h:88,gap:[16,0],center:true}),sq:blockBox({w:88,h:88,radius:[14,14],bg:"#F3F3F3"}),imgInset:.1,imgFit:"contain",imgBlend:"multiply",name:blockBox({w:225.875,h:24.688,gap:[8,4],center:true}),nameText:blockText({size:19,weight:700,lineHeight:24.7}),link:blockText({size:19,weight:700,lineHeight:24.7}),linkReach:4,badge:blockBox({w:32.625,h:22,padding:[0,8,0,8],radius:[999,999],bg:"#DEE4F1",center:true}),badgeText:blockText({size:13,weight:700,lineHeight:13}),meta:blockText({size:15,weight:400,lineHeight:21,marginTop:2}),price:blockText({size:19,weight:700,lineHeight:29.45,tabular:true}),was:blockText({size:15,weight:400,lineHeight:23.25,tabular:true,deco:"strike"}),narrow:{upTo:599,sq:blockBox({w:64,h:64,radius:[14,14],bg:"#F3F3F3"}),cost:blockBox({w:432,h:29.438,marginTop:4,gap:[8,8]}),nameText:blockText({size:17,weight:700,lineHeight:22.1}),link:blockText({size:17,weight:700,lineHeight:22.1})},narrower:{upTo:330,sq:blockBox({w:56,h:56,radius:[14,14],bg:"#F3F3F3"}),cost:blockBox({w:216,h:29.438,marginTop:4,gap:[8,8]}),nameText:blockText({size:17,weight:700,lineHeight:22.1}),link:blockText({size:17,weight:700,lineHeight:22.1})},phone:{upTo:639,line:blockBox({w:303,h:81.25,gap:[12,0],center:true}),sq:blockBox({w:56,h:56,radius:[12,12],bg:"#F3F3F3"}),cost:blockBox({w:235,h:23.25,marginTop:2,gap:[8,8]}),nameText:blockText({size:15,weight:700,lineHeight:19.5}),link:blockText({size:15,weight:700,lineHeight:19.5}),meta:blockText({size:13,weight:400,lineHeight:17.55,marginTop:2}),price:blockText({size:15,weight:700,lineHeight:23.25,tabular:true}),was:blockText({size:13,weight:400,lineHeight:20.15,tabular:true,deco:"strike"}),smallUpTo:359,smallSq:48}},cartDrawer:{line:blockBox({w:360,h:147.094,gap:[14,0]}),img:blockBox({w:64,h:64,radius:[14,14],bg:"surface",edge:{width:1.5,color:"#C6D3CD",ring:true}}),imgInset:6,imgFit:"contain",name:blockBox({w:216,h:22.094,gap:[8,4],center:true}),nameText:blockText({size:17,weight:700,lineHeight:22.1,wrap:"auto"}),badge:blockBox({w:32.625,h:22,padding:[0,8,0,8],radius:[999,999],bg:"#DEE4F1",edge:{width:1.5,color:"rgba(90, 96, 135, 0.45)",ring:true},center:true}),badgeText:blockText({size:13,weight:700,lineHeight:13,wrap:"auto"}),meta:blockText({size:15,weight:400,lineHeight:21,marginTop:2}),note:blockText({size:15,weight:700,lineHeight:21,color:"ink",marginTop:2}),acts:blockBox({w:282,h:92,marginTop:10,gap:[12,8],center:true}),plan:blockBox({w:193.703,h:44,padding:[3,3,3,3],radius:[999,999],bg:"surface",edge:{width:1.5,color:"#C6D3CD",ring:true}}),planBtn:blockBox({w:63.859,h:38,padding:[0,14,0,14],minHeight:38,radius:[999,999]}),planText:blockText({size:15,weight:500,lineHeight:23.25,wrap:"auto"}),planOn:blockBox({w:123.844,h:38,padding:[0,14,0,14],minHeight:38,radius:[999,999],bg:"ink",color:"surface"}),planOnText:blockText({size:15,weight:700,lineHeight:23.25,color:"surface",wrap:"auto"}),qty:blockBox({w:104,h:40,radius:[999,999],bg:"surface",edge:{width:1.5,color:"#C6D3CD",ring:true},center:true}),countMin:24,qtyBtn:blockBox({w:40,h:40,radius:[20,20],center:true}),qtyIcon:blockBox({w:16,h:16}),count:blockText({size:15,weight:700,lineHeight:23.25,wrap:"auto",tabular:true}),remove:blockBox({w:58.359,h:40,minHeight:40,color:"ink"}),removeText:blockText({size:15,weight:700,lineHeight:23.25,color:"ink",wrap:"auto",deco:"underline",decoOffset:3}),price:blockText({size:17,weight:700,lineHeight:22.1,wrap:"auto",tabular:true}),was:blockText({size:15,weight:400,lineHeight:19.5,wrap:"auto",tabular:true,deco:"strike"}),pressScale:.9,hover:{color:"ink",share:.06,over:"surface"},motion:{press:140,fill:150,planFill:150}},price:{note:blockText({size:13,weight:400,lineHeight:19.5,color:"muted",marginTop:12}),noteStrong:blockText({size:13,weight:700,lineHeight:19.5,color:"muted"})},priceWeb:{rows:blockBox({w:536,h:166.625,gap:[10,10]}),row:blockBox({w:536,h:26.344,gap:[16,16]}),term:blockText({size:17,weight:400,lineHeight:26.35,wrap:"balance"}),value:blockText({size:17,weight:700,lineHeight:26.35,tabular:true}),off:blockText({size:17,weight:700,lineHeight:26.35,color:"ink",wrap:"balance"}),total:blockBox({w:536,h:49.594,marginTop:8,gap:[16,16]}),totalTerm:blockText({size:20,weight:700,lineHeight:31,wrap:"balance"}),totalValue:blockText({size:32,weight:700,lineHeight:49.6,tracking:-.64,tabular:true}),note:blockText({size:15,weight:400,lineHeight:22.5,marginTop:16}),noteStrong:blockText({size:15,weight:700,lineHeight:22.5,color:"ink"}),phone:{upTo:639,rows:blockBox({w:239,h:145.141,gap:[8,8]}),term:blockText({size:15,weight:400,lineHeight:23.25,wrap:"balance"}),value:blockText({size:15,weight:700,lineHeight:23.25,tabular:true}),totalTerm:blockText({size:18,weight:700,lineHeight:27.9,wrap:"balance"}),totalValue:blockText({size:28,weight:700,lineHeight:43.4,tracking:-.56,tabular:true}),note:blockText({size:15,weight:400,lineHeight:22.5,marginTop:12})},drawer:{rows:blockBox({w:360,h:154.219,marginTop:32,gap:[10,10]}),term:blockText({size:17,weight:400,lineHeight:26.35,wrap:"balance"}),value:blockText({size:17,weight:700,lineHeight:26.35,tabular:true}),totalTerm:blockText({size:20,weight:700,lineHeight:31,wrap:"balance"}),totalValue:blockText({size:24,weight:700,lineHeight:37.2,tabular:true}),note:blockText({size:15,weight:400,lineHeight:22.5,marginTop:12})}},need:{card:blockBox({w:325,h:125.25,padding:[14,16,14,16],radius:[0,20],bg:"surface",shadow:{color:"rgba(0, 0, 0, 0.06)",x:0,y:2,blur:3,spread:-1}}),kicker:blockBox({w:293,h:24,gap:[8,8],center:true}),kickerText:blockText({size:15,weight:700,lineHeight:23.25}),source:blockBox({w:116.719,h:24,padding:[0,9,0,9],radius:[999,999],bg:"#DAF6E8",center:true,color:"ink"}),sourceText:blockText({size:12,weight:700,lineHeight:18.6,color:"ink"}),title:blockText({shown:false,size:15,weight:700,lineHeight:23.25}),signal:blockBox({w:293,h:65.25,marginTop:8,gap:[9,9],color:"#4D4D4D"}),signalText:blockText({size:15,weight:400,lineHeight:21.75,color:"#4D4D4D"}),signalLead:blockText({size:15,weight:700,lineHeight:21.75}),dot:blockBox({w:9,h:9,radius:[4.5,4.5],bg:"alert",color:"#4D4D4D",dy:-1}),score:blockBox({w:293,h:99.859,padding:[10,14,10,14],marginTop:12,gap:[12,12],radius:[10,10],bg:"#FCF0D6",center:true}),scoreLabel:blockText({size:14,weight:600,lineHeight:18.9,color:"#4D4D4D"}),scoreTag:blockBox({w:63.125,h:20.188,padding:[2,6,2,6],marginTop:3,radius:[6,6],bg:"surface"}),scoreTagText:blockText({size:12,weight:600,lineHeight:16.2,tracking:.72,face:"mono",upper:true,marginTop:3,paddingTop:2}),scoreNums:blockBox({w:106.109,h:51.141,gap:[6,0],center:true}),scoreWas:blockText({size:17,weight:700,lineHeight:26.35,color:"muted",deco:"strike",decoThickness:1.5}),scoreArrow:blockBox({w:16,h:16,color:"muted"}),scoreArrowFlip:true,scoreNow:blockText({size:28,weight:700,lineHeight:28,tracking:-.84,tabular:true}),scoreOf:blockText({size:15,weight:700,lineHeight:15,color:"#4D4D4D",tabular:true}),scoreSince:blockText({size:13,weight:700,lineHeight:20.15,color:"ink",marginTop:3})},needPlan:{card:blockBox({w:329,h:380.172,padding:[16,16,16,16],marginTop:14,radius:[22,22],bg:"surface",shadow:{color:"rgba(38, 37, 35, 0.06)",x:0,y:1,blur:3,spread:0},color:"#262523"}),kicker:blockBox({w:297,h:24,gap:[8,8],center:true,color:"#262523"}),kickerText:blockText({size:15,weight:800,lineHeight:22.5,color:"#262523"}),source:blockBox({w:83.375,h:24,padding:[0,9,0,9],radius:[999,999],bg:"#F2F1EE",center:true,color:"#4A4845"}),sourceText:blockText({size:12,weight:700,lineHeight:18,color:"#4A4845"}),title:blockText({size:19,weight:800,lineHeight:23.18,color:"#262523",marginTop:12}),signal:blockBox({w:297,h:65.25,marginTop:6,gap:[9,9],color:"#4A4845"}),signalText:blockText({size:15,weight:400,lineHeight:21.75,color:"#4A4845"}),signalLead:blockText({size:15,weight:800,lineHeight:21.75,color:"#262523"}),dot:blockBox({w:9,h:9,radius:[4.5,4.5],bg:"#E5372B",color:"#4A4845",dy:-1}),score:blockBox({w:297,h:69.75,padding:[10,14,10,14],marginTop:12,gap:[12,12],radius:[14,14],bg:"planAccentWash",center:true,color:"#262523"}),scoreLabel:blockText({size:13.5,weight:600,lineHeight:18.225,color:"#4A4845",wrap:"balance"}),scoreTag:blockBox({w:51.609,h:17.5,padding:[2,6,2,6],marginTop:3,radius:[5,5],bg:"surface",color:"#262523"}),scoreTagText:blockText({size:10,weight:600,lineHeight:13.5,color:"#262523",tracking:.6,face:"mono",upper:true,wrap:"balance",marginTop:3,paddingTop:2}),scoreNums:blockBox({w:94.75,h:49.75,gap:[6,0],center:true,color:"#262523"}),scoreWas:blockText({size:17,weight:700,lineHeight:25.5,color:"#6B6863",deco:"strike"}),scoreArrow:blockBox({w:16,h:16,color:"#6B6863"}),scoreArrowFlip:true,scoreNow:blockText({size:28,weight:800,lineHeight:28,color:"#262523"}),scoreOf:blockText({size:13,weight:800,lineHeight:13,color:"muted"}),scoreSince:blockText({size:12.5,weight:700,lineHeight:18.75,color:"planLink",marginTop:3}),sources:blockBox({w:131.375,h:24,gap:[4,4],color:"#262523"}),sourceDna:blockBox({w:44,h:24,padding:[0,9,0,9],radius:[999,999],bg:"planLinkWash",center:true,color:"planLink"}),sourceDnaText:blockText({size:12,weight:700,lineHeight:18,color:"planLink"}),dotWatch:blockBox({w:9,h:9,radius:[4.5,4.5],bg:"#E5A000",color:"#4A4845",dy:-1}),dotClear:blockBox({w:9,h:9,radius:[4.5,4.5],bg:"#5FA82B",color:"#4A4845",dy:-1}),scoreLabelMax:135,says:blockBox({w:297,h:52,padding:[10,12,10,12],marginTop:12,gap:[10,10],radius:[14,14],bg:"#F8F7F4",color:"#262523"}),saysImg:blockBox({w:32,h:32,radius:[16,16],color:"#262523"}),saysText:blockText({size:14.5,weight:400,lineHeight:20.3,color:"#4A4845"}),saysBy:blockText({size:14.5,weight:800,lineHeight:20.3,color:"#262523"}),saysByGap:2,saysTag:blockBox({w:51.609,h:15,padding:[2,6,2,6],radius:[5,5],bg:"surface",color:"#262523"}),saysTagText:blockText({size:10,weight:400,lineHeight:14,color:"#262523",tracking:.6,face:"mono",upper:true,paddingTop:2}),saysBare:blockBox({w:297,h:81,padding:[10,12,10,12],marginTop:12,gap:[10,10],radius:[14,14],bg:"#F8F7F4",color:"#262523"}),saysKicker:blockText({size:17,weight:400,lineHeight:25.5,color:"#262523"}),saysSerif:blockText({size:17,weight:800,lineHeight:25.5,color:"#262523",tracking:-.17,wrap:"balance"}),jump:blockBox({w:297,h:60,padding:[8,14,8,8],marginTop:12,gap:[12,12],radius:[14,14],bg:"planInk",center:true,color:"planOnInk"}),jumpImg:blockBox({w:44,h:44,radius:[10,10],bg:"surface",color:"surface"}),jumpKicker:blockText({size:13,weight:800,lineHeight:19.5,color:"planAccent"}),jumpTitle:blockText({size:15,weight:800,lineHeight:18.75,color:"planOnInk"}),jumpGo:blockText({size:14,weight:800,lineHeight:21,color:"planOnInk"}),jumpPressScale:.98,more:blockBox({w:87.547,h:36,marginTop:6,marginBottom:-4,gap:[4,4],minHeight:36,center:true,color:"planLink"}),moreText:blockText({size:15,weight:800,lineHeight:22.5,color:"planLink"}),moreIcon:blockBox({w:16,h:16,color:"planLink"}),moreInset:16,moreTurn:{closed:90,open:-90},rep:blockBox({w:297,h:48.5,padding:[14,14,12,14],marginTop:10,radius:[16,16],bg:"#F8F7F4",color:"#262523"})},tip:{card:blockBox({w:201.5,h:275.031,padding:[8,10,10,10],radius:[20,20],bg:"#FCF0D6"}),tones:{y:"#FCF0D6",c:"tintBlue",g:"tintGo",r:"tintPink"},img:blockBox({w:181.5,h:113.438,radius:[10,10],bg:"#F3F3F3"}),n:blockBox({w:28,h:28,radius:[14,14],bg:"surface",center:true,x:8,y:8}),nText:blockText({size:14,weight:700,lineHeight:14}),title:blockText({size:16,weight:700,lineHeight:20,marginTop:10}),text:blockText({size:15,weight:400,lineHeight:21,color:"#4D4D4D",marginTop:4}),foot:blockBox({w:181.5,h:26.594,padding:[8,0,0,0],gap:[4,4],center:true,color:"ink"}),footText:blockText({size:12,weight:400,lineHeight:18.6,color:"ink",tracking:.48,face:"mono",upper:true,paddingTop:8}),footArrow:blockBox({w:14,h:14,color:"ink"}),footArrowFlip:true,pressScale:.98,bare:blockBox({w:181.5,h:42,padding:[2,0,0,0],center:true}),thumb:blockBox({w:40,h:40,radius:[10,10],bg:"surface",center:true}),thumbIcon:blockBox({w:22,h:22})},tipPhoto:{card:blockBox({w:221,h:152,padding:[8,8,12,8],radius:[20,20],bg:"#FCF0D6"}),tones:{y:"#FCF0D6",c:"#EEDCC8",g:"tintGo",r:"tintPink"},img:blockBox({w:205,h:102.5,radius:[10,10],bg:"#F3F3F3"}),imgAspect:2,n:blockBox({w:28,h:28,radius:[14,14],bg:"surface",center:true,x:8,y:8}),nText:blockText({size:14,weight:700,lineHeight:14}),title:blockText({size:15,weight:700,lineHeight:19.5,marginTop:10}),titleInset:4,pressScale:.98,bare:blockBox({w:205,h:42,padding:[2,0,0,0],center:true}),thumb:blockBox({w:40,h:40,radius:[10,10],bg:"surface",center:true}),thumbIcon:blockBox({w:22,h:22,color:"ink"})},tipWeb:{card:blockBox({w:226,h:172.047,gap:[10,10]}),img:blockBox({w:226,h:141.25,radius:[14,14]}),imgAspect:1.6,title:blockText({size:16,weight:700,lineHeight:20.8,wrap:"balance"}),coverRadius:10,row:{from:440,card:blockBox({w:400,h:80,padding:[6,0,6,0],gap:[10,10],minHeight:80,center:true}),img:blockBox({w:64,h:64,radius:[10,10]}),arrowColumn:18,arrow:blockBox({w:18,h:18,color:"ink"}),arrowTurn:180},phone:{upTo:639,card:blockBox({w:216,h:162.5,gap:[8,8]}),img:blockBox({w:216,h:135,radius:[14,14]}),imgAspect:1.6,title:blockText({size:15,weight:700,lineHeight:19.5,wrap:"balance"}),smallUpTo:359,smallW:208},mark:{tile:blockBox({w:226,h:141.25,radius:[14,14],bg:"#F5F5F5",center:true,color:"ink"}),icon:{share:.36,min:16,max:40,color:"ink"}},ring:{width:2,offset:2,color:"text"},hoverOffset:3},tipPlan:{card:blockBox({w:225.406,h:182.844,padding:[14,14,12,14],radius:[18,18],bg:"planAccentChip",color:"#262523"}),tones:{y:"planAccentChip",c:"planLinkChip",g:"#DDEFC4",r:"#FFD8D6"},top:blockBox({w:197.406,h:30,center:true,color:"#262523"}),nText:blockText({size:30,weight:900,lineHeight:30,color:"#262523"}),icon:blockBox({w:26,h:26,color:"#262523"}),title:blockText({size:17,weight:800,lineHeight:21.25,color:"#262523",marginTop:14}),text:blockText({size:14.5,weight:400,lineHeight:20.3,color:"#4A4845",marginTop:4}),foot:blockBox({w:197.406,h:25.75,padding:[10,0,0,0],color:"planLink"}),footText:blockText({size:10.5,weight:400,lineHeight:15.75,color:"planLink",tracking:.42,face:"mono",upper:true,paddingTop:10})},cartPlan:{line:blockBox({w:297,h:95.625,gap:[12,12],color:"#262523"}),img:blockBox({w:64,h:64,radius:[14,14],bg:"planLinkWash",center:true,color:"planLink"}),icon:blockBox({w:28,h:28,color:"planLink"}),name:blockText({size:16.5,weight:800,lineHeight:20.625,color:"#262523",wrap:"balance"}),prices:blockBox({w:221,h:24,marginTop:3,gap:[8,2],center:true,color:"#262523"}),price:blockText({size:16,weight:800,lineHeight:24,color:"#262523",tabular:true}),was:blockText({size:14,weight:600,lineHeight:21,color:"#6B6863",deco:"strike"}),small:blockText({size:14,weight:400,lineHeight:21,color:"#6B6863"}),acts:blockBox({w:221,h:40,marginTop:8,gap:[16,16],center:true,color:"#262523"}),step:blockBox({w:110,h:40,radius:[999,999],bg:"surface",edge:{width:1.5,color:"#DAD7D1",ring:true},center:true,color:"#262523"}),remove:blockBox({w:56.422,h:40,minHeight:40,color:"#4A4845"}),removeText:blockText({size:14.5,weight:700,lineHeight:21.75,color:"#4A4845",deco:"underline",decoOffset:3,decoThickness:1.5})},cartBar:{bar:blockBox({w:361,h:66,padding:[8,8,8,10],gap:[10,10],minHeight:60,radius:[22,22],bg:"surface",shadow:{color:"rgba(0, 0, 0, 0.06)",x:0,y:1,blur:3,spread:0},center:true,x:16}),lift:{color:"rgba(0, 0, 0, 0.09)",x:0,y:10,blur:28,spread:0},thumbs:blockBox({w:88,h:44,padding:[0,4,0,0],center:true}),thumb:blockBox({w:40,h:40,radius:[12,12],bg:"#F3F3F3"}),thumbRing:2,thumbOverlap:18,imgInset:4,imgFit:"contain",imgBlend:"multiply",count:blockBox({w:20,h:20,padding:[0,5,0,5],radius:[10,10],bg:"text",center:true,color:"surface",x:72,y:-4}),countText:blockText({size:12,weight:700,lineHeight:12,color:"surface",tabular:true}),countAt:{top:-4,right:-4},sum:blockBox({w:130.656,h:35.688,gap:[2,2]}),total:blockText({size:17,weight:700,lineHeight:18.7,tracking:-.17,tabular:true}),sub:blockText({size:12,weight:400,lineHeight:15,color:"muted"}),go:blockBox({w:104.344,h:50,padding:[0,18,0,18],gap:[6,6],minHeight:50,radius:[999,999],bg:"pink",edge:{width:1,color:"ink",ring:true},center:true,color:"ink"}),goText:blockText({size:15,weight:700,lineHeight:23.25,color:"ink"}),pressScale:.97,hover:{color:"pink",share:.9,over:"text"},motion:{rise:{duration:240,from:24,fade:false},bump:{duration:240,scale:1.12,peakAt:.5,curve:"ease-out"}}},cartBarWeb:{bar:blockBox({w:600,h:68,padding:[10,10,10,14],gap:[14,14],minHeight:68,radius:[26,26],bg:"surface",shadow:{color:"rgba(0, 0, 0, 0.06)",x:0,y:1,blur:3,spread:0},center:true}),lift:{color:"rgba(0, 0, 0, 0.09)",x:0,y:10,blur:28,spread:0},thumbs:blockBox({w:102,h:44,padding:[0,6,0,0],center:true}),thumb:blockBox({w:44,h:44,padding:[4,4,4,4],radius:[12,12],bg:"surface",shadow:{color:"rgba(0, 0, 0, 0.14)",x:0,y:1,blur:3,spread:0},fit:"contain"}),thumbRing:2,thumbOverlap:18,imgInset:4,imgFit:"contain",imgBlend:"normal",count:blockBox({w:22,h:22,padding:[0,6,0,6],radius:[11,11],bg:"go",center:true,x:83,y:-5}),countText:blockText({size:12,weight:700,lineHeight:12,wrap:"auto",tabular:true}),countAt:{top:-5,right:-3},sum:blockBox({w:307.484,h:43.5,gap:[2,2]}),total:blockText({size:20,weight:700,lineHeight:22,color:"ink",tracking:-.2,tabular:true}),sub:blockText({size:15,weight:400,lineHeight:19.5}),go:blockBox({w:138.516,h:48,padding:[0,22,0,22],minHeight:48,radius:[999,999],bg:"ink",color:"surface"}),goText:blockText({size:17,weight:700,lineHeight:26.35,color:"surface",wrap:"auto"}),pressScale:.97,hover:{color:"ink",share:.86,over:"text"},motion:{rise:{duration:260,from:24,fade:true},bump:{duration:240,scale:1.1,peakAt:.5,curve:"out"}},phone:{upTo:559,bar:blockBox({w:335,h:79,padding:[8,8,8,10],gap:[10,10],minHeight:64,radius:[22,22],bg:"surface",center:true}),thumb:blockBox({w:40,h:40,padding:[4,4,4,4],radius:[12,12],bg:"surface",shadow:{color:"#FFFFFF",x:0,y:0,blur:0,spread:2},fit:"contain"}),go:blockBox({w:94.594,h:48,padding:[0,18,0,18],minHeight:48,radius:[999,999],bg:"ink",color:"surface"}),lastOnly:true,wordHidden:true}},why:{card:blockBox({w:393,h:655.609}),head:blockBox({w:393,h:126.328,padding:[4,16,12,16],gap:[12,12]}),pic:blockBox({w:64,h:64,radius:[10,10],bg:"#F3F3F3"}),packInset:.08,kind:blockText({size:12,weight:700,lineHeight:18.6,color:"ink",tracking:.72,face:"mono",upper:true}),title:blockText({size:22,weight:700,lineHeight:24.64,tracking:-.55,marginTop:2}),sub:blockText({size:14,weight:400,lineHeight:18.9,color:"#4D4D4D",marginTop:3}),close:blockBox({w:36,h:36,padding:[1,6,1,6],radius:[18,18],center:true,color:"ink"}),closeIcon:blockBox({w:20,h:20,color:"ink"}),body:blockBox({w:393,h:529.281,padding:[0,16,24,16],gap:[12,12]}),box:blockBox({w:361,h:169.281,padding:[14,14,14,14],radius:[20,20],bg:"tintPink"}),heading:blockText({size:17,weight:700,lineHeight:21.25}),rows:blockBox({w:333,h:110.031,marginTop:10,gap:[10,10]}),row:blockText({size:15,weight:400,lineHeight:21.75}),rowHead:blockText({size:12,weight:400,lineHeight:17.4,color:"ink",tracking:.48,face:"mono",upper:true}),secHeading:blockText({size:17,weight:700,lineHeight:21.25}),how:blockBox({w:361,h:49.5,marginTop:8,gap:[6,6]}),bullet:blockBox({w:361,h:21.75,gap:[8,8],color:"#4D4D4D"}),bulletText:blockText({size:15,weight:400,lineHeight:21.75,color:"#4D4D4D"}),bulletColumn:14,dot:{size:6,top:9,color:"ink"},para:blockText({size:15,weight:400,lineHeight:22.5,color:"#4D4D4D",marginTop:6}),acts:blockBox({w:361,h:98,gap:[2,2]}),btn:blockBox({w:361,h:52,padding:[0,20,0,20],gap:[8,8],minHeight:52,radius:[999,999],bg:"ink",center:true,color:"surface"}),btnText:blockText({size:16,weight:700,lineHeight:24.8,color:"surface"}),more:blockBox({w:164.891,h:44,padding:[0,12,0,12],minHeight:44,center:true,color:"ink"}),moreText:blockText({size:15,weight:700,lineHeight:23.25,color:"ink",deco:"underline",decoOffset:3,decoThickness:1.5}),tones:{calm:"tintBlue",y:"#FCF0D6",c:"#EEDCC8",g:"tintGo",r:"tintPink"},photoBg:"#F3F3F3",closeHover:"tintSage",pressScale:.97,hover:{color:"ink",share:.88,over:"surface"}},whyWeb:{card:blockBox({w:558,h:571.375}),head:blockBox({w:558,h:105.375,padding:[24,24,12,24],gap:[12,12]}),pic:blockBox({w:64,h:64,radius:[10,10],bg:"#F5F5F5"}),packInset:.08,kind:blockText({size:15,weight:700,lineHeight:19.5,color:"ink"}),title:blockText({size:22,weight:500,lineHeight:24.64,color:"ink",tracking:-.44,marginTop:2}),sub:blockText({size:15,weight:400,lineHeight:20.25,marginTop:3}),close:blockBox({w:40,h:40,padding:[1,6,1,6],radius:[20,20],center:true}),closeIcon:blockBox({w:20,h:20}),body:blockBox({w:558,h:466,padding:[0,24,24,24],gap:[22,22]}),box:blockBox({w:510,h:129}),heading:blockText({size:16,weight:700,lineHeight:20}),rows:blockBox({w:510,h:99,marginTop:10,gap:[12,12]}),row:blockText({size:15,weight:400,lineHeight:21.75}),rowHead:blockText({size:15,weight:700,lineHeight:21.75,color:"ink"}),secHeading:blockText({size:16,weight:700,lineHeight:20}),how:blockBox({w:510,h:49.5,marginTop:8,gap:[6,6]}),bullet:blockBox({w:510,h:21.75,gap:[8,8]}),bulletText:blockText({size:15,weight:400,lineHeight:21.75}),bulletColumn:14,dot:{size:6,top:9.75,color:"ink"},para:blockText({size:15,weight:400,lineHeight:22.5,marginTop:6}),acts:blockBox({w:510,h:92,gap:[2,2]}),btn:blockBox({w:510,h:46,padding:[0,20,0,20],gap:[8,8],minHeight:46,radius:[999,999],bg:"ink",center:true,color:"surface"}),btnText:blockText({size:17,weight:400,lineHeight:26.35,color:"surface",wrap:"auto"}),more:blockBox({w:164.891,h:44,padding:[0,12,0,12],minHeight:44,center:true,color:"ink"}),moreText:blockText({size:15,weight:700,lineHeight:23.25,color:"ink",wrap:"auto",deco:"underline",decoOffset:3,decoThickness:1.5}),photoBg:"surface",closeHover:"none",pressScale:.97,hover:{color:"ink",share:.88,over:"surface"},phone:{upTo:419,head:blockBox({w:341,h:145.031,padding:[24,24,12,24],gap:[10,10]}),pic:blockBox({w:48,h:48,radius:[10,10],bg:"#F5F5F5"}),title:blockText({size:20,weight:500,lineHeight:22.4,color:"ink",tracking:-.4,marginTop:2})}},whyPlan:{card:blockBox({w:329,h:323.109,padding:[12,14,12,14],radius:[16,16],edge:{width:1.5,color:"#262523",ring:true},color:"#262523"}),heading:blockText({size:10.5,weight:400,lineHeight:15.75,color:"#6B6863",tracking:.63,face:"mono",upper:true}),row:blockBox({w:301,h:59.688,marginTop:10,gap:[10,10],color:"#262523"}),chipColumn:58,chips:{dna:{box:blockBox({w:58,h:22,radius:[6,6],bg:"planLinkWash",center:true,color:"planLink"}),text:blockText({size:10.5,weight:700,lineHeight:15.75,color:"planLink",tracking:.42,face:"mono",upper:true})},record:{box:blockBox({w:58,h:22,radius:[6,6],bg:"#F2F1EE",center:true,color:"#4A4845"}),text:blockText({size:10.5,weight:700,lineHeight:15.75,color:"#4A4845",tracking:.42,face:"mono",upper:true})},ask:{box:blockBox({w:58,h:22,radius:[6,6],bg:"planAccentWash",center:true,color:"#262523"}),text:blockText({size:10.5,weight:700,lineHeight:15.75,color:"#262523",tracking:.42,face:"mono",upper:true})}},rowTitle:blockText({size:15,weight:800,lineHeight:19.5,color:"#262523"}),rowBody:blockText({size:14,weight:400,lineHeight:19.6,color:"#4A4845",marginTop:1}),score:blockBox({w:301,h:42.797,padding:[11,12,11,14],marginTop:12,gap:[8,8],radius:[12,12],bg:"planInk",center:true,color:"planOnInk"}),scoreText:blockText({size:14.5,weight:800,lineHeight:18.85,color:"planOnInk"}),scoreValue:blockText({size:16,weight:700,lineHeight:20.8,color:"planAccent",face:"mono"})},lights:{card:blockBox({w:325,h:134,marginTop:14}),head:blockBox({w:325,h:24,marginBottom:10,gap:[12,12],center:true}),lead:blockText({size:14,weight:400,lineHeight:18.2,color:"#3D3D3D"}),name:blockText({size:14,weight:700,lineHeight:18.2,color:"ink"}),pills:{better:{box:blockBox({w:66.094,h:24,padding:[0,10,0,10],minHeight:24,radius:[999,999],bg:"#D7F5E7",center:true,color:"ink"}),text:blockText({size:12,weight:700,lineHeight:12,color:"ink",tracking:.48,face:"mono"})},same:{box:blockBox({w:50.734,h:24,padding:[0,10,0,10],minHeight:24,radius:[999,999],bg:"#FBEED0",center:true,color:"ink"}),text:blockText({size:12,weight:700,lineHeight:12,color:"ink",tracking:.48,face:"mono"})},worse:{box:blockBox({w:58.406,h:24,padding:[0,10,0,10],minHeight:24,radius:[999,999],bg:"#F6EBDE",center:true,color:"#834D0D"}),text:blockText({size:12,weight:700,lineHeight:12,color:"#834D0D",tracking:.48,face:"mono"})}},viz:blockBox({w:325,h:56}),grid:{rows:10,gap:1.5,radius:1.5,widthShare:.6},zones:{lot:6.5,some:3.5},colors:{go:"go",some:"#E4BA55",lot:"#BC6E13"},src:blockBox({w:325,h:44,gap:[16,0],center:true}),srcBtn:blockBox({w:181.5,h:44,gap:[6,6],minHeight:44,center:true,color:"#4D4D4D"}),srcText:blockText({size:14,weight:400,lineHeight:21.7,color:"#4D4D4D"}),srcIcon:blockBox({w:16,h:16,color:"#5A6087"}),act:blockBox({w:221.172,h:44,padding:[0,20,0,20],marginTop:6,marginBottom:14,minHeight:44,radius:[999,999],bg:"surface",edge:{width:1.5,color:"ink",ring:true},center:true,color:"ink"}),actText:blockText({size:15,weight:700,lineHeight:23.25,color:"ink",marginTop:6})},checkin:{card:blockBox({w:393,h:179.25}),body:blockBox({w:393,h:99.25,padding:[0,16,24,16],gap:[24,24]}),question:blockText({size:17,weight:700,lineHeight:21.25}),picks:blockBox({w:361,h:96,marginTop:10,gap:[8,8]}),pick:blockBox({w:115,h:44,padding:[4,4,4,4],gap:[6,6],minHeight:44,radius:[999,999],bg:"surface",edge:{width:1,color:"ink",ring:false},center:true,color:"ink"}),pickText:blockText({size:15,weight:400,lineHeight:18,color:"ink",wrap:"balance",paddingTop:4}),pickOn:blockBox({w:115,h:44,padding:[4,4,4,4],gap:[6,6],minHeight:44,radius:[999,999],bg:"pink",edge:{width:1,color:"pink",ring:false},center:true,color:"ink"}),pickOnText:blockText({size:15,weight:700,lineHeight:18,color:"ink",wrap:"balance",paddingTop:4}),pickHover:{color:"pink",share:.3,over:"surface"},stepTop:16,row:blockBox({w:361,h:44,gap:[8,8],minHeight:44,center:true}),rowLabel:blockText({size:15,weight:400,lineHeight:18.75}),rowValue:blockText({size:15,weight:700,lineHeight:18.75}),rowIcon:blockBox({w:18,h:18,color:"ink"}),rowTurn:90,rowPressScale:.98,note:blockBox({w:361,h:60.594,padding:[10,12,10,12],marginTop:12,radius:[10,10],bg:"#FFE8E6"}),noteText:blockText({size:14,weight:400,lineHeight:20.3,marginTop:12,paddingTop:10}),noteLink:blockText({size:14,weight:700,lineHeight:20.3,deco:"underline",decoOffset:3}),done:blockText({size:15,weight:400,lineHeight:21,wrap:"balance",marginTop:12}),acts:blockBox({w:361,h:52,gap:[2,2]}),btn:blockBox({w:361,h:52,padding:[0,20,0,20],gap:[8,8],minHeight:52,radius:[999,999],bg:"ink",center:true,color:"surface"}),btnText:blockText({size:16,weight:700,lineHeight:24.8,color:"surface"})},weather:{card:blockBox({w:361,h:321.734,padding:[16,16,16,16],gap:[16,16],radius:[20,20],bg:"#FCF4E0"}),skies:{sun:"#FCF4E0",blue:"tintBlue"},now:blockBox({w:329,h:113.891,gap:[12,12],center:true}),temp:blockText({size:64,weight:700,lineHeight:60.8,color:"ink",tracking:-2.56,tabular:true}),cond:blockText({size:17,weight:700,lineHeight:22.1,color:"ink",marginTop:8}),hl:blockText({size:15,weight:400,lineHeight:21,tabular:true,marginTop:2}),glyph:blockBox({w:88,h:88}),walk:blockBox({w:329,h:159.844,padding:[12,16,12,16],gap:[4,4],radius:[10,10],bg:"surface"}),walkTitle:blockBox({w:297,h:22.094,gap:[8,8],center:true,color:"ink"}),walkTitleText:blockText({size:17,weight:700,lineHeight:22.1,color:"ink"}),walkText:blockText({size:15,weight:400,lineHeight:21.75}),lvl:blockBox({w:10,h:10,radius:[5,5],bg:"#77DDAC",color:"ink"}),levels:{good:"#77DDAC",ok:"#F4CF7A",hot:"#DC8F7C",storm:"#8DA4BB"},comfort:blockBox({w:297,h:32.5,padding:[12,0,0,0],marginTop:8,gap:[8,6],center:true}),comfortRule:{width:1,color:"line"},comfortLabel:blockText({size:13,weight:400,lineHeight:16.9,color:"muted"}),comfortValue:blockText({size:15,weight:700,lineHeight:19.5,color:"ink"}),bar:blockBox({w:82,h:8,gap:[3,3]}),pipOn:blockBox({w:14,h:8,radius:[2,2],bg:"#77DDAC"}),pipOff:blockBox({w:14,h:8,radius:[2,2],bg:"#F1F5F2"})},weatherSummary:{card:blockBox({w:361,h:265.484,padding:[24,16,24,16],radius:[20,20],bg:"#FCF4E0"}),glyph:blockBox({w:88,h:88}),temp:blockText({size:72,weight:700,lineHeight:68.4,color:"ink",tracking:-2.88,tabular:true,marginTop:8}),cond:blockText({size:17,weight:700,lineHeight:22.1,color:"ink",marginTop:8}),hl:blockText({size:15,weight:400,lineHeight:21,tabular:true,marginTop:2})},weatherTile:{card:blockBox({w:272,h:187.984,padding:[16,16,16,16],gap:[8,8],radius:[20,20],bg:"#F5F5F5"}),top:blockBox({w:240,h:24,gap:[8,8],center:true}),label:blockText({size:12,weight:700,lineHeight:15.6,color:"ink",tracking:.72,face:"mono",upper:true}),glyph:blockBox({w:36,h:36,marginTop:-6,marginBottom:-6}),glyphMargin:[-6,-4,-6,0],big:blockText({size:28,weight:700,lineHeight:30.8,color:"ink",tracking:-.56,tabular:true}),small:blockText({size:15,weight:700,lineHeight:16.5,color:"muted",tabular:true}),smallGap:4,meta:blockText({size:14,weight:400,lineHeight:19.6}),btn:blockBox({w:137.375,h:38,padding:[0,12,0,12],gap:[8,8],minHeight:38,radius:[999,999],bg:"ink",edge:{width:1.5,color:"ink",ring:false},center:true,color:"surface"}),btnText:blockText({size:15,weight:700,lineHeight:15,color:"surface"}),btnIcon:blockBox({w:20,h:20,color:"surface"})},weatherWeb:{card:blockBox({w:533.078,h:242,padding:[24,24,24,24],radius:[20,20],bg:"surface",edge:{width:1,color:"line",ring:false}}),head:blockBox({w:483.078,h:34,marginBottom:16,gap:[12,12],center:true}),city:blockText({size:24,weight:700,lineHeight:28.8,color:"ink",tracking:-.48,wrap:"auto"}),units:blockBox({w:78,h:34,padding:[2,2,2,2],radius:[999,999],edge:{width:1,color:"line",ring:false}}),unit:blockBox({w:36,h:28,minHeight:28,radius:[999,999],center:true,color:"muted"}),unitText:blockText({size:13,weight:700,lineHeight:20.15,color:"muted",wrap:"auto"}),unitOn:blockBox({w:36,h:28,minHeight:28,radius:[999,999],bg:"ink",center:true,color:"surface"}),unitOnText:blockText({size:13,weight:700,lineHeight:20.15,color:"surface",wrap:"auto"}),now:blockBox({w:483.078,h:88,gap:[24,12],center:true}),glyph:blockBox({w:88,h:88}),temp:blockText({size:51.2,weight:700,lineHeight:51.2,color:"ink",tracking:-1.536,wrap:"auto",tabular:true}),tempFluid:{min:44,vw:4,max:56},sky:blockText({size:15,weight:400,lineHeight:21,color:"muted",wrap:"auto",marginTop:6}),tags:blockBox({w:483.078,h:30,marginTop:24,gap:[8,8]}),tag:blockBox({w:123.75,h:30,padding:[0,14,0,14],gap:[8,8],minHeight:30,radius:[999,999],bg:"surface",edge:{width:1,color:"#F2C763",ring:false},center:true,color:"ink"}),tagText:blockText({size:13,weight:700,lineHeight:20.15,color:"ink",wrap:"auto"}),dot:7,hues:{red:"alert",yellow:"#F2C763",green:"go",blue:"#4E98C9",plain:"line",plainDot:"muted"},phone:{upTo:559,card:blockBox({w:335,h:272,padding:[18,18,18,18],radius:[20,20],bg:"surface",edge:{width:1,color:"line",ring:false}}),glyph:blockBox({w:64,h:64})}},weatherAlert:{card:blockBox({w:361,h:48,padding:[0,16,0,16],gap:[12,12],minHeight:48,radius:[10,10],bg:"#FBF1EE",center:true,color:"#6D1D14"}),icon:blockBox({w:20,h:20,color:"alert"}),title:blockText({size:15,weight:700,lineHeight:23.25,color:"#6D1D14"}),titleGap:6,text:blockText({size:15,weight:400,lineHeight:23.25,color:"#6D1D14"}),chev:blockBox({w:16,h:16,color:"#6D1D14"}),pressScale:.98},weatherDetails:{grid:blockBox({w:361,h:591.25,gap:[12,12]}),tile:blockBox({w:174.5,h:143.359,padding:[14,14,14,14],gap:[6,6],minHeight:120,radius:[20,20],bg:"surface",edge:{width:1,color:"line",ring:false}}),label:blockText({size:12,weight:700,lineHeight:15.6,color:"muted",tracking:.72,face:"mono",upper:true}),labelGap:6,icon:blockBox({w:16,h:16,color:"ink"}),chev:blockBox({w:14,h:14,color:"muted"}),value:blockText({size:28,weight:700,lineHeight:30.8,color:"ink",tracking:-.56,tabular:true}),valueGap:6,unit:blockText({size:15,weight:700,lineHeight:16.5,color:"ink",tabular:true}),note:blockText({size:13,weight:400,lineHeight:18.2}),pressScale:.98},weatherHours:{cell:blockBox({w:54,h:100,padding:[2,0,0,0],gap:[4,4],center:true}),column:54,rows:[18,32,16,20,6],time:blockText({size:13,weight:400,lineHeight:15.6,color:"muted"}),timeNow:blockText({size:13,weight:700,lineHeight:15.6,color:"ink"}),glyph:blockBox({w:32,h:32}),icon:blockBox({w:24,h:24,color:"#926F06"}),chance:blockText({size:12,weight:700,lineHeight:12,color:"#1E7AB7",face:"mono"}),temp:blockText({size:15,weight:700,lineHeight:18,color:"ink",tabular:true}),quiet:blockText({size:13,weight:400,lineHeight:15.6,color:"muted",tabular:true}),bar:blockBox({w:52,h:6,radius:[3,3],bg:"#77DDAC"}),barInset:1,levels:{good:"#77DDAC",ok:"#F4CF7A",hot:"#DC8F7C",storm:"#8DA4BB"},windows:blockBox({w:327,h:76.594,marginBottom:12,gap:[8,8]}),window:blockBox({w:159.5,h:76.594,padding:[10,12,10,12],gap:[2,2],radius:[10,10],bg:"tintGo"}),windowTitle:blockText({size:15,weight:700,lineHeight:19.5,color:"ink",tabular:true}),windowText:blockText({size:13,weight:400,lineHeight:17.55}),legend:blockBox({w:327,h:18.188,marginTop:12,gap:[14,4],color:"muted"}),legendItem:blockBox({w:47.813,h:18.188,gap:[6,6],center:true,color:"muted"}),legendText:blockText({size:13,weight:400,lineHeight:18.2,color:"muted",marginTop:12}),legendDot:blockBox({w:10,h:10,radius:[5,5],bg:"#77DDAC",color:"muted"})},weatherForecast:{row:blockBox({w:327,h:48,gap:[8,8],minHeight:48,center:true}),rule:{width:1,color:"line"},columns:[48,32,30,155,30],walkColumns:[42,30,28,73,28,86],day:blockText({size:15,weight:700,lineHeight:18,color:"ink"}),sky:blockBox({w:32,h:30,gap:[1,1]}),glyph:blockBox({w:30,h:30}),chance:blockText({size:12,weight:700,lineHeight:12,color:"#1E7AB7",face:"mono"}),low:blockText({size:14,weight:400,lineHeight:14,color:"muted",face:"mono",tabular:true}),high:blockText({size:14,weight:400,lineHeight:14,color:"ink",face:"mono",tabular:true}),bar:blockBox({w:155,h:6,radius:[3,3],bg:"#F1F5F2"}),fill:blockBox({w:99.203,h:6,radius:[3,3],bg:"#DDB44F",x:23.25}),tag:blockBox({w:42.016,h:24,padding:[0,10,0,10],minHeight:24,radius:[999,999],bg:"#FCF0D6",edge:{width:1,color:"tintYellowEdge",ring:true},center:true,color:"ink"}),tagText:blockText({size:12,weight:700,lineHeight:14.4,color:"ink"}),tags:{good:{bg:"tintGo",ring:"#8FE3BB",ringWidth:1,color:"ink"},ok:{bg:"#FCF0D6",ring:"tintYellowEdge",ringWidth:1,color:"ink"},warn:{bg:"#FBF1EE",ring:"#E9B8AB",ringWidth:1,color:"#6D1D14"},rain:{bg:"tintBlue",ring:"#AFD1E7",ringWidth:1,color:"ink"}}},weatherLevels:{phone:{list:blockBox({w:361,h:140,marginTop:16,marginBottom:16,gap:[12,12]}),row:blockBox({w:361,h:26,gap:[8,8],center:true}),columns:[24,56,185,72],icon:blockBox({w:26,h:26}),name:blockText({size:15,weight:400,lineHeight:23.25}),bar:blockBox({w:185,h:8,radius:[999,999],bg:"#ECECEC"}),fills:{high:"#B67A3F",mid:"#F2C763",low:"ink"},level:{high:blockText({size:13,weight:700,lineHeight:20.15,color:"#A05E32",face:"mono"}),mid:blockText({size:13,weight:400,lineHeight:20.15,color:"#A05E32",face:"mono"}),low:blockText({size:13,weight:400,lineHeight:20.15,color:"muted",face:"mono"})}},web:{list:blockBox({w:344.891,h:140,marginTop:16,marginBottom:16,gap:[12,12]}),row:blockBox({w:344.891,h:26,gap:[12,12],center:true}),columns:[26,64,138.891,80],icon:blockBox({w:26,h:26}),name:blockText({size:15,weight:400,lineHeight:23.25,wrap:"auto"}),bar:blockBox({w:138.891,h:8,radius:[999,999],bg:"#ECECEC"}),fills:{high:"#B67A3F",mid:"#F2C763",low:"ink"},level:{high:blockText({size:13,weight:700,lineHeight:20.15,color:"#A05E32",face:"mono",wrap:"auto"}),mid:blockText({size:13,weight:400,lineHeight:20.15,color:"#A05E32",face:"mono",wrap:"auto"}),low:blockText({size:13,weight:400,lineHeight:20.15,color:"muted",face:"mono",wrap:"auto"})}},webPhoneUpTo:559},weatherReading:{phone:{body:blockBox({w:361,h:88.344,gap:[12,12]}),gap:12,picks:blockBox({w:361,h:36,gap:[10,10]}),on:blockBox({w:103.016,h:36,padding:[0,12,0,12],gap:[6,6],minHeight:36,radius:[999,999],bg:"pink",edge:{width:1,color:"pink",ring:false},center:true,color:"ink"}),onText:blockText({size:15,weight:700,lineHeight:19.5,color:"ink"}),off:blockBox({w:86.875,h:36,padding:[0,12,0,12],gap:[6,6],minHeight:36,radius:[999,999],bg:"surface",edge:{width:1,color:"ink",ring:false},center:true,color:"ink"}),offText:blockText({size:15,weight:400,lineHeight:19.5,color:"ink"}),check:blockBox({w:16,h:16,color:"ink"}),read:blockBox({w:361,h:40.344,gap:[12,0]}),value:blockText({size:36,weight:700,lineHeight:37.8,color:"ink",tracking:-.72,tabular:true}),word:blockText({size:17,weight:700,lineHeight:26.35,color:"alert",tracking:.34,face:"mono",upper:true})},web:{body:blockBox({w:344.891,h:140.344}),gap:16,picks:blockBox({w:344.891,h:82,marginTop:16,marginBottom:16,gap:[10,10]}),on:blockBox({w:107.016,h:36,padding:[0,14,0,14],gap:[6,6],minHeight:36,radius:[999,999],bg:"pink",edge:{width:1,color:"pink",ring:false},center:true,color:"ink"}),onText:blockText({size:15,weight:700,lineHeight:19.5,color:"ink",wrap:"auto"}),off:blockBox({w:90.875,h:36,padding:[0,14,0,14],gap:[6,6],minHeight:36,radius:[999,999],bg:"surface",edge:{width:1,color:"ink",ring:false},center:true,color:"ink"}),offText:blockText({size:15,weight:400,lineHeight:19.5,color:"ink",wrap:"auto"}),check:blockBox({w:16,h:16,color:"ink"}),read:blockBox({w:344.891,h:42.344,gap:[12,0]}),value:blockText({size:38.4,weight:700,lineHeight:40.32,color:"ink",tracking:-.768,wrap:"auto",tabular:true}),word:blockText({size:17,weight:700,lineHeight:26.35,color:"#A05E32",tracking:.34,face:"mono",upper:true,wrap:"auto"})},fluid:{min:36,vw:3,max:44},tones:{good:"#0C844B",ok:"#A05E32",low:"alert"}}};function deepFreeze2(value){if(value!==null&&typeof value=="object"&&!Object.isFrozen(value))for(let v of Object.values(value))deepFreeze2(v);return value}var k=everfurTokens,PRESET=/* @__PURE__ */Symbol.for("@everfur-health/ui-core#preset@v1");function asPreset(theme){return Object.defineProperty(theme,PRESET,{value:theme,enumerable:true}),deepFreeze2(theme)}var SCALE_CAPS={content:0,heading:2,control:1.8,compact:1.5,badge:1.3},everfurTheme=asPreset({name:"everfur",colors:{bg:k.color.bg,surface:k.color.efWhite,text:k.color.text,ink:k.role.color.ink,onInk:k.color.efWhite,muted:k.role.color.muted,line:k.role.color.line,go:k.role.color.go,onGo:k.role.color.ink,pink:k.color.efDustyPink,onPink:k.role.color.ink,alert:k.color.alert,alertDeep:k.color.alertDeep,icoSage:k.role.color.icoSage,bgMist:k.color.bgMist,tintSage:k.role.color.tintSage,tintBlue:k.role.color.tintBlue,tintGo:k.role.color.tintGo,tintPink:k.role.color.tintPink,tintYellowEdge:k.role.color.tintYellowEdge,tintWatch:everfurMetrics.colors.watch,tintRed:k.role.color.tintRed,scrim:everfurMetrics.colors.scrim,grab:everfurMetrics.colors.grab,focus:k.role.color.ink,planInk:everfurMetrics.colors.planInk,planOnInk:everfurMetrics.colors.planOnInk,planAccent:everfurMetrics.colors.planAccent,planLink:everfurMetrics.colors.planLink,planAccentWash:everfurMetrics.colors.planAccentWash,planAccentChip:everfurMetrics.colors.planAccentChip,planLinkWash:everfurMetrics.colors.planLinkWash,planLinkChip:everfurMetrics.colors.planLinkChip},radius:{...k.radius},space:{...k.space},type:{family:k.font.family.base,mono:k.font.family.mono,faces:{regular:"Azeret-Regular",medium:"Azeret-Medium",bold:"Azeret-Bold",mono:"AzeretMono-Regular",monoBold:"AzeretMono-Bold"},namedFaces:true,size:{xs:k.font.size.xs,sm:k.font.size.sm,md:k.font.size.md,lg:k.font.size.lg,xl:k.font.size.xl},weight:{...k.font.weight},lineHeight:{...k.font.lineHeight},scaleCaps:SCALE_CAPS},motion:{duration:{press:k.motion.duration.press,fade:k.motion.duration.fade,enter:k.motion.duration.enter,sheet:k.motion.duration.sheet,sheetOut:k.motion.duration.sheetOut},easing:{out:k.motion.easing.out,drawer:k.motion.easing.drawer},pop:{duration:k.motion.duration.enter,from:.95,peakAt:.55,amplitude:.035,switchAmplitude:.06},reduced:false},metrics:everfurMetrics});function presetOf(theme){return theme[PRESET]??everfurTheme}function isObject(v){return v!==null&&typeof v=="object"&&!Array.isArray(v)}function merge(base3,over){if(!isObject(base3)||!isObject(over))return over===void 0?base3:over;let out={...base3};for(let[key,value]of Object.entries(over))value!==void 0&&(out[key]=merge(base3[key],value));return out}function resolveTheme(partial,base3=everfurTheme){if(!partial)return base3;let merged=merge(base3,partial),given=partial.colors;if(given){let colors=merged.colors;for(let[wash,from,share]of PLAN_WASHES){let c=given[from];c!==void 0&&given[wash]===void 0&&(colors[wash]=mixHex(c,share,colors.surface)??colors[wash]??c)}}return deepFreeze2(merged)}var PLAN_WASHES=[["planAccentWash","planAccent",.17],["planAccentChip","planAccent",.47],["planLinkWash","planLink",.12],["planLinkChip","planLink",.2]];function mixHex(color,share,ground){let ch=v=>{let m=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(v??"");return m?[m[1],m[2],m[3]].map(h=>parseInt(h,16)):void 0},[c,g]=[ch(color),ch(ground)];if(!(!c||!g))return`#${c.map((v,i)=>Math.round(v*share+(g[i]??0)*(1-share)).toString(16).padStart(2,"0")).join("").toUpperCase()}`}var ThemeContext=/* @__PURE__ */(()=>{let key=/* @__PURE__ */Symbol.for("@everfur-health/ui-core#ThemeContext@v1"),host2=globalThis,context=host2[key]??(host2[key]=react.createContext(null));return context.displayName??(context.displayName="EverfurThemeContext"),context})();function ThemeProvider({theme:theme,children:children}){let outer=useTheme(),key=theme===void 0||isComplete(theme)?theme:contentKey(theme),value=react.useMemo(()=>isComplete(theme)?filled(theme):resolveTheme(theme,outer),[key,outer]);return react.createElement(ThemeContext.Provider,{value:value},children)}function contentKey(value){return JSON.stringify(value,(_,v)=>isObject(v)&&!Array.isArray(v)?Object.fromEntries(Object.keys(v).sort().map(k2=>[k2,v[k2]])):v)}function isComplete(theme){return theme!==void 0&&Object.isFrozen(theme)&&GROUPS.every(g=>g in theme)}var GROUPS=["name","colors","radius","space","type","motion","metrics"];function hasEvery(shape,value){if(shape===void 0)return true;if(!isObject(shape))return value!==void 0;if(!isObject(value))return false;for(let key of Object.keys(shape))if(!hasEvery(shape[key],value[key]))return false;return true}var fills=/* @__PURE__ */new WeakMap;function filled(theme){let hit=fills.get(theme);if(hit)return hit;if(hasEvery(everfurTheme,theme))return fills.set(theme,theme),theme;let preset=presetOf(theme),merged=merge(everfurTheme,preset===everfurTheme?theme:merge(preset,theme));merged[PRESET]=preset;let out=deepFreeze2(merged);return fills.set(theme,out),out}function useTheme(){let explicit=react.useContext(ThemeContext);return explicit?filled(explicit):everfurTheme}var px=n=>Math.round(n*1e3)/1e3;function faceOf(weight,mono=false){return mono?weight>450?"monoBold":"mono":weight>500?"bold":weight>450?"medium":"regular"}function withAlpha(color,alpha){let m=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(color);if(!m)return color;let[r,g,b]=[m[1],m[2],m[3]].map(h=>parseInt(h,16));return`rgba(${r}, ${g}, ${b}, ${alpha})`}function channelsOf(color){let hex=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(color);if(hex)return[hex[1],hex[2],hex[3]].map(h=>parseInt(h,16));let rgb2=/^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)/i.exec(color);return rgb2?[rgb2[1],rgb2[2],rgb2[3]].map(Number):void 0}function mixColor(color,share,base3,fallback){let[c,b]=[channelsOf(color),channelsOf(base3)];return!c||!b?fallback:`rgb(${c.map((v,i)=>Math.round(v*share+(b[i]??0)*(1-share))).join(", ")})`}function colorOf(t,value){let m=/^([a-zA-Z]+)(?:\/([\d.]+))?$/.exec(value),role=m?.[1];if(!m||role===void 0||!(role in t.colors))return value;let c=t.colors[role];return m[2]===void 0?c:withAlpha(c,Number(m[2]))}function textPartSpec(t,p){return{size:p.size,weight:p.weight,lineHeight:p.lineHeight,color:colorOf(t,p.color),...p.face==="mono"?{mono:true}:{},...p.face==="serif"?{serif:true}:{},...p.tracking?{tracking:p.tracking}:{},...p.upper?{upper:true}:{},...p.deco==="none"?{}:{deco:p.deco==="strike"?"strike":"underline",decoOffset:p.decoOffset,decoThickness:p.decoThickness},...p.tabular?{tabular:true}:{},...p.wrap==="auto"?{}:{wrap:p.wrap==="balance"?"balance":"pretty"}}}function partFill(t,value){return value==="none"?void 0:colorOf(t,value)}function summarySpec(t){let m=t.metrics.summary,lh=(size,ratio)=>px(size*ratio);return{paddingX:m.paddingX,paddingY:m.paddingY,radius:m.radius,borderWidth:m.borderWidth,borderColor:t.colors.line,background:colorOf(t,m.background),shadow:m.shadow,row:{paddingY:m.rowPaddingY,minHeight:m.rowMinHeight,gapX:m.rowGapX,gapY:m.rowGapY,divider:m.rowDivider,center:m.rowCenter},totalRowMinHeight:m.totalRowMinHeight,gap:m.gap??0,totalMarginTop:m.totalMarginTop??0,tabular:m.tabular,term:{size:m.termSize,weight:t.type.weight.regular,lineHeight:lh(m.termSize,m.termLineHeight),color:colorOf(t,m.termColor)},value:{size:m.valueSize,weight:m.valueWeight,lineHeight:lh(m.valueSize,m.valueLineHeight),color:colorOf(t,m.valueColor)},totalTerm:{size:m.totalTermSize,weight:m.totalTermWeight,lineHeight:lh(m.totalTermSize,m.termLineHeight),color:colorOf(t,m.totalTermColor)},total:{size:m.totalSize,weight:m.totalWeight,lineHeight:lh(m.totalSize,m.totalLineHeight),color:colorOf(t,m.valueColor)},off:textPartSpec(t,t.metrics.summary.off)}}function skeletonWidth(t,index){let widths=t.metrics.skeleton.widths;return`${widths[index%widths.length]}%`}function itemTestID(parent,key,own){return own!==void 0?own:parent===void 0?void 0:`${parent}-${key}`}var nums=group=>group,isBox=v=>"edge"in v&&"shadow"in v&&"fit"in v,isText=v=>"deco"in v&&"face"in v&&"tabular"in v;function byValue(group){let out=/* @__PURE__ */new Map;for(let[k2,v]of Object.entries(group))out.has(v)||out.set(v,k2);return out}var groups,derived=/* @__PURE__ */new WeakMap;function tokenOf(map,theme,v){let k2=map.get(v),t=k2===void 0?void 0:theme[k2];return typeof t=="number"?t:v}function blocksMetrics(theme){let base3=everfurBlocksMetrics,p=everfurTheme;if(theme.space===p.space&&theme.radius===p.radius&&theme.type.size===p.type.size&&theme.type.weight===p.type.weight)return base3;let hit=derived.get(theme);if(hit)return hit;groups??(groups={space:byValue(nums(p.space)),radius:byValue(nums(p.radius)),size:byValue(nums(p.type.size)),weight:byValue(nums(p.type.weight))});let g=groups,space=v=>tokenOf(g.space,nums(theme.space),v),radius=v=>tokenOf(g.radius,nums(theme.radius),v),walk=v=>Array.isArray(v)?v.map(walk):v===null||typeof v!="object"?v:isBox(v)?{...v,padding:v.padding.map(space),gap:v.gap.map(space),marginTop:space(v.marginTop),marginBottom:space(v.marginBottom),radius:v.radius.map(radius)}:isText(v)?{...v,size:tokenOf(g.size,nums(theme.type.size),v.size),weight:tokenOf(g.weight,nums(theme.type.weight),v.weight),marginTop:space(v.marginTop),paddingTop:space(v.paddingTop)}:Object.fromEntries(Object.entries(v).map(([k2,x])=>[k2,walk(x)])),out=walk(base3);return derived.set(theme,out),out}var TEXT_VARIANT_TIERS={display:"heading",headline:"heading",title:"heading",heading:"heading",body:"content",lead:"content",label:"control",meta:"compact",caption:"content",overline:"compact",kicker:"compact"};function textToneColor(t,tone){let c=t.colors;switch(tone){case"ink":return c.ink;case"text":return c.text;case"muted":return c.muted;case"danger":return c.alertDeep;case"inverse":return c.onInk;default:return}}function textVariantSpec(t,variant,tone,weight){let base3=textPartSpec(t,t.metrics.text[variant]),color=textToneColor(t,tone);return{...base3,...color?{color:color}:{},...weight?{weight:t.type.weight[weight]}:{}}}var TEXT_VARIANT_BREAKS={display:"balance",headline:"balance",title:"balance",heading:"balance",body:"pretty",lead:"pretty",meta:"pretty",caption:"pretty",label:"auto",overline:"auto",kicker:"auto"};function textVariantTier(t,variant){return t.type.variantTiers?.[variant]??TEXT_VARIANT_TIERS[variant]}var ReducedMotionContext=/* @__PURE__ */(()=>{let key=/* @__PURE__ */Symbol.for("@everfur-health/ui-native#ReducedMotionContext@v1"),host2=globalThis,context=host2[key]??(host2[key]=react.createContext(null));return context.displayName??(context.displayName="EverfurReducedMotionContext"),context})();function useKnownReducedMotion(){return react.useContext(ReducedMotionContext)}function rnText(t,spec){let face2=faceOf(spec.weight,spec.mono===true);return{fontFamily:spec.serif?t.type.faces.serif??t.type.faces.bold:t.type.faces[face2],...t.type.namedFaces?{}:{fontWeight:String(spec.weight)},fontSize:spec.size,lineHeight:spec.lineHeight,color:spec.color,...spec.tracking?{letterSpacing:spec.tracking}:{},...spec.upper?{textTransform:"uppercase"}:{},...spec.deco?rnDeco(spec):{},...spec.tabular?{fontVariant:["tabular-nums"]}:{},...spec.wrap&&reactNative.Platform.OS==="web"?{textWrap:spec.wrap}:{}}}function rnDeco(spec){let base3={textDecorationLine:spec.deco==="strike"?"line-through":"underline"};return reactNative.Platform.OS!=="web"?base3:{...base3,...spec.decoOffset?{textUnderlineOffset:spec.decoOffset}:{},...spec.decoThickness?{textDecorationThickness:spec.decoThickness}:{}}}function rnBox(t,b){let[pt=0,pr=0,pb=0,pl=0]=b.padding,[rt=0,rb=0]=b.radius,fill=partFill(t,b.bg);return{paddingTop:pt,paddingRight:pr,paddingBottom:pb,paddingLeft:pl,...b.marginTop?{marginTop:b.marginTop}:{},...b.gap[0]?{columnGap:b.gap[0]}:{},...b.gap[1]?{rowGap:b.gap[1]}:{},...rt===rb?rt?{borderRadius:rt}:{}:{borderTopLeftRadius:rt,borderTopRightRadius:rt,borderBottomLeftRadius:rb,borderBottomRightRadius:rb},...fill?{backgroundColor:fill}:{},...b.edge.width>0&&!b.edge.ring?{borderWidth:b.edge.width,borderColor:colorOf(t,b.edge.color)}:{},...b.minHeight?{minHeight:b.minHeight}:{},...rnShadow(b.shadow)}}function webReducedMotion(){if(reactNative.Platform.OS!=="web")return false;let g=globalThis;return typeof g.matchMedia=="function"&&g.matchMedia("(prefers-reduced-motion: reduce)").matches}function useOsReducedMotion(known){let[reduced,setReduced]=react.useState(()=>known===null&&webReducedMotion());return react.useEffect(()=>{if(known!==null)return;let mounted=true,query=reactNative.AccessibilityInfo?.isReduceMotionEnabled;if(typeof query=="function"){let result=query.call(reactNative.AccessibilityInfo);result!=null&&typeof result.then=="function"&&result.then(value=>{mounted&&setReduced(value===true)},()=>{})}let subscription=reactNative.AccessibilityInfo?.addEventListener?.("reduceMotionChanged",value=>setReduced(value===true));return()=>{mounted=false,subscription?.remove?.()}},[known]),known??reduced}function useRnReduced(t){let os=useOsReducedMotion(useKnownReducedMotion());return t.motion.reduced||os}function slopFor(size){let pad=Math.max(0,Math.ceil((44-size)/2));return pad===0?void 0:{top:pad,bottom:pad,left:pad,right:pad}}function rnShadow(s){return s.blur===0&&s.y===0&&s.x===0?null:{shadowColor:s.color,shadowOffset:{width:s.x,height:s.y},shadowOpacity:1,shadowRadius:s.blur,elevation:1}}function breakProps(mode){return mode==="auto"?null:reactNative.Platform.OS==="ios"?{lineBreakStrategyIOS:"push-out"}:reactNative.Platform.OS==="android"&&mode==="balance"?{textBreakStrategy:"balanced"}:null}function weightStyle(t,weight){let w=t.type.weight[weight];return t.type.namedFaces?{fontFamily:t.type.faces[faceOf(w)]}:{fontWeight:String(w)}}function Text2({tier:tier,variant:variant,tone:tone,weight:weight,level:level,lineBreak:lineBreak,...props}){let t=useTheme(),cap2=t.type.scaleCaps[tier??(variant?textVariantTier(t,variant):"content")],breaks=breakProps(lineBreak??(variant?TEXT_VARIANT_BREAKS[variant]:"auto"));if(variant===void 0&&tone===void 0&&weight===void 0&&level===void 0)return breaks?react.createElement(reactNative.Text,{...cap2>0?{maxFontSizeMultiplier:cap2}:{},...breaks,...props}):react.createElement(reactNative.Text,cap2>0?{maxFontSizeMultiplier:cap2,...props}:props);let color=textToneColor(t,tone),own=variant?rnText(t,textVariantSpec(t,variant,tone,weight)):{...color?{color:color}:{},...weight?weightStyle(t,weight):{}},heading=level===void 0?{}:{accessibilityRole:"header",...reactNative.Platform.OS==="web"?{"aria-level":level}:{}};return react.createElement(reactNative.Text,{...cap2>0?{maxFontSizeMultiplier:cap2}:{},...breaks,...heading,...props,style:[own,props.style]})}var BOX=24,FINE=16,SEAM=.8,fine=dp=>Math.round(dp*FINE);function place(cx,cy,W,H,ux,uy){let left=cx-W/2,top=cy-H/2,x=Math.round(left),y=Math.round(top);return{position:"absolute",left:x,top:y,width:W,height:H,transform:[{translateX:left-x},{translateY:top-y},{rotate:`${Math.atan2(uy,ux)*180/Math.PI}deg`},{scale:1/FINE}]}}function strokePieces(icon,k2,out){for(let s of icon.strokes){let w=s.width*k2,pts=s.points,n=pts.length/2,last=s.closed?n:n-1;for(let i=0;i<last;i+=1){let j=(i+1)%n,px2=(pts[i*2]??0)*k2,py=(pts[i*2+1]??0)*k2,dx=(pts[j*2]??0)*k2-px2,dy=(pts[j*2+1]??0)*k2-py,len=Math.hypot(dx,dy);if(len===0&&!(n===2&&s.cap))continue;let ux=len===0?1:dx/len,uy=len===0?0:dy/len,e0=s.closed||i>0||s.cap?w/2:0,e1=s.closed||j!==n-1||s.cap?w/2:0,along=(len+e1-e0)/2;out.push({paint:"backgroundColor",style:{...place(px2+ux*along,py+uy*along,fine(len+e0+e1),fine(w),ux,uy),borderTopLeftRadius:e0>0?fine(w)/2:0,borderBottomLeftRadius:e0>0?fine(w)/2:0,borderTopRightRadius:e1>0?fine(w)/2:0,borderBottomRightRadius:e1>0?fine(w)/2:0,...s.opacity===void 0?{}:{opacity:s.opacity}}})}}}function boxPieces(icon,k2,out){for(let b of icon.boxes){let w=(b.w+b.width)*k2,h=(b.h+b.width)*k2;out.push({paint:"borderColor",style:{...place((b.x-b.width/2)*k2+w/2,(b.y-b.width/2)*k2+h/2,fine(w),fine(h),1,0),borderWidth:fine(b.width*k2),borderRadius:(b.radius+b.width/2)*k2*FINE,...b.opacity===void 0?{}:{opacity:b.opacity}}})}}function trianglePieces(icon,k2,out){for(let t of icon.triangles){let p=[0,1,2].map(i=>[(t[i*2]??0)*k2,(t[i*2+1]??0)*k2]),base3=0,len=-1;for(let i=0;i<3;i+=1){let a2=p[i]??[0,0],b=p[(i+1)%3]??[0,0],d=Math.hypot(b[0]-a2[0],b[1]-a2[1]);d>len&&(len=d,base3=i)}if(len<=0)continue;let b0=p[base3]??[0,0],b1=p[(base3+1)%3]??[0,0],a=p[(base3+2)%3]??[0,0],ux=(b1[0]-b0[0])/len,uy=(b1[1]-b0[1])/len,along=(a[0]-b0[0])*ux+(a[1]-b0[1])*uy,across=(a[0]-b0[0])*-uy+(a[1]-b0[1])*ux,h=Math.abs(across),up=across<0,mid=up?-h/2:h/2,bl=fine(along),br=fine(len)-bl,bh=fine(h);out.push({paint:up?"borderBottomColor":"borderTopColor",style:{...place(b0[0]+ux*(len/2)-uy*mid,b0[1]+uy*(len/2)+ux*mid,bl+br,bh,ux,uy),width:0,height:0,borderLeftWidth:bl,borderRightWidth:br,borderLeftColor:"transparent",borderRightColor:"transparent",...up?{borderBottomWidth:bh}:{borderTopWidth:bh}}})}for(let e of icon.seams){let x0=(e[0]??0)*k2,y0=(e[1]??0)*k2,dx=(e[2]??0)*k2-x0,dy=(e[3]??0)*k2-y0,d=Math.hypot(dx,dy),in0=SEAM*(e[4]??0),in1=SEAM*(e[5]??0),bar=d-in0-in1;if(d===0||bar<=0)continue;let mid=in0+bar/2;out.push({paint:"backgroundColor",style:place(x0+dx/d*mid,y0+dy/d*mid,fine(bar),fine(SEAM),dx/d,dy/d)})}}var cache2=/* @__PURE__ */new WeakMap;function piecesOf(icon,size){let sizes=cache2.get(icon);sizes===void 0&&(sizes=/* @__PURE__ */new Map,cache2.set(icon,sizes));let hit=sizes.get(size);if(hit!==void 0)return hit;let out=[],k2=size/BOX;return boxPieces(icon,k2,out),strokePieces(icon,k2,out),trianglePieces(icon,k2,out),sizes.set(size,out),out}function Glyph({icon:icon,size:size,color:color,label:label,testID:testID,style:style}){let t=useTheme(),side=size??t.metrics.icon.size,ink=color??t.colors.ink;/* @__PURE__ */
|
|
36
|
+
return jsxRuntime.jsx(reactNative.View,{testID:testID,pointerEvents:"none",style:[{width:side,height:side},style],...label?{accessible:true,accessibilityRole:"image",accessibilityLabel:label}:{accessible:false,accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants"},children:piecesOf(icon,side).map((piece,i)=>/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[piece.style,{[piece.paint]:ink}]},i))})}var REGISTRY=/* @__PURE__ */(()=>{let key=/* @__PURE__ */Symbol.for("@everfur-health/ui-native#icons@v1"),host2=globalThis;return host2[key]??(host2[key]={icons:{},warned:/* @__PURE__ */new Set})})();function registerIcons(icons){Object.assign(REGISTRY.icons,icons)}function iconNamed(name){let icon=REGISTRY.icons[name];return icon===void 0&&(typeof __DEV__<"u"?__DEV__:typeof process<"u"&&process.env.NODE_ENV!=="production")&&!REGISTRY.warned.has(name)&&(REGISTRY.warned.add(name),console.warn(`@everfur-health/ui-native: no icon "${name}" is registered. The lean entry draws only the icons an app registers: registerIcons({ ... }) with the UI_RN_ICON_* exports, or pass a drawing.`)),icon}function Icon({name:name,...rest}){let icon=iconNamed(name);return icon?/* @__PURE__ */jsxRuntime.jsx(Glyph,{icon:icon,...rest}):null}reactNative.StyleSheet.create({base:{flexDirection:"row",alignItems:"center",justifyContent:"center"},block:{alignSelf:"stretch"},auto:{alignSelf:"flex-start"},labelBox:{flexShrink:1},label:{textAlign:"center"}});reactNative.StyleSheet.create({head:{flexDirection:"row",flexWrap:"wrap",alignItems:"center",justifyContent:"space-between"},shrink:{flexShrink:1},end:{justifyContent:"flex-end"}});reactNative.StyleSheet.create({chip:{flexDirection:"row",alignItems:"center",alignSelf:"flex-start"}});reactNative.StyleSheet.create({st:{alignItems:"center",alignSelf:"stretch"},center:{textAlign:"center"},acts:{alignItems:"center",alignSelf:"stretch"},link:{alignItems:"center",justifyContent:"center"},underline:{textDecorationLine:"underline"}});function rnTextPart(t,p){return rnText(t,textPartSpec(t,p))}reactNative.StyleSheet.create({acts:{flexDirection:"row",flexWrap:"wrap",alignItems:"center"},st:{alignItems:"center",alignSelf:"stretch"},center:{textAlign:"center"},stActs:{alignItems:"center",alignSelf:"stretch"},link:{alignItems:"center",justifyContent:"center"},underline:{textDecorationLine:"underline"}});reactNative.StyleSheet.create({pill:{flexDirection:"row",alignItems:"center",alignSelf:"flex-start",maxWidth:"100%"},label:{flexShrink:1}});var UI_RN_ICON_ARROW_LEFT={strokes:[{width:2,cap:true,closed:false,points:[12,19,5,12,12,5]},{width:2,cap:true,closed:false,points:[19,12,5,12]}],boxes:[],triangles:[],seams:[]};var UI_RN_ICON_CHEVRON={strokes:[{width:2,cap:true,closed:false,points:[9,18.001,15,12.001,9,6.001]}],boxes:[],triangles:[],seams:[]};var UI_RN_ICON_LEAF={strokes:[{width:2,cap:true,closed:true,points:[11,20,8.727,19.628,6.697,18.538,5.131,16.848,4.199,14.741,4.001,12.446,4.558,10.211,5.811,8.278,7.624,6.856,9.8,6.1,12.322,5.587,14.274,5.099,15.788,4.568,16.993,3.921,18.02,3.088,19,2,19.734,3.557,20.375,5.318,20.828,7.42,21,10,20.72,12.286,19.931,14.388,18.708,16.245,17.127,17.796,15.265,18.98,13.198,19.735,11,20]},{width:2,cap:true,closed:false,points:[2,21,2.218,19.285,2.858,17.776,3.896,16.524,5.311,15.582,7.08,15,8.885,14.469,10.573,13.695,11.993,12.823,13,12]}],boxes:[],triangles:[],seams:[]};var UI_RN_ICON_PAW={strokes:[{width:2,cap:true,closed:true,points:[9,10,10.913,10.381,12.536,11.464,13.619,13.087,14,15,14,18.5,13.615,20.094,12.547,21.338,11.029,21.959,9.395,21.82,8.003,20.952,7.16,19.545,6.576,18.327,5.676,17.425,4.46,16.84,3.054,15.997,2.186,14.607,2.046,12.974,2.665,11.456,3.907,10.387,5.5,10]}],boxes:[{x:9,y:2,w:4,h:4,radius:2,width:2},{x:16,y:6,w:4,h:4,radius:2,width:2},{x:18,y:14,w:4,h:4,radius:2,width:2}],triangles:[],seams:[]};reactNative.StyleSheet.create({qty:{flexDirection:"row",alignItems:"center",alignSelf:"flex-start"},button:{alignItems:"center",justifyContent:"center"}});reactNative.StyleSheet.create({row:{flexDirection:"row",flexWrap:"wrap",alignItems:"center",justifyContent:"space-between"},titles:{flexShrink:1}});reactNative.StyleSheet.create({row:{flexDirection:"row",alignSelf:"stretch"},hairline:{position:"absolute",left:0,right:0},tab:{flex:1,flexBasis:0,flexDirection:"row",alignItems:"center",justifyContent:"center"},center:{flexShrink:1,textAlign:"center"}});reactNative.StyleSheet.create({scrim:{flex:1,justifyContent:"flex-end"},sheet:{maxHeight:"100%"},grab:{alignItems:"center",justifyContent:"center"},head:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"},titles:{flexShrink:1,flexGrow:1},close:{alignItems:"center",justifyContent:"center"},closeEnd:{marginLeft:"auto"},scroll:{flexGrow:0},top:{flexDirection:"row",alignItems:"center"}});function Skeleton({lines:lines=3,shape:shape,label:label,testID:testID,style:style}){let t=useTheme(),m=t.metrics.skeleton,named=label?{accessible:true,accessibilityRole:"progressbar",accessibilityLabel:label,accessibilityState:{busy:true}}:{accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants"};return shape?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{testID:testID,style:[shapeStyle(t,shape),style],...named}):/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{testID:testID,style:[{rowGap:m.gap,alignSelf:"stretch"},style],...named,children:Array.from({length:Math.max(1,lines)},(_,i)=>/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:{height:m.lineHeight,width:skeletonWidth(t,i),borderRadius:t.radius.pill,backgroundColor:t.colors.tintSage}},i))})}function shapeStyle(t,shape){let round=shape.radius==="circle",width=shape.width??(round?shape.height:void 0),radius=shapeRadius(t,shape,width);return{height:shape.height,...width===void 0?{alignSelf:"stretch"}:{width:width},borderRadius:radius,backgroundColor:t.colors.tintSage}}function shapeRadius(t,shape,width){let r=shape.radius??"pill";return r==="none"?0:r==="circle"?(typeof width=="number"?Math.min(width,shape.height):shape.height)/2:t.radius[r]}function SummaryList({rows:given,total:total=false,trailingRows:trailingRows=[],loading:loading=false,loadingLabel:loadingLabel,variant:variant="standard",note:note,grouped:grouped=true,lineBreak:lineBreak,testID:testID,style:style}){let t=useTheme(),s=summarySpec(t);if(loading)/* @__PURE__ */
|
|
38
37
|
return jsxRuntime.jsx(reactNative.View,{testID:testID,style:[{padding:s.paddingX,borderRadius:s.radius,backgroundColor:t.colors.surface},style],children:/* @__PURE__ */jsxRuntime.jsx(Skeleton,{lines:4,label:loadingLabel})});let rows=typeof total=="object"?[...given,{...total,key:total.key??"total"}]:given,large=total!==false;if(rows.length===0)return null;let read=row=>grouped?{accessible:true,accessibilityLabel:`${row.term}, ${row.value}`}:null,breaks=lineBreak===void 0?null:{lineBreak:lineBreak},noteRow=note?{...note,key:note.key??"note"}:void 0,all=[...rows,...trailingRows,...noteRow?[noteRow]:[]];if(variant!=="standard"&&variant!=="flush"){let su=t.metrics.variants.summary;/* @__PURE__ */
|
|
39
38
|
return jsxRuntime.jsx(reactNative.View,{testID:testID,style:[rnBox(t,variant==="inset"?su.inset:su.box),style],children:all.map((row,i)=>{let kind=row===noteRow?"note":large&&i===rows.length-1?"total":"row",box=kind==="note"?su.renewRow:kind==="total"?su.totalRow:su.row,term=kind==="note"?su.renewTerm:kind==="total"?su.totalTerm:su.term,value=kind==="note"?su.renew:kind==="total"?su.total:su.value;/* @__PURE__ */
|
|
40
39
|
return jsxRuntime.jsxs(reactNative.View,{testID:itemTestID(testID,row.key??i,row.testID),...read(row),style:[styles11.cardRow,{columnGap:box.gap[0]??0,minHeight:box.minHeight||void 0,marginTop:box.marginTop||void 0}],children:[
|
|
@@ -44,42 +43,42 @@ return jsxRuntime.jsx(reactNative.View,{testID:testID,style:[{paddingHorizontal:
|
|
|
44
43
|
return jsxRuntime.jsxs(reactNative.View,{testID:itemTestID(testID,row.key??i,row.testID),...read(row),style:[styles11.row,{alignItems:s.row.center?"center":"baseline",paddingVertical:s.row.paddingY,columnGap:s.row.gapX,rowGap:s.row.gapY},minHeight?{minHeight:minHeight}:null,last||s.row.divider===0?null:{borderBottomWidth:s.row.divider,borderBottomColor:s.borderColor}],children:[
|
|
45
44
|
/* @__PURE__ */jsxRuntime.jsx(Text2,{...breaks,style:rnText(t,isTotal?s.totalTerm:s.term),children:row.term}),
|
|
46
45
|
/* @__PURE__ */jsxRuntime.jsx(Text2,{...breaks,style:[rnText(t,isTotal?s.total:row.tone==="off"?s.off:s.value),styles11.value,s.tabular?styles11.tabular:null],children:row.value})]},row.key??`${i}`)})})}var styles11=reactNative.StyleSheet.create({row:{flexDirection:"row",flexWrap:"wrap",justifyContent:"space-between"},cardRow:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"},value:{marginLeft:"auto",textAlign:"right"},tabular:{fontVariant:["tabular-nums"]}});function BlockIcon({icon:icon,size:size,color:color,style:style}){let t=useTheme();return typeof icon=="function"?icon({size:size,color:color??t.colors.ink}):typeof icon!="string"?/* @__PURE__ */jsxRuntime.jsx(Glyph,{icon:icon,size:size,color:color,style:style}):/* @__PURE__ */jsxRuntime.jsx(Icon,{name:icon,size:size,color:color,style:style})}function FadeImage({onShown:onShown,onLoad:onLoad,style:style,...props}){let t=useTheme(),reduced=useRnReduced(t),fade=react.useRef(new reactNative.Animated.Value(0)).current;/* @__PURE__ */
|
|
47
|
-
return jsxRuntime.jsx(reactNative.Animated.Image,{...props,fadeDuration:0,onLoad:e=>{onLoad?.(e);let ms=t.motion.duration.fade;if(reduced||ms<=0){fade.setValue(1),onShown?.();return}reactNative.Animated.timing(fade,{toValue:1,duration:ms,easing:reactNative.Easing.out(reactNative.Easing.cubic),useNativeDriver:reactNative.Platform.OS!=="web"}).start(()=>onShown?.())},style:[style,{opacity:fade}]})}reactNative.StyleSheet.create({row:{flexDirection:"row",alignItems:"flex-start"},noGap:{columnGap:0},box:{alignItems:"center",justifyContent:"center"},grow:{flex:1,minWidth:0}});reactNative.StyleSheet.create({row:{flexDirection:"row",alignItems:"center"},words:{flex:1,minWidth:0},center:{alignItems:"center",justifyContent:"center"}});reactNative.StyleSheet.create({hintRow:{flexDirection:"row",alignItems:"flex-start"},grow:{flex:1}});reactNative.StyleSheet.create({base:{alignItems:"center",justifyContent:"center",alignSelf:"flex-start"}});reactNative.StyleSheet.create({base:{alignSelf:"flex-start"}});reactNative.StyleSheet.create({track:{alignSelf:"flex-start"},thumb:{position:"absolute"}});reactNative.StyleSheet.create({box:{flexDirection:"row"},line:{alignItems:"center"},area:{alignItems:"stretch"},input:{flex:1,minWidth:0,margin:0,borderWidth:0,backgroundColor:"transparent"},hidden:{position:"absolute",width:1,height:1,overflow:"hidden",opacity:0}});reactNative.StyleSheet.create({clip:{overflow:"hidden"},center:{alignItems:"center",justifyContent:"center"},stack:{flexDirection:"row",alignItems:"center",alignSelf:"flex-start"}});reactNative.StyleSheet.create({leadAuto:{flexShrink:0},words:{flex:1,minWidth:0},below:{alignSelf:"flex-start"},end:{flexDirection:"row",alignItems:"center",flexShrink:1,maxWidth:"45%",justifyContent:"flex-end"},flush:{marginTop:0}});reactNative.StyleSheet.create({row:{flexDirection:"row",alignItems:"flex-start"},copy:{flex:1,minWidth:0},acts:{flexDirection:"row",flexWrap:"wrap",alignItems:"center"}});function Toast({message:message,action:action,variant:variant="pill",testID:testID,style:style}){let t=useTheme(),card=variant==="card",m=t.metrics.lists.toast,v=t.metrics.variants.toast,box=card?v.box:m.box,[pt=0,pr=0,pb=0,pl=0]=box.padding,words2=rnTextPart(t,card?v.text:m.text);/* @__PURE__ */
|
|
46
|
+
return jsxRuntime.jsx(reactNative.Animated.Image,{...props,fadeDuration:0,onLoad:e=>{onLoad?.(e);let ms=t.motion.duration.fade;if(reduced||ms<=0){fade.setValue(1),onShown?.();return}reactNative.Animated.timing(fade,{toValue:1,duration:ms,easing:reactNative.Easing.out(reactNative.Easing.cubic),useNativeDriver:reactNative.Platform.OS!=="web"}).start(()=>onShown?.())},style:[style,{opacity:fade}]})}reactNative.StyleSheet.create({row:{flexDirection:"row",alignItems:"flex-start"},noGap:{columnGap:0},box:{alignItems:"center",justifyContent:"center"},grow:{flex:1,minWidth:0}});reactNative.StyleSheet.create({row:{flexDirection:"row",alignItems:"center"},words:{flex:1,minWidth:0},center:{alignItems:"center",justifyContent:"center"}});reactNative.StyleSheet.create({hintRow:{flexDirection:"row",alignItems:"flex-start"},grow:{flex:1}});reactNative.StyleSheet.create({base:{alignItems:"center",justifyContent:"center",alignSelf:"flex-start"}});reactNative.StyleSheet.create({base:{alignSelf:"flex-start"}});reactNative.StyleSheet.create({track:{alignSelf:"flex-start"},thumb:{position:"absolute"}});reactNative.StyleSheet.create({box:{flexDirection:"row"},line:{alignItems:"center"},area:{alignItems:"stretch"},input:{flex:1,minWidth:0,margin:0,borderWidth:0,backgroundColor:"transparent"},hidden:{position:"absolute",width:1,height:1,overflow:"hidden",opacity:0}});reactNative.StyleSheet.create({clip:{overflow:"hidden"},center:{alignItems:"center",justifyContent:"center"},stack:{flexDirection:"row",alignItems:"center",alignSelf:"flex-start"}});reactNative.StyleSheet.create({leadAuto:{flexShrink:0},words:{flex:1,minWidth:0},below:{alignSelf:"flex-start"},end:{flexDirection:"row",alignItems:"center",flexShrink:1,maxWidth:"45%",justifyContent:"flex-end"},flush:{marginTop:0}});reactNative.StyleSheet.create({offRow:{flexDirection:"row",alignItems:"center",alignSelf:"stretch"},offText:{flexShrink:1,minWidth:0},offAction:{flexDirection:"row",alignItems:"center",marginLeft:"auto",flexShrink:0},row:{flexDirection:"row",alignItems:"flex-start"},copy:{flex:1,minWidth:0},acts:{flexDirection:"row",flexWrap:"wrap",alignItems:"center"}});function Toast({message:message,action:action,variant:variant="pill",testID:testID,style:style}){let t=useTheme(),card=variant==="card",m=t.metrics.lists.toast,v=t.metrics.variants.toast,box=card?v.box:m.box,[pt=0,pr=0,pb=0,pl=0]=box.padding,words2=rnTextPart(t,card?v.text:m.text);/* @__PURE__ */
|
|
48
47
|
return jsxRuntime.jsxs(reactNative.View,{testID:testID,style:[card?styles22.card:[styles22.pill,{marginHorizontal:m.inset}],{paddingTop:pt,paddingRight:pr,paddingBottom:pb,paddingLeft:pl,borderRadius:box.radius[0]??0,backgroundColor:partFill(t,box.bg)},style],children:[
|
|
49
|
-
/* @__PURE__ */jsxRuntime.jsx(Text2,{style:[words2,card?styles22.start:styles22.center,styles22.shrink],children:message}),action?/* @__PURE__ */jsxRuntime.jsx(reactNative.Pressable,{onPress:action.onPress,accessibilityRole:"button",accessibilityLabel:action.label,testID:testID?`${testID}-action`:void 0,style:({pressed:pressed})=>[{marginLeft:t.metrics.lists.banner.acts.gap[0]??0},pressed?{opacity:t.metrics.lists.linkPressedOpacity}:null],children:/* @__PURE__ */jsxRuntime.jsx(Text2,{tier:"control",style:rnTextPart(t,{...card?v.text:m.text,weight:t.metrics.lists.banner.link.weight}),children:action.label})}):null]})}var styles22=reactNative.StyleSheet.create({fill:{flex:1},host:{position:"absolute",left:0,right:0,alignItems:"center"},cardHost:{position:"absolute"},card:{alignSelf:"stretch"},start:{textAlign:"left"},pill:{flexDirection:"row",flexWrap:"wrap",alignItems:"center",justifyContent:"center",alignSelf:"center",maxWidth:"100%"},center:{textAlign:"center"},shrink:{flexShrink:1}});reactNative.StyleSheet.create({row:{flexDirection:"row",alignItems:"center"}});function
|
|
48
|
+
/* @__PURE__ */jsxRuntime.jsx(Text2,{style:[words2,card?styles22.start:styles22.center,styles22.shrink],children:message}),action?/* @__PURE__ */jsxRuntime.jsx(reactNative.Pressable,{onPress:action.onPress,accessibilityRole:"button",accessibilityLabel:action.label,testID:testID?`${testID}-action`:void 0,style:({pressed:pressed})=>[{marginLeft:t.metrics.lists.banner.acts.gap[0]??0},pressed?{opacity:t.metrics.lists.linkPressedOpacity}:null],children:/* @__PURE__ */jsxRuntime.jsx(Text2,{tier:"control",style:rnTextPart(t,{...card?v.text:m.text,weight:t.metrics.lists.banner.link.weight}),children:action.label})}):null]})}var styles22=reactNative.StyleSheet.create({fill:{flex:1},host:{position:"absolute",left:0,right:0,alignItems:"center"},cardHost:{position:"absolute"},card:{alignSelf:"stretch"},start:{textAlign:"left"},pill:{flexDirection:"row",flexWrap:"wrap",alignItems:"center",justifyContent:"center",alignSelf:"center",maxWidth:"100%"},center:{textAlign:"center"},shrink:{flexShrink:1}});reactNative.StyleSheet.create({row:{flexDirection:"row",alignItems:"center"}});function rnSource2(image){return typeof image=="number"?image:typeof image=="string"?image?{uri:image}:null:image&&typeof image=="object"&&image.uri?image:null}function Photo({image:image,onImageError:onImageError,box:box,testID:testID}){let t=useTheme(),[failed,setFailed]=react.useState(null),source=rnSource2(image),style=[rnBox(t,box),{width:box.w,height:box.h,overflow:"hidden"}];return!source||failed===image?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:style}):/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:style,children:/* @__PURE__ */jsxRuntime.jsx(FadeImage,{testID:testID,source:source,resizeMode:"cover",onError:()=>{image!=null&&(setFailed(image),onImageError?.(image))},style:{position:"absolute",top:0,right:0,bottom:0,left:0}},JSON.stringify(source))})}function Quote({quote:quote,m:m,testID:testID}){let t=useTheme(),text2=p=>rnText(t,textPartSpec(t,p)),tag=quote.tag?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{testID:testID===void 0?void 0:`${testID}-tag`,style:rnBox(t,m.saysTag),children:/* @__PURE__ */jsxRuntime.jsx(Text2,{style:[text2(m.saysTagText),{paddingTop:0,lineHeight:m.saysTag.h-(m.saysTag.padding?.[0]??0)-(m.saysTag.padding?.[2]??0)}],children:quote.tag})}):null;return rnSource2(quote.image)===null?/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{testID:testID,style:[rnBox(t,m.says),{flexDirection:"column",rowGap:m.saysBare.gap[1],marginTop:m.says.marginTop}],children:[quote.by||tag?/* @__PURE__ */jsxRuntime.jsxs(Text2,{style:text2(m.saysKicker),children:[quote.by,quote.by&&tag?" ":null,tag]}):null,
|
|
50
49
|
/* @__PURE__ */jsxRuntime.jsx(Text2,{style:text2(m.saysSerif),children:quote.text})]}):/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{testID:testID,style:[rnBox(t,m.says),{flexDirection:"row",alignItems:"flex-start",columnGap:m.says.gap[0],marginTop:m.says.marginTop}],children:[
|
|
51
50
|
/* @__PURE__ */jsxRuntime.jsx(Photo,{image:quote.image,onImageError:quote.onImageError,box:m.saysImg}),
|
|
52
|
-
/* @__PURE__ */jsxRuntime.jsxs(Text2,{style:[text2(m.saysText),{flex:1}],children:[quote.by?/* @__PURE__ */jsxRuntime.jsx(Text2,{style:text2(m.saysBy),children:quote.by}):null,quote.by?" ":null,quote.text,tag?" ":null,tag]})]})}function Jump({jump:jump,m:m,testID:testID}){let t=useTheme(),reduced=useRnReduced(t),text2=p=>rnText(t,textPartSpec(t,p)),photo=
|
|
51
|
+
/* @__PURE__ */jsxRuntime.jsxs(Text2,{style:[text2(m.saysText),{flex:1}],children:[quote.by?/* @__PURE__ */jsxRuntime.jsx(Text2,{style:text2(m.saysBy),children:quote.by}):null,quote.by?" ":null,quote.text,tag?" ":null,tag]})]})}function Jump({jump:jump,m:m,testID:testID}){let t=useTheme(),reduced=useRnReduced(t),text2=p=>rnText(t,textPartSpec(t,p)),photo=rnSource2(jump.image)!==null,strip=[rnBox(t,m.jump),{flexDirection:"row",alignItems:"center",columnGap:m.jump.gap[0],marginTop:m.jump.marginTop}],inner=/* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[photo?/* @__PURE__ */jsxRuntime.jsx(Photo,{image:jump.image,onImageError:jump.onImageError,box:m.jumpImg}):null,
|
|
53
52
|
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:{flex:1,minWidth:0},children:[
|
|
54
53
|
/* @__PURE__ */jsxRuntime.jsx(Text2,{style:text2(m.jumpKicker),children:jump.kicker}),
|
|
55
54
|
/* @__PURE__ */jsxRuntime.jsx(Text2,{style:text2(m.jumpTitle),children:jump.title})]}),
|
|
56
|
-
/* @__PURE__ */jsxRuntime.jsx(Text2,{style:text2(m.jumpGo),children:jump.go})]});return jump.onPress?/* @__PURE__ */jsxRuntime.jsx(reactNative.Pressable,{testID:testID,onPress:jump.onPress,accessibilityRole:"button",accessibilityLabel:jump.accessibilityLabel??`${jump.kicker}, ${jump.title}`,style:({pressed:pressed})=>[...strip,pressed&&!reduced?{transform:[{scale:m.jumpPressScale}]}:null],children:inner}):/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{testID:testID,style:strip,children:inner})}function PlanNeedCard({kicker:kicker,source:source,sources:givenSources,title:title,signals:signals,score:score,more:more,quote:quote,jump:jump,variant:variant="standard",children:children,beforeJump:beforeJump,loading:loading=false,loadingLabel:loadingLabel,testID:testID,style:style}){let t=useTheme(),plan=variant==="plan",mp=blocksMetrics(t).needPlan,m=plan?mp:blocksMetrics(t).need,
|
|
55
|
+
/* @__PURE__ */jsxRuntime.jsx(Text2,{style:text2(m.jumpGo),children:jump.go})]});return jump.onPress?/* @__PURE__ */jsxRuntime.jsx(reactNative.Pressable,{testID:testID,onPress:jump.onPress,accessibilityRole:"button",accessibilityLabel:jump.accessibilityLabel??`${jump.kicker}, ${jump.title}`,style:({pressed:pressed})=>[...strip,pressed&&!reduced?{transform:[{scale:m.jumpPressScale}]}:null],children:inner}):/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{testID:testID,style:strip,children:inner})}function PlanNeedCard({kicker:kicker,source:source,sources:givenSources,title:title,signals:signals,score:score,more:more,quote:quote,jump:jump,variant:variant="standard",children:children,beforeJump:beforeJump,loading:loading=false,loadingLabel:loadingLabel,testID:testID,style:style}){let t=useTheme(),plan=variant==="plan",mp=blocksMetrics(t).needPlan,m=plan?mp:blocksMetrics(t).need,part2=n=>testID===void 0?void 0:`${testID}-${n}`,sources=givenSources??(source?[{label:source}]:[]),text2=p=>rnText(t,textPartSpec(t,p)),card=[rnBox(t,m.card),{marginTop:0},style];if(loading)/* @__PURE__ */
|
|
57
56
|
return jsxRuntime.jsx(reactNative.View,{testID:testID,style:card,children:/* @__PURE__ */jsxRuntime.jsx(Skeleton,{lines:3,label:loadingLabel})});let signalText=text2(m.signalText);/* @__PURE__ */
|
|
58
57
|
return jsxRuntime.jsxs(reactNative.View,{testID:testID,style:card,children:[
|
|
59
58
|
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:{flexDirection:"row",alignItems:"center",columnGap:m.kicker.gap[0],minHeight:sources.length>0?m.kicker.h:void 0},children:[
|
|
60
59
|
/* @__PURE__ */jsxRuntime.jsx(Text2,{style:text2(m.kickerText),children:kicker}),sources.length>0?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:{marginLeft:"auto",flexDirection:"row",columnGap:mp.sources.gap[0],flexShrink:1},children:sources.map((s,i)=>{let dna=s.kind==="dna";/* @__PURE__ */
|
|
61
|
-
return jsxRuntime.jsx(reactNative.View,{testID:
|
|
60
|
+
return jsxRuntime.jsx(reactNative.View,{testID:part2(givenSources?`source-${i}`:"source"),style:[rnBox(t,m.source),dna?{backgroundColor:colorOf(t,mp.sourceDna.bg)}:null,{height:m.source.h,justifyContent:"center"}],children:/* @__PURE__ */jsxRuntime.jsx(Text2,{numberOfLines:1,style:text2(dna?mp.sourceDnaText:m.sourceText),children:s.label})},`${i}-${s.label}`)})}):null]}),title?/* @__PURE__ */jsxRuntime.jsx(Text2,{accessibilityRole:"header",style:[text2(m.title),{marginTop:m.title.marginTop}],children:title}):null,signals.map(s=>/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:{flexDirection:"row",columnGap:m.signal.gap[0],marginTop:m.signal.marginTop},children:[s.dot===false?null:s.dot==="space"?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:{width:m.dot.w}}):/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:{height:signalText.lineHeight,justifyContent:"center",paddingTop:(signalText.fontSize??0)*.4-m.dot.h/2},children:/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:{width:m.dot.w,height:m.dot.h,borderRadius:m.dot.w/2,backgroundColor:colorOf(t,plan&&s.tone==="watch"?mp.dotWatch.bg:plan&&s.tone==="clear"?mp.dotClear.bg:m.dot.bg),transform:[{translateY:m.dot.dy}]}})}),
|
|
62
61
|
/* @__PURE__ */jsxRuntime.jsxs(Text2,{style:[signalText,{flex:1}],children:[s.lead?/* @__PURE__ */jsxRuntime.jsx(Text2,{style:text2(m.signalLead),children:s.lead}):null,s.lead?" ":null,s.text]})]},s.key)),plan&&more?/* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[
|
|
63
|
-
/* @__PURE__ */jsxRuntime.jsxs(reactNative.Pressable,{testID:
|
|
62
|
+
/* @__PURE__ */jsxRuntime.jsxs(reactNative.Pressable,{testID:part2("more"),onPress:more.onPress,accessibilityRole:"button",accessibilityState:{expanded:more.expanded},"aria-expanded":more.expanded,style:{flexDirection:"row",alignItems:"center",alignSelf:"flex-start",columnGap:mp.more.gap[0],minHeight:mp.more.minHeight,marginTop:mp.more.marginTop,marginBottom:mp.more.marginBottom,marginLeft:mp.moreInset},children:[
|
|
64
63
|
/* @__PURE__ */jsxRuntime.jsx(Text2,{style:text2(mp.moreText),children:more.label}),
|
|
65
|
-
/* @__PURE__ */jsxRuntime.jsx(Glyph,{icon:UI_RN_ICON_CHEVRON,size:mp.moreIcon.w,color:colorOf(t,mp.moreText.color),style:{transform:[{rotate:`${more.expanded?mp.moreTurn.open:mp.moreTurn.closed}deg`}]}})]}),more.expanded?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{testID:
|
|
66
|
-
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:{flexShrink:1,minWidth:0,maxWidth:plan&&mp.scoreLabelMax?mp.scoreLabelMax:void 0},children:/* @__PURE__ */jsxRuntime.jsxs(Text2,{style:text2(m.scoreLabel),children:[score.label,score.tag?" ":null,score.tag?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{testID:
|
|
64
|
+
/* @__PURE__ */jsxRuntime.jsx(Glyph,{icon:UI_RN_ICON_CHEVRON,size:mp.moreIcon.w,color:colorOf(t,mp.moreText.color),style:{transform:[{rotate:`${more.expanded?mp.moreTurn.open:mp.moreTurn.closed}deg`}]}})]}),more.expanded?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{testID:part2("more-panel"),nativeID:more.panelId,style:[rnBox(t,mp.rep),{marginTop:mp.rep.marginTop}],children:more.content}):null]}):null,score?/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{testID:testID===void 0?void 0:`${testID}-score`,style:[rnBox(t,m.score),{flexDirection:"row",justifyContent:"space-between",alignItems:"center"}],children:[
|
|
65
|
+
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:{flexShrink:1,minWidth:0,maxWidth:plan&&mp.scoreLabelMax?mp.scoreLabelMax:void 0},children:/* @__PURE__ */jsxRuntime.jsxs(Text2,{style:text2(m.scoreLabel),children:[score.label,score.tag?" ":null,score.tag?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{testID:part2("tag"),style:rnBox(t,m.scoreTag),children:/* @__PURE__ */jsxRuntime.jsx(Text2,{style:text2(m.scoreTagText),children:score.tag})}):null]})}),
|
|
67
66
|
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{accessible:score.accessibilityLabel!==void 0,accessibilityLabel:score.accessibilityLabel,style:{flexShrink:0,alignItems:"flex-end"},children:[
|
|
68
|
-
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:{flexDirection:"row",alignItems:"center",columnGap:m.scoreNums.gap[0]},children:[score.was?/* @__PURE__ */jsxRuntime.jsx(Text2,{style:text2(m.scoreWas),children:score.was}):null,score.was?score.icon!==void 0?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{testID:
|
|
69
|
-
/* @__PURE__ */jsxRuntime.jsxs(Text2,{style:text2(m.scoreNow),children:[score.now,score.of?/* @__PURE__ */jsxRuntime.jsx(Text2,{style:text2(m.scoreOf),children:score.of}):null]})]}),score.since?/* @__PURE__ */jsxRuntime.jsx(Text2,{style:[text2(m.scoreSince),{marginTop:m.scoreSince.marginTop}],children:score.since}):null]})]}):null,plan&"e?/* @__PURE__ */jsxRuntime.jsx(Quote,{quote:quote,m:mp,testID:
|
|
70
|
-
return jsxRuntime.jsx(reactNative.View,{testID:testID,style:card,children:/* @__PURE__ */jsxRuntime.jsx(Skeleton,{lines:3,label:loadingLabel})});let kn=kit.n,n=web?null:/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[rnBox(t,kn),{position:"absolute",left:kn.x,top:kn.y,width:kn.w,height:kn.h,alignItems:"center",justifyContent:"center"}],children:/* @__PURE__ */jsxRuntime.jsx(Text2,{style:text2(kit.nText),children:number})}),titleText=/* @__PURE__ */jsxRuntime.jsx(Text2,{style:text2(web?w.title:kit.title),children:title}),cover=onPress!==void 0&&(web||pressTarget==="card"),
|
|
67
|
+
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:{flexDirection:"row",alignItems:"center",columnGap:m.scoreNums.gap[0]},children:[score.was?/* @__PURE__ */jsxRuntime.jsx(Text2,{style:text2(m.scoreWas),children:score.was}):null,score.was?score.icon!==void 0?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{testID:part2("arrow"),children:/* @__PURE__ */jsxRuntime.jsx(BlockIcon,{icon:score.icon,size:m.scoreArrow.w,color:colorOf(t,m.scoreArrow.color)})}):/* @__PURE__ */jsxRuntime.jsx(Glyph,{testID:part2("arrow"),icon:UI_RN_ICON_ARROW_LEFT,size:m.scoreArrow.w,color:colorOf(t,m.scoreArrow.color),style:m.scoreArrowFlip?{transform:[{rotate:"180deg"}]}:void 0}):null,
|
|
68
|
+
/* @__PURE__ */jsxRuntime.jsxs(Text2,{style:text2(m.scoreNow),children:[score.now,score.of?/* @__PURE__ */jsxRuntime.jsx(Text2,{style:text2(m.scoreOf),children:score.of}):null]})]}),score.since?/* @__PURE__ */jsxRuntime.jsx(Text2,{style:[text2(m.scoreSince),{marginTop:m.scoreSince.marginTop}],children:score.since}):null]})]}):null,plan&"e?/* @__PURE__ */jsxRuntime.jsx(Quote,{quote:quote,m:mp,testID:part2("quote")}):null,plan?beforeJump:null,plan&&jump?/* @__PURE__ */jsxRuntime.jsx(Jump,{jump:jump,m:mp,testID:part2("jump")}):null,children]})}function rnSource3(image){return typeof image=="number"?image:typeof image=="string"?image?{uri:image}:null:image&&typeof image=="object"&&image.uri?image:null}function TipCard(props){let{number:number,title:title,text:line,foot:foot,footArrow:footArrow=false,footPress:footPress,tone:tone="y",image:image,onImageError:onImageError,icon:icon=UI_RN_ICON_LEAF,onPress:onPress,pressTarget:pressTarget="title",accessibilityLabel:accessibilityLabel,variant:variant="standard",loading:loading=false,loadingLabel:loadingLabel,testID:testID,style:style}=props,t=useTheme(),reduced=useRnReduced(t),m=blocksMetrics(t).tip,ph=blocksMetrics(t).tipPhoto,w=blocksMetrics(t).tipWeb,pl=blocksMetrics(t).tipPlan,web=variant==="web",photo=variant==="photo",plan=variant==="plan",[down,setDown]=react.useState(false),[failed,setFailed]=react.useState(null),text2=p=>rnText(t,textPartSpec(t,p)),kit=photo?{...m,card:ph.card,tones:ph.tones,img:ph.img,n:ph.n,nText:ph.nText,title:ph.title,pressScale:ph.pressScale,bare:ph.bare,thumb:ph.thumb,thumbIcon:ph.thumbIcon}:plan?{...m,card:pl.card,tones:pl.tones,title:pl.title,text:pl.text,footText:pl.footText,foot:pl.foot,pressScale:1}:m,card=web?[rnBox(t,w.card),style]:[rnBox(t,kit.card),{backgroundColor:colorOf(t,kit.tones[tone])},style],aspect=web?w.imgAspect:photo?ph.imgAspect:m.img.w/m.img.h,press=web?1:kit.pressScale;if(loading)/* @__PURE__ */
|
|
69
|
+
return jsxRuntime.jsx(reactNative.View,{testID:testID,style:card,children:/* @__PURE__ */jsxRuntime.jsx(Skeleton,{lines:3,label:loadingLabel})});let kn=kit.n,n=web?null:/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[rnBox(t,kn),{position:"absolute",left:kn.x,top:kn.y,width:kn.w,height:kn.h,alignItems:"center",justifyContent:"center"}],children:/* @__PURE__ */jsxRuntime.jsx(Text2,{style:text2(kit.nText),children:number})}),titleText=/* @__PURE__ */jsxRuntime.jsx(Text2,{style:text2(web?w.title:kit.title),children:title}),cover=onPress!==void 0&&(web||pressTarget==="card"),part2=n2=>testID===void 0?void 0:`${testID}-${n2}`,given=plan?null:rnSource3(image),source=given&&failed!==image?given:null,footStyle=text2(kit.footText),arrow=footArrow||footPress?/* @__PURE__ */jsxRuntime.jsx(Glyph,{icon:UI_RN_ICON_ARROW_LEFT,size:m.footArrow.w,color:typeof footStyle.color=="string"?footStyle.color:void 0,style:m.footArrowFlip?{transform:[{rotate:"180deg"}]}:void 0}):null,footText=/* @__PURE__ */jsxRuntime.jsx(Text2,{style:footStyle,children:foot}),footRow={flexDirection:"row",alignItems:"center",columnGap:m.foot.gap[0]},footEl=foot&&!web&&!photo?footPress?/* @__PURE__ */jsxRuntime.jsxs(reactNative.Pressable,{testID:footPress.testID??part2("foot"),onPress:footPress.onPress,accessibilityRole:"link",accessibilityLabel:footPress.accessibilityLabel??foot,hitSlop:slopFor(footStyle.lineHeight??m.footArrow.w),style:[footRow,{marginTop:"auto",paddingTop:kit.foot.padding[0],alignSelf:"flex-start",zIndex:1}],children:[footText,arrow]}):arrow?/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:[footRow,{marginTop:"auto",paddingTop:kit.foot.padding[0]}],children:[footText,arrow]}):/* @__PURE__ */jsxRuntime.jsx(Text2,{style:[footStyle,{marginTop:"auto",paddingTop:kit.foot.padding[0]}],children:foot}):null,failOn=()=>{image!=null&&(setFailed(image),onImageError?.(image))},thumbIcon=spec=>/* @__PURE__ */jsxRuntime.jsx(BlockIcon,{icon:icon,size:spec.w,color:colorOf(t,spec.color)}),top=plan?/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants",style:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",minHeight:pl.top.h},children:[
|
|
71
70
|
/* @__PURE__ */jsxRuntime.jsx(Text2,{style:text2(pl.nText),children:number}),
|
|
72
|
-
/* @__PURE__ */jsxRuntime.jsx(BlockIcon,{icon:icon,size:pl.icon.w,color:colorOf(t,pl.icon.color)})]}):!web&&!source?/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{testID:
|
|
71
|
+
/* @__PURE__ */jsxRuntime.jsx(BlockIcon,{icon:icon,size:pl.icon.w,color:colorOf(t,pl.icon.color)})]}):!web&&!source?/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{testID:part2("thumb"),accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants",style:[rnBox(t,kit.bare),{flexDirection:"row",justifyContent:"space-between",alignItems:"center"}],children:[
|
|
73
72
|
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[rnBox(t,kn),{width:kn.w,height:kn.h,alignItems:"center",justifyContent:"center"}],children:/* @__PURE__ */jsxRuntime.jsx(Text2,{style:text2(kit.nText),children:number})}),
|
|
74
|
-
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[rnBox(t,kit.thumb),{width:kit.thumb.w,height:kit.thumb.h,alignItems:"center",justifyContent:"center"}],children:thumbIcon(kit.thumbIcon)})]}):/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants",style:[rnBox(t,web?w.img:kit.img),{width:"100%",aspectRatio:aspect,overflow:"hidden"}],children:[source?/* @__PURE__ */jsxRuntime.jsx(FadeImage,{testID:
|
|
73
|
+
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[rnBox(t,kit.thumb),{width:kit.thumb.w,height:kit.thumb.h,alignItems:"center",justifyContent:"center"}],children:thumbIcon(kit.thumbIcon)})]}):/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants",style:[rnBox(t,web?w.img:kit.img),{width:"100%",aspectRatio:aspect,overflow:"hidden"}],children:[source?/* @__PURE__ */jsxRuntime.jsx(FadeImage,{testID:part2("image"),source:source,resizeMode:"cover",onError:failOn,style:{position:"absolute",top:0,right:0,bottom:0,left:0}},typeof image=="string"?image:JSON.stringify(image)):null,n]}),body=/* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[top,
|
|
75
74
|
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:web?null:{marginTop:kit.title.marginTop,marginHorizontal:photo?ph.titleInset:0},children:onPress&&!cover?/* @__PURE__ */jsxRuntime.jsx(reactNative.Pressable,{onPress:onPress,accessibilityRole:"button",accessibilityLabel:title,children:titleText}):titleText}),line&&!web&&!photo?/* @__PURE__ */jsxRuntime.jsx(Text2,{style:[text2(kit.text),{marginTop:kit.text.marginTop}],children:line}):null,footEl]});return cover&&footPress?/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{testID:testID,style:[...card,down&&!reduced?{transform:[{scale:press}]}:null],children:[body,
|
|
76
|
-
/* @__PURE__ */jsxRuntime.jsx(reactNative.Pressable,{testID:part("cover"),onPress:onPress,onPressIn:()=>setDown(true),onPressOut:()=>setDown(false),accessibilityRole:"button",accessibilityLabel:accessibilityLabel??title,style:{position:"absolute",top:0,right:0,bottom:0,left:0}})]}):cover?/* @__PURE__ */jsxRuntime.jsx(reactNative.Pressable,{testID:testID,onPress:onPress,accessibilityRole:"button",accessibilityLabel:accessibilityLabel??title,style:({pressed:pressed})=>[...card,pressed&&!reduced&&press!==1?{transform:[{scale:press}]}:null],children:body}):/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{testID:testID,style:card,children:body})}var DESIGN_V3_LIGHT=/* @__PURE__ */Object.freeze({ink:"#262523",ink2:"#4A4845",ink3:"#6B6863",paper:"#F8F7F4",card:"#FFFFFF",line:"#E7E6E2",tile:"#F2F1EE",shadow:"rgba(38, 37, 35, .07)",riskBg:"#FFE3E1",riskInk:"#B0231B",riskDot:"#E5372B",clearBg:"#E6F4D3",clearInk:"#2F6A12",clearDot:"#5FA82B",watchDot:"#E5A000"}),cache3=/* @__PURE__ */new WeakMap;function v3Palette(theme){let hit=cache3.get(theme);if(hit!==void 0)return hit;let c=theme.color,dark=theme.brightness==="dark",neutrals=dark?{dark:dark,ink:c.text.primary,ink2:c.text.secondary,ink3:c.text.muted,paper:c.background,card:c.surface,line:c.borderRingCream,tile:c.surfaceSubtle,shadow:c.shadow,riskBg:c.badgeBgCritical,riskInk:c.danger,riskDot:c.danger,clearBg:c.badgeBgPositive,clearInk:c.success,clearDot:c.success,watchDot:c.warningStrong}:{dark:dark,...DESIGN_V3_LIGHT},textOn=(ink,grounds)=>pushToContrast(ink,grounds,poleForGrounds(grounds),V3_TEXT_CONTRAST),labelOn=(ink,fill)=>contrastRatio(ink,fill)>=V3_TEXT_CONTRAST?ink:legibleOn(fill,V3_TEXT_CONTRAST),badgeGrounds=[neutrals.card,neutrals.paper].map(under=>flattenOnto(c.brandSoft,under)??under),brand={primary:c.primary,onPrimary:labelOn(c.onPrimary,c.primary),accent:c.accent,onAccent:labelOn(c.onAccent,c.accent),link:textOn(c.linkInk,[neutrals.card,neutrals.paper,neutrals.tile]),badge:c.brandSoft,onBadge:textOn(c.brandInk,badgeGrounds)},palette=/* @__PURE__ */Object.freeze({...neutrals,...brand});return cache3.set(theme,palette),palette}var V3_TEXT_CONTRAST=4.5;var GRAB="#DAD7D1";function planDsInput(p,outline=false){let r=role=>p.roles[role]??role,neutral=hex=>p.dark?r("line"):hex,box=(bg,extra={})=>({bg:bg,...extra}),words2=color=>({color:color}),noShadow={color:"",x:0,y:0,blur:0,spread:0},plan=Object.fromEntries(Object.entries({planInk:"primary",planOnInk:"onPrimary",planAccent:"accent",planLink:"link",planAccentWash:"accent4",planAccentChip:"accentChip",planLinkWash:"linkWash",planLinkChip:"linkChip"}).flatMap(([k2,role])=>p.roles[role]===void 0?[]:[[k2,p.roles[role]]]));return{colors:{bg:r("paper"),surface:r("card"),text:r("black"),ink:r(outline?"ink":"primary"),onInk:r("onPrimary"),muted:r("ink3"),line:r("line"),scrim:r("scrim"),grab:neutral(GRAB),focus:r("ink"),...plan},type:p.type,motion:{reduced:p.reduced},metrics:{variants:{drawer:{frame:box(r("card"),{color:r("ink")}),grab:box(neutral(GRAB)),kicker:words2(r("ink3")),close:{color:r("ink")},title:{color:r("ink"),wrap:"auto"},text:words2(r("black")),scrim:r("scrim")},segmented:{track:box(r("card"),{edge:{color:neutral(GRAB)}}),label:words2(r("ink")),chosen:box(r("primary")),chosenLabel:words2(r("onPrimary"))},stepper:{track:box(r("card"),{edge:{color:neutral(GRAB)}}),button:{color:r("ink")},value:words2(r("ink"))},summary:{box:box(r("card"),p.dark?{shadow:noShadow}:{}),term:words2(r("ink2")),value:words2(r("ink")),totalTerm:words2(r("ink")),total:words2(r("ink")),renewTerm:words2(r("ink2")),renew:words2(r("ink")),inset:box(r("paper"))},toast:{box:box(r("ink")),text:words2(r("onInk"))},focus:{color:r("ink")}}}}}var caches=/* @__PURE__ */new WeakMap;function planDsTheme(key,preset,input,outline=false){let byPreset=caches.get(preset);byPreset===void 0&&(byPreset={fill:/* @__PURE__ */new WeakMap,outline:/* @__PURE__ */new WeakMap},caches.set(preset,byPreset));let cache6=byPreset[outline?"outline":"fill"],t=cache6.get(key);return t===void 0&&(t=resolveTheme(planDsInput(input(),outline),preset),cache6.set(key,t)),t}var rnBlockFonts=theme=>{let n=theme.type.namedFaces,family=key=>face(theme,key).fontFamily;return{family:family("regular"),mono:family("mono"),faces:{regular:family("regular"),medium:family("medium"),bold:family("bold"),mono:family("mono"),monoBold:family("monoBold"),serif:headingFace(theme,"bold").fontFamily},namedFaces:n.regular&&n.medium&&n.bold}},mapped=/* @__PURE__ */new WeakMap;function themeInputFromEverfur(theme,fonts,base3=everfurTheme){if(base3!==everfurTheme)return mapEverfur(theme,fonts,base3);let byTheme=mapped.get(fonts);byTheme===void 0&&mapped.set(fonts,byTheme=/* @__PURE__ */new WeakMap);let input=byTheme.get(theme);return input===void 0&&byTheme.set(theme,input=mapEverfur(theme,fonts,base3)),input}function mapEverfur(theme,fonts,base3){let c=theme.color,d=EVERFUR_LIGHT.color,dark=theme.brightness==="dark",compiled=dark?EVERFUR_DARK:EVERFUR_LIGHT,moved=key=>c[key]!==d[key],colors={};if(moved("primary")?(Object.assign(colors,{ink:c.primary,onInk:c.onPrimary,focus:c.primary}),moved("accent")||Object.assign(colors,{go:c.primary,onGo:c.onPrimary})):moved("onPrimary")&&(colors.onInk=c.onPrimary),moved("accent")&&Object.assign(colors,{go:c.accent,onGo:c.onAccent}),moved("brandSoft")&&(colors.tintSage=c.brandSoft),moved("danger")&&Object.assign(colors,{alert:c.danger,alertDeep:c.danger}),dark)Object.assign(colors,{bg:c.background,surface:c.surface,text:c.text.primary,muted:c.text.muted,line:c.borderRingCream});else{let k2=compiled.color;c.background!==k2.background&&(colors.bg=c.background),c.surface!==k2.surface&&(colors.surface=c.surface),c.text.primary!==k2.text.primary&&(colors.text=c.text.primary),c.text.muted!==k2.text.muted&&(colors.muted=c.text.muted)}let over={};Object.keys(colors).length>0&&(over.colors={...colors});let r=theme.radius,kr=compiled.radius;if(r.xs!==kr.xs||r.sm!==kr.sm||r.lg!==kr.lg||r.xl!==kr.xl||r.pill!==kr.pill){let radius={};r.xs!==kr.xs&&(radius.sm=r.xs),r.sm!==kr.sm&&(radius.md=r.sm),r.lg!==kr.lg&&(radius.lg=r.lg),r.xl!==kr.xl&&(radius.xl=r.xl),r.pill!==kr.pill&&(radius.pill=r.pill),over.radius=radius,(r.lg!==kr.lg||r.xl!==kr.xl)&&(over.metrics={...r.lg!==kr.lg?{card:{radius:r.lg},summary:{radius:r.lg}}:{},...r.xl!==kr.xl?{sheet:{radius:r.xl}}:{}})}if(theme.space.xs!==compiled.space.xs){let f=theme.space.xs/compiled.space.xs,s=base3.space,n=v=>Math.round(v*f);over.space={1:n(s[1]),2:n(s[2]),3:n(s[3]),4:n(s[4]),5:n(s[5]),6:n(s[6]),7:n(s[7]),8:n(s[8]),9:n(s[9])}}let ts=theme.type.size,ks=compiled.type.size,sizeMoved=ts.caption!==ks.caption||ts.bodyTight!==ks.bodyTight||ts.body!==ks.body||ts.subtitle!==ks.subtitle||ts.verdict!==ks.verdict,lh=theme.type.lineHeight,klh=compiled.type.lineHeight,lineMoved=lh.relaxed!==klh.relaxed||lh.tight!==klh.tight,caps=theme.type.scaleCaps,kcaps=compiled.type.scaleCaps,capsMoved=caps.content!==kcaps.content||caps.heading!==kcaps.heading||caps.control!==kcaps.control||caps.compact!==kcaps.compact||caps.badge!==kcaps.badge,typeMoved=sizeMoved||lineMoved||capsMoved;over.type={...sizeMoved?{size:{xs:ts.caption,sm:ts.bodyTight,md:ts.body,lg:ts.subtitle,xl:ts.verdict}}:{},...lineMoved?{lineHeight:{body:lh.relaxed,display:lh.tight}}:{},...capsMoved?{scaleCaps:{content:caps.content,heading:caps.heading,control:caps.control,compact:caps.compact,badge:caps.badge}}:{},...fonts(theme)},theme.motion.reducedMotion&&!base3.motion.reduced&&(over.motion={reduced:true});let branded=typeMoved||Object.keys(colors).length>0||Object.keys(over).some(k2=>k2!=="type"&&k2!=="colors")||theme.type.families.regular!==EVERFUR_LIGHT.type.families.regular,plan=planColors(theme,compiled,colors.surface??base3.colors.surface),ownPlan=Object.entries(plan).filter(([k2,v])=>v!==base3.colors[k2]);return ownPlan.length>0&&(over.colors={...colors,...Object.fromEntries(ownPlan)}),branded?{name:"partner",...over}:over}var DS_PLAN={planAccent:everfurTheme.colors.planAccent,planLink:everfurTheme.colors.planLink},PLAN_WASHES2={planAccentWash:["accent",.17],planAccentChip:["accent",.47],planLinkWash:["link",.12],planLinkChip:["link",.2]};function planColors(theme,compiled,surface){let v=v3Palette(theme),k2=v3Palette(compiled),c=theme.color,out={};(c.primary!==compiled.color.primary||c.onPrimary!==compiled.color.onPrimary)&&Object.assign(out,{planInk:c.primary,planOnInk:v.onPrimary}),c.accent!==compiled.color.accent&&(out.planAccent=c.accent),v.link!==k2.link&&(out.planLink=v.link);let ink={accent:out.planAccent??DS_PLAN.planAccent,link:out.planLink??DS_PLAN.planLink},slot={planLinkWash:v.dark?void 0:theme.slots.planWash?.backgroundColor,planLinkChip:v.dark?void 0:theme.slots.planChip?.backgroundColor},ownCard=surface.toLowerCase()!==v.card.toLowerCase();for(let[key,[from,share]]of Object.entries(PLAN_WASHES2)){let given=slot[key];given!==void 0?out[key]=given:ownCard&&(out[key]=mixColor(ink[from],share,v.card,v.card))}return out}function useBlockThemeInput(fonts){let everfur=useEverfurTheme();return react.useMemo(()=>themeInputFromEverfur(everfur,fonts),[everfur,fonts])}function rnPlanDsTheme(theme,roles){return planDsTheme(theme,everfurTheme,()=>({roles:roles,dark:v3Palette(theme).dark,type:{...rnBlockFonts(theme),scaleCaps:theme.type.scaleCaps},reduced:theme.motion.reducedMotion}))}function PlanDs(props){return react.createElement(ThemeProvider,{theme:props.theme},props.children)}var DESIGN_RN_PLAN=/* @__PURE__ */Object.freeze({root:{backgroundColor:"$paper",color:"$ink",fontFamily:"sans",fontSize:17,lineHeight:25.5,paddingBottom:28,paddingLeft:16,paddingRight:16,paddingTop:16},pageFine:{color:"$ink3",fontFamily:"sans",fontSize:12.5,lineHeight:18.13,marginBottom:0,marginLeft:0,marginRight:0,marginTop:16,textAlign:"center"},tools:{alignItems:"center",color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:8,justifyContent:"space-between",lineHeight:25.5,marginBottom:2,marginLeft:2,marginRight:-6,marginTop:-8},toolsEyebrow:{color:"$ink3",fontFamily:"mono",fontSize:11,letterSpacing:.77,lineHeight:16.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0,textTransform:"uppercase"},toolsEnd:{alignItems:"center",color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:2,lineHeight:25.5},orders:{alignItems:"center",alignSelf:"flex-start",backgroundColor:"transparent",borderRadius:999,color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:15,fontWeight:"700",gap:6,lineHeight:22.5,minHeight:44,paddingBottom:0,paddingLeft:8,paddingRight:8,paddingTop:0},ordersIcon:{height:21,width:21},cart:{alignItems:"center",backgroundColor:"transparent",borderRadius:22,color:"$ink",fontFamily:"sans",fontSize:17,height:44,justifyContent:"center",lineHeight:25.5,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0,position:"relative",width:44},cartIcon:{height:26,width:26},cartCount:{backgroundColor:"$riskDot",borderRadius:999,color:"$card",fontFamily:"sans",fontSize:12,fontVariant:["tabular-nums"],fontWeight:"800",height:20,lineHeight:20,minWidth:20,paddingBottom:0,paddingLeft:5,paddingRight:5,paddingTop:0,position:"absolute",right:1,ring:[{width:2,color:"$paper"}],textAlign:"center",top:3},head:{alignItems:"center",color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:12,grid:["fr",56],lineHeight:25.5,paddingBottom:0,paddingLeft:2,paddingRight:2,paddingTop:2},eyebrow:{color:"$ink3",fontFamily:"mono",fontSize:11,letterSpacing:.77,lineHeight:16.5,marginBottom:6,marginLeft:0,marginRight:0,marginTop:0,textTransform:"uppercase"},title:{color:"$ink",fontFamily:"serif",fontSize:29,fontWeight:"800",letterSpacing:-.29,lineHeight:30.74,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0},subtitle:{color:"$ink2",fontFamily:"sans",fontSize:15,lineHeight:22.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:6},headImage:{backgroundColor:"$tile",borderRadius:28,height:56,ring:[{width:3,color:"$paper"},{width:5.5,color:"$accent"}],width:56},by:{alignItems:"center",backgroundColor:"$card",borderRadius:16,color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:10,grid:[40,"fr",22],lineHeight:25.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:14,paddingBottom:10,paddingLeft:12,paddingRight:12,paddingTop:10,shadow:{x:0,y:1,blur:3,color:"#262523",opacity:.06}},byImage:{backgroundColor:"$tile",borderRadius:20,height:40,width:40},byName:{color:"$ink",fontFamily:"sans",fontSize:15,fontWeight:"800",lineHeight:18.75},byRole:{color:"$ink3",fontFamily:"mono",fontSize:10.5,letterSpacing:.53,lineHeight:15.75,marginTop:2,textTransform:"uppercase"},byOk:{color:"$link",height:22,width:22},need:{backgroundColor:"$card",borderRadius:22,color:"$ink",fontFamily:"sans",fontSize:17,lineHeight:25.5,marginTop:14,paddingBottom:16,paddingLeft:16,paddingRight:16,paddingTop:16,shadow:{x:0,y:1,blur:3,color:"#262523",opacity:.06}},needKicker:{alignItems:"center",color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:15,fontWeight:"800",gap:8,lineHeight:22.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0},sources:{color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:15,fontWeight:"800",gap:4,lineHeight:22.5,marginLeft:"auto"},source:{alignItems:"center",alignSelf:"flex-start",backgroundColor:"$tile",borderRadius:999,color:"$ink2",flexDirection:"row",fontFamily:"sans",fontSize:12,fontWeight:"700",height:24,lineHeight:18,paddingBottom:0,paddingLeft:9,paddingRight:9,paddingTop:0},sourceDna:{backgroundColor:"$linkWash",color:"$link"},needTitle:{color:"$ink",fontFamily:"sans",fontSize:19,fontWeight:"800",lineHeight:23.18,marginBottom:0,marginLeft:0,marginRight:0,marginTop:12},needRisk:{alignItems:"baseline",color:"$ink2",flexDirection:"row",fontFamily:"sans",fontSize:15,gap:9,grid:[9,"fr"],lineHeight:21.75,marginBottom:0,marginLeft:0,marginRight:0,marginTop:6},needRiskLead:{color:"$ink",fontFamily:"sans",fontSize:15,fontWeight:"800",lineHeight:21.75},dot:{alignSelf:"flex-start",borderRadius:4.5,flexGrow:0,flexShrink:0,height:9,width:9},dotRisk:{backgroundColor:"$riskDot"},odds:{alignItems:"center",backgroundColor:"$accent4",borderRadius:14,color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:12,justifyContent:"space-between",lineHeight:25.5,marginTop:12,paddingBottom:10,paddingLeft:14,paddingRight:14,paddingTop:10},oddsKicker:{color:"$ink2",fontFamily:"sans",fontSize:13.5,fontWeight:"600",lineHeight:18.23,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0,maxWidth:135},oddsTag:{alignSelf:"flex-start",backgroundColor:"$card",borderRadius:5,color:"$ink",fontFamily:"mono",fontSize:10,fontWeight:"600",letterSpacing:.6,lineHeight:13.5,marginTop:3,paddingBottom:2,paddingLeft:6,paddingRight:6,paddingTop:2,textTransform:"uppercase"},oddsNumbers:{alignItems:"center",color:"$ink",columnGap:6,flexDirection:"row",fontFamily:"sans",fontSize:17,grid:["auto","auto","auto"],justifyItems:"flex-end",lineHeight:25.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0,rowGap:0},oddsFrom:{color:"$ink3",fontFamily:"sans",fontSize:17,fontWeight:"700",lineHeight:25.5,textDecorationLine:"line-through"},oddsIcon:{color:"$ink3",height:16,width:16},oddsTo:{color:"$ink",fontFamily:"serif",fontSize:28,fontWeight:"800",lineHeight:28},oddsLabel:{color:"$link",fontFamily:"sans",fontSize:12.5,fontWeight:"700",lineHeight:18.75,marginTop:3},says:{alignItems:"flex-start",backgroundColor:"$paper",borderRadius:14,color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:10,grid:[32,"fr"],lineHeight:25.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:12,paddingBottom:10,paddingLeft:12,paddingRight:12,paddingTop:10},saysImage:{borderRadius:16,height:32,width:32},saysText:{color:"$ink2",fontFamily:"sans",fontSize:14.5,lineHeight:20.3,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0},saysBy:{color:"$ink",fontFamily:"sans",fontSize:14.5,fontWeight:"800",lineHeight:20.3,marginRight:2},saysSerif:{color:"$ink",fontFamily:"serif",fontSize:17,fontWeight:"800",letterSpacing:-.17,lineHeight:25.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0},tag:{backgroundColor:"$card",borderRadius:5,color:"$ink",fontFamily:"mono",fontSize:10,letterSpacing:.6,lineHeight:14,paddingBottom:2,paddingLeft:6,paddingRight:6,paddingTop:2,textTransform:"uppercase"},jump:{alignItems:"center",backgroundColor:"$primary",borderRadius:14,color:"$onPrimary",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:12,grid:[44,"fr","auto"],lineHeight:25.5,marginTop:12,paddingBottom:8,paddingLeft:8,paddingRight:14,paddingTop:8,textAlign:"left",width:"100%"},jumpNoImage:{grid:["fr","auto"]},jumpImage:{backgroundColor:"$card",borderRadius:10,height:44,width:44},jumpSmall:{color:"$accent",fontFamily:"sans",fontSize:13,fontWeight:"800",lineHeight:19.5,textAlign:"left"},jumpStrong:{color:"$onPrimary",fontFamily:"sans",fontSize:15,fontWeight:"800",lineHeight:18.75,textAlign:"left"},jumpGo:{color:"$onPrimary",fontFamily:"sans",fontSize:14,fontWeight:"800",lineHeight:21,textAlign:"left"},steps:{backgroundColor:"$card",borderRadius:22,color:"$ink",fontFamily:"sans",fontSize:17,lineHeight:25.5,marginTop:14,paddingBottom:12,paddingLeft:12,paddingRight:12,paddingTop:16,shadow:{x:0,y:1,blur:3,color:"#262523",opacity:.06}},stepsHead:{alignItems:"baseline",color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:12,justifyContent:"space-between",lineHeight:25.5,paddingBottom:0,paddingLeft:4,paddingRight:4,paddingTop:0},stepsTitle:{alignItems:"center",color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:19,fontWeight:"800",gap:10,lineHeight:22.8,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0},stepsLabel:{color:"$ink3",fontFamily:"mono",fontSize:11,letterSpacing:.55,lineHeight:16.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0,textTransform:"uppercase"},n:{alignItems:"center",backgroundColor:"$primary",borderRadius:12,color:"$onPrimary",flexGrow:0,flexShrink:0,fontFamily:"sans",fontSize:12.5,fontWeight:"800",height:24,justifyContent:"center",lineHeight:15,width:24},tips:{color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:10,lineHeight:25.5,marginBottom:0,marginLeft:-12,marginRight:-12,marginTop:10,paddingBottom:2,paddingLeft:12,paddingRight:12,paddingTop:0},tip:{borderRadius:18,color:"$ink",flexBasis:"78%",flexDirection:"column",flexGrow:0,flexShrink:0,fontFamily:"sans",fontSize:17,lineHeight:25.5,maxWidth:280,paddingBottom:12,paddingLeft:14,paddingRight:14,paddingTop:14},tipY:{backgroundColor:"$accentChip"},tipC:{backgroundColor:"$linkChip"},tipG:{backgroundColor:"$clearChip"},tipR:{backgroundColor:"$riskChip"},tipTop:{alignItems:"center",color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,justifyContent:"space-between",lineHeight:25.5},tipIcon:{color:"$ink",height:26,width:26},tipN:{color:"$ink",fontFamily:"serif",fontSize:30,fontWeight:"900",lineHeight:30},tipStrong:{color:"$ink",fontFamily:"sans",fontSize:17,fontWeight:"800",lineHeight:21.25,marginTop:14},tipSmall:{color:"$ink2",fontFamily:"sans",fontSize:14.5,lineHeight:20.3,marginTop:4},tipEm:{color:"$link",fontFamily:"mono",fontSize:10.5,fontStyle:"normal",letterSpacing:.42,lineHeight:15.75,marginTop:"auto",paddingTop:10,textTransform:"uppercase"},sec:{backgroundColor:"$card",borderRadius:22,color:"$ink",fontFamily:"sans",fontSize:17,lineHeight:25.5,marginTop:14,paddingBottom:16,paddingLeft:16,paddingRight:16,paddingTop:16,shadow:{x:0,y:1,blur:3,color:"#262523",opacity:.06}},secTitle:{alignItems:"center",color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:19,fontWeight:"800",gap:10,lineHeight:22.8,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0},secN:{alignItems:"center",backgroundColor:"$primary",borderRadius:12,color:"$onPrimary",flexGrow:0,flexShrink:0,fontFamily:"sans",fontSize:12.5,fontWeight:"800",height:24,justifyContent:"center",lineHeight:15,width:24},pick:{backgroundColor:"transparent",borderRadius:16,color:"$ink",fontFamily:"sans",fontSize:17,lineHeight:25.5,marginTop:14,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0},pickTop:{alignItems:"center",color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:12,grid:[76,"fr"],lineHeight:25.5},pickImage:{backgroundColor:"$paper",borderRadius:14,height:76,overflow:"hidden",width:76},pickTitle:{color:"$ink",fontFamily:"sans",fontSize:17,fontWeight:"800",lineHeight:20.4,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0},stars:{alignItems:"center",color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:13.5,fontWeight:"800",gap:4,lineHeight:20.25,marginBottom:0,marginLeft:0,marginRight:0,marginTop:2},starsIcon:{color:"$watchDot",height:14,width:14},starsLabel:{color:"$ink3",fontFamily:"sans",fontSize:13.5,fontWeight:"500",lineHeight:20.25},pickLine:{color:"$ink2",fontFamily:"sans",fontSize:14,lineHeight:19.6,marginBottom:0,marginLeft:0,marginRight:0,marginTop:3},reviews:{color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:10,lineHeight:25.5,marginBottom:0,marginLeft:-16,marginRight:-16,marginTop:12,paddingBottom:0,paddingLeft:16,paddingRight:16,paddingTop:0},review:{backgroundColor:"$paper",borderRadius:14,color:"$ink",flexBasis:"78%",flexGrow:0,flexShrink:0,fontFamily:"sans",fontSize:17,lineHeight:25.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0,maxWidth:280,paddingBottom:12,paddingLeft:14,paddingRight:14,paddingTop:12},reviewStars:{color:"$watchDot",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:1,lineHeight:25.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0},reviewStar:{height:13,width:13},reviewText:{color:"$ink",fontFamily:"sans",fontSize:15,lineHeight:21,marginBottom:0,marginLeft:0,marginRight:0,marginTop:5},reviewBy:{color:"$ink3",fontFamily:"sans",fontSize:13,lineHeight:19.5,marginTop:4},why:{borderRadius:16,color:"$ink",fontFamily:"sans",fontSize:17,inner:{width:1.5,color:"$ink"},lineHeight:25.5,marginTop:14,paddingBottom:12,paddingLeft:14,paddingRight:14,paddingTop:12},whyMini:{color:"$ink3",fontFamily:"mono",fontSize:10.5,letterSpacing:.63,lineHeight:15.75,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0,textTransform:"uppercase"},whyList:{color:"$ink",fontFamily:"sans",fontSize:17,lineHeight:25.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0},whyRow:{alignItems:"flex-start",color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:10,grid:[58,"fr"],lineHeight:25.5,marginTop:10},whyStrong:{color:"$ink",fontFamily:"sans",fontSize:15,fontWeight:"800",lineHeight:19.5},whySmall:{color:"$ink2",fontFamily:"sans",fontSize:14,lineHeight:19.6,marginTop:1},chip:{alignItems:"center",borderRadius:6,color:"$ink",fontFamily:"mono",fontSize:10.5,fontWeight:"700",height:22,justifyContent:"center",letterSpacing:.42,lineHeight:15.75,textTransform:"uppercase"},chipDna:{backgroundColor:"$linkWash",color:"$link"},chipAsk:{backgroundColor:"$accent4",color:"$ink"},chipRec:{backgroundColor:"$tile",color:"$ink2"},score:{alignItems:"center",backgroundColor:"$primary",borderRadius:12,color:"$onPrimary",flexDirection:"row",fontFamily:"sans",fontSize:14.5,fontWeight:"800",gap:8,justifyContent:"space-between",lineHeight:18.85,marginBottom:0,marginLeft:0,marginRight:0,marginTop:12,paddingBottom:11,paddingLeft:14,paddingRight:12,paddingTop:11},scoreValue:{color:"$accent",flexGrow:0,flexShrink:0,fontFamily:"mono",fontSize:16,fontWeight:"700",lineHeight:20.8},dose:{backgroundColor:"$linkWash",borderRadius:16,color:"$ink",fontFamily:"sans",fontSize:17,lineHeight:25.5,marginTop:10,paddingBottom:14,paddingLeft:14,paddingRight:14,paddingTop:12},doseMini:{color:"$link",fontFamily:"mono",fontSize:10.5,letterSpacing:.63,lineHeight:15.75,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0,textTransform:"uppercase"},doseList:{color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:8,grid:["fr","fr","fr"],lineHeight:25.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:10,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0},doseItem:{alignItems:"center",backgroundColor:"$card",borderRadius:12,color:"$ink",fontFamily:"sans",fontSize:17,gap:2,lineHeight:25.5,paddingBottom:10,paddingLeft:4,paddingRight:4,paddingTop:10,textAlign:"center"},doseValue:{color:"$ink",fontFamily:"mono",fontSize:21,fontVariant:["tabular-nums"],fontWeight:"700",lineHeight:23.1,textAlign:"center"},doseLabel:{color:"$ink2",fontFamily:"sans",fontSize:12.5,lineHeight:16.25,textAlign:"center"},doseNote:{color:"$link",fontFamily:"sans",fontSize:14,lineHeight:20.3,marginBottom:0,marginLeft:0,marginRight:0,marginTop:10},ingredients:{color:"$ink",flexDirection:"row",flexWrap:"wrap",fontFamily:"sans",fontSize:17,gap:6,lineHeight:25.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:12},ingredient:{backgroundColor:"$tile",borderRadius:999,color:"$ink",fontFamily:"sans",fontSize:13.5,fontWeight:"600",lineHeight:20.25,paddingBottom:6,paddingLeft:10,paddingRight:10,paddingTop:6},opts:{color:"$ink",fontFamily:"sans",fontSize:17,gap:8,lineHeight:25.5,marginTop:14},opt:{alignItems:"center",backgroundColor:"$card",borderRadius:16,color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:12,inner:{width:1.5,color:"$n_DEDCD7"},justifyContent:"space-between",lineHeight:25.5,paddingBottom:14,paddingLeft:14,paddingRight:14,paddingTop:14,textAlign:"left",width:"100%"},optOn:{inner:{width:2.5,color:"$ink"}},optOnce:{backgroundColor:"$paper",inner:null,paddingBottom:10,paddingLeft:14,paddingRight:14,paddingTop:10,shadow:null},optOnceOn:{backgroundColor:"$card",inner:{width:2,color:"$ink"}},optText:{alignItems:"flex-start",color:"$ink",fontFamily:"sans",fontSize:17,gap:2,lineHeight:25.5,textAlign:"left"},optStrong:{color:"$ink",fontFamily:"sans",fontSize:16,fontWeight:"800",lineHeight:24,textAlign:"left"},optOnceStrong:{fontSize:15,fontWeight:"700",lineHeight:22.5},optSmall:{color:"$ink2",fontFamily:"sans",fontSize:13.5,lineHeight:20.25,textAlign:"left"},optOnceSmall:{fontSize:13,lineHeight:19.5},optTag:{backgroundColor:"$riskInk",borderRadius:6,color:"$card",fontFamily:"sans",fontSize:12,fontWeight:"800",lineHeight:18,marginBottom:4,paddingBottom:2,paddingLeft:8,paddingRight:8,paddingTop:2,textAlign:"left"},price:{alignItems:"flex-end",color:"$ink",columnGap:8,flexDirection:"column",flexWrap:"nowrap",fontFamily:"sans",fontSize:17,lineHeight:25.5,minWidth:0,rowGap:0,textAlign:"left"},priceValue:{color:"$ink",fontFamily:"sans",fontSize:24,fontVariant:["tabular-nums"],fontWeight:"800",lineHeight:26.4,textAlign:"left"},priceWas:{color:"$riskInk",fontFamily:"sans",fontSize:15,fontWeight:"700",lineHeight:22.5,textAlign:"left",textDecorationLine:"line-through"},optPrice:{color:"$ink",fontFamily:"sans",fontSize:18,fontWeight:"800",lineHeight:27,textAlign:"left"},optOncePrice:{color:"$ink2",fontSize:15,fontWeight:"700",lineHeight:22.5},buy:{alignItems:"center",color:"$ink",fontFamily:"sans",fontSize:17,gap:12,justifyContent:"space-between",lineHeight:25.5,marginTop:12},button:{alignItems:"center",alignSelf:"flex-start",backgroundColor:"$primary",borderRadius:999,color:"$onPrimary",flexDirection:"row",flexGrow:0,flexShrink:0,fontFamily:"sans",fontSize:17,fontWeight:"700",gap:8,justifyContent:"center",lineHeight:25.5,minHeight:52,paddingBottom:0,paddingLeft:20,paddingRight:20,paddingTop:0,textDecorationLine:"none",width:"100%"},buttonDisabled:{opacity:.32},proof:{alignItems:"center",color:"$riskInk",flexDirection:"row",fontFamily:"sans",fontSize:14.5,fontWeight:"800",gap:6,justifyContent:"center",lineHeight:21.75,marginBottom:0,marginLeft:0,marginRight:0,marginTop:10},proofIcon:{flexGrow:0,flexShrink:0,height:21,marginTop:-2,width:21},trust:{color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:6,grid:["fr","fr","fr"],lineHeight:25.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:12,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0},trustItem:{alignItems:"center",color:"$ink2",fontFamily:"sans",fontSize:12.5,fontWeight:"600",gap:4,lineHeight:16.25,textAlign:"center"},trustIcon:{color:"$link",height:20,width:20},on:{alignItems:"center",backgroundColor:"$clearBg",borderRadius:14,color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:10,grid:[34,"fr","auto"],lineHeight:25.5,marginTop:12,paddingBottom:10,paddingLeft:12,paddingRight:10,paddingTop:10},onIcon:{alignItems:"center",backgroundColor:"$clearDot",borderRadius:17,color:"$card",fontFamily:"sans",fontSize:17,height:34,justifyContent:"center",lineHeight:25.5,width:34},onIconSvg:{height:18,width:18},onStrong:{color:"$clearInk",fontFamily:"sans",fontSize:15,fontWeight:"700",lineHeight:18.75},onSmall:{color:"$ink2",fontFamily:"sans",fontSize:13,lineHeight:17.55,marginTop:1},onButton:{backgroundColor:"$card",borderRadius:999,color:"$ink",fontFamily:"sans",fontSize:14,fontWeight:"800",inner:{width:1.5,color:"$ink"},lineHeight:21,minHeight:38,paddingBottom:0,paddingLeft:14,paddingRight:14,paddingTop:0},more:{color:"$ink",columnGap:18,flexDirection:"row",flexWrap:"wrap",fontFamily:"sans",fontSize:17,lineHeight:25.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:8,rowGap:0},moreButton:{backgroundColor:"transparent",color:"$link",fontFamily:"sans",fontSize:14,fontWeight:"700",lineHeight:21,minHeight:34,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0,textDecorationLine:"underline"},fine:{color:"$ink3",fontFamily:"sans",fontSize:13,lineHeight:18.85,marginBottom:0,marginLeft:0,marginRight:0,marginTop:8},others:{backgroundColor:"$card",borderRadius:22,color:"$ink",fontFamily:"sans",fontSize:17,lineHeight:25.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:14,paddingBottom:16,paddingLeft:16,paddingRight:16,paddingTop:16,shadow:{x:0,y:1,blur:3,color:"#262523",opacity:.06}},sign:{borderRadius:16,color:"$ink",fontFamily:"sans",fontSize:17,inner:{width:1.5,color:"$n_DEDCD7"},lineHeight:25.5,marginTop:12,paddingBottom:14,paddingLeft:14,paddingRight:14,paddingTop:14},signUrgent:{backgroundColor:"$riskBg",inner:null,shadow:null},signTitle:{alignItems:"center",color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:16,fontWeight:"800",gap:8,lineHeight:20,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0},signUrgentTitle:{color:"$riskInk"},signUrgentIcon:{height:20,width:20},signBody:{color:"$ink2",fontFamily:"sans",fontSize:15,lineHeight:21.75,marginBottom:0,marginLeft:0,marginRight:0,marginTop:4},signUrgentBody:{color:"$ink"},questionsKicker:{color:"$ink",fontFamily:"sans",fontSize:16,fontWeight:"800",lineHeight:20,marginBottom:0,marginLeft:0,marginRight:0,marginTop:18},questions:{color:"$ink",fontFamily:"sans",fontSize:15,gap:6,lineHeight:21.75,marginBottom:0,marginLeft:0,marginRight:0,marginTop:10,paddingLeft:22},questionsAfterKicker:{marginTop:6},add:{alignItems:"center",backgroundColor:"transparent",borderRadius:999,color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:16,fontWeight:"800",inner:{width:2,color:"$ink"},justifyContent:"center",lineHeight:24,marginTop:14,minHeight:48,paddingBottom:0,paddingLeft:16,paddingRight:16,paddingTop:0,width:"100%"},addOn:{backgroundColor:"$clearBg",color:"$clearInk",inner:null,shadow:null},askRow:{alignItems:"center",backgroundColor:"$linkWash",borderRadius:16,color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:12,grid:[40,"fr",18],lineHeight:25.5,marginTop:10,paddingBottom:12,paddingLeft:12,paddingRight:14,paddingTop:12,textAlign:"left",width:"100%"},askRowInSec:{marginTop:12},askRowIcon:{alignItems:"center",backgroundColor:"$card",borderRadius:11,color:"$link",fontFamily:"sans",fontSize:17,height:40,justifyContent:"center",lineHeight:25.5,textAlign:"left",width:40},askRowIconSvg:{height:21,width:21},askRowStrong:{color:"$ink",fontFamily:"sans",fontSize:15.5,fontWeight:"800",lineHeight:20.15,textAlign:"left"},askRowSmall:{color:"$ink2",fontFamily:"sans",fontSize:14,lineHeight:19.6,marginTop:1,textAlign:"left"},askRowChev:{color:"$ink2",height:18,width:18},extras:{color:"$ink",fontFamily:"sans",fontSize:17,gap:10,lineHeight:25.5,marginTop:22},extrasTitle:{color:"$ink3",fontFamily:"mono",fontSize:11,fontWeight:"400",letterSpacing:.77,lineHeight:12.65,marginBottom:0,marginLeft:4,marginRight:4,marginTop:0,textTransform:"uppercase"},extra:{alignItems:"flex-start",backgroundColor:"$card",borderRadius:22,color:"$ink",columnGap:12,flexDirection:"row",fontFamily:"sans",fontSize:17,grid:[56,"fr"],lineHeight:25.5,paddingBottom:14,paddingLeft:14,paddingRight:14,paddingTop:14,rowGap:4,shadow:{x:0,y:1,blur:3,color:"#262523",opacity:.06}},extraKit:{backgroundColor:"$linkWash",inner:null,shadow:null},extraImage:{backgroundColor:"$card",borderRadius:14,height:56,width:56},extraKitImage:{backgroundColor:"$card"},extraIcon:{alignItems:"center",backgroundColor:"$linkWash",borderRadius:14,color:"$link",height:56,justifyContent:"center",width:56},extraIconSvg:{height:26,width:26},extraTitle:{color:"$ink",fontFamily:"sans",fontSize:17,fontWeight:"800",lineHeight:20.4,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0},extraTitleSerif:{fontFamily:"serif",fontSize:21,fontWeight:"800",letterSpacing:-.21,lineHeight:25.2},extraBody:{color:"$ink2",fontFamily:"sans",fontSize:14.5,lineHeight:20.3,marginBottom:0,marginLeft:0,marginRight:0,marginTop:3},extraPrice:{alignItems:"center",color:"$ink",columnGap:8,flexDirection:"row",flexWrap:"wrap",fontFamily:"sans",fontSize:14.5,lineHeight:20.3,marginBottom:0,marginLeft:0,marginRight:0,marginTop:6,rowGap:0},extraPriceValue:{color:"$ink",fontFamily:"sans",fontSize:19,fontVariant:["tabular-nums"],fontWeight:"800",lineHeight:26.6},extraPriceWas:{color:"$ink3",fontFamily:"sans",fontSize:14,fontWeight:"700",lineHeight:19.6,textDecorationLine:"line-through"},extraGo:{backgroundColor:"$primary",borderRadius:999,color:"$onPrimary",fontFamily:"sans",fontSize:14.5,fontWeight:"800",lineHeight:21.75,marginTop:8,minHeight:40,paddingBottom:0,paddingLeft:18,paddingRight:18,paddingTop:0},extraGoOn:{backgroundColor:"$clearBg",color:"$clearInk"},wait:{backgroundColor:"$card",borderRadius:22,color:"$ink",fontFamily:"sans",fontSize:17,lineHeight:25.5,marginTop:14,paddingBottom:16,paddingLeft:16,paddingRight:16,paddingTop:16,shadow:{x:0,y:1,blur:3,color:"#262523",opacity:.06}},waitTop:{alignItems:"center",color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:12,grid:[46,"fr"],lineHeight:25.5},waitTile:{alignItems:"center",backgroundColor:"$linkWash",borderRadius:13,color:"$link",flexGrow:0,flexShrink:0,fontFamily:"sans",fontSize:22,height:46,justifyContent:"center",lineHeight:33,width:46},waitTileSvg:{height:23,width:23},waitMini:{color:"$ink3",fontFamily:"mono",fontSize:10.5,letterSpacing:.63,lineHeight:15.75,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0,textTransform:"uppercase"},waitTitle:{color:"$ink",fontFamily:"serif",fontSize:26,fontWeight:"800",letterSpacing:-.26,lineHeight:27.3,marginBottom:0,marginLeft:0,marginRight:0,marginTop:2},waitKey:{color:"$ink",fontFamily:"sans",fontSize:16,fontWeight:"800",lineHeight:24,marginBottom:0,marginLeft:0,marginRight:0,marginTop:18},waitText:{alignItems:"center",color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:15.5,fontWeight:"700",gap:8,lineHeight:23.25,marginBottom:12,marginLeft:0,marginRight:0,marginTop:16},waitTextSvg:{color:"$link",flexGrow:0,flexShrink:0,height:20,width:20},waitButton:{alignItems:"center",alignSelf:"flex-start",backgroundColor:"$primary",borderRadius:999,color:"$onPrimary",flexDirection:"row",fontFamily:"sans",fontSize:16,fontWeight:"700",gap:8,justifyContent:"center",lineHeight:24,minHeight:48,paddingBottom:0,paddingLeft:22,paddingRight:22,paddingTop:0,textDecorationLine:"none",width:"100%"},track:{color:"$ink",fontFamily:"sans",fontSize:17,lineHeight:25.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:14,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0},trackStep:{color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:12,grid:[22,"fr"],lineHeight:25.5,paddingBottom:16,position:"relative"},trackStepLast:{paddingBottom:0},trackLine:{backgroundColor:"$n_E2DFD9",borderRadius:1,bottom:-2,left:10,position:"absolute",top:20,width:2},trackLineDone:{backgroundColor:"$primary"},trackDot:{alignItems:"center",backgroundColor:"$card",borderRadius:11,height:22,inner:{width:2,color:"$n_CFCBC4"},justifyContent:"center",position:"relative",width:22,zIndex:1},trackDotDone:{backgroundColor:"$primary",inner:null,shadow:null},trackDotNow:{backgroundColor:"$accent",inner:{width:2,color:"$ink"}},trackDotSvg:{color:"$card",height:13,width:13},trackTitle:{color:"$ink",fontFamily:"sans",fontSize:15.5,fontWeight:"800",lineHeight:20.15},trackTitleTodo:{color:"$ink3",fontWeight:"700"},trackDetail:{color:"$ink3",fontFamily:"sans",fontSize:14,lineHeight:18.9,marginTop:1},trackTag:{backgroundColor:"$ink",borderRadius:5,color:"$onInk",fontFamily:"mono",fontSize:10,letterSpacing:.6,lineHeight:13.5,paddingBottom:2,paddingLeft:6,paddingRight:6,paddingTop:2,textTransform:"uppercase"},next:{backgroundColor:"$card",borderRadius:18,color:"$ink",fontFamily:"sans",fontSize:17,lineHeight:25.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:22,paddingBottom:4,paddingLeft:16,paddingRight:16,paddingTop:4,shadow:{x:0,y:1,blur:3,color:"#262523",opacity:.06},textAlign:"left"},nextIn:{backgroundColor:"$paper",inner:null,marginTop:8,shadow:null},nextRow:{alignItems:"center",color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:12,grid:[36,"fr"],lineHeight:25.5,paddingBottom:10,paddingLeft:0,paddingRight:0,paddingTop:10,textAlign:"left"},nextIcon:{alignItems:"center",backgroundColor:"$linkWash",borderRadius:11,color:"$link",fontFamily:"sans",fontSize:17,height:36,justifyContent:"center",lineHeight:25.5,textAlign:"left",width:36},nextIconSvg:{height:19,width:19},nextIconImage:{borderRadius:11,height:"100%",width:"100%"},nextLabel:{color:"$ink3",fontFamily:"mono",fontSize:10.5,letterSpacing:.53,lineHeight:15.75,textAlign:"left",textTransform:"uppercase"},nextText:{color:"$ink",fontFamily:"sans",fontSize:15,fontWeight:"600",lineHeight:20.25,marginTop:1,textAlign:"left"},done:{color:"$ink",fontFamily:"sans",fontSize:17,lineHeight:25.5,paddingBottom:20,paddingLeft:22,paddingRight:22,paddingTop:40,textAlign:"center"},doneCheck:{alignItems:"center",backgroundColor:"$accent",borderRadius:38,color:"$ink",fontFamily:"sans",fontSize:17,height:76,justifyContent:"center",lineHeight:25.5,marginBottom:0,marginLeft:"auto",marginRight:"auto",marginTop:0,textAlign:"center",width:76},doneCheckSvg:{height:38,width:38},doneTitle:{color:"$ink",fontFamily:"serif",fontSize:34,fontWeight:"800",letterSpacing:-.34,lineHeight:39.1,marginBottom:0,marginLeft:0,marginRight:0,marginTop:20,textAlign:"center"},doneWhen:{color:"$ink",fontFamily:"sans",fontSize:16,fontWeight:"700",lineHeight:24,marginBottom:0,marginLeft:0,marginRight:0,marginTop:10,textAlign:"center"},doneWho:{color:"$ink2",fontFamily:"sans",fontSize:15,lineHeight:22.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:2,textAlign:"center"},pushFoot:{backgroundColor:"$paper",borderTopColor:"$line",borderTopWidth:1,color:"$ink",flexGrow:0,flexShrink:0,fontFamily:"sans",fontSize:17,lineHeight:25.5,paddingBottom:34,paddingLeft:18,paddingRight:18,paddingTop:12},pushFootStack:{color:"$ink",fontFamily:"sans",fontSize:17,gap:10,lineHeight:25.5},shop:{color:"$ink",fontFamily:"sans",fontSize:17,gap:12,lineHeight:25.5,paddingBottom:28,paddingLeft:18,paddingRight:18,paddingTop:8},shopTitle:{color:"$ink",fontFamily:"serif",fontSize:29,fontWeight:"800",letterSpacing:-.29,lineHeight:31.32,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0},shopSub:{color:"$ink2",fontFamily:"sans",fontSize:15,lineHeight:21.75,marginBottom:0,marginLeft:0,marginRight:0,marginTop:-6},shopKey:{color:"$ink",fontFamily:"sans",fontSize:16,fontWeight:"800",lineHeight:18.4,marginBottom:-4,marginLeft:2,marginRight:2,marginTop:6},shopCard:{backgroundColor:"$card",borderRadius:22,color:"$ink",fontFamily:"sans",fontSize:17,lineHeight:25.5,paddingBottom:14,paddingLeft:16,paddingRight:16,paddingTop:14,shadow:{x:0,y:1,blur:3,color:"#262523",opacity:.06}},shopFine:{color:"$ink3",fontFamily:"sans",fontSize:13,lineHeight:18.85,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0},shopFineCenter:{marginTop:14,textAlign:"center"},shopEmpty:{alignItems:"center",color:"$ink",fontFamily:"sans",fontSize:17,gap:8,lineHeight:25.5,paddingBottom:8,paddingLeft:12,paddingRight:12,paddingTop:48,textAlign:"center"},shopEmptyTile:{alignItems:"center",backgroundColor:"$linkWash",borderRadius:20,color:"$link",flexGrow:0,flexShrink:0,fontFamily:"sans",fontSize:22,height:72,justifyContent:"center",lineHeight:33,marginBottom:8,textAlign:"center",width:72},shopEmptyTileSvg:{height:34,width:34},shopEmptyTitle:{color:"$ink",fontFamily:"serif",fontSize:28,fontWeight:"800",letterSpacing:-.28,lineHeight:30.8,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0,textAlign:"center"},shopEmptyText:{color:"$ink2",fontFamily:"sans",fontSize:15.5,lineHeight:22.48,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0,maxWidth:298.07,textAlign:"center"},shopEmptyButton:{alignItems:"center",alignSelf:"flex-start",backgroundColor:"$primary",borderRadius:999,color:"$onPrimary",flexDirection:"row",fontFamily:"sans",fontSize:16,fontWeight:"700",gap:8,justifyContent:"center",lineHeight:24,marginTop:12,minHeight:48,paddingBottom:0,paddingLeft:22,paddingRight:22,paddingTop:0,textAlign:"center",textDecorationLine:"none"},shopLink:{backgroundColor:"transparent",color:"$link",fontFamily:"sans",fontSize:15,fontWeight:"700",lineHeight:22.5,minHeight:40,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0,textDecorationLine:"underline"},shopActions:{alignItems:"center",color:"$ink",fontFamily:"sans",fontSize:17,gap:4,lineHeight:25.5,marginTop:4},orderList:{color:"$ink",fontFamily:"sans",fontSize:17,gap:10,lineHeight:25.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0},order:{alignItems:"center",backgroundColor:"$card",borderRadius:22,color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:10,grid:["fr",18],lineHeight:25.5,paddingBottom:14,paddingLeft:16,paddingRight:14,paddingTop:14,shadow:{x:0,y:1,blur:3,color:"#262523",opacity:.06},textAlign:"left",width:"100%"},orderChev:{color:"$ink3",height:18,width:18},orderTop:{alignItems:"center",color:"$ink",columnGap:10,flexDirection:"row",flexWrap:"wrap",fontFamily:"sans",fontSize:17,lineHeight:25.5,rowGap:4,textAlign:"left"},orderNo:{color:"$ink3",fontFamily:"mono",fontSize:12,letterSpacing:.48,lineHeight:18,textAlign:"left"},orderWhat:{color:"$ink",fontFamily:"sans",fontSize:16,fontWeight:"800",lineHeight:20.8,marginTop:8,textAlign:"left"},orderMeta:{color:"$ink3",fontFamily:"sans",fontSize:14,lineHeight:19.6,marginTop:2,textAlign:"left"},orderPics:{color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:6,lineHeight:25.5,marginTop:10,textAlign:"left"},orderPic:{alignItems:"center",backgroundColor:"$linkWash",borderRadius:10,color:"$link",fontFamily:"sans",fontSize:17,height:40,justifyContent:"center",lineHeight:25.5,overflow:"hidden",textAlign:"left",width:40},orderPicImage:{height:"100%",width:"100%"},orderPicSvg:{height:20,width:20},pill:{alignItems:"center",alignSelf:"flex-start",backgroundColor:"$accent3",borderRadius:999,color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:13,fontWeight:"800",gap:6,lineHeight:19.5,minHeight:26,paddingBottom:0,paddingLeft:10,paddingRight:10,paddingTop:0,textAlign:"left"},pillDone:{backgroundColor:"$clearBg",color:"$clearInk"},pillSub:{backgroundColor:"$linkWash",color:"$link"},cartItems:{color:"$ink",fontFamily:"sans",fontSize:17,gap:18,lineHeight:25.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0},cartItem:{alignItems:"flex-start",color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:12,grid:[64,"fr"],lineHeight:25.5},cartItemImage:{alignItems:"center",backgroundColor:"$linkWash",borderRadius:14,color:"$link",fontFamily:"sans",fontSize:17,height:64,justifyContent:"center",lineHeight:25.5,overflow:"hidden",width:64},cartItemImageSvg:{height:28,width:28},cartItemTitle:{color:"$ink",fontFamily:"sans",fontSize:16.5,fontWeight:"800",lineHeight:20.63,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0},cartItemPrice:{alignItems:"center",color:"$ink",columnGap:8,flexDirection:"row",flexWrap:"wrap",fontFamily:"sans",fontSize:17,lineHeight:25.5,marginTop:3,rowGap:2},cartItemPriceValue:{color:"$ink",fontFamily:"sans",fontSize:16,fontVariant:["tabular-nums"],fontWeight:"800",lineHeight:24},cartItemPriceWas:{color:"$ink3",fontFamily:"sans",fontSize:14,fontWeight:"600",lineHeight:21,textDecorationLine:"line-through"},cartItemPriceNote:{color:"$ink3",fontFamily:"sans",fontSize:14,lineHeight:21},cartItemActions:{alignItems:"center",color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:16,lineHeight:25.5,marginTop:8},stepper:{alignItems:"center",alignSelf:"flex-start",backgroundColor:"$card",borderRadius:999,color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,grid:[40,30,40],height:40,inner:{width:1.5,color:"$n_DAD7D1"},lineHeight:25.5},stepperButton:{alignItems:"center",backgroundColor:"transparent",borderRadius:999,color:"$ink",fontFamily:"sans",fontSize:17,height:40,justifyContent:"center",lineHeight:25.5,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0},stepperButtonDisabled:{opacity:.3},stepperButtonSvg:{height:16,width:16},stepperValue:{color:"$ink",fontFamily:"sans",fontSize:15.5,fontVariant:["tabular-nums"],fontWeight:"800",lineHeight:23.25,textAlign:"center"},remove:{backgroundColor:"transparent",color:"$ink2",fontFamily:"sans",fontSize:14.5,fontWeight:"700",lineHeight:21.75,minHeight:40,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0,textDecorationLine:"underline"},mode:{color:"$ink",fontFamily:"sans",fontSize:17,gap:6,lineHeight:25.5,marginTop:8},modeButton:{alignItems:"center",backgroundColor:"$paper",borderRadius:12,color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:14.5,fontWeight:"700",gap:10,justifyContent:"space-between",lineHeight:18.85,minHeight:44,paddingBottom:8,paddingLeft:12,paddingRight:12,paddingTop:8,textAlign:"left"},modeButtonOn:{backgroundColor:"$card",inner:{width:2,color:"$ink"}},modePrice:{color:"$ink",fontFamily:"sans",fontSize:14.5,fontVariant:["tabular-nums"],fontWeight:"800",lineHeight:18.85,textAlign:"left"},every:{backgroundColor:"$card",borderRadius:999,color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:4,grid:["fr","fr","fr"],inner:{width:1.5,color:"$n_DAD7D1"},lineHeight:25.5,marginTop:8,paddingBottom:4,paddingLeft:4,paddingRight:4,paddingTop:4},everyButton:{backgroundColor:"transparent",borderRadius:999,color:"$ink",fontFamily:"sans",fontSize:14,fontWeight:"700",lineHeight:21,minHeight:36,paddingBottom:0,paddingLeft:6,paddingRight:6,paddingTop:0,textAlign:"center"},everyButtonOn:{backgroundColor:"$primary",color:"$onPrimary"},summary:{backgroundColor:"$card",borderRadius:16,color:"$ink",fontFamily:"sans",fontSize:17,lineHeight:25.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0,paddingBottom:6,paddingLeft:16,paddingRight:16,paddingTop:6,shadow:{x:0,y:1,blur:3,color:"#262523",opacity:.06}},summaryRow:{alignItems:"center",color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:15,fontVariant:["tabular-nums"],gap:12,justifyContent:"space-between",lineHeight:22.5,minHeight:34},summaryLabel:{alignItems:"center",alignSelf:"flex-start",color:"$ink2",flexDirection:"row",fontFamily:"sans",fontSize:15,fontVariant:["tabular-nums"],gap:8,lineHeight:22.5},summaryTotal:{fontSize:17,fontWeight:"800",lineHeight:25.5,minHeight:42},summaryTotalLabel:{color:"$ink"},summaryRenew:{fontSize:14,lineHeight:21,marginTop:-6,minHeight:28},summaryTag:{backgroundColor:"$ink",borderRadius:5,color:"$onInk",fontFamily:"mono",fontSize:10,fontVariant:["tabular-nums"],letterSpacing:.6,lineHeight:15,paddingBottom:2,paddingLeft:6,paddingRight:6,paddingTop:2,textTransform:"uppercase"},foot:{color:"$ink",fontFamily:"sans",fontSize:17,gap:8,lineHeight:25.5},footFine:{color:"$ink3",fontFamily:"sans",fontSize:13,lineHeight:18.85,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0,textAlign:"center"},co:{color:"$ink",fontFamily:"sans",fontSize:17,gap:10,lineHeight:25.5,marginTop:2},coProduct:{alignItems:"center",color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:12,grid:[56,"fr"],lineHeight:25.5},coProductImage:{alignItems:"center",backgroundColor:"$accent3",borderRadius:14,color:"$ink",fontFamily:"sans",fontSize:17,height:56,justifyContent:"center",lineHeight:25.5,overflow:"hidden",width:56},coProductImageSvg:{height:30,width:30},coProductTitle:{color:"$ink",fontFamily:"sans",fontSize:20,fontWeight:"800",lineHeight:24,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0},coProductLine:{color:"$ink2",fontFamily:"sans",fontSize:14,lineHeight:18.9,marginBottom:0,marginLeft:0,marginRight:0,marginTop:2},coOptions:{color:"$ink",fontFamily:"sans",fontSize:17,gap:8,lineHeight:25.5,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0},coOption:{borderRadius:16,color:"$ink",fontFamily:"sans",fontSize:17,inner:{width:1.5,color:"$n_DAD7D1"},lineHeight:25.5},coOptionOn:{backgroundColor:"$accent4",inner:{width:2,color:"$ink"}},coOptionHit:{alignItems:"flex-start",backgroundColor:"transparent",borderRadius:16,color:"$ink",columnGap:12,flexDirection:"row",fontFamily:"sans",fontSize:17,grid:[22,"fr","auto"],lineHeight:25.5,paddingBottom:12,paddingLeft:14,paddingRight:14,paddingTop:12,rowGap:2,textAlign:"left",width:"100%"},coOptionStrong:{color:"$ink",fontFamily:"sans",fontSize:16,fontWeight:"700",lineHeight:21.6,textAlign:"left"},coOptionSmall:{color:"$ink2",fontFamily:"sans",fontSize:13,lineHeight:18.2,textAlign:"left"},coOptionPrice:{color:"$ink",fontFamily:"sans",fontSize:16,fontVariant:["tabular-nums"],fontWeight:"800",lineHeight:21.6,textAlign:"right"},coOptionPriceWas:{color:"$riskInk",fontFamily:"sans",fontSize:13,fontVariant:["tabular-nums"],fontWeight:"600",lineHeight:17.55,textAlign:"right",textDecorationLine:"line-through"},coRadio:{alignItems:"center",borderRadius:11,height:22,inner:{width:2,color:"$n_BDB9B2"},justifyContent:"center",width:22},coRadioOn:{inner:{width:7,color:"$ink"}},coKicker:{color:"$ink3",fontFamily:"mono",fontSize:10.5,letterSpacing:.63,lineHeight:15.75,marginBottom:6,marginLeft:0,marginRight:0,marginTop:0,textTransform:"uppercase"},coWhen:{color:"$ink",fontFamily:"sans",fontSize:17,lineHeight:25.5,paddingBottom:12,paddingLeft:48,paddingRight:14,paddingTop:0},coItems:{color:"$ink",fontFamily:"sans",fontSize:17,gap:10,lineHeight:25.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0},coItem:{alignItems:"center",color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:15,gap:12,grid:[44,"fr","auto"],lineHeight:22.5},coItemPic:{alignItems:"center",backgroundColor:"$linkWash",borderRadius:10,color:"$link",fontFamily:"sans",fontSize:15,height:44,justifyContent:"center",lineHeight:22.5,overflow:"hidden",width:44},coItemStrong:{color:"$ink",fontFamily:"sans",fontSize:15.5,fontWeight:"800",lineHeight:19.38},coItemSmall:{color:"$ink3",fontFamily:"sans",fontSize:13.5,lineHeight:20.25},coItemValue:{color:"$ink",fontFamily:"sans",fontSize:15,fontVariant:["tabular-nums"],fontWeight:"800",lineHeight:22.5},coRows:{backgroundColor:"$paper",borderRadius:16,color:"$ink",fontFamily:"sans",fontSize:17,lineHeight:25.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0,paddingBottom:2,paddingLeft:14,paddingRight:14,paddingTop:2},coRow:{alignItems:"center",color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:14.5,gap:10,grid:[20,73.6,"fr"],lineHeight:21.75,minHeight:40},coRowSvg:{color:"$ink2",height:20,width:20},coRowLabel:{color:"$ink3",fontFamily:"sans",fontSize:14.5,lineHeight:21.75},coRowValue:{color:"$ink",fontFamily:"sans",fontSize:14.5,fontWeight:"700",lineHeight:21.75},coRowsShop:{backgroundColor:"$card",shadow:{x:0,y:1,blur:3,color:"#262523",opacity:.06}},coFine:{color:"$ink3",fontFamily:"sans",fontSize:12.5,lineHeight:18.13,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0,textAlign:"center"},coSummary:{backgroundColor:"$paper",borderRadius:16,color:"$ink",fontFamily:"sans",fontSize:17,inner:null,lineHeight:25.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0,paddingBottom:6,paddingLeft:16,paddingRight:16,paddingTop:6,shadow:null},weightField:{color:"$ink",fontFamily:"sans",fontSize:15,fontWeight:"700",gap:8,lineHeight:22.5,marginTop:14},weightInputWrap:{color:"$ink",fontFamily:"sans",fontSize:15,fontWeight:"700",lineHeight:22.5,position:"relative"},weightInput:{backgroundColor:"$card",borderRadius:16,color:"$ink",fontFamily:"sans",fontSize:24,fontVariant:["tabular-nums"],fontWeight:"800",height:58,inner:{width:1.5,color:"$n_DAD7D1"},lineHeight:36,paddingBottom:0,paddingLeft:18,paddingRight:56,paddingTop:0,width:"100%"},weightInputFocus:{inner:{width:2.5,color:"$ink"}},weightUnit:{color:"$ink3",fontFamily:"sans",fontSize:17,fontWeight:"700",lineHeight:25.5,position:"absolute",right:18,top:"50%"},weightError:{color:"$riskInk",fontFamily:"sans",fontSize:14,fontWeight:"700",lineHeight:21,marginBottom:0,marginLeft:0,marginRight:0,marginTop:6,minHeight:20},weightActions:{color:"$ink",fontFamily:"sans",fontSize:17,gap:8,lineHeight:25.5,marginTop:10},subCard:{alignItems:"center",backgroundColor:"$clearBg",borderRadius:22,color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:12,grid:[56,"fr","auto"],lineHeight:25.5,paddingBottom:12,paddingLeft:12,paddingRight:14,paddingTop:12},subCardImage:{backgroundColor:"$card",borderRadius:14,height:56,width:56},subCardStrong:{color:"$ink",fontFamily:"sans",fontSize:16,fontWeight:"800",lineHeight:20},subCardSmall:{color:"$ink2",fontFamily:"sans",fontSize:14,lineHeight:18.9,marginTop:2},subCardButton:{backgroundColor:"$card",borderRadius:999,color:"$ink",fontFamily:"sans",fontSize:14,fontWeight:"800",inner:{width:1.5,color:"$ink"},lineHeight:21,minHeight:40,paddingBottom:0,paddingLeft:14,paddingRight:14,paddingTop:0},carrier:{alignItems:"center",color:"$ink",columnGap:12,flexDirection:"row",fontFamily:"sans",fontSize:17,grid:[40,"fr"],lineHeight:25.5,rowGap:4},carrierIcon:{alignItems:"center",backgroundColor:"$linkWash",borderRadius:11,color:"$link",fontFamily:"sans",fontSize:17,height:40,justifyContent:"center",lineHeight:25.5,width:40},carrierIconSvg:{height:21,width:21},carrierStrong:{color:"$ink",fontFamily:"sans",fontSize:16,fontWeight:"800",lineHeight:24},carrierSmall:{alignItems:"center",color:"$ink2",columnGap:8,flexDirection:"row",flexWrap:"wrap",fontFamily:"mono",fontSize:13,letterSpacing:.26,lineHeight:19.5,marginTop:1,rowGap:2},carrierButton:{alignItems:"center",alignSelf:"flex-start",backgroundColor:"transparent",borderRadius:999,color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:15,fontWeight:"700",gap:8,inner:{width:1.5,color:"$ink"},justifyContent:"center",lineHeight:22.5,marginTop:10,minHeight:40,paddingBottom:0,paddingLeft:16,paddingRight:16,paddingTop:0,textDecorationLine:"none"},carrierWait:{color:"$ink2",fontFamily:"sans",fontSize:14.5,lineHeight:20.3},carrierTag:{backgroundColor:"$ink",borderRadius:5,color:"$onInk",fontFamily:"mono",fontSize:10,letterSpacing:.6,lineHeight:15,paddingBottom:2,paddingLeft:6,paddingRight:6,paddingTop:2,textTransform:"uppercase"},toast:{backgroundColor:"$ink",borderRadius:16,color:"$onInk",fontFamily:"sans",fontSize:14.5,left:16,lineHeight:20.3,opacity:1,paddingBottom:12,paddingLeft:15,paddingRight:15,paddingTop:12,position:"absolute",right:16,top:62,zIndex:50},scrim:{backgroundColor:"$scrim",bottom:0,left:0,opacity:1,position:"absolute",right:0,top:0,zIndex:40},sheet:{backgroundColor:"$card",borderBottomLeftRadius:0,borderBottomRightRadius:0,borderTopLeftRadius:28,borderTopRightRadius:28,bottom:0,color:"$ink",fontFamily:"sans",fontSize:17,left:0,lineHeight:25.5,maxHeight:"80%",paddingBottom:40,paddingLeft:20,paddingRight:20,paddingTop:10,position:"absolute",right:0,zIndex:41},sheetGrab:{backgroundColor:"$n_DAD7D1",borderRadius:3,height:5,marginBottom:10,marginLeft:"auto",marginRight:"auto",marginTop:0,width:40},sheetTop:{alignItems:"center",color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,justifyContent:"space-between",lineHeight:25.5},sheetKicker:{color:"$ink3",fontFamily:"mono",fontSize:11,letterSpacing:.88,lineHeight:16.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0,textTransform:"uppercase"},sheetClose:{alignItems:"center",backgroundColor:"transparent",borderRadius:20,color:"$ink",fontFamily:"sans",fontSize:17,height:40,justifyContent:"center",lineHeight:25.5,marginRight:-8,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0,position:"relative",width:40},sheetCloseSvg:{height:22,width:22},sheetTitle:{color:"$ink",fontFamily:"serif",fontSize:24,fontWeight:"800",letterSpacing:-.24,lineHeight:27.6,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0},sheetBody:{color:"$black",fontFamily:"sans",fontSize:16,gap:10,lineHeight:24,marginTop:12},blanksWrap:{color:"$ink",fontFamily:"sans",fontSize:17,lineHeight:25.5,marginTop:14},blanksCard:{backgroundColor:"$card",borderRadius:20,color:"$ink",fontFamily:"sans",fontSize:17,gap:8,lineHeight:25.5,paddingBottom:13,paddingLeft:12,paddingRight:12,paddingTop:12,shadow:{x:0,y:1,blur:3,color:"#262523",opacity:.06}},blanksHead:{alignItems:"center",color:"$ink3",flexDirection:"row",fontFamily:"sans",fontSize:12.5,fontWeight:"800",gap:10,justifyContent:"space-between",letterSpacing:.88,lineHeight:18.75,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0,paddingBottom:2,paddingLeft:2,paddingRight:2,paddingTop:0,textTransform:"uppercase"},blanksPill:{backgroundColor:"$accent",borderRadius:999,color:"$ink",fontFamily:"sans",fontSize:13,fontStyle:"normal",fontWeight:"800",letterSpacing:.13,lineHeight:19.5,paddingBottom:2,paddingLeft:10,paddingRight:10,paddingTop:2,textTransform:"none"},blanksPillFilled:{backgroundColor:"$clearBg",color:"$clearInk"},blanksList:{color:"$ink",fontFamily:"sans",fontSize:17,gap:7,lineHeight:25.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0},blanksRow:{alignItems:"center",backgroundColor:"$paper",borderRadius:15,color:"$ink",columnGap:11,flexDirection:"row",fontFamily:"sans",fontSize:17,grid:[34,"fr"],lineHeight:25.5,paddingBottom:9,paddingLeft:9,paddingRight:12,paddingTop:9},blanksNum:{alignItems:"center",backgroundColor:"$accentChip",borderRadius:11,color:"$ink",fontFamily:"serif",fontSize:22,fontWeight:"800",height:40,justifyContent:"center",lineHeight:33,width:34},blanksText:{color:"$ink",fontFamily:"sans",fontSize:16,fontWeight:"700",lineHeight:21.6},blanksSource:{color:"$ink3",fontFamily:"sans",fontSize:13.5,lineHeight:20.25},blank:{alignSelf:"flex-start",backgroundColor:"$accent4",borderRadius:6,color:"$ink",fontFamily:"sans",fontSize:16,fontStyle:"normal",fontWeight:"700",height:20,inner:{width:1.5,color:"$accent"},lineHeight:21.6,minWidth:36},blankS:{minWidth:24},blankL:{minWidth:64},blankFilled:{backgroundColor:"transparent",borderRadius:6,height:"auto",inner:null,marginBottom:0,marginLeft:-3,marginRight:-3,marginTop:0,minWidth:0,paddingBottom:0,paddingLeft:3,paddingRight:3,paddingTop:0,shadow:null},manageOrders:{backgroundColor:"transparent",color:"$link",fontFamily:"sans",fontSize:15,fontWeight:"700",lineHeight:22.5,minHeight:40,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0,textDecorationLine:"underline"}}),DESIGN_RN_PLAN_ICONS=/* @__PURE__ */Object.freeze({shield:{strokes:[{width:1.8,cap:true,closed:true,points:[12,3,19,6,19,12,18.759,14.125,18.074,16,17,17.625,15.593,19,13.907,20.125,12,21,10.093,20.125,8.407,19,7,17.625,5.926,16,5.241,14.125,5,12,5,6]},{width:1.8,cap:true,closed:false,points:[9,12,11,14,15,10]}],boxes:[],triangles:[],seams:[]},arrow:{strokes:[{width:2,cap:true,closed:false,points:[4.5,12,19,12]},{width:2,cap:true,closed:false,points:[13.5,6.5,19,12,13.5,17.5]}],boxes:[],triangles:[],seams:[]},check:{strokes:[{width:2.4,cap:true,closed:false,points:[5,12.6,9.4,17,19,7.4]}],boxes:[],triangles:[],seams:[]},star:{strokes:[],boxes:[],triangles:[[12,16.9,6.8,19.6,7.8,13.8],[16.2,13.8,17.2,19.6,12,16.9],[7.8,13.8,3.5,9.7,9.4,8.8],[14.6,8.8,20.5,9.7,16.2,13.8],[9.4,8.8,12,3.5,14.6,8.8],[16.2,13.8,12,16.9,7.8,13.8],[14.6,8.8,16.2,13.8,7.8,13.8],[14.6,8.8,7.8,13.8,9.4,8.8]],seams:[[12,16.9,7.8,13.8,.245,.677],[12,16.9,16.2,13.8,.245,.677],[7.8,13.8,9.4,8.8,.69,.248],[14.6,8.8,16.2,13.8,.248,.243],[14.6,8.8,9.4,8.8,.68,.245],[16.2,13.8,7.8,13.8,.677,.68],[14.6,8.8,7.8,13.8,.68,.69]]},truck:{strokes:[{width:1.7,cap:false,closed:true,points:[2.8,6.5,14.2,6.5,14.2,16,2.8,16]},{width:1.7,cap:false,closed:false,points:[14.2,9.5,17.8,9.5,21.2,12.9,21.2,16,14.2,16]}],boxes:[{x:5,y:15.8,w:3.6,h:3.6,radius:1.8,width:1.7},{x:15.4,y:15.8,w:3.6,h:3.6,radius:1.8,width:1.7}],triangles:[],seams:[]},refresh:{strokes:[{width:1.7,cap:true,closed:false,points:[4,12,4.343,14.363,5.368,16.52,6.985,18.278,9.048,19.48,11.374,20.021,13.756,19.85,15.981,18.984,17.852,17.5,19.201,15.53,19.909,13.249,19.912,10.861,19.21,8.578,17.865,6.605,15.998,5.116,13.775,4.245,11.393,4.068,9.066,4.602,7,5.8]},{width:1.7,cap:true,closed:false,points:[4,4,4,8,8,8]}],boxes:[],triangles:[],seams:[]},card:{strokes:[{width:1.7,cap:true,closed:false,points:[3,9.5,21,9.5]},{width:1.7,cap:true,closed:false,points:[6.5,15,10.5,15]}],boxes:[{x:3,y:5.5,w:18,h:13,radius:2.2,width:1.7}],triangles:[],seams:[]},alert:{strokes:[{width:1.9,cap:true,closed:true,points:[12,3.5,21.5,20,2.5,20]},{width:1.9,cap:true,closed:false,points:[12,10,12,14.5]},{width:1.9,cap:true,closed:false,points:[12,17.2,12.01,17.2]}],boxes:[],triangles:[],seams:[]},x:{strokes:[{width:2,cap:true,closed:false,points:[6.5,6.5,17.5,17.5]},{width:2,cap:true,closed:false,points:[17.5,6.5,6.5,17.5]}],boxes:[],triangles:[],seams:[]},chat:{strokes:[{width:1.7,cap:false,closed:true,points:[5,5.2,19,5.2,19.8,5.414,20.386,6,20.6,6.8,20.6,15.4,20.386,16.2,19.8,16.786,19,17,10.3,17,5.5,20.6,5.5,17,5,17,4.2,16.786,3.614,16.2,3.4,15.4,3.4,6.8,3.614,6,4.2,5.414,5,5.2]}],boxes:[],triangles:[],seams:[]},repeat:{strokes:[{width:1.8,cap:true,closed:false,points:[4.5,11,4.824,8.824,5.766,6.837,7.244,5.208,9.131,4.077,11.264,3.543,13.461,3.65,15.533,4.391,17.3,5.7,19.5,8]},{width:1.8,cap:true,closed:false,points:[19.5,3.5,19.5,8,15,8]},{width:1.8,cap:true,closed:false,points:[19.5,13,19.176,15.176,18.234,17.163,16.756,18.792,14.869,19.923,12.736,20.457,10.539,20.35,8.467,19.609,6.7,18.3,4.5,16]},{width:1.8,cap:true,closed:false,points:[4.5,20.5,4.5,16,9,16]}],boxes:[],triangles:[],seams:[]},calendar:{strokes:[{width:1.8,cap:true,closed:false,points:[4,10,20,10]},{width:1.8,cap:true,closed:false,points:[8.5,3.5,8.5,7.5]},{width:1.8,cap:true,closed:false,points:[15.5,3.5,15.5,7.5]}],boxes:[{x:4,y:5.5,w:16,h:15,radius:2.5,width:1.8}],triangles:[],seams:[]},flame:{strokes:[],boxes:[],triangles:[[12.15,14.513,13.1,15.2,13.1,13.7],[11.5,13.3,12.15,14.513,13.1,13.7],[16.874,10.907,15.7,9.3,15.381,10.659],[14.7,16.7,16.838,18.516,17.693,16.84],[14.7,16.7,14.489,17.681,16.838,18.516],[18,14.9,14.507,15.633,17.693,16.84],[16.874,10.907,15.381,10.659,14.685,11.707],[17.693,12.759,16.874,10.907,14.685,11.707],[15.538,19.832,16.838,18.516,14.489,17.681],[14.685,11.707,13.959,14.633,17.693,12.759],[17.693,12.759,13.959,14.633,18,14.9],[13.891,20.692,13.055,19.006,12,21],[12,21,12,19.2,10.109,20.692],[8.462,19.832,10.109,20.692,10.659,18.863],[10.659,18.863,9.741,17.97,8.462,19.832],[6.307,16.84,9.602,15.677,6,14.9],[6.273,13.033,6,14.9,9.602,15.677],[9.602,15.677,10.113,14.812,6.273,13.033],[6.988,11.438,6.273,13.033,10.113,14.812],[13.525,7.088,12.856,5.017,12,3.5],[13.856,9.589,13.525,7.088,12,3.5],[13.7,12.4,13.856,9.589,12,3.5],[10.113,14.812,10.792,14.042,6.988,11.438],[14.7,16.7,17.693,16.84,14.507,15.633],[13.7,12.4,13.959,14.633,14.685,11.707],[14.507,15.633,18,14.9,13.959,14.633],[13.1,13.7,13.959,14.633,13.7,12.4],[11.5,13.3,13.1,13.7,13.7,12.4],[7.983,10.048,6.988,11.438,10.792,14.042],[10.792,14.042,11.5,13.3,7.983,10.048],[14.489,17.681,13.913,18.475,15.538,19.832],[13.891,20.692,15.538,19.832,13.913,18.475],[13.891,20.692,13.913,18.475,13.055,19.006],[12,19.2,12,21,13.055,19.006],[10.659,18.863,10.109,20.692,12,19.2],[7.162,18.516,8.462,19.832,9.741,17.97],[9.741,17.97,9.4,16.7,7.162,18.516],[6.307,16.84,7.162,18.516,9.4,16.7],[6.307,16.84,9.4,16.7,9.602,15.677],[9.1,8.8,7.983,10.048,11.5,13.3],[11.5,13.3,13.7,12.4,9.1,8.8],[10.054,7.77,9.1,8.8,13.7,12.4],[10.927,6.683,10.054,7.77,13.7,12.4],[11.613,5.481,10.927,6.683,13.7,12.4],[12.006,4.106,11.613,5.481,13.7,12.4],[12,2.5,12.006,4.106,13.7,12.4],[12,2.5,13.7,12.4,12,3.5]],seams:[[12.15,14.513,13.1,13.7,.121,.428],[11.5,13.3,13.1,13.7,.681,.356],[15.381,10.659,16.874,10.907,.033,.883],[14.7,16.7,16.838,18.516,.648,1.318],[14.7,16.7,17.693,16.84,.648,1.533],[14.489,17.681,16.838,18.516,.51,1.318],[14.507,15.633,18,14.9,.782,1.787],[14.507,15.633,17.693,16.84,.782,1.533],[14.685,11.707,16.874,10.907,.68,.883],[14.685,11.707,17.693,12.759,.61,.484],[14.489,17.681,15.538,19.832,.51,1.115],[13.959,14.633,14.685,11.707,1.333,.576],[13.959,14.633,17.693,12.759,.851,.484],[13.959,14.633,18,14.9,.851,1.787],[13.055,19.006,13.891,20.692,.36,.984],[12,21,13.055,19.006,.945,.395],[12,19.2,12,21,.394,.945],[10.109,20.692,12,19.2,.715,.394],[10.109,20.692,10.659,18.863,.715,.428],[10.659,18.863,8.462,19.832,.428,.809],[8.462,19.832,9.741,17.97,.809,.525],[6.307,16.84,9.602,15.677,1.65,.812],[6,14.9,9.602,15.677,.194,1.012],[6.273,13.033,9.602,15.677,2.068,1.012],[10.113,14.812,6.273,13.033,1.217,2.068],[10.113,14.812,6.988,11.438,1.217,2.2],[12,3.5,13.525,7.088,4.697,5.571],[12,3.5,13.856,9.589,4.697,3.017],[12,3.5,13.7,12.4,4.648,26.765],[10.792,14.042,6.988,11.438,1.339,2.2],[13.7,12.4,13.959,14.633,.819,1.333],[13.1,13.7,13.7,12.4,0,.819],[11.5,13.3,13.7,12.4,.681,.537],[10.792,14.042,7.983,10.048,1.339,2.328],[11.5,13.3,7.983,10.048,1.438,2.328],[13.913,18.475,15.538,19.832,.409,1.115],[13.891,20.692,13.913,18.475,.984,.409],[7.162,18.516,9.741,17.97,.977,.525],[7.162,18.516,9.4,16.7,.977,.677],[6.307,16.84,9.4,16.7,1.65,.677],[11.5,13.3,9.1,8.8,1.438,1.129],[13.7,12.4,9.1,8.8,2.046,1.129],[10.054,7.77,13.7,12.4,.079,2.285],[10.927,6.683,13.7,12.4,.237,3.126],[11.613,5.481,13.7,12.4,.475,5.451],[12.006,4.106,13.7,12.4,.961,15.892],[12,2.5,13.7,12.4,2.974,26.765]]},box:{strokes:[{width:1.7,cap:false,closed:true,points:[3.8,7.8,12,4,20.2,7.8,20.2,16.4,12,20,3.8,16.4]},{width:1.7,cap:false,closed:false,points:[3.8,7.8,12,11.6,20.2,7.8]},{width:1.7,cap:false,closed:false,points:[12,11.6,12,20]}],boxes:[],triangles:[],seams:[]},cart:{strokes:[{width:1.8,cap:true,closed:false,points:[2.8,4,5.4,4,7.7,14.6,8.203,15.401,9.1,15.7,17.3,15.7,18.197,15.401,18.7,14.6,20.4,7.6,6.3,7.6]}],boxes:[{x:8.3,y:18.3,w:2.6,h:2.6,radius:1.3,width:1.8},{x:15.8,y:18.3,w:2.6,h:2.6,radius:1.3,width:1.8}],triangles:[],seams:[]},minus:{strokes:[{width:2.2,cap:true,closed:false,points:[6,12,18,12]}],boxes:[],triangles:[],seams:[]},plus:{strokes:[{width:2.2,cap:true,closed:false,points:[12,6,12,18]},{width:2.2,cap:true,closed:false,points:[6,12,18,12]}],boxes:[],triangles:[],seams:[]},chev:{strokes:[{width:2,cap:true,closed:false,points:[9,5.5,15.5,12,9,18.5]}],boxes:[],triangles:[],seams:[]},pulse:{strokes:[{width:1.8,cap:true,closed:false,points:[3,12.5,6.8,12.5,9.2,6.9,13.4,17.5,15.8,12.5,21,12.5]}],boxes:[],triangles:[],seams:[]},file:{strokes:[{width:1.7,cap:true,closed:true,points:[7,3.5,14.2,3.5,18.5,7.8,18.5,20,18.324,20.424,17.9,20.6,7,20.6,6.576,20.424,6.4,20,6.4,4.1,6.576,3.676,7,3.5]},{width:1.7,cap:true,closed:false,points:[14,3.6,14,8,18.4,8]},{width:1.7,cap:true,closed:false,points:[9.4,12.4,14.6,12.4]},{width:1.7,cap:true,closed:false,points:[9.4,15.8,14.6,15.8]}],boxes:[],triangles:[],seams:[]},kit:{strokes:[{width:1.7,cap:false,closed:true,points:[4,7.6,12,3.6,20,7.6,20,16.4,12,20.4,4,16.4]},{width:1.7,cap:false,closed:false,points:[4,7.6,12,11.6,20,7.6]},{width:1.7,cap:false,closed:false,points:[12,11.6,12,20.4]}],boxes:[],triangles:[],seams:[]},dna:{strokes:[{width:1.7,cap:true,closed:false,points:[7,3.5,7.28,4.645,8.04,5.594,9.16,6.394,10.52,7.097,12,7.75,13.48,8.403,14.84,9.106,15.96,9.906,16.72,10.855,17,12,16.72,13.145,15.96,14.094,14.84,14.894,13.48,15.597,12,16.25,10.52,16.903,9.16,17.606,8.04,18.406,7.28,19.355,7,20.5]},{width:1.7,cap:true,closed:false,points:[17,3.5,16.72,4.645,15.96,5.594,14.84,6.394,13.48,7.097,12,7.75,10.52,8.403,9.16,9.106,8.04,9.906,7.28,10.855,7,12,7.28,13.145,8.04,14.094,9.16,14.894,10.52,15.597,12,16.25,13.48,16.903,14.84,17.606,15.96,18.406,16.72,19.355,17,20.5]},{width:1.7,cap:true,closed:false,points:[8.6,6.3,15.4,6.3]},{width:1.7,cap:true,closed:false,points:[8.6,17.7,15.4,17.7]},{width:1.7,cap:true,closed:false,points:[10.4,9.6,13.6,9.6]},{width:1.7,cap:true,closed:false,points:[10.4,14.4,13.6,14.4]}],boxes:[],triangles:[],seams:[]},heart:{strokes:[{width:1.8,cap:false,closed:true,points:[12,20.2,11.739,20.035,11.041,19.559,10.03,18.804,8.831,17.799,7.569,16.575,6.37,15.163,5.359,13.593,4.661,11.895,4.4,10.1,4.833,8.454,5.87,7.105,7.349,6.264,9.039,6.062,10.675,6.532,12,7.6,13.325,6.532,14.961,6.062,16.651,6.264,18.13,7.105,19.167,8.454,19.6,10.1,19.339,11.895,18.641,13.593,17.63,15.163,16.431,16.575,15.169,17.799,13.97,18.804,12.959,19.559,12.261,20.035,12,20.2]}],boxes:[],triangles:[],seams:[]},bottle:{strokes:[{width:1.7,cap:false,closed:true,points:[7.2,6.2,16.8,6.2,17.507,6.493,17.8,7.2,17.8,19.5,17.572,20.35,16.95,20.972,16.1,21.2,7.9,21.2,7.05,20.972,6.428,20.35,6.2,19.5,6.2,7.2,6.493,6.493,7.2,6.2]},{width:1.7,cap:false,closed:true,points:[9,11,15,11,15,16,9,16]}],boxes:[{x:8,y:2.8,w:8,h:3.4,radius:1,width:1.7}],triangles:[],seams:[]},harness:{strokes:[{width:1.5,cap:true,closed:false,points:[7.5,4.5,7.728,6.82,8.364,8.708,9.336,10.116,10.572,10.996,12,11.3,13.428,10.996,14.664,10.116,15.636,8.708,16.272,6.82,16.5,4.5]},{width:1.5,cap:true,closed:true,points:[5,12.6,19,12.6,19,17.2,18.692,18.35,17.85,19.192,16.7,19.5,7.3,19.5,6.15,19.192,5.308,18.35,5,17.2]},{width:1.5,cap:true,closed:false,points:[8.2,15.3,15.8,15.3]}],boxes:[{x:10.7,y:8.9,w:2.6,h:2.6,radius:1.3,width:1.5}],triangles:[],seams:[]},ramp:{strokes:[{width:1.5,cap:true,closed:false,points:[2.5,19.5,21.5,19.5]},{width:1.5,cap:true,closed:false,points:[3.5,19.5,3.5,16.5,8,16.5,8,13.5,12.5,13.5,12.5,10.5,17,10.5,17,7.5,20.5,7.5,20.5,19.5]},{width:1.5,cap:true,closed:false,points:[3.5,16.5,20.5,7.5],opacity:.35}],boxes:[],triangles:[],seams:[]}});var PLAN_LIGHT=/* @__PURE__ */Object.freeze({black:"#000000",onInk:"#FFFFFF",wash:"rgba(38, 37, 35, 0.06)",scrim:"rgba(38, 37, 35, 0.38)",riskChip:"#FFD8D6",clearChip:"#DDEFC4"});function rgb(color){let c=color.trim(),h=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(c);if(h!==null){let x=h[1].length===3?h[1].split("").map(d=>d+d).join(""):h[1];return[0,2,4].map(k2=>parseInt(x.slice(k2,k2+2),16))}let r=/^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)/i.exec(c);return r===null?null:[Number(r[1]),Number(r[2]),Number(r[3])]}function mixPlanColor(color,share,ground){let a=rgb(color),b=rgb(ground);if(a===null||b===null)return ground;let to=k2=>Math.round(a[k2]*share+b[k2]*(1-share)).toString(16).padStart(2,"0");return`#${to(0)}${to(1)}${to(2)}`.toUpperCase()}function clearOf(color){let c=rgb(color);return c===null?"transparent":`rgba(${c[0]}, ${c[1]}, ${c[2]}, 0)`}function planRoles(theme){let c=theme.color,v=v3Palette(theme),card=v.card,link=v.link;return{ink:v.ink,ink2:v.ink2,ink3:v.ink3,paper:v.paper,tile:v.tile,line:v.line,card:card,riskBg:v.riskBg,riskInk:v.riskInk,riskDot:v.riskDot,clearBg:v.clearBg,clearInk:v.clearInk,clearDot:v.clearDot,watchDot:v.watchDot,...v.dark?{black:c.text.primary,onInk:c.background,wash:mixPlanColor(c.text.primary,.08,c.surface),scrim:"rgba(0, 0, 0, 0.6)",riskChip:c.badgeBgCritical,clearChip:c.badgeBgPositive}:PLAN_LIGHT,primary:v.primary,onPrimary:v.onPrimary,accent:v.accent,accent4:mixPlanColor(c.accent,.17,card),accent3:mixPlanColor(c.accent,.25,card),accentChip:mixPlanColor(c.accent,.47,card),link:link,linkWash:(v.dark?void 0:theme.slots.planWash?.backgroundColor)??mixPlanColor(link,.12,card),linkChip:(v.dark?void 0:theme.slots.planChip?.backgroundColor)??mixPlanColor(link,.2,card)}}var TEXT_KEYS=/* @__PURE__ */new Set(["fontSize","fontWeight","fontFamily","fontStyle","letterSpacing","lineHeight","textTransform","color","textAlign","textDecorationLine","fontVariant"]),DROP=/* @__PURE__ */new Set(["justifyItems"]);function font(theme,family,weight){let w=Number(weight??400);if(family==="serif"){let h=headingFace(theme,"bold");return h.fontWeight===void 0?{fontFamily:h.fontFamily}:{fontFamily:h.fontFamily,fontWeight:String(w)}}let mono=family==="mono",key=w>=650?mono?"monoBold":"bold":w>=450?mono?"monoMedium":"medium":mono?"mono":"regular",f=face(theme,key);return theme.type.namedFaces[key]?{fontFamily:f.fontFamily}:{fontFamily:f.fontFamily,fontWeight:String(w)}}function paintPart(theme,roles,part,dark,line){let box={},text2={},colour=v=>{if(!v.startsWith("$"))return v;let name=v.slice(1);return name.startsWith("n_")?dark?line:`#${name.slice(2)}`:roles[name]??v},rings=[],inner;for(let[key,value]of Object.entries(part))if(!(value===void 0||DROP.has(key)||key==="grid"||key==="fontWeight"))if(key==="fontFamily")Object.assign(text2,font(theme,String(value),part.fontWeight));else if(key==="shadow"){if(value===null)Object.assign(box,{shadowOpacity:0,elevation:0});else if(!dark){let s=value;Object.assign(box,{shadowColor:colour(s.color),shadowOpacity:s.opacity,shadowRadius:s.blur,shadowOffset:{width:s.x,height:s.y},elevation:Math.max(1,Math.round(s.blur/2))})}}else if(key==="inner"){let r=value;inner=r===null?null:{position:"absolute",top:0,right:0,bottom:0,left:0,borderWidth:r.width,borderColor:colour(r.color),pointerEvents:"none"}}else if(key==="ring"){let list=value,radius=typeof part.borderRadius=="number"?part.borderRadius:0;rings=list.map((r,i)=>({borderWidth:r.width-(list[i-1]?.width??0),borderColor:colour(r.color),borderRadius:radius+r.width})).reverse()}else key==="color"||key.endsWith("Color")?(key==="color"?text2:box)[key]=colour(String(value)):(TEXT_KEYS.has(key)?text2:box)[key]=value;part.fontWeight!==void 0&&part.fontFamily===void 0&&Object.assign(text2,font(theme,"sans",part.fontWeight));let outer=rings[0];if(outer!==void 0){let w=part.ring.reduce((m,r)=>Math.max(m,r.width),0),place3={...outer};if(box.position==="absolute"){for(let k2 of["position","zIndex"])box[k2]!==void 0&&(place3[k2]=box[k2]);for(let k2 of["top","right","bottom","left"])typeof box[k2]=="number"&&(place3[k2]=box[k2]-w);for(let k2 of["position","zIndex","top","right","bottom","left"])delete box[k2]}else{for(let k2 of["marginTop","marginRight","marginBottom","marginLeft"])place3[k2]=(typeof box[k2]=="number"?box[k2]:0)-w,delete box[k2];box.alignSelf!==void 0&&(place3.alignSelf=box.alignSelf,delete box.alignSelf)}rings[0]=place3}return{box:box,text:text2,rings:rings,...inner===void 0?{}:{inner:inner},grid:part.grid??[]}}var cache4=/* @__PURE__ */new WeakMap;function planPaint(theme){let hit=cache4.get(theme);if(hit!==void 0)return hit;let roles=planRoles(theme),dark=theme.brightness==="dark",out={roles:roles};for(let[name,part]of Object.entries(DESIGN_RN_PLAN))out[name]=paintPart(theme,roles,part,dark,roles.line);let painted=out;return cache4.set(theme,painted),painted}function gridCell(p,i){let t=p.grid[i];return t===void 0?{}:t==="fr"?{flexGrow:1,flexShrink:1,flexBasis:0,minWidth:0}:t==="auto"?{flexShrink:0}:typeof t=="number"?{width:t,flexShrink:0}:{}}var RADII=["borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],MARGINS=["margin","marginTop","marginRight","marginBottom","marginLeft","marginHorizontal","marginVertical"],draws=/* @__PURE__ */new WeakMap;function planDraw(X){let hit=draws.get(X);if(hit!==void 0)return hit;let list=names=>names.filter(n=>typeof n=="string"),draw={bx:(...names)=>list(names).map(n=>X[n].box),im:(...names)=>list(names).map(n=>X[n].box),tx:(...names)=>list(names).map(n=>X[n].text),tb:(...names)=>list(names).flatMap(n=>[X[n].box,X[n].text]),ring:(name,node,place3)=>{let rings=X[name].rings;return rings.length===0?node:rings.reduceRight((child,style,i)=>react.createElement(reactNative.View,{key:i,style:i===0&&place3!==void 0?[style,place3]:style},child),node)},inner:(...names)=>{let ring=null,radius={};for(let n of list(names)){let p=X[n];p.inner!==void 0&&(ring=p.inner);for(let k2 of RADII)p.box[k2]!==void 0&&(radius={...radius,[k2]:p.box[k2]})}return ring===null?null:react.createElement(reactNative.View,{style:[ring,radius]})},ink:(name,fallback)=>typeof X[name].text.color=="string"?X[name].text.color:fallback,side:(name,fallback)=>typeof X[name].box.width=="number"?X[name].box.width:fallback,mod:(base3,kind)=>{if(kind===void 0||kind==="")return null;let name=`${base3}${kind.charAt(0).toUpperCase()}${kind.slice(1)}`;return name!=="roles"&&name in X?name:null},scroll:name=>{let place3={},content={};for(let[k2,v]of Object.entries(X[name].box))(MARGINS.includes(k2)?place3:content)[k2]=v;return{place:place3,content:content}},swipe:(name,inner)=>{let b=X[name].box,share=typeof b.flexBasis=="string"&&b.flexBasis.endsWith("%")?Number(b.flexBasis.slice(0,-1))/100:1,max=typeof b.maxWidth=="number"?b.maxWidth:1/0;return Math.round(Math.min(max,inner*share)*100)/100}};return draws.set(X,draw),draw}var PLAN_PRESS_SCALE=/* @__PURE__ */Object.freeze({button:.97,onButton:.96,jump:.98,opt:.98,add:.98,extraGo:.96,every:.96,askRow:.98,stepper:.9,mode:.98,order:.98,subCard:.96});function pressScale(style,scale,off){return off?style:({pressed:pressed})=>pressed?[style,{transform:[{scale:scale}]}]:style}var ORDER_STEPS=["ordered","shipped","out_for_delivery","delivered"],TRACK_STEP={ordered:0,shipped:1,delivered:3};function hostOrderView(o){let step=Math.max(0,ORDER_STEPS.indexOf(o.status));return{key:o.key,number:o.number??null,step:step,dates:o.dates??[],everfur:false,steps:[0,1,2,3],productId:null,items:o.items.map(x=>({title:x.title,quantity:x.quantity,price:x.price,imageUrl:x.imageUrl??null,icon:x.icon??null})),total:Math.round(o.items.reduce((n,x)=>n+x.price,0)*100)/100,currency:o.currency,subscriptionBox:o.subscriptionBox===true,carrier:o.carrier??null,trackingNumber:o.trackingNumber??null,trackingTag:o.trackingTag??null,trackingUrl:o.trackingUrl??null}}function everfurOrderView(o,items){let it=items.find(x=>x.productId===o.productId),t=o.tracking,quantity=o.quantity??1,total=o.total??Math.round(o.price*quantity*100)/100,step=t===void 0?0:TRACK_STEP[t.status];return{key:o.orderId,number:t?.orderNumber??null,step:step,dates:t===void 0?[o.createdAt??null]:[o.createdAt??null,t.shippedAt,null,step===3?null:t.estimatedDelivery],steps:t===void 0?[0]:[0,1,3],everfur:true,productId:o.productId,items:[{title:o.title??it?.title??"",quantity:quantity,price:total,imageUrl:it?.imageUrl??null,icon:null}],total:total,currency:o.currency,subscriptionBox:false,carrier:t?.carrier??null,trackingNumber:t?.trackingNumber??null,trackingTag:null,trackingUrl:t?.trackingUrl??null}}function formatShopDay(iso,locale,now=/* @__PURE__ */new Date){if(iso==null)return null;let dateOnly=/^\d{4}-\d{2}-\d{2}$/.test(iso),d=new Date(dateOnly?`${iso}T00:00:00Z`:iso);if(Number.isNaN(d.getTime()))return null;let tz=dateOnly?"UTC":void 0,year=Number(new Intl.DateTimeFormat("en-US",{year:"numeric",...tz?{timeZone:tz}:{}}).format(d));try{return new Intl.DateTimeFormat(locale??"en-US",year!==now.getFullYear()?{month:"short",day:"numeric",year:"numeric",...tz?{timeZone:tz}:{}}:{weekday:"short",month:"short",day:"numeric",...tz?{timeZone:tz}:{}}).format(d)}catch{return iso}}function andList(names){return names.length<=1?names[0]??"":`${names.slice(0,-1).join(", ")} and ${names[names.length-1]??""}`}var CENTER={justifyContent:"center"},SHRINK={flexShrink:1},FILL={width:"100%",height:"100%"},WRAP={flexWrap:"wrap"},FULL_ROW={width:"100%",alignSelf:"stretch"},HIT_44={top:2,bottom:2,left:2,right:2},IN_ROW={alignSelf:"auto"},SR_ONLY={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",borderWidth:0},inlineTag=(k2,label,part)=>/* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[" ",
|
|
77
|
-
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:k2.S.D.bx(
|
|
78
|
-
return jsxRuntime.jsx(reactNative.Pressable,{onPress:disabled?void 0:onPress,disabled:disabled,accessibilityRole:"button",accessibilityLabel:label,accessibilityState:{disabled:disabled},style:pressScale(opts.ghost?[S.buttonGhost,disabled?S.disabled:null]:bx(
|
|
75
|
+
/* @__PURE__ */jsxRuntime.jsx(reactNative.Pressable,{testID:part2("cover"),onPress:onPress,onPressIn:()=>setDown(true),onPressOut:()=>setDown(false),accessibilityRole:"button",accessibilityLabel:accessibilityLabel??title,style:{position:"absolute",top:0,right:0,bottom:0,left:0}})]}):cover?/* @__PURE__ */jsxRuntime.jsx(reactNative.Pressable,{testID:testID,onPress:onPress,accessibilityRole:"button",accessibilityLabel:accessibilityLabel??title,style:({pressed:pressed})=>[...card,pressed&&!reduced&&press!==1?{transform:[{scale:press}]}:null],children:body}):/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{testID:testID,style:card,children:body})}var DESIGN_V3_LIGHT=/* @__PURE__ */Object.freeze({ink:"#262523",ink2:"#4A4845",ink3:"#6B6863",paper:"#F8F7F4",card:"#FFFFFF",line:"#E7E6E2",tile:"#F2F1EE",shadow:"rgba(38, 37, 35, .07)",riskBg:"#FFE3E1",riskInk:"#B0231B",riskDot:"#E5372B",clearBg:"#E6F4D3",clearInk:"#2F6A12",clearDot:"#5FA82B",watchDot:"#E5A000"}),cache3=/* @__PURE__ */new WeakMap;function v3Palette(theme){let hit=cache3.get(theme);if(hit!==void 0)return hit;let c=theme.color,dark=theme.brightness==="dark",neutrals=dark?{dark:dark,ink:c.text.primary,ink2:c.text.secondary,ink3:c.text.muted,paper:c.background,card:c.surface,line:c.borderRingCream,tile:c.surfaceSubtle,shadow:c.shadow,riskBg:c.badgeBgCritical,riskInk:c.danger,riskDot:c.danger,clearBg:c.badgeBgPositive,clearInk:c.success,clearDot:c.success,watchDot:c.warningStrong}:{dark:dark,...DESIGN_V3_LIGHT},textOn=(ink,grounds)=>pushToContrast(ink,grounds,poleForGrounds(grounds),V3_TEXT_CONTRAST),labelOn=(ink,fill)=>contrastRatio(ink,fill)>=V3_TEXT_CONTRAST?ink:legibleOn(fill,V3_TEXT_CONTRAST),badgeGrounds=[neutrals.card,neutrals.paper].map(under=>flattenOnto(c.brandSoft,under)??under),brand={primary:c.primary,onPrimary:labelOn(c.onPrimary,c.primary),accent:c.accent,onAccent:labelOn(c.onAccent,c.accent),link:textOn(c.linkInk,[neutrals.card,neutrals.paper,neutrals.tile]),badge:c.brandSoft,onBadge:textOn(c.brandInk,badgeGrounds)},palette=/* @__PURE__ */Object.freeze({...neutrals,...brand});return cache3.set(theme,palette),palette}var V3_TEXT_CONTRAST=4.5;var GRAB="#DAD7D1";function planDsInput(p,outline=false){let r=role=>p.roles[role]??role,neutral=hex=>p.dark?r("line"):hex,box=(bg,extra={})=>({bg:bg,...extra}),words2=color=>({color:color}),noShadow={color:"",x:0,y:0,blur:0,spread:0},plan=Object.fromEntries(Object.entries({planInk:"primary",planOnInk:"onPrimary",planAccent:"accent",planLink:"link",planAccentWash:"accent4",planAccentChip:"accentChip",planLinkWash:"linkWash",planLinkChip:"linkChip"}).flatMap(([k2,role])=>p.roles[role]===void 0?[]:[[k2,p.roles[role]]]));return{colors:{bg:r("paper"),surface:r("card"),text:r("black"),ink:r(outline?"ink":"primary"),onInk:r("onPrimary"),muted:r("ink3"),line:r("line"),scrim:r("scrim"),grab:neutral(GRAB),focus:r("ink"),...plan},type:p.type,motion:{reduced:p.reduced},metrics:{variants:{drawer:{frame:box(r("card"),{color:r("ink")}),grab:box(neutral(GRAB)),kicker:words2(r("ink3")),close:{color:r("ink")},title:{color:r("ink"),wrap:"auto"},text:words2(r("black")),scrim:r("scrim")},segmented:{track:box(r("card"),{edge:{color:neutral(GRAB)}}),label:words2(r("ink")),chosen:box(r("primary")),chosenLabel:words2(r("onPrimary"))},stepper:{track:box(r("card"),{edge:{color:neutral(GRAB)}}),button:{color:r("ink")},value:words2(r("ink"))},summary:{box:box(r("card"),p.dark?{shadow:noShadow}:{}),term:words2(r("ink2")),value:words2(r("ink")),totalTerm:words2(r("ink")),total:words2(r("ink")),renewTerm:words2(r("ink2")),renew:words2(r("ink")),inset:box(r("paper"))},toast:{box:box(r("ink")),text:words2(r("onInk"))},focus:{color:r("ink")}}}}}var caches=/* @__PURE__ */new WeakMap;function planDsTheme(key,preset,input,outline=false){let byPreset=caches.get(preset);byPreset===void 0&&(byPreset={fill:/* @__PURE__ */new WeakMap,outline:/* @__PURE__ */new WeakMap},caches.set(preset,byPreset));let cache6=byPreset[outline?"outline":"fill"],t=cache6.get(key);return t===void 0&&(t=resolveTheme(planDsInput(input(),outline),preset),cache6.set(key,t)),t}var rnBlockFonts=theme=>{let n=theme.type.namedFaces,family=key=>face(theme,key).fontFamily;return{family:family("regular"),mono:family("mono"),faces:{regular:family("regular"),medium:family("medium"),bold:family("bold"),mono:family("mono"),monoBold:family("monoBold"),serif:headingFace(theme,"bold").fontFamily},namedFaces:n.regular&&n.medium&&n.bold}},mapped=/* @__PURE__ */new WeakMap;function themeInputFromEverfur(theme,fonts,base3=everfurTheme){if(base3!==everfurTheme)return mapEverfur(theme,fonts,base3);let byTheme=mapped.get(fonts);byTheme===void 0&&mapped.set(fonts,byTheme=/* @__PURE__ */new WeakMap);let input=byTheme.get(theme);return input===void 0&&byTheme.set(theme,input=mapEverfur(theme,fonts,base3)),input}function mapEverfur(theme,fonts,base3){let c=theme.color,d=EVERFUR_LIGHT.color,dark=theme.brightness==="dark",compiled=dark?EVERFUR_DARK:EVERFUR_LIGHT,moved=key=>c[key]!==d[key],colors={};if(moved("primary")?(Object.assign(colors,{ink:c.primary,onInk:c.onPrimary,focus:c.primary}),moved("accent")||Object.assign(colors,{go:c.primary,onGo:c.onPrimary})):moved("onPrimary")&&(colors.onInk=c.onPrimary),moved("accent")&&Object.assign(colors,{go:c.accent,onGo:c.onAccent}),moved("brandSoft")&&(colors.tintSage=c.brandSoft),moved("danger")&&Object.assign(colors,{alert:c.danger,alertDeep:c.danger}),dark)Object.assign(colors,{bg:c.background,surface:c.surface,text:c.text.primary,muted:c.text.muted,line:c.borderRingCream});else{let k2=compiled.color;c.background!==k2.background&&(colors.bg=c.background),c.surface!==k2.surface&&(colors.surface=c.surface),c.text.primary!==k2.text.primary&&(colors.text=c.text.primary),c.text.muted!==k2.text.muted&&(colors.muted=c.text.muted)}let over={};Object.keys(colors).length>0&&(over.colors={...colors});let r=theme.radius,kr=compiled.radius;if(r.xs!==kr.xs||r.sm!==kr.sm||r.lg!==kr.lg||r.xl!==kr.xl||r.pill!==kr.pill){let radius={};r.xs!==kr.xs&&(radius.sm=r.xs),r.sm!==kr.sm&&(radius.md=r.sm),r.lg!==kr.lg&&(radius.lg=r.lg),r.xl!==kr.xl&&(radius.xl=r.xl),r.pill!==kr.pill&&(radius.pill=r.pill),over.radius=radius,(r.lg!==kr.lg||r.xl!==kr.xl)&&(over.metrics={...r.lg!==kr.lg?{card:{radius:r.lg},summary:{radius:r.lg}}:{},...r.xl!==kr.xl?{sheet:{radius:r.xl}}:{}})}if(theme.space.xs!==compiled.space.xs){let f=theme.space.xs/compiled.space.xs,s=base3.space,n=v=>Math.round(v*f);over.space={1:n(s[1]),2:n(s[2]),3:n(s[3]),4:n(s[4]),5:n(s[5]),6:n(s[6]),7:n(s[7]),8:n(s[8]),9:n(s[9])}}let ts=theme.type.size,ks=compiled.type.size,sizeMoved=ts.caption!==ks.caption||ts.bodyTight!==ks.bodyTight||ts.body!==ks.body||ts.subtitle!==ks.subtitle||ts.verdict!==ks.verdict,lh=theme.type.lineHeight,klh=compiled.type.lineHeight,lineMoved=lh.relaxed!==klh.relaxed||lh.tight!==klh.tight,caps=theme.type.scaleCaps,kcaps=compiled.type.scaleCaps,capsMoved=caps.content!==kcaps.content||caps.heading!==kcaps.heading||caps.control!==kcaps.control||caps.compact!==kcaps.compact||caps.badge!==kcaps.badge,typeMoved=sizeMoved||lineMoved||capsMoved;over.type={...sizeMoved?{size:{xs:ts.caption,sm:ts.bodyTight,md:ts.body,lg:ts.subtitle,xl:ts.verdict}}:{},...lineMoved?{lineHeight:{body:lh.relaxed,display:lh.tight}}:{},...capsMoved?{scaleCaps:{content:caps.content,heading:caps.heading,control:caps.control,compact:caps.compact,badge:caps.badge}}:{},...fonts(theme)},theme.motion.reducedMotion&&!base3.motion.reduced&&(over.motion={reduced:true});let branded=typeMoved||Object.keys(colors).length>0||Object.keys(over).some(k2=>k2!=="type"&&k2!=="colors")||theme.type.families.regular!==EVERFUR_LIGHT.type.families.regular,plan=planColors(theme,compiled,colors.surface??base3.colors.surface),ownPlan=Object.entries(plan).filter(([k2,v])=>v!==base3.colors[k2]);return ownPlan.length>0&&(over.colors={...colors,...Object.fromEntries(ownPlan)}),branded?{name:"partner",...over}:over}var DS_PLAN={planAccent:everfurTheme.colors.planAccent,planLink:everfurTheme.colors.planLink},PLAN_WASHES2={planAccentWash:["accent",.17],planAccentChip:["accent",.47],planLinkWash:["link",.12],planLinkChip:["link",.2]};function planColors(theme,compiled,surface){let v=v3Palette(theme),k2=v3Palette(compiled),c=theme.color,out={};(c.primary!==compiled.color.primary||c.onPrimary!==compiled.color.onPrimary)&&Object.assign(out,{planInk:c.primary,planOnInk:v.onPrimary}),c.accent!==compiled.color.accent&&(out.planAccent=c.accent),v.link!==k2.link&&(out.planLink=v.link);let ink={accent:out.planAccent??DS_PLAN.planAccent,link:out.planLink??DS_PLAN.planLink},slot={planLinkWash:v.dark?void 0:theme.slots.planWash?.backgroundColor,planLinkChip:v.dark?void 0:theme.slots.planChip?.backgroundColor},ownCard=surface.toLowerCase()!==v.card.toLowerCase();for(let[key,[from,share]]of Object.entries(PLAN_WASHES2)){let given=slot[key];given!==void 0?out[key]=given:ownCard&&(out[key]=mixColor(ink[from],share,v.card,v.card))}return out}function useBlockThemeInput(fonts){let everfur=useEverfurTheme();return react.useMemo(()=>themeInputFromEverfur(everfur,fonts),[everfur,fonts])}function rnPlanDsTheme(theme,roles){return planDsTheme(theme,everfurTheme,()=>({roles:roles,dark:v3Palette(theme).dark,type:{...rnBlockFonts(theme),scaleCaps:theme.type.scaleCaps},reduced:theme.motion.reducedMotion}))}function PlanDs(props){return react.createElement(ThemeProvider,{theme:props.theme},props.children)}var DESIGN_RN_PLAN=/* @__PURE__ */Object.freeze({root:{backgroundColor:"$paper",color:"$ink",fontFamily:"sans",fontSize:17,lineHeight:25.5,paddingBottom:28,paddingLeft:16,paddingRight:16,paddingTop:16},pageFine:{color:"$ink3",fontFamily:"sans",fontSize:12.5,lineHeight:18.13,marginBottom:0,marginLeft:0,marginRight:0,marginTop:16,textAlign:"center"},tools:{alignItems:"center",color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:8,justifyContent:"space-between",lineHeight:25.5,marginBottom:2,marginLeft:2,marginRight:-6,marginTop:-8},toolsEyebrow:{color:"$ink3",fontFamily:"mono",fontSize:11,letterSpacing:.77,lineHeight:16.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0,textTransform:"uppercase"},toolsEnd:{alignItems:"center",color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:2,lineHeight:25.5},orders:{alignItems:"center",alignSelf:"flex-start",backgroundColor:"transparent",borderRadius:999,color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:15,fontWeight:"700",gap:6,lineHeight:22.5,minHeight:44,paddingBottom:0,paddingLeft:8,paddingRight:8,paddingTop:0},ordersIcon:{height:21,width:21},cart:{alignItems:"center",backgroundColor:"transparent",borderRadius:22,color:"$ink",fontFamily:"sans",fontSize:17,height:44,justifyContent:"center",lineHeight:25.5,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0,position:"relative",width:44},cartIcon:{height:26,width:26},cartCount:{backgroundColor:"$riskDot",borderRadius:999,color:"$card",fontFamily:"sans",fontSize:12,fontVariant:["tabular-nums"],fontWeight:"800",height:20,lineHeight:20,minWidth:20,paddingBottom:0,paddingLeft:5,paddingRight:5,paddingTop:0,position:"absolute",right:1,ring:[{width:2,color:"$paper"}],textAlign:"center",top:3},head:{alignItems:"center",color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:12,grid:["fr",56],lineHeight:25.5,paddingBottom:0,paddingLeft:2,paddingRight:2,paddingTop:2},eyebrow:{color:"$ink2",fontFamily:"mono",fontSize:15,letterSpacing:1.05,lineHeight:22.5,marginBottom:6,marginLeft:0,marginRight:0,marginTop:6,textTransform:"uppercase"},title:{color:"$ink",fontFamily:"serif",fontSize:29,fontWeight:"800",letterSpacing:-.29,lineHeight:30.74,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0},subtitle:{color:"$ink2",fontFamily:"sans",fontSize:15,lineHeight:22.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:6},headImage:{backgroundColor:"$tile",borderRadius:28,height:56,ring:[{width:3,color:"$paper"},{width:5.5,color:"$accent"}],width:56},by:{alignItems:"center",backgroundColor:"$card",borderRadius:16,color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:10,grid:[40,"fr",22],lineHeight:25.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:14,paddingBottom:10,paddingLeft:12,paddingRight:12,paddingTop:10,shadow:{x:0,y:1,blur:3,color:"#262523",opacity:.06}},byImage:{backgroundColor:"$tile",borderRadius:20,height:40,width:40},byName:{color:"$ink",fontFamily:"sans",fontSize:15,fontWeight:"800",lineHeight:18.75},byRole:{color:"$ink3",fontFamily:"mono",fontSize:10.5,letterSpacing:.53,lineHeight:15.75,marginTop:2,textTransform:"uppercase"},byOk:{color:"$link",height:22,width:22},byIcon:{alignItems:"center",backgroundColor:"$tile",borderRadius:20,color:"$ink",height:40,justifyContent:"center",width:40},byIconSvg:{height:20,width:20},need:{backgroundColor:"$card",borderRadius:22,color:"$ink",fontFamily:"sans",fontSize:17,lineHeight:25.5,marginTop:14,paddingBottom:16,paddingLeft:16,paddingRight:16,paddingTop:16,shadow:{x:0,y:1,blur:3,color:"#262523",opacity:.06}},needKicker:{alignItems:"center",color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:15,fontWeight:"800",gap:8,lineHeight:22.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0},sources:{color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:15,fontWeight:"800",gap:4,lineHeight:22.5,marginLeft:"auto"},source:{alignItems:"center",alignSelf:"flex-start",backgroundColor:"$tile",borderRadius:999,color:"$ink2",flexDirection:"row",fontFamily:"sans",fontSize:12,fontWeight:"700",height:24,lineHeight:18,paddingBottom:0,paddingLeft:9,paddingRight:9,paddingTop:0},sourceDna:{backgroundColor:"$linkWash",color:"$link"},needTitle:{color:"$ink",fontFamily:"sans",fontSize:19,fontWeight:"800",lineHeight:23.18,marginBottom:0,marginLeft:0,marginRight:0,marginTop:12},needRisk:{alignItems:"baseline",color:"$ink2",flexDirection:"row",fontFamily:"sans",fontSize:15,gap:9,grid:[9,"fr"],lineHeight:21.75,marginBottom:0,marginLeft:0,marginRight:0,marginTop:6},needRiskLead:{color:"$ink",fontFamily:"sans",fontSize:15,fontWeight:"800",lineHeight:21.75},dot:{alignSelf:"flex-start",borderRadius:4.5,flexGrow:0,flexShrink:0,height:9,width:9},dotRisk:{backgroundColor:"$riskDot"},odds:{alignItems:"center",backgroundColor:"$accent4",borderRadius:14,color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:12,justifyContent:"space-between",lineHeight:25.5,marginTop:12,paddingBottom:10,paddingLeft:14,paddingRight:14,paddingTop:10},oddsKicker:{color:"$ink2",fontFamily:"sans",fontSize:13.5,fontWeight:"600",lineHeight:18.23,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0,maxWidth:135},oddsTag:{alignSelf:"flex-start",backgroundColor:"$card",borderRadius:5,color:"$ink",fontFamily:"mono",fontSize:10,fontWeight:"600",letterSpacing:.6,lineHeight:13.5,marginTop:3,paddingBottom:2,paddingLeft:6,paddingRight:6,paddingTop:2,textTransform:"uppercase"},oddsNumbers:{alignItems:"center",color:"$ink",columnGap:6,flexDirection:"row",fontFamily:"sans",fontSize:17,grid:["auto","auto","auto"],justifyItems:"flex-end",lineHeight:25.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0,rowGap:0},oddsFrom:{color:"$ink3",fontFamily:"sans",fontSize:17,fontWeight:"700",lineHeight:25.5,textDecorationLine:"line-through"},oddsIcon:{color:"$ink3",height:16,width:16},oddsTo:{color:"$ink",fontFamily:"serif",fontSize:28,fontWeight:"800",lineHeight:28},oddsLabel:{color:"$link",fontFamily:"sans",fontSize:12.5,fontWeight:"700",lineHeight:18.75,marginTop:3},says:{alignItems:"flex-start",backgroundColor:"$paper",borderRadius:16,color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:10,grid:[32,"fr"],lineHeight:25.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:12,paddingBottom:14,paddingLeft:14,paddingRight:14,paddingTop:14},saysImage:{borderRadius:16,height:32,width:32},saysText:{color:"$ink2",fontFamily:"sans",fontSize:14.5,lineHeight:20.3,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0},saysBy:{color:"$ink",fontFamily:"sans",fontSize:14.5,fontWeight:"800",lineHeight:20.3,marginRight:2},saysSerif:{color:"$ink",fontFamily:"serif",fontSize:17,fontWeight:"800",letterSpacing:-.17,lineHeight:25.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0},saysKicker:{alignItems:"center",color:"$ink3",flexDirection:"row",fontFamily:"mono",fontSize:10.5,justifyContent:"space-between",letterSpacing:.63,lineHeight:15.75,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0,textTransform:"uppercase"},saysQuote:{color:"$ink",fontFamily:"serif",fontSize:17,fontWeight:"800",letterSpacing:-.17,lineHeight:23.8,marginBottom:0,marginLeft:0,marginRight:0,marginTop:8},tag:{backgroundColor:"$card",borderRadius:5,color:"$ink",fontFamily:"mono",fontSize:10,letterSpacing:.6,lineHeight:14,paddingBottom:2,paddingLeft:6,paddingRight:6,paddingTop:2,textTransform:"uppercase"},jump:{alignItems:"center",backgroundColor:"$primary",borderRadius:14,color:"$onPrimary",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:12,grid:[44,"fr","auto"],lineHeight:25.5,marginTop:12,paddingBottom:8,paddingLeft:8,paddingRight:14,paddingTop:8,textAlign:"left",width:"100%"},jumpNoImage:{grid:["fr","auto"]},jumpImage:{backgroundColor:"$card",borderRadius:10,height:44,width:44},jumpSmall:{color:"$accent",fontFamily:"sans",fontSize:13,fontWeight:"800",lineHeight:19.5,textAlign:"left"},jumpStrong:{color:"$onPrimary",fontFamily:"sans",fontSize:15,fontWeight:"800",lineHeight:18.75,textAlign:"left"},jumpGo:{color:"$onPrimary",fontFamily:"sans",fontSize:14,fontWeight:"800",lineHeight:21,textAlign:"left"},steps:{backgroundColor:"$card",borderRadius:22,color:"$ink",fontFamily:"sans",fontSize:17,lineHeight:25.5,marginTop:14,paddingBottom:12,paddingLeft:12,paddingRight:12,paddingTop:16,shadow:{x:0,y:1,blur:3,color:"#262523",opacity:.06}},stepsHead:{alignItems:"baseline",color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:12,justifyContent:"space-between",lineHeight:25.5,paddingBottom:0,paddingLeft:4,paddingRight:4,paddingTop:0},stepsTitle:{alignItems:"center",color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:19,fontWeight:"800",gap:10,lineHeight:22.8,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0},stepsLabel:{color:"$ink3",fontFamily:"mono",fontSize:11,letterSpacing:.55,lineHeight:16.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0,textTransform:"uppercase"},n:{alignItems:"center",backgroundColor:"$primary",borderRadius:12,color:"$onPrimary",flexGrow:0,flexShrink:0,fontFamily:"sans",fontSize:12.5,fontWeight:"800",height:24,justifyContent:"center",lineHeight:15,width:24},tips:{color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:10,lineHeight:25.5,marginBottom:0,marginLeft:-12,marginRight:-12,marginTop:10,paddingBottom:2,paddingLeft:12,paddingRight:12,paddingTop:0},tip:{borderRadius:18,color:"$ink",flexBasis:"78%",flexDirection:"column",flexGrow:0,flexShrink:0,fontFamily:"sans",fontSize:17,lineHeight:25.5,maxWidth:280,paddingBottom:12,paddingLeft:14,paddingRight:14,paddingTop:14},tipY:{backgroundColor:"$accentChip"},tipC:{backgroundColor:"$linkChip"},tipG:{backgroundColor:"$clearChip"},tipR:{backgroundColor:"$riskChip"},tipTop:{alignItems:"center",color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,justifyContent:"space-between",lineHeight:25.5},tipIcon:{color:"$ink",height:26,width:26},tipN:{color:"$ink",fontFamily:"serif",fontSize:30,fontWeight:"900",lineHeight:30},tipStrong:{color:"$ink",fontFamily:"sans",fontSize:17,fontWeight:"800",lineHeight:21.25,marginTop:14},tipSmall:{color:"$ink2",fontFamily:"sans",fontSize:14.5,lineHeight:20.3,marginTop:4},tipEm:{color:"$link",fontFamily:"mono",fontSize:10.5,fontStyle:"normal",letterSpacing:.42,lineHeight:15.75,marginTop:"auto",paddingTop:10,textTransform:"uppercase"},tipList:{color:"$ink",fontFamily:"sans",fontSize:17,gap:2,lineHeight:25.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:6,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0},tipRow:{alignItems:"flex-start",color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:12,grid:[28,"fr"],lineHeight:25.5,paddingBottom:10,paddingLeft:6,paddingRight:6,paddingTop:10},tipRowN:{alignItems:"center",backgroundColor:"$accent4",borderRadius:8,color:"$ink",fontFamily:"serif",fontSize:16,fontWeight:"800",height:28,justifyContent:"center",lineHeight:16,width:28},tipRowStrong:{color:"$ink",fontFamily:"sans",fontSize:16,fontWeight:"800",lineHeight:20,marginTop:3},tipRowSmall:{color:"$ink2",fontFamily:"sans",fontSize:14.5,lineHeight:20.3,marginTop:3},tipRowEm:{color:"$link",fontFamily:"mono",fontSize:10.5,fontStyle:"normal",letterSpacing:.42,lineHeight:15.75,marginTop:5,textTransform:"uppercase"},sec:{backgroundColor:"$card",borderRadius:22,color:"$ink",fontFamily:"sans",fontSize:17,lineHeight:25.5,marginTop:14,paddingBottom:16,paddingLeft:16,paddingRight:16,paddingTop:16,shadow:{x:0,y:1,blur:3,color:"#262523",opacity:.06}},secTitle:{alignItems:"center",color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:19,fontWeight:"800",gap:10,lineHeight:22.8,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0},secN:{alignItems:"center",backgroundColor:"$primary",borderRadius:12,color:"$onPrimary",flexGrow:0,flexShrink:0,fontFamily:"sans",fontSize:12.5,fontWeight:"800",height:24,justifyContent:"center",lineHeight:15,width:24},pick:{backgroundColor:"transparent",borderRadius:16,color:"$ink",fontFamily:"sans",fontSize:17,lineHeight:25.5,marginTop:14,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0},pickTop:{alignItems:"center",color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:12,grid:[76,"fr"],lineHeight:25.5},pickImage:{backgroundColor:"$paper",borderRadius:14,height:76,overflow:"hidden",width:76},pickTitle:{color:"$ink",fontFamily:"sans",fontSize:17,fontWeight:"800",lineHeight:20.4,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0},stars:{alignItems:"center",color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:13.5,fontWeight:"800",gap:4,lineHeight:20.25,marginBottom:0,marginLeft:0,marginRight:0,marginTop:2},starsIcon:{color:"$watchDot",height:14,width:14},starsLabel:{color:"$ink3",fontFamily:"sans",fontSize:13.5,fontWeight:"500",lineHeight:20.25},pickLine:{color:"$ink2",fontFamily:"sans",fontSize:14,lineHeight:19.6,marginBottom:0,marginLeft:0,marginRight:0,marginTop:3},reviews:{color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:10,lineHeight:25.5,marginBottom:0,marginLeft:-16,marginRight:-16,marginTop:12,paddingBottom:0,paddingLeft:16,paddingRight:16,paddingTop:0},review:{backgroundColor:"$paper",borderRadius:14,color:"$ink",flexBasis:"78%",flexGrow:0,flexShrink:0,fontFamily:"sans",fontSize:17,lineHeight:25.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0,maxWidth:280,paddingBottom:12,paddingLeft:14,paddingRight:14,paddingTop:12},reviewsStack:{color:"$ink",fontFamily:"sans",fontSize:17,gap:8,lineHeight:25.5,marginTop:12},reviewCard:{backgroundColor:"$paper",borderRadius:14,color:"$ink",fontFamily:"sans",fontSize:17,lineHeight:25.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0,paddingBottom:12,paddingLeft:14,paddingRight:14,paddingTop:12},reviewStars:{color:"$watchDot",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:1,lineHeight:25.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0},reviewStar:{height:13,width:13},reviewText:{color:"$ink",fontFamily:"sans",fontSize:15,lineHeight:21,marginBottom:0,marginLeft:0,marginRight:0,marginTop:5},reviewBy:{color:"$ink3",fontFamily:"sans",fontSize:13,lineHeight:19.5,marginTop:4},why:{borderRadius:16,color:"$ink",fontFamily:"sans",fontSize:17,inner:{width:1.5,color:"$ink"},lineHeight:25.5,marginTop:14,paddingBottom:12,paddingLeft:14,paddingRight:14,paddingTop:12},whyMini:{color:"$ink3",fontFamily:"mono",fontSize:10.5,letterSpacing:.63,lineHeight:15.75,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0,textTransform:"uppercase"},whyList:{color:"$ink",fontFamily:"sans",fontSize:17,lineHeight:25.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0},whyRow:{alignItems:"flex-start",color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:10,grid:[58,"fr"],lineHeight:25.5,marginTop:10},whyStrong:{color:"$ink",fontFamily:"sans",fontSize:15,fontWeight:"800",lineHeight:19.5},whySmall:{color:"$ink2",fontFamily:"sans",fontSize:14,lineHeight:19.6,marginTop:1},chip:{alignItems:"center",borderRadius:6,color:"$ink",fontFamily:"mono",fontSize:10.5,fontWeight:"700",height:22,justifyContent:"center",letterSpacing:.42,lineHeight:15.75,textTransform:"uppercase"},chipDna:{backgroundColor:"$linkWash",color:"$link"},chipAsk:{backgroundColor:"$accent4",color:"$ink"},chipRec:{backgroundColor:"$tile",color:"$ink2"},score:{alignItems:"center",backgroundColor:"$primary",borderRadius:12,color:"$onPrimary",flexDirection:"row",fontFamily:"sans",fontSize:14.5,fontWeight:"800",gap:8,justifyContent:"space-between",lineHeight:18.85,marginBottom:0,marginLeft:0,marginRight:0,marginTop:12,paddingBottom:11,paddingLeft:14,paddingRight:12,paddingTop:11},scoreValue:{color:"$accent",flexGrow:0,flexShrink:0,fontFamily:"mono",fontSize:16,fontWeight:"700",lineHeight:20.8},dose:{backgroundColor:"$linkWash",borderRadius:16,color:"$ink",fontFamily:"sans",fontSize:17,lineHeight:25.5,marginTop:10,paddingBottom:14,paddingLeft:14,paddingRight:14,paddingTop:12},doseMini:{color:"$link",fontFamily:"mono",fontSize:10.5,letterSpacing:.63,lineHeight:15.75,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0,textTransform:"uppercase"},doseList:{color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:8,grid:["fr","fr","fr"],lineHeight:25.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:10,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0},doseItem:{alignItems:"center",backgroundColor:"$card",borderRadius:12,color:"$ink",fontFamily:"sans",fontSize:17,gap:2,lineHeight:25.5,paddingBottom:10,paddingLeft:4,paddingRight:4,paddingTop:10,textAlign:"center"},doseValue:{color:"$ink",fontFamily:"mono",fontSize:21,fontVariant:["tabular-nums"],fontWeight:"700",lineHeight:23.1,textAlign:"center"},doseLabel:{color:"$ink2",fontFamily:"sans",fontSize:12.5,lineHeight:16.25,textAlign:"center"},doseNote:{color:"$link",fontFamily:"sans",fontSize:14,lineHeight:20.3,marginBottom:0,marginLeft:0,marginRight:0,marginTop:10},ingredients:{color:"$ink",flexDirection:"row",flexWrap:"wrap",fontFamily:"sans",fontSize:17,gap:6,lineHeight:25.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:12},ingredient:{backgroundColor:"$tile",borderRadius:999,color:"$ink",fontFamily:"sans",fontSize:13.5,fontWeight:"600",lineHeight:20.25,paddingBottom:6,paddingLeft:10,paddingRight:10,paddingTop:6},opts:{color:"$ink",fontFamily:"sans",fontSize:17,gap:8,lineHeight:25.5,marginTop:14},opt:{alignItems:"center",backgroundColor:"$card",borderRadius:16,color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:12,inner:{width:1.5,color:"$n_DEDCD7"},justifyContent:"space-between",lineHeight:25.5,paddingBottom:14,paddingLeft:14,paddingRight:14,paddingTop:14,textAlign:"left",width:"100%"},optOn:{inner:{width:2.5,color:"$ink"}},optOnce:{backgroundColor:"$paper",inner:null,paddingBottom:10,paddingLeft:14,paddingRight:14,paddingTop:10,shadow:null},optOnceOn:{backgroundColor:"$card",inner:{width:2,color:"$ink"}},optText:{alignItems:"flex-start",color:"$ink",fontFamily:"sans",fontSize:17,gap:2,lineHeight:25.5,textAlign:"left"},optStrong:{color:"$ink",fontFamily:"sans",fontSize:16,fontWeight:"800",lineHeight:24,textAlign:"left"},optOnceStrong:{fontSize:15,fontWeight:"700",lineHeight:22.5},optSmall:{color:"$ink2",fontFamily:"sans",fontSize:13.5,lineHeight:20.25,textAlign:"left"},optOnceSmall:{fontSize:13,lineHeight:19.5},optTag:{backgroundColor:"$riskInk",borderRadius:6,color:"$card",fontFamily:"sans",fontSize:12,fontWeight:"800",lineHeight:18,marginBottom:4,paddingBottom:2,paddingLeft:8,paddingRight:8,paddingTop:2,textAlign:"left"},price:{alignItems:"flex-end",color:"$ink",columnGap:8,flexDirection:"column",flexWrap:"nowrap",fontFamily:"sans",fontSize:17,lineHeight:25.5,minWidth:0,rowGap:0,textAlign:"left"},priceValue:{color:"$ink",fontFamily:"sans",fontSize:24,fontVariant:["tabular-nums"],fontWeight:"800",lineHeight:26.4,textAlign:"left"},priceWas:{color:"$riskInk",fontFamily:"sans",fontSize:15,fontWeight:"700",lineHeight:22.5,textAlign:"left",textDecorationLine:"line-through"},optPrice:{color:"$ink",fontFamily:"sans",fontSize:18,fontWeight:"800",lineHeight:27,textAlign:"left"},optOncePrice:{color:"$ink2",fontSize:15,fontWeight:"700",lineHeight:22.5},buy:{alignItems:"center",color:"$ink",fontFamily:"sans",fontSize:17,gap:12,justifyContent:"space-between",lineHeight:25.5,marginTop:12},button:{alignItems:"center",alignSelf:"flex-start",backgroundColor:"$primary",borderRadius:999,color:"$onPrimary",flexDirection:"row",flexGrow:0,flexShrink:0,fontFamily:"sans",fontSize:17,fontWeight:"700",gap:8,justifyContent:"center",lineHeight:25.5,minHeight:52,paddingBottom:0,paddingLeft:20,paddingRight:20,paddingTop:0,textDecorationLine:"none",width:"100%"},buttonDisabled:{opacity:.32},proof:{alignItems:"center",color:"$riskInk",flexDirection:"row",fontFamily:"sans",fontSize:14.5,fontWeight:"800",gap:6,justifyContent:"center",lineHeight:21.75,marginBottom:0,marginLeft:0,marginRight:0,marginTop:10},proofIcon:{flexGrow:0,flexShrink:0,height:21,marginTop:-2,width:21},trust:{color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:6,grid:["fr","fr","fr"],lineHeight:25.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:12,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0},trustItem:{alignItems:"center",color:"$ink2",fontFamily:"sans",fontSize:12.5,fontWeight:"600",gap:4,lineHeight:16.25,textAlign:"center"},trustIcon:{color:"$link",height:20,width:20},on:{alignItems:"center",backgroundColor:"$clearBg",borderRadius:14,color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:10,grid:[34,"fr","auto"],lineHeight:25.5,marginTop:12,paddingBottom:10,paddingLeft:12,paddingRight:10,paddingTop:10},onIcon:{alignItems:"center",backgroundColor:"$clearDot",borderRadius:17,color:"$card",fontFamily:"sans",fontSize:17,height:34,justifyContent:"center",lineHeight:25.5,width:34},onIconSvg:{height:18,width:18},onStrong:{color:"$clearInk",fontFamily:"sans",fontSize:15,fontWeight:"700",lineHeight:18.75},onSmall:{color:"$ink2",fontFamily:"sans",fontSize:13,lineHeight:17.55,marginTop:1},onButton:{backgroundColor:"$card",borderRadius:999,color:"$ink",fontFamily:"sans",fontSize:14,fontWeight:"800",inner:{width:1.5,color:"$ink"},lineHeight:21,minHeight:38,paddingBottom:0,paddingLeft:14,paddingRight:14,paddingTop:0},more:{color:"$ink",columnGap:18,flexDirection:"row",flexWrap:"wrap",fontFamily:"sans",fontSize:17,lineHeight:25.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:8,rowGap:0},moreButton:{backgroundColor:"transparent",color:"$link",fontFamily:"sans",fontSize:14,fontWeight:"700",lineHeight:21,minHeight:34,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0,textDecorationLine:"underline"},fine:{color:"$ink3",fontFamily:"sans",fontSize:13,lineHeight:18.85,marginBottom:0,marginLeft:0,marginRight:0,marginTop:8},others:{backgroundColor:"$card",borderRadius:22,color:"$ink",fontFamily:"sans",fontSize:17,lineHeight:25.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:14,paddingBottom:16,paddingLeft:16,paddingRight:16,paddingTop:16,shadow:{x:0,y:1,blur:3,color:"#262523",opacity:.06}},sign:{borderRadius:16,color:"$ink",fontFamily:"sans",fontSize:17,inner:{width:1.5,color:"$n_DEDCD7"},lineHeight:25.5,marginTop:12,paddingBottom:14,paddingLeft:14,paddingRight:14,paddingTop:14},signUrgent:{backgroundColor:"$riskBg",inner:null,shadow:null},signTitle:{alignItems:"center",color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:16,fontWeight:"800",gap:8,lineHeight:20,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0},signUrgentTitle:{color:"$riskInk"},signUrgentIcon:{height:20,width:20},signBody:{color:"$ink2",fontFamily:"sans",fontSize:15,lineHeight:21.75,marginBottom:0,marginLeft:0,marginRight:0,marginTop:4},signUrgentBody:{color:"$ink"},questionsKicker:{color:"$ink",fontFamily:"sans",fontSize:16,fontWeight:"800",lineHeight:20,marginBottom:0,marginLeft:0,marginRight:0,marginTop:18},questions:{color:"$ink",fontFamily:"sans",fontSize:15,gap:6,lineHeight:21.75,marginBottom:0,marginLeft:0,marginRight:0,marginTop:10,paddingLeft:22},questionsAfterKicker:{marginTop:6},add:{alignItems:"center",backgroundColor:"transparent",borderRadius:999,color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:16,fontWeight:"800",inner:{width:2,color:"$ink"},justifyContent:"center",lineHeight:24,marginTop:14,minHeight:48,paddingBottom:0,paddingLeft:16,paddingRight:16,paddingTop:0,width:"100%"},addOn:{backgroundColor:"$clearBg",color:"$clearInk",inner:null,shadow:null},askRow:{alignItems:"center",backgroundColor:"$linkWash",borderRadius:16,color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:12,grid:[40,"fr",18],lineHeight:25.5,marginTop:10,paddingBottom:12,paddingLeft:12,paddingRight:14,paddingTop:12,textAlign:"left",width:"100%"},askRowInSec:{marginTop:12},askRowIcon:{alignItems:"center",backgroundColor:"$card",borderRadius:11,color:"$link",fontFamily:"sans",fontSize:17,height:40,justifyContent:"center",lineHeight:25.5,textAlign:"left",width:40},askRowIconSvg:{height:21,width:21},askRowStrong:{color:"$ink",fontFamily:"sans",fontSize:15.5,fontWeight:"800",lineHeight:20.15,textAlign:"left"},askRowSmall:{color:"$ink2",fontFamily:"sans",fontSize:14,lineHeight:19.6,marginTop:1,textAlign:"left"},askRowChev:{color:"$ink2",height:18,width:18},extras:{color:"$ink",fontFamily:"sans",fontSize:17,gap:10,lineHeight:25.5,marginTop:22},extrasTitle:{color:"$ink3",fontFamily:"mono",fontSize:11,fontWeight:"400",letterSpacing:.77,lineHeight:12.65,marginBottom:0,marginLeft:4,marginRight:4,marginTop:0,textTransform:"uppercase"},extra:{alignItems:"flex-start",backgroundColor:"$card",borderRadius:22,color:"$ink",columnGap:12,flexDirection:"row",fontFamily:"sans",fontSize:17,grid:[56,"fr"],lineHeight:25.5,paddingBottom:14,paddingLeft:14,paddingRight:14,paddingTop:14,rowGap:4,shadow:{x:0,y:1,blur:3,color:"#262523",opacity:.06}},extraKit:{backgroundColor:"$linkWash",inner:null,shadow:null},extraImage:{backgroundColor:"$card",borderRadius:14,height:56,width:56},extraKitImage:{backgroundColor:"$card"},extraIcon:{alignItems:"center",backgroundColor:"$linkWash",borderRadius:14,color:"$link",height:56,justifyContent:"center",width:56},extraIconSvg:{height:26,width:26},extraTitle:{color:"$ink",fontFamily:"sans",fontSize:17,fontWeight:"800",lineHeight:20.4,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0},extraTitleSerif:{fontFamily:"serif",fontSize:21,fontWeight:"800",letterSpacing:-.21,lineHeight:25.2},extraBody:{color:"$ink2",fontFamily:"sans",fontSize:14.5,lineHeight:20.3,marginBottom:0,marginLeft:0,marginRight:0,marginTop:3},extraPrice:{alignItems:"center",color:"$ink",columnGap:8,flexDirection:"row",flexWrap:"wrap",fontFamily:"sans",fontSize:14.5,lineHeight:20.3,marginBottom:0,marginLeft:0,marginRight:0,marginTop:6,rowGap:0},extraPriceValue:{color:"$ink",fontFamily:"sans",fontSize:19,fontVariant:["tabular-nums"],fontWeight:"800",lineHeight:26.6},extraPriceWas:{color:"$ink3",fontFamily:"sans",fontSize:14,fontWeight:"700",lineHeight:19.6,textDecorationLine:"line-through"},extraGo:{backgroundColor:"$primary",borderRadius:999,color:"$onPrimary",fontFamily:"sans",fontSize:14.5,fontWeight:"800",lineHeight:21.75,marginTop:8,minHeight:40,paddingBottom:0,paddingLeft:18,paddingRight:18,paddingTop:0},extraGoOn:{backgroundColor:"$clearBg",color:"$clearInk"},wait:{backgroundColor:"$card",borderRadius:22,color:"$ink",fontFamily:"sans",fontSize:17,lineHeight:25.5,marginTop:14,paddingBottom:16,paddingLeft:16,paddingRight:16,paddingTop:16,shadow:{x:0,y:1,blur:3,color:"#262523",opacity:.06}},waitTop:{alignItems:"center",color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:12,grid:[46,"fr"],lineHeight:25.5},waitTile:{alignItems:"center",backgroundColor:"$linkWash",borderRadius:13,color:"$link",flexGrow:0,flexShrink:0,fontFamily:"sans",fontSize:22,height:46,justifyContent:"center",lineHeight:33,width:46},waitTileSvg:{height:23,width:23},waitMini:{color:"$ink3",fontFamily:"mono",fontSize:10.5,letterSpacing:.63,lineHeight:15.75,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0,textTransform:"uppercase"},waitTitle:{color:"$ink",fontFamily:"serif",fontSize:26,fontWeight:"800",letterSpacing:-.26,lineHeight:27.3,marginBottom:0,marginLeft:0,marginRight:0,marginTop:2},waitKey:{color:"$ink",fontFamily:"sans",fontSize:16,fontWeight:"800",lineHeight:24,marginBottom:0,marginLeft:0,marginRight:0,marginTop:18},waitText:{alignItems:"center",color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:15.5,fontWeight:"700",gap:8,lineHeight:23.25,marginBottom:12,marginLeft:0,marginRight:0,marginTop:16},waitTextSvg:{color:"$link",flexGrow:0,flexShrink:0,height:20,width:20},waitButton:{alignItems:"center",alignSelf:"flex-start",backgroundColor:"$primary",borderRadius:999,color:"$onPrimary",flexDirection:"row",fontFamily:"sans",fontSize:16,fontWeight:"700",gap:8,justifyContent:"center",lineHeight:24,minHeight:48,paddingBottom:0,paddingLeft:22,paddingRight:22,paddingTop:0,textDecorationLine:"none",width:"100%"},track:{color:"$ink",fontFamily:"sans",fontSize:17,lineHeight:25.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:14,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0},trackStep:{color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:12,grid:[22,"fr"],lineHeight:25.5,paddingBottom:16,position:"relative"},trackStepLast:{paddingBottom:0},trackLine:{backgroundColor:"$n_E2DFD9",borderRadius:1,bottom:-2,left:10,position:"absolute",top:20,width:2},trackLineDone:{backgroundColor:"$primary"},trackDot:{alignItems:"center",backgroundColor:"$card",borderRadius:11,height:22,inner:{width:2,color:"$n_CFCBC4"},justifyContent:"center",position:"relative",width:22,zIndex:1},trackDotDone:{backgroundColor:"$primary",inner:null,shadow:null},trackDotNow:{backgroundColor:"$accent",inner:{width:2,color:"$ink"}},trackDotSvg:{color:"$card",height:13,width:13},trackTitle:{color:"$ink",fontFamily:"sans",fontSize:15.5,fontWeight:"800",lineHeight:20.15},trackTitleTodo:{color:"$ink3",fontWeight:"700"},trackDetail:{color:"$ink3",fontFamily:"sans",fontSize:14,lineHeight:18.9,marginTop:1},trackTag:{backgroundColor:"$ink",borderRadius:5,color:"$onInk",fontFamily:"mono",fontSize:10,letterSpacing:.6,lineHeight:13.5,paddingBottom:2,paddingLeft:6,paddingRight:6,paddingTop:2,textTransform:"uppercase"},next:{backgroundColor:"$card",borderRadius:18,color:"$ink",fontFamily:"sans",fontSize:17,lineHeight:25.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:22,paddingBottom:4,paddingLeft:16,paddingRight:16,paddingTop:4,shadow:{x:0,y:1,blur:3,color:"#262523",opacity:.06},textAlign:"left"},nextIn:{backgroundColor:"$paper",inner:null,marginTop:8,shadow:null},nextRow:{alignItems:"center",color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:12,grid:[36,"fr"],lineHeight:25.5,paddingBottom:10,paddingLeft:0,paddingRight:0,paddingTop:10,textAlign:"left"},nextIcon:{alignItems:"center",backgroundColor:"$linkWash",borderRadius:11,color:"$link",fontFamily:"sans",fontSize:17,height:36,justifyContent:"center",lineHeight:25.5,textAlign:"left",width:36},nextIconSvg:{height:19,width:19},nextIconImage:{borderRadius:11,height:"100%",width:"100%"},nextLabel:{color:"$ink3",fontFamily:"mono",fontSize:10.5,letterSpacing:.53,lineHeight:15.75,textAlign:"left",textTransform:"uppercase"},nextText:{color:"$ink",fontFamily:"sans",fontSize:15,fontWeight:"600",lineHeight:20.25,marginTop:1,textAlign:"left"},done:{color:"$ink",fontFamily:"sans",fontSize:17,lineHeight:25.5,paddingBottom:20,paddingLeft:22,paddingRight:22,paddingTop:40,textAlign:"center"},doneCheck:{alignItems:"center",backgroundColor:"$accent",borderRadius:38,color:"$ink",fontFamily:"sans",fontSize:17,height:76,justifyContent:"center",lineHeight:25.5,marginBottom:0,marginLeft:"auto",marginRight:"auto",marginTop:0,textAlign:"center",width:76},doneCheckSvg:{height:38,width:38},doneTitle:{color:"$ink",fontFamily:"serif",fontSize:34,fontWeight:"800",letterSpacing:-.34,lineHeight:39.1,marginBottom:0,marginLeft:0,marginRight:0,marginTop:20,textAlign:"center"},doneWhen:{color:"$ink",fontFamily:"sans",fontSize:16,fontWeight:"700",lineHeight:24,marginBottom:0,marginLeft:0,marginRight:0,marginTop:10,textAlign:"center"},doneWho:{color:"$ink2",fontFamily:"sans",fontSize:15,lineHeight:22.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:2,textAlign:"center"},pushFoot:{backgroundColor:"$paper",borderTopColor:"$line",borderTopWidth:1,color:"$ink",flexGrow:0,flexShrink:0,fontFamily:"sans",fontSize:17,lineHeight:25.5,paddingBottom:34,paddingLeft:18,paddingRight:18,paddingTop:12},pushFootStack:{color:"$ink",fontFamily:"sans",fontSize:17,gap:10,lineHeight:25.5},shop:{color:"$ink",fontFamily:"sans",fontSize:17,gap:12,lineHeight:25.5,paddingBottom:28,paddingLeft:18,paddingRight:18,paddingTop:8},shopTitle:{color:"$ink",fontFamily:"serif",fontSize:29,fontWeight:"800",letterSpacing:-.29,lineHeight:31.32,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0},shopSub:{color:"$ink2",fontFamily:"sans",fontSize:15,lineHeight:21.75,marginBottom:0,marginLeft:0,marginRight:0,marginTop:-6},shopKey:{color:"$ink",fontFamily:"sans",fontSize:16,fontWeight:"800",lineHeight:18.4,marginBottom:-4,marginLeft:2,marginRight:2,marginTop:6},shopCard:{backgroundColor:"$card",borderRadius:22,color:"$ink",fontFamily:"sans",fontSize:17,lineHeight:25.5,paddingBottom:14,paddingLeft:16,paddingRight:16,paddingTop:14,shadow:{x:0,y:1,blur:3,color:"#262523",opacity:.06}},shopFine:{color:"$ink3",fontFamily:"sans",fontSize:13,lineHeight:18.85,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0},shopFineCenter:{marginTop:14,textAlign:"center"},shopEmpty:{alignItems:"center",color:"$ink",fontFamily:"sans",fontSize:17,gap:8,lineHeight:25.5,paddingBottom:8,paddingLeft:12,paddingRight:12,paddingTop:48,textAlign:"center"},shopEmptyTile:{alignItems:"center",backgroundColor:"$linkWash",borderRadius:20,color:"$link",flexGrow:0,flexShrink:0,fontFamily:"sans",fontSize:22,height:72,justifyContent:"center",lineHeight:33,marginBottom:8,textAlign:"center",width:72},shopEmptyTileSvg:{height:34,width:34},shopEmptyTitle:{color:"$ink",fontFamily:"serif",fontSize:28,fontWeight:"800",letterSpacing:-.28,lineHeight:30.8,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0,textAlign:"center"},shopEmptyText:{color:"$ink2",fontFamily:"sans",fontSize:15.5,lineHeight:22.48,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0,maxWidth:298.07,textAlign:"center"},shopEmptyButton:{alignItems:"center",alignSelf:"flex-start",backgroundColor:"$primary",borderRadius:999,color:"$onPrimary",flexDirection:"row",fontFamily:"sans",fontSize:16,fontWeight:"700",gap:8,justifyContent:"center",lineHeight:24,marginTop:12,minHeight:48,paddingBottom:0,paddingLeft:22,paddingRight:22,paddingTop:0,textAlign:"center",textDecorationLine:"none"},shopLink:{backgroundColor:"transparent",color:"$link",fontFamily:"sans",fontSize:15,fontWeight:"700",lineHeight:22.5,minHeight:40,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0,textDecorationLine:"underline"},shopActions:{alignItems:"center",color:"$ink",fontFamily:"sans",fontSize:17,gap:4,lineHeight:25.5,marginTop:4},orderList:{color:"$ink",fontFamily:"sans",fontSize:17,gap:10,lineHeight:25.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0},order:{alignItems:"center",backgroundColor:"$card",borderRadius:22,color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:10,grid:["fr",18],lineHeight:25.5,paddingBottom:14,paddingLeft:16,paddingRight:14,paddingTop:14,shadow:{x:0,y:1,blur:3,color:"#262523",opacity:.06},textAlign:"left",width:"100%"},orderChev:{color:"$ink3",height:18,width:18},orderTop:{alignItems:"center",color:"$ink",columnGap:10,flexDirection:"row",flexWrap:"wrap",fontFamily:"sans",fontSize:17,lineHeight:25.5,rowGap:4,textAlign:"left"},orderNo:{color:"$ink3",fontFamily:"mono",fontSize:12,letterSpacing:.48,lineHeight:18,textAlign:"left"},orderWhat:{color:"$ink",fontFamily:"sans",fontSize:16,fontWeight:"800",lineHeight:20.8,marginTop:8,textAlign:"left"},orderMeta:{color:"$ink3",fontFamily:"sans",fontSize:14,lineHeight:19.6,marginTop:2,textAlign:"left"},orderPics:{color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:6,lineHeight:25.5,marginTop:10,textAlign:"left"},orderPic:{alignItems:"center",backgroundColor:"$linkWash",borderRadius:10,color:"$link",fontFamily:"sans",fontSize:17,height:40,justifyContent:"center",lineHeight:25.5,overflow:"hidden",textAlign:"left",width:40},orderPicImage:{height:"100%",width:"100%"},orderPicSvg:{height:20,width:20},pill:{alignItems:"center",alignSelf:"flex-start",backgroundColor:"$accent3",borderRadius:999,color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:13,fontWeight:"800",gap:6,lineHeight:19.5,minHeight:26,paddingBottom:0,paddingLeft:10,paddingRight:10,paddingTop:0,textAlign:"left"},pillDone:{backgroundColor:"$clearBg",color:"$clearInk"},pillSub:{backgroundColor:"$linkWash",color:"$link"},cartItems:{color:"$ink",fontFamily:"sans",fontSize:17,gap:18,lineHeight:25.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0},cartItem:{alignItems:"flex-start",color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:12,grid:[64,"fr"],lineHeight:25.5},cartItemImage:{alignItems:"center",backgroundColor:"$linkWash",borderRadius:14,color:"$link",fontFamily:"sans",fontSize:17,height:64,justifyContent:"center",lineHeight:25.5,overflow:"hidden",width:64},cartItemImageSvg:{height:28,width:28},cartItemTitle:{color:"$ink",fontFamily:"sans",fontSize:16.5,fontWeight:"800",lineHeight:20.63,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0},cartItemPrice:{alignItems:"center",color:"$ink",columnGap:8,flexDirection:"row",flexWrap:"wrap",fontFamily:"sans",fontSize:17,lineHeight:25.5,marginTop:3,rowGap:2},cartItemPriceValue:{color:"$ink",fontFamily:"sans",fontSize:16,fontVariant:["tabular-nums"],fontWeight:"800",lineHeight:24},cartItemPriceWas:{color:"$ink3",fontFamily:"sans",fontSize:14,fontWeight:"600",lineHeight:21,textDecorationLine:"line-through"},cartItemPriceNote:{color:"$ink3",fontFamily:"sans",fontSize:14,lineHeight:21},cartItemActions:{alignItems:"center",color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:16,lineHeight:25.5,marginTop:8},stepper:{alignItems:"center",alignSelf:"flex-start",backgroundColor:"$card",borderRadius:999,color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,grid:[40,30,40],height:40,inner:{width:1.5,color:"$n_DAD7D1"},lineHeight:25.5},stepperButton:{alignItems:"center",backgroundColor:"transparent",borderRadius:999,color:"$ink",fontFamily:"sans",fontSize:17,height:40,justifyContent:"center",lineHeight:25.5,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0},stepperButtonDisabled:{opacity:.3},stepperButtonSvg:{height:16,width:16},stepperValue:{color:"$ink",fontFamily:"sans",fontSize:15.5,fontVariant:["tabular-nums"],fontWeight:"800",lineHeight:23.25,textAlign:"center"},remove:{backgroundColor:"transparent",color:"$ink2",fontFamily:"sans",fontSize:14.5,fontWeight:"700",lineHeight:21.75,minHeight:40,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0,textDecorationLine:"underline"},mode:{color:"$ink",fontFamily:"sans",fontSize:17,gap:6,lineHeight:25.5,marginTop:8},modeButton:{alignItems:"center",backgroundColor:"$paper",borderRadius:12,color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:14.5,fontWeight:"700",gap:10,justifyContent:"space-between",lineHeight:18.85,minHeight:44,paddingBottom:8,paddingLeft:12,paddingRight:12,paddingTop:8,textAlign:"left"},modeButtonOn:{backgroundColor:"$card",inner:{width:2,color:"$ink"}},modePrice:{color:"$ink",fontFamily:"sans",fontSize:14.5,fontVariant:["tabular-nums"],fontWeight:"800",lineHeight:18.85,textAlign:"left"},every:{backgroundColor:"$card",borderRadius:999,color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:4,grid:["fr","fr","fr"],inner:{width:1.5,color:"$n_DAD7D1"},lineHeight:25.5,marginTop:8,paddingBottom:4,paddingLeft:4,paddingRight:4,paddingTop:4},everyButton:{backgroundColor:"transparent",borderRadius:999,color:"$ink",fontFamily:"sans",fontSize:14,fontWeight:"700",lineHeight:21,minHeight:36,paddingBottom:0,paddingLeft:6,paddingRight:6,paddingTop:0,textAlign:"center"},everyButtonOn:{backgroundColor:"$primary",color:"$onPrimary"},summary:{backgroundColor:"$card",borderRadius:16,color:"$ink",fontFamily:"sans",fontSize:17,lineHeight:25.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0,paddingBottom:6,paddingLeft:16,paddingRight:16,paddingTop:6,shadow:{x:0,y:1,blur:3,color:"#262523",opacity:.06}},summaryRow:{alignItems:"center",color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:15,fontVariant:["tabular-nums"],gap:12,justifyContent:"space-between",lineHeight:22.5,minHeight:34},summaryLabel:{alignItems:"center",alignSelf:"flex-start",color:"$ink2",flexDirection:"row",fontFamily:"sans",fontSize:15,fontVariant:["tabular-nums"],gap:8,lineHeight:22.5},summaryTotal:{fontSize:17,fontWeight:"800",lineHeight:25.5,minHeight:42},summaryTotalLabel:{color:"$ink"},summaryRenew:{fontSize:14,lineHeight:21,marginTop:-6,minHeight:28},summaryTag:{backgroundColor:"$ink",borderRadius:5,color:"$onInk",fontFamily:"mono",fontSize:10,fontVariant:["tabular-nums"],letterSpacing:.6,lineHeight:15,paddingBottom:2,paddingLeft:6,paddingRight:6,paddingTop:2,textTransform:"uppercase"},foot:{color:"$ink",fontFamily:"sans",fontSize:17,gap:8,lineHeight:25.5},footFine:{color:"$ink3",fontFamily:"sans",fontSize:13,lineHeight:18.85,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0,textAlign:"center"},co:{color:"$ink",fontFamily:"sans",fontSize:17,gap:10,lineHeight:25.5,marginTop:2},coProduct:{alignItems:"center",color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:12,grid:[56,"fr"],lineHeight:25.5},coProductImage:{alignItems:"center",backgroundColor:"$accent3",borderRadius:14,color:"$ink",fontFamily:"sans",fontSize:17,height:56,justifyContent:"center",lineHeight:25.5,overflow:"hidden",width:56},coProductImageSvg:{height:30,width:30},coProductTitle:{color:"$ink2",fontFamily:"sans",fontSize:14,fontWeight:"800",lineHeight:18.9,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0},coProductLine:{color:"$ink2",fontFamily:"sans",fontSize:14,lineHeight:18.9,marginBottom:0,marginLeft:0,marginRight:0,marginTop:2},coOptions:{color:"$ink",fontFamily:"sans",fontSize:17,gap:8,lineHeight:25.5,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0},coOption:{borderRadius:16,color:"$ink",fontFamily:"sans",fontSize:17,inner:{width:1.5,color:"$n_DAD7D1"},lineHeight:25.5},coOptionOn:{backgroundColor:"$accent4",inner:{width:2,color:"$ink"}},coOptionHit:{alignItems:"flex-start",backgroundColor:"transparent",borderRadius:16,color:"$ink",columnGap:12,flexDirection:"row",fontFamily:"sans",fontSize:17,grid:[22,"fr","auto"],lineHeight:25.5,paddingBottom:12,paddingLeft:14,paddingRight:14,paddingTop:12,rowGap:2,textAlign:"left",width:"100%"},coOptionStrong:{color:"$ink",fontFamily:"sans",fontSize:16,fontWeight:"700",lineHeight:21.6,textAlign:"left"},coOptionSmall:{color:"$ink2",fontFamily:"sans",fontSize:13,lineHeight:18.2,textAlign:"left"},coOptionPrice:{color:"$ink",fontFamily:"sans",fontSize:16,fontVariant:["tabular-nums"],fontWeight:"800",lineHeight:21.6,textAlign:"right"},coOptionPriceWas:{color:"$riskInk",fontFamily:"sans",fontSize:13,fontVariant:["tabular-nums"],fontWeight:"600",lineHeight:17.55,textAlign:"right",textDecorationLine:"line-through"},coRadio:{alignItems:"center",borderRadius:11,height:22,inner:{width:2,color:"$n_BDB9B2"},justifyContent:"center",width:22},coRadioOn:{inner:{width:7,color:"$ink"}},coKicker:{color:"$ink3",fontFamily:"mono",fontSize:10.5,letterSpacing:.63,lineHeight:15.75,marginBottom:6,marginLeft:0,marginRight:0,marginTop:0,textTransform:"uppercase"},coWhen:{color:"$ink",fontFamily:"sans",fontSize:17,lineHeight:25.5,paddingBottom:12,paddingLeft:48,paddingRight:14,paddingTop:0},coItems:{color:"$ink",fontFamily:"sans",fontSize:17,gap:10,lineHeight:25.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0},coItem:{alignItems:"center",color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:15,gap:12,grid:[44,"fr","auto"],lineHeight:22.5},coItemPic:{alignItems:"center",backgroundColor:"$linkWash",borderRadius:10,color:"$link",fontFamily:"sans",fontSize:15,height:44,justifyContent:"center",lineHeight:22.5,overflow:"hidden",width:44},coItemStrong:{color:"$ink",fontFamily:"sans",fontSize:15.5,fontWeight:"800",lineHeight:19.38},coItemSmall:{color:"$ink3",fontFamily:"sans",fontSize:13.5,lineHeight:20.25},coItemValue:{color:"$ink",fontFamily:"sans",fontSize:15,fontVariant:["tabular-nums"],fontWeight:"800",lineHeight:22.5},coRows:{backgroundColor:"$paper",borderRadius:16,color:"$ink",fontFamily:"sans",fontSize:17,lineHeight:25.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0,paddingBottom:2,paddingLeft:14,paddingRight:14,paddingTop:2},coRow:{alignItems:"center",color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:14.5,gap:10,grid:[20,73.6,"fr"],lineHeight:21.75,minHeight:40},coRowSvg:{color:"$ink2",height:20,width:20},coRowLabel:{color:"$ink3",fontFamily:"sans",fontSize:14.5,lineHeight:21.75},coRowValue:{color:"$ink",fontFamily:"sans",fontSize:14.5,fontWeight:"700",lineHeight:21.75},coRowsShop:{backgroundColor:"$card",shadow:{x:0,y:1,blur:3,color:"#262523",opacity:.06}},coFine:{color:"$ink3",fontFamily:"sans",fontSize:12.5,lineHeight:18.13,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0,textAlign:"center"},coSummary:{backgroundColor:"$paper",borderRadius:16,color:"$ink",fontFamily:"sans",fontSize:17,inner:null,lineHeight:25.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0,paddingBottom:6,paddingLeft:16,paddingRight:16,paddingTop:6,shadow:null},weightField:{color:"$ink",fontFamily:"sans",fontSize:15,fontWeight:"700",gap:8,lineHeight:22.5,marginTop:14},weightInputWrap:{color:"$ink",fontFamily:"sans",fontSize:15,fontWeight:"700",lineHeight:22.5,position:"relative"},weightInput:{backgroundColor:"$card",borderRadius:16,color:"$ink",fontFamily:"sans",fontSize:24,fontVariant:["tabular-nums"],fontWeight:"800",height:58,inner:{width:1.5,color:"$n_DAD7D1"},lineHeight:36,paddingBottom:0,paddingLeft:18,paddingRight:56,paddingTop:0,width:"100%"},weightInputFocus:{inner:{width:2.5,color:"$ink"}},weightUnit:{color:"$ink3",fontFamily:"sans",fontSize:17,fontWeight:"700",lineHeight:25.5,position:"absolute",right:18,top:"50%"},weightError:{color:"$riskInk",fontFamily:"sans",fontSize:14,fontWeight:"700",lineHeight:21,marginBottom:0,marginLeft:0,marginRight:0,marginTop:6,minHeight:20},weightActions:{color:"$ink",fontFamily:"sans",fontSize:17,gap:8,lineHeight:25.5,marginTop:10},subCard:{alignItems:"center",backgroundColor:"$clearBg",borderRadius:22,color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,gap:12,grid:[56,"fr","auto"],lineHeight:25.5,paddingBottom:12,paddingLeft:12,paddingRight:14,paddingTop:12},subCardImage:{backgroundColor:"$card",borderRadius:14,height:56,width:56},subCardStrong:{color:"$ink",fontFamily:"sans",fontSize:16,fontWeight:"800",lineHeight:20},subCardSmall:{color:"$ink2",fontFamily:"sans",fontSize:14,lineHeight:18.9,marginTop:2},subCardButton:{backgroundColor:"$card",borderRadius:999,color:"$ink",fontFamily:"sans",fontSize:14,fontWeight:"800",inner:{width:1.5,color:"$ink"},lineHeight:21,minHeight:40,paddingBottom:0,paddingLeft:14,paddingRight:14,paddingTop:0},carrier:{alignItems:"center",color:"$ink",columnGap:12,flexDirection:"row",fontFamily:"sans",fontSize:17,grid:[40,"fr"],lineHeight:25.5,rowGap:4},carrierIcon:{alignItems:"center",backgroundColor:"$linkWash",borderRadius:11,color:"$link",fontFamily:"sans",fontSize:17,height:40,justifyContent:"center",lineHeight:25.5,width:40},carrierIconSvg:{height:21,width:21},carrierStrong:{color:"$ink",fontFamily:"sans",fontSize:16,fontWeight:"800",lineHeight:24},carrierSmall:{alignItems:"center",color:"$ink2",columnGap:8,flexDirection:"row",flexWrap:"wrap",fontFamily:"mono",fontSize:13,letterSpacing:.26,lineHeight:19.5,marginTop:1,rowGap:2},carrierButton:{alignItems:"center",alignSelf:"flex-start",backgroundColor:"transparent",borderRadius:999,color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:15,fontWeight:"700",gap:8,inner:{width:1.5,color:"$ink"},justifyContent:"center",lineHeight:22.5,marginTop:10,minHeight:40,paddingBottom:0,paddingLeft:16,paddingRight:16,paddingTop:0,textDecorationLine:"none"},carrierWait:{color:"$ink2",fontFamily:"sans",fontSize:14.5,lineHeight:20.3},carrierTag:{backgroundColor:"$ink",borderRadius:5,color:"$onInk",fontFamily:"mono",fontSize:10,letterSpacing:.6,lineHeight:15,paddingBottom:2,paddingLeft:6,paddingRight:6,paddingTop:2,textTransform:"uppercase"},toast:{backgroundColor:"$ink",borderRadius:16,color:"$onInk",fontFamily:"sans",fontSize:14.5,left:16,lineHeight:20.3,opacity:1,paddingBottom:12,paddingLeft:15,paddingRight:15,paddingTop:12,position:"absolute",right:16,top:62,zIndex:50},scrim:{backgroundColor:"$scrim",bottom:0,left:0,opacity:1,position:"absolute",right:0,top:0,zIndex:40},sheet:{backgroundColor:"$card",borderBottomLeftRadius:0,borderBottomRightRadius:0,borderTopLeftRadius:28,borderTopRightRadius:28,bottom:0,color:"$ink",fontFamily:"sans",fontSize:17,left:0,lineHeight:25.5,maxHeight:"80%",paddingBottom:40,paddingLeft:20,paddingRight:20,paddingTop:10,position:"absolute",right:0,zIndex:41},sheetGrab:{backgroundColor:"$n_DAD7D1",borderRadius:3,height:5,marginBottom:10,marginLeft:"auto",marginRight:"auto",marginTop:0,width:40},sheetTop:{alignItems:"center",color:"$ink",flexDirection:"row",fontFamily:"sans",fontSize:17,justifyContent:"space-between",lineHeight:25.5},sheetKicker:{color:"$ink3",fontFamily:"mono",fontSize:11,letterSpacing:.88,lineHeight:16.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0,textTransform:"uppercase"},sheetClose:{alignItems:"center",backgroundColor:"transparent",borderRadius:20,color:"$ink",fontFamily:"sans",fontSize:17,height:40,justifyContent:"center",lineHeight:25.5,marginRight:-8,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0,position:"relative",width:40},sheetCloseSvg:{height:22,width:22},sheetTitle:{color:"$ink",fontFamily:"serif",fontSize:24,fontWeight:"800",letterSpacing:-.24,lineHeight:27.6,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0},sheetBody:{color:"$black",fontFamily:"sans",fontSize:16,gap:10,lineHeight:24,marginTop:12},coButton:{alignItems:"center",alignSelf:"flex-start",backgroundColor:"$primary",borderRadius:999,color:"$onPrimary",flexDirection:"row",fontFamily:"sans",fontSize:17,fontWeight:"700",gap:8,justifyContent:"center",lineHeight:25.5,minHeight:56,paddingBottom:0,paddingLeft:28,paddingRight:28,paddingTop:0,textDecorationLine:"none",width:"100%"},footButton:{alignItems:"center",alignSelf:"flex-start",backgroundColor:"$primary",borderRadius:999,color:"$onPrimary",flexDirection:"row",fontFamily:"sans",fontSize:16,fontWeight:"700",gap:8,justifyContent:"center",lineHeight:24,minHeight:48,paddingBottom:0,paddingLeft:22,paddingRight:22,paddingTop:0,textDecorationLine:"none",width:"100%"},blanksWrap:{color:"$ink",fontFamily:"sans",fontSize:17,lineHeight:25.5,marginTop:14},blanksCard:{backgroundColor:"$card",borderRadius:20,color:"$ink",fontFamily:"sans",fontSize:17,gap:8,lineHeight:25.5,paddingBottom:13,paddingLeft:12,paddingRight:12,paddingTop:12,shadow:{x:0,y:1,blur:3,color:"#262523",opacity:.06}},blanksHead:{alignItems:"center",color:"$ink3",flexDirection:"row",fontFamily:"sans",fontSize:12.5,fontWeight:"800",gap:10,justifyContent:"space-between",letterSpacing:.88,lineHeight:18.75,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0,paddingBottom:2,paddingLeft:2,paddingRight:2,paddingTop:0,textTransform:"uppercase"},blanksPill:{backgroundColor:"$accent",borderRadius:999,color:"$ink",fontFamily:"sans",fontSize:13,fontStyle:"normal",fontWeight:"800",letterSpacing:.13,lineHeight:19.5,paddingBottom:2,paddingLeft:10,paddingRight:10,paddingTop:2,textTransform:"none"},blanksPillFilled:{backgroundColor:"$clearBg",color:"$clearInk"},blanksList:{color:"$ink",fontFamily:"sans",fontSize:17,gap:7,lineHeight:25.5,marginBottom:0,marginLeft:0,marginRight:0,marginTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0},blanksRow:{alignItems:"center",backgroundColor:"$paper",borderRadius:15,color:"$ink",columnGap:11,flexDirection:"row",fontFamily:"sans",fontSize:17,grid:[34,"fr"],lineHeight:25.5,paddingBottom:9,paddingLeft:9,paddingRight:12,paddingTop:9},blanksNum:{alignItems:"center",backgroundColor:"$accentChip",borderRadius:11,color:"$ink",fontFamily:"serif",fontSize:22,fontWeight:"800",height:40,justifyContent:"center",lineHeight:33,width:34},blanksText:{color:"$ink",fontFamily:"sans",fontSize:16,fontWeight:"700",lineHeight:21.6},blanksSource:{color:"$ink3",fontFamily:"sans",fontSize:13.5,lineHeight:20.25},blank:{alignSelf:"flex-start",backgroundColor:"$accent4",borderRadius:6,color:"$ink",fontFamily:"sans",fontSize:16,fontStyle:"normal",fontWeight:"700",height:20,inner:{width:1.5,color:"$accent"},lineHeight:21.6,minWidth:36},blankS:{minWidth:24},blankL:{minWidth:64},blankFilled:{backgroundColor:"transparent",borderRadius:6,height:"auto",inner:null,marginBottom:0,marginLeft:-3,marginRight:-3,marginTop:0,minWidth:0,paddingBottom:0,paddingLeft:3,paddingRight:3,paddingTop:0,shadow:null},manageOrders:{backgroundColor:"transparent",color:"$link",fontFamily:"sans",fontSize:15,fontWeight:"700",lineHeight:22.5,minHeight:40,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0,textDecorationLine:"underline"}}),DESIGN_RN_PLAN_ICONS=/* @__PURE__ */Object.freeze({shield:{strokes:[{width:1.8,cap:true,closed:true,points:[12,3,19,6,19,12,18.759,14.125,18.074,16,17,17.625,15.593,19,13.907,20.125,12,21,10.093,20.125,8.407,19,7,17.625,5.926,16,5.241,14.125,5,12,5,6]},{width:1.8,cap:true,closed:false,points:[9,12,11,14,15,10]}],boxes:[],triangles:[],seams:[]},arrow:{strokes:[{width:2,cap:true,closed:false,points:[4.5,12,19,12]},{width:2,cap:true,closed:false,points:[13.5,6.5,19,12,13.5,17.5]}],boxes:[],triangles:[],seams:[]},check:{strokes:[{width:2.4,cap:true,closed:false,points:[5,12.6,9.4,17,19,7.4]}],boxes:[],triangles:[],seams:[]},star:{strokes:[],boxes:[],triangles:[[12,16.9,6.8,19.6,7.8,13.8],[16.2,13.8,17.2,19.6,12,16.9],[7.8,13.8,3.5,9.7,9.4,8.8],[14.6,8.8,20.5,9.7,16.2,13.8],[9.4,8.8,12,3.5,14.6,8.8],[16.2,13.8,12,16.9,7.8,13.8],[14.6,8.8,16.2,13.8,7.8,13.8],[14.6,8.8,7.8,13.8,9.4,8.8]],seams:[[12,16.9,7.8,13.8,.245,.677],[12,16.9,16.2,13.8,.245,.677],[7.8,13.8,9.4,8.8,.69,.248],[14.6,8.8,16.2,13.8,.248,.243],[14.6,8.8,9.4,8.8,.68,.245],[16.2,13.8,7.8,13.8,.677,.68],[14.6,8.8,7.8,13.8,.68,.69]]},truck:{strokes:[{width:1.7,cap:false,closed:true,points:[2.8,6.5,14.2,6.5,14.2,16,2.8,16]},{width:1.7,cap:false,closed:false,points:[14.2,9.5,17.8,9.5,21.2,12.9,21.2,16,14.2,16]}],boxes:[{x:5,y:15.8,w:3.6,h:3.6,radius:1.8,width:1.7},{x:15.4,y:15.8,w:3.6,h:3.6,radius:1.8,width:1.7}],triangles:[],seams:[]},refresh:{strokes:[{width:1.7,cap:true,closed:false,points:[4,12,4.343,14.363,5.368,16.52,6.985,18.278,9.048,19.48,11.374,20.021,13.756,19.85,15.981,18.984,17.852,17.5,19.201,15.53,19.909,13.249,19.912,10.861,19.21,8.578,17.865,6.605,15.998,5.116,13.775,4.245,11.393,4.068,9.066,4.602,7,5.8]},{width:1.7,cap:true,closed:false,points:[4,4,4,8,8,8]}],boxes:[],triangles:[],seams:[]},card:{strokes:[{width:1.7,cap:true,closed:false,points:[3,9.5,21,9.5]},{width:1.7,cap:true,closed:false,points:[6.5,15,10.5,15]}],boxes:[{x:3,y:5.5,w:18,h:13,radius:2.2,width:1.7}],triangles:[],seams:[]},alert:{strokes:[{width:1.9,cap:true,closed:true,points:[12,3.5,21.5,20,2.5,20]},{width:1.9,cap:true,closed:false,points:[12,10,12,14.5]},{width:1.9,cap:true,closed:false,points:[12,17.2,12.01,17.2]}],boxes:[],triangles:[],seams:[]},x:{strokes:[{width:2,cap:true,closed:false,points:[6.5,6.5,17.5,17.5]},{width:2,cap:true,closed:false,points:[17.5,6.5,6.5,17.5]}],boxes:[],triangles:[],seams:[]},chat:{strokes:[{width:1.7,cap:false,closed:true,points:[5,5.2,19,5.2,19.8,5.414,20.386,6,20.6,6.8,20.6,15.4,20.386,16.2,19.8,16.786,19,17,10.3,17,5.5,20.6,5.5,17,5,17,4.2,16.786,3.614,16.2,3.4,15.4,3.4,6.8,3.614,6,4.2,5.414,5,5.2]}],boxes:[],triangles:[],seams:[]},repeat:{strokes:[{width:1.8,cap:true,closed:false,points:[4.5,11,4.824,8.824,5.766,6.837,7.244,5.208,9.131,4.077,11.264,3.543,13.461,3.65,15.533,4.391,17.3,5.7,19.5,8]},{width:1.8,cap:true,closed:false,points:[19.5,3.5,19.5,8,15,8]},{width:1.8,cap:true,closed:false,points:[19.5,13,19.176,15.176,18.234,17.163,16.756,18.792,14.869,19.923,12.736,20.457,10.539,20.35,8.467,19.609,6.7,18.3,4.5,16]},{width:1.8,cap:true,closed:false,points:[4.5,20.5,4.5,16,9,16]}],boxes:[],triangles:[],seams:[]},calendar:{strokes:[{width:1.8,cap:true,closed:false,points:[4,10,20,10]},{width:1.8,cap:true,closed:false,points:[8.5,3.5,8.5,7.5]},{width:1.8,cap:true,closed:false,points:[15.5,3.5,15.5,7.5]}],boxes:[{x:4,y:5.5,w:16,h:15,radius:2.5,width:1.8}],triangles:[],seams:[]},flame:{strokes:[],boxes:[],triangles:[[12.15,14.513,13.1,15.2,13.1,13.7],[11.5,13.3,12.15,14.513,13.1,13.7],[16.874,10.907,15.7,9.3,15.381,10.659],[14.7,16.7,16.838,18.516,17.693,16.84],[14.7,16.7,14.489,17.681,16.838,18.516],[18,14.9,14.507,15.633,17.693,16.84],[16.874,10.907,15.381,10.659,14.685,11.707],[17.693,12.759,16.874,10.907,14.685,11.707],[15.538,19.832,16.838,18.516,14.489,17.681],[14.685,11.707,13.959,14.633,17.693,12.759],[17.693,12.759,13.959,14.633,18,14.9],[13.891,20.692,13.055,19.006,12,21],[12,21,12,19.2,10.109,20.692],[8.462,19.832,10.109,20.692,10.659,18.863],[10.659,18.863,9.741,17.97,8.462,19.832],[6.307,16.84,9.602,15.677,6,14.9],[6.273,13.033,6,14.9,9.602,15.677],[9.602,15.677,10.113,14.812,6.273,13.033],[6.988,11.438,6.273,13.033,10.113,14.812],[13.525,7.088,12.856,5.017,12,3.5],[13.856,9.589,13.525,7.088,12,3.5],[13.7,12.4,13.856,9.589,12,3.5],[10.113,14.812,10.792,14.042,6.988,11.438],[14.7,16.7,17.693,16.84,14.507,15.633],[13.7,12.4,13.959,14.633,14.685,11.707],[14.507,15.633,18,14.9,13.959,14.633],[13.1,13.7,13.959,14.633,13.7,12.4],[11.5,13.3,13.1,13.7,13.7,12.4],[7.983,10.048,6.988,11.438,10.792,14.042],[10.792,14.042,11.5,13.3,7.983,10.048],[14.489,17.681,13.913,18.475,15.538,19.832],[13.891,20.692,15.538,19.832,13.913,18.475],[13.891,20.692,13.913,18.475,13.055,19.006],[12,19.2,12,21,13.055,19.006],[10.659,18.863,10.109,20.692,12,19.2],[7.162,18.516,8.462,19.832,9.741,17.97],[9.741,17.97,9.4,16.7,7.162,18.516],[6.307,16.84,7.162,18.516,9.4,16.7],[6.307,16.84,9.4,16.7,9.602,15.677],[9.1,8.8,7.983,10.048,11.5,13.3],[11.5,13.3,13.7,12.4,9.1,8.8],[10.054,7.77,9.1,8.8,13.7,12.4],[10.927,6.683,10.054,7.77,13.7,12.4],[11.613,5.481,10.927,6.683,13.7,12.4],[12.006,4.106,11.613,5.481,13.7,12.4],[12,2.5,12.006,4.106,13.7,12.4],[12,2.5,13.7,12.4,12,3.5]],seams:[[12.15,14.513,13.1,13.7,.121,.428],[11.5,13.3,13.1,13.7,.681,.356],[15.381,10.659,16.874,10.907,.033,.883],[14.7,16.7,16.838,18.516,.648,1.318],[14.7,16.7,17.693,16.84,.648,1.533],[14.489,17.681,16.838,18.516,.51,1.318],[14.507,15.633,18,14.9,.782,1.787],[14.507,15.633,17.693,16.84,.782,1.533],[14.685,11.707,16.874,10.907,.68,.883],[14.685,11.707,17.693,12.759,.61,.484],[14.489,17.681,15.538,19.832,.51,1.115],[13.959,14.633,14.685,11.707,1.333,.576],[13.959,14.633,17.693,12.759,.851,.484],[13.959,14.633,18,14.9,.851,1.787],[13.055,19.006,13.891,20.692,.36,.984],[12,21,13.055,19.006,.945,.395],[12,19.2,12,21,.394,.945],[10.109,20.692,12,19.2,.715,.394],[10.109,20.692,10.659,18.863,.715,.428],[10.659,18.863,8.462,19.832,.428,.809],[8.462,19.832,9.741,17.97,.809,.525],[6.307,16.84,9.602,15.677,1.65,.812],[6,14.9,9.602,15.677,.194,1.012],[6.273,13.033,9.602,15.677,2.068,1.012],[10.113,14.812,6.273,13.033,1.217,2.068],[10.113,14.812,6.988,11.438,1.217,2.2],[12,3.5,13.525,7.088,4.697,5.571],[12,3.5,13.856,9.589,4.697,3.017],[12,3.5,13.7,12.4,4.648,26.765],[10.792,14.042,6.988,11.438,1.339,2.2],[13.7,12.4,13.959,14.633,.819,1.333],[13.1,13.7,13.7,12.4,0,.819],[11.5,13.3,13.7,12.4,.681,.537],[10.792,14.042,7.983,10.048,1.339,2.328],[11.5,13.3,7.983,10.048,1.438,2.328],[13.913,18.475,15.538,19.832,.409,1.115],[13.891,20.692,13.913,18.475,.984,.409],[7.162,18.516,9.741,17.97,.977,.525],[7.162,18.516,9.4,16.7,.977,.677],[6.307,16.84,9.4,16.7,1.65,.677],[11.5,13.3,9.1,8.8,1.438,1.129],[13.7,12.4,9.1,8.8,2.046,1.129],[10.054,7.77,13.7,12.4,.079,2.285],[10.927,6.683,13.7,12.4,.237,3.126],[11.613,5.481,13.7,12.4,.475,5.451],[12.006,4.106,13.7,12.4,.961,15.892],[12,2.5,13.7,12.4,2.974,26.765]]},box:{strokes:[{width:1.7,cap:false,closed:true,points:[3.8,7.8,12,4,20.2,7.8,20.2,16.4,12,20,3.8,16.4]},{width:1.7,cap:false,closed:false,points:[3.8,7.8,12,11.6,20.2,7.8]},{width:1.7,cap:false,closed:false,points:[12,11.6,12,20]}],boxes:[],triangles:[],seams:[]},cart:{strokes:[{width:1.8,cap:true,closed:false,points:[2.8,4,5.4,4,7.7,14.6,8.203,15.401,9.1,15.7,17.3,15.7,18.197,15.401,18.7,14.6,20.4,7.6,6.3,7.6]}],boxes:[{x:8.3,y:18.3,w:2.6,h:2.6,radius:1.3,width:1.8},{x:15.8,y:18.3,w:2.6,h:2.6,radius:1.3,width:1.8}],triangles:[],seams:[]},minus:{strokes:[{width:2.2,cap:true,closed:false,points:[6,12,18,12]}],boxes:[],triangles:[],seams:[]},plus:{strokes:[{width:2.2,cap:true,closed:false,points:[12,6,12,18]},{width:2.2,cap:true,closed:false,points:[6,12,18,12]}],boxes:[],triangles:[],seams:[]},chev:{strokes:[{width:2,cap:true,closed:false,points:[9,5.5,15.5,12,9,18.5]}],boxes:[],triangles:[],seams:[]},pulse:{strokes:[{width:1.8,cap:true,closed:false,points:[3,12.5,6.8,12.5,9.2,6.9,13.4,17.5,15.8,12.5,21,12.5]}],boxes:[],triangles:[],seams:[]},file:{strokes:[{width:1.7,cap:true,closed:true,points:[7,3.5,14.2,3.5,18.5,7.8,18.5,20,18.324,20.424,17.9,20.6,7,20.6,6.576,20.424,6.4,20,6.4,4.1,6.576,3.676,7,3.5]},{width:1.7,cap:true,closed:false,points:[14,3.6,14,8,18.4,8]},{width:1.7,cap:true,closed:false,points:[9.4,12.4,14.6,12.4]},{width:1.7,cap:true,closed:false,points:[9.4,15.8,14.6,15.8]}],boxes:[],triangles:[],seams:[]},kit:{strokes:[{width:1.7,cap:false,closed:true,points:[4,7.6,12,3.6,20,7.6,20,16.4,12,20.4,4,16.4]},{width:1.7,cap:false,closed:false,points:[4,7.6,12,11.6,20,7.6]},{width:1.7,cap:false,closed:false,points:[12,11.6,12,20.4]}],boxes:[],triangles:[],seams:[]},dna:{strokes:[{width:1.7,cap:true,closed:false,points:[7,3.5,7.28,4.645,8.04,5.594,9.16,6.394,10.52,7.097,12,7.75,13.48,8.403,14.84,9.106,15.96,9.906,16.72,10.855,17,12,16.72,13.145,15.96,14.094,14.84,14.894,13.48,15.597,12,16.25,10.52,16.903,9.16,17.606,8.04,18.406,7.28,19.355,7,20.5]},{width:1.7,cap:true,closed:false,points:[17,3.5,16.72,4.645,15.96,5.594,14.84,6.394,13.48,7.097,12,7.75,10.52,8.403,9.16,9.106,8.04,9.906,7.28,10.855,7,12,7.28,13.145,8.04,14.094,9.16,14.894,10.52,15.597,12,16.25,13.48,16.903,14.84,17.606,15.96,18.406,16.72,19.355,17,20.5]},{width:1.7,cap:true,closed:false,points:[8.6,6.3,15.4,6.3]},{width:1.7,cap:true,closed:false,points:[8.6,17.7,15.4,17.7]},{width:1.7,cap:true,closed:false,points:[10.4,9.6,13.6,9.6]},{width:1.7,cap:true,closed:false,points:[10.4,14.4,13.6,14.4]}],boxes:[],triangles:[],seams:[]},heart:{strokes:[{width:1.8,cap:false,closed:true,points:[12,20.2,11.739,20.035,11.041,19.559,10.03,18.804,8.831,17.799,7.569,16.575,6.37,15.163,5.359,13.593,4.661,11.895,4.4,10.1,4.833,8.454,5.87,7.105,7.349,6.264,9.039,6.062,10.675,6.532,12,7.6,13.325,6.532,14.961,6.062,16.651,6.264,18.13,7.105,19.167,8.454,19.6,10.1,19.339,11.895,18.641,13.593,17.63,15.163,16.431,16.575,15.169,17.799,13.97,18.804,12.959,19.559,12.261,20.035,12,20.2]}],boxes:[],triangles:[],seams:[]},bottle:{strokes:[{width:1.7,cap:false,closed:true,points:[7.2,6.2,16.8,6.2,17.507,6.493,17.8,7.2,17.8,19.5,17.572,20.35,16.95,20.972,16.1,21.2,7.9,21.2,7.05,20.972,6.428,20.35,6.2,19.5,6.2,7.2,6.493,6.493,7.2,6.2]},{width:1.7,cap:false,closed:true,points:[9,11,15,11,15,16,9,16]}],boxes:[{x:8,y:2.8,w:8,h:3.4,radius:1,width:1.7}],triangles:[],seams:[]},harness:{strokes:[{width:1.5,cap:true,closed:false,points:[7.5,4.5,7.728,6.82,8.364,8.708,9.336,10.116,10.572,10.996,12,11.3,13.428,10.996,14.664,10.116,15.636,8.708,16.272,6.82,16.5,4.5]},{width:1.5,cap:true,closed:true,points:[5,12.6,19,12.6,19,17.2,18.692,18.35,17.85,19.192,16.7,19.5,7.3,19.5,6.15,19.192,5.308,18.35,5,17.2]},{width:1.5,cap:true,closed:false,points:[8.2,15.3,15.8,15.3]}],boxes:[{x:10.7,y:8.9,w:2.6,h:2.6,radius:1.3,width:1.5}],triangles:[],seams:[]},ramp:{strokes:[{width:1.5,cap:true,closed:false,points:[2.5,19.5,21.5,19.5]},{width:1.5,cap:true,closed:false,points:[3.5,19.5,3.5,16.5,8,16.5,8,13.5,12.5,13.5,12.5,10.5,17,10.5,17,7.5,20.5,7.5,20.5,19.5]},{width:1.5,cap:true,closed:false,points:[3.5,16.5,20.5,7.5],opacity:.35}],boxes:[],triangles:[],seams:[]}});var PLAN_LIGHT=/* @__PURE__ */Object.freeze({black:"#000000",onInk:"#FFFFFF",wash:"rgba(38, 37, 35, 0.06)",scrim:"rgba(38, 37, 35, 0.38)",riskChip:"#FFD8D6",clearChip:"#DDEFC4"});function rgb(color){let c=color.trim(),h=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(c);if(h!==null){let x=h[1].length===3?h[1].split("").map(d=>d+d).join(""):h[1];return[0,2,4].map(k2=>parseInt(x.slice(k2,k2+2),16))}let r=/^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)/i.exec(c);return r===null?null:[Number(r[1]),Number(r[2]),Number(r[3])]}function mixPlanColor(color,share,ground){let a=rgb(color),b=rgb(ground);if(a===null||b===null)return ground;let to=k2=>Math.round(a[k2]*share+b[k2]*(1-share)).toString(16).padStart(2,"0");return`#${to(0)}${to(1)}${to(2)}`.toUpperCase()}function clearOf(color){let c=rgb(color);return c===null?"transparent":`rgba(${c[0]}, ${c[1]}, ${c[2]}, 0)`}function planRoles(theme){let c=theme.color,v=v3Palette(theme),card=v.card,link=v.link;return{ink:v.ink,ink2:v.ink2,ink3:v.ink3,paper:v.paper,tile:v.tile,line:v.line,card:card,...partnerGround(theme)?{paper:c.background}:{},riskBg:v.riskBg,riskInk:v.riskInk,riskDot:v.riskDot,clearBg:v.clearBg,clearInk:v.clearInk,clearDot:v.clearDot,watchDot:v.watchDot,...v.dark?{black:c.text.primary,onInk:c.background,wash:mixPlanColor(c.text.primary,.08,c.surface),scrim:"rgba(0, 0, 0, 0.6)",riskChip:c.badgeBgCritical,clearChip:c.badgeBgPositive}:PLAN_LIGHT,primary:v.primary,onPrimary:v.onPrimary,accent:v.accent,accent4:mixPlanColor(c.accent,.17,card),accent3:mixPlanColor(c.accent,.25,card),accentChip:mixPlanColor(c.accent,.47,card),link:link,linkWash:(v.dark?void 0:theme.slots.planWash?.backgroundColor)??mixPlanColor(link,.12,card),linkChip:(v.dark?void 0:theme.slots.planChip?.backgroundColor)??mixPlanColor(link,.2,card)}}function partnerGround(theme){return theme.brightness==="dark"?false:theme.meta.displayName!==EVERFUR_LIGHT.meta.displayName||theme.color.background!==EVERFUR_LIGHT.color.background}var PLAN_CARDS=["sec","steps","need","by","extra"],PLAN_CARD_CORNERS=["sec","steps","need"],PLAN_BUTTONS=["button","coButton","footButton"];function partnerParts(theme,out){if(theme.brightness==="dark")return;let card=theme.slots.card,button=theme.slots.primaryButton,over=(name,box)=>{let p=out[name];out[name]={...p,box:{...p.box,...box}}};if(card!==void 0)for(let name of PLAN_CARDS)over(name,{...card.backgroundColor===void 0?{}:{backgroundColor:card.backgroundColor},...card.borderRadius===void 0||!PLAN_CARD_CORNERS.includes(name)?{}:{borderRadius:card.borderRadius}});if(button?.borderRadius!==void 0)for(let name of PLAN_BUTTONS)over(name,{borderRadius:button.borderRadius})}var TEXT_KEYS=/* @__PURE__ */new Set(["fontSize","fontWeight","fontFamily","fontStyle","letterSpacing","lineHeight","textTransform","color","textAlign","textDecorationLine","fontVariant"]),DROP=/* @__PURE__ */new Set(["justifyItems"]);function font(theme,family,weight){let w=Number(weight??400);if(family==="serif"){let h=headingFace(theme,"bold");return h.fontWeight===void 0?{fontFamily:h.fontFamily}:{fontFamily:h.fontFamily,fontWeight:String(w)}}let mono=family==="mono",key=w>=650?mono?"monoBold":"bold":w>=450?mono?"monoMedium":"medium":mono?"mono":"regular",f=face(theme,key);return theme.type.namedFaces[key]?{fontFamily:f.fontFamily}:{fontFamily:f.fontFamily,fontWeight:String(w)}}function paintPart(theme,roles,part2,dark,line){let box={},text2={},colour=v=>{if(!v.startsWith("$"))return v;let name=v.slice(1);return name.startsWith("n_")?dark?line:`#${name.slice(2)}`:roles[name]??v},rings=[],inner;for(let[key,value]of Object.entries(part2))if(!(value===void 0||DROP.has(key)||key==="grid"||key==="fontWeight"))if(key==="fontFamily")Object.assign(text2,font(theme,String(value),part2.fontWeight));else if(key==="shadow"){if(value===null)Object.assign(box,{shadowOpacity:0,elevation:0});else if(!dark){let s=value;Object.assign(box,{shadowColor:colour(s.color),shadowOpacity:s.opacity,shadowRadius:s.blur,shadowOffset:{width:s.x,height:s.y},elevation:Math.max(1,Math.round(s.blur/2))})}}else if(key==="inner"){let r=value;inner=r===null?null:{position:"absolute",top:0,right:0,bottom:0,left:0,borderWidth:r.width,borderColor:colour(r.color),pointerEvents:"none"}}else if(key==="ring"){let list=value,radius=typeof part2.borderRadius=="number"?part2.borderRadius:0;rings=list.map((r,i)=>({borderWidth:r.width-(list[i-1]?.width??0),borderColor:colour(r.color),borderRadius:radius+r.width})).reverse()}else key==="color"||key.endsWith("Color")?(key==="color"?text2:box)[key]=colour(String(value)):(TEXT_KEYS.has(key)?text2:box)[key]=value;part2.fontWeight!==void 0&&part2.fontFamily===void 0&&Object.assign(text2,font(theme,"sans",part2.fontWeight));let outer=rings[0];if(outer!==void 0){let w=part2.ring.reduce((m,r)=>Math.max(m,r.width),0),place3={...outer};if(box.position==="absolute"){for(let k2 of["position","zIndex"])box[k2]!==void 0&&(place3[k2]=box[k2]);for(let k2 of["top","right","bottom","left"])typeof box[k2]=="number"&&(place3[k2]=box[k2]-w);for(let k2 of["position","zIndex","top","right","bottom","left"])delete box[k2]}else{for(let k2 of["marginTop","marginRight","marginBottom","marginLeft"])place3[k2]=(typeof box[k2]=="number"?box[k2]:0)-w,delete box[k2];box.alignSelf!==void 0&&(place3.alignSelf=box.alignSelf,delete box.alignSelf)}rings[0]=place3}return{box:box,text:text2,rings:rings,...inner===void 0?{}:{inner:inner},grid:part2.grid??[]}}var cache4=/* @__PURE__ */new WeakMap;function planPaint(theme){let hit=cache4.get(theme);if(hit!==void 0)return hit;let roles=planRoles(theme),dark=theme.brightness==="dark",out={roles:roles};for(let[name,part2]of Object.entries(DESIGN_RN_PLAN))out[name]=paintPart(theme,roles,part2,dark,roles.line);partnerParts(theme,out);let painted=out;return cache4.set(theme,painted),painted}function gridCell(p,i){let t=p.grid[i];return t===void 0?{}:t==="fr"?{flexGrow:1,flexShrink:1,flexBasis:0,minWidth:0}:t==="auto"?{flexShrink:0}:typeof t=="number"?{width:t,flexShrink:0}:{}}var RADII=["borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],MARGINS=["margin","marginTop","marginRight","marginBottom","marginLeft","marginHorizontal","marginVertical"],draws=/* @__PURE__ */new WeakMap;function planDraw(X){let hit=draws.get(X);if(hit!==void 0)return hit;let list=names=>names.filter(n=>typeof n=="string"),draw={bx:(...names)=>list(names).map(n=>X[n].box),im:(...names)=>list(names).map(n=>X[n].box),tx:(...names)=>list(names).map(n=>X[n].text),tb:(...names)=>list(names).flatMap(n=>[X[n].box,X[n].text]),ring:(name,node,place3)=>{let rings=X[name].rings;return rings.length===0?node:rings.reduceRight((child,style,i)=>react.createElement(reactNative.View,{key:i,style:i===0&&place3!==void 0?[style,place3]:style},child),node)},inner:(...names)=>{let ring=null,radius={};for(let n of list(names)){let p=X[n];p.inner!==void 0&&(ring=p.inner);for(let k2 of RADII)p.box[k2]!==void 0&&(radius={...radius,[k2]:p.box[k2]})}return ring===null?null:react.createElement(reactNative.View,{style:[ring,radius]})},ink:(name,fallback)=>typeof X[name].text.color=="string"?X[name].text.color:fallback,side:(name,fallback)=>typeof X[name].box.width=="number"?X[name].box.width:fallback,mod:(base3,kind)=>{if(kind===void 0||kind==="")return null;let name=`${base3}${kind.charAt(0).toUpperCase()}${kind.slice(1)}`;return name!=="roles"&&name in X?name:null},scroll:name=>{let place3={},content={};for(let[k2,v]of Object.entries(X[name].box))(MARGINS.includes(k2)?place3:content)[k2]=v;return{place:place3,content:content}},swipe:(name,inner)=>{let b=X[name].box,share=typeof b.flexBasis=="string"&&b.flexBasis.endsWith("%")?Number(b.flexBasis.slice(0,-1))/100:1,max=typeof b.maxWidth=="number"?b.maxWidth:1/0;return Math.round(Math.min(max,inner*share)*100)/100}};return draws.set(X,draw),draw}var PLAN_PRESS_SCALE=/* @__PURE__ */Object.freeze({button:.97,onButton:.96,jump:.98,opt:.98,add:.98,extraGo:.96,every:.96,askRow:.98,stepper:.9,mode:.98,order:.98,subCard:.96});function pressScale(style,scale,off){return off?style:({pressed:pressed})=>pressed?[style,{transform:[{scale:scale}]}]:style}var ORDER_STEPS=["ordered","shipped","out_for_delivery","delivered"],TRACK_STEP={ordered:0,shipped:1,delivered:3};function hostOrderView(o){let step=Math.max(0,ORDER_STEPS.indexOf(o.status));return{key:o.key,number:o.number??null,step:step,dates:o.dates??[],everfur:false,steps:[0,1,2,3],productId:null,items:o.items.map(x=>({title:x.title,quantity:x.quantity,price:x.price,imageUrl:x.imageUrl??null,icon:x.icon??null})),total:Math.round(o.items.reduce((n,x)=>n+x.price,0)*100)/100,currency:o.currency,subscriptionBox:o.subscriptionBox===true,carrier:o.carrier??null,trackingNumber:o.trackingNumber??null,trackingTag:o.trackingTag??null,trackingUrl:o.trackingUrl??null}}function everfurOrderView(o,items){let it=items.find(x=>x.productId===o.productId),t=o.tracking,quantity=o.quantity??1,total=o.total??Math.round(o.price*quantity*100)/100,step=t===void 0?0:TRACK_STEP[t.status];return{key:o.orderId,number:t?.orderNumber??null,step:step,dates:t===void 0?[o.createdAt??null]:[o.createdAt??null,t.shippedAt,null,step===3?null:t.estimatedDelivery],steps:t===void 0?[0]:[0,1,3],everfur:true,productId:o.productId,items:[{title:o.title??it?.title??"",quantity:quantity,price:total,imageUrl:it?.imageUrl??null,icon:null}],total:total,currency:o.currency,subscriptionBox:false,carrier:t?.carrier??null,trackingNumber:t?.trackingNumber??null,trackingTag:null,trackingUrl:t?.trackingUrl??null}}function formatShopDay(iso,locale,now=/* @__PURE__ */new Date){if(iso==null)return null;let dateOnly=/^\d{4}-\d{2}-\d{2}$/.test(iso),d=new Date(dateOnly?`${iso}T00:00:00Z`:iso);if(Number.isNaN(d.getTime()))return null;let tz=dateOnly?"UTC":void 0,year=Number(new Intl.DateTimeFormat("en-US",{year:"numeric",...tz?{timeZone:tz}:{}}).format(d));try{return new Intl.DateTimeFormat(locale??"en-US",year!==now.getFullYear()?{month:"short",day:"numeric",year:"numeric",...tz?{timeZone:tz}:{}}:{weekday:"short",month:"short",day:"numeric",...tz?{timeZone:tz}:{}}).format(d)}catch{return iso}}function andList(names){return names.length<=1?names[0]??"":`${names.slice(0,-1).join(", ")} and ${names[names.length-1]??""}`}var CENTER={justifyContent:"center"},SHRINK={flexShrink:1},FILL={width:"100%",height:"100%"},WRAP={flexWrap:"wrap"},FULL_ROW={width:"100%",alignSelf:"stretch"},HIT_44={top:2,bottom:2,left:2,right:2},IN_ROW={alignSelf:"auto"},SR_ONLY={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",borderWidth:0},inlineTag=(k2,label,part2)=>/* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[" ",
|
|
76
|
+
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:k2.S.D.bx(part2),children:/* @__PURE__ */jsxRuntime.jsx(Text,{style:k2.S.D.tx(part2),children:label})})]});function shopButton(k2,label,onPress,opts={}){let{S:S}=k2,{bx:bx,tx:tx}=S.D,disabled=opts.disabled===true,part2=opts.part??"button";/* @__PURE__ */
|
|
77
|
+
return jsxRuntime.jsx(reactNative.Pressable,{onPress:disabled?void 0:onPress,disabled:disabled,accessibilityRole:"button",accessibilityLabel:label,accessibilityState:{disabled:disabled},style:pressScale(opts.ghost?[S.buttonGhost,disabled?S.disabled:null]:bx(part2,disabled&&"buttonDisabled"),PLAN_PRESS_SCALE.button,disabled),...opts.testID?{testID:opts.testID}:{},children:/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"control",style:opts.ghost?S.buttonGhostText:tx(part2),children:label})})}function shopLink(k2,label,onPress,testID){let{bx:bx,tx:tx}=k2.S.D;/* @__PURE__ */
|
|
79
78
|
return jsxRuntime.jsx(reactNative.Pressable,{onPress:onPress,accessibilityRole:"button",accessibilityLabel:label,style:[...bx("shopLink"),CENTER],...testID?{testID:testID}:{},children:/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"control",style:tx("shopLink"),children:label})})}function shopRows(k2,rows,inShop=false){if(rows.length===0)return null;let{bx:bx,tx:tx,ink:ink,side:side}=k2.S.D,X=k2.S.X;/* @__PURE__ */
|
|
80
79
|
return jsxRuntime.jsx(reactNative.View,{style:bx("coRows",inShop&&"coRowsShop"),testID:"health-plan-checkout-rows",children:rows.map(r=>/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("coRow"),children:[
|
|
81
80
|
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:gridCell(X.coRow,0),children:k2.icon(r.icon,ink("coRowSvg",X.roles.ink2??""),side("coRowSvg",20))}),
|
|
82
|
-
/* @__PURE__ */jsxRuntime.jsx(Text,{style:[...tx("coRowLabel"),gridCell(X.coRow,1)],children:r.label}),
|
|
81
|
+
/* @__PURE__ */jsxRuntime.jsx(Text,{style:[...tx("coRowLabel"),{minWidth:gridCell(X.coRow,1).width,flexShrink:0}],numberOfLines:1,children:r.label}),
|
|
83
82
|
/* @__PURE__ */jsxRuntime.jsx(Text,{style:[...tx("coRow","coRowValue"),gridCell(X.coRow,2)],children:r.value})]},r.label))})}function shopSummary(k2,total,opts={}){let{S:S,copy:copy}=k2,renew=opts.renew??null,shipping=copy.shippingValue!=="";return renew!==null||shipping&&opts.tag===true&©.shippingTag!==""?planSummary(k2,total,opts):/* @__PURE__ */jsxRuntime.jsx(PlanDs,{theme:S.ds,children:/* @__PURE__ */jsxRuntime.jsx(SummaryList,{variant:opts.inCheckout?"inset":"card",rows:[{key:"subtotal",term:copy.subtotal,value:total},...shipping?[{key:"shipping",term:copy.shipping,value:copy.shippingValue}]:[]],total:{key:"total",term:copy.total,value:total},testID:"health-plan-summary"})})}function planSummary(k2,total,opts){let{S:S,copy:copy}=k2,{bx:bx,tx:tx}=S.D,renew=opts.renew??null,row=(label,value,mod,tag)=>/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("summaryRow",mod),children:[
|
|
84
83
|
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:[...bx("summaryLabel"),SHRINK,IN_ROW],children:[
|
|
85
84
|
/* @__PURE__ */jsxRuntime.jsx(Text,{style:[...tx("summaryRow",mod,mod==="summaryTotal"?"summaryTotalLabel":"summaryLabel"),SHRINK],children:label}),tag===void 0?null:/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("summaryTag"),testID:"health-plan-summary-tag",children:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("summaryTag"),children:tag})})]}),
|
|
@@ -109,8 +108,8 @@ return jsxRuntime.jsxs(reactNative.View,{style:bx("wait"),testID:"health-plan-wa
|
|
|
109
108
|
return jsxRuntime.jsxs(reactNative.View,{style:bx("shopEmpty"),children:[
|
|
110
109
|
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("shopEmptyTile"),children:k2.icon(iconName,ink("shopEmptyTile",k2.S.X.roles.link??""),side("shopEmptyTileSvg",34))}),
|
|
111
110
|
/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("shopEmptyTitle"),accessibilityRole:"header",children:title}),
|
|
112
|
-
/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("shopEmptyText"),children:body}),control]})}var tile=(k2,src,
|
|
113
|
-
return jsxRuntime.jsx(reactNative.View,{style:bx(
|
|
111
|
+
/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("shopEmptyText"),children:body}),control]})}var tile=(k2,src,part2,svg,fallback="box")=>{let{bx:bx,ink:ink}=k2.S.D;/* @__PURE__ */
|
|
112
|
+
return jsxRuntime.jsx(reactNative.View,{style:bx(part2),children:src?/* @__PURE__ */jsxRuntime.jsx(reactNative.Image,{source:{uri:src},style:FILL,accessibilityIgnoresInvertColors:true}):k2.icon(fallback,ink(part2,k2.S.X.roles.link??""),svg)})};function shopCartBody(k2,lines,subtotal,renew,petPrices,h){let{S:S,copy:copy}=k2,{bx:bx,tx:tx,tb:tb,inner:inner,side:side}=S.D,X=S.X;if(lines.length===0)/* @__PURE__ */
|
|
114
113
|
return jsxRuntime.jsx(reactNative.View,{style:bx("shop"),testID:"health-plan-cart-empty",children:shopEmpty(k2,"cart",copy.cartEmptyTitle,copy.cartEmptyBody(petPrices),shopLink(k2,copy.seeOrders,h.onOrders,"health-plan-cart-orders"))});let step=(label,iconName,off,onPress,testID,cell)=>/* @__PURE__ */jsxRuntime.jsx(reactNative.Pressable,{onPress:off?void 0:onPress,disabled:off,accessibilityRole:"button",accessibilityLabel:label,accessibilityState:{disabled:off},hitSlop:HIT_44,style:pressScale([...bx("stepperButton",off&&"stepperButtonDisabled"),gridCell(X.stepper,cell)],PLAN_PRESS_SCALE.stepper,off),testID:testID,children:k2.icon(iconName,void 0,side("stepperButtonSvg",16))});/* @__PURE__ */
|
|
115
114
|
return jsxRuntime.jsxs(reactNative.View,{style:bx("shop"),testID:"health-plan-cart",children:[
|
|
116
115
|
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("shopCard"),children:/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("cartItems"),children:lines.map(x=>/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("cartItem"),testID:`health-plan-cart-line-${x.key}`,children:[
|
|
@@ -164,13 +163,13 @@ return jsxRuntime.jsxs(reactNative.View,{style:bx("shop"),testID:"health-plan-or
|
|
|
164
163
|
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("cartItemPrice"),children:[
|
|
165
164
|
/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("cartItemPriceValue"),children:a.fmt(x.price,o.currency)??""}),
|
|
166
165
|
/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("cartItemPriceNote"),children:copy.orderItemLine(x.quantity,o.subscriptionBox)})]})]})]},x.title))})}),shopSummary(k2,total),shopRows(k2,a.rows,true),a.onBuyAgain===null?null:shopButton(k2,copy.buyAgain,a.onBuyAgain,{ghost:true,testID:"health-plan-buy-again"}),a.onHelp===null?null:shopLink(k2,copy.orderHelp,a.onHelp),fine3===""?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("shopFine"),children:fine3})]})}var HealthPlanScrollContext=react.createContext(null),HealthPlanViewportContext=react.createContext(null);function HealthPlanScrollScope({scrollRef:scrollRef,children:children,style:style}){let origin=react.useRef(null),still=usePlanTheme().motion.reducedMotion,scrollTo=react.useCallback(node=>{let from=origin.current,scroller=scrollRef.current;if(!(node===null||from===null||scroller===null))try{node.measureLayout(from,(_x,y)=>scroller.scrollTo({y:Math.max(0,y),animated:!still}),()=>{})}catch{}},[scrollRef,still]),value=react.useMemo(()=>scrollTo,[scrollTo]),viewport=react.useMemo(()=>({measure:onFrame=>{let scroller=scrollRef.current;if(typeof scroller?.measureInWindow=="function")try{scroller.measureInWindow((_x,y,_w,height)=>{height>0&&onFrame({y:y,height:height})})}catch{}},top:node=>{let from=origin.current,scroller=scrollRef.current;if(!(node===null||from===null||scroller===null))try{node.measureLayout(from,(_x,y)=>scroller.scrollTo({y:Math.max(0,y),animated:!1}),()=>{})}catch{}}}),[scrollRef]);/* @__PURE__ */
|
|
167
|
-
return jsxRuntime.jsx(HealthPlanScrollContext.Provider,{value:value,children:/* @__PURE__ */jsxRuntime.jsx(HealthPlanViewportContext.Provider,{value:viewport,children:/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{ref:origin,style:style,collapsable:false,children:children})})})}function useHealthPlanScroll(){return react.useContext(HealthPlanScrollContext)}function useHealthPlanViewport(){return react.useContext(HealthPlanViewportContext)}var warned=false;function warnConnectedOutsideProvider(isDevelopment){if(warned||!isDevelopment)return;warned=true;let globalConsole=globalThis.console;try{globalConsole?.warn?.("[everfur] A ConnectedHealthPlan* block was drawn outside HealthPlanFocusProvider, so it draws nothing. Wrap it in HealthPlanFocusProvider (or HealthPlanFocus), or use the pure block with your own data.")}catch{}}function healthPlanPetWords(name,sex){let n=name?.trim()??"",named=n===""?"your pet":n,Named=n===""?"Your pet":n;return sex==="female"?{name:named,Name:Named,poss:"her",Poss:"Her",obj:"her"}:sex==="male"?{name:named,Name:Named,poss:"his",Poss:"His",obj:"him"}:{name:named,Name:Named,poss:`${named}'s`,Poss:`${Named}'s`,obj:named}}var cartRenewal=p=>p===null?"":`${p.productName} renews every ${p.intervalDays} days at ${p.box??""} until you cancel; skip or cancel anytime in the app.`,HEALTH_PLAN_NO_SHIP_DAY_COPY=/* @__PURE__ */Object.freeze({onceFine:"",cartFine:cartRenewal,startedWhat:()=>""});function healthPlanFocusCopyFor(pet){let w=healthPlanPetWords(pet.name,pet.sex),nameOf=p=>p.petName?.trim()||w.name,NameOf=p=>p.petName?.trim()||w.Name,copy=/* @__PURE__ */Object.freeze({jumpKicker:(p,subscribed)=>subscribed?`In ${w.poss} plan, every ${p.intervalDays} days`:p.offer?`${p.discountPercent}% off ${w.poss} first box`:p.intervalDays>0?`Ships every ${p.intervalDays} days`:copy.onceLine(p),optionsLabel:"How to buy",subscribe:"Subscribe",bestValue:"Best value",subscribeLine:p=>p.offer?`First box, then ${p.box??""}`:`${p.box??""} every ${p.intervalDays} days`,priceLine:p=>p.offer?`${p.discountPercent}% off the first box. Ships every ${p.intervalDays} days.`:p.intervalDays>0?`Ships every ${p.intervalDays} days.`:copy.onceOffer(p),once:"One box",onceLine:p=>p.onceDiscountPercent>0?`${p.onceDiscountPercent}% off, ships once`:"Ships once",buyOnce:p=>`Buy one box, ${p.once??p.box??""}`,subscribed:"Subscribed",subscribedLine:(p,next)=>next===null?`Every ${p.intervalDays} days`:`Every ${p.intervalDays} days · next box ${next}`,manage:"Manage",checkoutKicker:"Checkout",checkoutTitle:p=>`Checkout: ${p.productName}`,checkoutOffer:p=>`${p.discountPercent}% off your first box.`,shipsEvery:"Ships every",days:n=>`${n} days`,buyOnceOption:"Buy once",checkoutGo:(_p,subscribe,today)=>`${subscribe?"Subscribe":"Buy now"} · ${today} today`,renews:p=>`Renews every ${p.intervalDays} days at ${p.box??""} until you cancel; skip or cancel anytime in the app.`,onceFine:"One box, ships tomorrow.",onceOffer:p=>p.onceDiscountPercent>0?`${p.onceDiscountPercent}% off, ships once.`:"Ships once.",checkoutNote:"",close:"Close",startedTitle:p=>`${NameOf(p)}'s plan has started.`,orderedTitle:()=>"Order placed.",startedWhat:p=>`${p.productName} ships tomorrow.`,startedNote:"",startedSteps:"What happens next",tomorrow:"Tomorrow",firstBoxShips:`${w.Poss} first box ships.`,trackingComesByText:"Tracking comes by text.",checkin:q=>q===null?"A 2-week check-in by text.":`A 2-week check-in by text: ${q}`,refill:`A text 3 days before ${w.poss} next box. Reply SKIP to skip it.`,nextBoxShips:p=>`${w.Poss} next box ships, ${p.box??""}.`,startedDone:`Back to ${w.poss} plan`,manageKicker:"Your subscription",manageTitle:p=>`Manage ${p.productName}`,skip:"Skip the next box",cancel:"Cancel subscription",skipped:(_p,next)=>next===null?"Skipped.":`Skipped. ${w.Poss} next box ships ${next}.`,cancelled:p=>`${p.productName} is cancelled. Restart it from ${w.poss} plan anytime.`,orders:"Orders",startedHeader:"Subscribed",placedHeader:"Order placed",cartCheckoutTitle:"Checkout",orderNote:"",cartLabel:n=>n>0?`Cart, ${n} item${n>1?"s":""}`:"Cart, empty",addToCart:price=>`Add to cart · ${price}`,viewCart:"View cart",addedToCart:(p,subscription)=>`${p.productName} is in your cart${subscription?", as a subscription":""}.`,removedFromCart:name=>`${name} is out of your cart.`,cartTitle:"Cart",cartEmptyTitle:"Your cart is empty",cartEmptyBody:p=>`${NameOf(p)}'s plan pick lands here when you add it.`,seeOrders:`See ${w.poss} orders`,quantityLabel:name=>`How many: ${name}`,fewer:"One fewer",more:"One more",remove:"Remove",cartSubLine:p=>p.offer?`First box ${p.discountPercent}% off, then ${p.box??""} every ${p.intervalDays} days`:`Every ${p.intervalDays} days`,cartOnceLine:(p,subscribed)=>subscribed?`An extra box. ${w.Poss} plan keeps shipping.`:p.onceDiscountPercent>0?`One box, ${p.onceDiscountPercent}% off`:"One box",cartModeLabel:name=>`How to buy ${name}`,cartModeSubscribe:p=>p.offer?`Subscribe, ${p.discountPercent}% off the first box`:"Subscribe",cartModeOnce:p=>p.onceDiscountPercent>0?`One box, ${p.onceDiscountPercent}% off`:"One box",subtotal:"Subtotal",shipping:"Shipping",shippingValue:"",shippingTag:"",total:"Total",dueToday:"Due today",thenRenews:p=>`Then ${p.productName}`,renewsEvery:p=>`${p.box??""} every ${p.intervalDays} days`,checkoutCart:total=>`Checkout · ${total}`,cartOneAtATime:"",cartSubscriptionApart:"",cartItemSubscription:p=>`Subscription, every ${p.intervalDays} days`,cartItemQuantity:n=>`Qty ${n}`,placeOrder:(total,subscribe)=>`${subscribe?"Place order and subscribe":"Place order"} · ${total}`,cartFine:p=>`${p===null?"":`${cartRenewal(p)} `}Ships tomorrow.`,placedSteps:"What's coming",placedShips:"It ships.",placedArrives:"It arrives at home.",viewOrder:"View order",herSubscription:`${w.Poss} subscription`,nextBox:day=>`Next box ${day}`,everyDays:n=>`Every ${n} days`,ordersHeading:afterSubscription=>afterSubscription?"Orders":`${w.Poss} orders`,ordersFine:"",ordersEmptyTitle:"No orders yet",ordersEmptyBody:p=>`The boxes from ${nameOf(p)}'s plan show up here.`,moreOrders:"",orderSteps:["Ordered","Shipped","Out for delivery","Delivered"],subscriptionBox:"Subscription box",orderTitle:n=>n===null?"Order":`Order ${n}`,arrivesBy:day=>`Arrives by ${day}`,deliveredOn:day=>`Delivered ${day}`,expected:day=>`Expected ${day}`,tracking:"Tracking",trackingByText:"The tracking number comes by text when it ships.",trackOn:carrier=>`Track on ${carrier}`,trackLink:"",inThisOrder:"In this order",orderItemLine:(n,box)=>`Qty ${n}${box?" · subscription box":""}`,paidWith:"Paid with",buyAgain:"Buy again",orderHelp:"Get help with this order",addWeightTitle:`Add ${w.poss} weight to size ${w.poss} dose`,addWeightBody:`From a home scale or ${w.poss} last vet visit.`,connectRecordsTitle:`Connect ${w.poss} vet records`,connectRecordsBody:`${w.Poss} weight, visits and labs make ${w.poss} plan sharper.`,weightKicker:`${w.Poss} weight`,weightTitle:p=>`Add ${nameOf(p)}'s weight`,weightBody:`From a home scale or ${w.poss} last vet visit. ${w.Poss} plan uses it to size ${w.poss} dose.`,weightField:`${w.Poss} weight`,weightUnit:"lb",weightUnitKg:"kg",weightErrorKg:"Enter your pet’s weight",weightError:`Enter ${w.poss} weight in pounds, like 14.1.`,weightSave:`Save ${w.poss} weight`,weightSaved:lb=>`Saved: ${lb} lb. ${w.Poss} dose is sized for ${w.obj}.`,weightSavedKg:kg=>`Saved: ${kg} kg. ${w.Poss} dose is sized for ${w.obj}.`,checkoutFailed:"That didn't go through. Please try again.",builtWith:vet=>`Built with ${vet}`,fromVet:shortName=>`From ${shortName}`,waitVetTips:vet=>`Free tips from ${vet}, built around that risk`,signalsFit:count=>`${count} of ${count} signals fit ${w.Name}`,signalsValue:count=>`${count}/${count}`,noPick:`No supplement for this one. ${w.Poss} vet comes first.`,callYourVet:"Call your vet today",callAVet:"Call a vet today",saveForCheckup:`Save for ${w.poss} next checkup`,savedForCheckup:`Saved for ${w.poss} next checkup`,blanksLabel:`${w.Poss} three blanks`,blanksAsked:clinic=>`Asked ${clinic}`,blanksAskedNoClinic:"",blanksWaitPill:"2 to 5 days",blanksFilledKicker:`From ${w.poss} vet records`,blanksFilled:(filled2,total)=>`${filled2} of ${total} filled`,blanksWeight:`Keep ${w.obj} at `,blanksWeightSource:`From ${w.poss} vet visits`,blanksDose:(dose,product)=>`${dose} of ${product}`,blanksDoseSource:`Sized to ${w.poss} weight`,blanksShots:`${w.Poss} next shots are due `,blanksShotsSource:`From ${w.poss} clinic`,blankEmpty:"blank",recordsLanded:`${w.Poss} records are in. ${w.Poss} plan now uses ${w.poss} weight and ${w.poss} visits.`,todayLabel:`${w.Poss} Health Plan`,poweredBy:"powered by",poweredByName:"Everfur",seeMore:"See more",seeLess:"See less",reportActions:"Actions to take",openReport:`Open it in ${w.poss} report`,askReport:"Ask about it",fullOpen:`See ${w.poss} full plan`,fullOpenLine:`${w.Poss} vet, reviews and ${w.poss} checkup`,fullClose:`Show ${w.poss} brief plan`,fullCloseLine:`${w.Poss} risk, tips, pick and signs`,hopeNoted:phrases=>`Noted. When ${w.poss} results land, we'll start with ${phrases}.`,productLink:product=>`${product}, see the product`,productPhotos:product=>`${product} photos, swipe for more`,shopAll:"Shop all",madeFor:`Made for ${w.name}`,ratingLine:count=>`· ${count} reviews`,productOffer:p=>`${p.discountPercent}% off ${w.poss} first box`,productEvery:p=>`Every ${p.intervalDays} days`,productOnce:p=>p.onceDiscountPercent>0?`One box, ${p.onceDiscountPercent}% off`:"One box",productExtraBox:"An extra box",productOnPlan:p=>`On ${w.poss} plan, every ${p.intervalDays} days. This adds one extra box.`,quantity:"Quantity",description:"Description",readMore:"Read more",readLess:"Read less",whatsInside:"What's inside",howMuch:"How much",reviewsTitle:"Reviews",reviewCount:count=>`${count} reviews`,reviewsSwipe:"Reviews, swipe for more",readAllReviews:count=>`Read all ${count} reviews`,starsLabel:rating=>`${rating} out of 5 stars`,buyNow:"Buy now"});return copy}var HEALTH_PLAN_FOCUS_COPY=healthPlanFocusCopyFor({sex:"female"});function formatHealthPlanDay(iso,locale){if(iso===null||!/^\d{4}-\d{2}-\d{2}$/.test(iso))return null;let d=/* @__PURE__ */new Date(`${iso}T00:00:00Z`);if(Number.isNaN(d.getTime()))return null;try{return new Intl.DateTimeFormat(locale??"en-US",{month:"short",day:"numeric",timeZone:"UTC"}).format(d)}catch{return iso}}var HEALTH_PLAN_ORDERS_EMPTY=/* @__PURE__ */Object.freeze({loaded:false,orders:[],next:null,loading:false});function pushHealthPlanScreen(prev,screen){return[...prev.filter(x=>x.kind!==screen.kind),screen]}function healthPlanOverlayOf(sheet,started,top){return sheet!==null?sheet.kind:healthPlanUnderOf(started,top)}function healthPlanUnderOf(started,top){return started!==null?"started":top!==void 0?top.kind:null}function mergeHealthPlanOrders(recent,loaded){let seen=/* @__PURE__ */new Set;return[...recent,...loaded].filter(o=>seen.has(o.orderId)?false:(seen.add(o.orderId),true))}function addRecentHealthPlanOrders(prev,orders){return[...orders,...prev.filter(o=>!orders.some(x=>x.orderId===o.orderId))]}function appendHealthPlanOrderPage(prev,page){return{loaded:true,orders:[...prev.orders,...page.orders.filter(o=>!prev.orders.some(x=>x.orderId===o.orderId))],next:page.nextCursor,loading:false}}function healthPlanOrderNumber(key,everfurOrders,hostOrders){if(key===null)return null;let own=everfurOrders.find(o=>o.orderId===key);return own!==void 0?own.tracking?.orderNumber??null:hostOrders.find(o=>o.key===key)?.number??null}function editHealthPlanCartLine(prev,productId,f){return prev.flatMap(x=>x.productId!==productId?[x]:f(x)??[])}async function readHealthPlanOrders(repo,petRef,cursor){if(repo.listOneBoxOrderPage!==void 0)return repo.listOneBoxOrderPage(petRef,{limit:20,...cursor===null?{}:{cursor:cursor}});if(cursor!==null||repo.listOneBoxOrders===void 0)return{ok:true,value:{orders:[],nextCursor:null}};let res=await repo.listOneBoxOrders(petRef);return res.ok?{ok:true,value:{orders:res.value,nextCursor:null}}:res}function isHealthPlanInvalidCursor(error){if(error.httpStatus!==422)return false;let raw=error.raw!==null&&typeof error.raw=="object"?error.raw:null;return[error.reasonCode,error.wireMessage,raw?.detail,raw?.message].some(x=>x==="invalid_cursor")}var roundCents=n=>Math.round(n*100)/100;function useHealthPlanSubscriptionRepository(){let{runtime:runtime}=useEverfurContext();return react.useMemo(()=>createHealthPlanSubscriptionRepository(runtime),[runtime])}function useHealthPlanSubscription(options){let{userRef:userRef}=useEverfurContext(),own=useHealthPlanSubscriptionRepository(),repository=options.repository??own,enabled=options.enabled!==false&&userRef!==null&&options.petRef!==null&&options.productId!==null,{petRef:petRef,productId:productId}=options,[phase,setPhase]=react.useState("idle"),[quote,setQuote]=react.useState(null),[subscription,setSubscription]=react.useState(null),[busy,setBusy]=react.useState(false),[error,setError]=react.useState(null),[readyAt,setReadyAt]=react.useState(null),epoch=react.useRef(0),writes=react.useRef(0),quiet=react.useRef(0),busyRef=react.useRef(false),refreshAfterWrite=react.useRef(false),revalidateRef=react.useRef(()=>Promise.resolve()),load=react.useCallback(async()=>{let mine=++epoch.current;if(refreshAfterWrite.current=false,setReadyAt(null),!enabled||petRef===null||productId===null){setPhase("idle"),setQuote(null),setSubscription(null);return}setPhase("loading");let res=await repository.quote(petRef,productId);if(mine===epoch.current){if(!res.ok){setQuote(null),setSubscription(null),setError(res.error),setPhase(isHealthPlanSubscriptionUnavailable(res.error)?"unavailable":"failed");return}setError(null),setQuote(res.value),setSubscription(res.value.subscription),setPhase("ready"),setReadyAt(Date.now())}},[enabled,petRef,productId,repository]),ready=enabled&&phase==="ready",revalidate=react.useCallback(async()=>{if(!ready||busyRef.current||petRef===null||productId===null)return;let mine=epoch.current,wrote=writes.current,seq=++quiet.current,res=await repository.quote(petRef,productId);mine!==epoch.current||wrote!==writes.current||seq!==quiet.current||busyRef.current||!res.ok||(setQuote(res.value),setSubscription(res.value.subscription),setReadyAt(Date.now()))},[ready,petRef,productId,repository]);revalidateRef.current=revalidate;let refreshOnKey=()=>{if(!ready){load();return}if(busyRef.current){refreshAfterWrite.current=true;return}revalidate()};useHealthPlanRevalidation({lifecycle:options.lifecycle,refreshKey:options.refreshKey,readyAt:ready?readyAt:null,revalidate:()=>{revalidate()},refresh:refreshOnKey});let settleWrite=react.useCallback(()=>{refreshAfterWrite.current&&(refreshAfterWrite.current=false,revalidateRef.current())},[]);react.useEffect(()=>(load(),()=>{epoch.current+=1}),[load]);let write2=react.useCallback(async run2=>{let mine=epoch.current;writes.current+=1,busyRef.current=true,setBusy(true);let res=await run2();return busyRef.current=false,mine!==epoch.current?res:(setBusy(false),res.ok?(setError(null),setSubscription(res.value),settleWrite(),res):(setError(res.error),isHealthPlanSubscriptionUnavailable(res.error)?setPhase("unavailable"):settleWrite(),res))},[settleWrite]),buy=react.useCallback(async tapKey=>{let mine=epoch.current;writes.current+=1,busyRef.current=true,setBusy(true);let res=await repository.buyOneBox(petRef,productId,tapKey);return busyRef.current=false,mine!==epoch.current?res:(setBusy(false),res.ok?(setError(null),load(),res):(setError(res.error),isHealthPlanSubscriptionUnavailable(res.error)?setPhase("unavailable"):settleWrite(),res))},[repository,petRef,productId,load,settleWrite]);return react.useMemo(()=>{let p=petRef,sid=subscription?.subscriptionId??"",none=()=>Promise.resolve(err(makeEverfurError("validationFailed",{retryable:false,wireMessage:"the subscription quote is not ready"})));return{phase:phase,quote:quote,subscription:subscription,busy:busy,error:error,subscribe:n=>ready&&productId!==null?write2(()=>repository.create(p,productId,n)):none(),changeInterval:n=>ready&&sid!==""?write2(()=>repository.changeInterval(p,sid,n)):none(),skip:()=>ready&&sid!==""?write2(()=>repository.skip(p,sid)):none(),cancel:()=>ready&&sid!==""?write2(()=>repository.cancel(p,sid)):none(),restart:n=>ready&&sid!==""?write2(()=>repository.restart(p,sid,n)):none(),buyOneBox:k2=>ready&&productId!==null?buy(k2):none(),refresh:load}},[phase,quote,subscription,busy,error,ready,petRef,productId,repository,write2,buy,load])}var LB_PER_KG=2.20462262;function healthPlanWeightForSave(entered,inKg){return{weightKg:inKg?entered:Math.round(entered/LB_PER_KG*100)/100,pounds:inKg?Math.round(entered*LB_PER_KG*10)/10:entered}}var SIGNALS_SYMBOL=/* @__PURE__ */Symbol.for("@everfur/sdk#HealthPlanSignals@v1"),signalHost=globalThis;function isSignalState(value){if(typeof value!="object"||value===null)return false;let v=value;return v.landed instanceof Set&&v.noVet instanceof Set&&v.noVetByPet instanceof Map}var stored=signalHost[SIGNALS_SYMBOL],fresh=()=>({landed:/* @__PURE__ */new Set,noVet:/* @__PURE__ */new Set,noVetByPet:/* @__PURE__ */new Map}),state=isSignalState(stored)?stored:signalHost[SIGNALS_SYMBOL]=fresh(),landedListeners=state.landed,noVetListeners=state.noVet,noVetByPet=state.noVetByPet;function notifyHealthPlanRecordsLanded(petRef,source="host"){for(let listener of[...landedListeners])try{listener(petRef,source)}catch{}}function onHealthPlanRecordsLanded(listener){return landedListeners.add(listener),()=>{landedListeners.delete(listener)}}function setHealthPlanNoVet(petRef,noVet){if((noVetByPet.get(petRef)??false)!==noVet){noVet?noVetByPet.set(petRef,true):noVetByPet.delete(petRef);for(let listener of[...noVetListeners])try{listener(petRef,noVet)}catch{}}}function healthPlanNoVet(petRef){return noVetByPet.get(petRef)??false}function onHealthPlanNoVet(listener){return noVetListeners.add(listener),()=>{noVetListeners.delete(listener)}}function useHealthPlanBlanksLanding(options){let{petRef:petRef,noVet:noVetOverride,blanksFacts:blanksFacts,store:store,say:say,line:line}=options,[storeNoVet,setStoreNoVet]=react.useState(()=>healthPlanNoVet(petRef));react.useEffect(()=>(setStoreNoVet(healthPlanNoVet(petRef)),onHealthPlanNoVet((pet,none)=>{pet===petRef&&setStoreNoVet(none)})),[petRef]);let noVet=noVetOverride??storeNoVet,[flashKey,setFlashKey]=react.useState(null),hostSaid=react.useRef(false);react.useEffect(()=>(hostSaid.current=false,onHealthPlanRecordsLanded((pet,source)=>{pet===petRef&&source==="host"&&(hostSaid.current=true)})),[petRef]);let blanksPhase=blanksFacts?.phase??null,blanksId=blanksFacts?.requestId??null,landed=react.useRef({say:say,line:line});return landed.current={say:say,line:line},react.useEffect(()=>{if(blanksId===null)return;let live=true,run2=()=>{let memo=store.readBlanksMemo(petRef);if(blanksPhase==="wait"){memo.waited!==blanksId&&store.writeBlanksMemo(petRef,{...memo,waited:blanksId});return}!live||memo.flashed===blanksId||(store.writeBlanksMemo(petRef,{...memo,flashed:blanksId}),!(memo.waited!==blanksId&&!hostSaid.current)&&(hostSaid.current=false,setFlashKey(blanksId),landed.current.line!==""&&landed.current.say(landed.current.line),notifyHealthPlanRecordsLanded(petRef,"plan")))};return store.loadBlanksMemo===void 0?run2():store.loadBlanksMemo(petRef).then(run2),()=>{live=false}},[blanksPhase,blanksId,petRef,store]),{noVet:noVet,flashKey:flashKey}}function useHealthPlanOrdersList(options){let{shop:shop,ordersOpen:ordersOpen,subsRepo:subsRepo,petRef:petRef,everfurOrders:everfurOrders,setEverfurOrders:setEverfurOrders,say:say}=options,ordersLive=react.useRef(false),loadingMore=react.useRef(false),sayRef=react.useRef(say);return sayRef.current=say,react.useEffect(()=>{if(!shop||!ordersOpen)return;let live=true;return ordersLive.current=true,readHealthPlanOrders(subsRepo,petRef,null).then(res=>{live&&(res.ok?setEverfurOrders({loaded:true,orders:res.value.orders,next:res.value.nextCursor,loading:false}):(setEverfurOrders(prev=>({...prev,loaded:true,loading:false})),sayRef.current(res.error.displayMessage)))}),()=>{live=false,ordersLive.current=false}},[shop,ordersOpen,petRef,subsRepo]),{moreOrders:()=>{let cursor=everfurOrders.next;cursor===null||loadingMore.current||(loadingMore.current=true,setEverfurOrders(prev=>({...prev,loading:true})),readHealthPlanOrders(subsRepo,petRef,cursor).then(async res=>{let again=!res.ok&&isHealthPlanInvalidCursor(res.error)?await readHealthPlanOrders(subsRepo,petRef,null):null;if(loadingMore.current=false,!!ordersLive.current){if(again!==null){again.ok?setEverfurOrders({loaded:true,orders:again.value.orders,next:again.value.nextCursor,loading:false}):(setEverfurOrders(prev=>({...prev,next:null,loading:false})),sayRef.current(again.error.displayMessage));return}if(res.ok){let page=res.value;setEverfurOrders(prev=>appendHealthPlanOrderPage(prev,page))}else setEverfurOrders(prev=>({...prev,loading:false})),sayRef.current(res.error.displayMessage)}}))}}}var KG_MIN=.5,KG_MAX=90,LB_MIN=1,LB_MAX=200,TOAST_MS=2600,GLOBAL_CLOCK={setTimeout:(fn,ms)=>setTimeout(fn,ms),clearTimeout:handle=>clearTimeout(handle)};function useHealthPlanFocus(options,copy,ports,rules){let{design:design,item:item,petRef:petRef,petName:petName,locale:locale}=options,{store:store,callHost:callHost2}=ports,clock=ports.clock??GLOBAL_CLOCK,telemetry=useHealthPlanTelemetry(),{runtime:runtime}=useEverfurContext(),sub=useHealthPlanSubscription({petRef:petRef,productId:item.productId,enabled:options.subscriptions!==false&&design.pick.none!==true,...options.subscriptionRepository?{repository:options.subscriptionRepository}:{},...options.lifecycle!==void 0?{lifecycle:options.lifecycle}:{},...options.refreshKey!==void 0?{refreshKey:options.refreshKey}:{}}),[mode,setMode]=react.useState("sub"),[added,setAdded]=react.useState(false),[extras,setExtras]=react.useState(()=>/* @__PURE__ */new Set),[sheet,setSheet]=react.useState(null),[started,setStarted]=react.useState(null),tapKey=react.useRef(null),[toast,setToast]=react.useState(null),toastTimer=react.useRef(null),clockRef=react.useRef(clock);clockRef.current=clock,react.useEffect(()=>()=>{toastTimer.current!==null&&clockRef.current.clearTimeout(toastTimer.current)},[]);let withTracking=line=>[line,copy.trackingComesByText].filter(x=>x!=="").join(" "),say=line=>{rules.dropEmptyToast&&line===""||(setToast(line),toastTimer.current!==null&&clock.clearTimeout(toastTimer.current),toastTimer.current=clock.setTimeout(()=>setToast(null),TOAST_MS))},everfur=options.checkout==="everfur_stripe"&&rules.checkoutReachable,ownPages=useHealthPlanPageRepository(),pages=options.pageRepository??ownPages,checkoutTap=react.useRef(null),[redirecting,setRedirecting]=react.useState(false),shop=options.shop??everfur,[cart,setCartState]=react.useState(()=>shop?store.readCart(petRef):[]),cartRef=react.useRef(cart);react.useEffect(()=>{if(!shop||store.loadCart===void 0)return;let live=true;return store.loadCart(petRef).then(()=>{if(!live)return;let kept=store.readCart(petRef);cartRef.current.length===0&&kept.length>0&&(cartRef.current=kept,setCartState(kept))}),()=>{live=false}},[shop,store,petRef]);let setCart=react.useCallback(f=>{let next=f(cartRef.current);cartRef.current=next,store.writeCart(petRef,next),setCartState(next)},[petRef,store]),[screens,setScreens]=react.useState([]),ownSubs=useHealthPlanSubscriptionRepository(),subsRepo=options.subscriptionRepository??ownSubs,[everfurOrders,setEverfurOrders]=react.useState(HEALTH_PLAN_ORDERS_EMPTY),[cartOff,setCartOff]=react.useState(false),[weightSaved,setWeightSaved]=react.useState(false),[recent,setRecent]=react.useState([]),others=options.others??[],planItems=[item,...others],ownOrders=mergeHealthPlanOrders(recent,everfurOrders.orders),hostOrders=options.shopOrders??[],orderNumber=key=>healthPlanOrderNumber(key,ownOrders,hostOrders),push=react.useCallback(screen=>{setSheet(null),setScreens(prev=>pushHealthPlanScreen(prev,screen))},[]),top=screens.length>0?screens[screens.length-1]:void 0,overlay2=healthPlanOverlayOf(sheet,started,top),under=healthPlanUnderOf(started,top),closeOverlays=react.useCallback(()=>{setSheet(null),setStarted(null),setScreens([])},[]),back=react.useCallback(()=>{sheet!==null?setSheet(null):started!==null?setStarted(null):setScreens(prev=>prev.slice(0,-1))},[sheet,started]),title=(o=>{switch(o){case"started":return started?.kind==="once"?copy.placedHeader:copy.startedHeader;case"cart":return copy.cartTitle;case"placed":return copy.placedHeader;case"orders":return copy.orders;case"order":return copy.orderTitle(orderNumber(top?.kind==="order"?top.key:null));case"product":{let id=top?.kind==="product"?top.productId:null;return id===null?void 0:planItems.find(x=>x.productId===id)?.title}default:return}})(under),full=under==="started"||under==="cart"||under==="placed"||under==="product",onOverlayChange=options.onOverlayChange,callHostRef=react.useRef(callHost2);callHostRef.current=callHost2,react.useEffect(()=>{onOverlayChange!==void 0&&callHostRef.current(onOverlayChange,overlay2,{close:closeOverlays,back:back,...title===void 0?{}:{title:title},...full?{full:full}:{}})},[overlay2,onOverlayChange,closeOverlays,back,title,full]);let quote=sub.phase==="ready"?sub.quote:null,subscription=sub.subscription,active=subscription?.status==="active",pickPriced=(quote?.boxPrice??item.price)!==null,canSubscribe=quote!==null&&(!rules.subscribeNeedsPrice||pickPriced),offer=canSubscribe&"e.offerApplies&&subscription===null,every=active?subscription.intervalDays:canSubscribe?quote.defaultIntervalDays:0,fmt=(n,currency2)=>formatHealthPlanPriceWith(n,currency2,{dropZeroCents:false,...options.priceFormat,...locale?{locale:locale}:{}}),fmtWhole=(n,currency2)=>formatHealthPlanPriceWith(n,currency2,{dropZeroCents:true,...options.priceFormat,...locale?{locale:locale}:{}}),currency=quote?.currency??item.currency,boxPrice=quote?.boxPrice??item.price,oneBox=quote?.oneBox??null,prices=(days,productName=item.title)=>({petName:petName,productName:productName,first:fmt(offer&"e?quote.firstBoxPrice:boxPrice,currency),box:fmt(boxPrice,currency),once:fmt(oneBox?.price??boxPrice,currency),onceDiscountPercent:oneBox?.discountPercent??0,intervalDays:days,discountPercent:offer&"e?quote.firstBoxDiscountPercent:0,offer:offer}),pr=prices(every),priced=pr.box!==null,buyMode=canSubscribe?mode:"once",day=iso=>formatHealthPlanDay(iso,locale),nextBoxDay=s=>day(s.timeline.find(step=>step.step==="next_box_ships")?.on??s.nextBoxDate),buyOnce=(target=item)=>{options.onBuy?callHost2(options.onBuy,target):options.onCheckout&&callHost2(options.onCheckout,[target])},partnerBuys=options.onBuy!==void 0||options.onCheckout!==void 0,settle=res=>res.ok?(options.onSubscriptionChange&&callHost2(options.onSubscriptionChange,res.value),res.value):(say(res.error.displayMessage),null),redirect=async(purchase,intervalDays,target=item)=>{if(redirecting)return;let urls=ports.returnUrls();if(urls===null)return;let sig=`${target.productId}:${purchase}:${intervalDays??""}`;checkoutTap.current?.sig!==sig&&(checkoutTap.current={sig:sig,key:ports.mintKey()}),setRedirecting(true);let res=await pages.startCheckout(petRef,{productId:target.productId,purchase:purchase,...intervalDays===null?{}:{intervalDays:intervalDays},...urls},checkoutTap.current.key);if(setRedirecting(false),!res.ok){say(res.error.displayMessage);return}store.rememberCheckout(petRef,res.value.checkoutId),ports.openUrl(res.value.url)},itemOf2=productId=>planItems.find(x=>x.productId===productId),inCart=productId=>cart.find(x=>x.productId===productId),isPick=productId=>productId===item.productId,lineSub=x=>isPick(x.productId)&&canSubscribe&&!active&&x.mode==="sub",unitOf=x=>isPick(x.productId)?lineSub(x)?offer&"e?quote.firstBoxPrice:boxPrice:oneBox?.price??boxPrice:itemOf2(x.productId)?.price??null,lines=cart.filter(x=>itemOf2(x.productId)!==void 0),lineCount=lines.reduce((n,x)=>n+x.qty,0),cartTotal=roundCents(lines.reduce((n,x)=>n+(unitOf(x)??0)*x.qty,0)),subLine=lines.find(lineSub)??null,cartOn=everfur&&!cartOff&&pages.startCartCheckout!==void 0,hostLines=!everfur&&options.onCheckoutLines!==void 0,boxesOn=cartOn||hostLines,wasOf=(was,cur)=>{let m=/^[^\d]*(\d+(?:\.\d{1,2})?)[^\d]*$/.exec(was.replace(/,/g,""));return(m?fmt(Number(m[1]),cur??currency):null)??was},lineView=x=>{let it=itemOf2(x.productId)??item,subbed=lineSub(x),pick2=isPick(x.productId),ex=pick2||!rules.linesFromExtras?void 0:design.extras?.items.find(e=>e.productId===x.productId),lp=pick2?prices(x.every,it.title):{...prices(0,it.title),offer:false};return{key:x.productId,name:it.title,imageUrl:it.imageUrl??ex?.imageUrl??null,quantity:x.qty,subscription:subbed,price:fmt(unitOf(x),pick2?currency:it.currency),was:pick2?subbed?offer?lp.box:null:oneBox!==null&&boxPrice!==null&&oneBox.price<boxPrice?lp.box:null:ex?.was?wasOf(ex.was,it.currency):null,note:pick2?subbed?copy.cartSubLine(lp):copy.cartOnceLine(lp,active):null,...rules.linesFromExtras?{tag:ex?.tag??null}:{},modes:pick2&&canSubscribe&&!active?{label:copy.cartModeLabel(it.title),sub:{label:copy.cartModeSubscribe(lp),price:lp.first},once:{label:copy.cartModeOnce(lp),price:lp.once}}:null,every:subbed&"e!==null?{options:quote.intervalOptions,selected:x.every}:null,maxQuantity:boxesOn&&!subbed?5:1,lp:lp}},views=lines.map(lineView),renewPrices=subLine===null?null:prices(subLine.every),addToCart=(target,m,qty=1,quiet=false)=>{if(inCart(target.productId)){push({kind:"cart"});return}let subbing=isPick(target.productId)&&canSubscribe&&!active&&m==="sub",boxes=subbing?1:Math.max(1,Math.min(boxesOn?5:1,qty));setCart(prev=>[...prev,{productId:target.productId,mode:subbing?"sub":"once",every:quote?.defaultIntervalDays??0,qty:boxes}]),quiet||say(copy.addedToCart(isPick(target.productId)?pr:{...prices(0,target.title),offer:false},subbing))},showCart=()=>setScreens(prev=>{let at=prev.findIndex(x=>x.kind==="cart");return at>=0?prev.slice(0,at+1):[...prev,{kind:"cart"}]}),editLine=(productId,f)=>setCart(prev=>editHealthPlanCartLine(prev,productId,f)),stepQuantity=(productId,by)=>editLine(productId,x=>({...x,qty:Math.max(1,Math.min(boxesOn&&!lineSub(x)?5:1,x.qty+by))})),removeLine=productId=>{editLine(productId,()=>null),say(copy.removedFromCart(itemOf2(productId)?.title??""))},apart=cartOn&&subLine!==null&&lines.length>1,batch=apart?lines.filter(x=>!lineSub(x)):lines,batchTotal=roundCents(batch.reduce((n,x)=>n+(unitOf(x)??0)*x.qty,0)),batchSub=batch.find(lineSub)??null,batchRenew=batchSub===null?null:prices(batchSub.every),cartReady=lines.length>0&&lines.every(x=>unitOf(x)!==null)&&(lines.length===1&&(lines[0]?.qty??0)===1?true:cartOn?batch.length>0&&batch.length<=10:!everfur&&(options.onCheckout!==void 0||hostLines)&&lines.every(x=>!lineSub(x))),redirectCart=async batchLines=>{if(redirecting||pages.startCartCheckout===void 0)return;let urls=ports.returnUrls();if(urls===null)return;let sig=`cart:${batchLines.map(x=>`${x.productId}:${x.qty}:${lineSub(x)?x.every:""}`).join("|")}`;checkoutTap.current?.sig!==sig&&(checkoutTap.current={sig:sig,key:ports.mintKey()}),setRedirecting(true);let res=await pages.startCartCheckout(petRef,{items:batchLines.map(x=>{let subbing=lineSub(x);return{productId:x.productId,purchase:subbing?"subscription":"one_box",...subbing?{intervalDays:x.every}:{},quantity:subbing?1:x.qty}}),...urls},checkoutTap.current.key);if(setRedirecting(false),!res.ok){let why=healthPlanCheckoutRefusal(res.error);if(why==="cart_disabled"){setCartOff(true),setSheet(null),say(copy.cartOneAtATime===""?res.error.displayMessage:copy.cartOneAtATime);return}if(why==="cart_has_subscription"){setSheet(null),say(copy.cartSubscriptionApart===""?res.error.displayMessage:copy.cartSubscriptionApart);return}say(res.error.displayMessage);return}store.rememberCheckout(petRef,res.value.checkoutId),ports.openUrl(res.value.url)},orderOneBox=async()=>{tapKey.current===null&&(tapKey.current=ports.mintKey());let res=await sub.buyOneBox(tapKey.current);return res.ok?(tapKey.current=null,options.onOneBoxOrder&&callHost2(options.onOneBoxOrder,res.value),res.value):(say(res.error.displayMessage),null)},placeCart=async()=>{if(!cartReady)return;if(everfur&&cartOn&&!(batch.length===1&&(batch[0]?.qty??0)===1)){batch.map(x=>itemOf2(x.productId)).filter(x=>x!==void 0);trackCheckoutStarted(telemetry,petRef,{count:batch.reduce((n,x)=>n+x.qty,0),subtotal:batchTotal,currency:currency}),await redirectCart(batch);return}if(hostLines&&!(lines.length===1&&(lines[0]?.qty??0)===1)){let handed=lines.flatMap(x=>{let it=itemOf2(x.productId);return it===void 0?[]:[{item:it,quantity:x.qty}]});trackCheckoutStarted(telemetry,petRef,{items:handed.map(x=>x.item),count:handed.reduce((n,x)=>n+x.quantity,0),subtotal:cartTotal,currency:currency}),bought(lines.map(x=>x.productId)),setSheet(null),setScreens([]),options.onCheckoutLines&&callHost2(options.onCheckoutLines,handed);return}let only=batch.length===1?batch[0]:lines.length===1?lines[0]:void 0;if(only===void 0){options.onCheckout&&callHost2(options.onCheckout,lines.map(x=>itemOf2(x.productId)).filter(x=>x!==void 0));return}let target=itemOf2(only.productId)??item,subbing=lineSub(only);if(trackCheckoutStarted(telemetry,petRef,{count:1,subtotal:unitOf(only),currency:isPick(only.productId)?currency:target.currency}),everfur){await redirect(subbing?"subscription":"one_box",subbing?only.every:null,target);return}if(subbing){let s=settle(await sub.subscribe(only.every));if(s===null)return;bought([s.productId]),setSheet(null),setScreens([]),setStarted({kind:"sub",sub:s});return}if(!isPick(only.productId)||oneBox===null){setSheet(null),hostLines&&(bought([only.productId]),setScreens([])),buyOnce(target);return}let o=await orderOneBox();o!==null&&(bought([o.productId]),placed([o]))},press=()=>{if(trackCheckoutStarted(telemetry,petRef,{count:1,subtotal:item.price,currency:item.price===null?null:item.currency}),!canSubscribe){everfur?redirect("one_box",null):buyOnce();return}tapKey.current=null,setSheet({kind:"checkout",mode:buyMode,every:quote.defaultIntervalDays})},pressOther=target=>{trackCheckoutStarted(telemetry,petRef,{count:1,subtotal:target.price,currency:target.price===null?null:target.currency}),everfur?redirect("one_box",null,target):buyOnce(target)},confirmCheckout=async()=>{if(sheet?.kind!=="checkout")return;let isSub=sheet.mode==="sub";if(everfur){await redirect(isSub?"subscription":"one_box",isSub?sheet.every:null);return}if(!isSub){if(oneBox===null){setSheet(null),buyOnce();return}let o=await orderOneBox();if(o===null)return;setSheet(null),placed([o]);return}let s=settle(await sub.subscribe(sheet.every));s!==null&&(setSheet(null),setStarted({kind:"sub",sub:s}))},changeInterval=d=>{subscription===null||d===subscription.intervalDays||sub.changeInterval(d).then(settle)},skip=async()=>{let s=settle(await sub.skip());s!==null&&say(copy.skipped(prices(s.intervalDays),nextBoxDay(s)))},cancel=async()=>{let mp=prices(subscription?.intervalDays??every);settle(await sub.cancel())!==null&&(setSheet(null),setMode("sub"),say(copy.cancelled(mp)))},seeOrdersFromManage=()=>{setSheet(null),top?.kind!=="orders"&&push({kind:"orders"})},toggleAdded=questions=>{let next=!added;setAdded(next),options.onAddToVisit&&callHost2(options.onAddToVisit,next,questions)},toggleExtra=(key,on)=>{let next=!on;setExtras(prev=>{let out=new Set(prev);return next?out.add(key):out.delete(key),out}),options.onExtra&&callHost2(options.onExtra,key,next)},pressExtra=(key,product,on)=>{if(product!==void 0){shop?addToCart(product,"once"):pressOther(product);return}toggleExtra(key,on)},ordersOpen=screens.some(x=>x.kind==="orders"||x.kind==="order"),{moreOrders:moreOrders}=useHealthPlanOrdersList({shop:shop,ordersOpen:ordersOpen,subsRepo:subsRepo,petRef:petRef,everfurOrders:everfurOrders,setEverfurOrders:setEverfurOrders,say:say}),weightKnown=options.weightKnown!==false||weightSaved,kg=options.weightUnit==="kg",[weightInput,setWeightInput]=react.useState(""),[weightError,setWeightError]=react.useState(""),[savingWeight,setSavingWeight]=react.useState(false),openWeight=()=>{setWeightError(""),setSheet({kind:"weight"})},saveWeight=async()=>{let n=Math.round(Number.parseFloat(weightInput.replace(",","."))*10)/10;if(!(kg?n>=KG_MIN&&n<=KG_MAX:n>=LB_MIN&&n<=LB_MAX)){setWeightError(kg?copy.weightErrorKg:copy.weightError);return}let{weightKg:weightKg,pounds:lb}=healthPlanWeightForSave(n,kg);setSavingWeight(true);let res=options.onSaveWeight?await options.onSaveWeight(weightKg,lb):await runtime.updatePet(petRef,{weightKg:weightKg});if(setSavingWeight(false),!res.ok){setWeightError(res.error.displayMessage);return}setWeightError(""),setWeightSaved(true),setSheet(null),say(kg?copy.weightSavedKg(String(n)):copy.weightSaved(String(lb))),options.onWeightSaved&&callHost2(options.onWeightSaved,weightKg)},{noVet:noVet,flashKey:flashKey}=useHealthPlanBlanksLanding({petRef:petRef,noVet:options.noVet,blanksFacts:options.blanksFacts,store:store,say:say,line:copy.recordsLanded}),placed=orders=>{let first=orders[0];if(first!==void 0){if(!shop){setStarted({kind:"once",order:first});return}setRecent(prev=>addRecentHealthPlanOrders(prev,orders)),setSheet(null),setScreens([{kind:"placed",orders:orders}])}},bought=productIds=>{let gone=new Set(productIds.filter(x=>x!==null));gone.size>0&&setCart(prev=>prev.filter(x=>!gone.has(x.productId)))};return{sub:sub,copy:copy,everfur:everfur,shop:shop,partnerBuys:partnerBuys,redirecting:redirecting,pages:pages,quote:quote,subscription:subscription,active:active,canSubscribe:canSubscribe,offer:offer,every:every,currency:currency,boxPrice:boxPrice,oneBox:oneBox,pr:pr,priced:priced,mode:mode,buyMode:buyMode,fmt:fmt,fmtWhole:fmtWhole,prices:prices,day:day,nextBoxDay:nextBoxDay,withTracking:withTracking,sheet:sheet,started:started,screens:screens,top:top,overlay:overlay2,under:under,title:title,full:full,toast:toast,added:added,extras:extras,planItems:planItems,cart:cart,lines:lines,lineCount:lineCount,cartTotal:cartTotal,subLine:subLine,cartOn:cartOn,hostLines:hostLines,boxesOn:boxesOn,wasOf:wasOf,views:views,renewPrices:renewPrices,apart:apart,batch:batch,batchTotal:batchTotal,batchSub:batchSub,batchRenew:batchRenew,cartReady:cartReady,itemOf:itemOf2,inCart:inCart,isPick:isPick,lineSub:lineSub,unitOf:unitOf,lineView:lineView,everfurOrders:everfurOrders,ownOrders:ownOrders,orderNumber:orderNumber,weightKnown:weightKnown,kg:kg,weightInput:weightInput,weightError:weightError,savingWeight:savingWeight,noVet:noVet,flashKey:flashKey,say:say,setMode:setMode,openSheet:setSheet,closeSheet:()=>setSheet(null),push:push,replaceScreens:setScreens,closeStarted:()=>setStarted(null),closeOverlays:closeOverlays,back:back,toggleAdded:toggleAdded,toggleExtra:toggleExtra,pressExtra:pressExtra,buyOnce:buyOnce,press:press,pressOther:pressOther,confirmCheckout:confirmCheckout,changeInterval:changeInterval,skip:skip,cancel:cancel,seeOrdersFromManage:seeOrdersFromManage,addToCart:addToCart,showCart:showCart,editLine:editLine,stepQuantity:stepQuantity,removeLine:removeLine,placeCart:placeCart,moreOrders:moreOrders,openWeight:openWeight,setWeightInput:setWeightInput,saveWeight:saveWeight,returnHandlers:{onPaid:state2=>{let run2=state2.subscription,orders=state2.orders??(state2.order===null?[]:[state2.order]);if(run2!==null)options.onSubscriptionChange&&callHost2(options.onSubscriptionChange,run2),rules.closeOnReturn&&(setSheet(null),setScreens([])),setStarted({kind:"sub",sub:run2});else if(orders.length>0){for(let o of orders)options.onOneBoxOrder&&callHost2(options.onOneBoxOrder,o);placed(orders)}bought([run2?.productId??null,...orders.map(o=>o.productId)]),sub.refresh()},onFailed:()=>{setSheet(null),shop&&(rules.closeOnReturn&&setStarted(null),setScreens([{kind:"cart"}])),copy.checkoutFailed!==""&&say(copy.checkoutFailed)},onCancel:()=>setRedirecting(false),onTimeout:()=>{shop&&(setSheet(null),rules.closeOnReturn&&setStarted(null),setScreens([{kind:"orders"}]))},onError:error=>say(error.displayMessage)}}}function useHealthPlanRecordsEmpty(reader,petRef){let[empty,setEmpty]=react.useState(null);return react.useEffect(()=>{if(reader===void 0)return;let live=true;return reader.getRecord(petRef).then(res=>{live&&setEmpty(res.ok?res.value.withheld!==true&&res.value.is_empty===true:null)}).catch(()=>{}),()=>{live=false}},[reader,petRef]),empty}var CLOSE_FALLBACK="Close",HEALTH_PLAN_TOP_CARD_COPY=/* @__PURE__ */Object.freeze({action:who=>who.possessive===null?null:`See ${who.possessive} Health Plan`,ask:"What does it mean?",askPrompt:(focus,ask)=>focus.risk?.lead?`${focus.risk.lead} ${ask}`:`${focus.title}: ${ask}`,close:who=>who.possessive===null?null:`Close ${who.possessive} focus`,resultsKicker:who=>who.possessive===null?null:`${capital(who.possessive)} results`,resultsClose:who=>who.possessive===null?null:`Close ${who.possessive} results`,resultsTopRisk:"Top risk"});function capital(word){return word.charAt(0).toUpperCase()+word.slice(1)}function healthPlanPossessive(pet){let sex=typeof pet.sex=="string"?pet.sex.trim().toLowerCase():null;if(sex==="female")return"her";if(sex==="male")return"his";let name=typeof pet.name=="string"?pet.name.trim():"";return name!==""?`${name}'s`:null}function healthPlanTopCard(page,options={}){let focus=page?.page?.focus;if(page===null||focus===void 0||focus.title.trim()===""||focus.kicker.trim()==="")return;let copy={...HEALTH_PLAN_TOP_CARD_COPY,...options.copy},who={pet:page.pet,possessive:healthPlanPossessive(page.pet)},badge=focus.sources?.find(source=>source.label.trim()!=="")?.label,onOpenPlan=options.onOpenPlan,action=onOpenPlan===void 0?null:copy.action(who),close=copy.close(who),ask=copy.ask.trim(),results=options.results!==void 0&&focus.report!==void 0?options.results:void 0;if(results!==void 0){let kicker=copy.resultsKicker(who)?.trim()||focus.kicker,shut=copy.resultsClose(who),onTop=results.onTopRisk??onOpenPlan,top={key:"top-risk",label:copy.resultsTopRisk,title:focus.title,...focus.risk?.lead?{line:focus.risk.lead}:{},tone:"risk",...onTop===void 0?{}:{onPress:onTop}};return{kicker:kicker,...badge===void 0?{}:{badge:badge},title:focus.title,results:[top,...results.rows??[]],...action===null||action.trim()===""||onOpenPlan===void 0?{}:{action:{label:action,onPress:onOpenPlan}},...ask===""?{}:{ask:{label:ask,prompt:copy.askPrompt(focus,ask)}},closeLabel:shut===null||shut.trim()===""?CLOSE_FALLBACK:shut,pill:kicker,...options.renderIcon===void 0?{}:{renderIcon:options.renderIcon}}}return{kicker:focus.kicker,...badge===void 0?{}:{badge:badge},title:focus.title,...focus.risk?.lead?{lead:focus.risk.lead}:{},...focus.risk?.body?{body:focus.risk.body}:{},...action===null||action.trim()===""||onOpenPlan===void 0?{}:{action:{label:action,onPress:onOpenPlan}},...ask===""?{}:{ask:{label:ask,prompt:copy.askPrompt(focus,ask)}},closeLabel:close===null||close.trim()===""?CLOSE_FALLBACK:close,pill:focus.kicker,...options.renderIcon===void 0?{}:{renderIcon:options.renderIcon}}}var HEALTH_PLAN_FOCUS_RN_COPY=/* @__PURE__ */Object.freeze({...HEALTH_PLAN_FOCUS_COPY,firstBoxShips:"Her first box ships.",placedShips:"It ships.",trackingComesByText:"",trackingByText:"",moreOrders:"Load more",checkoutFailed:"That didn't go through. Please try again.",back:"Back"}),cap=s=>s===""?s:`${s.charAt(0).toUpperCase()}${s.slice(1)}`;function healthPlanPetCopy(pet){let name=pet.name?.trim()??"",her=healthPlanPossessive(pet)??"your pet's",Her=cap(her),them=pet.sex==="female"?"her":pet.sex==="male"?"him":name!==""?name:"your pet",base3=HEALTH_PLAN_FOCUS_COPY,r5=healthPlanFocusCopyFor({name:pet.name,sex:pet.sex});return{jumpKicker:(p,subscribed)=>subscribed?`In ${her} plan, every ${p.intervalDays} days`:p.offer?`${p.discountPercent}% off ${her} first box`:base3.jumpKicker(p,false),firstBoxShips:pet.trackingTexts===true?`${Her} first box ships. Tracking comes by text.`:`${Her} first box ships.`,placedShips:base3.placedShips,trackingComesByText:pet.trackingTexts===true?base3.trackingComesByText:"",trackingByText:pet.trackingTexts===true?base3.trackingByText:"",refill:`A text 3 days before ${her} next box. Reply SKIP to skip it.`,nextBoxShips:p=>`${Her} next box ships, ${p.box??""}.`,startedDone:`Back to ${her} plan`,skipped:(_p,next)=>next===null?"Skipped.":`Skipped. ${Her} next box ships ${next}.`,cancelled:p=>`${p.productName} is cancelled. Restart it from ${her} plan anytime.`,seeOrders:`See ${her} orders`,cartOnceLine:(p,subscribed)=>subscribed?`An extra box. ${Her} plan keeps shipping.`:base3.cartOnceLine(p,false),herSubscription:`${Her} subscription`,ordersHeading:afterSubscription=>afterSubscription?"Orders":`${Her} orders`,addWeightTitle:`Add ${her} weight to size ${her} dose`,addWeightBody:`From a home scale or ${her} last vet visit.`,connectRecordsTitle:`Connect ${her} vet records`,connectRecordsBody:`${Her} weight, visits and labs make ${her} plan sharper.`,weightKicker:`${Her} weight`,weightBody:`From a home scale or ${her} last vet visit. ${Her} plan uses it to size ${her} dose.`,weightField:`${Her} weight`,weightError:`Enter ${her} weight in pounds, like 14.1.`,weightSave:`Save ${her} weight`,weightSaved:lb=>`Saved: ${lb} lb. ${Her} dose is sized for ${them}.`,weightErrorKg:r5.weightErrorKg,weightSavedKg:r5.weightSavedKg,signalsFit:r5.signalsFit,noPick:r5.noPick,saveForCheckup:r5.saveForCheckup,savedForCheckup:r5.savedForCheckup,blanksLabel:r5.blanksLabel,blanksFilledKicker:r5.blanksFilledKicker,blanksWeight:r5.blanksWeight,blanksWeightSource:r5.blanksWeightSource,blanksDoseSource:r5.blanksDoseSource,blanksShots:r5.blanksShots,blanksShotsSource:r5.blanksShotsSource,recordsLanded:r5.recordsLanded}}var BLANKS_MEMO_KV_PREFIX="everfur.healthPlan.blanks",NONE=/* @__PURE__ */Object.freeze({waited:null,flashed:null}),memos=/* @__PURE__ */new Map,loads=/* @__PURE__ */new Map,keyOf2=petRef=>`${BLANKS_MEMO_KV_PREFIX}:${petRef}`;function parse(raw){if(raw===null)return NONE;try{let o=JSON.parse(raw);if(o===null||typeof o!="object")return NONE;let r=o;return{waited:typeof r.waited=="string"?r.waited:null,flashed:typeof r.flashed=="string"?r.flashed:null}}catch{return NONE}}function loadBlanksMemo(kv,petRef){let own=memos.get(petRef);if(own!==void 0)return Promise.resolve(own);let load=loads.get(petRef);return load===void 0&&(load=(async()=>{let read=NONE;try{read=kv?parse(await kv.getItem(keyOf2(petRef))):NONE}catch{}let memo=memos.get(petRef)??read;return memos.set(petRef,memo),memo})(),loads.set(petRef,load)),load}function blanksMemo(petRef){return memos.get(petRef)??NONE}function setBlanksMemo(kv,petRef,memo){if(memos.set(petRef,memo),!!kv)try{kv.setItem(keyOf2(petRef),JSON.stringify(memo)).catch(()=>{})}catch{}}var CHECKOUT_PARAM="everfur_checkout",CHECKOUT_CANCEL_PARAM="everfur_checkout_cancel",STRIPE_SESSION_ID="{CHECKOUT_SESSION_ID}",CHECKOUT_POLL_MS=2e3,CHECKOUT_POLL_TRIES=30;function validReturnUrl(url){return typeof url!="string"?false:/^https:\/\/[^/?#\s]+[^\s]*$/i.test(url.trim())}var PARAM_RE=new RegExp(`([?&])(?:${CHECKOUT_PARAM}|${CHECKOUT_CANCEL_PARAM})=[^&#]*&?`,"g");function checkoutReturnUrl(base3,name,value){let hashAt=base3.indexOf("#"),hash=hashAt===-1?"":base3.slice(hashAt),head=hashAt===-1?base3:base3.slice(0,hashAt);head=head.replace(PARAM_RE,"$1").replace(/[?&]$/,"");let sep=head.includes("?")?"&":"?";return`${head}${sep}${name}=${value}${hash}`}function readCheckoutReturn(url,base3){let strip=u=>u.split(/[?#]/)[0]?.replace(/\/+$/,"").toLowerCase()??"";if(strip(url)!==strip(base3))return null;let query=url.split("#")[0]?.split("?")[1]??"",params=/* @__PURE__ */new Map;for(let pair of query.split("&")){if(pair==="")continue;let at=pair.indexOf("="),key=at===-1?pair:pair.slice(0,at),value=at===-1?"":pair.slice(at+1);try{value=decodeURIComponent(value)}catch{}params.set(key,value)}if(params.has(CHECKOUT_CANCEL_PARAM))return{kind:"cancel"};let id=params.get(CHECKOUT_PARAM);return id===void 0?null:{kind:"return",sessionId:id===""||id===STRIPE_SESSION_ID?null:id}}function mintTapKey(){let c=globalThis.crypto;return c?.randomUUID?c.randomUUID():`tap-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,12)}`}var SHOP_CART_KV_PREFIX="everfur.healthPlan.cart",SHOP_CHECKOUT_KV_PREFIX="everfur.healthPlan.checkout",checkouts=/* @__PURE__ */new Map,carts=/* @__PURE__ */new Map,checkoutTouched=/* @__PURE__ */new Set,cartTouched=/* @__PURE__ */new Set,loads2=/* @__PURE__ */new WeakMap,DONE=Promise.resolve();function parseCart(raw){if(raw===null)return[];try{let o=JSON.parse(raw);return Array.isArray(o)?o.flatMap(x=>{if(x===null||typeof x!="object")return[];let r=x,productId=r.productId,mode=r.mode,every=r.every,qty=r.qty;return typeof productId!="string"||mode!=="sub"&&mode!=="once"||typeof every!="number"||typeof qty!="number"?[]:[{productId:productId,mode:mode,every:every,qty:Math.max(1,Math.min(mode==="sub"?1:5,Math.round(qty)))}]}):[]}catch{return[]}}function write(kv,key,value){if(kv)try{(value===null?kv.removeItem(key):kv.setItem(key,value)).catch(()=>{})}catch{}}function loadShopMemory(kv,petRef){if(!kv)return DONE;let perPet=loads2.get(kv);perPet===void 0&&(perPet=/* @__PURE__ */new Map,loads2.set(kv,perPet));let load=perPet.get(petRef);return load===void 0&&(load=(async()=>{let cart=[],checkout=null;try{let[rawCart,rawCheckout]=await Promise.all([kv.getItem(`${SHOP_CART_KV_PREFIX}:${petRef}`),kv.getItem(`${SHOP_CHECKOUT_KV_PREFIX}:${petRef}`)]);cart=parseCart(rawCart),checkout=typeof rawCheckout=="string"&&rawCheckout!==""?rawCheckout:null}catch{}!cartTouched.has(petRef)&&cart.length>0&&carts.set(petRef,cart),!checkoutTouched.has(petRef)&&checkout!==null&&checkouts.set(petRef,checkout)})(),perPet.set(petRef,load)),load}function rememberCheckout(petRef,checkoutId,kv){checkoutTouched.add(petRef),checkouts.set(petRef,checkoutId),write(kv,`${SHOP_CHECKOUT_KV_PREFIX}:${petRef}`,checkoutId)}function recallCheckout(petRef){return checkouts.get(petRef)??null}function forgetCheckout(petRef,kv){checkoutTouched.add(petRef),checkouts.delete(petRef),write(kv,`${SHOP_CHECKOUT_KV_PREFIX}:${petRef}`,null)}function readCart(petRef){return carts.get(petRef)??[]}function writeCart(petRef,lines,kv){cartTouched.add(petRef),lines.length===0?carts.delete(petRef):carts.set(petRef,lines),write(kv,`${SHOP_CART_KV_PREFIX}:${petRef}`,lines.length===0?null:JSON.stringify(lines))}function rnFocusStore(kv){return{readCart:readCart,writeCart:(petRef,lines)=>writeCart(petRef,lines,kv),loadCart:petRef=>loadShopMemory(kv,petRef),rememberCheckout:(petRef,checkoutId)=>rememberCheckout(petRef,checkoutId,kv),readBlanksMemo:blanksMemo,writeBlanksMemo:(petRef,memo)=>setBlanksMemo(kv,petRef,memo),loadBlanksMemo:petRef=>loadBlanksMemo(kv,petRef)}}var RN_RULES_BASE=/* @__PURE__ */Object.freeze({dropEmptyToast:true,subscribeNeedsPrice:false,closeOnReturn:true,linesFromExtras:false});var WAITING=/* @__PURE__ */new Set(["requested","awaiting_clinic","awaiting_upload","received","parsing","in_review"]),VACCINE=/vaccin|rabies|dhpp|booster|bordetella|lepto|lyme|parvo|distemper/i,LB_PER_KG2=2.20462262;function dayMs(value){if(value==null||value.length===0)return null;let ms=Date.parse(/^\d{4}-\d{2}-\d{2}$/.test(value)?`${value}T00:00:00Z`:value);return Number.isNaN(ms)?null:ms}function kilograms(value,unit){return value===null||!Number.isFinite(value)||value<=0||unit===null?null:/^\s*kg|kilo/i.test(unit)?value:/^\s*(lb|lbs|pound)/i.test(unit)?value/LB_PER_KG2:null}function healthPlanRecordsWeightKg(record){if(record===null||record.isEmpty||record.withheld)return null;let readings=[];for(let series of record.entitySeries)if(series.key.startsWith("body_weight"))for(let point of series.points){if(point.origin==="owner_reported")continue;let at=dayMs(point.at),unit=point.display?.replace(/^[\d.,\s]+/,"")??null,kg=kilograms(point.value,unit);at!==null&&kg!==null&&readings.push({at:at,kg:kg})}for(let entity of record.entities){if(entity.category!=="body_weight"||entity.origin==="owner_reported")continue;let at=dayMs(entity.observedAt),kg=kilograms(entity.value===null?null:Number.parseFloat(entity.value),entity.unit);at!==null&&kg!==null&&readings.push({at:at,kg:kg})}return readings.length===0?null:(readings.sort((a,b)=>b.at-a.at),readings[0]?.kg??null)}function healthPlanNextShotsAt(record,today){if(record===null||record.isEmpty||record.withheld)return null;let next=null;for(let item of record.forwardLooking){if(!VACCINE.test(item.title))continue;let due=dayMs(item.dueAt);due===null||due<today||(next===null||due<next)&&(next=due)}return next}function latestClinicRequest(requests){return requests.filter(r=>r.source==="clinic_request").slice().sort((a,b)=>(dayMs(b.createdAt)??0)-(dayMs(a.createdAt)??0))[0]}function healthPlanRecordsHoldNoBlanks(input,now){let asked=latestClinicRequest(input.requests);if(asked===void 0||asked.status!=="published"||input.record===null||input.record.withheld)return false;let today=Math.floor(now/864e5)*864e5;return healthPlanRecordsWeightKg(input.record)===null&&healthPlanNextShotsAt(input.record,today)===null}function healthPlanBlanksFacts(input,now){let asked=latestClinicRequest(input.requests);if(asked===void 0)return null;let clinicName=asked.clinicName?.trim()?asked.clinicName.trim():null;if(WAITING.has(asked.status))return{phase:"wait",requestId:String(asked.id),clinicName:clinicName,weightKg:null,nextShotsAt:null};if(asked.status!=="published"||input.record===null||input.record.isEmpty||input.record.withheld)return null;let today=Math.floor(now/864e5)*864e5,weightKg=healthPlanRecordsWeightKg(input.record),nextShotsAt=healthPlanNextShotsAt(input.record,today);return weightKg===null&&nextShotsAt===null?null:{phase:"filled",requestId:String(asked.id),clinicName:clinicName,weightKg:weightKg,nextShotsAt:nextShotsAt}}var COARSE_NOW_TICK_MS=3600*1e3;function useCoarseNow(fixed,shown=true){let[now,setNow]=react.useState(()=>Date.now()),first=react.useRef(true);return react.useEffect(()=>{if(first.current){first.current=false;return}shown&&setNow(Date.now())},[fixed,shown]),react.useEffect(()=>{if(!shown)return;let tick=setInterval(()=>setNow(Date.now()),COARSE_NOW_TICK_MS),onVisible=()=>{document.visibilityState==="visible"&&setNow(Date.now())},doc=typeof document<"u"&&typeof document.addEventListener=="function"?document:null;return doc?.addEventListener("visibilitychange",onVisible),()=>{clearInterval(tick),doc?.removeEventListener("visibilitychange",onVisible)}},[fixed,shown]),now}function RecordsProbe(props){let{status:status,requests:requests,record:record,refresh:refresh}=records.useEverfurRecords({petRef:props.petRef}),{onRead:onRead,petRef:petRef}=props,now=useCoarseNow(),blanks=react.useMemo(()=>healthPlanBlanksFacts({requests:requests,record:record},now),[requests,record,now]),heldNone=react.useMemo(()=>healthPlanRecordsHoldNoBlanks({requests:requests,record:record},now),[requests,record,now]);react.useEffect(()=>{onRead({missing:status==="empty"||heldNone,blanks:blanks})},[status,heldNone,blanks,onRead]);let reread=react.useRef(refresh);return reread.current=refresh,react.useEffect(()=>onHealthPlanRecordsLanded((pet,source)=>{pet===petRef&&source==="host"&&reread.current()}),[petRef]),null}var initialRead=/* @__PURE__ */new Set;function useCheckoutReturn(options){let{enabled:enabled,petRef:petRef,pages:pages,returnUrl:returnUrl,lifecycle:lifecycle,kv:kv}=options,handlers=react.useRef(options);handlers.current=options,react.useEffect(()=>{if(!enabled||returnUrl===null)return;let live=true,polling=false,run2=0,timer=null,poll=async(checkoutId,tries,mine)=>{let res=await pages.getCheckout(petRef,checkoutId);if(!(!live||mine!==run2)){if(res.ok&&res.value.status==="paid"){polling=false,forgetCheckout(petRef,kv),handlers.current.onPaid(res.value);return}if(res.ok&&(res.value.status==="failed"||res.value.status==="expired")){polling=false,forgetCheckout(petRef,kv),handlers.current.onFailed();return}if(!res.ok&&!res.error.retryable){polling=false,forgetCheckout(petRef,kv),handlers.current.onError(res.error);return}if(tries<=1){polling=false,forgetCheckout(petRef,kv),handlers.current.onTimeout();return}timer=setTimeout(()=>{poll(checkoutId,tries-1,mine)},CHECKOUT_POLL_MS)}},start=checkoutId=>{polling||(polling=true,poll(checkoutId,CHECKOUT_POLL_TRIES,run2))},loaded=loadShopMemory(kv,petRef),onUrl=url=>{let back=readCheckoutReturn(url,returnUrl);if(back!==null){if(back.kind==="cancel"){run2+=1,polling=false,timer!==null&&clearTimeout(timer),timer=null,forgetCheckout(petRef,kv),handlers.current.onCancel();return}loaded.then(()=>{if(!live)return;let id=recallCheckout(petRef)??back.sessionId;id!==null&&start(id)})}},resume=()=>{loaded.then(()=>{if(!live)return;let id=recallCheckout(petRef);id!==null&&start(id)})},sub=reactNative.Linking.addEventListener("url",event=>onUrl(event.url));reactNative.Linking.getInitialURL().then(url=>{!live||url===null||url===void 0||initialRead.has(url)||readCheckoutReturn(url,returnUrl)!==null&&(initialRead.add(url),onUrl(url))}).catch(()=>{}).then(resume);let offForeground;if(lifecycle)offForeground=lifecycle.onForeground(resume);else{let app=reactNative.AppState.addEventListener("change",next=>{next==="active"&&resume()});offForeground=()=>app.remove()}return()=>{live=false,timer!==null&&clearTimeout(timer),sub.remove(),offForeground()}},[enabled,petRef,pages,returnUrl,lifecycle,kv])}var BOX2=24,FINE2=16,SEAM2=.8,fine2=dp=>Math.round(dp*FINE2);function place2(cx,cy,W,H,ux,uy){let left=cx-W/2,top=cy-H/2,x=Math.round(left),y=Math.round(top);return{position:"absolute",left:x,top:y,width:W,height:H,transform:[{translateX:left-x},{translateY:top-y},{rotate:`${Math.atan2(uy,ux)*180/Math.PI}deg`},{scale:1/FINE2}]}}function strokePieces2(icon,k2,out){for(let s of icon.strokes){let w=s.width*k2,pts=s.points,n=pts.length/2,last=s.closed?n:n-1;for(let i=0;i<last;i+=1){let j=(i+1)%n,px2=(pts[i*2]??0)*k2,py=(pts[i*2+1]??0)*k2,dx=(pts[j*2]??0)*k2-px2,dy=(pts[j*2+1]??0)*k2-py,len=Math.hypot(dx,dy);if(len===0&&!(n===2&&s.cap))continue;let ux=len===0?1:dx/len,uy=len===0?0:dy/len,e0=s.closed||i>0||s.cap?w/2:0,e1=s.closed||j!==n-1||s.cap?w/2:0,along=(len+e1-e0)/2;out.push({paint:"backgroundColor",style:{...place2(px2+ux*along,py+uy*along,fine2(len+e0+e1),fine2(w),ux,uy),borderTopLeftRadius:e0>0?fine2(w)/2:0,borderBottomLeftRadius:e0>0?fine2(w)/2:0,borderTopRightRadius:e1>0?fine2(w)/2:0,borderBottomRightRadius:e1>0?fine2(w)/2:0,...s.opacity===void 0?{}:{opacity:s.opacity}}})}}}function boxPieces2(icon,k2,out){for(let b of icon.boxes){let w=(b.w+b.width)*k2,h=(b.h+b.width)*k2;out.push({paint:"borderColor",style:{...place2((b.x-b.width/2)*k2+w/2,(b.y-b.width/2)*k2+h/2,fine2(w),fine2(h),1,0),borderWidth:fine2(b.width*k2),borderRadius:(b.radius+b.width/2)*k2*FINE2,...b.opacity===void 0?{}:{opacity:b.opacity}}})}}function trianglePieces2(icon,k2,out){for(let t of icon.triangles){let p=[0,1,2].map(i=>[(t[i*2]??0)*k2,(t[i*2+1]??0)*k2]),base3=0,len=-1;for(let i=0;i<3;i+=1){let a2=p[i]??[0,0],b=p[(i+1)%3]??[0,0],d=Math.hypot(b[0]-a2[0],b[1]-a2[1]);d>len&&(len=d,base3=i)}if(len<=0)continue;let b0=p[base3]??[0,0],b1=p[(base3+1)%3]??[0,0],a=p[(base3+2)%3]??[0,0],ux=(b1[0]-b0[0])/len,uy=(b1[1]-b0[1])/len,along=(a[0]-b0[0])*ux+(a[1]-b0[1])*uy,across=(a[0]-b0[0])*-uy+(a[1]-b0[1])*ux,h=Math.abs(across),up=across<0,mid=up?-h/2:h/2,bl=fine2(along),br=fine2(len)-bl,bh=fine2(h);out.push({paint:up?"borderBottomColor":"borderTopColor",style:{...place2(b0[0]+ux*(len/2)-uy*mid,b0[1]+uy*(len/2)+ux*mid,bl+br,bh,ux,uy),width:0,height:0,borderLeftWidth:bl,borderRightWidth:br,borderLeftColor:"transparent",borderRightColor:"transparent",...up?{borderBottomWidth:bh}:{borderTopWidth:bh}}})}for(let e of icon.seams){let x0=(e[0]??0)*k2,y0=(e[1]??0)*k2,dx=(e[2]??0)*k2-x0,dy=(e[3]??0)*k2-y0,d=Math.hypot(dx,dy),in0=SEAM2*(e[4]??0),in1=SEAM2*(e[5]??0),bar=d-in0-in1;if(d===0||bar<=0)continue;let mid=in0+bar/2;out.push({paint:"backgroundColor",style:place2(x0+dx/d*mid,y0+dy/d*mid,fine2(bar),fine2(SEAM2),dx/d,dy/d)})}}var cache5=/* @__PURE__ */new Map;function piecesOf2(name,size){let key=`${name}:${size}`,hit=cache5.get(key);if(hit!==void 0)return hit;let icon=DESIGN_RN_PLAN_ICONS[name],out=[],k2=size/BOX2;return boxPieces2(icon,k2,out),strokePieces2(icon,k2,out),trianglePieces2(icon,k2,out),cache5.set(key,out),out}function FocusIcon({name:name,size:size=18,color:color}){let pieces=DESIGN_RN_PLAN_ICONS[name]===void 0?[]:piecesOf2(name,size);/* @__PURE__ */
|
|
168
|
-
return jsxRuntime.jsx(reactNative.View,{accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants",testID:`health-plan-icon-${name}`,children:/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:{width:size,height:size},children:pieces.map((piece,i)=>/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[piece.style,{[piece.paint]:color}]},i))})})}function focusPalette(theme){let c=theme.color;if(theme.brightness==="dark")return{ink:c.text.primary,ink2:c.text.secondary,ink3:c.text.muted,paper:c.surfaceSubtle,tile:c.badgeBgNeutral,line:c.brandBorder,card:c.surface,teal:c.brandInk,cyan:c.brandSofter,yellow:c.accent,riskDot:c.errorRed,riskBg:c.badgeBgCritical,riskInk:c.text.primary,clearDot:c.success,clearBg:c.badgeBgPositive,clearInk:c.text.primary,star:c.accent,button:c.primary,onButton:c.onPrimary,jump:c.surfaceSubtle,onJump:c.text.primary,jumpSmall:c.accent,tints:{y:c.badgeBgCaution,c:c.brandSofter,g:c.badgeBgPositive,r:c.badgeBgCritical},scrim:"rgba(0,0,0,0.6)"};let v=v3Palette(theme);return{ink:v.ink,ink2:v.ink2,ink3:v.ink3,paper:v.paper,tile:v.tile,line:v.line,card:v.card,teal:c.brandInk,cyan:c.brandSofter,yellow:v.accent,riskDot:v.riskDot,riskBg:v.riskBg,riskInk:v.riskInk,clearDot:v.clearDot,clearBg:v.clearBg,clearInk:v.clearInk,star:v.watchDot,button:v.primary,onButton:v.onPrimary,jump:v.ink,onJump:v.card,jumpSmall:v.accent,tints:{y:"#FFE7A1",c:"#C8F4F8",g:"#DDEFC4",r:"#FFD8D6"},scrim:"rgba(38,37,35,0.45)"}}function makeFocusStyles(theme){let
|
|
169
|
-
return jsxRuntime.jsx(KitContext.Provider,{value:props.kit,children:props.children})}var DEFAULT_COPY={...HEALTH_PLAN_FOCUS_RN_COPY,...healthPlanPetCopy({name:null,sex:null,trackingTexts:false})},STYLES=/* @__PURE__ */new WeakMap;function stylesFor(theme){let s=STYLES.get(theme);return s===void 0&&(s=makeFocusStyles(theme),STYLES.set(theme,s)),s}function useBuildHealthPlanRnKit(copy,renderIcon){let theme=usePlanTheme(),S=stylesFor(theme),ink=S.palette.ink,still=theme.motion.reducedMotion;return react.useMemo(()=>({S:S,icon:(name,color,size)=>(renderIcon?callHost(renderIcon,name):void 0)??/* @__PURE__ */jsxRuntime.jsx(FocusIcon,{name:name,color:color??ink,...size===void 0?{}:{size:size}}),copy:copy,still:still}),[S,ink,copy,renderIcon,still])}function useHealthPlanRnKit(own={}){let shared=react.useContext(KitContext),fallback=useBuildHealthPlanRnKit(DEFAULT_COPY,void 0),base3=shared??fallback,{copy:copy,renderIcon:renderIcon}=own;return react.useMemo(()=>{if(copy===void 0&&renderIcon===void 0)return base3;let merged=copy===void 0?base3.copy:{...base3.copy,...copy},icon=renderIcon===void 0?base3.icon:(name,color,size)=>callHost(renderIcon,name)??base3.icon(name,color,size);return{...base3,copy:merged,icon:icon}},[base3,copy,renderIcon])}var SHRINK2={flexShrink:1},FR={flexGrow:1,flexShrink:1,flexBasis:0,minWidth:0},KEEP={flexShrink:0},START={alignSelf:"flex-start"},CENTER2={justifyContent:"center"},COLUMN={flexDirection:"column"}
|
|
170
|
-
return jsxRuntime.jsx(reactNative.View,{style:bx(
|
|
166
|
+
return jsxRuntime.jsx(HealthPlanScrollContext.Provider,{value:value,children:/* @__PURE__ */jsxRuntime.jsx(HealthPlanViewportContext.Provider,{value:viewport,children:/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{ref:origin,style:style,collapsable:false,children:children})})})}function useHealthPlanScroll(){return react.useContext(HealthPlanScrollContext)}function useHealthPlanViewport(){return react.useContext(HealthPlanViewportContext)}var warned=false;function warnConnectedOutsideProvider(isDevelopment){if(warned||!isDevelopment)return;warned=true;let globalConsole=globalThis.console;try{globalConsole?.warn?.("[everfur] A ConnectedHealthPlan* block was drawn outside HealthPlanFocusProvider, so it draws nothing. Wrap it in HealthPlanFocusProvider (or HealthPlanFocus), or use the pure block with your own data.")}catch{}}function healthPlanPetWords(name,sex){let n=name?.trim()??"",named=n===""?"your pet":n,Named=n===""?"Your pet":n;return sex==="female"?{name:named,Name:Named,poss:"her",Poss:"Her",obj:"her"}:sex==="male"?{name:named,Name:Named,poss:"his",Poss:"His",obj:"him"}:{name:named,Name:Named,poss:`${named}'s`,Poss:`${Named}'s`,obj:named}}var cartRenewal=p=>p===null?"":`${p.productName} renews every ${p.intervalDays} days at ${p.box??""} until you cancel; skip or cancel anytime in the app.`,HEALTH_PLAN_NO_SHIP_DAY_COPY=/* @__PURE__ */Object.freeze({onceFine:"",cartFine:cartRenewal,startedWhat:()=>""});function healthPlanFocusCopyFor(pet){let w=healthPlanPetWords(pet.name,pet.sex),nameOf=p=>p.petName?.trim()||w.name,NameOf=p=>p.petName?.trim()||w.Name,copy=/* @__PURE__ */Object.freeze({jumpKicker:(p,subscribed)=>subscribed?`In ${w.poss} plan, every ${p.intervalDays} days`:p.offer?`${p.discountPercent}% off ${w.poss} first box`:p.intervalDays>0?`Ships every ${p.intervalDays} days`:copy.onceLine(p),optionsLabel:"How to buy",subscribe:"Subscribe",bestValue:"Best value",subscribeLine:p=>p.offer?`First box, then ${p.box??""}`:`${p.box??""} every ${p.intervalDays} days`,priceLine:p=>p.offer?`${p.discountPercent}% off the first box. Ships every ${p.intervalDays} days.`:p.intervalDays>0?`Ships every ${p.intervalDays} days.`:copy.onceOffer(p),once:"One box",onceLine:p=>p.onceDiscountPercent>0?`${p.onceDiscountPercent}% off, ships once`:"Ships once",buyOnce:p=>`Buy one box, ${p.once??p.box??""}`,subscribed:"Subscribed",subscribedLine:(p,next)=>next===null?`Every ${p.intervalDays} days`:`Every ${p.intervalDays} days · next box ${next}`,manage:"Manage",checkoutKicker:"Checkout",checkoutTitle:p=>`Checkout: ${p.productName}`,checkoutOffer:p=>`${p.discountPercent}% off your first box.`,shipsEvery:"Ships every",days:n=>`${n} days`,buyOnceOption:"Buy once",checkoutGo:(_p,subscribe,today)=>`${subscribe?"Subscribe":"Buy now"} · ${today} today`,renews:p=>`Renews every ${p.intervalDays} days at ${p.box??""} until you cancel; skip or cancel anytime in the app.`,onceFine:"One box, ships tomorrow.",onceOffer:p=>p.onceDiscountPercent>0?`${p.onceDiscountPercent}% off, ships once.`:"Ships once.",checkoutNote:"",close:"Close",startedTitle:p=>`${NameOf(p)}'s plan has started.`,orderedTitle:()=>"Order placed.",startedWhat:p=>`${p.productName} ships tomorrow.`,startedNote:"",startedSteps:"What happens next",tomorrow:"Tomorrow",firstBoxShips:`${w.Poss} first box ships.`,trackingComesByText:"Tracking comes by text.",checkin:q=>q===null?"A 2-week check-in by text.":`A 2-week check-in by text: ${q}`,refill:`A text 3 days before ${w.poss} next box. Reply SKIP to skip it.`,nextBoxShips:p=>`${w.Poss} next box ships, ${p.box??""}.`,startedDone:`Back to ${w.poss} plan`,manageKicker:"Your subscription",manageTitle:p=>`Manage ${p.productName}`,skip:"Skip the next box",cancel:"Cancel subscription",skipped:(_p,next)=>next===null?"Skipped.":`Skipped. ${w.Poss} next box ships ${next}.`,cancelled:p=>`${p.productName} is cancelled. Restart it from ${w.poss} plan anytime.`,orders:"Orders",startedHeader:"Subscribed",placedHeader:"Order placed",cartCheckoutTitle:"Checkout",orderNote:"",cartLabel:n=>n>0?`Cart, ${n} item${n>1?"s":""}`:"Cart, empty",addToCart:price2=>`Add to cart · ${price2}`,viewCart:"View cart",addedToCart:(p,subscription)=>`${p.productName} is in your cart${subscription?", as a subscription":""}.`,removedFromCart:name=>`${name} is out of your cart.`,cartTitle:"Cart",cartEmptyTitle:"Your cart is empty",cartEmptyBody:p=>`${NameOf(p)}'s plan pick lands here when you add it.`,seeOrders:`See ${w.poss} orders`,quantityLabel:name=>`How many: ${name}`,fewer:"One fewer",more:"One more",remove:"Remove",cartSubLine:p=>p.offer?`First box ${p.discountPercent}% off, then ${p.box??""} every ${p.intervalDays} days`:`Every ${p.intervalDays} days`,cartOnceLine:(p,subscribed)=>subscribed?`An extra box. ${w.Poss} plan keeps shipping.`:p.onceDiscountPercent>0?`One box, ${p.onceDiscountPercent}% off`:"One box",cartModeLabel:name=>`How to buy ${name}`,cartModeSubscribe:p=>p.offer?`Subscribe, ${p.discountPercent}% off the first box`:"Subscribe",cartModeOnce:p=>p.onceDiscountPercent>0?`One box, ${p.onceDiscountPercent}% off`:"One box",subtotal:"Subtotal",shipping:"Shipping",shippingValue:"",shippingTag:"",total:"Total",dueToday:"Due today",thenRenews:p=>`Then ${p.productName}`,renewsEvery:p=>`${p.box??""} every ${p.intervalDays} days`,checkoutCart:total=>`Checkout · ${total}`,cartOneAtATime:"",cartSubscriptionApart:"",cartItemSubscription:p=>`Subscription, every ${p.intervalDays} days`,cartItemQuantity:n=>`Qty ${n}`,placeOrder:(total,subscribe)=>`${subscribe?"Place order and subscribe":"Place order"} · ${total}`,cartFine:p=>`${p===null?"":`${cartRenewal(p)} `}Ships tomorrow.`,placedSteps:"What's coming",placedShips:"It ships.",placedArrives:"It arrives at home.",viewOrder:"View order",herSubscription:`${w.Poss} subscription`,nextBox:day=>`Next box ${day}`,everyDays:n=>`Every ${n} days`,ordersHeading:afterSubscription=>afterSubscription?"Orders":`${w.Poss} orders`,ordersFine:"",ordersEmptyTitle:"No orders yet",ordersEmptyBody:p=>`The boxes from ${nameOf(p)}'s plan show up here.`,moreOrders:"",orderSteps:["Ordered","Shipped","Out for delivery","Delivered"],subscriptionBox:"Subscription box",orderTitle:n=>n===null?"Order":`Order ${n}`,arrivesBy:day=>`Arrives by ${day}`,deliveredOn:day=>`Delivered ${day}`,expected:day=>`Expected ${day}`,tracking:"Tracking",trackingByText:"The tracking number comes by text when it ships.",trackOn:carrier=>`Track on ${carrier}`,trackLink:"",inThisOrder:"In this order",orderItemLine:(n,box)=>`Qty ${n}${box?" · subscription box":""}`,paidWith:"Paid with",buyAgain:"Buy again",orderHelp:"Get help with this order",addWeightTitle:`Add ${w.poss} weight to size ${w.poss} dose`,addWeightBody:`From a home scale or ${w.poss} last vet visit.`,connectRecordsTitle:`Connect ${w.poss} vet records`,connectRecordsBody:`${w.Poss} weight, visits and labs make ${w.poss} plan sharper.`,weightKicker:`${w.Poss} weight`,weightTitle:p=>`Add ${nameOf(p)}'s weight`,weightBody:`From a home scale or ${w.poss} last vet visit. ${w.Poss} plan uses it to size ${w.poss} dose.`,weightField:`${w.Poss} weight`,weightUnit:"lb",weightUnitKg:"kg",weightErrorKg:"Enter your pet’s weight",weightError:`Enter ${w.poss} weight in pounds, like 14.1.`,weightSave:`Save ${w.poss} weight`,weightSaved:lb=>`Saved: ${lb} lb. ${w.Poss} dose is sized for ${w.obj}.`,weightSavedKg:kg=>`Saved: ${kg} kg. ${w.Poss} dose is sized for ${w.obj}.`,checkoutFailed:"That didn't go through. Please try again.",builtWith:vet=>`Built with ${vet}`,fromVet:shortName=>`From ${shortName}`,waitVetTips:vet=>`Free tips from ${vet}, built around that risk`,signalsFit:count=>`${count} of ${count} signals fit ${w.Name}`,signalsValue:count=>`${count}/${count}`,noPick:`No supplement for this one. ${w.Poss} vet comes first.`,callYourVet:"Call your vet today",callAVet:"Call a vet today",saveForCheckup:`Save for ${w.poss} next checkup`,savedForCheckup:`Saved for ${w.poss} next checkup`,blanksLabel:`${w.Poss} three blanks`,blanksAsked:clinic=>`Asked ${clinic}`,blanksAskedNoClinic:"",blanksWaitPill:"2 to 5 days",blanksFilledKicker:`From ${w.poss} vet records`,blanksFilled:(filled2,total)=>`${filled2} of ${total} filled`,blanksWeight:`Keep ${w.obj} at `,blanksWeightSource:`From ${w.poss} vet visits`,blanksDose:(dose,product)=>`${dose} of ${product}`,blanksDoseSource:`Sized to ${w.poss} weight`,blanksShots:`${w.Poss} next shots are due `,blanksShotsSource:`From ${w.poss} clinic`,blankEmpty:"blank",recordsLanded:`${w.Poss} records are in. ${w.Poss} plan now uses ${w.poss} weight and ${w.poss} visits.`,todayLabel:`${w.Poss} Health Plan`,poweredBy:"powered by",poweredByName:"Everfur",seeMore:"See more",seeLess:"See less",reportActions:"Actions to take",openReport:`Open it in ${w.poss} report`,askReport:"Ask about it",fullOpen:`See ${w.poss} full plan`,fullOpenLine:`${w.Poss} vet, reviews and ${w.poss} checkup`,fullClose:`Show ${w.poss} brief plan`,fullCloseLine:`${w.Poss} risk, tips, pick and signs`,hopeNoted:phrases=>`Noted. When ${w.poss} results land, we'll start with ${phrases}.`,productLink:product=>`${product}, see the product`,productPhotos:product=>`${product} photos, swipe for more`,shopAll:"Shop all",madeFor:`Made for ${w.name}`,ratingLine:count=>`· ${count} reviews`,productOffer:p=>`${p.discountPercent}% off ${w.poss} first box`,productEvery:p=>`Every ${p.intervalDays} days`,productOnce:p=>p.onceDiscountPercent>0?`One box, ${p.onceDiscountPercent}% off`:"One box",productExtraBox:"An extra box",productOnPlan:p=>`On ${w.poss} plan, every ${p.intervalDays} days. This adds one extra box.`,quantity:"Quantity",description:"Description",readMore:"Read more",readLess:"Read less",whatsInside:"What's inside",howMuch:"How much",reviewsTitle:"Reviews",reviewCount:count=>`${count} reviews`,reviewsSwipe:"Reviews, swipe for more",readAllReviews:count=>`Read all ${count} reviews`,starsLabel:rating=>`${rating} out of 5 stars`,buyNow:"Buy now"});return copy}var HEALTH_PLAN_FOCUS_COPY=healthPlanFocusCopyFor({sex:"female"});function formatHealthPlanDay(iso,locale){if(iso===null||!/^\d{4}-\d{2}-\d{2}$/.test(iso))return null;let d=/* @__PURE__ */new Date(`${iso}T00:00:00Z`);if(Number.isNaN(d.getTime()))return null;try{return new Intl.DateTimeFormat(locale??"en-US",{month:"short",day:"numeric",timeZone:"UTC"}).format(d)}catch{return iso}}var HEALTH_PLAN_ORDERS_EMPTY=/* @__PURE__ */Object.freeze({loaded:false,orders:[],next:null,loading:false});function pushHealthPlanScreen(prev,screen){return[...prev.filter(x=>x.kind!==screen.kind),screen]}function healthPlanOverlayOf(sheet,started,top){return sheet!==null?sheet.kind:healthPlanUnderOf(started,top)}function healthPlanUnderOf(started,top){return started!==null?"started":top!==void 0?top.kind:null}function mergeHealthPlanOrders(recent,loaded){let seen=/* @__PURE__ */new Set;return[...recent,...loaded].filter(o=>seen.has(o.orderId)?false:(seen.add(o.orderId),true))}function addRecentHealthPlanOrders(prev,orders){return[...orders,...prev.filter(o=>!orders.some(x=>x.orderId===o.orderId))]}function appendHealthPlanOrderPage(prev,page){return{loaded:true,orders:[...prev.orders,...page.orders.filter(o=>!prev.orders.some(x=>x.orderId===o.orderId))],next:page.nextCursor,loading:false}}function healthPlanOrderNumber(key,everfurOrders,hostOrders){if(key===null)return null;let own=everfurOrders.find(o=>o.orderId===key);return own!==void 0?own.tracking?.orderNumber??null:hostOrders.find(o=>o.key===key)?.number??null}function editHealthPlanCartLine(prev,productId,f){return prev.flatMap(x=>x.productId!==productId?[x]:f(x)??[])}async function readHealthPlanOrders(repo,petRef,cursor){if(repo.listOneBoxOrderPage!==void 0)return repo.listOneBoxOrderPage(petRef,{limit:20,...cursor===null?{}:{cursor:cursor}});if(cursor!==null||repo.listOneBoxOrders===void 0)return{ok:true,value:{orders:[],nextCursor:null}};let res=await repo.listOneBoxOrders(petRef);return res.ok?{ok:true,value:{orders:res.value,nextCursor:null}}:res}function isHealthPlanInvalidCursor(error){if(error.httpStatus!==422)return false;let raw=error.raw!==null&&typeof error.raw=="object"?error.raw:null;return[error.reasonCode,error.wireMessage,raw?.detail,raw?.message].some(x=>x==="invalid_cursor")}var roundCents=n=>Math.round(n*100)/100;function useHealthPlanSubscriptionRepository(){let{runtime:runtime}=useEverfurContext();return react.useMemo(()=>createHealthPlanSubscriptionRepository(runtime),[runtime])}function useHealthPlanSubscription(options){let{userRef:userRef}=useEverfurContext(),own=useHealthPlanSubscriptionRepository(),repository=options.repository??own,enabled=options.enabled!==false&&userRef!==null&&options.petRef!==null&&options.productId!==null,{petRef:petRef,productId:productId}=options,[phase,setPhase]=react.useState("idle"),[quote,setQuote]=react.useState(null),[subscription,setSubscription]=react.useState(null),[busy,setBusy]=react.useState(false),[error,setError]=react.useState(null),[readyAt,setReadyAt]=react.useState(null),epoch=react.useRef(0),writes=react.useRef(0),quiet=react.useRef(0),busyRef=react.useRef(false),refreshAfterWrite=react.useRef(false),revalidateRef=react.useRef(()=>Promise.resolve()),load=react.useCallback(async()=>{let mine=++epoch.current;if(refreshAfterWrite.current=false,setReadyAt(null),!enabled||petRef===null||productId===null){setPhase("idle"),setQuote(null),setSubscription(null);return}setPhase("loading");let res=await repository.quote(petRef,productId);if(mine===epoch.current){if(!res.ok){setQuote(null),setSubscription(null),setError(res.error),setPhase(isHealthPlanSubscriptionUnavailable(res.error)?"unavailable":"failed");return}setError(null),setQuote(res.value),setSubscription(res.value.subscription),setPhase("ready"),setReadyAt(Date.now())}},[enabled,petRef,productId,repository]),ready=enabled&&phase==="ready",revalidate=react.useCallback(async()=>{if(!ready||busyRef.current||petRef===null||productId===null)return;let mine=epoch.current,wrote=writes.current,seq=++quiet.current,res=await repository.quote(petRef,productId);mine!==epoch.current||wrote!==writes.current||seq!==quiet.current||busyRef.current||!res.ok||(setQuote(res.value),setSubscription(res.value.subscription),setReadyAt(Date.now()))},[ready,petRef,productId,repository]);revalidateRef.current=revalidate;let refreshOnKey=()=>{if(!ready){load();return}if(busyRef.current){refreshAfterWrite.current=true;return}revalidate()};useHealthPlanRevalidation({lifecycle:options.lifecycle,refreshKey:options.refreshKey,readyAt:ready?readyAt:null,revalidate:()=>{revalidate()},refresh:refreshOnKey});let settleWrite=react.useCallback(()=>{refreshAfterWrite.current&&(refreshAfterWrite.current=false,revalidateRef.current())},[]);react.useEffect(()=>(load(),()=>{epoch.current+=1}),[load]);let write2=react.useCallback(async run3=>{let mine=epoch.current;writes.current+=1,busyRef.current=true,setBusy(true);let res=await run3();return busyRef.current=false,mine!==epoch.current?res:(setBusy(false),res.ok?(setError(null),setSubscription(res.value),settleWrite(),res):(setError(res.error),isHealthPlanSubscriptionUnavailable(res.error)?setPhase("unavailable"):settleWrite(),res))},[settleWrite]),buy=react.useCallback(async tapKey=>{let mine=epoch.current;writes.current+=1,busyRef.current=true,setBusy(true);let res=await repository.buyOneBox(petRef,productId,tapKey);return busyRef.current=false,mine!==epoch.current?res:(setBusy(false),res.ok?(setError(null),load(),res):(setError(res.error),isHealthPlanSubscriptionUnavailable(res.error)?setPhase("unavailable"):settleWrite(),res))},[repository,petRef,productId,load,settleWrite]);return react.useMemo(()=>{let p=petRef,sid=subscription?.subscriptionId??"",none=()=>Promise.resolve(err(makeEverfurError("validationFailed",{retryable:false,wireMessage:"the subscription quote is not ready"})));return{phase:phase,quote:quote,subscription:subscription,busy:busy,error:error,subscribe:n=>ready&&productId!==null?write2(()=>repository.create(p,productId,n)):none(),changeInterval:n=>ready&&sid!==""?write2(()=>repository.changeInterval(p,sid,n)):none(),skip:()=>ready&&sid!==""?write2(()=>repository.skip(p,sid)):none(),cancel:()=>ready&&sid!==""?write2(()=>repository.cancel(p,sid)):none(),restart:n=>ready&&sid!==""?write2(()=>repository.restart(p,sid,n)):none(),buyOneBox:k2=>ready&&productId!==null?buy(k2):none(),refresh:load}},[phase,quote,subscription,busy,error,ready,petRef,productId,repository,write2,buy,load])}var LB_PER_KG=2.20462262;function healthPlanWeightForSave(entered,inKg){return{weightKg:inKg?entered:Math.round(entered/LB_PER_KG*100)/100,pounds:inKg?Math.round(entered*LB_PER_KG*10)/10:entered}}var SIGNALS_SYMBOL=/* @__PURE__ */Symbol.for("@everfur/sdk#HealthPlanSignals@v1"),signalHost=globalThis;function isSignalState(value){if(typeof value!="object"||value===null)return false;let v=value;return v.landed instanceof Set&&v.noVet instanceof Set&&v.noVetByPet instanceof Map}var stored=signalHost[SIGNALS_SYMBOL],fresh=()=>({landed:/* @__PURE__ */new Set,noVet:/* @__PURE__ */new Set,noVetByPet:/* @__PURE__ */new Map}),state=isSignalState(stored)?stored:signalHost[SIGNALS_SYMBOL]=fresh(),landedListeners=state.landed,noVetListeners=state.noVet,noVetByPet=state.noVetByPet;function notifyHealthPlanRecordsLanded(petRef,source="host"){for(let listener of[...landedListeners])try{listener(petRef,source)}catch{}}function onHealthPlanRecordsLanded(listener){return landedListeners.add(listener),()=>{landedListeners.delete(listener)}}function setHealthPlanNoVet(petRef,noVet){if((noVetByPet.get(petRef)??false)!==noVet){noVet?noVetByPet.set(petRef,true):noVetByPet.delete(petRef);for(let listener of[...noVetListeners])try{listener(petRef,noVet)}catch{}}}function healthPlanNoVet(petRef){return noVetByPet.get(petRef)??false}function onHealthPlanNoVet(listener){return noVetListeners.add(listener),()=>{noVetListeners.delete(listener)}}function useHealthPlanBlanksLanding(options){let{petRef:petRef,noVet:noVetOverride,blanksFacts:blanksFacts,store:store,say:say,line:line}=options,[storeNoVet,setStoreNoVet]=react.useState(()=>healthPlanNoVet(petRef));react.useEffect(()=>(setStoreNoVet(healthPlanNoVet(petRef)),onHealthPlanNoVet((pet,none)=>{pet===petRef&&setStoreNoVet(none)})),[petRef]);let noVet=noVetOverride??storeNoVet,[flashKey,setFlashKey]=react.useState(null),hostSaid=react.useRef(false);react.useEffect(()=>(hostSaid.current=false,onHealthPlanRecordsLanded((pet,source)=>{pet===petRef&&source==="host"&&(hostSaid.current=true)})),[petRef]);let blanksPhase=blanksFacts?.phase??null,blanksId=blanksFacts?.requestId??null,landed=react.useRef({say:say,line:line});return landed.current={say:say,line:line},react.useEffect(()=>{if(blanksId===null)return;let live=true,run3=()=>{let memo=store.readBlanksMemo(petRef);if(blanksPhase==="wait"){memo.waited!==blanksId&&store.writeBlanksMemo(petRef,{...memo,waited:blanksId});return}!live||memo.flashed===blanksId||(store.writeBlanksMemo(petRef,{...memo,flashed:blanksId}),!(memo.waited!==blanksId&&!hostSaid.current)&&(hostSaid.current=false,setFlashKey(blanksId),landed.current.line!==""&&landed.current.say(landed.current.line),notifyHealthPlanRecordsLanded(petRef,"plan")))};return store.loadBlanksMemo===void 0?run3():store.loadBlanksMemo(petRef).then(run3),()=>{live=false}},[blanksPhase,blanksId,petRef,store]),{noVet:noVet,flashKey:flashKey}}function useHealthPlanOrdersList(options){let{shop:shop,ordersOpen:ordersOpen,subsRepo:subsRepo,petRef:petRef,everfurOrders:everfurOrders,setEverfurOrders:setEverfurOrders,say:say}=options,ordersLive=react.useRef(false),loadingMore=react.useRef(false),sayRef=react.useRef(say);return sayRef.current=say,react.useEffect(()=>{if(!shop||!ordersOpen)return;let live=true;return ordersLive.current=true,readHealthPlanOrders(subsRepo,petRef,null).then(res=>{live&&(res.ok?setEverfurOrders({loaded:true,orders:res.value.orders,next:res.value.nextCursor,loading:false}):(setEverfurOrders(prev=>({...prev,loaded:true,loading:false})),sayRef.current(res.error.displayMessage)))}),()=>{live=false,ordersLive.current=false}},[shop,ordersOpen,petRef,subsRepo]),{moreOrders:()=>{let cursor=everfurOrders.next;cursor===null||loadingMore.current||(loadingMore.current=true,setEverfurOrders(prev=>({...prev,loading:true})),readHealthPlanOrders(subsRepo,petRef,cursor).then(async res=>{let again=!res.ok&&isHealthPlanInvalidCursor(res.error)?await readHealthPlanOrders(subsRepo,petRef,null):null;if(loadingMore.current=false,!!ordersLive.current){if(again!==null){again.ok?setEverfurOrders({loaded:true,orders:again.value.orders,next:again.value.nextCursor,loading:false}):(setEverfurOrders(prev=>({...prev,next:null,loading:false})),sayRef.current(again.error.displayMessage));return}if(res.ok){let page=res.value;setEverfurOrders(prev=>appendHealthPlanOrderPage(prev,page))}else setEverfurOrders(prev=>({...prev,loading:false})),sayRef.current(res.error.displayMessage)}}))}}}var KG_MIN=.5,KG_MAX=90,LB_MIN=1,LB_MAX=200,TOAST_MS=2600,GLOBAL_CLOCK={setTimeout:(fn,ms)=>setTimeout(fn,ms),clearTimeout:handle=>clearTimeout(handle)};function useHealthPlanFocus(options,copy,ports,rules){let{design:design,item:item,petRef:petRef,petName:petName,locale:locale}=options,{store:store,callHost:callHost2}=ports,clock=ports.clock??GLOBAL_CLOCK,telemetry=useHealthPlanTelemetry(),{runtime:runtime}=useEverfurContext(),sub=useHealthPlanSubscription({petRef:petRef,productId:item.productId,enabled:options.subscriptions!==false&&design.pick.none!==true,...options.subscriptionRepository?{repository:options.subscriptionRepository}:{},...options.lifecycle!==void 0?{lifecycle:options.lifecycle}:{},...options.refreshKey!==void 0?{refreshKey:options.refreshKey}:{}}),[mode,setMode]=react.useState("sub"),[added,setAdded]=react.useState(false),[extras,setExtras]=react.useState(()=>/* @__PURE__ */new Set),[sheet,setSheet]=react.useState(null),[started,setStarted]=react.useState(null),tapKey=react.useRef(null),[toast,setToast]=react.useState(null),toastTimer=react.useRef(null),clockRef=react.useRef(clock);clockRef.current=clock,react.useEffect(()=>()=>{toastTimer.current!==null&&clockRef.current.clearTimeout(toastTimer.current)},[]);let withTracking=line=>[line,copy.trackingComesByText].filter(x=>x!=="").join(" "),say=line=>{rules.dropEmptyToast&&line===""||(setToast(line),toastTimer.current!==null&&clock.clearTimeout(toastTimer.current),toastTimer.current=clock.setTimeout(()=>setToast(null),TOAST_MS))},everfur=options.checkout==="everfur_stripe"&&rules.checkoutReachable,ownPages=useHealthPlanPageRepository(),pages=options.pageRepository??ownPages,checkoutTap=react.useRef(null),[redirecting,setRedirecting]=react.useState(false),shop=options.shop??everfur,[cart,setCartState]=react.useState(()=>shop?store.readCart(petRef):[]),cartRef=react.useRef(cart);react.useEffect(()=>{if(!shop||store.loadCart===void 0)return;let live=true;return store.loadCart(petRef).then(()=>{if(!live)return;let kept=store.readCart(petRef);cartRef.current.length===0&&kept.length>0&&(cartRef.current=kept,setCartState(kept))}),()=>{live=false}},[shop,store,petRef]);let setCart=react.useCallback(f=>{let next=f(cartRef.current);cartRef.current=next,store.writeCart(petRef,next),setCartState(next)},[petRef,store]),[screens,setScreens]=react.useState([]),ownSubs=useHealthPlanSubscriptionRepository(),subsRepo=options.subscriptionRepository??ownSubs,[everfurOrders,setEverfurOrders]=react.useState(HEALTH_PLAN_ORDERS_EMPTY),[cartOff,setCartOff]=react.useState(false),[weightSaved,setWeightSaved]=react.useState(false),[recent,setRecent]=react.useState([]),others=options.others??[],planItems=[item,...others],ownOrders=mergeHealthPlanOrders(recent,everfurOrders.orders),hostOrders=options.shopOrders??[],orderNumber=key=>healthPlanOrderNumber(key,ownOrders,hostOrders),push=react.useCallback(screen=>{setSheet(null),setScreens(prev=>pushHealthPlanScreen(prev,screen))},[]),top=screens.length>0?screens[screens.length-1]:void 0,overlay2=healthPlanOverlayOf(sheet,started,top),under=healthPlanUnderOf(started,top),closeOverlays=react.useCallback(()=>{setSheet(null),setStarted(null),setScreens([])},[]),back=react.useCallback(()=>{sheet!==null?setSheet(null):started!==null?setStarted(null):setScreens(prev=>prev.slice(0,-1))},[sheet,started]),title=(o=>{switch(o){case"started":return started?.kind==="once"?copy.placedHeader:copy.startedHeader;case"cart":return copy.cartTitle;case"placed":return copy.placedHeader;case"orders":return copy.orders;case"order":return copy.orderTitle(orderNumber(top?.kind==="order"?top.key:null));case"product":{let id=top?.kind==="product"?top.productId:null;return id===null?void 0:planItems.find(x=>x.productId===id)?.title}default:return}})(under),full=under==="started"||under==="cart"||under==="placed"||under==="product",onOverlayChange=options.onOverlayChange,callHostRef=react.useRef(callHost2);callHostRef.current=callHost2,react.useEffect(()=>{onOverlayChange!==void 0&&callHostRef.current(onOverlayChange,overlay2,{close:closeOverlays,back:back,...title===void 0?{}:{title:title},...full?{full:full}:{}})},[overlay2,onOverlayChange,closeOverlays,back,title,full]);let quote=sub.phase==="ready"?sub.quote:null,subscription=sub.subscription,active=subscription?.status==="active",pickPriced=(quote?.boxPrice??item.price)!==null,canSubscribe=quote!==null&&(!rules.subscribeNeedsPrice||pickPriced),offer=canSubscribe&"e.offerApplies&&subscription===null,every=active?subscription.intervalDays:canSubscribe?quote.defaultIntervalDays:0,fmt=(n,currency2)=>formatHealthPlanPriceWith(n,currency2,{dropZeroCents:false,...options.priceFormat,...locale?{locale:locale}:{}}),fmtWhole=(n,currency2)=>formatHealthPlanPriceWith(n,currency2,{dropZeroCents:true,...options.priceFormat,...locale?{locale:locale}:{}}),currency=quote?.currency??item.currency,boxPrice=quote?.boxPrice??item.price,oneBox=quote?.oneBox??null,prices=(days,productName=item.title)=>({petName:petName,productName:productName,first:fmt(offer&"e?quote.firstBoxPrice:boxPrice,currency),box:fmt(boxPrice,currency),once:fmt(oneBox?.price??boxPrice,currency),onceDiscountPercent:oneBox?.discountPercent??0,intervalDays:days,discountPercent:offer&"e?quote.firstBoxDiscountPercent:0,offer:offer}),pr=prices(every),priced=pr.box!==null,buyMode=canSubscribe?mode:"once",day=iso=>formatHealthPlanDay(iso,locale),nextBoxDay=s=>day(s.timeline.find(step=>step.step==="next_box_ships")?.on??s.nextBoxDate),buyOnce=(target=item)=>{options.onBuy?callHost2(options.onBuy,target):options.onCheckout&&callHost2(options.onCheckout,[target])},partnerBuys=options.onBuy!==void 0||options.onCheckout!==void 0,settle=res=>res.ok?(options.onSubscriptionChange&&callHost2(options.onSubscriptionChange,res.value),res.value):(say(res.error.displayMessage),null),redirect=async(purchase,intervalDays,target=item)=>{if(redirecting)return;let urls=ports.returnUrls();if(urls===null)return;let sig=`${target.productId}:${purchase}:${intervalDays??""}`;checkoutTap.current?.sig!==sig&&(checkoutTap.current={sig:sig,key:ports.mintKey()}),setRedirecting(true);let res=await pages.startCheckout(petRef,{productId:target.productId,purchase:purchase,...intervalDays===null?{}:{intervalDays:intervalDays},...urls},checkoutTap.current.key);if(setRedirecting(false),!res.ok){say(res.error.displayMessage);return}store.rememberCheckout(petRef,res.value.checkoutId),ports.openUrl(res.value.url)},itemOf2=productId=>planItems.find(x=>x.productId===productId),inCart=productId=>cart.find(x=>x.productId===productId),isPick=productId=>productId===item.productId,lineSub=x=>isPick(x.productId)&&canSubscribe&&!active&&x.mode==="sub",unitOf=x=>isPick(x.productId)?lineSub(x)?offer&"e?quote.firstBoxPrice:boxPrice:oneBox?.price??boxPrice:itemOf2(x.productId)?.price??null,lines=cart.filter(x=>itemOf2(x.productId)!==void 0),lineCount=lines.reduce((n,x)=>n+x.qty,0),cartTotal=roundCents(lines.reduce((n,x)=>n+(unitOf(x)??0)*x.qty,0)),subLine=lines.find(lineSub)??null,cartOn=everfur&&!cartOff&&pages.startCartCheckout!==void 0,hostLines=!everfur&&options.onCheckoutLines!==void 0,boxesOn=cartOn||hostLines,wasOf=(was,cur)=>{let m=/^[^\d]*(\d+(?:\.\d{1,2})?)[^\d]*$/.exec(was.replace(/,/g,""));return(m?fmt(Number(m[1]),cur??currency):null)??was},lineView=x=>{let it=itemOf2(x.productId)??item,subbed=lineSub(x),pick2=isPick(x.productId),ex=pick2||!rules.linesFromExtras?void 0:design.extras?.items.find(e=>e.productId===x.productId),lp=pick2?prices(x.every,it.title):{...prices(0,it.title),offer:false};return{key:x.productId,name:it.title,imageUrl:it.imageUrl??ex?.imageUrl??null,quantity:x.qty,subscription:subbed,price:fmt(unitOf(x),pick2?currency:it.currency),was:pick2?subbed?offer?lp.box:null:oneBox!==null&&boxPrice!==null&&oneBox.price<boxPrice?lp.box:null:ex?.was?wasOf(ex.was,it.currency):null,note:pick2?subbed?copy.cartSubLine(lp):copy.cartOnceLine(lp,active):null,...rules.linesFromExtras?{tag:ex?.tag??null}:{},modes:pick2&&canSubscribe&&!active?{label:copy.cartModeLabel(it.title),sub:{label:copy.cartModeSubscribe(lp),price:lp.first},once:{label:copy.cartModeOnce(lp),price:lp.once}}:null,every:subbed&"e!==null?{options:quote.intervalOptions,selected:x.every}:null,maxQuantity:boxesOn&&!subbed?5:1,lp:lp}},views=lines.map(lineView),renewPrices=subLine===null?null:prices(subLine.every),addToCart=(target,m,qty=1,quiet=false)=>{if(inCart(target.productId)){push({kind:"cart"});return}let subbing=isPick(target.productId)&&canSubscribe&&!active&&m==="sub",boxes=subbing?1:Math.max(1,Math.min(boxesOn?5:1,qty));setCart(prev=>[...prev,{productId:target.productId,mode:subbing?"sub":"once",every:quote?.defaultIntervalDays??0,qty:boxes}]),quiet||say(copy.addedToCart(isPick(target.productId)?pr:{...prices(0,target.title),offer:false},subbing))},showCart=()=>setScreens(prev=>{let at=prev.findIndex(x=>x.kind==="cart");return at>=0?prev.slice(0,at+1):[...prev,{kind:"cart"}]}),editLine=(productId,f)=>setCart(prev=>editHealthPlanCartLine(prev,productId,f)),stepQuantity=(productId,by)=>editLine(productId,x=>({...x,qty:Math.max(1,Math.min(boxesOn&&!lineSub(x)?5:1,x.qty+by))})),removeLine=productId=>{editLine(productId,()=>null),say(copy.removedFromCart(itemOf2(productId)?.title??""))},apart=cartOn&&subLine!==null&&lines.length>1,batch=apart?lines.filter(x=>!lineSub(x)):lines,batchTotal=roundCents(batch.reduce((n,x)=>n+(unitOf(x)??0)*x.qty,0)),batchSub=batch.find(lineSub)??null,batchRenew=batchSub===null?null:prices(batchSub.every),cartReady=lines.length>0&&lines.every(x=>unitOf(x)!==null)&&(lines.length===1&&(lines[0]?.qty??0)===1?true:cartOn?batch.length>0&&batch.length<=10:!everfur&&(options.onCheckout!==void 0||hostLines)&&lines.every(x=>!lineSub(x))),redirectCart=async batchLines=>{if(redirecting||pages.startCartCheckout===void 0)return;let urls=ports.returnUrls();if(urls===null)return;let sig=`cart:${batchLines.map(x=>`${x.productId}:${x.qty}:${lineSub(x)?x.every:""}`).join("|")}`;checkoutTap.current?.sig!==sig&&(checkoutTap.current={sig:sig,key:ports.mintKey()}),setRedirecting(true);let res=await pages.startCartCheckout(petRef,{items:batchLines.map(x=>{let subbing=lineSub(x);return{productId:x.productId,purchase:subbing?"subscription":"one_box",...subbing?{intervalDays:x.every}:{},quantity:subbing?1:x.qty}}),...urls},checkoutTap.current.key);if(setRedirecting(false),!res.ok){let why=healthPlanCheckoutRefusal(res.error);if(why==="cart_disabled"){setCartOff(true),setSheet(null),say(copy.cartOneAtATime===""?res.error.displayMessage:copy.cartOneAtATime);return}if(why==="cart_has_subscription"){setSheet(null),say(copy.cartSubscriptionApart===""?res.error.displayMessage:copy.cartSubscriptionApart);return}say(res.error.displayMessage);return}store.rememberCheckout(petRef,res.value.checkoutId),ports.openUrl(res.value.url)},orderOneBox=async()=>{tapKey.current===null&&(tapKey.current=ports.mintKey());let res=await sub.buyOneBox(tapKey.current);return res.ok?(tapKey.current=null,options.onOneBoxOrder&&callHost2(options.onOneBoxOrder,res.value),res.value):(say(res.error.displayMessage),null)},placeCart=async()=>{if(!cartReady)return;if(everfur&&cartOn&&!(batch.length===1&&(batch[0]?.qty??0)===1)){batch.map(x=>itemOf2(x.productId)).filter(x=>x!==void 0);trackCheckoutStarted(telemetry,petRef,{count:batch.reduce((n,x)=>n+x.qty,0),subtotal:batchTotal,currency:currency}),await redirectCart(batch);return}if(hostLines&&!(lines.length===1&&(lines[0]?.qty??0)===1)){let handed=lines.flatMap(x=>{let it=itemOf2(x.productId);return it===void 0?[]:[{item:it,quantity:x.qty}]});trackCheckoutStarted(telemetry,petRef,{items:handed.map(x=>x.item),count:handed.reduce((n,x)=>n+x.quantity,0),subtotal:cartTotal,currency:currency}),bought(lines.map(x=>x.productId)),setSheet(null),setScreens([]),options.onCheckoutLines&&callHost2(options.onCheckoutLines,handed);return}let only=batch.length===1?batch[0]:lines.length===1?lines[0]:void 0;if(only===void 0){options.onCheckout&&callHost2(options.onCheckout,lines.map(x=>itemOf2(x.productId)).filter(x=>x!==void 0));return}let target=itemOf2(only.productId)??item,subbing=lineSub(only);if(trackCheckoutStarted(telemetry,petRef,{count:1,subtotal:unitOf(only),currency:isPick(only.productId)?currency:target.currency}),everfur){await redirect(subbing?"subscription":"one_box",subbing?only.every:null,target);return}if(subbing){let s=settle(await sub.subscribe(only.every));if(s===null)return;bought([s.productId]),setSheet(null),setScreens([]),setStarted({kind:"sub",sub:s});return}if(!isPick(only.productId)||oneBox===null){setSheet(null),hostLines&&(bought([only.productId]),setScreens([])),buyOnce(target);return}let o=await orderOneBox();o!==null&&(bought([o.productId]),placed([o]))},press=()=>{if(trackCheckoutStarted(telemetry,petRef,{count:1,subtotal:item.price,currency:item.price===null?null:item.currency}),!canSubscribe){everfur?redirect("one_box",null):buyOnce();return}tapKey.current=null,setSheet({kind:"checkout",mode:buyMode,every:quote.defaultIntervalDays})},pressOther=target=>{trackCheckoutStarted(telemetry,petRef,{count:1,subtotal:target.price,currency:target.price===null?null:target.currency}),everfur?redirect("one_box",null,target):buyOnce(target)},confirmCheckout=async()=>{if(sheet?.kind!=="checkout")return;let isSub=sheet.mode==="sub";if(everfur){await redirect(isSub?"subscription":"one_box",isSub?sheet.every:null);return}if(!isSub){if(oneBox===null){setSheet(null),buyOnce();return}let o=await orderOneBox();if(o===null)return;setSheet(null),placed([o]);return}let s=settle(await sub.subscribe(sheet.every));s!==null&&(setSheet(null),setStarted({kind:"sub",sub:s}))},changeInterval=d=>{subscription===null||d===subscription.intervalDays||sub.changeInterval(d).then(settle)},skip=async()=>{let s=settle(await sub.skip());s!==null&&say(copy.skipped(prices(s.intervalDays),nextBoxDay(s)))},cancel=async()=>{let mp=prices(subscription?.intervalDays??every);settle(await sub.cancel())!==null&&(setSheet(null),setMode("sub"),say(copy.cancelled(mp)))},seeOrdersFromManage=()=>{setSheet(null),top?.kind!=="orders"&&push({kind:"orders"})},toggleAdded=questions=>{let next=!added;setAdded(next),options.onAddToVisit&&callHost2(options.onAddToVisit,next,questions)},toggleExtra=(key,on)=>{let next=!on;setExtras(prev=>{let out=new Set(prev);return next?out.add(key):out.delete(key),out}),options.onExtra&&callHost2(options.onExtra,key,next)},pressExtra=(key,product,on)=>{if(product!==void 0){shop?addToCart(product,"once"):pressOther(product);return}toggleExtra(key,on)},ordersOpen=screens.some(x=>x.kind==="orders"||x.kind==="order"),{moreOrders:moreOrders}=useHealthPlanOrdersList({shop:shop,ordersOpen:ordersOpen,subsRepo:subsRepo,petRef:petRef,everfurOrders:everfurOrders,setEverfurOrders:setEverfurOrders,say:say}),weightKnown=options.weightKnown!==false||weightSaved,kg=options.weightUnit==="kg",[weightInput,setWeightInput]=react.useState(""),[weightError,setWeightError]=react.useState(""),[savingWeight,setSavingWeight]=react.useState(false),openWeight=()=>{setWeightError(""),setSheet({kind:"weight"})},saveWeight=async()=>{let n=Math.round(Number.parseFloat(weightInput.replace(",","."))*10)/10;if(!(kg?n>=KG_MIN&&n<=KG_MAX:n>=LB_MIN&&n<=LB_MAX)){setWeightError(kg?copy.weightErrorKg:copy.weightError);return}let{weightKg:weightKg,pounds:lb}=healthPlanWeightForSave(n,kg);setSavingWeight(true);let res=options.onSaveWeight?await options.onSaveWeight(weightKg,lb):await runtime.updatePet(petRef,{weightKg:weightKg});if(setSavingWeight(false),!res.ok){setWeightError(res.error.displayMessage);return}setWeightError(""),setWeightSaved(true),setSheet(null),say(kg?copy.weightSavedKg(String(n)):copy.weightSaved(String(lb))),options.onWeightSaved&&callHost2(options.onWeightSaved,weightKg)},{noVet:noVet,flashKey:flashKey}=useHealthPlanBlanksLanding({petRef:petRef,noVet:options.noVet,blanksFacts:options.blanksFacts,store:store,say:say,line:copy.recordsLanded}),placed=orders=>{let first=orders[0];if(first!==void 0){if(!shop){setStarted({kind:"once",order:first});return}setRecent(prev=>addRecentHealthPlanOrders(prev,orders)),setSheet(null),setScreens([{kind:"placed",orders:orders}])}},bought=productIds=>{let gone=new Set(productIds.filter(x=>x!==null));gone.size>0&&setCart(prev=>prev.filter(x=>!gone.has(x.productId)))};return{sub:sub,copy:copy,everfur:everfur,shop:shop,partnerBuys:partnerBuys,redirecting:redirecting,pages:pages,quote:quote,subscription:subscription,active:active,canSubscribe:canSubscribe,offer:offer,every:every,currency:currency,boxPrice:boxPrice,oneBox:oneBox,pr:pr,priced:priced,mode:mode,buyMode:buyMode,fmt:fmt,fmtWhole:fmtWhole,prices:prices,day:day,nextBoxDay:nextBoxDay,withTracking:withTracking,sheet:sheet,started:started,screens:screens,top:top,overlay:overlay2,under:under,title:title,full:full,toast:toast,added:added,extras:extras,planItems:planItems,cart:cart,lines:lines,lineCount:lineCount,cartTotal:cartTotal,subLine:subLine,cartOn:cartOn,hostLines:hostLines,boxesOn:boxesOn,wasOf:wasOf,views:views,renewPrices:renewPrices,apart:apart,batch:batch,batchTotal:batchTotal,batchSub:batchSub,batchRenew:batchRenew,cartReady:cartReady,itemOf:itemOf2,inCart:inCart,isPick:isPick,lineSub:lineSub,unitOf:unitOf,lineView:lineView,everfurOrders:everfurOrders,ownOrders:ownOrders,orderNumber:orderNumber,weightKnown:weightKnown,kg:kg,weightInput:weightInput,weightError:weightError,savingWeight:savingWeight,noVet:noVet,flashKey:flashKey,say:say,setMode:setMode,openSheet:setSheet,closeSheet:()=>setSheet(null),push:push,replaceScreens:setScreens,closeStarted:()=>setStarted(null),closeOverlays:closeOverlays,back:back,toggleAdded:toggleAdded,toggleExtra:toggleExtra,pressExtra:pressExtra,buyOnce:buyOnce,press:press,pressOther:pressOther,confirmCheckout:confirmCheckout,changeInterval:changeInterval,skip:skip,cancel:cancel,seeOrdersFromManage:seeOrdersFromManage,addToCart:addToCart,showCart:showCart,editLine:editLine,stepQuantity:stepQuantity,removeLine:removeLine,placeCart:placeCart,moreOrders:moreOrders,openWeight:openWeight,setWeightInput:setWeightInput,saveWeight:saveWeight,returnHandlers:{onPaid:state2=>{let run3=state2.subscription,orders=state2.orders??(state2.order===null?[]:[state2.order]);if(run3!==null)options.onSubscriptionChange&&callHost2(options.onSubscriptionChange,run3),rules.closeOnReturn&&(setSheet(null),setScreens([])),setStarted({kind:"sub",sub:run3});else if(orders.length>0){for(let o of orders)options.onOneBoxOrder&&callHost2(options.onOneBoxOrder,o);placed(orders)}bought([run3?.productId??null,...orders.map(o=>o.productId)]),sub.refresh()},onFailed:()=>{setSheet(null),shop&&(rules.closeOnReturn&&setStarted(null),setScreens([{kind:"cart"}])),copy.checkoutFailed!==""&&say(copy.checkoutFailed)},onCancel:()=>setRedirecting(false),onTimeout:()=>{shop&&(setSheet(null),rules.closeOnReturn&&setStarted(null),setScreens([{kind:"orders"}]))},onError:error=>say(error.displayMessage)}}}function useHealthPlanRecordsEmpty(reader,petRef){let[empty,setEmpty]=react.useState(null);return react.useEffect(()=>{if(reader===void 0)return;let live=true;return reader.getRecord(petRef).then(res=>{live&&setEmpty(res.ok?res.value.withheld!==true&&res.value.is_empty===true:null)}).catch(()=>{}),()=>{live=false}},[reader,petRef]),empty}var CLOSE_FALLBACK="Close",HEALTH_PLAN_TOP_CARD_COPY=/* @__PURE__ */Object.freeze({action:who=>who.possessive===null?null:`See ${who.possessive} Health Plan`,ask:"What does it mean?",askPrompt:(focus,ask)=>focus.risk?.lead?`${focus.risk.lead} ${ask}`:`${focus.title}: ${ask}`,close:who=>who.possessive===null?null:`Close ${who.possessive} focus`,resultsKicker:who=>who.possessive===null?null:`${capital(who.possessive)} results`,resultsClose:who=>who.possessive===null?null:`Close ${who.possessive} results`,resultsTopRisk:"Top risk"});function capital(word){return word.charAt(0).toUpperCase()+word.slice(1)}function healthPlanPossessive(pet){let sex=typeof pet.sex=="string"?pet.sex.trim().toLowerCase():null;if(sex==="female")return"her";if(sex==="male")return"his";let name=typeof pet.name=="string"?pet.name.trim():"";return name!==""?`${name}'s`:null}function healthPlanTopCard(page,options={}){let focus=page?.page?.focus;if(page===null||focus===void 0||focus.title.trim()===""||focus.kicker.trim()==="")return;let copy={...HEALTH_PLAN_TOP_CARD_COPY,...options.copy},who={pet:page.pet,possessive:healthPlanPossessive(page.pet)},badge=focus.sources?.find(source=>source.label.trim()!=="")?.label,onOpenPlan=options.onOpenPlan,action=onOpenPlan===void 0?null:copy.action(who),close=copy.close(who),ask=copy.ask.trim(),results=options.results!==void 0&&focus.report!==void 0?options.results:void 0;if(results!==void 0){let kicker=copy.resultsKicker(who)?.trim()||focus.kicker,shut=copy.resultsClose(who),onTop=results.onTopRisk??onOpenPlan,top={key:"top-risk",label:copy.resultsTopRisk,title:focus.title,...focus.risk?.lead?{line:focus.risk.lead}:{},tone:"risk",...onTop===void 0?{}:{onPress:onTop}};return{kicker:kicker,...badge===void 0?{}:{badge:badge},title:focus.title,results:[top,...results.rows??[]],...action===null||action.trim()===""||onOpenPlan===void 0?{}:{action:{label:action,onPress:onOpenPlan}},...ask===""?{}:{ask:{label:ask,prompt:copy.askPrompt(focus,ask)}},closeLabel:shut===null||shut.trim()===""?CLOSE_FALLBACK:shut,pill:kicker,...options.renderIcon===void 0?{}:{renderIcon:options.renderIcon}}}return{kicker:focus.kicker,...badge===void 0?{}:{badge:badge},title:focus.title,...focus.risk?.lead?{lead:focus.risk.lead}:{},...focus.risk?.body?{body:focus.risk.body}:{},...action===null||action.trim()===""||onOpenPlan===void 0?{}:{action:{label:action,onPress:onOpenPlan}},...ask===""?{}:{ask:{label:ask,prompt:copy.askPrompt(focus,ask)}},closeLabel:close===null||close.trim()===""?CLOSE_FALLBACK:close,pill:focus.kicker,...options.renderIcon===void 0?{}:{renderIcon:options.renderIcon}}}var HEALTH_PLAN_FOCUS_RN_COPY=/* @__PURE__ */Object.freeze({...HEALTH_PLAN_FOCUS_COPY,firstBoxShips:"Her first box ships.",placedShips:"It ships.",trackingComesByText:"",trackingByText:"",moreOrders:"Load more",checkoutFailed:"That didn't go through. Please try again.",back:"Back"}),cap=s=>s===""?s:`${s.charAt(0).toUpperCase()}${s.slice(1)}`;function healthPlanPetCopy(pet){let name=pet.name?.trim()??"",her=healthPlanPossessive(pet)??"your pet's",Her=cap(her),them=pet.sex==="female"?"her":pet.sex==="male"?"him":name!==""?name:"your pet",base3=HEALTH_PLAN_FOCUS_COPY,r5=healthPlanFocusCopyFor({name:pet.name,sex:pet.sex});return{jumpKicker:(p,subscribed)=>subscribed?`In ${her} plan, every ${p.intervalDays} days`:p.offer?`${p.discountPercent}% off ${her} first box`:base3.jumpKicker(p,false),firstBoxShips:pet.trackingTexts===true?`${Her} first box ships. Tracking comes by text.`:`${Her} first box ships.`,placedShips:base3.placedShips,trackingComesByText:pet.trackingTexts===true?base3.trackingComesByText:"",trackingByText:pet.trackingTexts===true?base3.trackingByText:"",refill:`A text 3 days before ${her} next box. Reply SKIP to skip it.`,nextBoxShips:p=>`${Her} next box ships, ${p.box??""}.`,startedDone:`Back to ${her} plan`,skipped:(_p,next)=>next===null?"Skipped.":`Skipped. ${Her} next box ships ${next}.`,cancelled:p=>`${p.productName} is cancelled. Restart it from ${her} plan anytime.`,seeOrders:`See ${her} orders`,cartOnceLine:(p,subscribed)=>subscribed?`An extra box. ${Her} plan keeps shipping.`:base3.cartOnceLine(p,false),herSubscription:`${Her} subscription`,ordersHeading:afterSubscription=>afterSubscription?"Orders":`${Her} orders`,addWeightTitle:`Add ${her} weight to size ${her} dose`,addWeightBody:`From a home scale or ${her} last vet visit.`,connectRecordsTitle:`Connect ${her} vet records`,connectRecordsBody:`${Her} weight, visits and labs make ${her} plan sharper.`,weightKicker:`${Her} weight`,weightBody:`From a home scale or ${her} last vet visit. ${Her} plan uses it to size ${her} dose.`,weightField:`${Her} weight`,weightError:`Enter ${her} weight in pounds, like 14.1.`,weightSave:`Save ${her} weight`,weightSaved:lb=>`Saved: ${lb} lb. ${Her} dose is sized for ${them}.`,weightErrorKg:r5.weightErrorKg,weightSavedKg:r5.weightSavedKg,signalsFit:r5.signalsFit,noPick:r5.noPick,saveForCheckup:r5.saveForCheckup,savedForCheckup:r5.savedForCheckup,blanksLabel:r5.blanksLabel,blanksFilledKicker:r5.blanksFilledKicker,blanksWeight:r5.blanksWeight,blanksWeightSource:r5.blanksWeightSource,blanksDoseSource:r5.blanksDoseSource,blanksShots:r5.blanksShots,blanksShotsSource:r5.blanksShotsSource,recordsLanded:r5.recordsLanded}}var BLANKS_MEMO_KV_PREFIX="everfur.healthPlan.blanks",NONE=/* @__PURE__ */Object.freeze({waited:null,flashed:null}),memos=/* @__PURE__ */new Map,loads=/* @__PURE__ */new Map,keyOf2=petRef=>`${BLANKS_MEMO_KV_PREFIX}:${petRef}`;function parse(raw){if(raw===null)return NONE;try{let o=JSON.parse(raw);if(o===null||typeof o!="object")return NONE;let r=o;return{waited:typeof r.waited=="string"?r.waited:null,flashed:typeof r.flashed=="string"?r.flashed:null}}catch{return NONE}}function loadBlanksMemo(kv,petRef){let own=memos.get(petRef);if(own!==void 0)return Promise.resolve(own);let load=loads.get(petRef);return load===void 0&&(load=(async()=>{let read=NONE;try{read=kv?parse(await kv.getItem(keyOf2(petRef))):NONE}catch{}let memo=memos.get(petRef)??read;return memos.set(petRef,memo),memo})(),loads.set(petRef,load)),load}function blanksMemo(petRef){return memos.get(petRef)??NONE}function setBlanksMemo(kv,petRef,memo){if(memos.set(petRef,memo),!!kv)try{kv.setItem(keyOf2(petRef),JSON.stringify(memo)).catch(()=>{})}catch{}}var CHECKOUT_PARAM="everfur_checkout",CHECKOUT_CANCEL_PARAM="everfur_checkout_cancel",STRIPE_SESSION_ID="{CHECKOUT_SESSION_ID}",CHECKOUT_POLL_MS=2e3,CHECKOUT_POLL_TRIES=30;function validReturnUrl(url){return typeof url!="string"?false:/^https:\/\/[^/?#\s]+[^\s]*$/i.test(url.trim())}var PARAM_RE=new RegExp(`([?&])(?:${CHECKOUT_PARAM}|${CHECKOUT_CANCEL_PARAM})=[^&#]*&?`,"g");function checkoutReturnUrl(base3,name,value){let hashAt=base3.indexOf("#"),hash=hashAt===-1?"":base3.slice(hashAt),head=hashAt===-1?base3:base3.slice(0,hashAt);head=head.replace(PARAM_RE,"$1").replace(/[?&]$/,"");let sep=head.includes("?")?"&":"?";return`${head}${sep}${name}=${value}${hash}`}function readCheckoutReturn(url,base3){let strip=u=>u.split(/[?#]/)[0]?.replace(/\/+$/,"").toLowerCase()??"";if(strip(url)!==strip(base3))return null;let query=url.split("#")[0]?.split("?")[1]??"",params=/* @__PURE__ */new Map;for(let pair of query.split("&")){if(pair==="")continue;let at=pair.indexOf("="),key=at===-1?pair:pair.slice(0,at),value=at===-1?"":pair.slice(at+1);try{value=decodeURIComponent(value)}catch{}params.set(key,value)}if(params.has(CHECKOUT_CANCEL_PARAM))return{kind:"cancel"};let id=params.get(CHECKOUT_PARAM);return id===void 0?null:{kind:"return",sessionId:id===""||id===STRIPE_SESSION_ID?null:id}}function mintTapKey(){let c=globalThis.crypto;return c?.randomUUID?c.randomUUID():`tap-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,12)}`}var SHOP_CART_KV_PREFIX="everfur.healthPlan.cart",SHOP_CHECKOUT_KV_PREFIX="everfur.healthPlan.checkout",checkouts=/* @__PURE__ */new Map,carts=/* @__PURE__ */new Map,checkoutTouched=/* @__PURE__ */new Set,cartTouched=/* @__PURE__ */new Set,loads2=/* @__PURE__ */new WeakMap,DONE=Promise.resolve();function parseCart(raw){if(raw===null)return[];try{let o=JSON.parse(raw);return Array.isArray(o)?o.flatMap(x=>{if(x===null||typeof x!="object")return[];let r=x,productId=r.productId,mode=r.mode,every=r.every,qty=r.qty;return typeof productId!="string"||mode!=="sub"&&mode!=="once"||typeof every!="number"||typeof qty!="number"?[]:[{productId:productId,mode:mode,every:every,qty:Math.max(1,Math.min(mode==="sub"?1:5,Math.round(qty)))}]}):[]}catch{return[]}}function write(kv,key,value){if(kv)try{(value===null?kv.removeItem(key):kv.setItem(key,value)).catch(()=>{})}catch{}}function loadShopMemory(kv,petRef){if(!kv)return DONE;let perPet=loads2.get(kv);perPet===void 0&&(perPet=/* @__PURE__ */new Map,loads2.set(kv,perPet));let load=perPet.get(petRef);return load===void 0&&(load=(async()=>{let cart=[],checkout=null;try{let[rawCart,rawCheckout]=await Promise.all([kv.getItem(`${SHOP_CART_KV_PREFIX}:${petRef}`),kv.getItem(`${SHOP_CHECKOUT_KV_PREFIX}:${petRef}`)]);cart=parseCart(rawCart),checkout=typeof rawCheckout=="string"&&rawCheckout!==""?rawCheckout:null}catch{}!cartTouched.has(petRef)&&cart.length>0&&carts.set(petRef,cart),!checkoutTouched.has(petRef)&&checkout!==null&&checkouts.set(petRef,checkout)})(),perPet.set(petRef,load)),load}function rememberCheckout(petRef,checkoutId,kv){checkoutTouched.add(petRef),checkouts.set(petRef,checkoutId),write(kv,`${SHOP_CHECKOUT_KV_PREFIX}:${petRef}`,checkoutId)}function recallCheckout(petRef){return checkouts.get(petRef)??null}function forgetCheckout(petRef,kv){checkoutTouched.add(petRef),checkouts.delete(petRef),write(kv,`${SHOP_CHECKOUT_KV_PREFIX}:${petRef}`,null)}function readCart(petRef){return carts.get(petRef)??[]}function writeCart(petRef,lines,kv){cartTouched.add(petRef),lines.length===0?carts.delete(petRef):carts.set(petRef,lines),write(kv,`${SHOP_CART_KV_PREFIX}:${petRef}`,lines.length===0?null:JSON.stringify(lines))}function rnFocusStore(kv){return{readCart:readCart,writeCart:(petRef,lines)=>writeCart(petRef,lines,kv),loadCart:petRef=>loadShopMemory(kv,petRef),rememberCheckout:(petRef,checkoutId)=>rememberCheckout(petRef,checkoutId,kv),readBlanksMemo:blanksMemo,writeBlanksMemo:(petRef,memo)=>setBlanksMemo(kv,petRef,memo),loadBlanksMemo:petRef=>loadBlanksMemo(kv,petRef)}}var RN_RULES_BASE=/* @__PURE__ */Object.freeze({dropEmptyToast:true,subscribeNeedsPrice:false,closeOnReturn:true,linesFromExtras:false});var WAITING=/* @__PURE__ */new Set(["requested","awaiting_clinic","awaiting_upload","received","parsing","in_review"]),VACCINE=/vaccin|rabies|dhpp|booster|bordetella|lepto|lyme|parvo|distemper/i,LB_PER_KG2=2.20462262;function dayMs(value){if(value==null||value.length===0)return null;let ms=Date.parse(/^\d{4}-\d{2}-\d{2}$/.test(value)?`${value}T00:00:00Z`:value);return Number.isNaN(ms)?null:ms}function kilograms(value,unit){return value===null||!Number.isFinite(value)||value<=0||unit===null?null:/^\s*kg|kilo/i.test(unit)?value:/^\s*(lb|lbs|pound)/i.test(unit)?value/LB_PER_KG2:null}function healthPlanRecordsWeightKg(record){if(record===null||record.isEmpty||record.withheld)return null;let readings=[];for(let series of record.entitySeries)if(series.key.startsWith("body_weight"))for(let point of series.points){if(point.origin==="owner_reported")continue;let at=dayMs(point.at),unit=point.display?.replace(/^[\d.,\s]+/,"")??null,kg=kilograms(point.value,unit);at!==null&&kg!==null&&readings.push({at:at,kg:kg})}for(let entity of record.entities){if(entity.category!=="body_weight"||entity.origin==="owner_reported")continue;let at=dayMs(entity.observedAt),kg=kilograms(entity.value===null?null:Number.parseFloat(entity.value),entity.unit);at!==null&&kg!==null&&readings.push({at:at,kg:kg})}return readings.length===0?null:(readings.sort((a,b)=>b.at-a.at),readings[0]?.kg??null)}function healthPlanNextShotsAt(record,today){if(record===null||record.isEmpty||record.withheld)return null;let next=null;for(let item of record.forwardLooking){if(!VACCINE.test(item.title))continue;let due=dayMs(item.dueAt);due===null||due<today||(next===null||due<next)&&(next=due)}return next}function latestClinicRequest(requests){return requests.filter(r=>r.source==="clinic_request").slice().sort((a,b)=>(dayMs(b.createdAt)??0)-(dayMs(a.createdAt)??0))[0]}function healthPlanRecordsHoldNoBlanks(input,now){let asked=latestClinicRequest(input.requests);if(asked===void 0||asked.status!=="published"||input.record===null||input.record.withheld)return false;let today=Math.floor(now/864e5)*864e5;return healthPlanRecordsWeightKg(input.record)===null&&healthPlanNextShotsAt(input.record,today)===null}function healthPlanBlanksFacts(input,now){let asked=latestClinicRequest(input.requests);if(asked===void 0)return null;let clinicName=asked.clinicName?.trim()?asked.clinicName.trim():null;if(WAITING.has(asked.status))return{phase:"wait",requestId:String(asked.id),clinicName:clinicName,weightKg:null,nextShotsAt:null};if(asked.status!=="published"||input.record===null||input.record.isEmpty||input.record.withheld)return null;let today=Math.floor(now/864e5)*864e5,weightKg=healthPlanRecordsWeightKg(input.record),nextShotsAt=healthPlanNextShotsAt(input.record,today);return weightKg===null&&nextShotsAt===null?null:{phase:"filled",requestId:String(asked.id),clinicName:clinicName,weightKg:weightKg,nextShotsAt:nextShotsAt}}var COARSE_NOW_TICK_MS=3600*1e3;function useCoarseNow(fixed,shown=true){let[now,setNow]=react.useState(()=>Date.now()),first=react.useRef(true);return react.useEffect(()=>{if(first.current){first.current=false;return}shown&&setNow(Date.now())},[fixed,shown]),react.useEffect(()=>{if(!shown)return;let tick=setInterval(()=>setNow(Date.now()),COARSE_NOW_TICK_MS),onVisible=()=>{document.visibilityState==="visible"&&setNow(Date.now())},doc2=typeof document<"u"&&typeof document.addEventListener=="function"?document:null;return doc2?.addEventListener("visibilitychange",onVisible),()=>{clearInterval(tick),doc2?.removeEventListener("visibilitychange",onVisible)}},[fixed,shown]),now}function RecordsProbe(props){let{status:status,requests:requests,record:record,refresh:refresh}=records.useEverfurRecords({petRef:props.petRef}),{onRead:onRead,petRef:petRef}=props,now=useCoarseNow(),blanks=react.useMemo(()=>healthPlanBlanksFacts({requests:requests,record:record},now),[requests,record,now]),heldNone=react.useMemo(()=>healthPlanRecordsHoldNoBlanks({requests:requests,record:record},now),[requests,record,now]);react.useEffect(()=>{onRead({missing:status==="empty"||heldNone,blanks:blanks})},[status,heldNone,blanks,onRead]);let reread=react.useRef(refresh);return reread.current=refresh,react.useEffect(()=>onHealthPlanRecordsLanded((pet,source)=>{pet===petRef&&source==="host"&&reread.current()}),[petRef]),null}var initialRead=/* @__PURE__ */new Set;function useCheckoutReturn(options){let{enabled:enabled,petRef:petRef,pages:pages,returnUrl:returnUrl,lifecycle:lifecycle,kv:kv}=options,handlers=react.useRef(options);handlers.current=options,react.useEffect(()=>{if(!enabled||returnUrl===null)return;let live=true,polling=false,run3=0,timer=null,poll=async(checkoutId,tries,mine)=>{let res=await pages.getCheckout(petRef,checkoutId);if(!(!live||mine!==run3)){if(res.ok&&res.value.status==="paid"){polling=false,forgetCheckout(petRef,kv),handlers.current.onPaid(res.value);return}if(res.ok&&(res.value.status==="failed"||res.value.status==="expired")){polling=false,forgetCheckout(petRef,kv),handlers.current.onFailed();return}if(!res.ok&&!res.error.retryable){polling=false,forgetCheckout(petRef,kv),handlers.current.onError(res.error);return}if(tries<=1){polling=false,forgetCheckout(petRef,kv),handlers.current.onTimeout();return}timer=setTimeout(()=>{poll(checkoutId,tries-1,mine)},CHECKOUT_POLL_MS)}},start=checkoutId=>{polling||(polling=true,poll(checkoutId,CHECKOUT_POLL_TRIES,run3))},loaded=loadShopMemory(kv,petRef),onUrl=url=>{let back=readCheckoutReturn(url,returnUrl);if(back!==null){if(back.kind==="cancel"){run3+=1,polling=false,timer!==null&&clearTimeout(timer),timer=null,forgetCheckout(petRef,kv),handlers.current.onCancel();return}loaded.then(()=>{if(!live)return;let id=recallCheckout(petRef)??back.sessionId;id!==null&&start(id)})}},resume=()=>{loaded.then(()=>{if(!live)return;let id=recallCheckout(petRef);id!==null&&start(id)})},sub=reactNative.Linking.addEventListener("url",event=>onUrl(event.url));reactNative.Linking.getInitialURL().then(url=>{!live||url===null||url===void 0||initialRead.has(url)||readCheckoutReturn(url,returnUrl)!==null&&(initialRead.add(url),onUrl(url))}).catch(()=>{}).then(resume);let offForeground;if(lifecycle)offForeground=lifecycle.onForeground(resume);else{let app=reactNative.AppState.addEventListener("change",next=>{next==="active"&&resume()});offForeground=()=>app.remove()}return()=>{live=false,timer!==null&&clearTimeout(timer),sub.remove(),offForeground()}},[enabled,petRef,pages,returnUrl,lifecycle,kv])}var BOX2=24,FINE2=16,SEAM2=.8,fine2=dp=>Math.round(dp*FINE2);function place2(cx,cy,W,H,ux,uy){let left=cx-W/2,top=cy-H/2,x=Math.round(left),y=Math.round(top);return{position:"absolute",left:x,top:y,width:W,height:H,transform:[{translateX:left-x},{translateY:top-y},{rotate:`${Math.atan2(uy,ux)*180/Math.PI}deg`},{scale:1/FINE2}]}}function strokePieces2(icon,k2,out){for(let s of icon.strokes){let w=s.width*k2,pts=s.points,n=pts.length/2,last=s.closed?n:n-1;for(let i=0;i<last;i+=1){let j=(i+1)%n,px2=(pts[i*2]??0)*k2,py=(pts[i*2+1]??0)*k2,dx=(pts[j*2]??0)*k2-px2,dy=(pts[j*2+1]??0)*k2-py,len=Math.hypot(dx,dy);if(len===0&&!(n===2&&s.cap))continue;let ux=len===0?1:dx/len,uy=len===0?0:dy/len,e0=s.closed||i>0||s.cap?w/2:0,e1=s.closed||j!==n-1||s.cap?w/2:0,along=(len+e1-e0)/2;out.push({paint:"backgroundColor",style:{...place2(px2+ux*along,py+uy*along,fine2(len+e0+e1),fine2(w),ux,uy),borderTopLeftRadius:e0>0?fine2(w)/2:0,borderBottomLeftRadius:e0>0?fine2(w)/2:0,borderTopRightRadius:e1>0?fine2(w)/2:0,borderBottomRightRadius:e1>0?fine2(w)/2:0,...s.opacity===void 0?{}:{opacity:s.opacity}}})}}}function boxPieces2(icon,k2,out){for(let b of icon.boxes){let w=(b.w+b.width)*k2,h=(b.h+b.width)*k2;out.push({paint:"borderColor",style:{...place2((b.x-b.width/2)*k2+w/2,(b.y-b.width/2)*k2+h/2,fine2(w),fine2(h),1,0),borderWidth:fine2(b.width*k2),borderRadius:(b.radius+b.width/2)*k2*FINE2,...b.opacity===void 0?{}:{opacity:b.opacity}}})}}function trianglePieces2(icon,k2,out){for(let t of icon.triangles){let p=[0,1,2].map(i=>[(t[i*2]??0)*k2,(t[i*2+1]??0)*k2]),base3=0,len=-1;for(let i=0;i<3;i+=1){let a2=p[i]??[0,0],b=p[(i+1)%3]??[0,0],d=Math.hypot(b[0]-a2[0],b[1]-a2[1]);d>len&&(len=d,base3=i)}if(len<=0)continue;let b0=p[base3]??[0,0],b1=p[(base3+1)%3]??[0,0],a=p[(base3+2)%3]??[0,0],ux=(b1[0]-b0[0])/len,uy=(b1[1]-b0[1])/len,along=(a[0]-b0[0])*ux+(a[1]-b0[1])*uy,across=(a[0]-b0[0])*-uy+(a[1]-b0[1])*ux,h=Math.abs(across),up=across<0,mid=up?-h/2:h/2,bl=fine2(along),br=fine2(len)-bl,bh=fine2(h);out.push({paint:up?"borderBottomColor":"borderTopColor",style:{...place2(b0[0]+ux*(len/2)-uy*mid,b0[1]+uy*(len/2)+ux*mid,bl+br,bh,ux,uy),width:0,height:0,borderLeftWidth:bl,borderRightWidth:br,borderLeftColor:"transparent",borderRightColor:"transparent",...up?{borderBottomWidth:bh}:{borderTopWidth:bh}}})}for(let e of icon.seams){let x0=(e[0]??0)*k2,y0=(e[1]??0)*k2,dx=(e[2]??0)*k2-x0,dy=(e[3]??0)*k2-y0,d=Math.hypot(dx,dy),in0=SEAM2*(e[4]??0),in1=SEAM2*(e[5]??0),bar=d-in0-in1;if(d===0||bar<=0)continue;let mid=in0+bar/2;out.push({paint:"backgroundColor",style:place2(x0+dx/d*mid,y0+dy/d*mid,fine2(bar),fine2(SEAM2),dx/d,dy/d)})}}var cache5=/* @__PURE__ */new Map;function piecesOf2(name,size){let key=`${name}:${size}`,hit=cache5.get(key);if(hit!==void 0)return hit;let icon=DESIGN_RN_PLAN_ICONS[name],out=[],k2=size/BOX2;return boxPieces2(icon,k2,out),strokePieces2(icon,k2,out),trianglePieces2(icon,k2,out),cache5.set(key,out),out}function FocusIcon({name:name,size:size=18,color:color}){let pieces=DESIGN_RN_PLAN_ICONS[name]===void 0?[]:piecesOf2(name,size);/* @__PURE__ */
|
|
167
|
+
return jsxRuntime.jsx(reactNative.View,{accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants",testID:`health-plan-icon-${name}`,children:/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:{width:size,height:size},children:pieces.map((piece,i)=>/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[piece.style,{[piece.paint]:color}]},i))})})}function focusPalette(theme){let c=theme.color;if(theme.brightness==="dark")return{ink:c.text.primary,ink2:c.text.secondary,ink3:c.text.muted,paper:c.surfaceSubtle,tile:c.badgeBgNeutral,line:c.brandBorder,card:c.surface,teal:c.brandInk,cyan:c.brandSofter,yellow:c.accent,riskDot:c.errorRed,riskBg:c.badgeBgCritical,riskInk:c.text.primary,clearDot:c.success,clearBg:c.badgeBgPositive,clearInk:c.text.primary,star:c.accent,button:c.primary,onButton:c.onPrimary,jump:c.surfaceSubtle,onJump:c.text.primary,jumpSmall:c.accent,tints:{y:c.badgeBgCaution,c:c.brandSofter,g:c.badgeBgPositive,r:c.badgeBgCritical},scrim:"rgba(0,0,0,0.6)"};let v=v3Palette(theme);return{ink:v.ink,ink2:v.ink2,ink3:v.ink3,paper:planRoles(theme).paper??v.paper,tile:v.tile,line:v.line,card:v.card,teal:c.brandInk,cyan:c.brandSofter,yellow:v.accent,riskDot:v.riskDot,riskBg:v.riskBg,riskInk:v.riskInk,clearDot:v.clearDot,clearBg:v.clearBg,clearInk:v.clearInk,star:v.watchDot,button:v.primary,onButton:v.onPrimary,jump:v.ink,onJump:v.card,jumpSmall:v.accent,tints:{y:"#FFE7A1",c:"#C8F4F8",g:"#DDEFC4",r:"#FFD8D6"},scrim:"rgba(38,37,35,0.45)"}}function makeFocusStyles(theme){let P2=focusPalette(theme),{space:space}=theme,t=(size,ink,weight="regular",ratio=1.35)=>({...face(theme,weight),fontSize:size,lineHeight:Math.round(size*ratio),color:ink}),s=reactNative.StyleSheet.create({shrink:{flexShrink:1,minWidth:0},toolLabel:t(14,P2.ink,"bold"),mini:{...t(10.5,P2.ink3,"mono"),textTransform:"uppercase",letterSpacing:.9},h3:{...t(19,P2.ink,"bold",1.2),marginTop:space.sm},bold:face(theme,"bold"),noPick:{...t(15,P2.ink2,"regular",1.45),marginTop:14},small:t(13,P2.ink3,"regular",1.35),smallInk:t(13,P2.ink2,"regular",1.35),buttonGhost:{minHeight:48,borderRadius:999,alignItems:"center",justifyContent:"center",paddingHorizontal:space.lg,borderWidth:2,borderColor:P2.ink,marginTop:space.sm},buttonGhostText:{...t(15,P2.ink,"bold",1.2),textAlign:"center"},disabled:{opacity:.5},fine:{...t(13,P2.ink3,"regular",1.4),marginTop:space.sm},scrim:{flex:1,justifyContent:"flex-end",backgroundColor:P2.scrim},sheet:{maxHeight:"92%",paddingHorizontal:space.lg,paddingTop:space.sm,paddingBottom:space.xl,borderTopLeftRadius:22,borderTopRightRadius:22,backgroundColor:P2.card},sheetGrab:{alignSelf:"center",width:40,height:4,borderRadius:2,backgroundColor:P2.line,marginBottom:space.sm},sheetTop:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"},close:{width:44,height:44,alignItems:"center",justifyContent:"center"},screen:{paddingHorizontal:space.lg,paddingBottom:space.xl,gap:space.sm},back:{flexDirection:"row",alignItems:"center",gap:space.xs,minHeight:44,alignSelf:"flex-start"}}),X=planPaint(theme);return{...s,palette:P2,X:X,D:planDraw(X),ds:rnPlanDsTheme(theme,X.roles)}}var KitContext=react.createContext(null);function HealthPlanRnKitScope(props){/* @__PURE__ */
|
|
168
|
+
return jsxRuntime.jsx(KitContext.Provider,{value:props.kit,children:props.children})}var DEFAULT_COPY={...HEALTH_PLAN_FOCUS_RN_COPY,...healthPlanPetCopy({name:null,sex:null,trackingTexts:false})},STYLES=/* @__PURE__ */new WeakMap;function stylesFor(theme){let s=STYLES.get(theme);return s===void 0&&(s=makeFocusStyles(theme),STYLES.set(theme,s)),s}function useBuildHealthPlanRnKit(copy,renderIcon){let theme=usePlanTheme(),S=stylesFor(theme),ink=S.palette.ink,still=theme.motion.reducedMotion;return react.useMemo(()=>({S:S,icon:(name,color,size)=>(renderIcon?callHost(renderIcon,name):void 0)??/* @__PURE__ */jsxRuntime.jsx(FocusIcon,{name:name,color:color??ink,...size===void 0?{}:{size:size}}),copy:copy,still:still}),[S,ink,copy,renderIcon,still])}function useHealthPlanRnKit(own={}){let shared=react.useContext(KitContext),fallback=useBuildHealthPlanRnKit(DEFAULT_COPY,void 0),base3=shared??fallback,{copy:copy,renderIcon:renderIcon}=own;return react.useMemo(()=>{if(copy===void 0&&renderIcon===void 0)return base3;let merged=copy===void 0?base3.copy:{...base3.copy,...copy},icon=renderIcon===void 0?base3.icon:(name,color,size)=>callHost(renderIcon,name)??base3.icon(name,color,size);return{...base3,copy:merged,icon:icon}},[base3,copy,renderIcon])}var SHRINK2={flexShrink:1},FR={flexGrow:1,flexShrink:1,flexBasis:0,minWidth:0},KEEP={flexShrink:0},START={alignSelf:"flex-start"},CENTER2={justifyContent:"center"},COLUMN={flexDirection:"column"};var IN_PLACE={position:"relative",top:0,right:0},planImg=(src,style,fit)=>src?/* @__PURE__ */jsxRuntime.jsx(reactNative.Image,{source:{uri:src},style:style,resizeMode:fit,accessibilityIgnoresInvertColors:true}):null,PRODUCT_SHOT={width:64,height:64};function planTag(k2,label,part2){let{bx:bx,tx:tx}=k2.S.D;return label===void 0||label===""?null:/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("tag",part2),children:/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"compact",style:tx("tag",part2),children:label})})}function planNumber(k2,value,part2){let{bx:bx,tx:tx}=k2.S.D;/* @__PURE__ */
|
|
169
|
+
return jsxRuntime.jsx(reactNative.View,{style:bx(part2),accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants",children:/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"badge",style:tx(part2),children:String(value)})})}function planSecHead(k2,value,label){let{bx:bx,tx:tx}=k2.S.D;/* @__PURE__ */
|
|
171
170
|
return jsxRuntime.jsxs(reactNative.View,{style:bx("secTitle"),children:[planNumber(k2,value,"secN"),
|
|
172
171
|
/* @__PURE__ */jsxRuntime.jsx(Text,{style:[...tx("secTitle"),SHRINK2],accessibilityRole:"header",children:label})]})}var warnedNoReturnUrl=false;function warnNoReturnUrl(){if(globalThis.__DEV__===false||warnedNoReturnUrl)return;warnedNoReturnUrl=true;let globalConsole=globalThis.console;try{globalConsole?.warn?.("[everfur] The Health Plan shop is on with Everfur checkout, but `focus.checkoutReturnUrl` is missing or not an https URL, so the member is never sent to Stripe: checkout keeps the in-app path (your onBuy / onCheckout). Pass the https App Link (Universal Link) your app opens as `checkoutReturnUrl`.")}catch{}}var isDogSpecies=s=>s!=null&&/^(dog|canine)$/i.test(s.trim()),ModelContext=react.createContext(null);function useHealthPlanFocusContext(){return react.useContext(ModelContext)}function useConnectedHealthPlanModel(){let m=react.useContext(ModelContext);return m===null&&warnConnectedOutsideProvider(globalThis.__DEV__!==false),m}function useHealthPlanFocusModel(props){let{design:design,item:item,petRef:petRef}=props,petName=props.petName?.trim()?props.petName.trim():null,{runtime:runtime}=useEverfurContext(),[pageWidth,setPageWidthState]=react.useState(null),setPageWidth=react.useCallback(w=>setPageWidthState(w),[]),sex=props.petSex??null,trackingTexts=props.trackingTexts===true,copy=react.useMemo(()=>({...HEALTH_PLAN_FOCUS_RN_COPY,...healthPlanPetCopy({name:petName,sex:sex,trackingTexts:trackingTexts}),...design.copy,...props.fromBackend===true?HEALTH_PLAN_NO_SHIP_DAY_COPY:{},...props.copy}),[petName,sex,trackingTexts,design.copy,props.copy,props.fromBackend]),kit=useBuildHealthPlanRnKit(copy,props.renderIcon),returnUrl=validReturnUrl(props.checkoutReturnUrl)?props.checkoutReturnUrl.trim():null,scrollScope=useHealthPlanScroll(),pickRef=react.useRef(null);react.useEffect(()=>{props.shop===true&&props.checkout==="everfur_stripe"&&returnUrl===null&&warnNoReturnUrl()},[props.shop,props.checkout,returnUrl]);let kv=runtime.registry.services.kv,store=react.useMemo(()=>rnFocusStore(kv),[kv]),navigate=props.navigate,recordsReader=props.recordsRepository,readEmpty=recordsReader!==void 0&&props.recordsMissing===void 0&&props.onConnectRecords!==void 0,recordsEmpty=useHealthPlanRecordsEmpty(readEmpty?recordsReader:void 0,petRef),probeRecords=recordsReader===void 0&&props.onConnectRecords!==void 0&&props.recordsMissing===void 0&&props.recordsBlanks===void 0,[recordsRead,setRecordsRead]=react.useState(null),onRecordsRead=react.useCallback(read=>setRecordsRead({pet:petRef,read:read}),[petRef]),probed=probeRecords&&recordsRead!==null&&recordsRead.pet===petRef?recordsRead.read:null,recordsProbe=probeRecords?/* @__PURE__ */jsxRuntime.jsx(RecordsProbe,{petRef:petRef,onRead:onRecordsRead},petRef):null,recordsMissing=props.recordsMissing??(recordsReader!==void 0?recordsEmpty===true:probed?.missing===true),blanksFacts=props.recordsBlanks!==void 0?props.recordsBlanks:probed?.blanks??null,{onOverlayChange:hostOverlay,...logicProps}=props,hp=useHealthPlanFocus({...logicProps,petName:petName,blanksFacts:blanksFacts,...hostOverlay===void 0?{}:{onOverlayChange:(o,c)=>o==="product"?void 0:hostOverlay(o,c)}},copy,{store:store,returnUrls:()=>returnUrl===null?null:{successUrl:checkoutReturnUrl(returnUrl,CHECKOUT_PARAM,STRIPE_SESSION_ID),cancelUrl:checkoutReturnUrl(returnUrl,CHECKOUT_CANCEL_PARAM,"1")},openUrl:url=>{navigate?callHost(navigate,url):reactNative.Linking.openURL(url).catch(()=>{})},callHost:callHost,mintKey:mintTapKey},{...RN_RULES_BASE,checkoutReachable:returnUrl!==null}),{shop:shop,everfur:everfur,partnerBuys:partnerBuys,itemOf:itemOf2,inCart:inCart,weightKnown:weightKnown,noVet:noVet,planItems:planItems}=hp,allOrders=[...hp.ownOrders.map(o=>everfurOrderView(o,planItems)),...(props.shopOrders??[]).map(hostOrderView)];useCheckoutReturn({enabled:everfur,petRef:petRef,pages:hp.pages,returnUrl:returnUrl,lifecycle:props.lifecycle??null,kv:kv,...hp.returnHandlers});let species=props.species??null,isDog=isDogSpecies(species),otherSpecies=species!==null&&species.trim()!==""&&!isDog,askWeight=!weightKnown&&isDog,pk=design.pick,waitNode=props.renderWait?callHost(props.renderWait)??null:null,waiting=waitNode!==null||design.wait!==void 0,rows=props.checkoutRows??(props.fromBackend?[]:design.checkoutRows??[]),trust=props.trust??(props.fromBackend?[]:pk.trust??[]),byline=design.byline!==void 0&&(props.fromBackend!==true||props.vetReviewed===true)?design.byline:void 0,vet=byline??null,noPick=pk.none===true,pickHidden=noPick&&pk.hidden===true,curated=design.extras?.items.some(x=>x.productId!==void 0)===true,vetSignTitle=title=>noVet?copy.callAVet:recordsMissing?copy.callYourVet:title,blanksShown=blanksFacts!==null&&!waiting,extraItems=(design.extras?.items??[]).filter(x=>x.owned!==true),extraProduct=x=>x.productId!==void 0&&(shop||everfur||partnerBuys)?itemOf2(x.productId):void 0,extrasShown=extraItems.some(x=>extraProduct(x)!==void 0||props.onExtra!==void 0),pickInCart=shop&&inCart(item.productId)!==void 0,onJump=props.onJump,jump=onJump?()=>{callHost(onJump)}:scrollScope?()=>scrollScope(pickRef.current):void 0,sec=1,numbers={};return design.routine&&!waiting&&(numbers.routine=sec++),!(waiting||pickHidden)&&!noPick&&(numbers.pick=sec++),!waiting&&design.signs?numbers.signs=sec++:!waiting&&design.checkup&&(numbers.checkup=sec++),{model:{props:props,hp:hp,kit:kit,copy:copy,petName:petName,returnUrl:returnUrl,blanksFacts:blanksFacts,recordsMissing:recordsMissing,waitNode:waitNode,waiting:waiting,blanksShown:blanksShown,rows:rows,trust:trust,byline:byline,vet:vet,noPick:noPick,pickHidden:pickHidden,curated:curated,otherSpecies:otherSpecies,askWeight:askWeight,pickInCart:pickInCart,jump:jump,pickRef:pickRef,pageWidth:pageWidth,setPageWidth:setPageWidth,numbers:numbers,allOrders:allOrders,extraProduct:extraProduct,extraItems:extraItems,extrasShown:extrasShown,vetSignTitle:vetSignTitle},recordsProbe:recordsProbe}}function HealthPlanFocusProvider(props){let{model:model,recordsProbe:recordsProbe}=useHealthPlanFocusModel(props);/* @__PURE__ */
|
|
173
|
-
return jsxRuntime.jsx(ModelContext.Provider,{value:model,children:/* @__PURE__ */jsxRuntime.jsxs(HealthPlanRnKitScope,{kit:model.kit,children:[props.children,recordsProbe]})})}var FLASH_MS=900,FLASH_STEP_MS=80,FLASH_HOLD=.4,easeOut=()=>reactNative.Easing.bezier(0,0,.58,1),SHRINK3={flexShrink:1},LINE={flexDirection:"row",flexWrap:"wrap",alignItems:"center"},HOLDS_VALUE={height:void 0,paddingLeft:3,paddingRight:3};function HealthPlanBlanks(props){let{phase:phase,rows:rows,flashKey:flashKey}=props,theme=usePlanTheme(),still=theme.motion.reducedMotion,X=planPaint(theme),{bx:bx,tx:tx,tb:tb,inner:inner}=planDraw(X),flash=X.roles.accent??"",flashClear=clearOf(flash),blankGround=X.roles.accent4??"",all=rows.every(r=>r.value!==null),filledLook=phase==="filled"&&all,progress=react.useRef([]);for(;progress.current.length<rows.length;)progress.current.push(new reactNative.Animated.Value(1));let flashed=react.useRef(null);return react.useEffect(()=>{if(flashKey==null||flashed.current===flashKey||phase!=="filled"||(flashed.current=flashKey,still))return;let easing=easeOut(),runs=rows.flatMap((r,i)=>{let v=progress.current[i];return r.value===null||v===void 0?[]:(v.setValue(0),[reactNative.Animated.sequence([reactNative.Animated.delay(i*FLASH_STEP_MS),reactNative.Animated.timing(v,{toValue:1,duration:FLASH_MS,easing:easing,useNativeDriver:false})])])});for(let
|
|
172
|
+
return jsxRuntime.jsx(ModelContext.Provider,{value:model,children:/* @__PURE__ */jsxRuntime.jsxs(HealthPlanRnKitScope,{kit:model.kit,children:[props.children,recordsProbe]})})}var FLASH_MS=900,FLASH_STEP_MS=80,FLASH_HOLD=.4,easeOut=()=>reactNative.Easing.bezier(0,0,.58,1),SHRINK3={flexShrink:1},LINE={flexDirection:"row",flexWrap:"wrap",alignItems:"center"},HOLDS_VALUE={height:void 0,paddingLeft:3,paddingRight:3};function HealthPlanBlanks(props){let{phase:phase,rows:rows,flashKey:flashKey}=props,theme=usePlanTheme(),still=theme.motion.reducedMotion,X=planPaint(theme),{bx:bx,tx:tx,tb:tb,inner:inner}=planDraw(X),flash=X.roles.accent??"",flashClear=clearOf(flash),blankGround=X.roles.accent4??"",all=rows.every(r=>r.value!==null),filledLook=phase==="filled"&&all,progress=react.useRef([]);for(;progress.current.length<rows.length;)progress.current.push(new reactNative.Animated.Value(1));let flashed=react.useRef(null);return react.useEffect(()=>{if(flashKey==null||flashed.current===flashKey||phase!=="filled"||(flashed.current=flashKey,still))return;let easing=easeOut(),runs=rows.flatMap((r,i)=>{let v=progress.current[i];return r.value===null||v===void 0?[]:(v.setValue(0),[reactNative.Animated.sequence([reactNative.Animated.delay(i*FLASH_STEP_MS),reactNative.Animated.timing(v,{toValue:1,duration:FLASH_MS,easing:easing,useNativeDriver:false})])])});for(let run3 of runs)run3.start();return()=>{for(let run3 of runs)run3.stop()}},[flashKey,phase,still]),/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("blanksWrap","blanksCard"),accessibilityLabel:props.label,testID:"health-plan-blanks",children:[
|
|
174
173
|
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("blanksHead"),children:[
|
|
175
174
|
/* @__PURE__ */jsxRuntime.jsx(Text,{style:[...tx("blanksHead"),SHRINK3],tier:"compact",children:props.kicker}),props.pill===""?null:/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("blanksPill",filledLook&&"blanksPillFilled"),children:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("blanksPill",filledLook&&"blanksPillFilled"),tier:"compact",testID:"health-plan-blanks-pill",children:props.pill})})]}),
|
|
176
175
|
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("blanksList"),children:rows.map((r,i)=>{let value=phase!=="empty"?r.value:null,v=progress.current[i],flashBg=value!==null&&v!==void 0?v.interpolate({inputRange:[0,FLASH_HOLD,1],outputRange:[flash,flash,filledLook?flashClear:blankGround]}):null,width=r.width==="s"?"blankS":r.width==="l"?"blankL":null;/* @__PURE__ */
|
|
@@ -178,49 +177,62 @@ return jsxRuntime.jsxs(reactNative.View,{style:bx("blanksRow"),testID:`health-pl
|
|
|
178
177
|
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[...bx("blanksNum"),gridCell(X.blanksRow,0)],accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants",children:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("blanksNum"),children:String(i+1)})}),
|
|
179
178
|
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:gridCell(X.blanksRow,1),children:[
|
|
180
179
|
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:LINE,children:[r.lead===""?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("blanksText"),children:r.lead}),
|
|
181
|
-
/* @__PURE__ */jsxRuntime.jsxs(reactNative.Animated.View,{style:[...bx("blank",width,filledLook&&"blankFilled"),!filledLook&&value!==null?HOLDS_VALUE:null,flashBg===null?null:{backgroundColor:flashBg}],...value===null?{accessible:true,accessibilityLabel:props.blankLabel}:{},testID:value===null?`health-plan-blank-${r.key}-empty`:`health-plan-blank-${r.key}-value`,children:[inner("blank",filledLook&&"blankFilled"),value===null?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("blank"),children:value})]}),r.trail===""?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("blanksText"),children:r.trail})]}),r.source===""?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("blanksSource"),children:r.source})]})]},r.key)})})]})}function BlockScope({children:children}){let input=useBlockThemeInput(rnBlockFonts);return react.createElement(ThemeProvider,{theme:input},children)}var CART_BUMP_MS=320;function swipeWidth(k2,pageWidth,card,around){let X=k2.S.X,padX=name=>Number(X[name].box.paddingLeft??0)+Number(X[name].box.paddingRight??0);return k2.S.D.swipe(card,around.reduce((w,
|
|
180
|
+
/* @__PURE__ */jsxRuntime.jsxs(reactNative.Animated.View,{style:[...bx("blank",width,filledLook&&"blankFilled"),!filledLook&&value!==null?HOLDS_VALUE:null,flashBg===null?null:{backgroundColor:flashBg}],...value===null?{accessible:true,accessibilityLabel:props.blankLabel}:{},testID:value===null?`health-plan-blank-${r.key}-empty`:`health-plan-blank-${r.key}-value`,children:[inner("blank",filledLook&&"blankFilled"),value===null?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("blank"),children:value})]}),r.trail===""?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("blanksText"),children:r.trail})]}),r.source===""?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("blanksSource"),children:r.source})]})]},r.key)})})]})}function BlockScope({children:children}){let input=useBlockThemeInput(rnBlockFonts);return react.createElement(ThemeProvider,{theme:input},children)}registerIcons({paw:UI_RN_ICON_PAW});var WRAP2={flexWrap:"wrap"},ODDS_END={alignItems:"flex-end",flexShrink:0,marginLeft:"auto"},ODDS_ROW={flexDirection:"row",alignItems:"center"},CART_BUMP_MS=320;function swipeWidth(k2,pageWidth,card,around){let X=k2.S.X,padX=name=>Number(X[name].box.paddingLeft??0)+Number(X[name].box.paddingRight??0);return k2.S.D.swipe(card,around.reduce((w,part2)=>w-padX(part2),pageWidth))}function HealthPlanToolbar(props){let k2=useHealthPlanRnKit(props),{S:S,copy:copy,icon:icon}=k2,P2=S.palette,X=S.X,{bx:bx,tx:tx,tb:tb,ring:ring,ink:ink,side:side}=S.D,lineCount=props.cartCount,cartBump=react.useRef(new reactNative.Animated.Value(1)).current,lastCount=react.useRef(lineCount);react.useEffect(()=>{let grew=lineCount>lastCount.current;if(lastCount.current=lineCount,!grew||k2.still)return;let easing=reactNative.Easing.bezier(.23,1,.32,1),run3=reactNative.Animated.sequence([reactNative.Animated.timing(cartBump,{toValue:1.25,duration:CART_BUMP_MS*.4,easing:easing,useNativeDriver:false}),reactNative.Animated.timing(cartBump,{toValue:1,duration:CART_BUMP_MS*.6,easing:easing,useNativeDriver:false})]);return run3.start(),()=>run3.stop()},[lineCount,k2.still,cartBump]);let badgeOuter=X.cartCount.rings[0]??X.cartCount.box,badgePlace={position:"absolute",top:badgeOuter.top,right:badgeOuter.right};/* @__PURE__ */
|
|
182
181
|
return jsxRuntime.jsxs(reactNative.View,{style:bx("tools"),children:[props.eyebrow?/* @__PURE__ */jsxRuntime.jsx(Text,{style:[...tb("toolsEyebrow"),SHRINK2],children:props.eyebrow}):/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{}),
|
|
183
182
|
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("toolsEnd"),children:[
|
|
184
|
-
/* @__PURE__ */jsxRuntime.jsxs(reactNative.Pressable,{onPress:props.onOpenOrders,accessibilityRole:"button",accessibilityLabel:copy.orders,style:bx("orders"),testID:"health-plan-orders-button",children:[icon("box",ink("orders",
|
|
183
|
+
/* @__PURE__ */jsxRuntime.jsxs(reactNative.Pressable,{onPress:props.onOpenOrders,accessibilityRole:"button",accessibilityLabel:copy.orders,style:bx("orders"),testID:"health-plan-orders-button",children:[icon("box",ink("orders",P2.ink),side("ordersIcon",21)),
|
|
185
184
|
/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"control",style:tx("orders"),children:copy.orders})]}),
|
|
186
|
-
/* @__PURE__ */jsxRuntime.jsxs(reactNative.Pressable,{onPress:props.onOpenCart,accessibilityRole:"button",accessibilityLabel:copy.cartLabel(lineCount),style:bx("cart"),testID:"health-plan-cart-button",children:[icon("cart",ink("cart",
|
|
185
|
+
/* @__PURE__ */jsxRuntime.jsxs(reactNative.Pressable,{onPress:props.onOpenCart,accessibilityRole:"button",accessibilityLabel:copy.cartLabel(lineCount),style:bx("cart"),testID:"health-plan-cart-button",children:[icon("cart",ink("cart",P2.ink),side("cartIcon",26)),lineCount===0?null:
|
|
187
186
|
/* @__PURE__ */jsxRuntime.jsx(reactNative.Animated.View,{pointerEvents:"none",style:[badgePlace,{transform:[{scale:cartBump}]}],children:ring("cartCount",
|
|
188
187
|
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[...bx("cartCount"),X.cartCount.rings.length===0?IN_PLACE:null],children:/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"badge",style:tx("cartCount"),children:String(lineCount)})}),IN_PLACE)})]})]})]})}function HealthPlanHeader(props){let k2=useHealthPlanRnKit(props),{bx:bx,tb:tb,im:im,ring:ring}=k2.S.D;/* @__PURE__ */
|
|
189
188
|
return jsxRuntime.jsxs(reactNative.View,{style:bx("head"),children:[
|
|
190
189
|
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:gridCell(k2.S.X.head,0),children:[props.eyebrow?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("eyebrow"),children:props.eyebrow}):null,
|
|
191
|
-
/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("title"),accessibilityRole:"header",testID:"health-plan-focus-title",children:props.title}),props.subtitle?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("subtitle"),children:props.subtitle}):null]}),props.imageUrl?ring("headImage",planImg(props.imageUrl,im("headImage")),KEEP):null]})}function HealthPlanByline(props){let k2=useHealthPlanRnKit(props),{bx:bx,tb:tb,im:im,ink:ink,side:side}=k2.S.D,byline=props.vet;/* @__PURE__ */
|
|
192
|
-
return jsxRuntime.jsxs(reactNative.View,{style:bx("by"),testID:"health-plan-byline",children:[planImg(byline.imageUrl,im("byImage")),
|
|
190
|
+
/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("title"),accessibilityRole:"header",testID:"health-plan-focus-title",children:props.title}),props.subtitle?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("subtitle"),children:props.subtitle}):null]}),props.imageUrl?ring("headImage",planImg(props.imageUrl,im("headImage")),KEEP):null]})}function HealthPlanByline(props){let k2=useHealthPlanRnKit(props),{bx:bx,tb:tb,im:im,ink:ink,side:side}=k2.S.D,byline=props.vet,icSide=side("byIconSvg",20);/* @__PURE__ */
|
|
191
|
+
return jsxRuntime.jsxs(reactNative.View,{style:bx("by"),testID:"health-plan-byline",children:[byline.imageUrl?planImg(byline.imageUrl,im("byImage")):/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[...bx("byIcon"),KEEP],testID:"health-plan-byline-icon",children:/* @__PURE__ */jsxRuntime.jsx(Icon,{name:"paw",size:icSide,color:ink("byIcon",k2.S.palette.ink)})}),
|
|
193
192
|
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:gridCell(k2.S.X.by,1),children:[
|
|
194
|
-
/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("byName"),children:k2.copy.builtWith(byline.name)}),byline.role?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("byRole"),children:byline.role}):null]}),k2.icon("shield",ink("byOk",k2.S.palette.teal),side("byOk",22))]})}function HealthPlanAskRow(props){let k2=useHealthPlanRnKit(props);return shopAskRow(k2,props.icon,props.title,props.body,props.onPress,props.testID,props.inSection===true)}function HealthPlanWaitCard(props){let k2=useHealthPlanRnKit(props);return shopWait(k2,props.wait,props.onAction,props.vetName??null)}function HealthPlanVetQuote(props){let k2=useHealthPlanRnKit(props),{bx:bx,tx:tx,tb:tb,im:im}=k2.S.D,{quote:quote,vet:vet}=props;
|
|
195
|
-
|
|
196
|
-
/* @__PURE__ */jsxRuntime.
|
|
193
|
+
/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("byName"),children:k2.copy.builtWith(byline.name)}),byline.role?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("byRole"),children:byline.role}):null]}),k2.icon("shield",ink("byOk",k2.S.palette.teal),side("byOk",22))]})}function HealthPlanAskRow(props){let k2=useHealthPlanRnKit(props);return shopAskRow(k2,props.icon,props.title,props.body,props.onPress,props.testID,props.inSection===true)}function HealthPlanWaitCard(props){let k2=useHealthPlanRnKit(props);return shopWait(k2,props.wait,props.onAction,props.vetName??null)}function HealthPlanVetQuote(props){let k2=useHealthPlanRnKit(props),{bx:bx,tx:tx,tb:tb,im:im}=k2.S.D,{quote:quote,vet:vet}=props;if(vet.imageUrl)/* @__PURE__ */
|
|
194
|
+
return jsxRuntime.jsxs(reactNative.View,{style:bx("says"),testID:"health-plan-quote",children:[planImg(vet.imageUrl,im("saysImage")),
|
|
195
|
+
/* @__PURE__ */jsxRuntime.jsxs(Text,{style:[...tb("saysText"),gridCell(k2.S.X.says,1)],children:[vet.shortName?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("saysBy"),children:vet.shortName}):null,vet.shortName?" ":null,quote.text,quote.tag?" ":null,planTag(k2,quote.tag)]})]});let kicker=vet.shortName??quote.kicker??null;/* @__PURE__ */
|
|
196
|
+
return jsxRuntime.jsxs(reactNative.View,{style:[...bx("says"),COLUMN],testID:"health-plan-quote",children:[kicker||quote.tag?/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("saysKicker"),children:[
|
|
197
|
+
/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"compact",style:[...tx("saysKicker"),SHRINK2],children:kicker}),planTag(k2,quote.tag)]}):null,
|
|
198
|
+
/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("saysQuote"),children:`“${quote.text}”`})]})}function HealthPlanJumpStrip(props){let k2=useHealthPlanRnKit(props),{bx:bx,tx:tx,im:im}=k2.S.D,jump=props.onJump;/* @__PURE__ */
|
|
197
199
|
return jsxRuntime.jsxs(reactNative.Pressable,{onPress:jump,disabled:jump===void 0,accessibilityRole:jump?"button":"text",style:pressScale(bx("jump",!props.imageUrl&&"jumpNoImage"),PLAN_PRESS_SCALE.jump,jump===void 0),testID:"health-plan-jump",children:[planImg(props.imageUrl,im("jumpImage")),
|
|
198
200
|
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:FR,children:[props.kicker===null?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("jumpSmall"),children:props.kicker}),
|
|
199
|
-
/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("jumpStrong"),children:props.title})]}),jump?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("jumpGo"),children:props.go}):null]})}function HealthPlanFocusCard(props){let k2=useHealthPlanRnKit(props),f=props.focus,vet=props.vet,jump=props.jump,kind=f.risk?.kind,tone=kind==="risk"||kind==="watch"||kind==="clear"?kind:void 0
|
|
200
|
-
|
|
201
|
+
/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("jumpStrong"),children:props.title})]}),jump?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("jumpGo"),children:props.go}):null]})}function HealthPlanFocusCard(props){let k2=useHealthPlanRnKit(props),{bx:bx,tx:tx,tb:tb,ink:ink,side:side}=k2.S.D,X=k2.S.X,f=props.focus,vet=props.vet,jump=props.jump,kind=f.risk?.kind,tone=kind==="risk"||kind==="watch"||kind==="clear"?kind:void 0,odds=f.odds,oddsNode=odds?/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:[...bx("odds"),WRAP2],testID:"health-plan-score",children:[
|
|
202
|
+
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:[SHRINK2,{maxWidth:X.oddsKicker.box.maxWidth}],children:[
|
|
203
|
+
/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("oddsKicker"),children:odds.label}),odds.tag?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("oddsTag"),testID:"health-plan-tag",children:/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"compact",style:tx("oddsTag"),children:odds.tag})}):null]}),
|
|
204
|
+
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:ODDS_END,children:[
|
|
205
|
+
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:[...bx("oddsNumbers"),ODDS_ROW],children:[
|
|
206
|
+
/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("oddsFrom"),children:odds.from}),k2.icon("arrow",ink("oddsIcon",k2.S.palette.ink),side("oddsIcon",16)),
|
|
207
|
+
/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("oddsTo"),children:odds.to})]}),odds.toLabel?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("oddsLabel"),children:odds.toLabel}):null]})]}):null,quoteNode=f.quote&&vet!==null?/* @__PURE__ */jsxRuntime.jsx(HealthPlanVetQuote,{quote:f.quote,vet:vet,copy:props.copy,renderIcon:props.renderIcon}):null,card={backgroundColor:X.need.box.backgroundColor,borderRadius:X.need.box.borderRadius};/* @__PURE__ */
|
|
208
|
+
return jsxRuntime.jsx(reactNative.View,{testID:"health-plan-focus-card",style:{marginTop:X.need.box.marginTop},children:/* @__PURE__ */jsxRuntime.jsx(BlockScope,{children:/* @__PURE__ */jsxRuntime.jsx(PlanNeedCard,{variant:"plan",testID:"health-plan",kicker:f.kicker,sources:f.sources?.map(s=>({label:s.label,kind:s.kind==="dna"?"dna":"records"})),title:f.title,signals:f.risk?[{key:"risk",lead:f.risk.lead,text:f.risk.body??"",tone:tone,dot:tone===void 0?"space":true}]:[],beforeJump:oddsNode||quoteNode?/* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[oddsNode,quoteNode]}):void 0,jump:jump?{kicker:jump.kicker??"",title:jump.title,go:jump.onJump?jump.go:"",image:jump.imageUrl??null,onPress:jump.onJump}:void 0,style:card})})})}function HealthPlanTips(props){let k2=useHealthPlanRnKit(props),window=reactNative.useWindowDimensions(),{S:S,icon:icon}=k2,{bx:bx,tx:tx,tb:tb,scroll:scroll}=S.D,routine=props.routine,tipWidth=swipeWidth(k2,props.pageWidth??window.width,"tip",["root","steps"]),footOf=s=>s.fromVet?props.vetShortName?k2.copy.fromVet(props.vetShortName):void 0:s.source??void 0;/* @__PURE__ */
|
|
201
209
|
return jsxRuntime.jsxs(reactNative.View,{style:bx("steps"),testID:"health-plan-routine",children:[
|
|
202
210
|
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("stepsHead"),children:[
|
|
203
211
|
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:[...bx("stepsTitle"),SHRINK2],children:[planNumber(k2,props.number,"n"),
|
|
204
|
-
/* @__PURE__ */jsxRuntime.jsx(Text,{style:[...tx("stepsTitle"),SHRINK2],accessibilityRole:"header",children:routine.title})]}),routine.label?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("stepsLabel"),children:routine.label}):null]}),
|
|
205
|
-
/* @__PURE__ */jsxRuntime.jsx(BlockScope,{children:/* @__PURE__ */jsxRuntime.jsx(reactNative.ScrollView,{horizontal:true,showsHorizontalScrollIndicator:false,style:scroll("tips").place,contentContainerStyle:scroll("tips").content,children:routine.steps.map((s,i)=>{let tipIcon=s.icon
|
|
206
|
-
return jsxRuntime.jsx(TipCard,{variant:"plan",number:String(i+1),title:s.title,text:s.body||void 0,foot:
|
|
212
|
+
/* @__PURE__ */jsxRuntime.jsx(Text,{style:[...tx("stepsTitle"),SHRINK2],accessibilityRole:"header",children:routine.title})]}),routine.label?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("stepsLabel"),children:routine.label}):null]}),props.variant==="carousel"?
|
|
213
|
+
/* @__PURE__ */jsxRuntime.jsx(BlockScope,{children:/* @__PURE__ */jsxRuntime.jsx(reactNative.ScrollView,{horizontal:true,showsHorizontalScrollIndicator:false,style:scroll("tips").place,contentContainerStyle:scroll("tips").content,children:routine.steps.map((s,i)=>{let tipIcon=s.icon;/* @__PURE__ */
|
|
214
|
+
return jsxRuntime.jsx(TipCard,{variant:"plan",number:String(i+1),title:s.title,text:s.body||void 0,foot:footOf(s),tone:s.tone??"y",icon:({size:size,color:color})=>tipIcon?icon(tipIcon,color,size):null,style:{width:tipWidth,flexBasis:"auto"}},s.title)})})}):
|
|
215
|
+
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("tipList"),testID:"health-plan-tip-list",children:routine.steps.map((s,i)=>{let foot=footOf(s);/* @__PURE__ */
|
|
216
|
+
return jsxRuntime.jsxs(reactNative.View,{style:bx("tipRow"),testID:`health-plan-tip-${i}`,children:[
|
|
217
|
+
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[...bx("tipRowN"),gridCell(S.X.tipRow,0)],accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants",children:/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"badge",style:tx("tipRowN"),children:String(i+1)})}),
|
|
218
|
+
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:gridCell(S.X.tipRow,1),children:[
|
|
219
|
+
/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("tipRowStrong"),children:s.title}),s.body?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("tipRowSmall"),children:s.body}):null,foot?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("tipRowEm"),children:foot}):null]})]},s.title)})})]})}function healthPlanReviewWidth(k2,pageWidth){return swipeWidth(k2,pageWidth,"review",["root","sec","pick"])}function HealthPlanNoPick(props){let k2=useHealthPlanRnKit(props);return props.text===""?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:k2.S.noPick,testID:"health-plan-no-pick",children:props.text})}function HealthPlanFine(props){let k2=useHealthPlanRnKit(props);/* @__PURE__ */
|
|
207
220
|
return jsxRuntime.jsx(Text,{style:k2.S.D.tb("pageFine"),children:props.text})}function HealthPlanToast(props){let k2=useHealthPlanRnKit(props),toast=props.message,b=k2.S.X.toast.box,place3={position:b.position,top:b.top,left:b.left,right:b.right,zIndex:b.zIndex};/* @__PURE__ */
|
|
208
|
-
return jsxRuntime.jsx(PlanLinger,{motions:[TOAST_MOTION],draw:toast===null?null:([on])=>/* @__PURE__ */jsxRuntime.jsx(reactNative.Animated.View,{style:[place3,{opacity:on},k2.still||on===void 0?null:{transform:[{translateY:on.interpolate({inputRange:[0,1],outputRange:[-8,0]})}]}],accessibilityLiveRegion:"polite",accessibilityRole:"alert",testID:"health-plan-toast",children:/* @__PURE__ */jsxRuntime.jsx(PlanDs,{theme:k2.S.ds,children:/* @__PURE__ */jsxRuntime.jsx(Toast,{variant:"card",message:toast})})})})}function HealthPlanProductPick(props){let k2=useHealthPlanRnKit(props),{S:S,icon:icon}=k2,
|
|
221
|
+
return jsxRuntime.jsx(PlanLinger,{motions:[TOAST_MOTION],draw:toast===null?null:([on])=>/* @__PURE__ */jsxRuntime.jsx(reactNative.Animated.View,{style:[place3,{opacity:on},k2.still||on===void 0?null:{transform:[{translateY:on.interpolate({inputRange:[0,1],outputRange:[-8,0]})}]}],accessibilityLiveRegion:"polite",accessibilityRole:"alert",testID:"health-plan-toast",children:/* @__PURE__ */jsxRuntime.jsx(PlanDs,{theme:k2.S.ds,children:/* @__PURE__ */jsxRuntime.jsx(Toast,{variant:"card",message:toast})})})})}var ROW={flexDirection:"row"},MIDDLE={alignItems:"center"},CHIP_TRACK={flexShrink:0},CHIP_PAD={paddingHorizontal:6};function HealthPlanProductPick(props){let k2=useHealthPlanRnKit(props),{S:S,icon:icon}=k2,P2=S.palette,X=S.X,{bx:bx,tx:tx,tb:tb,ink:ink,side:side}=S.D,{item:item,pick:pk}=props,onMore=props.onMore;/* @__PURE__ */
|
|
209
222
|
return jsxRuntime.jsxs(reactNative.View,{ref:props.viewRef,style:bx("sec"),testID:"health-plan-pick",children:[planSecHead(k2,props.number,pk.title),
|
|
210
223
|
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("pick"),children:[
|
|
211
224
|
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("pickTop"),children:[
|
|
212
|
-
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("pickImage"),children:planImg(item.imageUrl,
|
|
225
|
+
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[...bx("pickImage"),CENTER2,MIDDLE],children:planImg(item.imageUrl,PRODUCT_SHOT,"contain")}),
|
|
213
226
|
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:gridCell(X.pickTop,1),children:[
|
|
214
|
-
/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("pickTitle"),testID:"health-plan-pick-title",children:item.title}),pk.rating?/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("stars"),accessibilityLabel:[pk.rating.value,pk.rating.label].filter(Boolean).join(" "),children:[icon("star",ink("starsIcon",
|
|
215
|
-
/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("stars"),children:pk.rating.value}),pk.rating.label?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("starsLabel"),children:pk.rating.label}):null]}):null,pk.line??item.description?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("pickLine"),children:pk.line??item.description}):null]})]}),props.children,pk.more&&onMore?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("more"),children:/* @__PURE__ */jsxRuntime.jsx(reactNative.Pressable,{onPress:onMore,accessibilityRole:"link",accessibilityLabel:pk.more,style:[...bx("moreButton"),CENTER2],children:/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"control",style:tx("moreButton"),children:pk.more})})}):null,pk.fine?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("fine"),children:pk.fine}):null]})]})}function HealthPlanReviews(props){let k2=useHealthPlanRnKit(props),window=reactNative.useWindowDimensions(),{S:S,icon:icon}=k2,{bx:bx,tb:tb,ink:ink,side:side,scroll:scroll}=S.D,reviews=props.reviews;if(reviews.items.length===0)return null;let reviewWidth=healthPlanReviewWidth(k2,props.pageWidth??window.width);/* @__PURE__ */
|
|
216
|
-
return jsxRuntime.
|
|
217
|
-
return jsxRuntime.jsxs(reactNative.View,{style:[...bx("review"),{width:reviewWidth,flexBasis:"auto"}],children:[
|
|
227
|
+
/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("pickTitle"),testID:"health-plan-pick-title",children:item.title}),pk.rating?/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("stars"),accessibilityLabel:[pk.rating.value,pk.rating.label].filter(Boolean).join(" "),children:[icon("star",ink("starsIcon",P2.star),side("starsIcon",14)),
|
|
228
|
+
/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("stars"),children:pk.rating.value}),pk.rating.label?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("starsLabel"),children:pk.rating.label}):null]}):null,pk.line??item.description?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("pickLine"),children:pk.line??item.description}):null]})]}),props.children,pk.more&&onMore?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("more"),children:/* @__PURE__ */jsxRuntime.jsx(reactNative.Pressable,{onPress:onMore,accessibilityRole:"link",accessibilityLabel:pk.more,style:[...bx("moreButton"),CENTER2],children:/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"control",style:tx("moreButton"),children:pk.more})})}):null,pk.fine?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("fine"),children:pk.fine}):null]})]})}function HealthPlanReviews(props){let k2=useHealthPlanRnKit(props),window=reactNative.useWindowDimensions(),{S:S,icon:icon}=k2,{bx:bx,tb:tb,ink:ink,side:side,scroll:scroll}=S.D,reviews=props.reviews;if(reviews.items.length===0)return null;let carousel=props.variant==="carousel",reviewWidth=healthPlanReviewWidth(k2,props.pageWidth??window.width),cards=reviews.items.map(r=>{let stars=Math.max(1,Math.min(5,Math.round(r.stars)));/* @__PURE__ */
|
|
229
|
+
return jsxRuntime.jsxs(reactNative.View,{style:carousel?[...bx("review"),{width:reviewWidth,flexBasis:"auto"}]:bx("reviewCard"),children:[
|
|
218
230
|
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("reviewStars"),accessibilityLabel:`${stars} out of 5 stars`,children:Array.from({length:stars},(_,i)=>/* @__PURE__ */jsxRuntime.jsx(react.Fragment,{children:icon("star",ink("reviewStars",S.palette.star),side("reviewStar",13))},i))}),
|
|
219
231
|
/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("reviewText"),children:`“${r.text}”`}),
|
|
220
|
-
/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("reviewBy"),children:r.by})]},`${r.by}${r.text}`)})})}function HealthPlanWhyItFits(props){let k2=useHealthPlanRnKit(props),{S:S,copy:copy}=k2,X=S.X,{bx:bx,tx:tx,tb:tb,mod:mod,inner:inner}=S.D,why=props.why;return why.rows.length===0?null:/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("why"),testID:"health-plan-why",children:[inner("why"),
|
|
232
|
+
/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("reviewBy"),children:r.by})]},`${r.by}${r.text}`)});return carousel?/* @__PURE__ */jsxRuntime.jsx(reactNative.ScrollView,{horizontal:true,showsHorizontalScrollIndicator:false,style:scroll("reviews").place,contentContainerStyle:scroll("reviews").content,accessibilityLabel:reviews.label,testID:"health-plan-reviews",children:cards}):/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("reviewsStack"),accessibilityLabel:reviews.label,testID:"health-plan-reviews",children:cards})}function HealthPlanWhyItFits(props){let k2=useHealthPlanRnKit(props),{S:S,copy:copy}=k2,X=S.X,{bx:bx,tx:tx,tb:tb,mod:mod,inner:inner}=S.D,why=props.why;return why.rows.length===0?null:/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("why"),testID:"health-plan-why",children:[inner("why"),
|
|
221
233
|
/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("whyMini"),children:why.title}),
|
|
222
234
|
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("whyList"),children:why.rows.map(r=>/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("whyRow"),children:[
|
|
223
|
-
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[...bx("chip",mod("chip",r.kind)),gridCell(X.whyRow,0)],children:/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"compact",style:tx("chip",mod("chip",r.kind)),children:r.chip})}),
|
|
235
|
+
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[...bx("chip",mod("chip",r.kind)),CHIP_TRACK,{minWidth:gridCell(X.whyRow,0).width}],children:/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"compact",numberOfLines:1,style:[...tx("chip",mod("chip",r.kind)),CHIP_PAD],children:r.chip})}),
|
|
224
236
|
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:gridCell(X.whyRow,1),children:[
|
|
225
237
|
/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("whyStrong"),children:r.title}),r.body?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("whySmall"),children:r.body}):null]})]},r.title))}),why.score&&why.rows.length>=2?/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("score"),testID:"health-plan-why-score",children:[
|
|
226
238
|
/* @__PURE__ */jsxRuntime.jsx(Text,{style:[...tx("score"),SHRINK2],children:copy.signalsFit(why.rows.length)}),
|
|
@@ -228,7 +240,7 @@ return jsxRuntime.jsxs(reactNative.View,{style:[...bx("review"),{width:reviewWid
|
|
|
228
240
|
return jsxRuntime.jsxs(reactNative.View,{style:bx("dose"),testID:"health-plan-dose",children:[
|
|
229
241
|
/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("doseMini"),children:dose.title}),
|
|
230
242
|
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("doseList"),children:dose.stats.map((s,i)=>/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:[...bx("doseItem"),gridCell(k2.S.X.doseList,i)],children:[
|
|
231
|
-
/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("doseValue"),children:s.value}),
|
|
243
|
+
/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("doseValue"),numberOfLines:1,adjustsFontSizeToFit:true,children:s.value}),
|
|
232
244
|
/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("doseLabel"),children:s.label})]},`${s.value}${s.label}`))}),dose.note?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("doseNote"),children:dose.note}):null]})}function HealthPlanIngredients(props){let k2=useHealthPlanRnKit(props),{bx:bx,tb:tb}=k2.S.D,ing=props.ingredients;return ing.items.length===0?null:/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("ingredients"),accessibilityLabel:ing.label??ing.items.join(", "),children:ing.items.map(x=>/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("ingredient"),children:x},x))})}function HealthPlanBuyOptions(props){let k2=useHealthPlanRnKit(props),{copy:copy}=k2,{bx:bx,tx:tx,tb:tb,inner:inner}=k2.S.D,{mode:buyMode,prices:pr,offer:offer}=props;/* @__PURE__ */
|
|
233
245
|
return jsxRuntime.jsxs(reactNative.View,{style:bx("opts"),accessibilityRole:"radiogroup",accessibilityLabel:copy.optionsLabel,testID:"health-plan-options",children:[
|
|
234
246
|
/* @__PURE__ */jsxRuntime.jsxs(reactNative.Pressable,{onPress:()=>props.onModeChange("sub"),accessibilityRole:"radio",accessibilityState:{checked:buyMode==="sub"},accessibilityLabel:copy.subscribe,style:pressScale(bx("opt",buyMode==="sub"&&"optOn"),PLAN_PRESS_SCALE.opt,false),testID:"health-plan-opt-sub",children:[inner("opt",buyMode==="sub"&&"optOn"),
|
|
@@ -255,28 +267,29 @@ return jsxRuntime.jsxs(reactNative.View,{style:bx("on"),testID:"health-plan-subs
|
|
|
255
267
|
/* @__PURE__ */jsxRuntime.jsxs(reactNative.Pressable,{onPress:props.onManage,accessibilityRole:"button",accessibilityLabel:copy.manage,style:pressScale([...bx("onButton"),CENTER2],PLAN_PRESS_SCALE.onButton,false),testID:"health-plan-manage",children:[inner("onButton"),
|
|
256
268
|
/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"control",style:tx("onButton"),children:copy.manage})]})]})}function HealthPlanOtherItems(props){let k2=useHealthPlanRnKit(props),{S:S}=k2,{bx:bx,tb:tb}=S.D;return props.items.length===0?null:/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("others"),testID:"health-plan-others",children:props.items.map(({item:o,buyLabel:buyLabel,buyDisabled:buyDisabled,onBuy:onBuy})=>/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("pick"),testID:`health-plan-other-${o.productId}`,children:[
|
|
257
269
|
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("pickTop"),children:[
|
|
258
|
-
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("pickImage"),children:planImg(o.imageUrl,
|
|
270
|
+
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[...bx("pickImage"),CENTER2,MIDDLE],children:planImg(o.imageUrl,PRODUCT_SHOT,"contain")}),
|
|
259
271
|
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:gridCell(S.X.pickTop,1),children:[props.showCategory===true&&o.category!==null?/* @__PURE__ */jsxRuntime.jsx(Text,{style:S.mini,children:o.category}):null,
|
|
260
272
|
/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("pickTitle"),children:o.title}),o.sample?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:START,children:planTag(k2,HEALTH_PLAN_COPY.sample)}):null,o.description?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("pickLine"),children:o.description}):null]})]}),
|
|
261
273
|
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("buy"),children:shopButton(k2,buyLabel,onBuy,{disabled:buyDisabled,testID:`health-plan-other-buy-${o.productId}`})})]},o.productId))})}function HealthPlanSigns(props){let k2=useHealthPlanRnKit(props),{bx:bx,tx:tx,tb:tb,inner:inner,ink:ink,side:side}=k2.S.D,signs=props.signs;/* @__PURE__ */
|
|
262
274
|
return jsxRuntime.jsxs(reactNative.View,{style:bx("sec"),testID:"health-plan-signs",children:[planSecHead(k2,props.number,signs.title),signs.items.map(s=>/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("sign",s.urgent===true&&"signUrgent"),children:[inner("sign",s.urgent===true&&"signUrgent"),
|
|
263
275
|
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("signTitle"),children:[s.urgent?k2.icon("alert",ink("signUrgentTitle",k2.S.palette.riskInk),side("signUrgentIcon",20)):null,
|
|
264
276
|
/* @__PURE__ */jsxRuntime.jsx(Text,{style:[...tx("signTitle",s.urgent===true&&"signUrgentTitle"),SHRINK2],children:s.callVet===true&&s.urgent!==true?props.callVetTitle??s.title:s.title})]}),
|
|
265
|
-
/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("signBody",s.urgent===true&&"signUrgentBody"),children:s.body})]},s.title)),props.children]})}function HealthPlanCheckup(props){let k2=useHealthPlanRnKit(props),{bx:bx,tx:tx,tb:tb,inner:inner}=k2.S.D,{checkup:c,added:added,addLabel:addLabel}=props,body=/* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[props.variant==="kicker"?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("questionsKicker"),accessibilityRole:"header",children:c.title}):planSecHead(k2,props.number??1,c.title),
|
|
266
|
-
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("questions",props.variant==="kicker"&&"questionsAfterKicker"),children:c.questions.map((q,i)
|
|
267
|
-
/* @__PURE__ */jsxRuntime.
|
|
268
|
-
/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("questions"),
|
|
277
|
+
/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("signBody",s.urgent===true&&"signUrgentBody"),children:s.body})]},s.title)),props.children]})}function HealthPlanCheckup(props){let k2=useHealthPlanRnKit(props),{bx:bx,tx:tx,tb:tb,inner:inner}=k2.S.D,{checkup:c,added:added,addLabel:addLabel}=props,markerSide=Number(k2.S.X.questions.box.paddingLeft??0),body=/* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[props.variant==="kicker"?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("questionsKicker"),accessibilityRole:"header",children:c.title}):planSecHead(k2,props.number??1,c.title),
|
|
278
|
+
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("questions",props.variant==="kicker"&&"questionsAfterKicker"),children:c.questions.map((q,i)=>
|
|
279
|
+
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:[ROW,{marginLeft:-markerSide}],children:[
|
|
280
|
+
/* @__PURE__ */jsxRuntime.jsx(Text,{style:[...tx("questions"),{width:markerSide,textAlign:"right"}],accessibilityElementsHidden:true,importantForAccessibility:"no",children:`${i+1}. `}),
|
|
281
|
+
/* @__PURE__ */jsxRuntime.jsx(Text,{style:[...tx("questions"),SHRINK2],children:q})]},q))}),addLabel===""?null:/* @__PURE__ */jsxRuntime.jsxs(reactNative.Pressable,{onPress:()=>props.onToggle(c.questions),accessibilityRole:"button",accessibilityState:{selected:added},accessibilityLabel:addLabel,style:pressScale(bx("add",added&&"addOn"),PLAN_PRESS_SCALE.add,false),testID:"health-plan-add-to-visit",children:[inner("add",added&&"addOn"),
|
|
269
282
|
/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"control",style:tx("add",added&&"addOn"),children:addLabel})]}),props.children]});return props.variant==="kicker"?body:/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("sec"),testID:"health-plan-checkup",children:body})}function HealthPlanExtras(props){let k2=useHealthPlanRnKit(props),{S:S}=k2,X=S.X,{bx:bx,tx:tx,tb:tb,im:im,mod:mod,ink:ink,side:side}=S.D;/* @__PURE__ */
|
|
270
283
|
return jsxRuntime.jsxs(reactNative.View,{style:bx("extras"),testID:"health-plan-extras",children:[
|
|
271
|
-
/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("extrasTitle"),accessibilityRole:"header",children:props.title}),props.items.map(({extra:x,price:
|
|
284
|
+
/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("extrasTitle"),accessibilityRole:"header",children:props.title}),props.items.map(({extra:x,price:price2,on:on,label:label,onPress:onPress})=>{let kind=mod("extra",x.kind);/* @__PURE__ */
|
|
272
285
|
return jsxRuntime.jsxs(reactNative.View,{style:bx("extra",kind),children:[x.imageUrl?planImg(x.imageUrl,im("extraImage",kind==="extraKit"&&"extraKitImage")):x.icon?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("extraIcon"),children:k2.icon(x.icon,ink("extraIcon",S.palette.teal),side("extraIconSvg",26))}):null,
|
|
273
286
|
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:gridCell(X.extra,1),children:[
|
|
274
287
|
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:{minHeight:x.imageUrl||x.icon?Number(X.extraImage.box.height??0):0},children:[
|
|
275
|
-
/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("extraTitle",x.kind==="kit"&&"extraTitleSerif"),children:x.title}),x.body?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("extraBody"),children:x.body}):null,
|
|
276
|
-
/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("extraPriceValue"),children:
|
|
288
|
+
/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("extraTitle",x.kind==="kit"&&"extraTitleSerif"),children:x.title}),x.body?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("extraBody"),children:x.body}):null,price2?/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("extraPrice"),children:[
|
|
289
|
+
/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("extraPriceValue"),children:price2}),x.was?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("extraPriceWas"),children:x.was}):null,planTag(k2,x.tag)]}):null]}),
|
|
277
290
|
/* @__PURE__ */jsxRuntime.jsx(reactNative.Pressable,{onPress:onPress,accessibilityRole:"button",accessibilityState:{selected:on},accessibilityLabel:label,style:pressScale([...bx("extraGo",on&&"extraGoOn"),{marginTop:Number(X.extraGo.box.marginTop??0)+Number(X.extra.box.rowGap??0)},START,CENTER2],PLAN_PRESS_SCALE.extraGo,false),children:/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"control",style:tx("extraGo",on&&"extraGoOn"),children:label})})]})]},x.key)})]})}function ConnectedHealthPlanToolbar(){let m=useConnectedHealthPlanModel();if(m===null||!m.hp.shop)return null;let{hp:hp}=m;/* @__PURE__ */
|
|
278
|
-
return jsxRuntime.jsx(HealthPlanToolbar,{eyebrow:
|
|
279
|
-
return jsxRuntime.jsx(HealthPlanHeader,{eyebrow:design.eyebrow
|
|
291
|
+
return jsxRuntime.jsx(HealthPlanToolbar,{eyebrow:void 0,cartCount:hp.lineCount,onOpenOrders:()=>hp.push({kind:"orders"}),onOpenCart:()=>hp.push({kind:"cart"})})}function ConnectedHealthPlanToast(){let m=useConnectedHealthPlanModel();return m===null?null:/* @__PURE__ */jsxRuntime.jsx(HealthPlanToast,{message:m.hp.toast})}function ConnectedHealthPlanHeader(){let m=useConnectedHealthPlanModel();if(m===null)return null;let{design:design}=m.props,subtitle=m.recordsMissing&&design.subtitleNoRecords?design.subtitleNoRecords:design.subtitle;/* @__PURE__ */
|
|
292
|
+
return jsxRuntime.jsx(HealthPlanHeader,{eyebrow:design.eyebrow||void 0,title:design.title,subtitle:subtitle,imageUrl:design.headImageUrl})}function ConnectedHealthPlanBlanks(){let m=useConnectedHealthPlanModel();if(m===null||!m.blanksShown||m.blanksFacts===null)return null;let{copy:copy,hp:hp,blanksFacts:blanksFacts,noPick:noPick}=m,pk=m.props.design.pick,kg=hp.kg,filled2=blanksFacts.phase==="filled",weightKg=blanksFacts.weightKg,marked=pk.dose?.stats.some(x=>x.kind!==void 0)===true,daily=(noPick?void 0:marked?pk.dose?.stats.find(x=>x.kind==="dose"):pk.dose?.stats[0])??(noPick||pk.doseLabel===void 0?void 0:{value:null,label:pk.doseLabel}),blankRows=[{key:"weight",lead:copy.blanksWeight,value:!filled2||weightKg===null?null:String(kg?Math.round(weightKg*10)/10:Math.round(weightKg*LB_PER_KG)),trail:` ${kg?copy.weightUnitKg:copy.weightUnit}`,source:copy.blanksWeightSource},...daily===void 0?[]:[{key:"dose",lead:"",value:filled2&&hp.weightKnown?daily.value:null,trail:` ${copy.blanksDose(daily.label,m.props.item.title)}`,source:copy.blanksDoseSource,width:"s"}],{key:"shots",lead:copy.blanksShots,value:filled2&&blanksFacts.nextShotsAt!==null?blanksDay(blanksFacts.nextShotsAt,m.props.locale):null,trail:"",source:copy.blanksShotsSource,width:"l"}],count=blankRows.filter(r=>r.value!==null).length;/* @__PURE__ */
|
|
280
293
|
return jsxRuntime.jsx(HealthPlanBlanks,{phase:blanksFacts.phase,kicker:filled2?copy.blanksFilledKicker:blanksFacts.clinicName!==null?copy.blanksAsked(blanksFacts.clinicName):copy.blanksAskedNoClinic,pill:filled2?copy.blanksFilled(count,blankRows.length):copy.blanksWaitPill,rows:blankRows,blankLabel:copy.blankEmpty,label:copy.blanksLabel,flashKey:hp.flashKey})}function ConnectedHealthPlanWaitCard(){let m=useConnectedHealthPlanModel();if(m===null)return null;if(m.waitNode!==null)/* @__PURE__ */return jsxRuntime.jsx(reactNative.View,{style:m.kit.S.D.bx("wait"),children:m.waitNode});let wait=m.props.design.wait;return wait?/* @__PURE__ */jsxRuntime.jsx(HealthPlanWaitCard,{wait:wait,onAction:m.props.onWaitAction,vetName:m.vet?.name??null}):null}function ConnectedHealthPlanByline(){let m=useConnectedHealthPlanModel();return m===null||!m.byline||m.waiting?null:/* @__PURE__ */jsxRuntime.jsx(HealthPlanByline,{vet:m.byline})}function ConnectedHealthPlanFocusCard(){let m=useConnectedHealthPlanModel(),f=m?.props.design.focus;if(m===null||!f||m.waiting)return null;let{hp:hp}=m,jump=f.jump&&!m.noPick?{title:f.jump.title,go:f.jump.go,kicker:hp.pr.box===null&&!hp.canSubscribe?null:m.copy.jumpKicker(hp.pr,hp.active),imageUrl:m.props.item.imageUrl,onJump:m.jump}:null;/* @__PURE__ */
|
|
281
294
|
return jsxRuntime.jsx(HealthPlanFocusCard,{focus:f,vet:m.vet,jump:jump})}function ConnectedHealthPlanTips(){let m=useConnectedHealthPlanModel(),routine=m?.props.design.routine;return m===null||!routine||m.waiting||m.numbers.routine===void 0?null:/* @__PURE__ */jsxRuntime.jsx(HealthPlanTips,{routine:routine,number:m.numbers.routine,vetShortName:m.vet?.shortName??null,pageWidth:m.pageWidth??void 0})}function ConnectedHealthPlanReviews(){let m=useConnectedHealthPlanModel(),reviews=m?.props.design.pick.reviews;return m===null||!reviews||reviews.items.length===0?null:/* @__PURE__ */jsxRuntime.jsx(HealthPlanReviews,{reviews:reviews,pageWidth:m.pageWidth??void 0})}function ConnectedHealthPlanWhyItFits(){let m=useConnectedHealthPlanModel(),why=m?.props.design.pick.why;return m===null||!why||why.rows.length===0?null:/* @__PURE__ */jsxRuntime.jsx(HealthPlanWhyItFits,{why:why})}function ConnectedHealthPlanDoseCard(){let m=useConnectedHealthPlanModel();if(m===null||m.otherSpecies)return null;let{copy:copy}=m;if(m.askWeight)/* @__PURE__ */return jsxRuntime.jsx(HealthPlanAskRow,{icon:"pulse",title:copy.addWeightTitle,body:copy.addWeightBody,onPress:m.hp.openWeight,testID:"health-plan-add-weight",inSection:true});let dose=m.props.design.pick.dose;return dose?/* @__PURE__ */jsxRuntime.jsx(HealthPlanDoseCard,{dose:dose}):null}function ConnectedHealthPlanIngredients(){let m=useConnectedHealthPlanModel(),ing=m?.props.design.pick.ingredients;return m===null||!ing||ing.items.length===0?null:/* @__PURE__ */jsxRuntime.jsx(HealthPlanIngredients,{ingredients:ing})}function ConnectedHealthPlanBuyOptions(){let m=useConnectedHealthPlanModel();if(m===null||!m.hp.canSubscribe||!m.hp.priced)return null;let{hp:hp}=m;/* @__PURE__ */
|
|
282
295
|
return jsxRuntime.jsx(HealthPlanBuyOptions,{mode:hp.buyMode,onModeChange:hp.setMode,prices:hp.pr,offer:hp.offer})}function ConnectedHealthPlanBuyButton(){let m=useConnectedHealthPlanModel();if(m===null)return null;let{hp:hp,copy:copy,props:props,pickInCart:pickInCart}=m,{pr:pr,priced:priced,buyMode:buyMode,sub:sub}=hp,item=props.item,loading=sub.phase==="loading"&&props.subscriptions!==false;return hp.shop?/* @__PURE__ */jsxRuntime.jsx(HealthPlanBuyButton,{label:pickInCart?copy.viewCart:priced?copy.addToCart((buyMode==="sub"?pr.first:pr.once)??""):HEALTH_PLAN_COPY.addToCart,onPress:()=>hp.addToCart(item,buyMode),disabled:loading||!priced&&!pickInCart}):/* @__PURE__ */jsxRuntime.jsx(HealthPlanBuyButton,{label:buyMode==="sub"?copy.subscribe:priced?copy.buyOnce(pr):copy.buyOnceOption,onPress:hp.press,disabled:loading||hp.redirecting||hp.everfur&&!priced||!hp.everfur&&!hp.canSubscribe&&!hp.partnerBuys})}function ConnectedHealthPlanProof(){let m=useConnectedHealthPlanModel(),proof=m?.props.design.pick.proof;return m===null||!proof||m.hp.active?null:/* @__PURE__ */jsxRuntime.jsx(HealthPlanProof,{text:proof})}function ConnectedHealthPlanTrustRow(){let m=useConnectedHealthPlanModel();return m===null||m.trust.length===0?null:/* @__PURE__ */jsxRuntime.jsx(HealthPlanTrustRow,{items:m.trust})}function ConnectedHealthPlanSubscribedBox(){let m=useConnectedHealthPlanModel();if(m===null)return null;let{hp:hp}=m,subscription=hp.subscription;return!hp.active||subscription===null?null:/* @__PURE__ */jsxRuntime.jsx(HealthPlanSubscribedBox,{prices:hp.pr,nextBoxDay:hp.nextBoxDay(subscription),onManage:()=>hp.openSheet({kind:"manage"})})}function ConnectedHealthPlanPickParts(){/* @__PURE__ */
|
|
@@ -296,7 +309,7 @@ return jsxRuntime.jsx(HealthPlanCheckup,{checkup:c,added:added,addLabel:addLabel
|
|
|
296
309
|
return jsxRuntime.jsx(HealthPlanAskRow,{icon:"file",title:copy.connectRecordsTitle,body:copy.connectRecordsBody,onPress:()=>{callHost(onConnect)},testID:"health-plan-connect-records",inSection:props.inSection===true})}function ConnectedHealthPlanSigns(){let m=useConnectedHealthPlanModel();if(m===null||m.waiting)return null;let{design:design}=m.props;if(design.signs){let callVetTitle=m.hp.noVet?m.copy.callAVet:m.recordsMissing?m.copy.callYourVet:void 0;/* @__PURE__ */
|
|
297
310
|
return jsxRuntime.jsxs(HealthPlanSigns,{signs:design.signs,number:m.numbers.signs??1,callVetTitle:callVetTitle,children:[
|
|
298
311
|
/* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanCheckup,{variant:"kicker"}),
|
|
299
|
-
/* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanConnectRecords,{inSection:true})]})}return design.checkup?/* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanCheckup,{variant:"section",children:/* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanConnectRecords,{inSection:true})}):/* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanConnectRecords,{})}function ConnectedHealthPlanExtras(){let m=useConnectedHealthPlanModel(),extras=m?.props.design.extras;if(m===null||!extras||!m.extrasShown)return null;let{hp:hp,copy:copy}=m,rows=[];for(let x of m.extraItems){let product=m.extraProduct(x);if(product===void 0&&m.props.onExtra===void 0)continue;let on=product!==void 0?hp.shop&&hp.inCart(product.productId)!==void 0:hp.extras.has(x.key),
|
|
312
|
+
/* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanConnectRecords,{inSection:true})]})}return design.checkup?/* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanCheckup,{variant:"section",children:/* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanConnectRecords,{inSection:true})}):/* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanConnectRecords,{})}function ConnectedHealthPlanExtras(){let m=useConnectedHealthPlanModel(),extras=m?.props.design.extras;if(m===null||!extras||!m.extrasShown)return null;let{hp:hp,copy:copy}=m,rows=[];for(let x of m.extraItems){let product=m.extraProduct(x);if(product===void 0&&m.props.onExtra===void 0)continue;let on=product!==void 0?hp.shop&&hp.inCart(product.productId)!==void 0:hp.extras.has(x.key),price2=x.price??(product!==void 0?hp.fmtWhole(product.price,product.currency):null),label=product!==void 0&&on?copy.viewCart:on?x.added:x.action;rows.push({extra:x,price:price2,on:on,label:label,onPress:()=>hp.pressExtra(x.key,product,on)})}/* @__PURE__ */
|
|
300
313
|
return jsxRuntime.jsx(HealthPlanExtras,{title:extras.title,items:rows})}function ConnectedHealthPlanFine(){let m=useConnectedHealthPlanModel(),fine3=m?.props.design.fine;return m===null||!fine3?null:/* @__PURE__ */jsxRuntime.jsx(HealthPlanFine,{text:fine3})}function blanksDay(ms,locale){let d=new Date(ms);try{return new Intl.DateTimeFormat(locale??"en-US",{month:"short",day:"numeric",year:"numeric",timeZone:"UTC"}).format(d)}catch{return d.toISOString().slice(0,10)}}function nextIcon(k2,name){let{ink:ink,side:side}=k2.S.D;return k2.icon(name,ink("nextIcon",k2.S.X.roles.link??""),side("nextIconSvg",19))}function doneCheck(k2){let{bx:bx,ink:ink,side:side}=k2.S.D;/* @__PURE__ */
|
|
301
314
|
return jsxRuntime.jsx(reactNative.View,{style:bx("doneCheck"),children:k2.icon("check",ink("doneCheck",k2.S.palette.ink),side("doneCheckSvg",38))})}function nextRow(k2,r){let{bx:bx,tx:tx,tb:tb,im:im}=k2.S.D,X=k2.S.X,tile2=r.imageUrl?planImg(r.imageUrl,im("nextIconImage")):nextIcon(k2,r.icon);/* @__PURE__ */
|
|
302
315
|
return jsxRuntime.jsxs(reactNative.View,{style:bx("nextRow"),children:[
|
|
@@ -312,21 +325,21 @@ return jsxRuntime.jsxs(reactNative.View,{style:bx("done"),testID:"health-plan-pl
|
|
|
312
325
|
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("next"),accessibilityLabel:copy.placedSteps,children:props.rows.map(r=>nextRow(k2,r))}),props.total!==null?shopSummary(k2,props.total):null,props.note?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("shopFine","shopFineCenter"),children:props.note}):null]})}function HealthPlanCart(props){let k2=useHealthPlanRnKit(props);return shopCartBody(k2,props.lines,props.subtotal,props.renew,props.petPrices,props.handlers)}function HealthPlanOrders(props){let k2=useHealthPlanRnKit(props);return shopOrdersBody(k2,props)}function HealthPlanOrder(props){let k2=useHealthPlanRnKit(props);return shopOrderBody(k2,props)}function HealthPlanBackRow(props){let k2=useHealthPlanRnKit(props),{S:S,copy:copy}=k2;/* @__PURE__ */
|
|
313
326
|
return jsxRuntime.jsxs(reactNative.Pressable,{onPress:props.onBack,accessibilityRole:"button",accessibilityLabel:copy.back,style:S.back,testID:"health-plan-back",children:[
|
|
314
327
|
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:{transform:[{scaleX:-1}]},children:k2.icon("chev")}),
|
|
315
|
-
/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"control",style:S.toolLabel,children:copy.back})]})}function HealthPlanSheetFrame(props){let k2=useHealthPlanRnKit(props),window=reactNative.useWindowDimensions(),{S:S,copy:copy,icon:icon,still:still}=k2,close=props.onClose,body=props.children??null,kicker=props.kicker;/* @__PURE__ */
|
|
328
|
+
/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"control",style:S.toolLabel,children:copy.back})]})}var SR_ONLY2={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",borderWidth:0},PLACE_KEYS=/* @__PURE__ */new Set(["position","top","bottom","left","right","zIndex"]),SAFE_GAP=12;function HealthPlanSheetFrame(props){let k2=useHealthPlanRnKit(props),window=reactNative.useWindowDimensions(),{S:S,copy:copy,icon:icon,still:still}=k2,close=props.onClose,body=props.children??null,kicker=props.kicker,{bx:bx,tx:tx,ink:ink,side:side}=S.D,insets=reactNativeSafeAreaContext.useSafeAreaInsets(),sheetBox=Object.fromEntries(Object.entries(S.X.sheet.box).filter(([key])=>!PLACE_KEYS.has(key))),foot=Math.max(Number(sheetBox.paddingBottom??0),insets.bottom+SAFE_GAP);/* @__PURE__ */
|
|
316
329
|
return jsxRuntime.jsx(PlanLinger,{motions:[SCRIM_MOTION,still?FADE_MOTION:SHEET_MOTION],draw:body===null?null:([scrimOn,sheetOn])=>/* @__PURE__ */jsxRuntime.jsx(reactNative.Modal,{visible:true,transparent:true,animationType:"none",onRequestClose:close,testID:"health-plan-sheet",children:/* @__PURE__ */jsxRuntime.jsx(reactNative.KeyboardAvoidingView,{behavior:reactNative.Platform.OS==="ios"?"padding":void 0,style:{flex:1},testID:"health-plan-sheet-keyboard",children:/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:[S.scrim,{backgroundColor:"transparent"}],children:[
|
|
317
330
|
/* @__PURE__ */jsxRuntime.jsx(reactNative.Animated.View,{pointerEvents:"none",style:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:S.palette.scrim,opacity:scrimOn}}),
|
|
318
331
|
/* @__PURE__ */jsxRuntime.jsx(reactNative.Pressable,{style:{flex:1},onPress:close,accessibilityRole:"button",accessibilityLabel:copy.close}),
|
|
319
|
-
/* @__PURE__ */jsxRuntime.jsxs(reactNative.Animated.View,{style:[
|
|
320
|
-
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:
|
|
321
|
-
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:
|
|
322
|
-
/* @__PURE__ */jsxRuntime.jsx(Text,{style:
|
|
323
|
-
/* @__PURE__ */jsxRuntime.jsx(reactNative.Pressable,{onPress:close,accessibilityRole:"button",accessibilityLabel:copy.close,style:
|
|
324
|
-
/* @__PURE__ */jsxRuntime.jsx(reactNative.ScrollView,{keyboardShouldPersistTaps:"handled",children:body})]})]})})})})}function productBlock(k2,item,line){let{bx:bx,tb:tb}=k2.S.D;/* @__PURE__ */
|
|
332
|
+
/* @__PURE__ */jsxRuntime.jsxs(reactNative.Animated.View,{style:[sheetBox,{paddingBottom:foot},still||sheetOn===void 0?{opacity:sheetOn}:{transform:[{translateY:sheetOn.interpolate({inputRange:[0,1],outputRange:[window.height,0]})}]}],accessibilityViewIsModal:true,children:[
|
|
333
|
+
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("sheetGrab")}),
|
|
334
|
+
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("sheetTop"),children:[
|
|
335
|
+
/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"compact",style:tx("sheetKicker"),children:kicker}),
|
|
336
|
+
/* @__PURE__ */jsxRuntime.jsx(reactNative.Pressable,{onPress:close,accessibilityRole:"button",accessibilityLabel:copy.close,style:bx("sheetClose"),testID:"health-plan-sheet-close",children:icon("x",ink("sheetClose",S.palette.ink),side("sheetCloseSvg",22))})]}),
|
|
337
|
+
/* @__PURE__ */jsxRuntime.jsx(reactNative.ScrollView,{keyboardShouldPersistTaps:"handled",children:body})]})]})})})})}var PRODUCT_SHOT_CO={width:"100%",height:"100%"};function productBlock(k2,item,line){let{bx:bx,tb:tb}=k2.S.D;/* @__PURE__ */
|
|
325
338
|
return jsxRuntime.jsxs(reactNative.View,{style:bx("coProduct"),children:[
|
|
326
|
-
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[...bx("coProductImage"),gridCell(k2.S.X.coProduct,0)],children:item.imageUrl?planImg(item.imageUrl,
|
|
339
|
+
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[...bx("coProductImage"),gridCell(k2.S.X.coProduct,0)],children:item.imageUrl?planImg(item.imageUrl,PRODUCT_SHOT_CO,"contain"):null}),
|
|
327
340
|
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:gridCell(k2.S.X.coProduct,1),children:[
|
|
328
341
|
/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("coProductTitle"),children:item.title}),line===""?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("coProductLine"),children:line})]})]})}function intervalsBlock(k2,options,selected,busy,pick2){let{bx:bx,tx:tx,inner:inner}=k2.S.D;/* @__PURE__ */
|
|
329
|
-
return jsxRuntime.jsxs(reactNative.View,{style:bx("every"),accessibilityRole:"radiogroup",accessibilityLabel:k2.copy.shipsEvery,children:[inner("every"),options.map((d,i)=>/* @__PURE__ */jsxRuntime.jsx(reactNative.Pressable,{onPress:busy?void 0:()=>pick2(d),disabled:busy,accessibilityRole:"radio",accessibilityState:{checked:selected===d,disabled:busy},accessibilityLabel:k2.copy.days(d),style:[...bx("everyButton",selected===d&&"everyButtonOn"),gridCell(k2.S.X.every,i),{justifyContent:"center"}],testID:`health-plan-every-${d}`,children:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("everyButton",selected===d&&"everyButtonOn"),children:k2.copy.days(d)})},d))]})}function coOption(k2,o){let X=k2.S.X,{bx:bx,tx:tx,inner:inner}=k2.S.D,first=X.coOptionHit.grid[0],coIndent=(typeof first=="number"?first:0)+(typeof X.coOptionHit.box.columnGap=="number"?X.coOptionHit.box.columnGap:0);/* @__PURE__ */
|
|
342
|
+
return jsxRuntime.jsxs(reactNative.View,{style:bx("every"),accessibilityRole:"radiogroup",accessibilityLabel:k2.copy.shipsEvery,children:[inner("every"),options.map((d,i)=>/* @__PURE__ */jsxRuntime.jsx(reactNative.Pressable,{onPress:busy?void 0:()=>pick2(d),disabled:busy,accessibilityRole:"radio",accessibilityState:{checked:selected===d,disabled:busy},accessibilityLabel:k2.copy.days(d),style:[...bx("everyButton",selected===d&&"everyButtonOn"),gridCell(k2.S.X.every,i),{justifyContent:"center"}],testID:`health-plan-every-${d}`,children:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("everyButton",selected===d&&"everyButtonOn"),numberOfLines:1,adjustsFontSizeToFit:true,children:k2.copy.days(d)})},d))]})}function coOption(k2,o){let X=k2.S.X,{bx:bx,tx:tx,inner:inner}=k2.S.D,first=X.coOptionHit.grid[0],coIndent=(typeof first=="number"?first:0)+(typeof X.coOptionHit.box.columnGap=="number"?X.coOptionHit.box.columnGap:0);/* @__PURE__ */
|
|
330
343
|
return jsxRuntime.jsxs(reactNative.View,{style:bx("coOption",o.on&&"coOptionOn"),children:[inner("coOption",o.on&&"coOptionOn"),
|
|
331
344
|
/* @__PURE__ */jsxRuntime.jsxs(reactNative.Pressable,{onPress:o.onPress,accessibilityRole:"radio",accessibilityState:{checked:o.on},accessibilityLabel:o.label,style:[...bx("coOptionHit"),{flexWrap:"wrap"}],testID:o.testID,children:[
|
|
332
345
|
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[...bx("coRadio"),gridCell(X.coOptionHit,0)],children:inner("coRadio",o.on&&"coRadioOn")}),
|
|
@@ -334,9 +347,9 @@ return jsxRuntime.jsxs(reactNative.View,{style:bx("coOption",o.on&&"coOptionOn")
|
|
|
334
347
|
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:gridCell(X.coOptionHit,2),children:[
|
|
335
348
|
/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("coOptionPrice"),children:o.price??""}),o.was===null?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("coOptionPriceWas"),children:o.was})]}),o.line===null?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:[...tx("coOptionSmall"),{width:"100%",paddingLeft:coIndent}],children:o.line})]}),o.after]})}function HealthPlanCheckoutSheet(props){let k2=useHealthPlanRnKit(props),{S:S,copy:copy}=k2,{bx:bx,tb:tb}=S.D,cp=props.prices,isSub=props.mode==="sub",today=isSub?cp.first:cp.once,coFine=[isSub?copy.renews(cp):copy.onceFine,copy.checkoutNote].filter(x=>x!=="").join(" ");/* @__PURE__ */
|
|
336
349
|
return jsxRuntime.jsxs(reactNative.View,{style:bx("co"),testID:"health-plan-checkout-sheet",children:[
|
|
337
|
-
/* @__PURE__ */jsxRuntime.jsx(Text,{style:
|
|
350
|
+
/* @__PURE__ */jsxRuntime.jsx(Text,{style:SR_ONLY2,accessibilityRole:"header",testID:"health-plan-checkout-title",children:copy.checkoutTitle(cp)}),productBlock(k2,props.item,props.line),
|
|
338
351
|
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("coOptions"),accessibilityRole:"radiogroup",accessibilityLabel:copy.optionsLabel,children:[coOption(k2,{on:isSub,label:copy.subscribe,price:cp.first,was:props.offer?cp.box:null,line:props.offer?copy.checkoutOffer(cp):null,onPress:()=>props.onModeChange("sub"),testID:"health-plan-co-sub",after:isSub?/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("coWhen"),children:[
|
|
339
|
-
/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("coKicker"),children:copy.shipsEvery}),intervalsBlock(k2,props.intervals,props.every,props.busy,props.onEveryChange)]}):null}),coOption(k2,{on:!isSub,label:copy.buyOnceOption,price:cp.once,was:cp.onceDiscountPercent>0?cp.box:null,line:props.oneBoxOffer?copy.onceOffer(cp):null,onPress:()=>props.onModeChange("once"),testID:"health-plan-co-once"})]}),shopRows(k2,props.rows),shopButton(k2,copy.checkoutGo(cp,isSub,today??""),props.onConfirm,{disabled:props.confirmDisabled,testID:"health-plan-checkout-go"}),coFine===""?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("coFine"),children:coFine})]})}function HealthPlanManageSheet(props){let k2=useHealthPlanRnKit(props),{S:S,copy:copy}=k2,{bx:bx,tb:tb}=S.D,mp=props.prices,seeOrders=props.onSeeOrders??null;/* @__PURE__ */
|
|
352
|
+
/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("coKicker"),children:copy.shipsEvery}),intervalsBlock(k2,props.intervals,props.every,props.busy,props.onEveryChange)]}):null}),coOption(k2,{on:!isSub,label:copy.buyOnceOption,price:cp.once,was:cp.onceDiscountPercent>0?cp.box:null,line:props.oneBoxOffer?copy.onceOffer(cp):null,onPress:()=>props.onModeChange("once"),testID:"health-plan-co-once"})]}),shopRows(k2,props.rows),shopButton(k2,copy.checkoutGo(cp,isSub,today??""),props.onConfirm,{disabled:props.confirmDisabled,testID:"health-plan-checkout-go",part:"coButton"}),coFine===""?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("coFine"),children:coFine})]})}function HealthPlanManageSheet(props){let k2=useHealthPlanRnKit(props),{S:S,copy:copy}=k2,{bx:bx,tb:tb}=S.D,mp=props.prices,seeOrders=props.onSeeOrders??null;/* @__PURE__ */
|
|
340
353
|
return jsxRuntime.jsxs(reactNative.View,{style:bx("co"),testID:"health-plan-manage-sheet",children:[
|
|
341
354
|
/* @__PURE__ */jsxRuntime.jsx(Text,{style:S.h3,accessibilityRole:"header",children:copy.manageTitle(mp)}),productBlock(k2,props.item,copy.subscribedLine(mp,props.nextBoxDay)),
|
|
342
355
|
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{children:[
|
|
@@ -350,12 +363,21 @@ return jsxRuntime.jsxs(reactNative.View,{style:{gap:12},testID:"health-plan-weig
|
|
|
350
363
|
/* @__PURE__ */jsxRuntime.jsx(reactNative.TextInput,{value:props.value,onChangeText:props.onChange,keyboardType:"decimal-pad",placeholder:"0.0",accessibilityLabel:copy.weightField,onSubmitEditing:props.onSave,onFocus:()=>setWeightFocused(true),onBlur:()=>setWeightFocused(false),style:[...bx("weightInput"),...tx("weightInput")],testID:"health-plan-weight-input"}),inner("weightInput",weightFocused&&"weightInputFocus"),
|
|
351
364
|
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{pointerEvents:"none",style:[...bx("weightUnit"),{top:0,bottom:0,justifyContent:"center"}],children:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("weightUnit"),children:props.unit==="kg"?copy.weightUnitKg:copy.weightUnit})})]})]}),props.error===""?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("weightError"),accessibilityLiveRegion:"polite",testID:"health-plan-weight-error",children:props.error}),
|
|
352
365
|
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("weightActions"),children:shopButton(k2,copy.weightSave,props.onSave,{disabled:props.saving,testID:"health-plan-weight-save"})})]})}var PAY_WITH="Pay with";function sheetOf(m,only){let{hp:hp,copy:copy,props:props,rows:rows}=m,{sheet:sheet,quote:quote,subscription:subscription,sub:sub,redirecting:redirecting}=hp,item=props.item,pk=props.design.pick;if(sheet===null||only!==void 0&&sheet.kind!==only)return null;let intervals=quote?.intervalOptions??subscription?.intervalOptions??[];if(sheet.kind==="checkout"&"e!==null)return{kicker:copy.checkoutKicker,body:/* @__PURE__ */jsxRuntime.jsx(HealthPlanCheckoutSheet,{item:item,line:pk.checkoutLine??pk.line??item.description??"",prices:hp.prices(sheet.every),mode:sheet.mode,every:sheet.every,intervals:intervals,offer:hp.offer,oneBoxOffer:hp.oneBox!==null,rows:rows,busy:sub.busy,confirmDisabled:sub.busy||redirecting,onModeChange:mode=>hp.openSheet({...sheet,mode:mode}),onEveryChange:every=>hp.openSheet({...sheet,every:every}),onConfirm:()=>{hp.confirmCheckout()}})};if(sheet.kind==="manage"&&subscription!==null&&hp.active)return{kicker:copy.manageKicker,body:/* @__PURE__ */jsxRuntime.jsx(HealthPlanManageSheet,{item:item,prices:hp.prices(subscription.intervalDays),nextBoxDay:hp.nextBoxDay(subscription),every:subscription.intervalDays,intervals:intervals,busy:sub.busy,onEveryChange:hp.changeInterval,onSkip:()=>{hp.skip()},onCancel:()=>{hp.cancel()},onSeeOrders:hp.shop?hp.seeOrdersFromManage:null})};if(sheet.kind==="cartCheckout"&&hp.batch.length>0){let{fmt:fmt,currency:currency,lines:lines,unitOf:unitOf,isPick:isPick,itemOf:itemOf2}=hp,total=fmt(hp.batchTotal,currency)??"";return{kicker:copy.checkoutKicker,body:/* @__PURE__ */jsxRuntime.jsx(HealthPlanCartCheckout,{lines:hp.batch.map(hp.lineView),lineTotal:x=>{let line=lines.find(l=>l.productId===x.key),unit=line===void 0?null:unitOf(line);return unit===null||line===void 0?null:fmt(Math.round(unit*line.qty*100)/100,isPick(line.productId)?currency:itemOf2(line.productId)?.currency??currency)},rows:rows,total:total,renew:hp.batchRenew,place:{label:copy.placeOrder(total,hp.batchSub!==null),disabled:!hp.cartReady||sub.busy||redirecting,onPress:()=>{hp.placeCart()}},fine:[copy.cartFine(hp.batchRenew),hp.apart?copy.cartSubscriptionApart:"",copy.checkoutNote].filter(x=>x!=="").join(" ")})}}return sheet.kind==="weight"?{kicker:copy.weightKicker,body:/* @__PURE__ */jsxRuntime.jsx(HealthPlanWeightSheet,{prices:hp.pr,value:hp.weightInput,onChange:hp.setWeightInput,error:hp.weightError,saving:hp.savingWeight,unit:hp.kg?"kg":"lb",onSave:()=>{hp.saveWeight()}})}:null}function ConnectedHealthPlanSheet(){let m=useConnectedHealthPlanModel();if(m===null)return null;let open=sheetOf(m);/* @__PURE__ */
|
|
353
|
-
return jsxRuntime.jsx(HealthPlanSheetFrame,{kicker:open?.kicker??"",onClose:m.hp.closeSheet,children:open?.body??null})}function ConnectedHealthPlanCheckoutSheet(){let m=useConnectedHealthPlanModel();return m===null?null:sheetOf(m,"checkout")?.body??null}function ConnectedHealthPlanManageSheet(){let m=useConnectedHealthPlanModel();return m===null?null:sheetOf(m,"manage")?.body??null}function ConnectedHealthPlanCartCheckout(){let m=useConnectedHealthPlanModel();return m===null?null:sheetOf(m,"cartCheckout")?.body??null}function ConnectedHealthPlanWeightSheet(){let m=useConnectedHealthPlanModel();return m===null?null:sheetOf(m,"weight")?.body??null}function ConnectedHealthPlanStarted(){let m=useConnectedHealthPlanModel(),started=m?.hp.started??null;if(m===null||started===null)return null;let{hp:hp,copy:copy,props:props}=m,pk=props.design.pick,
|
|
354
|
-
return jsxRuntime.jsx(HealthPlanStarted,{title:
|
|
366
|
+
return jsxRuntime.jsx(HealthPlanSheetFrame,{kicker:open?.kicker??"",onClose:m.hp.closeSheet,children:open?.body??null})}function ConnectedHealthPlanCheckoutSheet(){let m=useConnectedHealthPlanModel();return m===null?null:sheetOf(m,"checkout")?.body??null}function ConnectedHealthPlanManageSheet(){let m=useConnectedHealthPlanModel();return m===null?null:sheetOf(m,"manage")?.body??null}function ConnectedHealthPlanCartCheckout(){let m=useConnectedHealthPlanModel();return m===null?null:sheetOf(m,"cartCheckout")?.body??null}function ConnectedHealthPlanWeightSheet(){let m=useConnectedHealthPlanModel();return m===null?null:sheetOf(m,"weight")?.body??null}function ConnectedHealthPlanStarted(){let m=useConnectedHealthPlanModel(),started=m?.hp.started??null;if(m===null||started===null)return null;let{hp:hp,copy:copy,props:props}=m,pk=props.design.pick,run3=started.kind==="sub"?started.sub:null,boughtId=started.kind==="sub"?started.sub.productId:started.order.productId,boughtItem=hp.planItems.find(x=>x.productId===boughtId)??props.item,sp=hp.prices(run3?.intervalDays??hp.every,boughtItem.title),label=(step,first)=>step.step==="first_box_ships"&&first?copy.tomorrow:hp.day(step.on)??step.on,steps=run3===null?[{icon:"truck",when:copy.tomorrow,what:copy.firstBoxShips}]:run3.timeline.map((step,i)=>{switch(step.step){case"first_box_ships":return{icon:"truck",when:label(step,i===0),what:copy.firstBoxShips};case"checkin":return{icon:"chat",when:label(step,false),what:copy.checkin(pk.checkin??null)};case"refill_reminder":return{icon:"repeat",when:label(step,false),what:copy.refill};default:return{icon:"calendar",when:label(step,false),what:copy.nextBoxShips(sp)}}});/* @__PURE__ */
|
|
367
|
+
return jsxRuntime.jsx(HealthPlanStarted,{title:run3===null?copy.orderedTitle(sp):copy.startedTitle(sp),what:copy.startedWhat(sp),note:copy.startedNote,steps:steps.map(r=>({key:`${r.icon}${r.when}`,...r}))})}function ConnectedHealthPlanCart(){let m=useConnectedHealthPlanModel();if(m===null||m.hp.started!==null||m.hp.top?.kind!=="cart")return null;let{hp:hp}=m;/* @__PURE__ */
|
|
355
368
|
return jsxRuntime.jsx(HealthPlanCart,{lines:hp.views,subtotal:hp.fmt(hp.cartTotal,hp.currency)??"",renew:hp.renewPrices,petPrices:hp.pr,handlers:{onQuantity:hp.stepQuantity,onRemove:hp.removeLine,onMode:(key,mode)=>hp.editLine(key,x=>({...x,mode:mode,qty:1})),onEvery:(key,d)=>hp.editLine(key,x=>({...x,every:d})),onOrders:()=>hp.push({kind:"orders"})}})}function subCardOf(m){let{hp:hp,props:props}=m,subscription=hp.subscription;return subscription!==null&&hp.active?{name:subscription.title??props.item.title,imageUrl:props.item.imageUrl??null,next:hp.nextBoxDay(subscription),every:subscription.intervalDays,onManage:()=>hp.openSheet({kind:"manage"})}:null}function ConnectedHealthPlanOrders(){let m=useConnectedHealthPlanModel();if(m===null||m.hp.started!==null||m.hp.top?.kind!=="orders")return null;let{hp:hp}=m,locale=m.props.locale;/* @__PURE__ */
|
|
356
369
|
return jsxRuntime.jsx(HealthPlanOrders,{subscription:subCardOf(m),orders:m.allOrders,loaded:hp.everfurOrders.loaded,fmt:(amount,cur)=>hp.fmt(amount,cur),day:iso=>formatShopDay(iso,locale),onOpen:key=>hp.push({kind:"order",key:key}),onBack:hp.closeOverlays,petPrices:hp.pr,more:hp.everfurOrders.next===null?null:{onMore:hp.moreOrders,loading:hp.everfurOrders.loading}})}function ConnectedHealthPlanOrder(){let m=useConnectedHealthPlanModel(),top=m?.hp.top;if(m===null||m.hp.started!==null||top?.kind!=="order")return null;let{hp:hp,copy:copy,props:props}=m,order=m.allOrders.find(o=>o.key===top.key);if(order===void 0)return null;let again=order.everfur===true&&order.productId!==null?hp.itemOf(order.productId):void 0,onHelp=props.onOrderHelp;/* @__PURE__ */
|
|
357
370
|
return jsxRuntime.jsx(HealthPlanOrder,{order:order,fmt:(amount,cur)=>hp.fmt(amount,cur),day:iso=>formatShopDay(iso,props.locale),rows:m.rows.map(r=>r.label===PAY_WITH?{...r,label:copy.paidWith}:r),onBuyAgain:again===void 0?null:()=>hp.addToCart(again,"once"),onHelp:onHelp?()=>{callHost(onHelp,order.key)}:null})}function one(xs){let known=[...new Set(xs.filter(x=>x!=null))];return known.length===1?known[0]??null:null}function ConnectedHealthPlanPlaced(){let m=useConnectedHealthPlanModel(),top=m?.hp.top;if(m===null||m.hp.started!==null||top?.kind!=="placed")return null;let{hp:hp,copy:copy,props:props}=m,placedOrders=top.orders,first=placedOrders[0],op=hp.prices(hp.every,first?.title??(first?hp.itemOf(first.productId)?.title:void 0)??props.item.title),placedNo=one(placedOrders.map(o=>o.tracking?.orderNumber)),arrives=placedOrders.length>0&&placedOrders.every(o=>o.tracking?.estimatedDelivery)?one(placedOrders.map(o=>o.tracking?.estimatedDelivery)):null,arrivesDay=hp.day(arrives),placedCurrency=one(placedOrders.map(o=>o.currency)),placedTotal=placedCurrency===null?null:hp.fmt(Math.round(placedOrders.reduce((sum,o)=>sum+(o.total??o.price),0)*100)/100,placedCurrency),rows=[...placedOrders.map(o=>{let it=hp.itemOf(o.productId);return{key:o.orderId,icon:"box",imageUrl:it?.imageUrl??null,when:copy.cartItemQuantity(o.quantity??1),what:o.title??it?.title??"",product:true}}),{key:"ships",icon:"truck",when:copy.tomorrow,what:hp.withTracking(copy.placedShips)},...arrivesDay===null?[]:[{key:"arrives",icon:"calendar",when:arrivesDay,what:copy.placedArrives}]];/* @__PURE__ */
|
|
358
|
-
return jsxRuntime.jsx(HealthPlanPlaced,{title:copy.orderedTitle(op),arrives:arrivesDay,orderNumber:placedNo,rows:rows,total:placedOrders.length>1&&placedTotal!==null?placedTotal:null,note:copy.startedNote})}var
|
|
371
|
+
return jsxRuntime.jsx(HealthPlanPlaced,{title:copy.orderedTitle(op),arrives:arrivesDay,orderNumber:placedNo,rows:rows,total:placedOrders.length>1&&placedTotal!==null?placedTotal:null,note:copy.startedNote})}var frozen=items=>/* @__PURE__ */Object.freeze(items.map(i=>/* @__PURE__ */Object.freeze(i)));function defined(obj2){let out={};for(let[k2,v]of Object.entries(obj2))v!==void 0&&(out[k2]=v);return out}function slotNeeds(design){let f=design?.focus;if(!f)return frozen([]);let vet=design?.byline,kind=f.risk?.kind,tone=kind==="risk"||kind==="watch"||kind==="clear"?kind:void 0;return frozen([defined({kicker:f.kicker,sources:f.sources?.map(s=>({label:s.label,kind:s.kind==="dna"?"dna":"records"})),title:f.title,signals:f.risk?[{key:"risk",lead:f.risk.lead,text:f.risk.body??"",tone:tone,dot:tone===void 0?"space":true}]:[],score:f.odds?{label:f.odds.label,tag:f.odds.tag,was:f.odds.from,now:f.odds.to,since:f.odds.toLabel}:void 0,quote:f.quote&&vet?{text:f.quote.text,by:vet.shortName??void 0,image:vet.imageUrl??null,tag:f.quote.tag}:void 0})])}function slotTips(design){let steps=design?.routine?.steps??[],short=design?.byline?.shortName;return frozen(steps.map((s,i)=>defined({key:s.title,number:String(i+1),title:s.title,text:s.body||void 0,foot:s.fromVet?short?HEALTH_PLAN_FOCUS_COPY.fromVet(short):void 0:s.source??void 0,tone:s.tone??"y"})))}function price(item,locale){return formatHealthPlanPrice(item.price,item.currency,locale)??void 0}function slotProductItems(items,locale){return frozen(items.map(item=>defined({key:item.productId,name:item.title,image:item.imageUrl,imageAlt:item.title,kicker:item.category??void 0,price:price(item,locale),badge:item.sample?HEALTH_PLAN_COPY.sample:void 0})))}var SLOT_SCHEMA="everfur.slot/1";var BAD=/* @__PURE__ */Symbol("bad");function isRec(v){return v!==null&&typeof v=="object"&&!Array.isArray(v)}function str6(v,min,max){return typeof v=="string"&&v.length>=min&&v.length<=max?v:BAD}function optStr(v,max){return v==null?void 0:str6(v,0,max)}function rec(v){return v===void 0?{}:isRec(v)?v:BAD}function strMap(v){let r=rec(v);if(r===BAD)return BAD;for(let value of Object.values(r))if(typeof value!="string")return BAD;return r}function int2(v,min,max){return typeof v=="number"&&Number.isInteger(v)&&v>=min&&v<=max?v:BAD}function readFallback(v){if(v==null)return;if(v==="hide")return"hide";if(!isRec(v))return BAD;let type=str6(v.type,1,64),variant=optStr(v.variant,64),settings=rec(v.settings),bind=strMap(v.bind),actions=strMap(v.actions);return type===BAD||variant===BAD||settings===BAD||bind===BAD||actions===BAD?BAD:/* @__PURE__ */Object.freeze({type:type,...variant?{variant:variant}:{},settings:/* @__PURE__ */Object.freeze({...settings}),bind:/* @__PURE__ */Object.freeze({...bind}),actions:/* @__PURE__ */Object.freeze({...actions})})}function readVisibleIf(v){if(v==null)return;if(!isRec(v))return BAD;let source=str6(v.source,0,80);return source===BAD||v.op!=="present"&&v.op!=="absent"?BAD:/* @__PURE__ */Object.freeze({source:source,op:v.op})}function readPart(v){if(!isRec(v))return BAD;let id=str6(v.id,1,64),type=str6(v.type,1,64),variant=optStr(v.variant,64),settings=rec(v.settings),bind=strMap(v.bind),repeat=optStr(v.repeat,80),visibleIf=readVisibleIf(v.visibleIf),actions=strMap(v.actions),fallback=readFallback(v.fallback);return id===BAD||type===BAD||variant===BAD||settings===BAD||bind===BAD||repeat===BAD||visibleIf===BAD||actions===BAD||fallback===BAD?BAD:/* @__PURE__ */Object.freeze({id:id,type:type,...variant?{variant:variant}:{},settings:/* @__PURE__ */Object.freeze({...settings}),bind:/* @__PURE__ */Object.freeze({...bind}),...repeat?{repeat:repeat}:{},...visibleIf?{visibleIf:visibleIf}:{},actions:/* @__PURE__ */Object.freeze({...actions}),...fallback?{fallback:fallback}:{}})}var SCHEMA_ID=/^everfur\.slot\/(\d{1,4})$/,MARKUP=/<\s*[A-Za-z/!?]|&[A-Za-z#][A-Za-z0-9]*;/,CONTROL=/[\u0000-\u0008\u000b-\u001f\u007f\u2028\u2029]/,TOKEN_NAME=/^[a-z][a-zA-Z0-9]*(\.[a-zA-Z0-9]+){0,4}$/,HEX_COLOR=/^#[0-9a-fA-F]{6}$/,TOKEN_LIMIT=1e4;function utf8Length(text2){let bytes=0;for(let i=0;i<text2.length;i++){let code=text2.charCodeAt(i);code<128?bytes+=1:code<2048?bytes+=2:code>=55296&&code<=56319&&i+1<text2.length?(bytes+=4,i++):bytes+=3}return bytes}function isPlainText(text2){return text2.trim()!==""&&!MARKUP.test(text2)&&!CONTROL.test(text2)}function sizeOf(raw){try{return utf8Length(JSON.stringify(raw)??"")}catch{return Number.POSITIVE_INFINITY}}function schemaRefusal(raw){let id=raw!==null&&typeof raw=="object"?raw.schema:void 0;if(typeof id!="string")return"unparseable";let m=SCHEMA_ID.exec(id);return m===null?"unparseable":Number(m[1])>1?"newer_schema":null}function tokensOf(raw){let out={};for(let[name,value]of Object.entries(raw))TOKEN_NAME.test(name)&&(typeof value=="string"&&HEX_COLOR.test(value)||typeof value=="number"&&Number.isFinite(value)&&Math.abs(value)<=TOKEN_LIMIT)&&(out[name]=value);/* @__PURE__ */
|
|
372
|
+
return Object.freeze(out)}function copyOf(raw){let out={};for(let[key,entry]of Object.entries(raw)){let text2=typeof entry=="string"?entry:entry!==null&&typeof entry=="object"?entry.text:void 0;typeof text2=="string"&&text2.length<=500&&isPlainText(text2)&&(out[key]=text2)}/* @__PURE__ */
|
|
373
|
+
return Object.freeze(out)}function parseSlotDoc(raw,slot){if(sizeOf(raw)>65536)return{ok:false,reason:"too_large"};let refusal=schemaRefusal(raw);if(refusal!==null)return{ok:false,reason:refusal};let d=raw,docSlot=str6(d.slot,3,64),docVersion=d.docVersion===void 0||d.docVersion===null?null:int2(d.docVersion,1,Number.MAX_SAFE_INTEGER),minBlocks=d.minBlocks===void 0?1:int2(d.minBlocks,0,50),theme=d.theme===void 0||d.theme===null?{}:rec(d.theme),tokens=theme===BAD?BAD:rec(theme.tokens),copy=rec(d.copy),parts=Array.isArray(d.parts)&&d.parts.length>=1&&d.parts.length<=50?d.parts.map(readPart):BAD;return docSlot===BAD||docVersion===BAD||minBlocks===BAD||tokens===BAD||copy===BAD?{ok:false,reason:"unparseable"}:parts===BAD||parts.some(p=>p===BAD)?{ok:false,reason:"unparseable"}:docSlot!==slot?{ok:false,reason:"wrong_slot"}:{ok:true,doc:/* @__PURE__ */Object.freeze({schema:SLOT_SCHEMA,slot:docSlot,docVersion:docVersion,minBlocks:minBlocks,tokens:tokensOf(tokens),parts:/* @__PURE__ */Object.freeze(parts),copy:copyOf(copy)})}}function slotBodyOf(body){if(body===null)return{ok:false,reason:"too_large"};if(typeof body!="string")return{ok:true,raw:body};if(body.length>65536||utf8Length(body)>65536)return{ok:false,reason:"too_large"};try{return{ok:!0,raw:JSON.parse(body)}}catch{return{ok:false,reason:"unparseable"}}}function part(p){/* @__PURE__ */
|
|
374
|
+
return Object.freeze({settings:{},bind:{},actions:{},...p})}var SLOT_NAMED_PARTS=/* @__PURE__ */Object.freeze({focus:part({id:"focus",type:"PlanNeedCard",variant:"plan",bind:{title:"data:plan.needs"}}),needs:part({id:"needs",type:"PlanNeedCard",variant:"standard",repeat:"data:plan.needs"}),tips:part({id:"tips",type:"TipCard",variant:"plan",repeat:"data:plan.tips"}),shelf:part({id:"shelf",type:"ProductTile",variant:"standard",repeat:"data:plan.items"}),cartLines:part({id:"cart-lines",type:"CartLine",variant:"plan",repeat:"data:cart.lines"}),cartSummary:part({id:"cart-summary",type:"PriceSummary",bind:{rows:"data:cart.summary"},visibleIf:{source:"data:cart.summary",op:"present"}}),orders:part({id:"orders",type:"OrderRow",variant:"quiet",repeat:"data:orders.recent"})});function doc(slot,parts){/* @__PURE__ */
|
|
375
|
+
return Object.freeze({schema:SLOT_SCHEMA,slot:slot,docVersion:null,minBlocks:1,tokens:{},parts:/* @__PURE__ */Object.freeze([...parts]),copy:{}})}var P=SLOT_NAMED_PARTS,BUNDLED_SLOT_DOCS=/* @__PURE__ */Object.freeze({"health_plan.focus":doc("health_plan.focus",[P.focus,P.tips]),"today.health":doc("today.health",[P.focus,P.tips]),"shop.shelf":doc("shop.shelf",[P.shelf]),"shop.cart":doc("shop.cart",[P.cartLines,P.cartSummary]),"shop.orders":doc("shop.orders",[P.orders])});function bundledSlotDoc(slot){return Object.prototype.hasOwnProperty.call(BUNDLED_SLOT_DOCS,slot)?BUNDLED_SLOT_DOCS[slot]??null:null}function utf8Bytes(text2){let out=[];for(let ch of text2){let cp=ch.codePointAt(0);cp<128?out.push(cp):cp<2048?out.push(192|cp>>6,128|cp&63):cp<65536?out.push(224|cp>>12,128|cp>>6&63,128|cp&63):out.push(240|cp>>18,128|cp>>12&63,128|cp>>6&63,128|cp&63)}return out}function fnv1a64Hex(text2){let hi=3421674724,lo=2216829733;for(let byte2 of utf8Bytes(text2)){lo=(lo^byte2)>>>0;let loProduct=lo*435,carry=Math.floor(loProduct/4294967296),nextLo=loProduct>>>0;hi=hi*435+carry+lo*256>>>0,lo=nextLo}return hi.toString(16).padStart(8,"0")+lo.toString(16).padStart(8,"0")}var tenants=/* @__PURE__ */new WeakMap;function runtimeTenantOf(runtime){return tenants.get(runtime)}var SLOT_REGISTRY_HASH="sha256-0IDdNTQTtW2+pJ9GBCa/aWJrH/lf2X2jHhTQaCt6g5E=";var SLOT_BLOCKS={CartBar:{since:"0.4.0",variants:["standard","web"],platforms:["native","web"],settings:{lines:{type:"lines",values:["thumbs","total","sub","actionHiddenWord"]},variant:{type:"enum",values:["standard","web"],prop:"variant"}},props:["actionAccessibilityLabel","actionHiddenWord","actionLabel","busy","count","countLabel","disabled","fallback","loading","loadingLabel","sub","testID","thumbs","total","variant","visible"],required:["actionLabel","count"],fallback:"hide"},CartLine:{since:"0.2.0",variants:["standard","square","web","plan","drawer"],platforms:["native","web"],settings:{align:{type:"enum",values:["top","center"],prop:"align"},lines:{type:"lines",values:["badge","meta","wasPrice","smalls","note","metas","plan"]},thumbSize:{type:"enum",values:["sm","md","lg"],prop:"thumbSize"},variant:{type:"enum",values:["standard","square","web","plan","drawer"],prop:"variant"}},props:["actions","align","badge","error","fallback","image","imageAlt","loading","loadingLabel","meta","metas","name","namePress","note","plan","price","quantity","removeLabel","smalls","testID","thumbSize","variant","wasPrice"],required:["name"],fallback:null},CheckinSheet:{since:"0.4.0",variants:[],platforms:["native","web"],settings:{lines:{type:"lines",values:["kicker","note","doneText"]}},props:["action","closeLabel","doneText","fallback","flowLabel","image","imageKind","kicker","loading","loadingLabel","note","open","steps","testID","title"],required:["steps"],fallback:"hide"},OrderRow:{since:"0.2.0",variants:["standard","quiet","web"],platforms:["native","web"],settings:{actionGrid:{type:"boolean",prop:"actionGrid"},lines:{type:"lines",values:["meta","total","status","shots","notes"]},variant:{type:"enum",values:["standard","quiet","web"],prop:"variant"}},props:["accessibilityLabel","actionGrid","actions","error","loading","loadingLabel","meta","metaLink","notes","number","shots","status","testID","title","total","variant"],required:["title"],fallback:null},PlanNeedCard:{since:"0.2.0",variants:["standard","plan"],platforms:["native","web"],settings:{lines:{type:"lines",values:["source","sources","title","score","quote","jump"]},variant:{type:"enum",values:["standard","plan"],prop:"variant"}},props:["jump","kicker","loading","loadingLabel","more","quote","score","signals","source","sources","testID","title","variant"],required:["kicker","signals"],fallback:null},PriceSummary:{since:"0.2.0",variants:[],platforms:["native","web"],settings:{lines:{type:"lines",values:["total","note"]},size:{type:"enum",values:["checkout","drawer"],prop:"size",platforms:["web"],default:"checkout"},variant:{type:"enum",values:["standard","web"],prop:"variant",platforms:["web"],default:"standard"}},props:["loading","loadingLabel","note","rows","testID","total"],required:["rows"],fallback:null},ProductTile:{since:"0.2.0",variants:["standard","blend","web"],platforms:["native","web"],settings:{addLift:{type:"boolean",prop:"addLift"},ground:{type:"enum",values:["shelf","white"],prop:"ground"},imageInset:{type:"enum",values:["standard","even"],prop:"imageInset"},layout:{type:"enum",values:["tile","row","card"],prop:"layout"},lines:{type:"lines",values:["kicker","meta","price","wasPrice","per","badge","tag"]},metaTone:{type:"enum",values:["auto","autoDark"],prop:"metaTone"},variant:{type:"enum",values:["standard","blend","web"],prop:"variant"}},props:["action","addLift","badge","fallback","ground","image","imageAlt","imageInset","kicker","layout","loading","loadingLabel","meta","metaTone","name","per","price","stepper","tag","testID","variant","wasPrice"],required:["name"],fallback:null},ScoreLights:{since:"0.4.0",variants:[],platforms:["native","web"],settings:{lines:{type:"lines",values:["heading","since","source","next"]}},props:["heading","loading","loadingLabel","next","pill","since","source","state","testID","values","vizLabel"],required:["pill","state","values","vizLabel"],fallback:"hide"},SummaryList:{since:"0.1.0",variants:["standard","flush","card","inset"],platforms:["native","web"],settings:{lines:{type:"lines",values:["trailingRows","note"]},variant:{type:"enum",values:["standard","flush","card","inset"],prop:"variant"}},props:["loading","loadingLabel","note","rows","testID","total","trailingRows","variant"],required:["rows"],fallback:null},TipCard:{since:"0.2.0",variants:["standard","photo","web","plan"],platforms:["native","web"],settings:{footArrow:{type:"boolean",prop:"footArrow"},lines:{type:"lines",values:["text","foot"]},tone:{type:"enum",values:["y","c","g","r"],prop:"tone"},variant:{type:"enum",values:["standard","photo","web","plan"],prop:"variant"}},props:["accessibilityLabel","foot","footArrow","footPress","icon","image","loading","loadingLabel","number","pressTarget","testID","text","title","tone","variant"],required:["number","title"],fallback:null},WeatherAlert:{since:"0.4.0",variants:[],platforms:["native","web"],settings:{},props:["accessibilityLabel","loading","loadingLabel","testID","text","title"],required:["title"],fallback:"TipCard",fallbackProps:{number:{const:"!"},text:{from:"text"},title:{from:"title"},tone:{const:"r"}}},WeatherCard:{since:"0.4.0",variants:["walk","summary","tile","web"],platforms:["native","web"],settings:{lines:{type:"lines",values:["heading","condition","details","verdict","advice","comfort","label","note","action","units","tags"]},sky:{type:"enum",values:["sun","blue"],prop:"sky"},variant:{type:"enum",values:["walk","summary","tile","web"],prop:"variant"}},props:["action","advice","comfort","condition","details","glyph","heading","label","level","loading","loadingLabel","note","sky","tags","tagsLabel","temperature","testID","units","variant","verdict"],required:["temperature"],fallback:"hide"},WeatherDetails:{since:"0.4.0",variants:[],platforms:["native","web"],settings:{},props:["items","label","loading","loadingLabel","testID"],required:["items"],fallback:"hide"},WeatherForecast:{since:"0.4.0",variants:["plain","walk"],platforms:["native","web"],settings:{variant:{type:"enum",values:["plain","walk"],prop:"variant"}},props:["days","label","loading","loadingLabel","testID","variant"],required:["days"],fallback:"hide"},WeatherHours:{since:"0.4.0",variants:["plain","walk"],platforms:["native","web"],settings:{lines:{type:"lines",values:["windows","legend"]},variant:{type:"enum",values:["plain","walk"],prop:"variant"}},props:["hours","label","legend","loading","loadingLabel","testID","variant","windows"],required:["hours"],fallback:"hide"},WeatherLevels:{since:"0.4.0",variants:["phone","web"],platforms:["native","web"],settings:{variant:{type:"enum",values:["phone","web"],prop:"variant"}},props:["label","loading","loadingLabel","rows","testID","variant"],required:["rows"],fallback:"hide"},WeatherReading:{since:"0.4.0",variants:["phone","web"],platforms:["native","web"],settings:{lines:{type:"lines",values:["word","choices"]},variant:{type:"enum",values:["phone","web"],prop:"variant"}},props:["choices","loading","loadingLabel","testID","tone","value","variant","word"],required:["value"],fallback:"hide"},WhySheet:{since:"0.4.0",variants:["standard","web","plan"],platforms:["native","web"],settings:{lines:{type:"lines",values:["kind","sub","sections","link","score"]},tone:{type:"enum",values:["calm","y","c","g","r"],prop:"tone"},variant:{type:"enum",values:["standard","web","plan"],prop:"variant"}},props:["action","closeLabel","fallback","heading","image","imageKind","kind","link","loading","loadingLabel","rows","score","sections","sub","testID","title","tone","variant"],required:[],fallback:"hide"}};var SLOT_LKG_KEY="everfur.slots.v2",SLOT_INSTALL_ID_KEY="everfur.slots.installId.v2";var SLOT_CACHE_MS=6e4,SLOT_CACHE_MAX_MS=3e5,SLOT_FAILURE_MS=15e3,SLOT_LKG_MAX_AGE_MS=10080*60*1e3,ETAG=/^(W\/)?"[^"]{1,200}"$/,INSTALL_ID=/^[A-Za-z0-9_-]{8,128}$/,MAX_AGE=/(?:^|,)\s*max-age\s*=\s*"?(\d{1,10})"?\s*(?:,|$)/i,NO_STORE2=/(?:^|,)\s*(?:no-store|no-cache)\s*(?:,|$)/i,FIXED_SCOPE=/* @__PURE__ */Object.freeze({doc:"default",tenant:"default",epoch:0});function randomId(){let out="";for(let i=0;i<4;i++)out+=Math.floor(Math.random()*4294967296).toString(36).padStart(7,"0");return out}function slotCacheMs(cacheControl){if(cacheControl===null)return SLOT_CACHE_MS;if(NO_STORE2.test(cacheControl))return 0;let m=MAX_AGE.exec(cacheControl);return m===null?SLOT_CACHE_MS:Math.min(Number(m[1])*1e3,SLOT_CACHE_MAX_MS)}var has=(obj2,key)=>Object.prototype.hasOwnProperty.call(obj2,key);function createSlotClient(deps){let now=deps.now??Date.now,scopeOf=()=>{try{return deps.scope?.()??FIXED_SCOPE}catch{return FIXED_SCOPE}},memory=/* @__PURE__ */new Map,failures=/* @__PURE__ */new Map,inFlight=/* @__PURE__ */new Map,installId=null,epoch=null,rescoped=false,writes=Promise.resolve(),track=(event,props)=>{try{deps.telemetry?.track(event,props)}catch{}},observe=scope=>{epoch!==scope.epoch&&(epoch!==null&&(memory.clear(),failures.clear(),installId=null,rescoped=true),epoch=scope.epoch)},stale=scope=>{let current=scopeOf();return current.epoch!==scope.epoch||current.doc!==scope.doc},undoIfStale=async(scope,key,written)=>{if(!stale(scope))return false;try{await deps.kv.getItem(key)===written&&await deps.kv.removeItem(key)}catch{}return true},readInstallId=scope=>{let tenant=fnv1a64Hex(scope.tenant);if(installId?.tenant===tenant)return installId.id;let fresh2=rescoped;rescoped=false;let id=(async()=>{if(!fresh2)try{let raw=await deps.kv.getItem(SLOT_INSTALL_ID_KEY),kept=raw===null?null:JSON.parse(raw);if(kept?.tenant===tenant&&typeof kept.id=="string"&&INSTALL_ID.test(kept.id))return kept.id}catch{}try{let made=(deps.newId??randomId)();if(!INSTALL_ID.test(made))return null;let text2=JSON.stringify({tenant:tenant,id:made});return await deps.kv.setItem(SLOT_INSTALL_ID_KEY,text2),await undoIfStale(scope,SLOT_INSTALL_ID_KEY,text2)?null:made}catch{return null}})();return installId={tenant:tenant,id:id},id},readFile=async scopeKey=>{try{let raw=await deps.kv.getItem(SLOT_LKG_KEY),file=raw===null?null:JSON.parse(raw);return file?.scope!==scopeKey||file.docs===null||typeof file.docs!="object"||Array.isArray(file.docs)?{docs:{}}:{docs:file.docs}}catch{return{docs:{}}}},readStored=async(scope,slot)=>{let file=await readFile(fnv1a64Hex(scope.doc)),entry=has(file.docs,slot)?file.docs[slot]:void 0;if(entry==null||typeof entry.at!="number")return null;let age=now()-entry.at;if(!(age<SLOT_LKG_MAX_AGE_MS)||age<-SLOT_CACHE_MAX_MS)return null;let parsed=parseSlotDoc(entry.doc,slot);if(!parsed.ok)return null;let etag=typeof entry.etag=="string"&&ETAG.test(entry.etag)?entry.etag:null;return{doc:parsed.doc,etag:etag}},update=(scope,slot,change)=>{let scopeKey=fnv1a64Hex(scope.doc);return writes=writes.then(async()=>{if(!stale(scope))try{let file=await readFile(scopeKey);if(stale(scope))return;let docs={...file.docs},next=change(has(docs,slot)?docs[slot]:void 0);if(next===null?delete docs[slot]:docs[slot]=next,Object.keys(docs).length===0)await deps.kv.removeItem(SLOT_LKG_KEY);else{let text2=JSON.stringify({scope:scopeKey,docs:docs});await deps.kv.setItem(SLOT_LKG_KEY,text2),await undoIfStale(scope,SLOT_LKG_KEY,text2)}}catch{}}),writes},read=async(scope,slot)=>{let key=`${scope.doc}|${slot}`,mem=memory.get(key),stored2=mem===void 0?await readStored(scope,slot):null,held=mem!==void 0?{doc:mem.doc,etag:mem.etag}:stored2,install=await readInstallId(scope),headers={"x-everfur-blocks":deps.blocks??SLOT_REGISTRY_HASH};install!==null&&(headers["x-everfur-install-id"]=install),held?.doc&&held.etag!==null&&(headers["if-none-match"]=held.etag);let etag=null,ttl=SLOT_CACHE_MS,res=await deps.send("slots.read",{method:"GET",path:`/widget/v1/slots/${encodeURIComponent(slot)}`,headers:headers,rawText:65536,onResponseHeaders:header=>{let value=header("etag");etag=value!==null&&ETAG.test(value)?value:null,ttl=slotCacheMs(header("cache-control"))}}).catch(()=>null),fallBack=()=>held?.doc?{doc:held.doc,source:mem!==void 0?"cache":"last-known-good"}:{doc:null,source:"bundled"},failed=status2=>(failures.set(key,now()),track("slots.read_failed",{slot:slot,status:status2}),fallBack());if(stale(scope))return{doc:null,source:"bundled"};if(res===null)return failed(null);if(res.ok){let body=slotBodyOf(res.value);if(!body.ok)return track("slots.refused",{slot:slot,reason:body.reason}),fallBack();let parsed=parseSlotDoc(body.raw,slot);if(!parsed.ok)return track("slots.refused",{slot:slot,reason:parsed.reason}),fallBack();let at=now();return memory.set(key,{doc:parsed.doc,etag:etag,at:at,ttl:ttl}),await update(scope,slot,()=>({etag:etag,doc:body.raw,at:at})),{doc:parsed.doc,source:"live"}}let status=res.error.httpStatus;if(status===304&&held?.doc){let at=now();return memory.set(key,{doc:held.doc,etag:held.etag,at:at,ttl:ttl}),await update(scope,slot,entry=>entry===void 0?null:{...entry,at:at}),{doc:held.doc,source:"live"}}return status===404?(memory.set(key,{doc:null,etag:null,at:now(),ttl:ttl}),await update(scope,slot,()=>null),{doc:null,source:"bundled"}):failed(status??null)},peekIn=(scope,slot)=>{let mem=memory.get(`${scope.doc}|${slot}`);return mem===void 0||now()-mem.at>=mem.ttl?null:mem.doc===null?{doc:null,source:"bundled"}:{doc:mem.doc,source:"cache"}},storedIn=async(scope,slot)=>{let mem=memory.get(`${scope.doc}|${slot}`);if(mem!==void 0)return mem.doc===null?{doc:null,source:"bundled"}:{doc:mem.doc,source:"cache"};let kept=await readStored(scope,slot);return kept===null?{doc:null,source:"bundled"}:{doc:kept.doc,source:"last-known-good"}};return{peek(slot){let scope=scopeOf();return observe(scope),peekIn(scope,slot)},stored(slot){let scope=scopeOf();return observe(scope),storedIn(scope,slot).catch(()=>({doc:null,source:"bundled"}))},load(slot){let scope=scopeOf();observe(scope);let fromCache=peekIn(scope,slot);if(fromCache!==null)return Promise.resolve(fromCache);let key=`${scope.doc}|${slot}`,flight=`${scope.epoch}|${key}`,pending=inFlight.get(flight);if(pending!==void 0)return pending;let failedAt=failures.get(key),next=(failedAt!==void 0&&now()-failedAt<SLOT_FAILURE_MS?storedIn(scope,slot):read(scope,slot)).catch(()=>({doc:null,source:"bundled"})).finally(()=>inFlight.delete(flight));return inFlight.set(flight,next),next}}}function runtimeSlotScope(runtime){let tenant=runtimeTenantOf(runtime)??"unknown",auth=runtime.registry.services.authFor(null),who=auth.mode==="personalized"?`u:${auth.userRef??""}`:`a:${auth.userRef??""}`;return{doc:`${tenant}|${who}`,tenant:tenant,epoch:runtime.scopeEpoch??0}}var CLIENTS_SYMBOL=/* @__PURE__ */Symbol.for("@everfur/sdk#SlotClients@v1");function slotClientFor(runtime,make=runtimeSlotClient){let host2=globalThis,all=host2[CLIENTS_SYMBOL];all instanceof WeakMap||(all=/* @__PURE__ */new WeakMap,host2[CLIENTS_SYMBOL]=all);let map=all,client=map.get(runtime);return client===void 0&&(client=make(runtime),map.set(runtime,client)),client}function runtimeSlotClient(runtime){let{services:services}=runtime.registry;return createSlotClient({send:(call,req)=>createRequestFunnel({auth:services.authFor(null),...services.errorPolicy?{errorPolicy:services.errorPolicy}:{}}).send(call,req),kv:services.kv,telemetry:services.telemetry,scope:()=>runtimeSlotScope(runtime)})}function drawn(slot,load){return{doc:load.doc??bundledSlotDoc(slot),source:load.source}}function useSlotDoc(slot,enabled){let{runtime:runtime,scopeEpoch:scopeEpoch}=useEverfurContext(),client=enabled?slotClientFor(runtime):null,[state2,setState]=react.useState(()=>{let fresh2=client?.peek(slot);return fresh2?{slot:slot,epoch:scopeEpoch,value:drawn(slot,fresh2)}:null});return react.useEffect(()=>{if(client===null)return;let live=true,landed=false,fresh2=client.peek(slot);if(fresh2!==null){setState({slot:slot,epoch:scopeEpoch,value:drawn(slot,fresh2)});return}return client.stored(slot).then(held=>{live&&!landed&&setState({slot:slot,epoch:scopeEpoch,value:drawn(slot,held)})}),client.load(slot).then(load=>{landed=true,live&&setState({slot:slot,epoch:scopeEpoch,value:drawn(slot,load)})}),()=>{live=false}},[client,slot,scopeEpoch]),enabled?state2!==null&&state2.slot===slot&&state2.epoch===scopeEpoch?state2.value:{doc:null,source:"pending"}:{doc:bundledSlotDoc(slot),source:"bundled"}}function registryCatalog(platform){return{knows(type,variant){let spec=Object.prototype.hasOwnProperty.call(SLOT_BLOCKS,type)?SLOT_BLOCKS[type]:void 0;if(spec===void 0||!spec.platforms.includes(platform))return false;if(variant===void 0)return true;let setting=spec.settings.variant;return variant===setting?.default?true:spec.variants.includes(variant)?setting?.platforms===void 0||setting.platforms.includes(platform):false}}}function keep(part2){return{id:part2.id,...part2.repeat?{repeat:part2.repeat}:{},...part2.visibleIf?{visibleIf:part2.visibleIf}:{}}}function replacementFor(part2,catalog){if(catalog.knows(part2.type,part2.variant))return part2;if(part2.fallback==="hide")return null;let own=ownFallbackFor(part2,catalog);if(own!==null)return own;let spec=Object.prototype.hasOwnProperty.call(SLOT_BLOCKS,part2.type)?SLOT_BLOCKS[part2.type]:void 0,named=spec?.fallback??null;if(named===null||named==="hide"||!catalog.knows(named))return null;let target=SLOT_BLOCKS[named];if(spec?.fallbackProps!==void 0&&target!==void 0)return mappedFallback(part2,spec,named,target);let bind={};for(let[prop,value]of Object.entries(part2.bind))target?.props.includes(prop)&&(bind[prop]=value);return{...keep(part2),type:named,settings:{},bind:bind,actions:part2.actions}}function settingTakes(setting,value){return setting.type==="boolean"?typeof value=="boolean":setting.type==="enum"?typeof value=="string"&&(setting.values??[]).includes(value):setting.type==="lines"?Array.isArray(value)&&new Set(value).size===value.length&&value.every(line=>typeof line=="string"&&(setting.values??[]).includes(line)):false}function mappedFallback(part2,spec,named,target){let bind={},settings={},fixed={},variant;for(let[prop,rule]of Object.entries(spec.fallbackProps??{})){if("from"in rule){Object.prototype.hasOwnProperty.call(part2.bind,rule.from)&&(bind[prop]=part2.bind[rule.from]);continue}let value=rule.const;if(prop==="variant"){typeof value=="string"&&target.variants.includes(value)&&(variant=value);continue}let setting=Object.entries(target.settings).find(([key,s])=>key!=="variant"&&s.prop===prop);setting!==void 0&&settingTakes(setting[1],value)?settings[setting[0]]=value:typeof value=="string"&&(fixed[prop]=value)}let set=/* @__PURE__ */new Set([...Object.keys(bind),...Object.keys(fixed),...Object.keys(settings).map(key=>target.settings[key]?.prop)]);return variant!==void 0&&set.add("variant"),target.required.some(prop=>!set.has(prop))?null:{...keep(part2),type:named,...variant!==void 0?{variant:variant}:{},settings:settings,bind:bind,actions:{},...Object.keys(fixed).length>0?{fixed:fixed}:{}}}function ownFallbackFor(part2,catalog){let own=part2.fallback;return own===void 0||own==="hide"||!catalog.knows(own.type,own.variant)?null:{...keep(part2),type:own.type,...own.variant?{variant:own.variant}:{},settings:own.settings,bind:own.bind,actions:own.actions}}function partsToDraw(doc2,catalog){let out=[];for(let part2 of doc2.parts){let next=replacementFor(part2,catalog);next!==null&&out.push(next)}return out.length===0||out.length<doc2.minBlocks?null:out}var SLOT_EXTERNAL_HOSTS=/* @__PURE__ */Object.freeze(["everfur.com","www.everfur.com","docs.everfur.com"]),SLOT_ROUTES=/* @__PURE__ */Object.freeze(["chat","health_plan","plan.detail","records","shop","shop.cart","shop.orders","visit"]),SLOT_SHEETS=/* @__PURE__ */Object.freeze(["health_plan.checkout","health_plan.manage","health_plan.weight"]),EVENT=/^[a-z][a-z0-9_]*(\.[a-z][a-z0-9_]*){0,4}$/,HTTPS_URL=/^https:\/\/([A-Za-z0-9.-]+)(?:[/?#][^\s]*)?$/,URL_MAX=512;function isAllowedExternalUrl(url){if(url.length>URL_MAX)return false;let m=HTTPS_URL.exec(url);return m!==null&&SLOT_EXTERNAL_HOSTS.includes((m[1]??"").toLowerCase())}function parseSlotAction(value){if(typeof value!="string")return null;let at=value.indexOf(":");if(at<=0)return null;let kind=value.slice(0,at),target=value.slice(at+1);switch(kind){case"navigate":return SLOT_ROUTES.includes(target)?{kind:kind,route:target}:null;case"open_sheet":return SLOT_SHEETS.includes(target)?{kind:kind,id:target}:null;case"track":return EVENT.test(target)?{kind:kind,event:target}:null;case"external":return isAllowedExternalUrl(target)?{kind:kind,url:target}:null;default:return null}}var SLOT_DATA_SOURCES=/* @__PURE__ */Object.freeze({"plan.needs":"list","plan.tips":"list","plan.items":"list","cart.lines":"list","cart.summary":"item","orders.recent":"list"});function isSlotDataSource(name){return Object.prototype.hasOwnProperty.call(SLOT_DATA_SOURCES,name)}function parseSlotRef(value){if(value===void 0)return null;let at=value.indexOf(":");if(at<=0)return null;let kind=value.slice(0,at),name=value.slice(at+1);return name===""?null:kind==="data"?isSlotDataSource(name)?{kind:kind,name:name}:null:kind==="item"||kind==="copy"?{kind:kind,name:name}:null}var NOT_BINDABLE=/* @__PURE__ */new Set(["action","actions","busy","disabled","error","fallback","footPress","link","loading","loadingLabel","metaLink","namePress","next","open","quantity","stepper","testID","visible"]),SLOT_TEXT_PROPS=/* @__PURE__ */Object.freeze({CartBar:["actionLabel","actionAccessibilityLabel","actionHiddenWord","countLabel","sub","total"],CartLine:["name","imageAlt","meta","price","wasPrice","removeLabel","note"],CheckinSheet:["kicker","title","flowLabel","doneText","closeLabel"],OrderRow:["number","title","meta","total","accessibilityLabel"],PlanNeedCard:["kicker","source","title"],PriceSummary:["note"],ProductTile:["name","imageAlt","kicker","meta","price","wasPrice","per","badge"],ScoreLights:["heading","pill","since","vizLabel"],SummaryList:["note"],TipCard:["number","title","text","foot","accessibilityLabel"],WeatherAlert:["title","text","accessibilityLabel"],WeatherCard:["heading","temperature","condition","details","verdict","advice","label","note","tagsLabel"],WeatherDetails:["label"],WeatherForecast:["label"],WeatherHours:["label"],WeatherLevels:["label"],WeatherReading:["value","word"],WhySheet:["kind","title","sub","heading","closeLabel"]}),has2=(obj2,key)=>Object.prototype.hasOwnProperty.call(obj2,key);function present(value){return value==null||value===""?false:!Array.isArray(value)||value.length>0}function dataOf(data,name){return has2(data,name)?data[name]:void 0}function partVisible(part2,data,copy){let cond=part2.visibleIf;if(cond===void 0)return true;let ref=parseSlotRef(cond.source);if(ref===null)return false;if(ref.kind==="item")return true;let there=ref.kind==="data"?present(dataOf(data,ref.name)):has2(copy,ref.name);return cond.op==="present"?there:!there}function itemVisible(part2,item){let ref=parseSlotRef(part2.visibleIf?.source);if(ref?.kind!=="item")return true;let there=present(item[ref.name]);return part2.visibleIf?.op==="present"?there:!there}function propsFor(part2,item,data,copy,platform){let spec=SLOT_BLOCKS[part2.type],known=spec?.props??[],text2=SLOT_TEXT_PROPS[part2.type]??[],out={};for(let prop of known)has2(item,prop)&&!NOT_BINDABLE.has(prop)&&item[prop]!==void 0&&(out[prop]=item[prop]);for(let[prop,value]of Object.entries(part2.bind)){if(!known.includes(prop)||NOT_BINDABLE.has(prop))continue;let ref=parseSlotRef(value);if(ref===null)continue;let next,field=prop;if(ref.kind==="copy"){if(!text2.includes(prop))continue;next=has2(copy,ref.name)?copy[ref.name]:void 0,field=""}else if(ref.kind==="item")field=ref.name,next=has2(item,field)?item[field]:void 0;else{let first=dataOf(data,ref.name)?.[0];next=first!==void 0&&has2(first,prop)?first[prop]:void 0}ref.kind!=="copy"&&field!==prop&&!(text2.includes(prop)&&typeof next=="string")||(next===void 0?delete out[prop]:out[prop]=next)}for(let[prop,value]of Object.entries(part2.fixed??{}))known.includes(prop)&&!NOT_BINDABLE.has(prop)&&(out[prop]=value);part2.variant!==void 0&&known.includes("variant")&&(out.variant=part2.variant);for(let[name,value]of Object.entries(part2.settings)){let setting=spec?.settings[name];if(!(setting===void 0||setting.platforms!==void 0&&!setting.platforms.includes(platform)))if(setting.type==="lines"){if(!Array.isArray(value))continue;for(let line of setting.values??[])value.includes(line)||delete out[line]}else setting.prop!==void 0&&known.includes(setting.prop)&&(setting.type==="boolean"&&typeof value=="boolean"||setting.type==="enum"&&typeof value=="string"&&(setting.values??[]).includes(value))&&(out[setting.prop]=value)}return out}function keyOf3(item,index){let key=item.key;return typeof key=="string"&&key!==""?`${key}#${index}`:String(index)}function hasRequiredProps(type,props){let spec=SLOT_BLOCKS[type];return spec!==void 0&&spec.required.every(prop=>props[prop]!==void 0&&props[prop]!==null)}function resolveSlotPart(part2,data,copy,platform="native"){if(SLOT_BLOCKS[part2.type]===void 0||!partVisible(part2,data,copy))return null;let repeat=parseSlotRef(part2.repeat),items;if(part2.repeat!==void 0){if(repeat?.kind!=="data")return null;items=dataOf(data,repeat.name)??[]}else{let subject=Object.values(part2.bind).map(v=>parseSlotRef(v)).find(ref=>ref?.kind==="data");if(subject){let first=dataOf(data,subject.name)?.[0];items=first===void 0?[]:[first]}else items=[{}]}let blocks=[],incomplete=0;if(items.forEach((item,i)=>{if(!itemVisible(part2,item))return;let props=propsFor(part2,item,data,copy,platform);hasRequiredProps(part2.type,props)?blocks.push({key:keyOf3(item,i),props:/* @__PURE__ */Object.freeze(props)}):incomplete+=1}),blocks.length===0&&incomplete===0)return null;let actions={};for(let[name,value]of Object.entries(part2.actions)){let action=parseSlotAction(value);action!==null&&(actions[name]=action)}return{part:part2,blocks:blocks,incomplete:incomplete,actions:actions}}function catalogOf(blocks){let registry=registryCatalog("native");return{knows:(type,variant)=>Object.prototype.hasOwnProperty.call(blocks,type)&®istry.knows(type,variant)}}function slotPartsOf(doc2,slot,blocks){let catalog=catalogOf(blocks);if(doc2!==null){let parts=partsToDraw(doc2,catalog);if(parts!==null)return parts}let bundled=bundledSlotDoc(slot);return bundled===null?[]:partsToDraw(bundled,catalog)??[]}var COLOR_ROLES=new Set(Object.keys(everfurTheme.colors)),RADII2=new Set(Object.keys(everfurTheme.radius)),SPACES=new Set(Object.keys(everfurTheme.space));function slotThemeInput(tokens){let colors={},radius={},space={};for(let[name,value]of Object.entries(tokens)){let[group,key,extra]=name.split(".");key===void 0||extra!==void 0||((group==="color"||group==="colors")&&typeof value=="string"&&COLOR_ROLES.has(key)?colors[key]=value:group==="radius"&&typeof value=="number"&&value>=0&&RADII2.has(key)?radius[key]=value:group==="space"&&typeof value=="number"&&value>=0&&SPACES.has(key)&&(space[key]=value))}let out={};return Object.keys(colors).length>0&&(out.colors=colors),Object.keys(radius).length>0&&(out.radius=radius),Object.keys(space).length>0&&(out.space=space),Object.keys(out).length===0?null:out}function run2(action,context,handlers,track){switch(action.kind){case"navigate":callHost(handlers.onNavigate,action.route,context);return;case"open_sheet":callHost(handlers.onOpenSheet,action.id,context);return;case"track":track("slots.track",{slot:context.slot,part:context.part,event:action.event});return;case"external":handlers.onOpenUrl?callHost(handlers.onOpenUrl,action.url):reactNative.Linking.openURL(action.url).catch(()=>{})}}function canRun(action,handlers){return action.kind==="navigate"?handlers.onNavigate!==void 0:action.kind==="open_sheet"?handlers.onOpenSheet!==void 0:true}function DrawnPart({blocks:blocks,resolved:resolved,slot:slot,handlers:handlers,track:track}){let Block=Object.prototype.hasOwnProperty.call(blocks,resolved.part.type)?blocks[resolved.part.type]:void 0;if(Block===void 0)return null;let press=resolved.actions.onPress;/* @__PURE__ */
|
|
376
|
+
return jsxRuntime.jsx(jsxRuntime.Fragment,{children:resolved.blocks.map(block=>{let testID=`everfur-slot-${resolved.part.id}`,node=react.createElement(Block,{...block.props,testID:testID});if(press===void 0||!canRun(press,handlers))/* @__PURE__ */return jsxRuntime.jsx(react.Fragment,{children:node},block.key);let context={slot:slot,part:resolved.part.id,key:block.key};/* @__PURE__ */
|
|
377
|
+
return jsxRuntime.jsx(reactNative.Pressable,{accessibilityRole:press.kind==="external"?"link":"button",onPress:()=>run2(press,context,handlers,track),testID:`${testID}-press`,children:node},block.key)})})}var CRASHED=/* @__PURE__ */new WeakMap,slotDocKey=doc2=>fnv1a64Hex(JSON.stringify(doc2)),SlotPartBoundary=class extends react.Component{constructor(){super(...arguments);this.state={failed:false}}static getDerivedStateFromError(){return{failed:true}}componentDidCatch(){try{this.props.onError()}catch{}}render(){return this.state.failed?null:this.props.children}};function SlotParts(props){let{slot:slot,data:data,blocks:blocks,override:override}=props,handlers=props.handlers??NO_HANDLERS,{runtime:runtime}=useEverfurContext(),[,setCrashes]=react.useState(0),docKey=react.useMemo(()=>props.doc===null?null:slotDocKey(props.doc),[props.doc]),doc2=docKey!==null&&CRASHED.get(runtime)?.has(docKey)===true?null:props.doc,parts=react.useMemo(()=>slotPartsOf(doc2,slot,blocks),[doc2,slot,blocks]),catalog=react.useMemo(()=>catalogOf(blocks),[blocks]),reported=react.useRef({doc:doc2,parts:/* @__PURE__ */new Set});reported.current.doc!==doc2&&(reported.current={doc:doc2,parts:/* @__PURE__ */new Set});let copy=doc2?.copy??NO_COPY,tokens=react.useMemo(()=>slotThemeInput(doc2?.tokens??NO_TOKENS),[doc2]),track=(event,payload)=>{try{runtime.registry.services.telemetry.track(event,payload)}catch{}},failed=part2=>()=>{if(track("slots.part_failed",{slot:slot,part:part2.id,bundled:doc2===null}),doc2===null||docKey===null)return;let crashed=CRASHED.get(runtime);crashed===void 0&&CRASHED.set(runtime,crashed=/* @__PURE__ */new Set),crashed.add(docKey),setCrashes(n=>n+1)},generation=doc2===null?"b":"d",drawn2=parts.map(part2=>{let key=`${generation}:${part2.id}`,own=override?.(part2)??null;if(own!==null)/* @__PURE__ */
|
|
378
|
+
return jsxRuntime.jsx(SlotPartBoundary,{onError:failed(part2),children:own},key);let resolved=resolveSlotPart(part2,data,copy,"native");if(resolved!==null&&resolved.blocks.length===0){reported.current.parts.has(part2.id)||(reported.current.parts.add(part2.id),track("slots.part_incomplete",{slot:slot,part:part2.id,type:part2.type}));let stand=ownFallbackFor(part2,catalog),next=stand===null?null:resolveSlotPart(stand,data,copy,"native");resolved=next!==null&&next.blocks.length>0?next:null}if(resolved===null)return null;let body=/* @__PURE__ */jsxRuntime.jsx(DrawnPart,{blocks:blocks,resolved:resolved,slot:slot,handlers:handlers,track:track});/* @__PURE__ */
|
|
379
|
+
return jsxRuntime.jsx(SlotPartBoundary,{onError:failed(part2),children:/* @__PURE__ */jsxRuntime.jsx(BlockScope,{children:tokens===null?body:/* @__PURE__ */jsxRuntime.jsx(ThemeProvider,{theme:tokens,children:body})})},key)});/* @__PURE__ */
|
|
380
|
+
return jsxRuntime.jsx(jsxRuntime.Fragment,{children:drawn2})}var NO_HANDLERS=/* @__PURE__ */Object.freeze({}),NO_COPY=/* @__PURE__ */Object.freeze({}),NO_TOKENS=/* @__PURE__ */Object.freeze({});var HEALTH_PLAN_FOCUS_SLOT="health_plan.focus",FOCUS_BLOCKS=/* @__PURE__ */Object.freeze({PlanNeedCard:PlanNeedCard,SummaryList:SummaryList,TipCard:TipCard});function focusOverride(part2){return part2.variant!=="plan"?null:part2.type==="PlanNeedCard"&&part2.repeat===void 0&&Object.values(part2.bind).includes("data:plan.needs")?/* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanFocusCard,{}):part2.type==="TipCard"&&part2.repeat==="data:plan.tips"?/* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanTips,{}):null}function HealthPlanFocusSlot(){let m=useConnectedHealthPlanModel(),on=useSlotSwitch(),{doc:doc2,source:source}=useSlotDoc(HEALTH_PLAN_FOCUS_SLOT,on),design=m?.props.design,item=m?.props.item,others=m?.props.others,locale=m?.props.priceFormat?.locale??m?.props.locale,waiting=m===null||m.waiting,data=react.useMemo(()=>{if(waiting||design===void 0)return{};let items=[item,...others??[]].filter(x=>x!==void 0&&x!==NO_PLAN_ITEM);return{"plan.needs":slotNeeds(design),"plan.tips":slotTips(design),"plan.items":slotProductItems(items,locale)}},[waiting,design,item,others,locale]);return m===null||source==="pending"?null:/* @__PURE__ */jsxRuntime.jsx(SlotParts,{slot:HEALTH_PLAN_FOCUS_SLOT,doc:doc2,data:data,blocks:FOCUS_BLOCKS,override:focusOverride})}var PUSH_FOOT_MIN_BOTTOM=12;function HealthPlanFocus(props){/* @__PURE__ */
|
|
359
381
|
return jsxRuntime.jsx(HealthPlanFocusProvider,{...props,children:/* @__PURE__ */jsxRuntime.jsx(FocusLayout,{})})}function FocusLayout(){let m=useHealthPlanFocusContext(),{props:props,hp:hp,kit:kit}=m,{S:S,copy:copy}=kit,window=reactNative.useWindowDimensions(),{started:started,top:top,screens:screens,toast:toast,title:title,back:back,closeOverlays:closeOverlays}=hp,onOverlayChange=props.onOverlayChange,viewport=useHealthPlanViewport(),insets=reactNativeSafeAreaContext.useSafeAreaInsets(),pushedRef=react.useRef(null),[pane,setPane]=react.useState(null),pushedId=started!==null?"started":top===void 0?null:top.kind==="order"?`order:${top.key}`:top.kind,pushedOpen=pushedId!==null;react.useEffect(()=>{if(!pushedOpen||viewport===null){setPane(null);return}viewport.measure(({y:y,height:height})=>{let below=Math.max(0,window.height-(y+height)),under=Math.max(0,insets.bottom-below);setPane(was=>was!==null&&was.height===height&&was.under===under?was:{height:height,under:under})})},[pushedOpen,viewport,window.height,insets.bottom]),react.useEffect(()=>{pane!==null&&pushedId!==null&&viewport?.top(pushedRef.current)},[pane===null,pushedId,viewport]);let{bx:bx,tb:tb}=S.D,pageNode=/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:[...bx("root"),props.style],testID:"health-plan-focus",onLayout:e=>m.setPageWidth(Math.round(e.nativeEvent.layout.width)),children:[
|
|
360
382
|
/* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanToolbar,{}),
|
|
361
383
|
/* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanToast,{}),
|
|
@@ -363,19 +385,18 @@ return jsxRuntime.jsx(HealthPlanFocusProvider,{...props,children:/* @__PURE__ */
|
|
|
363
385
|
/* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanBlanks,{}),
|
|
364
386
|
/* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanWaitCard,{}),
|
|
365
387
|
/* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanByline,{}),
|
|
366
|
-
/* @__PURE__ */jsxRuntime.jsx(
|
|
367
|
-
/* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanTips,{}),
|
|
388
|
+
/* @__PURE__ */jsxRuntime.jsx(HealthPlanFocusSlot,{}),
|
|
368
389
|
/* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanProductPick,{}),
|
|
369
390
|
/* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanOtherItems,{}),
|
|
370
391
|
/* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanSigns,{}),
|
|
371
392
|
/* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanExtras,{}),
|
|
372
|
-
/* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanFine,{})]}),backRow=onOverlayChange===void 0?/* @__PURE__ */jsxRuntime.jsx(HealthPlanBackRow,{onBack:back}):null,pushedFrame=(testID,head,body,foot,footPart=null)=>{let footNode=foot===null?null:/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[...bx("pushFoot",footPart),{paddingBottom:Math.max(PUSH_FOOT_MIN_BOTTOM,pane?.under??0)}],testID:"health-plan-push-foot",children:foot}),content=/* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[head===null?null:/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:S.screen,children:head}),body]});return pane===null?/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{ref:pushedRef,testID:testID,collapsable:false,children:[content,footNode]}):/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{ref:pushedRef,testID:testID,style:{height:pane.height},collapsable:false,children:[
|
|
373
|
-
/* @__PURE__ */jsxRuntime.jsx(reactNative.ScrollView,{style:{flex:1},keyboardShouldPersistTaps:"handled",testID:"health-plan-push-scroll",children:content}),footNode]})},screenNode=null;if(started!==null)screenNode=pushedFrame("health-plan-started",
|
|
393
|
+
/* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanFine,{})]}),backRow=onOverlayChange===void 0?/* @__PURE__ */jsxRuntime.jsx(HealthPlanBackRow,{onBack:back}):null,pushedFrame=(testID,head,body,foot,footPart=null)=>{let footNode=foot===null?null:/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[...bx("pushFoot",footPart),{paddingBottom:Math.max(PUSH_FOOT_MIN_BOTTOM,pane?.under??0)}],testID:"health-plan-push-foot",children:foot}),content=/* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[head===null?null:/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:S.screen,children:head}),body]});return pane===null?/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{ref:pushedRef,testID:testID,style:{backgroundColor:S.palette.paper},collapsable:false,children:[content,footNode]}):/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{ref:pushedRef,testID:testID,style:{height:pane.height,backgroundColor:S.palette.paper},collapsable:false,children:[
|
|
394
|
+
/* @__PURE__ */jsxRuntime.jsx(reactNative.ScrollView,{style:{flex:1},keyboardShouldPersistTaps:"handled",testID:"health-plan-push-scroll",children:content}),footNode]})},screenNode=null;if(started!==null)screenNode=pushedFrame("health-plan-started",null,/* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanStarted,{}),shopButton(kit,copy.startedDone,hp.closeStarted,{testID:"health-plan-started-done",part:"footButton"}));else if(top!==void 0){let body=null,foot=null,footPart=null;if(top.kind==="cart"){let{views:views,cartReady:cartReady}=hp;body=/* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanCart,{}),footPart=views.length===0?null:"foot",foot=views.length===0?shopButton(kit,copy.startedDone,closeOverlays):/* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[shopButton(kit,copy.checkoutCart(hp.fmt(hp.cartTotal,hp.currency)??""),()=>hp.openSheet({kind:"cartCheckout"}),{disabled:!cartReady,testID:"health-plan-cart-checkout"}),!cartReady&©.cartOneAtATime!==""?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("shopFine","shopFineCenter"),children:copy.cartOneAtATime}):null]})}else if(top.kind==="orders")body=/* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanOrders,{});else if(top.kind==="order")body=/* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanOrder,{});else{let placedOrders=top.kind==="placed"?top.orders:[],first=placedOrders[0];body=/* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanPlaced,{}),footPart="pushFootStack",foot=/* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[shopButton(kit,placedOrders.length===1?copy.viewOrder:copy.seeOrders,()=>hp.replaceScreens(placedOrders.length===1&&first!==void 0?[{kind:"order",key:first.orderId}]:[{kind:"orders"}]),{testID:"health-plan-placed-view"}),shopButton(kit,copy.startedDone,closeOverlays,{ghost:true})]})}let heading=onOverlayChange===void 0&&title!==void 0?/* @__PURE__ */jsxRuntime.jsx(Text,{style:S.h3,accessibilityRole:"header",children:title}):null;screenNode=pushedFrame(`health-plan-screen-${top.kind}`,backRow===null&&heading===null&&toast===null?null:/* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[backRow,heading,
|
|
374
395
|
/* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanToast,{})]}),
|
|
375
396
|
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{testID:"health-plan-screen-body",children:body}),foot,footPart)}/* @__PURE__ */
|
|
376
397
|
return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[
|
|
377
398
|
/* @__PURE__ */jsxRuntime.jsx(PlanPushes,{id:started!==null?"started":top===void 0?"page":top.kind==="order"?`order:${top.key}`:top.kind,depth:screens.length+(started!==null?1:0),node:screenNode??pageNode,width:window.width,paper:S.palette.paper,still:kit.still}),
|
|
378
|
-
/* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanSheet,{})]})}function HealthPlanItemCard(props){let{item:item,onToggle:onToggle,pending:pending=false,error:error=null,imageVariant:imageVariant=HEALTH_PLAN_LAYOUT_DEFAULTS.imageVariant,reasonVariant:reasonVariant=HEALTH_PLAN_LAYOUT_DEFAULTS.reasonVariant,priceFormat:priceFormat,renderFooter:renderFooter,showCategory:showCategory=HEALTH_PLAN_LAYOUT_DEFAULTS.showCategory,cardShadow:cardShadow=HEALTH_PLAN_LAYOUT_DEFAULTS.cardShadow,cardBorder:cardBorder=HEALTH_PLAN_LAYOUT_DEFAULTS.cardBorder,addButtonSize:addButtonSize=HEALTH_PLAN_LAYOUT_DEFAULTS.addButtonSize,addButtonFontSize:addButtonFontSize,addedVariant:addedVariant=HEALTH_PLAN_LAYOUT_DEFAULTS.addedVariant,categoryVariant:categoryVariant=HEALTH_PLAN_LAYOUT_DEFAULTS.categoryVariant,cardPadding:cardPadding,itemTitleSize:itemTitleSize,itemTitleWeight:itemTitleWeight,priceSize:priceSize,priceWeight:priceWeight,reasonTextSize:reasonTextSize,reasonLabelWidth:reasonLabelWidth,reasonGap:reasonGap,style:style}=guardHostProps(props,["onToggle"]),theme=usePlanTheme(),styles25=react.useMemo(()=>makeStyles3(theme),[theme]),sized=(size,weight)=>{let px2=healthPlanLength(size),fontSize=px2===null||px2===0?null:{fontSize:px2,lineHeight:Math.round(px2*theme.type.lineHeight.snug)};return fontSize===null&&weight===void 0?null:{...fontSize,...weight===void 0?null:{fontWeight:String(weight)}}},titleSized=sized(itemTitleSize,itemTitleWeight),priceSized=sized(priceSize,priceWeight),reasonSized=sized(reasonTextSize),labelWidth=healthPlanLength(reasonLabelWidth),labelGap=healthPlanLength(reasonGap),padding=healthPlanLength(cardPadding),shadow=react.useMemo(()=>cardShadowStyle(cardShadow,styles25.cardShadow,theme),[cardShadow,styles25,theme]),
|
|
399
|
+
/* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanSheet,{})]})}function HealthPlanItemCard(props){let{item:item,onToggle:onToggle,pending:pending=false,error:error=null,imageVariant:imageVariant=HEALTH_PLAN_LAYOUT_DEFAULTS.imageVariant,reasonVariant:reasonVariant=HEALTH_PLAN_LAYOUT_DEFAULTS.reasonVariant,priceFormat:priceFormat,renderFooter:renderFooter,showCategory:showCategory=HEALTH_PLAN_LAYOUT_DEFAULTS.showCategory,cardShadow:cardShadow=HEALTH_PLAN_LAYOUT_DEFAULTS.cardShadow,cardBorder:cardBorder=HEALTH_PLAN_LAYOUT_DEFAULTS.cardBorder,addButtonSize:addButtonSize=HEALTH_PLAN_LAYOUT_DEFAULTS.addButtonSize,addButtonFontSize:addButtonFontSize,addedVariant:addedVariant=HEALTH_PLAN_LAYOUT_DEFAULTS.addedVariant,categoryVariant:categoryVariant=HEALTH_PLAN_LAYOUT_DEFAULTS.categoryVariant,cardPadding:cardPadding,itemTitleSize:itemTitleSize,itemTitleWeight:itemTitleWeight,priceSize:priceSize,priceWeight:priceWeight,reasonTextSize:reasonTextSize,reasonLabelWidth:reasonLabelWidth,reasonGap:reasonGap,style:style}=guardHostProps(props,["onToggle"]),theme=usePlanTheme(),styles25=react.useMemo(()=>makeStyles3(theme),[theme]),sized=(size,weight)=>{let px2=healthPlanLength(size),fontSize=px2===null||px2===0?null:{fontSize:px2,lineHeight:Math.round(px2*theme.type.lineHeight.snug)};return fontSize===null&&weight===void 0?null:{...fontSize,...weight===void 0?null:{fontWeight:String(weight)}}},titleSized=sized(itemTitleSize,itemTitleWeight),priceSized=sized(priceSize,priceWeight),reasonSized=sized(reasonTextSize),labelWidth=healthPlanLength(reasonLabelWidth),labelGap=healthPlanLength(reasonGap),padding=healthPlanLength(cardPadding),shadow=react.useMemo(()=>cardShadowStyle(cardShadow,styles25.cardShadow,theme),[cardShadow,styles25,theme]),price2=formatHealthPlanPriceWith(item.price,item.currency,priceFormat),thumbnail=imageVariant==="thumbnail",rows=reasonVariant==="rows",priceNode=price2===null?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:[styles25.price,priceSized],children:price2}),category=showCategory&&item.category!==null?/* @__PURE__ */jsxRuntime.jsx(Text,{...categoryVariant==="label"?{tier:"compact"}:{},style:categoryVariant==="label"?styles25.categoryLabel:styles25.category,testID:`health-plan-category-${item.productId}`,children:item.category}):null,full=addButtonSize==="full",{height:height,hit:hit}=healthPlanAddButtonHeight(addButtonSize),slop=(hit-height)/2,fontPx=healthPlanLength(addButtonFontSize),pillStyle=full?styles25.add:[styles25.addCompact,{minHeight:height,paddingHorizontal:height>=40?theme.space.lg:theme.space.md}],pillLabel=pressed=>[full||height>=40?styles25.addLabel:styles25.addCompactLabel,pressed?styles25.addPressedLabel:null,fontPx===null||fontPx===0?null:{fontSize:fontPx,lineHeight:Math.round(fontPx*theme.type.lineHeight.snug)}],hitSlop=slop>0?{top:slop,bottom:slop,left:0,right:0}:void 0,title=/* @__PURE__ */jsxRuntime.jsx(Text,{style:[thumbnail?styles25.thumbTitle:styles25.title,titleSized],accessibilityRole:"header",children:item.title}),sample=item.sample?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:styles25.sample,children:/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"badge",style:styles25.sampleLabel,children:HEALTH_PLAN_COPY.sample})}):null,description=item.description===null?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:styles25.body,children:item.description}),control=item.inPlan&&addedVariant==="pressed"?
|
|
379
400
|
/* @__PURE__ */jsxRuntime.jsx(reactNative.Pressable,{onPress:()=>onToggle?.(false),disabled:pending,accessibilityRole:"button",accessibilityLabel:HEALTH_PLAN_COPY.added,accessibilityState:{disabled:pending,busy:pending,selected:true},style:[pillStyle,styles25.addPressed,pending?styles25.dimmed:null],...hitSlop?{hitSlop:hitSlop}:{},testID:`health-plan-added-${item.productId}`,children:/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"control",style:pillLabel(true),children:HEALTH_PLAN_COPY.added})}):item.inPlan?/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:styles25.row,children:[
|
|
380
401
|
/* @__PURE__ */jsxRuntime.jsx(Text,{style:styles25.added,children:HEALTH_PLAN_COPY.added}),
|
|
381
402
|
/* @__PURE__ */jsxRuntime.jsx(reactNative.Pressable,{onPress:()=>onToggle?.(false),disabled:pending,accessibilityRole:"button",accessibilityLabel:HEALTH_PLAN_COPY.remove,accessibilityState:{disabled:pending,busy:pending},style:styles25.remove,testID:`health-plan-remove-${item.productId}`,children:/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"control",style:styles25.removeLabel,children:HEALTH_PLAN_COPY.remove})})]}):/* @__PURE__ */jsxRuntime.jsx(reactNative.Pressable,{onPress:()=>onToggle?.(true),disabled:pending,accessibilityRole:"button",accessibilityLabel:HEALTH_PLAN_COPY.addToCart,accessibilityState:{disabled:pending,busy:pending,...addedVariant==="pressed"?{selected:false}:{}},style:[pillStyle,pending?styles25.dimmed:null],...hitSlop?{hitSlop:hitSlop}:{},testID:`health-plan-add-${item.productId}`,children:/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"control",style:pillLabel(false),children:HEALTH_PLAN_COPY.addToCart})});/* @__PURE__ */
|
|
@@ -383,13 +404,33 @@ return jsxRuntime.jsxs(reactNative.View,{style:[styles25.card,shadow,cardBorder?
|
|
|
383
404
|
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:styles25.thumbCopy,children:[category,title,sample,description]})]}):/* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[item.imageUrl===null?null:/* @__PURE__ */jsxRuntime.jsx(reactNative.Image,{source:{uri:item.imageUrl},style:styles25.image,resizeMode:"cover",accessibilityIgnoresInvertColors:true}),category,
|
|
384
405
|
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:styles25.head,children:[title,priceNode]}),sample,description]}),item.reasons.map((reason,index)=>/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:[rows?styles25.reasonRow:styles25.reason,labelGap===null?null:{gap:labelGap}],testID:`health-plan-reason-${rows?"row":"pill"}`,children:[
|
|
385
406
|
/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"compact",style:[rows?styles25.reasonRowKind:styles25.reasonKind,rows&&labelWidth!==null?{width:labelWidth}:null],children:HEALTH_PLAN_REASON_LABELS[reason.kind]}),
|
|
386
|
-
/* @__PURE__ */jsxRuntime.jsx(Text,{style:[rows?styles25.reasonRowText:styles25.reasonText,reasonSized],children:reason.text})]},`${reason.kind}-${index}`)),renderFooter===void 0?null:/* @__PURE__ */jsxRuntime.jsx(HostRender,{resetKey:item,render:()=>renderFooter(item),fallback:null}),thumbnail?/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:styles25.actionRow,children:[priceNode,control]}):control,error===null?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:styles25.error,accessibilityLiveRegion:"polite",children:error.displayMessage})]})}var THUMB_SIZE=64,COMPACT_HEIGHT=32,REASON_LABEL_WIDTH=72;function cardShadowStyle(shadow,soft,theme){if(shadow===true)return soft;if(shadow===void 0||shadow===false)return null;let spec=typeof shadow=="string"?parseHealthPlanShadow(shadow):shadow;if(spec===null)return null;let rgba=toRgba(spec.color);if(rgba===null)return null;let blur=Math.max(0,spec.blur);return{shadowColor:`rgb(${rgba.r}, ${rgba.g}, ${rgba.b})`,shadowOffset:{width:spec.offsetX??0,height:spec.offsetY},shadowRadius:blur/2,shadowOpacity:Math.min(1,Math.max(0,rgba.a*(spec.opacity??1))),elevation:Math.max(0,Math.min(theme.space.lg,Math.round(blur/2)))}}function makeStyles3(theme){let{color:color,radius:radius,space:space,type:type,slots:slots}=theme,text2=(size,ink,weight)=>({...face(theme,weight),fontSize:size,lineHeight:Math.round(size*type.lineHeight.snug),color:ink}),cardInk=slots.planCard?.textColor??slots.card?.textColor,reasonLabelInk=slots.planReasonLabel?.textColor??slots.chip?.textColor??color.brandInk;return reactNative.StyleSheet.create({card:{gap:space.sm,padding:space.lg,borderRadius:radius.lg,borderWidth:1,borderColor:color.brandBorder,backgroundColor:color.surface,...slotBox(slots.card,1),...slotBox(slots.planCard,1)},cardShadow:{shadowColor:color.shadow,shadowOffset:{width:0,height:space.xs},shadowRadius:space.md,shadowOpacity:.08,elevation:space.xs},cardNoBorder:{borderWidth:0},category:text2(type.size.caption,cardInk??color.text.secondary,"regular"),categoryLabel:{...face(theme,"monoMedium"),fontSize:type.size.micro,lineHeight:Math.round(type.size.micro*type.lineHeight.snug),letterSpacing:type.letterSpacing.monoWide,textTransform:"uppercase",color:reasonLabelInk},image:{width:"100%",aspectRatio:4/3,borderRadius:radius.md,backgroundColor:color.surfaceSubtle},thumbHead:{flexDirection:"row",alignItems:"flex-start",gap:space.md},thumb:{width:THUMB_SIZE,height:THUMB_SIZE,borderRadius:radius.md,backgroundColor:color.surfaceSubtle},thumbCopy:{flex:1,gap:space.xs},thumbTitle:text2(type.size.body,cardInk??color.text.primary,"bold"),actionRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:space.sm},reasonRow:{flexDirection:"row",alignItems:"flex-start",gap:space.lg},reasonRowKind:{width:REASON_LABEL_WIDTH,paddingTop:2,...face(theme,"monoMedium"),fontSize:type.size.micro,lineHeight:Math.round(type.size.micro*type.lineHeight.snug),letterSpacing:type.letterSpacing.monoWide,textTransform:"uppercase",color:reasonLabelInk},reasonRowText:{flex:1,...text2(type.size.caption,cardInk??color.text.secondary,"regular")},head:{flexDirection:"row",alignItems:"baseline",justifyContent:"space-between",gap:space.sm},title:{flex:1,...text2(type.size.body,cardInk??color.text.primary,"bold")},price:text2(type.size.body,cardInk??color.text.primary,"bold"),sample:{alignSelf:"flex-start",paddingHorizontal:space.sm,paddingVertical:2,borderRadius:radius.pill,backgroundColor:color.badgeBgNeutral},sampleLabel:text2(type.size.caption,color.text.secondary,"bold"),body:text2(type.size.caption,cardInk??color.text.secondary,"regular"),reason:{flexDirection:"row",alignItems:"baseline",gap:space.sm,paddingHorizontal:space.sm,paddingVertical:space.xs,borderRadius:radius.md,backgroundColor:color.brandSofter,...slotBox(slots.chip,1)},reasonKind:{...text2(type.size.caption,color.brandInk,"bold"),textTransform:"uppercase",letterSpacing:.4,...slotText(slots.chip)},reasonText:{flex:1,...text2(type.size.caption,color.text.secondary,"regular"),...slotText(slots.chip)},row:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:space.sm},added:text2(type.size.caption,color.brandInk,"bold"),add:{minHeight:44,paddingHorizontal:space.lg,borderRadius:radius.pill,alignItems:"center",justifyContent:"center",backgroundColor:color.brand,...slotBox(slots.primaryButton)},addLabel:{...text2(type.size.body,color.text.onBrand,"bold"),...slotText(slots.primaryButton)},addCompact:{minHeight:COMPACT_HEIGHT,alignSelf:"flex-start",paddingHorizontal:space.md,borderRadius:radius.pill,alignItems:"center",justifyContent:"center",backgroundColor:color.brand,...slotBox(slots.primaryButton)},addCompactLabel:{...text2(type.size.caption,color.text.onBrand,"bold"),...slotText(slots.primaryButton)},addPressed:{backgroundColor:color.brandInk,borderWidth:0},addPressedLabel:{color:readableOn(color.brandInk)},remove:{minHeight:44,justifyContent:"center"},removeLabel:{...text2(type.size.caption,color.linkInk,"bold"),...slotText(slots.link)},dimmed:{opacity:.5},error:text2(type.size.caption,color.errorRed,"regular")})}var
|
|
407
|
+
/* @__PURE__ */jsxRuntime.jsx(Text,{style:[rows?styles25.reasonRowText:styles25.reasonText,reasonSized],children:reason.text})]},`${reason.kind}-${index}`)),renderFooter===void 0?null:/* @__PURE__ */jsxRuntime.jsx(HostRender,{resetKey:item,render:()=>renderFooter(item),fallback:null}),thumbnail?/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:styles25.actionRow,children:[priceNode,control]}):control,error===null?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:styles25.error,accessibilityLiveRegion:"polite",children:error.displayMessage})]})}var THUMB_SIZE=64,COMPACT_HEIGHT=32,REASON_LABEL_WIDTH=72;function cardShadowStyle(shadow,soft,theme){if(shadow===true)return soft;if(shadow===void 0||shadow===false)return null;let spec=typeof shadow=="string"?parseHealthPlanShadow(shadow):shadow;if(spec===null)return null;let rgba=toRgba(spec.color);if(rgba===null)return null;let blur=Math.max(0,spec.blur);return{shadowColor:`rgb(${rgba.r}, ${rgba.g}, ${rgba.b})`,shadowOffset:{width:spec.offsetX??0,height:spec.offsetY},shadowRadius:blur/2,shadowOpacity:Math.min(1,Math.max(0,rgba.a*(spec.opacity??1))),elevation:Math.max(0,Math.min(theme.space.lg,Math.round(blur/2)))}}function makeStyles3(theme){let{color:color,radius:radius,space:space,type:type,slots:slots}=theme,text2=(size,ink,weight)=>({...face(theme,weight),fontSize:size,lineHeight:Math.round(size*type.lineHeight.snug),color:ink}),cardInk=slots.planCard?.textColor??slots.card?.textColor,reasonLabelInk=slots.planReasonLabel?.textColor??slots.chip?.textColor??color.brandInk;return reactNative.StyleSheet.create({card:{gap:space.sm,padding:space.lg,borderRadius:radius.lg,borderWidth:1,borderColor:color.brandBorder,backgroundColor:color.surface,...slotBox(slots.card,1),...slotBox(slots.planCard,1)},cardShadow:{shadowColor:color.shadow,shadowOffset:{width:0,height:space.xs},shadowRadius:space.md,shadowOpacity:.08,elevation:space.xs},cardNoBorder:{borderWidth:0},category:text2(type.size.caption,cardInk??color.text.secondary,"regular"),categoryLabel:{...face(theme,"monoMedium"),fontSize:type.size.micro,lineHeight:Math.round(type.size.micro*type.lineHeight.snug),letterSpacing:type.letterSpacing.monoWide,textTransform:"uppercase",color:reasonLabelInk},image:{width:"100%",aspectRatio:4/3,borderRadius:radius.md,backgroundColor:color.surfaceSubtle},thumbHead:{flexDirection:"row",alignItems:"flex-start",gap:space.md},thumb:{width:THUMB_SIZE,height:THUMB_SIZE,borderRadius:radius.md,backgroundColor:color.surfaceSubtle},thumbCopy:{flex:1,gap:space.xs},thumbTitle:text2(type.size.body,cardInk??color.text.primary,"bold"),actionRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:space.sm},reasonRow:{flexDirection:"row",alignItems:"flex-start",gap:space.lg},reasonRowKind:{width:REASON_LABEL_WIDTH,paddingTop:2,...face(theme,"monoMedium"),fontSize:type.size.micro,lineHeight:Math.round(type.size.micro*type.lineHeight.snug),letterSpacing:type.letterSpacing.monoWide,textTransform:"uppercase",color:reasonLabelInk},reasonRowText:{flex:1,...text2(type.size.caption,cardInk??color.text.secondary,"regular")},head:{flexDirection:"row",alignItems:"baseline",justifyContent:"space-between",gap:space.sm},title:{flex:1,...text2(type.size.body,cardInk??color.text.primary,"bold")},price:text2(type.size.body,cardInk??color.text.primary,"bold"),sample:{alignSelf:"flex-start",paddingHorizontal:space.sm,paddingVertical:2,borderRadius:radius.pill,backgroundColor:color.badgeBgNeutral},sampleLabel:text2(type.size.caption,color.text.secondary,"bold"),body:text2(type.size.caption,cardInk??color.text.secondary,"regular"),reason:{flexDirection:"row",alignItems:"baseline",gap:space.sm,paddingHorizontal:space.sm,paddingVertical:space.xs,borderRadius:radius.md,backgroundColor:color.brandSofter,...slotBox(slots.chip,1)},reasonKind:{...text2(type.size.caption,color.brandInk,"bold"),textTransform:"uppercase",letterSpacing:.4,...slotText(slots.chip)},reasonText:{flex:1,...text2(type.size.caption,color.text.secondary,"regular"),...slotText(slots.chip)},row:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:space.sm},added:text2(type.size.caption,color.brandInk,"bold"),add:{minHeight:44,paddingHorizontal:space.lg,borderRadius:radius.pill,alignItems:"center",justifyContent:"center",backgroundColor:color.brand,...slotBox(slots.primaryButton)},addLabel:{...text2(type.size.body,color.text.onBrand,"bold"),...slotText(slots.primaryButton)},addCompact:{minHeight:COMPACT_HEIGHT,alignSelf:"flex-start",paddingHorizontal:space.md,borderRadius:radius.pill,alignItems:"center",justifyContent:"center",backgroundColor:color.brand,...slotBox(slots.primaryButton)},addCompactLabel:{...text2(type.size.caption,color.text.onBrand,"bold"),...slotText(slots.primaryButton)},addPressed:{backgroundColor:color.brandInk,borderWidth:0},addPressedLabel:{color:readableOn(color.brandInk)},remove:{minHeight:44,justifyContent:"center"},removeLabel:{...text2(type.size.caption,color.linkInk,"bold"),...slotText(slots.link)},dimmed:{opacity:.5},error:text2(type.size.caption,color.errorRed,"regular")})}var NEED_HEIGHT=478;function HealthPlanPageSkeleton({style:style}){let k2=useHealthPlanRnKit({}),X=k2.S.X,{bx:bx}=k2.S.D,tile2=X.roles.tile,bar=(width,height,marginTop=0)=>({width:width,height:height,marginTop:marginTop,borderRadius:6,backgroundColor:tile2}),title=X.title.text,sub=X.subtitle.text;/* @__PURE__ */
|
|
408
|
+
return jsxRuntime.jsxs(reactNative.View,{style:[...bx("root"),{flexGrow:1},style],accessible:true,accessibilityRole:"progressbar",accessibilityLabel:HEALTH_PLAN_COPY.loading,accessibilityState:{busy:true},testID:"health-plan-loading",children:[
|
|
409
|
+
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("head"),children:[
|
|
410
|
+
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:gridCell(X.head,0),children:[
|
|
411
|
+
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bar("40%",Number(X.eyebrow.text.lineHeight??16))}),
|
|
412
|
+
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bar("70%",Number(title.lineHeight??30),6)}),
|
|
413
|
+
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bar("90%",Number(sub.lineHeight??22),Number(X.subtitle.box.marginTop??6))})]}),
|
|
414
|
+
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[...bx("headImage"),KEEP]})]}),
|
|
415
|
+
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:[...bx("by"),{minHeight:60}],children:[
|
|
416
|
+
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[...bx("byIcon"),KEEP]}),
|
|
417
|
+
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:[gridCell(X.by,1),{gap:6}],children:[
|
|
418
|
+
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bar("70%",14)}),
|
|
419
|
+
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bar("30%",10)})]})]}),
|
|
420
|
+
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:[...bx("need"),{height:NEED_HEIGHT,gap:12}],children:[
|
|
421
|
+
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bar("35%",16)}),
|
|
422
|
+
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bar("60%",22)}),
|
|
423
|
+
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bar("100%",44)}),
|
|
424
|
+
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bar("100%",64,4)}),
|
|
425
|
+
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bar("100%",120,4)})]})]})}function HealthPlanErrorCard({style:style,children:children}){let k2=useHealthPlanRnKit({}),{bx:bx}=k2.S.D;/* @__PURE__ */
|
|
426
|
+
return jsxRuntime.jsx(reactNative.View,{style:[...bx("root"),style],testID:"health-plan-error",children:/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("sec"),children:children})})}var FOCUS_CALLBACKS=["onBuy","onMore","onExtra","onAddToVisit","onOverlayChange","onSubscriptionChange","onOneBoxOrder","onJump","onOrderHelp","onWeightSaved","onConnectRecords","onWaitAction","navigate"];function EverfurHealthPlan(props){let guarded=guardHostProps(props,["onCheckout","onAvailability","onAvailabilityChange","onAsk"]),theme=usePlanTheme(),styles25=react.useMemo(()=>makeStyles4(theme),[theme]),rawFocus=props.focus,focus=react.useMemo(()=>rawFocus===void 0?void 0:guardHostProps(rawFocus,FOCUS_CALLBACKS),[rawFocus]),{lifecycle:lifecycle,refreshKey:refreshKey,presentation:presentation,onAvailability:onAvailability,onAvailabilityChange:onAvailabilityChange,...bodyProps}=guarded,availabilityRef=react.useRef({onAvailability:onAvailability,onAvailabilityChange:onAvailabilityChange});availabilityRef.current={onAvailability:onAvailability,onAvailabilityChange:onAvailabilityChange};let report=react.useMemo(()=>(available,petRef)=>{let{onAvailability:next,onAvailabilityChange:old}=availabilityRef.current;next?.(available,petRef),old?.(available)},[]),resolved=useEverfurPresentation(presentation===void 0?void 0:definedPresentation({healthPlanLayout:presentation.healthPlanLayout,serverSlots:presentation.serverSlots})),layout=resolved.healthPlanLayout,plan=useEverfurHealthPlan({...guarded.petRef===void 0?{}:{petRef:guarded.petRef},...lifecycle===void 0?{}:{lifecycle:lifecycle},...refreshKey===void 0?{}:{refreshKey:refreshKey}});return plan.status==="signedOut"?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[styles25.page,guarded.style],children:/* @__PURE__ */jsxRuntime.jsx(Text,{style:styles25.body,children:HEALTH_PLAN_COPY.signedOut})}):/* @__PURE__ */jsxRuntime.jsx(SlotSwitchContext.Provider,{value:resolved.serverSlots,children:/* @__PURE__ */jsxRuntime.jsx(CapabilityGate,{capability:"healthPlan",...guarded.renderDisabled?{renderDisabled:guarded.renderDisabled}:{},style:guarded.style,children:/* @__PURE__ */jsxRuntime.jsx(PlanBody,{...bodyProps,plan:plan,styles:styles25,focusLayout:layout==="focus_plan",...focus===void 0?{}:{focus:focus},onReport:report,...lifecycle===void 0?{}:{lifecycle:lifecycle},...refreshKey===void 0?{}:{refreshKey:refreshKey}})})})}function useAvailability(available,petRef,report){react.useEffect(()=>{available!==null&&report(available,petRef)},[available,petRef,report])}function Refused({error:error,retry:retry,renderNotice:renderNotice,styles:styles25,style:style}){let signIn=isHealthPlanSessionRequired(error),line=signIn?HEALTH_PLAN_COPY.signedOut:error?.displayMessage??"";/* @__PURE__ */
|
|
387
427
|
return jsxRuntime.jsx(reactNative.View,{style:style,children:/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:styles25.notice,accessibilityLiveRegion:"polite",children:[error===null?null:/* @__PURE__ */jsxRuntime.jsx(HostRender,{resetKey:error,render:()=>renderNotice?renderNotice(error):/* @__PURE__ */jsxRuntime.jsx(Text,{style:styles25.noticeText,children:line}),fallback:/* @__PURE__ */jsxRuntime.jsx(Text,{style:styles25.noticeText,children:line})}),signIn?null:/* @__PURE__ */jsxRuntime.jsx(reactNative.Pressable,{onPress:retry,accessibilityRole:"button",accessibilityLabel:HEALTH_PLAN_COPY.retry,style:styles25.retry,testID:"health-plan-retry",children:/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"control",style:styles25.retryLabel,children:HEALTH_PLAN_COPY.retry})})]})})}function Loading({styles:styles25,style:style}){/* @__PURE__ */
|
|
388
428
|
return jsxRuntime.jsxs(reactNative.View,{style:[styles25.page,style],accessible:true,accessibilityRole:"progressbar",accessibilityLabel:HEALTH_PLAN_COPY.loading,accessibilityState:{busy:true},testID:"health-plan-loading",children:[
|
|
389
429
|
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:styles25.skeletonTitle}),
|
|
390
430
|
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:styles25.skeletonCard}),
|
|
391
431
|
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:styles25.skeletonCard})]})}function Empty({emptyCopy:emptyCopy,onAsk:onAsk,heading:heading,header:header,styles:styles25,style:style}){let words2={emptyTitle:emptyCopy?.emptyTitle??HEALTH_PLAN_COPY.emptyTitle,emptyBody:emptyCopy?.emptyBody??HEALTH_PLAN_COPY.emptyBody,emptyAsk:emptyCopy?.emptyAsk??HEALTH_PLAN_COPY.emptyAsk};return words2.emptyTitle.trim()===""&&words2.emptyBody.trim()===""?null:/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:style,testID:"health-plan-empty",children:[heading,header,
|
|
392
|
-
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:styles25.empty,children:[words2.emptyTitle.trim()===""?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:styles25.subtitle,children:words2.emptyTitle}),words2.emptyBody.trim()===""?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:styles25.body,children:words2.emptyBody}),words2.emptyAsk.trim()===""||onAsk===void 0?null:/* @__PURE__ */jsxRuntime.jsx(reactNative.Pressable,{onPress:()=>onAsk(),accessibilityRole:"button",style:styles25.retry,testID:"health-plan-empty-ask",children:/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"control",style:styles25.retryLabel,children:words2.emptyAsk})})]})]})}function FocusBody({plan:plan,focus:focus,styles:styles25,style:style,petName:petName,petSpecies:petSpecies,onCheckout:onCheckout,renderNotice:renderNotice,priceFormat:priceFormat,showCategory:showCategory,lifecycle:lifecycle,refreshKey:refreshKey,onAvailable:onAvailable,list:list,empty:empty}){let fromBackend=focus.design===void 0,page=useHealthPlanPage({petRef:plan.petRef,enabled:fromBackend,...focus.pageRepository?{repository:focus.pageRepository}:{},...lifecycle===void 0?{}:{lifecycle:lifecycle},...refreshKey===void 0?{}:{refreshKey:refreshKey}}),design=focus.design,checkout,weightKnown=focus.weightKnown,name=petName,sex=focus.petSex??null,species=petSpecies,vetReviewed=false,pageTexts=false,state2="ready";fromBackend&&(page.phase==="failed"?state2=isHealthPlanSessionRequired(page.error)?"failed":"list":page.missing?state2="list":page.page===null?state2="loading":page.page.page===null?state2="list":(design=page.page.page,checkout=page.page.checkout,weightKnown??=page.page.pet.weightKg!==null,name=page.page.pet.name??petName,sex=page.page.pet.sex??sex,species=page.page.pet.species??petSpecies,vetReviewed=page.page.vetReviewed===true,pageTexts=page.page.trackingTextsEnabled===true));let itemless=plan.status==="empty";itemless&&state2!=="loading"&&(state2=state2==="ready"&&healthPlanPageDrawsWithoutItems(design)?"ready":"hidden"),itemless&&state2==="ready"&&design!==void 0&&(design=withoutProductPart(design));let items=plan.plan?.items??[],pick2=design?.pick,picked=pick2===void 0?void 0:items.find(item=>pick2.productId!==void 0&&item.productId===pick2.productId)??items.find(item=>pick2.partnerSku!==void 0&&item.partnerSku===pick2.partnerSku)??items[0]??(itemless?NO_PLAN_ITEM:void 0);if(state2==="ready"&&(design===void 0||picked===void 0||plan.petRef===null)&&(state2="hidden"),react.useEffect(()=>{onAvailable(state2==="ready"||state2==="list"?true:state2==="hidden"?false:null)},[state2,onAvailable]),state2==="list")return list;if(state2==="failed")/* @__PURE__ */
|
|
432
|
+
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:styles25.empty,children:[words2.emptyTitle.trim()===""?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:styles25.subtitle,children:words2.emptyTitle}),words2.emptyBody.trim()===""?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:styles25.body,children:words2.emptyBody}),words2.emptyAsk.trim()===""||onAsk===void 0?null:/* @__PURE__ */jsxRuntime.jsx(reactNative.Pressable,{onPress:()=>onAsk(),accessibilityRole:"button",style:styles25.retry,testID:"health-plan-empty-ask",children:/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"control",style:styles25.retryLabel,children:words2.emptyAsk})})]})]})}function FocusBody({plan:plan,focus:focus,styles:styles25,style:style,petName:petName,petSpecies:petSpecies,onCheckout:onCheckout,renderNotice:renderNotice,priceFormat:priceFormat,showCategory:showCategory,lifecycle:lifecycle,refreshKey:refreshKey,onAvailable:onAvailable,list:list,empty:empty}){let fromBackend=focus.design===void 0,page=useHealthPlanPage({petRef:plan.petRef,enabled:fromBackend,...focus.pageRepository?{repository:focus.pageRepository}:{},...lifecycle===void 0?{}:{lifecycle:lifecycle},...refreshKey===void 0?{}:{refreshKey:refreshKey}}),design=focus.design,checkout,weightKnown=focus.weightKnown,name=petName,sex=focus.petSex??null,species=petSpecies,vetReviewed=false,pageTexts=false,state2="ready";fromBackend&&(page.phase==="failed"?state2=isHealthPlanSessionRequired(page.error)?"failed":"list":page.missing?state2="list":page.page===null?state2="loading":page.page.page===null?state2="list":(design=page.page.page,checkout=page.page.checkout,weightKnown??=page.page.pet.weightKg!==null,name=page.page.pet.name??petName,sex=page.page.pet.sex??sex,species=page.page.pet.species??petSpecies,vetReviewed=page.page.vetReviewed===true,pageTexts=page.page.trackingTextsEnabled===true));let itemless=plan.status==="empty";itemless&&state2!=="loading"&&(state2=state2==="ready"&&healthPlanPageDrawsWithoutItems(design)?"ready":"hidden"),itemless&&state2==="ready"&&design!==void 0&&(design=withoutProductPart(design));let items=plan.plan?.items??[],pick2=design?.pick,picked=pick2===void 0?void 0:items.find(item=>pick2.productId!==void 0&&item.productId===pick2.productId)??items.find(item=>pick2.partnerSku!==void 0&&item.partnerSku===pick2.partnerSku)??items[0]??(itemless?NO_PLAN_ITEM:void 0);if(state2==="ready"&&(design===void 0||picked===void 0||plan.petRef===null)&&(state2="hidden"),react.useEffect(()=>{onAvailable(state2==="ready"||state2==="list"?true:state2==="hidden"?false:null)},[state2,onAvailable]),state2==="list")return list;if(state2==="failed")/* @__PURE__ */
|
|
433
|
+
return jsxRuntime.jsx(HealthPlanErrorCard,{style:style,children:/* @__PURE__ */jsxRuntime.jsx(Refused,{error:page.error,retry:()=>{page.refresh()},renderNotice:renderNotice,styles:styles25,style:null})});if(state2==="loading")/* @__PURE__ */return jsxRuntime.jsx(HealthPlanPageSkeleton,{style:style});if(state2==="hidden"&&itemless)return empty;if(state2==="hidden"||design===void 0||picked===void 0||plan.petRef===null)return null;let onWeightSaved=focus.onWeightSaved,pageRefresh=page.refresh;/* @__PURE__ */
|
|
393
434
|
return jsxRuntime.jsx(HealthPlanFocus,{...focus,design:design,...checkout?{checkout:checkout}:{},...weightKnown===void 0?{}:{weightKnown:weightKnown},...fromBackend?{onWeightSaved:kg=>{onWeightSaved&&callHost(onWeightSaved,kg),pageRefresh()}}:{},item:picked,others:items.filter(item=>item!==picked),...showCategory!==void 0?{showCategory:showCategory}:{},...lifecycle===void 0?{}:{lifecycle:lifecycle},...refreshKey===void 0?{}:{refreshKey:refreshKey},petRef:plan.petRef,petName:name,petSex:sex,species:species,fromBackend:fromBackend,vetReviewed:vetReviewed,trackingTexts:fromBackend?pageTexts:focus.trackingTexts??plan.plan?.trackingTextsEnabled===true,...onCheckout?{onCheckout:onCheckout}:{},...priceFormat?{priceFormat:priceFormat}:{},style:style},plan.petRef)}function PlanBody({plan:plan,styles:styles25,onCheckout:onCheckout,renderNotice:renderNotice,style:style,imageVariant:imageVariant,reasonVariant:reasonVariant,cartBarVisibility:cartBarVisibility,priceFormat:priceFormat,renderHeader:renderHeader,renderItemFooter:renderItemFooter,renderFooter:renderFooter,titleSize:titleSize,titleGap:titleGap,sectionGap:sectionGap,cartBarPlacement:cartBarPlacement,titleLineHeight:titleLineHeight,renderBetweenItems:renderBetweenItems,focusLayout:focusLayout,focus:focus,onReport:onReport,onAsk:onAsk,emptyCopy:emptyCopy,lifecycle:lifecycle,refreshKey:refreshKey,...cardProps}){let theme=usePlanTheme(),{pets:pets}=useEverfurPets(),pet=pets.find(p=>p.petRef===plan.petRef),petName=pet?.name??null,[focusAvailable,setFocusAvailable]=react.useState(null);useAvailability(plan.status==="empty"?focusLayout?focusAvailable:false:plan.status==="ready"?focusLayout?focusAvailable:true:null,plan.petRef,onReport);let title=plan.plan?.headline??(petName===null?null:HEALTH_PLAN_TEMPLATES.planTitle(petName)),docked=cartBarPlacement==="none";usePublishHealthPlanCart(docked&&plan.status==="ready",plan.cart,plan.pending.length>0,plan.petRef,plan.plan,plan.setInPlan);let telemetry=useHealthPlanTelemetry();useHealthPlanOpened(plan.status==="ready"||plan.status==="empty",plan.petRef,plan.plan);let gap=healthPlanLength(sectionGap),pageStyle=gap===null?styles25.page:[styles25.page,{gap:gap}],size=healthPlanLength(titleSize),ratio=healthPlanLength(titleLineHeight),titleStyle=[styles25.title,size===null||size===0?null:{fontSize:size,lineHeight:Math.round(size*theme.type.lineHeight.snug)},ratio===null||ratio===0?null:{lineHeight:Math.round((size===null||size===0?theme.type.size.heading:size)*ratio)},{marginBottom:healthPlanTitleOffset(titleGap,gap??theme.space.lg)}],heading=title===null?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:titleStyle,accessibilityRole:"header",children:title}),writes=react.useMemo(()=>healthPlanWrites(plan.plan,plan.setInPlan),[plan.plan,plan.setInPlan]),context={petRef:plan.petRef,plan:plan.plan,cart:plan.cart,...writes},cardOptions=pickHealthPlanCardOptions(cardProps),between=(index,item)=>renderBetweenItems===void 0||index===0?null:/* @__PURE__ */jsxRuntime.jsx(HostRender,{resetKey:item,render:()=>renderBetweenItems(index,item),fallback:null}),header=renderHeader===void 0?null:/* @__PURE__ */jsxRuntime.jsx(HostRender,{resetKey:plan.plan,render:()=>renderHeader(context),fallback:null});if(plan.status==="noPet")/* @__PURE__ */
|
|
394
435
|
return jsxRuntime.jsx(reactNative.View,{style:[pageStyle,style],children:/* @__PURE__ */jsxRuntime.jsx(Text,{style:styles25.body,children:HEALTH_PLAN_COPY.choosePet})});if(plan.status==="loading")/* @__PURE__ */return jsxRuntime.jsx(Loading,{styles:styles25,style:[gap===null?null:{gap:gap},style]});if(plan.status==="failed")/* @__PURE__ */return jsxRuntime.jsx(Refused,{error:plan.error,retry:()=>{plan.refresh()},renderNotice:renderNotice,styles:styles25,style:[pageStyle,style]});let empty=/* @__PURE__ */jsxRuntime.jsx(Empty,{emptyCopy:emptyCopy,onAsk:onAsk,heading:heading,header:header,styles:styles25,style:[pageStyle,style]});if(plan.status==="empty"&&!focusLayout)return empty;let items=plan.plan?.items??[],list=/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:[pageStyle,style],children:[heading,header,items.map((item,index)=>/* @__PURE__ */jsxRuntime.jsxs(react.Fragment,{children:[between(index,item),
|
|
395
436
|
/* @__PURE__ */jsxRuntime.jsx(HealthPlanItemCard,{item:item,pending:plan.pending.includes(item.productId),error:plan.itemErrors[item.productId]??null,onToggle:inPlan=>{trackProductClicked(telemetry,plan.petRef,item.productId,inPlan),plan.setInPlan(item.productId,inPlan)},...imageVariant?{imageVariant:imageVariant}:{},...reasonVariant?{reasonVariant:reasonVariant}:{},...priceFormat?{priceFormat:priceFormat}:{},...renderItemFooter?{renderFooter:renderItemFooter}:{},...cardOptions})]},item.productId)),renderFooter===void 0?null:/* @__PURE__ */jsxRuntime.jsx(HostRender,{resetKey:plan.plan,render:()=>renderFooter(context),fallback:null}),!docked&&showHealthPlanCartBar(cartBarVisibility,plan.cart.count)?/* @__PURE__ */jsxRuntime.jsx(HealthPlanPetScope,{petRef:plan.petRef,children:/* @__PURE__ */jsxRuntime.jsx(HealthPlanCartBar,{cart:plan.cart,busy:plan.pending.length>0,...onCheckout?{onCheckout:onCheckout}:{},...priceFormat?{priceFormat:priceFormat}:{}})}):null]});return focusLayout?/* @__PURE__ */jsxRuntime.jsx(FocusBody,{plan:plan,focus:focus??{},styles:styles25,style:style,petName:petName,petSpecies:pet?.species??null,onCheckout:onCheckout,renderNotice:renderNotice,priceFormat:priceFormat,showCategory:cardOptions.showCategory,lifecycle:lifecycle,refreshKey:refreshKey,onAvailable:setFocusAvailable,list:list,empty:empty}):list}function makeStyles4(theme){let{color:color,radius:radius,space:space,type:type}=theme,text2=(size,ink,weight)=>({...face(theme,weight),fontSize:size,lineHeight:Math.round(size*type.lineHeight.snug),color:ink});return reactNative.StyleSheet.create({page:{gap:space.lg,padding:space.lg},title:{...text2(type.size.heading,color.text.primary,"bold"),...headingFace(theme,"bold")},subtitle:text2(type.size.body,color.text.primary,"bold"),body:text2(type.size.body,color.text.secondary,"regular"),notice:{gap:space.xs},noticeText:text2(type.size.caption,color.errorRed,"regular"),retry:{minHeight:44,justifyContent:"center",alignSelf:"flex-start"},retryLabel:text2(type.size.caption,color.linkInk,"bold"),empty:{gap:space.xs,padding:space.lg,borderRadius:radius.lg,backgroundColor:color.surfaceSubtle},skeletonTitle:{height:28,width:"50%",borderRadius:radius.sm,backgroundColor:color.skeleton},skeletonCard:{height:160,borderRadius:radius.lg,backgroundColor:color.skeleton}})}function HealthPlanTopRisk(props){let guarded=guardHostProps(props,["onOpenPlan"]),theme=usePlanTheme(),S=react.useMemo(()=>styles24(theme),[theme]);/* @__PURE__ */
|