@everfur/sdk 1.5.0 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/{bookingCopy.d-BuDv16WP.d.ts → bookingCopy.d-BL2-URcv.d.ts} +3 -2
  2. package/dist/{bookingCopy.d-rnBSqOSN.d.cts → bookingCopy.d-Dfew1pjY.d.cts} +3 -2
  3. package/dist/{chunk-6IHY7HS7.js → chunk-IO4CGYHT.js} +1 -1
  4. package/dist/{chunk-4KFFE42Z.js → chunk-NBAOR5TJ.js} +20 -20
  5. package/dist/{chunk-HHCGXQJR.js → chunk-RD6ZGYEJ.js} +9 -9
  6. package/dist/{chunk-BMYNDBUR.js → chunk-ZYHPCQVM.js} +1 -1
  7. package/dist/client/index.cjs +1 -1
  8. package/dist/client/index.d.cts +2 -2
  9. package/dist/client/index.d.ts +2 -2
  10. package/dist/client/index.js +1 -1
  11. package/dist/core/index.cjs +1 -1
  12. package/dist/core/index.js +1 -1
  13. package/dist/index.cjs +1 -1
  14. package/dist/index.js +1 -1
  15. package/dist/{models.d-BULqCO2R.d.ts → models.d-NAWqF1wC.d.ts} +4 -1
  16. package/dist/{models.d-BKmOfoqV.d.cts → models.d-wJ_Ze4p5.d.cts} +4 -1
  17. package/dist/records/index.cjs +1 -1
  18. package/dist/records/index.js +1 -1
  19. package/dist/server/events/index.cjs +1 -1
  20. package/dist/server/events/index.js +1 -1
  21. package/dist/server/index.cjs +1 -1
  22. package/dist/server/index.js +1 -1
  23. package/dist/tabs/index.cjs +3 -3
  24. package/dist/tabs/index.d.cts +1 -1
  25. package/dist/tabs/index.d.ts +1 -1
  26. package/dist/tabs/index.js +3 -3
  27. package/dist/televet/booking/index.cjs +1 -2
  28. package/dist/televet/booking/index.d.cts +2 -2
  29. package/dist/televet/booking/index.d.ts +2 -2
  30. package/dist/televet/booking/index.js +1 -2
  31. package/dist/web/health-plan/index.cjs +1 -1
  32. package/dist/web/health-plan/index.js +1 -1
  33. package/dist/web/index.cjs +2 -2
  34. package/dist/web/index.js +2 -2
  35. package/dist/web/records-sheet/index.cjs +1 -1
  36. package/dist/web/records-sheet/index.js +1 -1
  37. package/dist/web/shop/index.cjs +1 -1
  38. package/dist/web/shop/index.js +1 -1
  39. package/dist/web/televet/booking/index.cjs +7 -8
  40. package/dist/web/televet/booking/index.d.cts +2 -2
  41. package/dist/web/televet/booking/index.d.ts +2 -2
  42. package/dist/web/televet/booking/index.js +7 -8
  43. package/dist/web/televet/call/index.cjs +1 -1
  44. package/dist/web/televet/call/index.js +1 -1
  45. package/dist/web/ui/index.cjs +1 -1
  46. package/dist/web/ui/index.js +32 -32
  47. package/package.json +1 -1
@@ -134,7 +134,7 @@ return i.jsx(o.Animated.View,{accessibilityElementsHidden:true,importantForAcces
134
134
  return i.jsx(o.Animated.View,{pointerEvents:"none",accessibilityLiveRegion:"polite",style:[e.view(".ph-toast"),{top:Ko},a],testID:"everfur-tabs-toast",children:/* @__PURE__ */i.jsx(Text,{style:e.text(".ph-toast"),children:t})})}function useEverfurIntroSeen(){let{runtime:e,userRef:userRef}=Ie();return r.useMemo(()=>{let t=ve(e),n=e.registry.services.kv;return{shouldPlay:e=>Re({repo:t,kv:n,userRef:userRef,...e===void 0?{}:{signal:e}}),markSeen:()=>je({repo:t,kv:n,userRef:userRef})}},[e,userRef])}var ei=[{key:"look.color.primary",kind:"color",default:"#10462E"},{key:"look.color.on_primary",kind:"color",default:"#FFFFFF"},{key:"look.color.accent",kind:"color",default:"#07C168"},{key:"look.color.tint",kind:"color",default:"#DAF6E8"},{key:"look.color.chips",kind:"hexList",default:["#97E4C0","#F3CD73","#FFC3BC"]},{key:"look.color.surface",kind:"color",default:"#FFFFFF"},{key:"look.color.heading",kind:"color",default:"#10462E"},{key:"look.color.ink",kind:"color",default:"#000000"},{key:"look.color.muted",kind:"color",default:"#6B6B6B"},{key:"look.color.line",kind:"color",default:"#E4E4E4"},{key:"look.color.bubble",kind:"colorOrNone",default:"#10462E"},{key:"look.color.launcher",kind:"color",default:"#10462E"},{key:"look.color.on_launcher",kind:"color",default:"#07C168"},{key:"look.color.dot",kind:"color",default:"#07C168"},{key:"look.chat_wash",kind:"hexList",default:[]},{key:"look.font.heading",kind:"text",default:"Azeret"},{key:"look.font.body",kind:"text",default:"Azeret"},{key:"look.font.chat",kind:"text",default:"body"},{key:"look.font.label",kind:"text",default:"Azeret Mono"},{key:"look.font.heading_weight",kind:"number",default:700,oneOf:[500,600,700,800]},{key:"look.font.files",kind:"fontFiles",default:[{family:"Azeret",weight:"400",url:"brand/fonts/Azeret/Azeret-Regular.woff2"},{family:"Azeret",weight:"500",url:"brand/fonts/Azeret/Azeret-Medium.woff2"},{family:"Azeret",weight:"700",url:"brand/fonts/Azeret/Azeret-Bold.woff2"},{family:"Azeret Mono",weight:"400",url:"brand/fonts/Azeret-Mono/AzeretMono-Regular.woff2"}]},{key:"look.radius.card",kind:"number",default:20,range:[0,28]},{key:"look.radius.sheet",kind:"number",default:28,range:[0,28]},{key:"look.logo.wordmark",kind:"text",default:"brand/guide/img/wordmark-green.png"},{key:"look.logo.mark",kind:"text",default:"brand/guide/img/wordmark-green.png"},{key:"look.ask_icon",kind:"text",default:"everfur-ask"},{key:"look.lockup",kind:"choice",default:"side_by_side",oneOf:["side_by_side","stacked"]},{key:"text.partner_name",kind:"string",default:"Everfur",max:20},{key:"text.ask.name",kind:"string",default:"Everfur",max:16},{key:"text.ask.greeting",kind:"string",default:"What can we help {pet} with today?",max:56},{key:"text.ask.placeholder",kind:"string",default:"Ask anything about {pet}…",max:34},{key:"text.ask.dock_placeholder",kind:"string",default:"Ask {assistant} about {pet}…",max:34},{key:"text.ask.memory_chip",kind:"string",default:"Remembers {pet}",max:22},{key:"text.ask.from_history",kind:"string",default:"From {pet}'s history",max:28},{key:"text.ask.watch_for",kind:"string",default:"Watch for",max:24},{key:"text.ask.new_chat",kind:"string",default:"New chat",max:12},{key:"text.tabs.ask",kind:"string",default:"Ask",max:12},{key:"text.tabs.vet",kind:"string",default:"Vet",max:10},{key:"text.tabs.records",kind:"string",default:"Health",max:16},{key:"text.launcher.tip",kind:"string",default:"New: ask anything about your pets, 24/7.",max:48},{key:"text.nav.page_title",kind:"string",default:"",max:14,emptyOk:true},{key:"text.vet.book",kind:"string",default:"Book a video visit",max:22},{key:"text.vet.booked",kind:"string",default:"{pet}'s visit is booked",max:40},{key:"text.vet.see_times",kind:"string",default:"Find a time",max:16},{key:"text.vet.join",kind:"string",default:"Get ready",max:14},{key:"text.vet.add_calendar",kind:"string",default:"Add to calendar",max:20},{key:"text.records.empty_title",kind:"string",default:"Add {pet}'s records",max:36},{key:"text.records.empty_body",kind:"string",default:"Records can come from more than one clinic over a lifetime.",max:160},{key:"text.records.request",kind:"string",default:"Request from a clinic",max:34},{key:"text.records.upload",kind:"string",default:"Upload a document",max:24},{key:"text.cap.counter",kind:"string",default:"{left} of {cap} free messages left this month",max:48},{key:"text.cap.reached",kind:"string",default:"You've used your {cap} free messages this month.",max:64},{key:"text.cap.button",kind:"string",default:"See {plan}",max:24},{key:"text.members.title",kind:"string",default:"Ask anything about your pets, anytime",max:48},{key:"text.members.badge",kind:"string",default:"Members only",max:32},{key:"text.members.button",kind:"string",default:"Join membership",max:24},{key:"text.ui.not_now",kind:"string",default:"Not now",max:12},{key:"text.notify.records_ready",kind:"string",default:"When records arrive",max:28,reference:true},{key:"text.notify.visit_reminder",kind:"string",default:"Visit reminders",max:28,reference:true},{key:"text.notify.vet_reply",kind:"string",default:"Replies from the vet",max:28,reference:true},{key:"text.notify.care_due",kind:"string",default:"Care that's due",max:28,reference:true},{key:"layout.nav",kind:"choice",default:"bottom_tabs",oneOf:["bottom_tabs","top_tabs","sections_page","chat_first"]},{key:"layout.sections",kind:"itemList",default:["ask","records"],items:["ask","vet","records"]},{key:"layout.vet_on_ask",kind:"choice",default:"top",oneOf:["top","header_button","own_tab","in_answers"]},{key:"layout.vet_badge",kind:"choice",default:"tab_dot",oneOf:["none","header_pill","tab_dot"]},{key:"layout.memory_chip",kind:"boolean",default:false},{key:"layout.severity",kind:"choice",default:"four_levels",oneOf:["off","three_levels","four_levels"]},{key:"layout.suggestions",kind:"choice",default:"center",oneOf:["center","above_bar"]},{key:"layout.opens_on",kind:"choice",default:"new_chat",oneOf:["new_chat","last_chat"]},{key:"layout.answer_byline",kind:"choice",default:"avatar",oneOf:["none","avatar","wordmark"]},{key:"layout.launcher",kind:"choice",default:"none",oneOf:["none","floating_button"]},{key:"layout.presentation",kind:"choice",default:"in_tab",oneOf:["in_tab","full_screen"]},{key:"features.chat",kind:"boolean",default:true},{key:"features.records",kind:"boolean",default:true},{key:"features.video_visits",kind:"boolean",default:true},{key:"features.prescriptions",kind:"boolean",default:true},{key:"features.shop",kind:"choice",default:"everfur_care",oneOf:["off","everfur_care","partner_pick","partner_cart"],reference:true},{key:"features.partner_data",kind:"itemList",default:[],items:["park_checkins","camera_events","dna_results"]},{key:"features.texting",kind:"boolean",default:true,reference:true},{key:"features.texting_cap",kind:"numberOrNull",default:null,range:[1,999],reference:true},{key:"features.notify.records_ready",kind:"boolean",default:true,reference:true},{key:"features.notify.visit_reminder",kind:"boolean",default:true,reference:true},{key:"features.notify.vet_reply",kind:"boolean",default:true,reference:true},{key:"features.notify.care_due",kind:"boolean",default:true,reference:true},{key:"access.mode",kind:"choice",default:"open",oneOf:["open","free_cap","members_only"]},{key:"access.free_messages",kind:"number",default:0,range:[0,50]},{key:"access.locked",kind:"itemList",default:["video_visits"],items:["video_visits","texting","link_records","previous_results","dashboard","goals"]},{key:"plan.name",kind:"string",default:"Everfur Pro",max:20},{key:"plan.sold_by",kind:"choice",default:"everfur",oneOf:["everfur","partner"]},{key:"plan.price_display",kind:"choice",default:"full",oneOf:["full","monthly_equivalent","hidden"]},{key:"plan.price_year",kind:"money",default:"$144.99"},{key:"plan.price_month",kind:"money",default:"$15.00"},{key:"vet.visits_per_year",kind:"numberOrNull",default:null,range:[1,24]},{key:"vet.extra_visit_price",kind:"moneyOrNull",default:null},{key:"vet.name",kind:"string",default:"Licensed Everfur vet",max:28},{key:"vet.title",kind:"string",default:"",max:32,emptyOk:true},{key:"vet.photo",kind:"text",default:"prototypes/televet-photos/r5/vet.jpg"},{key:"units.weight",kind:"choice",default:"lb",oneOf:["lb","kg"]},{key:"units.temperature",kind:"choice",default:"F",oneOf:["F","C"]},{key:"units.distance",kind:"choice",default:"mi",oneOf:["mi","km"],reference:true},{key:"units.currency",kind:"choice",default:"$",oneOf:["$","US$"]}],ti={"look.color.primary":"#10462E","look.color.on_primary":"#FFFFFF","look.color.accent":"#07C168","look.color.tint":"#DAF6E8","look.color.chips":["#97E4C0","#F3CD73","#FFC3BC"],"look.color.surface":"#FFFFFF","look.color.heading":"#10462E","look.color.ink":"#000000","look.color.muted":"#6B6B6B","look.color.line":"#E4E4E4","look.color.bubble":"#10462E","look.color.launcher":"#10462E","look.color.on_launcher":"#07C168","look.color.dot":"#07C168","look.chat_wash":[],"look.font.heading":"Azeret","look.font.body":"Azeret","look.font.chat":"body","look.font.label":"Azeret Mono","look.font.heading_weight":700,"look.font.files":[{family:"Azeret",weight:"400",url:"brand/fonts/Azeret/Azeret-Regular.woff2"},{family:"Azeret",weight:"500",url:"brand/fonts/Azeret/Azeret-Medium.woff2"},{family:"Azeret",weight:"700",url:"brand/fonts/Azeret/Azeret-Bold.woff2"},{family:"Azeret Mono",weight:"400",url:"brand/fonts/Azeret-Mono/AzeretMono-Regular.woff2"}],"look.radius.card":20,"look.radius.sheet":28,"look.logo.wordmark":"brand/guide/img/wordmark-green.png","look.logo.mark":"brand/guide/img/wordmark-green.png","look.ask_icon":"everfur-ask","look.lockup":"side_by_side","text.partner_name":"Everfur","text.ask.name":"Everfur","text.ask.greeting":"What can we help {pet} with today?","text.ask.placeholder":"Ask anything about {pet}…","text.ask.dock_placeholder":"Ask {assistant} about {pet}…","text.ask.memory_chip":"Remembers {pet}","text.ask.from_history":"From {pet}'s history","text.ask.watch_for":"Watch for","text.ask.new_chat":"New chat","text.tabs.ask":"Ask","text.tabs.vet":"Vet","text.tabs.records":"Health","text.launcher.tip":"New: ask anything about your pets, 24/7.","text.nav.page_title":"","text.vet.book":"Book a video visit","text.vet.booked":"{pet}'s visit is booked","text.vet.see_times":"Find a time","text.vet.join":"Get ready","text.vet.add_calendar":"Add to calendar","text.records.empty_title":"Add {pet}'s records","text.records.empty_body":"Records can come from more than one clinic over a lifetime.","text.records.request":"Request from a clinic","text.records.upload":"Upload a document","text.cap.counter":"{left} of {cap} free messages left this month","text.cap.reached":"You've used your {cap} free messages this month.","text.cap.button":"See {plan}","text.members.title":"Ask anything about your pets, anytime","text.members.badge":"Members only","text.members.button":"Join membership","text.ui.not_now":"Not now","text.notify.records_ready":"When records arrive","text.notify.visit_reminder":"Visit reminders","text.notify.vet_reply":"Replies from the vet","text.notify.care_due":"Care that's due","layout.nav":"bottom_tabs","layout.sections":["ask","records"],"layout.vet_on_ask":"top","layout.vet_badge":"tab_dot","layout.memory_chip":false,"layout.severity":"four_levels","layout.suggestions":"center","layout.opens_on":"new_chat","layout.answer_byline":"avatar","layout.launcher":"none","layout.presentation":"in_tab","features.chat":true,"features.records":true,"features.video_visits":true,"features.prescriptions":true,"features.shop":"everfur_care","features.partner_data":[],"features.texting":true,"features.texting_cap":null,"features.notify.records_ready":true,"features.notify.visit_reminder":true,"features.notify.vet_reply":true,"features.notify.care_due":true,"access.mode":"open","access.free_messages":0,"access.locked":["video_visits"],"plan.name":"Everfur Pro","plan.sold_by":"everfur","plan.price_display":"full","plan.price_year":"$144.99","plan.price_month":"$15.00","vet.visits_per_year":null,"vet.extra_visit_price":null,"vet.name":"Licensed Everfur vet","vet.title":"","vet.photo":"prototypes/televet-photos/r5/vet.jpg","units.weight":"lb","units.temperature":"F","units.distance":"mi","units.currency":"$"},ni={"ask.emergency":"Emergency? Call a vet.","ask.privacy":"Confidential. {partner} can't see this chat.","ask.you":"You","ask.today":"Today","ask.follow_ups":"Follow-up questions","ask.attach.photo":"Photo","ask.attach.camera":"Camera","banner.four.0":"Good to know","banner.four.1":"Monitor at home","banner.four.2":"See a vet today","banner.four.3":"Call a vet now","banner.three.0":"All clear","banner.three.1":"Monitor at home","banner.three.2":"See a vet now","banner.body.lowest":"Just general info about {pet}. Nothing here needs action right now.","locked.video_visits":"Video visits with a vet","locked.texting":"Ask by text","locked.link_records":"Link {pet}'s vet records","locked.previous_results":"Previous results","locked.dashboard":"Health dashboard","locked.goals":"Goals for {pet}","plan.price.year":"a year","plan.price.month":"/month","plan.price.billed":"Billed Annually","vet.wellness_tab":"Wellness","vet.opening":"Next opening {when}","vet.next_visit":"Next video visit","vet.badge":"Booked","vet.length":"10 minutes","vet.kind_wellness":"wellness video call","vet.reschedule":"Reschedule","vet.cancel":"Cancel","vet.note":"The vet has {pet}'s records and what you've asked {assistant}. The visit opens right here, 15 minutes before.","vet.book_another":"Book another visit","vet.past_visits":"Past visits","vet.allowance":"{left} of {visits} video visits left this year","vet.extra":"Extra visits are {price} each","vet.gate.visits":"{pet} lives in {state}: a licensed vet can see {them} by video.","vet.gate.wellness":"{pet} lives in {state}: a vet gives general advice by video. No prescriptions.","vet.rx":"Prescriptions, if the vet decides {pet} needs one.","vet.card.when":"Video visit, tomorrow from {when}","vet.card.wellness_when":"Wellness video call, general advice","vet.card.wellness":"A vet can talk it through with you by video: general advice, no exam.","vet.next.text":"We'll text you and send a notification 30 minutes before.","vet.next.notify":"We'll send a notification 30 minutes before.","vet.next.summary":"{pet}'s summary goes to the vet ahead of the call.","vet.next.join":"Join right here in the app. No links to hunt for.","vet.done":"Done","vet.legal":"Video visits are with a licensed veterinarian.","vet.legal.rx":"Prescriptions where allowed, starting with California.","vet.legal.emergency":"In an emergency, go to the nearest emergency animal hospital.","vet.privacy":"Everfur is a separate provider. Your visits and messages are confidential, and {partner} can't see them.","records.status.in_range":"In range","records.status.watch":"Watch","records.vitals.temperature":"Temperature","records.vitals.heart_rate":"Heart rate","records.vitals.weight":"Weight","records.needs":"Needs a look","records.care":"Upcoming care","records.tiles":"Records & history","records.tile.labs":"Labs & bloodwork","records.tile.vaccines":"Vaccines","records.tile.visits":"Visits & records","records.tile.screenings":"Screenings","records.chart.over":"Over","records.chart.under":"Under","records.history":"History","pdata.park_checkins":"Park check-ins","pdata.camera_events":"Camera events","pdata.dna_results":"{partner} DNA","pdata.tag.park_checkins":"Park check-in","pdata.tag.camera_events":"Camera","pdata.tag.dna_results":"{partner} DNA","ask.tag.records":"Records","vet.book_another.for":"For {pet}","upload.title":"Upload a document","upload.body":"A PDF, or a photo of a paper record. Add them all; we sort them by date.","upload.photo":"Take a photo","upload.photo.note":"of a paper record","upload.library":"Choose from photos","upload.file":"Choose a file","upload.file.note":"PDF","load.error":"Couldn't load","load.retry":"Try again"},ri={vetOnAskByNav:{bottom_tabs:["top","own_tab","header_button","in_answers"],top_tabs:["own_tab","header_button","in_answers"],sections_page:["own_tab","in_answers"],chat_first:["header_button","in_answers"]},presentationByNav:{bottom_tabs:["in_tab"],top_tabs:["in_tab","full_screen"],sections_page:["in_tab"],chat_first:["in_tab"]}};function vetLevelFor(e,t){if(t==null||(t.country??"US").toUpperCase()!=="US")return"none";let n=(t.state??"").toUpperCase();return n===""?"none":e.videoAndRx.includes(n)?"visits":e.adviceOnly.includes(n)?"wellness":"none"}function resolveLayout(e,t){let n=[],r=e["layout.nav"],o=e["features.video_visits"]&&t!=="none",i=e["layout.vet_on_ask"],a=ri.vetOnAskByNav[r];e["features.video_visits"]&&!a.includes(i)&&(n.push("layout.vet_on_ask"),i=e["layout.sections"].includes("vet")&&a.includes("own_tab")?"own_tab":"in_answers"),o||(i="none");let l=/* @__PURE__ */new Set,s=[];for(let t of e["layout.sections"]){if(l.has(t)){n.push("layout.sections");continue}l.add(t),!(t==="vet"&&i!=="own_tab")&&(t==="ask"&&!e["features.chat"]||t==="records"&&!e["features.records"]||s.push(t))}i==="own_tab"&&!s.includes("vet")&&s.push("vet"),r==="chat_first"&&!s.includes("ask")&&(n.push("layout.sections"),s.unshift("ask")),s.length===0&&s.push(e["features.records"]&&!e["features.chat"]?"records":"ask");let d=e["layout.presentation"];(!ri.presentationByNav[r].includes(d)||d==="full_screen"&&e["layout.launcher"]!=="floating_button")&&(d!=="in_tab"&&n.push("layout.presentation"),d="in_tab");let c=e["layout.vet_badge"];c==="header_pill"&&d==="full_screen"&&i==="own_tab"&&(c="tab_dot");let u=d==="full_screen"?"close":r==="chat_first"?"down":"none";/* @__PURE__ */
135
135
  return Object.freeze({nav:r,sections:/* @__PURE__ */Object.freeze(s),vetOnAsk:i,vetBadge:c,presentation:d,launcher:e["layout.launcher"]==="floating_button",closeControl:u,adjusted:/* @__PURE__ */Object.freeze([...new Set(n)])})}var oi="your pet",ii=/\{([a-z]+)\}/g;function ai(e,t){return/(^|[.!?]\s+)$/.test(e.slice(0,t))}function fillSdkText(e,t,n={}){let r=typeof n.pet=="string"?n.pet.trim():"",o={partner:t["text.partner_name"],plan:t["plan.name"],assistant:t["text.ask.name"],pet:r===""?void 0:r,cap:String(n.cap??t["access.free_messages"]),left:n.left===void 0?void 0:String(n.left),visits:n.visits===void 0?void 0:String(n.visits),price:n.price,state:n.state,them:n.them??"them",when:n.when};return e.replace(ii,(t,n,r)=>{let i=o[n];return i!==void 0?i:n==="pet"?ai(e,r)?oi.charAt(0).toUpperCase()+oi.slice(1):oi:t})}function sdkText(e,t,n){return fillSdkText(e.settings[t],e.settings,n)}function sdkFixed(e,t,n){return fillSdkText(e.fixedStrings[t],e.settings,n)}function isInsidePartner(e){return e["text.partner_name"]!=="Everfur"}function objectPronoun(e){let t=(e??"").toLowerCase();return t==="female"||t==="f"?"her":t==="male"||t==="m"?"him":"them"}function askAccess(e,t,n){let r=e.settings;if(t==="member")return{kind:"open"};if(r["access.mode"]==="members_only")return{kind:"members_only"};if(r["access.mode"]==="free_cap"){let t=r["access.free_messages"];if(t<1)return{kind:"open"};let o=Math.max(0,t-Math.max(0,Math.floor(n)));return o===0?{kind:"cap_reached",cap:t}:{kind:"counter",left:o,cap:t,line:sdkText(e,"text.cap.counter",{cap:t,left:o})}}return{kind:"open"}}function isLocked(e,t,n){return t==="member"||e.settings["access.mode"]==="open"&&t==="unknown"?false:e.settings["access.locked"].includes(n)}function capMonth(e){let t=e.getUTCMonth()+1;return`${e.getUTCFullYear()}-${t<10?"0":""}${t}`}var li={video_visits:"locked.video_visits",texting:"locked.texting",link_records:"locked.link_records",previous_results:"locked.previous_results",dashboard:"locked.dashboard",goals:"locked.goals"};function formatPrice(e,t){let n=t.replace(/^(US)?\$/,"");return`${e["units.currency"]}${n}`}function priceLines(e){let t=e.settings;switch(t["plan.price_display"]){case"full":return[`${formatPrice(t,t["plan.price_year"])} ${sdkFixed(e,"plan.price.year")}`];case"monthly_equivalent":return[`${formatPrice(t,t["plan.price_month"])}${sdkFixed(e,"plan.price.month")}`,sdkFixed(e,"plan.price.billed")];default:return[]}}function planSheet(e,t){let n=e.settings,r=t===void 0?{}:{pet:t};/* @__PURE__ */
136
136
  return Object.freeze({kind:"plan",title:n["access.mode"]==="free_cap"?sdkText(e,"text.cap.reached",{cap:n["access.free_messages"]}):null,badge:null,price:priceLines(e),locked:n["access.locked"].map(t=>sdkFixed(e,li[t],r)),button:sdkText(e,"text.cap.button"),dismiss:sdkText(e,"text.ui.not_now"),soldBy:n["plan.sold_by"]})}function membersSheet(e){let t=e.settings;/* @__PURE__ */
137
- return Object.freeze({kind:"members",title:sdkText(e,"text.members.title"),badge:sdkText(e,"text.members.badge"),price:priceLines(e),locked:[],button:sdkText(e,"text.members.button"),dismiss:sdkText(e,"text.ui.not_now"),soldBy:t["plan.sold_by"]})}function vetTabLabel(e,t){return t==="wellness"?sdkFixed(e,"vet.wellness_tab"):sdkText(e,"text.tabs.vet")}var si="Licensed Everfur vet";function prescriptionsAllowed(e,t){return e["features.prescriptions"]&&t==="visits"}function vetHome(e,t){let n=e.settings,r=n["vet.name"],o=n["vet.photo"].trim()===""?null:n["vet.photo"],i=r!==si,a=t.pet===void 0?{}:{pet:t.pet},l=n["vet.visits_per_year"],s=l!==null&&t.visitsUsed!==null&&t.visitsUsed!==void 0?sdkFixed(e,"vet.allowance",{left:Math.max(0,l-t.visitsUsed),visits:l}):null,d=n["vet.extra_visit_price"],c=t.stateName?.trim()??"",u={...a,state:c,them:objectPronoun(t.petSex)},p=c!==""&&t.level==="visits"?sdkFixed(e,"vet.gate.visits",u):c!==""&&t.level==="wellness"?sdkFixed(e,"vet.gate.wellness",u):null,f=[sdkFixed(e,"vet.legal")];return n["features.prescriptions"]&&f.push(sdkFixed(e,"vet.legal.rx")),f.push(sdkFixed(e,"vet.legal.emergency")),/* @__PURE__ */Object.freeze({level:t.level,name:r,title:n["vet.title"].trim()===""?null:n["vet.title"],photo:o,initial:o===null&&i?r.trim().charAt(0).toUpperCase():null,book:sdkText(e,"text.vet.book"),seeTimes:sdkText(e,"text.vet.see_times"),allowance:s,extra:d===null?null:sdkFixed(e,"vet.extra",{price:formatPrice(n,d)}),gate:p,rx:prescriptionsAllowed(n,t.level)?sdkFixed(e,"vet.rx",a):null,legal:/* @__PURE__ */Object.freeze(f),privacy:isInsidePartner(n)?sdkFixed(e,"vet.privacy"):null})}function chipInk(e,t){return contrastRatio(t,e)>=contrastRatio("#FFFFFF",e)?t:"#FFFFFF"}function bubbleInk(e,t){return contrastRatio(e,"#FFFFFF")>=contrastRatio(e,t)?"#FFFFFF":t}function buttonFill(e){let t=e["look.color.primary"];return contrastRatio(t,e["look.color.surface"])<1.3?{fill:e["look.color.heading"],ink:"#FFFFFF"}:{fill:t,ink:e["look.color.on_primary"]}}function askFootLines(e){let t=[sdkFixed(e,"ask.emergency")];return isInsidePartner(e.settings)&&t.push(sdkFixed(e,"ask.privacy")),/* @__PURE__ */Object.freeze(t)}function memoryChip(e,t){return e.settings["layout.memory_chip"]?sdkText(e,"text.ask.memory_chip",t===void 0?{}:{pet:t}):null}function partnerDataSources(e){let t={park_checkins:"pdata.park_checkins",camera_events:"pdata.camera_events",dna_results:"pdata.dna_results"};/* @__PURE__ */
137
+ return Object.freeze({kind:"members",title:sdkText(e,"text.members.title"),badge:sdkText(e,"text.members.badge"),price:priceLines(e),locked:[],button:sdkText(e,"text.members.button"),dismiss:sdkText(e,"text.ui.not_now"),soldBy:t["plan.sold_by"]})}function vetTabLabel(e,t){return t==="wellness"?sdkFixed(e,"vet.wellness_tab"):sdkText(e,"text.tabs.vet")}var si="Licensed Everfur vet";function prescriptionsAllowed(e,t){return e["features.prescriptions"]&&t==="visits"}function vetHome(e,t){let n=e.settings,r=n["vet.name"],o=n["vet.photo"].trim()===""?null:n["vet.photo"],i=r!==si,a=t.pet===void 0?{}:{pet:t.pet},l=n["vet.visits_per_year"],s=l!==null&&t.visitsUsed!==null&&t.visitsUsed!==void 0?sdkFixed(e,"vet.allowance",{left:Math.max(0,l-t.visitsUsed),visits:l}):null,d=n["vet.extra_visit_price"],c=t.stateName?.trim()??"",u={...a,state:c,them:objectPronoun(t.petSex)},p=c!==""&&t.level==="visits"?sdkFixed(e,"vet.gate.visits",u):c!==""&&t.level==="wellness"?sdkFixed(e,"vet.gate.wellness",u):null,f=[sdkFixed(e,"vet.legal")];return n["features.prescriptions"]&&f.push(sdkFixed(e,"vet.legal.rx")),f.push(sdkFixed(e,"vet.legal.emergency")),/* @__PURE__ */Object.freeze({level:t.level,name:r,title:n["vet.title"].trim()===""?null:n["vet.title"],photo:o,initial:o===null&&i?r.trim().charAt(0).toUpperCase():null,book:sdkText(e,"text.vet.book"),seeTimes:sdkText(e,"text.vet.see_times"),allowance:s,extra:d===null?null:sdkFixed(e,"vet.extra",{price:formatPrice(n,d)}),gate:p,rx:prescriptionsAllowed(n,t.level)?sdkFixed(e,"vet.rx",a):null,legal:/* @__PURE__ */Object.freeze(f),privacy:isInsidePartner(n)?sdkFixed(e,"vet.privacy"):null})}function chipInk(e,t){return contrastRatio(t,e)>=contrastRatio("#FFFFFF",e)?t:"#FFFFFF"}function bubbleInk(e,t){return contrastRatio(e,"#FFFFFF")>=contrastRatio(e,t)?"#FFFFFF":t}function buttonFill(e){let t=e["look.color.primary"];return contrastRatio(t,e["look.color.surface"])<1.3?{fill:e["look.color.heading"],ink:"#FFFFFF"}:{fill:t,ink:e["look.color.on_primary"]}}function memoryChip(e,t){return e.settings["layout.memory_chip"]?sdkText(e,"text.ask.memory_chip",t===void 0?{}:{pet:t}):null}function partnerDataSources(e){let t={park_checkins:"pdata.park_checkins",camera_events:"pdata.camera_events",dna_results:"pdata.dna_results"};/* @__PURE__ */
138
138
  return Object.freeze(e.settings["features.partner_data"].map(n=>sdkFixed(e,t[n])))}var di="https:\\/\\/sdk(?:-[a-z]+)?\\.everfur\\.com";function ci(e){return e.replace(/[.*+?^${}()|[\]\\/]/g,"\\$&")}var ui=typeof __EVERFUR_BRAND_CDN_ORIGIN__=="string"&&__EVERFUR_BRAND_CDN_ORIGIN__.length>0?ci(__EVERFUR_BRAND_CDN_ORIGIN__):di;var pi=/^#[0-9A-Fa-f]{6}$/,fi=/\{([a-z]+)\}/g;function hi(e){return[...e.matchAll(fi)].map(e=>e[1])}var gi=/* @__PURE__ */new Set(["pet","partner","plan","assistant","cap"]),bi=/* @__PURE__ */new Set(["text.partner_name","text.ask.name","plan.name"]);function mi(e,t){return bi.has(e)?!/[{}]/.test(t):hi(t).every(t=>gi.has(t)||t==="left"&&e==="text.cap.counter")}function yi(e,t){let n=new Set(hi(e));return hi(t).every(e=>n.has(e)||gi.has(e))}var ki=/^(US)?\$\d{1,3}(,\d{3})*(\.\d{2})?$/;function vi(e){return typeof e=="string"&&pi.test(e)}function wi(e){return typeof e=="number"&&Number.isFinite(e)}function xi(e,t){return!(e.range!==void 0&&(t<e.range[0]||t>e.range[1])||e.oneOf!==void 0&&!e.oneOf.includes(t))}var _i=/* @__PURE__ */new RegExp(`^${ui}\\/brand\\/[0-9a-f]{16}\\.woff2$`);function Si(e){if(!Array.isArray(e))return;let t=[];for(let n of e){if(n===null||typeof n!="object")continue;let{family:e,weight:r,url:o}=n;if(typeof e!="string"||e.trim()===""||typeof o!="string"||!_i.test(o))continue;let i=typeof r=="number"?String(r):typeof r=="string"?r:"400";t.push(/* @__PURE__ */Object.freeze({family:e,weight:i,url:o}))}/* @__PURE__ */
139
139
  return Object.freeze(t)}function parseSettingValue(e,t){switch(e.kind){case"color":return vi(t)?t.toUpperCase():void 0;case"colorOrNone":return t==="none"?"none":vi(t)?t.toUpperCase():void 0;case"hexList":{if(!Array.isArray(t))return;let n=t.filter(vi).map(e=>e.toUpperCase());return n.length!==t.length||n.length>4||e.key==="look.color.chips"&&n.length<1||e.key==="look.chat_wash"&&n.length===1?void 0:/* @__PURE__ */Object.freeze(n)}case"fontFiles":return Si(t);case"boolean":return typeof t=="boolean"?t:void 0;case"number":return wi(t)&&xi(e,t)?t:void 0;case"numberOrNull":return t===null?null:wi(t)&&xi(e,t)?t:void 0;case"money":return typeof t=="string"&&ki.test(t)?t:void 0;case"moneyOrNull":return t===null?null:typeof t=="string"&&ki.test(t)?t:void 0;case"choice":return e.oneOf!==void 0&&e.oneOf.includes(t)?t:void 0;case"itemList":{if(!Array.isArray(t))return;let n=e.items??[],r=t.filter(e=>typeof e=="string"&&n.includes(e));return r.length!==t.length||new Set(r).size!==r.length&&e.key!=="layout.sections"?void 0:/* @__PURE__ */Object.freeze([...r])}case"string":return typeof t!="string"||t.trim()===""&&e.emptyOk!==true?void 0:mi(e.key,t)?t:void 0;case"text":return typeof t=="string"?t:void 0;default:return}}function resolveSettings(e){let t=e!==null&&typeof e=="object"&&!Array.isArray(e)?e:{},n={...ti},r=[];for(let e of ei){if(!Object.prototype.hasOwnProperty.call(t,e.key))continue;let o=parseSettingValue(e,t[e.key]);o===void 0?r.push(e.key):n[e.key]=o}return{settings:/* @__PURE__ */Object.freeze(n),rejected:/* @__PURE__ */Object.freeze(r)}}function resolveFixedStrings(e){let t={...ni};if(e!==null&&typeof e=="object"&&!Array.isArray(e))for(let[n,r]of Object.entries(e))!Object.prototype.hasOwnProperty.call(ni,n)||typeof r!="string"||r===""||yi(ni[n],r)&&(t[n]=r);/* @__PURE__ */
140
140
  return Object.freeze(t)}function Ci(e){return Array.isArray(e)?/* @__PURE__ */Object.freeze(e.filter(e=>typeof e=="string").map(e=>e.toUpperCase())):/* @__PURE__ */Object.freeze([])}function parseStateGate(e){let t=e!==null&&typeof e=="object"?e:{};/* @__PURE__ */
@@ -192,8 +192,8 @@ return i.jsxs(o.View,{testID:`everfur-sdk-header-${t.nav}`,children:[
192
192
  return i.jsx(o.View,{accessibilityRole:"tablist",style:{flexDirection:"row",borderBottomWidth:1,borderColor:a["look.color.line"],paddingHorizontal:8},testID:"everfur-sdk-ask-vet-switch",children:["ask","vet"].map(l=>/* @__PURE__ */i.jsx(o.Pressable,{accessibilityRole:"tab",accessibilityState:{selected:n===l},onPress:()=>r(l),style:{minHeight:44,paddingHorizontal:12,justifyContent:"center",borderBottomWidth:2,borderBottomColor:n===l?a["look.color.primary"]:"transparent"},testID:`everfur-sdk-switch-${l}`,children:/* @__PURE__ */i.jsx(Text,{tier:"control",style:{fontFamily:a["look.font.body"],fontSize:15,color:n===l?a["look.color.heading"]:a["look.color.muted"]},children:_a(e,l,t)})},l))})}function VetPill({config:e,layout:t,level:n,waiting:r,onPress:a}){let l=e.settings,s=t.vetBadge==="header_pill"&&r;/* @__PURE__ */
193
193
  return i.jsxs(o.Pressable,{accessibilityRole:"button",onPress:a,style:{flexDirection:"row",alignItems:"center",gap:6,height:32,paddingLeft:10,paddingRight:12,borderRadius:16,backgroundColor:"#FFFFFF",borderWidth:1,borderColor:l["look.color.line"]},testID:"everfur-sdk-vet-pill",children:[s?/* @__PURE__ */i.jsx(o.View,{style:{width:8,height:8,borderRadius:4,backgroundColor:l["look.color.dot"]},testID:"everfur-sdk-vet-pill-dot"}):null,
194
194
  /* @__PURE__ */i.jsx(Text,{tier:"control",style:{fontFamily:l["look.font.body"],fontSize:14,color:l["look.color.heading"]},children:vetTabLabel(e,n)})]})}function PetSwitcher({config:e,host:t,pet:n}){let r=e.settings;return n===null?null:/* @__PURE__ */i.jsxs(o.Pressable,{accessibilityRole:"button",onPress:()=>{if(t.pets.length<2)return;let e=t.pets.findIndex(e=>e.petRef===n.petRef),r=t.pets[(e+1)%t.pets.length];r!==void 0&&t.onPetChange?.(r.petRef)},style:{minHeight:44,flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:8},testID:"everfur-sdk-pet-switcher",children:[
195
- /* @__PURE__ */i.jsx(Text,{tier:"control",numberOfLines:1,style:{fontFamily:r["look.font.body"],fontSize:15,fontWeight:"600",color:r["look.color.heading"]},children:n.name}),t.pets.length>1?/* @__PURE__ */i.jsx(Text,{tier:"control",style:{fontSize:12,color:r["look.color.heading"]},children:"▾"}):null]})}function MemoryRow({config:e,pet:t,withLockup:n=false}){let r=memoryChip(e,t?.name);return r===null&&!n?null:/* @__PURE__ */i.jsxs(o.View,{style:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:8,paddingHorizontal:16,paddingTop:10},testID:"everfur-sdk-memory-row",children:[r!==null?/* @__PURE__ */i.jsx(SdkMemoryChip,{settings:e.settings,label:r}):/* @__PURE__ */i.jsx(o.View,{}),n?/* @__PURE__ */i.jsx(SdkLockup,{settings:e.settings}):null]})}function AskPane({config:t,layout:n,pet:a,level:l,access:s,hooks:d,chat:c,locked:u,onVet:p,onPlan:f}){let h=t.settings,g=h["look.color.heading"],b=r.useMemo(()=>({title:sdkText(t,"text.ask.greeting",a===null?{}:{pet:a.name}),chipTints:h["look.color.chips"].map(e=>({tint:e,ink:chipInk(e,g)}))}),[t,h,g,a]),m=r.useMemo(()=>({chats:xa,newChat:sdkText(t,"text.ask.new_chat")}),[t]),y=s.kind==="members_only"||s.kind==="cap_reached",k=askFootLines(t).filter(e=>e!==sdkFixed(t,"ask.emergency")),v=n.vetOnAsk!=="none"&&l!=="none"?a?.location?.state:void 0;/* @__PURE__ */
196
- return i.jsxs(o.View,{style:{flex:1},testID:"everfur-sdk-ask",children:[y?/* @__PURE__ */i.jsx(o.View,{style:{flex:1,alignItems:"center",justifyContent:"center",padding:24},testID:"everfur-sdk-ask-blocked",children:/* @__PURE__ */i.jsx(o.Pressable,{accessibilityRole:"button",onPress:f,style:{minHeight:44,justifyContent:"center"},children:/* @__PURE__ */i.jsx(Text,{tier:"control",style:{fontFamily:h["look.font.body"],fontSize:15,color:h["look.color.accent"]},children:s.kind==="members_only"?sdkText(t,"text.members.button"):sdkText(t,"text.cap.button")})})}):/* @__PURE__ */i.jsx(Xi.Provider,{value:d,children:/* @__PURE__ */i.jsx(e.EverfurChat,{...c,...a===null?{}:{petRef:a.petRef},...v===void 0?{}:{vetUsState:v},...u("texting")||!h["features.texting"]?{textingEntry:false}:{},...n.vetOnAsk==="none"?{}:{onFindVet:p},emptyState:b,historyBar:m,style:{flex:1}})}),s.kind==="counter"?/* @__PURE__ */i.jsx(Text,{style:{textAlign:"center",fontFamily:h["look.font.label"]==="body"?h["look.font.body"]:h["look.font.label"],fontSize:12,color:h["look.color.muted"],paddingVertical:4},testID:"everfur-sdk-counter",children:s.line}):null,k.map(e=>/* @__PURE__ */i.jsx(Text,{style:{textAlign:"center",fontFamily:h["look.font.body"],fontSize:12,color:h["look.color.muted"],paddingBottom:6,paddingHorizontal:16},testID:"everfur-sdk-ask-privacy",children:e},e))]})}function VetPane({config:e,pet:t,level:n,locked:r,onLocked:a,onAsk:s}){let d=l.useVetVisit({petRef:t?.petRef??null,usState:t?.location?.state??null}),c=vetHome(e,{level:n,...t===null?{}:{pet:t.name,petSex:t.sex??null,visitsUsed:t.visitsUsed??null},...t?.stateName!==void 0?{stateName:t.stateName}:t?.location?.state!==void 0?{stateName:t.location.state}:{}});/* @__PURE__ */
195
+ /* @__PURE__ */i.jsx(Text,{tier:"control",numberOfLines:1,style:{fontFamily:r["look.font.body"],fontSize:15,fontWeight:"600",color:r["look.color.heading"]},children:n.name}),t.pets.length>1?/* @__PURE__ */i.jsx(Text,{tier:"control",style:{fontSize:12,color:r["look.color.heading"]},children:"▾"}):null]})}function MemoryRow({config:e,pet:t,withLockup:n=false}){let r=memoryChip(e,t?.name);return r===null&&!n?null:/* @__PURE__ */i.jsxs(o.View,{style:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:8,paddingHorizontal:16,paddingTop:10},testID:"everfur-sdk-memory-row",children:[r!==null?/* @__PURE__ */i.jsx(SdkMemoryChip,{settings:e.settings,label:r}):/* @__PURE__ */i.jsx(o.View,{}),n?/* @__PURE__ */i.jsx(SdkLockup,{settings:e.settings}):null]})}function AskPane({config:t,layout:n,pet:a,level:l,access:s,hooks:d,chat:c,locked:u,onVet:p,onPlan:f}){let h=t.settings,g=h["look.color.heading"],b=r.useMemo(()=>({title:sdkText(t,"text.ask.greeting",a===null?{}:{pet:a.name}),chipTints:h["look.color.chips"].map(e=>({tint:e,ink:chipInk(e,g)}))}),[t,h,g,a]),m=r.useMemo(()=>({chats:xa,newChat:sdkText(t,"text.ask.new_chat")}),[t]),y=s.kind==="members_only"||s.kind==="cap_reached",k=n.vetOnAsk!=="none"&&l!=="none"?a?.location?.state:void 0;/* @__PURE__ */
196
+ return i.jsxs(o.View,{style:{flex:1},testID:"everfur-sdk-ask",children:[y?/* @__PURE__ */i.jsx(o.View,{style:{flex:1,alignItems:"center",justifyContent:"center",padding:24},testID:"everfur-sdk-ask-blocked",children:/* @__PURE__ */i.jsx(o.Pressable,{accessibilityRole:"button",onPress:f,style:{minHeight:44,justifyContent:"center"},children:/* @__PURE__ */i.jsx(Text,{tier:"control",style:{fontFamily:h["look.font.body"],fontSize:15,color:h["look.color.accent"]},children:s.kind==="members_only"?sdkText(t,"text.members.button"):sdkText(t,"text.cap.button")})})}):/* @__PURE__ */i.jsx(Xi.Provider,{value:d,children:/* @__PURE__ */i.jsx(e.EverfurChat,{...c,...a===null?{}:{petRef:a.petRef},...k===void 0?{}:{vetUsState:k},...u("texting")||!h["features.texting"]?{textingEntry:false}:{},...n.vetOnAsk==="none"?{}:{onFindVet:p},emptyState:b,historyBar:m,style:{flex:1}})}),s.kind==="counter"?/* @__PURE__ */i.jsx(Text,{style:{textAlign:"center",fontFamily:h["look.font.label"]==="body"?h["look.font.body"]:h["look.font.label"],fontSize:12,color:h["look.color.muted"],paddingVertical:4},testID:"everfur-sdk-counter",children:s.line}):null]})}function VetPane({config:e,pet:t,level:n,locked:r,onLocked:a,onAsk:s}){let d=l.useVetVisit({petRef:t?.petRef??null,usState:t?.location?.state??null}),c=vetHome(e,{level:n,...t===null?{}:{pet:t.name,petSex:t.sex??null,visitsUsed:t.visitsUsed??null},...t?.stateName!==void 0?{stateName:t.stateName}:t?.location?.state!==void 0?{stateName:t.location.state}:{}});/* @__PURE__ */
197
197
  return i.jsxs(o.View,{style:{flex:1},children:[
198
198
  /* @__PURE__ */i.jsx(SdkVetHomeView,{config:e,home:c,onBook:()=>{r?a():d.open(t?.petRef??null)},style:{flex:1}}),
199
199
  /* @__PURE__ */i.jsx(SdkDockBar,{config:e,pet:t?.name,onPress:s})]})}function RecordsPane({config:e,host:t,pet:r,vetShown:a,records:l,onPlan:s,onVet:d,locked:c,onAsk:u}){let p=e.settings,f=new Set(p["features.partner_data"]),h=(t.partnerData??[]).filter(e=>f.has(e.source)),g=partnerDataSources(e),b=t=>sdkFixed(e,t==="park_checkins"?"pdata.tag.park_checkins":t==="camera_events"?"pdata.tag.camera_events":"pdata.tag.dna_results");/* @__PURE__ */
@@ -17,7 +17,7 @@ import { EverfurInboxSheetProps } from '@everfur/sdk/notifications/inbox';
17
17
  import { H as HealthPlanPage } from '../focus.d-CLTjm6In.cjs';
18
18
  import { E as EverfurIntroMode, a as EverfurIntroFrame, b as EverfurIntroClose, c as EverfurIntroTabLabels } from '../useIntroSeen.d-BHTJ17FU.cjs';
19
19
  export { d as EverfurIntroExit, e as EverfurIntroSeen, i as isIntroSwipeOut, u as useEverfurIntroSeen } from '../useIntroSeen.d-BHTJ17FU.cjs';
20
- import { e as SdkMembership, g as SdkPetLocation, d as SdkLockable, j as SdkSection } from '../models.d-BKmOfoqV.cjs';
20
+ import { e as SdkMembership, g as SdkPetLocation, d as SdkLockable, j as SdkSection } from '../models.d-wJ_Ze4p5.cjs';
21
21
  import { S as SdkConfigV3 } from '../parse.d-BDZ7ffgj.cjs';
22
22
  import { a as SdkConfigSnapshot } from '../sdkConfigStore.d-C2BAr9kI.cjs';
23
23
  export { b as SdkConfigStatus } from '../sdkConfigStore.d-C2BAr9kI.cjs';
@@ -17,7 +17,7 @@ import { EverfurInboxSheetProps } from '@everfur/sdk/notifications/inbox';
17
17
  import { H as HealthPlanPage } from '../focus.d-u-HYvim0.js';
18
18
  import { E as EverfurIntroMode, a as EverfurIntroFrame, b as EverfurIntroClose, c as EverfurIntroTabLabels } from '../useIntroSeen.d-BHTJ17FU.js';
19
19
  export { d as EverfurIntroExit, e as EverfurIntroSeen, i as isIntroSwipeOut, u as useEverfurIntroSeen } from '../useIntroSeen.d-BHTJ17FU.js';
20
- import { e as SdkMembership, g as SdkPetLocation, d as SdkLockable, j as SdkSection } from '../models.d-BULqCO2R.js';
20
+ import { e as SdkMembership, g as SdkPetLocation, d as SdkLockable, j as SdkSection } from '../models.d-NAWqF1wC.js';
21
21
  import { S as SdkConfigV3 } from '../parse.d-BDZ7ffgj.js';
22
22
  import { a as SdkConfigSnapshot } from '../sdkConfigStore.d-BNCVVEWC.js';
23
23
  export { b as SdkConfigStatus } from '../sdkConfigStore.d-BNCVVEWC.js';
@@ -134,7 +134,7 @@ return z(x.View,{accessibilityElementsHidden:true,importantForAccessibility:"no-
134
134
  return z(x.View,{pointerEvents:"none",accessibilityLiveRegion:"polite",style:[e.view(".ph-toast"),{top:xi},r],testID:"everfur-tabs-toast",children:/* @__PURE__ */z(Text,{style:e.text(".ph-toast"),children:t})})}function useEverfurIntroSeen(){let{runtime:e,userRef:userRef}=st();return c(()=>{let t=Qe(e),n=e.registry.services.kv;return{shouldPlay:e=>rt({repo:t,kv:n,userRef:userRef,...e===void 0?{}:{signal:e}}),markSeen:()=>ot({repo:t,kv:n,userRef:userRef})}},[e,userRef])}var Ei=[{key:"look.color.primary",kind:"color",default:"#10462E"},{key:"look.color.on_primary",kind:"color",default:"#FFFFFF"},{key:"look.color.accent",kind:"color",default:"#07C168"},{key:"look.color.tint",kind:"color",default:"#DAF6E8"},{key:"look.color.chips",kind:"hexList",default:["#97E4C0","#F3CD73","#FFC3BC"]},{key:"look.color.surface",kind:"color",default:"#FFFFFF"},{key:"look.color.heading",kind:"color",default:"#10462E"},{key:"look.color.ink",kind:"color",default:"#000000"},{key:"look.color.muted",kind:"color",default:"#6B6B6B"},{key:"look.color.line",kind:"color",default:"#E4E4E4"},{key:"look.color.bubble",kind:"colorOrNone",default:"#10462E"},{key:"look.color.launcher",kind:"color",default:"#10462E"},{key:"look.color.on_launcher",kind:"color",default:"#07C168"},{key:"look.color.dot",kind:"color",default:"#07C168"},{key:"look.chat_wash",kind:"hexList",default:[]},{key:"look.font.heading",kind:"text",default:"Azeret"},{key:"look.font.body",kind:"text",default:"Azeret"},{key:"look.font.chat",kind:"text",default:"body"},{key:"look.font.label",kind:"text",default:"Azeret Mono"},{key:"look.font.heading_weight",kind:"number",default:700,oneOf:[500,600,700,800]},{key:"look.font.files",kind:"fontFiles",default:[{family:"Azeret",weight:"400",url:"brand/fonts/Azeret/Azeret-Regular.woff2"},{family:"Azeret",weight:"500",url:"brand/fonts/Azeret/Azeret-Medium.woff2"},{family:"Azeret",weight:"700",url:"brand/fonts/Azeret/Azeret-Bold.woff2"},{family:"Azeret Mono",weight:"400",url:"brand/fonts/Azeret-Mono/AzeretMono-Regular.woff2"}]},{key:"look.radius.card",kind:"number",default:20,range:[0,28]},{key:"look.radius.sheet",kind:"number",default:28,range:[0,28]},{key:"look.logo.wordmark",kind:"text",default:"brand/guide/img/wordmark-green.png"},{key:"look.logo.mark",kind:"text",default:"brand/guide/img/wordmark-green.png"},{key:"look.ask_icon",kind:"text",default:"everfur-ask"},{key:"look.lockup",kind:"choice",default:"side_by_side",oneOf:["side_by_side","stacked"]},{key:"text.partner_name",kind:"string",default:"Everfur",max:20},{key:"text.ask.name",kind:"string",default:"Everfur",max:16},{key:"text.ask.greeting",kind:"string",default:"What can we help {pet} with today?",max:56},{key:"text.ask.placeholder",kind:"string",default:"Ask anything about {pet}…",max:34},{key:"text.ask.dock_placeholder",kind:"string",default:"Ask {assistant} about {pet}…",max:34},{key:"text.ask.memory_chip",kind:"string",default:"Remembers {pet}",max:22},{key:"text.ask.from_history",kind:"string",default:"From {pet}'s history",max:28},{key:"text.ask.watch_for",kind:"string",default:"Watch for",max:24},{key:"text.ask.new_chat",kind:"string",default:"New chat",max:12},{key:"text.tabs.ask",kind:"string",default:"Ask",max:12},{key:"text.tabs.vet",kind:"string",default:"Vet",max:10},{key:"text.tabs.records",kind:"string",default:"Health",max:16},{key:"text.launcher.tip",kind:"string",default:"New: ask anything about your pets, 24/7.",max:48},{key:"text.nav.page_title",kind:"string",default:"",max:14,emptyOk:true},{key:"text.vet.book",kind:"string",default:"Book a video visit",max:22},{key:"text.vet.booked",kind:"string",default:"{pet}'s visit is booked",max:40},{key:"text.vet.see_times",kind:"string",default:"Find a time",max:16},{key:"text.vet.join",kind:"string",default:"Get ready",max:14},{key:"text.vet.add_calendar",kind:"string",default:"Add to calendar",max:20},{key:"text.records.empty_title",kind:"string",default:"Add {pet}'s records",max:36},{key:"text.records.empty_body",kind:"string",default:"Records can come from more than one clinic over a lifetime.",max:160},{key:"text.records.request",kind:"string",default:"Request from a clinic",max:34},{key:"text.records.upload",kind:"string",default:"Upload a document",max:24},{key:"text.cap.counter",kind:"string",default:"{left} of {cap} free messages left this month",max:48},{key:"text.cap.reached",kind:"string",default:"You've used your {cap} free messages this month.",max:64},{key:"text.cap.button",kind:"string",default:"See {plan}",max:24},{key:"text.members.title",kind:"string",default:"Ask anything about your pets, anytime",max:48},{key:"text.members.badge",kind:"string",default:"Members only",max:32},{key:"text.members.button",kind:"string",default:"Join membership",max:24},{key:"text.ui.not_now",kind:"string",default:"Not now",max:12},{key:"text.notify.records_ready",kind:"string",default:"When records arrive",max:28,reference:true},{key:"text.notify.visit_reminder",kind:"string",default:"Visit reminders",max:28,reference:true},{key:"text.notify.vet_reply",kind:"string",default:"Replies from the vet",max:28,reference:true},{key:"text.notify.care_due",kind:"string",default:"Care that's due",max:28,reference:true},{key:"layout.nav",kind:"choice",default:"bottom_tabs",oneOf:["bottom_tabs","top_tabs","sections_page","chat_first"]},{key:"layout.sections",kind:"itemList",default:["ask","records"],items:["ask","vet","records"]},{key:"layout.vet_on_ask",kind:"choice",default:"top",oneOf:["top","header_button","own_tab","in_answers"]},{key:"layout.vet_badge",kind:"choice",default:"tab_dot",oneOf:["none","header_pill","tab_dot"]},{key:"layout.memory_chip",kind:"boolean",default:false},{key:"layout.severity",kind:"choice",default:"four_levels",oneOf:["off","three_levels","four_levels"]},{key:"layout.suggestions",kind:"choice",default:"center",oneOf:["center","above_bar"]},{key:"layout.opens_on",kind:"choice",default:"new_chat",oneOf:["new_chat","last_chat"]},{key:"layout.answer_byline",kind:"choice",default:"avatar",oneOf:["none","avatar","wordmark"]},{key:"layout.launcher",kind:"choice",default:"none",oneOf:["none","floating_button"]},{key:"layout.presentation",kind:"choice",default:"in_tab",oneOf:["in_tab","full_screen"]},{key:"features.chat",kind:"boolean",default:true},{key:"features.records",kind:"boolean",default:true},{key:"features.video_visits",kind:"boolean",default:true},{key:"features.prescriptions",kind:"boolean",default:true},{key:"features.shop",kind:"choice",default:"everfur_care",oneOf:["off","everfur_care","partner_pick","partner_cart"],reference:true},{key:"features.partner_data",kind:"itemList",default:[],items:["park_checkins","camera_events","dna_results"]},{key:"features.texting",kind:"boolean",default:true,reference:true},{key:"features.texting_cap",kind:"numberOrNull",default:null,range:[1,999],reference:true},{key:"features.notify.records_ready",kind:"boolean",default:true,reference:true},{key:"features.notify.visit_reminder",kind:"boolean",default:true,reference:true},{key:"features.notify.vet_reply",kind:"boolean",default:true,reference:true},{key:"features.notify.care_due",kind:"boolean",default:true,reference:true},{key:"access.mode",kind:"choice",default:"open",oneOf:["open","free_cap","members_only"]},{key:"access.free_messages",kind:"number",default:0,range:[0,50]},{key:"access.locked",kind:"itemList",default:["video_visits"],items:["video_visits","texting","link_records","previous_results","dashboard","goals"]},{key:"plan.name",kind:"string",default:"Everfur Pro",max:20},{key:"plan.sold_by",kind:"choice",default:"everfur",oneOf:["everfur","partner"]},{key:"plan.price_display",kind:"choice",default:"full",oneOf:["full","monthly_equivalent","hidden"]},{key:"plan.price_year",kind:"money",default:"$144.99"},{key:"plan.price_month",kind:"money",default:"$15.00"},{key:"vet.visits_per_year",kind:"numberOrNull",default:null,range:[1,24]},{key:"vet.extra_visit_price",kind:"moneyOrNull",default:null},{key:"vet.name",kind:"string",default:"Licensed Everfur vet",max:28},{key:"vet.title",kind:"string",default:"",max:32,emptyOk:true},{key:"vet.photo",kind:"text",default:"prototypes/televet-photos/r5/vet.jpg"},{key:"units.weight",kind:"choice",default:"lb",oneOf:["lb","kg"]},{key:"units.temperature",kind:"choice",default:"F",oneOf:["F","C"]},{key:"units.distance",kind:"choice",default:"mi",oneOf:["mi","km"],reference:true},{key:"units.currency",kind:"choice",default:"$",oneOf:["$","US$"]}],Di={"look.color.primary":"#10462E","look.color.on_primary":"#FFFFFF","look.color.accent":"#07C168","look.color.tint":"#DAF6E8","look.color.chips":["#97E4C0","#F3CD73","#FFC3BC"],"look.color.surface":"#FFFFFF","look.color.heading":"#10462E","look.color.ink":"#000000","look.color.muted":"#6B6B6B","look.color.line":"#E4E4E4","look.color.bubble":"#10462E","look.color.launcher":"#10462E","look.color.on_launcher":"#07C168","look.color.dot":"#07C168","look.chat_wash":[],"look.font.heading":"Azeret","look.font.body":"Azeret","look.font.chat":"body","look.font.label":"Azeret Mono","look.font.heading_weight":700,"look.font.files":[{family:"Azeret",weight:"400",url:"brand/fonts/Azeret/Azeret-Regular.woff2"},{family:"Azeret",weight:"500",url:"brand/fonts/Azeret/Azeret-Medium.woff2"},{family:"Azeret",weight:"700",url:"brand/fonts/Azeret/Azeret-Bold.woff2"},{family:"Azeret Mono",weight:"400",url:"brand/fonts/Azeret-Mono/AzeretMono-Regular.woff2"}],"look.radius.card":20,"look.radius.sheet":28,"look.logo.wordmark":"brand/guide/img/wordmark-green.png","look.logo.mark":"brand/guide/img/wordmark-green.png","look.ask_icon":"everfur-ask","look.lockup":"side_by_side","text.partner_name":"Everfur","text.ask.name":"Everfur","text.ask.greeting":"What can we help {pet} with today?","text.ask.placeholder":"Ask anything about {pet}…","text.ask.dock_placeholder":"Ask {assistant} about {pet}…","text.ask.memory_chip":"Remembers {pet}","text.ask.from_history":"From {pet}'s history","text.ask.watch_for":"Watch for","text.ask.new_chat":"New chat","text.tabs.ask":"Ask","text.tabs.vet":"Vet","text.tabs.records":"Health","text.launcher.tip":"New: ask anything about your pets, 24/7.","text.nav.page_title":"","text.vet.book":"Book a video visit","text.vet.booked":"{pet}'s visit is booked","text.vet.see_times":"Find a time","text.vet.join":"Get ready","text.vet.add_calendar":"Add to calendar","text.records.empty_title":"Add {pet}'s records","text.records.empty_body":"Records can come from more than one clinic over a lifetime.","text.records.request":"Request from a clinic","text.records.upload":"Upload a document","text.cap.counter":"{left} of {cap} free messages left this month","text.cap.reached":"You've used your {cap} free messages this month.","text.cap.button":"See {plan}","text.members.title":"Ask anything about your pets, anytime","text.members.badge":"Members only","text.members.button":"Join membership","text.ui.not_now":"Not now","text.notify.records_ready":"When records arrive","text.notify.visit_reminder":"Visit reminders","text.notify.vet_reply":"Replies from the vet","text.notify.care_due":"Care that's due","layout.nav":"bottom_tabs","layout.sections":["ask","records"],"layout.vet_on_ask":"top","layout.vet_badge":"tab_dot","layout.memory_chip":false,"layout.severity":"four_levels","layout.suggestions":"center","layout.opens_on":"new_chat","layout.answer_byline":"avatar","layout.launcher":"none","layout.presentation":"in_tab","features.chat":true,"features.records":true,"features.video_visits":true,"features.prescriptions":true,"features.shop":"everfur_care","features.partner_data":[],"features.texting":true,"features.texting_cap":null,"features.notify.records_ready":true,"features.notify.visit_reminder":true,"features.notify.vet_reply":true,"features.notify.care_due":true,"access.mode":"open","access.free_messages":0,"access.locked":["video_visits"],"plan.name":"Everfur Pro","plan.sold_by":"everfur","plan.price_display":"full","plan.price_year":"$144.99","plan.price_month":"$15.00","vet.visits_per_year":null,"vet.extra_visit_price":null,"vet.name":"Licensed Everfur vet","vet.title":"","vet.photo":"prototypes/televet-photos/r5/vet.jpg","units.weight":"lb","units.temperature":"F","units.distance":"mi","units.currency":"$"},Oi={"ask.emergency":"Emergency? Call a vet.","ask.privacy":"Confidential. {partner} can't see this chat.","ask.you":"You","ask.today":"Today","ask.follow_ups":"Follow-up questions","ask.attach.photo":"Photo","ask.attach.camera":"Camera","banner.four.0":"Good to know","banner.four.1":"Monitor at home","banner.four.2":"See a vet today","banner.four.3":"Call a vet now","banner.three.0":"All clear","banner.three.1":"Monitor at home","banner.three.2":"See a vet now","banner.body.lowest":"Just general info about {pet}. Nothing here needs action right now.","locked.video_visits":"Video visits with a vet","locked.texting":"Ask by text","locked.link_records":"Link {pet}'s vet records","locked.previous_results":"Previous results","locked.dashboard":"Health dashboard","locked.goals":"Goals for {pet}","plan.price.year":"a year","plan.price.month":"/month","plan.price.billed":"Billed Annually","vet.wellness_tab":"Wellness","vet.opening":"Next opening {when}","vet.next_visit":"Next video visit","vet.badge":"Booked","vet.length":"10 minutes","vet.kind_wellness":"wellness video call","vet.reschedule":"Reschedule","vet.cancel":"Cancel","vet.note":"The vet has {pet}'s records and what you've asked {assistant}. The visit opens right here, 15 minutes before.","vet.book_another":"Book another visit","vet.past_visits":"Past visits","vet.allowance":"{left} of {visits} video visits left this year","vet.extra":"Extra visits are {price} each","vet.gate.visits":"{pet} lives in {state}: a licensed vet can see {them} by video.","vet.gate.wellness":"{pet} lives in {state}: a vet gives general advice by video. No prescriptions.","vet.rx":"Prescriptions, if the vet decides {pet} needs one.","vet.card.when":"Video visit, tomorrow from {when}","vet.card.wellness_when":"Wellness video call, general advice","vet.card.wellness":"A vet can talk it through with you by video: general advice, no exam.","vet.next.text":"We'll text you and send a notification 30 minutes before.","vet.next.notify":"We'll send a notification 30 minutes before.","vet.next.summary":"{pet}'s summary goes to the vet ahead of the call.","vet.next.join":"Join right here in the app. No links to hunt for.","vet.done":"Done","vet.legal":"Video visits are with a licensed veterinarian.","vet.legal.rx":"Prescriptions where allowed, starting with California.","vet.legal.emergency":"In an emergency, go to the nearest emergency animal hospital.","vet.privacy":"Everfur is a separate provider. Your visits and messages are confidential, and {partner} can't see them.","records.status.in_range":"In range","records.status.watch":"Watch","records.vitals.temperature":"Temperature","records.vitals.heart_rate":"Heart rate","records.vitals.weight":"Weight","records.needs":"Needs a look","records.care":"Upcoming care","records.tiles":"Records & history","records.tile.labs":"Labs & bloodwork","records.tile.vaccines":"Vaccines","records.tile.visits":"Visits & records","records.tile.screenings":"Screenings","records.chart.over":"Over","records.chart.under":"Under","records.history":"History","pdata.park_checkins":"Park check-ins","pdata.camera_events":"Camera events","pdata.dna_results":"{partner} DNA","pdata.tag.park_checkins":"Park check-in","pdata.tag.camera_events":"Camera","pdata.tag.dna_results":"{partner} DNA","ask.tag.records":"Records","vet.book_another.for":"For {pet}","upload.title":"Upload a document","upload.body":"A PDF, or a photo of a paper record. Add them all; we sort them by date.","upload.photo":"Take a photo","upload.photo.note":"of a paper record","upload.library":"Choose from photos","upload.file":"Choose a file","upload.file.note":"PDF","load.error":"Couldn't load","load.retry":"Try again"},zi={vetOnAskByNav:{bottom_tabs:["top","own_tab","header_button","in_answers"],top_tabs:["own_tab","header_button","in_answers"],sections_page:["own_tab","in_answers"],chat_first:["header_button","in_answers"]},presentationByNav:{bottom_tabs:["in_tab"],top_tabs:["in_tab","full_screen"],sections_page:["in_tab"],chat_first:["in_tab"]}};function vetLevelFor(e,t){if(t==null||(t.country??"US").toUpperCase()!=="US")return"none";let n=(t.state??"").toUpperCase();return n===""?"none":e.videoAndRx.includes(n)?"visits":e.adviceOnly.includes(n)?"wellness":"none"}function resolveLayout(e,t){let n=[],r=e["layout.nav"],o=e["features.video_visits"]&&t!=="none",i=e["layout.vet_on_ask"],a=zi.vetOnAskByNav[r];e["features.video_visits"]&&!a.includes(i)&&(n.push("layout.vet_on_ask"),i=e["layout.sections"].includes("vet")&&a.includes("own_tab")?"own_tab":"in_answers"),o||(i="none");let l=/* @__PURE__ */new Set,s=[];for(let t of e["layout.sections"]){if(l.has(t)){n.push("layout.sections");continue}l.add(t),!(t==="vet"&&i!=="own_tab")&&(t==="ask"&&!e["features.chat"]||t==="records"&&!e["features.records"]||s.push(t))}i==="own_tab"&&!s.includes("vet")&&s.push("vet"),r==="chat_first"&&!s.includes("ask")&&(n.push("layout.sections"),s.unshift("ask")),s.length===0&&s.push(e["features.records"]&&!e["features.chat"]?"records":"ask");let d=e["layout.presentation"];(!zi.presentationByNav[r].includes(d)||d==="full_screen"&&e["layout.launcher"]!=="floating_button")&&(d!=="in_tab"&&n.push("layout.presentation"),d="in_tab");let c=e["layout.vet_badge"];c==="header_pill"&&d==="full_screen"&&i==="own_tab"&&(c="tab_dot");let u=d==="full_screen"?"close":r==="chat_first"?"down":"none";/* @__PURE__ */
135
135
  return Object.freeze({nav:r,sections:/* @__PURE__ */Object.freeze(s),vetOnAsk:i,vetBadge:c,presentation:d,launcher:e["layout.launcher"]==="floating_button",closeControl:u,adjusted:/* @__PURE__ */Object.freeze([...new Set(n)])})}var Pi="your pet",Bi=/\{([a-z]+)\}/g;function Ni(e,t){return/(^|[.!?]\s+)$/.test(e.slice(0,t))}function fillSdkText(e,t,n={}){let r=typeof n.pet=="string"?n.pet.trim():"",o={partner:t["text.partner_name"],plan:t["plan.name"],assistant:t["text.ask.name"],pet:r===""?void 0:r,cap:String(n.cap??t["access.free_messages"]),left:n.left===void 0?void 0:String(n.left),visits:n.visits===void 0?void 0:String(n.visits),price:n.price,state:n.state,them:n.them??"them",when:n.when};return e.replace(Bi,(t,n,r)=>{let i=o[n];return i!==void 0?i:n==="pet"?Ni(e,r)?Pi.charAt(0).toUpperCase()+Pi.slice(1):Pi:t})}function sdkText(e,t,n){return fillSdkText(e.settings[t],e.settings,n)}function sdkFixed(e,t,n){return fillSdkText(e.fixedStrings[t],e.settings,n)}function isInsidePartner(e){return e["text.partner_name"]!=="Everfur"}function objectPronoun(e){let t=(e??"").toLowerCase();return t==="female"||t==="f"?"her":t==="male"||t==="m"?"him":"them"}function askAccess(e,t,n){let r=e.settings;if(t==="member")return{kind:"open"};if(r["access.mode"]==="members_only")return{kind:"members_only"};if(r["access.mode"]==="free_cap"){let t=r["access.free_messages"];if(t<1)return{kind:"open"};let o=Math.max(0,t-Math.max(0,Math.floor(n)));return o===0?{kind:"cap_reached",cap:t}:{kind:"counter",left:o,cap:t,line:sdkText(e,"text.cap.counter",{cap:t,left:o})}}return{kind:"open"}}function isLocked(e,t,n){return t==="member"||e.settings["access.mode"]==="open"&&t==="unknown"?false:e.settings["access.locked"].includes(n)}function capMonth(e){let t=e.getUTCMonth()+1;return`${e.getUTCFullYear()}-${t<10?"0":""}${t}`}var $i={video_visits:"locked.video_visits",texting:"locked.texting",link_records:"locked.link_records",previous_results:"locked.previous_results",dashboard:"locked.dashboard",goals:"locked.goals"};function formatPrice(e,t){let n=t.replace(/^(US)?\$/,"");return`${e["units.currency"]}${n}`}function priceLines(e){let t=e.settings;switch(t["plan.price_display"]){case"full":return[`${formatPrice(t,t["plan.price_year"])} ${sdkFixed(e,"plan.price.year")}`];case"monthly_equivalent":return[`${formatPrice(t,t["plan.price_month"])}${sdkFixed(e,"plan.price.month")}`,sdkFixed(e,"plan.price.billed")];default:return[]}}function planSheet(e,t){let n=e.settings,r=t===void 0?{}:{pet:t};/* @__PURE__ */
136
136
  return Object.freeze({kind:"plan",title:n["access.mode"]==="free_cap"?sdkText(e,"text.cap.reached",{cap:n["access.free_messages"]}):null,badge:null,price:priceLines(e),locked:n["access.locked"].map(t=>sdkFixed(e,$i[t],r)),button:sdkText(e,"text.cap.button"),dismiss:sdkText(e,"text.ui.not_now"),soldBy:n["plan.sold_by"]})}function membersSheet(e){let t=e.settings;/* @__PURE__ */
137
- return Object.freeze({kind:"members",title:sdkText(e,"text.members.title"),badge:sdkText(e,"text.members.badge"),price:priceLines(e),locked:[],button:sdkText(e,"text.members.button"),dismiss:sdkText(e,"text.ui.not_now"),soldBy:t["plan.sold_by"]})}function vetTabLabel(e,t){return t==="wellness"?sdkFixed(e,"vet.wellness_tab"):sdkText(e,"text.tabs.vet")}var Li="Licensed Everfur vet";function prescriptionsAllowed(e,t){return e["features.prescriptions"]&&t==="visits"}function vetHome(e,t){let n=e.settings,r=n["vet.name"],o=n["vet.photo"].trim()===""?null:n["vet.photo"],i=r!==Li,a=t.pet===void 0?{}:{pet:t.pet},l=n["vet.visits_per_year"],s=l!==null&&t.visitsUsed!==null&&t.visitsUsed!==void 0?sdkFixed(e,"vet.allowance",{left:Math.max(0,l-t.visitsUsed),visits:l}):null,d=n["vet.extra_visit_price"],c=t.stateName?.trim()??"",u={...a,state:c,them:objectPronoun(t.petSex)},p=c!==""&&t.level==="visits"?sdkFixed(e,"vet.gate.visits",u):c!==""&&t.level==="wellness"?sdkFixed(e,"vet.gate.wellness",u):null,f=[sdkFixed(e,"vet.legal")];return n["features.prescriptions"]&&f.push(sdkFixed(e,"vet.legal.rx")),f.push(sdkFixed(e,"vet.legal.emergency")),/* @__PURE__ */Object.freeze({level:t.level,name:r,title:n["vet.title"].trim()===""?null:n["vet.title"],photo:o,initial:o===null&&i?r.trim().charAt(0).toUpperCase():null,book:sdkText(e,"text.vet.book"),seeTimes:sdkText(e,"text.vet.see_times"),allowance:s,extra:d===null?null:sdkFixed(e,"vet.extra",{price:formatPrice(n,d)}),gate:p,rx:prescriptionsAllowed(n,t.level)?sdkFixed(e,"vet.rx",a):null,legal:/* @__PURE__ */Object.freeze(f),privacy:isInsidePartner(n)?sdkFixed(e,"vet.privacy"):null})}function chipInk(e,t){return contrastRatio(t,e)>=contrastRatio("#FFFFFF",e)?t:"#FFFFFF"}function bubbleInk(e,t){return contrastRatio(e,"#FFFFFF")>=contrastRatio(e,t)?"#FFFFFF":t}function buttonFill(e){let t=e["look.color.primary"];return contrastRatio(t,e["look.color.surface"])<1.3?{fill:e["look.color.heading"],ink:"#FFFFFF"}:{fill:t,ink:e["look.color.on_primary"]}}function askFootLines(e){let t=[sdkFixed(e,"ask.emergency")];return isInsidePartner(e.settings)&&t.push(sdkFixed(e,"ask.privacy")),/* @__PURE__ */Object.freeze(t)}function memoryChip(e,t){return e.settings["layout.memory_chip"]?sdkText(e,"text.ask.memory_chip",t===void 0?{}:{pet:t}):null}function partnerDataSources(e){let t={park_checkins:"pdata.park_checkins",camera_events:"pdata.camera_events",dna_results:"pdata.dna_results"};/* @__PURE__ */
137
+ return Object.freeze({kind:"members",title:sdkText(e,"text.members.title"),badge:sdkText(e,"text.members.badge"),price:priceLines(e),locked:[],button:sdkText(e,"text.members.button"),dismiss:sdkText(e,"text.ui.not_now"),soldBy:t["plan.sold_by"]})}function vetTabLabel(e,t){return t==="wellness"?sdkFixed(e,"vet.wellness_tab"):sdkText(e,"text.tabs.vet")}var Li="Licensed Everfur vet";function prescriptionsAllowed(e,t){return e["features.prescriptions"]&&t==="visits"}function vetHome(e,t){let n=e.settings,r=n["vet.name"],o=n["vet.photo"].trim()===""?null:n["vet.photo"],i=r!==Li,a=t.pet===void 0?{}:{pet:t.pet},l=n["vet.visits_per_year"],s=l!==null&&t.visitsUsed!==null&&t.visitsUsed!==void 0?sdkFixed(e,"vet.allowance",{left:Math.max(0,l-t.visitsUsed),visits:l}):null,d=n["vet.extra_visit_price"],c=t.stateName?.trim()??"",u={...a,state:c,them:objectPronoun(t.petSex)},p=c!==""&&t.level==="visits"?sdkFixed(e,"vet.gate.visits",u):c!==""&&t.level==="wellness"?sdkFixed(e,"vet.gate.wellness",u):null,f=[sdkFixed(e,"vet.legal")];return n["features.prescriptions"]&&f.push(sdkFixed(e,"vet.legal.rx")),f.push(sdkFixed(e,"vet.legal.emergency")),/* @__PURE__ */Object.freeze({level:t.level,name:r,title:n["vet.title"].trim()===""?null:n["vet.title"],photo:o,initial:o===null&&i?r.trim().charAt(0).toUpperCase():null,book:sdkText(e,"text.vet.book"),seeTimes:sdkText(e,"text.vet.see_times"),allowance:s,extra:d===null?null:sdkFixed(e,"vet.extra",{price:formatPrice(n,d)}),gate:p,rx:prescriptionsAllowed(n,t.level)?sdkFixed(e,"vet.rx",a):null,legal:/* @__PURE__ */Object.freeze(f),privacy:isInsidePartner(n)?sdkFixed(e,"vet.privacy"):null})}function chipInk(e,t){return contrastRatio(t,e)>=contrastRatio("#FFFFFF",e)?t:"#FFFFFF"}function bubbleInk(e,t){return contrastRatio(e,"#FFFFFF")>=contrastRatio(e,t)?"#FFFFFF":t}function buttonFill(e){let t=e["look.color.primary"];return contrastRatio(t,e["look.color.surface"])<1.3?{fill:e["look.color.heading"],ink:"#FFFFFF"}:{fill:t,ink:e["look.color.on_primary"]}}function memoryChip(e,t){return e.settings["layout.memory_chip"]?sdkText(e,"text.ask.memory_chip",t===void 0?{}:{pet:t}):null}function partnerDataSources(e){let t={park_checkins:"pdata.park_checkins",camera_events:"pdata.camera_events",dna_results:"pdata.dna_results"};/* @__PURE__ */
138
138
  return Object.freeze(e.settings["features.partner_data"].map(n=>sdkFixed(e,t[n])))}var ji="https:\\/\\/sdk(?:-[a-z]+)?\\.everfur\\.com";function Wi(e){return e.replace(/[.*+?^${}()|[\]\\/]/g,"\\$&")}var Ui=typeof __EVERFUR_BRAND_CDN_ORIGIN__=="string"&&__EVERFUR_BRAND_CDN_ORIGIN__.length>0?Wi(__EVERFUR_BRAND_CDN_ORIGIN__):ji;var Vi=/^#[0-9A-Fa-f]{6}$/,Mi=/\{([a-z]+)\}/g;function qi(e){return[...e.matchAll(Mi)].map(e=>e[1])}var Hi=/* @__PURE__ */new Set(["pet","partner","plan","assistant","cap"]),Ki=/* @__PURE__ */new Set(["text.partner_name","text.ask.name","plan.name"]);function Yi(e,t){return Ki.has(e)?!/[{}]/.test(t):qi(t).every(t=>Hi.has(t)||t==="left"&&e==="text.cap.counter")}function Gi(e,t){let n=new Set(qi(e));return qi(t).every(e=>n.has(e)||Hi.has(e))}var Ji=/^(US)?\$\d{1,3}(,\d{3})*(\.\d{2})?$/;function Qi(e){return typeof e=="string"&&Vi.test(e)}function Zi(e){return typeof e=="number"&&Number.isFinite(e)}function Xi(e,t){return!(e.range!==void 0&&(t<e.range[0]||t>e.range[1])||e.oneOf!==void 0&&!e.oneOf.includes(t))}var ea=/* @__PURE__ */new RegExp(`^${Ui}\\/brand\\/[0-9a-f]{16}\\.woff2$`);function ta(e){if(!Array.isArray(e))return;let t=[];for(let n of e){if(n===null||typeof n!="object")continue;let{family:e,weight:r,url:o}=n;if(typeof e!="string"||e.trim()===""||typeof o!="string"||!ea.test(o))continue;let i=typeof r=="number"?String(r):typeof r=="string"?r:"400";t.push(/* @__PURE__ */Object.freeze({family:e,weight:i,url:o}))}/* @__PURE__ */
139
139
  return Object.freeze(t)}function parseSettingValue(e,t){switch(e.kind){case"color":return Qi(t)?t.toUpperCase():void 0;case"colorOrNone":return t==="none"?"none":Qi(t)?t.toUpperCase():void 0;case"hexList":{if(!Array.isArray(t))return;let n=t.filter(Qi).map(e=>e.toUpperCase());return n.length!==t.length||n.length>4||e.key==="look.color.chips"&&n.length<1||e.key==="look.chat_wash"&&n.length===1?void 0:/* @__PURE__ */Object.freeze(n)}case"fontFiles":return ta(t);case"boolean":return typeof t=="boolean"?t:void 0;case"number":return Zi(t)&&Xi(e,t)?t:void 0;case"numberOrNull":return t===null?null:Zi(t)&&Xi(e,t)?t:void 0;case"money":return typeof t=="string"&&Ji.test(t)?t:void 0;case"moneyOrNull":return t===null?null:typeof t=="string"&&Ji.test(t)?t:void 0;case"choice":return e.oneOf!==void 0&&e.oneOf.includes(t)?t:void 0;case"itemList":{if(!Array.isArray(t))return;let n=e.items??[],r=t.filter(e=>typeof e=="string"&&n.includes(e));return r.length!==t.length||new Set(r).size!==r.length&&e.key!=="layout.sections"?void 0:/* @__PURE__ */Object.freeze([...r])}case"string":return typeof t!="string"||t.trim()===""&&e.emptyOk!==true?void 0:Yi(e.key,t)?t:void 0;case"text":return typeof t=="string"?t:void 0;default:return}}function resolveSettings(e){let t=e!==null&&typeof e=="object"&&!Array.isArray(e)?e:{},n={...Di},r=[];for(let e of Ei){if(!Object.prototype.hasOwnProperty.call(t,e.key))continue;let o=parseSettingValue(e,t[e.key]);o===void 0?r.push(e.key):n[e.key]=o}return{settings:/* @__PURE__ */Object.freeze(n),rejected:/* @__PURE__ */Object.freeze(r)}}function resolveFixedStrings(e){let t={...Oi};if(e!==null&&typeof e=="object"&&!Array.isArray(e))for(let[n,r]of Object.entries(e))!Object.prototype.hasOwnProperty.call(Oi,n)||typeof r!="string"||r===""||Gi(Oi[n],r)&&(t[n]=r);/* @__PURE__ */
140
140
  return Object.freeze(t)}function na(e){return Array.isArray(e)?/* @__PURE__ */Object.freeze(e.filter(e=>typeof e=="string").map(e=>e.toUpperCase())):/* @__PURE__ */Object.freeze([])}function parseStateGate(e){let t=e!==null&&typeof e=="object"?e:{};/* @__PURE__ */
@@ -192,8 +192,8 @@ return P(y,{testID:`everfur-sdk-header-${t.nav}`,children:[
192
192
  return z(y,{accessibilityRole:"tablist",style:{flexDirection:"row",borderBottomWidth:1,borderColor:o["look.color.line"],paddingHorizontal:8},testID:"everfur-sdk-ask-vet-switch",children:["ask","vet"].map(i=>/* @__PURE__ */z(v,{accessibilityRole:"tab",accessibilityState:{selected:n===i},onPress:()=>r(i),style:{minHeight:44,paddingHorizontal:12,justifyContent:"center",borderBottomWidth:2,borderBottomColor:n===i?o["look.color.primary"]:"transparent"},testID:`everfur-sdk-switch-${i}`,children:/* @__PURE__ */z(Text,{tier:"control",style:{fontFamily:o["look.font.body"],fontSize:15,color:n===i?o["look.color.heading"]:o["look.color.muted"]},children:el(e,i,t)})},i))})}function VetPill({config:e,layout:t,level:n,waiting:r,onPress:o}){let i=e.settings,a=t.vetBadge==="header_pill"&&r;/* @__PURE__ */
193
193
  return P(v,{accessibilityRole:"button",onPress:o,style:{flexDirection:"row",alignItems:"center",gap:6,height:32,paddingLeft:10,paddingRight:12,borderRadius:16,backgroundColor:"#FFFFFF",borderWidth:1,borderColor:i["look.color.line"]},testID:"everfur-sdk-vet-pill",children:[a?/* @__PURE__ */z(y,{style:{width:8,height:8,borderRadius:4,backgroundColor:i["look.color.dot"]},testID:"everfur-sdk-vet-pill-dot"}):null,
194
194
  /* @__PURE__ */z(Text,{tier:"control",style:{fontFamily:i["look.font.body"],fontSize:14,color:i["look.color.heading"]},children:vetTabLabel(e,n)})]})}function PetSwitcher({config:e,host:t,pet:n}){let r=e.settings;return n===null?null:/* @__PURE__ */P(v,{accessibilityRole:"button",onPress:()=>{if(t.pets.length<2)return;let e=t.pets.findIndex(e=>e.petRef===n.petRef),r=t.pets[(e+1)%t.pets.length];r!==void 0&&t.onPetChange?.(r.petRef)},style:{minHeight:44,flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:8},testID:"everfur-sdk-pet-switcher",children:[
195
- /* @__PURE__ */z(Text,{tier:"control",numberOfLines:1,style:{fontFamily:r["look.font.body"],fontSize:15,fontWeight:"600",color:r["look.color.heading"]},children:n.name}),t.pets.length>1?/* @__PURE__ */z(Text,{tier:"control",style:{fontSize:12,color:r["look.color.heading"]},children:"▾"}):null]})}function MemoryRow({config:e,pet:t,withLockup:n=false}){let r=memoryChip(e,t?.name);return r===null&&!n?null:/* @__PURE__ */P(y,{style:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:8,paddingHorizontal:16,paddingTop:10},testID:"everfur-sdk-memory-row",children:[r!==null?/* @__PURE__ */z(SdkMemoryChip,{settings:e.settings,label:r}):/* @__PURE__ */z(y,{}),n?/* @__PURE__ */z(SdkLockup,{settings:e.settings}):null]})}function AskPane({config:t,layout:n,pet:r,level:o,access:i,hooks:a,chat:l,locked:s,onVet:d,onPlan:u}){let p=t.settings,f=p["look.color.heading"],h=c(()=>({title:sdkText(t,"text.ask.greeting",r===null?{}:{pet:r.name}),chipTints:p["look.color.chips"].map(e=>({tint:e,ink:chipInk(e,f)}))}),[t,p,f,r]),g=c(()=>({chats:Xa,newChat:sdkText(t,"text.ask.new_chat")}),[t]),b=i.kind==="members_only"||i.kind==="cap_reached",m=askFootLines(t).filter(e=>e!==sdkFixed(t,"ask.emergency")),k=n.vetOnAsk!=="none"&&o!=="none"?r?.location?.state:void 0;/* @__PURE__ */
196
- return P(y,{style:{flex:1},testID:"everfur-sdk-ask",children:[b?/* @__PURE__ */z(y,{style:{flex:1,alignItems:"center",justifyContent:"center",padding:24},testID:"everfur-sdk-ask-blocked",children:/* @__PURE__ */z(v,{accessibilityRole:"button",onPress:u,style:{minHeight:44,justifyContent:"center"},children:/* @__PURE__ */z(Text,{tier:"control",style:{fontFamily:p["look.font.body"],fontSize:15,color:p["look.color.accent"]},children:i.kind==="members_only"?sdkText(t,"text.members.button"):sdkText(t,"text.cap.button")})})}):/* @__PURE__ */z(Ta.Provider,{value:a,children:/* @__PURE__ */z(e,{...l,...r===null?{}:{petRef:r.petRef},...k===void 0?{}:{vetUsState:k},...s("texting")||!p["features.texting"]?{textingEntry:false}:{},...n.vetOnAsk==="none"?{}:{onFindVet:d},emptyState:h,historyBar:g,style:{flex:1}})}),i.kind==="counter"?/* @__PURE__ */z(Text,{style:{textAlign:"center",fontFamily:p["look.font.label"]==="body"?p["look.font.body"]:p["look.font.label"],fontSize:12,color:p["look.color.muted"],paddingVertical:4},testID:"everfur-sdk-counter",children:i.line}):null,m.map(e=>/* @__PURE__ */z(Text,{style:{textAlign:"center",fontFamily:p["look.font.body"],fontSize:12,color:p["look.color.muted"],paddingBottom:6,paddingHorizontal:16},testID:"everfur-sdk-ask-privacy",children:e},e))]})}function VetPane({config:e,pet:t,level:n,locked:r,onLocked:o,onAsk:i}){let a=useVetVisit({petRef:t?.petRef??null,usState:t?.location?.state??null}),l=vetHome(e,{level:n,...t===null?{}:{pet:t.name,petSex:t.sex??null,visitsUsed:t.visitsUsed??null},...t?.stateName!==void 0?{stateName:t.stateName}:t?.location?.state!==void 0?{stateName:t.location.state}:{}});/* @__PURE__ */
195
+ /* @__PURE__ */z(Text,{tier:"control",numberOfLines:1,style:{fontFamily:r["look.font.body"],fontSize:15,fontWeight:"600",color:r["look.color.heading"]},children:n.name}),t.pets.length>1?/* @__PURE__ */z(Text,{tier:"control",style:{fontSize:12,color:r["look.color.heading"]},children:"▾"}):null]})}function MemoryRow({config:e,pet:t,withLockup:n=false}){let r=memoryChip(e,t?.name);return r===null&&!n?null:/* @__PURE__ */P(y,{style:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:8,paddingHorizontal:16,paddingTop:10},testID:"everfur-sdk-memory-row",children:[r!==null?/* @__PURE__ */z(SdkMemoryChip,{settings:e.settings,label:r}):/* @__PURE__ */z(y,{}),n?/* @__PURE__ */z(SdkLockup,{settings:e.settings}):null]})}function AskPane({config:t,layout:n,pet:r,level:o,access:i,hooks:a,chat:l,locked:s,onVet:d,onPlan:u}){let p=t.settings,f=p["look.color.heading"],h=c(()=>({title:sdkText(t,"text.ask.greeting",r===null?{}:{pet:r.name}),chipTints:p["look.color.chips"].map(e=>({tint:e,ink:chipInk(e,f)}))}),[t,p,f,r]),g=c(()=>({chats:Xa,newChat:sdkText(t,"text.ask.new_chat")}),[t]),b=i.kind==="members_only"||i.kind==="cap_reached",m=n.vetOnAsk!=="none"&&o!=="none"?r?.location?.state:void 0;/* @__PURE__ */
196
+ return P(y,{style:{flex:1},testID:"everfur-sdk-ask",children:[b?/* @__PURE__ */z(y,{style:{flex:1,alignItems:"center",justifyContent:"center",padding:24},testID:"everfur-sdk-ask-blocked",children:/* @__PURE__ */z(v,{accessibilityRole:"button",onPress:u,style:{minHeight:44,justifyContent:"center"},children:/* @__PURE__ */z(Text,{tier:"control",style:{fontFamily:p["look.font.body"],fontSize:15,color:p["look.color.accent"]},children:i.kind==="members_only"?sdkText(t,"text.members.button"):sdkText(t,"text.cap.button")})})}):/* @__PURE__ */z(Ta.Provider,{value:a,children:/* @__PURE__ */z(e,{...l,...r===null?{}:{petRef:r.petRef},...m===void 0?{}:{vetUsState:m},...s("texting")||!p["features.texting"]?{textingEntry:false}:{},...n.vetOnAsk==="none"?{}:{onFindVet:d},emptyState:h,historyBar:g,style:{flex:1}})}),i.kind==="counter"?/* @__PURE__ */z(Text,{style:{textAlign:"center",fontFamily:p["look.font.label"]==="body"?p["look.font.body"]:p["look.font.label"],fontSize:12,color:p["look.color.muted"],paddingVertical:4},testID:"everfur-sdk-counter",children:i.line}):null]})}function VetPane({config:e,pet:t,level:n,locked:r,onLocked:o,onAsk:i}){let a=useVetVisit({petRef:t?.petRef??null,usState:t?.location?.state??null}),l=vetHome(e,{level:n,...t===null?{}:{pet:t.name,petSex:t.sex??null,visitsUsed:t.visitsUsed??null},...t?.stateName!==void 0?{stateName:t.stateName}:t?.location?.state!==void 0?{stateName:t.location.state}:{}});/* @__PURE__ */
197
197
  return P(y,{style:{flex:1},children:[
198
198
  /* @__PURE__ */z(SdkVetHomeView,{config:e,home:l,onBook:()=>{r?o():a.open(t?.petRef??null)},style:{flex:1}}),
199
199
  /* @__PURE__ */z(SdkDockBar,{config:e,pet:t?.name,onPress:i})]})}function RecordsPane({config:e,host:t,pet:n,vetShown:r,records:i,onPlan:a,onVet:l,locked:s,onAsk:d}){let c=e.settings,u=new Set(c["features.partner_data"]),p=(t.partnerData??[]).filter(e=>u.has(e.source)),f=partnerDataSources(e),h=t=>sdkFixed(e,t==="park_checkins"?"pdata.tag.park_checkins":t==="camera_events"?"pdata.tag.camera_events":"pdata.tag.dna_results");/* @__PURE__ */
@@ -319,8 +319,7 @@ return r.jsxs(t.View,{style:[c.screen,s],testID:"televet-vet-thread",children:[
319
319
  /* @__PURE__ */r.jsx(TelevetSkeletonBlock,{height:56})]}):p.status==="error"?/* @__PURE__ */r.jsx(TelevetStateCard,{title:$a.loadFailed,actionLabel:$a.retry,onAction:p.retry,testID:"televet-vet-thread-error"}):/* @__PURE__ */r.jsxs(t.ScrollView,{ref:m,accessibilityLabel:Wa($a.threadLogTemplate,{vet:v}),contentContainerStyle:d.log,scrollEventThrottle:64,keyboardShouldPersistTaps:"handled",keyboardDismissMode:g?"interactive":"on-drag",onScroll:e=>{e.nativeEvent.contentOffset.y<=Ts&&p.loadOlder()},testID:"televet-vet-thread-log",children:[p.messages.length===0?/* @__PURE__ */r.jsx(Text,{style:d.system,children:$a.empty}):null,p.messages.map((e,t)=>/* @__PURE__ */r.jsx(ThreadItem,{message:e,previous:p.messages[t-1],vet:v,styles:d},e.messageId))]}),p.status==="ready"&&p.canWrite?/* @__PURE__ */r.jsxs(t.View,{style:c.stack,children:[
320
320
  /* @__PURE__ */r.jsxs(t.View,{style:d.composer,children:[
321
321
  /* @__PURE__ */r.jsx(Cr,{value:h,onChangeText:f,multiline:true,accessibilityLabel:Ua(Wa($a.composerLabelTemplateNative,{vet:v})),placeholder:Wa($a.composerPlaceholderTemplate,{vet:v}),style:d.field,testID:"televet-vet-thread-field"}),
322
- /* @__PURE__ */r.jsx(t.Pressable,{onPress:T,disabled:!k,accessibilityRole:"button",accessibilityLabel:$a.send,accessibilityState:{disabled:!k,busy:p.sending},style:[d.send,k?null:d.sendDisabled],testID:"televet-vet-thread-send",children:/* @__PURE__ */r.jsx(Text,{tier:"control",style:d.sendLabel,children:$a.send})})]}),p.sendFailure==="notSent"?/* @__PURE__ */r.jsx(Text,{style:d.failure,accessibilityLiveRegion:"assertive",testID:"televet-vet-thread-failure",children:$a.notSent}):p.sentCount>0?/* @__PURE__ */r.jsx(Text,{style:d.note,accessibilityLiveRegion:"polite",testID:"televet-vet-thread-status",children:$a.sent}):null,
323
- /* @__PURE__ */r.jsx(Text,{style:d.note,children:Ua(Wa($a.composerNoteTemplate,{vet:v}))})]}):null,p.sendFailure==="vetWritesFirst"?/* @__PURE__ */r.jsx(Text,{style:d.note,accessibilityLiveRegion:"polite",testID:"televet-vet-thread-vet-first",children:$a.vetWritesFirst}):null]})]})}function ThreadItem({message:e,previous:n,vet:l,styles:i}){let o=ii(e.createdAt),a=n===void 0||ii(n.createdAt)!==o,s=e.attachmentCount>0?Wa($a.attachmentsTemplate,{n:String(e.attachmentCount)}):null;/* @__PURE__ */
322
+ /* @__PURE__ */r.jsx(t.Pressable,{onPress:T,disabled:!k,accessibilityRole:"button",accessibilityLabel:$a.send,accessibilityState:{disabled:!k,busy:p.sending},style:[d.send,k?null:d.sendDisabled],testID:"televet-vet-thread-send",children:/* @__PURE__ */r.jsx(Text,{tier:"control",style:d.sendLabel,children:$a.send})})]}),p.sendFailure==="notSent"?/* @__PURE__ */r.jsx(Text,{style:d.failure,accessibilityLiveRegion:"assertive",testID:"televet-vet-thread-failure",children:$a.notSent}):p.sentCount>0?/* @__PURE__ */r.jsx(Text,{style:d.note,accessibilityLiveRegion:"polite",testID:"televet-vet-thread-status",children:$a.sent}):null]}):null,p.sendFailure==="vetWritesFirst"?/* @__PURE__ */r.jsx(Text,{style:d.note,accessibilityLiveRegion:"polite",testID:"televet-vet-thread-vet-first",children:$a.vetWritesFirst}):null]})]})}function ThreadItem({message:e,previous:n,vet:l,styles:i}){let o=ii(e.createdAt),a=n===void 0||ii(n.createdAt)!==o,s=e.attachmentCount>0?Wa($a.attachmentsTemplate,{n:String(e.attachmentCount)}):null;/* @__PURE__ */
324
323
  return r.jsxs(r.Fragment,{children:[a?/* @__PURE__ */r.jsx(Text,{style:i.day,children:o}):null,e.role==="system"?/* @__PURE__ */r.jsx(Text,{style:i.system,children:e.content}):/* @__PURE__ */r.jsxs(t.View,{style:[i.item,e.role==="owner"?i.itemMine:null],testID:`televet-vet-thread-message-${e.messageId}`,children:[e.role==="vet"?/* @__PURE__ */r.jsxs(t.View,{style:i.whoRow,children:[
325
324
  /* @__PURE__ */r.jsx(Text,{style:i.who,children:e.senderName??Ua(l)}),
326
325
  /* @__PURE__ */r.jsx(Text,{style:i.time,children:ri(e.createdAt)})]}):null,e.content.length>0?/* @__PURE__ */r.jsx(Text,{style:e.role==="owner"?i.bubbleMine:i.bubbleVet,children:e.content}):null,s?/* @__PURE__ */r.jsx(Text,{style:i.attachments,children:s}):null]})]})}function ws(e){for(let t=e.length-1;t>=0;t-=1){let n=e[t]?.role==="vet"?e[t]?.senderName:null;if(n)return n}return null}function TelevetVisitSummaryScreen({consult:e,controller:n,onBack:l,onMessageVet:i,onBook:o,style:a}){let s=Qa(),c=es(),d=useTelevetBookingController(n),u=useVisitSummary(d,e.consultId),{pets:p}=useEverfurPets(),h=Ia(p,e.petId),f=u.summary,m=f?.approvedByName??e.clinicianName,g=qa(m),y=h&&e.clinicianName?Wa(Ga.visitTitleTemplate,{pet:h,vet:e.clinicianName}):Ua(Ka(h)),b=[li(e.scheduledAt),m].filter(Boolean).join(" · "),v=vetThreadPetRef(p,e.petId),x=i&&v!==null?()=>i({petRef:v,petName:h,vetName:m??null}):void 0;/* @__PURE__ */
@@ -3,8 +3,8 @@ import { ReactNode, ComponentType, ReactElement } from 'react';
3
3
  import { StyleProp, ViewStyle } from 'react-native';
4
4
  import { P as PetRef } from '../../ids.d-B2GAAifq.cjs';
5
5
  export { B as Brand, _ as __brand } from '../../ids.d-B2GAAifq.cjs';
6
- import { T as TelevetEmptyRosterCause, a as TelevetStateInterestAction$1, b as TelevetMediaShortfall, c as TelevetBookingStep, d as TelevetBookingContext, e as TelevetBookingController, f as TelevetTriageRead, g as TelevetStateInterestWrite, h as TelevetVetThreadTarget, i as TelevetDayPeriod } from '../../bookingCopy.d-rnBSqOSN.cjs';
7
- export { C as CONSULT_MINUTES, N as NO_MEDIA_SHORTFALL, j as TELEVET_BOOKING_BASE, k as TELEVET_BOOKING_COPY, l as TELEVET_BOOKING_STEPS, m as TELEVET_CONSULT_PAGE_LIMIT, n as TELEVET_JOIN_CLOSES_MINUTES_AFTER, o as TELEVET_JOIN_OPENS_MINUTES_BEFORE, p as TELEVET_MESSAGE_THREADS_PATH, q as TelevetAttachmentMeta, r as TelevetAttachmentPolicy, s as TelevetBookingAction, t as TelevetBookingControllerDeps, u as TelevetBookingCopy, v as TelevetBookingDraft, w as TelevetBookingFailure, x as TelevetBookingRefusal, y as TelevetBookingState, z as TelevetEarlyTriage, A as TelevetEmptyRosterView, B as TelevetJoinReadiness, D as TelevetJoinState, E as TelevetMediaRefusal, F as TelevetRead, G as TelevetStateInterestReason, H as TelevetWrite, U as UpcomingTelevetVisitState, I as UseVetThreadOptions, V as VET_MESSAGES_COPY, J as VET_MESSAGE_CONTENT_MAX, K as VET_MESSAGE_PAGE_DEFAULT, L as VET_MESSAGE_PAGE_MAX, M as VetMessage, O as VetMessagePage, P as VetMessageRole, Q as VetMessagesAvailability, R as VetSendFailure, S as VetThread, W as VetThreadState, X as VetThreadsState, Y as VisitSummary, Z as VisitSummaryMedication, _ as VisitSummaryState, $ as attestation, a0 as canConfirm, a1 as canManageTelevetVisit, a2 as createTelevetBookingController, a3 as currentStep, a4 as emptyTelevetDraft, a5 as formatVisitRange, a6 as formatWhen, a7 as formatWhenWithDay, a8 as hasPreviousStep, a9 as initialTelevetBookingState, aa as isHoldExpired, ab as isMediaShortfallEmpty, ac as isSkipped, ad as isTelevetBookingCopyReady, ae as isVetMessagesDark, af as isVetThreadVetFirst, ag as mediaShortfallFromUnsentPicks, ah as splitTelevetVisits, ai as televetBookingKey, aj as televetBookingReducer, ak as televetBookingRefusal, al as televetCancelCall, am as televetConsultCall, an as televetEmptyRosterCause, ao as televetEmptyRosterView, ap as televetHoldCall, aq as televetJoinCall, ar as televetJoinOpensAtMs, as as televetJoinReadiness, at as televetMediaShortfallLines, au as televetRescheduleCall, av as televetThreadMessagesCall, aw as televetThreadReadCall, ax as televetVisitSummaryCall, ay as useEarlyTriage, az as useStateInterest, aA as useTelevetBookConsult, aB as useTelevetBookingAvailable, aC as useTelevetBookingController, aD as useTelevetBookingEntitlement, aE as useTelevetCancellationPolicy, aF as useTelevetClinicians, aG as useTelevetHoldSlot, aH as useTelevetJoin, aI as useTelevetNextSlot, aJ as useTelevetRescheduleConsult, aK as useTelevetSlots, aL as useTelevetStatePolicy, aM as useUpcomingTelevetVisit, aN as useVetThread, aO as useVetThreads, aP as useVisitSummary, aQ as validateBookingBody, aR as vetThreadPetRef, aS as withUnsentPicks } from '../../bookingCopy.d-rnBSqOSN.cjs';
6
+ import { T as TelevetEmptyRosterCause, a as TelevetStateInterestAction$1, b as TelevetMediaShortfall, c as TelevetBookingStep, d as TelevetBookingContext, e as TelevetBookingController, f as TelevetTriageRead, g as TelevetStateInterestWrite, h as TelevetVetThreadTarget, i as TelevetDayPeriod } from '../../bookingCopy.d-Dfew1pjY.cjs';
7
+ export { C as CONSULT_MINUTES, N as NO_MEDIA_SHORTFALL, j as TELEVET_BOOKING_BASE, k as TELEVET_BOOKING_COPY, l as TELEVET_BOOKING_STEPS, m as TELEVET_CONSULT_PAGE_LIMIT, n as TELEVET_JOIN_CLOSES_MINUTES_AFTER, o as TELEVET_JOIN_OPENS_MINUTES_BEFORE, p as TELEVET_MESSAGE_THREADS_PATH, q as TelevetAttachmentMeta, r as TelevetAttachmentPolicy, s as TelevetBookingAction, t as TelevetBookingControllerDeps, u as TelevetBookingCopy, v as TelevetBookingDraft, w as TelevetBookingFailure, x as TelevetBookingRefusal, y as TelevetBookingState, z as TelevetEarlyTriage, A as TelevetEmptyRosterView, B as TelevetJoinReadiness, D as TelevetJoinState, E as TelevetMediaRefusal, F as TelevetRead, G as TelevetStateInterestReason, H as TelevetWrite, U as UpcomingTelevetVisitState, I as UseVetThreadOptions, V as VET_MESSAGES_COPY, J as VET_MESSAGE_CONTENT_MAX, K as VET_MESSAGE_PAGE_DEFAULT, L as VET_MESSAGE_PAGE_MAX, M as VetMessage, O as VetMessagePage, P as VetMessageRole, Q as VetMessagesAvailability, R as VetSendFailure, S as VetThread, W as VetThreadState, X as VetThreadsState, Y as VisitSummary, Z as VisitSummaryMedication, _ as VisitSummaryState, $ as attestation, a0 as canConfirm, a1 as canManageTelevetVisit, a2 as createTelevetBookingController, a3 as currentStep, a4 as emptyTelevetDraft, a5 as formatVisitRange, a6 as formatWhen, a7 as formatWhenWithDay, a8 as hasPreviousStep, a9 as initialTelevetBookingState, aa as isHoldExpired, ab as isMediaShortfallEmpty, ac as isSkipped, ad as isTelevetBookingCopyReady, ae as isVetMessagesDark, af as isVetThreadVetFirst, ag as mediaShortfallFromUnsentPicks, ah as splitTelevetVisits, ai as televetBookingKey, aj as televetBookingReducer, ak as televetBookingRefusal, al as televetCancelCall, am as televetConsultCall, an as televetEmptyRosterCause, ao as televetEmptyRosterView, ap as televetHoldCall, aq as televetJoinCall, ar as televetJoinOpensAtMs, as as televetJoinReadiness, at as televetMediaShortfallLines, au as televetRescheduleCall, av as televetThreadMessagesCall, aw as televetThreadReadCall, ax as televetVisitSummaryCall, ay as useEarlyTriage, az as useStateInterest, aA as useTelevetBookConsult, aB as useTelevetBookingAvailable, aC as useTelevetBookingController, aD as useTelevetBookingEntitlement, aE as useTelevetCancellationPolicy, aF as useTelevetClinicians, aG as useTelevetHoldSlot, aH as useTelevetJoin, aI as useTelevetNextSlot, aJ as useTelevetRescheduleConsult, aK as useTelevetSlots, aL as useTelevetStatePolicy, aM as useUpcomingTelevetVisit, aN as useVetThread, aO as useVetThreads, aP as useVisitSummary, aQ as validateBookingBody, aR as vetThreadPetRef, aS as withUnsentPicks } from '../../bookingCopy.d-Dfew1pjY.cjs';
8
8
  import { T as TelevetConsult, E as EverfurTelevetFlowRequest, b as TelevetCancelReceipt, c as TelevetSlot } from '../../televetGlobal.d-gZrXPaLl.cjs';
9
9
  export { C as CANCELLATION_POLICY_VERSION_MAX, d as CANCEL_REASON_MAX, e as CONSULT_KINDS, f as CONSULT_STATUSES, g as ConsultKind, h as ConsultStatus, M as MEDIA_REFS_MAX, R as REASON_TEXT_MAX, i as TERMINAL_CONSULT_STATUSES, j as TelevetBookingBody, k as TelevetBookingEntitlement, l as TelevetCancellationPolicy, m as TelevetClinician, n as TelevetSlotHold, o as TelevetStatePolicy, p as TelevetTriageVerdict, q as isWellFormedStateCode } from '../../televetGlobal.d-gZrXPaLl.cjs';
10
10
  import { V as VetVisitIntent } from '../../visitIntent.d-CY7mrflo.cjs';
@@ -3,8 +3,8 @@ import { ReactNode, ComponentType, ReactElement } from 'react';
3
3
  import { StyleProp, ViewStyle } from 'react-native';
4
4
  import { P as PetRef } from '../../ids.d-B2GAAifq.js';
5
5
  export { B as Brand, _ as __brand } from '../../ids.d-B2GAAifq.js';
6
- import { T as TelevetEmptyRosterCause, a as TelevetStateInterestAction$1, b as TelevetMediaShortfall, c as TelevetBookingStep, d as TelevetBookingContext, e as TelevetBookingController, f as TelevetTriageRead, g as TelevetStateInterestWrite, h as TelevetVetThreadTarget, i as TelevetDayPeriod } from '../../bookingCopy.d-BuDv16WP.js';
7
- export { C as CONSULT_MINUTES, N as NO_MEDIA_SHORTFALL, j as TELEVET_BOOKING_BASE, k as TELEVET_BOOKING_COPY, l as TELEVET_BOOKING_STEPS, m as TELEVET_CONSULT_PAGE_LIMIT, n as TELEVET_JOIN_CLOSES_MINUTES_AFTER, o as TELEVET_JOIN_OPENS_MINUTES_BEFORE, p as TELEVET_MESSAGE_THREADS_PATH, q as TelevetAttachmentMeta, r as TelevetAttachmentPolicy, s as TelevetBookingAction, t as TelevetBookingControllerDeps, u as TelevetBookingCopy, v as TelevetBookingDraft, w as TelevetBookingFailure, x as TelevetBookingRefusal, y as TelevetBookingState, z as TelevetEarlyTriage, A as TelevetEmptyRosterView, B as TelevetJoinReadiness, D as TelevetJoinState, E as TelevetMediaRefusal, F as TelevetRead, G as TelevetStateInterestReason, H as TelevetWrite, U as UpcomingTelevetVisitState, I as UseVetThreadOptions, V as VET_MESSAGES_COPY, J as VET_MESSAGE_CONTENT_MAX, K as VET_MESSAGE_PAGE_DEFAULT, L as VET_MESSAGE_PAGE_MAX, M as VetMessage, O as VetMessagePage, P as VetMessageRole, Q as VetMessagesAvailability, R as VetSendFailure, S as VetThread, W as VetThreadState, X as VetThreadsState, Y as VisitSummary, Z as VisitSummaryMedication, _ as VisitSummaryState, $ as attestation, a0 as canConfirm, a1 as canManageTelevetVisit, a2 as createTelevetBookingController, a3 as currentStep, a4 as emptyTelevetDraft, a5 as formatVisitRange, a6 as formatWhen, a7 as formatWhenWithDay, a8 as hasPreviousStep, a9 as initialTelevetBookingState, aa as isHoldExpired, ab as isMediaShortfallEmpty, ac as isSkipped, ad as isTelevetBookingCopyReady, ae as isVetMessagesDark, af as isVetThreadVetFirst, ag as mediaShortfallFromUnsentPicks, ah as splitTelevetVisits, ai as televetBookingKey, aj as televetBookingReducer, ak as televetBookingRefusal, al as televetCancelCall, am as televetConsultCall, an as televetEmptyRosterCause, ao as televetEmptyRosterView, ap as televetHoldCall, aq as televetJoinCall, ar as televetJoinOpensAtMs, as as televetJoinReadiness, at as televetMediaShortfallLines, au as televetRescheduleCall, av as televetThreadMessagesCall, aw as televetThreadReadCall, ax as televetVisitSummaryCall, ay as useEarlyTriage, az as useStateInterest, aA as useTelevetBookConsult, aB as useTelevetBookingAvailable, aC as useTelevetBookingController, aD as useTelevetBookingEntitlement, aE as useTelevetCancellationPolicy, aF as useTelevetClinicians, aG as useTelevetHoldSlot, aH as useTelevetJoin, aI as useTelevetNextSlot, aJ as useTelevetRescheduleConsult, aK as useTelevetSlots, aL as useTelevetStatePolicy, aM as useUpcomingTelevetVisit, aN as useVetThread, aO as useVetThreads, aP as useVisitSummary, aQ as validateBookingBody, aR as vetThreadPetRef, aS as withUnsentPicks } from '../../bookingCopy.d-BuDv16WP.js';
6
+ import { T as TelevetEmptyRosterCause, a as TelevetStateInterestAction$1, b as TelevetMediaShortfall, c as TelevetBookingStep, d as TelevetBookingContext, e as TelevetBookingController, f as TelevetTriageRead, g as TelevetStateInterestWrite, h as TelevetVetThreadTarget, i as TelevetDayPeriod } from '../../bookingCopy.d-BL2-URcv.js';
7
+ export { C as CONSULT_MINUTES, N as NO_MEDIA_SHORTFALL, j as TELEVET_BOOKING_BASE, k as TELEVET_BOOKING_COPY, l as TELEVET_BOOKING_STEPS, m as TELEVET_CONSULT_PAGE_LIMIT, n as TELEVET_JOIN_CLOSES_MINUTES_AFTER, o as TELEVET_JOIN_OPENS_MINUTES_BEFORE, p as TELEVET_MESSAGE_THREADS_PATH, q as TelevetAttachmentMeta, r as TelevetAttachmentPolicy, s as TelevetBookingAction, t as TelevetBookingControllerDeps, u as TelevetBookingCopy, v as TelevetBookingDraft, w as TelevetBookingFailure, x as TelevetBookingRefusal, y as TelevetBookingState, z as TelevetEarlyTriage, A as TelevetEmptyRosterView, B as TelevetJoinReadiness, D as TelevetJoinState, E as TelevetMediaRefusal, F as TelevetRead, G as TelevetStateInterestReason, H as TelevetWrite, U as UpcomingTelevetVisitState, I as UseVetThreadOptions, V as VET_MESSAGES_COPY, J as VET_MESSAGE_CONTENT_MAX, K as VET_MESSAGE_PAGE_DEFAULT, L as VET_MESSAGE_PAGE_MAX, M as VetMessage, O as VetMessagePage, P as VetMessageRole, Q as VetMessagesAvailability, R as VetSendFailure, S as VetThread, W as VetThreadState, X as VetThreadsState, Y as VisitSummary, Z as VisitSummaryMedication, _ as VisitSummaryState, $ as attestation, a0 as canConfirm, a1 as canManageTelevetVisit, a2 as createTelevetBookingController, a3 as currentStep, a4 as emptyTelevetDraft, a5 as formatVisitRange, a6 as formatWhen, a7 as formatWhenWithDay, a8 as hasPreviousStep, a9 as initialTelevetBookingState, aa as isHoldExpired, ab as isMediaShortfallEmpty, ac as isSkipped, ad as isTelevetBookingCopyReady, ae as isVetMessagesDark, af as isVetThreadVetFirst, ag as mediaShortfallFromUnsentPicks, ah as splitTelevetVisits, ai as televetBookingKey, aj as televetBookingReducer, ak as televetBookingRefusal, al as televetCancelCall, am as televetConsultCall, an as televetEmptyRosterCause, ao as televetEmptyRosterView, ap as televetHoldCall, aq as televetJoinCall, ar as televetJoinOpensAtMs, as as televetJoinReadiness, at as televetMediaShortfallLines, au as televetRescheduleCall, av as televetThreadMessagesCall, aw as televetThreadReadCall, ax as televetVisitSummaryCall, ay as useEarlyTriage, az as useStateInterest, aA as useTelevetBookConsult, aB as useTelevetBookingAvailable, aC as useTelevetBookingController, aD as useTelevetBookingEntitlement, aE as useTelevetCancellationPolicy, aF as useTelevetClinicians, aG as useTelevetHoldSlot, aH as useTelevetJoin, aI as useTelevetNextSlot, aJ as useTelevetRescheduleConsult, aK as useTelevetSlots, aL as useTelevetStatePolicy, aM as useUpcomingTelevetVisit, aN as useVetThread, aO as useVetThreads, aP as useVisitSummary, aQ as validateBookingBody, aR as vetThreadPetRef, aS as withUnsentPicks } from '../../bookingCopy.d-BL2-URcv.js';
8
8
  import { T as TelevetConsult, E as EverfurTelevetFlowRequest, b as TelevetCancelReceipt, c as TelevetSlot } from '../../televetGlobal.d-DkJkV55Y.js';
9
9
  export { C as CANCELLATION_POLICY_VERSION_MAX, d as CANCEL_REASON_MAX, e as CONSULT_KINDS, f as CONSULT_STATUSES, g as ConsultKind, h as ConsultStatus, M as MEDIA_REFS_MAX, R as REASON_TEXT_MAX, i as TERMINAL_CONSULT_STATUSES, j as TelevetBookingBody, k as TelevetBookingEntitlement, l as TelevetCancellationPolicy, m as TelevetClinician, n as TelevetSlotHold, o as TelevetStatePolicy, p as TelevetTriageVerdict, q as isWellFormedStateCode } from '../../televetGlobal.d-DkJkV55Y.js';
10
10
  import { V as VetVisitIntent } from '../../visitIntent.d-CY7mrflo.js';
@@ -319,8 +319,7 @@ return E(h,{style:[d.screen,s],testID:"televet-vet-thread",children:[
319
319
  /* @__PURE__ */R(TelevetSkeletonBlock,{height:56})]}):p.status==="error"?/* @__PURE__ */R(TelevetStateCard,{title:gs.loadFailed,actionLabel:gs.retry,onAction:p.retry,testID:"televet-vet-thread-error"}):/* @__PURE__ */E(k,{ref:y,accessibilityLabel:ys(gs.threadLogTemplate,{vet:_}),contentContainerStyle:c.log,scrollEventThrottle:64,keyboardShouldPersistTaps:"handled",keyboardDismissMode:b?"interactive":"on-drag",onScroll:e=>{e.nativeEvent.contentOffset.y<=Ys&&p.loadOlder()},testID:"televet-vet-thread-log",children:[p.messages.length===0?/* @__PURE__ */R(Text,{style:c.system,children:gs.empty}):null,p.messages.map((e,t)=>/* @__PURE__ */R(ThreadItem,{message:e,previous:p.messages[t-1],vet:_,styles:c},e.messageId))]}),p.status==="ready"&&p.canWrite?/* @__PURE__ */E(h,{style:d.stack,children:[
320
320
  /* @__PURE__ */E(h,{style:c.composer,children:[
321
321
  /* @__PURE__ */R(Xr,{value:m,onChangeText:g,multiline:true,accessibilityLabel:bs(ys(gs.composerLabelTemplateNative,{vet:_})),placeholder:ys(gs.composerPlaceholderTemplate,{vet:_}),style:c.field,testID:"televet-vet-thread-field"}),
322
- /* @__PURE__ */R(f,{onPress:x,disabled:!I,accessibilityRole:"button",accessibilityLabel:gs.send,accessibilityState:{disabled:!I,busy:p.sending},style:[c.send,I?null:c.sendDisabled],testID:"televet-vet-thread-send",children:/* @__PURE__ */R(Text,{tier:"control",style:c.sendLabel,children:gs.send})})]}),p.sendFailure==="notSent"?/* @__PURE__ */R(Text,{style:c.failure,accessibilityLiveRegion:"assertive",testID:"televet-vet-thread-failure",children:gs.notSent}):p.sentCount>0?/* @__PURE__ */R(Text,{style:c.note,accessibilityLiveRegion:"polite",testID:"televet-vet-thread-status",children:gs.sent}):null,
323
- /* @__PURE__ */R(Text,{style:c.note,children:bs(ys(gs.composerNoteTemplate,{vet:_}))})]}):null,p.sendFailure==="vetWritesFirst"?/* @__PURE__ */R(Text,{style:c.note,accessibilityLiveRegion:"polite",testID:"televet-vet-thread-vet-first",children:gs.vetWritesFirst}):null]})]})}function ThreadItem({message:e,previous:t,vet:n,styles:r}){let l=zi(e.createdAt),i=t===void 0||zi(t.createdAt)!==l,o=e.attachmentCount>0?ys(gs.attachmentsTemplate,{n:String(e.attachmentCount)}):null;/* @__PURE__ */
322
+ /* @__PURE__ */R(f,{onPress:x,disabled:!I,accessibilityRole:"button",accessibilityLabel:gs.send,accessibilityState:{disabled:!I,busy:p.sending},style:[c.send,I?null:c.sendDisabled],testID:"televet-vet-thread-send",children:/* @__PURE__ */R(Text,{tier:"control",style:c.sendLabel,children:gs.send})})]}),p.sendFailure==="notSent"?/* @__PURE__ */R(Text,{style:c.failure,accessibilityLiveRegion:"assertive",testID:"televet-vet-thread-failure",children:gs.notSent}):p.sentCount>0?/* @__PURE__ */R(Text,{style:c.note,accessibilityLiveRegion:"polite",testID:"televet-vet-thread-status",children:gs.sent}):null]}):null,p.sendFailure==="vetWritesFirst"?/* @__PURE__ */R(Text,{style:c.note,accessibilityLiveRegion:"polite",testID:"televet-vet-thread-vet-first",children:gs.vetWritesFirst}):null]})]})}function ThreadItem({message:e,previous:t,vet:n,styles:r}){let l=zi(e.createdAt),i=t===void 0||zi(t.createdAt)!==l,o=e.attachmentCount>0?ys(gs.attachmentsTemplate,{n:String(e.attachmentCount)}):null;/* @__PURE__ */
324
323
  return E(z,{children:[i?/* @__PURE__ */R(Text,{style:r.day,children:l}):null,e.role==="system"?/* @__PURE__ */R(Text,{style:r.system,children:e.content}):/* @__PURE__ */E(h,{style:[r.item,e.role==="owner"?r.itemMine:null],testID:`televet-vet-thread-message-${e.messageId}`,children:[e.role==="vet"?/* @__PURE__ */E(h,{style:r.whoRow,children:[
325
324
  /* @__PURE__ */R(Text,{style:r.who,children:e.senderName??bs(n)}),
326
325
  /* @__PURE__ */R(Text,{style:r.time,children:Ri(e.createdAt)})]}):null,e.content.length>0?/* @__PURE__ */R(Text,{style:e.role==="owner"?r.bubbleMine:r.bubbleVet,children:e.content}):null,o?/* @__PURE__ */R(Text,{style:r.attachments,children:o}):null]})]})}function Js(e){for(let t=e.length-1;t>=0;t-=1){let n=e[t]?.role==="vet"?e[t]?.senderName:null;if(n)return n}return null}function TelevetVisitSummaryScreen({consult:e,controller:t,onBack:n,onMessageVet:r,onBook:l,style:i}){let o=_s(),a=Is(),s=useTelevetBookingController(t),d=useVisitSummary(s,e.consultId),{pets:c}=useEverfurPets(),u=ts(c,e.petId),p=d.summary,f=p?.approvedByName??e.clinicianName,m=vs(f),g=u&&e.clinicianName?ys(ws.visitTitleTemplate,{pet:u,vet:e.clinicianName}):bs(Ts(u)),y=[Ei(e.scheduledAt),f].filter(Boolean).join(" · "),b=vetThreadPetRef(c,e.petId),v=r&&b!==null?()=>r({petRef:b,petName:u,vetName:f??null}):void 0;/* @__PURE__ */
@@ -3,7 +3,7 @@
3
3
  "use strict";var e=require("react"),t=require("react/jsx-runtime"),i=require("react-dom");function r(e){if(typeof e=="number")return a(e);if(typeof e!="string")return null;let t=e.trim();if(t.length===0)return null;if(t.startsWith("#"))return n(t.slice(1));if(t.toLowerCase().startsWith("0x"))return n(t.slice(2));if(t.toLowerCase().startsWith("rgb"))return o(t);if(/^[0-9a-fA-F]+$/.test(t)){let e=n(t);if(e!==null)return e}return/^\d+$/.test(t)?a(Number.parseInt(t,10)):null}function n(e){let t=e.trim();if(!/^[0-9a-fA-F]+$/.test(t))return null;if(t.length===3)return{r:l(t[0]),g:l(t[1]),b:l(t[2]),a:1};if(t.length===6)return{r:s(t,0),g:s(t,2),b:s(t,4),a:1};if(t.length===8){let e=s(t,0);return{r:s(t,2),g:s(t,4),b:s(t,6),a:e/255}}return null}function o(e){let t=e.indexOf("("),i=e.indexOf(")");if(t<0||i<0||i<t)return null;let r=e.slice(t+1,i).split(",").map(e=>e.trim());if(r.length<3)return null;let n=u(Number(r[0])),o=u(Number(r[1])),a=u(Number(r[2]));if(n===null||o===null||a===null)return null;let s=1;if(r.length>=4){let e=Number(r[3]);if(!Number.isFinite(e))return null;s=Math.min(1,Math.max(0,e))}return{r:n,g:o,b:a,a:s}}function a(e){if(!Number.isFinite(e))return null;let t=Math.trunc(e)>>>0,i=t>>>24&255;return{r:t>>>16&255,g:t>>>8&255,b:t&255,a:i===0?1:i/255}}function s(e,t){return Number.parseInt(e.slice(t,t+2),16)}function l(e){return Number.parseInt(`${e??"0"}${e??"0"}`,16)}function u(e){return Number.isFinite(e)?Math.min(255,Math.max(0,Math.round(e))):null}function c(e,t,i){return`#${d(e)}${d(t)}${d(i)}`.toUpperCase()}function d(e){return e.toString(16).padStart(2,"0")}var p="#111111",f="#FFFFFF",m="#000000";function readableOn(e){let t=r(e);if(t===null)return f;let i=b(t),n=b({r:17,g:17,b:17}),o=b({r:255,g:255,b:255});return x(i,o)>=x(i,n)?f:p}function h(e,t){let i=readableOn(e);return contrastRatio(i,e)>=t?i:contrastRatio(f,e)>=contrastRatio(m,e)?f:m}function g(e){let t=t=>e.reduce((e,i)=>Math.min(e,contrastRatio(t,i)),Number.POSITIVE_INFINITY);return t(f)>=t(m)?f:m}function b(e){let t=v(e.r/255),i=v(e.g/255),r=v(e.b/255);return.2126*t+.7152*i+.0722*r}function v(e){return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}function x(e,t){let i=Math.max(e,t),r=Math.min(e,t);return(i+.05)/(r+.05)}function contrastRatio(e,t){let i=r(e),n=r(t);if(i===null||n===null)return 1;let o=n.a>=1?n:{...n},a=i.a>=1?i:y(i,o);return x(b(a),b(o))}function y(e,t){let i=e.a,r=(e,t)=>Math.round(e*i+t*(1-i));return{r:r(e.r,t.r),g:r(e.g,t.g),b:r(e.b,t.b),a:1}}function w(e,t){let i=r(e),n=r(t);if(i===null||n===null)return null;let o=i.a>=1?i:y(i,{...n});return c(o.r,o.g,o.b)}function k(e,t){let i=r(e);if(i===null)return null;let n=Math.min(1,Math.max(0,t));return`rgba(${i.r}, ${i.g}, ${i.b}, ${n})`}var _=.05;function j(e,t,i,n){let o=t[0];if(o===void 0)return i;let a=e=>t.every(t=>contrastRatio(e,t)>=n);if(r(e)===null)return i;if(a(e))return e;let s=w(e,o),l=s===null?null:r(s),u=r(i);if(l===null||u===null)return i;for(let e=1;e<1/_;e+=1){let t=e*_,i=(e,i)=>Math.round(e+(i-e)*t),r=c(i(l.r,u.r),i(l.g,u.g),i(l.b,u.b));if(a(r))return r}return i}var z=/* @__PURE__ */Object.freeze({display:/* @__PURE__ */Object.freeze({size:29,lineHeight:1.06,weight:"800",face:"heading",letterSpacing:-.01,uppercase:false,tier:"heading"}),title:/* @__PURE__ */Object.freeze({size:23,lineHeight:1.12,weight:"800",face:"heading",letterSpacing:-.01,uppercase:false,tier:"heading"}),cardTitle:/* @__PURE__ */Object.freeze({size:19,lineHeight:1.22,weight:"800",face:"sans",letterSpacing:0,uppercase:false,tier:"heading"}),rowTitle:/* @__PURE__ */Object.freeze({size:15.5,lineHeight:1.4,weight:"700",face:"sans",letterSpacing:0,uppercase:false,tier:"content"}),body:/* @__PURE__ */Object.freeze({size:15,lineHeight:1.5,weight:"400",face:"sans",letterSpacing:0,uppercase:false,tier:"content"}),message:/* @__PURE__ */Object.freeze({size:15.5,lineHeight:1.5,weight:"400",face:"sans",letterSpacing:0,uppercase:false,tier:"content"}),bodySmall:/* @__PURE__ */Object.freeze({size:14.5,lineHeight:1.4,weight:"400",face:"sans",letterSpacing:0,uppercase:false,tier:"content"}),caption:/* @__PURE__ */Object.freeze({size:13,lineHeight:1.4,weight:"400",face:"sans",letterSpacing:0,uppercase:false,tier:"content"}),label:/* @__PURE__ */Object.freeze({size:10.5,lineHeight:1.4,weight:"400",face:"mono",letterSpacing:.05,uppercase:true,tier:"compact"}),eyebrow:/* @__PURE__ */Object.freeze({size:15,lineHeight:1.5,weight:"400",face:"mono",letterSpacing:.07,uppercase:true,tier:"compact"}),chip:/* @__PURE__ */Object.freeze({size:15,lineHeight:1.3,weight:"600",face:"sans",letterSpacing:0,uppercase:false,tier:"compact"}),tab:/* @__PURE__ */Object.freeze({size:16,lineHeight:1.5,weight:"600",face:"sans",letterSpacing:0,uppercase:false,tier:"compact"}),button:/* @__PURE__ */Object.freeze({size:15,lineHeight:1.5,weight:"700",face:"sans",letterSpacing:0,uppercase:false,tier:"control"}),badge:/* @__PURE__ */Object.freeze({size:12,lineHeight:1.5,weight:"700",face:"sans",letterSpacing:0,uppercase:false,tier:"badge"})});var C=Object.freeze;function deepFreeze(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){C(e);for(let t of Object.keys(e))deepFreeze(e[t])}return e}var S=/* @__PURE__ */Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3});var P={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},T={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},F={nano:8,small:9,micro:10,tiny:11,caption:13,bodyTight:15,body:17,subtitle:20,heading:22,verdict:24},$={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},O={regular:"400",medium:"500",bold:"700"},E={eyebrow:1,monoWide:.9,headerBrand:-.42,tight:-.35},I=0,L="System",H="monospace",R=["content","heading","control","compact","badge"];function D(e){let t={};for(let i of R)t[i]=e;return t}var N=[];function B(){return{family:L,mono:H,fontUrl:null,families:{regular:L,medium:L,bold:L,mono:H,monoMedium:H,monoBold:H},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:F,tierSizes:D(F),lineHeight:$,weight:O,letterSpacing:E,scale:1,maxScale:I,scaleCaps:S,headingFamily:null,headingWeight:null,fontSources:N,roles:z,typeScale:1}}var A={},M=/* @__PURE__ */Object.freeze({standard:/* @__PURE__ */Object.freeze([.2,0,0,1]),emphasized:/* @__PURE__ */Object.freeze([.2,.8,.2,1]),exit:/* @__PURE__ */Object.freeze([.4,0,1,1])});function cssCubicBezier(e){return`cubic-bezier(${e.join(", ")})`}var W={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:cssCubicBezier(M.standard),emphasized:cssCubicBezier(M.emphasized),exit:cssCubicBezier(M.exit)},reducedMotion:false},q={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)"},U=deepFreeze({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:q,space:P,radius:T,type:B(),motion:W,slots:A}),K={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)"},V=deepFreeze({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:K,space:P,radius:T,type:B(),motion:W,slots:A});var G=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),Y=globalThis,X=Y[G]??(Y[G]=e.createContext(U));X.displayName??="EverfurThemeContext";function useEverfurTheme(){return e.useContext(X)}var Q={ink:"#10462E",go:"#07C168",alert:"#C03410",tintSage:"#E6ECE8"},Z=/* @__PURE__ */Symbol.for("@everfur-health/ui-core#ThemeContext@v1");function J(){let t=globalThis,i=t[Z];return i===void 0&&(i=e.createContext(null),i.displayName="EverfurThemeContext",t[Z]=i),i}var ee=(e,t)=>e.toUpperCase()===t.toUpperCase();function te(e){let t=r(e);return t!==null&&b(t)<.18}var ie=/* @__PURE__ */new WeakMap;function re(e,t){if(t===null)return e;let i=ie.get(e);i===void 0&&(i=/* @__PURE__ */new WeakMap,ie.set(e,i));let r=i.get(t);return r===void 0&&(r=ne(e,t),i.set(t,r)),r}function ne(e,t){let i=t.colors,r=!ee(i.ink,Q.ink),n=!ee(i.go,Q.go),o=e===U&&te(i.bg),a=o?V:e,s=a.color,l=e=>o||s[e]===U.color[e],u={};r&&l("primary")&&(Object.assign(u,{primary:i.ink,onPrimary:i.onInk,brand:i.ink,brandInk:i.ink}),l("linkInk")&&(u.linkInk=i.ink),!n&&l("accent")&&Object.assign(u,{accent:i.ink,onAccent:i.onInk})),n&&l("accent")&&Object.assign(u,{accent:i.go,onAccent:i.onGo}),!ee(i.alert,Q.alert)&&l("danger")&&(u.danger=i.alert),!ee(i.tintSage,Q.tintSage)&&l("brandSoft")&&(u.brandSoft=i.tintSage,l("brandSofter")&&(u.brandSofter=i.tintSage)),o&&Object.assign(u,{background:i.bg,surface:i.surface,text:{...s.text,primary:i.text,muted:i.muted},borderRingCream:i.line});let c=t.motion?.reduced===true&&!a.motion.reducedMotion;return!o&&!c&&Object.keys(u).length===0?e:{...a,color:{...s,...u},...c?{motion:{...a.motion,reducedMotion:true}}:{}}}function oe(){let t=useEverfurTheme(),i=e.useContext(J());return e.useMemo(()=>re(t,i),[t,i])}var ae=/* @__PURE__ */Object.freeze({loading:"Loading",retry:"Try again",signedOut:"Sign in required",addToCart:"Add to cart",added:"Added",remove:"Remove",checkout:"Checkout",subtotal:"Subtotal",sample:"Sample",cartEmpty:"Your cart is empty.",choosePet:"Choose a pet",emptyTitle:"",emptyBody:"",emptyAsk:""}),se=/* @__PURE__ */Object.freeze({emptyTitle:true,emptyBody:true,emptyAsk:true}),le=/* @__PURE__ */Object.freeze({dna:"",records:"Records",inside:"Inside",profile:""}),ue=/* @__PURE__ */Object.freeze({planTitle:e=>`${e}'s care plan`,cartLabel:e=>`${e} cart`}),ce=/* @__PURE__ */Object.freeze([...Object.keys(ae).filter(e=>se[e]===true&&ae[e]==="").map(e=>`HEALTH_PLAN_COPY.${e}`),...["profile"].filter(e=>le[e]==="").map(e=>`HEALTH_PLAN_REASON_LABELS.${e}`)]);var de=/* @__PURE__ */Object.freeze({imageVariant:"wide",reasonVariant:"pills",cartBarVisibility:"whenItems",cartBarPlacement:"sticky",addButtonSize:"full",addedVariant:"link",categoryVariant:"text",showCategory:false,cardShadow:false,cardBorder:true});function pe(e,t){return{setInPlan:t,addAll:async()=>{let i=(e?.items??[]).filter(e=>!e.inPlan);return(await Promise.all(i.map(e=>t(e.productId,true)))).every(Boolean)}}}function showHealthPlanCartBar(e,t){return(e??de.cartBarVisibility)==="always"||t>0}var fe=/* @__PURE__ */Object.freeze(["showCategory","cardShadow","cardBorder","addButtonSize","addButtonFontSize","addedVariant","categoryVariant","cardPadding","itemTitleSize","itemTitleWeight","priceSize","priceWeight","reasonTextSize","reasonLabelWidth","reasonGap"]);function me(e){let t={};for(let i of fe)e[i]!==void 0&&(t[i]=e[i]);return t}function he(e){let t=typeof e=="number"&&Number.isFinite(e)&&e>0?e:e==="compact"?32:44;return{height:t,hit:Math.max(44,t)}}function ge(e){return typeof e=="number"&&Number.isFinite(e)&&e>=0?e:null}function be(e,t){let i=ge(e);return i===null?0:i-t}function isHealthPlanSessionRequired(e){return e!==null&&(e.reasonCode==="session_required"||e.code==="sessionRequired")}var ve=/* @__PURE__ */Symbol.for("@everfur/sdk#HealthPlanCartDock@v1"),xe=globalThis,ye=xe[ve]??(xe[ve]=e.createContext(null));function HealthPlanCartScope({children:t}){let[i,r]=e.useState(null),n=e.useMemo(()=>({dock:i,publish:r}),[i]);return e.createElement(ye.Provider,{value:n},t)}function useHealthPlanCartDock(){return e.useContext(ye)?.dock??null}function we(t,i,r,petRef,n,o){let a=e.useContext(ye)?.publish,s=e.useRef(o);e.useEffect(()=>{s.current=o},[o]);let l=e.useMemo(()=>pe(n,(e,t)=>s.current(e,t)),[n]);e.useEffect(()=>{if(!(a===void 0||!t))return a(/* @__PURE__ */Object.freeze({cart:i,busy:r,petRef:petRef,plan:n,...l})),()=>a(null)},[a,t,i,r,petRef,n,l])}function healthPlanPetWords(e,t){let i=e?.trim()??"",r=i===""?"your pet":i,n=i===""?"Your pet":i;return t==="female"?{name:r,Name:n,poss:"her",Poss:"Her",obj:"her"}:t==="male"?{name:r,Name:n,poss:"his",Poss:"His",obj:"him"}:{name:r,Name:n,poss:`${r}'s`,Poss:`${n}'s`,obj:r}}var ke=e=>e===null?"":`${e.productName} renews every ${e.intervalDays} days at ${e.box??""} until you cancel; skip or cancel anytime in the app.`,_e=/* @__PURE__ */Object.freeze({onceFine:"",cartFine:ke,startedWhat:()=>""});function healthPlanFocusCopyFor(e){let t=healthPlanPetWords(e.name,e.sex),i=e=>e.petName?.trim()||t.name,NameOf=e=>e.petName?.trim()||t.Name,r=/* @__PURE__ */Object.freeze({jumpKicker:(e,i)=>i?`In ${t.poss} plan, every ${e.intervalDays} days`:e.offer?`${e.discountPercent}% off ${t.poss} first box`:e.intervalDays>0?`Ships every ${e.intervalDays} days`:r.onceLine(e),optionsLabel:"How to buy",subscribe:"Subscribe",bestValue:"Best value",subscribeLine:e=>e.offer?`First box, then ${e.box??""}`:`${e.box??""} every ${e.intervalDays} days`,priceLine:e=>e.offer?`${e.discountPercent}% off the first box. Ships every ${e.intervalDays} days.`:e.intervalDays>0?`Ships every ${e.intervalDays} days.`:r.onceOffer(e),once:"One box",onceLine:e=>e.onceDiscountPercent>0?`${e.onceDiscountPercent}% off, ships once`:"Ships once",buyOnce:e=>`Buy one box, ${e.once??e.box??""}`,subscribed:"Subscribed",subscribedLine:(e,t)=>t===null?`Every ${e.intervalDays} days`:`Every ${e.intervalDays} days · next box ${t}`,manage:"Manage",checkoutKicker:"Checkout",checkoutTitle:e=>`Checkout: ${e.productName}`,checkoutOffer:e=>`${e.discountPercent}% off your first box.`,shipsEvery:"Ships every",days:e=>`${e} days`,buyOnceOption:"Buy once",checkoutGo:(e,t,i)=>`${t?"Subscribe":"Buy now"} · ${i} today`,renews:e=>`Renews every ${e.intervalDays} days at ${e.box??""} until you cancel; skip or cancel anytime in the app.`,onceFine:"One box, ships tomorrow.",onceOffer:e=>e.onceDiscountPercent>0?`${e.onceDiscountPercent}% off, ships once.`:"Ships once.",checkoutNote:"",close:"Close",startedTitle:e=>`${NameOf(e)}'s plan has started.`,orderedTitle:()=>"Order placed.",startedWhat:e=>`${e.productName} ships tomorrow.`,startedNote:"",startedSteps:"What happens next",tomorrow:"Tomorrow",firstBoxShips:`${t.Poss} first box ships.`,trackingComesByText:"Tracking comes by text.",checkin:e=>e===null?"A 2-week check-in by text.":`A 2-week check-in by text: ${e}`,refill:`A text 3 days before ${t.poss} next box. Reply SKIP to skip it.`,nextBoxShips:e=>`${t.Poss} next box ships, ${e.box??""}.`,startedDone:`Back to ${t.poss} plan`,manageKicker:"Your subscription",manageTitle:e=>`Manage ${e.productName}`,skip:"Skip the next box",cancel:"Cancel subscription",skipped:(e,i)=>i===null?"Skipped.":`Skipped. ${t.Poss} next box ships ${i}.`,cancelled:e=>`${e.productName} is cancelled. Restart it from ${t.poss} plan anytime.`,orders:"Orders",startedHeader:"Subscribed",placedHeader:"Order placed",cartCheckoutTitle:"Checkout",orderNote:"",cartLabel:e=>e>0?`Cart, ${e} item${e>1?"s":""}`:"Cart, empty",addToCart:e=>`Add to cart · ${e}`,viewCart:"View cart",addedToCart:(e,t)=>`${e.productName} is in your cart${t?", as a subscription":""}.`,removedFromCart:e=>`${e} is out of your cart.`,cartTitle:"Cart",cartEmptyTitle:"Your cart is empty",cartEmptyBody:e=>`${NameOf(e)}'s plan pick lands here when you add it.`,seeOrders:`See ${t.poss} orders`,quantityLabel:e=>`How many: ${e}`,fewer:"One fewer",more:"One more",remove:"Remove",cartSubLine:e=>e.offer?`First box ${e.discountPercent}% off, then ${e.box??""} every ${e.intervalDays} days`:`Every ${e.intervalDays} days`,cartOnceLine:(e,i)=>i?`An extra box. ${t.Poss} plan keeps shipping.`:e.onceDiscountPercent>0?`One box, ${e.onceDiscountPercent}% off`:"One box",cartModeLabel:e=>`How to buy ${e}`,cartModeSubscribe:e=>e.offer?`Subscribe, ${e.discountPercent}% off the first box`:"Subscribe",cartModeOnce:e=>e.onceDiscountPercent>0?`One box, ${e.onceDiscountPercent}% off`:"One box",subtotal:"Subtotal",shipping:"Shipping",shippingValue:"",shippingTag:"",total:"Total",dueToday:"Due today",thenRenews:e=>`Then ${e.productName}`,renewsEvery:e=>`${e.box??""} every ${e.intervalDays} days`,checkoutCart:e=>`Checkout · ${e}`,cartOneAtATime:"",cartSubscriptionApart:"",cartItemSubscription:e=>`Subscription, every ${e.intervalDays} days`,cartItemQuantity:e=>`Qty ${e}`,placeOrder:(e,t)=>`${t?"Place order and subscribe":"Place order"} · ${e}`,cartFine:e=>`${e===null?"":`${ke(e)} `}Ships tomorrow.`,placedSteps:"What's coming",placedShips:"It ships.",placedArrives:"It arrives at home.",viewOrder:"View order",herSubscription:`${t.Poss} subscription`,nextBox:e=>`Next box ${e}`,everyDays:e=>`Every ${e} days`,ordersHeading:e=>e?"Orders":`${t.Poss} orders`,ordersFine:"",ordersEmptyTitle:"No orders yet",ordersEmptyBody:e=>`The boxes from ${i(e)}'s plan show up here.`,moreOrders:"",orderSteps:["Ordered","Shipped","Out for delivery","Delivered"],subscriptionBox:"Subscription box",orderTitle:e=>e===null?"Order":`Order ${e}`,arrivesBy:e=>`Arrives by ${e}`,deliveredOn:e=>`Delivered ${e}`,expected:e=>`Expected ${e}`,tracking:"Tracking",trackingByText:"The tracking number comes by text when it ships.",trackOn:e=>`Track on ${e}`,trackLink:"",inThisOrder:"In this order",orderItemLine:(e,t)=>`Qty ${e}${t?" · subscription box":""}`,paidWith:"Paid with",buyAgain:"Buy again",orderHelp:"Get help with this order",addWeightTitle:`Add ${t.poss} weight to size ${t.poss} dose`,addWeightBody:`From a home scale or ${t.poss} last vet visit.`,connectRecordsTitle:`Connect ${t.poss} vet records`,connectRecordsBody:`${t.Poss} weight, visits and labs make ${t.poss} plan sharper.`,weightKicker:`${t.Poss} weight`,weightTitle:e=>`Add ${i(e)}'s weight`,weightBody:`From a home scale or ${t.poss} last vet visit. ${t.Poss} plan uses it to size ${t.poss} dose.`,weightField:`${t.Poss} weight`,weightUnit:"lb",weightUnitKg:"kg",weightErrorKg:"Enter your pet’s weight",weightError:`Enter ${t.poss} weight in pounds, like 14.1.`,weightSave:`Save ${t.poss} weight`,weightSaved:e=>`Saved: ${e} lb. ${t.Poss} dose is sized for ${t.obj}.`,weightSavedKg:e=>`Saved: ${e} kg. ${t.Poss} dose is sized for ${t.obj}.`,checkoutFailed:"That didn't go through. Please try again.",builtWith:e=>`Built with ${e}`,fromVet:e=>`From ${e}`,waitVetTips:e=>`Free tips from ${e}, built around that risk`,signalsFit:e=>`${e} of ${e} signals fit ${t.Name}`,signalsValue:e=>`${e}/${e}`,noPick:`No supplement for this one. ${t.Poss} vet comes first.`,callYourVet:"Call your vet today",callAVet:"Call a vet today",saveForCheckup:`Save for ${t.poss} next checkup`,savedForCheckup:`Saved for ${t.poss} next checkup`,blanksLabel:`${t.Poss} three blanks`,blanksAsked:e=>`Asked ${e}`,blanksAskedNoClinic:"",blanksWaitPill:"2 to 5 days",blanksFilledKicker:`From ${t.poss} vet records`,blanksFilled:(e,t)=>`${e} of ${t} filled`,blanksWeight:`Keep ${t.obj} at `,blanksWeightSource:`From ${t.poss} vet visits`,blanksDose:(e,t)=>`${e} of ${t}`,blanksDoseSource:`Sized to ${t.poss} weight`,blanksShots:`${t.Poss} next shots are due `,blanksShotsSource:`From ${t.poss} clinic`,blankEmpty:"blank",recordsLanded:`${t.Poss} records are in. ${t.Poss} plan now uses ${t.poss} weight and ${t.poss} visits.`,todayLabel:`${t.Poss} Health Plan`,poweredBy:"powered by",poweredByName:"Everfur",seeMore:"See more",seeLess:"See less",reportActions:"Actions to take",openReport:`Open it in ${t.poss} report`,askReport:"Ask about it",fullOpen:`See ${t.poss} full plan`,fullOpenLine:`${t.Poss} vet, reviews and ${t.poss} checkup`,fullClose:`Show ${t.poss} brief plan`,fullCloseLine:`${t.Poss} risk, tips, pick and signs`,hopeNoted:e=>`Noted. When ${t.poss} results land, we'll start with ${e}.`,productLink:e=>`${e}, see the product`,productPhotos:e=>`${e} photos, swipe for more`,shopAll:"Shop all",madeFor:`Made for ${t.name}`,ratingLine:e=>`· ${e} reviews`,productOffer:e=>`${e.discountPercent}% off ${t.poss} first box`,productEvery:e=>`Every ${e.intervalDays} days`,productOnce:e=>e.onceDiscountPercent>0?`One box, ${e.onceDiscountPercent}% off`:"One box",productExtraBox:"An extra box",productOnPlan:e=>`On ${t.poss} plan, every ${e.intervalDays} days. This adds one extra box.`,quantity:"Quantity",description:"Description",readMore:"Read more",readLess:"Read less",whatsInside:"What's inside",howMuch:"How much",reviewsTitle:"Reviews",reviewCount:e=>`${e} reviews`,reviewsSwipe:"Reviews, swipe for more",readAllReviews:e=>`Read all ${e} reviews`,starsLabel:e=>`${e} out of 5 stars`,buyNow:"Buy now"});return r}var je=healthPlanFocusCopyFor({sex:"female"});function formatHealthPlanDay(e,t){if(e===null||!/^\d{4}-\d{2}-\d{2}$/.test(e))return null;let i=/* @__PURE__ */new Date(`${e}T00:00:00Z`);if(Number.isNaN(i.getTime()))return null;try{return new Intl.DateTimeFormat(t??"en-US",{month:"short",day:"numeric",timeZone:"UTC"}).format(i)}catch{return e}}function ze(e){return e!=null&&(e.wait!==void 0||e.pick.hidden===true)}function Ce(e){return{...e,pick:{...e.pick,none:true,hidden:true}}}var Se=/* @__PURE__ */Object.freeze({productId:"",partnerSku:null,title:"",description:null,category:null,price:null,currency:null,imageUrl:null,url:null,reasons:[],inPlan:false,sample:false});var Pe=/* @__PURE__ */Object.freeze({track(){},trackExpectedFailure(){}});function ok(e,t){/* @__PURE__ */
4
4
  return Object.freeze({ok:true,value:e})}function err(e){/* @__PURE__ */
5
5
  return Object.freeze({ok:false,error:e})}var Te=class _EverfurConfigError extends Error{constructor(e,t){super(t),this.name="EverfurConfigError",this.kind=e,Object.setPrototypeOf(this,_EverfurConfigError.prototype)}};var Fe=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurContext@v1"),$e=globalThis,Oe=$e[Fe]??($e[Fe]=e.createContext(null));Oe.displayName??="EverfurContext";function Ee(){let t=e.useContext(Oe);if(t===null)throw new Te("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return t}var Ie=/* @__PURE__ */Object.freeze({opened:"health_plan.opened",productClicked:"health_plan.product_clicked",checkoutStarted:"health_plan.checkout_started"});function Le(){return e.useContext(Oe)?.runtime.registry.services.telemetry??Pe}var He=e.createContext(null);function HealthPlanPetScope({petRef:petRef,children:t}){return e.createElement(He.Provider,{value:petRef},t)}function Re(t){let i=e.useContext(He),r=e.useContext(Oe);return i??t??r?.activePet??null}function De(t,petRef,i){let r=Le(),n=e.useRef(null);e.useEffect(()=>{if(!t||petRef===null||n.current===petRef)return;n.current=petRef;let e=i?.items??[];r.track(Ie.opened,{petRef:petRef,itemsCount:e.length,inPlanCount:e.filter(e=>e.inPlan).length})},[t,petRef,i,r])}function Ne(e,petRef,t,i){e.track(Ie.productClicked,{petRef:petRef,productId:t,inPlan:i})}function Be(e,petRef,t){e.track(Ie.checkoutStarted,{petRef:petRef,itemsCount:t.count,subtotal:t.subtotal,currency:t.currency})}var Ae=[{wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"AuthorizationException",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"ConflictException",envelope:"http_envelope",httpStatus:409,retryable:true},{wireCode:"DAILY_QUOTA_EXCEEDED",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"FILE_TOO_LARGE",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"IDEMPOTENCY_KEY_IN_FLIGHT",envelope:"http_envelope",httpStatus:409,retryable:true},{wireCode:"IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"INVALID_CONTENT_TYPE",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"InternalFailureException",envelope:"http_envelope",httpStatus:500,retryable:true},{wireCode:"MethodNotAllowedException",envelope:"http_envelope",httpStatus:405,retryable:false},{wireCode:"NotImplementedException",envelope:"http_envelope",httpStatus:501,retryable:false},{wireCode:"PaymentRequiredException",envelope:"http_envelope",httpStatus:402,retryable:false},{wireCode:"ResourceNotFoundException",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"ServiceUnavailableException",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"TIER_UPGRADE_REQUIRED",envelope:"http_envelope",httpStatus:402,retryable:false},{wireCode:"ThrottlingException",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"ValidationException",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"accessDenied",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"access_denied",envelope:"oauth_error",httpStatus:302,retryable:false},{wireCode:"anchor_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"anchor_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"anonTokenInvalid",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"attachment_unreadable",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"authExpired",envelope:"http_envelope",httpStatus:401,retryable:true},{wireCode:"authRejected",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"before_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"bundle_mismatch",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"bundle_not_uploaded",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"bundles_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"catalog_empty_refused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"catalog_shrink_refused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"consent_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"consent_required",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"consent_scope_wrong_route",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"device_cipher_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"email_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"endpoint_not_allowed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"environment_mismatch",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"event_cursor_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_id_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"event_payload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_type_not_available",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_type_unknown",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_required",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_reused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"inbox_cursor_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"insufficientCapability",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"insufficient_scope",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"internal_error",envelope:"sse_frame",httpStatus:200,retryable:false},{wireCode:"invalidRequest",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"invalid_client",envelope:"oauth_error",httpStatus:401,retryable:false},{wireCode:"invalid_client_metadata",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_grant",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_redirect_uri",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_request",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_scope",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_target",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"item_id_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"linked_account_read_only",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"mcp_connection_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"mcp_request_conflict",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"mcp_request_gone",envelope:"http_envelope",httpStatus:410,retryable:false},{wireCode:"mcp_request_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"not_found",envelope:"sse_frame",httpStatus:200,retryable:false},{wireCode:"not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"open_url_not_allowed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"partner_visit_link_conflict",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"partner_visit_owner_only",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"partner_visit_pet_already_mapped",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"payload_too_large",envelope:"http_envelope",httpStatus:413,retryable:false},{wireCode:"petRefInUse",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"pet_health_list_removals_unconfirmed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"pet_health_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"pet_not_registered",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"provider_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"rateLimited",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"read_target_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"record_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"record_subject_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"record_upload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"records_consent_required",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"restricted_key",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"sandbox_only",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"session_required",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"session_revoked",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"share_limit_reached",envelope:"http_envelope",httpStatus:429,retryable:false},{wireCode:"slow_down",envelope:"oauth_error",httpStatus:429,retryable:true},{wireCode:"species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"subscription_keys_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"tenant_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"tenant_has_no_capabilities",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"tenant_resource_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"tenant_surface_not_enabled",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"ticket_not_resolved",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"tickets_disabled",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"timeout",envelope:"sse_frame",httpStatus:200,retryable:true},{wireCode:"timezone_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"token_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"unavailable",envelope:"sse_frame",httpStatus:200,retryable:true},{wireCode:"unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"unrestrictedKeyRequired",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"unsupported_grant_type",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"unsupported_response_type",envelope:"oauth_error",httpStatus:302,retryable:false},{wireCode:"user_ref_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"verify_mint_rate_limited",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"verify_mint_refused",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"verify_mint_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"verify_user_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"web_push_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"webhook_endpoint_update_empty",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"webhook_endpoint_update_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false}],Me=/* @__PURE__ */Object.freeze(Ae.map(e=>/* @__PURE__ */Object.freeze(e)));/* @__PURE__ */Object.freeze(Me.map(e=>e.wireCode));var We=/* @__PURE__ */Object.freeze({ValidationException:"validationFailed",AuthorizationException:"authRejected",PaymentRequiredException:"paymentRequired",AccessDeniedException:"accessDenied",ResourceNotFoundException:"resourceNotFound",ConflictException:"conflict",ThrottlingException:"rateLimited",InternalFailureException:"internalError",NotImplementedException:"notImplemented",ServiceUnavailableException:"serviceUnavailable",MethodNotAllowedException:"validationFailed",authExpired:"authExpired",unavailable:"serviceUnavailable",session_required:"sessionRequired",session_revoked:"authExpired",anonTokenInvalid:"authRejected",accessDenied:"accessDenied",invalidRequest:"sdkUpdateRequired",authRejected:"authRejected",rateLimited:"rateLimited",insufficientCapability:"accessDenied",unrestrictedKeyRequired:"accessDenied",user_ref_invalid:"validationFailed",event_cursor_invalid:"validationFailed",event_filter_invalid:"validationFailed",event_payload_invalid:"validationFailed",event_type_unknown:"validationFailed",idempotency_key_invalid:"validationFailed",idempotency_key_required:"validationFailed",idempotency_key_reused:"idempotencyConflict",payload_too_large:"validationFailed",webhook_url_rejected:"validationFailed",webhook_endpoint_update_empty:"validationFailed",webhook_endpoint_update_invalid:"validationFailed",event_type_not_available:"conflict",record_subject_not_found:"resourceNotFound",records_consent_required:"conflict",record_species_unsupported:"validationFailed",record_upload_invalid:"validationFailed",FILE_TOO_LARGE:"validationFailed",INVALID_CONTENT_TYPE:"validationFailed",attachment_unreadable:"validationFailed",provider_unsupported:"validationFailed",token_invalid:"validationFailed",device_cipher_unavailable:"serviceUnavailable",email_invalid:"validationFailed",consent_required:"validationFailed",consent_invalid:"validationFailed",consent_scope_wrong_route:"validationFailed",IDEMPOTENCY_KEY_IN_FLIGHT:"idempotencyInFlight",IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST:"idempotencyConflict",DAILY_QUOTA_EXCEEDED:"quotaExceeded",TIER_UPGRADE_REQUIRED:"paymentRequired",not_found:"conversationNotFound",timeout:"streamTimeout",internal_error:"internalError",invalid_request:"validationFailed",invalid_client:"authRejected",invalid_grant:"authRejected",unsupported_grant_type:"validationFailed",invalid_scope:"validationFailed",invalid_target:"validationFailed",invalid_redirect_uri:"validationFailed",invalid_client_metadata:"validationFailed",unsupported_response_type:"validationFailed",access_denied:"accessDenied",slow_down:"rateLimited",mcp_request_not_found:"resourceNotFound",mcp_request_gone:"resourceNotFound",mcp_connection_not_found:"resourceNotFound",mcp_request_conflict:"conflict",sandbox_only:"accessDenied",tenant_has_no_capabilities:"conflict",verify_mint_refused:"accessDenied",verify_mint_rate_limited:"rateLimited",verify_mint_unavailable:"serviceUnavailable",verify_user_ref_invalid:"validationFailed",insufficient_scope:"accessDenied",tenant_filter_invalid:"validationFailed",tenant_resource_not_found:"resourceNotFound",tenant_surface_not_enabled:"conflict",pet_health_species_unsupported:"validationFailed",pet_health_list_removals_unconfirmed:"validationFailed",petRefInUse:"conflict",share_limit_reached:"conflict",pet_not_registered:"resourceNotFound",species_unsupported:"validationFailed",partner_visit_owner_only:"accessDenied",partner_visit_link_conflict:"conflict",partner_visit_pet_already_mapped:"conflict",linked_account_read_only:"conflict",catalog_empty_refused:"conflict",catalog_shrink_refused:"conflict",endpoint_not_allowed:"validationFailed",event_id_invalid:"validationFailed",inbox_cursor_invalid:"validationFailed",item_id_invalid:"validationFailed",open_url_not_allowed:"validationFailed",read_target_invalid:"validationFailed",subscription_keys_invalid:"validationFailed",web_push_unavailable:"serviceUnavailable",anchor_not_found:"resourceNotFound",anchor_ref_invalid:"validationFailed",before_invalid:"validationFailed",bundle_mismatch:"validationFailed",bundle_not_uploaded:"validationFailed",bundles_unavailable:"serviceUnavailable",environment_mismatch:"validationFailed",restricted_key:"accessDenied",ticket_not_resolved:"conflict",tickets_disabled:"resourceNotFound",timezone_invalid:"validationFailed"}),qe=/* @__PURE__ */Object.freeze(Me.map(e=>/* @__PURE__ */Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:We[e.wireCode]}))),Ue=new Map(qe.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),Ke=/* @__PURE__ */Object.freeze(["http_envelope",...[...new Set(qe.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function contractErrorFor(e,t){if(typeof e!="string")return;let i=e.trim().toUpperCase();if(i.length!==0)for(let e of[t??"http_envelope",...Ke]){let t=Ue.get(e+i);if(t)return t}}var Ve=/* @__PURE__ */Object.freeze({authExpired:"authentication",authRejected:"authentication",sessionRequired:"authentication",identitySignatureRequired:"authentication",accessDenied:"authorization",paymentRequired:"entitlement",quotaExceeded:"rateLimit",rateLimited:"rateLimit",validationFailed:"invalidRequest",sdkUpdateRequired:"invalidRequest",runtimeDisposed:"invalidRequest",conversationNotFound:"notFound",petNotFound:"notFound",resourceNotFound:"notFound",conflict:"conflict",idempotencyConflict:"conflict",idempotencyInFlight:"conflict",streamTimeout:"connection",streamIncomplete:"connection",upstreamLlmTimeout:"connection",serviceUnavailable:"connection",internalError:"server",notImplemented:"server",mediaUploadFailed:"media",moderationBlocked:"policy",unknown:"unknown"});function categoryFor(e){return Ve[e]}function fromWire(e){let t=contractErrorFor(e);if(t)return t.normalized;let i=(e??"").trim().toUpperCase(),r=i.replace(/[^A-Z0-9]/g,"");if(r==="AUTHREJECTED")return"authRejected";if(i.startsWith("AUTH"))return"authExpired";switch(r){case"DAILYQUOTAEXCEEDED":case"QUOTAEXCEEDED":return"quotaExceeded";case"RATELIMITED":case"TOOMANYREQUESTS":case"TELEVETRATELIMITED":return"rateLimited";case"IDEMPOTENCYKEYCONFLICT":case"IDEMPOTENCYCONFLICT":return"idempotencyConflict";case"ACCESSDENIED":case"FORBIDDEN":return"accessDenied";case"IDENTITYSIGNATUREREQUIRED":return"identitySignatureRequired";case"FREECAPREACHED":return"paymentRequired";case"RUNTIMEDISPOSED":return"runtimeDisposed";case"NOTFOUND":case"CONVERSATIONNOTFOUND":return"conversationNotFound";case"PETNOTFOUND":return"petNotFound";case"TIMEOUT":case"STREAMTIMEOUT":return"streamTimeout";case"MEDIAUPLOADFAILED":case"UNRECOGNIZEDVIDEOFORMAT":case"FILETOOSMALL":return"mediaUploadFailed";case"MODERATIONBLOCKED":return"moderationBlocked";case"UPSTREAMLLMTIMEOUT":return"upstreamLlmTimeout";case"INTERNALERROR":case"INTERNALSERVERERROR":return"internalError";case"STREAMINCOMPLETE":case"CHATSTREAMINCOMPLETE":return"streamIncomplete";case"INVALIDANALYSISTYPE":case"INVALIDUPLOADPURPOSE":return"unknown";default:return"unknown"}}var Ge=/* @__PURE__ */new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function isAutoRetryable(e){return Ge.has(e)}var Ye=/* @__PURE__ */new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function isRetryableCode(e){return isAutoRetryable(e)||Ye.has(e)}var Xe=500,Qe=8e3,Ze=4;function backoffDelayMs(e,t=Math.random){let i=Math.max(0,e),r=Math.min(Xe*2**i,Qe);return Math.floor(t()*r)}var Je="This feature isn't available on your account right now.",et="Something in that request was not right. Check the details and try again.",tt=/* @__PURE__ */Object.freeze({authExpired:"Please sign in again to continue.",authRejected:"Please sign in again to continue.",sessionRequired:"This app needs to be updated to keep using Everfur.",accessDenied:Je,paymentRequired:"This is part of a paid plan.",quotaExceeded:"You have used today's messages. This resets tomorrow.",rateLimited:"You are sending messages quickly. Try again in a few seconds.",validationFailed:et,sdkUpdateRequired:"This app needs to be updated to keep using Everfur.",conflict:"That is already running. Wait for it to finish, then try again.",idempotencyConflict:"That message was already delivered.",idempotencyInFlight:"That is still processing. Give it a moment.",conversationNotFound:"This conversation is no longer available.",petNotFound:"We could not find that pet. Please pick a pet and try again.",resourceNotFound:"We could not find that.",streamTimeout:"The response timed out. Tap retry to try again.",mediaUploadFailed:"We could not upload that photo. Please attach it again.",moderationBlocked:"This request cannot be answered here.",upstreamLlmTimeout:"The response timed out. Tap retry to try again.",internalError:"We hit a snag on our end. Please try again.",notImplemented:"That is not available yet.",serviceUnavailable:"That service is briefly unavailable. Try again shortly.",streamIncomplete:"The connection dropped mid-answer. Tap retry to continue.",identitySignatureRequired:Je,runtimeDisposed:et,unknown:"Something went wrong. Please try again."}),it="This session has ended. Please sign in again.",rt="linked_account_read_only";function nt(e,t,i){return e==="conflict"&&i===rt?Je:(e==="authRejected"||e==="authExpired")&&typeof t=="string"&&t.trim().toLowerCase()==="session_revoked"?it:userFacingError(e)}function userFacingError(e){return tt[e]}function ot(e,t,i){Object.defineProperty(e,t,{value:i,enumerable:false,writable:false,configurable:false})}var at=/^[a-z][a-z0-9_]{0,63}$/;function makeEverfurError(e,t){let i=contractErrorFor(t?.wireCode,t?.wireEnvelope),r=e==="conflict"&&t?.reasonCode===rt,n={code:e,category:categoryFor(e),retryable:t?.retryable??(r?false:isRetryableCode(e)),displayMessage:nt(e,t?.wireCode,r?rt:null)};t?.httpStatus!==void 0&&(n.httpStatus=t.httpStatus),t?.requestId&&(n.requestId=t.requestId),typeof t?.reasonCode=="string"&&at.test(t.reasonCode)&&(n.reasonCode=t.reasonCode);let o=t?.retryAfterSeconds;if(typeof o=="number"&&Number.isFinite(o)&&o>=0&&(n.retryAfterSeconds=Math.round(o)),i);return t?.wireMessage&&ot(n,"wireMessage",t.wireMessage),t?.raw!==void 0&&t.raw!==null&&ot(n,"raw",t.raw),/* @__PURE__ */Object.freeze(n)}function assertNever(e){throw new Error(`assertNever: unhandled discriminated-union member ${JSON.stringify(e)}`)}function errorFrame(e){/* @__PURE__ */
6
- return Object.freeze({kind:"error",terminal:true,code:e.code,retryable:e.retryable,wireMessage:e.wireMessage,synthesized:e.synthesized,lastEventId:e.lastEventId,serverRequestId:null,...e.freeCap?{freeCap:/* @__PURE__ */Object.freeze({...e.freeCap})}:{}})}var st="x-everfur-anon-token",lt="anonTokenInvalid";async function ut(e){if(e.userRef!==null||e.anonIdentity===void 0)return null;try{return await e.anonIdentity.token()}catch{return null}}function ct(e,t){let i=e instanceof Error?e.message:typeof e=="string"?e:null;return makeEverfurError("authRejected",{retryable:false,...t?.wireCode?{wireCode:t.wireCode}:{},...t?.requestId?{requestId:t.requestId}:{},...i?{wireMessage:i}:{},...e!=null?{raw:e}:{}})}function authHeaders(e){let t={};return e.mode==="personalized"?t.authorization=`Bearer ${e.token}`:(t["x-everfur-partner-key"]=e.publishableKey,e.anonToken&&(t[st]=e.anonToken)),e.userRef&&(t["x-everfur-user-ref"]=e.userRef),e.sessionId&&(t["x-everfur-session-id"]=e.sessionId),t}function withAuthHeaders(e,t){return{...e,headers:{...dt(e.headers),...authHeaders(t)}}}function dt(e){if(!e)return{};let t={};for(let[i,r]of Object.entries(e)){let e=i.toLowerCase();e==="authorization"||e==="x-everfur-partner-key"||e===st||(t[i]=r)}return t}async function authedSend(e,t){if(t.mode==="anonymous"){let i=await ut(t),r=await t.transport.request(withAuthHeaders(e,pt(t,i)));if(r.ok||mt(r.error.raw)!==lt||t.anonIdentity===void 0||t.userRef!==null)return r;let n=await t.anonIdentity.token({forceRefresh:true});return n===null||n===i?r:t.transport.request(withAuthHeaders(e,pt(t,n)))}let i;try{i=await t.identity.currentToken()}catch(e){return t.identity.reportRejected?.(),err(ct(e))}let r=await t.transport.request(withAuthHeaders(e,{mode:"personalized",token:i,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));if(r.ok||r.error.httpStatus!==401)return r;let n;try{n=await t.identity.currentToken({forceRefresh:!0})}catch(e){return t.identity.reportRejected?.(),err(ct(e,{wireCode:mt(r.error.raw),requestId:r.error.requestId}))}let o=await t.transport.request(withAuthHeaders(e,{mode:"personalized",token:n,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));return!o.ok&&o.error.httpStatus===401?(t.identity.reportRejected?.(),err(ft(o.error))):o}function pt(e,t){return{mode:"anonymous",publishableKey:e.publishableKey,userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{},...t!==null?{anonToken:t}:{}}}function ft(e){let t=e.raw,i=mt(t);return makeEverfurError("authRejected",{retryable:false,...e.httpStatus!==void 0?{httpStatus:e.httpStatus}:{},...e.requestId?{requestId:e.requestId}:{},...i?{wireCode:i}:{},...e.reasonCode?{reasonCode:e.reasonCode}:{},...e.wireMessage?{wireMessage:e.wireMessage}:{},...t!=null?{raw:t}:{}})}function mt(e){if(typeof e!="object"||e===null)return null;let t=e,i=(typeof t.error=="object"&&t.error!==null?t.error.code:void 0)??t.code;return typeof i=="string"&&i.length>0?i:null}function ht(e,t){let i=globalThis.URL;if(typeof i=="function"){let r;try{r=t===void 0?new i(e):new i(e,t)}catch{return null}try{if(r.protocol)return r}catch{}}return xt(e)}var gt=/^([a-z][a-z0-9+.-]*):\/\/(?:([^:@/?#]*)(?::([^@/?#]*))?@)?(\[[0-9a-f:.]+\]|[\w.~-]+)(?::(\d*))?(\/[^?#]*)?(\?[^#]*)?(#.*)?$/i,bt=/[\s\u0000-\u001f\u007f\\]/,vt={"http:":"80","https:":"443"};function xt(e,t){let i=e.trim();let r=bt.test(i)?null:gt.exec(i);if(r===null)return null;let[,n="",o="",a="",s="",l="",u="",c="",d=""]=r,p=`${n.toLowerCase()}:`,f=Number(l);if(f>65535)return null;let m=l===""||String(f)===vt[p]?"":String(f),h=vt[p]!==void 0,g=s.toLowerCase()+(m&&`:${m}`),b=u||(h?"/":""),v=o||a?`${o}${a&&`:${a}`}@`:"";return{href:`${p}//${v}${g}${b}${c}${d}`,protocol:p,username:o,password:a,hostname:s.toLowerCase(),port:m,origin:h?`${p}//${g}`:"null",pathname:b,search:c==="?"?"":c,hash:d==="#"?"":d}}var yt="1.5.0";function networkError(e){return makeEverfurError("internalError",{retryable:true,wireMessage:wt(e)})}function wt(e){return e instanceof Error?e.message:typeof e=="string"?e:"network request failed"}var kt=3e4,_t=Qe*2,jt="idempotency-key",zt=/* @__PURE__ */new Set(["POST","PUT","PATCH","DELETE"]),Ct=/* @__PURE__ */Object.freeze({onEvent(){}}),St=/* @__PURE__ */Object.freeze({setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),now:()=>Date.now()});function Pt(e){let t=e.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return t.length===0?null:`efs_${t}`.slice(0,128)}function createRequestFunnel(e){let t=e.observer??Ct,i=e.timers??St,r=e.rng??Math.random,n=e.sleep??((e,t)=>qt(e,i,t)),o=e.maxAttempts??Ze,a=e.unaryTimeoutMs??kt,s=e.newIdempotencyKey??Ft(),l=e=>{try{t.onEvent(e)}catch{}};async function u(t,u,c){let d=c?.maxAttempts,p=Math.max(1,d??o),f=c?.idempotent??zt.has(u.method),m=c?.idempotencyKey===void 0?null:Pt(c.idempotencyKey),h=f?m??s():null,g=Tt(u,h),b=0;for(;;){let o=e=>/* @__PURE__ */Object.freeze({call:t,method:u.method,path:u.path,attempt:b,...h?{idempotencyKey:h}:{},...e});l(o({phase:"attempt"}));let s=Mt(a,i),c=Wt(s.signal,u.signal),f;try{f=await authedSend({...g,signal:c.signal},e.auth)}catch(e){f=err(networkError(e))}finally{c.dispose(),s.cancel()}if(f.ok)return l(o({phase:"settled",ok:true,reason:"ok"})),f;let m=f.error,v=Ot(m,b,{maxAttempts:p,rng:r,now:i.now(),aborted:u.signal?.aborted===true,...d!==void 0?{perCallMaxAttempts:d}:{},...e.errorPolicy!==void 0?{policy:e.errorPolicy}:{}}),x={ok:false,code:m.code,reason:v.reason,...m.httpStatus!==void 0?{httpStatus:m.httpStatus}:{},...m.requestId!==void 0?{requestId:m.requestId}:{}};if(!v.retry)return l(o({phase:"settled",...x})),err(m);if(l(o({phase:"retry",...x,delayMs:v.delayMs})),await n(v.delayMs,u.signal),u.signal?.aborted===true)return l(o({phase:"settled",...x,reason:"aborted"})),err(m);b+=1}}async function c(t){return withAuthHeaders(t,await At(e.auth))}async function*d(t,i,r){l(
6
+ return Object.freeze({kind:"error",terminal:true,code:e.code,retryable:e.retryable,wireMessage:e.wireMessage,synthesized:e.synthesized,lastEventId:e.lastEventId,serverRequestId:null,...e.freeCap?{freeCap:/* @__PURE__ */Object.freeze({...e.freeCap})}:{}})}var st="x-everfur-anon-token",lt="anonTokenInvalid";async function ut(e){if(e.userRef!==null||e.anonIdentity===void 0)return null;try{return await e.anonIdentity.token()}catch{return null}}function ct(e,t){let i=e instanceof Error?e.message:typeof e=="string"?e:null;return makeEverfurError("authRejected",{retryable:false,...t?.wireCode?{wireCode:t.wireCode}:{},...t?.requestId?{requestId:t.requestId}:{},...i?{wireMessage:i}:{},...e!=null?{raw:e}:{}})}function authHeaders(e){let t={};return e.mode==="personalized"?t.authorization=`Bearer ${e.token}`:(t["x-everfur-partner-key"]=e.publishableKey,e.anonToken&&(t[st]=e.anonToken)),e.userRef&&(t["x-everfur-user-ref"]=e.userRef),e.sessionId&&(t["x-everfur-session-id"]=e.sessionId),t}function withAuthHeaders(e,t){return{...e,headers:{...dt(e.headers),...authHeaders(t)}}}function dt(e){if(!e)return{};let t={};for(let[i,r]of Object.entries(e)){let e=i.toLowerCase();e==="authorization"||e==="x-everfur-partner-key"||e===st||(t[i]=r)}return t}async function authedSend(e,t){if(t.mode==="anonymous"){let i=await ut(t),r=await t.transport.request(withAuthHeaders(e,pt(t,i)));if(r.ok||mt(r.error.raw)!==lt||t.anonIdentity===void 0||t.userRef!==null)return r;let n=await t.anonIdentity.token({forceRefresh:true});return n===null||n===i?r:t.transport.request(withAuthHeaders(e,pt(t,n)))}let i;try{i=await t.identity.currentToken()}catch(e){return t.identity.reportRejected?.(),err(ct(e))}let r=await t.transport.request(withAuthHeaders(e,{mode:"personalized",token:i,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));if(r.ok||r.error.httpStatus!==401)return r;let n;try{n=await t.identity.currentToken({forceRefresh:!0})}catch(e){return t.identity.reportRejected?.(),err(ct(e,{wireCode:mt(r.error.raw),requestId:r.error.requestId}))}let o=await t.transport.request(withAuthHeaders(e,{mode:"personalized",token:n,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));return!o.ok&&o.error.httpStatus===401?(t.identity.reportRejected?.(),err(ft(o.error))):o}function pt(e,t){return{mode:"anonymous",publishableKey:e.publishableKey,userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{},...t!==null?{anonToken:t}:{}}}function ft(e){let t=e.raw,i=mt(t);return makeEverfurError("authRejected",{retryable:false,...e.httpStatus!==void 0?{httpStatus:e.httpStatus}:{},...e.requestId?{requestId:e.requestId}:{},...i?{wireCode:i}:{},...e.reasonCode?{reasonCode:e.reasonCode}:{},...e.wireMessage?{wireMessage:e.wireMessage}:{},...t!=null?{raw:t}:{}})}function mt(e){if(typeof e!="object"||e===null)return null;let t=e,i=(typeof t.error=="object"&&t.error!==null?t.error.code:void 0)??t.code;return typeof i=="string"&&i.length>0?i:null}function ht(e,t){let i=globalThis.URL;if(typeof i=="function"){let r;try{r=t===void 0?new i(e):new i(e,t)}catch{return null}try{if(r.protocol)return r}catch{}}return xt(e)}var gt=/^([a-z][a-z0-9+.-]*):\/\/(?:([^:@/?#]*)(?::([^@/?#]*))?@)?(\[[0-9a-f:.]+\]|[\w.~-]+)(?::(\d*))?(\/[^?#]*)?(\?[^#]*)?(#.*)?$/i,bt=/[\s\u0000-\u001f\u007f\\]/,vt={"http:":"80","https:":"443"};function xt(e,t){let i=e.trim();let r=bt.test(i)?null:gt.exec(i);if(r===null)return null;let[,n="",o="",a="",s="",l="",u="",c="",d=""]=r,p=`${n.toLowerCase()}:`,f=Number(l);if(f>65535)return null;let m=l===""||String(f)===vt[p]?"":String(f),h=vt[p]!==void 0,g=s.toLowerCase()+(m&&`:${m}`),b=u||(h?"/":""),v=o||a?`${o}${a&&`:${a}`}@`:"";return{href:`${p}//${v}${g}${b}${c}${d}`,protocol:p,username:o,password:a,hostname:s.toLowerCase(),port:m,origin:h?`${p}//${g}`:"null",pathname:b,search:c==="?"?"":c,hash:d==="#"?"":d}}var yt="1.5.1";function networkError(e){return makeEverfurError("internalError",{retryable:true,wireMessage:wt(e)})}function wt(e){return e instanceof Error?e.message:typeof e=="string"?e:"network request failed"}var kt=3e4,_t=Qe*2,jt="idempotency-key",zt=/* @__PURE__ */new Set(["POST","PUT","PATCH","DELETE"]),Ct=/* @__PURE__ */Object.freeze({onEvent(){}}),St=/* @__PURE__ */Object.freeze({setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),now:()=>Date.now()});function Pt(e){let t=e.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return t.length===0?null:`efs_${t}`.slice(0,128)}function createRequestFunnel(e){let t=e.observer??Ct,i=e.timers??St,r=e.rng??Math.random,n=e.sleep??((e,t)=>qt(e,i,t)),o=e.maxAttempts??Ze,a=e.unaryTimeoutMs??kt,s=e.newIdempotencyKey??Ft(),l=e=>{try{t.onEvent(e)}catch{}};async function u(t,u,c){let d=c?.maxAttempts,p=Math.max(1,d??o),f=c?.idempotent??zt.has(u.method),m=c?.idempotencyKey===void 0?null:Pt(c.idempotencyKey),h=f?m??s():null,g=Tt(u,h),b=0;for(;;){let o=e=>/* @__PURE__ */Object.freeze({call:t,method:u.method,path:u.path,attempt:b,...h?{idempotencyKey:h}:{},...e});l(o({phase:"attempt"}));let s=Mt(a,i),c=Wt(s.signal,u.signal),f;try{f=await authedSend({...g,signal:c.signal},e.auth)}catch(e){f=err(networkError(e))}finally{c.dispose(),s.cancel()}if(f.ok)return l(o({phase:"settled",ok:true,reason:"ok"})),f;let m=f.error,v=Ot(m,b,{maxAttempts:p,rng:r,now:i.now(),aborted:u.signal?.aborted===true,...d!==void 0?{perCallMaxAttempts:d}:{},...e.errorPolicy!==void 0?{policy:e.errorPolicy}:{}}),x={ok:false,code:m.code,reason:v.reason,...m.httpStatus!==void 0?{httpStatus:m.httpStatus}:{},...m.requestId!==void 0?{requestId:m.requestId}:{}};if(!v.retry)return l(o({phase:"settled",...x})),err(m);if(l(o({phase:"retry",...x,delayMs:v.delayMs})),await n(v.delayMs,u.signal),u.signal?.aborted===true)return l(o({phase:"settled",...x,reason:"aborted"})),err(m);b+=1}}async function c(t){return withAuthHeaders(t,await At(e.auth))}async function*d(t,i,r){l(
7
7
  /* @__PURE__ */Object.freeze({call:t,phase:"stream.open",method:i.method,path:i.path,attempt:0}));try{yield*e.auth.transport.stream(i,r)}catch{yield errorFrame({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null})}}/* @__PURE__ */
8
8
  return Object.freeze({send:u,authorize:c,stream:d})}function Tt(e,t){let i={};for(let[t,r]of Object.entries(e.headers??{}))t.toLowerCase()!==jt&&(i[t]=r);return t!==null&&(i["Idempotency-Key"]=t),{...e,headers:i}}function Ft(){let e=0;return()=>`efk_${Date.now().toString(36)}_${(e++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}var $t=10;function Ot(e,t,i){if(i.aborted)return{retry:false,reason:"aborted"};let r=Et(e);if(r==="quota")return{retry:false,reason:"daily-quota-exhausted"};if(r!=="burst"&&!isAutoRetryable(e.code))return{retry:false,reason:"terminal-code"};let n=r==="burst"?"burst-throttle":"retryable-code";if((()=>{if(i.policy===void 0)return false;try{return!i.policy.shouldRetry(e.code,t)}catch{return false}})())return{retry:false,reason:"terminal-code"};let o=()=>{if(i.policy===void 0)return null;let t;try{t=i.policy.maxAttempts(e.code)}catch{return null}return typeof t!="number"||!Number.isFinite(t)?null:Math.max(1,Math.min($t,Math.floor(t)))},a=i.perCallMaxAttempts??o()??i.maxAttempts;if(t+1>=a)return{retry:false,reason:"attempts-exhausted"};let s=It(e,i.now);return s!==null?s>_t?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:n,delayMs:s}:{retry:true,reason:n,delayMs:backoffDelayMs(t,i.rng)}}function Et(e){let t=e.code==="unknown"?fromWire(Nt(e.raw)):e.code;return t==="quotaExceeded"?"quota":t==="rateLimited"||e.httpStatus===429?"burst":null}function It(e,t){let i=Ht(e.raw);if(i!==null){let e=i-t;return e>0?e:0}let r=Lt(e.raw);return r===null?null:Math.round(r*1e3)}function Lt(e){for(let t of Rt(e)){let e=t.retry_after_seconds;if(typeof e=="number"&&Number.isFinite(e)&&e>=0)return e}return null}function Ht(e){for(let t of Rt(e)){let e=t.resets_at,i=Dt(e);if(i!==null)return i}return null}function Rt(e){if(!Bt(e))return[];let t=[e];for(let i of["error","detail"]){let r=e[i];Bt(r)&&t.push(r)}return t}function Dt(e){if(typeof e=="number"&&Number.isFinite(e))return e<1e11?Math.round(e*1e3):Math.round(e);if(typeof e=="string"&&e.trim().length>0){let t=Date.parse(e);return Number.isFinite(t)?t:null}return null}function Nt(e){for(let t of Rt(e)){let e=t.code;if(typeof e=="string"&&e.length>0)return e}return null}function Bt(e){return typeof e=="object"&&e!==null}async function At(e){if(e.mode==="anonymous"){let t=await ut(e);return{mode:"anonymous",publishableKey:e.publishableKey,userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{},...t!==null?{anonToken:t}:{}}}return{mode:"personalized",token:await e.identity.currentToken(),userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{}}}function Mt(e,t){let i=new AbortController,r=t.setTimeout(()=>i.abort(),e);return{signal:i.signal,cancel:()=>t.clearTimeout(r)}}function Wt(e,t){let i=()=>{};if(!t)return{signal:e,dispose:i};let r=new AbortController;if(e.aborted||t.aborted)return r.abort(),{signal:r.signal,dispose:i};let n=()=>r.abort();return e.addEventListener("abort",n,{once:true}),t.addEventListener("abort",n,{once:true}),{signal:r.signal,dispose:()=>{e.removeEventListener("abort",n),t.removeEventListener("abort",n)}}}function qt(e,t,i){return e<=0||i?.aborted===true?Promise.resolve():new Promise(r=>{let n=t.setTimeout(()=>{i?.removeEventListener("abort",o),r()},e),o=()=>{t.clearTimeout(n),r()};i?.addEventListener("abort",o,{once:true})})}function Ut(e){return e!=null&&(e.httpStatus===404||e.category==="notFound")}function Kt(e){return e.code!=="conversationNotFound"?e:makeEverfurError("resourceNotFound",{retryable:false,...e.httpStatus===void 0?{}:{httpStatus:e.httpStatus},...e.requestId===void 0?{}:{requestId:e.requestId},...e.reasonCode===void 0?{}:{reasonCode:e.reasonCode},...e.wireMessage===void 0?{}:{wireMessage:e.wireMessage},...e.raw===void 0?{}:{raw:e.raw}})}function Vt(e){return e.ok?e:err(Kt(e.error))}function Gt(e){return{send:async(...t)=>Vt(await e.send(...t)),authorize:t=>e.authorize(t),stream:(t,i,r)=>e.stream(t,i,r)}}var Yt=/* @__PURE__ */Object.freeze(["dna","records","inside","profile"]),Xt=128;function Qt(e){return makeEverfurError("validationFailed",{retryable:false,wireMessage:e})}function Zt(e){return makeEverfurError("runtimeDisposed",{retryable:false,wireMessage:`the Everfur runtime is disposed; ${e} was called after unmount`})}function Jt(e){return makeEverfurError("internalError",{retryable:false,httpStatus:502,wireMessage:`${e}: the response carried no plan`})}var ei=(e,t=4e3)=>typeof e=="string"&&e.trim().length>0&&e.length<=t?e.trim():null;function ti(e){let t=ei(e,2048);return t===null?null:/^https:\/\/[^\s]+$/i.test(t)?t:null}function ii(e){let t=typeof e=="number"?e:typeof e=="string"&&/^\d+(\.\d+)?$/.test(e.trim())?Number(e):Number.NaN;return Number.isFinite(t)&&t>=0?t:null}function ri(e){return typeof e=="string"&&/^[A-Za-z]{3}$/.test(e)?e.toUpperCase():null}function ni(e){if(!Array.isArray(e))/* @__PURE__ */return Object.freeze([]);let t=[];for(let i of e){if(i===null||typeof i!="object")continue;let e=i,r=ei(e.text,1e3);if(r===null)continue;let n=typeof e.kind=="string"&&Yt.includes(e.kind)?e.kind:"profile";t.push(/* @__PURE__ */Object.freeze({kind:n,text:r}))}/* @__PURE__ */
9
9
  return Object.freeze(t)}var oi=6;function ai(e){return typeof e=="number"&&Number.isFinite(e)&&e>=0&&e<=400?e:null}function si(e,t,i){if(!Array.isArray(e))/* @__PURE__ */return Object.freeze([]);let r=[];for(let n of e){if(r.length>=i)break;if(n===null||typeof n!="object"||Array.isArray(n))continue;let e=t(n);e!==null&&r.push(e)}/* @__PURE__ */