@everfur/sdk 0.18.0 → 0.18.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/README.md +1 -0
- package/dist/{Chat.d-nBMspy8Z.d.cts → Chat.d-B7iUVGmB.d.cts} +1 -1
- package/dist/{Chat.d-B8TWabGJ.d.ts → Chat.d-BkLu9G00.d.ts} +1 -1
- package/dist/{DepthViews.d-oOd8fuK6.d.cts → DepthViews.d-BiS-GTEf.d.cts} +1 -1
- package/dist/{DepthViews.d-8lDlsvMt.d.cts → DepthViews.d-C-zs_BnZ.d.cts} +1 -1
- package/dist/{DepthViews.d-DL16ovp4.d.ts → DepthViews.d-C0DVqywN.d.ts} +1 -1
- package/dist/{DepthViews.d-40yUiKkk.d.ts → DepthViews.d-hXV6Ef0y.d.ts} +1 -1
- package/dist/{RecordsPage.d-DIAUDckk.d.cts → RecordsPage.d-5rHMTDyY.d.cts} +1 -1
- package/dist/{RecordsPage.d-BUczguEu.d.ts → RecordsPage.d-BG_RDR1V.d.ts} +1 -1
- package/dist/animations/index.d.cts +3 -3
- package/dist/animations/index.d.ts +3 -3
- package/dist/{appStateLifecycle.d-Ciy42l5z.d.ts → appStateLifecycle.d-7H_2a9it.d.ts} +3 -3
- package/dist/{appStateLifecycle.d-CvhRl6ey.d.cts → appStateLifecycle.d-_TM06yEk.d.cts} +3 -3
- package/dist/{attachments.d-BcE2ZTaC.d.ts → attachments.d-D7f7OfPE.d.ts} +5 -5
- package/dist/{attachments.d-CkQIvOXZ.d.cts → attachments.d-DFbXLAYK.d.cts} +2 -2
- package/dist/{attachments.d-PKWAhoTz.d.cts → attachments.d-HmRqizDG.d.cts} +5 -5
- package/dist/{attachments.d-CYQXPR-Y.d.ts → attachments.d-_mgNU-ur.d.ts} +2 -2
- package/dist/{bookingCopy.d-eX4UED7v.d.cts → bookingCopy.d-0K1trjxx.d.cts} +2 -2
- package/dist/{bookingCopy.d-DA1wfcj3.d.ts → bookingCopy.d-RU8lNYJ4.d.ts} +2 -2
- package/dist/{casesRepository.d-DBdJKUms.d.ts → casesRepository.d-D2SQFL27.d.ts} +1 -1
- package/dist/{casesRepository.d-D1HFTASM.d.cts → casesRepository.d-D7vIZ9oX.d.cts} +1 -1
- package/dist/chat/index.d.cts +10 -10
- package/dist/chat/index.d.ts +10 -10
- package/dist/chat/lite/index.d.cts +10 -10
- package/dist/chat/lite/index.d.ts +10 -10
- package/dist/client/index.cjs +2 -2
- package/dist/client/index.d.cts +6 -6
- package/dist/client/index.d.ts +6 -6
- package/dist/client/index.js +2 -2
- package/dist/{clinicBatch.d-DneAvigV.d.cts → clinicBatch.d-BN1jfVGo.d.cts} +2 -2
- package/dist/{clinicBatch.d-C-boO8Bw.d.ts → clinicBatch.d-BhaCdstU.d.ts} +2 -2
- package/dist/{config.d-DMHNVTP3.d.cts → config.d-BFTqU7ft.d.cts} +1 -1
- package/dist/{config.d-DXb2J8uy.d.ts → config.d-D_k_rNZZ.d.ts} +1 -1
- package/dist/consent/index.d.cts +5 -5
- package/dist/consent/index.d.ts +5 -5
- package/dist/{context.d-B-MAQGea.d.ts → context.d-B4LODPF1.d.ts} +5 -5
- package/dist/{context.d-wqh1k0Lk.d.cts → context.d-D2fhrjAM.d.cts} +5 -5
- package/dist/{copy.d-DjZUPo5t.d.ts → copy.d-Bn9eIgkW.d.ts} +2 -2
- package/dist/{copy.d-DKxrZwGS.d.cts → copy.d-DjYhMxxS.d.cts} +2 -2
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.d.cts +13 -13
- package/dist/core/index.d.ts +13 -13
- package/dist/core/index.js +1 -1
- package/dist/{depth.d-CghhRDXi.d.cts → depth.d-CsKZkLNi.d.cts} +2 -2
- package/dist/{depth.d-BIEzpRYI.d.ts → depth.d-DlaIV8TV.d.ts} +2 -2
- package/dist/{entitlementRepository.d-DAfH8Cc6.d.ts → entitlementRepository.d-C5d_6QMi.d.ts} +2 -2
- package/dist/{entitlementRepository.d-CPJUGTxm.d.cts → entitlementRepository.d-CpIRpfzy.d.cts} +2 -2
- package/dist/{focus.d-BbXAdBvO.d.ts → focus.d-DOlAaNIU.d.ts} +2 -2
- package/dist/{focus.d-DP0D_ZPV.d.cts → focus.d-DdBbwzjP.d.cts} +2 -2
- package/dist/health-plan/index.d.cts +9 -9
- package/dist/health-plan/index.d.ts +9 -9
- package/dist/{idempotency.d-Ckg1QBNm.d.ts → idempotency.d-CmQc1OUv.d.ts} +1 -1
- package/dist/{idempotency.d-Det48mgE.d.cts → idempotency.d-P4O5lNBq.d.cts} +1 -1
- package/dist/{identity.d-42zkEcip.d.ts → identity.d-BZXPu9Hi.d.ts} +1 -1
- package/dist/{identity.d-CLL-uA7Z.d.cts → identity.d-BmbAwQYx.d.cts} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +13 -13
- package/dist/index.d.ts +13 -13
- package/dist/index.js +1 -1
- package/dist/{introEvents.d-BQWGZ7sZ.d.cts → introEvents.d-Bqw2Hcpt.d.cts} +1 -1
- package/dist/{introEvents.d-C9YLJ8oL.d.ts → introEvents.d-Cy8yxOoe.d.ts} +1 -1
- package/dist/notifications/index.d.cts +4 -4
- package/dist/notifications/index.d.ts +4 -4
- package/dist/{optInView.d-BS3afARj.d.cts → optInView.d-DXj2w4KU.d.cts} +2 -2
- package/dist/{optInView.d-qoO2QvYI.d.ts → optInView.d-wGSNOB86.d.ts} +2 -2
- package/dist/{parse.d-CweaQUPi.d.cts → parse.d-C9_UMXfA.d.cts} +1 -1
- package/dist/{parse.d-CMqbalEM.d.ts → parse.d-MQST1RP3.d.ts} +1 -1
- package/dist/{pets.d-BqXJdlSM.d.cts → pets.d-CP13kAFa.d.cts} +1 -1
- package/dist/{pets.d-CcYsYFf7.d.ts → pets.d-tqGZP3Co.d.ts} +1 -1
- package/dist/{petsRepository.d-Cb_srKM6.d.ts → petsRepository.d-CLyzuoo4.d.ts} +1 -1
- package/dist/{petsRepository.d-CUkUCzi0.d.cts → petsRepository.d-CyerzD5G.d.cts} +1 -1
- package/dist/{ports.d-DHYmw-nA.d.cts → ports.d-CB9YZT2L.d.cts} +4 -4
- package/dist/{ports.d-BPn7SPWw.d.ts → ports.d-RKc2C07X.d.ts} +4 -4
- package/dist/records/depth/index.d.cts +9 -9
- package/dist/records/depth/index.d.ts +9 -9
- package/dist/records/index.cjs +1 -1
- package/dist/records/index.d.cts +10 -10
- package/dist/records/index.d.ts +10 -10
- package/dist/records/index.js +1 -1
- package/dist/{requestFunnel.d-L3oGPnCi.d.ts → requestFunnel.d-BPWf5SQf.d.ts} +2 -2
- package/dist/{requestFunnel.d-BjtdtG4R.d.cts → requestFunnel.d-DocT7FXR.d.cts} +2 -2
- package/dist/{runtimeTypes.d-D0Caa_Hw.d.cts → runtimeTypes.d-CkwEMpy8.d.cts} +4 -4
- package/dist/{runtimeTypes.d-C2RO2Sqz.d.ts → runtimeTypes.d-D4Cjjf_C.d.ts} +4 -4
- package/dist/{screenProps.d-D-o0_ELN.d.cts → screenProps.d-Byla6nJL.d.cts} +1 -1
- package/dist/{screenProps.d-BdQ2mawf.d.ts → screenProps.d-DNTTp7hU.d.ts} +1 -1
- 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/shop/index.d.cts +3 -3
- package/dist/shop/index.d.ts +3 -3
- package/dist/tabs/index.d.cts +6 -6
- package/dist/tabs/index.d.ts +6 -6
- package/dist/televet/booking/index.d.cts +6 -6
- package/dist/televet/booking/index.d.ts +6 -6
- package/dist/testing/index.cjs +1 -1
- package/dist/testing/index.d.cts +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/index.js +1 -1
- package/dist/testing/rn/index.d.cts +7 -7
- package/dist/testing/rn/index.d.ts +7 -7
- package/dist/testing/web/index.d.cts +7 -7
- package/dist/testing/web/index.d.ts +7 -7
- package/dist/texting/index.d.cts +5 -5
- package/dist/texting/index.d.ts +5 -5
- package/dist/{threadOptions.d-CPYEz0wW.d.cts → threadOptions.d-CIrevUL8.d.cts} +2 -2
- package/dist/{threadOptions.d-BRMCU6Wx.d.ts → threadOptions.d-jgk_sHrj.d.ts} +2 -2
- package/dist/{timelineRows.d-D4vDIhl6.d.cts → timelineRows.d-BEjiHpkP.d.cts} +1 -1
- package/dist/{timelineRows.d-C0X6ikJF.d.ts → timelineRows.d-BST14weg.d.ts} +1 -1
- package/dist/{useHealthPlanSubscription.d-DNtKgp06.d.ts → useHealthPlanSubscription.d-C9kh4mvk.d.ts} +2 -2
- package/dist/{useHealthPlanSubscription.d-dA3Kp2tI.d.cts → useHealthPlanSubscription.d-CYJi9ZNE.d.cts} +2 -2
- package/dist/{usePresentation.d-BnyKXj2W.d.cts → usePresentation.d-COEh8Xa1.d.cts} +1 -1
- package/dist/{usePresentation.d-DTejSTEA.d.ts → usePresentation.d-WA3sfMpz.d.ts} +1 -1
- package/dist/{useRecordsDepth.d-DJJfhKqn.d.ts → useRecordsDepth.d-CAYnVYl1.d.ts} +1 -1
- package/dist/{useRecordsDepth.d-C7xReDt0.d.cts → useRecordsDepth.d-DZfdRdIU.d.cts} +1 -1
- package/dist/{view.d-B4fsSYs6.d.ts → view.d-D8soknYh.d.ts} +3 -3
- package/dist/{view.d-jyKB5_ym.d.cts → view.d-eM315KIZ.d.cts} +3 -3
- package/dist/web/consent/index.d.cts +5 -5
- package/dist/web/consent/index.d.ts +5 -5
- package/dist/web/health-plan/index.d.cts +11 -11
- package/dist/web/health-plan/index.d.ts +11 -11
- package/dist/web/index.cjs +1 -1
- package/dist/web/index.d.cts +23 -23
- package/dist/web/index.d.ts +23 -23
- package/dist/web/index.js +1 -1
- package/dist/web/intro/index.d.cts +6 -6
- package/dist/web/intro/index.d.ts +6 -6
- package/dist/web/notifications/index.d.cts +3 -3
- package/dist/web/notifications/index.d.ts +3 -3
- package/dist/web/records/depth/index.d.cts +9 -9
- package/dist/web/records/depth/index.d.ts +9 -9
- package/dist/web/records/index.d.cts +11 -11
- package/dist/web/records/index.d.ts +11 -11
- package/dist/web/records-sheet/index.cjs +1 -1
- package/dist/web/records-sheet/index.js +1 -1
- package/dist/web/shop/index.d.cts +3 -3
- package/dist/web/shop/index.d.ts +3 -3
- package/dist/web/televet/booking/index.d.cts +6 -6
- package/dist/web/televet/booking/index.d.ts +6 -6
- package/dist/web/texting/index.d.cts +5 -5
- package/dist/web/texting/index.d.ts +5 -5
- package/package.json +2 -2
package/dist/server/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
|
|
2
2
|
function ok(value,warning){/* @__PURE__ */
|
|
3
3
|
return Object.freeze({ok:true,value:value})}function err(error){/* @__PURE__ */
|
|
4
|
-
return Object.freeze({ok:false,error:error})}var EverfurConfigError=class _EverfurConfigError extends Error{constructor(kind,message){super(message),this.name="EverfurConfigError",this.kind=kind,Object.setPrototypeOf(this,_EverfurConfigError.prototype)}};var ABSOLUTE_URL=/^([A-Za-z][A-Za-z0-9+.-]*):\/\/([^/?#]*)/;var SDK_VERSION="0.18.
|
|
4
|
+
return Object.freeze({ok:false,error:error})}var EverfurConfigError=class _EverfurConfigError extends Error{constructor(kind,message){super(message),this.name="EverfurConfigError",this.kind=kind,Object.setPrototypeOf(this,_EverfurConfigError.prototype)}};var ABSOLUTE_URL=/^([A-Za-z][A-Za-z0-9+.-]*):\/\/([^/?#]*)/;var SDK_VERSION="0.18.2",SDK_PLATFORM="react-native",DEFAULT_CONTRACT_VERSION="2026-09-19",ENV_API_BASE_URL="EVERFUR_API_BASE_URL";function configFailure(reason,message){/* @__PURE__ */
|
|
5
5
|
return Object.freeze({ok:false,failure:/* @__PURE__ */Object.freeze({reason:reason,message:message})})}function tryResolveApiBaseUrl(apiBaseUrl){let explicit=apiBaseUrl?.trim(),candidate=explicit&&explicit.length>0?explicit:readEnv(ENV_API_BASE_URL);return candidate?normalizeBaseUrl(candidate):configFailure("missing-api-base-url",`apiBaseUrl is required: pass config.apiBaseUrl or set ${ENV_API_BASE_URL}. The SDK never ships a hardcoded host.`)}function resolveApiBaseUrl(apiBaseUrl){let outcome=tryResolveApiBaseUrl(apiBaseUrl);if(!outcome.ok)throw new EverfurConfigError("invalid-argument",outcome.failure.message);return outcome.value}function buildBaseHeaders(cfg){return{"X-Everfur-SDK-Version":cfg.sdkVersion,"X-Everfur-SDK-Platform":cfg.platform,"X-Everfur-Contract":cfg.contractVersion}}function hostOf(authority){return authority.slice(authority.lastIndexOf("@")+1).replace(/:\d+$/,"").toLowerCase()}function isPrintableHost(host){return host.length===0||host.includes("@")?false:host.startsWith("[")&&host.endsWith("]")?true:!host.includes(":")}function canEchoOrigin(rawTrimmed,host){let schemeEnd=rawTrimmed.indexOf("://");return schemeEnd<0||rawTrimmed.slice(schemeEnd+3).includes("@")?false:isPrintableHost(host)}function safeOrigin(scheme,host){return`${scheme}://${host}`}function normalizeBaseUrl(raw){let trimmed=raw.trim(),match=ABSOLUTE_URL.exec(trimmed);if(match===null||match[2]===void 0||match[2].length===0)return configFailure("malformed-api-base-url","apiBaseUrl is not a valid absolute URL");let scheme=(match[1]??"").toLowerCase(),host=hostOf(match[2]);if(host.length===0)return configFailure("malformed-api-base-url","apiBaseUrl is not a valid absolute URL");let shown=canEchoOrigin(trimmed,host)?`: ${safeOrigin(scheme,host)}`:"";if(scheme!=="https"){if(!(scheme==="http"&&isLoopbackHost(host)))return scheme==="http"?configFailure("insecure-api-base-url",`apiBaseUrl must use https (cleartext http is only allowed for localhost)${shown}`):configFailure("unsupported-api-base-url-scheme",`apiBaseUrl must be http(s)${shown}`)}let value=trimmed.endsWith("/")?trimmed.slice(0,-1):trimmed;/* @__PURE__ */
|
|
6
6
|
return Object.freeze({ok:true,value:value})}function isLoopbackHost(hostname){let host=hostname.toLowerCase();return host==="localhost"||host==="127.0.0.1"||host==="[::1]"||host==="::1"}function readEnv(name){let value=globalThis.process?.env?.[name];return typeof value=="string"&&value.trim().length>0?value.trim():void 0}var DAILY_QUOTA_WIRE_CODE="DAILY_QUOTA_EXCEEDED",THROTTLES=/* @__PURE__ */new Set(["THROTTLINGEXCEPTION","RATELIMITED","TOOMANYREQUESTS"]);function foldDailyQuotaWireCode(code,body){if(!THROTTLES.has(code.toUpperCase().replace(/[^A-Z0-9]/g,"")))return code;let b=body,limit=b?.daily_limit??b?.error?.daily_limit;return typeof limit=="number"&&Number.isFinite(limit)?DAILY_QUOTA_WIRE_CODE:code}var CONTRACT_RETRYABILITY=/* @__PURE__ */Object.freeze([
|
|
7
7
|
/* @__PURE__ */Object.freeze({wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false}),
|
package/dist/shop/index.d.cts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { ImageSourcePropType } from 'react-native';
|
|
4
|
-
import { O as OmsClient, S as ShopPet, b as ShopPackageSource, c as ShopCopy, d as ShopV3Copy, e as ShopRoute, f as ShopCardHandoff, a as ShopPaymentsPort, h as ShopProfileName, i as ShopOrdersV2Copy } from '../idempotency.d-
|
|
5
|
-
export { j as OmsClientConfig, k as OmsConsumerAuth, l as OmsGetToken, m as SHOP_COPY, n as SHOP_COPY_PLACEHOLDERS, o as SHOP_ORDERS_V2_COPY, p as SHOP_V3_COPY, q as SHOP_V3_COPY_PLACEHOLDERS, r as ShopPackage, s as ShopPackageLine, E as ShopPayerActionContext, t as ShopPaymentStepResult, u as ShopTabName, U as UNAVAILABLE_PACKAGE_SOURCE, x as createOmsClient, y as createOmsPackageSource, A as newIdempotencyKey, B as shopCopy, C as shopOrdersV2Copy, D as shopV3Copy } from '../idempotency.d-
|
|
4
|
+
import { O as OmsClient, S as ShopPet, b as ShopPackageSource, c as ShopCopy, d as ShopV3Copy, e as ShopRoute, f as ShopCardHandoff, a as ShopPaymentsPort, h as ShopProfileName, i as ShopOrdersV2Copy } from '../idempotency.d-P4O5lNBq.cjs';
|
|
5
|
+
export { j as OmsClientConfig, k as OmsConsumerAuth, l as OmsGetToken, m as SHOP_COPY, n as SHOP_COPY_PLACEHOLDERS, o as SHOP_ORDERS_V2_COPY, p as SHOP_V3_COPY, q as SHOP_V3_COPY_PLACEHOLDERS, r as ShopPackage, s as ShopPackageLine, E as ShopPayerActionContext, t as ShopPaymentStepResult, u as ShopTabName, U as UNAVAILABLE_PACKAGE_SOURCE, x as createOmsClient, y as createOmsPackageSource, A as newIdempotencyKey, B as shopCopy, C as shopOrdersV2Copy, D as shopV3Copy } from '../idempotency.d-P4O5lNBq.cjs';
|
|
6
6
|
import { E as EverfurShopOrdersV2Screen } from '../view.d-CbcJKNJj.cjs';
|
|
7
7
|
export { o as OmsAddress, a as OmsBuyAgainItem, F as OmsCardActionLink, G as OmsCardSetupLink, p as OmsCartLine, q as OmsCents, j as OmsError, r as OmsOffer, b as OmsOrder, c as OmsOrderSummary, f as OmsPlan, s as OmsPlanChangeOption, t as OmsPlanOperation, m as OmsPlanSkipWarning, u as OmsPlanSkipWarningKey, n as OmsPrescription, g as OmsQuote, v as OmsQuoteLine, h as OmsReceipt, w as OmsReceiptCard, x as OmsReceiptLine, y as OmsResult, i as OmsShopConfig, z as OmsSupply, A as isOmsRefusal, B as isOmsRetryable, C as isOmsUnavailable } from '../omsErrors.d-VF5tnr20.cjs';
|
|
8
|
-
import '../config.d-
|
|
8
|
+
import '../config.d-BFTqU7ft.cjs';
|
|
9
9
|
import '../EverfurError.d-8NHtlgzA.cjs';
|
|
10
10
|
import '../EverfurResult.d-BFH-3s6E.cjs';
|
|
11
11
|
|
package/dist/shop/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { ImageSourcePropType } from 'react-native';
|
|
4
|
-
import { O as OmsClient, S as ShopPet, b as ShopPackageSource, c as ShopCopy, d as ShopV3Copy, e as ShopRoute, f as ShopCardHandoff, a as ShopPaymentsPort, h as ShopProfileName, i as ShopOrdersV2Copy } from '../idempotency.d-
|
|
5
|
-
export { j as OmsClientConfig, k as OmsConsumerAuth, l as OmsGetToken, m as SHOP_COPY, n as SHOP_COPY_PLACEHOLDERS, o as SHOP_ORDERS_V2_COPY, p as SHOP_V3_COPY, q as SHOP_V3_COPY_PLACEHOLDERS, r as ShopPackage, s as ShopPackageLine, E as ShopPayerActionContext, t as ShopPaymentStepResult, u as ShopTabName, U as UNAVAILABLE_PACKAGE_SOURCE, x as createOmsClient, y as createOmsPackageSource, A as newIdempotencyKey, B as shopCopy, C as shopOrdersV2Copy, D as shopV3Copy } from '../idempotency.d-
|
|
4
|
+
import { O as OmsClient, S as ShopPet, b as ShopPackageSource, c as ShopCopy, d as ShopV3Copy, e as ShopRoute, f as ShopCardHandoff, a as ShopPaymentsPort, h as ShopProfileName, i as ShopOrdersV2Copy } from '../idempotency.d-CmQc1OUv.js';
|
|
5
|
+
export { j as OmsClientConfig, k as OmsConsumerAuth, l as OmsGetToken, m as SHOP_COPY, n as SHOP_COPY_PLACEHOLDERS, o as SHOP_ORDERS_V2_COPY, p as SHOP_V3_COPY, q as SHOP_V3_COPY_PLACEHOLDERS, r as ShopPackage, s as ShopPackageLine, E as ShopPayerActionContext, t as ShopPaymentStepResult, u as ShopTabName, U as UNAVAILABLE_PACKAGE_SOURCE, x as createOmsClient, y as createOmsPackageSource, A as newIdempotencyKey, B as shopCopy, C as shopOrdersV2Copy, D as shopV3Copy } from '../idempotency.d-CmQc1OUv.js';
|
|
6
6
|
import { E as EverfurShopOrdersV2Screen } from '../view.d-CbcJKNJj.js';
|
|
7
7
|
export { o as OmsAddress, a as OmsBuyAgainItem, F as OmsCardActionLink, G as OmsCardSetupLink, p as OmsCartLine, q as OmsCents, j as OmsError, r as OmsOffer, b as OmsOrder, c as OmsOrderSummary, f as OmsPlan, s as OmsPlanChangeOption, t as OmsPlanOperation, m as OmsPlanSkipWarning, u as OmsPlanSkipWarningKey, n as OmsPrescription, g as OmsQuote, v as OmsQuoteLine, h as OmsReceipt, w as OmsReceiptCard, x as OmsReceiptLine, y as OmsResult, i as OmsShopConfig, z as OmsSupply, A as isOmsRefusal, B as isOmsRetryable, C as isOmsUnavailable } from '../omsErrors.d-VF5tnr20.js';
|
|
8
|
-
import '../config.d-
|
|
8
|
+
import '../config.d-D_k_rNZZ.js';
|
|
9
9
|
import '../EverfurError.d-8NHtlgzA.js';
|
|
10
10
|
import '../EverfurResult.d-D_-254ZY.js';
|
|
11
11
|
|
package/dist/tabs/index.d.cts
CHANGED
|
@@ -6,13 +6,13 @@ import { ReactNode } from 'react';
|
|
|
6
6
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
7
7
|
import { P as PetRef } from '../ids.d-B2GAAifq.cjs';
|
|
8
8
|
import { E as EverfurStarterPrompt } from '../quickPrompts.d-NM_81Jc1.cjs';
|
|
9
|
-
import { E as EverfurIntroCopy, a as EverfurIntroBlank, b as EverfurRecordsRequested, d as EverfurRecordsLanded, I as IntroText } from '../introEvents.d-
|
|
10
|
-
export { c as EVERFUR_INTRO_COPY, e as IntroFacts, f as IntroPetWords, g as IntroTextInput, h as defaultIntroBlanks, i as introFacts, j as introPetWords, k as introText, n as numberWord } from '../introEvents.d-
|
|
9
|
+
import { E as EverfurIntroCopy, a as EverfurIntroBlank, b as EverfurRecordsRequested, d as EverfurRecordsLanded, I as IntroText } from '../introEvents.d-Bqw2Hcpt.cjs';
|
|
10
|
+
export { c as EVERFUR_INTRO_COPY, e as IntroFacts, f as IntroPetWords, g as IntroTextInput, h as defaultIntroBlanks, i as introFacts, j as introPetWords, k as introText, n as numberWord } from '../introEvents.d-Bqw2Hcpt.cjs';
|
|
11
11
|
import { C as CaptureRecordsSignature } from '../clinicRequestProps.d-1dCtouGA.cjs';
|
|
12
12
|
import { g as EverfurChatOpeningCard } from '../threadOptions.d-bEAFkIsC.cjs';
|
|
13
13
|
import { E as EverfurTabId, a as EverfurTabsCopy } from '../tabsModel.d-D9GWPFrL.cjs';
|
|
14
14
|
export { b as EVERFUR_TABS_COPY } from '../tabsModel.d-D9GWPFrL.cjs';
|
|
15
|
-
import { H as HealthPlanPage } from '../focus.d-
|
|
15
|
+
import { H as HealthPlanPage } from '../focus.d-DdBbwzjP.cjs';
|
|
16
16
|
import { E as EverfurIntroMode, a as EverfurIntroFrame, b as EverfurIntroClose, c as EverfurIntroTabLabels } from '../useIntroSeen.d-CTWFUthO.cjs';
|
|
17
17
|
export { d as EverfurIntroExit, e as EverfurIntroSeen, i as isIntroSwipeOut, u as useEverfurIntroSeen } from '../useIntroSeen.d-CTWFUthO.cjs';
|
|
18
18
|
import '../EverfurResult.d-BFH-3s6E.cjs';
|
|
@@ -20,10 +20,10 @@ import '../EverfurError.d-8NHtlgzA.cjs';
|
|
|
20
20
|
import '../clinicModels.d-BXgKZqDb.cjs';
|
|
21
21
|
import '../models.d-BSqvbTE1.cjs';
|
|
22
22
|
import '../threadOptions.d-CW51PyVd.cjs';
|
|
23
|
-
import '../requestFunnel.d-
|
|
23
|
+
import '../requestFunnel.d-DocT7FXR.cjs';
|
|
24
24
|
import '../ErrorPolicyPort.d-DirW9hgO.cjs';
|
|
25
|
-
import '../config.d-
|
|
26
|
-
import '../identity.d-
|
|
25
|
+
import '../config.d-BFTqU7ft.cjs';
|
|
26
|
+
import '../identity.d-BmbAwQYx.cjs';
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* How the member got here, said by the host (explicit, owner decision (a)): a plain open from your app's own tab bar,
|
package/dist/tabs/index.d.ts
CHANGED
|
@@ -6,13 +6,13 @@ import { ReactNode } from 'react';
|
|
|
6
6
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
7
7
|
import { P as PetRef } from '../ids.d-B2GAAifq.js';
|
|
8
8
|
import { E as EverfurStarterPrompt } from '../quickPrompts.d-NM_81Jc1.js';
|
|
9
|
-
import { E as EverfurIntroCopy, a as EverfurIntroBlank, b as EverfurRecordsRequested, d as EverfurRecordsLanded, I as IntroText } from '../introEvents.d-
|
|
10
|
-
export { c as EVERFUR_INTRO_COPY, e as IntroFacts, f as IntroPetWords, g as IntroTextInput, h as defaultIntroBlanks, i as introFacts, j as introPetWords, k as introText, n as numberWord } from '../introEvents.d-
|
|
9
|
+
import { E as EverfurIntroCopy, a as EverfurIntroBlank, b as EverfurRecordsRequested, d as EverfurRecordsLanded, I as IntroText } from '../introEvents.d-Cy8yxOoe.js';
|
|
10
|
+
export { c as EVERFUR_INTRO_COPY, e as IntroFacts, f as IntroPetWords, g as IntroTextInput, h as defaultIntroBlanks, i as introFacts, j as introPetWords, k as introText, n as numberWord } from '../introEvents.d-Cy8yxOoe.js';
|
|
11
11
|
import { C as CaptureRecordsSignature } from '../clinicRequestProps.d-CjsMg_OD.js';
|
|
12
12
|
import { g as EverfurChatOpeningCard } from '../threadOptions.d-U5YBUKM-.js';
|
|
13
13
|
import { E as EverfurTabId, a as EverfurTabsCopy } from '../tabsModel.d-D9GWPFrL.js';
|
|
14
14
|
export { b as EVERFUR_TABS_COPY } from '../tabsModel.d-D9GWPFrL.js';
|
|
15
|
-
import { H as HealthPlanPage } from '../focus.d-
|
|
15
|
+
import { H as HealthPlanPage } from '../focus.d-DOlAaNIU.js';
|
|
16
16
|
import { E as EverfurIntroMode, a as EverfurIntroFrame, b as EverfurIntroClose, c as EverfurIntroTabLabels } from '../useIntroSeen.d-CTWFUthO.js';
|
|
17
17
|
export { d as EverfurIntroExit, e as EverfurIntroSeen, i as isIntroSwipeOut, u as useEverfurIntroSeen } from '../useIntroSeen.d-CTWFUthO.js';
|
|
18
18
|
import '../EverfurResult.d-D_-254ZY.js';
|
|
@@ -20,10 +20,10 @@ import '../EverfurError.d-8NHtlgzA.js';
|
|
|
20
20
|
import '../clinicModels.d-CaS64-P-.js';
|
|
21
21
|
import '../models.d-DOwnr8fi.js';
|
|
22
22
|
import '../threadOptions.d-CW51PyVd.js';
|
|
23
|
-
import '../requestFunnel.d-
|
|
23
|
+
import '../requestFunnel.d-BPWf5SQf.js';
|
|
24
24
|
import '../ErrorPolicyPort.d-68yrE3BE.js';
|
|
25
|
-
import '../config.d-
|
|
26
|
-
import '../identity.d-
|
|
25
|
+
import '../config.d-D_k_rNZZ.js';
|
|
26
|
+
import '../identity.d-BZXPu9Hi.js';
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* How the member got here, said by the host (explicit, owner decision (a)): a plain open from your app's own tab bar,
|
|
@@ -3,8 +3,8 @@ import { ReactNode, ComponentType, ReactElement } from 'react';
|
|
|
3
3
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
4
4
|
import { P as PetRef } from '../../ids.d-B2GAAifq.cjs';
|
|
5
5
|
export { B as Brand, _ as __brand } from '../../ids.d-B2GAAifq.cjs';
|
|
6
|
-
import { T as TelevetEmptyRosterCause, a as TelevetStateInterestAction$1, b as TelevetMediaShortfall, c as TelevetBookingStep, d as TelevetBookingContext, e as TelevetBookingController, f as TelevetTriageRead, g as TelevetStateInterestWrite, h as TelevetVetThreadTarget, i as TelevetDayPeriod } from '../../bookingCopy.d-
|
|
7
|
-
export { C as CONSULT_MINUTES, N as NO_MEDIA_SHORTFALL, j as TELEVET_BOOKING_BASE, k as TELEVET_BOOKING_COPY, l as TELEVET_BOOKING_STEPS, m as TELEVET_CONSULT_PAGE_LIMIT, n as TELEVET_JOIN_CLOSES_MINUTES_AFTER, o as TELEVET_JOIN_OPENS_MINUTES_BEFORE, p as TELEVET_MESSAGE_THREADS_PATH, q as TelevetAttachmentMeta, r as TelevetAttachmentPolicy, s as TelevetBookingAction, t as TelevetBookingControllerDeps, u as TelevetBookingCopy, v as TelevetBookingDraft, w as TelevetBookingFailure, x as TelevetBookingRefusal, y as TelevetBookingState, z as TelevetEarlyTriage, A as TelevetEmptyRosterView, B as TelevetJoinReadiness, D as TelevetJoinState, E as TelevetMediaRefusal, F as TelevetRead, G as TelevetStateInterestReason, H as TelevetWrite, U as UpcomingTelevetVisitState, I as UseVetThreadOptions, V as VET_MESSAGES_COPY, J as VET_MESSAGE_CONTENT_MAX, K as VET_MESSAGE_PAGE_DEFAULT, L as VET_MESSAGE_PAGE_MAX, M as VetMessage, O as VetMessagePage, P as VetMessageRole, Q as VetMessagesAvailability, R as VetSendFailure, S as VetThread, W as VetThreadState, X as VetThreadsState, Y as VisitSummary, Z as VisitSummaryMedication, _ as VisitSummaryState, $ as attestation, a0 as canConfirm, a1 as canManageTelevetVisit, a2 as createTelevetBookingController, a3 as currentStep, a4 as emptyTelevetDraft, a5 as formatVisitRange, a6 as formatWhen, a7 as formatWhenWithDay, a8 as hasPreviousStep, a9 as initialTelevetBookingState, aa as isHoldExpired, ab as isMediaShortfallEmpty, ac as isSkipped, ad as isTelevetBookingCopyReady, ae as isVetMessagesDark, af as isVetThreadVetFirst, ag as mediaShortfallFromUnsentPicks, ah as splitTelevetVisits, ai as televetBookingKey, aj as televetBookingReducer, ak as televetBookingRefusal, al as televetCancelCall, am as televetConsultCall, an as televetEmptyRosterCause, ao as televetEmptyRosterView, ap as televetHoldCall, aq as televetJoinCall, ar as televetJoinOpensAtMs, as as televetJoinReadiness, at as televetMediaShortfallLines, au as televetRescheduleCall, av as televetThreadMessagesCall, aw as televetThreadReadCall, ax as televetVisitSummaryCall, ay as useEarlyTriage, az as useStateInterest, aA as useTelevetBookConsult, aB as useTelevetBookingAvailable, aC as useTelevetBookingController, aD as useTelevetBookingEntitlement, aE as useTelevetCancellationPolicy, aF as useTelevetClinicians, aG as useTelevetHoldSlot, aH as useTelevetJoin, aI as useTelevetNextSlot, aJ as useTelevetRescheduleConsult, aK as useTelevetSlots, aL as useTelevetStatePolicy, aM as useUpcomingTelevetVisit, aN as useVetThread, aO as useVetThreads, aP as useVisitSummary, aQ as validateBookingBody, aR as vetThreadPetRef, aS as withUnsentPicks } from '../../bookingCopy.d-
|
|
6
|
+
import { T as TelevetEmptyRosterCause, a as TelevetStateInterestAction$1, b as TelevetMediaShortfall, c as TelevetBookingStep, d as TelevetBookingContext, e as TelevetBookingController, f as TelevetTriageRead, g as TelevetStateInterestWrite, h as TelevetVetThreadTarget, i as TelevetDayPeriod } from '../../bookingCopy.d-0K1trjxx.cjs';
|
|
7
|
+
export { C as CONSULT_MINUTES, N as NO_MEDIA_SHORTFALL, j as TELEVET_BOOKING_BASE, k as TELEVET_BOOKING_COPY, l as TELEVET_BOOKING_STEPS, m as TELEVET_CONSULT_PAGE_LIMIT, n as TELEVET_JOIN_CLOSES_MINUTES_AFTER, o as TELEVET_JOIN_OPENS_MINUTES_BEFORE, p as TELEVET_MESSAGE_THREADS_PATH, q as TelevetAttachmentMeta, r as TelevetAttachmentPolicy, s as TelevetBookingAction, t as TelevetBookingControllerDeps, u as TelevetBookingCopy, v as TelevetBookingDraft, w as TelevetBookingFailure, x as TelevetBookingRefusal, y as TelevetBookingState, z as TelevetEarlyTriage, A as TelevetEmptyRosterView, B as TelevetJoinReadiness, D as TelevetJoinState, E as TelevetMediaRefusal, F as TelevetRead, G as TelevetStateInterestReason, H as TelevetWrite, U as UpcomingTelevetVisitState, I as UseVetThreadOptions, V as VET_MESSAGES_COPY, J as VET_MESSAGE_CONTENT_MAX, K as VET_MESSAGE_PAGE_DEFAULT, L as VET_MESSAGE_PAGE_MAX, M as VetMessage, O as VetMessagePage, P as VetMessageRole, Q as VetMessagesAvailability, R as VetSendFailure, S as VetThread, W as VetThreadState, X as VetThreadsState, Y as VisitSummary, Z as VisitSummaryMedication, _ as VisitSummaryState, $ as attestation, a0 as canConfirm, a1 as canManageTelevetVisit, a2 as createTelevetBookingController, a3 as currentStep, a4 as emptyTelevetDraft, a5 as formatVisitRange, a6 as formatWhen, a7 as formatWhenWithDay, a8 as hasPreviousStep, a9 as initialTelevetBookingState, aa as isHoldExpired, ab as isMediaShortfallEmpty, ac as isSkipped, ad as isTelevetBookingCopyReady, ae as isVetMessagesDark, af as isVetThreadVetFirst, ag as mediaShortfallFromUnsentPicks, ah as splitTelevetVisits, ai as televetBookingKey, aj as televetBookingReducer, ak as televetBookingRefusal, al as televetCancelCall, am as televetConsultCall, an as televetEmptyRosterCause, ao as televetEmptyRosterView, ap as televetHoldCall, aq as televetJoinCall, ar as televetJoinOpensAtMs, as as televetJoinReadiness, at as televetMediaShortfallLines, au as televetRescheduleCall, av as televetThreadMessagesCall, aw as televetThreadReadCall, ax as televetVisitSummaryCall, ay as useEarlyTriage, az as useStateInterest, aA as useTelevetBookConsult, aB as useTelevetBookingAvailable, aC as useTelevetBookingController, aD as useTelevetBookingEntitlement, aE as useTelevetCancellationPolicy, aF as useTelevetClinicians, aG as useTelevetHoldSlot, aH as useTelevetJoin, aI as useTelevetNextSlot, aJ as useTelevetRescheduleConsult, aK as useTelevetSlots, aL as useTelevetStatePolicy, aM as useUpcomingTelevetVisit, aN as useVetThread, aO as useVetThreads, aP as useVisitSummary, aQ as validateBookingBody, aR as vetThreadPetRef, aS as withUnsentPicks } from '../../bookingCopy.d-0K1trjxx.cjs';
|
|
8
8
|
import { T as TelevetConsult, E as EverfurTelevetFlowRequest, b as TelevetCancelReceipt, c as TelevetSlot } from '../../televetGlobal.d-CKwDCbmN.cjs';
|
|
9
9
|
export { C as CANCELLATION_POLICY_VERSION_MAX, d as CANCEL_REASON_MAX, e as CONSULT_KINDS, f as CONSULT_STATUSES, g as ConsultKind, h as ConsultStatus, M as MEDIA_REFS_MAX, R as REASON_TEXT_MAX, i as TERMINAL_CONSULT_STATUSES, j as TelevetBookingBody, k as TelevetBookingEntitlement, l as TelevetCancellationPolicy, m as TelevetClinician, n as TelevetSlotHold, o as TelevetStatePolicy, p as TelevetTriageVerdict, q as isWellFormedStateCode } from '../../televetGlobal.d-CKwDCbmN.cjs';
|
|
10
10
|
import { V as VetVisitIntent } from '../../visitIntent.d-D7_yVp1I.cjs';
|
|
@@ -13,11 +13,11 @@ export { e as TelevetBookedScreen, f as TelevetBookedScreenProps, c as TelevetCa
|
|
|
13
13
|
export { b as VetCallCredential, c as VetCallJoinRefusal, d as VetCallLimits, p as parseVetCallCredential, v as vetCallJoinReason, e as vetCallJoinRefusal } from '../../callRoom.d-B1DoYdJe.cjs';
|
|
14
14
|
export { E as EverfurError, a as EverfurErrorCategory, b as EverfurErrorCode } from '../../EverfurError.d-8NHtlgzA.cjs';
|
|
15
15
|
export { E as EverfurResult } from '../../EverfurResult.d-BFH-3s6E.cjs';
|
|
16
|
-
export { W as WidgetPet } from '../../petsRepository.d-
|
|
17
|
-
import '../../requestFunnel.d-
|
|
16
|
+
export { W as WidgetPet } from '../../petsRepository.d-CyerzD5G.cjs';
|
|
17
|
+
import '../../requestFunnel.d-DocT7FXR.cjs';
|
|
18
18
|
import '../../ErrorPolicyPort.d-DirW9hgO.cjs';
|
|
19
|
-
import '../../config.d-
|
|
20
|
-
import '../../identity.d-
|
|
19
|
+
import '../../config.d-BFTqU7ft.cjs';
|
|
20
|
+
import '../../identity.d-BmbAwQYx.cjs';
|
|
21
21
|
import '../../TelemetryPort.d-BDNr00hu.cjs';
|
|
22
22
|
import '../../profile.d-CSs1wlXT.cjs';
|
|
23
23
|
|
|
@@ -3,8 +3,8 @@ import { ReactNode, ComponentType, ReactElement } from 'react';
|
|
|
3
3
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
4
4
|
import { P as PetRef } from '../../ids.d-B2GAAifq.js';
|
|
5
5
|
export { B as Brand, _ as __brand } from '../../ids.d-B2GAAifq.js';
|
|
6
|
-
import { T as TelevetEmptyRosterCause, a as TelevetStateInterestAction$1, b as TelevetMediaShortfall, c as TelevetBookingStep, d as TelevetBookingContext, e as TelevetBookingController, f as TelevetTriageRead, g as TelevetStateInterestWrite, h as TelevetVetThreadTarget, i as TelevetDayPeriod } from '../../bookingCopy.d-
|
|
7
|
-
export { C as CONSULT_MINUTES, N as NO_MEDIA_SHORTFALL, j as TELEVET_BOOKING_BASE, k as TELEVET_BOOKING_COPY, l as TELEVET_BOOKING_STEPS, m as TELEVET_CONSULT_PAGE_LIMIT, n as TELEVET_JOIN_CLOSES_MINUTES_AFTER, o as TELEVET_JOIN_OPENS_MINUTES_BEFORE, p as TELEVET_MESSAGE_THREADS_PATH, q as TelevetAttachmentMeta, r as TelevetAttachmentPolicy, s as TelevetBookingAction, t as TelevetBookingControllerDeps, u as TelevetBookingCopy, v as TelevetBookingDraft, w as TelevetBookingFailure, x as TelevetBookingRefusal, y as TelevetBookingState, z as TelevetEarlyTriage, A as TelevetEmptyRosterView, B as TelevetJoinReadiness, D as TelevetJoinState, E as TelevetMediaRefusal, F as TelevetRead, G as TelevetStateInterestReason, H as TelevetWrite, U as UpcomingTelevetVisitState, I as UseVetThreadOptions, V as VET_MESSAGES_COPY, J as VET_MESSAGE_CONTENT_MAX, K as VET_MESSAGE_PAGE_DEFAULT, L as VET_MESSAGE_PAGE_MAX, M as VetMessage, O as VetMessagePage, P as VetMessageRole, Q as VetMessagesAvailability, R as VetSendFailure, S as VetThread, W as VetThreadState, X as VetThreadsState, Y as VisitSummary, Z as VisitSummaryMedication, _ as VisitSummaryState, $ as attestation, a0 as canConfirm, a1 as canManageTelevetVisit, a2 as createTelevetBookingController, a3 as currentStep, a4 as emptyTelevetDraft, a5 as formatVisitRange, a6 as formatWhen, a7 as formatWhenWithDay, a8 as hasPreviousStep, a9 as initialTelevetBookingState, aa as isHoldExpired, ab as isMediaShortfallEmpty, ac as isSkipped, ad as isTelevetBookingCopyReady, ae as isVetMessagesDark, af as isVetThreadVetFirst, ag as mediaShortfallFromUnsentPicks, ah as splitTelevetVisits, ai as televetBookingKey, aj as televetBookingReducer, ak as televetBookingRefusal, al as televetCancelCall, am as televetConsultCall, an as televetEmptyRosterCause, ao as televetEmptyRosterView, ap as televetHoldCall, aq as televetJoinCall, ar as televetJoinOpensAtMs, as as televetJoinReadiness, at as televetMediaShortfallLines, au as televetRescheduleCall, av as televetThreadMessagesCall, aw as televetThreadReadCall, ax as televetVisitSummaryCall, ay as useEarlyTriage, az as useStateInterest, aA as useTelevetBookConsult, aB as useTelevetBookingAvailable, aC as useTelevetBookingController, aD as useTelevetBookingEntitlement, aE as useTelevetCancellationPolicy, aF as useTelevetClinicians, aG as useTelevetHoldSlot, aH as useTelevetJoin, aI as useTelevetNextSlot, aJ as useTelevetRescheduleConsult, aK as useTelevetSlots, aL as useTelevetStatePolicy, aM as useUpcomingTelevetVisit, aN as useVetThread, aO as useVetThreads, aP as useVisitSummary, aQ as validateBookingBody, aR as vetThreadPetRef, aS as withUnsentPicks } from '../../bookingCopy.d-
|
|
6
|
+
import { T as TelevetEmptyRosterCause, a as TelevetStateInterestAction$1, b as TelevetMediaShortfall, c as TelevetBookingStep, d as TelevetBookingContext, e as TelevetBookingController, f as TelevetTriageRead, g as TelevetStateInterestWrite, h as TelevetVetThreadTarget, i as TelevetDayPeriod } from '../../bookingCopy.d-RU8lNYJ4.js';
|
|
7
|
+
export { C as CONSULT_MINUTES, N as NO_MEDIA_SHORTFALL, j as TELEVET_BOOKING_BASE, k as TELEVET_BOOKING_COPY, l as TELEVET_BOOKING_STEPS, m as TELEVET_CONSULT_PAGE_LIMIT, n as TELEVET_JOIN_CLOSES_MINUTES_AFTER, o as TELEVET_JOIN_OPENS_MINUTES_BEFORE, p as TELEVET_MESSAGE_THREADS_PATH, q as TelevetAttachmentMeta, r as TelevetAttachmentPolicy, s as TelevetBookingAction, t as TelevetBookingControllerDeps, u as TelevetBookingCopy, v as TelevetBookingDraft, w as TelevetBookingFailure, x as TelevetBookingRefusal, y as TelevetBookingState, z as TelevetEarlyTriage, A as TelevetEmptyRosterView, B as TelevetJoinReadiness, D as TelevetJoinState, E as TelevetMediaRefusal, F as TelevetRead, G as TelevetStateInterestReason, H as TelevetWrite, U as UpcomingTelevetVisitState, I as UseVetThreadOptions, V as VET_MESSAGES_COPY, J as VET_MESSAGE_CONTENT_MAX, K as VET_MESSAGE_PAGE_DEFAULT, L as VET_MESSAGE_PAGE_MAX, M as VetMessage, O as VetMessagePage, P as VetMessageRole, Q as VetMessagesAvailability, R as VetSendFailure, S as VetThread, W as VetThreadState, X as VetThreadsState, Y as VisitSummary, Z as VisitSummaryMedication, _ as VisitSummaryState, $ as attestation, a0 as canConfirm, a1 as canManageTelevetVisit, a2 as createTelevetBookingController, a3 as currentStep, a4 as emptyTelevetDraft, a5 as formatVisitRange, a6 as formatWhen, a7 as formatWhenWithDay, a8 as hasPreviousStep, a9 as initialTelevetBookingState, aa as isHoldExpired, ab as isMediaShortfallEmpty, ac as isSkipped, ad as isTelevetBookingCopyReady, ae as isVetMessagesDark, af as isVetThreadVetFirst, ag as mediaShortfallFromUnsentPicks, ah as splitTelevetVisits, ai as televetBookingKey, aj as televetBookingReducer, ak as televetBookingRefusal, al as televetCancelCall, am as televetConsultCall, an as televetEmptyRosterCause, ao as televetEmptyRosterView, ap as televetHoldCall, aq as televetJoinCall, ar as televetJoinOpensAtMs, as as televetJoinReadiness, at as televetMediaShortfallLines, au as televetRescheduleCall, av as televetThreadMessagesCall, aw as televetThreadReadCall, ax as televetVisitSummaryCall, ay as useEarlyTriage, az as useStateInterest, aA as useTelevetBookConsult, aB as useTelevetBookingAvailable, aC as useTelevetBookingController, aD as useTelevetBookingEntitlement, aE as useTelevetCancellationPolicy, aF as useTelevetClinicians, aG as useTelevetHoldSlot, aH as useTelevetJoin, aI as useTelevetNextSlot, aJ as useTelevetRescheduleConsult, aK as useTelevetSlots, aL as useTelevetStatePolicy, aM as useUpcomingTelevetVisit, aN as useVetThread, aO as useVetThreads, aP as useVisitSummary, aQ as validateBookingBody, aR as vetThreadPetRef, aS as withUnsentPicks } from '../../bookingCopy.d-RU8lNYJ4.js';
|
|
8
8
|
import { T as TelevetConsult, E as EverfurTelevetFlowRequest, b as TelevetCancelReceipt, c as TelevetSlot } from '../../televetGlobal.d-CC-DrqkQ.js';
|
|
9
9
|
export { C as CANCELLATION_POLICY_VERSION_MAX, d as CANCEL_REASON_MAX, e as CONSULT_KINDS, f as CONSULT_STATUSES, g as ConsultKind, h as ConsultStatus, M as MEDIA_REFS_MAX, R as REASON_TEXT_MAX, i as TERMINAL_CONSULT_STATUSES, j as TelevetBookingBody, k as TelevetBookingEntitlement, l as TelevetCancellationPolicy, m as TelevetClinician, n as TelevetSlotHold, o as TelevetStatePolicy, p as TelevetTriageVerdict, q as isWellFormedStateCode } from '../../televetGlobal.d-CC-DrqkQ.js';
|
|
10
10
|
import { V as VetVisitIntent } from '../../visitIntent.d-D7_yVp1I.js';
|
|
@@ -13,11 +13,11 @@ export { e as TelevetBookedScreen, f as TelevetBookedScreenProps, c as TelevetCa
|
|
|
13
13
|
export { b as VetCallCredential, c as VetCallJoinRefusal, d as VetCallLimits, p as parseVetCallCredential, v as vetCallJoinReason, e as vetCallJoinRefusal } from '../../callRoom.d-Dqm1rUqT.js';
|
|
14
14
|
export { E as EverfurError, a as EverfurErrorCategory, b as EverfurErrorCode } from '../../EverfurError.d-8NHtlgzA.js';
|
|
15
15
|
export { E as EverfurResult } from '../../EverfurResult.d-D_-254ZY.js';
|
|
16
|
-
export { W as WidgetPet } from '../../petsRepository.d-
|
|
17
|
-
import '../../requestFunnel.d-
|
|
16
|
+
export { W as WidgetPet } from '../../petsRepository.d-CLyzuoo4.js';
|
|
17
|
+
import '../../requestFunnel.d-BPWf5SQf.js';
|
|
18
18
|
import '../../ErrorPolicyPort.d-68yrE3BE.js';
|
|
19
|
-
import '../../config.d-
|
|
20
|
-
import '../../identity.d-
|
|
19
|
+
import '../../config.d-D_k_rNZZ.js';
|
|
20
|
+
import '../../identity.d-BZXPu9Hi.js';
|
|
21
21
|
import '../../TelemetryPort.d-BDNr00hu.js';
|
|
22
22
|
import '../../profile.d-CSs1wlXT.js';
|
|
23
23
|
|
package/dist/testing/index.cjs
CHANGED
|
@@ -102,4 +102,4 @@ return Object.freeze({kind:"done",terminal:true,conversationId:fields.conversati
|
|
|
102
102
|
return Object.freeze({kind:"error",terminal:true,code:fields.code,retryable:fields.retryable,wireMessage:fields.wireMessage,synthesized:fields.synthesized,lastEventId:fields.lastEventId,serverRequestId:fields.serverRequestId??null})}function analysisStartedFrame(requestId,lastEventId,serverRequestId=null){/* @__PURE__ */
|
|
103
103
|
return Object.freeze({kind:"analysisStarted",requestId:requestId,lastEventId:lastEventId,serverRequestId:serverRequestId,terminal:false})}function analysisCompleteFrame(fields,serverRequestId=null){/* @__PURE__ */
|
|
104
104
|
return Object.freeze({kind:"analysisComplete",terminal:false,resultId:fields.resultId,analysisType:fields.analysisType,modelVersion:fields.modelVersion,confidence:fields.confidence,detections:/* @__PURE__ */Object.freeze([...fields.detections]),interpretation:fields.interpretation,lastEventId:fields.lastEventId,serverRequestId:serverRequestId})}function unknownFrame(raw,lastEventId,serverRequestId=null){/* @__PURE__ */
|
|
105
|
-
return Object.freeze({kind:"unknown",raw:{...raw},lastEventId:lastEventId,serverRequestId:serverRequestId,terminal:false})}var BLOCK_SEPARATOR=`\n\n`,MAX_PENDING_BLOCK_CHARS=1048576,wireObjectSchema=/* @__PURE__ */zod.z.record(/* @__PURE__ */zod.z.string(),/* @__PURE__ */zod.z.unknown()),URGENCY_LEVELS=["emergency","schedule_soon","home_care"];async function*parseSse(bytes,serverRequestId=null){let resolvedRequestId=null,requestIdNow=()=>(resolvedRequestId!==null||(resolvedRequestId=typeof serverRequestId=="function"?serverRequestId():serverRequestId),resolvedRequestId),decoder=new TextDecoder("utf-8"),buffer="",scanFrom=0,sawDelta=false;for await(let chunk of bytes){for(buffer+=decoder.decode(chunk,{stream:true});;){let sep=buffer.indexOf(BLOCK_SEPARATOR,scanFrom);if(sep===-1)break;let block=buffer.slice(0,sep);buffer=buffer.slice(sep+BLOCK_SEPARATOR.length),scanFrom=0;let frame=parseBlock(block,requestIdNow());if(frame!==null&&(frame.kind==="delta"&&(sawDelta=true),yield frame,frame.terminal))return}if(scanFrom=buffer.length>0?buffer.length-1:0,buffer.length>MAX_PENDING_BLOCK_CHARS){yield errorFrame({code:sawDelta?"CHAT_STREAM_INCOMPLETE":"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:requestIdNow()});return}}if(buffer+=decoder.decode(),buffer.trim().length>0){let frame=parseBlock(buffer,requestIdNow());if(frame!==null&&(frame.kind==="delta"&&(sawDelta=true),yield frame,frame.terminal))return}yield errorFrame({code:sawDelta?"CHAT_STREAM_INCOMPLETE":"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:requestIdNow()})}function parseBlock(block,serverRequestId){let id=null,dataLines=[];for(let rawLine of block.split(`\n`)){let line=rawLine.replace(/\s+$/,"");line.length===0||line.startsWith(":")||(line.startsWith("id:")?id=line.slice(3).trim():line.startsWith("data:")&&dataLines.push(line.slice(5).replace(/^ /,"")))}if(dataLines.length===0)return null;let decoded;try{decoded=JSON.parse(dataLines.join(`\n`))}catch{return null}if(typeof decoded!="object"||decoded===null||Array.isArray(decoded))return null;let parsed=wireObjectSchema.safeParse(decoded);return parsed.success?frameFromWire(parsed.data,id,serverRequestId):null}function frameFromWire(json,lastEventId,serverRequestId){let type=json.type,event=json.event;if(type==="error"||"error"in json)return errorFrame({code:asString(json.code)??"unknown",retryable:json.retryable===true,wireMessage:asString(json.error),synthesized:false,lastEventId:lastEventId,serverRequestId:serverRequestId});if(type==="done"||json.done===true)return doneFrame({conversationId:asString(json.conversation_id)??"",messageId:asString(json.message_id),title:asString(json.title),followUpQuestions:asStringList(json.follow_up_questions),citations:asMapList(json.citations),citationStatus:asString(json.citation_status),urgencyLevel:asUrgency(json.urgency_level),urgencyReason:asString(json.urgency_reason),urgencyProvided:urgencySlotProvided(json),resultId:asString(json.result_id),lastEventId:lastEventId},serverRequestId);if(type==="accepted"||json.status==="reasoning")return acceptedFrame(asString(json.stream_id),lastEventId,serverRequestId);if(type==="heartbeat"||json.heartbeat===true)return heartbeatFrame(lastEventId,serverRequestId);if(type==="text.delta"||"delta"in json||"token"in json){let delta=asString(json.delta)??asString(json.token)??"";return deltaFrame(delta,lastEventId,serverRequestId)}return event==="analysis_started"?analysisStartedFrame(asString(json.request_id),lastEventId,serverRequestId):event==="analysis_complete"?analysisCompleteFrame({resultId:asString(json.result_id),analysisType:asString(json.analysis_type),modelVersion:asString(json.model_version),confidence:asNumber(json.confidence),detections:asMapList(json.detections),interpretation:asString(json.interpretation),lastEventId:lastEventId},serverRequestId):unknownFrame(json,lastEventId,serverRequestId)}function asString(v){return typeof v=="string"?v:null}function asNumber(v){return typeof v=="number"&&Number.isFinite(v)?v:null}function asUrgency(v){return typeof v=="string"&&URGENCY_LEVELS.includes(v)?v:null}function urgencySlotProvided(json){if(!Object.prototype.hasOwnProperty.call(json,"urgency_level"))return false;let raw=json.urgency_level;return raw===null||asUrgency(raw)!==null}function asStringList(v){return Array.isArray(v)?v.map(e=>typeof e=="string"?e:String(e)):[]}function isPlainObject(v){return typeof v=="object"&&v!==null&&!Array.isArray(v)}function asMapList(v){return Array.isArray(v)?v.filter(isPlainObject):[]}var DAILY_QUOTA_WIRE_CODE="DAILY_QUOTA_EXCEEDED",THROTTLES=/* @__PURE__ */new Set(["THROTTLINGEXCEPTION","RATELIMITED","TOOMANYREQUESTS"]);function foldDailyQuotaWireCode(code,body){if(!THROTTLES.has(code.toUpperCase().replace(/[^A-Z0-9]/g,"")))return code;let b=body,limit=b?.daily_limit??b?.error?.daily_limit;return typeof limit=="number"&&Number.isFinite(limit)?DAILY_QUOTA_WIRE_CODE:code}var ACCESS_DENIED_COPY="This feature isn't available on your account right now.",VALIDATION_FAILED_COPY="Something in that request was not right. Check the details and try again.",USER_FACING_COPY=/* @__PURE__ */Object.freeze({authExpired:"Please sign in again to continue.",authRejected:"Please sign in again to continue.",sessionRequired:"This app needs to be updated to keep using Everfur.",accessDenied:ACCESS_DENIED_COPY,paymentRequired:"This is part of a paid plan.",quotaExceeded:"You have used today's messages. This resets tomorrow.",rateLimited:"You are sending messages quickly. Try again in a few seconds.",validationFailed:VALIDATION_FAILED_COPY,sdkUpdateRequired:"This app needs to be updated to keep using Everfur.",conflict:"That is already running. Wait for it to finish, then try again.",idempotencyConflict:"That message was already delivered.",idempotencyInFlight:"That is still processing. Give it a moment.",conversationNotFound:"This conversation is no longer available.",petNotFound:"We could not find that pet. Please pick a pet and try again.",resourceNotFound:"We could not find that.",streamTimeout:"The response timed out. Tap retry to try again.",mediaUploadFailed:"We could not upload that photo. Please attach it again.",moderationBlocked:"This request cannot be answered here.",upstreamLlmTimeout:"The response timed out. Tap retry to try again.",internalError:"We hit a snag on our end. Please try again.",notImplemented:"That is not available yet.",serviceUnavailable:"That service is briefly unavailable. Try again shortly.",streamIncomplete:"The connection dropped mid-answer. Tap retry to continue.",identitySignatureRequired:ACCESS_DENIED_COPY,runtimeDisposed:VALIDATION_FAILED_COPY,unknown:"Something went wrong. Please try again."}),SESSION_REVOKED_COPY="This session has ended. Please sign in again.",LINKED_ACCOUNT_READ_ONLY="linked_account_read_only";function displayFor(code,wireCode,reasonCode){return code==="conflict"&&reasonCode===LINKED_ACCOUNT_READ_ONLY?ACCESS_DENIED_COPY:(code==="authRejected"||code==="authExpired")&&typeof wireCode=="string"&&wireCode.trim().toLowerCase()==="session_revoked"?SESSION_REVOKED_COPY:userFacingError(code)}function userFacingError(code){return USER_FACING_COPY[code]}function defineHidden(target,key,value){Object.defineProperty(target,key,{value:value,enumerable:false,writable:false,configurable:false})}var REASON_CODE_SHAPE=/^[a-z][a-z0-9_]{0,63}$/;function makeEverfurError(code,opts){let row=contractErrorFor(opts?.wireCode,opts?.wireEnvelope),linkedReadOnly=code==="conflict"&&opts?.reasonCode===LINKED_ACCOUNT_READ_ONLY,error={code:code,category:categoryFor(code),retryable:opts?.retryable??(linkedReadOnly?false:isRetryableCode(code)),displayMessage:displayFor(code,opts?.wireCode,linkedReadOnly?LINKED_ACCOUNT_READ_ONLY:null)};opts?.httpStatus!==void 0&&(error.httpStatus=opts.httpStatus),opts?.requestId&&(error.requestId=opts.requestId),typeof opts?.reasonCode=="string"&&REASON_CODE_SHAPE.test(opts.reasonCode)&&(error.reasonCode=opts.reasonCode);let wait=opts?.retryAfterSeconds;if(typeof wait=="number"&&Number.isFinite(wait)&&wait>=0&&(error.retryAfterSeconds=Math.round(wait)),row);return opts?.wireMessage&&defineHidden(error,"wireMessage",opts.wireMessage),opts?.raw!==void 0&&opts.raw!==null&&defineHidden(error,"raw",opts.raw),/* @__PURE__ */Object.freeze(error)}async function*bufferedTextByteSource(text,splitAt=[]){let bytes=(new TextEncoder).encode(text),points=[...new Set(splitAt)].filter(n=>n>0&&n<bytes.length).sort((a,b)=>a-b),start=0;for(let point of points)yield bytes.subarray(start,point),start=point;yield bytes.subarray(start)}function errorFromResponse(status,body,requestId){let wireCode=extractWireCode(body),code=wireCode?fromWire(wireCode):fromHttpStatus(status),wireMessage=extractWireMessage(body);return makeEverfurError(code,{httpStatus:status,...extractRetryable(body)?{retryable:true}:{},...{},...wireCode?{wireCode:wireCode}:{},...extractReasonCode(body)?{reasonCode:extractReasonCode(body)}:{},...extractRetryAfterSeconds(body)!==null?{retryAfterSeconds:extractRetryAfterSeconds(body)}:{},...wireMessage?{wireMessage:wireMessage}:{},...body!=null?{raw:body}:{}})}function extractRetryAfterSeconds(body){let b=body,value=b?.retry_after_seconds??b?.error?.retry_after_seconds;return typeof value=="number"&&Number.isFinite(value)&&value>=0?value:null}function extractReasonCode(body){let b=body,reason=b?.error?.reason_code??b?.reason_code;return typeof reason=="string"&&reason.length>0?reason:null}function extractWireCode(body){let b=body,code=b?.error?.code??b?.code;return typeof code=="string"&&code.length>0?foldDailyQuotaWireCode(code,body):null}function extractWireMessage(body){let b=body,message=b?.error?.message??b?.message;return typeof message=="string"&&message.length>0?message:null}function extractRetryable(body){let b=body;return b?.error?.retryable===true||b?.retryable===true}var wire=/* @__PURE__ */Object.freeze({accepted:streamId=>JSON.stringify(streamId?{type:"accepted",stream_id:streamId}:{type:"accepted"}),heartbeat:()=>JSON.stringify({type:"heartbeat"}),delta:text=>JSON.stringify({type:"text.delta",delta:text}),done:fields=>JSON.stringify({type:"done",...fields??{}}),error:(code,retryable=false)=>JSON.stringify({type:"error",code:code,retryable:retryable})}),bodies=/* @__PURE__ */Object.freeze({pets:rows=>({pets:rows.map(row=>({pet_id:"a0000000-0000-4000-8000-000000000001",pet_ref:"pet-A",name:"Rex",species:"dog",breed:"Labrador",age_years:3,weight_kg:20,updated_at:"2026-09-18T10:00:00Z",...row}))}),uploadInitiate:overrides=>({upload_id:"b0000000-0000-4000-8000-000000000001",upload_url:"https://uploads.example.test/bucket",upload_fields:{key:"uploads/user-A/chat/photo.jpg","Content-Type":"image/jpeg",policy:"p",signature:"s"},s3_key:"uploads/user-A/chat/photo.jpg",expires_in_seconds:900,purpose:"chat_attachment",max_content_length:10485760,...overrides??{}}),feedback:overrides=>({feedback_id:"c0000000-0000-4000-8000-000000000001",feedback_type:"helpful",updated_at:"2026-09-18T10:00:00Z",...overrides??{}})});function assertRouteIsServed(method,path){let verdict=classifyRoute(method,path);if(verdict!=="known")throw verdict==="absent"?new EverfurConfigError("invalid-argument",`MockTransport: ${method} ${path} is a route the Everfur backend does NOT serve, so this call returns 404 in production. Scripting a success for it makes a green test that hides a broken integration. Known-absent routes: ${KNOWN_ABSENT_ROUTES.join(", ")}. Pass { strictPaths: false } to MockTransport only if you are deliberately testing this shape.`):new EverfurConfigError("invalid-argument",`MockTransport: ${method} ${path} is not a known partner-plane route. If the backend has gained it, add it to KNOWN_PARTNER_ROUTES in src/core/testing/knownRoutes.ts. Pass { strictPaths: false } to opt out for this transport.`)}var MockTransport=class{constructor(options={}){this.streamQueue=[];this.requestQueue=[];this.lastRequestScript=/* @__PURE__ */new Map;this.openCount=0;this.requests=[];this.streamRequests=[];this.peak=0;this.strictPaths=options.strictPaths??true}get openStreams(){return this.openCount}get peakOpenStreams(){return this.peak}enqueueStream(...scripts){return this.streamQueue.push(...scripts),this}enqueueRequest(...scripts){return this.requestQueue.push(...scripts),this}async request(req){this.strictPaths&&assertRouteIsServed(req.method,req.path);let base={method:req.method,path:req.path,headers:{...req.headers??{}},...req.query===void 0?{}:{query:{...req.query}}},record=req.body===void 0?base:{...base,body:req.body};this.requests.push(record);let endpoint=`${req.method} ${req.path}`,next=this.requestQueue.shift();next!==void 0&&this.lastRequestScript.set(endpoint,next);let script=next??this.lastRequestScript.get(endpoint)??{status:200,body:{}},status=script.status??200;return status===304||status>=400?err(errorFromResponse(status,script.body??null)):ok(script.body??{})}stream(req,signal){this.strictPaths&&assertRouteIsServed(req.method,req.path),this.streamRequests.push({path:req.path,authorization:header(req,"authorization"),partnerKey:header(req,"x-everfur-partner-key"),idempotencyKey:header(req,"idempotency-key"),...req.body===void 0?{}:{body:req.body},headers:{...req.headers??{}}});let script=this.streamQueue.shift()??{kind:"sse",blocks:[wire.done()]};return this.openStream(script,signal)}async*openStream(script,signal){this.openCount+=1,this.openCount>this.peak&&(this.peak=this.openCount);try{yield*this.runScript(script,signal)}finally{this.openCount-=1}}async*runScript(script,signal){switch(script.kind){case"httpError":{let wireCode=extractWireCode2(script.body)??statusToWireCode(script.status);yield errorFrame({code:wireCode,retryable:extractRetryable2(script.body)||isAutoRetryable(fromWire(wireCode)),wireMessage:extractWireMessage2(script.body),synthesized:true,lastEventId:null});return}case"network":yield errorFrame({code:"INTERNAL_ERROR",retryable:true,wireMessage:"network request failed",synthesized:true,lastEventId:null});return;case"partialByte":yield*parseSse(bufferedTextByteSource(script.body,script.splitAt));return;case"sse":yield*parseSse(sseByteSource(script.blocks,script.gapMs??0,signal));return;case"drop":yield*parseSse(sseByteSource(script.blocks,0,signal));return;case"stall":yield*parseSse(stallByteSource(script.preface??[],signal));return;default:return assertNever(script)}}};async function*sseByteSource(blocks,gapMs,signal){let enc=new TextEncoder,first=true;for(let block of blocks){if(signal.aborted||!first&&gapMs>0&&await abortableSleep(gapMs,signal)==="abort")return;first=false,yield enc.encode(toSseBlock(block))}}async function*stallByteSource(preface,signal){let enc=new TextEncoder;for(let block of preface){if(signal.aborted)return;yield enc.encode(toSseBlock(block))}await abortableSleep(1/0,signal)}function toSseBlock(payload){return`data: ${payload}\n\n`}function abortableSleep(ms,signal){return new Promise(resolve=>{if(signal.aborted){resolve("abort");return}let handle=null,onAbort=()=>{handle!==null&&clearTimeout(handle),signal.removeEventListener("abort",onAbort),resolve("abort")};Number.isFinite(ms)&&(handle=setTimeout(()=>{signal.removeEventListener("abort",onAbort),resolve("timeout")},ms)),signal.addEventListener("abort",onAbort,{once:true})})}function header(req,name){let headers=req.headers;if(!headers)return null;for(let[key,value]of Object.entries(headers))if(key.toLowerCase()===name)return value;return null}function extractWireCode2(body){let b=body,code=b?.error?.code??b?.code;return typeof code=="string"&&code.length>0?foldDailyQuotaWireCode(code,body):null}function extractWireMessage2(body){let b=body,message=b?.error?.message??b?.message;return typeof message=="string"&&message.length>0?message:null}function extractRetryable2(body){let b=body;return b?.error?.retryable===true||b?.retryable===true}function statusToWireCode(status){return status===401?"AUTH_EXPIRED":status===403?"ACCESS_DENIED":status===404?"NOT_FOUND":status===409?"IDEMPOTENCY_CONFLICT":status===421?"MISDIRECTED_REQUEST":status===429?"RATE_LIMITED":status===400||status===422?"INVALID_REQUEST":status>=500?"INTERNAL_ERROR":""}var CARE_MOCK_TODAY="2026-09-23",CARE_MOCK_IMG="https://care-v3-mock.everfur.invalid/img/",careMockImg=file=>`${CARE_MOCK_IMG}${file}`,CARE_MOCK_PET_RECORDS="pet-care-v3-records",CARE_MOCK_PET_NO_RECORDS="pet-care-v3-no-records",CARE_MOCK_OFFER={apoquel:"offer-apoquel",simparicaTrio:"offer-simparica-trio",salmonOil:"offer-salmon-oil",vetradent:"offer-vetradent",earWipes:"offer-ear-wipes",douxoCalm:"offer-douxo-calm",veggiedent:"offer-veggiedent",dasuquin:"offer-dasuquin",fortiflora:"offer-fortiflora",greenies:"offer-greenies",trickyTreats:"offer-tricky-treats"},careMockSlugOf=offerId=>offerId.replace(/^offer-/,""),CARE_MOCK_PRICES={[CARE_MOCK_OFFER.apoquel]:{priceCents:6499,autoPriceCents:6499,isRx:true},[CARE_MOCK_OFFER.simparicaTrio]:{priceCents:3199,autoPriceCents:null,isRx:true},[CARE_MOCK_OFFER.salmonOil]:{priceCents:3299,autoPriceCents:2969,isRx:false},[CARE_MOCK_OFFER.dasuquin]:{priceCents:2799,autoPriceCents:2519,isRx:false},[CARE_MOCK_OFFER.fortiflora]:{priceCents:2499,autoPriceCents:2249,isRx:false},[CARE_MOCK_OFFER.vetradent]:{priceCents:2199,autoPriceCents:1979,isRx:false},[CARE_MOCK_OFFER.veggiedent]:{priceCents:999,autoPriceCents:899,isRx:false},[CARE_MOCK_OFFER.greenies]:{priceCents:3999,autoPriceCents:null,isRx:false},[CARE_MOCK_OFFER.trickyTreats]:{priceCents:1100,autoPriceCents:null,isRx:false},[CARE_MOCK_OFFER.earWipes]:{priceCents:1499,autoPriceCents:null,isRx:false},[CARE_MOCK_OFFER.douxoCalm]:{priceCents:1299,autoPriceCents:null,isRx:false}},shot=slug=>careMockImg(`care-${slug}.webp`),cutout=slug=>careMockImg(`care-${slug}-mask.webp`),CARE_MOCK_ADDRESS={ref:"addr-home",label:"Home",isDefault:true,isComplete:true,address:{recipientName:null,line1:"1432 Irving St",line2:null,city:"San Francisco",region:"CA",postalCode:"94122",country:"US"}},CARE_MOCK_CARD={paymentMethodId:"pm-care-v3-mock-visa",brand:"visa",last4:"4242",wallet:null},CARE_MOCK_SHOP_CONFIG={recurringTermsVersion:"care-v3-mock",recurringTermsUrl:"https://care-v3-mock.everfur.invalid/recurring-terms",stripePublishableKey:null,delivery:null,freeShippingThresholdCents:3500,firstRxDiscountCents:5e3,firstRxDiscountCode:"VET50",firstAutoOrderPrice:null},CARE_MOCK_PACKS={[CARE_MOCK_OFFER.apoquel]:{packQuantity:"30.0",packUnit:"each"}},CARE_MOCK_PRESCRIPTIONS=[{rxId:"rx-apoquel",petId:CARE_MOCK_PET_RECORDS,drug:"Apoquel",strength:"16 mg",form:"tablet",status:"ready",offerId:CARE_MOCK_OFFER.apoquel,packCount:1,fillsUsed:null,fillsTotal:null,expiresOn:null,nextFillOn:null,supply:{unitsLeft:8,unitLabel:"tablets",dailyUnits:1,runsOutOn:"2026-10-01",refillArrivesOn:"2026-09-29"},prescriberName:"Dr. Goode",refillsTotal:null,refillsLeft:2},{rxId:"rx-simparica-trio",petId:CARE_MOCK_PET_RECORDS,drug:"Simparica Trio",strength:"44.1 to 88 lb",form:"chew",status:"ready",offerId:CARE_MOCK_OFFER.simparicaTrio,packCount:1,fillsUsed:null,fillsTotal:null,expiresOn:null,nextFillOn:"2026-10-05",supply:null,prescriberName:"Dr. Goode",refillsTotal:null,refillsLeft:8}],step=(key,doneAt)=>({key:key,doneAt:doneAt}),CARE_MOCK_ORDER_BOX_ID="order-care-v3-box-0923",CARE_MOCK_ORDER_RX_ID="order-care-v3-rx-0923",CARE_MOCK_ORDER_PAST_AUG="order-care-v3-box-0815",CARE_MOCK_ORDER_PAST_JUL="order-care-v3-box-0718",PLACED="2026-09-23T16:00:00Z",CARE_MOCK_ORDERS=[{orderId:CARE_MOCK_ORDER_BOX_ID,referenceNumber:"EF-260923-4471",status:"accepted",total:3824,placedAt:PLACED,itemCount:1,items:[{offerId:CARE_MOCK_OFFER.salmonOil,title:"Zesty Paws Salmon Oil",quantity:1,imageUrl:shot("salmon-oil"),cutoutUrl:cutout("salmon-oil")}],fulfiller:"everfur_box",arrivesBy:"2026-09-26",steps:[step("ordered_paid",PLACED),step("packing",null),step("delivered",null)],currentStep:"packing",statusLineKey:"ships_tomorrow",prescriberName:null},{orderId:CARE_MOCK_ORDER_RX_ID,referenceNumber:"EF-260923-4471",status:"pending_handoff",total:1499,placedAt:PLACED,itemCount:1,items:[{offerId:CARE_MOCK_OFFER.apoquel,title:"Apoquel 16 mg",quantity:1,imageUrl:shot("apoquel"),cutoutUrl:cutout("apoquel")}],fulfiller:"pharmacy",arrivesBy:"2026-09-29",steps:[step("ordered",PLACED),step("vet_ok",null),step("filled_checked",null),step("delivered",null)],currentStep:"vet_ok",statusLineKey:"needs_vet_ok",prescriberName:"Dr. Goode",clinicName:"Maplewood"},{orderId:CARE_MOCK_ORDER_PAST_AUG,referenceNumber:null,status:"delivered",total:5428,placedAt:"2026-08-12T16:00:00Z",itemCount:3,items:[{offerId:CARE_MOCK_OFFER.vetradent,title:"Vetradent dental chews",quantity:1,imageUrl:shot("vetradent")},{offerId:CARE_MOCK_OFFER.earWipes,title:"Zymox Ear Wipes",quantity:1,imageUrl:shot("ear-wipes")},{offerId:CARE_MOCK_OFFER.douxoCalm,title:"Douxo S3 Calm shampoo",quantity:1,imageUrl:shot("douxo-calm")}],fulfiller:"everfur_box",arrivesBy:"2026-08-15",steps:[step("ordered_paid","2026-08-12T16:00:00Z"),step("packing","2026-08-13T16:00:00Z"),step("delivered","2026-08-15T18:00:00Z")],currentStep:"delivered",statusLineKey:"delivered",prescriberName:null},{orderId:CARE_MOCK_ORDER_PAST_JUL,referenceNumber:null,status:"delivered",total:5755,placedAt:"2026-07-15T16:00:00Z",itemCount:2,items:[{offerId:CARE_MOCK_OFFER.dasuquin,title:"Dasuquin with MSM",quantity:1,imageUrl:shot("dasuquin")},{offerId:CARE_MOCK_OFFER.fortiflora,title:"FortiFlora probiotic",quantity:1,imageUrl:shot("fortiflora")}],fulfiller:"everfur_box",arrivesBy:"2026-07-18",steps:[step("ordered_paid","2026-07-15T16:00:00Z"),step("packing","2026-07-16T16:00:00Z"),step("delivered","2026-07-18T18:00:00Z")],currentStep:"delivered",statusLineKey:"delivered",prescriberName:null}],ORDER_LINES={[CARE_MOCK_ORDER_BOX_ID]:[[CARE_MOCK_OFFER.salmonOil,2969,256,false]],[CARE_MOCK_ORDER_RX_ID]:[[CARE_MOCK_OFFER.apoquel,6499,0,true]],[CARE_MOCK_ORDER_PAST_AUG]:[[CARE_MOCK_OFFER.vetradent,2199,190,false],[CARE_MOCK_OFFER.earWipes,1499,129,false],[CARE_MOCK_OFFER.douxoCalm,1299,112,false]],[CARE_MOCK_ORDER_PAST_JUL]:[[CARE_MOCK_OFFER.dasuquin,2799,241,false],[CARE_MOCK_OFFER.fortiflora,2499,216,false]]};function careMockOrderDetail(summary){let lines=(ORDER_LINES[summary.orderId]??[]).map(([offerId,unitPrice,tax2,rx],i)=>{let item=summary.items?.find(it=>it.offerId===offerId);return{lineId:`${summary.orderId}-l${i+1}`,offerId:offerId,sku:offerId,title:item?.title??offerId,requiresRx:rx,compounded:false,packQuantity:CARE_MOCK_PACKS[offerId]?.packQuantity??null,packUnit:CARE_MOCK_PACKS[offerId]?.packUnit??null,quantity:1,unitPrice:unitPrice,discount:rx?5e3:0,tax:tax2,fulfillmentType:rx?"pharmacy":"everfur_box",petId:CARE_MOCK_PET_RECORDS,imageUrl:item?.imageUrl??null}}),subtotal=lines.reduce((s,l)=>s+l.unitPrice*l.quantity,0),discount=lines.reduce((s,l)=>s+l.discount,0),tax=lines.reduce((s,l)=>s+l.tax,0),delivered=summary.status==="delivered";return{summary:summary,lines:lines,shipping:summary.orderId===CARE_MOCK_ORDER_BOX_ID?599:0,shippingTax:0,shipments:[],canCancel:!delivered,canReturn:false,canPay:false,paymentStatus:delivered||summary.status==="shipped"?"captured":"authorized",refunds:[],returnIds:[],subtotal:subtotal,discount:discount,tax:tax,arrivesBy:summary.arrivesBy??null,tracking:null,steps:(summary.steps??[]).map(s=>({key:s.key,done:s.doneAt!=null,at:s.doneAt})),paymentMethodId:CARE_MOCK_CARD.paymentMethodId}}var CARE_MOCK_PLANS=[{planId:"plan-care-v3-simparica",lines:[{offerId:CARE_MOCK_OFFER.simparicaTrio,quantity:1,petId:CARE_MOCK_PET_RECORDS}],cadenceDays:30,destination:CARE_MOCK_ADDRESS.ref,paymentMethodId:CARE_MOCK_CARD.paymentMethodId,discountBps:0,nextRun:"2026-10-05",state:"active",stopReason:null,priceCentsPerCycle:3199,chargedWhenFilled:true,nextShipOn:"2026-10-05",skippedCycleOn:null,prescriberName:"Dr. Goode",refillsLeft:8,refillsTotal:null,autoDiscountPct:null,changeOptions:[changeOption(CARE_MOCK_OFFER.simparicaTrio,"Simparica Trio","1 chew",1,3199,[30],true),changeOption(CARE_MOCK_OFFER.simparicaTrio,"Simparica Trio","3 chews",3,9597,[90],false)]},{planId:"plan-care-v3-apoquel",lines:[{offerId:CARE_MOCK_OFFER.apoquel,quantity:1,petId:CARE_MOCK_PET_RECORDS}],cadenceDays:30,destination:CARE_MOCK_ADDRESS.ref,paymentMethodId:CARE_MOCK_CARD.paymentMethodId,discountBps:0,nextRun:"2026-10-27",state:"active",stopReason:null,priceCentsPerCycle:6499,chargedWhenFilled:true,nextShipOn:"2026-10-27",skippedCycleOn:null,prescriberName:"Dr. Goode",refillsLeft:2,refillsTotal:null,autoDiscountPct:null,changeOptions:[changeOption(CARE_MOCK_OFFER.apoquel,"Apoquel 16 mg","30 tablets",1,6499,[30],true),changeOption(CARE_MOCK_OFFER.apoquel,"Apoquel 16 mg","60 tablets",2,12998,[60],false)]},{planId:"plan-care-v3-salmon-oil",lines:[{offerId:CARE_MOCK_OFFER.salmonOil,quantity:1,petId:CARE_MOCK_PET_RECORDS}],cadenceDays:120,destination:CARE_MOCK_ADDRESS.ref,paymentMethodId:CARE_MOCK_CARD.paymentMethodId,discountBps:1e3,nextRun:"2027-01-21",state:"active",stopReason:null,priceCentsPerCycle:2969,chargedWhenFilled:false,nextShipOn:"2027-01-21",skippedCycleOn:null,prescriberName:null,refillsLeft:null,refillsTotal:null,autoDiscountPct:10,changeOptions:[changeOption(CARE_MOCK_OFFER.salmonOil,"Zesty Paws Salmon Oil","32 fl oz",1,2969,[60,90,120,180],true)]}],CARE_MOCK_PLAN_SKIP_WARNINGS={"plan-care-v3-simparica":{key:"last_dose",values:{unitLabel:"chew",doseOn:"2026-10-01",noneFor:"2026-11-01",lastsTo:null,weeks:null}},"plan-care-v3-apoquel":{key:"bottle_gap",values:{unitLabel:null,doseOn:null,noneFor:null,lastsTo:"2026-10-30",weeks:4}}};function changeOption(offerId,title,size,quantity,priceCentsPerCycle,cadenceDays,current){return{offerId:offerId,title:title,size:size,packQuantity:null,packUnit:null,unitLabel:null,quantity:quantity,priceCentsPerCycle:priceCentsPerCycle,cadenceDays:cadenceDays,current:current}}var CARE_MOCK_BUY_AGAIN=[{offerId:CARE_MOCK_OFFER.vetradent,title:"Vetradent chews",imageUrl:shot("vetradent"),priceCents:2199,lastOrderedOn:"2026-08-15",isRx:false,likelyOut:true},{offerId:CARE_MOCK_OFFER.earWipes,title:"Zymox Ear Wipes",imageUrl:shot("ear-wipes"),priceCents:1499,lastOrderedOn:"2026-08-15",isRx:false,likelyOut:false},{offerId:CARE_MOCK_OFFER.douxoCalm,title:"Douxo Calm shampoo",imageUrl:shot("douxo-calm"),priceCents:1299,lastOrderedOn:"2026-08-15",isRx:false,likelyOut:false},{offerId:CARE_MOCK_OFFER.dasuquin,title:"Dasuquin with MSM",imageUrl:shot("dasuquin"),priceCents:2799,lastOrderedOn:"2026-07-18",isRx:false,likelyOut:false}],CARE_MOCK_TAX_RATE=.08625;function careMockQuote(lines,config=CARE_MOCK_SHOP_CONFIG){let prices=CARE_MOCK_PRICES,rate=config.taxRate??CARE_MOCK_TAX_RATE,offLeft=config.firstRxDiscountCents??0,priced=lines.map(l=>{let p=prices[l.offerId],unitPrice=p?.priceCents??0,isRx=p?.isRx===true,auto=p?.autoPriceCents,cut=config.firstAutoOrderPrice==="auto"&&l.plan==="auto"&&typeof auto=="number"&&auto<unitPrice?(unitPrice-auto)*l.quantity:0,off2=isRx?Math.min(offLeft,unitPrice*l.quantity-cut):0;return offLeft-=off2,{l:l,unitPrice:unitPrice,isRx:isRx,off:off2,cut:cut,net:unitPrice*l.quantity-cut}}),box=priced.filter(x=>!x.isRx).reduce((s,x)=>s+x.net,0),rx=priced.filter(x=>x.isRx).reduce((s,x)=>s+x.net,0),off=priced.reduce((s,x)=>s+x.off,0),tax=Math.round(box*rate),taxLeft=tax,boxLines=priced.filter(x=>!x.isRx);return{lines:priced.map(x=>{let lineTax=0;return!x.isRx&&box>0&&(lineTax=x===boxLines[boxLines.length-1]?taxLeft:Math.round(x.net*tax/box),taxLeft-=lineTax),{offerId:x.l.offerId,quantity:x.l.quantity,petId:x.l.petId??null,unitPrice:x.unitPrice,discount:x.cut+x.off,tax:lineTax,whenFilledDiscountCents:x.isRx?x.off:null,isRx:x.isRx,chargedWhenFilled:x.isRx}}),shipping:0,tax:tax,total:box+tax+rx-off,expiresAt:"2026-09-23T17:00:00Z",shipsOn:"2026-09-24",arrivesOn:"2026-09-26",whenFilledDiscountCents:off,dueTodayCents:box+tax,dueWhenFilledCents:rx-off}}exports.CARE_MOCK_ADDRESS=CARE_MOCK_ADDRESS;exports.CARE_MOCK_BUY_AGAIN=CARE_MOCK_BUY_AGAIN;exports.CARE_MOCK_CARD=CARE_MOCK_CARD;exports.CARE_MOCK_IMG=CARE_MOCK_IMG;exports.CARE_MOCK_OFFER=CARE_MOCK_OFFER;exports.CARE_MOCK_ORDERS=CARE_MOCK_ORDERS;exports.CARE_MOCK_ORDER_BOX_ID=CARE_MOCK_ORDER_BOX_ID;exports.CARE_MOCK_ORDER_PAST_AUG=CARE_MOCK_ORDER_PAST_AUG;exports.CARE_MOCK_ORDER_PAST_JUL=CARE_MOCK_ORDER_PAST_JUL;exports.CARE_MOCK_ORDER_RX_ID=CARE_MOCK_ORDER_RX_ID;exports.CARE_MOCK_PACKS=CARE_MOCK_PACKS;exports.CARE_MOCK_PET_NO_RECORDS=CARE_MOCK_PET_NO_RECORDS;exports.CARE_MOCK_PET_RECORDS=CARE_MOCK_PET_RECORDS;exports.CARE_MOCK_PLANS=CARE_MOCK_PLANS;exports.CARE_MOCK_PLAN_SKIP_WARNINGS=CARE_MOCK_PLAN_SKIP_WARNINGS;exports.CARE_MOCK_PRESCRIPTIONS=CARE_MOCK_PRESCRIPTIONS;exports.CARE_MOCK_PRICES=CARE_MOCK_PRICES;exports.CARE_MOCK_SHOP_CONFIG=CARE_MOCK_SHOP_CONFIG;exports.CARE_MOCK_TAX_RATE=CARE_MOCK_TAX_RATE;exports.CARE_MOCK_TODAY=CARE_MOCK_TODAY;exports.MockTransport=MockTransport;exports.bodies=bodies;exports.careMockImg=careMockImg;exports.careMockOrderDetail=careMockOrderDetail;exports.careMockQuote=careMockQuote;exports.careMockSlugOf=careMockSlugOf;exports.wire=wire;
|
|
105
|
+
return Object.freeze({kind:"unknown",raw:{...raw},lastEventId:lastEventId,serverRequestId:serverRequestId,terminal:false})}function createFallbackUtf8Decoder(){let pending=[];return{decode(input,options){let stream=options?.stream===true,bytes=pending.length>0?pending.slice():[];if(input!==void 0)for(let i2=0;i2<input.length;i2+=1)bytes.push(input[i2]);pending=[];let out="",i=0;for(;i<bytes.length;){let b0=bytes[i];if(b0<128){out+=String.fromCharCode(b0),i+=1;continue}let need,lower=128,upper=191,cp;if(b0>=194&&b0<=223)need=1,cp=b0&31;else if(b0>=224&&b0<=239)need=2,cp=b0&15,b0===224&&(lower=160),b0===237&&(upper=159);else if(b0>=240&&b0<=244)need=3,cp=b0&7,b0===240&&(lower=144),b0===244&&(upper=143);else{out+="�",i+=1;continue}let j=1,valid=true;for(;j<=need&&!(i+j>=bytes.length);){let b=bytes[i+j],lo=j===1?lower:128,hi=j===1?upper:191;if(b<lo||b>hi){valid=false;break}cp=cp<<6|b&63,j+=1}if(!valid){out+="�",i+=j;continue}if(j<=need){stream?pending=bytes.slice(i):out+="�";break}out+=String.fromCodePoint(cp),i+=need+1}return out}}}function createUtf8Decoder(){let Native=globalThis.TextDecoder;return typeof Native=="function"?new Native("utf-8"):createFallbackUtf8Decoder()}var BLOCK_SEPARATOR=`\n\n`,MAX_PENDING_BLOCK_CHARS=1048576,wireObjectSchema=/* @__PURE__ */zod.z.record(/* @__PURE__ */zod.z.string(),/* @__PURE__ */zod.z.unknown()),URGENCY_LEVELS=["emergency","schedule_soon","home_care"];async function*parseSse(bytes,serverRequestId=null){let resolvedRequestId=null,requestIdNow=()=>(resolvedRequestId!==null||(resolvedRequestId=typeof serverRequestId=="function"?serverRequestId():serverRequestId),resolvedRequestId),decoder=createUtf8Decoder(),buffer="",scanFrom=0,sawDelta=false;for await(let chunk of bytes){for(buffer+=decoder.decode(chunk,{stream:true});;){let sep=buffer.indexOf(BLOCK_SEPARATOR,scanFrom);if(sep===-1)break;let block=buffer.slice(0,sep);buffer=buffer.slice(sep+BLOCK_SEPARATOR.length),scanFrom=0;let frame=parseBlock(block,requestIdNow());if(frame!==null&&(frame.kind==="delta"&&(sawDelta=true),yield frame,frame.terminal))return}if(scanFrom=buffer.length>0?buffer.length-1:0,buffer.length>MAX_PENDING_BLOCK_CHARS){yield errorFrame({code:sawDelta?"CHAT_STREAM_INCOMPLETE":"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:requestIdNow()});return}}if(buffer+=decoder.decode(),buffer.trim().length>0){let frame=parseBlock(buffer,requestIdNow());if(frame!==null&&(frame.kind==="delta"&&(sawDelta=true),yield frame,frame.terminal))return}yield errorFrame({code:sawDelta?"CHAT_STREAM_INCOMPLETE":"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:requestIdNow()})}function parseBlock(block,serverRequestId){let id=null,dataLines=[];for(let rawLine of block.split(`\n`)){let line=rawLine.replace(/\s+$/,"");line.length===0||line.startsWith(":")||(line.startsWith("id:")?id=line.slice(3).trim():line.startsWith("data:")&&dataLines.push(line.slice(5).replace(/^ /,"")))}if(dataLines.length===0)return null;let decoded;try{decoded=JSON.parse(dataLines.join(`\n`))}catch{return null}if(typeof decoded!="object"||decoded===null||Array.isArray(decoded))return null;let parsed=wireObjectSchema.safeParse(decoded);return parsed.success?frameFromWire(parsed.data,id,serverRequestId):null}function frameFromWire(json,lastEventId,serverRequestId){let type=json.type,event=json.event;if(type==="error"||"error"in json)return errorFrame({code:asString(json.code)??"unknown",retryable:json.retryable===true,wireMessage:asString(json.error),synthesized:false,lastEventId:lastEventId,serverRequestId:serverRequestId});if(type==="done"||json.done===true)return doneFrame({conversationId:asString(json.conversation_id)??"",messageId:asString(json.message_id),title:asString(json.title),followUpQuestions:asStringList(json.follow_up_questions),citations:asMapList(json.citations),citationStatus:asString(json.citation_status),urgencyLevel:asUrgency(json.urgency_level),urgencyReason:asString(json.urgency_reason),urgencyProvided:urgencySlotProvided(json),resultId:asString(json.result_id),lastEventId:lastEventId},serverRequestId);if(type==="accepted"||json.status==="reasoning")return acceptedFrame(asString(json.stream_id),lastEventId,serverRequestId);if(type==="heartbeat"||json.heartbeat===true)return heartbeatFrame(lastEventId,serverRequestId);if(type==="text.delta"||"delta"in json||"token"in json){let delta=asString(json.delta)??asString(json.token)??"";return deltaFrame(delta,lastEventId,serverRequestId)}return event==="analysis_started"?analysisStartedFrame(asString(json.request_id),lastEventId,serverRequestId):event==="analysis_complete"?analysisCompleteFrame({resultId:asString(json.result_id),analysisType:asString(json.analysis_type),modelVersion:asString(json.model_version),confidence:asNumber(json.confidence),detections:asMapList(json.detections),interpretation:asString(json.interpretation),lastEventId:lastEventId},serverRequestId):unknownFrame(json,lastEventId,serverRequestId)}function asString(v){return typeof v=="string"?v:null}function asNumber(v){return typeof v=="number"&&Number.isFinite(v)?v:null}function asUrgency(v){return typeof v=="string"&&URGENCY_LEVELS.includes(v)?v:null}function urgencySlotProvided(json){if(!Object.prototype.hasOwnProperty.call(json,"urgency_level"))return false;let raw=json.urgency_level;return raw===null||asUrgency(raw)!==null}function asStringList(v){return Array.isArray(v)?v.map(e=>typeof e=="string"?e:String(e)):[]}function isPlainObject(v){return typeof v=="object"&&v!==null&&!Array.isArray(v)}function asMapList(v){return Array.isArray(v)?v.filter(isPlainObject):[]}var DAILY_QUOTA_WIRE_CODE="DAILY_QUOTA_EXCEEDED",THROTTLES=/* @__PURE__ */new Set(["THROTTLINGEXCEPTION","RATELIMITED","TOOMANYREQUESTS"]);function foldDailyQuotaWireCode(code,body){if(!THROTTLES.has(code.toUpperCase().replace(/[^A-Z0-9]/g,"")))return code;let b=body,limit=b?.daily_limit??b?.error?.daily_limit;return typeof limit=="number"&&Number.isFinite(limit)?DAILY_QUOTA_WIRE_CODE:code}var ACCESS_DENIED_COPY="This feature isn't available on your account right now.",VALIDATION_FAILED_COPY="Something in that request was not right. Check the details and try again.",USER_FACING_COPY=/* @__PURE__ */Object.freeze({authExpired:"Please sign in again to continue.",authRejected:"Please sign in again to continue.",sessionRequired:"This app needs to be updated to keep using Everfur.",accessDenied:ACCESS_DENIED_COPY,paymentRequired:"This is part of a paid plan.",quotaExceeded:"You have used today's messages. This resets tomorrow.",rateLimited:"You are sending messages quickly. Try again in a few seconds.",validationFailed:VALIDATION_FAILED_COPY,sdkUpdateRequired:"This app needs to be updated to keep using Everfur.",conflict:"That is already running. Wait for it to finish, then try again.",idempotencyConflict:"That message was already delivered.",idempotencyInFlight:"That is still processing. Give it a moment.",conversationNotFound:"This conversation is no longer available.",petNotFound:"We could not find that pet. Please pick a pet and try again.",resourceNotFound:"We could not find that.",streamTimeout:"The response timed out. Tap retry to try again.",mediaUploadFailed:"We could not upload that photo. Please attach it again.",moderationBlocked:"This request cannot be answered here.",upstreamLlmTimeout:"The response timed out. Tap retry to try again.",internalError:"We hit a snag on our end. Please try again.",notImplemented:"That is not available yet.",serviceUnavailable:"That service is briefly unavailable. Try again shortly.",streamIncomplete:"The connection dropped mid-answer. Tap retry to continue.",identitySignatureRequired:ACCESS_DENIED_COPY,runtimeDisposed:VALIDATION_FAILED_COPY,unknown:"Something went wrong. Please try again."}),SESSION_REVOKED_COPY="This session has ended. Please sign in again.",LINKED_ACCOUNT_READ_ONLY="linked_account_read_only";function displayFor(code,wireCode,reasonCode){return code==="conflict"&&reasonCode===LINKED_ACCOUNT_READ_ONLY?ACCESS_DENIED_COPY:(code==="authRejected"||code==="authExpired")&&typeof wireCode=="string"&&wireCode.trim().toLowerCase()==="session_revoked"?SESSION_REVOKED_COPY:userFacingError(code)}function userFacingError(code){return USER_FACING_COPY[code]}function defineHidden(target,key,value){Object.defineProperty(target,key,{value:value,enumerable:false,writable:false,configurable:false})}var REASON_CODE_SHAPE=/^[a-z][a-z0-9_]{0,63}$/;function makeEverfurError(code,opts){let row=contractErrorFor(opts?.wireCode,opts?.wireEnvelope),linkedReadOnly=code==="conflict"&&opts?.reasonCode===LINKED_ACCOUNT_READ_ONLY,error={code:code,category:categoryFor(code),retryable:opts?.retryable??(linkedReadOnly?false:isRetryableCode(code)),displayMessage:displayFor(code,opts?.wireCode,linkedReadOnly?LINKED_ACCOUNT_READ_ONLY:null)};opts?.httpStatus!==void 0&&(error.httpStatus=opts.httpStatus),opts?.requestId&&(error.requestId=opts.requestId),typeof opts?.reasonCode=="string"&&REASON_CODE_SHAPE.test(opts.reasonCode)&&(error.reasonCode=opts.reasonCode);let wait=opts?.retryAfterSeconds;if(typeof wait=="number"&&Number.isFinite(wait)&&wait>=0&&(error.retryAfterSeconds=Math.round(wait)),row);return opts?.wireMessage&&defineHidden(error,"wireMessage",opts.wireMessage),opts?.raw!==void 0&&opts.raw!==null&&defineHidden(error,"raw",opts.raw),/* @__PURE__ */Object.freeze(error)}async function*bufferedTextByteSource(text,splitAt=[]){let bytes=(new TextEncoder).encode(text),points=[...new Set(splitAt)].filter(n=>n>0&&n<bytes.length).sort((a,b)=>a-b),start=0;for(let point of points)yield bytes.subarray(start,point),start=point;yield bytes.subarray(start)}function errorFromResponse(status,body,requestId){let wireCode=extractWireCode(body),code=wireCode?fromWire(wireCode):fromHttpStatus(status),wireMessage=extractWireMessage(body);return makeEverfurError(code,{httpStatus:status,...extractRetryable(body)?{retryable:true}:{},...{},...wireCode?{wireCode:wireCode}:{},...extractReasonCode(body)?{reasonCode:extractReasonCode(body)}:{},...extractRetryAfterSeconds(body)!==null?{retryAfterSeconds:extractRetryAfterSeconds(body)}:{},...wireMessage?{wireMessage:wireMessage}:{},...body!=null?{raw:body}:{}})}function extractRetryAfterSeconds(body){let b=body,value=b?.retry_after_seconds??b?.error?.retry_after_seconds;return typeof value=="number"&&Number.isFinite(value)&&value>=0?value:null}function extractReasonCode(body){let b=body,reason=b?.error?.reason_code??b?.reason_code;return typeof reason=="string"&&reason.length>0?reason:null}function extractWireCode(body){let b=body,code=b?.error?.code??b?.code;return typeof code=="string"&&code.length>0?foldDailyQuotaWireCode(code,body):null}function extractWireMessage(body){let b=body,message=b?.error?.message??b?.message;return typeof message=="string"&&message.length>0?message:null}function extractRetryable(body){let b=body;return b?.error?.retryable===true||b?.retryable===true}var wire=/* @__PURE__ */Object.freeze({accepted:streamId=>JSON.stringify(streamId?{type:"accepted",stream_id:streamId}:{type:"accepted"}),heartbeat:()=>JSON.stringify({type:"heartbeat"}),delta:text=>JSON.stringify({type:"text.delta",delta:text}),done:fields=>JSON.stringify({type:"done",...fields??{}}),error:(code,retryable=false)=>JSON.stringify({type:"error",code:code,retryable:retryable})}),bodies=/* @__PURE__ */Object.freeze({pets:rows=>({pets:rows.map(row=>({pet_id:"a0000000-0000-4000-8000-000000000001",pet_ref:"pet-A",name:"Rex",species:"dog",breed:"Labrador",age_years:3,weight_kg:20,updated_at:"2026-09-18T10:00:00Z",...row}))}),uploadInitiate:overrides=>({upload_id:"b0000000-0000-4000-8000-000000000001",upload_url:"https://uploads.example.test/bucket",upload_fields:{key:"uploads/user-A/chat/photo.jpg","Content-Type":"image/jpeg",policy:"p",signature:"s"},s3_key:"uploads/user-A/chat/photo.jpg",expires_in_seconds:900,purpose:"chat_attachment",max_content_length:10485760,...overrides??{}}),feedback:overrides=>({feedback_id:"c0000000-0000-4000-8000-000000000001",feedback_type:"helpful",updated_at:"2026-09-18T10:00:00Z",...overrides??{}})});function assertRouteIsServed(method,path){let verdict=classifyRoute(method,path);if(verdict!=="known")throw verdict==="absent"?new EverfurConfigError("invalid-argument",`MockTransport: ${method} ${path} is a route the Everfur backend does NOT serve, so this call returns 404 in production. Scripting a success for it makes a green test that hides a broken integration. Known-absent routes: ${KNOWN_ABSENT_ROUTES.join(", ")}. Pass { strictPaths: false } to MockTransport only if you are deliberately testing this shape.`):new EverfurConfigError("invalid-argument",`MockTransport: ${method} ${path} is not a known partner-plane route. If the backend has gained it, add it to KNOWN_PARTNER_ROUTES in src/core/testing/knownRoutes.ts. Pass { strictPaths: false } to opt out for this transport.`)}var MockTransport=class{constructor(options={}){this.streamQueue=[];this.requestQueue=[];this.lastRequestScript=/* @__PURE__ */new Map;this.openCount=0;this.requests=[];this.streamRequests=[];this.peak=0;this.strictPaths=options.strictPaths??true}get openStreams(){return this.openCount}get peakOpenStreams(){return this.peak}enqueueStream(...scripts){return this.streamQueue.push(...scripts),this}enqueueRequest(...scripts){return this.requestQueue.push(...scripts),this}async request(req){this.strictPaths&&assertRouteIsServed(req.method,req.path);let base={method:req.method,path:req.path,headers:{...req.headers??{}},...req.query===void 0?{}:{query:{...req.query}}},record=req.body===void 0?base:{...base,body:req.body};this.requests.push(record);let endpoint=`${req.method} ${req.path}`,next=this.requestQueue.shift();next!==void 0&&this.lastRequestScript.set(endpoint,next);let script=next??this.lastRequestScript.get(endpoint)??{status:200,body:{}},status=script.status??200;return status===304||status>=400?err(errorFromResponse(status,script.body??null)):ok(script.body??{})}stream(req,signal){this.strictPaths&&assertRouteIsServed(req.method,req.path),this.streamRequests.push({path:req.path,authorization:header(req,"authorization"),partnerKey:header(req,"x-everfur-partner-key"),idempotencyKey:header(req,"idempotency-key"),...req.body===void 0?{}:{body:req.body},headers:{...req.headers??{}}});let script=this.streamQueue.shift()??{kind:"sse",blocks:[wire.done()]};return this.openStream(script,signal)}async*openStream(script,signal){this.openCount+=1,this.openCount>this.peak&&(this.peak=this.openCount);try{yield*this.runScript(script,signal)}finally{this.openCount-=1}}async*runScript(script,signal){switch(script.kind){case"httpError":{let wireCode=extractWireCode2(script.body)??statusToWireCode(script.status);yield errorFrame({code:wireCode,retryable:extractRetryable2(script.body)||isAutoRetryable(fromWire(wireCode)),wireMessage:extractWireMessage2(script.body),synthesized:true,lastEventId:null});return}case"network":yield errorFrame({code:"INTERNAL_ERROR",retryable:true,wireMessage:"network request failed",synthesized:true,lastEventId:null});return;case"partialByte":yield*parseSse(bufferedTextByteSource(script.body,script.splitAt));return;case"sse":yield*parseSse(sseByteSource(script.blocks,script.gapMs??0,signal));return;case"drop":yield*parseSse(sseByteSource(script.blocks,0,signal));return;case"stall":yield*parseSse(stallByteSource(script.preface??[],signal));return;default:return assertNever(script)}}};async function*sseByteSource(blocks,gapMs,signal){let enc=new TextEncoder,first=true;for(let block of blocks){if(signal.aborted||!first&&gapMs>0&&await abortableSleep(gapMs,signal)==="abort")return;first=false,yield enc.encode(toSseBlock(block))}}async function*stallByteSource(preface,signal){let enc=new TextEncoder;for(let block of preface){if(signal.aborted)return;yield enc.encode(toSseBlock(block))}await abortableSleep(1/0,signal)}function toSseBlock(payload){return`data: ${payload}\n\n`}function abortableSleep(ms,signal){return new Promise(resolve=>{if(signal.aborted){resolve("abort");return}let handle=null,onAbort=()=>{handle!==null&&clearTimeout(handle),signal.removeEventListener("abort",onAbort),resolve("abort")};Number.isFinite(ms)&&(handle=setTimeout(()=>{signal.removeEventListener("abort",onAbort),resolve("timeout")},ms)),signal.addEventListener("abort",onAbort,{once:true})})}function header(req,name){let headers=req.headers;if(!headers)return null;for(let[key,value]of Object.entries(headers))if(key.toLowerCase()===name)return value;return null}function extractWireCode2(body){let b=body,code=b?.error?.code??b?.code;return typeof code=="string"&&code.length>0?foldDailyQuotaWireCode(code,body):null}function extractWireMessage2(body){let b=body,message=b?.error?.message??b?.message;return typeof message=="string"&&message.length>0?message:null}function extractRetryable2(body){let b=body;return b?.error?.retryable===true||b?.retryable===true}function statusToWireCode(status){return status===401?"AUTH_EXPIRED":status===403?"ACCESS_DENIED":status===404?"NOT_FOUND":status===409?"IDEMPOTENCY_CONFLICT":status===421?"MISDIRECTED_REQUEST":status===429?"RATE_LIMITED":status===400||status===422?"INVALID_REQUEST":status>=500?"INTERNAL_ERROR":""}var CARE_MOCK_TODAY="2026-09-23",CARE_MOCK_IMG="https://care-v3-mock.everfur.invalid/img/",careMockImg=file=>`${CARE_MOCK_IMG}${file}`,CARE_MOCK_PET_RECORDS="pet-care-v3-records",CARE_MOCK_PET_NO_RECORDS="pet-care-v3-no-records",CARE_MOCK_OFFER={apoquel:"offer-apoquel",simparicaTrio:"offer-simparica-trio",salmonOil:"offer-salmon-oil",vetradent:"offer-vetradent",earWipes:"offer-ear-wipes",douxoCalm:"offer-douxo-calm",veggiedent:"offer-veggiedent",dasuquin:"offer-dasuquin",fortiflora:"offer-fortiflora",greenies:"offer-greenies",trickyTreats:"offer-tricky-treats"},careMockSlugOf=offerId=>offerId.replace(/^offer-/,""),CARE_MOCK_PRICES={[CARE_MOCK_OFFER.apoquel]:{priceCents:6499,autoPriceCents:6499,isRx:true},[CARE_MOCK_OFFER.simparicaTrio]:{priceCents:3199,autoPriceCents:null,isRx:true},[CARE_MOCK_OFFER.salmonOil]:{priceCents:3299,autoPriceCents:2969,isRx:false},[CARE_MOCK_OFFER.dasuquin]:{priceCents:2799,autoPriceCents:2519,isRx:false},[CARE_MOCK_OFFER.fortiflora]:{priceCents:2499,autoPriceCents:2249,isRx:false},[CARE_MOCK_OFFER.vetradent]:{priceCents:2199,autoPriceCents:1979,isRx:false},[CARE_MOCK_OFFER.veggiedent]:{priceCents:999,autoPriceCents:899,isRx:false},[CARE_MOCK_OFFER.greenies]:{priceCents:3999,autoPriceCents:null,isRx:false},[CARE_MOCK_OFFER.trickyTreats]:{priceCents:1100,autoPriceCents:null,isRx:false},[CARE_MOCK_OFFER.earWipes]:{priceCents:1499,autoPriceCents:null,isRx:false},[CARE_MOCK_OFFER.douxoCalm]:{priceCents:1299,autoPriceCents:null,isRx:false}},shot=slug=>careMockImg(`care-${slug}.webp`),cutout=slug=>careMockImg(`care-${slug}-mask.webp`),CARE_MOCK_ADDRESS={ref:"addr-home",label:"Home",isDefault:true,isComplete:true,address:{recipientName:null,line1:"1432 Irving St",line2:null,city:"San Francisco",region:"CA",postalCode:"94122",country:"US"}},CARE_MOCK_CARD={paymentMethodId:"pm-care-v3-mock-visa",brand:"visa",last4:"4242",wallet:null},CARE_MOCK_SHOP_CONFIG={recurringTermsVersion:"care-v3-mock",recurringTermsUrl:"https://care-v3-mock.everfur.invalid/recurring-terms",stripePublishableKey:null,delivery:null,freeShippingThresholdCents:3500,firstRxDiscountCents:5e3,firstRxDiscountCode:"VET50",firstAutoOrderPrice:null},CARE_MOCK_PACKS={[CARE_MOCK_OFFER.apoquel]:{packQuantity:"30.0",packUnit:"each"}},CARE_MOCK_PRESCRIPTIONS=[{rxId:"rx-apoquel",petId:CARE_MOCK_PET_RECORDS,drug:"Apoquel",strength:"16 mg",form:"tablet",status:"ready",offerId:CARE_MOCK_OFFER.apoquel,packCount:1,fillsUsed:null,fillsTotal:null,expiresOn:null,nextFillOn:null,supply:{unitsLeft:8,unitLabel:"tablets",dailyUnits:1,runsOutOn:"2026-10-01",refillArrivesOn:"2026-09-29"},prescriberName:"Dr. Goode",refillsTotal:null,refillsLeft:2},{rxId:"rx-simparica-trio",petId:CARE_MOCK_PET_RECORDS,drug:"Simparica Trio",strength:"44.1 to 88 lb",form:"chew",status:"ready",offerId:CARE_MOCK_OFFER.simparicaTrio,packCount:1,fillsUsed:null,fillsTotal:null,expiresOn:null,nextFillOn:"2026-10-05",supply:null,prescriberName:"Dr. Goode",refillsTotal:null,refillsLeft:8}],step=(key,doneAt)=>({key:key,doneAt:doneAt}),CARE_MOCK_ORDER_BOX_ID="order-care-v3-box-0923",CARE_MOCK_ORDER_RX_ID="order-care-v3-rx-0923",CARE_MOCK_ORDER_PAST_AUG="order-care-v3-box-0815",CARE_MOCK_ORDER_PAST_JUL="order-care-v3-box-0718",PLACED="2026-09-23T16:00:00Z",CARE_MOCK_ORDERS=[{orderId:CARE_MOCK_ORDER_BOX_ID,referenceNumber:"EF-260923-4471",status:"accepted",total:3824,placedAt:PLACED,itemCount:1,items:[{offerId:CARE_MOCK_OFFER.salmonOil,title:"Zesty Paws Salmon Oil",quantity:1,imageUrl:shot("salmon-oil"),cutoutUrl:cutout("salmon-oil")}],fulfiller:"everfur_box",arrivesBy:"2026-09-26",steps:[step("ordered_paid",PLACED),step("packing",null),step("delivered",null)],currentStep:"packing",statusLineKey:"ships_tomorrow",prescriberName:null},{orderId:CARE_MOCK_ORDER_RX_ID,referenceNumber:"EF-260923-4471",status:"pending_handoff",total:1499,placedAt:PLACED,itemCount:1,items:[{offerId:CARE_MOCK_OFFER.apoquel,title:"Apoquel 16 mg",quantity:1,imageUrl:shot("apoquel"),cutoutUrl:cutout("apoquel")}],fulfiller:"pharmacy",arrivesBy:"2026-09-29",steps:[step("ordered",PLACED),step("vet_ok",null),step("filled_checked",null),step("delivered",null)],currentStep:"vet_ok",statusLineKey:"needs_vet_ok",prescriberName:"Dr. Goode",clinicName:"Maplewood"},{orderId:CARE_MOCK_ORDER_PAST_AUG,referenceNumber:null,status:"delivered",total:5428,placedAt:"2026-08-12T16:00:00Z",itemCount:3,items:[{offerId:CARE_MOCK_OFFER.vetradent,title:"Vetradent dental chews",quantity:1,imageUrl:shot("vetradent")},{offerId:CARE_MOCK_OFFER.earWipes,title:"Zymox Ear Wipes",quantity:1,imageUrl:shot("ear-wipes")},{offerId:CARE_MOCK_OFFER.douxoCalm,title:"Douxo S3 Calm shampoo",quantity:1,imageUrl:shot("douxo-calm")}],fulfiller:"everfur_box",arrivesBy:"2026-08-15",steps:[step("ordered_paid","2026-08-12T16:00:00Z"),step("packing","2026-08-13T16:00:00Z"),step("delivered","2026-08-15T18:00:00Z")],currentStep:"delivered",statusLineKey:"delivered",prescriberName:null},{orderId:CARE_MOCK_ORDER_PAST_JUL,referenceNumber:null,status:"delivered",total:5755,placedAt:"2026-07-15T16:00:00Z",itemCount:2,items:[{offerId:CARE_MOCK_OFFER.dasuquin,title:"Dasuquin with MSM",quantity:1,imageUrl:shot("dasuquin")},{offerId:CARE_MOCK_OFFER.fortiflora,title:"FortiFlora probiotic",quantity:1,imageUrl:shot("fortiflora")}],fulfiller:"everfur_box",arrivesBy:"2026-07-18",steps:[step("ordered_paid","2026-07-15T16:00:00Z"),step("packing","2026-07-16T16:00:00Z"),step("delivered","2026-07-18T18:00:00Z")],currentStep:"delivered",statusLineKey:"delivered",prescriberName:null}],ORDER_LINES={[CARE_MOCK_ORDER_BOX_ID]:[[CARE_MOCK_OFFER.salmonOil,2969,256,false]],[CARE_MOCK_ORDER_RX_ID]:[[CARE_MOCK_OFFER.apoquel,6499,0,true]],[CARE_MOCK_ORDER_PAST_AUG]:[[CARE_MOCK_OFFER.vetradent,2199,190,false],[CARE_MOCK_OFFER.earWipes,1499,129,false],[CARE_MOCK_OFFER.douxoCalm,1299,112,false]],[CARE_MOCK_ORDER_PAST_JUL]:[[CARE_MOCK_OFFER.dasuquin,2799,241,false],[CARE_MOCK_OFFER.fortiflora,2499,216,false]]};function careMockOrderDetail(summary){let lines=(ORDER_LINES[summary.orderId]??[]).map(([offerId,unitPrice,tax2,rx],i)=>{let item=summary.items?.find(it=>it.offerId===offerId);return{lineId:`${summary.orderId}-l${i+1}`,offerId:offerId,sku:offerId,title:item?.title??offerId,requiresRx:rx,compounded:false,packQuantity:CARE_MOCK_PACKS[offerId]?.packQuantity??null,packUnit:CARE_MOCK_PACKS[offerId]?.packUnit??null,quantity:1,unitPrice:unitPrice,discount:rx?5e3:0,tax:tax2,fulfillmentType:rx?"pharmacy":"everfur_box",petId:CARE_MOCK_PET_RECORDS,imageUrl:item?.imageUrl??null}}),subtotal=lines.reduce((s,l)=>s+l.unitPrice*l.quantity,0),discount=lines.reduce((s,l)=>s+l.discount,0),tax=lines.reduce((s,l)=>s+l.tax,0),delivered=summary.status==="delivered";return{summary:summary,lines:lines,shipping:summary.orderId===CARE_MOCK_ORDER_BOX_ID?599:0,shippingTax:0,shipments:[],canCancel:!delivered,canReturn:false,canPay:false,paymentStatus:delivered||summary.status==="shipped"?"captured":"authorized",refunds:[],returnIds:[],subtotal:subtotal,discount:discount,tax:tax,arrivesBy:summary.arrivesBy??null,tracking:null,steps:(summary.steps??[]).map(s=>({key:s.key,done:s.doneAt!=null,at:s.doneAt})),paymentMethodId:CARE_MOCK_CARD.paymentMethodId}}var CARE_MOCK_PLANS=[{planId:"plan-care-v3-simparica",lines:[{offerId:CARE_MOCK_OFFER.simparicaTrio,quantity:1,petId:CARE_MOCK_PET_RECORDS}],cadenceDays:30,destination:CARE_MOCK_ADDRESS.ref,paymentMethodId:CARE_MOCK_CARD.paymentMethodId,discountBps:0,nextRun:"2026-10-05",state:"active",stopReason:null,priceCentsPerCycle:3199,chargedWhenFilled:true,nextShipOn:"2026-10-05",skippedCycleOn:null,prescriberName:"Dr. Goode",refillsLeft:8,refillsTotal:null,autoDiscountPct:null,changeOptions:[changeOption(CARE_MOCK_OFFER.simparicaTrio,"Simparica Trio","1 chew",1,3199,[30],true),changeOption(CARE_MOCK_OFFER.simparicaTrio,"Simparica Trio","3 chews",3,9597,[90],false)]},{planId:"plan-care-v3-apoquel",lines:[{offerId:CARE_MOCK_OFFER.apoquel,quantity:1,petId:CARE_MOCK_PET_RECORDS}],cadenceDays:30,destination:CARE_MOCK_ADDRESS.ref,paymentMethodId:CARE_MOCK_CARD.paymentMethodId,discountBps:0,nextRun:"2026-10-27",state:"active",stopReason:null,priceCentsPerCycle:6499,chargedWhenFilled:true,nextShipOn:"2026-10-27",skippedCycleOn:null,prescriberName:"Dr. Goode",refillsLeft:2,refillsTotal:null,autoDiscountPct:null,changeOptions:[changeOption(CARE_MOCK_OFFER.apoquel,"Apoquel 16 mg","30 tablets",1,6499,[30],true),changeOption(CARE_MOCK_OFFER.apoquel,"Apoquel 16 mg","60 tablets",2,12998,[60],false)]},{planId:"plan-care-v3-salmon-oil",lines:[{offerId:CARE_MOCK_OFFER.salmonOil,quantity:1,petId:CARE_MOCK_PET_RECORDS}],cadenceDays:120,destination:CARE_MOCK_ADDRESS.ref,paymentMethodId:CARE_MOCK_CARD.paymentMethodId,discountBps:1e3,nextRun:"2027-01-21",state:"active",stopReason:null,priceCentsPerCycle:2969,chargedWhenFilled:false,nextShipOn:"2027-01-21",skippedCycleOn:null,prescriberName:null,refillsLeft:null,refillsTotal:null,autoDiscountPct:10,changeOptions:[changeOption(CARE_MOCK_OFFER.salmonOil,"Zesty Paws Salmon Oil","32 fl oz",1,2969,[60,90,120,180],true)]}],CARE_MOCK_PLAN_SKIP_WARNINGS={"plan-care-v3-simparica":{key:"last_dose",values:{unitLabel:"chew",doseOn:"2026-10-01",noneFor:"2026-11-01",lastsTo:null,weeks:null}},"plan-care-v3-apoquel":{key:"bottle_gap",values:{unitLabel:null,doseOn:null,noneFor:null,lastsTo:"2026-10-30",weeks:4}}};function changeOption(offerId,title,size,quantity,priceCentsPerCycle,cadenceDays,current){return{offerId:offerId,title:title,size:size,packQuantity:null,packUnit:null,unitLabel:null,quantity:quantity,priceCentsPerCycle:priceCentsPerCycle,cadenceDays:cadenceDays,current:current}}var CARE_MOCK_BUY_AGAIN=[{offerId:CARE_MOCK_OFFER.vetradent,title:"Vetradent chews",imageUrl:shot("vetradent"),priceCents:2199,lastOrderedOn:"2026-08-15",isRx:false,likelyOut:true},{offerId:CARE_MOCK_OFFER.earWipes,title:"Zymox Ear Wipes",imageUrl:shot("ear-wipes"),priceCents:1499,lastOrderedOn:"2026-08-15",isRx:false,likelyOut:false},{offerId:CARE_MOCK_OFFER.douxoCalm,title:"Douxo Calm shampoo",imageUrl:shot("douxo-calm"),priceCents:1299,lastOrderedOn:"2026-08-15",isRx:false,likelyOut:false},{offerId:CARE_MOCK_OFFER.dasuquin,title:"Dasuquin with MSM",imageUrl:shot("dasuquin"),priceCents:2799,lastOrderedOn:"2026-07-18",isRx:false,likelyOut:false}],CARE_MOCK_TAX_RATE=.08625;function careMockQuote(lines,config=CARE_MOCK_SHOP_CONFIG){let prices=CARE_MOCK_PRICES,rate=config.taxRate??CARE_MOCK_TAX_RATE,offLeft=config.firstRxDiscountCents??0,priced=lines.map(l=>{let p=prices[l.offerId],unitPrice=p?.priceCents??0,isRx=p?.isRx===true,auto=p?.autoPriceCents,cut=config.firstAutoOrderPrice==="auto"&&l.plan==="auto"&&typeof auto=="number"&&auto<unitPrice?(unitPrice-auto)*l.quantity:0,off2=isRx?Math.min(offLeft,unitPrice*l.quantity-cut):0;return offLeft-=off2,{l:l,unitPrice:unitPrice,isRx:isRx,off:off2,cut:cut,net:unitPrice*l.quantity-cut}}),box=priced.filter(x=>!x.isRx).reduce((s,x)=>s+x.net,0),rx=priced.filter(x=>x.isRx).reduce((s,x)=>s+x.net,0),off=priced.reduce((s,x)=>s+x.off,0),tax=Math.round(box*rate),taxLeft=tax,boxLines=priced.filter(x=>!x.isRx);return{lines:priced.map(x=>{let lineTax=0;return!x.isRx&&box>0&&(lineTax=x===boxLines[boxLines.length-1]?taxLeft:Math.round(x.net*tax/box),taxLeft-=lineTax),{offerId:x.l.offerId,quantity:x.l.quantity,petId:x.l.petId??null,unitPrice:x.unitPrice,discount:x.cut+x.off,tax:lineTax,whenFilledDiscountCents:x.isRx?x.off:null,isRx:x.isRx,chargedWhenFilled:x.isRx}}),shipping:0,tax:tax,total:box+tax+rx-off,expiresAt:"2026-09-23T17:00:00Z",shipsOn:"2026-09-24",arrivesOn:"2026-09-26",whenFilledDiscountCents:off,dueTodayCents:box+tax,dueWhenFilledCents:rx-off}}exports.CARE_MOCK_ADDRESS=CARE_MOCK_ADDRESS;exports.CARE_MOCK_BUY_AGAIN=CARE_MOCK_BUY_AGAIN;exports.CARE_MOCK_CARD=CARE_MOCK_CARD;exports.CARE_MOCK_IMG=CARE_MOCK_IMG;exports.CARE_MOCK_OFFER=CARE_MOCK_OFFER;exports.CARE_MOCK_ORDERS=CARE_MOCK_ORDERS;exports.CARE_MOCK_ORDER_BOX_ID=CARE_MOCK_ORDER_BOX_ID;exports.CARE_MOCK_ORDER_PAST_AUG=CARE_MOCK_ORDER_PAST_AUG;exports.CARE_MOCK_ORDER_PAST_JUL=CARE_MOCK_ORDER_PAST_JUL;exports.CARE_MOCK_ORDER_RX_ID=CARE_MOCK_ORDER_RX_ID;exports.CARE_MOCK_PACKS=CARE_MOCK_PACKS;exports.CARE_MOCK_PET_NO_RECORDS=CARE_MOCK_PET_NO_RECORDS;exports.CARE_MOCK_PET_RECORDS=CARE_MOCK_PET_RECORDS;exports.CARE_MOCK_PLANS=CARE_MOCK_PLANS;exports.CARE_MOCK_PLAN_SKIP_WARNINGS=CARE_MOCK_PLAN_SKIP_WARNINGS;exports.CARE_MOCK_PRESCRIPTIONS=CARE_MOCK_PRESCRIPTIONS;exports.CARE_MOCK_PRICES=CARE_MOCK_PRICES;exports.CARE_MOCK_SHOP_CONFIG=CARE_MOCK_SHOP_CONFIG;exports.CARE_MOCK_TAX_RATE=CARE_MOCK_TAX_RATE;exports.CARE_MOCK_TODAY=CARE_MOCK_TODAY;exports.MockTransport=MockTransport;exports.bodies=bodies;exports.careMockImg=careMockImg;exports.careMockOrderDetail=careMockOrderDetail;exports.careMockQuote=careMockQuote;exports.careMockSlugOf=careMockSlugOf;exports.wire=wire;
|
package/dist/testing/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
|
|
2
2
|
import { E as EverfurResult } from '../EverfurResult.d-BFH-3s6E.cjs';
|
|
3
|
-
import { T as TransportPort, d as EverfurRequest, F as Frame } from '../config.d-
|
|
3
|
+
import { T as TransportPort, d as EverfurRequest, F as Frame } from '../config.d-BFTqU7ft.cjs';
|
|
4
4
|
import { C as CareOmsOrderSummary, a as CareOmsShopConfig, b as CareOmsOrder, c as CareOmsQuote } from '../omsFields.d-BHntKIAH.cjs';
|
|
5
5
|
import { k as OmsAddressDetail, a as OmsBuyAgainItem, l as OmsPaymentMethod, f as OmsPlan, m as OmsPlanSkipWarning, n as OmsPrescription } from '../omsErrors.d-VF5tnr20.cjs';
|
|
6
6
|
import '../EverfurError.d-8NHtlgzA.cjs';
|
package/dist/testing/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
|
|
2
2
|
import { E as EverfurResult } from '../EverfurResult.d-D_-254ZY.js';
|
|
3
|
-
import { T as TransportPort, d as EverfurRequest, F as Frame } from '../config.d-
|
|
3
|
+
import { T as TransportPort, d as EverfurRequest, F as Frame } from '../config.d-D_k_rNZZ.js';
|
|
4
4
|
import { C as CareOmsOrderSummary, a as CareOmsShopConfig, b as CareOmsOrder, c as CareOmsQuote } from '../omsFields.d-Cvfw8wWU.js';
|
|
5
5
|
import { k as OmsAddressDetail, a as OmsBuyAgainItem, l as OmsPaymentMethod, f as OmsPlan, m as OmsPlanSkipWarning, n as OmsPrescription } from '../omsErrors.d-VF5tnr20.js';
|
|
6
6
|
import '../EverfurError.d-8NHtlgzA.js';
|
package/dist/testing/index.js
CHANGED
|
@@ -102,4 +102,4 @@ return Object.freeze({kind:"done",terminal:true,conversationId:fields.conversati
|
|
|
102
102
|
return Object.freeze({kind:"error",terminal:true,code:fields.code,retryable:fields.retryable,wireMessage:fields.wireMessage,synthesized:fields.synthesized,lastEventId:fields.lastEventId,serverRequestId:fields.serverRequestId??null})}function analysisStartedFrame(requestId,lastEventId,serverRequestId=null){/* @__PURE__ */
|
|
103
103
|
return Object.freeze({kind:"analysisStarted",requestId:requestId,lastEventId:lastEventId,serverRequestId:serverRequestId,terminal:false})}function analysisCompleteFrame(fields,serverRequestId=null){/* @__PURE__ */
|
|
104
104
|
return Object.freeze({kind:"analysisComplete",terminal:false,resultId:fields.resultId,analysisType:fields.analysisType,modelVersion:fields.modelVersion,confidence:fields.confidence,detections:/* @__PURE__ */Object.freeze([...fields.detections]),interpretation:fields.interpretation,lastEventId:fields.lastEventId,serverRequestId:serverRequestId})}function unknownFrame(raw,lastEventId,serverRequestId=null){/* @__PURE__ */
|
|
105
|
-
return Object.freeze({kind:"unknown",raw:{...raw},lastEventId:lastEventId,serverRequestId:serverRequestId,terminal:false})}var BLOCK_SEPARATOR=`\n\n`,MAX_PENDING_BLOCK_CHARS=1048576,wireObjectSchema=/* @__PURE__ */z.record(/* @__PURE__ */z.string(),/* @__PURE__ */z.unknown()),URGENCY_LEVELS=["emergency","schedule_soon","home_care"];async function*parseSse(bytes,serverRequestId=null){let resolvedRequestId=null,requestIdNow=()=>(resolvedRequestId!==null||(resolvedRequestId=typeof serverRequestId=="function"?serverRequestId():serverRequestId),resolvedRequestId),decoder=new TextDecoder("utf-8"),buffer="",scanFrom=0,sawDelta=false;for await(let chunk of bytes){for(buffer+=decoder.decode(chunk,{stream:true});;){let sep=buffer.indexOf(BLOCK_SEPARATOR,scanFrom);if(sep===-1)break;let block=buffer.slice(0,sep);buffer=buffer.slice(sep+BLOCK_SEPARATOR.length),scanFrom=0;let frame=parseBlock(block,requestIdNow());if(frame!==null&&(frame.kind==="delta"&&(sawDelta=true),yield frame,frame.terminal))return}if(scanFrom=buffer.length>0?buffer.length-1:0,buffer.length>MAX_PENDING_BLOCK_CHARS){yield errorFrame({code:sawDelta?"CHAT_STREAM_INCOMPLETE":"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:requestIdNow()});return}}if(buffer+=decoder.decode(),buffer.trim().length>0){let frame=parseBlock(buffer,requestIdNow());if(frame!==null&&(frame.kind==="delta"&&(sawDelta=true),yield frame,frame.terminal))return}yield errorFrame({code:sawDelta?"CHAT_STREAM_INCOMPLETE":"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:requestIdNow()})}function parseBlock(block,serverRequestId){let id=null,dataLines=[];for(let rawLine of block.split(`\n`)){let line=rawLine.replace(/\s+$/,"");line.length===0||line.startsWith(":")||(line.startsWith("id:")?id=line.slice(3).trim():line.startsWith("data:")&&dataLines.push(line.slice(5).replace(/^ /,"")))}if(dataLines.length===0)return null;let decoded;try{decoded=JSON.parse(dataLines.join(`\n`))}catch{return null}if(typeof decoded!="object"||decoded===null||Array.isArray(decoded))return null;let parsed=wireObjectSchema.safeParse(decoded);return parsed.success?frameFromWire(parsed.data,id,serverRequestId):null}function frameFromWire(json,lastEventId,serverRequestId){let type=json.type,event=json.event;if(type==="error"||"error"in json)return errorFrame({code:asString(json.code)??"unknown",retryable:json.retryable===true,wireMessage:asString(json.error),synthesized:false,lastEventId:lastEventId,serverRequestId:serverRequestId});if(type==="done"||json.done===true)return doneFrame({conversationId:asString(json.conversation_id)??"",messageId:asString(json.message_id),title:asString(json.title),followUpQuestions:asStringList(json.follow_up_questions),citations:asMapList(json.citations),citationStatus:asString(json.citation_status),urgencyLevel:asUrgency(json.urgency_level),urgencyReason:asString(json.urgency_reason),urgencyProvided:urgencySlotProvided(json),resultId:asString(json.result_id),lastEventId:lastEventId},serverRequestId);if(type==="accepted"||json.status==="reasoning")return acceptedFrame(asString(json.stream_id),lastEventId,serverRequestId);if(type==="heartbeat"||json.heartbeat===true)return heartbeatFrame(lastEventId,serverRequestId);if(type==="text.delta"||"delta"in json||"token"in json){let delta=asString(json.delta)??asString(json.token)??"";return deltaFrame(delta,lastEventId,serverRequestId)}return event==="analysis_started"?analysisStartedFrame(asString(json.request_id),lastEventId,serverRequestId):event==="analysis_complete"?analysisCompleteFrame({resultId:asString(json.result_id),analysisType:asString(json.analysis_type),modelVersion:asString(json.model_version),confidence:asNumber(json.confidence),detections:asMapList(json.detections),interpretation:asString(json.interpretation),lastEventId:lastEventId},serverRequestId):unknownFrame(json,lastEventId,serverRequestId)}function asString(v){return typeof v=="string"?v:null}function asNumber(v){return typeof v=="number"&&Number.isFinite(v)?v:null}function asUrgency(v){return typeof v=="string"&&URGENCY_LEVELS.includes(v)?v:null}function urgencySlotProvided(json){if(!Object.prototype.hasOwnProperty.call(json,"urgency_level"))return false;let raw=json.urgency_level;return raw===null||asUrgency(raw)!==null}function asStringList(v){return Array.isArray(v)?v.map(e=>typeof e=="string"?e:String(e)):[]}function isPlainObject(v){return typeof v=="object"&&v!==null&&!Array.isArray(v)}function asMapList(v){return Array.isArray(v)?v.filter(isPlainObject):[]}var DAILY_QUOTA_WIRE_CODE="DAILY_QUOTA_EXCEEDED",THROTTLES=/* @__PURE__ */new Set(["THROTTLINGEXCEPTION","RATELIMITED","TOOMANYREQUESTS"]);function foldDailyQuotaWireCode(code,body){if(!THROTTLES.has(code.toUpperCase().replace(/[^A-Z0-9]/g,"")))return code;let b=body,limit=b?.daily_limit??b?.error?.daily_limit;return typeof limit=="number"&&Number.isFinite(limit)?DAILY_QUOTA_WIRE_CODE:code}var ACCESS_DENIED_COPY="This feature isn't available on your account right now.",VALIDATION_FAILED_COPY="Something in that request was not right. Check the details and try again.",USER_FACING_COPY=/* @__PURE__ */Object.freeze({authExpired:"Please sign in again to continue.",authRejected:"Please sign in again to continue.",sessionRequired:"This app needs to be updated to keep using Everfur.",accessDenied:ACCESS_DENIED_COPY,paymentRequired:"This is part of a paid plan.",quotaExceeded:"You have used today's messages. This resets tomorrow.",rateLimited:"You are sending messages quickly. Try again in a few seconds.",validationFailed:VALIDATION_FAILED_COPY,sdkUpdateRequired:"This app needs to be updated to keep using Everfur.",conflict:"That is already running. Wait for it to finish, then try again.",idempotencyConflict:"That message was already delivered.",idempotencyInFlight:"That is still processing. Give it a moment.",conversationNotFound:"This conversation is no longer available.",petNotFound:"We could not find that pet. Please pick a pet and try again.",resourceNotFound:"We could not find that.",streamTimeout:"The response timed out. Tap retry to try again.",mediaUploadFailed:"We could not upload that photo. Please attach it again.",moderationBlocked:"This request cannot be answered here.",upstreamLlmTimeout:"The response timed out. Tap retry to try again.",internalError:"We hit a snag on our end. Please try again.",notImplemented:"That is not available yet.",serviceUnavailable:"That service is briefly unavailable. Try again shortly.",streamIncomplete:"The connection dropped mid-answer. Tap retry to continue.",identitySignatureRequired:ACCESS_DENIED_COPY,runtimeDisposed:VALIDATION_FAILED_COPY,unknown:"Something went wrong. Please try again."}),SESSION_REVOKED_COPY="This session has ended. Please sign in again.",LINKED_ACCOUNT_READ_ONLY="linked_account_read_only";function displayFor(code,wireCode,reasonCode){return code==="conflict"&&reasonCode===LINKED_ACCOUNT_READ_ONLY?ACCESS_DENIED_COPY:(code==="authRejected"||code==="authExpired")&&typeof wireCode=="string"&&wireCode.trim().toLowerCase()==="session_revoked"?SESSION_REVOKED_COPY:userFacingError(code)}function userFacingError(code){return USER_FACING_COPY[code]}function defineHidden(target,key,value){Object.defineProperty(target,key,{value:value,enumerable:false,writable:false,configurable:false})}var REASON_CODE_SHAPE=/^[a-z][a-z0-9_]{0,63}$/;function makeEverfurError(code,opts){let row=contractErrorFor(opts?.wireCode,opts?.wireEnvelope),linkedReadOnly=code==="conflict"&&opts?.reasonCode===LINKED_ACCOUNT_READ_ONLY,error={code:code,category:categoryFor(code),retryable:opts?.retryable??(linkedReadOnly?false:isRetryableCode(code)),displayMessage:displayFor(code,opts?.wireCode,linkedReadOnly?LINKED_ACCOUNT_READ_ONLY:null)};opts?.httpStatus!==void 0&&(error.httpStatus=opts.httpStatus),opts?.requestId&&(error.requestId=opts.requestId),typeof opts?.reasonCode=="string"&&REASON_CODE_SHAPE.test(opts.reasonCode)&&(error.reasonCode=opts.reasonCode);let wait=opts?.retryAfterSeconds;if(typeof wait=="number"&&Number.isFinite(wait)&&wait>=0&&(error.retryAfterSeconds=Math.round(wait)),row);return opts?.wireMessage&&defineHidden(error,"wireMessage",opts.wireMessage),opts?.raw!==void 0&&opts.raw!==null&&defineHidden(error,"raw",opts.raw),/* @__PURE__ */Object.freeze(error)}async function*bufferedTextByteSource(text,splitAt=[]){let bytes=(new TextEncoder).encode(text),points=[...new Set(splitAt)].filter(n=>n>0&&n<bytes.length).sort((a,b)=>a-b),start=0;for(let point of points)yield bytes.subarray(start,point),start=point;yield bytes.subarray(start)}function errorFromResponse(status,body,requestId){let wireCode=extractWireCode(body),code=wireCode?fromWire(wireCode):fromHttpStatus(status),wireMessage=extractWireMessage(body);return makeEverfurError(code,{httpStatus:status,...extractRetryable(body)?{retryable:true}:{},...{},...wireCode?{wireCode:wireCode}:{},...extractReasonCode(body)?{reasonCode:extractReasonCode(body)}:{},...extractRetryAfterSeconds(body)!==null?{retryAfterSeconds:extractRetryAfterSeconds(body)}:{},...wireMessage?{wireMessage:wireMessage}:{},...body!=null?{raw:body}:{}})}function extractRetryAfterSeconds(body){let b=body,value=b?.retry_after_seconds??b?.error?.retry_after_seconds;return typeof value=="number"&&Number.isFinite(value)&&value>=0?value:null}function extractReasonCode(body){let b=body,reason=b?.error?.reason_code??b?.reason_code;return typeof reason=="string"&&reason.length>0?reason:null}function extractWireCode(body){let b=body,code=b?.error?.code??b?.code;return typeof code=="string"&&code.length>0?foldDailyQuotaWireCode(code,body):null}function extractWireMessage(body){let b=body,message=b?.error?.message??b?.message;return typeof message=="string"&&message.length>0?message:null}function extractRetryable(body){let b=body;return b?.error?.retryable===true||b?.retryable===true}var wire=/* @__PURE__ */Object.freeze({accepted:streamId=>JSON.stringify(streamId?{type:"accepted",stream_id:streamId}:{type:"accepted"}),heartbeat:()=>JSON.stringify({type:"heartbeat"}),delta:text=>JSON.stringify({type:"text.delta",delta:text}),done:fields=>JSON.stringify({type:"done",...fields??{}}),error:(code,retryable=false)=>JSON.stringify({type:"error",code:code,retryable:retryable})}),bodies=/* @__PURE__ */Object.freeze({pets:rows=>({pets:rows.map(row=>({pet_id:"a0000000-0000-4000-8000-000000000001",pet_ref:"pet-A",name:"Rex",species:"dog",breed:"Labrador",age_years:3,weight_kg:20,updated_at:"2026-09-18T10:00:00Z",...row}))}),uploadInitiate:overrides=>({upload_id:"b0000000-0000-4000-8000-000000000001",upload_url:"https://uploads.example.test/bucket",upload_fields:{key:"uploads/user-A/chat/photo.jpg","Content-Type":"image/jpeg",policy:"p",signature:"s"},s3_key:"uploads/user-A/chat/photo.jpg",expires_in_seconds:900,purpose:"chat_attachment",max_content_length:10485760,...overrides??{}}),feedback:overrides=>({feedback_id:"c0000000-0000-4000-8000-000000000001",feedback_type:"helpful",updated_at:"2026-09-18T10:00:00Z",...overrides??{}})});function assertRouteIsServed(method,path){let verdict=classifyRoute(method,path);if(verdict!=="known")throw verdict==="absent"?new EverfurConfigError("invalid-argument",`MockTransport: ${method} ${path} is a route the Everfur backend does NOT serve, so this call returns 404 in production. Scripting a success for it makes a green test that hides a broken integration. Known-absent routes: ${KNOWN_ABSENT_ROUTES.join(", ")}. Pass { strictPaths: false } to MockTransport only if you are deliberately testing this shape.`):new EverfurConfigError("invalid-argument",`MockTransport: ${method} ${path} is not a known partner-plane route. If the backend has gained it, add it to KNOWN_PARTNER_ROUTES in src/core/testing/knownRoutes.ts. Pass { strictPaths: false } to opt out for this transport.`)}var MockTransport=class{constructor(options={}){this.streamQueue=[];this.requestQueue=[];this.lastRequestScript=/* @__PURE__ */new Map;this.openCount=0;this.requests=[];this.streamRequests=[];this.peak=0;this.strictPaths=options.strictPaths??true}get openStreams(){return this.openCount}get peakOpenStreams(){return this.peak}enqueueStream(...scripts){return this.streamQueue.push(...scripts),this}enqueueRequest(...scripts){return this.requestQueue.push(...scripts),this}async request(req){this.strictPaths&&assertRouteIsServed(req.method,req.path);let base={method:req.method,path:req.path,headers:{...req.headers??{}},...req.query===void 0?{}:{query:{...req.query}}},record=req.body===void 0?base:{...base,body:req.body};this.requests.push(record);let endpoint=`${req.method} ${req.path}`,next=this.requestQueue.shift();next!==void 0&&this.lastRequestScript.set(endpoint,next);let script=next??this.lastRequestScript.get(endpoint)??{status:200,body:{}},status=script.status??200;return status===304||status>=400?err(errorFromResponse(status,script.body??null)):ok(script.body??{})}stream(req,signal){this.strictPaths&&assertRouteIsServed(req.method,req.path),this.streamRequests.push({path:req.path,authorization:header(req,"authorization"),partnerKey:header(req,"x-everfur-partner-key"),idempotencyKey:header(req,"idempotency-key"),...req.body===void 0?{}:{body:req.body},headers:{...req.headers??{}}});let script=this.streamQueue.shift()??{kind:"sse",blocks:[wire.done()]};return this.openStream(script,signal)}async*openStream(script,signal){this.openCount+=1,this.openCount>this.peak&&(this.peak=this.openCount);try{yield*this.runScript(script,signal)}finally{this.openCount-=1}}async*runScript(script,signal){switch(script.kind){case"httpError":{let wireCode=extractWireCode2(script.body)??statusToWireCode(script.status);yield errorFrame({code:wireCode,retryable:extractRetryable2(script.body)||isAutoRetryable(fromWire(wireCode)),wireMessage:extractWireMessage2(script.body),synthesized:true,lastEventId:null});return}case"network":yield errorFrame({code:"INTERNAL_ERROR",retryable:true,wireMessage:"network request failed",synthesized:true,lastEventId:null});return;case"partialByte":yield*parseSse(bufferedTextByteSource(script.body,script.splitAt));return;case"sse":yield*parseSse(sseByteSource(script.blocks,script.gapMs??0,signal));return;case"drop":yield*parseSse(sseByteSource(script.blocks,0,signal));return;case"stall":yield*parseSse(stallByteSource(script.preface??[],signal));return;default:return assertNever(script)}}};async function*sseByteSource(blocks,gapMs,signal){let enc=new TextEncoder,first=true;for(let block of blocks){if(signal.aborted||!first&&gapMs>0&&await abortableSleep(gapMs,signal)==="abort")return;first=false,yield enc.encode(toSseBlock(block))}}async function*stallByteSource(preface,signal){let enc=new TextEncoder;for(let block of preface){if(signal.aborted)return;yield enc.encode(toSseBlock(block))}await abortableSleep(1/0,signal)}function toSseBlock(payload){return`data: ${payload}\n\n`}function abortableSleep(ms,signal){return new Promise(resolve=>{if(signal.aborted){resolve("abort");return}let handle=null,onAbort=()=>{handle!==null&&clearTimeout(handle),signal.removeEventListener("abort",onAbort),resolve("abort")};Number.isFinite(ms)&&(handle=setTimeout(()=>{signal.removeEventListener("abort",onAbort),resolve("timeout")},ms)),signal.addEventListener("abort",onAbort,{once:true})})}function header(req,name){let headers=req.headers;if(!headers)return null;for(let[key,value]of Object.entries(headers))if(key.toLowerCase()===name)return value;return null}function extractWireCode2(body){let b=body,code=b?.error?.code??b?.code;return typeof code=="string"&&code.length>0?foldDailyQuotaWireCode(code,body):null}function extractWireMessage2(body){let b=body,message=b?.error?.message??b?.message;return typeof message=="string"&&message.length>0?message:null}function extractRetryable2(body){let b=body;return b?.error?.retryable===true||b?.retryable===true}function statusToWireCode(status){return status===401?"AUTH_EXPIRED":status===403?"ACCESS_DENIED":status===404?"NOT_FOUND":status===409?"IDEMPOTENCY_CONFLICT":status===421?"MISDIRECTED_REQUEST":status===429?"RATE_LIMITED":status===400||status===422?"INVALID_REQUEST":status>=500?"INTERNAL_ERROR":""}var CARE_MOCK_TODAY="2026-09-23",CARE_MOCK_IMG="https://care-v3-mock.everfur.invalid/img/",careMockImg=file=>`${CARE_MOCK_IMG}${file}`,CARE_MOCK_PET_RECORDS="pet-care-v3-records",CARE_MOCK_PET_NO_RECORDS="pet-care-v3-no-records",CARE_MOCK_OFFER={apoquel:"offer-apoquel",simparicaTrio:"offer-simparica-trio",salmonOil:"offer-salmon-oil",vetradent:"offer-vetradent",earWipes:"offer-ear-wipes",douxoCalm:"offer-douxo-calm",veggiedent:"offer-veggiedent",dasuquin:"offer-dasuquin",fortiflora:"offer-fortiflora",greenies:"offer-greenies",trickyTreats:"offer-tricky-treats"},careMockSlugOf=offerId=>offerId.replace(/^offer-/,""),CARE_MOCK_PRICES={[CARE_MOCK_OFFER.apoquel]:{priceCents:6499,autoPriceCents:6499,isRx:true},[CARE_MOCK_OFFER.simparicaTrio]:{priceCents:3199,autoPriceCents:null,isRx:true},[CARE_MOCK_OFFER.salmonOil]:{priceCents:3299,autoPriceCents:2969,isRx:false},[CARE_MOCK_OFFER.dasuquin]:{priceCents:2799,autoPriceCents:2519,isRx:false},[CARE_MOCK_OFFER.fortiflora]:{priceCents:2499,autoPriceCents:2249,isRx:false},[CARE_MOCK_OFFER.vetradent]:{priceCents:2199,autoPriceCents:1979,isRx:false},[CARE_MOCK_OFFER.veggiedent]:{priceCents:999,autoPriceCents:899,isRx:false},[CARE_MOCK_OFFER.greenies]:{priceCents:3999,autoPriceCents:null,isRx:false},[CARE_MOCK_OFFER.trickyTreats]:{priceCents:1100,autoPriceCents:null,isRx:false},[CARE_MOCK_OFFER.earWipes]:{priceCents:1499,autoPriceCents:null,isRx:false},[CARE_MOCK_OFFER.douxoCalm]:{priceCents:1299,autoPriceCents:null,isRx:false}},shot=slug=>careMockImg(`care-${slug}.webp`),cutout=slug=>careMockImg(`care-${slug}-mask.webp`),CARE_MOCK_ADDRESS={ref:"addr-home",label:"Home",isDefault:true,isComplete:true,address:{recipientName:null,line1:"1432 Irving St",line2:null,city:"San Francisco",region:"CA",postalCode:"94122",country:"US"}},CARE_MOCK_CARD={paymentMethodId:"pm-care-v3-mock-visa",brand:"visa",last4:"4242",wallet:null},CARE_MOCK_SHOP_CONFIG={recurringTermsVersion:"care-v3-mock",recurringTermsUrl:"https://care-v3-mock.everfur.invalid/recurring-terms",stripePublishableKey:null,delivery:null,freeShippingThresholdCents:3500,firstRxDiscountCents:5e3,firstRxDiscountCode:"VET50",firstAutoOrderPrice:null},CARE_MOCK_PACKS={[CARE_MOCK_OFFER.apoquel]:{packQuantity:"30.0",packUnit:"each"}},CARE_MOCK_PRESCRIPTIONS=[{rxId:"rx-apoquel",petId:CARE_MOCK_PET_RECORDS,drug:"Apoquel",strength:"16 mg",form:"tablet",status:"ready",offerId:CARE_MOCK_OFFER.apoquel,packCount:1,fillsUsed:null,fillsTotal:null,expiresOn:null,nextFillOn:null,supply:{unitsLeft:8,unitLabel:"tablets",dailyUnits:1,runsOutOn:"2026-10-01",refillArrivesOn:"2026-09-29"},prescriberName:"Dr. Goode",refillsTotal:null,refillsLeft:2},{rxId:"rx-simparica-trio",petId:CARE_MOCK_PET_RECORDS,drug:"Simparica Trio",strength:"44.1 to 88 lb",form:"chew",status:"ready",offerId:CARE_MOCK_OFFER.simparicaTrio,packCount:1,fillsUsed:null,fillsTotal:null,expiresOn:null,nextFillOn:"2026-10-05",supply:null,prescriberName:"Dr. Goode",refillsTotal:null,refillsLeft:8}],step=(key,doneAt)=>({key:key,doneAt:doneAt}),CARE_MOCK_ORDER_BOX_ID="order-care-v3-box-0923",CARE_MOCK_ORDER_RX_ID="order-care-v3-rx-0923",CARE_MOCK_ORDER_PAST_AUG="order-care-v3-box-0815",CARE_MOCK_ORDER_PAST_JUL="order-care-v3-box-0718",PLACED="2026-09-23T16:00:00Z",CARE_MOCK_ORDERS=[{orderId:CARE_MOCK_ORDER_BOX_ID,referenceNumber:"EF-260923-4471",status:"accepted",total:3824,placedAt:PLACED,itemCount:1,items:[{offerId:CARE_MOCK_OFFER.salmonOil,title:"Zesty Paws Salmon Oil",quantity:1,imageUrl:shot("salmon-oil"),cutoutUrl:cutout("salmon-oil")}],fulfiller:"everfur_box",arrivesBy:"2026-09-26",steps:[step("ordered_paid",PLACED),step("packing",null),step("delivered",null)],currentStep:"packing",statusLineKey:"ships_tomorrow",prescriberName:null},{orderId:CARE_MOCK_ORDER_RX_ID,referenceNumber:"EF-260923-4471",status:"pending_handoff",total:1499,placedAt:PLACED,itemCount:1,items:[{offerId:CARE_MOCK_OFFER.apoquel,title:"Apoquel 16 mg",quantity:1,imageUrl:shot("apoquel"),cutoutUrl:cutout("apoquel")}],fulfiller:"pharmacy",arrivesBy:"2026-09-29",steps:[step("ordered",PLACED),step("vet_ok",null),step("filled_checked",null),step("delivered",null)],currentStep:"vet_ok",statusLineKey:"needs_vet_ok",prescriberName:"Dr. Goode",clinicName:"Maplewood"},{orderId:CARE_MOCK_ORDER_PAST_AUG,referenceNumber:null,status:"delivered",total:5428,placedAt:"2026-08-12T16:00:00Z",itemCount:3,items:[{offerId:CARE_MOCK_OFFER.vetradent,title:"Vetradent dental chews",quantity:1,imageUrl:shot("vetradent")},{offerId:CARE_MOCK_OFFER.earWipes,title:"Zymox Ear Wipes",quantity:1,imageUrl:shot("ear-wipes")},{offerId:CARE_MOCK_OFFER.douxoCalm,title:"Douxo S3 Calm shampoo",quantity:1,imageUrl:shot("douxo-calm")}],fulfiller:"everfur_box",arrivesBy:"2026-08-15",steps:[step("ordered_paid","2026-08-12T16:00:00Z"),step("packing","2026-08-13T16:00:00Z"),step("delivered","2026-08-15T18:00:00Z")],currentStep:"delivered",statusLineKey:"delivered",prescriberName:null},{orderId:CARE_MOCK_ORDER_PAST_JUL,referenceNumber:null,status:"delivered",total:5755,placedAt:"2026-07-15T16:00:00Z",itemCount:2,items:[{offerId:CARE_MOCK_OFFER.dasuquin,title:"Dasuquin with MSM",quantity:1,imageUrl:shot("dasuquin")},{offerId:CARE_MOCK_OFFER.fortiflora,title:"FortiFlora probiotic",quantity:1,imageUrl:shot("fortiflora")}],fulfiller:"everfur_box",arrivesBy:"2026-07-18",steps:[step("ordered_paid","2026-07-15T16:00:00Z"),step("packing","2026-07-16T16:00:00Z"),step("delivered","2026-07-18T18:00:00Z")],currentStep:"delivered",statusLineKey:"delivered",prescriberName:null}],ORDER_LINES={[CARE_MOCK_ORDER_BOX_ID]:[[CARE_MOCK_OFFER.salmonOil,2969,256,false]],[CARE_MOCK_ORDER_RX_ID]:[[CARE_MOCK_OFFER.apoquel,6499,0,true]],[CARE_MOCK_ORDER_PAST_AUG]:[[CARE_MOCK_OFFER.vetradent,2199,190,false],[CARE_MOCK_OFFER.earWipes,1499,129,false],[CARE_MOCK_OFFER.douxoCalm,1299,112,false]],[CARE_MOCK_ORDER_PAST_JUL]:[[CARE_MOCK_OFFER.dasuquin,2799,241,false],[CARE_MOCK_OFFER.fortiflora,2499,216,false]]};function careMockOrderDetail(summary){let lines=(ORDER_LINES[summary.orderId]??[]).map(([offerId,unitPrice,tax2,rx],i)=>{let item=summary.items?.find(it=>it.offerId===offerId);return{lineId:`${summary.orderId}-l${i+1}`,offerId:offerId,sku:offerId,title:item?.title??offerId,requiresRx:rx,compounded:false,packQuantity:CARE_MOCK_PACKS[offerId]?.packQuantity??null,packUnit:CARE_MOCK_PACKS[offerId]?.packUnit??null,quantity:1,unitPrice:unitPrice,discount:rx?5e3:0,tax:tax2,fulfillmentType:rx?"pharmacy":"everfur_box",petId:CARE_MOCK_PET_RECORDS,imageUrl:item?.imageUrl??null}}),subtotal=lines.reduce((s,l)=>s+l.unitPrice*l.quantity,0),discount=lines.reduce((s,l)=>s+l.discount,0),tax=lines.reduce((s,l)=>s+l.tax,0),delivered=summary.status==="delivered";return{summary:summary,lines:lines,shipping:summary.orderId===CARE_MOCK_ORDER_BOX_ID?599:0,shippingTax:0,shipments:[],canCancel:!delivered,canReturn:false,canPay:false,paymentStatus:delivered||summary.status==="shipped"?"captured":"authorized",refunds:[],returnIds:[],subtotal:subtotal,discount:discount,tax:tax,arrivesBy:summary.arrivesBy??null,tracking:null,steps:(summary.steps??[]).map(s=>({key:s.key,done:s.doneAt!=null,at:s.doneAt})),paymentMethodId:CARE_MOCK_CARD.paymentMethodId}}var CARE_MOCK_PLANS=[{planId:"plan-care-v3-simparica",lines:[{offerId:CARE_MOCK_OFFER.simparicaTrio,quantity:1,petId:CARE_MOCK_PET_RECORDS}],cadenceDays:30,destination:CARE_MOCK_ADDRESS.ref,paymentMethodId:CARE_MOCK_CARD.paymentMethodId,discountBps:0,nextRun:"2026-10-05",state:"active",stopReason:null,priceCentsPerCycle:3199,chargedWhenFilled:true,nextShipOn:"2026-10-05",skippedCycleOn:null,prescriberName:"Dr. Goode",refillsLeft:8,refillsTotal:null,autoDiscountPct:null,changeOptions:[changeOption(CARE_MOCK_OFFER.simparicaTrio,"Simparica Trio","1 chew",1,3199,[30],true),changeOption(CARE_MOCK_OFFER.simparicaTrio,"Simparica Trio","3 chews",3,9597,[90],false)]},{planId:"plan-care-v3-apoquel",lines:[{offerId:CARE_MOCK_OFFER.apoquel,quantity:1,petId:CARE_MOCK_PET_RECORDS}],cadenceDays:30,destination:CARE_MOCK_ADDRESS.ref,paymentMethodId:CARE_MOCK_CARD.paymentMethodId,discountBps:0,nextRun:"2026-10-27",state:"active",stopReason:null,priceCentsPerCycle:6499,chargedWhenFilled:true,nextShipOn:"2026-10-27",skippedCycleOn:null,prescriberName:"Dr. Goode",refillsLeft:2,refillsTotal:null,autoDiscountPct:null,changeOptions:[changeOption(CARE_MOCK_OFFER.apoquel,"Apoquel 16 mg","30 tablets",1,6499,[30],true),changeOption(CARE_MOCK_OFFER.apoquel,"Apoquel 16 mg","60 tablets",2,12998,[60],false)]},{planId:"plan-care-v3-salmon-oil",lines:[{offerId:CARE_MOCK_OFFER.salmonOil,quantity:1,petId:CARE_MOCK_PET_RECORDS}],cadenceDays:120,destination:CARE_MOCK_ADDRESS.ref,paymentMethodId:CARE_MOCK_CARD.paymentMethodId,discountBps:1e3,nextRun:"2027-01-21",state:"active",stopReason:null,priceCentsPerCycle:2969,chargedWhenFilled:false,nextShipOn:"2027-01-21",skippedCycleOn:null,prescriberName:null,refillsLeft:null,refillsTotal:null,autoDiscountPct:10,changeOptions:[changeOption(CARE_MOCK_OFFER.salmonOil,"Zesty Paws Salmon Oil","32 fl oz",1,2969,[60,90,120,180],true)]}],CARE_MOCK_PLAN_SKIP_WARNINGS={"plan-care-v3-simparica":{key:"last_dose",values:{unitLabel:"chew",doseOn:"2026-10-01",noneFor:"2026-11-01",lastsTo:null,weeks:null}},"plan-care-v3-apoquel":{key:"bottle_gap",values:{unitLabel:null,doseOn:null,noneFor:null,lastsTo:"2026-10-30",weeks:4}}};function changeOption(offerId,title,size,quantity,priceCentsPerCycle,cadenceDays,current){return{offerId:offerId,title:title,size:size,packQuantity:null,packUnit:null,unitLabel:null,quantity:quantity,priceCentsPerCycle:priceCentsPerCycle,cadenceDays:cadenceDays,current:current}}var CARE_MOCK_BUY_AGAIN=[{offerId:CARE_MOCK_OFFER.vetradent,title:"Vetradent chews",imageUrl:shot("vetradent"),priceCents:2199,lastOrderedOn:"2026-08-15",isRx:false,likelyOut:true},{offerId:CARE_MOCK_OFFER.earWipes,title:"Zymox Ear Wipes",imageUrl:shot("ear-wipes"),priceCents:1499,lastOrderedOn:"2026-08-15",isRx:false,likelyOut:false},{offerId:CARE_MOCK_OFFER.douxoCalm,title:"Douxo Calm shampoo",imageUrl:shot("douxo-calm"),priceCents:1299,lastOrderedOn:"2026-08-15",isRx:false,likelyOut:false},{offerId:CARE_MOCK_OFFER.dasuquin,title:"Dasuquin with MSM",imageUrl:shot("dasuquin"),priceCents:2799,lastOrderedOn:"2026-07-18",isRx:false,likelyOut:false}],CARE_MOCK_TAX_RATE=.08625;function careMockQuote(lines,config=CARE_MOCK_SHOP_CONFIG){let prices=CARE_MOCK_PRICES,rate=config.taxRate??CARE_MOCK_TAX_RATE,offLeft=config.firstRxDiscountCents??0,priced=lines.map(l=>{let p=prices[l.offerId],unitPrice=p?.priceCents??0,isRx=p?.isRx===true,auto=p?.autoPriceCents,cut=config.firstAutoOrderPrice==="auto"&&l.plan==="auto"&&typeof auto=="number"&&auto<unitPrice?(unitPrice-auto)*l.quantity:0,off2=isRx?Math.min(offLeft,unitPrice*l.quantity-cut):0;return offLeft-=off2,{l:l,unitPrice:unitPrice,isRx:isRx,off:off2,cut:cut,net:unitPrice*l.quantity-cut}}),box=priced.filter(x=>!x.isRx).reduce((s,x)=>s+x.net,0),rx=priced.filter(x=>x.isRx).reduce((s,x)=>s+x.net,0),off=priced.reduce((s,x)=>s+x.off,0),tax=Math.round(box*rate),taxLeft=tax,boxLines=priced.filter(x=>!x.isRx);return{lines:priced.map(x=>{let lineTax=0;return!x.isRx&&box>0&&(lineTax=x===boxLines[boxLines.length-1]?taxLeft:Math.round(x.net*tax/box),taxLeft-=lineTax),{offerId:x.l.offerId,quantity:x.l.quantity,petId:x.l.petId??null,unitPrice:x.unitPrice,discount:x.cut+x.off,tax:lineTax,whenFilledDiscountCents:x.isRx?x.off:null,isRx:x.isRx,chargedWhenFilled:x.isRx}}),shipping:0,tax:tax,total:box+tax+rx-off,expiresAt:"2026-09-23T17:00:00Z",shipsOn:"2026-09-24",arrivesOn:"2026-09-26",whenFilledDiscountCents:off,dueTodayCents:box+tax,dueWhenFilledCents:rx-off}}export{CARE_MOCK_ADDRESS,CARE_MOCK_BUY_AGAIN,CARE_MOCK_CARD,CARE_MOCK_IMG,CARE_MOCK_OFFER,CARE_MOCK_ORDERS,CARE_MOCK_ORDER_BOX_ID,CARE_MOCK_ORDER_PAST_AUG,CARE_MOCK_ORDER_PAST_JUL,CARE_MOCK_ORDER_RX_ID,CARE_MOCK_PACKS,CARE_MOCK_PET_NO_RECORDS,CARE_MOCK_PET_RECORDS,CARE_MOCK_PLANS,CARE_MOCK_PLAN_SKIP_WARNINGS,CARE_MOCK_PRESCRIPTIONS,CARE_MOCK_PRICES,CARE_MOCK_SHOP_CONFIG,CARE_MOCK_TAX_RATE,CARE_MOCK_TODAY,MockTransport,bodies,careMockImg,careMockOrderDetail,careMockQuote,careMockSlugOf,wire};
|
|
105
|
+
return Object.freeze({kind:"unknown",raw:{...raw},lastEventId:lastEventId,serverRequestId:serverRequestId,terminal:false})}function createFallbackUtf8Decoder(){let pending=[];return{decode(input,options){let stream=options?.stream===true,bytes=pending.length>0?pending.slice():[];if(input!==void 0)for(let i2=0;i2<input.length;i2+=1)bytes.push(input[i2]);pending=[];let out="",i=0;for(;i<bytes.length;){let b0=bytes[i];if(b0<128){out+=String.fromCharCode(b0),i+=1;continue}let need,lower=128,upper=191,cp;if(b0>=194&&b0<=223)need=1,cp=b0&31;else if(b0>=224&&b0<=239)need=2,cp=b0&15,b0===224&&(lower=160),b0===237&&(upper=159);else if(b0>=240&&b0<=244)need=3,cp=b0&7,b0===240&&(lower=144),b0===244&&(upper=143);else{out+="�",i+=1;continue}let j=1,valid=true;for(;j<=need&&!(i+j>=bytes.length);){let b=bytes[i+j],lo=j===1?lower:128,hi=j===1?upper:191;if(b<lo||b>hi){valid=false;break}cp=cp<<6|b&63,j+=1}if(!valid){out+="�",i+=j;continue}if(j<=need){stream?pending=bytes.slice(i):out+="�";break}out+=String.fromCodePoint(cp),i+=need+1}return out}}}function createUtf8Decoder(){let Native=globalThis.TextDecoder;return typeof Native=="function"?new Native("utf-8"):createFallbackUtf8Decoder()}var BLOCK_SEPARATOR=`\n\n`,MAX_PENDING_BLOCK_CHARS=1048576,wireObjectSchema=/* @__PURE__ */z.record(/* @__PURE__ */z.string(),/* @__PURE__ */z.unknown()),URGENCY_LEVELS=["emergency","schedule_soon","home_care"];async function*parseSse(bytes,serverRequestId=null){let resolvedRequestId=null,requestIdNow=()=>(resolvedRequestId!==null||(resolvedRequestId=typeof serverRequestId=="function"?serverRequestId():serverRequestId),resolvedRequestId),decoder=createUtf8Decoder(),buffer="",scanFrom=0,sawDelta=false;for await(let chunk of bytes){for(buffer+=decoder.decode(chunk,{stream:true});;){let sep=buffer.indexOf(BLOCK_SEPARATOR,scanFrom);if(sep===-1)break;let block=buffer.slice(0,sep);buffer=buffer.slice(sep+BLOCK_SEPARATOR.length),scanFrom=0;let frame=parseBlock(block,requestIdNow());if(frame!==null&&(frame.kind==="delta"&&(sawDelta=true),yield frame,frame.terminal))return}if(scanFrom=buffer.length>0?buffer.length-1:0,buffer.length>MAX_PENDING_BLOCK_CHARS){yield errorFrame({code:sawDelta?"CHAT_STREAM_INCOMPLETE":"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:requestIdNow()});return}}if(buffer+=decoder.decode(),buffer.trim().length>0){let frame=parseBlock(buffer,requestIdNow());if(frame!==null&&(frame.kind==="delta"&&(sawDelta=true),yield frame,frame.terminal))return}yield errorFrame({code:sawDelta?"CHAT_STREAM_INCOMPLETE":"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:requestIdNow()})}function parseBlock(block,serverRequestId){let id=null,dataLines=[];for(let rawLine of block.split(`\n`)){let line=rawLine.replace(/\s+$/,"");line.length===0||line.startsWith(":")||(line.startsWith("id:")?id=line.slice(3).trim():line.startsWith("data:")&&dataLines.push(line.slice(5).replace(/^ /,"")))}if(dataLines.length===0)return null;let decoded;try{decoded=JSON.parse(dataLines.join(`\n`))}catch{return null}if(typeof decoded!="object"||decoded===null||Array.isArray(decoded))return null;let parsed=wireObjectSchema.safeParse(decoded);return parsed.success?frameFromWire(parsed.data,id,serverRequestId):null}function frameFromWire(json,lastEventId,serverRequestId){let type=json.type,event=json.event;if(type==="error"||"error"in json)return errorFrame({code:asString(json.code)??"unknown",retryable:json.retryable===true,wireMessage:asString(json.error),synthesized:false,lastEventId:lastEventId,serverRequestId:serverRequestId});if(type==="done"||json.done===true)return doneFrame({conversationId:asString(json.conversation_id)??"",messageId:asString(json.message_id),title:asString(json.title),followUpQuestions:asStringList(json.follow_up_questions),citations:asMapList(json.citations),citationStatus:asString(json.citation_status),urgencyLevel:asUrgency(json.urgency_level),urgencyReason:asString(json.urgency_reason),urgencyProvided:urgencySlotProvided(json),resultId:asString(json.result_id),lastEventId:lastEventId},serverRequestId);if(type==="accepted"||json.status==="reasoning")return acceptedFrame(asString(json.stream_id),lastEventId,serverRequestId);if(type==="heartbeat"||json.heartbeat===true)return heartbeatFrame(lastEventId,serverRequestId);if(type==="text.delta"||"delta"in json||"token"in json){let delta=asString(json.delta)??asString(json.token)??"";return deltaFrame(delta,lastEventId,serverRequestId)}return event==="analysis_started"?analysisStartedFrame(asString(json.request_id),lastEventId,serverRequestId):event==="analysis_complete"?analysisCompleteFrame({resultId:asString(json.result_id),analysisType:asString(json.analysis_type),modelVersion:asString(json.model_version),confidence:asNumber(json.confidence),detections:asMapList(json.detections),interpretation:asString(json.interpretation),lastEventId:lastEventId},serverRequestId):unknownFrame(json,lastEventId,serverRequestId)}function asString(v){return typeof v=="string"?v:null}function asNumber(v){return typeof v=="number"&&Number.isFinite(v)?v:null}function asUrgency(v){return typeof v=="string"&&URGENCY_LEVELS.includes(v)?v:null}function urgencySlotProvided(json){if(!Object.prototype.hasOwnProperty.call(json,"urgency_level"))return false;let raw=json.urgency_level;return raw===null||asUrgency(raw)!==null}function asStringList(v){return Array.isArray(v)?v.map(e=>typeof e=="string"?e:String(e)):[]}function isPlainObject(v){return typeof v=="object"&&v!==null&&!Array.isArray(v)}function asMapList(v){return Array.isArray(v)?v.filter(isPlainObject):[]}var DAILY_QUOTA_WIRE_CODE="DAILY_QUOTA_EXCEEDED",THROTTLES=/* @__PURE__ */new Set(["THROTTLINGEXCEPTION","RATELIMITED","TOOMANYREQUESTS"]);function foldDailyQuotaWireCode(code,body){if(!THROTTLES.has(code.toUpperCase().replace(/[^A-Z0-9]/g,"")))return code;let b=body,limit=b?.daily_limit??b?.error?.daily_limit;return typeof limit=="number"&&Number.isFinite(limit)?DAILY_QUOTA_WIRE_CODE:code}var ACCESS_DENIED_COPY="This feature isn't available on your account right now.",VALIDATION_FAILED_COPY="Something in that request was not right. Check the details and try again.",USER_FACING_COPY=/* @__PURE__ */Object.freeze({authExpired:"Please sign in again to continue.",authRejected:"Please sign in again to continue.",sessionRequired:"This app needs to be updated to keep using Everfur.",accessDenied:ACCESS_DENIED_COPY,paymentRequired:"This is part of a paid plan.",quotaExceeded:"You have used today's messages. This resets tomorrow.",rateLimited:"You are sending messages quickly. Try again in a few seconds.",validationFailed:VALIDATION_FAILED_COPY,sdkUpdateRequired:"This app needs to be updated to keep using Everfur.",conflict:"That is already running. Wait for it to finish, then try again.",idempotencyConflict:"That message was already delivered.",idempotencyInFlight:"That is still processing. Give it a moment.",conversationNotFound:"This conversation is no longer available.",petNotFound:"We could not find that pet. Please pick a pet and try again.",resourceNotFound:"We could not find that.",streamTimeout:"The response timed out. Tap retry to try again.",mediaUploadFailed:"We could not upload that photo. Please attach it again.",moderationBlocked:"This request cannot be answered here.",upstreamLlmTimeout:"The response timed out. Tap retry to try again.",internalError:"We hit a snag on our end. Please try again.",notImplemented:"That is not available yet.",serviceUnavailable:"That service is briefly unavailable. Try again shortly.",streamIncomplete:"The connection dropped mid-answer. Tap retry to continue.",identitySignatureRequired:ACCESS_DENIED_COPY,runtimeDisposed:VALIDATION_FAILED_COPY,unknown:"Something went wrong. Please try again."}),SESSION_REVOKED_COPY="This session has ended. Please sign in again.",LINKED_ACCOUNT_READ_ONLY="linked_account_read_only";function displayFor(code,wireCode,reasonCode){return code==="conflict"&&reasonCode===LINKED_ACCOUNT_READ_ONLY?ACCESS_DENIED_COPY:(code==="authRejected"||code==="authExpired")&&typeof wireCode=="string"&&wireCode.trim().toLowerCase()==="session_revoked"?SESSION_REVOKED_COPY:userFacingError(code)}function userFacingError(code){return USER_FACING_COPY[code]}function defineHidden(target,key,value){Object.defineProperty(target,key,{value:value,enumerable:false,writable:false,configurable:false})}var REASON_CODE_SHAPE=/^[a-z][a-z0-9_]{0,63}$/;function makeEverfurError(code,opts){let row=contractErrorFor(opts?.wireCode,opts?.wireEnvelope),linkedReadOnly=code==="conflict"&&opts?.reasonCode===LINKED_ACCOUNT_READ_ONLY,error={code:code,category:categoryFor(code),retryable:opts?.retryable??(linkedReadOnly?false:isRetryableCode(code)),displayMessage:displayFor(code,opts?.wireCode,linkedReadOnly?LINKED_ACCOUNT_READ_ONLY:null)};opts?.httpStatus!==void 0&&(error.httpStatus=opts.httpStatus),opts?.requestId&&(error.requestId=opts.requestId),typeof opts?.reasonCode=="string"&&REASON_CODE_SHAPE.test(opts.reasonCode)&&(error.reasonCode=opts.reasonCode);let wait=opts?.retryAfterSeconds;if(typeof wait=="number"&&Number.isFinite(wait)&&wait>=0&&(error.retryAfterSeconds=Math.round(wait)),row);return opts?.wireMessage&&defineHidden(error,"wireMessage",opts.wireMessage),opts?.raw!==void 0&&opts.raw!==null&&defineHidden(error,"raw",opts.raw),/* @__PURE__ */Object.freeze(error)}async function*bufferedTextByteSource(text,splitAt=[]){let bytes=(new TextEncoder).encode(text),points=[...new Set(splitAt)].filter(n=>n>0&&n<bytes.length).sort((a,b)=>a-b),start=0;for(let point of points)yield bytes.subarray(start,point),start=point;yield bytes.subarray(start)}function errorFromResponse(status,body,requestId){let wireCode=extractWireCode(body),code=wireCode?fromWire(wireCode):fromHttpStatus(status),wireMessage=extractWireMessage(body);return makeEverfurError(code,{httpStatus:status,...extractRetryable(body)?{retryable:true}:{},...{},...wireCode?{wireCode:wireCode}:{},...extractReasonCode(body)?{reasonCode:extractReasonCode(body)}:{},...extractRetryAfterSeconds(body)!==null?{retryAfterSeconds:extractRetryAfterSeconds(body)}:{},...wireMessage?{wireMessage:wireMessage}:{},...body!=null?{raw:body}:{}})}function extractRetryAfterSeconds(body){let b=body,value=b?.retry_after_seconds??b?.error?.retry_after_seconds;return typeof value=="number"&&Number.isFinite(value)&&value>=0?value:null}function extractReasonCode(body){let b=body,reason=b?.error?.reason_code??b?.reason_code;return typeof reason=="string"&&reason.length>0?reason:null}function extractWireCode(body){let b=body,code=b?.error?.code??b?.code;return typeof code=="string"&&code.length>0?foldDailyQuotaWireCode(code,body):null}function extractWireMessage(body){let b=body,message=b?.error?.message??b?.message;return typeof message=="string"&&message.length>0?message:null}function extractRetryable(body){let b=body;return b?.error?.retryable===true||b?.retryable===true}var wire=/* @__PURE__ */Object.freeze({accepted:streamId=>JSON.stringify(streamId?{type:"accepted",stream_id:streamId}:{type:"accepted"}),heartbeat:()=>JSON.stringify({type:"heartbeat"}),delta:text=>JSON.stringify({type:"text.delta",delta:text}),done:fields=>JSON.stringify({type:"done",...fields??{}}),error:(code,retryable=false)=>JSON.stringify({type:"error",code:code,retryable:retryable})}),bodies=/* @__PURE__ */Object.freeze({pets:rows=>({pets:rows.map(row=>({pet_id:"a0000000-0000-4000-8000-000000000001",pet_ref:"pet-A",name:"Rex",species:"dog",breed:"Labrador",age_years:3,weight_kg:20,updated_at:"2026-09-18T10:00:00Z",...row}))}),uploadInitiate:overrides=>({upload_id:"b0000000-0000-4000-8000-000000000001",upload_url:"https://uploads.example.test/bucket",upload_fields:{key:"uploads/user-A/chat/photo.jpg","Content-Type":"image/jpeg",policy:"p",signature:"s"},s3_key:"uploads/user-A/chat/photo.jpg",expires_in_seconds:900,purpose:"chat_attachment",max_content_length:10485760,...overrides??{}}),feedback:overrides=>({feedback_id:"c0000000-0000-4000-8000-000000000001",feedback_type:"helpful",updated_at:"2026-09-18T10:00:00Z",...overrides??{}})});function assertRouteIsServed(method,path){let verdict=classifyRoute(method,path);if(verdict!=="known")throw verdict==="absent"?new EverfurConfigError("invalid-argument",`MockTransport: ${method} ${path} is a route the Everfur backend does NOT serve, so this call returns 404 in production. Scripting a success for it makes a green test that hides a broken integration. Known-absent routes: ${KNOWN_ABSENT_ROUTES.join(", ")}. Pass { strictPaths: false } to MockTransport only if you are deliberately testing this shape.`):new EverfurConfigError("invalid-argument",`MockTransport: ${method} ${path} is not a known partner-plane route. If the backend has gained it, add it to KNOWN_PARTNER_ROUTES in src/core/testing/knownRoutes.ts. Pass { strictPaths: false } to opt out for this transport.`)}var MockTransport=class{constructor(options={}){this.streamQueue=[];this.requestQueue=[];this.lastRequestScript=/* @__PURE__ */new Map;this.openCount=0;this.requests=[];this.streamRequests=[];this.peak=0;this.strictPaths=options.strictPaths??true}get openStreams(){return this.openCount}get peakOpenStreams(){return this.peak}enqueueStream(...scripts){return this.streamQueue.push(...scripts),this}enqueueRequest(...scripts){return this.requestQueue.push(...scripts),this}async request(req){this.strictPaths&&assertRouteIsServed(req.method,req.path);let base={method:req.method,path:req.path,headers:{...req.headers??{}},...req.query===void 0?{}:{query:{...req.query}}},record=req.body===void 0?base:{...base,body:req.body};this.requests.push(record);let endpoint=`${req.method} ${req.path}`,next=this.requestQueue.shift();next!==void 0&&this.lastRequestScript.set(endpoint,next);let script=next??this.lastRequestScript.get(endpoint)??{status:200,body:{}},status=script.status??200;return status===304||status>=400?err(errorFromResponse(status,script.body??null)):ok(script.body??{})}stream(req,signal){this.strictPaths&&assertRouteIsServed(req.method,req.path),this.streamRequests.push({path:req.path,authorization:header(req,"authorization"),partnerKey:header(req,"x-everfur-partner-key"),idempotencyKey:header(req,"idempotency-key"),...req.body===void 0?{}:{body:req.body},headers:{...req.headers??{}}});let script=this.streamQueue.shift()??{kind:"sse",blocks:[wire.done()]};return this.openStream(script,signal)}async*openStream(script,signal){this.openCount+=1,this.openCount>this.peak&&(this.peak=this.openCount);try{yield*this.runScript(script,signal)}finally{this.openCount-=1}}async*runScript(script,signal){switch(script.kind){case"httpError":{let wireCode=extractWireCode2(script.body)??statusToWireCode(script.status);yield errorFrame({code:wireCode,retryable:extractRetryable2(script.body)||isAutoRetryable(fromWire(wireCode)),wireMessage:extractWireMessage2(script.body),synthesized:true,lastEventId:null});return}case"network":yield errorFrame({code:"INTERNAL_ERROR",retryable:true,wireMessage:"network request failed",synthesized:true,lastEventId:null});return;case"partialByte":yield*parseSse(bufferedTextByteSource(script.body,script.splitAt));return;case"sse":yield*parseSse(sseByteSource(script.blocks,script.gapMs??0,signal));return;case"drop":yield*parseSse(sseByteSource(script.blocks,0,signal));return;case"stall":yield*parseSse(stallByteSource(script.preface??[],signal));return;default:return assertNever(script)}}};async function*sseByteSource(blocks,gapMs,signal){let enc=new TextEncoder,first=true;for(let block of blocks){if(signal.aborted||!first&&gapMs>0&&await abortableSleep(gapMs,signal)==="abort")return;first=false,yield enc.encode(toSseBlock(block))}}async function*stallByteSource(preface,signal){let enc=new TextEncoder;for(let block of preface){if(signal.aborted)return;yield enc.encode(toSseBlock(block))}await abortableSleep(1/0,signal)}function toSseBlock(payload){return`data: ${payload}\n\n`}function abortableSleep(ms,signal){return new Promise(resolve=>{if(signal.aborted){resolve("abort");return}let handle=null,onAbort=()=>{handle!==null&&clearTimeout(handle),signal.removeEventListener("abort",onAbort),resolve("abort")};Number.isFinite(ms)&&(handle=setTimeout(()=>{signal.removeEventListener("abort",onAbort),resolve("timeout")},ms)),signal.addEventListener("abort",onAbort,{once:true})})}function header(req,name){let headers=req.headers;if(!headers)return null;for(let[key,value]of Object.entries(headers))if(key.toLowerCase()===name)return value;return null}function extractWireCode2(body){let b=body,code=b?.error?.code??b?.code;return typeof code=="string"&&code.length>0?foldDailyQuotaWireCode(code,body):null}function extractWireMessage2(body){let b=body,message=b?.error?.message??b?.message;return typeof message=="string"&&message.length>0?message:null}function extractRetryable2(body){let b=body;return b?.error?.retryable===true||b?.retryable===true}function statusToWireCode(status){return status===401?"AUTH_EXPIRED":status===403?"ACCESS_DENIED":status===404?"NOT_FOUND":status===409?"IDEMPOTENCY_CONFLICT":status===421?"MISDIRECTED_REQUEST":status===429?"RATE_LIMITED":status===400||status===422?"INVALID_REQUEST":status>=500?"INTERNAL_ERROR":""}var CARE_MOCK_TODAY="2026-09-23",CARE_MOCK_IMG="https://care-v3-mock.everfur.invalid/img/",careMockImg=file=>`${CARE_MOCK_IMG}${file}`,CARE_MOCK_PET_RECORDS="pet-care-v3-records",CARE_MOCK_PET_NO_RECORDS="pet-care-v3-no-records",CARE_MOCK_OFFER={apoquel:"offer-apoquel",simparicaTrio:"offer-simparica-trio",salmonOil:"offer-salmon-oil",vetradent:"offer-vetradent",earWipes:"offer-ear-wipes",douxoCalm:"offer-douxo-calm",veggiedent:"offer-veggiedent",dasuquin:"offer-dasuquin",fortiflora:"offer-fortiflora",greenies:"offer-greenies",trickyTreats:"offer-tricky-treats"},careMockSlugOf=offerId=>offerId.replace(/^offer-/,""),CARE_MOCK_PRICES={[CARE_MOCK_OFFER.apoquel]:{priceCents:6499,autoPriceCents:6499,isRx:true},[CARE_MOCK_OFFER.simparicaTrio]:{priceCents:3199,autoPriceCents:null,isRx:true},[CARE_MOCK_OFFER.salmonOil]:{priceCents:3299,autoPriceCents:2969,isRx:false},[CARE_MOCK_OFFER.dasuquin]:{priceCents:2799,autoPriceCents:2519,isRx:false},[CARE_MOCK_OFFER.fortiflora]:{priceCents:2499,autoPriceCents:2249,isRx:false},[CARE_MOCK_OFFER.vetradent]:{priceCents:2199,autoPriceCents:1979,isRx:false},[CARE_MOCK_OFFER.veggiedent]:{priceCents:999,autoPriceCents:899,isRx:false},[CARE_MOCK_OFFER.greenies]:{priceCents:3999,autoPriceCents:null,isRx:false},[CARE_MOCK_OFFER.trickyTreats]:{priceCents:1100,autoPriceCents:null,isRx:false},[CARE_MOCK_OFFER.earWipes]:{priceCents:1499,autoPriceCents:null,isRx:false},[CARE_MOCK_OFFER.douxoCalm]:{priceCents:1299,autoPriceCents:null,isRx:false}},shot=slug=>careMockImg(`care-${slug}.webp`),cutout=slug=>careMockImg(`care-${slug}-mask.webp`),CARE_MOCK_ADDRESS={ref:"addr-home",label:"Home",isDefault:true,isComplete:true,address:{recipientName:null,line1:"1432 Irving St",line2:null,city:"San Francisco",region:"CA",postalCode:"94122",country:"US"}},CARE_MOCK_CARD={paymentMethodId:"pm-care-v3-mock-visa",brand:"visa",last4:"4242",wallet:null},CARE_MOCK_SHOP_CONFIG={recurringTermsVersion:"care-v3-mock",recurringTermsUrl:"https://care-v3-mock.everfur.invalid/recurring-terms",stripePublishableKey:null,delivery:null,freeShippingThresholdCents:3500,firstRxDiscountCents:5e3,firstRxDiscountCode:"VET50",firstAutoOrderPrice:null},CARE_MOCK_PACKS={[CARE_MOCK_OFFER.apoquel]:{packQuantity:"30.0",packUnit:"each"}},CARE_MOCK_PRESCRIPTIONS=[{rxId:"rx-apoquel",petId:CARE_MOCK_PET_RECORDS,drug:"Apoquel",strength:"16 mg",form:"tablet",status:"ready",offerId:CARE_MOCK_OFFER.apoquel,packCount:1,fillsUsed:null,fillsTotal:null,expiresOn:null,nextFillOn:null,supply:{unitsLeft:8,unitLabel:"tablets",dailyUnits:1,runsOutOn:"2026-10-01",refillArrivesOn:"2026-09-29"},prescriberName:"Dr. Goode",refillsTotal:null,refillsLeft:2},{rxId:"rx-simparica-trio",petId:CARE_MOCK_PET_RECORDS,drug:"Simparica Trio",strength:"44.1 to 88 lb",form:"chew",status:"ready",offerId:CARE_MOCK_OFFER.simparicaTrio,packCount:1,fillsUsed:null,fillsTotal:null,expiresOn:null,nextFillOn:"2026-10-05",supply:null,prescriberName:"Dr. Goode",refillsTotal:null,refillsLeft:8}],step=(key,doneAt)=>({key:key,doneAt:doneAt}),CARE_MOCK_ORDER_BOX_ID="order-care-v3-box-0923",CARE_MOCK_ORDER_RX_ID="order-care-v3-rx-0923",CARE_MOCK_ORDER_PAST_AUG="order-care-v3-box-0815",CARE_MOCK_ORDER_PAST_JUL="order-care-v3-box-0718",PLACED="2026-09-23T16:00:00Z",CARE_MOCK_ORDERS=[{orderId:CARE_MOCK_ORDER_BOX_ID,referenceNumber:"EF-260923-4471",status:"accepted",total:3824,placedAt:PLACED,itemCount:1,items:[{offerId:CARE_MOCK_OFFER.salmonOil,title:"Zesty Paws Salmon Oil",quantity:1,imageUrl:shot("salmon-oil"),cutoutUrl:cutout("salmon-oil")}],fulfiller:"everfur_box",arrivesBy:"2026-09-26",steps:[step("ordered_paid",PLACED),step("packing",null),step("delivered",null)],currentStep:"packing",statusLineKey:"ships_tomorrow",prescriberName:null},{orderId:CARE_MOCK_ORDER_RX_ID,referenceNumber:"EF-260923-4471",status:"pending_handoff",total:1499,placedAt:PLACED,itemCount:1,items:[{offerId:CARE_MOCK_OFFER.apoquel,title:"Apoquel 16 mg",quantity:1,imageUrl:shot("apoquel"),cutoutUrl:cutout("apoquel")}],fulfiller:"pharmacy",arrivesBy:"2026-09-29",steps:[step("ordered",PLACED),step("vet_ok",null),step("filled_checked",null),step("delivered",null)],currentStep:"vet_ok",statusLineKey:"needs_vet_ok",prescriberName:"Dr. Goode",clinicName:"Maplewood"},{orderId:CARE_MOCK_ORDER_PAST_AUG,referenceNumber:null,status:"delivered",total:5428,placedAt:"2026-08-12T16:00:00Z",itemCount:3,items:[{offerId:CARE_MOCK_OFFER.vetradent,title:"Vetradent dental chews",quantity:1,imageUrl:shot("vetradent")},{offerId:CARE_MOCK_OFFER.earWipes,title:"Zymox Ear Wipes",quantity:1,imageUrl:shot("ear-wipes")},{offerId:CARE_MOCK_OFFER.douxoCalm,title:"Douxo S3 Calm shampoo",quantity:1,imageUrl:shot("douxo-calm")}],fulfiller:"everfur_box",arrivesBy:"2026-08-15",steps:[step("ordered_paid","2026-08-12T16:00:00Z"),step("packing","2026-08-13T16:00:00Z"),step("delivered","2026-08-15T18:00:00Z")],currentStep:"delivered",statusLineKey:"delivered",prescriberName:null},{orderId:CARE_MOCK_ORDER_PAST_JUL,referenceNumber:null,status:"delivered",total:5755,placedAt:"2026-07-15T16:00:00Z",itemCount:2,items:[{offerId:CARE_MOCK_OFFER.dasuquin,title:"Dasuquin with MSM",quantity:1,imageUrl:shot("dasuquin")},{offerId:CARE_MOCK_OFFER.fortiflora,title:"FortiFlora probiotic",quantity:1,imageUrl:shot("fortiflora")}],fulfiller:"everfur_box",arrivesBy:"2026-07-18",steps:[step("ordered_paid","2026-07-15T16:00:00Z"),step("packing","2026-07-16T16:00:00Z"),step("delivered","2026-07-18T18:00:00Z")],currentStep:"delivered",statusLineKey:"delivered",prescriberName:null}],ORDER_LINES={[CARE_MOCK_ORDER_BOX_ID]:[[CARE_MOCK_OFFER.salmonOil,2969,256,false]],[CARE_MOCK_ORDER_RX_ID]:[[CARE_MOCK_OFFER.apoquel,6499,0,true]],[CARE_MOCK_ORDER_PAST_AUG]:[[CARE_MOCK_OFFER.vetradent,2199,190,false],[CARE_MOCK_OFFER.earWipes,1499,129,false],[CARE_MOCK_OFFER.douxoCalm,1299,112,false]],[CARE_MOCK_ORDER_PAST_JUL]:[[CARE_MOCK_OFFER.dasuquin,2799,241,false],[CARE_MOCK_OFFER.fortiflora,2499,216,false]]};function careMockOrderDetail(summary){let lines=(ORDER_LINES[summary.orderId]??[]).map(([offerId,unitPrice,tax2,rx],i)=>{let item=summary.items?.find(it=>it.offerId===offerId);return{lineId:`${summary.orderId}-l${i+1}`,offerId:offerId,sku:offerId,title:item?.title??offerId,requiresRx:rx,compounded:false,packQuantity:CARE_MOCK_PACKS[offerId]?.packQuantity??null,packUnit:CARE_MOCK_PACKS[offerId]?.packUnit??null,quantity:1,unitPrice:unitPrice,discount:rx?5e3:0,tax:tax2,fulfillmentType:rx?"pharmacy":"everfur_box",petId:CARE_MOCK_PET_RECORDS,imageUrl:item?.imageUrl??null}}),subtotal=lines.reduce((s,l)=>s+l.unitPrice*l.quantity,0),discount=lines.reduce((s,l)=>s+l.discount,0),tax=lines.reduce((s,l)=>s+l.tax,0),delivered=summary.status==="delivered";return{summary:summary,lines:lines,shipping:summary.orderId===CARE_MOCK_ORDER_BOX_ID?599:0,shippingTax:0,shipments:[],canCancel:!delivered,canReturn:false,canPay:false,paymentStatus:delivered||summary.status==="shipped"?"captured":"authorized",refunds:[],returnIds:[],subtotal:subtotal,discount:discount,tax:tax,arrivesBy:summary.arrivesBy??null,tracking:null,steps:(summary.steps??[]).map(s=>({key:s.key,done:s.doneAt!=null,at:s.doneAt})),paymentMethodId:CARE_MOCK_CARD.paymentMethodId}}var CARE_MOCK_PLANS=[{planId:"plan-care-v3-simparica",lines:[{offerId:CARE_MOCK_OFFER.simparicaTrio,quantity:1,petId:CARE_MOCK_PET_RECORDS}],cadenceDays:30,destination:CARE_MOCK_ADDRESS.ref,paymentMethodId:CARE_MOCK_CARD.paymentMethodId,discountBps:0,nextRun:"2026-10-05",state:"active",stopReason:null,priceCentsPerCycle:3199,chargedWhenFilled:true,nextShipOn:"2026-10-05",skippedCycleOn:null,prescriberName:"Dr. Goode",refillsLeft:8,refillsTotal:null,autoDiscountPct:null,changeOptions:[changeOption(CARE_MOCK_OFFER.simparicaTrio,"Simparica Trio","1 chew",1,3199,[30],true),changeOption(CARE_MOCK_OFFER.simparicaTrio,"Simparica Trio","3 chews",3,9597,[90],false)]},{planId:"plan-care-v3-apoquel",lines:[{offerId:CARE_MOCK_OFFER.apoquel,quantity:1,petId:CARE_MOCK_PET_RECORDS}],cadenceDays:30,destination:CARE_MOCK_ADDRESS.ref,paymentMethodId:CARE_MOCK_CARD.paymentMethodId,discountBps:0,nextRun:"2026-10-27",state:"active",stopReason:null,priceCentsPerCycle:6499,chargedWhenFilled:true,nextShipOn:"2026-10-27",skippedCycleOn:null,prescriberName:"Dr. Goode",refillsLeft:2,refillsTotal:null,autoDiscountPct:null,changeOptions:[changeOption(CARE_MOCK_OFFER.apoquel,"Apoquel 16 mg","30 tablets",1,6499,[30],true),changeOption(CARE_MOCK_OFFER.apoquel,"Apoquel 16 mg","60 tablets",2,12998,[60],false)]},{planId:"plan-care-v3-salmon-oil",lines:[{offerId:CARE_MOCK_OFFER.salmonOil,quantity:1,petId:CARE_MOCK_PET_RECORDS}],cadenceDays:120,destination:CARE_MOCK_ADDRESS.ref,paymentMethodId:CARE_MOCK_CARD.paymentMethodId,discountBps:1e3,nextRun:"2027-01-21",state:"active",stopReason:null,priceCentsPerCycle:2969,chargedWhenFilled:false,nextShipOn:"2027-01-21",skippedCycleOn:null,prescriberName:null,refillsLeft:null,refillsTotal:null,autoDiscountPct:10,changeOptions:[changeOption(CARE_MOCK_OFFER.salmonOil,"Zesty Paws Salmon Oil","32 fl oz",1,2969,[60,90,120,180],true)]}],CARE_MOCK_PLAN_SKIP_WARNINGS={"plan-care-v3-simparica":{key:"last_dose",values:{unitLabel:"chew",doseOn:"2026-10-01",noneFor:"2026-11-01",lastsTo:null,weeks:null}},"plan-care-v3-apoquel":{key:"bottle_gap",values:{unitLabel:null,doseOn:null,noneFor:null,lastsTo:"2026-10-30",weeks:4}}};function changeOption(offerId,title,size,quantity,priceCentsPerCycle,cadenceDays,current){return{offerId:offerId,title:title,size:size,packQuantity:null,packUnit:null,unitLabel:null,quantity:quantity,priceCentsPerCycle:priceCentsPerCycle,cadenceDays:cadenceDays,current:current}}var CARE_MOCK_BUY_AGAIN=[{offerId:CARE_MOCK_OFFER.vetradent,title:"Vetradent chews",imageUrl:shot("vetradent"),priceCents:2199,lastOrderedOn:"2026-08-15",isRx:false,likelyOut:true},{offerId:CARE_MOCK_OFFER.earWipes,title:"Zymox Ear Wipes",imageUrl:shot("ear-wipes"),priceCents:1499,lastOrderedOn:"2026-08-15",isRx:false,likelyOut:false},{offerId:CARE_MOCK_OFFER.douxoCalm,title:"Douxo Calm shampoo",imageUrl:shot("douxo-calm"),priceCents:1299,lastOrderedOn:"2026-08-15",isRx:false,likelyOut:false},{offerId:CARE_MOCK_OFFER.dasuquin,title:"Dasuquin with MSM",imageUrl:shot("dasuquin"),priceCents:2799,lastOrderedOn:"2026-07-18",isRx:false,likelyOut:false}],CARE_MOCK_TAX_RATE=.08625;function careMockQuote(lines,config=CARE_MOCK_SHOP_CONFIG){let prices=CARE_MOCK_PRICES,rate=config.taxRate??CARE_MOCK_TAX_RATE,offLeft=config.firstRxDiscountCents??0,priced=lines.map(l=>{let p=prices[l.offerId],unitPrice=p?.priceCents??0,isRx=p?.isRx===true,auto=p?.autoPriceCents,cut=config.firstAutoOrderPrice==="auto"&&l.plan==="auto"&&typeof auto=="number"&&auto<unitPrice?(unitPrice-auto)*l.quantity:0,off2=isRx?Math.min(offLeft,unitPrice*l.quantity-cut):0;return offLeft-=off2,{l:l,unitPrice:unitPrice,isRx:isRx,off:off2,cut:cut,net:unitPrice*l.quantity-cut}}),box=priced.filter(x=>!x.isRx).reduce((s,x)=>s+x.net,0),rx=priced.filter(x=>x.isRx).reduce((s,x)=>s+x.net,0),off=priced.reduce((s,x)=>s+x.off,0),tax=Math.round(box*rate),taxLeft=tax,boxLines=priced.filter(x=>!x.isRx);return{lines:priced.map(x=>{let lineTax=0;return!x.isRx&&box>0&&(lineTax=x===boxLines[boxLines.length-1]?taxLeft:Math.round(x.net*tax/box),taxLeft-=lineTax),{offerId:x.l.offerId,quantity:x.l.quantity,petId:x.l.petId??null,unitPrice:x.unitPrice,discount:x.cut+x.off,tax:lineTax,whenFilledDiscountCents:x.isRx?x.off:null,isRx:x.isRx,chargedWhenFilled:x.isRx}}),shipping:0,tax:tax,total:box+tax+rx-off,expiresAt:"2026-09-23T17:00:00Z",shipsOn:"2026-09-24",arrivesOn:"2026-09-26",whenFilledDiscountCents:off,dueTodayCents:box+tax,dueWhenFilledCents:rx-off}}export{CARE_MOCK_ADDRESS,CARE_MOCK_BUY_AGAIN,CARE_MOCK_CARD,CARE_MOCK_IMG,CARE_MOCK_OFFER,CARE_MOCK_ORDERS,CARE_MOCK_ORDER_BOX_ID,CARE_MOCK_ORDER_PAST_AUG,CARE_MOCK_ORDER_PAST_JUL,CARE_MOCK_ORDER_RX_ID,CARE_MOCK_PACKS,CARE_MOCK_PET_NO_RECORDS,CARE_MOCK_PET_RECORDS,CARE_MOCK_PLANS,CARE_MOCK_PLAN_SKIP_WARNINGS,CARE_MOCK_PRESCRIPTIONS,CARE_MOCK_PRICES,CARE_MOCK_SHOP_CONFIG,CARE_MOCK_TAX_RATE,CARE_MOCK_TODAY,MockTransport,bodies,careMockImg,careMockOrderDetail,careMockQuote,careMockSlugOf,wire};
|
|
@@ -5,21 +5,21 @@ export { B as Brand, P as PetRef, R as RecordsRequestId, _ as __brand } from '..
|
|
|
5
5
|
export { c as EverfurFontSource, d as EverfurFontWeight } from '../../tokens.d-BUVqme2D.cjs';
|
|
6
6
|
export { C as ClientBranding, R as RadiusScale, S as SurfaceStyle } from '../../branding.d-BFauULV6.cjs';
|
|
7
7
|
export { b as CapabilityDisabled, D as DisabledLevel, E as EntitlementDecision } from '../../resolve.d-BTC3b6FW.cjs';
|
|
8
|
-
export { f as EntitlementSnapshot } from '../../runtimeTypes.d-
|
|
8
|
+
export { f as EntitlementSnapshot } from '../../runtimeTypes.d-CkwEMpy8.cjs';
|
|
9
9
|
export { i as RecordsRequestStatus, d as RecordsRequestView, j as RecordsSimpleStatus } from '../../models.d-BSqvbTE1.cjs';
|
|
10
10
|
import { ReactNode } from 'react';
|
|
11
11
|
import { R as RiskTier } from '../../PhotoController.d-BzCJOE7e.cjs';
|
|
12
12
|
export { EverfurTestEntitlements, RecordsSandboxActionResult, RecordsSandboxClinicReply, RecordsSandboxController, RecordsSandboxResult, VetVisitSandboxActionResult, VetVisitSandboxController, VetVisitSandboxEvent, VetVisitSandboxReminderStage, VetVisitSandboxResult, VetVisitSandboxStatus, VetVisitSandboxVisit, useEverfurRecordsSandbox, useEverfurTestEntitlements, useEverfurVetVisitSandbox } from '../web/index.cjs';
|
|
13
13
|
import '../../presentation.d-Bs8xQ4gD.cjs';
|
|
14
|
-
import '../../petsRepository.d-
|
|
15
|
-
import '../../identity.d-
|
|
16
|
-
import '../../config.d-
|
|
14
|
+
import '../../petsRepository.d-CyerzD5G.cjs';
|
|
15
|
+
import '../../identity.d-BmbAwQYx.cjs';
|
|
16
|
+
import '../../config.d-BFTqU7ft.cjs';
|
|
17
17
|
import '../../profile.d-CSs1wlXT.cjs';
|
|
18
18
|
import '../../cacheEpoch.d-DknKn3S0.cjs';
|
|
19
19
|
import '../../ErrorPolicyPort.d-DirW9hgO.cjs';
|
|
20
|
-
import '../../ports.d-
|
|
21
|
-
import '../../casesRepository.d-
|
|
22
|
-
import '../../requestFunnel.d-
|
|
20
|
+
import '../../ports.d-CB9YZT2L.cjs';
|
|
21
|
+
import '../../casesRepository.d-D7vIZ9oX.cjs';
|
|
22
|
+
import '../../requestFunnel.d-DocT7FXR.cjs';
|
|
23
23
|
import '../../TelemetryPort.d-BDNr00hu.cjs';
|
|
24
24
|
import '../../ports.d-BX4f4UsB.cjs';
|
|
25
25
|
import '../../CameraPort.d-Cv31Pz7g.cjs';
|