@everfur/sdk 0.7.1 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +311 -0
- package/README.md +24 -16
- package/dist/{Chat-CFi5cNUF.d.ts → Chat-Cv9EYMYA.d.ts} +3 -3
- package/dist/{Chat-DQOsAumH.d.cts → Chat-s2vcPbw3.d.cts} +3 -3
- package/dist/{DepthViews-uilL1NJZ.d.ts → DepthViews-CVxUHOJ-.d.ts} +1 -1
- package/dist/{DepthViews-C409ubw-.d.cts → DepthViews-Cz7mSW7p.d.cts} +1 -1
- package/dist/{DepthViews-es8mIK0w.d.ts → DepthViews-DNRY0Ugm.d.ts} +1 -1
- package/dist/{DepthViews-D81c95Ra.d.cts → DepthViews-DvNixbxg.d.cts} +1 -1
- package/dist/{ErrorPolicyPort-D22LUVrK.d.ts → ErrorPolicyPort-DwSnmGcX.d.ts} +1 -1
- package/dist/{ErrorPolicyPort-D6CybiqJ.d.cts → ErrorPolicyPort-NFDPe-5w.d.cts} +1 -1
- package/dist/{EverfurError-DmELDpXp.d.cts → EverfurError-pEXDbUJ1.d.cts} +9 -1
- package/dist/{EverfurError-DmELDpXp.d.ts → EverfurError-pEXDbUJ1.d.ts} +9 -1
- package/dist/{EverfurResult-ZtH-YV1h.d.cts → EverfurResult-dtl8ERAw.d.cts} +1 -1
- package/dist/{EverfurResult-SGvHKsCB.d.ts → EverfurResult-sKkoXew0.d.ts} +1 -1
- package/dist/IntakeMedia-BFZfBLjB.d.cts +116 -0
- package/dist/{IntakeMedia-BcjjUizr.d.ts → IntakeMedia-BH0fYDT2.d.cts} +19 -2
- package/dist/{IntakeMedia-CL_S2tZE.d.cts → IntakeMedia-Bavl7E4Z.d.ts} +19 -2
- package/dist/IntakeMedia-C8GlN_GK.d.ts +116 -0
- package/dist/animations/index.cjs +109 -1
- package/dist/animations/index.d.cts +6 -6
- package/dist/animations/index.d.ts +6 -6
- package/dist/animations/index.js +109 -1
- package/dist/{attachments-DNaSbmA3.d.ts → attachments-BaslXMdS.d.ts} +3 -3
- package/dist/{attachments-DI710no4.d.cts → attachments-DbFwz4iq.d.cts} +7 -7
- package/dist/{attachments-B2GjBgvF.d.cts → attachments-y3EcOX_w.d.cts} +3 -3
- package/dist/{attachments-SF88N654.d.ts → attachments-y_aO4hlk.d.ts} +7 -7
- package/dist/{bookingCopy-xlXxORCA.d.cts → bookingCopy-4i1R7klo.d.cts} +15 -7
- package/dist/{bookingCopy-D2N3RhsV.d.ts → bookingCopy-B3UMITD-.d.ts} +15 -7
- package/dist/{branding-ytH4jJq1.d.ts → branding-BYEqU855.d.ts} +1 -1
- package/dist/{branding-Bio5MM6g.d.cts → branding-BwEu68C8.d.cts} +1 -1
- package/dist/{callRoom-7wrE3RP2.d.ts → callRoom-B1qq_D-4.d.ts} +1 -1
- package/dist/{callRoom-B_EqaUzx.d.cts → callRoom-DfZTWFXh.d.cts} +1 -1
- package/dist/{casesRepository-B-md8h1S.d.cts → casesRepository-B6Z0XBIb.d.cts} +2 -2
- package/dist/{casesRepository-CC6951TK.d.ts → casesRepository-SI0zp5YH.d.ts} +2 -2
- package/dist/chat/index.cjs +333 -1
- package/dist/chat/index.d.cts +12 -12
- package/dist/chat/index.d.ts +12 -12
- package/dist/chat/index.js +333 -1
- package/dist/client/index.cjs +115 -11
- package/dist/client/index.d.cts +14 -14
- package/dist/client/index.d.ts +14 -14
- package/dist/client/index.js +115 -11
- package/dist/{config-BM0sv5jx.d.ts → config-Cvo47voG.d.ts} +3 -3
- package/dist/{config-Daa1plhQ.d.cts → config-v5k6NsK_.d.cts} +3 -3
- package/dist/consent/index.cjs +112 -1
- package/dist/consent/index.d.cts +9 -9
- package/dist/consent/index.d.ts +9 -9
- package/dist/consent/index.js +112 -1
- package/dist/{context-DQHtwcHN.d.cts → context-BZOtJbBO.d.cts} +9 -9
- package/dist/{context-CDV2pwGI.d.ts → context-cZ7NZ0sG.d.ts} +9 -9
- package/dist/{copy-Cl1l-qmY.d.ts → copy-CZBUHbyS.d.ts} +5 -5
- package/dist/{copy-BEx5F71o.d.cts → copy-ChJupm1p.d.cts} +5 -5
- package/dist/core/index.cjs +140 -13
- package/dist/core/index.d.cts +19 -19
- package/dist/core/index.d.ts +19 -19
- package/dist/core/index.js +140 -13
- package/dist/{depth-CAAwiStc.d.cts → depth-CRyU7-pf.d.cts} +7 -6
- package/dist/{depth-DfNRVtrV.d.ts → depth-vNpwOkZ8.d.ts} +7 -6
- package/dist/{entitlementRepository-DPvWjV-N.d.cts → entitlementRepository-Bv8nSYRd.d.cts} +4 -4
- package/dist/{entitlementRepository-CVWvND1P.d.ts → entitlementRepository-CUdxbQrP.d.ts} +4 -4
- package/dist/{identity-BhT7oJDS.d.ts → identity-B8GkH53J.d.ts} +2 -2
- package/dist/{identity-DUlshgow.d.cts → identity-BHaMJ3KK.d.cts} +2 -2
- package/dist/index.cjs +363 -12
- package/dist/index.d.cts +19 -19
- package/dist/index.d.ts +19 -19
- package/dist/index.js +363 -12
- package/dist/{models-DSqA5Ahs.d.ts → models-CrbUwbuS.d.ts} +1 -1
- package/dist/{models-Bn2z0NNo.d.cts → models-DzvqEjMm.d.cts} +1 -1
- package/dist/notifications/index.cjs +94 -2
- package/dist/notifications/index.d.cts +5 -5
- package/dist/notifications/index.d.ts +5 -5
- package/dist/notifications/index.js +94 -2
- package/dist/{pets-Bneph9m1.d.cts → pets-BI7Ji8hi.d.cts} +2 -2
- package/dist/{pets-DjcLmRrW.d.ts → pets-Dnn-DK1T.d.ts} +2 -2
- package/dist/{petsRepository-BwxmfX_s.d.ts → petsRepository-B2lO1sKS.d.ts} +2 -2
- package/dist/{petsRepository-BnVre3q7.d.cts → petsRepository-BP9nhM1R.d.cts} +2 -2
- package/dist/photo/index.cjs +131 -1
- package/dist/photo/index.d.cts +3 -3
- package/dist/photo/index.d.ts +3 -3
- package/dist/photo/index.js +131 -1
- package/dist/{ports-Di9rdLO9.d.ts → ports-BUXF0Rp3.d.ts} +7 -7
- package/dist/{ports-BPKxFOSe.d.cts → ports-C40S2V14.d.cts} +7 -7
- package/dist/records/depth/index.cjs +200 -2
- package/dist/records/depth/index.d.cts +11 -11
- package/dist/records/depth/index.d.ts +11 -11
- package/dist/records/depth/index.js +200 -2
- package/dist/records/index.cjs +742 -4
- package/dist/records/index.d.cts +22 -14
- package/dist/records/index.d.ts +22 -14
- package/dist/records/index.js +742 -4
- package/dist/{requestFunnel-CiSX2pun.d.ts → requestFunnel-BrOijMcw.d.ts} +5 -5
- package/dist/{requestFunnel-DMR_1T3O.d.cts → requestFunnel-BxNVGyGm.d.cts} +5 -5
- package/dist/{runtimeTypes-CkMFCbHW.d.ts → runtimeTypes-CvI1ZH8j.d.ts} +7 -7
- package/dist/{runtimeTypes-2gJ5hYoE.d.cts → runtimeTypes-DOO3f-W-.d.cts} +7 -7
- package/dist/server/events/index.cjs +92 -2
- package/dist/server/events/index.d.cts +4 -4
- package/dist/server/events/index.d.ts +4 -4
- package/dist/server/events/index.js +92 -2
- package/dist/server/index.cjs +95 -2
- package/dist/server/index.d.cts +5 -5
- package/dist/server/index.d.ts +5 -5
- package/dist/server/index.js +95 -2
- package/dist/televet/booking/index.cjs +394 -4
- package/dist/televet/booking/index.d.cts +24 -127
- package/dist/televet/booking/index.d.ts +24 -127
- package/dist/televet/booking/index.js +394 -4
- package/dist/televet/call/index.cjs +71 -1
- package/dist/televet/call/index.d.cts +3 -3
- package/dist/televet/call/index.d.ts +3 -3
- package/dist/televet/call/index.js +71 -1
- package/dist/televet/index.cjs +101 -1
- package/dist/televet/index.d.cts +25 -8
- package/dist/televet/index.d.ts +25 -8
- package/dist/televet/index.js +101 -1
- package/dist/{bookingTypes-D4pD3tHs.d.ts → televetGlobal-C5dTUACe.d.cts} +34 -1
- package/dist/{bookingTypes-D4pD3tHs.d.cts → televetGlobal-CnjrfhT4.d.ts} +34 -1
- package/dist/testing/index.cjs +98 -7
- package/dist/testing/index.d.cts +3 -3
- package/dist/testing/index.d.ts +3 -3
- package/dist/testing/index.js +98 -7
- package/dist/testing/rn/index.cjs +101 -1
- package/dist/testing/rn/index.d.cts +13 -13
- package/dist/testing/rn/index.d.ts +13 -13
- package/dist/testing/rn/index.js +101 -1
- package/dist/testing/web/index.cjs +95 -1
- package/dist/testing/web/index.d.cts +14 -14
- package/dist/testing/web/index.d.ts +14 -14
- package/dist/testing/web/index.js +95 -1
- package/dist/{timelineRows-D3171ksh.d.ts → timelineRows-CEx2TzYB.d.ts} +1 -1
- package/dist/{timelineRows-DDnz4gx2.d.cts → timelineRows-Dffceql_.d.cts} +1 -1
- package/dist/{tokens-BYtbKwFh.d.cts → tokens-Tzo1KBND.d.cts} +43 -2
- package/dist/{tokens-BYtbKwFh.d.ts → tokens-Tzo1KBND.d.ts} +43 -2
- package/dist/{typeStyle-DKz02DGU.d.ts → typeStyle-C3IG9Sft.d.ts} +22 -3
- package/dist/{typeStyle-BqfwxZH4.d.cts → typeStyle-CZ3Tj60N.d.cts} +22 -3
- package/dist/{useRecordsDepth-COJ0wSYK.d.cts → useRecordsDepth-D6a6-_u_.d.cts} +7 -6
- package/dist/{useRecordsDepth-Z9FF5X4E.d.ts → useRecordsDepth-DuPUJFDQ.d.ts} +7 -6
- package/dist/{useVetVisit-Ds8f1peV.d.cts → useVetVisit-BQX_aTJs.d.cts} +2 -2
- package/dist/{useVetVisit-BsjoDO-n.d.ts → useVetVisit-RPBOabl8.d.ts} +2 -2
- package/dist/video/index.cjs +122 -1
- package/dist/video/index.d.cts +3 -3
- package/dist/video/index.d.ts +3 -3
- package/dist/video/index.js +122 -1
- package/dist/{view-DoQEHXJR.d.ts → view-BSmN5RWf.d.ts} +5 -5
- package/dist/{view-nRy6SitU.d.cts → view-UFwCG1Pn.d.cts} +5 -5
- package/dist/web/consent/index.cjs +111 -1
- package/dist/web/consent/index.d.cts +9 -9
- package/dist/web/consent/index.d.ts +9 -9
- package/dist/web/consent/index.js +111 -1
- package/dist/web/index.cjs +325 -14
- package/dist/web/index.d.cts +22 -22
- package/dist/web/index.d.ts +22 -22
- package/dist/web/index.js +325 -14
- package/dist/web/notifications/index.cjs +95 -2
- package/dist/web/notifications/index.d.cts +7 -7
- package/dist/web/notifications/index.d.ts +7 -7
- package/dist/web/notifications/index.js +95 -2
- package/dist/web/records/depth/index.cjs +169 -2
- package/dist/web/records/depth/index.d.cts +11 -11
- package/dist/web/records/depth/index.d.ts +11 -11
- package/dist/web/records/depth/index.js +169 -2
- package/dist/web/records/index.cjs +689 -4
- package/dist/web/records/index.d.cts +34 -37
- package/dist/web/records/index.d.ts +34 -37
- package/dist/web/records/index.js +689 -4
- package/dist/web/records/upload/index.cjs +3 -0
- package/dist/web/records/upload/index.d.cts +23 -0
- package/dist/web/records/upload/index.d.ts +23 -0
- package/dist/web/records/upload/index.js +3 -0
- package/dist/web/televet/booking/index.cjs +423 -4
- package/dist/web/televet/booking/index.d.cts +21 -35
- package/dist/web/televet/booking/index.d.ts +21 -35
- package/dist/web/televet/booking/index.js +423 -4
- package/dist/web/televet/call/index.cjs +28 -1
- package/dist/web/televet/call/index.d.cts +2 -2
- package/dist/web/televet/call/index.d.ts +2 -2
- package/dist/web/televet/call/index.js +28 -1
- package/dist/web/televet/index.cjs +102 -4
- package/dist/web/televet/index.d.cts +22 -11
- package/dist/web/televet/index.d.ts +22 -11
- package/dist/web/televet/index.js +102 -4
- package/package.json +20 -4
- package/web/records/upload/native-blocked.cjs +12 -0
- package/web/records/upload/package.json +8 -0
- package/dist/televetGlobal-CEk0_cW9.d.cts +0 -34
- package/dist/televetGlobal-Cs9Wbqsy.d.ts +0 -34
|
@@ -1 +1,95 @@
|
|
|
1
|
-
import {createContext,useMemo,useContext}from'react';import {z}from'zod';var Ce=Object.defineProperty;var n=(e,t)=>Ce(e,"name",{value:t,configurable:true});function T(e,t){return Object.freeze(t===void 0?{ok:true,value:e}:{ok:true,value:e,warning:t})}n(T,"ok");function l(e){return Object.freeze({ok:false,error:e})}n(l,"err");var x=class x extends Error{constructor(t,r){super(r),this.name="EverfurConfigError",this.kind=t,Object.setPrototypeOf(this,x.prototype);}};n(x,"EverfurConfigError");var R=x;var W=Symbol.for("@everfur/sdk#EverfurContext@v1"),K=globalThis,$=K[W]??(K[W]=createContext(null));$.displayName??="EverfurContext";function h(){let e=useContext($);if(e===null)throw new R("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return e}n(h,"useEverfurContext");function ke(){let{runtime:e}=h();return useMemo(()=>({apply:n(t=>e.updateEntitlements(t),"apply")}),[e])}n(ke,"useEverfurTestEntitlements");var D=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(D.map(e=>e.wireCode));var Fe=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"}),Q=Object.freeze(D.map(e=>Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:Fe[e.wireCode]}))),Ie=new Map(Q.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),Ae=Object.freeze(["http_envelope",...[...new Set(Q.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function O(e,t){if(typeof e!="string")return;let r=e.trim().toUpperCase();if(r.length!==0)for(let o of [t??"http_envelope",...Ae]){let a=Ie.get(o+r);if(a)return a}}n(O,"contractErrorFor");function Pe(e){return e.envelope==="sse_frame"?`/errors#sse-${e.wireCode}`:e.envelope==="oauth_error"?`/errors#oauth-${e.wireCode}`:`/errors#${e.wireCode}`}n(Pe,"contractDocUrl");function X(e){return null}n(X,"publishedDocUrl");var je=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 J(e){return je[e]}n(J,"categoryFor");function Z(e){let t=O(e);if(t)return t.normalized;let r=(e??"").trim().toUpperCase(),o=r.replace(/[^A-Z0-9]/g,"");if(o==="AUTHREJECTED")return "authRejected";if(r.startsWith("AUTH"))return "authExpired";switch(o){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"}}n(Z,"fromWire");var ze=new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function V(e){return ze.has(e)}n(V,"isAutoRetryable");var qe=new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function ee(e){return V(e)||qe.has(e)}n(ee,"isRetryableCode");var De=500,U=8e3,te=4;function re(e,t=Math.random){let r=Math.max(0,e),o=Math.min(De*2**r,U);return Math.floor(t()*o)}n(re,"backoffDelayMs");var Ve=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 Ue(e){return Ve[e]}n(Ue,"userFacingError");function ne(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:false,writable:false,configurable:false});}n(ne,"defineHidden");var Me=/^[a-z][a-z0-9_]{0,63}$/;function y(e,t){let r=O(t?.wireCode,t?.wireEnvelope),o={code:e,category:J(e),retryable:t?.retryable??ee(e),displayMessage:Ue(e)};if(t?.httpStatus!==void 0&&(o.httpStatus=t.httpStatus),t?.requestId&&(o.requestId=t.requestId),typeof t?.reasonCode=="string"&&Me.test(t.reasonCode)&&(o.reasonCode=t.reasonCode),r);return t?.wireMessage&&ne(o,"wireMessage",t.wireMessage),t?.raw!==void 0&&t.raw!==null&&ne(o,"raw",t.raw),Object.freeze(o)}n(y,"makeEverfurError");function oe(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})}n(oe,"errorFrame");function Be(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}n(Be,"authHeaders");function S(e,t){return {...e,headers:{...Ye(e.headers),...Be(t)}}}n(S,"withAuthHeaders");function Ye(e){if(!e)return {};let t={};for(let[r,o]of Object.entries(e)){let a=r.toLowerCase();a==="authorization"||a==="x-everfur-partner-key"||(t[r]=o);}return t}n(Ye,"stripAuthHeaders");async function ie(e,t){if(t.mode==="anonymous")return t.transport.request(S(e,{mode:"anonymous",publishableKey:t.publishableKey,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));let r;try{r=await t.identity.currentToken();}catch{return l(M())}let o=await t.transport.request(S(e,{mode:"personalized",token:r,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));if(o.ok||o.error.httpStatus!==401)return o;let a;try{a=await t.identity.currentToken({forceRefresh:!0});}catch{return l(M())}let s=await t.transport.request(S(e,{mode:"personalized",token:a,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));return !s.ok&&s.error.httpStatus===401?l(M(s.error.httpStatus)):s}n(ie,"authedSend");function M(e){return y("authRejected",{retryable:false,...e!==void 0?{httpStatus:e}:{}})}n(M,"authRejectedError");function ae(e){return y("internalError",{retryable:true,wireMessage:He(e)})}n(ae,"networkError");function He(e){return e instanceof Error?e.message:typeof e=="string"?e:"network request failed"}n(He,"describeCause");var We=3e4,Ke=U*2,$e="idempotency-key",Ge=new Set(["POST","PUT","PATCH","DELETE"]),Qe=Object.freeze({onEvent(){}}),Xe=Object.freeze({setTimeout:n((e,t)=>setTimeout(e,t),"setTimeout"),clearTimeout:n(e=>clearTimeout(e),"clearTimeout"),now:n(()=>Date.now(),"now")});function Je(e){let t=e.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return t.length===0?null:`efs_${t}`.slice(0,128)}n(Je,"seededIdempotencyKey");function k(e){let t=e.observer??Qe,r=e.timers??Xe,o=e.rng??Math.random,a=e.sleep??((m,d)=>pt(m,r,d)),s=e.maxAttempts??te,u=e.unaryTimeoutMs??We,p=e.newIdempotencyKey??et(),c=n(m=>{try{t.onEvent(m);}catch{}},"emit");async function f(m,d,b){let A=b?.maxAttempts,ge=Math.max(1,A??s),Re=b?.idempotent??Ge.has(d.method),Se=b?.idempotencyKey===void 0?null:Je(b.idempotencyKey),P=Re?Se??p():null,we=Ze(d,P),j=0;for(;;){let E=n(q=>Object.freeze({call:m,method:d.method,path:d.path,attempt:j,...P?{idempotencyKey:P}:{},...q}),"stamp");c(E({phase:"attempt"}));let Y=dt(u,r),H=ct(Y.signal,d.signal),g;try{g=await ie({...we,signal:H.signal},e.auth);}catch(q){g=l(ae(q));}finally{H.dispose(),Y.cancel();}if(g.ok)return c(E({phase:"settled",ok:true,reason:"ok"})),g;let v=g.error,C=rt(v,j,{maxAttempts:ge,rng:o,now:r.now(),aborted:d.signal?.aborted===true,...A!==void 0?{perCallMaxAttempts:A}:{},...e.errorPolicy!==void 0?{policy:e.errorPolicy}:{}}),z={ok:false,code:v.code,reason:C.reason,...v.httpStatus!==void 0?{httpStatus:v.httpStatus}:{},...v.requestId!==void 0?{requestId:v.requestId}:{}};if(!C.retry)return c(E({phase:"settled",...z})),l(v);if(c(E({phase:"retry",...z,delayMs:C.delayMs})),await a(C.delayMs,d.signal),d.signal?.aborted===true)return c(E({phase:"settled",...z,reason:"aborted"})),l(v);j+=1;}}n(f,"send");async function w(m){return S(m,await ut(e.auth))}n(w,"authorize");async function*Ee(m,d,b){c(Object.freeze({call:m,phase:"stream.open",method:d.method,path:d.path,attempt:0}));try{yield*e.auth.transport.stream(d,b);}catch{yield oe({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:null});}}return n(Ee,"stream"),Object.freeze({send:f,authorize:w,stream:Ee})}n(k,"createRequestFunnel");function Ze(e,t){let r={};for(let[o,a]of Object.entries(e.headers??{}))o.toLowerCase()!==$e&&(r[o]=a);return t!==null&&(r["Idempotency-Key"]=t),{...e,headers:r}}n(Ze,"assembleHeaders");function et(){let e=0;return ()=>`efk_${Date.now().toString(36)}_${(e++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}n(et,"defaultIdempotencyKeyFactory");var tt=10;function rt(e,t,r){if(r.aborted)return {retry:false,reason:"aborted"};let o=nt(e);if(o==="quota")return {retry:false,reason:"daily-quota-exhausted"};if(o!=="burst"&&!V(e.code))return {retry:false,reason:"terminal-code"};let a=o==="burst"?"burst-throttle":"retryable-code";if(n(()=>{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 u=n(()=>{if(r.policy===void 0)return null;let f;try{f=r.policy.maxAttempts(e.code);}catch{return null}return typeof f!="number"||!Number.isFinite(f)?null:Math.max(1,Math.min(tt,Math.floor(f)))},"policyCeiling"),p=r.perCallMaxAttempts??u()??r.maxAttempts;if(t+1>=p)return {retry:false,reason:"attempts-exhausted"};let c=ot(e,r.now);return c!==null?c>Ke?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:a,delayMs:c}:{retry:true,reason:a,delayMs:re(t,r.rng)}}n(rt,"decideRetry");function nt(e){let t=e.code==="unknown"?Z(lt(e.raw)):e.code;return t==="quotaExceeded"?"quota":t==="rateLimited"||e.httpStatus===429?"burst":null}n(nt,"throttleKind");function ot(e,t){let r=at(e.raw);if(r!==null){let a=r-t;return a>0?a:0}let o=it(e.raw);return o===null?null:Math.round(o*1e3)}n(ot,"retryOverrideMs");function it(e){for(let t of L(e)){let r=t.retry_after_seconds;if(typeof r=="number"&&Number.isFinite(r)&&r>=0)return r}return null}n(it,"findRetryAfterSeconds");function at(e){for(let t of L(e)){let r=t.resets_at,o=st(r);if(o!==null)return o}return null}n(at,"findResetsAt");function L(e){if(!se(e))return [];let t=[e];for(let r of ["error","detail"]){let o=e[r];se(o)&&t.push(o);}return t}n(L,"candidateScopes");function st(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}n(st,"parseInstantMs");function lt(e){for(let t of L(e)){let r=t.code;if(typeof r=="string"&&r.length>0)return r}return null}n(lt,"rawWireCode");function se(e){return typeof e=="object"&&e!==null}n(se,"isRecord");async function ut(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}:{}}}n(ut,"resolveDeviceAuth");function dt(e,t){let r=new AbortController,o=t.setTimeout(()=>r.abort(),e);return {signal:r.signal,cancel:n(()=>t.clearTimeout(o),"cancel")}}n(dt,"boundedSignal");function ct(e,t){let r=n(()=>{},"noop");if(!t)return {signal:e,dispose:r};let o=new AbortController;if(e.aborted||t.aborted)return o.abort(),{signal:o.signal,dispose:r};let a=n(()=>o.abort(),"onAbort");return e.addEventListener("abort",a,{once:true}),t.addEventListener("abort",a,{once:true}),{signal:o.signal,dispose:n(()=>{e.removeEventListener("abort",a),t.removeEventListener("abort",a);},"dispose")}}n(ct,"mergeSignals");function pt(e,t,r){return e<=0||r?.aborted===true?Promise.resolve():new Promise(o=>{let a=t.setTimeout(()=>{r?.removeEventListener("abort",s),o();},e),s=n(()=>{t.clearTimeout(a),o();},"onAbort");r?.addEventListener("abort",s,{once:true});})}n(pt,"delayAbortable");function F(e){for(let t=0;t<e.length;t+=1){let r=e.charCodeAt(t);if(r>=55296&&r<=56319){let o=e.charCodeAt(t+1);if(!(o>=56320&&o<=57343))return true;t+=1;}else if(r>=56320&&r<=57343)return true}return false}n(F,"hasLoneSurrogate");function le(e){return [...e].length}n(le,"serverLength");var ce=new Set(["requested","awaiting_clinic","awaiting_upload","received","parsing","in_review","published","failed","revoked"]),ue=Object.freeze({submitted:"requested",sent:"requested",dispatching:"requested",awaiting_response:"awaiting_clinic",clinic_responded_no_records:"awaiting_clinic",records_received:"received",parsing_failed:"in_review",review_email_failed:"in_review",clinic_declined:"failed"});function ft(e){let t=Object.prototype.hasOwnProperty.call(ue,e)?ue[e]:void 0;if(t!==void 0)return t;let r=e;return ce.has(r)?r:"parsing"}n(ft,"normalizeStatus");var yt=z.object({request_id:z.string().min(1),pet_ref:z.string().min(1),status:z.string(),simple_status:z.string().nullish(),simple_status_detail:z.string().nullish(),status_label:z.string().optional(),dispatch_status:z.string().nullish(),can_retry_send:z.boolean().optional(),can_revoke:z.boolean().optional(),can_convert_to_upload:z.boolean().optional(),can_update_clinic_email:z.boolean().optional(),reminder_count:z.number().int().nonnegative().optional(),last_reminder_at:z.string().nullish(),waiting_expectation:z.string().nullish(),document_count:z.number().optional(),held_item_count:z.number().optional(),received_at:z.string().nullish(),parsing_started_at:z.string().nullish(),review_started_at:z.string().nullish(),created_at:z.string().optional(),updated_at:z.string().optional(),source:z.string().nullish().catch(null),action_needed_label:z.string().nullish().catch(null),failure_reason:z.string().nullish().catch(null),failure_code:z.string().nullish().catch(null),recovery_stage:z.string().nullish().catch(null),show_clinic_phone:z.boolean().optional().catch(void 0),clinic_name:z.string().nullish().catch(null),clinic_email:z.string().nullish().catch(null),clinic_phone:z.string().nullish().catch(null),converted_to_upload_at:z.string().nullish().catch(null),request_group_id:z.string().nullish().catch(null)}).passthrough();function pe(e){let t=yt.safeParse(e);if(!t.success)return null;let r=t.data,o=mt(r.simple_status),a=o==="requested"&&(r.status==="awaiting_upload"||r.simple_status_detail==="awaiting_owner_upload")?"awaiting_upload":o==="parsing"&&(r.simple_status_detail==="in_review"||r.simple_status_detail==="review_email_failed")?"in_review":o??ft(r.status);return Object.freeze({id:r.request_id,petRef:r.pet_ref,status:a,simpleStatus:o,simpleStatusDetail:r.simple_status_detail??null,statusLabel:r.status_label??"",dispatchStatus:r.dispatch_status??null,canRetrySend:r.can_retry_send===true,canRevoke:r.can_revoke===true,canConvertToUpload:r.can_convert_to_upload===true,canUpdateClinicEmail:r.can_update_clinic_email===true,reminderCount:r.reminder_count??0,lastReminderAt:r.last_reminder_at??null,waitingExpectation:r.waiting_expectation??null,documentCount:de(r.document_count,0),heldItemCount:de(r.held_item_count,0),receivedAt:r.received_at??null,parsingStartedAt:r.parsing_started_at??null,reviewStartedAt:r.review_started_at??null,createdAt:r.created_at??"",updatedAt:r.updated_at??"",wireStatus:r.status,source:r.source??null,actionNeededLabel:r.action_needed_label??null,failureReason:r.failure_reason??null,failureCode:r.failure_code??null,recoveryStage:r.recovery_stage??null,showClinicPhone:r.show_clinic_phone===true,clinicName:r.clinic_name??null,clinicEmail:r.clinic_email??null,clinicPhone:r.clinic_phone??null,convertedToUploadAt:r.converted_to_upload_at??null,requestGroupId:r.request_group_id??null})}n(pe,"mapRequestView");z.object({request_group_id:z.string().min(1),pet_ref:z.string().min(1),total:z.number().int().nonnegative(),responded:z.number().int().nonnegative(),pending:z.number().int().nonnegative(),members:z.array(z.unknown())});function mt(e){return !e||e==="awaiting_upload"||e==="in_review"?null:ce.has(e)?e:null}n(mt,"normalizeSimpleStatus");z.object({source_doc_id:z.string().min(1),request_id:z.string().min(1)});var vt=z.object({label:z.string(),value:z.string()}),_t=z.object({key:z.string(),category:z.string().optional(),label:z.string().optional(),value:z.string().nullish(),unit:z.string().nullish(),observed_at:z.string().nullish(),status:z.string().nullish(),origin:z.string().nullish(),canonical_key:z.string().nullish()}),bt=z.object({at:z.string(),value:z.number().nullish(),display:z.string().nullish(),origin:z.string().nullish()}),ht=z.object({key:z.string(),label:z.string().optional(),points:z.array(bt).optional()}),Et=z.object({title:z.string(),detail:z.string().nullish(),due_at:z.string().nullish()}),gt=z.object({doc_id:z.string(),title:z.string().nullish(),page_count:z.number().nullish(),received_at:z.string().nullish()});z.object({identity:z.array(vt).optional(),entities:z.array(_t).optional(),entity_series:z.array(ht).optional(),forward_looking:z.array(Et).optional(),documents:z.array(gt).optional()});z.object({pet_ref:z.string().optional(),granted:z.boolean().optional(),version:z.string().nullish(),granted_at:z.string().nullish()});function de(e,t){return typeof e=="number"&&Number.isFinite(e)?e:t}n(de,"numberOr");var Rt="/widget/v1/records/sandbox/requests",fe=64,St=new Set(["records","no_records","declined"]),wt=new Set(["applied","already_applied","not_applicable"]);function I(e){return y("validationFailed",{retryable:false,wireMessage:e})}n(I,"invalid");function Ct(e){return typeof e!="string"||e.length===0?I("request_id is required and must be a non-empty string"):F(e)?I("request_id contains an unpaired surrogate and cannot be encoded"):[...e].length>fe?I(`request_id is longer than ${fe} characters`):null}n(Ct,"requestIdError");function xt(e){if(typeof e!="object"||e===null)return null;let{result:t,request:r}=e;if(typeof t!="string"||!wt.has(t))return null;let o=pe(r);return o===null?null:Object.freeze({result:t,request:o})}n(xt,"mapActionResult");function ye(e){let t=e.funnel??k({auth:e.auth,...e.errorPolicy?{errorPolicy:e.errorPolicy}:{}}),r=n(async(o,a,s,u)=>{let p=Ct(a);if(p!==null)return l(p);let c=`${Rt}/${encodeURIComponent(a)}/${s}`,f=await t.send(o,u===void 0?{method:"POST",path:c}:{method:"POST",path:c,body:u});if(!f.ok)return l(f.error);let w=xt(f.value);return w===null?l(y("internalError",{retryable:false})):T(w)},"run");return {simulateClinicReply(o,a){return typeof a!="string"||!St.has(a)?Promise.resolve(l(I("outcome must be records, no_records or declined"))):r("records.sandbox.clinicReply",o,"clinic-reply",{outcome:a})},publishSampleRecord(o){return r("records.sandbox.publishSample",o,"publish-sample")}}}n(ye,"createRecordsSandboxController");function Ot(){let{runtime:e,userRef:t,scopeEpoch:r}=h();return useMemo(()=>{let{services:o}=e.registry;return ye({auth:o.authFor(t),...o.errorPolicy?{errorPolicy:o.errorPolicy}:{}})},[e,t,r])}n(Ot,"useEverfurRecordsSandbox");var N="/widget/v1/televet/sandbox/visits",kt=128,me=64,be=new Set(["booked","cancelled","completed","no_show"]),Ft=new Set(["applied","already_applied","not_applicable"]),ve=new Set(["rescheduled","reminder","followup_sent","message_received","ended"]),_e=new Set(["24h","30m"]);function _(e){return y("validationFailed",{retryable:false,wireMessage:e})}n(_,"invalid");function B(e,t,r){return typeof t!="string"||t.length===0?_(`${e} is required and must be a non-empty string`):F(t)?_(`${e} contains an unpaired surrogate and cannot be encoded`):le(t)>r?_(`${e} is longer than ${r} characters`):null}n(B,"textError");function It(e){if(typeof e!="object"||e===null)return null;let{result:t,visit:r}=e;if(typeof t!="string"||!Ft.has(t)||typeof r!="object"||r===null)return null;let{visit_ref:o,pet_ref:a,status:s,scheduled_at:u}=r;return typeof o!="string"||o.length===0||typeof a!="string"||a.length===0||typeof s!="string"||!be.has(s)||typeof u!="string"||u.length===0?null:Object.freeze({result:t,visit:Object.freeze({visitRef:o,petRef:a,status:s,scheduledAt:u})})}n(It,"mapActionResult");function he(e){let t=e.funnel??k({auth:e.auth,...e.errorPolicy?{errorPolicy:e.errorPolicy}:{}}),r=n(async(o,a,s)=>{let u=await t.send(o,{method:"POST",path:a,body:s},{idempotent:false,maxAttempts:1});if(!u.ok)return l(u.error);let p=It(u.value);return p===null?l(y("internalError",{retryable:false})):T(p)},"run");return {createVisit(o){let a=B("pet_ref",o,kt);return a!==null?Promise.resolve(l(a)):r("televet.sandbox.createVisit",N,{pet_ref:o})},advanceVisit(o,a){let s=B("visit_ref",o,me);if(s!==null)return Promise.resolve(l(s));if(typeof a!="string"||!be.has(a))return Promise.resolve(l(_("to must be booked, cancelled, completed or no_show")));let u=`${N}/${encodeURIComponent(o)}/advance`;return r("televet.sandbox.advanceVisit",u,{to:a})},simulateVisitEvent(o,a,s){let u=B("visit_ref",o,me);if(u!==null)return Promise.resolve(l(u));if(typeof a!="string"||!ve.has(a))return Promise.resolve(l(_(`event must be one of ${[...ve].join(", ")}`)));if(a==="reminder"){if(typeof s!="string"||!_e.has(s))return Promise.resolve(l(_(`stage must be one of ${[..._e].join(", ")} for a reminder`)))}else if(s!==void 0)return Promise.resolve(l(_("stage is only for a reminder")));let p=`${N}/${encodeURIComponent(o)}/simulate`;return r("televet.sandbox.simulateVisitEvent",p,s===void 0?{event:a}:{event:a,stage:s})}}}n(he,"createVetVisitSandboxController");function Pt(){let{runtime:e,userRef:t,scopeEpoch:r}=h();return useMemo(()=>{let{services:o}=e.registry;return he({auth:o.authFor(t),...o.errorPolicy?{errorPolicy:o.errorPolicy}:{}})},[e,t,r])}n(Pt,"useEverfurVetVisitSandbox");export{Ot as useEverfurRecordsSandbox,ke as useEverfurTestEntitlements,Pt as useEverfurVetVisitSandbox};
|
|
1
|
+
"use client";
|
|
2
|
+
import{createContext,useMemo,useContext}from"react";import{z}from"zod";function ok(value,warning){/* @__PURE__ */
|
|
3
|
+
return Object.freeze({ok:true,value:value})}function err(error){/* @__PURE__ */
|
|
4
|
+
return Object.freeze({ok:false,error:error})}var EverfurConfigError=class _EverfurConfigError extends Error{constructor(kind,message){super(message),this.name="EverfurConfigError",this.kind=kind,Object.setPrototypeOf(this,_EverfurConfigError.prototype)}};var EVERFUR_CONTEXT_SYMBOL=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurContext@v1"),globalContextHost=globalThis,EverfurContext=globalContextHost[EVERFUR_CONTEXT_SYMBOL]??(globalContextHost[EVERFUR_CONTEXT_SYMBOL]=createContext(null));EverfurContext.displayName??="EverfurContext";function useEverfurContext(){let ctx=useContext(EverfurContext);if(ctx===null)throw new EverfurConfigError("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return ctx}function useEverfurTestEntitlements(){let{runtime:runtime}=useEverfurContext();return useMemo(()=>({apply:snapshot=>runtime.updateEntitlements(snapshot)}),[runtime])}var CONTRACT_RETRYABILITY=/* @__PURE__ */Object.freeze([
|
|
5
|
+
/* @__PURE__ */Object.freeze({wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false}),
|
|
6
|
+
/* @__PURE__ */Object.freeze({wireCode:"AuthorizationException",envelope:"http_envelope",httpStatus:401,retryable:false}),
|
|
7
|
+
/* @__PURE__ */Object.freeze({wireCode:"ConflictException",envelope:"http_envelope",httpStatus:409,retryable:true}),
|
|
8
|
+
/* @__PURE__ */Object.freeze({wireCode:"DAILY_QUOTA_EXCEEDED",envelope:"http_envelope",httpStatus:429,retryable:true}),
|
|
9
|
+
/* @__PURE__ */Object.freeze({wireCode:"FILE_TOO_LARGE",envelope:"http_envelope",httpStatus:400,retryable:false}),
|
|
10
|
+
/* @__PURE__ */Object.freeze({wireCode:"IDEMPOTENCY_KEY_IN_FLIGHT",envelope:"http_envelope",httpStatus:409,retryable:true}),
|
|
11
|
+
/* @__PURE__ */Object.freeze({wireCode:"IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST",envelope:"http_envelope",httpStatus:409,retryable:false}),
|
|
12
|
+
/* @__PURE__ */Object.freeze({wireCode:"INVALID_CONTENT_TYPE",envelope:"http_envelope",httpStatus:400,retryable:false}),
|
|
13
|
+
/* @__PURE__ */Object.freeze({wireCode:"InternalFailureException",envelope:"http_envelope",httpStatus:500,retryable:true}),
|
|
14
|
+
/* @__PURE__ */Object.freeze({wireCode:"MethodNotAllowedException",envelope:"http_envelope",httpStatus:405,retryable:false}),
|
|
15
|
+
/* @__PURE__ */Object.freeze({wireCode:"NotImplementedException",envelope:"http_envelope",httpStatus:501,retryable:false}),
|
|
16
|
+
/* @__PURE__ */Object.freeze({wireCode:"PaymentRequiredException",envelope:"http_envelope",httpStatus:402,retryable:false}),
|
|
17
|
+
/* @__PURE__ */Object.freeze({wireCode:"ResourceNotFoundException",envelope:"http_envelope",httpStatus:404,retryable:false}),
|
|
18
|
+
/* @__PURE__ */Object.freeze({wireCode:"ServiceUnavailableException",envelope:"http_envelope",httpStatus:503,retryable:true}),
|
|
19
|
+
/* @__PURE__ */Object.freeze({wireCode:"TIER_UPGRADE_REQUIRED",envelope:"http_envelope",httpStatus:402,retryable:false}),
|
|
20
|
+
/* @__PURE__ */Object.freeze({wireCode:"ThrottlingException",envelope:"http_envelope",httpStatus:429,retryable:true}),
|
|
21
|
+
/* @__PURE__ */Object.freeze({wireCode:"ValidationException",envelope:"http_envelope",httpStatus:400,retryable:false}),
|
|
22
|
+
/* @__PURE__ */Object.freeze({wireCode:"accessDenied",envelope:"http_envelope",httpStatus:403,retryable:false}),
|
|
23
|
+
/* @__PURE__ */Object.freeze({wireCode:"access_denied",envelope:"oauth_error",httpStatus:302,retryable:false}),
|
|
24
|
+
/* @__PURE__ */Object.freeze({wireCode:"attachment_unreadable",envelope:"http_envelope",httpStatus:400,retryable:false}),
|
|
25
|
+
/* @__PURE__ */Object.freeze({wireCode:"authExpired",envelope:"http_envelope",httpStatus:401,retryable:true}),
|
|
26
|
+
/* @__PURE__ */Object.freeze({wireCode:"authRejected",envelope:"http_envelope",httpStatus:401,retryable:false}),
|
|
27
|
+
/* @__PURE__ */Object.freeze({wireCode:"consent_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),
|
|
28
|
+
/* @__PURE__ */Object.freeze({wireCode:"consent_required",envelope:"http_envelope",httpStatus:422,retryable:false}),
|
|
29
|
+
/* @__PURE__ */Object.freeze({wireCode:"consent_scope_wrong_route",envelope:"http_envelope",httpStatus:400,retryable:false}),
|
|
30
|
+
/* @__PURE__ */Object.freeze({wireCode:"device_cipher_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),
|
|
31
|
+
/* @__PURE__ */Object.freeze({wireCode:"email_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),
|
|
32
|
+
/* @__PURE__ */Object.freeze({wireCode:"event_cursor_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),
|
|
33
|
+
/* @__PURE__ */Object.freeze({wireCode:"event_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),
|
|
34
|
+
/* @__PURE__ */Object.freeze({wireCode:"event_payload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),
|
|
35
|
+
/* @__PURE__ */Object.freeze({wireCode:"event_type_not_available",envelope:"http_envelope",httpStatus:400,retryable:false}),
|
|
36
|
+
/* @__PURE__ */Object.freeze({wireCode:"event_type_unknown",envelope:"http_envelope",httpStatus:400,retryable:false}),
|
|
37
|
+
/* @__PURE__ */Object.freeze({wireCode:"idempotency_key_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),
|
|
38
|
+
/* @__PURE__ */Object.freeze({wireCode:"idempotency_key_required",envelope:"http_envelope",httpStatus:400,retryable:false}),
|
|
39
|
+
/* @__PURE__ */Object.freeze({wireCode:"idempotency_key_reused",envelope:"http_envelope",httpStatus:409,retryable:false}),
|
|
40
|
+
/* @__PURE__ */Object.freeze({wireCode:"insufficientCapability",envelope:"http_envelope",httpStatus:403,retryable:false}),
|
|
41
|
+
/* @__PURE__ */Object.freeze({wireCode:"insufficient_scope",envelope:"http_envelope",httpStatus:403,retryable:false}),
|
|
42
|
+
/* @__PURE__ */Object.freeze({wireCode:"internal_error",envelope:"sse_frame",httpStatus:200,retryable:false}),
|
|
43
|
+
/* @__PURE__ */Object.freeze({wireCode:"invalidRequest",envelope:"http_envelope",httpStatus:400,retryable:false}),
|
|
44
|
+
/* @__PURE__ */Object.freeze({wireCode:"invalid_client",envelope:"oauth_error",httpStatus:401,retryable:false}),
|
|
45
|
+
/* @__PURE__ */Object.freeze({wireCode:"invalid_client_metadata",envelope:"oauth_error",httpStatus:400,retryable:false}),
|
|
46
|
+
/* @__PURE__ */Object.freeze({wireCode:"invalid_grant",envelope:"oauth_error",httpStatus:400,retryable:false}),
|
|
47
|
+
/* @__PURE__ */Object.freeze({wireCode:"invalid_redirect_uri",envelope:"oauth_error",httpStatus:400,retryable:false}),
|
|
48
|
+
/* @__PURE__ */Object.freeze({wireCode:"invalid_request",envelope:"oauth_error",httpStatus:400,retryable:false}),
|
|
49
|
+
/* @__PURE__ */Object.freeze({wireCode:"invalid_scope",envelope:"oauth_error",httpStatus:400,retryable:false}),
|
|
50
|
+
/* @__PURE__ */Object.freeze({wireCode:"invalid_target",envelope:"oauth_error",httpStatus:400,retryable:false}),
|
|
51
|
+
/* @__PURE__ */Object.freeze({wireCode:"mcp_connection_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),
|
|
52
|
+
/* @__PURE__ */Object.freeze({wireCode:"mcp_request_conflict",envelope:"http_envelope",httpStatus:409,retryable:false}),
|
|
53
|
+
/* @__PURE__ */Object.freeze({wireCode:"mcp_request_gone",envelope:"http_envelope",httpStatus:410,retryable:false}),
|
|
54
|
+
/* @__PURE__ */Object.freeze({wireCode:"mcp_request_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),
|
|
55
|
+
/* @__PURE__ */Object.freeze({wireCode:"not_found",envelope:"sse_frame",httpStatus:200,retryable:false}),
|
|
56
|
+
/* @__PURE__ */Object.freeze({wireCode:"partner_visit_link_conflict",envelope:"http_envelope",httpStatus:409,retryable:false}),
|
|
57
|
+
/* @__PURE__ */Object.freeze({wireCode:"partner_visit_owner_only",envelope:"http_envelope",httpStatus:403,retryable:false}),
|
|
58
|
+
/* @__PURE__ */Object.freeze({wireCode:"partner_visit_pet_already_mapped",envelope:"http_envelope",httpStatus:409,retryable:false}),
|
|
59
|
+
/* @__PURE__ */Object.freeze({wireCode:"payload_too_large",envelope:"http_envelope",httpStatus:413,retryable:false}),
|
|
60
|
+
/* @__PURE__ */Object.freeze({wireCode:"petRefInUse",envelope:"http_envelope",httpStatus:409,retryable:false}),
|
|
61
|
+
/* @__PURE__ */Object.freeze({wireCode:"pet_health_list_removals_unconfirmed",envelope:"http_envelope",httpStatus:422,retryable:false}),
|
|
62
|
+
/* @__PURE__ */Object.freeze({wireCode:"pet_health_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),
|
|
63
|
+
/* @__PURE__ */Object.freeze({wireCode:"pet_not_registered",envelope:"http_envelope",httpStatus:404,retryable:false}),
|
|
64
|
+
/* @__PURE__ */Object.freeze({wireCode:"provider_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),
|
|
65
|
+
/* @__PURE__ */Object.freeze({wireCode:"rateLimited",envelope:"http_envelope",httpStatus:429,retryable:true}),
|
|
66
|
+
/* @__PURE__ */Object.freeze({wireCode:"record_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),
|
|
67
|
+
/* @__PURE__ */Object.freeze({wireCode:"record_subject_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),
|
|
68
|
+
/* @__PURE__ */Object.freeze({wireCode:"record_upload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),
|
|
69
|
+
/* @__PURE__ */Object.freeze({wireCode:"records_consent_required",envelope:"http_envelope",httpStatus:409,retryable:false}),
|
|
70
|
+
/* @__PURE__ */Object.freeze({wireCode:"sandbox_only",envelope:"http_envelope",httpStatus:403,retryable:false}),
|
|
71
|
+
/* @__PURE__ */Object.freeze({wireCode:"session_required",envelope:"http_envelope",httpStatus:403,retryable:false}),
|
|
72
|
+
/* @__PURE__ */Object.freeze({wireCode:"share_limit_reached",envelope:"http_envelope",httpStatus:429,retryable:false}),
|
|
73
|
+
/* @__PURE__ */Object.freeze({wireCode:"slow_down",envelope:"oauth_error",httpStatus:429,retryable:true}),
|
|
74
|
+
/* @__PURE__ */Object.freeze({wireCode:"species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),
|
|
75
|
+
/* @__PURE__ */Object.freeze({wireCode:"tenant_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),
|
|
76
|
+
/* @__PURE__ */Object.freeze({wireCode:"tenant_has_no_capabilities",envelope:"http_envelope",httpStatus:409,retryable:false}),
|
|
77
|
+
/* @__PURE__ */Object.freeze({wireCode:"tenant_resource_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),
|
|
78
|
+
/* @__PURE__ */Object.freeze({wireCode:"tenant_surface_not_enabled",envelope:"http_envelope",httpStatus:409,retryable:false}),
|
|
79
|
+
/* @__PURE__ */Object.freeze({wireCode:"timeout",envelope:"sse_frame",httpStatus:200,retryable:true}),
|
|
80
|
+
/* @__PURE__ */Object.freeze({wireCode:"token_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),
|
|
81
|
+
/* @__PURE__ */Object.freeze({wireCode:"unavailable",envelope:"sse_frame",httpStatus:200,retryable:true}),
|
|
82
|
+
/* @__PURE__ */Object.freeze({wireCode:"unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),
|
|
83
|
+
/* @__PURE__ */Object.freeze({wireCode:"unsupported_grant_type",envelope:"oauth_error",httpStatus:400,retryable:false}),
|
|
84
|
+
/* @__PURE__ */Object.freeze({wireCode:"unsupported_response_type",envelope:"oauth_error",httpStatus:302,retryable:false}),
|
|
85
|
+
/* @__PURE__ */Object.freeze({wireCode:"verify_mint_rate_limited",envelope:"http_envelope",httpStatus:429,retryable:true}),
|
|
86
|
+
/* @__PURE__ */Object.freeze({wireCode:"verify_mint_refused",envelope:"http_envelope",httpStatus:403,retryable:false}),
|
|
87
|
+
/* @__PURE__ */Object.freeze({wireCode:"verify_mint_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),
|
|
88
|
+
/* @__PURE__ */Object.freeze({wireCode:"verify_user_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),
|
|
89
|
+
/* @__PURE__ */Object.freeze({wireCode:"webhook_endpoint_update_empty",envelope:"http_envelope",httpStatus:400,retryable:false}),
|
|
90
|
+
/* @__PURE__ */Object.freeze({wireCode:"webhook_endpoint_update_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),
|
|
91
|
+
/* @__PURE__ */Object.freeze({wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false})]);/* @__PURE__ */Object.freeze(CONTRACT_RETRYABILITY.map(row=>row.wireCode));var NORMALIZED_FOLD=/* @__PURE__ */Object.freeze({ValidationException:"validationFailed",AuthorizationException:"authRejected",PaymentRequiredException:"paymentRequired",AccessDeniedException:"accessDenied",ResourceNotFoundException:"resourceNotFound",ConflictException:"conflict",ThrottlingException:"rateLimited",InternalFailureException:"internalError",NotImplementedException:"notImplemented",ServiceUnavailableException:"serviceUnavailable",MethodNotAllowedException:"validationFailed",authExpired:"authExpired",unavailable:"serviceUnavailable",session_required:"sessionRequired",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"}),CONTRACT_ERROR_ROWS=/* @__PURE__ */Object.freeze(CONTRACT_RETRYABILITY.map(generated=>/* @__PURE__ */Object.freeze({wireCode:generated.wireCode,envelope:generated.envelope,retryable:generated.retryable,normalized:NORMALIZED_FOLD[generated.wireCode]}))),BY_KEY=new Map(CONTRACT_ERROR_ROWS.map(r=>[r.envelope+r.wireCode.toUpperCase(),r])),ENVELOPE_LOOKUP_ORDER=/* @__PURE__ */Object.freeze(["http_envelope",...[...new Set(CONTRACT_ERROR_ROWS.map(r=>r.envelope))].filter(e=>e!=="http_envelope").sort()]);function contractErrorFor(wireCode,envelope){if(typeof wireCode!="string")return;let key=wireCode.trim().toUpperCase();if(key.length!==0)for(let candidate of[envelope??"http_envelope",...ENVELOPE_LOOKUP_ORDER]){let row=BY_KEY.get(candidate+key);if(row)return row}}var CATEGORY_OF=/* @__PURE__ */Object.freeze({authExpired:"authentication",authRejected:"authentication",sessionRequired:"authentication",identitySignatureRequired:"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 categoryFor(code){return CATEGORY_OF[code]}function fromWire(wire){let contractRow=contractErrorFor(wire);if(contractRow)return contractRow.normalized;let upper=(wire??"").trim().toUpperCase(),canonical=upper.replace(/[^A-Z0-9]/g,"");if(canonical==="AUTHREJECTED")return"authRejected";if(upper.startsWith("AUTH"))return"authExpired";switch(canonical){case"DAILYQUOTAEXCEEDED":case"QUOTAEXCEEDED":return"quotaExceeded";case"RATELIMITED":case"TOOMANYREQUESTS":case"TELEVETRATELIMITED":return"rateLimited";case"IDEMPOTENCYKEYCONFLICT":case"IDEMPOTENCYCONFLICT":return"idempotencyConflict";case"ACCESSDENIED":case"FORBIDDEN":return"accessDenied";case"IDENTITYSIGNATUREREQUIRED":return"identitySignatureRequired";case"NOTFOUND":case"CONVERSATIONNOTFOUND":return"conversationNotFound";case"PETNOTFOUND":return"petNotFound";case"TIMEOUT":case"STREAMTIMEOUT":return"streamTimeout";case"MEDIAUPLOADFAILED":case"UNRECOGNIZEDVIDEOFORMAT":case"FILETOOSMALL":return"mediaUploadFailed";case"MODERATIONBLOCKED":return"moderationBlocked";case"UPSTREAMLLMTIMEOUT":return"upstreamLlmTimeout";case"INTERNALERROR":case"INTERNALSERVERERROR":return"internalError";case"STREAMINCOMPLETE":case"CHATSTREAMINCOMPLETE":return"streamIncomplete";case"INVALIDANALYSISTYPE":case"INVALIDUPLOADPURPOSE":return"unknown";default:return"unknown"}}var AUTO_RETRYABLE_CODES=/* @__PURE__ */new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function isAutoRetryable(code){return AUTO_RETRYABLE_CODES.has(code)}var RETRYABLE_CONTRACT_CODES=/* @__PURE__ */new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function isRetryableCode(code){return isAutoRetryable(code)||RETRYABLE_CONTRACT_CODES.has(code)}var BACKOFF_BASE_MS=500,BACKOFF_CAP_MS=8e3,MAX_RETRY_ATTEMPTS=4;function backoffDelayMs(attempt,rng=Math.random){let bounded=Math.max(0,attempt),ceiling=Math.min(BACKOFF_BASE_MS*2**bounded,BACKOFF_CAP_MS);return Math.floor(rng()*ceiling)}var ACCESS_DENIED_COPY="This feature isn't available on your account right now.",USER_FACING_COPY=/* @__PURE__ */Object.freeze({authExpired:"Please sign in again to continue.",authRejected:"Please sign in again to continue.",sessionRequired:"This app needs to be updated to keep using Everfur.",accessDenied:ACCESS_DENIED_COPY,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.",identitySignatureRequired:ACCESS_DENIED_COPY,unknown:"Something went wrong. Please try again."});function userFacingError(code){return USER_FACING_COPY[code]}function defineHidden(target,key,value){Object.defineProperty(target,key,{value:value,enumerable:false,writable:false,configurable:false})}var REASON_CODE_SHAPE=/^[a-z][a-z0-9_]{0,63}$/;function makeEverfurError(code,opts){let row=contractErrorFor(opts?.wireCode,opts?.wireEnvelope),error={code:code,category:categoryFor(code),retryable:opts?.retryable??isRetryableCode(code),displayMessage:userFacingError(code)};opts?.httpStatus!==void 0&&(error.httpStatus=opts.httpStatus),opts?.requestId&&(error.requestId=opts.requestId),typeof opts?.reasonCode=="string"&&REASON_CODE_SHAPE.test(opts.reasonCode)&&(error.reasonCode=opts.reasonCode);let wait=opts?.retryAfterSeconds;if(typeof wait=="number"&&Number.isFinite(wait)&&wait>=0&&(error.retryAfterSeconds=Math.round(wait)),row);return opts?.wireMessage&&defineHidden(error,"wireMessage",opts.wireMessage),opts?.raw!==void 0&&opts.raw!==null&&defineHidden(error,"raw",opts.raw),/* @__PURE__ */Object.freeze(error)}function errorFrame(fields){/* @__PURE__ */
|
|
92
|
+
return Object.freeze({kind:"error",terminal:true,code:fields.code,retryable:fields.retryable,wireMessage:fields.wireMessage,synthesized:fields.synthesized,lastEventId:fields.lastEventId,serverRequestId:null})}function authHeaders(auth){let headers={};return auth.mode==="personalized"?headers.authorization=`Bearer ${auth.token}`:headers["x-everfur-partner-key"]=auth.publishableKey,auth.userRef&&(headers["x-everfur-user-ref"]=auth.userRef),auth.sessionId&&(headers["x-everfur-session-id"]=auth.sessionId),headers}function withAuthHeaders(req,auth){return{...req,headers:{...stripAuthHeaders(req.headers),...authHeaders(auth)}}}function stripAuthHeaders(headers){if(!headers)return{};let out={};for(let[key,value]of Object.entries(headers)){let lower=key.toLowerCase();lower==="authorization"||lower==="x-everfur-partner-key"||(out[key]=value)}return out}async function authedSend(req,ctx){if(ctx.mode==="anonymous")return ctx.transport.request(withAuthHeaders(req,{mode:"anonymous",publishableKey:ctx.publishableKey,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));let token;try{token=await ctx.identity.currentToken()}catch{return err(authRejectedError())}let first=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:token,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));if(first.ok||first.error.httpStatus!==401)return first;let refreshed;try{refreshed=await ctx.identity.currentToken({forceRefresh:!0})}catch{return err(authRejectedError())}let retry=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:refreshed,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));return!retry.ok&&retry.error.httpStatus===401?err(authRejectedError(retry.error.httpStatus)):retry}function authRejectedError(httpStatus){return makeEverfurError("authRejected",{retryable:false,...httpStatus!==void 0?{httpStatus:httpStatus}:{}})}function networkError(cause){return makeEverfurError("internalError",{retryable:true,wireMessage:describeCause(cause)})}function describeCause(cause){return cause instanceof Error?cause.message:typeof cause=="string"?cause:"network request failed"}var FUNNEL_UNARY_TIMEOUT_MS=3e4,RETRY_OVERRIDE_MAX_MS=BACKOFF_CAP_MS*2,IDEMPOTENCY_HEADER="idempotency-key",MUTATING_METHODS=/* @__PURE__ */new Set(["POST","PUT","PATCH","DELETE"]),NOOP_OBSERVER=/* @__PURE__ */Object.freeze({onEvent(){}}),defaultFunnelTimers=/* @__PURE__ */Object.freeze({setTimeout:(handler,ms)=>setTimeout(handler,ms),clearTimeout:handle=>clearTimeout(handle),now:()=>Date.now()});function seededIdempotencyKey(seed){let safe=seed.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return safe.length===0?null:`efs_${safe}`.slice(0,128)}function createRequestFunnel(deps){let observer=deps.observer??NOOP_OBSERVER,timers=deps.timers??defaultFunnelTimers,rng=deps.rng??Math.random,sleep=deps.sleep??((ms,signal)=>delayAbortable(ms,timers,signal)),ceiling=deps.maxAttempts??MAX_RETRY_ATTEMPTS,timeoutMs=deps.unaryTimeoutMs??FUNNEL_UNARY_TIMEOUT_MS,mintKey=deps.newIdempotencyKey??defaultIdempotencyKeyFactory(),emit=event=>{try{observer.onEvent(event)}catch{}};async function send(call,req,opts){let perCallMaxAttempts=opts?.maxAttempts,maxAttempts=Math.max(1,perCallMaxAttempts??ceiling),idempotent=opts?.idempotent??MUTATING_METHODS.has(req.method),seeded=opts?.idempotencyKey===void 0?null:seededIdempotencyKey(opts.idempotencyKey),idempotencyKey=idempotent?seeded??mintKey():null,base=assembleHeaders(req,idempotencyKey),attempt=0;for(;;){let stamp=extra=>/* @__PURE__ */Object.freeze({call:call,method:req.method,path:req.path,attempt:attempt,...idempotencyKey?{idempotencyKey:idempotencyKey}:{},...extra});emit(stamp({phase:"attempt"}));let deadline=boundedSignal(timeoutMs,timers),merged=mergeSignals(deadline.signal,req.signal),settled;try{settled=await authedSend({...base,signal:merged.signal},deps.auth)}catch(cause){settled=err(networkError(cause))}finally{merged.dispose(),deadline.cancel()}if(settled.ok)return emit(stamp({phase:"settled",ok:true,reason:"ok"})),settled;let error=settled.error,decision=decideRetry(error,attempt,{maxAttempts:maxAttempts,rng:rng,now:timers.now(),aborted:req.signal?.aborted===true,...perCallMaxAttempts!==void 0?{perCallMaxAttempts:perCallMaxAttempts}:{},...deps.errorPolicy!==void 0?{policy:deps.errorPolicy}:{}}),settledEvent={ok:false,code:error.code,reason:decision.reason,...error.httpStatus!==void 0?{httpStatus:error.httpStatus}:{},...error.requestId!==void 0?{requestId:error.requestId}:{}};if(!decision.retry)return emit(stamp({phase:"settled",...settledEvent})),err(error);if(emit(stamp({phase:"retry",...settledEvent,delayMs:decision.delayMs})),await sleep(decision.delayMs,req.signal),req.signal?.aborted===true)return emit(stamp({phase:"settled",...settledEvent,reason:"aborted"})),err(error);attempt+=1}}async function authorize(req){return withAuthHeaders(req,await resolveDeviceAuth(deps.auth))}async function*stream(call,req,signal){emit(
|
|
93
|
+
/* @__PURE__ */Object.freeze({call:call,phase:"stream.open",method:req.method,path:req.path,attempt:0}));try{yield*deps.auth.transport.stream(req,signal)}catch{yield errorFrame({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null})}}/* @__PURE__ */
|
|
94
|
+
return Object.freeze({send:send,authorize:authorize,stream:stream})}function assembleHeaders(req,idempotencyKey){let headers={};for(let[key,value]of Object.entries(req.headers??{}))key.toLowerCase()!==IDEMPOTENCY_HEADER&&(headers[key]=value);return idempotencyKey!==null&&(headers["Idempotency-Key"]=idempotencyKey),{...req,headers:headers}}function defaultIdempotencyKeyFactory(){let counter=0;return()=>`efk_${Date.now().toString(36)}_${(counter++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}var POLICY_MAX_ATTEMPTS_CAP=10;function decideRetry(error,attempt,ctx){if(ctx.aborted)return{retry:false,reason:"aborted"};let throttle=throttleKind(error);if(throttle==="quota")return{retry:false,reason:"daily-quota-exhausted"};if(throttle!=="burst"&&!isAutoRetryable(error.code))return{retry:false,reason:"terminal-code"};let reason=throttle==="burst"?"burst-throttle":"retryable-code";if((()=>{if(ctx.policy===void 0)return false;try{return!ctx.policy.shouldRetry(error.code,attempt)}catch{return false}})())return{retry:false,reason:"terminal-code"};let policyCeiling=()=>{if(ctx.policy===void 0)return null;let raw;try{raw=ctx.policy.maxAttempts(error.code)}catch{return null}return typeof raw!="number"||!Number.isFinite(raw)?null:Math.max(1,Math.min(POLICY_MAX_ATTEMPTS_CAP,Math.floor(raw)))},ceiling=ctx.perCallMaxAttempts??policyCeiling()??ctx.maxAttempts;if(attempt+1>=ceiling)return{retry:false,reason:"attempts-exhausted"};let override=retryOverrideMs(error,ctx.now);return override!==null?override>RETRY_OVERRIDE_MAX_MS?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:reason,delayMs:override}:{retry:true,reason:reason,delayMs:backoffDelayMs(attempt,ctx.rng)}}function throttleKind(error){let code=error.code==="unknown"?fromWire(rawWireCode(error.raw)):error.code;return code==="quotaExceeded"?"quota":code==="rateLimited"||error.httpStatus===429?"burst":null}function retryOverrideMs(error,now){let at=findResetsAt(error.raw);if(at!==null){let delta=at-now;return delta>0?delta:0}let wait=findRetryAfterSeconds(error.raw);return wait===null?null:Math.round(wait*1e3)}function findRetryAfterSeconds(raw){for(let scope of candidateScopes(raw)){let value=scope.retry_after_seconds;if(typeof value=="number"&&Number.isFinite(value)&&value>=0)return value}return null}function findResetsAt(raw){for(let scope of candidateScopes(raw)){let value=scope.resets_at,parsed=parseInstantMs(value);if(parsed!==null)return parsed}return null}function candidateScopes(raw){if(!isRecord(raw))return[];let out=[raw];for(let nested of["error","detail"]){let value=raw[nested];isRecord(value)&&out.push(value)}return out}function parseInstantMs(value){if(typeof value=="number"&&Number.isFinite(value))return value<1e11?Math.round(value*1e3):Math.round(value);if(typeof value=="string"&&value.trim().length>0){let parsed=Date.parse(value);return Number.isFinite(parsed)?parsed:null}return null}function rawWireCode(raw){for(let scope of candidateScopes(raw)){let code=scope.code;if(typeof code=="string"&&code.length>0)return code}return null}function isRecord(value){return typeof value=="object"&&value!==null}async function resolveDeviceAuth(auth){return auth.mode==="anonymous"?{mode:"anonymous",publishableKey:auth.publishableKey,userRef:auth.userRef,...auth.sessionId?{sessionId:auth.sessionId}:{}}:{mode:"personalized",token:await auth.identity.currentToken(),userRef:auth.userRef,...auth.sessionId?{sessionId:auth.sessionId}:{}}}function boundedSignal(ms,timers){let ctrl=new AbortController,handle=timers.setTimeout(()=>ctrl.abort(),ms);return{signal:ctrl.signal,cancel:()=>timers.clearTimeout(handle)}}function mergeSignals(deadline,caller){let noop=()=>{};if(!caller)return{signal:deadline,dispose:noop};let ctrl=new AbortController;if(deadline.aborted||caller.aborted)return ctrl.abort(),{signal:ctrl.signal,dispose:noop};let onAbort=()=>ctrl.abort();return deadline.addEventListener("abort",onAbort,{once:true}),caller.addEventListener("abort",onAbort,{once:true}),{signal:ctrl.signal,dispose:()=>{deadline.removeEventListener("abort",onAbort),caller.removeEventListener("abort",onAbort)}}}function delayAbortable(ms,timers,signal){return ms<=0||signal?.aborted===true?Promise.resolve():new Promise(resolve=>{let handle=timers.setTimeout(()=>{signal?.removeEventListener("abort",onAbort),resolve()},ms),onAbort=()=>{timers.clearTimeout(handle),resolve()};signal?.addEventListener("abort",onAbort,{once:true})})}function hasLoneSurrogate(value){for(let i=0;i<value.length;i+=1){let code=value.charCodeAt(i);if(code>=55296&&code<=56319){let low=value.charCodeAt(i+1);if(!(low>=56320&&low<=57343))return true;i+=1}else if(code>=56320&&code<=57343)return true}return false}function serverLength(value){return[...value].length}var KNOWN_STATUSES=/* @__PURE__ */new Set(["requested","awaiting_clinic","awaiting_upload","received","parsing","in_review","published","failed","revoked"]),STATUS_ALIASES=/* @__PURE__ */Object.freeze({submitted:"requested",sent:"requested",dispatching:"requested",awaiting_response:"awaiting_clinic",clinic_responded_no_records:"awaiting_clinic",records_received:"received",parsing_failed:"in_review",review_email_failed:"in_review",clinic_declined:"failed"});function normalizeStatus(raw){let aliased=Object.prototype.hasOwnProperty.call(STATUS_ALIASES,raw)?STATUS_ALIASES[raw]:void 0;if(aliased!==void 0)return aliased;let value=raw;return KNOWN_STATUSES.has(value)?value:"parsing"}var requestSchema=/* @__PURE__ */z.object({request_id:/* @__PURE__ */z.string().min(1),pet_ref:/* @__PURE__ */z.string().min(1),status:/* @__PURE__ */z.string(),simple_status:/* @__PURE__ */z.string().nullish(),simple_status_detail:/* @__PURE__ */z.string().nullish(),status_label:/* @__PURE__ */z.string().optional(),dispatch_status:/* @__PURE__ */z.string().nullish(),can_retry_send:/* @__PURE__ */z.boolean().optional(),can_revoke:/* @__PURE__ */z.boolean().optional(),can_convert_to_upload:/* @__PURE__ */z.boolean().optional(),can_update_clinic_email:/* @__PURE__ */z.boolean().optional(),reminder_count:/* @__PURE__ */z.number().int().nonnegative().optional(),last_reminder_at:/* @__PURE__ */z.string().nullish(),waiting_expectation:/* @__PURE__ */z.string().nullish(),document_count:/* @__PURE__ */z.number().optional(),held_item_count:/* @__PURE__ */z.number().optional(),received_at:/* @__PURE__ */z.string().nullish(),parsing_started_at:/* @__PURE__ */z.string().nullish(),review_started_at:/* @__PURE__ */z.string().nullish(),created_at:/* @__PURE__ */z.string().optional(),updated_at:/* @__PURE__ */z.string().optional(),source:/* @__PURE__ */z.string().nullish().catch(null),action_needed_label:/* @__PURE__ */z.string().nullish().catch(null),failure_reason:/* @__PURE__ */z.string().nullish().catch(null),failure_code:/* @__PURE__ */z.string().nullish().catch(null),recovery_stage:/* @__PURE__ */z.string().nullish().catch(null),show_clinic_phone:/* @__PURE__ */z.boolean().optional().catch(void 0),clinic_name:/* @__PURE__ */z.string().nullish().catch(null),clinic_email:/* @__PURE__ */z.string().nullish().catch(null),clinic_phone:/* @__PURE__ */z.string().nullish().catch(null),converted_to_upload_at:/* @__PURE__ */z.string().nullish().catch(null),request_group_id:/* @__PURE__ */z.string().nullish().catch(null)}).passthrough();function mapRequestView(wire){let parsed=requestSchema.safeParse(wire);if(!parsed.success)return null;let w=parsed.data,simpleStatus=normalizeSimpleStatus(w.simple_status),status=simpleStatus==="requested"&&(w.status==="awaiting_upload"||w.simple_status_detail==="awaiting_owner_upload")?"awaiting_upload":simpleStatus==="parsing"&&(w.simple_status_detail==="in_review"||w.simple_status_detail==="review_email_failed")?"in_review":simpleStatus??normalizeStatus(w.status);/* @__PURE__ */
|
|
95
|
+
return Object.freeze({id:w.request_id,petRef:w.pet_ref,status:status,simpleStatus:simpleStatus,simpleStatusDetail:w.simple_status_detail??null,statusLabel:w.status_label??"",dispatchStatus:w.dispatch_status??null,canRetrySend:w.can_retry_send===true,canRevoke:w.can_revoke===true,canConvertToUpload:w.can_convert_to_upload===true,canUpdateClinicEmail:w.can_update_clinic_email===true,reminderCount:w.reminder_count??0,lastReminderAt:w.last_reminder_at??null,waitingExpectation:w.waiting_expectation??null,documentCount:numberOr(w.document_count,0),heldItemCount:numberOr(w.held_item_count,0),receivedAt:w.received_at??null,parsingStartedAt:w.parsing_started_at??null,reviewStartedAt:w.review_started_at??null,createdAt:w.created_at??"",updatedAt:w.updated_at??"",wireStatus:w.status,source:w.source??null,actionNeededLabel:w.action_needed_label??null,failureReason:w.failure_reason??null,failureCode:w.failure_code??null,recoveryStage:w.recovery_stage??null,showClinicPhone:w.show_clinic_phone===true,clinicName:w.clinic_name??null,clinicEmail:w.clinic_email??null,clinicPhone:w.clinic_phone??null,convertedToUploadAt:w.converted_to_upload_at??null,requestGroupId:w.request_group_id??null})}function normalizeSimpleStatus(raw){return!raw||raw==="awaiting_upload"||raw==="in_review"?null:KNOWN_STATUSES.has(raw)?raw:null}function numberOr(v,fallback){return typeof v=="number"&&Number.isFinite(v)?v:fallback}var BASE="/widget/v1/records/sandbox/requests",REQUEST_ID_MAX=64,OUTCOMES=/* @__PURE__ */new Set(["records","no_records","declined"]),RESULTS=/* @__PURE__ */new Set(["applied","already_applied","not_applicable"]);function invalid(wireMessage){return makeEverfurError("validationFailed",{retryable:false,wireMessage:wireMessage})}function requestIdError(value){return typeof value!="string"||value.length===0?invalid("request_id is required and must be a non-empty string"):hasLoneSurrogate(value)?invalid("request_id contains an unpaired surrogate and cannot be encoded"):[...value].length>REQUEST_ID_MAX?invalid(`request_id is longer than ${REQUEST_ID_MAX} characters`):null}function mapActionResult(wire){if(typeof wire!="object"||wire===null)return null;let{result:result,request:request}=wire;if(typeof result!="string"||!RESULTS.has(result))return null;let view=mapRequestView(request);return view===null?null:/* @__PURE__ */Object.freeze({result:result,request:view})}function createRecordsSandboxController(deps){let funnel=deps.funnel??createRequestFunnel({auth:deps.auth,...deps.errorPolicy?{errorPolicy:deps.errorPolicy}:{}}),run=async(call,requestId,action,body)=>{let bad=requestIdError(requestId);if(bad!==null)return err(bad);let path=`${BASE}/${encodeURIComponent(requestId)}/${action}`,res=await funnel.send(call,body===void 0?{method:"POST",path:path}:{method:"POST",path:path,body:body});if(!res.ok)return err(res.error);let mapped=mapActionResult(res.value);return mapped===null?err(makeEverfurError("internalError",{retryable:false})):ok(mapped)};return{simulateClinicReply(requestId,outcome){return typeof outcome!="string"||!OUTCOMES.has(outcome)?Promise.resolve(err(invalid("outcome must be records, no_records or declined"))):run("records.sandbox.clinicReply",requestId,"clinic-reply",{outcome:outcome})},publishSampleRecord(requestId){return run("records.sandbox.publishSample",requestId,"publish-sample")}}}function useEverfurRecordsSandbox(){let{runtime:runtime,userRef:userRef,scopeEpoch:scopeEpoch}=useEverfurContext();return useMemo(()=>{let{services:services}=runtime.registry;return createRecordsSandboxController({auth:services.authFor(userRef),...services.errorPolicy?{errorPolicy:services.errorPolicy}:{}})},[runtime,userRef,scopeEpoch])}var VET_VISIT_SANDBOX_VISITS_PATH="/widget/v1/televet/sandbox/visits",PET_REF_MAX=128,VISIT_REF_MAX=64,STATUSES=/* @__PURE__ */new Set(["booked","cancelled","completed","no_show"]),RESULTS2=/* @__PURE__ */new Set(["applied","already_applied","not_applicable"]),EVENTS=/* @__PURE__ */new Set(["rescheduled","reminder","followup_sent","message_received","ended"]),REMINDER_STAGES=/* @__PURE__ */new Set(["24h","30m"]);function invalid2(wireMessage){return makeEverfurError("validationFailed",{retryable:false,wireMessage:wireMessage})}function textError(name,value,max){return typeof value!="string"||value.length===0?invalid2(`${name} is required and must be a non-empty string`):hasLoneSurrogate(value)?invalid2(`${name} contains an unpaired surrogate and cannot be encoded`):serverLength(value)>max?invalid2(`${name} is longer than ${max} characters`):null}function mapActionResult2(wire){if(typeof wire!="object"||wire===null)return null;let{result:result,visit:visit}=wire;if(typeof result!="string"||!RESULTS2.has(result)||typeof visit!="object"||visit===null)return null;let{visit_ref:visit_ref,pet_ref:pet_ref,status:status,scheduled_at:scheduled_at}=visit;return typeof visit_ref!="string"||visit_ref.length===0||typeof pet_ref!="string"||pet_ref.length===0||typeof status!="string"||!STATUSES.has(status)||typeof scheduled_at!="string"||scheduled_at.length===0?null:/* @__PURE__ */Object.freeze({result:result,visit:/* @__PURE__ */Object.freeze({visitRef:visit_ref,petRef:pet_ref,status:status,scheduledAt:scheduled_at})})}function createVetVisitSandboxController(deps){let funnel=deps.funnel??createRequestFunnel({auth:deps.auth,...deps.errorPolicy?{errorPolicy:deps.errorPolicy}:{}}),run=async(call,path,body)=>{let res=await funnel.send(call,{method:"POST",path:path,body:body},{idempotent:false,maxAttempts:1});if(!res.ok)return err(res.error);let mapped=mapActionResult2(res.value);return mapped===null?err(makeEverfurError("internalError",{retryable:false})):ok(mapped)};return{createVisit(petRef){let bad=textError("pet_ref",petRef,PET_REF_MAX);return bad!==null?Promise.resolve(err(bad)):run("televet.sandbox.createVisit",VET_VISIT_SANDBOX_VISITS_PATH,{pet_ref:petRef})},advanceVisit(visitRef,to){let bad=textError("visit_ref",visitRef,VISIT_REF_MAX);if(bad!==null)return Promise.resolve(err(bad));if(typeof to!="string"||!STATUSES.has(to))return Promise.resolve(err(invalid2("to must be booked, cancelled, completed or no_show")));let path=`${VET_VISIT_SANDBOX_VISITS_PATH}/${encodeURIComponent(visitRef)}/advance`;return run("televet.sandbox.advanceVisit",path,{to:to})},simulateVisitEvent(visitRef,event,stage){let bad=textError("visit_ref",visitRef,VISIT_REF_MAX);if(bad!==null)return Promise.resolve(err(bad));if(typeof event!="string"||!EVENTS.has(event))return Promise.resolve(err(invalid2(`event must be one of ${[...EVENTS].join(", ")}`)));if(event==="reminder"){if(typeof stage!="string"||!REMINDER_STAGES.has(stage))return Promise.resolve(err(invalid2(`stage must be one of ${[...REMINDER_STAGES].join(", ")} for a reminder`)))}else if(stage!==void 0)return Promise.resolve(err(invalid2("stage is only for a reminder")));let path=`${VET_VISIT_SANDBOX_VISITS_PATH}/${encodeURIComponent(visitRef)}/simulate`;return run("televet.sandbox.simulateVisitEvent",path,stage===void 0?{event:event}:{event:event,stage:stage})}}}function useEverfurVetVisitSandbox(){let{runtime:runtime,userRef:userRef,scopeEpoch:scopeEpoch}=useEverfurContext();return useMemo(()=>{let{services:services}=runtime.registry;return createVetVisitSandboxController({auth:services.authFor(userRef),...services.errorPolicy?{errorPolicy:services.errorPolicy}:{}})},[runtime,userRef,scopeEpoch])}export{useEverfurRecordsSandbox,useEverfurTestEntitlements,useEverfurVetVisitSandbox};
|
|
@@ -41,6 +41,12 @@ declare const SLOT_MIN_BORDER_CONTRAST = 3;
|
|
|
41
41
|
* of them (the link list names every ground a text link is drawn on).
|
|
42
42
|
*/
|
|
43
43
|
type SlotGrounds = Readonly<Record<EverfurThemeSlotName, readonly string[]>>;
|
|
44
|
+
/**
|
|
45
|
+
* The ground AROUND each filled slot that draws no edge of its own (a bubble on the chat ground, the send disc on the
|
|
46
|
+
* composer, a button on its card): what the slot's shape must stand out from. A slot missing here (the composer and
|
|
47
|
+
* the record card carry their own guarded edges, a link has no box) is never given an edge.
|
|
48
|
+
*/
|
|
49
|
+
type SlotSurrounds = Readonly<Partial<Record<EverfurThemeSlotName, readonly string[]>>>;
|
|
44
50
|
/**
|
|
45
51
|
* The contrast guard: every text colour a slot paints must reach `SLOT_MIN_CONTRAST` on the ground it is drawn on,
|
|
46
52
|
* and every edge `SLOT_MIN_BORDER_CONTRAST` on the fill it bounds.
|
|
@@ -57,7 +63,7 @@ type SlotGrounds = Readonly<Record<EverfurThemeSlotName, readonly string[]>>;
|
|
|
57
63
|
* reads below 3:1.
|
|
58
64
|
* Returns the same reference when nothing changes.
|
|
59
65
|
*/
|
|
60
|
-
declare function guardSlotContrast(slots: EverfurThemeSlots, grounds?: SlotGrounds): EverfurThemeSlots;
|
|
66
|
+
declare function guardSlotContrast(slots: EverfurThemeSlots, grounds?: SlotGrounds, surrounds?: SlotSurrounds): EverfurThemeSlots;
|
|
61
67
|
|
|
62
68
|
/** Recursively freeze a plain object/array tree in place and return it (typed as the input). */
|
|
63
69
|
declare function deepFreeze<T>(value: T): T;
|
|
@@ -167,6 +173,41 @@ interface EverfurColorTokens {
|
|
|
167
173
|
readonly onBubbleVet: string;
|
|
168
174
|
readonly skeleton: string;
|
|
169
175
|
readonly scanButtonPink: string;
|
|
176
|
+
/**
|
|
177
|
+
* The fill of a PICKED or CURRENT mark: the picked day and time chips, the `Now` pill on the request timeline,
|
|
178
|
+
* the open thread in the history list, a pet's initials disc on a partner palette. Everfur's dusty pink on the
|
|
179
|
+
* light palette (`scanButtonPink`); a dusk twin of it on the dark one. A partner `accent_color` (else
|
|
180
|
+
* `primary_color`) re-derives it as a tint of that colour over the partner's surface, so Everfur's pink never
|
|
181
|
+
* shows inside a partner's palette. Its ink is `onHighlight`.
|
|
182
|
+
*/
|
|
183
|
+
readonly highlight: string;
|
|
184
|
+
/** The ink on `highlight`: body black on the pink, computed by the resolver (4.5:1) for every other fill. */
|
|
185
|
+
readonly onHighlight: string;
|
|
186
|
+
/**
|
|
187
|
+
* A small brand MARK that carries no text: the ring round the pet avatar, the centre of the current step on the
|
|
188
|
+
* request timeline. Everfur's bright green by default; a partner accent (else primary) re-derives it, pushed until
|
|
189
|
+
* it reads at 3:1 (WCAG 1.4.11) on the grounds it sits on.
|
|
190
|
+
*/
|
|
191
|
+
readonly mark: string;
|
|
192
|
+
/**
|
|
193
|
+
* The edge of an OUTLINED control whose outline is what shows it (the chat header's Vet pill). The compiled value
|
|
194
|
+
* is `brandBorder`, kept exactly on Everfur's own palette; on a partner's brand or grounds it is pushed until it
|
|
195
|
+
* reads at 3:1 (WCAG 1.4.11) on every ground a control sits on.
|
|
196
|
+
*/
|
|
197
|
+
readonly controlEdge: string;
|
|
198
|
+
/**
|
|
199
|
+
* The outline of a STRUCTURAL mark that has nothing else to show it (a step still to come on the request timeline,
|
|
200
|
+
* the rail between steps, the edge of an informational banner). The compiled value is `borderHairlineGreen`, kept
|
|
201
|
+
* exactly on Everfur's own palette; on a partner's brand or grounds it is pushed to 3:1 (WCAG 1.4.11).
|
|
202
|
+
*/
|
|
203
|
+
readonly structureEdge: string;
|
|
204
|
+
/**
|
|
205
|
+
* The edge a `primary`-filled control needs when its fill does not stand out from the ground it sits on (a pale
|
|
206
|
+
* partner primary on a white chat: the send disc, the owner's bubble). Equal to `primary` whenever the fill alone
|
|
207
|
+
* reads at 3:1 on every such ground, which is every compiled palette; a surface draws an edge only when the two
|
|
208
|
+
* differ.
|
|
209
|
+
*/
|
|
210
|
+
readonly primaryEdge: string;
|
|
170
211
|
readonly checkupCardLowRiskBg: string;
|
|
171
212
|
readonly checkupCardConcernBg: string;
|
|
172
213
|
}
|
|
@@ -374,4 +415,4 @@ declare const EVERFUR_LIGHT: EverfurTheme;
|
|
|
374
415
|
/** The compiled DARK default (deeply frozen). */
|
|
375
416
|
declare const EVERFUR_DARK: EverfurTheme;
|
|
376
417
|
|
|
377
|
-
export { SLOT_MIN_CONTRAST as A, SYSTEM_FONT_FAMILY as B, SYSTEM_MONO_FAMILY as C, DEFAULT_MAX_FONT_SCALE as D, type
|
|
418
|
+
export { SLOT_MIN_CONTRAST as A, SYSTEM_FONT_FAMILY as B, SYSTEM_MONO_FAMILY as C, DEFAULT_MAX_FONT_SCALE as D, type EverfurColorTokens as E, type SlotGrounds as F, type SlotSurrounds as G, TEXT_SCALE_TIER_CAPS as H, cssCubicBezier as I, deepFreeze as J, guardSlotContrast as K, mergeThemeSlots as L, parseThemeSlots as M, SLOT_MIN_BORDER_CONTRAST as S, THEME_SLOT_KEYS as T, type EverfurFontFaceKey as a, type EverfurFontFamilies as b, type EverfurFontWeight as c, type EverfurLetterSpacingTokens as d, type EverfurLineHeightTokens as e, type EverfurMotionDurationTokens as f, type EverfurMotionTokens as g, type EverfurRadiusTokens as h, type EverfurSpaceTokens as i, type EverfurSpringToken as j, type EverfurTextColorTokens as k, type EverfurTheme as l, type EverfurThemeMeta as m, type EverfurThemeSlot as n, type EverfurThemeSlotKey as o, type EverfurThemeSlotName as p, type EverfurThemeSlots as q, type EverfurTypeSizeTokens as r, type EverfurTypeTokens as s, type EverfurWeightTokens as t, THEME_SLOT_NAMES as u, EASING_CURVES as v, EVERFUR_DARK as w, EVERFUR_LIGHT as x, type EverfurEasingCurve as y, type EverfurTextScaleTier as z };
|
|
@@ -41,6 +41,12 @@ declare const SLOT_MIN_BORDER_CONTRAST = 3;
|
|
|
41
41
|
* of them (the link list names every ground a text link is drawn on).
|
|
42
42
|
*/
|
|
43
43
|
type SlotGrounds = Readonly<Record<EverfurThemeSlotName, readonly string[]>>;
|
|
44
|
+
/**
|
|
45
|
+
* The ground AROUND each filled slot that draws no edge of its own (a bubble on the chat ground, the send disc on the
|
|
46
|
+
* composer, a button on its card): what the slot's shape must stand out from. A slot missing here (the composer and
|
|
47
|
+
* the record card carry their own guarded edges, a link has no box) is never given an edge.
|
|
48
|
+
*/
|
|
49
|
+
type SlotSurrounds = Readonly<Partial<Record<EverfurThemeSlotName, readonly string[]>>>;
|
|
44
50
|
/**
|
|
45
51
|
* The contrast guard: every text colour a slot paints must reach `SLOT_MIN_CONTRAST` on the ground it is drawn on,
|
|
46
52
|
* and every edge `SLOT_MIN_BORDER_CONTRAST` on the fill it bounds.
|
|
@@ -57,7 +63,7 @@ type SlotGrounds = Readonly<Record<EverfurThemeSlotName, readonly string[]>>;
|
|
|
57
63
|
* reads below 3:1.
|
|
58
64
|
* Returns the same reference when nothing changes.
|
|
59
65
|
*/
|
|
60
|
-
declare function guardSlotContrast(slots: EverfurThemeSlots, grounds?: SlotGrounds): EverfurThemeSlots;
|
|
66
|
+
declare function guardSlotContrast(slots: EverfurThemeSlots, grounds?: SlotGrounds, surrounds?: SlotSurrounds): EverfurThemeSlots;
|
|
61
67
|
|
|
62
68
|
/** Recursively freeze a plain object/array tree in place and return it (typed as the input). */
|
|
63
69
|
declare function deepFreeze<T>(value: T): T;
|
|
@@ -167,6 +173,41 @@ interface EverfurColorTokens {
|
|
|
167
173
|
readonly onBubbleVet: string;
|
|
168
174
|
readonly skeleton: string;
|
|
169
175
|
readonly scanButtonPink: string;
|
|
176
|
+
/**
|
|
177
|
+
* The fill of a PICKED or CURRENT mark: the picked day and time chips, the `Now` pill on the request timeline,
|
|
178
|
+
* the open thread in the history list, a pet's initials disc on a partner palette. Everfur's dusty pink on the
|
|
179
|
+
* light palette (`scanButtonPink`); a dusk twin of it on the dark one. A partner `accent_color` (else
|
|
180
|
+
* `primary_color`) re-derives it as a tint of that colour over the partner's surface, so Everfur's pink never
|
|
181
|
+
* shows inside a partner's palette. Its ink is `onHighlight`.
|
|
182
|
+
*/
|
|
183
|
+
readonly highlight: string;
|
|
184
|
+
/** The ink on `highlight`: body black on the pink, computed by the resolver (4.5:1) for every other fill. */
|
|
185
|
+
readonly onHighlight: string;
|
|
186
|
+
/**
|
|
187
|
+
* A small brand MARK that carries no text: the ring round the pet avatar, the centre of the current step on the
|
|
188
|
+
* request timeline. Everfur's bright green by default; a partner accent (else primary) re-derives it, pushed until
|
|
189
|
+
* it reads at 3:1 (WCAG 1.4.11) on the grounds it sits on.
|
|
190
|
+
*/
|
|
191
|
+
readonly mark: string;
|
|
192
|
+
/**
|
|
193
|
+
* The edge of an OUTLINED control whose outline is what shows it (the chat header's Vet pill). The compiled value
|
|
194
|
+
* is `brandBorder`, kept exactly on Everfur's own palette; on a partner's brand or grounds it is pushed until it
|
|
195
|
+
* reads at 3:1 (WCAG 1.4.11) on every ground a control sits on.
|
|
196
|
+
*/
|
|
197
|
+
readonly controlEdge: string;
|
|
198
|
+
/**
|
|
199
|
+
* The outline of a STRUCTURAL mark that has nothing else to show it (a step still to come on the request timeline,
|
|
200
|
+
* the rail between steps, the edge of an informational banner). The compiled value is `borderHairlineGreen`, kept
|
|
201
|
+
* exactly on Everfur's own palette; on a partner's brand or grounds it is pushed to 3:1 (WCAG 1.4.11).
|
|
202
|
+
*/
|
|
203
|
+
readonly structureEdge: string;
|
|
204
|
+
/**
|
|
205
|
+
* The edge a `primary`-filled control needs when its fill does not stand out from the ground it sits on (a pale
|
|
206
|
+
* partner primary on a white chat: the send disc, the owner's bubble). Equal to `primary` whenever the fill alone
|
|
207
|
+
* reads at 3:1 on every such ground, which is every compiled palette; a surface draws an edge only when the two
|
|
208
|
+
* differ.
|
|
209
|
+
*/
|
|
210
|
+
readonly primaryEdge: string;
|
|
170
211
|
readonly checkupCardLowRiskBg: string;
|
|
171
212
|
readonly checkupCardConcernBg: string;
|
|
172
213
|
}
|
|
@@ -374,4 +415,4 @@ declare const EVERFUR_LIGHT: EverfurTheme;
|
|
|
374
415
|
/** The compiled DARK default (deeply frozen). */
|
|
375
416
|
declare const EVERFUR_DARK: EverfurTheme;
|
|
376
417
|
|
|
377
|
-
export { SLOT_MIN_CONTRAST as A, SYSTEM_FONT_FAMILY as B, SYSTEM_MONO_FAMILY as C, DEFAULT_MAX_FONT_SCALE as D, type
|
|
418
|
+
export { SLOT_MIN_CONTRAST as A, SYSTEM_FONT_FAMILY as B, SYSTEM_MONO_FAMILY as C, DEFAULT_MAX_FONT_SCALE as D, type EverfurColorTokens as E, type SlotGrounds as F, type SlotSurrounds as G, TEXT_SCALE_TIER_CAPS as H, cssCubicBezier as I, deepFreeze as J, guardSlotContrast as K, mergeThemeSlots as L, parseThemeSlots as M, SLOT_MIN_BORDER_CONTRAST as S, THEME_SLOT_KEYS as T, type EverfurFontFaceKey as a, type EverfurFontFamilies as b, type EverfurFontWeight as c, type EverfurLetterSpacingTokens as d, type EverfurLineHeightTokens as e, type EverfurMotionDurationTokens as f, type EverfurMotionTokens as g, type EverfurRadiusTokens as h, type EverfurSpaceTokens as i, type EverfurSpringToken as j, type EverfurTextColorTokens as k, type EverfurTheme as l, type EverfurThemeMeta as m, type EverfurThemeSlot as n, type EverfurThemeSlotKey as o, type EverfurThemeSlotName as p, type EverfurThemeSlots as q, type EverfurTypeSizeTokens as r, type EverfurTypeTokens as s, type EverfurWeightTokens as t, THEME_SLOT_NAMES as u, EASING_CURVES as v, EVERFUR_DARK as w, EVERFUR_LIGHT as x, type EverfurEasingCurve as y, type EverfurTextScaleTier as z };
|
|
@@ -1,5 +1,17 @@
|
|
|
1
|
-
import { C as ClientBranding, E as EverfurThemeInput } from './branding-
|
|
2
|
-
import {
|
|
1
|
+
import { C as ClientBranding, E as EverfurThemeInput } from './branding-BYEqU855.js';
|
|
2
|
+
import { l as EverfurTheme, c as EverfurFontWeight, a as EverfurFontFaceKey } from './tokens-Tzo1KBND.js';
|
|
3
|
+
|
|
4
|
+
/** One partner input the contrast guard adjusted. */
|
|
5
|
+
interface EverfurThemeAdjustment {
|
|
6
|
+
/** The branding field as the console and the flat theme write it (`text_color`, `slots.userBubble.text_color`). */
|
|
7
|
+
readonly field: string;
|
|
8
|
+
/** Where the colour is drawn, in a few words (`body text`, `outline`). */
|
|
9
|
+
readonly role: string;
|
|
10
|
+
/** The colour the input asked for; null when the guard added a colour the input never set (a slot's edge). */
|
|
11
|
+
readonly requested: string | null;
|
|
12
|
+
/** The colour the surfaces paint there. */
|
|
13
|
+
readonly painted: string;
|
|
14
|
+
}
|
|
3
15
|
|
|
4
16
|
/**
|
|
5
17
|
* Overlay `b` onto `base`, field by field: a non-null branding field WINS; a null field KEEPS the base. A
|
|
@@ -86,6 +98,13 @@ declare const TEXT_SCALE_FLOOR = 0.5;
|
|
|
86
98
|
* motion, and the high-contrast derivation when the user asked for it.
|
|
87
99
|
*/
|
|
88
100
|
declare function resolveTheme(input?: ResolveThemeInput): EverfurTheme;
|
|
101
|
+
/**
|
|
102
|
+
* The partner inputs the contrast guard adjusted for this resolve input (`EverfurThemeAdjustment`): each branding
|
|
103
|
+
* field the resolved theme paints differently from what it asked for, with both colours. Read without the user's
|
|
104
|
+
* `prefers-contrast: more` derivation, which is the user's preference, not an adjustment of a partner's colour. Pure
|
|
105
|
+
* and total. The providers write it to the console once in a development build; a console preview can list it.
|
|
106
|
+
*/
|
|
107
|
+
declare function themeAdjustments(input?: ResolveThemeInput): readonly EverfurThemeAdjustment[];
|
|
89
108
|
/**
|
|
90
109
|
* The console's preview helper: resolve a draft branding exactly as the device would, from the raw shapes (the
|
|
91
110
|
* partner's `theme` prop and the server-shaped branding object the console is about to publish), with the device
|
|
@@ -109,4 +128,4 @@ interface EverfurFaceStyle {
|
|
|
109
128
|
*/
|
|
110
129
|
declare function face(theme: EverfurTheme, weight: EverfurFontFaceKey): EverfurFaceStyle;
|
|
111
130
|
|
|
112
|
-
export { type EverfurFaceStyle as E, type ResolveThemeInput as R, TEXT_SCALE_FLOOR as T, face as f, previewTheme as p, resolveTheme as r, withServerBranding as w };
|
|
131
|
+
export { type EverfurFaceStyle as E, type ResolveThemeInput as R, TEXT_SCALE_FLOOR as T, type EverfurThemeAdjustment as a, face as f, previewTheme as p, resolveTheme as r, themeAdjustments as t, withServerBranding as w };
|
|
@@ -1,5 +1,17 @@
|
|
|
1
|
-
import { C as ClientBranding, E as EverfurThemeInput } from './branding-
|
|
2
|
-
import {
|
|
1
|
+
import { C as ClientBranding, E as EverfurThemeInput } from './branding-BwEu68C8.cjs';
|
|
2
|
+
import { l as EverfurTheme, c as EverfurFontWeight, a as EverfurFontFaceKey } from './tokens-Tzo1KBND.cjs';
|
|
3
|
+
|
|
4
|
+
/** One partner input the contrast guard adjusted. */
|
|
5
|
+
interface EverfurThemeAdjustment {
|
|
6
|
+
/** The branding field as the console and the flat theme write it (`text_color`, `slots.userBubble.text_color`). */
|
|
7
|
+
readonly field: string;
|
|
8
|
+
/** Where the colour is drawn, in a few words (`body text`, `outline`). */
|
|
9
|
+
readonly role: string;
|
|
10
|
+
/** The colour the input asked for; null when the guard added a colour the input never set (a slot's edge). */
|
|
11
|
+
readonly requested: string | null;
|
|
12
|
+
/** The colour the surfaces paint there. */
|
|
13
|
+
readonly painted: string;
|
|
14
|
+
}
|
|
3
15
|
|
|
4
16
|
/**
|
|
5
17
|
* Overlay `b` onto `base`, field by field: a non-null branding field WINS; a null field KEEPS the base. A
|
|
@@ -86,6 +98,13 @@ declare const TEXT_SCALE_FLOOR = 0.5;
|
|
|
86
98
|
* motion, and the high-contrast derivation when the user asked for it.
|
|
87
99
|
*/
|
|
88
100
|
declare function resolveTheme(input?: ResolveThemeInput): EverfurTheme;
|
|
101
|
+
/**
|
|
102
|
+
* The partner inputs the contrast guard adjusted for this resolve input (`EverfurThemeAdjustment`): each branding
|
|
103
|
+
* field the resolved theme paints differently from what it asked for, with both colours. Read without the user's
|
|
104
|
+
* `prefers-contrast: more` derivation, which is the user's preference, not an adjustment of a partner's colour. Pure
|
|
105
|
+
* and total. The providers write it to the console once in a development build; a console preview can list it.
|
|
106
|
+
*/
|
|
107
|
+
declare function themeAdjustments(input?: ResolveThemeInput): readonly EverfurThemeAdjustment[];
|
|
89
108
|
/**
|
|
90
109
|
* The console's preview helper: resolve a draft branding exactly as the device would, from the raw shapes (the
|
|
91
110
|
* partner's `theme` prop and the server-shaped branding object the console is about to publish), with the device
|
|
@@ -109,4 +128,4 @@ interface EverfurFaceStyle {
|
|
|
109
128
|
*/
|
|
110
129
|
declare function face(theme: EverfurTheme, weight: EverfurFontFaceKey): EverfurFaceStyle;
|
|
111
130
|
|
|
112
|
-
export { type EverfurFaceStyle as E, type ResolveThemeInput as R, TEXT_SCALE_FLOOR as T, face as f, previewTheme as p, resolveTheme as r, withServerBranding as w };
|
|
131
|
+
export { type EverfurFaceStyle as E, type ResolveThemeInput as R, TEXT_SCALE_FLOOR as T, type EverfurThemeAdjustment as a, face as f, previewTheme as p, resolveTheme as r, themeAdjustments as t, withServerBranding as w };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { R as RecordsRequestId, P as PetRef } from './ids-B2GAAifq.cjs';
|
|
2
|
-
import { ag as RecordsClinicSearchInput, ah as RecordsClinicSearchPage, ai as RecordsRecentClinicsInput, aj as RecordsAuthorizationCopy, ak as CreateClinicRequestInput, al as RecordsSignatureUploadPolicy, m as RecordsClinic, W as RecordsClinicBatch, X as RecordsClinicBatchClient, n as RecordsDepthClient } from './depth-
|
|
3
|
-
import { E as EverfurResult } from './EverfurResult-
|
|
4
|
-
import { f as RecordsRequestGroupView, d as RecordsRequestView } from './models-
|
|
5
|
-
import { E as EverfurError } from './EverfurError-
|
|
2
|
+
import { ag as RecordsClinicSearchInput, ah as RecordsClinicSearchPage, ai as RecordsRecentClinicsInput, aj as RecordsAuthorizationCopy, ak as CreateClinicRequestInput, al as RecordsSignatureUploadPolicy, m as RecordsClinic, W as RecordsClinicBatch, X as RecordsClinicBatchClient, n as RecordsDepthClient } from './depth-CRyU7-pf.cjs';
|
|
3
|
+
import { E as EverfurResult } from './EverfurResult-dtl8ERAw.cjs';
|
|
4
|
+
import { f as RecordsRequestGroupView, d as RecordsRequestView } from './models-DzvqEjMm.cjs';
|
|
5
|
+
import { E as EverfurError } from './EverfurError-pEXDbUJ1.cjs';
|
|
6
6
|
|
|
7
7
|
interface RecordsClinicController {
|
|
8
8
|
searchClinics(input?: RecordsClinicSearchInput): Promise<EverfurResult<RecordsClinicSearchPage>>;
|
|
@@ -34,8 +34,9 @@ interface RecordsSignatureContext {
|
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
36
36
|
* A captured signature: a registered signature id (the PNG uploaded through the initiate/complete APIs, the
|
|
37
|
-
* consumer's own path, which keeps the bytes off the JSON body), or
|
|
38
|
-
*
|
|
37
|
+
* consumer's own path, which keeps the bytes off the JSON body), or an inline PNG: the built-in React Native
|
|
38
|
+
* pad's one-bit image (a few hundred bytes), or any built-in pad's PNG when the direct S3 POST was refused
|
|
39
|
+
* (`signatureUploadFallback.ts`). The widget create path accepts it inline up to 2 MiB of base64.
|
|
39
40
|
*/
|
|
40
41
|
type CapturedRecordsSignature = {
|
|
41
42
|
readonly signatureId: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { R as RecordsRequestId, P as PetRef } from './ids-B2GAAifq.js';
|
|
2
|
-
import { ag as RecordsClinicSearchInput, ah as RecordsClinicSearchPage, ai as RecordsRecentClinicsInput, aj as RecordsAuthorizationCopy, ak as CreateClinicRequestInput, al as RecordsSignatureUploadPolicy, m as RecordsClinic, W as RecordsClinicBatch, X as RecordsClinicBatchClient, n as RecordsDepthClient } from './depth-
|
|
3
|
-
import { E as EverfurResult } from './EverfurResult-
|
|
4
|
-
import { f as RecordsRequestGroupView, d as RecordsRequestView } from './models-
|
|
5
|
-
import { E as EverfurError } from './EverfurError-
|
|
2
|
+
import { ag as RecordsClinicSearchInput, ah as RecordsClinicSearchPage, ai as RecordsRecentClinicsInput, aj as RecordsAuthorizationCopy, ak as CreateClinicRequestInput, al as RecordsSignatureUploadPolicy, m as RecordsClinic, W as RecordsClinicBatch, X as RecordsClinicBatchClient, n as RecordsDepthClient } from './depth-vNpwOkZ8.js';
|
|
3
|
+
import { E as EverfurResult } from './EverfurResult-sKkoXew0.js';
|
|
4
|
+
import { f as RecordsRequestGroupView, d as RecordsRequestView } from './models-CrbUwbuS.js';
|
|
5
|
+
import { E as EverfurError } from './EverfurError-pEXDbUJ1.js';
|
|
6
6
|
|
|
7
7
|
interface RecordsClinicController {
|
|
8
8
|
searchClinics(input?: RecordsClinicSearchInput): Promise<EverfurResult<RecordsClinicSearchPage>>;
|
|
@@ -34,8 +34,9 @@ interface RecordsSignatureContext {
|
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
36
36
|
* A captured signature: a registered signature id (the PNG uploaded through the initiate/complete APIs, the
|
|
37
|
-
* consumer's own path, which keeps the bytes off the JSON body), or
|
|
38
|
-
*
|
|
37
|
+
* consumer's own path, which keeps the bytes off the JSON body), or an inline PNG: the built-in React Native
|
|
38
|
+
* pad's one-bit image (a few hundred bytes), or any built-in pad's PNG when the direct S3 POST was refused
|
|
39
|
+
* (`signatureUploadFallback.ts`). The widget create path accepts it inline up to 2 MiB of base64.
|
|
39
40
|
*/
|
|
40
41
|
type CapturedRecordsSignature = {
|
|
41
42
|
readonly signatureId: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { E as EverfurError } from './EverfurError-
|
|
1
|
+
import { E as EverfurError } from './EverfurError-pEXDbUJ1.cjs';
|
|
2
2
|
import { P as PetRef } from './ids-B2GAAifq.cjs';
|
|
3
|
-
import { E as EverfurResult } from './EverfurResult-
|
|
3
|
+
import { E as EverfurResult } from './EverfurResult-dtl8ERAw.cjs';
|
|
4
4
|
import { V as VetVisitIntent } from './visitIntent-D7_yVp1I.cjs';
|
|
5
5
|
|
|
6
6
|
/** What the hosted page will open for a handoff minted with `visitRef`: the platform's own echo. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { E as EverfurError } from './EverfurError-
|
|
1
|
+
import { E as EverfurError } from './EverfurError-pEXDbUJ1.js';
|
|
2
2
|
import { P as PetRef } from './ids-B2GAAifq.js';
|
|
3
|
-
import { E as EverfurResult } from './EverfurResult-
|
|
3
|
+
import { E as EverfurResult } from './EverfurResult-sKkoXew0.js';
|
|
4
4
|
import { V as VetVisitIntent } from './visitIntent-D7_yVp1I.js';
|
|
5
5
|
|
|
6
6
|
/** What the hosted page will open for a handoff minted with `visitRef`: the platform's own echo. */
|