@everfur/sdk 1.5.1 → 1.5.2

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 (79) hide show
  1. package/dist/care/index.cjs +2 -2
  2. package/dist/care/index.js +2 -2
  3. package/dist/chat/index.cjs +235 -234
  4. package/dist/chat/index.js +311 -310
  5. package/dist/chat/lite/index.cjs +339 -338
  6. package/dist/chat/lite/index.js +314 -313
  7. package/dist/{chunk-NBAOR5TJ.js → chunk-2T5CB5MW.js} +21 -21
  8. package/dist/{chunk-RD6ZGYEJ.js → chunk-ASE36WGP.js} +7 -7
  9. package/dist/{chunk-IO4CGYHT.js → chunk-CMDCBYUH.js} +1 -1
  10. package/dist/{chunk-ZYHPCQVM.js → chunk-K7YHXFPQ.js} +1 -1
  11. package/dist/client/index.cjs +1 -1
  12. package/dist/client/index.d.cts +1 -1
  13. package/dist/client/index.d.ts +1 -1
  14. package/dist/client/index.js +1 -1
  15. package/dist/core/index.cjs +31 -31
  16. package/dist/core/index.js +31 -31
  17. package/dist/health-plan/index.cjs +266 -266
  18. package/dist/health-plan/index.js +443 -443
  19. package/dist/{inbox.d-DJ9xgU1Z.d.ts → inbox.d-B2JXK0uI.d.ts} +1 -1
  20. package/dist/{inbox.d-CPcMMz-Y.d.cts → inbox.d-CwA1ogzV.d.cts} +1 -1
  21. package/dist/index.cjs +257 -256
  22. package/dist/index.js +364 -363
  23. package/dist/notifications/inbox/index.cjs +28 -28
  24. package/dist/notifications/inbox/index.d.cts +5 -5
  25. package/dist/notifications/inbox/index.d.ts +5 -5
  26. package/dist/notifications/inbox/index.js +53 -53
  27. package/dist/notifications/index.cjs +1 -1
  28. package/dist/notifications/index.d.cts +3 -3
  29. package/dist/notifications/index.d.ts +3 -3
  30. package/dist/notifications/index.js +1 -1
  31. package/dist/{parse.d-Cj3fURer.d.ts → parse.d-QjB2LJCd.d.ts} +19 -10
  32. package/dist/{parse.d-cH7ZmMeo.d.cts → parse.d-_Ttu2h5g.d.cts} +19 -10
  33. package/dist/records/depth/index.cjs +80 -80
  34. package/dist/records/depth/index.js +115 -115
  35. package/dist/records/index.cjs +653 -653
  36. package/dist/records/index.js +1074 -1074
  37. package/dist/{route.d-DSYEd2MR.d.ts → route.d-DtuKY5dM.d.ts} +1 -1
  38. package/dist/{route.d-DCzQh4ix.d.cts → route.d-Nt-r-7IO.d.cts} +1 -1
  39. package/dist/server/events/index.cjs +1 -1
  40. package/dist/server/events/index.js +1 -1
  41. package/dist/server/index.cjs +1 -1
  42. package/dist/server/index.js +1 -1
  43. package/dist/shop/index.cjs +188 -188
  44. package/dist/shop/index.js +386 -386
  45. package/dist/shop/orders-v2/index.cjs +72 -72
  46. package/dist/shop/orders-v2/index.js +126 -126
  47. package/dist/tabs/index.cjs +114 -111
  48. package/dist/tabs/index.d.cts +18 -5
  49. package/dist/tabs/index.d.ts +18 -5
  50. package/dist/tabs/index.js +191 -188
  51. package/dist/televet/booking/index.cjs +214 -211
  52. package/dist/televet/booking/index.js +344 -341
  53. package/dist/televet/call/index.cjs +53 -53
  54. package/dist/televet/call/index.js +67 -67
  55. package/dist/{useInboxUnread.d-CXiaR3BZ.d.ts → useInboxUnread.d-0DrQPn7J.d.ts} +1 -1
  56. package/dist/{useInboxUnread.d-DERpMelw.d.cts → useInboxUnread.d-CRcOTkmu.d.cts} +1 -1
  57. package/dist/web/health-plan/index.cjs +1 -1
  58. package/dist/web/health-plan/index.js +1 -1
  59. package/dist/web/inbox/index.cjs +1 -1
  60. package/dist/web/inbox/index.d.cts +6 -6
  61. package/dist/web/inbox/index.d.ts +6 -6
  62. package/dist/web/inbox/index.js +1 -1
  63. package/dist/web/index.cjs +184 -184
  64. package/dist/web/index.js +181 -181
  65. package/dist/web/notifications/index.cjs +1 -1
  66. package/dist/web/notifications/index.d.cts +2 -2
  67. package/dist/web/notifications/index.d.ts +2 -2
  68. package/dist/web/notifications/index.js +1 -1
  69. package/dist/web/records-sheet/index.cjs +1 -1
  70. package/dist/web/records-sheet/index.js +1 -1
  71. package/dist/web/shop/index.cjs +1 -1
  72. package/dist/web/shop/index.js +2 -2
  73. package/dist/web/televet/booking/index.cjs +1 -1
  74. package/dist/web/televet/booking/index.js +1 -1
  75. package/dist/web/televet/call/index.cjs +1 -1
  76. package/dist/web/televet/call/index.js +1 -1
  77. package/dist/web/ui/index.cjs +1 -1
  78. package/dist/web/ui/index.js +16 -16
  79. package/package.json +1 -1
@@ -1,70 +1,70 @@
1
1
  /*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
2
- import{createContext,forwardRef as e,createElement as t,useMemo as r,useRef as o,useEffect as l,useState as n,useCallback as i,useContext as a}from"react";import{TextInput as c,StyleSheet as s,useWindowDimensions as d,View as u,Pressable as f,Text as b,Animated as g}from"react-native";import{useSafeAreaInsets as h}from"react-native-safe-area-context";import{jsxs as p,jsx as m,Fragment as y}from"react/jsx-runtime";var v=/* @__PURE__ */Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});function face(e,t){let r=e.type,o=r.families[t];return t==="mono"||r.namedFaces[t]?{fontFamily:o}:{fontFamily:o,fontWeight:r.weight[v[t]]}}function headingFace(e,t="bold"){let{headingFamily:r,headingWeight:o}=e.type;if(r===null&&o===null)return face(e,t);if(r!==null)return{fontFamily:r,fontWeight:o??e.type.weight[v[t]]};let l=face(e,t);return l.fontWeight===void 0||o===null?l:{fontFamily:l.fontFamily,fontWeight:o}}function C(e){return e<=450?"regular":e<=650?"medium":"bold"}var w={regular:"mono",medium:"monoMedium",bold:"monoBold"};function textRole(e,t){let r=F.get(e);r===void 0&&(r=/* @__PURE__ */new Map,F.set(e,r));let o=r.get(t);if(o!==void 0)return o;let l=x(e,t);return r.set(t,l),l}var F=/* @__PURE__ */new WeakMap;function x(e,t){let r=e.type.roles[t],o=r.weight==="400"&&r.face!=="mono"?e.type.weight.regular:r.weight,l=C(Number(o)),n=r.face==="mono"?face(e,w[l]):r.face==="heading"?headingFace(e,l):face(e,l),i=r.face==="heading"?e.type.headingWeight??o:o,a=n.fontWeight===void 0?n:{fontFamily:n.fontFamily,fontWeight:i},c=r.size,s={...a,fontSize:c,lineHeight:Math.round(c*r.lineHeight*100)/100};return r.letterSpacing!==0&&(s.letterSpacing=Math.round(c*r.letterSpacing*100)/100),r.uppercase&&(s.textTransform="uppercase"),/* @__PURE__ */Object.freeze(s)}var B=/* @__PURE__ */Object.freeze({track(){},trackExpectedFailure(){}});function k(e,t){let r=globalThis.URL;if(typeof r=="function"){let o;try{o=t===void 0?new r(e):new r(e,t)}catch{return null}try{if(o.protocol)return o}catch{}}return D(e)}var z=/^([a-z][a-z0-9+.-]*):\/\/(?:([^:@/?#]*)(?::([^@/?#]*))?@)?(\[[0-9a-f:.]+\]|[\w.~-]+)(?::(\d*))?(\/[^?#]*)?(\?[^#]*)?(#.*)?$/i,S=/[\s\u0000-\u001f\u007f\\]/,T={"http:":"80","https:":"443"};function D(e,t){let r=e.trim();let o=S.test(r)?null:z.exec(r);if(o===null)return null;let[,l="",n="",i="",a="",c="",s="",d="",u=""]=o,f=`${l.toLowerCase()}:`,b=Number(c);if(b>65535)return null;let g=c===""||String(b)===T[f]?"":String(b),h=T[f]!==void 0,p=a.toLowerCase()+(g&&`:${g}`),m=s||(h?"/":""),y=n||i?`${n}${i&&`:${i}`}@`:"";return{href:`${f}//${y}${p}${m}${d}${u}`,protocol:f,username:n,password:i,hostname:a.toLowerCase(),port:g,origin:h?`${f}//${p}`:"null",pathname:m,search:d==="?"?"":d,hash:u==="#"?"":u}}function isSafeRoomUrl(e){return k(e.trim())?.protocol==="https:"}function isUsableRoomCredential(e,t){return isSafeRoomUrl(e)&&t.trim().length>0}function O(e){let t=globalThis.console;try{t?.error?.("[everfur] A host callback threw; the SDK ignored it.",e)}catch{}}function j(e){return(typeof e=="object"||typeof e=="function")&&e!==null&&typeof e.then=="function"}function R(e,...t){if(typeof e=="function")try{let r=e(...t);return j(r)&&Promise.resolve(r).then(void 0,O),r}catch(e){O(e);return}}var I=/* @__PURE__ */new WeakMap;function L(e){if(typeof e!="function")return;let t=I.get(e);if(t!==void 0)return t;let r=(...t)=>{R(e,...t)};return I.set(e,r),r}function H(e,t){let r=null;for(let o of t){let t=e[o];typeof t=="function"&&(r??={...e},r[o]=L(t))}return r??e}var E=10,M=/* @__PURE__ */Object.freeze({muteCta:"Mute",unmuteCta:"Unmute",cameraOffCta:"Camera off",cameraOnCta:"Camera on",leaveCta:"Leave",switchCameraCta:"Switch camera",speakerOffCta:"Speaker off",speakerOnCta:"Speaker on",lobbyTitleNoName:"Your vet is joining",lobbySubtitle:"",lobbyPrepLabel:"While you wait",lobbyPrepNoPet:"Have your pet nearby and somewhere well lit.",lobbyTitle:e=>{let t=e?.trim()??"";return t.length>0?`${t} is joining`:M.lobbyTitleNoName},lobbyPrep:e=>{let t=e?.trim()??"";return t.length>0?`Have ${t} nearby and somewhere well lit.`:M.lobbyPrepNoPet},lobbyDuration:e=>`${e} minutes`,waitingRoomLabel:"Waiting room",leaveWaitingRoomLabel:"Leave the waiting room",lobbyTipsTitle:e=>{let t=e?.trim()??"";return t.length>0?`Before ${t} joins`:M.lobbyPrepLabel},lobbyTipSpot:"Find a bright, quiet spot.",joinFailedReason:"That did not open. Try again.",recordingNoticeTitle:"This consultation is recorded.",recordingNoticeCta:"Continue to the call",recordingNoticeDecline:"Not now",selfCameraOffLabel:"Your camera is off"});function A(e){let t=Math.max(0,Math.floor(e/1e3)),r=String(t%60).padStart(2,"0"),o=Math.floor(t%3600/60),l=Math.floor(t/3600);return l>0?`${l}:${String(o).padStart(2,"0")}:${r}`:`${o}:${r}`}var W=/* @__PURE__ */Object.freeze({position:"absolute",top:0,right:0,bottom:0,left:0});var P=/* @__PURE__ */Object.freeze({display:/* @__PURE__ */Object.freeze({size:29,lineHeight:1.06,weight:"800",face:"heading",letterSpacing:-.01,uppercase:false,tier:"heading"}),title:/* @__PURE__ */Object.freeze({size:23,lineHeight:1.12,weight:"800",face:"heading",letterSpacing:-.01,uppercase:false,tier:"heading"}),cardTitle:/* @__PURE__ */Object.freeze({size:19,lineHeight:1.22,weight:"800",face:"sans",letterSpacing:0,uppercase:false,tier:"heading"}),rowTitle:/* @__PURE__ */Object.freeze({size:15.5,lineHeight:1.4,weight:"700",face:"sans",letterSpacing:0,uppercase:false,tier:"content"}),body:/* @__PURE__ */Object.freeze({size:15,lineHeight:1.5,weight:"400",face:"sans",letterSpacing:0,uppercase:false,tier:"content"}),message:/* @__PURE__ */Object.freeze({size:15.5,lineHeight:1.5,weight:"400",face:"sans",letterSpacing:0,uppercase:false,tier:"content"}),bodySmall:/* @__PURE__ */Object.freeze({size:14.5,lineHeight:1.4,weight:"400",face:"sans",letterSpacing:0,uppercase:false,tier:"content"}),caption:/* @__PURE__ */Object.freeze({size:13,lineHeight:1.4,weight:"400",face:"sans",letterSpacing:0,uppercase:false,tier:"content"}),label:/* @__PURE__ */Object.freeze({size:10.5,lineHeight:1.4,weight:"400",face:"mono",letterSpacing:.05,uppercase:true,tier:"compact"}),eyebrow:/* @__PURE__ */Object.freeze({size:15,lineHeight:1.5,weight:"400",face:"mono",letterSpacing:.07,uppercase:true,tier:"compact"}),chip:/* @__PURE__ */Object.freeze({size:15,lineHeight:1.3,weight:"600",face:"sans",letterSpacing:0,uppercase:false,tier:"compact"}),tab:/* @__PURE__ */Object.freeze({size:16,lineHeight:1.5,weight:"600",face:"sans",letterSpacing:0,uppercase:false,tier:"compact"}),button:/* @__PURE__ */Object.freeze({size:15,lineHeight:1.5,weight:"700",face:"sans",letterSpacing:0,uppercase:false,tier:"control"}),badge:/* @__PURE__ */Object.freeze({size:12,lineHeight:1.5,weight:"700",face:"sans",letterSpacing:0,uppercase:false,tier:"badge"})});var N=Object.freeze;function deepFreeze(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){N(e);for(let t of Object.keys(e))deepFreeze(e[t])}return e}var $=/* @__PURE__ */Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3});var V={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},G={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},U={nano:8,small:9,micro:10,tiny:11,caption:13,bodyTight:15,body:17,subtitle:20,heading:22,verdict:24},q={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},Y={regular:"400",medium:"500",bold:"700"},X={eyebrow:1,monoWide:.9,headerBrand:-.42,tight:-.35},J=0,K="System",_="monospace",Q=["content","heading","control","compact","badge"];function Z(e){let t={};for(let r of Q)t[r]=e;return t}var ee=[];function te(){return{family:K,mono:_,fontUrl:null,families:{regular:K,medium:K,bold:K,mono:_,monoMedium:_,monoBold:_},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:U,tierSizes:Z(U),lineHeight:q,weight:Y,letterSpacing:X,scale:1,maxScale:J,scaleCaps:$,headingFamily:null,headingWeight:null,fontSources:ee,roles:P,typeScale:1}}var re={},oe=/* @__PURE__ */Object.freeze({standard:/* @__PURE__ */Object.freeze([.2,0,0,1]),emphasized:/* @__PURE__ */Object.freeze([.2,.8,.2,1]),exit:/* @__PURE__ */Object.freeze([.4,0,1,1])});function cssCubicBezier(e){return`cubic-bezier(${e.join(", ")})`}var le={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:cssCubicBezier(oe.standard),emphasized:cssCubicBezier(oe.emphasized),exit:cssCubicBezier(oe.exit)},reducedMotion:false},ne={brand:"#10462E",brandSoft:"rgba(16,70,46,0.10)",brandSofter:"rgba(16,70,46,0.15)",brandBorder:"rgba(16,70,46,0.18)",borderHairlineGreen:"rgba(16,70,46,0.25)",brandBorderStrong:"rgba(16,70,46,0.55)",brandInk:"#10462E",linkInk:"#10462E",surface:"#FFFFFF",surfaceCream:"#FFFFFF",surfaceSubtle:"#F1F5F2",background:"#FFFFFF",borderRingCream:"#E4E4E4",chatGround:"#FFFFFF",composerFill:"#FFFFFF",composerBorder:"rgba(16,70,46,0.75)",shadow:"#0B3421",text:{primary:"#000000",secondary:"#0E462E",muted:"#6B6B6B",placeholder:"rgba(61,61,61,0.75)",onBrand:"#FFFFFF",metaCool:"#3D3D3D",timestamp:"rgba(61,61,61,0.75)"},primary:"#10462E",onPrimary:"#FFFFFF",accent:"#10462E",onAccent:"#FFFFFF",accentEdge:"#07C168",success:"#07C168",danger:"#C03410",onDanger:"#FFFFFF",errorRed:"#C03410",warningStrong:"#A45610",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.12)",badgeBgCaution:"rgba(217,130,29,0.14)",badgeBgCritical:"rgba(192,52,16,0.06)",badgeBgNeutral:"rgba(107,107,107,0.12)",bubbleUser:"#10462E",bubbleAssistant:"#FFFFFF",bubbleVet:"#FFC3BC",onBubbleVet:"#000000",skeleton:"#E9F1E9",scanButtonPink:"#FFC3BC",highlight:"#FFC3BC",onHighlight:"#000000",mark:"#07C168",controlEdge:"rgba(16,70,46,0.18)",structureEdge:"rgba(16,70,46,0.25)",primaryEdge:"#10462E",checkupCardLowRiskBg:"rgba(7,193,104,0.10)",checkupCardConcernBg:"rgba(239,167,0,0.10)",info:"#10462E",badgeBgInfo:"rgba(16,70,46,0.10)",infoEdge:"rgba(16,70,46,0.25)"},ie=deepFreeze({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:ne,space:V,radius:G,type:te(),motion:le,slots:re}),ae={brand:"#6BD39A",brandSoft:"rgba(107,211,154,0.12)",brandSofter:"rgba(107,211,154,0.18)",brandBorder:"rgba(107,211,154,0.22)",borderHairlineGreen:"rgba(107,211,154,0.28)",brandBorderStrong:"rgba(107,211,154,0.55)",brandInk:"#6BD39A",linkInk:"#6BD39A",surface:"#1C1F23",surfaceCream:"#23272C",surfaceSubtle:"#23272C",background:"#15171A",borderRingCream:"#3A3F45",chatGround:"#1C1F23",composerFill:"#23272C",composerBorder:"rgba(107,211,154,0.75)",shadow:"#000000",text:{primary:"#F5F3F0",secondary:"#A9E4C4",muted:"#9A9A9A",placeholder:"rgba(255,255,255,0.55)",onBrand:"#0E1F17",metaCool:"#C9C9C9",timestamp:"rgba(245,243,240,0.7)"},primary:"#6BD39A",onPrimary:"#0E1F17",accent:"#6BD39A",onAccent:"#0E1F17",accentEdge:"#34D888",success:"#07C168",danger:"#F87171",onDanger:"#0E1F17",errorRed:"#FF6B5B",warningStrong:"#F0A35E",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.18)",badgeBgCaution:"rgba(217,130,29,0.20)",badgeBgCritical:"rgba(185,28,28,0.22)",badgeBgNeutral:"rgba(255,255,255,0.10)",bubbleUser:"#6BD39A",bubbleAssistant:"#1C1F23",bubbleVet:"#FFC3BC",onBubbleVet:"#000000",skeleton:"#23272C",scanButtonPink:"#FFC3BC",highlight:"#605051",onHighlight:"#F5F3F0",mark:"#07C168",controlEdge:"rgba(107,211,154,0.22)",structureEdge:"rgba(107,211,154,0.28)",primaryEdge:"#6BD39A",checkupCardLowRiskBg:"rgba(7,193,104,0.16)",checkupCardConcernBg:"rgba(239,167,0,0.16)",info:"#6BD39A",badgeBgInfo:"rgba(107,211,154,0.12)",infoEdge:"rgba(107,211,154,0.28)"};deepFreeze({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:ae,space:V,radius:G,type:te(),motion:le,slots:re});var ce=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),se=globalThis,de=se[ce]??(se[ce]=createContext(ie));de.displayName??="EverfurThemeContext";function useEverfurTheme(){return a(de)}function ue(e,t){let r=e.scaleCaps[t];return r>0?r:void 0}function Text({tier:e,variant:r,...o}){let l=useEverfurTheme(),n=r===void 0?void 0:l.type.roles[r],i=ue(l.type,e??n?.tier??"content"),a=r===void 0?o:{...o,style:[{...textRole(l,r),color:l.color.text.primary,flexShrink:1},o.style]};return t(b,i===void 0?a:{maxFontSizeMultiplier:i,...a})}e(function(e,r){return t(c,{...e,...r===null?{}:{ref:r}})});function optionalModule(e,t,r){let o;try{o=t()}catch(t){return be(`optional peer '${e}' is not installed: ${ge(t)}`)}let l=fe(o);return l==null?be(`optional peer '${e}' resolved to no module`):r&&!r(l)?be(`optional peer '${e}' is present but failed its shape check`):/* @__PURE__ */Object.freeze({available:true,module:l})}function fe(e){return typeof e=="object"&&e!==null&&"default"in e&&Object.keys(e).length<=2?e.default:e}function be(e){/* @__PURE__ */
3
- return Object.freeze({available:false,module:null,reason:e})}function ge(e){return e instanceof Error?e.message:typeof e=="string"?e:"unknown load error"}var he=/* @__PURE__ */Symbol.for("@everfur/sdk/televet");function pe(){let e=globalThis,t=e[he];if(t!==void 0)return t;let r={presenter:null,snapshot:/* @__PURE__ */Object.freeze({request:null,serial:0,activeHost:null}),hosts:[],nextHost:1,listeners:/* @__PURE__ */new Set,dailyRegistered:false};return e[he]=r,r}function me(e){pe().dailyRegistered=e}var ye=`[everfur] The in-app vet call needs the Daily native modules, which this app has not registered. Install @daily-co/react-native-daily-js, @daily-co/react-native-webrtc and (Expo) @daily-co/config-plugin-rn-daily-js, rebuild the native app (a JS-only OTA cannot add a native module), and call registerEverfurDaily(() => require('@daily-co/react-native-daily-js')) once in your app entry. ON EXPO GO THIS CANNOT BE FIXED BY INSTALLING: Expo Go runs a fixed set of native modules and cannot load Daily at any version, so you need a development build (expo prebuild, then run the native app) before the in-app call works at all. Until then the in-app visit tells the member the call cannot be joined; <VetVisitButton prefer="redirect" /> is the explicit way to the hosted visit in the browser, which needs no native module.`,ve="@daily-co/react-native-daily-js",Ce=`optional peer '${ve}' has no registered loader`,we=`optional peer '${ve}' is present but failed its shape check`;function Fe(e){return typeof e=="object"&&e!==null}function xe(e){return Fe(e)&&"box"in e}function Be(e){let t=e.default,r=Fe(t)||typeof t=="function"?t:{},o=typeof e.createCallObject=="function"?e:r,l=o.createCallObject,n={createCallObject:typeof l=="function"?l.bind(o):l,DailyMediaView:e.DailyMediaView??r.DailyMediaView};return isEverfurDailyModule(n)?n:null}function isEverfurDailyModule(e){if(!Fe(e)||typeof e.createCallObject!="function")return false;let t=e.DailyMediaView;return typeof t=="function"||typeof t=="object"&&t!==null}var ke=null,ze=null;function Se(e){/* @__PURE__ */
4
- return Object.freeze({available:false,module:null,reason:e})}function registerEverfurDaily(e){ke=e,ze=null,me(e!==null)}function loadEverfurDaily(){if(ze!==null)return ze;let e=ke;if(e===null)return ze=Se(Ce),ze;let t=optionalModule(ve,()=>({box:e()}),xe);if(!t.available)return ze=Se(t.reason),ze;let r=t.module.box;if(!Fe(r))return ze=Se(we),ze;let o=Be(r);return ze=o===null?Se(we):/* @__PURE__ */Object.freeze({available:true,module:o}),ze}function CallControl({label:e,glyph:t,onPress:r,testID:o,muted:l=false,style:n}){/* @__PURE__ */
5
- return m(f,{onPress:r,testID:o,accessibilityRole:"button",accessibilityLabel:e,accessibilityState:{selected:l},style:n,children:t})}function GlyphBox({children:e,testID:t}){/* @__PURE__ */
6
- return m(u,{style:Te.box,accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants",testID:t,children:e})}function Slash({color:e}){/* @__PURE__ */
7
- return m(u,{style:[Te.slash,{backgroundColor:e}]})}function MicGlyph({color:e,off:t=false}){/* @__PURE__ */
8
- return p(GlyphBox,{testID:t?"glyph-mic-off":"glyph-mic",children:[
9
- /* @__PURE__ */p(u,{style:Te.column,children:[
10
- /* @__PURE__ */m(u,{style:[Te.micCapsule,{borderColor:e}]}),
11
- /* @__PURE__ */m(u,{style:[Te.micCradle,{borderColor:e}]}),
12
- /* @__PURE__ */m(u,{style:[Te.micStem,{backgroundColor:e}]})]}),t?/* @__PURE__ */m(Slash,{color:e}):null]})}function CameraGlyph({color:e,off:t=false}){/* @__PURE__ */
13
- return p(GlyphBox,{testID:t?"glyph-camera-off":"glyph-camera",children:[
14
- /* @__PURE__ */p(u,{style:Te.row,children:[
15
- /* @__PURE__ */m(u,{style:[Te.cameraBody,{borderColor:e}]}),
16
- /* @__PURE__ */m(u,{style:[Te.cameraLens,{borderRightColor:e}]})]}),t?/* @__PURE__ */m(Slash,{color:e}):null]})}function SpeakerGlyph({color:e,off:t=false}){/* @__PURE__ */
17
- return p(GlyphBox,{testID:t?"glyph-speaker-off":"glyph-speaker",children:[
18
- /* @__PURE__ */p(u,{style:Te.row,children:[
19
- /* @__PURE__ */m(u,{style:[Te.speakerBox,{backgroundColor:e}]}),
20
- /* @__PURE__ */m(u,{style:[Te.speakerCone,{borderRightColor:e}]}),t?null:/* @__PURE__ */m(u,{style:[Te.speakerWave,{borderColor:e}]})]}),t?/* @__PURE__ */m(Slash,{color:e}):null]})}function SwitchCameraGlyph({color:e}){/* @__PURE__ */
21
- return m(GlyphBox,{testID:"glyph-switch-camera",children:/* @__PURE__ */p(u,{style:[Te.switchBody,{borderColor:e}],children:[
22
- /* @__PURE__ */m(u,{style:[Te.switchTurn,{borderColor:e,borderTopColor:"transparent"}]}),
23
- /* @__PURE__ */m(u,{style:[Te.switchHead,{borderBottomColor:e}]})]})})}function LeaveGlyph({color:e}){/* @__PURE__ */
24
- return m(GlyphBox,{testID:"glyph-leave",children:/* @__PURE__ */p(u,{style:Te.column,children:[
25
- /* @__PURE__ */m(u,{style:[Te.receiver,{borderColor:e}]}),
26
- /* @__PURE__ */p(u,{style:Te.receiverPads,children:[
27
- /* @__PURE__ */m(u,{style:[Te.receiverPad,{backgroundColor:e}]}),
28
- /* @__PURE__ */m(u,{style:[Te.receiverPad,{backgroundColor:e}]})]})]})})}var Te=s.create({box:{width:24,height:24,alignItems:"center",justifyContent:"center"},row:{flexDirection:"row",alignItems:"center"},column:{alignItems:"center"},slash:{position:"absolute",width:2,height:28,borderRadius:1,transform:[{rotate:"-45deg"}]},micCapsule:{width:10,height:14,borderRadius:5,borderWidth:2},micCradle:{width:16,height:8,marginTop:-5,borderWidth:2,borderTopWidth:0,borderBottomLeftRadius:8,borderBottomRightRadius:8},micStem:{width:2,height:3},cameraBody:{width:14,height:12,borderRadius:3,borderWidth:2},cameraLens:{width:0,height:0,marginLeft:1,borderTopWidth:5,borderBottomWidth:5,borderRightWidth:6,borderTopColor:"transparent",borderBottomColor:"transparent"},speakerBox:{width:4,height:8,borderRadius:1},speakerCone:{width:0,height:0,borderTopWidth:7,borderBottomWidth:7,borderRightWidth:7,borderTopColor:"transparent",borderBottomColor:"transparent",transform:[{rotate:"180deg"}]},speakerWave:{width:7,height:12,marginLeft:2,borderWidth:2,borderLeftWidth:0,borderTopRightRadius:6,borderBottomRightRadius:6},switchBody:{width:20,height:15,borderRadius:3,borderWidth:2,alignItems:"center",justifyContent:"center"},switchTurn:{width:9,height:9,borderRadius:4.5,borderWidth:2},switchHead:{position:"absolute",top:2,right:4,width:0,height:0,borderLeftWidth:3,borderRightWidth:3,borderBottomWidth:4,borderLeftColor:"transparent",borderRightColor:"transparent"},receiver:{width:22,height:10,borderWidth:3,borderBottomWidth:0,borderTopLeftRadius:11,borderTopRightRadius:11},receiverPads:{flexDirection:"row",width:22,justifyContent:"space-between",marginTop:-1},receiverPad:{width:5,height:4,borderRadius:1}});var De=/* @__PURE__ */Object.freeze({surface:"rgba(255,255,255,0.08)",surfaceRaised:"rgba(255,255,255,0.14)",surfaceActive:"rgba(255,255,255,0.24)",hairline:"rgba(255,255,255,0.18)",glyph:"rgba(255,255,255,0.72)",textSecondary:"rgba(255,255,255,0.78)",textTertiary:"rgba(255,255,255,0.56)"}),Oe=3,je=180,Re=420,Ie=.35,Le=.6,He=360,Ee=132,Me=184,Ae=44;function We(e){return typeof e=="number"&&Number.isInteger(e)&&e>=1?e:10}function WaitingDots({reducedMotion:e,styles:t}){let r=o(Array.from({length:Oe},()=>new g.Value(Ie))).current;return l(()=>{if(e)return;let t=r.map((e,t)=>g.loop(g.sequence([g.delay(t*je),g.timing(e,{toValue:1,duration:Re,useNativeDriver:true}),g.timing(e,{toValue:Ie,duration:Re,useNativeDriver:true}),g.delay((Oe-t-1)*je)])));for(let e of t)e.start();return()=>{for(let e of t)e.stop()}},[e,r]),/* @__PURE__ */m(u,{style:t.dotRow,testID:"everfur-vet-lobby-dots",accessibilityElementsHidden:true,importantForAccessibility:"no",children:r.map((r,o)=>/* @__PURE__ */m(g.View,{style:[t.dot,{opacity:e?Le:r}]},o))})}function LobbyControl({label:e,glyph:t,active:r,onPress:o,testID:l,styles:n}){/* @__PURE__ */
29
- return m(f,{onPress:o,testID:l,accessibilityRole:"button",accessibilityState:{selected:!r},accessibilityLabel:e,style:[n.control,r?null:n.controlOff],children:t})}function EverfurVetCallLobby(e){let{clinicianName:t,petName:o,consultMinutes:l,micOn:n,cameraOn:i,onToggleMic:a,onToggleCamera:c,onSwitchCamera:s,onLeave:b,style:g}=e,y=useEverfurTheme(),v=r(()=>Pe(y),[y]),C=h(),{width:w}=d(),F=w<He?Ee:Me;/* @__PURE__ */
30
- return p(u,{style:[v.root,{paddingTop:C.top+y.space.sm,paddingBottom:C.bottom+y.space.lg},g],testID:"everfur-vet-lobby",children:[
31
- /* @__PURE__ */p(u,{style:v.topRow,children:[
32
- /* @__PURE__ */m(f,{onPress:b,accessibilityRole:"button",accessibilityLabel:M.leaveCta,testID:"everfur-vet-lobby-leave",hitSlop:12,style:v.leaveHit,children:/* @__PURE__ */m(Text,{tier:"control",style:v.leaveLabel,children:M.leaveCta})}),
33
- /* @__PURE__ */m(Text,{tier:"badge",style:v.prepLabel,testID:"everfur-vet-lobby-label",children:M.waitingRoomLabel})]}),
34
- /* @__PURE__ */p(u,{style:v.center,children:[
35
- /* @__PURE__ */p(u,{style:[v.avatar,{width:F,height:F,borderRadius:F/2}],testID:"everfur-vet-lobby-avatar",accessibilityElementsHidden:true,importantForAccessibility:"no",children:[
36
- /* @__PURE__ */m(u,{style:v.avatarGlyphHead}),
37
- /* @__PURE__ */m(u,{style:v.avatarGlyphBody})]}),
38
- /* @__PURE__ */m(u,{accessibilityLiveRegion:"polite",accessible:true,children:/* @__PURE__ */m(Text,{tier:"heading",style:v.title,testID:"everfur-vet-lobby-title",children:M.lobbyTitle(t)})}),
39
- /* @__PURE__ */m(WaitingDots,{reducedMotion:y.motion.reducedMotion,styles:v})]}),
40
- /* @__PURE__ */p(u,{style:v.prepCard,testID:"everfur-vet-lobby-prep",children:[
41
- /* @__PURE__ */m(Text,{tier:"badge",style:v.prepLabel,children:M.lobbyTipsTitle(t)}),[M.lobbyTipSpot,M.lobbyPrep(o)].map((e,t)=>/* @__PURE__ */p(u,{style:v.tip,children:[
2
+ import{createContext,forwardRef as e,createElement as t,useMemo as r,useRef as o,useEffect as l,useState as n,useCallback as i,useContext as a}from"react";import*as c from"react-native";import{TextInput as s,StyleSheet as d,useWindowDimensions as u,View as f,Pressable as b,Text as g,Animated as h}from"react-native";import{useSafeAreaInsets as p}from"react-native-safe-area-context";import{jsx as m,jsxs as y,Fragment as v}from"react/jsx-runtime";var C=/* @__PURE__ */Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});function face(e,t){let r=e.type,o=r.families[t];return t==="mono"||r.namedFaces[t]?{fontFamily:o}:{fontFamily:o,fontWeight:r.weight[C[t]]}}function headingFace(e,t="bold"){let{headingFamily:r,headingWeight:o}=e.type;if(r===null&&o===null)return face(e,t);if(r!==null)return{fontFamily:r,fontWeight:o??e.type.weight[C[t]]};let l=face(e,t);return l.fontWeight===void 0||o===null?l:{fontFamily:l.fontFamily,fontWeight:o}}function w(e){return e<=450?"regular":e<=650?"medium":"bold"}var F={regular:"mono",medium:"monoMedium",bold:"monoBold"};function textRole(e,t){let r=x.get(e);r===void 0&&(r=/* @__PURE__ */new Map,x.set(e,r));let o=r.get(t);if(o!==void 0)return o;let l=B(e,t);return r.set(t,l),l}var x=/* @__PURE__ */new WeakMap;function B(e,t){let r=e.type.roles[t],o=r.weight==="400"&&r.face!=="mono"?e.type.weight.regular:r.weight,l=w(Number(o)),n=r.face==="mono"?face(e,F[l]):r.face==="heading"?headingFace(e,l):face(e,l),i=r.face==="heading"?e.type.headingWeight??o:o,a=n.fontWeight===void 0?n:{fontFamily:n.fontFamily,fontWeight:i},c=r.size,s={...a,fontSize:c,lineHeight:Math.round(c*r.lineHeight*100)/100};return r.letterSpacing!==0&&(s.letterSpacing=Math.round(c*r.letterSpacing*100)/100),r.uppercase&&(s.textTransform="uppercase"),/* @__PURE__ */Object.freeze(s)}var k=/* @__PURE__ */Object.freeze({track(){},trackExpectedFailure(){}});function S(e,t){let r=globalThis.URL;if(typeof r=="function"){let o;try{o=t===void 0?new r(e):new r(e,t)}catch{return null}try{if(o.protocol)return o}catch{}}return O(e)}var z=/^([a-z][a-z0-9+.-]*):\/\/(?:([^:@/?#]*)(?::([^@/?#]*))?@)?(\[[0-9a-f:.]+\]|[\w.~-]+)(?::(\d*))?(\/[^?#]*)?(\?[^#]*)?(#.*)?$/i,T=/[\s\u0000-\u001f\u007f\\]/,D={"http:":"80","https:":"443"};function O(e,t){let r=e.trim();let o=T.test(r)?null:z.exec(r);if(o===null)return null;let[,l="",n="",i="",a="",c="",s="",d="",u=""]=o,f=`${l.toLowerCase()}:`,b=Number(c);if(b>65535)return null;let g=c===""||String(b)===D[f]?"":String(b),h=D[f]!==void 0,p=a.toLowerCase()+(g&&`:${g}`),m=s||(h?"/":""),y=n||i?`${n}${i&&`:${i}`}@`:"";return{href:`${f}//${y}${p}${m}${d}${u}`,protocol:f,username:n,password:i,hostname:a.toLowerCase(),port:g,origin:h?`${f}//${p}`:"null",pathname:m,search:d==="?"?"":d,hash:u==="#"?"":u}}function isSafeRoomUrl(e){return S(e.trim())?.protocol==="https:"}function isUsableRoomCredential(e,t){return isSafeRoomUrl(e)&&t.trim().length>0}function j(e){let t=globalThis.console;try{t?.error?.("[everfur] A host callback threw; the SDK ignored it.",e)}catch{}}function I(e){return(typeof e=="object"||typeof e=="function")&&e!==null&&typeof e.then=="function"}function R(e,...t){if(typeof e=="function")try{let r=e(...t);return I(r)&&Promise.resolve(r).then(void 0,j),r}catch(e){j(e);return}}var L=/* @__PURE__ */new WeakMap;function H(e){if(typeof e!="function")return;let t=L.get(e);if(t!==void 0)return t;let r=(...t)=>{R(e,...t)};return L.set(e,r),r}function E(e,t){let r=null;for(let o of t){let t=e[o];typeof t=="function"&&(r??={...e},r[o]=H(t))}return r??e}var M=10,W=/* @__PURE__ */Object.freeze({muteCta:"Mute",unmuteCta:"Unmute",cameraOffCta:"Camera off",cameraOnCta:"Camera on",leaveCta:"Leave",switchCameraCta:"Switch camera",speakerOffCta:"Speaker off",speakerOnCta:"Speaker on",lobbyTitleNoName:"Your vet is joining",lobbySubtitle:"",lobbyPrepLabel:"While you wait",lobbyPrepNoPet:"Have your pet nearby and somewhere well lit.",lobbyTitle:e=>{let t=e?.trim()??"";return t.length>0?`${t} is joining`:W.lobbyTitleNoName},lobbyPrep:e=>{let t=e?.trim()??"";return t.length>0?`Have ${t} nearby and somewhere well lit.`:W.lobbyPrepNoPet},lobbyDuration:e=>`${e} minutes`,waitingRoomLabel:"Waiting room",leaveWaitingRoomLabel:"Leave the waiting room",lobbyTipsTitle:e=>{let t=e?.trim()??"";return t.length>0?`Before ${t} joins`:W.lobbyPrepLabel},lobbyTipSpot:"Find a bright, quiet spot.",joinFailedReason:"That did not open. Try again.",recordingNoticeTitle:"This consultation is recorded.",recordingNoticeCta:"Continue to the call",recordingNoticeDecline:"Not now",selfCameraOffLabel:"Your camera is off"});function A(e){let t=Math.max(0,Math.floor(e/1e3)),r=String(t%60).padStart(2,"0"),o=Math.floor(t%3600/60),l=Math.floor(t/3600);return l>0?`${l}:${String(o).padStart(2,"0")}:${r}`:`${o}:${r}`}var P=/* @__PURE__ */Object.freeze({position:"absolute",top:0,right:0,bottom:0,left:0});var N=/* @__PURE__ */Object.freeze({display:/* @__PURE__ */Object.freeze({size:29,lineHeight:1.06,weight:"800",face:"heading",letterSpacing:-.01,uppercase:false,tier:"heading"}),title:/* @__PURE__ */Object.freeze({size:23,lineHeight:1.12,weight:"800",face:"heading",letterSpacing:-.01,uppercase:false,tier:"heading"}),cardTitle:/* @__PURE__ */Object.freeze({size:19,lineHeight:1.22,weight:"800",face:"sans",letterSpacing:0,uppercase:false,tier:"heading"}),rowTitle:/* @__PURE__ */Object.freeze({size:15.5,lineHeight:1.4,weight:"700",face:"sans",letterSpacing:0,uppercase:false,tier:"content"}),body:/* @__PURE__ */Object.freeze({size:15,lineHeight:1.5,weight:"400",face:"sans",letterSpacing:0,uppercase:false,tier:"content"}),message:/* @__PURE__ */Object.freeze({size:15.5,lineHeight:1.5,weight:"400",face:"sans",letterSpacing:0,uppercase:false,tier:"content"}),bodySmall:/* @__PURE__ */Object.freeze({size:14.5,lineHeight:1.4,weight:"400",face:"sans",letterSpacing:0,uppercase:false,tier:"content"}),caption:/* @__PURE__ */Object.freeze({size:13,lineHeight:1.4,weight:"400",face:"sans",letterSpacing:0,uppercase:false,tier:"content"}),label:/* @__PURE__ */Object.freeze({size:10.5,lineHeight:1.4,weight:"400",face:"mono",letterSpacing:.05,uppercase:true,tier:"compact"}),eyebrow:/* @__PURE__ */Object.freeze({size:15,lineHeight:1.5,weight:"400",face:"mono",letterSpacing:.07,uppercase:true,tier:"compact"}),chip:/* @__PURE__ */Object.freeze({size:15,lineHeight:1.3,weight:"600",face:"sans",letterSpacing:0,uppercase:false,tier:"compact"}),tab:/* @__PURE__ */Object.freeze({size:16,lineHeight:1.5,weight:"600",face:"sans",letterSpacing:0,uppercase:false,tier:"compact"}),button:/* @__PURE__ */Object.freeze({size:15,lineHeight:1.5,weight:"700",face:"sans",letterSpacing:0,uppercase:false,tier:"control"}),badge:/* @__PURE__ */Object.freeze({size:12,lineHeight:1.5,weight:"700",face:"sans",letterSpacing:0,uppercase:false,tier:"badge"})});var $=Object.freeze;function deepFreeze(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){$(e);for(let t of Object.keys(e))deepFreeze(e[t])}return e}var G=/* @__PURE__ */Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3});var V={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},U={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},q={nano:8,small:9,micro:10,tiny:11,caption:13,bodyTight:15,body:17,subtitle:20,heading:22,verdict:24},Y={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},X={regular:"400",medium:"500",bold:"700"},J={eyebrow:1,monoWide:.9,headerBrand:-.42,tight:-.35},K=0,_="System",Q="monospace",Z=["content","heading","control","compact","badge"];function ee(e){let t={};for(let r of Z)t[r]=e;return t}var te=[];function re(){return{family:_,mono:Q,fontUrl:null,families:{regular:_,medium:_,bold:_,mono:Q,monoMedium:Q,monoBold:Q},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:q,tierSizes:ee(q),lineHeight:Y,weight:X,letterSpacing:J,scale:1,maxScale:K,scaleCaps:G,headingFamily:null,headingWeight:null,fontSources:te,roles:N,typeScale:1}}var oe={},le=/* @__PURE__ */Object.freeze({standard:/* @__PURE__ */Object.freeze([.2,0,0,1]),emphasized:/* @__PURE__ */Object.freeze([.2,.8,.2,1]),exit:/* @__PURE__ */Object.freeze([.4,0,1,1])});function cssCubicBezier(e){return`cubic-bezier(${e.join(", ")})`}var ne={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:cssCubicBezier(le.standard),emphasized:cssCubicBezier(le.emphasized),exit:cssCubicBezier(le.exit)},reducedMotion:false},ie={brand:"#10462E",brandSoft:"rgba(16,70,46,0.10)",brandSofter:"rgba(16,70,46,0.15)",brandBorder:"rgba(16,70,46,0.18)",borderHairlineGreen:"rgba(16,70,46,0.25)",brandBorderStrong:"rgba(16,70,46,0.55)",brandInk:"#10462E",linkInk:"#10462E",surface:"#FFFFFF",surfaceCream:"#FFFFFF",surfaceSubtle:"#F1F5F2",background:"#FFFFFF",borderRingCream:"#E4E4E4",chatGround:"#FFFFFF",composerFill:"#FFFFFF",composerBorder:"rgba(16,70,46,0.75)",shadow:"#0B3421",text:{primary:"#000000",secondary:"#0E462E",muted:"#6B6B6B",placeholder:"rgba(61,61,61,0.75)",onBrand:"#FFFFFF",metaCool:"#3D3D3D",timestamp:"rgba(61,61,61,0.75)"},primary:"#10462E",onPrimary:"#FFFFFF",accent:"#10462E",onAccent:"#FFFFFF",accentEdge:"#07C168",success:"#07C168",danger:"#C03410",onDanger:"#FFFFFF",errorRed:"#C03410",warningStrong:"#A45610",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.12)",badgeBgCaution:"rgba(217,130,29,0.14)",badgeBgCritical:"rgba(192,52,16,0.06)",badgeBgNeutral:"rgba(107,107,107,0.12)",bubbleUser:"#10462E",bubbleAssistant:"#FFFFFF",bubbleVet:"#FFC3BC",onBubbleVet:"#000000",skeleton:"#E9F1E9",scanButtonPink:"#FFC3BC",highlight:"#FFC3BC",onHighlight:"#000000",mark:"#07C168",controlEdge:"rgba(16,70,46,0.18)",structureEdge:"rgba(16,70,46,0.25)",primaryEdge:"#10462E",checkupCardLowRiskBg:"rgba(7,193,104,0.10)",checkupCardConcernBg:"rgba(239,167,0,0.10)",info:"#10462E",badgeBgInfo:"rgba(16,70,46,0.10)",infoEdge:"rgba(16,70,46,0.25)"},ae=deepFreeze({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:ie,space:V,radius:U,type:re(),motion:ne,slots:oe}),ce={brand:"#6BD39A",brandSoft:"rgba(107,211,154,0.12)",brandSofter:"rgba(107,211,154,0.18)",brandBorder:"rgba(107,211,154,0.22)",borderHairlineGreen:"rgba(107,211,154,0.28)",brandBorderStrong:"rgba(107,211,154,0.55)",brandInk:"#6BD39A",linkInk:"#6BD39A",surface:"#1C1F23",surfaceCream:"#23272C",surfaceSubtle:"#23272C",background:"#15171A",borderRingCream:"#3A3F45",chatGround:"#1C1F23",composerFill:"#23272C",composerBorder:"rgba(107,211,154,0.75)",shadow:"#000000",text:{primary:"#F5F3F0",secondary:"#A9E4C4",muted:"#9A9A9A",placeholder:"rgba(255,255,255,0.55)",onBrand:"#0E1F17",metaCool:"#C9C9C9",timestamp:"rgba(245,243,240,0.7)"},primary:"#6BD39A",onPrimary:"#0E1F17",accent:"#6BD39A",onAccent:"#0E1F17",accentEdge:"#34D888",success:"#07C168",danger:"#F87171",onDanger:"#0E1F17",errorRed:"#FF6B5B",warningStrong:"#F0A35E",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.18)",badgeBgCaution:"rgba(217,130,29,0.20)",badgeBgCritical:"rgba(185,28,28,0.22)",badgeBgNeutral:"rgba(255,255,255,0.10)",bubbleUser:"#6BD39A",bubbleAssistant:"#1C1F23",bubbleVet:"#FFC3BC",onBubbleVet:"#000000",skeleton:"#23272C",scanButtonPink:"#FFC3BC",highlight:"#605051",onHighlight:"#F5F3F0",mark:"#07C168",controlEdge:"rgba(107,211,154,0.22)",structureEdge:"rgba(107,211,154,0.28)",primaryEdge:"#6BD39A",checkupCardLowRiskBg:"rgba(7,193,104,0.16)",checkupCardConcernBg:"rgba(239,167,0,0.16)",info:"#6BD39A",badgeBgInfo:"rgba(107,211,154,0.12)",infoEdge:"rgba(107,211,154,0.28)"};deepFreeze({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:ce,space:V,radius:U,type:re(),motion:ne,slots:oe});var se=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),de=globalThis,ue=de[se]??(de[se]=createContext(ae));ue.displayName??="EverfurThemeContext";function useEverfurTheme(){return a(ue)}function fe(e,t){let r=e.scaleCaps[t];return r>0?r:void 0}function Text({tier:e,variant:r,...o}){let l=useEverfurTheme(),n=r===void 0?void 0:l.type.roles[r],i=fe(l.type,e??n?.tier??"content"),a=r===void 0?o:{...o,style:[{...textRole(l,r),color:l.color.text.primary,flexShrink:1},o.style]};return t(g,i===void 0?a:{maxFontSizeMultiplier:i,...a})}e(function(e,r){return t(s,{...e,...r===null?{}:{ref:r}})});var be=640,ge=600,he=/* @__PURE__ */Object.freeze({width:0,height:0}),pe="useWindowDimensions"in c&&typeof c.useWindowDimensions=="function"?c.useWindowDimensions:()=>he,me=/* @__PURE__ */Object.freeze({width:"100%",maxWidth:be,alignSelf:"center"});/* @__PURE__ */Object.freeze({...me,flex:1});var ye=/* @__PURE__ */Object.freeze({...me,flexGrow:1,flexShrink:1});function ve(){return pe().width>=ge}var Ce=/* @__PURE__ */Symbol.for("@everfur/sdk#InSdkColumn@v1"),we=globalThis,Fe=we[Ce]??(we[Ce]=createContext(false));Fe.displayName??="EverfurInSdkColumn";function SdkTabletColumn({children:e,style:t,testID:r}){let o=ve(),l=a(Fe);return!o||l?e:/* @__PURE__ */m(f,{style:t===void 0?ye:[ye,t],testID:r??"everfur-tablet-column",children:/* @__PURE__ */m(Fe.Provider,{value:true,children:e})})}function optionalModule(e,t,r){let o;try{o=t()}catch(t){return Be(`optional peer '${e}' is not installed: ${ke(t)}`)}let l=xe(o);return l==null?Be(`optional peer '${e}' resolved to no module`):r&&!r(l)?Be(`optional peer '${e}' is present but failed its shape check`):/* @__PURE__ */Object.freeze({available:true,module:l})}function xe(e){return typeof e=="object"&&e!==null&&"default"in e&&Object.keys(e).length<=2?e.default:e}function Be(e){/* @__PURE__ */
3
+ return Object.freeze({available:false,module:null,reason:e})}function ke(e){return e instanceof Error?e.message:typeof e=="string"?e:"unknown load error"}var Se=/* @__PURE__ */Symbol.for("@everfur/sdk/televet");function ze(){let e=globalThis,t=e[Se];if(t!==void 0)return t;let r={presenter:null,snapshot:/* @__PURE__ */Object.freeze({request:null,serial:0,activeHost:null}),hosts:[],nextHost:1,listeners:/* @__PURE__ */new Set,dailyRegistered:false};return e[Se]=r,r}function Te(e){ze().dailyRegistered=e}var De=`[everfur] The in-app vet call needs the Daily native modules, which this app has not registered. Install @daily-co/react-native-daily-js, @daily-co/react-native-webrtc and (Expo) @daily-co/config-plugin-rn-daily-js, rebuild the native app (a JS-only OTA cannot add a native module), and call registerEverfurDaily(() => require('@daily-co/react-native-daily-js')) once in your app entry. ON EXPO GO THIS CANNOT BE FIXED BY INSTALLING: Expo Go runs a fixed set of native modules and cannot load Daily at any version, so you need a development build (expo prebuild, then run the native app) before the in-app call works at all. Until then the in-app visit tells the member the call cannot be joined; <VetVisitButton prefer="redirect" /> is the explicit way to the hosted visit in the browser, which needs no native module.`,Oe="@daily-co/react-native-daily-js",je=`optional peer '${Oe}' has no registered loader`,Ie=`optional peer '${Oe}' is present but failed its shape check`;function Re(e){return typeof e=="object"&&e!==null}function Le(e){return Re(e)&&"box"in e}function He(e){let t=e.default,r=Re(t)||typeof t=="function"?t:{},o=typeof e.createCallObject=="function"?e:r,l=o.createCallObject,n={createCallObject:typeof l=="function"?l.bind(o):l,DailyMediaView:e.DailyMediaView??r.DailyMediaView};return isEverfurDailyModule(n)?n:null}function isEverfurDailyModule(e){if(!Re(e)||typeof e.createCallObject!="function")return false;let t=e.DailyMediaView;return typeof t=="function"||typeof t=="object"&&t!==null}var Ee=null,Me=null;function We(e){/* @__PURE__ */
4
+ return Object.freeze({available:false,module:null,reason:e})}function registerEverfurDaily(e){Ee=e,Me=null,Te(e!==null)}function loadEverfurDaily(){if(Me!==null)return Me;let e=Ee;if(e===null)return Me=We(je),Me;let t=optionalModule(Oe,()=>({box:e()}),Le);if(!t.available)return Me=We(t.reason),Me;let r=t.module.box;if(!Re(r))return Me=We(Ie),Me;let o=He(r);return Me=o===null?We(Ie):/* @__PURE__ */Object.freeze({available:true,module:o}),Me}function CallControl({label:e,glyph:t,onPress:r,testID:o,muted:l=false,style:n}){/* @__PURE__ */
5
+ return m(b,{onPress:r,testID:o,accessibilityRole:"button",accessibilityLabel:e,accessibilityState:{selected:l},style:n,children:t})}function GlyphBox({children:e,testID:t}){/* @__PURE__ */
6
+ return m(f,{style:Ae.box,accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants",testID:t,children:e})}function Slash({color:e}){/* @__PURE__ */
7
+ return m(f,{style:[Ae.slash,{backgroundColor:e}]})}function MicGlyph({color:e,off:t=false}){/* @__PURE__ */
8
+ return y(GlyphBox,{testID:t?"glyph-mic-off":"glyph-mic",children:[
9
+ /* @__PURE__ */y(f,{style:Ae.column,children:[
10
+ /* @__PURE__ */m(f,{style:[Ae.micCapsule,{borderColor:e}]}),
11
+ /* @__PURE__ */m(f,{style:[Ae.micCradle,{borderColor:e}]}),
12
+ /* @__PURE__ */m(f,{style:[Ae.micStem,{backgroundColor:e}]})]}),t?/* @__PURE__ */m(Slash,{color:e}):null]})}function CameraGlyph({color:e,off:t=false}){/* @__PURE__ */
13
+ return y(GlyphBox,{testID:t?"glyph-camera-off":"glyph-camera",children:[
14
+ /* @__PURE__ */y(f,{style:Ae.row,children:[
15
+ /* @__PURE__ */m(f,{style:[Ae.cameraBody,{borderColor:e}]}),
16
+ /* @__PURE__ */m(f,{style:[Ae.cameraLens,{borderRightColor:e}]})]}),t?/* @__PURE__ */m(Slash,{color:e}):null]})}function SpeakerGlyph({color:e,off:t=false}){/* @__PURE__ */
17
+ return y(GlyphBox,{testID:t?"glyph-speaker-off":"glyph-speaker",children:[
18
+ /* @__PURE__ */y(f,{style:Ae.row,children:[
19
+ /* @__PURE__ */m(f,{style:[Ae.speakerBox,{backgroundColor:e}]}),
20
+ /* @__PURE__ */m(f,{style:[Ae.speakerCone,{borderRightColor:e}]}),t?null:/* @__PURE__ */m(f,{style:[Ae.speakerWave,{borderColor:e}]})]}),t?/* @__PURE__ */m(Slash,{color:e}):null]})}function SwitchCameraGlyph({color:e}){/* @__PURE__ */
21
+ return m(GlyphBox,{testID:"glyph-switch-camera",children:/* @__PURE__ */y(f,{style:[Ae.switchBody,{borderColor:e}],children:[
22
+ /* @__PURE__ */m(f,{style:[Ae.switchTurn,{borderColor:e,borderTopColor:"transparent"}]}),
23
+ /* @__PURE__ */m(f,{style:[Ae.switchHead,{borderBottomColor:e}]})]})})}function LeaveGlyph({color:e}){/* @__PURE__ */
24
+ return m(GlyphBox,{testID:"glyph-leave",children:/* @__PURE__ */y(f,{style:Ae.column,children:[
25
+ /* @__PURE__ */m(f,{style:[Ae.receiver,{borderColor:e}]}),
26
+ /* @__PURE__ */y(f,{style:Ae.receiverPads,children:[
27
+ /* @__PURE__ */m(f,{style:[Ae.receiverPad,{backgroundColor:e}]}),
28
+ /* @__PURE__ */m(f,{style:[Ae.receiverPad,{backgroundColor:e}]})]})]})})}var Ae=d.create({box:{width:24,height:24,alignItems:"center",justifyContent:"center"},row:{flexDirection:"row",alignItems:"center"},column:{alignItems:"center"},slash:{position:"absolute",width:2,height:28,borderRadius:1,transform:[{rotate:"-45deg"}]},micCapsule:{width:10,height:14,borderRadius:5,borderWidth:2},micCradle:{width:16,height:8,marginTop:-5,borderWidth:2,borderTopWidth:0,borderBottomLeftRadius:8,borderBottomRightRadius:8},micStem:{width:2,height:3},cameraBody:{width:14,height:12,borderRadius:3,borderWidth:2},cameraLens:{width:0,height:0,marginLeft:1,borderTopWidth:5,borderBottomWidth:5,borderRightWidth:6,borderTopColor:"transparent",borderBottomColor:"transparent"},speakerBox:{width:4,height:8,borderRadius:1},speakerCone:{width:0,height:0,borderTopWidth:7,borderBottomWidth:7,borderRightWidth:7,borderTopColor:"transparent",borderBottomColor:"transparent",transform:[{rotate:"180deg"}]},speakerWave:{width:7,height:12,marginLeft:2,borderWidth:2,borderLeftWidth:0,borderTopRightRadius:6,borderBottomRightRadius:6},switchBody:{width:20,height:15,borderRadius:3,borderWidth:2,alignItems:"center",justifyContent:"center"},switchTurn:{width:9,height:9,borderRadius:4.5,borderWidth:2},switchHead:{position:"absolute",top:2,right:4,width:0,height:0,borderLeftWidth:3,borderRightWidth:3,borderBottomWidth:4,borderLeftColor:"transparent",borderRightColor:"transparent"},receiver:{width:22,height:10,borderWidth:3,borderBottomWidth:0,borderTopLeftRadius:11,borderTopRightRadius:11},receiverPads:{flexDirection:"row",width:22,justifyContent:"space-between",marginTop:-1},receiverPad:{width:5,height:4,borderRadius:1}});var Pe=/* @__PURE__ */Object.freeze({surface:"rgba(255,255,255,0.08)",surfaceRaised:"rgba(255,255,255,0.14)",surfaceActive:"rgba(255,255,255,0.24)",hairline:"rgba(255,255,255,0.18)",glyph:"rgba(255,255,255,0.72)",textSecondary:"rgba(255,255,255,0.78)",textTertiary:"rgba(255,255,255,0.56)"}),Ne=3,$e=180,Ge=420,Ve=.35,Ue=.6,qe=360,Ye=132,Xe=184,Je=44;function Ke(e){return typeof e=="number"&&Number.isInteger(e)&&e>=1?e:10}function WaitingDots({reducedMotion:e,styles:t}){let r=o(Array.from({length:Ne},()=>new h.Value(Ve))).current;return l(()=>{if(e)return;let t=r.map((e,t)=>h.loop(h.sequence([h.delay(t*$e),h.timing(e,{toValue:1,duration:Ge,useNativeDriver:true}),h.timing(e,{toValue:Ve,duration:Ge,useNativeDriver:true}),h.delay((Ne-t-1)*$e)])));for(let e of t)e.start();return()=>{for(let e of t)e.stop()}},[e,r]),/* @__PURE__ */m(f,{style:t.dotRow,testID:"everfur-vet-lobby-dots",accessibilityElementsHidden:true,importantForAccessibility:"no",children:r.map((r,o)=>/* @__PURE__ */m(h.View,{style:[t.dot,{opacity:e?Ue:r}]},o))})}function LobbyControl({label:e,glyph:t,active:r,onPress:o,testID:l,styles:n}){/* @__PURE__ */
29
+ return m(b,{onPress:o,testID:l,accessibilityRole:"button",accessibilityState:{selected:!r},accessibilityLabel:e,style:[n.control,r?null:n.controlOff],children:t})}function EverfurVetCallLobby(e){let{clinicianName:t,petName:o,consultMinutes:l,micOn:n,cameraOn:i,onToggleMic:a,onToggleCamera:c,onSwitchCamera:s,onLeave:d,style:g}=e,h=useEverfurTheme(),v=r(()=>_e(h),[h]),C=p(),{width:w}=u(),F=w<qe?Ye:Xe;/* @__PURE__ */
30
+ return m(f,{style:[v.root,{paddingTop:C.top+h.space.sm,paddingBottom:C.bottom+h.space.lg},g],testID:"everfur-vet-lobby",children:/* @__PURE__ */y(SdkTabletColumn,{children:[
31
+ /* @__PURE__ */y(f,{style:v.topRow,children:[
32
+ /* @__PURE__ */m(b,{onPress:d,accessibilityRole:"button",accessibilityLabel:W.leaveCta,testID:"everfur-vet-lobby-leave",hitSlop:12,style:v.leaveHit,children:/* @__PURE__ */m(Text,{tier:"control",style:v.leaveLabel,children:W.leaveCta})}),
33
+ /* @__PURE__ */m(Text,{tier:"badge",style:v.prepLabel,testID:"everfur-vet-lobby-label",children:W.waitingRoomLabel})]}),
34
+ /* @__PURE__ */y(f,{style:v.center,children:[
35
+ /* @__PURE__ */y(f,{style:[v.avatar,{width:F,height:F,borderRadius:F/2}],testID:"everfur-vet-lobby-avatar",accessibilityElementsHidden:true,importantForAccessibility:"no",children:[
36
+ /* @__PURE__ */m(f,{style:v.avatarGlyphHead}),
37
+ /* @__PURE__ */m(f,{style:v.avatarGlyphBody})]}),
38
+ /* @__PURE__ */m(f,{accessibilityLiveRegion:"polite",accessible:true,children:/* @__PURE__ */m(Text,{tier:"heading",style:v.title,testID:"everfur-vet-lobby-title",children:W.lobbyTitle(t)})}),
39
+ /* @__PURE__ */m(WaitingDots,{reducedMotion:h.motion.reducedMotion,styles:v})]}),
40
+ /* @__PURE__ */y(f,{style:v.prepCard,testID:"everfur-vet-lobby-prep",children:[
41
+ /* @__PURE__ */m(Text,{tier:"badge",style:v.prepLabel,children:W.lobbyTipsTitle(t)}),[W.lobbyTipSpot,W.lobbyPrep(o)].map((e,t)=>/* @__PURE__ */y(f,{style:v.tip,children:[
42
42
  /* @__PURE__ */m(Text,{tier:"badge",style:v.tipNumber,accessibilityElementsHidden:true,importantForAccessibility:"no",children:String(t+1).padStart(2,"0")}),
43
43
  /* @__PURE__ */m(Text,{style:v.prepBody,children:e})]},e))]}),
44
- /* @__PURE__ */p(u,{style:v.controls,children:[
45
- /* @__PURE__ */m(LobbyControl,{label:n?M.muteCta:M.unmuteCta,glyph:/* @__PURE__ */m(MicGlyph,{color:y.color.text.onBrand,off:!n}),active:n,onPress:a,testID:"everfur-vet-lobby-mic",styles:v}),
46
- /* @__PURE__ */m(LobbyControl,{label:i?M.cameraOffCta:M.cameraOnCta,glyph:/* @__PURE__ */m(CameraGlyph,{color:y.color.text.onBrand,off:!i}),active:i,onPress:c,testID:"everfur-vet-lobby-camera",styles:v}),i&&s?/* @__PURE__ */m(LobbyControl,{label:M.switchCameraCta,glyph:/* @__PURE__ */m(SwitchCameraGlyph,{color:y.color.text.onBrand}),active:true,onPress:s,testID:"everfur-vet-lobby-switch-camera",styles:v}):null]}),
47
- /* @__PURE__ */m(Text,{tier:"badge",style:v.duration,testID:"everfur-vet-lobby-duration",children:M.lobbyDuration(We(l))})]})}function Pe(e){let{color:t,space:r,radius:o,type:l}=e;return s.create({root:{flex:1,backgroundColor:t.brand,paddingHorizontal:r.lg},topRow:{flexDirection:"row",alignItems:"center",gap:r.md},tip:{flexDirection:"row",gap:r.md,alignItems:"flex-start",paddingTop:r.sm},tipNumber:{...face(e,"monoBold"),color:De.textSecondary,fontSize:13,width:24,paddingTop:4},leaveHit:{minHeight:Ae,justifyContent:"center",paddingVertical:r.xs,paddingRight:r.md},leaveLabel:{...face(e,"medium"),color:t.text.onBrand,fontSize:l.size.body},center:{flex:1,alignItems:"center",justifyContent:"center"},avatar:{alignItems:"center",justifyContent:"center",borderWidth:2,borderColor:t.success,backgroundColor:De.surface,marginBottom:r.lg,overflow:"hidden"},avatarGlyphHead:{width:34,height:34,borderRadius:17,borderWidth:2,borderColor:De.glyph,marginBottom:6},avatarGlyphBody:{width:66,height:33,borderTopLeftRadius:33,borderTopRightRadius:33,borderWidth:2,borderBottomWidth:0,borderColor:De.glyph},title:{...face(e,"bold"),color:t.text.onBrand,fontSize:l.size.heading,lineHeight:Math.round(l.size.heading*l.lineHeight.snug),textAlign:"center",paddingHorizontal:r.sm},dotRow:{flexDirection:"row",gap:r.xs,marginTop:r.lg},dot:{width:8,height:8,borderRadius:4,backgroundColor:t.success},prepCard:{borderRadius:o.lg,borderWidth:1,borderColor:De.hairline,backgroundColor:De.surface,padding:r.lg,marginBottom:r.lg},prepLabel:{...face(e,"monoBold"),color:t.accent,fontSize:l.size.micro,letterSpacing:1.2,textTransform:"uppercase"},prepBody:{...face(e,"regular"),color:t.text.onBrand,fontSize:l.size.subtitle,lineHeight:Math.round(l.size.subtitle*l.lineHeight.relaxed)},controls:{flexDirection:"row",justifyContent:"center",gap:r.lg,marginBottom:r.lg},control:{minWidth:64,minHeight:48,paddingHorizontal:r.md,alignItems:"center",justifyContent:"center",borderRadius:o.pill,backgroundColor:De.surfaceRaised},controlOff:{backgroundColor:De.surfaceActive},duration:{...face(e,"medium"),color:De.textTertiary,fontSize:l.size.micro,letterSpacing:1.6,textAlign:"center"}})}var Ne=5e3;function $e(e,t){return new Promise(r=>{let o=setTimeout(r,t);e.catch(()=>{}).then(()=>{clearTimeout(o),r()})})}function Ve(e,t){let r=o(e);l(()=>{r.current=e});let n=o(false);l(()=>(n.current=true,()=>{n.current=false}),[]);let a=o(false),c=i(()=>{a.current||!n.current||(a.current=true,r.current())},[]),s=o(false),d=i(()=>{s.current||(s.current=true,$e(t(),Ne).then(c))},[t,c]);return{reportLeft:c,leave:d,leaving:s}}var Ge=/* @__PURE__ */Symbol.for("@everfur/sdk/televet/recording-notice-receipt");function Ue(){let e=globalThis;return e[Ge]??=/* @__PURE__ */new Map}function qe(e){return(Ue().get(e)??0)>0}function Ye(e){let[t,r]=n(true),l=o(true),a=i(()=>{let t=e.current;if(!t?.setNativeInCallAudioMode)return;let o=!l.current;l.current=o,r(o),t.setNativeInCallAudioMode(o?"video":"voice")},[e]);return{speakerOn:t,toggleSpeaker:a}}function Xe(e){return e??null}function Je(e){return!!e?.videoTrack}function PersonMark({styles:e}){/* @__PURE__ */
48
- return p(u,{style:e.remoteOffAvatar,accessibilityElementsHidden:true,importantForAccessibility:"no",children:[
49
- /* @__PURE__ */m(u,{style:e.remoteOffHead}),
50
- /* @__PURE__ */m(u,{style:e.remoteOffBody})]})}function EverfurVetCall(e){/* @__PURE__ */
51
- return m(VetCallRoom,{...e},e.roomUrl)}function VetCallRoom(e){let{roomUrl:t,token:a,onLeave:c,clinicianName:s,petName:d,consultMinutes:b,daily:g,telemetry:v,onUnavailable:C,renderUnavailable:w,style:F}=H(e,["onLeave"]),x=useEverfurTheme(),k=r(()=>rt(x),[x]),z=h(),S=v??B,T=o(S);l(()=>{T.current=S});let D=o(null),[O,j]=n(()=>qe(t)),[I,L]=n("joining"),[E,W]=n(null),[P,N]=n(null),[$,V]=n(true),[G,U]=n(true),{speakerOn:q,toggleSpeaker:Y}=Ye(D),[X,J]=n(true),[K,_]=n({flip:false,speaker:false}),[Q,Z]=n(null),[ee,te]=n(0),re=isUsableRoomCredential(t,a),oe=r(()=>re?g?{available:true,module:g,reason:""}:loadEverfurDaily():null,[re,g]),le=oe?.available?oe.module:null,ne=r(()=>oe===null?{reason:"roomUnusable",detail:"[everfur] The vet call needs an https room URL and a non-empty join token."}:oe.available?null:{reason:"dailyMissing",detail:`${ye} (${oe.reason})`},[oe]),ie=o(false);l(()=>{if(ne===null){ie.current=false;return}if(R(C,ne.reason,ne.detail),!ie.current){ie.current=true;try{globalThis.console?.warn?.(ne.detail)}catch{}}},[ne,C]);let ae=i(async()=>{let e=D.current;if(D.current=null,!!e){await $e(new Promise(t=>t(e.leave())),Ne);try{e.setLocalAudio(!1),e.setLocalVideo(!1)}catch{}try{await e.destroy()}catch{}}},[]),{reportLeft:ce,leave:se,leaving:de}=Ve(c,ae);l(()=>{if(le===null||!O)return;let e=false,r=le.createCallObject();D.current=r,_({flip:typeof r.cycleCamera=="function",speaker:typeof r.setNativeInCallAudioMode=="function"});let o=()=>{let e=Object.values(r.participants());N(e.find(e=>e.local)??null),W(e.find(e=>!e.local)??null)},l=["participant-joined","participant-updated","participant-left"];for(let e of l)r.on(e,o);let n=()=>{e||de.current||(L("left"),ce())},i=()=>{e||L("error")};return r.on("left-meeting",n),r.on("error",i),r.join({url:t,token:a}).then(()=>{e||(L("joined"),Z(Date.now()),o(),T.current.track("televet.call.joined",{provider:"daily"}))}).catch(()=>{e||(L("error"),T.current.trackExpectedFailure("televet.call.join_failed",{provider:"daily"}))}),()=>{e=true;for(let e of l)r.off(e,o);r.off("left-meeting",n),r.off("error",i),ae()}},[le,O,t,a,ae,ce,de]),l(()=>{if(Q===null)return;te(Date.now()-Q);let e=setInterval(()=>{te(Date.now()-Q)},1e3);return()=>{clearInterval(e)}},[Q]);let ue=i(()=>{let e=D.current;e&&V(t=>(e.setLocalAudio(!t),!t))},[]),fe=i(()=>{let e=D.current;e&&U(t=>(e.setLocalVideo(!t),!t))},[]),be=i(()=>{let e=D.current;e?.cycleCamera&&e.cycleCamera().then(e=>{let t=e?.device?.facingMode;t&&J(t==="user")},()=>{})},[]);if(ne!==null)return w?/* @__PURE__ */m(y,{children:w(ne.reason,ne.detail)}):null;if(le===null)return null;if(!O)/* @__PURE__ */
52
- return p(u,{style:[k.notice,{paddingTop:z.top+x.space.xl,paddingBottom:z.bottom+x.space.xl},F],testID:"everfur-vet-call-recording-notice",children:[
53
- /* @__PURE__ */m(Text,{style:k.noticeTitle,accessibilityRole:"header",children:M.recordingNoticeTitle}),
54
- /* @__PURE__ */m(f,{onPress:()=>j(true),accessibilityRole:"button",accessibilityLabel:M.recordingNoticeCta,testID:"everfur-vet-call-recording-continue",style:k.noticeContinue,children:/* @__PURE__ */m(Text,{tier:"control",style:k.noticeContinueLabel,children:M.recordingNoticeCta})}),
55
- /* @__PURE__ */m(f,{onPress:ce,accessibilityRole:"button",accessibilityLabel:M.leaveCta,testID:"everfur-vet-call-recording-leave",style:k.errorLeaveHit,children:/* @__PURE__ */m(Text,{tier:"control",style:k.noticeLeave,children:M.leaveCta})})]});if(I==="error")/* @__PURE__ */
56
- return p(u,{style:[k.centered,F],testID:"everfur-vet-call-error",children:[
57
- /* @__PURE__ */m(Text,{style:k.status,accessibilityLiveRegion:"polite",children:M.joinFailedReason}),
58
- /* @__PURE__ */m(f,{onPress:se,accessibilityRole:"button",accessibilityLabel:M.leaveCta,testID:"everfur-vet-call-error-leave",style:k.errorLeaveHit,children:/* @__PURE__ */m(Text,{tier:"control",style:k.errorLeave,children:M.leaveCta})})]});if(E===null)/* @__PURE__ */
59
- return m(EverfurVetCallLobby,{clinicianName:s,petName:d,consultMinutes:b,micOn:$,cameraOn:G,onToggleMic:ue,onToggleCamera:fe,...K.flip?{onSwitchCamera:be}:{},onLeave:se,style:F});let ge=le.DailyMediaView,he=s?.trim()??"",pe=ee>=We(b)*6e4;/* @__PURE__ */
60
- return p(u,{style:[k.root,F],testID:"everfur-vet-call",children:[
61
- /* @__PURE__ */p(u,{style:k.fill,testID:"everfur-vet-call-remote",children:[
62
- /* @__PURE__ */m(ge,{videoTrack:Xe(E.videoTrack),audioTrack:Xe(E.audioTrack),mirror:false,objectFit:"cover",style:k.fill}),Je(E)?null:/* @__PURE__ */p(u,{style:k.remoteOff,testID:"everfur-vet-call-remote-camera-off",children:[
63
- /* @__PURE__ */m(PersonMark,{styles:k}),he.length>0?/* @__PURE__ */m(Text,{style:k.remoteOffName,numberOfLines:1,children:he}):null]})]}),
64
- /* @__PURE__ */p(u,{style:[k.statusRow,{top:z.top+x.space.sm}],pointerEvents:"none",children:[he.length>0?/* @__PURE__ */m(Text,{tier:"compact",style:k.statusName,numberOfLines:1,testID:"everfur-vet-call-remote-name",children:he}):null,Q!==null?/* @__PURE__ */m(Text,{tier:"badge",style:[k.statusMeta,pe?k.statusMetaOver:null],testID:"everfur-vet-call-elapsed",children:A(ee)}):null]}),
65
- /* @__PURE__ */p(u,{style:[k.selfView,{top:z.top+x.space.sm}],testID:"everfur-vet-call-self",children:[
66
- /* @__PURE__ */m(ge,{videoTrack:G?Xe(P?.videoTrack):null,audioTrack:null,mirror:X,objectFit:"cover",style:k.fill}),P?.videoTrack&&G?null:/* @__PURE__ */m(u,{style:[k.selfViewOff,k.fill],testID:"everfur-vet-call-self-off",children:/* @__PURE__ */m(Text,{tier:"badge",style:k.selfViewOffLabel,children:M.selfCameraOffLabel})})]}),
67
- /* @__PURE__ */p(u,{style:[k.controlBar,{bottom:z.bottom+x.space.lg}],children:[K.speaker?/* @__PURE__ */m(CallControl,{label:q?M.speakerOffCta:M.speakerOnCta,glyph:/* @__PURE__ */m(SpeakerGlyph,{color:q?x.color.text.onBrand:Ze,off:!q}),muted:!q,onPress:Y,testID:"everfur-vet-call-speaker",style:[k.control,q?null:k.controlMuted]}):null,
68
- /* @__PURE__ */m(CallControl,{label:$?M.muteCta:M.unmuteCta,glyph:/* @__PURE__ */m(MicGlyph,{color:$?x.color.text.onBrand:Ze,off:!$}),muted:!$,onPress:ue,testID:"everfur-vet-call-mic",style:[k.control,$?null:k.controlMuted]}),
69
- /* @__PURE__ */m(CallControl,{label:G?M.cameraOffCta:M.cameraOnCta,glyph:/* @__PURE__ */m(CameraGlyph,{color:G?x.color.text.onBrand:Ze,off:!G}),muted:!G,onPress:fe,testID:"everfur-vet-call-camera",style:[k.control,G?null:k.controlMuted]}),K.flip&&G?/* @__PURE__ */m(CallControl,{label:M.switchCameraCta,glyph:/* @__PURE__ */m(SwitchCameraGlyph,{color:x.color.text.onBrand}),onPress:be,testID:"everfur-vet-call-switch-camera",style:k.control}):null,
70
- /* @__PURE__ */m(CallControl,{label:M.leaveCta,glyph:/* @__PURE__ */m(LeaveGlyph,{color:x.color.text.onBrand}),onPress:se,testID:"everfur-vet-call-leave",style:[k.control,k.controlDanger]})]})]})}var Ke="#141414",_e="#1B1B1B",Qe="rgba(20,20,20,0.62)",Ze="#141414",et=104,tt={textShadowColor:"rgba(0,0,0,0.55)",textShadowRadius:6};function rt(e){let{color:t,space:r,radius:o,type:l}=e;return s.create({root:{flex:1,backgroundColor:Ke},fill:{...W},centered:{flex:1,alignItems:"center",justifyContent:"center",gap:r.lg,padding:r.xl,backgroundColor:Ke},statusRow:{position:"absolute",left:r.md,right:et+r.md*2,flexDirection:"column",alignItems:"flex-start",gap:2},statusName:{flexShrink:1,...face(e,"medium"),color:t.text.onBrand,fontSize:l.size.body,...tt},statusMeta:{...face(e,"mono"),color:t.text.onBrand,fontSize:l.size.caption,...tt},statusMetaOver:{color:t.danger},selfView:{position:"absolute",right:r.md,width:et,height:148,borderRadius:o.lg,overflow:"hidden",backgroundColor:_e,borderWidth:1,borderColor:"rgba(255,255,255,0.24)",shadowColor:"#000",shadowOpacity:.35,shadowRadius:12,shadowOffset:{width:0,height:4},elevation:6},selfViewOff:{alignItems:"center",justifyContent:"center",paddingHorizontal:r.xs,backgroundColor:_e},remoteOff:{...W,alignItems:"center",justifyContent:"center",gap:r.md,backgroundColor:Ke},remoteOffAvatar:{width:96,height:96,borderRadius:o.pill,overflow:"hidden",alignItems:"center",justifyContent:"flex-end",backgroundColor:"rgba(255,255,255,0.14)"},remoteOffHead:{width:36,height:36,borderRadius:18,marginBottom:6,backgroundColor:"rgba(255,255,255,0.56)"},remoteOffBody:{width:64,height:28,borderTopLeftRadius:32,borderTopRightRadius:32,backgroundColor:"rgba(255,255,255,0.56)"},remoteOffName:{...face(e,"medium"),color:t.text.onBrand,fontSize:l.size.subtitle,paddingHorizontal:r.xl},notice:{flex:1,justifyContent:"center",gap:r.lg,paddingHorizontal:r.xl,backgroundColor:t.surface},noticeTitle:{...face(e,"medium"),fontSize:l.size.subtitle,lineHeight:Math.round(l.size.subtitle*l.lineHeight.relaxed),color:t.text.primary},noticeContinue:{minHeight:44,alignItems:"center",justifyContent:"center",paddingHorizontal:r.xl,borderRadius:o.pill,backgroundColor:t.primary},noticeContinueLabel:{...face(e,"medium"),color:t.onPrimary,fontSize:l.size.body},noticeLeave:{...face(e,"medium"),color:t.brandInk,fontSize:l.size.body},selfViewOffLabel:{...face(e,"medium"),color:"rgba(255,255,255,0.78)",fontSize:l.size.micro,textAlign:"center"},controlBar:{position:"absolute",left:0,right:0,flexDirection:"row",justifyContent:"center",alignItems:"center",gap:r.sm},control:{minWidth:54,minHeight:56,paddingHorizontal:r.md,alignItems:"center",justifyContent:"center",borderRadius:o.pill,backgroundColor:Qe},controlMuted:{backgroundColor:t.text.onBrand},controlDanger:{backgroundColor:t.danger},status:{...face(e,"medium"),fontSize:l.size.subtitle,lineHeight:Math.round(l.size.subtitle*l.lineHeight.relaxed),color:t.surface,textAlign:"center"},errorLeaveHit:{minHeight:44,minWidth:44,alignItems:"center",justifyContent:"center",paddingHorizontal:r.lg},errorLeave:{...face(e,"medium"),color:t.surface,fontSize:l.size.body,textDecorationLine:"underline"}})}export{ye as EVERFUR_DAILY_SETUP,EverfurVetCall,EverfurVetCallLobby,E as VET_CALL_CONSULT_MINUTES,M as VET_CALL_COPY,isEverfurDailyModule,isSafeRoomUrl,isUsableRoomCredential,loadEverfurDaily,registerEverfurDaily};
44
+ /* @__PURE__ */y(f,{style:v.controls,children:[
45
+ /* @__PURE__ */m(LobbyControl,{label:n?W.muteCta:W.unmuteCta,glyph:/* @__PURE__ */m(MicGlyph,{color:h.color.text.onBrand,off:!n}),active:n,onPress:a,testID:"everfur-vet-lobby-mic",styles:v}),
46
+ /* @__PURE__ */m(LobbyControl,{label:i?W.cameraOffCta:W.cameraOnCta,glyph:/* @__PURE__ */m(CameraGlyph,{color:h.color.text.onBrand,off:!i}),active:i,onPress:c,testID:"everfur-vet-lobby-camera",styles:v}),i&&s?/* @__PURE__ */m(LobbyControl,{label:W.switchCameraCta,glyph:/* @__PURE__ */m(SwitchCameraGlyph,{color:h.color.text.onBrand}),active:true,onPress:s,testID:"everfur-vet-lobby-switch-camera",styles:v}):null]}),
47
+ /* @__PURE__ */m(Text,{tier:"badge",style:v.duration,testID:"everfur-vet-lobby-duration",children:W.lobbyDuration(Ke(l))})]})})}function _e(e){let{color:t,space:r,radius:o,type:l}=e;return d.create({root:{flex:1,backgroundColor:t.brand,paddingHorizontal:r.lg},topRow:{flexDirection:"row",alignItems:"center",gap:r.md},tip:{flexDirection:"row",gap:r.md,alignItems:"flex-start",paddingTop:r.sm},tipNumber:{...face(e,"monoBold"),color:Pe.textSecondary,fontSize:13,width:24,paddingTop:4},leaveHit:{minHeight:Je,justifyContent:"center",paddingVertical:r.xs,paddingRight:r.md},leaveLabel:{...face(e,"medium"),color:t.text.onBrand,fontSize:l.size.body},center:{flex:1,alignItems:"center",justifyContent:"center"},avatar:{alignItems:"center",justifyContent:"center",borderWidth:2,borderColor:t.success,backgroundColor:Pe.surface,marginBottom:r.lg,overflow:"hidden"},avatarGlyphHead:{width:34,height:34,borderRadius:17,borderWidth:2,borderColor:Pe.glyph,marginBottom:6},avatarGlyphBody:{width:66,height:33,borderTopLeftRadius:33,borderTopRightRadius:33,borderWidth:2,borderBottomWidth:0,borderColor:Pe.glyph},title:{...face(e,"bold"),color:t.text.onBrand,fontSize:l.size.heading,lineHeight:Math.round(l.size.heading*l.lineHeight.snug),textAlign:"center",paddingHorizontal:r.sm},dotRow:{flexDirection:"row",gap:r.xs,marginTop:r.lg},dot:{width:8,height:8,borderRadius:4,backgroundColor:t.success},prepCard:{borderRadius:o.lg,borderWidth:1,borderColor:Pe.hairline,backgroundColor:Pe.surface,padding:r.lg,marginBottom:r.lg},prepLabel:{...face(e,"monoBold"),color:t.accent,fontSize:l.size.micro,letterSpacing:1.2,textTransform:"uppercase"},prepBody:{...face(e,"regular"),color:t.text.onBrand,fontSize:l.size.subtitle,lineHeight:Math.round(l.size.subtitle*l.lineHeight.relaxed)},controls:{flexDirection:"row",justifyContent:"center",gap:r.lg,marginBottom:r.lg},control:{minWidth:64,minHeight:48,paddingHorizontal:r.md,alignItems:"center",justifyContent:"center",borderRadius:o.pill,backgroundColor:Pe.surfaceRaised},controlOff:{backgroundColor:Pe.surfaceActive},duration:{...face(e,"medium"),color:Pe.textTertiary,fontSize:l.size.micro,letterSpacing:1.6,textAlign:"center"}})}var Qe=5e3;function Ze(e,t){return new Promise(r=>{let o=setTimeout(r,t);e.catch(()=>{}).then(()=>{clearTimeout(o),r()})})}function et(e,t){let r=o(e);l(()=>{r.current=e});let n=o(false);l(()=>(n.current=true,()=>{n.current=false}),[]);let a=o(false),c=i(()=>{a.current||!n.current||(a.current=true,r.current())},[]),s=o(false),d=i(()=>{s.current||(s.current=true,Ze(t(),Qe).then(c))},[t,c]);return{reportLeft:c,leave:d,leaving:s}}var tt=/* @__PURE__ */Symbol.for("@everfur/sdk/televet/recording-notice-receipt");function rt(){let e=globalThis;return e[tt]??=/* @__PURE__ */new Map}function ot(e){return(rt().get(e)??0)>0}function lt(e){let[t,r]=n(true),l=o(true),a=i(()=>{let t=e.current;if(!t?.setNativeInCallAudioMode)return;let o=!l.current;l.current=o,r(o),t.setNativeInCallAudioMode(o?"video":"voice")},[e]);return{speakerOn:t,toggleSpeaker:a}}function nt(e){return e??null}function it(e){return!!e?.videoTrack}function PersonMark({styles:e}){/* @__PURE__ */
48
+ return y(f,{style:e.remoteOffAvatar,accessibilityElementsHidden:true,importantForAccessibility:"no",children:[
49
+ /* @__PURE__ */m(f,{style:e.remoteOffHead}),
50
+ /* @__PURE__ */m(f,{style:e.remoteOffBody})]})}function EverfurVetCall(e){/* @__PURE__ */
51
+ return m(VetCallRoom,{...e},e.roomUrl)}function VetCallRoom(e){let{roomUrl:t,token:a,onLeave:c,clinicianName:s,petName:d,consultMinutes:u,daily:g,telemetry:h,onUnavailable:C,renderUnavailable:w,style:F}=E(e,["onLeave"]),x=useEverfurTheme(),B=r(()=>bt(x),[x]),S=p(),z=h??k,T=o(z);l(()=>{T.current=z});let D=o(null),[O,j]=n(()=>ot(t)),[I,L]=n("joining"),[H,M]=n(null),[P,N]=n(null),[$,G]=n(true),[V,U]=n(true),{speakerOn:q,toggleSpeaker:Y}=lt(D),[X,J]=n(true),[K,_]=n({flip:false,speaker:false}),[Q,Z]=n(null),[ee,te]=n(0),re=isUsableRoomCredential(t,a),oe=r(()=>re?g?{available:true,module:g,reason:""}:loadEverfurDaily():null,[re,g]),le=oe?.available?oe.module:null,ne=r(()=>oe===null?{reason:"roomUnusable",detail:"[everfur] The vet call needs an https room URL and a non-empty join token."}:oe.available?null:{reason:"dailyMissing",detail:`${De} (${oe.reason})`},[oe]),ie=o(false);l(()=>{if(ne===null){ie.current=false;return}if(R(C,ne.reason,ne.detail),!ie.current){ie.current=true;try{globalThis.console?.warn?.(ne.detail)}catch{}}},[ne,C]);let ae=i(async()=>{let e=D.current;if(D.current=null,!!e){await Ze(new Promise(t=>t(e.leave())),Qe);try{e.setLocalAudio(!1),e.setLocalVideo(!1)}catch{}try{await e.destroy()}catch{}}},[]),{reportLeft:ce,leave:se,leaving:de}=et(c,ae);l(()=>{if(le===null||!O)return;let e=false,r=le.createCallObject();D.current=r,_({flip:typeof r.cycleCamera=="function",speaker:typeof r.setNativeInCallAudioMode=="function"});let o=()=>{let e=Object.values(r.participants());N(e.find(e=>e.local)??null),M(e.find(e=>!e.local)??null)},l=["participant-joined","participant-updated","participant-left"];for(let e of l)r.on(e,o);let n=()=>{e||de.current||(L("left"),ce())},i=()=>{e||L("error")};return r.on("left-meeting",n),r.on("error",i),r.join({url:t,token:a}).then(()=>{e||(L("joined"),Z(Date.now()),o(),T.current.track("televet.call.joined",{provider:"daily"}))}).catch(()=>{e||(L("error"),T.current.trackExpectedFailure("televet.call.join_failed",{provider:"daily"}))}),()=>{e=true;for(let e of l)r.off(e,o);r.off("left-meeting",n),r.off("error",i),ae()}},[le,O,t,a,ae,ce,de]),l(()=>{if(Q===null)return;te(Date.now()-Q);let e=setInterval(()=>{te(Date.now()-Q)},1e3);return()=>{clearInterval(e)}},[Q]);let ue=i(()=>{let e=D.current;e&&G(t=>(e.setLocalAudio(!t),!t))},[]),fe=i(()=>{let e=D.current;e&&U(t=>(e.setLocalVideo(!t),!t))},[]),be=i(()=>{let e=D.current;e?.cycleCamera&&e.cycleCamera().then(e=>{let t=e?.device?.facingMode;t&&J(t==="user")},()=>{})},[]);if(ne!==null)return w?/* @__PURE__ */m(v,{children:w(ne.reason,ne.detail)}):null;if(le===null)return null;if(!O)/* @__PURE__ */
52
+ return m(f,{style:[B.notice,{paddingTop:S.top+x.space.xl,paddingBottom:S.bottom+x.space.xl},F],testID:"everfur-vet-call-recording-notice",children:/* @__PURE__ */y(SdkTabletColumn,{style:B.noticeColumn,children:[
53
+ /* @__PURE__ */m(Text,{style:B.noticeTitle,accessibilityRole:"header",children:W.recordingNoticeTitle}),
54
+ /* @__PURE__ */m(b,{onPress:()=>j(true),accessibilityRole:"button",accessibilityLabel:W.recordingNoticeCta,testID:"everfur-vet-call-recording-continue",style:B.noticeContinue,children:/* @__PURE__ */m(Text,{tier:"control",style:B.noticeContinueLabel,children:W.recordingNoticeCta})}),
55
+ /* @__PURE__ */m(b,{onPress:ce,accessibilityRole:"button",accessibilityLabel:W.leaveCta,testID:"everfur-vet-call-recording-leave",style:B.errorLeaveHit,children:/* @__PURE__ */m(Text,{tier:"control",style:B.noticeLeave,children:W.leaveCta})})]})});if(I==="error")/* @__PURE__ */
56
+ return y(f,{style:[B.centered,F],testID:"everfur-vet-call-error",children:[
57
+ /* @__PURE__ */m(Text,{style:B.status,accessibilityLiveRegion:"polite",children:W.joinFailedReason}),
58
+ /* @__PURE__ */m(b,{onPress:se,accessibilityRole:"button",accessibilityLabel:W.leaveCta,testID:"everfur-vet-call-error-leave",style:B.errorLeaveHit,children:/* @__PURE__ */m(Text,{tier:"control",style:B.errorLeave,children:W.leaveCta})})]});if(H===null)/* @__PURE__ */
59
+ return m(EverfurVetCallLobby,{clinicianName:s,petName:d,consultMinutes:u,micOn:$,cameraOn:V,onToggleMic:ue,onToggleCamera:fe,...K.flip?{onSwitchCamera:be}:{},onLeave:se,style:F});let ge=le.DailyMediaView,he=s?.trim()??"",pe=ee>=Ke(u)*6e4;/* @__PURE__ */
60
+ return y(f,{style:[B.root,F],testID:"everfur-vet-call",children:[
61
+ /* @__PURE__ */y(f,{style:B.fill,testID:"everfur-vet-call-remote",children:[
62
+ /* @__PURE__ */m(ge,{videoTrack:nt(H.videoTrack),audioTrack:nt(H.audioTrack),mirror:false,objectFit:"cover",style:B.fill}),it(H)?null:/* @__PURE__ */y(f,{style:B.remoteOff,testID:"everfur-vet-call-remote-camera-off",children:[
63
+ /* @__PURE__ */m(PersonMark,{styles:B}),he.length>0?/* @__PURE__ */m(Text,{style:B.remoteOffName,numberOfLines:1,children:he}):null]})]}),
64
+ /* @__PURE__ */y(f,{style:[B.statusRow,{top:S.top+x.space.sm}],pointerEvents:"none",children:[he.length>0?/* @__PURE__ */m(Text,{tier:"compact",style:B.statusName,numberOfLines:1,testID:"everfur-vet-call-remote-name",children:he}):null,Q!==null?/* @__PURE__ */m(Text,{tier:"badge",style:[B.statusMeta,pe?B.statusMetaOver:null],testID:"everfur-vet-call-elapsed",children:A(ee)}):null]}),
65
+ /* @__PURE__ */y(f,{style:[B.selfView,{top:S.top+x.space.sm}],testID:"everfur-vet-call-self",children:[
66
+ /* @__PURE__ */m(ge,{videoTrack:V?nt(P?.videoTrack):null,audioTrack:null,mirror:X,objectFit:"cover",style:B.fill}),P?.videoTrack&&V?null:/* @__PURE__ */m(f,{style:[B.selfViewOff,B.fill],testID:"everfur-vet-call-self-off",children:/* @__PURE__ */m(Text,{tier:"badge",style:B.selfViewOffLabel,children:W.selfCameraOffLabel})})]}),
67
+ /* @__PURE__ */y(f,{style:[B.controlBar,{bottom:S.bottom+x.space.lg}],children:[K.speaker?/* @__PURE__ */m(CallControl,{label:q?W.speakerOffCta:W.speakerOnCta,glyph:/* @__PURE__ */m(SpeakerGlyph,{color:q?x.color.text.onBrand:dt,off:!q}),muted:!q,onPress:Y,testID:"everfur-vet-call-speaker",style:[B.control,q?null:B.controlMuted]}):null,
68
+ /* @__PURE__ */m(CallControl,{label:$?W.muteCta:W.unmuteCta,glyph:/* @__PURE__ */m(MicGlyph,{color:$?x.color.text.onBrand:dt,off:!$}),muted:!$,onPress:ue,testID:"everfur-vet-call-mic",style:[B.control,$?null:B.controlMuted]}),
69
+ /* @__PURE__ */m(CallControl,{label:V?W.cameraOffCta:W.cameraOnCta,glyph:/* @__PURE__ */m(CameraGlyph,{color:V?x.color.text.onBrand:dt,off:!V}),muted:!V,onPress:fe,testID:"everfur-vet-call-camera",style:[B.control,V?null:B.controlMuted]}),K.flip&&V?/* @__PURE__ */m(CallControl,{label:W.switchCameraCta,glyph:/* @__PURE__ */m(SwitchCameraGlyph,{color:x.color.text.onBrand}),onPress:be,testID:"everfur-vet-call-switch-camera",style:B.control}):null,
70
+ /* @__PURE__ */m(CallControl,{label:W.leaveCta,glyph:/* @__PURE__ */m(LeaveGlyph,{color:x.color.text.onBrand}),onPress:se,testID:"everfur-vet-call-leave",style:[B.control,B.controlDanger]})]})]})}var at="#141414",ct="#1B1B1B",st="rgba(20,20,20,0.62)",dt="#141414",ut=104,ft={textShadowColor:"rgba(0,0,0,0.55)",textShadowRadius:6};function bt(e){let{color:t,space:r,radius:o,type:l}=e;return d.create({root:{flex:1,backgroundColor:at},fill:{...P},centered:{flex:1,alignItems:"center",justifyContent:"center",gap:r.lg,padding:r.xl,backgroundColor:at},statusRow:{position:"absolute",left:r.md,right:ut+r.md*2,flexDirection:"column",alignItems:"flex-start",gap:2},statusName:{flexShrink:1,...face(e,"medium"),color:t.text.onBrand,fontSize:l.size.body,...ft},statusMeta:{...face(e,"mono"),color:t.text.onBrand,fontSize:l.size.caption,...ft},statusMetaOver:{color:t.danger},selfView:{position:"absolute",right:r.md,width:ut,height:148,borderRadius:o.lg,overflow:"hidden",backgroundColor:ct,borderWidth:1,borderColor:"rgba(255,255,255,0.24)",shadowColor:"#000",shadowOpacity:.35,shadowRadius:12,shadowOffset:{width:0,height:4},elevation:6},selfViewOff:{alignItems:"center",justifyContent:"center",paddingHorizontal:r.xs,backgroundColor:ct},remoteOff:{...P,alignItems:"center",justifyContent:"center",gap:r.md,backgroundColor:at},remoteOffAvatar:{width:96,height:96,borderRadius:o.pill,overflow:"hidden",alignItems:"center",justifyContent:"flex-end",backgroundColor:"rgba(255,255,255,0.14)"},remoteOffHead:{width:36,height:36,borderRadius:18,marginBottom:6,backgroundColor:"rgba(255,255,255,0.56)"},remoteOffBody:{width:64,height:28,borderTopLeftRadius:32,borderTopRightRadius:32,backgroundColor:"rgba(255,255,255,0.56)"},remoteOffName:{...face(e,"medium"),color:t.text.onBrand,fontSize:l.size.subtitle,paddingHorizontal:r.xl},notice:{flex:1,justifyContent:"center",gap:r.lg,paddingHorizontal:r.xl,backgroundColor:t.surface},noticeColumn:{justifyContent:"center",gap:r.lg},noticeTitle:{...face(e,"medium"),fontSize:l.size.subtitle,lineHeight:Math.round(l.size.subtitle*l.lineHeight.relaxed),color:t.text.primary},noticeContinue:{minHeight:44,alignItems:"center",justifyContent:"center",paddingHorizontal:r.xl,borderRadius:o.pill,backgroundColor:t.primary},noticeContinueLabel:{...face(e,"medium"),color:t.onPrimary,fontSize:l.size.body},noticeLeave:{...face(e,"medium"),color:t.brandInk,fontSize:l.size.body},selfViewOffLabel:{...face(e,"medium"),color:"rgba(255,255,255,0.78)",fontSize:l.size.micro,textAlign:"center"},controlBar:{position:"absolute",left:0,right:0,flexDirection:"row",justifyContent:"center",alignItems:"center",gap:r.sm},control:{minWidth:54,minHeight:56,paddingHorizontal:r.md,alignItems:"center",justifyContent:"center",borderRadius:o.pill,backgroundColor:st},controlMuted:{backgroundColor:t.text.onBrand},controlDanger:{backgroundColor:t.danger},status:{...face(e,"medium"),fontSize:l.size.subtitle,lineHeight:Math.round(l.size.subtitle*l.lineHeight.relaxed),color:t.surface,textAlign:"center"},errorLeaveHit:{minHeight:44,minWidth:44,alignItems:"center",justifyContent:"center",paddingHorizontal:r.lg},errorLeave:{...face(e,"medium"),color:t.surface,fontSize:l.size.body,textDecorationLine:"underline"}})}export{De as EVERFUR_DAILY_SETUP,EverfurVetCall,EverfurVetCallLobby,M as VET_CALL_CONSULT_MINUTES,W as VET_CALL_COPY,isEverfurDailyModule,isSafeRoomUrl,isUsableRoomCredential,loadEverfurDaily,registerEverfurDaily};
@@ -1,7 +1,7 @@
1
1
  /*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
2
2
  import { E as EverfurResult } from './EverfurResult.d-D_-254ZY.js';
3
3
  import { P as PetRef } from './ids.d-B2GAAifq.js';
4
- import { E as EverfurInboxItem, b as EverfurInboxOpen, a as EverfurInboxClient } from './inbox.d-DJ9xgU1Z.js';
4
+ import { E as EverfurInboxItem, b as EverfurInboxOpen, a as EverfurInboxClient } from './inbox.d-B2JXK0uI.js';
5
5
  import { E as EverfurError } from './EverfurError.d-8NHtlgzA.js';
6
6
  import { L as LifecyclePort } from './LifecyclePort.d-Cb9NtmP-.js';
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
2
2
  import { E as EverfurResult } from './EverfurResult.d-BFH-3s6E.cjs';
3
3
  import { P as PetRef } from './ids.d-B2GAAifq.cjs';
4
- import { E as EverfurInboxItem, b as EverfurInboxOpen, a as EverfurInboxClient } from './inbox.d-CPcMMz-Y.cjs';
4
+ import { E as EverfurInboxItem, b as EverfurInboxOpen, a as EverfurInboxClient } from './inbox.d-CwA1ogzV.cjs';
5
5
  import { E as EverfurError } from './EverfurError.d-8NHtlgzA.cjs';
6
6
  import { L as LifecyclePort } from './LifecyclePort.d-Cb9NtmP-.cjs';
7
7
 
@@ -3,7 +3,7 @@
3
3
  "use strict";var e=require("react"),t=require("react/jsx-runtime"),i=require("react-dom");function r(e){if(typeof e=="number")return a(e);if(typeof e!="string")return null;let t=e.trim();if(t.length===0)return null;if(t.startsWith("#"))return n(t.slice(1));if(t.toLowerCase().startsWith("0x"))return n(t.slice(2));if(t.toLowerCase().startsWith("rgb"))return o(t);if(/^[0-9a-fA-F]+$/.test(t)){let e=n(t);if(e!==null)return e}return/^\d+$/.test(t)?a(Number.parseInt(t,10)):null}function n(e){let t=e.trim();if(!/^[0-9a-fA-F]+$/.test(t))return null;if(t.length===3)return{r:l(t[0]),g:l(t[1]),b:l(t[2]),a:1};if(t.length===6)return{r:s(t,0),g:s(t,2),b:s(t,4),a:1};if(t.length===8){let e=s(t,0);return{r:s(t,2),g:s(t,4),b:s(t,6),a:e/255}}return null}function o(e){let t=e.indexOf("("),i=e.indexOf(")");if(t<0||i<0||i<t)return null;let r=e.slice(t+1,i).split(",").map(e=>e.trim());if(r.length<3)return null;let n=u(Number(r[0])),o=u(Number(r[1])),a=u(Number(r[2]));if(n===null||o===null||a===null)return null;let s=1;if(r.length>=4){let e=Number(r[3]);if(!Number.isFinite(e))return null;s=Math.min(1,Math.max(0,e))}return{r:n,g:o,b:a,a:s}}function a(e){if(!Number.isFinite(e))return null;let t=Math.trunc(e)>>>0,i=t>>>24&255;return{r:t>>>16&255,g:t>>>8&255,b:t&255,a:i===0?1:i/255}}function s(e,t){return Number.parseInt(e.slice(t,t+2),16)}function l(e){return Number.parseInt(`${e??"0"}${e??"0"}`,16)}function u(e){return Number.isFinite(e)?Math.min(255,Math.max(0,Math.round(e))):null}function c(e,t,i){return`#${d(e)}${d(t)}${d(i)}`.toUpperCase()}function d(e){return e.toString(16).padStart(2,"0")}var p="#111111",f="#FFFFFF",m="#000000";function readableOn(e){let t=r(e);if(t===null)return f;let i=b(t),n=b({r:17,g:17,b:17}),o=b({r:255,g:255,b:255});return x(i,o)>=x(i,n)?f:p}function h(e,t){let i=readableOn(e);return contrastRatio(i,e)>=t?i:contrastRatio(f,e)>=contrastRatio(m,e)?f:m}function g(e){let t=t=>e.reduce((e,i)=>Math.min(e,contrastRatio(t,i)),Number.POSITIVE_INFINITY);return t(f)>=t(m)?f:m}function b(e){let t=v(e.r/255),i=v(e.g/255),r=v(e.b/255);return.2126*t+.7152*i+.0722*r}function v(e){return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}function x(e,t){let i=Math.max(e,t),r=Math.min(e,t);return(i+.05)/(r+.05)}function contrastRatio(e,t){let i=r(e),n=r(t);if(i===null||n===null)return 1;let o=n.a>=1?n:{...n},a=i.a>=1?i:y(i,o);return x(b(a),b(o))}function y(e,t){let i=e.a,r=(e,t)=>Math.round(e*i+t*(1-i));return{r:r(e.r,t.r),g:r(e.g,t.g),b:r(e.b,t.b),a:1}}function w(e,t){let i=r(e),n=r(t);if(i===null||n===null)return null;let o=i.a>=1?i:y(i,{...n});return c(o.r,o.g,o.b)}function k(e,t){let i=r(e);if(i===null)return null;let n=Math.min(1,Math.max(0,t));return`rgba(${i.r}, ${i.g}, ${i.b}, ${n})`}var _=.05;function j(e,t,i,n){let o=t[0];if(o===void 0)return i;let a=e=>t.every(t=>contrastRatio(e,t)>=n);if(r(e)===null)return i;if(a(e))return e;let s=w(e,o),l=s===null?null:r(s),u=r(i);if(l===null||u===null)return i;for(let e=1;e<1/_;e+=1){let t=e*_,i=(e,i)=>Math.round(e+(i-e)*t),r=c(i(l.r,u.r),i(l.g,u.g),i(l.b,u.b));if(a(r))return r}return i}var z=/* @__PURE__ */Object.freeze({display:/* @__PURE__ */Object.freeze({size:29,lineHeight:1.06,weight:"800",face:"heading",letterSpacing:-.01,uppercase:false,tier:"heading"}),title:/* @__PURE__ */Object.freeze({size:23,lineHeight:1.12,weight:"800",face:"heading",letterSpacing:-.01,uppercase:false,tier:"heading"}),cardTitle:/* @__PURE__ */Object.freeze({size:19,lineHeight:1.22,weight:"800",face:"sans",letterSpacing:0,uppercase:false,tier:"heading"}),rowTitle:/* @__PURE__ */Object.freeze({size:15.5,lineHeight:1.4,weight:"700",face:"sans",letterSpacing:0,uppercase:false,tier:"content"}),body:/* @__PURE__ */Object.freeze({size:15,lineHeight:1.5,weight:"400",face:"sans",letterSpacing:0,uppercase:false,tier:"content"}),message:/* @__PURE__ */Object.freeze({size:15.5,lineHeight:1.5,weight:"400",face:"sans",letterSpacing:0,uppercase:false,tier:"content"}),bodySmall:/* @__PURE__ */Object.freeze({size:14.5,lineHeight:1.4,weight:"400",face:"sans",letterSpacing:0,uppercase:false,tier:"content"}),caption:/* @__PURE__ */Object.freeze({size:13,lineHeight:1.4,weight:"400",face:"sans",letterSpacing:0,uppercase:false,tier:"content"}),label:/* @__PURE__ */Object.freeze({size:10.5,lineHeight:1.4,weight:"400",face:"mono",letterSpacing:.05,uppercase:true,tier:"compact"}),eyebrow:/* @__PURE__ */Object.freeze({size:15,lineHeight:1.5,weight:"400",face:"mono",letterSpacing:.07,uppercase:true,tier:"compact"}),chip:/* @__PURE__ */Object.freeze({size:15,lineHeight:1.3,weight:"600",face:"sans",letterSpacing:0,uppercase:false,tier:"compact"}),tab:/* @__PURE__ */Object.freeze({size:16,lineHeight:1.5,weight:"600",face:"sans",letterSpacing:0,uppercase:false,tier:"compact"}),button:/* @__PURE__ */Object.freeze({size:15,lineHeight:1.5,weight:"700",face:"sans",letterSpacing:0,uppercase:false,tier:"control"}),badge:/* @__PURE__ */Object.freeze({size:12,lineHeight:1.5,weight:"700",face:"sans",letterSpacing:0,uppercase:false,tier:"badge"})});var C=Object.freeze;function deepFreeze(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){C(e);for(let t of Object.keys(e))deepFreeze(e[t])}return e}var S=/* @__PURE__ */Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3});var P={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},T={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},F={nano:8,small:9,micro:10,tiny:11,caption:13,bodyTight:15,body:17,subtitle:20,heading:22,verdict:24},$={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},O={regular:"400",medium:"500",bold:"700"},E={eyebrow:1,monoWide:.9,headerBrand:-.42,tight:-.35},I=0,L="System",H="monospace",R=["content","heading","control","compact","badge"];function D(e){let t={};for(let i of R)t[i]=e;return t}var N=[];function B(){return{family:L,mono:H,fontUrl:null,families:{regular:L,medium:L,bold:L,mono:H,monoMedium:H,monoBold:H},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:F,tierSizes:D(F),lineHeight:$,weight:O,letterSpacing:E,scale:1,maxScale:I,scaleCaps:S,headingFamily:null,headingWeight:null,fontSources:N,roles:z,typeScale:1}}var A={},M=/* @__PURE__ */Object.freeze({standard:/* @__PURE__ */Object.freeze([.2,0,0,1]),emphasized:/* @__PURE__ */Object.freeze([.2,.8,.2,1]),exit:/* @__PURE__ */Object.freeze([.4,0,1,1])});function cssCubicBezier(e){return`cubic-bezier(${e.join(", ")})`}var W={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:cssCubicBezier(M.standard),emphasized:cssCubicBezier(M.emphasized),exit:cssCubicBezier(M.exit)},reducedMotion:false},q={brand:"#10462E",brandSoft:"rgba(16,70,46,0.10)",brandSofter:"rgba(16,70,46,0.15)",brandBorder:"rgba(16,70,46,0.18)",borderHairlineGreen:"rgba(16,70,46,0.25)",brandBorderStrong:"rgba(16,70,46,0.55)",brandInk:"#10462E",linkInk:"#10462E",surface:"#FFFFFF",surfaceCream:"#FFFFFF",surfaceSubtle:"#F1F5F2",background:"#FFFFFF",borderRingCream:"#E4E4E4",chatGround:"#FFFFFF",composerFill:"#FFFFFF",composerBorder:"rgba(16,70,46,0.75)",shadow:"#0B3421",text:{primary:"#000000",secondary:"#0E462E",muted:"#6B6B6B",placeholder:"rgba(61,61,61,0.75)",onBrand:"#FFFFFF",metaCool:"#3D3D3D",timestamp:"rgba(61,61,61,0.75)"},primary:"#10462E",onPrimary:"#FFFFFF",accent:"#10462E",onAccent:"#FFFFFF",accentEdge:"#07C168",success:"#07C168",danger:"#C03410",onDanger:"#FFFFFF",errorRed:"#C03410",warningStrong:"#A45610",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.12)",badgeBgCaution:"rgba(217,130,29,0.14)",badgeBgCritical:"rgba(192,52,16,0.06)",badgeBgNeutral:"rgba(107,107,107,0.12)",bubbleUser:"#10462E",bubbleAssistant:"#FFFFFF",bubbleVet:"#FFC3BC",onBubbleVet:"#000000",skeleton:"#E9F1E9",scanButtonPink:"#FFC3BC",highlight:"#FFC3BC",onHighlight:"#000000",mark:"#07C168",controlEdge:"rgba(16,70,46,0.18)",structureEdge:"rgba(16,70,46,0.25)",primaryEdge:"#10462E",checkupCardLowRiskBg:"rgba(7,193,104,0.10)",checkupCardConcernBg:"rgba(239,167,0,0.10)",info:"#10462E",badgeBgInfo:"rgba(16,70,46,0.10)",infoEdge:"rgba(16,70,46,0.25)"},U=deepFreeze({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:q,space:P,radius:T,type:B(),motion:W,slots:A}),K={brand:"#6BD39A",brandSoft:"rgba(107,211,154,0.12)",brandSofter:"rgba(107,211,154,0.18)",brandBorder:"rgba(107,211,154,0.22)",borderHairlineGreen:"rgba(107,211,154,0.28)",brandBorderStrong:"rgba(107,211,154,0.55)",brandInk:"#6BD39A",linkInk:"#6BD39A",surface:"#1C1F23",surfaceCream:"#23272C",surfaceSubtle:"#23272C",background:"#15171A",borderRingCream:"#3A3F45",chatGround:"#1C1F23",composerFill:"#23272C",composerBorder:"rgba(107,211,154,0.75)",shadow:"#000000",text:{primary:"#F5F3F0",secondary:"#A9E4C4",muted:"#9A9A9A",placeholder:"rgba(255,255,255,0.55)",onBrand:"#0E1F17",metaCool:"#C9C9C9",timestamp:"rgba(245,243,240,0.7)"},primary:"#6BD39A",onPrimary:"#0E1F17",accent:"#6BD39A",onAccent:"#0E1F17",accentEdge:"#34D888",success:"#07C168",danger:"#F87171",onDanger:"#0E1F17",errorRed:"#FF6B5B",warningStrong:"#F0A35E",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.18)",badgeBgCaution:"rgba(217,130,29,0.20)",badgeBgCritical:"rgba(185,28,28,0.22)",badgeBgNeutral:"rgba(255,255,255,0.10)",bubbleUser:"#6BD39A",bubbleAssistant:"#1C1F23",bubbleVet:"#FFC3BC",onBubbleVet:"#000000",skeleton:"#23272C",scanButtonPink:"#FFC3BC",highlight:"#605051",onHighlight:"#F5F3F0",mark:"#07C168",controlEdge:"rgba(107,211,154,0.22)",structureEdge:"rgba(107,211,154,0.28)",primaryEdge:"#6BD39A",checkupCardLowRiskBg:"rgba(7,193,104,0.16)",checkupCardConcernBg:"rgba(239,167,0,0.16)",info:"#6BD39A",badgeBgInfo:"rgba(107,211,154,0.12)",infoEdge:"rgba(107,211,154,0.28)"},V=deepFreeze({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:K,space:P,radius:T,type:B(),motion:W,slots:A});var G=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),Y=globalThis,X=Y[G]??(Y[G]=e.createContext(U));X.displayName??="EverfurThemeContext";function useEverfurTheme(){return e.useContext(X)}var Q={ink:"#10462E",go:"#07C168",alert:"#C03410",tintSage:"#E6ECE8"},Z=/* @__PURE__ */Symbol.for("@everfur-health/ui-core#ThemeContext@v1");function J(){let t=globalThis,i=t[Z];return i===void 0&&(i=e.createContext(null),i.displayName="EverfurThemeContext",t[Z]=i),i}var ee=(e,t)=>e.toUpperCase()===t.toUpperCase();function te(e){let t=r(e);return t!==null&&b(t)<.18}var ie=/* @__PURE__ */new WeakMap;function re(e,t){if(t===null)return e;let i=ie.get(e);i===void 0&&(i=/* @__PURE__ */new WeakMap,ie.set(e,i));let r=i.get(t);return r===void 0&&(r=ne(e,t),i.set(t,r)),r}function ne(e,t){let i=t.colors,r=!ee(i.ink,Q.ink),n=!ee(i.go,Q.go),o=e===U&&te(i.bg),a=o?V:e,s=a.color,l=e=>o||s[e]===U.color[e],u={};r&&l("primary")&&(Object.assign(u,{primary:i.ink,onPrimary:i.onInk,brand:i.ink,brandInk:i.ink}),l("linkInk")&&(u.linkInk=i.ink),!n&&l("accent")&&Object.assign(u,{accent:i.ink,onAccent:i.onInk})),n&&l("accent")&&Object.assign(u,{accent:i.go,onAccent:i.onGo}),!ee(i.alert,Q.alert)&&l("danger")&&(u.danger=i.alert),!ee(i.tintSage,Q.tintSage)&&l("brandSoft")&&(u.brandSoft=i.tintSage,l("brandSofter")&&(u.brandSofter=i.tintSage)),o&&Object.assign(u,{background:i.bg,surface:i.surface,text:{...s.text,primary:i.text,muted:i.muted},borderRingCream:i.line});let c=t.motion?.reduced===true&&!a.motion.reducedMotion;return!o&&!c&&Object.keys(u).length===0?e:{...a,color:{...s,...u},...c?{motion:{...a.motion,reducedMotion:true}}:{}}}function oe(){let t=useEverfurTheme(),i=e.useContext(J());return e.useMemo(()=>re(t,i),[t,i])}var ae=/* @__PURE__ */Object.freeze({loading:"Loading",retry:"Try again",signedOut:"Sign in required",addToCart:"Add to cart",added:"Added",remove:"Remove",checkout:"Checkout",subtotal:"Subtotal",sample:"Sample",cartEmpty:"Your cart is empty.",choosePet:"Choose a pet",emptyTitle:"",emptyBody:"",emptyAsk:""}),se=/* @__PURE__ */Object.freeze({emptyTitle:true,emptyBody:true,emptyAsk:true}),le=/* @__PURE__ */Object.freeze({dna:"",records:"Records",inside:"Inside",profile:""}),ue=/* @__PURE__ */Object.freeze({planTitle:e=>`${e}'s care plan`,cartLabel:e=>`${e} cart`}),ce=/* @__PURE__ */Object.freeze([...Object.keys(ae).filter(e=>se[e]===true&&ae[e]==="").map(e=>`HEALTH_PLAN_COPY.${e}`),...["profile"].filter(e=>le[e]==="").map(e=>`HEALTH_PLAN_REASON_LABELS.${e}`)]);var de=/* @__PURE__ */Object.freeze({imageVariant:"wide",reasonVariant:"pills",cartBarVisibility:"whenItems",cartBarPlacement:"sticky",addButtonSize:"full",addedVariant:"link",categoryVariant:"text",showCategory:false,cardShadow:false,cardBorder:true});function pe(e,t){return{setInPlan:t,addAll:async()=>{let i=(e?.items??[]).filter(e=>!e.inPlan);return(await Promise.all(i.map(e=>t(e.productId,true)))).every(Boolean)}}}function showHealthPlanCartBar(e,t){return(e??de.cartBarVisibility)==="always"||t>0}var fe=/* @__PURE__ */Object.freeze(["showCategory","cardShadow","cardBorder","addButtonSize","addButtonFontSize","addedVariant","categoryVariant","cardPadding","itemTitleSize","itemTitleWeight","priceSize","priceWeight","reasonTextSize","reasonLabelWidth","reasonGap"]);function me(e){let t={};for(let i of fe)e[i]!==void 0&&(t[i]=e[i]);return t}function he(e){let t=typeof e=="number"&&Number.isFinite(e)&&e>0?e:e==="compact"?32:44;return{height:t,hit:Math.max(44,t)}}function ge(e){return typeof e=="number"&&Number.isFinite(e)&&e>=0?e:null}function be(e,t){let i=ge(e);return i===null?0:i-t}function isHealthPlanSessionRequired(e){return e!==null&&(e.reasonCode==="session_required"||e.code==="sessionRequired")}var ve=/* @__PURE__ */Symbol.for("@everfur/sdk#HealthPlanCartDock@v1"),xe=globalThis,ye=xe[ve]??(xe[ve]=e.createContext(null));function HealthPlanCartScope({children:t}){let[i,r]=e.useState(null),n=e.useMemo(()=>({dock:i,publish:r}),[i]);return e.createElement(ye.Provider,{value:n},t)}function useHealthPlanCartDock(){return e.useContext(ye)?.dock??null}function we(t,i,r,petRef,n,o){let a=e.useContext(ye)?.publish,s=e.useRef(o);e.useEffect(()=>{s.current=o},[o]);let l=e.useMemo(()=>pe(n,(e,t)=>s.current(e,t)),[n]);e.useEffect(()=>{if(!(a===void 0||!t))return a(/* @__PURE__ */Object.freeze({cart:i,busy:r,petRef:petRef,plan:n,...l})),()=>a(null)},[a,t,i,r,petRef,n,l])}function healthPlanPetWords(e,t){let i=e?.trim()??"",r=i===""?"your pet":i,n=i===""?"Your pet":i;return t==="female"?{name:r,Name:n,poss:"her",Poss:"Her",obj:"her"}:t==="male"?{name:r,Name:n,poss:"his",Poss:"His",obj:"him"}:{name:r,Name:n,poss:`${r}'s`,Poss:`${n}'s`,obj:r}}var ke=e=>e===null?"":`${e.productName} renews every ${e.intervalDays} days at ${e.box??""} until you cancel; skip or cancel anytime in the app.`,_e=/* @__PURE__ */Object.freeze({onceFine:"",cartFine:ke,startedWhat:()=>""});function healthPlanFocusCopyFor(e){let t=healthPlanPetWords(e.name,e.sex),i=e=>e.petName?.trim()||t.name,NameOf=e=>e.petName?.trim()||t.Name,r=/* @__PURE__ */Object.freeze({jumpKicker:(e,i)=>i?`In ${t.poss} plan, every ${e.intervalDays} days`:e.offer?`${e.discountPercent}% off ${t.poss} first box`:e.intervalDays>0?`Ships every ${e.intervalDays} days`:r.onceLine(e),optionsLabel:"How to buy",subscribe:"Subscribe",bestValue:"Best value",subscribeLine:e=>e.offer?`First box, then ${e.box??""}`:`${e.box??""} every ${e.intervalDays} days`,priceLine:e=>e.offer?`${e.discountPercent}% off the first box. Ships every ${e.intervalDays} days.`:e.intervalDays>0?`Ships every ${e.intervalDays} days.`:r.onceOffer(e),once:"One box",onceLine:e=>e.onceDiscountPercent>0?`${e.onceDiscountPercent}% off, ships once`:"Ships once",buyOnce:e=>`Buy one box, ${e.once??e.box??""}`,subscribed:"Subscribed",subscribedLine:(e,t)=>t===null?`Every ${e.intervalDays} days`:`Every ${e.intervalDays} days · next box ${t}`,manage:"Manage",checkoutKicker:"Checkout",checkoutTitle:e=>`Checkout: ${e.productName}`,checkoutOffer:e=>`${e.discountPercent}% off your first box.`,shipsEvery:"Ships every",days:e=>`${e} days`,buyOnceOption:"Buy once",checkoutGo:(e,t,i)=>`${t?"Subscribe":"Buy now"} · ${i} today`,renews:e=>`Renews every ${e.intervalDays} days at ${e.box??""} until you cancel; skip or cancel anytime in the app.`,onceFine:"One box, ships tomorrow.",onceOffer:e=>e.onceDiscountPercent>0?`${e.onceDiscountPercent}% off, ships once.`:"Ships once.",checkoutNote:"",close:"Close",startedTitle:e=>`${NameOf(e)}'s plan has started.`,orderedTitle:()=>"Order placed.",startedWhat:e=>`${e.productName} ships tomorrow.`,startedNote:"",startedSteps:"What happens next",tomorrow:"Tomorrow",firstBoxShips:`${t.Poss} first box ships.`,trackingComesByText:"Tracking comes by text.",checkin:e=>e===null?"A 2-week check-in by text.":`A 2-week check-in by text: ${e}`,refill:`A text 3 days before ${t.poss} next box. Reply SKIP to skip it.`,nextBoxShips:e=>`${t.Poss} next box ships, ${e.box??""}.`,startedDone:`Back to ${t.poss} plan`,manageKicker:"Your subscription",manageTitle:e=>`Manage ${e.productName}`,skip:"Skip the next box",cancel:"Cancel subscription",skipped:(e,i)=>i===null?"Skipped.":`Skipped. ${t.Poss} next box ships ${i}.`,cancelled:e=>`${e.productName} is cancelled. Restart it from ${t.poss} plan anytime.`,orders:"Orders",startedHeader:"Subscribed",placedHeader:"Order placed",cartCheckoutTitle:"Checkout",orderNote:"",cartLabel:e=>e>0?`Cart, ${e} item${e>1?"s":""}`:"Cart, empty",addToCart:e=>`Add to cart · ${e}`,viewCart:"View cart",addedToCart:(e,t)=>`${e.productName} is in your cart${t?", as a subscription":""}.`,removedFromCart:e=>`${e} is out of your cart.`,cartTitle:"Cart",cartEmptyTitle:"Your cart is empty",cartEmptyBody:e=>`${NameOf(e)}'s plan pick lands here when you add it.`,seeOrders:`See ${t.poss} orders`,quantityLabel:e=>`How many: ${e}`,fewer:"One fewer",more:"One more",remove:"Remove",cartSubLine:e=>e.offer?`First box ${e.discountPercent}% off, then ${e.box??""} every ${e.intervalDays} days`:`Every ${e.intervalDays} days`,cartOnceLine:(e,i)=>i?`An extra box. ${t.Poss} plan keeps shipping.`:e.onceDiscountPercent>0?`One box, ${e.onceDiscountPercent}% off`:"One box",cartModeLabel:e=>`How to buy ${e}`,cartModeSubscribe:e=>e.offer?`Subscribe, ${e.discountPercent}% off the first box`:"Subscribe",cartModeOnce:e=>e.onceDiscountPercent>0?`One box, ${e.onceDiscountPercent}% off`:"One box",subtotal:"Subtotal",shipping:"Shipping",shippingValue:"",shippingTag:"",total:"Total",dueToday:"Due today",thenRenews:e=>`Then ${e.productName}`,renewsEvery:e=>`${e.box??""} every ${e.intervalDays} days`,checkoutCart:e=>`Checkout · ${e}`,cartOneAtATime:"",cartSubscriptionApart:"",cartItemSubscription:e=>`Subscription, every ${e.intervalDays} days`,cartItemQuantity:e=>`Qty ${e}`,placeOrder:(e,t)=>`${t?"Place order and subscribe":"Place order"} · ${e}`,cartFine:e=>`${e===null?"":`${ke(e)} `}Ships tomorrow.`,placedSteps:"What's coming",placedShips:"It ships.",placedArrives:"It arrives at home.",viewOrder:"View order",herSubscription:`${t.Poss} subscription`,nextBox:e=>`Next box ${e}`,everyDays:e=>`Every ${e} days`,ordersHeading:e=>e?"Orders":`${t.Poss} orders`,ordersFine:"",ordersEmptyTitle:"No orders yet",ordersEmptyBody:e=>`The boxes from ${i(e)}'s plan show up here.`,moreOrders:"",orderSteps:["Ordered","Shipped","Out for delivery","Delivered"],subscriptionBox:"Subscription box",orderTitle:e=>e===null?"Order":`Order ${e}`,arrivesBy:e=>`Arrives by ${e}`,deliveredOn:e=>`Delivered ${e}`,expected:e=>`Expected ${e}`,tracking:"Tracking",trackingByText:"The tracking number comes by text when it ships.",trackOn:e=>`Track on ${e}`,trackLink:"",inThisOrder:"In this order",orderItemLine:(e,t)=>`Qty ${e}${t?" · subscription box":""}`,paidWith:"Paid with",buyAgain:"Buy again",orderHelp:"Get help with this order",addWeightTitle:`Add ${t.poss} weight to size ${t.poss} dose`,addWeightBody:`From a home scale or ${t.poss} last vet visit.`,connectRecordsTitle:`Connect ${t.poss} vet records`,connectRecordsBody:`${t.Poss} weight, visits and labs make ${t.poss} plan sharper.`,weightKicker:`${t.Poss} weight`,weightTitle:e=>`Add ${i(e)}'s weight`,weightBody:`From a home scale or ${t.poss} last vet visit. ${t.Poss} plan uses it to size ${t.poss} dose.`,weightField:`${t.Poss} weight`,weightUnit:"lb",weightUnitKg:"kg",weightErrorKg:"Enter your pet’s weight",weightError:`Enter ${t.poss} weight in pounds, like 14.1.`,weightSave:`Save ${t.poss} weight`,weightSaved:e=>`Saved: ${e} lb. ${t.Poss} dose is sized for ${t.obj}.`,weightSavedKg:e=>`Saved: ${e} kg. ${t.Poss} dose is sized for ${t.obj}.`,checkoutFailed:"That didn't go through. Please try again.",builtWith:e=>`Built with ${e}`,fromVet:e=>`From ${e}`,waitVetTips:e=>`Free tips from ${e}, built around that risk`,signalsFit:e=>`${e} of ${e} signals fit ${t.Name}`,signalsValue:e=>`${e}/${e}`,noPick:`No supplement for this one. ${t.Poss} vet comes first.`,callYourVet:"Call your vet today",callAVet:"Call a vet today",saveForCheckup:`Save for ${t.poss} next checkup`,savedForCheckup:`Saved for ${t.poss} next checkup`,blanksLabel:`${t.Poss} three blanks`,blanksAsked:e=>`Asked ${e}`,blanksAskedNoClinic:"",blanksWaitPill:"2 to 5 days",blanksFilledKicker:`From ${t.poss} vet records`,blanksFilled:(e,t)=>`${e} of ${t} filled`,blanksWeight:`Keep ${t.obj} at `,blanksWeightSource:`From ${t.poss} vet visits`,blanksDose:(e,t)=>`${e} of ${t}`,blanksDoseSource:`Sized to ${t.poss} weight`,blanksShots:`${t.Poss} next shots are due `,blanksShotsSource:`From ${t.poss} clinic`,blankEmpty:"blank",recordsLanded:`${t.Poss} records are in. ${t.Poss} plan now uses ${t.poss} weight and ${t.poss} visits.`,todayLabel:`${t.Poss} Health Plan`,poweredBy:"powered by",poweredByName:"Everfur",seeMore:"See more",seeLess:"See less",reportActions:"Actions to take",openReport:`Open it in ${t.poss} report`,askReport:"Ask about it",fullOpen:`See ${t.poss} full plan`,fullOpenLine:`${t.Poss} vet, reviews and ${t.poss} checkup`,fullClose:`Show ${t.poss} brief plan`,fullCloseLine:`${t.Poss} risk, tips, pick and signs`,hopeNoted:e=>`Noted. When ${t.poss} results land, we'll start with ${e}.`,productLink:e=>`${e}, see the product`,productPhotos:e=>`${e} photos, swipe for more`,shopAll:"Shop all",madeFor:`Made for ${t.name}`,ratingLine:e=>`· ${e} reviews`,productOffer:e=>`${e.discountPercent}% off ${t.poss} first box`,productEvery:e=>`Every ${e.intervalDays} days`,productOnce:e=>e.onceDiscountPercent>0?`One box, ${e.onceDiscountPercent}% off`:"One box",productExtraBox:"An extra box",productOnPlan:e=>`On ${t.poss} plan, every ${e.intervalDays} days. This adds one extra box.`,quantity:"Quantity",description:"Description",readMore:"Read more",readLess:"Read less",whatsInside:"What's inside",howMuch:"How much",reviewsTitle:"Reviews",reviewCount:e=>`${e} reviews`,reviewsSwipe:"Reviews, swipe for more",readAllReviews:e=>`Read all ${e} reviews`,starsLabel:e=>`${e} out of 5 stars`,buyNow:"Buy now"});return r}var je=healthPlanFocusCopyFor({sex:"female"});function formatHealthPlanDay(e,t){if(e===null||!/^\d{4}-\d{2}-\d{2}$/.test(e))return null;let i=/* @__PURE__ */new Date(`${e}T00:00:00Z`);if(Number.isNaN(i.getTime()))return null;try{return new Intl.DateTimeFormat(t??"en-US",{month:"short",day:"numeric",timeZone:"UTC"}).format(i)}catch{return e}}function ze(e){return e!=null&&(e.wait!==void 0||e.pick.hidden===true)}function Ce(e){return{...e,pick:{...e.pick,none:true,hidden:true}}}var Se=/* @__PURE__ */Object.freeze({productId:"",partnerSku:null,title:"",description:null,category:null,price:null,currency:null,imageUrl:null,url:null,reasons:[],inPlan:false,sample:false});var Pe=/* @__PURE__ */Object.freeze({track(){},trackExpectedFailure(){}});function ok(e,t){/* @__PURE__ */
4
4
  return Object.freeze({ok:true,value:e})}function err(e){/* @__PURE__ */
5
5
  return Object.freeze({ok:false,error:e})}var Te=class _EverfurConfigError extends Error{constructor(e,t){super(t),this.name="EverfurConfigError",this.kind=e,Object.setPrototypeOf(this,_EverfurConfigError.prototype)}};var Fe=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurContext@v1"),$e=globalThis,Oe=$e[Fe]??($e[Fe]=e.createContext(null));Oe.displayName??="EverfurContext";function Ee(){let t=e.useContext(Oe);if(t===null)throw new Te("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return t}var Ie=/* @__PURE__ */Object.freeze({opened:"health_plan.opened",productClicked:"health_plan.product_clicked",checkoutStarted:"health_plan.checkout_started"});function Le(){return e.useContext(Oe)?.runtime.registry.services.telemetry??Pe}var He=e.createContext(null);function HealthPlanPetScope({petRef:petRef,children:t}){return e.createElement(He.Provider,{value:petRef},t)}function Re(t){let i=e.useContext(He),r=e.useContext(Oe);return i??t??r?.activePet??null}function De(t,petRef,i){let r=Le(),n=e.useRef(null);e.useEffect(()=>{if(!t||petRef===null||n.current===petRef)return;n.current=petRef;let e=i?.items??[];r.track(Ie.opened,{petRef:petRef,itemsCount:e.length,inPlanCount:e.filter(e=>e.inPlan).length})},[t,petRef,i,r])}function Ne(e,petRef,t,i){e.track(Ie.productClicked,{petRef:petRef,productId:t,inPlan:i})}function Be(e,petRef,t){e.track(Ie.checkoutStarted,{petRef:petRef,itemsCount:t.count,subtotal:t.subtotal,currency:t.currency})}var Ae=[{wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"AuthorizationException",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"ConflictException",envelope:"http_envelope",httpStatus:409,retryable:true},{wireCode:"DAILY_QUOTA_EXCEEDED",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"FILE_TOO_LARGE",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"IDEMPOTENCY_KEY_IN_FLIGHT",envelope:"http_envelope",httpStatus:409,retryable:true},{wireCode:"IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"INVALID_CONTENT_TYPE",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"InternalFailureException",envelope:"http_envelope",httpStatus:500,retryable:true},{wireCode:"MethodNotAllowedException",envelope:"http_envelope",httpStatus:405,retryable:false},{wireCode:"NotImplementedException",envelope:"http_envelope",httpStatus:501,retryable:false},{wireCode:"PaymentRequiredException",envelope:"http_envelope",httpStatus:402,retryable:false},{wireCode:"ResourceNotFoundException",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"ServiceUnavailableException",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"TIER_UPGRADE_REQUIRED",envelope:"http_envelope",httpStatus:402,retryable:false},{wireCode:"ThrottlingException",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"ValidationException",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"accessDenied",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"access_denied",envelope:"oauth_error",httpStatus:302,retryable:false},{wireCode:"anchor_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"anchor_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"anonTokenInvalid",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"attachment_unreadable",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"authExpired",envelope:"http_envelope",httpStatus:401,retryable:true},{wireCode:"authRejected",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"before_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"bundle_mismatch",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"bundle_not_uploaded",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"bundles_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"catalog_empty_refused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"catalog_shrink_refused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"consent_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"consent_required",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"consent_scope_wrong_route",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"device_cipher_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"email_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"endpoint_not_allowed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"environment_mismatch",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"event_cursor_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_id_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"event_payload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_type_not_available",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_type_unknown",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_required",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_reused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"inbox_cursor_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"insufficientCapability",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"insufficient_scope",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"internal_error",envelope:"sse_frame",httpStatus:200,retryable:false},{wireCode:"invalidRequest",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"invalid_client",envelope:"oauth_error",httpStatus:401,retryable:false},{wireCode:"invalid_client_metadata",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_grant",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_redirect_uri",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_request",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_scope",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_target",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"item_id_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"linked_account_read_only",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"mcp_connection_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"mcp_request_conflict",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"mcp_request_gone",envelope:"http_envelope",httpStatus:410,retryable:false},{wireCode:"mcp_request_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"not_found",envelope:"sse_frame",httpStatus:200,retryable:false},{wireCode:"not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"open_url_not_allowed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"partner_visit_link_conflict",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"partner_visit_owner_only",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"partner_visit_pet_already_mapped",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"payload_too_large",envelope:"http_envelope",httpStatus:413,retryable:false},{wireCode:"petRefInUse",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"pet_health_list_removals_unconfirmed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"pet_health_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"pet_not_registered",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"provider_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"rateLimited",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"read_target_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"record_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"record_subject_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"record_upload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"records_consent_required",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"restricted_key",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"sandbox_only",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"session_required",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"session_revoked",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"share_limit_reached",envelope:"http_envelope",httpStatus:429,retryable:false},{wireCode:"slow_down",envelope:"oauth_error",httpStatus:429,retryable:true},{wireCode:"species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"subscription_keys_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"tenant_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"tenant_has_no_capabilities",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"tenant_resource_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"tenant_surface_not_enabled",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"ticket_not_resolved",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"tickets_disabled",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"timeout",envelope:"sse_frame",httpStatus:200,retryable:true},{wireCode:"timezone_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"token_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"unavailable",envelope:"sse_frame",httpStatus:200,retryable:true},{wireCode:"unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"unrestrictedKeyRequired",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"unsupported_grant_type",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"unsupported_response_type",envelope:"oauth_error",httpStatus:302,retryable:false},{wireCode:"user_ref_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"verify_mint_rate_limited",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"verify_mint_refused",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"verify_mint_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"verify_user_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"web_push_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"webhook_endpoint_update_empty",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"webhook_endpoint_update_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false}],Me=/* @__PURE__ */Object.freeze(Ae.map(e=>/* @__PURE__ */Object.freeze(e)));/* @__PURE__ */Object.freeze(Me.map(e=>e.wireCode));var We=/* @__PURE__ */Object.freeze({ValidationException:"validationFailed",AuthorizationException:"authRejected",PaymentRequiredException:"paymentRequired",AccessDeniedException:"accessDenied",ResourceNotFoundException:"resourceNotFound",ConflictException:"conflict",ThrottlingException:"rateLimited",InternalFailureException:"internalError",NotImplementedException:"notImplemented",ServiceUnavailableException:"serviceUnavailable",MethodNotAllowedException:"validationFailed",authExpired:"authExpired",unavailable:"serviceUnavailable",session_required:"sessionRequired",session_revoked:"authExpired",anonTokenInvalid:"authRejected",accessDenied:"accessDenied",invalidRequest:"sdkUpdateRequired",authRejected:"authRejected",rateLimited:"rateLimited",insufficientCapability:"accessDenied",unrestrictedKeyRequired:"accessDenied",user_ref_invalid:"validationFailed",event_cursor_invalid:"validationFailed",event_filter_invalid:"validationFailed",event_payload_invalid:"validationFailed",event_type_unknown:"validationFailed",idempotency_key_invalid:"validationFailed",idempotency_key_required:"validationFailed",idempotency_key_reused:"idempotencyConflict",payload_too_large:"validationFailed",webhook_url_rejected:"validationFailed",webhook_endpoint_update_empty:"validationFailed",webhook_endpoint_update_invalid:"validationFailed",event_type_not_available:"conflict",record_subject_not_found:"resourceNotFound",records_consent_required:"conflict",record_species_unsupported:"validationFailed",record_upload_invalid:"validationFailed",FILE_TOO_LARGE:"validationFailed",INVALID_CONTENT_TYPE:"validationFailed",attachment_unreadable:"validationFailed",provider_unsupported:"validationFailed",token_invalid:"validationFailed",device_cipher_unavailable:"serviceUnavailable",email_invalid:"validationFailed",consent_required:"validationFailed",consent_invalid:"validationFailed",consent_scope_wrong_route:"validationFailed",IDEMPOTENCY_KEY_IN_FLIGHT:"idempotencyInFlight",IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST:"idempotencyConflict",DAILY_QUOTA_EXCEEDED:"quotaExceeded",TIER_UPGRADE_REQUIRED:"paymentRequired",not_found:"conversationNotFound",timeout:"streamTimeout",internal_error:"internalError",invalid_request:"validationFailed",invalid_client:"authRejected",invalid_grant:"authRejected",unsupported_grant_type:"validationFailed",invalid_scope:"validationFailed",invalid_target:"validationFailed",invalid_redirect_uri:"validationFailed",invalid_client_metadata:"validationFailed",unsupported_response_type:"validationFailed",access_denied:"accessDenied",slow_down:"rateLimited",mcp_request_not_found:"resourceNotFound",mcp_request_gone:"resourceNotFound",mcp_connection_not_found:"resourceNotFound",mcp_request_conflict:"conflict",sandbox_only:"accessDenied",tenant_has_no_capabilities:"conflict",verify_mint_refused:"accessDenied",verify_mint_rate_limited:"rateLimited",verify_mint_unavailable:"serviceUnavailable",verify_user_ref_invalid:"validationFailed",insufficient_scope:"accessDenied",tenant_filter_invalid:"validationFailed",tenant_resource_not_found:"resourceNotFound",tenant_surface_not_enabled:"conflict",pet_health_species_unsupported:"validationFailed",pet_health_list_removals_unconfirmed:"validationFailed",petRefInUse:"conflict",share_limit_reached:"conflict",pet_not_registered:"resourceNotFound",species_unsupported:"validationFailed",partner_visit_owner_only:"accessDenied",partner_visit_link_conflict:"conflict",partner_visit_pet_already_mapped:"conflict",linked_account_read_only:"conflict",catalog_empty_refused:"conflict",catalog_shrink_refused:"conflict",endpoint_not_allowed:"validationFailed",event_id_invalid:"validationFailed",inbox_cursor_invalid:"validationFailed",item_id_invalid:"validationFailed",open_url_not_allowed:"validationFailed",read_target_invalid:"validationFailed",subscription_keys_invalid:"validationFailed",web_push_unavailable:"serviceUnavailable",anchor_not_found:"resourceNotFound",anchor_ref_invalid:"validationFailed",before_invalid:"validationFailed",bundle_mismatch:"validationFailed",bundle_not_uploaded:"validationFailed",bundles_unavailable:"serviceUnavailable",environment_mismatch:"validationFailed",restricted_key:"accessDenied",ticket_not_resolved:"conflict",tickets_disabled:"resourceNotFound",timezone_invalid:"validationFailed"}),qe=/* @__PURE__ */Object.freeze(Me.map(e=>/* @__PURE__ */Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:We[e.wireCode]}))),Ue=new Map(qe.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),Ke=/* @__PURE__ */Object.freeze(["http_envelope",...[...new Set(qe.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function contractErrorFor(e,t){if(typeof e!="string")return;let i=e.trim().toUpperCase();if(i.length!==0)for(let e of[t??"http_envelope",...Ke]){let t=Ue.get(e+i);if(t)return t}}var Ve=/* @__PURE__ */Object.freeze({authExpired:"authentication",authRejected:"authentication",sessionRequired:"authentication",identitySignatureRequired:"authentication",accessDenied:"authorization",paymentRequired:"entitlement",quotaExceeded:"rateLimit",rateLimited:"rateLimit",validationFailed:"invalidRequest",sdkUpdateRequired:"invalidRequest",runtimeDisposed:"invalidRequest",conversationNotFound:"notFound",petNotFound:"notFound",resourceNotFound:"notFound",conflict:"conflict",idempotencyConflict:"conflict",idempotencyInFlight:"conflict",streamTimeout:"connection",streamIncomplete:"connection",upstreamLlmTimeout:"connection",serviceUnavailable:"connection",internalError:"server",notImplemented:"server",mediaUploadFailed:"media",moderationBlocked:"policy",unknown:"unknown"});function categoryFor(e){return Ve[e]}function fromWire(e){let t=contractErrorFor(e);if(t)return t.normalized;let i=(e??"").trim().toUpperCase(),r=i.replace(/[^A-Z0-9]/g,"");if(r==="AUTHREJECTED")return"authRejected";if(i.startsWith("AUTH"))return"authExpired";switch(r){case"DAILYQUOTAEXCEEDED":case"QUOTAEXCEEDED":return"quotaExceeded";case"RATELIMITED":case"TOOMANYREQUESTS":case"TELEVETRATELIMITED":return"rateLimited";case"IDEMPOTENCYKEYCONFLICT":case"IDEMPOTENCYCONFLICT":return"idempotencyConflict";case"ACCESSDENIED":case"FORBIDDEN":return"accessDenied";case"IDENTITYSIGNATUREREQUIRED":return"identitySignatureRequired";case"FREECAPREACHED":return"paymentRequired";case"RUNTIMEDISPOSED":return"runtimeDisposed";case"NOTFOUND":case"CONVERSATIONNOTFOUND":return"conversationNotFound";case"PETNOTFOUND":return"petNotFound";case"TIMEOUT":case"STREAMTIMEOUT":return"streamTimeout";case"MEDIAUPLOADFAILED":case"UNRECOGNIZEDVIDEOFORMAT":case"FILETOOSMALL":return"mediaUploadFailed";case"MODERATIONBLOCKED":return"moderationBlocked";case"UPSTREAMLLMTIMEOUT":return"upstreamLlmTimeout";case"INTERNALERROR":case"INTERNALSERVERERROR":return"internalError";case"STREAMINCOMPLETE":case"CHATSTREAMINCOMPLETE":return"streamIncomplete";case"INVALIDANALYSISTYPE":case"INVALIDUPLOADPURPOSE":return"unknown";default:return"unknown"}}var Ge=/* @__PURE__ */new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function isAutoRetryable(e){return Ge.has(e)}var Ye=/* @__PURE__ */new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function isRetryableCode(e){return isAutoRetryable(e)||Ye.has(e)}var Xe=500,Qe=8e3,Ze=4;function backoffDelayMs(e,t=Math.random){let i=Math.max(0,e),r=Math.min(Xe*2**i,Qe);return Math.floor(t()*r)}var Je="This feature isn't available on your account right now.",et="Something in that request was not right. Check the details and try again.",tt=/* @__PURE__ */Object.freeze({authExpired:"Please sign in again to continue.",authRejected:"Please sign in again to continue.",sessionRequired:"This app needs to be updated to keep using Everfur.",accessDenied:Je,paymentRequired:"This is part of a paid plan.",quotaExceeded:"You have used today's messages. This resets tomorrow.",rateLimited:"You are sending messages quickly. Try again in a few seconds.",validationFailed:et,sdkUpdateRequired:"This app needs to be updated to keep using Everfur.",conflict:"That is already running. Wait for it to finish, then try again.",idempotencyConflict:"That message was already delivered.",idempotencyInFlight:"That is still processing. Give it a moment.",conversationNotFound:"This conversation is no longer available.",petNotFound:"We could not find that pet. Please pick a pet and try again.",resourceNotFound:"We could not find that.",streamTimeout:"The response timed out. Tap retry to try again.",mediaUploadFailed:"We could not upload that photo. Please attach it again.",moderationBlocked:"This request cannot be answered here.",upstreamLlmTimeout:"The response timed out. Tap retry to try again.",internalError:"We hit a snag on our end. Please try again.",notImplemented:"That is not available yet.",serviceUnavailable:"That service is briefly unavailable. Try again shortly.",streamIncomplete:"The connection dropped mid-answer. Tap retry to continue.",identitySignatureRequired:Je,runtimeDisposed:et,unknown:"Something went wrong. Please try again."}),it="This session has ended. Please sign in again.",rt="linked_account_read_only";function nt(e,t,i){return e==="conflict"&&i===rt?Je:(e==="authRejected"||e==="authExpired")&&typeof t=="string"&&t.trim().toLowerCase()==="session_revoked"?it:userFacingError(e)}function userFacingError(e){return tt[e]}function ot(e,t,i){Object.defineProperty(e,t,{value:i,enumerable:false,writable:false,configurable:false})}var at=/^[a-z][a-z0-9_]{0,63}$/;function makeEverfurError(e,t){let i=contractErrorFor(t?.wireCode,t?.wireEnvelope),r=e==="conflict"&&t?.reasonCode===rt,n={code:e,category:categoryFor(e),retryable:t?.retryable??(r?false:isRetryableCode(e)),displayMessage:nt(e,t?.wireCode,r?rt:null)};t?.httpStatus!==void 0&&(n.httpStatus=t.httpStatus),t?.requestId&&(n.requestId=t.requestId),typeof t?.reasonCode=="string"&&at.test(t.reasonCode)&&(n.reasonCode=t.reasonCode);let o=t?.retryAfterSeconds;if(typeof o=="number"&&Number.isFinite(o)&&o>=0&&(n.retryAfterSeconds=Math.round(o)),i);return t?.wireMessage&&ot(n,"wireMessage",t.wireMessage),t?.raw!==void 0&&t.raw!==null&&ot(n,"raw",t.raw),/* @__PURE__ */Object.freeze(n)}function assertNever(e){throw new Error(`assertNever: unhandled discriminated-union member ${JSON.stringify(e)}`)}function errorFrame(e){/* @__PURE__ */
6
- return Object.freeze({kind:"error",terminal:true,code:e.code,retryable:e.retryable,wireMessage:e.wireMessage,synthesized:e.synthesized,lastEventId:e.lastEventId,serverRequestId:null,...e.freeCap?{freeCap:/* @__PURE__ */Object.freeze({...e.freeCap})}:{}})}var st="x-everfur-anon-token",lt="anonTokenInvalid";async function ut(e){if(e.userRef!==null||e.anonIdentity===void 0)return null;try{return await e.anonIdentity.token()}catch{return null}}function ct(e,t){let i=e instanceof Error?e.message:typeof e=="string"?e:null;return makeEverfurError("authRejected",{retryable:false,...t?.wireCode?{wireCode:t.wireCode}:{},...t?.requestId?{requestId:t.requestId}:{},...i?{wireMessage:i}:{},...e!=null?{raw:e}:{}})}function authHeaders(e){let t={};return e.mode==="personalized"?t.authorization=`Bearer ${e.token}`:(t["x-everfur-partner-key"]=e.publishableKey,e.anonToken&&(t[st]=e.anonToken)),e.userRef&&(t["x-everfur-user-ref"]=e.userRef),e.sessionId&&(t["x-everfur-session-id"]=e.sessionId),t}function withAuthHeaders(e,t){return{...e,headers:{...dt(e.headers),...authHeaders(t)}}}function dt(e){if(!e)return{};let t={};for(let[i,r]of Object.entries(e)){let e=i.toLowerCase();e==="authorization"||e==="x-everfur-partner-key"||e===st||(t[i]=r)}return t}async function authedSend(e,t){if(t.mode==="anonymous"){let i=await ut(t),r=await t.transport.request(withAuthHeaders(e,pt(t,i)));if(r.ok||mt(r.error.raw)!==lt||t.anonIdentity===void 0||t.userRef!==null)return r;let n=await t.anonIdentity.token({forceRefresh:true});return n===null||n===i?r:t.transport.request(withAuthHeaders(e,pt(t,n)))}let i;try{i=await t.identity.currentToken()}catch(e){return t.identity.reportRejected?.(),err(ct(e))}let r=await t.transport.request(withAuthHeaders(e,{mode:"personalized",token:i,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));if(r.ok||r.error.httpStatus!==401)return r;let n;try{n=await t.identity.currentToken({forceRefresh:!0})}catch(e){return t.identity.reportRejected?.(),err(ct(e,{wireCode:mt(r.error.raw),requestId:r.error.requestId}))}let o=await t.transport.request(withAuthHeaders(e,{mode:"personalized",token:n,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));return!o.ok&&o.error.httpStatus===401?(t.identity.reportRejected?.(),err(ft(o.error))):o}function pt(e,t){return{mode:"anonymous",publishableKey:e.publishableKey,userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{},...t!==null?{anonToken:t}:{}}}function ft(e){let t=e.raw,i=mt(t);return makeEverfurError("authRejected",{retryable:false,...e.httpStatus!==void 0?{httpStatus:e.httpStatus}:{},...e.requestId?{requestId:e.requestId}:{},...i?{wireCode:i}:{},...e.reasonCode?{reasonCode:e.reasonCode}:{},...e.wireMessage?{wireMessage:e.wireMessage}:{},...t!=null?{raw:t}:{}})}function mt(e){if(typeof e!="object"||e===null)return null;let t=e,i=(typeof t.error=="object"&&t.error!==null?t.error.code:void 0)??t.code;return typeof i=="string"&&i.length>0?i:null}function ht(e,t){let i=globalThis.URL;if(typeof i=="function"){let r;try{r=t===void 0?new i(e):new i(e,t)}catch{return null}try{if(r.protocol)return r}catch{}}return xt(e)}var gt=/^([a-z][a-z0-9+.-]*):\/\/(?:([^:@/?#]*)(?::([^@/?#]*))?@)?(\[[0-9a-f:.]+\]|[\w.~-]+)(?::(\d*))?(\/[^?#]*)?(\?[^#]*)?(#.*)?$/i,bt=/[\s\u0000-\u001f\u007f\\]/,vt={"http:":"80","https:":"443"};function xt(e,t){let i=e.trim();let r=bt.test(i)?null:gt.exec(i);if(r===null)return null;let[,n="",o="",a="",s="",l="",u="",c="",d=""]=r,p=`${n.toLowerCase()}:`,f=Number(l);if(f>65535)return null;let m=l===""||String(f)===vt[p]?"":String(f),h=vt[p]!==void 0,g=s.toLowerCase()+(m&&`:${m}`),b=u||(h?"/":""),v=o||a?`${o}${a&&`:${a}`}@`:"";return{href:`${p}//${v}${g}${b}${c}${d}`,protocol:p,username:o,password:a,hostname:s.toLowerCase(),port:m,origin:h?`${p}//${g}`:"null",pathname:b,search:c==="?"?"":c,hash:d==="#"?"":d}}var yt="1.5.1";function networkError(e){return makeEverfurError("internalError",{retryable:true,wireMessage:wt(e)})}function wt(e){return e instanceof Error?e.message:typeof e=="string"?e:"network request failed"}var kt=3e4,_t=Qe*2,jt="idempotency-key",zt=/* @__PURE__ */new Set(["POST","PUT","PATCH","DELETE"]),Ct=/* @__PURE__ */Object.freeze({onEvent(){}}),St=/* @__PURE__ */Object.freeze({setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),now:()=>Date.now()});function Pt(e){let t=e.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return t.length===0?null:`efs_${t}`.slice(0,128)}function createRequestFunnel(e){let t=e.observer??Ct,i=e.timers??St,r=e.rng??Math.random,n=e.sleep??((e,t)=>qt(e,i,t)),o=e.maxAttempts??Ze,a=e.unaryTimeoutMs??kt,s=e.newIdempotencyKey??Ft(),l=e=>{try{t.onEvent(e)}catch{}};async function u(t,u,c){let d=c?.maxAttempts,p=Math.max(1,d??o),f=c?.idempotent??zt.has(u.method),m=c?.idempotencyKey===void 0?null:Pt(c.idempotencyKey),h=f?m??s():null,g=Tt(u,h),b=0;for(;;){let o=e=>/* @__PURE__ */Object.freeze({call:t,method:u.method,path:u.path,attempt:b,...h?{idempotencyKey:h}:{},...e});l(o({phase:"attempt"}));let s=Mt(a,i),c=Wt(s.signal,u.signal),f;try{f=await authedSend({...g,signal:c.signal},e.auth)}catch(e){f=err(networkError(e))}finally{c.dispose(),s.cancel()}if(f.ok)return l(o({phase:"settled",ok:true,reason:"ok"})),f;let m=f.error,v=Ot(m,b,{maxAttempts:p,rng:r,now:i.now(),aborted:u.signal?.aborted===true,...d!==void 0?{perCallMaxAttempts:d}:{},...e.errorPolicy!==void 0?{policy:e.errorPolicy}:{}}),x={ok:false,code:m.code,reason:v.reason,...m.httpStatus!==void 0?{httpStatus:m.httpStatus}:{},...m.requestId!==void 0?{requestId:m.requestId}:{}};if(!v.retry)return l(o({phase:"settled",...x})),err(m);if(l(o({phase:"retry",...x,delayMs:v.delayMs})),await n(v.delayMs,u.signal),u.signal?.aborted===true)return l(o({phase:"settled",...x,reason:"aborted"})),err(m);b+=1}}async function c(t){return withAuthHeaders(t,await At(e.auth))}async function*d(t,i,r){l(
6
+ return Object.freeze({kind:"error",terminal:true,code:e.code,retryable:e.retryable,wireMessage:e.wireMessage,synthesized:e.synthesized,lastEventId:e.lastEventId,serverRequestId:null,...e.freeCap?{freeCap:/* @__PURE__ */Object.freeze({...e.freeCap})}:{}})}var st="x-everfur-anon-token",lt="anonTokenInvalid";async function ut(e){if(e.userRef!==null||e.anonIdentity===void 0)return null;try{return await e.anonIdentity.token()}catch{return null}}function ct(e,t){let i=e instanceof Error?e.message:typeof e=="string"?e:null;return makeEverfurError("authRejected",{retryable:false,...t?.wireCode?{wireCode:t.wireCode}:{},...t?.requestId?{requestId:t.requestId}:{},...i?{wireMessage:i}:{},...e!=null?{raw:e}:{}})}function authHeaders(e){let t={};return e.mode==="personalized"?t.authorization=`Bearer ${e.token}`:(t["x-everfur-partner-key"]=e.publishableKey,e.anonToken&&(t[st]=e.anonToken)),e.userRef&&(t["x-everfur-user-ref"]=e.userRef),e.sessionId&&(t["x-everfur-session-id"]=e.sessionId),t}function withAuthHeaders(e,t){return{...e,headers:{...dt(e.headers),...authHeaders(t)}}}function dt(e){if(!e)return{};let t={};for(let[i,r]of Object.entries(e)){let e=i.toLowerCase();e==="authorization"||e==="x-everfur-partner-key"||e===st||(t[i]=r)}return t}async function authedSend(e,t){if(t.mode==="anonymous"){let i=await ut(t),r=await t.transport.request(withAuthHeaders(e,pt(t,i)));if(r.ok||mt(r.error.raw)!==lt||t.anonIdentity===void 0||t.userRef!==null)return r;let n=await t.anonIdentity.token({forceRefresh:true});return n===null||n===i?r:t.transport.request(withAuthHeaders(e,pt(t,n)))}let i;try{i=await t.identity.currentToken()}catch(e){return t.identity.reportRejected?.(),err(ct(e))}let r=await t.transport.request(withAuthHeaders(e,{mode:"personalized",token:i,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));if(r.ok||r.error.httpStatus!==401)return r;let n;try{n=await t.identity.currentToken({forceRefresh:!0})}catch(e){return t.identity.reportRejected?.(),err(ct(e,{wireCode:mt(r.error.raw),requestId:r.error.requestId}))}let o=await t.transport.request(withAuthHeaders(e,{mode:"personalized",token:n,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));return!o.ok&&o.error.httpStatus===401?(t.identity.reportRejected?.(),err(ft(o.error))):o}function pt(e,t){return{mode:"anonymous",publishableKey:e.publishableKey,userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{},...t!==null?{anonToken:t}:{}}}function ft(e){let t=e.raw,i=mt(t);return makeEverfurError("authRejected",{retryable:false,...e.httpStatus!==void 0?{httpStatus:e.httpStatus}:{},...e.requestId?{requestId:e.requestId}:{},...i?{wireCode:i}:{},...e.reasonCode?{reasonCode:e.reasonCode}:{},...e.wireMessage?{wireMessage:e.wireMessage}:{},...t!=null?{raw:t}:{}})}function mt(e){if(typeof e!="object"||e===null)return null;let t=e,i=(typeof t.error=="object"&&t.error!==null?t.error.code:void 0)??t.code;return typeof i=="string"&&i.length>0?i:null}function ht(e,t){let i=globalThis.URL;if(typeof i=="function"){let r;try{r=t===void 0?new i(e):new i(e,t)}catch{return null}try{if(r.protocol)return r}catch{}}return xt(e)}var gt=/^([a-z][a-z0-9+.-]*):\/\/(?:([^:@/?#]*)(?::([^@/?#]*))?@)?(\[[0-9a-f:.]+\]|[\w.~-]+)(?::(\d*))?(\/[^?#]*)?(\?[^#]*)?(#.*)?$/i,bt=/[\s\u0000-\u001f\u007f\\]/,vt={"http:":"80","https:":"443"};function xt(e,t){let i=e.trim();let r=bt.test(i)?null:gt.exec(i);if(r===null)return null;let[,n="",o="",a="",s="",l="",u="",c="",d=""]=r,p=`${n.toLowerCase()}:`,f=Number(l);if(f>65535)return null;let m=l===""||String(f)===vt[p]?"":String(f),h=vt[p]!==void 0,g=s.toLowerCase()+(m&&`:${m}`),b=u||(h?"/":""),v=o||a?`${o}${a&&`:${a}`}@`:"";return{href:`${p}//${v}${g}${b}${c}${d}`,protocol:p,username:o,password:a,hostname:s.toLowerCase(),port:m,origin:h?`${p}//${g}`:"null",pathname:b,search:c==="?"?"":c,hash:d==="#"?"":d}}var yt="1.5.2";function networkError(e){return makeEverfurError("internalError",{retryable:true,wireMessage:wt(e)})}function wt(e){return e instanceof Error?e.message:typeof e=="string"?e:"network request failed"}var kt=3e4,_t=Qe*2,jt="idempotency-key",zt=/* @__PURE__ */new Set(["POST","PUT","PATCH","DELETE"]),Ct=/* @__PURE__ */Object.freeze({onEvent(){}}),St=/* @__PURE__ */Object.freeze({setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),now:()=>Date.now()});function Pt(e){let t=e.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return t.length===0?null:`efs_${t}`.slice(0,128)}function createRequestFunnel(e){let t=e.observer??Ct,i=e.timers??St,r=e.rng??Math.random,n=e.sleep??((e,t)=>qt(e,i,t)),o=e.maxAttempts??Ze,a=e.unaryTimeoutMs??kt,s=e.newIdempotencyKey??Ft(),l=e=>{try{t.onEvent(e)}catch{}};async function u(t,u,c){let d=c?.maxAttempts,p=Math.max(1,d??o),f=c?.idempotent??zt.has(u.method),m=c?.idempotencyKey===void 0?null:Pt(c.idempotencyKey),h=f?m??s():null,g=Tt(u,h),b=0;for(;;){let o=e=>/* @__PURE__ */Object.freeze({call:t,method:u.method,path:u.path,attempt:b,...h?{idempotencyKey:h}:{},...e});l(o({phase:"attempt"}));let s=Mt(a,i),c=Wt(s.signal,u.signal),f;try{f=await authedSend({...g,signal:c.signal},e.auth)}catch(e){f=err(networkError(e))}finally{c.dispose(),s.cancel()}if(f.ok)return l(o({phase:"settled",ok:true,reason:"ok"})),f;let m=f.error,v=Ot(m,b,{maxAttempts:p,rng:r,now:i.now(),aborted:u.signal?.aborted===true,...d!==void 0?{perCallMaxAttempts:d}:{},...e.errorPolicy!==void 0?{policy:e.errorPolicy}:{}}),x={ok:false,code:m.code,reason:v.reason,...m.httpStatus!==void 0?{httpStatus:m.httpStatus}:{},...m.requestId!==void 0?{requestId:m.requestId}:{}};if(!v.retry)return l(o({phase:"settled",...x})),err(m);if(l(o({phase:"retry",...x,delayMs:v.delayMs})),await n(v.delayMs,u.signal),u.signal?.aborted===true)return l(o({phase:"settled",...x,reason:"aborted"})),err(m);b+=1}}async function c(t){return withAuthHeaders(t,await At(e.auth))}async function*d(t,i,r){l(
7
7
  /* @__PURE__ */Object.freeze({call:t,phase:"stream.open",method:i.method,path:i.path,attempt:0}));try{yield*e.auth.transport.stream(i,r)}catch{yield errorFrame({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null})}}/* @__PURE__ */
8
8
  return Object.freeze({send:u,authorize:c,stream:d})}function Tt(e,t){let i={};for(let[t,r]of Object.entries(e.headers??{}))t.toLowerCase()!==jt&&(i[t]=r);return t!==null&&(i["Idempotency-Key"]=t),{...e,headers:i}}function Ft(){let e=0;return()=>`efk_${Date.now().toString(36)}_${(e++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}var $t=10;function Ot(e,t,i){if(i.aborted)return{retry:false,reason:"aborted"};let r=Et(e);if(r==="quota")return{retry:false,reason:"daily-quota-exhausted"};if(r!=="burst"&&!isAutoRetryable(e.code))return{retry:false,reason:"terminal-code"};let n=r==="burst"?"burst-throttle":"retryable-code";if((()=>{if(i.policy===void 0)return false;try{return!i.policy.shouldRetry(e.code,t)}catch{return false}})())return{retry:false,reason:"terminal-code"};let o=()=>{if(i.policy===void 0)return null;let t;try{t=i.policy.maxAttempts(e.code)}catch{return null}return typeof t!="number"||!Number.isFinite(t)?null:Math.max(1,Math.min($t,Math.floor(t)))},a=i.perCallMaxAttempts??o()??i.maxAttempts;if(t+1>=a)return{retry:false,reason:"attempts-exhausted"};let s=It(e,i.now);return s!==null?s>_t?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:n,delayMs:s}:{retry:true,reason:n,delayMs:backoffDelayMs(t,i.rng)}}function Et(e){let t=e.code==="unknown"?fromWire(Nt(e.raw)):e.code;return t==="quotaExceeded"?"quota":t==="rateLimited"||e.httpStatus===429?"burst":null}function It(e,t){let i=Ht(e.raw);if(i!==null){let e=i-t;return e>0?e:0}let r=Lt(e.raw);return r===null?null:Math.round(r*1e3)}function Lt(e){for(let t of Rt(e)){let e=t.retry_after_seconds;if(typeof e=="number"&&Number.isFinite(e)&&e>=0)return e}return null}function Ht(e){for(let t of Rt(e)){let e=t.resets_at,i=Dt(e);if(i!==null)return i}return null}function Rt(e){if(!Bt(e))return[];let t=[e];for(let i of["error","detail"]){let r=e[i];Bt(r)&&t.push(r)}return t}function Dt(e){if(typeof e=="number"&&Number.isFinite(e))return e<1e11?Math.round(e*1e3):Math.round(e);if(typeof e=="string"&&e.trim().length>0){let t=Date.parse(e);return Number.isFinite(t)?t:null}return null}function Nt(e){for(let t of Rt(e)){let e=t.code;if(typeof e=="string"&&e.length>0)return e}return null}function Bt(e){return typeof e=="object"&&e!==null}async function At(e){if(e.mode==="anonymous"){let t=await ut(e);return{mode:"anonymous",publishableKey:e.publishableKey,userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{},...t!==null?{anonToken:t}:{}}}return{mode:"personalized",token:await e.identity.currentToken(),userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{}}}function Mt(e,t){let i=new AbortController,r=t.setTimeout(()=>i.abort(),e);return{signal:i.signal,cancel:()=>t.clearTimeout(r)}}function Wt(e,t){let i=()=>{};if(!t)return{signal:e,dispose:i};let r=new AbortController;if(e.aborted||t.aborted)return r.abort(),{signal:r.signal,dispose:i};let n=()=>r.abort();return e.addEventListener("abort",n,{once:true}),t.addEventListener("abort",n,{once:true}),{signal:r.signal,dispose:()=>{e.removeEventListener("abort",n),t.removeEventListener("abort",n)}}}function qt(e,t,i){return e<=0||i?.aborted===true?Promise.resolve():new Promise(r=>{let n=t.setTimeout(()=>{i?.removeEventListener("abort",o),r()},e),o=()=>{t.clearTimeout(n),r()};i?.addEventListener("abort",o,{once:true})})}function Ut(e){return e!=null&&(e.httpStatus===404||e.category==="notFound")}function Kt(e){return e.code!=="conversationNotFound"?e:makeEverfurError("resourceNotFound",{retryable:false,...e.httpStatus===void 0?{}:{httpStatus:e.httpStatus},...e.requestId===void 0?{}:{requestId:e.requestId},...e.reasonCode===void 0?{}:{reasonCode:e.reasonCode},...e.wireMessage===void 0?{}:{wireMessage:e.wireMessage},...e.raw===void 0?{}:{raw:e.raw}})}function Vt(e){return e.ok?e:err(Kt(e.error))}function Gt(e){return{send:async(...t)=>Vt(await e.send(...t)),authorize:t=>e.authorize(t),stream:(t,i,r)=>e.stream(t,i,r)}}var Yt=/* @__PURE__ */Object.freeze(["dna","records","inside","profile"]),Xt=128;function Qt(e){return makeEverfurError("validationFailed",{retryable:false,wireMessage:e})}function Zt(e){return makeEverfurError("runtimeDisposed",{retryable:false,wireMessage:`the Everfur runtime is disposed; ${e} was called after unmount`})}function Jt(e){return makeEverfurError("internalError",{retryable:false,httpStatus:502,wireMessage:`${e}: the response carried no plan`})}var ei=(e,t=4e3)=>typeof e=="string"&&e.trim().length>0&&e.length<=t?e.trim():null;function ti(e){let t=ei(e,2048);return t===null?null:/^https:\/\/[^\s]+$/i.test(t)?t:null}function ii(e){let t=typeof e=="number"?e:typeof e=="string"&&/^\d+(\.\d+)?$/.test(e.trim())?Number(e):Number.NaN;return Number.isFinite(t)&&t>=0?t:null}function ri(e){return typeof e=="string"&&/^[A-Za-z]{3}$/.test(e)?e.toUpperCase():null}function ni(e){if(!Array.isArray(e))/* @__PURE__ */return Object.freeze([]);let t=[];for(let i of e){if(i===null||typeof i!="object")continue;let e=i,r=ei(e.text,1e3);if(r===null)continue;let n=typeof e.kind=="string"&&Yt.includes(e.kind)?e.kind:"profile";t.push(/* @__PURE__ */Object.freeze({kind:n,text:r}))}/* @__PURE__ */
9
9
  return Object.freeze(t)}var oi=6;function ai(e){return typeof e=="number"&&Number.isFinite(e)&&e>=0&&e<=400?e:null}function si(e,t,i){if(!Array.isArray(e))/* @__PURE__ */return Object.freeze([]);let r=[];for(let n of e){if(r.length>=i)break;if(n===null||typeof n!="object"||Array.isArray(n))continue;let e=t(n);e!==null&&r.push(e)}/* @__PURE__ */