@aranova/tracking-react 1.11.0 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,9 +1,9 @@
1
1
  export { AdPlatformTracking, AdPlatformTrackingProps, BookedAttempt, BookingHandoffLink, BookingHandoffLinkProps, BookingHandoffOptions, BookingSubmitState, BookingSubmitStatus, ConsentBanner, ConsentBannerProps, CreateTrackingOptions, CreateTrackingResult, GoogleAdsTracking, GoogleAdsTrackingProps, PhoneField, PhoneFieldApi, PhoneFieldProps, PhoneInputProps, TrackingProviderProps, UseConsentResult, UseCookiePreferencesOptions, UseCookiePreferencesResult, UsePhoneFieldOptions, createTracking, useBookingHandoffUrl, useBookingIntegration, useBookingSlots, useBookingSubmit, useConsent, useConsentState, useCookiePreferences, useGclid, usePhoneConfig, usePhoneField, useTrackingParams } from '@aranova/tracking-react/client';
2
2
  import { T as TrackingParams, a as TrackingInstallSurface, b as TrackingEnvironment, c as TrackingClientContext, d as TrackingEventCreatePayload, e as TrackingSessionUpsertPayload } from './phone-utils-BNiSqeF7.mjs';
3
3
  export { C as ConsentChoice, f as ConsentChoiceState, g as ConsentSource, h as ConsentState, D as DEFAULT_DECLINE_TTL_DAYS, i as DEFAULT_PHONE_COUNTRY, G as GtagEnvironmentMap, M as MetaPixelEnvironmentMap, P as ParsedPhone, j as PhoneConfig, k as PhoneDisplayFormat, S as SetConsentOptions, l as TrackedField, m as TrackingInitConfig, n as formatPhone, o as formatPhoneAsTyped, p as getConsentChoice, q as getConsentState, r as onConsentChange, s as optIn, t as optOut, u as parsePhone, v as phoneField, w as resetConsent, x as setConsentState, y as toE164 } from './phone-utils-BNiSqeF7.mjs';
4
- export { A as AranovaApiError, B as BusinessConfig, a as BusinessConfigFeatures, b as BusinessConfigService, C as CompareTo, c as ConversionUserData, d as CurrencyRevenue, e as CustomerCurrencyDelta, f as CustomerCurrencyTotal, g as CustomerGetOptions, h as CustomerGetResult, i as CustomerKpis, j as CustomerKpisDeltas, k as CustomerKpisPrevious, l as CustomerListPage, m as CustomerListQuery, n as CustomerProfile, o as CustomerSegment, p as CustomerSegmentCount, q as CustomerSortField, r as CustomerSummary, s as CustomerSummaryQuery, D as DistinctCustomersByCurrency, E as EffectiveSaleProperty, G as Granularity, N as NAMED_RANGES, t as NamedRange, P as PublicServiceItem, S as SALE_SOURCES, u as SUPPORTED_CURRENCIES, v as Sale, w as SaleBuiltinRequirableField, x as SaleCursorPage, y as SaleFilters, z as SaleInput, F as SaleItem, H as SaleItemInput, I as SaleKeysetSortField, J as SaleListPage, K as SaleListQuery, L as SaleListQueryV2, M as SalePropertyOption, O as SalePropertyType, Q as SaleService, R as SaleServiceInput, T as SaleSortField, U as SaleSortOrder, V as SaleSource, W as SaleSourceFacts, X as SaleSummary, Y as SaleSummaryPrevious, Z as SaleSummaryQuery, _ as SaleSummaryQueryV2, $ as SaleSummaryV2, a0 as SaleUpdateInput, a1 as SalesBusinessClient, a2 as SalesCategoryBreakdown, a3 as SalesClient, a4 as SalesClientConfig, a5 as SalesCustomersClient, a6 as SalesServiceBreakdown, a7 as SalesTransportConfig, a8 as SalesTrendPoint, a9 as SummaryCurrencyDelta, aa as SummaryDeltas, ab as SummaryWindow, ac as SupportedCurrency, ad as TRACKING_RANGES, ae as TrackingOverviewRange, af as clearStashedUserData, ag as createSalesClient, ah as currencySchema, ai as fetchServices, aj as formatDateInTz, ak as formatMoney, al as fromMinor, am as saleCreateSchema, an as saleItemSchema, ao as saleServiceSchema, ap as saleUpdateSchema, aq as salesRequest, ar as stashUserData, as as toMinor } from './sales-CSV0H3iG.mjs';
5
- export { B as BookingDetailsFailure, a as BookingDetailsInput, b as BookingDetailsOptions, c as BookingDetailsOutcome, d as BookingDetailsStatus, e as BookingDropOff, f as BookingFormSubmit, g as BookingInput, h as BookingMode, i as BookingOutcome, j as BookingSimulation, k as BookingSubmitOptions, C as ConversionConfig, l as ConversionConfigStore, F as FormSubmitField, S as SalesBookingsClient, T as TrackingConfigReference, m as getTrackingConfigRuntime, n as newBookingAttemptKey, r as resolveConversionConfig, o as resolveTrackingConfigUrl } from './bookings-BnXZGgwr.mjs';
6
- export { A as AutomaticEventName, B as BookableDay, a as BookingHandoffPrefill, b as BookingIntegration, c as BookingOption, d as BookingOptionGroup, e as BookingProvider, f as BookingRules, C as CtaClickConfig, g as CtaClickMetadata, E as EVENT_SEMANTICS, h as EventCategory, i as EventClientVisibility, j as EventConfig, k as EventKind, l as EventMetadata, m as EventName, n as EventOutcomeRole, o as EventSemantics, F as FormStartConfig, p as FormStartMetadata, q as FormStepConfig, r as FormStepMetadata, M as ManualEventName, s as MultiPageSessionConfig, t as MultiPageSessionMetadata, P as PageExitConfig, u as PageExitMetadata, v as PageIdentity, w as PageViewConfig, x as PageViewMetadata, y as PhoneClickConfig, z as PhoneClickMetadata, R as RegisteredAutomaticEvents, D as RegisteredManualEvents, S as ScrollDepthConfig, G as ScrollDepthMetadata, H as SdkHeartbeatConfig, I as SdkHeartbeatMetadata, J as SiteLinkArrivalConfig, K as SiteLinkArrivalMetadata, L as SiteLinkClickConfig, N as SiteLinkClickMetadata, O as SpecificPageName, Q as SpecificPageVisitConfig, T as SpecificPageVisitMetadata, U as TimeOnSiteConfig, V as TimeOnSiteMetadata, W as TrackableEvent, X as TriggerRegistryConfig, Y as TypedTrackEventOptions, Z as TypedTrackingClient, _ as bookableSlots, $ as buildBookingHandoffUrl, a0 as getBookingIntegration, a1 as getEventSemantics, a2 as groupBookingOptions, a3 as shopToday } from './ingest-typed-TI6KqVzL.mjs';
4
+ export { A as AranovaApiError, B as BusinessConfig, a as BusinessConfigFeatures, b as BusinessConfigService, C as CompareTo, c as ConversionUserData, d as CurrencyRevenue, e as CustomerCurrencyDelta, f as CustomerCurrencyTotal, g as CustomerGetOptions, h as CustomerGetResult, i as CustomerKpis, j as CustomerKpisDeltas, k as CustomerKpisPrevious, l as CustomerListPage, m as CustomerListQuery, n as CustomerProfile, o as CustomerSegment, p as CustomerSegmentCount, q as CustomerSortField, r as CustomerSummary, s as CustomerSummaryQuery, D as DistinctCustomersByCurrency, E as EffectiveSaleProperty, G as Granularity, N as NAMED_RANGES, t as NamedRange, P as PublicServiceItem, S as SALE_SOURCES, u as SUPPORTED_CURRENCIES, v as Sale, w as SaleBuiltinRequirableField, x as SaleCursorPage, y as SaleFilters, z as SaleInput, F as SaleItem, H as SaleItemInput, I as SaleKeysetSortField, J as SaleListPage, K as SaleListQuery, L as SaleListQueryV2, M as SalePropertyOption, O as SalePropertyType, Q as SaleService, R as SaleServiceInput, T as SaleSortField, U as SaleSortOrder, V as SaleSource, W as SaleSourceFacts, X as SaleSummary, Y as SaleSummaryPrevious, Z as SaleSummaryQuery, _ as SaleSummaryQueryV2, $ as SaleSummaryV2, a0 as SaleUpdateInput, a1 as SalesBusinessClient, a2 as SalesCategoryBreakdown, a3 as SalesClient, a4 as SalesClientConfig, a5 as SalesCustomersClient, a6 as SalesServiceBreakdown, a7 as SalesTransportConfig, a8 as SalesTrendPoint, a9 as SummaryCurrencyDelta, aa as SummaryDeltas, ab as SummaryWindow, ac as SupportedCurrency, ad as TRACKING_RANGES, ae as TrackingOverviewRange, af as clearStashedUserData, ag as createSalesClient, ah as currencySchema, ai as fetchServices, aj as formatDateInTz, ak as formatMoney, al as fromMinor, am as saleCreateSchema, an as saleItemSchema, ao as saleServiceSchema, ap as saleUpdateSchema, aq as salesRequest, ar as stashUserData, as as toMinor } from './sales-6vMEcopj.mjs';
5
+ export { B as BookingDetailsFailure, a as BookingDetailsInput, b as BookingDetailsOptions, c as BookingDetailsOutcome, d as BookingDetailsStatus, e as BookingDropOff, f as BookingFormSubmit, g as BookingInput, h as BookingMode, i as BookingOutcome, j as BookingSimulation, k as BookingSubmitOptions, C as ConversionConfig, l as ConversionConfigStore, F as FormSubmitField, S as SalesBookingsClient, T as TrackingConfigReference, m as getTrackingConfigRuntime, n as newBookingAttemptKey, r as resolveConversionConfig, o as resolveTrackingConfigUrl } from './bookings-Lmi0o_PA.mjs';
6
+ export { A as AutomaticEventName, B as BookableDay, a as BookingHandoffPrefill, b as BookingIntegration, c as BookingOption, d as BookingOptionGroup, e as BookingProvider, f as BookingRules, C as CtaClickConfig, g as CtaClickMetadata, E as EVENT_SEMANTICS, h as EventCategory, i as EventClientVisibility, j as EventConfig, k as EventKind, l as EventMetadata, m as EventName, n as EventOutcomeRole, o as EventSemantics, F as FormStartConfig, p as FormStartMetadata, q as FormStepConfig, r as FormStepMetadata, M as ManualEventName, s as MultiPageSessionConfig, t as MultiPageSessionMetadata, P as PageExitConfig, u as PageExitMetadata, v as PageIdentity, w as PageViewConfig, x as PageViewMetadata, y as PhoneClickConfig, z as PhoneClickMetadata, R as RegisteredAutomaticEvents, D as RegisteredManualEvents, S as ScrollDepthConfig, G as ScrollDepthMetadata, H as SdkHeartbeatConfig, I as SdkHeartbeatMetadata, J as SiteLinkArrivalConfig, K as SiteLinkArrivalMetadata, L as SiteLinkClickConfig, N as SiteLinkClickMetadata, O as SpecificPageName, Q as SpecificPageVisitConfig, T as SpecificPageVisitMetadata, U as TimeOnSiteConfig, V as TimeOnSiteMetadata, W as TrackableEvent, X as TriggerRegistryConfig, Y as TypedTrackEventOptions, Z as TypedTrackingClient, _ as bookableSlots, $ as buildBookingHandoffUrl, a0 as getBookingIntegration, a1 as getEventSemantics, a2 as groupBookingOptions, a3 as shopToday } from './ingest-typed-PKFEuJ8E.mjs';
7
7
  export { F as FormSubmitConfig, a as FormSubmitMetadata, J as JsonValue } from './form-submit-CX-CxJjQ.mjs';
8
8
  import * as z from 'zod/mini';
9
9
  export { CountryCode } from 'libphonenumber-js';
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  export { AdPlatformTracking, AdPlatformTrackingProps, BookedAttempt, BookingHandoffLink, BookingHandoffLinkProps, BookingHandoffOptions, BookingSubmitState, BookingSubmitStatus, ConsentBanner, ConsentBannerProps, CreateTrackingOptions, CreateTrackingResult, GoogleAdsTracking, GoogleAdsTrackingProps, PhoneField, PhoneFieldApi, PhoneFieldProps, PhoneInputProps, TrackingProviderProps, UseConsentResult, UseCookiePreferencesOptions, UseCookiePreferencesResult, UsePhoneFieldOptions, createTracking, useBookingHandoffUrl, useBookingIntegration, useBookingSlots, useBookingSubmit, useConsent, useConsentState, useCookiePreferences, useGclid, usePhoneConfig, usePhoneField, useTrackingParams } from '@aranova/tracking-react/client';
2
2
  import { T as TrackingParams, a as TrackingInstallSurface, b as TrackingEnvironment, c as TrackingClientContext, d as TrackingEventCreatePayload, e as TrackingSessionUpsertPayload } from './phone-utils-D12FW8tT.js';
3
3
  export { C as ConsentChoice, f as ConsentChoiceState, g as ConsentSource, h as ConsentState, D as DEFAULT_DECLINE_TTL_DAYS, i as DEFAULT_PHONE_COUNTRY, G as GtagEnvironmentMap, M as MetaPixelEnvironmentMap, P as ParsedPhone, j as PhoneConfig, k as PhoneDisplayFormat, S as SetConsentOptions, l as TrackedField, m as TrackingInitConfig, n as formatPhone, o as formatPhoneAsTyped, p as getConsentChoice, q as getConsentState, r as onConsentChange, s as optIn, t as optOut, u as parsePhone, v as phoneField, w as resetConsent, x as setConsentState, y as toE164 } from './phone-utils-D12FW8tT.js';
4
- export { A as AranovaApiError, B as BusinessConfig, a as BusinessConfigFeatures, b as BusinessConfigService, C as CompareTo, c as ConversionUserData, d as CurrencyRevenue, e as CustomerCurrencyDelta, f as CustomerCurrencyTotal, g as CustomerGetOptions, h as CustomerGetResult, i as CustomerKpis, j as CustomerKpisDeltas, k as CustomerKpisPrevious, l as CustomerListPage, m as CustomerListQuery, n as CustomerProfile, o as CustomerSegment, p as CustomerSegmentCount, q as CustomerSortField, r as CustomerSummary, s as CustomerSummaryQuery, D as DistinctCustomersByCurrency, E as EffectiveSaleProperty, G as Granularity, N as NAMED_RANGES, t as NamedRange, P as PublicServiceItem, S as SALE_SOURCES, u as SUPPORTED_CURRENCIES, v as Sale, w as SaleBuiltinRequirableField, x as SaleCursorPage, y as SaleFilters, z as SaleInput, F as SaleItem, H as SaleItemInput, I as SaleKeysetSortField, J as SaleListPage, K as SaleListQuery, L as SaleListQueryV2, M as SalePropertyOption, O as SalePropertyType, Q as SaleService, R as SaleServiceInput, T as SaleSortField, U as SaleSortOrder, V as SaleSource, W as SaleSourceFacts, X as SaleSummary, Y as SaleSummaryPrevious, Z as SaleSummaryQuery, _ as SaleSummaryQueryV2, $ as SaleSummaryV2, a0 as SaleUpdateInput, a1 as SalesBusinessClient, a2 as SalesCategoryBreakdown, a3 as SalesClient, a4 as SalesClientConfig, a5 as SalesCustomersClient, a6 as SalesServiceBreakdown, a7 as SalesTransportConfig, a8 as SalesTrendPoint, a9 as SummaryCurrencyDelta, aa as SummaryDeltas, ab as SummaryWindow, ac as SupportedCurrency, ad as TRACKING_RANGES, ae as TrackingOverviewRange, af as clearStashedUserData, ag as createSalesClient, ah as currencySchema, ai as fetchServices, aj as formatDateInTz, ak as formatMoney, al as fromMinor, am as saleCreateSchema, an as saleItemSchema, ao as saleServiceSchema, ap as saleUpdateSchema, aq as salesRequest, ar as stashUserData, as as toMinor } from './sales-BegN5t_z.js';
5
- export { B as BookingDetailsFailure, a as BookingDetailsInput, b as BookingDetailsOptions, c as BookingDetailsOutcome, d as BookingDetailsStatus, e as BookingDropOff, f as BookingFormSubmit, g as BookingInput, h as BookingMode, i as BookingOutcome, j as BookingSimulation, k as BookingSubmitOptions, C as ConversionConfig, l as ConversionConfigStore, F as FormSubmitField, S as SalesBookingsClient, T as TrackingConfigReference, m as getTrackingConfigRuntime, n as newBookingAttemptKey, r as resolveConversionConfig, o as resolveTrackingConfigUrl } from './bookings-vM_aCNOS.js';
6
- export { A as AutomaticEventName, B as BookableDay, a as BookingHandoffPrefill, b as BookingIntegration, c as BookingOption, d as BookingOptionGroup, e as BookingProvider, f as BookingRules, C as CtaClickConfig, g as CtaClickMetadata, E as EVENT_SEMANTICS, h as EventCategory, i as EventClientVisibility, j as EventConfig, k as EventKind, l as EventMetadata, m as EventName, n as EventOutcomeRole, o as EventSemantics, F as FormStartConfig, p as FormStartMetadata, q as FormStepConfig, r as FormStepMetadata, M as ManualEventName, s as MultiPageSessionConfig, t as MultiPageSessionMetadata, P as PageExitConfig, u as PageExitMetadata, v as PageIdentity, w as PageViewConfig, x as PageViewMetadata, y as PhoneClickConfig, z as PhoneClickMetadata, R as RegisteredAutomaticEvents, D as RegisteredManualEvents, S as ScrollDepthConfig, G as ScrollDepthMetadata, H as SdkHeartbeatConfig, I as SdkHeartbeatMetadata, J as SiteLinkArrivalConfig, K as SiteLinkArrivalMetadata, L as SiteLinkClickConfig, N as SiteLinkClickMetadata, O as SpecificPageName, Q as SpecificPageVisitConfig, T as SpecificPageVisitMetadata, U as TimeOnSiteConfig, V as TimeOnSiteMetadata, W as TrackableEvent, X as TriggerRegistryConfig, Y as TypedTrackEventOptions, Z as TypedTrackingClient, _ as bookableSlots, $ as buildBookingHandoffUrl, a0 as getBookingIntegration, a1 as getEventSemantics, a2 as groupBookingOptions, a3 as shopToday } from './ingest-typed-BS9agXM5.js';
4
+ export { A as AranovaApiError, B as BusinessConfig, a as BusinessConfigFeatures, b as BusinessConfigService, C as CompareTo, c as ConversionUserData, d as CurrencyRevenue, e as CustomerCurrencyDelta, f as CustomerCurrencyTotal, g as CustomerGetOptions, h as CustomerGetResult, i as CustomerKpis, j as CustomerKpisDeltas, k as CustomerKpisPrevious, l as CustomerListPage, m as CustomerListQuery, n as CustomerProfile, o as CustomerSegment, p as CustomerSegmentCount, q as CustomerSortField, r as CustomerSummary, s as CustomerSummaryQuery, D as DistinctCustomersByCurrency, E as EffectiveSaleProperty, G as Granularity, N as NAMED_RANGES, t as NamedRange, P as PublicServiceItem, S as SALE_SOURCES, u as SUPPORTED_CURRENCIES, v as Sale, w as SaleBuiltinRequirableField, x as SaleCursorPage, y as SaleFilters, z as SaleInput, F as SaleItem, H as SaleItemInput, I as SaleKeysetSortField, J as SaleListPage, K as SaleListQuery, L as SaleListQueryV2, M as SalePropertyOption, O as SalePropertyType, Q as SaleService, R as SaleServiceInput, T as SaleSortField, U as SaleSortOrder, V as SaleSource, W as SaleSourceFacts, X as SaleSummary, Y as SaleSummaryPrevious, Z as SaleSummaryQuery, _ as SaleSummaryQueryV2, $ as SaleSummaryV2, a0 as SaleUpdateInput, a1 as SalesBusinessClient, a2 as SalesCategoryBreakdown, a3 as SalesClient, a4 as SalesClientConfig, a5 as SalesCustomersClient, a6 as SalesServiceBreakdown, a7 as SalesTransportConfig, a8 as SalesTrendPoint, a9 as SummaryCurrencyDelta, aa as SummaryDeltas, ab as SummaryWindow, ac as SupportedCurrency, ad as TRACKING_RANGES, ae as TrackingOverviewRange, af as clearStashedUserData, ag as createSalesClient, ah as currencySchema, ai as fetchServices, aj as formatDateInTz, ak as formatMoney, al as fromMinor, am as saleCreateSchema, an as saleItemSchema, ao as saleServiceSchema, ap as saleUpdateSchema, aq as salesRequest, ar as stashUserData, as as toMinor } from './sales-DXLGjJQ6.js';
5
+ export { B as BookingDetailsFailure, a as BookingDetailsInput, b as BookingDetailsOptions, c as BookingDetailsOutcome, d as BookingDetailsStatus, e as BookingDropOff, f as BookingFormSubmit, g as BookingInput, h as BookingMode, i as BookingOutcome, j as BookingSimulation, k as BookingSubmitOptions, C as ConversionConfig, l as ConversionConfigStore, F as FormSubmitField, S as SalesBookingsClient, T as TrackingConfigReference, m as getTrackingConfigRuntime, n as newBookingAttemptKey, r as resolveConversionConfig, o as resolveTrackingConfigUrl } from './bookings-v_ucn93l.js';
6
+ export { A as AutomaticEventName, B as BookableDay, a as BookingHandoffPrefill, b as BookingIntegration, c as BookingOption, d as BookingOptionGroup, e as BookingProvider, f as BookingRules, C as CtaClickConfig, g as CtaClickMetadata, E as EVENT_SEMANTICS, h as EventCategory, i as EventClientVisibility, j as EventConfig, k as EventKind, l as EventMetadata, m as EventName, n as EventOutcomeRole, o as EventSemantics, F as FormStartConfig, p as FormStartMetadata, q as FormStepConfig, r as FormStepMetadata, M as ManualEventName, s as MultiPageSessionConfig, t as MultiPageSessionMetadata, P as PageExitConfig, u as PageExitMetadata, v as PageIdentity, w as PageViewConfig, x as PageViewMetadata, y as PhoneClickConfig, z as PhoneClickMetadata, R as RegisteredAutomaticEvents, D as RegisteredManualEvents, S as ScrollDepthConfig, G as ScrollDepthMetadata, H as SdkHeartbeatConfig, I as SdkHeartbeatMetadata, J as SiteLinkArrivalConfig, K as SiteLinkArrivalMetadata, L as SiteLinkClickConfig, N as SiteLinkClickMetadata, O as SpecificPageName, Q as SpecificPageVisitConfig, T as SpecificPageVisitMetadata, U as TimeOnSiteConfig, V as TimeOnSiteMetadata, W as TrackableEvent, X as TriggerRegistryConfig, Y as TypedTrackEventOptions, Z as TypedTrackingClient, _ as bookableSlots, $ as buildBookingHandoffUrl, a0 as getBookingIntegration, a1 as getEventSemantics, a2 as groupBookingOptions, a3 as shopToday } from './ingest-typed-B9I1c7jr.js';
7
7
  export { F as FormSubmitConfig, a as FormSubmitMetadata, J as JsonValue } from './form-submit-CX-CxJjQ.js';
8
8
  import * as z from 'zod/mini';
9
9
  export { CountryCode } from 'libphonenumber-js';
package/dist/index.js CHANGED
@@ -915,9 +915,58 @@ function parseConversionConfig(raw) {
915
915
  };
916
916
  }
917
917
  function parseLeadForms(value) {
918
- if (!value || typeof value !== "object") return null;
919
- const version = value.registry_version;
920
- return typeof version === "number" ? { registry_version: version } : null;
918
+ if (!isRecord(value) || typeof value.registry_version !== "number") return null;
919
+ return {
920
+ registry_version: value.registry_version,
921
+ contracts: records(value.contracts).flatMap(
922
+ (c) => typeof c.form_kind === "string" && typeof c.contract_hash === "string" ? [
923
+ {
924
+ form_kind: c.form_kind,
925
+ requires: records(c.requires).flatMap(
926
+ (r) => typeof r.role === "string" ? [
927
+ {
928
+ role: r.role,
929
+ required_when: parseCondition(r.required_when),
930
+ waived: r.waived === true
931
+ }
932
+ ] : []
933
+ ),
934
+ requires_any: records(c.requires_any).map((g) => ({
935
+ roles: strings(g.roles),
936
+ waived: g.waived === true
937
+ })),
938
+ options: records(c.options).flatMap(
939
+ (o) => typeof o.role === "string" ? [{ role: o.role, options: records(o.options).flatMap(parseContractOption) }] : []
940
+ ),
941
+ contract_hash: c.contract_hash
942
+ }
943
+ ] : []
944
+ )
945
+ };
946
+ }
947
+ function parseCondition(value) {
948
+ if (!isRecord(value) || typeof value.role !== "string") return null;
949
+ return { role: value.role, any_of: strings(value.any_of) };
950
+ }
951
+ function parseContractOption(value) {
952
+ if (typeof value.key !== "string" || typeof value.label !== "string") return [];
953
+ return [
954
+ {
955
+ key: value.key,
956
+ label: value.label,
957
+ is_non_answer: value.is_non_answer === true,
958
+ deprecated: value.deprecated === true
959
+ }
960
+ ];
961
+ }
962
+ function isRecord(value) {
963
+ return !!value && typeof value === "object" && !Array.isArray(value);
964
+ }
965
+ function records(value) {
966
+ return Array.isArray(value) ? value.filter(isRecord) : [];
967
+ }
968
+ function strings(value) {
969
+ return Array.isArray(value) ? value.filter((v) => typeof v === "string") : [];
921
970
  }
922
971
  var CACHE_PREFIX = "_aranova_cfg_";
923
972
  function cacheKey(url) {