@everfur/sdk 0.5.4 → 0.5.5

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 (105) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/README.md +8 -8
  3. package/dist/{Chat-Dfjegpf2.d.cts → Chat-BBnXSZQG.d.cts} +20 -3
  4. package/dist/{Chat-DXDS-MiC.d.ts → Chat-BzvoUe9L.d.ts} +20 -3
  5. package/dist/{DepthViews-BhBA6qiu.d.cts → DepthViews-BYEgUxDQ.d.ts} +1 -1
  6. package/dist/{DepthViews-meuqwdBv.d.cts → DepthViews-CsVphyQL.d.ts} +1 -1
  7. package/dist/{DepthViews-ru9SaVXz.d.ts → DepthViews-D-pleytA.d.cts} +1 -1
  8. package/dist/{DepthViews-DFODLIM2.d.ts → DepthViews-DKbfq4bX.d.cts} +1 -1
  9. package/dist/animations/index.d.cts +3 -3
  10. package/dist/animations/index.d.ts +3 -3
  11. package/dist/{attachments-DN0VDOBG.d.cts → attachments-BcD6K0IF.d.cts} +5 -5
  12. package/dist/{attachments-Cnz4Zqxq.d.ts → attachments-CFK3WPF4.d.ts} +5 -5
  13. package/dist/{attachments-hAjG4YGo.d.cts → attachments-CieUG7nB.d.cts} +2 -2
  14. package/dist/{attachments-D3i4WG5V.d.ts → attachments-DorefS77.d.ts} +2 -2
  15. package/dist/{bookingCopy-Bu1pMPh1.d.ts → bookingCopy-BUTs_nKf.d.ts} +2 -2
  16. package/dist/{bookingCopy-DP3k0iBn.d.cts → bookingCopy-Cl3RZ_k2.d.cts} +2 -2
  17. package/dist/{casesRepository-Bf8QDDPM.d.ts → casesRepository-C29WolRA.d.ts} +1 -1
  18. package/dist/{casesRepository-BIV6eQxW.d.cts → casesRepository-Ct5MO1mM.d.cts} +1 -1
  19. package/dist/chat/index.cjs +1 -1
  20. package/dist/chat/index.d.cts +9 -9
  21. package/dist/chat/index.d.ts +9 -9
  22. package/dist/chat/index.js +1 -1
  23. package/dist/client/index.cjs +2 -2
  24. package/dist/client/index.d.cts +6 -6
  25. package/dist/client/index.d.ts +6 -6
  26. package/dist/client/index.js +2 -2
  27. package/dist/{config-3jJR8fVC.d.cts → config-BBeF3kv5.d.cts} +1 -1
  28. package/dist/{config-FhlcRHRe.d.ts → config-Dl8Iqs1i.d.ts} +1 -1
  29. package/dist/consent/index.d.cts +5 -5
  30. package/dist/consent/index.d.ts +5 -5
  31. package/dist/{context-BVGuiYob.d.cts → context-DGZrfVkE.d.cts} +5 -5
  32. package/dist/{context-BqfAkCov.d.ts → context-DXj75_Lo.d.ts} +5 -5
  33. package/dist/{copy-DBbgO9g4.d.cts → copy-CQHEQwW7.d.cts} +2 -2
  34. package/dist/{copy-BDfIOo5Z.d.ts → copy-CSbMmuCV.d.ts} +2 -2
  35. package/dist/core/index.cjs +7 -7
  36. package/dist/core/index.d.cts +15 -13
  37. package/dist/core/index.d.ts +15 -13
  38. package/dist/core/index.js +7 -7
  39. package/dist/{depth-Cwmumplg.d.cts → depth-Bb2yphTT.d.cts} +2 -2
  40. package/dist/{depth-VpVaDj5I.d.ts → depth-DRzDoKeE.d.ts} +2 -2
  41. package/dist/{entitlementRepository-Cys2DfuQ.d.ts → entitlementRepository-S4bU03Ld.d.ts} +9 -2
  42. package/dist/{entitlementRepository-CCIj0Z0c.d.cts → entitlementRepository-lwXYn-lq.d.cts} +9 -2
  43. package/dist/{identity-BMPu-Kg6.d.ts → identity-C0r18khM.d.ts} +1 -1
  44. package/dist/{identity-DkVFMcyL.d.cts → identity-d2lu16uc.d.cts} +1 -1
  45. package/dist/index.cjs +6 -6
  46. package/dist/index.d.cts +12 -12
  47. package/dist/index.d.ts +12 -12
  48. package/dist/index.js +6 -6
  49. package/dist/notifications/index.d.cts +2 -2
  50. package/dist/notifications/index.d.ts +2 -2
  51. package/dist/{pets-B6QnvZi2.d.cts → pets-BZ0384Do.d.cts} +1 -1
  52. package/dist/{pets-BCgVJlJD.d.ts → pets-CJdq4rRX.d.ts} +1 -1
  53. package/dist/{petsRepository-CwIyiIvt.d.cts → petsRepository-BHooDwb1.d.cts} +1 -1
  54. package/dist/{petsRepository-I9vZvRpE.d.ts → petsRepository-DE8scL1O.d.ts} +1 -1
  55. package/dist/{ports-D0DaSL3j.d.cts → ports-CcUYur16.d.cts} +4 -4
  56. package/dist/{ports-BtrM61nV.d.ts → ports-DWL3Nl3j.d.ts} +4 -4
  57. package/dist/records/depth/index.d.cts +7 -7
  58. package/dist/records/depth/index.d.ts +7 -7
  59. package/dist/records/index.d.cts +9 -9
  60. package/dist/records/index.d.ts +9 -9
  61. package/dist/{requestFunnel-C1Fp7waD.d.ts → requestFunnel-C5LPty-S.d.ts} +2 -2
  62. package/dist/{requestFunnel-CR8wGfpV.d.cts → requestFunnel-TtUvlQS1.d.cts} +2 -2
  63. package/dist/{runtimeTypes-BCXujmD6.d.cts → runtimeTypes-BbLoCs-9.d.cts} +12 -4
  64. package/dist/{runtimeTypes-CuwgMArF.d.ts → runtimeTypes-CiJ6Y_wP.d.ts} +12 -4
  65. package/dist/server/events/index.cjs +1 -1
  66. package/dist/server/events/index.d.cts +2 -2
  67. package/dist/server/events/index.d.ts +2 -2
  68. package/dist/server/events/index.js +1 -1
  69. package/dist/server/index.cjs +2 -2
  70. package/dist/server/index.d.cts +3 -3
  71. package/dist/server/index.d.ts +3 -3
  72. package/dist/server/index.js +2 -2
  73. package/dist/televet/booking/index.cjs +1 -1
  74. package/dist/televet/booking/index.d.cts +6 -6
  75. package/dist/televet/booking/index.d.ts +6 -6
  76. package/dist/televet/booking/index.js +1 -1
  77. package/dist/testing/index.d.cts +1 -1
  78. package/dist/testing/index.d.ts +1 -1
  79. package/dist/testing/rn/index.d.cts +7 -7
  80. package/dist/testing/rn/index.d.ts +7 -7
  81. package/dist/testing/web/index.d.cts +7 -7
  82. package/dist/testing/web/index.d.ts +7 -7
  83. package/dist/{timelineRows-EaAqBcX2.d.cts → timelineRows-BZ4YqN5G.d.cts} +1 -1
  84. package/dist/{timelineRows-DFmwWHyj.d.ts → timelineRows-Bv7nr5Oz.d.ts} +1 -1
  85. package/dist/{useRecordsDepth-DgQrho7p.d.cts → useRecordsDepth-BYVOh123.d.cts} +1 -1
  86. package/dist/{useRecordsDepth-Bo2d27fm.d.ts → useRecordsDepth-DuylsLXR.d.ts} +1 -1
  87. package/dist/{view-DwYhyFC2.d.cts → view-Cqtik97G.d.cts} +2 -2
  88. package/dist/{view-DGIjZtq8.d.ts → view-Uv0dWIQH.d.ts} +2 -2
  89. package/dist/web/consent/index.d.cts +5 -5
  90. package/dist/web/consent/index.d.ts +5 -5
  91. package/dist/web/index.cjs +7 -7
  92. package/dist/web/index.d.cts +14 -14
  93. package/dist/web/index.d.ts +14 -14
  94. package/dist/web/index.js +7 -7
  95. package/dist/web/notifications/index.d.cts +3 -3
  96. package/dist/web/notifications/index.d.ts +3 -3
  97. package/dist/web/records/depth/index.d.cts +7 -7
  98. package/dist/web/records/depth/index.d.ts +7 -7
  99. package/dist/web/records/index.d.cts +9 -9
  100. package/dist/web/records/index.d.ts +9 -9
  101. package/dist/web/televet/booking/index.cjs +2 -2
  102. package/dist/web/televet/booking/index.d.cts +6 -6
  103. package/dist/web/televet/booking/index.d.ts +6 -6
  104. package/dist/web/televet/booking/index.js +2 -2
  105. package/package.json +5 -4
@@ -1,2 +1,2 @@
1
- 'use strict';var react=require('react'),jsxRuntime=require('react/jsx-runtime');var fs=Object.defineProperty;var o=(e,t)=>fs(e,"name",{value:t,configurable:true});function rr(e){throw new Error(`assertNever: unhandled discriminated-union member ${JSON.stringify(e)}`)}o(rr,"assertNever");function li(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(li,"errorFrame");function Gr(e){let t=globalThis.console;try{t?.error?.("[everfur] A host callback threw; the SDK ignored it.",e);}catch{}}o(Gr,"reportHostFailure");function gs(e){return (typeof e=="object"||typeof e=="function")&&e!==null&&typeof e.then=="function"}o(gs,"isThenable");function nr(e,...t){if(typeof e=="function")try{let r=e(...t);return gs(r)&&Promise.resolve(r).then(void 0,Gr),r}catch(r){Gr(r);return}}o(nr,"callHost");var ai=new WeakMap;function vs(e){if(typeof e!="function")return;let t=ai.get(e);if(t!==void 0)return t;let r=o((...n)=>{nr(e,...n);},"guarded");return ai.set(e,r),r}o(vs,"guardHost");function dt(e,t){let r=null;for(let n of t){let a=e[n];typeof a=="function"&&(r??={...e},r[n]=vs(a));}return r??e}o(dt,"guardHostProps");function or(e,...t){let r;try{r=e(...t);}catch(n){return Gr(n),Promise.resolve({ok:false,error:n})}return Promise.resolve(r).then(n=>({ok:true,value:n}),n=>({ok:false,error:n}))}o(or,"callHostAsync");var g=o(e=>e,"DRAFT"),bs=["[PLACEHOLDER","[PLAN NAME]","[LINK]","[Last]","TODO","TBD"];function hs(e){return bs.some(t=>e.toUpperCase().includes(t.toUpperCase()))}o(hs,"isPlaceholderCopy");function Y(e,t){let r=e;for(let[n,a]of Object.entries(t))r=r.split(`{${n}}`).join(a);return r}o(Y,"fill");var ie=Object.freeze({stateBlockedTitle:g("Not available in this state yet"),noCliniciansTitle:g("No vets available right now"),noCliniciansBody:g("Nobody is free in your area at the moment. This changes through the day."),noCliniciansRetryCta:g("Check again"),noCliniciansRegionBody:g("Video visits have to be with a vet licensed in your state, and we don\u2019t have one there yet."),yourVetTitle:g("Your Vet"),reviewsLabel:g("reviews"),rescheduleFromTemplate:g("Moving your visit on {when}"),rescheduleFailed:g("That did not move. Your original time is unchanged."),keepExistingCta:g("Keep my current time"),bookingPausedTitle:g("Booking is not available right now."),slotsErrorTitle:g("Could not load times"),noSlotsTitle:g("No times available"),nextOpeningTemplate:g("Next opening across our vets: {when}"),seeOtherVetsCta:g("See other vets"),retryCta:g("Try again"),holdExpired:g("That time is no longer held. Pick another."),slotTaken:g("That time was just taken. Pick another."),reasonPlaceholder:g("What is going on with your pet?"),reasonTooLong:g("That is too long. Please shorten it."),shareRecordsOff:g("Share health records with this vet"),confirmNotEntitled:g("A Pro membership is needed to book a video visit."),confirmFailed:g("That did not book. Try again."),checkAvailabilityCta:g("Check availability"),stateInterest:Object.freeze({cta:g("Add me to the list"),submitting:g("Adding you to the list\u2026"),joinedTitle:g("You are on the list"),joinedBody:g("We will let you know when this changes."),failed:g("That did not save. Try again.")}),media:Object.freeze({droppedTemplate:g("{n} attachment did not upload."),droppedPluralTemplate:g("{n} attachments did not upload."),refusedSizeTemplate:g("{n} attachment was too large to send."),refusedSizePluralTemplate:g("{n} attachments were too large to send."),refusedTypeTemplate:g("{n} attachment is a file type that cannot be sent."),refusedTypePluralTemplate:g("{n} attachments are file types that cannot be sent."),refusedUnreadableTemplate:g("{n} attachment could not be read."),refusedUnreadablePluralTemplate:g("{n} attachments could not be read.")}),navTitle:g("Book a visit"),rescheduleNavTitle:g("Change your visit"),close:g("Close"),continueCta:g("Continue"),petSelectTitle:g("Who is this visit for?"),addPetCta:g("Add a pet"),locationUnknownTitle:g("We need your location to find a vet"),locationUnknownBody:g("Turn on location for Everfur, then try again."),locationUnknownCta:g("Allow location"),locationBlockedTitle:g("Location is turned off"),locationBlockedBody:g("Everfur needs your location to match you with a vet in your area."),locationBlockedCta:g("Open Settings"),locationUnavailableTitle:g("We could not read your location"),locationUnavailableBody:g("Try again in a moment."),stateAttestTemplate:g("I confirm my pet and I are in {state} right now."),describeHeading:g("Tell the vet what you are seeing"),describeHelpLong:g("A few sentences is plenty. When it started, what changed, anything you've already tried."),addPhotoCta:g("ADD PHOTO OR VIDEO"),removePhotoLabel:g("Remove photo"),summaryPet:g("Pet"),summaryVet:g("Vet"),summaryWhen:g("When"),summaryLength:g("Length"),summaryReason:g("Reason"),summaryLengthTemplate:g("{n} minutes"),confirmCta:g("Confirm visit"),bookedTitle:g("You are booked."),addToCalendarCta:g("Add to calendar"),doneCta:g("Done"),booked:Object.freeze({remindPromise:g("We will notify you 30 minutes before."),summaryPromise:g("{pet}'s summary goes to the vet ahead of the call."),joinPromise:g("Join right here in the app. No links to hunt for."),backToPet:g("Back to {pet}"),calendarAdded:g("Added to your calendar"),calendarFailedBody:g("That did not save to your calendar.")}),chrome:Object.freeze({closeHint:g("Closes without saving"),discardTitle:g("Leave without booking?"),discardBody:g("Your answers will not be saved."),discardConfirmCta:g("Leave"),discardKeepCta:g("Keep going"),noPetsTitle:g("No pets on this account"),loadFailedTitle:g("Could not load"),retryCta:g("Try again")}),emergency:Object.freeze({bannerTitle:g("This cannot wait for a scheduled call."),keepBookingCta:g("I have handled this, keep booking"),lede:g("What you are describing is the kind of thing vets want to see in person, now."),exitPrimaryVetTitle:g("Call {petName}'s primary vet"),exitFindErTitle:g("Find an emergency vet near you"),startCallHint:g("Starts a phone call")}),visit:Object.freeze({title:g("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 si(e=ie){return typeof e=="string"?[e]:typeof e!="object"||e===null?[]:Object.values(e).flatMap(t=>si(t))}o(si,"televetBookingCopyValues");function Ae(){return si().every(e=>e.trim().length>0&&!hs(e))}o(Ae,"isTelevetBookingCopyReady");var ut=Object.freeze({findEmergencyVet:"Find an emergency vet near you",poisonControl:"ASPCA Animal Poison Control",poisonControlDetail:"(888) 426-4435 \xB7 a fee may apply",poisonControlTel:"tel:+18884264435"}),y=Object.freeze({...ie,petSelectTitle:"Who is this visit for?",describeHeading:"Type to the vet what you're seeing",describeHelpLong:"Describe the issues your pet is experiencing",reasonPlaceholder:"She's been scratching her left ear a lot this week...",yourVetTitle:"Which vet would you like to see?",timeHeading:"Pick a date and time",reviewHeading:"Does this look right?",issuesHeadingTemplate:"Select {pet}\u2019s main issues",issuesHint:"Can select more than 1",otherIssue:"Other",bookedHeadingTemplate:"You're booked with {vet}",addToCalendarCta:"Add to Calendar",backLabel:"Back",emergency:Object.freeze({...ie.emergency,bannerTitle:"This can't wait for a scheduled call.",lede:"What you're describing is the kind of thing vets want to see in person, now. Please call one of these first.",ledeWithoutExits:ie.emergency.lede,keepBookingCta:"I've handled this, continue with booking",exitPrimaryVetTitle:"Call {petName}'s primary vet"})});var Jr=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(Jr.map(e=>e.wireCode));var Ss=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"}),ui=Object.freeze(Jr.map(e=>Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:Ss[e.wireCode]}))),Es=new Map(ui.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),Cs=Object.freeze(["http_envelope",...[...new Set(ui.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function ir(e,t){if(typeof e!="string")return;let r=e.trim().toUpperCase();if(r.length!==0)for(let n of [t??"http_envelope",...Cs]){let a=Es.get(n+r);if(a)return a}}o(ir,"contractErrorFor");function ks(e){return e.envelope==="sse_frame"?`/errors#sse-${e.wireCode}`:e.envelope==="oauth_error"?`/errors#oauth-${e.wireCode}`:`/errors#${e.wireCode}`}o(ks,"contractDocUrl");function ci(e){return null}o(ci,"publishedDocUrl");var xs=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 pi(e){return xs[e]}o(pi,"categoryFor");function fi(e){let t=ir(e);if(t)return t.normalized;let r=(e??"").trim().toUpperCase(),n=r.replace(/[^A-Z0-9]/g,"");if(n==="AUTHREJECTED")return "authRejected";if(r.startsWith("AUTH"))return "authExpired";switch(n){case "DAILYQUOTAEXCEEDED":case "QUOTAEXCEEDED":return "quotaExceeded";case "RATELIMITED":case "TOOMANYREQUESTS":case "TELEVETRATELIMITED":return "rateLimited";case "IDEMPOTENCYKEYCONFLICT":case "IDEMPOTENCYCONFLICT":return "idempotencyConflict";case "ACCESSDENIED":case "FORBIDDEN":return "accessDenied";case "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(fi,"fromWire");var Rs=new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function Xr(e){return Rs.has(e)}o(Xr,"isAutoRetryable");var _s=new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function yi(e){return Xr(e)||_s.has(e)}o(yi,"isRetryableCode");var Ps=500,Qr=8e3,mi=4;function gi(e,t=Math.random){let r=Math.max(0,e),n=Math.min(Ps*2**r,Qr);return Math.floor(t()*n)}o(gi,"backoffDelayMs");var ws=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 Zr(e){return ws[e]}o(Zr,"userFacingError");function vi(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:false,writable:false,configurable:false});}o(vi,"defineHidden");var Is=/^[a-z][a-z0-9_]{0,63}$/;function ue(e,t){let r=ir(t?.wireCode,t?.wireEnvelope),n={code:e,category:pi(e),retryable:t?.retryable??yi(e),displayMessage:Zr(e)};if(t?.httpStatus!==void 0&&(n.httpStatus=t.httpStatus),t?.requestId&&(n.requestId=t.requestId),typeof t?.reasonCode=="string"&&Is.test(t.reasonCode)&&(n.reasonCode=t.reasonCode),r);return t?.wireMessage&&vi(n,"wireMessage",t.wireMessage),t?.raw!==void 0&&t.raw!==null&&vi(n,"raw",t.raw),Object.freeze(n)}o(ue,"makeEverfurError");function F(e,t){return Object.freeze(t===void 0?{ok:true,value:e}:{ok:true,value:e,warning:t})}o(F,"ok");function w(e){return Object.freeze({ok:false,error:e})}o(w,"err");var lr=class lr extends Error{constructor(t,r){super(r),this.name="EverfurConfigError",this.kind=t,Object.setPrototypeOf(this,lr.prototype);}};o(lr,"EverfurConfigError");var _t=lr;function Os(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(Os,"authHeaders");function Pt(e,t){return {...e,headers:{...As(e.headers),...Os(t)}}}o(Pt,"withAuthHeaders");function As(e){if(!e)return {};let t={};for(let[r,n]of Object.entries(e)){let a=r.toLowerCase();a==="authorization"||a==="x-everfur-partner-key"||(t[r]=n);}return t}o(As,"stripAuthHeaders");async function bi(e,t){if(t.mode==="anonymous")return t.transport.request(Pt(e,{mode:"anonymous",publishableKey:t.publishableKey,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));let r;try{r=await t.identity.currentToken();}catch{return w(en())}let n=await t.transport.request(Pt(e,{mode:"personalized",token:r,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));if(n.ok||n.error.httpStatus!==401)return n;let a;try{a=await t.identity.currentToken({forceRefresh:!0});}catch{return w(en())}let l=await t.transport.request(Pt(e,{mode:"personalized",token:a,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));return !l.ok&&l.error.httpStatus===401?w(en(l.error.httpStatus)):l}o(bi,"authedSend");function en(e){return ue("authRejected",{retryable:false,...e!==void 0?{httpStatus:e}:{}})}o(en,"authRejectedError");function hi(e){return ue("internalError",{retryable:true,wireMessage:Bs(e)})}o(hi,"networkError");function Bs(e){return e instanceof Error?e.message:typeof e=="string"?e:"network request failed"}o(Bs,"describeCause");var tn=3e4,Ds=Qr*2,Ns="idempotency-key",Ls=new Set(["POST","PUT","PATCH","DELETE"]),Fs=Object.freeze({onEvent(){}}),Ms=Object.freeze({setTimeout:o((e,t)=>setTimeout(e,t),"setTimeout"),clearTimeout:o(e=>clearTimeout(e),"clearTimeout"),now:o(()=>Date.now(),"now")});function zs(e){let t=e.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return t.length===0?null:`efs_${t}`.slice(0,128)}o(zs,"seededIdempotencyKey");function wt(e){let t=e.observer??Fs,r=e.timers??Ms,n=e.rng??Math.random,a=e.sleep??((m,c)=>Qs(m,r,c)),l=e.maxAttempts??mi,s=e.unaryTimeoutMs??tn,i=e.newIdempotencyKey??rn(),d=o(m=>{try{t.onEvent(m);}catch{}},"emit");async function u(m,c,v){let S=v?.maxAttempts,b=Math.max(1,S??l),T=v?.idempotent??Ls.has(c.method),C=v?.idempotencyKey===void 0?null:zs(v.idempotencyKey),k=T?C??i():null,D=js(c,k),x=0;for(;;){let O=o(Z=>Object.freeze({call:m,method:c.method,path:c.path,attempt:x,...k?{idempotencyKey:k}:{},...Z}),"stamp");d(O({phase:"attempt"}));let z=Js(s,r),j=Xs(z.signal,c.signal),J;try{J=await bi({...D,signal:j.signal},e.auth);}catch(Z){J=w(hi(Z));}finally{j.dispose(),z.cancel();}if(J.ok)return d(O({phase:"settled",ok:true,reason:"ok"})),J;let N=J.error,X=Vs(N,x,{maxAttempts:b,rng:n,now:r.now(),aborted:c.signal?.aborted===true,...S!==void 0?{perCallMaxAttempts:S}:{},...e.errorPolicy!==void 0?{policy:e.errorPolicy}:{}}),W={ok:false,code:N.code,reason:X.reason,...N.httpStatus!==void 0?{httpStatus:N.httpStatus}:{},...N.requestId!==void 0?{requestId:N.requestId}:{}};if(!X.retry)return d(O({phase:"settled",...W})),w(N);if(d(O({phase:"retry",...W,delayMs:X.delayMs})),await a(X.delayMs,c.signal),c.signal?.aborted===true)return d(O({phase:"settled",...W,reason:"aborted"})),w(N);x+=1;}}o(u,"send");async function f(m){return Pt(m,await Gs(e.auth))}o(f,"authorize");async function*p(m,c,v){d(Object.freeze({call:m,phase:"stream.open",method:c.method,path:c.path,attempt:0}));try{yield*e.auth.transport.stream(c,v);}catch{yield li({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:null});}}return o(p,"stream"),Object.freeze({send:u,authorize:f,stream:p})}o(wt,"createRequestFunnel");function js(e,t){let r={};for(let[n,a]of Object.entries(e.headers??{}))n.toLowerCase()!==Ns&&(r[n]=a);return t!==null&&(r["Idempotency-Key"]=t),{...e,headers:r}}o(js,"assembleHeaders");function rn(){let e=0;return ()=>`efk_${Date.now().toString(36)}_${(e++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}o(rn,"defaultIdempotencyKeyFactory");var Hs=10;function Vs(e,t,r){if(r.aborted)return {retry:false,reason:"aborted"};let n=Us(e);if(n==="quota")return {retry:false,reason:"daily-quota-exhausted"};if(n!=="burst"&&!Xr(e.code))return {retry:false,reason:"terminal-code"};let a=n==="burst"?"burst-throttle":"retryable-code";if(o(()=>{if(r.policy===void 0)return false;try{return !r.policy.shouldRetry(e.code,t)}catch{return false}},"policyVetoedRetry")())return {retry:false,reason:"terminal-code"};let s=o(()=>{if(r.policy===void 0)return null;let u;try{u=r.policy.maxAttempts(e.code);}catch{return null}return typeof u!="number"||!Number.isFinite(u)?null:Math.max(1,Math.min(Hs,Math.floor(u)))},"policyCeiling"),i=r.perCallMaxAttempts??s()??r.maxAttempts;if(t+1>=i)return {retry:false,reason:"attempts-exhausted"};let d=Ws(e,r.now);return d!==null?d>Ds?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:a,delayMs:d}:{retry:true,reason:a,delayMs:gi(t,r.rng)}}o(Vs,"decideRetry");function Us(e){let t=e.code==="unknown"?fi(Ys(e.raw)):e.code;return t==="quotaExceeded"?"quota":t==="rateLimited"||e.httpStatus===429?"burst":null}o(Us,"throttleKind");function Ws(e,t){let r=Ks(e.raw);if(r!==null){let a=r-t;return a>0?a:0}let n=$s(e.raw);return n===null?null:Math.round(n*1e3)}o(Ws,"retryOverrideMs");function $s(e){for(let t of nn(e)){let r=t.retry_after_seconds;if(typeof r=="number"&&Number.isFinite(r)&&r>=0)return r}return null}o($s,"findRetryAfterSeconds");function Ks(e){for(let t of nn(e)){let r=t.resets_at,n=qs(r);if(n!==null)return n}return null}o(Ks,"findResetsAt");function nn(e){if(!Ti(e))return [];let t=[e];for(let r of ["error","detail"]){let n=e[r];Ti(n)&&t.push(n);}return t}o(nn,"candidateScopes");function qs(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(qs,"parseInstantMs");function Ys(e){for(let t of nn(e)){let r=t.code;if(typeof r=="string"&&r.length>0)return r}return null}o(Ys,"rawWireCode");function Ti(e){return typeof e=="object"&&e!==null}o(Ti,"isRecord");async function Gs(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(Gs,"resolveDeviceAuth");function Js(e,t){let r=new AbortController,n=t.setTimeout(()=>r.abort(),e);return {signal:r.signal,cancel:o(()=>t.clearTimeout(n),"cancel")}}o(Js,"boundedSignal");function Xs(e,t){let r=o(()=>{},"noop");if(!t)return {signal:e,dispose:r};let n=new AbortController;if(e.aborted||t.aborted)return n.abort(),{signal:n.signal,dispose:r};let a=o(()=>n.abort(),"onAbort");return e.addEventListener("abort",a,{once:true}),t.addEventListener("abort",a,{once:true}),{signal:n.signal,dispose:o(()=>{e.removeEventListener("abort",a),t.removeEventListener("abort",a);},"dispose")}}o(Xs,"mergeSignals");function Qs(e,t,r){return e<=0||r?.aborted===true?Promise.resolve():new Promise(n=>{let a=t.setTimeout(()=>{r?.removeEventListener("abort",l),n();},e),l=o(()=>{t.clearTimeout(a),n();},"onAbort");r?.addEventListener("abort",l,{once:true});})}o(Qs,"delayAbortable");var ki="televet_booking_not_live";function ar(e){return ue("conflict",{retryable:false,reasonCode:ki,wireMessage:`the booking was answered with a consult whose status is ${e}, which is not a live visit`})}o(ar,"televetBookingNotLiveError");var on="televet_booking_key_reused",Si="IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST";function sr(e){return e.httpStatus!==409||e.reasonCode===on||It(e)?.code!==Si?e:ue(e.code,{retryable:false,httpStatus:409,...e.requestId!==void 0?{requestId:e.requestId}:{},wireCode:Si,reasonCode:on,...e.wireMessage!==void 0?{wireMessage:e.wireMessage}:{},raw:e.raw})}o(sr,"foldTelevetBookingKeyReused");function It(e){let t=e.raw;if(typeof t!="object"||t===null)return null;let r=t,n=r.detail??r.error;return typeof n=="object"&&n!==null?n:r}o(It,"details");function Zs(e){let t=It(e)?.categories;return Array.isArray(t)?Object.freeze(t.filter(r=>typeof r=="string")):Object.freeze([])}o(Zs,"categoriesOf");function Ei(e){let t=It(e)?.retry_after_seconds;return typeof t=="number"&&Number.isFinite(t)&&t>0?t:null}o(Ei,"retryAfterOf");function Ci(e){let t=e.wireMessage;if(typeof t=="string"&&t.trim().length>0)return t.trim();let r=It(e)?.message;return typeof r=="string"&&r.trim().length>0?r.trim():null}o(Ci,"messageOf");function ed(e){let t=e.reasonCode;if(typeof t=="string"&&t.length>0)return t;let r=It(e),n=r?.code??r?.error_code;return typeof n=="string"&&n.length>0?n:null}o(ed,"codeOf");function ze(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:Ei(e),message:Ci(e)});if(t===404)return Object.freeze({kind:"unavailable"});switch(ed(e)){case "televet_rate_limited":return Object.freeze({kind:"rate_limited",retryAfterSeconds:Ei(e),message:Ci(e)});case "televet_emergency_ack_required":return Object.freeze({kind:"emergency",categories:Zs(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 ki:return Object.freeze({kind:"slot_taken"});case on: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(ze,"televetBookingRefusal");function td(e){try{return new URL(e.trim()).protocol==="https:"}catch{return false}}o(td,"isSafeRoomUrl");function rd(e,t){return td(e)&&t.trim().length>0}o(rd,"isUsableRoomCredential");function dr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(dr,"isRecord");function ln(e,t){return typeof e=="number"&&Number.isInteger(e)&&e>=t?e:null}o(ln,"wholeNumber");function nd(e){if(!dr(e))return null;let t=ln(e.consult_minutes,1),r=ln(e.auto_end_minutes,0),n=ln(e.warn_before_seconds,0);return t===null||r===null||n===null?null:Object.freeze({consultMinutes:t,autoEndMinutes:r,warnBeforeSeconds:n})}o(nd,"parseCallLimits");function an(e){if(!dr(e))return null;let t=e.room_url??e.url,r=e.token;if(typeof t!="string"||typeof r!="string"||!rd(t,r))return null;let n=e.recording_notice;return Object.freeze({roomUrl:t.trim(),token:r,recordingNotice:typeof n=="boolean"?n:true,callLimits:nd(e.call_limits)})}o(an,"parseVetCallCredential");function sn(e){let t=xi(e.raw);return t!==null&&t.length>0?t:null}o(sn,"vetCallJoinReason");function xi(e){if(!dr(e))return null;let t=e.detail??e.error,n=(dr(t)?t:e).reason;return typeof n=="string"?n:null}o(xi,"reasonOf");function dn(e){if(e.httpStatus===404)return "unavailable";let t=xi(e.raw);return t==="too_early"||t==="too_late"||t==="room_not_ready"?t:t!==null&&t.startsWith("status_")?"not_joinable":"unknown"}o(dn,"vetCallJoinRefusal");var _i=["scheduled","in_progress","awaiting_summary","completed","cancelled_owner","cancelled_ops","no_show_owner","no_show_vet"],ur=new Set(["completed","cancelled_owner","cancelled_ops","no_show_owner","no_show_vet"]),od=new Set(["scheduled","in_progress","awaiting_summary"]);function cr(e){return od.has(e.status)}o(cr,"isLiveConsult");var Pi=["wellness","prescription"],id=60;function cn(e){let t=Date.parse(e.startsAt),r=Date.parse(e.endsAt);if(Number.isNaN(t)||Number.isNaN(r))return null;let n=Math.round((r-t)/6e4);return n>0?Math.min(n,id):null}o(cn,"televetSlotMinutes");var pr=64,He=2e3,fr=10;function ke(e){return typeof e=="string"&&/^[A-Za-z]{2}$/.test(e.trim())}o(ke,"isWellFormedStateCode");function Be(e){return typeof e=="object"&&e!==null?e:null}o(Be,"row");function Q(e){return typeof e=="string"&&e.length>0?e:null}o(Q,"str");function je(e){return typeof e=="string"&&e.trim().length>0?e.trim():null}o(je,"trimmedOrNull");function ct(e,t){return typeof e=="boolean"?e:t}o(ct,"bool");function un(e){return typeof e=="number"&&Number.isFinite(e)?e:null}o(un,"num");function Ri(e,t){return typeof t=="string"&&e.includes(t)?t:"unknown"}o(Ri,"closed");function pt(e,t){if(!Array.isArray(e))return Object.freeze([]);let r=[];for(let n of e){let a=t(n);a!==null&&r.push(a);}return Object.freeze(r)}o(pt,"parseList");function wi(e,t){let r=Be(e);return r===null?null:Object.freeze({state:Q(r.state)??t,wellnessAvailable:ct(r.wellness_available,false),prescriptionsAvailable:ct(r.prescriptions_available,false),cancellationPolicyText:je(r.cancellation_policy_text)})}o(wi,"parseStatePolicy");function Ii(e){let t=Be(e);if(t===null)return null;let r=je(t.summary),n=je(t.version);return r===null||n===null?null:Object.freeze({summary:r,version:n})}o(Ii,"parseCancellationPolicy");function Oi(e){let t=Be(e);if(t===null)return null;let r=Q(t.clinician_id),n=Q(t.display_name);return r===null||n===null?null:Object.freeze({clinicianId:r,displayName:n,credentials:je(t.credentials_text),rating:un(t.rating),ratingCount:un(t.rating_count),bio:je(t.bio),photoRef:Q(t.photo_ref),licensedStates:pt(t.licensed_states,a=>{let l=Be(a),s=l===null?null:Q(l.state);return s===null?null:Object.freeze({state:s,canPrescribe:ct(l?.can_prescribe,false)})})})}o(Oi,"parseClinician");function pn(e){let t=Be(e);if(t===null)return null;let r=Q(t.slot_id),n=Q(t.starts_at);return r===null||n===null?null:Object.freeze({slotId:r,startsAt:n,endsAt:Q(t.ends_at)??n})}o(pn,"parseSlot");function Ai(e){let t=Be(e);if(t===null)return null;let r=Q(t.slot_id),n=Q(t.hold_expires_at);return r===null||n===null?null:Object.freeze({slotId:r,expiresAt:n})}o(Ai,"parseSlotHold");function Ot(e){let t=Be(e);if(t===null)return null;let r=Q(t.consult_id),n=Q(t.scheduled_at);return r===null||n===null?null:Object.freeze({consultId:r,petId:Q(t.pet_id)??"",clinicianId:Q(t.clinician_id)??"",clinicianName:je(t.display_name),reasonText:je(t.reason_text),mediaRefs:pt(t.media_refs,a=>Q(a)),status:Ri(_i,t.status),kind:Ri(Pi,t.kind),scheduledAt:n,emergencyFlagged:ct(t.emergency_flagged,false),hasRoom:Q(t.meeting_url)!==null})}o(Ot,"parseConsult");function Bi(e){let t=Be(e);return Object.freeze({active:ct(t?.active,false)})}o(Bi,"parseBookingEntitlement");var Ve=240;function Di(e){let t=Be(e);if(t===null)return null;let r=un(t.fee_cents);return r===null||r<0?null:Object.freeze({feeCents:r,currency:Q(t.currency)??"usd",feeRecorded:ct(t.fee_recorded,r>0),summary:je(t.summary)})}o(Di,"parseCancelReceipt");var Ue="/widget/v1/televet",ld=`${Ue}/state-policy`,ad=`${Ue}/vets`,Ni=`${Ue}/slots`,sd=`${Ue}/slots/next`,yr=`${Ue}/consults`,dd=`${Ue}/entitlement`,ud=`${Ue}/cancellation-policy`;function Li(e){return `${Ni}/${encodeURIComponent(e)}/hold`}o(Li,"televetHoldCall");function Fi(e){return `${yr}/${encodeURIComponent(e)}/reschedule`}o(Fi,"televetRescheduleCall");function mr(e){return `${yr}/${encodeURIComponent(e)}`}o(mr,"televetConsultCall");function Mi(e){return `${mr(e)}/join`}o(Mi,"televetJoinCall");function zi(e){return `${mr(e)}/cancel`}o(zi,"televetCancelCall");var ji=100;function ce(e){return w(ue("validationFailed",{retryable:false,wireMessage:e}))}o(ce,"invalid");function Xe(e){return w(ue("internalError",{retryable:false,httpStatus:502,wireMessage:e}))}o(Xe,"unusable");function fn(e){return e.httpStatus===404}o(fn,"isDark");function ft(e,t,r){try{e?.track(t,r);}catch{}}o(ft,"safeTrack");function Hi(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(!ke(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>He?`reason_text must be at most ${He} characters`:cd(e)}o(Hi,"validateBookingBody");function cd(e){let t=e.state_attested===true,r=e.cancellation_policy_version?.trim()??"";return t!==r.length>0?"state_attested and cancellation_policy_version must be sent together or omitted together":r.length>pr?`cancellation_policy_version must be at most ${pr} characters`:null}o(cd,"attestationRefusal");function mn(e){let t=e.funnel??wt({auth:e.auth,...e.errorPolicy?{errorPolicy:e.errorPolicy}:{}}),r=e.telemetry;return {async statePolicy(n,a){let l=n.trim();if(!ke(l))return ce("state must be a two-letter US state code");let s=await t.send("televet.booking.state_policy",{method:"GET",path:`${ld}/${encodeURIComponent(l)}`,...a?{signal:a}:{}});if(!s.ok)return w(s.error);let i=wi(s.value,l);return i===null?Xe("the state policy response was unreadable"):F(i)},async entitlement(n){let a=await t.send("televet.booking.entitlement",{method:"GET",path:dd,...n?{signal:n}:{}});return a.ok?F(Bi(a.value)):w(a.error)},async cancellationPolicy(n){let a=await t.send("televet.booking.cancellation_policy",{method:"GET",path:ud,...n?{signal:n}:{}});return a.ok?F(Ii(a.value)):F(null)},async clinicians(n,a){let l=n.trim();if(!ke(l))return ce("state must be a two-letter US state code");let s=await t.send("televet.booking.clinicians",{method:"GET",path:ad,query:{state:l},...a?{signal:a}:{}});return s.ok?F(pt(yn(s.value,"vets"),Oi)):fn(s.error)?F(Object.freeze([])):w(s.error)},async slots(n,a){let l=n.trim();if(l.length===0)return ce("clinicianId is required");let s=await t.send("televet.booking.slots",{method:"GET",path:Ni,query:{clinician_id:l},...a?{signal:a}:{}});return s.ok?F(pt(yn(s.value,"slots"),pn)):fn(s.error)?F(Object.freeze([])):w(s.error)},async nextSlot(n){let a=await t.send("televet.booking.next_slot",{method:"GET",path:sd,...n?{signal:n}:{}});return a.ok?F(pn(fd(a.value,"slot"))):F(null)},async holdSlot(n){let a=n.trim();if(a.length===0)return ce("slotId is required");let l=await t.send("televet.booking.hold",{method:"POST",path:Li(a)},{idempotent:false,maxAttempts:1});if(!l.ok)return ft(r,"televet.booking.hold_failed",{status:l.error.httpStatus??null}),w(l.error);let s=Ai(l.value);return s===null?Xe("the hold response carried no usable expiry"):F(s)},async book(n,a){let l=Hi(n);if(l!==null)return ce(l);let s=a.trim();if(s.length===0)return ce("idempotencyKey is required");let i=await t.send("televet.booking.book",{method:"POST",path:yr,body:pd(n)},{idempotent:true,idempotencyKey:s,maxAttempts:1});if(!i.ok)return ft(r,"televet.booking.book_failed",{status:i.error.httpStatus??null}),w(sr(i.error));let d=Ot(i.value);return d===null?Xe("the booking response was unreadable"):cr(d)?F(d):(ft(r,"televet.booking.book_failed",{status:null,consult_status:d.status}),w(ar(d.status)))},async reschedule(n,a){let l=n.trim(),s=a.trim();if(l.length===0)return ce("consultId is required");if(s.length===0)return ce("slotId is required");let i=await t.send("televet.booking.reschedule",{method:"POST",path:Fi(l),body:{new_slot_id:s}},{idempotent:false,maxAttempts:1});if(!i.ok)return ft(r,"televet.booking.reschedule_failed",{status:i.error.httpStatus??null}),w(i.error);let d=Ot(i.value);return d===null?Xe("the reschedule response was unreadable"):F(d)},async listConsults(n){let a=await t.send("televet.booking.consults",{method:"GET",path:yr,query:{limit:String(ji)},...n?{signal:n}:{}});return a.ok?F(pt(yn(a.value,"consults"),Ot)):fn(a.error)?F(Object.freeze([])):w(a.error)},async getConsult(n,a){let l=n.trim();if(l.length===0)return ce("consultId is required");let s=await t.send("televet.booking.consult",{method:"GET",path:mr(l),...a?{signal:a}:{}});if(!s.ok)return w(s.error);let i=Ot(s.value);return i===null?Xe("the consult response was unreadable"):F(i)},async joinConsult(n){let a=n.trim();if(a.length===0)return ce("consultId is required");let l=await t.send("televet.booking.join",{method:"POST",path:Mi(a)},{idempotent:false,maxAttempts:1});if(!l.ok)return ft(r,"televet.booking.join_failed",{status:l.error.httpStatus??null}),w(l.error);let s=an(l.value);return s===null?Xe("the join response carried no usable room credential"):F(s)},async cancelConsult(n,a){let l=n.trim(),s=a.trim();if(l.length===0)return ce("consultId is required");if(s.length===0)return ce("reason is required");if(s.length>Ve)return ce(`reason must be at most ${Ve} characters`);let i=await t.send("televet.booking.cancel",{method:"POST",path:zi(l),body:{reason:s}},{idempotent:false,maxAttempts:1});if(!i.ok)return ft(r,"televet.booking.cancel_failed",{status:i.error.httpStatus??null}),w(i.error);let d=Di(i.value);return d===null?Xe("the cancel response was unreadable"):F(d)}}}o(mn,"createTelevetBookingController");function pd(e){let t=e.cancellation_policy_version?.trim()??"",r=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,...r?{state_attested:true,cancellation_policy_version:t}:{}}}o(pd,"bookingWireBody");function yn(e,t){if(Array.isArray(e))return e;if(typeof e=="object"&&e!==null){let r=e,n=r[t]??r.items??r.data;if(Array.isArray(n))return n}return e}o(yn,"rows");function fd(e,t){if(typeof e=="object"&&e!==null&&!Array.isArray(e)){let r=e,n=r[t]??r.data;if(typeof n=="object"&&n!==null)return n}return e}o(fd,"unwrap");var Vi=Symbol.for("@everfur/sdk#EverfurContext@v1"),Ui=globalThis,Wi=Ui[Vi]??(Ui[Vi]=react.createContext(null));Wi.displayName??="EverfurContext";function Qe(){let e=react.useContext(Wi);if(e===null)throw new _t("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return e}o(Qe,"useEverfurContext");var gd=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 vd(e){return gd[e]}o(vd,"requires");function $i(e,t,r){let n=vd(e),a=new Map;for(let i of t)a.set(i.resource,i);if(r?.isPending===true&&n.some(i=>!a.has(i)))return gn({name:e,enabled:false,isPending:true,limits:{}});let l=bd(n,a);return n.filter(i=>a.get(i)?.granted!==true).length===0?gn({name:e,enabled:true,isPending:false,limits:l}):gn({name:e,enabled:false,isPending:false,limits:l,disabled:hd(n,a)})}o($i,"decideCapability");function bd(e,t){let r={};for(let n of e){let a=t.get(n)?.limits;if(a)for(let[l,s]of Object.entries(a)){let i=r[l];r[l]=i===void 0?s:Math.min(i,s);}}return r}o(bd,"mergeLimits");function hd(e,t){for(let r of e){let n=t.get(r)?.disabled;if(n)return Object.freeze({reason:n.reason,level:n.level,recoverable:n.recoverable})}return Object.freeze({reason:Zr("accessDenied"),level:"user_entitlement",recoverable:false})}o(hd,"disabledFor");function gn(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(gn,"freezeDecision");function At(e){let{runtime:t}=Qe(),r=t.entitlements,n=react.useSyncExternalStore(r.subscribe,r.getSnapshot,r.getSnapshot);return react.useMemo(()=>$i(e,n.decisions,{isPending:n.isPending}),[e,n])}o(At,"useCapability");function he(e){let{runtime:t,userRef:r,scopeEpoch:n}=Qe();return react.useMemo(()=>{if(e)return e;if(r===null)return null;let{services:a}=t.registry;return mn({auth:a.authFor(r),telemetry:a.telemetry,...a.errorPolicy?{errorPolicy:a.errorPolicy}:{}})},[t,r,n,e])}o(he,"useTelevetBookingController");function Ed(){let{userRef:e}=Qe(),t=At("televet");return react.useMemo(()=>({available:t.enabled&&e!==null,isPending:t.isPending}),[t.enabled,t.isPending,e])}o(Ed,"useTelevetBookingAvailable");function Ze(e,t,r){let[n,a]=react.useState(()=>({key:e,data:null,isPending:t&&r!==null,error:null})),[l,s]=react.useState(0),i=react.useRef(r);i.current=r,react.useEffect(()=>{let f=i.current;if(!t||f===null){a({key:e,data:null,isPending:false,error:null});return}let p=new AbortController,m=true;return a(c=>c.key===e?{...c,isPending:true,error:null}:{key:e,data:null,isPending:true,error:null}),(async()=>{let c;try{c=await f(p.signal);}catch{m&&a({key:e,data:null,isPending:false,error:null});return}m&&(c.ok?a({key:e,data:c.value,isPending:false,error:null}):a({key:e,data:null,isPending:false,error:c.error}));})(),()=>{m=false,p.abort();}},[e,t,l]);let d=react.useCallback(()=>s(f=>f+1),[]),u=n.key===e;return react.useMemo(()=>({enabled:t,data:u?n.data:null,isPending:t&&(!u||n.isPending),isError:u&&n.error!==null,error:u?n.error:null,refetch:d}),[t,u,n.data,n.isPending,n.error,d])}o(Ze,"useTelevetRead");function bn(e,t){let r=e?.trim()??"",n=t?.statePolicy!==void 0&&ke(r),a=t?.statePolicy;return Ze(`state-policy:${r}`,n,n&&a?l=>a.call(t,r,l):null)}o(bn,"useTelevetStatePolicy");function hn(e){let t=e?.entitlement!==void 0,r=e?.entitlement;return Ze("entitlement",t,t&&r?n=>r.call(e,n):null)}o(hn,"useTelevetBookingEntitlement");function Bt(e){let t=e?.cancellationPolicy!==void 0,r=e?.cancellationPolicy;return Ze("cancellation-policy",t,t&&r?n=>r.call(e,n):null)}o(Bt,"useTelevetCancellationPolicy");function Tn(e,t){let r=e?.trim()??"",n=t?.clinicians!==void 0&&ke(r),a=t?.clinicians;return Ze(`clinicians:${r}`,n,n&&a?l=>a.call(t,r,l):null)}o(Tn,"useTelevetClinicians");function Dt(e,t){let r=e?.trim()??"",n=t!==null&&r.length>0;return Ze(`slots:${r}`,n,n&&t?a=>t.slots(r,a):null)}o(Dt,"useTelevetSlots");function Sn(e){let t=e?.nextSlot!==void 0,r=e?.nextSlot;return Ze("next-slot",t,t&&r?n=>r.call(e,n):null)}o(Sn,"useTelevetNextSlot");function En(e){let[t,r]=react.useState(null),n=react.useRef(true),a=react.useRef(false),l=react.useRef(e);l.current=e,react.useEffect(()=>(n.current=true,()=>{n.current=false;}),[]);let s=react.useCallback((...i)=>{let d=l.current;if(d===null||a.current)return;let u=i[i.length-1],f=typeof u=="object"&&u!==null&&("onSuccess"in u||"onError"in u),p=f?u:void 0,m=f?i.slice(0,-1):i;a.current=true,r({variables:m[0]??null}),(async()=>{let c=null;try{c=await d(...m);}catch{c=null;}a.current=false,n.current&&r(null),c!==null&&(c.ok?p?.onSuccess?.(c.value):p?.onError?.(c.error));})();},[]);return react.useMemo(()=>({isPending:t!==null,variables:t?.variables??null,mutate:s}),[t,s])}o(En,"useTelevetWrite");function Nt(e){return En(e?t=>e.holdSlot(t):null)}o(Nt,"useTelevetHoldSlot");function Cn(e){return En(e?(t,r)=>e.book(t,r):null)}o(Cn,"useTelevetBookConsult");function kn(e,t){return En(t&&e?r=>t.reschedule(e,r):null)}o(kn,"useTelevetRescheduleConsult");function br(e,t=0){let r=e?.listConsults!==void 0,n=e?.listConsults;return Ze(`consults:${t}`,r,r&&n?a=>n.call(e,a):null)}o(br,"useTelevetConsults");function xn(e){return e.error!==null&&e.error.httpStatus===404}o(xn,"televetReadIsDark");var Rn=15,_n=250,Yi=new Set(["scheduled","in_progress"]);function et(e){let t=Date.parse(e.scheduledAt);return Number.isNaN(t)?null:t}o(et,"startsAtMs");function Pn(e){let t=et(e);return t===null?null:t-Rn*6e4}o(Pn,"televetJoinOpensAtMs");function wn(e,t){if(!Yi.has(e.status))return {joinable:false,reason:`status_${e.status}`};if(!e.hasRoom)return {joinable:false,reason:"room_not_ready"};let r=et(e);return r===null||t<r-Rn*6e4?{joinable:false,reason:"too_early"}:t>r+_n*6e4?{joinable:false,reason:"too_late"}:{joinable:true}}o(wn,"televetJoinDecision");function Lt(e,t){let r=[],n=[];for(let a of e){let l=et(a);(Yi.has(a.status)&&l!==null&&l+_n*6e4>t?r:n).push(a);}return r.sort((a,l)=>(et(a)??0)-(et(l)??0)),n.sort((a,l)=>(et(l)??0)-(et(a)??0)),Object.freeze({upcoming:Object.freeze(r),past:Object.freeze(n)})}o(Lt,"splitTelevetVisits");function In(e){return e==="scheduled"}o(In,"canManageTelevetVisit");function Gi(e){let t=br(e);return t.enabled?t.isPending?"pending":t.isError||Lt(t.data??[],Date.now()).upcoming.length>0?"visits":"booking":"booking"}o(Gi,"useTelevetLanding");var I=Object.freeze({bookCardTitle:"Book a video visit",bookCardCta:"Find a time",upcomingTitle:"Upcoming visits",pastTitle:"Past visits",emptyTitle:"No visits yet",emptyBody:"When you book a video visit, it will appear here.",loading:"Loading your visits\u2026",loadErrorTitle:"Could not load your visits",loadErrorBody:"Check your connection and try again.",retry:"Try again",joinCta:"Join visit",joining:"Joining\u2026",rescheduleCta:"Reschedule",cancelCta:"Cancel visit",cancelConfirmTitle:"Cancel this visit?",cancellationReasonLabel:"Why are you cancelling?",cancelConfirmCta:"Cancel visit",cancellingVisit:"Cancelling visit\u2026",cancelDismissCta:"Keep visit",cancelledTitle:"Visit cancelled",cancellationFeeRecorded:"A late cancellation fee was recorded for this visit.",cancellationFeeNotRecorded:"No late cancellation fee was recorded for this visit.",loadingCancellationTerms:"Loading cancellation terms\u2026",cancellationTermsUnavailable:"We could not confirm the current cancellation terms. Try again before continuing.",cancellationReasonMissing:"Tell us why you are cancelling.",cancellationReasonTooLong:o(e=>`Keep the reason to ${String(e)} characters or fewer.`,"cancellationReasonTooLong"),cancelTermsFirst:"We could not confirm the cancellation terms. Please try again before cancelling.",cancelFailed:"We could not cancel this visit. Refresh your visits to confirm its status before trying again."});function Ji(e){switch(e){case "scheduled":return "Scheduled";case "in_progress":return "In progress";case "awaiting_summary":return "Summary on its way";case "completed":return "Completed";case "cancelled_owner":return "Cancelled by you";case "cancelled_ops":return "Cancelled by Everfur";case "no_show_owner":return "Missed";case "no_show_vet":return "Vet couldn't attend";default:return null}}o(Ji,"televetVisitStatusWeb");function Xi(e,t){if(e==="too_early")return t?`This visit opens at ${t}. You can join from then.`:"This visit has not opened yet.";if(e==="too_late")return "This visit has ended.";if(e==="room_not_ready")return "We are still setting up the video room. Try again in a moment.";switch(e){case "status_cancelled_owner":return "You cancelled this visit.";case "status_cancelled_ops":return "This visit was cancelled. Please book another time.";case "status_no_show_owner":return "This visit was missed.";case "status_no_show_vet":return "The vet could not make this visit. Please book another time.";case "status_awaiting_summary":return "This visit has ended. Your summary is on its way.";case "status_completed":return "This visit has ended.";default:return "This visit cannot be joined right now."}}o(Xi,"televetJoinBlockWeb");var Bn=class Bn extends react.Component{constructor(){super(...arguments);this.state={failed:false,key:this.props.resetKey};}static getDerivedStateFromError(){return {failed:true}}static getDerivedStateFromProps(r,n){return Object.is(r.resetKey,n.key)?null:{failed:false,key:r.resetKey}}render(){return this.state.failed?this.props.fallback:this.props.children}};o(Bn,"HostRenderBoundary");var On=Bn;function kd({render:e}){return e()}o(kd,"RenderHost");function An({render:e,fallback:t,resetKey:r}){return react.createElement(On,{fallback:t,resetKey:r,children:react.createElement(kd,{render:e})})}o(An,"HostRender");function Ln(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let t of Object.keys(e))Ln(e[t]);}return e}o(Ln,"deepFreeze");var xd=Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3}),el={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},tl={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},Zi={nano:8,small:9,micro:10,tiny:11,caption:12,bodyTight:13,body:14,subtitle:16,heading:18,verdict:24},Rd={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},_d={regular:"400",medium:"500",bold:"700"},Pd={eyebrow:1,monoWide:.9,headerBrand:-0.42,tight:-0.35},wd=0,hr="System",Tr="monospace",Id=["content","heading","control","compact","badge"];function Od(e){let t={};for(let r of Id)t[r]=e;return t}o(Od,"authoredTierSizes");function rl(){return {family:hr,mono:Tr,fontUrl:null,families:{regular:hr,medium:hr,bold:hr,mono:Tr,monoMedium:Tr,monoBold:Tr},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:Zi,tierSizes:Od(Zi),lineHeight:Rd,weight:_d,letterSpacing:Pd,scale:1,maxScale:wd,scaleCaps:xd}}o(rl,"baseType");var nl={},Dn=Object.freeze({standard:Object.freeze([.2,0,0,1]),emphasized:Object.freeze([.2,.8,.2,1]),exit:Object.freeze([.4,0,1,1])});function Nn(e){return `cubic-bezier(${e.join(", ")})`}o(Nn,"cssCubicBezier");var ol={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:Nn(Dn.standard),emphasized:Nn(Dn.emphasized),exit:Nn(Dn.exit)},reducedMotion:false},Ad={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)"},il=Ln({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:Ad,space:el,radius:tl,type:rl(),motion:ol,slots:nl}),Bd={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)"};Ln({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:Bd,space:el,radius:tl,type:rl(),motion:ol,slots:nl});var ll=Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),al=globalThis,Fn=al[ll]??(al[ll]=react.createContext(il));Fn.displayName??="EverfurThemeContext";function _(){return react.useContext(Fn)}o(_,"useEverfurTheme");var sl=Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});var dl='system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',Ld="System";function Fd(e){let t=e.trim();return t.length===0||t===Ld?dl:`${ul(t)}, ${dl}`}o(Fd,"cssFontFamily");function Md(e){let t=e.trim();return t.length===0||t==="monospace"?"ui-monospace, Menlo, Consolas, monospace":`${ul(t)}, ui-monospace, Menlo, Consolas, monospace`}o(Md,"cssMonoFamily");function ul(e){return `"${e.replace(/[\\"]/g,"\\$&")}"`}o(ul,"quote");function h(e,t){let r=e.type,n=r.families[t];return {fontFamily:t==="mono"||t==="monoMedium"||t==="monoBold"?Md(n):Fd(n),fontWeight:r.namedFaces[t]?r.weight.regular:r.weight[sl[t]]}}o(h,"faceCss");var yt=Object.freeze({textAlign:"start"});var zd=48;function jd(e){return e.isPending?"pending":e.enabled?"enabled":"disabled"}o(jd,"selectView");function fl(e){let{capability:t,children:r,renderDisabled:n,renderPending:a,style:l,className:s}=e,i=At(t),d=react.useMemo(()=>jd(i),[i]);switch(d){case "enabled":return r;case "pending":return a?jsxRuntime.jsx(An,{render:a,fallback:jsxRuntime.jsx(cl,{capability:t,style:l,className:s})}):jsxRuntime.jsx(cl,{capability:t,style:l,className:s});case "disabled":return n?jsxRuntime.jsx(An,{render:()=>n(i),fallback:jsxRuntime.jsx(pl,{decision:i,style:l,className:s}),resetKey:i}):jsxRuntime.jsx(pl,{decision:i,style:l,className:s});default:return rr(d)}}o(fl,"CapabilityGate");function cl({capability:e,style:t,className:r}){let n=_(),a=react.useMemo(()=>yl(n),[n]);return jsxRuntime.jsx("div",{role:"status","aria-busy":"true","aria-label":`Loading ${e}`,className:r,style:{...a.offstate,...t},children:jsxRuntime.jsx("div",{style:a.skeletonBar})})}o(cl,"PendingSkeleton");function pl({decision:e,style:t,className:r}){let n=_(),a=react.useMemo(()=>yl(n),[n]),l=e.disabled?.reason??"";return jsxRuntime.jsx("div",{className:r,style:{...a.offstate,...t},children:l.length>0?jsxRuntime.jsx("p",{style:a.offstateText,children:l}):null})}o(pl,"OffState");function yl(e){let{color:t,space:r,radius:n,type:a}=e;return {offstate:{...yt,boxSizing:"border-box",minHeight:zd,display:"flex",flexDirection:"column",justifyContent:"center",padding:`${r.md}px ${r.lg}px`,backgroundColor:t.surfaceCream,borderRadius:n.md,border:`1px solid ${t.brandBorder}`},offstateText:{margin:0,...h(e,"regular"),fontSize:a.size.body,lineHeight:`${Math.round(a.size.body*a.lineHeight.normal)}px`,color:t.text.muted},skeletonBar:{height:r.md,borderRadius:n.xs,backgroundColor:t.brandSofter}}}o(yl,"makeStyles");function Sr(e){for(let t=0;t<e.length;t+=1){let r=e.charCodeAt(t);if(r>=55296&&r<=56319){let n=e.charCodeAt(t+1);if(!(n>=56320&&n<=57343))return true;t+=1;}else if(r>=56320&&r<=57343)return true}return false}o(Sr,"hasLoneSurrogate");function Er(e){return [...e].length}o(Er,"serverLength");var ml=Object.freeze({dog:"dog",canine:"dog",k9:"dog",puppy:"dog",cat:"cat",feline:"cat",kitten:"cat"});function gl(e){if(typeof e!="string")return null;let t=e.trim().toLowerCase();return Object.prototype.hasOwnProperty.call(ml,t)?ml[t]:null}o(gl,"canonicalPetSpecies");var vl=50,Hd=128,zn=120,bl=120,Vd=2e3,hl=120,Ud=80,El=new Set(["male","female","unknown"]),Cl=new Set(["day","month","year"]),kl=new Set(["low","medium","high","athletic"]),xl=new Set(["indoor","outdoor","both"]),Rl=new Set(["mild","moderate","severe"]),Wd=/^(\d{4})-(\d{2})-(\d{2})$/,_l=[["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"]],Pl=[["allergies","allergies"],["medications","medications"],["supplements","supplements"],["conditions","conditions"]];Object.freeze([..._l,...Pl].map(([e])=>e));function $d(e){let t=Wd.exec(e);if(t===null)return false;let[r,n,a]=[Number(t[1]),Number(t[2]),Number(t[3])],l=new Date(Date.UTC(r,n-1,a));return l.getUTCFullYear()===r&&l.getUTCMonth()===n-1&&l.getUTCDate()===a}o($d,"isRealDate");var Mt=o(e=>(t,r)=>typeof r=="string"&&e.has(r)?null:`${t} must be one of ${[...e].join(", ")}`,"oneOf"),Kd=o((e,t)=>typeof t=="boolean"?null:`${e} must be true or false`,"boolean"),kr=o((e,t)=>typeof t=="string"&&$d(t)?null:`${e} must be a real date written YYYY-MM-DD`,"date"),Re=o((e,t={})=>(r,n)=>{if(typeof n!="string")return `${r} must be a string`;if(Sr(n))return `${r} contains an unpaired surrogate and cannot be encoded`;let a=t.trimmed?n.trim():n;if(t.required&&a.length===0)return `${r} is required and must not be blank`;let l=Er(a);return l<=e?null:`${r} is ${l} characters; the server accepts at most ${e}`},"text"),qd={sex:Mt(El),spayedNeutered:Kd,birthDate:kr,birthDatePrecision:Mt(Cl),activityLevel:Mt(kl),indoorOutdoor:Mt(xl),foodBrand:Re(hl),foodType:Re(hl),microchipId:Re(Ud)},jn=["ref","ref",false,Re(Hd,{required:true,trimmed:true})],Hn=["notes","notes",false,Re(Vd,{trimmed:true})],Tl=[jn,["name","name",true,Re(zn,{required:true,trimmed:true})],["dose","dose",false,Re(bl,{trimmed:true})],["frequency","frequency",false,Re(bl,{trimmed:true})],["startDate","start_date",false,kr],["endDate","end_date",false,kr],Hn],Yd={allergies:[jn,["allergen","allergen",true,Re(zn,{required:true,trimmed:true})],["severity","severity",false,Mt(Rl)],Hn],medications:Tl,supplements:Tl,conditions:[jn,["conditionName","condition_name",true,Re(zn,{required:true,trimmed:true})],["diagnosedDate","diagnosed_date",false,kr],Hn]};function Gd(e,t,r){let n=`${e}[${t}]`;if(typeof r!="object"||r===null||Array.isArray(r))return {error:`${n} must be an object`};let a=r,l={};for(let[d,u,f,p]of Yd[e]){let m=a[d];if(m==null){if(f)return {error:`${n}.${d} is required`};m===null&&(l[u]=null);continue}let c=p(`${n}.${d}`,m);if(c!==null)return {error:c};l[u]=m;}let s=l.start_date,i=l.end_date;return typeof s=="string"&&typeof i=="string"&&i<s?{error:`${n}.endDate must not be before startDate`}:{item:l}}o(Gd,"itemToWire");function Jd(e,t){if(!Array.isArray(t))return {error:`${e} must be an array (send [] to clear it)`};if(t.length>vl)return {error:`${e} has ${t.length} items; the server accepts at most ${vl}`};let r=[],n=new Set;for(let a=0;a<t.length;a+=1){let l=Gd(e,a,t[a]);if("error"in l)return l;let s=l.item.ref;if(typeof s=="string"){let i=s.trim();if(n.has(i))return {error:`${e}: ref ${JSON.stringify(i)} is used twice; a ref names one item`};n.add(i);}r.push(l.item);}return {items:r}}o(Jd,"listToWire");function wl(e,t){let r=e,n={};for(let[s,i]of _l){let d=r[s];if(d!==void 0){if(d!==null){let u=qd[s](s,d);if(u!==null)return {error:u}}n[i]=d;}}let a=r.birthDate!==void 0,l=r.birthDatePrecision!==void 0;if(a!==l||a&&r.birthDate===null!=(r.birthDatePrecision===null))return {error:"birthDate and birthDatePrecision must be sent together, both set or both null"};for(let[s,i]of Pl){let d=r[s];if(d===void 0)continue;let u=Jd(s,d);if("error"in u)return u;n[i]=u.items;}return Object.keys(n).length>0&&t!==void 0&&gl(t)===null?{error:"health fields need a pet Everfur reads as a dog or a cat (dog, canine, k9, puppy, cat, feline, kitten)"}:{body:n}}o(wl,"petHealthToWire");var G=o(e=>typeof e=="string"?e:null,"str"),Ft=o((e,t)=>typeof t=="string"&&e.has(t)?t:null,"pick"),Xd=o(e=>typeof e=="boolean"?e:null,"bool");function Cr(e,t){return Array.isArray(e)?Object.freeze(e.flatMap(r=>{if(typeof r!="object"||r===null||Array.isArray(r))return [];let n=t(r);return n===null?[]:[n]})):Object.freeze([])}o(Cr,"itemsFromWire");function Sl(e){let t=G(e.name);return t===null||t.length===0?null:Object.freeze({ref:G(e.ref),name:t,dose:G(e.dose),frequency:G(e.frequency),startDate:G(e.start_date),endDate:G(e.end_date),notes:G(e.notes)})}o(Sl,"medicationFromWire");function Il(e){let t=e.profile_version;return Object.freeze({profileVersion:typeof t=="number"&&Number.isInteger(t)&&t>=0?t:0,sex:Ft(El,e.sex),spayedNeutered:Xd(e.spayed_neutered),birthDate:G(e.birth_date),birthDatePrecision:Ft(Cl,e.birth_date_precision),activityLevel:Ft(kl,e.activity_level),indoorOutdoor:Ft(xl,e.indoor_outdoor),foodBrand:G(e.food_brand),foodType:G(e.food_type),microchipId:G(e.microchip_id),allergies:Cr(e.allergies,r=>{let n=G(r.allergen);return n===null||n.length===0?null:Object.freeze({ref:G(r.ref),allergen:n,severity:Ft(Rl,r.severity),notes:G(r.notes)})}),medications:Cr(e.medications,Sl),supplements:Cr(e.supplements,Sl),conditions:Cr(e.conditions,r=>{let n=G(r.condition_name);return n===null||n.length===0?null:Object.freeze({ref:G(r.ref),conditionName:n,diagnosedDate:G(r.diagnosed_date),notes:G(r.notes)})})})}o(Il,"petHealthFromWire");var Bl=100,Dl=50,Nl=100,Ll=50,Fl=500,Qd=128,Zd=6e4;function Pe(e){return ue("validationFailed",{retryable:false,wireMessage:e})}o(Pe,"invalid");function tt(e,t,r){if(typeof t!="string")return Pe(`${e} must be a string`);let n=Er(t);return n<=r?null:Pe(`${e} is ${n} characters; the server accepts at most ${r}`)}o(tt,"checkString");function xr(e,t,r){return typeof t=="number"&&Number.isFinite(t)&&t>=0&&t<=r?null:Pe(`${e} must be a finite number between 0 and ${r}`)}o(xr,"outOfRange");function Ol(e,t){if(typeof e!="string")return Pe("pet_ref must be a string");if(e.trim().length===0)return Pe("pet_ref must not be blank");if(Sr(e))return Pe("pet_ref contains an unpaired surrogate and cannot be encoded");if(t!=null&&typeof t!="object")return Pe("profile must be an object");let r=[tt("pet_ref",e,Qd)];return t?.name!==void 0&&r.push(tt("name",t.name,Bl)),t?.species!==void 0&&r.push(tt("species",t.species,Dl)),t?.breed!==void 0&&r.push(tt("breed",t.breed,Nl)),t?.ageYears!==void 0&&r.push(xr("age_years",t.ageYears,Ll)),t?.weightKg!==void 0&&r.push(xr("weight_kg",t.weightKg,Fl)),r.find(n=>n!==null)??null}o(Ol,"validate");function Ml(e,t){let r=wl(e,t);return "error"in r?{error:Pe(r.error)}:r}o(Ml,"healthToWire");function eu(e){if(typeof e!="object"||e===null)return {error:Pe("patch must be an object")};let t=e,r=[["name","name",l=>tt("name",l,Bl)],["species","species",l=>tt("species",l,Dl)],["breed","breed",l=>tt("breed",l,Nl)],["ageYears","age_years",l=>xr("age_years",l,Ll)],["weightKg","weight_kg",l=>xr("weight_kg",l,Fl)]],n={};for(let[l,s,i]of r){let d=t[l];if(d!==void 0){if(d!==null){let u=i(d);if(u!==null)return {error:u}}n[s]=d;}}let a=Ml(t,t.species);return "error"in a?a:(Object.assign(n,a.body),Object.keys(n).length===0?{error:Pe("patch must change at least one field")}:{body:n})}o(eu,"patchToWire");function tu(e){if(e==null)return {body:{}};let t=Ml(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(tu,"toWire");var _e=o(e=>typeof e=="string"?e:null,"str"),Rr=o(e=>typeof e=="number"&&Number.isFinite(e)?e:null,"num");function Al(e,t){let r=typeof e=="object"&&e!==null?e:{};return Object.freeze({petRef:_e(r.pet_ref)??t,name:_e(r.name),species:_e(r.species),breed:_e(r.breed),ageYears:Rr(r.age_years),weightKg:Rr(r.weight_kg)})}o(Al,"fromWire");function zl(e){if(typeof e!="object"||e===null)return null;let t=e,r=_e(t.pet_ref);return r===null||r.length===0?null:Object.freeze({petId:_e(t.pet_id),petRef:r,name:_e(t.name),species:_e(t.species),breed:_e(t.breed),ageYears:Rr(t.age_years),weightKg:Rr(t.weight_kg),updatedAt:_e(t.updated_at)})}o(zl,"widgetPetFromWire");function ru(e){let t=zl(e);return t===null?null:Object.freeze({...t,...Il(e)})}o(ru,"widgetPetProfileFromWire");function nu(e){let t=Array.isArray(e)?e:typeof e=="object"&&e!==null&&Array.isArray(e.pets)?e.pets:[];return Object.freeze(t.flatMap(r=>{let n=zl(r);return n===null?[]:[n]}))}o(nu,"petListFromWire");function jl(e){return ou(wt({auth:e}),wt({auth:e,unaryTimeoutMs:Zd}))}o(jl,"createPetsRepository");function ou(e,t=e){let r=o((a,l)=>l?{...a,signal:l}:a,"withSignal"),n=o(a=>Ol(a,void 0)??`/widget/v1/pets/${encodeURIComponent(a)}`,"petPath");return {async list(a){let l=await e.send("pets.list",r({method:"GET",path:"/widget/v1/pets"},a?.signal));return l.ok?F(nu(l.value)):w(l.error)},async registerPet(a,l,s){let i=Ol(a,l);if(i!==null)return w(i);let d=tu(l);if("error"in d)return w(d.error);let f={method:"POST",path:`/widget/v1/pets/${encodeURIComponent(a)}`,body:d.body},p=await e.send("pets.registerPet",s?.signal?{...f,signal:s.signal}:f);return p.ok?F(Al(p.value,a)):w(p.error)},async updatePet(a,l,s){let i=n(a);if(typeof i!="string")return w(i);let d=eu(l);if("error"in d)return w(d.error);let u=await e.send("pets.updatePet",r({method:"PATCH",path:i,body:d.body},s?.signal));return u.ok?F(Al(u.value,a)):w(u.error)},async getPetProfile(a,l){let s=n(a);if(typeof s!="string")return w(s);let i=await e.send("pets.getPetProfile",r({method:"GET",path:`${s}/profile`},l?.signal));if(!i.ok)return w(i.error);let d=ru(i.value);return d===null?w(ue("internalError",{retryable:false,httpStatus:502,wireMessage:"the pet profile response carried no pet_ref"})):F(d)},async deletePet(a,l){let s=n(a);if(typeof s!="string")return w(s);let i=await e.send("pets.deletePet",r({method:"DELETE",path:s},l?.signal));return i.ok?F(void 0):w(i.error)},async eraseUserData(a){let l=await t.send("pets.eraseUserData",r({method:"DELETE",path:"/widget/v1/me"},a?.signal),{maxAttempts:1});return l.ok?F(void 0):w(l.error)}}}o(ou,"createPetsRepositoryOver");function _r(){let{runtime:e,userRef:t,activePet:r,scopeEpoch:n}=Qe(),a=react.useMemo(()=>jl(e.registry.services.authFor(t)),[e,t,n]),[l,s]=react.useState({repository:a,pets:[],loading:true,error:null}),i=l.repository===a?l:{pets:[],loading:true,error:null},d=react.useRef(0),u=react.useCallback(async()=>{let p=++d.current;s(c=>({...c,repository:a,loading:true,error:null,pets:c.repository===a?c.pets:[]}));let m=await a.list();p===d.current&&s(m.ok?{repository:a,pets:m.value,loading:false,error:null}:c=>({repository:a,pets:c.repository===a?c.pets:[],loading:false,error:m.error}));},[a]);react.useEffect(()=>(u(),()=>{d.current+=1;}),[u]);let f=react.useMemo(()=>r===null?null:i.pets.find(p=>p.petRef===r)??null,[r,i.pets]);return react.useMemo(()=>({pets:i.pets,activePet:f,loading:i.loading,error:i.error,refresh:u}),[i.pets,i.loading,i.error,f,u])}o(_r,"useEverfurPets");var zt=Object.freeze(["pet","issues","reason","clinician","time","review","booked"]),Hl=Object.freeze({petId:null,state:null,clinicianId:null,slot:null,holdExpiresAt:null,shareHealthRecords:false,idempotencyKey:null});function Wn(e,t={}){let r=Object.freeze({...Hl,...t}),n=Un(0,e);return Object.freeze({index:n,draft:r,furthestIndex:n})}o(Wn,"initialTelevetBookingState");function Pr(e,t){return e==="pet"?t.ownedPetCount<=1:e==="issues"?t.withIssues!==true:false}o(Pr,"isSkipped");function wr(e){return zt[e]}o(wr,"stepAt");function Un(e,t){for(let r=e;r<zt.length;r+=1){let n=wr(r);if(n&&!Pr(n,t))return r}return zt.length-1}o(Un,"nextVisible");function Vl(e,t){for(let r=e;r>=0;r-=1){let n=wr(r);if(n&&!Pr(n,t))return r}return null}o(Vl,"previousVisible");function $n(e,t){return Vl(e.index-1,t)!==null}o($n,"hasPreviousStep");function Kn(e,t,r){switch(t.type){case "patch":{let n={...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({...n,slot:null,holdExpiresAt:null,idempotencyKey:null})}):Object.freeze({...e,draft:Object.freeze(n)})}case "next":{let n=Un(e.index+1,r);return Object.freeze({...e,index:n,furthestIndex:Math.max(e.furthestIndex,n)})}case "back":{if(wr(e.index)==="booked")return e;let n=Vl(e.index-1,r);return n===null?e:Object.freeze({...e,index:n})}case "goTo":{let n=zt.indexOf(t.step);if(n<0)return e;let a=Pr(t.step,r)?Un(n,r):n;return Object.freeze({...e,index:a,furthestIndex:Math.max(e.furthestIndex,a)})}default:return e}}o(Kn,"televetBookingReducer");function qn(e){return wr(e.index)??"pet"}o(qn,"currentStep");function jt(e,t){let r=t.trim();return !!e.petId&&!!e.clinicianId&&!!e.slot&&ke(e.state)&&r.length>0&&r.length<=He}o(jt,"canConfirm");function Ir(e,t){if(!e.holdExpiresAt)return false;let r=Date.parse(e.holdExpiresAt);return Number.isNaN(r)?false:r<=t}o(Ir,"isHoldExpired");function Ul(e,t,r){return e.slot?.slotId!==t||e.holdExpiresAt===null||e.idempotencyKey===null?false:!Ir(e,r)}o(Ul,"holdsSlot");var Wl=Object.freeze({slot:null,holdExpiresAt:null,idempotencyKey:null}),du=rn();function Yn(e){return `televet.book.${du()}.${e}`}o(Yn,"televetBookingKey");function Gn(e,t,r){let n=r?.version?.trim()??"";return !e||!t||n.length===0?Object.freeze({}):Object.freeze({state_attested:true,cancellation_policy_version:n})}o(Gn,"attestation");var uu=Object.freeze([{id:"itchy-skin",label:"Itchy skin and allergies"},{id:"upset-stomach",label:"Upset stomach"},{id:"ear-infections",label:"Ear infections"},{id:"anxiety",label:"Anxiety and behavior"},{id:"parasites",label:"Fleas, ticks, and heartworm"},{id:"joint-pain",label:"Joint pain and mobility"},{id:"eye-issues",label:"Eye issues"},{id:"urinary",label:"Urinary issues"},{id:"surgery-aftercare",label:"Surgery aftercare"},{id:"senior-dog-care",label:"Senior dog care",species:"dog"}]),cu="other";function pu(e){let t=e?.trim().toLowerCase()??"";return t.startsWith("dog")?"dog":t.startsWith("cat")?"cat":null}o(pu,"televetIssueSpecies");function $l(e){let t=pu(e),r=uu.filter(n=>!n.species||n.species===t).map(({id:n,label:a})=>Object.freeze({id:n,label:a}));return Object.freeze([...r,Object.freeze({id:cu,label:y.otherIssue})])}o($l,"televetIssueChips");function Kl(e,t){let r=e.filter(a=>a.trim().length>0),n=t.trim();return r.length===0?n:n.length===0?r.join(", "):`${r.join(", ")}
2
- ${n}`}o(Kl,"composeTelevetReason");function De(e){let t=new Date(e);return Number.isNaN(t.getTime())?null:t}o(De,"parse");function mt(e){let t=De(e);return t?t.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"}):""}o(mt,"formatClock");function fu(e){let t=De(e);return t?t.toLocaleDateString(void 0,{month:"long",day:"numeric"}):""}o(fu,"formatDate");var rt=10;function gt(e){let t=De(e);return t?new Intl.DateTimeFormat(void 0,{timeZoneName:"short"}).formatToParts(t).find(n=>n.type==="timeZoneName")?.value??"":""}o(gt,"formatZone");function yu(e){let t=De(e);if(!t)return "";let r=new Date(t.getTime()+rt*6e4).toISOString(),n=gt(e),a=`${mt(e)} - ${mt(r)}`;return n&&n!==""?`${a} ${n}`:a}o(yu,"formatVisitRange");function ql(e){let t=fu(e),r=[mt(e),gt(e)].filter(Boolean).join(" ");return [t,r].filter(Boolean).join(", ")}o(ql,"formatWhen");function Te(e){let t=De(e);return t?[t.toLocaleDateString(void 0,{weekday:"short"}),ql(e)].filter(Boolean).join(", "):""}o(Te,"formatWhenWithDay");function Yl(e){let t=De(e);if(!t)return "";let r=t.toLocaleString(void 0,{weekday:"short",day:"numeric",month:"short",hour:"numeric",minute:"2-digit"}),n=gt(e);return n?`${r} ${n}`:r}o(Yl,"formatShortDateTimeWithZone");function Gl(e){return [mt(e),gt(e)].filter(Boolean).join(" ")}o(Gl,"formatClockWithZone");function Ht(e){let t=De(e);return t?`${t.getFullYear()}-${t.getMonth()+1}-${t.getDate()}`:"unknown"}o(Ht,"localDayKey");function Jl(e){let t=De(e);return t===null?"":t.toLocaleDateString(void 0,{month:"long"})}o(Jl,"formatMonthLabel");function Xl(e){let t=De(e);return t===null?"":t.toLocaleDateString(void 0,{weekday:"long",month:"long",day:"numeric"})}o(Xl,"formatFullDayLabel");function Zl(e){let{draft:t,reasonText:r,book:n,stateAttested:a,termsAttested:l,cancellationPolicy:s,triage:i,goTo:d,releaseSlot:u,setFailure:f,setEmergency:p,setBookedConsult:m,onBooked:c}=e,v=react.useCallback(b=>{if(!jt(t,r)||!t.idempotencyKey)return;if(Ir(t,Date.now())){f("expired"),d("time");return}let T=o(C=>{let k=ze(C);if(k.kind==="emergency"){p(k.categories);return}if(k.kind==="rate_limited"){f("rate_limited");return}f(k.kind==="not_entitled"?"not_entitled":k.kind==="slot_taken"?"taken":k.kind==="clinician_unavailable"?"clinician_unavailable":k.kind==="unavailable"?"unavailable":"failed"),k.kind==="slot_taken"&&(u(),d("time"));},"refuse");f(null),p(null),n.mutate({pet_id:t.petId,clinician_id:t.clinicianId,slot_id:t.slot.slotId,state:t.state,reason_text:r.trim(),species:null,media_refs:[],emergency_acknowledged:b||i.isAcknowledged(r),share_health_records:t.shareHealthRecords,...Gn(a,l,s)},t.idempotencyKey,{onSuccess:o(C=>{if(!cr(C)){T(ar(C.status));return}m(C),d("booked"),c?.(C);},"onSuccess"),onError:o(C=>T(sr(C)),"onError")});},[t,r,n,a,l,s,i,d,u,f,p,m,c]),S=react.useCallback(()=>v(false),[v]);return {submitBooking:v,confirm:S}}o(Zl,"useBookingSubmit");function gu(e){if(e.httpStatus===409)return Object.freeze({failure:"taken"});switch(ze(e).kind){case "slot_taken":return Object.freeze({failure:"taken"});case "rate_limited":return Object.freeze({failure:"rate_limited"});case "not_entitled":return Object.freeze({failure:"not_entitled"});case "unavailable":return Object.freeze({failure:"unavailable"});default:return Object.freeze({failure:"failed"})}}o(gu,"televetHoldFailure");function ea(e){let{draft:t,hold:r,dispatch:n,setFailure:a,refetchSlots:l}=e;return react.useCallback(s=>{if(a(null),Ul(t,s.slotId,Date.now())){n({type:"next"});return}r.mutate(s.slotId,{onSuccess:o(i=>{n({type:"patch",patch:{slot:s,holdExpiresAt:i.expiresAt,idempotencyKey:Yn(s.slotId)}}),n({type:"next"});},"onSuccess"),onError:o(i=>{let d=gu(i);a(d.failure),d.failure==="taken"&&l();},"onError")});},[t,r,n,a,l])}o(ea,"useSlotHold");function Jn(e){return Object.freeze(e==="dark"?{title:ie.noCliniciansTitle,message:ie.noCliniciansBody,retryLabel:ie.noCliniciansRetryCta,interestReason:null}:{title:ie.noCliniciansTitle,message:ie.noCliniciansRegionBody,retryLabel:null,interestReason:"no_licensed_vet"})}o(Jn,"televetEmptyRosterView");function Xn(e){return e?"roster":"dark"}o(Xn,"televetEmptyRosterCause");var Vt=Object.freeze({failed:0,refused:Object.freeze({size:0,type:0,unreadable:0})});function Qn(e){let{failed:t,refused:r}=e;return t<=0&&r.size<=0&&r.type<=0&&r.unreadable<=0}o(Qn,"isMediaShortfallEmpty");function Zn(e){let t=o(n=>Number.isFinite(n)&&n>0?Math.floor(n):0,"count"),r=ie.media;return [{n:t(e.failed),one:r.droppedTemplate,many:r.droppedPluralTemplate},{n:t(e.refused.size),one:r.refusedSizeTemplate,many:r.refusedSizePluralTemplate},{n:t(e.refused.type),one:r.refusedTypeTemplate,many:r.refusedTypePluralTemplate},{n:t(e.refused.unreadable),one:r.refusedUnreadableTemplate,many:r.refusedUnreadablePluralTemplate}].filter(n=>n.n>0).map(n=>Y(n.n===1?n.one:n.many,{n:String(n.n)}))}o(Zn,"televetMediaShortfallLines");function Or(e){let t=Number.isFinite(e)&&e>0?Math.floor(e):0;return t===0?Vt:Object.freeze({failed:t,refused:Vt.refused})}o(Or,"mediaShortfallFromUnsentPicks");function vu(e,t){let r=Or(t);return r.failed===0?e:Object.freeze({failed:e.failed+r.failed,refused:e.refused})}o(vu,"withUnsentPicks");function ro(e){let[t,r]=react.useState(false),[n,a]=react.useState(false),[l,s]=react.useState(null),i=react.useRef(null),d=react.useRef(null),u=react.useRef(true);react.useEffect(()=>(u.current=true,()=>{u.current=false,d.current?.abort(),d.current=null;}),[]);let f=react.useCallback(()=>{d.current?.abort(),d.current=null,u.current&&a(false);},[]),p=react.useCallback(async b=>{if(d.current!==null)return false;let T=b.trim();if(l!==null&&l===T||!e)return true;let C=i.current!==null&&i.current.reason===T?i.current.emergency:null;if(C===null){let k=new AbortController;d.current=k,a(true);try{let D=await e(T,k.signal);if(k.signal.aborted||!u.current)return !1;D===null?C=!1:(C=D.isEmergency||D.fallback,i.current=Object.freeze({reason:T,emergency:C}));}catch{if(k.signal.aborted||!u.current)return false;C=false;}finally{d.current===k&&(d.current=null,u.current&&a(false));}}return C===true?(r(true),false):true},[l,e]),m=react.useCallback(b=>{s(b.trim()),r(false);},[]),c=react.useCallback(()=>r(false),[]),v=react.useCallback(()=>{f(),i.current=null,s(null),r(false);},[f]),S=react.useCallback(b=>l!==null&&l===b.trim(),[l]);return {open:t,checking:n,check:p,acknowledge:m,close:c,cancel:f,reset:v,isAcknowledged:S}}o(ro,"useEarlyTriage");function Eu(e){let t=e?.trim().toUpperCase()??"";return /^[A-Z]{2}$/.test(t)?t:null}o(Eu,"normalizeStateCode");function no(e,t){let r=Eu(e),[n,a]=react.useState(()=>Object.freeze({})),l=react.useRef(0),s=react.useRef(null),i=react.useCallback(d=>{if(!t||r===null)return null;let u=`${r}:${d}`;s.current!==null&&s.current!==u&&(l.current+=1),s.current=u;let f=n[u]??"idle";return {joined:f==="joined",pending:f==="pending",failed:f==="failed",onPress:o(()=>{if(f==="pending"||f==="joined")return;let p=l.current+=1;a(m=>Object.freeze({...m,[u]:"pending"})),(async()=>{let m=false;try{m=await t(r,d);}catch{m=false;}l.current===p&&a(c=>Object.freeze({...c,[u]:m?"joined":"failed"}));})();},"onPress")}},[r,n,t]);return react.useMemo(()=>({actionFor:i}),[i])}o(no,"useStateInterest");var bt=2;function ra(e){return typeof e!="number"||!Number.isInteger(e)?bt:e<1?1:e>6?6:e}o(ra,"headingLevel");function Ut(e){return e>=6?6:e+1}o(Ut,"nextHeadingLevel");function le(e){return `h${String(e)}`}o(le,"headingTag");var xu=Ut(bt),oo=react.createContext(xu);function me(){return react.useContext(oo)}o(me,"useNestedHeadingLevel");function Ru(e,t){if(e===void 0)return {};let r={};return e.backgroundColor!==void 0&&(r.backgroundColor=e.backgroundColor),e.borderColor!==void 0&&(r.borderColor=e.borderColor,r.borderWidth=t??1),e.borderRadius!==void 0&&(r.borderRadius=e.borderRadius),r}o(Ru,"slotBox");function na(e){return e?.textColor===void 0?{}:{color:e.textColor}}o(na,"slotText");function oa(e,t){let r=Ru(e,t),n={};return r.backgroundColor!==void 0&&(n.backgroundColor=r.backgroundColor),r.borderColor!==void 0&&(n.border=`${r.borderWidth??1}px solid ${r.borderColor}`),r.borderRadius!==void 0&&(n.borderRadius=r.borderRadius),n}o(oa,"slotBoxCss");var ae=44;function L(){let e=_();return react.useMemo(()=>Pu(e),[e])}o(L,"useBookingStyles");function P({label:e,onPress:t,kind:r="primary",disabled:n=false,loading:a=false,fullWidth:l=true,accessibilityLabel:s,describedBy:i,testID:d,style:u}){let f=L(),p=n||a;return jsxRuntime.jsx("button",{type:"button",onClick:t,disabled:p,"aria-busy":a||void 0,...s&&s!==e?{"aria-label":s}:{},...i?{"aria-describedby":i}:{},"data-testid":d,style:{...f.button,...r==="primary"?f.buttonPrimary:r==="danger"?f.buttonDanger:f.buttonSecondary,...l?f.buttonFull:f.buttonAuto,...p?f.buttonDisabled:null,...u},children:e})}o(P,"TelevetButton");function K({title:e,message:t,actionLabel:r,onAction:n,testID:a}){let l=L(),s=le(me()),i=typeof r=="string"&&r.length>0&&typeof n=="function";return jsxRuntime.jsxs("div",{style:l.stateCard,"data-testid":a,children:[jsxRuntime.jsx(s,{style:l.stateTitle,children:e}),t?jsxRuntime.jsx("p",{style:l.stateMessage,children:t}):null,i?jsxRuntime.jsx(P,{label:r,onPress:n,kind:"secondary",fullWidth:false}):null]})}o(K,"TelevetStateCard");function ge({height:e,width:t="100%",testID:r}){let n=L();return jsxRuntime.jsx("span",{"aria-hidden":"true","data-testid":r,style:{...n.skeleton,height:e,width:t}})}o(ge,"TelevetSkeletonBlock");function q({message:e,assertive:t=false,testID:r,style:n}){let a=L();return jsxRuntime.jsx("p",{role:t?"alert":"status","data-testid":r,style:{...a.failure,...n},children:e})}o(q,"TelevetFailureLine");function Pu(e){let{color:t,space:r,radius:n,type:a,slots:l}=e,{size:s,lineHeight:i}=a,d=o(u=>`${String(u)}px`,"rem");return {screen:{...yt,display:"flex",flexDirection:"column",minHeight:0,flex:"1 1 auto",gap:d(r.md),paddingLeft:d(r.xl),paddingRight:d(r.xl),boxSizing:"border-box"},stepFill:{display:"flex",flexDirection:"column",flex:"1 1 auto",minHeight:0,gap:d(r.md)},list:{display:"flex",flexDirection:"column",gap:d(r.sm)},button:{minHeight:ae,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:d(r.sm),paddingLeft:d(r.xl),paddingRight:d(r.xl),paddingTop:d(r.sm),paddingBottom:d(r.sm),borderRadius:d(n.pill),borderStyle:"solid",borderWidth:0,cursor:"pointer",textAlign:"center",...h(e,"medium"),fontSize:d(s.body),lineHeight:String(i.snug),boxSizing:"border-box"},buttonFull:{alignSelf:"stretch",width:"100%"},buttonAuto:{alignSelf:"flex-start",minWidth:ae},buttonPrimary:{backgroundColor:t.primary,color:t.onPrimary,...oa(l.primaryButton),...na(l.primaryButton)},buttonSecondary:{borderWidth:1,borderColor:t.brandBorder,backgroundColor:"transparent",color:t.brand,...l.primaryButton?.borderRadius===void 0?null:{borderRadius:d(l.primaryButton.borderRadius)},...l.primaryButton?.borderColor===void 0?null:{borderColor:l.primaryButton.borderColor}},buttonDanger:{backgroundColor:t.danger,color:t.onPrimary},buttonDisabled:{opacity:.45,cursor:"not-allowed"},stateCard:{minHeight:140,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:d(r.sm),padding:d(r.lg),borderRadius:d(n.lg),borderStyle:"solid",borderWidth:1,borderColor:t.brandBorder,boxSizing:"border-box"},stateTitle:{margin:0,...h(e,"medium"),color:t.brand,fontSize:d(s.subtitle),lineHeight:String(i.snug)},stateMessage:{margin:0,...h(e,"regular"),color:t.text.metaCool,fontSize:d(s.body),lineHeight:String(i.normal)},skeleton:{display:"block",borderRadius:d(n.md),backgroundColor:t.skeleton,flexShrink:0},failure:{margin:0,...h(e,"regular"),color:t.danger,fontSize:d(s.caption),lineHeight:String(i.normal)},stepTitle:{margin:0,...h(e,"bold"),color:t.brand,fontSize:d(s.verdict),lineHeight:String(i.snug),textAlign:"center"},stepHelp:{margin:0,...h(e,"regular"),color:t.text.metaCool,fontSize:d(s.body),lineHeight:String(i.normal),textAlign:"center"},divider:{height:1,backgroundColor:t.brandBorder,flexShrink:0},scrollRoot:{display:"flex",flexDirection:"column",flex:"1 1 auto",minHeight:0},scrollBody:{flex:"1 1 auto",minHeight:0,overflowY:"auto",overscrollBehavior:"contain"},scrollFooter:{flexShrink:0,paddingTop:d(r.md),paddingBottom:d(r.lg)}}}o(Pu,"makeBookingStyles");function Br({petName:e,primaryVet:t,onFindEmergencyVet:r}){return r?true:t!=null&&(e?.trim()??"").length>0}o(Br,"hasTelevetEmergencyExit");function Wt({petName:e,primaryVet:t,onFindEmergencyVet:r,testIDPrefix:n}){let a=_(),l=react.useMemo(()=>Du(a),[a]),s=e?.trim()??"",i=`${react.useId()}-primary-vet-hint`;return jsxRuntime.jsxs("div",{style:l.exits,"data-testid":`${n}-exits`,children:[r?jsxRuntime.jsx("button",{type:"button",onClick:()=>{nr(r);},style:{...l.card,...l.cardButton},"data-testid":`${n}-find-vet`,children:jsxRuntime.jsx("span",{style:l.title,children:ut.findEmergencyVet})}):null,null,t!=null&&s.length>0?jsxRuntime.jsx(Au,{petName:s,vet:t,hintId:i,local:l,testIDPrefix:n}):null]})}o(Wt,"TelevetEmergencyExits");function Au({petName:e,vet:t,hintId:r,local:n,testIDPrefix:a}){let l=Y(y.emergency.exitPrimaryVetTitle,{petName:e}),s=t.detail?.trim()??"",i=jsxRuntime.jsxs("span",{style:n.text,children:[jsxRuntime.jsx("span",{style:n.title,children:l}),s.length>0?jsxRuntime.jsx("span",{style:n.detail,children:s}):null]});if(!t.dial)return jsxRuntime.jsx("div",{style:n.card,"data-testid":`${a}-primary-vet`,children:i});let d=t.dial;return jsxRuntime.jsxs("button",{type:"button",onClick:()=>{nr(d);},"aria-label":s.length>0?`${l}, ${s}`:l,"aria-describedby":r,style:{...n.card,...n.cardButton},"data-testid":`${a}-primary-vet-call`,children:[i,jsxRuntime.jsx("span",{id:r,style:Bu,children:y.emergency.startCallHint})]})}o(Au,"PrimaryVetCard");var Bu=Object.freeze({position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0});function Du(e){let{color:t,space:r,radius:n,type:a}=e,{size:l,lineHeight:s}=a;return {exits:{display:"flex",flexDirection:"column",gap:r.sm},card:{display:"flex",alignItems:"center",gap:r.sm,minHeight:ae,padding:r.lg,borderRadius:n.md,border:`1px solid ${t.brandBorder}`,background:t.surface,color:t.text.primary,textAlign:"start",textDecoration:"none",boxSizing:"border-box"},cardButton:{width:"100%",cursor:"pointer",font:"inherit",position:"relative"},text:{display:"flex",flexDirection:"column",gap:r.xs,flexShrink:1},title:{...h(e,"medium"),color:t.text.primary,fontSize:l.body,lineHeight:`${String(l.body*s.normal)}px`},detail:{...h(e,"regular"),color:t.text.metaCool,fontSize:l.caption,lineHeight:`${String(l.caption*s.normal)}px`}}}o(Du,"makeExitStyles");function la({petName:e,primaryVet:t,onFindEmergencyVet:r,onContinue:n}){let a=_(),l=L(),s=react.useMemo(()=>so(a),[a]),i=le(me()),d=Br({petName:e,primaryVet:t,onFindEmergencyVet:r})?y.emergency.lede:y.emergency.ledeWithoutExits;return jsxRuntime.jsxs("section",{role:"alert",style:{...l.stepFill,...s.emergencyPanel},"data-testid":"televet-early-emergency",children:[jsxRuntime.jsx(i,{style:s.emergencyTitle,children:y.emergency.bannerTitle}),jsxRuntime.jsx("p",{style:s.emergencyLede,children:d}),jsxRuntime.jsx(Wt,{petName:e,primaryVet:t,onFindEmergencyVet:r,testIDPrefix:"televet-early-emergency"}),jsxRuntime.jsx(P,{label:y.emergency.keepBookingCta,kind:"secondary",onPress:n,testID:"televet-early-emergency-continue"})]})}o(la,"TelevetEarlyEmergency");function lo({action:e,testIDPrefix:t}){let r=_(),n=react.useMemo(()=>so(r),[r]),a=le(me());return e===null?null:e.joined?jsxRuntime.jsxs("div",{role:"status","data-testid":`${t}-joined`,style:n.interestFeedback,children:[jsxRuntime.jsx(a,{style:n.interestJoinedTitle,children:y.stateInterest.joinedTitle}),jsxRuntime.jsx("p",{style:n.interestBody,children:y.stateInterest.joinedBody})]}):jsxRuntime.jsxs("div",{"data-testid":t,style:n.interestAction,children:[jsxRuntime.jsx(P,{label:e.pending?y.stateInterest.submitting:y.stateInterest.cta,kind:"secondary",loading:e.pending,disabled:e.pending,onPress:e.onPress,testID:`${t}-submit`}),e.failed?jsxRuntime.jsx(q,{message:y.stateInterest.failed,assertive:true,testID:`${t}-error`}):null]})}o(lo,"TelevetStateInterestAction");function aa({cause:e,onRetry:t,stateInterest:r=null}){let n=Jn(e);return jsxRuntime.jsxs("div",{"data-testid":"televet-clinicians-empty",children:[jsxRuntime.jsx(K,{title:n.title,message:n.message,...n.retryLabel!==null&&t?{actionLabel:n.retryLabel,onAction:t}:{}}),n.interestReason!==null?jsxRuntime.jsx(lo,{action:r??null,testIDPrefix:"televet-state-interest-no-licensed-vet"}):null]})}o(aa,"TelevetClinicianEmptyState");function Nu({onCheckAvailability:e}){return jsxRuntime.jsx(ao,{...e?{onCheckAvailability:e}:{}})}o(Nu,"TelevetEntitlementInterestState");function ao({onCheckAvailability:e,renderUnavailable:t}){let r=L();return jsxRuntime.jsxs("div",{"data-testid":"televet-booking-not-entitled",style:r.list,children:[t?t():jsxRuntime.jsx(K,{title:y.bookingPausedTitle}),e?jsxRuntime.jsx(P,{label:y.checkAvailabilityCta,kind:"secondary",onPress:e,testID:"televet-check-state-availability"}):null]})}o(ao,"EntitlementPausedState");function $t({shortfall:e,testIDPrefix:t}){let r=_(),n=react.useMemo(()=>so(r),[r]);if(Qn(e))return null;let a=Zn(e);return a.length===0?null:jsxRuntime.jsx("ul",{role:"status",style:n.mediaNotice,"data-testid":`${t}-media-notice`,children:a.map((l,s)=>jsxRuntime.jsx("li",{style:n.mediaLine,"data-testid":`${t}-media-line-${String(s)}`,children:l},l))})}o($t,"TelevetMediaDropNotice");function so(e){let{color:t,space:r,radius:n,type:a}=e,{size:l,lineHeight:s}=a;return {emergencyPanel:{display:"flex",flexDirection:"column",gap:r.sm,padding:r.lg,borderRadius:n.lg,border:`2px solid ${t.danger}`,background:t.surface},emergencyTitle:{...h(e,"medium"),margin:0,color:t.danger,fontSize:l.heading,lineHeight:`${String(l.heading*s.snug)}px`},emergencyLede:{...h(e,"regular"),margin:0,color:t.text.primary,fontSize:l.subtitle,lineHeight:`${String(l.subtitle*s.normal)}px`},interestAction:{display:"flex",flexDirection:"column",gap:r.sm,marginTop:r.sm},interestFeedback:{display:"flex",flexDirection:"column",gap:r.xs,marginTop:r.sm},interestJoinedTitle:{...h(e,"medium"),margin:0,color:t.brand,fontSize:l.body,lineHeight:`${String(l.body*s.snug)}px`},interestBody:{...h(e,"regular"),margin:0,color:t.text.metaCool,fontSize:l.body,lineHeight:`${String(l.body*s.normal)}px`},mediaNotice:{display:"flex",flexDirection:"column",gap:r.xs,margin:0,padding:0,listStyle:"none"},mediaLine:{...h(e,"regular"),color:t.text.metaCool,fontSize:l.caption,lineHeight:`${String(l.caption*s.normal)}px`}}}o(so,"makeEdgeStyles");function sa(e){let{surfaceUnavailable:t,notEntitled:r,policyBlocked:n,triageOpen:a,step:l}=e;return t||r&&l!=="clinician"||n?true:l==="reason"&&a}o(sa,"televetBookingGateApplies");function da({state:e,petName:t,primaryVet:r,onFindEmergencyVet:n,stateInterest:a=null,onCheckAvailability:l,onAcknowledgeEmergency:s,renderUnavailable:i}){let d=L(),{surfaceUnavailable:u,notEntitled:f,policyBlocked:p,triageOpen:m,step:c}=e;return u?jsxRuntime.jsx("div",{style:d.stepFill,"data-testid":"televet-booking-unavailable",children:i?i():jsxRuntime.jsx(K,{title:y.bookingPausedTitle})}):f&&c!=="clinician"?jsxRuntime.jsx(ao,{...l?{onCheckAvailability:l}:{},...i?{renderUnavailable:i}:{}}):p?jsxRuntime.jsxs("div",{"data-testid":"televet-booking-state-blocked",children:[jsxRuntime.jsx(K,{title:y.stateBlockedTitle}),jsxRuntime.jsx(lo,{action:a,testIDPrefix:"televet-state-interest-state-blocked"})]}):c==="reason"&&m?jsxRuntime.jsx(la,{...t!==void 0?{petName:t}:{},...r?{primaryVet:r}:{},onFindEmergencyVet:n,onContinue:s}):null}o(da,"TelevetBookingGate");function ua(e){return e.noState?true:e.isPending||e.isError?false:e.isEmpty||e.notEntitled}o(ua,"televetClinicianOutcomeApplies");function ca({state:e,cause:t,locationStatus:r,onRequestLocation:n,onRetry:a,stateInterest:l=null,renderUnavailable:s}){return e.noState?jsxRuntime.jsx("div",{"data-testid":"televet-booking-location-unknown",children:jsxRuntime.jsx(K,{title:r==="blocked"?y.locationBlockedTitle:r==="unavailable"?y.locationUnavailableTitle:y.locationUnknownTitle,message:r==="blocked"?y.locationBlockedBody:r==="unavailable"?y.locationUnavailableBody:y.locationUnknownBody,actionLabel:n&&r!=="blocked"?y.locationUnknownCta:void 0,onAction:r==="blocked"?void 0:n})}):e.isEmpty?jsxRuntime.jsx(aa,{cause:t,onRetry:a,stateInterest:l}):jsxRuntime.jsx(ao,{...s?{renderUnavailable:s}:{}})}o(ca,"TelevetClinicianOutcome");function pa(e){return `televet-consult-${e}`}o(pa,"televetConsultCalendarKey");function co({consult:e,petName:t,onDone:r,onAddToCalendar:n,canJoinInApp:a=false,lengthMinutes:l}){let s=_(),i=L(),d=react.useMemo(()=>zu(s),[s]),u=`${react.useId()}-booked-title`,f=le(me()),[p,m]=react.useState("idle"),c=o(async()=>{if(!n)return;m("saving");let S=new Date(e.scheduledAt);if(Number.isNaN(S.getTime())){m("failed");return}let b=typeof l=="number"&&Number.isFinite(l)&&l>0?l:rt,T=await or(n,{key:pa(e.consultId),title:y.visit.title,startDate:S,endDate:new Date(S.getTime()+b*6e4),alarmOffsetMinutes:-30});if(!T.ok){m("failed");return}m(T.value===true?"saved":T.value==="handed-off"?"idle":"failed");},"addToCalendar"),v=[y.booked.remindPromise,Y(y.booked.summaryPromise,{pet:t??""}),...a?[y.booked.joinPromise]:[]];return Ae()?jsxRuntime.jsxs("section",{style:d.screen,"aria-labelledby":u,"data-testid":"televet-booked",children:[jsxRuntime.jsx("div",{style:d.header,children:jsxRuntime.jsx(P,{label:y.doneCta,kind:"secondary",fullWidth:false,onPress:r,testID:"televet-booked-done"})}),jsxRuntime.jsx("div",{"aria-hidden":"true",style:d.avatar}),jsxRuntime.jsx(f,{id:u,style:d.title,children:e.clinicianName?Y(y.bookedHeadingTemplate,{vet:e.clinicianName}):y.bookedTitle}),jsxRuntime.jsx("p",{style:d.when,children:jsxRuntime.jsx("time",{dateTime:e.scheduledAt,children:Te(e.scheduledAt)})}),jsxRuntime.jsx("ol",{style:d.steps,"data-testid":"televet-booked-steps",children:v.map((S,b)=>jsxRuntime.jsxs("li",{style:d.step,children:[jsxRuntime.jsx("span",{"aria-hidden":"true",style:d.stepNumber,children:String(b+1)}),jsxRuntime.jsx("span",{style:d.stepText,children:S.trim()})]},S))}),jsxRuntime.jsxs("div",{style:d.actions,children:[n?jsxRuntime.jsx(P,{label:p==="saved"?y.booked.calendarAdded:y.addToCalendarCta,kind:"primary",loading:p==="saving",disabled:p==="saving"||p==="saved",onPress:()=>{c();},testID:"televet-booked-calendar"}):null,p==="failed"?jsxRuntime.jsx("p",{role:"status",style:{...i.failure,...d.calendarNote},"data-testid":"televet-booked-calendar-failed",children:y.booked.calendarFailedBody}):null,jsxRuntime.jsx(P,{label:t?Y(y.booked.backToPet,{pet:t}):y.doneCta,kind:"secondary",onPress:r,testID:"televet-booked-back"})]})]}):jsxRuntime.jsx("div",{style:d.screen,"data-testid":"televet-booked-copy-unapproved"})}o(co,"TelevetBookedScreen");function zu(e){let{color:t,space:r,radius:n,type:a}=e,{size:l,lineHeight:s}=a,i=o(d=>`${String(d)}px`,"rem");return {screen:{display:"flex",flexDirection:"column",flex:"1 1 auto",minHeight:0,gap:i(r.md),paddingLeft:i(r.xl),paddingRight:i(r.xl),boxSizing:"border-box"},header:{display:"flex",justifyContent:"flex-end",paddingBottom:i(r.lg)},avatar:{alignSelf:"center",width:120,height:120,flexShrink:0,borderRadius:"50%",backgroundColor:t.surfaceSubtle,borderStyle:"solid",borderWidth:2,borderColor:t.success,boxSizing:"border-box"},title:{margin:0,textAlign:"center",...h(e,"bold"),color:t.brand,fontSize:i(l.verdict),lineHeight:String(s.tight),letterSpacing:"-0.7px",paddingTop:i(r.lg)},when:{margin:0,textAlign:"center",...h(e,"regular"),color:t.text.metaCool,fontSize:i(l.subtitle),lineHeight:String(s.normal)},steps:{listStyle:"none",margin:0,marginTop:i(r.xl),padding:i(r.lg),borderRadius:i(n.lg),borderStyle:"solid",borderWidth:1,borderColor:t.brandBorder,display:"flex",flexDirection:"column",gap:i(r.lg),boxSizing:"border-box"},step:{display:"flex",flexDirection:"row",alignItems:"flex-start",gap:i(r.md)},stepNumber:{width:26,height:26,flexShrink:0,borderRadius:"50%",backgroundColor:t.primary,display:"inline-flex",alignItems:"center",justifyContent:"center",...h(e,"medium"),color:t.onPrimary,fontSize:i(l.caption),lineHeight:"1"},stepText:{flex:"1 1 auto",minWidth:0,...h(e,"regular"),color:t.brand,fontSize:i(l.body),lineHeight:String(s.normal)},actions:{marginTop:"auto",paddingBottom:i(r.xl),display:"flex",flexDirection:"column",gap:i(r.md)},calendarNote:{textAlign:"center"}}}o(zu,"makeStyles");function fa(){let e=[];return {register(t){return e=[...e,t],()=>{e=e.filter(r=>r!==t);}},dispatch(){for(let t of [...e].reverse())try{if(t())return !0}catch{}return false}}}o(fa,"createTelevetBackChannel");var po=react.createContext(null);function Kt(e,t=true){let r=react.useContext(po),n=react.useRef(e);n.current=e,react.useEffect(()=>{if(!(r===null||!t))return r.register(()=>n.current())},[r,t]);}o(Kt,"useTelevetBackChannel");var St=Object.freeze({position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0});var ya='button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])';function mo(e){return e.tagName==="DIALOG"}o(mo,"isDialogElement");function Wu(e,t){if(t.isDefaultPrevented()||t.nativeEvent.isComposing)return false;let r=t.target;return !(r instanceof Element)||r.closest("dialog")===e}o(Wu,"ownsEscape");function Nr(e,t,r,n){let a=n?.escapeAtKeyDown===true,l=react.useRef(null),s=react.useRef(false),i=react.useRef(null),d=react.useRef(r);d.current=r;let u=react.useCallback(()=>{if(!s.current)return;s.current=false;let m=d.current===void 0?i.current:d.current.current;m&&m.isConnected&&m.focus(),(!m||!m.isConnected||document.activeElement===m)&&(i.current=null);},[]);react.useEffect(()=>{if(!e){u();return}let m=l.current;if(!s.current){let v=typeof document>"u"?null:document.activeElement;v!==null&&m!==null&&m.contains(v)||(i.current=v instanceof HTMLElement?v:null);}if(s.current=true,m===null)return;if(!mo(m)){m.contains(document.activeElement)||(m.querySelector(ya)??m).focus();return}let c=m;typeof c.showModal=="function"?c.open||c.showModal():c.setAttribute("open","");},[e,u]),react.useEffect(()=>u,[u]),react.useEffect(()=>{let m=l.current;if(!e||m===null||!mo(m))return;let c=m;if(typeof c.showModal!="function")return;let v=null,S=o(T=>{T.target instanceof HTMLElement&&(v=T.target);},"onFocusIn"),b=o(()=>{if(!c.isConnected||c.open)return;let T=v;c.showModal(),T!==null&&T.isConnected&&c.contains(T)&&document.activeElement!==T&&T.focus();},"onNativeClose");return c.addEventListener("focusin",S),c.addEventListener("close",b),()=>{c.removeEventListener("focusin",S),c.removeEventListener("close",b);}},[e]);let f=react.useCallback(m=>{let c=l.current;if(c===null)return;if(m.key==="Escape"&&!mo(c)){m.preventDefault(),m.stopPropagation(),t();return}if(m.key==="Escape"&&a&&Wu(c,m)){m.preventDefault(),t();return}if(m.key!=="Tab")return;let v=Array.from(c.querySelectorAll(ya)),S=v[0],b=v[v.length-1];if(!S||!b){m.preventDefault();return}let T=document.activeElement;m.shiftKey&&(T===S||!c.contains(T))?(m.preventDefault(),b.focus()):!m.shiftKey&&(T===b||!c.contains(T))&&(m.preventDefault(),S.focus());},[t,a]),p=react.useCallback(m=>{m.target===m.currentTarget&&(m.preventDefault(),t());},[t]);return {dialogRef:l,onKeyDown:f,onCancel:p}}o(Nr,"useModalDialog");var go=["pet","issues","reason","triage","clinician","time","review","booked"];function vo({step:e,furthestIndex:t,title:r,canGoBack:n,isDirty:a,onBack:l,onClose:s,onConfirmDiscard:i,headingLevel:d=bt,triageOpen:u=false}){let f=_(),p=react.useMemo(()=>va(f),[f]),[m,c]=react.useState(false),v=react.useRef(null),b=`${react.useId()}-close-hint`,T=le(d);react.useEffect(()=>{if(!a||typeof window>"u")return;let x=o(O=>{O.preventDefault(),O.returnValue="";},"onBeforeUnload");return window.addEventListener("beforeunload",x),()=>window.removeEventListener("beforeunload",x)},[a]);let C=react.useCallback(()=>{if(!a){s();return}let x={title:y.chrome.discardTitle,body:y.chrome.discardBody,confirmLabel:y.chrome.discardConfirmCta,keepLabel:y.chrome.discardKeepCta};if(i){Promise.resolve(i(x)).then(O=>{O&&s();},()=>{});return}c(true);},[a,s,i]);Kt(()=>(C(),true));let k=go.length,D=go.indexOf(e==="reason"&&u?"triage":e)+1;return jsxRuntime.jsxs("div",{style:p.wrap,children:[jsxRuntime.jsxs("header",{style:p.bar,children:[jsxRuntime.jsx("div",{style:p.side,children:n?jsxRuntime.jsx("button",{type:"button",onClick:l,"data-testid":"televet-booking-back",style:{...p.tap,...p.back},children:y.backLabel}):null}),jsxRuntime.jsx(T,{style:St,children:r??y.navTitle}),jsxRuntime.jsxs("div",{style:p.progress,children:[jsxRuntime.jsx("p",{style:St,"data-testid":"televet-booking-progress-label",children:Y(y.loading.progressTemplate,{step:String(D),total:String(k)})}),jsxRuntime.jsx("div",{"aria-hidden":"true",style:p.segments,"data-testid":"televet-booking-rail",children:go.map((x,O)=>jsxRuntime.jsx("span",{"data-lit":O<D?"true":"false",style:{...p.segment,...O<D?p.segmentLit:null}},x))})]}),jsxRuntime.jsxs("div",{style:{...p.side,...p.sideRight},children:[jsxRuntime.jsx("button",{type:"button",ref:v,onClick:C,"aria-label":y.close,"aria-describedby":b,"data-testid":"televet-booking-close",style:{...p.tap,...p.closeTap},children:jsxRuntime.jsx("svg",{"aria-hidden":"true",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",children:jsxRuntime.jsx("path",{d:"M18 6 6 18M6 6l12 12"})})}),jsxRuntime.jsx("span",{id:b,style:St,children:y.chrome.closeHint})]})]}),m?jsxRuntime.jsx(Gu,{onKeep:()=>c(false),onLeave:()=>{c(false),s();},returnFocusTo:v}):null]})}o(vo,"TelevetBookingChrome");function Gu({onKeep:e,onLeave:t,returnFocusTo:r}){let n=_(),a=react.useMemo(()=>va(n),[n]),{dialogRef:l,onKeyDown:s,onCancel:i}=Nr(true,e,r),d=react.useId(),u=`${d}-discard-title`,f=`${d}-discard-body`;return jsxRuntime.jsxs("dialog",{ref:l,onKeyDown:s,onCancel:i,"aria-labelledby":u,"aria-describedby":f,"data-testid":"televet-booking-discard",style:a.dialog,children:[jsxRuntime.jsx("h2",{id:u,style:a.dialogTitle,children:y.chrome.discardTitle}),jsxRuntime.jsx("p",{id:f,style:a.dialogBody,children:y.chrome.discardBody}),jsxRuntime.jsxs("div",{style:a.dialogActions,children:[jsxRuntime.jsx(P,{label:y.chrome.discardKeepCta,onPress:e,kind:"primary",fullWidth:false,testID:"televet-booking-discard-keep"}),jsxRuntime.jsx(P,{label:y.chrome.discardConfirmCta,onPress:t,kind:"secondary",fullWidth:false,testID:"televet-booking-discard-leave"})]})]})}o(Gu,"DiscardDialog");var Ju="Back";function va(e){let{color:t,space:r,radius:n,type:a}=e,{size:l,lineHeight:s}=a,i=o(u=>`${String(u)}px`,"rem"),d={background:"transparent",borderStyle:"none",padding:0,cursor:"pointer"};return {wrap:{backgroundColor:t.surface,flexShrink:0},bar:{display:"flex",flexDirection:"row",alignItems:"center",paddingLeft:i(r.lg),paddingRight:i(r.lg),minHeight:56,boxSizing:"border-box"},side:{width:64,flexShrink:0,display:"flex",alignItems:"center"},sideRight:{justifyContent:"flex-end"},tap:{...d,minHeight:ae,minWidth:ae,display:"inline-flex",alignItems:"center",justifyContent:"center"},closeTap:{justifyContent:"flex-end",color:t.text.primary},back:{...h(e,"bold"),color:t.brand,fontSize:i(l.body),paddingLeft:i(r.sm),paddingRight:i(r.sm)},progress:{flex:"1 1 auto",minWidth:0,display:"flex",justifyContent:"center"},segments:{display:"flex",alignItems:"center",gap:i(r.xs),width:"100%",maxWidth:480},segment:{display:"block",flex:"1 1 0",height:3,borderRadius:i(n.pill),backgroundColor:t.brandBorder},segmentLit:{backgroundColor:t.success},dialog:{margin:"auto",maxWidth:420,width:"calc(100% - 32px)",boxSizing:"border-box",padding:i(r.lg),borderRadius:i(n.lg),borderStyle:"solid",borderWidth:1,borderColor:t.brandBorder,backgroundColor:t.surface,color:t.text.primary},dialogTitle:{margin:0,...h(e,"medium"),color:t.brand,fontSize:i(l.subtitle),lineHeight:String(s.snug)},dialogBody:{margin:0,paddingTop:i(r.sm),...h(e,"regular"),color:t.text.metaCool,fontSize:i(l.body),lineHeight:String(s.normal)},dialogActions:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:i(r.sm),paddingTop:i(r.lg)}}}o(va,"makeStyles");function ba(e){let t=[],r=Xu(e.ageYears);r!==null&&t.push(`${String(r)} yr${r===1?"":"s"} old`);let n=e.weightKg;typeof n=="number"&&Number.isFinite(n)&&n>0&&t.push(`${String(Math.round(n))} kg`);let a=e.breed?.trim();return a&&t.push(a),t.join(" \xB7 ")}o(ba,"formatTelevetPetMetaLine");function Xu(e){if(typeof e!="number"||!Number.isFinite(e))return null;let t=Math.floor(e);return t>=0?t:null}o(Xu,"wholeYears");function bo({media:e,onChange:t,onPickMedia:r,listLabel:n}){let a=_(),l=react.useMemo(()=>rc(a),[a]),s=fr-e.length,[i,d]=react.useState(false);if(!r)return null;let u=o(async()=>{if(!(i||s<=0)){d(true);try{let f=await or(r,s);if(!f.ok||f.value===null||f.value.length===0)return;let p=new Set(e.map(c=>c.uri)),m=f.value.filter(c=>typeof c?.uri=="string"&&c.uri.length>0&&!p.has(c.uri));if(m.length===0)return;t([...e,...m].slice(0,fr));}finally{d(false);}}},"pick");return jsxRuntime.jsxs("ul",{role:"list","aria-label":n,style:l.row,children:[e.map((f,p)=>jsxRuntime.jsxs("li",{style:l.thumb,children:[jsxRuntime.jsx("img",{src:f.uri,alt:f.filename,style:l.thumbImage}),f.mimeType.startsWith("video/")?jsxRuntime.jsx("span",{"aria-hidden":"true",style:l.videoBadge,"data-testid":`televet-intake-media-video-${String(p)}`,children:tc}):null,jsxRuntime.jsx("button",{type:"button",onClick:()=>t(e.filter((m,c)=>c!==p)),"aria-label":`${y.removePhotoLabel}: ${f.filename}`,"data-testid":`televet-intake-media-remove-${String(p)}`,style:l.remove,children:jsxRuntime.jsx("span",{"aria-hidden":"true",style:l.removeGlyph,children:ec})})]},`${f.uri}-${String(p)}`)),s>0?jsxRuntime.jsx("li",{style:l.addItem,children:jsxRuntime.jsx("button",{type:"button",onClick:()=>{u();},disabled:i,"aria-busy":i||void 0,"data-testid":"televet-intake-add-media",style:{...l.dropzone,...i?l.dropzoneBusy:null},children:jsxRuntime.jsx("span",{style:l.dropzoneText,children:y.addPhotoCta})})}):null]})}o(bo,"TelevetIntakeMedia");var ec="\xD7",tc="\u25B6",Lr=92;function rc(e){let{color:t,space:r,radius:n,type:a}=e,{size:l,lineHeight:s}=a,i=o(d=>`${String(d)}px`,"rem");return {row:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"row",flexWrap:"wrap",gap:i(r.md),paddingTop:i(r.sm)},thumb:{position:"relative",width:Lr,height:Lr,borderRadius:i(n.md),backgroundColor:t.surfaceSubtle},thumbImage:{width:"100%",height:"100%",objectFit:"cover",borderRadius:i(n.md),display:"block"},videoBadge:{position:"absolute",left:6,bottom:6,paddingLeft:6,paddingRight:6,paddingTop:2,paddingBottom:2,borderRadius:i(n.sm),backgroundColor:t.shadow,color:t.text.onBrand,fontSize:i(l.nano),lineHeight:"1"},addItem:{display:"flex"},remove:{position:"absolute",top:-8,right:-8,width:ae-16,height:ae-16,borderRadius:"50%",borderStyle:"none",backgroundColor:t.text.metaCool,display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:"pointer",padding:0},removeGlyph:{...h(e,"medium"),color:t.surface,fontSize:i(l.subtitle),lineHeight:"1"},dropzone:{width:Lr,height:Lr,borderRadius:i(n.md),borderWidth:1,borderStyle:"dashed",borderColor:t.brandBorder,backgroundColor:"transparent",display:"inline-flex",alignItems:"center",justifyContent:"center",paddingLeft:i(r.sm),paddingRight:i(r.sm),cursor:"pointer",boxSizing:"border-box"},dropzoneBusy:{opacity:.6,cursor:"progress"},dropzoneText:{...h(e,"mono"),color:t.text.metaCool,fontSize:i(l.nano),lineHeight:String(s.normal),letterSpacing:"0.3px",textAlign:"center"}}}o(rc,"makeStyles");function To({slots:e,selectedDayKey:t,onSelectDay:r,groupLabel:n}){let a=_(),l=react.useMemo(()=>ic(a),[a]),s=react.useMemo(()=>Mr(e),[e]),i=react.useRef(new Map),d=s[0],u=t??d?.key??null,f=react.useRef(null),p=react.useRef(false);react.useEffect(()=>{if(p.current)return;let c=f.current,v=u===null?void 0:i.current.get(u);if(!c||!v||(p.current=true,u===d?.key))return;let S=v.getBoundingClientRect().left-c.getBoundingClientRect().left;c.scrollLeft+=S-(c.clientWidth-v.clientWidth)/2;},[u,d]);let m=react.useCallback(c=>{let v=c.key==="ArrowRight"||c.key==="ArrowDown"?1:c.key==="ArrowLeft"||c.key==="ArrowUp"?-1:0,S=c.key==="Home"?0:c.key==="End"?s.length-1:null;if(v===0&&S===null)return;let b=s.findIndex(k=>k.key===u);if(b<0)return;let T=S??Math.min(s.length-1,Math.max(0,b+v)),C=s[T];C===void 0||C.key===u||(c.preventDefault(),r(C),i.current.get(C.key)?.focus());},[s,u,r]);return d===void 0?null:jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{"aria-hidden":"true",style:l.month,"data-testid":"televet-day-strip-month",children:Jl(d.iso)}),jsxRuntime.jsx("div",{ref:f,role:"radiogroup","aria-label":n,onKeyDown:m,style:l.strip,"data-testid":"televet-day-strip",children:s.map(c=>{let v=c.key===u;return jsxRuntime.jsxs("button",{ref:S=>{S?i.current.set(c.key,S):i.current.delete(c.key);},type:"button",role:"radio","aria-checked":v,tabIndex:v?0:-1,onClick:()=>r(c),"aria-label":Xl(c.iso),"data-testid":`televet-day-${c.key}`,style:{...l.day,...v?l.daySelected:null},children:[jsxRuntime.jsx("span",{"aria-hidden":"true",style:{...l.dayWeekday,...v?l.dayTextSelected:null},children:c.weekday}),jsxRuntime.jsx("span",{"aria-hidden":"true",style:{...l.dayNumber,...v?l.dayTextSelected:null},children:c.dayNumber})]},c.key)})})]})}o(To,"TelevetDayStrip");function Mr(e){let t=new Map;for(let r of e){let n=Ht(r.startsAt);if(t.has(n))continue;let a=new Date(r.startsAt);Number.isNaN(a.getTime())||t.set(n,Object.freeze({key:n,iso:r.startsAt,weekday:a.toLocaleDateString(void 0,{weekday:"short"}),dayNumber:String(a.getDate())}));}return Object.freeze([...t.values()])}o(Mr,"televetDaysFromSlots");function ic(e){let{color:t,space:r,radius:n,type:a}=e,{size:l,lineHeight:s}=a,i=o(d=>`${String(d)}px`,"rem");return {month:{margin:0,textAlign:"center",...h(e,"medium"),color:t.brand,fontSize:i(l.subtitle),lineHeight:String(s.snug),paddingBottom:i(r.md)},strip:{display:"flex",flexDirection:"row",gap:i(r.sm),paddingLeft:i(r.xs),paddingRight:i(r.xs),overflowX:"auto",overscrollBehaviorX:"contain",scrollSnapType:"x proximity"},day:{width:52,flexShrink:0,scrollSnapAlign:"center",minHeight:ae,paddingTop:i(r.md),paddingBottom:i(r.md),borderRadius:i(n.md),borderStyle:"solid",borderWidth:1,borderColor:t.brandBorder,backgroundColor:"transparent",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2,cursor:"pointer",boxSizing:"border-box"},daySelected:{backgroundColor:t.primary,borderColor:t.primary},dayWeekday:{...h(e,"mono"),color:t.text.secondary,fontSize:i(l.tiny),lineHeight:String(s.tight)},dayNumber:{...h(e,"medium"),color:t.brand,fontSize:i(l.heading),lineHeight:String(s.tight)},dayTextSelected:{color:t.onPrimary}}}o(ic,"makeStyles");function qt({slots:e,busySlotId:t,onPick:r,selectedSlot:n=null,header:a,dayGroupLabel:l,timeGroupLabel:s,rowTestIdPrefix:i="televet-slot",testID:d="televet-slot-list"}){let u=_(),f=react.useMemo(()=>dc(u),[u]),p=react.useMemo(()=>Mr(e),[e]),m=`${react.useId()}-zone`,[c,v]=react.useState(null),S=n?Ht(n.startsAt):null,b=sc(p,[c,S])??p[0]?.key??null,T=react.useMemo(()=>b?e.filter(x=>Ht(x.startsAt)===b):[],[e,b]),C=T[0],k=t!==null,D=C?gt(C.startsAt):null;return jsxRuntime.jsxs("div",{style:f.root,"data-testid":d,children:[a,jsxRuntime.jsx(To,{slots:e,selectedDayKey:b,onSelectDay:x=>v(x.key),groupLabel:l}),D?jsxRuntime.jsx("p",{id:m,style:f.zone,"data-testid":"televet-slot-zone",children:D}):null,jsxRuntime.jsx("div",{style:f.gridScroll,children:jsxRuntime.jsx("ul",{role:"list","aria-label":s,...D?{"aria-describedby":m}:{},"aria-busy":k||void 0,style:f.grid,children:T.map(x=>{let O=t===x.slotId;return jsxRuntime.jsx("li",{style:f.gridItem,children:jsxRuntime.jsx("button",{type:"button",onClick:()=>r(x),disabled:k,"aria-busy":O||void 0,"aria-label":Te(x.startsAt),"data-testid":`${i}-${x.slotId}`,style:{...f.chip,...O?f.chipBusy:null,...k&&!O?f.chipDisabled:null},children:jsxRuntime.jsx("span",{"aria-hidden":"true",style:{...f.chipLabel,...O?f.chipLabelBusy:null},children:mt(x.startsAt)})})},x.slotId)})})})]})}o(qt,"TelevetSlotPicker");function sc(e,t){for(let r of t)if(r!==null&&e.some(n=>n.key===r))return r;return null}o(sc,"firstOffered");function dc(e){let{color:t,space:r,radius:n,type:a}=e,{size:l,lineHeight:s}=a,i=o(d=>`${String(d)}px`,"rem");return {root:{display:"flex",flexDirection:"column",flex:"1 1 auto",minHeight:0},gridScroll:{flex:"1 1 auto",minHeight:0,overflowY:"auto",overscrollBehavior:"contain"},zone:{margin:0,textAlign:"center",...h(e,"mono"),color:t.text.secondary,fontSize:i(l.tiny),lineHeight:String(s.normal),letterSpacing:"0.4px",paddingTop:i(r.md),paddingBottom:i(r.md)},grid:{listStyle:"none",margin:0,padding:0,paddingBottom:i(r.xl),display:"flex",flexDirection:"row",flexWrap:"wrap",gap:i(r.md)},gridItem:{display:"flex",flexGrow:1,flexBasis:"28%",minWidth:96},chip:{width:"100%",minHeight:48,borderRadius:i(n.pill),borderStyle:"solid",borderWidth:1,borderColor:t.brandBorder,backgroundColor:"transparent",display:"inline-flex",alignItems:"center",justifyContent:"center",paddingLeft:i(r.md),paddingRight:i(r.md),cursor:"pointer",boxSizing:"border-box"},chipBusy:{backgroundColor:t.primary,borderColor:t.primary},chipDisabled:{opacity:.45,cursor:"not-allowed"},chipLabel:{...h(e,"regular"),color:t.brand,fontSize:i(l.subtitle),lineHeight:String(s.tight)},chipLabelBusy:{color:t.onPrimary}}}o(dc,"makeStyles");function Ie(e){let{color:t,space:r,radius:n,type:a}=e,{size:l,lineHeight:s}=a,i=o(d=>`${String(d)}px`,"rem");return {marker:{minHeight:1},chipRow:{display:"flex",flexWrap:"wrap",justifyContent:"center",gap:i(r.sm)},chip:{minHeight:44,padding:`${i(r.sm)} ${i(r.lg)}`,borderRadius:i(n.pill),borderStyle:"solid",borderWidth:1,borderColor:t.brand,backgroundColor:t.surface,color:t.brand,cursor:"pointer",...h(e,"regular"),fontSize:i(l.body),lineHeight:String(s.snug)},chipOn:{borderColor:t.accent,backgroundColor:t.accent,color:t.onAccent,...h(e,"bold")},stepScroll:{paddingBottom:i(r.md)},visuallyHiddenHeading:{position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0},petRow:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",gap:i(r.sm),minHeight:64,paddingLeft:i(r.md),paddingRight:i(r.md),paddingTop:i(r.sm),paddingBottom:i(r.sm),borderRadius:i(n.pill),borderStyle:"solid",borderWidth:1,borderColor:t.brandBorder,backgroundColor:"transparent",textAlign:"left",cursor:"pointer",boxSizing:"border-box"},petRowSelected:{borderColor:t.primary},petDisc:{width:28,height:28,flexShrink:0,borderRadius:"50%",backgroundColor:t.surfaceSubtle,display:"inline-flex",alignItems:"center",justifyContent:"center",...h(e,"medium"),color:t.brand,fontSize:i(l.caption),lineHeight:"1"},petRowText:{display:"flex",flexDirection:"column",minWidth:0,gap:2},petRowName:{...h(e,"medium"),color:t.brand,fontSize:i(l.body),lineHeight:String(s.snug),overflowWrap:"anywhere"},petRowMeta:{...h(e,"regular"),color:t.text.metaCool,fontSize:i(l.caption),lineHeight:String(s.normal),overflowWrap:"anywhere"},vetRow:{display:"flex",flexDirection:"row",alignItems:"center",gap:i(r.md)},vetAvatar:{width:64,height:64,flexShrink:0,borderRadius:"50%",backgroundColor:t.surfaceSubtle,display:"inline-flex",alignItems:"center",justifyContent:"center",...h(e,"medium"),color:t.brand,fontSize:i(l.heading),lineHeight:"1"},vetIdentity:{display:"flex",flexDirection:"column",flex:"1 1 auto",minWidth:0,gap:2},vetName:{margin:0,...h(e,"medium"),color:t.brand,fontSize:i(l.subtitle),lineHeight:String(s.snug)},vetCredentials:{margin:0,...h(e,"regular"),color:t.text.metaCool,fontSize:i(l.caption),lineHeight:String(s.normal)},vetRating:{margin:0,...h(e,"regular"),color:t.text.secondary,fontSize:i(l.caption),lineHeight:String(s.normal)},vetBio:{margin:0,...h(e,"regular"),color:t.brand,fontSize:i(l.body),lineHeight:String(s.normal)},reasonInput:{width:"100%",minHeight:120,resize:"vertical",borderStyle:"solid",borderWidth:1,borderColor:t.brandBorder,borderRadius:i(n.md),padding:i(r.md),backgroundColor:t.surface,...h(e,"regular"),color:t.text.primary,fontSize:i(l.body),lineHeight:String(s.normal),boxSizing:"border-box"},emergencyBanner:{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:i(r.md),padding:i(r.lg),borderRadius:i(n.lg),borderStyle:"solid",borderWidth:1,borderColor:t.errorRed,backgroundColor:t.badgeBgCritical,boxSizing:"border-box"},emergencyTitle:{margin:0,...h(e,"bold"),color:t.errorRed,fontSize:i(l.subtitle),lineHeight:String(s.snug)},emergencyLede:{margin:0,...h(e,"regular"),color:t.text.primary,fontSize:i(l.body),lineHeight:String(s.normal)}}}o(Ie,"makeLocalStyles");function lt({label:e,value:t,last:r=false,testID:n}){let a=_(),l=react.useMemo(()=>ko(a),[a]);return jsxRuntime.jsxs("div",{style:{...l.row,...r?l.rowLast:null},"data-testid":n,children:[jsxRuntime.jsx("dt",{style:l.rowLabel,children:e}),jsxRuntime.jsx("dd",{style:l.rowValue,children:t})]})}o(lt,"TelevetSummaryRow");function Yt({label:e,checked:t,onToggle:r,testID:n}){let a=_(),l=react.useMemo(()=>ko(a),[a]);return jsxRuntime.jsxs("label",{style:l.consent,children:[jsxRuntime.jsx("input",{type:"checkbox",checked:t,onChange:s=>r(s.currentTarget.checked),"data-testid":n,style:St}),jsxRuntime.jsx("span",{"aria-hidden":"true",style:{...l.box,...t?l.boxChecked:null},children:t?jsxRuntime.jsx("span",{style:l.tick,children:cc}):null}),jsxRuntime.jsx("span",{style:l.consentLabel,children:e})]})}o(Yt,"TelevetConsentCheckbox");var cc="\u2713";function Co({children:e,testID:t}){let r=_(),n=react.useMemo(()=>ko(r),[r]);return jsxRuntime.jsx("dl",{style:n.card,"data-testid":t,children:e})}o(Co,"TelevetSummaryCard");function ko(e){let{color:t,space:r,radius:n,type:a}=e,{size:l,lineHeight:s}=a,i=o(d=>`${String(d)}px`,"rem");return {card:{margin:0,borderRadius:i(n.lg),borderStyle:"solid",borderWidth:1,borderColor:t.brandBorder,paddingLeft:i(r.lg),paddingRight:i(r.lg),boxSizing:"border-box"},row:{display:"flex",flexDirection:"row",alignItems:"flex-start",justifyContent:"space-between",gap:i(r.lg),paddingTop:i(r.lg),paddingBottom:i(r.lg),borderBottomStyle:"solid",borderBottomWidth:1,borderBottomColor:t.brandBorder},rowLast:{borderBottomWidth:0},rowLabel:{margin:0,flexShrink:0,...h(e,"regular"),color:t.brand,fontSize:i(l.subtitle),lineHeight:String(s.snug)},rowValue:{margin:0,marginInlineStart:0,minWidth:0,textAlign:"right",overflowWrap:"anywhere",...h(e,"medium"),color:t.brand,fontSize:i(l.subtitle),lineHeight:String(s.snug)},consent:{display:"flex",flexDirection:"row",alignItems:"flex-start",gap:i(r.md),minHeight:ae,padding:i(r.lg),borderRadius:i(n.md),backgroundColor:t.surfaceSubtle,cursor:"pointer",boxSizing:"border-box"},box:{width:22,height:22,flexShrink:0,borderRadius:i(n.xs),borderStyle:"solid",borderWidth:1.5,borderColor:t.brand,backgroundColor:t.surface,display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box"},boxChecked:{backgroundColor:t.primary,borderColor:t.primary},tick:{...h(e,"bold"),color:t.onPrimary,fontSize:i(l.caption),lineHeight:"1"},consentLabel:{flex:"1 1 auto",minWidth:0,overflowWrap:"anywhere",...h(e,"regular"),color:t.text.metaCool,fontSize:i(l.body),lineHeight:String(s.normal)}}}o(ko,"makeStyles");function xo({headingRef:e,when:t,lengthMinutes:r,clinician:n,petName:a,reason:l,shareRecords:s,onToggleShare:i,stateCode:d,stateAttested:u,onToggleStateAttest:f,cancellationTerms:p,termsAttested:m,onToggleTermsAttest:c,canConfirm:v,busy:S,failure:b,onConfirm:T,emergency:C,onAcknowledgeEmergency:k,onSeeOtherVets:D,mediaShortfall:x=Vt,primaryVet:O,onFindEmergencyVet:z}){let j=L(),J=_(),N=react.useMemo(()=>Ie(J),[J]),X=Br({petName:a,primaryVet:O,onFindEmergencyVet:z})?y.emergency.lede:y.emergency.ledeWithoutExits;return jsxRuntime.jsxs("div",{style:j.scrollRoot,"data-testid":"televet-booking-review",children:[jsxRuntime.jsx("div",{style:j.scrollBody,"data-testid":"televet-booking-review-scroll",children:jsxRuntime.jsxs("div",{style:j.list,children:[jsxRuntime.jsx(at,{headingRef:e,style:j.stepTitle,children:y.reviewHeading}),jsxRuntime.jsxs(Co,{testID:"televet-review-summary",children:[a?jsxRuntime.jsx(lt,{label:y.summaryPet,value:a,testID:"televet-review-row-pet"}):null,n?jsxRuntime.jsx(lt,{label:y.summaryVet,value:n,testID:"televet-review-row-vet"}):null,jsxRuntime.jsx(lt,{label:y.summaryWhen,value:t,testID:"televet-review-row-when"}),jsxRuntime.jsx(lt,{label:y.summaryLength,value:Y(y.summaryLengthTemplate,{n:String(r)}),testID:"televet-review-row-length"}),l?jsxRuntime.jsx(lt,{label:y.summaryReason,value:l,last:true,testID:"televet-review-row-reason"}):null]}),jsxRuntime.jsx(Yt,{label:y.shareRecordsOff,checked:s,onToggle:i,testID:"televet-review-share-records"}),p?jsxRuntime.jsx(Yt,{label:p,checked:m,onToggle:c,testID:"televet-review-terms-attest"}):null,d?jsxRuntime.jsx(Yt,{label:Y(y.stateAttestTemplate,{state:d}),checked:u,onToggle:f,testID:"televet-review-state-attest"}):null,jsxRuntime.jsx($t,{shortfall:x,testIDPrefix:"televet-review"}),C?jsxRuntime.jsxs("div",{role:"alert",style:N.emergencyBanner,"data-testid":"televet-review-emergency",children:[jsxRuntime.jsx(Ca,{style:N.emergencyTitle,children:y.emergency.bannerTitle}),jsxRuntime.jsx("p",{style:N.emergencyLede,children:X}),C.length>0?jsxRuntime.jsx("p",{style:N.emergencyLede,"data-testid":"televet-review-emergency-categories",children:C.join(", ")}):null,jsxRuntime.jsx(Wt,{petName:a,primaryVet:O,onFindEmergencyVet:z,testIDPrefix:"televet-review-emergency"}),jsxRuntime.jsx(P,{label:y.emergency.keepBookingCta,kind:"secondary",loading:S,disabled:S,onPress:k,testID:"televet-review-emergency-ack"})]}):null,b==="failed"?jsxRuntime.jsx(q,{message:y.confirmFailed}):null,b==="clinician_unavailable"?jsxRuntime.jsxs("div",{style:j.list,"data-testid":"televet-review-clinician-unavailable",children:[jsxRuntime.jsx(q,{message:y.confirmFailed}),jsxRuntime.jsx(P,{label:y.seeOtherVetsCta,kind:"secondary",onPress:D,testID:"televet-review-see-other-vets"})]}):null,b==="rate_limited"?jsxRuntime.jsx(q,{message:y.confirmFailed,testID:"televet-review-rate-limited"}):null,b==="not_entitled"?jsxRuntime.jsx(q,{message:y.bookingPausedTitle,testID:"televet-review-not-entitled"}):null]})}),C?null:jsxRuntime.jsx("div",{style:j.scrollFooter,children:jsxRuntime.jsx(P,{label:y.confirmCta,kind:"primary",loading:S,disabled:!v||S||!!d&&!u||!!p&&!m,onPress:T,testID:"televet-review-confirm"})})]})}o(xo,"ReviewStep");var yc="\u25CB",mc="+";function We(e,t){return t?e.find(n=>n.petRef===t||n.petId===t)?.name??null:null}o(We,"nameOf");function at({headingRef:e,style:t,id:r,children:n}){let a=le(me());return jsxRuntime.jsx(a,{ref:e,tabIndex:-1,style:t,...r===void 0?{}:{id:r},children:n})}o(at,"StepHeading");function Ca({style:e,children:t}){let r=le(Ut(me()));return jsxRuntime.jsx(r,{style:e,children:t})}o(Ca,"SubHeading");function xa({headingRef:e,pets:t,isPending:r,isError:n,onRetry:a,selectedId:l,onSelect:s,onAddPet:i}){let d=L(),u=_(),f=react.useMemo(()=>Ie(u),[u]);return r?jsxRuntime.jsx("div",{role:"progressbar","aria-label":y.loading.pets,"aria-busy":"true",style:d.list,"data-testid":"televet-pets-loading",children:[0,1].map(p=>jsxRuntime.jsx(ge,{height:64},p))}):n?jsxRuntime.jsx("div",{"data-testid":"televet-pets-error",children:jsxRuntime.jsx(K,{title:y.chrome.loadFailedTitle,actionLabel:y.chrome.retryCta,onAction:a})}):t.length===0?jsxRuntime.jsx("div",{"data-testid":"televet-pets-empty",children:jsxRuntime.jsx(K,{title:y.chrome.noPetsTitle,actionLabel:y.addPetCta,onAction:i})}):jsxRuntime.jsxs("div",{style:d.stepFill,children:[jsxRuntime.jsx(at,{headingRef:e,style:d.stepTitle,children:y.petSelectTitle}),jsxRuntime.jsx("div",{style:{...d.scrollBody,...f.stepScroll},children:jsxRuntime.jsxs("ul",{role:"list",style:d.list,"data-testid":"televet-pets",children:[t.map(p=>{let m=l===p.petRef;return jsxRuntime.jsx(ka,{name:p.name??"",meta:ba(p),selected:m,onPress:()=>s(p.petRef),testID:`televet-pet-${p.petRef}`},p.petRef)}),i?jsxRuntime.jsx(ka,{name:y.addPetCta,meta:"",selected:false,onPress:i,testID:"televet-pet-add",glyph:mc}):null]})})]})}o(xa,"PetStep");function ka({name:e,meta:t,selected:r,onPress:n,testID:a,glyph:l}){let s=_(),i=react.useMemo(()=>Ie(s),[s]);return jsxRuntime.jsx("li",{children:jsxRuntime.jsxs("button",{type:"button",onClick:n,"aria-pressed":r,"data-testid":a,style:{...i.petRow,...r?i.petRowSelected:null},children:[jsxRuntime.jsx("span",{"aria-hidden":"true",style:i.petDisc,children:l??Ra(e)}),jsxRuntime.jsxs("span",{style:i.petRowText,children:[jsxRuntime.jsx("span",{style:i.petRowName,children:e}),t?jsxRuntime.jsx("span",{style:i.petRowMeta,children:t}):null]})]})})}o(ka,"PetRow");function Ra(e){let t=e.trim();return t.length===0?yc:t.slice(0,1).toUpperCase()}o(Ra,"initialOf");function _a({headingRef:e,clinicians:t,isPending:r,isError:n,selectedId:a,onSelect:l,onRetry:s}){let i=L(),d=_(),u=react.useMemo(()=>Ie(d),[d]);if(r)return jsxRuntime.jsx("div",{role:"progressbar","aria-label":y.loading.clinicians,"aria-busy":"true",style:i.list,"data-testid":"televet-clinicians-loading",children:jsxRuntime.jsx(ge,{height:96})});if(n)return jsxRuntime.jsx("div",{"data-testid":"televet-clinicians-error",children:jsxRuntime.jsx(K,{title:y.chrome.loadFailedTitle,actionLabel:y.chrome.retryCta,onAction:s})});if(t.length===0)return jsxRuntime.jsx("div",{"data-testid":"televet-clinicians-empty",children:jsxRuntime.jsx(K,{title:y.noCliniciansTitle,message:y.noCliniciansBody,actionLabel:y.noCliniciansRetryCta,onAction:s})});let f=t.find(p=>p.clinicianId===a)??t[0];return f===void 0?null:jsxRuntime.jsxs("div",{style:i.list,"data-testid":"televet-clinicians",children:[jsxRuntime.jsx(at,{headingRef:e,style:i.stepTitle,children:y.yourVetTitle}),jsxRuntime.jsxs("div",{style:u.vetRow,children:[jsxRuntime.jsx("span",{"aria-hidden":"true",style:u.vetAvatar,children:Ra(f.displayName)}),jsxRuntime.jsxs("div",{style:u.vetIdentity,children:[jsxRuntime.jsx("p",{style:u.vetName,children:f.displayName}),f.credentials?jsxRuntime.jsx("p",{style:u.vetCredentials,children:f.credentials}):null,f.rating!==null&&f.ratingCount!==null?jsxRuntime.jsx("p",{style:u.vetRating,"data-testid":"televet-vet-rating",children:`\u2605 ${String(f.rating)} \xB7 ${String(f.ratingCount)} ${y.reviewsLabel}`}):null]})]}),f.bio?jsxRuntime.jsx("p",{style:u.vetBio,"data-testid":"televet-vet-bio",children:f.bio}):null,jsxRuntime.jsx("div",{style:i.divider}),jsxRuntime.jsx(P,{label:y.continueCta,kind:"primary",onPress:()=>l(f.clinicianId),testID:`televet-clinician-${f.clinicianId}`})]})}o(_a,"ClinicianStep");function Pa({headingRef:e,slots:t,enabled:r,isPending:n,isError:a,busySlotId:l,failure:s,selectedSlot:i,nextOpening:d,onPick:u,onRetry:f,onSeeOtherVets:p}){let m=L();return r?n?jsxRuntime.jsx("div",{role:"progressbar","aria-label":y.loading.slots,"aria-busy":"true",style:m.list,"data-testid":"televet-slots-loading",children:[0,1,2].map(c=>jsxRuntime.jsx(ge,{height:48},c))}):a?jsxRuntime.jsx(K,{title:y.slotsErrorTitle,actionLabel:y.retryCta,onAction:f,testID:"televet-slots-error"}):t.length===0?jsxRuntime.jsx("div",{"data-testid":"televet-slots-empty",children:jsxRuntime.jsx(K,{title:y.noSlotsTitle,message:d?Y(y.nextOpeningTemplate,{when:Te(d.startsAt)}):void 0,actionLabel:d?y.seeOtherVetsCta:void 0,onAction:d?p:void 0})}):jsxRuntime.jsxs("div",{style:m.stepFill,"data-testid":"televet-slots",children:[jsxRuntime.jsx(at,{headingRef:e,style:m.stepTitle,children:y.timeHeading}),s==="expired"?jsxRuntime.jsx(q,{message:y.holdExpired}):null,s==="taken"?jsxRuntime.jsx(q,{message:y.slotTaken}):null,s==="failed"||s==="rate_limited"?jsxRuntime.jsx(q,{message:y.confirmFailed,testID:"televet-slots-hold-failed"}):null,jsxRuntime.jsx(qt,{slots:t,busySlotId:l,onPick:u,selectedSlot:i,dayGroupLabel:y.summaryWhen,timeGroupLabel:y.navTitle})]}):jsxRuntime.jsx("div",{"data-testid":"televet-slots-unavailable",children:jsxRuntime.jsx(K,{title:y.bookingPausedTitle})})}o(Pa,"SlotStep");function wa({headingRef:e,petName:t,chips:r,selected:n,onToggle:a,onNext:l}){let s=L(),i=_(),d=react.useMemo(()=>Ie(i),[i]),u=Y(y.issuesHeadingTemplate,{pet:t??""});return jsxRuntime.jsxs("div",{style:s.scrollRoot,"data-testid":"televet-booking-issues",children:[jsxRuntime.jsx("div",{style:s.scrollBody,children:jsxRuntime.jsxs("div",{style:s.list,children:[jsxRuntime.jsx(at,{headingRef:e,style:s.stepTitle,children:u}),jsxRuntime.jsx("p",{style:s.stepHelp,children:y.issuesHint}),jsxRuntime.jsx("div",{role:"group","aria-label":u,style:d.chipRow,children:r.map(f=>{let p=n.includes(f.id);return jsxRuntime.jsx("button",{type:"button","aria-pressed":p,onClick:()=>a(f.id),style:{...d.chip,...p?d.chipOn:null},"data-testid":`televet-issue-${f.id}`,children:f.label},f.id)})})]})}),jsxRuntime.jsx("div",{style:s.scrollFooter,children:jsxRuntime.jsx(P,{label:y.continueCta,kind:"primary",onPress:l,testID:"televet-issues-next"})})]})}o(wa,"IssuesStep");function Ia({headingRef:e,value:t,composed:r,onChange:n,onNext:a,media:l,onChangeMedia:s,onPickMedia:i,checking:d=false}){let u=L(),f=_(),p=react.useMemo(()=>Ie(f),[f]),m=react.useId(),c=`${m}-reason-heading`,v=`${m}-reason-help`,S=(r??t).trim(),b=S.length>He,T=S.length>0&&!b;return jsxRuntime.jsxs("div",{style:u.scrollRoot,"data-testid":"televet-booking-reason",children:[jsxRuntime.jsx("div",{style:u.scrollBody,"data-testid":"televet-booking-reason-scroll",children:jsxRuntime.jsxs("div",{style:u.list,children:[jsxRuntime.jsx(at,{headingRef:e,id:c,style:u.stepTitle,children:y.describeHeading}),jsxRuntime.jsx("p",{id:v,style:u.stepHelp,children:y.describeHelpLong}),jsxRuntime.jsx("textarea",{value:t,onChange:C=>n(C.currentTarget.value),"aria-labelledby":c,"aria-describedby":v,"aria-invalid":b||void 0,placeholder:y.reasonPlaceholder,style:p.reasonInput,"data-testid":"televet-reason-input"}),b?jsxRuntime.jsx(q,{message:y.reasonTooLong}):null,jsxRuntime.jsx(bo,{media:l,onChange:s,listLabel:y.addPhotoCta,...i?{onPickMedia:i}:{}})]})}),jsxRuntime.jsx("div",{style:u.scrollFooter,children:jsxRuntime.jsx(P,{label:y.continueCta,kind:"primary",disabled:!T,loading:d,onPress:a,testID:"televet-reason-next"})})]})}o(Ia,"ReasonStep");function Po(e){let{petRef:t,usState:r,controller:n,onBooked:a,onExit:l,onAddPet:s,onPickMedia:i,onAddToCalendar:d,onConfirmDiscard:u,onRequestLocation:f,locationStatus:p="unknown",onTriageReason:m,onStateInterest:c,primaryVet:v,onFindEmergencyVet:S,canJoinInApp:b=false,renderUnavailable:T,headingLevel:C,style:k,testID:D}=dt(e,["onBooked","onExit","onAddPet","onRequestLocation","onFindEmergencyVet"]),x=ra(C??bt),O=Ut(x),z=L(),j=_(),J=react.useMemo(()=>Ie(j),[j]),N=he(n),X=_r(),W=X.pets,Z=W.length,fe=react.useMemo(()=>({ownedPetCount:Z,withIssues:true}),[Z]),[be,Oe]=react.useReducer((H,Je)=>Kn(H,Je,fe),void 0,()=>Wn({ownedPetCount:0,withIssues:true},{petId:t??null,state:r??null})),A=react.useCallback(H=>Oe(H),[]),[$e,Ke]=react.useState(""),[qe,$]=react.useState([]),[Ee,V]=react.useState(null),[Fe,st]=react.useState(null),[Hr,$o]=react.useState(false),[Vr,Ko]=react.useState(false),[qo,Qa]=react.useState([]),[Ur,Za]=react.useState(null),[es,ts]=react.useState(null),{draft:R}=be,re=qn(be),Yo=react.useMemo(()=>$l(W.find(H=>H.petRef===R.petId||H.petId===R.petId)?.species??null),[W,R.petId]),Ye=Kl(qe.map(H=>Yo.find(Je=>Je.id===H)?.label??""),$e),Go=react.useRef(R.state);Go.current!==R.state&&(Go.current=R.state,Hr&&$o(false),Vr&&Ko(false));let tr=bn(R.state,N),Jo=Bt(N),Rt=hn(N),ye=Tn(R.state,N),Me=Dt(R.clinicianId,N),Wr=Me.refetch,rs=Sn(N).data??null,$r=Nt(N),Xo=Cn(N),Ce=ro(m??null),Qo=no(R.state,c??null).actionFor("no_licensed_vet"),Kr=r??null;react.useEffect(()=>{Kr&&!R.state&&A({type:"patch",patch:{state:Kr}});},[Kr,R.state,A]),react.useEffect(()=>{t&&!R.petId&&A({type:"patch",patch:{petId:t}});},[t,R.petId,A]);let qr=W.length===1?W[0]?.petRef??null:null;react.useEffect(()=>{qr&&!R.petId&&A({type:"patch",patch:{petId:qr}});},[qr,R.petId,A]);let Zo=react.useRef(re);Zo.current=re;let ei=react.useRef(0);react.useEffect(()=>{Z!==ei.current&&(ei.current=Z,A({type:"goTo",step:Zo.current}));},[Z,A]);let Yr=ye.data?.[0]?.clinicianId??null;react.useEffect(()=>{Yr&&!R.clinicianId&&A({type:"patch",patch:{clinicianId:Yr}});},[Yr,R.clinicianId,A]);let Ge=react.useRef(null),ti=react.useRef(false);react.useEffect(()=>{if(!ti.current){ti.current=true;return}Ge.current?.focus();},[re]);let ns=ea({draft:R,hold:$r,dispatch:A,setFailure:V,refetchSlots:Wr}),{submitBooking:os,confirm:is}=Zl({draft:R,reasonText:Ye,book:Xo,stateAttested:Hr,termsAttested:Vr,cancellationPolicy:Jo.data??null,triage:Ce,goTo:react.useCallback(H=>A({type:"goTo",step:H}),[A]),releaseSlot:react.useCallback(()=>{ts(R.slot),A({type:"patch",patch:Wl}),Wr();},[R.slot,A,Wr]),setFailure:V,setEmergency:st,setBookedConsult:Za,...a?{onBooked:a}:{}}),ls=tr.enabled&&tr.data!==null&&!tr.data.wellnessAvailable,ri=Rt.enabled&&Rt.data?.active===false||Ee==="not_entitled",as=Rt.enabled&&Rt.data!==null,ss=Xn(as),ni=Or(qo.length),ds=Ye.trim().length>0||!!R.slot,oi={surfaceUnavailable:N===null||Ee==="unavailable"||xn(Rt)||xn(tr),notEntitled:ri,policyBlocked:ls,triageOpen:Ce.open,step:re},us=sa(oi),ii={noState:!R.state,isPending:ye.enabled&&ye.isPending,isError:ye.isError,isEmpty:(ye.data?.length??0)===0,notEntitled:ri},cs=ua(ii);return Ae()?jsxRuntime.jsx(oo.Provider,{value:O,children:jsxRuntime.jsxs("div",{style:{...z.screen,...k},"data-testid":D??"televet-booking",children:[jsxRuntime.jsx(vo,{step:re,furthestIndex:be.furthestIndex,triageOpen:Ce.open,canGoBack:(Ce.open||$n(be,fe))&&re!=="booked",isDirty:ds,onBack:()=>{if(Ce.open){Ce.close();return}Ce.cancel(),A({type:"back"});},onClose:()=>l?.(),headingLevel:x,...u?{onConfirmDiscard:u}:{}}),us?jsxRuntime.jsx(da,{state:oi,petName:We(W,R.petId),...v?{primaryVet:v}:{},onFindEmergencyVet:S,stateInterest:Qo,...c?{onCheckAvailability:o(()=>A({type:"goTo",step:"clinician"}),"onCheckAvailability")}:{},onAcknowledgeEmergency:()=>{Ce.acknowledge(Ye),A({type:"next"});},...T?{renderUnavailable:T}:{}}):re==="time"?jsxRuntime.jsx(Pa,{headingRef:Ge,slots:Me.data??[],enabled:Me.enabled,isPending:Me.enabled&&Me.isPending&&Me.data===null,isError:Me.isError,busySlotId:$r.isPending?$r.variables:null,failure:Ee,selectedSlot:R.slot??es,nextOpening:rs,onPick:ns,onRetry:()=>Me.refetch(),onSeeOtherVets:()=>A({type:"goTo",step:"clinician"})}):re==="review"?jsxRuntime.jsx(xo,{headingRef:Ge,when:R.slot?Te(R.slot.startsAt):"",lengthMinutes:(R.slot?cn(R.slot):null)??rt,petName:We(W,R.petId),reason:Ye.trim(),clinician:ye.data?.find(H=>H.clinicianId===R.clinicianId)?.displayName??null,shareRecords:R.shareHealthRecords,stateCode:R.state,stateAttested:Hr,onToggleStateAttest:$o,cancellationTerms:Jo.data?.summary??null,termsAttested:Vr,onToggleTermsAttest:Ko,onToggleShare:H=>A({type:"patch",patch:{shareHealthRecords:H}}),canConfirm:jt(R,Ye),busy:Xo.isPending,failure:Ee,onConfirm:is,emergency:Fe,onAcknowledgeEmergency:()=>os(true),mediaShortfall:ni,primaryVet:v,onFindEmergencyVet:S,onSeeOtherVets:()=>A({type:"goTo",step:"clinician"})}):re==="booked"?jsxRuntime.jsx("div",{style:z.stepFill,"data-testid":"televet-booking-booked",children:Ur?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(co,{consult:Ur,petName:We(W,Ur.petId)??We(W,R.petId),onDone:()=>l?.(),canJoinInApp:b,lengthMinutes:(R.slot?cn(R.slot):null)??rt,...d?{onAddToCalendar:d}:{}}),jsxRuntime.jsx($t,{shortfall:ni,testIDPrefix:"televet-booked"})]}):null}):re==="clinician"&&cs?jsxRuntime.jsx(ca,{state:ii,cause:ss,locationStatus:p,...f?{onRequestLocation:f}:{},onRetry:()=>ye.refetch(),stateInterest:Qo,...T?{renderUnavailable:T}:{}}):re==="clinician"?jsxRuntime.jsx(_a,{headingRef:Ge,clinicians:ye.data??[],isPending:ye.enabled&&ye.isPending,isError:ye.isError,selectedId:R.clinicianId,onRetry:()=>ye.refetch(),onSelect:H=>{A({type:"patch",patch:{clinicianId:H}}),A({type:"next"});}}):re==="issues"?jsxRuntime.jsx(wa,{headingRef:Ge,petName:We(W,R.petId),chips:Yo,selected:qe,onToggle:H=>$(Je=>Je.includes(H)?Je.filter(ps=>ps!==H):[...Je,H]),onNext:()=>A({type:"next"})}):re==="reason"?jsxRuntime.jsx(Ia,{headingRef:Ge,value:$e,composed:Ye,onChange:Ke,media:qo,onChangeMedia:Qa,...i?{onPickMedia:i}:{},checking:Ce.checking,onNext:()=>{Ce.check(Ye).then(H=>{H&&A({type:"next"});});}}):re==="pet"?jsxRuntime.jsx(xa,{headingRef:Ge,pets:W,isPending:X.loading,isError:X.error!==null,onRetry:()=>{X.refresh();},onAddPet:s,selectedId:R.petId,onSelect:H=>{A({type:"patch",patch:{petId:H}}),A({type:"next"});}}):jsxRuntime.jsx("div",{style:J.marker,"data-testid":`televet-booking-step-${re}`})]})}):jsxRuntime.jsx("div",{style:{...z.screen,...k},"data-testid":D??"televet-booking",children:jsxRuntime.jsx("div",{style:z.stepFill,"data-testid":"televet-booking-copy-unapproved",children:T?T():null})})}o(Po,"EverfurTelevetBooking");var Aa=Symbol.for("@everfur/sdk/televet");function Ba(){let e=globalThis,t=e[Aa];if(t!==void 0)return t;let r={presenter:null,snapshot:Object.freeze({request:null,serial:0,activeHost:null}),hosts:[],nextHost:1,listeners:new Set,dailyRegistered:false};return e[Aa]=r,r}o(Ba,"televetGlobal");function zr(){return Ba().dailyRegistered}o(zr,"isEverfurDailyRegistered");function wo(){let e=Ba(),t=e.noticeReceipts;if(t!==void 0)return t;let r=new Map;return e.noticeReceipts=r,r}o(wo,"noticeReceipts");function Da(e){let t=wo(),r=t.get(e);r!==void 0?r.holders+=1:t.set(e,{holders:1,joined:false});}o(Da,"markRecordingNoticeAccepted");function Na(e){let t=wo(),r=t.get(e);r!==void 0&&(r.holders-=1,r.holders<=0&&t.delete(e));}o(Na,"clearRecordingNoticeAccepted");function La(e){return wo().get(e)?.joined===true}o(La,"isTelevetCallJoined");var Le=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`:Le.lobbyTitleNoName},"lobbyTitle"),lobbyPrep:o(e=>{let t=e?.trim()??"";return t.length>0?`Have ${t} nearby and somewhere well lit.`:Le.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 Fa(e){switch(e){case "too_early":return "This visit has not opened yet.";case "too_late":return "This visit has ended.";case "room_not_ready":return "We are still setting up the video room. Try again in a moment.";case "status_cancelled_owner":return "You cancelled this visit.";case "status_cancelled_ops":return "This visit was cancelled. Please book another time.";case "status_no_show_owner":return "This visit was missed.";case "status_no_show_vet":return "The vet could not make this visit. Please book another time.";case "status_awaiting_summary":return "This visit has ended. Your summary is on its way.";case "status_completed":return "This visit has ended.";default:return Qt}}o(Fa,"televetJoinRefusalWebCopy");var Qt="This visit cannot be joined right now.";function Ma(e){return e==="room_not_ready"||e==="unknown"}o(Ma,"televetJoinIsRetryable");function za(e){let t=null;return ()=>{if(t!==null)return t;let r=e();return t=r,r.then(void 0,()=>{t===r&&(t=null);}),r}}o(za,"memoizeTelevetLoader");var Ha=Object.freeze({status:"joining"});function Io(e,t){let[r,n]=react.useState(0),[a,l]=react.useState(Ha),s=react.useRef(null);react.useEffect(()=>{let d=t?.joinConsult;if(t===null||d===void 0){l(Object.freeze({status:"refused",refusal:"unavailable",reason:null}));return}let u=`${e}#${String(r)}`,f=s.current;if(f===null||f.key!==u){let m;try{m=d.call(t,e);}catch(c){m=Promise.reject(c);}f={key:u,promise:m},s.current=f;}let p=true;return l(Ha),f.promise.then(m=>{p&&(m.ok?l(Object.freeze({status:"ready",credential:m.value})):l(Object.freeze({status:"refused",refusal:dn(m.error),reason:sn(m.error)})));},()=>{p&&l(Object.freeze({status:"refused",refusal:"unknown",reason:null}));}),()=>{p=false;}},[e,t,r]);let i=react.useCallback(()=>n(d=>d+1),[]);return {state:a,retry:i}}o(Io,"useTelevetJoin");var Ua=za(()=>import('@everfur/sdk/web/televet/call')),kc=tn;function Oo({consultId:e,controller:t,onLeave:r,style:n}){let a=L(),[l,s]=react.useState(null),i=l===e,[d]=react.useState(zr);react.useEffect(()=>{if(d)return;let f=true;return Ua().then(p=>{f&&Rc(p.EVERFUR_DAILY_SETUP);},()=>{}),()=>{f=false;}},[d]),Kt(()=>(r(),true),!i);let u=react.useCallback(()=>{s(null),r();},[r]);return d?i?jsxRuntime.jsx(xc,{consultId:e,controller:t,onLeave:u,style:n},e):jsxRuntime.jsx(Wa,{onContinue:()=>s(e),onDecline:r,style:n}):jsxRuntime.jsxs("div",{style:{...a.stepFill,...n},"data-testid":"televet-join-call-unavailable",children:[jsxRuntime.jsx(q,{message:Qt}),jsxRuntime.jsx(P,{label:Le.leaveCta,kind:"secondary",onPress:r,testID:"televet-join-unavailable-leave"})]})}o(Oo,"TelevetJoinScreen");function Wa({onContinue:e,onDecline:t,busy:r=false,declineHeld:n=false,style:a}){let l=L(),s=`${react.useId()}-recording-notice`,i=react.useRef(null);return react.useEffect(()=>{let d=i.current;if(!d)return;let u=d.ownerDocument.activeElement;u!==null&&u!==d.ownerDocument.body||d.focus();},[]),jsxRuntime.jsx("div",{style:{...l.stepFill,...a},children:jsxRuntime.jsxs("div",{ref:i,role:"alertdialog","aria-labelledby":s,"aria-busy":r||void 0,tabIndex:-1,"data-testid":"everfur-vet-call-recording-notice",style:l.stateCard,children:[jsxRuntime.jsx("p",{id:s,style:l.stateTitle,children:Le.recordingNoticeTitle}),jsxRuntime.jsx(P,{label:Le.recordingNoticeCta,kind:"primary",loading:r,onPress:()=>e?.(),testID:"everfur-vet-call-recording-continue"}),jsxRuntime.jsx(P,{label:Le.recordingNoticeDecline,kind:"secondary",disabled:n,onPress:()=>t?.(),testID:"everfur-vet-call-recording-decline"})]})})}o(Wa,"TelevetRecordingNotice");function xc({consultId:e,controller:t,onLeave:r,style:n}){let a=L(),l=he(t),{state:s,retry:i}=Io(e,l),d=s.status==="ready"?s.credential:null,[u,f]=react.useState(null),[p,m]=react.useState(false),c=d!==null;react.useEffect(()=>{if(!c||u!==null)return;let x=true;return Ua().then(O=>{x&&f(()=>O);},()=>{x&&m(true);}),()=>{x=false;}},[c,u]);let[v,S]=react.useState(null);react.useEffect(()=>{if(d===null)return;let x=d.roomUrl;return Da(x),S(d),()=>{Na(x);}},[d]);let b=s.status==="joining",[T,C]=react.useState(false);react.useEffect(()=>{if(!b){C(false);return}let x=setTimeout(()=>C(true),kc);return ()=>{clearTimeout(x);}},[b]);let k=b&&!T;if(Kt(()=>(k||d!==null&&u!==null&&!p&&La(d.roomUrl)||r(),true)),s.status==="refused"||p){let x=s.status==="refused"?s.refusal:"unavailable",O=s.status==="refused"?Fa(s.reason):Qt;return jsxRuntime.jsxs("div",{style:{...a.stepFill,...n},"data-testid":"televet-join-refused",children:[jsxRuntime.jsx(q,{message:O,testID:"televet-join-refused-message"}),Ma(x)&&s.status==="refused"?jsxRuntime.jsx(P,{label:y.retryCta,kind:"primary",onPress:i,testID:"televet-join-retry"}):null,jsxRuntime.jsx(P,{label:Le.leaveCta,kind:"secondary",onPress:r,testID:"televet-join-leave"})]})}if(d===null||u===null||v!==d)return jsxRuntime.jsx(Wa,{busy:true,declineHeld:k,onDecline:r,style:n});let{EverfurVetCall:D}=u;return jsxRuntime.jsx(D,{roomUrl:d.roomUrl,token:d.token,onLeave:r,renderUnavailable:()=>jsxRuntime.jsxs("div",{style:a.stepFill,"data-testid":"televet-join-call-unavailable",children:[jsxRuntime.jsx(q,{message:Qt}),jsxRuntime.jsx(P,{label:Le.leaveCta,kind:"secondary",onPress:r,testID:"televet-join-unavailable-leave"})]}),...n?{style:n}:{}})}o(xc,"TelevetJoinRoom");var Va=false;function Rc(e){if(Va)return;Va=true;let t=globalThis.console;try{t?.warn?.(e);}catch{}}o(Rc,"warnSetupOnce");var wc=2e4;function $a(e=true,t=wc){let[r,n]=react.useState(()=>Date.now());return react.useEffect(()=>{if(!e)return;n(Date.now());let a=setInterval(()=>n(Date.now()),t);return ()=>clearInterval(a)},[e,t]),r}o($a,"useNowMs");function Ic(e){let t=e.trim().length;return t<1?I.cancellationReasonMissing:t>Ve?I.cancellationReasonTooLong(Ve):null}o(Ic,"reasonRefusal");function Bo({terms:e,submitting:t,failure:r,onConfirm:n,onDismiss:a,onRetryTerms:l,styles:s}){let[i,d]=react.useState(""),[u,f]=react.useState(null),p=react.useId(),m=react.useId(),c=e.status==="ready",v=o(()=>{if(t||!c)return;let S=Ic(i);f(S),S||n(i.trim());},"confirm");return jsxRuntime.jsxs("form",{onSubmit:S=>{S.preventDefault(),v();},"aria-label":I.cancelConfirmCta,noValidate:true,style:s.form,"data-testid":"televet-visit-cancel-form",children:[jsxRuntime.jsx("p",{style:s.noticeTitle,children:I.cancelConfirmTitle}),e.status==="ready"?jsxRuntime.jsx("div",{style:s.notice,"data-testid":"televet-visit-cancel-terms",children:jsxRuntime.jsx("p",{style:s.note,children:e.summary})}):e.status==="loading"?jsxRuntime.jsx("div",{role:"status",style:s.notice,children:jsxRuntime.jsx("p",{style:s.note,children:I.loadingCancellationTerms})}):jsxRuntime.jsxs("div",{role:"alert",style:{...s.notice,...s.noticeDanger},"data-testid":"televet-visit-cancel-terms-error",children:[jsxRuntime.jsx("p",{style:s.note,children:I.cancellationTermsUnavailable}),jsxRuntime.jsx(P,{label:I.retry,kind:"secondary",fullWidth:false,onPress:l})]}),jsxRuntime.jsx("label",{htmlFor:p,style:s.label,children:I.cancellationReasonLabel}),jsxRuntime.jsx("textarea",{id:p,value:i,onChange:S=>{d(S.target.value),u&&f(null);},maxLength:Ve,rows:3,disabled:t||!c,"aria-invalid":u?true:void 0,"aria-describedby":u?m:void 0,style:s.textarea,"data-testid":"televet-visit-cancel-reason"}),u?jsxRuntime.jsx("p",{id:m,role:"alert",style:s.fieldError,children:u}):null,r?jsxRuntime.jsx("div",{role:"alert",style:{...s.notice,...s.noticeDanger},"data-testid":"televet-visit-cancel-failed",children:jsxRuntime.jsx("p",{style:s.note,children:r})}):null,jsxRuntime.jsxs("div",{style:s.actions,children:[jsxRuntime.jsx(P,{label:t?I.cancellingVisit:I.cancelConfirmCta,kind:"danger",fullWidth:false,disabled:t||!c,loading:t,onPress:v,testID:"televet-visit-cancel-yes"}),jsxRuntime.jsx(P,{label:I.cancelDismissCta,kind:"secondary",fullWidth:false,disabled:t,onPress:a,testID:"televet-visit-cancel-keep"})]})]})}o(Bo,"TelevetCancelVisitForm");function Ya(e){let{color:t,space:r,radius:n,type:a}=e,{size:l,lineHeight:s}=a,i=o(d=>`${String(d)}px`,"px");return {screen:{...yt,display:"flex",flexDirection:"column",gap:i(r.md),paddingLeft:i(r.xl),paddingRight:i(r.xl),boxSizing:"border-box"},topBar:{display:"flex",alignItems:"center",justifyContent:"flex-end",minHeight:44},topBarStart:{justifyContent:"flex-start"},iconButton:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:44,height:44,padding:0,border:0,borderRadius:i(n.pill),background:"transparent",color:t.text.primary,cursor:"pointer"},textButton:{display:"inline-flex",alignItems:"center",minHeight:44,padding:`0 ${i(r.sm)}`,border:0,borderRadius:i(n.pill),background:"transparent",color:t.brand,cursor:"pointer",...h(e,"bold"),fontSize:i(l.body)},panel:{display:"flex",flexDirection:"column",borderStyle:"solid",borderWidth:1,borderColor:t.brandBorder,borderRadius:i(n.lg),backgroundColor:t.surface,overflow:"hidden"},panelBody:{display:"flex",flexDirection:"column",gap:i(r.md),padding:i(r.lg)},panelHeader:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:i(r.sm),padding:`${i(r.md)} ${i(r.lg)}`,borderBottom:`1px solid ${t.brandBorder}`},panelTitle:{margin:0,...h(e,"medium"),color:t.brand,fontSize:i(l.subtitle),lineHeight:String(s.snug)},count:{...h(e,"mono"),color:t.text.metaCool,fontSize:i(l.caption)},bookTitle:{margin:0,...h(e,"medium"),color:t.brand,fontSize:i(l.subtitle),lineHeight:String(s.snug)},list:{listStyle:"none",margin:0,padding:0},row:{display:"flex",flexDirection:"column",gap:i(r.sm),padding:`${i(r.md)} ${i(r.lg)}`,borderBottom:`1px solid ${t.brandBorder}`},rowHead:{display:"flex",flexWrap:"wrap",alignItems:"flex-start",justifyContent:"space-between",gap:i(r.sm)},when:{margin:0,...h(e,"medium"),color:t.text.primary,fontSize:i(l.subtitle),lineHeight:String(s.snug)},pet:{margin:0,...h(e,"regular"),color:t.text.metaCool,fontSize:i(l.caption)},chip:{display:"inline-flex",alignItems:"center",padding:`2px ${i(r.sm)}`,borderRadius:i(n.pill),backgroundColor:t.surfaceSubtle,...h(e,"mono"),color:t.text.metaCool,fontSize:i(l.micro),letterSpacing:"0.04em",textTransform:"uppercase"},chipPositive:{backgroundColor:t.badgeBgPositive,color:t.brand},actions:{display:"flex",flexWrap:"wrap",gap:i(r.sm)},note:{margin:0,...h(e,"regular"),color:t.text.metaCool,fontSize:i(l.body),lineHeight:String(s.normal)},notice:{display:"flex",flexDirection:"column",gap:i(r.xs),padding:i(r.md),borderRadius:i(n.md),backgroundColor:t.surfaceSubtle},noticeTitle:{margin:0,...h(e,"medium"),color:t.text.primary,fontSize:i(l.body),lineHeight:String(s.snug)},noticeDanger:{backgroundColor:t.badgeBgCritical},form:{display:"flex",flexDirection:"column",gap:i(r.sm),marginTop:i(r.sm),paddingTop:i(r.md),borderTop:`1px solid ${t.brandBorder}`},label:{...h(e,"medium"),color:t.text.primary,fontSize:i(l.body)},textarea:{minHeight:96,padding:i(r.sm),borderRadius:i(n.md),border:`1px solid ${t.brandBorder}`,...h(e,"regular"),fontSize:i(l.body),color:t.text.primary,backgroundColor:t.surface,resize:"vertical",boxSizing:"border-box"},fieldError:{margin:0,...h(e,"regular"),color:t.danger,fontSize:i(l.caption)},empty:{display:"flex",flexDirection:"column",gap:i(r.xs),padding:i(r.lg)},skeletons:{display:"flex",flexDirection:"column",gap:i(r.sm),padding:i(r.lg)}}}o(Ya,"makeVisitStyles");function Lo({controller:e,onJoin:t,onReschedule:r,onBook:n,onBack:a,isRoot:l=true,revision:s=0,returnedTo:i=false,nowMs:d,style:u}){let f=_(),p=react.useMemo(()=>Ya(f),[f]),m=le(me()),c=he(e),[v,S]=react.useState(0),b=br(c,s+v),T=Bt(c),{pets:C}=_r(),[k,D]=react.useState({status:"idle"}),[x,O]=react.useState(null),z=b.data??[],j=$a(z.some($=>!ur.has($.status))),J=d??j,{upcoming:N,past:X}=react.useMemo(()=>Lt(z,J),[z,J]),W=react.useRef(null),Z=react.useRef(null),fe=react.useRef(null),be=react.useRef(null),Oe=react.useRef(i),A=!(b.enabled&&b.isPending);react.useEffect(()=>{Oe.current&&Z.current?.focus();},[]),react.useEffect(()=>{!Oe.current||!A||(Oe.current=false,!W.current?.contains(document.activeElement)&&(fe.current??be.current)?.focus());},[A]);let $e=T.data!==null&&T.data!==void 0?{status:"ready",summary:T.data.summary}:T.enabled&&T.isPending?{status:"loading"}:{status:"error"},Ke=o(($,Ee)=>{let V=c?.cancelConsult;if($e.status!=="ready"||!c||!V){D({status:"failed",consultId:$.consultId,message:I.cancelTermsFirst});return}D({status:"submitting",consultId:$.consultId}),V.call(c,$.consultId,Ee).then(Fe=>{Fe.ok?(O(Fe.value),D({status:"idle"})):D({status:"failed",consultId:$.consultId,message:I.cancelFailed}),S(st=>st+1);},()=>D({status:"failed",consultId:$.consultId,message:I.cancelFailed}));},"cancelVisit"),qe=o($=>jsxRuntime.jsx(Ac,{consult:$,petName:We(C,$.petId),nowMs:J,styles:p,cancelling:k.status!=="idle"&&k.consultId===$.consultId?k:null,anyCancelInFlight:k.status==="submitting",terms:$e,onJoin:t,onReschedule:r,onAskCancel:()=>{O(null),D({status:"asking",consultId:$.consultId});},onDismissCancel:()=>D({status:"idle"}),onCancel:Ee=>Ke($,Ee),onRetryTerms:()=>T.refetch()},$.consultId),"renderRow");return jsxRuntime.jsxs("div",{ref:W,style:{...p.screen,...u},"data-testid":"televet-visits",children:[jsxRuntime.jsx("div",{style:l?p.topBar:{...p.topBar,...p.topBarStart},children:l?jsxRuntime.jsx("button",{type:"button",onClick:a,"aria-label":Bc,style:p.iconButton,"data-testid":"televet-visits-close",children:jsxRuntime.jsx(Nc,{})}):jsxRuntime.jsx("button",{type:"button",onClick:a,style:p.textButton,"data-testid":"televet-visits-back",children:Dc})}),x?jsxRuntime.jsxs("div",{role:"status",style:p.notice,"data-testid":"televet-visits-cancel-receipt",children:[jsxRuntime.jsx("p",{style:p.noticeTitle,children:I.cancelledTitle}),x.summary?jsxRuntime.jsx("p",{style:p.note,children:x.summary}):null,jsxRuntime.jsx("p",{style:p.note,children:x.feeRecorded?I.cancellationFeeRecorded:I.cancellationFeeNotRecorded})]}):null,n?jsxRuntime.jsx("section",{style:p.panel,"data-testid":"televet-visits-book-card",children:jsxRuntime.jsxs("div",{style:p.panelBody,children:[jsxRuntime.jsx("p",{style:p.bookTitle,children:I.bookCardTitle}),jsxRuntime.jsx(P,{label:I.bookCardCta,onPress:n,testID:"televet-visits-book"})]})}):null,b.enabled&&b.isPending?jsxRuntime.jsxs("section",{style:p.panel,children:[jsxRuntime.jsx(No,{Title:m,title:I.pastTitle,count:null,styles:p,headingRef:Z}),jsxRuntime.jsx("div",{role:"progressbar","aria-label":I.loading,"aria-busy":"true",style:p.skeletons,"data-testid":"televet-visits-loading",children:[0,1,2].map($=>jsxRuntime.jsx(ge,{height:56},$))})]}):b.isError&&b.data===null?jsxRuntime.jsxs("div",{ref:be,role:"alert",tabIndex:-1,style:{...p.notice,...p.noticeDanger},"data-testid":"televet-visits-error",children:[jsxRuntime.jsx("p",{style:p.noticeTitle,children:I.loadErrorTitle}),jsxRuntime.jsx("p",{style:p.note,"data-testid":"televet-visits-error-body",children:I.loadErrorBody}),jsxRuntime.jsx(P,{label:I.retry,kind:"secondary",fullWidth:false,onPress:()=>b.refetch()})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[N.length>0?jsxRuntime.jsxs("section",{style:p.panel,"data-testid":"televet-visits-upcoming",children:[jsxRuntime.jsx(No,{Title:m,title:I.upcomingTitle,count:N.length,styles:p,headingRef:fe}),jsxRuntime.jsx("ul",{"aria-label":I.upcomingTitle,style:p.list,children:N.map(qe)})]}):null,jsxRuntime.jsxs("section",{style:p.panel,"data-testid":"televet-visits-past",children:[jsxRuntime.jsx(No,{Title:m,title:I.pastTitle,count:X.length,styles:p,...N.length===0?{headingRef:fe}:{}}),z.length===0?jsxRuntime.jsxs("div",{style:p.empty,"data-testid":"televet-visits-empty",children:[jsxRuntime.jsx("p",{style:p.noticeTitle,children:I.emptyTitle}),jsxRuntime.jsx("p",{style:p.note,children:I.emptyBody})]}):X.length===0?null:jsxRuntime.jsx("ul",{"aria-label":I.pastTitle,style:p.list,children:X.map(qe)})]})]})]})}o(Lo,"TelevetVisitsScreen");function No({Title:e,title:t,count:r,styles:n,headingRef:a}){return jsxRuntime.jsxs("div",{style:n.panelHeader,children:[jsxRuntime.jsx(e,{style:n.panelTitle,...a?{ref:a,tabIndex:-1}:{},children:t}),r===null?null:jsxRuntime.jsx("span",{style:n.count,children:r})]})}o(No,"PanelHeader");function Ac({consult:e,petName:t,nowMs:r,styles:n,cancelling:a,anyCancelInFlight:l,terms:s,onJoin:i,onReschedule:d,onAskCancel:u,onDismissCancel:f,onCancel:p,onRetryTerms:m}){let c=wn(e,r),v=ur.has(e.status),S=Ji(e.status),b=Pn(e),T=In(e.status),C=e.consultId,k=react.useId(),D=!c.joinable&&!v;return jsxRuntime.jsxs("li",{style:n.row,"data-testid":`televet-visits-row-${C}`,children:[jsxRuntime.jsxs("div",{style:n.rowHead,children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{style:n.when,children:Yl(e.scheduledAt)}),t?jsxRuntime.jsx("p",{style:n.pet,children:t}):null]}),S?jsxRuntime.jsx("span",{style:c.joinable?{...n.chip,...n.chipPositive}:n.chip,"data-testid":`televet-visits-status-${C}`,children:S}):null]}),jsxRuntime.jsxs("div",{style:n.actions,children:[v?null:jsxRuntime.jsx(P,{label:I.joinCta,fullWidth:false,disabled:!c.joinable,onPress:()=>i(e,t),describedBy:D?k:void 0,testID:`televet-visits-join-${C}`}),T&&d?jsxRuntime.jsx(P,{label:I.rescheduleCta,kind:"secondary",fullWidth:false,onPress:()=>d(e),testID:`televet-visits-reschedule-${C}`}):null,T?jsxRuntime.jsx(P,{label:I.cancelCta,kind:"danger",fullWidth:false,disabled:l,onPress:u,testID:`televet-visits-cancel-${C}`}):null]}),D?jsxRuntime.jsx("p",{id:k,style:n.note,"data-testid":`televet-visits-join-note-${C}`,children:Xi(c.reason,b===null?void 0:Gl(new Date(b).toISOString()))}):null,a?jsxRuntime.jsx(Bo,{terms:s,submitting:a.status==="submitting",failure:a.status==="failed"?a.message:null,onConfirm:p,onDismiss:f,onRetryTerms:m,styles:n}):null]})}o(Ac,"VisitRow");var Bc="Close",Dc="Back";function Nc(){return jsxRuntime.jsx("svg",{"aria-hidden":"true",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",children:jsxRuntime.jsx("path",{d:"M18 6 6 18M6 6l12 12"})})}o(Nc,"CloseGlyph");function Fo(e){let{consult:t,onRescheduled:r,onCancel:n,controller:a,style:l,testID:s}=dt(e,["onRescheduled","onCancel"]),i=L(),d=he(a),u=Dt(t?.clinicianId??null,d),f=Nt(d),p=kn(t?.consultId??null,d),[m,c]=react.useState(null),v=react.useCallback(b=>{c(null),f.mutate(b.slotId,{onSuccess:o(()=>{p.mutate(b.slotId,{onSuccess:o(T=>r?.(T),"onSuccess"),onError:o(T=>c(ze(T).kind==="unavailable"?"unavailable":"failed"),"onError")});},"onSuccess"),onError:o(T=>c(ze(T).kind==="unavailable"?"unavailable":"taken"),"onError")});},[f,p,r]),S=f.isPending||p.isPending;return Ae()?t?jsxRuntime.jsxs("section",{style:{...i.stepFill,...l},"aria-label":y.rescheduleNavTitle,"data-testid":s??"televet-reschedule",children:[jsxRuntime.jsx("p",{style:i.stepHelp,children:Y(y.rescheduleFromTemplate,{when:Te(t.scheduledAt)})}),m==="taken"?jsxRuntime.jsx(q,{message:y.slotTaken}):null,m==="failed"?jsxRuntime.jsx(q,{message:y.rescheduleFailed}):null,m==="unavailable"?jsxRuntime.jsx(q,{message:y.bookingPausedTitle,testID:"televet-reschedule-unavailable"}):null,u.enabled?u.isPending?jsxRuntime.jsx("div",{role:"progressbar","aria-label":y.loading.slots,"aria-busy":"true",style:i.list,"data-testid":"televet-reschedule-slots-loading",children:[0,1,2].map(b=>jsxRuntime.jsx(ge,{height:48},b))}):u.isError?jsxRuntime.jsx(K,{title:y.slotsErrorTitle,actionLabel:y.retryCta,onAction:()=>u.refetch(),testID:"televet-reschedule-slots-error"}):(u.data??[]).length===0?jsxRuntime.jsx("div",{"data-testid":"televet-reschedule-empty",children:jsxRuntime.jsx(K,{title:y.noSlotsTitle})}):jsxRuntime.jsx(qt,{slots:u.data??[],busySlotId:S?f.variables:null,onPick:v,dayGroupLabel:y.summaryWhen,timeGroupLabel:y.rescheduleNavTitle,rowTestIdPrefix:"televet-reschedule-slot",testID:"televet-reschedule-slots"}):jsxRuntime.jsx("div",{"data-testid":"televet-reschedule-paused",children:jsxRuntime.jsx(K,{title:y.bookingPausedTitle})}),jsxRuntime.jsx(P,{label:y.keepExistingCta,kind:"secondary",disabled:S,onPress:()=>n?.(),testID:"televet-reschedule-keep"})]}):jsxRuntime.jsx("div",{role:"progressbar","aria-label":y.loading.consult,"aria-busy":"true",style:{...i.list,...l},"data-testid":"televet-reschedule-loading",children:[0,1].map(b=>jsxRuntime.jsx(ge,{height:48},b))}):jsxRuntime.jsx("div",{style:{...i.stepFill,...l},"data-testid":"televet-reschedule-copy-unapproved"})}o(Fo,"EverfurTelevetReschedule");function Ho(e){let t=e.visitRef?.trim()??"";return t.length>0?Object.freeze({name:"visit",visitRef:t,intent:e.intent??null}):jo}o(Ho,"televetScreenForRequest");var jo=Object.freeze({name:"home"}),Vc=Object.freeze({name:"visits"}),Uc=Object.freeze({name:"booking"});function Wc(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(Wc,"navReducer");function Xa(e){let{style:t,renderPending:r,className:n,...a}=dt(e,["onExit","onBooked","onAddPet","onRequestLocation","onFindEmergencyVet"]);return jsxRuntime.jsx(fl,{capability:"televet",style:t,...n!==void 0?{className:n}:{},...r?{renderPending:r}:{},children:jsxRuntime.jsx($c,{...a,...t!==void 0?{style:t}:{}})})}o(Xa,"EverfurTelevetFlow");function $c({petRef:e,usState:t,controller:r,onBooked:n,onExit:a,onAddPet:l,onPickMedia:s,onAddToCalendar:i,onConfirmDiscard:d,onRequestLocation:u,locationStatus:f,primaryVet:p,onFindEmergencyVet:m,onTriageReason:c,historyMode:v="memory",canJoinInApp:S=false,renderUnavailable:b,initialScreen:T,headingLevel:C,style:k}){let D=L(),[x,O]=react.useReducer(Wc,T??jo,V=>Object.freeze({stack:Object.freeze([V])})),z=x.stack[x.stack.length-1]??jo,j=x.stack.length,J=react.useRef(j),N=j<J.current;react.useEffect(()=>{J.current=j;},[j]);let[X,W]=react.useState(0),Z=react.useCallback(()=>W(V=>V+1),[]),fe=react.useRef(0),be=react.useRef(j);be.current=j,react.useEffect(()=>{if(v!=="browser"||typeof window>"u")return;let V=o(Fe=>{let st=Fe.state?.efTelevet;typeof st=="number"&&st<be.current&&(fe.current=Math.max(0,fe.current-1),O({type:"pop"}));},"onPopState");return window.addEventListener("popstate",V),()=>window.removeEventListener("popstate",V)},[v]);let Oe=react.useCallback(V=>{v==="browser"&&typeof window<"u"&&(fe.current+=1,window.history.pushState({efTelevet:be.current+1},"")),O({type:"push",screen:V});},[v]),A=react.useCallback(()=>{if(v==="browser"&&typeof window<"u"&&fe.current>0){fe.current-=1,window.history.go(-1);return}O({type:"pop"});},[v]),$e=react.useCallback(()=>b?b():jsxRuntime.jsx("div",{style:D.list,"data-testid":"televet-unavailable",children:Ae()?jsxRuntime.jsx(K,{title:y.bookingPausedTitle}):null}),[b,D.list]),Ke=react.useCallback(()=>{j>1?A():a?.();},[j,A,a]),qe=react.useCallback(V=>O({type:"land",screen:V==="visits"?Vc:Uc}),[]),$=jsxRuntime.jsx(Po,{...e!==void 0?{petRef:e}:{},...t!==void 0?{usState:t}:{},...r?{controller:r}:{},onBooked:V=>{Z(),n?.(V);},onExit:Ke,...l?{onAddPet:l}:{},...s?{onPickMedia:s}:{},...i?{onAddToCalendar:i}:{},...d?{onConfirmDiscard:d}:{},...u?{onRequestLocation:u}:{},...f?{locationStatus:f}:{},...p?{primaryVet:p}:{},...m?{onFindEmergencyVet:m}:{},...c?{onTriageReason:c}:{},canJoinInApp:S,renderUnavailable:$e,...C!==void 0?{headingLevel:C}:{},...k?{style:k}:{}}),Ee=jsxRuntime.jsx(Lo,{...r?{controller:r}:{},revision:X,isRoot:j<=1,returnedTo:N,onJoin:(V,Fe)=>Oe({name:"call",consultId:V.consultId,clinicianName:V.clinicianName,petName:Fe}),onReschedule:V=>Oe({name:"reschedule",consult:V}),onBook:()=>Oe({name:"booking"}),onBack:Ke,...k?{style:k}:{}});switch(z.name){case "home":return jsxRuntime.jsx(Kc,{controller:r,onLand:qe,style:k});case "booking":return $;case "visits":case "visit":return Ee;case "reschedule":return jsxRuntime.jsx(Fo,{consult:z.consult,...r?{controller:r}:{},onRescheduled:()=>{Z(),A();},onCancel:()=>A(),...k?{style:k}:{}});case "call":return jsxRuntime.jsx(Oo,{consultId:z.consultId,...r?{controller:r}:{},...z.clinicianName!==void 0?{clinicianName:z.clinicianName}:{},...z.petName!==void 0?{petName:z.petName}:{},onLeave:()=>{Z(),Ke();},...k?{style:k}:{}});default:return rr(z)}}o($c,"TelevetFlowBody");function Kc({controller:e,onLand:t,style:r}){let n=L(),a=he(e),l=Gi(a);return react.useEffect(()=>{l!=="pending"&&t(l);},[l,t]),jsxRuntime.jsxs("div",{role:"progressbar","aria-label":I.loading,"aria-busy":"true",style:{...n.screen,...n.list,...r},"data-testid":"televet-landing-loading",children:[jsxRuntime.jsx(ge,{height:72}),jsxRuntime.jsx(ge,{height:72})]})}o(Kc,"TelevetLandingScreen");var Vo=Xa;var Gc=Object.freeze({escapeAtKeyDown:true});function Jc({request:e,onClose:t,onAddToCalendar:r}){let n=_(),a=react.useMemo(()=>Xc(n),[n]),l=react.useMemo(()=>fa(),[]),s=react.useCallback(()=>{l.dispatch()||t();},[l,t]),{dialogRef:i,onKeyDown:d,onCancel:u}=Nr(true,s,void 0,Gc),f=react.useMemo(()=>Ho(e),[e]);return jsxRuntime.jsx("dialog",{ref:i,onKeyDown:d,onCancel:u,"aria-label":y.visit.title,"data-testid":"everfur-televet-dialog",style:a,children:jsxRuntime.jsx(po.Provider,{value:l,children:jsxRuntime.jsx(Vo,{...e.petRef!==void 0?{petRef:e.petRef}:{},...e.usState!==void 0?{usState:e.usState}:{},initialScreen:f,onExit:t,...r?{onAddToCalendar:r}:{},canJoinInApp:zr(),historyMode:"memory"})})})}o(Jc,"EverfurTelevetDialog");function Xc(e){let{color:t,radius:r,space:n}=e;return {position:"fixed",inset:0,boxSizing:"border-box",width:"100%",maxWidth:640,height:"100%",maxHeight:"100%",margin:"0 auto",padding:`${String(n.lg)}px 0`,border:0,borderRadius:r.lg,display:"flex",flexDirection:"column",overflowY:"auto",backgroundColor:t.surface,color:t.text.primary}}o(Xc,"dialogStyle");exports.BACK_LABEL=Ju;exports.CANCELLATION_POLICY_VERSION_MAX=pr;exports.CANCEL_REASON_MAX=Ve;exports.CONSULT_KINDS=Pi;exports.CONSULT_MINUTES=rt;exports.CONSULT_STATUSES=_i;exports.EverfurTelevet=Vo;exports.EverfurTelevetBooking=Po;exports.EverfurTelevetDialog=Jc;exports.EverfurTelevetFlow=Xa;exports.EverfurTelevetReschedule=Fo;exports.MEDIA_REFS_MAX=fr;exports.NO_MEDIA_SHORTFALL=Vt;exports.REASON_TEXT_MAX=He;exports.TELEVET_BOOKING_BASE=Ue;exports.TELEVET_BOOKING_COPY=ie;exports.TELEVET_BOOKING_COPY_WEB=y;exports.TELEVET_BOOKING_STEPS=zt;exports.TELEVET_CONSULT_PAGE_LIMIT=ji;exports.TELEVET_EMERGENCY_EXITS_WEB=ut;exports.TELEVET_JOIN_CLOSES_MINUTES_AFTER=_n;exports.TELEVET_JOIN_OPENS_MINUTES_BEFORE=Rn;exports.TERMINAL_CONSULT_STATUSES=ur;exports.TelevetBookedScreen=co;exports.TelevetBookingChrome=vo;exports.TelevetCancelVisitForm=Bo;exports.TelevetClinicianEmptyState=aa;exports.TelevetConsentCheckbox=Yt;exports.TelevetDayStrip=To;exports.TelevetEarlyEmergency=la;exports.TelevetEmergencyExits=Wt;exports.TelevetEntitlementInterestState=Nu;exports.TelevetIntakeMedia=bo;exports.TelevetJoinScreen=Oo;exports.TelevetMediaDropNotice=$t;exports.TelevetSlotPicker=qt;exports.TelevetStateInterestAction=lo;exports.TelevetSummaryCard=Co;exports.TelevetSummaryRow=lt;exports.TelevetVisitsScreen=Lo;exports.attestation=Gn;exports.canConfirm=jt;exports.canManageTelevetVisit=In;exports.createTelevetBookingController=mn;exports.currentStep=qn;exports.emptyTelevetDraft=Hl;exports.formatVisitRange=yu;exports.formatWhen=ql;exports.formatWhenWithDay=Te;exports.hasPreviousStep=$n;exports.initialTelevetBookingState=Wn;exports.isHoldExpired=Ir;exports.isMediaShortfallEmpty=Qn;exports.isSkipped=Pr;exports.isTelevetBookingCopyReady=Ae;exports.isWellFormedStateCode=ke;exports.mediaShortfallFromUnsentPicks=Or;exports.parseVetCallCredential=an;exports.splitTelevetVisits=Lt;exports.televetBookingKey=Yn;exports.televetBookingReducer=Kn;exports.televetBookingRefusal=ze;exports.televetCancelCall=zi;exports.televetConsultCalendarKey=pa;exports.televetConsultCall=mr;exports.televetDaysFromSlots=Mr;exports.televetEmptyRosterCause=Xn;exports.televetEmptyRosterView=Jn;exports.televetHoldCall=Li;exports.televetJoinCall=Mi;exports.televetJoinDecision=wn;exports.televetJoinOpensAtMs=Pn;exports.televetMediaShortfallLines=Zn;exports.televetRescheduleCall=Fi;exports.televetScreenForRequest=Ho;exports.useEarlyTriage=ro;exports.useStateInterest=no;exports.useTelevetBookConsult=Cn;exports.useTelevetBookingAvailable=Ed;exports.useTelevetBookingController=he;exports.useTelevetBookingEntitlement=hn;exports.useTelevetCancellationPolicy=Bt;exports.useTelevetClinicians=Tn;exports.useTelevetHoldSlot=Nt;exports.useTelevetJoin=Io;exports.useTelevetNextSlot=Sn;exports.useTelevetRescheduleConsult=kn;exports.useTelevetSlots=Dt;exports.useTelevetStatePolicy=bn;exports.validateBookingBody=Hi;exports.vetCallJoinReason=sn;exports.vetCallJoinRefusal=dn;exports.withUnsentPicks=vu;
1
+ 'use strict';var react=require('react'),jsxRuntime=require('react/jsx-runtime');var Ns=Object.defineProperty;var o=(e,t)=>Ns(e,"name",{value:t,configurable:true});function sr(e){throw new Error(`assertNever: unhandled discriminated-union member ${JSON.stringify(e)}`)}o(sr,"assertNever");function mi(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(mi,"errorFrame");function en(e){let t=globalThis.console;try{t?.error?.("[everfur] A host callback threw; the SDK ignored it.",e);}catch{}}o(en,"reportHostFailure");function Ms(e){return (typeof e=="object"||typeof e=="function")&&e!==null&&typeof e.then=="function"}o(Ms,"isThenable");function dr(e,...t){if(typeof e=="function")try{let r=e(...t);return Ms(r)&&Promise.resolve(r).then(void 0,en),r}catch(r){en(r);return}}o(dr,"callHost");var gi=new WeakMap;function js(e){if(typeof e!="function")return;let t=gi.get(e);if(t!==void 0)return t;let r=o((...n)=>{dr(e,...n);},"guarded");return gi.set(e,r),r}o(js,"guardHost");function yt(e,t){let r=null;for(let n of t){let i=e[n];typeof i=="function"&&(r??={...e},r[n]=js(i));}return r??e}o(yt,"guardHostProps");function ur(e,...t){let r;try{r=e(...t);}catch(n){return en(n),Promise.resolve({ok:false,error:n})}return Promise.resolve(r).then(n=>({ok:true,value:n}),n=>({ok:false,error:n}))}o(ur,"callHostAsync");var g=o(e=>e,"DRAFT"),zs=["[PLACEHOLDER","[PLAN NAME]","[LINK]","[Last]","TODO","TBD"];function Hs(e){return zs.some(t=>e.toUpperCase().includes(t.toUpperCase()))}o(Hs,"isPlaceholderCopy");function W(e,t){let r=e;for(let[n,i]of Object.entries(t))r=r.split(`{${n}}`).join(i);return r}o(W,"fill");var le=Object.freeze({stateBlockedTitle:g("Not available in this state yet"),noCliniciansTitle:g("No vets available right now"),noCliniciansBody:g("Nobody is free in your area at the moment. This changes through the day."),noCliniciansRetryCta:g("Check again"),noCliniciansRegionBody:g("Video visits have to be with a vet licensed in your state, and we don\u2019t have one there yet."),yourVetTitle:g("Your Vet"),reviewsLabel:g("reviews"),rescheduleFromTemplate:g("Moving your visit on {when}"),rescheduleFailed:g("That did not move. Your original time is unchanged."),keepExistingCta:g("Keep my current time"),bookingPausedTitle:g("Booking is not available right now."),slotsErrorTitle:g("Could not load times"),noSlotsTitle:g("No times available"),nextOpeningTemplate:g("Next opening across our vets: {when}"),seeOtherVetsCta:g("See other vets"),retryCta:g("Try again"),holdExpired:g("That time is no longer held. Pick another."),slotTaken:g("That time was just taken. Pick another."),reasonPlaceholder:g("What is going on with your pet?"),reasonTooLong:g("That is too long. Please shorten it."),shareRecordsOff:g("Share health records with this vet"),confirmNotEntitled:g("A Pro membership is needed to book a video visit."),confirmFailed:g("That did not book. Try again."),checkAvailabilityCta:g("Check availability"),stateInterest:Object.freeze({cta:g("Add me to the list"),submitting:g("Adding you to the list\u2026"),joinedTitle:g("You are on the list"),joinedBody:g("We will let you know when this changes."),failed:g("That did not save. Try again.")}),media:Object.freeze({droppedTemplate:g("{n} attachment did not upload."),droppedPluralTemplate:g("{n} attachments did not upload."),refusedSizeTemplate:g("{n} attachment was too large to send."),refusedSizePluralTemplate:g("{n} attachments were too large to send."),refusedTypeTemplate:g("{n} attachment is a file type that cannot be sent."),refusedTypePluralTemplate:g("{n} attachments are file types that cannot be sent."),refusedUnreadableTemplate:g("{n} attachment could not be read."),refusedUnreadablePluralTemplate:g("{n} attachments could not be read.")}),navTitle:g("Book a visit"),rescheduleNavTitle:g("Change your visit"),close:g("Close"),continueCta:g("Continue"),petSelectTitle:g("Who is this visit for?"),addPetCta:g("Add a pet"),locationUnknownTitle:g("We need your location to find a vet"),locationUnknownBody:g("Turn on location for Everfur, then try again."),locationUnknownCta:g("Allow location"),locationBlockedTitle:g("Location is turned off"),locationBlockedBody:g("Everfur needs your location to match you with a vet in your area."),locationBlockedCta:g("Open Settings"),locationUnavailableTitle:g("We could not read your location"),locationUnavailableBody:g("Try again in a moment."),stateAttestTemplate:g("I confirm my pet and I are in {state} right now."),describeHeading:g("Tell the vet what you are seeing"),describeHelpLong:g("A few sentences is plenty. When it started, what changed, anything you've already tried."),addPhotoCta:g("ADD PHOTO OR VIDEO"),removePhotoLabel:g("Remove photo"),summaryPet:g("Pet"),summaryVet:g("Vet"),summaryWhen:g("When"),summaryLength:g("Length"),summaryReason:g("Reason"),summaryLengthTemplate:g("{n} minutes"),confirmCta:g("Confirm visit"),bookedTitle:g("You are booked."),addToCalendarCta:g("Add to calendar"),doneCta:g("Done"),booked:Object.freeze({remindPromise:g("We will notify you 30 minutes before."),summaryPromise:g("{pet}'s summary goes to the vet ahead of the call."),joinPromise:g("Join right here in the app. No links to hunt for."),backToPet:g("Back to {pet}"),calendarAdded:g("Added to your calendar"),calendarFailedBody:g("That did not save to your calendar.")}),chrome:Object.freeze({closeHint:g("Closes without saving"),discardTitle:g("Leave without booking?"),discardBody:g("Your answers will not be saved."),discardConfirmCta:g("Leave"),discardKeepCta:g("Keep going"),noPetsTitle:g("No pets on this account"),loadFailedTitle:g("Could not load"),retryCta:g("Try again")}),emergency:Object.freeze({bannerTitle:g("This cannot wait for a scheduled call."),keepBookingCta:g("I have handled this, keep booking"),lede:g("What you are describing is the kind of thing vets want to see in person, now."),exitPrimaryVetTitle:g("Call {petName}'s primary vet"),exitFindErTitle:g("Find an emergency vet near you"),startCallHint:g("Starts a phone call")}),visit:Object.freeze({title:g("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 vi(e=le){return typeof e=="string"?[e]:typeof e!="object"||e===null?[]:Object.values(e).flatMap(t=>vi(t))}o(vi,"televetBookingCopyValues");function Ne(){return vi().every(e=>e.trim().length>0&&!Hs(e))}o(Ne,"isTelevetBookingCopyReady");var mt=Object.freeze({findEmergencyVet:"Find an emergency vet near you",poisonControl:"ASPCA Animal Poison Control",poisonControlDetail:"(888) 426-4435 \xB7 a fee may apply",poisonControlTel:"tel:+18884264435"}),y=Object.freeze({...le,petSelectTitle:"Who is this visit for?",describeHeading:"Type to the vet what you're seeing",describeHelpLong:"Describe the issues your pet is experiencing",reasonPlaceholder:"She's been scratching her left ear a lot this week...",yourVetTitle:"Which vet would you like to see?",timeHeading:"Pick a date and time",reviewHeading:"Does this look right?",issuesHeadingTemplate:"Select {pet}\u2019s main issues",issuesHint:"Can select more than 1",otherIssue:"Other",bookedHeadingTemplate:"You're booked with {vet}",addToCalendarCta:"Add to Calendar",backLabel:"Back",emergency:Object.freeze({...le.emergency,bannerTitle:"This can't wait for a scheduled call.",lede:"What you're describing is the kind of thing vets want to see in person, now. Please call one of these first.",ledeWithoutExits:le.emergency.lede,keepBookingCta:"I've handled this, continue with booking",exitPrimaryVetTitle:"Call {petName}'s primary vet"})});var tn=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(tn.map(e=>e.wireCode));var Us=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"}),hi=Object.freeze(tn.map(e=>Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:Us[e.wireCode]}))),Ws=new Map(hi.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),$s=Object.freeze(["http_envelope",...[...new Set(hi.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function cr(e,t){if(typeof e!="string")return;let r=e.trim().toUpperCase();if(r.length!==0)for(let n of [t??"http_envelope",...$s]){let i=Ws.get(n+r);if(i)return i}}o(cr,"contractErrorFor");function Ks(e){return e.envelope==="sse_frame"?`/errors#sse-${e.wireCode}`:e.envelope==="oauth_error"?`/errors#oauth-${e.wireCode}`:`/errors#${e.wireCode}`}o(Ks,"contractDocUrl");function Ti(e){return null}o(Ti,"publishedDocUrl");var qs=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 Si(e){return qs[e]}o(Si,"categoryFor");function Ei(e){let t=cr(e);if(t)return t.normalized;let r=(e??"").trim().toUpperCase(),n=r.replace(/[^A-Z0-9]/g,"");if(n==="AUTHREJECTED")return "authRejected";if(r.startsWith("AUTH"))return "authExpired";switch(n){case "DAILYQUOTAEXCEEDED":case "QUOTAEXCEEDED":return "quotaExceeded";case "RATELIMITED":case "TOOMANYREQUESTS":case "TELEVETRATELIMITED":return "rateLimited";case "IDEMPOTENCYKEYCONFLICT":case "IDEMPOTENCYCONFLICT":return "idempotencyConflict";case "ACCESSDENIED":case "FORBIDDEN":return "accessDenied";case "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(Ei,"fromWire");var Ys=new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function rn(e){return Ys.has(e)}o(rn,"isAutoRetryable");var Gs=new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function Ci(e){return rn(e)||Gs.has(e)}o(Ci,"isRetryableCode");var Js=500,nn=8e3,ki=4;function xi(e,t=Math.random){let r=Math.max(0,e),n=Math.min(Js*2**r,nn);return Math.floor(t()*n)}o(xi,"backoffDelayMs");var Xs=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 on(e){return Xs[e]}o(on,"userFacingError");function Ri(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:false,writable:false,configurable:false});}o(Ri,"defineHidden");var Qs=/^[a-z][a-z0-9_]{0,63}$/;function te(e,t){let r=cr(t?.wireCode,t?.wireEnvelope),n={code:e,category:Si(e),retryable:t?.retryable??Ci(e),displayMessage:on(e)};if(t?.httpStatus!==void 0&&(n.httpStatus=t.httpStatus),t?.requestId&&(n.requestId=t.requestId),typeof t?.reasonCode=="string"&&Qs.test(t.reasonCode)&&(n.reasonCode=t.reasonCode),r);return t?.wireMessage&&Ri(n,"wireMessage",t.wireMessage),t?.raw!==void 0&&t.raw!==null&&Ri(n,"raw",t.raw),Object.freeze(n)}o(te,"makeEverfurError");function F(e,t){return Object.freeze(t===void 0?{ok:true,value:e}:{ok:true,value:e,warning:t})}o(F,"ok");function R(e){return Object.freeze({ok:false,error:e})}o(R,"err");var pr=class pr extends Error{constructor(t,r){super(r),this.name="EverfurConfigError",this.kind=t,Object.setPrototypeOf(this,pr.prototype);}};o(pr,"EverfurConfigError");var Bt=pr;function Zs(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(Zs,"authHeaders");function Lt(e,t){return {...e,headers:{...ed(e.headers),...Zs(t)}}}o(Lt,"withAuthHeaders");function ed(e){if(!e)return {};let t={};for(let[r,n]of Object.entries(e)){let i=r.toLowerCase();i==="authorization"||i==="x-everfur-partner-key"||(t[r]=n);}return t}o(ed,"stripAuthHeaders");async function _i(e,t){if(t.mode==="anonymous")return t.transport.request(Lt(e,{mode:"anonymous",publishableKey:t.publishableKey,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));let r;try{r=await t.identity.currentToken();}catch{return R(ln())}let n=await t.transport.request(Lt(e,{mode:"personalized",token:r,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));if(n.ok||n.error.httpStatus!==401)return n;let i;try{i=await t.identity.currentToken({forceRefresh:!0});}catch{return R(ln())}let l=await t.transport.request(Lt(e,{mode:"personalized",token:i,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));return !l.ok&&l.error.httpStatus===401?R(ln(l.error.httpStatus)):l}o(_i,"authedSend");function ln(e){return te("authRejected",{retryable:false,...e!==void 0?{httpStatus:e}:{}})}o(ln,"authRejectedError");function Pi(e){return te("internalError",{retryable:true,wireMessage:td(e)})}o(Pi,"networkError");function td(e){return e instanceof Error?e.message:typeof e=="string"?e:"network request failed"}o(td,"describeCause");var an=3e4,rd=nn*2,nd="idempotency-key",od=new Set(["POST","PUT","PATCH","DELETE"]),id=Object.freeze({onEvent(){}}),ld=Object.freeze({setTimeout:o((e,t)=>setTimeout(e,t),"setTimeout"),clearTimeout:o(e=>clearTimeout(e),"clearTimeout"),now:o(()=>Date.now(),"now")});function ad(e){let t=e.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return t.length===0?null:`efs_${t}`.slice(0,128)}o(ad,"seededIdempotencyKey");function et(e){let t=e.observer??id,r=e.timers??ld,n=e.rng??Math.random,i=e.sleep??((m,c)=>Td(m,r,c)),l=e.maxAttempts??ki,s=e.unaryTimeoutMs??an,a=e.newIdempotencyKey??sn(),d=o(m=>{try{t.onEvent(m);}catch{}},"emit");async function u(m,c,v){let b=v?.maxAttempts,h=Math.max(1,b??l),S=v?.idempotent??od.has(c.method),E=v?.idempotencyKey===void 0?null:ad(v.idempotencyKey),k=S?E??a():null,L=sd(c,k),x=0;for(;;){let A=o(ee=>Object.freeze({call:m,method:c.method,path:c.path,attempt:x,...k?{idempotencyKey:k}:{},...ee}),"stamp");d(A({phase:"attempt"}));let z=bd(s,r),H=hd(z.signal,c.signal),X;try{X=await _i({...L,signal:H.signal},e.auth);}catch(ee){X=R(Pi(ee));}finally{H.dispose(),z.cancel();}if(X.ok)return d(A({phase:"settled",ok:true,reason:"ok"})),X;let D=X.error,G=ud(D,x,{maxAttempts:h,rng:n,now:r.now(),aborted:c.signal?.aborted===true,...b!==void 0?{perCallMaxAttempts:b}:{},...e.errorPolicy!==void 0?{policy:e.errorPolicy}:{}}),q={ok:false,code:D.code,reason:G.reason,...D.httpStatus!==void 0?{httpStatus:D.httpStatus}:{},...D.requestId!==void 0?{requestId:D.requestId}:{}};if(!G.retry)return d(A({phase:"settled",...q})),R(D);if(d(A({phase:"retry",...q,delayMs:G.delayMs})),await i(G.delayMs,c.signal),c.signal?.aborted===true)return d(A({phase:"settled",...q,reason:"aborted"})),R(D);x+=1;}}o(u,"send");async function p(m){return Lt(m,await vd(e.auth))}o(p,"authorize");async function*f(m,c,v){d(Object.freeze({call:m,phase:"stream.open",method:c.method,path:c.path,attempt:0}));try{yield*e.auth.transport.stream(c,v);}catch{yield mi({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:null});}}return o(f,"stream"),Object.freeze({send:u,authorize:p,stream:f})}o(et,"createRequestFunnel");function sd(e,t){let r={};for(let[n,i]of Object.entries(e.headers??{}))n.toLowerCase()!==nd&&(r[n]=i);return t!==null&&(r["Idempotency-Key"]=t),{...e,headers:r}}o(sd,"assembleHeaders");function sn(){let e=0;return ()=>`efk_${Date.now().toString(36)}_${(e++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}o(sn,"defaultIdempotencyKeyFactory");var dd=10;function ud(e,t,r){if(r.aborted)return {retry:false,reason:"aborted"};let n=cd(e);if(n==="quota")return {retry:false,reason:"daily-quota-exhausted"};if(n!=="burst"&&!rn(e.code))return {retry:false,reason:"terminal-code"};let i=n==="burst"?"burst-throttle":"retryable-code";if(o(()=>{if(r.policy===void 0)return false;try{return !r.policy.shouldRetry(e.code,t)}catch{return false}},"policyVetoedRetry")())return {retry:false,reason:"terminal-code"};let s=o(()=>{if(r.policy===void 0)return null;let u;try{u=r.policy.maxAttempts(e.code);}catch{return null}return typeof u!="number"||!Number.isFinite(u)?null:Math.max(1,Math.min(dd,Math.floor(u)))},"policyCeiling"),a=r.perCallMaxAttempts??s()??r.maxAttempts;if(t+1>=a)return {retry:false,reason:"attempts-exhausted"};let d=pd(e,r.now);return d!==null?d>rd?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:i,delayMs:d}:{retry:true,reason:i,delayMs:xi(t,r.rng)}}o(ud,"decideRetry");function cd(e){let t=e.code==="unknown"?Ei(gd(e.raw)):e.code;return t==="quotaExceeded"?"quota":t==="rateLimited"||e.httpStatus===429?"burst":null}o(cd,"throttleKind");function pd(e,t){let r=yd(e.raw);if(r!==null){let i=r-t;return i>0?i:0}let n=fd(e.raw);return n===null?null:Math.round(n*1e3)}o(pd,"retryOverrideMs");function fd(e){for(let t of dn(e)){let r=t.retry_after_seconds;if(typeof r=="number"&&Number.isFinite(r)&&r>=0)return r}return null}o(fd,"findRetryAfterSeconds");function yd(e){for(let t of dn(e)){let r=t.resets_at,n=md(r);if(n!==null)return n}return null}o(yd,"findResetsAt");function dn(e){if(!wi(e))return [];let t=[e];for(let r of ["error","detail"]){let n=e[r];wi(n)&&t.push(n);}return t}o(dn,"candidateScopes");function md(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(md,"parseInstantMs");function gd(e){for(let t of dn(e)){let r=t.code;if(typeof r=="string"&&r.length>0)return r}return null}o(gd,"rawWireCode");function wi(e){return typeof e=="object"&&e!==null}o(wi,"isRecord");async function vd(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(vd,"resolveDeviceAuth");function bd(e,t){let r=new AbortController,n=t.setTimeout(()=>r.abort(),e);return {signal:r.signal,cancel:o(()=>t.clearTimeout(n),"cancel")}}o(bd,"boundedSignal");function hd(e,t){let r=o(()=>{},"noop");if(!t)return {signal:e,dispose:r};let n=new AbortController;if(e.aborted||t.aborted)return n.abort(),{signal:n.signal,dispose:r};let i=o(()=>n.abort(),"onAbort");return e.addEventListener("abort",i,{once:true}),t.addEventListener("abort",i,{once:true}),{signal:n.signal,dispose:o(()=>{e.removeEventListener("abort",i),t.removeEventListener("abort",i);},"dispose")}}o(hd,"mergeSignals");function Td(e,t,r){return e<=0||r?.aborted===true?Promise.resolve():new Promise(n=>{let i=t.setTimeout(()=>{r?.removeEventListener("abort",l),n();},e),l=o(()=>{t.clearTimeout(i),n();},"onAbort");r?.addEventListener("abort",l,{once:true});})}o(Td,"delayAbortable");var Bi="televet_booking_not_live";function fr(e){return te("conflict",{retryable:false,reasonCode:Bi,wireMessage:`the booking was answered with a consult whose status is ${e}, which is not a live visit`})}o(fr,"televetBookingNotLiveError");var un="televet_booking_key_reused",Ii="IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST";function yr(e){return e.httpStatus!==409||e.reasonCode===un||Nt(e)?.code!==Ii?e:te(e.code,{retryable:false,httpStatus:409,...e.requestId!==void 0?{requestId:e.requestId}:{},wireCode:Ii,reasonCode:un,...e.wireMessage!==void 0?{wireMessage:e.wireMessage}:{},raw:e.raw})}o(yr,"foldTelevetBookingKeyReused");function Nt(e){let t=e.raw;if(typeof t!="object"||t===null)return null;let r=t,n=r.detail??r.error;return typeof n=="object"&&n!==null?n:r}o(Nt,"details");function Sd(e){let t=Nt(e)?.categories;return Array.isArray(t)?Object.freeze(t.filter(r=>typeof r=="string")):Object.freeze([])}o(Sd,"categoriesOf");function Oi(e){let t=Nt(e)?.retry_after_seconds;return typeof t=="number"&&Number.isFinite(t)&&t>0?t:null}o(Oi,"retryAfterOf");function Ai(e){let t=e.wireMessage;if(typeof t=="string"&&t.trim().length>0)return t.trim();let r=Nt(e)?.message;return typeof r=="string"&&r.trim().length>0?r.trim():null}o(Ai,"messageOf");function Ed(e){let t=e.reasonCode;if(typeof t=="string"&&t.length>0)return t;let r=Nt(e),n=r?.code??r?.error_code;return typeof n=="string"&&n.length>0?n:null}o(Ed,"codeOf");function Ue(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:Oi(e),message:Ai(e)});if(t===404)return Object.freeze({kind:"unavailable"});switch(Ed(e)){case "televet_rate_limited":return Object.freeze({kind:"rate_limited",retryAfterSeconds:Oi(e),message:Ai(e)});case "televet_emergency_ack_required":return Object.freeze({kind:"emergency",categories:Sd(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 Bi:return Object.freeze({kind:"slot_taken"});case un: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(Ue,"televetBookingRefusal");function Cd(e){try{return new URL(e.trim()).protocol==="https:"}catch{return false}}o(Cd,"isSafeRoomUrl");function kd(e,t){return Cd(e)&&t.trim().length>0}o(kd,"isUsableRoomCredential");function mr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(mr,"isRecord");function cn(e,t){return typeof e=="number"&&Number.isInteger(e)&&e>=t?e:null}o(cn,"wholeNumber");function xd(e){if(!mr(e))return null;let t=cn(e.consult_minutes,1),r=cn(e.auto_end_minutes,0),n=cn(e.warn_before_seconds,0);return t===null||r===null||n===null?null:Object.freeze({consultMinutes:t,autoEndMinutes:r,warnBeforeSeconds:n})}o(xd,"parseCallLimits");function pn(e){if(!mr(e))return null;let t=e.room_url??e.url,r=e.token;if(typeof t!="string"||typeof r!="string"||!kd(t,r))return null;let n=e.recording_notice;return Object.freeze({roomUrl:t.trim(),token:r,recordingNotice:typeof n=="boolean"?n:true,callLimits:xd(e.call_limits)})}o(pn,"parseVetCallCredential");function fn(e){let t=Li(e.raw);return t!==null&&t.length>0?t:null}o(fn,"vetCallJoinReason");function Li(e){if(!mr(e))return null;let t=e.detail??e.error,n=(mr(t)?t:e).reason;return typeof n=="string"?n:null}o(Li,"reasonOf");function yn(e){if(e.httpStatus===404)return "unavailable";let t=Li(e.raw);return t==="too_early"||t==="too_late"||t==="room_not_ready"?t:t!==null&&t.startsWith("status_")?"not_joinable":"unknown"}o(yn,"vetCallJoinRefusal");var Di=["scheduled","in_progress","awaiting_summary","completed","cancelled_owner","cancelled_ops","no_show_owner","no_show_vet"],gr=new Set(["completed","cancelled_owner","cancelled_ops","no_show_owner","no_show_vet"]),Rd=new Set(["scheduled","in_progress","awaiting_summary"]);function vr(e){return Rd.has(e.status)}o(vr,"isLiveConsult");var Fi=["wellness","prescription"],_d=60;function gn(e){let t=Date.parse(e.startsAt),r=Date.parse(e.endsAt);if(Number.isNaN(t)||Number.isNaN(r))return null;let n=Math.round((r-t)/6e4);return n>0?Math.min(n,_d):null}o(gn,"televetSlotMinutes");var br=64,$e=2e3,hr=10;function _e(e){return typeof e=="string"&&/^[A-Za-z]{2}$/.test(e.trim())}o(_e,"isWellFormedStateCode");function De(e){return typeof e=="object"&&e!==null?e:null}o(De,"row");function Q(e){return typeof e=="string"&&e.length>0?e:null}o(Q,"str");function We(e){return typeof e=="string"&&e.trim().length>0?e.trim():null}o(We,"trimmedOrNull");function gt(e,t){return typeof e=="boolean"?e:t}o(gt,"bool");function mn(e){return typeof e=="number"&&Number.isFinite(e)?e:null}o(mn,"num");function Ni(e,t){return typeof t=="string"&&e.includes(t)?t:"unknown"}o(Ni,"closed");function vt(e,t){if(!Array.isArray(e))return Object.freeze([]);let r=[];for(let n of e){let i=t(n);i!==null&&r.push(i);}return Object.freeze(r)}o(vt,"parseList");function Mi(e,t){let r=De(e);return r===null?null:Object.freeze({state:Q(r.state)??t,wellnessAvailable:gt(r.wellness_available,false),prescriptionsAvailable:gt(r.prescriptions_available,false),cancellationPolicyText:We(r.cancellation_policy_text)})}o(Mi,"parseStatePolicy");function ji(e){let t=De(e);if(t===null)return null;let r=We(t.summary),n=We(t.version);return r===null||n===null?null:Object.freeze({summary:r,version:n})}o(ji,"parseCancellationPolicy");function zi(e){let t=De(e);if(t===null)return null;let r=Q(t.clinician_id),n=Q(t.display_name);return r===null||n===null?null:Object.freeze({clinicianId:r,displayName:n,credentials:We(t.credentials_text),rating:mn(t.rating),ratingCount:mn(t.rating_count),bio:We(t.bio),photoRef:Q(t.photo_ref),licensedStates:vt(t.licensed_states,i=>{let l=De(i),s=l===null?null:Q(l.state);return s===null?null:Object.freeze({state:s,canPrescribe:gt(l?.can_prescribe,false)})})})}o(zi,"parseClinician");function vn(e){let t=De(e);if(t===null)return null;let r=Q(t.slot_id),n=Q(t.starts_at);return r===null||n===null?null:Object.freeze({slotId:r,startsAt:n,endsAt:Q(t.ends_at)??n})}o(vn,"parseSlot");function Hi(e){let t=De(e);if(t===null)return null;let r=Q(t.slot_id),n=Q(t.hold_expires_at);return r===null||n===null?null:Object.freeze({slotId:r,expiresAt:n})}o(Hi,"parseSlotHold");function Dt(e){let t=De(e);if(t===null)return null;let r=Q(t.consult_id),n=Q(t.scheduled_at);return r===null||n===null?null:Object.freeze({consultId:r,petId:Q(t.pet_id)??"",clinicianId:Q(t.clinician_id)??"",clinicianName:We(t.display_name),reasonText:We(t.reason_text),mediaRefs:vt(t.media_refs,i=>Q(i)),status:Ni(Di,t.status),kind:Ni(Fi,t.kind),scheduledAt:n,emergencyFlagged:gt(t.emergency_flagged,false),hasRoom:Q(t.meeting_url)!==null})}o(Dt,"parseConsult");function Vi(e){let t=De(e);return Object.freeze({active:gt(t?.active,false)})}o(Vi,"parseBookingEntitlement");var Ke=240;function Ui(e){let t=De(e);if(t===null)return null;let r=mn(t.fee_cents);return r===null||r<0?null:Object.freeze({feeCents:r,currency:Q(t.currency)??"usd",feeRecorded:gt(t.fee_recorded,r>0),summary:We(t.summary)})}o(Ui,"parseCancelReceipt");var qe="/widget/v1/televet",Pd=`${qe}/state-policy`,wd=`${qe}/vets`,Wi=`${qe}/slots`,Id=`${qe}/slots/next`,Tr=`${qe}/consults`,Od=`${qe}/entitlement`,Ad=`${qe}/cancellation-policy`;function $i(e){return `${Wi}/${encodeURIComponent(e)}/hold`}o($i,"televetHoldCall");function Ki(e){return `${Tr}/${encodeURIComponent(e)}/reschedule`}o(Ki,"televetRescheduleCall");function Sr(e){return `${Tr}/${encodeURIComponent(e)}`}o(Sr,"televetConsultCall");function qi(e){return `${Sr(e)}/join`}o(qi,"televetJoinCall");function Yi(e){return `${Sr(e)}/cancel`}o(Yi,"televetCancelCall");var Gi=100;function ce(e){return R(te("validationFailed",{retryable:false,wireMessage:e}))}o(ce,"invalid");function tt(e){return R(te("internalError",{retryable:false,httpStatus:502,wireMessage:e}))}o(tt,"unusable");function bn(e){return e.httpStatus===404}o(bn,"isDark");function bt(e,t,r){try{e?.track(t,r);}catch{}}o(bt,"safeTrack");function Ji(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(!_e(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`:Bd(e)}o(Ji,"validateBookingBody");function Bd(e){let t=e.state_attested===true,r=e.cancellation_policy_version?.trim()??"";return t!==r.length>0?"state_attested and cancellation_policy_version must be sent together or omitted together":r.length>br?`cancellation_policy_version must be at most ${br} characters`:null}o(Bd,"attestationRefusal");function Tn(e){let t=e.funnel??et({auth:e.auth,...e.errorPolicy?{errorPolicy:e.errorPolicy}:{}}),r=e.telemetry;return {async statePolicy(n,i){let l=n.trim();if(!_e(l))return ce("state must be a two-letter US state code");let s=await t.send("televet.booking.state_policy",{method:"GET",path:`${Pd}/${encodeURIComponent(l)}`,...i?{signal:i}:{}});if(!s.ok)return R(s.error);let a=Mi(s.value,l);return a===null?tt("the state policy response was unreadable"):F(a)},async entitlement(n){let i=await t.send("televet.booking.entitlement",{method:"GET",path:Od,...n?{signal:n}:{}});return i.ok?F(Vi(i.value)):R(i.error)},async cancellationPolicy(n){let i=await t.send("televet.booking.cancellation_policy",{method:"GET",path:Ad,...n?{signal:n}:{}});return i.ok?F(ji(i.value)):F(null)},async clinicians(n,i){let l=n.trim();if(!_e(l))return ce("state must be a two-letter US state code");let s=await t.send("televet.booking.clinicians",{method:"GET",path:wd,query:{state:l},...i?{signal:i}:{}});return s.ok?F(vt(hn(s.value,"vets"),zi)):bn(s.error)?F(Object.freeze([])):R(s.error)},async slots(n,i){let l=n.trim();if(l.length===0)return ce("clinicianId is required");let s=await t.send("televet.booking.slots",{method:"GET",path:Wi,query:{clinician_id:l},...i?{signal:i}:{}});return s.ok?F(vt(hn(s.value,"slots"),vn)):bn(s.error)?F(Object.freeze([])):R(s.error)},async nextSlot(n){let i=await t.send("televet.booking.next_slot",{method:"GET",path:Id,...n?{signal:n}:{}});return i.ok?F(vn(Nd(i.value,"slot"))):F(null)},async holdSlot(n){let i=n.trim();if(i.length===0)return ce("slotId is required");let l=await t.send("televet.booking.hold",{method:"POST",path:$i(i)},{idempotent:false,maxAttempts:1});if(!l.ok)return bt(r,"televet.booking.hold_failed",{status:l.error.httpStatus??null}),R(l.error);let s=Hi(l.value);return s===null?tt("the hold response carried no usable expiry"):F(s)},async book(n,i){let l=Ji(n);if(l!==null)return ce(l);let s=i.trim();if(s.length===0)return ce("idempotencyKey is required");let a=await t.send("televet.booking.book",{method:"POST",path:Tr,body:Ld(n)},{idempotent:true,idempotencyKey:s,maxAttempts:1});if(!a.ok)return bt(r,"televet.booking.book_failed",{status:a.error.httpStatus??null}),R(yr(a.error));let d=Dt(a.value);return d===null?tt("the booking response was unreadable"):vr(d)?F(d):(bt(r,"televet.booking.book_failed",{status:null,consult_status:d.status}),R(fr(d.status)))},async reschedule(n,i){let l=n.trim(),s=i.trim();if(l.length===0)return ce("consultId is required");if(s.length===0)return ce("slotId is required");let a=await t.send("televet.booking.reschedule",{method:"POST",path:Ki(l),body:{new_slot_id:s}},{idempotent:false,maxAttempts:1});if(!a.ok)return bt(r,"televet.booking.reschedule_failed",{status:a.error.httpStatus??null}),R(a.error);let d=Dt(a.value);return d===null?tt("the reschedule response was unreadable"):F(d)},async listConsults(n){let i=await t.send("televet.booking.consults",{method:"GET",path:Tr,query:{limit:String(Gi)},...n?{signal:n}:{}});return i.ok?F(vt(hn(i.value,"consults"),Dt)):bn(i.error)?F(Object.freeze([])):R(i.error)},async getConsult(n,i){let l=n.trim();if(l.length===0)return ce("consultId is required");let s=await t.send("televet.booking.consult",{method:"GET",path:Sr(l),...i?{signal:i}:{}});if(!s.ok)return R(s.error);let a=Dt(s.value);return a===null?tt("the consult response was unreadable"):F(a)},async joinConsult(n){let i=n.trim();if(i.length===0)return ce("consultId is required");let l=await t.send("televet.booking.join",{method:"POST",path:qi(i)},{idempotent:false,maxAttempts:1});if(!l.ok)return bt(r,"televet.booking.join_failed",{status:l.error.httpStatus??null}),R(l.error);let s=pn(l.value);return s===null?tt("the join response carried no usable room credential"):F(s)},async cancelConsult(n,i){let l=n.trim(),s=i.trim();if(l.length===0)return ce("consultId is required");if(s.length===0)return ce("reason is required");if(s.length>Ke)return ce(`reason must be at most ${Ke} characters`);let a=await t.send("televet.booking.cancel",{method:"POST",path:Yi(l),body:{reason:s}},{idempotent:false,maxAttempts:1});if(!a.ok)return bt(r,"televet.booking.cancel_failed",{status:a.error.httpStatus??null}),R(a.error);let d=Ui(a.value);return d===null?tt("the cancel response was unreadable"):F(d)}}}o(Tn,"createTelevetBookingController");function Ld(e){let t=e.cancellation_policy_version?.trim()??"",r=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,...r?{state_attested:true,cancellation_policy_version:t}:{}}}o(Ld,"bookingWireBody");function hn(e,t){if(Array.isArray(e))return e;if(typeof e=="object"&&e!==null){let r=e,n=r[t]??r.items??r.data;if(Array.isArray(n))return n}return e}o(hn,"rows");function Nd(e,t){if(typeof e=="object"&&e!==null&&!Array.isArray(e)){let r=e,n=r[t]??r.data;if(typeof n=="object"&&n!==null)return n}return e}o(Nd,"unwrap");var Xi=Symbol.for("@everfur/sdk#EverfurContext@v1"),Qi=globalThis,Zi=Qi[Xi]??(Qi[Xi]=react.createContext(null));Zi.displayName??="EverfurContext";function Te(){let e=react.useContext(Zi);if(e===null)throw new Bt("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return e}o(Te,"useEverfurContext");var Md=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 jd(e){return Md[e]}o(jd,"requires");function el(e,t,r){let n=jd(e),i=new Map;for(let a of t)i.set(a.resource,a);if(r?.isPending===true&&n.some(a=>!i.has(a)))return Sn({name:e,enabled:false,isPending:true,limits:{}});let l=zd(n,i);return n.filter(a=>i.get(a)?.granted!==true).length===0?Sn({name:e,enabled:true,isPending:false,limits:l}):Sn({name:e,enabled:false,isPending:false,limits:l,disabled:Hd(n,i)})}o(el,"decideCapability");function zd(e,t){let r={};for(let n of e){let i=t.get(n)?.limits;if(i)for(let[l,s]of Object.entries(i)){let a=r[l];r[l]=a===void 0?s:Math.min(a,s);}}return r}o(zd,"mergeLimits");function Hd(e,t){for(let r of e){let n=t.get(r)?.disabled;if(n)return Object.freeze({reason:n.reason,level:n.level,recoverable:n.recoverable})}return Object.freeze({reason:on("accessDenied"),level:"user_entitlement",recoverable:false})}o(Hd,"disabledFor");function Sn(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(Sn,"freezeDecision");function Ft(e){let{runtime:t}=Te(),r=t.entitlements,n=react.useSyncExternalStore(r.subscribe,r.getSnapshot,r.getSnapshot);return react.useMemo(()=>el(e,n.decisions,{isPending:n.isPending}),[e,n])}o(Ft,"useCapability");function Se(e){let{runtime:t,userRef:r,scopeEpoch:n}=Te();return react.useMemo(()=>{if(e)return e;if(r===null)return null;let{services:i}=t.registry;return Tn({auth:i.authFor(r),telemetry:i.telemetry,...i.errorPolicy?{errorPolicy:i.errorPolicy}:{}})},[t,r,n,e])}o(Se,"useTelevetBookingController");function Wd(){let{userRef:e}=Te(),t=Ft("televet");return react.useMemo(()=>({available:t.enabled&&e!==null,isPending:t.isPending}),[t.enabled,t.isPending,e])}o(Wd,"useTelevetBookingAvailable");function rt(e,t,r){let[n,i]=react.useState(()=>({key:e,data:null,isPending:t&&r!==null,error:null})),[l,s]=react.useState(0),a=react.useRef(r);a.current=r,react.useEffect(()=>{let p=a.current;if(!t||p===null){i({key:e,data:null,isPending:false,error:null});return}let f=new AbortController,m=true;return i(c=>c.key===e?{...c,isPending:true,error:null}:{key:e,data:null,isPending:true,error:null}),(async()=>{let c;try{c=await p(f.signal);}catch{m&&i({key:e,data:null,isPending:false,error:null});return}m&&(c.ok?i({key:e,data:c.value,isPending:false,error:null}):i({key:e,data:null,isPending:false,error:c.error}));})(),()=>{m=false,f.abort();}},[e,t,l]);let d=react.useCallback(()=>s(p=>p+1),[]),u=n.key===e;return react.useMemo(()=>({enabled:t,data:u?n.data:null,isPending:t&&(!u||n.isPending),isError:u&&n.error!==null,error:u?n.error:null,refetch:d}),[t,u,n.data,n.isPending,n.error,d])}o(rt,"useTelevetRead");function Cn(e,t){let r=e?.trim()??"",n=t?.statePolicy!==void 0&&_e(r),i=t?.statePolicy;return rt(`state-policy:${r}`,n,n&&i?l=>i.call(t,r,l):null)}o(Cn,"useTelevetStatePolicy");function kn(e){let t=e?.entitlement!==void 0,r=e?.entitlement;return rt("entitlement",t,t&&r?n=>r.call(e,n):null)}o(kn,"useTelevetBookingEntitlement");function Mt(e){let t=e?.cancellationPolicy!==void 0,r=e?.cancellationPolicy;return rt("cancellation-policy",t,t&&r?n=>r.call(e,n):null)}o(Mt,"useTelevetCancellationPolicy");function xn(e,t){let r=e?.trim()??"",n=t?.clinicians!==void 0&&_e(r),i=t?.clinicians;return rt(`clinicians:${r}`,n,n&&i?l=>i.call(t,r,l):null)}o(xn,"useTelevetClinicians");function jt(e,t){let r=e?.trim()??"",n=t!==null&&r.length>0;return rt(`slots:${r}`,n,n&&t?i=>t.slots(r,i):null)}o(jt,"useTelevetSlots");function Rn(e){let t=e?.nextSlot!==void 0,r=e?.nextSlot;return rt("next-slot",t,t&&r?n=>r.call(e,n):null)}o(Rn,"useTelevetNextSlot");function _n(e){let[t,r]=react.useState(null),n=react.useRef(true),i=react.useRef(false),l=react.useRef(e);l.current=e,react.useEffect(()=>(n.current=true,()=>{n.current=false;}),[]);let s=react.useCallback((...a)=>{let d=l.current;if(d===null||i.current)return;let u=a[a.length-1],p=typeof u=="object"&&u!==null&&("onSuccess"in u||"onError"in u),f=p?u:void 0,m=p?a.slice(0,-1):a;i.current=true,r({variables:m[0]??null}),(async()=>{let c=null;try{c=await d(...m);}catch{c=null;}i.current=false,n.current&&r(null),c!==null&&(c.ok?f?.onSuccess?.(c.value):f?.onError?.(c.error));})();},[]);return react.useMemo(()=>({isPending:t!==null,variables:t?.variables??null,mutate:s}),[t,s])}o(_n,"useTelevetWrite");function zt(e){return _n(e?t=>e.holdSlot(t):null)}o(zt,"useTelevetHoldSlot");function Pn(e){return _n(e?(t,r)=>e.book(t,r):null)}o(Pn,"useTelevetBookConsult");function wn(e,t){return _n(t&&e?r=>t.reschedule(e,r):null)}o(wn,"useTelevetRescheduleConsult");function kr(e,t=0){let r=e?.listConsults!==void 0,n=e?.listConsults;return rt(`consults:${t}`,r,r&&n?i=>n.call(e,i):null)}o(kr,"useTelevetConsults");function In(e){return e.error!==null&&e.error.httpStatus===404}o(In,"televetReadIsDark");var On=15,An=250,nl=new Set(["scheduled","in_progress"]);function nt(e){let t=Date.parse(e.scheduledAt);return Number.isNaN(t)?null:t}o(nt,"startsAtMs");function Bn(e){let t=nt(e);return t===null?null:t-On*6e4}o(Bn,"televetJoinOpensAtMs");function Ln(e,t){if(!nl.has(e.status))return {joinable:false,reason:`status_${e.status}`};if(!e.hasRoom)return {joinable:false,reason:"room_not_ready"};let r=nt(e);return r===null||t<r-On*6e4?{joinable:false,reason:"too_early"}:t>r+An*6e4?{joinable:false,reason:"too_late"}:{joinable:true}}o(Ln,"televetJoinDecision");function Ht(e,t){let r=[],n=[];for(let i of e){let l=nt(i);(nl.has(i.status)&&l!==null&&l+An*6e4>t?r:n).push(i);}return r.sort((i,l)=>(nt(i)??0)-(nt(l)??0)),n.sort((i,l)=>(nt(l)??0)-(nt(i)??0)),Object.freeze({upcoming:Object.freeze(r),past:Object.freeze(n)})}o(Ht,"splitTelevetVisits");function Nn(e){return e==="scheduled"}o(Nn,"canManageTelevetVisit");function ol(e){let t=kr(e);return t.enabled?t.isPending?"pending":t.isError||Ht(t.data??[],Date.now()).upcoming.length>0?"visits":"booking":"booking"}o(ol,"useTelevetLanding");var I=Object.freeze({bookCardTitle:"Book a video visit",bookCardCta:"Find a time",upcomingTitle:"Upcoming visits",pastTitle:"Past visits",emptyTitle:"No visits yet",emptyBody:"When you book a video visit, it will appear here.",loading:"Loading your visits\u2026",loadErrorTitle:"Could not load your visits",loadErrorBody:"Check your connection and try again.",retry:"Try again",joinCta:"Join visit",joining:"Joining\u2026",rescheduleCta:"Reschedule",cancelCta:"Cancel visit",cancelConfirmTitle:"Cancel this visit?",cancellationReasonLabel:"Why are you cancelling?",cancelConfirmCta:"Cancel visit",cancellingVisit:"Cancelling visit\u2026",cancelDismissCta:"Keep visit",cancelledTitle:"Visit cancelled",cancellationFeeRecorded:"A late cancellation fee was recorded for this visit.",cancellationFeeNotRecorded:"No late cancellation fee was recorded for this visit.",loadingCancellationTerms:"Loading cancellation terms\u2026",cancellationTermsUnavailable:"We could not confirm the current cancellation terms. Try again before continuing.",cancellationReasonMissing:"Tell us why you are cancelling.",cancellationReasonTooLong:o(e=>`Keep the reason to ${String(e)} characters or fewer.`,"cancellationReasonTooLong"),cancelTermsFirst:"We could not confirm the cancellation terms. Please try again before cancelling.",cancelFailed:"We could not cancel this visit. Refresh your visits to confirm its status before trying again."});function il(e){switch(e){case "scheduled":return "Scheduled";case "in_progress":return "In progress";case "awaiting_summary":return "Summary on its way";case "completed":return "Completed";case "cancelled_owner":return "Cancelled by you";case "cancelled_ops":return "Cancelled by Everfur";case "no_show_owner":return "Missed";case "no_show_vet":return "Vet couldn't attend";default:return null}}o(il,"televetVisitStatusWeb");function ll(e,t){if(e==="too_early")return t?`This visit opens at ${t}. You can join from then.`:"This visit has not opened yet.";if(e==="too_late")return "This visit has ended.";if(e==="room_not_ready")return "We are still setting up the video room. Try again in a moment.";switch(e){case "status_cancelled_owner":return "You cancelled this visit.";case "status_cancelled_ops":return "This visit was cancelled. Please book another time.";case "status_no_show_owner":return "This visit was missed.";case "status_no_show_vet":return "The vet could not make this visit. Please book another time.";case "status_awaiting_summary":return "This visit has ended. Your summary is on its way.";case "status_completed":return "This visit has ended.";default:return "This visit cannot be joined right now."}}o(ll,"televetJoinBlockWeb");var Mn=class Mn extends react.Component{constructor(){super(...arguments);this.state={failed:false,key:this.props.resetKey};}static getDerivedStateFromError(){return {failed:true}}static getDerivedStateFromProps(r,n){return Object.is(r.resetKey,n.key)?null:{failed:false,key:r.resetKey}}render(){return this.state.failed?this.props.fallback:this.props.children}};o(Mn,"HostRenderBoundary");var Dn=Mn;function Kd({render:e}){return e()}o(Kd,"RenderHost");function Fn({render:e,fallback:t,resetKey:r}){return react.createElement(Dn,{fallback:t,resetKey:r,children:react.createElement(Kd,{render:e})})}o(Fn,"HostRender");function Hn(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let t of Object.keys(e))Hn(e[t]);}return e}o(Hn,"deepFreeze");var qd=Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3}),dl={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},ul={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},sl={nano:8,small:9,micro:10,tiny:11,caption:12,bodyTight:13,body:14,subtitle:16,heading:18,verdict:24},Yd={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},Gd={regular:"400",medium:"500",bold:"700"},Jd={eyebrow:1,monoWide:.9,headerBrand:-0.42,tight:-0.35},Xd=0,xr="System",Rr="monospace",Qd=["content","heading","control","compact","badge"];function Zd(e){let t={};for(let r of Qd)t[r]=e;return t}o(Zd,"authoredTierSizes");function cl(){return {family:xr,mono:Rr,fontUrl:null,families:{regular:xr,medium:xr,bold:xr,mono:Rr,monoMedium:Rr,monoBold:Rr},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:sl,tierSizes:Zd(sl),lineHeight:Yd,weight:Gd,letterSpacing:Jd,scale:1,maxScale:Xd,scaleCaps:qd}}o(cl,"baseType");var pl={},jn=Object.freeze({standard:Object.freeze([.2,0,0,1]),emphasized:Object.freeze([.2,.8,.2,1]),exit:Object.freeze([.4,0,1,1])});function zn(e){return `cubic-bezier(${e.join(", ")})`}o(zn,"cssCubicBezier");var fl={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:zn(jn.standard),emphasized:zn(jn.emphasized),exit:zn(jn.exit)},reducedMotion:false},eu={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)"},yl=Hn({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:eu,space:dl,radius:ul,type:cl(),motion:fl,slots:pl}),tu={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)"};Hn({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:tu,space:dl,radius:ul,type:cl(),motion:fl,slots:pl});var ml=Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),gl=globalThis,Vn=gl[ml]??(gl[ml]=react.createContext(yl));Vn.displayName??="EverfurThemeContext";function w(){return react.useContext(Vn)}o(w,"useEverfurTheme");var vl=Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});var bl='system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',ou="System";function iu(e){let t=e.trim();return t.length===0||t===ou?bl:`${hl(t)}, ${bl}`}o(iu,"cssFontFamily");function lu(e){let t=e.trim();return t.length===0||t==="monospace"?"ui-monospace, Menlo, Consolas, monospace":`${hl(t)}, ui-monospace, Menlo, Consolas, monospace`}o(lu,"cssMonoFamily");function hl(e){return `"${e.replace(/[\\"]/g,"\\$&")}"`}o(hl,"quote");function T(e,t){let r=e.type,n=r.families[t];return {fontFamily:t==="mono"||t==="monoMedium"||t==="monoBold"?lu(n):iu(n),fontWeight:r.namedFaces[t]?r.weight.regular:r.weight[vl[t]]}}o(T,"faceCss");var ht=Object.freeze({textAlign:"start"});var au=48;function su(e){return e.isPending?"pending":e.enabled?"enabled":"disabled"}o(su,"selectView");function El(e){let{capability:t,children:r,renderDisabled:n,renderPending:i,style:l,className:s}=e,a=Ft(t),d=react.useMemo(()=>su(a),[a]);switch(d){case "enabled":return r;case "pending":return i?jsxRuntime.jsx(Fn,{render:i,fallback:jsxRuntime.jsx(Tl,{capability:t,style:l,className:s})}):jsxRuntime.jsx(Tl,{capability:t,style:l,className:s});case "disabled":return n?jsxRuntime.jsx(Fn,{render:()=>n(a),fallback:jsxRuntime.jsx(Sl,{decision:a,style:l,className:s}),resetKey:a}):jsxRuntime.jsx(Sl,{decision:a,style:l,className:s});default:return sr(d)}}o(El,"CapabilityGate");function Tl({capability:e,style:t,className:r}){let n=w(),i=react.useMemo(()=>Cl(n),[n]);return jsxRuntime.jsx("div",{role:"status","aria-busy":"true","aria-label":`Loading ${e}`,className:r,style:{...i.offstate,...t},children:jsxRuntime.jsx("div",{style:i.skeletonBar})})}o(Tl,"PendingSkeleton");function Sl({decision:e,style:t,className:r}){let n=w(),i=react.useMemo(()=>Cl(n),[n]),l=e.disabled?.reason??"";return jsxRuntime.jsx("div",{className:r,style:{...i.offstate,...t},children:l.length>0?jsxRuntime.jsx("p",{style:i.offstateText,children:l}):null})}o(Sl,"OffState");function Cl(e){let{color:t,space:r,radius:n,type:i}=e;return {offstate:{...ht,boxSizing:"border-box",minHeight:au,display:"flex",flexDirection:"column",justifyContent:"center",padding:`${r.md}px ${r.lg}px`,backgroundColor:t.surfaceCream,borderRadius:n.md,border:`1px solid ${t.brandBorder}`},offstateText:{margin:0,...T(e,"regular"),fontSize:i.size.body,lineHeight:`${Math.round(i.size.body*i.lineHeight.normal)}px`,color:t.text.muted},skeletonBar:{height:r.md,borderRadius:n.xs,backgroundColor:t.brandSofter}}}o(Cl,"makeStyles");function Tt(e){for(let t=0;t<e.length;t+=1){let r=e.charCodeAt(t);if(r>=55296&&r<=56319){let n=e.charCodeAt(t+1);if(!(n>=56320&&n<=57343))return true;t+=1;}else if(r>=56320&&r<=57343)return true}return false}o(Tt,"hasLoneSurrogate");function St(e){return [...e].length}o(St,"serverLength");var kl=Object.freeze({dog:"dog",canine:"dog",k9:"dog",puppy:"dog",cat:"cat",feline:"cat",kitten:"cat"});function xl(e){if(typeof e!="string")return null;let t=e.trim().toLowerCase();return Object.prototype.hasOwnProperty.call(kl,t)?kl[t]:null}o(xl,"canonicalPetSpecies");var Rl=50,du=128,Wn=120,_l=120,uu=2e3,Pl=120,cu=80,Ol=new Set(["male","female","unknown"]),Al=new Set(["day","month","year"]),Bl=new Set(["low","medium","high","athletic"]),Ll=new Set(["indoor","outdoor","both"]),Nl=new Set(["mild","moderate","severe"]),pu=/^(\d{4})-(\d{2})-(\d{2})$/,Dl=[["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"]],Fl=[["allergies","allergies"],["medications","medications"],["supplements","supplements"],["conditions","conditions"]];Object.freeze([...Dl,...Fl].map(([e])=>e));function fu(e){let t=pu.exec(e);if(t===null)return false;let[r,n,i]=[Number(t[1]),Number(t[2]),Number(t[3])],l=new Date(Date.UTC(r,n-1,i));return l.getUTCFullYear()===r&&l.getUTCMonth()===n-1&&l.getUTCDate()===i}o(fu,"isRealDate");var Ut=o(e=>(t,r)=>typeof r=="string"&&e.has(r)?null:`${t} must be one of ${[...e].join(", ")}`,"oneOf"),yu=o((e,t)=>typeof t=="boolean"?null:`${e} must be true or false`,"boolean"),Pr=o((e,t)=>typeof t=="string"&&fu(t)?null:`${e} must be a real date written YYYY-MM-DD`,"date"),we=o((e,t={})=>(r,n)=>{if(typeof n!="string")return `${r} must be a string`;if(Tt(n))return `${r} contains an unpaired surrogate and cannot be encoded`;let i=t.trimmed?n.trim():n;if(t.required&&i.length===0)return `${r} is required and must not be blank`;let l=St(i);return l<=e?null:`${r} is ${l} characters; the server accepts at most ${e}`},"text"),mu={sex:Ut(Ol),spayedNeutered:yu,birthDate:Pr,birthDatePrecision:Ut(Al),activityLevel:Ut(Bl),indoorOutdoor:Ut(Ll),foodBrand:we(Pl),foodType:we(Pl),microchipId:we(cu)},$n=["ref","ref",false,we(du,{required:true,trimmed:true})],Kn=["notes","notes",false,we(uu,{trimmed:true})],wl=[$n,["name","name",true,we(Wn,{required:true,trimmed:true})],["dose","dose",false,we(_l,{trimmed:true})],["frequency","frequency",false,we(_l,{trimmed:true})],["startDate","start_date",false,Pr],["endDate","end_date",false,Pr],Kn],gu={allergies:[$n,["allergen","allergen",true,we(Wn,{required:true,trimmed:true})],["severity","severity",false,Ut(Nl)],Kn],medications:wl,supplements:wl,conditions:[$n,["conditionName","condition_name",true,we(Wn,{required:true,trimmed:true})],["diagnosedDate","diagnosed_date",false,Pr],Kn]};function vu(e,t,r){let n=`${e}[${t}]`;if(typeof r!="object"||r===null||Array.isArray(r))return {error:`${n} must be an object`};let i=r,l={};for(let[d,u,p,f]of gu[e]){let m=i[d];if(m==null){if(p)return {error:`${n}.${d} is required`};m===null&&(l[u]=null);continue}let c=f(`${n}.${d}`,m);if(c!==null)return {error:c};l[u]=m;}let s=l.start_date,a=l.end_date;return typeof s=="string"&&typeof a=="string"&&a<s?{error:`${n}.endDate must not be before startDate`}:{item:l}}o(vu,"itemToWire");function bu(e,t){if(!Array.isArray(t))return {error:`${e} must be an array (send [] to clear it)`};if(t.length>Rl)return {error:`${e} has ${t.length} items; the server accepts at most ${Rl}`};let r=[],n=new Set;for(let i=0;i<t.length;i+=1){let l=vu(e,i,t[i]);if("error"in l)return l;let s=l.item.ref;if(typeof s=="string"){let a=s.trim();if(n.has(a))return {error:`${e}: ref ${JSON.stringify(a)} is used twice; a ref names one item`};n.add(a);}r.push(l.item);}return {items:r}}o(bu,"listToWire");function Ml(e,t){let r=e,n={};for(let[s,a]of Dl){let d=r[s];if(d!==void 0){if(d!==null){let u=mu[s](s,d);if(u!==null)return {error:u}}n[a]=d;}}let i=r.birthDate!==void 0,l=r.birthDatePrecision!==void 0;if(i!==l||i&&r.birthDate===null!=(r.birthDatePrecision===null))return {error:"birthDate and birthDatePrecision must be sent together, both set or both null"};for(let[s,a]of Fl){let d=r[s];if(d===void 0)continue;let u=bu(s,d);if("error"in u)return u;n[a]=u.items;}return Object.keys(n).length>0&&t!==void 0&&xl(t)===null?{error:"health fields need a pet Everfur reads as a dog or a cat (dog, canine, k9, puppy, cat, feline, kitten)"}:{body:n}}o(Ml,"petHealthToWire");var J=o(e=>typeof e=="string"?e:null,"str"),Vt=o((e,t)=>typeof t=="string"&&e.has(t)?t:null,"pick"),hu=o(e=>typeof e=="boolean"?e:null,"bool");function _r(e,t){return Array.isArray(e)?Object.freeze(e.flatMap(r=>{if(typeof r!="object"||r===null||Array.isArray(r))return [];let n=t(r);return n===null?[]:[n]})):Object.freeze([])}o(_r,"itemsFromWire");function Il(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(Il,"medicationFromWire");function jl(e){let t=e.profile_version;return Object.freeze({profileVersion:typeof t=="number"&&Number.isInteger(t)&&t>=0?t:0,sex:Vt(Ol,e.sex),spayedNeutered:hu(e.spayed_neutered),birthDate:J(e.birth_date),birthDatePrecision:Vt(Al,e.birth_date_precision),activityLevel:Vt(Bl,e.activity_level),indoorOutdoor:Vt(Ll,e.indoor_outdoor),foodBrand:J(e.food_brand),foodType:J(e.food_type),microchipId:J(e.microchip_id),allergies:_r(e.allergies,r=>{let n=J(r.allergen);return n===null||n.length===0?null:Object.freeze({ref:J(r.ref),allergen:n,severity:Vt(Nl,r.severity),notes:J(r.notes)})}),medications:_r(e.medications,Il),supplements:_r(e.supplements,Il),conditions:_r(e.conditions,r=>{let n=J(r.condition_name);return n===null||n.length===0?null:Object.freeze({ref:J(r.ref),conditionName:n,diagnosedDate:J(r.diagnosed_date),notes:J(r.notes)})})})}o(jl,"petHealthFromWire");var Vl=100,Ul=50,Wl=100,$l=50,Kl=500,Tu=128,Su=6e4;function Oe(e){return te("validationFailed",{retryable:false,wireMessage:e})}o(Oe,"invalid");function ot(e,t,r){if(typeof t!="string")return Oe(`${e} must be a string`);let n=St(t);return n<=r?null:Oe(`${e} is ${n} characters; the server accepts at most ${r}`)}o(ot,"checkString");function wr(e,t,r){return typeof t=="number"&&Number.isFinite(t)&&t>=0&&t<=r?null:Oe(`${e} must be a finite number between 0 and ${r}`)}o(wr,"outOfRange");function zl(e,t){if(typeof e!="string")return Oe("pet_ref must be a string");if(e.trim().length===0)return Oe("pet_ref must not be blank");if(Tt(e))return Oe("pet_ref contains an unpaired surrogate and cannot be encoded");if(t!=null&&typeof t!="object")return Oe("profile must be an object");let r=[ot("pet_ref",e,Tu)];return t?.name!==void 0&&r.push(ot("name",t.name,Vl)),t?.species!==void 0&&r.push(ot("species",t.species,Ul)),t?.breed!==void 0&&r.push(ot("breed",t.breed,Wl)),t?.ageYears!==void 0&&r.push(wr("age_years",t.ageYears,$l)),t?.weightKg!==void 0&&r.push(wr("weight_kg",t.weightKg,Kl)),r.find(n=>n!==null)??null}o(zl,"validate");function ql(e,t){let r=Ml(e,t);return "error"in r?{error:Oe(r.error)}:r}o(ql,"healthToWire");function Eu(e){if(typeof e!="object"||e===null)return {error:Oe("patch must be an object")};let t=e,r=[["name","name",l=>ot("name",l,Vl)],["species","species",l=>ot("species",l,Ul)],["breed","breed",l=>ot("breed",l,Wl)],["ageYears","age_years",l=>wr("age_years",l,$l)],["weightKg","weight_kg",l=>wr("weight_kg",l,Kl)]],n={};for(let[l,s,a]of r){let d=t[l];if(d!==void 0){if(d!==null){let u=a(d);if(u!==null)return {error:u}}n[s]=d;}}let i=ql(t,t.species);return "error"in i?i:(Object.assign(n,i.body),Object.keys(n).length===0?{error:Oe("patch must change at least one field")}:{body:n})}o(Eu,"patchToWire");function Cu(e){if(e==null)return {body:{}};let t=ql(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(Cu,"toWire");var Ie=o(e=>typeof e=="string"?e:null,"str"),Ir=o(e=>typeof e=="number"&&Number.isFinite(e)?e:null,"num");function Hl(e,t){let r=typeof e=="object"&&e!==null?e:{};return Object.freeze({petRef:Ie(r.pet_ref)??t,name:Ie(r.name),species:Ie(r.species),breed:Ie(r.breed),ageYears:Ir(r.age_years),weightKg:Ir(r.weight_kg)})}o(Hl,"fromWire");function Yl(e){if(typeof e!="object"||e===null)return null;let t=e,r=Ie(t.pet_ref);return r===null||r.length===0?null:Object.freeze({petId:Ie(t.pet_id),petRef:r,name:Ie(t.name),species:Ie(t.species),breed:Ie(t.breed),ageYears:Ir(t.age_years),weightKg:Ir(t.weight_kg),updatedAt:Ie(t.updated_at)})}o(Yl,"widgetPetFromWire");function ku(e){let t=Yl(e);return t===null?null:Object.freeze({...t,...jl(e)})}o(ku,"widgetPetProfileFromWire");function xu(e){let t=Array.isArray(e)?e:typeof e=="object"&&e!==null&&Array.isArray(e.pets)?e.pets:[];return Object.freeze(t.flatMap(r=>{let n=Yl(r);return n===null?[]:[n]}))}o(xu,"petListFromWire");function Gl(e){return Ru(et({auth:e}),et({auth:e,unaryTimeoutMs:Su}))}o(Gl,"createPetsRepository");function Ru(e,t=e){let r=o((i,l)=>l?{...i,signal:l}:i,"withSignal"),n=o(i=>zl(i,void 0)??`/widget/v1/pets/${encodeURIComponent(i)}`,"petPath");return {async list(i){let l=await e.send("pets.list",r({method:"GET",path:"/widget/v1/pets"},i?.signal));return l.ok?F(xu(l.value)):R(l.error)},async registerPet(i,l,s){let a=zl(i,l);if(a!==null)return R(a);let d=Cu(l);if("error"in d)return R(d.error);let p={method:"POST",path:`/widget/v1/pets/${encodeURIComponent(i)}`,body:d.body},f=await e.send("pets.registerPet",s?.signal?{...p,signal:s.signal}:p);return f.ok?F(Hl(f.value,i)):R(f.error)},async updatePet(i,l,s){let a=n(i);if(typeof a!="string")return R(a);let d=Eu(l);if("error"in d)return R(d.error);let u=await e.send("pets.updatePet",r({method:"PATCH",path:a,body:d.body},s?.signal));return u.ok?F(Hl(u.value,i)):R(u.error)},async getPetProfile(i,l){let s=n(i);if(typeof s!="string")return R(s);let a=await e.send("pets.getPetProfile",r({method:"GET",path:`${s}/profile`},l?.signal));if(!a.ok)return R(a.error);let d=ku(a.value);return d===null?R(te("internalError",{retryable:false,httpStatus:502,wireMessage:"the pet profile response carried no pet_ref"})):F(d)},async deletePet(i,l){let s=n(i);if(typeof s!="string")return R(s);let a=await e.send("pets.deletePet",r({method:"DELETE",path:s},l?.signal));return a.ok?F(void 0):R(a.error)},async eraseUserData(i){let l=await t.send("pets.eraseUserData",r({method:"DELETE",path:"/widget/v1/me"},i?.signal),{maxAttempts:1});return l.ok?F(void 0):R(l.error)}}}o(Ru,"createPetsRepositoryOver");function Or(){let{runtime:e,userRef:t,activePet:r,scopeEpoch:n}=Te(),i=react.useMemo(()=>Gl(e.registry.services.authFor(t)),[e,t,n]),[l,s]=react.useState({repository:i,pets:[],loading:true,error:null}),a=l.repository===i?l:{pets:[],loading:true,error:null},d=react.useRef(0),u=react.useCallback(async()=>{let f=++d.current;s(c=>({...c,repository:i,loading:true,error:null,pets:c.repository===i?c.pets:[]}));let m=await i.list();f===d.current&&s(m.ok?{repository:i,pets:m.value,loading:false,error:null}:c=>({repository:i,pets:c.repository===i?c.pets:[],loading:false,error:m.error}));},[i]);react.useEffect(()=>(u(),()=>{d.current+=1;}),[u]);let p=react.useMemo(()=>r===null?null:a.pets.find(f=>f.petRef===r)??null,[r,a.pets]);return react.useMemo(()=>({pets:a.pets,activePet:p,loading:a.loading,error:a.error,refresh:u}),[a.pets,a.loading,a.error,p,u])}o(Or,"useEverfurPets");var Wt=Object.freeze(["pet","issues","reason","clinician","time","review","booked"]),Jl=Object.freeze({petId:null,state:null,clinicianId:null,slot:null,holdExpiresAt:null,shareHealthRecords:false,idempotencyKey:null});function Gn(e,t={}){let r=Object.freeze({...Jl,...t}),n=Yn(0,e);return Object.freeze({index:n,draft:r,furthestIndex:n})}o(Gn,"initialTelevetBookingState");function Ar(e,t){return e==="pet"?t.ownedPetCount<=1:e==="issues"?t.withIssues!==true:false}o(Ar,"isSkipped");function Br(e){return Wt[e]}o(Br,"stepAt");function Yn(e,t){for(let r=e;r<Wt.length;r+=1){let n=Br(r);if(n&&!Ar(n,t))return r}return Wt.length-1}o(Yn,"nextVisible");function Xl(e,t){for(let r=e;r>=0;r-=1){let n=Br(r);if(n&&!Ar(n,t))return r}return null}o(Xl,"previousVisible");function Jn(e,t){return Xl(e.index-1,t)!==null}o(Jn,"hasPreviousStep");function Xn(e,t,r){switch(t.type){case "patch":{let n={...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({...n,slot:null,holdExpiresAt:null,idempotencyKey:null})}):Object.freeze({...e,draft:Object.freeze(n)})}case "next":{let n=Yn(e.index+1,r);return Object.freeze({...e,index:n,furthestIndex:Math.max(e.furthestIndex,n)})}case "back":{if(Br(e.index)==="booked")return e;let n=Xl(e.index-1,r);return n===null?e:Object.freeze({...e,index:n})}case "goTo":{let n=Wt.indexOf(t.step);if(n<0)return e;let i=Ar(t.step,r)?Yn(n,r):n;return Object.freeze({...e,index:i,furthestIndex:Math.max(e.furthestIndex,i)})}default:return e}}o(Xn,"televetBookingReducer");function Qn(e){return Br(e.index)??"pet"}o(Qn,"currentStep");function $t(e,t){let r=t.trim();return !!e.petId&&!!e.clinicianId&&!!e.slot&&_e(e.state)&&r.length>0&&r.length<=$e}o($t,"canConfirm");function Lr(e,t){if(!e.holdExpiresAt)return false;let r=Date.parse(e.holdExpiresAt);return Number.isNaN(r)?false:r<=t}o(Lr,"isHoldExpired");function Ql(e,t,r){return e.slot?.slotId!==t||e.holdExpiresAt===null||e.idempotencyKey===null?false:!Lr(e,r)}o(Ql,"holdsSlot");var Zl=Object.freeze({slot:null,holdExpiresAt:null,idempotencyKey:null}),Ou=sn();function Zn(e){return `televet.book.${Ou()}.${e}`}o(Zn,"televetBookingKey");function eo(e,t,r){let n=r?.version?.trim()??"";return !e||!t||n.length===0?Object.freeze({}):Object.freeze({state_attested:true,cancellation_policy_version:n})}o(eo,"attestation");var Au=Object.freeze([{id:"itchy-skin",label:"Itchy skin and allergies"},{id:"upset-stomach",label:"Upset stomach"},{id:"ear-infections",label:"Ear infections"},{id:"anxiety",label:"Anxiety and behavior"},{id:"parasites",label:"Fleas, ticks, and heartworm"},{id:"joint-pain",label:"Joint pain and mobility"},{id:"eye-issues",label:"Eye issues"},{id:"urinary",label:"Urinary issues"},{id:"surgery-aftercare",label:"Surgery aftercare"},{id:"senior-dog-care",label:"Senior dog care",species:"dog"}]),Bu="other";function Lu(e){let t=e?.trim().toLowerCase()??"";return t.startsWith("dog")?"dog":t.startsWith("cat")?"cat":null}o(Lu,"televetIssueSpecies");function ea(e){let t=Lu(e),r=Au.filter(n=>!n.species||n.species===t).map(({id:n,label:i})=>Object.freeze({id:n,label:i}));return Object.freeze([...r,Object.freeze({id:Bu,label:y.otherIssue})])}o(ea,"televetIssueChips");function ta(e,t){let r=e.filter(i=>i.trim().length>0),n=t.trim();return r.length===0?n:n.length===0?r.join(", "):`${r.join(", ")}
2
+ ${n}`}o(ta,"composeTelevetReason");function Fe(e){let t=new Date(e);return Number.isNaN(t.getTime())?null:t}o(Fe,"parse");function Et(e){let t=Fe(e);return t?t.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"}):""}o(Et,"formatClock");function Nu(e){let t=Fe(e);return t?t.toLocaleDateString(void 0,{month:"long",day:"numeric"}):""}o(Nu,"formatDate");var it=10;function Ct(e){let t=Fe(e);return t?new Intl.DateTimeFormat(void 0,{timeZoneName:"short"}).formatToParts(t).find(n=>n.type==="timeZoneName")?.value??"":""}o(Ct,"formatZone");function Du(e){let t=Fe(e);if(!t)return "";let r=new Date(t.getTime()+it*6e4).toISOString(),n=Ct(e),i=`${Et(e)} - ${Et(r)}`;return n&&n!==""?`${i} ${n}`:i}o(Du,"formatVisitRange");function ra(e){let t=Nu(e),r=[Et(e),Ct(e)].filter(Boolean).join(" ");return [t,r].filter(Boolean).join(", ")}o(ra,"formatWhen");function Ee(e){let t=Fe(e);return t?[t.toLocaleDateString(void 0,{weekday:"short"}),ra(e)].filter(Boolean).join(", "):""}o(Ee,"formatWhenWithDay");function na(e){let t=Fe(e);if(!t)return "";let r=t.toLocaleString(void 0,{weekday:"short",day:"numeric",month:"short",hour:"numeric",minute:"2-digit"}),n=Ct(e);return n?`${r} ${n}`:r}o(na,"formatShortDateTimeWithZone");function oa(e){return [Et(e),Ct(e)].filter(Boolean).join(" ")}o(oa,"formatClockWithZone");function Kt(e){let t=Fe(e);return t?`${t.getFullYear()}-${t.getMonth()+1}-${t.getDate()}`:"unknown"}o(Kt,"localDayKey");function ia(e){let t=Fe(e);return t===null?"":t.toLocaleDateString(void 0,{month:"long"})}o(ia,"formatMonthLabel");function la(e){let t=Fe(e);return t===null?"":t.toLocaleDateString(void 0,{weekday:"long",month:"long",day:"numeric"})}o(la,"formatFullDayLabel");function sa(e){let{draft:t,reasonText:r,book:n,stateAttested:i,termsAttested:l,cancellationPolicy:s,triage:a,goTo:d,releaseSlot:u,setFailure:p,setEmergency:f,setBookedConsult:m,onBooked:c}=e,v=react.useCallback(h=>{if(!$t(t,r)||!t.idempotencyKey)return;if(Lr(t,Date.now())){p("expired"),d("time");return}let S=o(E=>{let k=Ue(E);if(k.kind==="emergency"){f(k.categories);return}if(k.kind==="rate_limited"){p("rate_limited");return}p(k.kind==="not_entitled"?"not_entitled":k.kind==="slot_taken"?"taken":k.kind==="clinician_unavailable"?"clinician_unavailable":k.kind==="unavailable"?"unavailable":"failed"),k.kind==="slot_taken"&&(u(),d("time"));},"refuse");p(null),f(null),n.mutate({pet_id:t.petId,clinician_id:t.clinicianId,slot_id:t.slot.slotId,state:t.state,reason_text:r.trim(),species:null,media_refs:[],emergency_acknowledged:h||a.isAcknowledged(r),share_health_records:t.shareHealthRecords,...eo(i,l,s)},t.idempotencyKey,{onSuccess:o(E=>{if(!vr(E)){S(fr(E.status));return}m(E),d("booked"),c?.(E);},"onSuccess"),onError:o(E=>S(yr(E)),"onError")});},[t,r,n,i,l,s,a,d,u,p,f,m,c]),b=react.useCallback(()=>v(false),[v]);return {submitBooking:v,confirm:b}}o(sa,"useBookingSubmit");function Mu(e){if(e.httpStatus===409)return Object.freeze({failure:"taken"});switch(Ue(e).kind){case "slot_taken":return Object.freeze({failure:"taken"});case "rate_limited":return Object.freeze({failure:"rate_limited"});case "not_entitled":return Object.freeze({failure:"not_entitled"});case "unavailable":return Object.freeze({failure:"unavailable"});default:return Object.freeze({failure:"failed"})}}o(Mu,"televetHoldFailure");function da(e){let{draft:t,hold:r,dispatch:n,setFailure:i,refetchSlots:l}=e;return react.useCallback(s=>{if(i(null),Ql(t,s.slotId,Date.now())){n({type:"next"});return}r.mutate(s.slotId,{onSuccess:o(a=>{n({type:"patch",patch:{slot:s,holdExpiresAt:a.expiresAt,idempotencyKey:Zn(s.slotId)}}),n({type:"next"});},"onSuccess"),onError:o(a=>{let d=Mu(a);i(d.failure),d.failure==="taken"&&l();},"onError")});},[t,r,n,i,l])}o(da,"useSlotHold");function to(e){return Object.freeze(e==="dark"?{title:le.noCliniciansTitle,message:le.noCliniciansBody,retryLabel:le.noCliniciansRetryCta,interestReason:null}:{title:le.noCliniciansTitle,message:le.noCliniciansRegionBody,retryLabel:null,interestReason:"no_licensed_vet"})}o(to,"televetEmptyRosterView");function ro(e){return e?"roster":"dark"}o(ro,"televetEmptyRosterCause");var qt=Object.freeze({failed:0,refused:Object.freeze({size:0,type:0,unreadable:0})});function no(e){let{failed:t,refused:r}=e;return t<=0&&r.size<=0&&r.type<=0&&r.unreadable<=0}o(no,"isMediaShortfallEmpty");function oo(e){let t=o(n=>Number.isFinite(n)&&n>0?Math.floor(n):0,"count"),r=le.media;return [{n:t(e.failed),one:r.droppedTemplate,many:r.droppedPluralTemplate},{n:t(e.refused.size),one:r.refusedSizeTemplate,many:r.refusedSizePluralTemplate},{n:t(e.refused.type),one:r.refusedTypeTemplate,many:r.refusedTypePluralTemplate},{n:t(e.refused.unreadable),one:r.refusedUnreadableTemplate,many:r.refusedUnreadablePluralTemplate}].filter(n=>n.n>0).map(n=>W(n.n===1?n.one:n.many,{n:String(n.n)}))}o(oo,"televetMediaShortfallLines");function Nr(e){let t=Number.isFinite(e)&&e>0?Math.floor(e):0;return t===0?qt:Object.freeze({failed:t,refused:qt.refused})}o(Nr,"mediaShortfallFromUnsentPicks");function ju(e,t){let r=Nr(t);return r.failed===0?e:Object.freeze({failed:e.failed+r.failed,refused:e.refused})}o(ju,"withUnsentPicks");var pe=Object.freeze({title:"Vet test mode (sandbox tenants)",create:"Create a simulated visit for this pet",createLabel:"Create",visitTemplate:"Visit {visitRef}: {status}, scheduled {scheduledAt}.",eventsNote:"Raise one of the visit events that is not a status change, to see what a tap on it opens:",advance:Object.freeze({completed:"Complete it",cancelled:"Cancel it",no_show:"Mark no-show"}),events:Object.freeze({rescheduled:"Rescheduled",reminder:"Reminder (24h)",followup_sent:"Follow-up sent",message_received:"Vet replied",ended:"Ended"}),resultTemplate:"{label}: {result}.",errorTemplate:"{label}: {message}"});var io="/widget/v1/televet/sandbox/visits",zu=128,ua=64,fa=new Set(["booked","cancelled","completed","no_show"]),Hu=new Set(["applied","already_applied","not_applicable"]),ca=new Set(["rescheduled","reminder","followup_sent","message_received","ended"]),pa=new Set(["24h","30m"]);function lt(e){return te("validationFailed",{retryable:false,wireMessage:e})}o(lt,"invalid");function lo(e,t,r){return typeof t!="string"||t.length===0?lt(`${e} is required and must be a non-empty string`):Tt(t)?lt(`${e} contains an unpaired surrogate and cannot be encoded`):St(t)>r?lt(`${e} is longer than ${r} characters`):null}o(lo,"textError");function Vu(e){if(typeof e!="object"||e===null)return null;let{result:t,visit:r}=e;if(typeof t!="string"||!Hu.has(t)||typeof r!="object"||r===null)return null;let{visit_ref:n,pet_ref:i,status:l,scheduled_at:s}=r;return typeof n!="string"||n.length===0||typeof i!="string"||i.length===0||typeof l!="string"||!fa.has(l)||typeof s!="string"||s.length===0?null:Object.freeze({result:t,visit:Object.freeze({visitRef:n,petRef:i,status:l,scheduledAt:s})})}o(Vu,"mapActionResult");function ya(e){let t=e.funnel??et({auth:e.auth,...e.errorPolicy?{errorPolicy:e.errorPolicy}:{}}),r=o(async(n,i,l)=>{let s=await t.send(n,{method:"POST",path:i,body:l},{idempotent:false,maxAttempts:1});if(!s.ok)return R(s.error);let a=Vu(s.value);return a===null?R(te("internalError",{retryable:false})):F(a)},"run");return {createVisit(n){let i=lo("pet_ref",n,zu);return i!==null?Promise.resolve(R(i)):r("televet.sandbox.createVisit",io,{pet_ref:n})},advanceVisit(n,i){let l=lo("visit_ref",n,ua);if(l!==null)return Promise.resolve(R(l));if(typeof i!="string"||!fa.has(i))return Promise.resolve(R(lt("to must be booked, cancelled, completed or no_show")));let s=`${io}/${encodeURIComponent(n)}/advance`;return r("televet.sandbox.advanceVisit",s,{to:i})},simulateVisitEvent(n,i,l){let s=lo("visit_ref",n,ua);if(s!==null)return Promise.resolve(R(s));if(typeof i!="string"||!ca.has(i))return Promise.resolve(R(lt(`event must be one of ${[...ca].join(", ")}`)));if(i==="reminder"){if(typeof l!="string"||!pa.has(l))return Promise.resolve(R(lt(`stage must be one of ${[...pa].join(", ")} for a reminder`)))}else if(l!==void 0)return Promise.resolve(R(lt("stage is only for a reminder")));let a=`${io}/${encodeURIComponent(n)}/simulate`;return r("televet.sandbox.simulateVisitEvent",a,l===void 0?{event:i}:{event:i,stage:l})}}}o(ya,"createVetVisitSandboxController");function ma(){let{runtime:e,userRef:t,scopeEpoch:r}=Te();return react.useMemo(()=>{let{services:n}=e.registry;return ya({auth:n.authFor(t),...n.errorPolicy?{errorPolicy:n.errorPolicy}:{}})},[e,t,r])}o(ma,"useEverfurVetVisitSandbox");function Ku(e,t){return e&&t.enabled&&t.data!==null&&t.data.active===false}o(Ku,"televetOpensSimulator");var qu=o(e=>e.livemode===false,"isSandbox");function Yu(){let e=Te().runtime.entitlements,t=react.useCallback(()=>qu(e.getSnapshot()),[e]);return react.useSyncExternalStore(e.subscribe,t,t)}o(Yu,"useTelevetSandboxTenant");function va(e,t){let r=Ku(Yu(),e);return {simulate:r,fundingRefused:t&&!r}}o(va,"useTelevetSimulatorRoute");function ba(e){let t=ma(),[r,n]=react.useState(null),[i,l]=react.useState(null),[s,a]=react.useState(false),d=react.useRef(false),u=react.useRef(true);react.useEffect(()=>(u.current=true,()=>{u.current=false;}),[]);let p=react.useCallback((b,h,S)=>{d.current||(d.current=true,a(true),h().then(E=>{if(d.current=false,!!u.current){if(a(false),!E.ok){l({tone:"danger",text:W(pe.errorTemplate,{label:b,message:E.error.displayMessage})});return}S&&n(E.value.visit),l({tone:"ok",text:W(pe.resultTemplate,{label:b,result:E.value.result})});}}));},[]),f=react.useCallback(()=>{p(pe.createLabel,()=>t.createVisit(e),true);},[e,p,t]),m=react.useCallback(b=>{r!==null&&p(pe.advance[b],()=>t.advanceVisit(r.visitRef,b),true);},[p,t,r]),c=react.useCallback(b=>{if(r===null)return;let h=b==="reminder"?"24h":void 0;p(pe.events[b],()=>t.simulateVisitEvent(r.visitRef,b,h),false);},[p,t,r]),v=r===null?null:W(pe.visitTemplate,{visitRef:r.visitRef,status:r.status,scheduledAt:r.scheduledAt});return {visit:r,visitLine:v,line:i,busy:s,create:f,advance:m,raise:c}}o(ba,"useTelevetVisitSimulator");var ha=Object.freeze(["completed","cancelled","no_show"]),Ta=Object.freeze(["rescheduled","reminder","followup_sent","message_received","ended"]);function co(e){let[t,r]=react.useState(false),[n,i]=react.useState(false),[l,s]=react.useState(null),a=react.useRef(null),d=react.useRef(null),u=react.useRef(true);react.useEffect(()=>(u.current=true,()=>{u.current=false,d.current?.abort(),d.current=null;}),[]);let p=react.useCallback(()=>{d.current?.abort(),d.current=null,u.current&&i(false);},[]),f=react.useCallback(async h=>{if(d.current!==null)return false;let S=h.trim();if(l!==null&&l===S||!e)return true;let E=a.current!==null&&a.current.reason===S?a.current.emergency:null;if(E===null){let k=new AbortController;d.current=k,i(true);try{let L=await e(S,k.signal);if(k.signal.aborted||!u.current)return !1;L===null?E=!1:(E=L.isEmergency||L.fallback,a.current=Object.freeze({reason:S,emergency:E}));}catch{if(k.signal.aborted||!u.current)return false;E=false;}finally{d.current===k&&(d.current=null,u.current&&i(false));}}return E===true?(r(true),false):true},[l,e]),m=react.useCallback(h=>{s(h.trim()),r(false);},[]),c=react.useCallback(()=>r(false),[]),v=react.useCallback(()=>{p(),a.current=null,s(null),r(false);},[p]),b=react.useCallback(h=>l!==null&&l===h.trim(),[l]);return {open:t,checking:n,check:f,acknowledge:m,close:c,cancel:p,reset:v,isAcknowledged:b}}o(co,"useEarlyTriage");function Zu(e){let t=e?.trim().toUpperCase()??"";return /^[A-Z]{2}$/.test(t)?t:null}o(Zu,"normalizeStateCode");function po(e,t){let r=Zu(e),[n,i]=react.useState(()=>Object.freeze({})),l=react.useRef(0),s=react.useRef(null),a=react.useCallback(d=>{if(!t||r===null)return null;let u=`${r}:${d}`;s.current!==null&&s.current!==u&&(l.current+=1),s.current=u;let p=n[u]??"idle";return {joined:p==="joined",pending:p==="pending",failed:p==="failed",onPress:o(()=>{if(p==="pending"||p==="joined")return;let f=l.current+=1;i(m=>Object.freeze({...m,[u]:"pending"})),(async()=>{let m=false;try{m=await t(r,d);}catch{m=false;}l.current===f&&i(c=>Object.freeze({...c,[u]:m?"joined":"failed"}));})();},"onPress")}},[r,n,t]);return react.useMemo(()=>({actionFor:a}),[a])}o(po,"useStateInterest");var xt=2;function Ea(e){return typeof e!="number"||!Number.isInteger(e)?xt:e<1?1:e>6?6:e}o(Ea,"headingLevel");function Gt(e){return e>=6?6:e+1}o(Gt,"nextHeadingLevel");function ae(e){return `h${String(e)}`}o(ae,"headingTag");var rc=Gt(xt),fo=react.createContext(rc);function ge(){return react.useContext(fo)}o(ge,"useNestedHeadingLevel");function nc(e,t){if(e===void 0)return {};let r={};return e.backgroundColor!==void 0&&(r.backgroundColor=e.backgroundColor),e.borderColor!==void 0&&(r.borderColor=e.borderColor,r.borderWidth=t??1),e.borderRadius!==void 0&&(r.borderRadius=e.borderRadius),r}o(nc,"slotBox");function Ca(e){return e?.textColor===void 0?{}:{color:e.textColor}}o(Ca,"slotText");function ka(e,t){let r=nc(e,t),n={};return r.backgroundColor!==void 0&&(n.backgroundColor=r.backgroundColor),r.borderColor!==void 0&&(n.border=`${r.borderWidth??1}px solid ${r.borderColor}`),r.borderRadius!==void 0&&(n.borderRadius=r.borderRadius),n}o(ka,"slotBoxCss");var se=44;function N(){let e=w();return react.useMemo(()=>ic(e),[e])}o(N,"useBookingStyles");function _({label:e,onPress:t,kind:r="primary",disabled:n=false,loading:i=false,fullWidth:l=true,accessibilityLabel:s,describedBy:a,testID:d,style:u}){let p=N(),f=n||i;return jsxRuntime.jsx("button",{type:"button",onClick:t,disabled:f,"aria-busy":i||void 0,...s&&s!==e?{"aria-label":s}:{},...a?{"aria-describedby":a}:{},"data-testid":d,style:{...p.button,...r==="primary"?p.buttonPrimary:r==="danger"?p.buttonDanger:p.buttonSecondary,...l?p.buttonFull:p.buttonAuto,...f?p.buttonDisabled:null,...u},children:e})}o(_,"TelevetButton");function $({title:e,message:t,actionLabel:r,onAction:n,testID:i}){let l=N(),s=ae(ge()),a=typeof r=="string"&&r.length>0&&typeof n=="function";return jsxRuntime.jsxs("div",{style:l.stateCard,"data-testid":i,children:[jsxRuntime.jsx(s,{style:l.stateTitle,children:e}),t?jsxRuntime.jsx("p",{style:l.stateMessage,children:t}):null,a?jsxRuntime.jsx(_,{label:r,onPress:n,kind:"secondary",fullWidth:false}):null]})}o($,"TelevetStateCard");function ve({height:e,width:t="100%",testID:r}){let n=N();return jsxRuntime.jsx("span",{"aria-hidden":"true","data-testid":r,style:{...n.skeleton,height:e,width:t}})}o(ve,"TelevetSkeletonBlock");function K({message:e,assertive:t=false,testID:r,style:n}){let i=N();return jsxRuntime.jsx("p",{role:t?"alert":"status","data-testid":r,style:{...i.failure,...n},children:e})}o(K,"TelevetFailureLine");function ic(e){let{color:t,space:r,radius:n,type:i,slots:l}=e,{size:s,lineHeight:a}=i,d=o(u=>`${String(u)}px`,"rem");return {screen:{...ht,display:"flex",flexDirection:"column",minHeight:0,flex:"1 1 auto",gap:d(r.md),paddingLeft:d(r.xl),paddingRight:d(r.xl),boxSizing:"border-box"},stepFill:{display:"flex",flexDirection:"column",flex:"1 1 auto",minHeight:0,gap:d(r.md)},list:{display:"flex",flexDirection:"column",gap:d(r.sm)},button:{minHeight:se,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:d(r.sm),paddingLeft:d(r.xl),paddingRight:d(r.xl),paddingTop:d(r.sm),paddingBottom:d(r.sm),borderRadius:d(n.pill),borderStyle:"solid",borderWidth:0,cursor:"pointer",textAlign:"center",...T(e,"medium"),fontSize:d(s.body),lineHeight:String(a.snug),boxSizing:"border-box"},buttonFull:{alignSelf:"stretch",width:"100%"},buttonAuto:{alignSelf:"flex-start",minWidth:se},buttonPrimary:{backgroundColor:t.primary,color:t.onPrimary,...ka(l.primaryButton),...Ca(l.primaryButton)},buttonSecondary:{borderWidth:1,borderColor:t.brandBorder,backgroundColor:"transparent",color:t.brand,...l.primaryButton?.borderRadius===void 0?null:{borderRadius:d(l.primaryButton.borderRadius)},...l.primaryButton?.borderColor===void 0?null:{borderColor:l.primaryButton.borderColor}},buttonDanger:{backgroundColor:t.danger,color:t.onPrimary},buttonDisabled:{opacity:.45,cursor:"not-allowed"},stateCard:{minHeight:140,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:d(r.sm),padding:d(r.lg),borderRadius:d(n.lg),borderStyle:"solid",borderWidth:1,borderColor:t.brandBorder,boxSizing:"border-box"},stateTitle:{margin:0,...T(e,"medium"),color:t.brand,fontSize:d(s.subtitle),lineHeight:String(a.snug)},stateMessage:{margin:0,...T(e,"regular"),color:t.text.metaCool,fontSize:d(s.body),lineHeight:String(a.normal)},skeleton:{display:"block",borderRadius:d(n.md),backgroundColor:t.skeleton,flexShrink:0},failure:{margin:0,...T(e,"regular"),color:t.danger,fontSize:d(s.caption),lineHeight:String(a.normal)},stepTitle:{margin:0,...T(e,"bold"),color:t.brand,fontSize:d(s.verdict),lineHeight:String(a.snug),textAlign:"center"},stepHelp:{margin:0,...T(e,"regular"),color:t.text.metaCool,fontSize:d(s.body),lineHeight:String(a.normal),textAlign:"center"},divider:{height:1,backgroundColor:t.brandBorder,flexShrink:0},scrollRoot:{display:"flex",flexDirection:"column",flex:"1 1 auto",minHeight:0},scrollBody:{flex:"1 1 auto",minHeight:0,overflowY:"auto",overscrollBehavior:"contain"},scrollFooter:{flexShrink:0,paddingTop:d(r.md),paddingBottom:d(r.lg)}}}o(ic,"makeBookingStyles");function Fr({petName:e,primaryVet:t,onFindEmergencyVet:r}){return r?true:t!=null&&(e?.trim()??"").length>0}o(Fr,"hasTelevetEmergencyExit");function Jt({petName:e,primaryVet:t,onFindEmergencyVet:r,testIDPrefix:n}){let i=w(),l=react.useMemo(()=>cc(i),[i]),s=e?.trim()??"",a=`${react.useId()}-primary-vet-hint`;return jsxRuntime.jsxs("div",{style:l.exits,"data-testid":`${n}-exits`,children:[r?jsxRuntime.jsx("button",{type:"button",onClick:()=>{dr(r);},style:{...l.card,...l.cardButton},"data-testid":`${n}-find-vet`,children:jsxRuntime.jsx("span",{style:l.title,children:mt.findEmergencyVet})}):null,null,t!=null&&s.length>0?jsxRuntime.jsx(dc,{petName:s,vet:t,hintId:a,local:l,testIDPrefix:n}):null]})}o(Jt,"TelevetEmergencyExits");function dc({petName:e,vet:t,hintId:r,local:n,testIDPrefix:i}){let l=W(y.emergency.exitPrimaryVetTitle,{petName:e}),s=t.detail?.trim()??"",a=jsxRuntime.jsxs("span",{style:n.text,children:[jsxRuntime.jsx("span",{style:n.title,children:l}),s.length>0?jsxRuntime.jsx("span",{style:n.detail,children:s}):null]});if(!t.dial)return jsxRuntime.jsx("div",{style:n.card,"data-testid":`${i}-primary-vet`,children:a});let d=t.dial;return jsxRuntime.jsxs("button",{type:"button",onClick:()=>{dr(d);},"aria-label":s.length>0?`${l}, ${s}`:l,"aria-describedby":r,style:{...n.card,...n.cardButton},"data-testid":`${i}-primary-vet-call`,children:[a,jsxRuntime.jsx("span",{id:r,style:uc,children:y.emergency.startCallHint})]})}o(dc,"PrimaryVetCard");var uc=Object.freeze({position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0});function cc(e){let{color:t,space:r,radius:n,type:i}=e,{size:l,lineHeight:s}=i;return {exits:{display:"flex",flexDirection:"column",gap:r.sm},card:{display:"flex",alignItems:"center",gap:r.sm,minHeight:se,padding:r.lg,borderRadius:n.md,border:`1px solid ${t.brandBorder}`,background:t.surface,color:t.text.primary,textAlign:"start",textDecoration:"none",boxSizing:"border-box"},cardButton:{width:"100%",cursor:"pointer",font:"inherit",position:"relative"},text:{display:"flex",flexDirection:"column",gap:r.xs,flexShrink:1},title:{...T(e,"medium"),color:t.text.primary,fontSize:l.body,lineHeight:`${String(l.body*s.normal)}px`},detail:{...T(e,"regular"),color:t.text.metaCool,fontSize:l.caption,lineHeight:`${String(l.caption*s.normal)}px`}}}o(cc,"makeExitStyles");function Ra({petName:e,primaryVet:t,onFindEmergencyVet:r,onContinue:n}){let i=w(),l=N(),s=react.useMemo(()=>vo(i),[i]),a=ae(ge()),d=Fr({petName:e,primaryVet:t,onFindEmergencyVet:r})?y.emergency.lede:y.emergency.ledeWithoutExits;return jsxRuntime.jsxs("section",{role:"alert",style:{...l.stepFill,...s.emergencyPanel},"data-testid":"televet-early-emergency",children:[jsxRuntime.jsx(a,{style:s.emergencyTitle,children:y.emergency.bannerTitle}),jsxRuntime.jsx("p",{style:s.emergencyLede,children:d}),jsxRuntime.jsx(Jt,{petName:e,primaryVet:t,onFindEmergencyVet:r,testIDPrefix:"televet-early-emergency"}),jsxRuntime.jsx(_,{label:y.emergency.keepBookingCta,kind:"secondary",onPress:n,testID:"televet-early-emergency-continue"})]})}o(Ra,"TelevetEarlyEmergency");function mo({action:e,testIDPrefix:t}){let r=w(),n=react.useMemo(()=>vo(r),[r]),i=ae(ge());return e===null?null:e.joined?jsxRuntime.jsxs("div",{role:"status","data-testid":`${t}-joined`,style:n.interestFeedback,children:[jsxRuntime.jsx(i,{style:n.interestJoinedTitle,children:y.stateInterest.joinedTitle}),jsxRuntime.jsx("p",{style:n.interestBody,children:y.stateInterest.joinedBody})]}):jsxRuntime.jsxs("div",{"data-testid":t,style:n.interestAction,children:[jsxRuntime.jsx(_,{label:e.pending?y.stateInterest.submitting:y.stateInterest.cta,kind:"secondary",loading:e.pending,disabled:e.pending,onPress:e.onPress,testID:`${t}-submit`}),e.failed?jsxRuntime.jsx(K,{message:y.stateInterest.failed,assertive:true,testID:`${t}-error`}):null]})}o(mo,"TelevetStateInterestAction");function _a({cause:e,onRetry:t,stateInterest:r=null}){let n=to(e);return jsxRuntime.jsxs("div",{"data-testid":"televet-clinicians-empty",children:[jsxRuntime.jsx($,{title:n.title,message:n.message,...n.retryLabel!==null&&t?{actionLabel:n.retryLabel,onAction:t}:{}}),n.interestReason!==null?jsxRuntime.jsx(mo,{action:r??null,testIDPrefix:"televet-state-interest-no-licensed-vet"}):null]})}o(_a,"TelevetClinicianEmptyState");function pc({onCheckAvailability:e}){return jsxRuntime.jsx(go,{...e?{onCheckAvailability:e}:{}})}o(pc,"TelevetEntitlementInterestState");function go({onCheckAvailability:e,renderUnavailable:t}){let r=N();return jsxRuntime.jsxs("div",{"data-testid":"televet-booking-not-entitled",style:r.list,children:[t?t():jsxRuntime.jsx($,{title:y.bookingPausedTitle}),e?jsxRuntime.jsx(_,{label:y.checkAvailabilityCta,kind:"secondary",onPress:e,testID:"televet-check-state-availability"}):null]})}o(go,"EntitlementPausedState");function Xt({shortfall:e,testIDPrefix:t}){let r=w(),n=react.useMemo(()=>vo(r),[r]);if(no(e))return null;let i=oo(e);return i.length===0?null:jsxRuntime.jsx("ul",{role:"status",style:n.mediaNotice,"data-testid":`${t}-media-notice`,children:i.map((l,s)=>jsxRuntime.jsx("li",{style:n.mediaLine,"data-testid":`${t}-media-line-${String(s)}`,children:l},l))})}o(Xt,"TelevetMediaDropNotice");function vo(e){let{color:t,space:r,radius:n,type:i}=e,{size:l,lineHeight:s}=i;return {emergencyPanel:{display:"flex",flexDirection:"column",gap:r.sm,padding:r.lg,borderRadius:n.lg,border:`2px solid ${t.danger}`,background:t.surface},emergencyTitle:{...T(e,"medium"),margin:0,color:t.danger,fontSize:l.heading,lineHeight:`${String(l.heading*s.snug)}px`},emergencyLede:{...T(e,"regular"),margin:0,color:t.text.primary,fontSize:l.subtitle,lineHeight:`${String(l.subtitle*s.normal)}px`},interestAction:{display:"flex",flexDirection:"column",gap:r.sm,marginTop:r.sm},interestFeedback:{display:"flex",flexDirection:"column",gap:r.xs,marginTop:r.sm},interestJoinedTitle:{...T(e,"medium"),margin:0,color:t.brand,fontSize:l.body,lineHeight:`${String(l.body*s.snug)}px`},interestBody:{...T(e,"regular"),margin:0,color:t.text.metaCool,fontSize:l.body,lineHeight:`${String(l.body*s.normal)}px`},mediaNotice:{display:"flex",flexDirection:"column",gap:r.xs,margin:0,padding:0,listStyle:"none"},mediaLine:{...T(e,"regular"),color:t.text.metaCool,fontSize:l.caption,lineHeight:`${String(l.caption*s.normal)}px`}}}o(vo,"makeEdgeStyles");function Pa(e){let{surfaceUnavailable:t,notEntitled:r,policyBlocked:n,triageOpen:i,step:l}=e;return t||r&&l!=="clinician"||n?true:l==="reason"&&i}o(Pa,"televetBookingGateApplies");function wa({state:e,petName:t,primaryVet:r,onFindEmergencyVet:n,stateInterest:i=null,onCheckAvailability:l,onAcknowledgeEmergency:s,renderUnavailable:a}){let d=N(),{surfaceUnavailable:u,notEntitled:p,policyBlocked:f,triageOpen:m,step:c}=e;return u?jsxRuntime.jsx("div",{style:d.stepFill,"data-testid":"televet-booking-unavailable",children:a?a():jsxRuntime.jsx($,{title:y.bookingPausedTitle})}):p&&c!=="clinician"?jsxRuntime.jsx(go,{...l?{onCheckAvailability:l}:{},...a?{renderUnavailable:a}:{}}):f?jsxRuntime.jsxs("div",{"data-testid":"televet-booking-state-blocked",children:[jsxRuntime.jsx($,{title:y.stateBlockedTitle}),jsxRuntime.jsx(mo,{action:i,testIDPrefix:"televet-state-interest-state-blocked"})]}):c==="reason"&&m?jsxRuntime.jsx(Ra,{...t!==void 0?{petName:t}:{},...r?{primaryVet:r}:{},onFindEmergencyVet:n,onContinue:s}):null}o(wa,"TelevetBookingGate");function Ia(e){return e.noState?true:e.isPending||e.isError?false:e.isEmpty||e.notEntitled}o(Ia,"televetClinicianOutcomeApplies");function Oa({state:e,cause:t,locationStatus:r,onRequestLocation:n,onRetry:i,stateInterest:l=null,renderUnavailable:s}){return e.noState?jsxRuntime.jsx("div",{"data-testid":"televet-booking-location-unknown",children:jsxRuntime.jsx($,{title:r==="blocked"?y.locationBlockedTitle:r==="unavailable"?y.locationUnavailableTitle:y.locationUnknownTitle,message:r==="blocked"?y.locationBlockedBody:r==="unavailable"?y.locationUnavailableBody:y.locationUnknownBody,actionLabel:n&&r!=="blocked"?y.locationUnknownCta:void 0,onAction:r==="blocked"?void 0:n})}):e.isEmpty?jsxRuntime.jsx(_a,{cause:t,onRetry:i,stateInterest:l}):jsxRuntime.jsx(go,{...s?{renderUnavailable:s}:{}})}o(Oa,"TelevetClinicianOutcome");function Aa(e){return `televet-consult-${e}`}o(Aa,"televetConsultCalendarKey");function ho({consult:e,petName:t,onDone:r,onAddToCalendar:n,canJoinInApp:i=false,lengthMinutes:l}){let s=w(),a=N(),d=react.useMemo(()=>gc(s),[s]),u=`${react.useId()}-booked-title`,p=ae(ge()),[f,m]=react.useState("idle"),c=o(async()=>{if(!n)return;m("saving");let b=new Date(e.scheduledAt);if(Number.isNaN(b.getTime())){m("failed");return}let h=typeof l=="number"&&Number.isFinite(l)&&l>0?l:it,S=await ur(n,{key:Aa(e.consultId),title:y.visit.title,startDate:b,endDate:new Date(b.getTime()+h*6e4),alarmOffsetMinutes:-30});if(!S.ok){m("failed");return}m(S.value===true?"saved":S.value==="handed-off"?"idle":"failed");},"addToCalendar"),v=[y.booked.remindPromise,W(y.booked.summaryPromise,{pet:t??""}),...i?[y.booked.joinPromise]:[]];return Ne()?jsxRuntime.jsxs("section",{style:d.screen,"aria-labelledby":u,"data-testid":"televet-booked",children:[jsxRuntime.jsx("div",{style:d.header,children:jsxRuntime.jsx(_,{label:y.doneCta,kind:"secondary",fullWidth:false,onPress:r,testID:"televet-booked-done"})}),jsxRuntime.jsx("div",{"aria-hidden":"true",style:d.avatar}),jsxRuntime.jsx(p,{id:u,style:d.title,children:e.clinicianName?W(y.bookedHeadingTemplate,{vet:e.clinicianName}):y.bookedTitle}),jsxRuntime.jsx("p",{style:d.when,children:jsxRuntime.jsx("time",{dateTime:e.scheduledAt,children:Ee(e.scheduledAt)})}),jsxRuntime.jsx("ol",{style:d.steps,"data-testid":"televet-booked-steps",children:v.map((b,h)=>jsxRuntime.jsxs("li",{style:d.step,children:[jsxRuntime.jsx("span",{"aria-hidden":"true",style:d.stepNumber,children:String(h+1)}),jsxRuntime.jsx("span",{style:d.stepText,children:b.trim()})]},b))}),jsxRuntime.jsxs("div",{style:d.actions,children:[n?jsxRuntime.jsx(_,{label:f==="saved"?y.booked.calendarAdded:y.addToCalendarCta,kind:"primary",loading:f==="saving",disabled:f==="saving"||f==="saved",onPress:()=>{c();},testID:"televet-booked-calendar"}):null,f==="failed"?jsxRuntime.jsx("p",{role:"status",style:{...a.failure,...d.calendarNote},"data-testid":"televet-booked-calendar-failed",children:y.booked.calendarFailedBody}):null,jsxRuntime.jsx(_,{label:t?W(y.booked.backToPet,{pet:t}):y.doneCta,kind:"secondary",onPress:r,testID:"televet-booked-back"})]})]}):jsxRuntime.jsx("div",{style:d.screen,"data-testid":"televet-booked-copy-unapproved"})}o(ho,"TelevetBookedScreen");function gc(e){let{color:t,space:r,radius:n,type:i}=e,{size:l,lineHeight:s}=i,a=o(d=>`${String(d)}px`,"rem");return {screen:{display:"flex",flexDirection:"column",flex:"1 1 auto",minHeight:0,gap:a(r.md),paddingLeft:a(r.xl),paddingRight:a(r.xl),boxSizing:"border-box"},header:{display:"flex",justifyContent:"flex-end",paddingBottom:a(r.lg)},avatar:{alignSelf:"center",width:120,height:120,flexShrink:0,borderRadius:"50%",backgroundColor:t.surfaceSubtle,borderStyle:"solid",borderWidth:2,borderColor:t.success,boxSizing:"border-box"},title:{margin:0,textAlign:"center",...T(e,"bold"),color:t.brand,fontSize:a(l.verdict),lineHeight:String(s.tight),letterSpacing:"-0.7px",paddingTop:a(r.lg)},when:{margin:0,textAlign:"center",...T(e,"regular"),color:t.text.metaCool,fontSize:a(l.subtitle),lineHeight:String(s.normal)},steps:{listStyle:"none",margin:0,marginTop:a(r.xl),padding:a(r.lg),borderRadius:a(n.lg),borderStyle:"solid",borderWidth:1,borderColor:t.brandBorder,display:"flex",flexDirection:"column",gap:a(r.lg),boxSizing:"border-box"},step:{display:"flex",flexDirection:"row",alignItems:"flex-start",gap:a(r.md)},stepNumber:{width:26,height:26,flexShrink:0,borderRadius:"50%",backgroundColor:t.primary,display:"inline-flex",alignItems:"center",justifyContent:"center",...T(e,"medium"),color:t.onPrimary,fontSize:a(l.caption),lineHeight:"1"},stepText:{flex:"1 1 auto",minWidth:0,...T(e,"regular"),color:t.brand,fontSize:a(l.body),lineHeight:String(s.normal)},actions:{marginTop:"auto",paddingBottom:a(r.xl),display:"flex",flexDirection:"column",gap:a(r.md)},calendarNote:{textAlign:"center"}}}o(gc,"makeStyles");function Ba(){let e=[];return {register(t){return e=[...e,t],()=>{e=e.filter(r=>r!==t);}},dispatch(){for(let t of [...e].reverse())try{if(t())return !0}catch{}return false}}}o(Ba,"createTelevetBackChannel");var To=react.createContext(null);function Qt(e,t=true){let r=react.useContext(To),n=react.useRef(e);n.current=e,react.useEffect(()=>{if(!(r===null||!t))return r.register(()=>n.current())},[r,t]);}o(Qt,"useTelevetBackChannel");var Pt=Object.freeze({position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0});var La='button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])';function Co(e){return e.tagName==="DIALOG"}o(Co,"isDialogElement");function Sc(e,t){if(t.isDefaultPrevented()||t.nativeEvent.isComposing)return false;let r=t.target;return !(r instanceof Element)||r.closest("dialog")===e}o(Sc,"ownsEscape");function jr(e,t,r,n){let i=n?.escapeAtKeyDown===true,l=react.useRef(null),s=react.useRef(false),a=react.useRef(null),d=react.useRef(r);d.current=r;let u=react.useCallback(()=>{if(!s.current)return;s.current=false;let m=d.current===void 0?a.current:d.current.current;m&&m.isConnected&&m.focus(),(!m||!m.isConnected||document.activeElement===m)&&(a.current=null);},[]);react.useEffect(()=>{if(!e){u();return}let m=l.current;if(!s.current){let v=typeof document>"u"?null:document.activeElement;v!==null&&m!==null&&m.contains(v)||(a.current=v instanceof HTMLElement?v:null);}if(s.current=true,m===null)return;if(!Co(m)){m.contains(document.activeElement)||(m.querySelector(La)??m).focus();return}let c=m;typeof c.showModal=="function"?c.open||c.showModal():c.setAttribute("open","");},[e,u]),react.useEffect(()=>u,[u]),react.useEffect(()=>{let m=l.current;if(!e||m===null||!Co(m))return;let c=m;if(typeof c.showModal!="function")return;let v=null,b=o(S=>{S.target instanceof HTMLElement&&(v=S.target);},"onFocusIn"),h=o(()=>{if(!c.isConnected||c.open)return;let S=v;c.showModal(),S!==null&&S.isConnected&&c.contains(S)&&document.activeElement!==S&&S.focus();},"onNativeClose");return c.addEventListener("focusin",b),c.addEventListener("close",h),()=>{c.removeEventListener("focusin",b),c.removeEventListener("close",h);}},[e]);let p=react.useCallback(m=>{let c=l.current;if(c===null)return;if(m.key==="Escape"&&!Co(c)){m.preventDefault(),m.stopPropagation(),t();return}if(m.key==="Escape"&&i&&Sc(c,m)){m.preventDefault(),t();return}if(m.key!=="Tab")return;let v=Array.from(c.querySelectorAll(La)),b=v[0],h=v[v.length-1];if(!b||!h){m.preventDefault();return}let S=document.activeElement;m.shiftKey&&(S===b||!c.contains(S))?(m.preventDefault(),h.focus()):!m.shiftKey&&(S===h||!c.contains(S))&&(m.preventDefault(),b.focus());},[t,i]),f=react.useCallback(m=>{m.target===m.currentTarget&&(m.preventDefault(),t());},[t]);return {dialogRef:l,onKeyDown:p,onCancel:f}}o(jr,"useModalDialog");var ko=["pet","issues","reason","triage","clinician","time","review","booked"];function xo({step:e,furthestIndex:t,title:r,canGoBack:n,isDirty:i,onBack:l,onClose:s,onConfirmDiscard:a,headingLevel:d=xt,triageOpen:u=false}){let p=w(),f=react.useMemo(()=>Fa(p),[p]),[m,c]=react.useState(false),v=react.useRef(null),h=`${react.useId()}-close-hint`,S=ae(d);react.useEffect(()=>{if(!i||typeof window>"u")return;let x=o(A=>{A.preventDefault(),A.returnValue="";},"onBeforeUnload");return window.addEventListener("beforeunload",x),()=>window.removeEventListener("beforeunload",x)},[i]);let E=react.useCallback(()=>{if(!i){s();return}let x={title:y.chrome.discardTitle,body:y.chrome.discardBody,confirmLabel:y.chrome.discardConfirmCta,keepLabel:y.chrome.discardKeepCta};if(a){Promise.resolve(a(x)).then(A=>{A&&s();},()=>{});return}c(true);},[i,s,a]);Qt(()=>(E(),true));let k=ko.length,L=ko.indexOf(e==="reason"&&u?"triage":e)+1;return jsxRuntime.jsxs("div",{style:f.wrap,children:[jsxRuntime.jsxs("header",{style:f.bar,children:[jsxRuntime.jsx("div",{style:f.side,children:n?jsxRuntime.jsx("button",{type:"button",onClick:l,"data-testid":"televet-booking-back",style:{...f.tap,...f.back},children:y.backLabel}):null}),jsxRuntime.jsx(S,{style:Pt,children:r??y.navTitle}),jsxRuntime.jsxs("div",{style:f.progress,children:[jsxRuntime.jsx("p",{style:Pt,"data-testid":"televet-booking-progress-label",children:W(y.loading.progressTemplate,{step:String(L),total:String(k)})}),jsxRuntime.jsx("div",{"aria-hidden":"true",style:f.segments,"data-testid":"televet-booking-rail",children:ko.map((x,A)=>jsxRuntime.jsx("span",{"data-lit":A<L?"true":"false",style:{...f.segment,...A<L?f.segmentLit:null}},x))})]}),jsxRuntime.jsxs("div",{style:{...f.side,...f.sideRight},children:[jsxRuntime.jsx("button",{type:"button",ref:v,onClick:E,"aria-label":y.close,"aria-describedby":h,"data-testid":"televet-booking-close",style:{...f.tap,...f.closeTap},children:jsxRuntime.jsx("svg",{"aria-hidden":"true",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",children:jsxRuntime.jsx("path",{d:"M18 6 6 18M6 6l12 12"})})}),jsxRuntime.jsx("span",{id:h,style:Pt,children:y.chrome.closeHint})]})]}),m?jsxRuntime.jsx(Rc,{onKeep:()=>c(false),onLeave:()=>{c(false),s();},returnFocusTo:v}):null]})}o(xo,"TelevetBookingChrome");function Rc({onKeep:e,onLeave:t,returnFocusTo:r}){let n=w(),i=react.useMemo(()=>Fa(n),[n]),{dialogRef:l,onKeyDown:s,onCancel:a}=jr(true,e,r),d=react.useId(),u=`${d}-discard-title`,p=`${d}-discard-body`;return jsxRuntime.jsxs("dialog",{ref:l,onKeyDown:s,onCancel:a,"aria-labelledby":u,"aria-describedby":p,"data-testid":"televet-booking-discard",style:i.dialog,children:[jsxRuntime.jsx("h2",{id:u,style:i.dialogTitle,children:y.chrome.discardTitle}),jsxRuntime.jsx("p",{id:p,style:i.dialogBody,children:y.chrome.discardBody}),jsxRuntime.jsxs("div",{style:i.dialogActions,children:[jsxRuntime.jsx(_,{label:y.chrome.discardKeepCta,onPress:e,kind:"primary",fullWidth:false,testID:"televet-booking-discard-keep"}),jsxRuntime.jsx(_,{label:y.chrome.discardConfirmCta,onPress:t,kind:"secondary",fullWidth:false,testID:"televet-booking-discard-leave"})]})]})}o(Rc,"DiscardDialog");var _c="Back";function Fa(e){let{color:t,space:r,radius:n,type:i}=e,{size:l,lineHeight:s}=i,a=o(u=>`${String(u)}px`,"rem"),d={background:"transparent",borderStyle:"none",padding:0,cursor:"pointer"};return {wrap:{backgroundColor:t.surface,flexShrink:0},bar:{display:"flex",flexDirection:"row",alignItems:"center",paddingLeft:a(r.lg),paddingRight:a(r.lg),minHeight:56,boxSizing:"border-box"},side:{width:64,flexShrink:0,display:"flex",alignItems:"center"},sideRight:{justifyContent:"flex-end"},tap:{...d,minHeight:se,minWidth:se,display:"inline-flex",alignItems:"center",justifyContent:"center"},closeTap:{justifyContent:"flex-end",color:t.text.primary},back:{...T(e,"bold"),color:t.brand,fontSize:a(l.body),paddingLeft:a(r.sm),paddingRight:a(r.sm)},progress:{flex:"1 1 auto",minWidth:0,display:"flex",justifyContent:"center"},segments:{display:"flex",alignItems:"center",gap:a(r.xs),width:"100%",maxWidth:480},segment:{display:"block",flex:"1 1 0",height:3,borderRadius:a(n.pill),backgroundColor:t.brandBorder},segmentLit:{backgroundColor:t.success},dialog:{margin:"auto",maxWidth:420,width:"calc(100% - 32px)",boxSizing:"border-box",padding:a(r.lg),borderRadius:a(n.lg),borderStyle:"solid",borderWidth:1,borderColor:t.brandBorder,backgroundColor:t.surface,color:t.text.primary},dialogTitle:{margin:0,...T(e,"medium"),color:t.brand,fontSize:a(l.subtitle),lineHeight:String(s.snug)},dialogBody:{margin:0,paddingTop:a(r.sm),...T(e,"regular"),color:t.text.metaCool,fontSize:a(l.body),lineHeight:String(s.normal)},dialogActions:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:a(r.sm),paddingTop:a(r.lg)}}}o(Fa,"makeStyles");function Ma(e){let t=[],r=Pc(e.ageYears);r!==null&&t.push(`${String(r)} yr${r===1?"":"s"} old`);let n=e.weightKg;typeof n=="number"&&Number.isFinite(n)&&n>0&&t.push(`${String(Math.round(n))} kg`);let i=e.breed?.trim();return i&&t.push(i),t.join(" \xB7 ")}o(Ma,"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 Ro({media:e,onChange:t,onPickMedia:r,listLabel:n}){let i=w(),l=react.useMemo(()=>Bc(i),[i]),s=hr-e.length,[a,d]=react.useState(false);if(!r)return null;let u=o(async()=>{if(!(a||s<=0)){d(true);try{let p=await ur(r,s);if(!p.ok||p.value===null||p.value.length===0)return;let f=new Set(e.map(c=>c.uri)),m=p.value.filter(c=>typeof c?.uri=="string"&&c.uri.length>0&&!f.has(c.uri));if(m.length===0)return;t([...e,...m].slice(0,hr));}finally{d(false);}}},"pick");return jsxRuntime.jsxs("ul",{role:"list","aria-label":n,style:l.row,children:[e.map((p,f)=>jsxRuntime.jsxs("li",{style:l.thumb,children:[jsxRuntime.jsx("img",{src:p.uri,alt:p.filename,style:l.thumbImage}),p.mimeType.startsWith("video/")?jsxRuntime.jsx("span",{"aria-hidden":"true",style:l.videoBadge,"data-testid":`televet-intake-media-video-${String(f)}`,children:Ac}):null,jsxRuntime.jsx("button",{type:"button",onClick:()=>t(e.filter((m,c)=>c!==f)),"aria-label":`${y.removePhotoLabel}: ${p.filename}`,"data-testid":`televet-intake-media-remove-${String(f)}`,style:l.remove,children:jsxRuntime.jsx("span",{"aria-hidden":"true",style:l.removeGlyph,children:Oc})})]},`${p.uri}-${String(f)}`)),s>0?jsxRuntime.jsx("li",{style:l.addItem,children:jsxRuntime.jsx("button",{type:"button",onClick:()=>{u();},disabled:a,"aria-busy":a||void 0,"data-testid":"televet-intake-add-media",style:{...l.dropzone,...a?l.dropzoneBusy:null},children:jsxRuntime.jsx("span",{style:l.dropzoneText,children:y.addPhotoCta})})}):null]})}o(Ro,"TelevetIntakeMedia");var Oc="\xD7",Ac="\u25B6",zr=92;function Bc(e){let{color:t,space:r,radius:n,type:i}=e,{size:l,lineHeight:s}=i,a=o(d=>`${String(d)}px`,"rem");return {row:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"row",flexWrap:"wrap",gap:a(r.md),paddingTop:a(r.sm)},thumb:{position:"relative",width:zr,height:zr,borderRadius:a(n.md),backgroundColor:t.surfaceSubtle},thumbImage:{width:"100%",height:"100%",objectFit:"cover",borderRadius:a(n.md),display:"block"},videoBadge:{position:"absolute",left:6,bottom:6,paddingLeft:6,paddingRight:6,paddingTop:2,paddingBottom:2,borderRadius:a(n.sm),backgroundColor:t.shadow,color:t.text.onBrand,fontSize:a(l.nano),lineHeight:"1"},addItem:{display:"flex"},remove:{position:"absolute",top:-8,right:-8,width:se-16,height:se-16,borderRadius:"50%",borderStyle:"none",backgroundColor:t.text.metaCool,display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:"pointer",padding:0},removeGlyph:{...T(e,"medium"),color:t.surface,fontSize:a(l.subtitle),lineHeight:"1"},dropzone:{width:zr,height:zr,borderRadius:a(n.md),borderWidth:1,borderStyle:"dashed",borderColor:t.brandBorder,backgroundColor:"transparent",display:"inline-flex",alignItems:"center",justifyContent:"center",paddingLeft:a(r.sm),paddingRight:a(r.sm),cursor:"pointer",boxSizing:"border-box"},dropzoneBusy:{opacity:.6,cursor:"progress"},dropzoneText:{...T(e,"mono"),color:t.text.metaCool,fontSize:a(l.nano),lineHeight:String(s.normal),letterSpacing:"0.3px",textAlign:"center"}}}o(Bc,"makeStyles");function Po({slots:e,selectedDayKey:t,onSelectDay:r,groupLabel:n}){let i=w(),l=react.useMemo(()=>Dc(i),[i]),s=react.useMemo(()=>Vr(e),[e]),a=react.useRef(new Map),d=s[0],u=t??d?.key??null,p=react.useRef(null),f=react.useRef(false);react.useEffect(()=>{if(f.current)return;let c=p.current,v=u===null?void 0:a.current.get(u);if(!c||!v||(f.current=true,u===d?.key))return;let b=v.getBoundingClientRect().left-c.getBoundingClientRect().left;c.scrollLeft+=b-(c.clientWidth-v.clientWidth)/2;},[u,d]);let m=react.useCallback(c=>{let v=c.key==="ArrowRight"||c.key==="ArrowDown"?1:c.key==="ArrowLeft"||c.key==="ArrowUp"?-1:0,b=c.key==="Home"?0:c.key==="End"?s.length-1:null;if(v===0&&b===null)return;let h=s.findIndex(k=>k.key===u);if(h<0)return;let S=b??Math.min(s.length-1,Math.max(0,h+v)),E=s[S];E===void 0||E.key===u||(c.preventDefault(),r(E),a.current.get(E.key)?.focus());},[s,u,r]);return d===void 0?null:jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{"aria-hidden":"true",style:l.month,"data-testid":"televet-day-strip-month",children:ia(d.iso)}),jsxRuntime.jsx("div",{ref:p,role:"radiogroup","aria-label":n,onKeyDown:m,style:l.strip,"data-testid":"televet-day-strip",children:s.map(c=>{let v=c.key===u;return jsxRuntime.jsxs("button",{ref:b=>{b?a.current.set(c.key,b):a.current.delete(c.key);},type:"button",role:"radio","aria-checked":v,tabIndex:v?0:-1,onClick:()=>r(c),"aria-label":la(c.iso),"data-testid":`televet-day-${c.key}`,style:{...l.day,...v?l.daySelected:null},children:[jsxRuntime.jsx("span",{"aria-hidden":"true",style:{...l.dayWeekday,...v?l.dayTextSelected:null},children:c.weekday}),jsxRuntime.jsx("span",{"aria-hidden":"true",style:{...l.dayNumber,...v?l.dayTextSelected:null},children:c.dayNumber})]},c.key)})})]})}o(Po,"TelevetDayStrip");function Vr(e){let t=new Map;for(let r of e){let n=Kt(r.startsAt);if(t.has(n))continue;let i=new Date(r.startsAt);Number.isNaN(i.getTime())||t.set(n,Object.freeze({key:n,iso:r.startsAt,weekday:i.toLocaleDateString(void 0,{weekday:"short"}),dayNumber:String(i.getDate())}));}return Object.freeze([...t.values()])}o(Vr,"televetDaysFromSlots");function Dc(e){let{color:t,space:r,radius:n,type:i}=e,{size:l,lineHeight:s}=i,a=o(d=>`${String(d)}px`,"rem");return {month:{margin:0,textAlign:"center",...T(e,"medium"),color:t.brand,fontSize:a(l.subtitle),lineHeight:String(s.snug),paddingBottom:a(r.md)},strip:{display:"flex",flexDirection:"row",gap:a(r.sm),paddingLeft:a(r.xs),paddingRight:a(r.xs),overflowX:"auto",overscrollBehaviorX:"contain",scrollSnapType:"x proximity"},day:{width:52,flexShrink:0,scrollSnapAlign:"center",minHeight:se,paddingTop:a(r.md),paddingBottom:a(r.md),borderRadius:a(n.md),borderStyle:"solid",borderWidth:1,borderColor:t.brandBorder,backgroundColor:"transparent",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2,cursor:"pointer",boxSizing:"border-box"},daySelected:{backgroundColor:t.primary,borderColor:t.primary},dayWeekday:{...T(e,"mono"),color:t.text.secondary,fontSize:a(l.tiny),lineHeight:String(s.tight)},dayNumber:{...T(e,"medium"),color:t.brand,fontSize:a(l.heading),lineHeight:String(s.tight)},dayTextSelected:{color:t.onPrimary}}}o(Dc,"makeStyles");function Zt({slots:e,busySlotId:t,onPick:r,selectedSlot:n=null,header:i,dayGroupLabel:l,timeGroupLabel:s,rowTestIdPrefix:a="televet-slot",testID:d="televet-slot-list"}){let u=w(),p=react.useMemo(()=>zc(u),[u]),f=react.useMemo(()=>Vr(e),[e]),m=`${react.useId()}-zone`,[c,v]=react.useState(null),b=n?Kt(n.startsAt):null,h=jc(f,[c,b])??f[0]?.key??null,S=react.useMemo(()=>h?e.filter(x=>Kt(x.startsAt)===h):[],[e,h]),E=S[0],k=t!==null,L=E?Ct(E.startsAt):null;return jsxRuntime.jsxs("div",{style:p.root,"data-testid":d,children:[i,jsxRuntime.jsx(Po,{slots:e,selectedDayKey:h,onSelectDay:x=>v(x.key),groupLabel:l}),L?jsxRuntime.jsx("p",{id:m,style:p.zone,"data-testid":"televet-slot-zone",children:L}):null,jsxRuntime.jsx("div",{style:p.gridScroll,children:jsxRuntime.jsx("ul",{role:"list","aria-label":s,...L?{"aria-describedby":m}:{},"aria-busy":k||void 0,style:p.grid,children:S.map(x=>{let A=t===x.slotId;return jsxRuntime.jsx("li",{style:p.gridItem,children:jsxRuntime.jsx("button",{type:"button",onClick:()=>r(x),disabled:k,"aria-busy":A||void 0,"aria-label":Ee(x.startsAt),"data-testid":`${a}-${x.slotId}`,style:{...p.chip,...A?p.chipBusy:null,...k&&!A?p.chipDisabled:null},children:jsxRuntime.jsx("span",{"aria-hidden":"true",style:{...p.chipLabel,...A?p.chipLabelBusy:null},children:Et(x.startsAt)})})},x.slotId)})})})]})}o(Zt,"TelevetSlotPicker");function jc(e,t){for(let r of t)if(r!==null&&e.some(n=>n.key===r))return r;return null}o(jc,"firstOffered");function zc(e){let{color:t,space:r,radius:n,type:i}=e,{size:l,lineHeight:s}=i,a=o(d=>`${String(d)}px`,"rem");return {root:{display:"flex",flexDirection:"column",flex:"1 1 auto",minHeight:0},gridScroll:{flex:"1 1 auto",minHeight:0,overflowY:"auto",overscrollBehavior:"contain"},zone:{margin:0,textAlign:"center",...T(e,"mono"),color:t.text.secondary,fontSize:a(l.tiny),lineHeight:String(s.normal),letterSpacing:"0.4px",paddingTop:a(r.md),paddingBottom:a(r.md)},grid:{listStyle:"none",margin:0,padding:0,paddingBottom:a(r.xl),display:"flex",flexDirection:"row",flexWrap:"wrap",gap:a(r.md)},gridItem:{display:"flex",flexGrow:1,flexBasis:"28%",minWidth:96},chip:{width:"100%",minHeight:48,borderRadius:a(n.pill),borderStyle:"solid",borderWidth:1,borderColor:t.brandBorder,backgroundColor:"transparent",display:"inline-flex",alignItems:"center",justifyContent:"center",paddingLeft:a(r.md),paddingRight:a(r.md),cursor:"pointer",boxSizing:"border-box"},chipBusy:{backgroundColor:t.primary,borderColor:t.primary},chipDisabled:{opacity:.45,cursor:"not-allowed"},chipLabel:{...T(e,"regular"),color:t.brand,fontSize:a(l.subtitle),lineHeight:String(s.tight)},chipLabelBusy:{color:t.onPrimary}}}o(zc,"makeStyles");function Be(e){let{color:t,space:r,radius:n,type:i}=e,{size:l,lineHeight:s}=i,a=o(d=>`${String(d)}px`,"rem");return {marker:{minHeight:1},chipRow:{display:"flex",flexWrap:"wrap",justifyContent:"center",gap:a(r.sm)},chip:{minHeight:44,padding:`${a(r.sm)} ${a(r.lg)}`,borderRadius:a(n.pill),borderStyle:"solid",borderWidth:1,borderColor:t.brand,backgroundColor:t.surface,color:t.brand,cursor:"pointer",...T(e,"regular"),fontSize:a(l.body),lineHeight:String(s.snug)},chipOn:{borderColor:t.accent,backgroundColor:t.accent,color:t.onAccent,...T(e,"bold")},stepScroll:{paddingBottom:a(r.md)},visuallyHiddenHeading:{position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0},petRow:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",gap:a(r.sm),minHeight:64,paddingLeft:a(r.md),paddingRight:a(r.md),paddingTop:a(r.sm),paddingBottom:a(r.sm),borderRadius:a(n.pill),borderStyle:"solid",borderWidth:1,borderColor:t.brandBorder,backgroundColor:"transparent",textAlign:"left",cursor:"pointer",boxSizing:"border-box"},petRowSelected:{borderColor:t.primary},petDisc:{width:28,height:28,flexShrink:0,borderRadius:"50%",backgroundColor:t.surfaceSubtle,display:"inline-flex",alignItems:"center",justifyContent:"center",...T(e,"medium"),color:t.brand,fontSize:a(l.caption),lineHeight:"1"},petRowText:{display:"flex",flexDirection:"column",minWidth:0,gap:2},petRowName:{...T(e,"medium"),color:t.brand,fontSize:a(l.body),lineHeight:String(s.snug),overflowWrap:"anywhere"},petRowMeta:{...T(e,"regular"),color:t.text.metaCool,fontSize:a(l.caption),lineHeight:String(s.normal),overflowWrap:"anywhere"},vetRow:{display:"flex",flexDirection:"row",alignItems:"center",gap:a(r.md)},vetAvatar:{width:64,height:64,flexShrink:0,borderRadius:"50%",backgroundColor:t.surfaceSubtle,display:"inline-flex",alignItems:"center",justifyContent:"center",...T(e,"medium"),color:t.brand,fontSize:a(l.heading),lineHeight:"1"},vetIdentity:{display:"flex",flexDirection:"column",flex:"1 1 auto",minWidth:0,gap:2},vetName:{margin:0,...T(e,"medium"),color:t.brand,fontSize:a(l.subtitle),lineHeight:String(s.snug)},vetCredentials:{margin:0,...T(e,"regular"),color:t.text.metaCool,fontSize:a(l.caption),lineHeight:String(s.normal)},vetRating:{margin:0,...T(e,"regular"),color:t.text.secondary,fontSize:a(l.caption),lineHeight:String(s.normal)},vetBio:{margin:0,...T(e,"regular"),color:t.brand,fontSize:a(l.body),lineHeight:String(s.normal)},reasonInput:{width:"100%",minHeight:120,resize:"vertical",borderStyle:"solid",borderWidth:1,borderColor:t.brandBorder,borderRadius:a(n.md),padding:a(r.md),backgroundColor:t.surface,...T(e,"regular"),color:t.text.primary,fontSize:a(l.body),lineHeight:String(s.normal),boxSizing:"border-box"},emergencyBanner:{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:a(r.md),padding:a(r.lg),borderRadius:a(n.lg),borderStyle:"solid",borderWidth:1,borderColor:t.errorRed,backgroundColor:t.badgeBgCritical,boxSizing:"border-box"},emergencyTitle:{margin:0,...T(e,"bold"),color:t.errorRed,fontSize:a(l.subtitle),lineHeight:String(s.snug)},emergencyLede:{margin:0,...T(e,"regular"),color:t.text.primary,fontSize:a(l.body),lineHeight:String(s.normal)}}}o(Be,"makeLocalStyles");function ut({label:e,value:t,last:r=false,testID:n}){let i=w(),l=react.useMemo(()=>Ao(i),[i]);return jsxRuntime.jsxs("div",{style:{...l.row,...r?l.rowLast:null},"data-testid":n,children:[jsxRuntime.jsx("dt",{style:l.rowLabel,children:e}),jsxRuntime.jsx("dd",{style:l.rowValue,children:t})]})}o(ut,"TelevetSummaryRow");function er({label:e,checked:t,onToggle:r,testID:n}){let i=w(),l=react.useMemo(()=>Ao(i),[i]);return jsxRuntime.jsxs("label",{style:l.consent,children:[jsxRuntime.jsx("input",{type:"checkbox",checked:t,onChange:s=>r(s.currentTarget.checked),"data-testid":n,style:Pt}),jsxRuntime.jsx("span",{"aria-hidden":"true",style:{...l.box,...t?l.boxChecked:null},children:t?jsxRuntime.jsx("span",{style:l.tick,children:Vc}):null}),jsxRuntime.jsx("span",{style:l.consentLabel,children:e})]})}o(er,"TelevetConsentCheckbox");var Vc="\u2713";function Oo({children:e,testID:t}){let r=w(),n=react.useMemo(()=>Ao(r),[r]);return jsxRuntime.jsx("dl",{style:n.card,"data-testid":t,children:e})}o(Oo,"TelevetSummaryCard");function Ao(e){let{color:t,space:r,radius:n,type:i}=e,{size:l,lineHeight:s}=i,a=o(d=>`${String(d)}px`,"rem");return {card:{margin:0,borderRadius:a(n.lg),borderStyle:"solid",borderWidth:1,borderColor:t.brandBorder,paddingLeft:a(r.lg),paddingRight:a(r.lg),boxSizing:"border-box"},row:{display:"flex",flexDirection:"row",alignItems:"flex-start",justifyContent:"space-between",gap:a(r.lg),paddingTop:a(r.lg),paddingBottom:a(r.lg),borderBottomStyle:"solid",borderBottomWidth:1,borderBottomColor:t.brandBorder},rowLast:{borderBottomWidth:0},rowLabel:{margin:0,flexShrink:0,...T(e,"regular"),color:t.brand,fontSize:a(l.subtitle),lineHeight:String(s.snug)},rowValue:{margin:0,marginInlineStart:0,minWidth:0,textAlign:"right",overflowWrap:"anywhere",...T(e,"medium"),color:t.brand,fontSize:a(l.subtitle),lineHeight:String(s.snug)},consent:{display:"flex",flexDirection:"row",alignItems:"flex-start",gap:a(r.md),minHeight:se,padding:a(r.lg),borderRadius:a(n.md),backgroundColor:t.surfaceSubtle,cursor:"pointer",boxSizing:"border-box"},box:{width:22,height:22,flexShrink:0,borderRadius:a(n.xs),borderStyle:"solid",borderWidth:1.5,borderColor:t.brand,backgroundColor:t.surface,display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box"},boxChecked:{backgroundColor:t.primary,borderColor:t.primary},tick:{...T(e,"bold"),color:t.onPrimary,fontSize:a(l.caption),lineHeight:"1"},consentLabel:{flex:"1 1 auto",minWidth:0,overflowWrap:"anywhere",...T(e,"regular"),color:t.text.metaCool,fontSize:a(l.body),lineHeight:String(s.normal)}}}o(Ao,"makeStyles");function Bo({headingRef:e,when:t,lengthMinutes:r,clinician:n,petName:i,reason:l,shareRecords:s,onToggleShare:a,stateCode:d,stateAttested:u,onToggleStateAttest:p,cancellationTerms:f,termsAttested:m,onToggleTermsAttest:c,canConfirm:v,busy:b,failure:h,onConfirm:S,emergency:E,onAcknowledgeEmergency:k,onSeeOtherVets:L,mediaShortfall:x=qt,primaryVet:A,onFindEmergencyVet:z}){let H=N(),X=w(),D=react.useMemo(()=>Be(X),[X]),G=Fr({petName:i,primaryVet:A,onFindEmergencyVet:z})?y.emergency.lede:y.emergency.ledeWithoutExits;return jsxRuntime.jsxs("div",{style:H.scrollRoot,"data-testid":"televet-booking-review",children:[jsxRuntime.jsx("div",{style:H.scrollBody,"data-testid":"televet-booking-review-scroll",children:jsxRuntime.jsxs("div",{style:H.list,children:[jsxRuntime.jsx(ct,{headingRef:e,style:H.stepTitle,children:y.reviewHeading}),jsxRuntime.jsxs(Oo,{testID:"televet-review-summary",children:[i?jsxRuntime.jsx(ut,{label:y.summaryPet,value:i,testID:"televet-review-row-pet"}):null,n?jsxRuntime.jsx(ut,{label:y.summaryVet,value:n,testID:"televet-review-row-vet"}):null,jsxRuntime.jsx(ut,{label:y.summaryWhen,value:t,testID:"televet-review-row-when"}),jsxRuntime.jsx(ut,{label:y.summaryLength,value:W(y.summaryLengthTemplate,{n:String(r)}),testID:"televet-review-row-length"}),l?jsxRuntime.jsx(ut,{label:y.summaryReason,value:l,last:true,testID:"televet-review-row-reason"}):null]}),jsxRuntime.jsx(er,{label:y.shareRecordsOff,checked:s,onToggle:a,testID:"televet-review-share-records"}),f?jsxRuntime.jsx(er,{label:f,checked:m,onToggle:c,testID:"televet-review-terms-attest"}):null,d?jsxRuntime.jsx(er,{label:W(y.stateAttestTemplate,{state:d}),checked:u,onToggle:p,testID:"televet-review-state-attest"}):null,jsxRuntime.jsx(Xt,{shortfall:x,testIDPrefix:"televet-review"}),E?jsxRuntime.jsxs("div",{role:"alert",style:D.emergencyBanner,"data-testid":"televet-review-emergency",children:[jsxRuntime.jsx(Ua,{style:D.emergencyTitle,children:y.emergency.bannerTitle}),jsxRuntime.jsx("p",{style:D.emergencyLede,children:G}),E.length>0?jsxRuntime.jsx("p",{style:D.emergencyLede,"data-testid":"televet-review-emergency-categories",children:E.join(", ")}):null,jsxRuntime.jsx(Jt,{petName:i,primaryVet:A,onFindEmergencyVet:z,testIDPrefix:"televet-review-emergency"}),jsxRuntime.jsx(_,{label:y.emergency.keepBookingCta,kind:"secondary",loading:b,disabled:b,onPress:k,testID:"televet-review-emergency-ack"})]}):null,h==="failed"?jsxRuntime.jsx(K,{message:y.confirmFailed}):null,h==="clinician_unavailable"?jsxRuntime.jsxs("div",{style:H.list,"data-testid":"televet-review-clinician-unavailable",children:[jsxRuntime.jsx(K,{message:y.confirmFailed}),jsxRuntime.jsx(_,{label:y.seeOtherVetsCta,kind:"secondary",onPress:L,testID:"televet-review-see-other-vets"})]}):null,h==="rate_limited"?jsxRuntime.jsx(K,{message:y.confirmFailed,testID:"televet-review-rate-limited"}):null,h==="not_entitled"?jsxRuntime.jsx(K,{message:y.bookingPausedTitle,testID:"televet-review-not-entitled"}):null]})}),E?null:jsxRuntime.jsx("div",{style:H.scrollFooter,children:jsxRuntime.jsx(_,{label:y.confirmCta,kind:"primary",loading:b,disabled:!v||b||!!d&&!u||!!f&&!m,onPress:S,testID:"televet-review-confirm"})})]})}o(Bo,"ReviewStep");var $c="\u25CB",Kc="+";function Ye(e,t){return t?e.find(n=>n.petRef===t||n.petId===t)?.name??null:null}o(Ye,"nameOf");function ct({headingRef:e,style:t,id:r,children:n}){let i=ae(ge());return jsxRuntime.jsx(i,{ref:e,tabIndex:-1,style:t,...r===void 0?{}:{id:r},children:n})}o(ct,"StepHeading");function Ua({style:e,children:t}){let r=ae(Gt(ge()));return jsxRuntime.jsx(r,{style:e,children:t})}o(Ua,"SubHeading");function Ur({headingRef:e,pets:t,isPending:r,isError:n,onRetry:i,selectedId:l,onSelect:s,onAddPet:a}){let d=N(),u=w(),p=react.useMemo(()=>Be(u),[u]);return r?jsxRuntime.jsx("div",{role:"progressbar","aria-label":y.loading.pets,"aria-busy":"true",style:d.list,"data-testid":"televet-pets-loading",children:[0,1].map(f=>jsxRuntime.jsx(ve,{height:64},f))}):n?jsxRuntime.jsx("div",{"data-testid":"televet-pets-error",children:jsxRuntime.jsx($,{title:y.chrome.loadFailedTitle,actionLabel:y.chrome.retryCta,onAction:i})}):t.length===0?jsxRuntime.jsx("div",{"data-testid":"televet-pets-empty",children:jsxRuntime.jsx($,{title:y.chrome.noPetsTitle,actionLabel:y.addPetCta,onAction:a})}):jsxRuntime.jsxs("div",{style:d.stepFill,children:[jsxRuntime.jsx(ct,{headingRef:e,style:d.stepTitle,children:y.petSelectTitle}),jsxRuntime.jsx("div",{style:{...d.scrollBody,...p.stepScroll},children:jsxRuntime.jsxs("ul",{role:"list",style:d.list,"data-testid":"televet-pets",children:[t.map(f=>{let m=l===f.petRef;return jsxRuntime.jsx(Wa,{name:f.name??"",meta:Ma(f),selected:m,onPress:()=>s(f.petRef),testID:`televet-pet-${f.petRef}`},f.petRef)}),a?jsxRuntime.jsx(Wa,{name:y.addPetCta,meta:"",selected:false,onPress:a,testID:"televet-pet-add",glyph:Kc}):null]})})]})}o(Ur,"PetStep");function Wa({name:e,meta:t,selected:r,onPress:n,testID:i,glyph:l}){let s=w(),a=react.useMemo(()=>Be(s),[s]);return jsxRuntime.jsx("li",{children:jsxRuntime.jsxs("button",{type:"button",onClick:n,"aria-pressed":r,"data-testid":i,style:{...a.petRow,...r?a.petRowSelected:null},children:[jsxRuntime.jsx("span",{"aria-hidden":"true",style:a.petDisc,children:l??$a(e)}),jsxRuntime.jsxs("span",{style:a.petRowText,children:[jsxRuntime.jsx("span",{style:a.petRowName,children:e}),t?jsxRuntime.jsx("span",{style:a.petRowMeta,children:t}):null]})]})})}o(Wa,"PetRow");function $a(e){let t=e.trim();return t.length===0?$c:t.slice(0,1).toUpperCase()}o($a,"initialOf");function Ka({headingRef:e,clinicians:t,isPending:r,isError:n,selectedId:i,onSelect:l,onRetry:s}){let a=N(),d=w(),u=react.useMemo(()=>Be(d),[d]);if(r)return jsxRuntime.jsx("div",{role:"progressbar","aria-label":y.loading.clinicians,"aria-busy":"true",style:a.list,"data-testid":"televet-clinicians-loading",children:jsxRuntime.jsx(ve,{height:96})});if(n)return jsxRuntime.jsx("div",{"data-testid":"televet-clinicians-error",children:jsxRuntime.jsx($,{title:y.chrome.loadFailedTitle,actionLabel:y.chrome.retryCta,onAction:s})});if(t.length===0)return jsxRuntime.jsx("div",{"data-testid":"televet-clinicians-empty",children:jsxRuntime.jsx($,{title:y.noCliniciansTitle,message:y.noCliniciansBody,actionLabel:y.noCliniciansRetryCta,onAction:s})});let p=t.find(f=>f.clinicianId===i)??t[0];return p===void 0?null:jsxRuntime.jsxs("div",{style:a.list,"data-testid":"televet-clinicians",children:[jsxRuntime.jsx(ct,{headingRef:e,style:a.stepTitle,children:y.yourVetTitle}),jsxRuntime.jsxs("div",{style:u.vetRow,children:[jsxRuntime.jsx("span",{"aria-hidden":"true",style:u.vetAvatar,children:$a(p.displayName)}),jsxRuntime.jsxs("div",{style:u.vetIdentity,children:[jsxRuntime.jsx("p",{style:u.vetName,children:p.displayName}),p.credentials?jsxRuntime.jsx("p",{style:u.vetCredentials,children:p.credentials}):null,p.rating!==null&&p.ratingCount!==null?jsxRuntime.jsx("p",{style:u.vetRating,"data-testid":"televet-vet-rating",children:`\u2605 ${String(p.rating)} \xB7 ${String(p.ratingCount)} ${y.reviewsLabel}`}):null]})]}),p.bio?jsxRuntime.jsx("p",{style:u.vetBio,"data-testid":"televet-vet-bio",children:p.bio}):null,jsxRuntime.jsx("div",{style:a.divider}),jsxRuntime.jsx(_,{label:y.continueCta,kind:"primary",onPress:()=>l(p.clinicianId),testID:`televet-clinician-${p.clinicianId}`})]})}o(Ka,"ClinicianStep");function qa({headingRef:e,slots:t,enabled:r,isPending:n,isError:i,busySlotId:l,failure:s,selectedSlot:a,nextOpening:d,onPick:u,onRetry:p,onSeeOtherVets:f}){let m=N();return r?n?jsxRuntime.jsx("div",{role:"progressbar","aria-label":y.loading.slots,"aria-busy":"true",style:m.list,"data-testid":"televet-slots-loading",children:[0,1,2].map(c=>jsxRuntime.jsx(ve,{height:48},c))}):i?jsxRuntime.jsx($,{title:y.slotsErrorTitle,actionLabel:y.retryCta,onAction:p,testID:"televet-slots-error"}):t.length===0?jsxRuntime.jsx("div",{"data-testid":"televet-slots-empty",children:jsxRuntime.jsx($,{title:y.noSlotsTitle,message:d?W(y.nextOpeningTemplate,{when:Ee(d.startsAt)}):void 0,actionLabel:d?y.seeOtherVetsCta:void 0,onAction:d?f:void 0})}):jsxRuntime.jsxs("div",{style:m.stepFill,"data-testid":"televet-slots",children:[jsxRuntime.jsx(ct,{headingRef:e,style:m.stepTitle,children:y.timeHeading}),s==="expired"?jsxRuntime.jsx(K,{message:y.holdExpired}):null,s==="taken"?jsxRuntime.jsx(K,{message:y.slotTaken}):null,s==="failed"||s==="rate_limited"?jsxRuntime.jsx(K,{message:y.confirmFailed,testID:"televet-slots-hold-failed"}):null,jsxRuntime.jsx(Zt,{slots:t,busySlotId:l,onPick:u,selectedSlot:a,dayGroupLabel:y.summaryWhen,timeGroupLabel:y.navTitle})]}):jsxRuntime.jsx("div",{"data-testid":"televet-slots-unavailable",children:jsxRuntime.jsx($,{title:y.bookingPausedTitle})})}o(qa,"SlotStep");function Ya({headingRef:e,petName:t,chips:r,selected:n,onToggle:i,onNext:l}){let s=N(),a=w(),d=react.useMemo(()=>Be(a),[a]),u=W(y.issuesHeadingTemplate,{pet:t??""});return jsxRuntime.jsxs("div",{style:s.scrollRoot,"data-testid":"televet-booking-issues",children:[jsxRuntime.jsx("div",{style:s.scrollBody,children:jsxRuntime.jsxs("div",{style:s.list,children:[jsxRuntime.jsx(ct,{headingRef:e,style:s.stepTitle,children:u}),jsxRuntime.jsx("p",{style:s.stepHelp,children:y.issuesHint}),jsxRuntime.jsx("div",{role:"group","aria-label":u,style:d.chipRow,children:r.map(p=>{let f=n.includes(p.id);return jsxRuntime.jsx("button",{type:"button","aria-pressed":f,onClick:()=>i(p.id),style:{...d.chip,...f?d.chipOn:null},"data-testid":`televet-issue-${p.id}`,children:p.label},p.id)})})]})}),jsxRuntime.jsx("div",{style:s.scrollFooter,children:jsxRuntime.jsx(_,{label:y.continueCta,kind:"primary",onPress:l,testID:"televet-issues-next"})})]})}o(Ya,"IssuesStep");function Ga({headingRef:e,value:t,composed:r,onChange:n,onNext:i,media:l,onChangeMedia:s,onPickMedia:a,checking:d=false}){let u=N(),p=w(),f=react.useMemo(()=>Be(p),[p]),m=react.useId(),c=`${m}-reason-heading`,v=`${m}-reason-help`,b=(r??t).trim(),h=b.length>$e,S=b.length>0&&!h;return jsxRuntime.jsxs("div",{style:u.scrollRoot,"data-testid":"televet-booking-reason",children:[jsxRuntime.jsx("div",{style:u.scrollBody,"data-testid":"televet-booking-reason-scroll",children:jsxRuntime.jsxs("div",{style:u.list,children:[jsxRuntime.jsx(ct,{headingRef:e,id:c,style:u.stepTitle,children:y.describeHeading}),jsxRuntime.jsx("p",{id:v,style:u.stepHelp,children:y.describeHelpLong}),jsxRuntime.jsx("textarea",{value:t,onChange:E=>n(E.currentTarget.value),"aria-labelledby":c,"aria-describedby":v,"aria-invalid":h||void 0,placeholder:y.reasonPlaceholder,style:f.reasonInput,"data-testid":"televet-reason-input"}),h?jsxRuntime.jsx(K,{message:y.reasonTooLong}):null,jsxRuntime.jsx(Ro,{media:l,onChange:s,listLabel:y.addPhotoCta,...a?{onPickMedia:a}:{}})]})}),jsxRuntime.jsx("div",{style:u.scrollFooter,children:jsxRuntime.jsx(_,{label:y.continueCta,kind:"primary",disabled:!S,loading:d,onPress:i,testID:"televet-reason-next"})})]})}o(Ga,"ReasonStep");function Xa({headingRef:e,petId:t,roster:r,onAddPet:n,onPickPet:i}){return t===null?jsxRuntime.jsx(Ur,{headingRef:e,pets:r.pets,isPending:r.loading,isError:r.error!==null,onRetry:()=>{r.refresh();},onAddPet:n,selectedId:null,onSelect:i}):jsxRuntime.jsx(qc,{petRef:t})}o(Xa,"TelevetVisitSimulator");function qc({petRef:e}){let t=N(),r=ba(e);return jsxRuntime.jsx("div",{style:{...t.stepFill,...t.scrollBody},"data-testid":"televet-simulator",children:jsxRuntime.jsxs("div",{style:t.list,children:[jsxRuntime.jsx($,{title:pe.title}),jsxRuntime.jsx(_,{label:pe.create,onPress:r.create,kind:"secondary",disabled:r.busy,testID:"televet-simulator-create"}),r.visitLine!==null?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("p",{style:t.stateMessage,"data-testid":"televet-simulator-visit",children:r.visitLine}),ha.map(n=>jsxRuntime.jsx(_,{label:pe.advance[n],onPress:()=>r.advance(n),kind:"secondary",disabled:r.busy,testID:`televet-simulator-advance-${n}`},n)),jsxRuntime.jsx("p",{style:t.stateMessage,children:pe.eventsNote}),Ta.map(n=>jsxRuntime.jsx(_,{label:pe.events[n],onPress:()=>r.raise(n),kind:"secondary",disabled:r.busy,testID:`televet-simulator-event-${n}`},n))]}):null,r.line===null?null:r.line.tone==="danger"?jsxRuntime.jsx(K,{message:r.line.text,testID:"televet-simulator-error"}):jsxRuntime.jsx("p",{role:"status",style:t.stateMessage,"data-testid":"televet-simulator-log",children:r.line.text})]})})}o(qc,"SimulatorScreen");function Do(e){let{petRef:t,usState:r,controller:n,onBooked:i,onExit:l,onAddPet:s,onPickMedia:a,onAddToCalendar:d,onConfirmDiscard:u,onRequestLocation:p,locationStatus:f="unknown",onTriageReason:m,onStateInterest:c,primaryVet:v,onFindEmergencyVet:b,canJoinInApp:h=false,renderUnavailable:S,headingLevel:E,style:k,testID:L}=yt(e,["onBooked","onExit","onAddPet","onRequestLocation","onFindEmergencyVet"]),x=Ea(E??xt),A=Gt(x),z=N(),H=w(),X=react.useMemo(()=>Be(H),[H]),D=Se(n),G=Or(),q=G.pets,ee=q.length,ye=react.useMemo(()=>({ownedPetCount:ee,withIssues:true}),[ee]),[he,Le]=react.useReducer((M,Ze)=>Xn(M,Ze,ye),void 0,()=>Gn({ownedPetCount:0,withIssues:true},{petId:t??null,state:r??null})),O=react.useCallback(M=>Le(M),[]),[Ge,Je]=react.useState(""),[Xe,Y]=react.useState([]),[xe,V]=react.useState(null),[ze,pt]=react.useState(null),[Kr,Zo]=react.useState(false),[qr,ei]=react.useState(false),[ti,hs]=react.useState([]),[Yr,Ts]=react.useState(null),[Ss,Es]=react.useState(null),{draft:P}=he,ne=Qn(he),ri=react.useMemo(()=>ea(q.find(M=>M.petRef===P.petId||M.petId===P.petId)?.species??null),[q,P.petId]),Qe=ta(Xe.map(M=>ri.find(Ze=>Ze.id===M)?.label??""),Ge),ni=react.useRef(P.state);ni.current!==P.state&&(ni.current=P.state,Kr&&Zo(false),qr&&ei(false));let ar=Cn(P.state,D),oi=Mt(D),ft=kn(D),me=xn(P.state,D),He=jt(P.clinicianId,D),Gr=He.refetch,Cs=Rn(D).data??null,Jr=zt(D),ii=Pn(D),Re=co(m??null),li=po(P.state,c??null).actionFor("no_licensed_vet"),Xr=r??null;react.useEffect(()=>{Xr&&!P.state&&O({type:"patch",patch:{state:Xr}});},[Xr,P.state,O]),react.useEffect(()=>{t&&!P.petId&&O({type:"patch",patch:{petId:t}});},[t,P.petId,O]);let Qr=q.length===1?q[0]?.petRef??null:null;react.useEffect(()=>{Qr&&!P.petId&&O({type:"patch",patch:{petId:Qr}});},[Qr,P.petId,O]);let ai=react.useRef(ne);ai.current=ne;let si=react.useRef(0);react.useEffect(()=>{ee!==si.current&&(si.current=ee,O({type:"goTo",step:ai.current}));},[ee,O]);let Zr=me.data?.[0]?.clinicianId??null;react.useEffect(()=>{Zr&&!P.clinicianId&&O({type:"patch",patch:{clinicianId:Zr}});},[Zr,P.clinicianId,O]);let Ve=react.useRef(null),di=react.useRef(false);react.useEffect(()=>{if(!di.current){di.current=true;return}Ve.current?.focus();},[ne]);let ks=da({draft:P,hold:Jr,dispatch:O,setFailure:V,refetchSlots:Gr}),{submitBooking:xs,confirm:Rs}=sa({draft:P,reasonText:Qe,book:ii,stateAttested:Kr,termsAttested:qr,cancellationPolicy:oi.data??null,triage:Re,goTo:react.useCallback(M=>O({type:"goTo",step:M}),[O]),releaseSlot:react.useCallback(()=>{Es(P.slot),O({type:"patch",patch:Zl}),Gr();},[P.slot,O,Gr]),setFailure:V,setEmergency:pt,setBookedConsult:Ts,...i?{onBooked:i}:{}}),_s=ar.enabled&&ar.data!==null&&!ar.data.wellnessAvailable,Ps=ft.enabled&&ft.data?.active===false||xe==="not_entitled",{simulate:ui,fundingRefused:ci}=va(ft,Ps),ws=ft.enabled&&ft.data!==null,Is=ro(ws),pi=Nr(ti.length),Os=Qe.trim().length>0||!!P.slot,fi={surfaceUnavailable:D===null||xe==="unavailable"||In(ft)||In(ar),notEntitled:ci,policyBlocked:_s,triageOpen:Re.open,step:ne},As=Pa(fi),yi={noState:!P.state,isPending:me.enabled&&me.isPending,isError:me.isError,isEmpty:(me.data?.length??0)===0,notEntitled:ci},Bs=Ia(yi);return Ne()?jsxRuntime.jsx(fo.Provider,{value:A,children:jsxRuntime.jsxs("div",{style:{...z.screen,...k},"data-testid":L??"televet-booking",children:[jsxRuntime.jsx(xo,{step:ne,furthestIndex:he.furthestIndex,triageOpen:Re.open,canGoBack:!ui&&(Re.open||Jn(he,ye))&&ne!=="booked",isDirty:Os,onBack:()=>{if(Re.open){Re.close();return}Re.cancel(),O({type:"back"});},onClose:()=>l?.(),headingLevel:x,...u?{onConfirmDiscard:u}:{}}),ui?jsxRuntime.jsx(Xa,{headingRef:Ve,petId:P.petId,roster:G,onAddPet:s,onPickPet:M=>O({type:"patch",patch:{petId:M}})}):As?jsxRuntime.jsx(wa,{state:fi,petName:Ye(q,P.petId),...v?{primaryVet:v}:{},onFindEmergencyVet:b,stateInterest:li,...c?{onCheckAvailability:o(()=>O({type:"goTo",step:"clinician"}),"onCheckAvailability")}:{},onAcknowledgeEmergency:()=>{Re.acknowledge(Qe),O({type:"next"});},...S?{renderUnavailable:S}:{}}):ne==="time"?jsxRuntime.jsx(qa,{headingRef:Ve,slots:He.data??[],enabled:He.enabled,isPending:He.enabled&&He.isPending&&He.data===null,isError:He.isError,busySlotId:Jr.isPending?Jr.variables:null,failure:xe,selectedSlot:P.slot??Ss,nextOpening:Cs,onPick:ks,onRetry:()=>He.refetch(),onSeeOtherVets:()=>O({type:"goTo",step:"clinician"})}):ne==="review"?jsxRuntime.jsx(Bo,{headingRef:Ve,when:P.slot?Ee(P.slot.startsAt):"",lengthMinutes:(P.slot?gn(P.slot):null)??it,petName:Ye(q,P.petId),reason:Qe.trim(),clinician:me.data?.find(M=>M.clinicianId===P.clinicianId)?.displayName??null,shareRecords:P.shareHealthRecords,stateCode:P.state,stateAttested:Kr,onToggleStateAttest:Zo,cancellationTerms:oi.data?.summary??null,termsAttested:qr,onToggleTermsAttest:ei,onToggleShare:M=>O({type:"patch",patch:{shareHealthRecords:M}}),canConfirm:$t(P,Qe),busy:ii.isPending,failure:xe,onConfirm:Rs,emergency:ze,onAcknowledgeEmergency:()=>xs(true),mediaShortfall:pi,primaryVet:v,onFindEmergencyVet:b,onSeeOtherVets:()=>O({type:"goTo",step:"clinician"})}):ne==="booked"?jsxRuntime.jsx("div",{style:z.stepFill,"data-testid":"televet-booking-booked",children:Yr?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(ho,{consult:Yr,petName:Ye(q,Yr.petId)??Ye(q,P.petId),onDone:()=>l?.(),canJoinInApp:h,lengthMinutes:(P.slot?gn(P.slot):null)??it,...d?{onAddToCalendar:d}:{}}),jsxRuntime.jsx(Xt,{shortfall:pi,testIDPrefix:"televet-booked"})]}):null}):ne==="clinician"&&Bs?jsxRuntime.jsx(Oa,{state:yi,cause:Is,locationStatus:f,...p?{onRequestLocation:p}:{},onRetry:()=>me.refetch(),stateInterest:li,...S?{renderUnavailable:S}:{}}):ne==="clinician"?jsxRuntime.jsx(Ka,{headingRef:Ve,clinicians:me.data??[],isPending:me.enabled&&me.isPending,isError:me.isError,selectedId:P.clinicianId,onRetry:()=>me.refetch(),onSelect:M=>{O({type:"patch",patch:{clinicianId:M}}),O({type:"next"});}}):ne==="issues"?jsxRuntime.jsx(Ya,{headingRef:Ve,petName:Ye(q,P.petId),chips:ri,selected:Xe,onToggle:M=>Y(Ze=>Ze.includes(M)?Ze.filter(Ls=>Ls!==M):[...Ze,M]),onNext:()=>O({type:"next"})}):ne==="reason"?jsxRuntime.jsx(Ga,{headingRef:Ve,value:Ge,composed:Qe,onChange:Je,media:ti,onChangeMedia:hs,...a?{onPickMedia:a}:{},checking:Re.checking,onNext:()=>{Re.check(Qe).then(M=>{M&&O({type:"next"});});}}):ne==="pet"?jsxRuntime.jsx(Ur,{headingRef:Ve,pets:q,isPending:G.loading,isError:G.error!==null,onRetry:()=>{G.refresh();},onAddPet:s,selectedId:P.petId,onSelect:M=>{O({type:"patch",patch:{petId:M}}),O({type:"next"});}}):jsxRuntime.jsx("div",{style:X.marker,"data-testid":`televet-booking-step-${ne}`})]})}):jsxRuntime.jsx("div",{style:{...z.screen,...k},"data-testid":L??"televet-booking",children:jsxRuntime.jsx("div",{style:z.stepFill,"data-testid":"televet-booking-copy-unapproved",children:S?S():null})})}o(Do,"EverfurTelevetBooking");var Za=Symbol.for("@everfur/sdk/televet");function es(){let e=globalThis,t=e[Za];if(t!==void 0)return t;let r={presenter:null,snapshot:Object.freeze({request:null,serial:0,activeHost:null}),hosts:[],nextHost:1,listeners:new Set,dailyRegistered:false};return e[Za]=r,r}o(es,"televetGlobal");function Wr(){return es().dailyRegistered}o(Wr,"isEverfurDailyRegistered");function Fo(){let e=es(),t=e.noticeReceipts;if(t!==void 0)return t;let r=new Map;return e.noticeReceipts=r,r}o(Fo,"noticeReceipts");function ts(e){let t=Fo(),r=t.get(e);r!==void 0?r.holders+=1:t.set(e,{holders:1,joined:false});}o(ts,"markRecordingNoticeAccepted");function rs(e){let t=Fo(),r=t.get(e);r!==void 0&&(r.holders-=1,r.holders<=0&&t.delete(e));}o(rs,"clearRecordingNoticeAccepted");function ns(e){return Fo().get(e)?.joined===true}o(ns,"isTelevetCallJoined");var je=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`:je.lobbyTitleNoName},"lobbyTitle"),lobbyPrep:o(e=>{let t=e?.trim()??"";return t.length>0?`Have ${t} nearby and somewhere well lit.`:je.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 os(e){switch(e){case "too_early":return "This visit has not opened yet.";case "too_late":return "This visit has ended.";case "room_not_ready":return "We are still setting up the video room. Try again in a moment.";case "status_cancelled_owner":return "You cancelled this visit.";case "status_cancelled_ops":return "This visit was cancelled. Please book another time.";case "status_no_show_owner":return "This visit was missed.";case "status_no_show_vet":return "The vet could not make this visit. Please book another time.";case "status_awaiting_summary":return "This visit has ended. Your summary is on its way.";case "status_completed":return "This visit has ended.";default:return or}}o(os,"televetJoinRefusalWebCopy");var or="This visit cannot be joined right now.";function is(e){return e==="room_not_ready"||e==="unknown"}o(is,"televetJoinIsRetryable");function ls(e){let t=null;return ()=>{if(t!==null)return t;let r=e();return t=r,r.then(void 0,()=>{t===r&&(t=null);}),r}}o(ls,"memoizeTelevetLoader");var ss=Object.freeze({status:"joining"});function Mo(e,t){let[r,n]=react.useState(0),[i,l]=react.useState(ss),s=react.useRef(null);react.useEffect(()=>{let d=t?.joinConsult;if(t===null||d===void 0){l(Object.freeze({status:"refused",refusal:"unavailable",reason:null}));return}let u=`${e}#${String(r)}`,p=s.current;if(p===null||p.key!==u){let m;try{m=d.call(t,e);}catch(c){m=Promise.reject(c);}p={key:u,promise:m},s.current=p;}let f=true;return l(ss),p.promise.then(m=>{f&&(m.ok?l(Object.freeze({status:"ready",credential:m.value})):l(Object.freeze({status:"refused",refusal:yn(m.error),reason:fn(m.error)})));},()=>{f&&l(Object.freeze({status:"refused",refusal:"unknown",reason:null}));}),()=>{f=false;}},[e,t,r]);let a=react.useCallback(()=>n(d=>d+1),[]);return {state:i,retry:a}}o(Mo,"useTelevetJoin");var us=ls(()=>import('@everfur/sdk/web/televet/call')),np=an;function jo({consultId:e,controller:t,onLeave:r,style:n}){let i=N(),[l,s]=react.useState(null),a=l===e,[d]=react.useState(Wr);react.useEffect(()=>{if(d)return;let p=true;return us().then(f=>{p&&ip(f.EVERFUR_DAILY_SETUP);},()=>{}),()=>{p=false;}},[d]),Qt(()=>(r(),true),!a);let u=react.useCallback(()=>{s(null),r();},[r]);return d?a?jsxRuntime.jsx(op,{consultId:e,controller:t,onLeave:u,style:n},e):jsxRuntime.jsx(cs,{onContinue:()=>s(e),onDecline:r,style:n}):jsxRuntime.jsxs("div",{style:{...i.stepFill,...n},"data-testid":"televet-join-call-unavailable",children:[jsxRuntime.jsx(K,{message:or}),jsxRuntime.jsx(_,{label:je.leaveCta,kind:"secondary",onPress:r,testID:"televet-join-unavailable-leave"})]})}o(jo,"TelevetJoinScreen");function cs({onContinue:e,onDecline:t,busy:r=false,declineHeld:n=false,style:i}){let l=N(),s=`${react.useId()}-recording-notice`,a=react.useRef(null);return react.useEffect(()=>{let d=a.current;if(!d)return;let u=d.ownerDocument.activeElement;u!==null&&u!==d.ownerDocument.body||d.focus();},[]),jsxRuntime.jsx("div",{style:{...l.stepFill,...i},children:jsxRuntime.jsxs("div",{ref:a,role:"alertdialog","aria-labelledby":s,"aria-busy":r||void 0,tabIndex:-1,"data-testid":"everfur-vet-call-recording-notice",style:l.stateCard,children:[jsxRuntime.jsx("p",{id:s,style:l.stateTitle,children:je.recordingNoticeTitle}),jsxRuntime.jsx(_,{label:je.recordingNoticeCta,kind:"primary",loading:r,onPress:()=>e?.(),testID:"everfur-vet-call-recording-continue"}),jsxRuntime.jsx(_,{label:je.recordingNoticeDecline,kind:"secondary",disabled:n,onPress:()=>t?.(),testID:"everfur-vet-call-recording-decline"})]})})}o(cs,"TelevetRecordingNotice");function op({consultId:e,controller:t,onLeave:r,style:n}){let i=N(),l=Se(t),{state:s,retry:a}=Mo(e,l),d=s.status==="ready"?s.credential:null,[u,p]=react.useState(null),[f,m]=react.useState(false),c=d!==null;react.useEffect(()=>{if(!c||u!==null)return;let x=true;return us().then(A=>{x&&p(()=>A);},()=>{x&&m(true);}),()=>{x=false;}},[c,u]);let[v,b]=react.useState(null);react.useEffect(()=>{if(d===null)return;let x=d.roomUrl;return ts(x),b(d),()=>{rs(x);}},[d]);let h=s.status==="joining",[S,E]=react.useState(false);react.useEffect(()=>{if(!h){E(false);return}let x=setTimeout(()=>E(true),np);return ()=>{clearTimeout(x);}},[h]);let k=h&&!S;if(Qt(()=>(k||d!==null&&u!==null&&!f&&ns(d.roomUrl)||r(),true)),s.status==="refused"||f){let x=s.status==="refused"?s.refusal:"unavailable",A=s.status==="refused"?os(s.reason):or;return jsxRuntime.jsxs("div",{style:{...i.stepFill,...n},"data-testid":"televet-join-refused",children:[jsxRuntime.jsx(K,{message:A,testID:"televet-join-refused-message"}),is(x)&&s.status==="refused"?jsxRuntime.jsx(_,{label:y.retryCta,kind:"primary",onPress:a,testID:"televet-join-retry"}):null,jsxRuntime.jsx(_,{label:je.leaveCta,kind:"secondary",onPress:r,testID:"televet-join-leave"})]})}if(d===null||u===null||v!==d)return jsxRuntime.jsx(cs,{busy:true,declineHeld:k,onDecline:r,style:n});let{EverfurVetCall:L}=u;return jsxRuntime.jsx(L,{roomUrl:d.roomUrl,token:d.token,onLeave:r,renderUnavailable:()=>jsxRuntime.jsxs("div",{style:i.stepFill,"data-testid":"televet-join-call-unavailable",children:[jsxRuntime.jsx(K,{message:or}),jsxRuntime.jsx(_,{label:je.leaveCta,kind:"secondary",onPress:r,testID:"televet-join-unavailable-leave"})]}),...n?{style:n}:{}})}o(op,"TelevetJoinRoom");var ds=false;function ip(e){if(ds)return;ds=true;let t=globalThis.console;try{t?.warn?.(e);}catch{}}o(ip,"warnSetupOnce");var sp=2e4;function ps(e=true,t=sp){let[r,n]=react.useState(()=>Date.now());return react.useEffect(()=>{if(!e)return;n(Date.now());let i=setInterval(()=>n(Date.now()),t);return ()=>clearInterval(i)},[e,t]),r}o(ps,"useNowMs");function dp(e){let t=e.trim().length;return t<1?I.cancellationReasonMissing:t>Ke?I.cancellationReasonTooLong(Ke):null}o(dp,"reasonRefusal");function Ho({terms:e,submitting:t,failure:r,onConfirm:n,onDismiss:i,onRetryTerms:l,styles:s}){let[a,d]=react.useState(""),[u,p]=react.useState(null),f=react.useId(),m=react.useId(),c=e.status==="ready",v=o(()=>{if(t||!c)return;let b=dp(a);p(b),b||n(a.trim());},"confirm");return jsxRuntime.jsxs("form",{onSubmit:b=>{b.preventDefault(),v();},"aria-label":I.cancelConfirmCta,noValidate:true,style:s.form,"data-testid":"televet-visit-cancel-form",children:[jsxRuntime.jsx("p",{style:s.noticeTitle,children:I.cancelConfirmTitle}),e.status==="ready"?jsxRuntime.jsx("div",{style:s.notice,"data-testid":"televet-visit-cancel-terms",children:jsxRuntime.jsx("p",{style:s.note,children:e.summary})}):e.status==="loading"?jsxRuntime.jsx("div",{role:"status",style:s.notice,children:jsxRuntime.jsx("p",{style:s.note,children:I.loadingCancellationTerms})}):jsxRuntime.jsxs("div",{role:"alert",style:{...s.notice,...s.noticeDanger},"data-testid":"televet-visit-cancel-terms-error",children:[jsxRuntime.jsx("p",{style:s.note,children:I.cancellationTermsUnavailable}),jsxRuntime.jsx(_,{label:I.retry,kind:"secondary",fullWidth:false,onPress:l})]}),jsxRuntime.jsx("label",{htmlFor:f,style:s.label,children:I.cancellationReasonLabel}),jsxRuntime.jsx("textarea",{id:f,value:a,onChange:b=>{d(b.target.value),u&&p(null);},maxLength:Ke,rows:3,disabled:t||!c,"aria-invalid":u?true:void 0,"aria-describedby":u?m:void 0,style:s.textarea,"data-testid":"televet-visit-cancel-reason"}),u?jsxRuntime.jsx("p",{id:m,role:"alert",style:s.fieldError,children:u}):null,r?jsxRuntime.jsx("div",{role:"alert",style:{...s.notice,...s.noticeDanger},"data-testid":"televet-visit-cancel-failed",children:jsxRuntime.jsx("p",{style:s.note,children:r})}):null,jsxRuntime.jsxs("div",{style:s.actions,children:[jsxRuntime.jsx(_,{label:t?I.cancellingVisit:I.cancelConfirmCta,kind:"danger",fullWidth:false,disabled:t||!c,loading:t,onPress:v,testID:"televet-visit-cancel-yes"}),jsxRuntime.jsx(_,{label:I.cancelDismissCta,kind:"secondary",fullWidth:false,disabled:t,onPress:i,testID:"televet-visit-cancel-keep"})]})]})}o(Ho,"TelevetCancelVisitForm");function ms(e){let{color:t,space:r,radius:n,type:i}=e,{size:l,lineHeight:s}=i,a=o(d=>`${String(d)}px`,"px");return {screen:{...ht,display:"flex",flexDirection:"column",gap:a(r.md),paddingLeft:a(r.xl),paddingRight:a(r.xl),boxSizing:"border-box"},topBar:{display:"flex",alignItems:"center",justifyContent:"flex-end",minHeight:44},topBarStart:{justifyContent:"flex-start"},iconButton:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:44,height:44,padding:0,border:0,borderRadius:a(n.pill),background:"transparent",color:t.text.primary,cursor:"pointer"},textButton:{display:"inline-flex",alignItems:"center",minHeight:44,padding:`0 ${a(r.sm)}`,border:0,borderRadius:a(n.pill),background:"transparent",color:t.brand,cursor:"pointer",...T(e,"bold"),fontSize:a(l.body)},panel:{display:"flex",flexDirection:"column",borderStyle:"solid",borderWidth:1,borderColor:t.brandBorder,borderRadius:a(n.lg),backgroundColor:t.surface,overflow:"hidden"},panelBody:{display:"flex",flexDirection:"column",gap:a(r.md),padding:a(r.lg)},panelHeader:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:a(r.sm),padding:`${a(r.md)} ${a(r.lg)}`,borderBottom:`1px solid ${t.brandBorder}`},panelTitle:{margin:0,...T(e,"medium"),color:t.brand,fontSize:a(l.subtitle),lineHeight:String(s.snug)},count:{...T(e,"mono"),color:t.text.metaCool,fontSize:a(l.caption)},bookTitle:{margin:0,...T(e,"medium"),color:t.brand,fontSize:a(l.subtitle),lineHeight:String(s.snug)},list:{listStyle:"none",margin:0,padding:0},row:{display:"flex",flexDirection:"column",gap:a(r.sm),padding:`${a(r.md)} ${a(r.lg)}`,borderBottom:`1px solid ${t.brandBorder}`},rowHead:{display:"flex",flexWrap:"wrap",alignItems:"flex-start",justifyContent:"space-between",gap:a(r.sm)},when:{margin:0,...T(e,"medium"),color:t.text.primary,fontSize:a(l.subtitle),lineHeight:String(s.snug)},pet:{margin:0,...T(e,"regular"),color:t.text.metaCool,fontSize:a(l.caption)},chip:{display:"inline-flex",alignItems:"center",padding:`2px ${a(r.sm)}`,borderRadius:a(n.pill),backgroundColor:t.surfaceSubtle,...T(e,"mono"),color:t.text.metaCool,fontSize:a(l.micro),letterSpacing:"0.04em",textTransform:"uppercase"},chipPositive:{backgroundColor:t.badgeBgPositive,color:t.brand},actions:{display:"flex",flexWrap:"wrap",gap:a(r.sm)},note:{margin:0,...T(e,"regular"),color:t.text.metaCool,fontSize:a(l.body),lineHeight:String(s.normal)},notice:{display:"flex",flexDirection:"column",gap:a(r.xs),padding:a(r.md),borderRadius:a(n.md),backgroundColor:t.surfaceSubtle},noticeTitle:{margin:0,...T(e,"medium"),color:t.text.primary,fontSize:a(l.body),lineHeight:String(s.snug)},noticeDanger:{backgroundColor:t.badgeBgCritical},form:{display:"flex",flexDirection:"column",gap:a(r.sm),marginTop:a(r.sm),paddingTop:a(r.md),borderTop:`1px solid ${t.brandBorder}`},label:{...T(e,"medium"),color:t.text.primary,fontSize:a(l.body)},textarea:{minHeight:96,padding:a(r.sm),borderRadius:a(n.md),border:`1px solid ${t.brandBorder}`,...T(e,"regular"),fontSize:a(l.body),color:t.text.primary,backgroundColor:t.surface,resize:"vertical",boxSizing:"border-box"},fieldError:{margin:0,...T(e,"regular"),color:t.danger,fontSize:a(l.caption)},empty:{display:"flex",flexDirection:"column",gap:a(r.xs),padding:a(r.lg)},skeletons:{display:"flex",flexDirection:"column",gap:a(r.sm),padding:a(r.lg)}}}o(ms,"makeVisitStyles");function Wo({controller:e,onJoin:t,onReschedule:r,onBook:n,onBack:i,isRoot:l=true,revision:s=0,returnedTo:a=false,nowMs:d,style:u}){let p=w(),f=react.useMemo(()=>ms(p),[p]),m=ae(ge()),c=Se(e),[v,b]=react.useState(0),h=kr(c,s+v),S=Mt(c),{pets:E}=Or(),[k,L]=react.useState({status:"idle"}),[x,A]=react.useState(null),z=h.data??[],H=ps(z.some(Y=>!gr.has(Y.status))),X=d??H,{upcoming:D,past:G}=react.useMemo(()=>Ht(z,X),[z,X]),q=react.useRef(null),ee=react.useRef(null),ye=react.useRef(null),he=react.useRef(null),Le=react.useRef(a),O=!(h.enabled&&h.isPending);react.useEffect(()=>{Le.current&&ee.current?.focus();},[]),react.useEffect(()=>{!Le.current||!O||(Le.current=false,!q.current?.contains(document.activeElement)&&(ye.current??he.current)?.focus());},[O]);let Ge=S.data!==null&&S.data!==void 0?{status:"ready",summary:S.data.summary}:S.enabled&&S.isPending?{status:"loading"}:{status:"error"},Je=o((Y,xe)=>{let V=c?.cancelConsult;if(Ge.status!=="ready"||!c||!V){L({status:"failed",consultId:Y.consultId,message:I.cancelTermsFirst});return}L({status:"submitting",consultId:Y.consultId}),V.call(c,Y.consultId,xe).then(ze=>{ze.ok?(A(ze.value),L({status:"idle"})):L({status:"failed",consultId:Y.consultId,message:I.cancelFailed}),b(pt=>pt+1);},()=>L({status:"failed",consultId:Y.consultId,message:I.cancelFailed}));},"cancelVisit"),Xe=o(Y=>jsxRuntime.jsx(cp,{consult:Y,petName:Ye(E,Y.petId),nowMs:X,styles:f,cancelling:k.status!=="idle"&&k.consultId===Y.consultId?k:null,anyCancelInFlight:k.status==="submitting",terms:Ge,onJoin:t,onReschedule:r,onAskCancel:()=>{A(null),L({status:"asking",consultId:Y.consultId});},onDismissCancel:()=>L({status:"idle"}),onCancel:xe=>Je(Y,xe),onRetryTerms:()=>S.refetch()},Y.consultId),"renderRow");return jsxRuntime.jsxs("div",{ref:q,style:{...f.screen,...u},"data-testid":"televet-visits",children:[jsxRuntime.jsx("div",{style:l?f.topBar:{...f.topBar,...f.topBarStart},children:l?jsxRuntime.jsx("button",{type:"button",onClick:i,"aria-label":pp,style:f.iconButton,"data-testid":"televet-visits-close",children:jsxRuntime.jsx(yp,{})}):jsxRuntime.jsx("button",{type:"button",onClick:i,style:f.textButton,"data-testid":"televet-visits-back",children:fp})}),x?jsxRuntime.jsxs("div",{role:"status",style:f.notice,"data-testid":"televet-visits-cancel-receipt",children:[jsxRuntime.jsx("p",{style:f.noticeTitle,children:I.cancelledTitle}),x.summary?jsxRuntime.jsx("p",{style:f.note,children:x.summary}):null,jsxRuntime.jsx("p",{style:f.note,children:x.feeRecorded?I.cancellationFeeRecorded:I.cancellationFeeNotRecorded})]}):null,n?jsxRuntime.jsx("section",{style:f.panel,"data-testid":"televet-visits-book-card",children:jsxRuntime.jsxs("div",{style:f.panelBody,children:[jsxRuntime.jsx("p",{style:f.bookTitle,children:I.bookCardTitle}),jsxRuntime.jsx(_,{label:I.bookCardCta,onPress:n,testID:"televet-visits-book"})]})}):null,h.enabled&&h.isPending?jsxRuntime.jsxs("section",{style:f.panel,children:[jsxRuntime.jsx(Uo,{Title:m,title:I.pastTitle,count:null,styles:f,headingRef:ee}),jsxRuntime.jsx("div",{role:"progressbar","aria-label":I.loading,"aria-busy":"true",style:f.skeletons,"data-testid":"televet-visits-loading",children:[0,1,2].map(Y=>jsxRuntime.jsx(ve,{height:56},Y))})]}):h.isError&&h.data===null?jsxRuntime.jsxs("div",{ref:he,role:"alert",tabIndex:-1,style:{...f.notice,...f.noticeDanger},"data-testid":"televet-visits-error",children:[jsxRuntime.jsx("p",{style:f.noticeTitle,children:I.loadErrorTitle}),jsxRuntime.jsx("p",{style:f.note,"data-testid":"televet-visits-error-body",children:I.loadErrorBody}),jsxRuntime.jsx(_,{label:I.retry,kind:"secondary",fullWidth:false,onPress:()=>h.refetch()})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[D.length>0?jsxRuntime.jsxs("section",{style:f.panel,"data-testid":"televet-visits-upcoming",children:[jsxRuntime.jsx(Uo,{Title:m,title:I.upcomingTitle,count:D.length,styles:f,headingRef:ye}),jsxRuntime.jsx("ul",{"aria-label":I.upcomingTitle,style:f.list,children:D.map(Xe)})]}):null,jsxRuntime.jsxs("section",{style:f.panel,"data-testid":"televet-visits-past",children:[jsxRuntime.jsx(Uo,{Title:m,title:I.pastTitle,count:G.length,styles:f,...D.length===0?{headingRef:ye}:{}}),z.length===0?jsxRuntime.jsxs("div",{style:f.empty,"data-testid":"televet-visits-empty",children:[jsxRuntime.jsx("p",{style:f.noticeTitle,children:I.emptyTitle}),jsxRuntime.jsx("p",{style:f.note,children:I.emptyBody})]}):G.length===0?null:jsxRuntime.jsx("ul",{"aria-label":I.pastTitle,style:f.list,children:G.map(Xe)})]})]})]})}o(Wo,"TelevetVisitsScreen");function Uo({Title:e,title:t,count:r,styles:n,headingRef:i}){return jsxRuntime.jsxs("div",{style:n.panelHeader,children:[jsxRuntime.jsx(e,{style:n.panelTitle,...i?{ref:i,tabIndex:-1}:{},children:t}),r===null?null:jsxRuntime.jsx("span",{style:n.count,children:r})]})}o(Uo,"PanelHeader");function cp({consult:e,petName:t,nowMs:r,styles:n,cancelling:i,anyCancelInFlight:l,terms:s,onJoin:a,onReschedule:d,onAskCancel:u,onDismissCancel:p,onCancel:f,onRetryTerms:m}){let c=Ln(e,r),v=gr.has(e.status),b=il(e.status),h=Bn(e),S=Nn(e.status),E=e.consultId,k=react.useId(),L=!c.joinable&&!v;return jsxRuntime.jsxs("li",{style:n.row,"data-testid":`televet-visits-row-${E}`,children:[jsxRuntime.jsxs("div",{style:n.rowHead,children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{style:n.when,children:na(e.scheduledAt)}),t?jsxRuntime.jsx("p",{style:n.pet,children:t}):null]}),b?jsxRuntime.jsx("span",{style:c.joinable?{...n.chip,...n.chipPositive}:n.chip,"data-testid":`televet-visits-status-${E}`,children:b}):null]}),jsxRuntime.jsxs("div",{style:n.actions,children:[v?null:jsxRuntime.jsx(_,{label:I.joinCta,fullWidth:false,disabled:!c.joinable,onPress:()=>a(e,t),describedBy:L?k:void 0,testID:`televet-visits-join-${E}`}),S&&d?jsxRuntime.jsx(_,{label:I.rescheduleCta,kind:"secondary",fullWidth:false,onPress:()=>d(e),testID:`televet-visits-reschedule-${E}`}):null,S?jsxRuntime.jsx(_,{label:I.cancelCta,kind:"danger",fullWidth:false,disabled:l,onPress:u,testID:`televet-visits-cancel-${E}`}):null]}),L?jsxRuntime.jsx("p",{id:k,style:n.note,"data-testid":`televet-visits-join-note-${E}`,children:ll(c.reason,h===null?void 0:oa(new Date(h).toISOString()))}):null,i?jsxRuntime.jsx(Ho,{terms:s,submitting:i.status==="submitting",failure:i.status==="failed"?i.message:null,onConfirm:f,onDismiss:p,onRetryTerms:m,styles:n}):null]})}o(cp,"VisitRow");var pp="Close",fp="Back";function yp(){return jsxRuntime.jsx("svg",{"aria-hidden":"true",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",children:jsxRuntime.jsx("path",{d:"M18 6 6 18M6 6l12 12"})})}o(yp,"CloseGlyph");function $o(e){let{consult:t,onRescheduled:r,onCancel:n,controller:i,style:l,testID:s}=yt(e,["onRescheduled","onCancel"]),a=N(),d=Se(i),u=jt(t?.clinicianId??null,d),p=zt(d),f=wn(t?.consultId??null,d),[m,c]=react.useState(null),v=react.useCallback(h=>{c(null),p.mutate(h.slotId,{onSuccess:o(()=>{f.mutate(h.slotId,{onSuccess:o(S=>r?.(S),"onSuccess"),onError:o(S=>c(Ue(S).kind==="unavailable"?"unavailable":"failed"),"onError")});},"onSuccess"),onError:o(S=>c(Ue(S).kind==="unavailable"?"unavailable":"taken"),"onError")});},[p,f,r]),b=p.isPending||f.isPending;return Ne()?t?jsxRuntime.jsxs("section",{style:{...a.stepFill,...l},"aria-label":y.rescheduleNavTitle,"data-testid":s??"televet-reschedule",children:[jsxRuntime.jsx("p",{style:a.stepHelp,children:W(y.rescheduleFromTemplate,{when:Ee(t.scheduledAt)})}),m==="taken"?jsxRuntime.jsx(K,{message:y.slotTaken}):null,m==="failed"?jsxRuntime.jsx(K,{message:y.rescheduleFailed}):null,m==="unavailable"?jsxRuntime.jsx(K,{message:y.bookingPausedTitle,testID:"televet-reschedule-unavailable"}):null,u.enabled?u.isPending?jsxRuntime.jsx("div",{role:"progressbar","aria-label":y.loading.slots,"aria-busy":"true",style:a.list,"data-testid":"televet-reschedule-slots-loading",children:[0,1,2].map(h=>jsxRuntime.jsx(ve,{height:48},h))}):u.isError?jsxRuntime.jsx($,{title:y.slotsErrorTitle,actionLabel:y.retryCta,onAction:()=>u.refetch(),testID:"televet-reschedule-slots-error"}):(u.data??[]).length===0?jsxRuntime.jsx("div",{"data-testid":"televet-reschedule-empty",children:jsxRuntime.jsx($,{title:y.noSlotsTitle})}):jsxRuntime.jsx(Zt,{slots:u.data??[],busySlotId:b?p.variables:null,onPick:v,dayGroupLabel:y.summaryWhen,timeGroupLabel:y.rescheduleNavTitle,rowTestIdPrefix:"televet-reschedule-slot",testID:"televet-reschedule-slots"}):jsxRuntime.jsx("div",{"data-testid":"televet-reschedule-paused",children:jsxRuntime.jsx($,{title:y.bookingPausedTitle})}),jsxRuntime.jsx(_,{label:y.keepExistingCta,kind:"secondary",disabled:b,onPress:()=>n?.(),testID:"televet-reschedule-keep"})]}):jsxRuntime.jsx("div",{role:"progressbar","aria-label":y.loading.consult,"aria-busy":"true",style:{...a.list,...l},"data-testid":"televet-reschedule-loading",children:[0,1].map(h=>jsxRuntime.jsx(ve,{height:48},h))}):jsxRuntime.jsx("div",{style:{...a.stepFill,...l},"data-testid":"televet-reschedule-copy-unapproved"})}o($o,"EverfurTelevetReschedule");function Go(e){let t=e.visitRef?.trim()??"";return t.length>0?Object.freeze({name:"visit",visitRef:t,intent:e.intent??null}):Yo}o(Go,"televetScreenForRequest");var Yo=Object.freeze({name:"home"}),Sp=Object.freeze({name:"visits"}),Ep=Object.freeze({name:"booking"});function Cp(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(Cp,"navReducer");function bs(e){let{style:t,renderPending:r,className:n,...i}=yt(e,["onExit","onBooked","onAddPet","onRequestLocation","onFindEmergencyVet"]);return jsxRuntime.jsx(El,{capability:"televet",style:t,...n!==void 0?{className:n}:{},...r?{renderPending:r}:{},children:jsxRuntime.jsx(kp,{...i,...t!==void 0?{style:t}:{}})})}o(bs,"EverfurTelevetFlow");function kp({petRef:e,usState:t,controller:r,onBooked:n,onExit:i,onAddPet:l,onPickMedia:s,onAddToCalendar:a,onConfirmDiscard:d,onRequestLocation:u,locationStatus:p,primaryVet:f,onFindEmergencyVet:m,onTriageReason:c,historyMode:v="memory",canJoinInApp:b=false,renderUnavailable:h,initialScreen:S,headingLevel:E,style:k}){let L=N(),[x,A]=react.useReducer(Cp,S??Yo,V=>Object.freeze({stack:Object.freeze([V])})),z=x.stack[x.stack.length-1]??Yo,H=x.stack.length,X=react.useRef(H),D=H<X.current;react.useEffect(()=>{X.current=H;},[H]);let[G,q]=react.useState(0),ee=react.useCallback(()=>q(V=>V+1),[]),ye=react.useRef(0),he=react.useRef(H);he.current=H,react.useEffect(()=>{if(v!=="browser"||typeof window>"u")return;let V=o(ze=>{let pt=ze.state?.efTelevet;typeof pt=="number"&&pt<he.current&&(ye.current=Math.max(0,ye.current-1),A({type:"pop"}));},"onPopState");return window.addEventListener("popstate",V),()=>window.removeEventListener("popstate",V)},[v]);let Le=react.useCallback(V=>{v==="browser"&&typeof window<"u"&&(ye.current+=1,window.history.pushState({efTelevet:he.current+1},"")),A({type:"push",screen:V});},[v]),O=react.useCallback(()=>{if(v==="browser"&&typeof window<"u"&&ye.current>0){ye.current-=1,window.history.go(-1);return}A({type:"pop"});},[v]),Ge=react.useCallback(()=>h?h():jsxRuntime.jsx("div",{style:L.list,"data-testid":"televet-unavailable",children:Ne()?jsxRuntime.jsx($,{title:y.bookingPausedTitle}):null}),[h,L.list]),Je=react.useCallback(()=>{H>1?O():i?.();},[H,O,i]),Xe=react.useCallback(V=>A({type:"land",screen:V==="visits"?Sp:Ep}),[]),Y=jsxRuntime.jsx(Do,{...e!==void 0?{petRef:e}:{},...t!==void 0?{usState:t}:{},...r?{controller:r}:{},onBooked:V=>{ee(),n?.(V);},onExit:Je,...l?{onAddPet:l}:{},...s?{onPickMedia:s}:{},...a?{onAddToCalendar:a}:{},...d?{onConfirmDiscard:d}:{},...u?{onRequestLocation:u}:{},...p?{locationStatus:p}:{},...f?{primaryVet:f}:{},...m?{onFindEmergencyVet:m}:{},...c?{onTriageReason:c}:{},canJoinInApp:b,renderUnavailable:Ge,...E!==void 0?{headingLevel:E}:{},...k?{style:k}:{}}),xe=jsxRuntime.jsx(Wo,{...r?{controller:r}:{},revision:G,isRoot:H<=1,returnedTo:D,onJoin:(V,ze)=>Le({name:"call",consultId:V.consultId,clinicianName:V.clinicianName,petName:ze}),onReschedule:V=>Le({name:"reschedule",consult:V}),onBook:()=>Le({name:"booking"}),onBack:Je,...k?{style:k}:{}});switch(z.name){case "home":return jsxRuntime.jsx(xp,{controller:r,onLand:Xe,style:k});case "booking":return Y;case "visits":case "visit":return xe;case "reschedule":return jsxRuntime.jsx($o,{consult:z.consult,...r?{controller:r}:{},onRescheduled:()=>{ee(),O();},onCancel:()=>O(),...k?{style:k}:{}});case "call":return jsxRuntime.jsx(jo,{consultId:z.consultId,...r?{controller:r}:{},...z.clinicianName!==void 0?{clinicianName:z.clinicianName}:{},...z.petName!==void 0?{petName:z.petName}:{},onLeave:()=>{ee(),Je();},...k?{style:k}:{}});default:return sr(z)}}o(kp,"TelevetFlowBody");function xp({controller:e,onLand:t,style:r}){let n=N(),i=Se(e),l=ol(i);return react.useEffect(()=>{l!=="pending"&&t(l);},[l,t]),jsxRuntime.jsxs("div",{role:"progressbar","aria-label":I.loading,"aria-busy":"true",style:{...n.screen,...n.list,...r},"data-testid":"televet-landing-loading",children:[jsxRuntime.jsx(ve,{height:72}),jsxRuntime.jsx(ve,{height:72})]})}o(xp,"TelevetLandingScreen");var Jo=bs;var Pp=Object.freeze({escapeAtKeyDown:true});function wp({request:e,onClose:t,onAddToCalendar:r}){let n=w(),i=react.useMemo(()=>Ip(n),[n]),l=react.useMemo(()=>Ba(),[]),s=react.useCallback(()=>{l.dispatch()||t();},[l,t]),{dialogRef:a,onKeyDown:d,onCancel:u}=jr(true,s,void 0,Pp),p=react.useMemo(()=>Go(e),[e]);return jsxRuntime.jsx("dialog",{ref:a,onKeyDown:d,onCancel:u,"aria-label":y.visit.title,"data-testid":"everfur-televet-dialog",style:i,children:jsxRuntime.jsx(To.Provider,{value:l,children:jsxRuntime.jsx(Jo,{...e.petRef!==void 0?{petRef:e.petRef}:{},...e.usState!==void 0?{usState:e.usState}:{},initialScreen:p,onExit:t,...r?{onAddToCalendar:r}:{},canJoinInApp:Wr(),historyMode:"memory"})})})}o(wp,"EverfurTelevetDialog");function Ip(e){let{color:t,radius:r,space:n}=e;return {position:"fixed",inset:0,boxSizing:"border-box",width:"100%",maxWidth:640,height:"100%",maxHeight:"100%",margin:"0 auto",padding:`${String(n.lg)}px 0`,border:0,borderRadius:r.lg,display:"flex",flexDirection:"column",overflowY:"auto",backgroundColor:t.surface,color:t.text.primary}}o(Ip,"dialogStyle");exports.BACK_LABEL=_c;exports.CANCELLATION_POLICY_VERSION_MAX=br;exports.CANCEL_REASON_MAX=Ke;exports.CONSULT_KINDS=Fi;exports.CONSULT_MINUTES=it;exports.CONSULT_STATUSES=Di;exports.EverfurTelevet=Jo;exports.EverfurTelevetBooking=Do;exports.EverfurTelevetDialog=wp;exports.EverfurTelevetFlow=bs;exports.EverfurTelevetReschedule=$o;exports.MEDIA_REFS_MAX=hr;exports.NO_MEDIA_SHORTFALL=qt;exports.REASON_TEXT_MAX=$e;exports.TELEVET_BOOKING_BASE=qe;exports.TELEVET_BOOKING_COPY=le;exports.TELEVET_BOOKING_COPY_WEB=y;exports.TELEVET_BOOKING_STEPS=Wt;exports.TELEVET_CONSULT_PAGE_LIMIT=Gi;exports.TELEVET_EMERGENCY_EXITS_WEB=mt;exports.TELEVET_JOIN_CLOSES_MINUTES_AFTER=An;exports.TELEVET_JOIN_OPENS_MINUTES_BEFORE=On;exports.TERMINAL_CONSULT_STATUSES=gr;exports.TelevetBookedScreen=ho;exports.TelevetBookingChrome=xo;exports.TelevetCancelVisitForm=Ho;exports.TelevetClinicianEmptyState=_a;exports.TelevetConsentCheckbox=er;exports.TelevetDayStrip=Po;exports.TelevetEarlyEmergency=Ra;exports.TelevetEmergencyExits=Jt;exports.TelevetEntitlementInterestState=pc;exports.TelevetIntakeMedia=Ro;exports.TelevetJoinScreen=jo;exports.TelevetMediaDropNotice=Xt;exports.TelevetSlotPicker=Zt;exports.TelevetStateInterestAction=mo;exports.TelevetSummaryCard=Oo;exports.TelevetSummaryRow=ut;exports.TelevetVisitsScreen=Wo;exports.attestation=eo;exports.canConfirm=$t;exports.canManageTelevetVisit=Nn;exports.createTelevetBookingController=Tn;exports.currentStep=Qn;exports.emptyTelevetDraft=Jl;exports.formatVisitRange=Du;exports.formatWhen=ra;exports.formatWhenWithDay=Ee;exports.hasPreviousStep=Jn;exports.initialTelevetBookingState=Gn;exports.isHoldExpired=Lr;exports.isMediaShortfallEmpty=no;exports.isSkipped=Ar;exports.isTelevetBookingCopyReady=Ne;exports.isWellFormedStateCode=_e;exports.mediaShortfallFromUnsentPicks=Nr;exports.parseVetCallCredential=pn;exports.splitTelevetVisits=Ht;exports.televetBookingKey=Zn;exports.televetBookingReducer=Xn;exports.televetBookingRefusal=Ue;exports.televetCancelCall=Yi;exports.televetConsultCalendarKey=Aa;exports.televetConsultCall=Sr;exports.televetDaysFromSlots=Vr;exports.televetEmptyRosterCause=ro;exports.televetEmptyRosterView=to;exports.televetHoldCall=$i;exports.televetJoinCall=qi;exports.televetJoinDecision=Ln;exports.televetJoinOpensAtMs=Bn;exports.televetMediaShortfallLines=oo;exports.televetRescheduleCall=Ki;exports.televetScreenForRequest=Go;exports.useEarlyTriage=co;exports.useStateInterest=po;exports.useTelevetBookConsult=Pn;exports.useTelevetBookingAvailable=Wd;exports.useTelevetBookingController=Se;exports.useTelevetBookingEntitlement=kn;exports.useTelevetCancellationPolicy=Mt;exports.useTelevetClinicians=xn;exports.useTelevetHoldSlot=zt;exports.useTelevetJoin=Mo;exports.useTelevetNextSlot=Rn;exports.useTelevetRescheduleConsult=wn;exports.useTelevetSlots=jt;exports.useTelevetStatePolicy=Cn;exports.validateBookingBody=Ji;exports.vetCallJoinReason=fn;exports.vetCallJoinRefusal=yn;exports.withUnsentPicks=ju;