@everfur/sdk 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/dist/{Chat-BOX-03ho.d.ts → Chat-Rzplrf5M.d.ts} +3 -3
  3. package/dist/{Chat-TA-aTcVF.d.cts → Chat-ypo6miKm.d.cts} +3 -3
  4. package/dist/{DepthViews-D2dRqWRq.d.ts → DepthViews-CeTfPUBX.d.ts} +1 -1
  5. package/dist/{DepthViews-DSFyaSeL.d.cts → DepthViews-ClykXOJj.d.cts} +1 -1
  6. package/dist/{DepthViews-Cviea-ri.d.cts → DepthViews-Cui3oonj.d.cts} +1 -1
  7. package/dist/{DepthViews-CgjX2AJ5.d.ts → DepthViews-baYLMNQ-.d.ts} +1 -1
  8. package/dist/animations/index.cjs +1 -1
  9. package/dist/animations/index.d.cts +3 -3
  10. package/dist/animations/index.d.ts +3 -3
  11. package/dist/animations/index.js +1 -1
  12. package/dist/{attachments-DHvnITuE.d.cts → attachments-CwsR-bPN.d.cts} +5 -5
  13. package/dist/{attachments-C_vtFu2f.d.ts → attachments-CzZ7in24.d.ts} +5 -5
  14. package/dist/{attachments-oD5U2fXI.d.ts → attachments-D3HCBmOE.d.ts} +2 -2
  15. package/dist/{attachments-pIdGOQfm.d.cts → attachments-Nk73Lll8.d.cts} +2 -2
  16. package/dist/{bookingCopy-DfuA13dh.d.cts → bookingCopy-Dv8rKqyV.d.cts} +2 -2
  17. package/dist/{bookingCopy-CJir9mjb.d.ts → bookingCopy-SDkXaxDf.d.ts} +2 -2
  18. package/dist/{casesRepository-DHgIYKN9.d.ts → casesRepository-BTAecTnF.d.ts} +1 -1
  19. package/dist/{casesRepository-B-Eg8ZJ3.d.cts → casesRepository-aryld7fJ.d.cts} +1 -1
  20. package/dist/chat/index.cjs +1 -1
  21. package/dist/chat/index.d.cts +9 -9
  22. package/dist/chat/index.d.ts +9 -9
  23. package/dist/chat/index.js +1 -1
  24. package/dist/client/index.cjs +5 -5
  25. package/dist/client/index.d.cts +6 -6
  26. package/dist/client/index.d.ts +6 -6
  27. package/dist/client/index.js +5 -5
  28. package/dist/{config-DAFbf721.d.cts → config-6qS7Sohy.d.cts} +1 -1
  29. package/dist/{config-ClI7QxB0.d.ts → config-X6BtwDwQ.d.ts} +1 -1
  30. package/dist/consent/index.cjs +1 -1
  31. package/dist/consent/index.d.cts +5 -5
  32. package/dist/consent/index.d.ts +5 -5
  33. package/dist/consent/index.js +1 -1
  34. package/dist/{context-CZbgF_OH.d.ts → context-7f3Nb_xE.d.ts} +5 -5
  35. package/dist/{context-B-dUM1Qf.d.cts → context-CkqPM4Ml.d.cts} +5 -5
  36. package/dist/{copy-CneuYdrO.d.cts → copy-Bd__Pw5s.d.cts} +2 -2
  37. package/dist/{copy-CeRH3NXy.d.ts → copy-NgKgOOET.d.ts} +2 -2
  38. package/dist/core/index.cjs +7 -7
  39. package/dist/core/index.d.cts +12 -12
  40. package/dist/core/index.d.ts +12 -12
  41. package/dist/core/index.js +7 -7
  42. package/dist/{depth-DO3Ko_qs.d.ts → depth-CYPH92jE.d.ts} +2 -2
  43. package/dist/{depth-B3NFKlF9.d.cts → depth-CyjaJJ6V.d.cts} +2 -2
  44. package/dist/{entitlementRepository-74kW5mK0.d.ts → entitlementRepository-DdeFuEKp.d.ts} +2 -2
  45. package/dist/{entitlementRepository-m6zLUmiB.d.cts → entitlementRepository-Dl1qRLcJ.d.cts} +2 -2
  46. package/dist/{identity-C7uxGwfT.d.cts → identity-DjqhDm5Z.d.cts} +1 -1
  47. package/dist/{identity-CLAUq-K4.d.ts → identity-Dy_L7Yq4.d.ts} +1 -1
  48. package/dist/index.cjs +6 -6
  49. package/dist/index.d.cts +12 -12
  50. package/dist/index.d.ts +12 -12
  51. package/dist/index.js +6 -6
  52. package/dist/notifications/index.cjs +2 -2
  53. package/dist/notifications/index.d.cts +2 -2
  54. package/dist/notifications/index.d.ts +2 -2
  55. package/dist/notifications/index.js +2 -2
  56. package/dist/{pets-BoB5B7kp.d.cts → pets-BSG2qbr_.d.cts} +1 -1
  57. package/dist/{pets-w4M9d-Dn.d.ts → pets-D7cZutrX.d.ts} +1 -1
  58. package/dist/{petsRepository-DZZoEG3r.d.cts → petsRepository-D1bnxDZg.d.cts} +1 -1
  59. package/dist/{petsRepository-BjKJ8UsN.d.ts → petsRepository-DhsX3GLw.d.ts} +1 -1
  60. package/dist/photo/index.cjs +1 -1
  61. package/dist/photo/index.js +1 -1
  62. package/dist/{ports-BO3bzTJg.d.ts → ports-C0m1G1fS.d.ts} +4 -4
  63. package/dist/{ports-C2EVK416.d.cts → ports-DNXyyzZF.d.cts} +4 -4
  64. package/dist/records/depth/index.cjs +2 -2
  65. package/dist/records/depth/index.d.cts +7 -7
  66. package/dist/records/depth/index.d.ts +7 -7
  67. package/dist/records/depth/index.js +2 -2
  68. package/dist/records/index.cjs +3 -3
  69. package/dist/records/index.d.cts +9 -9
  70. package/dist/records/index.d.ts +9 -9
  71. package/dist/records/index.js +3 -3
  72. package/dist/{requestFunnel-Djjwgoe9.d.cts → requestFunnel-Bqc1inM9.d.cts} +2 -2
  73. package/dist/{requestFunnel-D7ipek3e.d.ts → requestFunnel-FvE5yLDD.d.ts} +2 -2
  74. package/dist/{runtimeTypes-CTL3yToK.d.ts → runtimeTypes-C0yPBz89.d.ts} +4 -4
  75. package/dist/{runtimeTypes-D2C9uD85.d.cts → runtimeTypes-RN-VXTFV.d.cts} +4 -4
  76. package/dist/server/events/index.cjs +1 -1
  77. package/dist/server/events/index.d.cts +2 -2
  78. package/dist/server/events/index.d.ts +2 -2
  79. package/dist/server/events/index.js +1 -1
  80. package/dist/server/index.cjs +1 -1
  81. package/dist/server/index.d.cts +3 -3
  82. package/dist/server/index.d.ts +3 -3
  83. package/dist/server/index.js +1 -1
  84. package/dist/televet/booking/index.cjs +1 -1
  85. package/dist/televet/booking/index.d.cts +20 -14
  86. package/dist/televet/booking/index.d.ts +20 -14
  87. package/dist/televet/booking/index.js +1 -1
  88. package/dist/televet/index.cjs +1 -1
  89. package/dist/televet/index.js +1 -1
  90. package/dist/testing/index.cjs +3 -3
  91. package/dist/testing/index.d.cts +1 -1
  92. package/dist/testing/index.d.ts +1 -1
  93. package/dist/testing/index.js +3 -3
  94. package/dist/testing/rn/index.cjs +1 -1
  95. package/dist/testing/rn/index.d.cts +7 -7
  96. package/dist/testing/rn/index.d.ts +7 -7
  97. package/dist/testing/rn/index.js +1 -1
  98. package/dist/testing/web/index.cjs +1 -1
  99. package/dist/testing/web/index.d.cts +7 -7
  100. package/dist/testing/web/index.d.ts +7 -7
  101. package/dist/testing/web/index.js +1 -1
  102. package/dist/{timelineRows-7yFNK_rU.d.ts → timelineRows-D4U6A8zE.d.ts} +1 -1
  103. package/dist/{timelineRows-CzR1T2DR.d.cts → timelineRows-DAB5dpjF.d.cts} +1 -1
  104. package/dist/{useRecordsDepth-DFF7Faxx.d.ts → useRecordsDepth--ObtMyjH.d.ts} +1 -1
  105. package/dist/{useRecordsDepth-Bnw36jPr.d.cts → useRecordsDepth-B35y8bV-.d.cts} +1 -1
  106. package/dist/video/index.cjs +1 -1
  107. package/dist/video/index.js +1 -1
  108. package/dist/{view-CaJs8WFH.d.cts → view-B-Toym_j.d.cts} +2 -2
  109. package/dist/{view-BqcOYFTr.d.ts → view-D9JqNQai.d.ts} +2 -2
  110. package/dist/web/consent/index.cjs +1 -1
  111. package/dist/web/consent/index.d.cts +5 -5
  112. package/dist/web/consent/index.d.ts +5 -5
  113. package/dist/web/consent/index.js +1 -1
  114. package/dist/web/index.cjs +7 -7
  115. package/dist/web/index.d.cts +14 -14
  116. package/dist/web/index.d.ts +14 -14
  117. package/dist/web/index.js +7 -7
  118. package/dist/web/notifications/index.cjs +2 -2
  119. package/dist/web/notifications/index.d.cts +3 -3
  120. package/dist/web/notifications/index.d.ts +3 -3
  121. package/dist/web/notifications/index.js +2 -2
  122. package/dist/web/records/depth/index.cjs +2 -2
  123. package/dist/web/records/depth/index.d.cts +7 -7
  124. package/dist/web/records/depth/index.d.ts +7 -7
  125. package/dist/web/records/depth/index.js +2 -2
  126. package/dist/web/records/index.cjs +3 -3
  127. package/dist/web/records/index.d.cts +9 -9
  128. package/dist/web/records/index.d.ts +9 -9
  129. package/dist/web/records/index.js +3 -3
  130. package/dist/web/televet/booking/index.cjs +2 -2
  131. package/dist/web/televet/booking/index.d.cts +12 -8
  132. package/dist/web/televet/booking/index.d.ts +12 -8
  133. package/dist/web/televet/booking/index.js +2 -2
  134. package/dist/web/televet/call/index.cjs +1 -1
  135. package/dist/web/televet/call/index.js +1 -1
  136. package/dist/web/televet/index.cjs +1 -1
  137. package/dist/web/televet/index.js +1 -1
  138. package/package.json +1 -1
@@ -1 +1 @@
1
- 'use strict';var react=require('react'),reactNative=require('react-native'),jsxRuntime=require('react/jsx-runtime'),reactNativeSafeAreaContext=require('react-native-safe-area-context');var Da=Object.defineProperty;var o=(e,t)=>Da(e,"name",{value:t,configurable:true});function Gt(e){throw new Error(`assertNever: unhandled discriminated-union member ${JSON.stringify(e)}`)}o(Gt,"assertNever");function Do(e){return Object.freeze({kind:"error",terminal:true,code:e.code,retryable:e.retryable,wireMessage:e.wireMessage,synthesized:e.synthesized,lastEventId:e.lastEventId,serverRequestId:e.serverRequestId??null})}o(Do,"errorFrame");function zn(e){let t=globalThis.console;try{t?.error?.("[everfur] A host callback threw; the SDK ignored it.",e);}catch{}}o(zn,"reportHostFailure");function La(e){return (typeof e=="object"||typeof e=="function")&&e!==null&&typeof e.then=="function"}o(La,"isThenable");function Jt(e,...t){if(typeof e=="function")try{let n=e(...t);return La(n)&&Promise.resolve(n).then(void 0,zn),n}catch(n){zn(n);return}}o(Jt,"callHost");var Fo=new WeakMap;function Va(e){if(typeof e!="function")return;let t=Fo.get(e);if(t!==void 0)return t;let n=o((...r)=>{Jt(e,...r);},"guarded");return Fo.set(e,n),n}o(Va,"guardHost");function nt(e,t){let n=null;for(let r of t){let i=e[r];typeof i=="function"&&(n??={...e},n[r]=Va(i));}return n??e}o(nt,"guardHostProps");function Xt(e,...t){let n;try{n=e(...t);}catch(r){return zn(r),Promise.resolve({ok:false,error:r})}return Promise.resolve(n).then(r=>({ok:true,value:r}),r=>({ok:false,error:r}))}o(Xt,"callHostAsync");function No(){let e=[];return {register(t){return e=[...e,t],()=>{e=e.filter(n=>n!==t);}},dispatch(){for(let t of [...e].reverse())try{if(t())return !0}catch{}return false}}}o(No,"createTelevetBackChannel");var Mn=react.createContext(null);function rt(e,t=true){let n=react.useContext(Mn),r=react.useRef(e);r.current=e,react.useEffect(()=>{if(!(n===null||!t))return n.register(()=>r.current())},[n,t]);}o(rt,"useTelevetBackChannel");var m=o(e=>e,"DRAFT"),Ua=["[PLACEHOLDER","[PLAN NAME]","[LINK]","[Last]","TODO","TBD"];function Wa(e){return Ua.some(t=>e.toUpperCase().includes(t.toUpperCase()))}o(Wa,"isPlaceholderCopy");function ne(e,t){let n=e;for(let[r,i]of Object.entries(t))n=n.split(`{${r}}`).join(i);return n}o(ne,"fill");var u=Object.freeze({stateBlockedTitle:m("Not available in this state yet"),noCliniciansTitle:m("No vets available right now"),noCliniciansBody:m("Nobody is free in your area at the moment. This changes through the day."),noCliniciansRetryCta:m("Check again"),noCliniciansRegionBody:m("Video visits have to be with a vet licensed in your state, and we don\u2019t have one there yet."),yourVetTitle:m("Your Vet"),reviewsLabel:m("reviews"),rescheduleFromTemplate:m("Moving your visit on {when}"),rescheduleFailed:m("That did not move. Your original time is unchanged."),keepExistingCta:m("Keep my current time"),bookingPausedTitle:m("Booking is not available right now."),slotsErrorTitle:m("Could not load times"),noSlotsTitle:m("No times available"),nextOpeningTemplate:m("Next opening across our vets: {when}"),seeOtherVetsCta:m("See other vets"),retryCta:m("Try again"),holdExpired:m("That time is no longer held. Pick another."),slotTaken:m("That time was just taken. Pick another."),reasonPlaceholder:m("What is going on with your pet?"),reasonTooLong:m("That is too long. Please shorten it."),shareRecordsOff:m("Share health records with this vet"),confirmNotEntitled:m("A Pro membership is needed to book a video visit."),confirmFailed:m("That did not book. Try again."),checkAvailabilityCta:m("Check availability"),stateInterest:Object.freeze({cta:m("Add me to the list"),submitting:m("Adding you to the list\u2026"),joinedTitle:m("You are on the list"),joinedBody:m("We will let you know when this changes."),failed:m("That did not save. Try again.")}),media:Object.freeze({droppedTemplate:m("{n} attachment did not upload."),droppedPluralTemplate:m("{n} attachments did not upload."),refusedSizeTemplate:m("{n} attachment was too large to send."),refusedSizePluralTemplate:m("{n} attachments were too large to send."),refusedTypeTemplate:m("{n} attachment is a file type that cannot be sent."),refusedTypePluralTemplate:m("{n} attachments are file types that cannot be sent."),refusedUnreadableTemplate:m("{n} attachment could not be read."),refusedUnreadablePluralTemplate:m("{n} attachments could not be read.")}),navTitle:m("Book a visit"),rescheduleNavTitle:m("Change your visit"),close:m("Close"),continueCta:m("Continue"),petSelectTitle:m("Who is this visit for?"),addPetCta:m("Add a pet"),locationUnknownTitle:m("We need your location to find a vet"),locationUnknownBody:m("Turn on location for Everfur, then try again."),locationUnknownCta:m("Allow location"),locationBlockedTitle:m("Location is turned off"),locationBlockedBody:m("Everfur needs your location to match you with a vet in your area."),locationBlockedCta:m("Open Settings"),locationUnavailableTitle:m("We could not read your location"),locationUnavailableBody:m("Try again in a moment."),stateAttestTemplate:m("I confirm my pet and I are in {state} right now."),describeHeading:m("Tell the vet what you are seeing"),describeHelpLong:m("A few sentences is plenty. When it started, what changed, anything you've already tried."),addPhotoCta:m("ADD PHOTO OR VIDEO"),removePhotoLabel:m("Remove photo"),summaryPet:m("Pet"),summaryVet:m("Vet"),summaryWhen:m("When"),summaryLength:m("Length"),summaryReason:m("Reason"),summaryLengthTemplate:m("{n} minutes"),confirmCta:m("Confirm visit"),bookedTitle:m("You are booked."),addToCalendarCta:m("Add to calendar"),doneCta:m("Done"),booked:Object.freeze({remindPromise:m("We will notify you 30 minutes before."),summaryPromise:m("{pet}'s summary goes to the vet ahead of the call."),joinPromise:m("Join right here in the app. No links to hunt for."),backToPet:m("Back to {pet}"),calendarAdded:m("Added to your calendar"),calendarFailedBody:m("That did not save to your calendar.")}),chrome:Object.freeze({closeHint:m("Closes without saving"),discardTitle:m("Leave without booking?"),discardBody:m("Your answers will not be saved."),discardConfirmCta:m("Leave"),discardKeepCta:m("Keep going"),noPetsTitle:m("No pets on this account"),loadFailedTitle:m("Could not load"),retryCta:m("Try again")}),emergency:Object.freeze({bannerTitle:m("This cannot wait for a scheduled call."),keepBookingCta:m("I have handled this, keep booking"),lede:m("What you are describing is the kind of thing vets want to see in person, now."),exitPrimaryVetTitle:m("Call {petName}'s primary vet"),exitFindErTitle:m("Find an emergency vet near you"),startCallHint:m("Starts a phone call")}),visit:Object.freeze({title:m("Your visit")}),loading:Object.freeze({pets:"Loading pets. Nothing to read yet.",clinicians:"Loading vets. Nothing to read yet.",slots:"Loading times. Nothing to read yet.",consult:"Loading your visit. Nothing to read yet.",progressTemplate:"Step {step} of {total}"})});function Lo(e=u){return typeof e=="string"?[e]:typeof e!="object"||e===null?[]:Object.values(e).flatMap(t=>Lo(t))}o(Lo,"televetBookingCopyValues");function Se(){return Lo().every(e=>e.trim().length>0&&!Wa(e))}o(Se,"isTelevetBookingCopyReady");var jn=Object.freeze([Object.freeze({wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"AuthorizationException",envelope:"http_envelope",httpStatus:401,retryable:false}),Object.freeze({wireCode:"ConflictException",envelope:"http_envelope",httpStatus:409,retryable:true}),Object.freeze({wireCode:"DAILY_QUOTA_EXCEEDED",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"FILE_TOO_LARGE",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"IDEMPOTENCY_KEY_IN_FLIGHT",envelope:"http_envelope",httpStatus:409,retryable:true}),Object.freeze({wireCode:"IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"INVALID_CONTENT_TYPE",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"InternalFailureException",envelope:"http_envelope",httpStatus:500,retryable:true}),Object.freeze({wireCode:"MethodNotAllowedException",envelope:"http_envelope",httpStatus:405,retryable:false}),Object.freeze({wireCode:"NotImplementedException",envelope:"http_envelope",httpStatus:501,retryable:false}),Object.freeze({wireCode:"PaymentRequiredException",envelope:"http_envelope",httpStatus:402,retryable:false}),Object.freeze({wireCode:"ResourceNotFoundException",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"ServiceUnavailableException",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"TIER_UPGRADE_REQUIRED",envelope:"http_envelope",httpStatus:402,retryable:false}),Object.freeze({wireCode:"ThrottlingException",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"ValidationException",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"accessDenied",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"access_denied",envelope:"oauth_error",httpStatus:302,retryable:false}),Object.freeze({wireCode:"attachment_unreadable",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"authExpired",envelope:"http_envelope",httpStatus:401,retryable:true}),Object.freeze({wireCode:"authRejected",envelope:"http_envelope",httpStatus:401,retryable:false}),Object.freeze({wireCode:"consent_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"consent_required",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"consent_scope_wrong_route",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"device_cipher_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"email_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"event_cursor_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_payload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_type_not_available",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_type_unknown",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_required",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_reused",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"insufficientCapability",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"insufficient_scope",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"internal_error",envelope:"sse_frame",httpStatus:200,retryable:false}),Object.freeze({wireCode:"invalidRequest",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_client",envelope:"oauth_error",httpStatus:401,retryable:false}),Object.freeze({wireCode:"invalid_client_metadata",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_grant",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_redirect_uri",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_request",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_scope",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_target",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"mcp_connection_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"mcp_request_conflict",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"mcp_request_gone",envelope:"http_envelope",httpStatus:410,retryable:false}),Object.freeze({wireCode:"mcp_request_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"not_found",envelope:"sse_frame",httpStatus:200,retryable:false}),Object.freeze({wireCode:"partner_visit_link_conflict",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"partner_visit_owner_only",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"partner_visit_pet_already_mapped",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"payload_too_large",envelope:"http_envelope",httpStatus:413,retryable:false}),Object.freeze({wireCode:"petRefInUse",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"pet_health_list_removals_unconfirmed",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"pet_health_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"pet_not_registered",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"provider_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"rateLimited",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"record_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"record_subject_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"record_upload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"records_consent_required",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"sandbox_only",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"session_required",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"share_limit_reached",envelope:"http_envelope",httpStatus:429,retryable:false}),Object.freeze({wireCode:"slow_down",envelope:"oauth_error",httpStatus:429,retryable:true}),Object.freeze({wireCode:"species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"tenant_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"tenant_has_no_capabilities",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"tenant_resource_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"tenant_surface_not_enabled",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"timeout",envelope:"sse_frame",httpStatus:200,retryable:true}),Object.freeze({wireCode:"token_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"unavailable",envelope:"sse_frame",httpStatus:200,retryable:true}),Object.freeze({wireCode:"unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"unsupported_grant_type",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"unsupported_response_type",envelope:"oauth_error",httpStatus:302,retryable:false}),Object.freeze({wireCode:"verify_mint_rate_limited",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"verify_mint_refused",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"verify_mint_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"verify_user_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"webhook_endpoint_update_empty",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"webhook_endpoint_update_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false})]);Object.freeze(jn.map(e=>e.wireCode));var $a=Object.freeze({ValidationException:"validationFailed",AuthorizationException:"authRejected",PaymentRequiredException:"paymentRequired",AccessDeniedException:"accessDenied",ResourceNotFoundException:"resourceNotFound",ConflictException:"conflict",ThrottlingException:"rateLimited",InternalFailureException:"internalError",NotImplementedException:"notImplemented",ServiceUnavailableException:"serviceUnavailable",MethodNotAllowedException:"validationFailed",authExpired:"authExpired",unavailable:"serviceUnavailable",session_required:"sessionRequired",accessDenied:"accessDenied",invalidRequest:"sdkUpdateRequired",authRejected:"authRejected",rateLimited:"rateLimited",insufficientCapability:"accessDenied",event_cursor_invalid:"validationFailed",event_filter_invalid:"validationFailed",event_payload_invalid:"validationFailed",event_type_unknown:"validationFailed",idempotency_key_invalid:"validationFailed",idempotency_key_required:"validationFailed",idempotency_key_reused:"idempotencyConflict",payload_too_large:"validationFailed",webhook_url_rejected:"validationFailed",webhook_endpoint_update_empty:"validationFailed",webhook_endpoint_update_invalid:"validationFailed",event_type_not_available:"conflict",record_subject_not_found:"resourceNotFound",records_consent_required:"conflict",record_species_unsupported:"validationFailed",record_upload_invalid:"validationFailed",FILE_TOO_LARGE:"validationFailed",INVALID_CONTENT_TYPE:"validationFailed",attachment_unreadable:"validationFailed",provider_unsupported:"validationFailed",token_invalid:"validationFailed",device_cipher_unavailable:"serviceUnavailable",email_invalid:"validationFailed",consent_required:"validationFailed",consent_invalid:"validationFailed",consent_scope_wrong_route:"validationFailed",IDEMPOTENCY_KEY_IN_FLIGHT:"idempotencyInFlight",IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST:"idempotencyConflict",DAILY_QUOTA_EXCEEDED:"quotaExceeded",TIER_UPGRADE_REQUIRED:"paymentRequired",not_found:"conversationNotFound",timeout:"streamTimeout",internal_error:"internalError",invalid_request:"validationFailed",invalid_client:"authRejected",invalid_grant:"authRejected",unsupported_grant_type:"validationFailed",invalid_scope:"validationFailed",invalid_target:"validationFailed",invalid_redirect_uri:"validationFailed",invalid_client_metadata:"validationFailed",unsupported_response_type:"validationFailed",access_denied:"accessDenied",slow_down:"rateLimited",mcp_request_not_found:"resourceNotFound",mcp_request_gone:"resourceNotFound",mcp_connection_not_found:"resourceNotFound",mcp_request_conflict:"conflict",sandbox_only:"accessDenied",tenant_has_no_capabilities:"conflict",verify_mint_refused:"accessDenied",verify_mint_rate_limited:"rateLimited",verify_mint_unavailable:"serviceUnavailable",verify_user_ref_invalid:"validationFailed",insufficient_scope:"accessDenied",tenant_filter_invalid:"validationFailed",tenant_resource_not_found:"resourceNotFound",tenant_surface_not_enabled:"conflict",pet_health_species_unsupported:"validationFailed",pet_health_list_removals_unconfirmed:"validationFailed",petRefInUse:"conflict",share_limit_reached:"conflict",pet_not_registered:"resourceNotFound",species_unsupported:"validationFailed",partner_visit_owner_only:"accessDenied",partner_visit_link_conflict:"conflict",partner_visit_pet_already_mapped:"conflict"}),zo=Object.freeze(jn.map(e=>Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:$a[e.wireCode]}))),Ka=new Map(zo.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),Ya=Object.freeze(["http_envelope",...[...new Set(zo.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function Qt(e,t){if(typeof e!="string")return;let n=e.trim().toUpperCase();if(n.length!==0)for(let r of [t??"http_envelope",...Ya]){let i=Ka.get(r+n);if(i)return i}}o(Qt,"contractErrorFor");function Ga(e){return e.envelope==="sse_frame"?`/errors#sse-${e.wireCode}`:e.envelope==="oauth_error"?`/errors#oauth-${e.wireCode}`:`/errors#${e.wireCode}`}o(Ga,"contractDocUrl");function Mo(e){return null}o(Mo,"publishedDocUrl");var Ja=Object.freeze({authExpired:"authentication",authRejected:"authentication",sessionRequired:"authentication",accessDenied:"authorization",paymentRequired:"entitlement",quotaExceeded:"rateLimit",rateLimited:"rateLimit",validationFailed:"invalidRequest",sdkUpdateRequired:"invalidRequest",conversationNotFound:"notFound",petNotFound:"notFound",resourceNotFound:"notFound",conflict:"conflict",idempotencyConflict:"conflict",idempotencyInFlight:"conflict",streamTimeout:"connection",streamIncomplete:"connection",upstreamLlmTimeout:"connection",serviceUnavailable:"connection",internalError:"server",notImplemented:"server",mediaUploadFailed:"media",moderationBlocked:"policy",unknown:"unknown"});function jo(e){return Ja[e]}o(jo,"categoryFor");function Ho(e){let t=Qt(e);if(t)return t.normalized;let n=(e??"").trim().toUpperCase(),r=n.replace(/[^A-Z0-9]/g,"");if(r==="AUTHREJECTED")return "authRejected";if(n.startsWith("AUTH"))return "authExpired";switch(r){case "DAILYQUOTAEXCEEDED":case "QUOTAEXCEEDED":return "quotaExceeded";case "RATELIMITED":case "TOOMANYREQUESTS":return "rateLimited";case "IDEMPOTENCYKEYCONFLICT":case "IDEMPOTENCYCONFLICT":return "idempotencyConflict";case "ACCESSDENIED":case "FORBIDDEN":return "accessDenied";case "NOTFOUND":case "CONVERSATIONNOTFOUND":return "conversationNotFound";case "PETNOTFOUND":return "petNotFound";case "TIMEOUT":case "STREAMTIMEOUT":return "streamTimeout";case "MEDIAUPLOADFAILED":case "UNRECOGNIZEDVIDEOFORMAT":case "FILETOOSMALL":return "mediaUploadFailed";case "MODERATIONBLOCKED":return "moderationBlocked";case "UPSTREAMLLMTIMEOUT":return "upstreamLlmTimeout";case "INTERNALERROR":case "INTERNALSERVERERROR":return "internalError";case "STREAMINCOMPLETE":case "CHATSTREAMINCOMPLETE":return "streamIncomplete";case "INVALIDANALYSISTYPE":case "INVALIDUPLOADPURPOSE":return "unknown";default:return "unknown"}}o(Ho,"fromWire");var Xa=new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function Hn(e){return Xa.has(e)}o(Hn,"isAutoRetryable");var Qa=new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function Uo(e){return Hn(e)||Qa.has(e)}o(Uo,"isRetryableCode");var Za=500,Un=8e3,Wo=4;function qo(e,t=Math.random){let n=Math.max(0,e),r=Math.min(Za*2**n,Un);return Math.floor(t()*r)}o(qo,"backoffDelayMs");var es=Object.freeze({authExpired:"Please sign in again to continue.",authRejected:"Please sign in again to continue.",sessionRequired:"This app needs to be updated to keep using Everfur.",accessDenied:"This feature isn't available on your account right now.",paymentRequired:"This is part of a paid plan.",quotaExceeded:"You have used today's messages. This resets tomorrow.",rateLimited:"You are sending messages quickly. Try again in a few seconds.",validationFailed:"Something in that request was not right. Check the details and try again.",sdkUpdateRequired:"This app needs to be updated to keep using Everfur.",conflict:"That is already running. Wait for it to finish, then try again.",idempotencyConflict:"That message was already delivered.",idempotencyInFlight:"That is still processing. Give it a moment.",conversationNotFound:"This conversation is no longer available.",petNotFound:"We could not find that pet. Please pick a pet and try again.",resourceNotFound:"We could not find that.",streamTimeout:"The response timed out. Tap retry to try again.",mediaUploadFailed:"We could not upload that photo. Please attach it again.",moderationBlocked:"This request cannot be answered here.",upstreamLlmTimeout:"The response timed out. Tap retry to try again.",internalError:"We hit a snag on our end. Please try again.",notImplemented:"That is not available yet.",serviceUnavailable:"That service is briefly unavailable. Try again shortly.",streamIncomplete:"The connection dropped mid-answer. Tap retry to continue.",unknown:"Something went wrong. Please try again."});function Wn(e){return es[e]}o(Wn,"userFacingError");function $o(e,t,n){Object.defineProperty(e,t,{value:n,enumerable:false,writable:false,configurable:false});}o($o,"defineHidden");var ts=/^[a-z][a-z0-9_]{0,63}$/;function ye(e,t){let n=Qt(t?.wireCode,t?.wireEnvelope),r={code:e,category:jo(e),retryable:t?.retryable??Uo(e),displayMessage:Wn(e)};if(t?.httpStatus!==void 0&&(r.httpStatus=t.httpStatus),t?.requestId&&(r.requestId=t.requestId),typeof t?.reasonCode=="string"&&ts.test(t.reasonCode)&&(r.reasonCode=t.reasonCode),n);return t?.wireMessage&&$o(r,"wireMessage",t.wireMessage),t?.raw!==void 0&&t.raw!==null&&$o(r,"raw",t.raw),Object.freeze(r)}o(ye,"makeEverfurError");function L(e,t){return Object.freeze(t===void 0?{ok:true,value:e}:{ok:true,value:e,warning:t})}o(L,"ok");function w(e){return Object.freeze({ok:false,error:e})}o(w,"err");var Zt=class Zt extends Error{constructor(t,n){super(n),this.name="EverfurConfigError",this.kind=t,Object.setPrototypeOf(this,Zt.prototype);}};o(Zt,"EverfurConfigError");var bt=Zt;function ns(e){let t={};return e.mode==="personalized"?t.authorization=`Bearer ${e.token}`:t["x-everfur-partner-key"]=e.publishableKey,e.userRef&&(t["x-everfur-user-ref"]=e.userRef),e.sessionId&&(t["x-everfur-session-id"]=e.sessionId),t}o(ns,"authHeaders");function ht(e,t){return {...e,headers:{...rs(e.headers),...ns(t)}}}o(ht,"withAuthHeaders");function rs(e){if(!e)return {};let t={};for(let[n,r]of Object.entries(e)){let i=n.toLowerCase();i==="authorization"||i==="x-everfur-partner-key"||(t[n]=r);}return t}o(rs,"stripAuthHeaders");async function Ko(e,t){if(t.mode==="anonymous")return t.transport.request(ht(e,{mode:"anonymous",publishableKey:t.publishableKey,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));let n;try{n=await t.identity.currentToken();}catch{return w(qn())}let r=await t.transport.request(ht(e,{mode:"personalized",token:n,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));if(r.ok||r.error.httpStatus!==401)return r;let i;try{i=await t.identity.currentToken({forceRefresh:!0});}catch{return w(qn())}let l=await t.transport.request(ht(e,{mode:"personalized",token:i,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));return !l.ok&&l.error.httpStatus===401?w(qn(l.error.httpStatus)):l}o(Ko,"authedSend");function qn(e){return ye("authRejected",{retryable:false,...e!==void 0?{httpStatus:e}:{}})}o(qn,"authRejectedError");function Yo(e){return ye("internalError",{retryable:true,wireMessage:os(e)})}o(Yo,"networkError");function os(e){return e instanceof Error?e.message:typeof e=="string"?e:"network request failed"}o(os,"describeCause");var ls=3e4,is=Un*2,as="idempotency-key",ss=new Set(["POST","PUT","PATCH","DELETE"]),ds=Object.freeze({onEvent(){}}),cs=Object.freeze({setTimeout:o((e,t)=>setTimeout(e,t),"setTimeout"),clearTimeout:o(e=>clearTimeout(e),"clearTimeout"),now:o(()=>Date.now(),"now")});function us(e){let t=e.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return t.length===0?null:`efs_${t}`.slice(0,128)}o(us,"seededIdempotencyKey");function Tt(e){let t=e.observer??ds,n=e.timers??cs,r=e.rng??Math.random,i=e.sleep??((f,y)=>Ss(f,n,y)),l=e.maxAttempts??Wo,a=e.unaryTimeoutMs??ls,s=e.newIdempotencyKey??fs(),c=o(f=>{try{t.onEvent(f);}catch{}},"emit");async function d(f,y,E){let _=E?.maxAttempts,P=Math.max(1,_??l),h=E?.idempotent??ss.has(y.method),T=E?.idempotencyKey===void 0?null:us(E.idempotencyKey),R=h?T??s():null,O=ps(y,R),C=0;for(;;){let q=o(oe=>Object.freeze({call:f,method:y.method,path:y.path,attempt:C,...R?{idempotencyKey:R}:{},...oe}),"stamp");c(q({phase:"attempt"}));let D=ks(a,n),z=Cs(D.signal,y.signal),N;try{N=await Ko({...O,signal:z.signal},e.auth);}catch(oe){N=w(Yo(oe));}finally{z.dispose(),D.cancel();}if(N.ok)return c(q({phase:"settled",ok:true,reason:"ok"})),N;let K=N.error,fe=ms(K,C,{maxAttempts:P,rng:r,now:n.now(),aborted:y.signal?.aborted===true,..._!==void 0?{perCallMaxAttempts:_}:{},...e.errorPolicy!==void 0?{policy:e.errorPolicy}:{}}),Q={ok:false,code:K.code,reason:fe.reason,...K.httpStatus!==void 0?{httpStatus:K.httpStatus}:{},...K.requestId!==void 0?{requestId:K.requestId}:{}};if(!fe.retry)return c(q({phase:"settled",...Q})),w(K);if(c(q({phase:"retry",...Q,delayMs:fe.delayMs})),await i(fe.delayMs,y.signal),y.signal?.aborted===true)return c(q({phase:"settled",...Q,reason:"aborted"})),w(K);C+=1;}}o(d,"send");async function p(f){return ht(f,await Es(e.auth))}o(p,"authorize");async function*g(f,y,E){c(Object.freeze({call:f,phase:"stream.open",method:y.method,path:y.path,attempt:0}));try{yield*e.auth.transport.stream(y,E);}catch{yield Do({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:null});}}return o(g,"stream"),Object.freeze({send:d,authorize:p,stream:g})}o(Tt,"createRequestFunnel");function ps(e,t){let n={};for(let[r,i]of Object.entries(e.headers??{}))r.toLowerCase()!==as&&(n[r]=i);return t!==null&&(n["Idempotency-Key"]=t),{...e,headers:n}}o(ps,"assembleHeaders");function fs(){let e=0;return ()=>`efk_${Date.now().toString(36)}_${(e++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}o(fs,"defaultIdempotencyKeyFactory");var ys=10;function ms(e,t,n){if(n.aborted)return {retry:false,reason:"aborted"};let r=vs(e);if(r==="quota")return {retry:false,reason:"daily-quota-exhausted"};if(r!=="burst"&&!Hn(e.code))return {retry:false,reason:"terminal-code"};let i=r==="burst"?"burst-throttle":"retryable-code";if(o(()=>{if(n.policy===void 0)return false;try{return !n.policy.shouldRetry(e.code,t)}catch{return false}},"policyVetoedRetry")())return {retry:false,reason:"terminal-code"};let a=o(()=>{if(n.policy===void 0)return null;let d;try{d=n.policy.maxAttempts(e.code);}catch{return null}return typeof d!="number"||!Number.isFinite(d)?null:Math.max(1,Math.min(ys,Math.floor(d)))},"policyCeiling"),s=n.perCallMaxAttempts??a()??n.maxAttempts;if(t+1>=s)return {retry:false,reason:"attempts-exhausted"};let c=gs(e,n.now);return c!==null?c>is?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:i,delayMs:c}:{retry:true,reason:i,delayMs:qo(t,n.rng)}}o(ms,"decideRetry");function vs(e){let t=e.code==="unknown"?Ho(Ts(e.raw)):e.code;return t==="quotaExceeded"?"quota":t==="rateLimited"||e.httpStatus===429?"burst":null}o(vs,"throttleKind");function gs(e,t){let n=bs(e.raw);if(n===null)return null;let r=n-t;return r>0?r:0}o(gs,"retryOverrideMs");function bs(e){for(let t of Jo(e)){let n=t.resets_at,r=hs(n);if(r!==null)return r}return null}o(bs,"findResetsAt");function Jo(e){if(!Go(e))return [];let t=[e];for(let n of ["error","detail"]){let r=e[n];Go(r)&&t.push(r);}return t}o(Jo,"candidateScopes");function hs(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}o(hs,"parseInstantMs");function Ts(e){for(let t of Jo(e)){let n=t.code;if(typeof n=="string"&&n.length>0)return n}return null}o(Ts,"rawWireCode");function Go(e){return typeof e=="object"&&e!==null}o(Go,"isRecord");async function Es(e){return e.mode==="anonymous"?{mode:"anonymous",publishableKey:e.publishableKey,userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{}}:{mode:"personalized",token:await e.identity.currentToken(),userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{}}}o(Es,"resolveDeviceAuth");function ks(e,t){let n=new AbortController,r=t.setTimeout(()=>n.abort(),e);return {signal:n.signal,cancel:o(()=>t.clearTimeout(r),"cancel")}}o(ks,"boundedSignal");function Cs(e,t){let n=o(()=>{},"noop");if(!t)return {signal:e,dispose:n};let r=new AbortController;if(e.aborted||t.aborted)return r.abort(),{signal:r.signal,dispose:n};let i=o(()=>r.abort(),"onAbort");return e.addEventListener("abort",i,{once:true}),t.addEventListener("abort",i,{once:true}),{signal:r.signal,dispose:o(()=>{e.removeEventListener("abort",i),t.removeEventListener("abort",i);},"dispose")}}o(Cs,"mergeSignals");function Ss(e,t,n){return e<=0||n?.aborted===true?Promise.resolve():new Promise(r=>{let i=t.setTimeout(()=>{n?.removeEventListener("abort",l),r();},e),l=o(()=>{t.clearTimeout(i),r();},"onAbort");n?.addEventListener("abort",l,{once:true});})}o(Ss,"delayAbortable");function Rs(e){try{return new URL(e.trim()).protocol==="https:"}catch{return false}}o(Rs,"isSafeRoomUrl");function _s(e,t){return Rs(e)&&t.trim().length>0}o(_s,"isUsableRoomCredential");function en(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(en,"isRecord");function $n(e,t){return typeof e=="number"&&Number.isInteger(e)&&e>=t?e:null}o($n,"wholeNumber");function xs(e){if(!en(e))return null;let t=$n(e.consult_minutes,1),n=$n(e.auto_end_minutes,0),r=$n(e.warn_before_seconds,0);return t===null||n===null||r===null?null:Object.freeze({consultMinutes:t,autoEndMinutes:n,warnBeforeSeconds:r})}o(xs,"parseCallLimits");function Kn(e){if(!en(e))return null;let t=e.room_url??e.url,n=e.token;if(typeof t!="string"||typeof n!="string"||!_s(t,n))return null;let r=e.recording_notice;return Object.freeze({roomUrl:t.trim(),token:n,recordingNotice:typeof r=="boolean"?r:true,callLimits:xs(e.call_limits)})}o(Kn,"parseVetCallCredential");function Yn(e){let t=Xo(e.raw);return t!==null&&t.length>0?t:null}o(Yn,"vetCallJoinReason");function Xo(e){if(!en(e))return null;let t=e.detail??e.error,r=(en(t)?t:e).reason;return typeof r=="string"?r:null}o(Xo,"reasonOf");function Gn(e){if(e.httpStatus===404)return "unavailable";let t=Xo(e.raw);return t==="too_early"||t==="too_late"||t==="room_not_ready"?t:t!==null&&t.startsWith("status_")?"not_joinable":"unknown"}o(Gn,"vetCallJoinRefusal");var Zo=["scheduled","in_progress","awaiting_summary","completed","cancelled_owner","cancelled_ops","no_show_owner","no_show_vet"],$e=new Set(["completed","cancelled_owner","cancelled_ops","no_show_owner","no_show_vet"]),el=["wellness","prescription"],tn=64,_e=2e3,nn=10;function me(e){return typeof e=="string"&&/^[A-Za-z]{2}$/.test(e.trim())}o(me,"isWellFormedStateCode");function Re(e){return typeof e=="object"&&e!==null?e:null}o(Re,"row");function Z(e){return typeof e=="string"&&e.length>0?e:null}o(Z,"str");function Fe(e){return typeof e=="string"&&e.trim().length>0?e.trim():null}o(Fe,"trimmedOrNull");function ot(e,t){return typeof e=="boolean"?e:t}o(ot,"bool");function Jn(e){return typeof e=="number"&&Number.isFinite(e)?e:null}o(Jn,"num");function Qo(e,t){return typeof t=="string"&&e.includes(t)?t:"unknown"}o(Qo,"closed");function lt(e,t){if(!Array.isArray(e))return Object.freeze([]);let n=[];for(let r of e){let i=t(r);i!==null&&n.push(i);}return Object.freeze(n)}o(lt,"parseList");function tl(e,t){let n=Re(e);return n===null?null:Object.freeze({state:Z(n.state)??t,wellnessAvailable:ot(n.wellness_available,false),prescriptionsAvailable:ot(n.prescriptions_available,false),cancellationPolicyText:Fe(n.cancellation_policy_text)})}o(tl,"parseStatePolicy");function nl(e){let t=Re(e);if(t===null)return null;let n=Fe(t.summary),r=Fe(t.version);return n===null||r===null?null:Object.freeze({summary:n,version:r})}o(nl,"parseCancellationPolicy");function rl(e){let t=Re(e);if(t===null)return null;let n=Z(t.clinician_id),r=Z(t.display_name);return n===null||r===null?null:Object.freeze({clinicianId:n,displayName:r,credentials:Fe(t.credentials_text),rating:Jn(t.rating),ratingCount:Jn(t.rating_count),bio:Fe(t.bio),photoRef:Z(t.photo_ref),licensedStates:lt(t.licensed_states,i=>{let l=Re(i),a=l===null?null:Z(l.state);return a===null?null:Object.freeze({state:a,canPrescribe:ot(l?.can_prescribe,false)})})})}o(rl,"parseClinician");function Xn(e){let t=Re(e);if(t===null)return null;let n=Z(t.slot_id),r=Z(t.starts_at);return n===null||r===null?null:Object.freeze({slotId:n,startsAt:r,endsAt:Z(t.ends_at)??r})}o(Xn,"parseSlot");function ol(e){let t=Re(e);if(t===null)return null;let n=Z(t.slot_id),r=Z(t.hold_expires_at);return n===null||r===null?null:Object.freeze({slotId:n,expiresAt:r})}o(ol,"parseSlotHold");function Et(e){let t=Re(e);if(t===null)return null;let n=Z(t.consult_id),r=Z(t.scheduled_at);return n===null||r===null?null:Object.freeze({consultId:n,petId:Z(t.pet_id)??"",clinicianId:Z(t.clinician_id)??"",clinicianName:Fe(t.display_name),reasonText:Fe(t.reason_text),mediaRefs:lt(t.media_refs,i=>Z(i)),status:Qo(Zo,t.status),kind:Qo(el,t.kind),scheduledAt:r,emergencyFlagged:ot(t.emergency_flagged,false),hasRoom:Z(t.meeting_url)!==null})}o(Et,"parseConsult");function ll(e){let t=Re(e);return Object.freeze({active:ot(t?.active,false)})}o(ll,"parseBookingEntitlement");var rn=240;function il(e){let t=Re(e);if(t===null)return null;let n=Jn(t.fee_cents);return n===null||n<0?null:Object.freeze({feeCents:n,currency:Z(t.currency)??"usd",feeRecorded:ot(t.fee_recorded,n>0),summary:Fe(t.summary)})}o(il,"parseCancelReceipt");var Ne="/widget/v1/televet",ws=`${Ne}/state-policy`,Ps=`${Ne}/vets`,al=`${Ne}/slots`,Is=`${Ne}/slots/next`,on=`${Ne}/consults`,Os=`${Ne}/entitlement`,As=`${Ne}/cancellation-policy`;function sl(e){return `${al}/${encodeURIComponent(e)}/hold`}o(sl,"televetHoldCall");function dl(e){return `${on}/${encodeURIComponent(e)}/reschedule`}o(dl,"televetRescheduleCall");function ln(e){return `${on}/${encodeURIComponent(e)}`}o(ln,"televetConsultCall");function cl(e){return `${ln(e)}/join`}o(cl,"televetJoinCall");function ul(e){return `${ln(e)}/cancel`}o(ul,"televetCancelCall");var pl=100;function ie(e){return w(ye("validationFailed",{retryable:false,wireMessage:e}))}o(ie,"invalid");function Ke(e){return w(ye("internalError",{retryable:false,httpStatus:502,wireMessage:e}))}o(Ke,"unusable");function Qn(e){return e.httpStatus===404}o(Qn,"isDark");function kt(e,t,n){try{e?.track(t,n);}catch{}}o(kt,"safeTrack");function fl(e){if(e.pet_id.trim().length===0)return "pet_id is required";if(e.clinician_id.trim().length===0)return "clinician_id is required";if(e.slot_id.trim().length===0)return "slot_id is required";if(!me(e.state))return "state must be a two-letter US state code";let t=e.reason_text.trim();return t.length===0?"reason_text is required":t.length>_e?`reason_text must be at most ${_e} characters`:Bs(e)}o(fl,"validateBookingBody");function Bs(e){let t=e.state_attested===true,n=e.cancellation_policy_version?.trim()??"";return t!==n.length>0?"state_attested and cancellation_policy_version must be sent together or omitted together":n.length>tn?`cancellation_policy_version must be at most ${tn} characters`:null}o(Bs,"attestationRefusal");function er(e){let t=e.funnel??Tt({auth:e.auth,...e.errorPolicy?{errorPolicy:e.errorPolicy}:{}}),n=e.telemetry;return {async statePolicy(r,i){let l=r.trim();if(!me(l))return ie("state must be a two-letter US state code");let a=await t.send("televet.booking.state_policy",{method:"GET",path:`${ws}/${encodeURIComponent(l)}`,...i?{signal:i}:{}});if(!a.ok)return w(a.error);let s=tl(a.value,l);return s===null?Ke("the state policy response was unreadable"):L(s)},async entitlement(r){let i=await t.send("televet.booking.entitlement",{method:"GET",path:Os,...r?{signal:r}:{}});return i.ok?L(ll(i.value)):w(i.error)},async cancellationPolicy(r){let i=await t.send("televet.booking.cancellation_policy",{method:"GET",path:As,...r?{signal:r}:{}});return i.ok?L(nl(i.value)):L(null)},async clinicians(r,i){let l=r.trim();if(!me(l))return ie("state must be a two-letter US state code");let a=await t.send("televet.booking.clinicians",{method:"GET",path:Ps,query:{state:l},...i?{signal:i}:{}});return a.ok?L(lt(Zn(a.value,"vets"),rl)):Qn(a.error)?L(Object.freeze([])):w(a.error)},async slots(r,i){let l=r.trim();if(l.length===0)return ie("clinicianId is required");let a=await t.send("televet.booking.slots",{method:"GET",path:al,query:{clinician_id:l},...i?{signal:i}:{}});return a.ok?L(lt(Zn(a.value,"slots"),Xn)):Qn(a.error)?L(Object.freeze([])):w(a.error)},async nextSlot(r){let i=await t.send("televet.booking.next_slot",{method:"GET",path:Is,...r?{signal:r}:{}});return i.ok?L(Xn(Fs(i.value,"slot"))):L(null)},async holdSlot(r){let i=r.trim();if(i.length===0)return ie("slotId is required");let l=await t.send("televet.booking.hold",{method:"POST",path:sl(i)},{idempotent:false,maxAttempts:1});if(!l.ok)return kt(n,"televet.booking.hold_failed",{status:l.error.httpStatus??null}),w(l.error);let a=ol(l.value);return a===null?Ke("the hold response carried no usable expiry"):L(a)},async book(r,i){let l=fl(r);if(l!==null)return ie(l);let a=i.trim();if(a.length===0)return ie("idempotencyKey is required");let s=await t.send("televet.booking.book",{method:"POST",path:on,body:Ds(r)},{idempotent:true,idempotencyKey:a,maxAttempts:1});if(!s.ok)return kt(n,"televet.booking.book_failed",{status:s.error.httpStatus??null}),w(s.error);let c=Et(s.value);return c===null?Ke("the booking response was unreadable"):L(c)},async reschedule(r,i){let l=r.trim(),a=i.trim();if(l.length===0)return ie("consultId is required");if(a.length===0)return ie("slotId is required");let s=await t.send("televet.booking.reschedule",{method:"POST",path:dl(l),body:{new_slot_id:a}},{idempotent:false,maxAttempts:1});if(!s.ok)return kt(n,"televet.booking.reschedule_failed",{status:s.error.httpStatus??null}),w(s.error);let c=Et(s.value);return c===null?Ke("the reschedule response was unreadable"):L(c)},async listConsults(r){let i=await t.send("televet.booking.consults",{method:"GET",path:on,query:{limit:String(pl)},...r?{signal:r}:{}});return i.ok?L(lt(Zn(i.value,"consults"),Et)):Qn(i.error)?L(Object.freeze([])):w(i.error)},async getConsult(r,i){let l=r.trim();if(l.length===0)return ie("consultId is required");let a=await t.send("televet.booking.consult",{method:"GET",path:ln(l),...i?{signal:i}:{}});if(!a.ok)return w(a.error);let s=Et(a.value);return s===null?Ke("the consult response was unreadable"):L(s)},async joinConsult(r){let i=r.trim();if(i.length===0)return ie("consultId is required");let l=await t.send("televet.booking.join",{method:"POST",path:cl(i)},{idempotent:false,maxAttempts:1});if(!l.ok)return kt(n,"televet.booking.join_failed",{status:l.error.httpStatus??null}),w(l.error);let a=Kn(l.value);return a===null?Ke("the join response carried no usable room credential"):L(a)},async cancelConsult(r,i){let l=r.trim(),a=i.trim();if(l.length===0)return ie("consultId is required");if(a.length===0)return ie("reason is required");if(a.length>rn)return ie(`reason must be at most ${rn} characters`);let s=await t.send("televet.booking.cancel",{method:"POST",path:ul(l),body:{reason:a}},{idempotent:false,maxAttempts:1});if(!s.ok)return kt(n,"televet.booking.cancel_failed",{status:s.error.httpStatus??null}),w(s.error);let c=il(s.value);return c===null?Ke("the cancel response was unreadable"):L(c)}}}o(er,"createTelevetBookingController");function Ds(e){let t=e.cancellation_policy_version?.trim()??"",n=e.state_attested===true&&t.length>0;return {pet_id:e.pet_id,clinician_id:e.clinician_id,slot_id:e.slot_id,state:e.state,reason_text:e.reason_text.trim(),species:e.species,media_refs:[...e.media_refs],emergency_acknowledged:e.emergency_acknowledged,share_health_records:e.share_health_records,...n?{state_attested:true,cancellation_policy_version:t}:{}}}o(Ds,"bookingWireBody");function Zn(e,t){if(Array.isArray(e))return e;if(typeof e=="object"&&e!==null){let n=e,r=n[t]??n.items??n.data;if(Array.isArray(r))return r}return e}o(Zn,"rows");function Fs(e,t){if(typeof e=="object"&&e!==null&&!Array.isArray(e)){let n=e,r=n[t]??n.data;if(typeof r=="object"&&r!==null)return r}return e}o(Fs,"unwrap");var yl=Symbol.for("@everfur/sdk#EverfurContext@v1"),ml=globalThis,vl=ml[yl]??(ml[yl]=react.createContext(null));vl.displayName??="EverfurContext";function Ye(){let e=react.useContext(vl);if(e===null)throw new bt("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return e}o(Ye,"useEverfurContext");var Vs=Object.freeze({chat:Object.freeze(["chat.message.create"]),records:Object.freeze(["records.upload.create","records.record.read"]),recordsClinic:Object.freeze(["records.clinic.create"]),video:Object.freeze(["video.gait.execute"]),photo:Object.freeze(["photo.checkup.execute"]),animations:Object.freeze(["animations.state.read"]),televet:Object.freeze(["televet.visit.create"])});function zs(e){return Vs[e]}o(zs,"requires");function gl(e,t,n){let r=zs(e),i=new Map;for(let s of t)i.set(s.resource,s);if(n?.isPending===true&&r.some(s=>!i.has(s)))return tr({name:e,enabled:false,isPending:true,limits:{}});let l=Ms(r,i);return r.filter(s=>i.get(s)?.granted!==true).length===0?tr({name:e,enabled:true,isPending:false,limits:l}):tr({name:e,enabled:false,isPending:false,limits:l,disabled:js(r,i)})}o(gl,"decideCapability");function Ms(e,t){let n={};for(let r of e){let i=t.get(r)?.limits;if(i)for(let[l,a]of Object.entries(i)){let s=n[l];n[l]=s===void 0?a:Math.min(s,a);}}return n}o(Ms,"mergeLimits");function js(e,t){for(let n of e){let r=t.get(n)?.disabled;if(r)return Object.freeze({reason:r.reason,level:r.level,recoverable:r.recoverable})}return Object.freeze({reason:Wn("accessDenied"),level:"user_entitlement",recoverable:false})}o(js,"disabledFor");function tr(e){let t={name:e.name,enabled:e.enabled,isPending:e.isPending,limits:Object.freeze({...e.limits})};return e.disabled!==void 0&&(t.disabled=e.disabled),Object.freeze(t)}o(tr,"freezeDecision");function Ct(e){let{runtime:t}=Ye(),n=t.entitlements,r=react.useSyncExternalStore(n.subscribe,n.getSnapshot,n.getSnapshot);return react.useMemo(()=>gl(e,r.decisions,{isPending:r.isPending}),[e,r])}o(Ct,"useCapability");function ae(e){let{runtime:t,userRef:n,scopeEpoch:r}=Ye();return react.useMemo(()=>{if(e)return e;if(n===null)return null;let{services:i}=t.registry;return er({auth:i.authFor(n),telemetry:i.telemetry,...i.errorPolicy?{errorPolicy:i.errorPolicy}:{}})},[t,n,r,e])}o(ae,"useTelevetBookingController");function Ws(){let{userRef:e}=Ye(),t=Ct("televet");return react.useMemo(()=>({available:t.enabled&&e!==null,isPending:t.isPending}),[t.enabled,t.isPending,e])}o(Ws,"useTelevetBookingAvailable");function Le(e,t,n){let[r,i]=react.useState(()=>({key:e,data:null,isPending:t&&n!==null,error:null})),[l,a]=react.useState(0),s=react.useRef(n);s.current=n,react.useEffect(()=>{let p=s.current;if(!t||p===null){i({key:e,data:null,isPending:false,error:null});return}let g=new AbortController,f=true;return i(y=>y.key===e?{...y,isPending:true,error:null}:{key:e,data:null,isPending:true,error:null}),(async()=>{let y;try{y=await p(g.signal);}catch{f&&i({key:e,data:null,isPending:false,error:null});return}f&&(y.ok?i({key:e,data:y.value,isPending:false,error:null}):i({key:e,data:null,isPending:false,error:y.error}));})(),()=>{f=false,g.abort();}},[e,t,l]);let c=react.useCallback(()=>a(p=>p+1),[]),d=r.key===e;return react.useMemo(()=>({enabled:t,data:d?r.data:null,isPending:t&&(!d||r.isPending),isError:d&&r.error!==null,error:d?r.error:null,refetch:c}),[t,d,r.data,r.isPending,r.error,c])}o(Le,"useTelevetRead");function rr(e,t){let n=e?.trim()??"",r=t?.statePolicy!==void 0&&me(n),i=t?.statePolicy;return Le(`state-policy:${n}`,r,r&&i?l=>i.call(t,n,l):null)}o(rr,"useTelevetStatePolicy");function or(e){let t=e?.entitlement!==void 0,n=e?.entitlement;return Le("entitlement",t,t&&n?r=>n.call(e,r):null)}o(or,"useTelevetBookingEntitlement");function St(e){let t=e?.cancellationPolicy!==void 0,n=e?.cancellationPolicy;return Le("cancellation-policy",t,t&&n?r=>n.call(e,r):null)}o(St,"useTelevetCancellationPolicy");function lr(e,t){let n=e?.trim()??"",r=t?.clinicians!==void 0&&me(n),i=t?.clinicians;return Le(`clinicians:${n}`,r,r&&i?l=>i.call(t,n,l):null)}o(lr,"useTelevetClinicians");function Rt(e,t){let n=e?.trim()??"",r=t!==null&&n.length>0;return Le(`slots:${n}`,r,r&&t?i=>t.slots(n,i):null)}o(Rt,"useTelevetSlots");function ir(e){let t=e?.nextSlot!==void 0,n=e?.nextSlot;return Le("next-slot",t,t&&n?r=>n.call(e,r):null)}o(ir,"useTelevetNextSlot");function dn(e){let[t,n]=react.useState(null),r=react.useRef(true),i=react.useRef(false),l=react.useRef(e);l.current=e,react.useEffect(()=>(r.current=true,()=>{r.current=false;}),[]);let a=react.useCallback((...s)=>{let c=l.current;if(c===null||i.current)return;let d=s[s.length-1],p=typeof d=="object"&&d!==null&&("onSuccess"in d||"onError"in d),g=p?d:void 0,f=p?s.slice(0,-1):s;i.current=true,n({variables:f[0]??null}),(async()=>{let y=null;try{y=await c(...f);}catch{y=null;}i.current=false,r.current&&n(null),y!==null&&(y.ok?g?.onSuccess?.(y.value):g?.onError?.(y.error));})();},[]);return react.useMemo(()=>({isPending:t!==null,variables:t?.variables??null,mutate:a}),[t,a])}o(dn,"useTelevetWrite");function _t(e){return dn(e?t=>e.holdSlot(t):null)}o(_t,"useTelevetHoldSlot");function ar(e){return dn(e?(t,n)=>e.book(t,n):null)}o(ar,"useTelevetBookConsult");function sr(e,t){return dn(t&&e?n=>t.reschedule(e,n):null)}o(sr,"useTelevetRescheduleConsult");function cn(e,t=0){let n=e?.listConsults!==void 0,r=e?.listConsults;return Le(`consults:${t}`,n,n&&r?i=>r.call(e,i):null)}o(cn,"useTelevetConsults");function Tl(e,t,n=0){let r=e?.trim()??"",i=t?.getConsult!==void 0&&r.length>0,l=t?.getConsult;return Le(`consult:${r}:${n}`,i,i&&l?a=>l.call(t,r,a):null)}o(Tl,"useTelevetConsult");function El(e,t){let n=t?.cancelConsult;return dn(t&&n&&e?r=>n.call(t,e,r):null)}o(El,"useTelevetCancelConsult");function dr(e){return e.error!==null&&e.error.httpStatus===404}o(dr,"televetReadIsDark");var cr=15,ur=250,qs=new Set(["scheduled","in_progress"]);function Ge(e){let t=Date.parse(e.scheduledAt);return Number.isNaN(t)?null:t}o(Ge,"startsAtMs");function $s(e){let t=Ge(e);return t===null?null:t-cr*6e4}o($s,"televetJoinOpensAtMs");function pr(e,t){if(e===null)return {ready:false,reason:"not_open_yet"};if($e.has(e.status))return {ready:false,reason:"consult_over"};if(e.status==="in_progress")return {ready:true};let n=Ge(e);return n===null?{ready:false,reason:"not_open_yet"}:t<n-cr*6e4?{ready:false,reason:"not_open_yet"}:t>n+ur*6e4?{ready:false,reason:"consult_over"}:{ready:true}}o(pr,"televetJoinReadiness");function xt(e,t){let n=[],r=[];for(let i of e){let l=Ge(i);(qs.has(i.status)&&l!==null&&l+ur*6e4>t?n:r).push(i);}return n.sort((i,l)=>(Ge(i)??0)-(Ge(l)??0)),r.sort((i,l)=>(Ge(l)??0)-(Ge(i)??0)),Object.freeze({upcoming:Object.freeze(n),past:Object.freeze(r)})}o(xt,"splitTelevetVisits");function fr(e){return e==="scheduled"}o(fr,"canManageTelevetVisit");function kl(e){let t=cn(e);return t.enabled?t.isPending?"pending":t.isError||xt(t.data??[],Date.now()).upcoming.length>0?"visits":"booking":"booking"}o(kl,"useTelevetLanding");function vr(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let t of Object.keys(e))vr(e[t]);}return e}o(vr,"deepFreeze");var Ks=Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3}),Sl={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},Rl={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},Cl={nano:8,small:9,micro:10,tiny:11,caption:12,bodyTight:13,body:14,subtitle:16,heading:18,verdict:24},Ys={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},Gs={regular:"400",medium:"500",bold:"700"},Js={eyebrow:1,monoWide:.9,headerBrand:-0.42,tight:-0.35},Xs=0,un="System",pn="monospace",Qs=["content","heading","control","compact","badge"];function Zs(e){let t={};for(let n of Qs)t[n]=e;return t}o(Zs,"authoredTierSizes");function _l(){return {family:un,mono:pn,fontUrl:null,families:{regular:un,medium:un,bold:un,mono:pn,monoMedium:pn,monoBold:pn},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:Cl,tierSizes:Zs(Cl),lineHeight:Ys,weight:Gs,letterSpacing:Js,scale:1,maxScale:Xs,scaleCaps:Ks}}o(_l,"baseType");var xl={},yr=Object.freeze({standard:Object.freeze([.2,0,0,1]),emphasized:Object.freeze([.2,.8,.2,1]),exit:Object.freeze([.4,0,1,1])});function mr(e){return `cubic-bezier(${e.join(", ")})`}o(mr,"cssCubicBezier");var wl={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:mr(yr.standard),emphasized:mr(yr.emphasized),exit:mr(yr.exit)},reducedMotion:false},ed={brand:"#10462E",brandSoft:"rgba(16,70,46,0.10)",brandSofter:"rgba(16,70,46,0.15)",brandBorder:"rgba(16,70,46,0.18)",borderHairlineGreen:"rgba(16,70,46,0.25)",brandBorderStrong:"rgba(16,70,46,0.55)",brandInk:"#10462E",linkInk:"#10462E",surface:"#FFFFFF",surfaceCream:"#FDFBF8",surfaceSubtle:"#EFE9E3",background:"#FFFFFF",borderRingCream:"#D8D2C8",chatGround:"#FFFFFF",composerFill:"#FDFBF8",composerBorder:"rgba(16,70,46,0.75)",shadow:"#0B3421",text:{primary:"#111111",secondary:"#0E462E",muted:"#6E6660",placeholder:"rgba(61,61,61,0.75)",onBrand:"#FFFFFF",metaCool:"#3D3D3D",timestamp:"rgba(61,61,61,0.75)"},primary:"#10462E",onPrimary:"#FFFFFF",accent:"#10462E",onAccent:"#FFFFFF",accentEdge:"#07C168",success:"#07C168",danger:"#B91C1C",errorRed:"#FF1B00",warningStrong:"#A45610",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.12)",badgeBgCaution:"rgba(217,130,29,0.14)",badgeBgCritical:"rgba(185,28,28,0.12)",badgeBgNeutral:"rgba(110,102,96,0.12)",bubbleUser:"#10462E",bubbleAssistant:"#FFFFFF",skeleton:"#EFE9E3",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.10)",checkupCardConcernBg:"rgba(239,167,0,0.10)"},Pl=vr({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:ed,space:Sl,radius:Rl,type:_l(),motion:wl,slots:xl}),td={brand:"#6BD39A",brandSoft:"rgba(107,211,154,0.12)",brandSofter:"rgba(107,211,154,0.18)",brandBorder:"rgba(107,211,154,0.22)",borderHairlineGreen:"rgba(107,211,154,0.28)",brandBorderStrong:"rgba(107,211,154,0.55)",brandInk:"#6BD39A",linkInk:"#6BD39A",surface:"#1C1F23",surfaceCream:"#23272C",surfaceSubtle:"#23272C",background:"#15171A",borderRingCream:"#3A3F45",chatGround:"#1C1F23",composerFill:"#23272C",composerBorder:"rgba(107,211,154,0.75)",shadow:"#000000",text:{primary:"#F5F3F0",secondary:"#A9E4C4",muted:"#9A938C",placeholder:"rgba(255,255,255,0.55)",onBrand:"#0E1F17",metaCool:"#C9C9C9",timestamp:"rgba(245,243,240,0.7)"},primary:"#6BD39A",onPrimary:"#0E1F17",accent:"#6BD39A",onAccent:"#0E1F17",accentEdge:"#34D888",success:"#07C168",danger:"#F87171",errorRed:"#FF6B5B",warningStrong:"#F0A35E",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.18)",badgeBgCaution:"rgba(217,130,29,0.20)",badgeBgCritical:"rgba(185,28,28,0.22)",badgeBgNeutral:"rgba(255,255,255,0.10)",bubbleUser:"#6BD39A",bubbleAssistant:"#1C1F23",skeleton:"#23272C",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.16)",checkupCardConcernBg:"rgba(239,167,0,0.16)"};vr({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:td,space:Sl,radius:Rl,type:_l(),motion:wl,slots:xl});var Il=Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),Ol=globalThis,gr=Ol[Il]??(Ol[Il]=react.createContext(Pl));gr.displayName??="EverfurThemeContext";function S(){return react.useContext(gr)}o(S,"useEverfurTheme");function ad(e,t){let n=e.scaleCaps[t];return n>0?n:void 0}o(ad,"tierMultiplier");function v({tier:e="content",...t}){let{type:n}=S(),r=ad(n,e);return react.createElement(reactNative.Text,r===void 0?t:{maxFontSizeMultiplier:r,...t})}o(v,"Text");var Bl=react.forwardRef(o(function(t,n){return react.createElement(reactNative.TextInput,{...t,...n===null?{}:{ref:n}})},"TextInput"));var sd=Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});function b(e,t){let n=e.type,r=n.families[t];return t==="mono"||n.namedFaces[t]?{fontFamily:r}:{fontFamily:r,fontWeight:n.weight[sd[t]]}}o(b,"face");var Tr=class Tr extends react.Component{constructor(){super(...arguments);this.state={failed:false,key:this.props.resetKey};}static getDerivedStateFromError(){return {failed:true}}static getDerivedStateFromProps(n,r){return Object.is(n.resetKey,r.key)?null:{failed:false,key:n.resetKey}}render(){return this.state.failed?this.props.fallback:this.props.children}};o(Tr,"HostRenderBoundary");var br=Tr;function cd({render:e}){return e()}o(cd,"RenderHost");function hr({render:e,fallback:t,resetKey:n}){return react.createElement(br,{fallback:t,resetKey:n,children:react.createElement(cd,{render:e})})}o(hr,"HostRender");var ud=48;function pd(e){return e.isPending?"pending":e.enabled?"enabled":"disabled"}o(pd,"selectView");function Vl(e){let{capability:t,children:n,renderDisabled:r,renderPending:i,style:l}=e,a=Ct(t),s=react.useMemo(()=>pd(a),[a]);switch(s){case "enabled":return n;case "pending":return i?jsxRuntime.jsx(hr,{render:i,fallback:jsxRuntime.jsx(Nl,{capability:t,style:l})}):jsxRuntime.jsx(Nl,{capability:t,style:l});case "disabled":return r?jsxRuntime.jsx(hr,{render:()=>r(a),fallback:jsxRuntime.jsx(Ll,{decision:a,style:l}),resetKey:a}):jsxRuntime.jsx(Ll,{decision:a,style:l});default:return Gt(s)}}o(Vl,"CapabilityGate");function Nl({capability:e,style:t}){let n=S(),r=react.useMemo(()=>zl(n),[n]);return jsxRuntime.jsx(reactNative.View,{style:[r.offstate,t],accessible:true,accessibilityState:{busy:true},accessibilityLabel:`Loading ${e}`,children:jsxRuntime.jsx(reactNative.View,{style:r.skeletonBar})})}o(Nl,"PendingSkeleton");function Ll({decision:e,style:t}){let n=S(),r=react.useMemo(()=>zl(n),[n]),i=e.disabled?.reason??"";return jsxRuntime.jsx(reactNative.View,{style:[r.offstate,t],accessible:true,accessibilityRole:"text",accessibilityLabel:i,children:i.length>0?jsxRuntime.jsx(v,{style:r.offstateText,children:i}):null})}o(Ll,"OffState");function zl(e){let{color:t,space:n,radius:r,type:i}=e;return reactNative.StyleSheet.create({offstate:{minHeight:ud,justifyContent:"center",paddingHorizontal:n.lg,paddingVertical:n.md,backgroundColor:t.surfaceCream,borderRadius:r.md,borderWidth:reactNative.StyleSheet.hairlineWidth,borderColor:t.brandBorder},offstateText:{...b(e,"regular"),fontSize:i.size.body,lineHeight:Math.round(i.size.body*i.lineHeight.normal),color:t.text.muted},skeletonBar:{height:n.md,borderRadius:r.xs,backgroundColor:t.brandSofter}})}o(zl,"makeStyles");function fn(e){let t=e.raw;if(typeof t!="object"||t===null)return null;let n=t,r=n.detail??n.error;return typeof r=="object"&&r!==null?r:n}o(fn,"details");function fd(e){let t=fn(e)?.categories;return Array.isArray(t)?Object.freeze(t.filter(n=>typeof n=="string")):Object.freeze([])}o(fd,"categoriesOf");function Ml(e){let t=fn(e)?.retry_after_seconds;return typeof t=="number"&&Number.isFinite(t)&&t>0?t:null}o(Ml,"retryAfterOf");function jl(e){let t=e.wireMessage;if(typeof t=="string"&&t.trim().length>0)return t.trim();let n=fn(e)?.message;return typeof n=="string"&&n.trim().length>0?n.trim():null}o(jl,"messageOf");function yd(e){let t=e.reasonCode;if(typeof t=="string"&&t.length>0)return t;let n=fn(e),r=n?.code??n?.error_code;return typeof r=="string"&&r.length>0?r:null}o(yd,"codeOf");function Ve(e){let t=e.httpStatus;if(t===402)return Object.freeze({kind:"not_entitled"});if(t===429||e.code==="rateLimited"||e.code==="quotaExceeded")return Object.freeze({kind:"rate_limited",retryAfterSeconds:Ml(e),message:jl(e)});if(t===404)return Object.freeze({kind:"unavailable"});switch(yd(e)){case "televet_rate_limited":return Object.freeze({kind:"rate_limited",retryAfterSeconds:Ml(e),message:jl(e)});case "televet_emergency_ack_required":return Object.freeze({kind:"emergency",categories:fd(e)});case "televet_not_entitled":return Object.freeze({kind:"not_entitled"});case "televet_slot_conflict":return Object.freeze({kind:"slot_taken"});case "televet_hold_invalid":return Object.freeze({kind:"slot_taken"});case "televet_clinician_cannot_prescribe":case "televet_clinician_unavailable":case "televet_clinician_not_bookable":return Object.freeze({kind:"clinician_unavailable"});case "televet_membership_conflict":return Object.freeze({kind:"not_entitled"});case "televet_registry_unavailable":return Object.freeze({kind:"failed"});}return Object.freeze({kind:"failed"})}o(Ve,"televetBookingRefusal");function yn(e){for(let t=0;t<e.length;t+=1){let n=e.charCodeAt(t);if(n>=55296&&n<=56319){let r=e.charCodeAt(t+1);if(!(r>=56320&&r<=57343))return true;t+=1;}else if(n>=56320&&n<=57343)return true}return false}o(yn,"hasLoneSurrogate");function mn(e){return [...e].length}o(mn,"serverLength");var Hl=Object.freeze({dog:"dog",canine:"dog",k9:"dog",puppy:"dog",cat:"cat",feline:"cat",kitten:"cat"});function Ul(e){if(typeof e!="string")return null;let t=e.trim().toLowerCase();return Object.prototype.hasOwnProperty.call(Hl,t)?Hl[t]:null}o(Ul,"canonicalPetSpecies");var Wl=50,md=128,Cr=120,ql=120,vd=2e3,$l=120,gd=80,Gl=new Set(["male","female","unknown"]),Jl=new Set(["day","month","year"]),Xl=new Set(["low","medium","high","athletic"]),Ql=new Set(["indoor","outdoor","both"]),Zl=new Set(["mild","moderate","severe"]),bd=/^(\d{4})-(\d{2})-(\d{2})$/,ei=[["sex","sex"],["spayedNeutered","spayed_neutered"],["birthDate","birth_date"],["birthDatePrecision","birth_date_precision"],["activityLevel","activity_level"],["indoorOutdoor","indoor_outdoor"],["foodBrand","food_brand"],["foodType","food_type"],["microchipId","microchip_id"]],ti=[["allergies","allergies"],["medications","medications"],["supplements","supplements"],["conditions","conditions"]];Object.freeze([...ei,...ti].map(([e])=>e));function hd(e){let t=bd.exec(e);if(t===null)return false;let[n,r,i]=[Number(t[1]),Number(t[2]),Number(t[3])],l=new Date(Date.UTC(n,r-1,i));return l.getUTCFullYear()===n&&l.getUTCMonth()===r-1&&l.getUTCDate()===i}o(hd,"isRealDate");var Pt=o(e=>(t,n)=>typeof n=="string"&&e.has(n)?null:`${t} must be one of ${[...e].join(", ")}`,"oneOf"),Td=o((e,t)=>typeof t=="boolean"?null:`${e} must be true or false`,"boolean"),gn=o((e,t)=>typeof t=="string"&&hd(t)?null:`${e} must be a real date written YYYY-MM-DD`,"date"),ge=o((e,t={})=>(n,r)=>{if(typeof r!="string")return `${n} must be a string`;if(yn(r))return `${n} contains an unpaired surrogate and cannot be encoded`;let i=t.trimmed?r.trim():r;if(t.required&&i.length===0)return `${n} is required and must not be blank`;let l=mn(i);return l<=e?null:`${n} is ${l} characters; the server accepts at most ${e}`},"text"),Ed={sex:Pt(Gl),spayedNeutered:Td,birthDate:gn,birthDatePrecision:Pt(Jl),activityLevel:Pt(Xl),indoorOutdoor:Pt(Ql),foodBrand:ge($l),foodType:ge($l),microchipId:ge(gd)},Sr=["ref","ref",false,ge(md,{required:true,trimmed:true})],Rr=["notes","notes",false,ge(vd,{trimmed:true})],Kl=[Sr,["name","name",true,ge(Cr,{required:true,trimmed:true})],["dose","dose",false,ge(ql,{trimmed:true})],["frequency","frequency",false,ge(ql,{trimmed:true})],["startDate","start_date",false,gn],["endDate","end_date",false,gn],Rr],kd={allergies:[Sr,["allergen","allergen",true,ge(Cr,{required:true,trimmed:true})],["severity","severity",false,Pt(Zl)],Rr],medications:Kl,supplements:Kl,conditions:[Sr,["conditionName","condition_name",true,ge(Cr,{required:true,trimmed:true})],["diagnosedDate","diagnosed_date",false,gn],Rr]};function Cd(e,t,n){let r=`${e}[${t}]`;if(typeof n!="object"||n===null||Array.isArray(n))return {error:`${r} must be an object`};let i=n,l={};for(let[c,d,p,g]of kd[e]){let f=i[c];if(f==null){if(p)return {error:`${r}.${c} is required`};f===null&&(l[d]=null);continue}let y=g(`${r}.${c}`,f);if(y!==null)return {error:y};l[d]=f;}let a=l.start_date,s=l.end_date;return typeof a=="string"&&typeof s=="string"&&s<a?{error:`${r}.endDate must not be before startDate`}:{item:l}}o(Cd,"itemToWire");function Sd(e,t){if(!Array.isArray(t))return {error:`${e} must be an array (send [] to clear it)`};if(t.length>Wl)return {error:`${e} has ${t.length} items; the server accepts at most ${Wl}`};let n=[],r=new Set;for(let i=0;i<t.length;i+=1){let l=Cd(e,i,t[i]);if("error"in l)return l;let a=l.item.ref;if(typeof a=="string"){let s=a.trim();if(r.has(s))return {error:`${e}: ref ${JSON.stringify(s)} is used twice; a ref names one item`};r.add(s);}n.push(l.item);}return {items:n}}o(Sd,"listToWire");function ni(e,t){let n=e,r={};for(let[a,s]of ei){let c=n[a];if(c!==void 0){if(c!==null){let d=Ed[a](a,c);if(d!==null)return {error:d}}r[s]=c;}}let i=n.birthDate!==void 0,l=n.birthDatePrecision!==void 0;if(i!==l||i&&n.birthDate===null!=(n.birthDatePrecision===null))return {error:"birthDate and birthDatePrecision must be sent together, both set or both null"};for(let[a,s]of ti){let c=n[a];if(c===void 0)continue;let d=Sd(a,c);if("error"in d)return d;r[s]=d.items;}return Object.keys(r).length>0&&t!==void 0&&Ul(t)===null?{error:"health fields need a pet Everfur reads as a dog or a cat (dog, canine, k9, puppy, cat, feline, kitten)"}:{body:r}}o(ni,"petHealthToWire");var J=o(e=>typeof e=="string"?e:null,"str"),wt=o((e,t)=>typeof t=="string"&&e.has(t)?t:null,"pick"),Rd=o(e=>typeof e=="boolean"?e:null,"bool");function vn(e,t){return Array.isArray(e)?Object.freeze(e.flatMap(n=>{if(typeof n!="object"||n===null||Array.isArray(n))return [];let r=t(n);return r===null?[]:[r]})):Object.freeze([])}o(vn,"itemsFromWire");function Yl(e){let t=J(e.name);return t===null||t.length===0?null:Object.freeze({ref:J(e.ref),name:t,dose:J(e.dose),frequency:J(e.frequency),startDate:J(e.start_date),endDate:J(e.end_date),notes:J(e.notes)})}o(Yl,"medicationFromWire");function ri(e){let t=e.profile_version;return Object.freeze({profileVersion:typeof t=="number"&&Number.isInteger(t)&&t>=0?t:0,sex:wt(Gl,e.sex),spayedNeutered:Rd(e.spayed_neutered),birthDate:J(e.birth_date),birthDatePrecision:wt(Jl,e.birth_date_precision),activityLevel:wt(Xl,e.activity_level),indoorOutdoor:wt(Ql,e.indoor_outdoor),foodBrand:J(e.food_brand),foodType:J(e.food_type),microchipId:J(e.microchip_id),allergies:vn(e.allergies,n=>{let r=J(n.allergen);return r===null||r.length===0?null:Object.freeze({ref:J(n.ref),allergen:r,severity:wt(Zl,n.severity),notes:J(n.notes)})}),medications:vn(e.medications,Yl),supplements:vn(e.supplements,Yl),conditions:vn(e.conditions,n=>{let r=J(n.condition_name);return r===null||r.length===0?null:Object.freeze({ref:J(n.ref),conditionName:r,diagnosedDate:J(n.diagnosed_date),notes:J(n.notes)})})})}o(ri,"petHealthFromWire");var ii=100,ai=50,si=100,di=50,ci=500,_d=128,xd=6e4;function he(e){return ye("validationFailed",{retryable:false,wireMessage:e})}o(he,"invalid");function Je(e,t,n){if(typeof t!="string")return he(`${e} must be a string`);let r=mn(t);return r<=n?null:he(`${e} is ${r} characters; the server accepts at most ${n}`)}o(Je,"checkString");function bn(e,t,n){return typeof t=="number"&&Number.isFinite(t)&&t>=0&&t<=n?null:he(`${e} must be a finite number between 0 and ${n}`)}o(bn,"outOfRange");function oi(e,t){if(typeof e!="string")return he("pet_ref must be a string");if(e.trim().length===0)return he("pet_ref must not be blank");if(yn(e))return he("pet_ref contains an unpaired surrogate and cannot be encoded");if(t!=null&&typeof t!="object")return he("profile must be an object");let n=[Je("pet_ref",e,_d)];return t?.name!==void 0&&n.push(Je("name",t.name,ii)),t?.species!==void 0&&n.push(Je("species",t.species,ai)),t?.breed!==void 0&&n.push(Je("breed",t.breed,si)),t?.ageYears!==void 0&&n.push(bn("age_years",t.ageYears,di)),t?.weightKg!==void 0&&n.push(bn("weight_kg",t.weightKg,ci)),n.find(r=>r!==null)??null}o(oi,"validate");function ui(e,t){let n=ni(e,t);return "error"in n?{error:he(n.error)}:n}o(ui,"healthToWire");function wd(e){if(typeof e!="object"||e===null)return {error:he("patch must be an object")};let t=e,n=[["name","name",l=>Je("name",l,ii)],["species","species",l=>Je("species",l,ai)],["breed","breed",l=>Je("breed",l,si)],["ageYears","age_years",l=>bn("age_years",l,di)],["weightKg","weight_kg",l=>bn("weight_kg",l,ci)]],r={};for(let[l,a,s]of n){let c=t[l];if(c!==void 0){if(c!==null){let d=s(c);if(d!==null)return {error:d}}r[a]=c;}}let i=ui(t,t.species);return "error"in i?i:(Object.assign(r,i.body),Object.keys(r).length===0?{error:he("patch must change at least one field")}:{body:r})}o(wd,"patchToWire");function Pd(e){if(e==null)return {body:{}};let t=ui(e,e.species);return "error"in t?t:{body:{...e.name!==void 0?{name:e.name}:{},...e.species!==void 0?{species:e.species}:{},...e.breed!==void 0?{breed:e.breed}:{},...e.ageYears!==void 0?{age_years:e.ageYears}:{},...e.weightKg!==void 0?{weight_kg:e.weightKg}:{},...t.body}}}o(Pd,"toWire");var be=o(e=>typeof e=="string"?e:null,"str"),hn=o(e=>typeof e=="number"&&Number.isFinite(e)?e:null,"num");function li(e,t){let n=typeof e=="object"&&e!==null?e:{};return Object.freeze({petRef:be(n.pet_ref)??t,name:be(n.name),species:be(n.species),breed:be(n.breed),ageYears:hn(n.age_years),weightKg:hn(n.weight_kg)})}o(li,"fromWire");function pi(e){if(typeof e!="object"||e===null)return null;let t=e,n=be(t.pet_ref);return n===null||n.length===0?null:Object.freeze({petId:be(t.pet_id),petRef:n,name:be(t.name),species:be(t.species),breed:be(t.breed),ageYears:hn(t.age_years),weightKg:hn(t.weight_kg),updatedAt:be(t.updated_at)})}o(pi,"widgetPetFromWire");function Id(e){let t=pi(e);return t===null?null:Object.freeze({...t,...ri(e)})}o(Id,"widgetPetProfileFromWire");function Od(e){let t=Array.isArray(e)?e:typeof e=="object"&&e!==null&&Array.isArray(e.pets)?e.pets:[];return Object.freeze(t.flatMap(n=>{let r=pi(n);return r===null?[]:[r]}))}o(Od,"petListFromWire");function fi(e){return Ad(Tt({auth:e}),Tt({auth:e,unaryTimeoutMs:xd}))}o(fi,"createPetsRepository");function Ad(e,t=e){let n=o((i,l)=>l?{...i,signal:l}:i,"withSignal"),r=o(i=>oi(i,void 0)??`/widget/v1/pets/${encodeURIComponent(i)}`,"petPath");return {async list(i){let l=await e.send("pets.list",n({method:"GET",path:"/widget/v1/pets"},i?.signal));return l.ok?L(Od(l.value)):w(l.error)},async registerPet(i,l,a){let s=oi(i,l);if(s!==null)return w(s);let c=Pd(l);if("error"in c)return w(c.error);let p={method:"POST",path:`/widget/v1/pets/${encodeURIComponent(i)}`,body:c.body},g=await e.send("pets.registerPet",a?.signal?{...p,signal:a.signal}:p);return g.ok?L(li(g.value,i)):w(g.error)},async updatePet(i,l,a){let s=r(i);if(typeof s!="string")return w(s);let c=wd(l);if("error"in c)return w(c.error);let d=await e.send("pets.updatePet",n({method:"PATCH",path:s,body:c.body},a?.signal));return d.ok?L(li(d.value,i)):w(d.error)},async getPetProfile(i,l){let a=r(i);if(typeof a!="string")return w(a);let s=await e.send("pets.getPetProfile",n({method:"GET",path:`${a}/profile`},l?.signal));if(!s.ok)return w(s.error);let c=Id(s.value);return c===null?w(ye("internalError",{retryable:false,httpStatus:502,wireMessage:"the pet profile response carried no pet_ref"})):L(c)},async deletePet(i,l){let a=r(i);if(typeof a!="string")return w(a);let s=await e.send("pets.deletePet",n({method:"DELETE",path:a},l?.signal));return s.ok?L(void 0):w(s.error)},async eraseUserData(i){let l=await t.send("pets.eraseUserData",n({method:"DELETE",path:"/widget/v1/me"},i?.signal),{maxAttempts:1});return l.ok?L(void 0):w(l.error)}}}o(Ad,"createPetsRepositoryOver");function it(){let{runtime:e,userRef:t,activePet:n,scopeEpoch:r}=Ye(),i=react.useMemo(()=>fi(e.registry.services.authFor(t)),[e,t,r]),[l,a]=react.useState({repository:i,pets:[],loading:true,error:null}),s=l.repository===i?l:{pets:[],loading:true,error:null},c=react.useRef(0),d=react.useCallback(async()=>{let g=++c.current;a(y=>({...y,repository:i,loading:true,error:null,pets:y.repository===i?y.pets:[]}));let f=await i.list();g===c.current&&a(f.ok?{repository:i,pets:f.value,loading:false,error:null}:y=>({repository:i,pets:y.repository===i?y.pets:[],loading:false,error:f.error}));},[i]);react.useEffect(()=>(d(),()=>{c.current+=1;}),[d]);let p=react.useMemo(()=>n===null?null:s.pets.find(g=>g.petRef===n)??null,[n,s.pets]);return react.useMemo(()=>({pets:s.pets,activePet:p,loading:s.loading,error:s.error,refresh:d}),[s.pets,s.loading,s.error,p,d])}o(it,"useEverfurPets");var ze=Object.freeze(["pet","issues","reason","clinician","time","review","booked"]),yi=Object.freeze({petId:null,state:null,clinicianId:null,slot:null,holdExpiresAt:null,shareHealthRecords:false,idempotencyKey:null});function wr(e,t={}){let n=Object.freeze({...yi,...t}),r=xr(0,e);return Object.freeze({index:r,draft:n,furthestIndex:r})}o(wr,"initialTelevetBookingState");function Tn(e,t){return e==="pet"?t.ownedPetCount<=1:e==="issues"?t.withIssues!==true:false}o(Tn,"isSkipped");function En(e){return ze[e]}o(En,"stepAt");function xr(e,t){for(let n=e;n<ze.length;n+=1){let r=En(n);if(r&&!Tn(r,t))return n}return ze.length-1}o(xr,"nextVisible");function mi(e,t){for(let n=e;n>=0;n-=1){let r=En(n);if(r&&!Tn(r,t))return n}return null}o(mi,"previousVisible");function Pr(e,t){return mi(e.index-1,t)!==null}o(Pr,"hasPreviousStep");function Ir(e,t,n){switch(t.type){case "patch":{let r={...e.draft,...t.patch};return ("petId"in t.patch&&t.patch.petId!==e.draft.petId||"state"in t.patch&&t.patch.state!==e.draft.state||"clinicianId"in t.patch&&t.patch.clinicianId!==e.draft.clinicianId)&&e.draft.slot?Object.freeze({...e,draft:Object.freeze({...r,slot:null,holdExpiresAt:null,idempotencyKey:null})}):Object.freeze({...e,draft:Object.freeze(r)})}case "next":{let r=xr(e.index+1,n);return Object.freeze({...e,index:r,furthestIndex:Math.max(e.furthestIndex,r)})}case "back":{if(En(e.index)==="booked")return e;let r=mi(e.index-1,n);return r===null?e:Object.freeze({...e,index:r})}case "goTo":{let r=ze.indexOf(t.step);if(r<0)return e;let i=Tn(t.step,n)?xr(r,n):r;return Object.freeze({...e,index:i,furthestIndex:Math.max(e.furthestIndex,i)})}default:return e}}o(Ir,"televetBookingReducer");function Or(e){return En(e.index)??"pet"}o(Or,"currentStep");function It(e,t){let n=t.trim();return !!e.petId&&!!e.clinicianId&&!!e.slot&&me(e.state)&&n.length>0&&n.length<=_e}o(It,"canConfirm");function Ar(e,t){if(!e.holdExpiresAt)return false;let n=Date.parse(e.holdExpiresAt);return Number.isNaN(n)?false:n<=t}o(Ar,"isHoldExpired");function Br(e){return `televet.book.${e}`}o(Br,"televetBookingKey");function Dr(e,t,n){let r=n?.version?.trim()??"";return !e||!t||r.length===0?Object.freeze({}):Object.freeze({state_attested:true,cancellation_policy_version:r})}o(Dr,"attestation");function xe(e){let t=new Date(e);return Number.isNaN(t.getTime())?null:t}o(xe,"parse");function Xe(e){let t=xe(e);return t?t.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"}):""}o(Xe,"formatClock");function Ld(e){let t=xe(e);return t?t.toLocaleDateString(void 0,{month:"long",day:"numeric"}):""}o(Ld,"formatDate");var at=10;function st(e){let t=xe(e);return t?new Intl.DateTimeFormat(void 0,{timeZoneName:"short"}).formatToParts(t).find(r=>r.type==="timeZoneName")?.value??"":""}o(st,"formatZone");function Vd(e){let t=xe(e);if(!t)return "";let n=new Date(t.getTime()+at*6e4).toISOString(),r=st(e),i=`${Xe(e)} - ${Xe(n)}`;return r&&r!==""?`${i} ${r}`:i}o(Vd,"formatVisitRange");function vi(e){let t=Ld(e),n=[Xe(e),st(e)].filter(Boolean).join(" ");return [t,n].filter(Boolean).join(", ")}o(vi,"formatWhen");function pe(e){let t=xe(e);return t?[t.toLocaleDateString(void 0,{weekday:"short"}),vi(e)].filter(Boolean).join(", "):""}o(pe,"formatWhenWithDay");function gi(e){let t=xe(e);if(!t)return "";let n=t.toLocaleDateString(void 0,{weekday:"short"}),r=t.toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"}),i=[Xe(e),st(e)].filter(Boolean).join(" ");return [n,r,i].filter(Boolean).join(", ")}o(gi,"formatRecordWhen");function kn(e){let t=xe(e);return t?`${t.getFullYear()}-${t.getMonth()+1}-${t.getDate()}`:"unknown"}o(kn,"localDayKey");function bi(e){let t=xe(e);return t===null?"":t.toLocaleDateString(void 0,{month:"long"})}o(bi,"formatMonthLabel");function hi(e){let t=xe(e);return t===null?"":t.toLocaleDateString(void 0,{weekday:"long",month:"long",day:"numeric"})}o(hi,"formatFullDayLabel");function Ei(e){let{draft:t,reasonText:n,book:r,stateAttested:i,termsAttested:l,cancellationPolicy:a,triage:s,goTo:c,setFailure:d,setRateLimitMessage:p,setEmergency:g,setBookedConsult:f,onBooked:y}=e,E=react.useCallback(P=>{if(!(!It(t,n)||!t.idempotencyKey)){if(Ar(t,Date.now())){d("expired"),c("time");return}d(null),g(null),r.mutate({pet_id:t.petId,clinician_id:t.clinicianId,slot_id:t.slot.slotId,state:t.state,reason_text:n.trim(),species:null,media_refs:[],emergency_acknowledged:P||s.isAcknowledged(n),share_health_records:t.shareHealthRecords,...Dr(i,l,a)},t.idempotencyKey,{onSuccess:o(h=>{f(h),c("booked"),y?.(h);},"onSuccess"),onError:o(h=>{let T=Ve(h);if(T.kind==="emergency"){g(T.categories);return}if(T.kind==="rate_limited"){p(T.message),d("rate_limited");return}d(T.kind==="not_entitled"?"not_entitled":T.kind==="slot_taken"?"taken":T.kind==="clinician_unavailable"?"clinician_unavailable":T.kind==="unavailable"?"unavailable":"failed"),T.kind==="slot_taken"&&c("time");},"onError")});}},[t,n,r,i,l,a,s,c,d,p,g,f,y]),_=react.useCallback(()=>E(false),[E]);return {submitBooking:E,confirm:_}}o(Ei,"useBookingSubmit");function Lr(e){let[t,n]=react.useState(false),[r,i]=react.useState(false),[l,a]=react.useState(null),s=react.useRef(null),c=react.useRef(null),d=react.useRef(true);react.useEffect(()=>(d.current=true,()=>{d.current=false,c.current?.abort(),c.current=null;}),[]);let p=react.useCallback(()=>{c.current?.abort(),c.current=null,d.current&&i(false);},[]),g=react.useCallback(async P=>{if(c.current!==null)return false;let h=P.trim();if(l!==null&&l===h||!e)return true;let T=s.current!==null&&s.current.reason===h?s.current.emergency:null;if(T===null){let R=new AbortController;c.current=R,i(true);try{let O=await e(h,R.signal);if(R.signal.aborted||!d.current)return !1;O===null?T=!1:(T=O.isEmergency||O.fallback,s.current=Object.freeze({reason:h,emergency:T}));}catch{if(R.signal.aborted||!d.current)return false;T=false;}finally{c.current===R&&(c.current=null,d.current&&i(false));}}return T===true?(n(true),false):true},[l,e]),f=react.useCallback(P=>{a(P.trim()),n(false);},[]),y=react.useCallback(()=>n(false),[]),E=react.useCallback(()=>{p(),s.current=null,a(null),n(false);},[p]),_=react.useCallback(P=>l!==null&&l===P.trim(),[l]);return {open:t,checking:r,check:g,acknowledge:f,close:y,cancel:p,reset:E,isAcknowledged:_}}o(Lr,"useEarlyTriage");function Ud(e){let t=e?.trim().toUpperCase()??"";return /^[A-Z]{2}$/.test(t)?t:null}o(Ud,"normalizeStateCode");function Vr(e,t){let n=Ud(e),[r,i]=react.useState(()=>Object.freeze({})),l=react.useRef(0),a=react.useRef(null),s=react.useCallback(c=>{if(!t||n===null)return null;let d=`${n}:${c}`;a.current!==null&&a.current!==d&&(l.current+=1),a.current=d;let p=r[d]??"idle";return {joined:p==="joined",pending:p==="pending",failed:p==="failed",onPress:o(()=>{if(p==="pending"||p==="joined")return;let g=l.current+=1;i(f=>Object.freeze({...f,[d]:"pending"})),(async()=>{let f=false;try{f=await t(n,c);}catch{f=false;}l.current===g&&i(y=>Object.freeze({...y,[d]:f?"joined":"failed"}));})();},"onPress")}},[n,r,t]);return react.useMemo(()=>({actionFor:s}),[s])}o(Vr,"useStateInterest");function zr(e){return Object.freeze(e==="dark"?{title:u.noCliniciansTitle,message:u.noCliniciansBody,retryLabel:u.noCliniciansRetryCta,interestReason:null}:{title:u.noCliniciansTitle,message:u.noCliniciansRegionBody,retryLabel:null,interestReason:"no_licensed_vet"})}o(zr,"televetEmptyRosterView");function Mr(e){return e?"roster":"dark"}o(Mr,"televetEmptyRosterCause");var Ot=Object.freeze({failed:0,refused:Object.freeze({size:0,type:0,unreadable:0})});function jr(e){let{failed:t,refused:n}=e;return t<=0&&n.size<=0&&n.type<=0&&n.unreadable<=0}o(jr,"isMediaShortfallEmpty");function Hr(e){let t=o(r=>Number.isFinite(r)&&r>0?Math.floor(r):0,"count"),n=u.media;return [{n:t(e.failed),one:n.droppedTemplate,many:n.droppedPluralTemplate},{n:t(e.refused.size),one:n.refusedSizeTemplate,many:n.refusedSizePluralTemplate},{n:t(e.refused.type),one:n.refusedTypeTemplate,many:n.refusedTypePluralTemplate},{n:t(e.refused.unreadable),one:n.refusedUnreadableTemplate,many:n.refusedUnreadablePluralTemplate}].filter(r=>r.n>0).map(r=>ne(r.n===1?r.one:r.many,{n:String(r.n)}))}o(Hr,"televetMediaShortfallLines");function Cn(e){let t=Number.isFinite(e)&&e>0?Math.floor(e):0;return t===0?Ot:Object.freeze({failed:t,refused:Ot.refused})}o(Cn,"mediaShortfallFromUnsentPicks");function Wd(e,t){let n=Cn(t);return n.failed===0?e:Object.freeze({failed:e.failed+n.failed,refused:e.refused})}o(Wd,"withUnsentPicks");var X=44;function V(){let e=S();return react.useMemo(()=>Gd(e),[e])}o(V,"useBookingStyles");function A({label:e,onPress:t,kind:n="primary",disabled:r=false,loading:i=false,fullWidth:l=true,accessibilityLabel:a,testID:s,style:c}){let d=V(),p=S(),g=r||i;return jsxRuntime.jsxs(reactNative.Pressable,{onPress:t,disabled:g,accessibilityRole:"button",accessibilityLabel:a??e,accessibilityState:{disabled:g,busy:i},style:[d.button,n==="primary"?d.buttonPrimary:n==="danger"?d.buttonDanger:d.buttonSecondary,l?d.buttonFull:d.buttonAuto,g?d.buttonDisabled:null,c],testID:s,children:[i?jsxRuntime.jsx(reactNative.ActivityIndicator,{size:"small",color:n==="secondary"?p.color.brand:p.color.onPrimary}):null,jsxRuntime.jsx(v,{tier:"control",style:n==="secondary"?d.buttonSecondaryLabel:d.buttonPrimaryLabel,children:e})]})}o(A,"TelevetButton");function F({title:e,message:t,actionLabel:n,onAction:r,testID:i}){let l=V(),a=typeof n=="string"&&n.length>0&&typeof r=="function";return jsxRuntime.jsxs(reactNative.View,{style:l.stateCard,testID:i,children:[jsxRuntime.jsx(v,{style:l.stateTitle,accessibilityRole:"header",children:e}),t?jsxRuntime.jsx(v,{style:l.stateMessage,children:t}):null,a?jsxRuntime.jsx(A,{label:n,onPress:r,kind:"secondary",fullWidth:false}):null]})}o(F,"TelevetStateCard");function ee({height:e,width:t="100%",testID:n}){let r=V();return jsxRuntime.jsx(reactNative.View,{style:[r.skeleton,{height:e,width:t}],testID:n,accessibilityElementsHidden:true,importantForAccessibility:"no"})}o(ee,"TelevetSkeletonBlock");function $({message:e,assertive:t=false,testID:n,style:r}){let i=V();return jsxRuntime.jsx(v,{style:[i.failure,r],accessibilityLiveRegion:t?"assertive":"polite",testID:n,children:e})}o($,"TelevetFailureLine");function Gd(e){let{color:t,space:n,radius:r,type:i}=e,{size:l,lineHeight:a}=i;return reactNative.StyleSheet.create({screen:{flex:1,paddingHorizontal:n.xl,gap:n.md},stepFill:{flex:1,minHeight:0,gap:n.md},list:{gap:n.sm},button:{minHeight:X,flexDirection:"row",alignItems:"center",justifyContent:"center",gap:n.sm,paddingHorizontal:n.xl,paddingVertical:n.sm,borderRadius:r.pill},buttonFull:{alignSelf:"stretch"},buttonAuto:{alignSelf:"flex-start",minWidth:X},buttonPrimary:{backgroundColor:t.primary},buttonSecondary:{borderWidth:1,borderColor:t.brandBorder,backgroundColor:"transparent"},buttonDanger:{backgroundColor:t.danger},buttonDisabled:{opacity:.45},buttonPrimaryLabel:{...b(e,"medium"),color:t.onPrimary,fontSize:l.body,lineHeight:l.body*a.snug},buttonSecondaryLabel:{...b(e,"medium"),color:t.brand,fontSize:l.body,lineHeight:l.body*a.snug},stateCard:{minHeight:140,justifyContent:"center",gap:n.sm,padding:n.lg,borderRadius:r.lg,borderWidth:1,borderColor:t.brandBorder},stateTitle:{...b(e,"medium"),color:t.brand,fontSize:l.subtitle,lineHeight:l.subtitle*a.snug},stateMessage:{...b(e,"regular"),color:t.text.metaCool,fontSize:l.body,lineHeight:l.body*a.normal},skeleton:{borderRadius:r.md,backgroundColor:t.skeleton},failure:{...b(e,"regular"),color:t.danger,fontSize:l.caption,lineHeight:l.caption*a.normal},stepTitle:{...b(e,"bold"),color:t.brand,fontSize:l.heading,lineHeight:l.heading*a.snug},stepHelp:{...b(e,"regular"),color:t.text.metaCool,fontSize:l.body,lineHeight:l.body*a.normal},divider:{height:1,backgroundColor:t.brandBorder},scrollRoot:{flex:1,minHeight:0},scrollBody:{flex:1},scrollFooter:{paddingTop:n.md,paddingBottom:n.lg}})}o(Gd,"makeBookingStyles");function At({petName:e,primaryVet:t,onFindEmergencyVet:n}){let r=S(),i=react.useMemo(()=>xi(r),[r]),l=e?.trim()??"";return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[n?jsxRuntime.jsx(reactNative.Pressable,{accessibilityRole:"button",accessibilityLabel:u.emergency.exitFindErTitle,onPress:()=>{Jt(n);},style:i.vetCard,testID:"televet-emergency-find-vet",children:jsxRuntime.jsx(reactNative.View,{style:i.vetRow,children:jsxRuntime.jsx(v,{tier:"control",style:i.vetTitle,children:u.emergency.exitFindErTitle})})}):null,t!=null&&l.length>0?jsxRuntime.jsx(Jd,{petName:l,vet:t}):null]})}o(At,"TelevetEmergencyExits");function Jd({petName:e,vet:t}){let n=S(),r=react.useMemo(()=>xi(n),[n]),i=ne(u.emergency.exitPrimaryVetTitle,{petName:e}),l=t.detail?.trim()??"",a=jsxRuntime.jsx(reactNative.View,{style:r.vetRow,children:jsxRuntime.jsxs(reactNative.View,{style:r.vetText,children:[jsxRuntime.jsx(v,{tier:"control",style:r.vetTitle,children:i}),l.length>0?jsxRuntime.jsx(v,{style:r.vetDetail,children:l}):null]})});if(!t.dial)return jsxRuntime.jsx(reactNative.View,{style:r.vetCard,testID:"televet-early-emergency-primary-vet",children:a});let s=t.dial;return jsxRuntime.jsx(reactNative.Pressable,{accessibilityRole:"link",accessibilityLabel:l.length>0?`${i}, ${l}`:i,accessibilityHint:u.emergency.startCallHint,onPress:()=>{Jt(s);},style:r.vetCard,testID:"televet-early-emergency-primary-vet-call",children:a})}o(Jd,"PrimaryVetCard");function xi(e){let{color:t,space:n,radius:r,type:i}=e,{size:l,lineHeight:a}=i;return {vetCard:{minHeight:X,justifyContent:"center",padding:n.lg,borderRadius:r.lg,borderWidth:1,borderColor:t.brandBorder,backgroundColor:t.surface},vetRow:{flexDirection:"row",alignItems:"center",gap:n.sm},vetText:{flexShrink:1,gap:n.xs},vetTitle:{...b(e,"medium"),color:t.text.primary,fontSize:l.body,lineHeight:l.body*a.normal},vetDetail:{...b(e,"regular"),color:t.text.metaCool,fontSize:l.caption,lineHeight:l.caption*a.normal}}}o(xi,"makeExitStyles");function Ii({petName:e,primaryVet:t,onFindEmergencyVet:n,onContinue:r}){let i=S(),l=V(),a=react.useMemo(()=>$r(i),[i]);return jsxRuntime.jsxs(reactNative.View,{style:[l.stepFill,a.emergencyPanel],testID:"televet-early-emergency",children:[jsxRuntime.jsx(v,{tier:"heading",accessibilityRole:"header",accessibilityLiveRegion:"assertive",style:a.emergencyTitle,children:u.emergency.bannerTitle}),jsxRuntime.jsx(v,{style:a.emergencyLede,children:u.emergency.lede}),jsxRuntime.jsx(At,{petName:e,primaryVet:t,onFindEmergencyVet:n}),jsxRuntime.jsx(A,{label:u.emergency.keepBookingCta,kind:"secondary",onPress:r,testID:"televet-early-emergency-continue"})]})}o(Ii,"TelevetEarlyEmergency");function Wr({action:e,testIDPrefix:t}){let n=S(),r=react.useMemo(()=>$r(n),[n]);return e===null?null:e.joined?jsxRuntime.jsxs(reactNative.View,{testID:`${t}-joined`,style:r.interestFeedback,children:[jsxRuntime.jsx(v,{tier:"control",accessibilityRole:"header",children:u.stateInterest.joinedTitle}),jsxRuntime.jsx(v,{style:r.interestBody,children:u.stateInterest.joinedBody})]}):jsxRuntime.jsxs(reactNative.View,{testID:t,style:r.interestAction,children:[jsxRuntime.jsx(A,{label:u.stateInterest.cta,kind:"secondary",loading:e.pending,disabled:e.pending,onPress:e.onPress,testID:`${t}-submit`}),e.failed?jsxRuntime.jsx($,{message:u.stateInterest.failed,testID:`${t}-error`}):null]})}o(Wr,"TelevetStateInterestAction");function Oi({cause:e,onRetry:t,stateInterest:n=null}){let r=zr(e);return jsxRuntime.jsxs(reactNative.View,{testID:"televet-clinicians-empty",children:[jsxRuntime.jsx(F,{title:r.title,message:r.message,...r.retryLabel!==null&&t?{actionLabel:r.retryLabel,onAction:t}:{}}),r.interestReason!==null?jsxRuntime.jsx(Wr,{action:n??null,testIDPrefix:"televet-state-interest-no-licensed-vet"}):null]})}o(Oi,"TelevetClinicianEmptyState");function qr({onCheckAvailability:e}){let t=V();return jsxRuntime.jsxs(reactNative.View,{testID:"televet-booking-not-entitled",style:t.list,children:[jsxRuntime.jsx(F,{title:u.confirmNotEntitled}),e?jsxRuntime.jsx(A,{label:u.checkAvailabilityCta,kind:"secondary",onPress:e,testID:"televet-check-state-availability"}):null]})}o(qr,"TelevetEntitlementInterestState");function Bt({shortfall:e,testIDPrefix:t}){let n=S(),r=react.useMemo(()=>$r(n),[n]);if(jr(e))return null;let i=Hr(e);return i.length===0?null:jsxRuntime.jsx(reactNative.View,{style:r.mediaNotice,testID:`${t}-media-notice`,children:i.map((l,a)=>jsxRuntime.jsx(v,{style:r.mediaLine,accessibilityLiveRegion:"polite",testID:`${t}-media-line-${String(a)}`,children:l},l))})}o(Bt,"TelevetMediaDropNotice");function $r(e){let{color:t,space:n,radius:r,type:i}=e,{size:l,lineHeight:a}=i;return {emergencyPanel:{gap:n.sm,padding:n.lg,borderRadius:r.lg,borderWidth:2,borderColor:t.danger,backgroundColor:t.surface},emergencyTitle:{...b(e,"medium"),color:t.danger,fontSize:l.heading,lineHeight:l.heading*a.snug},emergencyLede:{...b(e,"regular"),color:t.text.primary,fontSize:l.subtitle,lineHeight:l.subtitle*a.normal},interestAction:{gap:n.sm,marginTop:n.sm},interestFeedback:{gap:n.xs,marginTop:n.sm},interestBody:{...b(e,"regular"),color:t.text.metaCool},mediaNotice:{gap:n.xs},mediaLine:{...b(e,"regular"),color:t.text.metaCool,fontSize:l.caption,lineHeight:l.caption*a.normal}}}o($r,"makeEdgeStyles");function Ai(e){let{surfaceUnavailable:t,notEntitled:n,policyBlocked:r,triageOpen:i,step:l}=e;return t||n&&l!=="clinician"||r?true:l==="reason"&&i}o(Ai,"televetBookingGateApplies");function Bi({state:e,petName:t,primaryVet:n,onFindEmergencyVet:r,stateInterest:i=null,onCheckAvailability:l,onAcknowledgeEmergency:a,renderUnavailable:s}){let c=V(),{surfaceUnavailable:d,notEntitled:p,policyBlocked:g,triageOpen:f,step:y}=e;return d?jsxRuntime.jsx(reactNative.View,{style:c.stepFill,testID:"televet-booking-unavailable",children:s?s():jsxRuntime.jsx(F,{title:u.bookingPausedTitle})}):p&&y!=="clinician"?jsxRuntime.jsx(qr,{...l?{onCheckAvailability:l}:{}}):g?jsxRuntime.jsxs(reactNative.View,{testID:"televet-booking-state-blocked",children:[jsxRuntime.jsx(F,{title:u.stateBlockedTitle}),jsxRuntime.jsx(Wr,{action:i,testIDPrefix:"televet-state-interest-state-blocked"})]}):y==="reason"&&f?jsxRuntime.jsx(Ii,{...t!==void 0?{petName:t}:{},...n?{primaryVet:n}:{},onFindEmergencyVet:r,onContinue:a}):null}o(Bi,"TelevetBookingGate");var Pi=false;function Zd(){if(!Pi){Pi=true;try{globalThis.console?.warn?.("[everfur] The vet booking has no US state for this member, so it cannot list vets. Pass the member's two-letter state as `usState` (on EverfurTelevet, VetVisitButton or EverfurChat as `vetUsState`), or pass `onRequestLocation` so the booking can ask your app to resolve one. The SDK never reads a device location itself.");}catch{}}}o(Zd,"warnNoStateSeamOnce");function Di(e){return e.noState?true:e.isPending||e.isError?false:e.isEmpty||e.notEntitled}o(Di,"televetClinicianOutcomeApplies");function Fi({state:e,cause:t,locationStatus:n,onRequestLocation:r,onRetry:i,stateInterest:l=null}){let a=e.noState&&!r;return react.useEffect(()=>{a&&Zd();},[a]),e.noState?jsxRuntime.jsx(reactNative.View,{testID:"televet-booking-location-unknown",children:jsxRuntime.jsx(F,{title:n==="blocked"?u.locationBlockedTitle:n==="unavailable"?u.locationUnavailableTitle:u.locationUnknownTitle,message:n==="blocked"?u.locationBlockedBody:n==="unavailable"?u.locationUnavailableBody:r?u.locationUnknownBody:void 0,actionLabel:r?n==="blocked"?u.locationBlockedCta:u.locationUnknownCta:void 0,onAction:r})}):e.isEmpty?jsxRuntime.jsx(Oi,{cause:t,onRetry:i,stateInterest:l}):jsxRuntime.jsx(qr,{})}o(Fi,"TelevetClinicianOutcome");function Ni(e){return `televet-consult-${e}`}o(Ni,"televetConsultCalendarKey");function Yr({consult:e,petName:t,onDone:n,onAddToCalendar:r,canJoinInApp:i=false}){let l=S(),a=V(),s=react.useMemo(()=>rc(l),[l]),[c,d]=react.useState("idle"),p=o(async()=>{if(!r)return;d("saving");let f=new Date(e.scheduledAt);if(Number.isNaN(f.getTime())){d("failed");return}let y=await Xt(r,{key:Ni(e.consultId),title:u.visit.title,startDate:f,endDate:new Date(f.getTime()+at*6e4),alarmOffsetMinutes:-30});d(y.ok&&y.value===true?"saved":"failed");},"addToCalendar"),g=[u.booked.remindPromise,ne(u.booked.summaryPromise,{pet:t??""}),...i?[u.booked.joinPromise]:[]];return Se()?jsxRuntime.jsxs(reactNative.View,{style:s.screen,testID:"televet-booked",children:[jsxRuntime.jsx(reactNative.View,{style:s.header,children:jsxRuntime.jsx(A,{label:u.doneCta,kind:"secondary",fullWidth:false,onPress:n,testID:"televet-booked-done"})}),jsxRuntime.jsx(reactNative.View,{style:s.avatar,accessibilityElementsHidden:true,importantForAccessibility:"no"}),jsxRuntime.jsx(v,{tier:"heading",style:s.title,accessibilityRole:"header",children:u.bookedTitle}),jsxRuntime.jsx(v,{style:s.when,children:pe(e.scheduledAt)}),jsxRuntime.jsx(reactNative.View,{style:s.steps,testID:"televet-booked-steps",children:g.map((f,y)=>jsxRuntime.jsxs(reactNative.View,{style:s.step,children:[jsxRuntime.jsx(reactNative.View,{style:s.stepNumber,accessibilityElementsHidden:true,importantForAccessibility:"no",children:jsxRuntime.jsx(v,{tier:"badge",style:s.stepNumberText,children:String(y+1)})}),jsxRuntime.jsx(v,{style:s.stepText,children:f.trim()})]},f))}),jsxRuntime.jsxs(reactNative.View,{style:s.actions,children:[r?jsxRuntime.jsx(A,{label:c==="saved"?u.booked.calendarAdded:u.addToCalendarCta,kind:"primary",loading:c==="saving",disabled:c==="saving"||c==="saved",onPress:()=>{p();},testID:"televet-booked-calendar"}):null,c==="failed"?jsxRuntime.jsx(v,{style:[a.failure,s.calendarNote],accessibilityLiveRegion:"polite",testID:"televet-booked-calendar-failed",children:u.booked.calendarFailedBody}):null,jsxRuntime.jsx(A,{label:t?ne(u.booked.backToPet,{pet:t}):u.doneCta,kind:"secondary",onPress:n,testID:"televet-booked-back"})]})]}):jsxRuntime.jsx(reactNative.View,{style:s.screen,testID:"televet-booked-copy-unapproved"})}o(Yr,"TelevetBookedScreen");function rc(e){let{color:t,space:n,radius:r,type:i}=e,{size:l,lineHeight:a}=i;return reactNative.StyleSheet.create({screen:{flex:1,paddingHorizontal:n.xl,gap:n.md},header:{alignItems:"flex-end",paddingBottom:n.lg},avatar:{alignSelf:"center",width:120,height:120,borderRadius:60,backgroundColor:t.surfaceSubtle,borderWidth:2,borderColor:t.success},title:{textAlign:"center",...b(e,"bold"),color:t.brand,fontSize:l.verdict,lineHeight:l.verdict*a.tight,letterSpacing:-0.7,paddingTop:n.lg},when:{textAlign:"center",...b(e,"regular"),color:t.text.metaCool,fontSize:l.subtitle,lineHeight:l.subtitle*a.normal},steps:{marginTop:n.xl,padding:n.lg,borderRadius:r.lg,borderWidth:1,borderColor:t.brandBorder,gap:n.lg},step:{flexDirection:"row",alignItems:"flex-start",gap:n.md},stepNumber:{width:26,height:26,borderRadius:13,backgroundColor:t.primary,alignItems:"center",justifyContent:"center"},stepNumberText:{...b(e,"medium"),color:t.onPrimary,fontSize:l.caption,lineHeight:l.caption,includeFontPadding:false},stepText:{flex:1,...b(e,"regular"),color:t.brand,fontSize:l.body,lineHeight:l.body*a.normal},actions:{marginTop:"auto",paddingBottom:n.xl,gap:n.md},calendarNote:{textAlign:"center"}})}o(rc,"makeStyles");function Jr({step:e,furthestIndex:t,title:n,canGoBack:r,isDirty:i,onBack:l,onClose:a,onConfirmDiscard:s}){let c=S(),d=react.useMemo(()=>sc(c),[c]),p=react.useMemo(()=>()=>{if(!i){a();return}let T={title:u.chrome.discardTitle,body:u.chrome.discardBody,confirmLabel:u.chrome.discardConfirmCta,keepLabel:u.chrome.discardKeepCta};if(s){Promise.resolve(s(T)).then(R=>{R&&a();},()=>{});return}reactNative.Alert.alert(T.title,T.body,[{text:T.keepLabel,style:"cancel"},{text:T.confirmLabel,style:"destructive",onPress:a}]);},[i,a,s]),g=react.useMemo(()=>()=>r?(l(),true):(p(),true),[r,l,p]);react.useEffect(()=>{let T=reactNative.BackHandler.addEventListener("hardwareBackPress",g);return ()=>{T.remove();}},[g]),rt(g);let f=ze.filter(T=>T!=="issues"),y=f.length,E=ze[t],_=E===void 0?0:Math.max(0,f.indexOf(E==="issues"?"reason":E)),h=e==="booked"?1:Math.min(1,(_+1)/y);return jsxRuntime.jsxs(reactNative.View,{style:d.wrap,children:[jsxRuntime.jsxs(reactNative.View,{style:d.bar,children:[jsxRuntime.jsx(reactNative.View,{style:d.side,children:jsxRuntime.jsx(reactNative.Pressable,{onPress:r?l:p,accessibilityRole:"button",accessibilityLabel:Rn,testID:"televet-booking-back",style:d.tap,children:jsxRuntime.jsx(reactNative.View,{style:d.chevron,accessibilityElementsHidden:true,importantForAccessibility:"no"})})}),jsxRuntime.jsx(v,{tier:"heading",style:d.title,accessibilityRole:"header",children:n??u.navTitle}),jsxRuntime.jsx(reactNative.View,{style:[d.side,d.sideRight],children:jsxRuntime.jsx(reactNative.Pressable,{onPress:p,accessibilityRole:"button",accessibilityLabel:u.close,accessibilityHint:u.chrome.closeHint,testID:"televet-booking-close",style:d.tap,children:jsxRuntime.jsx(v,{tier:"control",style:d.close,children:u.close})})})]}),jsxRuntime.jsx(reactNative.View,{style:d.railTrack,accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants",children:jsxRuntime.jsx(reactNative.View,{style:[d.railFill,{width:`${Math.round(h*100)}%`}],testID:"televet-booking-rail"})})]})}o(Jr,"TelevetBookingChrome");var Rn="Back";function sc(e){let{color:t,space:n,type:r}=e,{size:i,lineHeight:l}=r;return reactNative.StyleSheet.create({wrap:{backgroundColor:t.surface},bar:{flexDirection:"row",alignItems:"center",paddingHorizontal:n.lg,minHeight:56},side:{minWidth:64,justifyContent:"center"},sideRight:{alignItems:"flex-end"},tap:{minHeight:X,minWidth:X,justifyContent:"center",paddingHorizontal:n.xs},chevron:{width:10,height:10,borderLeftWidth:2,borderBottomWidth:2,borderColor:t.brand,transform:[{rotate:"45deg"}]},title:{flex:1,textAlign:"center",...b(e,"medium"),color:t.brand,fontSize:i.subtitle,lineHeight:i.subtitle*l.normal},close:{...b(e,"medium"),color:t.brand,fontSize:i.subtitle,lineHeight:i.subtitle*l.normal},railTrack:{height:4,backgroundColor:t.surfaceSubtle},railFill:{height:4,backgroundColor:t.success}})}o(sc,"makeStyles");function zi(e){let t=[],n=dc(e.ageYears);n!==null&&t.push(`${String(n)} yr${n===1?"":"s"} old`);let r=e.weightKg;typeof r=="number"&&Number.isFinite(r)&&r>0&&t.push(`${String(Math.round(r))} kg`);let i=e.breed?.trim();return i&&t.push(i),t.join(" \xB7 ")}o(zi,"formatTelevetPetMetaLine");function dc(e){if(typeof e!="number"||!Number.isFinite(e))return null;let t=Math.floor(e);return t>=0?t:null}o(dc,"wholeYears");function Qr({media:e,onChange:t,onPickMedia:n}){let r=S(),i=react.useMemo(()=>gc(r),[r]),l=nn-e.length,[a,s]=react.useState(false);if(!n)return null;let c=o(async()=>{if(!(a||l<=0)){s(true);try{let d=await Xt(n,l);if(!d.ok||d.value===null||d.value.length===0)return;let p=new Set(e.map(f=>f.uri)),g=d.value.filter(f=>typeof f?.uri=="string"&&f.uri.length>0&&!p.has(f.uri));if(g.length===0)return;t([...e,...g].slice(0,nn));}finally{s(false);}}},"pick");return jsxRuntime.jsxs(reactNative.View,{style:i.row,children:[e.map((d,p)=>jsxRuntime.jsxs(reactNative.View,{style:i.thumb,children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:d.uri},style:i.thumbImage,resizeMode:"cover"}),d.mimeType?.startsWith("video/")?jsxRuntime.jsx(reactNative.View,{style:i.videoBadge,testID:`televet-intake-media-video-${String(p)}`,children:jsxRuntime.jsx(v,{tier:"badge",style:i.videoBadgeText,children:vc})}):null,jsxRuntime.jsx(reactNative.Pressable,{onPress:()=>t(e.filter((g,f)=>f!==p)),accessibilityRole:"button",accessibilityLabel:u.removePhotoLabel,testID:`televet-intake-media-remove-${String(p)}`,style:i.remove,children:jsxRuntime.jsx(v,{tier:"control",style:i.removeGlyph,children:mc})})]},`${d.uri}-${String(p)}`)),l>0?jsxRuntime.jsx(reactNative.Pressable,{onPress:()=>{c();},disabled:a,accessibilityRole:"button",accessibilityLabel:u.addPhotoCta,accessibilityState:{busy:a,disabled:a},testID:"televet-intake-add-media",style:[i.dropzone,a?i.dropzoneBusy:null],children:a?jsxRuntime.jsx(reactNative.ActivityIndicator,{testID:"televet-intake-media-busy"}):jsxRuntime.jsx(v,{tier:"compact",style:i.dropzoneText,children:u.addPhotoCta})}):null]})}o(Qr,"TelevetIntakeMedia");var mc="\xD7",vc="\u25B6",_n=92;function gc(e){let{color:t,space:n,radius:r,type:i}=e,{size:l,lineHeight:a}=i;return reactNative.StyleSheet.create({row:{flexDirection:"row",flexWrap:"wrap",gap:n.md,paddingTop:n.sm},thumb:{width:_n,height:_n,borderRadius:r.md,backgroundColor:t.surfaceSubtle},thumbImage:{width:"100%",height:"100%",borderRadius:r.md},videoBadge:{position:"absolute",left:6,bottom:6,paddingHorizontal:6,paddingVertical:2,borderRadius:r.sm,backgroundColor:t.shadow},videoBadgeText:{color:t.text.onBrand,fontSize:l.nano},remove:{position:"absolute",top:-8,right:-8,width:X-16,height:X-16,borderRadius:X/2,backgroundColor:t.text.metaCool,alignItems:"center",justifyContent:"center"},removeGlyph:{...b(e,"medium"),color:t.surface,fontSize:l.subtitle,lineHeight:l.subtitle,includeFontPadding:false},dropzone:{width:_n,height:_n,borderRadius:r.md,borderWidth:1,borderStyle:"dashed",borderColor:t.brandBorder,alignItems:"center",justifyContent:"center",paddingHorizontal:n.sm},dropzoneBusy:{opacity:.6},dropzoneText:{...b(e,"mono"),color:t.text.metaCool,fontSize:l.nano,lineHeight:l.nano*a.normal,letterSpacing:.3,textAlign:"center"}})}o(gc,"makeStyles");function Zr({slots:e,selectedDayKey:t,onSelectDay:n}){let r=S(),i=react.useMemo(()=>kc(r),[r]),l=react.useMemo(()=>wn(e),[e]),a=l[0];return a===void 0?null:jsxRuntime.jsxs(reactNative.View,{children:[jsxRuntime.jsx(v,{tier:"compact",style:i.month,testID:"televet-day-strip-month",children:bi(a.iso)}),jsxRuntime.jsx(reactNative.ScrollView,{horizontal:true,showsHorizontalScrollIndicator:false,contentContainerStyle:i.strip,testID:"televet-day-strip",children:l.map(s=>{let c=s.key===t;return jsxRuntime.jsxs(reactNative.Pressable,{onPress:()=>n(s),accessibilityRole:"button",accessibilityLabel:hi(s.iso),accessibilityState:{selected:c},testID:`televet-day-${s.key}`,style:[i.day,c?i.daySelected:null],children:[jsxRuntime.jsx(v,{tier:"compact",style:[i.dayWeekday,c?i.dayTextSelected:null],children:s.weekday}),jsxRuntime.jsx(v,{tier:"compact",style:[i.dayNumber,c?i.dayTextSelected:null],children:s.dayNumber})]},s.key)})})]})}o(Zr,"TelevetDayStrip");function wn(e){let t=new Map;for(let n of e){let r=kn(n.startsAt);if(t.has(r))continue;let i=new Date(n.startsAt);Number.isNaN(i.getTime())||t.set(r,Object.freeze({key:r,iso:n.startsAt,weekday:i.toLocaleDateString(void 0,{weekday:"short"}),dayNumber:String(i.getDate())}));}return Object.freeze([...t.values()])}o(wn,"televetDaysFromSlots");function kc(e){let{color:t,space:n,radius:r,type:i}=e,{size:l,lineHeight:a}=i;return reactNative.StyleSheet.create({month:{textAlign:"center",...b(e,"medium"),color:t.brand,fontSize:l.subtitle,lineHeight:l.subtitle*a.snug,paddingBottom:n.md},strip:{gap:n.sm,paddingHorizontal:n.xs},day:{width:52,minHeight:X,paddingVertical:n.md,borderRadius:r.md,borderWidth:1,borderColor:t.brandBorder,alignItems:"center",justifyContent:"center",gap:2},daySelected:{backgroundColor:t.primary,borderColor:t.primary},dayWeekday:{...b(e,"mono"),color:t.text.secondary,fontSize:l.tiny,lineHeight:l.tiny*a.tight},dayNumber:{...b(e,"medium"),color:t.brand,fontSize:l.heading,lineHeight:l.heading*a.tight},dayTextSelected:{color:t.onPrimary}})}o(kc,"makeStyles");function Ft({slots:e,busySlotId:t,onPick:n,ListHeaderComponent:r,rowTestIdPrefix:i="televet-slot",testID:l="televet-slot-list"}){let a=S(),s=react.useMemo(()=>wc(a),[a]),c=react.useMemo(()=>wn(e),[e]),[d,p]=react.useState(null),g=d??c[0]?.key??null,f=react.useMemo(()=>g?e.filter(h=>kn(h.startsAt)===g):[],[e,g]),y=r,E=react.useMemo(()=>f.map(h=>st(h.startsAt)),[f]),_=react.useMemo(()=>new Set(E.filter(h=>h.length>0)).size>1,[E]),P=f[0];return jsxRuntime.jsxs(reactNative.View,{style:s.root,testID:l,children:[y?jsxRuntime.jsx(y,{}):null,jsxRuntime.jsx(Zr,{slots:e,selectedDayKey:g,onSelectDay:h=>p(h.key)}),P&&!_?jsxRuntime.jsx(v,{tier:"compact",style:s.zone,testID:"televet-slot-zone",children:st(P.startsAt)}):null,jsxRuntime.jsx(reactNative.ScrollView,{style:s.gridScroll,contentContainerStyle:s.grid,showsVerticalScrollIndicator:false,children:f.map((h,T)=>{let R=t===h.slotId,O=t!==null,C=_?E[T]??"":"";return jsxRuntime.jsxs(reactNative.Pressable,{onPress:()=>n(h),disabled:O,accessibilityRole:"button",accessibilityLabel:[Xe(h.startsAt),C].filter(q=>q.length>0).join(" "),accessibilityState:{disabled:O,busy:R},testID:`${i}-${h.slotId}`,style:[s.chip,R?s.chipBusy:null,O&&!R?s.chipDisabled:null],children:[jsxRuntime.jsx(v,{tier:"compact",style:[s.chipLabel,R?s.chipLabelBusy:null],children:Xe(h.startsAt)}),C.length>0?jsxRuntime.jsx(v,{tier:"compact",style:[s.chipZone,R?s.chipLabelBusy:null],testID:`${i}-${h.slotId}-zone`,children:C}):null]},h.slotId)})})]})}o(Ft,"TelevetSlotPicker");function wc(e){let{color:t,space:n,radius:r,type:i}=e,{size:l,lineHeight:a}=i;return reactNative.StyleSheet.create({root:{flex:1,minHeight:0},gridScroll:{flex:1},zone:{textAlign:"center",...b(e,"mono"),color:t.text.muted,fontSize:l.tiny,lineHeight:l.tiny*a.normal,letterSpacing:.4,paddingVertical:n.md},grid:{flexDirection:"row",flexWrap:"wrap",gap:n.md,paddingBottom:n.xl},chip:{minWidth:96,flexGrow:1,flexBasis:"28%",minHeight:48,borderRadius:r.pill,borderWidth:1,borderColor:t.brandBorder,alignItems:"center",justifyContent:"center",paddingHorizontal:n.md},chipBusy:{backgroundColor:t.primary,borderColor:t.primary},chipDisabled:{opacity:.45},chipLabel:{...b(e,"regular"),color:t.brand,fontSize:l.subtitle,lineHeight:l.subtitle*a.tight},chipLabelBusy:{color:t.onPrimary},chipZone:{...b(e,"mono"),color:t.text.muted,fontSize:l.tiny,lineHeight:l.tiny*a.normal,letterSpacing:.4}})}o(wc,"makeStyles");function et({label:e,value:t,last:n=false,testID:r}){let i=S(),l=react.useMemo(()=>ro(i),[i]);return jsxRuntime.jsxs(reactNative.View,{style:[l.row,n?l.rowLast:null],testID:r,children:[jsxRuntime.jsx(v,{style:l.rowLabel,children:e}),jsxRuntime.jsx(v,{style:l.rowValue,children:t})]})}o(et,"TelevetSummaryRow");function Nt({label:e,checked:t,onToggle:n,testID:r}){let i=S(),l=react.useMemo(()=>ro(i),[i]);return jsxRuntime.jsxs(reactNative.Pressable,{onPress:()=>n(!t),accessibilityRole:"checkbox",accessibilityLabel:e,accessibilityState:{checked:t},testID:r,style:l.consent,children:[jsxRuntime.jsx(reactNative.View,{style:[l.box,t?l.boxChecked:null],children:t?jsxRuntime.jsx(v,{tier:"badge",style:l.tick,children:Oc}):null}),jsxRuntime.jsx(v,{style:l.consentLabel,children:e})]})}o(Nt,"TelevetConsentCheckbox");var Oc="\u2713";function no({children:e,testID:t}){let n=S(),r=react.useMemo(()=>ro(n),[n]);return jsxRuntime.jsx(reactNative.View,{style:r.card,testID:t,children:e})}o(no,"TelevetSummaryCard");function ro(e){let{color:t,space:n,radius:r,type:i}=e,{size:l,lineHeight:a}=i;return reactNative.StyleSheet.create({card:{borderRadius:r.lg,borderWidth:1,borderColor:t.brandBorder,paddingHorizontal:n.lg},row:{flexDirection:"row",alignItems:"flex-start",justifyContent:"space-between",gap:n.lg,paddingVertical:n.lg,borderBottomWidth:1,borderBottomColor:t.brandBorder},rowLast:{borderBottomWidth:0},rowLabel:{...b(e,"regular"),color:t.brand,fontSize:l.subtitle,lineHeight:l.subtitle*a.snug},rowValue:{flexShrink:1,textAlign:"right",...b(e,"medium"),color:t.brand,fontSize:l.subtitle,lineHeight:l.subtitle*a.snug},consent:{flexDirection:"row",alignItems:"flex-start",gap:n.md,minHeight:X,padding:n.lg,borderRadius:r.md,backgroundColor:t.surfaceSubtle},box:{width:22,height:22,borderRadius:r.xs,borderWidth:1.5,borderColor:t.brand,backgroundColor:t.surface,alignItems:"center",justifyContent:"center"},boxChecked:{backgroundColor:t.primary,borderColor:t.primary},tick:{...b(e,"bold"),color:t.onPrimary,fontSize:l.caption,lineHeight:l.caption,includeFontPadding:false},consentLabel:{flex:1,...b(e,"regular"),color:t.text.metaCool,fontSize:l.body,lineHeight:l.body*a.normal}})}o(ro,"makeStyles");function oo({when:e,clinician:t,petName:n,reason:r,shareRecords:i,onToggleShare:l,stateCode:a,stateAttested:s,onToggleStateAttest:c,cancellationTerms:d,termsAttested:p,onToggleTermsAttest:g,canConfirm:f,busy:y,failure:E,rateLimitMessage:_,onConfirm:P,emergency:h,onAcknowledgeEmergency:T,onSeeOtherVets:R,mediaShortfall:O=Ot,primaryVet:C,onFindEmergencyVet:q}){let D=V(),z=S(),N=react.useMemo(()=>He(z),[z]);return jsxRuntime.jsxs(reactNative.View,{style:D.scrollRoot,testID:"televet-booking-review",children:[jsxRuntime.jsxs(reactNative.ScrollView,{style:D.scrollBody,contentContainerStyle:D.list,keyboardShouldPersistTaps:"handled",showsVerticalScrollIndicator:false,testID:"televet-booking-review-scroll",children:[jsxRuntime.jsxs(no,{testID:"televet-review-summary",children:[n?jsxRuntime.jsx(et,{label:u.summaryPet,value:n,testID:"televet-review-row-pet"}):null,t?jsxRuntime.jsx(et,{label:u.summaryVet,value:t,testID:"televet-review-row-vet"}):null,jsxRuntime.jsx(et,{label:u.summaryWhen,value:e,testID:"televet-review-row-when"}),jsxRuntime.jsx(et,{label:u.summaryLength,value:ne(u.summaryLengthTemplate,{n:String(at)}),testID:"televet-review-row-length"}),r?jsxRuntime.jsx(et,{label:u.summaryReason,value:r,last:true,testID:"televet-review-row-reason"}):null]}),jsxRuntime.jsx(Nt,{label:u.shareRecordsOff,checked:i,onToggle:l,testID:"televet-review-share-records"}),d?jsxRuntime.jsx(Nt,{label:d,checked:p,onToggle:g,testID:"televet-review-terms-attest"}):null,a?jsxRuntime.jsx(Nt,{label:ne(u.stateAttestTemplate,{state:a}),checked:s,onToggle:c,testID:"televet-review-state-attest"}):null,jsxRuntime.jsx(Bt,{shortfall:O,testIDPrefix:"televet-review"}),h?jsxRuntime.jsxs(reactNative.View,{style:N.emergencyBanner,testID:"televet-review-emergency",children:[jsxRuntime.jsx(v,{tier:"heading",accessibilityRole:"header",accessibilityLiveRegion:"assertive",style:N.emergencyTitle,children:u.emergency.bannerTitle}),jsxRuntime.jsx(v,{style:N.emergencyLede,children:u.emergency.lede}),h.length>0?jsxRuntime.jsx(v,{style:N.emergencyLede,testID:"televet-review-emergency-categories",children:h.join(", ")}):null,jsxRuntime.jsx(At,{petName:n,primaryVet:C,onFindEmergencyVet:q}),jsxRuntime.jsx(A,{label:u.emergency.keepBookingCta,kind:"secondary",loading:y,disabled:y,onPress:T,testID:"televet-review-emergency-ack"})]}):null,E==="failed"?jsxRuntime.jsx($,{message:u.confirmFailed}):null,E==="clinician_unavailable"?jsxRuntime.jsxs(reactNative.View,{style:D.list,testID:"televet-review-clinician-unavailable",children:[jsxRuntime.jsx($,{message:u.confirmFailed}),jsxRuntime.jsx(A,{label:u.seeOtherVetsCta,kind:"secondary",onPress:R,testID:"televet-review-see-other-vets"})]}):null,E==="rate_limited"&&_?jsxRuntime.jsx($,{message:_,testID:"televet-review-rate-limited"}):null,E==="rate_limited"&&!_?jsxRuntime.jsx($,{message:u.confirmFailed}):null,E==="not_entitled"?jsxRuntime.jsx($,{message:u.confirmNotEntitled,testID:"televet-review-not-entitled"}):null]}),h?null:jsxRuntime.jsx(reactNative.View,{style:D.scrollFooter,children:jsxRuntime.jsx(A,{label:u.confirmCta,kind:"primary",loading:y,disabled:!f||y||!!a&&!s||!!d&&!p,onPress:P,testID:"televet-review-confirm"})})]})}o(oo,"ReviewStep");var Fc="\u25CB",Nc="+";function Oe(e,t){return t?e.find(r=>r.petRef===t||r.petId===t)?.name??null:null}o(Oe,"nameOf");function Yi({pets:e,isPending:t,isError:n,onRetry:r,selectedId:i,onSelect:l,onAddPet:a}){let s=V(),c=S(),d=react.useMemo(()=>He(c),[c]);return t?jsxRuntime.jsx(reactNative.View,{style:s.list,testID:"televet-pets-loading",children:[0,1].map(p=>jsxRuntime.jsx(ee,{height:64},p))}):n?jsxRuntime.jsx(reactNative.View,{testID:"televet-pets-error",children:jsxRuntime.jsx(F,{title:u.chrome.loadFailedTitle,actionLabel:u.chrome.retryCta,onAction:r})}):e.length===0?jsxRuntime.jsx(reactNative.View,{testID:"televet-pets-empty",children:jsxRuntime.jsx(F,{title:u.chrome.noPetsTitle,actionLabel:u.addPetCta,onAction:a})}):jsxRuntime.jsxs(reactNative.View,{style:s.stepFill,children:[jsxRuntime.jsx(v,{tier:"heading",style:s.stepTitle,accessibilityRole:"header",children:u.petSelectTitle}),jsxRuntime.jsxs(reactNative.ScrollView,{contentContainerStyle:s.list,testID:"televet-pets",children:[e.map(p=>{let g=i===p.petRef,f=zi(p),y=p.name??"";return jsxRuntime.jsx($i,{name:y,meta:f,selected:g,onPress:()=>l(p.petRef),testID:`televet-pet-${p.petRef}`},p.petRef)}),a?jsxRuntime.jsx($i,{name:u.addPetCta,meta:"",selected:false,onPress:a,testID:"televet-pet-add",glyph:Nc}):null]}),jsxRuntime.jsx(reactNative.View,{style:d.spacer})]})}o(Yi,"PetStep");function $i({name:e,meta:t,selected:n,onPress:r,testID:i,glyph:l}){let a=S(),s=react.useMemo(()=>He(a),[a]);return jsxRuntime.jsxs(reactNative.View,{style:[s.petRow,n?s.petRowSelected:null],children:[jsxRuntime.jsx(A,{label:e,onPress:r,kind:"secondary",accessibilityLabel:e,testID:i,style:s.petRowButton}),jsxRuntime.jsxs(reactNative.View,{style:s.petRowText,pointerEvents:"none",children:[jsxRuntime.jsx(reactNative.View,{style:s.petDisc,children:jsxRuntime.jsx(v,{tier:"compact",style:s.petDiscGlyph,children:l??Gi(e)})}),t?jsxRuntime.jsx(v,{tier:"compact",style:s.petRowMeta,children:t}):null]})]})}o($i,"PetRow");function Gi(e){let t=e.trim();return t.length===0?Fc:t.slice(0,1).toUpperCase()}o(Gi,"initialOf");function Ji({clinicians:e,isPending:t,isError:n,selectedId:r,onSelect:i,onRetry:l}){let a=V(),s=S(),c=react.useMemo(()=>He(s),[s]);if(t)return jsxRuntime.jsx(reactNative.View,{style:a.list,testID:"televet-clinicians-loading",children:jsxRuntime.jsx(ee,{height:96})});if(n)return jsxRuntime.jsx(reactNative.View,{testID:"televet-clinicians-error",children:jsxRuntime.jsx(F,{title:u.chrome.loadFailedTitle,actionLabel:u.chrome.retryCta,onAction:l})});if(e.length===0)return jsxRuntime.jsx(reactNative.View,{testID:"televet-clinicians-empty",children:jsxRuntime.jsx(F,{title:u.noCliniciansTitle,message:u.noCliniciansBody,actionLabel:u.noCliniciansRetryCta,onAction:l})});let d=e.find(p=>p.clinicianId===r)??e[0];return d===void 0?null:jsxRuntime.jsxs(reactNative.View,{style:a.list,testID:"televet-clinicians",children:[jsxRuntime.jsx(v,{tier:"heading",style:a.stepTitle,accessibilityRole:"header",children:u.yourVetTitle}),jsxRuntime.jsxs(reactNative.View,{style:c.vetRow,children:[jsxRuntime.jsx(reactNative.View,{style:c.vetAvatar,children:jsxRuntime.jsx(v,{tier:"heading",style:c.vetAvatarText,children:Gi(d.displayName)})}),jsxRuntime.jsxs(reactNative.View,{style:c.vetIdentity,children:[jsxRuntime.jsx(v,{style:c.vetName,children:d.displayName}),d.credentials?jsxRuntime.jsx(v,{style:c.vetCredentials,children:d.credentials}):null,d.rating!==null&&d.ratingCount!==null?jsxRuntime.jsx(v,{tier:"compact",style:c.vetRating,testID:"televet-vet-rating",children:`\u2605 ${String(d.rating)} \xB7 ${String(d.ratingCount)} ${u.reviewsLabel}`}):null]})]}),d.bio?jsxRuntime.jsx(v,{style:c.vetBio,testID:"televet-vet-bio",children:d.bio}):null,jsxRuntime.jsx(reactNative.View,{style:a.divider}),jsxRuntime.jsx(A,{label:u.continueCta,kind:"primary",onPress:()=>i(d.clinicianId),testID:`televet-clinician-${d.clinicianId}`})]})}o(Ji,"ClinicianStep");function Xi({slots:e,enabled:t,isPending:n,isError:r,busySlotId:i,failure:l,nextOpening:a,onPick:s,onRetry:c,onSeeOtherVets:d}){let p=V();return t?n?jsxRuntime.jsx(reactNative.View,{style:p.list,testID:"televet-slots-loading",children:[0,1,2].map(g=>jsxRuntime.jsx(ee,{height:48},g))}):r?jsxRuntime.jsx(F,{title:u.slotsErrorTitle,actionLabel:u.retryCta,onAction:c,testID:"televet-slots-error"}):e.length===0?jsxRuntime.jsx(reactNative.View,{testID:"televet-slots-empty",children:jsxRuntime.jsx(F,{title:u.noSlotsTitle,message:a?ne(u.nextOpeningTemplate,{when:pe(a.startsAt)}):void 0,actionLabel:a?u.seeOtherVetsCta:void 0,onAction:a?d:void 0})}):jsxRuntime.jsxs(reactNative.View,{style:p.stepFill,testID:"televet-slots",children:[l==="expired"?jsxRuntime.jsx($,{message:u.holdExpired}):null,l==="taken"?jsxRuntime.jsx($,{message:u.slotTaken}):null,jsxRuntime.jsx(Ft,{slots:e,busySlotId:i,onPick:s})]}):jsxRuntime.jsx(reactNative.View,{testID:"televet-slots-unavailable",children:jsxRuntime.jsx(F,{title:u.bookingPausedTitle})})}o(Xi,"SlotStep");function Qi({value:e,onChange:t,onNext:n,media:r,onChangeMedia:i,onPickMedia:l,checking:a=false}){let s=V(),c=S(),d=react.useMemo(()=>He(c),[c]),p=e.trim(),g=p.length>0&&p.length<=_e;return jsxRuntime.jsxs(reactNative.View,{style:s.scrollRoot,testID:"televet-booking-reason",children:[jsxRuntime.jsxs(reactNative.ScrollView,{style:s.scrollBody,contentContainerStyle:s.list,keyboardShouldPersistTaps:"handled",keyboardDismissMode:"interactive",showsVerticalScrollIndicator:false,testID:"televet-booking-reason-scroll",children:[jsxRuntime.jsx(v,{tier:"heading",style:s.stepTitle,accessibilityRole:"header",children:u.describeHeading}),jsxRuntime.jsx(v,{style:s.stepHelp,children:u.describeHelpLong}),jsxRuntime.jsx(Bl,{value:e,onChangeText:t,multiline:true,placeholder:u.reasonPlaceholder,placeholderTextColor:c.color.text.placeholder,style:d.reasonInput,testID:"televet-reason-input"}),p.length>_e?jsxRuntime.jsx($,{message:u.reasonTooLong}):null,jsxRuntime.jsx(Qr,{media:r,onChange:i,...l?{onPickMedia:l}:{}})]}),jsxRuntime.jsx(reactNative.View,{style:s.scrollFooter,children:jsxRuntime.jsx(A,{label:u.continueCta,kind:"primary",disabled:!g,loading:a,onPress:n,testID:"televet-reason-next"})})]})}o(Qi,"ReasonStep");function He(e){let{color:t,space:n,radius:r,type:i}=e,{size:l,lineHeight:a}=i;return reactNative.StyleSheet.create({marker:{minHeight:1},spacer:{height:n.md},petRow:{gap:n.xs,paddingVertical:n.xs},petRowSelected:{opacity:1},petRowButton:{alignSelf:"stretch",justifyContent:"flex-start"},petRowText:{flexDirection:"row",alignItems:"center",gap:n.sm,paddingHorizontal:n.md},petDisc:{width:28,height:28,borderRadius:14,backgroundColor:t.surfaceSubtle,alignItems:"center",justifyContent:"center"},petDiscGlyph:{...b(e,"medium"),color:t.brand,fontSize:l.caption,lineHeight:l.caption},petRowMeta:{flexShrink:1,...b(e,"regular"),color:t.text.metaCool,fontSize:l.caption,lineHeight:l.caption*a.normal},vetRow:{flexDirection:"row",alignItems:"center",gap:n.md},vetAvatar:{width:64,height:64,borderRadius:32,backgroundColor:t.surfaceSubtle,alignItems:"center",justifyContent:"center"},vetAvatarText:{...b(e,"medium"),color:t.brand,fontSize:l.heading,lineHeight:l.heading},vetIdentity:{flex:1,gap:2},vetName:{...b(e,"medium"),color:t.brand,fontSize:l.subtitle,lineHeight:l.subtitle*a.snug},vetCredentials:{...b(e,"regular"),color:t.text.metaCool,fontSize:l.caption,lineHeight:l.caption*a.normal},vetRating:{...b(e,"regular"),color:t.text.secondary,fontSize:l.caption,lineHeight:l.caption*a.normal},vetBio:{...b(e,"regular"),color:t.brand,fontSize:l.body,lineHeight:l.body*a.normal},reasonInput:{minHeight:120,textAlignVertical:"top",borderWidth:1,borderColor:t.brandBorder,borderRadius:r.md,padding:n.md,...b(e,"regular"),color:t.text.primary,fontSize:l.body,lineHeight:l.body*a.normal},emergencyBanner:{gap:n.md,padding:n.lg,borderRadius:r.lg,borderWidth:1,borderColor:t.errorRed,backgroundColor:t.badgeBgCritical},emergencyTitle:{...b(e,"bold"),color:t.errorRed,fontSize:l.subtitle,lineHeight:l.subtitle*a.snug},emergencyLede:{...b(e,"regular"),color:t.text.primary,fontSize:l.body,lineHeight:l.body*a.normal}})}o(He,"makeLocalStyles");function ao(e){let{petRef:t,usState:n,controller:r,onBooked:i,onExit:l,onAddPet:a,onPickMedia:s,onAddToCalendar:c,onConfirmDiscard:d,onRequestLocation:p,locationStatus:g="unknown",onTriageReason:f,onStateInterest:y,primaryVet:E,onFindEmergencyVet:_,canJoinInApp:P=false,renderUnavailable:h,style:T,testID:R}=nt(e,["onBooked","onExit","onAddPet","onRequestLocation","onFindEmergencyVet"]),O=V(),C=S(),q=react.useMemo(()=>He(C),[C]),D=ae(r),z=it(),N=z.pets,K=N.length,fe=react.useMemo(()=>({ownedPetCount:K}),[K]),[Q,oe]=react.useReducer((G,gt)=>Ir(G,gt,fe),void 0,()=>wr({ownedPetCount:0},{petId:t??null,state:n??null})),I=react.useCallback(G=>oe(G),[]),[ue,ke]=react.useState(""),[M,qe]=react.useState(null),[Wt,Bn]=react.useState(null),[qt,$t]=react.useState(null),[mt,Eo]=react.useState(false),[Dn,ko]=react.useState(false),[Co,Ea]=react.useState([]),[Fn,ka]=react.useState(null),{draft:B}=Q,le=Or(Q),So=react.useRef(B.state);So.current!==B.state&&(So.current=B.state,mt&&Eo(false),Dn&&ko(false));let Kt=rr(B.state,D),Ro=St(D),vt=or(D),de=lr(B.state,D),tt=Rt(B.clinicianId,D),Ca=ir(D).data??null,Yt=_t(D),_o=ar(D),Ce=Lr(f??null),xo=Vr(B.state,y??null).actionFor("no_licensed_vet"),Nn=n??null;react.useEffect(()=>{Nn&&!B.state&&I({type:"patch",patch:{state:Nn}});},[Nn,B.state,I]),react.useEffect(()=>{t&&!B.petId&&I({type:"patch",patch:{petId:t}});},[t,B.petId,I]);let Ln=N.length===1?N[0]?.petRef??null:null;react.useEffect(()=>{Ln&&!B.petId&&I({type:"patch",patch:{petId:Ln}});},[Ln,B.petId,I]);let wo=react.useRef(le);wo.current=le;let Po=react.useRef(0);react.useEffect(()=>{K!==Po.current&&(Po.current=K,I({type:"goTo",step:wo.current}));},[K,I]);let Vn=de.data?.[0]?.clinicianId??null;react.useEffect(()=>{Vn&&!B.clinicianId&&I({type:"patch",patch:{clinicianId:Vn}});},[Vn,B.clinicianId,I]);let Sa=react.useCallback(G=>{qe(null),Yt.mutate(G.slotId,{onSuccess:o(gt=>{I({type:"patch",patch:{slot:G,holdExpiresAt:gt.expiresAt,idempotencyKey:Br(G.slotId)}}),I({type:"next"});},"onSuccess"),onError:o(gt=>qe(Ve(gt).kind==="unavailable"?"unavailable":"taken"),"onError")});},[Yt,I]),{submitBooking:Ra,confirm:_a}=Ei({draft:B,reasonText:ue,book:_o,stateAttested:mt,termsAttested:Dn,cancellationPolicy:Ro.data??null,triage:Ce,goTo:react.useCallback(G=>I({type:"goTo",step:G}),[I]),setFailure:qe,setRateLimitMessage:Bn,setEmergency:$t,setBookedConsult:ka,...i?{onBooked:i}:{}}),xa=Kt.enabled&&Kt.data!==null&&!Kt.data.wellnessAvailable,Io=vt.enabled&&vt.data?.active===false,wa=vt.enabled&&vt.data!==null,Pa=Mr(wa),Oo=Cn(Co.length),Ia=ue.trim().length>0||!!B.slot||!!B.clinicianId,Oa=D===null||M==="unavailable"||dr(vt)||dr(Kt),Ao={noState:!B.state,isPending:de.enabled&&de.isPending,isError:de.isError,isEmpty:(de.data?.length??0)===0,notEntitled:Io},Aa=Di(Ao),Bo={surfaceUnavailable:Oa,notEntitled:Io,policyBlocked:xa,triageOpen:Ce.open,step:le},Ba=Ai(Bo);return Se()?jsxRuntime.jsxs(reactNative.View,{style:[O.screen,T],testID:R??"televet-booking",children:[jsxRuntime.jsx(Jr,{step:le,furthestIndex:Q.furthestIndex,canGoBack:(Ce.open||Pr(Q,fe))&&le!=="booked",isDirty:Ia,onBack:()=>{if(Ce.open){Ce.close();return}Ce.cancel(),I({type:"back"});},onClose:()=>l?.(),...d?{onConfirmDiscard:d}:{}}),Ba?jsxRuntime.jsx(Bi,{state:Bo,petName:Oe(N,B.petId),...E?{primaryVet:E}:{},onFindEmergencyVet:_,stateInterest:xo,...y?{onCheckAvailability:o(()=>I({type:"goTo",step:"clinician"}),"onCheckAvailability")}:{},onAcknowledgeEmergency:()=>{Ce.acknowledge(ue),I({type:"next"});},...h?{renderUnavailable:h}:{}}):le==="time"?jsxRuntime.jsx(Xi,{slots:tt.data??[],enabled:tt.enabled,isPending:tt.enabled&&tt.isPending,isError:tt.isError,busySlotId:Yt.isPending?Yt.variables:null,failure:M,nextOpening:Ca,onPick:Sa,onRetry:()=>tt.refetch(),onSeeOtherVets:()=>I({type:"goTo",step:"clinician"})}):le==="review"?jsxRuntime.jsx(oo,{when:B.slot?pe(B.slot.startsAt):"",petName:Oe(N,B.petId),reason:ue.trim(),clinician:de.data?.find(G=>G.clinicianId===B.clinicianId)?.displayName??null,shareRecords:B.shareHealthRecords,stateCode:B.state,stateAttested:mt,onToggleStateAttest:Eo,cancellationTerms:Ro.data?.summary??null,termsAttested:Dn,onToggleTermsAttest:ko,onToggleShare:G=>I({type:"patch",patch:{shareHealthRecords:G}}),canConfirm:It(B,ue),busy:_o.isPending,failure:M,rateLimitMessage:Wt,onConfirm:_a,emergency:qt,onAcknowledgeEmergency:()=>Ra(true),onSeeOtherVets:()=>I({type:"goTo",step:"clinician"}),mediaShortfall:Oo,primaryVet:E,onFindEmergencyVet:_}):le==="booked"?jsxRuntime.jsx(reactNative.View,{style:O.stepFill,testID:"televet-booking-booked",children:Fn?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Yr,{consult:Fn,petName:Oe(N,Fn.petId)??Oe(N,B.petId),onDone:()=>l?.(),canJoinInApp:P,...c?{onAddToCalendar:c}:{}}),jsxRuntime.jsx(Bt,{shortfall:Oo,testIDPrefix:"televet-booked"})]}):null}):le==="clinician"&&Aa?jsxRuntime.jsx(Fi,{state:Ao,cause:Pa,locationStatus:g,...p?{onRequestLocation:p}:{},onRetry:()=>de.refetch(),stateInterest:xo}):le==="clinician"?jsxRuntime.jsx(Ji,{clinicians:de.data??[],isPending:de.enabled&&de.isPending,isError:de.isError,selectedId:B.clinicianId,onRetry:()=>de.refetch(),onSelect:G=>{I({type:"patch",patch:{clinicianId:G}}),I({type:"next"});}}):le==="reason"?jsxRuntime.jsx(Qi,{value:ue,onChange:ke,media:Co,onChangeMedia:Ea,...s?{onPickMedia:s}:{},checking:Ce.checking,onNext:()=>{Ce.check(ue).then(G=>{G&&I({type:"next"});});}}):le==="pet"?jsxRuntime.jsx(Yi,{pets:N,isPending:z.loading,isError:z.error!==null,onRetry:()=>{z.refresh();},onAddPet:a,selectedId:B.petId,onSelect:G=>{I({type:"patch",patch:{petId:G}}),I({type:"next"});}}):jsxRuntime.jsx(reactNative.View,{style:q.marker,testID:`televet-booking-step-${le}`})]}):jsxRuntime.jsx(reactNative.View,{style:[O.screen,T],testID:R??"televet-booking",children:jsxRuntime.jsx(reactNative.View,{style:O.stepFill,testID:"televet-booking-copy-unapproved",children:h?h():null})})}o(ao,"EverfurTelevetBooking");var jc=2e4;function On(e=true,t=jc){let[n,r]=react.useState(()=>Date.now());return react.useEffect(()=>{if(!e)return;r(Date.now());let i=setInterval(()=>r(Date.now()),t);return ()=>clearInterval(i)},[e,t]),n}o(On,"useNowMs");var x=Object.freeze({pastTitle:"Past visits",upcomingTitle:"Upcoming visits",emptyTitle:"No visits yet",bookCta:"Find a time",bookCardTitle:"Book a video visit",bookCardSubtitle:"Get help for your pet from home.",loadErrorTitle:"Could not load your visits",retryCta:"Try again",statusCompleted:"Completed",statusCancelled:"Cancelled",statusMissed:"Missed",manageCta:"Manage",joinCta:"Join call",joinDisabledReason:"You can join closer to the time.",joinOverReason:"This visit has ended.",vetUnassigned:"Your vet",rescheduleCta:"Reschedule",cancelCta:"Cancel visit",cancelConfirmTitle:"Cancel this visit?",cancelConfirmBody:"You can book another one afterwards.",cancelConfirmCta:"Cancel visit",cancelKeepCta:"Keep visit",cancelFailedTitle:"Could not cancel",cancelReason:"Cancelled by the pet parent in the app.",cancelPolicyErrorTitle:"Could not load what you need to agree to",phaseCancelled:"This visit was cancelled",phaseCancelledBody:"You can book another visit when you are ready.",notFoundTitle:"Not found",notFoundBody:"This visit is no longer available.",staleTitle:"Could not load your visits",staleRetry:"Try again"});function ta(e){switch(e){case "completed":return x.statusCompleted;case "cancelled_owner":case "cancelled_ops":return x.statusCancelled;case "no_show_owner":case "no_show_vet":return x.statusMissed;default:return null}}o(ta,"televetVisitStatusNative");function Mt({onBack:e,testID:t}){let n=ft();return jsxRuntime.jsx(reactNative.View,{style:n.navRow,children:jsxRuntime.jsx(reactNative.Pressable,{onPress:e,accessibilityRole:"button",accessibilityLabel:Rn,testID:t,style:n.backTap,children:jsxRuntime.jsx(reactNative.View,{style:n.chevron,accessibilityElementsHidden:true,importantForAccessibility:"no"})})})}o(Mt,"TelevetVisitBackRow");function ft(){let e=S();return react.useMemo(()=>Wc(e),[e])}o(ft,"useVisitStyles");function Wc(e){let{color:t,space:n,radius:r,type:i}=e,{size:l,lineHeight:a}=i;return reactNative.StyleSheet.create({screen:{flex:1,paddingHorizontal:n.xl},body:{gap:n.sm,paddingBottom:n.xl},navRow:{paddingVertical:n.sm,flexDirection:"row"},backTap:{minHeight:X,minWidth:X,justifyContent:"center"},chevron:{width:10,height:10,marginLeft:n.xs,borderLeftWidth:2,borderBottomWidth:2,borderColor:t.brand,transform:[{rotate:"45deg"}]},title:{...b(e,"medium"),color:t.brand,fontSize:l.heading,lineHeight:l.heading*a.snug,marginBottom:n.md},list:{gap:n.sm},row:{gap:n.xs,padding:n.md,borderRadius:r.md,borderWidth:1,borderColor:t.brandBorder,backgroundColor:t.surface},rowHead:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:n.sm},when:{flex:1,...b(e,"medium"),color:t.text.primary,fontSize:l.subtitle,lineHeight:l.subtitle*a.snug},status:{...b(e,"mono"),color:t.text.metaCool,fontSize:l.micro,letterSpacing:1},meta:{...b(e,"mono"),color:t.text.metaCool,fontSize:l.caption,lineHeight:l.caption*a.normal},bookCard:{gap:n.md,padding:n.xl,borderRadius:r.sm,borderWidth:reactNative.StyleSheet.hairlineWidth,borderColor:t.brand,backgroundColor:t.surface},bookTitle:{...b(e,"medium"),color:t.brand,fontSize:l.subtitle,lineHeight:l.subtitle*a.snug},bookSubtitle:{...b(e,"regular"),color:t.text.metaCool,fontSize:l.body,lineHeight:l.body*a.normal},visitCard:{gap:n.md,padding:n.lg,borderRadius:r.lg,borderWidth:1,borderColor:t.brandBorder},visitWhen:{...b(e,"medium"),color:t.brand,fontSize:l.heading,lineHeight:l.heading*a.snug},visitWho:{...b(e,"regular"),color:t.text.primary,fontSize:l.subtitle,lineHeight:l.subtitle*a.snug},visitMeta:{...b(e,"regular"),color:t.text.metaCool,fontSize:l.caption,lineHeight:l.caption*a.normal},reason:{...b(e,"regular"),color:t.text.metaCool,fontSize:l.caption,lineHeight:l.caption*a.normal},terms:{padding:n.md,borderRadius:r.sm,backgroundColor:t.surfaceSubtle,...b(e,"regular"),color:t.text.metaCool,fontSize:l.caption,lineHeight:l.caption*a.normal},noticeTitle:{...b(e,"bold"),color:t.text.primary,fontSize:l.subtitle,lineHeight:l.subtitle*a.snug},noticeBody:{...b(e,"regular"),color:t.text.metaCool,fontSize:l.body,lineHeight:l.body*a.normal},receipt:{gap:n.xs,padding:n.md,borderRadius:r.sm,backgroundColor:t.surfaceSubtle},stack:{gap:n.xs}})}o(Wc,"makeVisitStyles");function co({consult:e,controller:t,onJoin:n,onReschedule:r,onCancelled:i,onBack:l,revision:a=0,nowMs:s,style:c}){let d=ft(),p=ae(t),[g,f]=react.useState(0),y=Tl(e.consultId,p,a+g),E=St(p),_=El(e.consultId,p),{pets:P}=it(),[h,T]=react.useState(false),[R,O]=react.useState(false),[C,q]=react.useState(null),D=y.isError&&y.error?.httpStatus===404,z=D?null:y.data??e,N=z!==null&&$e.has(z.status),K=On(!N),Q=pr(z,s??K),oe=z===null?null:Oe(P,z.petId),I=E.data?.summary.trim()||null,ue=react.useCallback(()=>{I&&(O(false),_.mutate(x.cancelReason,{onSuccess:o($t=>{T(false),q($t),f(mt=>mt+1),i?.($t);},"onSuccess"),onError:o(()=>O(true),"onError")}));},[I,_,i]);if(z===null)return jsxRuntime.jsxs(reactNative.View,{style:[d.screen,c],testID:"televet-consult-missing",children:[jsxRuntime.jsx(Mt,{onBack:l,testID:"televet-consult-back"}),jsxRuntime.jsx(F,{title:x.notFoundTitle,message:x.notFoundBody})]});let ke=z.status,M=ke==="cancelled_owner"||ke==="cancelled_ops",qe=ke==="scheduled"||ke==="in_progress",Wt=fr(ke)&&C===null,Bn=z.clinicianName??x.vetUnassigned,qt=[oe,z.reasonText].filter(Boolean).join(" \xB7 ");return jsxRuntime.jsxs(reactNative.View,{style:[d.screen,c],testID:"televet-consult",children:[jsxRuntime.jsx(Mt,{onBack:l,testID:"televet-consult-back"}),jsxRuntime.jsxs(reactNative.ScrollView,{contentContainerStyle:d.body,children:[jsxRuntime.jsxs(reactNative.View,{style:d.visitCard,children:[jsxRuntime.jsx(v,{style:d.visitWhen,accessibilityRole:"header",testID:"televet-consult-when",children:pe(z.scheduledAt)}),jsxRuntime.jsxs(reactNative.View,{style:d.stack,children:[jsxRuntime.jsx(v,{style:d.visitWho,testID:"televet-consult-vet",children:Bn}),qt?jsxRuntime.jsx(v,{style:d.visitMeta,numberOfLines:2,children:qt}):null]})]}),qe&&C===null?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(A,{label:x.joinCta,disabled:!Q.ready,onPress:()=>n(z,oe),testID:"televet-consult-join"}),Q.ready?null:jsxRuntime.jsx(v,{style:d.reason,testID:"televet-consult-join-reason",children:Q.reason==="consult_over"?x.joinOverReason:x.joinDisabledReason}),Wt&&r?jsxRuntime.jsx(A,{label:x.rescheduleCta,kind:"secondary",onPress:()=>r(z),testID:"televet-consult-reschedule"}):null]}):null,C?jsxRuntime.jsx(reactNative.View,{style:d.receipt,testID:"televet-consult-cancel-receipt",children:jsxRuntime.jsx(v,{style:d.noticeTitle,accessibilityLiveRegion:"polite",children:C.summary??x.phaseCancelled})}):M?jsxRuntime.jsxs(reactNative.View,{style:d.stack,testID:"televet-consult-cancelled",children:[jsxRuntime.jsx(v,{style:d.noticeTitle,accessibilityRole:"header",children:x.phaseCancelled}),jsxRuntime.jsx(v,{style:d.noticeBody,children:x.phaseCancelledBody})]}):null,Wt?jsxRuntime.jsxs(reactNative.View,{style:d.stack,children:[I?jsxRuntime.jsx(v,{style:d.terms,accessibilityLiveRegion:"polite",testID:"televet-consult-cancellation-policy",children:I}):E.enabled&&E.isPending?jsxRuntime.jsx(reactNative.View,{testID:"televet-consult-cancellation-policy-loading",children:jsxRuntime.jsx(ee,{height:42})}):jsxRuntime.jsx(F,{title:x.cancelPolicyErrorTitle,actionLabel:x.retryCta,onAction:()=>E.refetch(),testID:"televet-consult-cancellation-policy-error"}),h?jsxRuntime.jsxs(reactNative.View,{style:d.stack,testID:"televet-consult-cancel-confirm",children:[jsxRuntime.jsx(v,{style:d.noticeTitle,children:x.cancelConfirmTitle}),jsxRuntime.jsx(v,{style:d.noticeBody,children:x.cancelConfirmBody}),R?jsxRuntime.jsx($,{message:x.cancelFailedTitle,testID:"televet-consult-cancel-failed"}):null,jsxRuntime.jsx(A,{label:x.cancelConfirmCta,kind:"danger",loading:_.isPending,onPress:ue,testID:"televet-consult-cancel-yes"}),jsxRuntime.jsx(A,{label:x.cancelKeepCta,kind:"secondary",disabled:_.isPending,onPress:()=>{T(false),O(false);},testID:"televet-consult-cancel-keep"})]}):jsxRuntime.jsx(A,{label:x.cancelCta,kind:"secondary",disabled:!I,onPress:()=>{O(false),T(true);},testID:"televet-consult-cancel"})]}):null,y.isError&&!D?jsxRuntime.jsx(F,{title:x.staleTitle,actionLabel:x.staleRetry,onAction:()=>y.refetch(),testID:"televet-consult-stale"}):null]})]})}o(co,"TelevetConsultScreen");var jt=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:"Usually under a minute",lobbyPrepLabel:"WHILE YOU WAIT",lobbyPrepNoPet:"Have your pet nearby and somewhere well lit.",lobbyTitle:o(e=>{let t=e?.trim()??"";return t.length>0?`${t} is joining`:jt.lobbyTitleNoName},"lobbyTitle"),lobbyPrep:o(e=>{let t=e?.trim()??"";return t.length>0?`Have ${t} nearby and somewhere well lit.`:jt.lobbyPrepNoPet},"lobbyPrep"),lobbyDuration:o(e=>`${e} MINUTE VISIT`,"lobbyDuration"),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 oa(e){switch(e){case "too_early":return "You can join closer to the time.";case "too_late":return "This visit has ended.";case "room_not_ready":return "The room is still being set up. Try again in a moment.";case "not_joinable":return "This visit is no longer open.";case "unavailable":return "No way to join this visit yet.";default:return "That did not open. Try again."}}o(oa,"televetJoinRefusalNativeCopy");var la="No way to join this visit yet.";function ia(e){return e==="room_not_ready"||e==="unknown"}o(ia,"televetJoinIsRetryable");var aa=Symbol.for("@everfur/sdk/televet");function Yc(){let e=globalThis,t=e[aa];if(t!==void 0)return t;let n={presenter:null,snapshot:Object.freeze({request:null,serial:0,activeHost:null}),hosts:[],nextHost:1,listeners:new Set,dailyRegistered:false};return e[aa]=n,n}o(Yc,"televetGlobal");function sa(){return Yc().dailyRegistered}o(sa,"isEverfurDailyRegistered");function da(e){let t=null;return ()=>{if(t!==null)return t;let n=e();return t=n,n.then(void 0,()=>{t===n&&(t=null);}),n}}o(da,"memoizeTelevetLoader");var ua=Object.freeze({status:"joining"});function uo(e,t){let[n,r]=react.useState(0),[i,l]=react.useState(ua),a=react.useRef(null);react.useEffect(()=>{let c=t?.joinConsult;if(t===null||c===void 0){l(Object.freeze({status:"refused",refusal:"unavailable",reason:null}));return}let d=`${e}#${String(n)}`,p=a.current;if(p===null||p.key!==d){let f;try{f=c.call(t,e);}catch(y){f=Promise.reject(y);}p={key:d,promise:f},a.current=p;}let g=true;return l(ua),p.promise.then(f=>{g&&(f.ok?l(Object.freeze({status:"ready",credential:f.value})):l(Object.freeze({status:"refused",refusal:Gn(f.error),reason:Yn(f.error)})));},()=>{g&&l(Object.freeze({status:"refused",refusal:"unknown",reason:null}));}),()=>{g=false;}},[e,t,n]);let s=react.useCallback(()=>r(c=>c+1),[]);return {state:i,retry:s}}o(uo,"useTelevetJoin");var po=react.createContext(null);function pa(e){let t=react.useContext(po);react.useEffect(()=>{if(!(t===null||!e))return t.setFullBleed(true),()=>{t.setFullBleed(false);}},[t,e]);}o(pa,"useTelevetModalFullBleed");var ru=da(()=>import('@everfur/sdk/televet/call'));function yo({consultId:e,controller:t,clinicianName:n,petName:r,onLeave:i,style:l}){let a=V(),s=ae(t),{state:c,retry:d}=uo(e,s),[p,g]=react.useState(null),[f,y]=react.useState(false),E=c.status==="ready";react.useEffect(()=>{if(!E||p!==null)return;let R=true;return ru().then(O=>{R&&g(()=>O);},()=>{R&&y(true);}),()=>{R=false;}},[E,p]);let _=E&&p!==null&&!f,P=o(()=>(_||i(),true),"onBackPress");rt(P);let h=react.useRef(P);if(h.current=P,react.useEffect(()=>{let R=reactNative.BackHandler.addEventListener("hardwareBackPress",()=>h.current());return ()=>{R.remove();}},[]),pa(_),c.status==="refused"||f){let R=c.status==="refused"?c.refusal:"unavailable";return jsxRuntime.jsxs(reactNative.View,{style:[a.stepFill,l],testID:"televet-join-refused",children:[jsxRuntime.jsx($,{message:oa(R),testID:"televet-join-refused-message"}),ia(R)&&c.status==="refused"?jsxRuntime.jsx(A,{label:u.retryCta,kind:"primary",onPress:d,testID:"televet-join-retry"}):null,jsxRuntime.jsx(A,{label:jt.leaveCta,kind:"secondary",onPress:i,testID:"televet-join-leave"})]})}if(c.status==="joining"||p===null)return jsxRuntime.jsx(reactNative.View,{style:[a.list,l],testID:"televet-join-loading",accessibilityLabel:u.loading.consult,children:jsxRuntime.jsx(ee,{height:48})});let{EverfurVetCall:T}=p;return jsxRuntime.jsx(T,{roomUrl:c.credential.roomUrl,token:c.credential.token,onLeave:i,clinicianName:n??null,petName:r??null,renderUnavailable:()=>jsxRuntime.jsxs(reactNative.View,{style:[a.stepFill,l],testID:"televet-join-call-unavailable",children:[jsxRuntime.jsx($,{message:la}),jsxRuntime.jsx(A,{label:jt.leaveCta,kind:"secondary",onPress:i,testID:"televet-join-unavailable-leave"})]}),style:l})}o(yo,"TelevetJoinScreen");function mo(e){let{consult:t,onRescheduled:n,onCancel:r,controller:i,style:l,testID:a}=nt(e,["onRescheduled","onCancel"]),s=V(),c=ae(i),d=Rt(t?.clinicianId??null,c),p=_t(c),g=sr(t?.consultId??null,c),[f,y]=react.useState(null),E=react.useCallback(P=>{y(null),p.mutate(P.slotId,{onSuccess:o(()=>{g.mutate(P.slotId,{onSuccess:o(h=>n?.(h),"onSuccess"),onError:o(h=>y(Ve(h).kind==="unavailable"?"unavailable":"failed"),"onError")});},"onSuccess"),onError:o(h=>y(Ve(h).kind==="unavailable"?"unavailable":"taken"),"onError")});},[p,g,n]),_=p.isPending||g.isPending;return Se()?t?jsxRuntime.jsxs(reactNative.View,{style:[s.stepFill,l],testID:a??"televet-reschedule",children:[jsxRuntime.jsx(v,{tier:"compact",style:s.stepHelp,children:ne(u.rescheduleFromTemplate,{when:pe(t.scheduledAt)})}),f==="taken"?jsxRuntime.jsx($,{message:u.slotTaken}):null,f==="failed"?jsxRuntime.jsx($,{message:u.rescheduleFailed}):null,f==="unavailable"?jsxRuntime.jsx($,{message:u.bookingPausedTitle,testID:"televet-reschedule-unavailable"}):null,d.enabled?d.isPending?jsxRuntime.jsx(reactNative.View,{style:s.list,testID:"televet-reschedule-slots-loading",children:[0,1,2].map(P=>jsxRuntime.jsx(ee,{height:48},P))}):d.isError?jsxRuntime.jsx(F,{title:u.slotsErrorTitle,actionLabel:u.retryCta,onAction:()=>d.refetch(),testID:"televet-reschedule-slots-error"}):(d.data??[]).length===0?jsxRuntime.jsx(reactNative.View,{testID:"televet-reschedule-empty",children:jsxRuntime.jsx(F,{title:u.noSlotsTitle})}):jsxRuntime.jsx(Ft,{slots:d.data??[],busySlotId:_?p.variables:null,onPick:E,rowTestIdPrefix:"televet-reschedule-slot",testID:"televet-reschedule-slots"}):jsxRuntime.jsx(reactNative.View,{testID:"televet-reschedule-paused",children:jsxRuntime.jsx(F,{title:u.bookingPausedTitle})}),jsxRuntime.jsx(A,{label:u.keepExistingCta,kind:"secondary",disabled:_,onPress:()=>r?.(),testID:"televet-reschedule-keep"})]}):jsxRuntime.jsx(reactNative.View,{style:[s.list,l],testID:"televet-reschedule-loading",children:[0,1].map(P=>jsxRuntime.jsx(ee,{height:48},P))}):jsxRuntime.jsx(reactNative.View,{style:[s.stepFill,l],testID:"televet-reschedule-copy-unapproved"})}o(mo,"EverfurTelevetReschedule");function vo({controller:e,onOpenVisit:t,onBook:n,onBack:r,revision:i=0,nowMs:l,style:a}){let s=ft(),c=ae(e),d=cn(c,i),{pets:p}=it(),g=d.data??[],f=g.some(C=>!$e.has(C.status)),y=On(f),E=l??y,{upcoming:_,past:P}=react.useMemo(()=>xt(g,E),[g,E]),h=d.enabled&&d.isPending,T=d.isError&&d.data===null,R=!h&&!T&&g.length>0,O=o(C=>{let q=ta(C.status),D=[C.clinicianName,Oe(p,C.petId)].filter(Boolean).join(" \xB7 ");return jsxRuntime.jsxs(reactNative.View,{style:s.row,testID:`televet-visits-row-${C.consultId}`,children:[jsxRuntime.jsxs(reactNative.View,{style:s.rowHead,children:[jsxRuntime.jsx(v,{style:s.when,children:gi(C.scheduledAt)}),q?jsxRuntime.jsx(v,{style:s.status,testID:`televet-visits-status-${C.consultId}`,children:q}):null]}),D?jsxRuntime.jsx(v,{style:s.meta,children:D}):null,C.status==="completed"?null:jsxRuntime.jsx(A,{label:x.manageCta,kind:"secondary",onPress:()=>t(C),testID:`televet-visits-open-${C.consultId}`})]},C.consultId)},"renderRow");return jsxRuntime.jsxs(reactNative.View,{style:[s.screen,a],testID:"televet-visits",children:[jsxRuntime.jsx(Mt,{onBack:r,testID:"televet-visits-back"}),jsxRuntime.jsxs(reactNative.ScrollView,{contentContainerStyle:s.body,children:[R?null:jsxRuntime.jsx(v,{style:s.title,accessibilityRole:"header",children:x.pastTitle}),T?jsxRuntime.jsxs(reactNative.View,{style:s.list,children:[jsxRuntime.jsx(F,{title:x.loadErrorTitle,actionLabel:x.retryCta,onAction:()=>d.refetch(),testID:"televet-visits-error"}),n?jsxRuntime.jsx(va,{onBook:n}):null]}):h?jsxRuntime.jsx(reactNative.View,{style:s.list,testID:"televet-visits-loading",children:[0,1,2].map(C=>jsxRuntime.jsx(ee,{height:72},C))}):g.length===0?jsxRuntime.jsxs(reactNative.View,{style:s.list,testID:"televet-visits-empty",children:[jsxRuntime.jsx(F,{title:x.emptyTitle}),n?jsxRuntime.jsx(A,{label:x.bookCta,onPress:n,testID:"televet-visits-book"}):null]}):jsxRuntime.jsxs(reactNative.View,{style:s.list,children:[_.length>0?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(v,{style:s.title,accessibilityRole:"header",children:x.upcomingTitle}),jsxRuntime.jsx(reactNative.View,{style:s.list,testID:"televet-visits-upcoming",children:_.map(O)})]}):null,n?jsxRuntime.jsx(va,{onBook:n}):null,jsxRuntime.jsx(v,{style:s.title,accessibilityRole:"header",children:x.pastTitle}),P.length>0?jsxRuntime.jsx(reactNative.View,{style:s.list,testID:"televet-visits-past",children:P.map(O)}):null]})]})]})}o(vo,"TelevetVisitsScreen");function va({onBook:e}){let t=ft();return jsxRuntime.jsxs(reactNative.View,{style:t.bookCard,testID:"televet-visits-book-card",children:[jsxRuntime.jsx(v,{style:t.bookTitle,children:x.bookCardTitle}),jsxRuntime.jsx(v,{style:t.bookSubtitle,children:x.bookCardSubtitle}),jsxRuntime.jsx(A,{label:x.bookCta,kind:"primary",onPress:e,testID:"televet-visits-book"})]})}o(va,"BookCard");var go=Object.freeze({name:"home"}),fu=Object.freeze({name:"visits"}),yu=Object.freeze({name:"booking"});function bo(e){let t=e.visitRef?.trim()??"";return t.length>0?Object.freeze({name:"visit",visitRef:t,intent:e.intent??null}):go}o(bo,"televetScreenForRequest");function mu(e,t){switch(t.type){case "push":return Object.freeze({stack:Object.freeze([...e.stack,t.screen])});case "pop":return e.stack.length<=1?e:Object.freeze({stack:Object.freeze(e.stack.slice(0,-1))});case "land":return e.stack[0]?.name!=="home"?e:Object.freeze({stack:Object.freeze([t.screen,...e.stack.slice(1)])});default:return e}}o(mu,"navReducer");function ha(e){let{style:t,renderPending:n,...r}=nt(e,["onExit","onBooked","onAddPet","onRequestLocation","onFindEmergencyVet"]);return jsxRuntime.jsx(Vl,{capability:"televet",style:t,...n?{renderPending:n}:{},children:jsxRuntime.jsx(vu,{...r,style:t})})}o(ha,"EverfurTelevetFlow");function vu({petRef:e,usState:t,controller:n,onBooked:r,onExit:i,onAddPet:l,onPickMedia:a,onAddToCalendar:s,onConfirmDiscard:c,onRequestLocation:d,locationStatus:p,primaryVet:g,onFindEmergencyVet:f,onTriageReason:y,canJoinInApp:E=false,renderUnavailable:_,initialScreen:P,style:h}){let T=V(),[R,O]=react.useReducer(mu,P??go,M=>Object.freeze({stack:Object.freeze([M])})),C=R.stack[R.stack.length-1]??go,q=R.stack.length,[D,z]=react.useState(0),N=react.useCallback(()=>z(M=>M+1),[]),K=react.useCallback(()=>q<=1||C.name==="call"||C.name==="booking"?false:(O({type:"pop"}),true),[q,C.name]);react.useEffect(()=>{let M=reactNative.BackHandler.addEventListener("hardwareBackPress",K);return ()=>{M.remove();}},[K]),rt(K);let fe=react.useCallback(()=>_?_():jsxRuntime.jsx(reactNative.View,{style:T.list,testID:"televet-unavailable",children:Se()?jsxRuntime.jsx(F,{title:u.bookingPausedTitle}):null}),[_,T.list]),Q=react.useCallback(()=>{q>1?O({type:"pop"}):i?.();},[q,i]),oe=o(M=>O({type:"push",screen:M}),"push"),I=react.useCallback(M=>O({type:"land",screen:M==="visits"?fu:yu}),[]),ue=jsxRuntime.jsx(ao,{...e!==void 0?{petRef:e}:{},...t!==void 0?{usState:t}:{},...n?{controller:n}:{},onBooked:M=>{N(),r?.(M);},onExit:Q,...l?{onAddPet:l}:{},...a?{onPickMedia:a}:{},...s?{onAddToCalendar:s}:{},...c?{onConfirmDiscard:c}:{},...d?{onRequestLocation:d}:{},...p?{locationStatus:p}:{},...g?{primaryVet:g}:{},...f?{onFindEmergencyVet:f}:{},...y?{onTriageReason:y}:{},canJoinInApp:E,renderUnavailable:fe,style:h}),ke=jsxRuntime.jsx(vo,{...n?{controller:n}:{},revision:D,onOpenVisit:M=>oe({name:"consult",consult:M}),onBook:()=>oe({name:"booking"}),onBack:Q,style:h});switch(C.name){case "home":return jsxRuntime.jsx(gu,{controller:n,onLand:I,style:h});case "booking":return ue;case "visits":case "visit":return ke;case "consult":return jsxRuntime.jsx(co,{consult:C.consult,...n?{controller:n}:{},revision:D,onJoin:(M,qe)=>oe({name:"call",consultId:M.consultId,clinicianName:M.clinicianName,petName:qe}),onReschedule:M=>oe({name:"reschedule",consult:M}),onCancelled:N,onBack:Q,style:h});case "reschedule":return jsxRuntime.jsx(mo,{consult:C.consult,...n?{controller:n}:{},onRescheduled:()=>{N(),O({type:"pop"});},onCancel:()=>O({type:"pop"}),style:h});case "call":return jsxRuntime.jsx(yo,{consultId:C.consultId,...n?{controller:n}:{},...C.clinicianName!==void 0?{clinicianName:C.clinicianName}:{},...C.petName!==void 0?{petName:C.petName}:{},onLeave:()=>{N(),Q();},style:h});default:return Gt(C)}}o(vu,"TelevetFlowBody");function gu({controller:e,onLand:t,style:n}){let r=V(),i=ae(e),l=kl(i);return react.useEffect(()=>{l!=="pending"&&t(l);},[l,t]),jsxRuntime.jsxs(reactNative.View,{style:[r.screen,r.list,n],testID:"televet-landing-loading",children:[jsxRuntime.jsx(ee,{height:72}),jsxRuntime.jsx(ee,{height:72})]})}o(gu,"TelevetLandingScreen");var ho=ha;function Ru({request:e,onClose:t}){let n=S(),r=reactNativeSafeAreaContext.useSafeAreaInsets(),i=react.useMemo(()=>No(),[]),l=react.useCallback(()=>{i.dispatch()||t();},[i,t]),[a,s]=react.useState(false),c=react.useMemo(()=>({setFullBleed:s}),[]),d=react.useMemo(()=>bo(e),[e]);return jsxRuntime.jsx(reactNative.Modal,{visible:true,animationType:n.motion.reducedMotion?"none":"slide",presentationStyle:"fullScreen",onRequestClose:l,children:jsxRuntime.jsx(reactNative.View,{testID:"everfur-televet-modal",style:[Ta.root,{backgroundColor:n.color.surface},a?null:{paddingTop:r.top,paddingBottom:r.bottom}],children:jsxRuntime.jsx(Mn.Provider,{value:i,children:jsxRuntime.jsx(po.Provider,{value:c,children:jsxRuntime.jsx(ho,{...e.petRef!==void 0?{petRef:e.petRef}:{},...e.usState!==void 0?{usState:e.usState}:{},initialScreen:d,onExit:t,canJoinInApp:sa(),style:Ta.root})})})})})}o(Ru,"EverfurTelevetModal");var Ta=reactNative.StyleSheet.create({root:{flex:1}});exports.BACK_LABEL=Rn;exports.CANCELLATION_POLICY_VERSION_MAX=tn;exports.CANCEL_REASON_MAX=rn;exports.CONSULT_KINDS=el;exports.CONSULT_MINUTES=at;exports.CONSULT_STATUSES=Zo;exports.EverfurTelevet=ho;exports.EverfurTelevetBooking=ao;exports.EverfurTelevetFlow=ha;exports.EverfurTelevetModal=Ru;exports.EverfurTelevetReschedule=mo;exports.MEDIA_REFS_MAX=nn;exports.NO_MEDIA_SHORTFALL=Ot;exports.REASON_TEXT_MAX=_e;exports.TELEVET_BOOKING_BASE=Ne;exports.TELEVET_BOOKING_COPY=u;exports.TELEVET_BOOKING_STEPS=ze;exports.TELEVET_CONSULT_PAGE_LIMIT=pl;exports.TELEVET_JOIN_CLOSES_MINUTES_AFTER=ur;exports.TELEVET_JOIN_OPENS_MINUTES_BEFORE=cr;exports.TERMINAL_CONSULT_STATUSES=$e;exports.TelevetBookedScreen=Yr;exports.TelevetBookingChrome=Jr;exports.TelevetClinicianEmptyState=Oi;exports.TelevetConsentCheckbox=Nt;exports.TelevetConsultScreen=co;exports.TelevetDayStrip=Zr;exports.TelevetEarlyEmergency=Ii;exports.TelevetEmergencyExits=At;exports.TelevetEntitlementInterestState=qr;exports.TelevetIntakeMedia=Qr;exports.TelevetJoinScreen=yo;exports.TelevetMediaDropNotice=Bt;exports.TelevetSlotPicker=Ft;exports.TelevetStateInterestAction=Wr;exports.TelevetSummaryCard=no;exports.TelevetSummaryRow=et;exports.TelevetVisitsScreen=vo;exports.attestation=Dr;exports.canConfirm=It;exports.canManageTelevetVisit=fr;exports.createTelevetBookingController=er;exports.currentStep=Or;exports.emptyTelevetDraft=yi;exports.formatVisitRange=Vd;exports.formatWhen=vi;exports.formatWhenWithDay=pe;exports.hasPreviousStep=Pr;exports.initialTelevetBookingState=wr;exports.isHoldExpired=Ar;exports.isMediaShortfallEmpty=jr;exports.isSkipped=Tn;exports.isTelevetBookingCopyReady=Se;exports.isWellFormedStateCode=me;exports.mediaShortfallFromUnsentPicks=Cn;exports.parseVetCallCredential=Kn;exports.splitTelevetVisits=xt;exports.televetBookingKey=Br;exports.televetBookingReducer=Ir;exports.televetBookingRefusal=Ve;exports.televetCancelCall=ul;exports.televetConsultCalendarKey=Ni;exports.televetConsultCall=ln;exports.televetDaysFromSlots=wn;exports.televetEmptyRosterCause=Mr;exports.televetEmptyRosterView=zr;exports.televetHoldCall=sl;exports.televetJoinCall=cl;exports.televetJoinOpensAtMs=$s;exports.televetJoinReadiness=pr;exports.televetMediaShortfallLines=Hr;exports.televetRescheduleCall=dl;exports.televetScreenForRequest=bo;exports.useEarlyTriage=Lr;exports.useStateInterest=Vr;exports.useTelevetBookConsult=ar;exports.useTelevetBookingAvailable=Ws;exports.useTelevetBookingController=ae;exports.useTelevetBookingEntitlement=or;exports.useTelevetCancellationPolicy=St;exports.useTelevetClinicians=lr;exports.useTelevetHoldSlot=_t;exports.useTelevetJoin=uo;exports.useTelevetNextSlot=ir;exports.useTelevetRescheduleConsult=sr;exports.useTelevetSlots=Rt;exports.useTelevetStatePolicy=rr;exports.validateBookingBody=fl;exports.vetCallJoinReason=Yn;exports.vetCallJoinRefusal=Gn;exports.withUnsentPicks=Wd;
1
+ 'use strict';var react=require('react'),reactNative=require('react-native'),jsxRuntime=require('react/jsx-runtime'),reactNativeSafeAreaContext=require('react-native-safe-area-context');var Fa=Object.defineProperty;var o=(e,t)=>Fa(e,"name",{value:t,configurable:true});function Gt(e){throw new Error(`assertNever: unhandled discriminated-union member ${JSON.stringify(e)}`)}o(Gt,"assertNever");function Fo(e){return Object.freeze({kind:"error",terminal:true,code:e.code,retryable:e.retryable,wireMessage:e.wireMessage,synthesized:e.synthesized,lastEventId:e.lastEventId,serverRequestId:e.serverRequestId??null})}o(Fo,"errorFrame");function Mn(e){let t=globalThis.console;try{t?.error?.("[everfur] A host callback threw; the SDK ignored it.",e);}catch{}}o(Mn,"reportHostFailure");function Va(e){return (typeof e=="object"||typeof e=="function")&&e!==null&&typeof e.then=="function"}o(Va,"isThenable");function Jt(e,...t){if(typeof e=="function")try{let n=e(...t);return Va(n)&&Promise.resolve(n).then(void 0,Mn),n}catch(n){Mn(n);return}}o(Jt,"callHost");var No=new WeakMap;function Ma(e){if(typeof e!="function")return;let t=No.get(e);if(t!==void 0)return t;let n=o((...r)=>{Jt(e,...r);},"guarded");return No.set(e,n),n}o(Ma,"guardHost");function nt(e,t){let n=null;for(let r of t){let i=e[r];typeof i=="function"&&(n??={...e},n[r]=Ma(i));}return n??e}o(nt,"guardHostProps");function Xt(e,...t){let n;try{n=e(...t);}catch(r){return Mn(r),Promise.resolve({ok:false,error:r})}return Promise.resolve(n).then(r=>({ok:true,value:r}),r=>({ok:false,error:r}))}o(Xt,"callHostAsync");function Lo(){let e=[];return {register(t){return e=[...e,t],()=>{e=e.filter(n=>n!==t);}},dispatch(){for(let t of [...e].reverse())try{if(t())return !0}catch{}return false}}}o(Lo,"createTelevetBackChannel");var zn=react.createContext(null);function rt(e,t=true){let n=react.useContext(zn),r=react.useRef(e);r.current=e,react.useEffect(()=>{if(!(n===null||!t))return n.register(()=>r.current())},[n,t]);}o(rt,"useTelevetBackChannel");var m=o(e=>e,"DRAFT"),Wa=["[PLACEHOLDER","[PLAN NAME]","[LINK]","[Last]","TODO","TBD"];function qa(e){return Wa.some(t=>e.toUpperCase().includes(t.toUpperCase()))}o(qa,"isPlaceholderCopy");function ne(e,t){let n=e;for(let[r,i]of Object.entries(t))n=n.split(`{${r}}`).join(i);return n}o(ne,"fill");var u=Object.freeze({stateBlockedTitle:m("Not available in this state yet"),noCliniciansTitle:m("No vets available right now"),noCliniciansBody:m("Nobody is free in your area at the moment. This changes through the day."),noCliniciansRetryCta:m("Check again"),noCliniciansRegionBody:m("Video visits have to be with a vet licensed in your state, and we don\u2019t have one there yet."),yourVetTitle:m("Your Vet"),reviewsLabel:m("reviews"),rescheduleFromTemplate:m("Moving your visit on {when}"),rescheduleFailed:m("That did not move. Your original time is unchanged."),keepExistingCta:m("Keep my current time"),bookingPausedTitle:m("Booking is not available right now."),slotsErrorTitle:m("Could not load times"),noSlotsTitle:m("No times available"),nextOpeningTemplate:m("Next opening across our vets: {when}"),seeOtherVetsCta:m("See other vets"),retryCta:m("Try again"),holdExpired:m("That time is no longer held. Pick another."),slotTaken:m("That time was just taken. Pick another."),reasonPlaceholder:m("What is going on with your pet?"),reasonTooLong:m("That is too long. Please shorten it."),shareRecordsOff:m("Share health records with this vet"),confirmNotEntitled:m("A Pro membership is needed to book a video visit."),confirmFailed:m("That did not book. Try again."),checkAvailabilityCta:m("Check availability"),stateInterest:Object.freeze({cta:m("Add me to the list"),submitting:m("Adding you to the list\u2026"),joinedTitle:m("You are on the list"),joinedBody:m("We will let you know when this changes."),failed:m("That did not save. Try again.")}),media:Object.freeze({droppedTemplate:m("{n} attachment did not upload."),droppedPluralTemplate:m("{n} attachments did not upload."),refusedSizeTemplate:m("{n} attachment was too large to send."),refusedSizePluralTemplate:m("{n} attachments were too large to send."),refusedTypeTemplate:m("{n} attachment is a file type that cannot be sent."),refusedTypePluralTemplate:m("{n} attachments are file types that cannot be sent."),refusedUnreadableTemplate:m("{n} attachment could not be read."),refusedUnreadablePluralTemplate:m("{n} attachments could not be read.")}),navTitle:m("Book a visit"),rescheduleNavTitle:m("Change your visit"),close:m("Close"),continueCta:m("Continue"),petSelectTitle:m("Who is this visit for?"),addPetCta:m("Add a pet"),locationUnknownTitle:m("We need your location to find a vet"),locationUnknownBody:m("Turn on location for Everfur, then try again."),locationUnknownCta:m("Allow location"),locationBlockedTitle:m("Location is turned off"),locationBlockedBody:m("Everfur needs your location to match you with a vet in your area."),locationBlockedCta:m("Open Settings"),locationUnavailableTitle:m("We could not read your location"),locationUnavailableBody:m("Try again in a moment."),stateAttestTemplate:m("I confirm my pet and I are in {state} right now."),describeHeading:m("Tell the vet what you are seeing"),describeHelpLong:m("A few sentences is plenty. When it started, what changed, anything you've already tried."),addPhotoCta:m("ADD PHOTO OR VIDEO"),removePhotoLabel:m("Remove photo"),summaryPet:m("Pet"),summaryVet:m("Vet"),summaryWhen:m("When"),summaryLength:m("Length"),summaryReason:m("Reason"),summaryLengthTemplate:m("{n} minutes"),confirmCta:m("Confirm visit"),bookedTitle:m("You are booked."),addToCalendarCta:m("Add to calendar"),doneCta:m("Done"),booked:Object.freeze({remindPromise:m("We will notify you 30 minutes before."),summaryPromise:m("{pet}'s summary goes to the vet ahead of the call."),joinPromise:m("Join right here in the app. No links to hunt for."),backToPet:m("Back to {pet}"),calendarAdded:m("Added to your calendar"),calendarFailedBody:m("That did not save to your calendar.")}),chrome:Object.freeze({closeHint:m("Closes without saving"),discardTitle:m("Leave without booking?"),discardBody:m("Your answers will not be saved."),discardConfirmCta:m("Leave"),discardKeepCta:m("Keep going"),noPetsTitle:m("No pets on this account"),loadFailedTitle:m("Could not load"),retryCta:m("Try again")}),emergency:Object.freeze({bannerTitle:m("This cannot wait for a scheduled call."),keepBookingCta:m("I have handled this, keep booking"),lede:m("What you are describing is the kind of thing vets want to see in person, now."),exitPrimaryVetTitle:m("Call {petName}'s primary vet"),exitFindErTitle:m("Find an emergency vet near you"),startCallHint:m("Starts a phone call")}),visit:Object.freeze({title:m("Your visit")}),loading:Object.freeze({pets:"Loading pets. Nothing to read yet.",clinicians:"Loading vets. Nothing to read yet.",slots:"Loading times. Nothing to read yet.",consult:"Loading your visit. Nothing to read yet.",progressTemplate:"Step {step} of {total}"})});function Vo(e=u){return typeof e=="string"?[e]:typeof e!="object"||e===null?[]:Object.values(e).flatMap(t=>Vo(t))}o(Vo,"televetBookingCopyValues");function Se(){return Vo().every(e=>e.trim().length>0&&!qa(e))}o(Se,"isTelevetBookingCopyReady");var jn=Object.freeze([Object.freeze({wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"AuthorizationException",envelope:"http_envelope",httpStatus:401,retryable:false}),Object.freeze({wireCode:"ConflictException",envelope:"http_envelope",httpStatus:409,retryable:true}),Object.freeze({wireCode:"DAILY_QUOTA_EXCEEDED",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"FILE_TOO_LARGE",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"IDEMPOTENCY_KEY_IN_FLIGHT",envelope:"http_envelope",httpStatus:409,retryable:true}),Object.freeze({wireCode:"IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"INVALID_CONTENT_TYPE",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"InternalFailureException",envelope:"http_envelope",httpStatus:500,retryable:true}),Object.freeze({wireCode:"MethodNotAllowedException",envelope:"http_envelope",httpStatus:405,retryable:false}),Object.freeze({wireCode:"NotImplementedException",envelope:"http_envelope",httpStatus:501,retryable:false}),Object.freeze({wireCode:"PaymentRequiredException",envelope:"http_envelope",httpStatus:402,retryable:false}),Object.freeze({wireCode:"ResourceNotFoundException",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"ServiceUnavailableException",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"TIER_UPGRADE_REQUIRED",envelope:"http_envelope",httpStatus:402,retryable:false}),Object.freeze({wireCode:"ThrottlingException",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"ValidationException",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"accessDenied",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"access_denied",envelope:"oauth_error",httpStatus:302,retryable:false}),Object.freeze({wireCode:"attachment_unreadable",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"authExpired",envelope:"http_envelope",httpStatus:401,retryable:true}),Object.freeze({wireCode:"authRejected",envelope:"http_envelope",httpStatus:401,retryable:false}),Object.freeze({wireCode:"consent_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"consent_required",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"consent_scope_wrong_route",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"device_cipher_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"email_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"event_cursor_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_payload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_type_not_available",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_type_unknown",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_required",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_reused",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"insufficientCapability",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"insufficient_scope",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"internal_error",envelope:"sse_frame",httpStatus:200,retryable:false}),Object.freeze({wireCode:"invalidRequest",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_client",envelope:"oauth_error",httpStatus:401,retryable:false}),Object.freeze({wireCode:"invalid_client_metadata",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_grant",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_redirect_uri",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_request",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_scope",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_target",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"mcp_connection_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"mcp_request_conflict",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"mcp_request_gone",envelope:"http_envelope",httpStatus:410,retryable:false}),Object.freeze({wireCode:"mcp_request_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"not_found",envelope:"sse_frame",httpStatus:200,retryable:false}),Object.freeze({wireCode:"partner_visit_link_conflict",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"partner_visit_owner_only",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"partner_visit_pet_already_mapped",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"payload_too_large",envelope:"http_envelope",httpStatus:413,retryable:false}),Object.freeze({wireCode:"petRefInUse",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"pet_health_list_removals_unconfirmed",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"pet_health_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"pet_not_registered",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"provider_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"rateLimited",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"record_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"record_subject_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"record_upload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"records_consent_required",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"sandbox_only",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"session_required",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"share_limit_reached",envelope:"http_envelope",httpStatus:429,retryable:false}),Object.freeze({wireCode:"slow_down",envelope:"oauth_error",httpStatus:429,retryable:true}),Object.freeze({wireCode:"species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"tenant_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"tenant_has_no_capabilities",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"tenant_resource_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"tenant_surface_not_enabled",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"timeout",envelope:"sse_frame",httpStatus:200,retryable:true}),Object.freeze({wireCode:"token_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"unavailable",envelope:"sse_frame",httpStatus:200,retryable:true}),Object.freeze({wireCode:"unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"unsupported_grant_type",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"unsupported_response_type",envelope:"oauth_error",httpStatus:302,retryable:false}),Object.freeze({wireCode:"verify_mint_rate_limited",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"verify_mint_refused",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"verify_mint_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"verify_user_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"webhook_endpoint_update_empty",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"webhook_endpoint_update_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false})]);Object.freeze(jn.map(e=>e.wireCode));var Ka=Object.freeze({ValidationException:"validationFailed",AuthorizationException:"authRejected",PaymentRequiredException:"paymentRequired",AccessDeniedException:"accessDenied",ResourceNotFoundException:"resourceNotFound",ConflictException:"conflict",ThrottlingException:"rateLimited",InternalFailureException:"internalError",NotImplementedException:"notImplemented",ServiceUnavailableException:"serviceUnavailable",MethodNotAllowedException:"validationFailed",authExpired:"authExpired",unavailable:"serviceUnavailable",session_required:"sessionRequired",accessDenied:"accessDenied",invalidRequest:"sdkUpdateRequired",authRejected:"authRejected",rateLimited:"rateLimited",insufficientCapability:"accessDenied",event_cursor_invalid:"validationFailed",event_filter_invalid:"validationFailed",event_payload_invalid:"validationFailed",event_type_unknown:"validationFailed",idempotency_key_invalid:"validationFailed",idempotency_key_required:"validationFailed",idempotency_key_reused:"idempotencyConflict",payload_too_large:"validationFailed",webhook_url_rejected:"validationFailed",webhook_endpoint_update_empty:"validationFailed",webhook_endpoint_update_invalid:"validationFailed",event_type_not_available:"conflict",record_subject_not_found:"resourceNotFound",records_consent_required:"conflict",record_species_unsupported:"validationFailed",record_upload_invalid:"validationFailed",FILE_TOO_LARGE:"validationFailed",INVALID_CONTENT_TYPE:"validationFailed",attachment_unreadable:"validationFailed",provider_unsupported:"validationFailed",token_invalid:"validationFailed",device_cipher_unavailable:"serviceUnavailable",email_invalid:"validationFailed",consent_required:"validationFailed",consent_invalid:"validationFailed",consent_scope_wrong_route:"validationFailed",IDEMPOTENCY_KEY_IN_FLIGHT:"idempotencyInFlight",IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST:"idempotencyConflict",DAILY_QUOTA_EXCEEDED:"quotaExceeded",TIER_UPGRADE_REQUIRED:"paymentRequired",not_found:"conversationNotFound",timeout:"streamTimeout",internal_error:"internalError",invalid_request:"validationFailed",invalid_client:"authRejected",invalid_grant:"authRejected",unsupported_grant_type:"validationFailed",invalid_scope:"validationFailed",invalid_target:"validationFailed",invalid_redirect_uri:"validationFailed",invalid_client_metadata:"validationFailed",unsupported_response_type:"validationFailed",access_denied:"accessDenied",slow_down:"rateLimited",mcp_request_not_found:"resourceNotFound",mcp_request_gone:"resourceNotFound",mcp_connection_not_found:"resourceNotFound",mcp_request_conflict:"conflict",sandbox_only:"accessDenied",tenant_has_no_capabilities:"conflict",verify_mint_refused:"accessDenied",verify_mint_rate_limited:"rateLimited",verify_mint_unavailable:"serviceUnavailable",verify_user_ref_invalid:"validationFailed",insufficient_scope:"accessDenied",tenant_filter_invalid:"validationFailed",tenant_resource_not_found:"resourceNotFound",tenant_surface_not_enabled:"conflict",pet_health_species_unsupported:"validationFailed",pet_health_list_removals_unconfirmed:"validationFailed",petRefInUse:"conflict",share_limit_reached:"conflict",pet_not_registered:"resourceNotFound",species_unsupported:"validationFailed",partner_visit_owner_only:"accessDenied",partner_visit_link_conflict:"conflict",partner_visit_pet_already_mapped:"conflict"}),zo=Object.freeze(jn.map(e=>Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:Ka[e.wireCode]}))),Ya=new Map(zo.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),Ga=Object.freeze(["http_envelope",...[...new Set(zo.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function Qt(e,t){if(typeof e!="string")return;let n=e.trim().toUpperCase();if(n.length!==0)for(let r of [t??"http_envelope",...Ga]){let i=Ya.get(r+n);if(i)return i}}o(Qt,"contractErrorFor");function Ja(e){return e.envelope==="sse_frame"?`/errors#sse-${e.wireCode}`:e.envelope==="oauth_error"?`/errors#oauth-${e.wireCode}`:`/errors#${e.wireCode}`}o(Ja,"contractDocUrl");function jo(e){return null}o(jo,"publishedDocUrl");var Xa=Object.freeze({authExpired:"authentication",authRejected:"authentication",sessionRequired:"authentication",accessDenied:"authorization",paymentRequired:"entitlement",quotaExceeded:"rateLimit",rateLimited:"rateLimit",validationFailed:"invalidRequest",sdkUpdateRequired:"invalidRequest",conversationNotFound:"notFound",petNotFound:"notFound",resourceNotFound:"notFound",conflict:"conflict",idempotencyConflict:"conflict",idempotencyInFlight:"conflict",streamTimeout:"connection",streamIncomplete:"connection",upstreamLlmTimeout:"connection",serviceUnavailable:"connection",internalError:"server",notImplemented:"server",mediaUploadFailed:"media",moderationBlocked:"policy",unknown:"unknown"});function Ho(e){return Xa[e]}o(Ho,"categoryFor");function Uo(e){let t=Qt(e);if(t)return t.normalized;let n=(e??"").trim().toUpperCase(),r=n.replace(/[^A-Z0-9]/g,"");if(r==="AUTHREJECTED")return "authRejected";if(n.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 "NOTFOUND":case "CONVERSATIONNOTFOUND":return "conversationNotFound";case "PETNOTFOUND":return "petNotFound";case "TIMEOUT":case "STREAMTIMEOUT":return "streamTimeout";case "MEDIAUPLOADFAILED":case "UNRECOGNIZEDVIDEOFORMAT":case "FILETOOSMALL":return "mediaUploadFailed";case "MODERATIONBLOCKED":return "moderationBlocked";case "UPSTREAMLLMTIMEOUT":return "upstreamLlmTimeout";case "INTERNALERROR":case "INTERNALSERVERERROR":return "internalError";case "STREAMINCOMPLETE":case "CHATSTREAMINCOMPLETE":return "streamIncomplete";case "INVALIDANALYSISTYPE":case "INVALIDUPLOADPURPOSE":return "unknown";default:return "unknown"}}o(Uo,"fromWire");var Qa=new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function Hn(e){return Qa.has(e)}o(Hn,"isAutoRetryable");var Za=new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function Wo(e){return Hn(e)||Za.has(e)}o(Wo,"isRetryableCode");var es=500,Un=8e3,qo=4;function $o(e,t=Math.random){let n=Math.max(0,e),r=Math.min(es*2**n,Un);return Math.floor(t()*r)}o($o,"backoffDelayMs");var ts=Object.freeze({authExpired:"Please sign in again to continue.",authRejected:"Please sign in again to continue.",sessionRequired:"This app needs to be updated to keep using Everfur.",accessDenied:"This feature isn't available on your account right now.",paymentRequired:"This is part of a paid plan.",quotaExceeded:"You have used today's messages. This resets tomorrow.",rateLimited:"You are sending messages quickly. Try again in a few seconds.",validationFailed:"Something in that request was not right. Check the details and try again.",sdkUpdateRequired:"This app needs to be updated to keep using Everfur.",conflict:"That is already running. Wait for it to finish, then try again.",idempotencyConflict:"That message was already delivered.",idempotencyInFlight:"That is still processing. Give it a moment.",conversationNotFound:"This conversation is no longer available.",petNotFound:"We could not find that pet. Please pick a pet and try again.",resourceNotFound:"We could not find that.",streamTimeout:"The response timed out. Tap retry to try again.",mediaUploadFailed:"We could not upload that photo. Please attach it again.",moderationBlocked:"This request cannot be answered here.",upstreamLlmTimeout:"The response timed out. Tap retry to try again.",internalError:"We hit a snag on our end. Please try again.",notImplemented:"That is not available yet.",serviceUnavailable:"That service is briefly unavailable. Try again shortly.",streamIncomplete:"The connection dropped mid-answer. Tap retry to continue.",unknown:"Something went wrong. Please try again."});function Wn(e){return ts[e]}o(Wn,"userFacingError");function Ko(e,t,n){Object.defineProperty(e,t,{value:n,enumerable:false,writable:false,configurable:false});}o(Ko,"defineHidden");var ns=/^[a-z][a-z0-9_]{0,63}$/;function ye(e,t){let n=Qt(t?.wireCode,t?.wireEnvelope),r={code:e,category:Ho(e),retryable:t?.retryable??Wo(e),displayMessage:Wn(e)};if(t?.httpStatus!==void 0&&(r.httpStatus=t.httpStatus),t?.requestId&&(r.requestId=t.requestId),typeof t?.reasonCode=="string"&&ns.test(t.reasonCode)&&(r.reasonCode=t.reasonCode),n);return t?.wireMessage&&Ko(r,"wireMessage",t.wireMessage),t?.raw!==void 0&&t.raw!==null&&Ko(r,"raw",t.raw),Object.freeze(r)}o(ye,"makeEverfurError");function L(e,t){return Object.freeze(t===void 0?{ok:true,value:e}:{ok:true,value:e,warning:t})}o(L,"ok");function w(e){return Object.freeze({ok:false,error:e})}o(w,"err");var Zt=class Zt extends Error{constructor(t,n){super(n),this.name="EverfurConfigError",this.kind=t,Object.setPrototypeOf(this,Zt.prototype);}};o(Zt,"EverfurConfigError");var bt=Zt;function rs(e){let t={};return e.mode==="personalized"?t.authorization=`Bearer ${e.token}`:t["x-everfur-partner-key"]=e.publishableKey,e.userRef&&(t["x-everfur-user-ref"]=e.userRef),e.sessionId&&(t["x-everfur-session-id"]=e.sessionId),t}o(rs,"authHeaders");function ht(e,t){return {...e,headers:{...os(e.headers),...rs(t)}}}o(ht,"withAuthHeaders");function os(e){if(!e)return {};let t={};for(let[n,r]of Object.entries(e)){let i=n.toLowerCase();i==="authorization"||i==="x-everfur-partner-key"||(t[n]=r);}return t}o(os,"stripAuthHeaders");async function Yo(e,t){if(t.mode==="anonymous")return t.transport.request(ht(e,{mode:"anonymous",publishableKey:t.publishableKey,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));let n;try{n=await t.identity.currentToken();}catch{return w(qn())}let r=await t.transport.request(ht(e,{mode:"personalized",token:n,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));if(r.ok||r.error.httpStatus!==401)return r;let i;try{i=await t.identity.currentToken({forceRefresh:!0});}catch{return w(qn())}let l=await t.transport.request(ht(e,{mode:"personalized",token:i,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));return !l.ok&&l.error.httpStatus===401?w(qn(l.error.httpStatus)):l}o(Yo,"authedSend");function qn(e){return ye("authRejected",{retryable:false,...e!==void 0?{httpStatus:e}:{}})}o(qn,"authRejectedError");function Go(e){return ye("internalError",{retryable:true,wireMessage:ls(e)})}o(Go,"networkError");function ls(e){return e instanceof Error?e.message:typeof e=="string"?e:"network request failed"}o(ls,"describeCause");var is=3e4,as=Un*2,ss="idempotency-key",ds=new Set(["POST","PUT","PATCH","DELETE"]),cs=Object.freeze({onEvent(){}}),us=Object.freeze({setTimeout:o((e,t)=>setTimeout(e,t),"setTimeout"),clearTimeout:o(e=>clearTimeout(e),"clearTimeout"),now:o(()=>Date.now(),"now")});function ps(e){let t=e.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return t.length===0?null:`efs_${t}`.slice(0,128)}o(ps,"seededIdempotencyKey");function Tt(e){let t=e.observer??cs,n=e.timers??us,r=e.rng??Math.random,i=e.sleep??((f,y)=>_s(f,n,y)),l=e.maxAttempts??qo,a=e.unaryTimeoutMs??is,s=e.newIdempotencyKey??ys(),c=o(f=>{try{t.onEvent(f);}catch{}},"emit");async function d(f,y,E){let _=E?.maxAttempts,P=Math.max(1,_??l),h=E?.idempotent??ds.has(y.method),T=E?.idempotencyKey===void 0?null:ps(E.idempotencyKey),R=h?T??s():null,O=fs(y,R),C=0;for(;;){let q=o(oe=>Object.freeze({call:f,method:y.method,path:y.path,attempt:C,...R?{idempotencyKey:R}:{},...oe}),"stamp");c(q({phase:"attempt"}));let D=Ss(a,n),M=Rs(D.signal,y.signal),N;try{N=await Yo({...O,signal:M.signal},e.auth);}catch(oe){N=w(Go(oe));}finally{M.dispose(),D.cancel();}if(N.ok)return c(q({phase:"settled",ok:true,reason:"ok"})),N;let K=N.error,fe=vs(K,C,{maxAttempts:P,rng:r,now:n.now(),aborted:y.signal?.aborted===true,..._!==void 0?{perCallMaxAttempts:_}:{},...e.errorPolicy!==void 0?{policy:e.errorPolicy}:{}}),Q={ok:false,code:K.code,reason:fe.reason,...K.httpStatus!==void 0?{httpStatus:K.httpStatus}:{},...K.requestId!==void 0?{requestId:K.requestId}:{}};if(!fe.retry)return c(q({phase:"settled",...Q})),w(K);if(c(q({phase:"retry",...Q,delayMs:fe.delayMs})),await i(fe.delayMs,y.signal),y.signal?.aborted===true)return c(q({phase:"settled",...Q,reason:"aborted"})),w(K);C+=1;}}o(d,"send");async function p(f){return ht(f,await Cs(e.auth))}o(p,"authorize");async function*g(f,y,E){c(Object.freeze({call:f,phase:"stream.open",method:y.method,path:y.path,attempt:0}));try{yield*e.auth.transport.stream(y,E);}catch{yield Fo({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:null});}}return o(g,"stream"),Object.freeze({send:d,authorize:p,stream:g})}o(Tt,"createRequestFunnel");function fs(e,t){let n={};for(let[r,i]of Object.entries(e.headers??{}))r.toLowerCase()!==ss&&(n[r]=i);return t!==null&&(n["Idempotency-Key"]=t),{...e,headers:n}}o(fs,"assembleHeaders");function ys(){let e=0;return ()=>`efk_${Date.now().toString(36)}_${(e++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}o(ys,"defaultIdempotencyKeyFactory");var ms=10;function vs(e,t,n){if(n.aborted)return {retry:false,reason:"aborted"};let r=gs(e);if(r==="quota")return {retry:false,reason:"daily-quota-exhausted"};if(r!=="burst"&&!Hn(e.code))return {retry:false,reason:"terminal-code"};let i=r==="burst"?"burst-throttle":"retryable-code";if(o(()=>{if(n.policy===void 0)return false;try{return !n.policy.shouldRetry(e.code,t)}catch{return false}},"policyVetoedRetry")())return {retry:false,reason:"terminal-code"};let a=o(()=>{if(n.policy===void 0)return null;let d;try{d=n.policy.maxAttempts(e.code);}catch{return null}return typeof d!="number"||!Number.isFinite(d)?null:Math.max(1,Math.min(ms,Math.floor(d)))},"policyCeiling"),s=n.perCallMaxAttempts??a()??n.maxAttempts;if(t+1>=s)return {retry:false,reason:"attempts-exhausted"};let c=bs(e,n.now);return c!==null?c>as?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:i,delayMs:c}:{retry:true,reason:i,delayMs:$o(t,n.rng)}}o(vs,"decideRetry");function gs(e){let t=e.code==="unknown"?Uo(ks(e.raw)):e.code;return t==="quotaExceeded"?"quota":t==="rateLimited"||e.httpStatus===429?"burst":null}o(gs,"throttleKind");function bs(e,t){let n=Ts(e.raw);if(n!==null){let i=n-t;return i>0?i:0}let r=hs(e.raw);return r===null?null:Math.round(r*1e3)}o(bs,"retryOverrideMs");function hs(e){for(let t of $n(e)){let n=t.retry_after_seconds;if(typeof n=="number"&&Number.isFinite(n)&&n>=0)return n}return null}o(hs,"findRetryAfterSeconds");function Ts(e){for(let t of $n(e)){let n=t.resets_at,r=Es(n);if(r!==null)return r}return null}o(Ts,"findResetsAt");function $n(e){if(!Jo(e))return [];let t=[e];for(let n of ["error","detail"]){let r=e[n];Jo(r)&&t.push(r);}return t}o($n,"candidateScopes");function Es(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}o(Es,"parseInstantMs");function ks(e){for(let t of $n(e)){let n=t.code;if(typeof n=="string"&&n.length>0)return n}return null}o(ks,"rawWireCode");function Jo(e){return typeof e=="object"&&e!==null}o(Jo,"isRecord");async function Cs(e){return e.mode==="anonymous"?{mode:"anonymous",publishableKey:e.publishableKey,userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{}}:{mode:"personalized",token:await e.identity.currentToken(),userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{}}}o(Cs,"resolveDeviceAuth");function Ss(e,t){let n=new AbortController,r=t.setTimeout(()=>n.abort(),e);return {signal:n.signal,cancel:o(()=>t.clearTimeout(r),"cancel")}}o(Ss,"boundedSignal");function Rs(e,t){let n=o(()=>{},"noop");if(!t)return {signal:e,dispose:n};let r=new AbortController;if(e.aborted||t.aborted)return r.abort(),{signal:r.signal,dispose:n};let i=o(()=>r.abort(),"onAbort");return e.addEventListener("abort",i,{once:true}),t.addEventListener("abort",i,{once:true}),{signal:r.signal,dispose:o(()=>{e.removeEventListener("abort",i),t.removeEventListener("abort",i);},"dispose")}}o(Rs,"mergeSignals");function _s(e,t,n){return e<=0||n?.aborted===true?Promise.resolve():new Promise(r=>{let i=t.setTimeout(()=>{n?.removeEventListener("abort",l),r();},e),l=o(()=>{t.clearTimeout(i),r();},"onAbort");n?.addEventListener("abort",l,{once:true});})}o(_s,"delayAbortable");function xs(e){try{return new URL(e.trim()).protocol==="https:"}catch{return false}}o(xs,"isSafeRoomUrl");function ws(e,t){return xs(e)&&t.trim().length>0}o(ws,"isUsableRoomCredential");function en(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(en,"isRecord");function Kn(e,t){return typeof e=="number"&&Number.isInteger(e)&&e>=t?e:null}o(Kn,"wholeNumber");function Ps(e){if(!en(e))return null;let t=Kn(e.consult_minutes,1),n=Kn(e.auto_end_minutes,0),r=Kn(e.warn_before_seconds,0);return t===null||n===null||r===null?null:Object.freeze({consultMinutes:t,autoEndMinutes:n,warnBeforeSeconds:r})}o(Ps,"parseCallLimits");function Yn(e){if(!en(e))return null;let t=e.room_url??e.url,n=e.token;if(typeof t!="string"||typeof n!="string"||!ws(t,n))return null;let r=e.recording_notice;return Object.freeze({roomUrl:t.trim(),token:n,recordingNotice:typeof r=="boolean"?r:true,callLimits:Ps(e.call_limits)})}o(Yn,"parseVetCallCredential");function Gn(e){let t=Xo(e.raw);return t!==null&&t.length>0?t:null}o(Gn,"vetCallJoinReason");function Xo(e){if(!en(e))return null;let t=e.detail??e.error,r=(en(t)?t:e).reason;return typeof r=="string"?r:null}o(Xo,"reasonOf");function Jn(e){if(e.httpStatus===404)return "unavailable";let t=Xo(e.raw);return t==="too_early"||t==="too_late"||t==="room_not_ready"?t:t!==null&&t.startsWith("status_")?"not_joinable":"unknown"}o(Jn,"vetCallJoinRefusal");var Zo=["scheduled","in_progress","awaiting_summary","completed","cancelled_owner","cancelled_ops","no_show_owner","no_show_vet"],$e=new Set(["completed","cancelled_owner","cancelled_ops","no_show_owner","no_show_vet"]),el=["wellness","prescription"],tn=64,_e=2e3,nn=10;function me(e){return typeof e=="string"&&/^[A-Za-z]{2}$/.test(e.trim())}o(me,"isWellFormedStateCode");function Re(e){return typeof e=="object"&&e!==null?e:null}o(Re,"row");function Z(e){return typeof e=="string"&&e.length>0?e:null}o(Z,"str");function Ne(e){return typeof e=="string"&&e.trim().length>0?e.trim():null}o(Ne,"trimmedOrNull");function ot(e,t){return typeof e=="boolean"?e:t}o(ot,"bool");function Xn(e){return typeof e=="number"&&Number.isFinite(e)?e:null}o(Xn,"num");function Qo(e,t){return typeof t=="string"&&e.includes(t)?t:"unknown"}o(Qo,"closed");function lt(e,t){if(!Array.isArray(e))return Object.freeze([]);let n=[];for(let r of e){let i=t(r);i!==null&&n.push(i);}return Object.freeze(n)}o(lt,"parseList");function tl(e,t){let n=Re(e);return n===null?null:Object.freeze({state:Z(n.state)??t,wellnessAvailable:ot(n.wellness_available,false),prescriptionsAvailable:ot(n.prescriptions_available,false),cancellationPolicyText:Ne(n.cancellation_policy_text)})}o(tl,"parseStatePolicy");function nl(e){let t=Re(e);if(t===null)return null;let n=Ne(t.summary),r=Ne(t.version);return n===null||r===null?null:Object.freeze({summary:n,version:r})}o(nl,"parseCancellationPolicy");function rl(e){let t=Re(e);if(t===null)return null;let n=Z(t.clinician_id),r=Z(t.display_name);return n===null||r===null?null:Object.freeze({clinicianId:n,displayName:r,credentials:Ne(t.credentials_text),rating:Xn(t.rating),ratingCount:Xn(t.rating_count),bio:Ne(t.bio),photoRef:Z(t.photo_ref),licensedStates:lt(t.licensed_states,i=>{let l=Re(i),a=l===null?null:Z(l.state);return a===null?null:Object.freeze({state:a,canPrescribe:ot(l?.can_prescribe,false)})})})}o(rl,"parseClinician");function Qn(e){let t=Re(e);if(t===null)return null;let n=Z(t.slot_id),r=Z(t.starts_at);return n===null||r===null?null:Object.freeze({slotId:n,startsAt:r,endsAt:Z(t.ends_at)??r})}o(Qn,"parseSlot");function ol(e){let t=Re(e);if(t===null)return null;let n=Z(t.slot_id),r=Z(t.hold_expires_at);return n===null||r===null?null:Object.freeze({slotId:n,expiresAt:r})}o(ol,"parseSlotHold");function Et(e){let t=Re(e);if(t===null)return null;let n=Z(t.consult_id),r=Z(t.scheduled_at);return n===null||r===null?null:Object.freeze({consultId:n,petId:Z(t.pet_id)??"",clinicianId:Z(t.clinician_id)??"",clinicianName:Ne(t.display_name),reasonText:Ne(t.reason_text),mediaRefs:lt(t.media_refs,i=>Z(i)),status:Qo(Zo,t.status),kind:Qo(el,t.kind),scheduledAt:r,emergencyFlagged:ot(t.emergency_flagged,false),hasRoom:Z(t.meeting_url)!==null})}o(Et,"parseConsult");function ll(e){let t=Re(e);return Object.freeze({active:ot(t?.active,false)})}o(ll,"parseBookingEntitlement");var rn=240;function il(e){let t=Re(e);if(t===null)return null;let n=Xn(t.fee_cents);return n===null||n<0?null:Object.freeze({feeCents:n,currency:Z(t.currency)??"usd",feeRecorded:ot(t.fee_recorded,n>0),summary:Ne(t.summary)})}o(il,"parseCancelReceipt");var Le="/widget/v1/televet",Is=`${Le}/state-policy`,Os=`${Le}/vets`,al=`${Le}/slots`,As=`${Le}/slots/next`,on=`${Le}/consults`,Bs=`${Le}/entitlement`,Ds=`${Le}/cancellation-policy`;function sl(e){return `${al}/${encodeURIComponent(e)}/hold`}o(sl,"televetHoldCall");function dl(e){return `${on}/${encodeURIComponent(e)}/reschedule`}o(dl,"televetRescheduleCall");function ln(e){return `${on}/${encodeURIComponent(e)}`}o(ln,"televetConsultCall");function cl(e){return `${ln(e)}/join`}o(cl,"televetJoinCall");function ul(e){return `${ln(e)}/cancel`}o(ul,"televetCancelCall");var pl=100;function ie(e){return w(ye("validationFailed",{retryable:false,wireMessage:e}))}o(ie,"invalid");function Ke(e){return w(ye("internalError",{retryable:false,httpStatus:502,wireMessage:e}))}o(Ke,"unusable");function Zn(e){return e.httpStatus===404}o(Zn,"isDark");function kt(e,t,n){try{e?.track(t,n);}catch{}}o(kt,"safeTrack");function fl(e){if(e.pet_id.trim().length===0)return "pet_id is required";if(e.clinician_id.trim().length===0)return "clinician_id is required";if(e.slot_id.trim().length===0)return "slot_id is required";if(!me(e.state))return "state must be a two-letter US state code";let t=e.reason_text.trim();return t.length===0?"reason_text is required":t.length>_e?`reason_text must be at most ${_e} characters`:Fs(e)}o(fl,"validateBookingBody");function Fs(e){let t=e.state_attested===true,n=e.cancellation_policy_version?.trim()??"";return t!==n.length>0?"state_attested and cancellation_policy_version must be sent together or omitted together":n.length>tn?`cancellation_policy_version must be at most ${tn} characters`:null}o(Fs,"attestationRefusal");function tr(e){let t=e.funnel??Tt({auth:e.auth,...e.errorPolicy?{errorPolicy:e.errorPolicy}:{}}),n=e.telemetry;return {async statePolicy(r,i){let l=r.trim();if(!me(l))return ie("state must be a two-letter US state code");let a=await t.send("televet.booking.state_policy",{method:"GET",path:`${Is}/${encodeURIComponent(l)}`,...i?{signal:i}:{}});if(!a.ok)return w(a.error);let s=tl(a.value,l);return s===null?Ke("the state policy response was unreadable"):L(s)},async entitlement(r){let i=await t.send("televet.booking.entitlement",{method:"GET",path:Bs,...r?{signal:r}:{}});return i.ok?L(ll(i.value)):w(i.error)},async cancellationPolicy(r){let i=await t.send("televet.booking.cancellation_policy",{method:"GET",path:Ds,...r?{signal:r}:{}});return i.ok?L(nl(i.value)):L(null)},async clinicians(r,i){let l=r.trim();if(!me(l))return ie("state must be a two-letter US state code");let a=await t.send("televet.booking.clinicians",{method:"GET",path:Os,query:{state:l},...i?{signal:i}:{}});return a.ok?L(lt(er(a.value,"vets"),rl)):Zn(a.error)?L(Object.freeze([])):w(a.error)},async slots(r,i){let l=r.trim();if(l.length===0)return ie("clinicianId is required");let a=await t.send("televet.booking.slots",{method:"GET",path:al,query:{clinician_id:l},...i?{signal:i}:{}});return a.ok?L(lt(er(a.value,"slots"),Qn)):Zn(a.error)?L(Object.freeze([])):w(a.error)},async nextSlot(r){let i=await t.send("televet.booking.next_slot",{method:"GET",path:As,...r?{signal:r}:{}});return i.ok?L(Qn(Ls(i.value,"slot"))):L(null)},async holdSlot(r){let i=r.trim();if(i.length===0)return ie("slotId is required");let l=await t.send("televet.booking.hold",{method:"POST",path:sl(i)},{idempotent:false,maxAttempts:1});if(!l.ok)return kt(n,"televet.booking.hold_failed",{status:l.error.httpStatus??null}),w(l.error);let a=ol(l.value);return a===null?Ke("the hold response carried no usable expiry"):L(a)},async book(r,i){let l=fl(r);if(l!==null)return ie(l);let a=i.trim();if(a.length===0)return ie("idempotencyKey is required");let s=await t.send("televet.booking.book",{method:"POST",path:on,body:Ns(r)},{idempotent:true,idempotencyKey:a,maxAttempts:1});if(!s.ok)return kt(n,"televet.booking.book_failed",{status:s.error.httpStatus??null}),w(s.error);let c=Et(s.value);return c===null?Ke("the booking response was unreadable"):L(c)},async reschedule(r,i){let l=r.trim(),a=i.trim();if(l.length===0)return ie("consultId is required");if(a.length===0)return ie("slotId is required");let s=await t.send("televet.booking.reschedule",{method:"POST",path:dl(l),body:{new_slot_id:a}},{idempotent:false,maxAttempts:1});if(!s.ok)return kt(n,"televet.booking.reschedule_failed",{status:s.error.httpStatus??null}),w(s.error);let c=Et(s.value);return c===null?Ke("the reschedule response was unreadable"):L(c)},async listConsults(r){let i=await t.send("televet.booking.consults",{method:"GET",path:on,query:{limit:String(pl)},...r?{signal:r}:{}});return i.ok?L(lt(er(i.value,"consults"),Et)):Zn(i.error)?L(Object.freeze([])):w(i.error)},async getConsult(r,i){let l=r.trim();if(l.length===0)return ie("consultId is required");let a=await t.send("televet.booking.consult",{method:"GET",path:ln(l),...i?{signal:i}:{}});if(!a.ok)return w(a.error);let s=Et(a.value);return s===null?Ke("the consult response was unreadable"):L(s)},async joinConsult(r){let i=r.trim();if(i.length===0)return ie("consultId is required");let l=await t.send("televet.booking.join",{method:"POST",path:cl(i)},{idempotent:false,maxAttempts:1});if(!l.ok)return kt(n,"televet.booking.join_failed",{status:l.error.httpStatus??null}),w(l.error);let a=Yn(l.value);return a===null?Ke("the join response carried no usable room credential"):L(a)},async cancelConsult(r,i){let l=r.trim(),a=i.trim();if(l.length===0)return ie("consultId is required");if(a.length===0)return ie("reason is required");if(a.length>rn)return ie(`reason must be at most ${rn} characters`);let s=await t.send("televet.booking.cancel",{method:"POST",path:ul(l),body:{reason:a}},{idempotent:false,maxAttempts:1});if(!s.ok)return kt(n,"televet.booking.cancel_failed",{status:s.error.httpStatus??null}),w(s.error);let c=il(s.value);return c===null?Ke("the cancel response was unreadable"):L(c)}}}o(tr,"createTelevetBookingController");function Ns(e){let t=e.cancellation_policy_version?.trim()??"",n=e.state_attested===true&&t.length>0;return {pet_id:e.pet_id,clinician_id:e.clinician_id,slot_id:e.slot_id,state:e.state,reason_text:e.reason_text.trim(),species:e.species,media_refs:[...e.media_refs],emergency_acknowledged:e.emergency_acknowledged,share_health_records:e.share_health_records,...n?{state_attested:true,cancellation_policy_version:t}:{}}}o(Ns,"bookingWireBody");function er(e,t){if(Array.isArray(e))return e;if(typeof e=="object"&&e!==null){let n=e,r=n[t]??n.items??n.data;if(Array.isArray(r))return r}return e}o(er,"rows");function Ls(e,t){if(typeof e=="object"&&e!==null&&!Array.isArray(e)){let n=e,r=n[t]??n.data;if(typeof r=="object"&&r!==null)return r}return e}o(Ls,"unwrap");var yl=Symbol.for("@everfur/sdk#EverfurContext@v1"),ml=globalThis,vl=ml[yl]??(ml[yl]=react.createContext(null));vl.displayName??="EverfurContext";function Ye(){let e=react.useContext(vl);if(e===null)throw new bt("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return e}o(Ye,"useEverfurContext");var zs=Object.freeze({chat:Object.freeze(["chat.message.create"]),records:Object.freeze(["records.upload.create","records.record.read"]),recordsClinic:Object.freeze(["records.clinic.create"]),video:Object.freeze(["video.gait.execute"]),photo:Object.freeze(["photo.checkup.execute"]),animations:Object.freeze(["animations.state.read"]),televet:Object.freeze(["televet.visit.create"])});function js(e){return zs[e]}o(js,"requires");function gl(e,t,n){let r=js(e),i=new Map;for(let s of t)i.set(s.resource,s);if(n?.isPending===true&&r.some(s=>!i.has(s)))return nr({name:e,enabled:false,isPending:true,limits:{}});let l=Hs(r,i);return r.filter(s=>i.get(s)?.granted!==true).length===0?nr({name:e,enabled:true,isPending:false,limits:l}):nr({name:e,enabled:false,isPending:false,limits:l,disabled:Us(r,i)})}o(gl,"decideCapability");function Hs(e,t){let n={};for(let r of e){let i=t.get(r)?.limits;if(i)for(let[l,a]of Object.entries(i)){let s=n[l];n[l]=s===void 0?a:Math.min(s,a);}}return n}o(Hs,"mergeLimits");function Us(e,t){for(let n of e){let r=t.get(n)?.disabled;if(r)return Object.freeze({reason:r.reason,level:r.level,recoverable:r.recoverable})}return Object.freeze({reason:Wn("accessDenied"),level:"user_entitlement",recoverable:false})}o(Us,"disabledFor");function nr(e){let t={name:e.name,enabled:e.enabled,isPending:e.isPending,limits:Object.freeze({...e.limits})};return e.disabled!==void 0&&(t.disabled=e.disabled),Object.freeze(t)}o(nr,"freezeDecision");function Ct(e){let{runtime:t}=Ye(),n=t.entitlements,r=react.useSyncExternalStore(n.subscribe,n.getSnapshot,n.getSnapshot);return react.useMemo(()=>gl(e,r.decisions,{isPending:r.isPending}),[e,r])}o(Ct,"useCapability");function ae(e){let{runtime:t,userRef:n,scopeEpoch:r}=Ye();return react.useMemo(()=>{if(e)return e;if(n===null)return null;let{services:i}=t.registry;return tr({auth:i.authFor(n),telemetry:i.telemetry,...i.errorPolicy?{errorPolicy:i.errorPolicy}:{}})},[t,n,r,e])}o(ae,"useTelevetBookingController");function $s(){let{userRef:e}=Ye(),t=Ct("televet");return react.useMemo(()=>({available:t.enabled&&e!==null,isPending:t.isPending}),[t.enabled,t.isPending,e])}o($s,"useTelevetBookingAvailable");function Ve(e,t,n){let[r,i]=react.useState(()=>({key:e,data:null,isPending:t&&n!==null,error:null})),[l,a]=react.useState(0),s=react.useRef(n);s.current=n,react.useEffect(()=>{let p=s.current;if(!t||p===null){i({key:e,data:null,isPending:false,error:null});return}let g=new AbortController,f=true;return i(y=>y.key===e?{...y,isPending:true,error:null}:{key:e,data:null,isPending:true,error:null}),(async()=>{let y;try{y=await p(g.signal);}catch{f&&i({key:e,data:null,isPending:false,error:null});return}f&&(y.ok?i({key:e,data:y.value,isPending:false,error:null}):i({key:e,data:null,isPending:false,error:y.error}));})(),()=>{f=false,g.abort();}},[e,t,l]);let c=react.useCallback(()=>a(p=>p+1),[]),d=r.key===e;return react.useMemo(()=>({enabled:t,data:d?r.data:null,isPending:t&&(!d||r.isPending),isError:d&&r.error!==null,error:d?r.error:null,refetch:c}),[t,d,r.data,r.isPending,r.error,c])}o(Ve,"useTelevetRead");function or(e,t){let n=e?.trim()??"",r=t?.statePolicy!==void 0&&me(n),i=t?.statePolicy;return Ve(`state-policy:${n}`,r,r&&i?l=>i.call(t,n,l):null)}o(or,"useTelevetStatePolicy");function lr(e){let t=e?.entitlement!==void 0,n=e?.entitlement;return Ve("entitlement",t,t&&n?r=>n.call(e,r):null)}o(lr,"useTelevetBookingEntitlement");function St(e){let t=e?.cancellationPolicy!==void 0,n=e?.cancellationPolicy;return Ve("cancellation-policy",t,t&&n?r=>n.call(e,r):null)}o(St,"useTelevetCancellationPolicy");function ir(e,t){let n=e?.trim()??"",r=t?.clinicians!==void 0&&me(n),i=t?.clinicians;return Ve(`clinicians:${n}`,r,r&&i?l=>i.call(t,n,l):null)}o(ir,"useTelevetClinicians");function Rt(e,t){let n=e?.trim()??"",r=t!==null&&n.length>0;return Ve(`slots:${n}`,r,r&&t?i=>t.slots(n,i):null)}o(Rt,"useTelevetSlots");function ar(e){let t=e?.nextSlot!==void 0,n=e?.nextSlot;return Ve("next-slot",t,t&&n?r=>n.call(e,r):null)}o(ar,"useTelevetNextSlot");function dn(e){let[t,n]=react.useState(null),r=react.useRef(true),i=react.useRef(false),l=react.useRef(e);l.current=e,react.useEffect(()=>(r.current=true,()=>{r.current=false;}),[]);let a=react.useCallback((...s)=>{let c=l.current;if(c===null||i.current)return;let d=s[s.length-1],p=typeof d=="object"&&d!==null&&("onSuccess"in d||"onError"in d),g=p?d:void 0,f=p?s.slice(0,-1):s;i.current=true,n({variables:f[0]??null}),(async()=>{let y=null;try{y=await c(...f);}catch{y=null;}i.current=false,r.current&&n(null),y!==null&&(y.ok?g?.onSuccess?.(y.value):g?.onError?.(y.error));})();},[]);return react.useMemo(()=>({isPending:t!==null,variables:t?.variables??null,mutate:a}),[t,a])}o(dn,"useTelevetWrite");function _t(e){return dn(e?t=>e.holdSlot(t):null)}o(_t,"useTelevetHoldSlot");function sr(e){return dn(e?(t,n)=>e.book(t,n):null)}o(sr,"useTelevetBookConsult");function dr(e,t){return dn(t&&e?n=>t.reschedule(e,n):null)}o(dr,"useTelevetRescheduleConsult");function cn(e,t=0){let n=e?.listConsults!==void 0,r=e?.listConsults;return Ve(`consults:${t}`,n,n&&r?i=>r.call(e,i):null)}o(cn,"useTelevetConsults");function Tl(e,t,n=0){let r=e?.trim()??"",i=t?.getConsult!==void 0&&r.length>0,l=t?.getConsult;return Ve(`consult:${r}:${n}`,i,i&&l?a=>l.call(t,r,a):null)}o(Tl,"useTelevetConsult");function El(e,t){let n=t?.cancelConsult;return dn(t&&n&&e?r=>n.call(t,e,r):null)}o(El,"useTelevetCancelConsult");function cr(e){return e.error!==null&&e.error.httpStatus===404}o(cr,"televetReadIsDark");var ur=15,pr=250,Ks=new Set(["scheduled","in_progress"]);function Ge(e){let t=Date.parse(e.scheduledAt);return Number.isNaN(t)?null:t}o(Ge,"startsAtMs");function Ys(e){let t=Ge(e);return t===null?null:t-ur*6e4}o(Ys,"televetJoinOpensAtMs");function fr(e,t){if(e===null)return {ready:false,reason:"not_open_yet"};if($e.has(e.status))return {ready:false,reason:"consult_over"};if(e.status==="in_progress")return {ready:true};let n=Ge(e);return n===null?{ready:false,reason:"not_open_yet"}:t<n-ur*6e4?{ready:false,reason:"not_open_yet"}:t>n+pr*6e4?{ready:false,reason:"consult_over"}:{ready:true}}o(fr,"televetJoinReadiness");function xt(e,t){let n=[],r=[];for(let i of e){let l=Ge(i);(Ks.has(i.status)&&l!==null&&l+pr*6e4>t?n:r).push(i);}return n.sort((i,l)=>(Ge(i)??0)-(Ge(l)??0)),r.sort((i,l)=>(Ge(l)??0)-(Ge(i)??0)),Object.freeze({upcoming:Object.freeze(n),past:Object.freeze(r)})}o(xt,"splitTelevetVisits");function yr(e){return e==="scheduled"}o(yr,"canManageTelevetVisit");function kl(e){let t=cn(e);return t.enabled?t.isPending?"pending":t.isError||xt(t.data??[],Date.now()).upcoming.length>0?"visits":"booking":"booking"}o(kl,"useTelevetLanding");function gr(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let t of Object.keys(e))gr(e[t]);}return e}o(gr,"deepFreeze");var Gs=Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3}),Sl={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},Rl={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},Cl={nano:8,small:9,micro:10,tiny:11,caption:12,bodyTight:13,body:14,subtitle:16,heading:18,verdict:24},Js={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},Xs={regular:"400",medium:"500",bold:"700"},Qs={eyebrow:1,monoWide:.9,headerBrand:-0.42,tight:-0.35},Zs=0,un="System",pn="monospace",ed=["content","heading","control","compact","badge"];function td(e){let t={};for(let n of ed)t[n]=e;return t}o(td,"authoredTierSizes");function _l(){return {family:un,mono:pn,fontUrl:null,families:{regular:un,medium:un,bold:un,mono:pn,monoMedium:pn,monoBold:pn},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:Cl,tierSizes:td(Cl),lineHeight:Js,weight:Xs,letterSpacing:Qs,scale:1,maxScale:Zs,scaleCaps:Gs}}o(_l,"baseType");var xl={},mr=Object.freeze({standard:Object.freeze([.2,0,0,1]),emphasized:Object.freeze([.2,.8,.2,1]),exit:Object.freeze([.4,0,1,1])});function vr(e){return `cubic-bezier(${e.join(", ")})`}o(vr,"cssCubicBezier");var wl={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:vr(mr.standard),emphasized:vr(mr.emphasized),exit:vr(mr.exit)},reducedMotion:false},nd={brand:"#10462E",brandSoft:"rgba(16,70,46,0.10)",brandSofter:"rgba(16,70,46,0.15)",brandBorder:"rgba(16,70,46,0.18)",borderHairlineGreen:"rgba(16,70,46,0.25)",brandBorderStrong:"rgba(16,70,46,0.55)",brandInk:"#10462E",linkInk:"#10462E",surface:"#FFFFFF",surfaceCream:"#FDFBF8",surfaceSubtle:"#EFE9E3",background:"#FFFFFF",borderRingCream:"#D8D2C8",chatGround:"#FFFFFF",composerFill:"#FDFBF8",composerBorder:"rgba(16,70,46,0.75)",shadow:"#0B3421",text:{primary:"#111111",secondary:"#0E462E",muted:"#6E6660",placeholder:"rgba(61,61,61,0.75)",onBrand:"#FFFFFF",metaCool:"#3D3D3D",timestamp:"rgba(61,61,61,0.75)"},primary:"#10462E",onPrimary:"#FFFFFF",accent:"#10462E",onAccent:"#FFFFFF",accentEdge:"#07C168",success:"#07C168",danger:"#B91C1C",errorRed:"#FF1B00",warningStrong:"#A45610",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.12)",badgeBgCaution:"rgba(217,130,29,0.14)",badgeBgCritical:"rgba(185,28,28,0.12)",badgeBgNeutral:"rgba(110,102,96,0.12)",bubbleUser:"#10462E",bubbleAssistant:"#FFFFFF",skeleton:"#EFE9E3",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.10)",checkupCardConcernBg:"rgba(239,167,0,0.10)"},Pl=gr({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:nd,space:Sl,radius:Rl,type:_l(),motion:wl,slots:xl}),rd={brand:"#6BD39A",brandSoft:"rgba(107,211,154,0.12)",brandSofter:"rgba(107,211,154,0.18)",brandBorder:"rgba(107,211,154,0.22)",borderHairlineGreen:"rgba(107,211,154,0.28)",brandBorderStrong:"rgba(107,211,154,0.55)",brandInk:"#6BD39A",linkInk:"#6BD39A",surface:"#1C1F23",surfaceCream:"#23272C",surfaceSubtle:"#23272C",background:"#15171A",borderRingCream:"#3A3F45",chatGround:"#1C1F23",composerFill:"#23272C",composerBorder:"rgba(107,211,154,0.75)",shadow:"#000000",text:{primary:"#F5F3F0",secondary:"#A9E4C4",muted:"#9A938C",placeholder:"rgba(255,255,255,0.55)",onBrand:"#0E1F17",metaCool:"#C9C9C9",timestamp:"rgba(245,243,240,0.7)"},primary:"#6BD39A",onPrimary:"#0E1F17",accent:"#6BD39A",onAccent:"#0E1F17",accentEdge:"#34D888",success:"#07C168",danger:"#F87171",errorRed:"#FF6B5B",warningStrong:"#F0A35E",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.18)",badgeBgCaution:"rgba(217,130,29,0.20)",badgeBgCritical:"rgba(185,28,28,0.22)",badgeBgNeutral:"rgba(255,255,255,0.10)",bubbleUser:"#6BD39A",bubbleAssistant:"#1C1F23",skeleton:"#23272C",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.16)",checkupCardConcernBg:"rgba(239,167,0,0.16)"};gr({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:rd,space:Sl,radius:Rl,type:_l(),motion:wl,slots:xl});var Il=Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),Ol=globalThis,br=Ol[Il]??(Ol[Il]=react.createContext(Pl));br.displayName??="EverfurThemeContext";function S(){return react.useContext(br)}o(S,"useEverfurTheme");function dd(e,t){let n=e.scaleCaps[t];return n>0?n:void 0}o(dd,"tierMultiplier");function v({tier:e="content",...t}){let{type:n}=S(),r=dd(n,e);return react.createElement(reactNative.Text,r===void 0?t:{maxFontSizeMultiplier:r,...t})}o(v,"Text");var Bl=react.forwardRef(o(function(t,n){return react.createElement(reactNative.TextInput,{...t,...n===null?{}:{ref:n}})},"TextInput"));var cd=Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});function b(e,t){let n=e.type,r=n.families[t];return t==="mono"||n.namedFaces[t]?{fontFamily:r}:{fontFamily:r,fontWeight:n.weight[cd[t]]}}o(b,"face");var Er=class Er extends react.Component{constructor(){super(...arguments);this.state={failed:false,key:this.props.resetKey};}static getDerivedStateFromError(){return {failed:true}}static getDerivedStateFromProps(n,r){return Object.is(n.resetKey,r.key)?null:{failed:false,key:n.resetKey}}render(){return this.state.failed?this.props.fallback:this.props.children}};o(Er,"HostRenderBoundary");var hr=Er;function pd({render:e}){return e()}o(pd,"RenderHost");function Tr({render:e,fallback:t,resetKey:n}){return react.createElement(hr,{fallback:t,resetKey:n,children:react.createElement(pd,{render:e})})}o(Tr,"HostRender");var fd=48;function yd(e){return e.isPending?"pending":e.enabled?"enabled":"disabled"}o(yd,"selectView");function Vl(e){let{capability:t,children:n,renderDisabled:r,renderPending:i,style:l}=e,a=Ct(t),s=react.useMemo(()=>yd(a),[a]);switch(s){case "enabled":return n;case "pending":return i?jsxRuntime.jsx(Tr,{render:i,fallback:jsxRuntime.jsx(Nl,{capability:t,style:l})}):jsxRuntime.jsx(Nl,{capability:t,style:l});case "disabled":return r?jsxRuntime.jsx(Tr,{render:()=>r(a),fallback:jsxRuntime.jsx(Ll,{decision:a,style:l}),resetKey:a}):jsxRuntime.jsx(Ll,{decision:a,style:l});default:return Gt(s)}}o(Vl,"CapabilityGate");function Nl({capability:e,style:t}){let n=S(),r=react.useMemo(()=>Ml(n),[n]);return jsxRuntime.jsx(reactNative.View,{style:[r.offstate,t],accessible:true,accessibilityState:{busy:true},accessibilityLabel:`Loading ${e}`,children:jsxRuntime.jsx(reactNative.View,{style:r.skeletonBar})})}o(Nl,"PendingSkeleton");function Ll({decision:e,style:t}){let n=S(),r=react.useMemo(()=>Ml(n),[n]),i=e.disabled?.reason??"";return jsxRuntime.jsx(reactNative.View,{style:[r.offstate,t],accessible:true,accessibilityRole:"text",accessibilityLabel:i,children:i.length>0?jsxRuntime.jsx(v,{style:r.offstateText,children:i}):null})}o(Ll,"OffState");function Ml(e){let{color:t,space:n,radius:r,type:i}=e;return reactNative.StyleSheet.create({offstate:{minHeight:fd,justifyContent:"center",paddingHorizontal:n.lg,paddingVertical:n.md,backgroundColor:t.surfaceCream,borderRadius:r.md,borderWidth:reactNative.StyleSheet.hairlineWidth,borderColor:t.brandBorder},offstateText:{...b(e,"regular"),fontSize:i.size.body,lineHeight:Math.round(i.size.body*i.lineHeight.normal),color:t.text.muted},skeletonBar:{height:n.md,borderRadius:r.xs,backgroundColor:t.brandSofter}})}o(Ml,"makeStyles");function fn(e){let t=e.raw;if(typeof t!="object"||t===null)return null;let n=t,r=n.detail??n.error;return typeof r=="object"&&r!==null?r:n}o(fn,"details");function md(e){let t=fn(e)?.categories;return Array.isArray(t)?Object.freeze(t.filter(n=>typeof n=="string")):Object.freeze([])}o(md,"categoriesOf");function zl(e){let t=fn(e)?.retry_after_seconds;return typeof t=="number"&&Number.isFinite(t)&&t>0?t:null}o(zl,"retryAfterOf");function jl(e){let t=e.wireMessage;if(typeof t=="string"&&t.trim().length>0)return t.trim();let n=fn(e)?.message;return typeof n=="string"&&n.trim().length>0?n.trim():null}o(jl,"messageOf");function vd(e){let t=e.reasonCode;if(typeof t=="string"&&t.length>0)return t;let n=fn(e),r=n?.code??n?.error_code;return typeof r=="string"&&r.length>0?r:null}o(vd,"codeOf");function xe(e){let t=e.httpStatus;if(t===402)return Object.freeze({kind:"not_entitled"});if(t===429||e.code==="rateLimited"||e.code==="quotaExceeded")return Object.freeze({kind:"rate_limited",retryAfterSeconds:zl(e),message:jl(e)});if(t===404)return Object.freeze({kind:"unavailable"});switch(vd(e)){case "televet_rate_limited":return Object.freeze({kind:"rate_limited",retryAfterSeconds:zl(e),message:jl(e)});case "televet_emergency_ack_required":return Object.freeze({kind:"emergency",categories:md(e)});case "televet_not_entitled":return Object.freeze({kind:"not_entitled"});case "televet_slot_conflict":return Object.freeze({kind:"slot_taken"});case "televet_hold_invalid":return Object.freeze({kind:"slot_taken"});case "televet_clinician_cannot_prescribe":case "televet_clinician_unavailable":case "televet_clinician_not_bookable":return Object.freeze({kind:"clinician_unavailable"});case "televet_membership_conflict":return Object.freeze({kind:"not_entitled"});case "televet_registry_unavailable":return Object.freeze({kind:"failed"});}return Object.freeze({kind:"failed"})}o(xe,"televetBookingRefusal");function Hl(e){if(e===null)return null;let t=xe(e);return t.kind==="rate_limited"?t.message:null}o(Hl,"televetRateLimitMessage");function yn(e){for(let t=0;t<e.length;t+=1){let n=e.charCodeAt(t);if(n>=55296&&n<=56319){let r=e.charCodeAt(t+1);if(!(r>=56320&&r<=57343))return true;t+=1;}else if(n>=56320&&n<=57343)return true}return false}o(yn,"hasLoneSurrogate");function mn(e){return [...e].length}o(mn,"serverLength");var Ul=Object.freeze({dog:"dog",canine:"dog",k9:"dog",puppy:"dog",cat:"cat",feline:"cat",kitten:"cat"});function Wl(e){if(typeof e!="string")return null;let t=e.trim().toLowerCase();return Object.prototype.hasOwnProperty.call(Ul,t)?Ul[t]:null}o(Wl,"canonicalPetSpecies");var ql=50,gd=128,Sr=120,$l=120,bd=2e3,Kl=120,hd=80,Jl=new Set(["male","female","unknown"]),Xl=new Set(["day","month","year"]),Ql=new Set(["low","medium","high","athletic"]),Zl=new Set(["indoor","outdoor","both"]),ei=new Set(["mild","moderate","severe"]),Td=/^(\d{4})-(\d{2})-(\d{2})$/,ti=[["sex","sex"],["spayedNeutered","spayed_neutered"],["birthDate","birth_date"],["birthDatePrecision","birth_date_precision"],["activityLevel","activity_level"],["indoorOutdoor","indoor_outdoor"],["foodBrand","food_brand"],["foodType","food_type"],["microchipId","microchip_id"]],ni=[["allergies","allergies"],["medications","medications"],["supplements","supplements"],["conditions","conditions"]];Object.freeze([...ti,...ni].map(([e])=>e));function Ed(e){let t=Td.exec(e);if(t===null)return false;let[n,r,i]=[Number(t[1]),Number(t[2]),Number(t[3])],l=new Date(Date.UTC(n,r-1,i));return l.getUTCFullYear()===n&&l.getUTCMonth()===r-1&&l.getUTCDate()===i}o(Ed,"isRealDate");var Pt=o(e=>(t,n)=>typeof n=="string"&&e.has(n)?null:`${t} must be one of ${[...e].join(", ")}`,"oneOf"),kd=o((e,t)=>typeof t=="boolean"?null:`${e} must be true or false`,"boolean"),gn=o((e,t)=>typeof t=="string"&&Ed(t)?null:`${e} must be a real date written YYYY-MM-DD`,"date"),ge=o((e,t={})=>(n,r)=>{if(typeof r!="string")return `${n} must be a string`;if(yn(r))return `${n} contains an unpaired surrogate and cannot be encoded`;let i=t.trimmed?r.trim():r;if(t.required&&i.length===0)return `${n} is required and must not be blank`;let l=mn(i);return l<=e?null:`${n} is ${l} characters; the server accepts at most ${e}`},"text"),Cd={sex:Pt(Jl),spayedNeutered:kd,birthDate:gn,birthDatePrecision:Pt(Xl),activityLevel:Pt(Ql),indoorOutdoor:Pt(Zl),foodBrand:ge(Kl),foodType:ge(Kl),microchipId:ge(hd)},Rr=["ref","ref",false,ge(gd,{required:true,trimmed:true})],_r=["notes","notes",false,ge(bd,{trimmed:true})],Yl=[Rr,["name","name",true,ge(Sr,{required:true,trimmed:true})],["dose","dose",false,ge($l,{trimmed:true})],["frequency","frequency",false,ge($l,{trimmed:true})],["startDate","start_date",false,gn],["endDate","end_date",false,gn],_r],Sd={allergies:[Rr,["allergen","allergen",true,ge(Sr,{required:true,trimmed:true})],["severity","severity",false,Pt(ei)],_r],medications:Yl,supplements:Yl,conditions:[Rr,["conditionName","condition_name",true,ge(Sr,{required:true,trimmed:true})],["diagnosedDate","diagnosed_date",false,gn],_r]};function Rd(e,t,n){let r=`${e}[${t}]`;if(typeof n!="object"||n===null||Array.isArray(n))return {error:`${r} must be an object`};let i=n,l={};for(let[c,d,p,g]of Sd[e]){let f=i[c];if(f==null){if(p)return {error:`${r}.${c} is required`};f===null&&(l[d]=null);continue}let y=g(`${r}.${c}`,f);if(y!==null)return {error:y};l[d]=f;}let a=l.start_date,s=l.end_date;return typeof a=="string"&&typeof s=="string"&&s<a?{error:`${r}.endDate must not be before startDate`}:{item:l}}o(Rd,"itemToWire");function _d(e,t){if(!Array.isArray(t))return {error:`${e} must be an array (send [] to clear it)`};if(t.length>ql)return {error:`${e} has ${t.length} items; the server accepts at most ${ql}`};let n=[],r=new Set;for(let i=0;i<t.length;i+=1){let l=Rd(e,i,t[i]);if("error"in l)return l;let a=l.item.ref;if(typeof a=="string"){let s=a.trim();if(r.has(s))return {error:`${e}: ref ${JSON.stringify(s)} is used twice; a ref names one item`};r.add(s);}n.push(l.item);}return {items:n}}o(_d,"listToWire");function ri(e,t){let n=e,r={};for(let[a,s]of ti){let c=n[a];if(c!==void 0){if(c!==null){let d=Cd[a](a,c);if(d!==null)return {error:d}}r[s]=c;}}let i=n.birthDate!==void 0,l=n.birthDatePrecision!==void 0;if(i!==l||i&&n.birthDate===null!=(n.birthDatePrecision===null))return {error:"birthDate and birthDatePrecision must be sent together, both set or both null"};for(let[a,s]of ni){let c=n[a];if(c===void 0)continue;let d=_d(a,c);if("error"in d)return d;r[s]=d.items;}return Object.keys(r).length>0&&t!==void 0&&Wl(t)===null?{error:"health fields need a pet Everfur reads as a dog or a cat (dog, canine, k9, puppy, cat, feline, kitten)"}:{body:r}}o(ri,"petHealthToWire");var J=o(e=>typeof e=="string"?e:null,"str"),wt=o((e,t)=>typeof t=="string"&&e.has(t)?t:null,"pick"),xd=o(e=>typeof e=="boolean"?e:null,"bool");function vn(e,t){return Array.isArray(e)?Object.freeze(e.flatMap(n=>{if(typeof n!="object"||n===null||Array.isArray(n))return [];let r=t(n);return r===null?[]:[r]})):Object.freeze([])}o(vn,"itemsFromWire");function Gl(e){let t=J(e.name);return t===null||t.length===0?null:Object.freeze({ref:J(e.ref),name:t,dose:J(e.dose),frequency:J(e.frequency),startDate:J(e.start_date),endDate:J(e.end_date),notes:J(e.notes)})}o(Gl,"medicationFromWire");function oi(e){let t=e.profile_version;return Object.freeze({profileVersion:typeof t=="number"&&Number.isInteger(t)&&t>=0?t:0,sex:wt(Jl,e.sex),spayedNeutered:xd(e.spayed_neutered),birthDate:J(e.birth_date),birthDatePrecision:wt(Xl,e.birth_date_precision),activityLevel:wt(Ql,e.activity_level),indoorOutdoor:wt(Zl,e.indoor_outdoor),foodBrand:J(e.food_brand),foodType:J(e.food_type),microchipId:J(e.microchip_id),allergies:vn(e.allergies,n=>{let r=J(n.allergen);return r===null||r.length===0?null:Object.freeze({ref:J(n.ref),allergen:r,severity:wt(ei,n.severity),notes:J(n.notes)})}),medications:vn(e.medications,Gl),supplements:vn(e.supplements,Gl),conditions:vn(e.conditions,n=>{let r=J(n.condition_name);return r===null||r.length===0?null:Object.freeze({ref:J(n.ref),conditionName:r,diagnosedDate:J(n.diagnosed_date),notes:J(n.notes)})})})}o(oi,"petHealthFromWire");var ai=100,si=50,di=100,ci=50,ui=500,wd=128,Pd=6e4;function he(e){return ye("validationFailed",{retryable:false,wireMessage:e})}o(he,"invalid");function Je(e,t,n){if(typeof t!="string")return he(`${e} must be a string`);let r=mn(t);return r<=n?null:he(`${e} is ${r} characters; the server accepts at most ${n}`)}o(Je,"checkString");function bn(e,t,n){return typeof t=="number"&&Number.isFinite(t)&&t>=0&&t<=n?null:he(`${e} must be a finite number between 0 and ${n}`)}o(bn,"outOfRange");function li(e,t){if(typeof e!="string")return he("pet_ref must be a string");if(e.trim().length===0)return he("pet_ref must not be blank");if(yn(e))return he("pet_ref contains an unpaired surrogate and cannot be encoded");if(t!=null&&typeof t!="object")return he("profile must be an object");let n=[Je("pet_ref",e,wd)];return t?.name!==void 0&&n.push(Je("name",t.name,ai)),t?.species!==void 0&&n.push(Je("species",t.species,si)),t?.breed!==void 0&&n.push(Je("breed",t.breed,di)),t?.ageYears!==void 0&&n.push(bn("age_years",t.ageYears,ci)),t?.weightKg!==void 0&&n.push(bn("weight_kg",t.weightKg,ui)),n.find(r=>r!==null)??null}o(li,"validate");function pi(e,t){let n=ri(e,t);return "error"in n?{error:he(n.error)}:n}o(pi,"healthToWire");function Id(e){if(typeof e!="object"||e===null)return {error:he("patch must be an object")};let t=e,n=[["name","name",l=>Je("name",l,ai)],["species","species",l=>Je("species",l,si)],["breed","breed",l=>Je("breed",l,di)],["ageYears","age_years",l=>bn("age_years",l,ci)],["weightKg","weight_kg",l=>bn("weight_kg",l,ui)]],r={};for(let[l,a,s]of n){let c=t[l];if(c!==void 0){if(c!==null){let d=s(c);if(d!==null)return {error:d}}r[a]=c;}}let i=pi(t,t.species);return "error"in i?i:(Object.assign(r,i.body),Object.keys(r).length===0?{error:he("patch must change at least one field")}:{body:r})}o(Id,"patchToWire");function Od(e){if(e==null)return {body:{}};let t=pi(e,e.species);return "error"in t?t:{body:{...e.name!==void 0?{name:e.name}:{},...e.species!==void 0?{species:e.species}:{},...e.breed!==void 0?{breed:e.breed}:{},...e.ageYears!==void 0?{age_years:e.ageYears}:{},...e.weightKg!==void 0?{weight_kg:e.weightKg}:{},...t.body}}}o(Od,"toWire");var be=o(e=>typeof e=="string"?e:null,"str"),hn=o(e=>typeof e=="number"&&Number.isFinite(e)?e:null,"num");function ii(e,t){let n=typeof e=="object"&&e!==null?e:{};return Object.freeze({petRef:be(n.pet_ref)??t,name:be(n.name),species:be(n.species),breed:be(n.breed),ageYears:hn(n.age_years),weightKg:hn(n.weight_kg)})}o(ii,"fromWire");function fi(e){if(typeof e!="object"||e===null)return null;let t=e,n=be(t.pet_ref);return n===null||n.length===0?null:Object.freeze({petId:be(t.pet_id),petRef:n,name:be(t.name),species:be(t.species),breed:be(t.breed),ageYears:hn(t.age_years),weightKg:hn(t.weight_kg),updatedAt:be(t.updated_at)})}o(fi,"widgetPetFromWire");function Ad(e){let t=fi(e);return t===null?null:Object.freeze({...t,...oi(e)})}o(Ad,"widgetPetProfileFromWire");function Bd(e){let t=Array.isArray(e)?e:typeof e=="object"&&e!==null&&Array.isArray(e.pets)?e.pets:[];return Object.freeze(t.flatMap(n=>{let r=fi(n);return r===null?[]:[r]}))}o(Bd,"petListFromWire");function yi(e){return Dd(Tt({auth:e}),Tt({auth:e,unaryTimeoutMs:Pd}))}o(yi,"createPetsRepository");function Dd(e,t=e){let n=o((i,l)=>l?{...i,signal:l}:i,"withSignal"),r=o(i=>li(i,void 0)??`/widget/v1/pets/${encodeURIComponent(i)}`,"petPath");return {async list(i){let l=await e.send("pets.list",n({method:"GET",path:"/widget/v1/pets"},i?.signal));return l.ok?L(Bd(l.value)):w(l.error)},async registerPet(i,l,a){let s=li(i,l);if(s!==null)return w(s);let c=Od(l);if("error"in c)return w(c.error);let p={method:"POST",path:`/widget/v1/pets/${encodeURIComponent(i)}`,body:c.body},g=await e.send("pets.registerPet",a?.signal?{...p,signal:a.signal}:p);return g.ok?L(ii(g.value,i)):w(g.error)},async updatePet(i,l,a){let s=r(i);if(typeof s!="string")return w(s);let c=Id(l);if("error"in c)return w(c.error);let d=await e.send("pets.updatePet",n({method:"PATCH",path:s,body:c.body},a?.signal));return d.ok?L(ii(d.value,i)):w(d.error)},async getPetProfile(i,l){let a=r(i);if(typeof a!="string")return w(a);let s=await e.send("pets.getPetProfile",n({method:"GET",path:`${a}/profile`},l?.signal));if(!s.ok)return w(s.error);let c=Ad(s.value);return c===null?w(ye("internalError",{retryable:false,httpStatus:502,wireMessage:"the pet profile response carried no pet_ref"})):L(c)},async deletePet(i,l){let a=r(i);if(typeof a!="string")return w(a);let s=await e.send("pets.deletePet",n({method:"DELETE",path:a},l?.signal));return s.ok?L(void 0):w(s.error)},async eraseUserData(i){let l=await t.send("pets.eraseUserData",n({method:"DELETE",path:"/widget/v1/me"},i?.signal),{maxAttempts:1});return l.ok?L(void 0):w(l.error)}}}o(Dd,"createPetsRepositoryOver");function it(){let{runtime:e,userRef:t,activePet:n,scopeEpoch:r}=Ye(),i=react.useMemo(()=>yi(e.registry.services.authFor(t)),[e,t,r]),[l,a]=react.useState({repository:i,pets:[],loading:true,error:null}),s=l.repository===i?l:{pets:[],loading:true,error:null},c=react.useRef(0),d=react.useCallback(async()=>{let g=++c.current;a(y=>({...y,repository:i,loading:true,error:null,pets:y.repository===i?y.pets:[]}));let f=await i.list();g===c.current&&a(f.ok?{repository:i,pets:f.value,loading:false,error:null}:y=>({repository:i,pets:y.repository===i?y.pets:[],loading:false,error:f.error}));},[i]);react.useEffect(()=>(d(),()=>{c.current+=1;}),[d]);let p=react.useMemo(()=>n===null?null:s.pets.find(g=>g.petRef===n)??null,[n,s.pets]);return react.useMemo(()=>({pets:s.pets,activePet:p,loading:s.loading,error:s.error,refresh:d}),[s.pets,s.loading,s.error,p,d])}o(it,"useEverfurPets");var Me=Object.freeze(["pet","issues","reason","clinician","time","review","booked"]),mi=Object.freeze({petId:null,state:null,clinicianId:null,slot:null,holdExpiresAt:null,shareHealthRecords:false,idempotencyKey:null});function Pr(e,t={}){let n=Object.freeze({...mi,...t}),r=wr(0,e);return Object.freeze({index:r,draft:n,furthestIndex:r})}o(Pr,"initialTelevetBookingState");function Tn(e,t){return e==="pet"?t.ownedPetCount<=1:e==="issues"?t.withIssues!==true:false}o(Tn,"isSkipped");function En(e){return Me[e]}o(En,"stepAt");function wr(e,t){for(let n=e;n<Me.length;n+=1){let r=En(n);if(r&&!Tn(r,t))return n}return Me.length-1}o(wr,"nextVisible");function vi(e,t){for(let n=e;n>=0;n-=1){let r=En(n);if(r&&!Tn(r,t))return n}return null}o(vi,"previousVisible");function Ir(e,t){return vi(e.index-1,t)!==null}o(Ir,"hasPreviousStep");function Or(e,t,n){switch(t.type){case "patch":{let r={...e.draft,...t.patch};return ("petId"in t.patch&&t.patch.petId!==e.draft.petId||"state"in t.patch&&t.patch.state!==e.draft.state||"clinicianId"in t.patch&&t.patch.clinicianId!==e.draft.clinicianId)&&e.draft.slot?Object.freeze({...e,draft:Object.freeze({...r,slot:null,holdExpiresAt:null,idempotencyKey:null})}):Object.freeze({...e,draft:Object.freeze(r)})}case "next":{let r=wr(e.index+1,n);return Object.freeze({...e,index:r,furthestIndex:Math.max(e.furthestIndex,r)})}case "back":{if(En(e.index)==="booked")return e;let r=vi(e.index-1,n);return r===null?e:Object.freeze({...e,index:r})}case "goTo":{let r=Me.indexOf(t.step);if(r<0)return e;let i=Tn(t.step,n)?wr(r,n):r;return Object.freeze({...e,index:i,furthestIndex:Math.max(e.furthestIndex,i)})}default:return e}}o(Or,"televetBookingReducer");function Ar(e){return En(e.index)??"pet"}o(Ar,"currentStep");function It(e,t){let n=t.trim();return !!e.petId&&!!e.clinicianId&&!!e.slot&&me(e.state)&&n.length>0&&n.length<=_e}o(It,"canConfirm");function Br(e,t){if(!e.holdExpiresAt)return false;let n=Date.parse(e.holdExpiresAt);return Number.isNaN(n)?false:n<=t}o(Br,"isHoldExpired");function Dr(e){return `televet.book.${e}`}o(Dr,"televetBookingKey");function Fr(e,t,n){let r=n?.version?.trim()??"";return !e||!t||r.length===0?Object.freeze({}):Object.freeze({state_attested:true,cancellation_policy_version:r})}o(Fr,"attestation");function we(e){let t=new Date(e);return Number.isNaN(t.getTime())?null:t}o(we,"parse");function Xe(e){let t=we(e);return t?t.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"}):""}o(Xe,"formatClock");function Md(e){let t=we(e);return t?t.toLocaleDateString(void 0,{month:"long",day:"numeric"}):""}o(Md,"formatDate");var at=10;function st(e){let t=we(e);return t?new Intl.DateTimeFormat(void 0,{timeZoneName:"short"}).formatToParts(t).find(r=>r.type==="timeZoneName")?.value??"":""}o(st,"formatZone");function zd(e){let t=we(e);if(!t)return "";let n=new Date(t.getTime()+at*6e4).toISOString(),r=st(e),i=`${Xe(e)} - ${Xe(n)}`;return r&&r!==""?`${i} ${r}`:i}o(zd,"formatVisitRange");function gi(e){let t=Md(e),n=[Xe(e),st(e)].filter(Boolean).join(" ");return [t,n].filter(Boolean).join(", ")}o(gi,"formatWhen");function pe(e){let t=we(e);return t?[t.toLocaleDateString(void 0,{weekday:"short"}),gi(e)].filter(Boolean).join(", "):""}o(pe,"formatWhenWithDay");function bi(e){let t=we(e);if(!t)return "";let n=t.toLocaleDateString(void 0,{weekday:"short"}),r=t.toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"}),i=[Xe(e),st(e)].filter(Boolean).join(" ");return [n,r,i].filter(Boolean).join(", ")}o(bi,"formatRecordWhen");function kn(e){let t=we(e);return t?`${t.getFullYear()}-${t.getMonth()+1}-${t.getDate()}`:"unknown"}o(kn,"localDayKey");function hi(e){let t=we(e);return t===null?"":t.toLocaleDateString(void 0,{month:"long"})}o(hi,"formatMonthLabel");function Ti(e){let t=we(e);return t===null?"":t.toLocaleDateString(void 0,{weekday:"long",month:"long",day:"numeric"})}o(Ti,"formatFullDayLabel");function ki(e){let{draft:t,reasonText:n,book:r,stateAttested:i,termsAttested:l,cancellationPolicy:a,triage:s,goTo:c,setFailure:d,setRateLimitMessage:p,setEmergency:g,setBookedConsult:f,onBooked:y}=e,E=react.useCallback(P=>{if(!(!It(t,n)||!t.idempotencyKey)){if(Br(t,Date.now())){d("expired"),c("time");return}d(null),g(null),r.mutate({pet_id:t.petId,clinician_id:t.clinicianId,slot_id:t.slot.slotId,state:t.state,reason_text:n.trim(),species:null,media_refs:[],emergency_acknowledged:P||s.isAcknowledged(n),share_health_records:t.shareHealthRecords,...Fr(i,l,a)},t.idempotencyKey,{onSuccess:o(h=>{f(h),c("booked"),y?.(h);},"onSuccess"),onError:o(h=>{let T=xe(h);if(T.kind==="emergency"){g(T.categories);return}if(T.kind==="rate_limited"){p(T.message),d("rate_limited");return}d(T.kind==="not_entitled"?"not_entitled":T.kind==="slot_taken"?"taken":T.kind==="clinician_unavailable"?"clinician_unavailable":T.kind==="unavailable"?"unavailable":"failed"),T.kind==="slot_taken"&&c("time");},"onError")});}},[t,n,r,i,l,a,s,c,d,p,g,f,y]),_=react.useCallback(()=>E(false),[E]);return {submitBooking:E,confirm:_}}o(ki,"useBookingSubmit");function Vr(e){let[t,n]=react.useState(false),[r,i]=react.useState(false),[l,a]=react.useState(null),s=react.useRef(null),c=react.useRef(null),d=react.useRef(true);react.useEffect(()=>(d.current=true,()=>{d.current=false,c.current?.abort(),c.current=null;}),[]);let p=react.useCallback(()=>{c.current?.abort(),c.current=null,d.current&&i(false);},[]),g=react.useCallback(async P=>{if(c.current!==null)return false;let h=P.trim();if(l!==null&&l===h||!e)return true;let T=s.current!==null&&s.current.reason===h?s.current.emergency:null;if(T===null){let R=new AbortController;c.current=R,i(true);try{let O=await e(h,R.signal);if(R.signal.aborted||!d.current)return !1;O===null?T=!1:(T=O.isEmergency||O.fallback,s.current=Object.freeze({reason:h,emergency:T}));}catch{if(R.signal.aborted||!d.current)return false;T=false;}finally{c.current===R&&(c.current=null,d.current&&i(false));}}return T===true?(n(true),false):true},[l,e]),f=react.useCallback(P=>{a(P.trim()),n(false);},[]),y=react.useCallback(()=>n(false),[]),E=react.useCallback(()=>{p(),s.current=null,a(null),n(false);},[p]),_=react.useCallback(P=>l!==null&&l===P.trim(),[l]);return {open:t,checking:r,check:g,acknowledge:f,close:y,cancel:p,reset:E,isAcknowledged:_}}o(Vr,"useEarlyTriage");function qd(e){let t=e?.trim().toUpperCase()??"";return /^[A-Z]{2}$/.test(t)?t:null}o(qd,"normalizeStateCode");function Mr(e,t){let n=qd(e),[r,i]=react.useState(()=>Object.freeze({})),l=react.useRef(0),a=react.useRef(null),s=react.useCallback(c=>{if(!t||n===null)return null;let d=`${n}:${c}`;a.current!==null&&a.current!==d&&(l.current+=1),a.current=d;let p=r[d]??"idle";return {joined:p==="joined",pending:p==="pending",failed:p==="failed",onPress:o(()=>{if(p==="pending"||p==="joined")return;let g=l.current+=1;i(f=>Object.freeze({...f,[d]:"pending"})),(async()=>{let f=false;try{f=await t(n,c);}catch{f=false;}l.current===g&&i(y=>Object.freeze({...y,[d]:f?"joined":"failed"}));})();},"onPress")}},[n,r,t]);return react.useMemo(()=>({actionFor:s}),[s])}o(Mr,"useStateInterest");function zr(e){return Object.freeze(e==="dark"?{title:u.noCliniciansTitle,message:u.noCliniciansBody,retryLabel:u.noCliniciansRetryCta,interestReason:null}:{title:u.noCliniciansTitle,message:u.noCliniciansRegionBody,retryLabel:null,interestReason:"no_licensed_vet"})}o(zr,"televetEmptyRosterView");function jr(e){return e?"roster":"dark"}o(jr,"televetEmptyRosterCause");var Ot=Object.freeze({failed:0,refused:Object.freeze({size:0,type:0,unreadable:0})});function Hr(e){let{failed:t,refused:n}=e;return t<=0&&n.size<=0&&n.type<=0&&n.unreadable<=0}o(Hr,"isMediaShortfallEmpty");function Ur(e){let t=o(r=>Number.isFinite(r)&&r>0?Math.floor(r):0,"count"),n=u.media;return [{n:t(e.failed),one:n.droppedTemplate,many:n.droppedPluralTemplate},{n:t(e.refused.size),one:n.refusedSizeTemplate,many:n.refusedSizePluralTemplate},{n:t(e.refused.type),one:n.refusedTypeTemplate,many:n.refusedTypePluralTemplate},{n:t(e.refused.unreadable),one:n.refusedUnreadableTemplate,many:n.refusedUnreadablePluralTemplate}].filter(r=>r.n>0).map(r=>ne(r.n===1?r.one:r.many,{n:String(r.n)}))}o(Ur,"televetMediaShortfallLines");function Cn(e){let t=Number.isFinite(e)&&e>0?Math.floor(e):0;return t===0?Ot:Object.freeze({failed:t,refused:Ot.refused})}o(Cn,"mediaShortfallFromUnsentPicks");function $d(e,t){let n=Cn(t);return n.failed===0?e:Object.freeze({failed:e.failed+n.failed,refused:e.refused})}o($d,"withUnsentPicks");var X=44;function V(){let e=S();return react.useMemo(()=>Xd(e),[e])}o(V,"useBookingStyles");function A({label:e,onPress:t,kind:n="primary",disabled:r=false,loading:i=false,fullWidth:l=true,accessibilityLabel:a,testID:s,style:c}){let d=V(),p=S(),g=r||i;return jsxRuntime.jsxs(reactNative.Pressable,{onPress:t,disabled:g,accessibilityRole:"button",accessibilityLabel:a??e,accessibilityState:{disabled:g,busy:i},style:[d.button,n==="primary"?d.buttonPrimary:n==="danger"?d.buttonDanger:d.buttonSecondary,l?d.buttonFull:d.buttonAuto,g?d.buttonDisabled:null,c],testID:s,children:[i?jsxRuntime.jsx(reactNative.ActivityIndicator,{size:"small",color:n==="secondary"?p.color.brand:p.color.onPrimary}):null,jsxRuntime.jsx(v,{tier:"control",style:n==="secondary"?d.buttonSecondaryLabel:d.buttonPrimaryLabel,children:e})]})}o(A,"TelevetButton");function F({title:e,message:t,actionLabel:n,onAction:r,testID:i}){let l=V(),a=typeof n=="string"&&n.length>0&&typeof r=="function";return jsxRuntime.jsxs(reactNative.View,{style:l.stateCard,testID:i,children:[jsxRuntime.jsx(v,{style:l.stateTitle,accessibilityRole:"header",children:e}),t?jsxRuntime.jsx(v,{style:l.stateMessage,children:t}):null,a?jsxRuntime.jsx(A,{label:n,onPress:r,kind:"secondary",fullWidth:false}):null]})}o(F,"TelevetStateCard");function ee({height:e,width:t="100%",testID:n}){let r=V();return jsxRuntime.jsx(reactNative.View,{style:[r.skeleton,{height:e,width:t}],testID:n,accessibilityElementsHidden:true,importantForAccessibility:"no"})}o(ee,"TelevetSkeletonBlock");function $({message:e,assertive:t=false,testID:n,style:r}){let i=V();return jsxRuntime.jsx(v,{style:[i.failure,r],accessibilityLiveRegion:t?"assertive":"polite",testID:n,children:e})}o($,"TelevetFailureLine");function Xd(e){let{color:t,space:n,radius:r,type:i}=e,{size:l,lineHeight:a}=i;return reactNative.StyleSheet.create({screen:{flex:1,paddingHorizontal:n.xl,gap:n.md},stepFill:{flex:1,minHeight:0,gap:n.md},list:{gap:n.sm},button:{minHeight:X,flexDirection:"row",alignItems:"center",justifyContent:"center",gap:n.sm,paddingHorizontal:n.xl,paddingVertical:n.sm,borderRadius:r.pill},buttonFull:{alignSelf:"stretch"},buttonAuto:{alignSelf:"flex-start",minWidth:X},buttonPrimary:{backgroundColor:t.primary},buttonSecondary:{borderWidth:1,borderColor:t.brandBorder,backgroundColor:"transparent"},buttonDanger:{backgroundColor:t.danger},buttonDisabled:{opacity:.45},buttonPrimaryLabel:{...b(e,"medium"),color:t.onPrimary,fontSize:l.body,lineHeight:l.body*a.snug},buttonSecondaryLabel:{...b(e,"medium"),color:t.brand,fontSize:l.body,lineHeight:l.body*a.snug},stateCard:{minHeight:140,justifyContent:"center",gap:n.sm,padding:n.lg,borderRadius:r.lg,borderWidth:1,borderColor:t.brandBorder},stateTitle:{...b(e,"medium"),color:t.brand,fontSize:l.subtitle,lineHeight:l.subtitle*a.snug},stateMessage:{...b(e,"regular"),color:t.text.metaCool,fontSize:l.body,lineHeight:l.body*a.normal},skeleton:{borderRadius:r.md,backgroundColor:t.skeleton},failure:{...b(e,"regular"),color:t.danger,fontSize:l.caption,lineHeight:l.caption*a.normal},stepTitle:{...b(e,"bold"),color:t.brand,fontSize:l.heading,lineHeight:l.heading*a.snug},stepHelp:{...b(e,"regular"),color:t.text.metaCool,fontSize:l.body,lineHeight:l.body*a.normal},divider:{height:1,backgroundColor:t.brandBorder},scrollRoot:{flex:1,minHeight:0},scrollBody:{flex:1},scrollFooter:{paddingTop:n.md,paddingBottom:n.lg}})}o(Xd,"makeBookingStyles");function At({petName:e,primaryVet:t,onFindEmergencyVet:n}){let r=S(),i=react.useMemo(()=>wi(r),[r]),l=e?.trim()??"";return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[n?jsxRuntime.jsx(reactNative.Pressable,{accessibilityRole:"button",accessibilityLabel:u.emergency.exitFindErTitle,onPress:()=>{Jt(n);},style:i.vetCard,testID:"televet-emergency-find-vet",children:jsxRuntime.jsx(reactNative.View,{style:i.vetRow,children:jsxRuntime.jsx(v,{tier:"control",style:i.vetTitle,children:u.emergency.exitFindErTitle})})}):null,t!=null&&l.length>0?jsxRuntime.jsx(Qd,{petName:l,vet:t}):null]})}o(At,"TelevetEmergencyExits");function Qd({petName:e,vet:t}){let n=S(),r=react.useMemo(()=>wi(n),[n]),i=ne(u.emergency.exitPrimaryVetTitle,{petName:e}),l=t.detail?.trim()??"",a=jsxRuntime.jsx(reactNative.View,{style:r.vetRow,children:jsxRuntime.jsxs(reactNative.View,{style:r.vetText,children:[jsxRuntime.jsx(v,{tier:"control",style:r.vetTitle,children:i}),l.length>0?jsxRuntime.jsx(v,{style:r.vetDetail,children:l}):null]})});if(!t.dial)return jsxRuntime.jsx(reactNative.View,{style:r.vetCard,testID:"televet-early-emergency-primary-vet",children:a});let s=t.dial;return jsxRuntime.jsx(reactNative.Pressable,{accessibilityRole:"link",accessibilityLabel:l.length>0?`${i}, ${l}`:i,accessibilityHint:u.emergency.startCallHint,onPress:()=>{Jt(s);},style:r.vetCard,testID:"televet-early-emergency-primary-vet-call",children:a})}o(Qd,"PrimaryVetCard");function wi(e){let{color:t,space:n,radius:r,type:i}=e,{size:l,lineHeight:a}=i;return {vetCard:{minHeight:X,justifyContent:"center",padding:n.lg,borderRadius:r.lg,borderWidth:1,borderColor:t.brandBorder,backgroundColor:t.surface},vetRow:{flexDirection:"row",alignItems:"center",gap:n.sm},vetText:{flexShrink:1,gap:n.xs},vetTitle:{...b(e,"medium"),color:t.text.primary,fontSize:l.body,lineHeight:l.body*a.normal},vetDetail:{...b(e,"regular"),color:t.text.metaCool,fontSize:l.caption,lineHeight:l.caption*a.normal}}}o(wi,"makeExitStyles");function Oi({petName:e,primaryVet:t,onFindEmergencyVet:n,onContinue:r}){let i=S(),l=V(),a=react.useMemo(()=>Kr(i),[i]);return jsxRuntime.jsxs(reactNative.View,{style:[l.stepFill,a.emergencyPanel],testID:"televet-early-emergency",children:[jsxRuntime.jsx(v,{tier:"heading",accessibilityRole:"header",accessibilityLiveRegion:"assertive",style:a.emergencyTitle,children:u.emergency.bannerTitle}),jsxRuntime.jsx(v,{style:a.emergencyLede,children:u.emergency.lede}),jsxRuntime.jsx(At,{petName:e,primaryVet:t,onFindEmergencyVet:n}),jsxRuntime.jsx(A,{label:u.emergency.keepBookingCta,kind:"secondary",onPress:r,testID:"televet-early-emergency-continue"})]})}o(Oi,"TelevetEarlyEmergency");function qr({action:e,testIDPrefix:t}){let n=S(),r=react.useMemo(()=>Kr(n),[n]);return e===null?null:e.joined?jsxRuntime.jsxs(reactNative.View,{testID:`${t}-joined`,style:r.interestFeedback,children:[jsxRuntime.jsx(v,{tier:"control",accessibilityRole:"header",children:u.stateInterest.joinedTitle}),jsxRuntime.jsx(v,{style:r.interestBody,children:u.stateInterest.joinedBody})]}):jsxRuntime.jsxs(reactNative.View,{testID:t,style:r.interestAction,children:[jsxRuntime.jsx(A,{label:u.stateInterest.cta,kind:"secondary",loading:e.pending,disabled:e.pending,onPress:e.onPress,testID:`${t}-submit`}),e.failed?jsxRuntime.jsx($,{message:u.stateInterest.failed,testID:`${t}-error`}):null]})}o(qr,"TelevetStateInterestAction");function Ai({cause:e,onRetry:t,stateInterest:n=null}){let r=zr(e);return jsxRuntime.jsxs(reactNative.View,{testID:"televet-clinicians-empty",children:[jsxRuntime.jsx(F,{title:r.title,message:r.message,...r.retryLabel!==null&&t?{actionLabel:r.retryLabel,onAction:t}:{}}),r.interestReason!==null?jsxRuntime.jsx(qr,{action:n??null,testIDPrefix:"televet-state-interest-no-licensed-vet"}):null]})}o(Ai,"TelevetClinicianEmptyState");function tc({onCheckAvailability:e}){return jsxRuntime.jsx($r,{...e?{onCheckAvailability:e}:{}})}o(tc,"TelevetEntitlementInterestState");function $r({onCheckAvailability:e,renderUnavailable:t}){let n=V();return jsxRuntime.jsxs(reactNative.View,{testID:"televet-booking-not-entitled",style:n.list,children:[t?t():jsxRuntime.jsx(F,{title:u.bookingPausedTitle}),e?jsxRuntime.jsx(A,{label:u.checkAvailabilityCta,kind:"secondary",onPress:e,testID:"televet-check-state-availability"}):null]})}o($r,"EntitlementPausedState");function Bt({shortfall:e,testIDPrefix:t}){let n=S(),r=react.useMemo(()=>Kr(n),[n]);if(Hr(e))return null;let i=Ur(e);return i.length===0?null:jsxRuntime.jsx(reactNative.View,{style:r.mediaNotice,testID:`${t}-media-notice`,children:i.map((l,a)=>jsxRuntime.jsx(v,{style:r.mediaLine,accessibilityLiveRegion:"polite",testID:`${t}-media-line-${String(a)}`,children:l},l))})}o(Bt,"TelevetMediaDropNotice");function Kr(e){let{color:t,space:n,radius:r,type:i}=e,{size:l,lineHeight:a}=i;return {emergencyPanel:{gap:n.sm,padding:n.lg,borderRadius:r.lg,borderWidth:2,borderColor:t.danger,backgroundColor:t.surface},emergencyTitle:{...b(e,"medium"),color:t.danger,fontSize:l.heading,lineHeight:l.heading*a.snug},emergencyLede:{...b(e,"regular"),color:t.text.primary,fontSize:l.subtitle,lineHeight:l.subtitle*a.normal},interestAction:{gap:n.sm,marginTop:n.sm},interestFeedback:{gap:n.xs,marginTop:n.sm},interestBody:{...b(e,"regular"),color:t.text.metaCool},mediaNotice:{gap:n.xs},mediaLine:{...b(e,"regular"),color:t.text.metaCool,fontSize:l.caption,lineHeight:l.caption*a.normal}}}o(Kr,"makeEdgeStyles");function Bi(e){let{surfaceUnavailable:t,notEntitled:n,policyBlocked:r,triageOpen:i,step:l}=e;return t||n&&l!=="clinician"||r?true:l==="reason"&&i}o(Bi,"televetBookingGateApplies");function Di({state:e,petName:t,primaryVet:n,onFindEmergencyVet:r,stateInterest:i=null,onCheckAvailability:l,onAcknowledgeEmergency:a,renderUnavailable:s}){let c=V(),{surfaceUnavailable:d,notEntitled:p,policyBlocked:g,triageOpen:f,step:y}=e;return d?jsxRuntime.jsx(reactNative.View,{style:c.stepFill,testID:"televet-booking-unavailable",children:s?s():jsxRuntime.jsx(F,{title:u.bookingPausedTitle})}):p&&y!=="clinician"?jsxRuntime.jsx($r,{...l?{onCheckAvailability:l}:{},...s?{renderUnavailable:s}:{}}):g?jsxRuntime.jsxs(reactNative.View,{testID:"televet-booking-state-blocked",children:[jsxRuntime.jsx(F,{title:u.stateBlockedTitle}),jsxRuntime.jsx(qr,{action:i,testIDPrefix:"televet-state-interest-state-blocked"})]}):y==="reason"&&f?jsxRuntime.jsx(Oi,{...t!==void 0?{petName:t}:{},...n?{primaryVet:n}:{},onFindEmergencyVet:r,onContinue:a}):null}o(Di,"TelevetBookingGate");var Ii=false;function nc(){if(!Ii){Ii=true;try{globalThis.console?.warn?.("[everfur] The vet booking has no US state for this member, so it cannot list vets. Pass the member's two-letter state as `usState` (on EverfurTelevet, VetVisitButton or EverfurChat as `vetUsState`), or pass `onRequestLocation` so the booking can ask your app to resolve one. The SDK never reads a device location itself.");}catch{}}}o(nc,"warnNoStateSeamOnce");function Fi(e){return e.noState?true:e.isPending||e.isError?false:e.isEmpty||e.notEntitled}o(Fi,"televetClinicianOutcomeApplies");function Ni({state:e,cause:t,locationStatus:n,onRequestLocation:r,onRetry:i,stateInterest:l=null,renderUnavailable:a}){let s=e.noState&&!r;return react.useEffect(()=>{s&&nc();},[s]),e.noState?jsxRuntime.jsx(reactNative.View,{testID:"televet-booking-location-unknown",children:jsxRuntime.jsx(F,{title:n==="blocked"?u.locationBlockedTitle:n==="unavailable"?u.locationUnavailableTitle:u.locationUnknownTitle,message:n==="blocked"?u.locationBlockedBody:n==="unavailable"?u.locationUnavailableBody:r?u.locationUnknownBody:void 0,actionLabel:r?n==="blocked"?u.locationBlockedCta:u.locationUnknownCta:void 0,onAction:r})}):e.isEmpty?jsxRuntime.jsx(Ai,{cause:t,onRetry:i,stateInterest:l}):jsxRuntime.jsx($r,{...a?{renderUnavailable:a}:{}})}o(Ni,"TelevetClinicianOutcome");function Li(e){return `televet-consult-${e}`}o(Li,"televetConsultCalendarKey");function Gr({consult:e,petName:t,onDone:n,onAddToCalendar:r,canJoinInApp:i=false}){let l=S(),a=V(),s=react.useMemo(()=>ic(l),[l]),[c,d]=react.useState("idle"),p=o(async()=>{if(!r)return;d("saving");let f=new Date(e.scheduledAt);if(Number.isNaN(f.getTime())){d("failed");return}let y=await Xt(r,{key:Li(e.consultId),title:u.visit.title,startDate:f,endDate:new Date(f.getTime()+at*6e4),alarmOffsetMinutes:-30});d(y.ok&&y.value===true?"saved":"failed");},"addToCalendar"),g=[u.booked.remindPromise,ne(u.booked.summaryPromise,{pet:t??""}),...i?[u.booked.joinPromise]:[]];return Se()?jsxRuntime.jsxs(reactNative.View,{style:s.screen,testID:"televet-booked",children:[jsxRuntime.jsx(reactNative.View,{style:s.header,children:jsxRuntime.jsx(A,{label:u.doneCta,kind:"secondary",fullWidth:false,onPress:n,testID:"televet-booked-done"})}),jsxRuntime.jsx(reactNative.View,{style:s.avatar,accessibilityElementsHidden:true,importantForAccessibility:"no"}),jsxRuntime.jsx(v,{tier:"heading",style:s.title,accessibilityRole:"header",children:u.bookedTitle}),jsxRuntime.jsx(v,{style:s.when,children:pe(e.scheduledAt)}),jsxRuntime.jsx(reactNative.View,{style:s.steps,testID:"televet-booked-steps",children:g.map((f,y)=>jsxRuntime.jsxs(reactNative.View,{style:s.step,children:[jsxRuntime.jsx(reactNative.View,{style:s.stepNumber,accessibilityElementsHidden:true,importantForAccessibility:"no",children:jsxRuntime.jsx(v,{tier:"badge",style:s.stepNumberText,children:String(y+1)})}),jsxRuntime.jsx(v,{style:s.stepText,children:f.trim()})]},f))}),jsxRuntime.jsxs(reactNative.View,{style:s.actions,children:[r?jsxRuntime.jsx(A,{label:c==="saved"?u.booked.calendarAdded:u.addToCalendarCta,kind:"primary",loading:c==="saving",disabled:c==="saving"||c==="saved",onPress:()=>{p();},testID:"televet-booked-calendar"}):null,c==="failed"?jsxRuntime.jsx(v,{style:[a.failure,s.calendarNote],accessibilityLiveRegion:"polite",testID:"televet-booked-calendar-failed",children:u.booked.calendarFailedBody}):null,jsxRuntime.jsx(A,{label:t?ne(u.booked.backToPet,{pet:t}):u.doneCta,kind:"secondary",onPress:n,testID:"televet-booked-back"})]})]}):jsxRuntime.jsx(reactNative.View,{style:s.screen,testID:"televet-booked-copy-unapproved"})}o(Gr,"TelevetBookedScreen");function ic(e){let{color:t,space:n,radius:r,type:i}=e,{size:l,lineHeight:a}=i;return reactNative.StyleSheet.create({screen:{flex:1,paddingHorizontal:n.xl,gap:n.md},header:{alignItems:"flex-end",paddingBottom:n.lg},avatar:{alignSelf:"center",width:120,height:120,borderRadius:60,backgroundColor:t.surfaceSubtle,borderWidth:2,borderColor:t.success},title:{textAlign:"center",...b(e,"bold"),color:t.brand,fontSize:l.verdict,lineHeight:l.verdict*a.tight,letterSpacing:-0.7,paddingTop:n.lg},when:{textAlign:"center",...b(e,"regular"),color:t.text.metaCool,fontSize:l.subtitle,lineHeight:l.subtitle*a.normal},steps:{marginTop:n.xl,padding:n.lg,borderRadius:r.lg,borderWidth:1,borderColor:t.brandBorder,gap:n.lg},step:{flexDirection:"row",alignItems:"flex-start",gap:n.md},stepNumber:{width:26,height:26,borderRadius:13,backgroundColor:t.primary,alignItems:"center",justifyContent:"center"},stepNumberText:{...b(e,"medium"),color:t.onPrimary,fontSize:l.caption,lineHeight:l.caption,includeFontPadding:false},stepText:{flex:1,...b(e,"regular"),color:t.brand,fontSize:l.body,lineHeight:l.body*a.normal},actions:{marginTop:"auto",paddingBottom:n.xl,gap:n.md},calendarNote:{textAlign:"center"}})}o(ic,"makeStyles");function Xr({step:e,furthestIndex:t,title:n,canGoBack:r,isDirty:i,onBack:l,onClose:a,onConfirmDiscard:s}){let c=S(),d=react.useMemo(()=>uc(c),[c]),p=react.useMemo(()=>()=>{if(!i){a();return}let T={title:u.chrome.discardTitle,body:u.chrome.discardBody,confirmLabel:u.chrome.discardConfirmCta,keepLabel:u.chrome.discardKeepCta};if(s){Promise.resolve(s(T)).then(R=>{R&&a();},()=>{});return}reactNative.Alert.alert(T.title,T.body,[{text:T.keepLabel,style:"cancel"},{text:T.confirmLabel,style:"destructive",onPress:a}]);},[i,a,s]),g=react.useMemo(()=>()=>r?(l(),true):(p(),true),[r,l,p]);react.useEffect(()=>{let T=reactNative.BackHandler.addEventListener("hardwareBackPress",g);return ()=>{T.remove();}},[g]),rt(g);let f=Me.filter(T=>T!=="issues"),y=f.length,E=Me[t],_=E===void 0?0:Math.max(0,f.indexOf(E==="issues"?"reason":E)),h=e==="booked"?1:Math.min(1,(_+1)/y);return jsxRuntime.jsxs(reactNative.View,{style:d.wrap,children:[jsxRuntime.jsxs(reactNative.View,{style:d.bar,children:[jsxRuntime.jsx(reactNative.View,{style:d.side,children:jsxRuntime.jsx(reactNative.Pressable,{onPress:r?l:p,accessibilityRole:"button",accessibilityLabel:Rn,testID:"televet-booking-back",style:d.tap,children:jsxRuntime.jsx(reactNative.View,{style:d.chevron,accessibilityElementsHidden:true,importantForAccessibility:"no"})})}),jsxRuntime.jsx(v,{tier:"heading",style:d.title,accessibilityRole:"header",children:n??u.navTitle}),jsxRuntime.jsx(reactNative.View,{style:[d.side,d.sideRight],children:jsxRuntime.jsx(reactNative.Pressable,{onPress:p,accessibilityRole:"button",accessibilityLabel:u.close,accessibilityHint:u.chrome.closeHint,testID:"televet-booking-close",style:d.tap,children:jsxRuntime.jsx(v,{tier:"control",style:d.close,children:u.close})})})]}),jsxRuntime.jsx(reactNative.View,{style:d.railTrack,accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants",children:jsxRuntime.jsx(reactNative.View,{style:[d.railFill,{width:`${Math.round(h*100)}%`}],testID:"televet-booking-rail"})})]})}o(Xr,"TelevetBookingChrome");var Rn="Back";function uc(e){let{color:t,space:n,type:r}=e,{size:i,lineHeight:l}=r;return reactNative.StyleSheet.create({wrap:{backgroundColor:t.surface},bar:{flexDirection:"row",alignItems:"center",paddingHorizontal:n.lg,minHeight:56},side:{minWidth:64,justifyContent:"center"},sideRight:{alignItems:"flex-end"},tap:{minHeight:X,minWidth:X,justifyContent:"center",paddingHorizontal:n.xs},chevron:{width:10,height:10,borderLeftWidth:2,borderBottomWidth:2,borderColor:t.brand,transform:[{rotate:"45deg"}]},title:{flex:1,textAlign:"center",...b(e,"medium"),color:t.brand,fontSize:i.subtitle,lineHeight:i.subtitle*l.normal},close:{...b(e,"medium"),color:t.brand,fontSize:i.subtitle,lineHeight:i.subtitle*l.normal},railTrack:{height:4,backgroundColor:t.surfaceSubtle},railFill:{height:4,backgroundColor:t.success}})}o(uc,"makeStyles");function zi(e){let t=[],n=pc(e.ageYears);n!==null&&t.push(`${String(n)} yr${n===1?"":"s"} old`);let r=e.weightKg;typeof r=="number"&&Number.isFinite(r)&&r>0&&t.push(`${String(Math.round(r))} kg`);let i=e.breed?.trim();return i&&t.push(i),t.join(" \xB7 ")}o(zi,"formatTelevetPetMetaLine");function pc(e){if(typeof e!="number"||!Number.isFinite(e))return null;let t=Math.floor(e);return t>=0?t:null}o(pc,"wholeYears");function Zr({media:e,onChange:t,onPickMedia:n}){let r=S(),i=react.useMemo(()=>Tc(r),[r]),l=nn-e.length,[a,s]=react.useState(false);if(!n)return null;let c=o(async()=>{if(!(a||l<=0)){s(true);try{let d=await Xt(n,l);if(!d.ok||d.value===null||d.value.length===0)return;let p=new Set(e.map(f=>f.uri)),g=d.value.filter(f=>typeof f?.uri=="string"&&f.uri.length>0&&!p.has(f.uri));if(g.length===0)return;t([...e,...g].slice(0,nn));}finally{s(false);}}},"pick");return jsxRuntime.jsxs(reactNative.View,{style:i.row,children:[e.map((d,p)=>jsxRuntime.jsxs(reactNative.View,{style:i.thumb,children:[jsxRuntime.jsx(reactNative.Image,{source:{uri:d.uri},style:i.thumbImage,resizeMode:"cover"}),d.mimeType?.startsWith("video/")?jsxRuntime.jsx(reactNative.View,{style:i.videoBadge,testID:`televet-intake-media-video-${String(p)}`,children:jsxRuntime.jsx(v,{tier:"badge",style:i.videoBadgeText,children:hc})}):null,jsxRuntime.jsx(reactNative.Pressable,{onPress:()=>t(e.filter((g,f)=>f!==p)),accessibilityRole:"button",accessibilityLabel:u.removePhotoLabel,testID:`televet-intake-media-remove-${String(p)}`,style:i.remove,children:jsxRuntime.jsx(v,{tier:"control",style:i.removeGlyph,children:bc})})]},`${d.uri}-${String(p)}`)),l>0?jsxRuntime.jsx(reactNative.Pressable,{onPress:()=>{c();},disabled:a,accessibilityRole:"button",accessibilityLabel:u.addPhotoCta,accessibilityState:{busy:a,disabled:a},testID:"televet-intake-add-media",style:[i.dropzone,a?i.dropzoneBusy:null],children:a?jsxRuntime.jsx(reactNative.ActivityIndicator,{testID:"televet-intake-media-busy"}):jsxRuntime.jsx(v,{tier:"compact",style:i.dropzoneText,children:u.addPhotoCta})}):null]})}o(Zr,"TelevetIntakeMedia");var bc="\xD7",hc="\u25B6",_n=92;function Tc(e){let{color:t,space:n,radius:r,type:i}=e,{size:l,lineHeight:a}=i;return reactNative.StyleSheet.create({row:{flexDirection:"row",flexWrap:"wrap",gap:n.md,paddingTop:n.sm},thumb:{width:_n,height:_n,borderRadius:r.md,backgroundColor:t.surfaceSubtle},thumbImage:{width:"100%",height:"100%",borderRadius:r.md},videoBadge:{position:"absolute",left:6,bottom:6,paddingHorizontal:6,paddingVertical:2,borderRadius:r.sm,backgroundColor:t.shadow},videoBadgeText:{color:t.text.onBrand,fontSize:l.nano},remove:{position:"absolute",top:-8,right:-8,width:X-16,height:X-16,borderRadius:X/2,backgroundColor:t.text.metaCool,alignItems:"center",justifyContent:"center"},removeGlyph:{...b(e,"medium"),color:t.surface,fontSize:l.subtitle,lineHeight:l.subtitle,includeFontPadding:false},dropzone:{width:_n,height:_n,borderRadius:r.md,borderWidth:1,borderStyle:"dashed",borderColor:t.brandBorder,alignItems:"center",justifyContent:"center",paddingHorizontal:n.sm},dropzoneBusy:{opacity:.6},dropzoneText:{...b(e,"mono"),color:t.text.metaCool,fontSize:l.nano,lineHeight:l.nano*a.normal,letterSpacing:.3,textAlign:"center"}})}o(Tc,"makeStyles");function eo({slots:e,selectedDayKey:t,onSelectDay:n}){let r=S(),i=react.useMemo(()=>Rc(r),[r]),l=react.useMemo(()=>wn(e),[e]),a=l[0];return a===void 0?null:jsxRuntime.jsxs(reactNative.View,{children:[jsxRuntime.jsx(v,{tier:"compact",style:i.month,testID:"televet-day-strip-month",children:hi(a.iso)}),jsxRuntime.jsx(reactNative.ScrollView,{horizontal:true,showsHorizontalScrollIndicator:false,contentContainerStyle:i.strip,testID:"televet-day-strip",children:l.map(s=>{let c=s.key===t;return jsxRuntime.jsxs(reactNative.Pressable,{onPress:()=>n(s),accessibilityRole:"button",accessibilityLabel:Ti(s.iso),accessibilityState:{selected:c},testID:`televet-day-${s.key}`,style:[i.day,c?i.daySelected:null],children:[jsxRuntime.jsx(v,{tier:"compact",style:[i.dayWeekday,c?i.dayTextSelected:null],children:s.weekday}),jsxRuntime.jsx(v,{tier:"compact",style:[i.dayNumber,c?i.dayTextSelected:null],children:s.dayNumber})]},s.key)})})]})}o(eo,"TelevetDayStrip");function wn(e){let t=new Map;for(let n of e){let r=kn(n.startsAt);if(t.has(r))continue;let i=new Date(n.startsAt);Number.isNaN(i.getTime())||t.set(r,Object.freeze({key:r,iso:n.startsAt,weekday:i.toLocaleDateString(void 0,{weekday:"short"}),dayNumber:String(i.getDate())}));}return Object.freeze([...t.values()])}o(wn,"televetDaysFromSlots");function Rc(e){let{color:t,space:n,radius:r,type:i}=e,{size:l,lineHeight:a}=i;return reactNative.StyleSheet.create({month:{textAlign:"center",...b(e,"medium"),color:t.brand,fontSize:l.subtitle,lineHeight:l.subtitle*a.snug,paddingBottom:n.md},strip:{gap:n.sm,paddingHorizontal:n.xs},day:{width:52,minHeight:X,paddingVertical:n.md,borderRadius:r.md,borderWidth:1,borderColor:t.brandBorder,alignItems:"center",justifyContent:"center",gap:2},daySelected:{backgroundColor:t.primary,borderColor:t.primary},dayWeekday:{...b(e,"mono"),color:t.text.secondary,fontSize:l.tiny,lineHeight:l.tiny*a.tight},dayNumber:{...b(e,"medium"),color:t.brand,fontSize:l.heading,lineHeight:l.heading*a.tight},dayTextSelected:{color:t.onPrimary}})}o(Rc,"makeStyles");function Ft({slots:e,busySlotId:t,onPick:n,ListHeaderComponent:r,rowTestIdPrefix:i="televet-slot",testID:l="televet-slot-list"}){let a=S(),s=react.useMemo(()=>Oc(a),[a]),c=react.useMemo(()=>wn(e),[e]),[d,p]=react.useState(null),g=d??c[0]?.key??null,f=react.useMemo(()=>g?e.filter(h=>kn(h.startsAt)===g):[],[e,g]),y=r,E=react.useMemo(()=>f.map(h=>st(h.startsAt)),[f]),_=react.useMemo(()=>new Set(E.filter(h=>h.length>0)).size>1,[E]),P=f[0];return jsxRuntime.jsxs(reactNative.View,{style:s.root,testID:l,children:[y?jsxRuntime.jsx(y,{}):null,jsxRuntime.jsx(eo,{slots:e,selectedDayKey:g,onSelectDay:h=>p(h.key)}),P&&!_?jsxRuntime.jsx(v,{tier:"compact",style:s.zone,testID:"televet-slot-zone",children:st(P.startsAt)}):null,jsxRuntime.jsx(reactNative.ScrollView,{style:s.gridScroll,contentContainerStyle:s.grid,showsVerticalScrollIndicator:false,children:f.map((h,T)=>{let R=t===h.slotId,O=t!==null,C=_?E[T]??"":"";return jsxRuntime.jsxs(reactNative.Pressable,{onPress:()=>n(h),disabled:O,accessibilityRole:"button",accessibilityLabel:[Xe(h.startsAt),C].filter(q=>q.length>0).join(" "),accessibilityState:{disabled:O,busy:R},testID:`${i}-${h.slotId}`,style:[s.chip,R?s.chipBusy:null,O&&!R?s.chipDisabled:null],children:[jsxRuntime.jsx(v,{tier:"compact",style:[s.chipLabel,R?s.chipLabelBusy:null],children:Xe(h.startsAt)}),C.length>0?jsxRuntime.jsx(v,{tier:"compact",style:[s.chipZone,R?s.chipLabelBusy:null],testID:`${i}-${h.slotId}-zone`,children:C}):null]},h.slotId)})})]})}o(Ft,"TelevetSlotPicker");function Oc(e){let{color:t,space:n,radius:r,type:i}=e,{size:l,lineHeight:a}=i;return reactNative.StyleSheet.create({root:{flex:1,minHeight:0},gridScroll:{flex:1},zone:{textAlign:"center",...b(e,"mono"),color:t.text.muted,fontSize:l.tiny,lineHeight:l.tiny*a.normal,letterSpacing:.4,paddingVertical:n.md},grid:{flexDirection:"row",flexWrap:"wrap",gap:n.md,paddingBottom:n.xl},chip:{minWidth:96,flexGrow:1,flexBasis:"28%",minHeight:48,borderRadius:r.pill,borderWidth:1,borderColor:t.brandBorder,alignItems:"center",justifyContent:"center",paddingHorizontal:n.md},chipBusy:{backgroundColor:t.primary,borderColor:t.primary},chipDisabled:{opacity:.45},chipLabel:{...b(e,"regular"),color:t.brand,fontSize:l.subtitle,lineHeight:l.subtitle*a.tight},chipLabelBusy:{color:t.onPrimary},chipZone:{...b(e,"mono"),color:t.text.muted,fontSize:l.tiny,lineHeight:l.tiny*a.normal,letterSpacing:.4}})}o(Oc,"makeStyles");function et({label:e,value:t,last:n=false,testID:r}){let i=S(),l=react.useMemo(()=>oo(i),[i]);return jsxRuntime.jsxs(reactNative.View,{style:[l.row,n?l.rowLast:null],testID:r,children:[jsxRuntime.jsx(v,{style:l.rowLabel,children:e}),jsxRuntime.jsx(v,{style:l.rowValue,children:t})]})}o(et,"TelevetSummaryRow");function Nt({label:e,checked:t,onToggle:n,testID:r}){let i=S(),l=react.useMemo(()=>oo(i),[i]);return jsxRuntime.jsxs(reactNative.Pressable,{onPress:()=>n(!t),accessibilityRole:"checkbox",accessibilityLabel:e,accessibilityState:{checked:t},testID:r,style:l.consent,children:[jsxRuntime.jsx(reactNative.View,{style:[l.box,t?l.boxChecked:null],children:t?jsxRuntime.jsx(v,{tier:"badge",style:l.tick,children:Dc}):null}),jsxRuntime.jsx(v,{style:l.consentLabel,children:e})]})}o(Nt,"TelevetConsentCheckbox");var Dc="\u2713";function ro({children:e,testID:t}){let n=S(),r=react.useMemo(()=>oo(n),[n]);return jsxRuntime.jsx(reactNative.View,{style:r.card,testID:t,children:e})}o(ro,"TelevetSummaryCard");function oo(e){let{color:t,space:n,radius:r,type:i}=e,{size:l,lineHeight:a}=i;return reactNative.StyleSheet.create({card:{borderRadius:r.lg,borderWidth:1,borderColor:t.brandBorder,paddingHorizontal:n.lg},row:{flexDirection:"row",alignItems:"flex-start",justifyContent:"space-between",gap:n.lg,paddingVertical:n.lg,borderBottomWidth:1,borderBottomColor:t.brandBorder},rowLast:{borderBottomWidth:0},rowLabel:{...b(e,"regular"),color:t.brand,fontSize:l.subtitle,lineHeight:l.subtitle*a.snug},rowValue:{flexShrink:1,textAlign:"right",...b(e,"medium"),color:t.brand,fontSize:l.subtitle,lineHeight:l.subtitle*a.snug},consent:{flexDirection:"row",alignItems:"flex-start",gap:n.md,minHeight:X,padding:n.lg,borderRadius:r.md,backgroundColor:t.surfaceSubtle},box:{width:22,height:22,borderRadius:r.xs,borderWidth:1.5,borderColor:t.brand,backgroundColor:t.surface,alignItems:"center",justifyContent:"center"},boxChecked:{backgroundColor:t.primary,borderColor:t.primary},tick:{...b(e,"bold"),color:t.onPrimary,fontSize:l.caption,lineHeight:l.caption,includeFontPadding:false},consentLabel:{flex:1,...b(e,"regular"),color:t.text.metaCool,fontSize:l.body,lineHeight:l.body*a.normal}})}o(oo,"makeStyles");function lo({when:e,clinician:t,petName:n,reason:r,shareRecords:i,onToggleShare:l,stateCode:a,stateAttested:s,onToggleStateAttest:c,cancellationTerms:d,termsAttested:p,onToggleTermsAttest:g,canConfirm:f,busy:y,failure:E,rateLimitMessage:_,onConfirm:P,emergency:h,onAcknowledgeEmergency:T,onSeeOtherVets:R,mediaShortfall:O=Ot,primaryVet:C,onFindEmergencyVet:q}){let D=V(),M=S(),N=react.useMemo(()=>He(M),[M]);return jsxRuntime.jsxs(reactNative.View,{style:D.scrollRoot,testID:"televet-booking-review",children:[jsxRuntime.jsxs(reactNative.ScrollView,{style:D.scrollBody,contentContainerStyle:D.list,keyboardShouldPersistTaps:"handled",showsVerticalScrollIndicator:false,testID:"televet-booking-review-scroll",children:[jsxRuntime.jsxs(ro,{testID:"televet-review-summary",children:[n?jsxRuntime.jsx(et,{label:u.summaryPet,value:n,testID:"televet-review-row-pet"}):null,t?jsxRuntime.jsx(et,{label:u.summaryVet,value:t,testID:"televet-review-row-vet"}):null,jsxRuntime.jsx(et,{label:u.summaryWhen,value:e,testID:"televet-review-row-when"}),jsxRuntime.jsx(et,{label:u.summaryLength,value:ne(u.summaryLengthTemplate,{n:String(at)}),testID:"televet-review-row-length"}),r?jsxRuntime.jsx(et,{label:u.summaryReason,value:r,last:true,testID:"televet-review-row-reason"}):null]}),jsxRuntime.jsx(Nt,{label:u.shareRecordsOff,checked:i,onToggle:l,testID:"televet-review-share-records"}),d?jsxRuntime.jsx(Nt,{label:d,checked:p,onToggle:g,testID:"televet-review-terms-attest"}):null,a?jsxRuntime.jsx(Nt,{label:ne(u.stateAttestTemplate,{state:a}),checked:s,onToggle:c,testID:"televet-review-state-attest"}):null,jsxRuntime.jsx(Bt,{shortfall:O,testIDPrefix:"televet-review"}),h?jsxRuntime.jsxs(reactNative.View,{style:N.emergencyBanner,testID:"televet-review-emergency",children:[jsxRuntime.jsx(v,{tier:"heading",accessibilityRole:"header",accessibilityLiveRegion:"assertive",style:N.emergencyTitle,children:u.emergency.bannerTitle}),jsxRuntime.jsx(v,{style:N.emergencyLede,children:u.emergency.lede}),h.length>0?jsxRuntime.jsx(v,{style:N.emergencyLede,testID:"televet-review-emergency-categories",children:h.join(", ")}):null,jsxRuntime.jsx(At,{petName:n,primaryVet:C,onFindEmergencyVet:q}),jsxRuntime.jsx(A,{label:u.emergency.keepBookingCta,kind:"secondary",loading:y,disabled:y,onPress:T,testID:"televet-review-emergency-ack"})]}):null,E==="failed"?jsxRuntime.jsx($,{message:u.confirmFailed}):null,E==="clinician_unavailable"?jsxRuntime.jsxs(reactNative.View,{style:D.list,testID:"televet-review-clinician-unavailable",children:[jsxRuntime.jsx($,{message:u.confirmFailed}),jsxRuntime.jsx(A,{label:u.seeOtherVetsCta,kind:"secondary",onPress:R,testID:"televet-review-see-other-vets"})]}):null,E==="rate_limited"&&_?jsxRuntime.jsx($,{message:_,testID:"televet-review-rate-limited"}):null,E==="rate_limited"&&!_?jsxRuntime.jsx($,{message:u.confirmFailed}):null,E==="not_entitled"?jsxRuntime.jsx($,{message:u.bookingPausedTitle,testID:"televet-review-not-entitled"}):null]}),h?null:jsxRuntime.jsx(reactNative.View,{style:D.scrollFooter,children:jsxRuntime.jsx(A,{label:u.confirmCta,kind:"primary",loading:y,disabled:!f||y||!!a&&!s||!!d&&!p,onPress:P,testID:"televet-review-confirm"})})]})}o(lo,"ReviewStep");var Vc="\u25CB",Mc="+";function Ae(e,t){return t?e.find(r=>r.petRef===t||r.petId===t)?.name??null:null}o(Ae,"nameOf");function Gi({pets:e,isPending:t,isError:n,onRetry:r,selectedId:i,onSelect:l,onAddPet:a}){let s=V(),c=S(),d=react.useMemo(()=>He(c),[c]);return t?jsxRuntime.jsx(reactNative.View,{style:s.list,testID:"televet-pets-loading",children:[0,1].map(p=>jsxRuntime.jsx(ee,{height:64},p))}):n?jsxRuntime.jsx(reactNative.View,{testID:"televet-pets-error",children:jsxRuntime.jsx(F,{title:u.chrome.loadFailedTitle,actionLabel:u.chrome.retryCta,onAction:r})}):e.length===0?jsxRuntime.jsx(reactNative.View,{testID:"televet-pets-empty",children:jsxRuntime.jsx(F,{title:u.chrome.noPetsTitle,actionLabel:u.addPetCta,onAction:a})}):jsxRuntime.jsxs(reactNative.View,{style:s.stepFill,children:[jsxRuntime.jsx(v,{tier:"heading",style:s.stepTitle,accessibilityRole:"header",children:u.petSelectTitle}),jsxRuntime.jsxs(reactNative.ScrollView,{contentContainerStyle:s.list,testID:"televet-pets",children:[e.map(p=>{let g=i===p.petRef,f=zi(p),y=p.name??"";return jsxRuntime.jsx(Ki,{name:y,meta:f,selected:g,onPress:()=>l(p.petRef),testID:`televet-pet-${p.petRef}`},p.petRef)}),a?jsxRuntime.jsx(Ki,{name:u.addPetCta,meta:"",selected:false,onPress:a,testID:"televet-pet-add",glyph:Mc}):null]}),jsxRuntime.jsx(reactNative.View,{style:d.spacer})]})}o(Gi,"PetStep");function Ki({name:e,meta:t,selected:n,onPress:r,testID:i,glyph:l}){let a=S(),s=react.useMemo(()=>He(a),[a]);return jsxRuntime.jsxs(reactNative.View,{style:[s.petRow,n?s.petRowSelected:null],children:[jsxRuntime.jsx(A,{label:e,onPress:r,kind:"secondary",accessibilityLabel:e,testID:i,style:s.petRowButton}),jsxRuntime.jsxs(reactNative.View,{style:s.petRowText,pointerEvents:"none",children:[jsxRuntime.jsx(reactNative.View,{style:s.petDisc,children:jsxRuntime.jsx(v,{tier:"compact",style:s.petDiscGlyph,children:l??Ji(e)})}),t?jsxRuntime.jsx(v,{tier:"compact",style:s.petRowMeta,children:t}):null]})]})}o(Ki,"PetRow");function Ji(e){let t=e.trim();return t.length===0?Vc:t.slice(0,1).toUpperCase()}o(Ji,"initialOf");function Xi({clinicians:e,isPending:t,isError:n,selectedId:r,onSelect:i,onRetry:l}){let a=V(),s=S(),c=react.useMemo(()=>He(s),[s]);if(t)return jsxRuntime.jsx(reactNative.View,{style:a.list,testID:"televet-clinicians-loading",children:jsxRuntime.jsx(ee,{height:96})});if(n)return jsxRuntime.jsx(reactNative.View,{testID:"televet-clinicians-error",children:jsxRuntime.jsx(F,{title:u.chrome.loadFailedTitle,actionLabel:u.chrome.retryCta,onAction:l})});if(e.length===0)return jsxRuntime.jsx(reactNative.View,{testID:"televet-clinicians-empty",children:jsxRuntime.jsx(F,{title:u.noCliniciansTitle,message:u.noCliniciansBody,actionLabel:u.noCliniciansRetryCta,onAction:l})});let d=e.find(p=>p.clinicianId===r)??e[0];return d===void 0?null:jsxRuntime.jsxs(reactNative.View,{style:a.list,testID:"televet-clinicians",children:[jsxRuntime.jsx(v,{tier:"heading",style:a.stepTitle,accessibilityRole:"header",children:u.yourVetTitle}),jsxRuntime.jsxs(reactNative.View,{style:c.vetRow,children:[jsxRuntime.jsx(reactNative.View,{style:c.vetAvatar,children:jsxRuntime.jsx(v,{tier:"heading",style:c.vetAvatarText,children:Ji(d.displayName)})}),jsxRuntime.jsxs(reactNative.View,{style:c.vetIdentity,children:[jsxRuntime.jsx(v,{style:c.vetName,children:d.displayName}),d.credentials?jsxRuntime.jsx(v,{style:c.vetCredentials,children:d.credentials}):null,d.rating!==null&&d.ratingCount!==null?jsxRuntime.jsx(v,{tier:"compact",style:c.vetRating,testID:"televet-vet-rating",children:`\u2605 ${String(d.rating)} \xB7 ${String(d.ratingCount)} ${u.reviewsLabel}`}):null]})]}),d.bio?jsxRuntime.jsx(v,{style:c.vetBio,testID:"televet-vet-bio",children:d.bio}):null,jsxRuntime.jsx(reactNative.View,{style:a.divider}),jsxRuntime.jsx(A,{label:u.continueCta,kind:"primary",onPress:()=>i(d.clinicianId),testID:`televet-clinician-${d.clinicianId}`})]})}o(Xi,"ClinicianStep");function Qi({slots:e,enabled:t,isPending:n,isError:r,busySlotId:i,failure:l,nextOpening:a,onPick:s,onRetry:c,onSeeOtherVets:d}){let p=V();return t?n?jsxRuntime.jsx(reactNative.View,{style:p.list,testID:"televet-slots-loading",children:[0,1,2].map(g=>jsxRuntime.jsx(ee,{height:48},g))}):r?jsxRuntime.jsx(F,{title:u.slotsErrorTitle,actionLabel:u.retryCta,onAction:c,testID:"televet-slots-error"}):e.length===0?jsxRuntime.jsx(reactNative.View,{testID:"televet-slots-empty",children:jsxRuntime.jsx(F,{title:u.noSlotsTitle,message:a?ne(u.nextOpeningTemplate,{when:pe(a.startsAt)}):void 0,actionLabel:a?u.seeOtherVetsCta:void 0,onAction:a?d:void 0})}):jsxRuntime.jsxs(reactNative.View,{style:p.stepFill,testID:"televet-slots",children:[l==="expired"?jsxRuntime.jsx($,{message:u.holdExpired}):null,l==="taken"?jsxRuntime.jsx($,{message:u.slotTaken}):null,jsxRuntime.jsx(Ft,{slots:e,busySlotId:i,onPick:s})]}):jsxRuntime.jsx(reactNative.View,{testID:"televet-slots-unavailable",children:jsxRuntime.jsx(F,{title:u.bookingPausedTitle})})}o(Qi,"SlotStep");function Zi({value:e,onChange:t,onNext:n,media:r,onChangeMedia:i,onPickMedia:l,checking:a=false}){let s=V(),c=S(),d=react.useMemo(()=>He(c),[c]),p=e.trim(),g=p.length>0&&p.length<=_e;return jsxRuntime.jsxs(reactNative.View,{style:s.scrollRoot,testID:"televet-booking-reason",children:[jsxRuntime.jsxs(reactNative.ScrollView,{style:s.scrollBody,contentContainerStyle:s.list,keyboardShouldPersistTaps:"handled",keyboardDismissMode:"interactive",showsVerticalScrollIndicator:false,testID:"televet-booking-reason-scroll",children:[jsxRuntime.jsx(v,{tier:"heading",style:s.stepTitle,accessibilityRole:"header",children:u.describeHeading}),jsxRuntime.jsx(v,{style:s.stepHelp,children:u.describeHelpLong}),jsxRuntime.jsx(Bl,{value:e,onChangeText:t,multiline:true,placeholder:u.reasonPlaceholder,placeholderTextColor:c.color.text.placeholder,style:d.reasonInput,testID:"televet-reason-input"}),p.length>_e?jsxRuntime.jsx($,{message:u.reasonTooLong}):null,jsxRuntime.jsx(Zr,{media:r,onChange:i,...l?{onPickMedia:l}:{}})]}),jsxRuntime.jsx(reactNative.View,{style:s.scrollFooter,children:jsxRuntime.jsx(A,{label:u.continueCta,kind:"primary",disabled:!g,loading:a,onPress:n,testID:"televet-reason-next"})})]})}o(Zi,"ReasonStep");function He(e){let{color:t,space:n,radius:r,type:i}=e,{size:l,lineHeight:a}=i;return reactNative.StyleSheet.create({marker:{minHeight:1},spacer:{height:n.md},petRow:{gap:n.xs,paddingVertical:n.xs},petRowSelected:{opacity:1},petRowButton:{alignSelf:"stretch",justifyContent:"flex-start"},petRowText:{flexDirection:"row",alignItems:"center",gap:n.sm,paddingHorizontal:n.md},petDisc:{width:28,height:28,borderRadius:14,backgroundColor:t.surfaceSubtle,alignItems:"center",justifyContent:"center"},petDiscGlyph:{...b(e,"medium"),color:t.brand,fontSize:l.caption,lineHeight:l.caption},petRowMeta:{flexShrink:1,...b(e,"regular"),color:t.text.metaCool,fontSize:l.caption,lineHeight:l.caption*a.normal},vetRow:{flexDirection:"row",alignItems:"center",gap:n.md},vetAvatar:{width:64,height:64,borderRadius:32,backgroundColor:t.surfaceSubtle,alignItems:"center",justifyContent:"center"},vetAvatarText:{...b(e,"medium"),color:t.brand,fontSize:l.heading,lineHeight:l.heading},vetIdentity:{flex:1,gap:2},vetName:{...b(e,"medium"),color:t.brand,fontSize:l.subtitle,lineHeight:l.subtitle*a.snug},vetCredentials:{...b(e,"regular"),color:t.text.metaCool,fontSize:l.caption,lineHeight:l.caption*a.normal},vetRating:{...b(e,"regular"),color:t.text.secondary,fontSize:l.caption,lineHeight:l.caption*a.normal},vetBio:{...b(e,"regular"),color:t.brand,fontSize:l.body,lineHeight:l.body*a.normal},reasonInput:{minHeight:120,textAlignVertical:"top",borderWidth:1,borderColor:t.brandBorder,borderRadius:r.md,padding:n.md,...b(e,"regular"),color:t.text.primary,fontSize:l.body,lineHeight:l.body*a.normal},emergencyBanner:{gap:n.md,padding:n.lg,borderRadius:r.lg,borderWidth:1,borderColor:t.errorRed,backgroundColor:t.badgeBgCritical},emergencyTitle:{...b(e,"bold"),color:t.errorRed,fontSize:l.subtitle,lineHeight:l.subtitle*a.snug},emergencyLede:{...b(e,"regular"),color:t.text.primary,fontSize:l.body,lineHeight:l.body*a.normal}})}o(He,"makeLocalStyles");function so(e){let{petRef:t,usState:n,controller:r,onBooked:i,onExit:l,onAddPet:a,onPickMedia:s,onAddToCalendar:c,onConfirmDiscard:d,onRequestLocation:p,locationStatus:g="unknown",onTriageReason:f,onStateInterest:y,primaryVet:E,onFindEmergencyVet:_,canJoinInApp:P=false,renderUnavailable:h,style:T,testID:R}=nt(e,["onBooked","onExit","onAddPet","onRequestLocation","onFindEmergencyVet"]),O=V(),C=S(),q=react.useMemo(()=>He(C),[C]),D=ae(r),M=it(),N=M.pets,K=N.length,fe=react.useMemo(()=>({ownedPetCount:K}),[K]),[Q,oe]=react.useReducer((G,gt)=>Or(G,gt,fe),void 0,()=>Pr({ownedPetCount:0},{petId:t??null,state:n??null})),I=react.useCallback(G=>oe(G),[]),[ue,ke]=react.useState(""),[z,qe]=react.useState(null),[Wt,Bn]=react.useState(null),[qt,$t]=react.useState(null),[mt,ko]=react.useState(false),[Dn,Co]=react.useState(false),[So,ka]=react.useState([]),[Fn,Ca]=react.useState(null),{draft:B}=Q,le=Ar(Q),Ro=react.useRef(B.state);Ro.current!==B.state&&(Ro.current=B.state,mt&&ko(false),Dn&&Co(false));let Kt=or(B.state,D),_o=St(D),vt=lr(D),de=ir(B.state,D),tt=Rt(B.clinicianId,D),Sa=ar(D).data??null,Yt=_t(D),xo=sr(D),Ce=Vr(f??null),wo=Mr(B.state,y??null).actionFor("no_licensed_vet"),Nn=n??null;react.useEffect(()=>{Nn&&!B.state&&I({type:"patch",patch:{state:Nn}});},[Nn,B.state,I]),react.useEffect(()=>{t&&!B.petId&&I({type:"patch",patch:{petId:t}});},[t,B.petId,I]);let Ln=N.length===1?N[0]?.petRef??null:null;react.useEffect(()=>{Ln&&!B.petId&&I({type:"patch",patch:{petId:Ln}});},[Ln,B.petId,I]);let Po=react.useRef(le);Po.current=le;let Io=react.useRef(0);react.useEffect(()=>{K!==Io.current&&(Io.current=K,I({type:"goTo",step:Po.current}));},[K,I]);let Vn=de.data?.[0]?.clinicianId??null;react.useEffect(()=>{Vn&&!B.clinicianId&&I({type:"patch",patch:{clinicianId:Vn}});},[Vn,B.clinicianId,I]);let Ra=react.useCallback(G=>{qe(null),Yt.mutate(G.slotId,{onSuccess:o(gt=>{I({type:"patch",patch:{slot:G,holdExpiresAt:gt.expiresAt,idempotencyKey:Dr(G.slotId)}}),I({type:"next"});},"onSuccess"),onError:o(gt=>qe(xe(gt).kind==="unavailable"?"unavailable":"taken"),"onError")});},[Yt,I]),{submitBooking:_a,confirm:xa}=ki({draft:B,reasonText:ue,book:xo,stateAttested:mt,termsAttested:Dn,cancellationPolicy:_o.data??null,triage:Ce,goTo:react.useCallback(G=>I({type:"goTo",step:G}),[I]),setFailure:qe,setRateLimitMessage:Bn,setEmergency:$t,setBookedConsult:Ca,...i?{onBooked:i}:{}}),wa=Kt.enabled&&Kt.data!==null&&!Kt.data.wellnessAvailable,Oo=vt.enabled&&vt.data?.active===false||z==="not_entitled",Pa=vt.enabled&&vt.data!==null,Ia=jr(Pa),Ao=Cn(So.length),Oa=ue.trim().length>0||!!B.slot,Aa=D===null||z==="unavailable"||cr(vt)||cr(Kt),Bo={noState:!B.state,isPending:de.enabled&&de.isPending,isError:de.isError,isEmpty:(de.data?.length??0)===0,notEntitled:Oo},Ba=Fi(Bo),Do={surfaceUnavailable:Aa,notEntitled:Oo,policyBlocked:wa,triageOpen:Ce.open,step:le},Da=Bi(Do);return Se()?jsxRuntime.jsxs(reactNative.View,{style:[O.screen,T],testID:R??"televet-booking",children:[jsxRuntime.jsx(Xr,{step:le,furthestIndex:Q.furthestIndex,canGoBack:(Ce.open||Ir(Q,fe))&&le!=="booked",isDirty:Oa,onBack:()=>{if(Ce.open){Ce.close();return}Ce.cancel(),I({type:"back"});},onClose:()=>l?.(),...d?{onConfirmDiscard:d}:{}}),Da?jsxRuntime.jsx(Di,{state:Do,petName:Ae(N,B.petId),...E?{primaryVet:E}:{},onFindEmergencyVet:_,stateInterest:wo,...y?{onCheckAvailability:o(()=>I({type:"goTo",step:"clinician"}),"onCheckAvailability")}:{},onAcknowledgeEmergency:()=>{Ce.acknowledge(ue),I({type:"next"});},...h?{renderUnavailable:h}:{}}):le==="time"?jsxRuntime.jsx(Qi,{slots:tt.data??[],enabled:tt.enabled,isPending:tt.enabled&&tt.isPending,isError:tt.isError,busySlotId:Yt.isPending?Yt.variables:null,failure:z,nextOpening:Sa,onPick:Ra,onRetry:()=>tt.refetch(),onSeeOtherVets:()=>I({type:"goTo",step:"clinician"})}):le==="review"?jsxRuntime.jsx(lo,{when:B.slot?pe(B.slot.startsAt):"",petName:Ae(N,B.petId),reason:ue.trim(),clinician:de.data?.find(G=>G.clinicianId===B.clinicianId)?.displayName??null,shareRecords:B.shareHealthRecords,stateCode:B.state,stateAttested:mt,onToggleStateAttest:ko,cancellationTerms:_o.data?.summary??null,termsAttested:Dn,onToggleTermsAttest:Co,onToggleShare:G=>I({type:"patch",patch:{shareHealthRecords:G}}),canConfirm:It(B,ue),busy:xo.isPending,failure:z,rateLimitMessage:Wt,onConfirm:xa,emergency:qt,onAcknowledgeEmergency:()=>_a(true),onSeeOtherVets:()=>I({type:"goTo",step:"clinician"}),mediaShortfall:Ao,primaryVet:E,onFindEmergencyVet:_}):le==="booked"?jsxRuntime.jsx(reactNative.View,{style:O.stepFill,testID:"televet-booking-booked",children:Fn?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Gr,{consult:Fn,petName:Ae(N,Fn.petId)??Ae(N,B.petId),onDone:()=>l?.(),canJoinInApp:P,...c?{onAddToCalendar:c}:{}}),jsxRuntime.jsx(Bt,{shortfall:Ao,testIDPrefix:"televet-booked"})]}):null}):le==="clinician"&&Ba?jsxRuntime.jsx(Ni,{state:Bo,cause:Ia,locationStatus:g,...p?{onRequestLocation:p}:{},onRetry:()=>de.refetch(),stateInterest:wo,...h?{renderUnavailable:h}:{}}):le==="clinician"?jsxRuntime.jsx(Xi,{clinicians:de.data??[],isPending:de.enabled&&de.isPending,isError:de.isError,selectedId:B.clinicianId,onRetry:()=>de.refetch(),onSelect:G=>{I({type:"patch",patch:{clinicianId:G}}),I({type:"next"});}}):le==="reason"?jsxRuntime.jsx(Zi,{value:ue,onChange:ke,media:So,onChangeMedia:ka,...s?{onPickMedia:s}:{},checking:Ce.checking,onNext:()=>{Ce.check(ue).then(G=>{G&&I({type:"next"});});}}):le==="pet"?jsxRuntime.jsx(Gi,{pets:N,isPending:M.loading,isError:M.error!==null,onRetry:()=>{M.refresh();},onAddPet:a,selectedId:B.petId,onSelect:G=>{I({type:"patch",patch:{petId:G}}),I({type:"next"});}}):jsxRuntime.jsx(reactNative.View,{style:q.marker,testID:`televet-booking-step-${le}`})]}):jsxRuntime.jsx(reactNative.View,{style:[O.screen,T],testID:R??"televet-booking",children:jsxRuntime.jsx(reactNative.View,{style:O.stepFill,testID:"televet-booking-copy-unapproved",children:h?h():null})})}o(so,"EverfurTelevetBooking");var Wc=2e4;function On(e=true,t=Wc){let[n,r]=react.useState(()=>Date.now());return react.useEffect(()=>{if(!e)return;r(Date.now());let i=setInterval(()=>r(Date.now()),t);return ()=>clearInterval(i)},[e,t]),n}o(On,"useNowMs");var x=Object.freeze({pastTitle:"Past visits",upcomingTitle:"Upcoming visits",emptyTitle:"No visits yet",bookCta:"Find a time",bookCardTitle:"Book a video visit",bookCardSubtitle:"Get help for your pet from home.",loadErrorTitle:"Could not load your visits",retryCta:"Try again",statusCompleted:"Completed",statusCancelled:"Cancelled",statusMissed:"Missed",manageCta:"Manage",joinCta:"Join call",joinDisabledReason:"You can join closer to the time.",joinOverReason:"This visit has ended.",vetUnassigned:"Your vet",rescheduleCta:"Reschedule",cancelCta:"Cancel visit",cancelConfirmTitle:"Cancel this visit?",cancelConfirmBody:"You can book another one afterwards.",cancelConfirmCta:"Cancel visit",cancelKeepCta:"Keep visit",cancelFailedTitle:"Could not cancel",cancelReason:"Cancelled by the pet parent in the app.",cancelPolicyErrorTitle:"Could not load what you need to agree to",phaseCancelled:"This visit was cancelled",phaseCancelledBody:"You can book another visit when you are ready.",notFoundTitle:"Not found",notFoundBody:"This visit is no longer available.",staleTitle:"Could not load your visits",staleRetry:"Try again"});function na(e){switch(e){case "completed":return x.statusCompleted;case "cancelled_owner":case "cancelled_ops":return x.statusCancelled;case "no_show_owner":case "no_show_vet":return x.statusMissed;default:return null}}o(na,"televetVisitStatusNative");function zt({onBack:e,testID:t}){let n=ft();return jsxRuntime.jsx(reactNative.View,{style:n.navRow,children:jsxRuntime.jsx(reactNative.Pressable,{onPress:e,accessibilityRole:"button",accessibilityLabel:Rn,testID:t,style:n.backTap,children:jsxRuntime.jsx(reactNative.View,{style:n.chevron,accessibilityElementsHidden:true,importantForAccessibility:"no"})})})}o(zt,"TelevetVisitBackRow");function ft(){let e=S();return react.useMemo(()=>Kc(e),[e])}o(ft,"useVisitStyles");function Kc(e){let{color:t,space:n,radius:r,type:i}=e,{size:l,lineHeight:a}=i;return reactNative.StyleSheet.create({screen:{flex:1,paddingHorizontal:n.xl},body:{gap:n.sm,paddingBottom:n.xl},navRow:{paddingVertical:n.sm,flexDirection:"row"},backTap:{minHeight:X,minWidth:X,justifyContent:"center"},chevron:{width:10,height:10,marginLeft:n.xs,borderLeftWidth:2,borderBottomWidth:2,borderColor:t.brand,transform:[{rotate:"45deg"}]},title:{...b(e,"medium"),color:t.brand,fontSize:l.heading,lineHeight:l.heading*a.snug,marginBottom:n.md},list:{gap:n.sm},row:{gap:n.xs,padding:n.md,borderRadius:r.md,borderWidth:1,borderColor:t.brandBorder,backgroundColor:t.surface},rowHead:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:n.sm},when:{flex:1,...b(e,"medium"),color:t.text.primary,fontSize:l.subtitle,lineHeight:l.subtitle*a.snug},status:{...b(e,"mono"),color:t.text.metaCool,fontSize:l.micro,letterSpacing:1},meta:{...b(e,"mono"),color:t.text.metaCool,fontSize:l.caption,lineHeight:l.caption*a.normal},bookCard:{gap:n.md,padding:n.xl,borderRadius:r.sm,borderWidth:reactNative.StyleSheet.hairlineWidth,borderColor:t.brand,backgroundColor:t.surface},bookTitle:{...b(e,"medium"),color:t.brand,fontSize:l.subtitle,lineHeight:l.subtitle*a.snug},bookSubtitle:{...b(e,"regular"),color:t.text.metaCool,fontSize:l.body,lineHeight:l.body*a.normal},visitCard:{gap:n.md,padding:n.lg,borderRadius:r.lg,borderWidth:1,borderColor:t.brandBorder},visitWhen:{...b(e,"medium"),color:t.brand,fontSize:l.heading,lineHeight:l.heading*a.snug},visitWho:{...b(e,"regular"),color:t.text.primary,fontSize:l.subtitle,lineHeight:l.subtitle*a.snug},visitMeta:{...b(e,"regular"),color:t.text.metaCool,fontSize:l.caption,lineHeight:l.caption*a.normal},reason:{...b(e,"regular"),color:t.text.metaCool,fontSize:l.caption,lineHeight:l.caption*a.normal},terms:{padding:n.md,borderRadius:r.sm,backgroundColor:t.surfaceSubtle,...b(e,"regular"),color:t.text.metaCool,fontSize:l.caption,lineHeight:l.caption*a.normal},noticeTitle:{...b(e,"bold"),color:t.text.primary,fontSize:l.subtitle,lineHeight:l.subtitle*a.snug},noticeBody:{...b(e,"regular"),color:t.text.metaCool,fontSize:l.body,lineHeight:l.body*a.normal},receipt:{gap:n.xs,padding:n.md,borderRadius:r.sm,backgroundColor:t.surfaceSubtle},stack:{gap:n.xs}})}o(Kc,"makeVisitStyles");function uo({consult:e,controller:t,onJoin:n,onReschedule:r,onCancelled:i,onBack:l,revision:a=0,nowMs:s,style:c}){let d=ft(),p=ae(t),[g,f]=react.useState(0),y=Tl(e.consultId,p,a+g),E=St(p),_=El(e.consultId,p),{pets:P}=it(),[h,T]=react.useState(false),[R,O]=react.useState(false),[C,q]=react.useState(null),D=y.isError&&y.error?.httpStatus===404,M=D?null:y.data??e,N=M!==null&&$e.has(M.status),K=On(!N),Q=fr(M,s??K),oe=M===null?null:Ae(P,M.petId),I=E.data?.summary.trim()||null,ue=react.useCallback(()=>{I&&(O(false),_.mutate(x.cancelReason,{onSuccess:o($t=>{T(false),q($t),f(mt=>mt+1),i?.($t);},"onSuccess"),onError:o(()=>O(true),"onError")}));},[I,_,i]);if(M===null)return jsxRuntime.jsxs(reactNative.View,{style:[d.screen,c],testID:"televet-consult-missing",children:[jsxRuntime.jsx(zt,{onBack:l,testID:"televet-consult-back"}),jsxRuntime.jsx(F,{title:x.notFoundTitle,message:x.notFoundBody})]});let ke=M.status,z=ke==="cancelled_owner"||ke==="cancelled_ops",qe=ke==="scheduled"||ke==="in_progress",Wt=yr(ke)&&C===null,Bn=M.clinicianName??x.vetUnassigned,qt=[oe,M.reasonText].filter(Boolean).join(" \xB7 ");return jsxRuntime.jsxs(reactNative.View,{style:[d.screen,c],testID:"televet-consult",children:[jsxRuntime.jsx(zt,{onBack:l,testID:"televet-consult-back"}),jsxRuntime.jsxs(reactNative.ScrollView,{contentContainerStyle:d.body,children:[jsxRuntime.jsxs(reactNative.View,{style:d.visitCard,children:[jsxRuntime.jsx(v,{style:d.visitWhen,accessibilityRole:"header",testID:"televet-consult-when",children:pe(M.scheduledAt)}),jsxRuntime.jsxs(reactNative.View,{style:d.stack,children:[jsxRuntime.jsx(v,{style:d.visitWho,testID:"televet-consult-vet",children:Bn}),qt?jsxRuntime.jsx(v,{style:d.visitMeta,numberOfLines:2,children:qt}):null]})]}),qe&&C===null?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(A,{label:x.joinCta,disabled:!Q.ready,onPress:()=>n(M,oe),testID:"televet-consult-join"}),Q.ready?null:jsxRuntime.jsx(v,{style:d.reason,testID:"televet-consult-join-reason",children:Q.reason==="consult_over"?x.joinOverReason:x.joinDisabledReason}),Wt&&r?jsxRuntime.jsx(A,{label:x.rescheduleCta,kind:"secondary",onPress:()=>r(M),testID:"televet-consult-reschedule"}):null]}):null,C?jsxRuntime.jsx(reactNative.View,{style:d.receipt,testID:"televet-consult-cancel-receipt",children:jsxRuntime.jsx(v,{style:d.noticeTitle,accessibilityLiveRegion:"polite",children:C.summary??x.phaseCancelled})}):z?jsxRuntime.jsxs(reactNative.View,{style:d.stack,testID:"televet-consult-cancelled",children:[jsxRuntime.jsx(v,{style:d.noticeTitle,accessibilityRole:"header",children:x.phaseCancelled}),jsxRuntime.jsx(v,{style:d.noticeBody,children:x.phaseCancelledBody})]}):null,Wt?jsxRuntime.jsxs(reactNative.View,{style:d.stack,children:[I?jsxRuntime.jsx(v,{style:d.terms,accessibilityLiveRegion:"polite",testID:"televet-consult-cancellation-policy",children:I}):E.enabled&&E.isPending?jsxRuntime.jsx(reactNative.View,{testID:"televet-consult-cancellation-policy-loading",children:jsxRuntime.jsx(ee,{height:42})}):jsxRuntime.jsx(F,{title:x.cancelPolicyErrorTitle,actionLabel:x.retryCta,onAction:()=>E.refetch(),testID:"televet-consult-cancellation-policy-error"}),h?jsxRuntime.jsxs(reactNative.View,{style:d.stack,testID:"televet-consult-cancel-confirm",children:[jsxRuntime.jsx(v,{style:d.noticeTitle,children:x.cancelConfirmTitle}),jsxRuntime.jsx(v,{style:d.noticeBody,children:x.cancelConfirmBody}),R?jsxRuntime.jsx($,{message:x.cancelFailedTitle,testID:"televet-consult-cancel-failed"}):null,jsxRuntime.jsx(A,{label:x.cancelConfirmCta,kind:"danger",loading:_.isPending,onPress:ue,testID:"televet-consult-cancel-yes"}),jsxRuntime.jsx(A,{label:x.cancelKeepCta,kind:"secondary",disabled:_.isPending,onPress:()=>{T(false),O(false);},testID:"televet-consult-cancel-keep"})]}):jsxRuntime.jsx(A,{label:x.cancelCta,kind:"secondary",disabled:!I,onPress:()=>{O(false),T(true);},testID:"televet-consult-cancel"})]}):null,y.isError&&!D?jsxRuntime.jsx(F,{title:x.staleTitle,actionLabel:x.staleRetry,onAction:()=>y.refetch(),testID:"televet-consult-stale"}):null]})]})}o(uo,"TelevetConsultScreen");var jt=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:"Usually under a minute",lobbyPrepLabel:"WHILE YOU WAIT",lobbyPrepNoPet:"Have your pet nearby and somewhere well lit.",lobbyTitle:o(e=>{let t=e?.trim()??"";return t.length>0?`${t} is joining`:jt.lobbyTitleNoName},"lobbyTitle"),lobbyPrep:o(e=>{let t=e?.trim()??"";return t.length>0?`Have ${t} nearby and somewhere well lit.`:jt.lobbyPrepNoPet},"lobbyPrep"),lobbyDuration:o(e=>`${e} MINUTE VISIT`,"lobbyDuration"),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 la(e){switch(e){case "too_early":return "You can join closer to the time.";case "too_late":return "This visit has ended.";case "room_not_ready":return "The room is still being set up. Try again in a moment.";case "not_joinable":return "This visit is no longer open.";case "unavailable":return "No way to join this visit yet.";default:return "That did not open. Try again."}}o(la,"televetJoinRefusalNativeCopy");var ia="No way to join this visit yet.";function aa(e){return e==="room_not_ready"||e==="unknown"}o(aa,"televetJoinIsRetryable");var sa=Symbol.for("@everfur/sdk/televet");function Xc(){let e=globalThis,t=e[sa];if(t!==void 0)return t;let n={presenter:null,snapshot:Object.freeze({request:null,serial:0,activeHost:null}),hosts:[],nextHost:1,listeners:new Set,dailyRegistered:false};return e[sa]=n,n}o(Xc,"televetGlobal");function da(){return Xc().dailyRegistered}o(da,"isEverfurDailyRegistered");function ca(e){let t=null;return ()=>{if(t!==null)return t;let n=e();return t=n,n.then(void 0,()=>{t===n&&(t=null);}),n}}o(ca,"memoizeTelevetLoader");var pa=Object.freeze({status:"joining"});function po(e,t){let[n,r]=react.useState(0),[i,l]=react.useState(pa),a=react.useRef(null);react.useEffect(()=>{let c=t?.joinConsult;if(t===null||c===void 0){l(Object.freeze({status:"refused",refusal:"unavailable",reason:null}));return}let d=`${e}#${String(n)}`,p=a.current;if(p===null||p.key!==d){let f;try{f=c.call(t,e);}catch(y){f=Promise.reject(y);}p={key:d,promise:f},a.current=p;}let g=true;return l(pa),p.promise.then(f=>{g&&(f.ok?l(Object.freeze({status:"ready",credential:f.value})):l(Object.freeze({status:"refused",refusal:Jn(f.error),reason:Gn(f.error)})));},()=>{g&&l(Object.freeze({status:"refused",refusal:"unknown",reason:null}));}),()=>{g=false;}},[e,t,n]);let s=react.useCallback(()=>r(c=>c+1),[]);return {state:i,retry:s}}o(po,"useTelevetJoin");var fo=react.createContext(null);function fa(e){let t=react.useContext(fo);react.useEffect(()=>{if(!(t===null||!e))return t.setFullBleed(true),()=>{t.setFullBleed(false);}},[t,e]);}o(fa,"useTelevetModalFullBleed");var iu=ca(()=>import('@everfur/sdk/televet/call'));function mo({consultId:e,controller:t,clinicianName:n,petName:r,onLeave:i,style:l}){let a=V(),s=ae(t),{state:c,retry:d}=po(e,s),[p,g]=react.useState(null),[f,y]=react.useState(false),E=c.status==="ready";react.useEffect(()=>{if(!E||p!==null)return;let R=true;return iu().then(O=>{R&&g(()=>O);},()=>{R&&y(true);}),()=>{R=false;}},[E,p]);let _=E&&p!==null&&!f,P=o(()=>(_||i(),true),"onBackPress");rt(P);let h=react.useRef(P);if(h.current=P,react.useEffect(()=>{let R=reactNative.BackHandler.addEventListener("hardwareBackPress",()=>h.current());return ()=>{R.remove();}},[]),fa(_),c.status==="refused"||f){let R=c.status==="refused"?c.refusal:"unavailable";return jsxRuntime.jsxs(reactNative.View,{style:[a.stepFill,l],testID:"televet-join-refused",children:[jsxRuntime.jsx($,{message:la(R),testID:"televet-join-refused-message"}),aa(R)&&c.status==="refused"?jsxRuntime.jsx(A,{label:u.retryCta,kind:"primary",onPress:d,testID:"televet-join-retry"}):null,jsxRuntime.jsx(A,{label:jt.leaveCta,kind:"secondary",onPress:i,testID:"televet-join-leave"})]})}if(c.status==="joining"||p===null)return jsxRuntime.jsx(reactNative.View,{style:[a.list,l],testID:"televet-join-loading",accessibilityLabel:u.loading.consult,children:jsxRuntime.jsx(ee,{height:48})});let{EverfurVetCall:T}=p;return jsxRuntime.jsx(T,{roomUrl:c.credential.roomUrl,token:c.credential.token,onLeave:i,clinicianName:n??null,petName:r??null,renderUnavailable:()=>jsxRuntime.jsxs(reactNative.View,{style:[a.stepFill,l],testID:"televet-join-call-unavailable",children:[jsxRuntime.jsx($,{message:ia}),jsxRuntime.jsx(A,{label:jt.leaveCta,kind:"secondary",onPress:i,testID:"televet-join-unavailable-leave"})]}),style:l})}o(mo,"TelevetJoinScreen");function vo(e){let{consult:t,onRescheduled:n,onCancel:r,controller:i,style:l,testID:a}=nt(e,["onRescheduled","onCancel"]),s=V(),c=ae(i),d=Rt(t?.clinicianId??null,c),p=_t(c),g=dr(t?.consultId??null,c),[f,y]=react.useState(null),E=react.useCallback(P=>{y(null),p.mutate(P.slotId,{onSuccess:o(()=>{g.mutate(P.slotId,{onSuccess:o(h=>n?.(h),"onSuccess"),onError:o(h=>y(xe(h).kind==="unavailable"?"unavailable":"failed"),"onError")});},"onSuccess"),onError:o(h=>y(xe(h).kind==="unavailable"?"unavailable":"taken"),"onError")});},[p,g,n]),_=p.isPending||g.isPending;return Se()?t?jsxRuntime.jsxs(reactNative.View,{style:[s.stepFill,l],testID:a??"televet-reschedule",children:[jsxRuntime.jsx(v,{tier:"compact",style:s.stepHelp,children:ne(u.rescheduleFromTemplate,{when:pe(t.scheduledAt)})}),f==="taken"?jsxRuntime.jsx($,{message:u.slotTaken}):null,f==="failed"?jsxRuntime.jsx($,{message:u.rescheduleFailed}):null,f==="unavailable"?jsxRuntime.jsx($,{message:u.bookingPausedTitle,testID:"televet-reschedule-unavailable"}):null,d.enabled?d.isPending?jsxRuntime.jsx(reactNative.View,{style:s.list,testID:"televet-reschedule-slots-loading",children:[0,1,2].map(P=>jsxRuntime.jsx(ee,{height:48},P))}):d.isError?jsxRuntime.jsx(F,{title:u.slotsErrorTitle,actionLabel:u.retryCta,onAction:()=>d.refetch(),testID:"televet-reschedule-slots-error"}):(d.data??[]).length===0?jsxRuntime.jsx(reactNative.View,{testID:"televet-reschedule-empty",children:jsxRuntime.jsx(F,{title:u.noSlotsTitle})}):jsxRuntime.jsx(Ft,{slots:d.data??[],busySlotId:_?p.variables:null,onPick:E,rowTestIdPrefix:"televet-reschedule-slot",testID:"televet-reschedule-slots"}):jsxRuntime.jsx(reactNative.View,{testID:"televet-reschedule-paused",children:jsxRuntime.jsx(F,{title:u.bookingPausedTitle})}),jsxRuntime.jsx(A,{label:u.keepExistingCta,kind:"secondary",disabled:_,onPress:()=>r?.(),testID:"televet-reschedule-keep"})]}):jsxRuntime.jsx(reactNative.View,{style:[s.list,l],testID:"televet-reschedule-loading",children:[0,1].map(P=>jsxRuntime.jsx(ee,{height:48},P))}):jsxRuntime.jsx(reactNative.View,{style:[s.stepFill,l],testID:"televet-reschedule-copy-unapproved"})}o(vo,"EverfurTelevetReschedule");function go({controller:e,onOpenVisit:t,onBook:n,onBack:r,revision:i=0,nowMs:l,style:a}){let s=ft(),c=ae(e),d=cn(c,i),{pets:p}=it(),g=d.data??[],f=g.some(C=>!$e.has(C.status)),y=On(f),E=l??y,{upcoming:_,past:P}=react.useMemo(()=>xt(g,E),[g,E]),h=d.enabled&&d.isPending,T=d.isError&&d.data===null,R=!h&&!T&&g.length>0,O=o(C=>{let q=na(C.status),D=[C.clinicianName,Ae(p,C.petId)].filter(Boolean).join(" \xB7 ");return jsxRuntime.jsxs(reactNative.View,{style:s.row,testID:`televet-visits-row-${C.consultId}`,children:[jsxRuntime.jsxs(reactNative.View,{style:s.rowHead,children:[jsxRuntime.jsx(v,{style:s.when,children:bi(C.scheduledAt)}),q?jsxRuntime.jsx(v,{style:s.status,testID:`televet-visits-status-${C.consultId}`,children:q}):null]}),D?jsxRuntime.jsx(v,{style:s.meta,children:D}):null,C.status==="completed"?null:jsxRuntime.jsx(A,{label:x.manageCta,kind:"secondary",onPress:()=>t(C),testID:`televet-visits-open-${C.consultId}`})]},C.consultId)},"renderRow");return jsxRuntime.jsxs(reactNative.View,{style:[s.screen,a],testID:"televet-visits",children:[jsxRuntime.jsx(zt,{onBack:r,testID:"televet-visits-back"}),jsxRuntime.jsxs(reactNative.ScrollView,{contentContainerStyle:s.body,children:[R?null:jsxRuntime.jsx(v,{style:s.title,accessibilityRole:"header",children:x.pastTitle}),T?jsxRuntime.jsxs(reactNative.View,{style:s.list,children:[jsxRuntime.jsx(F,{title:x.loadErrorTitle,message:Hl(d.error)??void 0,actionLabel:x.retryCta,onAction:()=>d.refetch(),testID:"televet-visits-error"}),n?jsxRuntime.jsx(ga,{onBook:n}):null]}):h?jsxRuntime.jsx(reactNative.View,{style:s.list,testID:"televet-visits-loading",children:[0,1,2].map(C=>jsxRuntime.jsx(ee,{height:72},C))}):g.length===0?jsxRuntime.jsxs(reactNative.View,{style:s.list,testID:"televet-visits-empty",children:[jsxRuntime.jsx(F,{title:x.emptyTitle}),n?jsxRuntime.jsx(A,{label:x.bookCta,onPress:n,testID:"televet-visits-book"}):null]}):jsxRuntime.jsxs(reactNative.View,{style:s.list,children:[_.length>0?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(v,{style:s.title,accessibilityRole:"header",children:x.upcomingTitle}),jsxRuntime.jsx(reactNative.View,{style:s.list,testID:"televet-visits-upcoming",children:_.map(O)})]}):null,n?jsxRuntime.jsx(ga,{onBook:n}):null,jsxRuntime.jsx(v,{style:s.title,accessibilityRole:"header",children:x.pastTitle}),P.length>0?jsxRuntime.jsx(reactNative.View,{style:s.list,testID:"televet-visits-past",children:P.map(O)}):null]})]})]})}o(go,"TelevetVisitsScreen");function ga({onBook:e}){let t=ft();return jsxRuntime.jsxs(reactNative.View,{style:t.bookCard,testID:"televet-visits-book-card",children:[jsxRuntime.jsx(v,{style:t.bookTitle,children:x.bookCardTitle}),jsxRuntime.jsx(v,{style:t.bookSubtitle,children:x.bookCardSubtitle}),jsxRuntime.jsx(A,{label:x.bookCta,kind:"primary",onPress:e,testID:"televet-visits-book"})]})}o(ga,"BookCard");var bo=Object.freeze({name:"home"}),vu=Object.freeze({name:"visits"}),gu=Object.freeze({name:"booking"});function ho(e){let t=e.visitRef?.trim()??"";return t.length>0?Object.freeze({name:"visit",visitRef:t,intent:e.intent??null}):bo}o(ho,"televetScreenForRequest");function bu(e,t){switch(t.type){case "push":return Object.freeze({stack:Object.freeze([...e.stack,t.screen])});case "pop":return e.stack.length<=1?e:Object.freeze({stack:Object.freeze(e.stack.slice(0,-1))});case "land":return e.stack[0]?.name!=="home"?e:Object.freeze({stack:Object.freeze([t.screen,...e.stack.slice(1)])});default:return e}}o(bu,"navReducer");function Ta(e){let{style:t,renderPending:n,...r}=nt(e,["onExit","onBooked","onAddPet","onRequestLocation","onFindEmergencyVet"]);return jsxRuntime.jsx(Vl,{capability:"televet",style:t,...n?{renderPending:n}:{},children:jsxRuntime.jsx(hu,{...r,style:t})})}o(Ta,"EverfurTelevetFlow");function hu({petRef:e,usState:t,controller:n,onBooked:r,onExit:i,onAddPet:l,onPickMedia:a,onAddToCalendar:s,onConfirmDiscard:c,onRequestLocation:d,locationStatus:p,primaryVet:g,onFindEmergencyVet:f,onTriageReason:y,canJoinInApp:E=false,renderUnavailable:_,initialScreen:P,style:h}){let T=V(),[R,O]=react.useReducer(bu,P??bo,z=>Object.freeze({stack:Object.freeze([z])})),C=R.stack[R.stack.length-1]??bo,q=R.stack.length,[D,M]=react.useState(0),N=react.useCallback(()=>M(z=>z+1),[]),K=react.useCallback(()=>q<=1||C.name==="call"||C.name==="booking"?false:(O({type:"pop"}),true),[q,C.name]);react.useEffect(()=>{let z=reactNative.BackHandler.addEventListener("hardwareBackPress",K);return ()=>{z.remove();}},[K]),rt(K);let fe=react.useCallback(()=>_?_():jsxRuntime.jsx(reactNative.View,{style:T.list,testID:"televet-unavailable",children:Se()?jsxRuntime.jsx(F,{title:u.bookingPausedTitle}):null}),[_,T.list]),Q=react.useCallback(()=>{q>1?O({type:"pop"}):i?.();},[q,i]),oe=o(z=>O({type:"push",screen:z}),"push"),I=react.useCallback(z=>O({type:"land",screen:z==="visits"?vu:gu}),[]),ue=jsxRuntime.jsx(so,{...e!==void 0?{petRef:e}:{},...t!==void 0?{usState:t}:{},...n?{controller:n}:{},onBooked:z=>{N(),r?.(z);},onExit:Q,...l?{onAddPet:l}:{},...a?{onPickMedia:a}:{},...s?{onAddToCalendar:s}:{},...c?{onConfirmDiscard:c}:{},...d?{onRequestLocation:d}:{},...p?{locationStatus:p}:{},...g?{primaryVet:g}:{},...f?{onFindEmergencyVet:f}:{},...y?{onTriageReason:y}:{},canJoinInApp:E,renderUnavailable:fe,style:h}),ke=jsxRuntime.jsx(go,{...n?{controller:n}:{},revision:D,onOpenVisit:z=>oe({name:"consult",consult:z}),onBook:()=>oe({name:"booking"}),onBack:Q,style:h});switch(C.name){case "home":return jsxRuntime.jsx(Tu,{controller:n,onLand:I,style:h});case "booking":return ue;case "visits":case "visit":return ke;case "consult":return jsxRuntime.jsx(uo,{consult:C.consult,...n?{controller:n}:{},revision:D,onJoin:(z,qe)=>oe({name:"call",consultId:z.consultId,clinicianName:z.clinicianName,petName:qe}),onReschedule:z=>oe({name:"reschedule",consult:z}),onCancelled:N,onBack:Q,style:h});case "reschedule":return jsxRuntime.jsx(vo,{consult:C.consult,...n?{controller:n}:{},onRescheduled:()=>{N(),O({type:"pop"});},onCancel:()=>O({type:"pop"}),style:h});case "call":return jsxRuntime.jsx(mo,{consultId:C.consultId,...n?{controller:n}:{},...C.clinicianName!==void 0?{clinicianName:C.clinicianName}:{},...C.petName!==void 0?{petName:C.petName}:{},onLeave:()=>{N(),Q();},style:h});default:return Gt(C)}}o(hu,"TelevetFlowBody");function Tu({controller:e,onLand:t,style:n}){let r=V(),i=ae(e),l=kl(i);return react.useEffect(()=>{l!=="pending"&&t(l);},[l,t]),jsxRuntime.jsxs(reactNative.View,{style:[r.screen,r.list,n],testID:"televet-landing-loading",children:[jsxRuntime.jsx(ee,{height:72}),jsxRuntime.jsx(ee,{height:72})]})}o(Tu,"TelevetLandingScreen");var To=Ta;function wu({request:e,onClose:t}){let n=S(),r=reactNativeSafeAreaContext.useSafeAreaInsets(),i=react.useMemo(()=>Lo(),[]),l=react.useCallback(()=>{i.dispatch()||t();},[i,t]),[a,s]=react.useState(false),c=react.useMemo(()=>({setFullBleed:s}),[]),d=react.useMemo(()=>ho(e),[e]);return jsxRuntime.jsx(reactNative.Modal,{visible:true,animationType:n.motion.reducedMotion?"none":"slide",presentationStyle:"fullScreen",onRequestClose:l,children:jsxRuntime.jsx(reactNative.View,{testID:"everfur-televet-modal",style:[Ea.root,{backgroundColor:n.color.surface},a?null:{paddingTop:r.top,paddingBottom:r.bottom}],children:jsxRuntime.jsx(zn.Provider,{value:i,children:jsxRuntime.jsx(fo.Provider,{value:c,children:jsxRuntime.jsx(To,{...e.petRef!==void 0?{petRef:e.petRef}:{},...e.usState!==void 0?{usState:e.usState}:{},initialScreen:d,onExit:t,canJoinInApp:da(),style:Ea.root})})})})})}o(wu,"EverfurTelevetModal");var Ea=reactNative.StyleSheet.create({root:{flex:1}});exports.BACK_LABEL=Rn;exports.CANCELLATION_POLICY_VERSION_MAX=tn;exports.CANCEL_REASON_MAX=rn;exports.CONSULT_KINDS=el;exports.CONSULT_MINUTES=at;exports.CONSULT_STATUSES=Zo;exports.EverfurTelevet=To;exports.EverfurTelevetBooking=so;exports.EverfurTelevetFlow=Ta;exports.EverfurTelevetModal=wu;exports.EverfurTelevetReschedule=vo;exports.MEDIA_REFS_MAX=nn;exports.NO_MEDIA_SHORTFALL=Ot;exports.REASON_TEXT_MAX=_e;exports.TELEVET_BOOKING_BASE=Le;exports.TELEVET_BOOKING_COPY=u;exports.TELEVET_BOOKING_STEPS=Me;exports.TELEVET_CONSULT_PAGE_LIMIT=pl;exports.TELEVET_JOIN_CLOSES_MINUTES_AFTER=pr;exports.TELEVET_JOIN_OPENS_MINUTES_BEFORE=ur;exports.TERMINAL_CONSULT_STATUSES=$e;exports.TelevetBookedScreen=Gr;exports.TelevetBookingChrome=Xr;exports.TelevetClinicianEmptyState=Ai;exports.TelevetConsentCheckbox=Nt;exports.TelevetConsultScreen=uo;exports.TelevetDayStrip=eo;exports.TelevetEarlyEmergency=Oi;exports.TelevetEmergencyExits=At;exports.TelevetEntitlementInterestState=tc;exports.TelevetIntakeMedia=Zr;exports.TelevetJoinScreen=mo;exports.TelevetMediaDropNotice=Bt;exports.TelevetSlotPicker=Ft;exports.TelevetStateInterestAction=qr;exports.TelevetSummaryCard=ro;exports.TelevetSummaryRow=et;exports.TelevetVisitsScreen=go;exports.attestation=Fr;exports.canConfirm=It;exports.canManageTelevetVisit=yr;exports.createTelevetBookingController=tr;exports.currentStep=Ar;exports.emptyTelevetDraft=mi;exports.formatVisitRange=zd;exports.formatWhen=gi;exports.formatWhenWithDay=pe;exports.hasPreviousStep=Ir;exports.initialTelevetBookingState=Pr;exports.isHoldExpired=Br;exports.isMediaShortfallEmpty=Hr;exports.isSkipped=Tn;exports.isTelevetBookingCopyReady=Se;exports.isWellFormedStateCode=me;exports.mediaShortfallFromUnsentPicks=Cn;exports.parseVetCallCredential=Yn;exports.splitTelevetVisits=xt;exports.televetBookingKey=Dr;exports.televetBookingReducer=Or;exports.televetBookingRefusal=xe;exports.televetCancelCall=ul;exports.televetConsultCalendarKey=Li;exports.televetConsultCall=ln;exports.televetDaysFromSlots=wn;exports.televetEmptyRosterCause=jr;exports.televetEmptyRosterView=zr;exports.televetHoldCall=sl;exports.televetJoinCall=cl;exports.televetJoinOpensAtMs=Ys;exports.televetJoinReadiness=fr;exports.televetMediaShortfallLines=Ur;exports.televetRescheduleCall=dl;exports.televetScreenForRequest=ho;exports.useEarlyTriage=Vr;exports.useStateInterest=Mr;exports.useTelevetBookConsult=sr;exports.useTelevetBookingAvailable=$s;exports.useTelevetBookingController=ae;exports.useTelevetBookingEntitlement=lr;exports.useTelevetCancellationPolicy=St;exports.useTelevetClinicians=ir;exports.useTelevetHoldSlot=_t;exports.useTelevetJoin=po;exports.useTelevetNextSlot=ar;exports.useTelevetRescheduleConsult=dr;exports.useTelevetSlots=Rt;exports.useTelevetStatePolicy=or;exports.validateBookingBody=fl;exports.vetCallJoinReason=Gn;exports.vetCallJoinRefusal=Jn;exports.withUnsentPicks=$d;