@checktiv/sdk-web 1.10.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/README.md +16 -1
- package/dist/agents/AGENTS.md +8 -0
- package/dist/agents/manifest.json +12 -0
- package/dist/capture-ui.d.ts +4 -4
- package/dist/capture-ui.js +6 -5
- package/dist/capture.d.ts +3 -3
- package/dist/capture.js +3 -2
- package/dist/challenge.js +2 -2
- package/dist/chunk-3KEVZCCZ.js +3 -0
- package/dist/chunk-CAI3JWWU.js +12 -0
- package/dist/chunk-EOTGVXW6.js +7 -0
- package/dist/{chunk-HV2QKVJX.js → chunk-FQSJUWRP.js} +1 -1
- package/dist/{chunk-YRM5SYRT.js → chunk-HWABVMID.js} +3 -3
- package/dist/chunk-MLQ2HMTS.js +3 -0
- package/dist/chunk-O3JECGW2.js +3 -0
- package/dist/chunk-PB2THQ3P.js +8 -0
- package/dist/chunk-TKK5CTVG.js +59 -0
- package/dist/chunk-VMWTID63.js +3 -0
- package/dist/{chunk-LRKS6JEP.js → chunk-YE2LWN74.js} +1 -1
- package/dist/collect-user-info.d.ts +3 -3
- package/dist/collect-user-info.js +2 -2
- package/dist/{controller-CO5r6vXD.d.ts → controller-Dh-rSrot.d.ts} +2 -1
- package/dist/{copy-D6Sd0BIe.d.ts → copy-Bsb1n1Wv.d.ts} +1 -1
- package/dist/credit-history.d.ts +4 -0
- package/dist/credit-history.js +12 -0
- package/dist/cross-device.js +2 -2
- package/dist/custom-form.css +1 -1
- package/dist/custom-form.d.ts +3 -3
- package/dist/custom-form.js +4 -4
- package/dist/esign/ceremony-runtime.js +1 -1
- package/dist/esign.d.ts +15 -3
- package/dist/esign.js +10 -5
- package/dist/fraud.d.ts +3 -3
- package/dist/fraud.js +2 -2
- package/dist/idv/cross-device.d.ts +7 -7
- package/dist/idv.d.ts +3 -3
- package/dist/idv.js +9 -9
- package/dist/{api-EY_fOZm-.d.ts → index-CGH7LlPH.d.ts} +266 -108
- package/dist/{index-iyKwn5_z.d.ts → index-CZt19Km4.d.ts} +5 -5
- package/dist/index.d.ts +6 -6
- package/dist/index.js +5 -4
- package/dist/{machine-DXxarDcC.d.ts → machine-EePe2ERe.d.ts} +13 -1
- package/dist/react.d.ts +4 -4
- package/dist/react.js +8 -7
- package/dist/workspace.d.ts +3 -3
- package/dist/workspace.js +1 -1
- package/package.json +29 -10
- package/dist/chunk-2SPZA3CQ.js +0 -3
- package/dist/chunk-GFHNOZVO.js +0 -3
- package/dist/chunk-NHNGQ5BB.js +0 -66
- package/dist/chunk-SU6RE6UR.js +0 -12
- package/dist/chunk-T6NMRTFB.js +0 -7
- package/dist/chunk-XOGHMNBX.js +0 -3
- package/dist/chunk-YK4WW4LX.js +0 -7
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { M as MountCopy } from './copy-
|
|
1
|
+
import { l as CaptureBehaviorStep, m as CaptureBehaviorTraits, o as CaptureBrandTokens, p as CaptureTheme, e as CaptureLayout, f as CaptureBehaviorMessage, q as CaptureSessionClientConfig, s as SelfiePromptMap, t as SelfieChromeCopy, B as BeginScanCopyOverrides, C as CoachingKind, k as CaptureTimingSnapshot } from './machine-EePe2ERe.js';
|
|
2
|
+
import { M as MountCopy } from './copy-Bsb1n1Wv.js';
|
|
3
3
|
import { C as CrossDeviceCopy } from './copy-DCeQ4JKx.js';
|
|
4
4
|
|
|
5
5
|
declare const SystemModes: readonly ["live", "test"];
|
|
@@ -20,6 +20,193 @@ interface ChecktivError {
|
|
|
20
20
|
declare const CHECKTIV_ERROR_CODES: readonly ChecktivKnownErrorCode[];
|
|
21
21
|
declare function createChecktivError(code: ChecktivKnownErrorCode): ChecktivError;
|
|
22
22
|
|
|
23
|
+
type ChecktivCustomFormEvent = {
|
|
24
|
+
type: 'checktiv.custom_form.ready';
|
|
25
|
+
} | {
|
|
26
|
+
type: 'checktiv.custom_form.submitted';
|
|
27
|
+
sessionId: string;
|
|
28
|
+
} | {
|
|
29
|
+
type: 'checktiv.custom_form.error';
|
|
30
|
+
error: ChecktivError;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
declare const ESIGN_STATES: readonly ["preparing", "consent", "read", "scroll_incomplete", "adopt", "age_gate", "explain", "sign", "decline", "withdraw", "obscured", "frame_blocked", "age_blocked", "conflict", "token_expired", "protocol_mismatch", "error", "submit_error", "terminal_signed", "terminal_declined", "terminal_voided", "terminal_expired", "terminal_withdrawn"];
|
|
34
|
+
type EsignState = (typeof ESIGN_STATES)[number];
|
|
35
|
+
type TerminalEnvelopeStatus = 'signed' | 'declined' | 'voided' | 'expired';
|
|
36
|
+
declare const TERMINAL_STATUS_TO_STATE: {
|
|
37
|
+
readonly signed: "terminal_signed";
|
|
38
|
+
readonly declined: "terminal_declined";
|
|
39
|
+
readonly voided: "terminal_voided";
|
|
40
|
+
readonly expired: "terminal_expired";
|
|
41
|
+
};
|
|
42
|
+
declare const ESIGN_CONSENT_ACTIONS: readonly ["withdraw_consent", "request_paper_copy"];
|
|
43
|
+
type EsignConsentAction = (typeof ESIGN_CONSENT_ACTIONS)[number];
|
|
44
|
+
type EsignConsentOutcome = 'consent_withdrawn_before_signing' | 'consent_withdrawn_after_signing' | 'paper_copy_requested' | 'paper_copy_already_outstanding';
|
|
45
|
+
type EsignRightsAffordance = 'both' | 'none';
|
|
46
|
+
declare const ESIGN_STATE_RIGHTS: {
|
|
47
|
+
readonly preparing: "none";
|
|
48
|
+
readonly consent: "both";
|
|
49
|
+
readonly read: "both";
|
|
50
|
+
readonly scroll_incomplete: "both";
|
|
51
|
+
readonly adopt: "both";
|
|
52
|
+
readonly age_gate: "both";
|
|
53
|
+
readonly explain: "both";
|
|
54
|
+
readonly sign: "both";
|
|
55
|
+
readonly decline: "both";
|
|
56
|
+
readonly withdraw: "both";
|
|
57
|
+
readonly obscured: "both";
|
|
58
|
+
readonly age_blocked: "none";
|
|
59
|
+
readonly frame_blocked: "none";
|
|
60
|
+
readonly conflict: "none";
|
|
61
|
+
readonly token_expired: "none";
|
|
62
|
+
readonly protocol_mismatch: "none";
|
|
63
|
+
readonly error: "none";
|
|
64
|
+
readonly submit_error: "none";
|
|
65
|
+
readonly terminal_signed: "none";
|
|
66
|
+
readonly terminal_declined: "none";
|
|
67
|
+
readonly terminal_voided: "none";
|
|
68
|
+
readonly terminal_expired: "none";
|
|
69
|
+
readonly terminal_withdrawn: "none";
|
|
70
|
+
};
|
|
71
|
+
declare function esignStateOffersRights(state: EsignState): boolean;
|
|
72
|
+
declare const ESIGN_FRAME_ANNOUNCE_TIMEOUT_MS = 20000;
|
|
73
|
+
|
|
74
|
+
type EsignSubmitOutcome = 'signed' | 'declined';
|
|
75
|
+
type ChecktivEsignEvent = {
|
|
76
|
+
type: 'checktiv.esign.ready';
|
|
77
|
+
} | {
|
|
78
|
+
type: 'checktiv.esign.state';
|
|
79
|
+
state: EsignState;
|
|
80
|
+
} | {
|
|
81
|
+
type: 'checktiv.esign.submitted';
|
|
82
|
+
sessionId: string;
|
|
83
|
+
outcome: EsignSubmitOutcome;
|
|
84
|
+
} | {
|
|
85
|
+
type: 'checktiv.esign.error';
|
|
86
|
+
error: ChecktivError;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
type CreditBrandTokens = CaptureBrandTokens;
|
|
90
|
+
type CreditTheme = CaptureTheme;
|
|
91
|
+
type CreditScreen = 'consent' | 'address_history' | 'identity_and_title' | 'review';
|
|
92
|
+
type CreditErrorCode = 'load_failed' | 'config_error' | 'session_expired' | 'submit_failed';
|
|
93
|
+
type CreditSkipReason = 'unsupported_jurisdiction';
|
|
94
|
+
interface CreditCopyMap {
|
|
95
|
+
continueLabel?: string;
|
|
96
|
+
backLabel?: string;
|
|
97
|
+
submitLabel?: string;
|
|
98
|
+
}
|
|
99
|
+
interface CreditInitMessage {
|
|
100
|
+
type: 'credit:init';
|
|
101
|
+
locale: string;
|
|
102
|
+
theme: CreditTheme;
|
|
103
|
+
copy?: CreditCopyMap;
|
|
104
|
+
}
|
|
105
|
+
type CreditBehaviorStep = CaptureBehaviorStep;
|
|
106
|
+
type CreditBehaviorTraits = CaptureBehaviorTraits;
|
|
107
|
+
interface CreditBehaviorSegment {
|
|
108
|
+
steps: CreditBehaviorStep[];
|
|
109
|
+
traits: CreditBehaviorTraits;
|
|
110
|
+
}
|
|
111
|
+
type CreditFromIframeMessage = {
|
|
112
|
+
type: 'credit:ready';
|
|
113
|
+
} | {
|
|
114
|
+
type: 'credit:resize';
|
|
115
|
+
height: number;
|
|
116
|
+
} | {
|
|
117
|
+
type: 'credit:screen_changed';
|
|
118
|
+
index: number;
|
|
119
|
+
total: number;
|
|
120
|
+
screen: CreditScreen;
|
|
121
|
+
} | {
|
|
122
|
+
type: 'credit:submitted';
|
|
123
|
+
} | {
|
|
124
|
+
type: 'credit:declined';
|
|
125
|
+
} | {
|
|
126
|
+
type: 'credit:skipped';
|
|
127
|
+
reason: CreditSkipReason;
|
|
128
|
+
} | {
|
|
129
|
+
type: 'credit:error';
|
|
130
|
+
code: CreditErrorCode;
|
|
131
|
+
} | {
|
|
132
|
+
type: 'credit:credential_expired';
|
|
133
|
+
} | {
|
|
134
|
+
type: 'credit:behavior';
|
|
135
|
+
steps: CreditBehaviorStep[];
|
|
136
|
+
traits: CreditBehaviorTraits;
|
|
137
|
+
};
|
|
138
|
+
declare const CREDIT_FRAME_MIN_HEIGHT_PX = 200;
|
|
139
|
+
declare const CREDIT_FRAME_MAX_HEIGHT_PX = 20000;
|
|
140
|
+
declare const CREDIT_SCREENS: readonly ["consent", "address_history", "identity_and_title", "review"];
|
|
141
|
+
declare const CREDIT_SCREEN_COUNT: 4;
|
|
142
|
+
declare function projectCreditCopy(copy: CreditCopyMap | undefined): CreditCopyMap | null;
|
|
143
|
+
declare function parseCreditInbound(data: unknown): CreditFromIframeMessage | null;
|
|
144
|
+
|
|
145
|
+
type CreditHistoryReconnectReason = 'bootstrap_timeout' | 'credential_expired';
|
|
146
|
+
type ChecktivCreditHistoryEvent = {
|
|
147
|
+
type: 'checktiv.credit_history.ready';
|
|
148
|
+
} | {
|
|
149
|
+
type: 'checktiv.credit_history.screen';
|
|
150
|
+
screen: CreditScreen;
|
|
151
|
+
index: number;
|
|
152
|
+
total: number;
|
|
153
|
+
} | {
|
|
154
|
+
type: 'checktiv.credit_history.reconnecting';
|
|
155
|
+
reason: CreditHistoryReconnectReason;
|
|
156
|
+
} | {
|
|
157
|
+
type: 'checktiv.credit_history.submitted';
|
|
158
|
+
sessionId: string;
|
|
159
|
+
} | {
|
|
160
|
+
type: 'checktiv.credit_history.declined';
|
|
161
|
+
} | {
|
|
162
|
+
type: 'checktiv.credit_history.skipped';
|
|
163
|
+
reason: CreditSkipReason;
|
|
164
|
+
} | {
|
|
165
|
+
type: 'checktiv.credit_history.error';
|
|
166
|
+
error: ChecktivError;
|
|
167
|
+
};
|
|
168
|
+
declare const CREDIT_HISTORY_EVENT_TYPES: readonly ["checktiv.credit_history.ready", "checktiv.credit_history.screen", "checktiv.credit_history.reconnecting", "checktiv.credit_history.submitted", "checktiv.credit_history.declined", "checktiv.credit_history.skipped", "checktiv.credit_history.error"];
|
|
169
|
+
declare function isChecktivCreditHistoryEvent(event: ChecktivEvent): event is ChecktivCreditHistoryEvent;
|
|
170
|
+
|
|
171
|
+
declare const FORM_FIELD_TYPES: readonly ["short_text", "long_text", "number", "email", "phone", "date", "single_select", "multi_select", "boolean", "file_upload", "content_heading", "content_paragraph"];
|
|
172
|
+
type FormFieldType = (typeof FORM_FIELD_TYPES)[number];
|
|
173
|
+
|
|
174
|
+
type CustomFormApplicantLabel = Record<string, string>;
|
|
175
|
+
interface CustomFormApplicantFieldValidation {
|
|
176
|
+
minLength?: number;
|
|
177
|
+
maxLength?: number;
|
|
178
|
+
min?: number;
|
|
179
|
+
max?: number;
|
|
180
|
+
minSelections?: number;
|
|
181
|
+
maxSelections?: number;
|
|
182
|
+
}
|
|
183
|
+
interface CustomFormApplicantFieldOption {
|
|
184
|
+
value: string;
|
|
185
|
+
label: CustomFormApplicantLabel;
|
|
186
|
+
}
|
|
187
|
+
interface CustomFormApplicantField {
|
|
188
|
+
id: string;
|
|
189
|
+
type: FormFieldType;
|
|
190
|
+
label: CustomFormApplicantLabel;
|
|
191
|
+
helpText?: CustomFormApplicantLabel;
|
|
192
|
+
required: boolean;
|
|
193
|
+
validation?: CustomFormApplicantFieldValidation;
|
|
194
|
+
options?: CustomFormApplicantFieldOption[];
|
|
195
|
+
}
|
|
196
|
+
type CustomFormApplicantConfig = {
|
|
197
|
+
supportedLocales: string[];
|
|
198
|
+
fields: CustomFormApplicantField[];
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
declare const MODULE_SUBPATH: {
|
|
202
|
+
readonly idv: "idv";
|
|
203
|
+
readonly fraud: "fraud";
|
|
204
|
+
readonly custom_form: "custom-form";
|
|
205
|
+
readonly esign: "esign";
|
|
206
|
+
readonly credit_history: "credit-history";
|
|
207
|
+
};
|
|
208
|
+
type SdkModuleName = keyof typeof MODULE_SUBPATH;
|
|
209
|
+
|
|
23
210
|
interface TokenManager {
|
|
24
211
|
get(): Promise<string>;
|
|
25
212
|
refresh(reason: 'expired' | '401'): Promise<string>;
|
|
@@ -36,6 +223,11 @@ type CrossDeviceHandoffHook = () => Promise<{
|
|
|
36
223
|
} | {
|
|
37
224
|
kind: 'unavailable';
|
|
38
225
|
}>;
|
|
226
|
+
interface ForwardedSession {
|
|
227
|
+
sessionId: string;
|
|
228
|
+
stepId: string;
|
|
229
|
+
config: CaptureSessionClientConfig | null;
|
|
230
|
+
}
|
|
39
231
|
interface IdvMountOptions {
|
|
40
232
|
target: HTMLElement | string;
|
|
41
233
|
onEvent?: (e: ChecktivIdvEvent) => void;
|
|
@@ -48,6 +240,7 @@ interface IdvMountOptions {
|
|
|
48
240
|
synthetic?: SyntheticIdvScript;
|
|
49
241
|
onOpenCrossDevice?: CrossDeviceHandoffHook;
|
|
50
242
|
crossDeviceCopy?: CrossDeviceCopy;
|
|
243
|
+
session?: ForwardedSession;
|
|
51
244
|
}
|
|
52
245
|
interface IdvHandle {
|
|
53
246
|
destroy(): void;
|
|
@@ -56,35 +249,8 @@ interface IdvHandle {
|
|
|
56
249
|
}
|
|
57
250
|
declare const REMINT_READY_TIMEOUT_MS = 15000;
|
|
58
251
|
declare function createIdv(ctx: SubstrateContext, opts: IdvMountOptions): IdvHandle;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
type FormFieldType = (typeof FORM_FIELD_TYPES)[number];
|
|
62
|
-
|
|
63
|
-
type CustomFormApplicantLabel = Record<string, string>;
|
|
64
|
-
interface CustomFormApplicantFieldValidation {
|
|
65
|
-
minLength?: number;
|
|
66
|
-
maxLength?: number;
|
|
67
|
-
min?: number;
|
|
68
|
-
max?: number;
|
|
69
|
-
minSelections?: number;
|
|
70
|
-
maxSelections?: number;
|
|
71
|
-
}
|
|
72
|
-
interface CustomFormApplicantFieldOption {
|
|
73
|
-
value: string;
|
|
74
|
-
label: CustomFormApplicantLabel;
|
|
75
|
-
}
|
|
76
|
-
interface CustomFormApplicantField {
|
|
77
|
-
id: string;
|
|
78
|
-
type: FormFieldType;
|
|
79
|
-
label: CustomFormApplicantLabel;
|
|
80
|
-
helpText?: CustomFormApplicantLabel;
|
|
81
|
-
required: boolean;
|
|
82
|
-
validation?: CustomFormApplicantFieldValidation;
|
|
83
|
-
options?: CustomFormApplicantFieldOption[];
|
|
84
|
-
}
|
|
85
|
-
type CustomFormApplicantConfig = {
|
|
86
|
-
supportedLocales: string[];
|
|
87
|
-
fields: CustomFormApplicantField[];
|
|
252
|
+
type IdvChunkModule = {
|
|
253
|
+
createIdv: typeof createIdv;
|
|
88
254
|
};
|
|
89
255
|
|
|
90
256
|
interface CustomFormFieldCopy {
|
|
@@ -111,16 +277,6 @@ interface CustomFormCopy {
|
|
|
111
277
|
readonly booleanNo?: string;
|
|
112
278
|
}
|
|
113
279
|
|
|
114
|
-
type ChecktivCustomFormEvent = {
|
|
115
|
-
type: 'checktiv.custom_form.ready';
|
|
116
|
-
} | {
|
|
117
|
-
type: 'checktiv.custom_form.submitted';
|
|
118
|
-
sessionId: string;
|
|
119
|
-
} | {
|
|
120
|
-
type: 'checktiv.custom_form.error';
|
|
121
|
-
error: ChecktivError;
|
|
122
|
-
};
|
|
123
|
-
|
|
124
280
|
interface CustomFormMountOptions {
|
|
125
281
|
target: HTMLElement | string;
|
|
126
282
|
config: CustomFormApplicantConfig;
|
|
@@ -137,47 +293,9 @@ interface CustomFormHandle {
|
|
|
137
293
|
destroy(): void;
|
|
138
294
|
}
|
|
139
295
|
declare function createCustomForm(ctx: SubstrateContext, opts: CustomFormMountOptions): CustomFormHandle;
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
type EsignState = (typeof ESIGN_STATES)[number];
|
|
143
|
-
type TerminalEnvelopeStatus = 'signed' | 'declined' | 'voided' | 'expired';
|
|
144
|
-
declare const TERMINAL_STATUS_TO_STATE: {
|
|
145
|
-
readonly signed: "terminal_signed";
|
|
146
|
-
readonly declined: "terminal_declined";
|
|
147
|
-
readonly voided: "terminal_voided";
|
|
148
|
-
readonly expired: "terminal_expired";
|
|
296
|
+
type CustomFormChunkModule = {
|
|
297
|
+
createCustomForm: typeof createCustomForm;
|
|
149
298
|
};
|
|
150
|
-
declare const ESIGN_CONSENT_ACTIONS: readonly ["withdraw_consent", "request_paper_copy"];
|
|
151
|
-
type EsignConsentAction = (typeof ESIGN_CONSENT_ACTIONS)[number];
|
|
152
|
-
type EsignConsentOutcome = 'consent_withdrawn_before_signing' | 'consent_withdrawn_after_signing' | 'paper_copy_requested' | 'paper_copy_already_outstanding';
|
|
153
|
-
type EsignRightsAffordance = 'both' | 'none';
|
|
154
|
-
declare const ESIGN_STATE_RIGHTS: {
|
|
155
|
-
readonly preparing: "none";
|
|
156
|
-
readonly consent: "both";
|
|
157
|
-
readonly read: "both";
|
|
158
|
-
readonly scroll_incomplete: "both";
|
|
159
|
-
readonly adopt: "both";
|
|
160
|
-
readonly age_gate: "both";
|
|
161
|
-
readonly explain: "both";
|
|
162
|
-
readonly sign: "both";
|
|
163
|
-
readonly decline: "both";
|
|
164
|
-
readonly withdraw: "both";
|
|
165
|
-
readonly obscured: "both";
|
|
166
|
-
readonly age_blocked: "none";
|
|
167
|
-
readonly frame_blocked: "none";
|
|
168
|
-
readonly conflict: "none";
|
|
169
|
-
readonly token_expired: "none";
|
|
170
|
-
readonly protocol_mismatch: "none";
|
|
171
|
-
readonly error: "none";
|
|
172
|
-
readonly submit_error: "none";
|
|
173
|
-
readonly terminal_signed: "none";
|
|
174
|
-
readonly terminal_declined: "none";
|
|
175
|
-
readonly terminal_voided: "none";
|
|
176
|
-
readonly terminal_expired: "none";
|
|
177
|
-
readonly terminal_withdrawn: "none";
|
|
178
|
-
};
|
|
179
|
-
declare function esignStateOffersRights(state: EsignState): boolean;
|
|
180
|
-
declare const ESIGN_FRAME_ANNOUNCE_TIMEOUT_MS = 20000;
|
|
181
299
|
|
|
182
300
|
type EsignCopy = Partial<Record<EsignState, string>> & {
|
|
183
301
|
frameTitle?: string;
|
|
@@ -322,31 +440,6 @@ declare function resolveEsignCopy(copy: EsignCopy | undefined, state: EsignState
|
|
|
322
440
|
declare function resolveEsignFrameTitle(copy: EsignCopy | undefined): string;
|
|
323
441
|
declare const ESIGN_COPY_STATE_KEYS: readonly EsignState[];
|
|
324
442
|
|
|
325
|
-
type EsignSubmitOutcome = 'signed' | 'declined';
|
|
326
|
-
type ChecktivEsignEvent = {
|
|
327
|
-
type: 'checktiv.esign.ready';
|
|
328
|
-
} | {
|
|
329
|
-
type: 'checktiv.esign.state';
|
|
330
|
-
state: EsignState;
|
|
331
|
-
} | {
|
|
332
|
-
type: 'checktiv.esign.submitted';
|
|
333
|
-
sessionId: string;
|
|
334
|
-
outcome: EsignSubmitOutcome;
|
|
335
|
-
} | {
|
|
336
|
-
type: 'checktiv.esign.error';
|
|
337
|
-
error: ChecktivError;
|
|
338
|
-
};
|
|
339
|
-
|
|
340
|
-
interface EsignContextMint {
|
|
341
|
-
contextToken: string;
|
|
342
|
-
embedOrigin: string;
|
|
343
|
-
disclosureLocale: string;
|
|
344
|
-
}
|
|
345
|
-
declare function parseEsignMint(body: unknown): EsignContextMint | null;
|
|
346
|
-
declare function parseEsignPending(body: unknown): {
|
|
347
|
-
retryAfterMs: number;
|
|
348
|
-
} | null;
|
|
349
|
-
|
|
350
443
|
interface EsignMountOptions {
|
|
351
444
|
target: HTMLElement | string;
|
|
352
445
|
copy?: EsignCopy;
|
|
@@ -366,6 +459,62 @@ interface EsignHandle {
|
|
|
366
459
|
destroy(): void;
|
|
367
460
|
}
|
|
368
461
|
declare function createEsign(ctx: SubstrateContext, opts: EsignMountOptions): EsignHandle;
|
|
462
|
+
type EsignChunkModule = {
|
|
463
|
+
createEsign: typeof createEsign;
|
|
464
|
+
};
|
|
465
|
+
|
|
466
|
+
interface CreditContextMint {
|
|
467
|
+
readonly creditContextToken: string;
|
|
468
|
+
readonly embedOrigin: string;
|
|
469
|
+
readonly expiresAt: string;
|
|
470
|
+
}
|
|
471
|
+
interface CreditHistoryScheduler {
|
|
472
|
+
set(callback: () => void, ms: number): unknown;
|
|
473
|
+
clear(handle: unknown): void;
|
|
474
|
+
}
|
|
475
|
+
interface CreditHistoryHostWindow extends Pick<Window, 'addEventListener' | 'removeEventListener'> {
|
|
476
|
+
readonly parent: {
|
|
477
|
+
postMessage(message: unknown, targetOrigin: string): void;
|
|
478
|
+
};
|
|
479
|
+
}
|
|
480
|
+
interface CreditHistoryOptions {
|
|
481
|
+
readonly win: CreditHistoryHostWindow;
|
|
482
|
+
readonly target: HTMLElement;
|
|
483
|
+
readonly sessionId: string;
|
|
484
|
+
readonly locale: string;
|
|
485
|
+
readonly theme: CreditTheme;
|
|
486
|
+
readonly copy?: CreditCopyMap;
|
|
487
|
+
readonly frameTitle?: string;
|
|
488
|
+
readonly readyTimeoutMs?: number;
|
|
489
|
+
readonly schedule?: CreditHistoryScheduler;
|
|
490
|
+
mintContext(): Promise<CreditContextMint>;
|
|
491
|
+
onEvent?(event: ChecktivCreditHistoryEvent): void;
|
|
492
|
+
onBehaviorSegment?(segment: CreditBehaviorSegment): void;
|
|
493
|
+
}
|
|
494
|
+
interface CreditHistoryController {
|
|
495
|
+
start(): void;
|
|
496
|
+
destroy(): void;
|
|
497
|
+
}
|
|
498
|
+
declare function clampFrameHeight(height: number): number;
|
|
499
|
+
declare function createCreditHistory(options: CreditHistoryOptions): CreditHistoryController;
|
|
500
|
+
|
|
501
|
+
interface CreditHistoryMountOptions {
|
|
502
|
+
target: HTMLElement | string;
|
|
503
|
+
session: {
|
|
504
|
+
sessionId: string;
|
|
505
|
+
stepId: string;
|
|
506
|
+
};
|
|
507
|
+
onEvent?: (event: ChecktivCreditHistoryEvent) => void;
|
|
508
|
+
copy?: CreditCopyMap;
|
|
509
|
+
frameTitle?: string;
|
|
510
|
+
onBehaviorSegment?: (segment: CreditBehaviorSegment) => void;
|
|
511
|
+
fetchImpl?: typeof fetch;
|
|
512
|
+
win?: CreditHistoryHostWindow;
|
|
513
|
+
}
|
|
514
|
+
interface CreditHistoryHandle {
|
|
515
|
+
destroy(): void;
|
|
516
|
+
}
|
|
517
|
+
declare function createCreditHistoryModule(ctx: SubstrateContext, opts: CreditHistoryMountOptions): CreditHistoryHandle;
|
|
369
518
|
|
|
370
519
|
interface ProvisionedHandle {
|
|
371
520
|
destroy(): void;
|
|
@@ -385,6 +534,7 @@ interface MountProvisionedOptions {
|
|
|
385
534
|
customFormConfig?: CustomFormApplicantConfig;
|
|
386
535
|
customFormCopy?: CustomFormCopy;
|
|
387
536
|
esignCopy?: EsignCopy;
|
|
537
|
+
creditCopy?: CreditCopyMap;
|
|
388
538
|
crossDeviceCopy?: CrossDeviceCopy;
|
|
389
539
|
onOpenCrossDevice?: CrossDeviceHandoffHook;
|
|
390
540
|
onRequestHelp?: EsignMountOptions['onRequestHelp'];
|
|
@@ -416,10 +566,12 @@ type ChecktivInitScope = {
|
|
|
416
566
|
type ChecktivInitOptions = ChecktivInitOptionsBase & ChecktivInitScope;
|
|
417
567
|
interface ChecktivClient {
|
|
418
568
|
mountProvisioned(opts: MountProvisionedOptions): ProvisionedHandle;
|
|
569
|
+
preload(modules: readonly SdkModuleName[]): void;
|
|
419
570
|
mount(module: 'idv', opts: IdvMountOptions): IdvHandle;
|
|
420
571
|
mount(module: 'fraud', opts: FraudMountOptions): FraudHandle;
|
|
421
572
|
mount(module: 'custom_form', opts: CustomFormMountOptions): CustomFormHandle;
|
|
422
573
|
mount(module: 'esign', opts: EsignMountOptions): EsignHandle;
|
|
574
|
+
mount(module: 'credit_history', opts: CreditHistoryMountOptions): CreditHistoryHandle;
|
|
423
575
|
}
|
|
424
576
|
interface SubstrateContext {
|
|
425
577
|
readonly region: SdkRegion;
|
|
@@ -452,6 +604,9 @@ interface FraudHandle {
|
|
|
452
604
|
destroy(): void;
|
|
453
605
|
}
|
|
454
606
|
declare function createFraud(ctx: SubstrateContext, opts: FraudMountOptions): FraudHandle;
|
|
607
|
+
type FraudChunkModule = {
|
|
608
|
+
createFraud: typeof createFraud;
|
|
609
|
+
};
|
|
455
610
|
|
|
456
611
|
type IdvCoachingHint = CoachingKind;
|
|
457
612
|
interface ResolvedIdvConfig {
|
|
@@ -487,7 +642,9 @@ type ChecktivIdvEvent = {
|
|
|
487
642
|
type: 'checktiv.idv.cross_device_capped';
|
|
488
643
|
} | {
|
|
489
644
|
type: 'checktiv.idv.cross_device_closed';
|
|
490
|
-
}
|
|
645
|
+
} | ({
|
|
646
|
+
type: 'checktiv.idv.timing';
|
|
647
|
+
} & CaptureTimingSnapshot);
|
|
491
648
|
type ChecktivEvent = ChecktivIdvEvent | ChecktivFraudEvent | {
|
|
492
649
|
type: `checktiv.${string}`;
|
|
493
650
|
[k: string]: unknown;
|
|
@@ -549,6 +706,7 @@ interface SessionsCreateApplicant {
|
|
|
549
706
|
readonly dateOfBirth?: string;
|
|
550
707
|
readonly address?: SessionsCreateApplicantAddress;
|
|
551
708
|
readonly referenceName?: string;
|
|
709
|
+
readonly bookingName?: string;
|
|
552
710
|
}
|
|
553
711
|
interface SessionsCreateInput {
|
|
554
712
|
readonly templateId: string;
|
|
@@ -575,4 +733,4 @@ declare class InvalidPublishableKeyError extends Error {
|
|
|
575
733
|
}
|
|
576
734
|
declare function parsePublishableKey(key: string): ParsedPublishableKey;
|
|
577
735
|
|
|
578
|
-
export {
|
|
736
|
+
export { type SdkRegion as $, type EsignRightsKey as A, type EsignShellKey as B, type ChecktivEsignEvent as C, type EsignState as D, ESIGN_CONSENT_ACTIONS as E, type EsignSubmitOutcome as F, type EsignTerminalState as G, type TerminalEnvelopeStatus as H, createEsign as I, esignStateOffersRights as J, resolveEsignCopy as K, resolveEsignDocumentCopy as L, resolveEsignFrameTitle as M, resolveEsignLabel as N, resolveEsignOutcomeCopy as O, resolveEsignRightsCopy as P, resolveEsignShellCopy as Q, resolveEsignTerminalStatus as R, type ChecktivIdvEvent as S, TERMINAL_STATUS_TO_STATE as T, type MountOptions as U, type ChecktivInitOptions as V, type ChecktivInitScope as W, type ChecktivClient as X, type SubstrateContext as Y, type CrossDeviceHandoffHook as Z, type TokenManager as _, ESIGN_COPY_FALLBACKS as a, type CreditHistoryController as a$, type ProvisionedHandle as a0, type InitOptions as a1, type ChecktivSessions as a2, CHECKTIV_ERROR_CODES as a3, type ChecktivCreditHistoryEvent as a4, type ChecktivError as a5, type ChecktivErrorCode as a6, type ChecktivEvent as a7, type ChecktivFraudEvent as a8, type ChecktivKnownErrorCode as a9, isChecktivCreditHistoryEvent as aA, parsePublishableKey as aB, type ForwardedSession as aC, type IdvChunkModule as aD, REMINT_READY_TIMEOUT_MS as aE, createIdv as aF, type FraudChunkModule as aG, createFraud as aH, type ChecktivCustomFormEvent as aI, type CustomFormChunkModule as aJ, type CustomFormCopy as aK, type CustomFormFieldCopy as aL, type CustomFormHandle as aM, type CustomFormMountOptions as aN, createCustomForm as aO, CREDIT_FRAME_MAX_HEIGHT_PX as aP, CREDIT_FRAME_MIN_HEIGHT_PX as aQ, CREDIT_HISTORY_EVENT_TYPES as aR, CREDIT_SCREENS as aS, CREDIT_SCREEN_COUNT as aT, type CreditBehaviorSegment as aU, type CreditBehaviorStep as aV, type CreditBehaviorTraits as aW, type CreditBrandTokens as aX, type CreditContextMint as aY, type CreditCopyMap as aZ, type CreditFromIframeMessage as a_, type ChecktivRecovery as aa, type CreditErrorCode as ab, type CreditHistoryReconnectReason as ac, type CreditScreen as ad, type CreditSkipReason as ae, type FraudHandle as af, type FraudMountOptions as ag, type GetSessionToken as ah, type GetSessionTokenContext as ai, type IdvCoachingHint as aj, type IdvHandle as ak, type IdvMountOptions as al, InvalidPublishableKeyError as am, type MountCompleteResult as an, type MountProvisionedOptions as ao, type MountScope as ap, type ParsedPublishableKey as aq, type ResolvedIdvConfig as ar, type SdkMode as as, type SessionsCreateApplicant as at, type SessionsCreateApplicantAddress as au, type SessionsCreateInput as av, type SessionsCreateOptions as aw, type SessionsCreateResult as ax, type SyntheticIdvScript as ay, createChecktivError as az, ESIGN_COPY_STATE_KEYS as b, type CreditHistoryHandle as b0, type CreditHistoryHostWindow as b1, type CreditHistoryMountOptions as b2, type CreditHistoryOptions as b3, type CreditHistoryScheduler as b4, type CreditInitMessage as b5, type CreditTheme as b6, clampFrameHeight as b7, createCreditHistory as b8, createCreditHistoryModule as b9, parseCreditInbound as ba, projectCreditCopy as bb, ESIGN_COUNT_TOKEN as c, ESIGN_DOCUMENT_FALLBACKS as d, ESIGN_DOCUMENT_KEYS as e, ESIGN_FRAME_ANNOUNCE_TIMEOUT_MS as f, ESIGN_LABELS as g, ESIGN_LABEL_FALLBACKS as h, ESIGN_OUTCOME_RIGHTS_KEY as i, ESIGN_RIGHTS_FALLBACKS as j, ESIGN_RIGHTS_KEYS as k, ESIGN_SHELL_FALLBACKS as l, ESIGN_SHELL_KEYS as m, ESIGN_STATES as n, ESIGN_STATE_RIGHTS as o, ESIGN_TERMINAL_STATUS_KEY as p, type EsignChunkModule as q, type EsignConsentAction as r, type EsignConsentOutcome as s, type EsignCopy as t, type EsignCopyScalarKey as u, type EsignDocumentCopyKey as v, type EsignHandle as w, type EsignLabel as x, type EsignMountOptions as y, type EsignRightsAffordance as z };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { ReactNode, ReactElement } from 'react';
|
|
3
3
|
import { CollectUserInfoSession, CollectUserInfoCollector } from './collect-user-info.js';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { M as MountCopy } from './copy-
|
|
4
|
+
import { S as ChecktivIdvEvent, U as MountOptions, V as ChecktivInitOptions, W as ChecktivInitScope, X as ChecktivClient } from './index-CGH7LlPH.js';
|
|
5
|
+
import { e as CaptureLayout, f as CaptureBehaviorMessage } from './machine-EePe2ERe.js';
|
|
6
|
+
import { M as MountCopy } from './copy-Bsb1n1Wv.js';
|
|
7
7
|
|
|
8
8
|
interface SelfServiceResendResult {
|
|
9
9
|
readonly requested: boolean;
|
|
@@ -31,7 +31,7 @@ interface ChecktivJourneyHandle {
|
|
|
31
31
|
requestResend(confirmEmail: string): Promise<SelfServiceResendResult>;
|
|
32
32
|
openCrossDevice(): void;
|
|
33
33
|
}
|
|
34
|
-
declare const ChecktivJourney:
|
|
34
|
+
declare const ChecktivJourney: React.ForwardRefExoticComponent<MountOptions & React.RefAttributes<ChecktivJourneyHandle>>;
|
|
35
35
|
declare function useCollectUserInfo(session: CollectUserInfoSession): CollectUserInfoCollector;
|
|
36
36
|
|
|
37
37
|
export { type ChecktivIdvProps as C, type SelfServiceResendResult as S, type ChecktivJourneyHandle as a, type ChecktivJourneyProps as b, type ChecktivProviderProps as c, ChecktivIdv as d, ChecktivJourney as e, ChecktivProvider as f, type ChecktivProviderPropsBase as g, useCollectUserInfo as h, useChecktiv as u };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import { S as SelfServiceResendResult } from './index-
|
|
4
|
-
export { C as ChecktivIdvProps, a as ChecktivJourneyHandle, b as ChecktivJourneyProps, c as ChecktivProviderProps } from './index-
|
|
1
|
+
import { V as ChecktivInitOptions, _ as TokenManager, X as ChecktivClient, $ as SdkRegion, a0 as ProvisionedHandle, U as MountOptions, a1 as InitOptions, a2 as ChecktivSessions } from './index-CGH7LlPH.js';
|
|
2
|
+
export { a3 as CHECKTIV_ERROR_CODES, a4 as ChecktivCreditHistoryEvent, a5 as ChecktivError, a6 as ChecktivErrorCode, C as ChecktivEsignEvent, a7 as ChecktivEvent, a8 as ChecktivFraudEvent, S as ChecktivIdvEvent, a9 as ChecktivKnownErrorCode, aa as ChecktivRecovery, ab as CreditErrorCode, ac as CreditHistoryReconnectReason, ad as CreditScreen, ae as CreditSkipReason, Z as CrossDeviceHandoffHook, t as EsignCopy, w as EsignHandle, y as EsignMountOptions, D as EsignState, af as FraudHandle, ag as FraudMountOptions, ah as GetSessionToken, ai as GetSessionTokenContext, aj as IdvCoachingHint, ak as IdvHandle, al as IdvMountOptions, am as InvalidPublishableKeyError, an as MountCompleteResult, ao as MountProvisionedOptions, ap as MountScope, aq as ParsedPublishableKey, ar as ResolvedIdvConfig, as as SdkMode, at as SessionsCreateApplicant, au as SessionsCreateApplicantAddress, av as SessionsCreateInput, aw as SessionsCreateOptions, ax as SessionsCreateResult, ay as SyntheticIdvScript, az as createChecktivError, aA as isChecktivCreditHistoryEvent, aB as parsePublishableKey } from './index-CGH7LlPH.js';
|
|
3
|
+
import { S as SelfServiceResendResult } from './index-CZt19Km4.js';
|
|
4
|
+
export { C as ChecktivIdvProps, a as ChecktivJourneyHandle, b as ChecktivJourneyProps, c as ChecktivProviderProps } from './index-CZt19Km4.js';
|
|
5
5
|
export { C as CrossDeviceCopy } from './copy-DCeQ4JKx.js';
|
|
6
|
-
import './machine-
|
|
7
|
-
import './copy-
|
|
6
|
+
import './machine-EePe2ERe.js';
|
|
7
|
+
import './copy-Bsb1n1Wv.js';
|
|
8
8
|
import 'react';
|
|
9
9
|
import './collect-user-info.js';
|
|
10
10
|
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
export { init, isSessionsCreateError, mount, mountButton, sessions, version } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { init, isSessionsCreateError, mount, mountButton, sessions, version } from './chunk-CAI3JWWU.js';
|
|
2
|
+
import './chunk-3KEVZCCZ.js';
|
|
3
3
|
export { InvalidPublishableKeyError, parsePublishableKey } from './chunk-WALPQ6TH.js';
|
|
4
|
-
import './chunk-
|
|
5
|
-
import './chunk-YK4WW4LX.js';
|
|
4
|
+
import './chunk-EOTGVXW6.js';
|
|
6
5
|
import './chunk-IQKHRPJR.js';
|
|
7
6
|
import './chunk-UBQTPS5J.js';
|
|
7
|
+
export { isChecktivCreditHistoryEvent } from './chunk-O3JECGW2.js';
|
|
8
|
+
import './chunk-VMWTID63.js';
|
|
8
9
|
export { CHECKTIV_ERROR_CODES, createChecktivError } from './chunk-C7GRMEYT.js';
|
|
9
10
|
export { regionToApiBase } from './chunk-HFQJYEGZ.js';
|
|
10
11
|
import './chunk-QFA3K5ZV.js';
|
|
@@ -18,6 +18,7 @@ interface SelfieChromeCopy {
|
|
|
18
18
|
interface BeginScanCopyOverrides {
|
|
19
19
|
prompt?: string;
|
|
20
20
|
label?: string;
|
|
21
|
+
progressSlowLabel?: string;
|
|
21
22
|
cameraStartingLabel?: string;
|
|
22
23
|
cameraUnavailableNotice?: string;
|
|
23
24
|
uploadPrompt?: string;
|
|
@@ -74,6 +75,12 @@ interface IdVerificationConfig {
|
|
|
74
75
|
allowDocumentUpload?: boolean;
|
|
75
76
|
minAge?: number;
|
|
76
77
|
}
|
|
78
|
+
interface CaptureSessionClientConfig {
|
|
79
|
+
documentTypes: IdvDocumentType[];
|
|
80
|
+
biometricMode: 'none' | 'selfie' | 'liveness';
|
|
81
|
+
minAge?: number;
|
|
82
|
+
allowDocumentUpload: boolean;
|
|
83
|
+
}
|
|
77
84
|
interface CaptureInitMessage {
|
|
78
85
|
type: 'capture:init';
|
|
79
86
|
captureToken: string;
|
|
@@ -112,6 +119,11 @@ interface CaptureBehaviorMessage {
|
|
|
112
119
|
steps: CaptureBehaviorStep[];
|
|
113
120
|
traits: CaptureBehaviorTraits;
|
|
114
121
|
}
|
|
122
|
+
interface CaptureTimingSnapshot {
|
|
123
|
+
providerImportMs?: number;
|
|
124
|
+
gateDwellMs?: number;
|
|
125
|
+
captureUiMs?: number;
|
|
126
|
+
}
|
|
115
127
|
interface SdkCrossDeviceStatusResponse {
|
|
116
128
|
advanced: boolean;
|
|
117
129
|
currentStepId: string | null;
|
|
@@ -195,4 +207,4 @@ declare function reducer(state: CaptureState, action: CaptureAction): CaptureSta
|
|
|
195
207
|
declare function nextCapturePhaseAfterDocument(side: CaptureDocumentSide, documentTypes: IdVerificationConfig['documentTypes'], biometricMode: IdVerificationConfig['biometricMode']): CapturePhase;
|
|
196
208
|
declare function isBiometricPhase(phase: CapturePhase): boolean;
|
|
197
209
|
|
|
198
|
-
export { type BeginScanCopyOverrides as B, type
|
|
210
|
+
export { type BeginScanCopyOverrides as B, type CoachingKind as C, type DataMode as D, type IdvR2Keys as I, type SdkCrossDeviceStatusResponse as S, type TestHint as T, type CaptureAction as a, type CaptureErrorKind as b, type CapturePhase as c, type CaptureState as d, type CaptureLayout as e, type CaptureBehaviorMessage as f, type IdvAcquisition as g, type CaptureInitMessage as h, isBiometricPhase as i, type CaptureInitStaticKey as j, type CaptureTimingSnapshot as k, type CaptureBehaviorStep as l, type CaptureBehaviorTraits as m, nextCapturePhaseAfterDocument as n, type CaptureBrandTokens as o, type CaptureTheme as p, type CaptureSessionClientConfig as q, reducer as r, type SelfiePromptMap as s, type SelfieChromeCopy as t };
|
package/dist/react.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import 'react';
|
|
2
2
|
import './collect-user-info.js';
|
|
3
|
-
import './
|
|
4
|
-
import './machine-
|
|
5
|
-
import './copy-
|
|
6
|
-
export { d as ChecktivIdv, C as ChecktivIdvProps, e as ChecktivJourney, a as ChecktivJourneyHandle, b as ChecktivJourneyProps, f as ChecktivProvider, c as ChecktivProviderProps, g as ChecktivProviderPropsBase, u as useChecktiv, h as useCollectUserInfo } from './index-
|
|
3
|
+
import './index-CGH7LlPH.js';
|
|
4
|
+
import './machine-EePe2ERe.js';
|
|
5
|
+
import './copy-Bsb1n1Wv.js';
|
|
6
|
+
export { d as ChecktivIdv, C as ChecktivIdvProps, e as ChecktivJourney, a as ChecktivJourneyHandle, b as ChecktivJourneyProps, f as ChecktivProvider, c as ChecktivProviderProps, g as ChecktivProviderPropsBase, u as useChecktiv, h as useCollectUserInfo } from './index-CZt19Km4.js';
|
|
7
7
|
import './copy-DCeQ4JKx.js';
|
package/dist/react.js
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { mount, init } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import { collectUserInfo } from './chunk-
|
|
1
|
+
import { mount, init } from './chunk-CAI3JWWU.js';
|
|
2
|
+
import './chunk-3KEVZCCZ.js';
|
|
3
|
+
import { collectUserInfo } from './chunk-YE2LWN74.js';
|
|
4
4
|
import './chunk-WALPQ6TH.js';
|
|
5
|
-
import './chunk-
|
|
6
|
-
import './chunk-YK4WW4LX.js';
|
|
5
|
+
import './chunk-EOTGVXW6.js';
|
|
7
6
|
import './chunk-IQKHRPJR.js';
|
|
8
7
|
import './chunk-UBQTPS5J.js';
|
|
8
|
+
import './chunk-O3JECGW2.js';
|
|
9
|
+
import './chunk-VMWTID63.js';
|
|
9
10
|
import './chunk-C7GRMEYT.js';
|
|
10
11
|
import './chunk-HFQJYEGZ.js';
|
|
11
12
|
import './chunk-QFA3K5ZV.js';
|
|
12
13
|
import './chunk-AIK7CDV6.js';
|
|
14
|
+
import * as React from 'react';
|
|
13
15
|
import { createContext, forwardRef, useRef, useImperativeHandle, useEffect, useMemo, useContext } from 'react';
|
|
14
|
-
import { jsx } from 'react/jsx-runtime';
|
|
15
16
|
|
|
16
|
-
var ChecktivContext=createContext(null);function ChecktivProvider(props){if(typeof window==="undefined")return null;return
|
|
17
|
+
var ChecktivContext=createContext(null);function ChecktivProvider(props){if(typeof window==="undefined")return null;return React.createElement(ProviderImpl,{...props})}function ProviderImpl(props){const{getSessionToken,theme,locale,children}=props;const scope="publishableKey"in props?{publishableKey:props.publishableKey}:{region:props.region,mode:props.mode};const pk="publishableKey"in props?props.publishableKey:void 0;const region="publishableKey"in props?void 0:props.region;const mode="publishableKey"in props?void 0:props.mode;const themeKey=JSON.stringify(theme??null);const client=useMemo(()=>init({...scope,getSessionToken,theme,locale}),[pk,region,mode,getSessionToken,themeKey,locale]);return React.createElement(ChecktivContext.Provider,{value:client},children)}function useChecktiv(){const client=useContext(ChecktivContext);if(client===null){throw new Error("useChecktiv must be used within a <ChecktivProvider>. Wrap the component tree that needs the Checktiv client with <ChecktivProvider>.")}return client}function ChecktivIdv({onEvent,copy,layout,onBeforeSubmit,onBehaviorSegment}){const client=useChecktiv();const containerRef=useRef(null);const handleRef=useRef(null);const mountConfigRef=useRef({copy,layout,onBeforeSubmit,onBehaviorSegment});const onEventRef=useRef(onEvent);onEventRef.current=onEvent;useEffect(()=>{if(typeof window==="undefined")return;if(containerRef.current===null)return;if(handleRef.current!==null)return;const mountConfig=mountConfigRef.current;handleRef.current=client.mount("idv",{target:containerRef.current,onEvent:e=>onEventRef.current(e),...mountConfig.copy!==void 0?{copy:mountConfig.copy}:{},...mountConfig.layout!==void 0?{layout:mountConfig.layout}:{},...mountConfig.onBeforeSubmit!==void 0?{onBeforeSubmit:mountConfig.onBeforeSubmit}:{},...mountConfig.onBehaviorSegment!==void 0?{onBehaviorSegment:mountConfig.onBehaviorSegment}:{}});return ()=>{handleRef.current?.destroy();handleRef.current=null;}},[client]);if(typeof window==="undefined")return null;return React.createElement("div",{ref:containerRef})}function pinnedJourneyConfig(props){return {fetchToken:props.fetchToken,onConsent:props.onConsent,layout:props.layout,theme:props.theme,copy:props.copy,resumeKey:props.resumeKey,shortCode:props.shortCode,apiBase:props.apiBase,fetchImpl:props.fetchImpl,crossDeviceCopy:props.crossDeviceCopy,onOpenCrossDevice:props.onOpenCrossDevice,maxWidth:props.maxWidth}}function latestJourneyHandlers(props){return {onEvent:props.onEvent,onComplete:props.onComplete,onError:props.onError}}var ChecktivJourneyImpl=(props,ref)=>{const containerRef=useRef(null);const handleRef=useRef(null);const scope="publishableKey"in props?{publishableKey:props.publishableKey}:{region:props.region,mode:props.mode};const pk="publishableKey"in props?props.publishableKey:void 0;const region="publishableKey"in props?void 0:props.region;const mode="publishableKey"in props?void 0:props.mode;const journeyConfig=pinnedJourneyConfig(props);const mountConfigRef=useRef(journeyConfig);mountConfigRef.current=journeyConfig;const handlers=latestJourneyHandlers(props);const handlersRef=useRef(handlers);handlersRef.current=handlers;useImperativeHandle(ref,()=>({requestResend:confirmEmail=>handleRef.current?.requestResend(confirmEmail)??Promise.resolve({requested:false}),openCrossDevice:()=>handleRef.current?.openCrossDevice?.()}),[]);useEffect(()=>{if(typeof window==="undefined")return;if(containerRef.current===null)return;if(handleRef.current!==null)return;const cfg=mountConfigRef.current;const opts={...scope,fetchToken:cfg.fetchToken,onEvent:e=>handlersRef.current.onEvent?.(e),onComplete:r=>handlersRef.current.onComplete?.(r),onError:err=>handlersRef.current.onError?.(err),...cfg.onConsent!==void 0?{onConsent:cfg.onConsent}:{},...cfg.layout!==void 0?{layout:cfg.layout}:{},...cfg.theme!==void 0?{theme:cfg.theme}:{},...cfg.copy!==void 0?{copy:cfg.copy}:{},...cfg.resumeKey!==void 0?{resumeKey:cfg.resumeKey}:{},...cfg.shortCode!==void 0?{shortCode:cfg.shortCode}:{},...cfg.apiBase!==void 0?{apiBase:cfg.apiBase}:{},...cfg.fetchImpl!==void 0?{fetchImpl:cfg.fetchImpl}:{},...cfg.crossDeviceCopy!==void 0?{crossDeviceCopy:cfg.crossDeviceCopy}:{},...cfg.onOpenCrossDevice!==void 0?{onOpenCrossDevice:cfg.onOpenCrossDevice}:{},...cfg.maxWidth!==void 0?{maxWidth:cfg.maxWidth}:{}};handleRef.current=mount(containerRef.current,opts);return ()=>{handleRef.current?.destroy();handleRef.current=null;}},[pk,region,mode]);if(typeof window==="undefined")return null;return React.createElement("div",{ref:containerRef})};var ChecktivJourney=forwardRef(ChecktivJourneyImpl);function useCollectUserInfo(session){const sessionRef=useRef(session);return useMemo(()=>collectUserInfo({session:sessionRef.current}),[])}
|
|
17
18
|
|
|
18
19
|
export { ChecktivIdv, ChecktivJourney, ChecktivProvider, useChecktiv, useCollectUserInfo };
|