@everfur/sdk 0.17.0 → 0.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (223) hide show
  1. package/CHANGELOG.md +167 -26
  2. package/care/package.json +8 -0
  3. package/dist/{Chat.d-uETscjrL.d.ts → Chat.d-Bz4iJ7d2.d.ts} +1 -1
  4. package/dist/{Chat.d-BYY1U61e.d.cts → Chat.d-C2ddC2u7.d.cts} +1 -1
  5. package/dist/{DepthViews.d-BsZ73mzL.d.ts → DepthViews.d-C6-Kzs6H.d.ts} +1 -1
  6. package/dist/{DepthViews.d-D_Qp4glO.d.cts → DepthViews.d-Chjs8H9V.d.cts} +1 -1
  7. package/dist/{DepthViews.d-DL8MP_kA.d.cts → DepthViews.d-pFL_ZBZT.d.cts} +1 -1
  8. package/dist/{DepthViews.d-B4SE5GUD.d.ts → DepthViews.d-qXt9OMgz.d.ts} +1 -1
  9. package/dist/{RecordsPage.d-CYotk2R9.d.cts → RecordsPage.d-Cmny6Q7g.d.cts} +2 -2
  10. package/dist/{RecordsPage.d-D4gP4leq.d.ts → RecordsPage.d-sNRolVdy.d.ts} +2 -2
  11. package/dist/animations/index.d.cts +5 -5
  12. package/dist/animations/index.d.ts +5 -5
  13. package/dist/{appStateLifecycle.d-DJXdDOJY.d.cts → appStateLifecycle.d-Bt70TQog.d.cts} +7 -7
  14. package/dist/{appStateLifecycle.d-CXJzBS3c.d.ts → appStateLifecycle.d-Jdg9_PFt.d.ts} +7 -7
  15. package/dist/{attachments.d-B8kOCb6q.d.cts → attachments.d-BVp3r6Ms.d.cts} +5 -5
  16. package/dist/{attachments.d-C61URT8r.d.cts → attachments.d-CF4_n-DZ.d.cts} +2 -2
  17. package/dist/{attachments.d-BTIGzXWD.d.ts → attachments.d-DnSCMjH0.d.ts} +5 -5
  18. package/dist/{attachments.d-BgatKf7d.d.ts → attachments.d-DsUZpMad.d.ts} +2 -2
  19. package/dist/{bookingCopy.d-B-bSYgqS.d.cts → bookingCopy.d-BHqE9Ozq.d.cts} +16 -16
  20. package/dist/{bookingCopy.d-JQW2SLM-.d.ts → bookingCopy.d-Ca4AQGZ7.d.ts} +16 -16
  21. package/dist/{branding.d-Bbc6p1XY.d.cts → branding.d-BFauULV6.d.cts} +1 -1
  22. package/dist/{branding.d-y6c0UwhE.d.ts → branding.d-DpNGEdDL.d.ts} +1 -1
  23. package/dist/care/index.cjs +3 -0
  24. package/dist/care/index.d.cts +434 -0
  25. package/dist/care/index.d.ts +434 -0
  26. package/dist/care/index.js +3 -0
  27. package/dist/{casesRepository.d-CVG2EXcg.d.cts → casesRepository.d-DFwD2kiS.d.cts} +1 -1
  28. package/dist/{casesRepository.d-CHEjzT4h.d.ts → casesRepository.d-VzxEyq2N.d.ts} +1 -1
  29. package/dist/chat/index.cjs +14 -13
  30. package/dist/chat/index.d.cts +13 -13
  31. package/dist/chat/index.d.ts +13 -13
  32. package/dist/chat/index.js +14 -13
  33. package/dist/chat/lite/index.cjs +14 -13
  34. package/dist/chat/lite/index.d.cts +13 -13
  35. package/dist/chat/lite/index.d.ts +13 -13
  36. package/dist/chat/lite/index.js +14 -13
  37. package/dist/chunk-Y3Q4GW47.js +31 -0
  38. package/dist/client/index.cjs +1 -1
  39. package/dist/client/index.d.cts +10 -10
  40. package/dist/client/index.d.ts +10 -10
  41. package/dist/client/index.js +1 -1
  42. package/dist/{clinicBatch.d-DdlFy4pD.d.cts → clinicBatch.d-CLqaih2C.d.cts} +2 -2
  43. package/dist/{clinicBatch.d-oNwH_dbI.d.ts → clinicBatch.d-DXDIL1lC.d.ts} +2 -2
  44. package/dist/{config.d-Cy_hJBJG.d.cts → config.d-7bCXvOGn.d.cts} +1 -1
  45. package/dist/{config.d-DopRLD4f.d.ts → config.d-cqyvpzDb.d.ts} +1 -1
  46. package/dist/consent/index.d.cts +5 -5
  47. package/dist/consent/index.d.ts +5 -5
  48. package/dist/{context.d-C42juGn6.d.cts → context.d-BeRanUXQ.d.cts} +7 -7
  49. package/dist/{context.d-Ban-Hhqu.d.ts → context.d-DAnmDYGr.d.ts} +7 -7
  50. package/dist/{copy.d-BTS5l6Ri.d.cts → copy.d-BPqs8swm.d.cts} +2 -2
  51. package/dist/{copy.d-qdbygul9.d.ts → copy.d-CxFzeuvo.d.ts} +2 -2
  52. package/dist/core/index.cjs +1 -1
  53. package/dist/core/index.d.cts +17 -17
  54. package/dist/core/index.d.ts +17 -17
  55. package/dist/core/index.js +1 -1
  56. package/dist/{depth.d-BGkHm2Se.d.ts → depth.d-C6XbnFig.d.ts} +2 -2
  57. package/dist/{depth.d-BfVrhq9o.d.cts → depth.d-qHdXHDd-.d.cts} +2 -2
  58. package/dist/{entitlementRepository.d-npT7L_7_.d.cts → entitlementRepository.d-C6uTDswj.d.cts} +4 -4
  59. package/dist/{entitlementRepository.d-CjwqCyhS.d.ts → entitlementRepository.d-D_cc7g4l.d.ts} +4 -4
  60. package/dist/{focus.d-S0nq_k1A.d.ts → focus.d-DiWvQR2j.d.ts} +193 -21
  61. package/dist/{focus.d-DS7Ze1Pp.d.cts → focus.d-HSkMHd-i.d.cts} +193 -21
  62. package/dist/health-plan/index.cjs +261 -176
  63. package/dist/health-plan/index.d.cts +627 -19
  64. package/dist/health-plan/index.d.ts +627 -19
  65. package/dist/health-plan/index.js +261 -176
  66. package/dist/{idempotency.d-COIrwuCb.d.ts → idempotency.d-CF5AvlYp.d.ts} +18 -639
  67. package/dist/{idempotency.d-gfiN4Qnp.d.cts → idempotency.d-DrO2zEZO.d.cts} +18 -639
  68. package/dist/{identity.d-D76vXtkJ.d.cts → identity.d-84x0dV7-.d.cts} +1 -1
  69. package/dist/{identity.d-B3mFvvRq.d.ts → identity.d-BXztMVYM.d.ts} +1 -1
  70. package/dist/index.cjs +12 -11
  71. package/dist/index.d.cts +21 -21
  72. package/dist/index.d.ts +21 -21
  73. package/dist/index.js +12 -11
  74. package/dist/{introEvents.d-3FLEemX3.d.cts → introEvents.d-Cwv72ER-.d.cts} +11 -11
  75. package/dist/{introEvents.d-BYnr37bd.d.ts → introEvents.d-DYU3znJs.d.ts} +11 -11
  76. package/dist/notifications/index.d.cts +4 -4
  77. package/dist/notifications/index.d.ts +4 -4
  78. package/dist/omsErrors.d-VF5tnr20.d.cts +633 -0
  79. package/dist/omsErrors.d-VF5tnr20.d.ts +633 -0
  80. package/dist/omsFields.d-BHntKIAH.d.cts +153 -0
  81. package/dist/omsFields.d-Cvfw8wWU.d.ts +153 -0
  82. package/dist/{optInView.d-DXRUGDiD.d.cts → optInView.d-4Hl4HbQh.d.cts} +3 -3
  83. package/dist/{optInView.d-BqFMcum4.d.ts → optInView.d-pq8tUTf6.d.ts} +3 -3
  84. package/dist/{parse.d-CY22hFxb.d.ts → parse.d-BJhhYfkv.d.ts} +1 -1
  85. package/dist/{parse.d-rvA_aRSO.d.cts → parse.d-D0v06qxx.d.cts} +1 -1
  86. package/dist/{pets.d-Cicz-aIO.d.ts → pets.d-1_CHpfgB.d.ts} +1 -1
  87. package/dist/{pets.d-RoHTZsaV.d.cts → pets.d-C4n-MDC4.d.cts} +1 -1
  88. package/dist/{petsRepository.d-DtAZf_Ja.d.ts → petsRepository.d-BuomdFjZ.d.ts} +1 -1
  89. package/dist/{petsRepository.d-BxMyt6Aj.d.cts → petsRepository.d-Dd95xh-M.d.cts} +1 -1
  90. package/dist/{ports.d-D7cjFUoL.d.cts → ports.d-Bf3tp7Pn.d.cts} +4 -4
  91. package/dist/{ports.d-DrgKa73F.d.ts → ports.d-ChZHFd-q.d.ts} +4 -4
  92. package/dist/{presentation.d-vy8kTGfR.d.cts → presentation.d-Bs8xQ4gD.d.cts} +4 -4
  93. package/dist/{presentation.d-vy8kTGfR.d.ts → presentation.d-Bs8xQ4gD.d.ts} +4 -4
  94. package/dist/records/depth/index.d.cts +9 -9
  95. package/dist/records/depth/index.d.ts +9 -9
  96. package/dist/records/index.cjs +11 -10
  97. package/dist/records/index.d.cts +24 -23
  98. package/dist/records/index.d.ts +24 -23
  99. package/dist/records/index.js +11 -10
  100. package/dist/{requestFunnel.d-BdQf53zs.d.cts → requestFunnel.d-CWI2pD3V.d.cts} +2 -2
  101. package/dist/{requestFunnel.d-B5y7Py8Z.d.ts → requestFunnel.d-DcQIAs45.d.ts} +2 -2
  102. package/dist/{resolve.d-CoQWUy1Y.d.cts → resolve.d-BTC3b6FW.d.cts} +1 -1
  103. package/dist/{resolve.d-CoQWUy1Y.d.ts → resolve.d-BTC3b6FW.d.ts} +1 -1
  104. package/dist/{runtimeTypes.d-r4Q5vASZ.d.cts → runtimeTypes.d-CIOVzjEK.d.cts} +6 -6
  105. package/dist/{runtimeTypes.d-D5EDgS3Y.d.ts → runtimeTypes.d-rbuONrIv.d.ts} +6 -6
  106. package/dist/{screenProps.d-v4a4kzxA.d.cts → screenProps.d-CFZe27oI.d.cts} +1 -1
  107. package/dist/{screenProps.d-KLCrP43b.d.ts → screenProps.d-yUA4k6yK.d.ts} +1 -1
  108. package/dist/server/events/index.cjs +2 -2
  109. package/dist/server/events/index.d.cts +49 -6
  110. package/dist/server/events/index.d.ts +49 -6
  111. package/dist/server/events/index.js +2 -2
  112. package/dist/server/index.cjs +1 -1
  113. package/dist/server/index.d.cts +3 -3
  114. package/dist/server/index.d.ts +3 -3
  115. package/dist/server/index.js +1 -1
  116. package/dist/shop/index.cjs +6 -6
  117. package/dist/shop/index.d.cts +9 -8
  118. package/dist/shop/index.d.ts +9 -8
  119. package/dist/shop/index.js +6 -6
  120. package/dist/shop/orders-v2/index.d.cts +2 -2
  121. package/dist/shop/orders-v2/index.d.ts +2 -2
  122. package/dist/tabs/index.cjs +4 -4
  123. package/dist/tabs/index.d.cts +14 -14
  124. package/dist/tabs/index.d.ts +14 -14
  125. package/dist/tabs/index.js +4 -4
  126. package/dist/{tabsModel.d-B7QMug1u.d.ts → tabsModel.d-D9GWPFrL.d.cts} +1 -1
  127. package/dist/{tabsModel.d-B7QMug1u.d.cts → tabsModel.d-D9GWPFrL.d.ts} +1 -1
  128. package/dist/televet/booking/index.d.cts +6 -6
  129. package/dist/televet/booking/index.d.ts +6 -6
  130. package/dist/testing/index.cjs +1 -1
  131. package/dist/testing/index.d.cts +85 -2
  132. package/dist/testing/index.d.ts +85 -2
  133. package/dist/testing/index.js +1 -1
  134. package/dist/testing/rn/index.d.cts +10 -10
  135. package/dist/testing/rn/index.d.ts +10 -10
  136. package/dist/testing/web/index.d.cts +10 -10
  137. package/dist/testing/web/index.d.ts +10 -10
  138. package/dist/texting/index.d.cts +6 -6
  139. package/dist/texting/index.d.ts +6 -6
  140. package/dist/{threadOptions.d-EFJaNBP1.d.cts → threadOptions.d-CRbFXnlq.d.cts} +66 -11
  141. package/dist/{threadOptions.d-GPJPprkn.d.cts → threadOptions.d-CW51PyVd.d.cts} +28 -1
  142. package/dist/{threadOptions.d-GPJPprkn.d.ts → threadOptions.d-CW51PyVd.d.ts} +28 -1
  143. package/dist/{threadOptions.d-B0folrKm.d.cts → threadOptions.d-U5YBUKM-.d.ts} +2 -2
  144. package/dist/{threadOptions.d-Crh_LiDe.d.ts → threadOptions.d-aK8FkszA.d.ts} +66 -11
  145. package/dist/{threadOptions.d-DTsJFkL-.d.ts → threadOptions.d-bEAFkIsC.d.cts} +2 -2
  146. package/dist/{timelineRows.d-DpSis9HR.d.ts → timelineRows.d-BbCLvjy1.d.ts} +1 -1
  147. package/dist/{timelineRows.d-6-Cw8xGd.d.cts → timelineRows.d-BvA_BoOe.d.cts} +1 -1
  148. package/dist/{typeStyle.d-B3Kdtjie.d.ts → typeStyle.d-B9Jo5mDX.d.ts} +1 -1
  149. package/dist/{typeStyle.d-DmlwyJq-.d.cts → typeStyle.d-Ckdh_S-t.d.cts} +1 -1
  150. package/dist/types.d-d3RdaeAA.d.cts +317 -0
  151. package/dist/types.d-d3RdaeAA.d.ts +317 -0
  152. package/dist/ui/index.cjs +68 -0
  153. package/dist/ui/index.d.cts +73 -0
  154. package/dist/ui/index.d.ts +73 -0
  155. package/dist/ui/index.js +68 -0
  156. package/dist/useHealthPlanSubscription.d-BN40CVK6.d.cts +756 -0
  157. package/dist/useHealthPlanSubscription.d-BYehTI7R.d.ts +756 -0
  158. package/dist/{usePresentation.d-CRG3Gaaq.d.ts → usePresentation.d-BfcyAEFt.d.ts} +66 -7
  159. package/dist/{usePresentation.d-C8rqY56C.d.cts → usePresentation.d-C39kKhoO.d.cts} +66 -7
  160. package/dist/{useRecordsDepth.d-DlRda5jp.d.ts → useRecordsDepth.d-B2ewVbRm.d.ts} +1 -1
  161. package/dist/{useRecordsDepth.d-BYk7m7gF.d.cts → useRecordsDepth.d-CKXAAHXI.d.cts} +1 -1
  162. package/dist/{view.d-DuIXHr08.d.ts → view.d-BnUDSQXz.d.ts} +3 -3
  163. package/dist/{view.d-B31M8rCG.d.cts → view.d-CbcJKNJj.d.cts} +1 -1
  164. package/dist/{view.d-B31M8rCG.d.ts → view.d-CbcJKNJj.d.ts} +1 -1
  165. package/dist/{view.d-CLpEHKOp.d.cts → view.d-DTNPjiZ1.d.cts} +3 -3
  166. package/dist/web/consent/index.d.cts +5 -5
  167. package/dist/web/consent/index.d.ts +5 -5
  168. package/dist/web/health-plan/index.cjs +335 -180
  169. package/dist/web/health-plan/index.d.cts +576 -19
  170. package/dist/web/health-plan/index.d.ts +576 -19
  171. package/dist/web/health-plan/index.js +297 -162
  172. package/dist/web/health-plan/styles.css +233 -0
  173. package/dist/web/health-plan/today/index.cjs +7 -0
  174. package/dist/web/health-plan/today/index.d.cts +15 -0
  175. package/dist/web/health-plan/today/index.d.ts +15 -0
  176. package/dist/web/health-plan/today/index.js +7 -0
  177. package/dist/web/index.cjs +36 -33
  178. package/dist/web/index.d.cts +60 -37
  179. package/dist/web/index.d.ts +60 -37
  180. package/dist/web/index.js +36 -33
  181. package/dist/web/intro/index.cjs +2 -2
  182. package/dist/web/intro/index.d.cts +8 -8
  183. package/dist/web/intro/index.d.ts +8 -8
  184. package/dist/web/intro/index.js +2 -2
  185. package/dist/web/notifications/index.d.cts +3 -3
  186. package/dist/web/notifications/index.d.ts +3 -3
  187. package/dist/web/records/depth/index.d.cts +9 -9
  188. package/dist/web/records/depth/index.d.ts +9 -9
  189. package/dist/web/records/index.cjs +1 -1
  190. package/dist/web/records/index.d.cts +11 -11
  191. package/dist/web/records/index.d.ts +11 -11
  192. package/dist/web/records/index.js +1 -1
  193. package/dist/web/records-sheet/index.cjs +13 -12
  194. package/dist/web/records-sheet/index.d.cts +13 -10
  195. package/dist/web/records-sheet/index.d.ts +13 -10
  196. package/dist/web/records-sheet/index.js +13 -12
  197. package/dist/web/shop/index.cjs +6 -6
  198. package/dist/web/shop/index.d.cts +8 -7
  199. package/dist/web/shop/index.d.ts +8 -7
  200. package/dist/web/shop/index.js +6 -6
  201. package/dist/web/shop/orders-v2/index.d.cts +1 -1
  202. package/dist/web/shop/orders-v2/index.d.ts +1 -1
  203. package/dist/web/televet/booking/index.cjs +1 -1
  204. package/dist/web/televet/booking/index.d.cts +6 -6
  205. package/dist/web/televet/booking/index.d.ts +6 -6
  206. package/dist/web/televet/booking/index.js +1 -1
  207. package/dist/web/texting/index.cjs +1 -1
  208. package/dist/web/texting/index.d.cts +6 -6
  209. package/dist/web/texting/index.d.ts +6 -6
  210. package/dist/web/texting/index.js +1 -1
  211. package/dist/web/ui/index.cjs +70 -0
  212. package/dist/web/ui/index.d.cts +78 -0
  213. package/dist/web/ui/index.d.ts +78 -0
  214. package/dist/web/ui/index.js +48 -0
  215. package/dist/web/ui/styles.css +244 -0
  216. package/package.json +71 -5
  217. package/ui/package.json +8 -0
  218. package/web/health-plan/today/native-blocked.cjs +12 -0
  219. package/web/health-plan/today/package.json +8 -0
  220. package/web/ui/native-blocked.cjs +12 -0
  221. package/web/ui/package.json +8 -0
  222. package/dist/useHealthPlanSubscription.d-DD30EkUR.d.ts +0 -205
  223. package/dist/useHealthPlanSubscription.d-DWrzUXf4.d.cts +0 -205
@@ -1,5 +1,5 @@
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 px=lengths.map(part=>part==="0"?0:/^-?\d*\.?\d+px$/.test(part)?Number(part.slice(0,-2)):Number.NaN);return px.some(n=>!Number.isFinite(n))?null:{color:color,offsetX:px[0]??0,offsetY:px[1]??0,blur:Math.max(0,px[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 DockContext=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__ */
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(part=>part==="0"?0:/^-?\d*\.?\d+px$/.test(part)?Number(part.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 DockContext=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
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 CONTRACT_RETRYABILITY=/* @__PURE__ */Object.freeze([
5
5
  /* @__PURE__ */Object.freeze({wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false}),
@@ -98,7 +98,8 @@ return Object.freeze({ok:false,error:error})}var EverfurConfigError=class _Everf
98
98
  return Object.freeze({kind:"error",terminal:true,code:fields.code,retryable:fields.retryable,wireMessage:fields.wireMessage,synthesized:fields.synthesized,lastEventId:fields.lastEventId,serverRequestId:null})}function mintFailedError(cause,refusal){let message=cause instanceof Error?cause.message:typeof cause=="string"?cause:null;return makeEverfurError("authRejected",{retryable:false,...refusal?.wireCode?{wireCode:refusal.wireCode}:{},...refusal?.requestId?{requestId:refusal.requestId}:{},...message?{wireMessage:message}:{},...cause!=null?{raw:cause}:{}})}function authHeaders(auth){let headers={};return auth.mode==="personalized"?headers.authorization=`Bearer ${auth.token}`:headers["x-everfur-partner-key"]=auth.publishableKey,auth.userRef&&(headers["x-everfur-user-ref"]=auth.userRef),auth.sessionId&&(headers["x-everfur-session-id"]=auth.sessionId),headers}function withAuthHeaders(req,auth){return{...req,headers:{...stripAuthHeaders(req.headers),...authHeaders(auth)}}}function stripAuthHeaders(headers){if(!headers)return{};let out={};for(let[key,value]of Object.entries(headers)){let lower=key.toLowerCase();lower==="authorization"||lower==="x-everfur-partner-key"||(out[key]=value)}return out}async function authedSend(req,ctx){if(ctx.mode==="anonymous")return ctx.transport.request(withAuthHeaders(req,{mode:"anonymous",publishableKey:ctx.publishableKey,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));let token;try{token=await ctx.identity.currentToken()}catch(cause){return ctx.identity.reportRejected?.(),err(mintFailedError(cause))}let first=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:token,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));if(first.ok||first.error.httpStatus!==401)return first;let refreshed;try{refreshed=await ctx.identity.currentToken({forceRefresh:!0})}catch(cause){return ctx.identity.reportRejected?.(),err(mintFailedError(cause,{wireCode: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="",host="",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=host.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:host.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(
99
99
  /* @__PURE__ */Object.freeze({call:call,phase:"stream.open",method:req.method,path:req.path,attempt:0}));try{yield*deps.auth.transport.stream(req,signal)}catch{yield errorFrame({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null})}}/* @__PURE__ */
100
100
  return Object.freeze({send:send,authorize:authorize,stream:stream})}function assembleHeaders(req,idempotencyKey){let headers={};for(let[key,value]of Object.entries(req.headers??{}))key.toLowerCase()!==IDEMPOTENCY_HEADER&&(headers[key]=value);return idempotencyKey!==null&&(headers["Idempotency-Key"]=idempotencyKey),{...req,headers:headers}}function defaultIdempotencyKeyFactory(){let counter=0;return()=>`efk_${Date.now().toString(36)}_${(counter++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}var POLICY_MAX_ATTEMPTS_CAP=10;function decideRetry(error,attempt,ctx){if(ctx.aborted)return{retry:false,reason:"aborted"};let throttle=throttleKind(error);if(throttle==="quota")return{retry:false,reason:"daily-quota-exhausted"};if(throttle!=="burst"&&!isAutoRetryable(error.code))return{retry:false,reason:"terminal-code"};let reason=throttle==="burst"?"burst-throttle":"retryable-code";if((()=>{if(ctx.policy===void 0)return false;try{return!ctx.policy.shouldRetry(error.code,attempt)}catch{return false}})())return{retry:false,reason:"terminal-code"};let policyCeiling=()=>{if(ctx.policy===void 0)return null;let raw;try{raw=ctx.policy.maxAttempts(error.code)}catch{return null}return typeof raw!="number"||!Number.isFinite(raw)?null:Math.max(1,Math.min(POLICY_MAX_ATTEMPTS_CAP,Math.floor(raw)))},ceiling=ctx.perCallMaxAttempts??policyCeiling()??ctx.maxAttempts;if(attempt+1>=ceiling)return{retry:false,reason:"attempts-exhausted"};let override=retryOverrideMs(error,ctx.now);return override!==null?override>RETRY_OVERRIDE_MAX_MS?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:reason,delayMs:override}:{retry:true,reason:reason,delayMs:backoffDelayMs(attempt,ctx.rng)}}function throttleKind(error){let code=error.code==="unknown"?fromWire(rawWireCode(error.raw)):error.code;return code==="quotaExceeded"?"quota":code==="rateLimited"||error.httpStatus===429?"burst":null}function retryOverrideMs(error,now){let at=findResetsAt(error.raw);if(at!==null){let delta=at-now;return delta>0?delta:0}let wait=findRetryAfterSeconds(error.raw);return wait===null?null:Math.round(wait*1e3)}function findRetryAfterSeconds(raw){for(let scope of candidateScopes(raw)){let value=scope.retry_after_seconds;if(typeof value=="number"&&Number.isFinite(value)&&value>=0)return value}return null}function findResetsAt(raw){for(let scope of candidateScopes(raw)){let value=scope.resets_at,parsed=parseInstantMs(value);if(parsed!==null)return parsed}return null}function candidateScopes(raw){if(!isRecord(raw))return[];let out=[raw];for(let nested of["error","detail"]){let value=raw[nested];isRecord(value)&&out.push(value)}return out}function parseInstantMs(value){if(typeof value=="number"&&Number.isFinite(value))return value<1e11?Math.round(value*1e3):Math.round(value);if(typeof value=="string"&&value.trim().length>0){let parsed=Date.parse(value);return Number.isFinite(parsed)?parsed:null}return null}function rawWireCode(raw){for(let scope of candidateScopes(raw)){let code=scope.code;if(typeof code=="string"&&code.length>0)return code}return null}function isRecord(value){return typeof value=="object"&&value!==null}async function resolveDeviceAuth(auth){return auth.mode==="anonymous"?{mode:"anonymous",publishableKey:auth.publishableKey,userRef:auth.userRef,...auth.sessionId?{sessionId:auth.sessionId}:{}}:{mode:"personalized",token:await auth.identity.currentToken(),userRef:auth.userRef,...auth.sessionId?{sessionId:auth.sessionId}:{}}}function boundedSignal(ms,timers){let ctrl=new AbortController,handle=timers.setTimeout(()=>ctrl.abort(),ms);return{signal:ctrl.signal,cancel:()=>timers.clearTimeout(handle)}}function mergeSignals(deadline,caller){let noop=()=>{};if(!caller)return{signal:deadline,dispose:noop};let ctrl=new AbortController;if(deadline.aborted||caller.aborted)return ctrl.abort(),{signal:ctrl.signal,dispose:noop};let onAbort=()=>ctrl.abort();return deadline.addEventListener("abort",onAbort,{once:true}),caller.addEventListener("abort",onAbort,{once:true}),{signal:ctrl.signal,dispose:()=>{deadline.removeEventListener("abort",onAbort),caller.removeEventListener("abort",onAbort)}}}function delayAbortable(ms,timers,signal){return ms<=0||signal?.aborted===true?Promise.resolve():new Promise(resolve=>{let handle=timers.setTimeout(()=>{signal?.removeEventListener("abort",onAbort),resolve()},ms),onAbort=()=>{timers.clearTimeout(handle),resolve()};signal?.addEventListener("abort",onAbort,{once:true})})}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__ */
101
- return Object.freeze(out)}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})}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__ */
101
+ 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__ */
102
+ 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__ */
102
103
  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__ */
103
104
  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:run2,now:clock}=latest.current;at!==null&&clock()-at>=HEALTH_PLAN_STALE_MS&&run2()}));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__ */
104
105
  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__ */
@@ -107,287 +108,371 @@ return Object.freeze({subscriptionId:subscriptionId,productId:productId,title:st
107
108
  return Object.freeze({orderId:orderId,productId:productId,title:str2(o.title),currency:currency,boxPrice:money(o.box_price)??price,price:price,discountPercent:int(o.discount_percent)??0,shipsOn:dateOf(o.ships_on),createdAt:instantOf(o.created_at),quantity:qty,total:money(o.total)??Math.round(price*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__ */
108
109
  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__ */
109
110
  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,price=money(o.price);return price===null||price>boxPrice?null:/* @__PURE__ */Object.freeze({price:price,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__ */
110
- 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}:{}})),one=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)?one("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"))):one("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"))):one("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"))):one("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"))):one("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,k)=>r.buyOneBox(p,id,k)),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__ */
111
- 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 mapped=each(row);mapped!==null&&out.push(mapped)}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)})})}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)})}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})},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__ */
111
+ 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__ */
112
+ 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 mapped=each(row);mapped!==null&&out.push(mapped)}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__ */
112
113
  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__ */
113
- 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 one=`${PRESENTATION_LOCK_PREFIX}${PRESENTATION_WIRE_NAMES[field]}`;for(let name of locked)if(name===PRESENTATION_LOCK||name===one)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__ */
114
- 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(k=>`${k}=${String(input[k])}`).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 mapped=itemToWire(list,index,raw[index]);if("error"in mapped)return mapped;let ref=mapped.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(mapped.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 mapped=listToWire(key,value);if("error"in mapped)return mapped;body[wire]=mapped.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__ */
114
+ 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__ */
115
+ 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 mapped=itemToWire(list,index,raw[index]);if("error"in mapped)return mapped;let ref=mapped.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(mapped.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 mapped=listToWire(key,value);if("error"in mapped)return mapped;body[wire]=mapped.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__ */
115
116
  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__ */
116
117
  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__ */
117
- 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)"};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__ */
118
+ 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__ */
118
119
  return Object.freeze({reason:explicit.reason,level:explicit.level,recoverable:explicit.recoverable})}/* @__PURE__ */
119
- 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(),styles2=react.useMemo(()=>makeStyles(theme),[theme]);/* @__PURE__ */
120
- return jsxRuntime.jsx(reactNative.View,{style:[styles2.offstate,style],accessible:true,accessibilityState:{busy:true},accessibilityLabel:`Loading ${capability}`,children:/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:styles2.skeletonBar})})}function OffState({decision:decision,style:style}){let theme=useEverfurTheme(),styles2=react.useMemo(()=>makeStyles(theme),[theme]),message=decision.disabled?.reason??"";/* @__PURE__ */
121
- return jsxRuntime.jsx(reactNative.View,{style:[styles2.offstate,style],accessible:true,accessibilityRole:"text",accessibilityLabel:message,children:message.length>0?/* @__PURE__ */jsxRuntime.jsx(Text,{style:styles2.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 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=useEverfurTheme(),styles2=react.useMemo(()=>makeStyles2(theme),[theme]),subtotal=formatHealthPlanPriceWith(cart.subtotal,cart.currency,priceFormat),disabled=cart.count===0||busy,telemetry=useHealthPlanTelemetry(),petRef=useHealthPlanBarPet(useHealthPlanCartDock()?.petRef);/* @__PURE__ */
122
- return jsxRuntime.jsxs(reactNative.View,{style:[styles2.bar,style],accessibilityLabel:HEALTH_PLAN_TEMPLATES.cartLabel(theme.meta.displayName),children:[
123
- /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:styles2.copy,children:[
124
- /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:styles2.labelRow,children:[
125
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:styles2.label,children:HEALTH_PLAN_TEMPLATES.cartLabel(theme.meta.displayName)}),cart.count>0?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:styles2.count,accessibilityElementsHidden:true,importantForAccessibility:"no",children:/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"badge",style:styles2.countLabel,children:String(cart.count)})}):null]}),cart.count===0?/* @__PURE__ */jsxRuntime.jsx(Text,{style:styles2.line,children:HEALTH_PLAN_COPY.cartEmpty}):subtotal===null?null:/* @__PURE__ */jsxRuntime.jsxs(Text,{style:styles2.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:[styles2.checkout,disabled?styles2.dimmed:null],testID:"health-plan-checkout",children:/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"control",style:styles2.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 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 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:(filled,total)=>`${filled} of ${total} filled`,blanksWeight:`Keep ${w.obj} at `,blanksWeightSource:`From ${w.poss} vet visits`,blanksDose:(dose,product)=>`${dose} of ${product}`,blanksDoseSource:`Sized to ${w.poss} weight`,blanksShots:`${w.Poss} next shots are due `,blanksShotsSource:`From ${w.poss} clinic`,blankEmpty:"blank",recordsLanded:`${w.Poss} records are in. ${w.Poss} plan now uses ${w.poss} weight and ${w.poss} visits.`});return copy}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}}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:k=>ready&&productId!==null?buy(k):none(),refresh:load}},[phase,quote,subscription,busy,error,ready,petRef,productId,repository,write2,buy,load])}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 RAPH_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"}}),RAPH_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 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,k,out){for(let s of icon.strokes){let w=s.width*k,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,px=(pts[i*2]??0)*k,py=(pts[i*2+1]??0)*k,dx=(pts[j*2]??0)*k-px,dy=(pts[j*2+1]??0)*k-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(px+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,k,out){for(let b of icon.boxes){let w=(b.w+b.width)*k,h=(b.h+b.width)*k;out.push({paint:"borderColor",style:{...place((b.x-b.width/2)*k+w/2,(b.y-b.width/2)*k+h/2,fine(w),fine(h),1,0),borderWidth:fine(b.width*k),borderRadius:(b.radius+b.width/2)*k*FINE,...b.opacity===void 0?{}:{opacity:b.opacity}}})}}function trianglePieces(icon,k,out){for(let t of icon.triangles){let p=[0,1,2].map(i=>[(t[i*2]??0)*k,(t[i*2+1]??0)*k]),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)*k,y0=(e[1]??0)*k,dx=(e[2]??0)*k-x0,dy=(e[3]??0)*k-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 cache=/* @__PURE__ */new Map;function piecesOf(name,size){let key=`${name}:${size}`,hit=cache.get(key);if(hit!==void 0)return hit;let icon=RAPH_RN_PLAN_ICONS[name],out=[],k=size/BOX;return boxPieces(icon,k,out),strokePieces(icon,k,out),trianglePieces(icon,k,out),cache.set(key,out),out}function FocusIcon({name:name,size:size=18,color:color}){let pieces=RAPH_RN_PLAN_ICONS[name]===void 0?[]:piecesOf(name,size);/* @__PURE__ */
126
- 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))})})}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`});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();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}}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 int2=Math.trunc(n)>>>0,a=int2>>>24&255;return{r:int2>>>16&255,g:int2>>>8&255,b:int2&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 RAPH_V3_LIGHT=/* @__PURE__ */Object.freeze({ink:"#262523",ink2:"#4A4845",ink3:"#6B6863",paper:"#F8F7F4",card:"#FFFFFF",line:"#E7E6E2",tile:"#F2F1EE",shadow:"rgba(38, 37, 35, .07)",riskBg:"#FFE3E1",riskInk:"#B0231B",riskDot:"#E5372B",clearBg:"#E6F4D3",clearInk:"#2F6A12",clearDot:"#5FA82B",watchDot:"#E5A000"}),cache2=/* @__PURE__ */new WeakMap;function v3Palette(theme){let hit=cache2.get(theme);if(hit!==void 0)return hit;let c=theme.color,dark=theme.brightness==="dark",neutrals=dark?{dark:dark,ink:c.text.primary,ink2:c.text.secondary,ink3:c.text.muted,paper:c.background,card:c.surface,line:c.borderRingCream,tile:c.surfaceSubtle,shadow:c.shadow,riskBg:c.badgeBgCritical,riskInk:c.danger,riskDot:c.danger,clearBg:c.badgeBgPositive,clearInk:c.success,clearDot:c.success,watchDot:c.warningStrong}:{dark:dark,...RAPH_V3_LIGHT},textOn=(ink,grounds)=>pushToContrast(ink,grounds,poleForGrounds(grounds),V3_TEXT_CONTRAST),labelOn=(ink,fill)=>contrastRatio(ink,fill)>=V3_TEXT_CONTRAST?ink:legibleOn(fill,V3_TEXT_CONTRAST),badgeGrounds=[neutrals.card,neutrals.paper].map(under=>flattenOnto(c.brandSoft,under)??under),brand={primary:c.primary,onPrimary:labelOn(c.onPrimary,c.primary),accent:c.accent,onAccent:labelOn(c.onAccent,c.accent),link:textOn(c.linkInk,[neutrals.card,neutrals.paper,neutrals.tile]),badge:c.brandSoft,onBadge:textOn(c.brandInk,badgeGrounds)},palette=/* @__PURE__ */Object.freeze({...neutrals,...brand});return cache2.set(theme,palette),palette}var V3_TEXT_CONTRAST=4.5;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(k=>parseInt(x.slice(k,k+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=k=>Math.round(a[k]*share+b[k]*(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),place2={...outer};if(box.position==="absolute"){for(let k of["position","zIndex"])box[k]!==void 0&&(place2[k]=box[k]);for(let k of["top","right","bottom","left"])typeof box[k]=="number"&&(place2[k]=box[k]-w);for(let k of["position","zIndex","top","right","bottom","left"])delete box[k]}else{for(let k of["marginTop","marginRight","marginBottom","marginLeft"])place2[k]=(typeof box[k]=="number"?box[k]:0)-w,delete box[k];box.alignSelf!==void 0&&(place2.alignSelf=box.alignSelf,delete box.alignSelf)}rings[0]=place2}return{box:box,text:text2,rings:rings,...inner===void 0?{}:{inner:inner},grid:part.grid??[]}}var cache3=/* @__PURE__ */new WeakMap;function planPaint(theme){let hit=cache3.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(RAPH_RN_PLAN))out[name]=paintPart(theme,roles,part,dark,roles.line);let painted=out;return cache3.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,place2)=>{let rings=X[name].rings;return rings.length===0?node:rings.reduceRight((child,style,i)=>react.createElement(reactNative.View,{key:i,style:i===0&&place2!==void 0?[style,place2]: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 k of RADII)p.box[k]!==void 0&&(radius={...radius,[k]:p.box[k]})}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 place2={},content={};for(let[k,v]of Object.entries(X[name].box))(MARGINS.includes(k)?place2:content)[k]=v;return{place:place2,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}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 P=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,P.ink,"bold"),mini:{...t(10.5,P.ink3,"mono"),textTransform:"uppercase",letterSpacing:.9},h3:{...t(19,P.ink,"bold",1.2),marginTop:space.sm},bold:face(theme,"bold"),noPick:{...t(15,P.ink2,"regular",1.45),marginTop:14},small:t(13,P.ink3,"regular",1.35),smallInk:t(13,P.ink2,"regular",1.35),buttonGhost:{minHeight:48,borderRadius:999,alignItems:"center",justifyContent:"center",paddingHorizontal:space.lg,borderWidth:2,borderColor:P.ink,marginTop:space.sm},buttonGhostText:{...t(15,P.ink,"bold",1.2),textAlign:"center"},disabled:{opacity:.5},fine:{...t(13,P.ink3,"regular",1.4),marginTop:space.sm},scrim:{flex:1,justifyContent:"flex-end",backgroundColor:P.scrim},sheet:{maxHeight:"92%",paddingHorizontal:space.lg,paddingTop:space.sm,paddingBottom:space.xl,borderTopLeftRadius:22,borderTopRightRadius:22,backgroundColor:P.card},sheetGrab:{alignSelf:"center",width:40,height:4,borderRadius:2,backgroundColor:P.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:P,X:X,D:planDraw(X)}}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__ */
120
+ 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__ */
121
+ 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__ */
122
+ 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 int2=Math.trunc(n)>>>0,a=int2>>>24&255;return{r:int2>>>16&255,g:int2>>>8&255,b:int2&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 host=globalThis,ctx=host[DS_THEME_CONTEXT];return ctx===void 0&&(ctx=react.createContext(null),ctx.displayName="EverfurThemeContext",host[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,host){if(host===null)return theme;let byHost=cache.get(theme);byHost===void 0&&(byHost=/* @__PURE__ */new WeakMap,cache.set(theme,byHost));let out=byHost.get(host);return out===void 0&&(out=overlay(theme,host),byHost.set(host,out)),out}function overlay(theme,host){let h=host.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=host.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(),host=react.useContext(dsThemeContext());return react.useMemo(()=>planThemeWithHost(theme,host),[theme,host])}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__ */
123
+ return jsxRuntime.jsxs(reactNative.View,{style:[styles25.bar,style],accessibilityLabel:HEALTH_PLAN_TEMPLATES.cartLabel(theme.meta.displayName),children:[
124
+ /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:styles25.copy,children:[
125
+ /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:styles25.labelRow,children:[
126
+ /* @__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__ */
127
127
  return jsxRuntime.jsxs(reactNative.View,{children:[
128
- /* @__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 FLASH_MS=900,FLASH_STEP_MS=80,FLASH_HOLD=.4,easeOut=()=>reactNative.Easing.bezier(0,0,.58,1),SHRINK={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=useEverfurTheme(),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 run2 of runs)run2.start();return()=>{for(let run2 of runs)run2.stop()}},[flashKey,phase,still]),/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("blanksWrap","blanksCard"),accessibilityLabel:props.label,testID:"health-plan-blanks",children:[
129
- /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("blanksHead"),children:[
130
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:[...tx("blanksHead"),SHRINK],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})})]}),
131
- /* @__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__ */
132
- return jsxRuntime.jsxs(reactNative.View,{style:bx("blanksRow"),testID:`health-plan-blank-${r.key}`,children:[
133
- /* @__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)})}),
134
- /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:gridCell(X.blanksRow,1),children:[
135
- /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:LINE,children:[r.lead===""?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("blanksText"),children:r.lead}),
136
- /* @__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)})})]})}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 MAX_QUANTITY=5,MAX_CART_LINES=10,ORDERS_PAGE=20,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]??""}`}async function readOrders(repo,petRef,cursor){if(repo.listOneBoxOrderPage!==void 0)return repo.listOneBoxOrderPage(petRef,{limit:ORDERS_PAGE,...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 invalidCursor(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 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:MAX_QUANTITY,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))}var CENTER={justifyContent:"center"},SHRINK2={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=(k,label,part)=>/* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[" ",
137
- /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:k.S.D.bx(part),children:/* @__PURE__ */jsxRuntime.jsx(Text,{style:k.S.D.tx(part),children:label})})]});function shopButton(k,label,onPress,opts={}){let{S:S}=k,{bx:bx,tx:tx}=S.D,disabled=opts.disabled===true,part=opts.part??"button";/* @__PURE__ */
138
- 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(part,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(part),children:label})})}function shopLink(k,label,onPress,testID){let{bx:bx,tx:tx}=k.S.D;/* @__PURE__ */
139
- 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(k,rows,inShop=false){if(rows.length===0)return null;let{bx:bx,tx:tx,ink:ink,side:side}=k.S.D,X=k.S.X;/* @__PURE__ */
128
+ /* @__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 everfurMetrics={button:{ink:{fill:false,minHeight:52,paddingX:24,gap:8,borderWidth:1,ring:false,fontSize:17,fontWeight:700,lineHeight:1,iconSize:24},go:{fill:false,minHeight:52,paddingX:24,gap:8,borderWidth:1,ring:false,fontSize:17,fontWeight:700,lineHeight:1,iconSize:24},outline:{fill:false,minHeight:52,paddingX:24,gap:8,borderWidth:1,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,ring:false,fontSize:15,fontWeight:700,lineHeight:1.55,iconSize:20},inkSm:{fill:false,minHeight:46,paddingX:16,gap:8,borderWidth:1,ring:false,fontSize:15,fontWeight:700,lineHeight:1,iconSize:20},goSm:{fill:false,minHeight:46,paddingX:16,gap:8,borderWidth:1,ring:false,fontSize:15,fontWeight:700,lineHeight:1,iconSize:20},outlineSm:{fill:false,minHeight:46,paddingX:16,gap:8,borderWidth:1,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,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,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,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,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,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,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,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,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,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,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,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"}};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},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){return partial?deepFreeze2(merge(base3,partial)):base3}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>650?"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 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 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]}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 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]})}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}});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,label:label,testID:testID,style:style}){let t=useTheme(),m=t.metrics.skeleton;/* @__PURE__ */
129
+ 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,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__ */
130
+ 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;if(variant!=="standard"){let su=t.metrics.variants.summary;/* @__PURE__ */
131
+ return jsxRuntime.jsx(reactNative.View,{testID:testID,style:[rnBox(t,variant==="inset"?su.inset:su.box),style],children:[...rows,...noteRow?[noteRow]:[]].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__ */
132
+ 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:[
133
+ /* @__PURE__ */jsxRuntime.jsx(Text2,{...breaks,style:rnText(t,textPartSpec(t,term)),children:row.term}),
134
+ /* @__PURE__ */jsxRuntime.jsx(Text2,{...breaks,style:rnText(t,textPartSpec(t,value)),children:row.value})]},row.key??`${i}`)})})}let all=noteRow?[...rows,noteRow]:rows;/* @__PURE__ */
135
+ return jsxRuntime.jsx(reactNative.View,{testID:testID,style:[{paddingHorizontal:s.paddingX,paddingVertical:s.paddingY,borderWidth:s.borderWidth,borderColor:s.borderColor,borderRadius:s.radius,backgroundColor:s.background},rnShadow(s.shadow),style],children:all.map((row,i)=>{let last=i===all.length-1,isTotal=large&&i===rows.length-1,minHeight=isTotal?s.totalRowMinHeight:s.row.minHeight;/* @__PURE__ */
136
+ 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:[
137
+ /* @__PURE__ */jsxRuntime.jsx(Text2,{...breaks,style:rnText(t,isTotal?s.totalTerm:s.term),children:row.term}),
138
+ /* @__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"]}});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__ */
139
+ 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:[
140
+ /* @__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"}});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"}),cache2=/* @__PURE__ */new WeakMap;function v3Palette(theme){let hit=cache2.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 cache2.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};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")},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 cache5=byPreset[outline?"outline":"fill"],t=cache5.get(key);return t===void 0&&(t=resolveTheme(planDsInput(input(),outline),preset),cache5.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}};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),place2={...outer};if(box.position==="absolute"){for(let k2 of["position","zIndex"])box[k2]!==void 0&&(place2[k2]=box[k2]);for(let k2 of["top","right","bottom","left"])typeof box[k2]=="number"&&(place2[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"])place2[k2]=(typeof box[k2]=="number"?box[k2]:0)-w,delete box[k2];box.alignSelf!==void 0&&(place2.alignSelf=box.alignSelf,delete box.alignSelf)}rings[0]=place2}return{box:box,text:text2,rings:rings,...inner===void 0?{}:{inner:inner},grid:part.grid??[]}}var cache3=/* @__PURE__ */new WeakMap;function planPaint(theme){let hit=cache3.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 cache3.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,place2)=>{let rings=X[name].rings;return rings.length===0?node:rings.reduceRight((child,style,i)=>react.createElement(reactNative.View,{key:i,style:i===0&&place2!==void 0?[style,place2]: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 place2={},content={};for(let[k2,v]of Object.entries(X[name].box))(MARGINS.includes(k2)?place2:content)[k2]=v;return{place:place2,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:[" ",
141
+ /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:k2.S.D.bx(part),children:/* @__PURE__ */jsxRuntime.jsx(Text,{style:k2.S.D.tx(part),children:label})})]});function shopButton(k2,label,onPress,opts={}){let{S:S}=k2,{bx:bx,tx:tx}=S.D,disabled=opts.disabled===true,part=opts.part??"button";/* @__PURE__ */
142
+ 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(part,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(part),children:label})})}function shopLink(k2,label,onPress,testID){let{bx:bx,tx:tx}=k2.S.D;/* @__PURE__ */
143
+ 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__ */
140
144
  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:[
141
- /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:gridCell(X.coRow,0),children:k.icon(r.icon,ink("coRowSvg",X.roles.ink2??""),side("coRowSvg",20))}),
145
+ /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:gridCell(X.coRow,0),children:k2.icon(r.icon,ink("coRowSvg",X.roles.ink2??""),side("coRowSvg",20))}),
142
146
  /* @__PURE__ */jsxRuntime.jsx(Text,{style:[...tx("coRowLabel"),gridCell(X.coRow,1)],children:r.label}),
143
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:[...tx("coRow","coRowValue"),gridCell(X.coRow,2)],children:r.value})]},r.label))})}function shopSummary(k,total,opts={}){let{S:S,copy:copy}=k,{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:[
144
- /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:[...bx("summaryLabel"),SHRINK2,IN_ROW],children:[
145
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:[...tx("summaryRow",mod,mod==="summaryTotal"?"summaryTotalLabel":"summaryLabel"),SHRINK2],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})})]}),
147
+ /* @__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&&copy.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:[
148
+ /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:[...bx("summaryLabel"),SHRINK,IN_ROW],children:[
149
+ /* @__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})})]}),
146
150
  /* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("summaryRow",mod),children:value})]});/* @__PURE__ */
147
- return jsxRuntime.jsxs(reactNative.View,{style:bx(opts.inCheckout?"coSummary":"summary"),children:[row(copy.subtotal,total),copy.shippingValue===""?null:row(copy.shipping,copy.shippingValue,void 0,opts.tag&&copy.shippingTag!==""?copy.shippingTag:void 0),row(renew===null?copy.total:copy.dueToday,total,"summaryTotal"),renew===null?null:row(copy.thenRenews(renew),copy.renewsEvery(renew),"summaryRenew")]})}function shopTrack(k,steps,label){let{S:S}=k,{bx:bx,tx:tx,tb:tb,inner:inner,ink:ink,side:side}=S.D;/* @__PURE__ */
151
+ return jsxRuntime.jsxs(reactNative.View,{style:bx(opts.inCheckout?"coSummary":"summary"),children:[row(copy.subtotal,total),copy.shippingValue===""?null:row(copy.shipping,copy.shippingValue,void 0,opts.tag&&copy.shippingTag!==""?copy.shippingTag:void 0),row(renew===null?copy.total:copy.dueToday,total,"summaryTotal"),renew===null?null:row(copy.thenRenews(renew),copy.renewsEvery(renew),"summaryRenew")]})}function shopTrack(k2,steps,label){let{S:S}=k2,{bx:bx,tx:tx,tb:tb,inner:inner,ink:ink,side:side}=S.D;/* @__PURE__ */
148
152
  return jsxRuntime.jsx(reactNative.View,{style:bx("track"),accessibilityLabel:label,testID:"health-plan-track",children:steps.map((s,i)=>{let done=s.state==="done",now=s.state==="now",last=i===steps.length-1;/* @__PURE__ */
149
153
  return jsxRuntime.jsxs(reactNative.View,{style:bx("trackStep",last&&"trackStepLast"),children:[last?null:/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("trackLine",done&&steps[i+1]?.state==="done"&&"trackLineDone")}),
150
- /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:[...bx("trackDot",done&&"trackDotDone",now&&"trackDotNow"),gridCell(S.X.trackStep,0)],children:[inner("trackDot",done&&"trackDotDone",now&&"trackDotNow"),done?k.icon("check",ink("trackDotSvg",S.X.roles.card??""),side("trackDotSvg",13)):null]}),
154
+ /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:[...bx("trackDot",done&&"trackDotDone",now&&"trackDotNow"),gridCell(S.X.trackStep,0)],children:[inner("trackDot",done&&"trackDotDone",now&&"trackDotNow"),done?k2.icon("check",ink("trackDotSvg",S.X.roles.card??""),side("trackDotSvg",13)):null]}),
151
155
  /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:gridCell(S.X.trackStep,1),children:[
152
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("trackTitle",!done&&!now&&"trackTitleTodo"),children:s.title}),s.detail?/* @__PURE__ */jsxRuntime.jsxs(Text,{style:tb("trackDetail"),children:[s.detail,s.tag?inlineTag(k,s.tag,"trackTag"):null]}):null]})]},s.title)})})}function shopAskRow(k,iconName,title,body,onPress,testID,inSec=false){let{S:S}=k,{bx:bx,tx:tx,tb:tb,ink:ink,side:side}=S.D;if(title==="")return null;let X=S.X;/* @__PURE__ */
156
+ /* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("trackTitle",!done&&!now&&"trackTitleTodo"),children:s.title}),s.detail?/* @__PURE__ */jsxRuntime.jsxs(Text,{style:tb("trackDetail"),children:[s.detail,s.tag?inlineTag(k2,s.tag,"trackTag"):null]}):null]})]},s.title)})})}function shopAskRow(k2,iconName,title,body,onPress,testID,inSec=false){let{S:S}=k2,{bx:bx,tx:tx,tb:tb,ink:ink,side:side}=S.D;if(title==="")return null;let X=S.X;/* @__PURE__ */
153
157
  return jsxRuntime.jsxs(reactNative.Pressable,{onPress:onPress,accessibilityRole:"button",accessibilityLabel:title,style:pressScale(bx("askRow",inSec&&"askRowInSec"),PLAN_PRESS_SCALE.askRow,false),testID:testID,children:[
154
- /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[...bx("askRowIcon"),gridCell(X.askRow,0)],children:k.icon(iconName,ink("askRowIcon",X.roles.link??""),side("askRowIconSvg",21))}),
158
+ /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[...bx("askRowIcon"),gridCell(X.askRow,0)],children:k2.icon(iconName,ink("askRowIcon",X.roles.link??""),side("askRowIconSvg",21))}),
155
159
  /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:gridCell(X.askRow,1),children:[
156
160
  /* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("askRowStrong"),children:title}),body===""?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("askRowSmall"),children:body})]}),
157
- /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:gridCell(X.askRow,2),children:k.icon("chev",ink("askRowChev",X.roles.ink2??""),side("askRowChev",18))})]})}function shopWait(k,w,onAction,vet=null){let{S:S}=k,{bx:bx,tx:tx,tb:tb,ink:ink,side:side}=S.D,X=S.X,link=X.roles.link??"",rows=(w.rows??[]).flatMap(r=>r.fromVet!==true?[r]:vet===null?[]:[{...r,text:k.copy.waitVetTips(vet)}]);/* @__PURE__ */
161
+ /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:gridCell(X.askRow,2),children:k2.icon("chev",ink("askRowChev",X.roles.ink2??""),side("askRowChev",18))})]})}function shopWait(k2,w,onAction,vet=null){let{S:S}=k2,{bx:bx,tx:tx,tb:tb,ink:ink,side:side}=S.D,X=S.X,link=X.roles.link??"",rows=(w.rows??[]).flatMap(r=>r.fromVet!==true?[r]:vet===null?[]:[{...r,text:k2.copy.waitVetTips(vet)}]);/* @__PURE__ */
158
162
  return jsxRuntime.jsxs(reactNative.View,{style:bx("wait"),testID:"health-plan-wait",children:[
159
163
  /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("waitTop"),children:[
160
- /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[...bx("waitTile"),gridCell(X.waitTop,0)],children:k.icon(w.icon??"kit",ink("waitTile",link),side("waitTileSvg",23))}),
164
+ /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[...bx("waitTile"),gridCell(X.waitTop,0)],children:k2.icon(w.icon??"kit",ink("waitTile",link),side("waitTileSvg",23))}),
161
165
  /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:gridCell(X.waitTop,1),children:[
162
166
  /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("waitMini"),children:w.kicker}),
163
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("waitTitle"),accessibilityRole:"header",children:w.title})]})]}),w.track&&w.track.length>0?shopTrack(k,w.track,w.kicker):null,w.heading?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("waitKey"),children:w.heading}):null,rows.length>0?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("next","nextIn"),children:rows.map(r=>/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("nextRow"),children:[
164
- /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[...bx("nextIcon"),gridCell(X.nextRow,0)],children:k.icon(r.icon,ink("nextIcon",link),side("nextIconSvg",19))}),
167
+ /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("waitTitle"),accessibilityRole:"header",children:w.title})]})]}),w.track&&w.track.length>0?shopTrack(k2,w.track,w.kicker):null,w.heading?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("waitKey"),children:w.heading}):null,rows.length>0?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("next","nextIn"),children:rows.map(r=>/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("nextRow"),children:[
168
+ /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[...bx("nextIcon"),gridCell(X.nextRow,0)],children:k2.icon(r.icon,ink("nextIcon",link),side("nextIconSvg",19))}),
165
169
  /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:gridCell(X.nextRow,1),children:[
166
170
  /* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("nextLabel"),children:r.label}),
167
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("nextText"),children:r.text})]})]},r.label))}):null,w.note?/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("waitText"),children:[k.icon("chat",ink("waitTextSvg",link),side("waitTextSvg",20)),
168
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:[...tx("waitText"),SHRINK2],children:w.note})]}):null,w.action&&onAction?shopButton(k,w.action,onAction,{part:"waitButton"}):null]})}function shopEmpty(k,iconName,title,body,control){let{bx:bx,tb:tb,ink:ink,side:side}=k.S.D;/* @__PURE__ */
171
+ /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("nextText"),children:r.text})]})]},r.label))}):null,w.note?/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("waitText"),children:[k2.icon("chat",ink("waitTextSvg",link),side("waitTextSvg",20)),
172
+ /* @__PURE__ */jsxRuntime.jsx(Text,{style:[...tx("waitText"),SHRINK],children:w.note})]}):null,w.action&&onAction?shopButton(k2,w.action,onAction,{part:"waitButton"}):null]})}function shopEmpty(k2,iconName,title,body,control){let{bx:bx,tb:tb,ink:ink,side:side}=k2.S.D;/* @__PURE__ */
169
173
  return jsxRuntime.jsxs(reactNative.View,{style:bx("shopEmpty"),children:[
170
- /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("shopEmptyTile"),children:k.icon(iconName,ink("shopEmptyTile",k.S.X.roles.link??""),side("shopEmptyTileSvg",34))}),
174
+ /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("shopEmptyTile"),children:k2.icon(iconName,ink("shopEmptyTile",k2.S.X.roles.link??""),side("shopEmptyTileSvg",34))}),
171
175
  /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("shopEmptyTitle"),accessibilityRole:"header",children:title}),
172
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("shopEmptyText"),children:body}),control]})}var tile=(k,src,part,svg,fallback="box")=>{let{bx:bx,ink:ink}=k.S.D;/* @__PURE__ */
173
- return jsxRuntime.jsx(reactNative.View,{style:bx(part),children:src?/* @__PURE__ */jsxRuntime.jsx(reactNative.Image,{source:{uri:src},style:FILL,accessibilityIgnoresInvertColors:true}):k.icon(fallback,ink(part,k.S.X.roles.link??""),svg)})};function shopCartBody(k,lines,subtotal,renew,petPrices,h){let{S:S,copy:copy}=k,{bx:bx,tx:tx,tb:tb,inner:inner,side:side}=S.D,X=S.X;if(lines.length===0)/* @__PURE__ */
174
- return jsxRuntime.jsx(reactNative.View,{style:bx("shop"),testID:"health-plan-cart-empty",children:shopEmpty(k,"cart",copy.cartEmptyTitle,copy.cartEmptyBody(petPrices),shopLink(k,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:k.icon(iconName,void 0,side("stepperButtonSvg",16))});/* @__PURE__ */
176
+ /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("shopEmptyText"),children:body}),control]})}var tile=(k2,src,part,svg,fallback="box")=>{let{bx:bx,ink:ink}=k2.S.D;/* @__PURE__ */
177
+ return jsxRuntime.jsx(reactNative.View,{style:bx(part),children:src?/* @__PURE__ */jsxRuntime.jsx(reactNative.Image,{source:{uri:src},style:FILL,accessibilityIgnoresInvertColors:true}):k2.icon(fallback,ink(part,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__ */
178
+ 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__ */
175
179
  return jsxRuntime.jsxs(reactNative.View,{style:bx("shop"),testID:"health-plan-cart",children:[
176
180
  /* @__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:[
177
- /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:gridCell(X.cartItem,0),children:tile(k,x.imageUrl,"cartItemImage",side("cartItemImageSvg",28))}),
181
+ /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:gridCell(X.cartItem,0),children:tile(k2,x.imageUrl,"cartItemImage",side("cartItemImageSvg",28))}),
178
182
  /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:gridCell(X.cartItem,1),children:[
179
183
  /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("cartItemTitle"),children:x.name}),
180
184
  /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("cartItemPrice"),children:[x.price===null?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("cartItemPriceValue"),children:x.price}),x.was===null?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("cartItemPriceWas"),children:x.was}),x.note===null?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("cartItemPriceNote"),children:x.note})]}),x.modes===null?null:/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("mode"),accessibilityRole:"radiogroup",accessibilityLabel:x.modes.label,children:["sub","once"].map(m=>{let mode=m==="sub"?x.modes?.sub:x.modes?.once,on=m==="sub"?x.subscription:!x.subscription;return mode===void 0?null:/* @__PURE__ */jsxRuntime.jsxs(reactNative.Pressable,{onPress:()=>h.onMode(x.key,m),accessibilityRole:"radio",accessibilityLabel:mode.label,accessibilityState:{checked:on},style:pressScale(bx("modeButton",on&&"modeButtonOn"),PLAN_PRESS_SCALE.mode,false),children:[inner("modeButton",on&&"modeButtonOn"),
181
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:[...tx("modeButton"),SHRINK2],children:mode.label}),mode.price===null?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("modeButton","modePrice"),children:mode.price})]},m)})}),x.every===null?null:/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("every"),accessibilityRole:"radiogroup",accessibilityLabel:copy.shipsEvery,children:[inner("every"),x.every.options.map((d,i)=>{let on=x.every?.selected===d;/* @__PURE__ */
185
+ /* @__PURE__ */jsxRuntime.jsx(Text,{style:[...tx("modeButton"),SHRINK],children:mode.label}),mode.price===null?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("modeButton","modePrice"),children:mode.price})]},m)})}),x.every===null?null:/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("every"),accessibilityRole:"radiogroup",accessibilityLabel:copy.shipsEvery,children:[inner("every"),x.every.options.map((d,i)=>{let on=x.every?.selected===d;/* @__PURE__ */
182
186
  return jsxRuntime.jsx(reactNative.Pressable,{onPress:()=>h.onEvery(x.key,d),accessibilityRole:"radio",accessibilityState:{checked:on},accessibilityLabel:copy.days(d),style:pressScale([...bx("everyButton",on&&"everyButtonOn"),gridCell(X.every,i),CENTER],PLAN_PRESS_SCALE.every,false),children:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("everyButton",on&&"everyButtonOn"),children:copy.days(d)})},d)})]}),
183
187
  /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("cartItemActions"),children:[x.subscription?null:/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("stepper"),accessibilityLabel:copy.quantityLabel(x.name),children:[inner("stepper"),step(copy.fewer,"minus",x.quantity<=1,()=>h.onQuantity(x.key,-1),`health-plan-fewer-${x.key}`,0),
184
188
  /* @__PURE__ */jsxRuntime.jsx(Text,{style:[...tx("stepperValue"),gridCell(X.stepper,1)],accessibilityLiveRegion:"polite",children:String(x.quantity)}),step(copy.more,"plus",x.quantity>=x.maxQuantity,()=>h.onQuantity(x.key,1),`health-plan-more-${x.key}`,2)]}),
185
- /* @__PURE__ */jsxRuntime.jsx(reactNative.Pressable,{onPress:()=>h.onRemove(x.key),accessibilityRole:"button",accessibilityLabel:copy.remove,hitSlop:HIT_44,style:[...bx("remove"),CENTER],testID:`health-plan-remove-${x.key}`,children:/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"control",style:tx("remove"),children:copy.remove})})]})]})]},x.key))})}),shopSummary(k,subtotal,{tag:true,renew:renew}),
186
- /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("shopActions"),children:shopLink(k,copy.seeOrders,h.onOrders,"health-plan-cart-orders")})]})}function shopCartCheckout(k,lines,lineTotal,rows,subtotal,renew,go,fine2){let{S:S,copy:copy}=k,{bx:bx,tx:tx,tb:tb}=S.D,X=S.X;/* @__PURE__ */
189
+ /* @__PURE__ */jsxRuntime.jsx(reactNative.Pressable,{onPress:()=>h.onRemove(x.key),accessibilityRole:"button",accessibilityLabel:copy.remove,hitSlop:HIT_44,style:[...bx("remove"),CENTER],testID:`health-plan-remove-${x.key}`,children:/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"control",style:tx("remove"),children:copy.remove})})]})]})]},x.key))})}),shopSummary(k2,subtotal,{tag:true,renew:renew}),
190
+ /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("shopActions"),children:shopLink(k2,copy.seeOrders,h.onOrders,"health-plan-cart-orders")})]})}function shopCartCheckout(k2,lines,lineTotal,rows,subtotal,renew,go,fine2){let{S:S,copy:copy}=k2,{bx:bx,tx:tx,tb:tb}=S.D,X=S.X;/* @__PURE__ */
187
191
  return jsxRuntime.jsxs(reactNative.View,{style:bx("co"),testID:"health-plan-cart-checkout-sheet",children:[
188
192
  /* @__PURE__ */jsxRuntime.jsx(Text,{style:SR_ONLY,accessibilityRole:"header",testID:"health-plan-cart-checkout-title",children:copy.cartCheckoutTitle}),
189
193
  /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("coItems"),children:lines.map(x=>/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("coItem"),children:[
190
- /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:gridCell(X.coItem,0),children:tile(k,x.imageUrl,"coItemPic",20)}),
194
+ /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:gridCell(X.coItem,0),children:tile(k2,x.imageUrl,"coItemPic",20)}),
191
195
  /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:gridCell(X.coItem,1),children:[
192
196
  /* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("coItemStrong"),children:x.name}),
193
197
  /* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("coItemSmall"),children:x.subscription?copy.cartItemSubscription(x.lp):copy.cartItemQuantity(x.quantity)})]}),
194
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:[...tx("coItem","coItemValue"),gridCell(X.coItem,2)],children:lineTotal(x)??""})]},x.key))}),shopRows(k,rows),shopSummary(k,subtotal,{renew:renew,inCheckout:true}),shopButton(k,go.label,go.onPress,{disabled:go.disabled,testID:"health-plan-place-order"}),fine2===""?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("coFine"),children:fine2})]})}function orderRow(k,o,fmt,day,onOpen){let{S:S,copy:copy}=k,{bx:bx,im:im,tx:tx,tb:tb,ink:ink,side:side}=S.D,X=S.X,done=o.step===3,last=o.dates[3]??null,lastDay=day(last),when=done?lastDay===null?null:copy.deliveredOn(lastDay):lastDay===null?null:copy.arrivesBy(lastDay),total=fmt(o.total,o.currency),what=andList(o.items.map(x=>x.title));/* @__PURE__ */
198
+ /* @__PURE__ */jsxRuntime.jsx(Text,{style:[...tx("coItem","coItemValue"),gridCell(X.coItem,2)],children:lineTotal(x)??""})]},x.key))}),shopRows(k2,rows),shopSummary(k2,subtotal,{renew:renew,inCheckout:true}),shopButton(k2,go.label,go.onPress,{disabled:go.disabled,testID:"health-plan-place-order"}),fine2===""?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("coFine"),children:fine2})]})}function orderRow(k2,o,fmt,day,onOpen){let{S:S,copy:copy}=k2,{bx:bx,im:im,tx:tx,tb:tb,ink:ink,side:side}=S.D,X=S.X,done=o.step===3,last=o.dates[3]??null,lastDay=day(last),when=done?lastDay===null?null:copy.deliveredOn(lastDay):lastDay===null?null:copy.arrivesBy(lastDay),total=fmt(o.total,o.currency),what=andList(o.items.map(x=>x.title));/* @__PURE__ */
195
199
  return jsxRuntime.jsxs(reactNative.Pressable,{onPress:()=>onOpen(o.key),accessibilityRole:"button",accessibilityLabel:what,style:pressScale(bx("order"),PLAN_PRESS_SCALE.order,false),testID:`health-plan-order-${o.key}`,children:[
196
200
  /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:gridCell(X.order,0),children:[
197
201
  /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("orderTop"),children:[
198
202
  /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("pill",done&&"pillDone"),children:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("pill",done&&"pillDone"),children:copy.orderSteps[o.step]??""})}),o.subscriptionBox?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("pill","pillSub"),children:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("pill","pillSub"),children:copy.subscriptionBox})}):null,o.number===null?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("orderNo"),children:o.number})]}),
199
203
  /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("orderWhat"),children:what}),
200
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("orderMeta"),children:[when,total].filter(x=>x!==null).join(" · ")}),o.items.length===0?null:/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("orderPics"),children:o.items.map(x=>/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("orderPic"),children:x.imageUrl?/* @__PURE__ */jsxRuntime.jsx(reactNative.Image,{source:{uri:x.imageUrl},style:im("orderPicImage"),accessibilityIgnoresInvertColors:true}):k.icon(x.icon??"box",ink("orderPic",X.roles.link??""),side("orderPicSvg",20))},x.title))})]}),
201
- /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:gridCell(X.order,1),children:k.icon("chev",ink("orderChev",X.roles.ink3??""),side("orderChev",18))})]},o.key)}function shopOrdersBody(k,a){let{S:S,copy:copy}=k,{bx:bx,im:im,tx:tx,tb:tb,inner:inner,ink:ink}=S.D,X=S.X,s=a.subscription;return!a.loaded&&s===null?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("shop"),testID:"health-plan-orders-loading"}):a.loaded&&a.orders.length===0&&s===null?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("shop"),testID:"health-plan-orders-empty",children:shopEmpty(k,"box",copy.ordersEmptyTitle,copy.ordersEmptyBody(a.petPrices),shopButton(k,copy.startedDone,a.onBack,{part:"shopEmptyButton"}))}):/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("shop"),testID:"health-plan-orders",children:[s===null?null:/* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[
204
+ /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("orderMeta"),children:[when,total].filter(x=>x!==null).join(" · ")}),o.items.length===0?null:/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("orderPics"),children:o.items.map(x=>/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("orderPic"),children:x.imageUrl?/* @__PURE__ */jsxRuntime.jsx(reactNative.Image,{source:{uri:x.imageUrl},style:im("orderPicImage"),accessibilityIgnoresInvertColors:true}):k2.icon(x.icon??"box",ink("orderPic",X.roles.link??""),side("orderPicSvg",20))},x.title))})]}),
205
+ /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:gridCell(X.order,1),children:k2.icon("chev",ink("orderChev",X.roles.ink3??""),side("orderChev",18))})]},o.key)}function shopOrdersBody(k2,a){let{S:S,copy:copy}=k2,{bx:bx,im:im,tx:tx,tb:tb,inner:inner,ink:ink}=S.D,X=S.X,s=a.subscription;return!a.loaded&&s===null?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("shop"),testID:"health-plan-orders-loading"}):a.loaded&&a.orders.length===0&&s===null?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("shop"),testID:"health-plan-orders-empty",children:shopEmpty(k2,"box",copy.ordersEmptyTitle,copy.ordersEmptyBody(a.petPrices),shopButton(k2,copy.startedDone,a.onBack,{part:"shopEmptyButton"}))}):/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("shop"),testID:"health-plan-orders",children:[s===null?null:/* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[
202
206
  /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("shopKey"),children:copy.herSubscription}),
203
- /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("subCard"),testID:"health-plan-orders-subscription",children:[s.imageUrl?/* @__PURE__ */jsxRuntime.jsx(reactNative.Image,{source:{uri:s.imageUrl},style:[...im("subCardImage"),{flexShrink:0}],accessibilityIgnoresInvertColors:true}):/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[...bx("subCardImage"),gridCell(X.subCard,0),CENTER,{alignItems:"center"}],children:k.icon("box",ink("subCardImage",X.roles.link??""))}),
207
+ /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("subCard"),testID:"health-plan-orders-subscription",children:[s.imageUrl?/* @__PURE__ */jsxRuntime.jsx(reactNative.Image,{source:{uri:s.imageUrl},style:[...im("subCardImage"),{flexShrink:0}],accessibilityIgnoresInvertColors:true}):/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[...bx("subCardImage"),gridCell(X.subCard,0),CENTER,{alignItems:"center"}],children:k2.icon("box",ink("subCardImage",X.roles.link??""))}),
204
208
  /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:gridCell(X.subCard,1),children:[
205
209
  /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("subCardStrong"),children:s.name}),s.next===null?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("subCardSmall"),children:copy.nextBox(s.next)}),
206
210
  /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("subCardSmall"),children:copy.everyDays(s.every)})]}),
207
211
  /* @__PURE__ */jsxRuntime.jsxs(reactNative.Pressable,{onPress:s.onManage,accessibilityRole:"button",accessibilityLabel:copy.manage,hitSlop:HIT_44,style:pressScale([...bx("subCardButton"),gridCell(X.subCard,2),CENTER],PLAN_PRESS_SCALE.subCard,false),testID:"health-plan-orders-manage",children:[inner("subCardButton"),
208
212
  /* @__PURE__ */jsxRuntime.jsx(Text,{tier:"control",style:tx("subCardButton"),children:copy.manage})]})]})]}),a.orders.length>0?/* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[
209
213
  /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("shopKey"),children:copy.ordersHeading(s!==null)}),
210
- /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("orderList"),children:a.orders.map(o=>orderRow(k,o,a.fmt,a.day,a.onOpen))}),a.more&&copy.moreOrders!==""?shopButton(k,copy.moreOrders,a.more.onMore,{ghost:true,disabled:a.more.loading,testID:"health-plan-orders-more"}):null,copy.ordersFine===""?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("shopFine"),children:copy.ordersFine})]}):null]})}function shopOrderBody(k,a){let{S:S,copy:copy}=k,{bx:bx,tx:tx,tb:tb,inner:inner,ink:ink,side:side}=S.D,X=S.X,o=a.order,done=o.step===3,last=o.dates[3]??null,lastDay=a.day(last),sub2=done?lastDay===null?null:copy.deliveredOn(lastDay):lastDay===null?null:copy.arrivesBy(lastDay),steps=o.steps.flatMap(i=>{let title=copy.orderSteps[i];if(title===void 0)return[];let d=a.day(o.dates[i]??null);return[i<=o.step?{title:title,state:"done",...d===null?{}:{detail:d}}:{title:title,state:"next",...d===null?{}:{detail:copy.expected(d)}}]}),httpsLink=o.trackingUrl!==null&&/^https:\/\//i.test(o.trackingUrl)?o.trackingUrl:null,linkLabel=httpsLink===null?"":o.carrier!==null?copy.trackOn(o.carrier):copy.trackLink,total=a.fmt(o.total,o.currency)??"",fine2=[copy.ordersFine,o.everfur?copy.orderNote:""].filter(x=>x!=="").join(" ");/* @__PURE__ */
214
+ /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("orderList"),children:a.orders.map(o=>orderRow(k2,o,a.fmt,a.day,a.onOpen))}),a.more&&copy.moreOrders!==""?shopButton(k2,copy.moreOrders,a.more.onMore,{ghost:true,disabled:a.more.loading,testID:"health-plan-orders-more"}):null,copy.ordersFine===""?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("shopFine"),children:copy.ordersFine})]}):null]})}function shopOrderBody(k2,a){let{S:S,copy:copy}=k2,{bx:bx,tx:tx,tb:tb,inner:inner,ink:ink,side:side}=S.D,X=S.X,o=a.order,done=o.step===3,last=o.dates[3]??null,lastDay=a.day(last),sub2=done?lastDay===null?null:copy.deliveredOn(lastDay):lastDay===null?null:copy.arrivesBy(lastDay),steps=(o.steps??(o.everfur?[0,1,2,3].slice(0,o.step+1):[0,1,2,3])).flatMap(i=>{let title=copy.orderSteps[i];if(title===void 0)return[];let d=a.day(o.dates[i]??null);return[i<=o.step?{title:title,state:"done",...d===null?{}:{detail:d}}:{title:title,state:"next",...d===null?{}:{detail:copy.expected(d)}}]}),httpsLink=o.trackingUrl!==null&&/^https:\/\//i.test(o.trackingUrl)?o.trackingUrl:null,linkLabel=httpsLink===null?"":o.carrier!==null?copy.trackOn(o.carrier):copy.trackLink,total=a.fmt(o.total,o.currency)??"",fine2=[copy.ordersFine,o.everfur?copy.orderNote:""].filter(x=>x!=="").join(" ");/* @__PURE__ */
211
215
  return jsxRuntime.jsxs(reactNative.View,{style:bx("shop"),testID:"health-plan-order",children:[
212
216
  /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("shopTitle"),accessibilityRole:"header",children:done?copy.orderSteps[3]:copy.orderSteps[0]}),sub2===null?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("shopSub"),children:sub2}),
213
- /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("shopCard"),children:shopTrack(k,steps,copy.tracking)}),o.carrier===null&&o.trackingNumber===null?null:/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("shopCard"),testID:"health-plan-carrier",children:/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:[...bx("carrier"),WRAP],children:[
214
- /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[...bx("carrierIcon"),gridCell(X.carrier,0)],children:k.icon("truck",ink("carrierIcon",X.roles.link??""),side("carrierIconSvg",21))}),
217
+ /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("shopCard"),children:shopTrack(k2,steps,copy.tracking)}),o.carrier===null&&o.trackingNumber===null?null:/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("shopCard"),testID:"health-plan-carrier",children:/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:[...bx("carrier"),WRAP],children:[
218
+ /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[...bx("carrierIcon"),gridCell(X.carrier,0)],children:k2.icon("truck",ink("carrierIcon",X.roles.link??""),side("carrierIconSvg",21))}),
215
219
  /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:gridCell(X.carrier,1),children:[o.carrier===null?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("carrierStrong"),children:o.carrier}),o.trackingNumber===null?null:
216
220
  /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:[...bx("carrierSmall"),WRAP],children:[
217
221
  /* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("carrierSmall"),selectable:true,children:o.trackingNumber}),o.trackingTag===null?null:/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("carrierTag"),testID:"health-plan-tracking-tag",children:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("carrierTag"),children:o.trackingTag})})]}),o.trackingNumber===null&&copy.trackingByText!==""?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("carrierWait"),children:copy.trackingByText}):null]}),httpsLink===null||linkLabel===""||o.trackingNumber===null?null:/* @__PURE__ */jsxRuntime.jsxs(reactNative.Pressable,{onPress:()=>{reactNative.Linking.openURL(httpsLink).catch(()=>{})},accessibilityRole:"button",accessibilityLabel:linkLabel,hitSlop:HIT_44,style:pressScale([...bx("carrierButton"),FULL_ROW],PLAN_PRESS_SCALE.button,false),testID:"health-plan-track-link",children:[inner("carrierButton"),
218
222
  /* @__PURE__ */jsxRuntime.jsx(Text,{tier:"control",style:tx("carrierButton"),children:linkLabel})]})]})}),
219
223
  /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("shopKey"),children:copy.inThisOrder}),
220
224
  /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("shopCard"),children:/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("cartItems"),children:o.items.map(x=>/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("cartItem"),testID:"health-plan-order-line",children:[
221
- /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:gridCell(X.cartItem,0),children:tile(k,x.imageUrl,"cartItemImage",side("cartItemImageSvg",28),x.icon??"box")}),
225
+ /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:gridCell(X.cartItem,0),children:tile(k2,x.imageUrl,"cartItemImage",side("cartItemImageSvg",28),x.icon??"box")}),
222
226
  /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:gridCell(X.cartItem,1),children:[
223
227
  /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("cartItemTitle"),children:x.title}),
224
228
  /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("cartItemPrice"),children:[
225
229
  /* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("cartItemPriceValue"),children:a.fmt(x.price,o.currency)??""}),
226
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("cartItemPriceNote"),children:copy.orderItemLine(x.quantity,o.subscriptionBox)})]})]})]},x.title))})}),shopSummary(k,total),shopRows(k,a.rows,true),a.onBuyAgain===null?null:shopButton(k,copy.buyAgain,a.onBuyAgain,{ghost:true,testID:"health-plan-buy-again"}),a.onHelp===null?null:shopLink(k,copy.orderHelp,a.onHelp),fine2===""?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("shopFine"),children:fine2})]})}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 HealthPlanScrollContext=react.createContext(null),HealthPlanViewportContext=react.createContext(null);function HealthPlanScrollScope({scrollRef:scrollRef,children:children,style:style}){let origin=react.useRef(null),still=useEverfurTheme().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__ */
227
- 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 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 PAY_WITH="Pay with",KG_MIN=.5,KG_MAX=90,SHRINK3={flexShrink:1},CART_BUMP_MS=320,PUSH_FOOT_MIN_BOTTOM=12,IN_PLACE={position:"relative",top:0,right:0},FR={flexGrow:1,flexShrink:1,flexBasis:0,minWidth:0},KEEP={flexShrink:0},START={alignSelf:"flex-start"},CENTER2={justifyContent:"center"},COLUMN={flexDirection:"column"},ROW_CENTER={flexDirection:"row",alignItems:"center"},STACK_END={flexDirection:"column",alignItems:"flex-end"},ON_BASELINE={alignSelf:"baseline"},FILL2={width:"100%",height:"100%"},MARKER={position:"absolute",right:"100%",textAlign:"right"},isDogSpecies=s=>s!=null&&/^(dog|canine)$/i.test(s.trim());function HealthPlanFocus(props){let{design:design,item:item,petRef:petRef,locale:locale}=props,petName=props.petName?.trim()?props.petName.trim():null,theme=useEverfurTheme(),S=react.useMemo(()=>makeFocusStyles(theme),[theme]),P=S.palette,telemetry=useHealthPlanTelemetry(),{runtime:runtime}=useEverfurContext(),window=reactNative.useWindowDimensions(),[pageWidth,setPageWidth]=react.useState(null),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]),sub=useHealthPlanSubscription({petRef:petRef,productId:item.productId,enabled:props.subscriptions!==false&&design.pick.none!==true,...props.subscriptionRepository?{repository:props.subscriptionRepository}:{},...props.lifecycle!==void 0?{lifecycle:props.lifecycle}:{},...props.refreshKey!==void 0?{refreshKey:props.refreshKey}:{}}),renderIcon=props.renderIcon,icon=react.useCallback((name,color,size)=>(renderIcon?callHost(renderIcon,name):void 0)??/* @__PURE__ */jsxRuntime.jsx(FocusIcon,{name:name,color:color??P.ink,...size===void 0?{}:{size:size}}),[renderIcon,P.ink]),still=theme.motion.reducedMotion,kit={S:S,icon:icon,copy:copy},[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);react.useEffect(()=>()=>{toastTimer.current!==null&&clearTimeout(toastTimer.current)},[]);let withTracking=line=>[line,copy.trackingComesByText].filter(x=>x!=="").join(" "),say=line=>{line!==""&&(setToast(line),toastTimer.current!==null&&clearTimeout(toastTimer.current),toastTimer.current=setTimeout(()=>setToast(null),2600))},returnUrl=validReturnUrl(props.checkoutReturnUrl)?props.checkoutReturnUrl.trim():null,everfur=props.checkout==="everfur_stripe"&&returnUrl!==null,ownPages=useHealthPlanPageRepository(),pages=props.pageRepository??ownPages,checkoutTap=react.useRef(null),[redirecting,setRedirecting]=react.useState(false),scrollScope=useHealthPlanScroll(),pickRef=react.useRef(null),shop=props.shop??everfur;react.useEffect(()=>{props.shop===true&&props.checkout==="everfur_stripe"&&returnUrl===null&&warnNoReturnUrl()},[props.shop,props.checkout,returnUrl]);let kv=runtime.registry.services.kv,[cart,setCartState]=react.useState(()=>shop?readCart(petRef):[]),cartRef=react.useRef(cart);react.useEffect(()=>{if(!shop)return;let live=true;return loadShopMemory(kv,petRef).then(()=>{if(!live)return;let kept=readCart(petRef);cartRef.current.length===0&&kept.length>0&&(cartRef.current=kept,setCartState(kept))}),()=>{live=false}},[shop,kv,petRef]);let setCart=react.useCallback(f2=>{let next=f2(cartRef.current);cartRef.current=next,writeCart(petRef,next,kv),setCartState(next)},[petRef,kv]),[screens,setScreens]=react.useState([]),ownSubs=useHealthPlanSubscriptionRepository(),subsRepo=props.subscriptionRepository??ownSubs,[everfurOrders,setEverfurOrders]=react.useState({loaded:false,orders:[],next:null,loading:false}),[cartOff,setCartOff]=react.useState(false),[weightSaved,setWeightSaved]=react.useState(false),[recent,setRecent]=react.useState([]),others=props.others??[],planItems=[item,...others],seen=/* @__PURE__ */new Set,allOrders=[...[...recent,...everfurOrders.orders].filter(o=>seen.has(o.orderId)?false:(seen.add(o.orderId),true)).map(o=>everfurOrderView(o,planItems)),...(props.shopOrders??[]).map(hostOrderView)],push=react.useCallback(screen=>{setSheet(null),setScreens(prev=>[...prev.filter(x=>x.kind!==screen.kind),screen])},[]),top=screens.length>0?screens[screens.length-1]:void 0,overlay=sheet!==null?sheet.kind:started!==null?"started":top!==void 0?top.kind:null,under=started!==null?"started":top!==void 0?top.kind:null,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]),orderNumber=key=>allOrders.find(o=>o.key===key)?.number??null,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(top?.kind==="order"?orderNumber(top.key):null);default:return}})(under),full=under==="started"||under==="cart"||under==="placed",onOverlayChange=props.onOverlayChange;react.useEffect(()=>{onOverlayChange!==void 0&&callHost(onOverlayChange,overlay,{close:closeOverlays,back:back,...title===void 0?{}:{title:title},...full?{full:full}:{}})},[overlay,onOverlayChange,closeOverlays,back,title,full]);let 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)),under2=Math.max(0,insets.bottom-below);setPane(was=>was!==null&&was.height===height&&was.under===under2?was:{height:height,under:under2})})},[pushedOpen,viewport,window.height,insets.bottom]),react.useEffect(()=>{pane!==null&&pushedId!==null&&viewport?.top(pushedRef.current)},[pane===null,pushedId,viewport]);let quote=sub.phase==="ready"?sub.quote:null,subscription=sub.subscription,active=subscription?.status==="active",canSubscribe=quote!==null,offer=canSubscribe&&quote.offerApplies&&subscription===null,every=active?subscription.intervalDays:canSubscribe?quote.defaultIntervalDays:0,fmt=(n2,currency2)=>formatHealthPlanPriceWith(n2,currency2,{dropZeroCents:false,...props.priceFormat,...locale?{locale:locale}:{}}),fmtWhole=(n2,currency2)=>formatHealthPlanPriceWith(n2,currency2,{dropZeroCents:true,...props.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&&quote?quote.firstBoxPrice:boxPrice,currency),box:fmt(boxPrice,currency),once:fmt(oneBox?.price??boxPrice,currency),onceDiscountPercent:oneBox?.discountPercent??0,intervalDays:days,discountPercent:offer&&quote?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)=>{props.onBuy?callHost(props.onBuy,target):props.onCheckout&&callHost(props.onCheckout,[target])},partnerBuys=props.onBuy!==void 0||props.onCheckout!==void 0,settle=res=>res.ok?(props.onSubscriptionChange&&callHost(props.onSubscriptionChange,res.value),res.value):(say(res.error.displayMessage),null),leave=url=>{props.navigate?callHost(props.navigate,url):reactNative.Linking.openURL(url).catch(()=>{})},returnUrls=()=>returnUrl===null?null:{successUrl:checkoutReturnUrl(returnUrl,CHECKOUT_PARAM,STRIPE_SESSION_ID),cancelUrl:checkoutReturnUrl(returnUrl,CHECKOUT_CANCEL_PARAM,"1")},redirect=async(purchase,intervalDays,target=item)=>{let urls=returnUrls();if(urls===null||redirecting)return;let sig=`${target.productId}:${purchase}:${intervalDays??""}`;checkoutTap.current?.sig!==sig&&(checkoutTap.current={sig:sig,key:mintTapKey()}),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}rememberCheckout(petRef,res.value.checkoutId,kv),leave(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&&quote?quote.firstBoxPrice:boxPrice:oneBox?.price??boxPrice:itemOf2(x.productId)?.price??null,lines=cart.filter(x=>itemOf2(x.productId)!==void 0),lineCount=lines.reduce((n2,x)=>n2+x.qty,0),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||theme.motion.reducedMotion)return;let easing=reactNative.Easing.bezier(.23,1,.32,1),run2=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 run2.start(),()=>run2.stop()},[lineCount,theme.motion.reducedMotion,cartBump]);let cartTotal=Math.round(lines.reduce((n2,x)=>n2+(unitOf(x)??0)*x.qty,0)*100)/100,subLine=lines.find(lineSub)??null,cartOn=everfur&&!cartOff&&pages.startCartCheckout!==void 0,lineView=x=>{let it=itemOf2(x.productId)??item,subbed=lineSub(x),pick2=isPick(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??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:null,note:pick2?subbed?copy.cartSubLine(lp):copy.cartOnceLine(lp,active):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&&quote!==null?{options:quote.intervalOptions,selected:x.every}:null,maxQuantity:cartOn&&!subbed?MAX_QUANTITY:1,lp:lp}},views=lines.map(lineView),renewPrices=subLine===null?null:prices(subLine.every),addToCart=(target,m)=>{if(inCart(target.productId)){push({kind:"cart"});return}let subbing=isPick(target.productId)&&canSubscribe&&!active&&m==="sub";setCart(prev=>[...prev,{productId:target.productId,mode:subbing?"sub":"once",every:quote?.defaultIntervalDays??0,qty:1}]),say(copy.addedToCart(isPick(target.productId)?pr:{...prices(0,target.title),offer:false},subbing))},editLine=(productId,f2)=>setCart(prev=>prev.flatMap(x=>x.productId!==productId?[x]:f2(x)??[])),apart=cartOn&&subLine!==null&&lines.length>1,batch=apart?lines.filter(x=>!lineSub(x)):lines,batchTotal=Math.round(batch.reduce((n2,x)=>n2+(unitOf(x)??0)*x.qty,0)*100)/100,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<=MAX_CART_LINES:!everfur&&props.onCheckout!==void 0&&lines.every(x=>!lineSub(x))),redirectCart=async batchLines=>{let urls=returnUrls();if(urls===null||redirecting||pages.startCartCheckout===void 0)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:mintTapKey()}),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}rememberCheckout(petRef,res.value.checkoutId,kv),leave(res.value.url)},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((n2,x)=>n2+x.qty,0),subtotal:batchTotal,currency:currency}),await redirectCart(batch);return}let only=batch.length===1?batch[0]:lines.length===1?lines[0]:void 0;if(only===void 0){props.onCheckout&&callHost(props.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),buyOnce(target);return}tapKey.current===null&&(tapKey.current=mintTapKey());let res=await sub.buyOneBox(tapKey.current);if(!res.ok){say(res.error.displayMessage);return}tapKey.current=null,props.onOneBoxOrder&&callHost(props.onOneBoxOrder,res.value),bought([res.value.productId]),placed([res.value])},ordersOpen=screens.some(x=>x.kind==="orders"||x.kind==="order"),ordersLive=react.useRef(false),loadingMore=react.useRef(false),sayRef=react.useRef(say);sayRef.current=say,react.useEffect(()=>{if(!shop||!ordersOpen)return;let live=true;return ordersLive.current=true,readOrders(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]);let moreOrders=()=>{let cursor=everfurOrders.next;cursor===null||loadingMore.current||(loadingMore.current=true,setEverfurOrders(prev=>({...prev,loading:true})),readOrders(subsRepo,petRef,cursor).then(async res=>{let again=!res.ok&&invalidCursor(res.error)?await readOrders(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=>({loaded:true,orders:[...prev.orders,...page.orders.filter(o=>!prev.orders.some(x=>x.orderId===o.orderId))],next:page.nextCursor,loading:false}))}else setEverfurOrders(prev=>({...prev,loading:false})),sayRef.current(res.error.displayMessage)}}))},species=props.species??null,isDog=isDogSpecies(species),otherSpecies=species!==null&&species.trim()!==""&&!isDog,weightKnown=props.weightKnown!==false||weightSaved,askWeight=!weightKnown&&isDog,kg=props.weightUnit==="kg",[weightInput,setWeightInput]=react.useState(""),[weightFocused,setWeightFocused]=react.useState(false),[weightError,setWeightError]=react.useState(""),[savingWeight,setSavingWeight]=react.useState(false),saveWeight=async()=>{let n2=Math.round(Number.parseFloat(weightInput.replace(",","."))*10)/10;if(!(kg?n2>=KG_MIN&&n2<=KG_MAX:n2>=1&&n2<=200)){setWeightError(kg?copy.weightErrorKg:copy.weightError);return}let{weightKg:weightKg,pounds:lb}=healthPlanWeightForSave(n2,kg);setSavingWeight(true);let res=props.onSaveWeight?await props.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(n2)):copy.weightSaved(String(lb))),props.onWeightSaved&&callHost(props.onWeightSaved,weightKg)},recordsReader=props.recordsRepository,[recordsEmpty,setRecordsEmpty]=react.useState(null),readEmpty=recordsReader!==void 0&&props.recordsMissing===void 0&&props.onConnectRecords!==void 0;react.useEffect(()=>{if(!readEmpty||recordsReader===void 0)return;let live=true;return recordsReader.getRecord(petRef).then(res=>{live&&setRecordsEmpty(res.ok?res.value.withheld!==true&&res.value.is_empty===true:null)}).catch(()=>{}),()=>{live=false}},[readEmpty,recordsReader,petRef]);let 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),[storeNoVet,setStoreNoVet]=react.useState(()=>healthPlanNoVet(petRef));react.useEffect(()=>(setStoreNoVet(healthPlanNoVet(petRef)),onHealthPlanNoVet((pet,none)=>{pet===petRef&&setStoreNoVet(none)})),[petRef]);let noVet=props.noVet??storeNoVet,blanksFacts=props.recordsBlanks!==void 0?props.recordsBlanks:probed?.blanks??null,[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:copy.recordsLanded});landed.current={say:say,line:copy.recordsLanded},react.useEffect(()=>{if(blanksId===null)return;let live=true;return loadBlanksMemo(kv,petRef).then(()=>{let memo=blanksMemo(petRef);if(blanksPhase==="wait"){memo.waited!==blanksId&&setBlanksMemo(kv,petRef,{...memo,waited:blanksId});return}!live||memo.flashed===blanksId||(setBlanksMemo(kv,petRef,{...memo,flashed:blanksId}),!(memo.waited!==blanksId&&!hostSaid.current)&&(hostSaid.current=false,setFlashKey(blanksId),landed.current.say(landed.current.line),notifyHealthPlanRecordsLanded(petRef,"plan")))}),()=>{live=false}},[blanksPhase,blanksId,petRef,kv]);let placed=orders=>{let first=orders[0];if(first!==void 0){if(!shop){setStarted({kind:"once",order:first});return}setRecent(prev=>[...orders,...prev.filter(o=>!orders.some(x=>x.orderId===o.orderId))]),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)))};useCheckoutReturn({enabled:everfur,petRef:petRef,pages:pages,returnUrl:returnUrl,lifecycle:props.lifecycle??null,kv:kv,onPaid:state2=>{let run2=state2.subscription,orders=state2.orders??(state2.order===null?[]:[state2.order]);if(run2!==null)props.onSubscriptionChange&&callHost(props.onSubscriptionChange,run2),setSheet(null),setScreens([]),setStarted({kind:"sub",sub:run2});else if(orders.length>0){for(let o of orders)props.onOneBoxOrder&&callHost(props.onOneBoxOrder,o);placed(orders)}bought([run2?.productId??null,...orders.map(o=>o.productId)]),sub.refresh()},onFailed:()=>{setSheet(null),shop&&(setStarted(null),setScreens([{kind:"cart"}])),say(copy.checkoutFailed)},onCancel:()=>{setRedirecting(false)},onTimeout:()=>{shop&&(setSheet(null),setStarted(null),setScreens([{kind:"orders"}]))},onError:error=>say(error.displayMessage)});let X=S.X,{bx:bx,im:im,tx:tx,tb:tb,ring:ring,inner:inner,ink:ink,side:side,mod:mod,scroll:scroll,swipe:swipe}=S.D,badgeOuter=X.cartCount.rings[0]??X.cartCount.box,badgePlace={position:"absolute",top:badgeOuter.top,right:badgeOuter.right},img=(src,style)=>src?/* @__PURE__ */jsxRuntime.jsx(reactNative.Image,{source:{uri:src},style:style,accessibilityIgnoresInvertColors:true}):null,tag=(label,part)=>label===void 0||label===""?null:/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("tag",part),children:/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"compact",style:tx("tag",part),children:label})}),sec=1,n=(k,part)=>/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx(part),accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants",children:/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"badge",style:tx(part),children:String(k)})}),secHead=label=>/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("secTitle"),children:[n(sec++,"secN"),
228
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:[...tx("secTitle"),SHRINK3],accessibilityRole:"header",children:label})]}),toastNode=/* @__PURE__ */jsxRuntime.jsx(PlanLinger,{motions:[TOAST_MOTION],draw:toast===null?null:([on])=>/* @__PURE__ */jsxRuntime.jsx(reactNative.Animated.View,{style:[...bx("toast"),{opacity:on},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(Text,{style:tx("toast"),children:toast})})}),f=design.focus,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,noRecords=recordsMissing,vetSignTitle=title2=>noVet?copy.callAVet:noRecords?copy.callYourVet:title2,pageW=pageWidth??window.width,padX=name=>Number(X[name].box.paddingLeft??0)+Number(X[name].box.paddingRight??0),tipWidth=swipe("tip",pageW-padX("root")-padX("steps")),reviewWidth=swipe("review",pageW-padX("root")-padX("sec")-padX("pick")),checkupBody=as=>{let c=design.checkup;if(c===void 0)return null;let addLabel=noRecords||noVet?added?copy.savedForCheckup:copy.saveForCheckup:added?c.added:c.add;/* @__PURE__ */
229
- return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[as==="kicker"?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("questionsKicker"),accessibilityRole:"header",children:c.title}):secHead(c.title),
230
- /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("questions",as==="kicker"&&"questionsAfterKicker"),children:c.questions.map((q,i)=>/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{children:[
231
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:[...tx("questions"),MARKER],accessibilityElementsHidden:true,importantForAccessibility:"no",children:`${i+1}. `}),
232
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("questions"),children:q})]},q))}),addLabel===""?null:/* @__PURE__ */jsxRuntime.jsxs(reactNative.Pressable,{onPress:()=>{let next=!added;setAdded(next),props.onAddToVisit&&callHost(props.onAddToVisit,next,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"),
233
- /* @__PURE__ */jsxRuntime.jsx(Text,{tier:"control",style:tx("add",added&&"addOn"),children:addLabel})]})]})},blanksShown=blanksFacts!==null&&!waiting,blanksCard=null;if(blanksShown){let filled=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:!filled||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:filled&&weightKnown?daily.value:null,trail:` ${copy.blanksDose(daily.label,item.title)}`,source:copy.blanksDoseSource,width:"s"}],{key:"shots",lead:copy.blanksShots,value:filled&&blanksFacts.nextShotsAt!==null?blanksDay(blanksFacts.nextShotsAt,locale):null,trail:"",source:copy.blanksShotsSource,width:"l"}],count=blankRows.filter(r=>r.value!==null).length;blanksCard=/* @__PURE__ */jsxRuntime.jsx(HealthPlanBlanks,{phase:blanksFacts.phase,kicker:filled?copy.blanksFilledKicker:blanksFacts.clinicName!==null?copy.blanksAsked(blanksFacts.clinicName):copy.blanksAskedNoClinic,pill:filled?copy.blanksFilled(count,blankRows.length):copy.blanksWaitPill,rows:blankRows,blankLabel:copy.blankEmpty,label:copy.blanksLabel,flashKey:flashKey})}let connectRow=inSec=>(noRecords||noVet)&&props.onConnectRecords&&!blanksShown?shopAskRow(kit,"file",copy.connectRecordsTitle,copy.connectRecordsBody,()=>props.onConnectRecords&&callHost(props.onConnectRecords),"health-plan-connect-records",inSec):null,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,tools=shop?/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("tools"),children:[design.eyebrow?/* @__PURE__ */jsxRuntime.jsx(Text,{style:[...tb("toolsEyebrow"),SHRINK3],children:design.eyebrow}):/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{}),
230
+ /* @__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),fine2===""?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("shopFine"),children:fine2})]})}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__ */
231
+ 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&&quote.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&&quote?quote.firstBoxPrice:boxPrice,currency),box:fmt(boxPrice,currency),once:fmt(oneBox?.price??boxPrice,currency),onceDiscountPercent:oneBox?.discountPercent??0,intervalDays:days,discountPercent:offer&&quote?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&&quote?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&&quote!==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 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 cache4=/* @__PURE__ */new Map;function piecesOf(name,size){let key=`${name}:${size}`,hit=cache4.get(key);if(hit!==void 0)return hit;let icon=DESIGN_RN_PLAN_ICONS[name],out=[],k2=size/BOX;return boxPieces(icon,k2,out),strokePieces(icon,k2,out),trianglePieces(icon,k2,out),cache4.set(key,out),out}function FocusIcon({name:name,size:size=18,color:color}){let pieces=DESIGN_RN_PLAN_ICONS[name]===void 0?[]:piecesOf(name,size);/* @__PURE__ */
232
+ 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 P=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,P.ink,"bold"),mini:{...t(10.5,P.ink3,"mono"),textTransform:"uppercase",letterSpacing:.9},h3:{...t(19,P.ink,"bold",1.2),marginTop:space.sm},bold:face(theme,"bold"),noPick:{...t(15,P.ink2,"regular",1.45),marginTop:14},small:t(13,P.ink3,"regular",1.35),smallInk:t(13,P.ink2,"regular",1.35),buttonGhost:{minHeight:48,borderRadius:999,alignItems:"center",justifyContent:"center",paddingHorizontal:space.lg,borderWidth:2,borderColor:P.ink,marginTop:space.sm},buttonGhostText:{...t(15,P.ink,"bold",1.2),textAlign:"center"},disabled:{opacity:.5},fine:{...t(13,P.ink3,"regular",1.4),marginTop:space.sm},scrim:{flex:1,justifyContent:"flex-end",backgroundColor:P.scrim},sheet:{maxHeight:"92%",paddingHorizontal:space.lg,paddingTop:space.sm,paddingBottom:space.xl,borderTopLeftRadius:22,borderTopRightRadius:22,backgroundColor:P.card},sheetGrab:{alignSelf:"center",width:40,height:4,borderRadius:2,backgroundColor:P.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:P,X:X,D:planDraw(X),ds:rnPlanDsTheme(theme,X.roles)}}var KitContext=react.createContext(null);function HealthPlanRnKitScope(props){/* @__PURE__ */
233
+ 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"},ROW_CENTER={flexDirection:"row",alignItems:"center"},STACK_END={flexDirection:"column",alignItems:"flex-end"},ON_BASELINE={alignSelf:"baseline"},FILL2={width:"100%",height:"100%"},MARKER={position:"absolute",right:"100%",textAlign:"right"},IN_PLACE={position:"relative",top:0,right:0},planImg=(src,style)=>src?/* @__PURE__ */jsxRuntime.jsx(reactNative.Image,{source:{uri:src},style:style,accessibilityIgnoresInvertColors:true}):null;function planTag(k2,label,part){let{bx:bx,tx:tx}=k2.S.D;return label===void 0||label===""?null:/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("tag",part),children:/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"compact",style:tx("tag",part),children:label})})}function planNumber(k2,value,part){let{bx:bx,tx:tx}=k2.S.D;/* @__PURE__ */
234
+ return jsxRuntime.jsx(reactNative.View,{style:bx(part),accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants",children:/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"badge",style:tx(part),children:String(value)})})}function planSecHead(k2,value,label){let{bx:bx,tx:tx}=k2.S.D;/* @__PURE__ */
235
+ return jsxRuntime.jsxs(reactNative.View,{style:bx("secTitle"),children:[planNumber(k2,value,"secN"),
236
+ /* @__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__ */
237
+ 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 run2 of runs)run2.start();return()=>{for(let run2 of runs)run2.stop()}},[flashKey,phase,still]),/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("blanksWrap","blanksCard"),accessibilityLabel:props.label,testID:"health-plan-blanks",children:[
238
+ /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("blanksHead"),children:[
239
+ /* @__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})})]}),
240
+ /* @__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__ */
241
+ return jsxRuntime.jsxs(reactNative.View,{style:bx("blanksRow"),testID:`health-plan-blank-${r.key}`,children:[
242
+ /* @__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)})}),
243
+ /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:gridCell(X.blanksRow,1),children:[
244
+ /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:LINE,children:[r.lead===""?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("blanksText"),children:r.lead}),
245
+ /* @__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)})})]})}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,part)=>w-padX(part),pageWidth))}function HealthPlanToolbar(props){let k2=useHealthPlanRnKit(props),{S:S,copy:copy,icon:icon}=k2,P=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),run2=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 run2.start(),()=>run2.stop()},[lineCount,k2.still,cartBump]);let badgeOuter=X.cartCount.rings[0]??X.cartCount.box,badgePlace={position:"absolute",top:badgeOuter.top,right:badgeOuter.right};/* @__PURE__ */
246
+ 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,{}),
234
247
  /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("toolsEnd"),children:[
235
- /* @__PURE__ */jsxRuntime.jsxs(reactNative.Pressable,{onPress:()=>push({kind:"orders"}),accessibilityRole:"button",accessibilityLabel:copy.orders,style:bx("orders"),testID:"health-plan-orders-button",children:[icon("box",ink("orders",P.ink),side("ordersIcon",21)),
248
+ /* @__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",P.ink),side("ordersIcon",21)),
236
249
  /* @__PURE__ */jsxRuntime.jsx(Text,{tier:"control",style:tx("orders"),children:copy.orders})]}),
237
- /* @__PURE__ */jsxRuntime.jsxs(reactNative.Pressable,{onPress:()=>push({kind:"cart"}),accessibilityRole:"button",accessibilityLabel:copy.cartLabel(lineCount),style:bx("cart"),testID:"health-plan-cart-button",children:[icon("cart",ink("cart",P.ink),side("cartIcon",26)),lineCount===0?null:
250
+ /* @__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",P.ink),side("cartIcon",26)),lineCount===0?null:
238
251
  /* @__PURE__ */jsxRuntime.jsx(reactNative.Animated.View,{pointerEvents:"none",style:[badgePlace,{transform:[{scale:cartBump}]}],children:ring("cartCount",
239
- /* @__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)})]})]})]}):null,pageNode=/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:[...bx("root"),props.style],testID:"health-plan-focus",onLayout:e=>setPageWidth(Math.round(e.nativeEvent.layout.width)),children:[tools,toastNode,
240
- /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("head"),children:[
241
- /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:gridCell(X.head,0),children:[design.eyebrow&&!shop?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("eyebrow"),children:design.eyebrow}):null,
242
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("title"),accessibilityRole:"header",testID:"health-plan-focus-title",children:design.title}),noRecords&&design.subtitleNoRecords?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("subtitle"),children:design.subtitleNoRecords}):design.subtitle?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("subtitle"),children:design.subtitle}):null]}),design.headImageUrl?ring("headImage",img(design.headImageUrl,im("headImage")),KEEP):null]}),blanksCard,waitNode!==null?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("wait"),children:waitNode}):design.wait?shopWait(kit,design.wait,props.onWaitAction,vet?.name??null):null,byline&&!waiting?/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("by"),testID:"health-plan-byline",children:[img(byline.imageUrl,im("byImage")),
243
- /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:gridCell(X.by,1),children:[
244
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("byName"),children:copy.builtWith(byline.name)}),byline.role?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("byRole"),children:byline.role}):null]}),icon("shield",ink("byOk",P.teal),side("byOk",22))]}):null,f&&!waiting?/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("need"),accessibilityLabel:f.title,testID:"health-plan-focus-card",children:[
252
+ /* @__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__ */
253
+ return jsxRuntime.jsxs(reactNative.View,{style:bx("head"),children:[
254
+ /* @__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,
255
+ /* @__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__ */
256
+ return jsxRuntime.jsxs(reactNative.View,{style:bx("by"),testID:"health-plan-byline",children:[planImg(byline.imageUrl,im("byImage")),
257
+ /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:gridCell(k2.S.X.by,1),children:[
258
+ /* @__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;return vet.imageUrl?/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("says"),testID:"health-plan-quote",children:[planImg(vet.imageUrl,im("saysImage")),
259
+ /* @__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)]})]}):/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:[...bx("says"),COLUMN],testID:"health-plan-quote",children:[vet.shortName||quote.tag?/* @__PURE__ */jsxRuntime.jsxs(Text,{style:tx("says"),children:[vet.shortName,vet.shortName&&quote.tag?" ":null,planTag(k2,quote.tag)]}):null,
260
+ /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("saysSerif"),children:quote.text})]})}function HealthPlanJumpStrip(props){let k2=useHealthPlanRnKit(props),{bx:bx,tx:tx,im:im}=k2.S.D,jump=props.onJump;/* @__PURE__ */
261
+ 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")),
262
+ /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:FR,children:[props.kicker===null?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("jumpSmall"),children:props.kicker}),
263
+ /* @__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),{S:S,icon:icon}=k2,P=S.palette,X=S.X,{bx:bx,tx:tx,tb:tb,mod:mod,ink:ink,side:side}=S.D,f=props.focus,vet=props.vet;/* @__PURE__ */
264
+ return jsxRuntime.jsxs(reactNative.View,{style:bx("need"),accessibilityLabel:f.title,testID:"health-plan-focus-card",children:[
245
265
  /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("needKicker"),children:[
246
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:[...tx("needKicker"),SHRINK3],children:f.kicker}),f.sources&&f.sources.length>0?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("sources"),children:f.sources.map(s=>/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("source",mod("source",s.kind)),children:/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"compact",style:tx("source",mod("source",s.kind)),children:s.label})},s.label))}):null]}),
266
+ /* @__PURE__ */jsxRuntime.jsx(Text,{style:[...tx("needKicker"),SHRINK2],children:f.kicker}),f.sources&&f.sources.length>0?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("sources"),children:f.sources.map(s=>/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("source",mod("source",s.kind)),children:/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"compact",style:tx("source",mod("source",s.kind)),children:s.label})},s.label))}):null]}),
247
267
  /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("needTitle"),accessibilityRole:"header",children:f.title}),f.risk?/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("needRisk"),children:[
248
268
  /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[...bx("dot",mod("dot",f.risk.kind)),ON_BASELINE]}),
249
269
  /* @__PURE__ */jsxRuntime.jsxs(Text,{style:[...tx("needRisk"),gridCell(X.needRisk,1)],children:[
250
270
  /* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("needRiskLead"),children:f.risk.lead}),f.risk.body?` ${f.risk.body}`:""]})]}):null,f.odds?/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("odds"),children:[
251
- /* @__PURE__ */jsxRuntime.jsxs(Text,{style:[...tb("oddsKicker"),SHRINK3],children:[f.odds.label,f.odds.tag?" ":null,tag(f.odds.tag,"oddsTag")]}),
271
+ /* @__PURE__ */jsxRuntime.jsxs(Text,{style:[...tb("oddsKicker"),SHRINK2],children:[f.odds.label,f.odds.tag?" ":null,planTag(k2,f.odds.tag,"oddsTag")]}),
252
272
  /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:[...bx("oddsNumbers"),STACK_END],children:[
253
273
  /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:[ROW_CENTER,{columnGap:X.oddsNumbers.box.columnGap}],children:[
254
274
  /* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("oddsFrom"),children:f.odds.from}),icon("arrow",ink("oddsIcon",P.ink3),side("oddsIcon",16)),
255
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("oddsTo"),children:f.odds.to})]}),f.odds.toLabel?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("oddsLabel"),children:f.odds.toLabel}):null]})]}):null,f.quote&&vet!==null&&vet.imageUrl?/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("says"),testID:"health-plan-quote",children:[img(vet.imageUrl,im("saysImage")),
256
- /* @__PURE__ */jsxRuntime.jsxs(Text,{style:[...tb("saysText"),gridCell(X.says,1)],children:[vet.shortName?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("saysBy"),children:vet.shortName}):null,vet.shortName?" ":null,f.quote.text,f.quote.tag?" ":null,tag(f.quote.tag)]})]}):f.quote&&vet!==null?/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:[...bx("says"),COLUMN],testID:"health-plan-quote",children:[vet.shortName||f.quote.tag?/* @__PURE__ */jsxRuntime.jsxs(Text,{style:tx("says"),children:[vet.shortName,vet.shortName&&f.quote.tag?" ":null,tag(f.quote.tag)]}):null,
257
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("saysSerif"),children:f.quote.text})]}):null,f.jump&&!noPick?/* @__PURE__ */jsxRuntime.jsxs(reactNative.Pressable,{onPress:jump,disabled:jump===void 0,accessibilityRole:jump?"button":"text",style:pressScale(bx("jump",!item.imageUrl&&"jumpNoImage"),PLAN_PRESS_SCALE.jump,jump===void 0),testID:"health-plan-jump",children:[img(item.imageUrl,im("jumpImage")),
258
- /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:FR,children:[pr.box===null&&!canSubscribe?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("jumpSmall"),children:copy.jumpKicker(pr,active)}),
259
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("jumpStrong"),children:f.jump.title})]}),jump?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("jumpGo"),children:f.jump.go}):null]}):null]}):null,design.routine&&!waiting?/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("steps"),testID:"health-plan-routine",children:[
275
+ /* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("oddsTo"),children:f.odds.to})]}),f.odds.toLabel?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("oddsLabel"),children:f.odds.toLabel}):null]})]}):null,f.quote&&vet!==null?/* @__PURE__ */jsxRuntime.jsx(HealthPlanVetQuote,{quote:f.quote,vet:vet,copy:props.copy,renderIcon:props.renderIcon}):null,props.jump?/* @__PURE__ */jsxRuntime.jsx(HealthPlanJumpStrip,{...props.jump,copy:props.copy,renderIcon:props.renderIcon}):null]})}function HealthPlanTips(props){let k2=useHealthPlanRnKit(props),window=reactNative.useWindowDimensions(),{S:S,icon:icon}=k2,P=S.palette,{bx:bx,tx:tx,tb:tb,mod:mod,ink:ink,side:side,scroll:scroll}=S.D,routine=props.routine,tipWidth=swipeWidth(k2,props.pageWidth??window.width,"tip",["root","steps"]);/* @__PURE__ */
276
+ return jsxRuntime.jsxs(reactNative.View,{style:bx("steps"),testID:"health-plan-routine",children:[
260
277
  /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("stepsHead"),children:[
261
- /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:[...bx("stepsTitle"),SHRINK3],children:[n(sec++,"n"),
262
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:[...tx("stepsTitle"),SHRINK3],accessibilityRole:"header",children:design.routine.title})]}),design.routine.label?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("stepsLabel"),children:design.routine.label}):null]}),
263
- /* @__PURE__ */jsxRuntime.jsx(reactNative.ScrollView,{horizontal:true,showsHorizontalScrollIndicator:false,style:scroll("tips").place,contentContainerStyle:scroll("tips").content,children:design.routine.steps.map((s,i)=>/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:[...bx("tip",mod("tip",s.tone??"y")),{width:tipWidth,flexBasis:"auto"}],children:[
278
+ /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:[...bx("stepsTitle"),SHRINK2],children:[planNumber(k2,props.number,"n"),
279
+ /* @__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]}),
280
+ /* @__PURE__ */jsxRuntime.jsx(reactNative.ScrollView,{horizontal:true,showsHorizontalScrollIndicator:false,style:scroll("tips").place,contentContainerStyle:scroll("tips").content,children:routine.steps.map((s,i)=>/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:[...bx("tip",mod("tip",s.tone??"y")),{width:tipWidth,flexBasis:"auto"}],children:[
264
281
  /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("tipTop"),children:[
265
282
  /* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("tipN"),accessibilityElementsHidden:true,importantForAccessibility:"no",children:String(i+1)}),s.icon?icon(s.icon,ink("tipIcon",P.ink),side("tipIcon",26)):null]}),
266
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("tipStrong"),children:s.title}),s.body?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("tipSmall"),children:s.body}):null,s.fromVet?vet?.shortName?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("tipEm"),children:copy.fromVet(vet.shortName)}):null:s.source?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("tipEm"),children:s.source}):null]},s.title))})]}):null,waiting||pickHidden?null:noPick?copy.noPick===""?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:S.noPick,testID:"health-plan-no-pick",children:copy.noPick}):/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{ref:pickRef,style:bx("sec"),testID:"health-plan-pick",children:[secHead(pk.title),
283
+ /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("tipStrong"),children:s.title}),s.body?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("tipSmall"),children:s.body}):null,s.fromVet?props.vetShortName?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("tipEm"),children:k2.copy.fromVet(props.vetShortName)}):null:s.source?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("tipEm"),children:s.source}):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__ */
284
+ 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,place2={position:b.position,top:b.top,left:b.left,right:b.right,zIndex:b.zIndex};/* @__PURE__ */
285
+ return jsxRuntime.jsx(PlanLinger,{motions:[TOAST_MOTION],draw:toast===null?null:([on])=>/* @__PURE__ */jsxRuntime.jsx(reactNative.Animated.View,{style:[place2,{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,P=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__ */
286
+ return jsxRuntime.jsxs(reactNative.View,{ref:props.viewRef,style:bx("sec"),testID:"health-plan-pick",children:[planSecHead(k2,props.number,pk.title),
267
287
  /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("pick"),children:[
268
288
  /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("pickTop"),children:[
269
- /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("pickImage"),children:img(item.imageUrl,FILL2)}),
289
+ /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("pickImage"),children:planImg(item.imageUrl,FILL2)}),
270
290
  /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:gridCell(X.pickTop,1),children:[
271
291
  /* @__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",P.star),side("starsIcon",14)),
272
- /* @__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]})]}),pk.reviews&&pk.reviews.items.length>0?/* @__PURE__ */jsxRuntime.jsx(reactNative.ScrollView,{horizontal:true,showsHorizontalScrollIndicator:false,style:scroll("reviews").place,contentContainerStyle:scroll("reviews").content,accessibilityLabel:pk.reviews.label,testID:"health-plan-reviews",children:pk.reviews.items.map(r=>{let stars=Math.max(1,Math.min(5,Math.round(r.stars)));/* @__PURE__ */
292
+ /* @__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__ */
293
+ return jsxRuntime.jsx(reactNative.ScrollView,{horizontal:true,showsHorizontalScrollIndicator:false,style:scroll("reviews").place,contentContainerStyle:scroll("reviews").content,accessibilityLabel:reviews.label,testID:"health-plan-reviews",children:reviews.items.map(r=>{let stars=Math.max(1,Math.min(5,Math.round(r.stars)));/* @__PURE__ */
273
294
  return jsxRuntime.jsxs(reactNative.View,{style:[...bx("review"),{width:reviewWidth,flexBasis:"auto"}],children:[
274
- /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("reviewStars"),accessibilityLabel:`${stars} out of 5 stars`,children:Array.from({length:stars},(_,k)=>/* @__PURE__ */jsxRuntime.jsx(react.Fragment,{children:icon("star",ink("reviewStars",P.star),side("reviewStar",13))},k))}),
295
+ /* @__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))}),
275
296
  /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("reviewText"),children:`“${r.text}”`}),
276
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("reviewBy"),children:r.by})]},`${r.by}${r.text}`)})}):null,pk.why&&pk.why.rows.length>0?/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("why"),testID:"health-plan-why",children:[inner("why"),
277
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("whyMini"),children:pk.why.title}),
278
- /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("whyList"),children:pk.why.rows.map(r=>/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("whyRow"),children:[
297
+ /* @__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"),
298
+ /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("whyMini"),children:why.title}),
299
+ /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("whyList"),children:why.rows.map(r=>/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("whyRow"),children:[
279
300
  /* @__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})}),
280
301
  /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:gridCell(X.whyRow,1),children:[
281
- /* @__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))}),pk.why.score&&pk.why.rows.length>=2?/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("score"),testID:"health-plan-why-score",children:[
282
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:[...tx("score"),SHRINK3],children:copy.signalsFit(pk.why.rows.length)}),
283
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("scoreValue"),accessibilityElementsHidden:true,importantForAccessibility:"no",children:copy.signalsValue(pk.why.rows.length)})]}):null]}):null,otherSpecies?null:askWeight?shopAskRow(kit,"pulse",copy.addWeightTitle,copy.addWeightBody,()=>{setWeightError(""),setSheet({kind:"weight"})},"health-plan-add-weight",true):pk.dose?/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("dose"),testID:"health-plan-dose",children:[
284
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("doseMini"),children:pk.dose.title}),
285
- /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("doseList"),children:pk.dose.stats.map((s,i)=>/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:[...bx("doseItem"),gridCell(X.doseList,i)],children:[
302
+ /* @__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:[
303
+ /* @__PURE__ */jsxRuntime.jsx(Text,{style:[...tx("score"),SHRINK2],children:copy.signalsFit(why.rows.length)}),
304
+ /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("scoreValue"),accessibilityElementsHidden:true,importantForAccessibility:"no",children:copy.signalsValue(why.rows.length)})]}):null]})}function HealthPlanDoseCard(props){let k2=useHealthPlanRnKit(props),{bx:bx,tb:tb}=k2.S.D,dose=props.dose;/* @__PURE__ */
305
+ return jsxRuntime.jsxs(reactNative.View,{style:bx("dose"),testID:"health-plan-dose",children:[
306
+ /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("doseMini"),children:dose.title}),
307
+ /* @__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:[
286
308
  /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("doseValue"),children:s.value}),
287
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("doseLabel"),children:s.label})]},`${s.value}${s.label}`))}),pk.dose.note?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("doseNote"),children:pk.dose.note}):null]}):null,pk.ingredients&&pk.ingredients.items.length>0?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("ingredients"),accessibilityLabel:pk.ingredients.label??pk.ingredients.items.join(", "),children:pk.ingredients.items.map(x=>/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("ingredient"),children:x},x))}):null,canSubscribe&&priced?/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("opts"),accessibilityRole:"radiogroup",accessibilityLabel:copy.optionsLabel,testID:"health-plan-options",children:[
288
- /* @__PURE__ */jsxRuntime.jsxs(reactNative.Pressable,{onPress:()=>setMode("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"),
309
+ /* @__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__ */
310
+ return jsxRuntime.jsxs(reactNative.View,{style:bx("opts"),accessibilityRole:"radiogroup",accessibilityLabel:copy.optionsLabel,testID:"health-plan-options",children:[
311
+ /* @__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"),
289
312
  /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:[...bx("optText"),FR],children:[offer?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("optTag"),children:copy.bestValue}):null,
290
313
  /* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("optStrong"),children:copy.subscribe}),
291
314
  /* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("optSmall"),children:copy.subscribeLine(pr)})]}),
292
315
  /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("price"),children:[offer?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("priceWas"),children:pr.box}):null,
293
316
  /* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("priceValue"),children:offer?pr.first:pr.box})]})]}),
294
- /* @__PURE__ */jsxRuntime.jsxs(reactNative.Pressable,{onPress:()=>setMode("once"),accessibilityRole:"radio",accessibilityState:{checked:buyMode==="once"},accessibilityLabel:copy.once,style:pressScale(bx("opt","optOnce",buyMode==="once"&&"optOn",buyMode==="once"&&"optOnceOn"),PLAN_PRESS_SCALE.opt,false),testID:"health-plan-opt-once",children:[inner("opt","optOnce",buyMode==="once"&&"optOn",buyMode==="once"&&"optOnceOn"),
317
+ /* @__PURE__ */jsxRuntime.jsxs(reactNative.Pressable,{onPress:()=>props.onModeChange("once"),accessibilityRole:"radio",accessibilityState:{checked:buyMode==="once"},accessibilityLabel:copy.once,style:pressScale(bx("opt","optOnce",buyMode==="once"&&"optOn",buyMode==="once"&&"optOnceOn"),PLAN_PRESS_SCALE.opt,false),testID:"health-plan-opt-once",children:[inner("opt","optOnce",buyMode==="once"&&"optOn",buyMode==="once"&&"optOnceOn"),
295
318
  /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:[...bx("optText"),FR],children:[
296
319
  /* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("optStrong","optOnceStrong"),children:copy.once}),
297
320
  /* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("optSmall","optOnceSmall"),children:copy.onceLine(pr)})]}),
298
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("optPrice","optOncePrice"),children:pr.once})]})]}):null,
299
- /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("buy"),children:shop?shopButton(kit,pickInCart?copy.viewCart:priced?copy.addToCart((buyMode==="sub"?pr.first:pr.once)??""):HEALTH_PLAN_COPY.addToCart,()=>addToCart(item,buyMode),{disabled:sub.phase==="loading"&&props.subscriptions!==false||!priced&&!pickInCart,testID:"health-plan-buy"}):shopButton(kit,buyMode==="sub"?copy.subscribe:priced?copy.buyOnce(pr):copy.buyOnceOption,press,{disabled:sub.phase==="loading"&&props.subscriptions!==false||redirecting||everfur&&!priced||!everfur&&!canSubscribe&&!partnerBuys,testID:"health-plan-buy"})}),pk.proof&&!active?/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("proof"),children:[
300
- /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("proofIcon"),children:icon("flame",ink("proof",P.riskInk),side("proofIcon",21))}),
301
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:[...tx("proof"),SHRINK3],children:pk.proof})]}):null,trust.length>0?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("trust"),testID:"health-plan-trust",children:trust.map((t,i)=>/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:[...bx("trustItem"),gridCell(X.trust,i)],children:[icon(t.icon,ink("trustIcon",P.teal),side("trustIcon",20)),
302
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("trustItem"),children:t.label})]},t.label))}):null,active&&subscription!==null?/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("on"),testID:"health-plan-subscribed",children:[
303
- /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("onIcon"),children:icon("check",ink("onIcon",P.card),side("onIconSvg",18))}),
304
- /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:gridCell(X.on,1),children:[
321
+ /* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("optPrice","optOncePrice"),children:pr.once})]})]})}function HealthPlanBuyButton(props){let k2=useHealthPlanRnKit(props);/* @__PURE__ */
322
+ return jsxRuntime.jsx(reactNative.View,{style:k2.S.D.bx("buy"),children:shopButton(k2,props.label,props.onPress,{disabled:props.disabled===true,testID:props.testID??"health-plan-buy"})})}function HealthPlanProof(props){let k2=useHealthPlanRnKit(props),{bx:bx,tx:tx,ink:ink,side:side}=k2.S.D;/* @__PURE__ */
323
+ return jsxRuntime.jsxs(reactNative.View,{style:bx("proof"),children:[
324
+ /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("proofIcon"),children:k2.icon("flame",ink("proof",k2.S.palette.riskInk),side("proofIcon",21))}),
325
+ /* @__PURE__ */jsxRuntime.jsx(Text,{style:[...tx("proof"),SHRINK2],children:props.text})]})}function HealthPlanTrustRow(props){let k2=useHealthPlanRnKit(props),{bx:bx,tx:tx,ink:ink,side:side}=k2.S.D;return props.items.length===0?null:/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("trust"),testID:"health-plan-trust",children:props.items.map((t,i)=>/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:[...bx("trustItem"),gridCell(k2.S.X.trust,i)],children:[k2.icon(t.icon,ink("trustIcon",k2.S.palette.teal),side("trustIcon",20)),
326
+ /* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("trustItem"),children:t.label})]},t.label))})}function HealthPlanSubscribedBox(props){let k2=useHealthPlanRnKit(props),{copy:copy}=k2,{bx:bx,tx:tx,tb:tb,inner:inner,ink:ink,side:side}=k2.S.D;/* @__PURE__ */
327
+ return jsxRuntime.jsxs(reactNative.View,{style:bx("on"),testID:"health-plan-subscribed",children:[
328
+ /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("onIcon"),children:k2.icon("check",ink("onIcon",k2.S.palette.card),side("onIconSvg",18))}),
329
+ /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:gridCell(k2.S.X.on,1),children:[
305
330
  /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("onStrong"),children:copy.subscribed}),
306
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("onSmall"),children:copy.subscribedLine(pr,nextBoxDay(subscription))})]}),
307
- /* @__PURE__ */jsxRuntime.jsxs(reactNative.Pressable,{onPress:()=>setSheet({kind:"manage"}),accessibilityRole:"button",accessibilityLabel:copy.manage,style:pressScale([...bx("onButton"),CENTER2],PLAN_PRESS_SCALE.onButton,false),testID:"health-plan-manage",children:[inner("onButton"),
308
- /* @__PURE__ */jsxRuntime.jsx(Text,{tier:"control",style:tx("onButton"),children:copy.manage})]})]}):null,pk.more&&props.onMore?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("more"),children:/* @__PURE__ */jsxRuntime.jsx(reactNative.Pressable,{onPress:()=>props.onMore&&callHost(props.onMore,item),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]})]}),others.length>0&&!waiting&&!noPick&&!curated?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("others"),testID:"health-plan-others",children:others.map(o=>{let once=fmt(o.price,o.currency),op={petName:petName,productName:o.title,first:once,box:once,once:once,onceDiscountPercent:0,intervalDays:0,discountPercent:0,offer:false};/* @__PURE__ */
309
- return jsxRuntime.jsxs(reactNative.View,{style:bx("pick"),testID:`health-plan-other-${o.productId}`,children:[
331
+ /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("onSmall"),children:copy.subscribedLine(props.prices,props.nextBoxDay)})]}),
332
+ /* @__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"),
333
+ /* @__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:[
310
334
  /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("pickTop"),children:[
311
- /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("pickImage"),children:img(o.imageUrl,FILL2)}),
312
- /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:gridCell(X.pickTop,1),children:[props.showCategory===true&&o.category!==null?/* @__PURE__ */jsxRuntime.jsx(Text,{style:S.mini,children:o.category}):null,
313
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("pickTitle"),children:o.title}),o.sample?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:START,children:tag(HEALTH_PLAN_COPY.sample)}):null,o.description?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("pickLine"),children:o.description}):null]})]}),
314
- /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("buy"),children:shop?shopButton(kit,inCart(o.productId)?copy.viewCart:once===null?HEALTH_PLAN_COPY.addToCart:copy.addToCart(once),()=>addToCart(o,"once"),{disabled:once===null,testID:`health-plan-other-buy-${o.productId}`}):shopButton(kit,once===null?copy.buyOnceOption:copy.buyOnce(op),()=>pressOther(o),{disabled:redirecting||everfur&&once===null||!everfur&&!partnerBuys,testID:`health-plan-other-buy-${o.productId}`})})]},o.productId)})}):null,waiting?null:design.signs?/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("sec"),testID:"health-plan-signs",children:[secHead(design.signs.title),design.signs.items.map(s=>/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("sign",s.urgent===true&&"signUrgent"),children:[inner("sign",s.urgent===true&&"signUrgent"),
315
- /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("signTitle"),children:[s.urgent?icon("alert",ink("signUrgentTitle",P.riskInk),side("signUrgentIcon",20)):null,
316
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:[...tx("signTitle",s.urgent===true&&"signUrgentTitle"),SHRINK3],children:s.callVet===true&&s.urgent!==true?vetSignTitle(s.title):s.title})]}),
317
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("signBody",s.urgent===true&&"signUrgentBody"),children:s.body})]},s.title)),checkupBody("kicker"),connectRow(true)]}):design.checkup?/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("sec"),testID:"health-plan-checkup",children:[checkupBody("section"),connectRow(true)]}):connectRow(false),design.extras&&extrasShown?/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("extras"),testID:"health-plan-extras",children:[
318
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("extrasTitle"),accessibilityRole:"header",children:design.extras.title}),extraItems.map(x=>{let product=extraProduct(x);if(product===void 0&&props.onExtra===void 0)return null;let on=product!==void 0?shop&&inCart(product.productId)!==void 0:extras.has(x.key),kind=mod("extra",x.kind),price=x.price??(product!==void 0?fmtWhole(product.price,product.currency):null),label=product!==void 0&&on?copy.viewCart:on?x.added:x.action;/* @__PURE__ */
319
- return jsxRuntime.jsxs(reactNative.View,{style:bx("extra",kind),children:[x.imageUrl?img(x.imageUrl,im("extraImage",kind==="extraKit"&&"extraKitImage")):x.icon?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("extraIcon"),children:icon(x.icon,ink("extraIcon",P.teal),side("extraIconSvg",26))}):null,
335
+ /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("pickImage"),children:planImg(o.imageUrl,FILL2)}),
336
+ /* @__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,
337
+ /* @__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]})]}),
338
+ /* @__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__ */
339
+ 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"),
340
+ /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("signTitle"),children:[s.urgent?k2.icon("alert",ink("signUrgentTitle",k2.S.palette.riskInk),side("signUrgentIcon",20)):null,
341
+ /* @__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})]}),
342
+ /* @__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),
343
+ /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("questions",props.variant==="kicker"&&"questionsAfterKicker"),children:c.questions.map((q,i)=>/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{children:[
344
+ /* @__PURE__ */jsxRuntime.jsx(Text,{style:[...tx("questions"),MARKER],accessibilityElementsHidden:true,importantForAccessibility:"no",children:`${i+1}. `}),
345
+ /* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("questions"),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"),
346
+ /* @__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__ */
347
+ return jsxRuntime.jsxs(reactNative.View,{style:bx("extras"),testID:"health-plan-extras",children:[
348
+ /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("extrasTitle"),accessibilityRole:"header",children:props.title}),props.items.map(({extra:x,price:price,on:on,label:label,onPress:onPress})=>{let kind=mod("extra",x.kind);/* @__PURE__ */
349
+ 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,
320
350
  /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:gridCell(X.extra,1),children:[
321
351
  /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:{minHeight:x.imageUrl||x.icon?Number(X.extraImage.box.height??0):0},children:[
322
352
  /* @__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,price?/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("extraPrice"),children:[
323
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("extraPriceValue"),children:price}),x.was?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("extraPriceWas"),children:x.was}):null,tag(x.tag)]}):null]}),
324
- /* @__PURE__ */jsxRuntime.jsx(reactNative.Pressable,{onPress:()=>{if(product!==void 0){shop?addToCart(product,"once"):pressOther(product);return}let next=!on;setExtras(prev=>{let out=new Set(prev);return next?out.add(x.key):out.delete(x.key),out}),props.onExtra&&callHost(props.onExtra,x.key,next)},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)})]}):null,design.fine?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("pageFine"),children:design.fine}):null]});function 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})}function 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)}let close=()=>setSheet(null),productBlock=line=>/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("coProduct"),children:[
325
- /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[...bx("coProductImage"),gridCell(S.X.coProduct,0)],children:item.imageUrl?img(item.imageUrl,FILL2):null}),
326
- /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:gridCell(S.X.coProduct,1),children:[
327
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("coProductTitle"),children:item.title}),line===""?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("coProductLine"),children:line})]})]}),intervals=(selected,pick2)=>/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("every"),accessibilityRole:"radiogroup",accessibilityLabel:copy.shipsEvery,children:[inner("every"),(quote?.intervalOptions??subscription?.intervalOptions??[]).map((d,i)=>/* @__PURE__ */jsxRuntime.jsx(reactNative.Pressable,{onPress:sub.busy?void 0:()=>pick2(d),disabled:sub.busy,accessibilityRole:"radio",accessibilityState:{checked:selected===d,disabled:sub.busy},accessibilityLabel:copy.days(d),style:[...bx("everyButton",selected===d&&"everyButtonOn"),gridCell(S.X.every,i),{justifyContent:"center"}],testID:`health-plan-every-${d}`,children:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("everyButton",selected===d&&"everyButtonOn"),children:copy.days(d)})},d))]}),coOption=o=>{let X2=S.X,first=X2.coOptionHit.grid[0],coIndent=(typeof first=="number"?first:0)+(typeof X2.coOptionHit.box.columnGap=="number"?X2.coOptionHit.box.columnGap:0);/* @__PURE__ */
353
+ /* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("extraPriceValue"),children:price}),x.was?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("extraPriceWas"),children:x.was}):null,planTag(k2,x.tag)]}):null]}),
354
+ /* @__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__ */
355
+ return jsxRuntime.jsx(HealthPlanToolbar,{eyebrow:m.props.design.eyebrow,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__ */
356
+ return jsxRuntime.jsx(HealthPlanHeader,{eyebrow:design.eyebrow&&!m.hp.shop?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__ */
357
+ 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__ */
358
+ 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__ */
359
+ 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__ */
360
+ return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[
361
+ /* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanReviews,{}),
362
+ /* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanWhyItFits,{}),
363
+ /* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanDoseCard,{}),
364
+ /* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanIngredients,{}),
365
+ /* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanBuyOptions,{}),
366
+ /* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanBuyButton,{}),
367
+ /* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanProof,{}),
368
+ /* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanTrustRow,{}),
369
+ /* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanSubscribedBox,{})]})}function ConnectedHealthPlanProductPick(props){let m=useConnectedHealthPlanModel();if(m===null||m.waiting||m.pickHidden)return null;if(m.noPick)/* @__PURE__ */return jsxRuntime.jsx(HealthPlanNoPick,{text:m.copy.noPick});let{item:item,design:design,onMore:onMore}=m.props;/* @__PURE__ */
370
+ return jsxRuntime.jsx(HealthPlanProductPick,{item:item,pick:design.pick,number:m.numbers.pick??1,viewRef:m.pickRef,onMore:onMore?()=>{callHost(onMore,item)}:void 0,children:props.children===void 0?/* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanPickParts,{}):props.children})}function ConnectedHealthPlanOtherItems(){let m=useConnectedHealthPlanModel(),others=m?.props.others??[];if(m===null||others.length===0||m.waiting||m.noPick||m.curated)return null;let{hp:hp,copy:copy,petName:petName}=m,rows=others.map(o=>{let once=hp.fmt(o.price,o.currency),op={petName:petName,productName:o.title,first:once,box:once,once:once,onceDiscountPercent:0,intervalDays:0,discountPercent:0,offer:false};return hp.shop?{item:o,buyLabel:hp.inCart(o.productId)?copy.viewCart:once===null?HEALTH_PLAN_COPY.addToCart:copy.addToCart(once),buyDisabled:once===null,onBuy:()=>hp.addToCart(o,"once")}:{item:o,buyLabel:once===null?copy.buyOnceOption:copy.buyOnce(op),buyDisabled:hp.redirecting||hp.everfur&&once===null||!hp.everfur&&!hp.partnerBuys,onBuy:()=>hp.pressOther(o)}});/* @__PURE__ */
371
+ return jsxRuntime.jsx(HealthPlanOtherItems,{items:rows,showCategory:m.props.showCategory})}function ConnectedHealthPlanCheckup(props){let m=useConnectedHealthPlanModel(),c=m?.props.design.checkup;if(m===null||c===void 0)return null;let{hp:hp,copy:copy}=m,added=hp.added,addLabel=m.recordsMissing||hp.noVet?added?copy.savedForCheckup:copy.saveForCheckup:added?c.added:c.add;/* @__PURE__ */
372
+ return jsxRuntime.jsx(HealthPlanCheckup,{checkup:c,added:added,addLabel:addLabel,onToggle:hp.toggleAdded,variant:props.variant,number:m.numbers.checkup,children:props.children})}function ConnectedHealthPlanConnectRecords(props){let m=useConnectedHealthPlanModel();if(m===null)return null;let onConnect=m.props.onConnectRecords;if(!((m.recordsMissing||m.hp.noVet)&&onConnect&&!m.blanksShown))return null;let{copy:copy}=m;/* @__PURE__ */
373
+ 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__ */
374
+ return jsxRuntime.jsxs(HealthPlanSigns,{signs:design.signs,number:m.numbers.signs??1,callVetTitle:callVetTitle,children:[
375
+ /* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanCheckup,{variant:"kicker"}),
376
+ /* @__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),price=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:price,on:on,label:label,onPress:()=>hp.pressExtra(x.key,product,on)})}/* @__PURE__ */
377
+ return jsxRuntime.jsx(HealthPlanExtras,{title:extras.title,items:rows})}function ConnectedHealthPlanFine(){let m=useConnectedHealthPlanModel(),fine2=m?.props.design.fine;return m===null||!fine2?null:/* @__PURE__ */jsxRuntime.jsx(HealthPlanFine,{text:fine2})}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__ */
378
+ 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__ */
379
+ return jsxRuntime.jsxs(reactNative.View,{style:bx("nextRow"),children:[
380
+ /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[...bx("nextIcon"),gridCell(X.nextRow,0),r.product===true?{overflow:"hidden"}:null],children:tile2}),
381
+ /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:gridCell(X.nextRow,1),children:[
382
+ /* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("nextLabel"),children:r.when}),
383
+ /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("nextText"),children:r.what})]})]},r.key)}function HealthPlanStarted(props){let k2=useHealthPlanRnKit(props),{bx:bx,tb:tb}=k2.S.D;/* @__PURE__ */
384
+ return jsxRuntime.jsxs(reactNative.View,{style:bx("done"),children:[doneCheck(k2),
385
+ /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("doneTitle"),accessibilityRole:"header",children:props.title}),props.what.trim()===""?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("doneWhen"),children:props.what}),props.note?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("doneWho"),children:props.note}):null,
386
+ /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("next"),accessibilityLabel:k2.copy.startedSteps,children:props.steps.map(r=>nextRow(k2,r))})]})}function HealthPlanPlaced(props){let k2=useHealthPlanRnKit(props),{copy:copy}=k2,{bx:bx,tb:tb}=k2.S.D;/* @__PURE__ */
387
+ return jsxRuntime.jsxs(reactNative.View,{style:bx("done"),testID:"health-plan-placed",children:[doneCheck(k2),
388
+ /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("doneTitle"),accessibilityRole:"header",children:props.title}),props.arrives===null?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("doneWhen"),children:copy.arrivesBy(props.arrives)}),props.orderNumber===null?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("doneWho"),children:copy.orderTitle(props.orderNumber)}),
389
+ /* @__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__ */
390
+ return jsxRuntime.jsxs(reactNative.Pressable,{onPress:props.onBack,accessibilityRole:"button",accessibilityLabel:copy.back,style:S.back,testID:"health-plan-back",children:[
391
+ /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:{transform:[{scaleX:-1}]},children:k2.icon("chev")}),
392
+ /* @__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__ */
393
+ 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:[
394
+ /* @__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}}),
395
+ /* @__PURE__ */jsxRuntime.jsx(reactNative.Pressable,{style:{flex:1},onPress:close,accessibilityRole:"button",accessibilityLabel:copy.close}),
396
+ /* @__PURE__ */jsxRuntime.jsxs(reactNative.Animated.View,{style:[S.sheet,still||sheetOn===void 0?{opacity:sheetOn}:{transform:[{translateY:sheetOn.interpolate({inputRange:[0,1],outputRange:[window.height,0]})}]}],accessibilityViewIsModal:true,children:[
397
+ /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:S.sheetGrab}),
398
+ /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:S.sheetTop,children:[
399
+ /* @__PURE__ */jsxRuntime.jsx(Text,{style:S.mini,children:kicker}),
400
+ /* @__PURE__ */jsxRuntime.jsx(reactNative.Pressable,{onPress:close,accessibilityRole:"button",accessibilityLabel:copy.close,style:S.close,testID:"health-plan-sheet-close",children:icon("x")})]}),
401
+ /* @__PURE__ */jsxRuntime.jsx(reactNative.ScrollView,{keyboardShouldPersistTaps:"handled",children:body})]})]})})})})}function productBlock(k2,item,line){let{bx:bx,tb:tb}=k2.S.D;/* @__PURE__ */
402
+ return jsxRuntime.jsxs(reactNative.View,{style:bx("coProduct"),children:[
403
+ /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[...bx("coProductImage"),gridCell(k2.S.X.coProduct,0)],children:item.imageUrl?planImg(item.imageUrl,FILL2):null}),
404
+ /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:gridCell(k2.S.X.coProduct,1),children:[
405
+ /* @__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__ */
406
+ 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__ */
328
407
  return jsxRuntime.jsxs(reactNative.View,{style:bx("coOption",o.on&&"coOptionOn"),children:[inner("coOption",o.on&&"coOptionOn"),
329
408
  /* @__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:[
330
- /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[...bx("coRadio"),gridCell(X2.coOptionHit,0)],children:inner("coRadio",o.on&&"coRadioOn")}),
331
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:[...tx("coOptionStrong"),gridCell(X2.coOptionHit,1)],children:o.label}),
332
- /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:gridCell(X2.coOptionHit,2),children:[
333
- /* @__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]})},sheetBody=null,kicker="";if(sheet?.kind==="checkout"&&quote!==null){kicker=copy.checkoutKicker;let isSub=sheet.mode==="sub",cp=prices(sheet.every),today=isSub?cp.first:cp.once,coFine=[isSub?copy.renews(cp):copy.onceFine,copy.checkoutNote].filter(x=>x!=="").join(" ");sheetBody=/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("co"),testID:"health-plan-checkout-sheet",children:[
334
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:S.h3,accessibilityRole:"header",children:copy.checkoutTitle(cp)}),productBlock(pk.checkoutLine??pk.line??item.description??""),
335
- /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("coOptions"),accessibilityRole:"radiogroup",accessibilityLabel:copy.optionsLabel,children:[coOption({on:isSub,label:copy.subscribe,price:cp.first,was:offer?cp.box:null,line:offer?copy.checkoutOffer(cp):null,onPress:()=>setSheet({...sheet,mode:"sub"}),testID:"health-plan-co-sub",after:isSub?/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("coWhen"),children:[
336
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("coKicker"),children:copy.shipsEvery}),intervals(sheet.every,d=>setSheet({...sheet,every:d}))]}):null}),coOption({on:!isSub,label:copy.buyOnceOption,price:cp.once,was:cp.onceDiscountPercent>0?cp.box:null,line:oneBox!==null?copy.onceOffer(cp):null,onPress:()=>setSheet({...sheet,mode:"once"}),testID:"health-plan-co-once"})]}),shopRows(kit,rows),shopButton(kit,copy.checkoutGo(cp,isSub,today??""),()=>{(async()=>{if(everfur){await redirect(isSub?"subscription":"one_box",isSub?sheet.every:null);return}if(!isSub){if(oneBox===null){close(),buyOnce();return}tapKey.current===null&&(tapKey.current=mintTapKey());let res=await sub.buyOneBox(tapKey.current);if(!res.ok){say(res.error.displayMessage);return}tapKey.current=null,props.onOneBoxOrder&&callHost(props.onOneBoxOrder,res.value),setSheet(null),placed([res.value]);return}let s=settle(await sub.subscribe(sheet.every));s!==null&&(setSheet(null),setStarted({kind:"sub",sub:s}))})()},{disabled:sub.busy||redirecting,testID:"health-plan-checkout-go"}),coFine===""?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("coFine"),children:coFine})]})}else if(sheet?.kind==="manage"&&subscription!==null&&active){kicker=copy.manageKicker;let mp=prices(subscription.intervalDays);sheetBody=/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("co"),testID:"health-plan-manage-sheet",children:[
337
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:S.h3,accessibilityRole:"header",children:copy.manageTitle(mp)}),productBlock(copy.subscribedLine(mp,nextBoxDay(subscription))),
409
+ /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[...bx("coRadio"),gridCell(X.coOptionHit,0)],children:inner("coRadio",o.on&&"coRadioOn")}),
410
+ /* @__PURE__ */jsxRuntime.jsx(Text,{style:[...tx("coOptionStrong"),gridCell(X.coOptionHit,1)],children:o.label}),
411
+ /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:gridCell(X.coOptionHit,2),children:[
412
+ /* @__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__ */
413
+ return jsxRuntime.jsxs(reactNative.View,{style:bx("co"),testID:"health-plan-checkout-sheet",children:[
414
+ /* @__PURE__ */jsxRuntime.jsx(Text,{style:S.h3,accessibilityRole:"header",children:copy.checkoutTitle(cp)}),productBlock(k2,props.item,props.line),
415
+ /* @__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:[
416
+ /* @__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__ */
417
+ return jsxRuntime.jsxs(reactNative.View,{style:bx("co"),testID:"health-plan-manage-sheet",children:[
418
+ /* @__PURE__ */jsxRuntime.jsx(Text,{style:S.h3,accessibilityRole:"header",children:copy.manageTitle(mp)}),productBlock(k2,props.item,copy.subscribedLine(mp,props.nextBoxDay)),
338
419
  /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{children:[
339
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("coKicker"),children:copy.shipsEvery}),intervals(subscription.intervalDays,d=>{d!==subscription.intervalDays&&sub.changeInterval(d).then(settle)})]}),shopButton(kit,copy.skip,()=>{sub.skip().then(res=>{let s=settle(res);s!==null&&say(copy.skipped(prices(s.intervalDays),nextBoxDay(s)))})},{ghost:true,disabled:sub.busy,testID:"health-plan-skip"}),shopLink(kit,copy.cancel,()=>{sub.cancel().then(res=>{settle(res)!==null&&(setSheet(null),setMode("sub"),say(copy.cancelled(mp)))})},"health-plan-cancel"),shop?shopLink(kit,copy.seeOrders,()=>{setSheet(null),top?.kind!=="orders"&&push({kind:"orders"})},"health-plan-manage-orders"):null]})}else if(sheet?.kind==="cartCheckout"&&batch.length>0){kicker=copy.checkoutKicker;let total=fmt(batchTotal,currency)??"";sheetBody=shopCartCheckout(kit,batch.map(lineView),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,total,batchRenew,{label:copy.placeOrder(total,batchSub!==null),disabled:!cartReady||sub.busy||redirecting,onPress:()=>{placeCart()}},[copy.cartFine(batchRenew),apart?copy.cartSubscriptionApart:"",copy.checkoutNote].filter(x=>x!=="").join(" "))}else sheet?.kind==="weight"&&(kicker=copy.weightKicker,sheetBody=/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:{gap:12},testID:"health-plan-weight-sheet",children:[
340
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:S.h3,accessibilityRole:"header",children:copy.weightTitle(pr)}),
420
+ /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("coKicker"),children:copy.shipsEvery}),intervalsBlock(k2,props.intervals,props.every,props.busy,props.onEveryChange)]}),shopButton(k2,copy.skip,props.onSkip,{ghost:true,disabled:props.busy,testID:"health-plan-skip"}),shopLink(k2,copy.cancel,props.onCancel,"health-plan-cancel"),seeOrders!==null?shopLink(k2,copy.seeOrders,seeOrders,"health-plan-manage-orders"):null]})}function HealthPlanCartCheckout(props){let k2=useHealthPlanRnKit(props);return shopCartCheckout(k2,props.lines,props.lineTotal,props.rows,props.total,props.renew,props.place,props.fine)}function HealthPlanWeightSheet(props){let k2=useHealthPlanRnKit(props),{S:S,copy:copy}=k2,{bx:bx,tx:tx,tb:tb,inner:inner}=S.D,[weightFocused,setWeightFocused]=react.useState(false);/* @__PURE__ */
421
+ return jsxRuntime.jsxs(reactNative.View,{style:{gap:12},testID:"health-plan-weight-sheet",children:[
422
+ /* @__PURE__ */jsxRuntime.jsx(Text,{style:S.h3,accessibilityRole:"header",children:copy.weightTitle(props.prices)}),
341
423
  /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("sheetBody"),children:copy.weightBody}),
342
424
  /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("weightField"),children:[
343
425
  /* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("weightField"),children:copy.weightField}),
344
426
  /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("weightInputWrap"),children:[
345
- /* @__PURE__ */jsxRuntime.jsx(reactNative.TextInput,{value:weightInput,onChangeText:setWeightInput,keyboardType:"decimal-pad",placeholder:"0.0",accessibilityLabel:copy.weightField,onSubmitEditing:()=>{saveWeight()},onFocus:()=>setWeightFocused(true),onBlur:()=>setWeightFocused(false),style:[...bx("weightInput"),...tx("weightInput")],testID:"health-plan-weight-input"}),inner("weightInput",weightFocused&&"weightInputFocus"),
346
- /* @__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:kg?copy.weightUnitKg:copy.weightUnit})})]})]}),weightError===""?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("weightError"),accessibilityLiveRegion:"polite",testID:"health-plan-weight-error",children:weightError}),
347
- /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("weightActions"),children:shopButton(kit,copy.weightSave,()=>{saveWeight()},{disabled:savingWeight,testID:"health-plan-weight-save"})})]}));let sheetNode=/* @__PURE__ */jsxRuntime.jsx(PlanLinger,{motions:[SCRIM_MOTION,still?FADE_MOTION:SHEET_MOTION],draw:sheetBody===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:[
348
- /* @__PURE__ */jsxRuntime.jsx(reactNative.Animated.View,{pointerEvents:"none",style:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:P.scrim,opacity:scrimOn}}),
349
- /* @__PURE__ */jsxRuntime.jsx(reactNative.Pressable,{style:{flex:1},onPress:close,accessibilityRole:"button",accessibilityLabel:copy.close}),
350
- /* @__PURE__ */jsxRuntime.jsxs(reactNative.Animated.View,{style:[S.sheet,still||sheetOn===void 0?{opacity:sheetOn}:{transform:[{translateY:sheetOn.interpolate({inputRange:[0,1],outputRange:[window.height,0]})}]}],accessibilityViewIsModal:true,children:[
351
- /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:S.sheetGrab}),
352
- /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:S.sheetTop,children:[
353
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:S.mini,children:kicker}),
354
- /* @__PURE__ */jsxRuntime.jsx(reactNative.Pressable,{onPress:close,accessibilityRole:"button",accessibilityLabel:copy.close,style:S.close,testID:"health-plan-sheet-close",children:icon("x")})]}),
355
- /* @__PURE__ */jsxRuntime.jsx(reactNative.ScrollView,{keyboardShouldPersistTaps:"handled",children:sheetBody})]})]})})})}),backRow=onOverlayChange===void 0?/* @__PURE__ */jsxRuntime.jsxs(reactNative.Pressable,{onPress:back,accessibilityRole:"button",accessibilityLabel:copy.back,style:S.back,testID:"health-plan-back",children:[
356
- /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:{transform:[{scaleX:-1}]},children:icon("chev")}),
357
- /* @__PURE__ */jsxRuntime.jsx(Text,{tier:"control",style:S.toolLabel,children:copy.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:[
358
- /* @__PURE__ */jsxRuntime.jsx(reactNative.ScrollView,{style:{flex:1},keyboardShouldPersistTaps:"handled",testID:"health-plan-push-scroll",children:content}),footNode]})},screenNode=null,nextIcon=name=>icon(name,ink("nextIcon",X.roles.link??""),side("nextIconSvg",19)),doneCheck=/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("doneCheck"),children:icon("check",ink("doneCheck",P.ink),side("doneCheckSvg",38))}),nextRow=(key,tile2,when,what,photo=false)=>/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("nextRow"),children:[
359
- /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[...bx("nextIcon"),gridCell(X.nextRow,0),photo?{overflow:"hidden"}:null],children:tile2}),
360
- /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:gridCell(X.nextRow,1),children:[
361
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("nextLabel"),children:when}),
362
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("nextText"),children:what})]})]},key);if(started!==null){let run2=started.kind==="sub"?started.sub:null,boughtId=started.kind==="sub"?started.sub.productId:started.order.productId,boughtItem=planItems.find(x=>x.productId===boughtId)??item,sp=prices(run2?.intervalDays??every,boughtItem.title),label=(step,first)=>step.step==="first_box_ships"&&first?copy.tomorrow:day(step.on)??step.on,steps=run2===null?[{icon:"truck",when:copy.tomorrow,what:copy.firstBoxShips}]:run2.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)}}}),doneTitle=run2===null?copy.orderedTitle(sp):copy.startedTitle(sp);screenNode=pushedFrame("health-plan-started",backRow,
363
- /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("done"),children:[doneCheck,
364
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("doneTitle"),accessibilityRole:"header",children:doneTitle}),copy.startedWhat(sp).trim()===""?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("doneWhen"),children:copy.startedWhat(sp)}),copy.startedNote?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("doneWho"),children:copy.startedNote}):null,
365
- /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:bx("next"),accessibilityLabel:copy.startedSteps,children:steps.map(r=>nextRow(`${r.icon}${r.when}`,nextIcon(r.icon),r.when,r.what))})]}),shopButton(kit,copy.startedDone,()=>setStarted(null),{testID:"health-plan-started-done"}))}else if(top!==void 0){let shopDay=iso=>formatShopDay(iso,locale),money2=(amount,cur)=>fmt(amount,cur),toOrders=()=>push({kind:"orders"}),body=null,foot=null,footPart=null;if(top.kind==="cart")body=shopCartBody(kit,views,fmt(cartTotal,currency)??"",renewPrices,pr,{onQuantity:(key,by)=>editLine(key,x=>({...x,qty:Math.max(1,Math.min(cartOn&&!lineSub(x)?MAX_QUANTITY:1,x.qty+by))})),onRemove:key=>{editLine(key,()=>null),say(copy.removedFromCart(itemOf2(key)?.title??""))},onMode:(key,m)=>editLine(key,x=>({...x,mode:m,qty:1})),onEvery:(key,d)=>editLine(key,x=>({...x,every:d})),onOrders:toOrders}),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(fmt(cartTotal,currency)??""),()=>setSheet({kind:"cartCheckout"}),{disabled:!cartReady,testID:"health-plan-cart-checkout"}),!cartReady&&copy.cartOneAtATime!==""?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("shopFine","shopFineCenter"),children:copy.cartOneAtATime}):null]});else if(top.kind==="orders"||top.kind==="order"){let subCard=subscription!==null&&active?{name:subscription.title??item.title,imageUrl:item.imageUrl??null,next:nextBoxDay(subscription),every:subscription.intervalDays,onManage:()=>setSheet({kind:"manage"})}:null;if(top.kind==="orders")body=shopOrdersBody(kit,{subscription:subCard,orders:allOrders,loaded:everfurOrders.loaded,fmt:money2,day:shopDay,onOpen:key=>push({kind:"order",key:key}),onBack:closeOverlays,petPrices:pr,more:everfurOrders.next===null?null:{onMore:moreOrders,loading:everfurOrders.loading}});else{let order=allOrders.find(o=>o.key===top.key),again=order?.everfur===true&&order.productId!==null?itemOf2(order.productId):void 0;body=order===void 0?null:shopOrderBody(kit,{order:order,fmt:money2,day:shopDay,rows:rows.map(r=>r.label===PAY_WITH?{...r,label:copy.paidWith}:r),onBuyAgain:again===void 0?null:()=>addToCart(again,"once"),onHelp:props.onOrderHelp?()=>props.onOrderHelp&&callHost(props.onOrderHelp,order.key):null})}}else{let placedOrders=top.orders,first=placedOrders[0],op=prices(every,first?.title??(first?itemOf2(first.productId)?.title:void 0)??item.title),one=xs=>{let known=[...new Set(xs.filter(x=>x!=null))];return known.length===1?known[0]??null:null},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=day(arrives),placedCurrency=one(placedOrders.map(o=>o.currency)),placedTotal=placedCurrency===null?null:fmt(Math.round(placedOrders.reduce((sum,o)=>sum+(o.total??o.price),0)*100)/100,placedCurrency);body=/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("done"),testID:"health-plan-placed",children:[doneCheck,
366
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("doneTitle"),accessibilityRole:"header",children:copy.orderedTitle(op)}),arrivesDay===null?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("doneWhen"),children:copy.arrivesBy(arrivesDay)}),placedNo===null?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("doneWho"),children:copy.orderTitle(placedNo)}),
367
- /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:bx("next"),accessibilityLabel:copy.placedSteps,children:[placedOrders.map(o=>{let it=itemOf2(o.productId);return nextRow(o.orderId,it?.imageUrl?img(it.imageUrl,im("nextIconImage")):nextIcon("box"),copy.cartItemQuantity(o.quantity??1),o.title??it?.title??"",true)}),nextRow("ships",nextIcon("truck"),copy.tomorrow,withTracking(copy.placedShips)),arrivesDay===null?null:nextRow("arrives",nextIcon("calendar"),arrivesDay,copy.placedArrives)]}),placedOrders.length>1&&placedTotal!==null?shopSummary(kit,placedTotal):null,copy.startedNote?/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("shopFine","shopFineCenter"),children:copy.startedNote}):null]}),footPart="pushFootStack",foot=/* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[shopButton(kit,placedOrders.length===1?copy.viewOrder:copy.seeOrders,()=>setScreens(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,toastNode]}),
427
+ /* @__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"),
428
+ /* @__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}),
429
+ /* @__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"&&quote!==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__ */
430
+ 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,run2=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(run2?.intervalDays??hp.every,boughtItem.title),label=(step,first)=>step.step==="first_box_ships"&&first?copy.tomorrow:hp.day(step.on)??step.on,steps=run2===null?[{icon:"truck",when:copy.tomorrow,what:copy.firstBoxShips}]:run2.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__ */
431
+ return jsxRuntime.jsx(HealthPlanStarted,{title:run2===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__ */
432
+ 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__ */
433
+ 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__ */
434
+ 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__ */
435
+ 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 PUSH_FOOT_MIN_BOTTOM=12;function HealthPlanFocus(props){/* @__PURE__ */
436
+ 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:[
437
+ /* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanToolbar,{}),
438
+ /* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanToast,{}),
439
+ /* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanHeader,{}),
440
+ /* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanBlanks,{}),
441
+ /* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanWaitCard,{}),
442
+ /* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanByline,{}),
443
+ /* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanFocusCard,{}),
444
+ /* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanTips,{}),
445
+ /* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanProductPick,{}),
446
+ /* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanOtherItems,{}),
447
+ /* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanSigns,{}),
448
+ /* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanExtras,{}),
449
+ /* @__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:[
450
+ /* @__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",backRow,/* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanStarted,{}),shopButton(kit,copy.startedDone,hp.closeStarted,{testID:"health-plan-started-done"}));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&&copy.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,
451
+ /* @__PURE__ */jsxRuntime.jsx(ConnectedHealthPlanToast,{})]}),
368
452
  /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{testID:"health-plan-screen-body",children:body}),foot,footPart)}/* @__PURE__ */
369
453
  return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[
370
- /* @__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:P.paper,still:still}),sheetNode,recordsProbe]})}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 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=useEverfurTheme(),styles2=react.useMemo(()=>makeStyles3(theme),[theme]),sized=(size,weight)=>{let px=healthPlanLength(size),fontSize=px===null||px===0?null:{fontSize:px,lineHeight:Math.round(px*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,styles2.cardShadow,theme),[cardShadow,styles2,theme]),price=formatHealthPlanPriceWith(item.price,item.currency,priceFormat),thumbnail=imageVariant==="thumbnail",rows=reasonVariant==="rows",priceNode=price===null?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:[styles2.price,priceSized],children:price}),category=showCategory&&item.category!==null?/* @__PURE__ */jsxRuntime.jsx(Text,{...categoryVariant==="label"?{tier:"compact"}:{},style:categoryVariant==="label"?styles2.categoryLabel:styles2.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?styles2.add:[styles2.addCompact,{minHeight:height,paddingHorizontal:height>=40?theme.space.lg:theme.space.md}],pillLabel=pressed=>[full||height>=40?styles2.addLabel:styles2.addCompactLabel,pressed?styles2.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?styles2.thumbTitle:styles2.title,titleSized],accessibilityRole:"header",children:item.title}),sample=item.sample?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:styles2.sample,children:/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"badge",style:styles2.sampleLabel,children:HEALTH_PLAN_COPY.sample})}):null,description=item.description===null?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:styles2.body,children:item.description}),control=item.inPlan&&addedVariant==="pressed"?
371
- /* @__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,styles2.addPressed,pending?styles2.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:styles2.row,children:[
372
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:styles2.added,children:HEALTH_PLAN_COPY.added}),
373
- /* @__PURE__ */jsxRuntime.jsx(reactNative.Pressable,{onPress:()=>onToggle?.(false),disabled:pending,accessibilityRole:"button",accessibilityLabel:HEALTH_PLAN_COPY.remove,accessibilityState:{disabled:pending,busy:pending},style:styles2.remove,testID:`health-plan-remove-${item.productId}`,children:/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"control",style:styles2.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?styles2.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__ */
374
- return jsxRuntime.jsxs(reactNative.View,{style:[styles2.card,shadow,cardBorder?null:styles2.cardNoBorder,padding===null?null:{padding:padding},style],accessibilityState:{busy:pending},testID:`health-plan-item-${item.productId}`,children:[thumbnail?/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:styles2.thumbHead,testID:`health-plan-thumb-head-${item.productId}`,children:[item.imageUrl===null?null:/* @__PURE__ */jsxRuntime.jsx(reactNative.Image,{source:{uri:item.imageUrl},style:styles2.thumb,resizeMode:"cover",accessibilityIgnoresInvertColors:true}),
375
- /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:styles2.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:styles2.image,resizeMode:"cover",accessibilityIgnoresInvertColors:true}),category,
376
- /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:styles2.head,children:[title,priceNode]}),sample,description]}),item.reasons.map((reason,index)=>/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:[rows?styles2.reasonRow:styles2.reason,labelGap===null?null:{gap:labelGap}],testID:`health-plan-reason-${rows?"row":"pill"}`,children:[
377
- /* @__PURE__ */jsxRuntime.jsx(Text,{tier:"compact",style:[rows?styles2.reasonRowKind:styles2.reasonKind,rows&&labelWidth!==null?{width:labelWidth}:null],children:HEALTH_PLAN_REASON_LABELS[reason.kind]}),
378
- /* @__PURE__ */jsxRuntime.jsx(Text,{style:[rows?styles2.reasonRowText:styles2.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:styles2.actionRow,children:[priceNode,control]}):control,error===null?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:styles2.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 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=useEverfurTheme(),styles2=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)},[]),layout=useEverfurPresentation(presentation?.healthPlanLayout===void 0?void 0:{healthPlanLayout:presentation.healthPlanLayout}).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:[styles2.page,guarded.style],children:/* @__PURE__ */jsxRuntime.jsx(Text,{style:styles2.body,children:HEALTH_PLAN_COPY.signedOut})}):/* @__PURE__ */jsxRuntime.jsx(CapabilityGate,{capability:"healthPlan",...guarded.renderDisabled?{renderDisabled:guarded.renderDisabled}:{},style:guarded.style,children:/* @__PURE__ */jsxRuntime.jsx(PlanBody,{...bodyProps,plan:plan,styles:styles2,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:styles2,style:style}){let signIn=isHealthPlanSessionRequired(error),line=signIn?HEALTH_PLAN_COPY.signedOut:error?.displayMessage??"";/* @__PURE__ */
379
- return jsxRuntime.jsx(reactNative.View,{style:style,children:/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:styles2.notice,accessibilityLiveRegion:"polite",children:[error===null?null:/* @__PURE__ */jsxRuntime.jsx(HostRender,{resetKey:error,render:()=>renderNotice?renderNotice(error):/* @__PURE__ */jsxRuntime.jsx(Text,{style:styles2.noticeText,children:line}),fallback:/* @__PURE__ */jsxRuntime.jsx(Text,{style:styles2.noticeText,children:line})}),signIn?null:/* @__PURE__ */jsxRuntime.jsx(reactNative.Pressable,{onPress:retry,accessibilityRole:"button",accessibilityLabel:HEALTH_PLAN_COPY.retry,style:styles2.retry,testID:"health-plan-retry",children:/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"control",style:styles2.retryLabel,children:HEALTH_PLAN_COPY.retry})})]})})}function Loading({styles:styles2,style:style}){/* @__PURE__ */
380
- return jsxRuntime.jsxs(reactNative.View,{style:[styles2.page,style],accessible:true,accessibilityRole:"progressbar",accessibilityLabel:HEALTH_PLAN_COPY.loading,accessibilityState:{busy:true},testID:"health-plan-loading",children:[
381
- /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:styles2.skeletonTitle}),
382
- /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:styles2.skeletonCard}),
383
- /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:styles2.skeletonCard})]})}function Empty({emptyCopy:emptyCopy,onAsk:onAsk,heading:heading,header:header,styles:styles2,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,
384
- /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:styles2.empty,children:[words2.emptyTitle.trim()===""?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:styles2.subtitle,children:words2.emptyTitle}),words2.emptyBody.trim()===""?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:styles2.body,children:words2.emptyBody}),words2.emptyAsk.trim()===""||onAsk===void 0?null:/* @__PURE__ */jsxRuntime.jsx(reactNative.Pressable,{onPress:()=>onAsk(),accessibilityRole:"button",style:styles2.retry,testID:"health-plan-empty-ask",children:/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"control",style:styles2.retryLabel,children:words2.emptyAsk})})]})]})}function FocusBody({plan:plan,focus:focus,styles:styles2,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__ */return jsxRuntime.jsx(Refused,{error:page.error,retry:()=>{page.refresh()},renderNotice:renderNotice,styles:styles2,style:[styles2.page,style]});if(state2==="loading")/* @__PURE__ */return jsxRuntime.jsx(Loading,{styles:styles2,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__ */
385
- 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:styles2,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=useEverfurTheme(),{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?styles2.page:[styles2.page,{gap:gap}],size=healthPlanLength(titleSize),ratio=healthPlanLength(titleLineHeight),titleStyle=[styles2.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__ */
386
- return jsxRuntime.jsx(reactNative.View,{style:[pageStyle,style],children:/* @__PURE__ */jsxRuntime.jsx(Text,{style:styles2.body,children:HEALTH_PLAN_COPY.choosePet})});if(plan.status==="loading")/* @__PURE__ */return jsxRuntime.jsx(Loading,{styles:styles2,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:styles2,style:[pageStyle,style]});let empty=/* @__PURE__ */jsxRuntime.jsx(Empty,{emptyCopy:emptyCopy,onAsk:onAsk,heading:heading,header:header,styles:styles2,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),
387
- /* @__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:styles2,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=useEverfurTheme(),S=react.useMemo(()=>styles(theme),[theme]);/* @__PURE__ */
454
+ /* @__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}),
455
+ /* @__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]),price=formatHealthPlanPriceWith(item.price,item.currency,priceFormat),thumbnail=imageVariant==="thumbnail",rows=reasonVariant==="rows",priceNode=price===null?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:[styles25.price,priceSized],children:price}),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"?
456
+ /* @__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:[
457
+ /* @__PURE__ */jsxRuntime.jsx(Text,{style:styles25.added,children:HEALTH_PLAN_COPY.added}),
458
+ /* @__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__ */
459
+ return jsxRuntime.jsxs(reactNative.View,{style:[styles25.card,shadow,cardBorder?null:styles25.cardNoBorder,padding===null?null:{padding:padding},style],accessibilityState:{busy:pending},testID:`health-plan-item-${item.productId}`,children:[thumbnail?/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:styles25.thumbHead,testID:`health-plan-thumb-head-${item.productId}`,children:[item.imageUrl===null?null:/* @__PURE__ */jsxRuntime.jsx(reactNative.Image,{source:{uri:item.imageUrl},style:styles25.thumb,resizeMode:"cover",accessibilityIgnoresInvertColors:true}),
460
+ /* @__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,
461
+ /* @__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:[
462
+ /* @__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]}),
463
+ /* @__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 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)},[]),layout=useEverfurPresentation(presentation?.healthPlanLayout===void 0?void 0:{healthPlanLayout:presentation.healthPlanLayout}).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(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__ */
464
+ 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__ */
465
+ 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:[
466
+ /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:styles25.skeletonTitle}),
467
+ /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:styles25.skeletonCard}),
468
+ /* @__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,
469
+ /* @__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__ */return jsxRuntime.jsx(Refused,{error:page.error,retry:()=>{page.refresh()},renderNotice:renderNotice,styles:styles25,style:[styles25.page,style]});if(state2==="loading")/* @__PURE__ */return jsxRuntime.jsx(Loading,{styles:styles25,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__ */
470
+ 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__ */
471
+ 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),
472
+ /* @__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__ */
388
473
  return jsxRuntime.jsxs(reactNative.View,{style:[S.card,guarded.style],testID:"health-plan-top-risk",children:[
389
474
  /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:S.kickerRow,children:[
390
475
  /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:S.dot}),
391
476
  /* @__PURE__ */jsxRuntime.jsx(Text,{style:S.kicker,children:guarded.kicker})]}),
392
477
  /* @__PURE__ */jsxRuntime.jsx(Text,{style:S.sentence,children:guarded.sentence}),
393
- /* @__PURE__ */jsxRuntime.jsx(reactNative.Pressable,{onPress:()=>guarded.onOpenPlan(),accessibilityRole:"button",accessibilityLabel:guarded.action,style:S.button,testID:"health-plan-top-risk-open",children:/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"control",style:S.buttonLabel,children:guarded.action})})]})}function styles(theme){let{color:color,radius:radius,space:space,type:type}=theme;return reactNative.StyleSheet.create({card:{gap:space.xs,alignItems:"flex-start",padding:space.md,borderRadius:radius.lg,backgroundColor:color.brandSofter},kickerRow:{flexDirection:"row",alignItems:"center",gap:space.xs},kicker:{...face(theme,"bold"),fontSize:type.size.caption,lineHeight:Math.round(type.size.caption*type.lineHeight.snug),color:color.text.secondary,textTransform:"uppercase",letterSpacing:type.size.caption*.06},dot:{width:8,height:8,borderRadius:4,backgroundColor:color.errorRed},sentence:{...face(theme,"bold"),fontSize:type.size.subtitle,lineHeight:Math.round(type.size.subtitle*type.lineHeight.snug),color:color.text.primary},button:{minHeight:40,justifyContent:"center",paddingHorizontal:space.md,borderRadius:999,backgroundColor:color.primary},buttonLabel:{...face(theme,"bold"),fontSize:type.size.caption,color:color.onPrimary}})}function useHealthPlanTopCard(options){let{petRef:petRef,enabled:enabled,onOpenPlan:onOpenPlan,copy:copy,renderIcon:renderIcon}=options,{page:page}=useHealthPlanPage({petRef:petRef,...enabled===void 0?{}:{enabled:enabled}});return react.useMemo(()=>healthPlanTopCard(page,{onOpenPlan:onOpenPlan,...copy===void 0?{}:{copy:copy},...renderIcon===void 0?{}:{renderIcon:renderIcon}}),[page,onOpenPlan,copy,renderIcon])}exports.EverfurHealthPlan=EverfurHealthPlan;exports.HEALTH_PLAN_COPY=HEALTH_PLAN_COPY;exports.HEALTH_PLAN_COPY_PLACEHOLDERS=HEALTH_PLAN_COPY_PLACEHOLDERS;exports.HEALTH_PLAN_FOCUS_COPY=HEALTH_PLAN_FOCUS_COPY;exports.HEALTH_PLAN_FOCUS_RN_COPY=HEALTH_PLAN_FOCUS_RN_COPY;exports.HEALTH_PLAN_LAYOUT_DEFAULTS=HEALTH_PLAN_LAYOUT_DEFAULTS;exports.HEALTH_PLAN_REASON_KINDS=HEALTH_PLAN_REASON_KINDS;exports.HEALTH_PLAN_REASON_LABELS=HEALTH_PLAN_REASON_LABELS;exports.HEALTH_PLAN_TEMPLATES=HEALTH_PLAN_TEMPLATES;exports.HEALTH_PLAN_TOP_CARD_COPY=HEALTH_PLAN_TOP_CARD_COPY;exports.HealthPlanBlanks=HealthPlanBlanks;exports.HealthPlanCartBar=HealthPlanCartBar;exports.HealthPlanCartScope=HealthPlanCartScope;exports.HealthPlanController=HealthPlanController;exports.HealthPlanFocus=HealthPlanFocus;exports.HealthPlanItemCard=HealthPlanItemCard;exports.HealthPlanScrollScope=HealthPlanScrollScope;exports.HealthPlanTopRisk=HealthPlanTopRisk;exports.createHealthPlanPageRepository=createHealthPlanPageRepository;exports.createHealthPlanPageRepositoryOver=createHealthPlanPageRepositoryOver;exports.createHealthPlanRepository=createHealthPlanRepository;exports.createHealthPlanRepositoryOver=createHealthPlanRepositoryOver;exports.createHealthPlanSubscriptionRepository=createHealthPlanSubscriptionRepository;exports.createHealthPlanSubscriptionRepositoryOver=createHealthPlanSubscriptionRepositoryOver;exports.formatHealthPlanDay=formatHealthPlanDay;exports.formatHealthPlanPrice=formatHealthPlanPrice;exports.formatHealthPlanPriceWith=formatHealthPlanPriceWith;exports.healthPlanBlanksFacts=healthPlanBlanksFacts;exports.healthPlanCart=healthPlanCart;exports.healthPlanCheckoutRefusal=healthPlanCheckoutRefusal;exports.healthPlanCheckoutSessionFromWire=healthPlanCheckoutSessionFromWire;exports.healthPlanCheckoutStateFromWire=healthPlanCheckoutStateFromWire;exports.healthPlanFocusCopyFor=healthPlanFocusCopyFor;exports.healthPlanFocusDesignFromWire=healthPlanFocusDesignFromWire;exports.healthPlanFromWire=healthPlanFromWire;exports.healthPlanNextShotsAt=healthPlanNextShotsAt;exports.healthPlanNoVet=healthPlanNoVet;exports.healthPlanOneBoxOrderFromWire=healthPlanOneBoxOrderFromWire;exports.healthPlanOneBoxOrderPageFromWire=healthPlanOneBoxOrderPageFromWire;exports.healthPlanOrderTrackingFromWire=healthPlanOrderTrackingFromWire;exports.healthPlanPageFromWire=healthPlanPageFromWire;exports.healthPlanPetCopy=healthPlanPetCopy;exports.healthPlanPetWords=healthPlanPetWords;exports.healthPlanPossessive=healthPlanPossessive;exports.healthPlanRecordsWeightKg=healthPlanRecordsWeightKg;exports.healthPlanSubscriptionFromWire=healthPlanSubscriptionFromWire;exports.healthPlanSubscriptionQuoteFromWire=healthPlanSubscriptionQuoteFromWire;exports.healthPlanTopCard=healthPlanTopCard;exports.isHealthPlanSessionRequired=isHealthPlanSessionRequired;exports.isHealthPlanSubscriptionUnavailable=isHealthPlanSubscriptionUnavailable;exports.notifyHealthPlanRecordsLanded=notifyHealthPlanRecordsLanded;exports.onHealthPlanNoVet=onHealthPlanNoVet;exports.onHealthPlanRecordsLanded=onHealthPlanRecordsLanded;exports.setHealthPlanNoVet=setHealthPlanNoVet;exports.showHealthPlanCartBar=showHealthPlanCartBar;exports.useEverfurHealthPlan=useEverfurHealthPlan;exports.useEverfurHealthPlanRepository=useEverfurHealthPlanRepository;exports.useEverfurPresentation=useEverfurPresentation;exports.useHealthPlanCartDock=useHealthPlanCartDock;exports.useHealthPlanPage=useHealthPlanPage;exports.useHealthPlanPageRepository=useHealthPlanPageRepository;exports.useHealthPlanSubscription=useHealthPlanSubscription;exports.useHealthPlanSubscriptionRepository=useHealthPlanSubscriptionRepository;exports.useHealthPlanTopCard=useHealthPlanTopCard;
478
+ /* @__PURE__ */jsxRuntime.jsx(reactNative.Pressable,{onPress:()=>guarded.onOpenPlan(),accessibilityRole:"button",accessibilityLabel:guarded.action,style:S.button,testID:"health-plan-top-risk-open",children:/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"control",style:S.buttonLabel,children:guarded.action})})]})}function styles24(theme){let{color:color,radius:radius,space:space,type:type}=theme;return reactNative.StyleSheet.create({card:{gap:space.xs,alignItems:"flex-start",padding:space.md,borderRadius:radius.lg,backgroundColor:color.brandSofter},kickerRow:{flexDirection:"row",alignItems:"center",gap:space.xs},kicker:{...face(theme,"bold"),fontSize:type.size.caption,lineHeight:Math.round(type.size.caption*type.lineHeight.snug),color:color.text.secondary,textTransform:"uppercase",letterSpacing:type.size.caption*.06},dot:{width:8,height:8,borderRadius:4,backgroundColor:color.errorRed},sentence:{...face(theme,"bold"),fontSize:type.size.subtitle,lineHeight:Math.round(type.size.subtitle*type.lineHeight.snug),color:color.text.primary},button:{minHeight:40,justifyContent:"center",paddingHorizontal:space.md,borderRadius:999,backgroundColor:color.primary},buttonLabel:{...face(theme,"bold"),fontSize:type.size.caption,color:color.onPrimary}})}function useHealthPlanTopCard(options){let{petRef:petRef,enabled:enabled,onOpenPlan:onOpenPlan,copy:copy,renderIcon:renderIcon}=options,{page:page}=useHealthPlanPage({petRef:petRef,...enabled===void 0?{}:{enabled:enabled}});return react.useMemo(()=>healthPlanTopCard(page,{onOpenPlan:onOpenPlan,...copy===void 0?{}:{copy:copy},...renderIcon===void 0?{}:{renderIcon:renderIcon}}),[page,onOpenPlan,copy,renderIcon])}exports.ConnectedHealthPlanBlanks=ConnectedHealthPlanBlanks;exports.ConnectedHealthPlanBuyButton=ConnectedHealthPlanBuyButton;exports.ConnectedHealthPlanBuyOptions=ConnectedHealthPlanBuyOptions;exports.ConnectedHealthPlanByline=ConnectedHealthPlanByline;exports.ConnectedHealthPlanCartCheckout=ConnectedHealthPlanCartCheckout;exports.ConnectedHealthPlanCartScreen=ConnectedHealthPlanCart;exports.ConnectedHealthPlanCheckoutSheet=ConnectedHealthPlanCheckoutSheet;exports.ConnectedHealthPlanCheckup=ConnectedHealthPlanCheckup;exports.ConnectedHealthPlanConnectRecords=ConnectedHealthPlanConnectRecords;exports.ConnectedHealthPlanDoseCard=ConnectedHealthPlanDoseCard;exports.ConnectedHealthPlanExtras=ConnectedHealthPlanExtras;exports.ConnectedHealthPlanFine=ConnectedHealthPlanFine;exports.ConnectedHealthPlanFocusCard=ConnectedHealthPlanFocusCard;exports.ConnectedHealthPlanHeader=ConnectedHealthPlanHeader;exports.ConnectedHealthPlanIngredients=ConnectedHealthPlanIngredients;exports.ConnectedHealthPlanManageSheet=ConnectedHealthPlanManageSheet;exports.ConnectedHealthPlanOrder=ConnectedHealthPlanOrder;exports.ConnectedHealthPlanOrders=ConnectedHealthPlanOrders;exports.ConnectedHealthPlanOtherItems=ConnectedHealthPlanOtherItems;exports.ConnectedHealthPlanPickParts=ConnectedHealthPlanPickParts;exports.ConnectedHealthPlanPlaced=ConnectedHealthPlanPlaced;exports.ConnectedHealthPlanProductPick=ConnectedHealthPlanProductPick;exports.ConnectedHealthPlanProof=ConnectedHealthPlanProof;exports.ConnectedHealthPlanReviews=ConnectedHealthPlanReviews;exports.ConnectedHealthPlanSheet=ConnectedHealthPlanSheet;exports.ConnectedHealthPlanSigns=ConnectedHealthPlanSigns;exports.ConnectedHealthPlanStarted=ConnectedHealthPlanStarted;exports.ConnectedHealthPlanSubscribedBox=ConnectedHealthPlanSubscribedBox;exports.ConnectedHealthPlanTips=ConnectedHealthPlanTips;exports.ConnectedHealthPlanToast=ConnectedHealthPlanToast;exports.ConnectedHealthPlanToolbar=ConnectedHealthPlanToolbar;exports.ConnectedHealthPlanTrustRow=ConnectedHealthPlanTrustRow;exports.ConnectedHealthPlanWaitCard=ConnectedHealthPlanWaitCard;exports.ConnectedHealthPlanWeightSheet=ConnectedHealthPlanWeightSheet;exports.ConnectedHealthPlanWhyItFits=ConnectedHealthPlanWhyItFits;exports.EverfurHealthPlan=EverfurHealthPlan;exports.HEALTH_PLAN_COPY=HEALTH_PLAN_COPY;exports.HEALTH_PLAN_COPY_PLACEHOLDERS=HEALTH_PLAN_COPY_PLACEHOLDERS;exports.HEALTH_PLAN_FOCUS_COPY=HEALTH_PLAN_FOCUS_COPY;exports.HEALTH_PLAN_FOCUS_RN_COPY=HEALTH_PLAN_FOCUS_RN_COPY;exports.HEALTH_PLAN_LAYOUT_DEFAULTS=HEALTH_PLAN_LAYOUT_DEFAULTS;exports.HEALTH_PLAN_REASON_KINDS=HEALTH_PLAN_REASON_KINDS;exports.HEALTH_PLAN_REASON_LABELS=HEALTH_PLAN_REASON_LABELS;exports.HEALTH_PLAN_TEMPLATES=HEALTH_PLAN_TEMPLATES;exports.HEALTH_PLAN_TOP_CARD_COPY=HEALTH_PLAN_TOP_CARD_COPY;exports.HealthPlanAskRow=HealthPlanAskRow;exports.HealthPlanBackRow=HealthPlanBackRow;exports.HealthPlanBlanks=HealthPlanBlanks;exports.HealthPlanBuyButton=HealthPlanBuyButton;exports.HealthPlanBuyOptions=HealthPlanBuyOptions;exports.HealthPlanByline=HealthPlanByline;exports.HealthPlanCartBar=HealthPlanCartBar;exports.HealthPlanCartCheckout=HealthPlanCartCheckout;exports.HealthPlanCartScope=HealthPlanCartScope;exports.HealthPlanCartScreen=HealthPlanCart;exports.HealthPlanCheckoutSheet=HealthPlanCheckoutSheet;exports.HealthPlanCheckup=HealthPlanCheckup;exports.HealthPlanController=HealthPlanController;exports.HealthPlanDoseCard=HealthPlanDoseCard;exports.HealthPlanExtras=HealthPlanExtras;exports.HealthPlanFine=HealthPlanFine;exports.HealthPlanFocus=HealthPlanFocus;exports.HealthPlanFocusCard=HealthPlanFocusCard;exports.HealthPlanFocusProvider=HealthPlanFocusProvider;exports.HealthPlanHeader=HealthPlanHeader;exports.HealthPlanIngredients=HealthPlanIngredients;exports.HealthPlanItemCard=HealthPlanItemCard;exports.HealthPlanJumpStrip=HealthPlanJumpStrip;exports.HealthPlanManageSheet=HealthPlanManageSheet;exports.HealthPlanNoPick=HealthPlanNoPick;exports.HealthPlanOrder=HealthPlanOrder;exports.HealthPlanOrders=HealthPlanOrders;exports.HealthPlanOtherItems=HealthPlanOtherItems;exports.HealthPlanPlaced=HealthPlanPlaced;exports.HealthPlanProductPick=HealthPlanProductPick;exports.HealthPlanProof=HealthPlanProof;exports.HealthPlanReviews=HealthPlanReviews;exports.HealthPlanScrollScope=HealthPlanScrollScope;exports.HealthPlanSheetFrame=HealthPlanSheetFrame;exports.HealthPlanSigns=HealthPlanSigns;exports.HealthPlanStarted=HealthPlanStarted;exports.HealthPlanSubscribedBox=HealthPlanSubscribedBox;exports.HealthPlanTips=HealthPlanTips;exports.HealthPlanToast=HealthPlanToast;exports.HealthPlanToolbar=HealthPlanToolbar;exports.HealthPlanTopRisk=HealthPlanTopRisk;exports.HealthPlanTrustRow=HealthPlanTrustRow;exports.HealthPlanVetQuote=HealthPlanVetQuote;exports.HealthPlanWaitCard=HealthPlanWaitCard;exports.HealthPlanWeightSheet=HealthPlanWeightSheet;exports.HealthPlanWhyItFits=HealthPlanWhyItFits;exports.createHealthPlanPageRepository=createHealthPlanPageRepository;exports.createHealthPlanPageRepositoryOver=createHealthPlanPageRepositoryOver;exports.createHealthPlanRepository=createHealthPlanRepository;exports.createHealthPlanRepositoryOver=createHealthPlanRepositoryOver;exports.createHealthPlanSubscriptionRepository=createHealthPlanSubscriptionRepository;exports.createHealthPlanSubscriptionRepositoryOver=createHealthPlanSubscriptionRepositoryOver;exports.formatHealthPlanDay=formatHealthPlanDay;exports.formatHealthPlanPrice=formatHealthPlanPrice;exports.formatHealthPlanPriceWith=formatHealthPlanPriceWith;exports.healthPlanBlanksFacts=healthPlanBlanksFacts;exports.healthPlanCart=healthPlanCart;exports.healthPlanCheckoutRefusal=healthPlanCheckoutRefusal;exports.healthPlanCheckoutSessionFromWire=healthPlanCheckoutSessionFromWire;exports.healthPlanCheckoutStateFromWire=healthPlanCheckoutStateFromWire;exports.healthPlanFocusCopyFor=healthPlanFocusCopyFor;exports.healthPlanFocusDesignFromWire=healthPlanFocusDesignFromWire;exports.healthPlanFromWire=healthPlanFromWire;exports.healthPlanNextShotsAt=healthPlanNextShotsAt;exports.healthPlanNoVet=healthPlanNoVet;exports.healthPlanOneBoxOrderFromWire=healthPlanOneBoxOrderFromWire;exports.healthPlanOneBoxOrderPageFromWire=healthPlanOneBoxOrderPageFromWire;exports.healthPlanOrderTrackingFromWire=healthPlanOrderTrackingFromWire;exports.healthPlanPageFromWire=healthPlanPageFromWire;exports.healthPlanPetCopy=healthPlanPetCopy;exports.healthPlanPetWords=healthPlanPetWords;exports.healthPlanPossessive=healthPlanPossessive;exports.healthPlanRecordsWeightKg=healthPlanRecordsWeightKg;exports.healthPlanSubscriptionFromWire=healthPlanSubscriptionFromWire;exports.healthPlanSubscriptionQuoteFromWire=healthPlanSubscriptionQuoteFromWire;exports.healthPlanTopCard=healthPlanTopCard;exports.isHealthPlanSessionRequired=isHealthPlanSessionRequired;exports.isHealthPlanSubscriptionUnavailable=isHealthPlanSubscriptionUnavailable;exports.notifyHealthPlanRecordsLanded=notifyHealthPlanRecordsLanded;exports.onHealthPlanNoVet=onHealthPlanNoVet;exports.onHealthPlanRecordsLanded=onHealthPlanRecordsLanded;exports.setHealthPlanNoVet=setHealthPlanNoVet;exports.showHealthPlanCartBar=showHealthPlanCartBar;exports.useEverfurHealthPlan=useEverfurHealthPlan;exports.useEverfurHealthPlanRepository=useEverfurHealthPlanRepository;exports.useEverfurPresentation=useEverfurPresentation;exports.useHealthPlanCartDock=useHealthPlanCartDock;exports.useHealthPlanPage=useHealthPlanPage;exports.useHealthPlanPageRepository=useHealthPlanPageRepository;exports.useHealthPlanSubscription=useHealthPlanSubscription;exports.useHealthPlanSubscriptionRepository=useHealthPlanSubscriptionRepository;exports.useHealthPlanTopCard=useHealthPlanTopCard;