@everfur/sdk 1.5.1 → 1.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{bookingCopy.d-BL2-URcv.d.ts → bookingCopy.d-Bn8bdo89.d.ts} +4 -4
- package/dist/{bookingCopy.d-Dfew1pjY.d.cts → bookingCopy.d-Dg7bPM-U.d.cts} +4 -4
- package/dist/care/index.cjs +2 -2
- package/dist/care/index.js +2 -2
- package/dist/chat/index.cjs +235 -234
- package/dist/chat/index.js +311 -310
- package/dist/chat/lite/index.cjs +339 -338
- package/dist/chat/lite/index.js +314 -313
- package/dist/{chunk-ZYHPCQVM.js → chunk-CFEHTNKX.js} +1 -1
- package/dist/{chunk-NBAOR5TJ.js → chunk-OU5RMGKD.js} +21 -21
- package/dist/{chunk-RD6ZGYEJ.js → chunk-XGF2HYNN.js} +16 -16
- package/dist/{chunk-IO4CGYHT.js → chunk-ZGL2GEEI.js} +1 -1
- package/dist/client/index.cjs +1 -1
- package/dist/client/index.d.cts +1 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.js +1 -1
- package/dist/core/index.cjs +31 -31
- package/dist/core/index.js +31 -31
- package/dist/health-plan/index.cjs +266 -266
- package/dist/health-plan/index.js +443 -443
- package/dist/{idempotency.d-dOFfV91-.d.ts → idempotency.d-CbB07p64.d.ts} +10 -8
- package/dist/{idempotency.d-CFVMhWcv.d.cts → idempotency.d-DrxKLPPe.d.cts} +10 -8
- package/dist/{inbox.d-DJ9xgU1Z.d.ts → inbox.d-B2JXK0uI.d.ts} +1 -1
- package/dist/{inbox.d-CPcMMz-Y.d.cts → inbox.d-CwA1ogzV.d.cts} +1 -1
- package/dist/index.cjs +257 -256
- package/dist/index.js +364 -363
- package/dist/notifications/inbox/index.cjs +28 -28
- package/dist/notifications/inbox/index.d.cts +5 -5
- package/dist/notifications/inbox/index.d.ts +5 -5
- package/dist/notifications/inbox/index.js +53 -53
- package/dist/notifications/index.cjs +1 -1
- package/dist/notifications/index.d.cts +3 -3
- package/dist/notifications/index.d.ts +3 -3
- package/dist/notifications/index.js +1 -1
- package/dist/{optInView.d-ByDJMrMv.d.cts → optInView.d-ChJyJMBA.d.cts} +4 -1
- package/dist/{optInView.d-DVshLxbD.d.ts → optInView.d-Cps7aLQN.d.ts} +4 -1
- package/dist/{parse.d-Cj3fURer.d.ts → parse.d-QjB2LJCd.d.ts} +19 -10
- package/dist/{parse.d-cH7ZmMeo.d.cts → parse.d-_Ttu2h5g.d.cts} +19 -10
- package/dist/records/depth/index.cjs +80 -80
- package/dist/records/depth/index.js +115 -115
- package/dist/records/index.cjs +653 -653
- package/dist/records/index.js +1074 -1074
- package/dist/{route.d-DSYEd2MR.d.ts → route.d-DtuKY5dM.d.ts} +1 -1
- package/dist/{route.d-DCzQh4ix.d.cts → route.d-Nt-r-7IO.d.cts} +1 -1
- package/dist/server/events/index.cjs +1 -1
- package/dist/server/events/index.js +1 -1
- package/dist/server/index.cjs +1 -1
- package/dist/server/index.js +1 -1
- package/dist/shop/index.cjs +188 -188
- package/dist/shop/index.d.cts +2 -2
- package/dist/shop/index.d.ts +2 -2
- package/dist/shop/index.js +386 -386
- package/dist/shop/orders-v2/index.cjs +72 -72
- package/dist/shop/orders-v2/index.js +126 -126
- package/dist/tabs/index.cjs +114 -111
- package/dist/tabs/index.d.cts +18 -5
- package/dist/tabs/index.d.ts +18 -5
- package/dist/tabs/index.js +191 -188
- package/dist/televet/booking/index.cjs +214 -211
- package/dist/televet/booking/index.d.cts +2 -2
- package/dist/televet/booking/index.d.ts +2 -2
- package/dist/televet/booking/index.js +344 -341
- package/dist/televet/call/index.cjs +53 -53
- package/dist/televet/call/index.js +67 -67
- package/dist/texting/index.cjs +8 -8
- package/dist/texting/index.d.cts +2 -2
- package/dist/texting/index.d.ts +2 -2
- package/dist/texting/index.js +8 -8
- package/dist/{useInboxUnread.d-CXiaR3BZ.d.ts → useInboxUnread.d-0DrQPn7J.d.ts} +1 -1
- package/dist/{useInboxUnread.d-DERpMelw.d.cts → useInboxUnread.d-CRcOTkmu.d.cts} +1 -1
- package/dist/web/health-plan/index.cjs +1 -1
- package/dist/web/health-plan/index.js +1 -1
- package/dist/web/inbox/index.cjs +1 -1
- package/dist/web/inbox/index.d.cts +6 -6
- package/dist/web/inbox/index.d.ts +6 -6
- package/dist/web/inbox/index.js +1 -1
- package/dist/web/index.cjs +184 -184
- package/dist/web/index.js +181 -181
- package/dist/web/notifications/index.cjs +1 -1
- package/dist/web/notifications/index.d.cts +2 -2
- package/dist/web/notifications/index.d.ts +2 -2
- package/dist/web/notifications/index.js +1 -1
- package/dist/web/records-sheet/index.cjs +1 -1
- package/dist/web/records-sheet/index.js +1 -1
- package/dist/web/shop/index.cjs +2 -2
- package/dist/web/shop/index.d.cts +2 -2
- package/dist/web/shop/index.d.ts +2 -2
- package/dist/web/shop/index.js +3 -3
- package/dist/web/televet/booking/index.cjs +185 -185
- package/dist/web/televet/booking/index.d.cts +2 -2
- package/dist/web/televet/booking/index.d.ts +2 -2
- package/dist/web/televet/booking/index.js +185 -185
- package/dist/web/televet/call/index.cjs +1 -1
- package/dist/web/televet/call/index.js +1 -1
- package/dist/web/texting/index.cjs +3 -4
- package/dist/web/texting/index.d.cts +2 -2
- package/dist/web/texting/index.d.ts +2 -2
- package/dist/web/texting/index.js +3 -4
- package/dist/web/ui/index.cjs +1 -1
- package/dist/web/ui/index.js +33 -33
- package/package.json +1 -1
|
@@ -1,91 +1,91 @@
|
|
|
1
1
|
/*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
|
|
2
|
-
"use strict";var e=require("react"),t=require("react-native"),r=require("react/jsx-runtime"),n=require("zod");function i(e,t){if(e===void 0)return{};let r={};return e.backgroundColor!==void 0&&(r.backgroundColor=e.backgroundColor),e.borderColor!==void 0&&(r.borderColor=e.borderColor,r.borderWidth=t??1),e.borderRadius!==void 0&&(r.borderRadius=e.borderRadius),r}function a(e){return e?.textColor===void 0?{}:{color:e.textColor}}function o(e){return e.recordCard??e.card}var l=/* @__PURE__ */Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});function face(e,t){let r=e.type,n=r.families[t];return t==="mono"||r.namedFaces[t]?{fontFamily:n}:{fontFamily:n,fontWeight:r.weight[l[t]]}}function headingFace(e,t="bold"){let{headingFamily:r,headingWeight:n}=e.type;if(r===null&&n===null)return face(e,t);if(r!==null)return{fontFamily:r,fontWeight:n??e.type.weight[l[t]]};let i=face(e,t);return i.fontWeight===void 0||n===null?i:{fontFamily:i.fontFamily,fontWeight:n}}function s(e){return e<=450?"regular":e<=650?"medium":"bold"}var d={regular:"mono",medium:"monoMedium",bold:"monoBold"};function textRole(e,t){let r=c.get(e);r===void 0&&(r=/* @__PURE__ */new Map,c.set(e,r));let n=r.get(t);if(n!==void 0)return n;let i=u(e,t);return r.set(t,i),i}var c=/* @__PURE__ */new WeakMap;function u(e,t){let r=e.type.roles[t],n=r.weight==="400"&&r.face!=="mono"?e.type.weight.regular:r.weight,i=s(Number(n)),a=r.face==="mono"?face(e,d[i]):r.face==="heading"?headingFace(e,i):face(e,i),o=r.face==="heading"?e.type.headingWeight??n:n,l=a.fontWeight===void 0?a:{fontFamily:a.fontFamily,fontWeight:o},c=r.size,u={...l,fontSize:c,lineHeight:Math.round(c*r.lineHeight*100)/100};return r.letterSpacing!==0&&(u.letterSpacing=Math.round(c*r.letterSpacing*100)/100),r.uppercase&&(u.textTransform="uppercase"),/* @__PURE__ */Object.freeze(u)}function parseColor(e){let t=p(e);return t===null?null:v(t)}function p(e){if(typeof e=="number")return b(e);if(typeof e!="string")return null;let t=e.trim();if(t.length===0)return null;if(t.startsWith("#"))return f(t.slice(1));if(t.toLowerCase().startsWith("0x"))return f(t.slice(2));if(t.toLowerCase().startsWith("rgb"))return h(t);if(/^[0-9a-fA-F]+$/.test(t)){let e=f(t);if(e!==null)return e}return/^\d+$/.test(t)?b(Number.parseInt(t,10)):null}function f(e){let t=e.trim();if(!/^[0-9a-fA-F]+$/.test(t))return null;if(t.length===3)return{r:m(t[0]),g:m(t[1]),b:m(t[2]),a:1};if(t.length===6)return{r:g(t,0),g:g(t,2),b:g(t,4),a:1};if(t.length===8){let e=g(t,0);return{r:g(t,2),g:g(t,4),b:g(t,6),a:e/255}}return null}function h(e){let t=e.indexOf("("),r=e.indexOf(")");if(t<0||r<0||r<t)return null;let n=e.slice(t+1,r).split(",").map(e=>e.trim());if(n.length<3)return null;let i=y(Number(n[0])),a=y(Number(n[1])),o=y(Number(n[2]));if(i===null||a===null||o===null)return null;let l=1;if(n.length>=4){let e=Number(n[3]);if(!Number.isFinite(e))return null;l=Math.min(1,Math.max(0,e))}return{r:i,g:a,b:o,a:l}}function b(e){if(!Number.isFinite(e))return null;let t=Math.trunc(e)>>>0,r=t>>>24&255;return{r:t>>>16&255,g:t>>>8&255,b:t&255,a:r===0?1:r/255}}function g(e,t){return Number.parseInt(e.slice(t,t+2),16)}function m(e){return Number.parseInt(`${e??"0"}${e??"0"}`,16)}function y(e){return Number.isFinite(e)?Math.min(255,Math.max(0,Math.round(e))):null}function v(e){if(e.a>=1)return _(e.r,e.g,e.b);let t=Math.round(e.a*1e3)/1e3;return`rgba(${e.r},${e.g},${e.b},${t})`}function _(e,t,r){return`#${w(e)}${w(t)}${w(r)}`.toUpperCase()}function w(e){return e.toString(16).padStart(2,"0")}var x="#111111",z="#FFFFFF",j="#000000";function readableOn(e){let t=p(e);if(t===null)return z;let r=S(t),n=S({r:17,g:17,b:17}),i=S({r:255,g:255,b:255});return T(r,i)>=T(r,n)?z:x}function C(e,t){let r=readableOn(e);return contrastRatio(r,e)>=t?r:contrastRatio(z,e)>=contrastRatio(j,e)?z:j}function k(e){let t=t=>e.reduce((e,r)=>Math.min(e,contrastRatio(t,r)),Number.POSITIVE_INFINITY);return t(z)>=t(j)?z:j}function S(e){let t=O(e.r/255),r=O(e.g/255),n=O(e.b/255);return.2126*t+.7152*r+.0722*n}function O(e){return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}function T(e,t){let r=Math.max(e,t),n=Math.min(e,t);return(r+.05)/(n+.05)}function contrastRatio(e,t){let r=p(e),n=p(t);if(r===null||n===null)return 1;let i=n.a>=1?n:{...n},a=r.a>=1?r:E(r,i);return T(S(a),S(i))}function E(e,t){let r=e.a,n=(e,t)=>Math.round(e*r+t*(1-r));return{r:n(e.r,t.r),g:n(e.g,t.g),b:n(e.b,t.b),a:1}}function R(e,t){let r=p(e),n=p(t);if(r===null||n===null)return null;let i=r.a>=1?r:E(r,{...n});return _(i.r,i.g,i.b)}function F(e,t){let r=p(e);if(r===null)return null;let n=Math.min(1,Math.max(0,t));return`rgba(${r.r}, ${r.g}, ${r.b}, ${n})`}var I=.05;function D(e,t,r,n){let i=t[0];if(i===void 0)return r;let a=e=>t.every(t=>contrastRatio(e,t)>=n);if(p(e)===null)return r;if(a(e))return e;let o=R(e,i),l=o===null?null:p(o),s=p(r);if(l===null||s===null)return r;for(let e=1;e<1/I;e+=1){let t=e*I,r=(e,r)=>Math.round(e+(r-e)*t),n=_(r(l.r,s.r),r(l.g,s.g),r(l.b,s.b));if(a(n))return n}return r}var B=/* @__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 L=Object.freeze;function deepFreeze(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){L(e);for(let t of Object.keys(e))deepFreeze(e[t])}return e}var H=/* @__PURE__ */Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3});var A={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},N={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},M={nano:8,small:9,micro:10,tiny:11,caption:13,bodyTight:15,body:17,subtitle:20,heading:22,verdict:24},P={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},V={regular:"400",medium:"500",bold:"700"},q={eyebrow:1,monoWide:.9,headerBrand:-.42,tight:-.35},$=0,W="System",U="monospace",G=["content","heading","control","compact","badge"];function K(e){let t={};for(let r of G)t[r]=e;return t}var Y=[];function Q(){return{family:W,mono:U,fontUrl:null,families:{regular:W,medium:W,bold:W,mono:U,monoMedium:U,monoBold:U},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:M,tierSizes:K(M),lineHeight:P,weight:V,letterSpacing:q,scale:1,maxScale:$,scaleCaps:H,headingFamily:null,headingWeight:null,fontSources:Y,roles:B,typeScale:1}}var X={},Z=/* @__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 J={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:cssCubicBezier(Z.standard),emphasized:cssCubicBezier(Z.emphasized),exit:cssCubicBezier(Z.exit)},reducedMotion:false},ee={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)"},te=deepFreeze({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:ee,space:A,radius:N,type:Q(),motion:J,slots:X}),re={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)"},ne=deepFreeze({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:re,space:A,radius:N,type:Q(),motion:J,slots:X});var ie=/* @__PURE__ */Object.freeze({ink:"#262523",ink2:"#4A4845",ink3:"#6B6863",paper:"#F8F7F4",card:"#FFFFFF",line:"#E7E6E2",tile:"#F2F1EE",shadow:"rgba(38, 37, 35, .07)",riskBg:"#FFE3E1",riskInk:"#B0231B",riskDot:"#E5372B",clearBg:"#E6F4D3",clearInk:"#2F6A12",clearDot:"#5FA82B",watchDot:"#E5A000"}),ae=/* @__PURE__ */new WeakMap;function oe(e){let t=ae.get(e);if(t!==void 0)return t;let r=e.color,n=e.brightness==="dark",i=n?{dark:n,ink:r.text.primary,ink2:r.text.secondary,ink3:r.text.muted,paper:r.background,card:r.surface,line:r.borderRingCream,tile:r.surfaceSubtle,shadow:r.shadow,riskBg:r.badgeBgCritical,riskInk:r.danger,riskDot:r.danger,clearBg:r.badgeBgPositive,clearInk:r.success,clearDot:r.success,watchDot:r.warningStrong}:{dark:n,...ie},a=(e,t)=>D(e,t,k(t),le),o=(e,t)=>contrastRatio(e,t)>=le?e:C(t,le),l=[i.card,i.paper].map(e=>R(r.brandSoft,e)??e),s={primary:r.primary,onPrimary:o(r.onPrimary,r.primary),accent:r.accent,onAccent:o(r.onAccent,r.accent),link:a(r.linkInk,[i.card,i.paper,i.tile]),badge:r.brandSoft,onBadge:a(r.brandInk,l)},d=/* @__PURE__ */Object.freeze({...i,...s});return ae.set(e,d),d}var le=4.5;function se(e,t){for(let r of t)if(contrastRatio(r,e)>=le)return r;return C(e,le)}var de=/* @__PURE__ */Object.freeze({ink:"#10462E",go:"#07C168",muted:"#6B6B6B",line:"#E4E4E4",alert:"#C03410",alertDeep:"#6D1D14",tintSage:"#E6ECE8",tintBlue:"#EAEEF6",tintYellow:"#FCF0D6",tintRed:"#FBF1EE",tintGo:"#DCF6EA",icoSage:"#819E90",efWhite:"#FFFFFF",efBlack:"#000000",efCharcoal:"#3D3D3D",efSkyBlue:"#4E98C9",embCyan1:"#E0FDFF",bgMist:"#F1F5F2",paper:"#F8F7F4",embB1:"#FFCE34",embB2:"#5CC8F2",embB3:"#FF6665",embB4:"#A55BD8",embRiskDot:"#E5372B",embRiskInk:"#B0231B",embClearDot:"#5FA82B",embInk2:"#4A4845",embInk3:"#6B6863",embTealInk:"#00707C",embYellow:"#FFCE34",watch:"#F9E6B9",barTrack:"#ECECEC",topCard:"#FFCE34",topKicker:"#4A4845",topInk:"#262523",plainEdge:"rgba(16, 70, 46, 0.2)"}),ce=/* @__PURE__ */Object.freeze({".rec-note":/* @__PURE__ */Object.freeze({fontSize:12.5}),".efh":/* @__PURE__ */Object.freeze({gap:12,fontSize:15}),".efh-sheet":/* @__PURE__ */Object.freeze({marginTop:20,paddingTop:20,paddingBottom:28,paddingLeft:16,borderTopLeftRadius:28}),".efh-ico":/* @__PURE__ */Object.freeze({width:22}),".efh-label":/* @__PURE__ */Object.freeze({fontSize:12}),".efh-pill":/* @__PURE__ */Object.freeze({minHeight:24,paddingLeft:10,fontSize:12,letterSpacing:.72}),".efh-card":/* @__PURE__ */Object.freeze({paddingTop:16,borderRadius:20}),".efh-card__title":/* @__PURE__ */Object.freeze({fontSize:18}),".efh-btn":/* @__PURE__ */Object.freeze({minHeight:48,paddingLeft:20,fontSize:16}),".efh-btn--row":/* @__PURE__ */Object.freeze({minHeight:40,paddingLeft:16,fontSize:15}),".efh-head":/* @__PURE__ */Object.freeze({marginBottom:8}),".efh-name":/* @__PURE__ */Object.freeze({fontSize:22}),".efh-meta":/* @__PURE__ */Object.freeze({fontSize:13}),".efh-stage":/* @__PURE__ */Object.freeze({height:236,marginTop:4,marginLeft:-16}),".efh-stage__grass":/* @__PURE__ */Object.freeze({height:"44%"}),".efh-stage__pet":/* @__PURE__ */Object.freeze({left:"58%",bottom:22,height:"86%"}),".efh-stage .efh-vitals":/* @__PURE__ */Object.freeze({top:14,left:16,gap:12}),".efh-head__from":/* @__PURE__ */Object.freeze({marginTop:12}),".efh-due":/* @__PURE__ */Object.freeze({marginLeft:-12}),".efh-due li":/* @__PURE__ */Object.freeze({gap:12,paddingTop:12,paddingLeft:12,borderRadius:10}),".efh-due__title":/* @__PURE__ */Object.freeze({fontSize:17,lineHeight:22.1}),".efh-sec":/* @__PURE__ */Object.freeze({marginTop:8,marginBottom:12}),".efh-tiles":/* @__PURE__ */Object.freeze({gap:10}),".efh-tile":/* @__PURE__ */Object.freeze({gap:8,paddingTop:16,borderRadius:20}),".efh-tile__title":/* @__PURE__ */Object.freeze({fontSize:15,lineHeight:18.75,letterSpacing:-.15}),".efh-tile__foot":/* @__PURE__ */Object.freeze({gap:8,minHeight:28}),".efh-tile__foot .efh-pill":/* @__PURE__ */Object.freeze({minHeight:22,paddingLeft:7,fontSize:10.5,letterSpacing:.21}),".efh-tile__foot:has(.efh-pill + .efh-pill)":/* @__PURE__ */Object.freeze({gap:6}),".efh-tile__num":/* @__PURE__ */Object.freeze({fontSize:20,lineHeight:20,letterSpacing:-.4}),".efh-wt":/* @__PURE__ */Object.freeze({gap:8}),".efh-wt b":/* @__PURE__ */Object.freeze({fontSize:32,lineHeight:32,letterSpacing:-.64}),".efh-emb":/* @__PURE__ */Object.freeze({gap:8,marginTop:12,fontSize:15,lineHeight:19.5}),".efh-wchart":/* @__PURE__ */Object.freeze({marginTop:20}),".efh-wchart__plot":/* @__PURE__ */Object.freeze({height:148}),".efh-wkey":/* @__PURE__ */Object.freeze({rowGap:4,columnGap:16,marginTop:12,fontSize:13,lineHeight:18.2}),".efh-wkey span":/* @__PURE__ */Object.freeze({gap:6}),".efh-key":/* @__PURE__ */Object.freeze({rowGap:8,columnGap:16,fontSize:13,lineHeight:18.2}),".efh-key span":/* @__PURE__ */Object.freeze({gap:6}),".efh-key span::before":/* @__PURE__ */Object.freeze({width:10}),".efh-tl__dot":/* @__PURE__ */Object.freeze({width:16,marginTop:3}),".efh-tl__year":/* @__PURE__ */Object.freeze({marginTop:20,marginBottom:12,marginLeft:40}),".efh-tl .efh-tl__year":/* @__PURE__ */Object.freeze({marginTop:4}),".efh-tl__item":/* @__PURE__ */Object.freeze({gap:16,paddingBottom:24}),".efh-tl__item::before":/* @__PURE__ */Object.freeze({left:11,top:22,bottom:-2}),".efh-tl__date":/* @__PURE__ */Object.freeze({fontSize:12,lineHeight:16.8,letterSpacing:.48}),".efh-tl__title":/* @__PURE__ */Object.freeze({marginTop:2,fontSize:17,lineHeight:22.1}),".efh-tl__text":/* @__PURE__ */Object.freeze({marginTop:2,lineHeight:22.5}),".efh-add":/* @__PURE__ */Object.freeze({gap:12}),".efh-add > p":/* @__PURE__ */Object.freeze({fontSize:15,lineHeight:22.5}),".efh-sheet .rec-note":/* @__PURE__ */Object.freeze({marginTop:4}),".efh-lab":/* @__PURE__ */Object.freeze({paddingTop:8,paddingBottom:96,paddingLeft:16}),".efh-titles":/* @__PURE__ */Object.freeze({gap:2,paddingTop:4}),".efh-title":/* @__PURE__ */Object.freeze({fontSize:22}),".efh-smeta":/* @__PURE__ */Object.freeze({fontSize:13}),".efh-mk__name":/* @__PURE__ */Object.freeze({fontSize:17}),".efh-mk__line":/* @__PURE__ */Object.freeze({rowGap:0,columnGap:6,marginTop:1,fontSize:13,lineHeight:18.2}),".efh-mk__line b":/* @__PURE__ */Object.freeze({fontSize:17}),".efh-none":/* @__PURE__ */Object.freeze({paddingTop:0}),".efh-none__scene":/* @__PURE__ */Object.freeze({marginBottom:16,marginLeft:-16}),".efh-none__t":/* @__PURE__ */Object.freeze({fontSize:22,lineHeight:25.3,letterSpacing:-.44}),".efh-none__lead":/* @__PURE__ */Object.freeze({marginTop:8,fontSize:15,lineHeight:22.5}),".efh-ways":/* @__PURE__ */Object.freeze({gap:12,marginTop:16}),".efh-way":/* @__PURE__ */Object.freeze({columnGap:12,paddingTop:16,borderRadius:20}),".efh-way__w":/* @__PURE__ */Object.freeze({gap:2}),".efh-way__t":/* @__PURE__ */Object.freeze({fontSize:16,lineHeight:20.8}),".efh-way__x":/* @__PURE__ */Object.freeze({fontSize:15,lineHeight:21.75}),".efh-peek__labs .efh-card__title":/* @__PURE__ */Object.freeze({marginBottom:8}),".efh-peek__g":/* @__PURE__ */Object.freeze({fontSize:15,lineHeight:21.75,marginBottom:6}),".efh-peek__g b":/* @__PURE__ */Object.freeze({fontSize:16}),".dot":/* @__PURE__ */Object.freeze({width:9}),".rec-top":/* @__PURE__ */Object.freeze({gap:8,paddingTop:16,paddingRight:18,paddingBottom:18,paddingLeft:18,borderRadius:22}),".rec-top__k":/* @__PURE__ */Object.freeze({gap:7,fontSize:10.5,letterSpacing:.63}),".rec-top .emb-btn":/* @__PURE__ */Object.freeze({marginTop:4}),".mixbar":/* @__PURE__ */Object.freeze({gap:2,height:10}),".mixlegend":/* @__PURE__ */Object.freeze({rowGap:6,columnGap:14,marginTop:12,fontSize:13.5}),".mixlegend li":/* @__PURE__ */Object.freeze({gap:7}),".mixlegend i":/* @__PURE__ */Object.freeze({width:9}),".mixlegend b":/* @__PURE__ */Object.freeze({fontSize:12}),".askbar":/* @__PURE__ */Object.freeze({gap:6,height:52,paddingRight:6,paddingLeft:8,borderWidth:1.5}),".askbar input":/* @__PURE__ */Object.freeze({fontSize:16}),".askbar__add":/* @__PURE__ */Object.freeze({width:38}),".askbar__add svg":/* @__PURE__ */Object.freeze({width:22}),".askbar__send":/* @__PURE__ */Object.freeze({width:40}),".askbar__send svg":/* @__PURE__ */Object.freeze({width:20}),".ph-head":/* @__PURE__ */Object.freeze({height:58,paddingLeft:14}),".ph-back":/* @__PURE__ */Object.freeze({width:44,marginLeft:-6}),".ph-back svg":/* @__PURE__ */Object.freeze({width:26}),".ph-title":/* @__PURE__ */Object.freeze({fontSize:17}),".emb-card":/* @__PURE__ */Object.freeze({borderRadius:22}),".emb-tile":/* @__PURE__ */Object.freeze({width:46,height:46,borderRadius:13}),".ask-pill":/* @__PURE__ */Object.freeze({right:16,bottom:16,gap:8,minHeight:48,paddingRight:18,paddingLeft:14,fontSize:15.5}),".ask-pill svg":/* @__PURE__ */Object.freeze({width:22}),".ph-askbar":/* @__PURE__ */Object.freeze({paddingTop:10,paddingRight:14,paddingBottom:10,paddingLeft:14}),".rec":/* @__PURE__ */Object.freeze({paddingTop:18,paddingLeft:16}),".rec-dna":/* @__PURE__ */Object.freeze({paddingTop:16,marginTop:16}),".rec-dna__top":/* @__PURE__ */Object.freeze({gap:12,marginBottom:14}),".rec-dna__top h3":/* @__PURE__ */Object.freeze({fontSize:17}),".rec-dna__top p":/* @__PURE__ */Object.freeze({fontSize:10.5,letterSpacing:.53,marginTop:2}),".rec-dna__risk":/* @__PURE__ */Object.freeze({gap:10,marginTop:14,paddingTop:12,paddingRight:12,paddingBottom:12,paddingLeft:14,borderRadius:14}),".rec-dna__risk small":/* @__PURE__ */Object.freeze({fontSize:13}),".rec-dna__risk strong":/* @__PURE__ */Object.freeze({marginTop:1,fontSize:16,lineHeight:20}),".rec-dna__clear":/* @__PURE__ */Object.freeze({gap:7,minHeight:36,marginTop:4,paddingLeft:4,fontSize:14}),".rec-dna__clear .dot":/* @__PURE__ */Object.freeze({width:7})});var ue=ce;function pe(e,t){let r=ue[e]?.[t];return typeof r=="number"?r:Number.NaN}var fe=pe;var he=/* @__PURE__ */Object.freeze({gap:fe(".efh","gap"),sheetPadTop:fe(".efh-sheet","paddingTop"),sheetPadX:fe(".efh-sheet","paddingLeft"),sheetPadBottom:fe(".efh-sheet","paddingBottom"),sheetRadius:fe(".efh-sheet","borderTopLeftRadius"),sheetGap:fe(".efh-sheet","marginTop"),cardPad:fe(".efh-card","paddingTop"),cardRadius:fe(".efh-card","borderRadius"),name:fe(".efh-name","fontSize"),cardTitle:fe(".efh-card__title","fontSize"),rowTitle:fe(".efh-mk__name","fontSize"),body:fe(".efh","fontSize"),small:fe(".efh-meta","fontSize"),mono:fe(".efh-label","fontSize"),tileNum:fe(".efh-tile__num","fontSize"),big:fe(".efh-wt b","fontSize"),button:fe(".efh-btn","minHeight"),rowButton:fe(".efh-btn--row","minHeight"),pill:fe(".efh-pill","minHeight"),plot:fe(".efh-wchart__plot","height"),rowRadius:fe(".efh-due li","borderRadius"),tileGap:fe(".efh-tiles","gap"),icon:fe(".efh-ico","width")});function be(e,t){return e.trim().toLowerCase()===t.trim().toLowerCase()}function ge(e,t,r){let n=F(e,r);return(n!==null?R(n,t):null)??t}var me=(e,t)=>parseColor(e)===parseColor(t);function ye(e){if(e.brightness!=="light")return false;let t=e.color,r=te.color;return me(t.primary,r.primary)&&me(t.brandInk,r.brandInk)&&me(t.onPrimary,r.onPrimary)&&me(t.accent,r.accent)&&me(t.accentEdge,r.accentEdge)}function ve(e){let t=e.color,r=de,n=oe(e),i=e.brightness==="dark",a=ye(e),o=(i?ne:te).color,l=!me(t.accent,o.accent),s=i?t.surface:r.efWhite,d=(e,t)=>ge(e,s,i?.18:t),c=a?r.tintSage:d(n.primary,.105),u=a?r.topCard:l?n.accent:c;return{tintSage:c,chevron:a?r.icoSage:ge(t.brandInk,s,.527),rowGround:a?r.bgMist:d(n.primary,.059),tintPartner:l?d(n.accent,.14):r.embCyan1,topFill:u,plainEdge:a?r.plainEdge:F(t.brandInk,.2)??t.structureEdge,topKicker:se(u,[l?n.onAccent:i?n.ink3:r.topKicker,r.topInk]),topInk:se(u,[l?n.onAccent:i?n.ink:r.topInk,r.topInk])}}function recordsSheetLook(e){let t=e.color,r=de,n=oe(e),i=ve(e),a=ye(e)?r.go:be(t.accent,t.primary)?t.onPrimary:t.accent;return e.brightness==="dark"?/* @__PURE__ */Object.freeze({dark:true,paper:n.paper,ground:t.background,card:n.card,text:n.ink,muted:n.ink3,line:t.structureEdge,ink:t.brandInk,fill:n.primary,onFill:n.onPrimary,accentOnFill:a,accent:n.accent,go:t.success,goTint:t.badgeBgPositive,alert:n.riskInk,alertDeep:n.riskInk,alertTint:t.badgeBgCritical,watch:t.badgeBgCaution,wind:r.efSkyBlue,tintBlue:t.surfaceSubtle,tintYellow:t.surfaceSubtle,barTrack:t.structureEdge,...i}):/* @__PURE__ */Object.freeze({dark:false,paper:n.paper,ground:r.efWhite,card:r.efWhite,text:r.efBlack,muted:r.muted,line:r.line,ink:t.brandInk,fill:n.primary,onFill:n.onPrimary,accentOnFill:a,accent:n.accent,go:r.go,goTint:r.tintGo,alert:r.alert,alertDeep:r.alertDeep,alertTint:r.tintRed,watch:r.watch,wind:r.efSkyBlue,tintBlue:r.tintBlue,tintYellow:r.tintYellow,barTrack:r.barTrack,...i})}var _e=e.createContext("sheet");_e.Provider;function we(){return e.useContext(_e)}function xe(e,t={}){return{padding:e.cardPad,gap:12,...t,...e.card}}function ze(e,t){let r={...e};for(let n of Object.keys(t)){let i=t[n];i!==void 0&&(r[n]={...e[n],...i})}return r}var je=/* @__PURE__ */new WeakMap;function Ce(e){let t=je.get(e);if(t!==void 0)return t;let r=recordsSheetLook(e),n=o(e.slots),l=face(e,"bold"),s={...l,fontSize:16,lineHeight:20},d=/* @__PURE__ */Object.freeze({look:r,ground:r.ground,card:{backgroundColor:r.card,borderRadius:e.radius.lg,borderWidth:r.dark?1:0,borderColor:r.line,shadowColor:"#000000",shadowOpacity:r.dark?0:.09,shadowRadius:3,shadowOffset:{width:0,height:1},elevation:r.dark?0:1,...i(n,1)},cardPad:he.cardPad,cardTitle:{...l,fontSize:he.cardTitle,lineHeight:Math.round(he.cardTitle*1.25*100)/100,letterSpacing:-.36,color:r.ink,...a(n)},body:{...face(e,"regular"),fontSize:15,lineHeight:21,color:r.ink,...a(n)},title:{...face(e,"medium"),fontSize:he.name,lineHeight:Math.round(he.name*1.2*100)/100,letterSpacing:-.33,color:r.ink},button:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:8,minHeight:he.button,paddingHorizontal:20,borderRadius:999},buttonInk:{backgroundColor:r.fill,borderWidth:0,...i(e.slots.primaryButton)},buttonInkLabel:{...s,color:r.onFill,...a(e.slots.primaryButton)},buttonOutline:{backgroundColor:"transparent",borderWidth:1.5,borderColor:r.ink},buttonOutlineLabel:{...s,color:r.ink},askPill:{backgroundColor:de.embYellow,borderWidth:0,paddingLeft:pe(".ask-pill","paddingLeft"),paddingRight:pe(".ask-pill","paddingRight")},askPillLabel:{...l,fontSize:pe(".ask-pill","fontSize"),lineHeight:pe(".ask-pill","fontSize")*1.2,color:de.topInk}});return je.set(e,d),d}var ke=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),Se=globalThis,Oe=Se[ke]??(Se[ke]=e.createContext(te));Oe.displayName??="EverfurThemeContext";function useEverfurTheme(){return e.useContext(Oe)}function Te(e,t){let r=e.scaleCaps[t];return r>0?r:void 0}function Text({tier:r,variant:n,...i}){let a=useEverfurTheme(),o=n===void 0?void 0:a.type.roles[n],l=Te(a.type,r??o?.tier??"content"),s=n===void 0?i:{...i,style:[{...textRole(a,n),color:a.color.text.primary,flexShrink:1},i.style]};return e.createElement(t.Text,l===void 0?s:{maxFontSizeMultiplier:l,...s})}e.forwardRef(function(r,n){return e.createElement(t.TextInput,{...r,...n===null?{}:{ref:n}})});var Ee="your pet";function Re(e){let t=e?.trim()??"";return t.length>0?t:Ee}var Fe=/* @__PURE__ */Object.freeze({title:"Health records",titleWeb:e=>{let t=e?.trim()??"";return t.length>0?`${t}’s Records`:"Health records"},titleNative:e=>{let t=e?.trim()??"";return t.length>0?t:"Health records"},openTimeline:"Open timeline",loading:"Loading health records",lead:e=>`${Re(e)}’s lab trends`,retryMarkers:"Retry loading lab trends",viewFullRecord:"View full medical record",viewTimeline:"View full timeline",important:e=>`Important: ${e}`});var Ie=/* @__PURE__ */Object.freeze({pressScale:.97,pressMs:160,riseWebPx:16,riseNativePx:14,fadeMs:320,moveMs:480,staggerMs:55,maxSteps:8});var De=/* @__PURE__ */Object.freeze({loading:"Loading",empty:"No records yet",upload:"Upload records",consentRequired:"Consent required",allow:"Allow",allPetsConsent:"This covers all your pets. You can withdraw it at any time.",sessionRequired:"Sign in required",recordUnavailable:"Record unavailable",retry:"Try again",records:"Records",beingReviewed:"being reviewed"}),Be="Everfur summarizes what your vet recorded. It is informational, not diagnostic.";function Le(e){let t=(e.brightness==="dark"?ne:te).color,r=e.color,n=(e,t)=>parseColor(e)===parseColor(t);return{success:!n(r.success,t.success),warning:!n(r.warningStrong,t.warningStrong)||!n(r.cautionAccent,t.cautionAccent),info:!(n(r.info,r.brandInk)&&n(r.badgeBgInfo,r.brandSoft)&&n(r.infoEdge,r.structureEdge))}}var He=4.5;function Ae(e){if(!Le(e).success)return null;let t=[e.color.surface];return D(e.color.success,t,k(t),He)}var Ne=52;function Me(){let t=useEverfurTheme(),r=Pe();return e.useMemo(()=>Ve(t,r),[t,r])}function Pe(){let e=useEverfurTheme();return we()==="sheet"?Ce(e):null}function Ve(e,r=null){let{color:n,space:l,radius:s,type:d,slots:c}=e,{size:u,lineHeight:p}=d,f=(e,t)=>Math.round(e*t),h=t.StyleSheet.hairlineWidth,b=l.xxl+l.md,g=(t,r,n,i="regular")=>({...face(e,i),fontSize:t,lineHeight:f(t,r),color:n}),m=o(c),y=a(m),v=a(c.banner),_=c.banner?.textColor,w=e.brightness==="dark"?n.errorRed:n.danger,x=(e,t)=>({bg:{backgroundColor:e,borderColor:"transparent"},fg:{color:t}}),z=(e,t)=>({bg:{backgroundColor:n.surface,borderColor:e},fg:{color:t}});return{chipTones:{neutral:z(n.brandBorderStrong,n.text.primary),info:x(n.brandSoft,n.brandInk),warning:z(n.cautionAccent,n.text.primary),critical:z(n.danger,n.danger),positive:z(n.success,Ae(e)??n.brandInk)},...t.StyleSheet.create({root:{flex:1,backgroundColor:n.background},body:{flex:1},content:{paddingHorizontal:l.lg,paddingBottom:l.xxl,gap:l.lg},contentTight:{paddingHorizontal:l.sm,paddingBottom:l.xxl,gap:l.lg},inset:{paddingHorizontal:l.sm},section:{gap:l.sm+l.xs/2},sectionHeader:{flexDirection:"row",alignItems:"center",gap:l.sm,paddingHorizontal:l.xs},sectionTitle:{...g(u.subtitle,p.snug,n.text.primary,"bold"),...headingFace(e,"bold"),letterSpacing:-.4},sectionCount:{...g(u.bodyTight,p.snug,n.text.muted,"medium")},card:{borderRadius:s.lg,borderWidth:1,borderColor:n.borderRingCream,backgroundColor:n.surface,paddingHorizontal:l.lg,paddingVertical:l.xs,...i(m,h)},creamCard:{borderRadius:s.lg,borderWidth:1,borderColor:n.borderRingCream,backgroundColor:n.surfaceCream,padding:l.lg,gap:l.md,...i(m,h)},row:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:l.md,paddingVertical:l.md},rowDivider:{borderTopWidth:h,borderTopColor:n.borderHairlineGreen},rowMain:{flex:1},rowRight:{alignItems:"flex-end",gap:l.xs+l.xs/2},rowTitle:{...g(u.body,p.snug,n.text.primary,"medium"),...y},rowDetail:{...g(u.caption,p.normal,n.text.secondary),marginTop:l.xs/2,...y},rowValue:{...g(u.body+1,p.snug,n.text.primary,"bold"),marginTop:l.xs/2,...y},rowMuted:{...g(u.caption,p.normal,n.text.muted),...y},chip:{minHeight:24,justifyContent:"center",borderRadius:s.pill,borderWidth:1.5,paddingHorizontal:l.sm+l.xs/2,alignSelf:"flex-start"},chipText:{...g(u.tiny+1,p.snug,n.text.primary,"monoBold"),letterSpacing:.7,textTransform:"uppercase"},chipSentence:{borderRadius:s.md,paddingVertical:l.xs,alignSelf:"stretch"},chipSentenceText:{...g(u.caption,p.normal,n.text.primary,"medium"),letterSpacing:0,textTransform:"none"},pill:{minHeight:Ne,borderRadius:s.pill,paddingHorizontal:l.lg+l.xs/2,flexDirection:"row",alignItems:"center",justifyContent:"center",gap:l.sm},pillPrimary:{backgroundColor:n.brand,...i(c.primaryButton)},pillPrimaryLabel:{...g(u.body,p.snug,n.onPrimary,"bold"),...a(c.primaryButton)},pillOutline:{borderWidth:1.5,borderColor:n.brandInk,backgroundColor:"transparent"},pillOutlineLabel:{...g(u.body,p.snug,n.brandInk,"bold")},pillDanger:{borderWidth:1.4,borderColor:n.danger,backgroundColor:n.surface},pillDangerLabel:{...g(u.bodyTight,p.snug,n.danger,"bold")},pillAsk:{borderWidth:h,borderColor:n.borderRingCream,backgroundColor:n.surface},pillAskLabel:{...g(u.body,p.snug,n.text.primary,"bold")},pillLink:{minHeight:b,backgroundColor:"transparent",paddingHorizontal:l.sm},pillLinkLabel:{...g(u.body,p.snug,n.linkInk,"bold")},pillDisabled:{opacity:.5},pressed:{transform:[{scale:Ie.pressScale}]},infoNote:{flexDirection:"row",alignItems:"flex-start",gap:l.sm,borderRadius:s.md-l.xs/2,backgroundColor:n.brandSoft,paddingHorizontal:l.md,paddingVertical:l.sm+l.xs/2,...i(c.banner)},infoNoteText:{flex:1,...g(u.bodyTight,p.normal,n.text.primary),...v},cautionNote:{flexDirection:"row",alignItems:"flex-start",gap:l.sm,borderRadius:s.md-l.xs/2,backgroundColor:n.badgeBgCaution,paddingHorizontal:l.md,paddingVertical:l.sm+l.xs/2},cautionNoteText:{flex:1,...g(u.bodyTight,p.normal,n.warningStrong)},statusCard:{borderRadius:s.md,backgroundColor:n.brandSoft,padding:l.md+l.xs/2},statusText:g(u.bodyTight,p.relaxed,n.text.primary),errorBanner:{flexDirection:"row",alignItems:"flex-start",gap:l.sm,borderRadius:s.md-l.xs/2,backgroundColor:n.badgeBgCritical,padding:l.md},errorText:{flex:1,...g(u.bodyTight,p.normal,w)},band:{flexDirection:"row",alignItems:"flex-start",gap:l.sm,borderRadius:s.md-l.xs/2,padding:l.md,backgroundColor:n.brandSoft,...i(c.banner)},bandText:{flex:1,...g(u.caption,p.normal,n.text.secondary),...v},infoGlyph:{width:l.md+l.xs/2,height:l.md+l.xs/2,borderRadius:s.pill,borderWidth:1,borderColor:_??n.text.secondary,alignItems:"center",justifyContent:"center"},infoGlyphText:{...g(u.small,p.tight,n.text.secondary,"bold"),...v},chevron:{width:l.sm,height:l.sm,borderTopWidth:l.xs/2,borderRightWidth:l.xs/2,borderColor:n.text.muted},lead:{paddingHorizontal:l.sm,...g(u.body+1,p.snug,n.text.primary,"bold")},field:{minHeight:b,paddingHorizontal:l.md,paddingVertical:l.sm,borderWidth:1,borderColor:n.borderHairlineGreen,borderRadius:s.sm,color:n.text.primary,backgroundColor:n.surface,...face(e,"regular"),fontSize:u.body,...i(c.input,1),...a(c.input)},fieldLabel:{...g(u.bodyTight,p.normal,n.text.secondary,"medium")},muted:g(u.caption,p.normal,n.text.muted),bodyText:g(u.body,p.normal,n.text.primary)}),...r!==null?qe(r):{}}}function qe(e){return t.StyleSheet.create({root:{flex:1,backgroundColor:e.ground},sectionTitle:e.cardTitle,card:{...e.card,paddingHorizontal:e.cardPad,paddingVertical:e.cardPad/4},creamCard:{...e.card,padding:e.cardPad,gap:12},pill:e.button,pillPrimary:e.buttonInk,pillPrimaryLabel:e.buttonInkLabel,pillOutline:e.buttonOutline,pillOutlineLabel:e.buttonOutlineLabel,pillAsk:e.askPill,pillAskLabel:e.askPillLabel,lead:{paddingHorizontal:8,...e.cardTitle}})}function $e(e){let t=globalThis.console;try{t?.error?.("[everfur] A host callback threw; the SDK ignored it.",e)}catch{}}function We(e){return(typeof e=="object"||typeof e=="function")&&e!==null&&typeof e.then=="function"}function Ue(e,...t){if(typeof e=="function")try{let r=e(...t);return We(r)&&Promise.resolve(r).then(void 0,$e),r}catch(e){$e(e);return}}var Ge=/* @__PURE__ */new WeakMap;function Ke(e){if(typeof e!="function")return;let t=Ge.get(e);if(t!==void 0)return t;let r=(...t)=>{Ue(e,...t)};return Ge.set(e,r),r}function Ye(e){return e?.httpStatus===429?"rate_limited":e?.httpStatus===502?"service_unavailable":"error"}function Qe(e,t){return e===null?"":t?`${e} ${t}`:e}var Xe=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ze(e){if(!e)return"-";let t=/^(\d{4})-(\d{2})-(\d{2})/.exec(e);if(t!==null)return Je(Number(t[1]),Number(t[2])-1,Number(t[3]));let r=Date.parse(e);if(Number.isNaN(r))return"-";let n=new Date(r);return Je(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate())}function Je(e,t,r){let n=Xe[t];return n===void 0?"-":`${n} ${r}, ${e}`}function et(e){let t=e?/^([\d-]{10}T[\d:]+)(\.\d+)?(.*)$/.exec(e):null,r=t?Date.parse(`${t[1]}${(t[2]??"").slice(0,4)}${t[3]||"Z"}`):Number.NaN;if(Number.isNaN(r))return Ze(e);let n=new Date(r);return Je(n.getFullYear(),n.getMonth(),n.getDate())}var tt=/* @__PURE__ */Object.freeze({timeline:"Timeline",loadingTimeline:"Loading timeline",labResults:"Blood & lab work",visits:"Visits",physicalExams:"Physical exams",visitNotes:"Visit notes",visit:"Visit",exam:"Exam",visitNote:"Visit note",notRecorded:"Not recorded",abnormal:"Abnormal",notExamined:"Not examined",normal:"Normal",measured:e=>`Measured ${e}`,uploadedDocument:"Uploaded document",kind:/* @__PURE__ */Object.freeze({visit:"Visit",vaccine:"Vaccine",weight:"Weight",medication:"Medication"}),clinicVisit:"Clinic visit",doctor:e=>`Dr. ${e}`,lot:e=>`Lot ${e}`,expires:e=>`Expires ${e}`});function rt(e){switch(e){case"above":return{label:"Above range",outOfRange:true};case"below":return{label:"Below range",outOfRange:true};case"in_range":return{label:"In range",outOfRange:false};default:return{label:"No range on file",outOfRange:false}}}function nt(e,t){return t<2?null:`${e==="flat"?"Holding steady":`Trending ${e==="down"?"down":e==="up"?"up":"steady"}`} over ${t} visits`}function it(e){let t=e.replace(/_/g," ").trim();return t.length===0?e:t.charAt(0).toUpperCase()+t.slice(1)}var at=/* @__PURE__ */Object.freeze({general:"General / attitude",eent:"Eyes, ears, nose & throat",oral_dental:"Oral & dental",cardiovascular:"Cardiovascular",respiratory:"Respiratory",gastrointestinal:"GI / abdomen",urogenital:"Urogenital",musculoskeletal:"Musculoskeletal",neurologic:"Neurologic",integument:"Skin & coat",lymphatic:"Lymph nodes"});function ot(e){return Object.prototype.hasOwnProperty.call(at,e)?at[e]:it(e)}var lt=/* @__PURE__ */Object.freeze({reason_for_visit:"Reason for visit",subjective:"Subjective",objective:"Objective",assessment:"Assessment",plan:"Plan",discharge_instructions:"Discharge instructions",follow_up:"Follow-up",remarks:"Notes"});function st(e){return Object.prototype.hasOwnProperty.call(lt,e)?lt[e]:it(e)}function dt(e){return e===null||!Number.isFinite(e)?"-":`${e.toFixed(3).replace(/\.?0+$/,"")} kg`}function ct(e,t,r){if((e===null||!Number.isFinite(e))&&r)return r;if(e===null||!Number.isFinite(e))return"-";let n=e.toFixed(3).replace(/\.?0+$/,"");return t?`${n} ${t}`:n}function ut(e,t,r){let n=nt(t,r);return e?`${tt.measured(Ze(e))}${n?` · ${n}`:""}`:n}var pt=/* @__PURE__ */Object.freeze({lab_report:"Lab report",pims_export:"Practice export",vaccination_certificate:"Vaccination certificate",imaging_report:"Imaging report",discharge_summary:"Discharge summary",referral_letter:"Referral letter",clinician_note:"Clinician note",consent_form:"Consent form",invoice_estimate:"Invoice",prescription:"Prescription",genetic_report:"Genetic report"});function ft(e){let t=e.title?.trim()??"";if(t.length>0)return t;let r=e.documentClass;return(r&&Object.prototype.hasOwnProperty.call(pt,r)?pt[r]:void 0)??tt.uploadedDocument}var ht=/* @__PURE__ */Object.freeze({visit:0,vaccine:1,weight:2,medication:3});function bt(e){if(!e)return null;let t=Date.parse(e);return Number.isNaN(t)?null:t}function buildTimelineRows(e){let t=[...e.visits.map((e,t)=>({key:`visit-${t}-${e.visitId}`,kind:"visit",kindLabel:tt.kind.visit,at:e.visitDate,date:Ze(e.visitDate),title:e.summary??tt.clinicVisit,detail:e.veterinarian?tt.doctor(e.veterinarian):null,docId:e.docId})),...e.vaccines.map((e,t)=>{let r=[];return e.lot&&r.push(tt.lot(e.lot)),e.expiresOn&&r.push(tt.expires(Ze(e.expiresOn))),{key:`vaccine-${t}-${e.vaccineId}`,kind:"vaccine",kindLabel:tt.kind.vaccine,at:e.administeredOn,date:Ze(e.administeredOn),title:e.product||tt.kind.vaccine,detail:r.length?r.join(" · "):null,docId:e.docId}}),...e.weights.map((e,t)=>({key:`weight-${t}-${e.weightId}`,kind:"weight",kindLabel:tt.kind.weight,at:e.observedOn,date:Ze(e.observedOn),title:dt(e.weightKg),detail:null,docId:e.docId})),...e.medications.map((e,t)=>{let r=[e.dose,e.route,e.frequency].filter(e=>!!e);return{key:`medication-${t}-${e.medicationId}`,kind:"medication",kindLabel:tt.kind.medication,at:e.startedOn,date:Ze(e.startedOn),title:e.drugName||tt.kind.medication,detail:r.length?r.join(" · "):null,docId:e.docId}})];/* @__PURE__ */
|
|
3
|
-
return Object.freeze(t.sort((e,t)=>{let r=bt(e.at),n=bt(t.at);return r===null&&n===null?ht[e.kind]-ht[t.kind]:r===null?1:n===null?-1:n!==r?n-r:ht[e.kind]-ht[t.kind]}))}var gt=[{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}],mt=/* @__PURE__ */Object.freeze(gt.map(e=>/* @__PURE__ */Object.freeze(e)));/* @__PURE__ */Object.freeze(mt.map(e=>e.wireCode));var yt=/* @__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"}),vt=/* @__PURE__ */Object.freeze(mt.map(e=>/* @__PURE__ */Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:yt[e.wireCode]}))),_t=new Map(vt.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),wt=/* @__PURE__ */Object.freeze(["http_envelope",...[...new Set(vt.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function contractErrorFor(e,t){if(typeof e!="string")return;let r=e.trim().toUpperCase();if(r.length!==0)for(let e of[t??"http_envelope",...wt]){let t=_t.get(e+r);if(t)return t}}var xt=/* @__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 xt[e]}function fromWire(e){let t=contractErrorFor(e);if(t)return t.normalized;let r=(e??"").trim().toUpperCase(),n=r.replace(/[^A-Z0-9]/g,"");if(n==="AUTHREJECTED")return"authRejected";if(r.startsWith("AUTH"))return"authExpired";switch(n){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 zt=/* @__PURE__ */new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function isAutoRetryable(e){return zt.has(e)}var jt=/* @__PURE__ */new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function isRetryableCode(e){return isAutoRetryable(e)||jt.has(e)}var Ct=500,kt=8e3,St=4;function backoffDelayMs(e,t=Math.random){let r=Math.max(0,e),n=Math.min(Ct*2**r,kt);return Math.floor(t()*n)}var Ot="This feature isn't available on your account right now.",Tt="Something in that request was not right. Check the details and try again.",Et=/* @__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:Ot,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:Tt,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:Ot,runtimeDisposed:Tt,unknown:"Something went wrong. Please try again."}),Rt="This session has ended. Please sign in again.",Ft="linked_account_read_only";function It(e,t,r){return e==="conflict"&&r===Ft?Ot:(e==="authRejected"||e==="authExpired")&&typeof t=="string"&&t.trim().toLowerCase()==="session_revoked"?Rt:userFacingError(e)}function userFacingError(e){return Et[e]}function Dt(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:false,writable:false,configurable:false})}var Bt=/^[a-z][a-z0-9_]{0,63}$/;function makeEverfurError(e,t){let r=contractErrorFor(t?.wireCode,t?.wireEnvelope),n=e==="conflict"&&t?.reasonCode===Ft,i={code:e,category:categoryFor(e),retryable:t?.retryable??(n?false:isRetryableCode(e)),displayMessage:It(e,t?.wireCode,n?Ft:null)};t?.httpStatus!==void 0&&(i.httpStatus=t.httpStatus),t?.requestId&&(i.requestId=t.requestId),typeof t?.reasonCode=="string"&&Bt.test(t.reasonCode)&&(i.reasonCode=t.reasonCode);let a=t?.retryAfterSeconds;if(typeof a=="number"&&Number.isFinite(a)&&a>=0&&(i.retryAfterSeconds=Math.round(a)),r);return t?.wireMessage&&Dt(i,"wireMessage",t.wireMessage),t?.raw!==void 0&&t.raw!==null&&Dt(i,"raw",t.raw),/* @__PURE__ */Object.freeze(i)}function ok(e,t){/* @__PURE__ */
|
|
2
|
+
"use strict";var e=require("react"),t=require("react-native"),r=require("react/jsx-runtime"),n=require("zod");function i(e){if(e&&e.__esModule)return e;var t=Object.create(null);if(e){Object.keys(e).forEach(function(r){if(r!=="default"){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:true,get:function(){return e[r]}})}})}t.default=e;return Object.freeze(t)}var a=/*#__PURE__*/i(t);function o(e,t){if(e===void 0)return{};let r={};return e.backgroundColor!==void 0&&(r.backgroundColor=e.backgroundColor),e.borderColor!==void 0&&(r.borderColor=e.borderColor,r.borderWidth=t??1),e.borderRadius!==void 0&&(r.borderRadius=e.borderRadius),r}function l(e){return e?.textColor===void 0?{}:{color:e.textColor}}function s(e){return e.recordCard??e.card}var d=/* @__PURE__ */Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});function face(e,t){let r=e.type,n=r.families[t];return t==="mono"||r.namedFaces[t]?{fontFamily:n}:{fontFamily:n,fontWeight:r.weight[d[t]]}}function headingFace(e,t="bold"){let{headingFamily:r,headingWeight:n}=e.type;if(r===null&&n===null)return face(e,t);if(r!==null)return{fontFamily:r,fontWeight:n??e.type.weight[d[t]]};let i=face(e,t);return i.fontWeight===void 0||n===null?i:{fontFamily:i.fontFamily,fontWeight:n}}function c(e){return e<=450?"regular":e<=650?"medium":"bold"}var u={regular:"mono",medium:"monoMedium",bold:"monoBold"};function textRole(e,t){let r=p.get(e);r===void 0&&(r=/* @__PURE__ */new Map,p.set(e,r));let n=r.get(t);if(n!==void 0)return n;let i=f(e,t);return r.set(t,i),i}var p=/* @__PURE__ */new WeakMap;function f(e,t){let r=e.type.roles[t],n=r.weight==="400"&&r.face!=="mono"?e.type.weight.regular:r.weight,i=c(Number(n)),a=r.face==="mono"?face(e,u[i]):r.face==="heading"?headingFace(e,i):face(e,i),o=r.face==="heading"?e.type.headingWeight??n:n,l=a.fontWeight===void 0?a:{fontFamily:a.fontFamily,fontWeight:o},s=r.size,d={...l,fontSize:s,lineHeight:Math.round(s*r.lineHeight*100)/100};return r.letterSpacing!==0&&(d.letterSpacing=Math.round(s*r.letterSpacing*100)/100),r.uppercase&&(d.textTransform="uppercase"),/* @__PURE__ */Object.freeze(d)}function parseColor(e){let t=h(e);return t===null?null:w(t)}function h(e){if(typeof e=="number")return m(e);if(typeof e!="string")return null;let t=e.trim();if(t.length===0)return null;if(t.startsWith("#"))return b(t.slice(1));if(t.toLowerCase().startsWith("0x"))return b(t.slice(2));if(t.toLowerCase().startsWith("rgb"))return g(t);if(/^[0-9a-fA-F]+$/.test(t)){let e=b(t);if(e!==null)return e}return/^\d+$/.test(t)?m(Number.parseInt(t,10)):null}function b(e){let t=e.trim();if(!/^[0-9a-fA-F]+$/.test(t))return null;if(t.length===3)return{r:v(t[0]),g:v(t[1]),b:v(t[2]),a:1};if(t.length===6)return{r:y(t,0),g:y(t,2),b:y(t,4),a:1};if(t.length===8){let e=y(t,0);return{r:y(t,2),g:y(t,4),b:y(t,6),a:e/255}}return null}function g(e){let t=e.indexOf("("),r=e.indexOf(")");if(t<0||r<0||r<t)return null;let n=e.slice(t+1,r).split(",").map(e=>e.trim());if(n.length<3)return null;let i=_(Number(n[0])),a=_(Number(n[1])),o=_(Number(n[2]));if(i===null||a===null||o===null)return null;let l=1;if(n.length>=4){let e=Number(n[3]);if(!Number.isFinite(e))return null;l=Math.min(1,Math.max(0,e))}return{r:i,g:a,b:o,a:l}}function m(e){if(!Number.isFinite(e))return null;let t=Math.trunc(e)>>>0,r=t>>>24&255;return{r:t>>>16&255,g:t>>>8&255,b:t&255,a:r===0?1:r/255}}function y(e,t){return Number.parseInt(e.slice(t,t+2),16)}function v(e){return Number.parseInt(`${e??"0"}${e??"0"}`,16)}function _(e){return Number.isFinite(e)?Math.min(255,Math.max(0,Math.round(e))):null}function w(e){if(e.a>=1)return x(e.r,e.g,e.b);let t=Math.round(e.a*1e3)/1e3;return`rgba(${e.r},${e.g},${e.b},${t})`}function x(e,t,r){return`#${z(e)}${z(t)}${z(r)}`.toUpperCase()}function z(e){return e.toString(16).padStart(2,"0")}var j="#111111",C="#FFFFFF",k="#000000";function readableOn(e){let t=h(e);if(t===null)return C;let r=T(t),n=T({r:17,g:17,b:17}),i=T({r:255,g:255,b:255});return R(r,i)>=R(r,n)?C:j}function S(e,t){let r=readableOn(e);return contrastRatio(r,e)>=t?r:contrastRatio(C,e)>=contrastRatio(k,e)?C:k}function O(e){let t=t=>e.reduce((e,r)=>Math.min(e,contrastRatio(t,r)),Number.POSITIVE_INFINITY);return t(C)>=t(k)?C:k}function T(e){let t=E(e.r/255),r=E(e.g/255),n=E(e.b/255);return.2126*t+.7152*r+.0722*n}function E(e){return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}function R(e,t){let r=Math.max(e,t),n=Math.min(e,t);return(r+.05)/(n+.05)}function contrastRatio(e,t){let r=h(e),n=h(t);if(r===null||n===null)return 1;let i=n.a>=1?n:{...n},a=r.a>=1?r:F(r,i);return R(T(a),T(i))}function F(e,t){let r=e.a,n=(e,t)=>Math.round(e*r+t*(1-r));return{r:n(e.r,t.r),g:n(e.g,t.g),b:n(e.b,t.b),a:1}}function I(e,t){let r=h(e),n=h(t);if(r===null||n===null)return null;let i=r.a>=1?r:F(r,{...n});return x(i.r,i.g,i.b)}function D(e,t){let r=h(e);if(r===null)return null;let n=Math.min(1,Math.max(0,t));return`rgba(${r.r}, ${r.g}, ${r.b}, ${n})`}var B=.05;function L(e,t,r,n){let i=t[0];if(i===void 0)return r;let a=e=>t.every(t=>contrastRatio(e,t)>=n);if(h(e)===null)return r;if(a(e))return e;let o=I(e,i),l=o===null?null:h(o),s=h(r);if(l===null||s===null)return r;for(let e=1;e<1/B;e+=1){let t=e*B,r=(e,r)=>Math.round(e+(r-e)*t),n=x(r(l.r,s.r),r(l.g,s.g),r(l.b,s.b));if(a(n))return n}return r}var H=/* @__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 A=Object.freeze;function deepFreeze(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){A(e);for(let t of Object.keys(e))deepFreeze(e[t])}return e}var N=/* @__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},M={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},V={nano:8,small:9,micro:10,tiny:11,caption:13,bodyTight:15,body:17,subtitle:20,heading:22,verdict:24},q={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},$={regular:"400",medium:"500",bold:"700"},W={eyebrow:1,monoWide:.9,headerBrand:-.42,tight:-.35},U=0,G="System",K="monospace",Y=["content","heading","control","compact","badge"];function Q(e){let t={};for(let r of Y)t[r]=e;return t}var X=[];function Z(){return{family:G,mono:K,fontUrl:null,families:{regular:G,medium:G,bold:G,mono:K,monoMedium:K,monoBold:K},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:V,tierSizes:Q(V),lineHeight:q,weight:$,letterSpacing:W,scale:1,maxScale:U,scaleCaps:N,headingFamily:null,headingWeight:null,fontSources:X,roles:H,typeScale:1}}var J={},ee=/* @__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 te={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:cssCubicBezier(ee.standard),emphasized:cssCubicBezier(ee.emphasized),exit:cssCubicBezier(ee.exit)},reducedMotion:false},re={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)"},ne=deepFreeze({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:re,space:P,radius:M,type:Z(),motion:te,slots:J}),ie={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)"},ae=deepFreeze({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:ie,space:P,radius:M,type:Z(),motion:te,slots:J});var oe=/* @__PURE__ */Object.freeze({ink:"#262523",ink2:"#4A4845",ink3:"#6B6863",paper:"#F8F7F4",card:"#FFFFFF",line:"#E7E6E2",tile:"#F2F1EE",shadow:"rgba(38, 37, 35, .07)",riskBg:"#FFE3E1",riskInk:"#B0231B",riskDot:"#E5372B",clearBg:"#E6F4D3",clearInk:"#2F6A12",clearDot:"#5FA82B",watchDot:"#E5A000"}),le=/* @__PURE__ */new WeakMap;function se(e){let t=le.get(e);if(t!==void 0)return t;let r=e.color,n=e.brightness==="dark",i=n?{dark:n,ink:r.text.primary,ink2:r.text.secondary,ink3:r.text.muted,paper:r.background,card:r.surface,line:r.borderRingCream,tile:r.surfaceSubtle,shadow:r.shadow,riskBg:r.badgeBgCritical,riskInk:r.danger,riskDot:r.danger,clearBg:r.badgeBgPositive,clearInk:r.success,clearDot:r.success,watchDot:r.warningStrong}:{dark:n,...oe},a=(e,t)=>L(e,t,O(t),de),o=(e,t)=>contrastRatio(e,t)>=de?e:S(t,de),l=[i.card,i.paper].map(e=>I(r.brandSoft,e)??e),s={primary:r.primary,onPrimary:o(r.onPrimary,r.primary),accent:r.accent,onAccent:o(r.onAccent,r.accent),link:a(r.linkInk,[i.card,i.paper,i.tile]),badge:r.brandSoft,onBadge:a(r.brandInk,l)},d=/* @__PURE__ */Object.freeze({...i,...s});return le.set(e,d),d}var de=4.5;function ce(e,t){for(let r of t)if(contrastRatio(r,e)>=de)return r;return S(e,de)}var ue=/* @__PURE__ */Object.freeze({ink:"#10462E",go:"#07C168",muted:"#6B6B6B",line:"#E4E4E4",alert:"#C03410",alertDeep:"#6D1D14",tintSage:"#E6ECE8",tintBlue:"#EAEEF6",tintYellow:"#FCF0D6",tintRed:"#FBF1EE",tintGo:"#DCF6EA",icoSage:"#819E90",efWhite:"#FFFFFF",efBlack:"#000000",efCharcoal:"#3D3D3D",efSkyBlue:"#4E98C9",embCyan1:"#E0FDFF",bgMist:"#F1F5F2",paper:"#F8F7F4",embB1:"#FFCE34",embB2:"#5CC8F2",embB3:"#FF6665",embB4:"#A55BD8",embRiskDot:"#E5372B",embRiskInk:"#B0231B",embClearDot:"#5FA82B",embInk2:"#4A4845",embInk3:"#6B6863",embTealInk:"#00707C",embYellow:"#FFCE34",watch:"#F9E6B9",barTrack:"#ECECEC",topCard:"#FFCE34",topKicker:"#4A4845",topInk:"#262523",plainEdge:"rgba(16, 70, 46, 0.2)"}),pe=/* @__PURE__ */Object.freeze({".rec-note":/* @__PURE__ */Object.freeze({fontSize:12.5}),".efh":/* @__PURE__ */Object.freeze({gap:12,fontSize:15}),".efh-sheet":/* @__PURE__ */Object.freeze({marginTop:20,paddingTop:20,paddingBottom:28,paddingLeft:16,borderTopLeftRadius:28}),".efh-ico":/* @__PURE__ */Object.freeze({width:22}),".efh-label":/* @__PURE__ */Object.freeze({fontSize:12}),".efh-pill":/* @__PURE__ */Object.freeze({minHeight:24,paddingLeft:10,fontSize:12,letterSpacing:.72}),".efh-card":/* @__PURE__ */Object.freeze({paddingTop:16,borderRadius:20}),".efh-card__title":/* @__PURE__ */Object.freeze({fontSize:18}),".efh-btn":/* @__PURE__ */Object.freeze({minHeight:48,paddingLeft:20,fontSize:16}),".efh-btn--row":/* @__PURE__ */Object.freeze({minHeight:40,paddingLeft:16,fontSize:15}),".efh-head":/* @__PURE__ */Object.freeze({marginBottom:8}),".efh-name":/* @__PURE__ */Object.freeze({fontSize:22}),".efh-meta":/* @__PURE__ */Object.freeze({fontSize:13}),".efh-stage":/* @__PURE__ */Object.freeze({height:236,marginTop:4,marginLeft:-16}),".efh-stage__grass":/* @__PURE__ */Object.freeze({height:"44%"}),".efh-stage__pet":/* @__PURE__ */Object.freeze({left:"58%",bottom:22,height:"86%"}),".efh-stage .efh-vitals":/* @__PURE__ */Object.freeze({top:14,left:16,gap:12}),".efh-head__from":/* @__PURE__ */Object.freeze({marginTop:12}),".efh-due":/* @__PURE__ */Object.freeze({marginLeft:-12}),".efh-due li":/* @__PURE__ */Object.freeze({gap:12,paddingTop:12,paddingLeft:12,borderRadius:10}),".efh-due__title":/* @__PURE__ */Object.freeze({fontSize:17,lineHeight:22.1}),".efh-sec":/* @__PURE__ */Object.freeze({marginTop:8,marginBottom:12}),".efh-tiles":/* @__PURE__ */Object.freeze({gap:10}),".efh-tile":/* @__PURE__ */Object.freeze({gap:8,paddingTop:16,borderRadius:20}),".efh-tile__title":/* @__PURE__ */Object.freeze({fontSize:15,lineHeight:18.75,letterSpacing:-.15}),".efh-tile__foot":/* @__PURE__ */Object.freeze({gap:8,minHeight:28}),".efh-tile__foot .efh-pill":/* @__PURE__ */Object.freeze({minHeight:22,paddingLeft:7,fontSize:10.5,letterSpacing:.21}),".efh-tile__foot:has(.efh-pill + .efh-pill)":/* @__PURE__ */Object.freeze({gap:6}),".efh-tile__num":/* @__PURE__ */Object.freeze({fontSize:20,lineHeight:20,letterSpacing:-.4}),".efh-wt":/* @__PURE__ */Object.freeze({gap:8}),".efh-wt b":/* @__PURE__ */Object.freeze({fontSize:32,lineHeight:32,letterSpacing:-.64}),".efh-emb":/* @__PURE__ */Object.freeze({gap:8,marginTop:12,fontSize:15,lineHeight:19.5}),".efh-wchart":/* @__PURE__ */Object.freeze({marginTop:20}),".efh-wchart__plot":/* @__PURE__ */Object.freeze({height:148}),".efh-wkey":/* @__PURE__ */Object.freeze({rowGap:4,columnGap:16,marginTop:12,fontSize:13,lineHeight:18.2}),".efh-wkey span":/* @__PURE__ */Object.freeze({gap:6}),".efh-key":/* @__PURE__ */Object.freeze({rowGap:8,columnGap:16,fontSize:13,lineHeight:18.2}),".efh-key span":/* @__PURE__ */Object.freeze({gap:6}),".efh-key span::before":/* @__PURE__ */Object.freeze({width:10}),".efh-tl__dot":/* @__PURE__ */Object.freeze({width:16,marginTop:3}),".efh-tl__year":/* @__PURE__ */Object.freeze({marginTop:20,marginBottom:12,marginLeft:40}),".efh-tl .efh-tl__year":/* @__PURE__ */Object.freeze({marginTop:4}),".efh-tl__item":/* @__PURE__ */Object.freeze({gap:16,paddingBottom:24}),".efh-tl__item::before":/* @__PURE__ */Object.freeze({left:11,top:22,bottom:-2}),".efh-tl__date":/* @__PURE__ */Object.freeze({fontSize:12,lineHeight:16.8,letterSpacing:.48}),".efh-tl__title":/* @__PURE__ */Object.freeze({marginTop:2,fontSize:17,lineHeight:22.1}),".efh-tl__text":/* @__PURE__ */Object.freeze({marginTop:2,lineHeight:22.5}),".efh-add":/* @__PURE__ */Object.freeze({gap:12}),".efh-add > p":/* @__PURE__ */Object.freeze({fontSize:15,lineHeight:22.5}),".efh-sheet .rec-note":/* @__PURE__ */Object.freeze({marginTop:4}),".efh-lab":/* @__PURE__ */Object.freeze({paddingTop:8,paddingBottom:96,paddingLeft:16}),".efh-titles":/* @__PURE__ */Object.freeze({gap:2,paddingTop:4}),".efh-title":/* @__PURE__ */Object.freeze({fontSize:22}),".efh-smeta":/* @__PURE__ */Object.freeze({fontSize:13}),".efh-mk__name":/* @__PURE__ */Object.freeze({fontSize:17}),".efh-mk__line":/* @__PURE__ */Object.freeze({rowGap:0,columnGap:6,marginTop:1,fontSize:13,lineHeight:18.2}),".efh-mk__line b":/* @__PURE__ */Object.freeze({fontSize:17}),".efh-none":/* @__PURE__ */Object.freeze({paddingTop:0}),".efh-none__scene":/* @__PURE__ */Object.freeze({marginBottom:16,marginLeft:-16}),".efh-none__t":/* @__PURE__ */Object.freeze({fontSize:22,lineHeight:25.3,letterSpacing:-.44}),".efh-none__lead":/* @__PURE__ */Object.freeze({marginTop:8,fontSize:15,lineHeight:22.5}),".efh-ways":/* @__PURE__ */Object.freeze({gap:12,marginTop:16}),".efh-way":/* @__PURE__ */Object.freeze({columnGap:12,paddingTop:16,borderRadius:20}),".efh-way__w":/* @__PURE__ */Object.freeze({gap:2}),".efh-way__t":/* @__PURE__ */Object.freeze({fontSize:16,lineHeight:20.8}),".efh-way__x":/* @__PURE__ */Object.freeze({fontSize:15,lineHeight:21.75}),".efh-peek__labs .efh-card__title":/* @__PURE__ */Object.freeze({marginBottom:8}),".efh-peek__g":/* @__PURE__ */Object.freeze({fontSize:15,lineHeight:21.75,marginBottom:6}),".efh-peek__g b":/* @__PURE__ */Object.freeze({fontSize:16}),".dot":/* @__PURE__ */Object.freeze({width:9}),".rec-top":/* @__PURE__ */Object.freeze({gap:8,paddingTop:16,paddingRight:18,paddingBottom:18,paddingLeft:18,borderRadius:22}),".rec-top__k":/* @__PURE__ */Object.freeze({gap:7,fontSize:10.5,letterSpacing:.63}),".rec-top .emb-btn":/* @__PURE__ */Object.freeze({marginTop:4}),".mixbar":/* @__PURE__ */Object.freeze({gap:2,height:10}),".mixlegend":/* @__PURE__ */Object.freeze({rowGap:6,columnGap:14,marginTop:12,fontSize:13.5}),".mixlegend li":/* @__PURE__ */Object.freeze({gap:7}),".mixlegend i":/* @__PURE__ */Object.freeze({width:9}),".mixlegend b":/* @__PURE__ */Object.freeze({fontSize:12}),".askbar":/* @__PURE__ */Object.freeze({gap:6,height:52,paddingRight:6,paddingLeft:8,borderWidth:1.5}),".askbar input":/* @__PURE__ */Object.freeze({fontSize:16}),".askbar__add":/* @__PURE__ */Object.freeze({width:38}),".askbar__add svg":/* @__PURE__ */Object.freeze({width:22}),".askbar__send":/* @__PURE__ */Object.freeze({width:40}),".askbar__send svg":/* @__PURE__ */Object.freeze({width:20}),".ph-head":/* @__PURE__ */Object.freeze({height:58,paddingLeft:14}),".ph-back":/* @__PURE__ */Object.freeze({width:44,marginLeft:-6}),".ph-back svg":/* @__PURE__ */Object.freeze({width:26}),".ph-title":/* @__PURE__ */Object.freeze({fontSize:17}),".emb-card":/* @__PURE__ */Object.freeze({borderRadius:22}),".emb-tile":/* @__PURE__ */Object.freeze({width:46,height:46,borderRadius:13}),".ask-pill":/* @__PURE__ */Object.freeze({right:16,bottom:16,gap:8,minHeight:48,paddingRight:18,paddingLeft:14,fontSize:15.5}),".ask-pill svg":/* @__PURE__ */Object.freeze({width:22}),".ph-askbar":/* @__PURE__ */Object.freeze({paddingTop:10,paddingRight:14,paddingBottom:10,paddingLeft:14}),".rec":/* @__PURE__ */Object.freeze({paddingTop:18,paddingLeft:16}),".rec-dna":/* @__PURE__ */Object.freeze({paddingTop:16,marginTop:16}),".rec-dna__top":/* @__PURE__ */Object.freeze({gap:12,marginBottom:14}),".rec-dna__top h3":/* @__PURE__ */Object.freeze({fontSize:17}),".rec-dna__top p":/* @__PURE__ */Object.freeze({fontSize:10.5,letterSpacing:.53,marginTop:2}),".rec-dna__risk":/* @__PURE__ */Object.freeze({gap:10,marginTop:14,paddingTop:12,paddingRight:12,paddingBottom:12,paddingLeft:14,borderRadius:14}),".rec-dna__risk small":/* @__PURE__ */Object.freeze({fontSize:13}),".rec-dna__risk strong":/* @__PURE__ */Object.freeze({marginTop:1,fontSize:16,lineHeight:20}),".rec-dna__clear":/* @__PURE__ */Object.freeze({gap:7,minHeight:36,marginTop:4,paddingLeft:4,fontSize:14}),".rec-dna__clear .dot":/* @__PURE__ */Object.freeze({width:7})});var fe=pe;function he(e,t){let r=fe[e]?.[t];return typeof r=="number"?r:Number.NaN}var be=he;var ge=/* @__PURE__ */Object.freeze({gap:be(".efh","gap"),sheetPadTop:be(".efh-sheet","paddingTop"),sheetPadX:be(".efh-sheet","paddingLeft"),sheetPadBottom:be(".efh-sheet","paddingBottom"),sheetRadius:be(".efh-sheet","borderTopLeftRadius"),sheetGap:be(".efh-sheet","marginTop"),cardPad:be(".efh-card","paddingTop"),cardRadius:be(".efh-card","borderRadius"),name:be(".efh-name","fontSize"),cardTitle:be(".efh-card__title","fontSize"),rowTitle:be(".efh-mk__name","fontSize"),body:be(".efh","fontSize"),small:be(".efh-meta","fontSize"),mono:be(".efh-label","fontSize"),tileNum:be(".efh-tile__num","fontSize"),big:be(".efh-wt b","fontSize"),button:be(".efh-btn","minHeight"),rowButton:be(".efh-btn--row","minHeight"),pill:be(".efh-pill","minHeight"),plot:be(".efh-wchart__plot","height"),rowRadius:be(".efh-due li","borderRadius"),tileGap:be(".efh-tiles","gap"),icon:be(".efh-ico","width")});function me(e,t){return e.trim().toLowerCase()===t.trim().toLowerCase()}function ye(e,t,r){let n=D(e,r);return(n!==null?I(n,t):null)??t}var ve=(e,t)=>parseColor(e)===parseColor(t);function _e(e){if(e.brightness!=="light")return false;let t=e.color,r=ne.color;return ve(t.primary,r.primary)&&ve(t.brandInk,r.brandInk)&&ve(t.onPrimary,r.onPrimary)&&ve(t.accent,r.accent)&&ve(t.accentEdge,r.accentEdge)}function we(e){let t=e.color,r=ue,n=se(e),i=e.brightness==="dark",a=_e(e),o=(i?ae:ne).color,l=!ve(t.accent,o.accent),s=i?t.surface:r.efWhite,d=(e,t)=>ye(e,s,i?.18:t),c=a?r.tintSage:d(n.primary,.105),u=a?r.topCard:l?n.accent:c;return{tintSage:c,chevron:a?r.icoSage:ye(t.brandInk,s,.527),rowGround:a?r.bgMist:d(n.primary,.059),tintPartner:l?d(n.accent,.14):r.embCyan1,topFill:u,plainEdge:a?r.plainEdge:D(t.brandInk,.2)??t.structureEdge,topKicker:ce(u,[l?n.onAccent:i?n.ink3:r.topKicker,r.topInk]),topInk:ce(u,[l?n.onAccent:i?n.ink:r.topInk,r.topInk])}}function recordsSheetLook(e){let t=e.color,r=ue,n=se(e),i=we(e),a=_e(e)?r.go:me(t.accent,t.primary)?t.onPrimary:t.accent;return e.brightness==="dark"?/* @__PURE__ */Object.freeze({dark:true,paper:n.paper,ground:t.background,card:n.card,text:n.ink,muted:n.ink3,line:t.structureEdge,ink:t.brandInk,fill:n.primary,onFill:n.onPrimary,accentOnFill:a,accent:n.accent,go:t.success,goTint:t.badgeBgPositive,alert:n.riskInk,alertDeep:n.riskInk,alertTint:t.badgeBgCritical,watch:t.badgeBgCaution,wind:r.efSkyBlue,tintBlue:t.surfaceSubtle,tintYellow:t.surfaceSubtle,barTrack:t.structureEdge,...i}):/* @__PURE__ */Object.freeze({dark:false,paper:n.paper,ground:r.efWhite,card:r.efWhite,text:r.efBlack,muted:r.muted,line:r.line,ink:t.brandInk,fill:n.primary,onFill:n.onPrimary,accentOnFill:a,accent:n.accent,go:r.go,goTint:r.tintGo,alert:r.alert,alertDeep:r.alertDeep,alertTint:r.tintRed,watch:r.watch,wind:r.efSkyBlue,tintBlue:r.tintBlue,tintYellow:r.tintYellow,barTrack:r.barTrack,...i})}var xe=e.createContext("sheet");xe.Provider;function ze(){return e.useContext(xe)}function je(e,t={}){return{padding:e.cardPad,gap:12,...t,...e.card}}function Ce(e,t){let r={...e};for(let n of Object.keys(t)){let i=t[n];i!==void 0&&(r[n]={...e[n],...i})}return r}var ke=/* @__PURE__ */new WeakMap;function Se(e){let t=ke.get(e);if(t!==void 0)return t;let r=recordsSheetLook(e),n=s(e.slots),i=face(e,"bold"),a={...i,fontSize:16,lineHeight:20},d=/* @__PURE__ */Object.freeze({look:r,ground:r.ground,card:{backgroundColor:r.card,borderRadius:e.radius.lg,borderWidth:r.dark?1:0,borderColor:r.line,shadowColor:"#000000",shadowOpacity:r.dark?0:.09,shadowRadius:3,shadowOffset:{width:0,height:1},elevation:r.dark?0:1,...o(n,1)},cardPad:ge.cardPad,cardTitle:{...i,fontSize:ge.cardTitle,lineHeight:Math.round(ge.cardTitle*1.25*100)/100,letterSpacing:-.36,color:r.ink,...l(n)},body:{...face(e,"regular"),fontSize:15,lineHeight:21,color:r.ink,...l(n)},title:{...face(e,"medium"),fontSize:ge.name,lineHeight:Math.round(ge.name*1.2*100)/100,letterSpacing:-.33,color:r.ink},button:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:8,minHeight:ge.button,paddingHorizontal:20,borderRadius:999},buttonInk:{backgroundColor:r.fill,borderWidth:0,...o(e.slots.primaryButton)},buttonInkLabel:{...a,color:r.onFill,...l(e.slots.primaryButton)},buttonOutline:{backgroundColor:"transparent",borderWidth:1.5,borderColor:r.ink},buttonOutlineLabel:{...a,color:r.ink},askPill:{backgroundColor:ue.embYellow,borderWidth:0,paddingLeft:he(".ask-pill","paddingLeft"),paddingRight:he(".ask-pill","paddingRight")},askPillLabel:{...i,fontSize:he(".ask-pill","fontSize"),lineHeight:he(".ask-pill","fontSize")*1.2,color:ue.topInk}});return ke.set(e,d),d}var Oe=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),Te=globalThis,Ee=Te[Oe]??(Te[Oe]=e.createContext(ne));Ee.displayName??="EverfurThemeContext";function useEverfurTheme(){return e.useContext(Ee)}function Re(e,t){let r=e.scaleCaps[t];return r>0?r:void 0}function Text({tier:r,variant:n,...i}){let a=useEverfurTheme(),o=n===void 0?void 0:a.type.roles[n],l=Re(a.type,r??o?.tier??"content"),s=n===void 0?i:{...i,style:[{...textRole(a,n),color:a.color.text.primary,flexShrink:1},i.style]};return e.createElement(t.Text,l===void 0?s:{maxFontSizeMultiplier:l,...s})}e.forwardRef(function(r,n){return e.createElement(t.TextInput,{...r,...n===null?{}:{ref:n}})});var Fe="your pet";function Ie(e){let t=e?.trim()??"";return t.length>0?t:Fe}var De=/* @__PURE__ */Object.freeze({title:"Health records",titleWeb:e=>{let t=e?.trim()??"";return t.length>0?`${t}’s Records`:"Health records"},titleNative:e=>{let t=e?.trim()??"";return t.length>0?t:"Health records"},openTimeline:"Open timeline",loading:"Loading health records",lead:e=>`${Ie(e)}’s lab trends`,retryMarkers:"Retry loading lab trends",viewFullRecord:"View full medical record",viewTimeline:"View full timeline",important:e=>`Important: ${e}`});var Be=/* @__PURE__ */Object.freeze({pressScale:.97,pressMs:160,riseWebPx:16,riseNativePx:14,fadeMs:320,moveMs:480,staggerMs:55,maxSteps:8});var Le=/* @__PURE__ */Object.freeze({loading:"Loading",empty:"No records yet",upload:"Upload records",consentRequired:"Consent required",allow:"Allow",allPetsConsent:"This covers all your pets. You can withdraw it at any time.",sessionRequired:"Sign in required",recordUnavailable:"Record unavailable",retry:"Try again",records:"Records",beingReviewed:"being reviewed"}),He="Everfur summarizes what your vet recorded. It is informational, not diagnostic.";function Ae(e){let t=(e.brightness==="dark"?ae:ne).color,r=e.color,n=(e,t)=>parseColor(e)===parseColor(t);return{success:!n(r.success,t.success),warning:!n(r.warningStrong,t.warningStrong)||!n(r.cautionAccent,t.cautionAccent),info:!(n(r.info,r.brandInk)&&n(r.badgeBgInfo,r.brandSoft)&&n(r.infoEdge,r.structureEdge))}}var Ne=4.5;function Pe(e){if(!Ae(e).success)return null;let t=[e.color.surface];return L(e.color.success,t,O(t),Ne)}var Me=52;function Ve(){let t=useEverfurTheme(),r=qe();return e.useMemo(()=>$e(t,r),[t,r])}function qe(){let e=useEverfurTheme();return ze()==="sheet"?Se(e):null}function $e(e,r=null){let{color:n,space:i,radius:a,type:d,slots:c}=e,{size:u,lineHeight:p}=d,f=(e,t)=>Math.round(e*t),h=t.StyleSheet.hairlineWidth,b=i.xxl+i.md,g=(t,r,n,i="regular")=>({...face(e,i),fontSize:t,lineHeight:f(t,r),color:n}),m=s(c),y=l(m),v=l(c.banner),_=c.banner?.textColor,w=e.brightness==="dark"?n.errorRed:n.danger,x=(e,t)=>({bg:{backgroundColor:e,borderColor:"transparent"},fg:{color:t}}),z=(e,t)=>({bg:{backgroundColor:n.surface,borderColor:e},fg:{color:t}});return{chipTones:{neutral:z(n.brandBorderStrong,n.text.primary),info:x(n.brandSoft,n.brandInk),warning:z(n.cautionAccent,n.text.primary),critical:z(n.danger,n.danger),positive:z(n.success,Pe(e)??n.brandInk)},...t.StyleSheet.create({root:{flex:1,backgroundColor:n.background},body:{flex:1},content:{paddingHorizontal:i.lg,paddingBottom:i.xxl,gap:i.lg},contentTight:{paddingHorizontal:i.sm,paddingBottom:i.xxl,gap:i.lg},inset:{paddingHorizontal:i.sm},section:{gap:i.sm+i.xs/2},sectionHeader:{flexDirection:"row",alignItems:"center",gap:i.sm,paddingHorizontal:i.xs},sectionTitle:{...g(u.subtitle,p.snug,n.text.primary,"bold"),...headingFace(e,"bold"),letterSpacing:-.4},sectionCount:{...g(u.bodyTight,p.snug,n.text.muted,"medium")},card:{borderRadius:a.lg,borderWidth:1,borderColor:n.borderRingCream,backgroundColor:n.surface,paddingHorizontal:i.lg,paddingVertical:i.xs,...o(m,h)},creamCard:{borderRadius:a.lg,borderWidth:1,borderColor:n.borderRingCream,backgroundColor:n.surfaceCream,padding:i.lg,gap:i.md,...o(m,h)},row:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:i.md,paddingVertical:i.md},rowDivider:{borderTopWidth:h,borderTopColor:n.borderHairlineGreen},rowMain:{flex:1},rowRight:{alignItems:"flex-end",gap:i.xs+i.xs/2},rowTitle:{...g(u.body,p.snug,n.text.primary,"medium"),...y},rowDetail:{...g(u.caption,p.normal,n.text.secondary),marginTop:i.xs/2,...y},rowValue:{...g(u.body+1,p.snug,n.text.primary,"bold"),marginTop:i.xs/2,...y},rowMuted:{...g(u.caption,p.normal,n.text.muted),...y},chip:{minHeight:24,justifyContent:"center",borderRadius:a.pill,borderWidth:1.5,paddingHorizontal:i.sm+i.xs/2,alignSelf:"flex-start"},chipText:{...g(u.tiny+1,p.snug,n.text.primary,"monoBold"),letterSpacing:.7,textTransform:"uppercase"},chipSentence:{borderRadius:a.md,paddingVertical:i.xs,alignSelf:"stretch"},chipSentenceText:{...g(u.caption,p.normal,n.text.primary,"medium"),letterSpacing:0,textTransform:"none"},pill:{minHeight:Me,borderRadius:a.pill,paddingHorizontal:i.lg+i.xs/2,flexDirection:"row",alignItems:"center",justifyContent:"center",gap:i.sm},pillPrimary:{backgroundColor:n.brand,...o(c.primaryButton)},pillPrimaryLabel:{...g(u.body,p.snug,n.onPrimary,"bold"),...l(c.primaryButton)},pillOutline:{borderWidth:1.5,borderColor:n.brandInk,backgroundColor:"transparent"},pillOutlineLabel:{...g(u.body,p.snug,n.brandInk,"bold")},pillDanger:{borderWidth:1.4,borderColor:n.danger,backgroundColor:n.surface},pillDangerLabel:{...g(u.bodyTight,p.snug,n.danger,"bold")},pillAsk:{borderWidth:h,borderColor:n.borderRingCream,backgroundColor:n.surface},pillAskLabel:{...g(u.body,p.snug,n.text.primary,"bold")},pillLink:{minHeight:b,backgroundColor:"transparent",paddingHorizontal:i.sm},pillLinkLabel:{...g(u.body,p.snug,n.linkInk,"bold")},pillDisabled:{opacity:.5},pressed:{transform:[{scale:Be.pressScale}]},infoNote:{flexDirection:"row",alignItems:"flex-start",gap:i.sm,borderRadius:a.md-i.xs/2,backgroundColor:n.brandSoft,paddingHorizontal:i.md,paddingVertical:i.sm+i.xs/2,...o(c.banner)},infoNoteText:{flex:1,...g(u.bodyTight,p.normal,n.text.primary),...v},cautionNote:{flexDirection:"row",alignItems:"flex-start",gap:i.sm,borderRadius:a.md-i.xs/2,backgroundColor:n.badgeBgCaution,paddingHorizontal:i.md,paddingVertical:i.sm+i.xs/2},cautionNoteText:{flex:1,...g(u.bodyTight,p.normal,n.warningStrong)},statusCard:{borderRadius:a.md,backgroundColor:n.brandSoft,padding:i.md+i.xs/2},statusText:g(u.bodyTight,p.relaxed,n.text.primary),errorBanner:{flexDirection:"row",alignItems:"flex-start",gap:i.sm,borderRadius:a.md-i.xs/2,backgroundColor:n.badgeBgCritical,padding:i.md},errorText:{flex:1,...g(u.bodyTight,p.normal,w)},band:{flexDirection:"row",alignItems:"flex-start",gap:i.sm,borderRadius:a.md-i.xs/2,padding:i.md,backgroundColor:n.brandSoft,...o(c.banner)},bandText:{flex:1,...g(u.caption,p.normal,n.text.secondary),...v},infoGlyph:{width:i.md+i.xs/2,height:i.md+i.xs/2,borderRadius:a.pill,borderWidth:1,borderColor:_??n.text.secondary,alignItems:"center",justifyContent:"center"},infoGlyphText:{...g(u.small,p.tight,n.text.secondary,"bold"),...v},chevron:{width:i.sm,height:i.sm,borderTopWidth:i.xs/2,borderRightWidth:i.xs/2,borderColor:n.text.muted},lead:{paddingHorizontal:i.sm,...g(u.body+1,p.snug,n.text.primary,"bold")},field:{minHeight:b,paddingHorizontal:i.md,paddingVertical:i.sm,borderWidth:1,borderColor:n.borderHairlineGreen,borderRadius:a.sm,color:n.text.primary,backgroundColor:n.surface,...face(e,"regular"),fontSize:u.body,...o(c.input,1),...l(c.input)},fieldLabel:{...g(u.bodyTight,p.normal,n.text.secondary,"medium")},muted:g(u.caption,p.normal,n.text.muted),bodyText:g(u.body,p.normal,n.text.primary)}),...r!==null?We(r):{}}}function We(e){return t.StyleSheet.create({root:{flex:1,backgroundColor:e.ground},sectionTitle:e.cardTitle,card:{...e.card,paddingHorizontal:e.cardPad,paddingVertical:e.cardPad/4},creamCard:{...e.card,padding:e.cardPad,gap:12},pill:e.button,pillPrimary:e.buttonInk,pillPrimaryLabel:e.buttonInkLabel,pillOutline:e.buttonOutline,pillOutlineLabel:e.buttonOutlineLabel,pillAsk:e.askPill,pillAskLabel:e.askPillLabel,lead:{paddingHorizontal:8,...e.cardTitle}})}function Ue(e){let t=globalThis.console;try{t?.error?.("[everfur] A host callback threw; the SDK ignored it.",e)}catch{}}function Ge(e){return(typeof e=="object"||typeof e=="function")&&e!==null&&typeof e.then=="function"}function Ke(e,...t){if(typeof e=="function")try{let r=e(...t);return Ge(r)&&Promise.resolve(r).then(void 0,Ue),r}catch(e){Ue(e);return}}var Ye=/* @__PURE__ */new WeakMap;function Qe(e){if(typeof e!="function")return;let t=Ye.get(e);if(t!==void 0)return t;let r=(...t)=>{Ke(e,...t)};return Ye.set(e,r),r}function Xe(e){return e?.httpStatus===429?"rate_limited":e?.httpStatus===502?"service_unavailable":"error"}function Ze(e,t){return e===null?"":t?`${e} ${t}`:e}var Je=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function et(e){if(!e)return"-";let t=/^(\d{4})-(\d{2})-(\d{2})/.exec(e);if(t!==null)return tt(Number(t[1]),Number(t[2])-1,Number(t[3]));let r=Date.parse(e);if(Number.isNaN(r))return"-";let n=new Date(r);return tt(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate())}function tt(e,t,r){let n=Je[t];return n===void 0?"-":`${n} ${r}, ${e}`}function rt(e){let t=e?/^([\d-]{10}T[\d:]+)(\.\d+)?(.*)$/.exec(e):null,r=t?Date.parse(`${t[1]}${(t[2]??"").slice(0,4)}${t[3]||"Z"}`):Number.NaN;if(Number.isNaN(r))return et(e);let n=new Date(r);return tt(n.getFullYear(),n.getMonth(),n.getDate())}var nt=/* @__PURE__ */Object.freeze({timeline:"Timeline",loadingTimeline:"Loading timeline",labResults:"Blood & lab work",visits:"Visits",physicalExams:"Physical exams",visitNotes:"Visit notes",visit:"Visit",exam:"Exam",visitNote:"Visit note",notRecorded:"Not recorded",abnormal:"Abnormal",notExamined:"Not examined",normal:"Normal",measured:e=>`Measured ${e}`,uploadedDocument:"Uploaded document",kind:/* @__PURE__ */Object.freeze({visit:"Visit",vaccine:"Vaccine",weight:"Weight",medication:"Medication"}),clinicVisit:"Clinic visit",doctor:e=>`Dr. ${e}`,lot:e=>`Lot ${e}`,expires:e=>`Expires ${e}`});function it(e){switch(e){case"above":return{label:"Above range",outOfRange:true};case"below":return{label:"Below range",outOfRange:true};case"in_range":return{label:"In range",outOfRange:false};default:return{label:"No range on file",outOfRange:false}}}function at(e,t){return t<2?null:`${e==="flat"?"Holding steady":`Trending ${e==="down"?"down":e==="up"?"up":"steady"}`} over ${t} visits`}function ot(e){let t=e.replace(/_/g," ").trim();return t.length===0?e:t.charAt(0).toUpperCase()+t.slice(1)}var lt=/* @__PURE__ */Object.freeze({general:"General / attitude",eent:"Eyes, ears, nose & throat",oral_dental:"Oral & dental",cardiovascular:"Cardiovascular",respiratory:"Respiratory",gastrointestinal:"GI / abdomen",urogenital:"Urogenital",musculoskeletal:"Musculoskeletal",neurologic:"Neurologic",integument:"Skin & coat",lymphatic:"Lymph nodes"});function st(e){return Object.prototype.hasOwnProperty.call(lt,e)?lt[e]:ot(e)}var dt=/* @__PURE__ */Object.freeze({reason_for_visit:"Reason for visit",subjective:"Subjective",objective:"Objective",assessment:"Assessment",plan:"Plan",discharge_instructions:"Discharge instructions",follow_up:"Follow-up",remarks:"Notes"});function ct(e){return Object.prototype.hasOwnProperty.call(dt,e)?dt[e]:ot(e)}function ut(e){return e===null||!Number.isFinite(e)?"-":`${e.toFixed(3).replace(/\.?0+$/,"")} kg`}function pt(e,t,r){if((e===null||!Number.isFinite(e))&&r)return r;if(e===null||!Number.isFinite(e))return"-";let n=e.toFixed(3).replace(/\.?0+$/,"");return t?`${n} ${t}`:n}function ft(e,t,r){let n=at(t,r);return e?`${nt.measured(et(e))}${n?` · ${n}`:""}`:n}var ht=/* @__PURE__ */Object.freeze({lab_report:"Lab report",pims_export:"Practice export",vaccination_certificate:"Vaccination certificate",imaging_report:"Imaging report",discharge_summary:"Discharge summary",referral_letter:"Referral letter",clinician_note:"Clinician note",consent_form:"Consent form",invoice_estimate:"Invoice",prescription:"Prescription",genetic_report:"Genetic report"});function bt(e){let t=e.title?.trim()??"";if(t.length>0)return t;let r=e.documentClass;return(r&&Object.prototype.hasOwnProperty.call(ht,r)?ht[r]:void 0)??nt.uploadedDocument}var gt=/* @__PURE__ */Object.freeze({visit:0,vaccine:1,weight:2,medication:3});function mt(e){if(!e)return null;let t=Date.parse(e);return Number.isNaN(t)?null:t}function buildTimelineRows(e){let t=[...e.visits.map((e,t)=>({key:`visit-${t}-${e.visitId}`,kind:"visit",kindLabel:nt.kind.visit,at:e.visitDate,date:et(e.visitDate),title:e.summary??nt.clinicVisit,detail:e.veterinarian?nt.doctor(e.veterinarian):null,docId:e.docId})),...e.vaccines.map((e,t)=>{let r=[];return e.lot&&r.push(nt.lot(e.lot)),e.expiresOn&&r.push(nt.expires(et(e.expiresOn))),{key:`vaccine-${t}-${e.vaccineId}`,kind:"vaccine",kindLabel:nt.kind.vaccine,at:e.administeredOn,date:et(e.administeredOn),title:e.product||nt.kind.vaccine,detail:r.length?r.join(" · "):null,docId:e.docId}}),...e.weights.map((e,t)=>({key:`weight-${t}-${e.weightId}`,kind:"weight",kindLabel:nt.kind.weight,at:e.observedOn,date:et(e.observedOn),title:ut(e.weightKg),detail:null,docId:e.docId})),...e.medications.map((e,t)=>{let r=[e.dose,e.route,e.frequency].filter(e=>!!e);return{key:`medication-${t}-${e.medicationId}`,kind:"medication",kindLabel:nt.kind.medication,at:e.startedOn,date:et(e.startedOn),title:e.drugName||nt.kind.medication,detail:r.length?r.join(" · "):null,docId:e.docId}})];/* @__PURE__ */
|
|
3
|
+
return Object.freeze(t.sort((e,t)=>{let r=mt(e.at),n=mt(t.at);return r===null&&n===null?gt[e.kind]-gt[t.kind]:r===null?1:n===null?-1:n!==r?n-r:gt[e.kind]-gt[t.kind]}))}var yt=[{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}],vt=/* @__PURE__ */Object.freeze(yt.map(e=>/* @__PURE__ */Object.freeze(e)));/* @__PURE__ */Object.freeze(vt.map(e=>e.wireCode));var _t=/* @__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"}),wt=/* @__PURE__ */Object.freeze(vt.map(e=>/* @__PURE__ */Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:_t[e.wireCode]}))),xt=new Map(wt.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),zt=/* @__PURE__ */Object.freeze(["http_envelope",...[...new Set(wt.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function contractErrorFor(e,t){if(typeof e!="string")return;let r=e.trim().toUpperCase();if(r.length!==0)for(let e of[t??"http_envelope",...zt]){let t=xt.get(e+r);if(t)return t}}var jt=/* @__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 jt[e]}function fromWire(e){let t=contractErrorFor(e);if(t)return t.normalized;let r=(e??"").trim().toUpperCase(),n=r.replace(/[^A-Z0-9]/g,"");if(n==="AUTHREJECTED")return"authRejected";if(r.startsWith("AUTH"))return"authExpired";switch(n){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 Ct=/* @__PURE__ */new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function isAutoRetryable(e){return Ct.has(e)}var kt=/* @__PURE__ */new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function isRetryableCode(e){return isAutoRetryable(e)||kt.has(e)}var St=500,Ot=8e3,Tt=4;function backoffDelayMs(e,t=Math.random){let r=Math.max(0,e),n=Math.min(St*2**r,Ot);return Math.floor(t()*n)}var Et="This feature isn't available on your account right now.",Rt="Something in that request was not right. Check the details and try again.",Ft=/* @__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:Et,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:Rt,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:Et,runtimeDisposed:Rt,unknown:"Something went wrong. Please try again."}),It="This session has ended. Please sign in again.",Dt="linked_account_read_only";function Bt(e,t,r){return e==="conflict"&&r===Dt?Et:(e==="authRejected"||e==="authExpired")&&typeof t=="string"&&t.trim().toLowerCase()==="session_revoked"?It:userFacingError(e)}function userFacingError(e){return Ft[e]}function Lt(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:false,writable:false,configurable:false})}var Ht=/^[a-z][a-z0-9_]{0,63}$/;function makeEverfurError(e,t){let r=contractErrorFor(t?.wireCode,t?.wireEnvelope),n=e==="conflict"&&t?.reasonCode===Dt,i={code:e,category:categoryFor(e),retryable:t?.retryable??(n?false:isRetryableCode(e)),displayMessage:Bt(e,t?.wireCode,n?Dt:null)};t?.httpStatus!==void 0&&(i.httpStatus=t.httpStatus),t?.requestId&&(i.requestId=t.requestId),typeof t?.reasonCode=="string"&&Ht.test(t.reasonCode)&&(i.reasonCode=t.reasonCode);let a=t?.retryAfterSeconds;if(typeof a=="number"&&Number.isFinite(a)&&a>=0&&(i.retryAfterSeconds=Math.round(a)),r);return t?.wireMessage&&Lt(i,"wireMessage",t.wireMessage),t?.raw!==void 0&&t.raw!==null&&Lt(i,"raw",t.raw),/* @__PURE__ */Object.freeze(i)}function ok(e,t){/* @__PURE__ */
|
|
4
4
|
return Object.freeze({ok:true,value:e})}function err(e){/* @__PURE__ */
|
|
5
|
-
return Object.freeze({ok:false,error:e})}var
|
|
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
|
|
5
|
+
return Object.freeze({ok:false,error:e})}var At=class _EverfurConfigError extends Error{constructor(e,t){super(t),this.name="EverfurConfigError",this.kind=e,Object.setPrototypeOf(this,_EverfurConfigError.prototype)}};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 Nt="x-everfur-anon-token",Pt="anonTokenInvalid";async function Mt(e){if(e.userRef!==null||e.anonIdentity===void 0)return null;try{return await e.anonIdentity.token()}catch{return null}}function Vt(e,t){let r=e instanceof Error?e.message:typeof e=="string"?e:null;return makeEverfurError("authRejected",{retryable:false,...t?.wireCode?{wireCode:t.wireCode}:{},...t?.requestId?{requestId:t.requestId}:{},...r?{wireMessage:r}:{},...e!=null?{raw:e}:{}})}function authHeaders(e){let t={};return e.mode==="personalized"?t.authorization=`Bearer ${e.token}`:(t["x-everfur-partner-key"]=e.publishableKey,e.anonToken&&(t[Nt]=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:{...qt(e.headers),...authHeaders(t)}}}function qt(e){if(!e)return{};let t={};for(let[r,n]of Object.entries(e)){let e=r.toLowerCase();e==="authorization"||e==="x-everfur-partner-key"||e===Nt||(t[r]=n)}return t}async function authedSend(e,t){if(t.mode==="anonymous"){let r=await Mt(t),n=await t.transport.request(withAuthHeaders(e,$t(t,r)));if(n.ok||Ut(n.error.raw)!==Pt||t.anonIdentity===void 0||t.userRef!==null)return n;let i=await t.anonIdentity.token({forceRefresh:true});return i===null||i===r?n:t.transport.request(withAuthHeaders(e,$t(t,i)))}let r;try{r=await t.identity.currentToken()}catch(e){return t.identity.reportRejected?.(),err(Vt(e))}let n=await t.transport.request(withAuthHeaders(e,{mode:"personalized",token:r,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));if(n.ok||n.error.httpStatus!==401)return n;let i;try{i=await t.identity.currentToken({forceRefresh:!0})}catch(e){return t.identity.reportRejected?.(),err(Vt(e,{wireCode:Ut(n.error.raw),requestId:n.error.requestId}))}let a=await t.transport.request(withAuthHeaders(e,{mode:"personalized",token:i,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));return!a.ok&&a.error.httpStatus===401?(t.identity.reportRejected?.(),err(Wt(a.error))):a}function $t(e,t){return{mode:"anonymous",publishableKey:e.publishableKey,userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{},...t!==null?{anonToken:t}:{}}}function Wt(e){let t=e.raw,r=Ut(t);return makeEverfurError("authRejected",{retryable:false,...e.httpStatus!==void 0?{httpStatus:e.httpStatus}:{},...e.requestId?{requestId:e.requestId}:{},...r?{wireCode:r}:{},...e.reasonCode?{reasonCode:e.reasonCode}:{},...e.wireMessage?{wireMessage:e.wireMessage}:{},...t!=null?{raw:t}:{}})}function Ut(e){if(typeof e!="object"||e===null)return null;let t=e,r=(typeof t.error=="object"&&t.error!==null?t.error.code:void 0)??t.code;return typeof r=="string"&&r.length>0?r:null}var Gt=/^([A-Za-z][A-Za-z0-9+.-]*):\/\/([^/?#]*)/;function Kt(e,t){let r=globalThis.URL;if(typeof r=="function"){let n;try{n=t===void 0?new r(e):new r(e,t)}catch{return null}try{if(n.protocol)return n}catch{}}return Zt(e,t)}var Yt=/^([a-z][a-z0-9+.-]*):\/\/(?:([^:@/?#]*)(?::([^@/?#]*))?@)?(\[[0-9a-f:.]+\]|[\w.~-]+)(?::(\d*))?(\/[^?#]*)?(\?[^#]*)?(#.*)?$/i,Qt=/[\s\u0000-\u001f\u007f\\]/,Xt={"http:":"80","https:":"443"};function Zt(e,t){let r=e.trim();if(t!==void 0&&!Gt.test(r)){let e=Zt(t);if(e===null||!r.startsWith("/")||r.startsWith("//"))return null;r=e.origin+r}let n=Qt.test(r)?null:Yt.exec(r);if(n===null)return null;let[,i="",a="",o="",l="",s="",d="",c="",u=""]=n,p=`${i.toLowerCase()}:`,f=Number(s);if(f>65535)return null;let h=s===""||String(f)===Xt[p]?"":String(f),b=Xt[p]!==void 0,g=l.toLowerCase()+(h&&`:${h}`),m=d||(b?"/":""),y=a||o?`${a}${o&&`:${o}`}@`:"";return{href:`${p}//${y}${g}${m}${c}${u}`,protocol:p,username:a,password:o,hostname:l.toLowerCase(),port:h,origin:b?`${p}//${g}`:"null",pathname:m,search:c==="?"?"":c,hash:u==="#"?"":u}}function networkError(e){return makeEverfurError("internalError",{retryable:true,wireMessage:Jt(e)})}function Jt(e){return e instanceof Error?e.message:typeof e=="string"?e:"network request failed"}var er=3e4,tr=Ot*2,rr="idempotency-key",nr=/* @__PURE__ */new Set(["POST","PUT","PATCH","DELETE"]),ir=/* @__PURE__ */Object.freeze({onEvent(){}}),ar=/* @__PURE__ */Object.freeze({setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),now:()=>Date.now()});function or(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??ir,r=e.timers??ar,n=e.rng??Math.random,i=e.sleep??((e,t)=>xr(e,r,t)),a=e.maxAttempts??Tt,o=e.unaryTimeoutMs??er,l=e.newIdempotencyKey??sr(),s=e=>{try{t.onEvent(e)}catch{}};async function d(t,d,c){let u=c?.maxAttempts,p=Math.max(1,u??a),f=c?.idempotent??nr.has(d.method),h=c?.idempotencyKey===void 0?null:or(c.idempotencyKey),b=f?h??l():null,g=lr(d,b),m=0;for(;;){let a=e=>/* @__PURE__ */Object.freeze({call:t,method:d.method,path:d.path,attempt:m,...b?{idempotencyKey:b}:{},...e});s(a({phase:"attempt"}));let l=_r(o,r),c=wr(l.signal,d.signal),f;try{f=await authedSend({...g,signal:c.signal},e.auth)}catch(e){f=err(networkError(e))}finally{c.dispose(),l.cancel()}if(f.ok)return s(a({phase:"settled",ok:true,reason:"ok"})),f;let h=f.error,y=cr(h,m,{maxAttempts:p,rng:n,now:r.now(),aborted:d.signal?.aborted===true,...u!==void 0?{perCallMaxAttempts:u}:{},...e.errorPolicy!==void 0?{policy:e.errorPolicy}:{}}),v={ok:false,code:h.code,reason:y.reason,...h.httpStatus!==void 0?{httpStatus:h.httpStatus}:{},...h.requestId!==void 0?{requestId:h.requestId}:{}};if(!y.retry)return s(a({phase:"settled",...v})),err(h);if(s(a({phase:"retry",...v,delayMs:y.delayMs})),await i(y.delayMs,d.signal),d.signal?.aborted===true)return s(a({phase:"settled",...v,reason:"aborted"})),err(h);m+=1}}async function c(t){return withAuthHeaders(t,await vr(e.auth))}async function*u(t,r,n){s(
|
|
7
7
|
/* @__PURE__ */Object.freeze({call:t,phase:"stream.open",method:r.method,path:r.path,attempt:0}));try{yield*e.auth.transport.stream(r,n)}catch{yield errorFrame({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null})}}/* @__PURE__ */
|
|
8
|
-
return Object.freeze({send:d,authorize:c,stream:u})}function
|
|
9
|
-
return Object.freeze({key:e.key,category:e.category??"",label:e.label??e.key,value:e.value??null,unit:e.unit??null,observedAt:e.observed_at??null,status:e.status??null,origin:
|
|
10
|
-
return Object.freeze({docId:e.doc_id,title:e.title??null,documentClass:e.document_class??null,pageCount:e.page_count??null,receivedAt:e.received_at??null})}var
|
|
11
|
-
return Object.freeze({petRef:e,withheld:true,markers:/* @__PURE__ */Object.freeze([]),summary:null,disclaimer:"",featuredMarkerId:null})}function mapRecordMarkers(petRef,e){let t=
|
|
12
|
-
return Object.freeze({petRef:r,withheld:false,markers:/* @__PURE__ */Object.freeze(o),summary:i.summary?/* @__PURE__ */Object.freeze({totalMarkers:i.summary.total_markers,inRangeCount:i.summary.in_range_count,outOfRangeCount:i.summary.out_of_range_count,unknownCount:i.summary.unknown_count}):null,disclaimer:i.disclaimer??"",featuredMarkerId:i.featured_marker_id??null})}var
|
|
8
|
+
return Object.freeze({send:d,authorize:c,stream:u})}function lr(e,t){let r={};for(let[t,n]of Object.entries(e.headers??{}))t.toLowerCase()!==rr&&(r[t]=n);return t!==null&&(r["Idempotency-Key"]=t),{...e,headers:r}}function sr(){let e=0;return()=>`efk_${Date.now().toString(36)}_${(e++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}var dr=10;function cr(e,t,r){if(r.aborted)return{retry:false,reason:"aborted"};let n=ur(e);if(n==="quota")return{retry:false,reason:"daily-quota-exhausted"};if(n!=="burst"&&!isAutoRetryable(e.code))return{retry:false,reason:"terminal-code"};let i=n==="burst"?"burst-throttle":"retryable-code";if((()=>{if(r.policy===void 0)return false;try{return!r.policy.shouldRetry(e.code,t)}catch{return false}})())return{retry:false,reason:"terminal-code"};let a=()=>{if(r.policy===void 0)return null;let t;try{t=r.policy.maxAttempts(e.code)}catch{return null}return typeof t!="number"||!Number.isFinite(t)?null:Math.max(1,Math.min(dr,Math.floor(t)))},o=r.perCallMaxAttempts??a()??r.maxAttempts;if(t+1>=o)return{retry:false,reason:"attempts-exhausted"};let l=pr(e,r.now);return l!==null?l>tr?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:i,delayMs:l}:{retry:true,reason:i,delayMs:backoffDelayMs(t,r.rng)}}function ur(e){let t=e.code==="unknown"?fromWire(mr(e.raw)):e.code;return t==="quotaExceeded"?"quota":t==="rateLimited"||e.httpStatus===429?"burst":null}function pr(e,t){let r=hr(e.raw);if(r!==null){let e=r-t;return e>0?e:0}let n=fr(e.raw);return n===null?null:Math.round(n*1e3)}function fr(e){for(let t of br(e)){let e=t.retry_after_seconds;if(typeof e=="number"&&Number.isFinite(e)&&e>=0)return e}return null}function hr(e){for(let t of br(e)){let e=t.resets_at,r=gr(e);if(r!==null)return r}return null}function br(e){if(!yr(e))return[];let t=[e];for(let r of["error","detail"]){let n=e[r];yr(n)&&t.push(n)}return t}function gr(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 mr(e){for(let t of br(e)){let e=t.code;if(typeof e=="string"&&e.length>0)return e}return null}function yr(e){return typeof e=="object"&&e!==null}async function vr(e){if(e.mode==="anonymous"){let t=await Mt(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 _r(e,t){let r=new AbortController,n=t.setTimeout(()=>r.abort(),e);return{signal:r.signal,cancel:()=>t.clearTimeout(n)}}function wr(e,t){let r=()=>{};if(!t)return{signal:e,dispose:r};let n=new AbortController;if(e.aborted||t.aborted)return n.abort(),{signal:n.signal,dispose:r};let i=()=>n.abort();return e.addEventListener("abort",i,{once:true}),t.addEventListener("abort",i,{once:true}),{signal:n.signal,dispose:()=>{e.removeEventListener("abort",i),t.removeEventListener("abort",i)}}}function xr(e,t,r){return e<=0||r?.aborted===true?Promise.resolve():new Promise(n=>{let i=t.setTimeout(()=>{r?.removeEventListener("abort",a),n()},e),a=()=>{t.clearTimeout(i),n()};r?.addEventListener("abort",a,{once:true})})}function zr(e){for(let t=0;t<e.length;t+=1){let r=e.charCodeAt(t);if(r>=55296&&r<=56319){let r=e.charCodeAt(t+1);if(!(r>=56320&&r<=57343))return true;t+=1}else if(r>=56320&&r<=57343)return true}return false}function jr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Cr=64,kr=512;function Sr(e){return e==="owner_reported"||e==="clinic_document"?e:null}var Or=/* @__PURE__ */n.z.object({key:/* @__PURE__ */n.z.string(),category:/* @__PURE__ */n.z.string().optional(),label:/* @__PURE__ */n.z.string().optional(),value:/* @__PURE__ */n.z.string().nullish(),unit:/* @__PURE__ */n.z.string().nullish(),observed_at:/* @__PURE__ */n.z.string().nullish(),status:/* @__PURE__ */n.z.string().nullish(),origin:/* @__PURE__ */n.z.string().nullish(),canonical_key:/* @__PURE__ */n.z.string().nullish()});var Tr=/* @__PURE__ */n.z.object({doc_id:/* @__PURE__ */n.z.string(),title:/* @__PURE__ */n.z.string().nullish(),document_class:/* @__PURE__ */n.z.string().nullish(),page_count:/* @__PURE__ */n.z.number().nullish(),received_at:/* @__PURE__ */n.z.string().nullish()});function Er(e){/* @__PURE__ */
|
|
9
|
+
return Object.freeze({key:e.key,category:e.category??"",label:e.label??e.key,value:e.value??null,unit:e.unit??null,observedAt:e.observed_at??null,status:e.status??null,origin:Sr(e.origin),canonicalKey:e.canonical_key??null})}function Rr(e){/* @__PURE__ */
|
|
10
|
+
return Object.freeze({docId:e.doc_id,title:e.title??null,documentClass:e.document_class??null,pageCount:e.page_count??null,receivedAt:e.received_at??null})}var Fr=/* @__PURE__ */n.z.string().nullish(),Ir=/* @__PURE__ */n.z.number().nullish(),Dr=/* @__PURE__ */n.z.object({collected_at:Fr,at:Fr,value:Ir,unit:Fr,qualitative_result:Fr,ref_low:Ir,ref_high:Ir,status:Fr,source_clinic:Fr,source_doc_id:Fr,doc_id:Fr,reviewed:/* @__PURE__ */n.z.boolean().nullish()}),Br=/* @__PURE__ */n.z.object({collected_at:Fr,at:Fr,value:Ir,unit:Fr,qualitative_result:Fr,status:Fr}),Lr=/* @__PURE__ */n.z.object({marker_id:/* @__PURE__ */n.z.string().min(1),canonical_name:Fr,name:Fr,loinc_code:Fr,canonical_unit:Fr,unit:Fr,panel_name:Fr,panel:Fr,meaning_text:Fr,meaning:Fr,latest:/* @__PURE__ */Br.nullish(),trajectory:Fr,points:/* @__PURE__ */n.z.array(Dr).optional()}),Hr=/* @__PURE__ */n.z.object({total_markers:/* @__PURE__ */n.z.number().int().nonnegative(),in_range_count:/* @__PURE__ */n.z.number().int().nonnegative(),out_of_range_count:/* @__PURE__ */n.z.number().int().nonnegative(),unknown_count:/* @__PURE__ */n.z.number().int().nonnegative()}),Ar=/* @__PURE__ */n.z.object({markers:/* @__PURE__ */n.z.array(Lr).optional(),summary:/* @__PURE__ */Hr.nullish(),disclaimer:/* @__PURE__ */n.z.string().optional(),featured_marker_id:Fr});function Nr(e){/* @__PURE__ */
|
|
11
|
+
return Object.freeze({petRef:e,withheld:true,markers:/* @__PURE__ */Object.freeze([]),summary:null,disclaimer:"",featuredMarkerId:null})}function mapRecordMarkers(petRef,e){let t=jr(e)?e:{},r=typeof t.pet_ref=="string"&&t.pet_ref.length>0?t.pet_ref:petRef;if(t.withheld===true)return Nr(r);let n=Ar.safeParse(t);if(!n.success)return Nr(r);let i=n.data,a=e=>/* @__PURE__ */Object.freeze({at:e.collected_at??e.at??null,value:e.value??null,unit:e.unit??null,qualitativeResult:e.qualitative_result??null,refLow:e.ref_low??null,refHigh:e.ref_high??null,status:e.status??null,sourceClinic:e.source_clinic??null,docId:e.source_doc_id??e.doc_id??null,reviewed:e.reviewed===true}),o=(i.markers??[]).map(e=>/* @__PURE__ */Object.freeze({markerId:e.marker_id,name:e.canonical_name??e.name??e.marker_id,loincCode:e.loinc_code??null,unit:e.canonical_unit??e.unit??null,panel:e.panel_name??e.panel??null,meaning:e.meaning_text??e.meaning??null,latest:e.latest?/* @__PURE__ */Object.freeze({at:e.latest.collected_at??e.latest.at??null,value:e.latest.value??null,unit:e.latest.unit??null,qualitativeResult:e.latest.qualitative_result??null,status:e.latest.status??null}):null,trajectory:e.trajectory??null,points:/* @__PURE__ */Object.freeze((e.points??[]).map(a))}));/* @__PURE__ */
|
|
12
|
+
return Object.freeze({petRef:r,withheld:false,markers:/* @__PURE__ */Object.freeze(o),summary:i.summary?/* @__PURE__ */Object.freeze({totalMarkers:i.summary.total_markers,inRangeCount:i.summary.in_range_count,outOfRangeCount:i.summary.out_of_range_count,unknownCount:i.summary.unknown_count}):null,disclaimer:i.disclaimer??"",featuredMarkerId:i.featured_marker_id??null})}var Pr=128,Mr=128;var Vr=/* @__PURE__ */n.z.string().min(1).refine(e=>e.startsWith("https://")),qr=/* @__PURE__ */n.z.object({source_doc_id:/* @__PURE__ */n.z.string().min(1),file_name:/* @__PURE__ */n.z.string().nullish(),doc_format:/* @__PURE__ */n.z.string().nullish(),byte_size:/* @__PURE__ */n.z.number().int().nonnegative().nullish(),received_at:/* @__PURE__ */n.z.string().nullish(),download_url:Vr,expires_in_seconds:/* @__PURE__ */n.z.number().int().nonnegative().nullish()}),$r=/* @__PURE__ */n.z.object({items:/* @__PURE__ */n.z.array(/* @__PURE__ */n.z.unknown()).optional()});function Wr(e){let t=$r.safeParse(e);if(!t.success)return null;let r=[];for(let e of t.data.items??[]){let t=qr.safeParse(e);t.success&&r.push(
|
|
13
13
|
/* @__PURE__ */Object.freeze({sourceDocId:t.data.source_doc_id,fileName:t.data.file_name??null,docFormat:t.data.doc_format??null,byteSize:t.data.byte_size??null,receivedAt:t.data.received_at??null,downloadUrl:t.data.download_url,expiresInSeconds:t.data.expires_in_seconds??0}))}/* @__PURE__ */
|
|
14
|
-
return Object.freeze(r)}var
|
|
15
|
-
return Object.freeze({features:/* @__PURE__ */Object.freeze({...t.data.features}),uploadContentTypes:/* @__PURE__ */Object.freeze([
|
|
16
|
-
return Object.freeze({petRef:e,available:false,withheld:t,labResults:/* @__PURE__ */Object.freeze([]),encounters:/* @__PURE__ */Object.freeze([]),clinicianNotes:/* @__PURE__ */Object.freeze([]),physicalExams:/* @__PURE__ */Object.freeze([]),completeness:null,conflicts:/* @__PURE__ */Object.freeze([])})}function mapRecordDepth(petRef,e){let t=
|
|
17
|
-
return Object.freeze({petRef:r,available:true,withheld:false,labResults:/* @__PURE__ */Object.freeze((i.lab_results??[]).map(e=>/* @__PURE__ */Object.freeze({markerId:e.marker_id,name:e.name,loincCode:e.loinc_code??null,unit:e.unit??null,panel:e.panel??null,meaning:e.meaning??null,latest:/* @__PURE__ */Object.freeze({at:e.latest?.at??null,value:e.latest?.value??null,unit:e.latest?.unit??null,qualitativeResult:e.latest?.qualitative_result??null,status:e.latest?.status??null}),trajectory:e.trajectory??null,points:/* @__PURE__ */Object.freeze((e.points??[]).map(a))}))),encounters:/* @__PURE__ */Object.freeze((i.encounters??[]).map(e=>/* @__PURE__ */Object.freeze({encounterId:e.encounter_id,date:e.date??null,type:e.type??null,clinicName:e.clinic_name??null,veterinarian:e.veterinarian??null,docId:e.doc_id??null}))),clinicianNotes:/* @__PURE__ */Object.freeze((i.clinician_notes??[]).map(e=>/* @__PURE__ */Object.freeze({noteId:e.note_id,encounterId:e.encounter_id??null,observedOn:e.observed_on??null,sections:/* @__PURE__ */Object.freeze((e.sections??[]).map(e=>/* @__PURE__ */Object.freeze({section:e.section,text:e.text})))}))),physicalExams:/* @__PURE__ */Object.freeze((i.physical_exams??[]).map(e=>/* @__PURE__ */Object.freeze({examId:e.exam_id,encounterId:e.encounter_id??null,observedOn:e.observed_on??null,docId:e.doc_id??null,systems:/* @__PURE__ */Object.freeze(Object.entries(e.systems??{}).map(([e,t])=>/* @__PURE__ */Object.freeze({system:e,findingStatus:t.finding_status??null,finding:t.finding??null})))}))),completeness:i.completeness?/* @__PURE__ */Object.freeze({hasLabHistory:i.completeness.has_lab_history===true,hasVaccinationHistory:i.completeness.has_vaccination_history===true,hasWeightHistory:i.completeness.has_weight_history===true,hasVitalsHistory:i.completeness.has_vitals_history===true,hasPhysicalExamHistory:i.completeness.has_physical_exam_history===true,hasProcedureHistory:i.completeness.has_procedure_history===true,hasGeneticHistory:i.completeness.has_genetic_history===true,hasReproductiveHistory:i.completeness.has_reproductive_history===true,hasParasitePreventionHistory:i.completeness.has_parasite_prevention_history===true,earliestRecordAt:i.completeness.earliest_record_at??null,latestRecordAt:i.completeness.latest_record_at??null,documentsIngested:i.completeness.documents_ingested??0,documentsInReview:i.completeness.documents_in_review??0,entitiesPendingReview:/* @__PURE__ */Object.freeze({...i.completeness.entities_pending_review??{}}),heldTotal:i.completeness.held_total??0}):null,conflicts:/* @__PURE__ */Object.freeze((i.conflicts??[]).map(e=>/* @__PURE__ */Object.freeze({conflictId:e.conflict_id,entityType:e.entity_type,field:e.field??null,severity:e.severity??"needs_review",candidates:/* @__PURE__ */Object.freeze((e.candidates??[]).map(e=>/* @__PURE__ */Object.freeze({value:e.value,docId:e.source_doc_id??e.doc_id??null,collectedAt:e.collected_at??null})))})))})}function
|
|
18
|
-
return Object.freeze({petRef:e,withheld:true,isEmpty:false,visits:/* @__PURE__ */Object.freeze([]),vaccines:/* @__PURE__ */Object.freeze([]),weights:/* @__PURE__ */Object.freeze([]),medications:/* @__PURE__ */Object.freeze([]),disclaimer:""})}function mapRecordsTimeline(petRef,e){let t=
|
|
19
|
-
return Object.freeze({petRef:r,withheld:false,isEmpty:a.length===0&&o.length===0&&l.length===0&&s.length===0,visits:/* @__PURE__ */Object.freeze(a),vaccines:/* @__PURE__ */Object.freeze(o),weights:/* @__PURE__ */Object.freeze(l),medications:/* @__PURE__ */Object.freeze(s),disclaimer:i.disclaimer??""})}function mapDocumentContributions(petRef,e){let t=
|
|
20
|
-
return Object.freeze({petRef:r,withheld:false,document:
|
|
14
|
+
return Object.freeze(r)}var Ur=/* @__PURE__ */Object.freeze(["vet","groomer","boarding"]),Gr=/* @__PURE__ */n.z.string().min(1).refine(e=>e.startsWith("https://")),Kr=/* @__PURE__ */n.z.string().nullish(),Yr=/* @__PURE__ */n.z.unknown().optional(),Qr=/* @__PURE__ */n.z.object({share_id:/* @__PURE__ */n.z.string().min(1),share_url:/* @__PURE__ */n.z.string().min(1),expires_at:Kr,audience:Yr}),Xr=/* @__PURE__ */n.z.object({shares:/* @__PURE__ */n.z.array(/* @__PURE__ */n.z.object({share_id:/* @__PURE__ */n.z.string().min(1),expires_at:Kr,created_at:Kr,view_count:/* @__PURE__ */n.z.number().int().nonnegative().nullish(),last_viewed_at:Kr,audience:Yr})).optional()}),Zr=/* @__PURE__ */n.z.object({download_url:Gr,expires_at:Kr}),Jr=/* @__PURE__ */n.z.object({share_id:/* @__PURE__ */n.z.string().min(1),expires_at:Kr,audience:Yr}),en=/* @__PURE__ */n.z.object({audience:/* @__PURE__ */n.z.string().min(1),sections:/* @__PURE__ */n.z.array(/* @__PURE__ */n.z.string()),entity_types:/* @__PURE__ */n.z.array(/* @__PURE__ */n.z.string()).nullable()}),tn=254;function isShareRecipientEmail(e){let t=e.trim();return t.length>0&&t.length<=tn&&/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(t)}var rn=e=>typeof e=="string"&&Ur.includes(e);function nn(e){return rn(e)?e:null}function mapShareAudiences(e){let t=n.z.array(en).safeParse(e);if(!t.success)/* @__PURE__ */return Object.freeze([]);let r=/* @__PURE__ */new Set,i=[];for(let e of t.data)!rn(e.audience)||r.has(e.audience)||(r.add(e.audience),i.push(/* @__PURE__ */Object.freeze({audience:e.audience,sections:/* @__PURE__ */Object.freeze([...e.sections]),entityTypes:e.entity_types===null?null:/* @__PURE__ */Object.freeze([...e.entity_types])}))/* @__PURE__ */);return Object.freeze(i)}function resolveShareUrl(e,t){let r=e.trim();if(r.length===0)return null;let n=/^[a-z][a-z0-9+.-]*:/i.test(r)?Kt(r):t!==void 0?Kt(r,t):null;return n===null||n.protocol!=="https:"?null:n.href}function mapRecordShareLink(e,t){let r=Qr.safeParse(e);if(!r.success)return null;let n=resolveShareUrl(r.data.share_url,t);return n===null?null:/* @__PURE__ */Object.freeze({shareId:r.data.share_id,shareUrl:n,expiresAt:r.data.expires_at??null,audience:nn(r.data.audience)})}function mapRecordShareList(e){let t=Xr.safeParse(e);return t.success?/* @__PURE__ */Object.freeze((t.data.shares??[]).map(e=>/* @__PURE__ */Object.freeze({shareId:e.share_id,expiresAt:e.expires_at??null,createdAt:e.created_at??null,viewCount:e.view_count??0,lastViewedAt:e.last_viewed_at??null,audience:nn(e.audience)}))):null}function mapRecordShareEmailReceipt(e){let t=Jr.safeParse(e);return t.success?/* @__PURE__ */Object.freeze({shareId:t.data.share_id,expiresAt:t.data.expires_at??null,audience:nn(t.data.audience)}):null}function mapRecordPdfLink(e){let t=Zr.safeParse(e);return t.success?/* @__PURE__ */Object.freeze({downloadUrl:t.data.download_url,expiresAt:t.data.expires_at??null}):null}var an="application/pdf",on=/* @__PURE__ */Object.freeze(["image/jpeg","image/png","image/heic","image/heif"]);var ln=/* @__PURE__ */Object.freeze({features:/* @__PURE__ */Object.freeze({}),uploadContentTypes:/* @__PURE__ */Object.freeze([an]),shareAudiences:/* @__PURE__ */Object.freeze([])}),sn=/* @__PURE__ */n.z.object({features:/* @__PURE__ */n.z.record(/* @__PURE__ */n.z.boolean()),upload_content_types:/* @__PURE__ */n.z.array(/* @__PURE__ */n.z.string()).nullish(),share_audiences:/* @__PURE__ */n.z.unknown().optional()});function dn(e){let t=sn.safeParse(e);if(!t.success)return ln;let r=t.data.upload_content_types??[],n=on.filter(e=>r.includes(e));/* @__PURE__ */
|
|
15
|
+
return Object.freeze({features:/* @__PURE__ */Object.freeze({...t.data.features}),uploadContentTypes:/* @__PURE__ */Object.freeze([an,...n]),shareAudiences:mapShareAudiences(t.data.share_audiences)})}var cn=/* @__PURE__ */n.z.object({signatures:/* @__PURE__ */n.z.array(/* @__PURE__ */n.z.object({signature_id:/* @__PURE__ */n.z.string().min(1),preview_url:/* @__PURE__ */n.z.string().min(1).refine(e=>e.startsWith("https://")),created_at:/* @__PURE__ */n.z.string().nullish()})).optional()});function mapSignatureSuggestions(e){let t=cn.safeParse(e);return t.success?/* @__PURE__ */Object.freeze((t.data.signatures??[]).map(e=>/* @__PURE__ */Object.freeze({signatureId:e.signature_id,previewUrl:e.preview_url,createdAt:e.created_at??null}))):null}function un(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 pn(e){return e.ok?e:err(un(e.error))}function fn(e){return{send:async(...t)=>pn(await e.send(...t)),authorize:t=>e.authorize(t),stream:(t,r,n)=>e.stream(t,r,n)}}var hn=/* @__PURE__ */n.z.string().nullish(),bn=/* @__PURE__ */n.z.number().nullish(),gn=/* @__PURE__ */n.z.object({at:hn,value:bn,unit:hn,qualitative_result:hn,ref_low:bn,ref_high:bn,status:hn,doc_id:hn}),mn=/* @__PURE__ */n.z.object({marker_id:/* @__PURE__ */n.z.string(),name:/* @__PURE__ */n.z.string(),loinc_code:hn,unit:hn,panel:hn,meaning:hn,latest:/* @__PURE__ */n.z.object({at:hn,value:bn,unit:hn,qualitative_result:hn,status:hn}).nullish(),trajectory:hn,points:/* @__PURE__ */n.z.array(gn).optional()}),yn=/* @__PURE__ */n.z.object({encounter_id:/* @__PURE__ */n.z.string(),date:hn,type:hn,clinic_name:hn,veterinarian:hn,doc_id:hn}),vn=/* @__PURE__ */n.z.object({note_id:/* @__PURE__ */n.z.string(),encounter_id:hn,observed_on:hn,sections:/* @__PURE__ */n.z.array(/* @__PURE__ */n.z.object({section:/* @__PURE__ */n.z.string(),text:/* @__PURE__ */n.z.string()})).optional()}),_n=/* @__PURE__ */n.z.object({exam_id:/* @__PURE__ */n.z.string(),encounter_id:hn,observed_on:hn,doc_id:hn,systems:/* @__PURE__ */n.z.record(/* @__PURE__ */n.z.object({finding_status:hn,finding:hn})).optional()}),wn=/* @__PURE__ */n.z.object({has_lab_history:/* @__PURE__ */n.z.boolean().optional(),has_vaccination_history:/* @__PURE__ */n.z.boolean().optional(),has_weight_history:/* @__PURE__ */n.z.boolean().optional(),has_vitals_history:/* @__PURE__ */n.z.boolean().optional(),has_physical_exam_history:/* @__PURE__ */n.z.boolean().optional(),has_procedure_history:/* @__PURE__ */n.z.boolean().optional(),has_genetic_history:/* @__PURE__ */n.z.boolean().optional(),has_reproductive_history:/* @__PURE__ */n.z.boolean().optional(),has_parasite_prevention_history:/* @__PURE__ */n.z.boolean().optional(),earliest_record_at:hn,latest_record_at:hn,documents_ingested:/* @__PURE__ */n.z.number().int().nonnegative().optional(),documents_in_review:/* @__PURE__ */n.z.number().int().nonnegative().optional(),entities_pending_review:/* @__PURE__ */n.z.record(/* @__PURE__ */n.z.number().int().nonnegative()).optional(),held_total:/* @__PURE__ */n.z.number().int().nonnegative().optional()}),xn=/* @__PURE__ */n.z.object({conflict_id:/* @__PURE__ */n.z.string(),entity_type:/* @__PURE__ */n.z.string(),field:hn,severity:hn,candidates:/* @__PURE__ */n.z.array(/* @__PURE__ */n.z.object({value:/* @__PURE__ */n.z.string(),source_doc_id:hn,doc_id:hn,collected_at:hn})).optional()}),zn=/* @__PURE__ */n.z.object({lab_results:/* @__PURE__ */n.z.array(mn).optional(),encounters:/* @__PURE__ */n.z.array(yn).optional(),clinician_notes:/* @__PURE__ */n.z.array(vn).optional(),physical_exams:/* @__PURE__ */n.z.array(_n).optional(),completeness:/* @__PURE__ */wn.nullish(),conflicts:/* @__PURE__ */n.z.array(xn).optional()}),jn=/* @__PURE__ */n.z.object({visits:/* @__PURE__ */n.z.array(/* @__PURE__ */n.z.object({visit_id:/* @__PURE__ */n.z.string(),visit_date:hn,veterinarian:hn,summary:hn,doc_id:hn})),vaccines:/* @__PURE__ */n.z.array(/* @__PURE__ */n.z.object({vaccine_id:/* @__PURE__ */n.z.string(),product:hn,lot:hn,administered_on:hn,expires_on:hn,doc_id:hn})),weights:/* @__PURE__ */n.z.array(/* @__PURE__ */n.z.object({weight_id:/* @__PURE__ */n.z.string(),observed_on:hn,weight_kg:bn,doc_id:hn})),medications:/* @__PURE__ */n.z.array(/* @__PURE__ */n.z.object({medication_id:/* @__PURE__ */n.z.string(),drug_name:hn,dose:hn,route:hn,frequency:hn,sig:hn,rx_number:hn,started_on:hn,stopped_on:hn,doc_id:hn})),disclaimer:/* @__PURE__ */n.z.string().optional()}),Cn=/* @__PURE__ */n.z.object({document:Tr,contributions:/* @__PURE__ */n.z.array(Or),contribution_count:/* @__PURE__ */n.z.number().int().nonnegative().optional()});function kn(e,petRef){return typeof e.pet_ref=="string"&&e.pet_ref.length>0?e.pet_ref:petRef}function Sn(e,t){/* @__PURE__ */
|
|
16
|
+
return Object.freeze({petRef:e,available:false,withheld:t,labResults:/* @__PURE__ */Object.freeze([]),encounters:/* @__PURE__ */Object.freeze([]),clinicianNotes:/* @__PURE__ */Object.freeze([]),physicalExams:/* @__PURE__ */Object.freeze([]),completeness:null,conflicts:/* @__PURE__ */Object.freeze([])})}function mapRecordDepth(petRef,e){let t=jr(e)?e:{},r=kn(t,petRef);if(t.withheld===true)return Sn(r,true);if(!["lab_results","encounters","clinician_notes","physical_exams","completeness","conflicts"].some(e=>e in t))return Sn(r,false);let n=zn.safeParse(t);if(!n.success)return Sn(r,true);let i=n.data,a=e=>/* @__PURE__ */Object.freeze({at:e.at??null,value:e.value??null,unit:e.unit??null,qualitativeResult:e.qualitative_result??null,refLow:e.ref_low??null,refHigh:e.ref_high??null,status:e.status??null,docId:e.doc_id??null});/* @__PURE__ */
|
|
17
|
+
return Object.freeze({petRef:r,available:true,withheld:false,labResults:/* @__PURE__ */Object.freeze((i.lab_results??[]).map(e=>/* @__PURE__ */Object.freeze({markerId:e.marker_id,name:e.name,loincCode:e.loinc_code??null,unit:e.unit??null,panel:e.panel??null,meaning:e.meaning??null,latest:/* @__PURE__ */Object.freeze({at:e.latest?.at??null,value:e.latest?.value??null,unit:e.latest?.unit??null,qualitativeResult:e.latest?.qualitative_result??null,status:e.latest?.status??null}),trajectory:e.trajectory??null,points:/* @__PURE__ */Object.freeze((e.points??[]).map(a))}))),encounters:/* @__PURE__ */Object.freeze((i.encounters??[]).map(e=>/* @__PURE__ */Object.freeze({encounterId:e.encounter_id,date:e.date??null,type:e.type??null,clinicName:e.clinic_name??null,veterinarian:e.veterinarian??null,docId:e.doc_id??null}))),clinicianNotes:/* @__PURE__ */Object.freeze((i.clinician_notes??[]).map(e=>/* @__PURE__ */Object.freeze({noteId:e.note_id,encounterId:e.encounter_id??null,observedOn:e.observed_on??null,sections:/* @__PURE__ */Object.freeze((e.sections??[]).map(e=>/* @__PURE__ */Object.freeze({section:e.section,text:e.text})))}))),physicalExams:/* @__PURE__ */Object.freeze((i.physical_exams??[]).map(e=>/* @__PURE__ */Object.freeze({examId:e.exam_id,encounterId:e.encounter_id??null,observedOn:e.observed_on??null,docId:e.doc_id??null,systems:/* @__PURE__ */Object.freeze(Object.entries(e.systems??{}).map(([e,t])=>/* @__PURE__ */Object.freeze({system:e,findingStatus:t.finding_status??null,finding:t.finding??null})))}))),completeness:i.completeness?/* @__PURE__ */Object.freeze({hasLabHistory:i.completeness.has_lab_history===true,hasVaccinationHistory:i.completeness.has_vaccination_history===true,hasWeightHistory:i.completeness.has_weight_history===true,hasVitalsHistory:i.completeness.has_vitals_history===true,hasPhysicalExamHistory:i.completeness.has_physical_exam_history===true,hasProcedureHistory:i.completeness.has_procedure_history===true,hasGeneticHistory:i.completeness.has_genetic_history===true,hasReproductiveHistory:i.completeness.has_reproductive_history===true,hasParasitePreventionHistory:i.completeness.has_parasite_prevention_history===true,earliestRecordAt:i.completeness.earliest_record_at??null,latestRecordAt:i.completeness.latest_record_at??null,documentsIngested:i.completeness.documents_ingested??0,documentsInReview:i.completeness.documents_in_review??0,entitiesPendingReview:/* @__PURE__ */Object.freeze({...i.completeness.entities_pending_review??{}}),heldTotal:i.completeness.held_total??0}):null,conflicts:/* @__PURE__ */Object.freeze((i.conflicts??[]).map(e=>/* @__PURE__ */Object.freeze({conflictId:e.conflict_id,entityType:e.entity_type,field:e.field??null,severity:e.severity??"needs_review",candidates:/* @__PURE__ */Object.freeze((e.candidates??[]).map(e=>/* @__PURE__ */Object.freeze({value:e.value,docId:e.source_doc_id??e.doc_id??null,collectedAt:e.collected_at??null})))})))})}function On(e){/* @__PURE__ */
|
|
18
|
+
return Object.freeze({petRef:e,withheld:true,isEmpty:false,visits:/* @__PURE__ */Object.freeze([]),vaccines:/* @__PURE__ */Object.freeze([]),weights:/* @__PURE__ */Object.freeze([]),medications:/* @__PURE__ */Object.freeze([]),disclaimer:""})}function mapRecordsTimeline(petRef,e){let t=jr(e)?e:{},r=kn(t,petRef);if(t.withheld===true)return On(r);let n=jn.safeParse(t);if(!n.success)return On(r);let i=n.data,a=i.visits.map(e=>/* @__PURE__ */Object.freeze({visitId:e.visit_id,visitDate:e.visit_date??null,veterinarian:e.veterinarian??null,summary:e.summary??null,docId:e.doc_id??null})),o=i.vaccines.map(e=>/* @__PURE__ */Object.freeze({vaccineId:e.vaccine_id,product:e.product??null,lot:e.lot??null,administeredOn:e.administered_on??null,expiresOn:e.expires_on??null,docId:e.doc_id??null})),l=i.weights.map(e=>/* @__PURE__ */Object.freeze({weightId:e.weight_id,observedOn:e.observed_on??null,weightKg:e.weight_kg??null,docId:e.doc_id??null})),s=i.medications.map(e=>/* @__PURE__ */Object.freeze({medicationId:e.medication_id,drugName:e.drug_name??null,dose:e.dose??null,route:e.route??null,frequency:e.frequency??null,sig:e.sig??null,rxNumber:e.rx_number??null,startedOn:e.started_on??null,stoppedOn:e.stopped_on??null,docId:e.doc_id??null}));/* @__PURE__ */
|
|
19
|
+
return Object.freeze({petRef:r,withheld:false,isEmpty:a.length===0&&o.length===0&&l.length===0&&s.length===0,visits:/* @__PURE__ */Object.freeze(a),vaccines:/* @__PURE__ */Object.freeze(o),weights:/* @__PURE__ */Object.freeze(l),medications:/* @__PURE__ */Object.freeze(s),disclaimer:i.disclaimer??""})}function mapDocumentContributions(petRef,e){let t=jr(e)?e:{},r=kn(t,petRef),n=()=>/* @__PURE__ */Object.freeze({petRef:r,withheld:true,document:null,contributions:/* @__PURE__ */Object.freeze([]),contributionCount:0});if(t.withheld===true)return n();let i=Cn.safeParse(t);if(!i.success)return n();let a=/* @__PURE__ */Object.freeze(i.data.contributions.map(Er));/* @__PURE__ */
|
|
20
|
+
return Object.freeze({petRef:r,withheld:false,document:Rr(i.data.document),contributions:a,contributionCount:i.data.contribution_count??a.length})}var Tn="/widget/v1/records/pets";function createRecordsDepthClient(e){let t=fn(e.funnel??createRequestFunnel({auth:e.auth,...e.errorPolicy?{errorPolicy:e.errorPolicy}:{}})),r=(e,t)=>typeof e=="string"&&e.length>0&&!zr(e)&&[...e].length<=t,n=async(e,petRef,n,i)=>{if(!r(petRef,Mr))return En();let a=await t.send(e,{method:"GET",path:n});if(!a.ok)return a;let o=i(a.value);return o.petRef===petRef?ok(o):err(makeEverfurError("internalError",{retryable:false}))},i=petRef=>`${Tn}/${encodeURIComponent(petRef)}`,a=petRef=>`${i(petRef)}/everfur_record`,o=async(e,r,n)=>{let i=await t.send(e,r,r.method==="POST"?{idempotent:false,maxAttempts:1}:void 0);if(!i.ok)return i;let a=n(i.value);return a===null?err(makeEverfurError("internalError",{retryable:false})):ok(a)},l=(e,t)=>!r(e.entityType,Cr)||!r(e.canonicalKey,kr)||e.idempotencyKey!==void 0&&!r(e.idempotencyKey,Pr)||t!==void 0&&Object.keys(t).length===0?null:{entity_type:e.entityType,canonical_key:e.canonicalKey,...t!==void 0?{corrected_fields:t}:{},...e.idempotencyKey!==void 0?{idempotency_key:e.idempotencyKey}:{}};return{getRecordDepth:petRef=>n("records.depth.record",petRef,`${i(petRef)}/record`,e=>mapRecordDepth(petRef,e)),getTimeline:petRef=>n("records.depth.timeline",petRef,`${i(petRef)}/timeline`,e=>mapRecordsTimeline(petRef,e)),getDocumentContributions(petRef,e){return r(e,64)?n("records.depth.contributions",petRef,`${i(petRef)}/documents/${encodeURIComponent(e)}/contributions`,e=>mapDocumentContributions(petRef,e)):En()},getMarkers:petRef=>n("records.depth.markers",petRef,`${i(petRef)}/markers`,e=>mapRecordMarkers(petRef,e)),createShare(petRef,t){if(!r(petRef,Mr))return En();let n=t?.audience;return n!==void 0&&!Ur.includes(n)?En():o("records.share.create",{method:"POST",path:`${a(petRef)}/share`,...n!==void 0?{body:{audience:n}}:{}},t=>mapRecordShareLink(t,e.apiBaseUrl))},emailShare(petRef,e){let t=e.recipientKind,n=typeof e.recipientEmail=="string"?e.recipientEmail.trim():"",i=t==="other"||Ur.includes(t);return!r(petRef,Mr)||!i||!isShareRecipientEmail(n)||zr(n)?En():o("records.share.email",{method:"POST",path:`${a(petRef)}/share/email`,body:{recipient_email:n,recipient_kind:t}},mapRecordShareEmailReceipt)},async readFeatures(){try{let e=await t.send("records.getFeatures",{method:"GET",path:"/widget/v1/records/features"});return e.ok?dn(e.value):ln}catch{return ln}},listShares(petRef){return r(petRef,Mr)?o("records.share.list",{method:"GET",path:`${a(petRef)}/shares`},mapRecordShareList):En()},async revokeShare(petRef,e){if(!r(petRef,Mr)||!r(e,64))return En();let n=await t.send("records.share.revoke",{method:"DELETE",path:`${a(petRef)}/shares/${encodeURIComponent(e)}`},{idempotent:false,maxAttempts:1});return n.ok?ok(void 0):n},getPdfLink(petRef){return r(petRef,Mr)?o("records.pdf.link",{method:"GET",path:`${a(petRef)}/pdf-link`},mapRecordPdfLink):En()},async editFact(petRef,e){let n=r(petRef,Mr)?l(e,e.correctedFields):null;if(n===null)return En();let i=await t.send("records.fact.edit",{method:"POST",path:`${a(petRef)}/facts/edit`,body:n},{idempotent:false,maxAttempts:1});return i.ok?ok(void 0):i},async removeFact(petRef,e){let n=r(petRef,Mr)?l(e):null;if(n===null)return En();let i=await t.send("records.fact.remove",{method:"POST",path:`${a(petRef)}/facts/remove`,body:n},{idempotent:false,maxAttempts:1});return i.ok?ok(void 0):i},listRequestDocuments(e){return r(e,64)?o("records.request.documents",{method:"GET",path:`/widget/v1/records/requests/${encodeURIComponent(e)}/documents`},Wr):En()},listAuthorizationSignatures:()=>o("records.signatures.list",{method:"GET",path:"/widget/v1/records/authorization-signatures"},mapSignatureSuggestions)}}function En(){return Promise.resolve(err(makeEverfurError("validationFailed",{retryable:false})))}var Rn=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurContext@v1"),Fn=globalThis,In=Fn[Rn]??(Fn[Rn]=e.createContext(null));In.displayName??="EverfurContext";function Dn(){let t=e.useContext(In);if(t===null)throw new At("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return t}var Bn=/* @__PURE__ */new Map,Ln=/* @__PURE__ */new Set;function Hn(petRef){return Bn.get(petRef)??0}function An(e){return Ln.add(e),()=>{Ln.delete(e)}}function Nn(petRef){let t=e.useCallback(()=>Hn(petRef),[petRef]);return e.useSyncExternalStore(An,t,t)}function useEverfurRecordsDepthClient(){let{runtime:t,userRef:userRef,scopeEpoch:r}=Dn();return e.useMemo(()=>{let{services:e}=t.registry;return createRecordsDepthClient({auth:e.authFor(userRef),...e.errorPolicy?{errorPolicy:e.errorPolicy}:{},...typeof e.apiBaseUrl=="string"?{apiBaseUrl:e.apiBaseUrl}:{}})},[t,userRef,r])}function useRecordsDepthRead(petRef,t,r,n=""){let i=useEverfurRecordsDepthClient(),{userRef:userRef}=Dn(),a=Nn(petRef),o=e.useMemo(()=>({}),[i,petRef,n,a]),[l,s]=e.useState({scope:o,value:null,error:null,loading:true}),d=e.useRef(0),c=e.useCallback(async()=>{let e=d.current+=1;if(s({scope:o,value:null,error:null,loading:true}),userRef===null){s({scope:o,value:null,error:null,loading:false});return}let r=await t(i,petRef);e===d.current&&(r.ok?s({scope:o,value:r.value,error:null,loading:false}):s({scope:o,value:null,error:r.error,loading:false}))},[i,petRef,t,o,userRef]);e.useEffect(()=>(c(),()=>{d.current+=1}),[c]);let u=l.scope===o?l:{value:null,error:null,loading:true},p=e.useCallback(()=>{c()},[c]),f=u.error===null||u.error.httpStatus!==404,h=f?u.error:null,b=u.loading?"loading":h!==null?"error":u.value===null?"empty":u.value.withheld?"populated":r(u.value)?"empty":"populated";return e.useMemo(()=>({status:b,value:u.value,error:h,available:f,refresh:p}),[b,u.value,h,f,p])}var Pn=class extends e.Component{constructor(){super(...arguments);this.state={failed:false,key:this.props.resetKey}}static getDerivedStateFromError(){return{failed:true}}static getDerivedStateFromProps(e,t){return Object.is(e.resetKey,t.key)?null:{failed:false,key:e.resetKey}}render(){return this.state.failed?this.props.fallback:this.props.children}};function RenderHost({render:e}){return e()}function HostRender({render:t,fallback:r,resetKey:n}){return e.createElement(Pn,{fallback:r,resetKey:n,children:e.createElement(RenderHost,{render:t})})}var Mn=/* @__PURE__ */Object.freeze({chat:/* @__PURE__ */Object.freeze(["chat.message.create"]),records:/* @__PURE__ */Object.freeze(["records.upload.create","records.record.read"]),recordsClinic:/* @__PURE__ */Object.freeze(["records.clinic.create"]),video:/* @__PURE__ */Object.freeze(["video.gait.execute"]),photo:/* @__PURE__ */Object.freeze(["photo.checkup.execute"]),animations:/* @__PURE__ */Object.freeze(["animations.state.read"]),televet:/* @__PURE__ */Object.freeze(["televet.visit.create"]),texting:/* @__PURE__ */Object.freeze(["sms.identity.read","sms.identity.update"]),healthPlan:/* @__PURE__ */Object.freeze(["shop.plan.read","shop.plan.update"])});function requires(e){return Mn[e]}function decideCapability(e,t,r){let n=requires(e),i=/* @__PURE__ */new Map;for(let e of t)i.set(e.resource,e);if(r?.isPending===true&&n.some(e=>!i.has(e)))return $n({name:e,enabled:false,isPending:true,limits:{}});let a=Vn(n,i);return n.filter(e=>i.get(e)?.granted!==true).length===0?$n({name:e,enabled:true,isPending:false,limits:a}):$n({name:e,enabled:false,isPending:false,limits:a,disabled:qn(n,i)})}function Vn(e,t){let r={};for(let n of e){let e=t.get(n)?.limits;if(e)for(let[t,n]of Object.entries(e)){let e=r[t];r[t]=e===void 0?n:Math.min(e,n)}}return r}function qn(e,t){for(let r of e){let e=t.get(r)?.disabled;if(e)/* @__PURE__ */
|
|
21
21
|
return Object.freeze({reason:e.reason,level:e.level,recoverable:e.recoverable})}/* @__PURE__ */
|
|
22
|
-
return Object.freeze({reason:userFacingError("accessDenied"),level:"user_entitlement",recoverable:false})}function
|
|
23
|
-
return r.jsx(t.View,{style:[o.offstate,i],accessible:true,accessibilityState:{busy:true},accessibilityLabel:`Loading ${n}`,children:/* @__PURE__ */r.jsx(t.View,{style:o.skeletonBar})})}function OffState({decision:n,style:i}){let a=useEverfurTheme(),o=e.useMemo(()=>
|
|
24
|
-
return r.jsx(t.View,{style:[o.offstate,i],accessible:true,accessibilityRole:"text",accessibilityLabel:l,children:l.length>0?/* @__PURE__ */r.jsx(Text,{style:o.offstateText,children:l}):null})}function
|
|
25
|
-
return r.jsx(Text,{style:[i.footnote,t.style],accessibilityRole:"text",testID:"records-footnote",children:
|
|
26
|
-
return r.jsx(t.View,{style:
|
|
27
|
-
return r.jsxs(t.View,{style:
|
|
22
|
+
return Object.freeze({reason:userFacingError("accessDenied"),level:"user_entitlement",recoverable:false})}function $n(e){let t={name:e.name,enabled:e.enabled,isPending:e.isPending,limits:/* @__PURE__ */Object.freeze({...e.limits})};return e.disabled!==void 0&&(t.disabled=e.disabled),/* @__PURE__ */Object.freeze(t)}function useCapability(t){let{runtime:r}=Dn(),n=r.entitlements,i=e.useSyncExternalStore(n.subscribe,n.getSnapshot,n.getSnapshot);return e.useMemo(()=>decideCapability(t,i.decisions,{isPending:i.isPending}),[t,i])}var Wn=48;function Un(e){return e.isPending?"pending":e.enabled?"enabled":"disabled"}function CapabilityGate(t){let{capability:n,children:i,renderDisabled:a,renderPending:o,style:l}=t,s=useCapability(n),d=e.useMemo(()=>Un(s),[s]);switch(d){case"enabled":return i;case"pending":return o?/* @__PURE__ */r.jsx(HostRender,{render:o,fallback:/* @__PURE__ */r.jsx(PendingSkeleton,{capability:n,style:l})}):/* @__PURE__ */r.jsx(PendingSkeleton,{capability:n,style:l});case"disabled":return a?/* @__PURE__ */r.jsx(HostRender,{render:()=>a(s),fallback:/* @__PURE__ */r.jsx(OffState,{decision:s,style:l}),resetKey:s}):/* @__PURE__ */r.jsx(OffState,{decision:s,style:l});default:return assertNever(d)}}function PendingSkeleton({capability:n,style:i}){let a=useEverfurTheme(),o=e.useMemo(()=>Gn(a),[a]);/* @__PURE__ */
|
|
23
|
+
return r.jsx(t.View,{style:[o.offstate,i],accessible:true,accessibilityState:{busy:true},accessibilityLabel:`Loading ${n}`,children:/* @__PURE__ */r.jsx(t.View,{style:o.skeletonBar})})}function OffState({decision:n,style:i}){let a=useEverfurTheme(),o=e.useMemo(()=>Gn(a),[a]),l=n.disabled?.reason??"";/* @__PURE__ */
|
|
24
|
+
return r.jsx(t.View,{style:[o.offstate,i],accessible:true,accessibilityRole:"text",accessibilityLabel:l,children:l.length>0?/* @__PURE__ */r.jsx(Text,{style:o.offstateText,children:l}):null})}function Gn(e){let{color:r,space:n,radius:i,type:a}=e;return t.StyleSheet.create({offstate:{minHeight:Wn,justifyContent:"center",paddingHorizontal:n.lg,paddingVertical:n.md,backgroundColor:r.surfaceCream,borderRadius:i.md,borderWidth:t.StyleSheet.hairlineWidth,borderColor:r.brandBorder},offstateText:{...face(e,"regular"),fontSize:a.size.body,lineHeight:Math.round(a.size.body*a.lineHeight.normal),color:r.text.muted},skeletonBar:{height:n.md,borderRadius:i.xs,backgroundColor:r.brandSofter}})}function RecordsFootnote(t){let n=useEverfurTheme(),i=e.useMemo(()=>Kn(n),[n]);/* @__PURE__ */
|
|
25
|
+
return r.jsx(Text,{style:[i.footnote,t.style],accessibilityRole:"text",testID:"records-footnote",children:He})}function Kn(e){let{color:r,space:n,type:i}=e;return t.StyleSheet.create({footnote:{...face(e,"regular"),paddingHorizontal:n.lg,paddingTop:n.md,paddingBottom:n.lg,textAlign:"center",fontSize:i.size.caption,lineHeight:Math.round(i.size.caption*i.lineHeight.normal),color:r.text.muted,backgroundColor:r.background}})}var Yn=/* @__PURE__ */Object.freeze({idle:/* @__PURE__ */Object.freeze({title:"Find your pet’s clinic",body:"Search for the clinic that holds your pet’s records. We’ll request them on your behalf once you sign the authorization.",action:null}),no_requests:/* @__PURE__ */Object.freeze({title:"No record requests yet",body:"When you request records from a clinic, you’ll be able to track every step here.",action:null}),no_records:/* @__PURE__ */Object.freeze({title:"Nothing to show just yet",body:"Once your pet’s records arrive and our team reviews them, lab trends and visits will appear here.",action:null}),rate_limited:/* @__PURE__ */Object.freeze({title:"Slow down a moment",body:"You’ve made a lot of requests just now. You can try again shortly.",action:"Try again"}),service_unavailable:/* @__PURE__ */Object.freeze({title:"Records search is temporarily down",body:"We’re working on it. Please try again in a few minutes.",action:"Try again"}),error:/* @__PURE__ */Object.freeze({title:"Couldn’t reach Everfur",body:"Check your connection and try again.",action:"Try again"})}),Qn=60;function Xn(e){return`Try again in ${e}s`}var Zn="Try again, available shortly";var Jn={pointerEvents:"none",accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants"};function ei(e){return{width:e,height:e,alignItems:"center",justifyContent:"center"}}function ti(e,t){return t??Math.max(1.5,Math.round(e/11*10)/10)}var ri={down:{rotate:"45deg",marginTop:-.4,marginLeft:0},up:{rotate:"225deg",marginTop:.4,marginLeft:0},right:{rotate:"-45deg",marginTop:0,marginLeft:-.4}};function ChevronGlyph({size:e,color:n,strokeWidth:i,direction:a}){let o=ti(e,i),l=e*.46,s=ri[a];/* @__PURE__ */
|
|
26
|
+
return r.jsx(t.View,{style:ei(e),...Jn,children:/* @__PURE__ */r.jsx(t.View,{style:{width:l,height:l,borderRightWidth:o,borderBottomWidth:o,borderColor:n,marginTop:l*s.marginTop,marginLeft:l*s.marginLeft,transform:[{rotate:s.rotate}]}})})}function SearchGlyph({size:e,color:n,strokeWidth:i}){let a=ti(e,i),o=e/24,l=16*o+a,s=11*o-l/2,d=11+8/Math.SQRT2,c=(21-d)*Math.SQRT2*o,u=(d+21)/2*o;/* @__PURE__ */
|
|
27
|
+
return r.jsxs(t.View,{style:ei(e),...Jn,children:[
|
|
28
28
|
/* @__PURE__ */r.jsx(t.View,{style:{position:"absolute",top:s,left:s,width:l,height:l,borderRadius:l,borderWidth:a,borderColor:n}}),
|
|
29
|
-
/* @__PURE__ */r.jsx(t.View,{style:{position:"absolute",top:u-a/2,left:u-(c+a)/2,width:c+a,height:a,borderRadius:a,backgroundColor:n,transform:[{rotate:"45deg"}]}})]})}var
|
|
30
|
-
return r.jsxs(t.View,{style:
|
|
29
|
+
/* @__PURE__ */r.jsx(t.View,{style:{position:"absolute",top:u-a/2,left:u-(c+a)/2,width:c+a,height:a,borderRadius:a,backgroundColor:n,transform:[{rotate:"45deg"}]}})]})}var ni={pointerEvents:"none",accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants"};function ii(e){return{width:e,height:e,alignItems:"center",justifyContent:"center"}}function ai(e){return Math.max(1.5,Math.round(e/11*10)/10)}function oi(e,t,r,n,i=0){return{position:"absolute",top:n.top-t/2,left:n.left-r/2,width:r,height:t,borderRadius:t,backgroundColor:e,transform:[{rotate:`${i}deg`}]}}function InboxGlyph({size:e,color:n}){let i=ai(e);/* @__PURE__ */
|
|
30
|
+
return r.jsxs(t.View,{style:ii(e),...ni,children:[
|
|
31
31
|
/* @__PURE__ */r.jsx(t.View,{style:{position:"absolute",top:e*.2,left:e*.06,width:e*.88,height:e*.66,borderWidth:i,borderColor:n,borderRadius:e*.12}}),
|
|
32
|
-
/* @__PURE__ */r.jsx(t.View,{style:
|
|
33
|
-
/* @__PURE__ */r.jsx(t.View,{style:
|
|
34
|
-
/* @__PURE__ */r.jsx(t.View,{style:{position:"absolute",top:e*.54-i/2,left:e*.34,width:e*.32,height:e*.14,borderBottomWidth:i,borderLeftWidth:i,borderRightWidth:i,borderColor:n,borderBottomLeftRadius:i,borderBottomRightRadius:i}})]})}function ActivityGlyph({size:e,color:n}){let i=
|
|
35
|
-
return r.jsxs(t.View,{style:
|
|
36
|
-
/* @__PURE__ */r.jsx(t.View,{style:
|
|
37
|
-
/* @__PURE__ */r.jsx(t.View,{style:
|
|
38
|
-
/* @__PURE__ */r.jsx(t.View,{style:
|
|
39
|
-
/* @__PURE__ */r.jsx(t.View,{style:
|
|
40
|
-
/* @__PURE__ */r.jsx(t.View,{style:
|
|
41
|
-
return r.jsxs(t.View,{style:
|
|
32
|
+
/* @__PURE__ */r.jsx(t.View,{style:oi(n,i,e*.26,{top:e*.54,left:e*.2})}),
|
|
33
|
+
/* @__PURE__ */r.jsx(t.View,{style:oi(n,i,e*.26,{top:e*.54,left:e*.8})}),
|
|
34
|
+
/* @__PURE__ */r.jsx(t.View,{style:{position:"absolute",top:e*.54-i/2,left:e*.34,width:e*.32,height:e*.14,borderBottomWidth:i,borderLeftWidth:i,borderRightWidth:i,borderColor:n,borderBottomLeftRadius:i,borderBottomRightRadius:i}})]})}function ActivityGlyph({size:e,color:n}){let i=ai(e),a=e*.5;/* @__PURE__ */
|
|
35
|
+
return r.jsxs(t.View,{style:ii(e),...ni,children:[
|
|
36
|
+
/* @__PURE__ */r.jsx(t.View,{style:oi(n,i,e*.24,{top:a,left:e*.12})}),
|
|
37
|
+
/* @__PURE__ */r.jsx(t.View,{style:oi(n,i,e*.42,{top:e*.32,left:e*.32},-68)}),
|
|
38
|
+
/* @__PURE__ */r.jsx(t.View,{style:oi(n,i,e*.62,{top:e*.5,left:e*.5},72)}),
|
|
39
|
+
/* @__PURE__ */r.jsx(t.View,{style:oi(n,i,e*.42,{top:e*.68,left:e*.68},-68)}),
|
|
40
|
+
/* @__PURE__ */r.jsx(t.View,{style:oi(n,i,e*.14,{top:a,left:e*.9})})]})}function ClockGlyph({size:e,color:n}){let i=ai(e),a=e/2;/* @__PURE__ */
|
|
41
|
+
return r.jsxs(t.View,{style:ii(e),...ni,children:[
|
|
42
42
|
/* @__PURE__ */r.jsx(t.View,{style:{position:"absolute",top:e*.04,left:e*.04,width:e*.92,height:e*.92,borderRadius:e,borderWidth:i,borderColor:n}}),
|
|
43
43
|
/* @__PURE__ */r.jsx(t.View,{style:{position:"absolute",top:e*.24,left:a-i/2,width:i,height:a-e*.24+i/2,borderRadius:i,backgroundColor:n}}),
|
|
44
|
-
/* @__PURE__ */r.jsx(t.View,{style:{position:"absolute",top:a-i/2,left:a-i/2,width:e*.22,height:i,borderRadius:i,backgroundColor:n}})]})}function ToolGlyph({size:e,color:n}){let i=
|
|
45
|
-
return r.jsxs(t.View,{style:
|
|
46
|
-
/* @__PURE__ */r.jsx(t.View,{style:
|
|
47
|
-
/* @__PURE__ */r.jsx(t.View,{style:{position:"absolute",top:e*.06,right:e*.06,width:a,height:a,borderRadius:a,borderWidth:i,borderColor:n,borderTopColor:"transparent",transform:[{rotate:"45deg"}]}})]})}function WifiOffGlyph({size:e,color:n}){let i=
|
|
48
|
-
return r.jsxs(t.View,{style:
|
|
44
|
+
/* @__PURE__ */r.jsx(t.View,{style:{position:"absolute",top:a-i/2,left:a-i/2,width:e*.22,height:i,borderRadius:i,backgroundColor:n}})]})}function ToolGlyph({size:e,color:n}){let i=ai(e),a=e*.42;/* @__PURE__ */
|
|
45
|
+
return r.jsxs(t.View,{style:ii(e),...ni,children:[
|
|
46
|
+
/* @__PURE__ */r.jsx(t.View,{style:oi(n,i*1.2,e*.62,{top:e*.62,left:e*.38},-45)}),
|
|
47
|
+
/* @__PURE__ */r.jsx(t.View,{style:{position:"absolute",top:e*.06,right:e*.06,width:a,height:a,borderRadius:a,borderWidth:i,borderColor:n,borderTopColor:"transparent",transform:[{rotate:"45deg"}]}})]})}function WifiOffGlyph({size:e,color:n}){let i=ai(e),a=(t,r)=>({position:"absolute",top:e*r,left:(e-t)/2,width:t,height:t,borderRadius:t,borderWidth:i,borderColor:"transparent",borderTopColor:n});/* @__PURE__ */
|
|
48
|
+
return r.jsxs(t.View,{style:ii(e),...ni,children:[
|
|
49
49
|
/* @__PURE__ */r.jsx(t.View,{style:a(e*.96,.12)}),
|
|
50
50
|
/* @__PURE__ */r.jsx(t.View,{style:a(e*.56,.38)}),
|
|
51
51
|
/* @__PURE__ */r.jsx(t.View,{style:{position:"absolute",top:e*.78,left:e/2-i,width:i*2,height:i*2,borderRadius:i,backgroundColor:n}}),
|
|
52
|
-
/* @__PURE__ */r.jsx(t.View,{style:
|
|
52
|
+
/* @__PURE__ */r.jsx(t.View,{style:oi(n,i,e*1.1,{top:e/2,left:e/2},45)})]})}function RecordsEmptyGlyph({variant:e,size:t,color:n}){switch(e){case"idle":/* @__PURE__ */
|
|
53
53
|
return r.jsx(SearchGlyph,{size:t,color:n});case"no_requests":/* @__PURE__ */
|
|
54
54
|
return r.jsx(InboxGlyph,{size:t,color:n});case"no_records":/* @__PURE__ */
|
|
55
55
|
return r.jsx(ActivityGlyph,{size:t,color:n});case"rate_limited":/* @__PURE__ */
|
|
56
56
|
return r.jsx(ClockGlyph,{size:t,color:n});case"service_unavailable":/* @__PURE__ */
|
|
57
57
|
return r.jsx(ToolGlyph,{size:t,color:n});case"error":/* @__PURE__ */
|
|
58
|
-
return r.jsx(WifiOffGlyph,{size:t,color:n});default:return null}}function RecordsEmptyState({variant:n,onAction:i,message:a,testID:o}){let l=
|
|
58
|
+
return r.jsx(WifiOffGlyph,{size:t,color:n});default:return null}}function RecordsEmptyState({variant:n,onAction:i,message:a,testID:o}){let l=li(),s=useEverfurTheme(),d=Yn[n],[c,u]=e.useState(n==="rate_limited"?Qn:0);e.useEffect(()=>{n==="rate_limited"&&u(Qn)},[n]),e.useEffect(()=>{if(c<=0)return;let e=setTimeout(()=>u(e=>Math.max(0,e-1)),1e3);return()=>clearTimeout(e)},[c]);let p=n==="rate_limited"&&c>0,f=p?Xn(c):d.action;/* @__PURE__ */
|
|
59
59
|
return r.jsxs(t.View,{style:l.container,accessibilityRole:"summary",testID:o,children:[
|
|
60
|
-
/* @__PURE__ */r.jsx(t.View,{style:l.glyph,accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants",testID:"records-empty-glyph",children:/* @__PURE__ */r.jsx(RecordsEmptyGlyph,{variant:n,size:
|
|
60
|
+
/* @__PURE__ */r.jsx(t.View,{style:l.glyph,accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants",testID:"records-empty-glyph",children:/* @__PURE__ */r.jsx(RecordsEmptyGlyph,{variant:n,size:si,color:s.color.brandInk})}),
|
|
61
61
|
/* @__PURE__ */r.jsx(Text,{style:l.title,children:d.title}),
|
|
62
|
-
/* @__PURE__ */r.jsx(Text,{style:l.body,children:a??d.body}),f!==null&&i?/* @__PURE__ */r.jsx(t.Pressable,{onPress:i,disabled:p,accessibilityRole:"button",accessibilityLabel:p?
|
|
63
|
-
return r.jsxs(t.View,{testID:"records-gate-off",style:[{minHeight:
|
|
64
|
-
/* @__PURE__ */r.jsx(t.Pressable,{onPress:n,accessibilityRole:"button",accessibilityLabel:i,testID:"records-gate-off-exit",style:{minHeight:
|
|
65
|
-
return r.jsxs(t.View,{style:{minHeight:
|
|
66
|
-
/* @__PURE__ */r.jsx(t.View,{style:[g,{alignItems:"flex-start"}],children:
|
|
67
|
-
/* @__PURE__ */r.jsx(t.View,{style:[g,{flexDirection:"row",alignItems:"center",justifyContent:"flex-end",gap:4}],children:
|
|
62
|
+
/* @__PURE__ */r.jsx(Text,{style:l.body,children:a??d.body}),f!==null&&i?/* @__PURE__ */r.jsx(t.Pressable,{onPress:i,disabled:p,accessibilityRole:"button",accessibilityLabel:p?Zn:f,accessibilityState:{disabled:p},style:[l.action,p?l.actionDisabled:null],testID:o?`${o}-action`:`records-empty-${n}-action`,children:/* @__PURE__ */r.jsx(Text,{style:l.actionLabel,children:f})}):null]})}function li(){let t=useEverfurTheme();return e.useMemo(()=>ci(t),[t])}var si=22,di=48;function ci(e){let{color:r,space:n,radius:i,type:a,slots:s}=e;return t.StyleSheet.create({container:{paddingVertical:n.xxl,paddingHorizontal:n.xl,alignItems:"center",gap:n.sm+n.xs/2},glyph:{width:di,height:di,alignItems:"center",justifyContent:"center",marginBottom:n.xs},title:{...headingFace(e,"bold"),fontSize:a.size.subtitle,lineHeight:Math.round(a.size.subtitle*a.lineHeight.snug)-1,color:r.brandInk,textAlign:"center"},body:{...face(e,"regular"),fontSize:a.size.bodyTight,lineHeight:Math.round(a.size.bodyTight*a.lineHeight.normal),color:r.text.muted,textAlign:"center",maxWidth:320},action:{marginTop:n.sm,minHeight:n.xxl+n.sm,borderRadius:i.pill,paddingHorizontal:n.lg+n.xs/2,backgroundColor:r.brand,alignItems:"center",justifyContent:"center",...o(s.primaryButton)},actionDisabled:{opacity:.5},actionLabel:{...face(e,"bold"),color:r.onPrimary,fontSize:a.size.bodyTight,lineHeight:Math.round(a.size.bodyTight*a.lineHeight.snug)-1,...l(s.primaryButton)}})}var ui=120,pi=44;function RecordsGateOffState({reason:e,onExit:n,exitLabel:i,style:a}){let{color:o,space:l,radius:s,type:d}=useEverfurTheme();/* @__PURE__ */
|
|
63
|
+
return r.jsxs(t.View,{testID:"records-gate-off",style:[{minHeight:ui,justifyContent:"center",gap:l.md,padding:l.lg,borderRadius:s.md,borderWidth:1,borderColor:o.brandBorder,backgroundColor:o.surfaceCream},a],children:[e.length>0?/* @__PURE__ */r.jsx(Text,{style:{fontSize:d.size.bodyTight,color:o.text.muted},children:e}):null,
|
|
64
|
+
/* @__PURE__ */r.jsx(t.Pressable,{onPress:n,accessibilityRole:"button",accessibilityLabel:i,testID:"records-gate-off-exit",style:{minHeight:pi,alignSelf:"flex-start",justifyContent:"center",paddingHorizontal:l.lg,borderRadius:s.pill,borderWidth:1.5,borderColor:o.brandInk},children:/* @__PURE__ */r.jsx(Text,{style:{fontSize:d.size.body,color:o.brandInk},children:i})})]})}function fi(e,t){return e===void 0?{}:{renderDisabled:n=>/* @__PURE__ */r.jsx(RecordsGateOffState,{reason:n.disabled?.reason??"",onExit:e,exitLabel:t})}}var hi=/* @__PURE__ */Object.freeze({note:"Test account: clinics are never contacted. Use records test mode to move a request forward.",clinicNotContacted:"Clinic not contacted",notEmailed:e=>`This is a test account, so no email went to ${e}.`,newClinicDirectSendNote:"This is a test account, so this clinic will not be emailed."});var NO_SUBSCRIPTION=()=>()=>{};function bi(e){return e?.livemode===false}function gi(){try{return Dn().runtime.entitlements??null}catch{return null}}function mi(){let t=gi(),r=e.useCallback(e=>t===null?NO_SUBSCRIPTION():t.subscribe(e),[t]),n=e.useCallback(()=>t===null?false:bi(t.getSnapshot()),[t]);return e.useSyncExternalStore(r,n,n)}function yi(t){let[r,n]=e.useState(null);return{shown:t!==null&&r!==t,onError:()=>n(t)}}function BrandLogo({logoUrl:e,name:n,barStyle:i,logoStyle:a,testID:o}){let l=yi(e);return e===null||!l.shown?null:/* @__PURE__ */r.jsx(t.View,{style:i,...o===void 0?{}:{testID:o},children:/* @__PURE__ */r.jsx(t.Image,{source:{uri:e},style:a,resizeMode:"contain",accessible:true,accessibilityRole:"image",accessibilityLabel:n,onError:l.onError})})}var vi="Back";function RecordsPushHeader({title:n,onBack:i,right:a,testID:l,look:s}){let d=useEverfurTheme(),c=e.useMemo(()=>s===void 0?recordsSheetLook(d):null,[s,d]),u=s??c,p=d.slots.header,f=p?.textColor??(u.dark?u.text:ue.topInk),h=he(".ph-back","width"),b=he(".ph-head","paddingLeft"),g={minWidth:h+he(".ph-back","marginLeft"),flexShrink:0};/* @__PURE__ */
|
|
65
|
+
return r.jsxs(t.View,{style:{minHeight:he(".ph-head","height"),paddingHorizontal:b,flexDirection:"row",alignItems:"center",gap:8,backgroundColor:u.paper,...o(p)},testID:l,children:[
|
|
66
|
+
/* @__PURE__ */r.jsx(t.View,{style:[g,{alignItems:"flex-start"}],children:i!==void 0?/* @__PURE__ */r.jsx(t.Pressable,{onPress:i,accessibilityRole:"button",accessibilityLabel:vi,hitSlop:6,style:{width:h,height:h,marginLeft:he(".ph-back","marginLeft"),alignItems:"center",justifyContent:"center"},testID:l!==void 0?`${l}-back`:void 0,children:/* @__PURE__ */r.jsx(t.View,{style:{transform:[{scaleX:-1}]},accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants",children:/* @__PURE__ */r.jsx(ChevronGlyph,{size:he(".ph-back svg","width"),color:f,direction:"right"})})}):null}),n.trim().length>0?/* @__PURE__ */r.jsx(Text,{accessibilityRole:"header",numberOfLines:1,tier:"heading",style:{...face(d,"bold"),flex:1,minWidth:0,textAlign:"center",fontSize:he(".ph-title","fontSize"),lineHeight:he(".ph-title","fontSize")*1.2,color:f},children:n}):/* @__PURE__ */r.jsx(t.View,{style:{flex:1},accessibilityElementsHidden:true,importantForAccessibility:"no",testID:l!==void 0?`${l}-spacer`:void 0}),
|
|
67
|
+
/* @__PURE__ */r.jsx(t.View,{style:[g,{flexDirection:"row",alignItems:"center",justifyContent:"flex-end",gap:4}],children:a})]})}var _i=28,wi=160,xi="Back";function ScreenHeader({title:e,onBack:n,right:i,testID:a,variant:o="brand"}){let l=zi(),s=useEverfurTheme(),d=s.meta.logoUrl,c=ze()==="sheet"?/* @__PURE__ */r.jsx(RecordsPushHeader,{title:e,onBack:n,right:i,testID:a}):/* @__PURE__ */r.jsxs(t.View,{style:d===null?l.row:l.rowUnderLogo,testID:a,children:[n?/* @__PURE__ */r.jsx(t.Pressable,{onPress:n,accessibilityRole:"button",accessibilityLabel:xi,hitSlop:12,style:l.back,testID:a?`${a}-back`:void 0,children:/* @__PURE__ */r.jsx(t.View,{style:l.chevron,accessibilityElementsHidden:true,importantForAccessibility:"no"})}):/* @__PURE__ */r.jsx(t.View,{style:l.back}),e.trim().length>0?/* @__PURE__ */r.jsx(Text,{style:o==="document"?l.documentTitle:l.title,accessibilityRole:"header",numberOfLines:1,children:e}):/* @__PURE__ */r.jsx(t.View,{style:l.spacer,accessibilityElementsHidden:true,importantForAccessibility:"no",testID:a?`${a}-spacer`:void 0}),
|
|
68
68
|
/* @__PURE__ */r.jsx(t.View,{style:l.right,children:i??/* @__PURE__ */r.jsx(t.View,{style:l.back})})]}),u=d===null?c:/* @__PURE__ */r.jsxs(t.View,{style:l.bar,children:[
|
|
69
69
|
/* @__PURE__ */r.jsx(BrandLogo,{logoUrl:d,name:s.meta.displayName,barStyle:l.logoBar,logoStyle:l.logo,testID:a?`${a}-logo`:void 0}),c]});/* @__PURE__ */
|
|
70
70
|
return r.jsxs(r.Fragment,{children:[u,
|
|
71
|
-
/* @__PURE__ */r.jsx(SandboxNote,{})]})}function SandboxNote(){let e=
|
|
72
|
-
return r.jsx(t.View,{style:[{width:e,height:n,borderRadius:i??l.xs,backgroundColor:o.skeleton},a],accessibilityElementsHidden:true,importantForAccessibility:"no"})}var
|
|
73
|
-
return r.jsxs(t.View,{style:n.timeline,accessible:true,accessibilityRole:"progressbar",accessibilityLabel:
|
|
74
|
-
/* @__PURE__ */r.jsx(t.View,{style:n.timelineDisclaimer,children:/* @__PURE__ */r.jsx(SkeletonBlock,{width:"100%",height:
|
|
71
|
+
/* @__PURE__ */r.jsx(SandboxNote,{})]})}function SandboxNote(){let e=mi(),n=Ve(),i=zi();return e?/* @__PURE__ */r.jsx(t.View,{style:[n.band,i.sandboxNote],accessible:true,accessibilityRole:"text",testID:"records-sandbox-note",children:/* @__PURE__ */r.jsx(Text,{style:n.bandText,children:hi.note})}):null}function zi(){let t=useEverfurTheme();return e.useMemo(()=>ji(t),[t])}function ji(e){let{color:r,space:n,type:i}=e,a=e.slots.header,s=a?.textColor??r.brandInk,d={flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:n.lg,paddingTop:n.xs,paddingBottom:n.md,gap:n.sm},c=n.xxl+n.md,u=n.md,p=n.xs/2,f=n.lg+n.xs+n.xs/2;return t.StyleSheet.create({row:{...d,...o(a)},rowUnderLogo:d,bar:{...o(a)},logoBar:{alignItems:"center",paddingTop:n.sm,paddingHorizontal:n.lg},logo:{height:_i,width:wi},back:{width:c,height:c,alignItems:"center",justifyContent:"center"},chevron:{width:u,height:u,borderLeftWidth:p,borderBottomWidth:p,borderColor:s,transform:[{rotate:"45deg"}],marginLeft:n.xs},title:{flex:1,...headingFace(e,"bold"),fontSize:i.size.heading,lineHeight:Math.round(i.size.heading*i.lineHeight.tight)+1,color:s},spacer:{flex:1},sandboxNote:{marginHorizontal:n.lg,marginBottom:n.md},documentTitle:{flex:1,textAlign:"center",...headingFace(e,"bold"),fontSize:i.size.subtitle,lineHeight:Math.round(i.size.subtitle*i.lineHeight.snug),color:r.text.primary,...l(a)},right:{flexDirection:"row",alignItems:"center",gap:n.sm+n.xs/2},listGlyph:{width:f,height:f,justifyContent:"space-evenly"},listBar:{height:p,borderRadius:p,backgroundColor:s},shareGlyph:{width:f-n.xs,height:f-n.xs},shareDot:{position:"absolute",width:n.xs+n.xs/2,height:n.xs+n.xs/2,borderRadius:n.xs,borderWidth:p,borderColor:s},shareDotTop:{right:0,top:0},shareDotLeft:{left:0,top:n.xs+n.xs/2},shareDotBottom:{right:0,bottom:0},shareStroke:{position:"absolute",left:n.xs,top:n.sm,width:n.sm+n.xs/2,height:p,backgroundColor:s},shareStrokeUp:{transform:[{rotate:"-30deg"}]},shareStrokeDown:{transform:[{rotate:"30deg"}]},sendGlyph:{width:f-n.xs,height:f-n.xs},downloadGlyph:{width:f-n.xs,height:f-n.xs,alignItems:"center"},downloadStem:{width:p,height:n.sm+n.xs/2,backgroundColor:s},downloadHead:{width:n.sm,height:n.sm,borderRightWidth:p,borderBottomWidth:p,borderColor:s,transform:[{rotate:"45deg"}],marginTop:-n.sm},downloadTray:{position:"absolute",bottom:0,left:0,right:0,height:n.xs+n.xs/2,borderLeftWidth:p,borderRightWidth:p,borderBottomWidth:p,borderColor:s}})}function SkeletonBlock({width:e,height:n,radius:i,style:a}){let{color:o,radius:l}=useEverfurTheme();/* @__PURE__ */
|
|
72
|
+
return r.jsx(t.View,{style:[{width:e,height:n,borderRadius:i??l.xs,backgroundColor:o.skeleton},a],accessibilityElementsHidden:true,importantForAccessibility:"no"})}var Ci=44,ki=24,Si=34,Oi=6;function TimelineSkeleton({testID:e}){let n=Ei();/* @__PURE__ */
|
|
73
|
+
return r.jsxs(t.View,{style:n.timeline,accessible:true,accessibilityRole:"progressbar",accessibilityLabel:nt.loadingTimeline,testID:e,children:[
|
|
74
|
+
/* @__PURE__ */r.jsx(t.View,{style:n.timelineDisclaimer,children:/* @__PURE__ */r.jsx(SkeletonBlock,{width:"100%",height:Ci,radius:12})}),Array.from({length:Oi},(e,i)=>/* @__PURE__ */r.jsxs(t.View,{children:[i>0?/* @__PURE__ */r.jsx(t.View,{style:n.timelineSeparator}):null,
|
|
75
75
|
/* @__PURE__ */r.jsxs(t.View,{style:n.timelineRow,children:[
|
|
76
|
-
/* @__PURE__ */r.jsx(SkeletonBlock,{width:
|
|
76
|
+
/* @__PURE__ */r.jsx(SkeletonBlock,{width:Si,height:Si,radius:Si/2}),
|
|
77
77
|
/* @__PURE__ */r.jsxs(t.View,{style:n.timelineBody,children:[
|
|
78
78
|
/* @__PURE__ */r.jsxs(t.View,{style:n.timelineTop,children:[
|
|
79
79
|
/* @__PURE__ */r.jsx(SkeletonBlock,{width:44,height:10,radius:5}),
|
|
80
80
|
/* @__PURE__ */r.jsx(SkeletonBlock,{width:56,height:12,radius:6})]}),
|
|
81
|
-
/* @__PURE__ */r.jsx(SkeletonBlock,{width:"70%",height:14,radius:7}),i%2===0?/* @__PURE__ */r.jsx(SkeletonBlock,{width:"45%",height:12,radius:6}):null]})]})]},i))]})}var
|
|
82
|
-
return r.jsx(DepthSurface,{state:n,style:e,onBack:t,header:/* @__PURE__ */r.jsx(ScreenHeader,{title:
|
|
83
|
-
return r.jsx(DepthSurface,{state:n,style:e,onBack:t,header:t?/* @__PURE__ */r.jsx(ScreenHeader,{title:
|
|
84
|
-
return r.jsx(DepthSurface,{state:o,style:n,onBack:i,header:/* @__PURE__ */r.jsx(ScreenHeader,{title:s,onBack:
|
|
85
|
-
return r.jsx(CapabilityGate,{capability:"records",style:n,...
|
|
86
|
-
/* @__PURE__ */r.jsx(t.View,{style:d.body,children:
|
|
87
|
-
/* @__PURE__ */r.jsx(RecordsFootnote,{})]})})}function
|
|
88
|
-
return r.jsxs(t.ScrollView,{style:n.list,contentContainerStyle:n.timelineContent,accessibilityLabel:
|
|
81
|
+
/* @__PURE__ */r.jsx(SkeletonBlock,{width:"70%",height:14,radius:7}),i%2===0?/* @__PURE__ */r.jsx(SkeletonBlock,{width:"45%",height:12,radius:6}):null]})]})]},i))]})}var Ti=62;function Ei(){let t=useEverfurTheme();return e.useMemo(()=>Ri(t),[t])}function Ri(e){let{color:r,space:n,radius:i}=e,a=t.StyleSheet.hairlineWidth;return t.StyleSheet.create({dashboard:{flex:1,paddingHorizontal:n.sm,paddingTop:n.xs,gap:n.lg,backgroundColor:r.background},inset:{paddingHorizontal:n.sm},summaryCard:{alignItems:"center",borderRadius:i.lg-n.xs,borderWidth:a,borderColor:r.brandBorder,backgroundColor:r.surface,paddingHorizontal:n.lg,paddingVertical:n.lg+n.xs,gap:n.md+n.xs/2},badges:{flexDirection:"row",gap:n.md},carouselCard:{borderRadius:i.lg-n.xs,borderWidth:a,borderColor:r.brandBorder,backgroundColor:r.surface,padding:n.lg},dots:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:n.xs+n.xs/2},centered:{alignSelf:"center"},actions:{gap:n.sm+n.xs/2},actionRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",borderRadius:i.md,borderWidth:a,borderColor:r.brandBorder,backgroundColor:r.surface,paddingHorizontal:n.lg,paddingVertical:n.lg},actionLeft:{flex:1,flexDirection:"row",alignItems:"center",gap:n.md},request:{paddingHorizontal:n.lg,paddingTop:n.xs,gap:n.lg+n.xs/2,backgroundColor:r.background},railRow:{flexDirection:"row",alignItems:"flex-start",gap:n.md},railColumn:{alignItems:"center",width:ki},connector:{marginVertical:n.xs/2},railBody:{flex:1,paddingBottom:n.lg+n.xs/2,gap:n.xs+n.xs/2},statusCard:{borderRadius:i.md,backgroundColor:r.brandSoft,padding:n.md+n.xs/2,gap:n.sm},timeline:{flex:1,backgroundColor:r.background},timelineDisclaimer:{paddingHorizontal:n.lg,paddingTop:n.xs,paddingBottom:n.md},timelineRow:{flexDirection:"row",gap:n.md,paddingHorizontal:n.lg,paddingVertical:n.md+n.xs/2},timelineBody:{flex:1,gap:n.xs-1},timelineTop:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:n.sm},timelineSeparator:{height:a,backgroundColor:r.brandBorder,marginLeft:Ti},clinics:{gap:n.md},clinicRow:{borderRadius:i.lg-n.xs/2,borderWidth:a,borderColor:r.brandBorder,backgroundColor:r.surface,paddingHorizontal:n.md+n.xs/2,paddingVertical:n.md+n.xs/2,gap:n.sm},shares:{gap:n.md,padding:n.md,borderRadius:i.md,backgroundColor:r.surfaceCream,borderWidth:a,borderColor:r.brandBorder},shareRow:{gap:n.xs+n.xs/2},record:{flex:1,paddingHorizontal:n.lg,paddingTop:n.xs,gap:n.lg+n.xs,backgroundColor:r.background},recordSection:{gap:n.sm+n.xs/2},recordHead:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"},recordCard:{borderRadius:i.lg,borderWidth:a,borderColor:r.brandBorder,backgroundColor:r.surface,paddingHorizontal:n.lg,paddingVertical:n.xs},recordRow:{gap:n.xs+n.xs/2,paddingVertical:n.md},recordDivider:{borderTopWidth:a,borderTopColor:r.borderHairlineGreen},document:{flex:1,paddingHorizontal:n.lg+n.xs,paddingTop:n.md,gap:n.lg},letterhead:{alignItems:"center",gap:n.sm,paddingBottom:n.lg,borderBottomWidth:2,borderBottomColor:r.skeleton},documentSection:{gap:n.xs},documentHead:{flexDirection:"row",alignItems:"center",gap:n.sm+n.xs/2,marginBottom:n.xs},documentRule:{flex:1,height:a,backgroundColor:r.borderHairlineGreen},documentRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:n.md,paddingVertical:n.sm+1}})}var Fi=640,Ii=600,Di=/* @__PURE__ */Object.freeze({width:0,height:0}),Bi="useWindowDimensions"in a&&typeof a.useWindowDimensions=="function"?a.useWindowDimensions:()=>Di,Li=/* @__PURE__ */Object.freeze({width:"100%",maxWidth:Fi,alignSelf:"center"});/* @__PURE__ */Object.freeze({...Li,flex:1});var Hi=/* @__PURE__ */Object.freeze({...Li,flexGrow:1,flexShrink:1});function Ai(){return Bi().width>=Ii}var Ni=/* @__PURE__ */Symbol.for("@everfur/sdk#InSdkColumn@v1"),Pi=globalThis,Mi=Pi[Ni]??(Pi[Ni]=e.createContext(false));Mi.displayName??="EverfurInSdkColumn";function SdkTabletColumn({children:n,style:i,testID:a}){let o=Ai(),l=e.useContext(Mi);return!o||l?n:/* @__PURE__ */r.jsx(t.View,{style:i===void 0?Hi:[Hi,i],testID:a??"everfur-tablet-column",children:/* @__PURE__ */r.jsx(Mi.Provider,{value:true,children:n})})}var Vi=300,qi=(e,petRef)=>e.getTimeline(petRef),$i=e=>e.isEmpty,Wi=(e,petRef)=>e.getRecordDepth(petRef),Ui=e=>!e.available||e.labResults.length+e.encounters.length+e.clinicianNotes.length+e.physicalExams.length===0,Gi=e=>e.contributions.length===0;function EverfurRecordsTimeline({petRef:petRef,style:e,onBack:t}){let n=useRecordsDepthRead(petRef,qi,$i);/* @__PURE__ */
|
|
82
|
+
return r.jsx(DepthSurface,{state:n,style:e,onBack:t,header:/* @__PURE__ */r.jsx(ScreenHeader,{title:nt.timeline,onBack:Qe(t),testID:"timeline-header"}),loading:/* @__PURE__ */r.jsx(TimelineSkeleton,{testID:"timeline-loading"}),empty:/* @__PURE__ */r.jsx(RecordsEmptyState,{variant:"no_records",testID:"timeline-empty"}),render:e=>/* @__PURE__ */r.jsx(TimelineBody,{timeline:e})})}function EverfurRecordDepth({petRef:petRef,style:e,onBack:t}){let n=useRecordsDepthRead(petRef,Wi,Ui);/* @__PURE__ */
|
|
83
|
+
return r.jsx(DepthSurface,{state:n,style:e,onBack:t,header:t?/* @__PURE__ */r.jsx(ScreenHeader,{title:Le.records,onBack:Qe(t)}):null,render:e=>/* @__PURE__ */r.jsx(DepthBody,{depth:e})})}function EverfurDocumentContributions({petRef:petRef,docId:t,style:n,onBack:i}){let a=e.useCallback((e,r)=>e.getDocumentContributions(r,t),[t]),o=useRecordsDepthRead(petRef,a,Gi,t),l=o.value?.document??null,s=l!==null?bt(l):nt.uploadedDocument;/* @__PURE__ */
|
|
84
|
+
return r.jsx(DepthSurface,{state:o,style:n,onBack:i,header:/* @__PURE__ */r.jsx(ScreenHeader,{title:s,onBack:Qe(i),testID:"contributions-header"}),empty:/* @__PURE__ */r.jsx(RecordsEmptyState,{variant:"no_records",testID:"contributions-empty"}),render:e=>/* @__PURE__ */r.jsx(ContributionsBody,{view:e})})}function DepthSurface({state:e,style:n,header:i,loading:a,empty:o,render:l,onBack:s}){let d=Yi();/* @__PURE__ */
|
|
85
|
+
return r.jsx(CapabilityGate,{capability:"records",style:n,...fi(Qe(s),xi),children:/* @__PURE__ */r.jsx(t.View,{style:[d.container,n],children:/* @__PURE__ */r.jsxs(SdkTabletColumn,{children:[i??null,
|
|
86
|
+
/* @__PURE__ */r.jsx(t.View,{style:d.body,children:Ki(e,l,d,a,o)}),
|
|
87
|
+
/* @__PURE__ */r.jsx(RecordsFootnote,{})]})})})}function Ki(e,n,i,a,o){switch(e.status){case"loading":return a??/* @__PURE__ */r.jsx(LoadingState,{styles:i});case"empty":return o??/* @__PURE__ */r.jsx(t.View,{style:i.centered,accessible:true,accessibilityRole:"summary",accessibilityLabel:Le.empty,children:/* @__PURE__ */r.jsx(t.View,{style:i.emptyGlyph})});case"error":return e.error?/* @__PURE__ */r.jsx(RecordsEmptyState,{variant:Xe(e.error),message:e.error.displayMessage,onAction:e.error.retryable?e.refresh:void 0,testID:"depth-error"}):null;case"populated":return e.value===null||e.value.withheld?null:n(e.value);default:return null}}function LoadingState({styles:n}){let[i,a]=e.useState(false);return e.useEffect(()=>{let e=setTimeout(()=>a(true),Vi);return()=>clearTimeout(e)},[]),/* @__PURE__ */r.jsx(t.View,{style:n.centered,accessible:true,accessibilityState:{busy:true},accessibilityLabel:Le.loading,children:i?/* @__PURE__ */r.jsx(t.ActivityIndicator,{}):null})}function TimelineBody({timeline:e}){let n=Yi(),i=buildTimelineRows(e);/* @__PURE__ */
|
|
88
|
+
return r.jsxs(t.ScrollView,{style:n.list,contentContainerStyle:n.timelineContent,accessibilityLabel:nt.timeline,children:[e.disclaimer.length>0?/* @__PURE__ */r.jsx(t.View,{style:n.timelineBand,accessible:true,accessibilityRole:"text",accessibilityLabel:De.important(e.disclaimer),children:/* @__PURE__ */r.jsx(Text,{style:n.timelineBandText,children:e.disclaimer})}):null,i.map((e,i)=>/* @__PURE__ */r.jsxs(t.View,{children:[i>0?/* @__PURE__ */r.jsx(t.View,{style:n.timelineSeparator}):null,
|
|
89
89
|
/* @__PURE__ */r.jsxs(t.View,{style:n.timelineRow,accessible:true,accessibilityRole:"text",accessibilityLabel:[e.kindLabel,e.date,e.title,e.detail].filter(Boolean).join(", "),testID:`records-timeline-row-${e.kind}`,children:[
|
|
90
90
|
/* @__PURE__ */r.jsx(t.View,{style:n.timelineBubble,accessibilityElementsHidden:true,importantForAccessibility:"no"}),
|
|
91
91
|
/* @__PURE__ */r.jsxs(t.View,{style:n.timelineBody,children:[
|
|
@@ -93,28 +93,28 @@ return r.jsxs(t.ScrollView,{style:n.list,contentContainerStyle:n.timelineContent
|
|
|
93
93
|
/* @__PURE__ */r.jsx(Text,{style:n.timelineKind,children:e.kindLabel}),
|
|
94
94
|
/* @__PURE__ */r.jsx(Text,{style:n.date,children:e.date})]}),
|
|
95
95
|
/* @__PURE__ */r.jsx(Text,{style:n.timelineTitle,children:e.title}),e.detail?/* @__PURE__ */r.jsx(Text,{style:n.rowDetail,children:e.detail}):null]})]})]},e.key))]})}function SectionHeader({title:e,count:t,styles:n}){/* @__PURE__ */
|
|
96
|
-
return r.jsx(Text,{style:n.heading,accessibilityRole:"header",children:`${e} (${t})`})}function DepthBody({depth:e}){let n=
|
|
97
|
-
return r.jsxs(t.ScrollView,{style:n.list,contentContainerStyle:n.listContent,accessibilityLabel:
|
|
98
|
-
/* @__PURE__ */r.jsx(SectionHeader,{title:
|
|
99
|
-
/* @__PURE__ */r.jsx(t.View,{style:n.card,children:e.labResults.map(e=>{let i=
|
|
100
|
-
return r.jsxs(t.View,{style:n.row,accessible:true,accessibilityRole:"text",accessibilityLabel:[e.name,
|
|
96
|
+
return r.jsx(Text,{style:n.heading,accessibilityRole:"header",children:`${e} (${t})`})}function DepthBody({depth:e}){let n=Yi();/* @__PURE__ */
|
|
97
|
+
return r.jsxs(t.ScrollView,{style:n.list,contentContainerStyle:n.listContent,accessibilityLabel:Le.records,children:[e.labResults.length>0?/* @__PURE__ */r.jsxs(t.View,{style:n.section,children:[
|
|
98
|
+
/* @__PURE__ */r.jsx(SectionHeader,{title:nt.labResults,count:e.labResults.length,styles:n}),
|
|
99
|
+
/* @__PURE__ */r.jsx(t.View,{style:n.card,children:e.labResults.map(e=>{let i=it(e.latest.status),a=ft(e.latest.at,e.trajectory,e.points.length);/* @__PURE__ */
|
|
100
|
+
return r.jsxs(t.View,{style:n.row,accessible:true,accessibilityRole:"text",accessibilityLabel:[e.name,pt(e.latest.value,e.latest.unit,e.latest.qualitativeResult),i.label,a].filter(Boolean).join(", "),children:[
|
|
101
101
|
/* @__PURE__ */r.jsx(Text,{style:n.rowTitle,children:e.name}),
|
|
102
|
-
/* @__PURE__ */r.jsx(Text,{style:n.rowValue,children:
|
|
102
|
+
/* @__PURE__ */r.jsx(Text,{style:n.rowValue,children:pt(e.latest.value,e.latest.unit,e.latest.qualitativeResult)}),a?/* @__PURE__ */r.jsx(Text,{style:n.rowDetail,children:a}):null,
|
|
103
103
|
/* @__PURE__ */r.jsx(Text,{style:[n.chip,i.outOfRange?n.chipCritical:n.chipNeutral],children:i.label}),e.meaning?/* @__PURE__ */r.jsx(Text,{style:n.rowDetail,children:e.meaning}):null]},e.markerId)})})]}):null,e.encounters.length>0?/* @__PURE__ */r.jsxs(t.View,{style:n.section,children:[
|
|
104
|
-
/* @__PURE__ */r.jsx(SectionHeader,{title:
|
|
105
|
-
/* @__PURE__ */r.jsx(t.View,{style:n.card,children:e.encounters.map(e=>{let i=[e.date?
|
|
104
|
+
/* @__PURE__ */r.jsx(SectionHeader,{title:nt.visits,count:e.encounters.length,styles:n}),
|
|
105
|
+
/* @__PURE__ */r.jsx(t.View,{style:n.card,children:e.encounters.map(e=>{let i=[e.date?et(e.date):null,e.clinicName,e.veterinarian].filter(e=>e&&e!=="-").join(" · ");/* @__PURE__ */
|
|
106
106
|
return r.jsxs(t.View,{style:n.row,accessible:true,accessibilityRole:"text",children:[
|
|
107
|
-
/* @__PURE__ */r.jsx(Text,{style:n.rowTitle,children:e.type?
|
|
108
|
-
/* @__PURE__ */r.jsx(SectionHeader,{title:
|
|
109
|
-
/* @__PURE__ */r.jsx(Text,{style:n.rowTitle,accessibilityRole:"header",children:e.observedOn?
|
|
110
|
-
return r.jsxs(t.View,{style:n.row,accessible:true,accessibilityRole:"text",accessibilityLabel:[
|
|
111
|
-
/* @__PURE__ */r.jsx(Text,{style:n.rowTitle,children:
|
|
107
|
+
/* @__PURE__ */r.jsx(Text,{style:n.rowTitle,children:e.type?ot(e.type):nt.visit}),i?/* @__PURE__ */r.jsx(Text,{style:n.rowDetail,children:i}):null]},e.encounterId)})})]}):null,e.physicalExams.length>0?/* @__PURE__ */r.jsxs(t.View,{style:n.section,children:[
|
|
108
|
+
/* @__PURE__ */r.jsx(SectionHeader,{title:nt.physicalExams,count:e.physicalExams.length,styles:n}),e.physicalExams.map(e=>/* @__PURE__ */r.jsxs(t.View,{style:n.card,children:[
|
|
109
|
+
/* @__PURE__ */r.jsx(Text,{style:n.rowTitle,accessibilityRole:"header",children:e.observedOn?et(e.observedOn):nt.exam}),e.systems.map(e=>{let i=e.findingStatus==="abnormal",a=i?nt.abnormal:e.findingStatus==="not_examined"?nt.notExamined:nt.normal;/* @__PURE__ */
|
|
110
|
+
return r.jsxs(t.View,{style:n.row,accessible:true,accessibilityRole:"text",accessibilityLabel:[st(e.system),a,i?e.finding:null].filter(Boolean).join(", "),children:[
|
|
111
|
+
/* @__PURE__ */r.jsx(Text,{style:n.rowTitle,children:st(e.system)}),i&&e.finding?/* @__PURE__ */r.jsx(Text,{style:n.rowDetail,children:e.finding}):null,
|
|
112
112
|
/* @__PURE__ */r.jsx(Text,{style:[n.chip,i?n.chipCaution:n.chipNeutral],children:a})]},e.system)})]},e.examId))]}):null,e.clinicianNotes.length>0?/* @__PURE__ */r.jsxs(t.View,{style:n.section,children:[
|
|
113
|
-
/* @__PURE__ */r.jsx(SectionHeader,{title:
|
|
114
|
-
/* @__PURE__ */r.jsx(Text,{style:n.rowTitle,accessibilityRole:"header",children:e.observedOn?
|
|
115
|
-
/* @__PURE__ */r.jsx(Text,{style:n.kindLabel,children:
|
|
116
|
-
/* @__PURE__ */r.jsx(Text,{style:e.text?n.rowDetail:n.rowMuted,children:e.text||
|
|
117
|
-
return r.jsxs(t.ScrollView,{style:n.list,contentContainerStyle:n.listContent,accessibilityLabel:
|
|
113
|
+
/* @__PURE__ */r.jsx(SectionHeader,{title:nt.visitNotes,count:e.clinicianNotes.length,styles:n}),e.clinicianNotes.map(e=>/* @__PURE__ */r.jsxs(t.View,{style:n.card,children:[
|
|
114
|
+
/* @__PURE__ */r.jsx(Text,{style:n.rowTitle,accessibilityRole:"header",children:e.observedOn?et(e.observedOn):nt.visitNote}),e.sections.map((e,i)=>/* @__PURE__ */r.jsxs(t.View,{style:n.row,accessible:true,accessibilityRole:"text",children:[
|
|
115
|
+
/* @__PURE__ */r.jsx(Text,{style:n.kindLabel,children:ct(e.section)}),
|
|
116
|
+
/* @__PURE__ */r.jsx(Text,{style:e.text?n.rowDetail:n.rowMuted,children:e.text||nt.notRecorded})]},`${e.section}:${i}`))]},e.noteId))]}):null]})}function ContributionsBody({view:e}){let n=Yi();/* @__PURE__ */
|
|
117
|
+
return r.jsxs(t.ScrollView,{style:n.list,contentContainerStyle:n.listContent,accessibilityLabel:Le.records,children:[e.document?.receivedAt?/* @__PURE__ */r.jsx(Text,{style:n.rowDetail,children:rt(e.document.receivedAt)}):null,
|
|
118
118
|
/* @__PURE__ */r.jsx(t.View,{style:n.card,children:e.contributions.map(e=>/* @__PURE__ */r.jsxs(t.View,{style:n.row,accessible:true,accessibilityRole:"text",children:[
|
|
119
119
|
/* @__PURE__ */r.jsx(Text,{style:n.rowTitle,children:e.label}),
|
|
120
|
-
/* @__PURE__ */r.jsx(Text,{style:n.rowValue,children:
|
|
120
|
+
/* @__PURE__ */r.jsx(Text,{style:n.rowValue,children:Ze(e.value,e.unit)}),e.observedAt?/* @__PURE__ */r.jsx(Text,{style:n.rowDetail,children:et(e.observedAt)}):null]},e.key))})]})}function Yi(){let t=useEverfurTheme(),r=qe();return e.useMemo(()=>r===null?Xi(t):Ce(Xi(t),Qi(r)),[t,r])}function Qi(e){return{container:{backgroundColor:e.ground},card:je(e,{padding:e.cardPad,gap:8}),heading:e.cardTitle,primaryButton:{...e.button,...e.buttonInk},primaryLabel:e.buttonInkLabel}}function Xi(e){let{color:r,space:n,radius:i,type:a,slots:d}=e,{size:c,lineHeight:u}=a,p=(e,t)=>Math.round(e*t),f=t.StyleSheet.hairlineWidth,h=n.xxl*3+n.xl,b=n.xxl+n.md,g=e.brightness==="dark"?r.errorRed:r.danger,m=l(s(d)),y=(t,r,n,i="regular")=>({...face(e,i),fontSize:t,lineHeight:p(t,r),color:n}),v=(e,t,r,n="regular")=>({...y(e,t,r,n),...m});return t.StyleSheet.create({container:{flex:1,minHeight:h,backgroundColor:r.background},body:{flex:1},centered:{minHeight:h,flexGrow:1,alignItems:"center",justifyContent:"center",padding:n.xl,gap:n.lg},emptyGlyph:{width:n.xxl+n.sm,height:n.xxl+n.sm,borderRadius:i.lg,backgroundColor:r.brandSoft,borderWidth:f,borderColor:r.brandBorder},errorText:{...y(c.subtitle,u.snug,g),textAlign:"center",marginBottom:n.md},primaryButton:{minHeight:b,minWidth:b,alignItems:"center",justifyContent:"center",paddingHorizontal:n.xl,paddingVertical:n.md,borderRadius:i.pill,backgroundColor:r.primary,...o(d.primaryButton)},primaryLabel:{...face(e,"bold"),color:r.onPrimary,fontSize:c.body,...l(d.primaryButton)},list:{flex:1},listContent:{padding:n.lg,gap:n.md},section:{gap:n.sm},heading:{...y(c.heading,u.snug,r.text.primary,"bold"),...headingFace(e,"bold")},card:{gap:n.sm,padding:n.md,borderRadius:i.md,backgroundColor:r.surfaceCream,borderWidth:f,borderColor:r.brandBorder,...o(s(d),f)},row:{gap:n.xs,paddingVertical:n.xs,borderBottomWidth:f,borderBottomColor:r.borderHairlineGreen},topLine:{flexDirection:"row",justifyContent:"space-between",gap:n.md},kindLabel:{...v(c.caption,u.normal,r.text.muted,"medium")},date:v(c.caption,u.normal,r.text.muted),rowTitle:{...v(c.body,u.normal,r.text.primary,"bold"),...headingFace(e,"bold")},rowValue:{...v(c.body,u.normal,r.text.primary,"medium")},rowDetail:v(c.bodyTight,u.normal,r.text.muted),rowMuted:{...v(c.bodyTight,u.normal,r.text.muted),opacity:.7},chip:{...y(c.caption,u.normal,r.text.primary),alignSelf:"flex-start",paddingHorizontal:n.sm,paddingVertical:n.xs,borderRadius:i.pill},chipNeutral:{backgroundColor:r.badgeBgNeutral},chipCaution:{backgroundColor:r.badgeBgCaution},chipCritical:{backgroundColor:r.badgeBgCritical},disclaimer:{...y(c.caption,u.normal,r.text.muted),marginTop:n.md},timelineContent:{paddingBottom:n.xxl},timelineBand:{flexDirection:"row",gap:n.sm,borderRadius:i.md-n.xs/2,padding:n.md,backgroundColor:r.brandSoft,marginHorizontal:n.lg,marginTop:n.xs,marginBottom:n.md},timelineBandText:{flex:1,...y(c.caption,u.normal,r.text.secondary)},timelineSeparator:{height:f,backgroundColor:r.brandBorder,marginLeft:Ti},timelineRow:{flexDirection:"row",gap:n.md,paddingHorizontal:n.lg,paddingVertical:n.md+n.xs/2},timelineBubble:{width:n.xxl+n.xs/2,height:n.xxl+n.xs/2,borderRadius:i.pill,backgroundColor:r.brandSoft,borderWidth:f,borderColor:r.brandBorder},timelineBody:{flex:1,gap:n.xs-1},timelineKind:{...face(e,"mono"),fontSize:c.micro,lineHeight:c.bodyTight,letterSpacing:a.letterSpacing.eyebrow/3,textTransform:"uppercase",color:r.text.secondary},timelineTitle:{...y(c.body,u.normal,r.text.primary,"medium")}})}exports.EverfurDocumentContributions=EverfurDocumentContributions;exports.EverfurRecordDepth=EverfurRecordDepth;exports.EverfurRecordsTimeline=EverfurRecordsTimeline;exports.buildTimelineRows=buildTimelineRows;exports.mapDocumentContributions=mapDocumentContributions;exports.mapRecordDepth=mapRecordDepth;exports.mapRecordsTimeline=mapRecordsTimeline;exports.useEverfurRecordsDepthClient=useEverfurRecordsDepthClient;exports.useRecordsDepthRead=useRecordsDepthRead;
|