@incodetech/core 0.0.0-dev-20260819-0bebbdc2 → 0.0.0-dev-20260819-1c04894b
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/{BrowserDiagnosticsCryptoProvider-6aqaVS6s.esm.js → BrowserDiagnosticsCryptoProvider-BzL_V7yb.esm.js} +1 -1
- package/dist/{IFeatureManagementCapability-DdEUp6tB.d.ts → IFeatureManagementCapability-De8wpbGh.d.ts} +2 -0
- package/dist/ae-signature.esm.js +1 -1
- package/dist/antifraud.esm.js +1 -1
- package/dist/{antifraudManager-B8Plzf7a.esm.js → antifraudManager-BMZvuxv0.esm.js} +1 -1
- package/dist/{apiError-C8O9Jo18.esm.js → apiError-jP0cswDJ.esm.js} +1 -1
- package/dist/authentication.esm.js +2 -2
- package/dist/{authenticationManager-BDwG2MBg.esm.js → authenticationManager-CQsYqM6S.esm.js} +3 -3
- package/dist/{authenticationStateMachine-B_k1nxxF.esm.js → authenticationStateMachine-jNp2tJ6j.esm.js} +2 -2
- package/dist/certificate-issuance.esm.js +1 -1
- package/dist/{certificateIssuanceManager-Ci4symEA.esm.js → certificateIssuanceManager-buCaNcxx.esm.js} +1 -1
- package/dist/consent.esm.js +1 -1
- package/dist/{consentManager-BApTlfA0.esm.js → consentManager-DyBXdkFn.esm.js} +1 -1
- package/dist/cross-document-data-match.esm.js +1 -1
- package/dist/{crossDocumentDataMatchManager-OmYvyung.esm.js → crossDocumentDataMatchManager-pNkutndd.esm.js} +1 -1
- package/dist/curp-validation.esm.js +1 -1
- package/dist/{curpValidationManager-UZxcrsrz.esm.js → curpValidationManager-DEesnLee.esm.js} +1 -1
- package/dist/custom-fields.esm.js +1 -1
- package/dist/custom-watchlist.esm.js +1 -1
- package/dist/{customFieldsManager-6mtAzlY2.esm.js → customFieldsManager-Dgy3Hi0q.esm.js} +1 -1
- package/dist/{customWatchlistManager-BgS0M1gL.esm.js → customWatchlistManager-BlJTcPKK.esm.js} +1 -1
- package/dist/{deepsightLoader-DZOieIHK.esm.js → deepsightLoader-BDlGUqao.esm.js} +3 -3
- package/dist/document-capture.d.ts +1 -1
- package/dist/document-capture.esm.js +1 -1
- package/dist/document-upload.d.ts +4 -4
- package/dist/document-upload.esm.js +1 -1
- package/dist/{documentCaptureManager-D7A4k-GE.esm.js → documentCaptureManager-2FoxNacZ.esm.js} +1 -1
- package/dist/{documentCaptureManager-B3t0ydtg.d.ts → documentCaptureManager-CIQSsmZe.d.ts} +4 -4
- package/dist/dynamic-forms.esm.js +2 -2
- package/dist/{dynamicFormsManager-CA2tDe_k.esm.js → dynamicFormsManager-f7Y9kUiR.esm.js} +2 -2
- package/dist/{dynamicFormsStateMachine-B4vHfk-3.esm.js → dynamicFormsStateMachine-CDmy6eXI.esm.js} +1 -1
- package/dist/ekyb.esm.js +3 -3
- package/dist/{ekybManager-DCQJu92m.esm.js → ekybManager-DQ_SfoWF.esm.js} +2 -2
- package/dist/{ekybStateMachine-DcNX5OXv.esm.js → ekybStateMachine-ZzqtUkd-.esm.js} +1 -1
- package/dist/ekyc.esm.js +1 -1
- package/dist/{ekycManager-oTstTJuL.esm.js → ekycManager-CasdX1Ou.esm.js} +1 -1
- package/dist/electronic-signature.esm.js +1 -1
- package/dist/{electronicSignatureManager-C8pORqlF.esm.js → electronicSignatureManager-D633yGbz.esm.js} +2 -2
- package/dist/email.esm.js +1 -1
- package/dist/{emailManager-tE-YvNtS.esm.js → emailManager-NLzaP12q.esm.js} +1 -1
- package/dist/{events-CxfNJVZW.esm.js → events-DYiyoSlx.esm.js} +5 -6
- package/dist/events.d.ts +11 -9
- package/dist/events.esm.js +1 -1
- package/dist/extensibility.d.ts +3 -2
- package/dist/extensibility.esm.js +32 -31
- package/dist/face-match.esm.js +1 -1
- package/dist/{faceCaptureManagerFactory-DccAZCel.esm.js → faceCaptureManagerFactory-CPf4an47.esm.js} +2 -2
- package/dist/{faceCaptureSetup-eQ57H0LP.esm.js → faceCaptureSetup-XzhL3jrY.esm.js} +2 -2
- package/dist/{faceMatchManager-BXp2WUT-.esm.js → faceMatchManager-DEVhhdf4.esm.js} +1 -1
- package/dist/{feature-management-DS_Nj5Gg.esm.js → feature-management-CkGxQul1.esm.js} +31 -40
- package/dist/feature-management.d.ts +41 -33
- package/dist/feature-management.esm.js +1 -1
- package/dist/field-comparison.esm.js +1 -1
- package/dist/{fieldComparisonManager-DhnYdYZ2.esm.js → fieldComparisonManager-BRYsIi34.esm.js} +1 -1
- package/dist/fiscal-qr.d.ts +2 -56
- package/dist/fiscal-qr.esm.js +2 -308
- package/dist/fiscalQrManager-CHcBJwUM.d.ts +68 -0
- package/dist/fiscalQrManager-DEgB0YYR.esm.js +311 -0
- package/dist/flow.esm.js +4 -4
- package/dist/{flowCompletionService-C6llWAAo.esm.js → flowCompletionService-YG3VycUU.esm.js} +1 -1
- package/dist/{flowServices-BwFbhVDV.esm.js → flowServices-C_Z7Pjvd.esm.js} +4 -4
- package/dist/geolocation.esm.js +2 -2
- package/dist/{geolocationManager-DIiUsJfx.esm.js → geolocationManager-AmYuocQ3.esm.js} +2 -2
- package/dist/{geolocationStateMachine-C0RXwD9o.esm.js → geolocationStateMachine-DSe6SL-7.esm.js} +1 -1
- package/dist/government-validation.esm.js +1 -1
- package/dist/{governmentValidationManager-DeF0Wcf5.esm.js → governmentValidationManager-Dheo7fh_.esm.js} +1 -1
- package/dist/home.esm.js +1 -1
- package/dist/id-ocr.esm.js +1 -1
- package/dist/id-selfie-flow.esm.js +6 -6
- package/dist/id-verification.esm.js +1 -1
- package/dist/id.esm.js +5 -5
- package/dist/{idCaptureManager-NBeR-cgG.esm.js → idCaptureManager-CykSLyn3.esm.js} +3 -3
- package/dist/{idCaptureServices-p3NtcUxw.esm.js → idCaptureServices-DoVKk86g.esm.js} +7 -7
- package/dist/{idCaptureStateMachine-BKbLET7m.esm.js → idCaptureStateMachine-D4UGjQNy.esm.js} +10 -10
- package/dist/{idOcrManager-CvJZhmBR.esm.js → idOcrManager-D_2k-6Vv.esm.js} +1 -1
- package/dist/{idVerificationManager-CduNXhWd.esm.js → idVerificationManager-DdlrWSSB.esm.js} +1 -1
- package/dist/identity-reuse.esm.js +1 -1
- package/dist/{identityReuseManager-D5vXknnJ.esm.js → identityReuseManager-CzLZNgdh.esm.js} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/{invokeOnCaptureCallback-1m1VJ3Q4.esm.js → invokeOnCaptureCallback-GpvMuz9o.esm.js} +1 -1
- package/dist/mandatory-consent.esm.js +1 -1
- package/dist/{mandatoryConsentManager-BeELm1zS.esm.js → mandatoryConsentManager-CEIkNukS.esm.js} +1 -1
- package/dist/{onDeviceFaceResults-DFirNde6.esm.js → onDeviceFaceResults-BYl2hbuy.esm.js} +3 -3
- package/dist/personhood.esm.js +4 -4
- package/dist/phone.esm.js +1 -1
- package/dist/{phoneManager-Cpiai2IM.esm.js → phoneManager-B_03mKyi.esm.js} +1 -1
- package/dist/qe-signature.esm.js +1 -1
- package/dist/{recordingService-Cs-zgcly.esm.js → recordingService-DxbuJNac.esm.js} +1 -1
- package/dist/redirect-to-mobile.esm.js +1 -1
- package/dist/{redirectToMobileManager-C0dfc7f6.esm.js → redirectToMobileManager-Bgo6eqri.esm.js} +1 -1
- package/dist/{runChildModule-CJBpdJ9L.esm.js → runChildModule-CkKzUrQR.esm.js} +2 -2
- package/dist/sdkVersion-_0-FMgKd.esm.js +4 -0
- package/dist/selfie.esm.js +6 -6
- package/dist/{selfieManager-C6nSxXbC.esm.js → selfieManager-DhPMKYxo.esm.js} +3 -3
- package/dist/{selfieStateMachine-CNBYEUhy.esm.js → selfieStateMachine-DkECDdim.esm.js} +2 -2
- package/dist/{session-BpBMD2qe.esm.js → session-BoCg9kCK.esm.js} +4 -4
- package/dist/session.esm.js +4 -4
- package/dist/{sessionInitializer-CNBU6Zmm.esm.js → sessionInitializer-DtcaH34N.esm.js} +5 -4
- package/dist/{setup-BwA7zG5D.d.ts → setup-CUHgyXuN.d.ts} +13 -1
- package/dist/{setup-MP1cPm8J.esm.js → setup-Ccd6xV05.esm.js} +7 -6
- package/dist/signature.esm.js +1 -1
- package/dist/{signatureManager-DdPgcmou.esm.js → signatureManager-DoACIR02.esm.js} +1 -1
- package/dist/trueSight-Bl-iCeAC.esm.js +1 -0
- package/dist/{trueSightService-7S24UFNk.esm.js → trueSightService-CTZ8wqNF.esm.js} +4 -6
- package/dist/trust-graph.esm.js +1 -1
- package/dist/video-selfie.esm.js +3 -3
- package/dist/{videoSelfieCameraWarmer-BIRjIgms.esm.js → videoSelfieCameraWarmer-DxxDSvmQ.esm.js} +2 -2
- package/dist/wasm.d.ts +1 -1
- package/dist/wasm.esm.js +1 -1
- package/dist/watchlist-for-business.esm.js +1 -1
- package/dist/watchlist.esm.js +1 -1
- package/dist/{watchlistManager-CjSMmbyq.esm.js → watchlistManager-CPBZnFYj.esm.js} +1 -1
- package/dist/workflow.d.ts +4 -4
- package/dist/workflow.esm.js +16 -16
- package/package.json +1 -1
- package/dist/trueSight-B42F3cH3.esm.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-
|
|
1
|
+
import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-DYiyoSlx.esm.js";
|
|
2
2
|
import { c as createManager, o as createActor } from "./xstate.esm-Cf4e0Cfd.esm.js";
|
|
3
3
|
import { t as faceMatchMachine } from "./faceMatchStateMachine-CJiO2yLO.esm.js";
|
|
4
4
|
//#region src/modules/face-match/faceMatchActor.ts
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { a as __toESM } from "./rolldown-runtime-FZ4Itg2g.esm.js";
|
|
2
|
+
import { t as SDK_VERSION } from "./sdkVersion-_0-FMgKd.esm.js";
|
|
2
3
|
import { t as BrowserLazyImportProvider } from "./BrowserLazyImportProvider-BhoA957O.esm.js";
|
|
3
4
|
let currentEnvironment;
|
|
4
5
|
/** Effective tier: the explicitly-set value, else the default (see note above). */
|
|
@@ -103,7 +104,8 @@ var FeatureManagementProvider = class FeatureManagementProvider {
|
|
|
103
104
|
};
|
|
104
105
|
this._user = this._getAdjustedUser({
|
|
105
106
|
customIDs: config.customIDs,
|
|
106
|
-
custom: config.custom
|
|
107
|
+
custom: config.custom,
|
|
108
|
+
appVersion: config.appVersion
|
|
107
109
|
});
|
|
108
110
|
const client = new module.StatsigClient(CLIENT_SDK_KEY, this._user, {
|
|
109
111
|
environment: { tier: config.environment },
|
|
@@ -206,6 +208,7 @@ var FeatureManagementProvider = class FeatureManagementProvider {
|
|
|
206
208
|
_getAdjustedUser(user) {
|
|
207
209
|
const persistedUserCustomIDs = this._user.customIDs ?? {};
|
|
208
210
|
const persistedUserCustom = this._user.custom ?? {};
|
|
211
|
+
const appVersion = user.appVersion ?? this._user.appVersion;
|
|
209
212
|
return {
|
|
210
213
|
customIDs: {
|
|
211
214
|
...persistedUserCustomIDs,
|
|
@@ -215,6 +218,7 @@ var FeatureManagementProvider = class FeatureManagementProvider {
|
|
|
215
218
|
...persistedUserCustom,
|
|
216
219
|
...user.custom
|
|
217
220
|
},
|
|
221
|
+
...appVersion !== void 0 ? { appVersion } : {},
|
|
218
222
|
...this._getRedactedFields()
|
|
219
223
|
};
|
|
220
224
|
}
|
|
@@ -454,7 +458,11 @@ function getIsFeatureManagementLocked() {
|
|
|
454
458
|
function buildInitializeOptions(options) {
|
|
455
459
|
const initializeOptions = { environment: options.environment ?? "production" };
|
|
456
460
|
if (options.clientExperimentId) initializeOptions.customIDs = { client_experiment_id: options.clientExperimentId };
|
|
457
|
-
|
|
461
|
+
initializeOptions.custom = {
|
|
462
|
+
...options.custom,
|
|
463
|
+
sdkVersion: SDK_VERSION
|
|
464
|
+
};
|
|
465
|
+
if (options.appVersion) initializeOptions.appVersion = options.appVersion;
|
|
458
466
|
if (options.redactedUserInfo) initializeOptions.redactedUserInfo = options.redactedUserInfo;
|
|
459
467
|
initializeOptions.disableStableId = options.disableStableId ?? true;
|
|
460
468
|
initializeOptions.disablePersistence = options.disablePersistence ?? true;
|
|
@@ -467,18 +475,14 @@ const resolvedExperiments = /* @__PURE__ */ new Map();
|
|
|
467
475
|
const exposedExperiments = /* @__PURE__ */ new Set();
|
|
468
476
|
/**
|
|
469
477
|
* Non-null fallback compared by reference. A `null` code fallback disables
|
|
470
|
-
* Statsig validation
|
|
471
|
-
* `
|
|
478
|
+
* Statsig's type validation, so `undefined`/`null` can never be used here.
|
|
479
|
+
* The `__unavailable` marker exists purely for debuggability: a genuinely
|
|
480
|
+
* not-allocated console payload is an empty object `{}`, which is otherwise
|
|
481
|
+
* indistinguishable from this sentinel by inspection (both resolve to code
|
|
482
|
+
* defaults with no assignment — the reference check is what actually
|
|
483
|
+
* matters at runtime).
|
|
472
484
|
*/
|
|
473
|
-
const EXPERIMENT_UNAVAILABLE_SENTINEL = Object.freeze({
|
|
474
|
-
schema: "v1",
|
|
475
|
-
status: "not_allocated",
|
|
476
|
-
arm: "",
|
|
477
|
-
flagKey: "",
|
|
478
|
-
experimentId: "",
|
|
479
|
-
experimentName: "",
|
|
480
|
-
params: {}
|
|
481
|
-
});
|
|
485
|
+
const EXPERIMENT_UNAVAILABLE_SENTINEL = Object.freeze({ __unavailable: true });
|
|
482
486
|
function isRecord(value) {
|
|
483
487
|
return typeof value === "object" && value !== null;
|
|
484
488
|
}
|
|
@@ -488,43 +492,26 @@ function defaultsResult(spec) {
|
|
|
488
492
|
assignment: null
|
|
489
493
|
};
|
|
490
494
|
}
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
const arm = payload.arm;
|
|
496
|
-
if (typeof flagKey !== "string" || typeof experimentId !== "string" || typeof experimentName !== "string" || typeof arm !== "string" || !flagKey || !experimentId || !experimentName || !arm) return null;
|
|
497
|
-
return {
|
|
498
|
-
flagKey,
|
|
499
|
-
experimentId,
|
|
500
|
-
experimentName,
|
|
501
|
-
variant: arm
|
|
502
|
-
};
|
|
495
|
+
/** Non-empty record means reportable; nothing inside it is validated. */
|
|
496
|
+
function buildAssignment(analytics) {
|
|
497
|
+
if (!isRecord(analytics) || Object.keys(analytics).length === 0) return null;
|
|
498
|
+
return { ...analytics };
|
|
503
499
|
}
|
|
504
500
|
function evaluateExperimentPayload(spec, raw) {
|
|
505
501
|
if (raw === EXPERIMENT_UNAVAILABLE_SENTINEL) return defaultsResult(spec);
|
|
506
|
-
if (!isRecord(raw)
|
|
507
|
-
const
|
|
508
|
-
if (status !== "ongoing" && status !== "completed" && status !== "not_allocated") return defaultsResult(spec);
|
|
509
|
-
if (status === "not_allocated") return defaultsResult(spec);
|
|
510
|
-
const rawParams = isRecord(raw.params) ? raw.params : {};
|
|
511
|
-
const parsedParams = spec.parseParams(rawParams);
|
|
512
|
-
if (parsedParams === null) return defaultsResult(spec);
|
|
502
|
+
if (!isRecord(raw)) return defaultsResult(spec);
|
|
503
|
+
const parsedParams = spec.parseParams(raw);
|
|
513
504
|
const params = {
|
|
514
505
|
...spec.defaults,
|
|
515
506
|
...parsedParams
|
|
516
507
|
};
|
|
517
|
-
if (status === "completed") return {
|
|
518
|
-
params,
|
|
519
|
-
assignment: null
|
|
520
|
-
};
|
|
521
508
|
if (!getFeatureGate(EXPERIMENT_ASSIGNED_ANALYTICS_EVENT_GATE).enabled) return {
|
|
522
509
|
params,
|
|
523
510
|
assignment: null
|
|
524
511
|
};
|
|
525
512
|
return {
|
|
526
513
|
params,
|
|
527
|
-
assignment: buildAssignment(raw)
|
|
514
|
+
assignment: buildAssignment(raw.analytics)
|
|
528
515
|
};
|
|
529
516
|
}
|
|
530
517
|
/**
|
|
@@ -589,8 +576,9 @@ const enumParam = (defaultValue, allowed) => ({
|
|
|
589
576
|
/**
|
|
590
577
|
* Derives the `defaults` / `parseParams` half of an `ExperimentSpec` from a
|
|
591
578
|
* schema. An omitted param keeps its code default (control users still get
|
|
592
|
-
* shipped behavior); a present-but-invalid param
|
|
593
|
-
*
|
|
579
|
+
* shipped behavior); a present-but-invalid param is skipped (falls back to
|
|
580
|
+
* its own default) rather than rejecting the whole payload, so a corrupt
|
|
581
|
+
* console edit to one key never disables the rest of the treatment.
|
|
594
582
|
*/
|
|
595
583
|
function defineExperimentParams(schema) {
|
|
596
584
|
const keys = Object.keys(schema);
|
|
@@ -604,7 +592,10 @@ function defineExperimentParams(schema) {
|
|
|
604
592
|
for (const key of keys) {
|
|
605
593
|
if (!(key in raw) || raw[key] === void 0) continue;
|
|
606
594
|
const value = raw[key];
|
|
607
|
-
if (!schema[key].isValid(value))
|
|
595
|
+
if (!schema[key].isValid(value)) {
|
|
596
|
+
console.warn(`[experiments] Invalid value for param "${key}" — falling back to its default.`);
|
|
597
|
+
continue;
|
|
598
|
+
}
|
|
608
599
|
parsed[key] = value;
|
|
609
600
|
}
|
|
610
601
|
return parsed;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as FeatureManagementParameterStore, c as FeatureManagementRedactedUserInfo, i as FeatureManagementLayer, l as FeatureManagementUserUpdate, n as FeatureManagementExperiment, o as FeatureManagementParameterStoreEvaluationOptions, r as FeatureManagementGate, s as FeatureManagementReadStatus, t as FeatureManagementEventMetadata } from "./IFeatureManagementCapability-
|
|
1
|
+
import { a as FeatureManagementParameterStore, c as FeatureManagementRedactedUserInfo, i as FeatureManagementLayer, l as FeatureManagementUserUpdate, n as FeatureManagementExperiment, o as FeatureManagementParameterStoreEvaluationOptions, r as FeatureManagementGate, s as FeatureManagementReadStatus, t as FeatureManagementEventMetadata } from "./IFeatureManagementCapability-De8wpbGh.js";
|
|
2
2
|
//#region src/integrations/feature-management/featureManagement.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* Name of the shared Statsig parameter store fronting SDK-module
|
|
@@ -78,31 +78,34 @@ declare function logEvent(name: string, value?: string | number, options?: {
|
|
|
78
78
|
}): void;
|
|
79
79
|
//#endregion
|
|
80
80
|
//#region src/integrations/feature-management/experiments.d.ts
|
|
81
|
-
/**
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
81
|
+
/**
|
|
82
|
+
* Statsig object payload: declared params live at the root; `analytics` is
|
|
83
|
+
* an optional, code-unvalidated block spread verbatim into the
|
|
84
|
+
* `experimentsAssigned` event. Presence of a non-empty `analytics` record is
|
|
85
|
+
* the only reportability signal — there is no `schema`/`status`/`arm`
|
|
86
|
+
* discriminator.
|
|
87
|
+
*/
|
|
88
|
+
type ExperimentTransport = {
|
|
89
|
+
analytics?: Record<string, unknown>;
|
|
90
|
+
} & Record<string, unknown>;
|
|
91
91
|
type ExperimentSpec<P> = {
|
|
92
92
|
storeParam: string;
|
|
93
93
|
defaults: P;
|
|
94
|
-
parseParams(raw: Record<string, unknown>): Partial<P
|
|
95
|
-
};
|
|
96
|
-
type ExperimentAssignedPayload = {
|
|
97
|
-
flagKey: string;
|
|
98
|
-
experimentId: string;
|
|
99
|
-
experimentName: string;
|
|
100
|
-
variant: string;
|
|
101
|
-
conditions?: Record<string, boolean | number | string>;
|
|
94
|
+
parseParams(raw: Record<string, unknown>): Partial<P>;
|
|
102
95
|
};
|
|
96
|
+
/**
|
|
97
|
+
* Verbatim copy of the console-supplied `analytics` block. Only `flagKey`
|
|
98
|
+
* (used elsewhere for reporting identity) is conventionally present — no
|
|
99
|
+
* field here is required or validated by the SDK.
|
|
100
|
+
*/
|
|
101
|
+
type ExperimentAssignedPayload = Record<string, unknown>;
|
|
103
102
|
type ResolvedExperiment<P> = {
|
|
104
103
|
params: P;
|
|
105
|
-
/**
|
|
104
|
+
/**
|
|
105
|
+
* Null when not reportable: `analytics` absent/empty on the console
|
|
106
|
+
* payload, not allocated (`{}`), unavailable, or the
|
|
107
|
+
* `experiment_assigned_analytics_event` gate is off.
|
|
108
|
+
*/
|
|
106
109
|
assignment: ExperimentAssignedPayload | null;
|
|
107
110
|
};
|
|
108
111
|
type ResolveExperimentOptions = {
|
|
@@ -111,17 +114,15 @@ type ResolveExperimentOptions = {
|
|
|
111
114
|
};
|
|
112
115
|
/**
|
|
113
116
|
* Non-null fallback compared by reference. A `null` code fallback disables
|
|
114
|
-
* Statsig validation
|
|
115
|
-
* `
|
|
117
|
+
* Statsig's type validation, so `undefined`/`null` can never be used here.
|
|
118
|
+
* The `__unavailable` marker exists purely for debuggability: a genuinely
|
|
119
|
+
* not-allocated console payload is an empty object `{}`, which is otherwise
|
|
120
|
+
* indistinguishable from this sentinel by inspection (both resolve to code
|
|
121
|
+
* defaults with no assignment — the reference check is what actually
|
|
122
|
+
* matters at runtime).
|
|
116
123
|
*/
|
|
117
124
|
declare const EXPERIMENT_UNAVAILABLE_SENTINEL: Readonly<{
|
|
118
|
-
|
|
119
|
-
status: "not_allocated";
|
|
120
|
-
arm: "";
|
|
121
|
-
flagKey: "";
|
|
122
|
-
experimentId: "";
|
|
123
|
-
experimentName: "";
|
|
124
|
-
params: {};
|
|
125
|
+
__unavailable: true;
|
|
125
126
|
}>;
|
|
126
127
|
/**
|
|
127
128
|
* Resolves an object-shaped experiment param with exposure suppressed (phase 1).
|
|
@@ -149,7 +150,13 @@ type ExperimentParamDescriptor<T extends ExperimentParamValue> = {
|
|
|
149
150
|
default: T;
|
|
150
151
|
isValid: (value: unknown) => value is T;
|
|
151
152
|
};
|
|
152
|
-
type ExperimentParamsSchema = Record<string, ExperimentParamDescriptor<ExperimentParamValue
|
|
153
|
+
type ExperimentParamsSchema = Record<string, ExperimentParamDescriptor<ExperimentParamValue>> & {
|
|
154
|
+
/**
|
|
155
|
+
* Reserved at the payload root for the pass-through analytics block — a
|
|
156
|
+
* param schema can never declare a param named `analytics`.
|
|
157
|
+
*/
|
|
158
|
+
analytics?: never;
|
|
159
|
+
};
|
|
153
160
|
/** The params map a schema implies — the single source of truth for `P`. */
|
|
154
161
|
type InferExperimentParams<S extends ExperimentParamsSchema> = { [K in keyof S]: S[K] extends ExperimentParamDescriptor<infer T> ? T : never; };
|
|
155
162
|
type NumberParamBounds = {
|
|
@@ -165,9 +172,10 @@ declare const enumParam: <const T extends readonly string[]>(defaultValue: T[num
|
|
|
165
172
|
/**
|
|
166
173
|
* Derives the `defaults` / `parseParams` half of an `ExperimentSpec` from a
|
|
167
174
|
* schema. An omitted param keeps its code default (control users still get
|
|
168
|
-
* shipped behavior); a present-but-invalid param
|
|
169
|
-
*
|
|
175
|
+
* shipped behavior); a present-but-invalid param is skipped (falls back to
|
|
176
|
+
* its own default) rather than rejecting the whole payload, so a corrupt
|
|
177
|
+
* console edit to one key never disables the rest of the treatment.
|
|
170
178
|
*/
|
|
171
179
|
declare function defineExperimentParams<S extends ExperimentParamsSchema>(schema: S): Pick<ExperimentSpec<InferExperimentParams<S>>, 'defaults' | 'parseParams'>;
|
|
172
180
|
//#endregion
|
|
173
|
-
export { EXPERIMENT_UNAVAILABLE_SENTINEL, type ExperimentAssignedPayload, type ExperimentParamDescriptor, type ExperimentParamValue, type ExperimentParamsSchema, type ExperimentSpec, type
|
|
181
|
+
export { EXPERIMENT_UNAVAILABLE_SENTINEL, type ExperimentAssignedPayload, type ExperimentParamDescriptor, type ExperimentParamValue, type ExperimentParamsSchema, type ExperimentSpec, type ExperimentTransport, type FeatureManagementExperiment, type FeatureManagementGate, type FeatureManagementLayer, type FeatureManagementParameterStore, type FeatureManagementParameterStoreEvaluationOptions, type FeatureManagementReadStatus, type FeatureManagementRedactedUserInfo, type FeatureManagementUserUpdate, type InferExperimentParams, type NumberParamBounds, ONBOARDING_WEB_SDK_PARAMETER_STORE, type ResolveExperimentOptions, type ResolvedExperiment, booleanParam, defineExperimentParams, enumParam, exposeExperimentOnce, getExperiment, getFeatureDynamicConfig, getFeatureGate, getFeatureManagementVersion, getFeatureParameterStore, getIsFeatureManagementInitialized, getLayer, logEvent, numberParam, resolveExperiment, resolveExperimentOnce, stringParam, subscribeFeatureManagement, updateFeatureManagementUser };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { E as updateFeatureManagementUser, T as subscribeFeatureManagement, _ as getIsFeatureManagementInitialized, a as stringParam, d as ONBOARDING_WEB_SDK_PARAMETER_STORE, f as getExperiment, g as getFeatureParameterStore, h as getFeatureManagementVersion, i as numberParam, l as resolveExperiment, m as getFeatureGate, n as defineExperimentParams, o as EXPERIMENT_UNAVAILABLE_SENTINEL, p as getFeatureDynamicConfig, r as enumParam, s as exposeExperimentOnce, t as booleanParam, u as resolveExperimentOnce, x as logEvent, y as getLayer } from "./feature-management-
|
|
1
|
+
import { E as updateFeatureManagementUser, T as subscribeFeatureManagement, _ as getIsFeatureManagementInitialized, a as stringParam, d as ONBOARDING_WEB_SDK_PARAMETER_STORE, f as getExperiment, g as getFeatureParameterStore, h as getFeatureManagementVersion, i as numberParam, l as resolveExperiment, m as getFeatureGate, n as defineExperimentParams, o as EXPERIMENT_UNAVAILABLE_SENTINEL, p as getFeatureDynamicConfig, r as enumParam, s as exposeExperimentOnce, t as booleanParam, u as resolveExperimentOnce, x as logEvent, y as getLayer } from "./feature-management-CkGxQul1.esm.js";
|
|
2
2
|
export { EXPERIMENT_UNAVAILABLE_SENTINEL, ONBOARDING_WEB_SDK_PARAMETER_STORE, booleanParam, defineExperimentParams, enumParam, exposeExperimentOnce, getExperiment, getFeatureDynamicConfig, getFeatureGate, getFeatureManagementVersion, getFeatureParameterStore, getIsFeatureManagementInitialized, getLayer, logEvent, numberParam, resolveExperiment, resolveExperimentOnce, stringParam, subscribeFeatureManagement, updateFeatureManagementUser };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as createFieldComparisonManagerFromActor, r as fieldComparisonMachine, t as createFieldComparisonManager } from "./fieldComparisonManager-
|
|
1
|
+
import { n as createFieldComparisonManagerFromActor, r as fieldComparisonMachine, t as createFieldComparisonManager } from "./fieldComparisonManager-BRYsIi34.esm.js";
|
|
2
2
|
export { createFieldComparisonManager, createFieldComparisonManagerFromActor, fieldComparisonMachine };
|
package/dist/{fieldComparisonManager-DhnYdYZ2.esm.js → fieldComparisonManager-BRYsIi34.esm.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as api } from "./api-Bx3gKW_y.esm.js";
|
|
2
|
-
import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-
|
|
2
|
+
import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-DYiyoSlx.esm.js";
|
|
3
3
|
import { t as endpoints } from "./endpoints-CCzL3XD_.esm.js";
|
|
4
4
|
import { c as createManager, o as createActor, r as assign, t as setup } from "./xstate.esm-Cf4e0Cfd.esm.js";
|
|
5
5
|
import { n as fromPromise } from "./xstate-actors.esm-CtI5S0f4.esm.js";
|
package/dist/fiscal-qr.d.ts
CHANGED
|
@@ -1,56 +1,2 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Configuration options for the Fiscal QR module.
|
|
5
|
-
*
|
|
6
|
-
* The backend currently sends an empty module configuration for this step.
|
|
7
|
-
*/
|
|
8
|
-
type FiscalQrConfig = Record<string, never>;
|
|
9
|
-
//#endregion
|
|
10
|
-
//#region src/modules/fiscal-qr/fiscalQrManager.d.ts
|
|
11
|
-
type FiscalQrIdleState = {
|
|
12
|
-
status: 'idle';
|
|
13
|
-
};
|
|
14
|
-
type FiscalQrScanningState = {
|
|
15
|
-
status: 'scanning';
|
|
16
|
-
stream?: MediaStream;
|
|
17
|
-
error?: string;
|
|
18
|
-
};
|
|
19
|
-
type FiscalQrCapturingState = {
|
|
20
|
-
status: 'capturing';
|
|
21
|
-
stream?: MediaStream;
|
|
22
|
-
};
|
|
23
|
-
type FiscalQrSuccessState = {
|
|
24
|
-
status: 'success';
|
|
25
|
-
stream?: MediaStream;
|
|
26
|
-
};
|
|
27
|
-
type FiscalQrProcessingState = {
|
|
28
|
-
status: 'processing';
|
|
29
|
-
};
|
|
30
|
-
type FiscalQrErrorState = {
|
|
31
|
-
status: 'error';
|
|
32
|
-
error?: string;
|
|
33
|
-
attempts: number;
|
|
34
|
-
stream?: MediaStream;
|
|
35
|
-
};
|
|
36
|
-
type FiscalQrVerifiedState = {
|
|
37
|
-
status: 'verified';
|
|
38
|
-
};
|
|
39
|
-
type FiscalQrFinishedState = {
|
|
40
|
-
status: 'finished';
|
|
41
|
-
};
|
|
42
|
-
type FiscalQrState = FiscalQrIdleState | FiscalQrScanningState | FiscalQrCapturingState | FiscalQrSuccessState | FiscalQrProcessingState | FiscalQrErrorState | FiscalQrVerifiedState | FiscalQrFinishedState;
|
|
43
|
-
declare function createFiscalQrManager(options: {
|
|
44
|
-
config: FiscalQrConfig;
|
|
45
|
-
}): Manager<FiscalQrState> & {
|
|
46
|
-
load(): void;
|
|
47
|
-
continue(): void;
|
|
48
|
-
skip(): void;
|
|
49
|
-
reset(): void;
|
|
50
|
-
};
|
|
51
|
-
type FiscalQrManager = ReturnType<typeof createFiscalQrManager>;
|
|
52
|
-
//#endregion
|
|
53
|
-
//#region src/modules/fiscal-qr/fiscalQrStateMachine.d.ts
|
|
54
|
-
declare const fiscalQrMachine: any;
|
|
55
|
-
//#endregion
|
|
56
|
-
export { type FiscalQrConfig, type FiscalQrManager, type FiscalQrState, createFiscalQrManager, fiscalQrMachine };
|
|
1
|
+
import { a as FiscalQrActor, i as createFiscalQrManagerFromActor, n as FiscalQrState, o as fiscalQrMachine, r as createFiscalQrManager, s as FiscalQrConfig, t as FiscalQrManager } from "./fiscalQrManager-CHcBJwUM.js";
|
|
2
|
+
export { type FiscalQrActor, type FiscalQrConfig, type FiscalQrManager, type FiscalQrState, createFiscalQrManager, createFiscalQrManagerFromActor, fiscalQrMachine };
|
package/dist/fiscal-qr.esm.js
CHANGED
|
@@ -1,308 +1,2 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
|
|
3
|
-
import { n as eventModuleNames, o as createManagerInstrumentation, v as addEvent } from "./events-CxfNJVZW.esm.js";
|
|
4
|
-
import { t as endpoints } from "./endpoints-CCzL3XD_.esm.js";
|
|
5
|
-
import { c as createManager, o as createActor, r as assign, t as setup } from "./xstate.esm-Cf4e0Cfd.esm.js";
|
|
6
|
-
import { n as fromPromise, t as fromCallback } from "./xstate-actors.esm-CtI5S0f4.esm.js";
|
|
7
|
-
import { a as stopCameraStream } from "./camera-_2sXMXiF.esm.js";
|
|
8
|
-
import { n as getBackCameraStream } from "./backCameraStream-BMGalshK.esm.js";
|
|
9
|
-
import { t as StreamCanvasCapture } from "./StreamCanvasCapture-D2XcXCZ4.esm.js";
|
|
10
|
-
import { BrowserQRCodeReader } from "@zxing/browser";
|
|
11
|
-
//#region src/modules/fiscal-qr/fiscalQrConstants.ts
|
|
12
|
-
const SUCCESS_DISPLAY_MS = 1500;
|
|
13
|
-
const PROCESSING_DISPLAY_MS = 3e3;
|
|
14
|
-
const ERROR_DISPLAY_MS = 3e3;
|
|
15
|
-
//#endregion
|
|
16
|
-
//#region src/modules/fiscal-qr/qrCodeDecoder.ts
|
|
17
|
-
function createQrCodeDecoder() {
|
|
18
|
-
const reader = new BrowserQRCodeReader();
|
|
19
|
-
return { decode(canvas) {
|
|
20
|
-
try {
|
|
21
|
-
const text = reader.decodeFromCanvas(canvas.canvas).getText().trim();
|
|
22
|
-
return text.length > 0 ? text : void 0;
|
|
23
|
-
} catch {
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
} };
|
|
27
|
-
}
|
|
28
|
-
//#endregion
|
|
29
|
-
//#region src/modules/fiscal-qr/fiscalQrUtils.ts
|
|
30
|
-
/**
|
|
31
|
-
* Continuously decodes QR codes from an existing frame capturer until the first
|
|
32
|
-
* hit.
|
|
33
|
-
*
|
|
34
|
-
* When `applyFocusDelay` is true, waits {@link INITIAL_FOCUS_DELAY_MS} (camera
|
|
35
|
-
* focus) before the first attempt; otherwise scans immediately. Either way it
|
|
36
|
-
* then retries every {@link SCAN_INTERVAL_MS}. `onDetected` fires at most once.
|
|
37
|
-
*
|
|
38
|
-
* Takes a shared {@link StreamCanvasCapture} rather than a stream on purpose:
|
|
39
|
-
* the capturer (and its hidden video) is created once for the camera session
|
|
40
|
-
* and reused across scan restarts, so re-entering scanning never spins up a new
|
|
41
|
-
* stream consumer — which would briefly disturb the visible camera feed.
|
|
42
|
-
*
|
|
43
|
-
* @returns a cleanup function that stops the scan loop. It does NOT dispose the
|
|
44
|
-
* capturer or stop the camera — the caller owns those lifecycles.
|
|
45
|
-
*/
|
|
46
|
-
function startQrScan(frameCapturer, onDetected, applyFocusDelay = true) {
|
|
47
|
-
const decoder = createQrCodeDecoder();
|
|
48
|
-
const timer = BrowserTimerProvider.getInstance();
|
|
49
|
-
let disposed = false;
|
|
50
|
-
let hasDetected = false;
|
|
51
|
-
let scanInterval;
|
|
52
|
-
let focusDelay;
|
|
53
|
-
const scan = () => {
|
|
54
|
-
if (disposed || hasDetected) return;
|
|
55
|
-
const canvas = frameCapturer.getLatestCanvas();
|
|
56
|
-
if (!canvas) return;
|
|
57
|
-
try {
|
|
58
|
-
const link = decoder.decode(canvas);
|
|
59
|
-
if (link && !disposed && !hasDetected) {
|
|
60
|
-
hasDetected = true;
|
|
61
|
-
onDetected(link);
|
|
62
|
-
}
|
|
63
|
-
} finally {
|
|
64
|
-
canvas.dispose();
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
const beginScanning = () => {
|
|
68
|
-
scan();
|
|
69
|
-
scanInterval = timer.setInterval(scan, 500);
|
|
70
|
-
};
|
|
71
|
-
if (applyFocusDelay) focusDelay = timer.setTimeout(beginScanning, 800);
|
|
72
|
-
else beginScanning();
|
|
73
|
-
return () => {
|
|
74
|
-
disposed = true;
|
|
75
|
-
if (focusDelay !== void 0) timer.clearTimeout(focusDelay);
|
|
76
|
-
if (scanInterval !== void 0) timer.clearInterval(scanInterval);
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
//#endregion
|
|
80
|
-
//#region src/modules/fiscal-qr/fiscalQrServices.ts
|
|
81
|
-
/**
|
|
82
|
-
* Submits a scanned Fiscal QR link to the backend.
|
|
83
|
-
*
|
|
84
|
-
* Throws when the request fails OR when the backend rejects the link
|
|
85
|
-
* (`success === false`), so callers can retry/skip — matching the legacy SDK
|
|
86
|
-
* which only advanced when `postResp.success` was truthy.
|
|
87
|
-
*/
|
|
88
|
-
async function submitFiscalQrLink(params, signal) {
|
|
89
|
-
const res = await api.post(endpoints.addFiscalQrLink, params, { signal });
|
|
90
|
-
if (!res.ok) throw new Error(`POST failed: ${res.status}`);
|
|
91
|
-
if (res.data?.success !== true) throw new Error("Fiscal QR link was not accepted");
|
|
92
|
-
return res.data;
|
|
93
|
-
}
|
|
94
|
-
//#endregion
|
|
95
|
-
//#region src/modules/fiscal-qr/fiscalQrStateMachine.ts
|
|
96
|
-
const fiscalQrMachine = setup({
|
|
97
|
-
types: {
|
|
98
|
-
context: {},
|
|
99
|
-
events: {},
|
|
100
|
-
input: {}
|
|
101
|
-
},
|
|
102
|
-
actors: {
|
|
103
|
-
initCamera: fromPromise(async () => {
|
|
104
|
-
const { stream } = await getBackCameraStream(void 0);
|
|
105
|
-
return {
|
|
106
|
-
stream,
|
|
107
|
-
frameCapturer: new StreamCanvasCapture(stream, { fps: 10 })
|
|
108
|
-
};
|
|
109
|
-
}),
|
|
110
|
-
submitFiscalQrLink: fromPromise(async ({ input, signal }) => {
|
|
111
|
-
await submitFiscalQrLink({ poaUrl: input.link }, signal);
|
|
112
|
-
}),
|
|
113
|
-
detectQrCode: fromCallback(({ input, sendBack }) => {
|
|
114
|
-
if (!input.frameCapturer) return () => {};
|
|
115
|
-
return startQrScan(input.frameCapturer, (link) => {
|
|
116
|
-
sendBack({
|
|
117
|
-
type: "QR_DETECTED",
|
|
118
|
-
link
|
|
119
|
-
});
|
|
120
|
-
}, input.applyFocusDelay);
|
|
121
|
-
})
|
|
122
|
-
},
|
|
123
|
-
actions: {
|
|
124
|
-
setLink: assign(({ event }) => {
|
|
125
|
-
if (event.type !== "QR_DETECTED") return {};
|
|
126
|
-
return {
|
|
127
|
-
link: event.link,
|
|
128
|
-
error: void 0
|
|
129
|
-
};
|
|
130
|
-
}),
|
|
131
|
-
setError: assign(({ event }) => ({ error: event.error?.message ?? "Submit failed" })),
|
|
132
|
-
setStream: assign(({ event }) => {
|
|
133
|
-
const { stream, frameCapturer } = event.output;
|
|
134
|
-
return {
|
|
135
|
-
stream,
|
|
136
|
-
frameCapturer,
|
|
137
|
-
error: void 0
|
|
138
|
-
};
|
|
139
|
-
}),
|
|
140
|
-
stopStream: assign(({ context }) => {
|
|
141
|
-
context.frameCapturer?.dispose();
|
|
142
|
-
if (context.stream) stopCameraStream(context.stream);
|
|
143
|
-
return {
|
|
144
|
-
stream: void 0,
|
|
145
|
-
frameCapturer: void 0
|
|
146
|
-
};
|
|
147
|
-
}),
|
|
148
|
-
incrementAttempts: assign(({ context }) => ({ attempts: context.attempts + 1 })),
|
|
149
|
-
resetSession: assign(() => ({
|
|
150
|
-
link: "",
|
|
151
|
-
error: void 0,
|
|
152
|
-
attempts: 0
|
|
153
|
-
})),
|
|
154
|
-
trackSuccess: () => addEvent({
|
|
155
|
-
code: "complete",
|
|
156
|
-
module: eventModuleNames.fiscalQr
|
|
157
|
-
})
|
|
158
|
-
},
|
|
159
|
-
guards: { isMaxAttemptsReached: ({ context }) => context.attempts + 1 >= 3 }
|
|
160
|
-
}).createMachine({
|
|
161
|
-
id: "fiscalQr",
|
|
162
|
-
initial: "idle",
|
|
163
|
-
context: ({ input }) => ({
|
|
164
|
-
config: input.config,
|
|
165
|
-
link: "",
|
|
166
|
-
stream: void 0,
|
|
167
|
-
error: void 0,
|
|
168
|
-
attempts: 0
|
|
169
|
-
}),
|
|
170
|
-
on: { SKIP: ".finished" },
|
|
171
|
-
states: {
|
|
172
|
-
idle: { on: {
|
|
173
|
-
LOAD: "idle",
|
|
174
|
-
CONTINUE: {
|
|
175
|
-
target: "initCamera",
|
|
176
|
-
actions: "resetSession"
|
|
177
|
-
}
|
|
178
|
-
} },
|
|
179
|
-
initCamera: { invoke: {
|
|
180
|
-
id: "initCamera",
|
|
181
|
-
src: "initCamera",
|
|
182
|
-
input: void 0,
|
|
183
|
-
onDone: {
|
|
184
|
-
target: "scanning",
|
|
185
|
-
actions: "setStream"
|
|
186
|
-
},
|
|
187
|
-
onError: {
|
|
188
|
-
target: "scanning",
|
|
189
|
-
actions: "setError"
|
|
190
|
-
}
|
|
191
|
-
} },
|
|
192
|
-
scanning: {
|
|
193
|
-
invoke: {
|
|
194
|
-
id: "detectQrCode",
|
|
195
|
-
src: "detectQrCode",
|
|
196
|
-
input: ({ context }) => ({
|
|
197
|
-
frameCapturer: context.frameCapturer,
|
|
198
|
-
applyFocusDelay: context.attempts === 0
|
|
199
|
-
})
|
|
200
|
-
},
|
|
201
|
-
on: {
|
|
202
|
-
QR_DETECTED: {
|
|
203
|
-
target: "submitting",
|
|
204
|
-
actions: "setLink"
|
|
205
|
-
},
|
|
206
|
-
RESET: {
|
|
207
|
-
target: "idle",
|
|
208
|
-
actions: "stopStream"
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
},
|
|
212
|
-
submitting: { invoke: {
|
|
213
|
-
id: "submitFiscalQrLink",
|
|
214
|
-
src: "submitFiscalQrLink",
|
|
215
|
-
input: ({ context }) => ({ link: context.link }),
|
|
216
|
-
onDone: {
|
|
217
|
-
target: "success",
|
|
218
|
-
actions: "trackSuccess"
|
|
219
|
-
},
|
|
220
|
-
onError: [{
|
|
221
|
-
target: "finished",
|
|
222
|
-
guard: "isMaxAttemptsReached",
|
|
223
|
-
actions: ["incrementAttempts", "setError"]
|
|
224
|
-
}, {
|
|
225
|
-
target: "error",
|
|
226
|
-
actions: ["incrementAttempts", "setError"]
|
|
227
|
-
}]
|
|
228
|
-
} },
|
|
229
|
-
success: { after: { [SUCCESS_DISPLAY_MS]: "processing" } },
|
|
230
|
-
processing: {
|
|
231
|
-
entry: "stopStream",
|
|
232
|
-
after: { [PROCESSING_DISPLAY_MS]: "verified" }
|
|
233
|
-
},
|
|
234
|
-
verified: { after: { [PROCESSING_DISPLAY_MS]: "finished" } },
|
|
235
|
-
error: { after: { [ERROR_DISPLAY_MS]: "scanning" } },
|
|
236
|
-
finished: {
|
|
237
|
-
type: "final",
|
|
238
|
-
entry: "stopStream"
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
});
|
|
242
|
-
//#endregion
|
|
243
|
-
//#region src/modules/fiscal-qr/fiscalQrActor.ts
|
|
244
|
-
/**
|
|
245
|
-
* Creates and starts a Fiscal QR actor.
|
|
246
|
-
* The actor begins in 'idle' state, ready to receive events.
|
|
247
|
-
*/
|
|
248
|
-
function createFiscalQrActor(options) {
|
|
249
|
-
return createActor(fiscalQrMachine, { input: { config: options.config } }).start();
|
|
250
|
-
}
|
|
251
|
-
//#endregion
|
|
252
|
-
//#region src/modules/fiscal-qr/fiscalQrManager.ts
|
|
253
|
-
function mapState(snapshot) {
|
|
254
|
-
const typedSnapshot = snapshot;
|
|
255
|
-
const { stream, error, attempts } = typedSnapshot.context;
|
|
256
|
-
if (typedSnapshot.matches("idle")) return { status: "idle" };
|
|
257
|
-
if (typedSnapshot.matches("initCamera") || typedSnapshot.matches("scanning")) return {
|
|
258
|
-
status: "scanning",
|
|
259
|
-
stream,
|
|
260
|
-
error
|
|
261
|
-
};
|
|
262
|
-
if (typedSnapshot.matches("submitting")) return {
|
|
263
|
-
status: "capturing",
|
|
264
|
-
stream
|
|
265
|
-
};
|
|
266
|
-
if (typedSnapshot.matches("success")) return {
|
|
267
|
-
status: "success",
|
|
268
|
-
stream
|
|
269
|
-
};
|
|
270
|
-
if (typedSnapshot.matches("processing")) return { status: "processing" };
|
|
271
|
-
if (typedSnapshot.matches("verified")) return { status: "verified" };
|
|
272
|
-
if (typedSnapshot.matches("error")) return {
|
|
273
|
-
status: "error",
|
|
274
|
-
error,
|
|
275
|
-
attempts,
|
|
276
|
-
stream
|
|
277
|
-
};
|
|
278
|
-
if (typedSnapshot.matches("finished")) return { status: "finished" };
|
|
279
|
-
return { status: "idle" };
|
|
280
|
-
}
|
|
281
|
-
function createApi({ actor, trackElementClicked }) {
|
|
282
|
-
return {
|
|
283
|
-
load() {
|
|
284
|
-
actor.send({ type: "LOAD" });
|
|
285
|
-
},
|
|
286
|
-
continue() {
|
|
287
|
-
trackElementClicked?.("continue");
|
|
288
|
-
actor.send({ type: "CONTINUE" });
|
|
289
|
-
},
|
|
290
|
-
skip() {
|
|
291
|
-
trackElementClicked?.("skip");
|
|
292
|
-
actor.send({ type: "SKIP" });
|
|
293
|
-
},
|
|
294
|
-
reset() {
|
|
295
|
-
actor.send({ type: "RESET" });
|
|
296
|
-
}
|
|
297
|
-
};
|
|
298
|
-
}
|
|
299
|
-
function createFiscalQrManager(options) {
|
|
300
|
-
return createManager({
|
|
301
|
-
actor: createFiscalQrActor(options),
|
|
302
|
-
mapState,
|
|
303
|
-
createApi,
|
|
304
|
-
instrumentation: createManagerInstrumentation(eventModuleNames.fiscalQr)
|
|
305
|
-
});
|
|
306
|
-
}
|
|
307
|
-
//#endregion
|
|
308
|
-
export { createFiscalQrManager, fiscalQrMachine };
|
|
1
|
+
import { n as createFiscalQrManagerFromActor, r as fiscalQrMachine, t as createFiscalQrManager } from "./fiscalQrManager-DEgB0YYR.esm.js";
|
|
2
|
+
export { createFiscalQrManager, createFiscalQrManagerFromActor, fiscalQrMachine };
|