@everfur/sdk 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. package/CHANGELOG.md +69 -4
  2. package/README.md +6 -1
  3. package/dist/{Chat-DwAC2vhB.d.ts → Chat-BZZ-Py5l.d.ts} +3 -3
  4. package/dist/{Chat-DPUD6dnc.d.cts → Chat-Dq4fffIO.d.cts} +3 -3
  5. package/dist/{DepthViews-DNEM96Se.d.ts → DepthViews-BG3E25MD.d.ts} +1 -1
  6. package/dist/{DepthViews-DP0R-DhB.d.cts → DepthViews-B_hIypI6.d.cts} +1 -1
  7. package/dist/{DepthViews-DbFhR4Du.d.cts → DepthViews-CL75jyRA.d.cts} +1 -1
  8. package/dist/{DepthViews-D_3hl4xk.d.ts → DepthViews-CkYri51q.d.ts} +1 -1
  9. package/dist/animations/index.cjs +1 -1
  10. package/dist/animations/index.d.cts +3 -3
  11. package/dist/animations/index.d.ts +3 -3
  12. package/dist/animations/index.js +1 -1
  13. package/dist/{attachments-CQgFrEQ7.d.cts → attachments-BorG422I.d.cts} +2 -2
  14. package/dist/{attachments-5NeobOCd.d.ts → attachments-BrUWQYNK.d.ts} +5 -4
  15. package/dist/{attachments-D8T5re7e.d.cts → attachments-D_SECjr1.d.cts} +5 -4
  16. package/dist/{attachments-Bw3iMQgu.d.ts → attachments-DpldrvIW.d.ts} +2 -2
  17. package/dist/bookingCopy-CqtDYvCR.d.ts +732 -0
  18. package/dist/bookingCopy-SREvkG19.d.cts +732 -0
  19. package/dist/{entitlementRepository-DSbzuyAW.d.ts → branding-CsRdeNwK.d.cts} +1 -133
  20. package/dist/{entitlementRepository-DKdXFgTo.d.cts → branding-CsRdeNwK.d.ts} +1 -133
  21. package/dist/callCopy-DoQKG3-L.d.cts +40 -0
  22. package/dist/callCopy-DoQKG3-L.d.ts +40 -0
  23. package/dist/casesRepository-DwtZVsbj.d.cts +51 -0
  24. package/dist/casesRepository-v6QczS9N.d.ts +51 -0
  25. package/dist/chat/index.cjs +1 -1
  26. package/dist/chat/index.d.cts +9 -8
  27. package/dist/chat/index.d.ts +9 -8
  28. package/dist/chat/index.js +1 -1
  29. package/dist/client/index.cjs +5 -5
  30. package/dist/client/index.d.cts +10 -8
  31. package/dist/client/index.d.ts +10 -8
  32. package/dist/client/index.js +5 -5
  33. package/dist/{config-CzTZGlfF.d.cts → config--Wu1Umhd.d.cts} +2 -2
  34. package/dist/{config-DW60uRb9.d.ts → config-C7eb_IMD.d.ts} +2 -2
  35. package/dist/consent/index.cjs +1 -1
  36. package/dist/consent/index.d.cts +5 -5
  37. package/dist/consent/index.d.ts +5 -5
  38. package/dist/consent/index.js +1 -1
  39. package/dist/{context-XvTzq1tE.d.cts → context-CL3lyuy1.d.cts} +6 -6
  40. package/dist/{context-DXhqHlPU.d.ts → context-CahAEha8.d.ts} +6 -6
  41. package/dist/{copy-Mjoo91aS.d.ts → copy-DdVFDL01.d.ts} +2 -2
  42. package/dist/{copy-bKDNigLb.d.cts → copy-UeUJVk8X.d.cts} +2 -2
  43. package/dist/core/index.cjs +7 -7
  44. package/dist/core/index.d.cts +118 -29
  45. package/dist/core/index.d.ts +118 -29
  46. package/dist/core/index.js +7 -7
  47. package/dist/{depth-CErXCU8J.d.cts → depth-D5HwcvKC.d.cts} +34 -3
  48. package/dist/{depth-DjDcJ6kH.d.ts → depth-DvPwPuT_.d.ts} +34 -3
  49. package/dist/entitlementRepository-B7egEdW6.d.ts +43 -0
  50. package/dist/entitlementRepository-BpJ7tiwl.d.cts +43 -0
  51. package/dist/{identity-DI4eVx9S.d.cts → identity-C2-08BZW.d.cts} +2 -2
  52. package/dist/{identity-BMx2SUOM.d.ts → identity-CEi9GRFZ.d.ts} +2 -2
  53. package/dist/index.cjs +6 -6
  54. package/dist/index.d.cts +17 -16
  55. package/dist/index.d.ts +17 -16
  56. package/dist/index.js +6 -6
  57. package/dist/notifications/index.cjs +2 -2
  58. package/dist/notifications/index.d.cts +2 -2
  59. package/dist/notifications/index.d.ts +2 -2
  60. package/dist/notifications/index.js +2 -2
  61. package/dist/optionalModule-DbJmsq5f.d.cts +21 -0
  62. package/dist/optionalModule-DbJmsq5f.d.ts +21 -0
  63. package/dist/{pets-CtQdRpWo.d.ts → pets-DJv2sj2H.d.ts} +1 -1
  64. package/dist/{pets-aB8q0JyX.d.cts → pets-JVCXgRgR.d.cts} +1 -1
  65. package/dist/{casesRepository-DHwtGRYY.d.cts → petsRepository-B_gKbAzJ.d.cts} +2 -48
  66. package/dist/{casesRepository-ClLv6qMl.d.ts → petsRepository-Bk6GDwLs.d.ts} +2 -48
  67. package/dist/photo/index.cjs +1 -1
  68. package/dist/photo/index.js +1 -1
  69. package/dist/{ports-DEBzEhbp.d.cts → ports-BY2ph0_y.d.cts} +5 -15
  70. package/dist/{ports-DMolTRzU.d.ts → ports-D7YW8qz9.d.ts} +5 -15
  71. package/dist/records/depth/index.cjs +2 -2
  72. package/dist/records/depth/index.d.cts +7 -7
  73. package/dist/records/depth/index.d.ts +7 -7
  74. package/dist/records/depth/index.js +2 -2
  75. package/dist/records/index.cjs +3 -3
  76. package/dist/records/index.d.cts +9 -9
  77. package/dist/records/index.d.ts +9 -9
  78. package/dist/records/index.js +3 -3
  79. package/dist/{requestFunnel-L-BQfi0z.d.cts → requestFunnel-BjDpqqvm.d.cts} +25 -2
  80. package/dist/{requestFunnel-CjW7uDuA.d.ts → requestFunnel-DFMGcluw.d.ts} +25 -2
  81. package/dist/{runtime-B8s-_hv8.d.cts → runtimeTypes-gZEJu-da.d.cts} +9 -99
  82. package/dist/{runtime-BR9ysG0J.d.ts → runtimeTypes-w5KqBMcs.d.ts} +9 -99
  83. package/dist/server/events/index.cjs +1 -1
  84. package/dist/server/events/index.d.cts +2 -2
  85. package/dist/server/events/index.d.ts +2 -2
  86. package/dist/server/events/index.js +1 -1
  87. package/dist/server/index.cjs +1 -1
  88. package/dist/server/index.d.cts +3 -3
  89. package/dist/server/index.d.ts +3 -3
  90. package/dist/server/index.js +1 -1
  91. package/dist/televet/booking/index.cjs +1 -0
  92. package/dist/televet/booking/index.d.cts +294 -0
  93. package/dist/televet/booking/index.d.ts +294 -0
  94. package/dist/televet/booking/index.js +1 -0
  95. package/dist/televet/call/index.cjs +1 -0
  96. package/dist/televet/call/index.d.cts +141 -0
  97. package/dist/televet/call/index.d.ts +141 -0
  98. package/dist/televet/call/index.js +1 -0
  99. package/dist/televet/index.cjs +1 -1
  100. package/dist/televet/index.d.cts +87 -5
  101. package/dist/televet/index.d.ts +87 -5
  102. package/dist/televet/index.js +1 -1
  103. package/dist/testing/index.cjs +3 -3
  104. package/dist/testing/index.d.cts +2 -2
  105. package/dist/testing/index.d.ts +2 -2
  106. package/dist/testing/index.js +3 -3
  107. package/dist/testing/rn/index.cjs +1 -1
  108. package/dist/testing/rn/index.d.cts +9 -8
  109. package/dist/testing/rn/index.d.ts +9 -8
  110. package/dist/testing/rn/index.js +1 -1
  111. package/dist/testing/web/index.cjs +1 -1
  112. package/dist/testing/web/index.d.cts +9 -8
  113. package/dist/testing/web/index.d.ts +9 -8
  114. package/dist/testing/web/index.js +1 -1
  115. package/dist/{timelineRows-DZed6dAM.d.ts → timelineRows-C15jxFFH.d.ts} +1 -1
  116. package/dist/{timelineRows-CaohZzXS.d.cts → timelineRows-odO8g9r2.d.cts} +1 -1
  117. package/dist/typeStyle-CKqVYD6L.d.cts +111 -0
  118. package/dist/typeStyle-DmoyacDG.d.ts +111 -0
  119. package/dist/{useRecordsDepth-BHBzJ76R.d.cts → useRecordsDepth-C6rjEaLn.d.cts} +1 -1
  120. package/dist/{useRecordsDepth-BU-OhzH6.d.ts → useRecordsDepth-crhBllQK.d.ts} +1 -1
  121. package/dist/video/index.cjs +1 -1
  122. package/dist/video/index.js +1 -1
  123. package/dist/{view-DtSPYpKa.d.ts → view-Bxwxp4xD.d.ts} +2 -2
  124. package/dist/{view-C3qPIXGX.d.cts → view-DyitEO0m.d.cts} +2 -2
  125. package/dist/web/consent/index.cjs +1 -1
  126. package/dist/web/consent/index.d.cts +5 -5
  127. package/dist/web/consent/index.d.ts +5 -5
  128. package/dist/web/consent/index.js +1 -1
  129. package/dist/web/index.cjs +7 -7
  130. package/dist/web/index.d.cts +18 -17
  131. package/dist/web/index.d.ts +18 -17
  132. package/dist/web/index.js +7 -7
  133. package/dist/web/notifications/index.cjs +2 -2
  134. package/dist/web/notifications/index.d.cts +3 -3
  135. package/dist/web/notifications/index.d.ts +3 -3
  136. package/dist/web/notifications/index.js +2 -2
  137. package/dist/web/records/depth/index.cjs +2 -2
  138. package/dist/web/records/depth/index.d.cts +7 -7
  139. package/dist/web/records/depth/index.d.ts +7 -7
  140. package/dist/web/records/depth/index.js +2 -2
  141. package/dist/web/records/index.cjs +3 -3
  142. package/dist/web/records/index.d.cts +102 -11
  143. package/dist/web/records/index.d.ts +102 -11
  144. package/dist/web/records/index.js +3 -3
  145. package/dist/web/televet/booking/index.cjs +1 -0
  146. package/dist/web/televet/booking/index.d.cts +349 -0
  147. package/dist/web/televet/booking/index.d.ts +349 -0
  148. package/dist/web/televet/booking/index.js +1 -0
  149. package/dist/web/televet/call/index.cjs +1 -0
  150. package/dist/web/televet/call/index.d.cts +142 -0
  151. package/dist/web/televet/call/index.d.ts +142 -0
  152. package/dist/web/televet/call/index.js +1 -0
  153. package/dist/web/televet/index.cjs +1 -1
  154. package/dist/web/televet/index.d.cts +90 -4
  155. package/dist/web/televet/index.d.ts +90 -4
  156. package/dist/web/televet/index.js +1 -1
  157. package/package.json +72 -4
  158. package/televet/booking/package.json +8 -0
  159. package/televet/call/package.json +8 -0
  160. package/web/televet/booking/native-blocked.cjs +12 -0
  161. package/web/televet/booking/package.json +8 -0
  162. package/web/televet/call/native-blocked.cjs +12 -0
  163. package/web/televet/call/package.json +8 -0
  164. package/dist/typeStyle-0TydiZ1w.d.cts +0 -19
  165. package/dist/typeStyle-CWMsoe6b.d.ts +0 -19
@@ -1,2 +1,2 @@
1
- 'use strict';var react=require('react'),reactNative=require('react-native'),zod=require('zod'),jsxRuntime=require('react/jsx-runtime');var Ar=Object.defineProperty;var o=(e,r)=>Ar(e,"name",{value:r,configurable:true});function ke(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let r of Object.keys(e))ke(e[r]);}return e}o(ke,"deepFreeze");var jr=Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3}),at={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},st={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},it={nano:8,small:9,micro:10,tiny:11,caption:12,bodyTight:13,body:14,subtitle:16,heading:18,verdict:24},zr={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},Nr={regular:"400",medium:"500",bold:"700"},Lr={eyebrow:1,monoWide:.9,headerBrand:-0.42,tight:-0.35},Mr=0,ue="System",pe="monospace",Vr=["content","heading","control","compact","badge"];function Br(e){let r={};for(let t of Vr)r[t]=e;return r}o(Br,"authoredTierSizes");function lt(){return {family:ue,mono:pe,fontUrl:null,families:{regular:ue,medium:ue,bold:ue,mono:pe,monoMedium:pe,monoBold:pe},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:it,tierSizes:Br(it),lineHeight:zr,weight:Nr,letterSpacing:Lr,scale:1,maxScale:Mr,scaleCaps:jr}}o(lt,"baseType");var dt={},Se=Object.freeze({standard:Object.freeze([.2,0,0,1]),emphasized:Object.freeze([.2,.8,.2,1]),exit:Object.freeze([.4,0,1,1])});function Te(e){return `cubic-bezier(${e.join(", ")})`}o(Te,"cssCubicBezier");var ct={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:Te(Se.standard),emphasized:Te(Se.emphasized),exit:Te(Se.exit)},reducedMotion:false},qr={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:"#FDFBF8",surfaceSubtle:"#EFE9E3",background:"#FFFFFF",borderRingCream:"#D8D2C8",chatGround:"#FFFFFF",composerFill:"#FDFBF8",composerBorder:"rgba(16,70,46,0.75)",shadow:"#0B3421",text:{primary:"#111111",secondary:"#0E462E",muted:"#6E6660",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:"#B91C1C",errorRed:"#FF1B00",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(185,28,28,0.12)",badgeBgNeutral:"rgba(110,102,96,0.12)",bubbleUser:"#10462E",bubbleAssistant:"#FFFFFF",skeleton:"#EFE9E3",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.10)",checkupCardConcernBg:"rgba(239,167,0,0.10)"},ut=ke({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:qr,space:at,radius:st,type:lt(),motion:ct,slots:dt}),Ur={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:"#9A938C",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",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",skeleton:"#23272C",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.16)",checkupCardConcernBg:"rgba(239,167,0,0.16)"};ke({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:Ur,space:at,radius:st,type:lt(),motion:ct,slots:dt});var pt=Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),yt=globalThis,Oe=yt[pt]??(yt[pt]=react.createContext(ut));Oe.displayName??="EverfurThemeContext";function w(){return react.useContext(Oe)}o(w,"useEverfurTheme");function Kr(e,r){let t=e.scaleCaps[r];return t>0?t:void 0}o(Kr,"tierMultiplier");function g({tier:e="content",...r}){let{type:t}=w(),n=Kr(t,e);return react.createElement(reactNative.Text,n===void 0?r:{maxFontSizeMultiplier:n,...r})}o(g,"Text");react.forwardRef(o(function(r,t){return react.createElement(reactNative.TextInput,{...r,...t===null?{}:{ref:t}})},"TextInput"));function Q(e,r){if(e===void 0)return {};let t={};return e.backgroundColor!==void 0&&(t.backgroundColor=e.backgroundColor),e.borderColor!==void 0&&(t.borderColor=e.borderColor,t.borderWidth=r??1),e.borderRadius!==void 0&&(t.borderRadius=e.borderRadius),t}o(Q,"slotBox");function J(e){return e?.textColor===void 0?{}:{color:e.textColor}}o(J,"slotText");var Xr=Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});function S(e,r){let t=e.type,n=t.families[r];return r==="mono"||t.namedFaces[r]?{fontFamily:n}:{fontFamily:n,fontWeight:t.weight[Xr[r]]}}o(S,"face");function mt(e){let r=globalThis.console;try{r?.error?.("[everfur] A host callback threw; the SDK ignored it.",e);}catch{}}o(mt,"reportHostFailure");function Qr(e){return (typeof e=="object"||typeof e=="function")&&e!==null&&typeof e.then=="function"}o(Qr,"isThenable");function Jr(e,...r){if(typeof e=="function")try{let t=e(...r);return Qr(t)&&Promise.resolve(t).then(void 0,mt),t}catch(t){mt(t);return}}o(Jr,"callHost");var gt=new WeakMap;function Z(e){if(typeof e!="function")return;let r=gt.get(e);if(r!==void 0)return r;let t=o((...n)=>{Jr(e,...n);},"guarded");return gt.set(e,t),t}o(Z,"guardHost");var U=Object.freeze({loading:"Loading",empty:"No records yet",upload:"Upload records",consentRequired:"Consent required",allow:"Allow",sessionRequired:"Sign in required",recordUnavailable:"Record unavailable",retry:"Try again",records:"Records",beingReviewed:"being reviewed"});var Zr="your pet";function L(e){let r=e?.trim()??"";return r.length>0?r:Zr}o(L,"petNameOr");var bt=Object.freeze({title:"Health records",openTimeline:"Open timeline",loading:"Loading health records",lead:o(e=>`${L(e)}\u2019s lab trends`,"lead"),retryMarkers:"Retry loading lab trends",viewFullRecord:"View full medical record",viewTimeline:"View full timeline",important:o(e=>`Important: ${e}`,"important")});Object.freeze({title:"Marker Summary",marker:"Marker",markers:"Markers",outOfRange:"OUT OF RANGE",inRange:"IN RANGE",noRange:"NO RANGE",subtitle:"Summary of your pet\u2019s biomarkers",ask:"Ask about these markers",askA11y:"Ask Everfur about these markers",a11y:o((e,r,t,n)=>`Marker summary: ${e} ${e===1?"marker":"markers"}, ${r} in range, ${t} out of range${n>0?`, ${n} without a range`:""}.`,"a11y")});Object.freeze({counter:o((e,r)=>`${e+1} of ${r}`,"counter"),a11y:o((e,r,t)=>e!==null?`${e}, marker ${r+1} of ${t}. Swipe left or right to see more markers.`:`Marker ${r+1} of ${t}`,"a11y")});Object.freeze({tapHint:"Tap a point to see where it came from.",singleHint:"One reading so far: we\u2019ll plot a trend as more come in.",empty:"No readings for this marker yet.",ask:"Ask about this marker",askA11y:o(e=>`Ask Everfur about ${e}`,"askA11y"),status:o(e=>`Status: ${e}`,"status"),latestA11y:o((e,r,t)=>`Latest reading ${e}, ${r}, collected ${t}`,"latestA11y"),readingsA11y:o(e=>`${e} readings, oldest to newest`,"readingsA11y")});Object.freeze({title:o(e=>`${L(e)}\u2019s records request`,"title"),body:o(e=>`We\u2019re requesting ${L(e)}\u2019s records from your vet. This usually takes a few days; we\u2019ll show lab trends here as soon as they arrive.`,"body"),a11y:o(e=>`Records request in progress for ${L(e)}.`,"a11y"),openA11y:o((e,r)=>`Open ${L(e)}\u2019s records request. ${r}`,"openA11y"),ask:"Ask about this request",askA11y:"Ask Everfur about this records request"});Object.freeze({title:o(e=>`Add ${L(e)}\u2019s records`,"title"),body:"Records can come from more than one clinic over a lifetime.",requestFromClinic:"Request from a clinic",requestFromClinicA11y:o(e=>`Request ${L(e)}\u2019s records from a clinic`,"requestFromClinicA11y"),uploadDocument:"Upload a document",uploadDocumentA11y:o(e=>`Upload one of ${L(e)}\u2019s records`,"uploadDocumentA11y")});function ht(e){return e?.httpStatus===429?"rate_limited":e?.httpStatus===502?"service_unavailable":"error"}o(ht,"recordsEmptyVariantForError");function vt(e,r){return e===null?"":r?`${e} ${r}`:e}o(vt,"formatEntityValue");var Rt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function O(e){if(!e)return "-";let r=/^(\d{4})-(\d{2})-(\d{2})/.exec(e);if(r!==null){let a=Rt[Number(r[2])-1];return a===void 0?"-":`${a} ${Number(r[3])}, ${r[1]}`}let t=Date.parse(e);if(Number.isNaN(t))return "-";let n=new Date(t);return `${Rt[n.getUTCMonth()]} ${n.getUTCDate()}, ${n.getUTCFullYear()}`}o(O,"formatRecordsDate");var b=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:o(e=>`Measured ${e}`,"measured"),uploadedDocument:"Uploaded document",kind:Object.freeze({visit:"Visit",vaccine:"Vaccine",weight:"Weight",medication:"Medication"}),clinicVisit:"Clinic visit",doctor:o(e=>`Dr. ${e}`,"doctor"),lot:o(e=>`Lot ${e}`,"lot"),expires:o(e=>`Expires ${e}`,"expires")});function wt(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}}}o(wt,"markerStatusLabel");function en(e,r){return r<2?null:`${e==="flat"?"Holding steady":`Trending ${e==="down"?"down":e==="up"?"up":"steady"}`} over ${r} visits`}o(en,"trajectoryLabel");function ye(e){let r=e.replace(/_/g," ").trim();return r.length===0?e:r.charAt(0).toUpperCase()+r.slice(1)}o(ye,"humanize");var _t=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 Fe(e){return Object.prototype.hasOwnProperty.call(_t,e)?_t[e]:ye(e)}o(Fe,"bodySystemLabel");var Et=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 xt(e){return Object.prototype.hasOwnProperty.call(Et,e)?Et[e]:ye(e)}o(xt,"soapSectionLabel");function Ct(e){return e===null||!Number.isFinite(e)?"-":`${e.toFixed(3).replace(/\.?0+$/,"")} kg`}o(Ct,"formatWeightKg");function Ie(e,r,t){if((e===null||!Number.isFinite(e))&&t)return t;if(e===null||!Number.isFinite(e))return "-";let n=e.toFixed(3).replace(/\.?0+$/,"");return r?`${n} ${r}`:n}o(Ie,"formatMarkerReading");function St(e,r,t){let n=en(r,t);return e?`${b.measured(O(e))}${n?` \xB7 ${n}`:""}`:n}o(St,"labDetailLine");var fe=Object.freeze({visit:0,vaccine:1,weight:2,medication:3});function Tt(e){if(!e)return null;let r=Date.parse(e);return Number.isNaN(r)?null:r}o(Tt,"toMillis");function Pe(e){let r=[...e.visits.map((t,n)=>({key:`visit-${n}-${t.visitId}`,kind:"visit",kindLabel:b.kind.visit,at:t.visitDate,date:O(t.visitDate),title:t.summary??b.clinicVisit,detail:t.veterinarian?b.doctor(t.veterinarian):null,docId:t.docId})),...e.vaccines.map((t,n)=>{let a=[];return t.lot&&a.push(b.lot(t.lot)),t.expiresOn&&a.push(b.expires(O(t.expiresOn))),{key:`vaccine-${n}-${t.vaccineId}`,kind:"vaccine",kindLabel:b.kind.vaccine,at:t.administeredOn,date:O(t.administeredOn),title:t.product||b.kind.vaccine,detail:a.length?a.join(" \xB7 "):null,docId:t.docId}}),...e.weights.map((t,n)=>({key:`weight-${n}-${t.weightId}`,kind:"weight",kindLabel:b.kind.weight,at:t.observedOn,date:O(t.observedOn),title:Ct(t.weightKg),detail:null,docId:t.docId})),...e.medications.map((t,n)=>{let a=[t.dose,t.route,t.frequency].filter(s=>!!s);return {key:`medication-${n}-${t.medicationId}`,kind:"medication",kindLabel:b.kind.medication,at:t.startedOn,date:O(t.startedOn),title:t.drugName||b.kind.medication,detail:a.length?a.join(" \xB7 "):null,docId:t.docId}})];return Object.freeze(r.sort((t,n)=>{let a=Tt(t.at),s=Tt(n.at);return a===null&&s===null?fe[t.kind]-fe[n.kind]:a===null?1:s===null?-1:s!==a?s-a:fe[t.kind]-fe[n.kind]}))}o(Pe,"buildTimelineRows");var De=Object.freeze([Object.freeze({wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"AuthorizationException",envelope:"http_envelope",httpStatus:401,retryable:false}),Object.freeze({wireCode:"ConflictException",envelope:"http_envelope",httpStatus:409,retryable:true}),Object.freeze({wireCode:"DAILY_QUOTA_EXCEEDED",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"FILE_TOO_LARGE",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"IDEMPOTENCY_KEY_IN_FLIGHT",envelope:"http_envelope",httpStatus:409,retryable:true}),Object.freeze({wireCode:"IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"INVALID_CONTENT_TYPE",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"InternalFailureException",envelope:"http_envelope",httpStatus:500,retryable:true}),Object.freeze({wireCode:"MethodNotAllowedException",envelope:"http_envelope",httpStatus:405,retryable:false}),Object.freeze({wireCode:"NotImplementedException",envelope:"http_envelope",httpStatus:501,retryable:false}),Object.freeze({wireCode:"PaymentRequiredException",envelope:"http_envelope",httpStatus:402,retryable:false}),Object.freeze({wireCode:"ResourceNotFoundException",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"ServiceUnavailableException",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"TIER_UPGRADE_REQUIRED",envelope:"http_envelope",httpStatus:402,retryable:false}),Object.freeze({wireCode:"ThrottlingException",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"ValidationException",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"accessDenied",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"access_denied",envelope:"oauth_error",httpStatus:302,retryable:false}),Object.freeze({wireCode:"attachment_unreadable",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"authExpired",envelope:"http_envelope",httpStatus:401,retryable:true}),Object.freeze({wireCode:"authRejected",envelope:"http_envelope",httpStatus:401,retryable:false}),Object.freeze({wireCode:"consent_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"consent_required",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"consent_scope_wrong_route",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"device_cipher_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"email_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"event_cursor_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_payload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_type_not_available",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_type_unknown",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_required",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_reused",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"insufficientCapability",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"insufficient_scope",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"internal_error",envelope:"sse_frame",httpStatus:200,retryable:false}),Object.freeze({wireCode:"invalidRequest",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_client",envelope:"oauth_error",httpStatus:401,retryable:false}),Object.freeze({wireCode:"invalid_client_metadata",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_grant",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_redirect_uri",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_request",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_scope",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_target",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"mcp_connection_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"mcp_request_conflict",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"mcp_request_gone",envelope:"http_envelope",httpStatus:410,retryable:false}),Object.freeze({wireCode:"mcp_request_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"not_found",envelope:"sse_frame",httpStatus:200,retryable:false}),Object.freeze({wireCode:"partner_visit_link_conflict",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"partner_visit_owner_only",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"partner_visit_pet_already_mapped",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"payload_too_large",envelope:"http_envelope",httpStatus:413,retryable:false}),Object.freeze({wireCode:"petRefInUse",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"pet_health_list_removals_unconfirmed",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"pet_health_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"pet_not_registered",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"provider_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"rateLimited",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"record_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"record_subject_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"record_upload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"records_consent_required",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"sandbox_only",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"session_required",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"share_limit_reached",envelope:"http_envelope",httpStatus:429,retryable:false}),Object.freeze({wireCode:"slow_down",envelope:"oauth_error",httpStatus:429,retryable:true}),Object.freeze({wireCode:"species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"tenant_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"tenant_has_no_capabilities",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"tenant_resource_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"tenant_surface_not_enabled",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"timeout",envelope:"sse_frame",httpStatus:200,retryable:true}),Object.freeze({wireCode:"token_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"unavailable",envelope:"sse_frame",httpStatus:200,retryable:true}),Object.freeze({wireCode:"unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"unsupported_grant_type",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"unsupported_response_type",envelope:"oauth_error",httpStatus:302,retryable:false}),Object.freeze({wireCode:"verify_mint_rate_limited",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"verify_mint_refused",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"verify_mint_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"verify_user_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"webhook_endpoint_update_empty",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"webhook_endpoint_update_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false})]);Object.freeze(De.map(e=>e.wireCode));var tn=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",accessDenied:"accessDenied",invalidRequest:"sdkUpdateRequired",authRejected:"authRejected",rateLimited:"rateLimited",insufficientCapability:"accessDenied",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"}),Ot=Object.freeze(De.map(e=>Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:tn[e.wireCode]}))),rn=new Map(Ot.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),nn=Object.freeze(["http_envelope",...[...new Set(Ot.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function me(e,r){if(typeof e!="string")return;let t=e.trim().toUpperCase();if(t.length!==0)for(let n of [r??"http_envelope",...nn]){let a=rn.get(n+t);if(a)return a}}o(me,"contractErrorFor");function on(e){return e.envelope==="sse_frame"?`/errors#sse-${e.wireCode}`:e.envelope==="oauth_error"?`/errors#oauth-${e.wireCode}`:`/errors#${e.wireCode}`}o(on,"contractDocUrl");function Ft(e){return null}o(Ft,"publishedDocUrl");var an=Object.freeze({authExpired:"authentication",authRejected:"authentication",sessionRequired:"authentication",accessDenied:"authorization",paymentRequired:"entitlement",quotaExceeded:"rateLimit",rateLimited:"rateLimit",validationFailed:"invalidRequest",sdkUpdateRequired:"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 It(e){return an[e]}o(It,"categoryFor");function Pt(e){let r=me(e);if(r)return r.normalized;let t=(e??"").trim().toUpperCase(),n=t.replace(/[^A-Z0-9]/g,"");if(n==="AUTHREJECTED")return "authRejected";if(t.startsWith("AUTH"))return "authExpired";switch(n){case "DAILYQUOTAEXCEEDED":case "QUOTAEXCEEDED":return "quotaExceeded";case "RATELIMITED":case "TOOMANYREQUESTS":return "rateLimited";case "IDEMPOTENCYKEYCONFLICT":case "IDEMPOTENCYCONFLICT":return "idempotencyConflict";case "ACCESSDENIED":case "FORBIDDEN":return "accessDenied";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"}}o(Pt,"fromWire");var sn=new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function Ae(e){return sn.has(e)}o(Ae,"isAutoRetryable");var ln=new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function Dt(e){return Ae(e)||ln.has(e)}o(Dt,"isRetryableCode");var dn=500,je=8e3,At=4;function jt(e,r=Math.random){let t=Math.max(0,e),n=Math.min(dn*2**t,je);return Math.floor(r()*n)}o(jt,"backoffDelayMs");var cn=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:"This feature isn't available on your account right now.",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:"Something in that request was not right. Check the details and try again.",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.",unknown:"Something went wrong. Please try again."});function ze(e){return cn[e]}o(ze,"userFacingError");function zt(e,r,t){Object.defineProperty(e,r,{value:t,enumerable:false,writable:false,configurable:false});}o(zt,"defineHidden");var un=/^[a-z][a-z0-9_]{0,63}$/;function M(e,r){let t=me(r?.wireCode,r?.wireEnvelope),n={code:e,category:It(e),retryable:r?.retryable??Dt(e),displayMessage:ze(e)};if(r?.httpStatus!==void 0&&(n.httpStatus=r.httpStatus),r?.requestId&&(n.requestId=r.requestId),typeof r?.reasonCode=="string"&&un.test(r.reasonCode)&&(n.reasonCode=r.reasonCode),t);return r?.wireMessage&&zt(n,"wireMessage",r.wireMessage),r?.raw!==void 0&&r.raw!==null&&zt(n,"raw",r.raw),Object.freeze(n)}o(M,"makeEverfurError");function H(e,r){return Object.freeze(r===void 0?{ok:true,value:e}:{ok:true,value:e,warning:r})}o(H,"ok");function F(e){return Object.freeze({ok:false,error:e})}o(F,"err");var ge=class ge extends Error{constructor(r,t){super(t),this.name="EverfurConfigError",this.kind=r,Object.setPrototypeOf(this,ge.prototype);}};o(ge,"EverfurConfigError");var ee=ge;function Nt(e){throw new Error(`assertNever: unhandled discriminated-union member ${JSON.stringify(e)}`)}o(Nt,"assertNever");function Lt(e){return Object.freeze({kind:"error",terminal:true,code:e.code,retryable:e.retryable,wireMessage:e.wireMessage,synthesized:e.synthesized,lastEventId:e.lastEventId,serverRequestId:e.serverRequestId??null})}o(Lt,"errorFrame");function fn(e){let r={};return e.mode==="personalized"?r.authorization=`Bearer ${e.token}`:r["x-everfur-partner-key"]=e.publishableKey,e.userRef&&(r["x-everfur-user-ref"]=e.userRef),e.sessionId&&(r["x-everfur-session-id"]=e.sessionId),r}o(fn,"authHeaders");function te(e,r){return {...e,headers:{...mn(e.headers),...fn(r)}}}o(te,"withAuthHeaders");function mn(e){if(!e)return {};let r={};for(let[t,n]of Object.entries(e)){let a=t.toLowerCase();a==="authorization"||a==="x-everfur-partner-key"||(r[t]=n);}return r}o(mn,"stripAuthHeaders");async function Mt(e,r){if(r.mode==="anonymous")return r.transport.request(te(e,{mode:"anonymous",publishableKey:r.publishableKey,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));let t;try{t=await r.identity.currentToken();}catch{return F(Ne())}let n=await r.transport.request(te(e,{mode:"personalized",token:t,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));if(n.ok||n.error.httpStatus!==401)return n;let a;try{a=await r.identity.currentToken({forceRefresh:!0});}catch{return F(Ne())}let s=await r.transport.request(te(e,{mode:"personalized",token:a,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));return !s.ok&&s.error.httpStatus===401?F(Ne(s.error.httpStatus)):s}o(Mt,"authedSend");function Ne(e){return M("authRejected",{retryable:false,...e!==void 0?{httpStatus:e}:{}})}o(Ne,"authRejectedError");function Vt(e){return M("internalError",{retryable:true,wireMessage:gn(e)})}o(Vt,"networkError");function gn(e){return e instanceof Error?e.message:typeof e=="string"?e:"network request failed"}o(gn,"describeCause");var bn=3e4,hn=je*2,Rn="idempotency-key",vn=new Set(["POST","PUT","PATCH","DELETE"]),_n=Object.freeze({onEvent(){}}),En=Object.freeze({setTimeout:o((e,r)=>setTimeout(e,r),"setTimeout"),clearTimeout:o(e=>clearTimeout(e),"clearTimeout"),now:o(()=>Date.now(),"now")});function qt(e){let r=e.observer??_n,t=e.timers??En,n=e.rng??Math.random,a=e.sleep??((h,E)=>jn(h,t,E)),s=e.maxAttempts??At,l=e.unaryTimeoutMs??bn,c=e.newIdempotencyKey??xn(),i=o(h=>{try{r.onEvent(h);}catch{}},"emit");async function u(h,E,C){let k=C?.maxAttempts,I=Math.max(1,k??s),P=C?.idempotent??vn.has(E.method)?c():null,Y=wn(E,P),we=0;for(;;){let K=o(Ce=>Object.freeze({call:h,method:E.method,path:E.path,attempt:we,...P?{idempotencyKey:P}:{},...Ce}),"stamp");i(K({phase:"attempt"}));let nt=Dn(l,t),ot=An(nt.signal,E.signal),X;try{X=await Mt({...Y,signal:ot.signal},e.auth);}catch(Ce){X=F(Vt(Ce));}finally{ot.dispose(),nt.cancel();}if(X.ok)return i(K({phase:"settled",ok:true,reason:"ok"})),X;let N=X.error,ce=Sn(N,we,{maxAttempts:I,rng:n,now:t.now(),aborted:E.signal?.aborted===true,...k!==void 0?{perCallMaxAttempts:k}:{},...e.errorPolicy!==void 0?{policy:e.errorPolicy}:{}}),xe={ok:false,code:N.code,reason:ce.reason,...N.httpStatus!==void 0?{httpStatus:N.httpStatus}:{},...N.requestId!==void 0?{requestId:N.requestId}:{}};if(!ce.retry)return i(K({phase:"settled",...xe})),F(N);if(i(K({phase:"retry",...xe,delayMs:ce.delayMs})),await a(ce.delayMs,E.signal),E.signal?.aborted===true)return i(K({phase:"settled",...xe,reason:"aborted"})),F(N);we+=1;}}o(u,"send");async function y(h){return te(h,await Pn(e.auth))}o(y,"authorize");async function*_(h,E,C){i(Object.freeze({call:h,phase:"stream.open",method:E.method,path:E.path,attempt:0}));try{yield*e.auth.transport.stream(E,C);}catch{yield Lt({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:null});}}return o(_,"stream"),Object.freeze({send:u,authorize:y,stream:_})}o(qt,"createRequestFunnel");function wn(e,r){let t={};for(let[n,a]of Object.entries(e.headers??{}))n.toLowerCase()!==Rn&&(t[n]=a);return r!==null&&(t["Idempotency-Key"]=r),{...e,headers:t}}o(wn,"assembleHeaders");function xn(){let e=0;return ()=>`efk_${Date.now().toString(36)}_${(e++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}o(xn,"defaultIdempotencyKeyFactory");var Cn=10;function Sn(e,r,t){if(t.aborted)return {retry:false,reason:"aborted"};let n=Tn(e);if(n==="quota")return {retry:false,reason:"daily-quota-exhausted"};if(n!=="burst"&&!Ae(e.code))return {retry:false,reason:"terminal-code"};let a=n==="burst"?"burst-throttle":"retryable-code";if(o(()=>{if(t.policy===void 0)return false;try{return !t.policy.shouldRetry(e.code,r)}catch{return false}},"policyVetoedRetry")())return {retry:false,reason:"terminal-code"};let l=o(()=>{if(t.policy===void 0)return null;let u;try{u=t.policy.maxAttempts(e.code);}catch{return null}return typeof u!="number"||!Number.isFinite(u)?null:Math.max(1,Math.min(Cn,Math.floor(u)))},"policyCeiling"),c=t.perCallMaxAttempts??l()??t.maxAttempts;if(r+1>=c)return {retry:false,reason:"attempts-exhausted"};let i=kn(e,t.now);return i!==null?i>hn?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:a,delayMs:i}:{retry:true,reason:a,delayMs:jt(r,t.rng)}}o(Sn,"decideRetry");function Tn(e){let r=e.code==="unknown"?Pt(In(e.raw)):e.code;return r==="quotaExceeded"?"quota":r==="rateLimited"||e.httpStatus===429?"burst":null}o(Tn,"throttleKind");function kn(e,r){let t=On(e.raw);if(t===null)return null;let n=t-r;return n>0?n:0}o(kn,"retryOverrideMs");function On(e){for(let r of Ut(e)){let t=r.resets_at,n=Fn(t);if(n!==null)return n}return null}o(On,"findResetsAt");function Ut(e){if(!Bt(e))return [];let r=[e];for(let t of ["error","detail"]){let n=e[t];Bt(n)&&r.push(n);}return r}o(Ut,"candidateScopes");function Fn(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 r=Date.parse(e);return Number.isFinite(r)?r:null}return null}o(Fn,"parseInstantMs");function In(e){for(let r of Ut(e)){let t=r.code;if(typeof t=="string"&&t.length>0)return t}return null}o(In,"rawWireCode");function Bt(e){return typeof e=="object"&&e!==null}o(Bt,"isRecord");async function Pn(e){return e.mode==="anonymous"?{mode:"anonymous",publishableKey:e.publishableKey,userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{}}:{mode:"personalized",token:await e.identity.currentToken(),userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{}}}o(Pn,"resolveDeviceAuth");function Dn(e,r){let t=new AbortController,n=r.setTimeout(()=>t.abort(),e);return {signal:t.signal,cancel:o(()=>r.clearTimeout(n),"cancel")}}o(Dn,"boundedSignal");function An(e,r){let t=o(()=>{},"noop");if(!r)return {signal:e,dispose:t};let n=new AbortController;if(e.aborted||r.aborted)return n.abort(),{signal:n.signal,dispose:t};let a=o(()=>n.abort(),"onAbort");return e.addEventListener("abort",a,{once:true}),r.addEventListener("abort",a,{once:true}),{signal:n.signal,dispose:o(()=>{e.removeEventListener("abort",a),r.removeEventListener("abort",a);},"dispose")}}o(An,"mergeSignals");function jn(e,r,t){return e<=0||t?.aborted===true?Promise.resolve():new Promise(n=>{let a=r.setTimeout(()=>{t?.removeEventListener("abort",s),n();},e),s=o(()=>{r.clearTimeout(a),n();},"onAbort");t?.addEventListener("abort",s,{once:true});})}o(jn,"delayAbortable");function Ht(e){for(let r=0;r<e.length;r+=1){let t=e.charCodeAt(r);if(t>=55296&&t<=56319){let n=e.charCodeAt(r+1);if(!(n>=56320&&n<=57343))return true;r+=1;}else if(t>=56320&&t<=57343)return true}return false}o(Ht,"hasLoneSurrogate");var Wt=64,$t=512;function Nn(e){return e==="owner_reported"||e==="clinic_document"?e:null}o(Nn,"normalizeOrigin");zod.z.object({request_id:zod.z.string().min(1),pet_ref:zod.z.string().min(1),status:zod.z.string(),simple_status:zod.z.string().nullish(),simple_status_detail:zod.z.string().nullish(),status_label:zod.z.string().optional(),dispatch_status:zod.z.string().nullish(),can_retry_send:zod.z.boolean().optional(),can_revoke:zod.z.boolean().optional(),can_convert_to_upload:zod.z.boolean().optional(),can_update_clinic_email:zod.z.boolean().optional(),reminder_count:zod.z.number().int().nonnegative().optional(),last_reminder_at:zod.z.string().nullish(),waiting_expectation:zod.z.string().nullish(),document_count:zod.z.number().optional(),held_item_count:zod.z.number().optional(),received_at:zod.z.string().nullish(),parsing_started_at:zod.z.string().nullish(),review_started_at:zod.z.string().nullish(),created_at:zod.z.string().optional(),updated_at:zod.z.string().optional(),source:zod.z.string().nullish().catch(null),action_needed_label:zod.z.string().nullish().catch(null),failure_reason:zod.z.string().nullish().catch(null),failure_code:zod.z.string().nullish().catch(null),recovery_stage:zod.z.string().nullish().catch(null),show_clinic_phone:zod.z.boolean().optional().catch(void 0),clinic_name:zod.z.string().nullish().catch(null),clinic_email:zod.z.string().nullish().catch(null),clinic_phone:zod.z.string().nullish().catch(null),converted_to_upload_at:zod.z.string().nullish().catch(null),request_group_id:zod.z.string().nullish().catch(null)}).passthrough();zod.z.object({request_group_id:zod.z.string().min(1),pet_ref:zod.z.string().min(1),total:zod.z.number().int().nonnegative(),responded:zod.z.number().int().nonnegative(),pending:zod.z.number().int().nonnegative(),members:zod.z.array(zod.z.unknown())});zod.z.object({source_doc_id:zod.z.string().min(1),request_id:zod.z.string().min(1)});var Ln=zod.z.object({label:zod.z.string(),value:zod.z.string()}),Le=zod.z.object({key:zod.z.string(),category:zod.z.string().optional(),label:zod.z.string().optional(),value:zod.z.string().nullish(),unit:zod.z.string().nullish(),observed_at:zod.z.string().nullish(),status:zod.z.string().nullish(),origin:zod.z.string().nullish(),canonical_key:zod.z.string().nullish()}),Mn=zod.z.object({at:zod.z.string(),value:zod.z.number().nullish(),display:zod.z.string().nullish(),origin:zod.z.string().nullish()}),Vn=zod.z.object({key:zod.z.string(),label:zod.z.string().optional(),points:zod.z.array(Mn).optional()}),Bn=zod.z.object({title:zod.z.string(),detail:zod.z.string().nullish(),due_at:zod.z.string().nullish()}),Me=zod.z.object({doc_id:zod.z.string(),title:zod.z.string().nullish(),page_count:zod.z.number().nullish(),received_at:zod.z.string().nullish()});function Gt(e){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:Nn(e.origin),canonicalKey:e.canonical_key??null})}o(Gt,"mapEntityRow");function Yt(e){return Object.freeze({docId:e.doc_id,title:e.title??null,pageCount:e.page_count??null,receivedAt:e.received_at??null})}o(Yt,"mapDocumentRow");zod.z.object({identity:zod.z.array(Ln).optional(),entities:zod.z.array(Le).optional(),entity_series:zod.z.array(Vn).optional(),forward_looking:zod.z.array(Bn).optional(),documents:zod.z.array(Me).optional()});zod.z.object({pet_ref:zod.z.string().optional(),granted:zod.z.boolean().optional(),version:zod.z.string().nullish(),granted_at:zod.z.string().nullish()});var v=zod.z.string().nullish(),be=zod.z.number().nullish(),qn=zod.z.object({collected_at:v,at:v,value:be,unit:v,qualitative_result:v,ref_low:be,ref_high:be,status:v,source_clinic:v,source_doc_id:v,doc_id:v,reviewed:zod.z.boolean().nullish()}),Un=zod.z.object({collected_at:v,at:v,value:be,unit:v,qualitative_result:v,status:v}),Hn=zod.z.object({marker_id:zod.z.string().min(1),canonical_name:v,name:v,loinc_code:v,canonical_unit:v,unit:v,panel_name:v,panel:v,meaning_text:v,meaning:v,latest:Un.nullish(),trajectory:v,points:zod.z.array(qn).optional()}),Wn=zod.z.object({total_markers:zod.z.number().int().nonnegative(),in_range_count:zod.z.number().int().nonnegative(),out_of_range_count:zod.z.number().int().nonnegative(),unknown_count:zod.z.number().int().nonnegative()}),$n=zod.z.object({markers:zod.z.array(Hn).optional(),summary:Wn.nullish(),disclaimer:zod.z.string().optional(),featured_marker_id:v});function Gn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(Gn,"isObject");function Kt(e){return Object.freeze({petRef:e,withheld:true,markers:Object.freeze([]),summary:null,disclaimer:"",featuredMarkerId:null})}o(Kt,"withheldMarkers");function Xt(e,r){let t=Gn(r)?r:{},n=typeof t.pet_ref=="string"&&t.pet_ref.length>0?t.pet_ref:e;if(t.withheld===true)return Kt(n);let a=$n.safeParse(t);if(!a.success)return Kt(n);let s=a.data,l=o(i=>Object.freeze({at:i.collected_at??i.at??null,value:i.value??null,unit:i.unit??null,qualitativeResult:i.qualitative_result??null,refLow:i.ref_low??null,refHigh:i.ref_high??null,status:i.status??null,sourceClinic:i.source_clinic??null,docId:i.source_doc_id??i.doc_id??null,reviewed:i.reviewed===true}),"point"),c=(s.markers??[]).map(i=>Object.freeze({markerId:i.marker_id,name:i.canonical_name??i.name??i.marker_id,loincCode:i.loinc_code??null,unit:i.canonical_unit??i.unit??null,panel:i.panel_name??i.panel??null,meaning:i.meaning_text??i.meaning??null,latest:i.latest?Object.freeze({at:i.latest.collected_at??i.latest.at??null,value:i.latest.value??null,unit:i.latest.unit??null,qualitativeResult:i.latest.qualitative_result??null,status:i.latest.status??null}):null,trajectory:i.trajectory??null,points:Object.freeze((i.points??[]).map(l))}));return Object.freeze({petRef:n,withheld:false,markers:Object.freeze(c),summary:s.summary?Object.freeze({totalMarkers:s.summary.total_markers,inRangeCount:s.summary.in_range_count,outOfRangeCount:s.summary.out_of_range_count,unknownCount:s.summary.unknown_count}):null,disclaimer:s.disclaimer??"",featuredMarkerId:s.featured_marker_id??null})}o(Xt,"mapRecordMarkers");var Qt=128,V=128;var Yn=zod.z.string().min(1).refine(e=>e.startsWith("https://")),re=zod.z.string().nullish(),Kn=zod.z.object({share_id:zod.z.string().min(1),share_url:zod.z.string().min(1),expires_at:re}),Xn=zod.z.object({shares:zod.z.array(zod.z.object({share_id:zod.z.string().min(1),expires_at:re,created_at:re,view_count:zod.z.number().int().nonnegative().nullish(),last_viewed_at:re})).optional()}),Qn=zod.z.object({download_url:Yn,expires_at:re});function Jn(e,r){let t=e.trim();if(t.length===0)return null;try{let n=/^[a-z][a-z0-9+.-]*:/i.test(t)?new URL(t):r!==void 0?new URL(t,r):null;return n===null||n.protocol!=="https:"?null:n.toString()}catch{return null}}o(Jn,"resolveShareUrl");function Jt(e,r){let t=Kn.safeParse(e);if(!t.success)return null;let n=Jn(t.data.share_url,r);return n===null?null:Object.freeze({shareId:t.data.share_id,shareUrl:n,expiresAt:t.data.expires_at??null})}o(Jt,"mapRecordShareLink");function Zt(e){let r=Xn.safeParse(e);return r.success?Object.freeze((r.data.shares??[]).map(t=>Object.freeze({shareId:t.share_id,expiresAt:t.expires_at??null,createdAt:t.created_at??null,viewCount:t.view_count??0,lastViewedAt:t.last_viewed_at??null}))):null}o(Zt,"mapRecordShareList");function er(e){let r=Qn.safeParse(e);return r.success?Object.freeze({downloadUrl:r.data.download_url,expiresAt:r.data.expires_at??null}):null}o(er,"mapRecordPdfLink");var Zn=zod.z.object({signatures:zod.z.array(zod.z.object({signature_id:zod.z.string().min(1),preview_url:zod.z.string().min(1).refine(e=>e.startsWith("https://")),created_at:zod.z.string().nullish()})).optional()});function tr(e){let r=Zn.safeParse(e);return r.success?Object.freeze((r.data.signatures??[]).map(t=>Object.freeze({signatureId:t.signature_id,previewUrl:t.preview_url,createdAt:t.created_at??null}))):null}o(tr,"mapSignatureSuggestions");var m=zod.z.string().nullish(),ne=zod.z.number().nullish(),eo=zod.z.object({at:m,value:ne,unit:m,qualitative_result:m,ref_low:ne,ref_high:ne,status:m,doc_id:m}),to=zod.z.object({marker_id:zod.z.string(),name:zod.z.string(),loinc_code:m,unit:m,panel:m,meaning:m,latest:zod.z.object({at:m,value:ne,unit:m,qualitative_result:m,status:m}).nullish(),trajectory:m,points:zod.z.array(eo).optional()}),ro=zod.z.object({encounter_id:zod.z.string(),date:m,type:m,clinic_name:m,veterinarian:m,doc_id:m}),no=zod.z.object({note_id:zod.z.string(),encounter_id:m,observed_on:m,sections:zod.z.array(zod.z.object({section:zod.z.string(),text:zod.z.string()})).optional()}),oo=zod.z.object({exam_id:zod.z.string(),encounter_id:m,observed_on:m,doc_id:m,systems:zod.z.record(zod.z.object({finding_status:m,finding:m})).optional()}),io=zod.z.object({has_lab_history:zod.z.boolean().optional(),has_vaccination_history:zod.z.boolean().optional(),has_weight_history:zod.z.boolean().optional(),has_vitals_history:zod.z.boolean().optional(),has_physical_exam_history:zod.z.boolean().optional(),has_procedure_history:zod.z.boolean().optional(),has_genetic_history:zod.z.boolean().optional(),has_reproductive_history:zod.z.boolean().optional(),has_parasite_prevention_history:zod.z.boolean().optional(),earliest_record_at:m,latest_record_at:m,documents_ingested:zod.z.number().int().nonnegative().optional(),documents_in_review:zod.z.number().int().nonnegative().optional(),entities_pending_review:zod.z.record(zod.z.number().int().nonnegative()).optional(),held_total:zod.z.number().int().nonnegative().optional()}),ao=zod.z.object({conflict_id:zod.z.string(),entity_type:zod.z.string(),field:m,severity:m,candidates:zod.z.array(zod.z.object({value:zod.z.string(),source_doc_id:m,doc_id:m,collected_at:m})).optional()}),so=zod.z.object({lab_results:zod.z.array(to).optional(),encounters:zod.z.array(ro).optional(),clinician_notes:zod.z.array(no).optional(),physical_exams:zod.z.array(oo).optional(),completeness:io.nullish(),conflicts:zod.z.array(ao).optional()}),lo=zod.z.object({visits:zod.z.array(zod.z.object({visit_id:zod.z.string(),visit_date:m,veterinarian:m,summary:m,doc_id:m})),vaccines:zod.z.array(zod.z.object({vaccine_id:zod.z.string(),product:m,lot:m,administered_on:m,expires_on:m,doc_id:m})),weights:zod.z.array(zod.z.object({weight_id:zod.z.string(),observed_on:m,weight_kg:ne,doc_id:m})),medications:zod.z.array(zod.z.object({medication_id:zod.z.string(),drug_name:m,dose:m,route:m,frequency:m,sig:m,rx_number:m,started_on:m,stopped_on:m,doc_id:m})),disclaimer:zod.z.string().optional()}),co=zod.z.object({document:Me,contributions:zod.z.array(Le),contribution_count:zod.z.number().int().nonnegative().optional()});function Be(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(Be,"isObject");function qe(e,r){return typeof e.pet_ref=="string"&&e.pet_ref.length>0?e.pet_ref:r}o(qe,"petOf");function Ve(e,r){return Object.freeze({petRef:e,available:false,withheld:r,labResults:Object.freeze([]),encounters:Object.freeze([]),clinicianNotes:Object.freeze([]),physicalExams:Object.freeze([]),completeness:null,conflicts:Object.freeze([])})}o(Ve,"emptyDepth");function nr(e,r){let t=Be(r)?r:{},n=qe(t,e);if(t.withheld===true)return Ve(n,true);if(!["lab_results","encounters","clinician_notes","physical_exams","completeness","conflicts"].some(i=>i in t))return Ve(n,false);let s=so.safeParse(t);if(!s.success)return Ve(n,true);let l=s.data,c=o(i=>Object.freeze({at:i.at??null,value:i.value??null,unit:i.unit??null,qualitativeResult:i.qualitative_result??null,refLow:i.ref_low??null,refHigh:i.ref_high??null,status:i.status??null,docId:i.doc_id??null}),"point");return Object.freeze({petRef:n,available:true,withheld:false,labResults:Object.freeze((l.lab_results??[]).map(i=>Object.freeze({markerId:i.marker_id,name:i.name,loincCode:i.loinc_code??null,unit:i.unit??null,panel:i.panel??null,meaning:i.meaning??null,latest:Object.freeze({at:i.latest?.at??null,value:i.latest?.value??null,unit:i.latest?.unit??null,qualitativeResult:i.latest?.qualitative_result??null,status:i.latest?.status??null}),trajectory:i.trajectory??null,points:Object.freeze((i.points??[]).map(c))}))),encounters:Object.freeze((l.encounters??[]).map(i=>Object.freeze({encounterId:i.encounter_id,date:i.date??null,type:i.type??null,clinicName:i.clinic_name??null,veterinarian:i.veterinarian??null,docId:i.doc_id??null}))),clinicianNotes:Object.freeze((l.clinician_notes??[]).map(i=>Object.freeze({noteId:i.note_id,encounterId:i.encounter_id??null,observedOn:i.observed_on??null,sections:Object.freeze((i.sections??[]).map(u=>Object.freeze({section:u.section,text:u.text})))}))),physicalExams:Object.freeze((l.physical_exams??[]).map(i=>Object.freeze({examId:i.exam_id,encounterId:i.encounter_id??null,observedOn:i.observed_on??null,docId:i.doc_id??null,systems:Object.freeze(Object.entries(i.systems??{}).map(([u,y])=>Object.freeze({system:u,findingStatus:y.finding_status??null,finding:y.finding??null})))}))),completeness:l.completeness?Object.freeze({hasLabHistory:l.completeness.has_lab_history===true,hasVaccinationHistory:l.completeness.has_vaccination_history===true,hasWeightHistory:l.completeness.has_weight_history===true,hasVitalsHistory:l.completeness.has_vitals_history===true,hasPhysicalExamHistory:l.completeness.has_physical_exam_history===true,hasProcedureHistory:l.completeness.has_procedure_history===true,hasGeneticHistory:l.completeness.has_genetic_history===true,hasReproductiveHistory:l.completeness.has_reproductive_history===true,hasParasitePreventionHistory:l.completeness.has_parasite_prevention_history===true,earliestRecordAt:l.completeness.earliest_record_at??null,latestRecordAt:l.completeness.latest_record_at??null,documentsIngested:l.completeness.documents_ingested??0,documentsInReview:l.completeness.documents_in_review??0,entitiesPendingReview:Object.freeze({...l.completeness.entities_pending_review??{}}),heldTotal:l.completeness.held_total??0}):null,conflicts:Object.freeze((l.conflicts??[]).map(i=>Object.freeze({conflictId:i.conflict_id,entityType:i.entity_type,field:i.field??null,severity:i.severity??"needs_review",candidates:Object.freeze((i.candidates??[]).map(u=>Object.freeze({value:u.value,docId:u.source_doc_id??u.doc_id??null,collectedAt:u.collected_at??null})))})))})}o(nr,"mapRecordDepth");function rr(e){return Object.freeze({petRef:e,withheld:true,isEmpty:false,visits:Object.freeze([]),vaccines:Object.freeze([]),weights:Object.freeze([]),medications:Object.freeze([]),disclaimer:""})}o(rr,"withheldTimeline");function or(e,r){let t=Be(r)?r:{},n=qe(t,e);if(t.withheld===true)return rr(n);let a=lo.safeParse(t);if(!a.success)return rr(n);let s=a.data,l=s.visits.map(y=>Object.freeze({visitId:y.visit_id,visitDate:y.visit_date??null,veterinarian:y.veterinarian??null,summary:y.summary??null,docId:y.doc_id??null})),c=s.vaccines.map(y=>Object.freeze({vaccineId:y.vaccine_id,product:y.product??null,lot:y.lot??null,administeredOn:y.administered_on??null,expiresOn:y.expires_on??null,docId:y.doc_id??null})),i=s.weights.map(y=>Object.freeze({weightId:y.weight_id,observedOn:y.observed_on??null,weightKg:y.weight_kg??null,docId:y.doc_id??null})),u=s.medications.map(y=>Object.freeze({medicationId:y.medication_id,drugName:y.drug_name??null,dose:y.dose??null,route:y.route??null,frequency:y.frequency??null,sig:y.sig??null,rxNumber:y.rx_number??null,startedOn:y.started_on??null,stoppedOn:y.stopped_on??null,docId:y.doc_id??null}));return Object.freeze({petRef:n,withheld:false,isEmpty:l.length===0&&c.length===0&&i.length===0&&u.length===0,visits:Object.freeze(l),vaccines:Object.freeze(c),weights:Object.freeze(i),medications:Object.freeze(u),disclaimer:s.disclaimer??""})}o(or,"mapRecordsTimeline");function ir(e,r){let t=Be(r)?r:{},n=qe(t,e),a=o(()=>Object.freeze({petRef:n,withheld:true,document:null,contributions:Object.freeze([]),contributionCount:0}),"withheld");if(t.withheld===true)return a();let s=co.safeParse(t);if(!s.success)return a();let l=Object.freeze(s.data.contributions.map(Gt));return Object.freeze({petRef:n,withheld:false,document:Yt(s.data.document),contributions:l,contributionCount:s.data.contribution_count??l.length})}o(ir,"mapDocumentContributions");var uo="/widget/v1/records/pets";function ar(e){let r=e.funnel??qt({auth:e.auth,...e.errorPolicy?{errorPolicy:e.errorPolicy}:{}}),t=o((i,u)=>typeof i=="string"&&i.length>0&&!Ht(i)&&[...i].length<=u,"segment"),n=o(async(i,u,y,_)=>{if(!t(u,V))return B();let h=await r.send(i,{method:"GET",path:y});if(!h.ok)return h;let E=_(h.value);return E.petRef===u?H(E):F(M("internalError",{retryable:false}))},"read"),a=o(i=>`${uo}/${encodeURIComponent(i)}`,"pet"),s=o(i=>`${a(i)}/everfur_record`,"record"),l=o(async(i,u,y)=>{let _=await r.send(i,u,u.method==="POST"?{idempotent:false,maxAttempts:1}:void 0);if(!_.ok)return _;let h=y(_.value);return h===null?F(M("internalError",{retryable:false})):H(h)},"parsed"),c=o((i,u)=>!t(i.entityType,Wt)||!t(i.canonicalKey,$t)||i.idempotencyKey!==void 0&&!t(i.idempotencyKey,Qt)||u!==void 0&&Object.keys(u).length===0?null:{entity_type:i.entityType,canonical_key:i.canonicalKey,...u!==void 0?{corrected_fields:u}:{},...i.idempotencyKey!==void 0?{idempotency_key:i.idempotencyKey}:{}},"factBody");return {getRecordDepth:o(i=>n("records.depth.record",i,`${a(i)}/record`,u=>nr(i,u)),"getRecordDepth"),getTimeline:o(i=>n("records.depth.timeline",i,`${a(i)}/timeline`,u=>or(i,u)),"getTimeline"),getDocumentContributions(i,u){return t(u,64)?n("records.depth.contributions",i,`${a(i)}/documents/${encodeURIComponent(u)}/contributions`,y=>ir(i,y)):B()},getMarkers:o(i=>n("records.depth.markers",i,`${a(i)}/markers`,u=>Xt(i,u)),"getMarkers"),createShare(i){return t(i,V)?l("records.share.create",{method:"POST",path:`${s(i)}/share`},u=>Jt(u,e.apiBaseUrl)):B()},listShares(i){return t(i,V)?l("records.share.list",{method:"GET",path:`${s(i)}/shares`},Zt):B()},async revokeShare(i,u){if(!t(i,V)||!t(u,64))return B();let y=await r.send("records.share.revoke",{method:"DELETE",path:`${s(i)}/shares/${encodeURIComponent(u)}`},{idempotent:false,maxAttempts:1});return y.ok?H(void 0):y},getPdfLink(i){return t(i,V)?l("records.pdf.link",{method:"GET",path:`${s(i)}/pdf-link`},er):B()},async editFact(i,u){let y=t(i,V)?c(u,u.correctedFields):null;if(y===null)return B();let _=await r.send("records.fact.edit",{method:"POST",path:`${s(i)}/facts/edit`,body:y},{idempotent:false,maxAttempts:1});return _.ok?H(void 0):_},async removeFact(i,u){let y=t(i,V)?c(u):null;if(y===null)return B();let _=await r.send("records.fact.remove",{method:"POST",path:`${s(i)}/facts/remove`,body:y},{idempotent:false,maxAttempts:1});return _.ok?H(void 0):_},listAuthorizationSignatures:o(()=>l("records.signatures.list",{method:"GET",path:"/widget/v1/records/authorization-signatures"},tr),"listAuthorizationSignatures")}}o(ar,"createRecordsDepthClient");function B(){return Promise.resolve(F(M("validationFailed",{retryable:false})))}o(B,"invalid");var sr=Symbol.for("@everfur/sdk#EverfurContext@v1"),lr=globalThis,dr=lr[sr]??(lr[sr]=react.createContext(null));dr.displayName??="EverfurContext";function oe(){let e=react.useContext(dr);if(e===null)throw new ee("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return e}o(oe,"useEverfurContext");var go=new Map,cr=new Set;function bo(e){return go.get(e)??0}o(bo,"recordsConsentEpochOf");function ho(e){return cr.add(e),()=>{cr.delete(e);}}o(ho,"subscribe");function ur(e){let r=react.useCallback(()=>bo(e),[e]);return react.useSyncExternalStore(ho,r,r)}o(ur,"useRecordsConsentEpoch");function yr(){let{runtime:e,userRef:r,scopeEpoch:t}=oe();return react.useMemo(()=>{let{services:n}=e.registry;return ar({auth:n.authFor(r),...n.errorPolicy?{errorPolicy:n.errorPolicy}:{},...typeof n.apiBaseUrl=="string"?{apiBaseUrl:n.apiBaseUrl}:{}})},[e,r,t])}o(yr,"useEverfurRecordsDepthClient");function ie(e,r,t,n=""){let a=yr(),{userRef:s}=oe(),l=ur(e),c=react.useMemo(()=>({}),[a,e,n,l]),[i,u]=react.useState({scope:c,value:null,error:null,loading:true}),y=react.useRef(0),_=react.useCallback(async()=>{let z=y.current+=1;if(u({scope:c,value:null,error:null,loading:true}),s===null){u({scope:c,value:null,error:null,loading:false});return}let P=await r(a,e);z===y.current&&(P.ok?u({scope:c,value:P.value,error:null,loading:false}):u({scope:c,value:null,error:P.error,loading:false}));},[a,e,r,c,s]);react.useEffect(()=>(_(),()=>{y.current+=1;}),[_]);let h=i.scope===c?i:{value:null,error:null,loading:true},E=react.useCallback(()=>{_();},[_]),C=h.error===null||h.error.httpStatus!==404,k=C?h.error:null,I=h.loading?"loading":k!==null?"error":h.value===null?"empty":h.value.withheld?"populated":t(h.value)?"empty":"populated";return react.useMemo(()=>({status:I,value:h.value,error:k,available:C,refresh:E}),[I,h.value,k,C,E])}o(ie,"useRecordsDepthRead");var $e=class $e extends react.Component{constructor(){super(...arguments);this.state={failed:false,key:this.props.resetKey};}static getDerivedStateFromError(){return {failed:true}}static getDerivedStateFromProps(t,n){return Object.is(t.resetKey,n.key)?null:{failed:false,key:t.resetKey}}render(){return this.state.failed?this.props.fallback:this.props.children}};o($e,"HostRenderBoundary");var He=$e;function wo({render:e}){return e()}o(wo,"RenderHost");function We({render:e,fallback:r,resetKey:t}){return react.createElement(He,{fallback:r,resetKey:t,children:react.createElement(wo,{render:e})})}o(We,"HostRender");var xo=Object.freeze({chat:Object.freeze(["chat.message.create"]),records:Object.freeze(["records.upload.create","records.record.read"]),recordsClinic:Object.freeze(["records.clinic.create"]),video:Object.freeze(["video.gait.execute"]),photo:Object.freeze(["photo.checkup.execute"]),animations:Object.freeze(["animations.state.read"]),televet:Object.freeze(["televet.visit.create"])});function Co(e){return xo[e]}o(Co,"requires");function mr(e,r,t){let n=Co(e),a=new Map;for(let c of r)a.set(c.resource,c);if(t?.isPending===true&&n.some(c=>!a.has(c)))return Ge({name:e,enabled:false,isPending:true,limits:{}});let s=So(n,a);return n.filter(c=>a.get(c)?.granted!==true).length===0?Ge({name:e,enabled:true,isPending:false,limits:s}):Ge({name:e,enabled:false,isPending:false,limits:s,disabled:To(n,a)})}o(mr,"decideCapability");function So(e,r){let t={};for(let n of e){let a=r.get(n)?.limits;if(a)for(let[s,l]of Object.entries(a)){let c=t[s];t[s]=c===void 0?l:Math.min(c,l);}}return t}o(So,"mergeLimits");function To(e,r){for(let t of e){let n=r.get(t)?.disabled;if(n)return Object.freeze({reason:n.reason,level:n.level,recoverable:n.recoverable})}return Object.freeze({reason:ze("accessDenied"),level:"user_entitlement",recoverable:false})}o(To,"disabledFor");function Ge(e){let r={name:e.name,enabled:e.enabled,isPending:e.isPending,limits:Object.freeze({...e.limits})};return e.disabled!==void 0&&(r.disabled=e.disabled),Object.freeze(r)}o(Ge,"freezeDecision");function Ye(e){let{runtime:r}=oe(),t=r.entitlements,n=react.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getSnapshot);return react.useMemo(()=>mr(e,n.decisions,{isPending:n.isPending}),[e,n])}o(Ye,"useCapability");var Fo=48;function Io(e){return e.isPending?"pending":e.enabled?"enabled":"disabled"}o(Io,"selectView");function Rr(e){let{capability:r,children:t,renderDisabled:n,renderPending:a,style:s}=e,l=Ye(r),c=react.useMemo(()=>Io(l),[l]);switch(c){case "enabled":return t;case "pending":return a?jsxRuntime.jsx(We,{render:a,fallback:jsxRuntime.jsx(br,{capability:r,style:s})}):jsxRuntime.jsx(br,{capability:r,style:s});case "disabled":return n?jsxRuntime.jsx(We,{render:()=>n(l),fallback:jsxRuntime.jsx(hr,{decision:l,style:s}),resetKey:l}):jsxRuntime.jsx(hr,{decision:l,style:s});default:return Nt(c)}}o(Rr,"CapabilityGate");function br({capability:e,style:r}){let t=w(),n=react.useMemo(()=>vr(t),[t]);return jsxRuntime.jsx(reactNative.View,{style:[n.offstate,r],accessible:true,accessibilityState:{busy:true},accessibilityLabel:`Loading ${e}`,children:jsxRuntime.jsx(reactNative.View,{style:n.skeletonBar})})}o(br,"PendingSkeleton");function hr({decision:e,style:r}){let t=w(),n=react.useMemo(()=>vr(t),[t]),a=e.disabled?.reason??"";return jsxRuntime.jsx(reactNative.View,{style:[n.offstate,r],accessible:true,accessibilityRole:"text",accessibilityLabel:a,children:a.length>0?jsxRuntime.jsx(g,{style:n.offstateText,children:a}):null})}o(hr,"OffState");function vr(e){let{color:r,space:t,radius:n,type:a}=e;return reactNative.StyleSheet.create({offstate:{minHeight:Fo,justifyContent:"center",paddingHorizontal:t.lg,paddingVertical:t.md,backgroundColor:r.surfaceCream,borderRadius:n.md,borderWidth:reactNative.StyleSheet.hairlineWidth,borderColor:r.brandBorder},offstateText:{...S(e,"regular"),fontSize:a.size.body,lineHeight:Math.round(a.size.body*a.lineHeight.normal),color:r.text.muted},skeletonBar:{height:t.md,borderRadius:n.xs,backgroundColor:r.brandSofter}})}o(vr,"makeStyles");var ae=Object.freeze({title:"For educational use only",body:"Everfur is for educational purposes only. It helps you track visible changes through AI checkups. It does not diagnose, treat, prescribe, or replace veterinary care. For urgent symptoms or emergencies, contact a veterinarian immediately."});function wr(e){let r=w(),t=react.useMemo(()=>Ao(r),[r]);return jsxRuntime.jsxs(reactNative.View,{style:[t.container,e.style],accessible:true,accessibilityRole:"text",accessibilityLabel:`${ae.title}. ${ae.body}`,children:[jsxRuntime.jsx(g,{style:t.title,children:ae.title}),jsxRuntime.jsx(g,{style:t.body,children:ae.body})]})}o(wr,"ClinicalDisclaimer");function Ao(e){let{color:r,space:t,type:n}=e;return reactNative.StyleSheet.create({container:{paddingHorizontal:t.lg,paddingVertical:t.md,borderTopWidth:reactNative.StyleSheet.hairlineWidth,borderTopColor:r.borderHairlineGreen,backgroundColor:r.surfaceCream,gap:t.xs},title:{...S(e,"bold"),fontSize:n.size.caption,lineHeight:Math.round(n.size.caption*n.lineHeight.snug),color:r.text.secondary,letterSpacing:n.letterSpacing.eyebrow},body:{...S(e,"regular"),fontSize:n.size.caption,lineHeight:Math.round(n.size.caption*n.lineHeight.snug),color:r.text.muted}})}o(Ao,"makeStyles");var xr=Object.freeze({idle:Object.freeze({title:"Find your pet\u2019s clinic",body:"Search for the clinic that holds your pet\u2019s records. We\u2019ll request them on your behalf once you sign the authorization.",action:null}),no_requests:Object.freeze({title:"No record requests yet",body:"When you request records from a clinic, you\u2019ll be able to track every step here.",action:null}),no_records:Object.freeze({title:"Nothing to show just yet",body:"Once your pet\u2019s records arrive and our team reviews them, lab trends and visits will appear here.",action:null}),rate_limited:Object.freeze({title:"Slow down a moment",body:"You\u2019ve made a lot of requests just now. You can try again shortly.",action:"Try again"}),service_unavailable:Object.freeze({title:"Records search is temporarily down",body:"We\u2019re working on it. Please try again in a few minutes.",action:"Try again"}),error:Object.freeze({title:"Couldn\u2019t reach Everfur",body:"Check your connection and try again.",action:"Try again"})}),Qe=60;function Cr(e){return `Try again in ${e}s`}o(Cr,"coolingActionLabel");var Sr="Try again, available shortly";function he({variant:e,onAction:r,message:t,testID:n}){let a=Mo(),s=xr[e],[l,c]=react.useState(e==="rate_limited"?Qe:0);react.useEffect(()=>{e==="rate_limited"&&c(Qe);},[e]),react.useEffect(()=>{if(l<=0)return;let y=setTimeout(()=>c(_=>Math.max(0,_-1)),1e3);return ()=>clearTimeout(y)},[l]);let i=e==="rate_limited"&&l>0,u=i?Cr(l):s.action;return jsxRuntime.jsxs(reactNative.View,{style:a.container,accessibilityRole:"summary",testID:n,children:[jsxRuntime.jsx(reactNative.View,{style:a.glyph,accessibilityElementsHidden:true,importantForAccessibility:"no"}),jsxRuntime.jsx(g,{style:a.title,children:s.title}),jsxRuntime.jsx(g,{style:a.body,children:t??s.body}),u!==null&&r?jsxRuntime.jsx(reactNative.Pressable,{onPress:r,disabled:i,accessibilityRole:"button",accessibilityLabel:i?Sr:u,accessibilityState:{disabled:i},style:[a.action,i?a.actionDisabled:null],testID:n?`${n}-action`:`records-empty-${e}-action`,children:jsxRuntime.jsx(g,{style:a.actionLabel,children:u})}):null]})}o(he,"RecordsEmptyState");function Mo(){let e=w();return react.useMemo(()=>Vo(e),[e])}o(Mo,"useStyles");function Vo(e){let{color:r,space:t,radius:n,type:a,slots:s}=e,l=t.lg+t.xs+t.xs/2;return reactNative.StyleSheet.create({container:{paddingVertical:t.xxl,paddingHorizontal:t.xl,alignItems:"center",gap:t.sm+t.xs/2},glyph:{width:l,height:l,borderRadius:l/2,backgroundColor:r.brandSoft,borderWidth:reactNative.StyleSheet.hairlineWidth,borderColor:r.brandBorder,marginBottom:t.xs},title:{...S(e,"bold"),fontSize:a.size.subtitle,lineHeight:Math.round(a.size.subtitle*a.lineHeight.snug)-1,color:r.brandInk,textAlign:"center"},body:{...S(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:t.sm,minHeight:t.xxl+t.sm,borderRadius:n.pill,paddingHorizontal:t.lg+t.xs/2,backgroundColor:r.brand,alignItems:"center",justifyContent:"center",...Q(s.primaryButton)},actionDisabled:{opacity:.5},actionLabel:{...S(e,"bold"),color:r.onPrimary,fontSize:a.size.bodyTight,lineHeight:Math.round(a.size.bodyTight*a.lineHeight.snug)-1,...J(s.primaryButton)}})}o(Vo,"makeStyles");var Ho=120,Wo=44;function $o({reason:e,onExit:r,exitLabel:t,style:n}){let{color:a,space:s,radius:l,type:c}=w();return jsxRuntime.jsxs(reactNative.View,{testID:"records-gate-off",style:[{minHeight:Ho,justifyContent:"center",gap:s.md,padding:s.lg,borderRadius:l.md,borderWidth:1,borderColor:a.brandBorder,backgroundColor:a.surfaceCream},n],children:[e.length>0?jsxRuntime.jsx(g,{style:{fontSize:c.size.bodyTight,color:a.text.muted},children:e}):null,jsxRuntime.jsx(reactNative.Pressable,{onPress:r,accessibilityRole:"button",accessibilityLabel:t,testID:"records-gate-off-exit",style:{minHeight:Wo,alignSelf:"flex-start",justifyContent:"center",paddingHorizontal:s.lg,borderRadius:l.pill,borderWidth:1.5,borderColor:a.brand},children:jsxRuntime.jsx(g,{style:{fontSize:c.size.body,color:a.brand},children:t})})]})}o($o,"RecordsGateOffState");function Fr(e,r){return e===void 0?{}:{renderDisabled:o(t=>jsxRuntime.jsx($o,{reason:t.disabled?.reason??"",onExit:e,exitLabel:r}),"renderDisabled")}}o(Fr,"recordsGateExit");var Je="Back";function ve({title:e,onBack:r,right:t,testID:n,variant:a="brand"}){let s=Qo();return jsxRuntime.jsxs(reactNative.View,{style:s.row,testID:n,children:[r?jsxRuntime.jsx(reactNative.Pressable,{onPress:r,accessibilityRole:"button",accessibilityLabel:Je,hitSlop:12,style:s.back,testID:n?`${n}-back`:void 0,children:jsxRuntime.jsx(reactNative.View,{style:s.chevron,accessibilityElementsHidden:true,importantForAccessibility:"no"})}):jsxRuntime.jsx(reactNative.View,{style:s.back}),jsxRuntime.jsx(g,{style:a==="document"?s.documentTitle:s.title,accessibilityRole:"header",numberOfLines:1,children:e}),jsxRuntime.jsx(reactNative.View,{style:s.right,children:t??jsxRuntime.jsx(reactNative.View,{style:s.back})})]})}o(ve,"ScreenHeader");function Qo(){let e=w();return react.useMemo(()=>Jo(e),[e])}o(Qo,"useStyles");function Jo(e){let{color:r,space:t,type:n}=e,a=t.xxl+t.md,s=t.md,l=t.xs/2,c=t.lg+t.xs+t.xs/2;return reactNative.StyleSheet.create({row:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:t.lg,paddingTop:t.xs,paddingBottom:t.md,gap:t.sm},back:{width:a,height:a,alignItems:"center",justifyContent:"center"},chevron:{width:s,height:s,borderLeftWidth:l,borderBottomWidth:l,borderColor:r.brandInk,transform:[{rotate:"45deg"}],marginLeft:t.xs},title:{flex:1,...S(e,"bold"),fontSize:n.size.heading,lineHeight:Math.round(n.size.heading*n.lineHeight.tight)+1,color:r.brandInk},documentTitle:{flex:1,textAlign:"center",...S(e,"bold"),fontSize:n.size.subtitle,lineHeight:Math.round(n.size.subtitle*n.lineHeight.snug),color:r.text.primary},right:{flexDirection:"row",alignItems:"center",gap:t.sm+t.xs/2},listGlyph:{width:c,height:c,justifyContent:"space-evenly"},listBar:{height:l,borderRadius:l,backgroundColor:r.brandInk},shareGlyph:{width:c-t.xs,height:c-t.xs},shareDot:{position:"absolute",width:t.xs+t.xs/2,height:t.xs+t.xs/2,borderRadius:t.xs,borderWidth:l,borderColor:r.brandInk},shareDotTop:{right:0,top:0},shareDotLeft:{left:0,top:t.xs+t.xs/2},shareDotBottom:{right:0,bottom:0},shareStroke:{position:"absolute",left:t.xs,top:t.sm,width:t.sm+t.xs/2,height:l,backgroundColor:r.brandInk},shareStrokeUp:{transform:[{rotate:"-30deg"}]},shareStrokeDown:{transform:[{rotate:"30deg"}]},sendGlyph:{width:c-t.xs,height:c-t.xs},sendBody:{position:"absolute",left:0,top:0,right:0,bottom:0,borderWidth:l,borderColor:r.brandInk,transform:[{rotate:"45deg"}],borderRadius:l},sendFold:{position:"absolute",left:0,right:0,top:"50%",height:l,backgroundColor:r.brandInk},downloadGlyph:{width:c-t.xs,height:c-t.xs,alignItems:"center"},downloadStem:{width:l,height:t.sm+t.xs/2,backgroundColor:r.brandInk},downloadHead:{width:t.sm,height:t.sm,borderRightWidth:l,borderBottomWidth:l,borderColor:r.brandInk,transform:[{rotate:"45deg"}],marginTop:-t.sm},downloadTray:{position:"absolute",bottom:0,left:0,right:0,height:t.xs+t.xs/2,borderLeftWidth:l,borderRightWidth:l,borderBottomWidth:l,borderColor:r.brandInk}})}o(Jo,"makeStyles");function G({width:e,height:r,radius:t,style:n}){let{color:a,radius:s}=w();return jsxRuntime.jsx(reactNative.View,{style:[{width:e,height:r,borderRadius:t??s.xs,backgroundColor:a.skeleton},n],accessibilityElementsHidden:true,importantForAccessibility:"no"})}o(G,"SkeletonBlock");var ti=44,ri=24,Ze=34,ni=6;function Pr({testID:e}){let r=oi();return jsxRuntime.jsxs(reactNative.View,{style:r.timeline,accessible:true,accessibilityRole:"progressbar",accessibilityLabel:b.loadingTimeline,testID:e,children:[jsxRuntime.jsx(reactNative.View,{style:r.timelineDisclaimer,children:jsxRuntime.jsx(G,{width:"100%",height:ti,radius:12})}),Array.from({length:ni},(t,n)=>jsxRuntime.jsxs(reactNative.View,{children:[n>0?jsxRuntime.jsx(reactNative.View,{style:r.timelineSeparator}):null,jsxRuntime.jsxs(reactNative.View,{style:r.timelineRow,children:[jsxRuntime.jsx(G,{width:Ze,height:Ze,radius:Ze/2}),jsxRuntime.jsxs(reactNative.View,{style:r.timelineBody,children:[jsxRuntime.jsxs(reactNative.View,{style:r.timelineTop,children:[jsxRuntime.jsx(G,{width:44,height:10,radius:5}),jsxRuntime.jsx(G,{width:56,height:12,radius:6})]}),jsxRuntime.jsx(G,{width:"70%",height:14,radius:7}),n%2===0?jsxRuntime.jsx(G,{width:"45%",height:12,radius:6}):null]})]})]},n))]})}o(Pr,"TimelineSkeleton");var et=62;function oi(){let e=w();return react.useMemo(()=>ii(e),[e])}o(oi,"useStyles");function ii(e){let{color:r,space:t,radius:n}=e,a=reactNative.StyleSheet.hairlineWidth;return reactNative.StyleSheet.create({dashboard:{flex:1,paddingHorizontal:t.sm,paddingTop:t.xs,gap:t.lg,backgroundColor:r.background},inset:{paddingHorizontal:t.sm},summaryCard:{alignItems:"center",borderRadius:n.lg-t.xs,borderWidth:a,borderColor:r.brandBorder,backgroundColor:r.surface,paddingHorizontal:t.lg,paddingVertical:t.lg+t.xs,gap:t.md+t.xs/2},badges:{flexDirection:"row",gap:t.md},carouselCard:{borderRadius:n.lg-t.xs,borderWidth:a,borderColor:r.brandBorder,backgroundColor:r.surface,padding:t.lg},dots:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:t.xs+t.xs/2},centered:{alignSelf:"center"},actions:{gap:t.sm+t.xs/2},actionRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",borderRadius:n.md,borderWidth:a,borderColor:r.brandBorder,backgroundColor:r.surface,paddingHorizontal:t.lg,paddingVertical:t.lg},actionLeft:{flex:1,flexDirection:"row",alignItems:"center",gap:t.md},request:{paddingHorizontal:t.lg,paddingTop:t.xs,gap:t.lg+t.xs/2,backgroundColor:r.background},railRow:{flexDirection:"row",alignItems:"flex-start",gap:t.md},railColumn:{alignItems:"center",width:ri},connector:{marginVertical:t.xs/2},railBody:{flex:1,paddingBottom:t.lg+t.xs/2,gap:t.xs+t.xs/2},statusCard:{borderRadius:n.md,backgroundColor:r.brandSoft,padding:t.md+t.xs/2,gap:t.sm},timeline:{flex:1,backgroundColor:r.background},timelineDisclaimer:{paddingHorizontal:t.lg,paddingTop:t.xs,paddingBottom:t.md},timelineRow:{flexDirection:"row",gap:t.md,paddingHorizontal:t.lg,paddingVertical:t.md+t.xs/2},timelineBody:{flex:1,gap:t.xs-1},timelineTop:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:t.sm},timelineSeparator:{height:a,backgroundColor:r.brandBorder,marginLeft:et},clinics:{gap:t.md},clinicRow:{borderRadius:n.lg-t.xs/2,borderWidth:a,borderColor:r.brandBorder,backgroundColor:r.surface,paddingHorizontal:t.md+t.xs/2,paddingVertical:t.md+t.xs/2,gap:t.sm},shares:{gap:t.md,padding:t.md,borderRadius:n.md,backgroundColor:r.surfaceCream,borderWidth:a,borderColor:r.brandBorder},shareRow:{gap:t.xs+t.xs/2}})}o(ii,"makeStyles");var ui=300,pi=o((e,r)=>e.getTimeline(r),"readTimeline"),yi=o(e=>e.isEmpty,"timelineEmpty"),fi=o((e,r)=>e.getRecordDepth(r),"readDepth"),mi=o(e=>!e.available||e.labResults.length+e.encounters.length+e.clinicianNotes.length+e.physicalExams.length===0,"depthEmpty"),gi=o(e=>e.contributions.length===0,"contributionsEmpty");function bi({petRef:e,style:r,onBack:t}){let n=ie(e,pi,yi);return jsxRuntime.jsx(rt,{state:n,style:r,onBack:t,header:jsxRuntime.jsx(ve,{title:b.timeline,onBack:Z(t),testID:"timeline-header"}),loading:jsxRuntime.jsx(Pr,{testID:"timeline-loading"}),empty:jsxRuntime.jsx(he,{variant:"no_records",testID:"timeline-empty"}),render:a=>jsxRuntime.jsx(Ei,{timeline:a})})}o(bi,"EverfurRecordsTimeline");function hi({petRef:e,style:r,onBack:t}){let n=ie(e,fi,mi);return jsxRuntime.jsx(rt,{state:n,style:r,onBack:t,header:t?jsxRuntime.jsx(ve,{title:U.records,onBack:Z(t)}):null,render:a=>jsxRuntime.jsx(wi,{depth:a})})}o(hi,"EverfurRecordDepth");function Ri({petRef:e,docId:r,style:t,onBack:n}){let a=react.useCallback((c,i)=>c.getDocumentContributions(i,r),[r]),s=ie(e,a,gi,r),l=s.value?.document?.title?.trim()||b.uploadedDocument;return jsxRuntime.jsx(rt,{state:s,style:t,onBack:n,header:jsxRuntime.jsx(ve,{title:l,onBack:Z(n),testID:"contributions-header"}),empty:jsxRuntime.jsx(he,{variant:"no_records",testID:"contributions-empty"}),render:c=>jsxRuntime.jsx(xi,{view:c})})}o(Ri,"EverfurDocumentContributions");function rt({state:e,style:r,header:t,loading:n,empty:a,render:s,onBack:l}){let c=Ee();return jsxRuntime.jsx(Rr,{capability:"records",style:r,...Fr(Z(l),Je),children:jsxRuntime.jsxs(reactNative.View,{style:[c.container,r],children:[t??null,jsxRuntime.jsx(reactNative.View,{style:c.body,children:vi(e,s,c,n,a)}),jsxRuntime.jsx(wr,{})]})})}o(rt,"DepthSurface");function vi(e,r,t,n,a){switch(e.status){case "loading":return n??jsxRuntime.jsx(_i,{styles:t});case "empty":return a??jsxRuntime.jsx(reactNative.View,{style:t.centered,accessible:true,accessibilityRole:"summary",accessibilityLabel:U.empty,children:jsxRuntime.jsx(reactNative.View,{style:t.emptyGlyph})});case "error":return e.error?jsxRuntime.jsx(he,{variant:ht(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:r(e.value);default:return null}}o(vi,"renderState");function _i({styles:e}){let[r,t]=react.useState(false);return react.useEffect(()=>{let n=setTimeout(()=>t(true),ui);return ()=>clearTimeout(n)},[]),jsxRuntime.jsx(reactNative.View,{style:e.centered,accessible:true,accessibilityState:{busy:true},accessibilityLabel:U.loading,children:r?jsxRuntime.jsx(reactNative.ActivityIndicator,{}):null})}o(_i,"LoadingState");function Ei({timeline:e}){let r=Ee(),t=Pe(e);return jsxRuntime.jsxs(reactNative.ScrollView,{style:r.list,contentContainerStyle:r.timelineContent,accessibilityLabel:b.timeline,children:[e.disclaimer.length>0?jsxRuntime.jsx(reactNative.View,{style:r.timelineBand,accessible:true,accessibilityRole:"text",accessibilityLabel:bt.important(e.disclaimer),children:jsxRuntime.jsx(g,{style:r.timelineBandText,children:e.disclaimer})}):null,t.map((n,a)=>jsxRuntime.jsxs(reactNative.View,{children:[a>0?jsxRuntime.jsx(reactNative.View,{style:r.timelineSeparator}):null,jsxRuntime.jsxs(reactNative.View,{style:r.timelineRow,accessible:true,accessibilityRole:"text",accessibilityLabel:[n.kindLabel,n.date,n.title,n.detail].filter(Boolean).join(", "),testID:`records-timeline-row-${n.kind}`,children:[jsxRuntime.jsx(reactNative.View,{style:r.timelineBubble,accessibilityElementsHidden:true,importantForAccessibility:"no"}),jsxRuntime.jsxs(reactNative.View,{style:r.timelineBody,children:[jsxRuntime.jsxs(reactNative.View,{style:r.topLine,children:[jsxRuntime.jsx(g,{style:r.timelineKind,children:n.kindLabel}),jsxRuntime.jsx(g,{style:r.date,children:n.date})]}),jsxRuntime.jsx(g,{style:r.timelineTitle,children:n.title}),n.detail?jsxRuntime.jsx(g,{style:r.rowDetail,children:n.detail}):null]})]})]},n.key))]})}o(Ei,"TimelineBody");function _e({title:e,count:r,styles:t}){return jsxRuntime.jsx(g,{style:t.heading,accessibilityRole:"header",children:`${e} (${r})`})}o(_e,"SectionHeader");function wi({depth:e}){let r=Ee();return jsxRuntime.jsxs(reactNative.ScrollView,{style:r.list,contentContainerStyle:r.listContent,accessibilityLabel:U.records,children:[e.labResults.length>0?jsxRuntime.jsxs(reactNative.View,{style:r.section,children:[jsxRuntime.jsx(_e,{title:b.labResults,count:e.labResults.length,styles:r}),jsxRuntime.jsx(reactNative.View,{style:r.card,children:e.labResults.map(t=>{let n=wt(t.latest.status),a=St(t.latest.at,t.trajectory,t.points.length);return jsxRuntime.jsxs(reactNative.View,{style:r.row,accessible:true,accessibilityRole:"text",accessibilityLabel:[t.name,Ie(t.latest.value,t.latest.unit,t.latest.qualitativeResult),n.label,a].filter(Boolean).join(", "),children:[jsxRuntime.jsx(g,{style:r.rowTitle,children:t.name}),jsxRuntime.jsx(g,{style:r.rowValue,children:Ie(t.latest.value,t.latest.unit,t.latest.qualitativeResult)}),a?jsxRuntime.jsx(g,{style:r.rowDetail,children:a}):null,jsxRuntime.jsx(g,{style:[r.chip,n.outOfRange?r.chipCritical:r.chipNeutral],children:n.label}),t.meaning?jsxRuntime.jsx(g,{style:r.rowDetail,children:t.meaning}):null]},t.markerId)})})]}):null,e.encounters.length>0?jsxRuntime.jsxs(reactNative.View,{style:r.section,children:[jsxRuntime.jsx(_e,{title:b.visits,count:e.encounters.length,styles:r}),jsxRuntime.jsx(reactNative.View,{style:r.card,children:e.encounters.map(t=>{let n=[t.date?O(t.date):null,t.clinicName,t.veterinarian].filter(a=>a&&a!=="-").join(" \xB7 ");return jsxRuntime.jsxs(reactNative.View,{style:r.row,accessible:true,accessibilityRole:"text",children:[jsxRuntime.jsx(g,{style:r.rowTitle,children:t.type?ye(t.type):b.visit}),n?jsxRuntime.jsx(g,{style:r.rowDetail,children:n}):null]},t.encounterId)})})]}):null,e.physicalExams.length>0?jsxRuntime.jsxs(reactNative.View,{style:r.section,children:[jsxRuntime.jsx(_e,{title:b.physicalExams,count:e.physicalExams.length,styles:r}),e.physicalExams.map(t=>jsxRuntime.jsxs(reactNative.View,{style:r.card,children:[jsxRuntime.jsx(g,{style:r.rowTitle,accessibilityRole:"header",children:t.observedOn?O(t.observedOn):b.exam}),t.systems.map(n=>{let a=n.findingStatus==="abnormal",s=a?b.abnormal:n.findingStatus==="not_examined"?b.notExamined:b.normal;return jsxRuntime.jsxs(reactNative.View,{style:r.row,accessible:true,accessibilityRole:"text",accessibilityLabel:[Fe(n.system),s,a?n.finding:null].filter(Boolean).join(", "),children:[jsxRuntime.jsx(g,{style:r.rowTitle,children:Fe(n.system)}),a&&n.finding?jsxRuntime.jsx(g,{style:r.rowDetail,children:n.finding}):null,jsxRuntime.jsx(g,{style:[r.chip,a?r.chipCaution:r.chipNeutral],children:s})]},n.system)})]},t.examId))]}):null,e.clinicianNotes.length>0?jsxRuntime.jsxs(reactNative.View,{style:r.section,children:[jsxRuntime.jsx(_e,{title:b.visitNotes,count:e.clinicianNotes.length,styles:r}),e.clinicianNotes.map(t=>jsxRuntime.jsxs(reactNative.View,{style:r.card,children:[jsxRuntime.jsx(g,{style:r.rowTitle,accessibilityRole:"header",children:t.observedOn?O(t.observedOn):b.visitNote}),t.sections.map((n,a)=>jsxRuntime.jsxs(reactNative.View,{style:r.row,accessible:true,accessibilityRole:"text",children:[jsxRuntime.jsx(g,{style:r.kindLabel,children:xt(n.section)}),jsxRuntime.jsx(g,{style:n.text?r.rowDetail:r.rowMuted,children:n.text||b.notRecorded})]},`${n.section}:${a}`))]},t.noteId))]}):null]})}o(wi,"DepthBody");function xi({view:e}){let r=Ee();return jsxRuntime.jsxs(reactNative.ScrollView,{style:r.list,contentContainerStyle:r.listContent,accessibilityLabel:U.records,children:[e.document?.receivedAt?jsxRuntime.jsx(g,{style:r.rowDetail,children:O(e.document.receivedAt)}):null,jsxRuntime.jsx(reactNative.View,{style:r.card,children:e.contributions.map(t=>jsxRuntime.jsxs(reactNative.View,{style:r.row,accessible:true,accessibilityRole:"text",children:[jsxRuntime.jsx(g,{style:r.rowTitle,children:t.label}),jsxRuntime.jsx(g,{style:r.rowValue,children:vt(t.value,t.unit)}),t.observedAt?jsxRuntime.jsx(g,{style:r.rowDetail,children:O(t.observedAt)}):null]},t.key))})]})}o(xi,"ContributionsBody");function Ee(){let e=w();return react.useMemo(()=>Ci(e),[e])}o(Ee,"useStyles");function Ci(e){let{color:r,space:t,radius:n,type:a,slots:s}=e,{size:l,lineHeight:c}=a,i=o((I,z)=>Math.round(I*z),"lh"),u=reactNative.StyleSheet.hairlineWidth,y=t.xxl*3+t.xl,_=t.xxl+t.md,h=e.brightness==="dark"?r.errorRed:r.danger,E=J(s.recordCard),C=o((I,z,P,Y="regular")=>({...S(e,Y),fontSize:I,lineHeight:i(I,z),color:P}),"text"),k=o((I,z,P,Y="regular")=>({...C(I,z,P,Y),...E}),"inCard");return reactNative.StyleSheet.create({container:{flex:1,minHeight:y,backgroundColor:r.background},body:{flex:1},centered:{minHeight:y,flexGrow:1,alignItems:"center",justifyContent:"center",padding:t.xl,gap:t.lg},emptyGlyph:{width:t.xxl+t.sm,height:t.xxl+t.sm,borderRadius:n.lg,backgroundColor:r.brandSoft,borderWidth:u,borderColor:r.brandBorder},errorText:{...C(l.subtitle,c.snug,h),textAlign:"center",marginBottom:t.md},primaryButton:{minHeight:_,minWidth:_,alignItems:"center",justifyContent:"center",paddingHorizontal:t.xl,paddingVertical:t.md,borderRadius:n.pill,backgroundColor:r.primary,...Q(s.primaryButton)},primaryLabel:{...S(e,"bold"),color:r.onPrimary,fontSize:l.body,...J(s.primaryButton)},list:{flex:1},listContent:{padding:t.lg,gap:t.md},section:{gap:t.sm},heading:{...C(l.heading,c.snug,r.text.primary,"bold")},card:{gap:t.sm,padding:t.md,borderRadius:n.md,backgroundColor:r.surfaceCream,borderWidth:u,borderColor:r.brandBorder,...Q(s.recordCard,u)},row:{gap:t.xs,paddingVertical:t.xs,borderBottomWidth:u,borderBottomColor:r.borderHairlineGreen},topLine:{flexDirection:"row",justifyContent:"space-between",gap:t.md},kindLabel:{...k(l.caption,c.normal,r.text.muted,"medium")},date:k(l.caption,c.normal,r.text.muted),rowTitle:{...k(l.body,c.normal,r.text.primary,"bold")},rowValue:{...k(l.body,c.normal,r.text.primary,"medium")},rowDetail:k(l.bodyTight,c.normal,r.text.muted),rowMuted:{...k(l.bodyTight,c.normal,r.text.muted),opacity:.7},chip:{...C(l.caption,c.normal,r.text.primary),alignSelf:"flex-start",paddingHorizontal:t.sm,paddingVertical:t.xs,borderRadius:n.pill},chipNeutral:{backgroundColor:r.badgeBgNeutral},chipCaution:{backgroundColor:r.badgeBgCaution},chipCritical:{backgroundColor:r.badgeBgCritical},disclaimer:{...C(l.caption,c.normal,r.text.muted),marginTop:t.md},timelineContent:{paddingBottom:t.xxl},timelineBand:{flexDirection:"row",gap:t.sm,borderRadius:n.md-t.xs/2,padding:t.md,backgroundColor:r.brandSoft,marginHorizontal:t.lg,marginTop:t.xs,marginBottom:t.md},timelineBandText:{flex:1,...C(l.caption,c.normal,r.text.secondary)},timelineSeparator:{height:u,backgroundColor:r.brandBorder,marginLeft:et},timelineRow:{flexDirection:"row",gap:t.md,paddingHorizontal:t.lg,paddingVertical:t.md+t.xs/2},timelineBubble:{width:t.xxl+t.xs/2,height:t.xxl+t.xs/2,borderRadius:n.pill,backgroundColor:r.brandSoft,borderWidth:u,borderColor:r.brandBorder},timelineBody:{flex:1,gap:t.xs-1},timelineKind:{...S(e,"mono"),fontSize:l.micro,lineHeight:l.bodyTight,letterSpacing:a.letterSpacing.eyebrow/3,textTransform:"uppercase",color:r.text.secondary},timelineTitle:{...C(l.body,c.normal,r.text.primary,"medium")}})}o(Ci,"makeStyles");
2
- exports.EverfurDocumentContributions=Ri;exports.EverfurRecordDepth=hi;exports.EverfurRecordsTimeline=bi;exports.buildTimelineRows=Pe;exports.mapDocumentContributions=ir;exports.mapRecordDepth=nr;exports.mapRecordsTimeline=or;exports.useEverfurRecordsDepthClient=yr;exports.useRecordsDepthRead=ie;
1
+ 'use strict';var react=require('react'),reactNative=require('react-native'),zod=require('zod'),jsxRuntime=require('react/jsx-runtime');var Nr=Object.defineProperty;var o=(e,r)=>Nr(e,"name",{value:r,configurable:true});function Oe(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let r of Object.keys(e))Oe(e[r]);}return e}o(Oe,"deepFreeze");var Lr=Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3}),st={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},lt={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},at={nano:8,small:9,micro:10,tiny:11,caption:12,bodyTight:13,body:14,subtitle:16,heading:18,verdict:24},Mr={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},Vr={regular:"400",medium:"500",bold:"700"},qr={eyebrow:1,monoWide:.9,headerBrand:-0.42,tight:-0.35},Br=0,pe="System",ye="monospace",Ur=["content","heading","control","compact","badge"];function Hr(e){let r={};for(let t of Ur)r[t]=e;return r}o(Hr,"authoredTierSizes");function dt(){return {family:pe,mono:ye,fontUrl:null,families:{regular:pe,medium:pe,bold:pe,mono:ye,monoMedium:ye,monoBold:ye},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:at,tierSizes:Hr(at),lineHeight:Mr,weight:Vr,letterSpacing:qr,scale:1,maxScale:Br,scaleCaps:Lr}}o(dt,"baseType");var ct={},Te=Object.freeze({standard:Object.freeze([.2,0,0,1]),emphasized:Object.freeze([.2,.8,.2,1]),exit:Object.freeze([.4,0,1,1])});function ke(e){return `cubic-bezier(${e.join(", ")})`}o(ke,"cssCubicBezier");var ut={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:ke(Te.standard),emphasized:ke(Te.emphasized),exit:ke(Te.exit)},reducedMotion:false},Wr={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:"#FDFBF8",surfaceSubtle:"#EFE9E3",background:"#FFFFFF",borderRingCream:"#D8D2C8",chatGround:"#FFFFFF",composerFill:"#FDFBF8",composerBorder:"rgba(16,70,46,0.75)",shadow:"#0B3421",text:{primary:"#111111",secondary:"#0E462E",muted:"#6E6660",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:"#B91C1C",errorRed:"#FF1B00",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(185,28,28,0.12)",badgeBgNeutral:"rgba(110,102,96,0.12)",bubbleUser:"#10462E",bubbleAssistant:"#FFFFFF",skeleton:"#EFE9E3",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.10)",checkupCardConcernBg:"rgba(239,167,0,0.10)"},pt=Oe({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:Wr,space:st,radius:lt,type:dt(),motion:ut,slots:ct}),$r={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:"#9A938C",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",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",skeleton:"#23272C",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.16)",checkupCardConcernBg:"rgba(239,167,0,0.16)"};Oe({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:$r,space:st,radius:lt,type:dt(),motion:ut,slots:ct});var yt=Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),ft=globalThis,Fe=ft[yt]??(ft[yt]=react.createContext(pt));Fe.displayName??="EverfurThemeContext";function w(){return react.useContext(Fe)}o(w,"useEverfurTheme");function Jr(e,r){let t=e.scaleCaps[r];return t>0?t:void 0}o(Jr,"tierMultiplier");function g({tier:e="content",...r}){let{type:t}=w(),n=Jr(t,e);return react.createElement(reactNative.Text,n===void 0?r:{maxFontSizeMultiplier:n,...r})}o(g,"Text");react.forwardRef(o(function(r,t){return react.createElement(reactNative.TextInput,{...r,...t===null?{}:{ref:t}})},"TextInput"));function J(e,r){if(e===void 0)return {};let t={};return e.backgroundColor!==void 0&&(t.backgroundColor=e.backgroundColor),e.borderColor!==void 0&&(t.borderColor=e.borderColor,t.borderWidth=r??1),e.borderRadius!==void 0&&(t.borderRadius=e.borderRadius),t}o(J,"slotBox");function Z(e){return e?.textColor===void 0?{}:{color:e.textColor}}o(Z,"slotText");var Zr=Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});function S(e,r){let t=e.type,n=t.families[r];return r==="mono"||t.namedFaces[r]?{fontFamily:n}:{fontFamily:n,fontWeight:t.weight[Zr[r]]}}o(S,"face");function gt(e){let r=globalThis.console;try{r?.error?.("[everfur] A host callback threw; the SDK ignored it.",e);}catch{}}o(gt,"reportHostFailure");function en(e){return (typeof e=="object"||typeof e=="function")&&e!==null&&typeof e.then=="function"}o(en,"isThenable");function tn(e,...r){if(typeof e=="function")try{let t=e(...r);return en(t)&&Promise.resolve(t).then(void 0,gt),t}catch(t){gt(t);return}}o(tn,"callHost");var bt=new WeakMap;function ee(e){if(typeof e!="function")return;let r=bt.get(e);if(r!==void 0)return r;let t=o((...n)=>{tn(e,...n);},"guarded");return bt.set(e,t),t}o(ee,"guardHost");var W=Object.freeze({loading:"Loading",empty:"No records yet",upload:"Upload records",consentRequired:"Consent required",allow:"Allow",sessionRequired:"Sign in required",recordUnavailable:"Record unavailable",retry:"Try again",records:"Records",beingReviewed:"being reviewed"});var rn="your pet";function V(e){let r=e?.trim()??"";return r.length>0?r:rn}o(V,"petNameOr");var ht=Object.freeze({title:"Health records",openTimeline:"Open timeline",loading:"Loading health records",lead:o(e=>`${V(e)}\u2019s lab trends`,"lead"),retryMarkers:"Retry loading lab trends",viewFullRecord:"View full medical record",viewTimeline:"View full timeline",important:o(e=>`Important: ${e}`,"important")});Object.freeze({title:"Marker Summary",marker:"Marker",markers:"Markers",outOfRange:"OUT OF RANGE",inRange:"IN RANGE",noRange:"NO RANGE",subtitle:"Summary of your pet\u2019s biomarkers",ask:"Ask about these markers",askA11y:"Ask Everfur about these markers",a11y:o((e,r,t,n)=>`Marker summary: ${e} ${e===1?"marker":"markers"}, ${r} in range, ${t} out of range${n>0?`, ${n} without a range`:""}.`,"a11y")});Object.freeze({counter:o((e,r)=>`${e+1} of ${r}`,"counter"),a11y:o((e,r,t)=>e!==null?`${e}, marker ${r+1} of ${t}. Swipe left or right to see more markers.`:`Marker ${r+1} of ${t}`,"a11y")});Object.freeze({tapHint:"Tap a point to see where it came from.",singleHint:"One reading so far: we\u2019ll plot a trend as more come in.",empty:"No readings for this marker yet.",ask:"Ask about this marker",askA11y:o(e=>`Ask Everfur about ${e}`,"askA11y"),status:o(e=>`Status: ${e}`,"status"),latestA11y:o((e,r,t)=>`Latest reading ${e}, ${r}, collected ${t}`,"latestA11y"),readingsA11y:o(e=>`${e} readings, oldest to newest`,"readingsA11y")});Object.freeze({title:o(e=>`${V(e)}\u2019s records request`,"title"),body:o(e=>`We\u2019re requesting ${V(e)}\u2019s records from your vet. This usually takes a few days; we\u2019ll show lab trends here as soon as they arrive.`,"body"),a11y:o(e=>`Records request in progress for ${V(e)}.`,"a11y"),openA11y:o((e,r)=>`Open ${V(e)}\u2019s records request. ${r}`,"openA11y"),ask:"Ask about this request",askA11y:"Ask Everfur about this records request"});Object.freeze({title:o(e=>`Add ${V(e)}\u2019s records`,"title"),body:"Records can come from more than one clinic over a lifetime.",requestFromClinic:"Request from a clinic",requestFromClinicA11y:o(e=>`Request ${V(e)}\u2019s records from a clinic`,"requestFromClinicA11y"),uploadDocument:"Upload a document",uploadDocumentA11y:o(e=>`Upload one of ${V(e)}\u2019s records`,"uploadDocumentA11y")});function Rt(e){return e?.httpStatus===429?"rate_limited":e?.httpStatus===502?"service_unavailable":"error"}o(Rt,"recordsEmptyVariantForError");function _t(e,r){return e===null?"":r?`${e} ${r}`:e}o(_t,"formatEntityValue");var vt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function O(e){if(!e)return "-";let r=/^(\d{4})-(\d{2})-(\d{2})/.exec(e);if(r!==null){let a=vt[Number(r[2])-1];return a===void 0?"-":`${a} ${Number(r[3])}, ${r[1]}`}let t=Date.parse(e);if(Number.isNaN(t))return "-";let n=new Date(t);return `${vt[n.getUTCMonth()]} ${n.getUTCDate()}, ${n.getUTCFullYear()}`}o(O,"formatRecordsDate");var b=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:o(e=>`Measured ${e}`,"measured"),uploadedDocument:"Uploaded document",kind:Object.freeze({visit:"Visit",vaccine:"Vaccine",weight:"Weight",medication:"Medication"}),clinicVisit:"Clinic visit",doctor:o(e=>`Dr. ${e}`,"doctor"),lot:o(e=>`Lot ${e}`,"lot"),expires:o(e=>`Expires ${e}`,"expires")});function xt(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}}}o(xt,"markerStatusLabel");function nn(e,r){return r<2?null:`${e==="flat"?"Holding steady":`Trending ${e==="down"?"down":e==="up"?"up":"steady"}`} over ${r} visits`}o(nn,"trajectoryLabel");function fe(e){let r=e.replace(/_/g," ").trim();return r.length===0?e:r.charAt(0).toUpperCase()+r.slice(1)}o(fe,"humanize");var Et=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 Ie(e){return Object.prototype.hasOwnProperty.call(Et,e)?Et[e]:fe(e)}o(Ie,"bodySystemLabel");var wt=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(wt,e)?wt[e]:fe(e)}o(Ct,"soapSectionLabel");function St(e){return e===null||!Number.isFinite(e)?"-":`${e.toFixed(3).replace(/\.?0+$/,"")} kg`}o(St,"formatWeightKg");function De(e,r,t){if((e===null||!Number.isFinite(e))&&t)return t;if(e===null||!Number.isFinite(e))return "-";let n=e.toFixed(3).replace(/\.?0+$/,"");return r?`${n} ${r}`:n}o(De,"formatMarkerReading");function Tt(e,r,t){let n=nn(r,t);return e?`${b.measured(O(e))}${n?` \xB7 ${n}`:""}`:n}o(Tt,"labDetailLine");var me=Object.freeze({visit:0,vaccine:1,weight:2,medication:3});function kt(e){if(!e)return null;let r=Date.parse(e);return Number.isNaN(r)?null:r}o(kt,"toMillis");function Pe(e){let r=[...e.visits.map((t,n)=>({key:`visit-${n}-${t.visitId}`,kind:"visit",kindLabel:b.kind.visit,at:t.visitDate,date:O(t.visitDate),title:t.summary??b.clinicVisit,detail:t.veterinarian?b.doctor(t.veterinarian):null,docId:t.docId})),...e.vaccines.map((t,n)=>{let a=[];return t.lot&&a.push(b.lot(t.lot)),t.expiresOn&&a.push(b.expires(O(t.expiresOn))),{key:`vaccine-${n}-${t.vaccineId}`,kind:"vaccine",kindLabel:b.kind.vaccine,at:t.administeredOn,date:O(t.administeredOn),title:t.product||b.kind.vaccine,detail:a.length?a.join(" \xB7 "):null,docId:t.docId}}),...e.weights.map((t,n)=>({key:`weight-${n}-${t.weightId}`,kind:"weight",kindLabel:b.kind.weight,at:t.observedOn,date:O(t.observedOn),title:St(t.weightKg),detail:null,docId:t.docId})),...e.medications.map((t,n)=>{let a=[t.dose,t.route,t.frequency].filter(l=>!!l);return {key:`medication-${n}-${t.medicationId}`,kind:"medication",kindLabel:b.kind.medication,at:t.startedOn,date:O(t.startedOn),title:t.drugName||b.kind.medication,detail:a.length?a.join(" \xB7 "):null,docId:t.docId}})];return Object.freeze(r.sort((t,n)=>{let a=kt(t.at),l=kt(n.at);return a===null&&l===null?me[t.kind]-me[n.kind]:a===null?1:l===null?-1:l!==a?l-a:me[t.kind]-me[n.kind]}))}o(Pe,"buildTimelineRows");var Ae=Object.freeze([Object.freeze({wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"AuthorizationException",envelope:"http_envelope",httpStatus:401,retryable:false}),Object.freeze({wireCode:"ConflictException",envelope:"http_envelope",httpStatus:409,retryable:true}),Object.freeze({wireCode:"DAILY_QUOTA_EXCEEDED",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"FILE_TOO_LARGE",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"IDEMPOTENCY_KEY_IN_FLIGHT",envelope:"http_envelope",httpStatus:409,retryable:true}),Object.freeze({wireCode:"IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"INVALID_CONTENT_TYPE",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"InternalFailureException",envelope:"http_envelope",httpStatus:500,retryable:true}),Object.freeze({wireCode:"MethodNotAllowedException",envelope:"http_envelope",httpStatus:405,retryable:false}),Object.freeze({wireCode:"NotImplementedException",envelope:"http_envelope",httpStatus:501,retryable:false}),Object.freeze({wireCode:"PaymentRequiredException",envelope:"http_envelope",httpStatus:402,retryable:false}),Object.freeze({wireCode:"ResourceNotFoundException",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"ServiceUnavailableException",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"TIER_UPGRADE_REQUIRED",envelope:"http_envelope",httpStatus:402,retryable:false}),Object.freeze({wireCode:"ThrottlingException",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"ValidationException",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"accessDenied",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"access_denied",envelope:"oauth_error",httpStatus:302,retryable:false}),Object.freeze({wireCode:"attachment_unreadable",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"authExpired",envelope:"http_envelope",httpStatus:401,retryable:true}),Object.freeze({wireCode:"authRejected",envelope:"http_envelope",httpStatus:401,retryable:false}),Object.freeze({wireCode:"consent_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"consent_required",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"consent_scope_wrong_route",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"device_cipher_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"email_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"event_cursor_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_payload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_type_not_available",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_type_unknown",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_required",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_reused",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"insufficientCapability",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"insufficient_scope",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"internal_error",envelope:"sse_frame",httpStatus:200,retryable:false}),Object.freeze({wireCode:"invalidRequest",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_client",envelope:"oauth_error",httpStatus:401,retryable:false}),Object.freeze({wireCode:"invalid_client_metadata",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_grant",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_redirect_uri",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_request",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_scope",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_target",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"mcp_connection_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"mcp_request_conflict",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"mcp_request_gone",envelope:"http_envelope",httpStatus:410,retryable:false}),Object.freeze({wireCode:"mcp_request_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"not_found",envelope:"sse_frame",httpStatus:200,retryable:false}),Object.freeze({wireCode:"partner_visit_link_conflict",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"partner_visit_owner_only",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"partner_visit_pet_already_mapped",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"payload_too_large",envelope:"http_envelope",httpStatus:413,retryable:false}),Object.freeze({wireCode:"petRefInUse",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"pet_health_list_removals_unconfirmed",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"pet_health_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"pet_not_registered",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"provider_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"rateLimited",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"record_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"record_subject_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"record_upload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"records_consent_required",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"sandbox_only",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"session_required",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"share_limit_reached",envelope:"http_envelope",httpStatus:429,retryable:false}),Object.freeze({wireCode:"slow_down",envelope:"oauth_error",httpStatus:429,retryable:true}),Object.freeze({wireCode:"species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"tenant_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"tenant_has_no_capabilities",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"tenant_resource_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"tenant_surface_not_enabled",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"timeout",envelope:"sse_frame",httpStatus:200,retryable:true}),Object.freeze({wireCode:"token_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"unavailable",envelope:"sse_frame",httpStatus:200,retryable:true}),Object.freeze({wireCode:"unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"unsupported_grant_type",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"unsupported_response_type",envelope:"oauth_error",httpStatus:302,retryable:false}),Object.freeze({wireCode:"verify_mint_rate_limited",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"verify_mint_refused",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"verify_mint_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"verify_user_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"webhook_endpoint_update_empty",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"webhook_endpoint_update_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false})]);Object.freeze(Ae.map(e=>e.wireCode));var on=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",accessDenied:"accessDenied",invalidRequest:"sdkUpdateRequired",authRejected:"authRejected",rateLimited:"rateLimited",insufficientCapability:"accessDenied",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"}),Ft=Object.freeze(Ae.map(e=>Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:on[e.wireCode]}))),an=new Map(Ft.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),sn=Object.freeze(["http_envelope",...[...new Set(Ft.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function ge(e,r){if(typeof e!="string")return;let t=e.trim().toUpperCase();if(t.length!==0)for(let n of [r??"http_envelope",...sn]){let a=an.get(n+t);if(a)return a}}o(ge,"contractErrorFor");function ln(e){return e.envelope==="sse_frame"?`/errors#sse-${e.wireCode}`:e.envelope==="oauth_error"?`/errors#oauth-${e.wireCode}`:`/errors#${e.wireCode}`}o(ln,"contractDocUrl");function It(e){return null}o(It,"publishedDocUrl");var dn=Object.freeze({authExpired:"authentication",authRejected:"authentication",sessionRequired:"authentication",accessDenied:"authorization",paymentRequired:"entitlement",quotaExceeded:"rateLimit",rateLimited:"rateLimit",validationFailed:"invalidRequest",sdkUpdateRequired:"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 Dt(e){return dn[e]}o(Dt,"categoryFor");function Pt(e){let r=ge(e);if(r)return r.normalized;let t=(e??"").trim().toUpperCase(),n=t.replace(/[^A-Z0-9]/g,"");if(n==="AUTHREJECTED")return "authRejected";if(t.startsWith("AUTH"))return "authExpired";switch(n){case "DAILYQUOTAEXCEEDED":case "QUOTAEXCEEDED":return "quotaExceeded";case "RATELIMITED":case "TOOMANYREQUESTS":return "rateLimited";case "IDEMPOTENCYKEYCONFLICT":case "IDEMPOTENCYCONFLICT":return "idempotencyConflict";case "ACCESSDENIED":case "FORBIDDEN":return "accessDenied";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"}}o(Pt,"fromWire");var cn=new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function je(e){return cn.has(e)}o(je,"isAutoRetryable");var un=new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function At(e){return je(e)||un.has(e)}o(At,"isRetryableCode");var pn=500,ze=8e3,jt=4;function zt(e,r=Math.random){let t=Math.max(0,e),n=Math.min(pn*2**t,ze);return Math.floor(r()*n)}o(zt,"backoffDelayMs");var yn=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:"This feature isn't available on your account right now.",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:"Something in that request was not right. Check the details and try again.",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.",unknown:"Something went wrong. Please try again."});function Ne(e){return yn[e]}o(Ne,"userFacingError");function Nt(e,r,t){Object.defineProperty(e,r,{value:t,enumerable:false,writable:false,configurable:false});}o(Nt,"defineHidden");var fn=/^[a-z][a-z0-9_]{0,63}$/;function q(e,r){let t=ge(r?.wireCode,r?.wireEnvelope),n={code:e,category:Dt(e),retryable:r?.retryable??At(e),displayMessage:Ne(e)};if(r?.httpStatus!==void 0&&(n.httpStatus=r.httpStatus),r?.requestId&&(n.requestId=r.requestId),typeof r?.reasonCode=="string"&&fn.test(r.reasonCode)&&(n.reasonCode=r.reasonCode),t);return r?.wireMessage&&Nt(n,"wireMessage",r.wireMessage),r?.raw!==void 0&&r.raw!==null&&Nt(n,"raw",r.raw),Object.freeze(n)}o(q,"makeEverfurError");function $(e,r){return Object.freeze(r===void 0?{ok:true,value:e}:{ok:true,value:e,warning:r})}o($,"ok");function F(e){return Object.freeze({ok:false,error:e})}o(F,"err");var be=class be extends Error{constructor(r,t){super(t),this.name="EverfurConfigError",this.kind=r,Object.setPrototypeOf(this,be.prototype);}};o(be,"EverfurConfigError");var te=be;function Lt(e){throw new Error(`assertNever: unhandled discriminated-union member ${JSON.stringify(e)}`)}o(Lt,"assertNever");function Mt(e){return Object.freeze({kind:"error",terminal:true,code:e.code,retryable:e.retryable,wireMessage:e.wireMessage,synthesized:e.synthesized,lastEventId:e.lastEventId,serverRequestId:e.serverRequestId??null})}o(Mt,"errorFrame");function bn(e){let r={};return e.mode==="personalized"?r.authorization=`Bearer ${e.token}`:r["x-everfur-partner-key"]=e.publishableKey,e.userRef&&(r["x-everfur-user-ref"]=e.userRef),e.sessionId&&(r["x-everfur-session-id"]=e.sessionId),r}o(bn,"authHeaders");function re(e,r){return {...e,headers:{...hn(e.headers),...bn(r)}}}o(re,"withAuthHeaders");function hn(e){if(!e)return {};let r={};for(let[t,n]of Object.entries(e)){let a=t.toLowerCase();a==="authorization"||a==="x-everfur-partner-key"||(r[t]=n);}return r}o(hn,"stripAuthHeaders");async function Vt(e,r){if(r.mode==="anonymous")return r.transport.request(re(e,{mode:"anonymous",publishableKey:r.publishableKey,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));let t;try{t=await r.identity.currentToken();}catch{return F(Le())}let n=await r.transport.request(re(e,{mode:"personalized",token:t,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));if(n.ok||n.error.httpStatus!==401)return n;let a;try{a=await r.identity.currentToken({forceRefresh:!0});}catch{return F(Le())}let l=await r.transport.request(re(e,{mode:"personalized",token:a,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));return !l.ok&&l.error.httpStatus===401?F(Le(l.error.httpStatus)):l}o(Vt,"authedSend");function Le(e){return q("authRejected",{retryable:false,...e!==void 0?{httpStatus:e}:{}})}o(Le,"authRejectedError");function qt(e){return q("internalError",{retryable:true,wireMessage:Rn(e)})}o(qt,"networkError");function Rn(e){return e instanceof Error?e.message:typeof e=="string"?e:"network request failed"}o(Rn,"describeCause");var vn=3e4,_n=ze*2,En="idempotency-key",wn=new Set(["POST","PUT","PATCH","DELETE"]),xn=Object.freeze({onEvent(){}}),Cn=Object.freeze({setTimeout:o((e,r)=>setTimeout(e,r),"setTimeout"),clearTimeout:o(e=>clearTimeout(e),"clearTimeout"),now:o(()=>Date.now(),"now")});function Sn(e){let r=e.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return r.length===0?null:`efs_${r}`.slice(0,128)}o(Sn,"seededIdempotencyKey");function Ut(e){let r=e.observer??xn,t=e.timers??Cn,n=e.rng??Math.random,a=e.sleep??((h,E)=>Mn(h,t,E)),l=e.maxAttempts??jt,s=e.unaryTimeoutMs??vn,c=e.newIdempotencyKey??kn(),i=o(h=>{try{r.onEvent(h);}catch{}},"emit");async function u(h,E,C){let k=C?.maxAttempts,I=Math.max(1,k??l),j=C?.idempotent??wn.has(E.method),z=C?.idempotencyKey===void 0?null:Sn(C.idempotencyKey),H=j?z??c():null,zr=Tn(E,H),xe=0;for(;;){let X=o(Se=>Object.freeze({call:h,method:E.method,path:E.path,attempt:xe,...H?{idempotencyKey:H}:{},...Se}),"stamp");i(X({phase:"attempt"}));let ot=Nn(s,t),it=Ln(ot.signal,E.signal),Q;try{Q=await Vt({...zr,signal:it.signal},e.auth);}catch(Se){Q=F(qt(Se));}finally{it.dispose(),ot.cancel();}if(Q.ok)return i(X({phase:"settled",ok:true,reason:"ok"})),Q;let M=Q.error,ue=Fn(M,xe,{maxAttempts:I,rng:n,now:t.now(),aborted:E.signal?.aborted===true,...k!==void 0?{perCallMaxAttempts:k}:{},...e.errorPolicy!==void 0?{policy:e.errorPolicy}:{}}),Ce={ok:false,code:M.code,reason:ue.reason,...M.httpStatus!==void 0?{httpStatus:M.httpStatus}:{},...M.requestId!==void 0?{requestId:M.requestId}:{}};if(!ue.retry)return i(X({phase:"settled",...Ce})),F(M);if(i(X({phase:"retry",...Ce,delayMs:ue.delayMs})),await a(ue.delayMs,E.signal),E.signal?.aborted===true)return i(X({phase:"settled",...Ce,reason:"aborted"})),F(M);xe+=1;}}o(u,"send");async function y(h){return re(h,await zn(e.auth))}o(y,"authorize");async function*_(h,E,C){i(Object.freeze({call:h,phase:"stream.open",method:E.method,path:E.path,attempt:0}));try{yield*e.auth.transport.stream(E,C);}catch{yield Mt({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:null});}}return o(_,"stream"),Object.freeze({send:u,authorize:y,stream:_})}o(Ut,"createRequestFunnel");function Tn(e,r){let t={};for(let[n,a]of Object.entries(e.headers??{}))n.toLowerCase()!==En&&(t[n]=a);return r!==null&&(t["Idempotency-Key"]=r),{...e,headers:t}}o(Tn,"assembleHeaders");function kn(){let e=0;return ()=>`efk_${Date.now().toString(36)}_${(e++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}o(kn,"defaultIdempotencyKeyFactory");var On=10;function Fn(e,r,t){if(t.aborted)return {retry:false,reason:"aborted"};let n=In(e);if(n==="quota")return {retry:false,reason:"daily-quota-exhausted"};if(n!=="burst"&&!je(e.code))return {retry:false,reason:"terminal-code"};let a=n==="burst"?"burst-throttle":"retryable-code";if(o(()=>{if(t.policy===void 0)return false;try{return !t.policy.shouldRetry(e.code,r)}catch{return false}},"policyVetoedRetry")())return {retry:false,reason:"terminal-code"};let s=o(()=>{if(t.policy===void 0)return null;let u;try{u=t.policy.maxAttempts(e.code);}catch{return null}return typeof u!="number"||!Number.isFinite(u)?null:Math.max(1,Math.min(On,Math.floor(u)))},"policyCeiling"),c=t.perCallMaxAttempts??s()??t.maxAttempts;if(r+1>=c)return {retry:false,reason:"attempts-exhausted"};let i=Dn(e,t.now);return i!==null?i>_n?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:a,delayMs:i}:{retry:true,reason:a,delayMs:zt(r,t.rng)}}o(Fn,"decideRetry");function In(e){let r=e.code==="unknown"?Pt(jn(e.raw)):e.code;return r==="quotaExceeded"?"quota":r==="rateLimited"||e.httpStatus===429?"burst":null}o(In,"throttleKind");function Dn(e,r){let t=Pn(e.raw);if(t===null)return null;let n=t-r;return n>0?n:0}o(Dn,"retryOverrideMs");function Pn(e){for(let r of Ht(e)){let t=r.resets_at,n=An(t);if(n!==null)return n}return null}o(Pn,"findResetsAt");function Ht(e){if(!Bt(e))return [];let r=[e];for(let t of ["error","detail"]){let n=e[t];Bt(n)&&r.push(n);}return r}o(Ht,"candidateScopes");function An(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 r=Date.parse(e);return Number.isFinite(r)?r:null}return null}o(An,"parseInstantMs");function jn(e){for(let r of Ht(e)){let t=r.code;if(typeof t=="string"&&t.length>0)return t}return null}o(jn,"rawWireCode");function Bt(e){return typeof e=="object"&&e!==null}o(Bt,"isRecord");async function zn(e){return e.mode==="anonymous"?{mode:"anonymous",publishableKey:e.publishableKey,userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{}}:{mode:"personalized",token:await e.identity.currentToken(),userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{}}}o(zn,"resolveDeviceAuth");function Nn(e,r){let t=new AbortController,n=r.setTimeout(()=>t.abort(),e);return {signal:t.signal,cancel:o(()=>r.clearTimeout(n),"cancel")}}o(Nn,"boundedSignal");function Ln(e,r){let t=o(()=>{},"noop");if(!r)return {signal:e,dispose:t};let n=new AbortController;if(e.aborted||r.aborted)return n.abort(),{signal:n.signal,dispose:t};let a=o(()=>n.abort(),"onAbort");return e.addEventListener("abort",a,{once:true}),r.addEventListener("abort",a,{once:true}),{signal:n.signal,dispose:o(()=>{e.removeEventListener("abort",a),r.removeEventListener("abort",a);},"dispose")}}o(Ln,"mergeSignals");function Mn(e,r,t){return e<=0||t?.aborted===true?Promise.resolve():new Promise(n=>{let a=r.setTimeout(()=>{t?.removeEventListener("abort",l),n();},e),l=o(()=>{r.clearTimeout(a),n();},"onAbort");t?.addEventListener("abort",l,{once:true});})}o(Mn,"delayAbortable");function Wt(e){for(let r=0;r<e.length;r+=1){let t=e.charCodeAt(r);if(t>=55296&&t<=56319){let n=e.charCodeAt(r+1);if(!(n>=56320&&n<=57343))return true;r+=1;}else if(t>=56320&&t<=57343)return true}return false}o(Wt,"hasLoneSurrogate");var $t=64,Gt=512;function qn(e){return e==="owner_reported"||e==="clinic_document"?e:null}o(qn,"normalizeOrigin");zod.z.object({request_id:zod.z.string().min(1),pet_ref:zod.z.string().min(1),status:zod.z.string(),simple_status:zod.z.string().nullish(),simple_status_detail:zod.z.string().nullish(),status_label:zod.z.string().optional(),dispatch_status:zod.z.string().nullish(),can_retry_send:zod.z.boolean().optional(),can_revoke:zod.z.boolean().optional(),can_convert_to_upload:zod.z.boolean().optional(),can_update_clinic_email:zod.z.boolean().optional(),reminder_count:zod.z.number().int().nonnegative().optional(),last_reminder_at:zod.z.string().nullish(),waiting_expectation:zod.z.string().nullish(),document_count:zod.z.number().optional(),held_item_count:zod.z.number().optional(),received_at:zod.z.string().nullish(),parsing_started_at:zod.z.string().nullish(),review_started_at:zod.z.string().nullish(),created_at:zod.z.string().optional(),updated_at:zod.z.string().optional(),source:zod.z.string().nullish().catch(null),action_needed_label:zod.z.string().nullish().catch(null),failure_reason:zod.z.string().nullish().catch(null),failure_code:zod.z.string().nullish().catch(null),recovery_stage:zod.z.string().nullish().catch(null),show_clinic_phone:zod.z.boolean().optional().catch(void 0),clinic_name:zod.z.string().nullish().catch(null),clinic_email:zod.z.string().nullish().catch(null),clinic_phone:zod.z.string().nullish().catch(null),converted_to_upload_at:zod.z.string().nullish().catch(null),request_group_id:zod.z.string().nullish().catch(null)}).passthrough();zod.z.object({request_group_id:zod.z.string().min(1),pet_ref:zod.z.string().min(1),total:zod.z.number().int().nonnegative(),responded:zod.z.number().int().nonnegative(),pending:zod.z.number().int().nonnegative(),members:zod.z.array(zod.z.unknown())});zod.z.object({source_doc_id:zod.z.string().min(1),request_id:zod.z.string().min(1)});var Bn=zod.z.object({label:zod.z.string(),value:zod.z.string()}),Me=zod.z.object({key:zod.z.string(),category:zod.z.string().optional(),label:zod.z.string().optional(),value:zod.z.string().nullish(),unit:zod.z.string().nullish(),observed_at:zod.z.string().nullish(),status:zod.z.string().nullish(),origin:zod.z.string().nullish(),canonical_key:zod.z.string().nullish()}),Un=zod.z.object({at:zod.z.string(),value:zod.z.number().nullish(),display:zod.z.string().nullish(),origin:zod.z.string().nullish()}),Hn=zod.z.object({key:zod.z.string(),label:zod.z.string().optional(),points:zod.z.array(Un).optional()}),Wn=zod.z.object({title:zod.z.string(),detail:zod.z.string().nullish(),due_at:zod.z.string().nullish()}),Ve=zod.z.object({doc_id:zod.z.string(),title:zod.z.string().nullish(),page_count:zod.z.number().nullish(),received_at:zod.z.string().nullish()});function Yt(e){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:qn(e.origin),canonicalKey:e.canonical_key??null})}o(Yt,"mapEntityRow");function Kt(e){return Object.freeze({docId:e.doc_id,title:e.title??null,pageCount:e.page_count??null,receivedAt:e.received_at??null})}o(Kt,"mapDocumentRow");zod.z.object({identity:zod.z.array(Bn).optional(),entities:zod.z.array(Me).optional(),entity_series:zod.z.array(Hn).optional(),forward_looking:zod.z.array(Wn).optional(),documents:zod.z.array(Ve).optional()});zod.z.object({pet_ref:zod.z.string().optional(),granted:zod.z.boolean().optional(),version:zod.z.string().nullish(),granted_at:zod.z.string().nullish()});var v=zod.z.string().nullish(),he=zod.z.number().nullish(),$n=zod.z.object({collected_at:v,at:v,value:he,unit:v,qualitative_result:v,ref_low:he,ref_high:he,status:v,source_clinic:v,source_doc_id:v,doc_id:v,reviewed:zod.z.boolean().nullish()}),Gn=zod.z.object({collected_at:v,at:v,value:he,unit:v,qualitative_result:v,status:v}),Yn=zod.z.object({marker_id:zod.z.string().min(1),canonical_name:v,name:v,loinc_code:v,canonical_unit:v,unit:v,panel_name:v,panel:v,meaning_text:v,meaning:v,latest:Gn.nullish(),trajectory:v,points:zod.z.array($n).optional()}),Kn=zod.z.object({total_markers:zod.z.number().int().nonnegative(),in_range_count:zod.z.number().int().nonnegative(),out_of_range_count:zod.z.number().int().nonnegative(),unknown_count:zod.z.number().int().nonnegative()}),Xn=zod.z.object({markers:zod.z.array(Yn).optional(),summary:Kn.nullish(),disclaimer:zod.z.string().optional(),featured_marker_id:v});function Qn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(Qn,"isObject");function Xt(e){return Object.freeze({petRef:e,withheld:true,markers:Object.freeze([]),summary:null,disclaimer:"",featuredMarkerId:null})}o(Xt,"withheldMarkers");function Qt(e,r){let t=Qn(r)?r:{},n=typeof t.pet_ref=="string"&&t.pet_ref.length>0?t.pet_ref:e;if(t.withheld===true)return Xt(n);let a=Xn.safeParse(t);if(!a.success)return Xt(n);let l=a.data,s=o(i=>Object.freeze({at:i.collected_at??i.at??null,value:i.value??null,unit:i.unit??null,qualitativeResult:i.qualitative_result??null,refLow:i.ref_low??null,refHigh:i.ref_high??null,status:i.status??null,sourceClinic:i.source_clinic??null,docId:i.source_doc_id??i.doc_id??null,reviewed:i.reviewed===true}),"point"),c=(l.markers??[]).map(i=>Object.freeze({markerId:i.marker_id,name:i.canonical_name??i.name??i.marker_id,loincCode:i.loinc_code??null,unit:i.canonical_unit??i.unit??null,panel:i.panel_name??i.panel??null,meaning:i.meaning_text??i.meaning??null,latest:i.latest?Object.freeze({at:i.latest.collected_at??i.latest.at??null,value:i.latest.value??null,unit:i.latest.unit??null,qualitativeResult:i.latest.qualitative_result??null,status:i.latest.status??null}):null,trajectory:i.trajectory??null,points:Object.freeze((i.points??[]).map(s))}));return Object.freeze({petRef:n,withheld:false,markers:Object.freeze(c),summary:l.summary?Object.freeze({totalMarkers:l.summary.total_markers,inRangeCount:l.summary.in_range_count,outOfRangeCount:l.summary.out_of_range_count,unknownCount:l.summary.unknown_count}):null,disclaimer:l.disclaimer??"",featuredMarkerId:l.featured_marker_id??null})}o(Qt,"mapRecordMarkers");var Jt=128,B=128;var Jn=zod.z.string().min(1).refine(e=>e.startsWith("https://")),Zn=zod.z.object({source_doc_id:zod.z.string().min(1),file_name:zod.z.string().nullish(),doc_format:zod.z.string().nullish(),byte_size:zod.z.number().int().nonnegative().nullish(),received_at:zod.z.string().nullish(),download_url:Jn,expires_in_seconds:zod.z.number().int().nonnegative().nullish()}),eo=zod.z.object({items:zod.z.array(zod.z.unknown()).optional()});function Zt(e){let r=eo.safeParse(e);if(!r.success)return null;let t=[];for(let n of r.data.items??[]){let a=Zn.safeParse(n);a.success&&t.push(Object.freeze({sourceDocId:a.data.source_doc_id,fileName:a.data.file_name??null,docFormat:a.data.doc_format??null,byteSize:a.data.byte_size??null,receivedAt:a.data.received_at??null,downloadUrl:a.data.download_url,expiresInSeconds:a.data.expires_in_seconds??0}));}return Object.freeze(t)}o(Zt,"mapRequestDocuments");var to=zod.z.string().min(1).refine(e=>e.startsWith("https://")),ne=zod.z.string().nullish(),ro=zod.z.object({share_id:zod.z.string().min(1),share_url:zod.z.string().min(1),expires_at:ne}),no=zod.z.object({shares:zod.z.array(zod.z.object({share_id:zod.z.string().min(1),expires_at:ne,created_at:ne,view_count:zod.z.number().int().nonnegative().nullish(),last_viewed_at:ne})).optional()}),oo=zod.z.object({download_url:to,expires_at:ne});function io(e,r){let t=e.trim();if(t.length===0)return null;try{let n=/^[a-z][a-z0-9+.-]*:/i.test(t)?new URL(t):r!==void 0?new URL(t,r):null;return n===null||n.protocol!=="https:"?null:n.toString()}catch{return null}}o(io,"resolveShareUrl");function er(e,r){let t=ro.safeParse(e);if(!t.success)return null;let n=io(t.data.share_url,r);return n===null?null:Object.freeze({shareId:t.data.share_id,shareUrl:n,expiresAt:t.data.expires_at??null})}o(er,"mapRecordShareLink");function tr(e){let r=no.safeParse(e);return r.success?Object.freeze((r.data.shares??[]).map(t=>Object.freeze({shareId:t.share_id,expiresAt:t.expires_at??null,createdAt:t.created_at??null,viewCount:t.view_count??0,lastViewedAt:t.last_viewed_at??null}))):null}o(tr,"mapRecordShareList");function rr(e){let r=oo.safeParse(e);return r.success?Object.freeze({downloadUrl:r.data.download_url,expiresAt:r.data.expires_at??null}):null}o(rr,"mapRecordPdfLink");var ao=zod.z.object({signatures:zod.z.array(zod.z.object({signature_id:zod.z.string().min(1),preview_url:zod.z.string().min(1).refine(e=>e.startsWith("https://")),created_at:zod.z.string().nullish()})).optional()});function nr(e){let r=ao.safeParse(e);return r.success?Object.freeze((r.data.signatures??[]).map(t=>Object.freeze({signatureId:t.signature_id,previewUrl:t.preview_url,createdAt:t.created_at??null}))):null}o(nr,"mapSignatureSuggestions");var m=zod.z.string().nullish(),oe=zod.z.number().nullish(),so=zod.z.object({at:m,value:oe,unit:m,qualitative_result:m,ref_low:oe,ref_high:oe,status:m,doc_id:m}),lo=zod.z.object({marker_id:zod.z.string(),name:zod.z.string(),loinc_code:m,unit:m,panel:m,meaning:m,latest:zod.z.object({at:m,value:oe,unit:m,qualitative_result:m,status:m}).nullish(),trajectory:m,points:zod.z.array(so).optional()}),co=zod.z.object({encounter_id:zod.z.string(),date:m,type:m,clinic_name:m,veterinarian:m,doc_id:m}),uo=zod.z.object({note_id:zod.z.string(),encounter_id:m,observed_on:m,sections:zod.z.array(zod.z.object({section:zod.z.string(),text:zod.z.string()})).optional()}),po=zod.z.object({exam_id:zod.z.string(),encounter_id:m,observed_on:m,doc_id:m,systems:zod.z.record(zod.z.object({finding_status:m,finding:m})).optional()}),yo=zod.z.object({has_lab_history:zod.z.boolean().optional(),has_vaccination_history:zod.z.boolean().optional(),has_weight_history:zod.z.boolean().optional(),has_vitals_history:zod.z.boolean().optional(),has_physical_exam_history:zod.z.boolean().optional(),has_procedure_history:zod.z.boolean().optional(),has_genetic_history:zod.z.boolean().optional(),has_reproductive_history:zod.z.boolean().optional(),has_parasite_prevention_history:zod.z.boolean().optional(),earliest_record_at:m,latest_record_at:m,documents_ingested:zod.z.number().int().nonnegative().optional(),documents_in_review:zod.z.number().int().nonnegative().optional(),entities_pending_review:zod.z.record(zod.z.number().int().nonnegative()).optional(),held_total:zod.z.number().int().nonnegative().optional()}),fo=zod.z.object({conflict_id:zod.z.string(),entity_type:zod.z.string(),field:m,severity:m,candidates:zod.z.array(zod.z.object({value:zod.z.string(),source_doc_id:m,doc_id:m,collected_at:m})).optional()}),mo=zod.z.object({lab_results:zod.z.array(lo).optional(),encounters:zod.z.array(co).optional(),clinician_notes:zod.z.array(uo).optional(),physical_exams:zod.z.array(po).optional(),completeness:yo.nullish(),conflicts:zod.z.array(fo).optional()}),go=zod.z.object({visits:zod.z.array(zod.z.object({visit_id:zod.z.string(),visit_date:m,veterinarian:m,summary:m,doc_id:m})),vaccines:zod.z.array(zod.z.object({vaccine_id:zod.z.string(),product:m,lot:m,administered_on:m,expires_on:m,doc_id:m})),weights:zod.z.array(zod.z.object({weight_id:zod.z.string(),observed_on:m,weight_kg:oe,doc_id:m})),medications:zod.z.array(zod.z.object({medication_id:zod.z.string(),drug_name:m,dose:m,route:m,frequency:m,sig:m,rx_number:m,started_on:m,stopped_on:m,doc_id:m})),disclaimer:zod.z.string().optional()}),bo=zod.z.object({document:Ve,contributions:zod.z.array(Me),contribution_count:zod.z.number().int().nonnegative().optional()});function Be(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(Be,"isObject");function Ue(e,r){return typeof e.pet_ref=="string"&&e.pet_ref.length>0?e.pet_ref:r}o(Ue,"petOf");function qe(e,r){return Object.freeze({petRef:e,available:false,withheld:r,labResults:Object.freeze([]),encounters:Object.freeze([]),clinicianNotes:Object.freeze([]),physicalExams:Object.freeze([]),completeness:null,conflicts:Object.freeze([])})}o(qe,"emptyDepth");function ir(e,r){let t=Be(r)?r:{},n=Ue(t,e);if(t.withheld===true)return qe(n,true);if(!["lab_results","encounters","clinician_notes","physical_exams","completeness","conflicts"].some(i=>i in t))return qe(n,false);let l=mo.safeParse(t);if(!l.success)return qe(n,true);let s=l.data,c=o(i=>Object.freeze({at:i.at??null,value:i.value??null,unit:i.unit??null,qualitativeResult:i.qualitative_result??null,refLow:i.ref_low??null,refHigh:i.ref_high??null,status:i.status??null,docId:i.doc_id??null}),"point");return Object.freeze({petRef:n,available:true,withheld:false,labResults:Object.freeze((s.lab_results??[]).map(i=>Object.freeze({markerId:i.marker_id,name:i.name,loincCode:i.loinc_code??null,unit:i.unit??null,panel:i.panel??null,meaning:i.meaning??null,latest:Object.freeze({at:i.latest?.at??null,value:i.latest?.value??null,unit:i.latest?.unit??null,qualitativeResult:i.latest?.qualitative_result??null,status:i.latest?.status??null}),trajectory:i.trajectory??null,points:Object.freeze((i.points??[]).map(c))}))),encounters:Object.freeze((s.encounters??[]).map(i=>Object.freeze({encounterId:i.encounter_id,date:i.date??null,type:i.type??null,clinicName:i.clinic_name??null,veterinarian:i.veterinarian??null,docId:i.doc_id??null}))),clinicianNotes:Object.freeze((s.clinician_notes??[]).map(i=>Object.freeze({noteId:i.note_id,encounterId:i.encounter_id??null,observedOn:i.observed_on??null,sections:Object.freeze((i.sections??[]).map(u=>Object.freeze({section:u.section,text:u.text})))}))),physicalExams:Object.freeze((s.physical_exams??[]).map(i=>Object.freeze({examId:i.exam_id,encounterId:i.encounter_id??null,observedOn:i.observed_on??null,docId:i.doc_id??null,systems:Object.freeze(Object.entries(i.systems??{}).map(([u,y])=>Object.freeze({system:u,findingStatus:y.finding_status??null,finding:y.finding??null})))}))),completeness:s.completeness?Object.freeze({hasLabHistory:s.completeness.has_lab_history===true,hasVaccinationHistory:s.completeness.has_vaccination_history===true,hasWeightHistory:s.completeness.has_weight_history===true,hasVitalsHistory:s.completeness.has_vitals_history===true,hasPhysicalExamHistory:s.completeness.has_physical_exam_history===true,hasProcedureHistory:s.completeness.has_procedure_history===true,hasGeneticHistory:s.completeness.has_genetic_history===true,hasReproductiveHistory:s.completeness.has_reproductive_history===true,hasParasitePreventionHistory:s.completeness.has_parasite_prevention_history===true,earliestRecordAt:s.completeness.earliest_record_at??null,latestRecordAt:s.completeness.latest_record_at??null,documentsIngested:s.completeness.documents_ingested??0,documentsInReview:s.completeness.documents_in_review??0,entitiesPendingReview:Object.freeze({...s.completeness.entities_pending_review??{}}),heldTotal:s.completeness.held_total??0}):null,conflicts:Object.freeze((s.conflicts??[]).map(i=>Object.freeze({conflictId:i.conflict_id,entityType:i.entity_type,field:i.field??null,severity:i.severity??"needs_review",candidates:Object.freeze((i.candidates??[]).map(u=>Object.freeze({value:u.value,docId:u.source_doc_id??u.doc_id??null,collectedAt:u.collected_at??null})))})))})}o(ir,"mapRecordDepth");function or(e){return Object.freeze({petRef:e,withheld:true,isEmpty:false,visits:Object.freeze([]),vaccines:Object.freeze([]),weights:Object.freeze([]),medications:Object.freeze([]),disclaimer:""})}o(or,"withheldTimeline");function ar(e,r){let t=Be(r)?r:{},n=Ue(t,e);if(t.withheld===true)return or(n);let a=go.safeParse(t);if(!a.success)return or(n);let l=a.data,s=l.visits.map(y=>Object.freeze({visitId:y.visit_id,visitDate:y.visit_date??null,veterinarian:y.veterinarian??null,summary:y.summary??null,docId:y.doc_id??null})),c=l.vaccines.map(y=>Object.freeze({vaccineId:y.vaccine_id,product:y.product??null,lot:y.lot??null,administeredOn:y.administered_on??null,expiresOn:y.expires_on??null,docId:y.doc_id??null})),i=l.weights.map(y=>Object.freeze({weightId:y.weight_id,observedOn:y.observed_on??null,weightKg:y.weight_kg??null,docId:y.doc_id??null})),u=l.medications.map(y=>Object.freeze({medicationId:y.medication_id,drugName:y.drug_name??null,dose:y.dose??null,route:y.route??null,frequency:y.frequency??null,sig:y.sig??null,rxNumber:y.rx_number??null,startedOn:y.started_on??null,stoppedOn:y.stopped_on??null,docId:y.doc_id??null}));return Object.freeze({petRef:n,withheld:false,isEmpty:s.length===0&&c.length===0&&i.length===0&&u.length===0,visits:Object.freeze(s),vaccines:Object.freeze(c),weights:Object.freeze(i),medications:Object.freeze(u),disclaimer:l.disclaimer??""})}o(ar,"mapRecordsTimeline");function sr(e,r){let t=Be(r)?r:{},n=Ue(t,e),a=o(()=>Object.freeze({petRef:n,withheld:true,document:null,contributions:Object.freeze([]),contributionCount:0}),"withheld");if(t.withheld===true)return a();let l=bo.safeParse(t);if(!l.success)return a();let s=Object.freeze(l.data.contributions.map(Yt));return Object.freeze({petRef:n,withheld:false,document:Kt(l.data.document),contributions:s,contributionCount:l.data.contribution_count??s.length})}o(sr,"mapDocumentContributions");var ho="/widget/v1/records/pets";function lr(e){let r=e.funnel??Ut({auth:e.auth,...e.errorPolicy?{errorPolicy:e.errorPolicy}:{}}),t=o((i,u)=>typeof i=="string"&&i.length>0&&!Wt(i)&&[...i].length<=u,"segment"),n=o(async(i,u,y,_)=>{if(!t(u,B))return N();let h=await r.send(i,{method:"GET",path:y});if(!h.ok)return h;let E=_(h.value);return E.petRef===u?$(E):F(q("internalError",{retryable:false}))},"read"),a=o(i=>`${ho}/${encodeURIComponent(i)}`,"pet"),l=o(i=>`${a(i)}/everfur_record`,"record"),s=o(async(i,u,y)=>{let _=await r.send(i,u,u.method==="POST"?{idempotent:false,maxAttempts:1}:void 0);if(!_.ok)return _;let h=y(_.value);return h===null?F(q("internalError",{retryable:false})):$(h)},"parsed"),c=o((i,u)=>!t(i.entityType,$t)||!t(i.canonicalKey,Gt)||i.idempotencyKey!==void 0&&!t(i.idempotencyKey,Jt)||u!==void 0&&Object.keys(u).length===0?null:{entity_type:i.entityType,canonical_key:i.canonicalKey,...u!==void 0?{corrected_fields:u}:{},...i.idempotencyKey!==void 0?{idempotency_key:i.idempotencyKey}:{}},"factBody");return {getRecordDepth:o(i=>n("records.depth.record",i,`${a(i)}/record`,u=>ir(i,u)),"getRecordDepth"),getTimeline:o(i=>n("records.depth.timeline",i,`${a(i)}/timeline`,u=>ar(i,u)),"getTimeline"),getDocumentContributions(i,u){return t(u,64)?n("records.depth.contributions",i,`${a(i)}/documents/${encodeURIComponent(u)}/contributions`,y=>sr(i,y)):N()},getMarkers:o(i=>n("records.depth.markers",i,`${a(i)}/markers`,u=>Qt(i,u)),"getMarkers"),createShare(i){return t(i,B)?s("records.share.create",{method:"POST",path:`${l(i)}/share`},u=>er(u,e.apiBaseUrl)):N()},listShares(i){return t(i,B)?s("records.share.list",{method:"GET",path:`${l(i)}/shares`},tr):N()},async revokeShare(i,u){if(!t(i,B)||!t(u,64))return N();let y=await r.send("records.share.revoke",{method:"DELETE",path:`${l(i)}/shares/${encodeURIComponent(u)}`},{idempotent:false,maxAttempts:1});return y.ok?$(void 0):y},getPdfLink(i){return t(i,B)?s("records.pdf.link",{method:"GET",path:`${l(i)}/pdf-link`},rr):N()},async editFact(i,u){let y=t(i,B)?c(u,u.correctedFields):null;if(y===null)return N();let _=await r.send("records.fact.edit",{method:"POST",path:`${l(i)}/facts/edit`,body:y},{idempotent:false,maxAttempts:1});return _.ok?$(void 0):_},async removeFact(i,u){let y=t(i,B)?c(u):null;if(y===null)return N();let _=await r.send("records.fact.remove",{method:"POST",path:`${l(i)}/facts/remove`,body:y},{idempotent:false,maxAttempts:1});return _.ok?$(void 0):_},listRequestDocuments(i){return t(i,64)?s("records.request.documents",{method:"GET",path:`/widget/v1/records/requests/${encodeURIComponent(i)}/documents`},Zt):N()},listAuthorizationSignatures:o(()=>s("records.signatures.list",{method:"GET",path:"/widget/v1/records/authorization-signatures"},nr),"listAuthorizationSignatures")}}o(lr,"createRecordsDepthClient");function N(){return Promise.resolve(F(q("validationFailed",{retryable:false})))}o(N,"invalid");var dr=Symbol.for("@everfur/sdk#EverfurContext@v1"),cr=globalThis,ur=cr[dr]??(cr[dr]=react.createContext(null));ur.displayName??="EverfurContext";function ie(){let e=react.useContext(ur);if(e===null)throw new te("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return e}o(ie,"useEverfurContext");var wo=new Map,pr=new Set;function xo(e){return wo.get(e)??0}o(xo,"recordsConsentEpochOf");function Co(e){return pr.add(e),()=>{pr.delete(e);}}o(Co,"subscribe");function yr(e){let r=react.useCallback(()=>xo(e),[e]);return react.useSyncExternalStore(Co,r,r)}o(yr,"useRecordsConsentEpoch");function mr(){let{runtime:e,userRef:r,scopeEpoch:t}=ie();return react.useMemo(()=>{let{services:n}=e.registry;return lr({auth:n.authFor(r),...n.errorPolicy?{errorPolicy:n.errorPolicy}:{},...typeof n.apiBaseUrl=="string"?{apiBaseUrl:n.apiBaseUrl}:{}})},[e,r,t])}o(mr,"useEverfurRecordsDepthClient");function ae(e,r,t,n=""){let a=mr(),{userRef:l}=ie(),s=yr(e),c=react.useMemo(()=>({}),[a,e,n,s]),[i,u]=react.useState({scope:c,value:null,error:null,loading:true}),y=react.useRef(0),_=react.useCallback(async()=>{let j=y.current+=1;if(u({scope:c,value:null,error:null,loading:true}),l===null){u({scope:c,value:null,error:null,loading:false});return}let z=await r(a,e);j===y.current&&(z.ok?u({scope:c,value:z.value,error:null,loading:false}):u({scope:c,value:null,error:z.error,loading:false}));},[a,e,r,c,l]);react.useEffect(()=>(_(),()=>{y.current+=1;}),[_]);let h=i.scope===c?i:{value:null,error:null,loading:true},E=react.useCallback(()=>{_();},[_]),C=h.error===null||h.error.httpStatus!==404,k=C?h.error:null,I=h.loading?"loading":k!==null?"error":h.value===null?"empty":h.value.withheld?"populated":t(h.value)?"empty":"populated";return react.useMemo(()=>({status:I,value:h.value,error:k,available:C,refresh:E}),[I,h.value,k,C,E])}o(ae,"useRecordsDepthRead");var Ge=class Ge extends react.Component{constructor(){super(...arguments);this.state={failed:false,key:this.props.resetKey};}static getDerivedStateFromError(){return {failed:true}}static getDerivedStateFromProps(t,n){return Object.is(t.resetKey,n.key)?null:{failed:false,key:t.resetKey}}render(){return this.state.failed?this.props.fallback:this.props.children}};o(Ge,"HostRenderBoundary");var We=Ge;function Fo({render:e}){return e()}o(Fo,"RenderHost");function $e({render:e,fallback:r,resetKey:t}){return react.createElement(We,{fallback:r,resetKey:t,children:react.createElement(Fo,{render:e})})}o($e,"HostRender");var Io=Object.freeze({chat:Object.freeze(["chat.message.create"]),records:Object.freeze(["records.upload.create","records.record.read"]),recordsClinic:Object.freeze(["records.clinic.create"]),video:Object.freeze(["video.gait.execute"]),photo:Object.freeze(["photo.checkup.execute"]),animations:Object.freeze(["animations.state.read"]),televet:Object.freeze(["televet.visit.create"])});function Do(e){return Io[e]}o(Do,"requires");function br(e,r,t){let n=Do(e),a=new Map;for(let c of r)a.set(c.resource,c);if(t?.isPending===true&&n.some(c=>!a.has(c)))return Ye({name:e,enabled:false,isPending:true,limits:{}});let l=Po(n,a);return n.filter(c=>a.get(c)?.granted!==true).length===0?Ye({name:e,enabled:true,isPending:false,limits:l}):Ye({name:e,enabled:false,isPending:false,limits:l,disabled:Ao(n,a)})}o(br,"decideCapability");function Po(e,r){let t={};for(let n of e){let a=r.get(n)?.limits;if(a)for(let[l,s]of Object.entries(a)){let c=t[l];t[l]=c===void 0?s:Math.min(c,s);}}return t}o(Po,"mergeLimits");function Ao(e,r){for(let t of e){let n=r.get(t)?.disabled;if(n)return Object.freeze({reason:n.reason,level:n.level,recoverable:n.recoverable})}return Object.freeze({reason:Ne("accessDenied"),level:"user_entitlement",recoverable:false})}o(Ao,"disabledFor");function Ye(e){let r={name:e.name,enabled:e.enabled,isPending:e.isPending,limits:Object.freeze({...e.limits})};return e.disabled!==void 0&&(r.disabled=e.disabled),Object.freeze(r)}o(Ye,"freezeDecision");function Ke(e){let{runtime:r}=ie(),t=r.entitlements,n=react.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getSnapshot);return react.useMemo(()=>br(e,n.decisions,{isPending:n.isPending}),[e,n])}o(Ke,"useCapability");var No=48;function Lo(e){return e.isPending?"pending":e.enabled?"enabled":"disabled"}o(Lo,"selectView");function _r(e){let{capability:r,children:t,renderDisabled:n,renderPending:a,style:l}=e,s=Ke(r),c=react.useMemo(()=>Lo(s),[s]);switch(c){case "enabled":return t;case "pending":return a?jsxRuntime.jsx($e,{render:a,fallback:jsxRuntime.jsx(Rr,{capability:r,style:l})}):jsxRuntime.jsx(Rr,{capability:r,style:l});case "disabled":return n?jsxRuntime.jsx($e,{render:()=>n(s),fallback:jsxRuntime.jsx(vr,{decision:s,style:l}),resetKey:s}):jsxRuntime.jsx(vr,{decision:s,style:l});default:return Lt(c)}}o(_r,"CapabilityGate");function Rr({capability:e,style:r}){let t=w(),n=react.useMemo(()=>Er(t),[t]);return jsxRuntime.jsx(reactNative.View,{style:[n.offstate,r],accessible:true,accessibilityState:{busy:true},accessibilityLabel:`Loading ${e}`,children:jsxRuntime.jsx(reactNative.View,{style:n.skeletonBar})})}o(Rr,"PendingSkeleton");function vr({decision:e,style:r}){let t=w(),n=react.useMemo(()=>Er(t),[t]),a=e.disabled?.reason??"";return jsxRuntime.jsx(reactNative.View,{style:[n.offstate,r],accessible:true,accessibilityRole:"text",accessibilityLabel:a,children:a.length>0?jsxRuntime.jsx(g,{style:n.offstateText,children:a}):null})}o(vr,"OffState");function Er(e){let{color:r,space:t,radius:n,type:a}=e;return reactNative.StyleSheet.create({offstate:{minHeight:No,justifyContent:"center",paddingHorizontal:t.lg,paddingVertical:t.md,backgroundColor:r.surfaceCream,borderRadius:n.md,borderWidth:reactNative.StyleSheet.hairlineWidth,borderColor:r.brandBorder},offstateText:{...S(e,"regular"),fontSize:a.size.body,lineHeight:Math.round(a.size.body*a.lineHeight.normal),color:r.text.muted},skeletonBar:{height:t.md,borderRadius:n.xs,backgroundColor:r.brandSofter}})}o(Er,"makeStyles");var se=Object.freeze({title:"For educational use only",body:"Everfur is for educational purposes only. It helps you track visible changes through AI checkups. It does not diagnose, treat, prescribe, or replace veterinary care. For urgent symptoms or emergencies, contact a veterinarian immediately."});function Cr(e){let r=w(),t=react.useMemo(()=>qo(r),[r]);return jsxRuntime.jsxs(reactNative.View,{style:[t.container,e.style],accessible:true,accessibilityRole:"text",accessibilityLabel:`${se.title}. ${se.body}`,children:[jsxRuntime.jsx(g,{style:t.title,children:se.title}),jsxRuntime.jsx(g,{style:t.body,children:se.body})]})}o(Cr,"ClinicalDisclaimer");function qo(e){let{color:r,space:t,type:n}=e;return reactNative.StyleSheet.create({container:{paddingHorizontal:t.lg,paddingVertical:t.md,borderTopWidth:reactNative.StyleSheet.hairlineWidth,borderTopColor:r.borderHairlineGreen,backgroundColor:r.surfaceCream,gap:t.xs},title:{...S(e,"bold"),fontSize:n.size.caption,lineHeight:Math.round(n.size.caption*n.lineHeight.snug),color:r.text.secondary,letterSpacing:n.letterSpacing.eyebrow},body:{...S(e,"regular"),fontSize:n.size.caption,lineHeight:Math.round(n.size.caption*n.lineHeight.snug),color:r.text.muted}})}o(qo,"makeStyles");var Sr=Object.freeze({idle:Object.freeze({title:"Find your pet\u2019s clinic",body:"Search for the clinic that holds your pet\u2019s records. We\u2019ll request them on your behalf once you sign the authorization.",action:null}),no_requests:Object.freeze({title:"No record requests yet",body:"When you request records from a clinic, you\u2019ll be able to track every step here.",action:null}),no_records:Object.freeze({title:"Nothing to show just yet",body:"Once your pet\u2019s records arrive and our team reviews them, lab trends and visits will appear here.",action:null}),rate_limited:Object.freeze({title:"Slow down a moment",body:"You\u2019ve made a lot of requests just now. You can try again shortly.",action:"Try again"}),service_unavailable:Object.freeze({title:"Records search is temporarily down",body:"We\u2019re working on it. Please try again in a few minutes.",action:"Try again"}),error:Object.freeze({title:"Couldn\u2019t reach Everfur",body:"Check your connection and try again.",action:"Try again"})}),Je=60;function Tr(e){return `Try again in ${e}s`}o(Tr,"coolingActionLabel");var kr="Try again, available shortly";function Re({variant:e,onAction:r,message:t,testID:n}){let a=$o(),l=Sr[e],[s,c]=react.useState(e==="rate_limited"?Je:0);react.useEffect(()=>{e==="rate_limited"&&c(Je);},[e]),react.useEffect(()=>{if(s<=0)return;let y=setTimeout(()=>c(_=>Math.max(0,_-1)),1e3);return ()=>clearTimeout(y)},[s]);let i=e==="rate_limited"&&s>0,u=i?Tr(s):l.action;return jsxRuntime.jsxs(reactNative.View,{style:a.container,accessibilityRole:"summary",testID:n,children:[jsxRuntime.jsx(reactNative.View,{style:a.glyph,accessibilityElementsHidden:true,importantForAccessibility:"no"}),jsxRuntime.jsx(g,{style:a.title,children:l.title}),jsxRuntime.jsx(g,{style:a.body,children:t??l.body}),u!==null&&r?jsxRuntime.jsx(reactNative.Pressable,{onPress:r,disabled:i,accessibilityRole:"button",accessibilityLabel:i?kr:u,accessibilityState:{disabled:i},style:[a.action,i?a.actionDisabled:null],testID:n?`${n}-action`:`records-empty-${e}-action`,children:jsxRuntime.jsx(g,{style:a.actionLabel,children:u})}):null]})}o(Re,"RecordsEmptyState");function $o(){let e=w();return react.useMemo(()=>Go(e),[e])}o($o,"useStyles");function Go(e){let{color:r,space:t,radius:n,type:a,slots:l}=e,s=t.lg+t.xs+t.xs/2;return reactNative.StyleSheet.create({container:{paddingVertical:t.xxl,paddingHorizontal:t.xl,alignItems:"center",gap:t.sm+t.xs/2},glyph:{width:s,height:s,borderRadius:s/2,backgroundColor:r.brandSoft,borderWidth:reactNative.StyleSheet.hairlineWidth,borderColor:r.brandBorder,marginBottom:t.xs},title:{...S(e,"bold"),fontSize:a.size.subtitle,lineHeight:Math.round(a.size.subtitle*a.lineHeight.snug)-1,color:r.brandInk,textAlign:"center"},body:{...S(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:t.sm,minHeight:t.xxl+t.sm,borderRadius:n.pill,paddingHorizontal:t.lg+t.xs/2,backgroundColor:r.brand,alignItems:"center",justifyContent:"center",...J(l.primaryButton)},actionDisabled:{opacity:.5},actionLabel:{...S(e,"bold"),color:r.onPrimary,fontSize:a.size.bodyTight,lineHeight:Math.round(a.size.bodyTight*a.lineHeight.snug)-1,...Z(l.primaryButton)}})}o(Go,"makeStyles");var Qo=120,Jo=44;function Zo({reason:e,onExit:r,exitLabel:t,style:n}){let{color:a,space:l,radius:s,type:c}=w();return jsxRuntime.jsxs(reactNative.View,{testID:"records-gate-off",style:[{minHeight:Qo,justifyContent:"center",gap:l.md,padding:l.lg,borderRadius:s.md,borderWidth:1,borderColor:a.brandBorder,backgroundColor:a.surfaceCream},n],children:[e.length>0?jsxRuntime.jsx(g,{style:{fontSize:c.size.bodyTight,color:a.text.muted},children:e}):null,jsxRuntime.jsx(reactNative.Pressable,{onPress:r,accessibilityRole:"button",accessibilityLabel:t,testID:"records-gate-off-exit",style:{minHeight:Jo,alignSelf:"flex-start",justifyContent:"center",paddingHorizontal:l.lg,borderRadius:s.pill,borderWidth:1.5,borderColor:a.brand},children:jsxRuntime.jsx(g,{style:{fontSize:c.size.body,color:a.brand},children:t})})]})}o(Zo,"RecordsGateOffState");function Dr(e,r){return e===void 0?{}:{renderDisabled:o(t=>jsxRuntime.jsx(Zo,{reason:t.disabled?.reason??"",onExit:e,exitLabel:r}),"renderDisabled")}}o(Dr,"recordsGateExit");var Ze="Back";function _e({title:e,onBack:r,right:t,testID:n,variant:a="brand"}){let l=oi();return jsxRuntime.jsxs(reactNative.View,{style:l.row,testID:n,children:[r?jsxRuntime.jsx(reactNative.Pressable,{onPress:r,accessibilityRole:"button",accessibilityLabel:Ze,hitSlop:12,style:l.back,testID:n?`${n}-back`:void 0,children:jsxRuntime.jsx(reactNative.View,{style:l.chevron,accessibilityElementsHidden:true,importantForAccessibility:"no"})}):jsxRuntime.jsx(reactNative.View,{style:l.back}),jsxRuntime.jsx(g,{style:a==="document"?l.documentTitle:l.title,accessibilityRole:"header",numberOfLines:1,children:e}),jsxRuntime.jsx(reactNative.View,{style:l.right,children:t??jsxRuntime.jsx(reactNative.View,{style:l.back})})]})}o(_e,"ScreenHeader");function oi(){let e=w();return react.useMemo(()=>ii(e),[e])}o(oi,"useStyles");function ii(e){let{color:r,space:t,type:n}=e,a=t.xxl+t.md,l=t.md,s=t.xs/2,c=t.lg+t.xs+t.xs/2;return reactNative.StyleSheet.create({row:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:t.lg,paddingTop:t.xs,paddingBottom:t.md,gap:t.sm},back:{width:a,height:a,alignItems:"center",justifyContent:"center"},chevron:{width:l,height:l,borderLeftWidth:s,borderBottomWidth:s,borderColor:r.brandInk,transform:[{rotate:"45deg"}],marginLeft:t.xs},title:{flex:1,...S(e,"bold"),fontSize:n.size.heading,lineHeight:Math.round(n.size.heading*n.lineHeight.tight)+1,color:r.brandInk},documentTitle:{flex:1,textAlign:"center",...S(e,"bold"),fontSize:n.size.subtitle,lineHeight:Math.round(n.size.subtitle*n.lineHeight.snug),color:r.text.primary},right:{flexDirection:"row",alignItems:"center",gap:t.sm+t.xs/2},listGlyph:{width:c,height:c,justifyContent:"space-evenly"},listBar:{height:s,borderRadius:s,backgroundColor:r.brandInk},shareGlyph:{width:c-t.xs,height:c-t.xs},shareDot:{position:"absolute",width:t.xs+t.xs/2,height:t.xs+t.xs/2,borderRadius:t.xs,borderWidth:s,borderColor:r.brandInk},shareDotTop:{right:0,top:0},shareDotLeft:{left:0,top:t.xs+t.xs/2},shareDotBottom:{right:0,bottom:0},shareStroke:{position:"absolute",left:t.xs,top:t.sm,width:t.sm+t.xs/2,height:s,backgroundColor:r.brandInk},shareStrokeUp:{transform:[{rotate:"-30deg"}]},shareStrokeDown:{transform:[{rotate:"30deg"}]},sendGlyph:{width:c-t.xs,height:c-t.xs},sendBody:{position:"absolute",left:0,top:0,right:0,bottom:0,borderWidth:s,borderColor:r.brandInk,transform:[{rotate:"45deg"}],borderRadius:s},sendFold:{position:"absolute",left:0,right:0,top:"50%",height:s,backgroundColor:r.brandInk},downloadGlyph:{width:c-t.xs,height:c-t.xs,alignItems:"center"},downloadStem:{width:s,height:t.sm+t.xs/2,backgroundColor:r.brandInk},downloadHead:{width:t.sm,height:t.sm,borderRightWidth:s,borderBottomWidth:s,borderColor:r.brandInk,transform:[{rotate:"45deg"}],marginTop:-t.sm},downloadTray:{position:"absolute",bottom:0,left:0,right:0,height:t.xs+t.xs/2,borderLeftWidth:s,borderRightWidth:s,borderBottomWidth:s,borderColor:r.brandInk}})}o(ii,"makeStyles");function K({width:e,height:r,radius:t,style:n}){let{color:a,radius:l}=w();return jsxRuntime.jsx(reactNative.View,{style:[{width:e,height:r,borderRadius:t??l.xs,backgroundColor:a.skeleton},n],accessibilityElementsHidden:true,importantForAccessibility:"no"})}o(K,"SkeletonBlock");var li=44,di=24,et=34,ci=6;function Ar({testID:e}){let r=ui();return jsxRuntime.jsxs(reactNative.View,{style:r.timeline,accessible:true,accessibilityRole:"progressbar",accessibilityLabel:b.loadingTimeline,testID:e,children:[jsxRuntime.jsx(reactNative.View,{style:r.timelineDisclaimer,children:jsxRuntime.jsx(K,{width:"100%",height:li,radius:12})}),Array.from({length:ci},(t,n)=>jsxRuntime.jsxs(reactNative.View,{children:[n>0?jsxRuntime.jsx(reactNative.View,{style:r.timelineSeparator}):null,jsxRuntime.jsxs(reactNative.View,{style:r.timelineRow,children:[jsxRuntime.jsx(K,{width:et,height:et,radius:et/2}),jsxRuntime.jsxs(reactNative.View,{style:r.timelineBody,children:[jsxRuntime.jsxs(reactNative.View,{style:r.timelineTop,children:[jsxRuntime.jsx(K,{width:44,height:10,radius:5}),jsxRuntime.jsx(K,{width:56,height:12,radius:6})]}),jsxRuntime.jsx(K,{width:"70%",height:14,radius:7}),n%2===0?jsxRuntime.jsx(K,{width:"45%",height:12,radius:6}):null]})]})]},n))]})}o(Ar,"TimelineSkeleton");var tt=62;function ui(){let e=w();return react.useMemo(()=>pi(e),[e])}o(ui,"useStyles");function pi(e){let{color:r,space:t,radius:n}=e,a=reactNative.StyleSheet.hairlineWidth;return reactNative.StyleSheet.create({dashboard:{flex:1,paddingHorizontal:t.sm,paddingTop:t.xs,gap:t.lg,backgroundColor:r.background},inset:{paddingHorizontal:t.sm},summaryCard:{alignItems:"center",borderRadius:n.lg-t.xs,borderWidth:a,borderColor:r.brandBorder,backgroundColor:r.surface,paddingHorizontal:t.lg,paddingVertical:t.lg+t.xs,gap:t.md+t.xs/2},badges:{flexDirection:"row",gap:t.md},carouselCard:{borderRadius:n.lg-t.xs,borderWidth:a,borderColor:r.brandBorder,backgroundColor:r.surface,padding:t.lg},dots:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:t.xs+t.xs/2},centered:{alignSelf:"center"},actions:{gap:t.sm+t.xs/2},actionRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",borderRadius:n.md,borderWidth:a,borderColor:r.brandBorder,backgroundColor:r.surface,paddingHorizontal:t.lg,paddingVertical:t.lg},actionLeft:{flex:1,flexDirection:"row",alignItems:"center",gap:t.md},request:{paddingHorizontal:t.lg,paddingTop:t.xs,gap:t.lg+t.xs/2,backgroundColor:r.background},railRow:{flexDirection:"row",alignItems:"flex-start",gap:t.md},railColumn:{alignItems:"center",width:di},connector:{marginVertical:t.xs/2},railBody:{flex:1,paddingBottom:t.lg+t.xs/2,gap:t.xs+t.xs/2},statusCard:{borderRadius:n.md,backgroundColor:r.brandSoft,padding:t.md+t.xs/2,gap:t.sm},timeline:{flex:1,backgroundColor:r.background},timelineDisclaimer:{paddingHorizontal:t.lg,paddingTop:t.xs,paddingBottom:t.md},timelineRow:{flexDirection:"row",gap:t.md,paddingHorizontal:t.lg,paddingVertical:t.md+t.xs/2},timelineBody:{flex:1,gap:t.xs-1},timelineTop:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:t.sm},timelineSeparator:{height:a,backgroundColor:r.brandBorder,marginLeft:tt},clinics:{gap:t.md},clinicRow:{borderRadius:n.lg-t.xs/2,borderWidth:a,borderColor:r.brandBorder,backgroundColor:r.surface,paddingHorizontal:t.md+t.xs/2,paddingVertical:t.md+t.xs/2,gap:t.sm},shares:{gap:t.md,padding:t.md,borderRadius:n.md,backgroundColor:r.surfaceCream,borderWidth:a,borderColor:r.brandBorder},shareRow:{gap:t.xs+t.xs/2}})}o(pi,"makeStyles");var hi=300,Ri=o((e,r)=>e.getTimeline(r),"readTimeline"),vi=o(e=>e.isEmpty,"timelineEmpty"),_i=o((e,r)=>e.getRecordDepth(r),"readDepth"),Ei=o(e=>!e.available||e.labResults.length+e.encounters.length+e.clinicianNotes.length+e.physicalExams.length===0,"depthEmpty"),wi=o(e=>e.contributions.length===0,"contributionsEmpty");function xi({petRef:e,style:r,onBack:t}){let n=ae(e,Ri,vi);return jsxRuntime.jsx(nt,{state:n,style:r,onBack:t,header:jsxRuntime.jsx(_e,{title:b.timeline,onBack:ee(t),testID:"timeline-header"}),loading:jsxRuntime.jsx(Ar,{testID:"timeline-loading"}),empty:jsxRuntime.jsx(Re,{variant:"no_records",testID:"timeline-empty"}),render:a=>jsxRuntime.jsx(Oi,{timeline:a})})}o(xi,"EverfurRecordsTimeline");function Ci({petRef:e,style:r,onBack:t}){let n=ae(e,_i,Ei);return jsxRuntime.jsx(nt,{state:n,style:r,onBack:t,header:t?jsxRuntime.jsx(_e,{title:W.records,onBack:ee(t)}):null,render:a=>jsxRuntime.jsx(Fi,{depth:a})})}o(Ci,"EverfurRecordDepth");function Si({petRef:e,docId:r,style:t,onBack:n}){let a=react.useCallback((c,i)=>c.getDocumentContributions(i,r),[r]),l=ae(e,a,wi,r),s=l.value?.document?.title?.trim()||b.uploadedDocument;return jsxRuntime.jsx(nt,{state:l,style:t,onBack:n,header:jsxRuntime.jsx(_e,{title:s,onBack:ee(n),testID:"contributions-header"}),empty:jsxRuntime.jsx(Re,{variant:"no_records",testID:"contributions-empty"}),render:c=>jsxRuntime.jsx(Ii,{view:c})})}o(Si,"EverfurDocumentContributions");function nt({state:e,style:r,header:t,loading:n,empty:a,render:l,onBack:s}){let c=we();return jsxRuntime.jsx(_r,{capability:"records",style:r,...Dr(ee(s),Ze),children:jsxRuntime.jsxs(reactNative.View,{style:[c.container,r],children:[t??null,jsxRuntime.jsx(reactNative.View,{style:c.body,children:Ti(e,l,c,n,a)}),jsxRuntime.jsx(Cr,{})]})})}o(nt,"DepthSurface");function Ti(e,r,t,n,a){switch(e.status){case "loading":return n??jsxRuntime.jsx(ki,{styles:t});case "empty":return a??jsxRuntime.jsx(reactNative.View,{style:t.centered,accessible:true,accessibilityRole:"summary",accessibilityLabel:W.empty,children:jsxRuntime.jsx(reactNative.View,{style:t.emptyGlyph})});case "error":return e.error?jsxRuntime.jsx(Re,{variant:Rt(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:r(e.value);default:return null}}o(Ti,"renderState");function ki({styles:e}){let[r,t]=react.useState(false);return react.useEffect(()=>{let n=setTimeout(()=>t(true),hi);return ()=>clearTimeout(n)},[]),jsxRuntime.jsx(reactNative.View,{style:e.centered,accessible:true,accessibilityState:{busy:true},accessibilityLabel:W.loading,children:r?jsxRuntime.jsx(reactNative.ActivityIndicator,{}):null})}o(ki,"LoadingState");function Oi({timeline:e}){let r=we(),t=Pe(e);return jsxRuntime.jsxs(reactNative.ScrollView,{style:r.list,contentContainerStyle:r.timelineContent,accessibilityLabel:b.timeline,children:[e.disclaimer.length>0?jsxRuntime.jsx(reactNative.View,{style:r.timelineBand,accessible:true,accessibilityRole:"text",accessibilityLabel:ht.important(e.disclaimer),children:jsxRuntime.jsx(g,{style:r.timelineBandText,children:e.disclaimer})}):null,t.map((n,a)=>jsxRuntime.jsxs(reactNative.View,{children:[a>0?jsxRuntime.jsx(reactNative.View,{style:r.timelineSeparator}):null,jsxRuntime.jsxs(reactNative.View,{style:r.timelineRow,accessible:true,accessibilityRole:"text",accessibilityLabel:[n.kindLabel,n.date,n.title,n.detail].filter(Boolean).join(", "),testID:`records-timeline-row-${n.kind}`,children:[jsxRuntime.jsx(reactNative.View,{style:r.timelineBubble,accessibilityElementsHidden:true,importantForAccessibility:"no"}),jsxRuntime.jsxs(reactNative.View,{style:r.timelineBody,children:[jsxRuntime.jsxs(reactNative.View,{style:r.topLine,children:[jsxRuntime.jsx(g,{style:r.timelineKind,children:n.kindLabel}),jsxRuntime.jsx(g,{style:r.date,children:n.date})]}),jsxRuntime.jsx(g,{style:r.timelineTitle,children:n.title}),n.detail?jsxRuntime.jsx(g,{style:r.rowDetail,children:n.detail}):null]})]})]},n.key))]})}o(Oi,"TimelineBody");function Ee({title:e,count:r,styles:t}){return jsxRuntime.jsx(g,{style:t.heading,accessibilityRole:"header",children:`${e} (${r})`})}o(Ee,"SectionHeader");function Fi({depth:e}){let r=we();return jsxRuntime.jsxs(reactNative.ScrollView,{style:r.list,contentContainerStyle:r.listContent,accessibilityLabel:W.records,children:[e.labResults.length>0?jsxRuntime.jsxs(reactNative.View,{style:r.section,children:[jsxRuntime.jsx(Ee,{title:b.labResults,count:e.labResults.length,styles:r}),jsxRuntime.jsx(reactNative.View,{style:r.card,children:e.labResults.map(t=>{let n=xt(t.latest.status),a=Tt(t.latest.at,t.trajectory,t.points.length);return jsxRuntime.jsxs(reactNative.View,{style:r.row,accessible:true,accessibilityRole:"text",accessibilityLabel:[t.name,De(t.latest.value,t.latest.unit,t.latest.qualitativeResult),n.label,a].filter(Boolean).join(", "),children:[jsxRuntime.jsx(g,{style:r.rowTitle,children:t.name}),jsxRuntime.jsx(g,{style:r.rowValue,children:De(t.latest.value,t.latest.unit,t.latest.qualitativeResult)}),a?jsxRuntime.jsx(g,{style:r.rowDetail,children:a}):null,jsxRuntime.jsx(g,{style:[r.chip,n.outOfRange?r.chipCritical:r.chipNeutral],children:n.label}),t.meaning?jsxRuntime.jsx(g,{style:r.rowDetail,children:t.meaning}):null]},t.markerId)})})]}):null,e.encounters.length>0?jsxRuntime.jsxs(reactNative.View,{style:r.section,children:[jsxRuntime.jsx(Ee,{title:b.visits,count:e.encounters.length,styles:r}),jsxRuntime.jsx(reactNative.View,{style:r.card,children:e.encounters.map(t=>{let n=[t.date?O(t.date):null,t.clinicName,t.veterinarian].filter(a=>a&&a!=="-").join(" \xB7 ");return jsxRuntime.jsxs(reactNative.View,{style:r.row,accessible:true,accessibilityRole:"text",children:[jsxRuntime.jsx(g,{style:r.rowTitle,children:t.type?fe(t.type):b.visit}),n?jsxRuntime.jsx(g,{style:r.rowDetail,children:n}):null]},t.encounterId)})})]}):null,e.physicalExams.length>0?jsxRuntime.jsxs(reactNative.View,{style:r.section,children:[jsxRuntime.jsx(Ee,{title:b.physicalExams,count:e.physicalExams.length,styles:r}),e.physicalExams.map(t=>jsxRuntime.jsxs(reactNative.View,{style:r.card,children:[jsxRuntime.jsx(g,{style:r.rowTitle,accessibilityRole:"header",children:t.observedOn?O(t.observedOn):b.exam}),t.systems.map(n=>{let a=n.findingStatus==="abnormal",l=a?b.abnormal:n.findingStatus==="not_examined"?b.notExamined:b.normal;return jsxRuntime.jsxs(reactNative.View,{style:r.row,accessible:true,accessibilityRole:"text",accessibilityLabel:[Ie(n.system),l,a?n.finding:null].filter(Boolean).join(", "),children:[jsxRuntime.jsx(g,{style:r.rowTitle,children:Ie(n.system)}),a&&n.finding?jsxRuntime.jsx(g,{style:r.rowDetail,children:n.finding}):null,jsxRuntime.jsx(g,{style:[r.chip,a?r.chipCaution:r.chipNeutral],children:l})]},n.system)})]},t.examId))]}):null,e.clinicianNotes.length>0?jsxRuntime.jsxs(reactNative.View,{style:r.section,children:[jsxRuntime.jsx(Ee,{title:b.visitNotes,count:e.clinicianNotes.length,styles:r}),e.clinicianNotes.map(t=>jsxRuntime.jsxs(reactNative.View,{style:r.card,children:[jsxRuntime.jsx(g,{style:r.rowTitle,accessibilityRole:"header",children:t.observedOn?O(t.observedOn):b.visitNote}),t.sections.map((n,a)=>jsxRuntime.jsxs(reactNative.View,{style:r.row,accessible:true,accessibilityRole:"text",children:[jsxRuntime.jsx(g,{style:r.kindLabel,children:Ct(n.section)}),jsxRuntime.jsx(g,{style:n.text?r.rowDetail:r.rowMuted,children:n.text||b.notRecorded})]},`${n.section}:${a}`))]},t.noteId))]}):null]})}o(Fi,"DepthBody");function Ii({view:e}){let r=we();return jsxRuntime.jsxs(reactNative.ScrollView,{style:r.list,contentContainerStyle:r.listContent,accessibilityLabel:W.records,children:[e.document?.receivedAt?jsxRuntime.jsx(g,{style:r.rowDetail,children:O(e.document.receivedAt)}):null,jsxRuntime.jsx(reactNative.View,{style:r.card,children:e.contributions.map(t=>jsxRuntime.jsxs(reactNative.View,{style:r.row,accessible:true,accessibilityRole:"text",children:[jsxRuntime.jsx(g,{style:r.rowTitle,children:t.label}),jsxRuntime.jsx(g,{style:r.rowValue,children:_t(t.value,t.unit)}),t.observedAt?jsxRuntime.jsx(g,{style:r.rowDetail,children:O(t.observedAt)}):null]},t.key))})]})}o(Ii,"ContributionsBody");function we(){let e=w();return react.useMemo(()=>Di(e),[e])}o(we,"useStyles");function Di(e){let{color:r,space:t,radius:n,type:a,slots:l}=e,{size:s,lineHeight:c}=a,i=o((I,j)=>Math.round(I*j),"lh"),u=reactNative.StyleSheet.hairlineWidth,y=t.xxl*3+t.xl,_=t.xxl+t.md,h=e.brightness==="dark"?r.errorRed:r.danger,E=Z(l.recordCard),C=o((I,j,z,H="regular")=>({...S(e,H),fontSize:I,lineHeight:i(I,j),color:z}),"text"),k=o((I,j,z,H="regular")=>({...C(I,j,z,H),...E}),"inCard");return reactNative.StyleSheet.create({container:{flex:1,minHeight:y,backgroundColor:r.background},body:{flex:1},centered:{minHeight:y,flexGrow:1,alignItems:"center",justifyContent:"center",padding:t.xl,gap:t.lg},emptyGlyph:{width:t.xxl+t.sm,height:t.xxl+t.sm,borderRadius:n.lg,backgroundColor:r.brandSoft,borderWidth:u,borderColor:r.brandBorder},errorText:{...C(s.subtitle,c.snug,h),textAlign:"center",marginBottom:t.md},primaryButton:{minHeight:_,minWidth:_,alignItems:"center",justifyContent:"center",paddingHorizontal:t.xl,paddingVertical:t.md,borderRadius:n.pill,backgroundColor:r.primary,...J(l.primaryButton)},primaryLabel:{...S(e,"bold"),color:r.onPrimary,fontSize:s.body,...Z(l.primaryButton)},list:{flex:1},listContent:{padding:t.lg,gap:t.md},section:{gap:t.sm},heading:{...C(s.heading,c.snug,r.text.primary,"bold")},card:{gap:t.sm,padding:t.md,borderRadius:n.md,backgroundColor:r.surfaceCream,borderWidth:u,borderColor:r.brandBorder,...J(l.recordCard,u)},row:{gap:t.xs,paddingVertical:t.xs,borderBottomWidth:u,borderBottomColor:r.borderHairlineGreen},topLine:{flexDirection:"row",justifyContent:"space-between",gap:t.md},kindLabel:{...k(s.caption,c.normal,r.text.muted,"medium")},date:k(s.caption,c.normal,r.text.muted),rowTitle:{...k(s.body,c.normal,r.text.primary,"bold")},rowValue:{...k(s.body,c.normal,r.text.primary,"medium")},rowDetail:k(s.bodyTight,c.normal,r.text.muted),rowMuted:{...k(s.bodyTight,c.normal,r.text.muted),opacity:.7},chip:{...C(s.caption,c.normal,r.text.primary),alignSelf:"flex-start",paddingHorizontal:t.sm,paddingVertical:t.xs,borderRadius:n.pill},chipNeutral:{backgroundColor:r.badgeBgNeutral},chipCaution:{backgroundColor:r.badgeBgCaution},chipCritical:{backgroundColor:r.badgeBgCritical},disclaimer:{...C(s.caption,c.normal,r.text.muted),marginTop:t.md},timelineContent:{paddingBottom:t.xxl},timelineBand:{flexDirection:"row",gap:t.sm,borderRadius:n.md-t.xs/2,padding:t.md,backgroundColor:r.brandSoft,marginHorizontal:t.lg,marginTop:t.xs,marginBottom:t.md},timelineBandText:{flex:1,...C(s.caption,c.normal,r.text.secondary)},timelineSeparator:{height:u,backgroundColor:r.brandBorder,marginLeft:tt},timelineRow:{flexDirection:"row",gap:t.md,paddingHorizontal:t.lg,paddingVertical:t.md+t.xs/2},timelineBubble:{width:t.xxl+t.xs/2,height:t.xxl+t.xs/2,borderRadius:n.pill,backgroundColor:r.brandSoft,borderWidth:u,borderColor:r.brandBorder},timelineBody:{flex:1,gap:t.xs-1},timelineKind:{...S(e,"mono"),fontSize:s.micro,lineHeight:s.bodyTight,letterSpacing:a.letterSpacing.eyebrow/3,textTransform:"uppercase",color:r.text.secondary},timelineTitle:{...C(s.body,c.normal,r.text.primary,"medium")}})}o(Di,"makeStyles");
2
+ exports.EverfurDocumentContributions=Si;exports.EverfurRecordDepth=Ci;exports.EverfurRecordsTimeline=xi;exports.buildTimelineRows=Pe;exports.mapDocumentContributions=sr;exports.mapRecordDepth=ir;exports.mapRecordsTimeline=ar;exports.useEverfurRecordsDepthClient=mr;exports.useRecordsDepthRead=ae;
@@ -1,13 +1,13 @@
1
- export { E as EverfurDocumentContributions, a as EverfurDocumentContributionsProps, b as EverfurRecordDepth, c as EverfurRecordsDepthProps, d as EverfurRecordsTimeline } from '../../DepthViews-DP0R-DhB.cjs';
2
- export { C as ClinicDraft, a as ClinicLocation, R as RecordsAskEntityRef, b as RecordsAskHandler, c as RecordsDepthStatus, d as RecordsHostSeams, e as RecordsScreen, f as RecordsScreenBaseProps, g as RecordsUrlKind, U as UseRecordsDepthState, u as useEverfurRecordsDepthClient, h as useRecordsDepthRead } from '../../useRecordsDepth-BHBzJ76R.cjs';
3
- export { T as TimelineRow, a as TimelineRowKind, b as buildTimelineRows } from '../../timelineRows-CaohZzXS.cjs';
4
- export { R as RecordClinicianNote, a as RecordClinicianNoteSection, b as RecordCompleteness, c as RecordConflict, d as RecordConflictCandidate, e as RecordDepthView, f as RecordDocumentContributionsView, g as RecordEncounter, h as RecordExamSystem, i as RecordLabMarker, j as RecordLabPoint, k as RecordPhysicalExam, l as RecordsClinic, m as RecordsDepthClient, n as RecordsTimelineMedication, o as RecordsTimelineVaccine, p as RecordsTimelineView, q as RecordsTimelineVisit, r as RecordsTimelineWeight, s as mapDocumentContributions, t as mapRecordDepth, u as mapRecordsTimeline } from '../../depth-CErXCU8J.cjs';
1
+ export { E as EverfurDocumentContributions, a as EverfurDocumentContributionsProps, b as EverfurRecordDepth, c as EverfurRecordsDepthProps, d as EverfurRecordsTimeline } from '../../DepthViews-B_hIypI6.cjs';
2
+ export { C as ClinicDraft, a as ClinicLocation, R as RecordsAskEntityRef, b as RecordsAskHandler, c as RecordsDepthStatus, d as RecordsHostSeams, e as RecordsScreen, f as RecordsScreenBaseProps, g as RecordsUrlKind, U as UseRecordsDepthState, u as useEverfurRecordsDepthClient, h as useRecordsDepthRead } from '../../useRecordsDepth-C6rjEaLn.cjs';
3
+ export { T as TimelineRow, a as TimelineRowKind, b as buildTimelineRows } from '../../timelineRows-odO8g9r2.cjs';
4
+ export { R as RecordClinicianNote, a as RecordClinicianNoteSection, b as RecordCompleteness, c as RecordConflict, d as RecordConflictCandidate, e as RecordDepthView, f as RecordDocumentContributionsView, g as RecordEncounter, h as RecordExamSystem, i as RecordLabMarker, j as RecordLabPoint, k as RecordPhysicalExam, l as RecordsClinic, m as RecordsDepthClient, n as RecordsRequestDocument, o as RecordsTimelineMedication, p as RecordsTimelineVaccine, q as RecordsTimelineView, r as RecordsTimelineVisit, s as RecordsTimelineWeight, t as mapDocumentContributions, u as mapRecordDepth, v as mapRecordsTimeline } from '../../depth-D5HwcvKC.cjs';
5
5
  export { B as Brand, P as PetRef, R as RecordsRequestId, _ as __brand } from '../../ids-B2GAAifq.cjs';
6
6
  export { E as EverfurError, a as EverfurErrorCategory, b as EverfurErrorCode, c as EverfurResult } from '../../EverfurResult-DN9pL2Ab.cjs';
7
7
  export { R as RecordDocumentMeta, a as RecordEntity, b as RecordOrigin } from '../../models-D2EUxPZY.cjs';
8
8
  import 'react';
9
9
  import 'react-native';
10
- import '../../requestFunnel-L-BQfi0z.cjs';
10
+ import '../../requestFunnel-BjDpqqvm.cjs';
11
11
  import '../../ErrorPolicyPort-CNf4uQZP.cjs';
12
- import '../../config-CzTZGlfF.cjs';
13
- import '../../identity-DI4eVx9S.cjs';
12
+ import '../../config--Wu1Umhd.cjs';
13
+ import '../../identity-C2-08BZW.cjs';
@@ -1,13 +1,13 @@
1
- export { E as EverfurDocumentContributions, a as EverfurDocumentContributionsProps, b as EverfurRecordDepth, c as EverfurRecordsDepthProps, d as EverfurRecordsTimeline } from '../../DepthViews-D_3hl4xk.js';
2
- export { C as ClinicDraft, a as ClinicLocation, R as RecordsAskEntityRef, b as RecordsAskHandler, c as RecordsDepthStatus, d as RecordsHostSeams, e as RecordsScreen, f as RecordsScreenBaseProps, g as RecordsUrlKind, U as UseRecordsDepthState, u as useEverfurRecordsDepthClient, h as useRecordsDepthRead } from '../../useRecordsDepth-BU-OhzH6.js';
3
- export { T as TimelineRow, a as TimelineRowKind, b as buildTimelineRows } from '../../timelineRows-DZed6dAM.js';
4
- export { R as RecordClinicianNote, a as RecordClinicianNoteSection, b as RecordCompleteness, c as RecordConflict, d as RecordConflictCandidate, e as RecordDepthView, f as RecordDocumentContributionsView, g as RecordEncounter, h as RecordExamSystem, i as RecordLabMarker, j as RecordLabPoint, k as RecordPhysicalExam, l as RecordsClinic, m as RecordsDepthClient, n as RecordsTimelineMedication, o as RecordsTimelineVaccine, p as RecordsTimelineView, q as RecordsTimelineVisit, r as RecordsTimelineWeight, s as mapDocumentContributions, t as mapRecordDepth, u as mapRecordsTimeline } from '../../depth-DjDcJ6kH.js';
1
+ export { E as EverfurDocumentContributions, a as EverfurDocumentContributionsProps, b as EverfurRecordDepth, c as EverfurRecordsDepthProps, d as EverfurRecordsTimeline } from '../../DepthViews-CkYri51q.js';
2
+ export { C as ClinicDraft, a as ClinicLocation, R as RecordsAskEntityRef, b as RecordsAskHandler, c as RecordsDepthStatus, d as RecordsHostSeams, e as RecordsScreen, f as RecordsScreenBaseProps, g as RecordsUrlKind, U as UseRecordsDepthState, u as useEverfurRecordsDepthClient, h as useRecordsDepthRead } from '../../useRecordsDepth-crhBllQK.js';
3
+ export { T as TimelineRow, a as TimelineRowKind, b as buildTimelineRows } from '../../timelineRows-C15jxFFH.js';
4
+ export { R as RecordClinicianNote, a as RecordClinicianNoteSection, b as RecordCompleteness, c as RecordConflict, d as RecordConflictCandidate, e as RecordDepthView, f as RecordDocumentContributionsView, g as RecordEncounter, h as RecordExamSystem, i as RecordLabMarker, j as RecordLabPoint, k as RecordPhysicalExam, l as RecordsClinic, m as RecordsDepthClient, n as RecordsRequestDocument, o as RecordsTimelineMedication, p as RecordsTimelineVaccine, q as RecordsTimelineView, r as RecordsTimelineVisit, s as RecordsTimelineWeight, t as mapDocumentContributions, u as mapRecordDepth, v as mapRecordsTimeline } from '../../depth-DvPwPuT_.js';
5
5
  export { B as Brand, P as PetRef, R as RecordsRequestId, _ as __brand } from '../../ids-B2GAAifq.js';
6
6
  export { E as EverfurError, a as EverfurErrorCategory, b as EverfurErrorCode, c as EverfurResult } from '../../EverfurResult-DN9pL2Ab.js';
7
7
  export { R as RecordDocumentMeta, a as RecordEntity, b as RecordOrigin } from '../../models-B-Uh2LTf.js';
8
8
  import 'react';
9
9
  import 'react-native';
10
- import '../../requestFunnel-CjW7uDuA.js';
10
+ import '../../requestFunnel-DFMGcluw.js';
11
11
  import '../../ErrorPolicyPort-CwbfmxzJ.js';
12
- import '../../config-DW60uRb9.js';
13
- import '../../identity-BMx2SUOM.js';
12
+ import '../../config-C7eb_IMD.js';
13
+ import '../../identity-CEi9GRFZ.js';