@everfur/sdk 0.15.1 → 0.16.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.
- package/CHANGELOG.md +138 -0
- package/README.md +3 -1
- package/chat/lite/package.json +8 -0
- package/dist/Chat.d-CzI2228d.d.ts +11 -0
- package/dist/Chat.d-D3ScVQ22.d.cts +11 -0
- package/dist/{DepthViews.d-PuBGdAYk.d.cts → DepthViews.d-6U4QqaW3.d.cts} +1 -1
- package/dist/{DepthViews.d--1daZblh.d.cts → DepthViews.d-BLx_ZTwa.d.cts} +1 -1
- package/dist/{DepthViews.d-CKTnEeUo.d.ts → DepthViews.d-Cwbel5o4.d.ts} +1 -1
- package/dist/{DepthViews.d-BuEWI6Ln.d.ts → DepthViews.d-DVIydPLt.d.ts} +1 -1
- package/dist/{RecordsPage.d-CBB8sfoY.d.ts → RecordsPage.d-Bwalb0wU.d.ts} +1 -1
- package/dist/{RecordsPage.d-Dq5gpQG0.d.cts → RecordsPage.d-Do7T8Fns.d.cts} +1 -1
- package/dist/animations/index.d.cts +5 -5
- package/dist/animations/index.d.ts +5 -5
- package/dist/{Chat.d-BlsnQwCQ.d.ts → appStateLifecycle.d-Bd-rNy6K.d.ts} +62 -144
- package/dist/{Chat.d-BO5iJsR2.d.cts → appStateLifecycle.d-_mh4CEAq.d.cts} +62 -144
- package/dist/attachmentTransport.d-Syrvv5zH.d.ts +41 -0
- package/dist/attachmentTransport.d-r1XCCdUB.d.cts +41 -0
- package/dist/{attachments.d-DFP9yvz9.d.ts → attachments.d-BiBGBE4o.d.ts} +24 -6
- package/dist/{attachments.d-C2nkIyDB.d.ts → attachments.d-CyB8hzDo.d.ts} +2 -2
- package/dist/{attachments.d-DRHsJkni.d.cts → attachments.d-GlO5UP7H.d.cts} +24 -6
- package/dist/{attachments.d-DRUC35Ti.d.cts → attachments.d-Y-qvSHVU.d.cts} +2 -2
- package/dist/{bookingCopy.d-bF_QknDC.d.cts → bookingCopy.d-BIaCiRuW.d.cts} +2 -2
- package/dist/{bookingCopy.d-CFL-1Be2.d.ts → bookingCopy.d-DgWvNKD5.d.ts} +2 -2
- package/dist/{casesRepository.d-C__BnffJ.d.ts → casesRepository.d-BW8DTYeN.d.ts} +1 -1
- package/dist/{casesRepository.d-BMOnT1fg.d.cts → casesRepository.d-_0AO2YrL.d.cts} +1 -1
- package/dist/chat/index.cjs +246 -231
- package/dist/chat/index.d.cts +16 -49
- package/dist/chat/index.d.ts +16 -49
- package/dist/chat/index.js +246 -231
- package/dist/chat/lite/index.cjs +430 -0
- package/dist/chat/lite/index.d.cts +35 -0
- package/dist/chat/lite/index.d.ts +35 -0
- package/dist/chat/lite/index.js +430 -0
- package/dist/client/index.cjs +4 -4
- package/dist/client/index.d.cts +6 -6
- package/dist/client/index.d.ts +6 -6
- package/dist/client/index.js +4 -4
- package/dist/{clinicBatch.d-D68RYvc3.d.ts → clinicBatch.d-BXwATY3-.d.ts} +2 -2
- package/dist/{clinicBatch.d-C5deJ4xY.d.cts → clinicBatch.d-BcuSaOkv.d.cts} +2 -2
- package/dist/{config.d-BQgrIDdu.d.cts → config.d-D1xcxALX.d.cts} +1 -1
- package/dist/{config.d-XSMThgVj.d.ts → config.d-jTVsAeky.d.ts} +1 -1
- package/dist/consent/index.d.cts +5 -5
- package/dist/consent/index.d.ts +5 -5
- package/dist/{context.d-Ba8YyJpk.d.cts → context.d-C3x-z665.d.cts} +5 -5
- package/dist/{context.d-xoh5vmxS.d.ts → context.d-goZeZO2I.d.ts} +5 -5
- package/dist/{copy.d-Cq-s-UUv.d.cts → copy.d-DPwFY4r5.d.cts} +2 -2
- package/dist/{copy.d-HV9fU5kh.d.ts → copy.d-yfJv7fl6.d.ts} +2 -2
- package/dist/core/index.cjs +10 -10
- package/dist/core/index.d.cts +13 -13
- package/dist/core/index.d.ts +13 -13
- package/dist/core/index.js +10 -10
- package/dist/{depth.d-D7kKiYl7.d.ts → depth.d-SJzknw_P.d.ts} +2 -2
- package/dist/{depth.d-DYnkz8Re.d.cts → depth.d-e_8_icip.d.cts} +2 -2
- package/dist/{entitlementRepository.d-DmnUZLl_.d.ts → entitlementRepository.d-BNgZhwoE.d.ts} +2 -2
- package/dist/{entitlementRepository.d-B_kEPLhz.d.cts → entitlementRepository.d-C_LdzINM.d.cts} +2 -2
- package/dist/{focus.d-BHm_QtQ9.d.cts → focus.d-CXpIkIuU.d.cts} +3 -3
- package/dist/{focus.d-CjL6Cj0m.d.ts → focus.d-DzIgOqNB.d.ts} +3 -3
- package/dist/health-plan/index.cjs +136 -133
- package/dist/health-plan/index.d.cts +77 -24
- package/dist/health-plan/index.d.ts +77 -24
- package/dist/health-plan/index.js +136 -133
- package/dist/{idempotency.d-BSRK8od4.d.cts → idempotency.d-0biUa_Vw.d.cts} +1 -1
- package/dist/{idempotency.d-CFc4CCc9.d.ts → idempotency.d-DcqIqmf9.d.ts} +1 -1
- package/dist/{identity.d-Be2Es9Td.d.ts → identity.d-BEJcHY-5.d.ts} +1 -1
- package/dist/{identity.d-HbwYQ4-z.d.cts → identity.d-COcNGuCJ.d.cts} +1 -1
- package/dist/index.cjs +245 -230
- package/dist/index.d.cts +15 -12
- package/dist/index.d.ts +15 -12
- package/dist/index.js +246 -231
- package/dist/{introEvents.d-Dr34KIaD.d.cts → introEvents.d-D8N9bbGO.d.cts} +1 -1
- package/dist/{introEvents.d-DflJ6J9H.d.ts → introEvents.d-GCdyQyUG.d.ts} +1 -1
- package/dist/notifications/index.d.cts +4 -4
- package/dist/notifications/index.d.ts +4 -4
- package/dist/{optInView.d-3mbj1mR6.d.ts → optInView.d-CY2IueSZ.d.ts} +2 -2
- package/dist/{optInView.d-D23o1gtT.d.cts → optInView.d-DVuuWDRw.d.cts} +2 -2
- package/dist/{parse.d-BERabxHw.d.ts → parse.d--ztmWIIP.d.ts} +1 -1
- package/dist/{parse.d-4lUXdmvY.d.cts → parse.d-B-WrkW2C.d.cts} +1 -1
- package/dist/{pets.d-CHU0UbXt.d.cts → pets.d-BSW0oEYx.d.cts} +1 -1
- package/dist/{pets.d-D_ayuqjp.d.ts → pets.d-DwsImaHU.d.ts} +1 -1
- package/dist/{petsRepository.d-Bwfe8yuR.d.cts → petsRepository.d-BQfWC3d4.d.cts} +1 -1
- package/dist/{petsRepository.d-DUaAWoTv.d.ts → petsRepository.d-BudLFHVe.d.ts} +1 -1
- package/dist/photo/index.cjs +2 -2
- package/dist/photo/index.js +2 -2
- package/dist/{ports.d-DzEJMVRs.d.ts → ports.d-B6kDPKF7.d.ts} +4 -4
- package/dist/{ports.d-ClbPRUtx.d.cts → ports.d-DzPbmiDT.d.cts} +4 -4
- package/dist/records/depth/index.cjs +10 -10
- package/dist/records/depth/index.d.cts +9 -9
- package/dist/records/depth/index.d.ts +9 -9
- package/dist/records/depth/index.js +10 -10
- package/dist/records/index.cjs +253 -211
- package/dist/records/index.d.cts +169 -73
- package/dist/records/index.d.ts +169 -73
- package/dist/records/index.js +254 -212
- package/dist/{requestFunnel.d-YabU6G-Z.d.ts → requestFunnel.d-BPsCHJWf.d.ts} +2 -2
- package/dist/{requestFunnel.d-JoqddYSx.d.cts → requestFunnel.d-BdpL7gwg.d.cts} +2 -2
- package/dist/{runtimeTypes.d-DQTBJAbk.d.ts → runtimeTypes.d-C_Pcxn-n.d.ts} +4 -4
- package/dist/{runtimeTypes.d-Cv38YuzP.d.cts → runtimeTypes.d-Cfq3IrZG.d.cts} +4 -4
- package/dist/{screenProps.d-C-AuHoyF.d.cts → screenProps.d-BJMn1kTR.d.cts} +2 -2
- package/dist/{screenProps.d-BuJLzFkN.d.ts → screenProps.d-DGrfO17l.d.ts} +2 -2
- package/dist/server/events/index.cjs +3 -3
- package/dist/server/events/index.d.cts +48 -6
- package/dist/server/events/index.d.ts +48 -6
- package/dist/server/events/index.js +3 -3
- package/dist/server/index.cjs +2 -2
- package/dist/server/index.d.cts +3 -3
- package/dist/server/index.d.ts +3 -3
- package/dist/server/index.js +2 -2
- package/dist/shop/index.cjs +16 -16
- package/dist/shop/index.d.cts +12 -3
- package/dist/shop/index.d.ts +12 -3
- package/dist/shop/index.js +16 -16
- package/dist/tabs/index.cjs +4 -4
- package/dist/tabs/index.d.cts +34 -15
- package/dist/tabs/index.d.ts +34 -15
- package/dist/tabs/index.js +5 -5
- package/dist/{tabsModel.d-BfIQg6yS.d.ts → tabsModel.d-B7QMug1u.d.cts} +1 -17
- package/dist/{tabsModel.d-BfIQg6yS.d.cts → tabsModel.d-B7QMug1u.d.ts} +1 -17
- package/dist/televet/booking/index.cjs +2 -2
- package/dist/televet/booking/index.d.cts +6 -6
- package/dist/televet/booking/index.d.ts +6 -6
- package/dist/televet/booking/index.js +2 -2
- package/dist/televet/call/index.cjs +1 -1
- package/dist/televet/call/index.js +1 -1
- package/dist/televet/index.cjs +4 -3
- package/dist/televet/index.d.cts +1 -0
- package/dist/televet/index.d.ts +1 -0
- package/dist/televet/index.js +5 -4
- package/dist/testing/index.d.cts +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/rn/index.cjs +1 -1
- package/dist/testing/rn/index.d.cts +7 -7
- package/dist/testing/rn/index.d.ts +7 -7
- package/dist/testing/rn/index.js +1 -1
- package/dist/testing/web/index.d.cts +7 -7
- package/dist/testing/web/index.d.ts +7 -7
- package/dist/texting/index.cjs +21 -16
- package/dist/texting/index.d.cts +5 -5
- package/dist/texting/index.d.ts +5 -5
- package/dist/texting/index.js +22 -17
- package/dist/threadOptions.d-B0folrKm.d.cts +147 -0
- package/dist/{threadOptions.d-DBrmOwmb.d.cts → threadOptions.d-B8HTJa9A.d.cts} +6 -40
- package/dist/{threadOptions.d-8x_1evAr.d.ts → threadOptions.d-BnhE7T8Y.d.ts} +6 -40
- package/dist/threadOptions.d-DTsJFkL-.d.ts +147 -0
- package/dist/threadOptions.d-GPJPprkn.d.cts +55 -0
- package/dist/threadOptions.d-GPJPprkn.d.ts +55 -0
- package/dist/{timelineRows.d-B6lLC8Ud.d.cts → timelineRows.d-BTcUdNeI.d.cts} +1 -1
- package/dist/{timelineRows.d-Brlkti-G.d.ts → timelineRows.d-kmBms1W5.d.ts} +1 -1
- package/dist/{planSignals.d-Dha2CMDF.d.cts → useHealthPlanSubscription.d-B_cth_iF.d.cts} +81 -3
- package/dist/{planSignals.d-CON9gTvJ.d.ts → useHealthPlanSubscription.d-BzNaVl89.d.ts} +81 -3
- package/dist/{usePresentation.d-Bne14SlX.d.ts → usePresentation.d-B7Uf44Ax.d.ts} +40 -40
- package/dist/{usePresentation.d-BcdCIuEU.d.cts → usePresentation.d-BkAMOfb5.d.cts} +40 -40
- package/dist/{useRecordsDepth.d-Cd6J03o5.d.ts → useRecordsDepth.d-BHkZi0tM.d.ts} +1 -1
- package/dist/{useRecordsDepth.d-DAa169VY.d.cts → useRecordsDepth.d-BxHpKipf.d.cts} +1 -1
- package/dist/video/index.cjs +2 -2
- package/dist/video/index.js +2 -2
- package/dist/{view.d-DkGM8GNA.d.ts → view.d-2BYMRnWj.d.ts} +3 -3
- package/dist/{view.d-3d5_O7Xk.d.cts → view.d-CoDbnv0f.d.cts} +3 -3
- package/dist/web/consent/index.d.cts +5 -5
- package/dist/web/consent/index.d.ts +5 -5
- package/dist/web/health-plan/index.cjs +5 -5
- package/dist/web/health-plan/index.d.cts +15 -69
- package/dist/web/health-plan/index.d.ts +15 -69
- package/dist/web/health-plan/index.js +5 -5
- package/dist/web/index.cjs +8 -8
- package/dist/web/index.d.cts +26 -43
- package/dist/web/index.d.ts +26 -43
- package/dist/web/index.js +8 -8
- package/dist/web/intro/index.d.cts +6 -6
- package/dist/web/intro/index.d.ts +6 -6
- package/dist/web/notifications/index.d.cts +3 -3
- package/dist/web/notifications/index.d.ts +3 -3
- package/dist/web/records/depth/index.cjs +9 -9
- package/dist/web/records/depth/index.d.cts +9 -9
- package/dist/web/records/depth/index.d.ts +9 -9
- package/dist/web/records/depth/index.js +9 -9
- package/dist/web/records/index.cjs +12 -12
- package/dist/web/records/index.d.cts +11 -11
- package/dist/web/records/index.d.ts +11 -11
- package/dist/web/records/index.js +12 -12
- package/dist/web/records-sheet/index.cjs +17 -17
- package/dist/web/records-sheet/index.js +17 -17
- package/dist/web/shop/index.cjs +12 -12
- package/dist/web/shop/index.d.cts +3 -3
- package/dist/web/shop/index.d.ts +3 -3
- package/dist/web/shop/index.js +12 -12
- package/dist/web/televet/booking/index.cjs +2 -2
- package/dist/web/televet/booking/index.d.cts +6 -6
- package/dist/web/televet/booking/index.d.ts +6 -6
- package/dist/web/televet/booking/index.js +2 -2
- package/dist/web/televet/call/index.cjs +1 -1
- package/dist/web/televet/call/index.js +1 -1
- package/dist/web/texting/index.d.cts +5 -5
- package/dist/web/texting/index.d.ts +5 -5
- package/package.json +22 -27
package/dist/web/shop/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
|
|
2
2
|
"use client";
|
|
3
|
-
import{createContext,useMemo,useState,useEffect,useRef,createElement,useContext,useLayoutEffect,useCallback,useId,useSyncExternalStore,Fragment as Fragment$1}from"react";import{jsx,jsxs,Fragment}from"react/jsx-runtime";import{createPortal}from"react-dom";var CART_MAX_QUANTITY=5,stores=/* @__PURE__ */new WeakMap,NONE=[];function storeOf(client){let s=stores.get(client);return s||(s={items:NONE,flash:null,storage:null,listeners:/* @__PURE__ */new Set},stores.set(client,s)),s}function set(client,items){let s=storeOf(client);if(s.items=items,s.storage)try{s.storage.write(JSON.stringify(items))}catch{}for(let l of[...s.listeners])l()}function clamp(n){return Math.max(1,Math.min(CART_MAX_QUANTITY,Math.round(n)))}function cartKey(line){return`${line.offerId}|${line.petId??""}|${line.rxId??""}`}var str=v=>typeof v=="string"&&v!=="";function parseItems(raw){if(!raw)return NONE;let data;try{data=JSON.parse(raw)}catch{return NONE}if(!Array.isArray(data))return NONE;let out=[];for(let d of data){if(!d||typeof d!="object")continue;let o=d;if(!str(o.offerId)||typeof o.title!="string"||typeof o.quantity!="number"||!Number.isFinite(o.quantity))continue;let unitPrice=typeof o.unitPrice=="number"&&Number.isFinite(o.unitPrice)?o.unitPrice:null,petId=str(o.petId)?o.petId:void 0,rxId=str(o.rxId)?o.rxId:void 0,line={offerId:o.offerId,...petId?{petId:petId}:{},...rxId?{rxId:rxId}:{}},key=cartKey(line);out.some(i=>i.key===key)||out.push({...line,key:key,title:o.title,unitPrice:unitPrice,requiresRx:o.requiresRx===true,quantity:rxId?Math.max(1,Math.round(o.quantity)):clamp(o.quantity)})}return out.length>0?out:NONE}function bindCartStorage(client,storage){let s=storeOf(client);if(!(!storage||s.storage)&&(s.storage=storage,s.items.length===0)){let raw=null;try{raw=storage.read()}catch{raw=null}s.items=parseItems(raw)}}function sessionCartStorage(key){let ss;try{ss=globalThis.sessionStorage}catch{return null}if(!ss||typeof ss.getItem!="function"||typeof ss.setItem!="function")return null;let store=ss;return{read:()=>store.getItem(key),write:value=>store.setItem(key,value)}}function cartItems(client){return storeOf(client).items}function addToCart(client,input){let key=cartKey(input),items=cartItems(client),was=items.find(i=>i.key===key),quantity=input.rxId?Math.max(1,Math.round(input.quantity)):clamp((was?.quantity??0)+input.quantity),item={...input,key:key,quantity:quantity};return set(client,was?items.map(i=>i.key===key?item:i):[...items,item]),item}function setCartQuantity(client,key,quantity){let items=cartItems(client);set(client,items.map(i=>i.key===key&&!i.rxId?{...i,quantity:clamp(quantity)}:i))}function removeFromCart(client,key){let items=cartItems(client),was=items.find(i=>i.key===key)??null;return was&&set(client,items.filter(i=>i.key!==key)),was}function removePlaced(client,keys){let gone=new Set(keys),items=cartItems(client);items.some(i=>gone.has(i.key))&&set(client,items.filter(i=>!gone.has(i.key)))}function flashCart(client,line){storeOf(client).flash=line}function takeCartFlash(client){let s=storeOf(client),line=s.flash;return s.flash=null,line}function cartLines(items){return items.map(i=>({offerId:i.offerId,quantity:i.quantity,...i.petId?{petId:i.petId}:{},...i.rxId?{rxId:i.rxId}:{}}))}function cartSubtotal(items){let sum=0;for(let i of items){if(i.unitPrice===null)return null;sum+=i.unitPrice*i.quantity}return sum}function cartCount(items){return items.reduce((n,i)=>n+i.quantity,0)}function useCart(client){let s=storeOf(client);return useSyncExternalStore(l=>(s.listeners.add(l),()=>{s.listeners.delete(l)}),()=>s.items,()=>s.items)}var EverfurConfigError=class _EverfurConfigError extends Error{constructor(kind,message){super(message),this.name="EverfurConfigError",this.kind=kind,Object.setPrototypeOf(this,_EverfurConfigError.prototype)}};function omsOk(value){/* @__PURE__ */
|
|
3
|
+
import{createContext,useMemo,useState,useEffect,useRef,createElement,useContext,useLayoutEffect,useCallback,useId,useSyncExternalStore,Fragment as Fragment$1}from"react";import{jsx,jsxs,Fragment}from"react/jsx-runtime";import{createPortal}from"react-dom";var CART_MAX_QUANTITY=5,stores=/* @__PURE__ */new WeakMap,NONE=[];function storeOf(client){let s=stores.get(client);return s||(s={items:NONE,flash:null,storage:null,binding:null,lastKey:null,listeners:/* @__PURE__ */new Set},stores.set(client,s)),s}function set(client,items){let s=storeOf(client);if(s.items=items,s.storage)try{s.storage.write(JSON.stringify(items))}catch{}for(let l of[...s.listeners])l()}function clamp(n){return Math.max(1,Math.min(CART_MAX_QUANTITY,Math.round(n)))}function cartKey(line){return`${line.offerId}|${line.petId??""}|${line.rxId??""}`}var str=v=>typeof v=="string"&&v!=="";function parseItems(raw){if(!raw)return NONE;let data;try{data=JSON.parse(raw)}catch{return NONE}if(!Array.isArray(data))return NONE;let out=[];for(let d of data){if(!d||typeof d!="object")continue;let o=d;if(!str(o.offerId)||typeof o.title!="string"||typeof o.quantity!="number"||!Number.isFinite(o.quantity))continue;let unitPrice=typeof o.unitPrice=="number"&&Number.isFinite(o.unitPrice)?o.unitPrice:null,petId=str(o.petId)?o.petId:void 0,rxId=str(o.rxId)?o.rxId:void 0,line={offerId:o.offerId,...petId?{petId:petId}:{},...rxId?{rxId:rxId}:{}},key=cartKey(line);out.some(i=>i.key===key)||out.push({...line,key:key,title:o.title,unitPrice:unitPrice,requiresRx:o.requiresRx===true,quantity:rxId?Math.max(1,Math.round(o.quantity)):clamp(o.quantity)})}return out.length>0?out:NONE}function bindCartStorage(client,storage){let s=storeOf(client);if(!(!storage||s.storage)&&(s.storage=storage,s.items.length===0)){let raw=null;try{raw=storage.read()}catch{raw=null}s.items=parseItems(raw)}}function sessionCartStorage(key){let ss;try{ss=globalThis.sessionStorage}catch{return null}if(!ss||typeof ss.getItem!="function"||typeof ss.setItem!="function")return null;let store=ss;return{read:()=>store.getItem(key),write:value=>store.setItem(key,value)}}function cartItems(client){return storeOf(client).items}function addToCart(client,input){let key=cartKey(input),items=cartItems(client),was=items.find(i=>i.key===key),quantity=input.rxId?Math.max(1,Math.round(input.quantity)):clamp((was?.quantity??0)+input.quantity),item={...input,key:key,quantity:quantity};return set(client,was?items.map(i=>i.key===key?item:i):[...items,item]),item}function setCartQuantity(client,key,quantity){let items=cartItems(client);set(client,items.map(i=>i.key===key&&!i.rxId?{...i,quantity:clamp(quantity)}:i))}function removeFromCart(client,key){let items=cartItems(client),was=items.find(i=>i.key===key)??null;return was&&set(client,items.filter(i=>i.key!==key)),was}function removePlaced(client,keys){let gone=new Set(keys),items=cartItems(client);items.some(i=>gone.has(i.key))&&set(client,items.filter(i=>!gone.has(i.key)))}function flashCart(client,line){storeOf(client).flash=line}function takeCartFlash(client){let s=storeOf(client),line=s.flash;return s.flash=null,line}function cartLines(items){return items.map(i=>({offerId:i.offerId,quantity:i.quantity,...i.petId?{petId:i.petId}:{},...i.rxId?{rxId:i.rxId}:{}}))}function cartSubtotal(items){let sum=0;for(let i of items){if(i.unitPrice===null)return null;sum+=i.unitPrice*i.quantity}return sum}function cartCount(items){return items.reduce((n,i)=>n+i.quantity,0)}function useCart(client){let s=storeOf(client);return useSyncExternalStore(l=>(s.listeners.add(l),()=>{s.listeners.delete(l)}),()=>s.items,()=>s.items)}var EverfurConfigError=class _EverfurConfigError extends Error{constructor(kind,message){super(message),this.name="EverfurConfigError",this.kind=kind,Object.setPrototypeOf(this,_EverfurConfigError.prototype)}};function omsOk(value){/* @__PURE__ */
|
|
4
4
|
return Object.freeze({ok:true,value:value})}function omsErr(error){/* @__PURE__ */
|
|
5
|
-
return Object.freeze({ok:false,error:/* @__PURE__ */Object.freeze(error)})}function isOmsRefusal(error,reasonCode){return error.kind==="refused"&&(reasonCode===void 0||error.reasonCode===reasonCode)}function isOmsUnavailable(error){return error.kind==="unavailable"}function isOmsRetryable(error){return error.kind==="network"||error.kind==="timeout"||error.kind==="serviceUnavailable"||error.kind==="refused"&&error.reasonCode==="order_state_conflict"}var REASON=/^[a-z][a-z0-9_]{0,63}$/,MAX_MESSAGE=300;function cleanMessage(raw){if(typeof raw!="string")return null;let text=raw.replace(/[\u0000-\u001f\u007f]+/g," ").trim();return text.length===0||text.length>MAX_MESSAGE?null:text}function retryAfter(header){if(!header)return null;let seconds=Number(header);return Number.isFinite(seconds)&&seconds>=0?Math.min(Math.round(seconds),3600):null}function omsErrorFromStatus(status,body,headers){let requestId=headers.requestId,rid=requestId?{requestId:requestId}:{};if(status===404)return{kind:"unavailable",...rid};if(status===401)return{kind:"signedOut"};if(status===402||status===409||status===422){let envelope=body&&typeof body=="object"?body:{},reason=typeof envelope.reason_code=="string"&&REASON.test(envelope.reason_code)?envelope.reason_code:null;return{kind:"refused",status:status,reasonCode:reason,message:cleanMessage(envelope.message),...rid}}return status===400?{kind:"invalidRequest",...rid}:status===429?{kind:"rateLimited",retryAfterSeconds:retryAfter(headers.retryAfter??null),...rid}:status===503?{kind:"serviceUnavailable",...rid}:status===403?{kind:"unavailable",...rid}:{kind:"serverError",status:status,...rid}}function newIdempotencyKey(){let c=globalThis.crypto;if(c&&typeof c.randomUUID=="function")return c.randomUUID();if(c&&typeof c.getRandomValues=="function"){let b=c.getRandomValues(new Uint8Array(16));b[6]=b[6]&15|64,b[8]=b[8]&63|128;let h=Array.from(b,x=>x.toString(16).padStart(2,"0")).join("");return`${h.slice(0,8)}-${h.slice(8,12)}-${h.slice(12,16)}-${h.slice(16,20)}-${h.slice(20)}`}throw new EverfurConfigError("missing-peer-dependency","No secure random source: cannot make an idempotency key")}var MAX_ROUNDS=3,NAME_REQUIRED_REASONS=["client_name_missing"];function isNameRequired(error){return!!error&&error.kind==="refused"&&!!error.reasonCode&&NAME_REQUIRED_REASONS.includes(error.reasonCode)}var ShopActionKeys=class{constructor(make=newIdempotencyKey){this.make=make;this.keys=/* @__PURE__ */new Map}key(step2){let k=this.keys.get(step2);return k||(k=this.make(),this.keys.set(step2,k)),k}next(step2){let k=this.make();return this.keys.set(step2,k),k}};async function confirmWithPayerActions(confirm,keys,payments,options={reconfirm:true}){let key=keys.key("confirm"),orderIds=[];for(let round=0;round<MAX_ROUNDS;round+=1){let res=await confirm(key);if(!res.ok)return{kind:"failed",error:res.error};orderIds=res.value.resale.map(r=>r.orderId);let pending=res.value.resale.filter(r=>r.outcome==="action_required"&&r.payerAction);if(pending.length===0)return{kind:"confirmed",orderIds:orderIds};if(!payments)return{kind:"needsPayerAction",orderIds:orderIds};for(let entry of pending){let stepResult=await payments.handleNextAction(entry.payerAction,{orderId:entry.orderId});if(!stepResult.ok)return stepResult.closed?{kind:"payerActionClosed",orderIds:orderIds}:{kind:"payerActionFailed",orderIds:orderIds,message:stepResult.message}}if(!options.reconfirm)return{kind:"confirmed",orderIds:orderIds};key=keys.next("confirm")}return{kind:"needsPayerAction",orderIds:orderIds}}function placeholder(key){return`[copy:shop.${key}]`}var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function possessive(name){return`${name}’s`}function listNames(names){return names.length<=1?names[0]??"":`${names.slice(0,-1).join(", ")} and ${names[names.length-1]}`}function asDate(iso){if(!iso)return null;let d=new Date(/^\d{4}-\d{2}-\d{2}$/.test(iso)?`${iso}T00:00:00Z`:iso);return Number.isNaN(d.getTime())?null:d}function formatDay(iso,opts={}){let d=asDate(iso);if(!d)return null;if(opts.when&&d.getUTCFullYear()!==(opts.now??/* @__PURE__ */new Date).getUTCFullYear())return d.toLocaleDateString("en-US",{timeZone:"UTC",month:"short",day:"numeric",year:"numeric"});let weekday=opts.weekday===true||opts.when===true;return d.toLocaleDateString("en-US",{timeZone:"UTC",...weekday?{weekday:"short"}:{},month:"short",day:"numeric"})}function monthOf(iso){let d=asDate(iso);return d?MONTHS[d.getUTCMonth()]:null}function formatCents(cents){let sign=cents<0?"-":"",abs=Math.abs(Math.round(cents));return`${sign}$${Math.floor(abs/100).toLocaleString("en-US")}.${String(abs%100).padStart(2,"0")}`}function cardLabel(brand,last4){return`${brand?brand.charAt(0).toUpperCase()+brand.slice(1):""} ending ${last4}`}var PHARMACY_REFUSAL="We can’t send this prescription to the pharmacy yet. Contact us.",PHARMACY_REFUSALS=["prescription_missing","prescription_reference_missing","prescription_unreadable","prescriptions_disagree","first_fill_mixed_with_refill","duplicate_prescription_line","prescription_in_flight","client_email_missing","client_phone_missing","client_phone_not_us","practice_email_missing","practice_phone_missing","practice_phone_not_us","patient_birth_date_missing","patient_weight_missing","weight_below_partner_unit","species_not_supported","sex_not_supported","refills_over_partner_limit","indications_missing","indication_not_mapped","compounding_missing","compounding_reason_not_mapped","compounding_unexplained","delivery_speed_unavailable","address_missing","address_not_deliverable"],SHOP_COPY={tabsLabel:"Care",tabPackage:"Package",tabShop:"Shop",tabOrders:"Orders",tabPlan:"Plan",legal:"Prescription items need a valid prescription from a licensed vet, and are filled by a licensed partner pharmacy.",legalTracking:"Prescription items are filled by a licensed partner pharmacy.",loadFailed:thing=>`We couldn’t load ${thing}. Check your connection and try again.`,tryAgain:"Try again",actionFailed:"That didn’t go through. Try again.",saving:"Saving…",keepIt:"Keep it",close:"Close",thingPackage:placeholder("thing.package"),thingShop:placeholder("thing.shop"),thingProduct:placeholder("thing.product"),thingPlan:placeholder("thing.plan"),thingOrders:"your orders",thingOrder:"this order",packageTitle:month=>`${month} package`,packageSub:(names,reviewBy,arrives)=>{let s=[];return names.length>0&&s.push(`For ${listNames(names)}.`),reviewBy&&arrives&&s.push(`Approve by ${reviewBy} and it arrives ${arrives}.`),s.length?s.join(" "):null},inThisPackage:"In this package",reviewBy:day=>`Review by ${day}`,forPet:name=>`For ${name}`,details:"Details",remove:"Remove",removed:"Removed.",total:"Total",items:"Items",shipping:"Shipping",tax:"Tax",free:"Free",approveAndShip:"Approve and ship",itemCount:n=>n===1?placeholder("package.item_count_one"):`${n} items`,withTotal:(label,total)=>`${label} · ${total}`,approveRegion:"Approve",packageDetailsRegion:"Package details",deliveryPaymentRegion:"Delivery and payment",questionsRegion:"Questions",approving:"Approving…",skipThisMonth:"Skip this month",chargedWhenShips:card=>`Charged to ${card} when it ships.`,rxCheckedFirst:"Prescriptions are checked with the vet who wrote them first.",delivery:"Delivery",arrives:day=>`Arrives ${day}`,change:"Change",outOfStock:"Out of stock",packageOutOfStock:"Out of stock right now, so it won’t ship this month.",packageEmpty:month=>`Nothing in ${possessive(month)} package yet. Add something from the shop, or skip this month.`,itemNoLongerSold:placeholder("package.item_no_longer_sold"),reviewClosed:placeholder("package.review_closed"),approvalInProgress:placeholder("package.approval_in_progress"),priceChanged:placeholder("package.price_changed"),cardStepFailed:placeholder("package.card_step_failed"),cardStepClosed:placeholder("package.card_step_closed"),noCardOnFile:placeholder("package.no_card_on_file"),shopTitle:"Shop",searchLabel:"Search the shop",searchPlaceholder:"Search the shop…",filtersLabel:"Filter",filterAll:"All",refillSoon:"Refill soon",prescribedFor:names=>`Prescribed for ${listNames(names)}`,inMonthsPackage:month=>`In ${possessive(month)} package →`,forPets:names=>`For ${listNames(names)}`,allProducts:placeholder("shop.all_products_title"),rx:"Rx",hasPrescription:name=>`${name} has a prescription`,needsPrescription:"Needs a prescription",noMatches:q=>`Nothing in the shop matches ‘${q}’.`,nothingHereYet:"Nothing here yet.",photoToCome:"Photo to come",backToShop:"Shop",howOften:"How often",everyMonthIn:name=>`Every month, in ${possessive(name)} package`,skipOrStop:"Skip or stop any month",justOnce:"Just once",shipsWith:month=>`Ships with ${possessive(month)} package`,justOnceShipsNow:placeholder("product.just_once_meta"),oneFewer:"One fewer",oneMore:"One more",quantity:"Quantity",addToPackage:month=>`Add to ${possessive(month)} package`,refillInPackage:month=>`Refill in ${possessive(month)} package`,buyNow:placeholder("product.buy_now"),startPlan:placeholder("product.start_plan"),adding:"Adding…",outOfStockNow:"Out of stock right now.",prescription:"Prescription",noPrescriptionFor:name=>`No prescription for ${name} on file.`,bookVideoVisit:"Book a video visit",refillsLeft:n=>`${n} ${n===1?"refill":"refills"} left`,rxBeingPrepared:"This prescription is being prepared. You can order it soon.",rxTooSoon:placeholder("rx.too_soon"),rxRenew:placeholder("rx.needs_renewal"),rxPick:placeholder("rx.pick_pet"),educational:"Educational, not a diagnosis.",planTitle:"Your plan",whatRepeats:"What repeats",repeatsLabel:title=>`${title} repeats`,cadenceMonths:months=>months===1?"Every month":`Every ${months} months`,cadenceDays:placeholder("plan.cadence_days"),repeatsEmpty:"Nothing repeats yet. Pick Every month when you add something, and it shows up here.",nextPackage:"Next package",reviewByLabel:"Review by",ships:"Ships",reviewMonthsPackage:month=>`Review ${possessive(month)} package →`,deliveryAndPayment:"Delivery and payment",shipTo:"Ship to",payWith:"Pay with",needABreak:"Need a break?",skipMonth:month=>`Skip ${month}`,skipMonthAsk:month=>`Skip ${month}?`,skipMonthBody:"Nothing ships this month.",pausePlan:"Pause the plan",pausePlanAsk:"Pause the plan?",pausePlanBody:"Nothing ships until you turn it back on.",declined:month=>month?`Declined. Update your card so ${possessive(month)} package can ship.`:"Declined.",resumePlan:placeholder("plan.resume"),stopReason:reason=>placeholder(`plan.stop_reason.${reason}`),consentTitle:placeholder("plan.consent_title"),consentBody:placeholder("plan.consent_body"),consentTermsLink:placeholder("plan.consent_terms_link"),consentAgree:placeholder("plan.consent_agree"),ordersTitle:"Orders",ordersSub:names=>`Packages and one-off orders for ${listNames(names)}.`,allOrders:"All orders",placed:day=>`Placed ${day}`,ordersEmpty:"No orders yet. Your first package shows up here once you approve it.",paymentFailed:"Payment failed",backToCare:"Care",onItsWay:title=>`${title}, on its way`,shouldArrive:day=>`It should arrive ${day}.`,whereItStands:"Where it stands",stepApproved:"Approved",stepChecking:"Checking prescriptions…",stepFilled:"Filled by the pharmacy",stepShipped:"Shipped",stepDelivered:"Delivered",now:"Now",expected:day=>`Expected ${day}.`,inTheBox:"In the box",payment:"Payment",cancelOrder:placeholder("order.cancel"),payOrder:placeholder("order.pay"),trackPackage:placeholder("order.track"),orderStatus:{pending_placement:"Confirmed, sending to the pharmacy",placement_unknown:"Confirmed",placed:"With the pharmacy, in review",accepted:"Approved by the pharmacist",release_sent:"Approved, being prepared",release_unknown:"Approved, being prepared",released:"Being prepared",shipped:"Shipped",delivered:"Delivered",needs_support:"We’re looking into this order",rejected:placeholder("order.status.rejected"),cancelled:"Cancelled",pending_handoff:placeholder("order.status.pending_handoff")},addressTitle:placeholder("address.title"),addressLabel:placeholder("address.label"),addressRecipient:placeholder("address.recipient_name"),addressLine1:placeholder("address.line1"),addressLine2:placeholder("address.line2"),addressCity:placeholder("address.city"),addressRegion:placeholder("address.region"),addressPostal:placeholder("address.postal_code"),addressSave:placeholder("address.save"),addressNeeded:placeholder("address.needed"),cardTitle:placeholder("card.title"),cardBody:placeholder("card.body"),cardStart:placeholder("card.start"),cardUnavailable:placeholder("card.unavailable"),confirmTitle:placeholder("buy.confirm_title"),confirmPay:placeholder("buy.confirm_pay"),nameMissing:placeholder("checkout.name_missing"),addName:placeholder("checkout.add_name"),firstName:placeholder("checkout.first_name"),lastName:placeholder("checkout.last_name"),saveName:placeholder("checkout.save_name"),refusal:{operation_not_supported:"This action isn’t available for this order.",order_not_sellable:"We can’t ship this order as it is. Add items or contact us.",rx_being_prepared:"This prescription is being prepared. You can order it soon.",rx_not_dispensable:PHARMACY_REFUSAL,...Object.fromEntries(PHARMACY_REFUSALS.map(code=>[code,PHARMACY_REFUSAL])),order_state_conflict:"This order changed. Refresh and try again.",payment_method_in_use:"A subscription or an order uses this card."},rateLimited:placeholder("error.rate_limited")},SHOP_COPY_PLACEHOLDERS=(()=>{let keys=/* @__PURE__ */new Set,visit=v=>{if(typeof v=="string"){let m=/^\[copy:(shop\.[a-z0-9_.]+)\]$/.exec(v);m&&keys.add(m[1])}else if(typeof v=="function")try{visit(v("x","x","x"))}catch{}else if(v&&typeof v=="object")for(let inner of Object.values(v))visit(inner)};return visit(SHOP_COPY),[...keys].sort()})();function shopCopy(overrides){return overrides?{...SHOP_COPY,...overrides}:SHOP_COPY}function refusalLine(copy,error){if(error.kind==="rateLimited")return copy.rateLimited;if(error.kind==="refused"){if(isNameRequired(error))return copy.nameMissing;let own=error.reasonCode?copy.refusal[error.reasonCode]:void 0;if(own)return own;if(error.message)return error.message}return copy.actionFailed}var UNAVAILABLE_PACKAGE_SOURCE=/* @__PURE__ */Object.freeze({load:()=>Promise.resolve(omsErr({kind:"unavailable"})),removeLine:()=>Promise.resolve(omsErr({kind:"unavailable"})),skip:()=>Promise.resolve(omsErr({kind:"unavailable"})),approve:()=>Promise.resolve({kind:"failed",error:{kind:"unavailable"}})});async function offersFor(client,ids){let unique=[...new Set(ids)],read=await Promise.all(unique.map(id=>client.offer(id)));return new Map(unique.map((id,i)=>[id,read[i].ok?read[i].value:null]))}function createOmsPackageSource(client){async function build(plan,review){let offers=await offersFor(client,review.lines.map(l=>l.offerId)),lines=review.lines.map(l=>({...l,offer:offers.get(l.offerId)??null})),draft=null;if(review.state==="open"&&lines.length>0){let d=await client.draftCycle(plan.planId,review.cycle);if(d.ok)draft=d.value;else if(d.error.kind!=="refused")return omsErr(d.error)}return omsOk({plan:plan,review:review,lines:lines,draft:draft})}return{async load(){let plans=await client.plans();if(!plans.ok)return omsErr(plans.error);let plan=plans.value.plans.find(p=>p.state==="active")??plans.value.plans.find(p=>p.state!=="cancelled");if(!plan)return omsOk(null);let review=await client.cycleReview(plan.planId);return review.ok?build(plan,review.value):omsErr(review.error)},async removeLine(pkg,index,keys){let rest=pkg.lines.filter((_,i)=>i!==index).map(l=>({offerId:l.offerId,quantity:l.quantity,...l.petId?{petId:l.petId}:{}})),edited=await client.editCycle(pkg.plan.planId,pkg.review.cycle,{idempotencyKey:keys.key(`remove:${index}`),lines:rest});return edited.ok?build(pkg.plan,edited.value):omsErr(edited.error)},async skip(pkg,keys){let res=await client.skipCycle(pkg.plan.planId,pkg.review.cycle,{idempotencyKey:keys.key("skip")});return res.ok?omsOk(void 0):omsErr(res.error)},approve(pkg,keys,payments){let draft=pkg.draft;return draft?confirmWithPayerActions(idempotencyKey=>client.approveCycle(pkg.plan.planId,pkg.review.cycle,{idempotencyKey:idempotencyKey,checkoutId:draft.checkoutId,expectedTotal:draft.total}),keys,payments,{reconfirm:false}):Promise.resolve({kind:"failed",error:{kind:"invalidRequest"}})}}}var SHOP_V3_COPY={cartTitle:"Cart",cartLabel:n=>n>0?`Cart, ${n} item${n>1?"s":""}`:"Cart, empty",cartEmptyTitle:"Your cart is empty",cartEmptyBody:null,addToCart:"Add to cart",viewCart:"View cart",addedToCart:name=>`${name} is in your cart.`,removedFromCart:name=>`${name} is out of your cart.`,quantityLabel:name=>`How many: ${name}`,fewer:"One fewer",more:"One more",remove:"Remove",subtotal:"Subtotal",shipping:"Shipping",tax:"Tax",free:"Free",total:"Total",checkoutCart:total=>`Checkout · ${total}`,checkoutKicker:"Checkout",itemQuantity:n=>`Qty ${n}`,shipsTo:"Ships to",payWith:"Pay with",placeOrder:total=>`Place order · ${total}`,chooseAddress:placeholder("checkout.choose_address"),chooseCard:placeholder("checkout.choose_card"),addAddress:placeholder("checkout.add_address"),addCard:placeholder("card.start"),makeDefault:placeholder("address.make_default"),editAddress:placeholder("address.edit"),noAddressYet:placeholder("address.needed"),noCardYet:placeholder("package.no_card_on_file"),placedHeader:"Order placed",placedTitle:"Order placed.",placedSteps:"What's coming",placedShips:"It ships.",placedArrives:"It arrives at home.",viewOrder:"View order",ordersTitle:"Orders",ordersEmptyTitle:"No orders yet",ordersEmptyBody:null,moreOrders:placeholder("orders.more"),subscriptionBox:"Subscription box",orderTitle:n=>n===null?"Order":`Order ${n}`,arrivesBy:day=>`Arrives by ${day}`,deliveredOn:day=>`Delivered ${day}`,expected:day=>`Expected ${day}`,orderSteps:["Ordered","Shipped","Out for delivery","Delivered"],tracking:"Tracking",trackOn:carrier=>`Track on ${carrier}`,inThisOrder:"In this order",orderItemLine:n=>`Qty ${n}`,buyAgain:"Buy again",orderHelp:"Get help with this order",paidWith:"Paid with",refund:placeholder("order.refund"),discount:placeholder("order.discount"),cancelAsk:placeholder("order.cancel_ask"),cancelBody:null,cancelRequested:placeholder("order.cancel_requested"),close:"Close",manageKicker:"Your subscription",manageTitle:name=>`Manage ${name}`,manage:"Manage",shipsEvery:"Ships every",daysChip:n=>`${n} days`,skipNext:"Skip the next box",cancelSubscription:"Cancel subscription",nextBox:day=>`Next box ${day}`,everyDays:n=>`Every ${n} days`,subscribedLine:(n,next)=>next===null?`Every ${n} days`:`Every ${n} days · next box ${next}`,skipped:"Skipped.",cancelSubscriptionAsk:placeholder("plan.cancel_ask"),cancelSubscriptionBody:placeholder("plan.cancel_body")},SHOP_V3_COPY_PLACEHOLDERS=Object.values(SHOP_V3_COPY).filter(v=>typeof v=="string"&&v.startsWith("[copy:"));function shopV3Copy(overrides){if(!overrides)return SHOP_V3_COPY;let own={};for(let[k,v]of Object.entries(overrides))k in SHOP_V3_COPY&&v!==void 0&&(own[k]=v);return{...SHOP_V3_COPY,...own}}var ShopContext=createContext(null);function ShopProvider(props){let{client:client,pets:pets,payments:payments,packageSource:packageSource,copy:copy,v3Copy:v3Copy,saveProfileName:saveProfileName,onProfileNameRequired:onProfileNameRequired,children:children}=props,saveName=useRef(saveProfileName);saveName.current=saveProfileName;let editName=useRef(onProfileNameRequired);editName.current=onProfileNameRequired;let canSave=!!saveProfileName,canEdit=!!onProfileNameRequired,value=useMemo(()=>{let list=pets??[],names=new Map(list.map(p=>[p.petId,p.name]));return{client:client,pets:list,petName:id=>id?names.get(id)??null:null,payments:payments??null,packageSource:packageSource??createOmsPackageSource(client),copy:shopCopy(copy),v3:shopV3Copy(v3Copy),saveProfileName:canSave?name=>saveName.current?saveName.current(name):Promise.resolve(false):null,onProfileNameRequired:canEdit?()=>editName.current?.():null}},[client,pets,payments,packageSource,copy,v3Copy,canSave,canEdit]);return createElement(ShopContext.Provider,{value:value},children)}function useShop(){let ctx=useContext(ShopContext);if(!ctx)throw new EverfurConfigError("not-initialized","useShop: wrap the shop in <ShopProvider>");return ctx}function useShopRead(key,read){let[state,setState]=useState({key:null,phase:"loading",value:null,error:null}),epoch=useRef(0),readRef=useRef(read);readRef.current=read;let load=useCallback(quiet=>{let mine=++epoch.current;key!==null&&(quiet||setState({key:key,phase:"loading",value:null,error:null}),readRef.current().then(res=>{mine===epoch.current&&(res.ok?setState({key:key,phase:"ready",value:res.value,error:null}):setState({key:key,phase:res.error.kind==="unavailable"?"unavailable":"failed",value:null,error:res.error}))}))},[key]);useEffect(()=>(load(false),()=>{epoch.current+=1}),[load]);let refresh=useCallback(()=>load(false),[load]);return state.key!==key?{phase:"loading",value:null,error:null,refresh:refresh}:{phase:state.phase,value:state.value,error:state.error,refresh:refresh}}function useShopConfig(){let{client:client}=useShop();return useShopRead("shop-config",()=>client.shopConfig())}function useOffers(query={}){let{client:client}=useShop(),text=query.text?.trim()??"",key=`offers:${text}:${query.requiresRx??""}`;return useShopRead(key,()=>client.offers({...text?{text:text}:{},...query.requiresRx!==void 0?{requiresRx:query.requiresRx}:{},limit:100}))}function useOffer(offerId){let{client:client}=useShop();return useShopRead(offerId?`offer:${offerId}`:null,()=>client.offer(offerId))}function usePrescriptions(){let{client:client}=useShop();return useShopRead("prescriptions",()=>client.prescriptions())}function useAddresses(){let{client:client}=useShop();return useShopRead("addresses",()=>client.addresses())}function useAddress(ref){let{client:client}=useShop();return useShopRead(ref?`address:${ref}`:null,()=>client.address(ref))}function usePaymentMethods(){let{client:client}=useShop();return useShopRead("payment-methods",()=>client.paymentMethods())}function useOrder(orderId){let{client:client}=useShop();return useShopRead(orderId?`order:${orderId}`:null,()=>client.order(orderId))}function usePlans(){let{client:client}=useShop();return useShopRead("plans",()=>client.plans({limit:100}))}function usePackage(){let{packageSource:packageSource}=useShop();return useShopRead("package",()=>packageSource.load())}function useShopAction(act){let[busy,setBusy]=useState(false),[error,setError]=useState(null),keys=useRef(null),running=useRef(false),actRef=useRef(act);actRef.current=act;let mounted=useRef(true);useEffect(()=>(mounted.current=true,()=>{mounted.current=false}),[]);let run=useCallback(async(...args)=>{if(running.current)return null;running.current=true,keys.current??=new ShopActionKeys,setBusy(true),setError(null);try{let res=await actRef.current(keys.current,...args);return res.ok?keys.current=null:isRetryWithSameKey(res.error)||(keys.current=null),mounted.current&&setError(res.ok?null:res.error),res}finally{running.current=false,mounted.current&&setBusy(false)}},[]),reset=useCallback(()=>{keys.current=null,setError(null)},[]);return{busy:busy,error:error,run:run,reset:reset}}function isRetryWithSameKey(error){return error.kind==="network"||error.kind==="timeout"||error.kind==="serviceUnavailable"||error.kind==="serverError"}function distinct(xs){let out=[];for(let x of xs)x!==null&&!out.includes(x)&&out.push(x);return out}var FORMS=[[/\b(inject(ion|able)?|vial|syringe|pen)s?\b/i,"syringe"],[/\b(chew(able)?|soft ?chew|treat)s?\b/i,"bowl"],[/\b(shampoo|spray|ointment|cream|gel|lotion|topical|spot[- ]on|otic|ophthalmic|wipe|foam|mousse|collar)s?\b/i,"shield"],[/\b(solution|suspension|liquid|syrup|elixir|drops?|oral ?paste|paste)s?\b/i,"flask"],[/\b(tablet|caplet|capsule|tab|cap|pill)s?\b/i,"pill"]];function drugFormIcon(title,form){for(let text of[title,form]){if(!text)continue;let hit=FORMS.find(([re])=>re.test(text));if(hit)return hit[1]}return"pill"}function tileFor(rx,title,form){return rx?{tone:"pink",icon:drugFormIcon(title,form)}:{tone:"yellow",icon:"leaf"}}function addressLine(a){return`${a.line2?`${a.line1}, ${a.line2}`:a.line1}, ${a.city}, ${a.region?`${a.region} `:""}${a.postalCode}`}function rxPill(copy){return{label:copy.rx,tone:"rx"}}function refillsLeft(rx){return rx.fillsTotal!==null&&rx.fillsUsed!==null?Math.max(0,rx.fillsTotal-Math.max(rx.fillsUsed,1)):null}function toPackageView(i){let{pkg:pkg,copy:copy,petName:petName}=i,review=pkg.review,month=monthOf(review.shipsOn),names=distinct(pkg.lines.map(l=>petName(l.petId))),open=review.state==="open",priced=new Map(review.quoteLines.map(q=>[`${q.offerId}:${q.petId??""}`,q])),items=pkg.lines.map((line,index)=>{let offer=line.offer,q=priced.get(`${line.offerId}:${line.petId??""}`),rx=offer?.requiresRx??false,pills=[];return offer||pills.push({label:copy.outOfStock,tone:"later"}),{petId:line.petId,view:{key:`${line.offerId}:${line.petId??""}:${index}`,name:offer?.title??copy.itemNoLongerSold,rx:rx,meta:null,alert:offer?null:copy.packageOutOfStock,pills:pills,price:q&&offer?formatCents(q.unitPrice*q.quantity-q.discount):null,...tileFor(rx,offer?.title),details:offer?{label:copy.details,to:{name:"product",offerId:offer.offerId,...line.petId?{petId:line.petId}:{}}}:null,remove:open?{label:copy.remove,busy:i.removing===index,disabled:i.removing!==null,onPress:()=>i.onRemove(index)}:null}}}),groups=[];for(let it of items){let name=petName(it.petId),label=name?copy.forPet(name):null,existing=groups.find(g=>g.label===label);existing?existing.items.push(it.view):groups.push({label:label,items:[it.view]})}let sum=[],d=pkg.draft;d?(sum.push({k:copy.items,v:formatCents(d.total-d.shipping-d.tax)}),sum.push({k:copy.shipping,v:d.shipping===0?copy.free:formatCents(d.shipping)}),sum.push({k:copy.tax,v:formatCents(d.tax)}),sum.push({k:copy.total,v:formatCents(d.total)})):review.quoteLines.length>0&&sum.push({k:copy.items,v:formatCents(review.quoteLines.reduce((n,q)=>n+q.unitPrice*q.quantity-q.discount,0))});let card=i.card?cardLabel(i.card.brand,i.card.last4):null,anyRx=pkg.lines.some(l=>l.offer?.requiresRx),note=card?[copy.chargedWhenShips(card),anyRx?copy.rxCheckedFirst:null].filter(Boolean).join(" "):null,error=i.error;!error&&review.state==="approving"?error=copy.approvalInProgress:!error&&review.state!=="open"&&review.state!==null?error=copy.reviewClosed:!error&&open&&!i.card&&(error=copy.noCardOnFile);let approve=open&&d&&i.card?{label:copy.approveAndShip,busyLabel:copy.approving,busy:i.approving,disabled:i.approving||i.placed===true||i.removing!==null,onPress:i.onApprove}:null;return{title:month?copy.packageTitle(month):copy.tabPackage,sub:copy.packageSub(names,formatDay(review.approveBy,{weekday:true}),null),reviewPill:review.approveBy&&open?copy.reviewBy(formatDay(review.approveBy)):null,countPill:pkg.lines.length>0?copy.itemCount(pkg.lines.length):null,fine:null,groups:pkg.lines.length>0?groups:[],empty:pkg.lines.length===0?{line:month?copy.packageEmpty(month):copy.nothingHereYet,shop:{label:copy.tabShop,to:{name:"shop"}},skip:null}:null,add:null,sum:sum,approve:approve,skip:open?{label:copy.skipThisMonth,to:{name:"plan"}}:null,note:note,error:error,delivery:i.address?[{k:copy.shipTo,v:addressLine(i.address),change:{label:copy.change,to:{name:"address",then:{name:"package"}}}}]:[],legal:copy.legal}}function readyRxFor(offerId,prescriptions){return prescriptions.filter(p=>p.status==="ready"&&p.offerId===offerId)}function toTile(offer,prescriptions,copy,petName,forPetId=null){let pills=[],meta=null,petId=forPetId,holder;return offer.requiresRx&&(pills.push(rxPill(copy)),holder=readyRxFor(offer.offerId,prescriptions).find(p=>petName(p.petId)),petId=holder?.petId??forPetId,meta=holder?copy.hasPrescription(petName(holder.petId)):copy.needsPrescription),{key:offer.offerId,to:{name:"product",offerId:offer.offerId,...petId?{petId:petId}:{}},name:offer.title,meta:meta,price:offer.price!==null?formatCents(offer.price):null,pills:pills,...tileFor(offer.requiresRx,offer.title,holder?.form),imageUrl:offer.imageUrl??null}}function isFirstFill(rx){return rx.fillsUsed===null||rx.fillsUsed===0}function toShelves(i){let{copy:copy}=i,tile=o=>toTile(o,i.prescriptions,copy,i.petName,i.petId??null),shelves=[],byId=/* @__PURE__ */new Map;for(let o of[...i.offers,...i.prescribed??[]])byId.set(o.offerId,o);let first=[],refill=[],firstPets=[];if(!i.searching){let ready=i.prescriptions.filter(p=>p.status==="ready"&&p.offerId!==null&&i.petName(p.petId));for(let offerId of distinct(ready.map(p=>p.offerId))){let o=byId.get(offerId);if(!o||!o.requiresRx)continue;let holders=ready.filter(p=>p.offerId===offerId);if(holders.every(isFirstFill)){first.push(o);for(let p of holders)firstPets.includes(i.petName(p.petId))||firstPets.push(i.petName(p.petId))}else refill.push(o)}}first.length>0&&shelves.push({key:"prescribed",title:copy.prescribedFor(firstPets),link:null,tiles:first.map(tile)}),refill.length>0&&shelves.push({key:"refill",title:copy.refillSoon,link:i.packageMonth?{label:copy.inMonthsPackage(i.packageMonth),to:{name:"package"}}:null,tiles:refill.map(tile)});let above=new Set([...first,...refill].map(o=>o.offerId));return shelves.push({key:"all",title:i.petNames.length>0?copy.forPets(i.petNames):copy.allProducts,link:null,tiles:i.offers.filter(o=>!above.has(o.offerId)).map(tile)}),shelves}function toProductView(i){let{copy:copy,offer:offer}=i,monthly=i.plansOn&&i.petName!==null,choice=monthly?i.choice:"once",submitLabel=choice==="monthly"?i.packageMonth?copy.addToPackage(i.packageMonth):copy.startPlan:copy.buyNow,sellable=offer.price!==null;return{back:{label:copy.backToShop,to:{name:"shop"}},title:offer.title,sub:null,price:sellable?formatCents(offer.price):null,priceUnit:null,...tileFor(false),source:null,stockLine:sellable?null:copy.outOfStockNow,choices:monthly?[{value:"monthly",title:copy.everyMonthIn(i.petName),meta:copy.skipOrStop},{value:"once",title:copy.justOnce,meta:copy.justOnceShipsNow}]:null,choice:monthly?choice:null,onChoice:v=>i.onChoice(v==="once"?"once":"monthly"),quantity:i.quantity,onQuantity:n=>i.onQuantity(Math.min(99,Math.max(1,n))),submit:sellable?{label:submitLabel,busyLabel:copy.adding,busy:i.busy,disabled:i.busy,onPress:i.onSubmit}:{label:copy.outOfStock,disabled:true,onPress:()=>{}},error:i.error,facts:null,cards:[],aside:null,legal:copy.legal}}function toRxProductView(i){let{copy:copy,offer:offer}=i,ready=readyRxFor(offer.offerId,i.prescriptions).filter(p=>i.petName(p.petId)),rx=(i.petId?ready.find(p=>p.petId===i.petId):void 0)??ready[0]??null,sellable=offer.price!==null,script=null,submit=null;if(rx){let left=refillsLeft(rx);script={name:copy.hasPrescription(i.petName(rx.petId)),meta:left!==null&&left>0?copy.refillsLeft(left):null,directions:null},submit=sellable?{label:i.packageMonth?copy.refillInPackage(i.packageMonth):copy.buyNow,busyLabel:copy.adding,busy:i.busy,disabled:i.busy,onPress:()=>i.onSubmit(rx)}:{label:copy.outOfStock,disabled:true,onPress:()=>{}}}else{let who=(i.petId?i.petName(i.petId):null)??i.firstPetName;script=who?{name:copy.noPrescriptionFor(who),meta:null,directions:null}:null,submit=i.bookVisitHref?{label:copy.bookVideoVisit,href:i.bookVisitHref}:null}return{back:{label:copy.backToShop,to:{name:"shop"}},stepLabel:copy.prescription,title:offer.title,sub:null,price:sellable?formatCents(offer.price):null,priceUnit:null,...tileFor(true,offer.title,rx?.form),script:script,stockLine:sellable?null:copy.outOfStockNow,submit:submit,note:null,error:i.error,cards:[],aside:null,legal:copy.legal}}function cadenceLine(days,copy){let months=Math.round(days/30.4);return months>=1&&Math.abs(days-months*30.4)<=2?copy.cadenceMonths(months):copy.cadenceDays}function toPlanView(i){let{copy:copy}=i,live=i.plans.filter(p=>p.state!=="cancelled"),rows=[];for(let plan of live)plan.lines.forEach((line,n)=>{let offer=i.offers.get(line.offerId)??null,pet=i.petName(line.petId),title=[offer?.title??copy.itemNoLongerSold,pet].filter(Boolean).join(" · "),stop=plan.stopReason,meta=stop==="payment_declined"?copy.declined(i.packageMonth):stop&&stop!=="customer"?copy.stopReason(stop):cadenceLine(plan.cadenceDays,copy);rows.push({key:`${plan.planId}:${n}`,title:title,meta:meta,alert:!!(stop&&stop!=="customer"),on:plan.state==="active",busy:i.busyPlan===plan.planId,onToggle:on=>i.onToggle(plan,on),error:i.rowError&&i.rowError.planId===plan.planId&&n===0?i.rowError.line:null})});let active=live.find(p=>p.state==="active")??null,sum=[],reviewBy=formatDay(i.reviewBy,{weekday:true});reviewBy&&sum.push({k:copy.reviewByLabel,v:reviewBy});let ships=formatDay(active?.nextRun??null,{weekday:true});ships&&sum.push({k:copy.ships,v:ships});let declined=live.some(p=>p.stopReason==="payment_declined"),delivery=[];i.address&&delivery.push({k:copy.shipTo,v:addressLine(i.address),change:{label:copy.change,to:{name:"address",then:{name:"plan"}}}}),i.card&&delivery.push({k:copy.payWith,v:cardLabel(i.card.brand,i.card.last4),alert:declined?copy.declined(i.packageMonth):null,change:{label:copy.change,to:{name:"card",then:{name:"plan"}}}});let month=i.packageMonth??monthOf(active?.nextRun??null);return{sub:null,rows:rows,emptyLine:rows.length===0?copy.repeatsEmpty:null,next:active&&sum.length>0?{sum:sum,link:i.packageMonth?{label:copy.reviewMonthsPackage(i.packageMonth),to:{name:"package"}}:null}:null,delivery:delivery,breakCard:active?{skip:month?{label:copy.skipMonth(month),ask:copy.skipMonthAsk(month),body:copy.skipMonthBody}:null,pause:{label:copy.pausePlan,ask:copy.pausePlanAsk,body:copy.pausePlanBody},busy:i.breakBusy,error:i.breakError,onConfirm:i.onBreak}:null,legal:copy.legal}}var SharedContext=createContext(null),ShopSharedProvider=SharedContext.Provider;function useShopShared(){let s=useContext(SharedContext);if(!s)throw new EverfurConfigError("not-initialized","shop screens render inside EverfurShop");return s}function packageMonth(pkg){return pkg.phase==="ready"&&pkg.value?monthOf(pkg.value.review.shipsOn):null}function loadable(read,map){return read.phase==="ready"&&read.value!==null?{phase:"ready",value:map(read.value)}:read.phase==="loading"?{phase:"loading"}:{phase:"failed",retry:read.refresh}}function pickCard(cards,id){return!cards||cards.length===0?null:(id?cards.find(c=>c.paymentMethodId===id):void 0)??cards[0]??null}function useOffersById(ids){let{client:client}=useShop(),unique=[...new Set(ids)].sort();return useShopRead(`offers-by-id:${unique.join(",")}`,async()=>{let read=await Promise.all(unique.map(id=>client.offer(id)));return omsOk(new Map(unique.map((id,i)=>[id,read[i].ok?read[i].value:null])))})}function outcomeLine(copy,outcome){return outcome.kind==="confirmed"?null:outcome.kind==="needsPayerAction"?copy.cardStepFailed:outcome.kind==="payerActionFailed"?outcome.message??copy.cardStepFailed:outcome.kind==="payerActionClosed"?copy.cardStepClosed:outcome.error.kind==="refused"&&outcome.error.reasonCode==="price_changed"?copy.priceChanged:refusalLine(copy,outcome.error)}var orderNotices=/* @__PURE__ */new WeakMap;function leaveOrderNotice(client,orderId,line){let notices=orderNotices.get(client);notices||(notices=/* @__PURE__ */new Map,orderNotices.set(client,notices)),line?notices.set(orderId,line):notices.delete(orderId)}function peekOrderNotice(client,orderId){return orderNotices.get(client)?.get(orderId)??null}function dropOrderNotice(client,orderId){orderNotices.get(client)?.delete(orderId)}var CARD_PAGE_NOTICE="\0card",takenReturns=/* @__PURE__ */new WeakSet;function takeCardReturn(client,ret,route,copy){if(!ret||takenReturns.has(ret))return false;let key=ret.step==="card"?route.name==="card"?CARD_PAGE_NOTICE:null:route.name==="order"?route.orderId:null;return key===null?false:(takenReturns.add(ret),leaveOrderNotice(client,key,ret.outcome==="closed"?copy.cardStepClosed:ret.outcome==="failed"?copy.cardStepFailed:null),true)}function usePackageScreen(go){let{copy:copy,petName:petName,packageSource:packageSource,payments:payments,client:client}=useShop(),{tabs:tabs,pkg:pkg}=useShopShared(),plan=pkg.phase==="ready"?pkg.value?.plan??null:null,cards=usePaymentMethods(),address=useAddress(plan?.destination??null),[removing,setRemoving]=useState(null),[error,setError]=useState(null),[approving,setApproving]=useState(false),[placed,setPlaced]=useState(false),remove=useShopAction((keys,p,index)=>packageSource.removeLine(p,index,keys));if(pkg.phase==="ready"&&pkg.value===null)return{tabs:tabs,view:{phase:"failed",retry:pkg.refresh}};let view=loadable(pkg,p=>toPackageView({pkg:p,card:pickCard(cards.value,p.plan.paymentMethodId),address:address.value?.address??null,copy:copy,petName:petName,removing:removing,approving:approving,placed:placed,error:error,onRemove:index=>{setRemoving(index),setError(null),remove.run(p,index).then(res=>{setRemoving(null),res&&res.ok?pkg.refresh():res&&setError(refusalLine(copy,res.error))})},onApprove:()=>{approving||placed||(setApproving(true),setError(null),(async()=>{let outcome=await approveOnce(packageSource,p,payments);setApproving(false);let line=outcomeLine(copy,outcome),orderId=outcome.kind!=="failed"?outcome.orderIds[0]:void 0;orderId?(setPlaced(true),leaveOrderNotice(client,orderId,line),go({name:"order",orderId:orderId})):(setError(line),outcome.kind==="failed"&&outcome.error.kind==="refused"&&pkg.refresh())})())}}));return{tabs:tabs,view:view}}var approvalKeys=/* @__PURE__ */new WeakMap;async function approveOnce(source,p,payments){let keys=approvalKeys.get(p);keys||(keys=new ShopActionKeys,approvalKeys.set(p,keys));let out=await source.approve(p,keys,payments);return(out.kind!=="failed"||out.error.kind==="refused")&&approvalKeys.delete(p),out}function useDebounced(value,ms){let[v,setV]=useState(value);return useEffect(()=>{let t=setTimeout(()=>setV(value),ms);return()=>clearTimeout(t)},[value,ms]),v}function useShopScreen(initialQuery){let{client:client,copy:copy,petName:petName,pets:pets}=useShop(),{tabs:tabs,pkg:pkg}=useShopShared(),[query,setQuery]=useState(initialQuery??""),text=useDebounced(query,250),offers=useOffers({text:text}),rx=usePrescriptions(),prescriptions=rx.value??[],names=pets.map(p=>p.name),month=packageMonth(pkg),prescribedIds=prescriptions.filter(p=>p.status==="ready"&&p.offerId!==null&&petName(p.petId)).map(p=>p.offerId),prescribed=useOffersById(prescribedIds),first=offers.phase==="ready"?offers.value??null:null,[laterState,setLater]=useState(null),later=laterState&&first&&laterState.first===first?laterState:null,cursor=later?later.cursor:first?.nextCursor??null,moreBusy=useRef(false),onMore=useCallback(()=>{if(!first||!cursor||moreBusy.current)return;moreBusy.current=true,setLater(l=>({first:first,offers:l&&l.first===first?l.offers:[],cursor:cursor,loading:true,failed:false}));let words=text.trim();client.offers({...words?{text:words}:{},cursor:cursor,limit:100}).then(res=>{moreBusy.current=false,setLater(l=>!l||l.first!==first?l:res.ok?{first:first,offers:[...l.offers,...res.value.offers],cursor:res.value.nextCursor,loading:false,failed:false}:{...l,loading:false,failed:true})})},[client,first,cursor,text]),shelves,prescribedWait=rx.phase==="loading"||prescribedIds.length>0&&prescribed.phase==="loading";if(first&&!prescribedWait){let seen=/* @__PURE__ */new Set,all=[];for(let o of[...first.offers,...later?.offers??[]])seen.has(o.offerId)||(seen.add(o.offerId),all.push(o));shelves={phase:"ready",value:toShelves({offers:all,prescribed:[...prescribed.value?.values()??[]].filter(o=>o!==null),prescriptions:prescriptions,copy:copy,petName:petName,petNames:names,packageMonth:month,searching:text.trim()!=="",petId:pets.length===1?pets[0].petId:null})}}else offers.phase==="loading"||prescribedWait?shelves={phase:"loading"}:offers.phase==="unavailable"?shelves={phase:"ready",value:[]}:shelves={phase:"failed",retry:offers.refresh};let count=shelves.phase==="ready"?shelves.value.reduce((n,s)=>n+s.tiles.length,0):1,empty=shelves.phase==="ready"&&count===0?text.trim()?copy.noMatches(text.trim()):copy.nothingHereYet:null,more=first&&cursor?{onMore:onMore,loading:later?.loading??false,failed:later?.failed??false}:null;return{tabs:tabs,view:{sub:null,query:query,onQuery:setQuery,filters:[],shelves:shelves,empty:empty,legal:copy.legal,more:more}}}function lineFor(offer,quantity,petId,rx){return{offerId:offer.offerId,quantity:rx?.packCount??quantity,...rx?.petId??petId?{petId:rx?.petId??petId}:{},...rx?{rxId:rx.rxId}:{}}}function routeFor(name,line){return{name:name,offerId:line.offerId,quantity:line.quantity,...line.petId?{petId:line.petId}:{},...line.rxId?{rxId:line.rxId}:{}}}function useProductScreen(offerId,petId,go){let{copy:copy,petName:petName,pets:pets,client:client}=useShop(),{config:config,pkg:pkg,bookVisitHref:bookVisitHref}=useShopShared(),offer=useOffer(offerId),rx=usePrescriptions(),[choice,setChoice]=useState("monthly"),[quantity,setQuantity]=useState(1),[error,setError]=useState(null),month=packageMonth(pkg),plans=usePlans(),plan=(pkg.phase==="ready"?pkg.value?.plan??null:null)??plans.value?.plans.find(p=>p.state==="active")??null,addToPlan=useShopAction((keys,p,line)=>client.updatePlan(p.planId,{idempotencyKey:keys.key("add"),lines:[...p.lines.map(l=>({offerId:l.offerId,quantity:l.quantity,...l.petId?{petId:l.petId}:{}})),line]})),submit=(line,monthly)=>{if(setError(null),!monthly)return go(routeFor("buy",line));if(!plan)return go(routeFor("consent",line));addToPlan.run(plan,line).then(res=>{res&&res.ok?(pkg.refresh(),go({name:"package"})):res&&setError(refusalLine(copy,res.error))})};if(offer.phase==="ready"&&offer.value?.requiresRx){let o=offer.value,base={offer:o,copy:copy,petId:petId??null,petName:petName,firstPetName:pets[0]?.name??null,packageMonth:month,error:error,bookVisitHref:bookVisitHref};return rx.phase==="unavailable"?{kind:"rx",view:{phase:"ready",value:toRxProductView({...base,prescriptions:[],busy:false,onSubmit:()=>{}})}}:{kind:"rx",view:loadable(rx,list=>toRxProductView({...base,prescriptions:list,busy:addToPlan.busy,onSubmit:p=>submit(lineFor(o,1,null,p),plan!==null)}))}}let petForChoice=(petId?petName(petId):null)??pets[0]?.name??null;return{kind:"product",view:loadable(offer,o=>toProductView({offer:o,copy:copy,petName:petForChoice,packageMonth:month,plansOn:config.recurringTermsVersion!==null,choice:choice,onChoice:setChoice,quantity:quantity,onQuantity:setQuantity,busy:addToPlan.busy,error:error,onSubmit:()=>submit(lineFor(o,quantity,petId??pets[0]?.petId??null,null),choice==="monthly"&&config.recurringTermsVersion!==null&&petForChoice!==null)}))}}function usePlanScreen(){let{copy:copy,petName:petName,client:client}=useShop(),{tabs:tabs,pkg:pkg}=useShopShared(),plans=usePlans(),cards=usePaymentMethods(),live=(plans.value?.plans??[]).filter(p=>p.state!=="cancelled"),active=live.find(p=>p.state==="active")??live[0]??null,address=useAddress(active?.destination??null),offers=useOffersById(live.flatMap(p=>p.lines.map(l=>l.offerId))),[busyPlan,setBusyPlan]=useState(null),[rowError,setRowError]=useState(null),[breakError,setBreakError]=useState(null),toggle=useShopAction((keys,p,on)=>client.planAction(p.planId,{idempotencyKey:keys.key(on?"resume":"pause"),operation:on?"resume":"pause"})),brk=useShopAction((keys,p,which)=>client.planAction(p.planId,{idempotencyKey:keys.key(which),operation:which})),month=packageMonth(pkg);if(plans.phase==="unavailable")return{tabs:tabs,view:{phase:"failed",retry:plans.refresh}};let view=loadable(plans,()=>toPlanView({plans:live,offers:offers.value??/* @__PURE__ */new Map,copy:copy,petName:petName,card:pickCard(cards.value,active?.paymentMethodId??null),address:address.value?.address??null,reviewBy:pkg.phase==="ready"?pkg.value?.review.approveBy??null:null,packageMonth:month,busyPlan:busyPlan,rowError:rowError,onToggle:(p,on)=>{setBusyPlan(p.planId),setRowError(null),toggle.run(p,on).then(res=>{setBusyPlan(null),toggle.reset(),res&&res.ok?plans.refresh():res&&setRowError({planId:p.planId,line:refusalLine(copy,res.error)})})},breakBusy:brk.busy,breakError:breakError,onBreak:async which=>{if(!active)return false;setBreakError(null);let res=await brk.run(active,which);return res&&res.ok?(brk.reset(),plans.refresh(),pkg.refresh(),true):(res&&setBreakError(refusalLine(copy,res.error)),false)}}));return{tabs:tabs,view:view}}var addedAddresses=/* @__PURE__ */new WeakMap;function peekAddedAddress(client){return addedAddresses.get(client)??null}function dropAddedAddress(client){addedAddresses.delete(client)}function useAddressStep(then,go){let{copy:copy,client:client}=useShop(),{pkg:pkg}=useShopShared(),back=then??{name:"package"},saved=useRef(null),save=useShopAction(async(keys,input)=>{let sent=JSON.stringify(input),ref=saved.current?.sent===sent?saved.current.ref:null;if(ref===null){let res=await client.addAddress(input);if(!res.ok)return omsErr(res.error);ref=res.value.ref,saved.current={sent:sent,ref:ref}}if(then?.name==="package"||then?.name==="plan"){let page2=await client.plans({limit:100});if(!page2.ok)return omsErr(page2.error);let live=page2.value.plans.filter(p=>p.state!=="cancelled"),shown=then.name==="package"?live.find(p=>p.planId===(pkg.value?.plan.planId??null))??null:live.find(p=>p.state==="active")??live[0]??null,moving=shown?live.filter(p=>p.planId===shown.planId||shown.destination!==null&&p.destination===shown.destination):[];for(let p of moving){if(p.destination===ref)continue;let moved=await client.updatePlan(p.planId,{idempotencyKey:keys.key(`destination:${p.planId}`),destination:ref});if(!moved.ok)return omsErr(moved.error)}}return omsOk(ref)});return{back:{label:copy.backToCare,to:back},busy:save.busy,error:save.error?refusalLine(copy,save.error):null,onSave:input=>{save.run(input).then(res=>{!res||!res.ok||(then?.name==="package"||then?.name==="plan"?pkg.refresh():addedAddresses.set(client,res.value),go(back))})}}}function useCardStep(then,go,handoff){let{copy:copy,client:client,payments:payments}=useShop(),{config:config}=useShopShared(),back=then??{name:"plan"},[error,setError]=useState(()=>peekOrderNotice(client,CARD_PAGE_NOTICE));useEffect(()=>dropOrderNotice(client,CARD_PAGE_NOTICE),[client]);let setup=useShopAction(async()=>{if(handoff){let step3=await handoff();return step3.ok?omsOk(true):(setError(step3.closed?copy.cardStepClosed:step3.message??copy.cardStepFailed),omsOk(false))}let s=await client.setupPaymentMethod();if(!s.ok||!payments)return s.ok?omsErr({kind:"invalidRequest"}):omsErr(s.error);let step2=await payments.confirmCardSetup(s.value.payerAction);return step2.ok?omsOk(true):(setError(step2.closed?copy.cardStepClosed:step2.message??copy.cardStepFailed),omsOk(false))}),on=handoff?true:payments!==null&&config.stripePublishableKey!==null;return{back:{label:copy.backToCare,to:back},error:error??(setup.error?refusalLine(copy,setup.error):null),start:on?{label:copy.cardStart,busyLabel:copy.saving,busy:setup.busy,disabled:setup.busy,onPress:()=>{setError(null),setup.run().then(res=>{res&&res.ok&&res.value&&go(back)})}}:null}}function useNameStep(retry){let{copy:copy,saveProfileName:saveProfileName,onProfileNameRequired:onProfileNameRequired}=useShop(),[open,setOpen]=useState(false),[busy,setBusy]=useState(false),[error,setError]=useState(null),retryRef=useRef(retry);retryRef.current=retry;let running=useRef(false),mounted=useRef(true);return useEffect(()=>(mounted.current=true,()=>{mounted.current=false}),[]),{view:open?{line:copy.nameMissing,form:saveProfileName?{firstLabel:copy.firstName,lastLabel:copy.lastName,saveLabel:copy.saveName,busy:busy,error:error,onSave:name=>{let firstName=name.firstName.trim(),lastName=name.lastName.trim();running.current||!firstName||!lastName||(running.current=true,setBusy(true),setError(null),saveProfileName({firstName:firstName,lastName:lastName}).then(saved=>saved,()=>false).then(saved=>{if(running.current=false,!!mounted.current){if(setBusy(false),!saved){setError(copy.actionFailed);return}setOpen(false),retryRef.current()}}))}}:null,handoff:!saveProfileName&&onProfileNameRequired?{label:copy.addName,onPress:onProfileNameRequired}:null}:null,raise:e=>isNameRequired(e)?(setError(null),setOpen(true),true):false,clear:()=>setOpen(false)}}function useCheckoutBasics(){let addresses=useAddresses(),cards=usePaymentMethods(),address=addresses.value?.find(a=>a.isDefault&&a.isComplete)??addresses.value?.find(a=>a.isComplete)??null,card=pickCard(cards.value,null);return{addresses:addresses,cards:cards,address:address,card:card}}function quoteLine(copy,quote2){return quote2.phase==="unavailable"?copy.actionFailed:quote2.phase==="failed"&"e2.error?refusalLine(copy,quote2.error):null}function useBuyStep(route,go){let{copy:copy,client:client,payments:payments,petName:petName}=useShop(),offer=useOffer(route.offerId),{address:address,card:card}=useCheckoutBasics(),line=useMemo(()=>({offerId:route.offerId,quantity:route.quantity,...route.petId?{petId:route.petId}:{},...route.rxId?{rxId:route.rxId}:{}}),[route.offerId,route.quantity,route.petId,route.rxId]),quote2=useShopRead(address?`quote:${address.ref}:${JSON.stringify(line)}`:null,()=>client.quote({lines:[line],shipTo:address.ref})),[shown,setShown]=useState(null),[error,setError]=useState(null),[placed,setPlaced]=useState(false),buy=useShopAction(async keys=>{let draft=await client.createCheckout({idempotencyKey:keys.key("draft"),lines:[line],shipTo:address.ref});if(!draft.ok)return omsErr(draft.error);if((shown??quote2.value?.total??null)!==draft.value.total)return setShown(draft.value.total),omsErr({kind:"refused",status:409,reasonCode:"price_changed",message:null});let out=await confirmWithPayerActions(idempotencyKey=>client.confirmCheckout(draft.value.checkoutId,{idempotencyKey:idempotencyKey,expectedTotal:draft.value.total,paymentMethodId:card.paymentMethodId}),keys,payments);return out.kind==="failed"?omsErr(out.error):omsOk(out)}),needs=[...address?[]:[{label:copy.addressNeeded,to:{name:"address",then:route}}],...card?[]:[{label:copy.cardTitle,to:{name:"card",then:route}}]],q=quote2.value,total=shown??q?.total??null,placeRef=useRef(()=>{}),name=useNameStep(()=>placeRef.current()),place=()=>{placed||(setError(null),name.clear(),buy.run().then(res=>{if(!res)return;let out=res.ok?res.value:{kind:"failed",error:res.error},orderId=out.kind!=="failed"?out.orderIds[0]:void 0;orderId?(setPlaced(true),leaveOrderNotice(client,orderId,outcomeLine(copy,out)),go({name:"order",orderId:orderId})):out.kind==="failed"&&name.raise(out.error)||setError(outcomeLine(copy,out))}))};return placeRef.current=place,{back:{label:copy.backToShop,to:{name:"product",offerId:route.offerId}},title:copy.confirmTitle,lines:offer.value?[{key:line.offerId,name:offer.value.title,meta:petName(line.petId),price:offer.value.price!==null?formatCents(offer.value.price*line.quantity):null}]:[],sum:q&&total!==null?[{k:copy.shipping,v:q.shipping===0?copy.free:formatCents(q.shipping)},{k:copy.tax,v:formatCents(q.tax)},{k:copy.total,v:formatCents(total)}]:null,needs:needs,pay:address&&card&&q?{label:copy.confirmPay,busyLabel:copy.saving,busy:buy.busy,disabled:buy.busy||placed,onPress:place}:null,note:card?copy.chargedWhenShips(cardLabel(card.brand,card.last4)):null,error:error??quoteLine(copy,quote2),nameStep:name.view}}function useConsentStep(route,go){let{copy:copy,client:client}=useShop(),{config:config,pkg:pkg}=useShopShared(),{address:address,card:card}=useCheckoutBasics(),create=useShopAction(keys=>client.createPlan({idempotencyKey:keys.key("create"),cadenceDays:30,destination:address.ref,paymentMethodId:card.paymentMethodId,consentTermsVersion:config.recurringTermsVersion,lines:[{offerId:route.offerId,quantity:route.quantity,...route.petId?{petId:route.petId}:{},...route.rxId?{rxId:route.rxId}:{}}]})),needs=[...address?[]:[{label:copy.addressNeeded,to:{name:"address",then:route}}],...card?[]:[{label:copy.cardTitle,to:{name:"card",then:route}}]];return{back:{label:copy.backToShop,to:{name:"product",offerId:route.offerId}},terms:config.recurringTermsUrl?{label:copy.consentTermsLink,href:config.recurringTermsUrl}:null,needs:needs,error:create.error?refusalLine(copy,create.error):null,agree:address&&card&&config.recurringTermsVersion?{label:copy.consentAgree,busyLabel:copy.saving,busy:create.busy,disabled:create.busy,onPress:()=>{create.run().then(res=>{res&&res.ok&&(pkg.refresh(),go({name:"plan"}))})}}:null}}var NavContext=createContext({href:()=>"#",go:()=>{}}),ShopNavProvider=NavContext.Provider;function useShopNav(){return useContext(NavContext)}function ShopLink({to:to,className:className,children:children,ariaCurrent:ariaCurrent}){let nav=useShopNav(),onClick=e=>{e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),nav.go(to))};/* @__PURE__ */
|
|
5
|
+
return Object.freeze({ok:false,error:/* @__PURE__ */Object.freeze(error)})}function isOmsRefusal(error,reasonCode){return error.kind==="refused"&&(reasonCode===void 0||error.reasonCode===reasonCode)}function isOmsUnavailable(error){return error.kind==="unavailable"}function isOmsRetryable(error){return error.kind==="network"||error.kind==="timeout"||error.kind==="serviceUnavailable"||error.kind==="refused"&&error.reasonCode==="order_state_conflict"}var REASON=/^[a-z][a-z0-9_]{0,63}$/,MAX_MESSAGE=300;function cleanMessage(raw){if(typeof raw!="string")return null;let text=raw.replace(/[\u0000-\u001f\u007f]+/g," ").trim();return text.length===0||text.length>MAX_MESSAGE?null:text}function retryAfter(header){if(!header)return null;let seconds=Number(header);return Number.isFinite(seconds)&&seconds>=0?Math.min(Math.round(seconds),3600):null}function omsErrorFromStatus(status,body,headers){let requestId=headers.requestId,rid=requestId?{requestId:requestId}:{};if(status===404)return{kind:"unavailable",...rid};if(status===401)return{kind:"signedOut"};if(status===402||status===409||status===422){let envelope=body&&typeof body=="object"?body:{},reason=typeof envelope.reason_code=="string"&&REASON.test(envelope.reason_code)?envelope.reason_code:null;return{kind:"refused",status:status,reasonCode:reason,message:cleanMessage(envelope.message),...rid}}return status===400?{kind:"invalidRequest",...rid}:status===429?{kind:"rateLimited",retryAfterSeconds:retryAfter(headers.retryAfter??null),...rid}:status===503?{kind:"serviceUnavailable",...rid}:status===403?{kind:"unavailable",...rid}:{kind:"serverError",status:status,...rid}}function newIdempotencyKey(){let c=globalThis.crypto;if(c&&typeof c.randomUUID=="function")return c.randomUUID();if(c&&typeof c.getRandomValues=="function"){let b=c.getRandomValues(new Uint8Array(16));b[6]=b[6]&15|64,b[8]=b[8]&63|128;let h=Array.from(b,x=>x.toString(16).padStart(2,"0")).join("");return`${h.slice(0,8)}-${h.slice(8,12)}-${h.slice(12,16)}-${h.slice(16,20)}-${h.slice(20)}`}throw new EverfurConfigError("missing-peer-dependency","No secure random source: cannot make an idempotency key")}var MAX_ROUNDS=3,NAME_REQUIRED_REASONS=["client_name_missing"];function isNameRequired(error){return!!error&&error.kind==="refused"&&!!error.reasonCode&&NAME_REQUIRED_REASONS.includes(error.reasonCode)}var ShopActionKeys=class{constructor(make=newIdempotencyKey){this.make=make;this.keys=/* @__PURE__ */new Map}key(step2){let k=this.keys.get(step2);return k||(k=this.make(),this.keys.set(step2,k)),k}next(step2){let k=this.make();return this.keys.set(step2,k),k}};async function confirmWithPayerActions(confirm,keys,payments,options={reconfirm:true}){let key=keys.key("confirm"),orderIds=[];for(let round=0;round<MAX_ROUNDS;round+=1){let res=await confirm(key);if(!res.ok)return{kind:"failed",error:res.error};orderIds=res.value.resale.map(r=>r.orderId);let pending=res.value.resale.filter(r=>r.outcome==="action_required"&&r.payerAction);if(pending.length===0)return{kind:"confirmed",orderIds:orderIds};if(!payments)return{kind:"needsPayerAction",orderIds:orderIds};if(round===0&&options.beforePayerAction)try{options.beforePayerAction(orderIds)}catch{}for(let entry of pending){let stepResult=await payments.handleNextAction(entry.payerAction,{orderId:entry.orderId});if(!stepResult.ok)return stepResult.closed?{kind:"payerActionClosed",orderIds:orderIds}:{kind:"payerActionFailed",orderIds:orderIds,message:stepResult.message}}if(!options.reconfirm)return{kind:"confirmed",orderIds:orderIds};key=keys.next("confirm")}return{kind:"needsPayerAction",orderIds:orderIds}}function placeholder(key){return`[copy:shop.${key}]`}var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function possessive(name){return`${name}’s`}function listNames(names){return names.length<=1?names[0]??"":`${names.slice(0,-1).join(", ")} and ${names[names.length-1]}`}function asDate(iso){if(!iso)return null;let d=new Date(/^\d{4}-\d{2}-\d{2}$/.test(iso)?`${iso}T00:00:00Z`:iso);return Number.isNaN(d.getTime())?null:d}function formatDay(iso,opts={}){let d=asDate(iso);if(!d)return null;if(opts.when&&d.getUTCFullYear()!==(opts.now??/* @__PURE__ */new Date).getUTCFullYear())return d.toLocaleDateString("en-US",{timeZone:"UTC",month:"short",day:"numeric",year:"numeric"});let weekday=opts.weekday===true||opts.when===true;return d.toLocaleDateString("en-US",{timeZone:"UTC",...weekday?{weekday:"short"}:{},month:"short",day:"numeric"})}function monthOf(iso){let d=asDate(iso);return d?MONTHS[d.getUTCMonth()]:null}function formatCents(cents){let sign=cents<0?"-":"",abs=Math.abs(Math.round(cents));return`${sign}$${Math.floor(abs/100).toLocaleString("en-US")}.${String(abs%100).padStart(2,"0")}`}function cardLabel(brand,last4){return`${brand?brand.charAt(0).toUpperCase()+brand.slice(1):""} ending ${last4}`}var PHARMACY_REFUSAL="We can’t send this prescription to the pharmacy yet. Contact us.",PHARMACY_REFUSALS=["prescription_missing","prescription_reference_missing","prescription_unreadable","prescriptions_disagree","first_fill_mixed_with_refill","duplicate_prescription_line","prescription_in_flight","client_email_missing","client_phone_missing","client_phone_not_us","practice_email_missing","practice_phone_missing","practice_phone_not_us","patient_birth_date_missing","patient_weight_missing","weight_below_partner_unit","species_not_supported","sex_not_supported","refills_over_partner_limit","indications_missing","indication_not_mapped","compounding_missing","compounding_reason_not_mapped","compounding_unexplained","delivery_speed_unavailable","address_missing","address_not_deliverable"],SHOP_COPY={tabsLabel:"Care",tabPackage:"Package",tabShop:"Shop",tabOrders:"Orders",tabPlan:"Plan",legal:"Prescription items need a valid prescription from a licensed vet, and are filled by a licensed partner pharmacy.",legalTracking:"Prescription items are filled by a licensed partner pharmacy.",loadFailed:thing=>`We couldn’t load ${thing}. Check your connection and try again.`,tryAgain:"Try again",actionFailed:"That didn’t go through. Try again.",saving:"Saving…",keepIt:"Keep it",close:"Close",thingPackage:placeholder("thing.package"),thingShop:placeholder("thing.shop"),thingProduct:placeholder("thing.product"),thingPlan:placeholder("thing.plan"),thingOrders:"your orders",thingOrder:"this order",packageTitle:month=>`${month} package`,packageSub:(names,reviewBy,arrives)=>{let s=[];return names.length>0&&s.push(`For ${listNames(names)}.`),reviewBy&&arrives&&s.push(`Approve by ${reviewBy} and it arrives ${arrives}.`),s.length?s.join(" "):null},inThisPackage:"In this package",reviewBy:day=>`Review by ${day}`,forPet:name=>`For ${name}`,details:"Details",remove:"Remove",removed:"Removed.",total:"Total",items:"Items",shipping:"Shipping",tax:"Tax",free:"Free",approveAndShip:"Approve and ship",itemCount:n=>n===1?placeholder("package.item_count_one"):`${n} items`,withTotal:(label,total)=>`${label} · ${total}`,approveRegion:"Approve",packageDetailsRegion:"Package details",deliveryPaymentRegion:"Delivery and payment",questionsRegion:"Questions",approving:"Approving…",skipThisMonth:"Skip this month",chargedWhenShips:card=>`Charged to ${card} when it ships.`,rxCheckedFirst:"Prescriptions are checked with the vet who wrote them first.",delivery:"Delivery",arrives:day=>`Arrives ${day}`,change:"Change",outOfStock:"Out of stock",packageOutOfStock:"Out of stock right now, so it won’t ship this month.",packageEmpty:month=>`Nothing in ${possessive(month)} package yet. Add something from the shop, or skip this month.`,itemNoLongerSold:placeholder("package.item_no_longer_sold"),reviewClosed:placeholder("package.review_closed"),approvalInProgress:placeholder("package.approval_in_progress"),priceChanged:placeholder("package.price_changed"),cardStepFailed:placeholder("package.card_step_failed"),cardStepClosed:placeholder("package.card_step_closed"),noCardOnFile:placeholder("package.no_card_on_file"),shopTitle:"Shop",searchLabel:"Search the shop",searchPlaceholder:"Search the shop…",filtersLabel:"Filter",filterAll:"All",refillSoon:"Refill soon",prescribedFor:names=>`Prescribed for ${listNames(names)}`,inMonthsPackage:month=>`In ${possessive(month)} package →`,forPets:names=>`For ${listNames(names)}`,allProducts:placeholder("shop.all_products_title"),rx:"Rx",hasPrescription:name=>`${name} has a prescription`,needsPrescription:"Needs a prescription",noMatches:q=>`Nothing in the shop matches ‘${q}’.`,nothingHereYet:"Nothing here yet.",photoToCome:"Photo to come",backToShop:"Shop",howOften:"How often",everyMonthIn:name=>`Every month, in ${possessive(name)} package`,skipOrStop:"Skip or stop any month",justOnce:"Just once",shipsWith:month=>`Ships with ${possessive(month)} package`,justOnceShipsNow:placeholder("product.just_once_meta"),oneFewer:"One fewer",oneMore:"One more",quantity:"Quantity",addToPackage:month=>`Add to ${possessive(month)} package`,refillInPackage:month=>`Refill in ${possessive(month)} package`,buyNow:placeholder("product.buy_now"),startPlan:placeholder("product.start_plan"),adding:"Adding…",outOfStockNow:"Out of stock right now.",prescription:"Prescription",noPrescriptionFor:name=>`No prescription for ${name} on file.`,bookVideoVisit:"Book a video visit",refillsLeft:n=>`${n} ${n===1?"refill":"refills"} left`,rxBeingPrepared:"This prescription is being prepared. You can order it soon.",rxTooSoon:placeholder("rx.too_soon"),rxRenew:placeholder("rx.needs_renewal"),rxPick:placeholder("rx.pick_pet"),educational:"Educational, not a diagnosis.",planTitle:"Your plan",whatRepeats:"What repeats",repeatsLabel:title=>`${title} repeats`,cadenceMonths:months=>months===1?"Every month":`Every ${months} months`,cadenceDays:placeholder("plan.cadence_days"),repeatsEmpty:"Nothing repeats yet. Pick Every month when you add something, and it shows up here.",nextPackage:"Next package",reviewByLabel:"Review by",ships:"Ships",reviewMonthsPackage:month=>`Review ${possessive(month)} package →`,deliveryAndPayment:"Delivery and payment",shipTo:"Ship to",payWith:"Pay with",needABreak:"Need a break?",skipMonth:month=>`Skip ${month}`,skipMonthAsk:month=>`Skip ${month}?`,skipMonthBody:"Nothing ships this month.",pausePlan:"Pause the plan",pausePlanAsk:"Pause the plan?",pausePlanBody:"Nothing ships until you turn it back on.",declined:month=>month?`Declined. Update your card so ${possessive(month)} package can ship.`:"Declined.",resumePlan:placeholder("plan.resume"),stopReason:reason=>placeholder(`plan.stop_reason.${reason}`),consentTitle:placeholder("plan.consent_title"),consentBody:placeholder("plan.consent_body"),consentTermsLink:placeholder("plan.consent_terms_link"),consentAgree:placeholder("plan.consent_agree"),ordersTitle:"Orders",ordersSub:names=>`Packages and one-off orders for ${listNames(names)}.`,allOrders:"All orders",placed:day=>`Placed ${day}`,ordersEmpty:"No orders yet. Your first package shows up here once you approve it.",paymentFailed:"Payment failed",backToCare:"Care",onItsWay:title=>`${title}, on its way`,shouldArrive:day=>`It should arrive ${day}.`,whereItStands:"Where it stands",stepApproved:"Approved",stepChecking:"Checking prescriptions…",stepFilled:"Filled by the pharmacy",stepShipped:"Shipped",stepDelivered:"Delivered",now:"Now",expected:day=>`Expected ${day}.`,inTheBox:"In the box",payment:"Payment",cancelOrder:placeholder("order.cancel"),payOrder:placeholder("order.pay"),trackPackage:placeholder("order.track"),orderStatus:{pending_placement:"Confirmed, sending to the pharmacy",placement_unknown:"Confirmed",placed:"With the pharmacy, in review",accepted:"Approved by the pharmacist",release_sent:"Approved, being prepared",release_unknown:"Approved, being prepared",released:"Being prepared",shipped:"Shipped",delivered:"Delivered",needs_support:"We’re looking into this order",rejected:placeholder("order.status.rejected"),cancelled:"Cancelled",pending_handoff:placeholder("order.status.pending_handoff")},addressTitle:placeholder("address.title"),addressLabel:placeholder("address.label"),addressRecipient:placeholder("address.recipient_name"),addressLine1:placeholder("address.line1"),addressLine2:placeholder("address.line2"),addressCity:placeholder("address.city"),addressRegion:placeholder("address.region"),addressPostal:placeholder("address.postal_code"),addressSave:placeholder("address.save"),addressNeeded:placeholder("address.needed"),cardTitle:placeholder("card.title"),cardBody:placeholder("card.body"),cardStart:placeholder("card.start"),cardUnavailable:placeholder("card.unavailable"),confirmTitle:placeholder("buy.confirm_title"),confirmPay:placeholder("buy.confirm_pay"),nameMissing:placeholder("checkout.name_missing"),addName:placeholder("checkout.add_name"),firstName:placeholder("checkout.first_name"),lastName:placeholder("checkout.last_name"),saveName:placeholder("checkout.save_name"),refusal:{operation_not_supported:"This action isn’t available for this order.",order_not_sellable:"We can’t ship this order as it is. Add items or contact us.",rx_being_prepared:"This prescription is being prepared. You can order it soon.",rx_not_dispensable:PHARMACY_REFUSAL,...Object.fromEntries(PHARMACY_REFUSALS.map(code=>[code,PHARMACY_REFUSAL])),order_state_conflict:"This order changed. Refresh and try again.",payment_method_in_use:"A subscription or an order uses this card."},rateLimited:placeholder("error.rate_limited")},SHOP_COPY_PLACEHOLDERS=(()=>{let keys=/* @__PURE__ */new Set,visit=v=>{if(typeof v=="string"){let m=/^\[copy:(shop\.[a-z0-9_.]+)\]$/.exec(v);m&&keys.add(m[1])}else if(typeof v=="function")try{visit(v("x","x","x"))}catch{}else if(v&&typeof v=="object")for(let inner of Object.values(v))visit(inner)};return visit(SHOP_COPY),[...keys].sort()})();function shopCopy(overrides){return overrides?{...SHOP_COPY,...overrides}:SHOP_COPY}function refusalLine(copy,error){if(error.kind==="rateLimited")return copy.rateLimited;if(error.kind==="refused"){if(isNameRequired(error))return copy.nameMissing;let own=error.reasonCode?copy.refusal[error.reasonCode]:void 0;if(own)return own;if(error.message)return error.message}return copy.actionFailed}var UNAVAILABLE_PACKAGE_SOURCE=/* @__PURE__ */Object.freeze({load:()=>Promise.resolve(omsErr({kind:"unavailable"})),removeLine:()=>Promise.resolve(omsErr({kind:"unavailable"})),skip:()=>Promise.resolve(omsErr({kind:"unavailable"})),approve:()=>Promise.resolve({kind:"failed",error:{kind:"unavailable"}})});async function offersFor(client,ids){let unique=[...new Set(ids)],read=await Promise.all(unique.map(id=>client.offer(id)));return new Map(unique.map((id,i)=>[id,read[i].ok?read[i].value:null]))}function createOmsPackageSource(client){async function build(plan,review){let offers=await offersFor(client,review.lines.map(l=>l.offerId)),lines=review.lines.map(l=>({...l,offer:offers.get(l.offerId)??null})),draft=null;if(review.state==="open"&&lines.length>0){let d=await client.draftCycle(plan.planId,review.cycle);if(d.ok)draft=d.value;else if(d.error.kind!=="refused")return omsErr(d.error)}return omsOk({plan:plan,review:review,lines:lines,draft:draft})}return{async load(){let plans=await client.plans();if(!plans.ok)return omsErr(plans.error);let plan=plans.value.plans.find(p=>p.state==="active")??plans.value.plans.find(p=>p.state!=="cancelled");if(!plan)return omsOk(null);let review=await client.cycleReview(plan.planId);return review.ok?build(plan,review.value):omsErr(review.error)},async removeLine(pkg,index,keys){let rest=pkg.lines.filter((_,i)=>i!==index).map(l=>({offerId:l.offerId,quantity:l.quantity,...l.petId?{petId:l.petId}:{}})),edited=await client.editCycle(pkg.plan.planId,pkg.review.cycle,{idempotencyKey:keys.key(`remove:${index}`),lines:rest});return edited.ok?build(pkg.plan,edited.value):omsErr(edited.error)},async skip(pkg,keys){let res=await client.skipCycle(pkg.plan.planId,pkg.review.cycle,{idempotencyKey:keys.key("skip")});return res.ok?omsOk(void 0):omsErr(res.error)},approve(pkg,keys,payments){let draft=pkg.draft;return draft?confirmWithPayerActions(idempotencyKey=>client.approveCycle(pkg.plan.planId,pkg.review.cycle,{idempotencyKey:idempotencyKey,checkoutId:draft.checkoutId,expectedTotal:draft.total}),keys,payments,{reconfirm:false}):Promise.resolve({kind:"failed",error:{kind:"invalidRequest"}})}}}var SHOP_V3_COPY={cartTitle:"Cart",cartLabel:n=>n>0?`Cart, ${n} item${n>1?"s":""}`:"Cart, empty",cartEmptyTitle:"Your cart is empty",cartEmptyBody:null,addToCart:"Add to cart",viewCart:"View cart",addedToCart:name=>`${name} is in your cart.`,removedFromCart:name=>`${name} is out of your cart.`,quantityLabel:name=>`How many: ${name}`,fewer:"One fewer",more:"One more",remove:"Remove",subtotal:"Subtotal",shipping:"Shipping",tax:"Tax",free:"Free",total:"Total",checkoutCart:total=>`Checkout · ${total}`,checkoutKicker:"Checkout",itemQuantity:n=>`Qty ${n}`,shipsTo:"Ships to",payWith:"Pay with",placeOrder:total=>`Place order · ${total}`,chooseAddress:placeholder("checkout.choose_address"),chooseCard:placeholder("checkout.choose_card"),addAddress:placeholder("checkout.add_address"),addCard:placeholder("card.start"),makeDefault:placeholder("address.make_default"),editAddress:placeholder("address.edit"),noAddressYet:placeholder("address.needed"),noCardYet:placeholder("package.no_card_on_file"),placedHeader:"Order placed",placedTitle:"Order placed.",placedSteps:"What's coming",placedShips:"It ships.",placedArrives:"It arrives at home.",viewOrder:"View order",ordersTitle:"Orders",ordersEmptyTitle:"No orders yet",ordersEmptyBody:null,moreOrders:placeholder("orders.more"),subscriptionBox:"Subscription box",orderTitle:n=>n===null?"Order":`Order ${n}`,arrivesBy:day=>`Arrives by ${day}`,deliveredOn:day=>`Delivered ${day}`,expected:day=>`Expected ${day}`,orderSteps:["Ordered","Shipped","Out for delivery","Delivered"],tracking:"Tracking",trackOn:carrier=>`Track on ${carrier}`,inThisOrder:"In this order",orderItemLine:n=>`Qty ${n}`,buyAgain:"Buy again",orderHelp:"Get help with this order",paidWith:"Paid with",refund:placeholder("order.refund"),discount:placeholder("order.discount"),cancelAsk:placeholder("order.cancel_ask"),cancelBody:null,cancelRequested:placeholder("order.cancel_requested"),close:"Close",manageKicker:"Your subscription",manageTitle:name=>`Manage ${name}`,manage:"Manage",shipsEvery:"Ships every",daysChip:n=>`${n} days`,skipNext:"Skip the next box",cancelSubscription:"Cancel subscription",nextBox:day=>`Next box ${day}`,everyDays:n=>`Every ${n} days`,subscribedLine:(n,next)=>next===null?`Every ${n} days`:`Every ${n} days · next box ${next}`,skipped:"Skipped.",cancelSubscriptionAsk:placeholder("plan.cancel_ask"),cancelSubscriptionBody:placeholder("plan.cancel_body")},SHOP_V3_COPY_PLACEHOLDERS=Object.values(SHOP_V3_COPY).filter(v=>typeof v=="string"&&v.startsWith("[copy:"));function shopV3Copy(overrides){if(!overrides)return SHOP_V3_COPY;let own={};for(let[k,v]of Object.entries(overrides))k in SHOP_V3_COPY&&v!==void 0&&(own[k]=v);return{...SHOP_V3_COPY,...own}}var ShopContext=createContext(null);function ShopProvider(props){let{client:client,pets:pets,payments:payments,packageSource:packageSource,copy:copy,v3Copy:v3Copy,saveProfileName:saveProfileName,onProfileNameRequired:onProfileNameRequired,children:children}=props,saveName=useRef(saveProfileName);saveName.current=saveProfileName;let editName=useRef(onProfileNameRequired);editName.current=onProfileNameRequired;let canSave=!!saveProfileName,canEdit=!!onProfileNameRequired,value=useMemo(()=>{let list=pets??[],names=new Map(list.map(p=>[p.petId,p.name]));return{client:client,pets:list,petName:id=>id?names.get(id)??null:null,payments:payments??null,packageSource:packageSource??createOmsPackageSource(client),copy:shopCopy(copy),v3:shopV3Copy(v3Copy),saveProfileName:canSave?name=>saveName.current?saveName.current(name):Promise.resolve(false):null,onProfileNameRequired:canEdit?()=>editName.current?.():null}},[client,pets,payments,packageSource,copy,v3Copy,canSave,canEdit]);return createElement(ShopContext.Provider,{value:value},children)}function useShop(){let ctx=useContext(ShopContext);if(!ctx)throw new EverfurConfigError("not-initialized","useShop: wrap the shop in <ShopProvider>");return ctx}function useShopRead(key,read){let[state,setState]=useState({key:null,phase:"loading",value:null,error:null}),epoch=useRef(0),inflight=useRef(null),readRef=useRef(read);readRef.current=read;let load=useCallback(quiet=>{let mine=++epoch.current;if(key===null)return Promise.resolve();quiet||setState({key:key,phase:"loading",value:null,error:null});let done=readRef.current().then(res=>{if(mine!==epoch.current)return;if(res.ok){setState({key:key,phase:"ready",value:res.value,error:null});return}let next={key:key,phase:res.error.kind==="unavailable"?"unavailable":"failed",value:null,error:res.error};quiet&&next.phase==="failed"?setState(prev=>prev.key===key&&prev.phase==="ready"?prev:next):setState(next)},()=>{});return inflight.current={epoch:mine,done:done},done.then(()=>{inflight.current?.epoch===mine&&(inflight.current=null)}),done},[key]);useEffect(()=>(load(false),()=>{epoch.current+=1}),[load]);let refresh=useCallback(()=>{load(false)},[load]),reread=useCallback(()=>{let running=inflight.current;return running&&running.epoch===epoch.current?running.done:load(true)},[load]);return state.key!==key?{phase:"loading",value:null,error:null,refresh:refresh,reread:reread}:{phase:state.phase,value:state.value,error:state.error,refresh:refresh,reread:reread}}function useShopConfig(){let{client:client}=useShop();return useShopRead("shop-config",()=>client.shopConfig())}function useOffers(query={}){let{client:client}=useShop(),text=query.text?.trim()??"",key=`offers:${text}:${query.requiresRx??""}`;return useShopRead(key,()=>client.offers({...text?{text:text}:{},...query.requiresRx!==void 0?{requiresRx:query.requiresRx}:{},limit:100}))}function useOffer(offerId){let{client:client}=useShop();return useShopRead(offerId?`offer:${offerId}`:null,()=>client.offer(offerId))}function usePrescriptions(){let{client:client}=useShop();return useShopRead("prescriptions",()=>client.prescriptions())}function useAddresses(){let{client:client}=useShop();return useShopRead("addresses",()=>client.addresses())}function useAddress(ref){let{client:client}=useShop();return useShopRead(ref?`address:${ref}`:null,()=>client.address(ref))}function usePaymentMethods(){let{client:client}=useShop();return useShopRead("payment-methods",()=>client.paymentMethods())}function useOrder(orderId){let{client:client}=useShop();return useShopRead(orderId?`order:${orderId}`:null,()=>client.order(orderId))}function usePlans(){let{client:client}=useShop();return useShopRead("plans",()=>client.plans({limit:100}))}function usePackage(){let{packageSource:packageSource}=useShop();return useShopRead("package",()=>packageSource.load())}function useShopAction(act){let[busy,setBusy]=useState(false),[error,setError]=useState(null),keys=useRef(null),running=useRef(false),actRef=useRef(act);actRef.current=act;let mounted=useRef(true);useEffect(()=>(mounted.current=true,()=>{mounted.current=false}),[]);let run=useCallback(async(...args)=>{if(running.current)return null;running.current=true,keys.current??=new ShopActionKeys,setBusy(true),setError(null);try{let res=await actRef.current(keys.current,...args);return res.ok?keys.current=null:isRetryWithSameKey(res.error)||(keys.current=null),mounted.current&&setError(res.ok?null:res.error),res}finally{running.current=false,mounted.current&&setBusy(false)}},[]),reset=useCallback(()=>{keys.current=null,setError(null)},[]);return{busy:busy,error:error,run:run,reset:reset}}function isRetryWithSameKey(error){return error.kind==="network"||error.kind==="timeout"||error.kind==="serviceUnavailable"||error.kind==="serverError"}function distinct(xs){let out=[];for(let x of xs)x!==null&&!out.includes(x)&&out.push(x);return out}var FORMS=[[/\b(inject(ion|able)?|vial|syringe|pen)s?\b/i,"syringe"],[/\b(chew(able)?|soft ?chew|treat)s?\b/i,"bowl"],[/\b(shampoo|spray|ointment|cream|gel|lotion|topical|spot[- ]on|otic|ophthalmic|wipe|foam|mousse|collar)s?\b/i,"shield"],[/\b(solution|suspension|liquid|syrup|elixir|drops?|oral ?paste|paste)s?\b/i,"flask"],[/\b(tablet|caplet|capsule|tab|cap|pill)s?\b/i,"pill"]];function drugFormIcon(title,form){for(let text of[title,form]){if(!text)continue;let hit=FORMS.find(([re])=>re.test(text));if(hit)return hit[1]}return"pill"}function tileFor(rx,title,form){return rx?{tone:"pink",icon:drugFormIcon(title,form)}:{tone:"yellow",icon:"leaf"}}function addressLine(a){return`${a.line2?`${a.line1}, ${a.line2}`:a.line1}, ${a.city}, ${a.region?`${a.region} `:""}${a.postalCode}`}function rxPill(copy){return{label:copy.rx,tone:"rx"}}function refillsLeft(rx){return rx.fillsTotal!==null&&rx.fillsUsed!==null?Math.max(0,rx.fillsTotal-Math.max(rx.fillsUsed,1)):null}function toPackageView(i){let{pkg:pkg,copy:copy,petName:petName}=i,review=pkg.review,month=monthOf(review.shipsOn),names=distinct(pkg.lines.map(l=>petName(l.petId))),open=review.state==="open",priced=new Map(review.quoteLines.map(q=>[`${q.offerId}:${q.petId??""}`,q])),items=pkg.lines.map((line,index)=>{let offer=line.offer,q=priced.get(`${line.offerId}:${line.petId??""}`),rx=offer?.requiresRx??false,pills=[];return offer||pills.push({label:copy.outOfStock,tone:"later"}),{petId:line.petId,view:{key:`${line.offerId}:${line.petId??""}:${index}`,name:offer?.title??copy.itemNoLongerSold,rx:rx,meta:null,alert:offer?null:copy.packageOutOfStock,pills:pills,price:q&&offer?formatCents(q.unitPrice*q.quantity-q.discount):null,...tileFor(rx,offer?.title),details:offer?{label:copy.details,to:{name:"product",offerId:offer.offerId,...line.petId?{petId:line.petId}:{}}}:null,remove:open?{label:copy.remove,busy:i.removing===index,disabled:i.removing!==null,onPress:()=>i.onRemove(index)}:null}}}),groups=[];for(let it of items){let name=petName(it.petId),label=name?copy.forPet(name):null,existing=groups.find(g=>g.label===label);existing?existing.items.push(it.view):groups.push({label:label,items:[it.view]})}let sum=[],d=pkg.draft;d?(sum.push({k:copy.items,v:formatCents(d.total-d.shipping-d.tax)}),sum.push({k:copy.shipping,v:d.shipping===0?copy.free:formatCents(d.shipping)}),sum.push({k:copy.tax,v:formatCents(d.tax)}),sum.push({k:copy.total,v:formatCents(d.total)})):review.quoteLines.length>0&&sum.push({k:copy.items,v:formatCents(review.quoteLines.reduce((n,q)=>n+q.unitPrice*q.quantity-q.discount,0))});let card=i.card?cardLabel(i.card.brand,i.card.last4):null,anyRx=pkg.lines.some(l=>l.offer?.requiresRx),note=card?[copy.chargedWhenShips(card),anyRx?copy.rxCheckedFirst:null].filter(Boolean).join(" "):null,error=i.error;!error&&review.state==="approving"?error=copy.approvalInProgress:!error&&review.state!=="open"&&review.state!==null?error=copy.reviewClosed:!error&&open&&!i.card&&(error=copy.noCardOnFile);let approve=open&&d&&i.card?{label:copy.approveAndShip,busyLabel:copy.approving,busy:i.approving,disabled:i.approving||i.placed===true||i.removing!==null,onPress:i.onApprove}:null;return{title:month?copy.packageTitle(month):copy.tabPackage,sub:copy.packageSub(names,formatDay(review.approveBy,{weekday:true}),null),reviewPill:review.approveBy&&open?copy.reviewBy(formatDay(review.approveBy)):null,countPill:pkg.lines.length>0?copy.itemCount(pkg.lines.length):null,fine:null,groups:pkg.lines.length>0?groups:[],empty:pkg.lines.length===0?{line:month?copy.packageEmpty(month):copy.nothingHereYet,shop:{label:copy.tabShop,to:{name:"shop"}},skip:null}:null,add:null,sum:sum,approve:approve,skip:open?{label:copy.skipThisMonth,to:{name:"plan"}}:null,note:note,error:error,delivery:i.address?[{k:copy.shipTo,v:addressLine(i.address),change:{label:copy.change,to:{name:"address",then:{name:"package"}}}}]:[],legal:copy.legal}}function readyRxFor(offerId,prescriptions){return prescriptions.filter(p=>p.status==="ready"&&p.offerId===offerId)}function toTile(offer,prescriptions,copy,petName,forPetId=null){let pills=[],meta=null,petId=forPetId,holder;return offer.requiresRx&&(pills.push(rxPill(copy)),holder=readyRxFor(offer.offerId,prescriptions).find(p=>petName(p.petId)),petId=holder?.petId??forPetId,meta=holder?copy.hasPrescription(petName(holder.petId)):copy.needsPrescription),{key:offer.offerId,to:{name:"product",offerId:offer.offerId,...petId?{petId:petId}:{}},name:offer.title,meta:meta,price:offer.price!==null?formatCents(offer.price):null,pills:pills,...tileFor(offer.requiresRx,offer.title,holder?.form),imageUrl:offer.imageUrl??null}}function isFirstFill(rx){return rx.fillsUsed===null||rx.fillsUsed===0}function toShelves(i){let{copy:copy}=i,tile=o=>toTile(o,i.prescriptions,copy,i.petName,i.petId??null),shelves=[],byId=/* @__PURE__ */new Map;for(let o of[...i.offers,...i.prescribed??[]])byId.set(o.offerId,o);let first=[],refill=[],firstPets=[];if(!i.searching){let ready=i.prescriptions.filter(p=>p.status==="ready"&&p.offerId!==null&&i.petName(p.petId));for(let offerId of distinct(ready.map(p=>p.offerId))){let o=byId.get(offerId);if(!o||!o.requiresRx)continue;let holders=ready.filter(p=>p.offerId===offerId);if(holders.every(isFirstFill)){first.push(o);for(let p of holders)firstPets.includes(i.petName(p.petId))||firstPets.push(i.petName(p.petId))}else refill.push(o)}}first.length>0&&shelves.push({key:"prescribed",title:copy.prescribedFor(firstPets),link:null,tiles:first.map(tile)}),refill.length>0&&shelves.push({key:"refill",title:copy.refillSoon,link:i.packageMonth?{label:copy.inMonthsPackage(i.packageMonth),to:{name:"package"}}:null,tiles:refill.map(tile)});let above=new Set([...first,...refill].map(o=>o.offerId));return shelves.push({key:"all",title:i.petNames.length>0?copy.forPets(i.petNames):copy.allProducts,link:null,tiles:i.offers.filter(o=>!above.has(o.offerId)).map(tile)}),shelves}function toProductView(i){let{copy:copy,offer:offer}=i,monthly=i.plansOn&&i.petName!==null,choice=monthly?i.choice:"once",submitLabel=choice==="monthly"?i.packageMonth?copy.addToPackage(i.packageMonth):copy.startPlan:copy.buyNow,sellable=offer.price!==null;return{back:{label:copy.backToShop,to:{name:"shop"}},title:offer.title,sub:null,price:sellable?formatCents(offer.price):null,priceUnit:null,...tileFor(false),source:null,stockLine:sellable?null:copy.outOfStockNow,choices:monthly?[{value:"monthly",title:copy.everyMonthIn(i.petName),meta:copy.skipOrStop},{value:"once",title:copy.justOnce,meta:copy.justOnceShipsNow}]:null,choice:monthly?choice:null,onChoice:v=>i.onChoice(v==="once"?"once":"monthly"),quantity:i.quantity,onQuantity:n=>i.onQuantity(Math.min(99,Math.max(1,n))),submit:sellable?{label:submitLabel,busyLabel:copy.adding,busy:i.busy,disabled:i.busy,onPress:i.onSubmit}:{label:copy.outOfStock,disabled:true,onPress:()=>{}},error:i.error,facts:null,cards:[],aside:null,legal:copy.legal}}function toRxProductView(i){let{copy:copy,offer:offer}=i,ready=readyRxFor(offer.offerId,i.prescriptions).filter(p=>i.petName(p.petId)),rx=(i.petId?ready.find(p=>p.petId===i.petId):void 0)??ready[0]??null,sellable=offer.price!==null,script=null,submit=null,form=rx?.form??null;if(rx){let left=refillsLeft(rx);script={name:copy.hasPrescription(i.petName(rx.petId)),meta:left!==null&&left>0?copy.refillsLeft(left):null,directions:null},submit=sellable?{label:i.packageMonth?copy.refillInPackage(i.packageMonth):copy.buyNow,busyLabel:copy.adding,busy:i.busy,disabled:i.busy,onPress:()=>i.onSubmit(rx)}:{label:copy.outOfStock,disabled:true,onPress:()=>{}}}else{let held=i.prescriptions.filter(p=>p.offerId===offer.offerId&&(p.status==="being_prepared"||p.status==="too_soon")&&i.petName(p.petId)),wait=(i.petId?held.find(p=>p.petId===i.petId):void 0)??held[0]??null;if(wait)script={name:copy.hasPrescription(i.petName(wait.petId)),meta:wait.status==="being_prepared"?copy.rxBeingPrepared:copy.rxTooSoon,directions:null},submit=null,form=wait.form;else{let who=(i.petId?i.petName(i.petId):null)??i.firstPetName;script=who?{name:copy.noPrescriptionFor(who),meta:null,directions:null}:null,submit=i.bookVisitHref?{label:copy.bookVideoVisit,href:i.bookVisitHref}:null}}return{back:{label:copy.backToShop,to:{name:"shop"}},stepLabel:copy.prescription,title:offer.title,sub:null,price:sellable?formatCents(offer.price):null,priceUnit:null,...tileFor(true,offer.title,form),script:script,stockLine:sellable?null:copy.outOfStockNow,submit:submit,note:null,error:i.error,cards:[],aside:null,legal:copy.legal}}function cadenceLine(days,copy){let months=Math.round(days/30.4);return months>=1&&Math.abs(days-months*30.4)<=2?copy.cadenceMonths(months):copy.cadenceDays}function toPlanView(i){let{copy:copy}=i,live=i.plans.filter(p=>p.state!=="cancelled"),rows=[];for(let plan of live)plan.lines.forEach((line,n)=>{let offer=i.offers.get(line.offerId)??null,pet=i.petName(line.petId),title=[offer?.title??copy.itemNoLongerSold,pet].filter(Boolean).join(" · "),stop=plan.stopReason,meta=stop==="payment_declined"?copy.declined(i.packageMonth):stop&&stop!=="customer"?copy.stopReason(stop):cadenceLine(plan.cadenceDays,copy);rows.push({key:`${plan.planId}:${n}`,title:title,meta:meta,alert:!!(stop&&stop!=="customer"),on:plan.state==="active",busy:i.busyPlan===plan.planId,onToggle:on=>i.onToggle(plan,on),error:i.rowError&&i.rowError.planId===plan.planId&&n===0?i.rowError.line:null})});let active=live.find(p=>p.state==="active")??null,sum=[],reviewBy=formatDay(i.reviewBy,{weekday:true});reviewBy&&sum.push({k:copy.reviewByLabel,v:reviewBy});let ships=formatDay(active?.nextRun??null,{weekday:true});ships&&sum.push({k:copy.ships,v:ships});let declined=live.some(p=>p.stopReason==="payment_declined"),delivery=[];i.address&&delivery.push({k:copy.shipTo,v:addressLine(i.address),change:{label:copy.change,to:{name:"address",then:{name:"plan"}}}}),i.card&&delivery.push({k:copy.payWith,v:cardLabel(i.card.brand,i.card.last4),alert:declined?copy.declined(i.packageMonth):null,change:{label:copy.change,to:{name:"card",then:{name:"plan"}}}});let month=i.packageMonth??monthOf(active?.nextRun??null);return{sub:null,rows:rows,emptyLine:rows.length===0?copy.repeatsEmpty:null,next:active&&sum.length>0?{sum:sum,link:i.packageMonth?{label:copy.reviewMonthsPackage(i.packageMonth),to:{name:"package"}}:null}:null,delivery:delivery,breakCard:active?{skip:month?{label:copy.skipMonth(month),ask:copy.skipMonthAsk(month),body:copy.skipMonthBody}:null,pause:{label:copy.pausePlan,ask:copy.pausePlanAsk,body:copy.pausePlanBody},busy:i.breakBusy,error:i.breakError,onConfirm:i.onBreak}:null,legal:copy.legal}}var SharedContext=createContext(null),ShopSharedProvider=SharedContext.Provider;function useShopShared(){let s=useContext(SharedContext);if(!s)throw new EverfurConfigError("not-initialized","shop screens render inside EverfurShop");return s}function packageMonth(pkg){return pkg.phase==="ready"&&pkg.value?monthOf(pkg.value.review.shipsOn):null}function loadable(read,map){return read.phase==="ready"&&read.value!==null?{phase:"ready",value:map(read.value)}:read.phase==="loading"?{phase:"loading"}:{phase:"failed",retry:read.refresh}}function pickCard(cards,id){return!cards||cards.length===0?null:(id?cards.find(c=>c.paymentMethodId===id):void 0)??cards[0]??null}function useOffersById(ids){let{client:client}=useShop(),unique=[...new Set(ids)].sort();return useShopRead(`offers-by-id:${unique.join(",")}`,async()=>{let read=await Promise.all(unique.map(id=>client.offer(id)));return omsOk(new Map(unique.map((id,i)=>[id,read[i].ok?read[i].value:null])))})}function outcomeLine(copy,outcome){return outcome.kind==="confirmed"?null:outcome.kind==="needsPayerAction"?copy.cardStepFailed:outcome.kind==="payerActionFailed"?outcome.message??copy.cardStepFailed:outcome.kind==="payerActionClosed"?copy.cardStepClosed:outcome.error.kind==="refused"&&outcome.error.reasonCode==="price_changed"?copy.priceChanged:refusalLine(copy,outcome.error)}var orderNotices=/* @__PURE__ */new WeakMap;function leaveOrderNotice(client,orderId,line){let notices=orderNotices.get(client);notices||(notices=/* @__PURE__ */new Map,orderNotices.set(client,notices)),line?notices.set(orderId,line):notices.delete(orderId)}function peekOrderNotice(client,orderId){return orderNotices.get(client)?.get(orderId)??null}function dropOrderNotice(client,orderId){orderNotices.get(client)?.delete(orderId)}var CARD_PAGE_NOTICE="\0card",takenReturns=/* @__PURE__ */new WeakSet;function takeCardReturn(client,ret,route,copy){if(!ret||takenReturns.has(ret))return false;let key=ret.step==="card"?route.name==="card"?CARD_PAGE_NOTICE:null:route.name==="order"?route.orderId:null;return key===null?false:(takenReturns.add(ret),leaveOrderNotice(client,key,ret.outcome==="closed"?copy.cardStepClosed:ret.outcome==="failed"?copy.cardStepFailed:null),true)}function usePackageScreen(go){let{copy:copy,petName:petName,packageSource:packageSource,payments:payments,client:client}=useShop(),{tabs:tabs,pkg:pkg}=useShopShared(),plan=pkg.phase==="ready"?pkg.value?.plan??null:null,cards=usePaymentMethods(),address=useAddress(plan?.destination??null),[removing,setRemoving]=useState(null),[error,setError]=useState(null),[approving,setApproving]=useState(false),[placed,setPlaced]=useState(false),remove=useShopAction((keys,p,index)=>packageSource.removeLine(p,index,keys));if(pkg.phase==="ready"&&pkg.value===null)return{tabs:tabs,view:{phase:"failed",retry:pkg.refresh}};let view=loadable(pkg,p=>toPackageView({pkg:p,card:pickCard(cards.value,p.plan.paymentMethodId),address:address.value?.address??null,copy:copy,petName:petName,removing:removing,approving:approving,placed:placed,error:error,onRemove:index=>{setRemoving(index),setError(null),remove.run(p,index).then(res=>{setRemoving(null),res&&res.ok?pkg.refresh():res&&setError(refusalLine(copy,res.error))})},onApprove:()=>{approving||placed||(setApproving(true),setError(null),(async()=>{let outcome=await approveOnce(packageSource,p,payments);setApproving(false);let line=outcomeLine(copy,outcome),orderId=outcome.kind!=="failed"?outcome.orderIds[0]:void 0;orderId?(setPlaced(true),leaveOrderNotice(client,orderId,line),go({name:"order",orderId:orderId})):(setError(line),outcome.kind==="failed"&&outcome.error.kind==="refused"&&pkg.refresh())})())}}));return{tabs:tabs,view:view}}var approvalKeys=/* @__PURE__ */new WeakMap;async function approveOnce(source,p,payments){let keys=approvalKeys.get(p);keys||(keys=new ShopActionKeys,approvalKeys.set(p,keys));let out=await source.approve(p,keys,payments);return(out.kind!=="failed"||out.error.kind==="refused")&&approvalKeys.delete(p),out}function useDebounced(value,ms){let[v,setV]=useState(value);return useEffect(()=>{let t=setTimeout(()=>setV(value),ms);return()=>clearTimeout(t)},[value,ms]),v}function useShopScreen(initialQuery){let{client:client,copy:copy,petName:petName,pets:pets}=useShop(),{tabs:tabs,pkg:pkg}=useShopShared(),[query,setQuery]=useState(initialQuery??""),text=useDebounced(query,250),offers=useOffers({text:text}),rx=usePrescriptions(),prescriptions=rx.value??[],names=pets.map(p=>p.name),month=packageMonth(pkg),prescribedIds=prescriptions.filter(p=>p.status==="ready"&&p.offerId!==null&&petName(p.petId)).map(p=>p.offerId),prescribed=useOffersById(prescribedIds),first=offers.phase==="ready"?offers.value??null:null,[laterState,setLater]=useState(null),later=laterState&&first&&laterState.first===first?laterState:null,cursor=later?later.cursor:first?.nextCursor??null,moreBusy=useRef(false),onMore=useCallback(()=>{if(!first||!cursor||moreBusy.current)return;moreBusy.current=true,setLater(l=>({first:first,offers:l&&l.first===first?l.offers:[],cursor:cursor,loading:true,failed:false}));let words=text.trim();client.offers({...words?{text:words}:{},cursor:cursor,limit:100}).then(res=>{moreBusy.current=false,setLater(l=>!l||l.first!==first?l:res.ok?{first:first,offers:[...l.offers,...res.value.offers],cursor:res.value.nextCursor,loading:false,failed:false}:{...l,loading:false,failed:true})})},[client,first,cursor,text]),shelves,prescribedWait=rx.phase==="loading"||prescribedIds.length>0&&prescribed.phase==="loading";if(first&&!prescribedWait){let seen=/* @__PURE__ */new Set,all=[];for(let o of[...first.offers,...later?.offers??[]])seen.has(o.offerId)||(seen.add(o.offerId),all.push(o));shelves={phase:"ready",value:toShelves({offers:all,prescribed:[...prescribed.value?.values()??[]].filter(o=>o!==null),prescriptions:prescriptions,copy:copy,petName:petName,petNames:names,packageMonth:month,searching:text.trim()!=="",petId:pets.length===1?pets[0].petId:null})}}else offers.phase==="loading"||prescribedWait?shelves={phase:"loading"}:offers.phase==="unavailable"?shelves={phase:"ready",value:[]}:shelves={phase:"failed",retry:offers.refresh};let count=shelves.phase==="ready"?shelves.value.reduce((n,s)=>n+s.tiles.length,0):1,empty=shelves.phase==="ready"&&count===0?text.trim()?copy.noMatches(text.trim()):copy.nothingHereYet:null,more=first&&cursor?{onMore:onMore,loading:later?.loading??false,failed:later?.failed??false}:null;return{tabs:tabs,view:{sub:null,query:query,onQuery:setQuery,filters:[],shelves:shelves,empty:empty,legal:copy.legal,more:more}}}function lineFor(offer,quantity,petId,rx){return{offerId:offer.offerId,quantity:rx?.packCount??quantity,...rx?.petId??petId?{petId:rx?.petId??petId}:{},...rx?{rxId:rx.rxId}:{}}}function routeFor(name,line){return{name:name,offerId:line.offerId,quantity:line.quantity,...line.petId?{petId:line.petId}:{},...line.rxId?{rxId:line.rxId}:{}}}function useProductScreen(offerId,petId,go){let{copy:copy,petName:petName,pets:pets,client:client}=useShop(),{config:config,pkg:pkg,bookVisitHref:bookVisitHref}=useShopShared(),offer=useOffer(offerId),rx=usePrescriptions(),[choice,setChoice]=useState("monthly"),[quantity,setQuantity]=useState(1),[error,setError]=useState(null),month=packageMonth(pkg),plans=usePlans(),plan=(pkg.phase==="ready"?pkg.value?.plan??null:null)??plans.value?.plans.find(p=>p.state==="active")??null,addToPlan=useShopAction((keys,p,line)=>client.updatePlan(p.planId,{idempotencyKey:keys.key("add"),lines:[...p.lines.map(l=>({offerId:l.offerId,quantity:l.quantity,...l.petId?{petId:l.petId}:{}})),line]})),submit=(line,monthly)=>{if(setError(null),!monthly)return go(routeFor("buy",line));if(!plan)return go(routeFor("consent",line));addToPlan.run(plan,line).then(res=>{res&&res.ok?(pkg.refresh(),go({name:"package"})):res&&setError(refusalLine(copy,res.error))})};if(offer.phase==="ready"&&offer.value?.requiresRx){let o=offer.value,base={offer:o,copy:copy,petId:petId??null,petName:petName,firstPetName:pets[0]?.name??null,packageMonth:month,error:error,bookVisitHref:bookVisitHref};return rx.phase==="unavailable"?{kind:"rx",view:{phase:"ready",value:toRxProductView({...base,prescriptions:[],busy:false,onSubmit:()=>{}})}}:{kind:"rx",view:loadable(rx,list=>toRxProductView({...base,prescriptions:list,busy:addToPlan.busy,onSubmit:p=>submit(lineFor(o,1,null,p),plan!==null)}))}}let petForChoice=(petId?petName(petId):null)??pets[0]?.name??null;return{kind:"product",view:loadable(offer,o=>toProductView({offer:o,copy:copy,petName:petForChoice,packageMonth:month,plansOn:config.recurringTermsVersion!==null,choice:choice,onChoice:setChoice,quantity:quantity,onQuantity:setQuantity,busy:addToPlan.busy,error:error,onSubmit:()=>submit(lineFor(o,quantity,petId??pets[0]?.petId??null,null),choice==="monthly"&&config.recurringTermsVersion!==null&&petForChoice!==null)}))}}function usePlanScreen(){let{copy:copy,petName:petName,client:client}=useShop(),{tabs:tabs,pkg:pkg}=useShopShared(),plans=usePlans(),cards=usePaymentMethods(),live=(plans.value?.plans??[]).filter(p=>p.state!=="cancelled"),active=live.find(p=>p.state==="active")??live[0]??null,address=useAddress(active?.destination??null),offers=useOffersById(live.flatMap(p=>p.lines.map(l=>l.offerId))),[busyPlan,setBusyPlan]=useState(null),[rowError,setRowError]=useState(null),[breakError,setBreakError]=useState(null),toggle=useShopAction((keys,p,on)=>client.planAction(p.planId,{idempotencyKey:keys.key(on?"resume":"pause"),operation:on?"resume":"pause"})),brk=useShopAction((keys,p,which)=>client.planAction(p.planId,{idempotencyKey:keys.key(which),operation:which})),month=packageMonth(pkg);if(plans.phase==="unavailable")return{tabs:tabs,view:{phase:"failed",retry:plans.refresh}};let view=loadable(plans,()=>toPlanView({plans:live,offers:offers.value??/* @__PURE__ */new Map,copy:copy,petName:petName,card:pickCard(cards.value,active?.paymentMethodId??null),address:address.value?.address??null,reviewBy:pkg.phase==="ready"?pkg.value?.review.approveBy??null:null,packageMonth:month,busyPlan:busyPlan,rowError:rowError,onToggle:(p,on)=>{setBusyPlan(p.planId),setRowError(null),toggle.run(p,on).then(res=>{setBusyPlan(null),toggle.reset(),res&&res.ok?plans.refresh():res&&setRowError({planId:p.planId,line:refusalLine(copy,res.error)})})},breakBusy:brk.busy,breakError:breakError,onBreak:async which=>{if(!active)return false;setBreakError(null);let res=await brk.run(active,which);return res&&res.ok?(brk.reset(),plans.refresh(),pkg.refresh(),true):(res&&setBreakError(refusalLine(copy,res.error)),false)}}));return{tabs:tabs,view:view}}var addedAddresses=/* @__PURE__ */new WeakMap;function peekAddedAddress(client){return addedAddresses.get(client)??null}function dropAddedAddress(client){addedAddresses.delete(client)}function useAddressStep(then,go){let{copy:copy,client:client}=useShop(),{pkg:pkg}=useShopShared(),back=then??{name:"package"},saved=useRef(null),save=useShopAction(async(keys,input)=>{let sent=JSON.stringify(input),ref=saved.current?.sent===sent?saved.current.ref:null;if(ref===null){let res=await client.addAddress(input);if(!res.ok)return omsErr(res.error);ref=res.value.ref,saved.current={sent:sent,ref:ref}}if(then?.name==="package"||then?.name==="plan"){let page2=await client.plans({limit:100});if(!page2.ok)return omsErr(page2.error);let live=page2.value.plans.filter(p=>p.state!=="cancelled"),shown=then.name==="package"?live.find(p=>p.planId===(pkg.value?.plan.planId??null))??null:live.find(p=>p.state==="active")??live[0]??null,moving=shown?live.filter(p=>p.planId===shown.planId||shown.destination!==null&&p.destination===shown.destination):[];for(let p of moving){if(p.destination===ref)continue;let moved=await client.updatePlan(p.planId,{idempotencyKey:keys.key(`destination:${p.planId}`),destination:ref});if(!moved.ok)return omsErr(moved.error)}}return omsOk(ref)});return{back:{label:copy.backToCare,to:back},busy:save.busy,error:save.error?refusalLine(copy,save.error):null,onSave:input=>{save.run(input).then(res=>{!res||!res.ok||(then?.name==="package"||then?.name==="plan"?pkg.refresh():addedAddresses.set(client,res.value),go(back))})}}}function useCardStep(then,go,handoff){let{copy:copy,client:client,payments:payments}=useShop(),{config:config}=useShopShared(),back=then??{name:"plan"},[error,setError]=useState(()=>peekOrderNotice(client,CARD_PAGE_NOTICE));useEffect(()=>dropOrderNotice(client,CARD_PAGE_NOTICE),[client]);let setup=useShopAction(async()=>{if(handoff){let step3=await handoff();return step3.ok?omsOk(true):(setError(step3.closed?copy.cardStepClosed:step3.message??copy.cardStepFailed),omsOk(false))}let s=await client.setupPaymentMethod();if(!s.ok||!payments)return s.ok?omsErr({kind:"invalidRequest"}):omsErr(s.error);let step2=await payments.confirmCardSetup(s.value.payerAction);return step2.ok?omsOk(true):(setError(step2.closed?copy.cardStepClosed:step2.message??copy.cardStepFailed),omsOk(false))}),on=handoff?true:payments!==null&&config.stripePublishableKey!==null;return{back:{label:copy.backToCare,to:back},error:error??(setup.error?refusalLine(copy,setup.error):null),start:on?{label:copy.cardStart,busyLabel:copy.saving,busy:setup.busy,disabled:setup.busy,onPress:()=>{setError(null),setup.run().then(res=>{res&&res.ok&&res.value&&go(back)})}}:null}}function useNameStep(retry){let{copy:copy,saveProfileName:saveProfileName,onProfileNameRequired:onProfileNameRequired}=useShop(),[open,setOpen]=useState(false),[busy,setBusy]=useState(false),[error,setError]=useState(null),retryRef=useRef(retry);retryRef.current=retry;let running=useRef(false),mounted=useRef(true);return useEffect(()=>(mounted.current=true,()=>{mounted.current=false}),[]),{view:open?{line:copy.nameMissing,form:saveProfileName?{firstLabel:copy.firstName,lastLabel:copy.lastName,saveLabel:copy.saveName,busy:busy,error:error,onSave:name=>{let firstName=name.firstName.trim(),lastName=name.lastName.trim();running.current||!firstName||!lastName||(running.current=true,setBusy(true),setError(null),saveProfileName({firstName:firstName,lastName:lastName}).then(saved=>saved,()=>false).then(saved=>{if(running.current=false,!!mounted.current){if(setBusy(false),!saved){setError(copy.actionFailed);return}setOpen(false),retryRef.current()}}))}}:null,handoff:!saveProfileName&&onProfileNameRequired?{label:copy.addName,onPress:onProfileNameRequired}:null}:null,raise:e=>isNameRequired(e)?(setError(null),setOpen(true),true):false,clear:()=>setOpen(false)}}function useCheckoutBasics(){let addresses=useAddresses(),cards=usePaymentMethods(),address=addresses.value?.find(a=>a.isDefault&&a.isComplete)??addresses.value?.find(a=>a.isComplete)??null,card=pickCard(cards.value,null);return{addresses:addresses,cards:cards,address:address,card:card}}function quoteLine(copy,quote2){return quote2.phase==="unavailable"?copy.actionFailed:quote2.phase==="failed"&"e2.error?refusalLine(copy,quote2.error):null}function useBuyStep(route,go){let{copy:copy,client:client,payments:payments,petName:petName}=useShop(),offer=useOffer(route.offerId),{address:address,card:card}=useCheckoutBasics(),line=useMemo(()=>({offerId:route.offerId,quantity:route.quantity,...route.petId?{petId:route.petId}:{},...route.rxId?{rxId:route.rxId}:{}}),[route.offerId,route.quantity,route.petId,route.rxId]),quote2=useShopRead(address?`quote:${address.ref}:${JSON.stringify(line)}`:null,()=>client.quote({lines:[line],shipTo:address.ref})),[shown,setShown]=useState(null),[error,setError]=useState(null),[placed,setPlaced]=useState(false),buy=useShopAction(async keys=>{let draft=await client.createCheckout({idempotencyKey:keys.key("draft"),lines:[line],shipTo:address.ref});if(!draft.ok)return omsErr(draft.error);if((shown??quote2.value?.total??null)!==draft.value.total)return setShown(draft.value.total),omsErr({kind:"refused",status:409,reasonCode:"price_changed",message:null});let out=await confirmWithPayerActions(idempotencyKey=>client.confirmCheckout(draft.value.checkoutId,{idempotencyKey:idempotencyKey,expectedTotal:draft.value.total,paymentMethodId:card.paymentMethodId}),keys,payments);return out.kind==="failed"?omsErr(out.error):omsOk(out)}),needs=[...address?[]:[{label:copy.addressNeeded,to:{name:"address",then:route}}],...card?[]:[{label:copy.cardTitle,to:{name:"card",then:route}}]],q=quote2.value,total=shown??q?.total??null,placeRef=useRef(()=>{}),name=useNameStep(()=>placeRef.current()),place=()=>{placed||(setError(null),name.clear(),buy.run().then(res=>{if(!res)return;let out=res.ok?res.value:{kind:"failed",error:res.error},orderId=out.kind!=="failed"?out.orderIds[0]:void 0;orderId?(setPlaced(true),leaveOrderNotice(client,orderId,outcomeLine(copy,out)),go({name:"order",orderId:orderId})):out.kind==="failed"&&name.raise(out.error)||setError(outcomeLine(copy,out))}))};return placeRef.current=place,{back:{label:copy.backToShop,to:{name:"product",offerId:route.offerId}},title:copy.confirmTitle,lines:offer.value?[{key:line.offerId,name:offer.value.title,meta:petName(line.petId),price:offer.value.price!==null?formatCents(offer.value.price*line.quantity):null}]:[],sum:q&&total!==null?[{k:copy.shipping,v:q.shipping===0?copy.free:formatCents(q.shipping)},{k:copy.tax,v:formatCents(q.tax)},{k:copy.total,v:formatCents(total)}]:null,needs:needs,pay:address&&card&&q?{label:copy.confirmPay,busyLabel:copy.saving,busy:buy.busy,disabled:buy.busy||placed,onPress:place}:null,note:card?copy.chargedWhenShips(cardLabel(card.brand,card.last4)):null,error:error??quoteLine(copy,quote2),nameStep:name.view}}function useConsentStep(route,go){let{copy:copy,client:client}=useShop(),{config:config,pkg:pkg}=useShopShared(),{address:address,card:card}=useCheckoutBasics(),create=useShopAction(keys=>client.createPlan({idempotencyKey:keys.key("create"),cadenceDays:30,destination:address.ref,paymentMethodId:card.paymentMethodId,consentTermsVersion:config.recurringTermsVersion,lines:[{offerId:route.offerId,quantity:route.quantity,...route.petId?{petId:route.petId}:{},...route.rxId?{rxId:route.rxId}:{}}]})),needs=[...address?[]:[{label:copy.addressNeeded,to:{name:"address",then:route}}],...card?[]:[{label:copy.cardTitle,to:{name:"card",then:route}}]];return{back:{label:copy.backToShop,to:{name:"product",offerId:route.offerId}},terms:config.recurringTermsUrl?{label:copy.consentTermsLink,href:config.recurringTermsUrl}:null,needs:needs,error:create.error?refusalLine(copy,create.error):null,agree:address&&card&&config.recurringTermsVersion?{label:copy.consentAgree,busyLabel:copy.saving,busy:create.busy,disabled:create.busy,onPress:()=>{create.run().then(res=>{res&&res.ok&&(pkg.refresh(),go({name:"plan"}))})}}:null}}var NavContext=createContext({href:()=>"#",go:()=>{}}),ShopNavProvider=NavContext.Provider;function useShopNav(){return useContext(NavContext)}function ShopLink({to:to,className:className,children:children,ariaCurrent:ariaCurrent}){let nav=useShopNav(),onClick=e=>{e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),nav.go(to))};/* @__PURE__ */
|
|
6
6
|
return jsx("a",{className:className,href:nav.href(to),onClick:onClick,"aria-current":ariaCurrent,children:children})}var US_STATES=["AL","AK","AZ","AR","CA","CO","CT","DE","DC","FL","GA","HI","ID","IL","IN","IA","KS","KY","LA","ME","MD","MA","MI","MN","MS","MO","MT","NE","NV","NH","NJ","NM","NY","NC","ND","OH","OK","OR","PA","RI","SC","SD","TN","TX","UT","VT","VA","WA","WV","WI","WY","AS","GU","MP","PR","VI","AA","AE","AP"],US_ZIP=/^\d{5}(-\d{4})?$/;function isUsState(region){return US_STATES.includes(region.trim().toUpperCase())}var SHOP_KIT_CSS=':host{--ef-dark-green:#10462E;--ef-white:#FFFFFF;--ef-black:#000000;--ef-dusty-pink:#FFC3BC;--ef-bright-green:#07C168;--ef-yellow:#F2C763;--ef-dusty-blue:#A8B9DA;--ef-sky-blue:#4E98C9;--ef-charcoal:#3D3D3D;--ef-red-deep:#6D1D14;--ef-red-bright:#C03410;--bg:var(--ef-white);--bg-brand:var(--ef-dark-green);--bg-accent:var(--ef-dusty-pink);--bg-accent-b2b:var(--ef-dusty-blue);--bg-warm:var(--ef-yellow);--text:var(--ef-black);--text-brand:var(--ef-dark-green);--text-on-brand:var(--ef-white);--text-cta:var(--ef-bright-green);--text-muted:#6B6B6B;--bg-mist:#F1F5F2;--border:#E4E4E4;--border-strong:var(--ef-charcoal);--alert:var(--ef-red-bright);--alert-deep:var(--ef-red-deep);--btn-primary-bg:var(--ef-dark-green);--btn-primary-text:var(--ef-white);--btn-secondary-bg:transparent;--btn-secondary-text:var(--ef-dark-green);--btn-secondary-border:var(--ef-dark-green);--font:"Azeret", "Helvetica Neue", Arial, sans-serif;--font-mono:"Azeret Mono", ui-monospace, "SF Mono", Menlo, monospace;--fs-xs:13px;--fs-sm:15px;--fs-md:17px;--fs-lg:20px;--fs-xl:24px;--fs-2xl:32px;--fs-3xl:40px;--fs-4xl:56px;--lh-body:1.55;--lh-display:1.15;--fw-regular:400;--fw-medium:500;--fw-bold:700;--sp-1:4px;--sp-2:8px;--sp-3:12px;--sp-4:16px;--sp-5:24px;--sp-6:32px;--sp-7:48px;--sp-8:64px;--sp-9:96px;--radius-sm:6px;--radius-md:10px;--radius-lg:20px;--radius-xl:28px;--radius-pill:999px;--shadow-sm:0 1px 2px rgba(16, 70, 46, 0.06);--shadow-md:0 4px 16px rgba(16, 70, 46, 0.08);--container:1200px;--container-narrow:720px}:host{font-family:var(--font);color:var(--text);background:var(--bg)}:host{font-size:var(--fs-md);line-height:var(--lh-body);margin:0}h1,h2,h3,h4{color:var(--text-brand);line-height:var(--lh-display);font-weight:var(--fw-bold)}h1{font-size:var(--fs-3xl)}h2{font-size:var(--fs-2xl)}h3{font-size:var(--fs-xl)}small{font-size:var(--fs-xs);color:var(--text-muted)}:host{--ink:var(--ef-dark-green);--go:var(--ef-bright-green);--muted:var(--text-muted);--line:var(--border);--pink-50:color-mix(in srgb, var(--ef-dusty-pink) 50%, var(--ef-white));--ease-out:cubic-bezier(0.23, 1, 0.32, 1);--max:1440px;--gutter:clamp(20px, 5vw, 72px);--edge:max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter)));--pad-75:clamp(48px, 5.2vw, 75px);--pad-90:clamp(56px, 6.25vw, 90px);color-scheme:light}*,*::before,*::after{box-sizing:border-box}:host{scroll-padding-top:86px;scroll-behavior:smooth;-webkit-text-size-adjust:100%}:host{margin:0;font-family:var(--font);font-size:var(--fs-md);line-height:var(--lh-body);color:var(--text);background:var(--bg);-webkit-font-smoothing:antialiased}img{display:block;max-width:100%}a{color:inherit}a,button,summary{-webkit-tap-highlight-color:color-mix(in srgb, var(--ink) 12%, transparent)}p,h1,h2,h3,ul,ol,figure{margin:0}h1,h2,h3{color:var(--ink);font-weight:var(--fw-medium)}:focus-visible{outline:3px solid var(--ink);outline-offset:3px}.visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}.skip{position:absolute;left:var(--sp-4);top:-100px;z-index:60;padding:var(--sp-3) var(--sp-4);background:var(--ink);color:var(--ef-white);border-radius:var(--radius-pill);text-decoration:none}.skip:focus{top:var(--sp-4)}.copy{display:grid;gap:var(--sp-4);font-size:clamp(17px, 1.25vw, 18px);line-height:1.55}.label{font-family:var(--font-mono);font-weight:var(--fw-bold);font-size:13px;line-height:1.4;letter-spacing:0.08em;text-transform:uppercase}.btn{display:inline-flex;align-items:center;justify-content:center;gap:var(--sp-2);border-radius:var(--radius-pill);border:0 solid var(--ink);font:inherit;text-decoration:none;white-space:nowrap;cursor:pointer;touch-action:manipulation;transition:background-color 180ms ease, color 180ms ease, transform 160ms var(--ease-out)}.btn:active{transform:scale(0.97)}.btn--ink{min-height:52px;padding:0 var(--sp-5);background:var(--ink);color:var(--ef-white);border:1.5px solid var(--ef-white);font-size:var(--fs-md);font-weight:var(--fw-bold);line-height:1}.btn--outline{min-height:52px;padding:0 var(--sp-5);background:transparent;color:var(--ink);border-width:1.5px;font-size:var(--fs-md);line-height:1}@media (hover: hover) and (pointer: fine){.btn--ink:hover{background:color-mix(in srgb, var(--ink) 86%, var(--ef-black))}.btn--outline:hover{background:color-mix(in srgb, var(--ink) 6%, var(--ef-white))}}@media (max-width: 479px){.btn{white-space:normal;text-align:center}}@media (prefers-reduced-motion: reduce){:host{scroll-behavior:auto}.btn{transition:none}.btn:active{transform:none}}:host{--side-w:248px;--top-h:72px;--gap:32px;--card-pad:24px;--tint-sage:color-mix(in srgb, var(--ef-dark-green) 5%, var(--bg-mist));--tint-pink:color-mix(in srgb, var(--ef-dusty-pink) 35%, var(--ef-white));--tint-pink-soft:color-mix(in srgb, var(--ef-dusty-pink) 15%, var(--ef-white));--tint-blue:color-mix(in srgb, var(--ef-dusty-blue) 24%, var(--ef-white));--tint-yellow:color-mix(in srgb, var(--ef-yellow) 26%, var(--ef-white));--tint-yellow-edge:color-mix(in srgb, var(--ef-yellow) 70%, var(--ef-white));--tint-red:color-mix(in srgb, var(--ef-red-bright) 7%, var(--ef-white));--tint-go:color-mix(in srgb, var(--ef-bright-green) 14%, var(--ef-white));--ico-grey:var(--text-muted);--ico-sage:color-mix(in srgb, var(--ef-dark-green) 50%, var(--bg-mist));--ico-blue:var(--ef-sky-blue)}.ico{display:block;flex:none;width:24px;height:24px}.side{position:sticky;top:calc(var(--top-h) + var(--sp-5));display:flex;flex-direction:column;gap:var(--sp-1);height:calc(100svh - var(--top-h) - var(--sp-5) * 2);min-height:420px;overflow-y:auto;padding:var(--sp-3);background:var(--ef-white);border:1px solid var(--line);border-radius:var(--radius-lg);scrollbar-width:thin}.pets{display:flex;gap:var(--sp-1);margin:0 0 var(--sp-3);padding:var(--sp-1) 0 var(--sp-3);list-style:none;overflow-x:auto;scrollbar-width:none}.pets::-webkit-scrollbar{display:none}.pets a{display:grid;justify-items:center;gap:6px;width:60px;padding:6px 0;border-radius:var(--radius-md);color:var(--ink);font-size:13px;line-height:1.2;text-decoration:none}.pets img{width:48px;height:48px;border-radius:50%;outline:2px solid transparent;outline-offset:2px;transition:outline-color 150ms ease}.pets img{object-fit:cover;background:var(--ef-white);box-shadow:inset 0 0 0 1px var(--line)}.pets a[aria-current] img{outline-color:var(--go)}.pets a[aria-current] span{font-weight:var(--fw-bold)}@media (hover: hover) and (pointer: fine){.pets a:not([aria-current]):hover img{outline-color:var(--ico-sage)}}.pets a:focus-visible{outline-offset:0}.page{min-width:0;padding-top:var(--sp-2)}.page-head{display:flex;align-items:center;min-height:44px}.page-title{font-size:clamp(28px, 2.5vw, 36px);line-height:1.15;letter-spacing:-0.02em;text-wrap:balance}.card{padding:var(--card-pad);background:var(--ef-white);border:1px solid var(--line);border-radius:var(--radius-lg)}.card__head{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:var(--sp-2) var(--sp-4);margin-bottom:var(--sp-4)}.card__title{font-weight:var(--fw-bold);font-size:var(--fs-lg);line-height:1.25;letter-spacing:-0.02em}.card__link{font-weight:var(--fw-bold);font-size:var(--fs-sm);line-height:1.4;color:var(--ink);text-decoration:none;white-space:nowrap}.card__link:hover{text-decoration:underline;text-underline-offset:3px}button.card__link{padding:0;border:0;background:none;font-family:inherit;cursor:pointer}.pill{display:inline-flex;align-items:center;min-height:24px;padding:0 10px;border-radius:var(--radius-pill);font-family:var(--font-mono);font-weight:var(--fw-bold);font-size:12px;line-height:1;letter-spacing:0.06em;text-transform:uppercase;white-space:nowrap}.pill--stable{background:var(--tint-go);color:var(--ink)}.pill--overdue{background:var(--ef-white);color:var(--alert);box-shadow:inset 0 0 0 1.25px var(--alert)}.pill--soon{background:var(--ef-white);color:var(--ink);box-shadow:inset 0 0 0 1.25px var(--tint-yellow-edge)}.pill--later{background:var(--ef-white);color:var(--muted);box-shadow:inset 0 0 0 1.25px var(--line)}.pill--clear{background:var(--ef-white);color:var(--go);box-shadow:inset 0 0 0 1.5px var(--go)}.pill--plain{background:var(--ef-white);color:var(--ink);box-shadow:inset 0 0 0 1.5px color-mix(in srgb, var(--ink) 20%, transparent)}.btn--sm{min-height:46px;padding:0 var(--sp-4);font-size:var(--fs-sm)}.btn--sm .ico{width:20px;height:20px}.btn--ink{border-color:var(--ink)}.btn--row{min-height:36px;padding:0 14px;font-size:14px}.btn--row .ico{width:17px;height:17px}.add{flex:1;display:flex;flex-direction:column;gap:var(--sp-3)}.add p{font-size:var(--fs-sm);line-height:1.5}.add .btn{width:100%}.legal{margin-top:var(--sp-7);font-size:13px;line-height:1.6;color:var(--muted);text-align:center}@media (max-width: 1279px){:host{--side-w:220px;--gap:24px}}@media (max-width: 899px){.side{display:none;position:fixed;z-index:40;top:calc(var(--top-h) + var(--sp-2));left:var(--sp-3);right:var(--sp-3);height:auto;max-height:calc(100svh - var(--top-h) - var(--sp-5));min-height:0}.page-head{flex-direction:column;align-items:flex-start}}@media (max-width: 559px){:host{--card-pad:18px}}[hidden]{display:none !important}.page-head--sub{flex-direction:column;align-items:flex-start}.back{display:inline-flex;align-items:center;gap:6px;margin-bottom:var(--sp-2);font-weight:var(--fw-bold);font-size:var(--fs-sm);line-height:1.4;color:var(--ink);text-decoration:none}.back .ico{width:18px;height:18px}@media (hover: hover) and (pointer: fine){.back:hover{text-decoration:underline;text-underline-offset:3px}}.page-sub{max-width:760px;margin-top:var(--sp-2);font-size:var(--fs-md);line-height:1.5;color:var(--text);text-wrap:pretty}.step-label{margin-bottom:var(--sp-1);font-family:var(--font-mono);font-weight:var(--fw-bold);font-size:12px;line-height:1.4;letter-spacing:0.06em;text-transform:uppercase;color:var(--muted)}.sub{display:grid;grid-template-columns:minmax(0, 1.35fr) minmax(0, 1fr);align-items:start;gap:var(--sp-5);margin-top:var(--sp-6)}.sub__main,.sub__aside{display:grid;gap:var(--sp-5);min-width:0}.sub__main > *,.sub__aside > *{min-width:0}.card > .card__title{margin-bottom:var(--sp-4)}.card__lead{margin-bottom:var(--sp-4);font-size:var(--fs-sm);line-height:1.5}.note{font-size:13px;line-height:1.5;color:var(--muted)}.facts{display:grid;grid-template-columns:repeat(4, minmax(0, 1fr));gap:var(--sp-3);margin:0;padding:0;list-style:none}.facts li{display:grid;align-content:start;gap:4px;padding:var(--sp-4);border-radius:var(--radius-md);background:var(--tint-sage)}.facts__k{font-size:13px;line-height:1.4;color:var(--muted)}.facts b{white-space:nowrap;font-variant-numeric:tabular-nums;font-size:var(--fs-xl);line-height:1.1;letter-spacing:-0.02em;color:var(--ink)}.facts small{font-weight:var(--fw-medium);font-size:13px;color:var(--muted)}.field{display:grid;gap:6px}.field__label{font-weight:var(--fw-bold);font-size:var(--fs-sm);line-height:1.4;color:var(--ink)}.input{display:flex;align-items:center;gap:10px;min-height:52px;padding:0 var(--sp-4);border:1.5px solid var(--line);border-radius:var(--radius-md);background:var(--ef-white)}.input:focus-within{border-color:var(--ink)}.input .ico{width:20px;height:20px;color:var(--muted)}.input input{flex:1;width:0;min-width:0;border:0;outline:0;background:transparent;font:inherit;font-size:var(--fs-md);color:var(--text)}.choices{display:grid;gap:var(--sp-2);min-width:0;margin:0;padding:0;border:0;list-style:none}.choice{position:relative;display:grid;grid-template-columns:22px minmax(0, 1fr) auto;align-items:center;gap:var(--sp-3);padding:14px var(--sp-4);border:1.5px solid var(--line);border-radius:var(--radius-md);background:var(--ef-white);cursor:pointer}.choice,.check,.sheet__close{touch-action:manipulation;-webkit-tap-highlight-color:color-mix(in srgb, var(--ink) 12%, transparent)}@media (hover: hover) and (pointer: fine){.choice:not(:has(input:checked)):hover{border-color:color-mix(in srgb, var(--ink) 45%, var(--line))}.sheet__close:hover{background:color-mix(in srgb, var(--tint-sage) 70%, var(--ico-sage) 30%)}}.choice:has(input:checked){border-color:var(--ink);background:var(--tint-pink)}.choice input{appearance:none;width:20px;height:20px;margin:0;border:1.5px solid var(--ico-sage);border-radius:50%;background:var(--ef-white);cursor:pointer}.choice input:checked{border:6px solid var(--ink)}.choice input:focus-visible,.check input:focus-visible{outline:3px solid var(--ink);outline-offset:2px}.choice__title{font-weight:var(--fw-bold);font-size:var(--fs-md);line-height:1.3;color:var(--ink)}.choice__meta{display:block;margin-top:2px;font-size:13px;line-height:1.4;color:var(--muted)}.check{display:grid;grid-template-columns:22px minmax(0, 1fr);align-items:start;gap:var(--sp-3);font-size:var(--fs-sm);line-height:1.5;cursor:pointer}.check input{appearance:none;display:grid;place-content:center;width:20px;height:20px;margin:1px 0 0;border:1.5px solid var(--ico-sage);border-radius:var(--radius-sm);background:var(--ef-white);cursor:pointer}.check input::after{content:"";width:5px;height:10px;border:solid var(--ef-white);border-width:0 2px 2px 0;rotate:45deg;translate:0 -1px;opacity:0}.check input:checked{border-color:var(--ink);background:var(--ink)}.check input:checked::after{opacity:1}.actions{display:flex;flex-wrap:wrap;align-items:center;gap:var(--sp-3) var(--sp-5)}.source{display:flex;align-items:flex-start;gap:var(--sp-2);font-size:13px;line-height:1.5;color:var(--muted)}.source .ico{flex:none;width:16px;height:16px;margin-top:2px;color:var(--ico-sage)}.source :is(a, button){padding:0;border:0;background:none;font:inherit;font-weight:var(--fw-bold);color:var(--ink);text-decoration:underline;text-underline-offset:3px;cursor:pointer}.btn--ask .ico{width:24px;height:24px}.sub__aside .btn{width:100%}.ghost{display:grid;gap:10px;margin-top:var(--sp-4)}.ghost span{height:12px;border-radius:var(--radius-pill);background:var(--tint-sage)}.ghost span:nth-child(2){width:82%}.ghost span:nth-child(3){width:64%}.sheet{overscroll-behavior:contain;width:min(560px, calc(100vw - 32px));max-height:calc(100svh - 48px);padding:0;border:1px solid var(--line);border-radius:var(--radius-lg);color:var(--text)}.sheet::backdrop{background:color-mix(in srgb, var(--ef-black) 35%, transparent)}.sheet__head{display:flex;align-items:center;justify-content:space-between;gap:var(--sp-3);padding:var(--sp-5) var(--sp-5) var(--sp-3)}.sheet__close{display:grid;place-items:center;width:40px;height:40px;border:0;border-radius:50%;background:var(--tint-sage);color:var(--ink);cursor:pointer}.sheet__close .ico{width:20px;height:20px}.sheet__body{display:grid;gap:var(--sp-4);padding:0 var(--sp-5) var(--sp-5)}.note .card__link{white-space:normal}@media (max-width: 1279px){.sub{grid-template-columns:minmax(0, 1fr)}}@media (max-width: 559px){.facts{grid-template-columns:repeat(2, minmax(0, 1fr))}}.input select{flex:1;width:0;min-width:0;min-height:48px;border:0;outline:0;background:transparent;font:inherit;font-size:var(--fs-md);color:var(--text);cursor:pointer}.icon-btn{display:grid;place-items:center;width:44px;height:44px;padding:0;border:0;border-radius:50%;background:transparent;color:var(--ink);cursor:pointer;touch-action:manipulation;transition:background-color 150ms ease, transform 160ms var(--ease-out)}.icon-btn .ico{width:22px;height:22px}.icon-btn:active{transform:scale(0.94)}.icon-btn:disabled{color:var(--line);cursor:default}@media (hover: hover) and (pointer: fine){.icon-btn:not(:disabled):hover{background:var(--tint-sage)}}.sum{margin:0;padding:0 var(--sp-5);border:1px solid var(--line);border-radius:var(--radius-lg);background:var(--ef-white)}.sum > div{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:2px var(--sp-4);padding:14px 0;border-bottom:1px solid var(--line)}.sum > div:last-child{border-bottom:0}.sum dt{font-size:var(--fs-sm);color:var(--muted)}.sum dd{margin:0 0 0 auto;font-weight:var(--fw-bold);font-size:var(--fs-sm);line-height:1.4;color:var(--ink);text-align:right}.sum--total > div:last-child dd{font-size:var(--fs-lg)}.av{flex:none;width:48px;height:48px;border-radius:50%;object-fit:cover;background:var(--ef-white);box-shadow:inset 0 0 0 1px var(--line)}.av--sm{width:36px;height:36px}.person{display:grid;grid-template-columns:auto minmax(0, 1fr) auto;align-items:center;gap:var(--sp-3) var(--sp-4)}.person__name{font-weight:var(--fw-bold);font-size:var(--fs-md);line-height:1.3;color:var(--ink)}.person__meta{font-size:13px;line-height:1.45;color:var(--muted)}.member{display:grid;gap:var(--sp-3)}.member .card__head{margin-bottom:0}.ask{display:grid;grid-template-columns:minmax(0, 1fr) 300px;align-items:start;gap:var(--sp-6)}.thumb{display:grid;place-items:center;flex:none;width:64px;height:64px;border-radius:var(--radius-md);background:var(--tint-blue);color:var(--ink)}.thumb .ico{width:26px;height:26px}.thumb--sage{background:var(--tint-sage)}.thumb--pink{background:var(--tint-pink)}.thumb--yellow{background:var(--tint-yellow)}.items{display:grid;margin:0;padding:0;list-style:none}.items > li{display:grid;grid-template-columns:64px minmax(0, 1fr) auto;align-items:center;gap:var(--sp-3) var(--sp-4);padding:var(--sp-4) 0;border-top:1px solid var(--line)}.items > li:first-child{padding-top:0;border-top:0}.items > li:last-child{padding-bottom:0}.items__name{display:flex;flex-wrap:wrap;align-items:center;gap:4px var(--sp-2);font-weight:var(--fw-bold);font-size:var(--fs-md);line-height:1.3;color:var(--ink)}.items__meta{margin-top:2px;font-size:13px;line-height:1.45;color:var(--muted)}.items__end{display:grid;justify-items:end;gap:4px;text-align:right;font-variant-numeric:tabular-nums}.items__price{font-weight:var(--fw-bold);font-size:var(--fs-md);color:var(--ink)}.pill--rx{background:var(--tint-blue);color:var(--ink)}.prods{display:grid;grid-template-columns:repeat(auto-fill, minmax(232px, 1fr));gap:var(--sp-4);margin:0;padding:0;list-style:none}.prod{position:relative;display:grid;grid-template-rows:auto 1fr;gap:var(--sp-3);height:100%;color:inherit;text-decoration:none}.prod__img{display:grid;place-items:center;aspect-ratio:1;border-radius:var(--radius-lg);background:var(--tint-blue);color:var(--ink);transition:box-shadow 150ms ease}.prod__img .ico{width:44px;height:44px}.prod__img--sage{background:var(--tint-sage)}.prod__img--pink{background:var(--tint-pink)}.prod__img--yellow{background:var(--tint-yellow)}@media (hover: hover) and (pointer: fine){.prod:hover .prod__img{box-shadow:inset 0 0 0 1.5px var(--ink)}}.prod__body{display:grid;align-content:start;gap:4px}.prod__name{font-weight:var(--fw-bold);font-size:var(--fs-md);line-height:1.3;color:var(--ink)}.prod__meta{font-size:13px;line-height:1.45;color:var(--muted)}.prod__price{display:flex;flex-wrap:wrap;align-items:center;gap:var(--sp-2);margin-top:4px;font-weight:var(--fw-bold);font-size:var(--fs-md);color:var(--ink);font-variant-numeric:tabular-nums}.prod__tags{position:absolute;top:var(--sp-3);left:var(--sp-3);display:flex;flex-wrap:wrap;gap:6px}.tabs{display:flex;gap:var(--sp-2);max-width:100%;min-width:0;margin:0;padding:0 0 2px;list-style:none;overflow-x:auto;scrollbar-width:none}.tabs::-webkit-scrollbar{display:none}.tabs a{display:inline-flex;align-items:center;min-height:40px;padding:0 var(--sp-4);border:1px solid var(--line);border-radius:var(--radius-pill);color:var(--ink);font-size:var(--fs-sm);line-height:1.2;text-decoration:none;white-space:nowrap}.tabs a[aria-current]{border-color:var(--ink);background:var(--tint-pink);font-weight:var(--fw-bold)}@media (hover: hover) and (pointer: fine){.tabs a:not([aria-current]):hover{border-color:color-mix(in srgb, var(--ink) 45%, var(--line))}}.qty{display:inline-flex;align-items:center;border:1px solid var(--line);border-radius:var(--radius-pill)}.qty .icon-btn{width:40px;height:40px}.qty .icon-btn .ico{width:18px;height:18px}.qty output{min-width:28px;text-align:center;font-weight:var(--fw-bold);font-variant-numeric:tabular-nums}.rows{display:grid;margin:0;padding:0;list-style:none}.rows > li{display:grid;grid-template-columns:minmax(0, 1fr) auto;align-items:center;gap:var(--sp-2) var(--sp-4);padding:var(--sp-4) 0;border-top:1px solid var(--line)}.rows > li:first-child{padding-top:0;border-top:0}.rows > li:last-child{padding-bottom:0}.rows__k{font-weight:var(--fw-bold);font-size:var(--fs-md);line-height:1.3;color:var(--ink)}.rows__v{margin-top:2px;font-size:var(--fs-sm);line-height:1.45;overflow-wrap:anywhere}.rows__meta{margin-top:2px;font-size:13px;line-height:1.45;color:var(--muted)}.switch{position:relative;display:inline-flex;flex:none;cursor:pointer}.switch input{appearance:none;width:48px;height:28px;margin:0;border-radius:var(--radius-pill);background:color-mix(in srgb, var(--line) 80%, var(--ico-sage));cursor:pointer;transition:background-color 150ms ease}.switch::after{content:"";position:absolute;top:3px;left:3px;width:22px;height:22px;border-radius:50%;background:var(--ef-white);box-shadow:var(--shadow-sm);pointer-events:none;transition:translate 200ms var(--ease-out)}.switch:has(input:checked) input{background:var(--ink)}.switch:has(input:checked)::after{translate:20px 0}.switch input:focus-visible{outline:3px solid var(--ink);outline-offset:2px}.btn--danger{min-height:46px;padding:0 var(--sp-4);border:1.5px solid var(--alert);background:var(--ef-white);color:var(--alert);font-size:var(--fs-sm);font-weight:var(--fw-bold)}@media (hover: hover) and (pointer: fine){.btn--danger:hover{background:var(--tint-red)}}.link-danger{padding:0;border:0;background:none;color:var(--alert);font:inherit;font-weight:var(--fw-bold);font-size:var(--fs-sm);text-decoration:underline;text-underline-offset:3px;cursor:pointer}@media (hover: hover) and (pointer: fine){.link-danger:hover{color:var(--alert-deep);text-decoration-thickness:2px}}.card[id]{scroll-margin-top:calc(var(--top-h) + var(--sp-4))}@media (max-width: 1279px){.ask{grid-template-columns:minmax(0, 1fr)}}@media (max-width: 559px){.items > li{grid-template-columns:56px minmax(0, 1fr)}.items .thumb{width:56px;height:56px}.items__end{grid-column:2;justify-items:start;text-align:left}.prods{grid-template-columns:repeat(2, minmax(0, 1fr));gap:var(--sp-3)}.prod__img .ico{width:34px;height:34px}}@media (prefers-reduced-motion: reduce){.switch::after,.icon-btn{transition:none}}:host{--ico-warm:color-mix(in srgb, color-mix(in srgb, var(--ef-yellow) 18%, var(--ef-white)) 80%, var(--ef-charcoal));--ico-amber:color-mix(in srgb, var(--ef-yellow) 55%, var(--ef-red-deep));--amber-text:color-mix(in srgb, var(--ef-yellow) 38%, var(--ef-red-deep))}.scroller{position:relative;min-width:0;max-width:100%}.scroller__track{position:relative;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none}.scroller__track::-webkit-scrollbar{display:none}.scroller__btn{position:absolute;top:50%;z-index:1;display:none;place-items:center;width:32px;height:32px;margin-top:-16px;padding:0;border:1px solid var(--line);border-radius:50%;background:var(--ef-white);box-shadow:0 0 0 6px var(--ef-white);color:var(--ink);cursor:pointer;opacity:0;visibility:hidden;transform:scale(0.95);transition:opacity 100ms var(--ease-out), transform 100ms var(--ease-out), visibility 0s linear 100ms}.scroller__btn .ico{width:18px;height:18px}.scroller__btn--prev{left:calc(-1 * var(--scroller-out, 12px))}.scroller__btn--prev .ico{rotate:180deg}.scroller__btn--next{right:calc(-1 * var(--scroller-out, 12px))}.scroller[data-more~="start"] > .scroller__btn--prev,.scroller[data-more~="end"] > .scroller__btn--next{opacity:1;visibility:visible;transform:none;transition:opacity 150ms var(--ease-out), transform 150ms var(--ease-out), visibility 0s}.scroller[data-more] > .scroller__btn:active{transform:scale(0.97)}@media (hover: hover) and (pointer: fine){.scroller__btn{display:grid}.scroller__btn:hover{border-color:var(--ink)}.scroller__track.is-draggable{cursor:grab}}@media (max-width: 899px){.scroller--bleed{align-self:stretch;max-width:none;margin-inline:calc(-1 * var(--gutter));--scroller-out:calc(16px - var(--gutter))}.scroller--bleed > .scroller__track{padding-inline:var(--gutter);scroll-padding-inline:var(--gutter)}}@media (prefers-reduced-motion: reduce){.scroller__btn,.scroller[data-more] > .scroller__btn:active{transform:none}}.page--care .tabs{margin-top:var(--sp-4)}.page--care .deadline{display:inline-flex;align-items:center;gap:var(--sp-2)}.page--care .items__acts{display:flex;flex-wrap:wrap;gap:var(--sp-1) var(--sp-3);margin-top:6px}.page--care .items__acts :is(a, button){padding:0;border:0;background:none;font:inherit;font-weight:var(--fw-bold);font-size:13px;color:var(--ink);text-decoration:underline;text-underline-offset:3px;cursor:pointer}.page--care .for{margin:var(--sp-5) 0 var(--sp-3)}.page--care .for:first-of-type{margin-top:0}.page--care .approve{display:grid;gap:var(--sp-4)}.page--care .approve .btn{width:100%}.page--care .approve .card__link{justify-self:center}.page--care .sum{padding:0;border:0}.page--care-shop .tabs{margin-top:var(--sp-4)}.page--care-shop .shop-bar{display:flex;flex-wrap:wrap;align-items:center;gap:var(--sp-3);margin:var(--sp-6) 0 var(--sp-5)}.page--care-shop .shop-bar .input{flex:1 1 280px;min-height:48px;border-radius:var(--radius-pill)}.page--care-shop .shop-bar > .scroller{flex:1 1 100%}.page--care-shop .shelf + .shelf{margin-top:var(--sp-7)}.page--care-shop .shelf .card__head{margin-bottom:var(--sp-4)}.page--care-product .prod-page{display:grid;grid-template-columns:minmax(0, 1fr) minmax(0, 1fr);align-items:start;gap:var(--sp-6);margin-top:var(--sp-5)}.page--care-product .prod__img{border-radius:var(--radius-lg)}.page--care-product .prod__img .ico{width:88px;height:88px}.page--care-product .buy{display:grid;gap:var(--sp-4)}.page--care-product .buy__price{font-family:var(--font-mono);font-size:var(--fs-2xl);line-height:1;color:var(--ink)}.page--care-product .buy .btn{width:100%}.page--care-product .buy .actions{flex-wrap:wrap}.page--care-product .buy .actions .btn{flex:1 1 auto}.page--care-product .more{display:grid;gap:var(--sp-5);margin-top:var(--sp-6)}.page--care-product .lasts{margin-top:var(--sp-3)}@media (max-width: 899px){.page--care-product .prod-page{grid-template-columns:minmax(0, 1fr)}.page--care-product .prod__img{max-width:420px}}.page--care-product-rx .prod-page{display:grid;grid-template-columns:minmax(0, 1fr) minmax(0, 1fr);align-items:start;gap:var(--sp-6);margin-top:var(--sp-5)}.page--care-product-rx .prod__img .ico{width:88px;height:88px}.page--care-product-rx .buy{display:grid;gap:var(--sp-4)}.page--care-product-rx .buy__price{font-family:var(--font-mono);font-size:var(--fs-2xl);line-height:1;color:var(--ink)}.page--care-product-rx .buy__price small{font-family:var(--font);font-size:var(--fs-sm);color:var(--muted)}.page--care-product-rx .buy .btn{width:100%}.page--care-product-rx .script{display:grid;gap:var(--sp-2);padding:var(--sp-4);border-radius:var(--radius-md);background:var(--tint-blue)}.page--care-product-rx .script .person{grid-template-columns:auto minmax(0, 1fr)}.page--care-product-rx .more{margin-top:var(--sp-6)}@media (max-width: 899px){.page--care-product-rx .prod-page{grid-template-columns:minmax(0, 1fr)}.page--care-product-rx .prod__img{max-width:420px}}.page--care-plan .tabs{margin-top:var(--sp-4)}.page--care-plan .sum{padding:0;border:0}.page--care-plan .pause{display:grid;gap:var(--sp-3)}.page--care-plan .pause .btn{width:100%}.page--care-orders .tabs{margin-top:var(--sp-4)}.page--care-orders .orders{margin-top:var(--sp-6)}',SHOP_ICONS={shield:{viewBox:"0 0 22.5814 22.5814",children:[["g",{fill:"none"},[["g",{},[["path",{d:"M18.8178 12.2313C18.8178 16.9358 15.5247 19.2881 11.6106 20.6523C11.4056 20.7218 11.183 20.7185 10.9802 20.6429C7.05663 19.288 3.76351 16.9358 3.76351 12.2313V5.6451C3.76351 5.39556 3.86264 5.15624 4.03909 4.97979C4.21554 4.80333 4.45486 4.7042 4.7044 4.7042C6.58619 4.7042 8.93842 3.57513 10.5756 2.14498C10.7749 1.97467 11.0285 1.8811 11.2907 1.8811C11.5528 1.8811 11.8064 1.97467 12.0057 2.14498C13.6523 3.58454 15.9951 4.7042 17.8769 4.7042C18.1264 4.7042 18.3658 4.80333 18.5422 4.97979C18.7187 5.15624 18.8178 5.39556 18.8178 5.6451V12.2313Z",stroke:"currentColor",strokeWidth:"1.88179",strokeLinecap:"round",strokeLinejoin:"round"},[]],["path",{d:"M8.468 11.2906L10.3498 13.1724L14.1134 9.40885",stroke:"currentColor",strokeWidth:"1.88179",strokeLinecap:"round",strokeLinejoin:"round"},[]]]]]]]},pill:{viewBox:"0 0 24 24",children:[["g",{fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},[["path",{d:"m10.5 20.5 10-10a4.95 4.95 0 1 0-7-7l-10 10a4.95 4.95 0 1 0 7 7Z"},[]],["path",{d:"m8.5 8.5 7 7"},[]]]]]},leaf:{viewBox:"0 0 24 24",children:[["g",{fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},[["path",{d:"M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10Z"},[]],["path",{d:"M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12"},[]]]]]},paw:{viewBox:"0 0 24 24",children:[["g",{fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},[["circle",{cx:"11",cy:"4",r:"2"},[]],["circle",{cx:"18",cy:"8",r:"2"},[]],["circle",{cx:"20",cy:"16",r:"2"},[]],["path",{d:"M9 10a5 5 0 0 1 5 5v3.5a3.5 3.5 0 0 1-6.84 1.045Q6.52 17.48 4.46 16.84A3.5 3.5 0 0 1 5.5 10Z"},[]]]]]},plus:{viewBox:"0 0 16 16",children:[["g",{fill:"none"},[["g",{},[["path",{d:"M3.33333 8H12.6667",stroke:"currentColor",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"},[]],["path",{d:"M8 3.33333V12.6667",stroke:"currentColor",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"},[]]]]]]]},minus:{viewBox:"0 0 24 24",children:[["path",{d:"M5 12h14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"},[]]]},check:{viewBox:"0 0 24 24",children:[["path",{d:"M20 6 9 17l-5-5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},[]]]},search:{viewBox:"0 0 24 24",children:[["g",{fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},[["circle",{cx:"11",cy:"11",r:"8"},[]],["path",{d:"m21 21-4.3-4.3"},[]]]]]},"arrow-left":{viewBox:"0 0 24 24",children:[["g",{fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},[["path",{d:"m12 19-7-7 7-7"},[]],["path",{d:"M19 12H5"},[]]]]]},ask:{viewBox:"0 0 48.9298 48.9298",children:[["g",{fill:"none"},[["g",{},[["path",{d:"M6.09993 33.3171C6.39971 34.0733 6.46645 34.9019 6.29158 35.6963L4.12031 42.4037C4.05035 42.7439 4.06844 43.0963 4.17286 43.4275C4.27729 43.7587 4.46458 44.0577 4.71699 44.2963C4.96939 44.5348 5.27854 44.7049 5.61512 44.7904C5.9517 44.8759 6.30454 44.8741 6.6402 44.785L13.5984 42.7503C14.3481 42.6016 15.1245 42.6666 15.839 42.9379C20.1925 44.971 25.1242 45.4011 29.7639 44.1524C34.4037 42.9037 38.4533 40.0564 41.1983 36.1129C43.9434 32.1694 45.2074 27.3831 44.7674 22.5985C44.3273 17.8138 42.2116 13.3383 38.7934 9.96162C35.3751 6.5849 30.8741 4.52397 26.0845 4.14244C21.2948 3.7609 16.5243 5.08329 12.6146 7.87628C8.70494 10.6693 5.90734 14.7534 4.71541 19.408C3.52348 24.0627 4.01383 28.9887 6.09993 33.3171Z",style:{fill:"var(--ef-dark-green)",stroke:"var(--ef-bright-green)"},strokeWidth:"1.39745",strokeLinecap:"round",strokeLinejoin:"round"},[]],["path",{fillRule:"evenodd",clipRule:"evenodd",d:"M34.8999 27.8255V27.6035H32.2725L32.2491 27.7993C31.9569 30.3439 29.7458 33.2428 25.5732 33.2428C23.4945 33.2428 21.7645 32.3813 20.5529 30.9367C19.3619 29.5155 18.6644 27.5126 18.6368 25.1857H35.1149V24.0099C35.1149 20.3584 33.8936 17.6221 32.0175 15.7957C30.1497 13.9734 27.6395 13.0774 25.0963 13.0774C18.7733 13.0787 13.815 17.6428 13.815 24.5737C13.815 31.5046 19.1344 35.8522 25.3113 35.8522C31.4882 35.8522 34.8999 31.2923 34.8999 27.8255ZM29.4619 18.0632C30.3537 19.4569 30.7107 21.2695 30.7287 22.9664H18.6796C18.6947 21.1661 19.1965 19.3452 20.1986 17.9723C21.2118 16.5842 22.7419 15.644 24.833 15.644C27.0978 15.644 28.5562 16.6448 29.4619 18.0646V18.0632Z",style:{fill:"var(--ef-white)"}},[]]]]]]]},file:{viewBox:"0 0 24 24",children:[["g",{fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"},[]],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4"},[]],["path",{d:"M10 9H8"},[]],["path",{d:"M16 13H8"},[]],["path",{d:"M16 17H8"},[]]]]]},message:{viewBox:"0 0 24 24",children:[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},[]]]},box:{viewBox:"0 0 24 24",children:[["g",{fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z"},[]],["path",{d:"M12 22V12"},[]],["path",{d:"M3.29 7 12 12l8.71-5"},[]],["path",{d:"m7.5 4.27 9 5.15"},[]]]]]},bag:{viewBox:"0 0 24 24",children:[["g",{fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},[["path",{d:"M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z"},[]],["path",{d:"M3 6h18"},[]],["path",{d:"M16 10a4 4 0 0 1-8 0"},[]]]]]},chevron:{viewBox:"0 0 19.358 19.358",children:[["g",{fill:"none"},[["g",{},[["path",{d:"M7.25918 14.5191L12.0987 9.67957L7.25918 4.84007",stroke:"currentColor",strokeWidth:"1.61317",strokeLinecap:"round",strokeLinejoin:"round"},[]]]]]]]},x:{viewBox:"0 0 24 24",children:[["g",{fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},[["path",{d:"M18 6 6 18"},[]],["path",{d:"m6 6 12 12"},[]]]]]},flask:{viewBox:"0 0 22.5814 22.5814",children:[["g",{fill:"none"},[["g",{},[["path",{d:"M13.1725 1.88153V7.52689C13.1724 7.84254 13.2516 8.15316 13.403 8.43014L18.5873 17.9143C18.7442 18.201 18.8237 18.5234 18.818 18.8501C18.8124 19.1767 18.7218 19.4963 18.5552 19.7773C18.3886 20.0583 18.1517 20.2911 17.8678 20.4528C17.5839 20.6145 17.2628 20.6995 16.9361 20.6994H5.64536C5.31866 20.6995 4.99757 20.6145 4.71368 20.4528C4.42979 20.2911 4.19288 20.0583 4.02626 19.7773C3.85964 19.4963 3.76906 19.1767 3.76342 18.8501C3.75778 18.5234 3.83728 18.201 3.99409 17.9143L9.17841 8.43014C9.32979 8.15316 9.40907 7.84254 9.40893 7.52689V1.88153",stroke:"currentColor",strokeWidth:"1.88179",strokeLinecap:"round",strokeLinejoin:"round"},[]],["path",{d:"M6.07162 14.1128H16.5099",stroke:"currentColor",strokeWidth:"1.88179",strokeLinecap:"round",strokeLinejoin:"round"},[]],["path",{d:"M7.99755 1.88153H14.5838",stroke:"currentColor",strokeWidth:"1.88179",strokeLinecap:"round",strokeLinejoin:"round"},[]]]]]]]},syringe:{viewBox:"0 0 19.5956 19.5956",children:[["g",{fill:"none"},[["g",{},[["path",{d:"M14.5322 1.63281L17.7982 4.89874",stroke:"currentColor",strokeWidth:"1.63296",strokeLinecap:"round",strokeLinejoin:"round"},[]],["path",{d:"M13.7158 5.71556L16.1653 3.26611",stroke:"currentColor",strokeWidth:"1.63296",strokeLinecap:"round",strokeLinejoin:"round"},[]],["path",{d:"M15.3496 7.34845L6.93981 15.7582C6.12333 16.5747 4.89861 16.5747 4.16377 15.7582L3.67388 15.2683C2.8574 14.4518 2.8574 13.2271 3.67388 12.4923L12.0836 4.08252",stroke:"currentColor",strokeWidth:"1.63296",strokeLinecap:"round",strokeLinejoin:"round"},[]],["path",{d:"M7.18457 8.9812L10.4505 12.2471",stroke:"currentColor",strokeWidth:"1.63296",strokeLinecap:"round",strokeLinejoin:"round"},[]],["path",{d:"M3.9182 15.5134L1.46875 17.9629",stroke:"currentColor",strokeWidth:"1.63296",strokeLinecap:"round",strokeLinejoin:"round"},[]],["path",{d:"M11.2666 3.26611L16.1655 8.16501",stroke:"currentColor",strokeWidth:"1.63296",strokeLinecap:"round",strokeLinejoin:"round"},[]]]]]]]},bowl:{viewBox:"0 0 24 24",children:[["g",{fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},[["path",{d:"M2 11h20"},[]],["path",{d:"M4 11c0 4.4 3.6 8 8 8s8-3.6 8-8"},[]],["path",{d:"M8.5 8c1.2-1.6 5.8-1.6 7 0"},[]]]]]}};function draw(node,key){let[tag,attrs,children]=node;return createElement(tag,{key:key,...attrs},...children.map(draw))}function Icon({name:name,className:className="ico"}){let icon=SHOP_ICONS[name];return icon?/* @__PURE__ */jsx("svg",{className:className,"aria-hidden":"true",focusable:"false",viewBox:icon.viewBox,children:icon.children.map(draw)}):null}function prefersStill(){try{return typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return false}}function Scroller({className:className,trackClassName:trackClassName,label:label,children:children}){let track=useRef(null),[more,setMore]=useState(""),[draggable,setDraggable]=useState(false),update=useCallback(()=>{let t=track.current;if(!t)return;let max=t.scrollWidth-t.clientWidth,edges=[];max>1&&t.scrollLeft>1&&edges.push("start"),max>1&&t.scrollLeft<max-1&&edges.push("end"),setMore(edges.join(" ")),setDraggable(max>1)},[]);useEffect(()=>{let t=track.current;if(!t)return;update();let ticking=false,onScroll=()=>{ticking||(ticking=true,requestAnimationFrame(()=>{ticking=false,update()}))};t.addEventListener("scroll",onScroll,{passive:true});let ro=typeof ResizeObserver=="function"?new ResizeObserver(update):null;ro?.observe(t);for(let child of Array.from(t.children))ro?.observe(child);let live=true;return(typeof document<"u"?document.fonts?.ready:void 0)?.then(()=>{live&&update()}),()=>{live=false,t.removeEventListener("scroll",onScroll),ro?.disconnect()}},[update,children]);let move=dir=>{let t=track.current;t&&t.scrollBy({left:dir*.8*t.clientWidth,behavior:prefersStill()?"auto":"smooth"})};/* @__PURE__ */
|
|
7
7
|
return jsxs("div",{className:["scroller",className].filter(Boolean).join(" "),"data-more":more,children:[
|
|
8
8
|
/* @__PURE__ */jsx("ul",{className:["scroller__track",trackClassName,draggable?"is-draggable":""].filter(Boolean).join(" "),"aria-label":label,ref:track,children:children}),["prev","next"].map(dir=>/* @__PURE__ */jsx("button",{type:"button",className:dir==="next"?"scroller__btn scroller__btn--next":"scroller__btn scroller__btn--prev",tabIndex:-1,"aria-hidden":"true",onMouseDown:e=>e.preventDefault(),onClick:()=>move(dir==="next"?1:-1),children:/* @__PURE__ */jsx(Icon,{name:"chevron"})},dir))]})}var ALERT_STYLE={color:"var(--alert-deep)"};function CareTabs({copy:copy,current:current,tabs:tabs}){let label={package:copy.tabPackage,shop:copy.tabShop,orders:copy.tabOrders,plan:copy.tabPlan};/* @__PURE__ */
|
|
@@ -254,7 +254,7 @@ return jsx(PlanScreen,{copy:copy,tabs:tabs,view:view})}function LiveAddress({the
|
|
|
254
254
|
return jsx(AddressFormScreen,{copy:copy,...useAddressStep(then,nav.go)})}function LiveCard({then:then,handoff:handoff}){let{copy:copy}=useShop(),nav=useShopNav();/* @__PURE__ */
|
|
255
255
|
return jsx(CardSetupScreen,{copy:copy,...useCardStep(then,nav.go,handoff)})}function LiveBuy({route:route}){let{copy:copy}=useShop(),nav=useShopNav();/* @__PURE__ */
|
|
256
256
|
return jsx(BuyConfirmScreen,{copy:copy,...useBuyStep(route,nav.go)})}function LiveConsent({route:route}){let{copy:copy}=useShop(),nav=useShopNav();/* @__PURE__ */
|
|
257
|
-
return jsx(PlanConsentScreen,{copy:copy,...useConsentStep(route,nav.go)})}var freezeInPlace=Object.freeze;function deepFreeze(value){if(value!==null&&typeof value=="object"&&!Object.isFrozen(value)){freezeInPlace(value);for(let key of Object.keys(value))deepFreeze(value[key])}return value}var TEXT_SCALE_TIER_CAPS=/* @__PURE__ */Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3}),SPACE={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},RADIUS={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},TYPE_SIZE={nano:8,small:9,micro:10,tiny:11,caption:13,bodyTight:15,body:17,subtitle:20,heading:22,verdict:24},LINE_HEIGHT={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},WEIGHT={regular:"400",medium:"500",bold:"700"},LETTER_SPACING={eyebrow:1,monoWide:.9,headerBrand:-.42,tight:-.35},DEFAULT_MAX_FONT_SCALE=0,SYSTEM_FONT_FAMILY="System",SYSTEM_MONO_FAMILY="monospace",TIERS=["content","heading","control","compact","badge"];function authoredTierSizes(size){let out={};for(let tier of TIERS)out[tier]=size;return out}var NO_FONT_SOURCES=[];function baseType(){return{family:SYSTEM_FONT_FAMILY,mono:SYSTEM_MONO_FAMILY,fontUrl:null,families:{regular:SYSTEM_FONT_FAMILY,medium:SYSTEM_FONT_FAMILY,bold:SYSTEM_FONT_FAMILY,mono:SYSTEM_MONO_FAMILY,monoMedium:SYSTEM_MONO_FAMILY,monoBold:SYSTEM_MONO_FAMILY},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:TYPE_SIZE,tierSizes:authoredTierSizes(TYPE_SIZE),lineHeight:LINE_HEIGHT,weight:WEIGHT,letterSpacing:LETTER_SPACING,scale:1,maxScale:DEFAULT_MAX_FONT_SCALE,scaleCaps:TEXT_SCALE_TIER_CAPS,headingFamily:null,headingWeight:null,fontSources:NO_FONT_SOURCES}}var NO_SLOTS={},EASING_CURVES=/* @__PURE__ */Object.freeze({standard:/* @__PURE__ */Object.freeze([.2,0,0,1]),emphasized:/* @__PURE__ */Object.freeze([.2,.8,.2,1]),exit:/* @__PURE__ */Object.freeze([.4,0,1,1])});function cssCubicBezier(curve){return`cubic-bezier(${curve.join(", ")})`}var MOTION={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:cssCubicBezier(EASING_CURVES.standard),emphasized:cssCubicBezier(EASING_CURVES.emphasized),exit:cssCubicBezier(EASING_CURVES.exit)},reducedMotion:false},LIGHT_COLOR={brand:"#10462E",brandSoft:"rgba(16,70,46,0.10)",brandSofter:"rgba(16,70,46,0.15)",brandBorder:"rgba(16,70,46,0.18)",borderHairlineGreen:"rgba(16,70,46,0.25)",brandBorderStrong:"rgba(16,70,46,0.55)",brandInk:"#10462E",linkInk:"#10462E",surface:"#FFFFFF",surfaceCream:"#FFFFFF",surfaceSubtle:"#F1F5F2",background:"#FFFFFF",borderRingCream:"#E4E4E4",chatGround:"#FFFFFF",composerFill:"#FFFFFF",composerBorder:"rgba(16,70,46,0.75)",shadow:"#0B3421",text:{primary:"#000000",secondary:"#0E462E",muted:"#6B6B6B",placeholder:"rgba(61,61,61,0.75)",onBrand:"#FFFFFF",metaCool:"#3D3D3D",timestamp:"rgba(61,61,61,0.75)"},primary:"#10462E",onPrimary:"#FFFFFF",accent:"#10462E",onAccent:"#FFFFFF",accentEdge:"#07C168",success:"#07C168",danger:"#C03410",onDanger:"#FFFFFF",errorRed:"#C03410",warningStrong:"#A45610",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.12)",badgeBgCaution:"rgba(217,130,29,0.14)",badgeBgCritical:"rgba(192,52,16,0.06)",badgeBgNeutral:"rgba(107,107,107,0.12)",bubbleUser:"#10462E",bubbleAssistant:"#FFFFFF",bubbleVet:"#FFC3BC",onBubbleVet:"#000000",skeleton:"#E9F1E9",scanButtonPink:"#FFC3BC",highlight:"#FFC3BC",onHighlight:"#000000",mark:"#07C168",controlEdge:"rgba(16,70,46,0.18)",structureEdge:"rgba(16,70,46,0.25)",primaryEdge:"#10462E",checkupCardLowRiskBg:"rgba(7,193,104,0.10)",checkupCardConcernBg:"rgba(239,167,0,0.10)",info:"#10462E",badgeBgInfo:"rgba(16,70,46,0.10)",infoEdge:"rgba(16,70,46,0.25)"},EVERFUR_LIGHT=deepFreeze({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:LIGHT_COLOR,space:SPACE,radius:RADIUS,type:baseType(),motion:MOTION,slots:NO_SLOTS}),DARK_COLOR={brand:"#6BD39A",brandSoft:"rgba(107,211,154,0.12)",brandSofter:"rgba(107,211,154,0.18)",brandBorder:"rgba(107,211,154,0.22)",borderHairlineGreen:"rgba(107,211,154,0.28)",brandBorderStrong:"rgba(107,211,154,0.55)",brandInk:"#6BD39A",linkInk:"#6BD39A",surface:"#1C1F23",surfaceCream:"#23272C",surfaceSubtle:"#23272C",background:"#15171A",borderRingCream:"#3A3F45",chatGround:"#1C1F23",composerFill:"#23272C",composerBorder:"rgba(107,211,154,0.75)",shadow:"#000000",text:{primary:"#F5F3F0",secondary:"#A9E4C4",muted:"#9A9A9A",placeholder:"rgba(255,255,255,0.55)",onBrand:"#0E1F17",metaCool:"#C9C9C9",timestamp:"rgba(245,243,240,0.7)"},primary:"#6BD39A",onPrimary:"#0E1F17",accent:"#6BD39A",onAccent:"#0E1F17",accentEdge:"#34D888",success:"#07C168",danger:"#F87171",onDanger:"#0E1F17",errorRed:"#FF6B5B",warningStrong:"#F0A35E",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.18)",badgeBgCaution:"rgba(217,130,29,0.20)",badgeBgCritical:"rgba(185,28,28,0.22)",badgeBgNeutral:"rgba(255,255,255,0.10)",bubbleUser:"#6BD39A",bubbleAssistant:"#1C1F23",bubbleVet:"#FFC3BC",onBubbleVet:"#000000",skeleton:"#23272C",scanButtonPink:"#FFC3BC",highlight:"#605051",onHighlight:"#F5F3F0",mark:"#07C168",controlEdge:"rgba(107,211,154,0.22)",structureEdge:"rgba(107,211,154,0.28)",primaryEdge:"#6BD39A",checkupCardLowRiskBg:"rgba(7,193,104,0.16)",checkupCardConcernBg:"rgba(239,167,0,0.16)",info:"#6BD39A",badgeBgInfo:"rgba(107,211,154,0.12)",infoEdge:"rgba(107,211,154,0.28)"};deepFreeze({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:DARK_COLOR,space:SPACE,radius:RADIUS,type:baseType(),motion:MOTION,slots:NO_SLOTS});var EVERFUR_THEME_CONTEXT_SYMBOL=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),globalThemeHost=globalThis,EverfurThemeContext=globalThemeHost[EVERFUR_THEME_CONTEXT_SYMBOL]??(globalThemeHost[EVERFUR_THEME_CONTEXT_SYMBOL]=createContext(EVERFUR_LIGHT));EverfurThemeContext.displayName??="EverfurThemeContext";function useEverfurTheme(){return useContext(EverfurThemeContext)}function toRgba(value){if(typeof value=="number")return argbIntToRgba(value);if(typeof value!="string")return null;let s=value.trim();if(s.length===0)return null;if(s.startsWith("#"))return fromHex(s.slice(1));if(s.toLowerCase().startsWith("0x"))return fromHex(s.slice(2));if(s.toLowerCase().startsWith("rgb"))return fromRgbFunc(s);if(/^[0-9a-fA-F]+$/.test(s)){let hex=fromHex(s);if(hex!==null)return hex}return/^\d+$/.test(s)?argbIntToRgba(Number.parseInt(s,10)):null}function fromHex(hex){let h=hex.trim();if(!/^[0-9a-fA-F]+$/.test(h))return null;if(h.length===3)return{r:dup(h[0]),g:dup(h[1]),b:dup(h[2]),a:1};if(h.length===6)return{r:byte(h,0),g:byte(h,2),b:byte(h,4),a:1};if(h.length===8){let a=byte(h,0);return{r:byte(h,2),g:byte(h,4),b:byte(h,6),a:a/255}}return null}function fromRgbFunc(input){let open=input.indexOf("("),close=input.indexOf(")");if(open<0||close<0||close<open)return null;let parts=input.slice(open+1,close).split(",").map(p=>p.trim());if(parts.length<3)return null;let r=clampByte(Number(parts[0])),g=clampByte(Number(parts[1])),b=clampByte(Number(parts[2]));if(r===null||g===null||b===null)return null;let a=1;if(parts.length>=4){let alpha=Number(parts[3]);if(!Number.isFinite(alpha))return null;a=Math.min(1,Math.max(0,alpha))}return{r:r,g:g,b:b,a:a}}function argbIntToRgba(n){if(!Number.isFinite(n))return null;let 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 step2=1;step2<1/PUSH_STEP;step2+=1){let t=step2*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"}),cache=/* @__PURE__ */new WeakMap;function v3Palette(theme){let hit=cache.get(theme);if(hit!==void 0)return hit;let c=theme.color,dark=theme.brightness==="dark",neutrals=dark?{dark:dark,ink:c.text.primary,ink2:c.text.secondary,ink3:c.text.muted,paper:c.background,card:c.surface,line:c.borderRingCream,tile:c.surfaceSubtle,shadow:c.shadow,riskBg:c.badgeBgCritical,riskInk:c.danger,riskDot:c.danger,clearBg:c.badgeBgPositive,clearInk:c.success,clearDot:c.success,watchDot:c.warningStrong}:{dark:dark,...RAPH_V3_LIGHT},textOn=(ink,grounds)=>pushToContrast(ink,grounds,poleForGrounds(grounds),V3_TEXT_CONTRAST),labelOn=(ink,fill2)=>contrastRatio(ink,fill2)>=V3_TEXT_CONTRAST?ink:legibleOn(fill2,V3_TEXT_CONTRAST),badgeGrounds=[neutrals.card,neutrals.paper].map(under=>flattenOnto(c.brandSoft,under)??under),brand={primary:c.primary,onPrimary:labelOn(c.onPrimary,c.primary),accent:c.accent,onAccent:labelOn(c.onAccent,c.accent),link:textOn(c.linkInk,[neutrals.card,neutrals.paper,neutrals.tile]),badge:c.brandSoft,onBadge:textOn(c.brandInk,badgeGrounds)},palette=/* @__PURE__ */Object.freeze({...neutrals,...brand});return cache.set(theme,palette),palette}var V3_TEXT_CONTRAST=4.5;var FACE_WEIGHT=/* @__PURE__ */Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});var SYSTEM_UI_STACK='system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',RN_SYSTEM_FAMILY="System";function cssFontFamily(family){let named=family.trim();return named.length===0||named===RN_SYSTEM_FAMILY?SYSTEM_UI_STACK:`${quote(named)}, ${SYSTEM_UI_STACK}`}function cssMonoFamily(mono){let named=mono.trim();return named.length===0||named==="monospace"?"ui-monospace, Menlo, Consolas, monospace":`${quote(named)}, ui-monospace, Menlo, Consolas, monospace`}function quote(family){return`"${family.replace(/[\\"]/g,"\\$&")}"`}function faceCss(theme,weight){let type=theme.type,family=type.families[weight];return{fontFamily:weight==="mono"||weight==="monoMedium"||weight==="monoBold"?cssMonoFamily(family):cssFontFamily(family),fontWeight:type.namedFaces[weight]?type.weight.regular:type.weight[FACE_WEIGHT[weight]]}}function headingFaceCss(theme,fallback="bold"){let{headingFamily:headingFamily,headingWeight:headingWeight}=theme.type,base=faceCss(theme,fallback);return headingFamily===null&&headingWeight===null?base:headingFamily!==null?{fontFamily:cssFontFamily(headingFamily),fontWeight:headingWeight??theme.type.weight[FACE_WEIGHT[fallback]]}:theme.type.namedFaces[fallback]||headingWeight===null?base:{fontFamily:base.fontFamily,fontWeight:headingWeight}}var PLAN_CLASS_PREFIX="efp-",PLAN_CONTEXT=[["font-family","$sans"],["color","$ink"],["font-size","17px"],["line-height","1.5"]],PLAN_RULES=[["h1",[0,0,1],[["color","$n_10462E"],["line-height","1.15"],["font-weight","700"]]],["h2",[0,0,1],[["color","$n_10462E"],["line-height","1.15"],["font-weight","700"]]],["h3",[0,0,1],[["color","$n_10462E"],["line-height","1.15"],["font-weight","700"]]],["h4",[0,0,1],[["color","$n_10462E"],["line-height","1.15"],["font-weight","700"]]],[".efp-ph-sheet > h3.efp-serif",[0,2,1],[["font-size","24px"]]],["*",[0,0,0],[["box-sizing","border-box"]]],["* > .efp-before",[0,1,0],[["box-sizing","border-box"]]],["[hidden]",[0,1,0],[["display","none",1]]],["h1",[0,0,1],[["color","inherit"],["margin","0"],["font-weight","700"],["line-height","1.15"]]],["h2",[0,0,1],[["color","inherit"],["margin","0"],["font-weight","700"],["line-height","1.15"]]],["h3",[0,0,1],[["color","inherit"],["margin","0"],["font-weight","700"],["line-height","1.15"]]],["h4",[0,0,1],[["color","inherit"],["margin","0"],["font-weight","700"],["line-height","1.15"]]],["p",[0,0,1],[["margin","0"]]],["ul",[0,0,1],[["margin","0"]]],["ol",[0,0,1],[["margin","0"]]],["button",[0,0,1],[["font","inherit"],["color","inherit"]]],["input",[0,0,1],[["font","inherit"],["color","inherit"]]],["textarea",[0,0,1],[["font","inherit"],["color","inherit"]]],["button",[0,0,1],[["background","none"],["border","0"],["padding","0"],["cursor","pointer"],["text-align","inherit"],["-webkit-tap-highlight-color","transparent"],["touch-action","manipulation"]]],["img",[0,0,1],[["display","block"]]],["svg",[0,0,1],[["display","block"]]],["a",[0,0,1],[["color","inherit"]]],[".efp-sr-only",[0,1,0],[["position","absolute"],["width","1px"],["height","1px"],["overflow","hidden"],["clip","rect(0 0 0 0)"],["white-space","nowrap"]]],[".efp-serif",[0,1,0],[["font-family","$serif"],["font-weight","800"],["font-variation-settings",'"SOFT" 0, "WONK" 0'],["letter-spacing","-0.01em"],["text-wrap","balance"]]],[".efp-emb-btn",[0,1,0],[["display","inline-flex"],["align-items","center"],["justify-content","center"],["gap","8px"],["min-height","48px"],["padding","0 22px"],["border-radius","999px"],["background","$primary"],["color","$onPrimary"],["font-weight","700"],["font-size","16px"],["text-decoration","none"],["transition","transform 160ms cubic-bezier(0.23, 1, 0.32, 1), opacity 160ms ease"]]],[".efp-emb-btn svg",[0,1,1],[["width","20px"],["height","20px"]]],[".efp-emb-btn--block",[0,1,0],[["width","100%"]]],[".efp-emb-btn--ghost",[0,1,0],[["background","transparent"],["color","$ink"],["box-shadow","inset 0 0 0 1.5px $ink"]]],[".efp-emb-btn--sm",[0,1,0],[["min-height","40px"],["padding","0 16px"],["font-size","15px"]]],[".efp-emb-btn--lg",[0,1,0],[["min-height","56px"],["padding","0 28px"],["font-size","17px"]]],[".efp-emb-btn[disabled]",[0,2,0],[["opacity",".32"],["pointer-events","none"]]],[".efp-dot",[0,1,0],[["display","inline-block"],["width","9px"],["height","9px"],["border-radius","50%"],["flex","none"]]],[".efp-dot--risk",[0,1,0],[["background","$riskDot"]]],[".efp-ph-scroll",[0,1,0],[["flex","1"],["min-height","0"],["overflow-y","auto"],["overscroll-behavior","contain"],["scrollbar-width","none"]]],[".efp-emb-tile",[0,1,0],[["width","46px"],["height","46px"],["border-radius","13px"],["background","$tile"],["display","grid"],["place-items","center"],["flex","none"],["font-size","22px"]]],[".efp-emb-tile svg",[0,1,1],[["width","23px"],["height","23px"]]],[".efp-emb-tile--cyan",[0,1,0],[["background","$linkWash"],["color","$link"]]],[".efp-ph-push",[0,1,0],[["position","absolute"],["inset","0"],["display","flex"],["flex-direction","column"],["background","$paper"],["pointer-events","auto"],["transform","translateX(100%)"],["visibility","hidden"],["transition","transform 220ms cubic-bezier(0.23, 1, 0.32, 1), visibility 0s linear 220ms"]]],[".efp-ph-push.efp-is-on",[0,2,0],[["transform","none"],["visibility","visible"],["transition","transform 300ms cubic-bezier(0.32, 0.72, 0, 1), visibility 0s"]]],[".efp-bk__radio",[0,1,0],[["width","22px"],["height","22px"],["border-radius","50%"],["box-shadow","inset 0 0 0 2px $n_BDB9B2"],["display","grid"],["place-items","center"]]],[".efp-bk__foot",[0,1,0],[["flex","none"],["padding","12px 18px 34px"],["background","$paper"],["box-shadow","0 -1px 0 $line"]]],[".efp-bk__done",[0,1,0],[["padding","40px 22px 20px"],["text-align","center"]]],[".efp-bk__check",[0,1,0],[["width","76px"],["height","76px"],["border-radius","50%"],["background","$accent"],["display","grid"],["place-items","center"],["margin","0 auto"]]],[".efp-bk__check svg",[0,1,1],[["width","38px"],["height","38px"]]],[".efp-bk__done .efp-bk__title",[0,2,0],[["margin-top","20px"],["font-size","34px"]]],[".efp-bk__when",[0,1,0],[["font-size","16px"],["margin-top","10px"],["font-weight","700"]]],[".efp-bk__who",[0,1,0],[["font-size","15px"],["color","$ink2"],["margin-top","2px"]]],[".efp-ph-scrim",[0,1,0],[["position","absolute"],["inset","0"],["z-index","40"],["background","$scrim"],["opacity","0"],["visibility","hidden"],["transition","opacity 200ms ease, visibility 0s linear 200ms"]]],[".efp-ph-scrim.efp-is-on",[0,2,0],[["opacity","1"],["visibility","visible"],["transition","opacity 240ms ease, visibility 0s"]]],[".efp-ph-sheet",[0,1,0],[["overscroll-behavior","contain"],["position","absolute"],["left","0"],["right","0"],["bottom","0"],["z-index","41"],["max-height","80%"],["overflow-y","auto"],["scrollbar-width","none"],["background","$card"],["border-radius","28px 28px 0 0"],["padding","10px 20px 40px"],["transform","translateY(100%)"],["visibility","hidden"],["transition","transform 220ms cubic-bezier(0.23, 1, 0.32, 1), visibility 0s linear 220ms"]]],[".efp-ph-sheet.efp-is-on",[0,2,0],[["transform","none"],["visibility","visible"],["transition","transform 320ms cubic-bezier(0.32, 0.72, 0, 1), visibility 0s"]]],[".efp-sheet__grab",[0,1,0],[["width","40px"],["height","5px"],["border-radius","3px"],["background","$n_DAD7D1"],["margin","0 auto 10px"]]],[".efp-sheet__top",[0,1,0],[["display","flex"],["align-items","center"],["justify-content","space-between"]]],[".efp-sheet__kicker",[0,1,0],[["font-family","$mono"],["font-size","11px"],["letter-spacing",".08em"],["text-transform","uppercase"],["color","$ink3"]]],[".efp-sheet__x",[0,1,0],[["width","40px"],["height","40px"],["margin-right","-8px"],["display","grid"],["place-items","center"],["border-radius","50%"]]],[".efp-sheet__x svg",[0,1,1],[["width","22px"],["height","22px"]]],[".efp-ph-sheet .efp-sheet__body",[0,2,0],[["display","grid"],["gap","10px"],["margin-top","12px"],["font-size","16px"],["line-height","1.5"],["color","$black"]]],[".efp-ph-toast",[0,1,0],[["position","absolute"],["left","16px"],["right","16px"],["top","112px"],["z-index","50"],["background","$ink"],["color","$onInk"],["border-radius","16px"],["padding","12px 15px"],["font-size","14.5px"],["line-height","1.4"],["opacity","0"],["transform","translateY(-8px)"],["pointer-events","none"],["transition","opacity 160ms ease, transform 160ms cubic-bezier(0.23, 1, 0.32, 1)"]]],[".efp-ph-toast.efp-is-on",[0,2,0],[["opacity","1"],["transform","none"],["transition-duration","220ms"]]],[".efp-plan__fine",[0,1,0],[["font-size","12.5px"],["color","$ink3"],["text-align","center"],["margin-top","16px"],["line-height","1.45"]]],[".efp-cp-tag",[0,1,0],[["font-family","$mono"],["font-size","10px"],["letter-spacing",".06em"],["text-transform","uppercase"],["background","$ink"],["color","$onInk"],["padding","2px 6px"],["border-radius","5px"]]],[".efp-cp-tag--s",[0,1,0],[["background","$card"],["color","$ink"]]],[".efp-hp",[0,1,0],[["padding","16px 16px 28px"]]],[".efp-hp-head",[0,1,0],[["display","grid"],["grid-template-columns","minmax(0, 1fr) 56px"],["gap","12px"],["align-items","center"],["padding","2px 2px 0"]]],[".efp-hp-head h2",[0,1,1],[["font-size","29px"],["line-height","1.06"]]],[".efp-hp-head p",[0,1,1],[["font-size","15px"],["color","$ink2"],["margin-top","6px"]]],[".efp-hp-head img",[0,1,1],[["width","56px"],["height","56px"],["border-radius","50%"],["object-fit","cover"],["background","$tile"],["box-shadow","0 0 0 3px $paper, 0 0 0 5.5px $accent"]]],[".efp-hp-need",[0,1,0],[["margin-top","14px"],["padding","16px"],["border-radius","22px"],["background","$card"],["box-shadow","0 1px 3px $wash"],["scroll-margin-top","12px"]]],[".efp-hp-need__k",[0,1,0],[["display","flex"],["align-items","center"],["gap","8px"],["font-size","15px"],["font-weight","800"]]],[".efp-hp-n",[0,1,0],[["flex","none"],["width","24px"],["height","24px"],["border-radius","50%"],["background","$primary"],["color","$onPrimary"],["display","grid"],["place-items","center"],["font-size","12.5px"],["font-weight","800"]]],[".efp-hp-srcs",[0,1,0],[["margin-left","auto"],["display","flex"],["gap","4px"]]],[".efp-hp-src",[0,1,0],[["height","24px"],["padding","0 9px"],["border-radius","999px"],["background","$tile"],["color","$ink2"],["font-size","12px"],["font-weight","700"],["display","inline-flex"],["align-items","center"],["white-space","nowrap"]]],[".efp-hp-src--dna",[0,1,0],[["background","$linkWash"],["color","$link"]]],[".efp-hp-need h3",[0,1,1],[["font-size","19px"],["font-weight","800"],["line-height","1.22"],["margin-top","12px"]]],[".efp-hp-need__s",[0,1,0],[["display","grid"],["grid-template-columns","9px minmax(0, 1fr)"],["gap","9px"],["align-items","baseline"],["margin-top","6px"],["font-size","15px"],["line-height","1.45"],["color","$ink2"]]],[".efp-hp-need__s b",[0,1,1],[["color","$ink"],["font-weight","800"]]],[".efp-hp-need__s .efp-dot",[0,2,0],[["transform","translateY(-1px)"]]],[".efp-hp-odds",[0,1,0],[["display","flex"],["justify-content","space-between"],["align-items","center"],["gap","12px"],["margin-top","12px"],["padding","10px 14px"],["border-radius","14px"],["background","$accent4"]]],[".efp-hp-odds__k",[0,1,0],[["font-size","13.5px"],["font-weight","600"],["line-height","1.35"],["color","$ink2"],["max-width","10em"]]],[".efp-hp-odds__k .efp-cp-tag",[0,2,0],[["display","inline-block"],["margin-top","3px"]]],[".efp-hp-odds__n",[0,1,0],[["display","grid"],["grid-template-columns","auto auto auto"],["align-items","center"],["justify-items","end"],["gap","0 6px"]]],[".efp-hp-odds__n s",[0,1,1],[["font-size","17px"],["font-weight","700"],["color","$ink3"]]],[".efp-hp-odds__n svg",[0,1,1],[["width","16px"],["height","16px"],["color","$ink3"]]],[".efp-hp-odds__n b",[0,1,1],[["font-family","$serif"],["font-size","28px"],["font-weight","800"],["line-height","1"]]],[".efp-hp-odds__n span",[0,1,1],[["grid-column","1 / -1"],["font-size","12.5px"],["font-weight","700"],["color","$link"],["margin-top","3px"]]],[".efp-hp-pick",[0,1,0],[["margin-top","12px"],["padding","12px"],["border-radius","16px"],["background","$paper"]]],[".efp-hp-pick__top",[0,1,0],[["display","grid"],["grid-template-columns","64px minmax(0, 1fr)"],["gap","12px"],["align-items","center"]]],[".efp-hp-pick__img",[0,1,0],[["width","64px"],["height","64px"],["border-radius","14px"],["background","$card"],["overflow","hidden"]]],[".efp-hp-pick__img img",[0,1,1],[["width","100%"],["height","100%"],["object-fit","cover"]]],[".efp-hp-pick h4",[0,1,1],[["font-size","17px"],["font-weight","800"],["line-height","1.2"]]],[".efp-hp-stars",[0,1,0],[["display","flex"],["align-items","center"],["gap","4px"],["margin-top","2px"],["font-size","13.5px"],["font-weight","800"]]],[".efp-hp-stars svg",[0,1,1],[["width","14px"],["height","14px"],["color","$watchDot"]]],[".efp-hp-stars span",[0,1,1],[["font-weight","500"],["color","$ink3"]]],[".efp-hp-pick__line",[0,1,0],[["margin-top","3px"],["font-size","14px"],["line-height","1.4"],["color","$ink2"]]],[".efp-hp-buy",[0,1,0],[["display","flex"],["justify-content","space-between"],["align-items","center"],["gap","12px"],["margin-top","12px"]]],[".efp-hp-price",[0,1,0],[["display","flex"],["flex-wrap","wrap"],["align-items","baseline"],["gap","0 8px"],["min-width","0"]]],[".efp-hp-price b",[0,1,1],[["font-size","24px"],["font-weight","800"],["line-height","1.1"],["font-variant-numeric","tabular-nums"]]],[".efp-hp-price s",[0,1,1],[["font-size","15px"],["font-weight","700"],["color","$riskInk"],["text-decoration-thickness","2px"]]],[".efp-hp-price small",[0,1,1],[["flex-basis","100%"],["margin-top","3px"],["font-size","12.5px"],["line-height","1.35"],["color","$ink3"]]],[".efp-hp-buy .efp-emb-btn",[0,2,0],[["flex","none"],["min-height","46px"],["padding","0 20px"]]],[".efp-hp-more",[0,1,0],[["display","flex"],["flex-wrap","wrap"],["gap","0 18px"],["margin-top","8px"]]],[".efp-hp-more button",[0,1,1],[["min-height","34px"],["font-size","14px"],["font-weight","700"],["color","$link"],["text-decoration","underline"],["text-decoration-thickness","1.5px"],["text-underline-offset","3px"]]],[".efp-hp-need > .efp-hp-more",[0,2,0],[["margin-top","10px"]]],[".efp-hp-on",[0,1,0],[["display","grid"],["grid-template-columns","34px minmax(0, 1fr) auto"],["gap","10px"],["align-items","center"],["margin-top","12px"],["padding","10px 10px 10px 12px"],["border-radius","14px"],["background","$clearBg"]]],[".efp-hp-on__ic",[0,1,0],[["width","34px"],["height","34px"],["border-radius","50%"],["background","$clearDot"],["color","$card"],["display","grid"],["place-items","center"]]],[".efp-hp-on__ic svg",[0,1,1],[["width","18px"],["height","18px"]]],[".efp-hp-on strong",[0,1,1],[["display","block"],["font-size","15px"],["color","$clearInk"],["line-height","1.25"]]],[".efp-hp-on small",[0,1,1],[["display","block"],["margin-top","1px"],["font-size","13px"],["line-height","1.35"],["color","$ink2"]]],[".efp-hp-on button",[0,1,1],[["min-height","38px"],["padding","0 14px"],["border-radius","999px"],["background","$card"],["font-size","14px"],["font-weight","800"],["box-shadow","inset 0 0 0 1.5px $ink"],["transition","transform 160ms cubic-bezier(0.23, 1, 0.32, 1)"]]],[".efp-is-on > .efp-hp-buy",[0,2,0],[["display","none"]]],[".efp-is-on [data-once]",[0,2,0],[["display","none"]]],[".efp-hp-by",[0,1,0],[["display","grid"],["grid-template-columns","40px minmax(0, 1fr)"],["gap","10px"],["align-items","center"],["margin-top","14px"],["padding","0 2px"]]],[".efp-hp-by img",[0,1,1],[["width","40px"],["height","40px"],["border-radius","50%"],["object-fit","cover"],["background","$tile"]]],[".efp-hp-by strong",[0,1,1],[["display","block"],["font-size","15px"],["font-weight","800"],["line-height","1.25"]]],[".efp-hp-by small",[0,1,1],[["display","block"],["margin-top","2px"],["font-family","$mono"],["font-size","10.5px"],["letter-spacing",".05em"],["text-transform","uppercase"],["color","$ink3"]]],[".efp-hp-steps",[0,1,0],[["margin-top","14px"],["padding","16px 12px 12px"],["border-radius","22px"],["background","$card"],["box-shadow","0 1px 3px $wash"]]],[".efp-hp-steps__head",[0,1,0],[["display","flex"],["justify-content","space-between"],["align-items","baseline"],["gap","12px"],["padding","0 4px"]]],[".efp-hp-steps__head h3",[0,1,1],[["font-size","19px"],["font-weight","800"],["line-height","1.2"]]],[".efp-hp-steps__head p",[0,1,1],[["font-family","$mono"],["font-size","11px"],["letter-spacing",".05em"],["text-transform","uppercase"],["color","$ink3"],["white-space","nowrap"]]],[".efp-hp-list",[0,1,0],[["list-style","none"],["margin","6px 0 0"],["padding","0"],["display","grid"],["gap","2px"]]],[".efp-hp-swipe",[0,1,0],[["display","flex"],["gap","10px"],["overflow-x","auto"],["scroll-snap-type","x mandatory"],["overscroll-behavior-x","contain"],["scrollbar-width","none"],["-webkit-overflow-scrolling","touch"]]],[".efp-hp-swipe[data-ef-focus-visible]",[0,2,0],[["border-radius","18px"]]],[".efp-hp-swipe > *",[0,1,0],[["flex","0 0 78%"],["max-width","280px"],["scroll-snap-align","start"]]],[".efp-hp-steps .efp-hp-swipe",[0,2,0],[["margin","10px -12px 0"],["padding","0 12px 2px"],["scroll-padding-inline","12px"]]],[".efp-hp-tip",[0,1,0],[["display","flex"],["flex-direction","column"],["padding","14px 14px 12px"],["border-radius","18px"]]],[".efp-hp-tip--y",[0,1,0],[["background","$accentChip"]]],[".efp-hp-tip--c",[0,1,0],[["background","$linkChip"]]],[".efp-hp-tip--g",[0,1,0],[["background","$clearChip"]]],[".efp-hp-tip--r",[0,1,0],[["background","$riskChip"]]],[".efp-hp-tip__top",[0,1,0],[["display","flex"],["justify-content","space-between"],["align-items","center"]]],[".efp-hp-tip__top svg",[0,1,1],[["width","26px"],["height","26px"],["color","$ink"]]],[".efp-hp-tip__n",[0,1,0],[["font-family","$serif"],["font-size","30px"],["font-weight","900"],["line-height","1"]]],[".efp-hp-tip strong",[0,1,1],[["display","block"],["margin-top","14px"],["font-size","17px"],["font-weight","800"],["line-height","1.25"]]],[".efp-hp-tip small",[0,1,1],[["display","block"],["margin-top","4px"],["font-size","14.5px"],["line-height","1.4"],["color","$ink2"]]],[".efp-hp-tip em",[0,1,1],[["display","block"],["margin-top","auto"],["padding-top","10px"],["font-style","normal"],["font-family","$mono"],["font-size","10.5px"],["letter-spacing",".04em"],["text-transform","uppercase"],["color","$link"]]],[".efp-hp-eyebrow",[0,1,0],[["font-family","$mono"],["font-size","11px"],["letter-spacing",".07em"],["text-transform","uppercase"],["color","$ink3"],["margin-bottom","6px"]]],[".efp-hp-head .efp-hp-eyebrow + h2",[0,2,1],[["margin-top","0"]]],[".efp-hp-by",[0,1,0],[["grid-template-columns","40px minmax(0, 1fr) 22px"],["margin-top","14px"],["padding","10px 12px"],["border-radius","16px"],["background","$card"],["box-shadow","0 1px 3px $wash"]]],[".efp-hp-by__ok",[0,1,0],[["width","22px"],["height","22px"],["color","$link"]]],[".efp-hp-says",[0,1,0],[["display","grid"],["grid-template-columns","32px minmax(0, 1fr)"],["gap","10px"],["align-items","start"],["margin","12px 0 0"],["padding","10px 12px"],["border-radius","14px"],["background","$paper"]]],[".efp-hp-says img",[0,1,1],[["width","32px"],["height","32px"],["border-radius","50%"],["object-fit","cover"]]],[".efp-hp-says p",[0,1,1],[["font-size","14.5px"],["line-height","1.4"],["color","$ink2"]]],[".efp-hp-says b",[0,1,1],[["color","$ink"],["font-weight","800"],["margin-right","2px"]]],[".efp-hp-jump",[0,1,0],[["width","100%"],["display","grid"],["grid-template-columns","44px minmax(0, 1fr) auto"],["gap","12px"],["align-items","center"],["margin-top","12px"],["padding","8px 14px 8px 8px"],["border-radius","14px"],["background","$primary"],["color","$onPrimary"],["text-align","left"],["transition","transform 160ms cubic-bezier(0.23, 1, 0.32, 1)"]]],[".efp-hp-jump img",[0,1,1],[["width","44px"],["height","44px"],["border-radius","10px"],["object-fit","cover"],["background","$card"]]],[".efp-hp-jump small",[0,1,1],[["display","block"],["font-size","13px"],["font-weight","800"],["color","$accent"]]],[".efp-hp-jump strong",[0,1,1],[["display","block"],["font-size","15px"],["font-weight","800"],["line-height","1.25"]]],[".efp-hp-jump__go",[0,1,0],[["font-size","14px"],["font-weight","800"]]],[".efp-hp-n",[0,1,0],[["flex","none"]]],[".efp-hp-steps__head h3",[0,1,1],[["display","flex"],["align-items","center"],["gap","10px"],["font-size","19px"],["font-weight","800"],["line-height","1.2"]]],[".efp-hp-sec__h",[0,1,0],[["display","flex"],["align-items","center"],["gap","10px"],["font-size","19px"],["font-weight","800"],["line-height","1.2"]]],[".efp-hp-sec",[0,1,0],[["margin-top","14px"],["padding","16px"],["border-radius","22px"],["background","$card"],["box-shadow","0 1px 3px $wash"],["scroll-margin-top","12px"]]],[".efp-hp-sec .efp-hp-pick",[0,2,0],[["margin-top","14px"],["padding","0"],["background","none"]]],[".efp-hp-sec .efp-hp-pick__top",[0,2,0],[["grid-template-columns","76px minmax(0, 1fr)"]]],[".efp-hp-sec .efp-hp-pick__img",[0,2,0],[["width","76px"],["height","76px"],["background","$paper"]]],[".efp-hp-mini",[0,1,0],[["font-family","$mono"],["font-size","10.5px"],["letter-spacing",".06em"],["text-transform","uppercase"],["color","$ink3"]]],[".efp-hp-why",[0,1,0],[["margin-top","14px"],["padding","12px 14px"],["border-radius","16px"],["box-shadow","inset 0 0 0 1.5px $ink"]]],[".efp-hp-why ul",[0,1,1],[["list-style","none"],["margin","0"],["padding","0"]]],[".efp-hp-dose ul",[0,1,1],[["list-style","none"],["margin","0"],["padding","0"]]],[".efp-hp-why li",[0,1,1],[["display","grid"],["grid-template-columns","58px minmax(0, 1fr)"],["gap","10px"],["align-items","start"],["margin-top","10px"]]],[".efp-hp-why strong",[0,1,1],[["display","block"],["font-size","15px"],["font-weight","800"],["line-height","1.3"]]],[".efp-hp-why small",[0,1,1],[["display","block"],["margin-top","1px"],["font-size","14px"],["line-height","1.4"],["color","$ink2"]]],[".efp-hp-chip",[0,1,0],[["height","22px"],["border-radius","6px"],["display","grid"],["place-items","center"],["font-family","$mono"],["font-size","10.5px"],["font-weight","700"],["letter-spacing",".04em"],["text-transform","uppercase"]]],[".efp-hp-chip--dna",[0,1,0],[["background","$linkWash"],["color","$link"]]],[".efp-hp-chip--ask",[0,1,0],[["background","$accent4"],["color","$ink"]]],[".efp-hp-chip--rec",[0,1,0],[["background","$tile"],["color","$ink2"]]],[".efp-hp-dose",[0,1,0],[["margin-top","10px"],["padding","12px 14px 14px"],["border-radius","16px"],["background","$linkWash"]]],[".efp-hp-dose .efp-hp-mini",[0,2,0],[["color","$link"]]],[".efp-hp-dose ul",[0,1,1],[["display","grid"],["grid-template-columns","repeat(3, minmax(0, 1fr))"],["gap","8px"],["margin-top","10px"]]],[".efp-hp-dose li",[0,1,1],[["display","grid"],["justify-items","center"],["gap","2px"],["padding","10px 4px"],["border-radius","12px"],["background","$card"],["text-align","center"]]],[".efp-hp-dose b",[0,1,1],[["font-family","$mono"],["font-size","21px"],["font-weight","700"],["line-height","1.1"],["font-variant-numeric","tabular-nums"]]],[".efp-hp-dose small",[0,1,1],[["font-size","12.5px"],["line-height","1.3"],["color","$ink2"]]],[".efp-hp-dose > p:last-child",[0,2,1],[["margin-top","10px"],["font-size","14px"],["line-height","1.45"],["color","$link"]]],[".efp-hp-in",[0,1,0],[["display","flex"],["flex-wrap","wrap"],["gap","6px"],["margin-top","12px"]]],[".efp-hp-in span",[0,1,1],[["padding","6px 10px"],["border-radius","999px"],["background","$tile"],["font-size","13.5px"],["font-weight","600"]]],[".efp-hp-opts",[0,1,0],[["display","grid"],["gap","8px"],["margin-top","14px"]]],[".efp-hp-opt",[0,1,0],[["width","100%"],["display","flex"],["justify-content","space-between"],["align-items","center"],["gap","12px"],["padding","14px"],["border-radius","16px"],["background","$card"],["text-align","left"],["box-shadow","inset 0 0 0 1.5px $n_DEDCD7"],["transition","box-shadow 160ms ease, transform 160ms cubic-bezier(0.23, 1, 0.32, 1)"]]],['.efp-hp-opt[aria-checked="true"]',[0,2,0],[["box-shadow","inset 0 0 0 2.5px $ink"]]],[".efp-hp-opt__t",[0,1,0],[["display","grid"],["justify-items","start"],["gap","2px"]]],[".efp-hp-opt__t strong",[0,1,1],[["font-size","16px"],["font-weight","800"]]],[".efp-hp-opt__t small",[0,1,1],[["font-size","13.5px"],["color","$ink2"]]],[".efp-hp-opt__tag",[0,1,0],[["margin-bottom","4px"],["padding","2px 8px"],["border-radius","6px"],["background","$riskInk"],["color","$card"],["font-size","12px"],["font-weight","800"]]],[".efp-hp-opt__p",[0,1,0],[["font-size","18px"],["font-weight","800"]]],[".efp-hp-opt .efp-hp-price",[0,2,0],[["display","flex"],["flex-direction","column"],["align-items","flex-end"],["flex-wrap","nowrap"]]],[".efp-hp-opt .efp-hp-price s",[0,2,1],[["order","-1"]]],[".efp-hp-opt .efp-hp-price small",[0,2,1],[["display","none"]]],[".efp-hp-sec .efp-hp-buy",[0,2,0],[["display","block"],["margin-top","12px"]]],[".efp-hp-sec .efp-hp-buy .efp-emb-btn",[0,3,0],[["width","100%"],["min-height","52px"],["font-size","17px"]]],[".efp-hp-trust",[0,1,0],[["list-style","none"],["margin","12px 0 0"],["padding","0"],["display","grid"],["grid-template-columns","repeat(3, minmax(0, 1fr))"],["gap","6px"]]],[".efp-hp-trust li",[0,1,1],[["display","grid"],["justify-items","center"],["gap","4px"],["font-size","12.5px"],["font-weight","600"],["line-height","1.3"],["text-align","center"],["color","$ink2"]]],[".efp-hp-trust svg",[0,1,1],[["width","20px"],["height","20px"],["color","$link"]]],[".efp-is-on > .efp-hp-opts",[0,2,0],[["display","none"]]],[".efp-is-on > .efp-hp-trust",[0,2,0],[["display","none"]]],[".efp-hp-fine",[0,1,0],[["margin-top","8px"],["font-size","13px"],["line-height","1.45"],["color","$ink3"]]],[".efp-hp-sign",[0,1,0],[["margin-top","12px"],["padding","14px"],["border-radius","16px"],["box-shadow","inset 0 0 0 1.5px $n_DEDCD7"]]],[".efp-hp-sign h4",[0,1,1],[["display","flex"],["align-items","center"],["gap","8px"],["font-size","16px"],["font-weight","800"],["line-height","1.25"]]],[".efp-hp-sign p",[0,1,1],[["margin-top","4px"],["font-size","15px"],["line-height","1.45"],["color","$ink2"]]],[".efp-hp-sign--er",[0,1,0],[["background","$riskBg"],["box-shadow","none"]]],[".efp-hp-sign--er h4",[0,1,1],[["color","$riskInk"]]],[".efp-hp-sign--er h4 svg",[0,1,2],[["width","20px"],["height","20px"]]],[".efp-hp-sign--er p",[0,1,1],[["color","$ink"]]],[".efp-hp-qs",[0,1,0],[["margin","10px 0 0"],["padding-left","22px"],["display","grid"],["gap","6px"],["font-size","15px"],["line-height","1.45"]]],[".efp-hp-sec .efp-hp-add",[0,2,0],[["display","flex"],["align-items","center"],["justify-content","center"],["width","100%"],["padding","0 16px"],["min-height","48px"],["margin-top","14px"],["border-radius","999px"],["font-size","16px"],["font-weight","800"],["box-shadow","inset 0 0 0 2px $ink"],["transition","transform 160ms cubic-bezier(0.23, 1, 0.32, 1), background-color 180ms ease"]]],['.efp-hp-sec .efp-hp-add[aria-pressed="true"]',[0,3,0],[["background","$clearBg"],["color","$clearInk"],["box-shadow","none"]]],[".efp-hp-revs",[0,1,0],[["margin","12px -16px 0"],["padding","0 16px"],["scroll-padding-inline","16px"]]],[".efp-hp-rev",[0,1,0],[["margin","0"],["padding","12px 14px"],["border-radius","14px"],["background","$paper"]]],[".efp-hp-rev__s",[0,1,0],[["display","flex"],["gap","1px"],["color","$watchDot"]]],[".efp-hp-rev__s svg",[0,1,1],[["width","13px"],["height","13px"]]],[".efp-hp-rev blockquote",[0,1,1],[["margin","5px 0 0"],["font-size","15px"],["line-height","1.4"]]],[".efp-hp-rev figcaption",[0,1,1],[["margin-top","4px"],["font-size","13px"],["color","$ink3"]]],[".efp-hp-score",[0,1,0],[["display","flex"],["justify-content","space-between"],["align-items","center"],["gap","8px"],["margin-top","12px"],["padding","11px 12px 11px 14px"],["border-radius","12px"],["background","$primary"],["color","$onPrimary"],["font-size","14.5px"],["font-weight","800"],["line-height","1.3"]]],[".efp-hp-score b",[0,1,1],[["flex","none"],["font-family","$mono"],["font-size","16px"],["font-weight","700"],["color","$accent"]]],[".efp-hp-opt--once",[0,1,0],[["padding","10px 14px"],["background","$paper"],["box-shadow","none"]]],[".efp-hp-opt--once .efp-hp-opt__t strong",[0,2,1],[["font-size","15px"],["font-weight","700"]]],[".efp-hp-opt--once .efp-hp-opt__t small",[0,2,1],[["font-size","13px"]]],[".efp-hp-opt--once .efp-hp-opt__p",[0,2,0],[["font-size","15px"],["font-weight","700"],["color","$ink2"]]],['.efp-hp-opt--once[aria-checked="true"]',[0,2,0],[["background","$card"],["box-shadow","inset 0 0 0 2px $ink"]]],[".efp-hp-proof",[0,1,0],[["display","flex"],["justify-content","center"],["align-items","center"],["gap","6px"],["margin-top","10px"],["font-size","14.5px"],["font-weight","800"],["color","$riskInk"]]],[".efp-hp-proof svg",[0,1,1],[["width","21px"],["height","21px"],["flex","none"],["margin-top","-2px"]]],[".efp-is-on > .efp-hp-proof",[0,2,0],[["display","none"]]],[".efp-hp-qs__k",[0,1,0],[["margin-top","18px"],["font-size","16px"],["font-weight","800"],["line-height","1.25"]]],[".efp-hp-qs__k + .efp-hp-qs",[0,2,0],[["margin-top","6px"]]],[".efp-hp-xs",[0,1,0],[["margin-top","22px"],["display","grid"],["gap","10px"]]],[".efp-hp-xs .efp-hp-eyebrow",[0,2,0],[["margin","0 4px"],["font-weight","400"]]],[".efp-hp-x",[0,1,0],[["display","grid"],["grid-template-columns","56px minmax(0, 1fr)"],["gap","4px 12px"],["align-items","start"],["padding","14px"],["border-radius","22px"],["background","$card"],["box-shadow","0 1px 3px $wash"]]],[".efp-hp-x > img",[0,1,1],[["width","56px"],["height","56px"],["border-radius","14px"],["object-fit","cover"],["background","$card"]]],[".efp-hp-x__ic",[0,1,0],[["width","56px"],["height","56px"],["border-radius","14px"],["object-fit","cover"],["background","$card"]]],[".efp-hp-x__ic",[0,1,0],[["display","grid"],["place-items","center"],["background","$linkWash"],["color","$link"]]],[".efp-hp-x__ic svg",[0,1,1],[["width","26px"],["height","26px"]]],[".efp-hp-x h4",[0,1,1],[["font-size","17px"],["font-weight","800"],["line-height","1.2"]]],[".efp-hp-x h4.efp-serif",[0,2,1],[["font-size","21px"]]],[".efp-hp-x p",[0,1,1],[["margin-top","3px"],["font-size","14.5px"],["line-height","1.4"],["color","$ink2"]]],[".efp-hp-x .efp-hp-x__p",[0,2,0],[["display","flex"],["flex-wrap","wrap"],["align-items","center"],["gap","0 8px"],["margin-top","6px"],["color","$ink"]]],[".efp-hp-x__p b",[0,1,1],[["font-size","19px"],["font-weight","800"],["font-variant-numeric","tabular-nums"]]],[".efp-hp-x__p s",[0,1,1],[["font-size","14px"],["font-weight","700"],["color","$ink3"]]],[".efp-hp-x__go",[0,1,0],[["grid-column","2"],["justify-self","start"],["margin-top","8px"],["min-height","40px"],["padding","0 18px"],["border-radius","999px"],["background","$primary"],["color","$onPrimary"],["font-size","14.5px"],["font-weight","800"],["transition","transform 160ms cubic-bezier(0.23, 1, 0.32, 1), background-color 180ms ease"]]],['.efp-hp-x__go[aria-pressed="true"]',[0,2,0],[["background","$clearBg"],["color","$clearInk"]]],[".efp-hp-x--kit",[0,1,0],[["background","$linkWash"],["box-shadow","none"]]],[".efp-hp-x--kit > img",[0,1,1],[["background","$card"]]],[".efp-hp-next",[0,1,0],[["list-style","none"],["margin","22px 0 0"],["padding","4px 16px"],["border-radius","18px"],["background","$card"],["text-align","left"],["box-shadow","0 1px 3px $wash"]]],[".efp-hp-next li",[0,1,1],[["display","grid"],["grid-template-columns","36px minmax(0, 1fr)"],["gap","12px"],["align-items","center"],["padding","10px 0"]]],[".efp-hp-next__ic",[0,1,0],[["width","36px"],["height","36px"],["border-radius","11px"],["background","$linkWash"],["color","$link"],["display","grid"],["place-items","center"]]],[".efp-hp-next__ic svg",[0,1,1],[["width","19px"],["height","19px"]]],[".efp-hp-next small",[0,1,1],[["display","block"],["font-family","$mono"],["font-size","10.5px"],["letter-spacing",".05em"],["text-transform","uppercase"],["color","$ink3"]]],[".efp-hp-next span",[0,1,1],[["display","block"],["margin-top","1px"],["font-size","15px"],["font-weight","600"],["line-height","1.35"]]],[".efp-co",[0,1,0],[["display","grid"],["gap","10px"],["margin-top","2px"]]],[".efp-co-prod",[0,1,0],[["display","grid"],["grid-template-columns","56px minmax(0, 1fr)"],["gap","12px"],["align-items","center"]]],[".efp-co-prod__img",[0,1,0],[["width","56px"],["height","56px"],["border-radius","14px"],["background","$accent3"],["color","$ink"],["overflow","hidden"],["display","grid"],["place-items","center"]]],[".efp-co-prod__img img",[0,1,1],[["width","100%"],["height","100%"],["object-fit","cover"]]],[".efp-co-prod__img svg",[0,1,1],[["width","30px"],["height","30px"]]],[".efp-co-prod p",[0,1,1],[["margin-top","2px"],["font-size","14px"],["line-height","1.35"],["color","$ink2"]]],[".efp-co-prod__t",[0,1,0],[["font-size","20px"],["font-weight","800"],["line-height","1.2"],["color","$ink"]]],[".efp-co-prod .efp-co-prod__t",[0,2,0],[["margin-top","0"]]],[".efp-co-opts",[0,1,0],[["display","grid"],["gap","8px"]]],[".efp-co-opt",[0,1,0],[["border-radius","16px"],["box-shadow","inset 0 0 0 1.5px $n_DAD7D1"],["transition","box-shadow 160ms ease, background-color 160ms ease"]]],[".efp-co-opt.efp-is-on",[0,2,0],[["background","$accent4"],["box-shadow","inset 0 0 0 2px $ink"]]],[".efp-co-opt.efp-is-on .efp-bk__radio",[0,3,0],[["box-shadow","inset 0 0 0 7px $ink"]]],[".efp-co-opt__hit",[0,1,0],[["width","100%"],["display","grid"],["grid-template-columns","22px minmax(0, 1fr) auto"],["gap","2px 12px"],["align-items","start"],["padding","12px 14px"],["border-radius","16px"],["text-align","left"]]],[".efp-co-opt__hit strong",[0,1,1],[["font-size","16px"],["line-height","1.35"]]],[".efp-co-opt__p",[0,1,0],[["text-align","right"],["font-size","16px"],["font-weight","800"],["line-height","1.35"],["font-variant-numeric","tabular-nums"]]],[".efp-co-opt__p s",[0,1,1],[["display","block"],["font-size","13px"],["font-weight","600"],["color","$riskInk"]]],[".efp-co-opt__hit small",[0,1,1],[["grid-column","2 / -1"],["font-size","13px"],["line-height","1.4"],["color","$ink2"]]],[".efp-co-k",[0,1,0],[["font-family","$mono"],["font-size","10.5px"],["letter-spacing",".06em"],["text-transform","uppercase"],["color","$ink3"],["margin-bottom","6px"]]],[".efp-co-every",[0,1,0],[["display","grid"],["grid-template-columns","repeat(3, minmax(0, 1fr))"],["gap","4px"],["padding","4px"],["border-radius","999px"],["background","$card"],["box-shadow","inset 0 0 0 1.5px $n_DAD7D1"]]],[".efp-co-when",[0,1,0],[["padding","0 14px 12px 48px"]]],[".efp-co-every button",[0,1,1],[["min-height","36px"],["padding","0 6px"],["border-radius","999px"],["font-size","14px"],["font-weight","700"],["text-align","center"],["white-space","nowrap"],["transition","background-color 160ms ease, transform 160ms cubic-bezier(0.23, 1, 0.32, 1)"]]],['.efp-co-every button[aria-checked="true"]',[0,2,1],[["background","$primary"],["color","$onPrimary"]]],[".efp-co-rows",[0,1,0],[["list-style","none"],["margin","0"],["padding","2px 14px"],["border-radius","16px"],["background","$paper"]]],[".efp-co-rows li",[0,1,1],[["display","grid"],["grid-template-columns","20px 4.6rem minmax(0, 1fr)"],["gap","10px"],["align-items","center"],["min-height","40px"],["font-size","14.5px"]]],[".efp-co-rows svg",[0,1,1],[["width","20px"],["height","20px"],["color","$ink2"]]],[".efp-co-rows span",[0,1,1],[["color","$ink3"]]],[".efp-co-rows b",[0,1,1],[["font-weight","700"]]],[".efp-co-fine",[0,1,0],[["font-size","12.5px"],["line-height","1.45"],["color","$ink3"],["text-align","center"]]],[".efp-mg-cancel",[0,1,0],[["justify-self","center"],["min-height","40px"],["font-size","14.5px"],["font-weight","700"],["color","$riskInk"]]],[".efp-hp-tools",[0,1,0],[["display","flex"],["align-items","center"],["justify-content","space-between"],["gap","8px"],["margin","-8px -6px 2px 2px"]]],[".efp-hp-tools .efp-hp-eyebrow",[0,2,0],[["margin","0"]]],[".efp-hp-tools__end",[0,1,0],[["display","flex"],["align-items","center"],["gap","2px"]]],[".efp-hp-orders",[0,1,0],[["display","inline-flex"],["align-items","center"],["gap","6px"],["min-height","44px"],["padding","0 8px"],["border-radius","999px"],["font-size","15px"],["font-weight","700"]]],[".efp-hp-orders svg",[0,1,1],[["width","21px"],["height","21px"]]],[".efp-hp-cart",[0,1,0],[["position","relative"],["width","44px"],["height","44px"],["display","grid"],["place-items","center"],["border-radius","50%"]]],[".efp-hp-cart svg",[0,1,1],[["width","26px"],["height","26px"]]],[".efp-hp-cart__n",[0,1,0],[["position","absolute"],["top","3px"],["right","1px"],["min-width","20px"],["height","20px"],["padding","0 5px"],["border-radius","999px"],["background","$riskDot"],["color","$card"],["font-size","12px"],["font-weight","800"],["line-height","20px"],["text-align","center"],["font-variant-numeric","tabular-nums"],["box-shadow","0 0 0 2px $paper"]]],[".efp-hp-ask-row",[0,1,0],[["width","100%"],["display","grid"],["grid-template-columns","40px minmax(0, 1fr) 18px"],["gap","12px"],["align-items","center"],["margin-top","10px"],["padding","12px 14px 12px 12px"],["border-radius","16px"],["background","$linkWash"],["text-align","left"],["transition","transform 160ms cubic-bezier(0.23, 1, 0.32, 1)"]]],[".efp-hp-ask-row__ic",[0,1,0],[["width","40px"],["height","40px"],["border-radius","11px"],["background","$card"],["color","$link"],["display","grid"],["place-items","center"]]],[".efp-hp-ask-row__ic svg",[0,1,1],[["width","21px"],["height","21px"]]],[".efp-hp-ask-row strong",[0,1,1],[["display","block"],["font-size","15.5px"],["font-weight","800"],["line-height","1.3"]]],[".efp-hp-ask-row small",[0,1,1],[["display","block"],["margin-top","1px"],["font-size","14px"],["line-height","1.4"],["color","$ink2"]]],[".efp-hp-ask-row > svg",[0,1,1],[["width","18px"],["height","18px"],["color","$ink2"]]],[".efp-hp-sec .efp-hp-ask-row",[0,2,0],[["margin-top","12px"]]],[".efp-hp-wait",[0,1,0],[["margin-top","14px"],["padding","16px"],["border-radius","22px"],["background","$card"],["box-shadow","0 1px 3px $wash"]]],[".efp-hp-wait__top",[0,1,0],[["display","grid"],["grid-template-columns","46px minmax(0, 1fr)"],["gap","12px"],["align-items","center"]]],[".efp-hp-wait__top h3",[0,1,1],[["font-size","26px"],["line-height","1.05"],["margin-top","2px"]]],[".efp-hp-wait .efp-sh-track",[0,2,0],[["margin-top","14px"]]],[".efp-hp-wait__k",[0,1,0],[["margin-top","18px"],["font-size","16px"],["font-weight","800"]]],[".efp-hp-next--in",[0,1,0],[["margin-top","8px"],["background","$paper"],["box-shadow","none"]]],[".efp-hp-wait__text",[0,1,0],[["display","flex"],["align-items","center"],["gap","8px"],["margin","16px 0 12px"],["font-size","15.5px"],["font-weight","700"]]],[".efp-hp-wait__text svg",[0,1,1],[["width","20px"],["height","20px"],["color","$link"],["flex","none"]]],[".efp-sh-track",[0,1,0],[["list-style","none"],["margin","0"],["padding","0"]]],[".efp-sh-track li",[0,1,1],[["position","relative"],["display","grid"],["grid-template-columns","22px minmax(0, 1fr)"],["gap","12px"],["padding-bottom","16px"]]],[".efp-sh-track li:last-child",[0,2,1],[["padding-bottom","0"]]],[".efp-sh-track li > .efp-before",[0,2,1],[["position","absolute"],["left","10px"],["top","20px"],["bottom","-2px"],["width","2px"],["border-radius","1px"],["background","$n_E2DFD9"]]],[".efp-sh-track li:last-child > .efp-before",[0,3,1],[["display","none"]]],[".efp-sh-track li.efp-is-done:has(+ li.efp-is-done) > .efp-before",[0,4,2],[["background","$primary"]]],[".efp-sh-track__dot",[0,1,0],[["width","22px"],["height","22px"],["border-radius","50%"],["display","grid"],["place-items","center"],["background","$card"],["box-shadow","inset 0 0 0 2px $n_CFCBC4"],["position","relative"],["z-index","1"]]],[".efp-sh-track__dot svg",[0,1,1],[["width","13px"],["height","13px"],["color","$card"]]],[".efp-sh-track .efp-is-done .efp-sh-track__dot",[0,3,0],[["background","$primary"],["box-shadow","none"]]],[".efp-sh-track .efp-is-now .efp-sh-track__dot",[0,3,0],[["background","$accent"],["box-shadow","inset 0 0 0 2px $ink"]]],[".efp-sh-track strong",[0,1,1],[["display","block"],["font-size","15.5px"],["font-weight","800"],["line-height","1.3"]]],[".efp-sh-track small",[0,1,1],[["display","block"],["margin-top","1px"],["font-size","14px"],["line-height","1.35"],["color","$ink3"]]],[".efp-sh-track li:not(.efp-is-done):not(.efp-is-now) strong",[0,3,2],[["color","$ink3"],["font-weight","700"]]],[".efp-sh",[0,1,0],[["display","grid"],["gap","12px"],["padding","8px 18px 28px"]]],[".efp-sh-title",[0,1,0],[["font-size","29px"],["line-height","1.08"]]],[".efp-sh-sub2",[0,1,0],[["margin-top","-6px"],["font-size","15px"],["line-height","1.45"],["color","$ink2"]]],[".efp-sh-k",[0,1,0],[["margin","6px 2px -4px"],["font-size","16px"],["font-weight","800"]]],[".efp-sh-card",[0,1,0],[["padding","14px 16px"],["border-radius","22px"],["background","$card"],["box-shadow","0 1px 3px $wash"]]],[".efp-sh-items",[0,1,0],[["list-style","none"],["margin","0"],["padding","0"],["display","grid"],["gap","18px"]]],[".efp-sh-item",[0,1,0],[["display","grid"],["grid-template-columns","64px minmax(0, 1fr)"],["gap","12px"],["align-items","start"]]],[".efp-sh-item__img",[0,1,0],[["width","64px"],["height","64px"],["border-radius","14px"],["overflow","hidden"],["display","grid"],["place-items","center"],["background","$linkWash"],["color","$link"]]],[".efp-sh-item__img img",[0,1,1],[["width","100%"],["height","100%"],["object-fit","cover"]]],[".efp-sh-item__img svg",[0,1,1],[["width","28px"],["height","28px"]]],[".efp-sh-item h3",[0,1,1],[["font-size","16.5px"],["font-weight","800"],["line-height","1.25"]]],[".efp-sh-item__p",[0,1,0],[["display","flex"],["flex-wrap","wrap"],["align-items","center"],["gap","2px 8px"],["margin-top","3px"]]],[".efp-sh-item__p b",[0,1,1],[["font-size","16px"],["font-weight","800"],["font-variant-numeric","tabular-nums"]]],[".efp-sh-item__p s",[0,1,1],[["font-size","14px"],["font-weight","600"],["color","$ink3"]]],[".efp-sh-item__p small",[0,1,1],[["font-size","14px"],["color","$ink3"]]],[".efp-sh-item__acts",[0,1,0],[["display","flex"],["align-items","center"],["gap","16px"],["margin-top","8px"]]],[".efp-sh-step",[0,1,0],[["display","inline-grid"],["grid-template-columns","40px 30px 40px"],["align-items","center"],["height","40px"],["border-radius","999px"],["background","$card"],["box-shadow","inset 0 0 0 1.5px $n_DAD7D1"]]],[".efp-sh-step button",[0,1,1],[["height","40px"],["display","grid"],["place-items","center"],["border-radius","999px"],["transition","transform 160ms cubic-bezier(0.23, 1, 0.32, 1)"]]],[".efp-sh-step button svg",[0,1,2],[["width","16px"],["height","16px"]]],[".efp-sh-step button[disabled]",[0,2,1],[["opacity",".3"],["cursor","default"]]],[".efp-sh-step output",[0,1,1],[["text-align","center"],["font-size","15.5px"],["font-weight","800"],["font-variant-numeric","tabular-nums"]]],[".efp-sh-rm",[0,1,0],[["min-height","40px"],["font-size","14.5px"],["font-weight","700"],["color","$ink2"],["text-decoration","underline"],["text-decoration-thickness","1.5px"],["text-underline-offset","3px"]]],[".efp-sh-mode",[0,1,0],[["display","grid"],["gap","6px"],["margin-top","8px"]]],[".efp-sh-mode button",[0,1,1],[["display","flex"],["justify-content","space-between"],["align-items","center"],["gap","10px"],["min-height","44px"],["padding","8px 12px"],["border-radius","12px"],["background","$paper"],["font-size","14.5px"],["font-weight","700"],["line-height","1.3"],["text-align","left"],["transition","box-shadow 160ms ease, transform 160ms cubic-bezier(0.23, 1, 0.32, 1)"]]],['.efp-sh-mode button[aria-checked="true"]',[0,2,1],[["background","$card"],["box-shadow","inset 0 0 0 2px $ink"]]],[".efp-sh-mode b",[0,1,1],[["font-weight","800"],["font-variant-numeric","tabular-nums"]]],[".efp-sh-item .efp-co-every",[0,2,0],[["margin-top","8px"]]],[".efp-sh-sum li.efp-is-renew",[0,2,1],[["min-height","28px"],["margin-top","-6px"],["font-size","14px"]]],[".efp-sh-sum",[0,1,0],[["list-style","none"],["margin","0"],["padding","6px 16px"],["border-radius","16px"],["background","$card"],["box-shadow","0 1px 3px $wash"]]],[".efp-sh-sum li",[0,1,1],[["display","flex"],["justify-content","space-between"],["align-items","center"],["gap","12px"],["min-height","34px"],["font-size","15px"],["font-variant-numeric","tabular-nums"]]],[".efp-sh-sum li > span:first-child",[0,2,2],[["color","$ink2"],["display","inline-flex"],["align-items","center"],["gap","8px"]]],[".efp-sh-sum li.efp-is-total",[0,2,1],[["min-height","42px"],["font-size","17px"],["font-weight","800"]]],[".efp-sh-sum li.efp-is-total span:first-child",[0,3,2],[["color","$ink"]]],[".efp-sh-foot",[0,1,0],[["display","grid"],["gap","8px"]]],[".efp-sh-foot .efp-sh-fine",[0,2,0],[["text-align","center"]]],[".efp-sh-fine",[0,1,0],[["font-size","13px"],["line-height","1.45"],["color","$ink3"]]],[".efp-sh-fine--c",[0,1,0],[["margin-top","14px"],["text-align","center"]]],[".efp-sh-empty",[0,1,0],[["display","grid"],["justify-items","center"],["gap","8px"],["padding","48px 12px 8px"],["text-align","center"]]],[".efp-sh-empty .efp-emb-tile",[0,2,0],[["width","72px"],["height","72px"],["border-radius","20px"],["margin-bottom","8px"]]],[".efp-sh-empty .efp-emb-tile svg",[0,2,1],[["width","34px"],["height","34px"]]],[".efp-sh-empty h2",[0,1,1],[["font-size","28px"],["line-height","1.1"]]],[".efp-sh-empty p",[0,1,1],[["max-width","30ch"],["font-size","15.5px"],["line-height","1.45"],["color","$ink2"],["text-wrap","pretty"]]],[".efp-sh-empty .efp-emb-btn",[0,2,0],[["margin-top","12px"]]],[".efp-sh-link",[0,1,0],[["min-height","40px"],["font-size","15px"],["font-weight","700"],["color","$link"],["text-decoration","underline"],["text-decoration-thickness","1.5px"],["text-underline-offset","3px"]]],[".efp-sh-subc",[0,1,0],[["display","grid"],["grid-template-columns","56px minmax(0, 1fr) auto"],["gap","12px"],["align-items","center"],["padding","12px 14px 12px 12px"],["border-radius","22px"],["background","$clearBg"]]],[".efp-sh-subc img",[0,1,1],[["width","56px"],["height","56px"],["border-radius","14px"],["object-fit","cover"],["background","$card"]]],[".efp-sh-subc strong",[0,1,1],[["display","block"],["font-size","16px"],["font-weight","800"],["line-height","1.25"]]],[".efp-sh-subc small",[0,1,1],[["display","block"],["margin-top","2px"],["font-size","14px"],["line-height","1.35"],["color","$ink2"]]],[".efp-sh-subc button",[0,1,1],[["min-height","40px"],["padding","0 14px"],["border-radius","999px"],["background","$card"],["font-size","14px"],["font-weight","800"],["box-shadow","inset 0 0 0 1.5px $ink"],["transition","transform 160ms cubic-bezier(0.23, 1, 0.32, 1)"]]],[".efp-sh-orders",[0,1,0],[["list-style","none"],["margin","0"],["padding","0"],["display","grid"],["gap","10px"]]],[".efp-sh-order",[0,1,0],[["width","100%"],["display","grid"],["grid-template-columns","minmax(0, 1fr) 18px"],["gap","10px"],["align-items","center"],["padding","14px 14px 14px 16px"],["border-radius","22px"],["background","$card"],["box-shadow","0 1px 3px $wash"],["text-align","left"],["transition","transform 160ms cubic-bezier(0.23, 1, 0.32, 1)"]]],[".efp-sh-order > svg",[0,1,1],[["width","18px"],["height","18px"],["color","$ink3"]]],[".efp-sh-order__top",[0,1,0],[["display","flex"],["flex-wrap","wrap"],["align-items","center"],["gap","4px 10px"]]],[".efp-sh-order__no",[0,1,0],[["font-family","$mono"],["font-size","12px"],["letter-spacing",".04em"],["color","$ink3"]]],[".efp-sh-order__what",[0,1,0],[["display","block"],["margin-top","8px"],["font-size","16px"],["font-weight","800"],["line-height","1.3"]]],[".efp-sh-order__meta",[0,1,0],[["display","block"],["margin-top","2px"],["font-size","14px"],["line-height","1.4"],["color","$ink3"]]],[".efp-sh-order__pics",[0,1,0],[["display","flex"],["gap","6px"],["margin-top","10px"]]],[".efp-sh-order__pics span",[0,1,1],[["width","40px"],["height","40px"],["border-radius","10px"],["overflow","hidden"],["display","grid"],["place-items","center"],["background","$linkWash"],["color","$link"]]],[".efp-sh-order__pics img",[0,1,1],[["width","100%"],["height","100%"],["object-fit","cover"]]],[".efp-sh-order__pics svg",[0,1,1],[["width","20px"],["height","20px"]]],[".efp-sh-pill",[0,1,0],[["display","inline-flex"],["align-items","center"],["gap","6px"],["min-height","26px"],["padding","0 10px"],["border-radius","999px"],["font-size","13px"],["font-weight","800"],["background","$accent3"],["color","$ink"]]],[".efp-sh-pill--done",[0,1,0],[["background","$clearBg"],["color","$clearInk"]]],[".efp-sh-pill--sub",[0,1,0],[["background","$linkWash"],["color","$link"]]],[".efp-sh-carrier",[0,1,0],[["display","grid"],["grid-template-columns","40px minmax(0, 1fr)"],["gap","4px 12px"],["align-items","center"]]],[".efp-sh-carrier__ic",[0,1,0],[["width","40px"],["height","40px"],["border-radius","11px"],["background","$linkWash"],["color","$link"],["display","grid"],["place-items","center"]]],[".efp-sh-carrier__ic svg",[0,1,1],[["width","21px"],["height","21px"]]],[".efp-sh-carrier strong",[0,1,1],[["display","block"],["font-size","16px"],["font-weight","800"]]],[".efp-sh-carrier small",[0,1,1],[["display","flex"],["flex-wrap","wrap"],["align-items","center"],["gap","2px 8px"],["margin-top","1px"],["font-family","$mono"],["font-size","13px"],["letter-spacing",".02em"],["color","$ink2"]]],[".efp-sh-carrier .efp-emb-btn",[0,2,0],[["grid-column","1 / -1"],["margin-top","10px"]]],[".efp-sh-carrier__wait",[0,1,0],[["grid-column","2"],["font-size","14.5px"],["line-height","1.4"],["color","$ink2"]]],[".efp-sh-acts",[0,1,0],[["display","grid"],["gap","4px"],["justify-items","center"],["margin-top","4px"]]],[".efp-hp-next__ic img",[0,1,1],[["width","100%"],["height","100%"],["object-fit","cover"],["border-radius","11px"]]],[".efp-co-items",[0,1,0],[["list-style","none"],["margin","0"],["padding","0"],["display","grid"],["gap","10px"]]],[".efp-co-items li",[0,1,1],[["display","grid"],["grid-template-columns","44px minmax(0, 1fr) auto"],["gap","12px"],["align-items","center"],["font-size","15px"]]],[".efp-co-items .efp-sh-order__pics",[0,2,0],[["margin","0"]]],[".efp-co-items strong",[0,1,1],[["display","block"],["font-size","15.5px"],["font-weight","800"],["line-height","1.25"]]],[".efp-co-items small",[0,1,1],[["display","block"],["font-size","13.5px"],["color","$ink3"]]],[".efp-co-items b",[0,1,1],[["font-weight","800"],["font-variant-numeric","tabular-nums"]]],[".efp-co .efp-sh-sum",[0,2,0],[["background","$paper"],["box-shadow","none"]]],[".efp-co-items .efp-sh-order__pics span",[0,2,1],[["width","44px"],["height","44px"]]],[".efp-sh .efp-co-rows",[0,2,0],[["background","$card"],["box-shadow","0 1px 3px $wash"]]],[".efp-wt-f",[0,1,0],[["display","grid"],["gap","8px"],["margin-top","14px"],["font-size","15px"],["font-weight","700"]]],[".efp-wt-f__in",[0,1,0],[["position","relative"]]],[".efp-wt-f input",[0,1,1],[["width","100%"],["height","58px"],["border","0"],["border-radius","16px"],["padding","0 56px 0 18px"],["background","$card"],["box-shadow","inset 0 0 0 1.5px $n_DAD7D1"],["font-size","24px"],["font-weight","800"],["font-variant-numeric","tabular-nums"],["outline","none"]]],[".efp-wt-f input[data-ef-focus]",[0,2,1],[["box-shadow","inset 0 0 0 2.5px $ink"]]],[".efp-wt-f__u",[0,1,0],[["position","absolute"],["right","18px"],["top","50%"],["translate","0 -50%"],["font-size","17px"],["font-weight","700"],["color","$ink3"],["pointer-events","none"]]],[".efp-wt-err",[0,1,0],[["min-height","20px"],["margin-top","6px"],["font-size","14px"],["font-weight","700"],["color","$riskInk"]]],[".efp-wt-acts",[0,1,0],[["display","grid"],["gap","8px"],["margin-top","10px"]]],[".efp-hp-ask-row strong",[0,1,1],[["text-wrap","balance"]]],[".efp-sh-order__what",[0,1,0],[["text-wrap","balance"]]],[".efp-sh-item h3",[0,1,1],[["text-wrap","balance"]]],[".efp-co-items strong",[0,1,1],[["text-wrap","balance"]]],[".efp-sh-subc strong",[0,1,1],[["text-wrap","balance"]]],[".efp-hp-ask-row small",[0,1,1],[["text-wrap","pretty"]]],[".efp-hp-tip small",[0,1,1],[["text-wrap","pretty"]]],[".efp-sh-carrier__wait",[0,1,0],[["text-wrap","pretty"]]],[".efp-sh-fine",[0,1,0],[["text-wrap","pretty"]]],[".efp-sh-sub2",[0,1,0],[["text-wrap","pretty"]]],[".efp-hp-next span",[0,1,1],[["text-wrap","pretty"]]],[".efp-hp-wait__text",[0,1,0],[["text-wrap","pretty"]]],[".efp-wt-err",[0,1,0],[["text-wrap","pretty"]]],[".efp-hp-foot-stack",[0,1,0],[["display","grid"],["gap","10px"]]],[".efp-blanks",[0,1,0],[["display","grid"],["gap","8px"],["background","$paper"],["border-radius","20px"],["padding","12px 12px 13px"]]],[".efp-blanks__h",[0,1,0],[["display","flex"],["justify-content","space-between"],["align-items","center"],["gap","10px"],["padding","0 2px 2px"],["font-size","12.5px"],["font-weight","800"],["letter-spacing",".07em"],["text-transform","uppercase"],["color","$ink3"]]],[".efp-blanks__h em",[0,1,1],[["font-style","normal"],["letter-spacing",".01em"],["text-transform","none"],["font-size","13px"],["font-weight","800"],["color","$ink"],["background","$accent"],["border-radius","999px"],["padding","2px 10px"],["white-space","nowrap"]]],['.efp-blanks[data-st="filled"] .efp-blanks__h em',[0,3,1],[["background","$clearBg"],["color","$clearInk"]]],[".efp-blanks ol",[0,1,1],[["list-style","none"],["margin","0"],["padding","0"],["display","grid"],["gap","7px"]]],[".efp-blanks li",[0,1,1],[["display","grid"],["grid-template-columns","34px minmax(0, 1fr)"],["column-gap","11px"],["align-items","center"],["background","$card"],["border-radius","15px"],["padding","9px 12px 9px 9px"]]],[".efp-blanks li > b",[0,1,2],[["grid-row","span 2"],["width","34px"],["height","40px"],["border-radius","11px"],["display","grid"],["place-items","center"],["font-family","$serif"],["font-size","22px"],["font-weight","800"]]],[".efp-blanks li > b",[0,1,2],[["background","$accentChip"]]],[".efp-blanks li > span",[0,1,2],[["font-size","16px"],["font-weight","700"],["line-height","1.35"]]],[".efp-blanks li > small",[0,1,2],[["font-size","13.5px"],["color","$ink3"]]],[".efp-blank",[0,1,0],[["display","inline-block"],["min-width","36px"],["height","20px"],["vertical-align","-3px"],["border-radius","6px"],["background","$accent4"],["box-shadow","inset 0 0 0 1.5px $accent"],["font-style","normal"]]],[".efp-blank--s",[0,1,0],[["min-width","24px"]]],[".efp-blank--l",[0,1,0],[["min-width","64px"]]],['.efp-blanks[data-st="filled"] .efp-blank',[0,3,0],[["height","auto"],["min-width","0"],["vertical-align","0"],["background","none"],["box-shadow","none"],["padding","0 3px"],["margin","0 -3px"],["border-radius","6px"]]],[".efp-hp-blanks",[0,1,0],[["margin-top","14px"]]],[".efp-hp-blanks .efp-blanks",[0,2,0],[["background","$card"],["box-shadow","0 1px 3px $wash"]]],[".efp-hp-blanks .efp-blanks li",[0,2,1],[["background","$paper"]]],[".efp-mg-orders",[0,1,0],[["justify-self","center"]]],[".efp-hp",[0,1,0],[["background","$paper"]]],[".efp-ph-toast",[0,1,0],[["top","calc(112px - 50px)"]]],[".efp-hp-jump:not(:has(> img))",[0,1,1],[["grid-template-columns","minmax(0, 1fr) auto"]]],[".efp-hp-others",[0,1,0],[["list-style","none"],["margin-bottom","0"]]],[".efp-sheet__x",[0,1,0],[["position","relative"]]],[".efp-ph-sheet",[0,2,0],[["max-height","calc(100% - 8px)"],["padding","8px 20px 14px"]],1],[".efp-sheet__grab",[0,2,0],[["display","none"]],1],[".efp-co",[0,2,0],[["gap","8px"]],1],[".efp-co-rows li",[0,2,1],[["min-height","36px"]],1],[".efp-hp-swipe",[0,2,0],[["scrollbar-width","thin"],["scrollbar-color","$n_CFCBC4 transparent"],["padding-bottom","10px"]],1]];var RAPH_PLAN_CLASSES={root:"hp",head:"hp-head",eyebrow:"hp-eyebrow",serif:"serif",by:"hp-by",byOk:"hp-by__ok",need:"hp-need",needKicker:"hp-need__k",sources:"hp-srcs",source:"hp-src","source:dna":"hp-src--dna",needRisk:"hp-need__s",dot:"dot","dot:risk":"dot--risk",odds:"hp-odds",oddsKicker:"hp-odds__k",oddsNumbers:"hp-odds__n",tag:"cp-tag cp-tag--s",says:"hp-says",saysKicker:"hp-says__k",jump:"hp-jump",jumpGo:"hp-jump__go",steps:"hp-steps",stepsHead:"hp-steps__head",n:"hp-n",list:"hp-list hp-swipe",tip:"hp-tip",tipN:"hp-tip__n",section:"hp-sec",sectionTitle:"hp-sec__h",pick:"hp-pick",others:"hp-sec hp-others",other:"hp-pick",pickTop:"hp-pick__top",pickImage:"hp-pick__img",stars:"hp-stars",pickLine:"hp-pick__line",reviews:"hp-revs hp-swipe",review:"hp-rev",reviewStars:"hp-rev__s",score:"hp-score",why:"hp-why",mini:"hp-mini",chip:"hp-chip","chip:dna":"hp-chip--dna","chip:rec":"hp-chip--rec","chip:ask":"hp-chip--ask",dose:"hp-dose",ingredients:"hp-in",opts:"hp-opts",opt:"hp-opt","opt:once":"hp-opt--once",optText:"hp-opt__t",optTag:"hp-opt__tag",price:"hp-price",optPrice:"hp-opt__p",buy:"hp-buy",button:"emb-btn emb-btn--block",proof:"hp-proof",trust:"hp-trust",on:"hp-on",onIcon:"hp-on__ic",more:"hp-more",fine:"hp-fine",sign:"hp-sign","sign:urgent":"hp-sign--er",questionsKicker:"hp-qs__k",questions:"hp-qs",add:"hp-add",extras:"hp-xs",extrasTitle:"hp-eyebrow",extra:"hp-x","extra:kit":"hp-x--kit",extraIcon:"hp-x__ic",extraTitle:"","extraTitle:kit":"serif",extraPrice:"hp-x__p",extraGo:"hp-x__go",pageFine:"plan__fine",stateOn:"is-on",scrim:"ph-scrim",sheet:"ph-sheet",sheetGrab:"sheet__grab",sheetTop:"sheet__top",sheetKicker:"sheet__kicker",sheetClose:"sheet__x",srOnly:"sr-only",co:"co",coProd:"co-prod",coProdImage:"co-prod__img",coProdTitle:"co-prod__t",coOpts:"co-opts",coOpt:"co-opt",coHit:"co-opt__hit",radio:"bk__radio",coPrice:"co-opt__p",coWhen:"co-when",coKey:"co-k",coEvery:"co-every",coRows:"co-rows",buttonLarge:"emb-btn emb-btn--block emb-btn--lg",buttonGhost:"emb-btn emb-btn--ghost emb-btn--block",coFine:"co-fine",mgCancel:"mg-cancel",started:"ph-push",startedScroll:"ph-scroll",done:"bk__done",doneCheck:"bk__check",doneTitle:"serif bk__title",doneWhen:"bk__when",doneWho:"bk__who",next:"hp-next",nextIcon:"hp-next__ic",foot:"bk__foot",toast:"ph-toast",tipTop:"hp-tip__top","tip:y":"hp-tip--y","tip:c":"hp-tip--c","tip:g":"hp-tip--g","tip:r":"hp-tip--r",tools:"hp-tools",toolsEnd:"hp-tools__end",ordersButton:"hp-orders",cartButton:"hp-cart",cartCount:"hp-cart__n",askRow:"hp-ask-row",askRowIcon:"hp-ask-row__ic",wait:"hp-wait",waitTop:"hp-wait__top",waitTile:"emb-tile emb-tile--cyan",waitKey:"hp-wait__k",waitText:"hp-wait__text","next:in":"hp-next--in",track:"sh-track","track:kit":"sh-track--kit",trackDot:"sh-track__dot",shopTag:"cp-tag",trackStep:"","trackStep:done":"is-done","trackStep:now":"is-now",push:"ph-push",sheetBody:"sheet__body",shop:"sh",shopTitle:"serif sh-title",shopSub:"sh-sub2",shopKey:"sh-k",shopCard:"sh-card","shopCard:carrier":"sh-carrier",shopItems:"sh-items",shopItem:"sh-item",shopItemImage:"sh-item__img",shopItemPrice:"sh-item__p",shopItemActions:"sh-item__acts",stepper:"sh-step",shopRemove:"sh-rm",shopMode:"sh-mode",summary:"sh-sum",summaryRow:"","summaryRow:total":"is-total","summaryRow:renew":"is-renew",shopFine:"sh-fine","shopFine:center":"sh-fine--c",shopEmpty:"sh-empty",shopTile:"emb-tile emb-tile--cyan",shopLink:"sh-link",shopActions:"sh-acts",subCard:"sh-subc",orderList:"sh-orders",order:"sh-order",orderTop:"sh-order__top",orderPill:"sh-pill","orderPill:done":"sh-pill--done","orderPill:sub":"sh-pill--sub",orderNo:"sh-order__no",orderWhat:"sh-order__what",orderMeta:"sh-order__meta",orderPics:"sh-order__pics",carrierIcon:"sh-carrier__ic",carrierWait:"sh-carrier__wait",buttonSmall:"emb-btn emb-btn--ghost emb-btn--sm",coItems:"co-items","foot:shop":"sh-foot","foot:stack":"hp-foot-stack",weightField:"wt-f",weightInput:"wt-f__in",weightUnit:"wt-f__u",weightError:"wt-err",weightActions:"wt-acts",blanks:"hp-blanks",blanksCard:"blanks",blanksHead:"blanks__h",blank:"blank","blank:s":"blank--s","blank:l":"blank--l",noPick:"",mgOrders:"sh-link mg-orders"},prefix=classes=>classes.split(/\s+/).filter(c=>c!=="").map(c=>`${PLAN_CLASS_PREFIX}${c}`).join(" ");/* @__PURE__ */Object.freeze(Object.fromEntries(Object.entries(RAPH_PLAN_CLASSES).map(([part,classes])=>[part,prefix(classes)])));var PLAN_BEFORE_CLASS=`${PLAN_CLASS_PREFIX}before`,RAPH_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 planTokens(theme){let c=theme.color,v=v3Palette(theme),neutral={ink:v.ink,ink2:v.ink2,ink3:v.ink3,paper:v.paper,tile:v.tile,line:v.line,card:v.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}:RAPH_PLAN_LIGHT},link=v.link,card=neutral.card;return{...neutral,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),sans:faceCss(theme,"regular").fontFamily,serif:headingFaceCss(theme,"bold").fontFamily,mono:cssMonoFamily(theme.type.mono)}}[...[".ph-push",".ph-push.is-on",".ph-sheet",".ph-sheet.is-on"].map(selector=>[selector,selector.split(".").length-1,[["transform","none"],["transition","opacity 160ms ease, visibility 0s linear 160ms"],["opacity","0"]]]),...[".ph-push.is-on",".ph-sheet.is-on"].map(selector=>[selector,2,[["opacity","1"],["transition","opacity 160ms ease, visibility 0s"]]]),[".ph-toast",1,[["transform","none",1]]]];var SHOP_V3_ROOT="efp-v3",SCOPE=`.${SHOP_V3_ROOT}`,WIDE="(min-width: 900px)",COLUMN=560;function fill(value,tokens,dark){return value.replace(/\$(n_[0-9A-F]{6}|[a-zA-Z0-9]+)/g,(whole,key)=>key.startsWith("n_")?dark?tokens.line??whole:`#${key.slice(2)}`:tokens[key]??whole)}function selectors(list){let out=[],depth=0,start=0;for(let i=0;i<list.length;i+=1){let ch=list[i];ch==="("?depth+=1:ch===")"?depth-=1:ch===","&&depth===0&&(out.push(list.slice(start,i).trim()),start=i+1)}return out.push(list.slice(start).trim()),out.filter(s=>s!=="")}var scoped=list=>selectors(list).map(s=>`${SCOPE} ${s}`).join(",");function block(decls,tokens,dark){return decls.map(d=>`${d[0]}:${fill(d[1],tokens,dark)}${d[2]===1?" !important":""}`).join(";")}var cache2=/* @__PURE__ */new WeakMap;function shopV3Css(theme){let hit=cache2.get(theme);if(hit!==void 0)return hit;let dark=theme.brightness==="dark",tokens={...planTokens(theme),sans:"var(--font)",serif:"var(--font)",mono:"var(--font-mono)"},t=v=>fill(v,tokens,dark),base=[],wide=[];for(let[selector,,decls,isWide]of PLAN_RULES)(isWide===1?wide:base).push(`${scoped(selector)}{${block(decls,tokens,dark)}}`);let side=`max(0px, calc(50% - ${COLUMN/2}px))`,frame=[`${SCOPE}{${block(PLAN_CONTEXT,tokens,dark)};background:${t("$paper")};min-height:100%;-webkit-font-smoothing:antialiased}`,`${SCOPE} .efp-v3-col{max-width:${COLUMN}px;margin:0 auto;min-height:100%;display:flex;flex-direction:column}`,`${SCOPE} .efp-v3-main{flex:1;min-width:0}`,`${SCOPE} .efp-v3-head{position:sticky;top:0;z-index:5;height:58px;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;padding:0 14px;background:${t("$paper")}}`,`${SCOPE} .efp-v3-back{width:44px;height:44px;display:grid;place-items:center;margin-left:-6px;border-radius:999px;color:${t("$ink")};text-decoration:none}`,`${SCOPE} .efp-v3-back svg{width:26px;height:26px}`,`${SCOPE} .efp-v3-title{grid-column:2;font-size:17px;font-weight:800;white-space:nowrap;margin:0;color:${t("$ink")}}`,`${SCOPE} .efp-v3-end{grid-column:3;justify-self:end;display:flex;align-items:center}`,`${SCOPE} .efp-bk__foot{position:sticky;bottom:0;z-index:4}`,`${SCOPE} .efp-ph-scrim{position:fixed}`,`${SCOPE} .efp-ph-sheet{position:fixed;left:${side};right:${side};max-height:88vh}`,`${SCOPE} .efp-ph-sheet:focus{outline:none}`,`${SCOPE} .efp-v3-sheet-top{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:44px}`,`${SCOPE} .efp-v3-x{width:44px;height:44px;display:grid;place-items:center;margin-right:-10px;border-radius:999px;color:${t("$ink")}}`,`${SCOPE} .efp-v3-x svg{width:22px;height:22px}`,`${SCOPE} .efp-sh-item h3,${SCOPE} .efp-co-items strong,${SCOPE} .efp-sh-order__what,${SCOPE} .efp-hp-next span span{overflow-wrap:anywhere}`,`${SCOPE} .efp-sh{grid-template-columns:minmax(0, 1fr)}`,`${SCOPE} .efp-sh-title,${SCOPE} .efp-sh-sub2,${SCOPE} .efp-v3-title,${SCOPE} .efp-bk__title,${SCOPE} .efp-bk__who,${SCOPE} .efp-v3-err{overflow-wrap:anywhere}`,`${SCOPE} .efp-sh-order__top{flex-wrap:wrap;min-width:0}`,`${SCOPE} .efp-sh-order > span{min-width:0}`,`${SCOPE} .efp-sh-pill{max-width:100%;padding-top:3px;padding-bottom:3px;line-height:1.3}`,`${SCOPE} .efp-v3-pill--risk{background:${t("$riskBg")};color:${t("$riskInk")}}`,`${SCOPE} .efp-v3-pill--quiet{background:${t("$paper")};color:${t("$ink2")};box-shadow:inset 0 0 0 1px ${t("$line")}}`,`${SCOPE} a.efp-sh-order,${SCOPE} a.efp-emb-btn,${SCOPE} a.efp-sh-link{text-decoration-line:none;color:inherit}`,`${SCOPE} a.efp-emb-btn{color:${t("$onPrimary")}}`,`${SCOPE} a.efp-emb-btn--ghost{color:${t("$ink")}}`,`${SCOPE} a.efp-sh-link{display:inline-flex;align-items:center;color:${t("$link")};text-decoration-line:underline}`,`${SCOPE} .efp-emb-btn[disabled]{opacity:.45;cursor:default}`,`${SCOPE} .efp-co-rows li.efp-v3-row{grid-template-columns:20px 4.6rem minmax(0, 1fr) auto}`,`${SCOPE} .efp-co-rows b{min-width:0;overflow-wrap:anywhere}`,`${SCOPE} .efp-v3-risk{color:${t("$riskInk")}}`,`${SCOPE} .efp-v3-change{display:inline-flex;align-items:center;min-height:40px;font-size:14px;font-weight:800;color:${t("$link")};text-decoration:none;white-space:nowrap}`,`${SCOPE} .efp-v3-err{margin:0;font-size:15px;line-height:1.45;color:${t("$riskInk")}}`,`${SCOPE} .efp-v3-note{margin:0;font-size:15px;line-height:1.45;color:${t("$ink2")}}`,`${SCOPE} .efp-v3-toast{position:fixed;left:50%;bottom:110px;z-index:50;transform:translateX(-50%);max-width:min(92vw,520px);padding:12px 18px;border-radius:999px;background:${t("$ink")};color:${t("$card")};font-size:15px;font-weight:700;box-shadow:0 6px 24px ${t("$wash")}}`,`${SCOPE} .efp-v3-ghost{display:grid;gap:12px}`,`${SCOPE} .efp-v3-ghost span{display:block;height:84px;border-radius:22px;background:${t("$tile")}}`,`${SCOPE} .efp-v3-name{display:grid;gap:10px}`,`${SCOPE} .efp-v3-name label{display:grid;gap:4px;font-size:14px;font-weight:700}`,`${SCOPE} .efp-v3-name input{min-height:48px;padding:0 14px;border-radius:12px;border:1.5px solid ${t("$line")};background:${t("$card")};font-size:16px}`,`@media (prefers-reduced-motion: reduce){${SCOPE} *{transition-duration:0.01ms !important;animation-duration:0.01ms !important}}`,".efp-care-tabs{display:flex;align-items:center;gap:8px;min-width:0}",".efp-care-tabs > :first-child{flex:1;min-width:0}",".efp-care-cart{position:relative;flex:none;width:44px;height:44px;display:grid;place-items:center;border-radius:999px;color:var(--ink);text-decoration:none}",".efp-care-cart .ico{width:24px;height:24px}",".efp-care-cart__n{position:absolute;top:2px;right:0;min-width:18px;height:18px;padding:0 5px;border-radius:999px;background:var(--ink);color:var(--ef-white);font-size:11px;font-weight:700;line-height:18px;text-align:center;font-variant-numeric:tabular-nums}",".page--care .efp-care-tabs,.page--care-shop .efp-care-tabs,.page--care-plan .efp-care-tabs,.page--care-orders .efp-care-tabs{margin-top:var(--sp-4)}",".efp-care-tabs .tabs{margin-top:0 !important}",`${SCOPE} .efp-care-tabs{padding:0 18px}`,`${SCOPE} .efp-care-tabs .scroller__btn{border:1px solid var(--line);background:var(--ef-white)}`,".prods > li,.prod,.prod__body{min-width:0}",".prod{grid-template-columns:minmax(0, 1fr)}",".prod__name,.prod__meta,.page-title,.items__name,.person__name,.choice__title{overflow-wrap:anywhere}",".back{position:relative}",'.back::before{content:"";position:absolute;inset:-12px -8px}',".btn:disabled{opacity:.45;cursor:default}",".btn:disabled:active{transform:none}",'.input:has([aria-invalid="true"]){border-color:var(--alert-deep)}'],css=[...base,...frame,wide.length>0?`@media ${WIDE}{${wide.join("")}}`:""].join(`\n`);return cache2.set(theme,css),css}var sheet=null;function constructable(css){try{if(typeof CSSStyleSheet!="function"||typeof CSSStyleSheet.prototype.replaceSync!="function")return null;let s=new CSSStyleSheet;return s.replaceSync(css),s}catch{return null}}function kitSheet(){return sheet||(sheet=constructable(SHOP_KIT_CSS)),sheet}var v3Sheets=/* @__PURE__ */new WeakMap;function v3Sheet(theme){return v3Sheets.has(theme)||v3Sheets.set(theme,constructable(shopV3Css(theme))),v3Sheets.get(theme)??null}function styleTag(root,attr,css){let style=root.querySelector(`style[${attr}]`);style||(style=document.createElement("style"),style.setAttribute(attr,""),root.insertBefore(style,root.querySelector("div[data-everfur-shop-root]"))),style.textContent!==css&&(style.textContent=css)}function ShopRoot({pageClass:pageClass,children:children,hostClassName:hostClassName}){let host=useRef(null),[mount,setMount]=useState(null),theme=useEverfurTheme();return useLayoutEffect(()=>{let el=host.current;if(!el)return;let root=el.shadowRoot??el.attachShadow({mode:"open"}),kit=kitSheet(),v3=v3Sheet(theme);kit&&v3&&"adoptedStyleSheets"in root?root.adoptedStyleSheets=[kit,v3]:(styleTag(root,"data-everfur-shop",SHOP_KIT_CSS),styleTag(root,"data-everfur-shop-v3",shopV3Css(theme)))},[theme]),useLayoutEffect(()=>{let el=host.current;if(!el)return;let root=el.shadowRoot??el.attachShadow({mode:"open"}),div=root.querySelector("div[data-everfur-shop-root]");div||(div=document.createElement("div"),div.setAttribute("data-everfur-shop-root",""),root.appendChild(div)),setMount(div)},[]),/* @__PURE__ */jsx("div",{ref:host,className:hostClassName,"data-everfur-shop":"",children:mount?createPortal(/* @__PURE__ */jsx("div",{className:pageClass,children:children}),mount):null})}function useCartCheckout(items,go,cardHandoff=null){let{client:client,copy:copy,v3:v3,payments:payments}=useShop(),addresses=useAddresses(),cards=usePaymentMethods(),[open,setOpen]=useState(false),[pane,setPane]=useState("main"),[addressRef,setAddressRef]=useState(()=>peekAddedAddress(client));useEffect(()=>dropAddedAddress(client),[client]);let[cardId,setCardId]=useState(null),[error,setError]=useState(null),usable=(addresses.value??[]).filter(a=>a.isComplete),address=usable.find(a=>a.ref===addressRef)??usable.find(a=>a.isDefault)??usable[0]??null,cardList=cards.value??[],card=cardList.find(c=>c.paymentMethodId===cardId)??cardList[0]??null,lines=useMemo(()=>cartLines(items),[items]),linesKey=JSON.stringify(lines),quote2=useShopRead(address&&lines.length>0?`cart-quote:${address.ref}:${linesKey}`:null,()=>client.quote({lines:lines,shipTo:address.ref})),[shown,setShown]=useState(null),draftKey=`${address?.ref??""}:${linesKey}`,shownTotal=shown&&shown.key===draftKey?shown.total:null,placeRef=useRef(()=>{}),nameStep=useNameStep(()=>placeRef.current()),placeAction=useShopAction(async keys=>{let draft=await client.createCheckout({idempotencyKey:keys.key("draft"),lines:lines,shipTo:address.ref});if(!draft.ok)return omsErr(draft.error);if((shownTotal??quote2.value?.total??null)!==draft.value.total)return setShown({key:draftKey,total:draft.value.total}),omsErr({kind:"refused",status:409,reasonCode:"price_changed",message:null});let out=await confirmWithPayerActions(idempotencyKey=>client.confirmCheckout(draft.value.checkoutId,{idempotencyKey:idempotencyKey,expectedTotal:draft.value.total,paymentMethodId:card.paymentMethodId}),keys,payments);return out.kind==="failed"?omsErr(out.error):omsOk(out)}),place=()=>{if(!address||!card||!quote2.value||placeAction.busy)return;setError(null),nameStep.clear();let placedKeys=items.map(i=>i.key);placeAction.run().then(res=>{if(!res)return;let out=res.ok?res.value:{kind:"failed",error:res.error};if(out.kind==="failed"){if(nameStep.raise(out.error))return;setError(outcomeLine(copy,out));return}if(out.orderIds.length===0){setError(copy.actionFailed);return}if(removePlaced(client,placedKeys),setOpen(false),setPane("main"),out.kind==="confirmed"){go({name:"placed",orderIds:out.orderIds});return}leaveOrderNotice(client,out.orderIds[0],outcomeLine(copy,out)),go({name:"order",orderId:out.orderIds[0]})})};placeRef.current=place;let[cardBusy,setCardBusy]=useState(false),before=useRef(null);useEffect(()=>{if(!before.current||cards.phase!=="ready"||!cards.value)return;let added=cards.value.find(c=>!before.current.has(c.paymentMethodId));before.current=null,added&&setCardId(added.paymentMethodId)},[cards.phase,cards.value]);let addCard=cardHandoff?{busy:cardBusy,run:()=>{if(cardBusy)return;setCardBusy(true),setError(null);let ids=new Set(cardList.map(c=>c.paymentMethodId));cardHandoff().then(step2=>{setCardBusy(false),step2.ok?(before.current=ids,setPane("main"),cards.refresh()):setError(step2.closed?copy.cardStepClosed:step2.message??copy.cardStepFailed)},()=>{setCardBusy(false),setError(copy.cardStepFailed)})}}:null,save=useShopAction((_keys,input)=>client.addAddress(input)),saveAddress={busy:save.busy,error:save.error?refusalLine(copy,save.error):null,run:input=>{save.run(input).then(res=>{res&&res.ok&&(setAddressRef(res.value.ref),setPane("main"),addresses.refresh())})}},sub=cartSubtotal(items),q=quote2.value,totalCents=shownTotal??q?.total??null,sum=[];sub!==null&&sum.push({k:v3.subtotal,v:formatCents(sub)}),q&&totalCents!==null&&(sum.push({k:v3.shipping,v:q.shipping===0?v3.free:formatCents(q.shipping)}),sum.push({k:v3.tax,v:formatCents(q.tax)}),sum.push({k:v3.total,v:formatCents(totalCents),total:true}));let rx=items.some(i=>i.requiresRx),fineParts=[card?copy.chargedWhenShips(cardLabel(card.brand,card.last4)):null,rx?copy.rxCheckedFirst:null].filter(x=>!!x);return{open:open,pane:pane,setPane:setPane,openSheet:()=>{setError(null),setPane("main"),setOpen(true)},closeSheet:()=>{placeAction.busy||(setOpen(false),setPane("main"))},addresses:[...usable].sort((a,b)=>Number(b.isDefault)-Number(a.isDefault)),addressesLoading:addresses.phase==="loading",address:address,chooseAddress:ref=>{setAddressRef(ref),setPane("main")},cards:cardList,cardsLoading:cards.phase==="loading",card:card,chooseCard:id=>{setCardId(id),setPane("main")},addCard:addCard,saveAddress:saveAddress,sum:sum,subtotal:sub!==null?formatCents(sub):null,total:totalCents!==null?formatCents(totalCents):null,canPlace:!!address&&!!card&&!!q&&items.length>0&&!placeAction.busy,placing:placeAction.busy,place:place,error:nameStep.view!==null?null:error??quoteLine(copy,quote2),nameStep:nameStep.view,fine:fineParts.length>0?fineParts.join(" "):null}}var PATHS={check:"M5 12.5l4.5 4.5L19 7.5",truck:"M3 6h11v10H3z M14 10h4l3 3v3h-7 M7 19a2 2 0 100-4 2 2 0 000 4z M17 19a2 2 0 100-4 2 2 0 000 4z",card:"M3 6h18v12H3z M3 10h18",alert:"M12 4l9 16H3z M12 10v4 M12 17h.01",x:"M6 6l12 12 M18 6L6 18",calendar:"M4 6h16v14H4z M4 10h16 M8 3v4 M16 3v4",box:"M3 7l9-4 9 4v10l-9 4-9-4z M3 7l9 4 9-4 M12 11v10",cart:"M3 4h2l2.4 11h10.2L20 8H6.2 M9 20a1 1 0 100-2 1 1 0 000 2z M17 20a1 1 0 100-2 1 1 0 000 2z",minus:"M5 12h14",plus:"M12 5v14 M5 12h14",chev:"M9 6l6 6-6 6",back:"M15 6l-6 6 6 6"};function V3Icon({name:name}){/* @__PURE__ */
|
|
257
|
+
return jsx(PlanConsentScreen,{copy:copy,...useConsentStep(route,nav.go)})}var freezeInPlace=Object.freeze;function deepFreeze(value){if(value!==null&&typeof value=="object"&&!Object.isFrozen(value)){freezeInPlace(value);for(let key of Object.keys(value))deepFreeze(value[key])}return value}var TEXT_SCALE_TIER_CAPS=/* @__PURE__ */Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3}),SPACE={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},RADIUS={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},TYPE_SIZE={nano:8,small:9,micro:10,tiny:11,caption:13,bodyTight:15,body:17,subtitle:20,heading:22,verdict:24},LINE_HEIGHT={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},WEIGHT={regular:"400",medium:"500",bold:"700"},LETTER_SPACING={eyebrow:1,monoWide:.9,headerBrand:-.42,tight:-.35},DEFAULT_MAX_FONT_SCALE=0,SYSTEM_FONT_FAMILY="System",SYSTEM_MONO_FAMILY="monospace",TIERS=["content","heading","control","compact","badge"];function authoredTierSizes(size){let out={};for(let tier of TIERS)out[tier]=size;return out}var NO_FONT_SOURCES=[];function baseType(){return{family:SYSTEM_FONT_FAMILY,mono:SYSTEM_MONO_FAMILY,fontUrl:null,families:{regular:SYSTEM_FONT_FAMILY,medium:SYSTEM_FONT_FAMILY,bold:SYSTEM_FONT_FAMILY,mono:SYSTEM_MONO_FAMILY,monoMedium:SYSTEM_MONO_FAMILY,monoBold:SYSTEM_MONO_FAMILY},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:TYPE_SIZE,tierSizes:authoredTierSizes(TYPE_SIZE),lineHeight:LINE_HEIGHT,weight:WEIGHT,letterSpacing:LETTER_SPACING,scale:1,maxScale:DEFAULT_MAX_FONT_SCALE,scaleCaps:TEXT_SCALE_TIER_CAPS,headingFamily:null,headingWeight:null,fontSources:NO_FONT_SOURCES}}var NO_SLOTS={},EASING_CURVES=/* @__PURE__ */Object.freeze({standard:/* @__PURE__ */Object.freeze([.2,0,0,1]),emphasized:/* @__PURE__ */Object.freeze([.2,.8,.2,1]),exit:/* @__PURE__ */Object.freeze([.4,0,1,1])});function cssCubicBezier(curve){return`cubic-bezier(${curve.join(", ")})`}var MOTION={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:cssCubicBezier(EASING_CURVES.standard),emphasized:cssCubicBezier(EASING_CURVES.emphasized),exit:cssCubicBezier(EASING_CURVES.exit)},reducedMotion:false},LIGHT_COLOR={brand:"#10462E",brandSoft:"rgba(16,70,46,0.10)",brandSofter:"rgba(16,70,46,0.15)",brandBorder:"rgba(16,70,46,0.18)",borderHairlineGreen:"rgba(16,70,46,0.25)",brandBorderStrong:"rgba(16,70,46,0.55)",brandInk:"#10462E",linkInk:"#10462E",surface:"#FFFFFF",surfaceCream:"#FFFFFF",surfaceSubtle:"#F1F5F2",background:"#FFFFFF",borderRingCream:"#E4E4E4",chatGround:"#FFFFFF",composerFill:"#FFFFFF",composerBorder:"rgba(16,70,46,0.75)",shadow:"#0B3421",text:{primary:"#000000",secondary:"#0E462E",muted:"#6B6B6B",placeholder:"rgba(61,61,61,0.75)",onBrand:"#FFFFFF",metaCool:"#3D3D3D",timestamp:"rgba(61,61,61,0.75)"},primary:"#10462E",onPrimary:"#FFFFFF",accent:"#10462E",onAccent:"#FFFFFF",accentEdge:"#07C168",success:"#07C168",danger:"#C03410",onDanger:"#FFFFFF",errorRed:"#C03410",warningStrong:"#A45610",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.12)",badgeBgCaution:"rgba(217,130,29,0.14)",badgeBgCritical:"rgba(192,52,16,0.06)",badgeBgNeutral:"rgba(107,107,107,0.12)",bubbleUser:"#10462E",bubbleAssistant:"#FFFFFF",bubbleVet:"#FFC3BC",onBubbleVet:"#000000",skeleton:"#E9F1E9",scanButtonPink:"#FFC3BC",highlight:"#FFC3BC",onHighlight:"#000000",mark:"#07C168",controlEdge:"rgba(16,70,46,0.18)",structureEdge:"rgba(16,70,46,0.25)",primaryEdge:"#10462E",checkupCardLowRiskBg:"rgba(7,193,104,0.10)",checkupCardConcernBg:"rgba(239,167,0,0.10)",info:"#10462E",badgeBgInfo:"rgba(16,70,46,0.10)",infoEdge:"rgba(16,70,46,0.25)"},EVERFUR_LIGHT=deepFreeze({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:LIGHT_COLOR,space:SPACE,radius:RADIUS,type:baseType(),motion:MOTION,slots:NO_SLOTS}),DARK_COLOR={brand:"#6BD39A",brandSoft:"rgba(107,211,154,0.12)",brandSofter:"rgba(107,211,154,0.18)",brandBorder:"rgba(107,211,154,0.22)",borderHairlineGreen:"rgba(107,211,154,0.28)",brandBorderStrong:"rgba(107,211,154,0.55)",brandInk:"#6BD39A",linkInk:"#6BD39A",surface:"#1C1F23",surfaceCream:"#23272C",surfaceSubtle:"#23272C",background:"#15171A",borderRingCream:"#3A3F45",chatGround:"#1C1F23",composerFill:"#23272C",composerBorder:"rgba(107,211,154,0.75)",shadow:"#000000",text:{primary:"#F5F3F0",secondary:"#A9E4C4",muted:"#9A9A9A",placeholder:"rgba(255,255,255,0.55)",onBrand:"#0E1F17",metaCool:"#C9C9C9",timestamp:"rgba(245,243,240,0.7)"},primary:"#6BD39A",onPrimary:"#0E1F17",accent:"#6BD39A",onAccent:"#0E1F17",accentEdge:"#34D888",success:"#07C168",danger:"#F87171",onDanger:"#0E1F17",errorRed:"#FF6B5B",warningStrong:"#F0A35E",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.18)",badgeBgCaution:"rgba(217,130,29,0.20)",badgeBgCritical:"rgba(185,28,28,0.22)",badgeBgNeutral:"rgba(255,255,255,0.10)",bubbleUser:"#6BD39A",bubbleAssistant:"#1C1F23",bubbleVet:"#FFC3BC",onBubbleVet:"#000000",skeleton:"#23272C",scanButtonPink:"#FFC3BC",highlight:"#605051",onHighlight:"#F5F3F0",mark:"#07C168",controlEdge:"rgba(107,211,154,0.22)",structureEdge:"rgba(107,211,154,0.28)",primaryEdge:"#6BD39A",checkupCardLowRiskBg:"rgba(7,193,104,0.16)",checkupCardConcernBg:"rgba(239,167,0,0.16)",info:"#6BD39A",badgeBgInfo:"rgba(107,211,154,0.12)",infoEdge:"rgba(107,211,154,0.28)"};deepFreeze({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:DARK_COLOR,space:SPACE,radius:RADIUS,type:baseType(),motion:MOTION,slots:NO_SLOTS});var EVERFUR_THEME_CONTEXT_SYMBOL=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),globalThemeHost=globalThis,EverfurThemeContext=globalThemeHost[EVERFUR_THEME_CONTEXT_SYMBOL]??(globalThemeHost[EVERFUR_THEME_CONTEXT_SYMBOL]=createContext(EVERFUR_LIGHT));EverfurThemeContext.displayName??="EverfurThemeContext";function useEverfurTheme(){return useContext(EverfurThemeContext)}function toRgba(value){if(typeof value=="number")return argbIntToRgba(value);if(typeof value!="string")return null;let s=value.trim();if(s.length===0)return null;if(s.startsWith("#"))return fromHex(s.slice(1));if(s.toLowerCase().startsWith("0x"))return fromHex(s.slice(2));if(s.toLowerCase().startsWith("rgb"))return fromRgbFunc(s);if(/^[0-9a-fA-F]+$/.test(s)){let hex=fromHex(s);if(hex!==null)return hex}return/^\d+$/.test(s)?argbIntToRgba(Number.parseInt(s,10)):null}function fromHex(hex){let h=hex.trim();if(!/^[0-9a-fA-F]+$/.test(h))return null;if(h.length===3)return{r:dup(h[0]),g:dup(h[1]),b:dup(h[2]),a:1};if(h.length===6)return{r:byte(h,0),g:byte(h,2),b:byte(h,4),a:1};if(h.length===8){let a=byte(h,0);return{r:byte(h,2),g:byte(h,4),b:byte(h,6),a:a/255}}return null}function fromRgbFunc(input){let open=input.indexOf("("),close=input.indexOf(")");if(open<0||close<0||close<open)return null;let parts=input.slice(open+1,close).split(",").map(p=>p.trim());if(parts.length<3)return null;let r=clampByte(Number(parts[0])),g=clampByte(Number(parts[1])),b=clampByte(Number(parts[2]));if(r===null||g===null||b===null)return null;let a=1;if(parts.length>=4){let alpha=Number(parts[3]);if(!Number.isFinite(alpha))return null;a=Math.min(1,Math.max(0,alpha))}return{r:r,g:g,b:b,a:a}}function argbIntToRgba(n){if(!Number.isFinite(n))return null;let 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 step2=1;step2<1/PUSH_STEP;step2+=1){let t=step2*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"}),cache=/* @__PURE__ */new WeakMap;function v3Palette(theme){let hit=cache.get(theme);if(hit!==void 0)return hit;let c=theme.color,dark=theme.brightness==="dark",neutrals=dark?{dark:dark,ink:c.text.primary,ink2:c.text.secondary,ink3:c.text.muted,paper:c.background,card:c.surface,line:c.borderRingCream,tile:c.surfaceSubtle,shadow:c.shadow,riskBg:c.badgeBgCritical,riskInk:c.danger,riskDot:c.danger,clearBg:c.badgeBgPositive,clearInk:c.success,clearDot:c.success,watchDot:c.warningStrong}:{dark:dark,...RAPH_V3_LIGHT},textOn=(ink,grounds)=>pushToContrast(ink,grounds,poleForGrounds(grounds),V3_TEXT_CONTRAST),labelOn=(ink,fill2)=>contrastRatio(ink,fill2)>=V3_TEXT_CONTRAST?ink:legibleOn(fill2,V3_TEXT_CONTRAST),badgeGrounds=[neutrals.card,neutrals.paper].map(under=>flattenOnto(c.brandSoft,under)??under),brand={primary:c.primary,onPrimary:labelOn(c.onPrimary,c.primary),accent:c.accent,onAccent:labelOn(c.onAccent,c.accent),link:textOn(c.linkInk,[neutrals.card,neutrals.paper,neutrals.tile]),badge:c.brandSoft,onBadge:textOn(c.brandInk,badgeGrounds)},palette=/* @__PURE__ */Object.freeze({...neutrals,...brand});return cache.set(theme,palette),palette}var V3_TEXT_CONTRAST=4.5;var FACE_WEIGHT=/* @__PURE__ */Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});var SYSTEM_UI_STACK='system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',RN_SYSTEM_FAMILY="System";function cssFontFamily(family){let named=family.trim();return named.length===0||named===RN_SYSTEM_FAMILY?SYSTEM_UI_STACK:`${quote(named)}, ${SYSTEM_UI_STACK}`}function cssMonoFamily(mono){let named=mono.trim();return named.length===0||named==="monospace"?"ui-monospace, Menlo, Consolas, monospace":`${quote(named)}, ui-monospace, Menlo, Consolas, monospace`}function quote(family){return`"${family.replace(/[\\"]/g,"\\$&")}"`}function faceCss(theme,weight){let type=theme.type,family=type.families[weight];return{fontFamily:weight==="mono"||weight==="monoMedium"||weight==="monoBold"?cssMonoFamily(family):cssFontFamily(family),fontWeight:type.namedFaces[weight]?type.weight.regular:type.weight[FACE_WEIGHT[weight]]}}function headingFaceCss(theme,fallback="bold"){let{headingFamily:headingFamily,headingWeight:headingWeight}=theme.type,base=faceCss(theme,fallback);return headingFamily===null&&headingWeight===null?base:headingFamily!==null?{fontFamily:cssFontFamily(headingFamily),fontWeight:headingWeight??theme.type.weight[FACE_WEIGHT[fallback]]}:theme.type.namedFaces[fallback]||headingWeight===null?base:{fontFamily:base.fontFamily,fontWeight:headingWeight}}var PLAN_CLASS_PREFIX="efp-",PLAN_CONTEXT=[["font-family","$sans"],["color","$ink"],["font-size","17px"],["line-height","1.5"]],PLAN_RULES=[["h1",[0,0,1],[["color","$n_10462E"],["line-height","1.15"],["font-weight","700"]]],["h2",[0,0,1],[["color","$n_10462E"],["line-height","1.15"],["font-weight","700"]]],["h3",[0,0,1],[["color","$n_10462E"],["line-height","1.15"],["font-weight","700"]]],["h4",[0,0,1],[["color","$n_10462E"],["line-height","1.15"],["font-weight","700"]]],[".efp-ph-sheet > h3.efp-serif",[0,2,1],[["font-size","24px"]]],["*",[0,0,0],[["box-sizing","border-box"]]],["* > .efp-before",[0,1,0],[["box-sizing","border-box"]]],["[hidden]",[0,1,0],[["display","none",1]]],["h1",[0,0,1],[["color","inherit"],["margin","0"],["font-weight","700"],["line-height","1.15"]]],["h2",[0,0,1],[["color","inherit"],["margin","0"],["font-weight","700"],["line-height","1.15"]]],["h3",[0,0,1],[["color","inherit"],["margin","0"],["font-weight","700"],["line-height","1.15"]]],["h4",[0,0,1],[["color","inherit"],["margin","0"],["font-weight","700"],["line-height","1.15"]]],["p",[0,0,1],[["margin","0"]]],["ul",[0,0,1],[["margin","0"]]],["ol",[0,0,1],[["margin","0"]]],["button",[0,0,1],[["font","inherit"],["color","inherit"]]],["input",[0,0,1],[["font","inherit"],["color","inherit"]]],["textarea",[0,0,1],[["font","inherit"],["color","inherit"]]],["button",[0,0,1],[["background","none"],["border","0"],["padding","0"],["cursor","pointer"],["text-align","inherit"],["-webkit-tap-highlight-color","transparent"],["touch-action","manipulation"]]],["img",[0,0,1],[["display","block"]]],["svg",[0,0,1],[["display","block"]]],["a",[0,0,1],[["color","inherit"]]],[".efp-sr-only",[0,1,0],[["position","absolute"],["width","1px"],["height","1px"],["overflow","hidden"],["clip","rect(0 0 0 0)"],["white-space","nowrap"]]],[".efp-serif",[0,1,0],[["font-family","$serif"],["font-weight","800"],["font-variation-settings",'"SOFT" 0, "WONK" 0'],["letter-spacing","-0.01em"],["text-wrap","balance"]]],[".efp-emb-btn",[0,1,0],[["display","inline-flex"],["align-items","center"],["justify-content","center"],["gap","8px"],["min-height","48px"],["padding","0 22px"],["border-radius","999px"],["background","$primary"],["color","$onPrimary"],["font-weight","700"],["font-size","16px"],["text-decoration","none"],["transition","transform 160ms cubic-bezier(0.23, 1, 0.32, 1), opacity 160ms ease"]]],[".efp-emb-btn svg",[0,1,1],[["width","20px"],["height","20px"]]],[".efp-emb-btn--block",[0,1,0],[["width","100%"]]],[".efp-emb-btn--ghost",[0,1,0],[["background","transparent"],["color","$ink"],["box-shadow","inset 0 0 0 1.5px $ink"]]],[".efp-emb-btn--sm",[0,1,0],[["min-height","40px"],["padding","0 16px"],["font-size","15px"]]],[".efp-emb-btn--lg",[0,1,0],[["min-height","56px"],["padding","0 28px"],["font-size","17px"]]],[".efp-emb-btn[disabled]",[0,2,0],[["opacity",".32"],["pointer-events","none"]]],[".efp-dot",[0,1,0],[["display","inline-block"],["width","9px"],["height","9px"],["border-radius","50%"],["flex","none"]]],[".efp-dot--risk",[0,1,0],[["background","$riskDot"]]],[".efp-ph-scroll",[0,1,0],[["flex","1"],["min-height","0"],["overflow-y","auto"],["overscroll-behavior","contain"],["scrollbar-width","none"]]],[".efp-emb-tile",[0,1,0],[["width","46px"],["height","46px"],["border-radius","13px"],["background","$tile"],["display","grid"],["place-items","center"],["flex","none"],["font-size","22px"]]],[".efp-emb-tile svg",[0,1,1],[["width","23px"],["height","23px"]]],[".efp-emb-tile--cyan",[0,1,0],[["background","$linkWash"],["color","$link"]]],[".efp-ph-push",[0,1,0],[["position","absolute"],["inset","0"],["display","flex"],["flex-direction","column"],["background","$paper"],["pointer-events","auto"],["transform","translateX(100%)"],["visibility","hidden"],["transition","transform 220ms cubic-bezier(0.23, 1, 0.32, 1), visibility 0s linear 220ms"]]],[".efp-ph-push.efp-is-on",[0,2,0],[["transform","none"],["visibility","visible"],["transition","transform 300ms cubic-bezier(0.32, 0.72, 0, 1), visibility 0s"]]],[".efp-bk__radio",[0,1,0],[["width","22px"],["height","22px"],["border-radius","50%"],["box-shadow","inset 0 0 0 2px $n_BDB9B2"],["display","grid"],["place-items","center"]]],[".efp-bk__foot",[0,1,0],[["flex","none"],["padding","12px 18px 34px"],["background","$paper"],["box-shadow","0 -1px 0 $line"]]],[".efp-bk__done",[0,1,0],[["padding","40px 22px 20px"],["text-align","center"]]],[".efp-bk__check",[0,1,0],[["width","76px"],["height","76px"],["border-radius","50%"],["background","$accent"],["display","grid"],["place-items","center"],["margin","0 auto"]]],[".efp-bk__check svg",[0,1,1],[["width","38px"],["height","38px"]]],[".efp-bk__done .efp-bk__title",[0,2,0],[["margin-top","20px"],["font-size","34px"]]],[".efp-bk__when",[0,1,0],[["font-size","16px"],["margin-top","10px"],["font-weight","700"]]],[".efp-bk__who",[0,1,0],[["font-size","15px"],["color","$ink2"],["margin-top","2px"]]],[".efp-ph-scrim",[0,1,0],[["position","absolute"],["inset","0"],["z-index","40"],["background","$scrim"],["opacity","0"],["visibility","hidden"],["transition","opacity 200ms ease, visibility 0s linear 200ms"]]],[".efp-ph-scrim.efp-is-on",[0,2,0],[["opacity","1"],["visibility","visible"],["transition","opacity 240ms ease, visibility 0s"]]],[".efp-ph-sheet",[0,1,0],[["overscroll-behavior","contain"],["position","absolute"],["left","0"],["right","0"],["bottom","0"],["z-index","41"],["max-height","80%"],["overflow-y","auto"],["scrollbar-width","none"],["background","$card"],["border-radius","28px 28px 0 0"],["padding","10px 20px 40px"],["transform","translateY(100%)"],["visibility","hidden"],["transition","transform 220ms cubic-bezier(0.23, 1, 0.32, 1), visibility 0s linear 220ms"]]],[".efp-ph-sheet.efp-is-on",[0,2,0],[["transform","none"],["visibility","visible"],["transition","transform 320ms cubic-bezier(0.32, 0.72, 0, 1), visibility 0s"]]],[".efp-sheet__grab",[0,1,0],[["width","40px"],["height","5px"],["border-radius","3px"],["background","$n_DAD7D1"],["margin","0 auto 10px"]]],[".efp-sheet__top",[0,1,0],[["display","flex"],["align-items","center"],["justify-content","space-between"]]],[".efp-sheet__kicker",[0,1,0],[["font-family","$mono"],["font-size","11px"],["letter-spacing",".08em"],["text-transform","uppercase"],["color","$ink3"]]],[".efp-sheet__x",[0,1,0],[["width","40px"],["height","40px"],["margin-right","-8px"],["display","grid"],["place-items","center"],["border-radius","50%"]]],[".efp-sheet__x svg",[0,1,1],[["width","22px"],["height","22px"]]],[".efp-ph-sheet .efp-sheet__body",[0,2,0],[["display","grid"],["gap","10px"],["margin-top","12px"],["font-size","16px"],["line-height","1.5"],["color","$black"]]],[".efp-ph-toast",[0,1,0],[["position","absolute"],["left","16px"],["right","16px"],["top","112px"],["z-index","50"],["background","$ink"],["color","$onInk"],["border-radius","16px"],["padding","12px 15px"],["font-size","14.5px"],["line-height","1.4"],["opacity","0"],["transform","translateY(-8px)"],["pointer-events","none"],["transition","opacity 160ms ease, transform 160ms cubic-bezier(0.23, 1, 0.32, 1)"]]],[".efp-ph-toast.efp-is-on",[0,2,0],[["opacity","1"],["transform","none"],["transition-duration","220ms"]]],[".efp-plan__fine",[0,1,0],[["font-size","12.5px"],["color","$ink3"],["text-align","center"],["margin-top","16px"],["line-height","1.45"]]],[".efp-cp-tag",[0,1,0],[["font-family","$mono"],["font-size","10px"],["letter-spacing",".06em"],["text-transform","uppercase"],["background","$ink"],["color","$onInk"],["padding","2px 6px"],["border-radius","5px"]]],[".efp-cp-tag--s",[0,1,0],[["background","$card"],["color","$ink"]]],[".efp-hp",[0,1,0],[["padding","16px 16px 28px"]]],[".efp-hp-head",[0,1,0],[["display","grid"],["grid-template-columns","minmax(0, 1fr) 56px"],["gap","12px"],["align-items","center"],["padding","2px 2px 0"]]],[".efp-hp-head h2",[0,1,1],[["font-size","29px"],["line-height","1.06"]]],[".efp-hp-head p",[0,1,1],[["font-size","15px"],["color","$ink2"],["margin-top","6px"]]],[".efp-hp-head img",[0,1,1],[["width","56px"],["height","56px"],["border-radius","50%"],["object-fit","cover"],["background","$tile"],["box-shadow","0 0 0 3px $paper, 0 0 0 5.5px $accent"]]],[".efp-hp-need",[0,1,0],[["margin-top","14px"],["padding","16px"],["border-radius","22px"],["background","$card"],["box-shadow","0 1px 3px $wash"],["scroll-margin-top","12px"]]],[".efp-hp-need__k",[0,1,0],[["display","flex"],["align-items","center"],["gap","8px"],["font-size","15px"],["font-weight","800"]]],[".efp-hp-n",[0,1,0],[["flex","none"],["width","24px"],["height","24px"],["border-radius","50%"],["background","$primary"],["color","$onPrimary"],["display","grid"],["place-items","center"],["font-size","12.5px"],["font-weight","800"]]],[".efp-hp-srcs",[0,1,0],[["margin-left","auto"],["display","flex"],["gap","4px"]]],[".efp-hp-src",[0,1,0],[["height","24px"],["padding","0 9px"],["border-radius","999px"],["background","$tile"],["color","$ink2"],["font-size","12px"],["font-weight","700"],["display","inline-flex"],["align-items","center"],["white-space","nowrap"]]],[".efp-hp-src--dna",[0,1,0],[["background","$linkWash"],["color","$link"]]],[".efp-hp-need h3",[0,1,1],[["font-size","19px"],["font-weight","800"],["line-height","1.22"],["margin-top","12px"]]],[".efp-hp-need__s",[0,1,0],[["display","grid"],["grid-template-columns","9px minmax(0, 1fr)"],["gap","9px"],["align-items","baseline"],["margin-top","6px"],["font-size","15px"],["line-height","1.45"],["color","$ink2"]]],[".efp-hp-need__s b",[0,1,1],[["color","$ink"],["font-weight","800"]]],[".efp-hp-need__s .efp-dot",[0,2,0],[["transform","translateY(-1px)"]]],[".efp-hp-odds",[0,1,0],[["display","flex"],["justify-content","space-between"],["align-items","center"],["gap","12px"],["margin-top","12px"],["padding","10px 14px"],["border-radius","14px"],["background","$accent4"]]],[".efp-hp-odds__k",[0,1,0],[["font-size","13.5px"],["font-weight","600"],["line-height","1.35"],["color","$ink2"],["max-width","10em"]]],[".efp-hp-odds__k .efp-cp-tag",[0,2,0],[["display","inline-block"],["margin-top","3px"]]],[".efp-hp-odds__n",[0,1,0],[["display","grid"],["grid-template-columns","auto auto auto"],["align-items","center"],["justify-items","end"],["gap","0 6px"]]],[".efp-hp-odds__n s",[0,1,1],[["font-size","17px"],["font-weight","700"],["color","$ink3"]]],[".efp-hp-odds__n svg",[0,1,1],[["width","16px"],["height","16px"],["color","$ink3"]]],[".efp-hp-odds__n b",[0,1,1],[["font-family","$serif"],["font-size","28px"],["font-weight","800"],["line-height","1"]]],[".efp-hp-odds__n span",[0,1,1],[["grid-column","1 / -1"],["font-size","12.5px"],["font-weight","700"],["color","$link"],["margin-top","3px"]]],[".efp-hp-pick",[0,1,0],[["margin-top","12px"],["padding","12px"],["border-radius","16px"],["background","$paper"]]],[".efp-hp-pick__top",[0,1,0],[["display","grid"],["grid-template-columns","64px minmax(0, 1fr)"],["gap","12px"],["align-items","center"]]],[".efp-hp-pick__img",[0,1,0],[["width","64px"],["height","64px"],["border-radius","14px"],["background","$card"],["overflow","hidden"]]],[".efp-hp-pick__img img",[0,1,1],[["width","100%"],["height","100%"],["object-fit","cover"]]],[".efp-hp-pick h4",[0,1,1],[["font-size","17px"],["font-weight","800"],["line-height","1.2"]]],[".efp-hp-stars",[0,1,0],[["display","flex"],["align-items","center"],["gap","4px"],["margin-top","2px"],["font-size","13.5px"],["font-weight","800"]]],[".efp-hp-stars svg",[0,1,1],[["width","14px"],["height","14px"],["color","$watchDot"]]],[".efp-hp-stars span",[0,1,1],[["font-weight","500"],["color","$ink3"]]],[".efp-hp-pick__line",[0,1,0],[["margin-top","3px"],["font-size","14px"],["line-height","1.4"],["color","$ink2"]]],[".efp-hp-buy",[0,1,0],[["display","flex"],["justify-content","space-between"],["align-items","center"],["gap","12px"],["margin-top","12px"]]],[".efp-hp-price",[0,1,0],[["display","flex"],["flex-wrap","wrap"],["align-items","baseline"],["gap","0 8px"],["min-width","0"]]],[".efp-hp-price b",[0,1,1],[["font-size","24px"],["font-weight","800"],["line-height","1.1"],["font-variant-numeric","tabular-nums"]]],[".efp-hp-price s",[0,1,1],[["font-size","15px"],["font-weight","700"],["color","$riskInk"],["text-decoration-thickness","2px"]]],[".efp-hp-price small",[0,1,1],[["flex-basis","100%"],["margin-top","3px"],["font-size","12.5px"],["line-height","1.35"],["color","$ink3"]]],[".efp-hp-buy .efp-emb-btn",[0,2,0],[["flex","none"],["min-height","46px"],["padding","0 20px"]]],[".efp-hp-more",[0,1,0],[["display","flex"],["flex-wrap","wrap"],["gap","0 18px"],["margin-top","8px"]]],[".efp-hp-more button",[0,1,1],[["min-height","34px"],["font-size","14px"],["font-weight","700"],["color","$link"],["text-decoration","underline"],["text-decoration-thickness","1.5px"],["text-underline-offset","3px"]]],[".efp-hp-need > .efp-hp-more",[0,2,0],[["margin-top","10px"]]],[".efp-hp-on",[0,1,0],[["display","grid"],["grid-template-columns","34px minmax(0, 1fr) auto"],["gap","10px"],["align-items","center"],["margin-top","12px"],["padding","10px 10px 10px 12px"],["border-radius","14px"],["background","$clearBg"]]],[".efp-hp-on__ic",[0,1,0],[["width","34px"],["height","34px"],["border-radius","50%"],["background","$clearDot"],["color","$card"],["display","grid"],["place-items","center"]]],[".efp-hp-on__ic svg",[0,1,1],[["width","18px"],["height","18px"]]],[".efp-hp-on strong",[0,1,1],[["display","block"],["font-size","15px"],["color","$clearInk"],["line-height","1.25"]]],[".efp-hp-on small",[0,1,1],[["display","block"],["margin-top","1px"],["font-size","13px"],["line-height","1.35"],["color","$ink2"]]],[".efp-hp-on button",[0,1,1],[["min-height","38px"],["padding","0 14px"],["border-radius","999px"],["background","$card"],["font-size","14px"],["font-weight","800"],["box-shadow","inset 0 0 0 1.5px $ink"],["transition","transform 160ms cubic-bezier(0.23, 1, 0.32, 1)"]]],[".efp-is-on > .efp-hp-buy",[0,2,0],[["display","none"]]],[".efp-is-on [data-once]",[0,2,0],[["display","none"]]],[".efp-hp-by",[0,1,0],[["display","grid"],["grid-template-columns","40px minmax(0, 1fr)"],["gap","10px"],["align-items","center"],["margin-top","14px"],["padding","0 2px"]]],[".efp-hp-by img",[0,1,1],[["width","40px"],["height","40px"],["border-radius","50%"],["object-fit","cover"],["background","$tile"]]],[".efp-hp-by strong",[0,1,1],[["display","block"],["font-size","15px"],["font-weight","800"],["line-height","1.25"]]],[".efp-hp-by small",[0,1,1],[["display","block"],["margin-top","2px"],["font-family","$mono"],["font-size","10.5px"],["letter-spacing",".05em"],["text-transform","uppercase"],["color","$ink3"]]],[".efp-hp-steps",[0,1,0],[["margin-top","14px"],["padding","16px 12px 12px"],["border-radius","22px"],["background","$card"],["box-shadow","0 1px 3px $wash"]]],[".efp-hp-steps__head",[0,1,0],[["display","flex"],["justify-content","space-between"],["align-items","baseline"],["gap","12px"],["padding","0 4px"]]],[".efp-hp-steps__head h3",[0,1,1],[["font-size","19px"],["font-weight","800"],["line-height","1.2"]]],[".efp-hp-steps__head p",[0,1,1],[["font-family","$mono"],["font-size","11px"],["letter-spacing",".05em"],["text-transform","uppercase"],["color","$ink3"],["white-space","nowrap"]]],[".efp-hp-list",[0,1,0],[["list-style","none"],["margin","6px 0 0"],["padding","0"],["display","grid"],["gap","2px"]]],[".efp-hp-swipe",[0,1,0],[["display","flex"],["gap","10px"],["overflow-x","auto"],["scroll-snap-type","x mandatory"],["overscroll-behavior-x","contain"],["scrollbar-width","none"],["-webkit-overflow-scrolling","touch"]]],[".efp-hp-swipe[data-ef-focus-visible]",[0,2,0],[["border-radius","18px"]]],[".efp-hp-swipe > *",[0,1,0],[["flex","0 0 78%"],["max-width","280px"],["scroll-snap-align","start"]]],[".efp-hp-steps .efp-hp-swipe",[0,2,0],[["margin","10px -12px 0"],["padding","0 12px 2px"],["scroll-padding-inline","12px"]]],[".efp-hp-tip",[0,1,0],[["display","flex"],["flex-direction","column"],["padding","14px 14px 12px"],["border-radius","18px"]]],[".efp-hp-tip--y",[0,1,0],[["background","$accentChip"]]],[".efp-hp-tip--c",[0,1,0],[["background","$linkChip"]]],[".efp-hp-tip--g",[0,1,0],[["background","$clearChip"]]],[".efp-hp-tip--r",[0,1,0],[["background","$riskChip"]]],[".efp-hp-tip__top",[0,1,0],[["display","flex"],["justify-content","space-between"],["align-items","center"]]],[".efp-hp-tip__top svg",[0,1,1],[["width","26px"],["height","26px"],["color","$ink"]]],[".efp-hp-tip__n",[0,1,0],[["font-family","$serif"],["font-size","30px"],["font-weight","900"],["line-height","1"]]],[".efp-hp-tip strong",[0,1,1],[["display","block"],["margin-top","14px"],["font-size","17px"],["font-weight","800"],["line-height","1.25"]]],[".efp-hp-tip small",[0,1,1],[["display","block"],["margin-top","4px"],["font-size","14.5px"],["line-height","1.4"],["color","$ink2"]]],[".efp-hp-tip em",[0,1,1],[["display","block"],["margin-top","auto"],["padding-top","10px"],["font-style","normal"],["font-family","$mono"],["font-size","10.5px"],["letter-spacing",".04em"],["text-transform","uppercase"],["color","$link"]]],[".efp-hp-eyebrow",[0,1,0],[["font-family","$mono"],["font-size","11px"],["letter-spacing",".07em"],["text-transform","uppercase"],["color","$ink3"],["margin-bottom","6px"]]],[".efp-hp-head .efp-hp-eyebrow + h2",[0,2,1],[["margin-top","0"]]],[".efp-hp-by",[0,1,0],[["grid-template-columns","40px minmax(0, 1fr) 22px"],["margin-top","14px"],["padding","10px 12px"],["border-radius","16px"],["background","$card"],["box-shadow","0 1px 3px $wash"]]],[".efp-hp-by__ok",[0,1,0],[["width","22px"],["height","22px"],["color","$link"]]],[".efp-hp-says",[0,1,0],[["display","grid"],["grid-template-columns","32px minmax(0, 1fr)"],["gap","10px"],["align-items","start"],["margin","12px 0 0"],["padding","10px 12px"],["border-radius","14px"],["background","$paper"]]],[".efp-hp-says img",[0,1,1],[["width","32px"],["height","32px"],["border-radius","50%"],["object-fit","cover"]]],[".efp-hp-says p",[0,1,1],[["font-size","14.5px"],["line-height","1.4"],["color","$ink2"]]],[".efp-hp-says b",[0,1,1],[["color","$ink"],["font-weight","800"],["margin-right","2px"]]],[".efp-hp-jump",[0,1,0],[["width","100%"],["display","grid"],["grid-template-columns","44px minmax(0, 1fr) auto"],["gap","12px"],["align-items","center"],["margin-top","12px"],["padding","8px 14px 8px 8px"],["border-radius","14px"],["background","$primary"],["color","$onPrimary"],["text-align","left"],["transition","transform 160ms cubic-bezier(0.23, 1, 0.32, 1)"]]],[".efp-hp-jump img",[0,1,1],[["width","44px"],["height","44px"],["border-radius","10px"],["object-fit","cover"],["background","$card"]]],[".efp-hp-jump small",[0,1,1],[["display","block"],["font-size","13px"],["font-weight","800"],["color","$accent"]]],[".efp-hp-jump strong",[0,1,1],[["display","block"],["font-size","15px"],["font-weight","800"],["line-height","1.25"]]],[".efp-hp-jump__go",[0,1,0],[["font-size","14px"],["font-weight","800"]]],[".efp-hp-n",[0,1,0],[["flex","none"]]],[".efp-hp-steps__head h3",[0,1,1],[["display","flex"],["align-items","center"],["gap","10px"],["font-size","19px"],["font-weight","800"],["line-height","1.2"]]],[".efp-hp-sec__h",[0,1,0],[["display","flex"],["align-items","center"],["gap","10px"],["font-size","19px"],["font-weight","800"],["line-height","1.2"]]],[".efp-hp-sec",[0,1,0],[["margin-top","14px"],["padding","16px"],["border-radius","22px"],["background","$card"],["box-shadow","0 1px 3px $wash"],["scroll-margin-top","12px"]]],[".efp-hp-sec .efp-hp-pick",[0,2,0],[["margin-top","14px"],["padding","0"],["background","none"]]],[".efp-hp-sec .efp-hp-pick__top",[0,2,0],[["grid-template-columns","76px minmax(0, 1fr)"]]],[".efp-hp-sec .efp-hp-pick__img",[0,2,0],[["width","76px"],["height","76px"],["background","$paper"]]],[".efp-hp-mini",[0,1,0],[["font-family","$mono"],["font-size","10.5px"],["letter-spacing",".06em"],["text-transform","uppercase"],["color","$ink3"]]],[".efp-hp-why",[0,1,0],[["margin-top","14px"],["padding","12px 14px"],["border-radius","16px"],["box-shadow","inset 0 0 0 1.5px $ink"]]],[".efp-hp-why ul",[0,1,1],[["list-style","none"],["margin","0"],["padding","0"]]],[".efp-hp-dose ul",[0,1,1],[["list-style","none"],["margin","0"],["padding","0"]]],[".efp-hp-why li",[0,1,1],[["display","grid"],["grid-template-columns","58px minmax(0, 1fr)"],["gap","10px"],["align-items","start"],["margin-top","10px"]]],[".efp-hp-why strong",[0,1,1],[["display","block"],["font-size","15px"],["font-weight","800"],["line-height","1.3"]]],[".efp-hp-why small",[0,1,1],[["display","block"],["margin-top","1px"],["font-size","14px"],["line-height","1.4"],["color","$ink2"]]],[".efp-hp-chip",[0,1,0],[["height","22px"],["border-radius","6px"],["display","grid"],["place-items","center"],["font-family","$mono"],["font-size","10.5px"],["font-weight","700"],["letter-spacing",".04em"],["text-transform","uppercase"]]],[".efp-hp-chip--dna",[0,1,0],[["background","$linkWash"],["color","$link"]]],[".efp-hp-chip--ask",[0,1,0],[["background","$accent4"],["color","$ink"]]],[".efp-hp-chip--rec",[0,1,0],[["background","$tile"],["color","$ink2"]]],[".efp-hp-dose",[0,1,0],[["margin-top","10px"],["padding","12px 14px 14px"],["border-radius","16px"],["background","$linkWash"]]],[".efp-hp-dose .efp-hp-mini",[0,2,0],[["color","$link"]]],[".efp-hp-dose ul",[0,1,1],[["display","grid"],["grid-template-columns","repeat(3, minmax(0, 1fr))"],["gap","8px"],["margin-top","10px"]]],[".efp-hp-dose li",[0,1,1],[["display","grid"],["justify-items","center"],["gap","2px"],["padding","10px 4px"],["border-radius","12px"],["background","$card"],["text-align","center"]]],[".efp-hp-dose b",[0,1,1],[["font-family","$mono"],["font-size","21px"],["font-weight","700"],["line-height","1.1"],["font-variant-numeric","tabular-nums"]]],[".efp-hp-dose small",[0,1,1],[["font-size","12.5px"],["line-height","1.3"],["color","$ink2"]]],[".efp-hp-dose > p:last-child",[0,2,1],[["margin-top","10px"],["font-size","14px"],["line-height","1.45"],["color","$link"]]],[".efp-hp-in",[0,1,0],[["display","flex"],["flex-wrap","wrap"],["gap","6px"],["margin-top","12px"]]],[".efp-hp-in span",[0,1,1],[["padding","6px 10px"],["border-radius","999px"],["background","$tile"],["font-size","13.5px"],["font-weight","600"]]],[".efp-hp-opts",[0,1,0],[["display","grid"],["gap","8px"],["margin-top","14px"]]],[".efp-hp-opt",[0,1,0],[["width","100%"],["display","flex"],["justify-content","space-between"],["align-items","center"],["gap","12px"],["padding","14px"],["border-radius","16px"],["background","$card"],["text-align","left"],["box-shadow","inset 0 0 0 1.5px $n_DEDCD7"],["transition","box-shadow 160ms ease, transform 160ms cubic-bezier(0.23, 1, 0.32, 1)"]]],['.efp-hp-opt[aria-checked="true"]',[0,2,0],[["box-shadow","inset 0 0 0 2.5px $ink"]]],[".efp-hp-opt__t",[0,1,0],[["display","grid"],["justify-items","start"],["gap","2px"]]],[".efp-hp-opt__t strong",[0,1,1],[["font-size","16px"],["font-weight","800"]]],[".efp-hp-opt__t small",[0,1,1],[["font-size","13.5px"],["color","$ink2"]]],[".efp-hp-opt__tag",[0,1,0],[["margin-bottom","4px"],["padding","2px 8px"],["border-radius","6px"],["background","$riskInk"],["color","$card"],["font-size","12px"],["font-weight","800"]]],[".efp-hp-opt__p",[0,1,0],[["font-size","18px"],["font-weight","800"]]],[".efp-hp-opt .efp-hp-price",[0,2,0],[["display","flex"],["flex-direction","column"],["align-items","flex-end"],["flex-wrap","nowrap"]]],[".efp-hp-opt .efp-hp-price s",[0,2,1],[["order","-1"]]],[".efp-hp-opt .efp-hp-price small",[0,2,1],[["display","none"]]],[".efp-hp-sec .efp-hp-buy",[0,2,0],[["display","block"],["margin-top","12px"]]],[".efp-hp-sec .efp-hp-buy .efp-emb-btn",[0,3,0],[["width","100%"],["min-height","52px"],["font-size","17px"]]],[".efp-hp-trust",[0,1,0],[["list-style","none"],["margin","12px 0 0"],["padding","0"],["display","grid"],["grid-template-columns","repeat(3, minmax(0, 1fr))"],["gap","6px"]]],[".efp-hp-trust li",[0,1,1],[["display","grid"],["justify-items","center"],["gap","4px"],["font-size","12.5px"],["font-weight","600"],["line-height","1.3"],["text-align","center"],["color","$ink2"]]],[".efp-hp-trust svg",[0,1,1],[["width","20px"],["height","20px"],["color","$link"]]],[".efp-is-on > .efp-hp-opts",[0,2,0],[["display","none"]]],[".efp-is-on > .efp-hp-trust",[0,2,0],[["display","none"]]],[".efp-hp-fine",[0,1,0],[["margin-top","8px"],["font-size","13px"],["line-height","1.45"],["color","$ink3"]]],[".efp-hp-sign",[0,1,0],[["margin-top","12px"],["padding","14px"],["border-radius","16px"],["box-shadow","inset 0 0 0 1.5px $n_DEDCD7"]]],[".efp-hp-sign h4",[0,1,1],[["display","flex"],["align-items","center"],["gap","8px"],["font-size","16px"],["font-weight","800"],["line-height","1.25"]]],[".efp-hp-sign p",[0,1,1],[["margin-top","4px"],["font-size","15px"],["line-height","1.45"],["color","$ink2"]]],[".efp-hp-sign--er",[0,1,0],[["background","$riskBg"],["box-shadow","none"]]],[".efp-hp-sign--er h4",[0,1,1],[["color","$riskInk"]]],[".efp-hp-sign--er h4 svg",[0,1,2],[["width","20px"],["height","20px"]]],[".efp-hp-sign--er p",[0,1,1],[["color","$ink"]]],[".efp-hp-qs",[0,1,0],[["margin","10px 0 0"],["padding-left","22px"],["display","grid"],["gap","6px"],["font-size","15px"],["line-height","1.45"]]],[".efp-hp-sec .efp-hp-add",[0,2,0],[["display","flex"],["align-items","center"],["justify-content","center"],["width","100%"],["padding","0 16px"],["min-height","48px"],["margin-top","14px"],["border-radius","999px"],["font-size","16px"],["font-weight","800"],["box-shadow","inset 0 0 0 2px $ink"],["transition","transform 160ms cubic-bezier(0.23, 1, 0.32, 1), background-color 180ms ease"]]],['.efp-hp-sec .efp-hp-add[aria-pressed="true"]',[0,3,0],[["background","$clearBg"],["color","$clearInk"],["box-shadow","none"]]],[".efp-hp-revs",[0,1,0],[["margin","12px -16px 0"],["padding","0 16px"],["scroll-padding-inline","16px"]]],[".efp-hp-rev",[0,1,0],[["margin","0"],["padding","12px 14px"],["border-radius","14px"],["background","$paper"]]],[".efp-hp-rev__s",[0,1,0],[["display","flex"],["gap","1px"],["color","$watchDot"]]],[".efp-hp-rev__s svg",[0,1,1],[["width","13px"],["height","13px"]]],[".efp-hp-rev blockquote",[0,1,1],[["margin","5px 0 0"],["font-size","15px"],["line-height","1.4"]]],[".efp-hp-rev figcaption",[0,1,1],[["margin-top","4px"],["font-size","13px"],["color","$ink3"]]],[".efp-hp-score",[0,1,0],[["display","flex"],["justify-content","space-between"],["align-items","center"],["gap","8px"],["margin-top","12px"],["padding","11px 12px 11px 14px"],["border-radius","12px"],["background","$primary"],["color","$onPrimary"],["font-size","14.5px"],["font-weight","800"],["line-height","1.3"]]],[".efp-hp-score b",[0,1,1],[["flex","none"],["font-family","$mono"],["font-size","16px"],["font-weight","700"],["color","$accent"]]],[".efp-hp-opt--once",[0,1,0],[["padding","10px 14px"],["background","$paper"],["box-shadow","none"]]],[".efp-hp-opt--once .efp-hp-opt__t strong",[0,2,1],[["font-size","15px"],["font-weight","700"]]],[".efp-hp-opt--once .efp-hp-opt__t small",[0,2,1],[["font-size","13px"]]],[".efp-hp-opt--once .efp-hp-opt__p",[0,2,0],[["font-size","15px"],["font-weight","700"],["color","$ink2"]]],['.efp-hp-opt--once[aria-checked="true"]',[0,2,0],[["background","$card"],["box-shadow","inset 0 0 0 2px $ink"]]],[".efp-hp-proof",[0,1,0],[["display","flex"],["justify-content","center"],["align-items","center"],["gap","6px"],["margin-top","10px"],["font-size","14.5px"],["font-weight","800"],["color","$riskInk"]]],[".efp-hp-proof svg",[0,1,1],[["width","21px"],["height","21px"],["flex","none"],["margin-top","-2px"]]],[".efp-is-on > .efp-hp-proof",[0,2,0],[["display","none"]]],[".efp-hp-qs__k",[0,1,0],[["margin-top","18px"],["font-size","16px"],["font-weight","800"],["line-height","1.25"]]],[".efp-hp-qs__k + .efp-hp-qs",[0,2,0],[["margin-top","6px"]]],[".efp-hp-xs",[0,1,0],[["margin-top","22px"],["display","grid"],["gap","10px"]]],[".efp-hp-xs .efp-hp-eyebrow",[0,2,0],[["margin","0 4px"],["font-weight","400"]]],[".efp-hp-x",[0,1,0],[["display","grid"],["grid-template-columns","56px minmax(0, 1fr)"],["gap","4px 12px"],["align-items","start"],["padding","14px"],["border-radius","22px"],["background","$card"],["box-shadow","0 1px 3px $wash"]]],[".efp-hp-x > img",[0,1,1],[["width","56px"],["height","56px"],["border-radius","14px"],["object-fit","cover"],["background","$card"]]],[".efp-hp-x__ic",[0,1,0],[["width","56px"],["height","56px"],["border-radius","14px"],["object-fit","cover"],["background","$card"]]],[".efp-hp-x__ic",[0,1,0],[["display","grid"],["place-items","center"],["background","$linkWash"],["color","$link"]]],[".efp-hp-x__ic svg",[0,1,1],[["width","26px"],["height","26px"]]],[".efp-hp-x h4",[0,1,1],[["font-size","17px"],["font-weight","800"],["line-height","1.2"]]],[".efp-hp-x h4.efp-serif",[0,2,1],[["font-size","21px"]]],[".efp-hp-x p",[0,1,1],[["margin-top","3px"],["font-size","14.5px"],["line-height","1.4"],["color","$ink2"]]],[".efp-hp-x .efp-hp-x__p",[0,2,0],[["display","flex"],["flex-wrap","wrap"],["align-items","center"],["gap","0 8px"],["margin-top","6px"],["color","$ink"]]],[".efp-hp-x__p b",[0,1,1],[["font-size","19px"],["font-weight","800"],["font-variant-numeric","tabular-nums"]]],[".efp-hp-x__p s",[0,1,1],[["font-size","14px"],["font-weight","700"],["color","$ink3"]]],[".efp-hp-x__go",[0,1,0],[["grid-column","2"],["justify-self","start"],["margin-top","8px"],["min-height","40px"],["padding","0 18px"],["border-radius","999px"],["background","$primary"],["color","$onPrimary"],["font-size","14.5px"],["font-weight","800"],["transition","transform 160ms cubic-bezier(0.23, 1, 0.32, 1), background-color 180ms ease"]]],['.efp-hp-x__go[aria-pressed="true"]',[0,2,0],[["background","$clearBg"],["color","$clearInk"]]],[".efp-hp-x--kit",[0,1,0],[["background","$linkWash"],["box-shadow","none"]]],[".efp-hp-x--kit > img",[0,1,1],[["background","$card"]]],[".efp-hp-next",[0,1,0],[["list-style","none"],["margin","22px 0 0"],["padding","4px 16px"],["border-radius","18px"],["background","$card"],["text-align","left"],["box-shadow","0 1px 3px $wash"]]],[".efp-hp-next li",[0,1,1],[["display","grid"],["grid-template-columns","36px minmax(0, 1fr)"],["gap","12px"],["align-items","center"],["padding","10px 0"]]],[".efp-hp-next__ic",[0,1,0],[["width","36px"],["height","36px"],["border-radius","11px"],["background","$linkWash"],["color","$link"],["display","grid"],["place-items","center"]]],[".efp-hp-next__ic svg",[0,1,1],[["width","19px"],["height","19px"]]],[".efp-hp-next small",[0,1,1],[["display","block"],["font-family","$mono"],["font-size","10.5px"],["letter-spacing",".05em"],["text-transform","uppercase"],["color","$ink3"]]],[".efp-hp-next span",[0,1,1],[["display","block"],["margin-top","1px"],["font-size","15px"],["font-weight","600"],["line-height","1.35"]]],[".efp-co",[0,1,0],[["display","grid"],["gap","10px"],["margin-top","2px"]]],[".efp-co-prod",[0,1,0],[["display","grid"],["grid-template-columns","56px minmax(0, 1fr)"],["gap","12px"],["align-items","center"]]],[".efp-co-prod__img",[0,1,0],[["width","56px"],["height","56px"],["border-radius","14px"],["background","$accent3"],["color","$ink"],["overflow","hidden"],["display","grid"],["place-items","center"]]],[".efp-co-prod__img img",[0,1,1],[["width","100%"],["height","100%"],["object-fit","cover"]]],[".efp-co-prod__img svg",[0,1,1],[["width","30px"],["height","30px"]]],[".efp-co-prod p",[0,1,1],[["margin-top","2px"],["font-size","14px"],["line-height","1.35"],["color","$ink2"]]],[".efp-co-prod__t",[0,1,0],[["font-size","20px"],["font-weight","800"],["line-height","1.2"],["color","$ink"]]],[".efp-co-prod .efp-co-prod__t",[0,2,0],[["margin-top","0"]]],[".efp-co-opts",[0,1,0],[["display","grid"],["gap","8px"]]],[".efp-co-opt",[0,1,0],[["border-radius","16px"],["box-shadow","inset 0 0 0 1.5px $n_DAD7D1"],["transition","box-shadow 160ms ease, background-color 160ms ease"]]],[".efp-co-opt.efp-is-on",[0,2,0],[["background","$accent4"],["box-shadow","inset 0 0 0 2px $ink"]]],[".efp-co-opt.efp-is-on .efp-bk__radio",[0,3,0],[["box-shadow","inset 0 0 0 7px $ink"]]],[".efp-co-opt__hit",[0,1,0],[["width","100%"],["display","grid"],["grid-template-columns","22px minmax(0, 1fr) auto"],["gap","2px 12px"],["align-items","start"],["padding","12px 14px"],["border-radius","16px"],["text-align","left"]]],[".efp-co-opt__hit strong",[0,1,1],[["font-size","16px"],["line-height","1.35"]]],[".efp-co-opt__p",[0,1,0],[["text-align","right"],["font-size","16px"],["font-weight","800"],["line-height","1.35"],["font-variant-numeric","tabular-nums"]]],[".efp-co-opt__p s",[0,1,1],[["display","block"],["font-size","13px"],["font-weight","600"],["color","$riskInk"]]],[".efp-co-opt__hit small",[0,1,1],[["grid-column","2 / -1"],["font-size","13px"],["line-height","1.4"],["color","$ink2"]]],[".efp-co-k",[0,1,0],[["font-family","$mono"],["font-size","10.5px"],["letter-spacing",".06em"],["text-transform","uppercase"],["color","$ink3"],["margin-bottom","6px"]]],[".efp-co-every",[0,1,0],[["display","grid"],["grid-template-columns","repeat(3, minmax(0, 1fr))"],["gap","4px"],["padding","4px"],["border-radius","999px"],["background","$card"],["box-shadow","inset 0 0 0 1.5px $n_DAD7D1"]]],[".efp-co-when",[0,1,0],[["padding","0 14px 12px 48px"]]],[".efp-co-every button",[0,1,1],[["min-height","36px"],["padding","0 6px"],["border-radius","999px"],["font-size","14px"],["font-weight","700"],["text-align","center"],["white-space","nowrap"],["transition","background-color 160ms ease, transform 160ms cubic-bezier(0.23, 1, 0.32, 1)"]]],['.efp-co-every button[aria-checked="true"]',[0,2,1],[["background","$primary"],["color","$onPrimary"]]],[".efp-co-rows",[0,1,0],[["list-style","none"],["margin","0"],["padding","2px 14px"],["border-radius","16px"],["background","$paper"]]],[".efp-co-rows li",[0,1,1],[["display","grid"],["grid-template-columns","20px 4.6rem minmax(0, 1fr)"],["gap","10px"],["align-items","center"],["min-height","40px"],["font-size","14.5px"]]],[".efp-co-rows svg",[0,1,1],[["width","20px"],["height","20px"],["color","$ink2"]]],[".efp-co-rows span",[0,1,1],[["color","$ink3"]]],[".efp-co-rows b",[0,1,1],[["font-weight","700"]]],[".efp-co-fine",[0,1,0],[["font-size","12.5px"],["line-height","1.45"],["color","$ink3"],["text-align","center"]]],[".efp-mg-cancel",[0,1,0],[["justify-self","center"],["min-height","40px"],["font-size","14.5px"],["font-weight","700"],["color","$riskInk"]]],[".efp-hp-tools",[0,1,0],[["display","flex"],["align-items","center"],["justify-content","space-between"],["gap","8px"],["margin","-8px -6px 2px 2px"]]],[".efp-hp-tools .efp-hp-eyebrow",[0,2,0],[["margin","0"]]],[".efp-hp-tools__end",[0,1,0],[["display","flex"],["align-items","center"],["gap","2px"]]],[".efp-hp-orders",[0,1,0],[["display","inline-flex"],["align-items","center"],["gap","6px"],["min-height","44px"],["padding","0 8px"],["border-radius","999px"],["font-size","15px"],["font-weight","700"]]],[".efp-hp-orders svg",[0,1,1],[["width","21px"],["height","21px"]]],[".efp-hp-cart",[0,1,0],[["position","relative"],["width","44px"],["height","44px"],["display","grid"],["place-items","center"],["border-radius","50%"]]],[".efp-hp-cart svg",[0,1,1],[["width","26px"],["height","26px"]]],[".efp-hp-cart__n",[0,1,0],[["position","absolute"],["top","3px"],["right","1px"],["min-width","20px"],["height","20px"],["padding","0 5px"],["border-radius","999px"],["background","$riskDot"],["color","$card"],["font-size","12px"],["font-weight","800"],["line-height","20px"],["text-align","center"],["font-variant-numeric","tabular-nums"],["box-shadow","0 0 0 2px $paper"]]],[".efp-hp-ask-row",[0,1,0],[["width","100%"],["display","grid"],["grid-template-columns","40px minmax(0, 1fr) 18px"],["gap","12px"],["align-items","center"],["margin-top","10px"],["padding","12px 14px 12px 12px"],["border-radius","16px"],["background","$linkWash"],["text-align","left"],["transition","transform 160ms cubic-bezier(0.23, 1, 0.32, 1)"]]],[".efp-hp-ask-row__ic",[0,1,0],[["width","40px"],["height","40px"],["border-radius","11px"],["background","$card"],["color","$link"],["display","grid"],["place-items","center"]]],[".efp-hp-ask-row__ic svg",[0,1,1],[["width","21px"],["height","21px"]]],[".efp-hp-ask-row strong",[0,1,1],[["display","block"],["font-size","15.5px"],["font-weight","800"],["line-height","1.3"]]],[".efp-hp-ask-row small",[0,1,1],[["display","block"],["margin-top","1px"],["font-size","14px"],["line-height","1.4"],["color","$ink2"]]],[".efp-hp-ask-row > svg",[0,1,1],[["width","18px"],["height","18px"],["color","$ink2"]]],[".efp-hp-sec .efp-hp-ask-row",[0,2,0],[["margin-top","12px"]]],[".efp-hp-wait",[0,1,0],[["margin-top","14px"],["padding","16px"],["border-radius","22px"],["background","$card"],["box-shadow","0 1px 3px $wash"]]],[".efp-hp-wait__top",[0,1,0],[["display","grid"],["grid-template-columns","46px minmax(0, 1fr)"],["gap","12px"],["align-items","center"]]],[".efp-hp-wait__top h3",[0,1,1],[["font-size","26px"],["line-height","1.05"],["margin-top","2px"]]],[".efp-hp-wait .efp-sh-track",[0,2,0],[["margin-top","14px"]]],[".efp-hp-wait__k",[0,1,0],[["margin-top","18px"],["font-size","16px"],["font-weight","800"]]],[".efp-hp-next--in",[0,1,0],[["margin-top","8px"],["background","$paper"],["box-shadow","none"]]],[".efp-hp-wait__text",[0,1,0],[["display","flex"],["align-items","center"],["gap","8px"],["margin","16px 0 12px"],["font-size","15.5px"],["font-weight","700"]]],[".efp-hp-wait__text svg",[0,1,1],[["width","20px"],["height","20px"],["color","$link"],["flex","none"]]],[".efp-sh-track",[0,1,0],[["list-style","none"],["margin","0"],["padding","0"]]],[".efp-sh-track li",[0,1,1],[["position","relative"],["display","grid"],["grid-template-columns","22px minmax(0, 1fr)"],["gap","12px"],["padding-bottom","16px"]]],[".efp-sh-track li:last-child",[0,2,1],[["padding-bottom","0"]]],[".efp-sh-track li > .efp-before",[0,2,1],[["position","absolute"],["left","10px"],["top","20px"],["bottom","-2px"],["width","2px"],["border-radius","1px"],["background","$n_E2DFD9"]]],[".efp-sh-track li:last-child > .efp-before",[0,3,1],[["display","none"]]],[".efp-sh-track li.efp-is-done:has(+ li.efp-is-done) > .efp-before",[0,4,2],[["background","$primary"]]],[".efp-sh-track__dot",[0,1,0],[["width","22px"],["height","22px"],["border-radius","50%"],["display","grid"],["place-items","center"],["background","$card"],["box-shadow","inset 0 0 0 2px $n_CFCBC4"],["position","relative"],["z-index","1"]]],[".efp-sh-track__dot svg",[0,1,1],[["width","13px"],["height","13px"],["color","$card"]]],[".efp-sh-track .efp-is-done .efp-sh-track__dot",[0,3,0],[["background","$primary"],["box-shadow","none"]]],[".efp-sh-track .efp-is-now .efp-sh-track__dot",[0,3,0],[["background","$accent"],["box-shadow","inset 0 0 0 2px $ink"]]],[".efp-sh-track strong",[0,1,1],[["display","block"],["font-size","15.5px"],["font-weight","800"],["line-height","1.3"]]],[".efp-sh-track small",[0,1,1],[["display","block"],["margin-top","1px"],["font-size","14px"],["line-height","1.35"],["color","$ink3"]]],[".efp-sh-track li:not(.efp-is-done):not(.efp-is-now) strong",[0,3,2],[["color","$ink3"],["font-weight","700"]]],[".efp-sh",[0,1,0],[["display","grid"],["gap","12px"],["padding","8px 18px 28px"]]],[".efp-sh-title",[0,1,0],[["font-size","29px"],["line-height","1.08"]]],[".efp-sh-sub2",[0,1,0],[["margin-top","-6px"],["font-size","15px"],["line-height","1.45"],["color","$ink2"]]],[".efp-sh-k",[0,1,0],[["margin","6px 2px -4px"],["font-size","16px"],["font-weight","800"]]],[".efp-sh-card",[0,1,0],[["padding","14px 16px"],["border-radius","22px"],["background","$card"],["box-shadow","0 1px 3px $wash"]]],[".efp-sh-items",[0,1,0],[["list-style","none"],["margin","0"],["padding","0"],["display","grid"],["gap","18px"]]],[".efp-sh-item",[0,1,0],[["display","grid"],["grid-template-columns","64px minmax(0, 1fr)"],["gap","12px"],["align-items","start"]]],[".efp-sh-item__img",[0,1,0],[["width","64px"],["height","64px"],["border-radius","14px"],["overflow","hidden"],["display","grid"],["place-items","center"],["background","$linkWash"],["color","$link"]]],[".efp-sh-item__img img",[0,1,1],[["width","100%"],["height","100%"],["object-fit","cover"]]],[".efp-sh-item__img svg",[0,1,1],[["width","28px"],["height","28px"]]],[".efp-sh-item h3",[0,1,1],[["font-size","16.5px"],["font-weight","800"],["line-height","1.25"]]],[".efp-sh-item__p",[0,1,0],[["display","flex"],["flex-wrap","wrap"],["align-items","center"],["gap","2px 8px"],["margin-top","3px"]]],[".efp-sh-item__p b",[0,1,1],[["font-size","16px"],["font-weight","800"],["font-variant-numeric","tabular-nums"]]],[".efp-sh-item__p s",[0,1,1],[["font-size","14px"],["font-weight","600"],["color","$ink3"]]],[".efp-sh-item__p small",[0,1,1],[["font-size","14px"],["color","$ink3"]]],[".efp-sh-item__acts",[0,1,0],[["display","flex"],["align-items","center"],["gap","16px"],["margin-top","8px"]]],[".efp-sh-step",[0,1,0],[["display","inline-grid"],["grid-template-columns","40px 30px 40px"],["align-items","center"],["height","40px"],["border-radius","999px"],["background","$card"],["box-shadow","inset 0 0 0 1.5px $n_DAD7D1"]]],[".efp-sh-step button",[0,1,1],[["height","40px"],["display","grid"],["place-items","center"],["border-radius","999px"],["transition","transform 160ms cubic-bezier(0.23, 1, 0.32, 1)"]]],[".efp-sh-step button svg",[0,1,2],[["width","16px"],["height","16px"]]],[".efp-sh-step button[disabled]",[0,2,1],[["opacity",".3"],["cursor","default"]]],[".efp-sh-step output",[0,1,1],[["text-align","center"],["font-size","15.5px"],["font-weight","800"],["font-variant-numeric","tabular-nums"]]],[".efp-sh-rm",[0,1,0],[["min-height","40px"],["font-size","14.5px"],["font-weight","700"],["color","$ink2"],["text-decoration","underline"],["text-decoration-thickness","1.5px"],["text-underline-offset","3px"]]],[".efp-sh-mode",[0,1,0],[["display","grid"],["gap","6px"],["margin-top","8px"]]],[".efp-sh-mode button",[0,1,1],[["display","flex"],["justify-content","space-between"],["align-items","center"],["gap","10px"],["min-height","44px"],["padding","8px 12px"],["border-radius","12px"],["background","$paper"],["font-size","14.5px"],["font-weight","700"],["line-height","1.3"],["text-align","left"],["transition","box-shadow 160ms ease, transform 160ms cubic-bezier(0.23, 1, 0.32, 1)"]]],['.efp-sh-mode button[aria-checked="true"]',[0,2,1],[["background","$card"],["box-shadow","inset 0 0 0 2px $ink"]]],[".efp-sh-mode b",[0,1,1],[["font-weight","800"],["font-variant-numeric","tabular-nums"]]],[".efp-sh-item .efp-co-every",[0,2,0],[["margin-top","8px"]]],[".efp-sh-sum li.efp-is-renew",[0,2,1],[["min-height","28px"],["margin-top","-6px"],["font-size","14px"]]],[".efp-sh-sum",[0,1,0],[["list-style","none"],["margin","0"],["padding","6px 16px"],["border-radius","16px"],["background","$card"],["box-shadow","0 1px 3px $wash"]]],[".efp-sh-sum li",[0,1,1],[["display","flex"],["justify-content","space-between"],["align-items","center"],["gap","12px"],["min-height","34px"],["font-size","15px"],["font-variant-numeric","tabular-nums"]]],[".efp-sh-sum li > span:first-child",[0,2,2],[["color","$ink2"],["display","inline-flex"],["align-items","center"],["gap","8px"]]],[".efp-sh-sum li.efp-is-total",[0,2,1],[["min-height","42px"],["font-size","17px"],["font-weight","800"]]],[".efp-sh-sum li.efp-is-total span:first-child",[0,3,2],[["color","$ink"]]],[".efp-sh-foot",[0,1,0],[["display","grid"],["gap","8px"]]],[".efp-sh-foot .efp-sh-fine",[0,2,0],[["text-align","center"]]],[".efp-sh-fine",[0,1,0],[["font-size","13px"],["line-height","1.45"],["color","$ink3"]]],[".efp-sh-fine--c",[0,1,0],[["margin-top","14px"],["text-align","center"]]],[".efp-sh-empty",[0,1,0],[["display","grid"],["justify-items","center"],["gap","8px"],["padding","48px 12px 8px"],["text-align","center"]]],[".efp-sh-empty .efp-emb-tile",[0,2,0],[["width","72px"],["height","72px"],["border-radius","20px"],["margin-bottom","8px"]]],[".efp-sh-empty .efp-emb-tile svg",[0,2,1],[["width","34px"],["height","34px"]]],[".efp-sh-empty h2",[0,1,1],[["font-size","28px"],["line-height","1.1"]]],[".efp-sh-empty p",[0,1,1],[["max-width","30ch"],["font-size","15.5px"],["line-height","1.45"],["color","$ink2"],["text-wrap","pretty"]]],[".efp-sh-empty .efp-emb-btn",[0,2,0],[["margin-top","12px"]]],[".efp-sh-link",[0,1,0],[["min-height","40px"],["font-size","15px"],["font-weight","700"],["color","$link"],["text-decoration","underline"],["text-decoration-thickness","1.5px"],["text-underline-offset","3px"]]],[".efp-sh-subc",[0,1,0],[["display","grid"],["grid-template-columns","56px minmax(0, 1fr) auto"],["gap","12px"],["align-items","center"],["padding","12px 14px 12px 12px"],["border-radius","22px"],["background","$clearBg"]]],[".efp-sh-subc img",[0,1,1],[["width","56px"],["height","56px"],["border-radius","14px"],["object-fit","cover"],["background","$card"]]],[".efp-sh-subc strong",[0,1,1],[["display","block"],["font-size","16px"],["font-weight","800"],["line-height","1.25"]]],[".efp-sh-subc small",[0,1,1],[["display","block"],["margin-top","2px"],["font-size","14px"],["line-height","1.35"],["color","$ink2"]]],[".efp-sh-subc button",[0,1,1],[["min-height","40px"],["padding","0 14px"],["border-radius","999px"],["background","$card"],["font-size","14px"],["font-weight","800"],["box-shadow","inset 0 0 0 1.5px $ink"],["transition","transform 160ms cubic-bezier(0.23, 1, 0.32, 1)"]]],[".efp-sh-orders",[0,1,0],[["list-style","none"],["margin","0"],["padding","0"],["display","grid"],["gap","10px"]]],[".efp-sh-order",[0,1,0],[["width","100%"],["display","grid"],["grid-template-columns","minmax(0, 1fr) 18px"],["gap","10px"],["align-items","center"],["padding","14px 14px 14px 16px"],["border-radius","22px"],["background","$card"],["box-shadow","0 1px 3px $wash"],["text-align","left"],["transition","transform 160ms cubic-bezier(0.23, 1, 0.32, 1)"]]],[".efp-sh-order > svg",[0,1,1],[["width","18px"],["height","18px"],["color","$ink3"]]],[".efp-sh-order__top",[0,1,0],[["display","flex"],["flex-wrap","wrap"],["align-items","center"],["gap","4px 10px"]]],[".efp-sh-order__no",[0,1,0],[["font-family","$mono"],["font-size","12px"],["letter-spacing",".04em"],["color","$ink3"]]],[".efp-sh-order__what",[0,1,0],[["display","block"],["margin-top","8px"],["font-size","16px"],["font-weight","800"],["line-height","1.3"]]],[".efp-sh-order__meta",[0,1,0],[["display","block"],["margin-top","2px"],["font-size","14px"],["line-height","1.4"],["color","$ink3"]]],[".efp-sh-order__pics",[0,1,0],[["display","flex"],["gap","6px"],["margin-top","10px"]]],[".efp-sh-order__pics span",[0,1,1],[["width","40px"],["height","40px"],["border-radius","10px"],["overflow","hidden"],["display","grid"],["place-items","center"],["background","$linkWash"],["color","$link"]]],[".efp-sh-order__pics img",[0,1,1],[["width","100%"],["height","100%"],["object-fit","cover"]]],[".efp-sh-order__pics svg",[0,1,1],[["width","20px"],["height","20px"]]],[".efp-sh-pill",[0,1,0],[["display","inline-flex"],["align-items","center"],["gap","6px"],["min-height","26px"],["padding","0 10px"],["border-radius","999px"],["font-size","13px"],["font-weight","800"],["background","$accent3"],["color","$ink"]]],[".efp-sh-pill--done",[0,1,0],[["background","$clearBg"],["color","$clearInk"]]],[".efp-sh-pill--sub",[0,1,0],[["background","$linkWash"],["color","$link"]]],[".efp-sh-carrier",[0,1,0],[["display","grid"],["grid-template-columns","40px minmax(0, 1fr)"],["gap","4px 12px"],["align-items","center"]]],[".efp-sh-carrier__ic",[0,1,0],[["width","40px"],["height","40px"],["border-radius","11px"],["background","$linkWash"],["color","$link"],["display","grid"],["place-items","center"]]],[".efp-sh-carrier__ic svg",[0,1,1],[["width","21px"],["height","21px"]]],[".efp-sh-carrier strong",[0,1,1],[["display","block"],["font-size","16px"],["font-weight","800"]]],[".efp-sh-carrier small",[0,1,1],[["display","flex"],["flex-wrap","wrap"],["align-items","center"],["gap","2px 8px"],["margin-top","1px"],["font-family","$mono"],["font-size","13px"],["letter-spacing",".02em"],["color","$ink2"]]],[".efp-sh-carrier .efp-emb-btn",[0,2,0],[["grid-column","1 / -1"],["margin-top","10px"]]],[".efp-sh-carrier__wait",[0,1,0],[["grid-column","2"],["font-size","14.5px"],["line-height","1.4"],["color","$ink2"]]],[".efp-sh-acts",[0,1,0],[["display","grid"],["gap","4px"],["justify-items","center"],["margin-top","4px"]]],[".efp-hp-next__ic img",[0,1,1],[["width","100%"],["height","100%"],["object-fit","cover"],["border-radius","11px"]]],[".efp-co-items",[0,1,0],[["list-style","none"],["margin","0"],["padding","0"],["display","grid"],["gap","10px"]]],[".efp-co-items li",[0,1,1],[["display","grid"],["grid-template-columns","44px minmax(0, 1fr) auto"],["gap","12px"],["align-items","center"],["font-size","15px"]]],[".efp-co-items .efp-sh-order__pics",[0,2,0],[["margin","0"]]],[".efp-co-items strong",[0,1,1],[["display","block"],["font-size","15.5px"],["font-weight","800"],["line-height","1.25"]]],[".efp-co-items small",[0,1,1],[["display","block"],["font-size","13.5px"],["color","$ink3"]]],[".efp-co-items b",[0,1,1],[["font-weight","800"],["font-variant-numeric","tabular-nums"]]],[".efp-co .efp-sh-sum",[0,2,0],[["background","$paper"],["box-shadow","none"]]],[".efp-co-items .efp-sh-order__pics span",[0,2,1],[["width","44px"],["height","44px"]]],[".efp-sh .efp-co-rows",[0,2,0],[["background","$card"],["box-shadow","0 1px 3px $wash"]]],[".efp-wt-f",[0,1,0],[["display","grid"],["gap","8px"],["margin-top","14px"],["font-size","15px"],["font-weight","700"]]],[".efp-wt-f__in",[0,1,0],[["position","relative"]]],[".efp-wt-f input",[0,1,1],[["width","100%"],["height","58px"],["border","0"],["border-radius","16px"],["padding","0 56px 0 18px"],["background","$card"],["box-shadow","inset 0 0 0 1.5px $n_DAD7D1"],["font-size","24px"],["font-weight","800"],["font-variant-numeric","tabular-nums"],["outline","none"]]],[".efp-wt-f input[data-ef-focus]",[0,2,1],[["box-shadow","inset 0 0 0 2.5px $ink"]]],[".efp-wt-f__u",[0,1,0],[["position","absolute"],["right","18px"],["top","50%"],["translate","0 -50%"],["font-size","17px"],["font-weight","700"],["color","$ink3"],["pointer-events","none"]]],[".efp-wt-err",[0,1,0],[["min-height","20px"],["margin-top","6px"],["font-size","14px"],["font-weight","700"],["color","$riskInk"]]],[".efp-wt-acts",[0,1,0],[["display","grid"],["gap","8px"],["margin-top","10px"]]],[".efp-hp-ask-row strong",[0,1,1],[["text-wrap","balance"]]],[".efp-sh-order__what",[0,1,0],[["text-wrap","balance"]]],[".efp-sh-item h3",[0,1,1],[["text-wrap","balance"]]],[".efp-co-items strong",[0,1,1],[["text-wrap","balance"]]],[".efp-sh-subc strong",[0,1,1],[["text-wrap","balance"]]],[".efp-hp-ask-row small",[0,1,1],[["text-wrap","pretty"]]],[".efp-hp-tip small",[0,1,1],[["text-wrap","pretty"]]],[".efp-sh-carrier__wait",[0,1,0],[["text-wrap","pretty"]]],[".efp-sh-fine",[0,1,0],[["text-wrap","pretty"]]],[".efp-sh-sub2",[0,1,0],[["text-wrap","pretty"]]],[".efp-hp-next span",[0,1,1],[["text-wrap","pretty"]]],[".efp-hp-wait__text",[0,1,0],[["text-wrap","pretty"]]],[".efp-wt-err",[0,1,0],[["text-wrap","pretty"]]],[".efp-hp-foot-stack",[0,1,0],[["display","grid"],["gap","10px"]]],[".efp-blanks",[0,1,0],[["display","grid"],["gap","8px"],["background","$paper"],["border-radius","20px"],["padding","12px 12px 13px"]]],[".efp-blanks__h",[0,1,0],[["display","flex"],["justify-content","space-between"],["align-items","center"],["gap","10px"],["padding","0 2px 2px"],["font-size","12.5px"],["font-weight","800"],["letter-spacing",".07em"],["text-transform","uppercase"],["color","$ink3"]]],[".efp-blanks__h em",[0,1,1],[["font-style","normal"],["letter-spacing",".01em"],["text-transform","none"],["font-size","13px"],["font-weight","800"],["color","$ink"],["background","$accent"],["border-radius","999px"],["padding","2px 10px"],["white-space","nowrap"]]],['.efp-blanks[data-st="filled"] .efp-blanks__h em',[0,3,1],[["background","$clearBg"],["color","$clearInk"]]],[".efp-blanks ol",[0,1,1],[["list-style","none"],["margin","0"],["padding","0"],["display","grid"],["gap","7px"]]],[".efp-blanks li",[0,1,1],[["display","grid"],["grid-template-columns","34px minmax(0, 1fr)"],["column-gap","11px"],["align-items","center"],["background","$card"],["border-radius","15px"],["padding","9px 12px 9px 9px"]]],[".efp-blanks li > b",[0,1,2],[["grid-row","span 2"],["width","34px"],["height","40px"],["border-radius","11px"],["display","grid"],["place-items","center"],["font-family","$serif"],["font-size","22px"],["font-weight","800"]]],[".efp-blanks li > b",[0,1,2],[["background","$accentChip"]]],[".efp-blanks li > span",[0,1,2],[["font-size","16px"],["font-weight","700"],["line-height","1.35"]]],[".efp-blanks li > small",[0,1,2],[["font-size","13.5px"],["color","$ink3"]]],[".efp-blank",[0,1,0],[["display","inline-block"],["min-width","36px"],["height","20px"],["vertical-align","-3px"],["border-radius","6px"],["background","$accent4"],["box-shadow","inset 0 0 0 1.5px $accent"],["font-style","normal"]]],[".efp-blank--s",[0,1,0],[["min-width","24px"]]],[".efp-blank--l",[0,1,0],[["min-width","64px"]]],['.efp-blanks[data-st="filled"] .efp-blank',[0,3,0],[["height","auto"],["min-width","0"],["vertical-align","0"],["background","none"],["box-shadow","none"],["padding","0 3px"],["margin","0 -3px"],["border-radius","6px"]]],[".efp-hp-blanks",[0,1,0],[["margin-top","14px"]]],[".efp-hp-blanks .efp-blanks",[0,2,0],[["background","$card"],["box-shadow","0 1px 3px $wash"]]],[".efp-hp-blanks .efp-blanks li",[0,2,1],[["background","$paper"]]],[".efp-mg-orders",[0,1,0],[["justify-self","center"]]],[".efp-hp",[0,1,0],[["background","$paper"]]],[".efp-ph-toast",[0,1,0],[["top","calc(112px - 50px)"]]],[".efp-hp-jump:not(:has(> img))",[0,1,1],[["grid-template-columns","minmax(0, 1fr) auto"]]],[".efp-hp-others",[0,1,0],[["list-style","none"],["margin-bottom","0"]]],[".efp-sheet__x",[0,1,0],[["position","relative"]]],[".efp-ph-sheet",[0,2,0],[["max-height","calc(100% - 8px)"],["padding","8px 20px 14px"]],1],[".efp-sheet__grab",[0,2,0],[["display","none"]],1],[".efp-co",[0,2,0],[["gap","8px"]],1],[".efp-co-rows li",[0,2,1],[["min-height","36px"]],1],[".efp-hp-swipe",[0,2,0],[["scrollbar-width","thin"],["scrollbar-color","$n_CFCBC4 transparent"],["padding-bottom","10px"]],1]];var RAPH_PLAN_CLASSES={root:"hp",head:"hp-head",eyebrow:"hp-eyebrow",serif:"serif",by:"hp-by",byOk:"hp-by__ok",need:"hp-need",needKicker:"hp-need__k",sources:"hp-srcs",source:"hp-src","source:dna":"hp-src--dna",needRisk:"hp-need__s",dot:"dot","dot:risk":"dot--risk",odds:"hp-odds",oddsKicker:"hp-odds__k",oddsNumbers:"hp-odds__n",tag:"cp-tag cp-tag--s",says:"hp-says",saysKicker:"hp-says__k",jump:"hp-jump",jumpGo:"hp-jump__go",steps:"hp-steps",stepsHead:"hp-steps__head",n:"hp-n",list:"hp-list hp-swipe",tip:"hp-tip",tipN:"hp-tip__n",section:"hp-sec",sectionTitle:"hp-sec__h",pick:"hp-pick",others:"hp-sec hp-others",other:"hp-pick",pickTop:"hp-pick__top",pickImage:"hp-pick__img",stars:"hp-stars",pickLine:"hp-pick__line",reviews:"hp-revs hp-swipe",review:"hp-rev",reviewStars:"hp-rev__s",score:"hp-score",why:"hp-why",mini:"hp-mini",chip:"hp-chip","chip:dna":"hp-chip--dna","chip:rec":"hp-chip--rec","chip:ask":"hp-chip--ask",dose:"hp-dose",ingredients:"hp-in",opts:"hp-opts",opt:"hp-opt","opt:once":"hp-opt--once",optText:"hp-opt__t",optTag:"hp-opt__tag",price:"hp-price",optPrice:"hp-opt__p",buy:"hp-buy",button:"emb-btn emb-btn--block",proof:"hp-proof",trust:"hp-trust",on:"hp-on",onIcon:"hp-on__ic",more:"hp-more",fine:"hp-fine",sign:"hp-sign","sign:urgent":"hp-sign--er",questionsKicker:"hp-qs__k",questions:"hp-qs",add:"hp-add",extras:"hp-xs",extrasTitle:"hp-eyebrow",extra:"hp-x","extra:kit":"hp-x--kit",extraIcon:"hp-x__ic",extraTitle:"","extraTitle:kit":"serif",extraPrice:"hp-x__p",extraGo:"hp-x__go",pageFine:"plan__fine",stateOn:"is-on",scrim:"ph-scrim",sheet:"ph-sheet",sheetGrab:"sheet__grab",sheetTop:"sheet__top",sheetKicker:"sheet__kicker",sheetClose:"sheet__x",srOnly:"sr-only",co:"co",coProd:"co-prod",coProdImage:"co-prod__img",coProdTitle:"co-prod__t",coOpts:"co-opts",coOpt:"co-opt",coHit:"co-opt__hit",radio:"bk__radio",coPrice:"co-opt__p",coWhen:"co-when",coKey:"co-k",coEvery:"co-every",coRows:"co-rows",buttonLarge:"emb-btn emb-btn--block emb-btn--lg",buttonGhost:"emb-btn emb-btn--ghost emb-btn--block",coFine:"co-fine",mgCancel:"mg-cancel",started:"ph-push",startedScroll:"ph-scroll",done:"bk__done",doneCheck:"bk__check",doneTitle:"serif bk__title",doneWhen:"bk__when",doneWho:"bk__who",next:"hp-next",nextIcon:"hp-next__ic",foot:"bk__foot",toast:"ph-toast",tipTop:"hp-tip__top","tip:y":"hp-tip--y","tip:c":"hp-tip--c","tip:g":"hp-tip--g","tip:r":"hp-tip--r",tools:"hp-tools",toolsEnd:"hp-tools__end",ordersButton:"hp-orders",cartButton:"hp-cart",cartCount:"hp-cart__n",askRow:"hp-ask-row",askRowIcon:"hp-ask-row__ic",wait:"hp-wait",waitTop:"hp-wait__top",waitTile:"emb-tile emb-tile--cyan",waitKey:"hp-wait__k",waitText:"hp-wait__text","next:in":"hp-next--in",track:"sh-track","track:kit":"sh-track--kit",trackDot:"sh-track__dot",shopTag:"cp-tag",trackStep:"","trackStep:done":"is-done","trackStep:now":"is-now",push:"ph-push",sheetBody:"sheet__body",shop:"sh",shopTitle:"serif sh-title",shopSub:"sh-sub2",shopKey:"sh-k",shopCard:"sh-card","shopCard:carrier":"sh-carrier",shopItems:"sh-items",shopItem:"sh-item",shopItemImage:"sh-item__img",shopItemPrice:"sh-item__p",shopItemActions:"sh-item__acts",stepper:"sh-step",shopRemove:"sh-rm",shopMode:"sh-mode",summary:"sh-sum",summaryRow:"","summaryRow:total":"is-total","summaryRow:renew":"is-renew",shopFine:"sh-fine","shopFine:center":"sh-fine--c",shopEmpty:"sh-empty",shopTile:"emb-tile emb-tile--cyan",shopLink:"sh-link",shopActions:"sh-acts",subCard:"sh-subc",orderList:"sh-orders",order:"sh-order",orderTop:"sh-order__top",orderPill:"sh-pill","orderPill:done":"sh-pill--done","orderPill:sub":"sh-pill--sub",orderNo:"sh-order__no",orderWhat:"sh-order__what",orderMeta:"sh-order__meta",orderPics:"sh-order__pics",carrierIcon:"sh-carrier__ic",carrierWait:"sh-carrier__wait",buttonSmall:"emb-btn emb-btn--ghost emb-btn--sm",coItems:"co-items","foot:shop":"sh-foot","foot:stack":"hp-foot-stack",weightField:"wt-f",weightInput:"wt-f__in",weightUnit:"wt-f__u",weightError:"wt-err",weightActions:"wt-acts",blanks:"hp-blanks",blanksCard:"blanks",blanksHead:"blanks__h",blank:"blank","blank:s":"blank--s","blank:l":"blank--l",noPick:"",mgOrders:"sh-link mg-orders"},prefix=classes=>classes.split(/\s+/).filter(c=>c!=="").map(c=>`${PLAN_CLASS_PREFIX}${c}`).join(" ");/* @__PURE__ */Object.freeze(Object.fromEntries(Object.entries(RAPH_PLAN_CLASSES).map(([part,classes])=>[part,prefix(classes)])));var PLAN_BEFORE_CLASS=`${PLAN_CLASS_PREFIX}before`,RAPH_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 planTokens(theme){let c=theme.color,v=v3Palette(theme),neutral={ink:v.ink,ink2:v.ink2,ink3:v.ink3,paper:v.paper,tile:v.tile,line:v.line,card:v.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}:RAPH_PLAN_LIGHT},link=v.link,card=neutral.card;return{...neutral,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),sans:faceCss(theme,"regular").fontFamily,serif:headingFaceCss(theme,"bold").fontFamily,mono:cssMonoFamily(theme.type.mono)}}[...[".ph-push",".ph-push.is-on",".ph-sheet",".ph-sheet.is-on"].map(selector=>[selector,selector.split(".").length-1,[["transform","none"],["transition","opacity 160ms ease, visibility 0s linear 160ms"],["opacity","0"]]]),...[".ph-push.is-on",".ph-sheet.is-on"].map(selector=>[selector,2,[["opacity","1"],["transition","opacity 160ms ease, visibility 0s"]]]),[".ph-toast",1,[["transform","none",1]]]];var SHOP_V3_ROOT="efp-v3",SCOPE=`.${SHOP_V3_ROOT}`,WIDE="(min-width: 900px)",COLUMN=560;function fill(value,tokens,dark){return value.replace(/\$(n_[0-9A-F]{6}|[a-zA-Z0-9]+)/g,(whole,key)=>key.startsWith("n_")?dark?tokens.line??whole:`#${key.slice(2)}`:tokens[key]??whole)}function selectors(list){let out=[],depth=0,start=0;for(let i=0;i<list.length;i+=1){let ch=list[i];ch==="("?depth+=1:ch===")"?depth-=1:ch===","&&depth===0&&(out.push(list.slice(start,i).trim()),start=i+1)}return out.push(list.slice(start).trim()),out.filter(s=>s!=="")}var scoped=list=>selectors(list).map(s=>`${SCOPE} ${s}`).join(",");function block(decls,tokens,dark){return decls.map(d=>`${d[0]}:${fill(d[1],tokens,dark)}${d[2]===1?" !important":""}`).join(";")}var cache2=/* @__PURE__ */new WeakMap;function shopV3Css(theme){let hit=cache2.get(theme);if(hit!==void 0)return hit;let dark=theme.brightness==="dark",tokens={...planTokens(theme),sans:"var(--font)",serif:"var(--font)",mono:"var(--font-mono)"},t=v=>fill(v,tokens,dark),base=[],wide=[];for(let[selector,,decls,isWide]of PLAN_RULES)(isWide===1?wide:base).push(`${scoped(selector)}{${block(decls,tokens,dark)}}`);let side=`max(0px, calc(50% - ${COLUMN/2}px))`,frame=[`${SCOPE}{${block(PLAN_CONTEXT,tokens,dark)};background:${t("$paper")};min-height:100%;-webkit-font-smoothing:antialiased}`,`${SCOPE} .efp-v3-col{max-width:${COLUMN}px;margin:0 auto;min-height:100%;display:flex;flex-direction:column}`,`${SCOPE} .efp-v3-main{flex:1;min-width:0}`,`${SCOPE} .efp-v3-head{position:sticky;top:0;z-index:5;height:58px;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;padding:0 14px;background:${t("$paper")}}`,`${SCOPE} .efp-v3-back{width:44px;height:44px;display:grid;place-items:center;margin-left:-6px;border-radius:999px;color:${t("$ink")};text-decoration:none}`,`${SCOPE} .efp-v3-back svg{width:26px;height:26px}`,`${SCOPE} .efp-v3-title{grid-column:2;font-size:17px;font-weight:800;white-space:nowrap;margin:0;color:${t("$ink")}}`,`${SCOPE} .efp-v3-end{grid-column:3;justify-self:end;display:flex;align-items:center}`,`${SCOPE} .efp-bk__foot{position:sticky;bottom:0;z-index:4}`,`${SCOPE} .efp-ph-scrim{position:fixed}`,`${SCOPE} .efp-ph-sheet{position:fixed;left:${side};right:${side};max-height:88vh}`,`${SCOPE} .efp-ph-sheet:focus{outline:none}`,`${SCOPE} .efp-v3-sheet-top{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:44px}`,`${SCOPE} .efp-v3-x{width:44px;height:44px;display:grid;place-items:center;margin-right:-10px;border-radius:999px;color:${t("$ink")}}`,`${SCOPE} .efp-v3-x svg{width:22px;height:22px}`,`${SCOPE} .efp-sh-item h3,${SCOPE} .efp-co-items strong,${SCOPE} .efp-sh-order__what,${SCOPE} .efp-hp-next span span{overflow-wrap:anywhere}`,`${SCOPE} .efp-sh{grid-template-columns:minmax(0, 1fr)}`,`${SCOPE} .efp-sh-title,${SCOPE} .efp-sh-sub2,${SCOPE} .efp-v3-title,${SCOPE} .efp-bk__title,${SCOPE} .efp-bk__who,${SCOPE} .efp-v3-err{overflow-wrap:anywhere}`,`${SCOPE} .efp-sh-order__top{flex-wrap:wrap;min-width:0}`,`${SCOPE} .efp-sh-order > span{min-width:0}`,`${SCOPE} .efp-sh-pill{max-width:100%;padding-top:3px;padding-bottom:3px;line-height:1.3}`,`${SCOPE} .efp-v3-pill--risk{background:${t("$riskBg")};color:${t("$riskInk")}}`,`${SCOPE} .efp-v3-pill--quiet{background:${t("$paper")};color:${t("$ink2")};box-shadow:inset 0 0 0 1px ${t("$line")}}`,`${SCOPE} a.efp-sh-order,${SCOPE} a.efp-emb-btn,${SCOPE} a.efp-sh-link{text-decoration-line:none;color:inherit}`,`${SCOPE} a.efp-emb-btn{color:${t("$onPrimary")}}`,`${SCOPE} a.efp-emb-btn--ghost{color:${t("$ink")}}`,`${SCOPE} a.efp-sh-link{display:inline-flex;align-items:center;color:${t("$link")};text-decoration-line:underline}`,`${SCOPE} .efp-emb-btn[disabled]{opacity:.45;cursor:default}`,`${SCOPE} .efp-co-rows li.efp-v3-row{grid-template-columns:20px 4.6rem minmax(0, 1fr) auto}`,`${SCOPE} .efp-co-rows b{min-width:0;overflow-wrap:anywhere}`,`${SCOPE} .efp-v3-risk{color:${t("$riskInk")}}`,`${SCOPE} .efp-v3-change{display:inline-flex;align-items:center;min-height:40px;font-size:14px;font-weight:800;color:${t("$link")};text-decoration:none;white-space:nowrap}`,`${SCOPE} .efp-v3-err{margin:0;font-size:15px;line-height:1.45;color:${t("$riskInk")}}`,`${SCOPE} .efp-v3-note{margin:0;font-size:15px;line-height:1.45;color:${t("$ink2")}}`,`${SCOPE} .efp-v3-toast{position:fixed;left:50%;bottom:110px;z-index:50;transform:translateX(-50%);max-width:min(92vw,520px);padding:12px 18px;border-radius:999px;background:${t("$ink")};color:${t("$card")};font-size:15px;font-weight:700;box-shadow:0 6px 24px ${t("$wash")}}`,`${SCOPE} .efp-v3-ghost{display:grid;gap:12px}`,`${SCOPE} .efp-v3-ghost span{display:block;height:84px;border-radius:22px;background:${t("$tile")}}`,`${SCOPE} .efp-v3-name{display:grid;gap:10px}`,`${SCOPE} .efp-v3-name label{display:grid;gap:4px;font-size:14px;font-weight:700}`,`${SCOPE} .efp-v3-name input{min-height:48px;padding:0 14px;border-radius:12px;border:1.5px solid ${t("$line")};background:${t("$card")};font-size:16px}`,`@media (prefers-reduced-motion: reduce){${SCOPE} *{transition-duration:0.01ms !important;animation-duration:0.01ms !important}}`,".efp-care-tabs{display:flex;align-items:center;gap:8px;min-width:0}",".efp-care-tabs > :first-child{flex:1;min-width:0}",".efp-care-cart{position:relative;flex:none;width:44px;height:44px;display:grid;place-items:center;border-radius:999px;color:var(--ink);text-decoration:none}",".efp-care-cart .ico{width:24px;height:24px}",".efp-care-cart__n{position:absolute;top:2px;right:0;min-width:18px;height:18px;padding:0 5px;border-radius:999px;background:var(--ink);color:var(--ef-white);font-size:11px;font-weight:700;line-height:18px;text-align:center;font-variant-numeric:tabular-nums}",".page--care .efp-care-tabs,.page--care-shop .efp-care-tabs,.page--care-plan .efp-care-tabs,.page--care-orders .efp-care-tabs{margin-top:var(--sp-4)}",".efp-care-tabs .tabs{margin-top:0 !important}",`${SCOPE} .efp-care-tabs{padding:0 18px}`,`${SCOPE} .efp-care-tabs .scroller__btn{border:1px solid var(--line);background:var(--ef-white)}`,".prods > li,.prod,.prod__body{min-width:0}",".prod{grid-template-columns:minmax(0, 1fr)}",".prod__name,.prod__meta,.page-title,.items__name,.person__name,.choice__title{overflow-wrap:anywhere}",".back{position:relative}",'.back::before{content:"";position:absolute;inset:-12px -8px}',".btn:disabled{opacity:.45;cursor:default}",".btn:disabled:active{transform:none}",'.input:has([aria-invalid="true"]){border-color:var(--alert-deep)}'],css=[...base,...frame,wide.length>0?`@media ${WIDE}{${wide.join("")}}`:""].join(`\n`);return cache2.set(theme,css),css}var sheet=null;function constructable(css){try{if(typeof CSSStyleSheet!="function"||typeof CSSStyleSheet.prototype.replaceSync!="function")return null;let s=new CSSStyleSheet;return s.replaceSync(css),s}catch{return null}}function kitSheet(){return sheet||(sheet=constructable(SHOP_KIT_CSS)),sheet}var v3Sheets=/* @__PURE__ */new WeakMap;function v3Sheet(theme){return v3Sheets.has(theme)||v3Sheets.set(theme,constructable(shopV3Css(theme))),v3Sheets.get(theme)??null}function styleTag(root,attr,css){let style=root.querySelector(`style[${attr}]`);style||(style=document.createElement("style"),style.setAttribute(attr,""),root.insertBefore(style,root.querySelector("div[data-everfur-shop-root]"))),style.textContent!==css&&(style.textContent=css)}function ShopRoot({pageClass:pageClass,children:children,hostClassName:hostClassName}){let host=useRef(null),[mount,setMount]=useState(null),theme=useEverfurTheme();return useLayoutEffect(()=>{let el=host.current;if(!el)return;let root=el.shadowRoot??el.attachShadow({mode:"open"}),kit=kitSheet(),v3=v3Sheet(theme);kit&&v3&&"adoptedStyleSheets"in root?root.adoptedStyleSheets=[kit,v3]:(styleTag(root,"data-everfur-shop",SHOP_KIT_CSS),styleTag(root,"data-everfur-shop-v3",shopV3Css(theme)))},[theme]),useLayoutEffect(()=>{let el=host.current;if(!el)return;let root=el.shadowRoot??el.attachShadow({mode:"open"}),div=root.querySelector("div[data-everfur-shop-root]");div||(div=document.createElement("div"),div.setAttribute("data-everfur-shop-root",""),root.appendChild(div)),setMount(div)},[]),/* @__PURE__ */jsx("div",{ref:host,className:hostClassName,"data-everfur-shop":"",children:mount?createPortal(/* @__PURE__ */jsx("div",{className:pageClass,children:children}),mount):null})}function useCartCheckout(items,go,cardHandoff=null){let{client:client,copy:copy,v3:v3,payments:payments}=useShop(),addresses=useAddresses(),cards=usePaymentMethods(),[open,setOpen]=useState(false),[pane,setPane]=useState("main"),[addressRef,setAddressRef]=useState(()=>peekAddedAddress(client));useEffect(()=>dropAddedAddress(client),[client]);let[cardId,setCardId]=useState(null),[error,setError]=useState(null),usable=(addresses.value??[]).filter(a=>a.isComplete),address=usable.find(a=>a.ref===addressRef)??usable.find(a=>a.isDefault)??usable[0]??null,cardList=cards.value??[],card=cardList.find(c=>c.paymentMethodId===cardId)??cardList[0]??null,lines=useMemo(()=>cartLines(items),[items]),linesKey=JSON.stringify(lines),quote2=useShopRead(address&&lines.length>0?`cart-quote:${address.ref}:${linesKey}`:null,()=>client.quote({lines:lines,shipTo:address.ref})),[shown,setShown]=useState(null),draftKey=`${address?.ref??""}:${linesKey}`,shownTotal=shown&&shown.key===draftKey?shown.total:null,placeRef=useRef(()=>{}),nameStep=useNameStep(()=>placeRef.current()),placedKeys=items.map(i=>i.key),placeAction=useShopAction(async keys=>{let draft=await client.createCheckout({idempotencyKey:keys.key("draft"),lines:lines,shipTo:address.ref});if(!draft.ok)return omsErr(draft.error);if((shownTotal??quote2.value?.total??null)!==draft.value.total)return setShown({key:draftKey,total:draft.value.total}),omsErr({kind:"refused",status:409,reasonCode:"price_changed",message:null});let out=await confirmWithPayerActions(idempotencyKey=>client.confirmCheckout(draft.value.checkoutId,{idempotencyKey:idempotencyKey,expectedTotal:draft.value.total,paymentMethodId:card.paymentMethodId}),keys,payments,{reconfirm:true,beforePayerAction:()=>removePlaced(client,placedKeys)});return out.kind==="failed"?omsErr(out.error):omsOk(out)}),place=()=>{!address||!card||!quote2.value||placeAction.busy||(setError(null),nameStep.clear(),placeAction.run().then(res=>{if(!res)return;let out=res.ok?res.value:{kind:"failed",error:res.error};if(out.kind==="failed"){if(nameStep.raise(out.error))return;setError(outcomeLine(copy,out));return}if(out.orderIds.length===0){setError(copy.actionFailed);return}if(removePlaced(client,placedKeys),setOpen(false),setPane("main"),out.kind==="confirmed"){go({name:"placed",orderIds:out.orderIds});return}leaveOrderNotice(client,out.orderIds[0],outcomeLine(copy,out)),go({name:"order",orderId:out.orderIds[0]})}))};placeRef.current=place;let[cardBusy,setCardBusy]=useState(false),before=useRef(null);useEffect(()=>{if(!before.current||cards.phase!=="ready"||!cards.value)return;let added=cards.value.find(c=>!before.current.has(c.paymentMethodId));before.current=null,added&&setCardId(added.paymentMethodId)},[cards.phase,cards.value]);let addCard=cardHandoff?{busy:cardBusy,run:()=>{if(cardBusy)return;setCardBusy(true),setError(null);let ids=new Set(cardList.map(c=>c.paymentMethodId));cardHandoff().then(step2=>{setCardBusy(false),step2.ok?(before.current=ids,setPane("main"),cards.refresh()):setError(step2.closed?copy.cardStepClosed:step2.message??copy.cardStepFailed)},()=>{setCardBusy(false),setError(copy.cardStepFailed)})}}:null,save=useShopAction((_keys,input)=>client.addAddress(input)),saveAddress={busy:save.busy,error:save.error?refusalLine(copy,save.error):null,run:input=>{save.run(input).then(res=>{res&&res.ok&&(setAddressRef(res.value.ref),setPane("main"),addresses.refresh())})}},sub=cartSubtotal(items),q=quote2.value,totalCents=shownTotal??q?.total??null,sum=[];sub!==null&&sum.push({k:v3.subtotal,v:formatCents(sub)}),q&&totalCents!==null&&(sum.push({k:v3.shipping,v:q.shipping===0?v3.free:formatCents(q.shipping)}),sum.push({k:v3.tax,v:formatCents(q.tax)}),sum.push({k:v3.total,v:formatCents(totalCents),total:true}));let rx=items.some(i=>i.requiresRx),fineParts=[card?copy.chargedWhenShips(cardLabel(card.brand,card.last4)):null,rx?copy.rxCheckedFirst:null].filter(x=>!!x);return{open:open,pane:pane,setPane:setPane,openSheet:()=>{setError(null),setPane("main"),setOpen(true)},closeSheet:()=>{placeAction.busy||(setOpen(false),setPane("main"))},addresses:[...usable].sort((a,b)=>Number(b.isDefault)-Number(a.isDefault)),addressesLoading:addresses.phase==="loading",address:address,chooseAddress:ref=>{setAddressRef(ref),setPane("main")},cards:cardList,cardsLoading:cards.phase==="loading",card:card,chooseCard:id=>{setCardId(id),setPane("main")},addCard:addCard,saveAddress:saveAddress,sum:sum,subtotal:sub!==null?formatCents(sub):null,total:totalCents!==null?formatCents(totalCents):null,canPlace:!!address&&!!card&&!!q&&items.length>0&&!placeAction.busy,placing:placeAction.busy,place:place,error:nameStep.view!==null?null:error??quoteLine(copy,quote2),nameStep:nameStep.view,fine:fineParts.length>0?fineParts.join(" "):null}}var PATHS={check:"M5 12.5l4.5 4.5L19 7.5",truck:"M3 6h11v10H3z M14 10h4l3 3v3h-7 M7 19a2 2 0 100-4 2 2 0 000 4z M17 19a2 2 0 100-4 2 2 0 000 4z",card:"M3 6h18v12H3z M3 10h18",alert:"M12 4l9 16H3z M12 10v4 M12 17h.01",x:"M6 6l12 12 M18 6L6 18",calendar:"M4 6h16v14H4z M4 10h16 M8 3v4 M16 3v4",box:"M3 7l9-4 9 4v10l-9 4-9-4z M3 7l9 4 9-4 M12 11v10",cart:"M3 4h2l2.4 11h10.2L20 8H6.2 M9 20a1 1 0 100-2 1 1 0 000 2z M17 20a1 1 0 100-2 1 1 0 000 2z",minus:"M5 12h14",plus:"M12 5v14 M5 12h14",chev:"M9 6l6 6-6 6",back:"M15 6l-6 6 6 6"};function V3Icon({name:name}){/* @__PURE__ */
|
|
258
258
|
return jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:/* @__PURE__ */jsx("path",{d:PATHS[name]})})}function V3Head({title:title,back:back,backLabel:backLabel,end:end}){/* @__PURE__ */
|
|
259
259
|
return jsxs("header",{className:"efp-v3-head",children:[back?/* @__PURE__ */jsxs(ShopLink,{to:back,className:"efp-v3-back",children:[
|
|
260
260
|
/* @__PURE__ */jsx(V3Icon,{name:"back"}),
|
|
@@ -290,7 +290,7 @@ return jsxs("div",{className:"efp-v3-name",role:"group","aria-labelledby":`${id}
|
|
|
290
290
|
/* @__PURE__ */jsx(V3Error,{line:form.error})]}):null,step2.handoff?/* @__PURE__ */jsx("button",{type:"button",className:"efp-emb-btn efp-emb-btn--ghost efp-emb-btn--block",onClick:step2.handoff.onPress,children:step2.handoff.label}):null]})}function CartPage(){let{client:client,copy:copy,v3:v3}=useShop(),nav=useShopNav(),items=useCart(client),co=useCartCheckout(items,nav.go),[toast,setToast]=useState(()=>{let line=takeCartFlash(client);return line?{line:line,id:0}:null}),say=line=>setToast(t=>({line:line,id:(t?.id??0)+1})),bar=co.subtotal??co.total;/* @__PURE__ */
|
|
291
291
|
return jsxs("div",{className:"efp-v3-col","data-everfur-shop-page":"cart",children:[
|
|
292
292
|
/* @__PURE__ */jsx(V3Head,{title:v3.cartTitle,back:{name:"shop"},backLabel:copy.backToShop}),
|
|
293
|
-
/* @__PURE__ */jsx("
|
|
293
|
+
/* @__PURE__ */jsx("div",{className:"efp-v3-main",children:/* @__PURE__ */jsx("div",{className:"efp-sh",children:items.length===0?/* @__PURE__ */jsxs("div",{className:"efp-sh-empty",children:[
|
|
294
294
|
/* @__PURE__ */jsx("span",{className:"efp-emb-tile efp-emb-tile--cyan",children:/* @__PURE__ */jsx(V3Icon,{name:"cart"})}),
|
|
295
295
|
/* @__PURE__ */jsx("h2",{className:"efp-serif",children:v3.cartEmptyTitle}),v3.cartEmptyBody?/* @__PURE__ */jsx("p",{children:v3.cartEmptyBody}):null,
|
|
296
296
|
/* @__PURE__ */jsx(ShopLink,{to:{name:"shop"},className:"efp-emb-btn",children:copy.tabShop})]}):/* @__PURE__ */jsxs(Fragment,{children:[
|
|
@@ -342,13 +342,13 @@ return jsx("li",{className:on?"efp-co-opt efp-is-on":"efp-co-opt",children:/* @_
|
|
|
342
342
|
/* @__PURE__ */jsx("span",{className:"efp-bk__radio","aria-hidden":"true"}),
|
|
343
343
|
/* @__PURE__ */jsx("strong",{children:cardLabel(c.brand,c.last4)})]})},c.paymentMethodId)})}),
|
|
344
344
|
/* @__PURE__ */jsx(ShopLink,{to:{name:"card",then:{name:"cart"}},className:"efp-emb-btn efp-emb-btn--ghost efp-emb-btn--block",children:v3.addCard}),
|
|
345
|
-
/* @__PURE__ */jsx(V3Error,{line:co.error})]})}var STEP_KEYS=["ordered","shipped","out_for_delivery","delivered"];function paymentFailed(order){return order.paymentStatus==="failed"||order.canPay&&order.paymentStatus==="requires_action"}function statusPill(status,copy,v3,failed=false){if(failed)return{label:copy.paymentFailed,tone:"risk"};let label=copy.orderStatus[status]??v3.orderSteps[0];return status==="delivered"?{label:label,tone:"done"}:status==="cancelled"||status==="rejected"?{label:label,tone:"quiet"}:status==="needs_support"?{label:label,tone:"risk"}:{label:label,tone:"wait"}}function latestTracking(order){if(order.tracking)return order.tracking;let best=null;for(let sh of order.shipments)for(let ev of sh.tracking)(!best||(ev.occurredAt??"")>(best.occurredAt??""))&&(best=ev);return best}function arrivesByOf(order){return order.arrivesBy??latestTracking(order)?.deliveryBy??null}function deliveredAt(order){let step2=order.steps?.find(s=>s.key==="delivered");if(step2?.at)return step2.at;for(let sh of order.shipments){let ev=sh.tracking.find(t=>t.status==="delivered");if(ev?.occurredAt)return ev.occurredAt}return null}function orderEnded(status){return status==="cancelled"||status==="rejected"||status==="needs_support"}function orderHeadline(order,copy,v3){let status=order.summary.status;return paymentFailed(order)?copy.paymentFailed:status==="delivered"?v3.orderSteps[3]:orderEnded(status)?copy.orderStatus[status]??v3.orderSteps[0]:status==="shipped"?v3.orderSteps[1]:v3.orderSteps[0]}function orderSubline(order,copy,v3){let status=order.summary.status;if(orderEnded(status))return null;if(status==="delivered"){let day=formatDay(deliveredAt(order),{when:true});return day?v3.deliveredOn(day):null}let by=formatDay(arrivesByOf(order),{weekday:true});return
|
|
345
|
+
/* @__PURE__ */jsx(V3Error,{line:co.error})]})}var SHOP_FOREGROUND_COOLDOWN_MS=2e3;function useRereadOnForeground(signal,reread,enabled=true){let latest=useRef({reread:reread,enabled:enabled});latest.current={reread:reread,enabled:enabled},useEffect(()=>{let last=Number.NEGATIVE_INFINITY;return signal(()=>{if(!latest.current.enabled)return;let now=Date.now();now-last<SHOP_FOREGROUND_COOLDOWN_MS||(last=now,latest.current.reread())})},[signal])}var STEP_KEYS=["ordered","shipped","out_for_delivery","delivered"];function paymentFailed(order){return order.paymentStatus==="failed"||order.canPay&&order.paymentStatus==="requires_action"}function paymentHeld(order){return order.paymentStatus==="authorized"||order.paymentStatus==="captured"}function statusPill(status,copy,v3,failed=false){if(failed)return{label:copy.paymentFailed,tone:"risk"};let label=copy.orderStatus[status]??v3.orderSteps[0];return status==="delivered"?{label:label,tone:"done"}:status==="cancelled"||status==="rejected"?{label:label,tone:"quiet"}:status==="needs_support"?{label:label,tone:"risk"}:{label:label,tone:"wait"}}function latestTracking(order){if(order.tracking)return order.tracking;let best=null;for(let sh of order.shipments)for(let ev of sh.tracking)(!best||(ev.occurredAt??"")>(best.occurredAt??""))&&(best=ev);return best}function arrivesByOf(order){return order.arrivesBy??latestTracking(order)?.deliveryBy??null}function deliveredAt(order){let step2=order.steps?.find(s=>s.key==="delivered");if(step2?.at)return step2.at;for(let sh of order.shipments){let ev=sh.tracking.find(t=>t.status==="delivered");if(ev?.occurredAt)return ev.occurredAt}return null}function orderEnded(status){return status==="cancelled"||status==="rejected"||status==="needs_support"}function orderHeadline(order,copy,v3){let status=order.summary.status;return paymentFailed(order)?copy.paymentFailed:status==="delivered"?v3.orderSteps[3]:orderEnded(status)?copy.orderStatus[status]??v3.orderSteps[0]:status==="shipped"?v3.orderSteps[1]:v3.orderSteps[0]}function orderSubline(order,copy,v3){let status=order.summary.status;if(orderEnded(status)||paymentFailed(order))return null;if(status==="delivered"){let day=formatDay(deliveredAt(order),{when:true});return day?v3.deliveredOn(day):null}let by=formatDay(arrivesByOf(order),{weekday:true});if(by)return v3.arrivesBy(by);let line=copy.orderStatus[status]??null;return line===orderHeadline(order,copy,v3)?null:line}function offersBuyAgain(status){return status==="delivered"||orderEnded(status)}function trackSteps(order,v3){let status=order.summary.status;if(status==="cancelled"||status==="rejected")return null;let sent=order.steps&&order.steps.length>0?order.steps:null,tracking=latestTracking(order),shippedAt=order.shipments.flatMap(sh=>sh.tracking).map(t=>t.occurredAt).filter(d=>!!d).sort()[0]??null,derived={ordered:{done:true,at:order.summary.placedAt},shipped:{done:status==="shipped"||status==="delivered"||!!tracking,at:shippedAt},out_for_delivery:{done:status==="delivered",at:null},delivered:{done:status==="delivered",at:deliveredAt(order)}},by=formatDay(arrivesByOf(order),{weekday:true}),steps=STEP_KEYS.map((key,i)=>{let s=sent?.find(x=>x.key===key),done=s?s.done:derived[key].done,at=s?s.at:derived[key].at,line=done?formatDay(at,{when:true}):key==="delivered"&&by?v3.expected(by):null;return{key:key,title:v3.orderSteps[i],line:line,done:done}}),nowAt=steps.reduce((at,s,i)=>s.done?i:at,-1);return steps.map(({done:done,...s},i)=>({...s,state:done?i===nowAt&&i<steps.length-1?"now":"done":"next"}))}function itemNames(items){return items.map(i=>i.title).join(", ")}function orderMeta(summary,copy,total=formatCents(summary.total)){let day=formatDay(summary.placedAt);return day?`${copy.placed(day)} · ${total}`:total}var tabVisible=listener=>{if(typeof document>"u"||typeof document.addEventListener!="function")return()=>{};let onChange=()=>{document.visibilityState==="visible"&&listener()};return document.addEventListener("visibilitychange",onChange),()=>document.removeEventListener("visibilitychange",onChange)};function OrderPage({orderId:orderId,onOrderHelp:onOrderHelp}){let{client:client,copy:copy,v3:v3,payments:payments,petName:petName}=useShop(),nav=useShopNav(),order=useOrder(orderId);useRereadOnForeground(tabVisible,order.reread);let cards=usePaymentMethods(),[line,setLine]=useState(()=>peekOrderNotice(client,orderId));useEffect(()=>dropOrderNotice(client,orderId),[client,orderId]);let[asking,setAsking]=useState(false),cancel=useShopAction(keys=>client.cancelOrder(orderId,{idempotencyKey:keys.key("cancel"),reasonCode:"customer_request"})),pay=useShopAction(async keys=>{let key=keys.key("pay");for(let round=0;round<3;round+=1){let res=await client.payOrder(orderId,{idempotencyKey:key});if(!res.ok)return omsErr(res.error);if(res.value.outcome==="authorized")return omsOk({kind:"confirmed",orderIds:[orderId]});if(!payments||!res.value.payerAction)return omsOk({kind:"needsPayerAction",orderIds:[orderId]});let step2=await payments.handleNextAction(res.value.payerAction,{orderId:orderId});if(!step2.ok)return omsOk(step2.closed?{kind:"payerActionClosed",orderIds:[orderId]}:{kind:"payerActionFailed",orderIds:[orderId],message:step2.message});key=keys.next("pay")}return omsOk({kind:"needsPayerAction",orderIds:[orderId]})}),o=order.phase==="ready"?order.value:null,ref=o?.summary.referenceNumber??null,head=/* @__PURE__ */jsx(V3Head,{title:v3.orderTitle(ref),back:{name:"orders"},backLabel:copy.allOrders});if(!o)/* @__PURE__ */
|
|
346
346
|
return jsxs("div",{className:"efp-v3-col","data-everfur-shop-page":"order",children:[head,
|
|
347
|
-
/* @__PURE__ */jsx("
|
|
347
|
+
/* @__PURE__ */jsx("div",{className:"efp-v3-main",children:/* @__PURE__ */jsx("div",{className:"efp-sh",children:order.phase==="loading"?/* @__PURE__ */jsx(V3Ghosts,{}):/* @__PURE__ */jsxs(Fragment,{children:[
|
|
348
348
|
/* @__PURE__ */jsx(V3Error,{line:copy.loadFailed(copy.thingOrder)}),
|
|
349
|
-
/* @__PURE__ */jsx("div",{className:"efp-sh-acts",children:/* @__PURE__ */jsx("button",{type:"button",className:"efp-emb-btn efp-emb-btn--ghost efp-emb-btn--sm",onClick:order.refresh,children:copy.tryAgain})})]})})})]});let steps=trackSteps(o,v3),tracking=latestTracking(o),carrier=tracking?.carrier??null,subtotal=o.subtotal??o.lines.reduce((n,l)=>n+l.unitPrice*l.quantity,0),discount=o.discount??o.lines.reduce((n,l)=>n+l.discount,0),tax=o.tax??o.lines.reduce((n,l)=>n+l.tax,0)+o.shippingTax,refunded=o.refunds.reduce((n,r)=>n+r.amount,0),sum=[{k:v3.subtotal,v:formatCents(subtotal)},...discount>0?[{k:v3.discount,v:formatCents(-discount)}]:[],{k:v3.shipping,v:o.shipping===0?v3.free:formatCents(o.shipping)},{k:v3.tax,v:formatCents(tax)},{k:v3.total,v:formatCents(o.summary.total),total:true},...refunded>0?[{k:v3.refund,v:formatCents(refunded)}]:[]],paidCard=o.paymentMethodId?(cards.value??[]).find(c=>c.paymentMethodId===o.paymentMethodId):void 0,sub=orderSubline(o,copy,v3),busy=pay.busy||cancel.busy,plain=o.lines.filter(l=>!l.requiresRx),rxLine=o.lines.find(l=>l.requiresRx)??null,buyAgain=plain.length>0?()=>{for(let l of plain)addToCart(client,{offerId:l.offerId,title:l.title,unitPrice:l.unitPrice,requiresRx:false,quantity:l.quantity,...l.petId?{petId:l.petId}:{}});nav.go({name:"cart"})}:rxLine?()=>nav.go({name:"product",offerId:rxLine.offerId,...rxLine.petId?{petId:rxLine.petId}:{}}):null,onPay=()=>{setLine(null),pay.run().then(res=>{res&&(setLine(res.ok?outcomeLine(copy,res.value):refusalLine(copy,res.error)),order.refresh())})},onCancel=()=>{cancel.run().then(res=>{if(!res)return;if(setAsking(false),!res.ok){setLine(refusalLine(copy,res.error));return}cancel.reset();let out=res.value.outcome;setLine(out==="requested"?v3.cancelRequested:out==="not_cancellable"?copy.refusal.operation_not_supported??copy.actionFailed:null),order.refresh()})};/* @__PURE__ */
|
|
349
|
+
/* @__PURE__ */jsx("div",{className:"efp-sh-acts",children:/* @__PURE__ */jsx("button",{type:"button",className:"efp-emb-btn efp-emb-btn--ghost efp-emb-btn--sm",onClick:order.refresh,children:copy.tryAgain})})]})})})]});let steps=trackSteps(o,v3),tracking=latestTracking(o),carrier=tracking?.carrier??null,subtotal=o.subtotal??o.lines.reduce((n,l)=>n+l.unitPrice*l.quantity,0),discount=o.discount??o.lines.reduce((n,l)=>n+l.discount,0),tax=o.tax??o.lines.reduce((n,l)=>n+l.tax,0)+o.shippingTax,refunded=o.refunds.reduce((n,r)=>r.state==="succeeded"?n+r.amount:n,0),sum=[{k:v3.subtotal,v:formatCents(subtotal)},...discount>0?[{k:v3.discount,v:formatCents(-discount)}]:[],{k:v3.shipping,v:o.shipping===0?v3.free:formatCents(o.shipping)},{k:v3.tax,v:formatCents(tax)},{k:v3.total,v:formatCents(o.summary.total),total:true},...refunded>0?[{k:v3.refund,v:formatCents(refunded)}]:[]],paidCard=o.paymentMethodId&&paymentHeld(o)?(cards.value??[]).find(c=>c.paymentMethodId===o.paymentMethodId):void 0,sub=orderSubline(o,copy,v3),busy=pay.busy||cancel.busy,plain=o.lines.filter(l=>!l.requiresRx),rxLine=o.lines.find(l=>l.requiresRx)??null,buyAgain=offersBuyAgain(o.summary.status)?plain.length>0?()=>{for(let l of plain)addToCart(client,{offerId:l.offerId,title:l.title,unitPrice:l.unitPrice,requiresRx:false,quantity:l.quantity,...l.petId?{petId:l.petId}:{}});nav.go({name:"cart"})}:rxLine?()=>nav.go({name:"product",offerId:rxLine.offerId,...rxLine.petId?{petId:rxLine.petId}:{}}):null:null,onPay=()=>{setLine(null),pay.run().then(res=>{res&&(setLine(res.ok?outcomeLine(copy,res.value):refusalLine(copy,res.error)),order.refresh())})},onCancel=()=>{cancel.run().then(res=>{if(!res)return;if(setAsking(false),!res.ok){setLine(refusalLine(copy,res.error)),order.reread();return}cancel.reset();let out=res.value.outcome;setLine(out==="requested"?v3.cancelRequested:out==="not_cancellable"?copy.refusal.operation_not_supported??copy.actionFailed:null),order.refresh()})};/* @__PURE__ */
|
|
350
350
|
return jsxs("div",{className:"efp-v3-col","data-everfur-shop-page":"order",children:[head,
|
|
351
|
-
/* @__PURE__ */jsx("
|
|
351
|
+
/* @__PURE__ */jsx("div",{className:"efp-v3-main",children:/* @__PURE__ */jsxs("div",{className:"efp-sh",children:[
|
|
352
352
|
/* @__PURE__ */jsx("h2",{className:"efp-serif efp-sh-title",children:orderHeadline(o,copy,v3)}),sub?/* @__PURE__ */jsx("p",{className:"efp-sh-sub2",children:sub}):null,
|
|
353
353
|
/* @__PURE__ */jsx(V3Error,{line:line}),o.canPay?/* @__PURE__ */jsx("button",{type:"button",className:"efp-emb-btn efp-emb-btn--block",disabled:busy||void 0,"aria-busy":pay.busy||void 0,onClick:onPay,"data-everfur-shop-action":"pay",children:pay.busy?copy.saving:copy.payOrder}):null,steps?/* @__PURE__ */jsx("div",{className:"efp-sh-card",children:/* @__PURE__ */jsx(V3Track,{steps:steps,label:v3.tracking})}):null,tracking&&(carrier||tracking.trackingNumber)?/* @__PURE__ */jsxs("div",{className:"efp-sh-card efp-sh-carrier",children:[
|
|
354
354
|
/* @__PURE__ */jsx("span",{className:"efp-sh-carrier__ic",children:/* @__PURE__ */jsx(V3Icon,{name:"truck"})}),
|
|
@@ -371,7 +371,7 @@ return jsxs("li",{className:"efp-sh-item",children:[
|
|
|
371
371
|
/* @__PURE__ */jsx("h3",{className:"efp-serif",children:v3.cancelAsk}),v3.cancelBody?/* @__PURE__ */jsx("p",{className:"efp-v3-note",children:v3.cancelBody}):null,
|
|
372
372
|
/* @__PURE__ */jsxs("div",{className:"efp-co",children:[
|
|
373
373
|
/* @__PURE__ */jsx("button",{type:"button",className:"efp-emb-btn efp-emb-btn--block",disabled:cancel.busy||void 0,"aria-busy":cancel.busy||void 0,onClick:onCancel,children:cancel.busy?copy.saving:copy.cancelOrder}),
|
|
374
|
-
/* @__PURE__ */jsx("button",{type:"button",className:"efp-emb-btn efp-emb-btn--ghost efp-emb-btn--block",disabled:cancel.busy||void 0,onClick:()=>setAsking(false),children:copy.keepIt})]})]})]})}var PAGE=20;function OrdersPage({tabs:tabs}){let{client:client,copy:copy,v3:v3}=useShop(),first=useShopRead("v3-orders",()=>client.orders({limit:PAGE})),[more,setMore]=useState(null),[moreBusy,setMoreBusy]=useState(false),[moreError,setMoreError]=useState(null),firstValue=first.value;useEffect(()=>setMore(null),[firstValue]);let orders=[...firstValue?.orders??[],...more?.orders??[]],cursor=more?more.cursor:firstValue?.nextCursor??null,missing=orders.filter(o=>!o.items).map(o=>o.orderId),details=useShopRead(missing.length>0?`v3-order-items:${missing.join(",")}`:null,async()=>{let read=await Promise.all(missing.map(id=>client.order(id)));return omsOk(new Map(missing.map((id,i)=>[id,read[i].ok?read[i].value.lines.map(l=>({title:l.title,quantity:l.quantity})):[]])))}),named=o=>o.items?o.items:details.value?.get(o.orderId)??null,busy=useRef(false),loadMore=useCallback(()=>{!cursor||busy.current||(busy.current=true,setMoreBusy(true),setMoreError(null),client.orders({limit:PAGE,cursor:cursor}).then(res=>{busy.current=false,setMoreBusy(false),res.ok?setMore(m=>({orders:[...m?.orders??[],...res.value.orders],cursor:res.value.nextCursor})):setMoreError(refusalLine(copy,res.error))}))},[client,copy,cursor]),body;return first.phase==="loading"?body=/* @__PURE__ */jsx(V3Ghosts,{}):first.phase==="failed"?body=/* @__PURE__ */jsxs(Fragment,{children:[
|
|
374
|
+
/* @__PURE__ */jsx("button",{type:"button",className:"efp-emb-btn efp-emb-btn--ghost efp-emb-btn--block",disabled:cancel.busy||void 0,onClick:()=>setAsking(false),children:copy.keepIt})]})]})]})}var PAGE=20;function OrdersPage({tabs:tabs}){let{client:client,copy:copy,v3:v3}=useShop(),first=useShopRead("v3-orders",()=>client.orders({limit:PAGE})),[more,setMore]=useState(null),[moreBusy,setMoreBusy]=useState(false),[moreError,setMoreError]=useState(null),firstValue=first.value;useEffect(()=>setMore(null),[firstValue]),useRereadOnForeground(tabVisible,first.reread,more===null);let orders=[...firstValue?.orders??[],...more?.orders??[]],cursor=more?more.cursor:firstValue?.nextCursor??null,missing=orders.filter(o=>!o.items).map(o=>o.orderId),details=useShopRead(missing.length>0?`v3-order-items:${missing.join(",")}`:null,async()=>{let read=await Promise.all(missing.map(id=>client.order(id)));return omsOk(new Map(missing.map((id,i)=>[id,read[i].ok?read[i].value.lines.map(l=>({title:l.title,quantity:l.quantity})):[]])))}),named=o=>o.items?o.items:details.value?.get(o.orderId)??null,busy=useRef(false),loadMore=useCallback(()=>{!cursor||busy.current||(busy.current=true,setMoreBusy(true),setMoreError(null),client.orders({limit:PAGE,cursor:cursor}).then(res=>{busy.current=false,setMoreBusy(false),res.ok?setMore(m=>({orders:[...m?.orders??[],...res.value.orders],cursor:res.value.nextCursor})):setMoreError(refusalLine(copy,res.error))}))},[client,copy,cursor]),body;return first.phase==="loading"?body=/* @__PURE__ */jsx(V3Ghosts,{}):first.phase==="failed"?body=/* @__PURE__ */jsxs(Fragment,{children:[
|
|
375
375
|
/* @__PURE__ */jsx(V3Error,{line:copy.loadFailed(copy.thingOrders)}),
|
|
376
376
|
/* @__PURE__ */jsx("div",{className:"efp-sh-acts",children:/* @__PURE__ */jsx("button",{type:"button",className:"efp-emb-btn efp-emb-btn--ghost efp-emb-btn--sm",onClick:first.refresh,children:copy.tryAgain})})]}):orders.length===0?body=/* @__PURE__ */jsxs("div",{className:"efp-sh-empty",children:[
|
|
377
377
|
/* @__PURE__ */jsx("span",{className:"efp-emb-tile efp-emb-tile--cyan",children:/* @__PURE__ */jsx(V3Icon,{name:"box"})}),
|
|
@@ -380,7 +380,7 @@ return jsxs("li",{className:"efp-sh-item",children:[
|
|
|
380
380
|
/* @__PURE__ */jsx("ul",{className:"efp-sh-orders",children:orders.map(o=>/* @__PURE__ */jsx(OrderCard,{order:o,items:named(o)},o.orderId))}),
|
|
381
381
|
/* @__PURE__ */jsx(V3Error,{line:moreError}),cursor?/* @__PURE__ */jsx(MoreOrders,{onMore:loadMore,loading:moreBusy}):null]}),/* @__PURE__ */jsxs("div",{className:"efp-v3-col","data-everfur-shop-page":"orders",children:[
|
|
382
382
|
/* @__PURE__ */jsx(CareTabs,{copy:copy,current:"orders",tabs:tabs}),
|
|
383
|
-
/* @__PURE__ */jsx("
|
|
383
|
+
/* @__PURE__ */jsx("div",{className:"efp-v3-main",children:/* @__PURE__ */jsxs("div",{className:"efp-sh",children:[
|
|
384
384
|
/* @__PURE__ */jsx("h1",{className:"efp-serif efp-sh-title",children:v3.ordersTitle}),body]})})]})}function OrderCard({order:order,items:items}){let{copy:copy,v3:v3}=useShop(),pill=statusPill(order.status,copy,v3),what=items&&items.length>0?itemNames(items):null,meta=orderMeta(order,copy,formatCents(order.total));/* @__PURE__ */
|
|
385
385
|
return jsx("li",{children:/* @__PURE__ */jsxs(ShopLink,{to:{name:"order",orderId:order.orderId},className:"efp-sh-order",children:[
|
|
386
386
|
/* @__PURE__ */jsxs("span",{children:[
|
|
@@ -390,7 +390,7 @@ return jsx("li",{children:/* @__PURE__ */jsxs(ShopLink,{to:{name:"order",orderId
|
|
|
390
390
|
/* @__PURE__ */jsx(V3Icon,{name:"chev"})]})})}function MoreOrders({onMore:onMore,loading:loading}){let ref=useRef(null),more=useRef(onMore);return more.current=onMore,useEffect(()=>{let el=ref.current;if(el===null||typeof IntersectionObserver>"u")return;let io=new IntersectionObserver(entries=>{entries.some(e=>e.isIntersecting)&&more.current()});return io.observe(el),()=>io.disconnect()},[]),/* @__PURE__ */jsx("div",{ref:ref,"data-everfur-orders-more":"","aria-busy":loading||void 0,children:loading?/* @__PURE__ */jsx(V3Ghosts,{rows:1}):null})}function PlacedPage({orderIds:orderIds}){let{client:client,copy:copy,v3:v3}=useShop(),orders=(useShopRead(orderIds.length>0?`placed:${orderIds.join(",")}`:null,async()=>omsOk(await Promise.all(orderIds.map(id=>client.order(id))))).value??[]).flatMap(r=>r.ok?[r.value]:[]),arrives=orders.map(arrivesByOf).filter(d=>!!d).sort().pop(),day=formatDay(arrives??null,{weekday:true}),lines=orders.flatMap(o=>o.lines),one=orderIds.length===1;/* @__PURE__ */
|
|
391
391
|
return jsxs("div",{className:"efp-v3-col","data-everfur-shop-page":"placed",children:[
|
|
392
392
|
/* @__PURE__ */jsx(V3Head,{title:v3.placedHeader,back:null,backLabel:copy.backToShop}),
|
|
393
|
-
/* @__PURE__ */jsx("
|
|
393
|
+
/* @__PURE__ */jsx("div",{className:"efp-v3-main",children:/* @__PURE__ */jsxs("div",{className:"efp-bk__done",children:[
|
|
394
394
|
/* @__PURE__ */jsx("span",{className:"efp-bk__check","aria-hidden":"true",children:/* @__PURE__ */jsx(V3Icon,{name:"check"})}),
|
|
395
395
|
/* @__PURE__ */jsx("h2",{className:"efp-serif efp-bk__title",children:v3.placedTitle}),day?/* @__PURE__ */jsx("p",{className:"efp-bk__when",children:v3.arrivesBy(day)}):null,orders.map(o=>o.summary.referenceNumber?/* @__PURE__ */jsx("p",{className:"efp-bk__who",children:v3.orderTitle(o.summary.referenceNumber)},o.summary.orderId):null),lines.length>0?/* @__PURE__ */jsxs("ol",{className:"efp-hp-next","aria-label":v3.placedSteps,children:[lines.map(l=>/* @__PURE__ */jsxs("li",{children:[
|
|
396
396
|
/* @__PURE__ */jsx("span",{className:"efp-hp-next__ic","aria-hidden":"true",children:/* @__PURE__ */jsx(V3Icon,{name:"box"})}),
|
|
@@ -415,4 +415,4 @@ return jsx(PlacedPage,{orderIds:route.orderIds},route.orderIds.join(","));case"a
|
|
|
415
415
|
return jsx(LiveAddress,{...route.then?{then:route.then}:{}});case"card":/* @__PURE__ */
|
|
416
416
|
return jsx(LiveCard,{handoff:cardHandoff,...route.then?{then:route.then}:{}},returned);case"buy":/* @__PURE__ */
|
|
417
417
|
return jsx(LiveBuy,{route:route});case"consent":/* @__PURE__ */
|
|
418
|
-
return jsx(LiveConsent,{route:route})}}var OmsWireError=class _OmsWireError extends Error{constructor(field){super(`OMS answer could not be read: ${field}`);this.field=field;this.name="OmsWireError",Object.setPrototypeOf(this,_OmsWireError.prototype)}};function obj(value,field){if(value===null||typeof value!="object"||Array.isArray(value))throw new OmsWireError(field);return value}function arr(value,field){if(value==null)return[];if(!Array.isArray(value))throw new OmsWireError(field);return value}function str2(o,key,field=key){let v=o[key];if(typeof v!="string"||v.length===0)throw new OmsWireError(field);return v}function optStr(o,key){let v=o[key];return typeof v=="string"&&v.length>0?v:null}function int(o,key,field=key){let v=o[key];if(typeof v!="number"||!Number.isFinite(v))throw new OmsWireError(field);return Math.trunc(v)}function optInt(o,key){let v=o[key];return typeof v=="number"&&Number.isFinite(v)?Math.trunc(v):null}function bool(o,key){return o[key]===true}function petIdOf(value){if(!value||typeof value!="object")return null;let id=value.pet_id;return typeof id=="string"&&id.length>0?id:null}var PACK_UNITS=["each","gram","milliliter"],SPEEDS=["ground","two_day","next_day"];function packUnit(o){let v=o.pack_unit;return typeof v=="string"&&PACK_UNITS.includes(v)?v:null}function speed(v){return typeof v=="string"&&SPEEDS.includes(v)?v:null}function httpsUrl(o,key){let v=optStr(o,key);if(!v)return null;try{return new URL(v).protocol==="https:"?v:null}catch{return null}}function shopConfigFromWire(raw){let o=obj(raw,"shop-config"),delivery=o.delivery&&typeof o.delivery=="object"?o.delivery:null,key=optStr(o,"stripe_publishable_key");return{recurringTermsVersion:optStr(o,"recurring_terms_version"),recurringTermsUrl:httpsUrl(o,"recurring_terms_url"),stripePublishableKey:key&&/^pk_(test|live)_[A-Za-z0-9]+$/.test(key)?key:null,delivery:delivery?{firstFill:speed(delivery.first_fill),refill:speed(delivery.refill)}:null,rxContactMissing:Array.isArray(o.rx_contact_missing)?o.rx_contact_missing.filter(p=>typeof p=="string"):null}}function offerFromWire(raw){let o=obj(raw,"offer"),qty=o.pack_quantity;return{offerId:str2(o,"offer_id"),sku:optStr(o,"sku")??"",title:str2(o,"title"),fulfillmentType:optStr(o,"fulfillment_type")??"physical",requiresRx:bool(o,"requires_rx"),compounded:bool(o,"compounded"),packQuantity:typeof qty=="string"&&/^\d+(\.\d+)?$/.test(qty)?qty:null,packUnit:packUnit(o),price:optInt(o,"price"),imageUrl:httpsUrl(o,"image_url")}}function offerPageFromWire(raw){let o=obj(raw,"offers");return{offers:arr(o.offers,"offers").map(offerFromWire),nextCursor:optStr(o,"next_cursor")}}function quoteFromWire(raw){let o=obj(raw,"quote");return{lines:arr(o.lines,"lines").map(l=>{let line=obj(l,"line");return{offerId:str2(line,"offer_id"),quantity:int(line,"quantity"),petId:petIdOf(line.pet),unitPrice:int(line,"unit_price"),discount:optInt(line,"discount")??0,tax:optInt(line,"tax")??0}}),shipping:int(o,"shipping"),tax:optInt(o,"tax")??0,total:int(o,"total"),expiresAt:str2(o,"expires_at")}}function checkoutFromWire(raw){let o=obj(raw,"checkout");return{checkoutId:str2(o,"checkout_id"),state:optStr(o,"state")??"draft",orderIds:arr(o.order_ids,"order_ids").filter(id=>typeof id=="string"),createdAt:optStr(o,"created_at")??"",total:int(o,"total"),shipping:optInt(o,"shipping")??0,tax:optInt(o,"tax")??0}}function confirmationFromWire(raw){let o=obj(raw,"confirmation");return{checkoutId:str2(o,"checkout_id"),resale:arr(o.resale,"resale").map(r=>{let entry=obj(r,"resale"),outcome=str2(entry,"outcome");if(outcome!=="confirmed"&&outcome!=="action_required")throw new OmsWireError("resale.outcome");let payerAction=optStr(entry,"payer_action");if(outcome==="action_required"&&!payerAction)throw new OmsWireError("resale.payer_action");return{outcome:outcome,orderId:str2(entry,"order_id"),payerAction:outcome==="confirmed"?null:payerAction}})}}function orderSummaryFromWire(raw){let o=obj(raw,"order"),ref=o.reference&&typeof o.reference=="object"?o.reference:null;return{orderId:str2(o,"order_id"),referenceNumber:ref?optStr(ref,"number"):null,status:str2(o,"status"),total:int(o,"total"),placedAt:optStr(o,"placed_at"),itemCount:optInt(o,"item_count"),items:Array.isArray(o.items)?o.items.flatMap(orderItemFromWire):null}}function orderItemFromWire(raw){if(raw===null||typeof raw!="object"||Array.isArray(raw))return[];let o=raw,offerId=optStr(o,"offer_id"),title=optStr(o,"title"),quantity=optInt(o,"quantity");return offerId&&title&&quantity!==null?[{offerId:offerId,title:title,quantity:quantity}]:[]}function orderStepFromWire(raw){if(raw===null||typeof raw!="object"||Array.isArray(raw))return[];let o=raw,key=optStr(o,"key");return key?[{key:key,done:o.done===true,at:optStr(o,"at")}]:[]}function optTrackingFromWire(raw){if(raw===null||typeof raw!="object"||Array.isArray(raw))return null;try{return trackingFromWire(raw)}catch{return null}}function orderPageFromWire(raw){let o=obj(raw,"orders");return{orders:arr(o.orders,"orders").map(orderSummaryFromWire),nextCursor:optStr(o,"next_cursor")}}function orderLineFromWire(raw){let o=obj(raw,"line"),qty=o.pack_quantity;return{lineId:str2(o,"line_id"),offerId:str2(o,"offer_id"),sku:optStr(o,"sku")??"",title:str2(o,"title"),requiresRx:bool(o,"requires_rx"),compounded:bool(o,"compounded"),packQuantity:typeof qty=="string"&&/^\d+(\.\d+)?$/.test(qty)?qty:null,packUnit:packUnit(o),quantity:int(o,"quantity"),unitPrice:int(o,"unit_price"),discount:optInt(o,"discount")??0,tax:optInt(o,"tax")??0,fulfillmentType:optStr(o,"fulfillment_type")??"physical",petId:petIdOf(o.pet)}}function trackingFromWire(raw){let o=obj(raw,"tracking");return{carrier:optStr(o,"carrier"),trackingNumber:optStr(o,"tracking_number"),status:str2(o,"status"),occurredAt:optStr(o,"occurred_at"),trackingUrl:httpsUrl(o,"tracking_url"),deliveryBy:optStr(o,"delivery_by")}}function shipmentFromWire(raw){let o=obj(raw,"shipment");return{shipmentId:str2(o,"shipment_id"),state:str2(o,"state"),lines:arr(o.lines,"shipment.lines").map(l=>{let line=obj(l,"shipment.line");return{lineId:str2(line,"line_id"),quantity:int(line,"quantity")}}),tracking:arr(o.tracking,"tracking").map(trackingFromWire)}}function orderFromWire(raw){let o=obj(raw,"order");return{summary:orderSummaryFromWire(o.summary),lines:arr(o.lines,"lines").map(orderLineFromWire),shipping:optInt(o,"shipping")??0,shippingTax:optInt(o,"shipping_tax")??0,shipments:arr(o.shipments,"shipments").map(shipmentFromWire),canCancel:bool(o,"can_cancel"),canReturn:bool(o,"can_return"),canPay:bool(o,"can_pay"),paymentStatus:optStr(o,"payment_status"),refunds:arr(o.refunds,"refunds").map(r=>{let refund=obj(r,"refund");return{refundId:str2(refund,"refund_id"),amount:int(refund,"amount"),state:str2(refund,"state")}}),returnIds:arr(o.return_ids,"return_ids").filter(id=>typeof id=="string"),subtotal:optInt(o,"subtotal"),discount:optInt(o,"discount"),tax:optInt(o,"tax"),arrivesBy:optStr(o,"arrives_by"),tracking:optTrackingFromWire(o.tracking),steps:Array.isArray(o.steps)?o.steps.flatMap(orderStepFromWire):null,paymentMethodId:optStr(o,"payment_method_id")}}function cancelOutcomeFromWire(raw){let o=obj(raw,"cancel");return{outcome:str2(o,"outcome"),refunded:optInt(o,"refunded"),reasonCode:optStr(o,"reason_code")}}function payOutcomeFromWire(raw){let o=obj(raw,"pay"),outcome=str2(o,"outcome");if(outcome!=="authorized"&&outcome!=="action_required")throw new OmsWireError("pay.outcome");let payerAction=optStr(o,"payer_action");if(outcome==="action_required"&&!payerAction)throw new OmsWireError("pay.payer_action");return{outcome:outcome,orderId:str2(o,"order_id"),payerAction:outcome==="authorized"?null:payerAction}}function returnFromWire(raw){let o=obj(raw,"return");return{returnId:str2(o,"return_id"),orderId:str2(o,"order_id"),lines:arr(o.lines,"return.lines").map(l=>{let line=obj(l,"return.line");return{lineId:str2(line,"line_id"),quantity:int(line,"quantity"),reasonCode:str2(line,"reason_code")}}),state:str2(o,"state"),rma:optStr(o,"rma"),labelUrl:httpsUrl(o,"label_url")}}function caseFromWire(raw){let o=obj(raw,"case");return{caseId:str2(o,"case_id"),orderId:str2(o,"order_id"),reasonCode:str2(o,"reason_code"),message:typeof o.message=="string"?o.message:"",openedAt:str2(o,"opened_at"),closedAt:optStr(o,"closed_at")}}function casesFromWire(raw){return arr(obj(raw,"cases").cases,"cases").map(caseFromWire)}function prescriptionsFromWire(raw){return arr(obj(raw,"prescriptions").prescriptions,"prescriptions").map(r=>{let o=obj(r,"prescription");return{rxId:str2(o,"rx_id"),petId:str2(o,"pet_id"),drug:optStr(o,"drug")??"",strength:optStr(o,"strength"),form:optStr(o,"form"),status:str2(o,"status"),offerId:optStr(o,"offer_id"),packCount:optInt(o,"pack_count"),fillsUsed:optInt(o,"fills_used"),fillsTotal:optInt(o,"fills_total"),expiresOn:optStr(o,"expires_on"),nextFillOn:optStr(o,"next_fill_on")}})}function addressEntryFromWire(raw){let o=obj(raw,"address");return{ref:str2(o,"ref"),label:optStr(o,"label")??"",isDefault:bool(o,"is_default"),isComplete:bool(o,"is_complete")}}function addressesFromWire(raw){return arr(obj(raw,"addresses").addresses,"addresses").map(addressEntryFromWire)}function addressDetailFromWire(raw){let o=obj(raw,"address"),a=obj(o.address,"address.address"),address={recipientName:optStr(a,"recipient_name"),line1:str2(a,"line1","address.line1"),line2:optStr(a,"line2"),city:str2(a,"city","address.city"),region:optStr(a,"region")??"",postalCode:str2(a,"postal_code","address.postal_code"),country:str2(a,"country","address.country")};return{...addressEntryFromWire(o),address:address}}function paymentMethodsFromWire(raw){return arr(obj(raw,"payment_methods").payment_methods,"payment_methods").map(r=>{let o=obj(r,"payment_method");return{paymentMethodId:str2(o,"payment_method_id"),brand:optStr(o,"brand")??"",last4:optStr(o,"last4")??"",wallet:optStr(o,"wallet")}})}function paymentSetupFromWire(raw){let o=obj(raw,"setup");return{setupId:str2(o,"setup_id"),payerAction:str2(o,"payer_action")}}function cardSetupLinkFromWire(raw){let o=obj(raw,"card_setup");return{url:str2(o,"url")}}function cardActionLinkFromWire(raw){let o=obj(raw,"card_action");return{url:str2(o,"url"),expiresAt:str2(o,"expires_at")}}function planFromWire(raw){let o=obj(raw,"plan");return{planId:str2(o,"plan_id"),lines:arr(o.lines,"plan.lines").map(l=>{let line=obj(l,"plan.line");return{offerId:str2(line,"offer_id"),quantity:int(line,"quantity"),petId:petIdOf(line.pet)}}),cadenceDays:int(o,"cadence_days"),destination:optStr(o,"destination"),paymentMethodId:optStr(o,"payment_method_id"),discountBps:optInt(o,"discount_bps")??0,nextRun:optStr(o,"next_run"),state:str2(o,"state"),stopReason:optStr(o,"stop_reason")}}function planPageFromWire(raw){let o=obj(raw,"plans");return{plans:arr(o.plans,"plans").map(planFromWire),nextCursor:optStr(o,"next_cursor")}}function cartLineToWire(line){let wire={offer_id:line.offerId,quantity:line.quantity};return line.petId&&(wire.pet={namespace:"consumer",pet_id:line.petId}),line.rxId&&(wire.rx_id=line.rxId),wire}function addressInputToWire(input){let a=input.address;return{label:input.label,make_default:input.makeDefault===true,address:{recipient_name:a.recipientName,line1:a.line1,line2:a.line2,city:a.city,region:a.region,postal_code:a.postalCode,country:a.country}}}function cycleReviewFromWire(raw){let o=obj(raw,"cycle"),review=o.review&&typeof o.review=="object"&&!Array.isArray(o.review)?o.review:null,pick=key=>review&&review[key]!==void 0&&review[key]!==null?review[key]:o[key];return{planId:str2(o,"plan_id"),reviewId:optStr(o,"review_id")??(review?optStr(review,"review_id"):null),cycle:int(o,"cycle"),state:review?optStr(review,"state")??optStr(o,"state"):optStr(o,"state"),lines:arr(pick("lines"),"cycle.lines").map(l=>{let line=obj(l,"cycle.line");return{offerId:str2(line,"offer_id"),quantity:int(line,"quantity"),petId:petIdOf(line.pet)}}),shipsOn:review?optStr(review,"ships_on")??optStr(o,"ships_on"):optStr(o,"ships_on"),approveBy:review?optStr(review,"approve_by")??optStr(o,"approve_by"):optStr(o,"approve_by"),quoteLines:arr(o.quote&&typeof o.quote=="object"?o.quote.lines:null,"cycle.quote.lines").map(l=>{let line=obj(l,"cycle.quote.line");return{offerId:str2(line,"offer_id"),quantity:int(line,"quantity"),petId:petIdOf(line.pet),unitPrice:int(line,"unit_price"),discount:optInt(line,"discount")??0,tax:optInt(line,"tax")??0}})}}function cycleDraftFromWire(raw){let o=obj(raw,"cycle-draft");return{checkoutId:str2(o,"checkout_id"),shipping:optInt(o,"shipping")??0,tax:optInt(o,"tax")??0,total:int(o,"total"),expiresAt:optStr(o,"expires_at")}}var DEFAULT_PATH="/api/v1/oms",DEFAULT_TIMEOUT_MS=3e4,PAYMENT_METHOD_ID=/^[A-Za-z0-9_]+$/,REASON_CODE=/^[a-z][a-z0-9_]{0,63}$/;function checkBaseUrl(raw){let url;try{url=new URL(raw)}catch{throw new EverfurConfigError("invalid-argument","createOmsClient: baseUrl is not a URL")}let local=url.hostname==="localhost"||url.hostname==="127.0.0.1"||url.hostname==="[::1]";if(url.protocol!=="https:"&&!(local&&url.protocol==="http:"))throw new EverfurConfigError("invalid-argument","createOmsClient: baseUrl must be https");if(url.username||url.password||url.search||url.hash)throw new EverfurConfigError("invalid-argument","createOmsClient: baseUrl must be a bare origin or path");return url.origin+url.pathname.replace(/\/+$/,"")}function seg(id){return encodeURIComponent(id)}function isValidId(id){return typeof id=="string"&&id.length>0&&id.length<=256}function createOmsClient(config){let base=checkBaseUrl(config.baseUrl)+(config.path??DEFAULT_PATH).replace(/\/+$/,""),fetchImpl=config.fetch??(typeof globalThis.fetch=="function"?globalThis.fetch.bind(globalThis):void 0);if(!fetchImpl)throw new EverfurConfigError("missing-peer-dependency","createOmsClient: no fetch available; pass config.fetch");if(!config.auth||config.auth.kind!=="everfur_consumer"||typeof config.auth.getToken!="function")throw new EverfurConfigError("invalid-argument",'createOmsClient: auth must be { kind: "everfur_consumer", getToken }');let getToken=config.auth.getToken,channel=config.channel??"web",timeoutMs=config.timeoutMs??DEFAULT_TIMEOUT_MS;async function token(){try{let t=await getToken();return typeof t=="string"&&t.length>0?t:null}catch{return null}}async function send(call){let bearer=await token();if(!bearer)return omsErr({kind:"signedOut"});let url=base+call.path;if(call.query){let params=new URLSearchParams;for(let[k,v]of Object.entries(call.query))v!==void 0&¶ms.set(k,String(v));let qs=params.toString();qs&&(url+=`?${qs}`)}let headers={accept:"application/json",authorization:`Bearer ${bearer}`},init={method:call.method,headers:headers};call.body!==void 0&&(headers["content-type"]="application/json",init.body=JSON.stringify(call.body));let controller=typeof AbortController=="function"?new AbortController:null;controller&&(init.signal=controller.signal);let timedOut=false,timer=setTimeout(()=>{timedOut=true,controller?.abort()},timeoutMs),res;try{res=await fetchImpl(url,init)}catch{return clearTimeout(timer),omsErr({kind:timedOut?"timeout":"network"})}try{let requestId=res.headers.get("x-request-id")??void 0,rid=requestId?{requestId:requestId}:{};if(res.status<200||res.status>=300){let body=res.status===402||res.status===409||res.status===422?await res.json().catch(()=>null):null;return omsErr(omsErrorFromStatus(res.status,body,{...rid,retryAfter:res.headers.get("retry-after")}))}if(call.read===null||res.status===204)return omsOk(void 0);let raw;try{raw=await res.json()}catch{return omsErr({kind:"badResponse",...rid})}try{return omsOk(call.read(raw))}catch{return omsErr({kind:"badResponse",...rid})}}catch{return omsErr({kind:timedOut?"timeout":"network"})}finally{clearTimeout(timer)}}let invalid=()=>Promise.resolve(omsErr({kind:"invalidRequest"}));function withId(id,run){return isValidId(id)?run(seg(id)):invalid()}let lines=ls=>ls.map(cartLineToWire);return{shopConfig:()=>send({method:"GET",path:"/shop-config",read:shopConfigFromWire}),offers:(q={})=>send({method:"GET",path:"/catalog/offers",query:{text:q.text,requires_rx:q.requiresRx,cursor:q.cursor,limit:q.limit},read:offerPageFromWire}),offer:offerId=>withId(offerId,id=>send({method:"GET",path:`/catalog/offers/${id}`,read:offerFromWire})),prescriptions:()=>send({method:"GET",path:"/prescriptions",read:prescriptionsFromWire}),addresses:()=>send({method:"GET",path:"/addresses",read:addressesFromWire}),address:ref=>withId(ref,id=>send({method:"GET",path:`/addresses/${id}`,read:addressDetailFromWire})),addAddress:input=>send({method:"POST",path:"/addresses",body:addressInputToWire(input),read:addressEntryFromWire}),updateAddress:(ref,input)=>withId(ref,id=>send({method:"PUT",path:`/addresses/${id}`,body:addressInputToWire(input),read:addressEntryFromWire})),removeAddress:ref=>withId(ref,id=>send({method:"DELETE",path:`/addresses/${id}`,read:null})),makeDefaultAddress:ref=>withId(ref,id=>send({method:"POST",path:`/addresses/${id}/default`,read:addressEntryFromWire})),paymentMethods:()=>send({method:"GET",path:"/payment-methods",read:paymentMethodsFromWire}),setupPaymentMethod:()=>send({method:"POST",path:"/payment-methods/setup",read:paymentSetupFromWire}),startCardSetupSession:r=>send({method:"POST",path:"/payment-methods/setup-session",body:{idempotency_key:r.idempotencyKey,return_url:r.returnUrl},read:cardSetupLinkFromWire}),removePaymentMethod:pm=>PAYMENT_METHOD_ID.test(pm)?send({method:"DELETE",path:`/payment-methods/${pm}`,read:null}):invalid(),quote:r=>send({method:"POST",path:"/cart/quote",body:{lines:lines(r.lines),ship_to:r.shipTo,promo_code:r.promoCode??null},read:quoteFromWire}),createCheckout:r=>send({method:"POST",path:"/checkouts",body:{idempotency_key:r.idempotencyKey,channel:channel,lines:lines(r.lines),ship_to:r.shipTo,receipt_email:r.receiptEmail??null,promo_code:r.promoCode??null},read:checkoutFromWire}),confirmCheckout:(checkoutId,r)=>PAYMENT_METHOD_ID.test(r.paymentMethodId)&&Number.isInteger(r.expectedTotal)?withId(checkoutId,id=>send({method:"POST",path:`/checkouts/${id}/confirm`,body:{idempotency_key:r.idempotencyKey,expected_total:r.expectedTotal,payment_method_id:r.paymentMethodId},read:confirmationFromWire})):invalid(),orders:(q={})=>send({method:"GET",path:"/orders",query:{cursor:q.cursor,limit:q.limit,reference:q.reference},read:orderPageFromWire}),order:orderId=>withId(orderId,id=>send({method:"GET",path:`/orders/${id}`,read:orderFromWire})),cancelOrder:(orderId,r)=>REASON_CODE.test(r.reasonCode)?withId(orderId,id=>send({method:"POST",path:`/orders/${id}/cancel`,body:{idempotency_key:r.idempotencyKey,reason_code:r.reasonCode},read:cancelOutcomeFromWire})):invalid(),payOrder:(orderId,r)=>{if(r.paymentMethodId!==void 0&&!PAYMENT_METHOD_ID.test(r.paymentMethodId))return invalid();let body={idempotency_key:r.idempotencyKey};return r.paymentMethodId&&(body.payment_method_id=r.paymentMethodId),withId(orderId,id=>send({method:"POST",path:`/orders/${id}/pay`,body:body,read:payOutcomeFromWire}))},cardActionLink:(orderId,r)=>withId(orderId,id=>send({method:"POST",path:`/orders/${id}/card-action-link`,body:{return_url:r.returnUrl},read:cardActionLinkFromWire})),requestReturn:(orderId,r)=>r.lines.every(l=>REASON_CODE.test(l.reasonCode))?withId(orderId,id=>send({method:"POST",path:`/orders/${id}/returns`,body:{idempotency_key:r.idempotencyKey,lines:r.lines.map(l=>({line_id:l.lineId,quantity:l.quantity,reason_code:l.reasonCode}))},read:returnFromWire})):invalid(),getReturn:returnId=>withId(returnId,id=>send({method:"GET",path:`/returns/${id}`,read:returnFromWire})),cancelReturn:returnId=>withId(returnId,id=>send({method:"POST",path:`/returns/${id}/cancel`,read:returnFromWire})),openCase:(orderId,r)=>REASON_CODE.test(r.reasonCode)&&r.message.length<=4e3?withId(orderId,id=>send({method:"POST",path:`/orders/${id}/cases`,body:{idempotency_key:r.idempotencyKey,reason_code:r.reasonCode,message:r.message},read:caseFromWire})):invalid(),orderCases:orderId=>withId(orderId,id=>send({method:"GET",path:`/orders/${id}/cases`,read:casesFromWire})),plans:(q={})=>send({method:"GET",path:"/subscriptions",query:{cursor:q.cursor,limit:q.limit},read:planPageFromWire}),createPlan:input=>PAYMENT_METHOD_ID.test(input.paymentMethodId)?send({method:"POST",path:"/subscriptions",body:{idempotency_key:input.idempotencyKey,cadence_days:input.cadenceDays,destination:input.destination,payment_method_id:input.paymentMethodId,consent_terms_version:input.consentTermsVersion,lines:lines(input.lines)},read:planFromWire}):invalid(),updatePlan:(planId,patch)=>{if(patch.paymentMethodId!==void 0&&!PAYMENT_METHOD_ID.test(patch.paymentMethodId))return invalid();let body={idempotency_key:patch.idempotencyKey};return patch.lines&&(body.lines=lines(patch.lines)),patch.cadenceDays!==void 0&&(body.cadence_days=patch.cadenceDays),patch.destination!==void 0&&(body.destination=patch.destination),patch.paymentMethodId!==void 0&&(body.payment_method_id=patch.paymentMethodId),withId(planId,id=>send({method:"PATCH",path:`/subscriptions/${id}`,body:body,read:planFromWire}))},planAction:(planId,r)=>withId(planId,id=>send({method:"POST",path:`/subscriptions/${id}/actions`,body:{idempotency_key:r.idempotencyKey,operation:r.operation},read:planFromWire})),cancelPlan:planId=>withId(planId,id=>send({method:"POST",path:`/subscriptions/${id}/cancel`,read:planFromWire})),cycleReview:planId=>withId(planId,id=>send({method:"GET",path:`/subscriptions/${id}/cycle`,read:cycleReviewFromWire})),editCycle:(planId,cycle,r)=>Number.isInteger(cycle)&&cycle>0?withId(planId,id=>send({method:"PUT",path:`/subscriptions/${id}/cycles/${cycle}/lines`,body:{idempotency_key:r.idempotencyKey,lines:lines(r.lines)},read:cycleReviewFromWire})):invalid(),draftCycle:(planId,cycle)=>Number.isInteger(cycle)&&cycle>0?withId(planId,id=>send({method:"POST",path:`/subscriptions/${id}/cycles/${cycle}/draft`,read:cycleDraftFromWire})):invalid(),approveCycle:(planId,cycle,r)=>Number.isInteger(cycle)&&cycle>0&&Number.isInteger(r.expectedTotal)?withId(planId,id=>send({method:"POST",path:`/subscriptions/${id}/cycles/${cycle}/approve`,body:{idempotency_key:r.idempotencyKey,checkout_id:r.checkoutId,expected_total:r.expectedTotal},read:confirmationFromWire})):invalid(),skipCycle:(planId,cycle,r)=>Number.isInteger(cycle)&&cycle>0?withId(planId,id=>send({method:"POST",path:`/subscriptions/${id}/cycles/${cycle}/skip`,body:{idempotency_key:r.idempotencyKey},read:planFromWire})):invalid()}}function step(result){return result.error?{ok:false,message:typeof result.error.message=="string"&&result.error.message.length<=300?result.error.message:null}:{ok:true}}function createStripeJsPayments(stripe,options={}){return{async confirmCardSetup(clientSecret){try{let confirmParams=options.returnUrl?{return_url:options.returnUrl}:void 0;return step(await stripe.confirmSetup({clientSecret:clientSecret,...options.elementsFor?{elements:options.elementsFor(clientSecret)}:{},...confirmParams?{confirmParams:confirmParams}:{},redirect:"if_required"}))}catch{return{ok:false,message:null}}},async handleNextAction(clientSecret){try{return step(await stripe.handleNextAction({clientSecret:clientSecret}))}catch{return{ok:false,message:null}}}}}export{EverfurShop,SHOP_COPY,SHOP_COPY_PLACEHOLDERS,SHOP_V3_COPY,SHOP_V3_COPY_PLACEHOLDERS,UNAVAILABLE_PACKAGE_SOURCE,createOmsClient,createOmsPackageSource,createStripeJsPayments,isOmsRefusal,isOmsRetryable,isOmsUnavailable,newIdempotencyKey,shopCopy,shopV3Copy};
|
|
418
|
+
return jsx(LiveConsent,{route:route})}}function parseUrl(raw,base){let Url=globalThis.URL;if(typeof Url=="function"){let url;try{url=base===void 0?new Url(raw):new Url(raw,base)}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,base){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}}var OmsWireError=class _OmsWireError extends Error{constructor(field){super(`OMS answer could not be read: ${field}`);this.field=field;this.name="OmsWireError",Object.setPrototypeOf(this,_OmsWireError.prototype)}};function obj(value,field){if(value===null||typeof value!="object"||Array.isArray(value))throw new OmsWireError(field);return value}function arr(value,field){if(value==null)return[];if(!Array.isArray(value))throw new OmsWireError(field);return value}function str2(o,key,field=key){let v=o[key];if(typeof v!="string"||v.length===0)throw new OmsWireError(field);return v}function optStr(o,key){let v=o[key];return typeof v=="string"&&v.length>0?v:null}function int(o,key,field=key){let v=o[key];if(typeof v!="number"||!Number.isFinite(v))throw new OmsWireError(field);return Math.trunc(v)}function optInt(o,key){let v=o[key];return typeof v=="number"&&Number.isFinite(v)?Math.trunc(v):null}function bool(o,key){return o[key]===true}function petIdOf(value){if(!value||typeof value!="object")return null;let id=value.pet_id;return typeof id=="string"&&id.length>0?id:null}var PACK_UNITS=["each","gram","milliliter"],SPEEDS=["ground","two_day","next_day"];function packUnit(o){let v=o.pack_unit;return typeof v=="string"&&PACK_UNITS.includes(v)?v:null}function speed(v){return typeof v=="string"&&SPEEDS.includes(v)?v:null}function httpsUrl(o,key){let v=optStr(o,key);return v&&parseUrl(v)?.protocol==="https:"?v:null}function shopConfigFromWire(raw){let o=obj(raw,"shop-config"),delivery=o.delivery&&typeof o.delivery=="object"?o.delivery:null,key=optStr(o,"stripe_publishable_key");return{recurringTermsVersion:optStr(o,"recurring_terms_version"),recurringTermsUrl:httpsUrl(o,"recurring_terms_url"),stripePublishableKey:key&&/^pk_(test|live)_[A-Za-z0-9]+$/.test(key)?key:null,delivery:delivery?{firstFill:speed(delivery.first_fill),refill:speed(delivery.refill)}:null,rxContactMissing:Array.isArray(o.rx_contact_missing)?o.rx_contact_missing.filter(p=>typeof p=="string"):null}}function offerFromWire(raw){let o=obj(raw,"offer"),qty=o.pack_quantity;return{offerId:str2(o,"offer_id"),sku:optStr(o,"sku")??"",title:str2(o,"title"),fulfillmentType:optStr(o,"fulfillment_type")??"physical",requiresRx:bool(o,"requires_rx"),compounded:bool(o,"compounded"),packQuantity:typeof qty=="string"&&/^\d+(\.\d+)?$/.test(qty)?qty:null,packUnit:packUnit(o),price:optInt(o,"price"),imageUrl:httpsUrl(o,"image_url")}}function offerPageFromWire(raw){let o=obj(raw,"offers");return{offers:arr(o.offers,"offers").map(offerFromWire),nextCursor:optStr(o,"next_cursor")}}function quoteFromWire(raw){let o=obj(raw,"quote");return{lines:arr(o.lines,"lines").map(l=>{let line=obj(l,"line");return{offerId:str2(line,"offer_id"),quantity:int(line,"quantity"),petId:petIdOf(line.pet),unitPrice:int(line,"unit_price"),discount:optInt(line,"discount")??0,tax:optInt(line,"tax")??0}}),shipping:int(o,"shipping"),tax:optInt(o,"tax")??0,total:int(o,"total"),expiresAt:str2(o,"expires_at")}}function checkoutFromWire(raw){let o=obj(raw,"checkout");return{checkoutId:str2(o,"checkout_id"),state:optStr(o,"state")??"draft",orderIds:arr(o.order_ids,"order_ids").filter(id=>typeof id=="string"),createdAt:optStr(o,"created_at")??"",total:int(o,"total"),shipping:optInt(o,"shipping")??0,tax:optInt(o,"tax")??0}}function confirmationFromWire(raw){let o=obj(raw,"confirmation");return{checkoutId:str2(o,"checkout_id"),resale:arr(o.resale,"resale").map(r=>{let entry=obj(r,"resale"),outcome=str2(entry,"outcome");if(outcome!=="confirmed"&&outcome!=="action_required")throw new OmsWireError("resale.outcome");let payerAction=optStr(entry,"payer_action");if(outcome==="action_required"&&!payerAction)throw new OmsWireError("resale.payer_action");return{outcome:outcome,orderId:str2(entry,"order_id"),payerAction:outcome==="confirmed"?null:payerAction}})}}function orderSummaryFromWire(raw){let o=obj(raw,"order"),ref=o.reference&&typeof o.reference=="object"?o.reference:null;return{orderId:str2(o,"order_id"),referenceNumber:ref?optStr(ref,"number"):null,status:str2(o,"status"),total:int(o,"total"),placedAt:optStr(o,"placed_at"),itemCount:optInt(o,"item_count"),items:Array.isArray(o.items)?o.items.flatMap(orderItemFromWire):null}}function orderItemFromWire(raw){if(raw===null||typeof raw!="object"||Array.isArray(raw))return[];let o=raw,offerId=optStr(o,"offer_id"),title=optStr(o,"title"),quantity=optInt(o,"quantity");return offerId&&title&&quantity!==null?[{offerId:offerId,title:title,quantity:quantity}]:[]}function orderStepFromWire(raw){if(raw===null||typeof raw!="object"||Array.isArray(raw))return[];let o=raw,key=optStr(o,"key");return key?[{key:key,done:o.done===true,at:optStr(o,"at")}]:[]}function optTrackingFromWire(raw){if(raw===null||typeof raw!="object"||Array.isArray(raw))return null;try{return trackingFromWire(raw)}catch{return null}}function orderPageFromWire(raw){let o=obj(raw,"orders");return{orders:arr(o.orders,"orders").map(orderSummaryFromWire),nextCursor:optStr(o,"next_cursor")}}function orderLineFromWire(raw){let o=obj(raw,"line"),qty=o.pack_quantity;return{lineId:str2(o,"line_id"),offerId:str2(o,"offer_id"),sku:optStr(o,"sku")??"",title:str2(o,"title"),requiresRx:bool(o,"requires_rx"),compounded:bool(o,"compounded"),packQuantity:typeof qty=="string"&&/^\d+(\.\d+)?$/.test(qty)?qty:null,packUnit:packUnit(o),quantity:int(o,"quantity"),unitPrice:int(o,"unit_price"),discount:optInt(o,"discount")??0,tax:optInt(o,"tax")??0,fulfillmentType:optStr(o,"fulfillment_type")??"physical",petId:petIdOf(o.pet)}}function trackingFromWire(raw){let o=obj(raw,"tracking");return{carrier:optStr(o,"carrier"),trackingNumber:optStr(o,"tracking_number"),status:str2(o,"status"),occurredAt:optStr(o,"occurred_at"),trackingUrl:httpsUrl(o,"tracking_url"),deliveryBy:optStr(o,"delivery_by")}}function shipmentFromWire(raw){let o=obj(raw,"shipment");return{shipmentId:str2(o,"shipment_id"),state:str2(o,"state"),lines:arr(o.lines,"shipment.lines").map(l=>{let line=obj(l,"shipment.line");return{lineId:str2(line,"line_id"),quantity:int(line,"quantity")}}),tracking:arr(o.tracking,"tracking").map(trackingFromWire)}}function orderFromWire(raw){let o=obj(raw,"order");return{summary:orderSummaryFromWire(o.summary),lines:arr(o.lines,"lines").map(orderLineFromWire),shipping:optInt(o,"shipping")??0,shippingTax:optInt(o,"shipping_tax")??0,shipments:arr(o.shipments,"shipments").map(shipmentFromWire),canCancel:bool(o,"can_cancel"),canReturn:bool(o,"can_return"),canPay:bool(o,"can_pay"),paymentStatus:optStr(o,"payment_status"),refunds:arr(o.refunds,"refunds").map(r=>{let refund=obj(r,"refund");return{refundId:str2(refund,"refund_id"),amount:int(refund,"amount"),state:str2(refund,"state")}}),returnIds:arr(o.return_ids,"return_ids").filter(id=>typeof id=="string"),subtotal:optInt(o,"subtotal"),discount:optInt(o,"discount"),tax:optInt(o,"tax"),arrivesBy:optStr(o,"arrives_by"),tracking:optTrackingFromWire(o.tracking),steps:Array.isArray(o.steps)?o.steps.flatMap(orderStepFromWire):null,paymentMethodId:optStr(o,"payment_method_id")}}function cancelOutcomeFromWire(raw){let o=obj(raw,"cancel");return{outcome:str2(o,"outcome"),refunded:optInt(o,"refunded"),reasonCode:optStr(o,"reason_code")}}function payOutcomeFromWire(raw){let o=obj(raw,"pay"),outcome=str2(o,"outcome");if(outcome!=="authorized"&&outcome!=="action_required")throw new OmsWireError("pay.outcome");let payerAction=optStr(o,"payer_action");if(outcome==="action_required"&&!payerAction)throw new OmsWireError("pay.payer_action");return{outcome:outcome,orderId:str2(o,"order_id"),payerAction:outcome==="authorized"?null:payerAction}}function returnFromWire(raw){let o=obj(raw,"return");return{returnId:str2(o,"return_id"),orderId:str2(o,"order_id"),lines:arr(o.lines,"return.lines").map(l=>{let line=obj(l,"return.line");return{lineId:str2(line,"line_id"),quantity:int(line,"quantity"),reasonCode:str2(line,"reason_code")}}),state:str2(o,"state"),rma:optStr(o,"rma"),labelUrl:httpsUrl(o,"label_url")}}function caseFromWire(raw){let o=obj(raw,"case");return{caseId:str2(o,"case_id"),orderId:str2(o,"order_id"),reasonCode:str2(o,"reason_code"),message:typeof o.message=="string"?o.message:"",openedAt:str2(o,"opened_at"),closedAt:optStr(o,"closed_at")}}function casesFromWire(raw){return arr(obj(raw,"cases").cases,"cases").map(caseFromWire)}function prescriptionsFromWire(raw){return arr(obj(raw,"prescriptions").prescriptions,"prescriptions").map(r=>{let o=obj(r,"prescription");return{rxId:str2(o,"rx_id"),petId:str2(o,"pet_id"),drug:optStr(o,"drug")??"",strength:optStr(o,"strength"),form:optStr(o,"form"),status:str2(o,"status"),offerId:optStr(o,"offer_id"),packCount:optInt(o,"pack_count"),fillsUsed:optInt(o,"fills_used"),fillsTotal:optInt(o,"fills_total"),expiresOn:optStr(o,"expires_on"),nextFillOn:optStr(o,"next_fill_on")}})}function addressEntryFromWire(raw){let o=obj(raw,"address");return{ref:str2(o,"ref"),label:optStr(o,"label")??"",isDefault:bool(o,"is_default"),isComplete:bool(o,"is_complete")}}function addressesFromWire(raw){return arr(obj(raw,"addresses").addresses,"addresses").map(addressEntryFromWire)}function addressDetailFromWire(raw){let o=obj(raw,"address"),a=obj(o.address,"address.address"),address={recipientName:optStr(a,"recipient_name"),line1:str2(a,"line1","address.line1"),line2:optStr(a,"line2"),city:str2(a,"city","address.city"),region:optStr(a,"region")??"",postalCode:str2(a,"postal_code","address.postal_code"),country:str2(a,"country","address.country")};return{...addressEntryFromWire(o),address:address}}function paymentMethodsFromWire(raw){return arr(obj(raw,"payment_methods").payment_methods,"payment_methods").map(r=>{let o=obj(r,"payment_method");return{paymentMethodId:str2(o,"payment_method_id"),brand:optStr(o,"brand")??"",last4:optStr(o,"last4")??"",wallet:optStr(o,"wallet")}})}function paymentSetupFromWire(raw){let o=obj(raw,"setup");return{setupId:str2(o,"setup_id"),payerAction:str2(o,"payer_action")}}function cardSetupLinkFromWire(raw){let o=obj(raw,"card_setup");return{url:str2(o,"url")}}function cardActionLinkFromWire(raw){let o=obj(raw,"card_action");return{url:str2(o,"url"),expiresAt:str2(o,"expires_at")}}function planFromWire(raw){let o=obj(raw,"plan");return{planId:str2(o,"plan_id"),lines:arr(o.lines,"plan.lines").map(l=>{let line=obj(l,"plan.line");return{offerId:str2(line,"offer_id"),quantity:int(line,"quantity"),petId:petIdOf(line.pet)}}),cadenceDays:int(o,"cadence_days"),destination:optStr(o,"destination"),paymentMethodId:optStr(o,"payment_method_id"),discountBps:optInt(o,"discount_bps")??0,nextRun:optStr(o,"next_run"),state:str2(o,"state"),stopReason:optStr(o,"stop_reason")}}function planPageFromWire(raw){let o=obj(raw,"plans");return{plans:arr(o.plans,"plans").map(planFromWire),nextCursor:optStr(o,"next_cursor")}}function cartLineToWire(line){let wire={offer_id:line.offerId,quantity:line.quantity};return line.petId&&(wire.pet={namespace:"consumer",pet_id:line.petId}),line.rxId&&(wire.rx_id=line.rxId),wire}function addressInputToWire(input){let a=input.address;return{label:input.label,make_default:input.makeDefault===true,address:{recipient_name:a.recipientName,line1:a.line1,line2:a.line2,city:a.city,region:a.region,postal_code:a.postalCode,country:a.country}}}function cycleReviewFromWire(raw){let o=obj(raw,"cycle"),review=o.review&&typeof o.review=="object"&&!Array.isArray(o.review)?o.review:null,pick=key=>review&&review[key]!==void 0&&review[key]!==null?review[key]:o[key];return{planId:str2(o,"plan_id"),reviewId:optStr(o,"review_id")??(review?optStr(review,"review_id"):null),cycle:int(o,"cycle"),state:review?optStr(review,"state")??optStr(o,"state"):optStr(o,"state"),lines:arr(pick("lines"),"cycle.lines").map(l=>{let line=obj(l,"cycle.line");return{offerId:str2(line,"offer_id"),quantity:int(line,"quantity"),petId:petIdOf(line.pet)}}),shipsOn:review?optStr(review,"ships_on")??optStr(o,"ships_on"):optStr(o,"ships_on"),approveBy:review?optStr(review,"approve_by")??optStr(o,"approve_by"):optStr(o,"approve_by"),quoteLines:arr(o.quote&&typeof o.quote=="object"?o.quote.lines:null,"cycle.quote.lines").map(l=>{let line=obj(l,"cycle.quote.line");return{offerId:str2(line,"offer_id"),quantity:int(line,"quantity"),petId:petIdOf(line.pet),unitPrice:int(line,"unit_price"),discount:optInt(line,"discount")??0,tax:optInt(line,"tax")??0}})}}function cycleDraftFromWire(raw){let o=obj(raw,"cycle-draft");return{checkoutId:str2(o,"checkout_id"),shipping:optInt(o,"shipping")??0,tax:optInt(o,"tax")??0,total:int(o,"total"),expiresAt:optStr(o,"expires_at")}}var DEFAULT_PATH="/api/v1/oms",DEFAULT_TIMEOUT_MS=3e4,PAYMENT_METHOD_ID=/^[A-Za-z0-9_]+$/,REASON_CODE=/^[a-z][a-z0-9_]{0,63}$/;function checkBaseUrl(raw){let url=parseUrl(raw);if(url===null)throw new EverfurConfigError("invalid-argument","createOmsClient: baseUrl is not a URL");let local=url.hostname==="localhost"||url.hostname==="127.0.0.1"||url.hostname==="[::1]";if(url.protocol!=="https:"&&!(local&&url.protocol==="http:"))throw new EverfurConfigError("invalid-argument","createOmsClient: baseUrl must be https");if(url.username||url.password||url.search||url.hash)throw new EverfurConfigError("invalid-argument","createOmsClient: baseUrl must be a bare origin or path");return url.origin+url.pathname.replace(/\/+$/,"")}function seg(id){return encodeURIComponent(id)}function isValidId(id){return typeof id=="string"&&id.length>0&&id.length<=256}function createOmsClient(config){let base=checkBaseUrl(config.baseUrl)+(config.path??DEFAULT_PATH).replace(/\/+$/,""),fetchImpl=config.fetch??(typeof globalThis.fetch=="function"?globalThis.fetch.bind(globalThis):void 0);if(!fetchImpl)throw new EverfurConfigError("missing-peer-dependency","createOmsClient: no fetch available; pass config.fetch");if(!config.auth||config.auth.kind!=="everfur_consumer"||typeof config.auth.getToken!="function")throw new EverfurConfigError("invalid-argument",'createOmsClient: auth must be { kind: "everfur_consumer", getToken }');let getToken=config.auth.getToken,channel=config.channel??"web",timeoutMs=config.timeoutMs??DEFAULT_TIMEOUT_MS;async function token(){try{let t=await getToken();return typeof t=="string"&&t.length>0?t:null}catch{return null}}async function send(call){let bearer=await token();if(!bearer)return omsErr({kind:"signedOut"});let url=base+call.path;if(call.query){let params=new URLSearchParams;for(let[k,v]of Object.entries(call.query))v!==void 0&¶ms.set(k,String(v));let qs=params.toString();qs&&(url+=`?${qs}`)}let headers={accept:"application/json",authorization:`Bearer ${bearer}`},init={method:call.method,headers:headers};call.body!==void 0&&(headers["content-type"]="application/json",init.body=JSON.stringify(call.body));let controller=typeof AbortController=="function"?new AbortController:null;controller&&(init.signal=controller.signal);let timedOut=false,timer=setTimeout(()=>{timedOut=true,controller?.abort()},timeoutMs),res;try{res=await fetchImpl(url,init)}catch{return clearTimeout(timer),omsErr({kind:timedOut?"timeout":"network"})}try{let requestId=res.headers.get("x-request-id")??void 0,rid=requestId?{requestId:requestId}:{};if(res.status<200||res.status>=300){let body=res.status===402||res.status===409||res.status===422?await res.json().catch(()=>null):null;return omsErr(omsErrorFromStatus(res.status,body,{...rid,retryAfter:res.headers.get("retry-after")}))}if(call.read===null||res.status===204)return omsOk(void 0);let raw;try{raw=await res.json()}catch{return omsErr({kind:"badResponse",...rid})}try{return omsOk(call.read(raw))}catch{return omsErr({kind:"badResponse",...rid})}}catch{return omsErr({kind:timedOut?"timeout":"network"})}finally{clearTimeout(timer)}}let invalid=()=>Promise.resolve(omsErr({kind:"invalidRequest"}));function withId(id,run){return isValidId(id)?run(seg(id)):invalid()}let lines=ls=>ls.map(cartLineToWire);return{shopConfig:()=>send({method:"GET",path:"/shop-config",read:shopConfigFromWire}),offers:(q={})=>send({method:"GET",path:"/catalog/offers",query:{text:q.text,requires_rx:q.requiresRx,cursor:q.cursor,limit:q.limit},read:offerPageFromWire}),offer:offerId=>withId(offerId,id=>send({method:"GET",path:`/catalog/offers/${id}`,read:offerFromWire})),prescriptions:()=>send({method:"GET",path:"/prescriptions",read:prescriptionsFromWire}),addresses:()=>send({method:"GET",path:"/addresses",read:addressesFromWire}),address:ref=>withId(ref,id=>send({method:"GET",path:`/addresses/${id}`,read:addressDetailFromWire})),addAddress:input=>send({method:"POST",path:"/addresses",body:addressInputToWire(input),read:addressEntryFromWire}),updateAddress:(ref,input)=>withId(ref,id=>send({method:"PUT",path:`/addresses/${id}`,body:addressInputToWire(input),read:addressEntryFromWire})),removeAddress:ref=>withId(ref,id=>send({method:"DELETE",path:`/addresses/${id}`,read:null})),makeDefaultAddress:ref=>withId(ref,id=>send({method:"POST",path:`/addresses/${id}/default`,read:addressEntryFromWire})),paymentMethods:()=>send({method:"GET",path:"/payment-methods",read:paymentMethodsFromWire}),setupPaymentMethod:()=>send({method:"POST",path:"/payment-methods/setup",read:paymentSetupFromWire}),startCardSetupSession:r=>send({method:"POST",path:"/payment-methods/setup-session",body:{idempotency_key:r.idempotencyKey,return_url:r.returnUrl},read:cardSetupLinkFromWire}),removePaymentMethod:pm=>PAYMENT_METHOD_ID.test(pm)?send({method:"DELETE",path:`/payment-methods/${pm}`,read:null}):invalid(),quote:r=>send({method:"POST",path:"/cart/quote",body:{lines:lines(r.lines),ship_to:r.shipTo,promo_code:r.promoCode??null},read:quoteFromWire}),createCheckout:r=>send({method:"POST",path:"/checkouts",body:{idempotency_key:r.idempotencyKey,channel:channel,lines:lines(r.lines),ship_to:r.shipTo,receipt_email:r.receiptEmail??null,promo_code:r.promoCode??null},read:checkoutFromWire}),confirmCheckout:(checkoutId,r)=>PAYMENT_METHOD_ID.test(r.paymentMethodId)&&Number.isInteger(r.expectedTotal)?withId(checkoutId,id=>send({method:"POST",path:`/checkouts/${id}/confirm`,body:{idempotency_key:r.idempotencyKey,expected_total:r.expectedTotal,payment_method_id:r.paymentMethodId},read:confirmationFromWire})):invalid(),orders:(q={})=>send({method:"GET",path:"/orders",query:{cursor:q.cursor,limit:q.limit,reference:q.reference},read:orderPageFromWire}),order:orderId=>withId(orderId,id=>send({method:"GET",path:`/orders/${id}`,read:orderFromWire})),cancelOrder:(orderId,r)=>REASON_CODE.test(r.reasonCode)?withId(orderId,id=>send({method:"POST",path:`/orders/${id}/cancel`,body:{idempotency_key:r.idempotencyKey,reason_code:r.reasonCode},read:cancelOutcomeFromWire})):invalid(),payOrder:(orderId,r)=>{if(r.paymentMethodId!==void 0&&!PAYMENT_METHOD_ID.test(r.paymentMethodId))return invalid();let body={idempotency_key:r.idempotencyKey};return r.paymentMethodId&&(body.payment_method_id=r.paymentMethodId),withId(orderId,id=>send({method:"POST",path:`/orders/${id}/pay`,body:body,read:payOutcomeFromWire}))},cardActionLink:(orderId,r)=>withId(orderId,id=>send({method:"POST",path:`/orders/${id}/card-action-link`,body:{return_url:r.returnUrl},read:cardActionLinkFromWire})),requestReturn:(orderId,r)=>r.lines.every(l=>REASON_CODE.test(l.reasonCode))?withId(orderId,id=>send({method:"POST",path:`/orders/${id}/returns`,body:{idempotency_key:r.idempotencyKey,lines:r.lines.map(l=>({line_id:l.lineId,quantity:l.quantity,reason_code:l.reasonCode}))},read:returnFromWire})):invalid(),getReturn:returnId=>withId(returnId,id=>send({method:"GET",path:`/returns/${id}`,read:returnFromWire})),cancelReturn:returnId=>withId(returnId,id=>send({method:"POST",path:`/returns/${id}/cancel`,read:returnFromWire})),openCase:(orderId,r)=>REASON_CODE.test(r.reasonCode)&&r.message.length<=4e3?withId(orderId,id=>send({method:"POST",path:`/orders/${id}/cases`,body:{idempotency_key:r.idempotencyKey,reason_code:r.reasonCode,message:r.message},read:caseFromWire})):invalid(),orderCases:orderId=>withId(orderId,id=>send({method:"GET",path:`/orders/${id}/cases`,read:casesFromWire})),plans:(q={})=>send({method:"GET",path:"/subscriptions",query:{cursor:q.cursor,limit:q.limit},read:planPageFromWire}),createPlan:input=>PAYMENT_METHOD_ID.test(input.paymentMethodId)?send({method:"POST",path:"/subscriptions",body:{idempotency_key:input.idempotencyKey,cadence_days:input.cadenceDays,destination:input.destination,payment_method_id:input.paymentMethodId,consent_terms_version:input.consentTermsVersion,lines:lines(input.lines)},read:planFromWire}):invalid(),updatePlan:(planId,patch)=>{if(patch.paymentMethodId!==void 0&&!PAYMENT_METHOD_ID.test(patch.paymentMethodId))return invalid();let body={idempotency_key:patch.idempotencyKey};return patch.lines&&(body.lines=lines(patch.lines)),patch.cadenceDays!==void 0&&(body.cadence_days=patch.cadenceDays),patch.destination!==void 0&&(body.destination=patch.destination),patch.paymentMethodId!==void 0&&(body.payment_method_id=patch.paymentMethodId),withId(planId,id=>send({method:"PATCH",path:`/subscriptions/${id}`,body:body,read:planFromWire}))},planAction:(planId,r)=>withId(planId,id=>send({method:"POST",path:`/subscriptions/${id}/actions`,body:{idempotency_key:r.idempotencyKey,operation:r.operation},read:planFromWire})),cancelPlan:planId=>withId(planId,id=>send({method:"POST",path:`/subscriptions/${id}/cancel`,read:planFromWire})),cycleReview:planId=>withId(planId,id=>send({method:"GET",path:`/subscriptions/${id}/cycle`,read:cycleReviewFromWire})),editCycle:(planId,cycle,r)=>Number.isInteger(cycle)&&cycle>0?withId(planId,id=>send({method:"PUT",path:`/subscriptions/${id}/cycles/${cycle}/lines`,body:{idempotency_key:r.idempotencyKey,lines:lines(r.lines)},read:cycleReviewFromWire})):invalid(),draftCycle:(planId,cycle)=>Number.isInteger(cycle)&&cycle>0?withId(planId,id=>send({method:"POST",path:`/subscriptions/${id}/cycles/${cycle}/draft`,read:cycleDraftFromWire})):invalid(),approveCycle:(planId,cycle,r)=>Number.isInteger(cycle)&&cycle>0&&Number.isInteger(r.expectedTotal)?withId(planId,id=>send({method:"POST",path:`/subscriptions/${id}/cycles/${cycle}/approve`,body:{idempotency_key:r.idempotencyKey,checkout_id:r.checkoutId,expected_total:r.expectedTotal},read:confirmationFromWire})):invalid(),skipCycle:(planId,cycle,r)=>Number.isInteger(cycle)&&cycle>0?withId(planId,id=>send({method:"POST",path:`/subscriptions/${id}/cycles/${cycle}/skip`,body:{idempotency_key:r.idempotencyKey},read:planFromWire})):invalid()}}function step(result){return result.error?{ok:false,message:typeof result.error.message=="string"&&result.error.message.length<=300?result.error.message:null}:{ok:true}}function createStripeJsPayments(stripe,options={}){return{async confirmCardSetup(clientSecret){try{let confirmParams=options.returnUrl?{return_url:options.returnUrl}:void 0;return step(await stripe.confirmSetup({clientSecret:clientSecret,...options.elementsFor?{elements:options.elementsFor(clientSecret)}:{},...confirmParams?{confirmParams:confirmParams}:{},redirect:"if_required"}))}catch{return{ok:false,message:null}}},async handleNextAction(clientSecret){try{return step(await stripe.handleNextAction({clientSecret:clientSecret}))}catch{return{ok:false,message:null}}}}}export{EverfurShop,SHOP_COPY,SHOP_COPY_PLACEHOLDERS,SHOP_V3_COPY,SHOP_V3_COPY_PLACEHOLDERS,UNAVAILABLE_PACKAGE_SOURCE,createOmsClient,createOmsPackageSource,createStripeJsPayments,isOmsRefusal,isOmsRetryable,isOmsUnavailable,newIdempotencyKey,shopCopy,shopV3Copy};
|