@everfur/sdk 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +69 -4
- package/README.md +6 -1
- package/dist/{Chat-DwAC2vhB.d.ts → Chat-BZZ-Py5l.d.ts} +3 -3
- package/dist/{Chat-DPUD6dnc.d.cts → Chat-Dq4fffIO.d.cts} +3 -3
- package/dist/{DepthViews-DNEM96Se.d.ts → DepthViews-BG3E25MD.d.ts} +1 -1
- package/dist/{DepthViews-DP0R-DhB.d.cts → DepthViews-B_hIypI6.d.cts} +1 -1
- package/dist/{DepthViews-DbFhR4Du.d.cts → DepthViews-CL75jyRA.d.cts} +1 -1
- package/dist/{DepthViews-D_3hl4xk.d.ts → DepthViews-CkYri51q.d.ts} +1 -1
- package/dist/animations/index.cjs +1 -1
- package/dist/animations/index.d.cts +3 -3
- package/dist/animations/index.d.ts +3 -3
- package/dist/animations/index.js +1 -1
- package/dist/{attachments-CQgFrEQ7.d.cts → attachments-BorG422I.d.cts} +2 -2
- package/dist/{attachments-5NeobOCd.d.ts → attachments-BrUWQYNK.d.ts} +5 -4
- package/dist/{attachments-D8T5re7e.d.cts → attachments-D_SECjr1.d.cts} +5 -4
- package/dist/{attachments-Bw3iMQgu.d.ts → attachments-DpldrvIW.d.ts} +2 -2
- package/dist/bookingCopy-CqtDYvCR.d.ts +732 -0
- package/dist/bookingCopy-SREvkG19.d.cts +732 -0
- package/dist/{entitlementRepository-DSbzuyAW.d.ts → branding-CsRdeNwK.d.cts} +1 -133
- package/dist/{entitlementRepository-DKdXFgTo.d.cts → branding-CsRdeNwK.d.ts} +1 -133
- package/dist/callCopy-DoQKG3-L.d.cts +40 -0
- package/dist/callCopy-DoQKG3-L.d.ts +40 -0
- package/dist/casesRepository-DwtZVsbj.d.cts +51 -0
- package/dist/casesRepository-v6QczS9N.d.ts +51 -0
- package/dist/chat/index.cjs +1 -1
- package/dist/chat/index.d.cts +9 -8
- package/dist/chat/index.d.ts +9 -8
- package/dist/chat/index.js +1 -1
- package/dist/client/index.cjs +5 -5
- package/dist/client/index.d.cts +10 -8
- package/dist/client/index.d.ts +10 -8
- package/dist/client/index.js +5 -5
- package/dist/{config-CzTZGlfF.d.cts → config--Wu1Umhd.d.cts} +2 -2
- package/dist/{config-DW60uRb9.d.ts → config-C7eb_IMD.d.ts} +2 -2
- package/dist/consent/index.cjs +1 -1
- package/dist/consent/index.d.cts +5 -5
- package/dist/consent/index.d.ts +5 -5
- package/dist/consent/index.js +1 -1
- package/dist/{context-XvTzq1tE.d.cts → context-CL3lyuy1.d.cts} +6 -6
- package/dist/{context-DXhqHlPU.d.ts → context-CahAEha8.d.ts} +6 -6
- package/dist/{copy-Mjoo91aS.d.ts → copy-DdVFDL01.d.ts} +2 -2
- package/dist/{copy-bKDNigLb.d.cts → copy-UeUJVk8X.d.cts} +2 -2
- package/dist/core/index.cjs +7 -7
- package/dist/core/index.d.cts +118 -29
- package/dist/core/index.d.ts +118 -29
- package/dist/core/index.js +7 -7
- package/dist/{depth-CErXCU8J.d.cts → depth-D5HwcvKC.d.cts} +34 -3
- package/dist/{depth-DjDcJ6kH.d.ts → depth-DvPwPuT_.d.ts} +34 -3
- package/dist/entitlementRepository-B7egEdW6.d.ts +43 -0
- package/dist/entitlementRepository-BpJ7tiwl.d.cts +43 -0
- package/dist/{identity-DI4eVx9S.d.cts → identity-C2-08BZW.d.cts} +2 -2
- package/dist/{identity-BMx2SUOM.d.ts → identity-CEi9GRFZ.d.ts} +2 -2
- package/dist/index.cjs +6 -6
- package/dist/index.d.cts +17 -16
- package/dist/index.d.ts +17 -16
- package/dist/index.js +6 -6
- package/dist/notifications/index.cjs +2 -2
- package/dist/notifications/index.d.cts +2 -2
- package/dist/notifications/index.d.ts +2 -2
- package/dist/notifications/index.js +2 -2
- package/dist/optionalModule-DbJmsq5f.d.cts +21 -0
- package/dist/optionalModule-DbJmsq5f.d.ts +21 -0
- package/dist/{pets-CtQdRpWo.d.ts → pets-DJv2sj2H.d.ts} +1 -1
- package/dist/{pets-aB8q0JyX.d.cts → pets-JVCXgRgR.d.cts} +1 -1
- package/dist/{casesRepository-DHwtGRYY.d.cts → petsRepository-B_gKbAzJ.d.cts} +2 -48
- package/dist/{casesRepository-ClLv6qMl.d.ts → petsRepository-Bk6GDwLs.d.ts} +2 -48
- package/dist/photo/index.cjs +1 -1
- package/dist/photo/index.js +1 -1
- package/dist/{ports-DEBzEhbp.d.cts → ports-BY2ph0_y.d.cts} +5 -15
- package/dist/{ports-DMolTRzU.d.ts → ports-D7YW8qz9.d.ts} +5 -15
- package/dist/records/depth/index.cjs +2 -2
- package/dist/records/depth/index.d.cts +7 -7
- package/dist/records/depth/index.d.ts +7 -7
- package/dist/records/depth/index.js +2 -2
- package/dist/records/index.cjs +3 -3
- package/dist/records/index.d.cts +9 -9
- package/dist/records/index.d.ts +9 -9
- package/dist/records/index.js +3 -3
- package/dist/{requestFunnel-L-BQfi0z.d.cts → requestFunnel-BjDpqqvm.d.cts} +25 -2
- package/dist/{requestFunnel-CjW7uDuA.d.ts → requestFunnel-DFMGcluw.d.ts} +25 -2
- package/dist/{runtime-B8s-_hv8.d.cts → runtimeTypes-gZEJu-da.d.cts} +9 -99
- package/dist/{runtime-BR9ysG0J.d.ts → runtimeTypes-w5KqBMcs.d.ts} +9 -99
- package/dist/server/events/index.cjs +1 -1
- package/dist/server/events/index.d.cts +2 -2
- package/dist/server/events/index.d.ts +2 -2
- package/dist/server/events/index.js +1 -1
- package/dist/server/index.cjs +1 -1
- package/dist/server/index.d.cts +3 -3
- package/dist/server/index.d.ts +3 -3
- package/dist/server/index.js +1 -1
- package/dist/televet/booking/index.cjs +1 -0
- package/dist/televet/booking/index.d.cts +294 -0
- package/dist/televet/booking/index.d.ts +294 -0
- package/dist/televet/booking/index.js +1 -0
- package/dist/televet/call/index.cjs +1 -0
- package/dist/televet/call/index.d.cts +141 -0
- package/dist/televet/call/index.d.ts +141 -0
- package/dist/televet/call/index.js +1 -0
- package/dist/televet/index.cjs +1 -1
- package/dist/televet/index.d.cts +87 -5
- package/dist/televet/index.d.ts +87 -5
- package/dist/televet/index.js +1 -1
- package/dist/testing/index.cjs +3 -3
- package/dist/testing/index.d.cts +2 -2
- package/dist/testing/index.d.ts +2 -2
- package/dist/testing/index.js +3 -3
- package/dist/testing/rn/index.cjs +1 -1
- package/dist/testing/rn/index.d.cts +9 -8
- package/dist/testing/rn/index.d.ts +9 -8
- package/dist/testing/rn/index.js +1 -1
- package/dist/testing/web/index.cjs +1 -1
- package/dist/testing/web/index.d.cts +9 -8
- package/dist/testing/web/index.d.ts +9 -8
- package/dist/testing/web/index.js +1 -1
- package/dist/{timelineRows-DZed6dAM.d.ts → timelineRows-C15jxFFH.d.ts} +1 -1
- package/dist/{timelineRows-CaohZzXS.d.cts → timelineRows-odO8g9r2.d.cts} +1 -1
- package/dist/typeStyle-CKqVYD6L.d.cts +111 -0
- package/dist/typeStyle-DmoyacDG.d.ts +111 -0
- package/dist/{useRecordsDepth-BHBzJ76R.d.cts → useRecordsDepth-C6rjEaLn.d.cts} +1 -1
- package/dist/{useRecordsDepth-BU-OhzH6.d.ts → useRecordsDepth-crhBllQK.d.ts} +1 -1
- package/dist/video/index.cjs +1 -1
- package/dist/video/index.js +1 -1
- package/dist/{view-DtSPYpKa.d.ts → view-Bxwxp4xD.d.ts} +2 -2
- package/dist/{view-C3qPIXGX.d.cts → view-DyitEO0m.d.cts} +2 -2
- package/dist/web/consent/index.cjs +1 -1
- package/dist/web/consent/index.d.cts +5 -5
- package/dist/web/consent/index.d.ts +5 -5
- package/dist/web/consent/index.js +1 -1
- package/dist/web/index.cjs +7 -7
- package/dist/web/index.d.cts +18 -17
- package/dist/web/index.d.ts +18 -17
- package/dist/web/index.js +7 -7
- package/dist/web/notifications/index.cjs +2 -2
- package/dist/web/notifications/index.d.cts +3 -3
- package/dist/web/notifications/index.d.ts +3 -3
- package/dist/web/notifications/index.js +2 -2
- package/dist/web/records/depth/index.cjs +2 -2
- package/dist/web/records/depth/index.d.cts +7 -7
- package/dist/web/records/depth/index.d.ts +7 -7
- package/dist/web/records/depth/index.js +2 -2
- package/dist/web/records/index.cjs +3 -3
- package/dist/web/records/index.d.cts +102 -11
- package/dist/web/records/index.d.ts +102 -11
- package/dist/web/records/index.js +3 -3
- package/dist/web/televet/booking/index.cjs +1 -0
- package/dist/web/televet/booking/index.d.cts +349 -0
- package/dist/web/televet/booking/index.d.ts +349 -0
- package/dist/web/televet/booking/index.js +1 -0
- package/dist/web/televet/call/index.cjs +1 -0
- package/dist/web/televet/call/index.d.cts +142 -0
- package/dist/web/televet/call/index.d.ts +142 -0
- package/dist/web/televet/call/index.js +1 -0
- package/dist/web/televet/index.cjs +1 -1
- package/dist/web/televet/index.d.cts +90 -4
- package/dist/web/televet/index.d.ts +90 -4
- package/dist/web/televet/index.js +1 -1
- package/package.json +72 -4
- package/televet/booking/package.json +8 -0
- package/televet/call/package.json +8 -0
- package/web/televet/booking/native-blocked.cjs +12 -0
- package/web/televet/booking/package.json +8 -0
- package/web/televet/call/native-blocked.cjs +12 -0
- package/web/televet/call/package.json +8 -0
- package/dist/typeStyle-0TydiZ1w.d.cts +0 -19
- package/dist/typeStyle-CWMsoe6b.d.ts +0 -19
package/dist/video/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {createContext,forwardRef,useState,useEffect,useCallback,useSyncExternalStore,useMemo,createElement,useContext,Component}from'react';import {TextInput,View,ActivityIndicator,Pressable,ScrollView,StyleSheet,Text}from'react-native';import {jsx,jsxs}from'react/jsx-runtime';var Mr=Object.defineProperty;var o=(e,r)=>Mr(e,"name",{value:r,configurable:true});var re=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(re.map(e=>e.wireCode));var Lr=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"}),we=Object.freeze(re.map(e=>Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:Lr[e.wireCode]}))),Ur=new Map(we.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),Br=Object.freeze(["http_envelope",...[...new Set(we.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function V(e,r){if(typeof e!="string")return;let t=e.trim().toUpperCase();if(t.length!==0)for(let n of [r??"http_envelope",...Br]){let i=Ur.get(n+t);if(i)return i}}o(V,"contractErrorFor");function Vr(e){return e.envelope==="sse_frame"?`/errors#sse-${e.wireCode}`:e.envelope==="oauth_error"?`/errors#oauth-${e.wireCode}`:`/errors#${e.wireCode}`}o(Vr,"contractDocUrl");function Fe(e){return null}o(Fe,"publishedDocUrl");var qr=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 Oe(e){return qr[e]}o(Oe,"categoryFor");function Pe(e){let r=V(e);if(r)return r.normalized;let t=(e??"").trim().toUpperCase(),n=t.replace(/[^A-Z0-9]/g,"");if(n==="AUTHREJECTED")return "authRejected";if(t.startsWith("AUTH"))return "authExpired";switch(n){case "DAILYQUOTAEXCEEDED":case "QUOTAEXCEEDED":return "quotaExceeded";case "RATELIMITED":case "TOOMANYREQUESTS":return "rateLimited";case "IDEMPOTENCYKEYCONFLICT":case "IDEMPOTENCYCONFLICT":return "idempotencyConflict";case "ACCESSDENIED":case "FORBIDDEN":return "accessDenied";case "NOTFOUND":case "CONVERSATIONNOTFOUND":return "conversationNotFound";case "PETNOTFOUND":return "petNotFound";case "TIMEOUT":case "STREAMTIMEOUT":return "streamTimeout";case "MEDIAUPLOADFAILED":case "UNRECOGNIZEDVIDEOFORMAT":case "FILETOOSMALL":return "mediaUploadFailed";case "MODERATIONBLOCKED":return "moderationBlocked";case "UPSTREAMLLMTIMEOUT":return "upstreamLlmTimeout";case "INTERNALERROR":case "INTERNALSERVERERROR":return "internalError";case "STREAMINCOMPLETE":case "CHATSTREAMINCOMPLETE":return "streamIncomplete";case "INVALIDANALYSISTYPE":case "INVALIDUPLOADPURPOSE":return "unknown";default:return "unknown"}}o(Pe,"fromWire");var Hr=new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function te(e){return Hr.has(e)}o(te,"isAutoRetryable");var Kr=new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function Ie(e){return te(e)||Kr.has(e)}o(Ie,"isRetryableCode");var Gr=500,ne=8e3,Ae=4;function ze(e,r=Math.random){let t=Math.max(0,e),n=Math.min(Gr*2**t,ne);return Math.floor(r()*n)}o(ze,"backoffDelayMs");var Yr=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 oe(e){return Yr[e]}o(oe,"userFacingError");function je(e,r,t){Object.defineProperty(e,r,{value:t,enumerable:false,writable:false,configurable:false});}o(je,"defineHidden");var Wr=/^[a-z][a-z0-9_]{0,63}$/;function m(e,r){let t=V(r?.wireCode,r?.wireEnvelope),n={code:e,category:Oe(e),retryable:r?.retryable??Ie(e),displayMessage:oe(e)};if(r?.httpStatus!==void 0&&(n.httpStatus=r.httpStatus),r?.requestId&&(n.requestId=r.requestId),typeof r?.reasonCode=="string"&&Wr.test(r.reasonCode)&&(n.reasonCode=r.reasonCode),t);return r?.wireMessage&&je(n,"wireMessage",r.wireMessage),r?.raw!==void 0&&r.raw!==null&&je(n,"raw",r.raw),Object.freeze(n)}o(m,"makeEverfurError");function j(e,r){return Object.freeze(r===void 0?{ok:true,value:e}:{ok:true,value:e,warning:r})}o(j,"ok");function y(e){return Object.freeze({ok:false,error:e})}o(y,"err");var q=class q extends Error{constructor(r,t){super(t),this.name="EverfurConfigError",this.kind=r,Object.setPrototypeOf(this,q.prototype);}};o(q,"EverfurConfigError");var z=q;function H(e){throw new Error(`assertNever: unhandled discriminated-union member ${JSON.stringify(e)}`)}o(H,"assertNever");function De(e){return Object.freeze({kind:"error",terminal:true,code:e.code,retryable:e.retryable,wireMessage:e.wireMessage,synthesized:e.synthesized,lastEventId:e.lastEventId,serverRequestId:e.serverRequestId??null})}o(De,"errorFrame");function Qr(e){let r={};return e.mode==="personalized"?r.authorization=`Bearer ${e.token}`:r["x-everfur-partner-key"]=e.publishableKey,e.userRef&&(r["x-everfur-user-ref"]=e.userRef),e.sessionId&&(r["x-everfur-session-id"]=e.sessionId),r}o(Qr,"authHeaders");function D(e,r){return {...e,headers:{...Xr(e.headers),...Qr(r)}}}o(D,"withAuthHeaders");function Xr(e){if(!e)return {};let r={};for(let[t,n]of Object.entries(e)){let i=t.toLowerCase();i==="authorization"||i==="x-everfur-partner-key"||(r[t]=n);}return r}o(Xr,"stripAuthHeaders");async function Ne(e,r){if(r.mode==="anonymous")return r.transport.request(D(e,{mode:"anonymous",publishableKey:r.publishableKey,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));let t;try{t=await r.identity.currentToken();}catch{return y(ie())}let n=await r.transport.request(D(e,{mode:"personalized",token:t,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));if(n.ok||n.error.httpStatus!==401)return n;let i;try{i=await r.identity.currentToken({forceRefresh:!0});}catch{return y(ie())}let a=await r.transport.request(D(e,{mode:"personalized",token:i,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));return !a.ok&&a.error.httpStatus===401?y(ie(a.error.httpStatus)):a}o(Ne,"authedSend");function ie(e){return m("authRejected",{retryable:false,...e!==void 0?{httpStatus:e}:{}})}o(ie,"authRejectedError");function Me(e){return m("internalError",{retryable:true,wireMessage:Zr(e)})}o(Me,"networkError");function Zr(e){return e instanceof Error?e.message:typeof e=="string"?e:"network request failed"}o(Zr,"describeCause");var et=3e4,rt=ne*2,tt="idempotency-key",nt=new Set(["POST","PUT","PATCH","DELETE"]),ot=Object.freeze({onEvent(){}}),it=Object.freeze({setTimeout:o((e,r)=>setTimeout(e,r),"setTimeout"),clearTimeout:o(e=>clearTimeout(e),"clearTimeout"),now:o(()=>Date.now(),"now")});function Ue(e){let r=e.observer??ot,t=e.timers??it,n=e.rng??Math.random,i=e.sleep??((h,g)=>vt(h,t,g)),a=e.maxAttempts??Ae,s=e.unaryTimeoutMs??et,l=e.newIdempotencyKey??st(),u=o(h=>{try{r.onEvent(h);}catch{}},"emit");async function p(h,g,v){let k=v?.maxAttempts,w=Math.max(1,k??a),Q=v?.idempotent??nt.has(g.method)?l():null,Nr=at(g,Q),X=0;for(;;){let I=o(ee=>Object.freeze({call:h,method:g.method,path:g.path,attempt:X,...Q?{idempotencyKey:Q}:{},...ee}),"stamp");u(I({phase:"attempt"}));let Te=bt(s,t),ke=gt(Te.signal,g.signal),A;try{A=await Ne({...Nr,signal:ke.signal},e.auth);}catch(ee){A=y(Me(ee));}finally{ke.dispose(),Te.cancel();}if(A.ok)return u(I({phase:"settled",ok:true,reason:"ok"})),A;let T=A.error,B=dt(T,X,{maxAttempts:w,rng:n,now:t.now(),aborted:g.signal?.aborted===true,...k!==void 0?{perCallMaxAttempts:k}:{},...e.errorPolicy!==void 0?{policy:e.errorPolicy}:{}}),Z={ok:false,code:T.code,reason:B.reason,...T.httpStatus!==void 0?{httpStatus:T.httpStatus}:{},...T.requestId!==void 0?{requestId:T.requestId}:{}};if(!B.retry)return u(I({phase:"settled",...Z})),y(T);if(u(I({phase:"retry",...Z,delayMs:B.delayMs})),await i(B.delayMs,g.signal),g.signal?.aborted===true)return u(I({phase:"settled",...Z,reason:"aborted"})),y(T);X+=1;}}o(p,"send");async function f(h){return D(h,await mt(e.auth))}o(f,"authorize");async function*R(h,g,v){u(Object.freeze({call:h,phase:"stream.open",method:g.method,path:g.path,attempt:0}));try{yield*e.auth.transport.stream(g,v);}catch{yield De({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:null});}}return o(R,"stream"),Object.freeze({send:p,authorize:f,stream:R})}o(Ue,"createRequestFunnel");function at(e,r){let t={};for(let[n,i]of Object.entries(e.headers??{}))n.toLowerCase()!==tt&&(t[n]=i);return r!==null&&(t["Idempotency-Key"]=r),{...e,headers:t}}o(at,"assembleHeaders");function st(){let e=0;return ()=>`efk_${Date.now().toString(36)}_${(e++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}o(st,"defaultIdempotencyKeyFactory");var lt=10;function dt(e,r,t){if(t.aborted)return {retry:false,reason:"aborted"};let n=ut(e);if(n==="quota")return {retry:false,reason:"daily-quota-exhausted"};if(n!=="burst"&&!te(e.code))return {retry:false,reason:"terminal-code"};let i=n==="burst"?"burst-throttle":"retryable-code";if(o(()=>{if(t.policy===void 0)return false;try{return !t.policy.shouldRetry(e.code,r)}catch{return false}},"policyVetoedRetry")())return {retry:false,reason:"terminal-code"};let s=o(()=>{if(t.policy===void 0)return null;let p;try{p=t.policy.maxAttempts(e.code);}catch{return null}return typeof p!="number"||!Number.isFinite(p)?null:Math.max(1,Math.min(lt,Math.floor(p)))},"policyCeiling"),l=t.perCallMaxAttempts??s()??t.maxAttempts;if(r+1>=l)return {retry:false,reason:"attempts-exhausted"};let u=ct(e,t.now);return u!==null?u>rt?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:i,delayMs:u}:{retry:true,reason:i,delayMs:ze(r,t.rng)}}o(dt,"decideRetry");function ut(e){let r=e.code==="unknown"?Pe(yt(e.raw)):e.code;return r==="quotaExceeded"?"quota":r==="rateLimited"||e.httpStatus===429?"burst":null}o(ut,"throttleKind");function ct(e,r){let t=pt(e.raw);if(t===null)return null;let n=t-r;return n>0?n:0}o(ct,"retryOverrideMs");function pt(e){for(let r of Be(e)){let t=r.resets_at,n=ft(t);if(n!==null)return n}return null}o(pt,"findResetsAt");function Be(e){if(!Le(e))return [];let r=[e];for(let t of ["error","detail"]){let n=e[t];Le(n)&&r.push(n);}return r}o(Be,"candidateScopes");function ft(e){if(typeof e=="number"&&Number.isFinite(e))return e<1e11?Math.round(e*1e3):Math.round(e);if(typeof e=="string"&&e.trim().length>0){let r=Date.parse(e);return Number.isFinite(r)?r:null}return null}o(ft,"parseInstantMs");function yt(e){for(let r of Be(e)){let t=r.code;if(typeof t=="string"&&t.length>0)return t}return null}o(yt,"rawWireCode");function Le(e){return typeof e=="object"&&e!==null}o(Le,"isRecord");async function mt(e){return e.mode==="anonymous"?{mode:"anonymous",publishableKey:e.publishableKey,userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{}}:{mode:"personalized",token:await e.identity.currentToken(),userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{}}}o(mt,"resolveDeviceAuth");function bt(e,r){let t=new AbortController,n=r.setTimeout(()=>t.abort(),e);return {signal:t.signal,cancel:o(()=>r.clearTimeout(n),"cancel")}}o(bt,"boundedSignal");function gt(e,r){let t=o(()=>{},"noop");if(!r)return {signal:e,dispose:t};let n=new AbortController;if(e.aborted||r.aborted)return n.abort(),{signal:n.signal,dispose:t};let i=o(()=>n.abort(),"onAbort");return e.addEventListener("abort",i,{once:true}),r.addEventListener("abort",i,{once:true}),{signal:n.signal,dispose:o(()=>{e.removeEventListener("abort",i),r.removeEventListener("abort",i);},"dispose")}}o(gt,"mergeSignals");function vt(e,r,t){return e<=0||t?.aborted===true?Promise.resolve():new Promise(n=>{let i=r.setTimeout(()=>{t?.removeEventListener("abort",a),n();},e),a=o(()=>{r.clearTimeout(i),n();},"onAbort");t?.addEventListener("abort",a,{once:true});})}o(vt,"delayAbortable");var Ve=Object.freeze({track(){},trackExpectedFailure(){}});function qe(e){let r={uri:e.uri,mimeType:e.mimeType},t=G(e);return t!==null&&(r.sizeBytes=t),Object.freeze(r)}o(qe,"fileHandleFromMedia");function G(e){let r=e.byteSize??e.sizeBytes;return typeof r=="number"&&Number.isFinite(r)&&r>=0?r:null}o(G,"mediaByteSize");function He(e){let r=e.durationSeconds;return typeof r=="number"&&Number.isFinite(r)&&r>=0?Math.round(r*1e3):null}o(He,"mediaDurationMs");function Ke(e,r){return Object.freeze(r===void 0?{mode:e}:{mode:e,maxDurationSeconds:r})}o(Ke,"captureOptionsFor");function ae(e){return e!=null&&e.isAvailable===true}o(ae,"isCaptureAvailable");var Ge=Object.freeze({setTimeout:o((e,r)=>setTimeout(e,r),"setTimeout"),clearTimeout:o(e=>clearTimeout(e),"clearTimeout"),now:o(()=>Date.now(),"now")});function Ye(e,r,t){return new Promise(n=>{if(r.aborted){n();return}let i={handle:void 0},a=o(()=>{t.clearTimeout(i.handle),r.removeEventListener("abort",a),n();},"done");i.handle=t.setTimeout(a,e),r.addEventListener("abort",a,{once:true});})}o(Ye,"delayAbortable");function ht(e,r){if(!r)return e;let t=new AbortController;if(e.aborted||r.aborted)return t.abort(),t.signal;let n=o(()=>t.abort(),"onAbort");return e.addEventListener("abort",n,{once:true}),r.addEventListener("abort",n,{once:true}),t.signal}o(ht,"mergeSignals");var se=class se{constructor(r){this.listeners=new Set;this.epoch=0;this.inFlight=null;this.snapshot=Object.freeze({...r});}subscribe(r){return this.listeners.add(r),()=>{this.listeners.delete(r);}}getSnapshot(){return this.snapshot}patch(r){this.snapshot=Object.freeze({...this.snapshot,...r});for(let t of this.listeners)t();}beginOperation(r){this.inFlight?.abort();let t=new AbortController;this.inFlight=t;let n=this.epoch;return {signal:r?ht(t.signal,r):t.signal,epoch:n,settle:o(()=>{this.inFlight===t&&(this.inFlight=null);},"settle")}}alive(r){return r===this.epoch}rescope(){this.epoch+=1,this.inFlight?.abort(),this.inFlight=null;}dispose(){this.epoch+=1,this.inFlight?.abort(),this.inFlight=null,this.listeners.clear();}};o(se,"MediaStore");var K=se;function We(e){for(let r=0;r<e.length;r+=1){let t=e.charCodeAt(r);if(t>=55296&&t<=56319){let n=e.charCodeAt(r+1);if(!(n>=56320&&n<=57343))return true;r+=1;}else if(t>=56320&&t<=57343)return true}return false}o(We,"hasLoneSurrogate");var Et=Object.freeze(["primary_label","primary_confidence","subtype_label","subtype_display","subtype_confidence","risk_tier","confidence_tier","copy_short","disease_name","disease_framing","model_version","skin_v2","eye_v2","llm_checkup"]),_t=Object.freeze(["decision_audit","decision_thresholds","per_class_auroc","ood_layers","gate1_score","possible_conditions","top_class"]),Rt=new Set(["skin_v2","eye_v2","llm_checkup"]),St=new Set(["primary_confidence","subtype_confidence"]),Ct=new Set(["low_risk","concern","uncertain"]),Tt=new Set(["possible","probable"]),kt=Object.freeze({primary_label:64,subtype_label:64,subtype_display:128,copy_short:512,disease_name:128,disease_framing:512,model_version:64});function Je(e){let r=c(e)?e:{},t={};for(let i of Et){if(!(i in r))continue;let a=r[i],s=xt(i,a);s!==F&&(t[i]=s);}let n=0;for(let i of _t)i in r&&(n+=1);return Object.freeze({metadata:Object.freeze(t),droppedOperatorKeys:n})}o(Je,"projectDetectionMetadata");var F=Symbol("drop");function xt(e,r){if(Rt.has(e))return typeof r=="boolean"?r:F;if(St.has(e))return $e(r)?r:F;if(e==="risk_tier")return typeof r=="string"&&Ct.has(r)?r:F;if(e==="confidence_tier")return typeof r=="string"&&Tt.has(r)?r:F;if(typeof r!="string")return F;let t=kt[e]??256;return r.length>t?r.slice(0,t):r}o(xt,"acceptKey");function $e(e){return typeof e=="number"&&Number.isFinite(e)&&e>=0&&e<=1}o($e,"isUnitConfidence");function Qe(e){if(!c(e))return null;let r=b(e.summary),t=b(e.disclaimer),n=le(e.recommendations??e.recommendation);return r===null&&t===null&&n.length===0?null:Object.freeze({summary:r??"",recommendations:Object.freeze(n),disclaimer:t??""})}o(Qe,"parseInterpretation");function Xe(e){if(!c(e))return {};if(c(e.metadata))return e.metadata;let r=e.detections;if(Array.isArray(r)&&r.length>0){let t=r[0];if(c(t)&&c(t.metadata))return t.metadata;if(c(t))return t}return e}o(Xe,"locateDetectionMetadata");function Ze(e){return c(e)?c(e.interpretation)?e.interpretation:e:null}o(Ze,"locateInterpretation");function c(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(c,"isRecord");function b(e){return typeof e=="string"&&e.length>0?e:null}o(b,"asString");function le(e){return typeof e=="string"?e.length>0?[e]:[]:Array.isArray(e)?e.filter(r=>typeof r=="string"&&r.length>0):[]}o(le,"asStringList");function er(e){return $e(e)?e:null}o(er,"asUnitNumber");function O(e){return typeof e=="number"&&Number.isFinite(e)?e:null}o(O,"asFiniteNumber");var Y=Object.freeze({initiate:"/widget/v1/uploads/initiate",precheck:"/widget/v1/photo/precheck",photoAnalyze:"/widget/v1/photo/analyze",videoAnalyze:"/widget/v1/video/analyze",job:o(e=>We(e)?null:`/widget/v1/analysis/jobs/${encodeURIComponent(e)}`,"job")});async function tr(e,r){let t={purpose:r.purpose,content_type:r.contentType};r.byteSize!==null&&(t.byte_size=r.byteSize);let n={method:"POST",path:Y.initiate,body:t,...r.signal?{signal:r.signal}:{}},i=await e.send("media.initiateUpload",n);if(!i.ok)return y(i.error);let a=wt(i.value);return a===null?y(m("mediaUploadFailed",{retryable:false})):j(a)}o(tr,"initiateUpload");function wt(e){if(!c(e))return null;let r=b(e.url),t=b(e.s3_key);if(r===null||t===null)return null;let n=e.fields,i={};if(c(n))for(let[a,s]of Object.entries(n))typeof s=="string"&&(i[a]=s);return Object.freeze({url:r,fields:Object.freeze(i),s3Key:t,expiresAt:O(e.expires_at)})}o(wt,"parsePresigned");async function nr(e,r,t,n,i){try{return await e.presignedPut(qe(r),{target:t,idempotencyKey:n,...i?{signal:i}:{}}),j(void 0)}catch{return y(m("mediaUploadFailed",{retryable:false}))}}o(nr,"stageUpload");async function or(e,r,t,n,i){let a={method:"POST",path:r,body:t,...i?{signal:i}:{}},s=await e.send("media.analyze",a);if(s.ok){let u=Ft(s.value);return u!==null?{kind:"async",job:u}:{kind:"sync",body:s.value}}let l=n(s.error.httpStatus,s.error);return l!==null?{kind:"gate",gate:l}:{kind:"error",error:s.error}}o(or,"submitAnalyze");function Ft(e){if(!c(e))return null;let r=b(e.job_id);if(r===null)return null;let t=b(e.status);return t!==null&&At(t)?null:Object.freeze({jobId:r,estimatedSeconds:O(e.estimated_completion_seconds)})}o(Ft,"parseAsyncJob");var Ot=2e3,rr=5e3,Pt=9e4;async function ir(e,r,t){let{timers:n,signal:i,alive:a}=t,s=n.now(),l=Math.max(Pt,(t.estimatedSeconds??0)*1e3),u=Ot;for(;;){if(i.aborted||!a())return {kind:"aborted"};if(await Ye(u,i,n),i.aborted||!a())return {kind:"aborted"};if(n.now()-s>l)return {kind:"timeout"};let p=Y.job(r);if(p===null)return {kind:"notFound"};let f=await e.send("media.pollJob",{method:"GET",path:p,...i?{signal:i}:{}},{maxAttempts:1});if(i.aborted||!a())return {kind:"aborted"};if(!f.ok){if(f.error.httpStatus===404)return {kind:"notFound"};u=Math.min(rr,u+1e3);continue}let R=It(f.value);if(R==="COMPLETED")return {kind:"complete",body:f.value};if(R==="FAILED")return {kind:"failed",error:zt(f.value)};u=Math.min(rr,u+1e3);}}o(ir,"pollJob");function It(e){return c(e)?(b(e.status)??"PROCESSING").toUpperCase():"PROCESSING"}o(It,"jobStatusOf");function At(e){let r=e.toUpperCase();return r==="COMPLETED"||r==="FAILED"}o(At,"isTerminalStatus");function zt(e){let r=c(e)?b(e.error)??b(e.error_code):null;return m("internalError",{retryable:false,...r?{wireMessage:r}:{}})}o(zt,"jobFailureError");function ar(){return null}o(ar,"detectNoGate");function sr(e,r){let t={s3_key:e};return r.type!==void 0&&(t.type=r.type),r.petRef!=null&&(t.pet_id=r.petRef),r.precheckToken!=null&&(t.precheck_token=r.precheckToken),t}o(sr,"analyzeBody");function lr(e){return new de(e)}o(lr,"createVideoController");var ue=class ue extends K{constructor(r){super({status:"idle",job:null,result:null,error:null,isCaptureAvailable:ae(r.camera),progress:0}),this.funnel=r.funnel??Ue({auth:r.auth,...r.errorPolicy?{errorPolicy:r.errorPolicy}:{}}),this.camera=r.camera,this.upload=r.upload,this.defaultPetRef=r.petRef??null,this.telemetry=r.telemetry??Ve,this.timers=r.timers??Ge,this.makeIdempotencyKey=r.makeIdempotencyKey??Lt();}async capture(r){if(!ae(this.camera))return y(m("unknown",{retryable:false}));let t;try{t=await this.camera.capture(Ke("video",15));}catch{return this.snapshot.status!=="idle"&&this.patch({status:"idle",progress:0}),y(m("unknown",{retryable:false}))}return this.submit(t,r?.petRef!==void 0?{petRef:r.petRef}:void 0)}async submit(r,t){let n=this.beginOperation(t?.signal),i=t?.petRef??this.defaultPetRef,a=this.makeIdempotencyKey(),s=this.timers.now();this.patch({status:"uploading",progress:0,error:null,result:null,job:null});try{let l=await tr(this.funnel,{purpose:"gait_video",contentType:r.mimeType,byteSize:G(r),signal:n.signal});if(n.signal.aborted||!this.alive(n.epoch))return x();if(!l.ok)return this.fail(n,l.error);let u=await nr(this.upload,r,l.value,a,n.signal);if(n.signal.aborted||!this.alive(n.epoch))return x();if(!u.ok)return this.telemetry.track("analysis.upload",{capability:"video",purpose:"gait_video",outcome:"failed"}),this.fail(n,u.error);this.patch({progress:1}),this.telemetry.track("analysis.upload",{capability:"video",purpose:"gait_video",byteSize:G(r)??0,durationMs:He(r)??0,outcome:"ok"}),this.patch({status:"analyzing"});let p=await or(this.funnel,Y.videoAnalyze,sr(l.value.s3Key,{petRef:i}),ar,n.signal);if(n.signal.aborted||!this.alive(n.epoch))return x();if(p.kind==="error")return this.fail(n,p.error);if(p.kind==="gate")return this.fail(n,m("unknown",{retryable:!1}));if(p.kind==="sync"){let h=Mt(p.body)??"";return this.complete(n,p.body,h,s)}let f=p.job;this.patch({job:{id:f.jobId,state:"processing"}});let R=await ir(this.funnel,f.jobId,{timers:this.timers,signal:n.signal,alive:o(()=>this.alive(n.epoch),"alive"),estimatedSeconds:f.estimatedSeconds});if(n.signal.aborted||!this.alive(n.epoch))return x();switch(R.kind){case "aborted":return x();case "complete":return this.complete(n,R.body,f.jobId,s);case "failed":return this.fail(n,R.error);case "timeout":return this.fail(n,m("streamTimeout",{retryable:!0}));case "notFound":return this.patch({job:null}),this.fail(n,m("conversationNotFound",{retryable:!1,httpStatus:404}));default:return this.fail(n,m("internalError",{retryable:!1}))}}finally{n.settle();}}cancel(){this.inFlight?.abort(),this.inFlight=null,(this.snapshot.status==="uploading"||this.snapshot.status==="analyzing")&&this.patch({status:"idle",progress:0});}complete(r,t,n,i){if(!this.alive(r.epoch))return x();let a=jt(t,n);return a.droppedOperatorKeys>0&&this.telemetry.track("analysis.metadata_leak_guard",{droppedKeyCount:a.droppedOperatorKeys}),this.telemetry.track("analysis.quality_gate",{usable:a.result.quality.usable,reasons:a.result.quality.reasons}),this.patch({status:"complete",progress:1,result:a.result,error:null,job:{id:n,state:"complete"}}),this.telemetry.track("analysis.result",{capability:"video",modelVersion:a.result.modelVersion??"",timeToResultMs:this.timers.now()-i}),j(n)}fail(r,t){return this.alive(r.epoch)?(this.patch({status:"error",error:t,progress:0}),this.telemetry.trackExpectedFailure("analysis.error",{code:t.code,...t.httpStatus!==void 0?{httpStatus:t.httpStatus}:{}}),y(t)):x()}};o(ue,"VideoController");var de=ue;function jt(e,r){let t=Je(Xe(e)),n=Qe(Ze(e)),i=b(t.metadata.model_version)??(c(e)?b(e.model_version):null);return {result:Object.freeze({jobId:r,analysisType:"gait",detections:Dt(e),interpretation:n,modelVersion:i,quality:Nt(e)}),droppedOperatorKeys:t.droppedOperatorKeys}}o(jt,"mapVideoResult");function Dt(e){let r=c(e)?e.detections:null;if(!Array.isArray(r))return Object.freeze([]);let t=[];for(let n of r){if(!c(n))continue;let i=b(n.label)??b(n.name);i!==null&&t.push(Object.freeze({label:i,confidence:er(n.confidence)??0,timestampMs:O(n.timestamp_ms??n.timestamp),durationMs:O(n.duration_ms??n.duration)}));}return Object.freeze(t)}o(Dt,"parseVideoDetections");function Nt(e){let r=c(e)?e.quality:null;if(!c(r))return Object.freeze({usable:true,reasons:Object.freeze([])});let t=r.usable;return Object.freeze({usable:typeof t=="boolean"?t:true,reasons:Object.freeze(le(r.reasons))})}o(Nt,"parseQuality");function Mt(e){return c(e)?b(e.result_id)??b(e.request_id)??b(e.job_id):null}o(Mt,"resultIdOf");function x(){return y(m("unknown",{retryable:false}))}o(x,"abortedResult");function Lt(){let e=0;return ()=>`video-analyze-${Date.now().toString(36)}-${(e++).toString(36)}-${Math.random().toString(36).slice(2,10)}`}o(Lt,"defaultIdempotencyFactory");var dr=Symbol.for("@everfur/sdk#EverfurContext@v1"),ur=globalThis,cr=ur[dr]??(ur[dr]=createContext(null));cr.displayName??="EverfurContext";function W(){let e=useContext(cr);if(e===null)throw new z("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return e}o(W,"useEverfurContext");var Gt=Object.freeze({status:"idle",job:null,result:null,error:null,isCaptureAvailable:false,progress:0}),Yt=o(()=>{},"NOOP_UNSUBSCRIBE");function ce(e){let{runtime:r,userRef:t,activePet:n,scopeEpoch:i}=W(),a=e?.petRef??n??null,[s,l]=useState(null);useEffect(()=>{let{services:v}=r.registry,k=r.registry.acquire("video",`${t??""}|${a??""}`,()=>lr({...v.errorPolicy?{errorPolicy:v.errorPolicy}:{},auth:v.authFor(t),camera:v.camera,upload:v.upload,petRef:a,telemetry:v.telemetry}),w=>w.dispose());return l(k),()=>{l(w=>w===k?null:w),r.registry.release(k);}},[r,t,a,i]);let u=useCallback(v=>s?s.subscribe(v):Yt,[s]),p=useCallback(()=>s?s.getSnapshot():Gt,[s]),f=useSyncExternalStore(u,p,p),R=useCallback(v=>s?s.submit(v):Promise.resolve(pr()),[s]),h=useCallback(()=>s?s.capture():Promise.resolve(pr()),[s]),g=useCallback(()=>{s?.cancel();},[s]);return useMemo(()=>({status:f.status,job:f.job,result:f.result,error:f.error,isCaptureAvailable:f.isCaptureAvailable,progress:f.progress,isBootstrapping:s===null,submit:R,capture:h,cancel:g}),[f,s,R,h,g])}o(ce,"useEverfurVideo");function pr(){return y(m("internalError",{retryable:true}))}o(pr,"notReadyError");function ye(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let r of Object.keys(e))ye(e[r]);}return e}o(ye,"deepFreeze");var Wt=Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3}),yr={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},mr={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},fr={nano:8,small:9,micro:10,tiny:11,caption:12,bodyTight:13,body:14,subtitle:16,heading:18,verdict:24},Jt={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},$t={regular:"400",medium:"500",bold:"700"},Qt={eyebrow:1,monoWide:.9,headerBrand:-0.42,tight:-0.35},Xt=0,J="System",$="monospace",Zt=["content","heading","control","compact","badge"];function en(e){let r={};for(let t of Zt)r[t]=e;return r}o(en,"authoredTierSizes");function br(){return {family:J,mono:$,fontUrl:null,families:{regular:J,medium:J,bold:J,mono:$,monoMedium:$,monoBold:$},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:fr,tierSizes:en(fr),lineHeight:Jt,weight:$t,letterSpacing:Qt,scale:1,maxScale:Xt,scaleCaps:Wt}}o(br,"baseType");var gr={},pe=Object.freeze({standard:Object.freeze([.2,0,0,1]),emphasized:Object.freeze([.2,.8,.2,1]),exit:Object.freeze([.4,0,1,1])});function fe(e){return `cubic-bezier(${e.join(", ")})`}o(fe,"cssCubicBezier");var vr={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:fe(pe.standard),emphasized:fe(pe.emphasized),exit:fe(pe.exit)},reducedMotion:false},rn={brand:"#10462E",brandSoft:"rgba(16,70,46,0.10)",brandSofter:"rgba(16,70,46,0.15)",brandBorder:"rgba(16,70,46,0.18)",borderHairlineGreen:"rgba(16,70,46,0.25)",brandBorderStrong:"rgba(16,70,46,0.55)",brandInk:"#10462E",linkInk:"#10462E",surface:"#FFFFFF",surfaceCream:"#FDFBF8",surfaceSubtle:"#EFE9E3",background:"#FFFFFF",borderRingCream:"#D8D2C8",chatGround:"#FFFFFF",composerFill:"#FDFBF8",composerBorder:"rgba(16,70,46,0.75)",shadow:"#0B3421",text:{primary:"#111111",secondary:"#0E462E",muted:"#6E6660",placeholder:"rgba(61,61,61,0.75)",onBrand:"#FFFFFF",metaCool:"#3D3D3D",timestamp:"rgba(61,61,61,0.75)"},primary:"#10462E",onPrimary:"#FFFFFF",accent:"#10462E",onAccent:"#FFFFFF",accentEdge:"#07C168",success:"#07C168",danger:"#B91C1C",errorRed:"#FF1B00",warningStrong:"#A45610",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.12)",badgeBgCaution:"rgba(217,130,29,0.14)",badgeBgCritical:"rgba(185,28,28,0.12)",badgeBgNeutral:"rgba(110,102,96,0.12)",bubbleUser:"#10462E",bubbleAssistant:"#FFFFFF",skeleton:"#EFE9E3",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.10)",checkupCardConcernBg:"rgba(239,167,0,0.10)"},hr=ye({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:rn,space:yr,radius:mr,type:br(),motion:vr,slots:gr}),tn={brand:"#6BD39A",brandSoft:"rgba(107,211,154,0.12)",brandSofter:"rgba(107,211,154,0.18)",brandBorder:"rgba(107,211,154,0.22)",borderHairlineGreen:"rgba(107,211,154,0.28)",brandBorderStrong:"rgba(107,211,154,0.55)",brandInk:"#6BD39A",linkInk:"#6BD39A",surface:"#1C1F23",surfaceCream:"#23272C",surfaceSubtle:"#23272C",background:"#15171A",borderRingCream:"#3A3F45",chatGround:"#1C1F23",composerFill:"#23272C",composerBorder:"rgba(107,211,154,0.75)",shadow:"#000000",text:{primary:"#F5F3F0",secondary:"#A9E4C4",muted:"#9A938C",placeholder:"rgba(255,255,255,0.55)",onBrand:"#0E1F17",metaCool:"#C9C9C9",timestamp:"rgba(245,243,240,0.7)"},primary:"#6BD39A",onPrimary:"#0E1F17",accent:"#6BD39A",onAccent:"#0E1F17",accentEdge:"#34D888",success:"#07C168",danger:"#F87171",errorRed:"#FF6B5B",warningStrong:"#F0A35E",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.18)",badgeBgCaution:"rgba(217,130,29,0.20)",badgeBgCritical:"rgba(185,28,28,0.22)",badgeBgNeutral:"rgba(255,255,255,0.10)",bubbleUser:"#6BD39A",bubbleAssistant:"#1C1F23",skeleton:"#23272C",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.16)",checkupCardConcernBg:"rgba(239,167,0,0.16)"};ye({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:tn,space:yr,radius:mr,type:br(),motion:vr,slots:gr});var Er=Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),_r=globalThis,me=_r[Er]??(_r[Er]=createContext(hr));me.displayName??="EverfurThemeContext";function S(){return useContext(me)}o(S,"useEverfurTheme");function dn(e,r){let t=e.scaleCaps[r];return t>0?t:void 0}o(dn,"tierMultiplier");function E({tier:e="content",...r}){let{type:t}=S(),n=dn(t,e);return createElement(Text,n===void 0?r:{maxFontSizeMultiplier:n,...r})}o(E,"Text");forwardRef(o(function(r,t){return createElement(TextInput,{...r,...t===null?{}:{ref:t}})},"TextInput"));var un=Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});function M(e,r){let t=e.type,n=t.families[r];return r==="mono"||t.namedFaces[r]?{fontFamily:n}:{fontFamily:n,fontWeight:t.weight[un[r]]}}o(M,"face");var ve=class ve extends Component{constructor(){super(...arguments);this.state={failed:false,key:this.props.resetKey};}static getDerivedStateFromError(){return {failed:true}}static getDerivedStateFromProps(t,n){return Object.is(t.resetKey,n.key)?null:{failed:false,key:t.resetKey}}render(){return this.state.failed?this.props.fallback:this.props.children}};o(ve,"HostRenderBoundary");var be=ve;function pn({render:e}){return e()}o(pn,"RenderHost");function ge({render:e,fallback:r,resetKey:t}){return createElement(be,{fallback:r,resetKey:t,children:createElement(pn,{render:e})})}o(ge,"HostRender");var fn=Object.freeze({chat:Object.freeze(["chat.message.create"]),records:Object.freeze(["records.upload.create","records.record.read"]),recordsClinic:Object.freeze(["records.clinic.create"]),video:Object.freeze(["video.gait.execute"]),photo:Object.freeze(["photo.checkup.execute"]),animations:Object.freeze(["animations.state.read"]),televet:Object.freeze(["televet.visit.create"])});function yn(e){return fn[e]}o(yn,"requires");function Cr(e,r,t){let n=yn(e),i=new Map;for(let l of r)i.set(l.resource,l);if(t?.isPending===true&&n.some(l=>!i.has(l)))return he({name:e,enabled:false,isPending:true,limits:{}});let a=mn(n,i);return n.filter(l=>i.get(l)?.granted!==true).length===0?he({name:e,enabled:true,isPending:false,limits:a}):he({name:e,enabled:false,isPending:false,limits:a,disabled:bn(n,i)})}o(Cr,"decideCapability");function mn(e,r){let t={};for(let n of e){let i=r.get(n)?.limits;if(i)for(let[a,s]of Object.entries(i)){let l=t[a];t[a]=l===void 0?s:Math.min(l,s);}}return t}o(mn,"mergeLimits");function bn(e,r){for(let t of e){let n=r.get(t)?.disabled;if(n)return Object.freeze({reason:n.reason,level:n.level,recoverable:n.recoverable})}return Object.freeze({reason:oe("accessDenied"),level:"user_entitlement",recoverable:false})}o(bn,"disabledFor");function he(e){let r={name:e.name,enabled:e.enabled,isPending:e.isPending,limits:Object.freeze({...e.limits})};return e.disabled!==void 0&&(r.disabled=e.disabled),Object.freeze(r)}o(he,"freezeDecision");function Ee(e){let{runtime:r}=W(),t=r.entitlements,n=useSyncExternalStore(t.subscribe,t.getSnapshot,t.getSnapshot);return useMemo(()=>Cr(e,n.decisions,{isPending:n.isPending}),[e,n])}o(Ee,"useCapability");var hn=48;function En(e){return e.isPending?"pending":e.enabled?"enabled":"disabled"}o(En,"selectView");function wr(e){let{capability:r,children:t,renderDisabled:n,renderPending:i,style:a}=e,s=Ee(r),l=useMemo(()=>En(s),[s]);switch(l){case "enabled":return t;case "pending":return i?jsx(ge,{render:i,fallback:jsx(kr,{capability:r,style:a})}):jsx(kr,{capability:r,style:a});case "disabled":return n?jsx(ge,{render:()=>n(s),fallback:jsx(xr,{decision:s,style:a}),resetKey:s}):jsx(xr,{decision:s,style:a});default:return H(l)}}o(wr,"CapabilityGate");function kr({capability:e,style:r}){let t=S(),n=useMemo(()=>Fr(t),[t]);return jsx(View,{style:[n.offstate,r],accessible:true,accessibilityState:{busy:true},accessibilityLabel:`Loading ${e}`,children:jsx(View,{style:n.skeletonBar})})}o(kr,"PendingSkeleton");function xr({decision:e,style:r}){let t=S(),n=useMemo(()=>Fr(t),[t]),i=e.disabled?.reason??"";return jsx(View,{style:[n.offstate,r],accessible:true,accessibilityRole:"text",accessibilityLabel:i,children:i.length>0?jsx(E,{style:n.offstateText,children:i}):null})}o(xr,"OffState");function Fr(e){let{color:r,space:t,radius:n,type:i}=e;return StyleSheet.create({offstate:{minHeight:hn,justifyContent:"center",paddingHorizontal:t.lg,paddingVertical:t.md,backgroundColor:r.surfaceCream,borderRadius:n.md,borderWidth:StyleSheet.hairlineWidth,borderColor:r.brandBorder},offstateText:{...M(e,"regular"),fontSize:i.size.body,lineHeight:Math.round(i.size.body*i.lineHeight.normal),color:r.text.muted},skeletonBar:{height:t.md,borderRadius:n.xs,backgroundColor:r.brandSofter}})}o(Fr,"makeStyles");var L=Object.freeze({title:"For educational use only",body:"Everfur is for educational purposes only. It helps you track visible changes through AI checkups. It does not diagnose, treat, prescribe, or replace veterinary care. For urgent symptoms or emergencies, contact a veterinarian immediately."});function Ir(e){let r=S(),t=useMemo(()=>Sn(r),[r]);return jsxs(View,{style:[t.container,e.style],accessible:true,accessibilityRole:"text",accessibilityLabel:`${L.title}. ${L.body}`,children:[jsx(E,{style:t.title,children:L.title}),jsx(E,{style:t.body,children:L.body})]})}o(Ir,"ClinicalDisclaimer");function Sn(e){let{color:r,space:t,type:n}=e;return StyleSheet.create({container:{paddingHorizontal:t.lg,paddingVertical:t.md,borderTopWidth:StyleSheet.hairlineWidth,borderTopColor:r.borderHairlineGreen,backgroundColor:r.surfaceCream,gap:t.xs},title:{...M(e,"bold"),fontSize:n.size.caption,lineHeight:Math.round(n.size.caption*n.lineHeight.snug),color:r.text.secondary,letterSpacing:n.letterSpacing.eyebrow},body:{...M(e,"regular"),fontSize:n.size.caption,lineHeight:Math.round(n.size.caption*n.lineHeight.snug),color:r.text.muted}})}o(Sn,"makeStyles");var Fn=300,Ce=120,Ar=44,zr=40,On=160;function Pn(e){let{petRef:r,style:t}=e;return jsx(wr,{capability:"video",style:t,children:jsx(An,{petRef:r,style:t})})}o(Pn,"EverfurVideo");function In(e){return e.isBootstrapping||e.status==="uploading"||e.status==="analyzing"?"loading":e.status==="error"&&e.error?"error":e.status==="complete"&&e.result?"populated":e.isCaptureAvailable?"empty":"native"}o(In,"selectView");function An({petRef:e,style:r}){let t=useMemo(()=>e!==void 0?{petRef:e}:void 0,[e]),n=ce(t),i=In(n),{styles:a}=P();return jsxs(View,{style:[a.container,r],children:[jsx(View,{style:a.body,children:zn(i,n)}),jsx(Ir,{})]})}o(An,"VideoBody");function zn(e,r){switch(e){case "loading":return jsx(jn,{progress:r.progress});case "native":return jsx(Dn,{});case "empty":return jsx(Nn,{onCapture:r.capture});case "error":return jsx(Mn,{error:r.error,onRetry:r.capture});case "populated":return jsx(Ln,{result:r.result});default:return H(e)}}o(zn,"renderView");function jn({progress:e}){let{theme:r,styles:t}=P(),[n,i]=useState(false);useEffect(()=>{let s=setTimeout(()=>i(true),Fn);return ()=>clearTimeout(s)},[]);let a=Math.max(0,Math.min(1,e));return jsxs(View,{style:t.centered,accessible:true,accessibilityState:{busy:true},accessibilityLabel:"Analyzing video",children:[n?jsx(ActivityIndicator,{color:r.color.brand}):null,n&&a>0&&a<1?jsx(View,{style:t.progressTrack,accessibilityRole:"progressbar",children:jsx(View,{style:[t.progressFill,{width:`${Math.round(a*100)}%`}]})}):null]})}o(jn,"LoadingState");function Dn(){let{styles:e}=P();return jsx(View,{style:e.offstate,accessible:true,accessibilityRole:"text",accessibilityLabel:"Camera is unavailable",children:jsx(View,{style:e.emptyGlyph})})}o(Dn,"NativeUnavailableState");function Nn({onCapture:e}){let{styles:r}=P();return jsx(View,{style:r.centered,accessible:true,accessibilityRole:"summary",accessibilityLabel:"Record a short clip to check gait",children:jsx(Pressable,{onPress:e,accessibilityRole:"button",accessibilityLabel:"Record video",style:r.primaryButton,children:jsx(E,{style:r.primaryLabel,children:"Record video"})})})}o(Nn,"EmptyState");function Mn({error:e,onRetry:r}){let{styles:t}=P();return jsxs(View,{style:t.centered,accessible:true,accessibilityRole:"alert",children:[jsx(E,{style:t.errorText,children:e.displayMessage}),e.retryable?jsx(Pressable,{onPress:r,accessibilityRole:"button",accessibilityLabel:"Try again",style:t.primaryButton,children:jsx(E,{style:t.primaryLabel,children:"Try again"})}):null]})}o(Mn,"ErrorState");function Ln({result:e}){let{styles:r}=P();return e.quality.usable?jsxs(ScrollView,{style:r.list,contentContainerStyle:r.listContent,accessibilityLabel:"Gait analysis result",children:[e.detections.map((t,n)=>jsx(View,{style:r.resultRow,children:jsx(E,{style:r.resultLabel,children:t.label})},`${t.label}-${n}`)),e.interpretation?jsxs(View,{style:r.interpretationBlock,children:[jsx(E,{style:r.summaryText,children:e.interpretation.summary}),jsx(E,{style:r.disclaimerText,children:e.interpretation.disclaimer})]}):null]}):jsx(View,{style:r.centered,accessible:true,accessibilityRole:"summary",accessibilityLabel:"Result uncertain",children:jsx(E,{style:r.uncertainText,children:"We could not get a clear read from this clip. Try recording again."})})}o(Ln,"ResultState");function P(){let e=S();return useMemo(()=>({theme:e,styles:Un(e)}),[e])}o(P,"useVideoStyles");function Un(e){let{color:r,space:t,radius:n,type:i}=e,a=i.weight.bold,s=i.weight.medium;return StyleSheet.create({container:{flex:1,minHeight:Ce,backgroundColor:r.background},body:{flex:1},centered:{minHeight:Ce,flexGrow:1,alignItems:"center",justifyContent:"center",padding:t.xl},offstate:{minHeight:Ce,alignItems:"center",justifyContent:"center",padding:t.xl},emptyGlyph:{width:zr,height:zr,borderRadius:n.pill,backgroundColor:r.surfaceCream,borderWidth:StyleSheet.hairlineWidth,borderColor:r.borderHairlineGreen},primaryButton:{minHeight:Ar,minWidth:Ar,alignItems:"center",justifyContent:"center",paddingHorizontal:t.xl,paddingVertical:t.md,borderRadius:n.pill,backgroundColor:r.primary,shadowColor:r.brandSofter,shadowOffset:{width:0,height:t.xs},shadowOpacity:1,shadowRadius:t.sm,elevation:t.xs},primaryLabel:{color:r.onPrimary,fontFamily:i.family,fontSize:i.size.body,fontWeight:a,letterSpacing:i.letterSpacing.tight},errorText:{color:r.danger,fontFamily:i.family,fontSize:i.size.subtitle,lineHeight:i.size.subtitle*i.lineHeight.normal,fontWeight:s,textAlign:"center",marginBottom:t.md},uncertainText:{color:r.text.muted,fontFamily:i.family,fontSize:i.size.subtitle,lineHeight:i.size.subtitle*i.lineHeight.normal,textAlign:"center"},progressTrack:{marginTop:t.lg,height:t.sm,width:On,borderRadius:n.pill,backgroundColor:r.skeleton,overflow:"hidden"},progressFill:{height:t.sm,borderRadius:n.pill,backgroundColor:r.brand},list:{flex:1},listContent:{padding:t.lg,gap:t.md},resultRow:{paddingVertical:t.sm,paddingHorizontal:t.md,borderRadius:n.sm,backgroundColor:r.surfaceCream,borderWidth:StyleSheet.hairlineWidth,borderColor:r.brandBorder},resultLabel:{color:r.text.primary,fontFamily:i.family,fontSize:i.size.body,lineHeight:i.size.body*i.lineHeight.normal,fontWeight:s},interpretationBlock:{marginTop:t.sm,gap:t.sm},summaryText:{color:r.text.primary,fontFamily:i.family,fontSize:i.size.subtitle,lineHeight:i.size.subtitle*i.lineHeight.normal},disclaimerText:{color:r.text.muted,fontFamily:i.family,fontSize:i.size.caption,lineHeight:i.size.caption*i.lineHeight.relaxed}})}o(Un,"makeStyles");export{Pn as EverfurVideo,ce as useEverfurVideo};
|
|
1
|
+
import {createContext,forwardRef,useState,useEffect,useCallback,useSyncExternalStore,useMemo,createElement,useContext,Component}from'react';import {TextInput,View,ActivityIndicator,Pressable,ScrollView,StyleSheet,Text}from'react-native';import {jsx,jsxs}from'react/jsx-runtime';var Ur=Object.defineProperty;var o=(e,r)=>Ur(e,"name",{value:r,configurable:true});var re=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(re.map(e=>e.wireCode));var Br=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"}),we=Object.freeze(re.map(e=>Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:Br[e.wireCode]}))),Vr=new Map(we.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),qr=Object.freeze(["http_envelope",...[...new Set(we.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function V(e,r){if(typeof e!="string")return;let t=e.trim().toUpperCase();if(t.length!==0)for(let n of [r??"http_envelope",...qr]){let i=Vr.get(n+t);if(i)return i}}o(V,"contractErrorFor");function Hr(e){return e.envelope==="sse_frame"?`/errors#sse-${e.wireCode}`:e.envelope==="oauth_error"?`/errors#oauth-${e.wireCode}`:`/errors#${e.wireCode}`}o(Hr,"contractDocUrl");function Fe(e){return null}o(Fe,"publishedDocUrl");var Kr=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 Oe(e){return Kr[e]}o(Oe,"categoryFor");function Pe(e){let r=V(e);if(r)return r.normalized;let t=(e??"").trim().toUpperCase(),n=t.replace(/[^A-Z0-9]/g,"");if(n==="AUTHREJECTED")return "authRejected";if(t.startsWith("AUTH"))return "authExpired";switch(n){case "DAILYQUOTAEXCEEDED":case "QUOTAEXCEEDED":return "quotaExceeded";case "RATELIMITED":case "TOOMANYREQUESTS":return "rateLimited";case "IDEMPOTENCYKEYCONFLICT":case "IDEMPOTENCYCONFLICT":return "idempotencyConflict";case "ACCESSDENIED":case "FORBIDDEN":return "accessDenied";case "NOTFOUND":case "CONVERSATIONNOTFOUND":return "conversationNotFound";case "PETNOTFOUND":return "petNotFound";case "TIMEOUT":case "STREAMTIMEOUT":return "streamTimeout";case "MEDIAUPLOADFAILED":case "UNRECOGNIZEDVIDEOFORMAT":case "FILETOOSMALL":return "mediaUploadFailed";case "MODERATIONBLOCKED":return "moderationBlocked";case "UPSTREAMLLMTIMEOUT":return "upstreamLlmTimeout";case "INTERNALERROR":case "INTERNALSERVERERROR":return "internalError";case "STREAMINCOMPLETE":case "CHATSTREAMINCOMPLETE":return "streamIncomplete";case "INVALIDANALYSISTYPE":case "INVALIDUPLOADPURPOSE":return "unknown";default:return "unknown"}}o(Pe,"fromWire");var Gr=new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function te(e){return Gr.has(e)}o(te,"isAutoRetryable");var Yr=new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function Ie(e){return te(e)||Yr.has(e)}o(Ie,"isRetryableCode");var Wr=500,ne=8e3,Ae=4;function ze(e,r=Math.random){let t=Math.max(0,e),n=Math.min(Wr*2**t,ne);return Math.floor(r()*n)}o(ze,"backoffDelayMs");var Jr=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 oe(e){return Jr[e]}o(oe,"userFacingError");function je(e,r,t){Object.defineProperty(e,r,{value:t,enumerable:false,writable:false,configurable:false});}o(je,"defineHidden");var $r=/^[a-z][a-z0-9_]{0,63}$/;function m(e,r){let t=V(r?.wireCode,r?.wireEnvelope),n={code:e,category:Oe(e),retryable:r?.retryable??Ie(e),displayMessage:oe(e)};if(r?.httpStatus!==void 0&&(n.httpStatus=r.httpStatus),r?.requestId&&(n.requestId=r.requestId),typeof r?.reasonCode=="string"&&$r.test(r.reasonCode)&&(n.reasonCode=r.reasonCode),t);return r?.wireMessage&&je(n,"wireMessage",r.wireMessage),r?.raw!==void 0&&r.raw!==null&&je(n,"raw",r.raw),Object.freeze(n)}o(m,"makeEverfurError");function j(e,r){return Object.freeze(r===void 0?{ok:true,value:e}:{ok:true,value:e,warning:r})}o(j,"ok");function y(e){return Object.freeze({ok:false,error:e})}o(y,"err");var q=class q extends Error{constructor(r,t){super(t),this.name="EverfurConfigError",this.kind=r,Object.setPrototypeOf(this,q.prototype);}};o(q,"EverfurConfigError");var z=q;function H(e){throw new Error(`assertNever: unhandled discriminated-union member ${JSON.stringify(e)}`)}o(H,"assertNever");function De(e){return Object.freeze({kind:"error",terminal:true,code:e.code,retryable:e.retryable,wireMessage:e.wireMessage,synthesized:e.synthesized,lastEventId:e.lastEventId,serverRequestId:e.serverRequestId??null})}o(De,"errorFrame");function Zr(e){let r={};return e.mode==="personalized"?r.authorization=`Bearer ${e.token}`:r["x-everfur-partner-key"]=e.publishableKey,e.userRef&&(r["x-everfur-user-ref"]=e.userRef),e.sessionId&&(r["x-everfur-session-id"]=e.sessionId),r}o(Zr,"authHeaders");function D(e,r){return {...e,headers:{...et(e.headers),...Zr(r)}}}o(D,"withAuthHeaders");function et(e){if(!e)return {};let r={};for(let[t,n]of Object.entries(e)){let i=t.toLowerCase();i==="authorization"||i==="x-everfur-partner-key"||(r[t]=n);}return r}o(et,"stripAuthHeaders");async function Ne(e,r){if(r.mode==="anonymous")return r.transport.request(D(e,{mode:"anonymous",publishableKey:r.publishableKey,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));let t;try{t=await r.identity.currentToken();}catch{return y(ie())}let n=await r.transport.request(D(e,{mode:"personalized",token:t,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));if(n.ok||n.error.httpStatus!==401)return n;let i;try{i=await r.identity.currentToken({forceRefresh:!0});}catch{return y(ie())}let a=await r.transport.request(D(e,{mode:"personalized",token:i,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));return !a.ok&&a.error.httpStatus===401?y(ie(a.error.httpStatus)):a}o(Ne,"authedSend");function ie(e){return m("authRejected",{retryable:false,...e!==void 0?{httpStatus:e}:{}})}o(ie,"authRejectedError");function Me(e){return m("internalError",{retryable:true,wireMessage:rt(e)})}o(Me,"networkError");function rt(e){return e instanceof Error?e.message:typeof e=="string"?e:"network request failed"}o(rt,"describeCause");var tt=3e4,nt=ne*2,ot="idempotency-key",it=new Set(["POST","PUT","PATCH","DELETE"]),at=Object.freeze({onEvent(){}}),st=Object.freeze({setTimeout:o((e,r)=>setTimeout(e,r),"setTimeout"),clearTimeout:o(e=>clearTimeout(e),"clearTimeout"),now:o(()=>Date.now(),"now")});function lt(e){let r=e.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return r.length===0?null:`efs_${r}`.slice(0,128)}o(lt,"seededIdempotencyKey");function Ue(e){let r=e.observer??at,t=e.timers??st,n=e.rng??Math.random,i=e.sleep??((h,g)=>_t(h,t,g)),a=e.maxAttempts??Ae,s=e.unaryTimeoutMs??tt,l=e.newIdempotencyKey??ut(),u=o(h=>{try{r.onEvent(h);}catch{}},"emit");async function p(h,g,v){let k=v?.maxAttempts,w=Math.max(1,k??a),Nr=v?.idempotent??it.has(g.method),Mr=v?.idempotencyKey===void 0?null:lt(v.idempotencyKey),Q=Nr?Mr??l():null,Lr=dt(g,Q),X=0;for(;;){let I=o(ee=>Object.freeze({call:h,method:g.method,path:g.path,attempt:X,...Q?{idempotencyKey:Q}:{},...ee}),"stamp");u(I({phase:"attempt"}));let Te=ht(s,t),ke=Et(Te.signal,g.signal),A;try{A=await Ne({...Lr,signal:ke.signal},e.auth);}catch(ee){A=y(Me(ee));}finally{ke.dispose(),Te.cancel();}if(A.ok)return u(I({phase:"settled",ok:true,reason:"ok"})),A;let T=A.error,B=pt(T,X,{maxAttempts:w,rng:n,now:t.now(),aborted:g.signal?.aborted===true,...k!==void 0?{perCallMaxAttempts:k}:{},...e.errorPolicy!==void 0?{policy:e.errorPolicy}:{}}),Z={ok:false,code:T.code,reason:B.reason,...T.httpStatus!==void 0?{httpStatus:T.httpStatus}:{},...T.requestId!==void 0?{requestId:T.requestId}:{}};if(!B.retry)return u(I({phase:"settled",...Z})),y(T);if(u(I({phase:"retry",...Z,delayMs:B.delayMs})),await i(B.delayMs,g.signal),g.signal?.aborted===true)return u(I({phase:"settled",...Z,reason:"aborted"})),y(T);X+=1;}}o(p,"send");async function f(h){return D(h,await vt(e.auth))}o(f,"authorize");async function*R(h,g,v){u(Object.freeze({call:h,phase:"stream.open",method:g.method,path:g.path,attempt:0}));try{yield*e.auth.transport.stream(g,v);}catch{yield De({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:null});}}return o(R,"stream"),Object.freeze({send:p,authorize:f,stream:R})}o(Ue,"createRequestFunnel");function dt(e,r){let t={};for(let[n,i]of Object.entries(e.headers??{}))n.toLowerCase()!==ot&&(t[n]=i);return r!==null&&(t["Idempotency-Key"]=r),{...e,headers:t}}o(dt,"assembleHeaders");function ut(){let e=0;return ()=>`efk_${Date.now().toString(36)}_${(e++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}o(ut,"defaultIdempotencyKeyFactory");var ct=10;function pt(e,r,t){if(t.aborted)return {retry:false,reason:"aborted"};let n=ft(e);if(n==="quota")return {retry:false,reason:"daily-quota-exhausted"};if(n!=="burst"&&!te(e.code))return {retry:false,reason:"terminal-code"};let i=n==="burst"?"burst-throttle":"retryable-code";if(o(()=>{if(t.policy===void 0)return false;try{return !t.policy.shouldRetry(e.code,r)}catch{return false}},"policyVetoedRetry")())return {retry:false,reason:"terminal-code"};let s=o(()=>{if(t.policy===void 0)return null;let p;try{p=t.policy.maxAttempts(e.code);}catch{return null}return typeof p!="number"||!Number.isFinite(p)?null:Math.max(1,Math.min(ct,Math.floor(p)))},"policyCeiling"),l=t.perCallMaxAttempts??s()??t.maxAttempts;if(r+1>=l)return {retry:false,reason:"attempts-exhausted"};let u=yt(e,t.now);return u!==null?u>nt?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:i,delayMs:u}:{retry:true,reason:i,delayMs:ze(r,t.rng)}}o(pt,"decideRetry");function ft(e){let r=e.code==="unknown"?Pe(gt(e.raw)):e.code;return r==="quotaExceeded"?"quota":r==="rateLimited"||e.httpStatus===429?"burst":null}o(ft,"throttleKind");function yt(e,r){let t=mt(e.raw);if(t===null)return null;let n=t-r;return n>0?n:0}o(yt,"retryOverrideMs");function mt(e){for(let r of Be(e)){let t=r.resets_at,n=bt(t);if(n!==null)return n}return null}o(mt,"findResetsAt");function Be(e){if(!Le(e))return [];let r=[e];for(let t of ["error","detail"]){let n=e[t];Le(n)&&r.push(n);}return r}o(Be,"candidateScopes");function bt(e){if(typeof e=="number"&&Number.isFinite(e))return e<1e11?Math.round(e*1e3):Math.round(e);if(typeof e=="string"&&e.trim().length>0){let r=Date.parse(e);return Number.isFinite(r)?r:null}return null}o(bt,"parseInstantMs");function gt(e){for(let r of Be(e)){let t=r.code;if(typeof t=="string"&&t.length>0)return t}return null}o(gt,"rawWireCode");function Le(e){return typeof e=="object"&&e!==null}o(Le,"isRecord");async function vt(e){return e.mode==="anonymous"?{mode:"anonymous",publishableKey:e.publishableKey,userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{}}:{mode:"personalized",token:await e.identity.currentToken(),userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{}}}o(vt,"resolveDeviceAuth");function ht(e,r){let t=new AbortController,n=r.setTimeout(()=>t.abort(),e);return {signal:t.signal,cancel:o(()=>r.clearTimeout(n),"cancel")}}o(ht,"boundedSignal");function Et(e,r){let t=o(()=>{},"noop");if(!r)return {signal:e,dispose:t};let n=new AbortController;if(e.aborted||r.aborted)return n.abort(),{signal:n.signal,dispose:t};let i=o(()=>n.abort(),"onAbort");return e.addEventListener("abort",i,{once:true}),r.addEventListener("abort",i,{once:true}),{signal:n.signal,dispose:o(()=>{e.removeEventListener("abort",i),r.removeEventListener("abort",i);},"dispose")}}o(Et,"mergeSignals");function _t(e,r,t){return e<=0||t?.aborted===true?Promise.resolve():new Promise(n=>{let i=r.setTimeout(()=>{t?.removeEventListener("abort",a),n();},e),a=o(()=>{r.clearTimeout(i),n();},"onAbort");t?.addEventListener("abort",a,{once:true});})}o(_t,"delayAbortable");var Ve=Object.freeze({track(){},trackExpectedFailure(){}});function qe(e){let r={uri:e.uri,mimeType:e.mimeType},t=G(e);return t!==null&&(r.sizeBytes=t),Object.freeze(r)}o(qe,"fileHandleFromMedia");function G(e){let r=e.byteSize??e.sizeBytes;return typeof r=="number"&&Number.isFinite(r)&&r>=0?r:null}o(G,"mediaByteSize");function He(e){let r=e.durationSeconds;return typeof r=="number"&&Number.isFinite(r)&&r>=0?Math.round(r*1e3):null}o(He,"mediaDurationMs");function Ke(e,r){return Object.freeze(r===void 0?{mode:e}:{mode:e,maxDurationSeconds:r})}o(Ke,"captureOptionsFor");function ae(e){return e!=null&&e.isAvailable===true}o(ae,"isCaptureAvailable");var Ge=Object.freeze({setTimeout:o((e,r)=>setTimeout(e,r),"setTimeout"),clearTimeout:o(e=>clearTimeout(e),"clearTimeout"),now:o(()=>Date.now(),"now")});function Ye(e,r,t){return new Promise(n=>{if(r.aborted){n();return}let i={handle:void 0},a=o(()=>{t.clearTimeout(i.handle),r.removeEventListener("abort",a),n();},"done");i.handle=t.setTimeout(a,e),r.addEventListener("abort",a,{once:true});})}o(Ye,"delayAbortable");function Rt(e,r){if(!r)return e;let t=new AbortController;if(e.aborted||r.aborted)return t.abort(),t.signal;let n=o(()=>t.abort(),"onAbort");return e.addEventListener("abort",n,{once:true}),r.addEventListener("abort",n,{once:true}),t.signal}o(Rt,"mergeSignals");var se=class se{constructor(r){this.listeners=new Set;this.epoch=0;this.inFlight=null;this.snapshot=Object.freeze({...r});}subscribe(r){return this.listeners.add(r),()=>{this.listeners.delete(r);}}getSnapshot(){return this.snapshot}patch(r){this.snapshot=Object.freeze({...this.snapshot,...r});for(let t of this.listeners)t();}beginOperation(r){this.inFlight?.abort();let t=new AbortController;this.inFlight=t;let n=this.epoch;return {signal:r?Rt(t.signal,r):t.signal,epoch:n,settle:o(()=>{this.inFlight===t&&(this.inFlight=null);},"settle")}}alive(r){return r===this.epoch}rescope(){this.epoch+=1,this.inFlight?.abort(),this.inFlight=null;}dispose(){this.epoch+=1,this.inFlight?.abort(),this.inFlight=null,this.listeners.clear();}};o(se,"MediaStore");var K=se;function We(e){for(let r=0;r<e.length;r+=1){let t=e.charCodeAt(r);if(t>=55296&&t<=56319){let n=e.charCodeAt(r+1);if(!(n>=56320&&n<=57343))return true;r+=1;}else if(t>=56320&&t<=57343)return true}return false}o(We,"hasLoneSurrogate");var St=Object.freeze(["primary_label","primary_confidence","subtype_label","subtype_display","subtype_confidence","risk_tier","confidence_tier","copy_short","disease_name","disease_framing","model_version","skin_v2","eye_v2","llm_checkup"]),Ct=Object.freeze(["decision_audit","decision_thresholds","per_class_auroc","ood_layers","gate1_score","possible_conditions","top_class"]),Tt=new Set(["skin_v2","eye_v2","llm_checkup"]),kt=new Set(["primary_confidence","subtype_confidence"]),xt=new Set(["low_risk","concern","uncertain"]),wt=new Set(["possible","probable"]),Ft=Object.freeze({primary_label:64,subtype_label:64,subtype_display:128,copy_short:512,disease_name:128,disease_framing:512,model_version:64});function Je(e){let r=c(e)?e:{},t={};for(let i of St){if(!(i in r))continue;let a=r[i],s=Ot(i,a);s!==F&&(t[i]=s);}let n=0;for(let i of Ct)i in r&&(n+=1);return Object.freeze({metadata:Object.freeze(t),droppedOperatorKeys:n})}o(Je,"projectDetectionMetadata");var F=Symbol("drop");function Ot(e,r){if(Tt.has(e))return typeof r=="boolean"?r:F;if(kt.has(e))return $e(r)?r:F;if(e==="risk_tier")return typeof r=="string"&&xt.has(r)?r:F;if(e==="confidence_tier")return typeof r=="string"&&wt.has(r)?r:F;if(typeof r!="string")return F;let t=Ft[e]??256;return r.length>t?r.slice(0,t):r}o(Ot,"acceptKey");function $e(e){return typeof e=="number"&&Number.isFinite(e)&&e>=0&&e<=1}o($e,"isUnitConfidence");function Qe(e){if(!c(e))return null;let r=b(e.summary),t=b(e.disclaimer),n=le(e.recommendations??e.recommendation);return r===null&&t===null&&n.length===0?null:Object.freeze({summary:r??"",recommendations:Object.freeze(n),disclaimer:t??""})}o(Qe,"parseInterpretation");function Xe(e){if(!c(e))return {};if(c(e.metadata))return e.metadata;let r=e.detections;if(Array.isArray(r)&&r.length>0){let t=r[0];if(c(t)&&c(t.metadata))return t.metadata;if(c(t))return t}return e}o(Xe,"locateDetectionMetadata");function Ze(e){return c(e)?c(e.interpretation)?e.interpretation:e:null}o(Ze,"locateInterpretation");function c(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(c,"isRecord");function b(e){return typeof e=="string"&&e.length>0?e:null}o(b,"asString");function le(e){return typeof e=="string"?e.length>0?[e]:[]:Array.isArray(e)?e.filter(r=>typeof r=="string"&&r.length>0):[]}o(le,"asStringList");function er(e){return $e(e)?e:null}o(er,"asUnitNumber");function O(e){return typeof e=="number"&&Number.isFinite(e)?e:null}o(O,"asFiniteNumber");var Y=Object.freeze({initiate:"/widget/v1/uploads/initiate",precheck:"/widget/v1/photo/precheck",photoAnalyze:"/widget/v1/photo/analyze",videoAnalyze:"/widget/v1/video/analyze",job:o(e=>We(e)?null:`/widget/v1/analysis/jobs/${encodeURIComponent(e)}`,"job")});async function tr(e,r){let t={purpose:r.purpose,content_type:r.contentType};r.byteSize!==null&&(t.byte_size=r.byteSize);let n={method:"POST",path:Y.initiate,body:t,...r.signal?{signal:r.signal}:{}},i=await e.send("media.initiateUpload",n);if(!i.ok)return y(i.error);let a=Pt(i.value);return a===null?y(m("mediaUploadFailed",{retryable:false})):j(a)}o(tr,"initiateUpload");function Pt(e){if(!c(e))return null;let r=b(e.url),t=b(e.s3_key);if(r===null||t===null)return null;let n=e.fields,i={};if(c(n))for(let[a,s]of Object.entries(n))typeof s=="string"&&(i[a]=s);return Object.freeze({url:r,fields:Object.freeze(i),s3Key:t,expiresAt:O(e.expires_at)})}o(Pt,"parsePresigned");async function nr(e,r,t,n,i){try{return await e.presignedPut(qe(r),{target:t,idempotencyKey:n,...i?{signal:i}:{}}),j(void 0)}catch{return y(m("mediaUploadFailed",{retryable:false}))}}o(nr,"stageUpload");async function or(e,r,t,n,i){let a={method:"POST",path:r,body:t,...i?{signal:i}:{}},s=await e.send("media.analyze",a);if(s.ok){let u=It(s.value);return u!==null?{kind:"async",job:u}:{kind:"sync",body:s.value}}let l=n(s.error.httpStatus,s.error);return l!==null?{kind:"gate",gate:l}:{kind:"error",error:s.error}}o(or,"submitAnalyze");function It(e){if(!c(e))return null;let r=b(e.job_id);if(r===null)return null;let t=b(e.status);return t!==null&&Dt(t)?null:Object.freeze({jobId:r,estimatedSeconds:O(e.estimated_completion_seconds)})}o(It,"parseAsyncJob");var At=2e3,rr=5e3,zt=9e4;async function ir(e,r,t){let{timers:n,signal:i,alive:a}=t,s=n.now(),l=Math.max(zt,(t.estimatedSeconds??0)*1e3),u=At;for(;;){if(i.aborted||!a())return {kind:"aborted"};if(await Ye(u,i,n),i.aborted||!a())return {kind:"aborted"};if(n.now()-s>l)return {kind:"timeout"};let p=Y.job(r);if(p===null)return {kind:"notFound"};let f=await e.send("media.pollJob",{method:"GET",path:p,...i?{signal:i}:{}},{maxAttempts:1});if(i.aborted||!a())return {kind:"aborted"};if(!f.ok){if(f.error.httpStatus===404)return {kind:"notFound"};u=Math.min(rr,u+1e3);continue}let R=jt(f.value);if(R==="COMPLETED")return {kind:"complete",body:f.value};if(R==="FAILED")return {kind:"failed",error:Nt(f.value)};u=Math.min(rr,u+1e3);}}o(ir,"pollJob");function jt(e){return c(e)?(b(e.status)??"PROCESSING").toUpperCase():"PROCESSING"}o(jt,"jobStatusOf");function Dt(e){let r=e.toUpperCase();return r==="COMPLETED"||r==="FAILED"}o(Dt,"isTerminalStatus");function Nt(e){let r=c(e)?b(e.error)??b(e.error_code):null;return m("internalError",{retryable:false,...r?{wireMessage:r}:{}})}o(Nt,"jobFailureError");function ar(){return null}o(ar,"detectNoGate");function sr(e,r){let t={s3_key:e};return r.type!==void 0&&(t.type=r.type),r.petRef!=null&&(t.pet_id=r.petRef),r.precheckToken!=null&&(t.precheck_token=r.precheckToken),t}o(sr,"analyzeBody");function lr(e){return new de(e)}o(lr,"createVideoController");var ue=class ue extends K{constructor(r){super({status:"idle",job:null,result:null,error:null,isCaptureAvailable:ae(r.camera),progress:0}),this.funnel=r.funnel??Ue({auth:r.auth,...r.errorPolicy?{errorPolicy:r.errorPolicy}:{}}),this.camera=r.camera,this.upload=r.upload,this.defaultPetRef=r.petRef??null,this.telemetry=r.telemetry??Ve,this.timers=r.timers??Ge,this.makeIdempotencyKey=r.makeIdempotencyKey??Vt();}async capture(r){if(!ae(this.camera))return y(m("unknown",{retryable:false}));let t;try{t=await this.camera.capture(Ke("video",15));}catch{return this.snapshot.status!=="idle"&&this.patch({status:"idle",progress:0}),y(m("unknown",{retryable:false}))}return this.submit(t,r?.petRef!==void 0?{petRef:r.petRef}:void 0)}async submit(r,t){let n=this.beginOperation(t?.signal),i=t?.petRef??this.defaultPetRef,a=this.makeIdempotencyKey(),s=this.timers.now();this.patch({status:"uploading",progress:0,error:null,result:null,job:null});try{let l=await tr(this.funnel,{purpose:"gait_video",contentType:r.mimeType,byteSize:G(r),signal:n.signal});if(n.signal.aborted||!this.alive(n.epoch))return x();if(!l.ok)return this.fail(n,l.error);let u=await nr(this.upload,r,l.value,a,n.signal);if(n.signal.aborted||!this.alive(n.epoch))return x();if(!u.ok)return this.telemetry.track("analysis.upload",{capability:"video",purpose:"gait_video",outcome:"failed"}),this.fail(n,u.error);this.patch({progress:1}),this.telemetry.track("analysis.upload",{capability:"video",purpose:"gait_video",byteSize:G(r)??0,durationMs:He(r)??0,outcome:"ok"}),this.patch({status:"analyzing"});let p=await or(this.funnel,Y.videoAnalyze,sr(l.value.s3Key,{petRef:i}),ar,n.signal);if(n.signal.aborted||!this.alive(n.epoch))return x();if(p.kind==="error")return this.fail(n,p.error);if(p.kind==="gate")return this.fail(n,m("unknown",{retryable:!1}));if(p.kind==="sync"){let h=Bt(p.body)??"";return this.complete(n,p.body,h,s)}let f=p.job;this.patch({job:{id:f.jobId,state:"processing"}});let R=await ir(this.funnel,f.jobId,{timers:this.timers,signal:n.signal,alive:o(()=>this.alive(n.epoch),"alive"),estimatedSeconds:f.estimatedSeconds});if(n.signal.aborted||!this.alive(n.epoch))return x();switch(R.kind){case "aborted":return x();case "complete":return this.complete(n,R.body,f.jobId,s);case "failed":return this.fail(n,R.error);case "timeout":return this.fail(n,m("streamTimeout",{retryable:!0}));case "notFound":return this.patch({job:null}),this.fail(n,m("conversationNotFound",{retryable:!1,httpStatus:404}));default:return this.fail(n,m("internalError",{retryable:!1}))}}finally{n.settle();}}cancel(){this.inFlight?.abort(),this.inFlight=null,(this.snapshot.status==="uploading"||this.snapshot.status==="analyzing")&&this.patch({status:"idle",progress:0});}complete(r,t,n,i){if(!this.alive(r.epoch))return x();let a=Mt(t,n);return a.droppedOperatorKeys>0&&this.telemetry.track("analysis.metadata_leak_guard",{droppedKeyCount:a.droppedOperatorKeys}),this.telemetry.track("analysis.quality_gate",{usable:a.result.quality.usable,reasons:a.result.quality.reasons}),this.patch({status:"complete",progress:1,result:a.result,error:null,job:{id:n,state:"complete"}}),this.telemetry.track("analysis.result",{capability:"video",modelVersion:a.result.modelVersion??"",timeToResultMs:this.timers.now()-i}),j(n)}fail(r,t){return this.alive(r.epoch)?(this.patch({status:"error",error:t,progress:0}),this.telemetry.trackExpectedFailure("analysis.error",{code:t.code,...t.httpStatus!==void 0?{httpStatus:t.httpStatus}:{}}),y(t)):x()}};o(ue,"VideoController");var de=ue;function Mt(e,r){let t=Je(Xe(e)),n=Qe(Ze(e)),i=b(t.metadata.model_version)??(c(e)?b(e.model_version):null);return {result:Object.freeze({jobId:r,analysisType:"gait",detections:Lt(e),interpretation:n,modelVersion:i,quality:Ut(e)}),droppedOperatorKeys:t.droppedOperatorKeys}}o(Mt,"mapVideoResult");function Lt(e){let r=c(e)?e.detections:null;if(!Array.isArray(r))return Object.freeze([]);let t=[];for(let n of r){if(!c(n))continue;let i=b(n.label)??b(n.name);i!==null&&t.push(Object.freeze({label:i,confidence:er(n.confidence)??0,timestampMs:O(n.timestamp_ms??n.timestamp),durationMs:O(n.duration_ms??n.duration)}));}return Object.freeze(t)}o(Lt,"parseVideoDetections");function Ut(e){let r=c(e)?e.quality:null;if(!c(r))return Object.freeze({usable:true,reasons:Object.freeze([])});let t=r.usable;return Object.freeze({usable:typeof t=="boolean"?t:true,reasons:Object.freeze(le(r.reasons))})}o(Ut,"parseQuality");function Bt(e){return c(e)?b(e.result_id)??b(e.request_id)??b(e.job_id):null}o(Bt,"resultIdOf");function x(){return y(m("unknown",{retryable:false}))}o(x,"abortedResult");function Vt(){let e=0;return ()=>`video-analyze-${Date.now().toString(36)}-${(e++).toString(36)}-${Math.random().toString(36).slice(2,10)}`}o(Vt,"defaultIdempotencyFactory");var dr=Symbol.for("@everfur/sdk#EverfurContext@v1"),ur=globalThis,cr=ur[dr]??(ur[dr]=createContext(null));cr.displayName??="EverfurContext";function W(){let e=useContext(cr);if(e===null)throw new z("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return e}o(W,"useEverfurContext");var Jt=Object.freeze({status:"idle",job:null,result:null,error:null,isCaptureAvailable:false,progress:0}),$t=o(()=>{},"NOOP_UNSUBSCRIBE");function ce(e){let{runtime:r,userRef:t,activePet:n,scopeEpoch:i}=W(),a=e?.petRef??n??null,[s,l]=useState(null);useEffect(()=>{let{services:v}=r.registry,k=r.registry.acquire("video",`${t??""}|${a??""}`,()=>lr({...v.errorPolicy?{errorPolicy:v.errorPolicy}:{},auth:v.authFor(t),camera:v.camera,upload:v.upload,petRef:a,telemetry:v.telemetry}),w=>w.dispose());return l(k),()=>{l(w=>w===k?null:w),r.registry.release(k);}},[r,t,a,i]);let u=useCallback(v=>s?s.subscribe(v):$t,[s]),p=useCallback(()=>s?s.getSnapshot():Jt,[s]),f=useSyncExternalStore(u,p,p),R=useCallback(v=>s?s.submit(v):Promise.resolve(pr()),[s]),h=useCallback(()=>s?s.capture():Promise.resolve(pr()),[s]),g=useCallback(()=>{s?.cancel();},[s]);return useMemo(()=>({status:f.status,job:f.job,result:f.result,error:f.error,isCaptureAvailable:f.isCaptureAvailable,progress:f.progress,isBootstrapping:s===null,submit:R,capture:h,cancel:g}),[f,s,R,h,g])}o(ce,"useEverfurVideo");function pr(){return y(m("internalError",{retryable:true}))}o(pr,"notReadyError");function ye(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let r of Object.keys(e))ye(e[r]);}return e}o(ye,"deepFreeze");var Qt=Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3}),yr={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},mr={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},fr={nano:8,small:9,micro:10,tiny:11,caption:12,bodyTight:13,body:14,subtitle:16,heading:18,verdict:24},Xt={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},Zt={regular:"400",medium:"500",bold:"700"},en={eyebrow:1,monoWide:.9,headerBrand:-0.42,tight:-0.35},rn=0,J="System",$="monospace",tn=["content","heading","control","compact","badge"];function nn(e){let r={};for(let t of tn)r[t]=e;return r}o(nn,"authoredTierSizes");function br(){return {family:J,mono:$,fontUrl:null,families:{regular:J,medium:J,bold:J,mono:$,monoMedium:$,monoBold:$},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:fr,tierSizes:nn(fr),lineHeight:Xt,weight:Zt,letterSpacing:en,scale:1,maxScale:rn,scaleCaps:Qt}}o(br,"baseType");var gr={},pe=Object.freeze({standard:Object.freeze([.2,0,0,1]),emphasized:Object.freeze([.2,.8,.2,1]),exit:Object.freeze([.4,0,1,1])});function fe(e){return `cubic-bezier(${e.join(", ")})`}o(fe,"cssCubicBezier");var vr={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:fe(pe.standard),emphasized:fe(pe.emphasized),exit:fe(pe.exit)},reducedMotion:false},on={brand:"#10462E",brandSoft:"rgba(16,70,46,0.10)",brandSofter:"rgba(16,70,46,0.15)",brandBorder:"rgba(16,70,46,0.18)",borderHairlineGreen:"rgba(16,70,46,0.25)",brandBorderStrong:"rgba(16,70,46,0.55)",brandInk:"#10462E",linkInk:"#10462E",surface:"#FFFFFF",surfaceCream:"#FDFBF8",surfaceSubtle:"#EFE9E3",background:"#FFFFFF",borderRingCream:"#D8D2C8",chatGround:"#FFFFFF",composerFill:"#FDFBF8",composerBorder:"rgba(16,70,46,0.75)",shadow:"#0B3421",text:{primary:"#111111",secondary:"#0E462E",muted:"#6E6660",placeholder:"rgba(61,61,61,0.75)",onBrand:"#FFFFFF",metaCool:"#3D3D3D",timestamp:"rgba(61,61,61,0.75)"},primary:"#10462E",onPrimary:"#FFFFFF",accent:"#10462E",onAccent:"#FFFFFF",accentEdge:"#07C168",success:"#07C168",danger:"#B91C1C",errorRed:"#FF1B00",warningStrong:"#A45610",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.12)",badgeBgCaution:"rgba(217,130,29,0.14)",badgeBgCritical:"rgba(185,28,28,0.12)",badgeBgNeutral:"rgba(110,102,96,0.12)",bubbleUser:"#10462E",bubbleAssistant:"#FFFFFF",skeleton:"#EFE9E3",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.10)",checkupCardConcernBg:"rgba(239,167,0,0.10)"},hr=ye({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:on,space:yr,radius:mr,type:br(),motion:vr,slots:gr}),an={brand:"#6BD39A",brandSoft:"rgba(107,211,154,0.12)",brandSofter:"rgba(107,211,154,0.18)",brandBorder:"rgba(107,211,154,0.22)",borderHairlineGreen:"rgba(107,211,154,0.28)",brandBorderStrong:"rgba(107,211,154,0.55)",brandInk:"#6BD39A",linkInk:"#6BD39A",surface:"#1C1F23",surfaceCream:"#23272C",surfaceSubtle:"#23272C",background:"#15171A",borderRingCream:"#3A3F45",chatGround:"#1C1F23",composerFill:"#23272C",composerBorder:"rgba(107,211,154,0.75)",shadow:"#000000",text:{primary:"#F5F3F0",secondary:"#A9E4C4",muted:"#9A938C",placeholder:"rgba(255,255,255,0.55)",onBrand:"#0E1F17",metaCool:"#C9C9C9",timestamp:"rgba(245,243,240,0.7)"},primary:"#6BD39A",onPrimary:"#0E1F17",accent:"#6BD39A",onAccent:"#0E1F17",accentEdge:"#34D888",success:"#07C168",danger:"#F87171",errorRed:"#FF6B5B",warningStrong:"#F0A35E",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.18)",badgeBgCaution:"rgba(217,130,29,0.20)",badgeBgCritical:"rgba(185,28,28,0.22)",badgeBgNeutral:"rgba(255,255,255,0.10)",bubbleUser:"#6BD39A",bubbleAssistant:"#1C1F23",skeleton:"#23272C",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.16)",checkupCardConcernBg:"rgba(239,167,0,0.16)"};ye({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:an,space:yr,radius:mr,type:br(),motion:vr,slots:gr});var Er=Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),_r=globalThis,me=_r[Er]??(_r[Er]=createContext(hr));me.displayName??="EverfurThemeContext";function S(){return useContext(me)}o(S,"useEverfurTheme");function pn(e,r){let t=e.scaleCaps[r];return t>0?t:void 0}o(pn,"tierMultiplier");function E({tier:e="content",...r}){let{type:t}=S(),n=pn(t,e);return createElement(Text,n===void 0?r:{maxFontSizeMultiplier:n,...r})}o(E,"Text");forwardRef(o(function(r,t){return createElement(TextInput,{...r,...t===null?{}:{ref:t}})},"TextInput"));var fn=Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});function M(e,r){let t=e.type,n=t.families[r];return r==="mono"||t.namedFaces[r]?{fontFamily:n}:{fontFamily:n,fontWeight:t.weight[fn[r]]}}o(M,"face");var ve=class ve extends Component{constructor(){super(...arguments);this.state={failed:false,key:this.props.resetKey};}static getDerivedStateFromError(){return {failed:true}}static getDerivedStateFromProps(t,n){return Object.is(t.resetKey,n.key)?null:{failed:false,key:t.resetKey}}render(){return this.state.failed?this.props.fallback:this.props.children}};o(ve,"HostRenderBoundary");var be=ve;function mn({render:e}){return e()}o(mn,"RenderHost");function ge({render:e,fallback:r,resetKey:t}){return createElement(be,{fallback:r,resetKey:t,children:createElement(mn,{render:e})})}o(ge,"HostRender");var bn=Object.freeze({chat:Object.freeze(["chat.message.create"]),records:Object.freeze(["records.upload.create","records.record.read"]),recordsClinic:Object.freeze(["records.clinic.create"]),video:Object.freeze(["video.gait.execute"]),photo:Object.freeze(["photo.checkup.execute"]),animations:Object.freeze(["animations.state.read"]),televet:Object.freeze(["televet.visit.create"])});function gn(e){return bn[e]}o(gn,"requires");function Cr(e,r,t){let n=gn(e),i=new Map;for(let l of r)i.set(l.resource,l);if(t?.isPending===true&&n.some(l=>!i.has(l)))return he({name:e,enabled:false,isPending:true,limits:{}});let a=vn(n,i);return n.filter(l=>i.get(l)?.granted!==true).length===0?he({name:e,enabled:true,isPending:false,limits:a}):he({name:e,enabled:false,isPending:false,limits:a,disabled:hn(n,i)})}o(Cr,"decideCapability");function vn(e,r){let t={};for(let n of e){let i=r.get(n)?.limits;if(i)for(let[a,s]of Object.entries(i)){let l=t[a];t[a]=l===void 0?s:Math.min(l,s);}}return t}o(vn,"mergeLimits");function hn(e,r){for(let t of e){let n=r.get(t)?.disabled;if(n)return Object.freeze({reason:n.reason,level:n.level,recoverable:n.recoverable})}return Object.freeze({reason:oe("accessDenied"),level:"user_entitlement",recoverable:false})}o(hn,"disabledFor");function he(e){let r={name:e.name,enabled:e.enabled,isPending:e.isPending,limits:Object.freeze({...e.limits})};return e.disabled!==void 0&&(r.disabled=e.disabled),Object.freeze(r)}o(he,"freezeDecision");function Ee(e){let{runtime:r}=W(),t=r.entitlements,n=useSyncExternalStore(t.subscribe,t.getSnapshot,t.getSnapshot);return useMemo(()=>Cr(e,n.decisions,{isPending:n.isPending}),[e,n])}o(Ee,"useCapability");var Rn=48;function Sn(e){return e.isPending?"pending":e.enabled?"enabled":"disabled"}o(Sn,"selectView");function wr(e){let{capability:r,children:t,renderDisabled:n,renderPending:i,style:a}=e,s=Ee(r),l=useMemo(()=>Sn(s),[s]);switch(l){case "enabled":return t;case "pending":return i?jsx(ge,{render:i,fallback:jsx(kr,{capability:r,style:a})}):jsx(kr,{capability:r,style:a});case "disabled":return n?jsx(ge,{render:()=>n(s),fallback:jsx(xr,{decision:s,style:a}),resetKey:s}):jsx(xr,{decision:s,style:a});default:return H(l)}}o(wr,"CapabilityGate");function kr({capability:e,style:r}){let t=S(),n=useMemo(()=>Fr(t),[t]);return jsx(View,{style:[n.offstate,r],accessible:true,accessibilityState:{busy:true},accessibilityLabel:`Loading ${e}`,children:jsx(View,{style:n.skeletonBar})})}o(kr,"PendingSkeleton");function xr({decision:e,style:r}){let t=S(),n=useMemo(()=>Fr(t),[t]),i=e.disabled?.reason??"";return jsx(View,{style:[n.offstate,r],accessible:true,accessibilityRole:"text",accessibilityLabel:i,children:i.length>0?jsx(E,{style:n.offstateText,children:i}):null})}o(xr,"OffState");function Fr(e){let{color:r,space:t,radius:n,type:i}=e;return StyleSheet.create({offstate:{minHeight:Rn,justifyContent:"center",paddingHorizontal:t.lg,paddingVertical:t.md,backgroundColor:r.surfaceCream,borderRadius:n.md,borderWidth:StyleSheet.hairlineWidth,borderColor:r.brandBorder},offstateText:{...M(e,"regular"),fontSize:i.size.body,lineHeight:Math.round(i.size.body*i.lineHeight.normal),color:r.text.muted},skeletonBar:{height:t.md,borderRadius:n.xs,backgroundColor:r.brandSofter}})}o(Fr,"makeStyles");var L=Object.freeze({title:"For educational use only",body:"Everfur is for educational purposes only. It helps you track visible changes through AI checkups. It does not diagnose, treat, prescribe, or replace veterinary care. For urgent symptoms or emergencies, contact a veterinarian immediately."});function Ir(e){let r=S(),t=useMemo(()=>kn(r),[r]);return jsxs(View,{style:[t.container,e.style],accessible:true,accessibilityRole:"text",accessibilityLabel:`${L.title}. ${L.body}`,children:[jsx(E,{style:t.title,children:L.title}),jsx(E,{style:t.body,children:L.body})]})}o(Ir,"ClinicalDisclaimer");function kn(e){let{color:r,space:t,type:n}=e;return StyleSheet.create({container:{paddingHorizontal:t.lg,paddingVertical:t.md,borderTopWidth:StyleSheet.hairlineWidth,borderTopColor:r.borderHairlineGreen,backgroundColor:r.surfaceCream,gap:t.xs},title:{...M(e,"bold"),fontSize:n.size.caption,lineHeight:Math.round(n.size.caption*n.lineHeight.snug),color:r.text.secondary,letterSpacing:n.letterSpacing.eyebrow},body:{...M(e,"regular"),fontSize:n.size.caption,lineHeight:Math.round(n.size.caption*n.lineHeight.snug),color:r.text.muted}})}o(kn,"makeStyles");var In=300,Ce=120,Ar=44,zr=40,An=160;function zn(e){let{petRef:r,style:t}=e;return jsx(wr,{capability:"video",style:t,children:jsx(Dn,{petRef:r,style:t})})}o(zn,"EverfurVideo");function jn(e){return e.isBootstrapping||e.status==="uploading"||e.status==="analyzing"?"loading":e.status==="error"&&e.error?"error":e.status==="complete"&&e.result?"populated":e.isCaptureAvailable?"empty":"native"}o(jn,"selectView");function Dn({petRef:e,style:r}){let t=useMemo(()=>e!==void 0?{petRef:e}:void 0,[e]),n=ce(t),i=jn(n),{styles:a}=P();return jsxs(View,{style:[a.container,r],children:[jsx(View,{style:a.body,children:Nn(i,n)}),jsx(Ir,{})]})}o(Dn,"VideoBody");function Nn(e,r){switch(e){case "loading":return jsx(Mn,{progress:r.progress});case "native":return jsx(Ln,{});case "empty":return jsx(Un,{onCapture:r.capture});case "error":return jsx(Bn,{error:r.error,onRetry:r.capture});case "populated":return jsx(Vn,{result:r.result});default:return H(e)}}o(Nn,"renderView");function Mn({progress:e}){let{theme:r,styles:t}=P(),[n,i]=useState(false);useEffect(()=>{let s=setTimeout(()=>i(true),In);return ()=>clearTimeout(s)},[]);let a=Math.max(0,Math.min(1,e));return jsxs(View,{style:t.centered,accessible:true,accessibilityState:{busy:true},accessibilityLabel:"Analyzing video",children:[n?jsx(ActivityIndicator,{color:r.color.brand}):null,n&&a>0&&a<1?jsx(View,{style:t.progressTrack,accessibilityRole:"progressbar",children:jsx(View,{style:[t.progressFill,{width:`${Math.round(a*100)}%`}]})}):null]})}o(Mn,"LoadingState");function Ln(){let{styles:e}=P();return jsx(View,{style:e.offstate,accessible:true,accessibilityRole:"text",accessibilityLabel:"Camera is unavailable",children:jsx(View,{style:e.emptyGlyph})})}o(Ln,"NativeUnavailableState");function Un({onCapture:e}){let{styles:r}=P();return jsx(View,{style:r.centered,accessible:true,accessibilityRole:"summary",accessibilityLabel:"Record a short clip to check gait",children:jsx(Pressable,{onPress:e,accessibilityRole:"button",accessibilityLabel:"Record video",style:r.primaryButton,children:jsx(E,{style:r.primaryLabel,children:"Record video"})})})}o(Un,"EmptyState");function Bn({error:e,onRetry:r}){let{styles:t}=P();return jsxs(View,{style:t.centered,accessible:true,accessibilityRole:"alert",children:[jsx(E,{style:t.errorText,children:e.displayMessage}),e.retryable?jsx(Pressable,{onPress:r,accessibilityRole:"button",accessibilityLabel:"Try again",style:t.primaryButton,children:jsx(E,{style:t.primaryLabel,children:"Try again"})}):null]})}o(Bn,"ErrorState");function Vn({result:e}){let{styles:r}=P();return e.quality.usable?jsxs(ScrollView,{style:r.list,contentContainerStyle:r.listContent,accessibilityLabel:"Gait analysis result",children:[e.detections.map((t,n)=>jsx(View,{style:r.resultRow,children:jsx(E,{style:r.resultLabel,children:t.label})},`${t.label}-${n}`)),e.interpretation?jsxs(View,{style:r.interpretationBlock,children:[jsx(E,{style:r.summaryText,children:e.interpretation.summary}),jsx(E,{style:r.disclaimerText,children:e.interpretation.disclaimer})]}):null]}):jsx(View,{style:r.centered,accessible:true,accessibilityRole:"summary",accessibilityLabel:"Result uncertain",children:jsx(E,{style:r.uncertainText,children:"We could not get a clear read from this clip. Try recording again."})})}o(Vn,"ResultState");function P(){let e=S();return useMemo(()=>({theme:e,styles:qn(e)}),[e])}o(P,"useVideoStyles");function qn(e){let{color:r,space:t,radius:n,type:i}=e,a=i.weight.bold,s=i.weight.medium;return StyleSheet.create({container:{flex:1,minHeight:Ce,backgroundColor:r.background},body:{flex:1},centered:{minHeight:Ce,flexGrow:1,alignItems:"center",justifyContent:"center",padding:t.xl},offstate:{minHeight:Ce,alignItems:"center",justifyContent:"center",padding:t.xl},emptyGlyph:{width:zr,height:zr,borderRadius:n.pill,backgroundColor:r.surfaceCream,borderWidth:StyleSheet.hairlineWidth,borderColor:r.borderHairlineGreen},primaryButton:{minHeight:Ar,minWidth:Ar,alignItems:"center",justifyContent:"center",paddingHorizontal:t.xl,paddingVertical:t.md,borderRadius:n.pill,backgroundColor:r.primary,shadowColor:r.brandSofter,shadowOffset:{width:0,height:t.xs},shadowOpacity:1,shadowRadius:t.sm,elevation:t.xs},primaryLabel:{color:r.onPrimary,fontFamily:i.family,fontSize:i.size.body,fontWeight:a,letterSpacing:i.letterSpacing.tight},errorText:{color:r.danger,fontFamily:i.family,fontSize:i.size.subtitle,lineHeight:i.size.subtitle*i.lineHeight.normal,fontWeight:s,textAlign:"center",marginBottom:t.md},uncertainText:{color:r.text.muted,fontFamily:i.family,fontSize:i.size.subtitle,lineHeight:i.size.subtitle*i.lineHeight.normal,textAlign:"center"},progressTrack:{marginTop:t.lg,height:t.sm,width:An,borderRadius:n.pill,backgroundColor:r.skeleton,overflow:"hidden"},progressFill:{height:t.sm,borderRadius:n.pill,backgroundColor:r.brand},list:{flex:1},listContent:{padding:t.lg,gap:t.md},resultRow:{paddingVertical:t.sm,paddingHorizontal:t.md,borderRadius:n.sm,backgroundColor:r.surfaceCream,borderWidth:StyleSheet.hairlineWidth,borderColor:r.brandBorder},resultLabel:{color:r.text.primary,fontFamily:i.family,fontSize:i.size.body,lineHeight:i.size.body*i.lineHeight.normal,fontWeight:s},interpretationBlock:{marginTop:t.sm,gap:t.sm},summaryText:{color:r.text.primary,fontFamily:i.family,fontSize:i.size.subtitle,lineHeight:i.size.subtitle*i.lineHeight.normal},disclaimerText:{color:r.text.muted,fontFamily:i.family,fontSize:i.size.caption,lineHeight:i.size.caption*i.lineHeight.relaxed}})}o(qn,"makeStyles");export{zn as EverfurVideo,ce as useEverfurVideo};
|
|
@@ -2,8 +2,8 @@ import { c as EverfurResult, E as EverfurError } from './EverfurResult-DN9pL2Ab.
|
|
|
2
2
|
import { R as RecordsRequestId, P as PetRef } from './ids-B2GAAifq.js';
|
|
3
3
|
import { F as FileHandle, U as UploadTransport } from './ports-BN6RHF9W.js';
|
|
4
4
|
import { C as CreateUploadRequestInput, d as RecordsRequestView, U as UploadedDocument, g as RecordsView, h as ConsentState, G as GrantConsentInput, i as RecordsDenialReason, a as RecordEntity } from './models-B-Uh2LTf.js';
|
|
5
|
-
import {
|
|
6
|
-
import { c as RecordsDepthStatus, i as RecordsClinicController } from './useRecordsDepth-
|
|
5
|
+
import { K as RecordMarkersView, L as RecordPdfLink, N as RecordShareLink, Q as RecordsClinicBatchClient } from './depth-DvPwPuT_.js';
|
|
6
|
+
import { c as RecordsDepthStatus, i as RecordsClinicController } from './useRecordsDepth-crhBllQK.js';
|
|
7
7
|
|
|
8
8
|
interface UploadDocumentInput {
|
|
9
9
|
readonly requestId: RecordsRequestId;
|
|
@@ -2,8 +2,8 @@ import { c as EverfurResult, E as EverfurError } from './EverfurResult-DN9pL2Ab.
|
|
|
2
2
|
import { R as RecordsRequestId, P as PetRef } from './ids-B2GAAifq.cjs';
|
|
3
3
|
import { F as FileHandle, U as UploadTransport } from './ports-BN6RHF9W.cjs';
|
|
4
4
|
import { C as CreateUploadRequestInput, d as RecordsRequestView, U as UploadedDocument, g as RecordsView, h as ConsentState, G as GrantConsentInput, i as RecordsDenialReason, a as RecordEntity } from './models-D2EUxPZY.cjs';
|
|
5
|
-
import {
|
|
6
|
-
import { c as RecordsDepthStatus, i as RecordsClinicController } from './useRecordsDepth-
|
|
5
|
+
import { K as RecordMarkersView, L as RecordPdfLink, N as RecordShareLink, Q as RecordsClinicBatchClient } from './depth-D5HwcvKC.cjs';
|
|
6
|
+
import { c as RecordsDepthStatus, i as RecordsClinicController } from './useRecordsDepth-C6rjEaLn.cjs';
|
|
7
7
|
|
|
8
8
|
interface UploadDocumentInput {
|
|
9
9
|
readonly requestId: RecordsRequestId;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var react=require('react'),jsxRuntime=require('react/jsx-runtime');var or=Object.defineProperty;var n=(e,r)=>or(e,"name",{value:r,configurable:true});var k=Object.freeze({loading:"Loading",retry:"Try again",signedOut:"Sign in required",changeable:"You can change this at any time.",saving:"Saving"}),Y=Object.freeze({transcript_exposure:Object.freeze({title:"Conversation sharing",body:n(e=>`Let ${e} read the conversations you have with Everfur.`,"body")}),partner_context:Object.freeze({title:"Pet details",body:n(e=>`Let Everfur use the pet details ${e} already holds as background in your conversations.`,"body")})});function K(e,r){if(e.status==="signed_out")return {kind:"signedOut"};let t=e.scopes.find(o=>o.scope===r);return t===void 0?e.error!==null?{kind:"failed",error:e.error}:{kind:"loading"}:t.loaded?{kind:"row",scope:t.scope,granted:t.granted,hasDecision:t.hasDecision,saving:t.saving,error:t.error}:t.error!==null?{kind:"failed",error:t.error}:{kind:"loading"}}n(K,"consentRowView");var W=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(W.map(e=>e.wireCode));var ar=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"}),ye=Object.freeze(W.map(e=>Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:ar[e.wireCode]}))),ir=new Map(ye.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),sr=Object.freeze(["http_envelope",...[...new Set(ye.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function M(e,r){if(typeof e!="string")return;let t=e.trim().toUpperCase();if(t.length!==0)for(let o of [r??"http_envelope",...sr]){let a=ir.get(o+t);if(a)return a}}n(M,"contractErrorFor");function lr(e){return e.envelope==="sse_frame"?`/errors#sse-${e.wireCode}`:e.envelope==="oauth_error"?`/errors#oauth-${e.wireCode}`:`/errors#${e.wireCode}`}n(lr,"contractDocUrl");function me(e){return null}n(me,"publishedDocUrl");var ur=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 ve(e){return ur[e]}n(ve,"categoryFor");function Ee(e){let r=M(e);if(r)return r.normalized;let t=(e??"").trim().toUpperCase(),o=t.replace(/[^A-Z0-9]/g,"");if(o==="AUTHREJECTED")return "authRejected";if(t.startsWith("AUTH"))return "authExpired";switch(o){case "DAILYQUOTAEXCEEDED":case "QUOTAEXCEEDED":return "quotaExceeded";case "RATELIMITED":case "TOOMANYREQUESTS":return "rateLimited";case "IDEMPOTENCYKEYCONFLICT":case "IDEMPOTENCYCONFLICT":return "idempotencyConflict";case "ACCESSDENIED":case "FORBIDDEN":return "accessDenied";case "NOTFOUND":case "CONVERSATIONNOTFOUND":return "conversationNotFound";case "PETNOTFOUND":return "petNotFound";case "TIMEOUT":case "STREAMTIMEOUT":return "streamTimeout";case "MEDIAUPLOADFAILED":case "UNRECOGNIZEDVIDEOFORMAT":case "FILETOOSMALL":return "mediaUploadFailed";case "MODERATIONBLOCKED":return "moderationBlocked";case "UPSTREAMLLMTIMEOUT":return "upstreamLlmTimeout";case "INTERNALERROR":case "INTERNALSERVERERROR":return "internalError";case "STREAMINCOMPLETE":case "CHATSTREAMINCOMPLETE":return "streamIncomplete";case "INVALIDANALYSISTYPE":case "INVALIDUPLOADPURPOSE":return "unknown";default:return "unknown"}}n(Ee,"fromWire");var dr=new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function $(e){return dr.has(e)}n($,"isAutoRetryable");var cr=new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function ge(e){return $(e)||cr.has(e)}n(ge,"isRetryableCode");var pr=500,G=8e3,be=4;function he(e,r=Math.random){let t=Math.max(0,e),o=Math.min(pr*2**t,G);return Math.floor(r()*o)}n(he,"backoffDelayMs");var fr=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 yr(e){return fr[e]}n(yr,"userFacingError");function _e(e,r,t){Object.defineProperty(e,r,{value:t,enumerable:false,writable:false,configurable:false});}n(_e,"defineHidden");var mr=/^[a-z][a-z0-9_]{0,63}$/;function T(e,r){let t=M(r?.wireCode,r?.wireEnvelope),o={code:e,category:ve(e),retryable:r?.retryable??ge(e),displayMessage:yr(e)};if(r?.httpStatus!==void 0&&(o.httpStatus=r.httpStatus),r?.requestId&&(o.requestId=r.requestId),typeof r?.reasonCode=="string"&&mr.test(r.reasonCode)&&(o.reasonCode=r.reasonCode),t);return r?.wireMessage&&_e(o,"wireMessage",r.wireMessage),r?.raw!==void 0&&r.raw!==null&&_e(o,"raw",r.raw),Object.freeze(o)}n(T,"makeEverfurError");function Q(e,r){return Object.freeze(r===void 0?{ok:true,value:e}:{ok:true,value:e,warning:r})}n(Q,"ok");function f(e){return Object.freeze({ok:false,error:e})}n(f,"err");var U=class U extends Error{constructor(r,t){super(t),this.name="EverfurConfigError",this.kind=r,Object.setPrototypeOf(this,U.prototype);}};n(U,"EverfurConfigError");var z=U;function Ce(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(Ce,"errorFrame");function gr(e){let r={};return e.mode==="personalized"?r.authorization=`Bearer ${e.token}`:r["x-everfur-partner-key"]=e.publishableKey,e.userRef&&(r["x-everfur-user-ref"]=e.userRef),e.sessionId&&(r["x-everfur-session-id"]=e.sessionId),r}n(gr,"authHeaders");function N(e,r){return {...e,headers:{...br(e.headers),...gr(r)}}}n(N,"withAuthHeaders");function br(e){if(!e)return {};let r={};for(let[t,o]of Object.entries(e)){let a=t.toLowerCase();a==="authorization"||a==="x-everfur-partner-key"||(r[t]=o);}return r}n(br,"stripAuthHeaders");async function Re(e,r){if(r.mode==="anonymous")return r.transport.request(N(e,{mode:"anonymous",publishableKey:r.publishableKey,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));let t;try{t=await r.identity.currentToken();}catch{return f(X())}let o=await r.transport.request(N(e,{mode:"personalized",token:t,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));if(o.ok||o.error.httpStatus!==401)return o;let a;try{a=await r.identity.currentToken({forceRefresh:!0});}catch{return f(X())}let s=await r.transport.request(N(e,{mode:"personalized",token:a,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));return !s.ok&&s.error.httpStatus===401?f(X(s.error.httpStatus)):s}n(Re,"authedSend");function X(e){return T("authRejected",{retryable:false,...e!==void 0?{httpStatus:e}:{}})}n(X,"authRejectedError");function Se(e){return T("internalError",{retryable:true,wireMessage:hr(e)})}n(Se,"networkError");function hr(e){return e instanceof Error?e.message:typeof e=="string"?e:"network request failed"}n(hr,"describeCause");var _r=3e4,Cr=G*2,Rr="idempotency-key",Sr=new Set(["POST","PUT","PATCH","DELETE"]),Tr=Object.freeze({onEvent(){}}),wr=Object.freeze({setTimeout:n((e,r)=>setTimeout(e,r),"setTimeout"),clearTimeout:n(e=>clearTimeout(e),"clearTimeout"),now:n(()=>Date.now(),"now")});function we(e){let r=e.observer??Tr,t=e.timers??wr,o=e.rng??Math.random,a=e.sleep??((m,d)=>Ur(m,t,d)),s=e.maxAttempts??be,p=e.unaryTimeoutMs??_r,i=e.newIdempotencyKey??Fr(),l=n(m=>{try{r.onEvent(m);}catch{}},"emit");async function u(m,d,y){let _=y?.maxAttempts,v=Math.max(1,_??s),R=y?.idempotent??Sr.has(d.method)?i():null,c=xr(d,R),g=0;for(;;){let b=n(V=>Object.freeze({call:m,method:d.method,path:d.path,attempt:g,...R?{idempotencyKey:R}:{},...V}),"stamp");l(b({phase:"attempt"}));let x=jr(p,t),P=Mr(x.signal,d.signal),F;try{F=await Re({...c,signal:P.signal},e.auth);}catch(V){F=f(Se(V));}finally{P.dispose(),x.cancel();}if(F.ok)return l(b({phase:"settled",ok:true,reason:"ok"})),F;let w=F.error,j=Or(w,g,{maxAttempts:v,rng:o,now:t.now(),aborted:d.signal?.aborted===true,..._!==void 0?{perCallMaxAttempts:_}:{},...e.errorPolicy!==void 0?{policy:e.errorPolicy}:{}}),H={ok:false,code:w.code,reason:j.reason,...w.httpStatus!==void 0?{httpStatus:w.httpStatus}:{},...w.requestId!==void 0?{requestId:w.requestId}:{}};if(!j.retry)return l(b({phase:"settled",...H})),f(w);if(l(b({phase:"retry",...H,delayMs:j.delayMs})),await a(j.delayMs,d.signal),d.signal?.aborted===true)return l(b({phase:"settled",...H,reason:"aborted"})),f(w);g+=1;}}n(u,"send");async function E(m){return N(m,await Dr(e.auth))}n(E,"authorize");async function*S(m,d,y){l(Object.freeze({call:m,phase:"stream.open",method:d.method,path:d.path,attempt:0}));try{yield*e.auth.transport.stream(d,y);}catch{yield Ce({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:null});}}return n(S,"stream"),Object.freeze({send:u,authorize:E,stream:S})}n(we,"createRequestFunnel");function xr(e,r){let t={};for(let[o,a]of Object.entries(e.headers??{}))o.toLowerCase()!==Rr&&(t[o]=a);return r!==null&&(t["Idempotency-Key"]=r),{...e,headers:t}}n(xr,"assembleHeaders");function Fr(){let e=0;return ()=>`efk_${Date.now().toString(36)}_${(e++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}n(Fr,"defaultIdempotencyKeyFactory");var kr=10;function Or(e,r,t){if(t.aborted)return {retry:false,reason:"aborted"};let o=Ar(e);if(o==="quota")return {retry:false,reason:"daily-quota-exhausted"};if(o!=="burst"&&!$(e.code))return {retry:false,reason:"terminal-code"};let a=o==="burst"?"burst-throttle":"retryable-code";if(n(()=>{if(t.policy===void 0)return false;try{return !t.policy.shouldRetry(e.code,r)}catch{return false}},"policyVetoedRetry")())return {retry:false,reason:"terminal-code"};let p=n(()=>{if(t.policy===void 0)return null;let u;try{u=t.policy.maxAttempts(e.code);}catch{return null}return typeof u!="number"||!Number.isFinite(u)?null:Math.max(1,Math.min(kr,Math.floor(u)))},"policyCeiling"),i=t.perCallMaxAttempts??p()??t.maxAttempts;if(r+1>=i)return {retry:false,reason:"attempts-exhausted"};let l=Ir(e,t.now);return l!==null?l>Cr?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:a,delayMs:l}:{retry:true,reason:a,delayMs:he(r,t.rng)}}n(Or,"decideRetry");function Ar(e){let r=e.code==="unknown"?Ee(Nr(e.raw)):e.code;return r==="quotaExceeded"?"quota":r==="rateLimited"||e.httpStatus===429?"burst":null}n(Ar,"throttleKind");function Ir(e,r){let t=Pr(e.raw);if(t===null)return null;let o=t-r;return o>0?o:0}n(Ir,"retryOverrideMs");function Pr(e){for(let r of xe(e)){let t=r.resets_at,o=zr(t);if(o!==null)return o}return null}n(Pr,"findResetsAt");function xe(e){if(!Te(e))return [];let r=[e];for(let t of ["error","detail"]){let o=e[t];Te(o)&&r.push(o);}return r}n(xe,"candidateScopes");function zr(e){if(typeof e=="number"&&Number.isFinite(e))return e<1e11?Math.round(e*1e3):Math.round(e);if(typeof e=="string"&&e.trim().length>0){let r=Date.parse(e);return Number.isFinite(r)?r:null}return null}n(zr,"parseInstantMs");function Nr(e){for(let r of xe(e)){let t=r.code;if(typeof t=="string"&&t.length>0)return t}return null}n(Nr,"rawWireCode");function Te(e){return typeof e=="object"&&e!==null}n(Te,"isRecord");async function Dr(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(Dr,"resolveDeviceAuth");function jr(e,r){let t=new AbortController,o=r.setTimeout(()=>t.abort(),e);return {signal:t.signal,cancel:n(()=>r.clearTimeout(o),"cancel")}}n(jr,"boundedSignal");function Mr(e,r){let t=n(()=>{},"noop");if(!r)return {signal:e,dispose:t};let o=new AbortController;if(e.aborted||r.aborted)return o.abort(),{signal:o.signal,dispose:t};let a=n(()=>o.abort(),"onAbort");return e.addEventListener("abort",a,{once:true}),r.addEventListener("abort",a,{once:true}),{signal:o.signal,dispose:n(()=>{e.removeEventListener("abort",a),r.removeEventListener("abort",a);},"dispose")}}n(Mr,"mergeSignals");function Ur(e,r,t){return e<=0||t?.aborted===true?Promise.resolve():new Promise(o=>{let a=r.setTimeout(()=>{t?.removeEventListener("abort",s),o();},e),s=n(()=>{r.clearTimeout(a),o();},"onAbort");t?.addEventListener("abort",s,{once:true});})}n(Ur,"delayAbortable");var Fe="/widget/v1/consent",D=Object.freeze(["transcript_exposure","partner_context"]),ke="records_content",Z=64,Lr=new Set(D);function L(e){return typeof e=="string"&&Lr.has(e)}n(L,"isEverfurConsentScope");function O(e){return T("validationFailed",{retryable:false,wireMessage:e})}n(O,"invalid");function Pe(e){return L(e)?null:O(e===ke?`'${ke}' is not recorded here: the records release a member grants and revokes is PUT and DELETE /widget/v1/records/pets/{pet_ref}/consent, which the records surface wires and which also kills the pet's live share links on a revoke. A row on the scoped ledger would not gate any read.`:`scope must be one of ${D.join(", ")}`)}n(Pe,"validateScope");function Br(e){if(typeof e!="object"||e===null)return O("write needs a decision object");let{scope:r,granted:t,consentVersion:o}=e,a=Pe(r);return a!==null?a:typeof t!="boolean"?O("granted must be true to grant or false to withdraw"):o!==void 0&&(typeof o!="string"||o.length===0||o.length>Z)?O(`consentVersion must be 1..${Z} characters`):null}n(Br,"validateDecision");var J=n(e=>typeof e=="string"&&e.length>0?e:null,"str");function Oe(e,r){if(typeof e!="object"||e===null)return null;let t=e;return typeof t.granted!="boolean"||typeof t.has_decision!="boolean"?null:Object.freeze({scope:r,granted:t.granted,hasDecision:t.has_decision,consentVersion:J(t.consent_version),actor:J(t.actor),recordedAt:J(t.recorded_at)})}n(Oe,"verdictFromWire");function Ae(e){return T("internalError",{retryable:false,httpStatus:502,wireMessage:`${e}: the response carried no granted/has_decision pair`})}n(Ae,"malformed");function Ie(e){return O(`the Everfur runtime is disposed; ${e} was called after unmount`)}n(Ie,"disposed");function ee(e){let r=n(()=>{let{services:t}=e.registry;return ze({auth:t.authFor(null),...t.errorPolicy?{errorPolicy:t.errorPolicy}:{}})},"over");return {read:n((t,o)=>e.isDisposed?Promise.resolve(f(Ie("read"))):r().read(t,o),"read"),write:n((t,o)=>e.isDisposed?Promise.resolve(f(Ie("write"))):r().write(t,o),"write")}}n(ee,"createConsentRepository");function ze(e){let r=e.funnel??we({auth:e.auth,...e.errorPolicy?{errorPolicy:e.errorPolicy}:{}}),t=n((o,a)=>a?{...o,signal:a}:o,"withSignal");return {async read(o,a){let s=Pe(o);if(s!==null)return f(s);let p=await r.send("consent.read",t({method:"GET",path:Fe,query:{scope:o}},a?.signal));if(!p.ok)return f(p.error);let i=Oe(p.value,o);return i===null?f(Ae("consent.read")):Q(i)},async write(o,a){let s=Br(o);if(s!==null)return f(s);let p={scope:o.scope,granted:o.granted};o.consentVersion!==void 0&&(p.consent_version=o.consentVersion);let i=await r.send("consent.write",t({method:"PUT",path:Fe,body:p},a?.signal));if(!i.ok)return f(i.error);let l=Oe(i.value,o.scope);return l===null?f(Ae("consent.write")):Q(l)}}}n(ze,"createConsentRepositoryOver");var Ne=Symbol.for("@everfur/sdk#EverfurContext@v1"),De=globalThis,je=De[Ne]??(De[Ne]=react.createContext(null));je.displayName??="EverfurContext";function re(){let e=react.useContext(je);if(e===null)throw new z("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return e}n(re,"useEverfurContext");function ne(e,r){return Object.freeze({scope:e,granted:false,hasDecision:false,consentVersion:null,recordedAt:null,loaded:false,saving:false,error:r})}n(ne,"blank");function Ue(e){return Object.freeze({scope:e.scope,granted:e.granted,hasDecision:e.hasDecision,consentVersion:e.consentVersion,recordedAt:e.recordedAt,loaded:true,saving:false,error:null})}n(Ue,"settled");function Kr(){return T("sessionRequired",{retryable:false,wireMessage:"a consent decision is authored by the member; sign a user in on the provider first"})}n(Kr,"noMember");function Le(){let{runtime:e}=re();return react.useMemo(()=>ee(e),[e])}n(Le,"useEverfurConsentRepository");function ae(e){let{userRef:r}=re(),t=Le(),o=(e?.scopes??[]).filter(L).join(","),a=react.useMemo(()=>{let y=o.length===0?[]:o.split(",");return y.length===0?D:Object.freeze(y)},[o]),[s,p]=react.useState(r===null?"signed_out":"loading"),[i,l]=react.useState([]),[u,E]=react.useState(null),S=react.useRef(0),m=react.useCallback(async()=>{if(r===null){S.current+=1,p("signed_out"),l([]),E(null);return}let y=S.current+=1;p("loading"),E(null);let _=await Promise.all(a.map(c=>t.read(c)));if(y!==S.current)return;let v=_.map((c,g)=>{let b=a[g];return c.ok?Ue(c.value):ne(b,c.error)}),C=_.find(c=>!c.ok),R=_.every(c=>!c.ok);l(Object.freeze(v)),p(R?"failed":"ready"),E(R&&C!==void 0&&!C.ok?C.error:null);},[t,a,r]);react.useEffect(()=>{m();},[m]);let d=react.useCallback(async(y,_)=>{if(r===null)return f(Kr());let v=S.current,C=null;l(c=>{let g=c.findIndex(F=>F.scope===y),b=g===-1?ne(y,null):c[g];C=b;let x=Object.freeze({...b,granted:_,hasDecision:true,saving:true,error:null});if(g===-1)return Object.freeze([...c,x]);let P=[...c];return P[g]=x,Object.freeze(P)});let R=await t.write({scope:y,granted:_});return v!==S.current||l(c=>{let g=c.findIndex(x=>x.scope===y);if(g===-1)return c;let b=[...c];return b[g]=R.ok?Ue(R.value):Object.freeze({...C??ne(y,null),saving:false,error:R.error}),Object.freeze(b)}),R},[t,r]);return react.useMemo(()=>({status:s,scopes:i,error:u,setConsent:d,refresh:m}),[s,i,u,d,m])}n(ae,"useEverfurConsent");function Be(e){let r=globalThis.console;try{r?.error?.("[everfur] A host callback threw; the SDK ignored it.",e);}catch{}}n(Be,"reportHostFailure");function Wr(e){return (typeof e=="object"||typeof e=="function")&&e!==null&&typeof e.then=="function"}n(Wr,"isThenable");function $r(e,...r){if(typeof e=="function")try{let t=e(...r);return Wr(t)&&Promise.resolve(t).then(void 0,Be),t}catch(t){Be(t);return}}n($r,"callHost");var qe=new WeakMap;function Gr(e){if(typeof e!="function")return;let r=qe.get(e);if(r!==void 0)return r;let t=n((...o)=>{$r(e,...o);},"guarded");return qe.set(e,t),t}n(Gr,"guardHost");function He(e,r){let t=null;for(let o of r){let a=e[o];typeof a=="function"&&(t??={...e},t[o]=Gr(a));}return t??e}n(He,"guardHostProps");var se=class se extends react.Component{constructor(){super(...arguments);this.state={failed:false,key:this.props.resetKey};}static getDerivedStateFromError(){return {failed:true}}static getDerivedStateFromProps(t,o){return Object.is(t.resetKey,o.key)?null:{failed:false,key:t.resetKey}}render(){return this.state.failed?this.props.fallback:this.props.children}};n(se,"HostRenderBoundary");var ie=se;function Xr({render:e}){return e()}n(Xr,"RenderHost");function Ye({render:e,fallback:r,resetKey:t}){return react.createElement(ie,{fallback:r,resetKey:t,children:react.createElement(Xr,{render:e})})}n(Ye,"HostRender");function de(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let r of Object.keys(e))de(e[r]);}return e}n(de,"deepFreeze");var Jr=Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3}),We={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},$e={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},Ke={nano:8,small:9,micro:10,tiny:11,caption:12,bodyTight:13,body:14,subtitle:16,heading:18,verdict:24},Zr={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},et={regular:"400",medium:"500",bold:"700"},rt={eyebrow:1,monoWide:.9,headerBrand:-0.42,tight:-0.35},tt=0,B="System",q="monospace",nt=["content","heading","control","compact","badge"];function ot(e){let r={};for(let t of nt)r[t]=e;return r}n(ot,"authoredTierSizes");function Ge(){return {family:B,mono:q,fontUrl:null,families:{regular:B,medium:B,bold:B,mono:q,monoMedium:q,monoBold:q},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:Ke,tierSizes:ot(Ke),lineHeight:Zr,weight:et,letterSpacing:rt,scale:1,maxScale:tt,scaleCaps:Jr}}n(Ge,"baseType");var Qe={},le=Object.freeze({standard:Object.freeze([.2,0,0,1]),emphasized:Object.freeze([.2,.8,.2,1]),exit:Object.freeze([.4,0,1,1])});function ue(e){return `cubic-bezier(${e.join(", ")})`}n(ue,"cssCubicBezier");var Xe={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:ue(le.standard),emphasized:ue(le.emphasized),exit:ue(le.exit)},reducedMotion:false},at={brand:"#10462E",brandSoft:"rgba(16,70,46,0.10)",brandSofter:"rgba(16,70,46,0.15)",brandBorder:"rgba(16,70,46,0.18)",borderHairlineGreen:"rgba(16,70,46,0.25)",brandBorderStrong:"rgba(16,70,46,0.55)",brandInk:"#10462E",linkInk:"#10462E",surface:"#FFFFFF",surfaceCream:"#FDFBF8",surfaceSubtle:"#EFE9E3",background:"#FFFFFF",borderRingCream:"#D8D2C8",chatGround:"#FFFFFF",composerFill:"#FDFBF8",composerBorder:"rgba(16,70,46,0.75)",shadow:"#0B3421",text:{primary:"#111111",secondary:"#0E462E",muted:"#6E6660",placeholder:"rgba(61,61,61,0.75)",onBrand:"#FFFFFF",metaCool:"#3D3D3D",timestamp:"rgba(61,61,61,0.75)"},primary:"#10462E",onPrimary:"#FFFFFF",accent:"#10462E",onAccent:"#FFFFFF",accentEdge:"#07C168",success:"#07C168",danger:"#B91C1C",errorRed:"#FF1B00",warningStrong:"#A45610",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.12)",badgeBgCaution:"rgba(217,130,29,0.14)",badgeBgCritical:"rgba(185,28,28,0.12)",badgeBgNeutral:"rgba(110,102,96,0.12)",bubbleUser:"#10462E",bubbleAssistant:"#FFFFFF",skeleton:"#EFE9E3",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.10)",checkupCardConcernBg:"rgba(239,167,0,0.10)"},Je=de({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:at,space:We,radius:$e,type:Ge(),motion:Xe,slots:Qe}),it={brand:"#6BD39A",brandSoft:"rgba(107,211,154,0.12)",brandSofter:"rgba(107,211,154,0.18)",brandBorder:"rgba(107,211,154,0.22)",borderHairlineGreen:"rgba(107,211,154,0.28)",brandBorderStrong:"rgba(107,211,154,0.55)",brandInk:"#6BD39A",linkInk:"#6BD39A",surface:"#1C1F23",surfaceCream:"#23272C",surfaceSubtle:"#23272C",background:"#15171A",borderRingCream:"#3A3F45",chatGround:"#1C1F23",composerFill:"#23272C",composerBorder:"rgba(107,211,154,0.75)",shadow:"#000000",text:{primary:"#F5F3F0",secondary:"#A9E4C4",muted:"#9A938C",placeholder:"rgba(255,255,255,0.55)",onBrand:"#0E1F17",metaCool:"#C9C9C9",timestamp:"rgba(245,243,240,0.7)"},primary:"#6BD39A",onPrimary:"#0E1F17",accent:"#6BD39A",onAccent:"#0E1F17",accentEdge:"#34D888",success:"#07C168",danger:"#F87171",errorRed:"#FF6B5B",warningStrong:"#F0A35E",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.18)",badgeBgCaution:"rgba(217,130,29,0.20)",badgeBgCritical:"rgba(185,28,28,0.22)",badgeBgNeutral:"rgba(255,255,255,0.10)",bubbleUser:"#6BD39A",bubbleAssistant:"#1C1F23",skeleton:"#23272C",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.16)",checkupCardConcernBg:"rgba(239,167,0,0.16)"};de({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:it,space:We,radius:$e,type:Ge(),motion:Xe,slots:Qe});var Ze=Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),er=globalThis,ce=er[Ze]??(er[Ze]=react.createContext(Je));ce.displayName??="EverfurThemeContext";function pe(){return react.useContext(ce)}n(pe,"useEverfurTheme");var rr=Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});var tr='system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',ut="System";function dt(e){let r=e.trim();return r.length===0||r===ut?tr:`${nr(r)}, ${tr}`}n(dt,"cssFontFamily");function ct(e){let r=e.trim();return r.length===0||r==="monospace"?"ui-monospace, Menlo, Consolas, monospace":`${nr(r)}, ui-monospace, Menlo, Consolas, monospace`}n(ct,"cssMonoFamily");function nr(e){return `"${e.replace(/[\\"]/g,"\\$&")}"`}n(nr,"quote");function A(e,r){let t=e.type,o=t.families[r];return {fontFamily:r==="mono"||r==="monoMedium"||r==="monoBold"?ct(o):dt(o),fontWeight:t.namedFaces[r]?t.weight.regular:t.weight[rr[r]]}}n(A,"faceCss");function mt(e){let{scope:r,onChange:t,renderNotice:o,style:a,className:s}=He(e,["onChange"]),p=pe(),i=react.useMemo(()=>vt(p),[p]),l=ae({scopes:[r]}),u=K(l,r),E=Y[r],[S,m]=react.useState(null),d=react.useCallback(async v=>{m(v);let C=await l.setConsent(r,v);C.ok&&(m(null),t?.(C.value.granted));},[l,t,r]),y=n((v,C)=>jsxRuntime.jsxs("div",{style:i.notice,children:[jsxRuntime.jsx(Ye,{resetKey:v,render:()=>o?o(v):jsxRuntime.jsx("p",{style:i.noticeText,children:v.displayMessage}),fallback:jsxRuntime.jsx("p",{style:i.noticeText,children:v.displayMessage})}),jsxRuntime.jsx("button",{type:"button",onClick:C,style:i.retry,children:k.retry})]}),"notice");if(u.kind==="signedOut")return jsxRuntime.jsxs("div",{className:s,style:{...i.container,...a},children:[jsxRuntime.jsx("p",{style:i.title,children:E.title}),jsxRuntime.jsx("p",{style:i.body,children:k.signedOut})]});if(u.kind==="loading")return jsxRuntime.jsx("div",{className:s,style:{...i.container,...a},role:"status","aria-busy":"true","aria-label":k.loading,children:jsxRuntime.jsx("p",{style:i.title,children:E.title})});if(u.kind==="failed")return jsxRuntime.jsxs("div",{className:s,style:{...i.container,...a},children:[jsxRuntime.jsx("p",{style:i.title,children:E.title}),y(u.error,()=>{l.refresh();})]});let _=`${E.title}. ${E.body(p.meta.displayName)}`;return jsxRuntime.jsxs("div",{className:s,style:{...i.container,...a},children:[jsxRuntime.jsxs("div",{style:{...i.row,...u.granted?i.rowChecked:null},children:[jsxRuntime.jsx("input",{type:"checkbox",checked:u.granted,disabled:u.saving,"aria-label":_,"aria-busy":u.saving?"true":void 0,onChange:v=>{d(v.currentTarget.checked);},style:i.box}),jsxRuntime.jsxs("div",{style:i.copy,children:[jsxRuntime.jsx("p",{style:i.title,children:E.title}),jsxRuntime.jsx("p",{style:i.body,children:E.body(p.meta.displayName)}),jsxRuntime.jsx("p",{style:i.footnote,children:k.changeable})]})]}),u.error===null?null:y(u.error,()=>{d(S??!u.granted);})]})}n(mt,"EverfurConsentToggle");function vt(e){let{color:r,radius:t,space:o,type:a}=e,s=`${Math.round(a.size.caption*a.lineHeight.snug)}px`;return {container:{boxSizing:"border-box",display:"flex",flexDirection:"column",gap:o.sm,padding:`${o.md}px ${o.lg}px`},row:{boxSizing:"border-box",display:"flex",alignItems:"flex-start",gap:o.md,borderRadius:t.md,border:`1px solid ${r.brandBorder}`,backgroundColor:r.surface,padding:o.lg},rowChecked:{border:`1px solid ${r.brand}`,backgroundColor:r.brandSoft},box:{width:24,height:24,minWidth:24,minHeight:24,margin:0,accentColor:r.brand,cursor:"pointer"},copy:{display:"flex",flexDirection:"column",gap:o.xs},title:{margin:0,...A(e,"bold"),fontSize:a.size.body,lineHeight:`${Math.round(a.size.body*a.lineHeight.snug)}px`,color:r.text.primary},body:{margin:0,...A(e,"regular"),fontSize:a.size.caption,lineHeight:s,color:r.text.secondary},footnote:{margin:0,...A(e,"regular"),fontSize:a.size.caption,lineHeight:s,color:r.text.muted},notice:{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:o.xs,paddingTop:o.xs},noticeText:{margin:0,...A(e,"regular"),fontSize:a.size.caption,lineHeight:s,color:r.errorRed},retry:{minHeight:44,padding:`0 ${o.sm}px`,border:"none",background:"none",cursor:"pointer",...A(e,"bold"),fontSize:a.size.caption,color:r.linkInk}}}n(vt,"makeStyles");exports.CONSENT_COPY=k;exports.CONSENT_SCOPE_COPY=Y;exports.CONSENT_VERSION_MAX=Z;exports.EVERFUR_CONSENT_SCOPES=D;exports.EverfurConsentToggle=mt;exports.consentRowView=K;exports.createConsentRepository=ee;exports.createConsentRepositoryOver=ze;exports.isEverfurConsentScope=L;exports.useEverfurConsent=ae;exports.useEverfurConsentRepository=Le;
|
|
1
|
+
'use strict';var react=require('react'),jsxRuntime=require('react/jsx-runtime');var ar=Object.defineProperty;var n=(e,r)=>ar(e,"name",{value:r,configurable:true});var F=Object.freeze({loading:"Loading",retry:"Try again",signedOut:"Sign in required",changeable:"You can change this at any time.",saving:"Saving"}),K=Object.freeze({transcript_exposure:Object.freeze({title:"Conversation sharing",body:n(e=>`Let ${e} read the conversations you have with Everfur.`,"body")}),partner_context:Object.freeze({title:"Pet details",body:n(e=>`Let Everfur use the pet details ${e} already holds as background in your conversations.`,"body")})});function W(e,r){if(e.status==="signed_out")return {kind:"signedOut"};let t=e.scopes.find(o=>o.scope===r);return t===void 0?e.error!==null?{kind:"failed",error:e.error}:{kind:"loading"}:t.loaded?{kind:"row",scope:t.scope,granted:t.granted,hasDecision:t.hasDecision,saving:t.saving,error:t.error}:t.error!==null?{kind:"failed",error:t.error}:{kind:"loading"}}n(W,"consentRowView");var $=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($.map(e=>e.wireCode));var ir=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"}),me=Object.freeze($.map(e=>Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:ir[e.wireCode]}))),sr=new Map(me.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),lr=Object.freeze(["http_envelope",...[...new Set(me.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function U(e,r){if(typeof e!="string")return;let t=e.trim().toUpperCase();if(t.length!==0)for(let o of [r??"http_envelope",...lr]){let a=sr.get(o+t);if(a)return a}}n(U,"contractErrorFor");function ur(e){return e.envelope==="sse_frame"?`/errors#sse-${e.wireCode}`:e.envelope==="oauth_error"?`/errors#oauth-${e.wireCode}`:`/errors#${e.wireCode}`}n(ur,"contractDocUrl");function ve(e){return null}n(ve,"publishedDocUrl");var dr=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 Ee(e){return dr[e]}n(Ee,"categoryFor");function ge(e){let r=U(e);if(r)return r.normalized;let t=(e??"").trim().toUpperCase(),o=t.replace(/[^A-Z0-9]/g,"");if(o==="AUTHREJECTED")return "authRejected";if(t.startsWith("AUTH"))return "authExpired";switch(o){case "DAILYQUOTAEXCEEDED":case "QUOTAEXCEEDED":return "quotaExceeded";case "RATELIMITED":case "TOOMANYREQUESTS":return "rateLimited";case "IDEMPOTENCYKEYCONFLICT":case "IDEMPOTENCYCONFLICT":return "idempotencyConflict";case "ACCESSDENIED":case "FORBIDDEN":return "accessDenied";case "NOTFOUND":case "CONVERSATIONNOTFOUND":return "conversationNotFound";case "PETNOTFOUND":return "petNotFound";case "TIMEOUT":case "STREAMTIMEOUT":return "streamTimeout";case "MEDIAUPLOADFAILED":case "UNRECOGNIZEDVIDEOFORMAT":case "FILETOOSMALL":return "mediaUploadFailed";case "MODERATIONBLOCKED":return "moderationBlocked";case "UPSTREAMLLMTIMEOUT":return "upstreamLlmTimeout";case "INTERNALERROR":case "INTERNALSERVERERROR":return "internalError";case "STREAMINCOMPLETE":case "CHATSTREAMINCOMPLETE":return "streamIncomplete";case "INVALIDANALYSISTYPE":case "INVALIDUPLOADPURPOSE":return "unknown";default:return "unknown"}}n(ge,"fromWire");var cr=new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function G(e){return cr.has(e)}n(G,"isAutoRetryable");var pr=new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function be(e){return G(e)||pr.has(e)}n(be,"isRetryableCode");var fr=500,Q=8e3,he=4;function _e(e,r=Math.random){let t=Math.max(0,e),o=Math.min(fr*2**t,Q);return Math.floor(r()*o)}n(_e,"backoffDelayMs");var yr=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 mr(e){return yr[e]}n(mr,"userFacingError");function Ce(e,r,t){Object.defineProperty(e,r,{value:t,enumerable:false,writable:false,configurable:false});}n(Ce,"defineHidden");var vr=/^[a-z][a-z0-9_]{0,63}$/;function w(e,r){let t=U(r?.wireCode,r?.wireEnvelope),o={code:e,category:Ee(e),retryable:r?.retryable??be(e),displayMessage:mr(e)};if(r?.httpStatus!==void 0&&(o.httpStatus=r.httpStatus),r?.requestId&&(o.requestId=r.requestId),typeof r?.reasonCode=="string"&&vr.test(r.reasonCode)&&(o.reasonCode=r.reasonCode),t);return r?.wireMessage&&Ce(o,"wireMessage",r.wireMessage),r?.raw!==void 0&&r.raw!==null&&Ce(o,"raw",r.raw),Object.freeze(o)}n(w,"makeEverfurError");function X(e,r){return Object.freeze(r===void 0?{ok:true,value:e}:{ok:true,value:e,warning:r})}n(X,"ok");function y(e){return Object.freeze({ok:false,error:e})}n(y,"err");var L=class L extends Error{constructor(r,t){super(t),this.name="EverfurConfigError",this.kind=r,Object.setPrototypeOf(this,L.prototype);}};n(L,"EverfurConfigError");var z=L;function Re(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(Re,"errorFrame");function br(e){let r={};return e.mode==="personalized"?r.authorization=`Bearer ${e.token}`:r["x-everfur-partner-key"]=e.publishableKey,e.userRef&&(r["x-everfur-user-ref"]=e.userRef),e.sessionId&&(r["x-everfur-session-id"]=e.sessionId),r}n(br,"authHeaders");function N(e,r){return {...e,headers:{...hr(e.headers),...br(r)}}}n(N,"withAuthHeaders");function hr(e){if(!e)return {};let r={};for(let[t,o]of Object.entries(e)){let a=t.toLowerCase();a==="authorization"||a==="x-everfur-partner-key"||(r[t]=o);}return r}n(hr,"stripAuthHeaders");async function Se(e,r){if(r.mode==="anonymous")return r.transport.request(N(e,{mode:"anonymous",publishableKey:r.publishableKey,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));let t;try{t=await r.identity.currentToken();}catch{return y(J())}let o=await r.transport.request(N(e,{mode:"personalized",token:t,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));if(o.ok||o.error.httpStatus!==401)return o;let a;try{a=await r.identity.currentToken({forceRefresh:!0});}catch{return y(J())}let s=await r.transport.request(N(e,{mode:"personalized",token:a,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));return !s.ok&&s.error.httpStatus===401?y(J(s.error.httpStatus)):s}n(Se,"authedSend");function J(e){return w("authRejected",{retryable:false,...e!==void 0?{httpStatus:e}:{}})}n(J,"authRejectedError");function Te(e){return w("internalError",{retryable:true,wireMessage:_r(e)})}n(Te,"networkError");function _r(e){return e instanceof Error?e.message:typeof e=="string"?e:"network request failed"}n(_r,"describeCause");var Cr=3e4,Rr=Q*2,Sr="idempotency-key",Tr=new Set(["POST","PUT","PATCH","DELETE"]),wr=Object.freeze({onEvent(){}}),xr=Object.freeze({setTimeout:n((e,r)=>setTimeout(e,r),"setTimeout"),clearTimeout:n(e=>clearTimeout(e),"clearTimeout"),now:n(()=>Date.now(),"now")});function Fr(e){let r=e.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return r.length===0?null:`efs_${r}`.slice(0,128)}n(Fr,"seededIdempotencyKey");function xe(e){let r=e.observer??wr,t=e.timers??xr,o=e.rng??Math.random,a=e.sleep??((m,c)=>Br(m,t,c)),s=e.maxAttempts??he,f=e.unaryTimeoutMs??Cr,i=e.newIdempotencyKey??Or(),l=n(m=>{try{r.onEvent(m);}catch{}},"emit");async function d(m,c,p){let h=p?.maxAttempts,v=Math.max(1,h??s),g=p?.idempotent??Tr.has(c.method),R=p?.idempotencyKey===void 0?null:Fr(p.idempotencyKey),u=g?R??i():null,_=kr(c,u),C=0;for(;;){let S=n(Y=>Object.freeze({call:m,method:c.method,path:c.path,attempt:C,...u?{idempotencyKey:u}:{},...Y}),"stamp");l(S({phase:"attempt"}));let I=Ur(f,t),j=Lr(I.signal,c.signal),P;try{P=await Se({..._,signal:j.signal},e.auth);}catch(Y){P=y(Te(Y));}finally{j.dispose(),I.cancel();}if(P.ok)return l(S({phase:"settled",ok:true,reason:"ok"})),P;let x=P.error,M=Ir(x,C,{maxAttempts:v,rng:o,now:t.now(),aborted:c.signal?.aborted===true,...h!==void 0?{perCallMaxAttempts:h}:{},...e.errorPolicy!==void 0?{policy:e.errorPolicy}:{}}),V={ok:false,code:x.code,reason:M.reason,...x.httpStatus!==void 0?{httpStatus:x.httpStatus}:{},...x.requestId!==void 0?{requestId:x.requestId}:{}};if(!M.retry)return l(S({phase:"settled",...V})),y(x);if(l(S({phase:"retry",...V,delayMs:M.delayMs})),await a(M.delayMs,c.signal),c.signal?.aborted===true)return l(S({phase:"settled",...V,reason:"aborted"})),y(x);C+=1;}}n(d,"send");async function E(m){return N(m,await Mr(e.auth))}n(E,"authorize");async function*T(m,c,p){l(Object.freeze({call:m,phase:"stream.open",method:c.method,path:c.path,attempt:0}));try{yield*e.auth.transport.stream(c,p);}catch{yield Re({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:null});}}return n(T,"stream"),Object.freeze({send:d,authorize:E,stream:T})}n(xe,"createRequestFunnel");function kr(e,r){let t={};for(let[o,a]of Object.entries(e.headers??{}))o.toLowerCase()!==Sr&&(t[o]=a);return r!==null&&(t["Idempotency-Key"]=r),{...e,headers:t}}n(kr,"assembleHeaders");function Or(){let e=0;return ()=>`efk_${Date.now().toString(36)}_${(e++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}n(Or,"defaultIdempotencyKeyFactory");var Ar=10;function Ir(e,r,t){if(t.aborted)return {retry:false,reason:"aborted"};let o=Pr(e);if(o==="quota")return {retry:false,reason:"daily-quota-exhausted"};if(o!=="burst"&&!G(e.code))return {retry:false,reason:"terminal-code"};let a=o==="burst"?"burst-throttle":"retryable-code";if(n(()=>{if(t.policy===void 0)return false;try{return !t.policy.shouldRetry(e.code,r)}catch{return false}},"policyVetoedRetry")())return {retry:false,reason:"terminal-code"};let f=n(()=>{if(t.policy===void 0)return null;let d;try{d=t.policy.maxAttempts(e.code);}catch{return null}return typeof d!="number"||!Number.isFinite(d)?null:Math.max(1,Math.min(Ar,Math.floor(d)))},"policyCeiling"),i=t.perCallMaxAttempts??f()??t.maxAttempts;if(r+1>=i)return {retry:false,reason:"attempts-exhausted"};let l=zr(e,t.now);return l!==null?l>Rr?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:a,delayMs:l}:{retry:true,reason:a,delayMs:_e(r,t.rng)}}n(Ir,"decideRetry");function Pr(e){let r=e.code==="unknown"?ge(jr(e.raw)):e.code;return r==="quotaExceeded"?"quota":r==="rateLimited"||e.httpStatus===429?"burst":null}n(Pr,"throttleKind");function zr(e,r){let t=Nr(e.raw);if(t===null)return null;let o=t-r;return o>0?o:0}n(zr,"retryOverrideMs");function Nr(e){for(let r of Fe(e)){let t=r.resets_at,o=Dr(t);if(o!==null)return o}return null}n(Nr,"findResetsAt");function Fe(e){if(!we(e))return [];let r=[e];for(let t of ["error","detail"]){let o=e[t];we(o)&&r.push(o);}return r}n(Fe,"candidateScopes");function Dr(e){if(typeof e=="number"&&Number.isFinite(e))return e<1e11?Math.round(e*1e3):Math.round(e);if(typeof e=="string"&&e.trim().length>0){let r=Date.parse(e);return Number.isFinite(r)?r:null}return null}n(Dr,"parseInstantMs");function jr(e){for(let r of Fe(e)){let t=r.code;if(typeof t=="string"&&t.length>0)return t}return null}n(jr,"rawWireCode");function we(e){return typeof e=="object"&&e!==null}n(we,"isRecord");async function Mr(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(Mr,"resolveDeviceAuth");function Ur(e,r){let t=new AbortController,o=r.setTimeout(()=>t.abort(),e);return {signal:t.signal,cancel:n(()=>r.clearTimeout(o),"cancel")}}n(Ur,"boundedSignal");function Lr(e,r){let t=n(()=>{},"noop");if(!r)return {signal:e,dispose:t};let o=new AbortController;if(e.aborted||r.aborted)return o.abort(),{signal:o.signal,dispose:t};let a=n(()=>o.abort(),"onAbort");return e.addEventListener("abort",a,{once:true}),r.addEventListener("abort",a,{once:true}),{signal:o.signal,dispose:n(()=>{e.removeEventListener("abort",a),r.removeEventListener("abort",a);},"dispose")}}n(Lr,"mergeSignals");function Br(e,r,t){return e<=0||t?.aborted===true?Promise.resolve():new Promise(o=>{let a=r.setTimeout(()=>{t?.removeEventListener("abort",s),o();},e),s=n(()=>{r.clearTimeout(a),o();},"onAbort");t?.addEventListener("abort",s,{once:true});})}n(Br,"delayAbortable");var ke="/widget/v1/consent",D=Object.freeze(["transcript_exposure","partner_context"]),Oe="records_content",ee=64,qr=new Set(D);function B(e){return typeof e=="string"&&qr.has(e)}n(B,"isEverfurConsentScope");function k(e){return w("validationFailed",{retryable:false,wireMessage:e})}n(k,"invalid");function ze(e){return B(e)?null:k(e===Oe?`'${Oe}' is not recorded here: the records release a member grants and revokes is PUT and DELETE /widget/v1/records/pets/{pet_ref}/consent, which the records surface wires and which also kills the pet's live share links on a revoke. A row on the scoped ledger would not gate any read.`:`scope must be one of ${D.join(", ")}`)}n(ze,"validateScope");function Hr(e){if(typeof e!="object"||e===null)return k("write needs a decision object");let{scope:r,granted:t,consentVersion:o}=e,a=ze(r);return a!==null?a:typeof t!="boolean"?k("granted must be true to grant or false to withdraw"):o!==void 0&&(typeof o!="string"||o.length===0||o.length>ee)?k(`consentVersion must be 1..${ee} characters`):null}n(Hr,"validateDecision");var Z=n(e=>typeof e=="string"&&e.length>0?e:null,"str");function Ae(e,r){if(typeof e!="object"||e===null)return null;let t=e;return typeof t.granted!="boolean"||typeof t.has_decision!="boolean"?null:Object.freeze({scope:r,granted:t.granted,hasDecision:t.has_decision,consentVersion:Z(t.consent_version),actor:Z(t.actor),recordedAt:Z(t.recorded_at)})}n(Ae,"verdictFromWire");function Ie(e){return w("internalError",{retryable:false,httpStatus:502,wireMessage:`${e}: the response carried no granted/has_decision pair`})}n(Ie,"malformed");function Pe(e){return k(`the Everfur runtime is disposed; ${e} was called after unmount`)}n(Pe,"disposed");function re(e){let r=n(()=>{let{services:t}=e.registry;return Ne({auth:t.authFor(null),...t.errorPolicy?{errorPolicy:t.errorPolicy}:{}})},"over");return {read:n((t,o)=>e.isDisposed?Promise.resolve(y(Pe("read"))):r().read(t,o),"read"),write:n((t,o)=>e.isDisposed?Promise.resolve(y(Pe("write"))):r().write(t,o),"write")}}n(re,"createConsentRepository");function Ne(e){let r=e.funnel??xe({auth:e.auth,...e.errorPolicy?{errorPolicy:e.errorPolicy}:{}}),t=n((o,a)=>a?{...o,signal:a}:o,"withSignal");return {async read(o,a){let s=ze(o);if(s!==null)return y(s);let f=await r.send("consent.read",t({method:"GET",path:ke,query:{scope:o}},a?.signal));if(!f.ok)return y(f.error);let i=Ae(f.value,o);return i===null?y(Ie("consent.read")):X(i)},async write(o,a){let s=Hr(o);if(s!==null)return y(s);let f={scope:o.scope,granted:o.granted};o.consentVersion!==void 0&&(f.consent_version=o.consentVersion);let i=await r.send("consent.write",t({method:"PUT",path:ke,body:f},a?.signal));if(!i.ok)return y(i.error);let l=Ae(i.value,o.scope);return l===null?y(Ie("consent.write")):X(l)}}}n(Ne,"createConsentRepositoryOver");var De=Symbol.for("@everfur/sdk#EverfurContext@v1"),je=globalThis,Me=je[De]??(je[De]=react.createContext(null));Me.displayName??="EverfurContext";function te(){let e=react.useContext(Me);if(e===null)throw new z("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return e}n(te,"useEverfurContext");function oe(e,r){return Object.freeze({scope:e,granted:false,hasDecision:false,consentVersion:null,recordedAt:null,loaded:false,saving:false,error:r})}n(oe,"blank");function Le(e){return Object.freeze({scope:e.scope,granted:e.granted,hasDecision:e.hasDecision,consentVersion:e.consentVersion,recordedAt:e.recordedAt,loaded:true,saving:false,error:null})}n(Le,"settled");function $r(){return w("sessionRequired",{retryable:false,wireMessage:"a consent decision is authored by the member; sign a user in on the provider first"})}n($r,"noMember");function Be(){let{runtime:e}=te();return react.useMemo(()=>re(e),[e])}n(Be,"useEverfurConsentRepository");function ie(e){let{userRef:r}=te(),t=Be(),o=(e?.scopes??[]).filter(B).join(","),a=react.useMemo(()=>{let p=o.length===0?[]:o.split(",");return p.length===0?D:Object.freeze(p)},[o]),[s,f]=react.useState(r===null?"signed_out":"loading"),[i,l]=react.useState([]),[d,E]=react.useState(null),T=react.useRef(0),m=react.useCallback(async()=>{if(r===null){T.current+=1,f("signed_out"),l([]),E(null);return}let p=T.current+=1;f("loading"),E(null);let h=await Promise.all(a.map(u=>t.read(u)));if(p!==T.current)return;let v=h.map((u,_)=>{let C=a[_];return u.ok?Le(u.value):oe(C,u.error)}),g=h.find(u=>!u.ok),R=h.every(u=>!u.ok);l(Object.freeze(v)),f(R?"failed":"ready"),E(R&&g!==void 0&&!g.ok?g.error:null);},[t,a,r]);react.useEffect(()=>{m();},[m]);let c=react.useCallback(async(p,h)=>{if(r===null)return y($r());let v=T.current,g=null;l(u=>{let _=u.findIndex(j=>j.scope===p),C=_===-1?oe(p,null):u[_];g=C;let S=Object.freeze({...C,granted:h,hasDecision:true,saving:true,error:null});if(_===-1)return Object.freeze([...u,S]);let I=[...u];return I[_]=S,Object.freeze(I)});let R=await t.write({scope:p,granted:h});return v!==T.current||l(u=>{let _=u.findIndex(S=>S.scope===p);if(_===-1)return u;let C=[...u];return C[_]=R.ok?Le(R.value):Object.freeze({...g??oe(p,null),saving:false,error:R.error}),Object.freeze(C)}),R},[t,r]);return react.useMemo(()=>({status:s,scopes:i,error:d,setConsent:c,refresh:m}),[s,i,d,c,m])}n(ie,"useEverfurConsent");function qe(e){let r=globalThis.console;try{r?.error?.("[everfur] A host callback threw; the SDK ignored it.",e);}catch{}}n(qe,"reportHostFailure");function Gr(e){return (typeof e=="object"||typeof e=="function")&&e!==null&&typeof e.then=="function"}n(Gr,"isThenable");function Qr(e,...r){if(typeof e=="function")try{let t=e(...r);return Gr(t)&&Promise.resolve(t).then(void 0,qe),t}catch(t){qe(t);return}}n(Qr,"callHost");var He=new WeakMap;function Xr(e){if(typeof e!="function")return;let r=He.get(e);if(r!==void 0)return r;let t=n((...o)=>{Qr(e,...o);},"guarded");return He.set(e,t),t}n(Xr,"guardHost");function Ve(e,r){let t=null;for(let o of r){let a=e[o];typeof a=="function"&&(t??={...e},t[o]=Xr(a));}return t??e}n(Ve,"guardHostProps");var le=class le extends react.Component{constructor(){super(...arguments);this.state={failed:false,key:this.props.resetKey};}static getDerivedStateFromError(){return {failed:true}}static getDerivedStateFromProps(t,o){return Object.is(t.resetKey,o.key)?null:{failed:false,key:t.resetKey}}render(){return this.state.failed?this.props.fallback:this.props.children}};n(le,"HostRenderBoundary");var se=le;function Zr({render:e}){return e()}n(Zr,"RenderHost");function Ke({render:e,fallback:r,resetKey:t}){return react.createElement(se,{fallback:r,resetKey:t,children:react.createElement(Zr,{render:e})})}n(Ke,"HostRender");function ce(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let r of Object.keys(e))ce(e[r]);}return e}n(ce,"deepFreeze");var et=Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3}),$e={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},Ge={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},We={nano:8,small:9,micro:10,tiny:11,caption:12,bodyTight:13,body:14,subtitle:16,heading:18,verdict:24},rt={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},tt={regular:"400",medium:"500",bold:"700"},nt={eyebrow:1,monoWide:.9,headerBrand:-0.42,tight:-0.35},ot=0,q="System",H="monospace",at=["content","heading","control","compact","badge"];function it(e){let r={};for(let t of at)r[t]=e;return r}n(it,"authoredTierSizes");function Qe(){return {family:q,mono:H,fontUrl:null,families:{regular:q,medium:q,bold:q,mono:H,monoMedium:H,monoBold:H},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:We,tierSizes:it(We),lineHeight:rt,weight:tt,letterSpacing:nt,scale:1,maxScale:ot,scaleCaps:et}}n(Qe,"baseType");var Xe={},ue=Object.freeze({standard:Object.freeze([.2,0,0,1]),emphasized:Object.freeze([.2,.8,.2,1]),exit:Object.freeze([.4,0,1,1])});function de(e){return `cubic-bezier(${e.join(", ")})`}n(de,"cssCubicBezier");var Je={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:de(ue.standard),emphasized:de(ue.emphasized),exit:de(ue.exit)},reducedMotion:false},st={brand:"#10462E",brandSoft:"rgba(16,70,46,0.10)",brandSofter:"rgba(16,70,46,0.15)",brandBorder:"rgba(16,70,46,0.18)",borderHairlineGreen:"rgba(16,70,46,0.25)",brandBorderStrong:"rgba(16,70,46,0.55)",brandInk:"#10462E",linkInk:"#10462E",surface:"#FFFFFF",surfaceCream:"#FDFBF8",surfaceSubtle:"#EFE9E3",background:"#FFFFFF",borderRingCream:"#D8D2C8",chatGround:"#FFFFFF",composerFill:"#FDFBF8",composerBorder:"rgba(16,70,46,0.75)",shadow:"#0B3421",text:{primary:"#111111",secondary:"#0E462E",muted:"#6E6660",placeholder:"rgba(61,61,61,0.75)",onBrand:"#FFFFFF",metaCool:"#3D3D3D",timestamp:"rgba(61,61,61,0.75)"},primary:"#10462E",onPrimary:"#FFFFFF",accent:"#10462E",onAccent:"#FFFFFF",accentEdge:"#07C168",success:"#07C168",danger:"#B91C1C",errorRed:"#FF1B00",warningStrong:"#A45610",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.12)",badgeBgCaution:"rgba(217,130,29,0.14)",badgeBgCritical:"rgba(185,28,28,0.12)",badgeBgNeutral:"rgba(110,102,96,0.12)",bubbleUser:"#10462E",bubbleAssistant:"#FFFFFF",skeleton:"#EFE9E3",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.10)",checkupCardConcernBg:"rgba(239,167,0,0.10)"},Ze=ce({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:st,space:$e,radius:Ge,type:Qe(),motion:Je,slots:Xe}),lt={brand:"#6BD39A",brandSoft:"rgba(107,211,154,0.12)",brandSofter:"rgba(107,211,154,0.18)",brandBorder:"rgba(107,211,154,0.22)",borderHairlineGreen:"rgba(107,211,154,0.28)",brandBorderStrong:"rgba(107,211,154,0.55)",brandInk:"#6BD39A",linkInk:"#6BD39A",surface:"#1C1F23",surfaceCream:"#23272C",surfaceSubtle:"#23272C",background:"#15171A",borderRingCream:"#3A3F45",chatGround:"#1C1F23",composerFill:"#23272C",composerBorder:"rgba(107,211,154,0.75)",shadow:"#000000",text:{primary:"#F5F3F0",secondary:"#A9E4C4",muted:"#9A938C",placeholder:"rgba(255,255,255,0.55)",onBrand:"#0E1F17",metaCool:"#C9C9C9",timestamp:"rgba(245,243,240,0.7)"},primary:"#6BD39A",onPrimary:"#0E1F17",accent:"#6BD39A",onAccent:"#0E1F17",accentEdge:"#34D888",success:"#07C168",danger:"#F87171",errorRed:"#FF6B5B",warningStrong:"#F0A35E",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.18)",badgeBgCaution:"rgba(217,130,29,0.20)",badgeBgCritical:"rgba(185,28,28,0.22)",badgeBgNeutral:"rgba(255,255,255,0.10)",bubbleUser:"#6BD39A",bubbleAssistant:"#1C1F23",skeleton:"#23272C",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.16)",checkupCardConcernBg:"rgba(239,167,0,0.16)"};ce({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:lt,space:$e,radius:Ge,type:Qe(),motion:Je,slots:Xe});var er=Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),rr=globalThis,pe=rr[er]??(rr[er]=react.createContext(Ze));pe.displayName??="EverfurThemeContext";function fe(){return react.useContext(pe)}n(fe,"useEverfurTheme");var tr=Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});var nr='system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',ct="System";function pt(e){let r=e.trim();return r.length===0||r===ct?nr:`${or(r)}, ${nr}`}n(pt,"cssFontFamily");function ft(e){let r=e.trim();return r.length===0||r==="monospace"?"ui-monospace, Menlo, Consolas, monospace":`${or(r)}, ui-monospace, Menlo, Consolas, monospace`}n(ft,"cssMonoFamily");function or(e){return `"${e.replace(/[\\"]/g,"\\$&")}"`}n(or,"quote");function O(e,r){let t=e.type,o=t.families[r];return {fontFamily:r==="mono"||r==="monoMedium"||r==="monoBold"?ft(o):pt(o),fontWeight:t.namedFaces[r]?t.weight.regular:t.weight[tr[r]]}}n(O,"faceCss");function Et(e){let{scope:r,onChange:t,renderNotice:o,style:a,className:s}=Ve(e,["onChange"]),f=fe(),i=react.useMemo(()=>gt(f),[f]),l=ie({scopes:[r]}),d=W(l,r),E=K[r],[T,m]=react.useState(null),c=react.useCallback(async v=>{m(v);let g=await l.setConsent(r,v);g.ok&&(m(null),t?.(g.value.granted));},[l,t,r]),p=n((v,g)=>jsxRuntime.jsxs("div",{style:i.notice,children:[jsxRuntime.jsx(Ke,{resetKey:v,render:()=>o?o(v):jsxRuntime.jsx("p",{style:i.noticeText,children:v.displayMessage}),fallback:jsxRuntime.jsx("p",{style:i.noticeText,children:v.displayMessage})}),jsxRuntime.jsx("button",{type:"button",onClick:g,style:i.retry,children:F.retry})]}),"notice");if(d.kind==="signedOut")return jsxRuntime.jsxs("div",{className:s,style:{...i.container,...a},children:[jsxRuntime.jsx("p",{style:i.title,children:E.title}),jsxRuntime.jsx("p",{style:i.body,children:F.signedOut})]});if(d.kind==="loading")return jsxRuntime.jsx("div",{className:s,style:{...i.container,...a},role:"status","aria-busy":"true","aria-label":F.loading,children:jsxRuntime.jsx("p",{style:i.title,children:E.title})});if(d.kind==="failed")return jsxRuntime.jsxs("div",{className:s,style:{...i.container,...a},children:[jsxRuntime.jsx("p",{style:i.title,children:E.title}),p(d.error,()=>{l.refresh();})]});let h=`${E.title}. ${E.body(f.meta.displayName)}`;return jsxRuntime.jsxs("div",{className:s,style:{...i.container,...a},children:[jsxRuntime.jsxs("div",{style:{...i.row,...d.granted?i.rowChecked:null},children:[jsxRuntime.jsx("input",{type:"checkbox",checked:d.granted,disabled:d.saving,"aria-label":h,"aria-busy":d.saving?"true":void 0,onChange:v=>{c(v.currentTarget.checked);},style:i.box}),jsxRuntime.jsxs("div",{style:i.copy,children:[jsxRuntime.jsx("p",{style:i.title,children:E.title}),jsxRuntime.jsx("p",{style:i.body,children:E.body(f.meta.displayName)}),jsxRuntime.jsx("p",{style:i.footnote,children:F.changeable})]})]}),d.error===null?null:p(d.error,()=>{c(T??!d.granted);})]})}n(Et,"EverfurConsentToggle");function gt(e){let{color:r,radius:t,space:o,type:a}=e,s=`${Math.round(a.size.caption*a.lineHeight.snug)}px`;return {container:{boxSizing:"border-box",display:"flex",flexDirection:"column",gap:o.sm,padding:`${o.md}px ${o.lg}px`},row:{boxSizing:"border-box",display:"flex",alignItems:"flex-start",gap:o.md,borderRadius:t.md,border:`1px solid ${r.brandBorder}`,backgroundColor:r.surface,padding:o.lg},rowChecked:{border:`1px solid ${r.brand}`,backgroundColor:r.brandSoft},box:{width:24,height:24,minWidth:24,minHeight:24,margin:0,accentColor:r.brand,cursor:"pointer"},copy:{display:"flex",flexDirection:"column",gap:o.xs},title:{margin:0,...O(e,"bold"),fontSize:a.size.body,lineHeight:`${Math.round(a.size.body*a.lineHeight.snug)}px`,color:r.text.primary},body:{margin:0,...O(e,"regular"),fontSize:a.size.caption,lineHeight:s,color:r.text.secondary},footnote:{margin:0,...O(e,"regular"),fontSize:a.size.caption,lineHeight:s,color:r.text.muted},notice:{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:o.xs,paddingTop:o.xs},noticeText:{margin:0,...O(e,"regular"),fontSize:a.size.caption,lineHeight:s,color:r.errorRed},retry:{minHeight:44,padding:`0 ${o.sm}px`,border:"none",background:"none",cursor:"pointer",...O(e,"bold"),fontSize:a.size.caption,color:r.linkInk}}}n(gt,"makeStyles");exports.CONSENT_COPY=F;exports.CONSENT_SCOPE_COPY=K;exports.CONSENT_VERSION_MAX=ee;exports.EVERFUR_CONSENT_SCOPES=D;exports.EverfurConsentToggle=Et;exports.consentRowView=W;exports.createConsentRepository=re;exports.createConsentRepositoryOver=Ne;exports.isEverfurConsentScope=B;exports.useEverfurConsent=ie;exports.useEverfurConsentRepository=Be;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ReactNode, CSSProperties } from 'react';
|
|
2
|
-
import { E as EverfurConsentScope } from '../../copy-
|
|
3
|
-
export { C as CONSENT_COPY, a as CONSENT_SCOPE_COPY, b as CONSENT_VERSION_MAX, c as ConsentRepository, d as ConsentRepositoryDeps, e as ConsentRowView, f as ConsentRuntime, g as ConsentScopeCopy, h as EVERFUR_CONSENT_SCOPES, i as EverfurConsentDecision, j as EverfurConsentOptions, k as EverfurConsentScopeState, l as EverfurConsentState, m as EverfurConsentStatus, n as EverfurConsentVerdict, o as consentRowView, p as createConsentRepository, q as createConsentRepositoryOver, r as isEverfurConsentScope, u as useEverfurConsent, s as useEverfurConsentRepository } from '../../copy-
|
|
2
|
+
import { E as EverfurConsentScope } from '../../copy-UeUJVk8X.cjs';
|
|
3
|
+
export { C as CONSENT_COPY, a as CONSENT_SCOPE_COPY, b as CONSENT_VERSION_MAX, c as ConsentRepository, d as ConsentRepositoryDeps, e as ConsentRowView, f as ConsentRuntime, g as ConsentScopeCopy, h as EVERFUR_CONSENT_SCOPES, i as EverfurConsentDecision, j as EverfurConsentOptions, k as EverfurConsentScopeState, l as EverfurConsentState, m as EverfurConsentStatus, n as EverfurConsentVerdict, o as consentRowView, p as createConsentRepository, q as createConsentRepositoryOver, r as isEverfurConsentScope, u as useEverfurConsent, s as useEverfurConsentRepository } from '../../copy-UeUJVk8X.cjs';
|
|
4
4
|
import { E as EverfurError } from '../../EverfurResult-DN9pL2Ab.cjs';
|
|
5
5
|
export { a as EverfurErrorCategory, b as EverfurErrorCode, c as EverfurResult } from '../../EverfurResult-DN9pL2Ab.cjs';
|
|
6
|
-
export { A as AuthContext, I as IdentityProvider, M as MintedToken, T as TokenProvider } from '../../identity-
|
|
7
|
-
export { A as AcceptedFrame, a as AnalysisCompleteFrame, b as AnalysisStartedFrame, D as DeltaFrame, c as DoneFrame, E as ErrorFrame, d as EverfurRequest, e as EverfurRequestBase, F as Frame, f as FrameBase, g as FrameKind, H as HeartbeatFrame, h as HttpMethod, M as MultipartBody, T as TransportPort, U as UnknownFrame, i as UrgencyLevel } from '../../config
|
|
6
|
+
export { A as AuthContext, I as IdentityProvider, M as MintedToken, T as TokenProvider } from '../../identity-C2-08BZW.cjs';
|
|
7
|
+
export { A as AcceptedFrame, a as AnalysisCompleteFrame, b as AnalysisStartedFrame, D as DeltaFrame, c as DoneFrame, E as ErrorFrame, d as EverfurRequest, e as EverfurRequestBase, F as Frame, f as FrameBase, g as FrameKind, H as HeartbeatFrame, h as HttpMethod, M as MultipartBody, T as TransportPort, U as UnknownFrame, i as UrgencyLevel } from '../../config--Wu1Umhd.cjs';
|
|
8
8
|
export { B as Brand, C as ConversationId, P as PetRef, R as RecordsRequestId, U as UserRef, _ as __brand } from '../../ids-B2GAAifq.cjs';
|
|
9
9
|
export { E as ErrorPolicyPort } from '../../ErrorPolicyPort-CNf4uQZP.cjs';
|
|
10
|
-
import '../../requestFunnel-
|
|
10
|
+
import '../../requestFunnel-BjDpqqvm.cjs';
|
|
11
11
|
|
|
12
12
|
interface EverfurConsentToggleProps {
|
|
13
13
|
/** Which act this row is. One row is one act; two acts are two rows, never one switch. */
|