@stytch/vanilla-js 4.5.5 → 4.6.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.
@@ -144,26 +144,27 @@ var h, p, f, _, m, v;
144
144
  }(_ || (_ = {})), function (e) {
145
145
  e.SMS = "sms", e.WhatsApp = "whatsapp", e.Email = "email";
146
146
  }(m || (m = {})), function (e) {
147
- e.MagicLinkLoginOrCreateEvent = "MAGIC_LINK_LOGIN_OR_CREATE", e.OTPsLoginOrCreateEvent = "OTP_LOGIN_OR_CREATE", e.OTPsAuthenticate = "OTP_AUTHENTICATE", e.CryptoWalletAuthenticateStart = "CRYPTO_WALLET_AUTHENTICATE_START", e.CryptoWalletAuthenticate = "CRYPTO_WALLET_AUTHENTICATE", e.PasswordCreate = "PASSWORD_CREATE", e.PasswordAuthenticate = "PASSWORD_AUTHENTICATE", e.PasswordResetByEmailStart = "PASSWORD_RESET_BY_EMAIL_START", e.PasswordResetByEmail = "PASSWORD_RESET_BY_EMAIL", e.PasskeyRegister = "PASSKEY_REGISTER", e.PasskeyAuthenticate = "PASSKEY_AUTHENTICATE", e.PasskeySkip = "PASSKEY_SKIP", e.PasskeyDone = "PASSKEY_DONE", e.B2BMagicLinkEmailLoginOrSignup = "B2B_MAGIC_LINK_EMAIL_LOGIN_OR_SIGNUP", e.B2BMagicLinkAuthenticate = "B2B_MAGIC_LINK_AUTHENTICATE", e.B2BMagicLinkEmailDiscoverySend = "B2B_MAGIC_LINK_EMAIL_DISCOVERY_SEND", e.B2BMagicLinkDiscoveryAuthenticate = "B2B_MAGIC_LINK_DISCOVERY_AUTHENTICATE", e.B2BSSOStart = "B2B_SSO_START", e.B2BSSOAuthenticate = "B2B_SSO_AUTHENTICATE", e.B2BOAuthAuthenticate = "B2B_OAUTH_AUTHENTICATE", e.B2BOAuthDiscoveryAuthenticate = "B2B_OAUTH_DISCOVERY_AUTHENTICATE", e.B2BDiscoveryOrganizationsCreate = "B2B_DISCOVERY_ORGANIZATIONS_CREATE", e.B2BDiscoveryIntermediateSessionExchange = "B2B_DISCOVERY_INTERMEDIATE_SESSION_EXCHANGE", e.B2BPasswordAuthenticate = "B2B_PASSWORD_AUTHENTICATE", e.B2BPasswordResetByEmailStart = "B2B_PASSWORD_RESET_BY_EMAIL_START", e.B2BPasswordResetByEmail = "B2B_PASSWORD_RESET_BY_EMAIL", e.B2BPasswordResetBySession = "B2B_PASSWORD_RESET_BY_SESSION";
147
+ e.MagicLinkLoginOrCreateEvent = "MAGIC_LINK_LOGIN_OR_CREATE", e.OTPsLoginOrCreateEvent = "OTP_LOGIN_OR_CREATE", e.OTPsAuthenticate = "OTP_AUTHENTICATE", e.CryptoWalletAuthenticateStart = "CRYPTO_WALLET_AUTHENTICATE_START", e.CryptoWalletAuthenticate = "CRYPTO_WALLET_AUTHENTICATE", e.PasswordCreate = "PASSWORD_CREATE", e.PasswordAuthenticate = "PASSWORD_AUTHENTICATE", e.PasswordResetByEmailStart = "PASSWORD_RESET_BY_EMAIL_START", e.PasswordResetByEmail = "PASSWORD_RESET_BY_EMAIL", e.PasskeyRegister = "PASSKEY_REGISTER", e.PasskeyAuthenticate = "PASSKEY_AUTHENTICATE", e.PasskeySkip = "PASSKEY_SKIP", e.PasskeyDone = "PASSKEY_DONE", e.B2BMagicLinkEmailLoginOrSignup = "B2B_MAGIC_LINK_EMAIL_LOGIN_OR_SIGNUP", e.B2BMagicLinkAuthenticate = "B2B_MAGIC_LINK_AUTHENTICATE", e.B2BMagicLinkEmailDiscoverySend = "B2B_MAGIC_LINK_EMAIL_DISCOVERY_SEND", e.B2BMagicLinkDiscoveryAuthenticate = "B2B_MAGIC_LINK_DISCOVERY_AUTHENTICATE", e.B2BSSOStart = "B2B_SSO_START", e.B2BSSOAuthenticate = "B2B_SSO_AUTHENTICATE", e.B2BOAuthAuthenticate = "B2B_OAUTH_AUTHENTICATE", e.B2BOAuthDiscoveryAuthenticate = "B2B_OAUTH_DISCOVERY_AUTHENTICATE", e.B2BDiscoveryOrganizationsCreate = "B2B_DISCOVERY_ORGANIZATIONS_CREATE", e.B2BDiscoveryIntermediateSessionExchange = "B2B_DISCOVERY_INTERMEDIATE_SESSION_EXCHANGE", e.B2BPasswordAuthenticate = "B2B_PASSWORD_AUTHENTICATE", e.B2BPasswordResetByEmailStart = "B2B_PASSWORD_RESET_BY_EMAIL_START", e.B2BPasswordResetByEmail = "B2B_PASSWORD_RESET_BY_EMAIL", e.B2BPasswordResetBySession = "B2B_PASSWORD_RESET_BY_SESSION", e.B2BSMSOTPSend = "B2B_SMS_OTP_SEND", e.B2BSMSOTPAuthenticate = "B2B_SMS_OTP_AUTHENTICATE", e.B2BTOTPCreate = "B2B_TOTP_CREATE", e.B2BTOTPAuthenticate = "B2B_TOTP_AUTHENTICATE", e.B2BRecoveryCodesRecover = "B2B_RECOVERY_CODES_RECOVER";
148
148
  }(v || (v = {}));
149
149
  var y,
150
150
  g,
151
151
  b,
152
- k = function (e) {
152
+ k,
153
+ w = function (e) {
153
154
  function t(e, r) {
154
155
  var n;
155
156
  return i(this, t), (n = s(this, t, [e + "\n" + r])).message = e + "\n" + r, n.name = "SDKAPIUnreachableError", n.details = r, Object.setPrototypeOf(o(n), t.prototype), n;
156
157
  }
157
158
  return a(t, c(Error)), r(t);
158
159
  }(),
159
- w = function (e) {
160
+ S = function (e) {
160
161
  function t(e, r) {
161
162
  var n;
162
163
  return i(this, t), (n = s(this, t)).name = "StytchSDKUsageError", n.message = "Invalid call to ".concat(e, "\n") + r, n;
163
164
  }
164
165
  return a(t, c(Error)), r(t);
165
166
  }(),
166
- S = function (e) {
167
+ C = function (e) {
167
168
  function t(e) {
168
169
  var r, n;
169
170
  i(this, t), (r = s(this, t)).name = "StytchSDKSchemaError";
@@ -174,7 +175,7 @@ var y,
174
175
  }
175
176
  return a(t, c(Error)), r(t);
176
177
  }(),
177
- C = function (e) {
178
+ T = function (e) {
178
179
  function t(e) {
179
180
  var r;
180
181
  i(this, t), (r = s(this, t)).name = "StytchSDKAPIError";
@@ -187,22 +188,22 @@ var y,
187
188
  }
188
189
  return a(t, c(Error)), r(t);
189
190
  }(),
190
- T = ["unauthorized_credentials", "user_unauthenticated", "invalid_secret_authentication", "session_not_found"],
191
- O = function (e) {
191
+ O = ["unauthorized_credentials", "user_unauthenticated", "invalid_secret_authentication", "session_not_found"],
192
+ P = function (e) {
192
193
  function t(e, r) {
193
194
  var n;
194
195
  return i(this, t), (n = s(this, t, [r])).name = e, n;
195
196
  }
196
197
  return a(t, c(Error)), r(t);
197
198
  }(),
198
- P = function (e) {
199
+ A = function (e) {
199
200
  function t(e) {
200
201
  var r;
201
202
  return i(this, t), r = s(this, t, ["StytchAPIUnreachableError", e]), Object.setPrototypeOf(o(r), t.prototype), r;
202
203
  }
203
- return a(t, O), r(t);
204
+ return a(t, P), r(t);
204
205
  }(),
205
- A = function (e) {
206
+ x = function (e) {
206
207
  function t(e) {
207
208
  var r;
208
209
  i(this, t);
@@ -211,9 +212,9 @@ var y,
211
212
  }).join("\n");
212
213
  return s(this, t, ["StytchAPISchemaError", "Request does not match expected schema\n".concat(n)]);
213
214
  }
214
- return a(t, O), r(t);
215
+ return a(t, P), r(t);
215
216
  }(),
216
- x = function (e) {
217
+ E = function (e) {
217
218
  function t(e) {
218
219
  var r;
219
220
  i(this, t);
@@ -224,260 +225,260 @@ var y,
224
225
  u = e.request_id;
225
226
  return (r = s(this, t, ["StytchAPIError", "[".concat(n, "] ").concat(o, "\n") + "".concat(a, "\n") + "See ".concat(c, " for more information.\n") + (u ? "request_id: ".concat(u, "\n") : "")])).error_type = o, r.error_message = a, r.error_url = c, r.request_id = u, r.status_code = n, r;
226
227
  }
227
- return a(t, O), r(t);
228
+ return a(t, P), r(t);
228
229
  }(),
229
- E = function (e) {
230
+ D = function (e) {
230
231
  function t(e, r, n) {
231
232
  var o;
232
233
  return i(this, t), (o = s(this, t, [e, r])).options = n, o;
233
234
  }
234
- return a(t, O), r(t);
235
+ return a(t, P), r(t);
235
236
  }(),
236
- D = function (e) {
237
+ R = function (e) {
237
238
  function t() {
238
239
  return i(this, t), s(this, t, ["NoCurrentSessionError", "There is no session currently available. Make sure the user is authenticated with a valid session."]);
239
240
  }
240
- return a(t, E), r(t);
241
+ return a(t, D), r(t);
241
242
  }(),
242
- R = function (e) {
243
+ I = function (e) {
243
244
  function t(e) {
244
245
  return i(this, t), s(this, t, ["InternalError", e || "An internal error has occurred. Please contact Stytch if this occurs."]);
245
246
  }
246
- return a(t, E), r(t);
247
+ return a(t, D), r(t);
247
248
  }(),
248
- I = function (e) {
249
+ F = function (e) {
249
250
  function t() {
250
251
  return i(this, t), s(this, t, ["NoBiometricsRegistrationError", "There is no biometric registration available. Authenticate with another method and add a new biometric registration first."]);
251
252
  }
252
- return a(t, E), r(t);
253
+ return a(t, D), r(t);
253
254
  }(),
254
- F = function (e) {
255
+ j = function (e) {
255
256
  function t() {
256
257
  return i(this, t), s(this, t, ["BiometricsUnavailableError", "Biometrics is not available on the device."]);
257
258
  }
258
- return a(t, E), r(t);
259
+ return a(t, D), r(t);
259
260
  }(),
260
- j = function (e) {
261
+ L = function (e) {
261
262
  function t() {
262
263
  return i(this, t), s(this, t, ["KeyInvalidatedError", "The biometrics enrollment on the device has changed."]);
263
264
  }
264
- return a(t, E), r(t);
265
+ return a(t, D), r(t);
265
266
  }(),
266
- L = function (e) {
267
+ B = function (e) {
267
268
  function t() {
268
269
  return i(this, t), s(this, t, ["KeystoreUnavailableError", "The Android keystore is unavailable on the device. Consider setting allowFallbackToCleartext to true."]);
269
270
  }
270
- return a(t, E), r(t);
271
+ return a(t, D), r(t);
271
272
  }(),
272
- B = function (e) {
273
+ M = function (e) {
273
274
  function t() {
274
275
  return i(this, t), s(this, t, ["NoBiometricsEnrolledError", "There is no biometric factor enrolled on the device. Add a biometric factor in the device settings."]);
275
276
  }
276
- return a(t, E), r(t);
277
+ return a(t, D), r(t);
277
278
  }(),
278
- M = function (e) {
279
+ N = function (e) {
279
280
  function t() {
280
281
  return i(this, t), s(this, t, ["UserCancellationError", "The user canceled the prompt. Ask the user to try again."]);
281
282
  }
282
- return a(t, E), r(t);
283
+ return a(t, D), r(t);
283
284
  }(),
284
- N = function (e) {
285
+ U = function (e) {
285
286
  function t() {
286
287
  return i(this, t), s(this, t, ["UserLockedOutError", "The user has been locked out due to too many failed attempts. Ask the user to try again later."]);
287
288
  }
288
- return a(t, E), r(t);
289
+ return a(t, D), r(t);
289
290
  }(),
290
- U = function (e) {
291
+ K = function (e) {
291
292
  function t() {
292
293
  return i(this, t), s(this, t, ["DeviceCredentialsNotAllowedError", "The device credentials allowment is mismatched. Change the allowDeviceCredentials parameter to be the same in both the register and authenticate methods."]);
293
294
  }
294
- return a(t, E), r(t);
295
+ return a(t, D), r(t);
295
296
  }(),
296
- K = function (e) {
297
+ q = function (e) {
297
298
  function t() {
298
299
  return i(this, t), s(this, t, ["MissingGoogleClientIDError", "No Google client ID was found in the project."]);
299
300
  }
300
- return a(t, E), r(t);
301
+ return a(t, D), r(t);
301
302
  }(),
302
- q = function (e) {
303
+ W = function (e) {
303
304
  function t() {
304
305
  return i(this, t), s(this, t, ["MissingPKCEError", "Make sure this flow is completed on the same device on which it was started."]);
305
306
  }
306
- return a(t, E), r(t);
307
+ return a(t, D), r(t);
307
308
  }(),
308
- W = function (e) {
309
+ H = function (e) {
309
310
  function t() {
310
311
  return i(this, t), s(this, t, ["MissingAuthorizationCredentialIDTokenError", "The authorization credential is missing an ID token."]);
311
312
  }
312
- return a(t, E), r(t);
313
+ return a(t, D), r(t);
313
314
  }(),
314
315
  G = function (e) {
315
316
  function t() {
316
317
  return i(this, t), s(this, t, ["InvalidAuthorizationCredentialError", "The authorization credential is invalid. Verify that OAuth is set up correctly in the developer console, and call the start flow method."]);
317
318
  }
318
- return a(t, E), r(t);
319
+ return a(t, D), r(t);
319
320
  }(),
320
- H = function (e) {
321
+ z = function (e) {
321
322
  function t() {
322
323
  return i(this, t), s(this, t, ["MissingPublicKeyError", "Failed to retrieve the public key. Add a new biometric registration."]);
323
324
  }
324
- return a(t, E), r(t);
325
+ return a(t, D), r(t);
325
326
  }(),
326
- z = function (e) {
327
+ V = function (e) {
327
328
  function t() {
328
329
  return i(this, t), s(this, t, ["ChallengeSigningFailedError", "Failed to sign the challenge with the key."]);
329
330
  }
330
- return a(t, E), r(t);
331
+ return a(t, D), r(t);
331
332
  }(),
332
333
  Y = function (e) {
333
334
  function t() {
334
335
  return i(this, t), s(this, t, ["SDKNotConfiguredError", "Stytch client is not confiured. You must call the configure method before using the SDK"]);
335
336
  }
336
- return a(t, E), r(t);
337
+ return a(t, D), r(t);
337
338
  }(),
338
- V = function (e) {
339
+ J = function (e) {
339
340
  function t() {
340
341
  return i(this, t), s(this, t, ["FailedCodeChallengeError", "Failed to create a code challenge"]);
341
342
  }
342
- return a(t, E), r(t);
343
+ return a(t, D), r(t);
343
344
  }(),
344
- J = function (e) {
345
+ $ = function (e) {
345
346
  function t() {
346
347
  return i(this, t), s(this, t, ["PasskeysUnsupportedError", "Passkeys are not supported on this device"]);
347
348
  }
348
- return a(t, E), r(t);
349
+ return a(t, D), r(t);
349
350
  }(),
350
- $ = function (e) {
351
+ X = function (e) {
351
352
  function t() {
352
353
  return i(this, t), s(this, t, ["FailedToDecryptDataError", "Failed to decrypt user data"]);
353
354
  }
354
- return a(t, E), r(t);
355
+ return a(t, D), r(t);
355
356
  }(),
356
- X = function (e) {
357
+ Z = function (e) {
357
358
  function t() {
358
359
  return i(this, t), s(this, t, ["BiometricsFailedError", "Biometric authentication failed"]);
359
360
  }
360
- return a(t, E), r(t);
361
+ return a(t, D), r(t);
361
362
  }(),
362
- Z = function (e) {
363
+ Q = function (e) {
363
364
  function t() {
364
365
  return i(this, t), s(this, t, ["InvalidStartUrlError", "The start URL was invalid or improperly formatted."]);
365
366
  }
366
- return a(t, E), r(t);
367
+ return a(t, D), r(t);
367
368
  }(),
368
- Q = function (e) {
369
+ ee = function (e) {
369
370
  function t() {
370
371
  return i(this, t), s(this, t, ["InvalidRedirectSchemeError", "The scheme from the given redirect urls was invalid. Possible reasons include: nil scheme, non-custom scheme (using http or https), or differing schemes for login/signup urls."]);
371
372
  }
372
- return a(t, E), r(t);
373
+ return a(t, D), r(t);
373
374
  }(),
374
- ee = function (e) {
375
+ te = function (e) {
375
376
  function t() {
376
377
  return i(this, t), s(this, t, ["MissingUrlError", "The underlying web authentication service failed to return a URL."]);
377
378
  }
378
- return a(t, E), r(t);
379
+ return a(t, D), r(t);
379
380
  }(),
380
- te = function (e) {
381
+ re = function (e) {
381
382
  function t() {
382
383
  return i(this, t), s(this, t, ["InvalidCredentialTypeError", "The public key credential type was not of the expected type."]);
383
384
  }
384
- return a(t, E), r(t);
385
+ return a(t, D), r(t);
385
386
  }(),
386
- re = function (e) {
387
+ ne = function (e) {
387
388
  function t() {
388
389
  return i(this, t), s(this, t, ["MissingAttestationObjectError", "The public key credential is missing the attestation object."]);
389
390
  }
390
- return a(t, E), r(t);
391
+ return a(t, D), r(t);
391
392
  }(),
392
- ne = function (e) {
393
+ ie = function (e) {
393
394
  function t() {
394
395
  return i(this, t), s(this, t, ["JSONDataNotConvertibleToStringError", "JSON data unable to be converted to String type."]);
395
396
  }
396
- return a(t, E), r(t);
397
+ return a(t, D), r(t);
397
398
  }(),
398
- ie = function (e) {
399
+ se = function (e) {
399
400
  function t() {
400
401
  return i(this, t), s(this, t, ["RandomNumberGenerationFailed", "Random number generation failed"]);
401
402
  }
402
- return a(t, E), r(t);
403
+ return a(t, D), r(t);
403
404
  }(),
404
- se = function (e) {
405
+ oe = function (e) {
405
406
  function t() {
406
407
  return i(this, t), s(this, t, ["PasskeysInvalidEncoding", "Invalid passkey encoding"]);
407
408
  }
408
- return a(t, E), r(t);
409
+ return a(t, D), r(t);
409
410
  }();
410
- function oe(e) {
411
+ function ae(e) {
411
412
  switch (e.message) {
412
413
  case "internal_error":
413
- return new R(e.message);
414
+ return new I(e.message);
414
415
  case "no_current_session":
415
- return new D();
416
+ return new R();
416
417
  case "no_biometrics_registration":
417
- return new I();
418
+ return new F();
418
419
  case "biometrics_unavailable":
419
420
  case "device_hardware_error":
420
421
  case "biometrics_not_available":
421
- return new F();
422
+ return new j();
422
423
  case "key_invalidated":
423
424
  case "no_biometric_key":
424
- return new j();
425
+ return new L();
425
426
  case "no_biometrics_enrolled":
426
- return new B();
427
+ return new M();
427
428
  case "keystore_unavailable":
428
- return new L();
429
+ return new B();
429
430
  case "device_credentials_not_allowed":
430
- return new U();
431
+ return new K();
431
432
  case "user_cancellation":
432
- return new M();
433
- case "user_locked_out":
434
433
  return new N();
434
+ case "user_locked_out":
435
+ return new U();
435
436
  case "google_onetap_missing_id_token":
436
437
  case "oauth_apple_missing_id_token":
437
438
  case "missing_authorization_credential_id_token":
438
- return new W();
439
+ return new H();
439
440
  case "google_onetap_missing_member":
440
441
  case "oauth_apple_credential_invalid":
441
442
  case "invalid_authorization_credential":
442
443
  return new G();
443
444
  case "missing_public_key":
444
- return new H();
445
- case "challenge_signing_failed":
446
445
  return new z();
446
+ case "challenge_signing_failed":
447
+ return new V();
447
448
  case "sdk_not_configured":
448
449
  return new Y();
449
450
  case "failed_code_challenge":
450
- return new V();
451
- case "passkeys_unsupported":
452
451
  return new J();
453
- case "failed_to_decrypt_data":
452
+ case "passkeys_unsupported":
454
453
  return new $();
455
- case "biometrics_failed":
454
+ case "failed_to_decrypt_data":
456
455
  return new X();
457
- case "invalid_start_url":
456
+ case "biometrics_failed":
458
457
  return new Z();
459
- case "invalid_redirect_scheme":
458
+ case "invalid_start_url":
460
459
  return new Q();
461
- case "missing_url":
460
+ case "invalid_redirect_scheme":
462
461
  return new ee();
463
- case "invalid_credential_type":
462
+ case "missing_url":
464
463
  return new te();
465
- case "missing_attestation_object":
464
+ case "invalid_credential_type":
466
465
  return new re();
467
- case "json_data_not_convertible_to_string":
466
+ case "missing_attestation_object":
468
467
  return new ne();
469
- case "random_number_generation_failed":
468
+ case "json_data_not_convertible_to_string":
470
469
  return new ie();
471
- case "passkeys_invalid_encoding":
470
+ case "random_number_generation_failed":
472
471
  return new se();
472
+ case "passkeys_invalid_encoding":
473
+ return new oe();
473
474
  default:
474
- return new E(e.name, e.message);
475
+ return new D(e.name, e.message);
475
476
  }
476
477
  }
477
- function ae(e, t) {
478
+ function ce(e, t) {
478
479
  var r = "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
479
480
  if (!r) {
480
- if (Array.isArray(e) || (r = ue(e)) || t && e && "number" == typeof e.length) {
481
+ if (Array.isArray(e) || (r = le(e)) || t && e && "number" == typeof e.length) {
481
482
  r && (e = r);
482
483
  var _n = 0,
483
484
  i = function i() {};
@@ -522,7 +523,7 @@ function ae(e, t) {
522
523
  }
523
524
  };
524
525
  }
525
- function ce(e, t) {
526
+ function ue(e, t) {
526
527
  return function (e) {
527
528
  if (Array.isArray(e)) return e;
528
529
  }(e) || function (e, t) {
@@ -551,32 +552,32 @@ function ce(e, t) {
551
552
  }
552
553
  return a;
553
554
  }
554
- }(e, t) || ue(e, t) || function () {
555
+ }(e, t) || le(e, t) || function () {
555
556
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
556
557
  }();
557
558
  }
558
- function ue(e, t) {
559
+ function le(e, t) {
559
560
  if (e) {
560
- if ("string" == typeof e) return le(e, t);
561
+ if ("string" == typeof e) return de(e, t);
561
562
  var r = Object.prototype.toString.call(e).slice(8, -1);
562
- return "Object" === r && e.constructor && (r = e.constructor.name), "Map" === r || "Set" === r ? Array.from(e) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? le(e, t) : void 0;
563
+ return "Object" === r && e.constructor && (r = e.constructor.name), "Map" === r || "Set" === r ? Array.from(e) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? de(e, t) : void 0;
563
564
  }
564
565
  }
565
- function le(e, t) {
566
+ function de(e, t) {
566
567
  (null == t || t > e.length) && (t = e.length);
567
568
  for (var r = 0, n = new Array(t); r < t; r++) n[r] = e[r];
568
569
  return n;
569
570
  }
570
- function de(e) {
571
- return de = "function" == typeof Symbol && "symbol" == _typeof(Symbol.iterator) ? function (e) {
571
+ function he(e) {
572
+ return he = "function" == typeof Symbol && "symbol" == _typeof(Symbol.iterator) ? function (e) {
572
573
  return _typeof(e);
573
574
  } : function (e) {
574
575
  return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : _typeof(e);
575
- }, de(e);
576
+ }, he(e);
576
577
  }
577
- function he() {
578
+ function pe() {
578
579
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
579
- he = function he() {
580
+ pe = function pe() {
580
581
  return t;
581
582
  };
582
583
  var e,
@@ -656,7 +657,7 @@ function he() {
656
657
  if ("throw" !== c.type) {
657
658
  var u = c.arg,
658
659
  l = u.value;
659
- return l && "object" == de(l) && n.call(l, "__await") ? t.resolve(l.__await).then(function (e) {
660
+ return l && "object" == he(l) && n.call(l, "__await") ? t.resolve(l.__await).then(function (e) {
660
661
  r("next", e, o, a);
661
662
  }, function (e) {
662
663
  r("throw", e, o, a);
@@ -755,7 +756,7 @@ function he() {
755
756
  return s.next = s;
756
757
  }
757
758
  }
758
- throw new TypeError(de(t) + " is not iterable");
759
+ throw new TypeError(he(t) + " is not iterable");
759
760
  }
760
761
  return y.prototype = g, i(S, "constructor", {
761
762
  value: g,
@@ -876,46 +877,46 @@ function he() {
876
877
  }
877
878
  }, t;
878
879
  }
879
- function pe(e, t) {
880
+ function fe(e, t) {
880
881
  for (var r = 0; r < t.length; r++) {
881
882
  var n = t[r];
882
- n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, _e(n.key), n);
883
+ n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, me(n.key), n);
883
884
  }
884
885
  }
885
- function fe(e, t, r) {
886
- return t && pe(e.prototype, t), r && pe(e, r), Object.defineProperty(e, "prototype", {
886
+ function _e(e, t, r) {
887
+ return t && fe(e.prototype, t), r && fe(e, r), Object.defineProperty(e, "prototype", {
887
888
  writable: !1
888
889
  }), e;
889
890
  }
890
- function _e(e) {
891
+ function me(e) {
891
892
  var t = function (e, t) {
892
- if ("object" != de(e) || !e) return e;
893
+ if ("object" != he(e) || !e) return e;
893
894
  var r = e[Symbol.toPrimitive];
894
895
  if (void 0 !== r) {
895
896
  var n = r.call(e, t || "default");
896
- if ("object" != de(n)) return n;
897
+ if ("object" != he(n)) return n;
897
898
  throw new TypeError("@@toPrimitive must return a primitive value.");
898
899
  }
899
900
  return ("string" === t ? String : Number)(e);
900
901
  }(e, "string");
901
- return "symbol" == de(t) ? t : String(t);
902
+ return "symbol" == he(t) ? t : String(t);
902
903
  }
903
- function me(e, t) {
904
+ function ve(e, t) {
904
905
  if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
905
906
  }
906
- function ve(e, t, r) {
907
- return t = ke(t), function (e, t) {
908
- if (t && ("object" === de(t) || "function" == typeof t)) return t;
907
+ function ye(e, t, r) {
908
+ return t = we(t), function (e, t) {
909
+ if (t && ("object" === he(t) || "function" == typeof t)) return t;
909
910
  if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
910
911
  return function (e) {
911
912
  if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
912
913
  return e;
913
914
  }(e);
914
- }(e, ge() ? Reflect.construct(t, r || [], ke(e).constructor) : t.apply(e, r));
915
+ }(e, be() ? Reflect.construct(t, r || [], we(e).constructor) : t.apply(e, r));
915
916
  }
916
- function ye(e) {
917
+ function ge(e) {
917
918
  var t = "function" == typeof Map ? new Map() : void 0;
918
- return ye = function ye(e) {
919
+ return ge = function ge(e) {
919
920
  if (null === e || !function (e) {
920
921
  try {
921
922
  return -1 !== Function.toString.call(e).indexOf("[native code]");
@@ -930,12 +931,12 @@ function ye(e) {
930
931
  }
931
932
  function r() {
932
933
  return function (e, t, r) {
933
- if (ge()) return Reflect.construct.apply(null, arguments);
934
+ if (be()) return Reflect.construct.apply(null, arguments);
934
935
  var n = [null];
935
936
  n.push.apply(n, t);
936
937
  var i = new (e.bind.apply(e, n))();
937
- return r && be(i, r.prototype), i;
938
- }(e, arguments, ke(this).constructor);
938
+ return r && ke(i, r.prototype), i;
939
+ }(e, arguments, we(this).constructor);
939
940
  }
940
941
  return r.prototype = Object.create(e.prototype, {
941
942
  constructor: {
@@ -944,38 +945,40 @@ function ye(e) {
944
945
  writable: !0,
945
946
  configurable: !0
946
947
  }
947
- }), be(r, e);
948
- }, ye(e);
948
+ }), ke(r, e);
949
+ }, ge(e);
949
950
  }
950
- function ge() {
951
+ function be() {
951
952
  try {
952
953
  var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
953
954
  } catch (e) {}
954
- return (ge = function ge() {
955
+ return (be = function be() {
955
956
  return !!e;
956
957
  })();
957
958
  }
958
- function be(e, t) {
959
- return be = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (e, t) {
959
+ function ke(e, t) {
960
+ return ke = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (e, t) {
960
961
  return e.__proto__ = t, e;
961
- }, be(e, t);
962
+ }, ke(e, t);
962
963
  }
963
- function ke(e) {
964
- return ke = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (e) {
964
+ function we(e) {
965
+ return we = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (e) {
965
966
  return e.__proto__ || Object.getPrototypeOf(e);
966
- }, ke(e);
967
+ }, we(e);
967
968
  }
968
969
  !function (e) {
969
970
  e.emailMagicLinks = "emailMagicLinks", e.sso = "sso", e.passwords = "passwords", e.oauth = "oauth";
970
971
  }(y || (y = {})), function (e) {
971
972
  e.Discovery = "Discovery", e.Organization = "Organization", e.PasswordReset = "PasswordReset";
972
973
  }(g || (g = {})), function (e) {
974
+ e.smsOtp = "smsOtp", e.totp = "totp";
975
+ }(b || (b = {})), function (e) {
973
976
  e.Google = "google", e.Microsoft = "microsoft";
974
- }(b || (b = {}));
975
- var we,
976
- Se = "https://accounts.google.com/gsi",
977
- Ce = "".concat(Se, "/client");
978
- function Te(e, t) {
977
+ }(k || (k = {}));
978
+ var Se,
979
+ Ce = "https://accounts.google.com/gsi",
980
+ Te = "".concat(Ce, "/client");
981
+ function Oe(e, t) {
979
982
  var r = {};
980
983
  for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (r[n] = e[n]);
981
984
  if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
@@ -984,7 +987,7 @@ function Te(e, t) {
984
987
  }
985
988
  return r;
986
989
  }
987
- function Oe(e, t, r, n) {
990
+ function Pe(e, t, r, n) {
988
991
  return new (r || (r = Promise))(function (i, s) {
989
992
  function o(e) {
990
993
  try {
@@ -1011,12 +1014,12 @@ function Oe(e, t, r, n) {
1011
1014
  }
1012
1015
  "function" == typeof SuppressedError && SuppressedError, function (e) {
1013
1016
  e.RequiredCatcha = "Catcha Required";
1014
- }(we || (we = {}));
1015
- var Pe,
1016
- Ae = function (e) {
1017
+ }(Se || (Se = {}));
1018
+ var Ae,
1019
+ xe = function (e) {
1017
1020
  function t(e) {
1018
1021
  var r;
1019
- return me(this, t), (r = ve(this, t, [e])).type = e, r;
1022
+ return ve(this, t), (r = ye(this, t, [e])).type = e, r;
1020
1023
  }
1021
1024
  return function (e, t) {
1022
1025
  if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
@@ -1028,10 +1031,10 @@ var Pe,
1028
1031
  }
1029
1032
  }), Object.defineProperty(e, "prototype", {
1030
1033
  writable: !1
1031
- }), t && be(e, t);
1032
- }(t, ye(Error)), fe(t);
1034
+ }), t && ke(e, t);
1035
+ }(t, ge(Error)), _e(t);
1033
1036
  }();
1034
- function xe(e) {
1037
+ function Ee(e) {
1035
1038
  var t,
1036
1039
  r = e.method,
1037
1040
  n = e.finalURL,
@@ -1039,9 +1042,9 @@ function xe(e) {
1039
1042
  s = e.xSDKClientHeader,
1040
1043
  o = e.xSDKParentHostHeader,
1041
1044
  a = e.body;
1042
- return Oe(this, void 0, void 0, he().mark(function e() {
1045
+ return Pe(this, void 0, void 0, pe().mark(function e() {
1043
1046
  var c, u, l, d, h, p;
1044
- return he().wrap(function (e) {
1047
+ return pe().wrap(function (e) {
1045
1048
  for (;;) switch (e.prev = e.next) {
1046
1049
  case 0:
1047
1050
  return c = {
@@ -1061,7 +1064,7 @@ function xe(e) {
1061
1064
  e.next = 13;
1062
1065
  break;
1063
1066
  }
1064
- throw new P("Unable to contact the Stytch servers. Are you online?");
1067
+ throw new A("Unable to contact the Stytch servers. Are you online?");
1065
1068
  case 13:
1066
1069
  throw e.t0;
1067
1070
  case 14:
@@ -1073,7 +1076,7 @@ function xe(e) {
1073
1076
  case 18:
1074
1077
  return d = e.sent, e.abrupt("return", d.data);
1075
1078
  case 22:
1076
- throw e.prev = 22, e.t1 = e["catch"](15), new P("Invalid JSON response from the Stytch servers.");
1079
+ throw e.prev = 22, e.t1 = e["catch"](15), new A("Invalid JSON response from the Stytch servers.");
1077
1080
  case 25:
1078
1081
  if (200 === l.status || !(null === (t = l.headers.get("content-type")) || void 0 === t ? void 0 : t.includes("application/json"))) {
1079
1082
  e.next = 38;
@@ -1084,30 +1087,30 @@ function xe(e) {
1084
1087
  h = e.sent, e.next = 35;
1085
1088
  break;
1086
1089
  case 32:
1087
- throw e.prev = 32, e.t2 = e["catch"](26), new P("Invalid or no response from server");
1090
+ throw e.prev = 32, e.t2 = e["catch"](26), new A("Invalid or no response from server");
1088
1091
  case 35:
1089
1092
  if (!("body" in h || "params" in h || "query" in h)) {
1090
1093
  e.next = 37;
1091
1094
  break;
1092
1095
  }
1093
- throw new A(h);
1094
- case 37:
1095
1096
  throw new x(h);
1097
+ case 37:
1098
+ throw new E(h);
1096
1099
  case 38:
1097
1100
  return e.prev = 38, e.next = 41, l.text();
1098
1101
  case 41:
1099
1102
  p = e.sent, e.next = 47;
1100
1103
  break;
1101
1104
  case 44:
1102
- throw e.prev = 44, e.t3 = e["catch"](38), new P("Invalid response from the Stytch servers.");
1105
+ throw e.prev = 44, e.t3 = e["catch"](38), new A("Invalid response from the Stytch servers.");
1103
1106
  case 47:
1104
1107
  if (!p.includes("Captcha required")) {
1105
1108
  e.next = 49;
1106
1109
  break;
1107
1110
  }
1108
- throw new Ae(we.RequiredCatcha);
1111
+ throw new xe(Se.RequiredCatcha);
1109
1112
  case 49:
1110
- throw new P("Invalid response from the Stytch servers.");
1113
+ throw new A("Invalid response from the Stytch servers.");
1111
1114
  case 50:
1112
1115
  case "end":
1113
1116
  return e.stop();
@@ -1115,43 +1118,43 @@ function xe(e) {
1115
1118
  }, e, null, [[3, 9], [15, 22], [26, 32], [38, 44]]);
1116
1119
  }));
1117
1120
  }
1118
- var Ee = new Uint8Array(16);
1119
- function De() {
1120
- if (!Pe && !(Pe = "undefined" != typeof crypto && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || "undefined" != typeof msCrypto && "function" == typeof msCrypto.getRandomValues && msCrypto.getRandomValues.bind(msCrypto))) throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
1121
- return Pe(Ee);
1121
+ var De = new Uint8Array(16);
1122
+ function Re() {
1123
+ if (!Ae && !(Ae = "undefined" != typeof crypto && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || "undefined" != typeof msCrypto && "function" == typeof msCrypto.getRandomValues && msCrypto.getRandomValues.bind(msCrypto))) throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
1124
+ return Ae(De);
1122
1125
  }
1123
- var Re = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
1124
- for (var Ie = [], Fe = 0; Fe < 256; ++Fe) Ie.push((Fe + 256).toString(16).substr(1));
1125
- function je(e) {
1126
+ var Ie = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
1127
+ for (var Fe = [], je = 0; je < 256; ++je) Fe.push((je + 256).toString(16).substr(1));
1128
+ function Le(e) {
1126
1129
  var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0,
1127
- r = (Ie[e[t + 0]] + Ie[e[t + 1]] + Ie[e[t + 2]] + Ie[e[t + 3]] + "-" + Ie[e[t + 4]] + Ie[e[t + 5]] + "-" + Ie[e[t + 6]] + Ie[e[t + 7]] + "-" + Ie[e[t + 8]] + Ie[e[t + 9]] + "-" + Ie[e[t + 10]] + Ie[e[t + 11]] + Ie[e[t + 12]] + Ie[e[t + 13]] + Ie[e[t + 14]] + Ie[e[t + 15]]).toLowerCase();
1130
+ r = (Fe[e[t + 0]] + Fe[e[t + 1]] + Fe[e[t + 2]] + Fe[e[t + 3]] + "-" + Fe[e[t + 4]] + Fe[e[t + 5]] + "-" + Fe[e[t + 6]] + Fe[e[t + 7]] + "-" + Fe[e[t + 8]] + Fe[e[t + 9]] + "-" + Fe[e[t + 10]] + Fe[e[t + 11]] + Fe[e[t + 12]] + Fe[e[t + 13]] + Fe[e[t + 14]] + Fe[e[t + 15]]).toLowerCase();
1128
1131
  if (!function (e) {
1129
- return "string" == typeof e && Re.test(e);
1132
+ return "string" == typeof e && Ie.test(e);
1130
1133
  }(r)) throw TypeError("Stringified UUID is invalid");
1131
1134
  return r;
1132
1135
  }
1133
- function Le(e, t, r) {
1134
- var n = (e = e || {}).random || (e.rng || De)();
1136
+ function Be(e, t, r) {
1137
+ var n = (e = e || {}).random || (e.rng || Re)();
1135
1138
  if (n[6] = 15 & n[6] | 64, n[8] = 63 & n[8] | 128, t) {
1136
1139
  r = r || 0;
1137
1140
  for (var i = 0; i < 16; ++i) t[r + i] = n[i];
1138
1141
  return t;
1139
1142
  }
1140
- return je(n);
1143
+ return Le(n);
1141
1144
  }
1142
- var Be = {};
1143
- function Me(e, t) {
1144
- return Oe(this, void 0, void 0, he().mark(function r() {
1145
- return he().wrap(function (r) {
1145
+ var Me = {};
1146
+ function Ne(e, t) {
1147
+ return Pe(this, void 0, void 0, pe().mark(function r() {
1148
+ return pe().wrap(function (r) {
1146
1149
  for (;;) switch (r.prev = r.next) {
1147
1150
  case 0:
1148
- if (void 0 === Be[e]) {
1151
+ if (void 0 === Me[e]) {
1149
1152
  r.next = 2;
1150
1153
  break;
1151
1154
  }
1152
- return r.abrupt("return", Be[e]);
1155
+ return r.abrupt("return", Me[e]);
1153
1156
  case 2:
1154
- return Be[e] = Ne(e, t), r.abrupt("return", Be[e]);
1157
+ return Me[e] = Ue(e, t), r.abrupt("return", Me[e]);
1155
1158
  case 4:
1156
1159
  case "end":
1157
1160
  return r.stop();
@@ -1159,10 +1162,10 @@ function Me(e, t) {
1159
1162
  }, r);
1160
1163
  }));
1161
1164
  }
1162
- function Ne(e, t) {
1165
+ function Ue(e, t) {
1163
1166
  return new Promise(function (r, n) {
1164
1167
  var i = function (e) {
1165
- var t = Ue(e);
1168
+ var t = Ke(e);
1166
1169
  if (t[0]) return t[0];
1167
1170
  }(e);
1168
1171
  if (i && "true" === i.dataset.loaded) try {
@@ -1186,44 +1189,44 @@ function Ne(e, t) {
1186
1189
  });
1187
1190
  });
1188
1191
  }
1189
- var Ue = function Ue(e) {
1192
+ var Ke = function Ke(e) {
1190
1193
  return document.querySelectorAll('script[src="'.concat(e, '"]'));
1191
1194
  };
1192
- var Ke,
1193
- qe = ["[Stytch]"],
1194
- We = function We() {
1195
+ var qe,
1196
+ We = ["[Stytch]"],
1197
+ He = function He() {
1195
1198
  for (var e, t = arguments.length, r = new Array(t), n = 0; n < t; n++) r[n] = arguments[n];
1196
- return (e = console).warn.apply(e, qe.concat(r));
1199
+ return (e = console).warn.apply(e, We.concat(r));
1197
1200
  },
1198
1201
  Ge = function Ge() {
1199
1202
  for (var e, t = arguments.length, r = new Array(t), n = 0; n < t; n++) r[n] = arguments[n];
1200
- return (e = console).error.apply(e, qe.concat(r));
1203
+ return (e = console).error.apply(e, We.concat(r));
1201
1204
  },
1202
- He = "\nYou can find your public token at https://stytch.com/dashboard/api-keys.",
1203
- ze = function ze(e) {
1205
+ ze = "\nYou can find your public token at https://stytch.com/dashboard/api-keys.",
1206
+ Ve = function Ve(e) {
1204
1207
  var t = {
1205
1208
  isObject: function isObject(r, n) {
1206
- var i = "object" === de(n) && !Array.isArray(n) && null !== n;
1207
- if (!i) throw new w(e, r + " must be an object.");
1209
+ var i = "object" === he(n) && !Array.isArray(n) && null !== n;
1210
+ if (!i) throw new S(e, r + " must be an object.");
1208
1211
  return t;
1209
1212
  },
1210
1213
  isOptionalObject: function isOptionalObject(e, r) {
1211
1214
  return void 0 === r ? t : t.isObject(e, r);
1212
1215
  },
1213
1216
  isString: function isString(r, n) {
1214
- if ("string" != typeof n) throw new w(e, r + " must be a string.");
1217
+ if ("string" != typeof n) throw new S(e, r + " must be a string.");
1215
1218
  return t;
1216
1219
  },
1217
1220
  isOptionalString: function isOptionalString(e, r) {
1218
1221
  return void 0 === r ? t : t.isString(e, r);
1219
1222
  },
1220
1223
  isStringArray: function isStringArray(r, n) {
1221
- if (!Array.isArray(n)) throw new w(e, r + " must be an array of strings.");
1224
+ if (!Array.isArray(n)) throw new S(e, r + " must be an array of strings.");
1222
1225
  var i,
1223
- s = ae(n);
1226
+ s = ce(n);
1224
1227
  try {
1225
1228
  for (s.s(); !(i = s.n()).done;) {
1226
- if ("string" != typeof i.value) throw new w(e, r + " must be an array of strings.");
1229
+ if ("string" != typeof i.value) throw new S(e, r + " must be an array of strings.");
1227
1230
  }
1228
1231
  } catch (e) {
1229
1232
  s.e(e);
@@ -1236,14 +1239,14 @@ var Ke,
1236
1239
  return void 0 === r ? t : t.isStringArray(e, r);
1237
1240
  },
1238
1241
  isNumber: function isNumber(r, n) {
1239
- if ("number" != typeof n) throw new w(e, r + " must be a number.");
1242
+ if ("number" != typeof n) throw new S(e, r + " must be a number.");
1240
1243
  return t;
1241
1244
  },
1242
1245
  isOptionalNumber: function isOptionalNumber(e, r) {
1243
1246
  return void 0 === r ? t : t.isNumber(e, r);
1244
1247
  },
1245
1248
  isBoolean: function isBoolean(r, n) {
1246
- if ("boolean" != typeof n) throw new w(e, r + " must be a boolean.");
1249
+ if ("boolean" != typeof n) throw new S(e, r + " must be a boolean.");
1247
1250
  return t;
1248
1251
  },
1249
1252
  isOptionalBoolean: function isOptionalBoolean(e, r) {
@@ -1253,19 +1256,19 @@ var Ke,
1253
1256
  return t;
1254
1257
  },
1255
1258
  Ye = function Ye(e) {
1256
- return Te(e, ["request_id", "status_code"]);
1259
+ return Oe(e, ["request_id", "status_code"]);
1257
1260
  },
1258
- Ve = function Ve(e) {
1259
- return Te(e, ["__user"]);
1261
+ Je = function Je(e) {
1262
+ return Oe(e, ["__user"]);
1260
1263
  },
1261
- Je = fe(function e(t, r, n) {
1264
+ $e = _e(function e(t, r, n) {
1262
1265
  var i = this,
1263
1266
  s = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : function () {
1264
1267
  return Promise.resolve(void 0);
1265
1268
  };
1266
- me(this, e), this.bootstrapPromise = n, this.isEnabled = function () {
1267
- return Oe(i, void 0, void 0, he().mark(function e() {
1268
- return he().wrap(function (e) {
1269
+ ve(this, e), this.bootstrapPromise = n, this.isEnabled = function () {
1270
+ return Pe(i, void 0, void 0, pe().mark(function e() {
1271
+ return pe().wrap(function (e) {
1269
1272
  for (;;) switch (e.prev = e.next) {
1270
1273
  case 0:
1271
1274
  return e.abrupt("return", this.state.then(function (e) {
@@ -1278,9 +1281,9 @@ var Ke,
1278
1281
  }, e, this);
1279
1282
  }));
1280
1283
  }, this.getTelemetryID = function () {
1281
- return Oe(i, void 0, void 0, he().mark(function e() {
1284
+ return Pe(i, void 0, void 0, pe().mark(function e() {
1282
1285
  var t, r, n, i;
1283
- return he().wrap(function (e) {
1286
+ return pe().wrap(function (e) {
1284
1287
  for (;;) switch (e.prev = e.next) {
1285
1288
  case 0:
1286
1289
  return e.next = 2, this.state;
@@ -1301,9 +1304,9 @@ var Ke,
1301
1304
  }, e, this);
1302
1305
  }));
1303
1306
  }, this.getDFPTelemetryIDAndCaptcha = function () {
1304
- return Oe(i, void 0, void 0, he().mark(function e() {
1307
+ return Pe(i, void 0, void 0, pe().mark(function e() {
1305
1308
  var t, r, n, i, s, o;
1306
- return he().wrap(function (e) {
1309
+ return pe().wrap(function (e) {
1307
1310
  for (;;) switch (e.prev = e.next) {
1308
1311
  case 0:
1309
1312
  return e.next = 2, this.state;
@@ -1346,14 +1349,14 @@ var Ke,
1346
1349
  }, e, this);
1347
1350
  }));
1348
1351
  }, this.retryWithCaptchaAndDFP = function (e, t) {
1349
- return Oe(i, void 0, void 0, he().mark(function r() {
1352
+ return Pe(i, void 0, void 0, pe().mark(function r() {
1350
1353
  var n, i, s;
1351
- return he().wrap(function (r) {
1354
+ return pe().wrap(function (r) {
1352
1355
  for (;;) switch (r.prev = r.next) {
1353
1356
  case 0:
1354
1357
  return r.next = 2, this.state;
1355
1358
  case 2:
1356
- if (n = r.sent, i = n.enabled, s = n.executeRecaptcha, e.type !== we.RequiredCatcha || !i) {
1359
+ if (n = r.sent, i = n.enabled, s = n.executeRecaptcha, e.type !== Se.RequiredCatcha || !i) {
1357
1360
  r.next = 14;
1358
1361
  break;
1359
1362
  }
@@ -1377,8 +1380,8 @@ var Ke,
1377
1380
  }, r, this);
1378
1381
  }));
1379
1382
  }, this.state = n.then(function (e) {
1380
- return Oe(i, void 0, void 0, he().mark(function n() {
1381
- return he().wrap(function (n) {
1383
+ return Pe(i, void 0, void 0, pe().mark(function n() {
1384
+ return pe().wrap(function (n) {
1382
1385
  for (;;) switch (n.prev = n.next) {
1383
1386
  case 0:
1384
1387
  if (e.runDFPProtectedAuth) {
@@ -1393,7 +1396,7 @@ var Ke,
1393
1396
  executeRecaptcha: s
1394
1397
  });
1395
1398
  case 2:
1396
- return n.next = 4, void Me("".concat("https://elements.stytch.com", "/telemetry.js"), function () {
1399
+ return n.next = 4, void Ne("".concat("https://elements.stytch.com", "/telemetry.js"), function () {
1397
1400
  return window;
1398
1401
  });
1399
1402
  case 4:
@@ -1413,11 +1416,11 @@ var Ke,
1413
1416
  }));
1414
1417
  });
1415
1418
  }),
1416
- $e = function $e() {
1419
+ Xe = function Xe() {
1417
1420
  return {
1418
1421
  isEnabled: function isEnabled() {
1419
- return Oe(void 0, void 0, void 0, he().mark(function e() {
1420
- return he().wrap(function (e) {
1422
+ return Pe(void 0, void 0, void 0, pe().mark(function e() {
1423
+ return pe().wrap(function (e) {
1421
1424
  for (;;) switch (e.prev = e.next) {
1422
1425
  case 0:
1423
1426
  return e.abrupt("return", !1);
@@ -1429,8 +1432,8 @@ var Ke,
1429
1432
  }));
1430
1433
  },
1431
1434
  getTelemetryID: function getTelemetryID() {
1432
- return Oe(void 0, void 0, void 0, he().mark(function e() {
1433
- return he().wrap(function (e) {
1435
+ return Pe(void 0, void 0, void 0, pe().mark(function e() {
1436
+ return pe().wrap(function (e) {
1434
1437
  for (;;) switch (e.prev = e.next) {
1435
1438
  case 0:
1436
1439
  return e.abrupt("return", void 0);
@@ -1442,8 +1445,8 @@ var Ke,
1442
1445
  }));
1443
1446
  },
1444
1447
  getDFPTelemetryIDAndCaptcha: function getDFPTelemetryIDAndCaptcha() {
1445
- return Oe(void 0, void 0, void 0, he().mark(function e() {
1446
- return he().wrap(function (e) {
1448
+ return Pe(void 0, void 0, void 0, pe().mark(function e() {
1449
+ return pe().wrap(function (e) {
1447
1450
  for (;;) switch (e.prev = e.next) {
1448
1451
  case 0:
1449
1452
  return e.abrupt("return", {
@@ -1458,8 +1461,8 @@ var Ke,
1458
1461
  }));
1459
1462
  },
1460
1463
  retryWithCaptchaAndDFP: function retryWithCaptchaAndDFP() {
1461
- return Oe(void 0, void 0, void 0, he().mark(function e() {
1462
- return he().wrap(function (e) {
1464
+ return Pe(void 0, void 0, void 0, pe().mark(function e() {
1465
+ return pe().wrap(function (e) {
1463
1466
  for (;;) switch (e.prev = e.next) {
1464
1467
  case 0:
1465
1468
  throw new Error("DFP protected auth is disabled");
@@ -1472,11 +1475,11 @@ var Ke,
1472
1475
  }
1473
1476
  };
1474
1477
  },
1475
- Xe = function () {
1478
+ Ze = function () {
1476
1479
  function e() {
1477
- me(this, e);
1480
+ ve(this, e);
1478
1481
  }
1479
- return fe(e, null, [{
1482
+ return _e(e, null, [{
1480
1483
  key: "marshall",
1481
1484
  value: function value(e) {
1482
1485
  return Object.assign(Object.assign({}, e), {
@@ -1496,17 +1499,17 @@ var Ke,
1496
1499
  value: function value(t) {
1497
1500
  if ("name" in t) switch (t.name) {
1498
1501
  case "SDKAPIUnreachableError":
1499
- return e.inflate(k, t);
1502
+ return e.inflate(w, t);
1500
1503
  case "StytchSDKSchemaError":
1501
- return e.inflate(S, t);
1504
+ return e.inflate(C, t);
1502
1505
  case "StytchAPIUnreachableError":
1503
- return e.inflate(P, t);
1504
- case "StytchAPISchemaError":
1505
1506
  return e.inflate(A, t);
1507
+ case "StytchAPISchemaError":
1508
+ return e.inflate(x, t);
1506
1509
  case "StytchSDKAPIError":
1507
- return e.inflate(C, t);
1510
+ return e.inflate(T, t);
1508
1511
  case "StytchAPIError":
1509
- return e.inflate(x, t);
1512
+ return e.inflate(E, t);
1510
1513
  case "TypeError":
1511
1514
  return e.inflate(TypeError, t);
1512
1515
  case "SyntaxError":
@@ -1524,11 +1527,11 @@ var Ke,
1524
1527
  }
1525
1528
  }]), e;
1526
1529
  }(),
1527
- Ze = function () {
1530
+ Qe = function () {
1528
1531
  function e(t) {
1529
- me(this, e), this.maxBatchSize = t.maxBatchSize, this.logEventURL = t.logEventURL, setInterval(this.flush.bind(this), t.intervalDurationMs), this.batch = [];
1532
+ ve(this, e), this.maxBatchSize = t.maxBatchSize, this.logEventURL = t.logEventURL, setInterval(this.flush.bind(this), t.intervalDurationMs), this.batch = [];
1530
1533
  }
1531
- return fe(e, [{
1534
+ return _e(e, [{
1532
1535
  key: "logEvent",
1533
1536
  value: function value(e, t) {
1534
1537
  this.batch.push({
@@ -1539,9 +1542,9 @@ var Ke,
1539
1542
  }, {
1540
1543
  key: "flush",
1541
1544
  value: function value() {
1542
- return Oe(this, void 0, void 0, he().mark(function e() {
1545
+ return Pe(this, void 0, void 0, pe().mark(function e() {
1543
1546
  var t;
1544
- return he().wrap(function (e) {
1547
+ return pe().wrap(function (e) {
1545
1548
  for (;;) switch (e.prev = e.next) {
1546
1549
  case 0:
1547
1550
  if (this.batch.length) {
@@ -1573,13 +1576,13 @@ var Ke,
1573
1576
  }();
1574
1577
  !function (e) {
1575
1578
  e.LoginOrCreateEML = "login_or_create_eml", e.LoginOrCreateOTP = "login_or_create_otp", e.ResetPassword = "reset_password";
1576
- }(Ke || (Ke = {}));
1577
- var Qe = fe(function e(t, r) {
1579
+ }(qe || (qe = {}));
1580
+ var et = _e(function e(t, r) {
1578
1581
  var n = this;
1579
- me(this, e), this._networkClient = t, this._subscriptionService = r, this.get = function () {
1580
- return Oe(n, void 0, void 0, he().mark(function e() {
1582
+ ve(this, e), this._networkClient = t, this._subscriptionService = r, this.get = function () {
1583
+ return Pe(n, void 0, void 0, pe().mark(function e() {
1581
1584
  var t, r;
1582
- return he().wrap(function (e) {
1585
+ return pe().wrap(function (e) {
1583
1586
  for (;;) switch (e.prev = e.next) {
1584
1587
  case 0:
1585
1588
  return e.next = 2, this._networkClient.fetchSDK({
@@ -1598,19 +1601,19 @@ var Qe = fe(function e(t, r) {
1598
1601
  }, this.getSync = function () {
1599
1602
  return n._subscriptionService.getUser();
1600
1603
  }, this.update = function (e) {
1601
- return Oe(n, void 0, void 0, he().mark(function t() {
1604
+ return Pe(n, void 0, void 0, pe().mark(function t() {
1602
1605
  var r, n;
1603
- return he().wrap(function (t) {
1606
+ return pe().wrap(function (t) {
1604
1607
  for (;;) switch (t.prev = t.next) {
1605
1608
  case 0:
1606
- return ze("stytch.user.update").isOptionalObject("untrusted_metadata", e.untrusted_metadata), t.next = 3, this._networkClient.fetchSDK({
1609
+ return Ve("stytch.user.update").isOptionalObject("untrusted_metadata", e.untrusted_metadata), t.next = 3, this._networkClient.fetchSDK({
1607
1610
  url: "/users/me",
1608
1611
  body: e,
1609
1612
  errorMessage: "Failed to update user.",
1610
1613
  method: "PUT"
1611
1614
  });
1612
1615
  case 3:
1613
- return r = t.sent, n = Ye(r.__user), this._subscriptionService.updateUser(n), t.abrupt("return", Ve(r));
1616
+ return r = t.sent, n = Ye(r.__user), this._subscriptionService.updateUser(n), t.abrupt("return", Je(r));
1614
1617
  case 7:
1615
1618
  case "end":
1616
1619
  return t.stop();
@@ -1618,9 +1621,9 @@ var Qe = fe(function e(t, r) {
1618
1621
  }, t, this);
1619
1622
  }));
1620
1623
  }, this.deleteEmail = function (e) {
1621
- return Oe(n, void 0, void 0, he().mark(function t() {
1624
+ return Pe(n, void 0, void 0, pe().mark(function t() {
1622
1625
  var r, n;
1623
- return he().wrap(function (t) {
1626
+ return pe().wrap(function (t) {
1624
1627
  for (;;) switch (t.prev = t.next) {
1625
1628
  case 0:
1626
1629
  return t.next = 2, this._networkClient.fetchSDK({
@@ -1629,7 +1632,7 @@ var Qe = fe(function e(t, r) {
1629
1632
  method: "DELETE"
1630
1633
  });
1631
1634
  case 2:
1632
- return r = t.sent, n = Ye(r.__user), this._subscriptionService.updateUser(n), t.abrupt("return", Ve(r));
1635
+ return r = t.sent, n = Ye(r.__user), this._subscriptionService.updateUser(n), t.abrupt("return", Je(r));
1633
1636
  case 6:
1634
1637
  case "end":
1635
1638
  return t.stop();
@@ -1637,9 +1640,9 @@ var Qe = fe(function e(t, r) {
1637
1640
  }, t, this);
1638
1641
  }));
1639
1642
  }, this.deletePhoneNumber = function (e) {
1640
- return Oe(n, void 0, void 0, he().mark(function t() {
1643
+ return Pe(n, void 0, void 0, pe().mark(function t() {
1641
1644
  var r, n;
1642
- return he().wrap(function (t) {
1645
+ return pe().wrap(function (t) {
1643
1646
  for (;;) switch (t.prev = t.next) {
1644
1647
  case 0:
1645
1648
  return t.next = 2, this._networkClient.fetchSDK({
@@ -1648,7 +1651,7 @@ var Qe = fe(function e(t, r) {
1648
1651
  method: "DELETE"
1649
1652
  });
1650
1653
  case 2:
1651
- return r = t.sent, n = Ye(r.__user), this._subscriptionService.updateUser(n), t.abrupt("return", Ve(r));
1654
+ return r = t.sent, n = Ye(r.__user), this._subscriptionService.updateUser(n), t.abrupt("return", Je(r));
1652
1655
  case 6:
1653
1656
  case "end":
1654
1657
  return t.stop();
@@ -1656,9 +1659,9 @@ var Qe = fe(function e(t, r) {
1656
1659
  }, t, this);
1657
1660
  }));
1658
1661
  }, this.deleteTOTP = function (e) {
1659
- return Oe(n, void 0, void 0, he().mark(function t() {
1662
+ return Pe(n, void 0, void 0, pe().mark(function t() {
1660
1663
  var r, n;
1661
- return he().wrap(function (t) {
1664
+ return pe().wrap(function (t) {
1662
1665
  for (;;) switch (t.prev = t.next) {
1663
1666
  case 0:
1664
1667
  return t.next = 2, this._networkClient.fetchSDK({
@@ -1667,7 +1670,7 @@ var Qe = fe(function e(t, r) {
1667
1670
  method: "DELETE"
1668
1671
  });
1669
1672
  case 2:
1670
- return r = t.sent, n = Ye(r.__user), this._subscriptionService.updateUser(n), t.abrupt("return", Ve(r));
1673
+ return r = t.sent, n = Ye(r.__user), this._subscriptionService.updateUser(n), t.abrupt("return", Je(r));
1671
1674
  case 6:
1672
1675
  case "end":
1673
1676
  return t.stop();
@@ -1675,9 +1678,9 @@ var Qe = fe(function e(t, r) {
1675
1678
  }, t, this);
1676
1679
  }));
1677
1680
  }, this.deleteOAuthRegistration = function (e) {
1678
- return Oe(n, void 0, void 0, he().mark(function t() {
1681
+ return Pe(n, void 0, void 0, pe().mark(function t() {
1679
1682
  var r, n;
1680
- return he().wrap(function (t) {
1683
+ return pe().wrap(function (t) {
1681
1684
  for (;;) switch (t.prev = t.next) {
1682
1685
  case 0:
1683
1686
  return t.next = 2, this._networkClient.fetchSDK({
@@ -1686,7 +1689,7 @@ var Qe = fe(function e(t, r) {
1686
1689
  method: "DELETE"
1687
1690
  });
1688
1691
  case 2:
1689
- return r = t.sent, n = Ye(r.__user), this._subscriptionService.updateUser(n), t.abrupt("return", Ve(r));
1692
+ return r = t.sent, n = Ye(r.__user), this._subscriptionService.updateUser(n), t.abrupt("return", Je(r));
1690
1693
  case 6:
1691
1694
  case "end":
1692
1695
  return t.stop();
@@ -1694,9 +1697,9 @@ var Qe = fe(function e(t, r) {
1694
1697
  }, t, this);
1695
1698
  }));
1696
1699
  }, this.deleteWebauthnRegistration = function (e) {
1697
- return Oe(n, void 0, void 0, he().mark(function t() {
1700
+ return Pe(n, void 0, void 0, pe().mark(function t() {
1698
1701
  var r, n;
1699
- return he().wrap(function (t) {
1702
+ return pe().wrap(function (t) {
1700
1703
  for (;;) switch (t.prev = t.next) {
1701
1704
  case 0:
1702
1705
  return t.next = 2, this._networkClient.fetchSDK({
@@ -1705,7 +1708,7 @@ var Qe = fe(function e(t, r) {
1705
1708
  method: "DELETE"
1706
1709
  });
1707
1710
  case 2:
1708
- return r = t.sent, n = Ye(r.__user), this._subscriptionService.updateUser(n), t.abrupt("return", Ve(r));
1711
+ return r = t.sent, n = Ye(r.__user), this._subscriptionService.updateUser(n), t.abrupt("return", Je(r));
1709
1712
  case 6:
1710
1713
  case "end":
1711
1714
  return t.stop();
@@ -1713,9 +1716,9 @@ var Qe = fe(function e(t, r) {
1713
1716
  }, t, this);
1714
1717
  }));
1715
1718
  }, this.deleteBiometricRegistration = function (e) {
1716
- return Oe(n, void 0, void 0, he().mark(function t() {
1719
+ return Pe(n, void 0, void 0, pe().mark(function t() {
1717
1720
  var r, n;
1718
- return he().wrap(function (t) {
1721
+ return pe().wrap(function (t) {
1719
1722
  for (;;) switch (t.prev = t.next) {
1720
1723
  case 0:
1721
1724
  return t.next = 2, this._networkClient.fetchSDK({
@@ -1724,7 +1727,7 @@ var Qe = fe(function e(t, r) {
1724
1727
  method: "DELETE"
1725
1728
  });
1726
1729
  case 2:
1727
- return r = t.sent, n = Ye(r.__user), this._subscriptionService.updateUser(n), t.abrupt("return", Ve(r));
1730
+ return r = t.sent, n = Ye(r.__user), this._subscriptionService.updateUser(n), t.abrupt("return", Je(r));
1728
1731
  case 6:
1729
1732
  case "end":
1730
1733
  return t.stop();
@@ -1739,10 +1742,10 @@ var Qe = fe(function e(t, r) {
1739
1742
  });
1740
1743
  };
1741
1744
  }),
1742
- et = function () {
1745
+ tt = function () {
1743
1746
  function e(t, r) {
1744
1747
  var n = this;
1745
- me(this, e), this._networkClient = t, this._subscriptionService = r, this.getSync = function () {
1748
+ ve(this, e), this._networkClient = t, this._subscriptionService = r, this.getSync = function () {
1746
1749
  return n._subscriptionService.getSession();
1747
1750
  }, this.onChange = function (e) {
1748
1751
  var t = n._subscriptionService.getSession();
@@ -1751,9 +1754,9 @@ var Qe = fe(function e(t, r) {
1751
1754
  (null == r ? void 0 : r.session) !== t && (t = null !== (n = null == r ? void 0 : r.session) && void 0 !== n ? n : null, e(t));
1752
1755
  });
1753
1756
  }, this.revoke = function (e) {
1754
- return Oe(n, void 0, void 0, he().mark(function t() {
1757
+ return Pe(n, void 0, void 0, pe().mark(function t() {
1755
1758
  var r;
1756
- return he().wrap(function (t) {
1759
+ return pe().wrap(function (t) {
1757
1760
  for (;;) switch (t.prev = t.next) {
1758
1761
  case 0:
1759
1762
  return t.prev = 0, t.next = 3, this._networkClient.fetchSDK({
@@ -1764,7 +1767,7 @@ var Qe = fe(function e(t, r) {
1764
1767
  case 3:
1765
1768
  return r = t.sent, this._subscriptionService.destroyState(), t.abrupt("return", r);
1766
1769
  case 8:
1767
- throw t.prev = 8, t.t0 = t["catch"](0), ((null == e ? void 0 : e.forceClear) || T.includes(t.t0.error_type)) && this._subscriptionService.destroyState(), t.t0;
1770
+ throw t.prev = 8, t.t0 = t["catch"](0), ((null == e ? void 0 : e.forceClear) || O.includes(t.t0.error_type)) && this._subscriptionService.destroyState(), t.t0;
1768
1771
  case 12:
1769
1772
  case "end":
1770
1773
  return t.stop();
@@ -1772,13 +1775,13 @@ var Qe = fe(function e(t, r) {
1772
1775
  }, t, this, [[0, 8]]);
1773
1776
  }));
1774
1777
  }, this.authenticate = function (e) {
1775
- return Oe(n, void 0, void 0, he().mark(function t() {
1778
+ return Pe(n, void 0, void 0, pe().mark(function t() {
1776
1779
  var r,
1777
1780
  n,
1778
1781
  i,
1779
1782
  s,
1780
1783
  o = this;
1781
- return he().wrap(function (t) {
1784
+ return pe().wrap(function (t) {
1782
1785
  for (;;) switch (t.prev = t.next) {
1783
1786
  case 0:
1784
1787
  return r = this._subscriptionService.getSession(), n = function n() {
@@ -1807,7 +1810,7 @@ var Qe = fe(function e(t, r) {
1807
1810
  session_token: s.session_token,
1808
1811
  session_jwt: s.session_jwt,
1809
1812
  intermediate_session_token: null
1810
- }), t.abrupt("return", Ve(s));
1813
+ }), t.abrupt("return", Je(s));
1811
1814
  case 13:
1812
1815
  if (t.prev = 13, t.t0 = t["catch"](2), !n()) {
1813
1816
  t.next = 17;
@@ -1815,7 +1818,7 @@ var Qe = fe(function e(t, r) {
1815
1818
  }
1816
1819
  return t.abrupt("return", this.authenticate(e));
1817
1820
  case 17:
1818
- throw T.includes(t.t0.error_type) && this._subscriptionService.destroySession(), t.t0;
1821
+ throw O.includes(t.t0.error_type) && this._subscriptionService.destroySession(), t.t0;
1819
1822
  case 19:
1820
1823
  case "end":
1821
1824
  return t.stop();
@@ -1824,7 +1827,7 @@ var Qe = fe(function e(t, r) {
1824
1827
  }));
1825
1828
  };
1826
1829
  }
1827
- return fe(e, [{
1830
+ return _e(e, [{
1828
1831
  key: "getTokens",
1829
1832
  value: function value() {
1830
1833
  return this._subscriptionService.getTokens();
@@ -1836,20 +1839,20 @@ var Qe = fe(function e(t, r) {
1836
1839
  }
1837
1840
  }]), e;
1838
1841
  }(),
1839
- tt = Promise.resolve({
1842
+ rt = Promise.resolve({
1840
1843
  pkceRequiredForEmailMagicLinks: !1
1841
1844
  }),
1842
- rt = function () {
1845
+ nt = function () {
1843
1846
  function e(t, r, n, i) {
1844
1847
  var s = this,
1845
- o = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : tt,
1846
- a = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : $e();
1847
- me(this, e), this._networkClient = t, this._subscriptionService = r, this._pkceManager = n, this._passwordResetPKCEManager = i, this._config = o, this.dfpProtectedAuth = a, this.email = {
1848
+ o = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : rt,
1849
+ a = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : Xe();
1850
+ ve(this, e), this._networkClient = t, this._subscriptionService = r, this._pkceManager = n, this._passwordResetPKCEManager = i, this._config = o, this.dfpProtectedAuth = a, this.email = {
1848
1851
  loginOrCreate: function loginOrCreate(e) {
1849
1852
  var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
1850
- return Oe(s, void 0, void 0, he().mark(function r() {
1853
+ return Pe(s, void 0, void 0, pe().mark(function r() {
1851
1854
  var n, i, s, o, a, c, u;
1852
- return he().wrap(function (r) {
1855
+ return pe().wrap(function (r) {
1853
1856
  for (;;) switch (r.prev = r.next) {
1854
1857
  case 0:
1855
1858
  return r.next = 2, this._config;
@@ -1885,9 +1888,9 @@ var Qe = fe(function e(t, r) {
1885
1888
  },
1886
1889
  send: function send(e) {
1887
1890
  var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
1888
- return Oe(s, void 0, void 0, he().mark(function r() {
1891
+ return Pe(s, void 0, void 0, pe().mark(function r() {
1889
1892
  var n, i, s, o, a, c, u, l, d;
1890
- return he().wrap(function (r) {
1893
+ return pe().wrap(function (r) {
1891
1894
  for (;;) switch (r.prev = r.next) {
1892
1895
  case 0:
1893
1896
  return r.next = 2, this._config;
@@ -1922,12 +1925,12 @@ var Qe = fe(function e(t, r) {
1922
1925
  }));
1923
1926
  }
1924
1927
  }, this.authenticate = function (e, t) {
1925
- return Oe(s, void 0, void 0, he().mark(function r() {
1928
+ return Pe(s, void 0, void 0, pe().mark(function r() {
1926
1929
  var n, i;
1927
- return he().wrap(function (r) {
1930
+ return pe().wrap(function (r) {
1928
1931
  for (;;) switch (r.prev = r.next) {
1929
1932
  case 0:
1930
- return ze("stytch.magicLinks.authenticate").isString("Token", e).isNumber("session_duration_minutes", t.session_duration_minutes), r.next = 3, this._passwordResetPKCEManager.getPKPair();
1933
+ return Ve("stytch.magicLinks.authenticate").isString("Token", e).isNumber("session_duration_minutes", t.session_duration_minutes), r.next = 3, this._passwordResetPKCEManager.getPKPair();
1931
1934
  case 3:
1932
1935
  if (n = r.sent, i = null, !(null == n ? void 0 : n.code_verifier)) {
1933
1936
  r.next = 19;
@@ -1967,7 +1970,7 @@ var Qe = fe(function e(t, r) {
1967
1970
  session_token: i.session_token,
1968
1971
  session_jwt: i.session_jwt,
1969
1972
  intermediate_session_token: null
1970
- }), r.abrupt("return", Ve(i));
1973
+ }), r.abrupt("return", Je(i));
1971
1974
  case 25:
1972
1975
  case "end":
1973
1976
  return r.stop();
@@ -1976,12 +1979,12 @@ var Qe = fe(function e(t, r) {
1976
1979
  }));
1977
1980
  };
1978
1981
  }
1979
- return fe(e, [{
1982
+ return _e(e, [{
1980
1983
  key: "getCodeChallenge",
1981
1984
  value: function value() {
1982
- return Oe(this, void 0, void 0, he().mark(function e() {
1985
+ return Pe(this, void 0, void 0, pe().mark(function e() {
1983
1986
  var t;
1984
- return he().wrap(function (e) {
1987
+ return pe().wrap(function (e) {
1985
1988
  for (;;) switch (e.prev = e.next) {
1986
1989
  case 0:
1987
1990
  return e.next = 2, this._pkceManager.getPKPair();
@@ -2005,9 +2008,9 @@ var Qe = fe(function e(t, r) {
2005
2008
  }, {
2006
2009
  key: "handlePKCEForAuthenticate",
2007
2010
  value: function value(e, t) {
2008
- return Oe(this, void 0, void 0, he().mark(function r() {
2011
+ return Pe(this, void 0, void 0, pe().mark(function r() {
2009
2012
  var n, i, s;
2010
- return he().wrap(function (r) {
2013
+ return pe().wrap(function (r) {
2011
2014
  for (;;) switch (r.prev = r.next) {
2012
2015
  case 0:
2013
2016
  return r.next = 2, e.getPKPair();
@@ -2031,17 +2034,17 @@ var Qe = fe(function e(t, r) {
2031
2034
  }
2032
2035
  }]), e;
2033
2036
  }(),
2034
- nt = fe(function e(t, r) {
2037
+ it = _e(function e(t, r) {
2035
2038
  var n = this,
2036
2039
  i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : function () {
2037
2040
  return Promise.resolve(void 0);
2038
2041
  },
2039
- s = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : $e();
2040
- me(this, e), this._networkClient = t, this._subscriptionService = r, this.executeRecaptcha = i, this.dfpProtectedAuth = s, this.sms = {
2042
+ s = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : Xe();
2043
+ ve(this, e), this._networkClient = t, this._subscriptionService = r, this.executeRecaptcha = i, this.dfpProtectedAuth = s, this.sms = {
2041
2044
  loginOrCreate: function loginOrCreate(e, t) {
2042
- return Oe(n, void 0, void 0, he().mark(function r() {
2045
+ return Pe(n, void 0, void 0, pe().mark(function r() {
2043
2046
  var n, i, s, o;
2044
- return he().wrap(function (r) {
2047
+ return pe().wrap(function (r) {
2045
2048
  for (;;) switch (r.prev = r.next) {
2046
2049
  case 0:
2047
2050
  return r.next = 2, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
@@ -2065,9 +2068,9 @@ var Qe = fe(function e(t, r) {
2065
2068
  }));
2066
2069
  },
2067
2070
  send: function send(e, t) {
2068
- return Oe(n, void 0, void 0, he().mark(function r() {
2071
+ return Pe(n, void 0, void 0, pe().mark(function r() {
2069
2072
  var n, i, s, o, a, c;
2070
- return he().wrap(function (r) {
2073
+ return pe().wrap(function (r) {
2071
2074
  for (;;) switch (r.prev = r.next) {
2072
2075
  case 0:
2073
2076
  return r.next = 2, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
@@ -2092,9 +2095,9 @@ var Qe = fe(function e(t, r) {
2092
2095
  }
2093
2096
  }, this.whatsapp = {
2094
2097
  loginOrCreate: function loginOrCreate(e, t) {
2095
- return Oe(n, void 0, void 0, he().mark(function r() {
2098
+ return Pe(n, void 0, void 0, pe().mark(function r() {
2096
2099
  var n, i, s, o;
2097
- return he().wrap(function (r) {
2100
+ return pe().wrap(function (r) {
2098
2101
  for (;;) switch (r.prev = r.next) {
2099
2102
  case 0:
2100
2103
  return r.next = 2, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
@@ -2118,9 +2121,9 @@ var Qe = fe(function e(t, r) {
2118
2121
  }));
2119
2122
  },
2120
2123
  send: function send(e, t) {
2121
- return Oe(n, void 0, void 0, he().mark(function r() {
2124
+ return Pe(n, void 0, void 0, pe().mark(function r() {
2122
2125
  var n, i, s, o, a, c;
2123
- return he().wrap(function (r) {
2126
+ return pe().wrap(function (r) {
2124
2127
  for (;;) switch (r.prev = r.next) {
2125
2128
  case 0:
2126
2129
  return r.next = 2, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
@@ -2145,9 +2148,9 @@ var Qe = fe(function e(t, r) {
2145
2148
  }
2146
2149
  }, this.email = {
2147
2150
  loginOrCreate: function loginOrCreate(e, t) {
2148
- return Oe(n, void 0, void 0, he().mark(function r() {
2151
+ return Pe(n, void 0, void 0, pe().mark(function r() {
2149
2152
  var n, i;
2150
- return he().wrap(function (r) {
2153
+ return pe().wrap(function (r) {
2151
2154
  for (;;) switch (r.prev = r.next) {
2152
2155
  case 0:
2153
2156
  return r.next = 2, this.executeRecaptcha();
@@ -2169,9 +2172,9 @@ var Qe = fe(function e(t, r) {
2169
2172
  }));
2170
2173
  },
2171
2174
  send: function send(e, t) {
2172
- return Oe(n, void 0, void 0, he().mark(function r() {
2175
+ return Pe(n, void 0, void 0, pe().mark(function r() {
2173
2176
  var n, i, s, o;
2174
- return he().wrap(function (r) {
2177
+ return pe().wrap(function (r) {
2175
2178
  for (;;) switch (r.prev = r.next) {
2176
2179
  case 0:
2177
2180
  return r.next = 2, this.executeRecaptcha();
@@ -2193,12 +2196,12 @@ var Qe = fe(function e(t, r) {
2193
2196
  }));
2194
2197
  }
2195
2198
  }, this.authenticate = function (e, t, r) {
2196
- return Oe(n, void 0, void 0, he().mark(function n() {
2199
+ return Pe(n, void 0, void 0, pe().mark(function n() {
2197
2200
  var i, s, o, a, c;
2198
- return he().wrap(function (n) {
2201
+ return pe().wrap(function (n) {
2199
2202
  for (;;) switch (n.prev = n.next) {
2200
2203
  case 0:
2201
- return ze("stytch.otps.authenticate").isString("Code", e).isNumber("session_duration_minutes", r.session_duration_minutes), n.next = 3, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
2204
+ return Ve("stytch.otps.authenticate").isString("Code", e).isNumber("session_duration_minutes", r.session_duration_minutes), n.next = 3, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
2202
2205
  case 3:
2203
2206
  return i = n.sent, s = i.dfp_telemetry_id, o = i.captcha_token, a = Object.assign({
2204
2207
  token: e,
@@ -2221,7 +2224,7 @@ var Qe = fe(function e(t, r) {
2221
2224
  session_token: c.session_token,
2222
2225
  session_jwt: c.session_jwt,
2223
2226
  intermediate_session_token: null
2224
- }), n.abrupt("return", Ve(c));
2227
+ }), n.abrupt("return", Je(c));
2225
2228
  case 12:
2226
2229
  case "end":
2227
2230
  return n.stop();
@@ -2230,9 +2233,9 @@ var Qe = fe(function e(t, r) {
2230
2233
  }));
2231
2234
  };
2232
2235
  }),
2233
- it = function () {
2236
+ st = function () {
2234
2237
  function e(t, r, n, i, s) {
2235
- me(this, e), this._networkClient = t, this._subscriptionService = r, this._pkceManager = n, this._dynamicConfig = i, this._config = s, this.google = {
2238
+ ve(this, e), this._networkClient = t, this._subscriptionService = r, this._pkceManager = n, this._dynamicConfig = i, this._config = s, this.google = {
2236
2239
  start: this.startOAuthFlow(p.Google)
2237
2240
  }, this.apple = {
2238
2241
  start: this.startOAuthFlow(p.Apple)
@@ -2272,17 +2275,17 @@ var Qe = fe(function e(t, r) {
2272
2275
  start: this.startOAuthFlow(p.Yahoo)
2273
2276
  };
2274
2277
  }
2275
- return fe(e, [{
2278
+ return _e(e, [{
2276
2279
  key: "authenticate",
2277
2280
  value: function value(e, t) {
2278
- return Oe(this, void 0, void 0, he().mark(function r() {
2281
+ return Pe(this, void 0, void 0, pe().mark(function r() {
2279
2282
  var n, i;
2280
- return he().wrap(function (r) {
2283
+ return pe().wrap(function (r) {
2281
2284
  for (;;) switch (r.prev = r.next) {
2282
2285
  case 0:
2283
- return ze("stytch.oauth.authenticate").isString("Token", e).isNumber("session_duration_minutes", t.session_duration_minutes), r.next = 3, this._pkceManager.getPKPair();
2286
+ return Ve("stytch.oauth.authenticate").isString("Token", e).isNumber("session_duration_minutes", t.session_duration_minutes), r.next = 3, this._pkceManager.getPKPair();
2284
2287
  case 3:
2285
- return (n = r.sent) || We("No code verifier found in local storage for OAuth flow.\nConsider using stytch.oauth.$provider.start() to add PKCE to your OAuth flows for added security.\nSee https://stytch.com/docs/oauth#guides_pkce for more information."), r.next = 7, this._networkClient.fetchSDK({
2288
+ return (n = r.sent) || He("No code verifier found in local storage for OAuth flow.\nConsider using stytch.oauth.$provider.start() to add PKCE to your OAuth flows for added security.\nSee https://stytch.com/docs/oauth#guides_pkce for more information."), r.next = 7, this._networkClient.fetchSDK({
2286
2289
  url: "/oauth/authenticate",
2287
2290
  method: "POST",
2288
2291
  body: Object.assign({
@@ -2300,7 +2303,7 @@ var Qe = fe(function e(t, r) {
2300
2303
  session_token: i.session_token,
2301
2304
  session_jwt: i.session_jwt,
2302
2305
  intermediate_session_token: null
2303
- }), r.abrupt("return", Ve(i));
2306
+ }), r.abrupt("return", Je(i));
2304
2307
  case 11:
2305
2308
  case "end":
2306
2309
  return r.stop();
@@ -2311,9 +2314,9 @@ var Qe = fe(function e(t, r) {
2311
2314
  }, {
2312
2315
  key: "getBaseApiUrl",
2313
2316
  value: function value() {
2314
- return Oe(this, void 0, void 0, he().mark(function e() {
2317
+ return Pe(this, void 0, void 0, pe().mark(function e() {
2315
2318
  var t, r;
2316
- return he().wrap(function (e) {
2319
+ return pe().wrap(function (e) {
2317
2320
  for (;;) switch (e.prev = e.next) {
2318
2321
  case 0:
2319
2322
  return e.next = 2, this._dynamicConfig;
@@ -2348,9 +2351,9 @@ var Qe = fe(function e(t, r) {
2348
2351
  i = r.signup_redirect_url,
2349
2352
  s = r.custom_scopes,
2350
2353
  o = r.provider_params;
2351
- return Oe(t, void 0, void 0, he().mark(function t() {
2354
+ return Pe(t, void 0, void 0, pe().mark(function t() {
2352
2355
  var r, a, c, u, l, d, h;
2353
- return he().wrap(function (t) {
2356
+ return pe().wrap(function (t) {
2354
2357
  for (;;) switch (t.prev = t.next) {
2355
2358
  case 0:
2356
2359
  return t.next = 2, this._dynamicConfig;
@@ -2377,7 +2380,7 @@ var Qe = fe(function e(t, r) {
2377
2380
  case 18:
2378
2381
  this._pkceManager.clearPKPair();
2379
2382
  case 19:
2380
- if (s && (ze("startOAuthFlow").isStringArray("custom_scopes", s), l.searchParams.set("custom_scopes", s.join(" "))), o) for (h in ze("startOAuthFlow").isOptionalObject("provider_params", o), o) l.searchParams.set("provider_" + h, o[h]);
2383
+ if (s && (Ve("startOAuthFlow").isStringArray("custom_scopes", s), l.searchParams.set("custom_scopes", s.join(" "))), o) for (h in Ve("startOAuthFlow").isOptionalObject("provider_params", o), o) l.searchParams.set("provider_" + h, o[h]);
2381
2384
  n && l.searchParams.set("login_redirect_url", n), i && l.searchParams.set("signup_redirect_url", i), window.location.href = l.toString();
2382
2385
  case 24:
2383
2386
  case "end":
@@ -2389,23 +2392,23 @@ var Qe = fe(function e(t, r) {
2389
2392
  }
2390
2393
  }]), e;
2391
2394
  }(),
2392
- st = function () {
2395
+ ot = function () {
2393
2396
  function e(t, r) {
2394
2397
  var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : function () {
2395
2398
  return Promise.resolve(void 0);
2396
2399
  },
2397
- i = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : $e();
2398
- me(this, e), this._networkClient = t, this._subscriptionService = r, this.executeRecaptcha = n, this.dfpProtectedAuth = i;
2400
+ i = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : Xe();
2401
+ ve(this, e), this._networkClient = t, this._subscriptionService = r, this.executeRecaptcha = n, this.dfpProtectedAuth = i;
2399
2402
  }
2400
- return fe(e, [{
2403
+ return _e(e, [{
2401
2404
  key: "authenticateStart",
2402
2405
  value: function value(e) {
2403
- return Oe(this, void 0, void 0, he().mark(function t() {
2406
+ return Pe(this, void 0, void 0, pe().mark(function t() {
2404
2407
  var r, n, i;
2405
- return he().wrap(function (t) {
2408
+ return pe().wrap(function (t) {
2406
2409
  for (;;) switch (t.prev = t.next) {
2407
2410
  case 0:
2408
- return ze("stytch.cryptoWallets.authenticateStart").isString("crypto_wallet_address", e.crypto_wallet_address).isString("crypto_wallet_type", e.crypto_wallet_type), r = !!this._subscriptionService.getSession(), t.next = 4, this.executeRecaptcha();
2411
+ return Ve("stytch.cryptoWallets.authenticateStart").isString("crypto_wallet_address", e.crypto_wallet_address).isString("crypto_wallet_type", e.crypto_wallet_type), r = !!this._subscriptionService.getSession(), t.next = 4, this.executeRecaptcha();
2409
2412
  case 4:
2410
2413
  return n = t.sent, i = r ? "/crypto_wallets/authenticate/start/secondary" : "/crypto_wallets/authenticate/start/primary", t.abrupt("return", this._networkClient.fetchSDK({
2411
2414
  url: i,
@@ -2427,12 +2430,12 @@ var Qe = fe(function e(t, r) {
2427
2430
  }, {
2428
2431
  key: "authenticate",
2429
2432
  value: function value(e) {
2430
- return Oe(this, void 0, void 0, he().mark(function t() {
2433
+ return Pe(this, void 0, void 0, pe().mark(function t() {
2431
2434
  var r, n, i, s;
2432
- return he().wrap(function (t) {
2435
+ return pe().wrap(function (t) {
2433
2436
  for (;;) switch (t.prev = t.next) {
2434
2437
  case 0:
2435
- return ze("stytch.cryptoWallets.authenticate").isString("signature", e.signature).isString("crypto_wallet_address", e.crypto_wallet_address).isString("crypto_wallet_type", e.crypto_wallet_type).isNumber("session_duration_minutes", e.session_duration_minutes), t.next = 3, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
2438
+ return Ve("stytch.cryptoWallets.authenticate").isString("signature", e.signature).isString("crypto_wallet_address", e.crypto_wallet_address).isString("crypto_wallet_type", e.crypto_wallet_type).isNumber("session_duration_minutes", e.session_duration_minutes), t.next = 3, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
2436
2439
  case 3:
2437
2440
  return r = t.sent, n = r.dfp_telemetry_id, i = r.captcha_token, t.next = 8, this._networkClient.retriableFetchSDK({
2438
2441
  url: "/crypto_wallets/authenticate",
@@ -2457,7 +2460,7 @@ var Qe = fe(function e(t, r) {
2457
2460
  session_token: s.session_token,
2458
2461
  session_jwt: s.session_jwt,
2459
2462
  intermediate_session_token: null
2460
- }), t.abrupt("return", Ve(s));
2463
+ }), t.abrupt("return", Je(s));
2461
2464
  case 11:
2462
2465
  case "end":
2463
2466
  return t.stop();
@@ -2467,19 +2470,19 @@ var Qe = fe(function e(t, r) {
2467
2470
  }
2468
2471
  }]), e;
2469
2472
  }(),
2470
- ot = function () {
2473
+ at = function () {
2471
2474
  function e(t, r, n) {
2472
- me(this, e), this._networkClient = t, this._subscriptionService = r, this.dfpProtectedAuth = n;
2475
+ ve(this, e), this._networkClient = t, this._subscriptionService = r, this.dfpProtectedAuth = n;
2473
2476
  }
2474
- return fe(e, [{
2477
+ return _e(e, [{
2475
2478
  key: "create",
2476
2479
  value: function value(e) {
2477
- return Oe(this, void 0, void 0, he().mark(function t() {
2480
+ return Pe(this, void 0, void 0, pe().mark(function t() {
2478
2481
  var r;
2479
- return he().wrap(function (t) {
2482
+ return pe().wrap(function (t) {
2480
2483
  for (;;) switch (t.prev = t.next) {
2481
2484
  case 0:
2482
- return ze("stytch.totps.create").isNumber("expiration_minutes", e.expiration_minutes), t.next = 3, this._networkClient.fetchSDK({
2485
+ return Ve("stytch.totps.create").isNumber("expiration_minutes", e.expiration_minutes), t.next = 3, this._networkClient.fetchSDK({
2483
2486
  url: "/totps",
2484
2487
  method: "POST",
2485
2488
  errorMessage: "Failed to create TOTP",
@@ -2488,7 +2491,7 @@ var Qe = fe(function e(t, r) {
2488
2491
  }
2489
2492
  });
2490
2493
  case 3:
2491
- return r = t.sent, this._subscriptionService.updateUser(r.__user), t.abrupt("return", Ve(r));
2494
+ return r = t.sent, this._subscriptionService.updateUser(r.__user), t.abrupt("return", Je(r));
2492
2495
  case 6:
2493
2496
  case "end":
2494
2497
  return t.stop();
@@ -2499,12 +2502,12 @@ var Qe = fe(function e(t, r) {
2499
2502
  }, {
2500
2503
  key: "authenticate",
2501
2504
  value: function value(e) {
2502
- return Oe(this, void 0, void 0, he().mark(function t() {
2505
+ return Pe(this, void 0, void 0, pe().mark(function t() {
2503
2506
  var r, n, i, s;
2504
- return he().wrap(function (t) {
2507
+ return pe().wrap(function (t) {
2505
2508
  for (;;) switch (t.prev = t.next) {
2506
2509
  case 0:
2507
- return ze("stytch.totps.authenticate").isNumber("session_duration_minutes", e.session_duration_minutes).isString("totp_code", e.totp_code), t.next = 3, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
2510
+ return Ve("stytch.totps.authenticate").isNumber("session_duration_minutes", e.session_duration_minutes).isString("totp_code", e.totp_code), t.next = 3, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
2508
2511
  case 3:
2509
2512
  return r = t.sent, n = r.dfp_telemetry_id, i = r.captcha_token, t.next = 8, this._networkClient.retriableFetchSDK({
2510
2513
  url: "/totps/authenticate",
@@ -2527,7 +2530,7 @@ var Qe = fe(function e(t, r) {
2527
2530
  session_token: s.session_token,
2528
2531
  session_jwt: s.session_jwt,
2529
2532
  intermediate_session_token: null
2530
- }), t.abrupt("return", Ve(s));
2533
+ }), t.abrupt("return", Je(s));
2531
2534
  case 11:
2532
2535
  case "end":
2533
2536
  return t.stop();
@@ -2538,8 +2541,8 @@ var Qe = fe(function e(t, r) {
2538
2541
  }, {
2539
2542
  key: "recoveryCodes",
2540
2543
  value: function value() {
2541
- return Oe(this, void 0, void 0, he().mark(function e() {
2542
- return he().wrap(function (e) {
2544
+ return Pe(this, void 0, void 0, pe().mark(function e() {
2545
+ return pe().wrap(function (e) {
2543
2546
  for (;;) switch (e.prev = e.next) {
2544
2547
  case 0:
2545
2548
  return e.abrupt("return", this._networkClient.fetchSDK({
@@ -2557,12 +2560,12 @@ var Qe = fe(function e(t, r) {
2557
2560
  }, {
2558
2561
  key: "recover",
2559
2562
  value: function value(e) {
2560
- return Oe(this, void 0, void 0, he().mark(function t() {
2563
+ return Pe(this, void 0, void 0, pe().mark(function t() {
2561
2564
  var r, n, i, s;
2562
- return he().wrap(function (t) {
2565
+ return pe().wrap(function (t) {
2563
2566
  for (;;) switch (t.prev = t.next) {
2564
2567
  case 0:
2565
- return ze("stytch.totps.recover").isNumber("session_duration_minutes", e.session_duration_minutes).isString("recovery_code", e.recovery_code), t.next = 3, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
2568
+ return Ve("stytch.totps.recover").isNumber("session_duration_minutes", e.session_duration_minutes).isString("recovery_code", e.recovery_code), t.next = 3, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
2566
2569
  case 3:
2567
2570
  return r = t.sent, n = r.dfp_telemetry_id, i = r.captcha_token, t.next = 8, this._networkClient.retriableFetchSDK({
2568
2571
  url: "/totps/recover",
@@ -2585,7 +2588,7 @@ var Qe = fe(function e(t, r) {
2585
2588
  session_token: s.session_token,
2586
2589
  session_jwt: s.session_jwt,
2587
2590
  intermediate_session_token: null
2588
- }), t.abrupt("return", Ve(s));
2591
+ }), t.abrupt("return", Je(s));
2589
2592
  case 11:
2590
2593
  case "end":
2591
2594
  return t.stop();
@@ -2595,14 +2598,14 @@ var Qe = fe(function e(t, r) {
2595
2598
  }
2596
2599
  }]), e;
2597
2600
  }();
2598
- function at(e) {
2601
+ function ct(e) {
2599
2602
  for (var t = "==".slice(0, (4 - e.length % 4) % 4), r = e.replace(/-/g, "+").replace(/_/g, "/") + t, n = atob(r), i = new ArrayBuffer(n.length), s = new Uint8Array(i), o = 0; o < n.length; o++) s[o] = n.charCodeAt(o);
2600
2603
  return i;
2601
2604
  }
2602
- function ct(e) {
2605
+ function ut(e) {
2603
2606
  var t,
2604
2607
  r = "",
2605
- n = ae(new Uint8Array(e));
2608
+ n = ce(new Uint8Array(e));
2606
2609
  try {
2607
2610
  for (n.s(); !(t = n.n()).done;) {
2608
2611
  var i = t.value;
@@ -2615,139 +2618,139 @@ function ct(e) {
2615
2618
  }
2616
2619
  return btoa(r).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
2617
2620
  }
2618
- var ut = "copy",
2619
- lt = "convert";
2620
- function dt(e, t, r) {
2621
- if (t === ut) return r;
2622
- if (t === lt) return e(r);
2621
+ var lt = "copy",
2622
+ dt = "convert";
2623
+ function ht(e, t, r) {
2624
+ if (t === lt) return r;
2625
+ if (t === dt) return e(r);
2623
2626
  if (t instanceof Array) return r.map(function (r) {
2624
- return dt(e, t[0], r);
2627
+ return ht(e, t[0], r);
2625
2628
  });
2626
2629
  if (t instanceof Object) {
2627
2630
  for (var n = {}, i = 0, s = Object.entries(t); i < s.length; i++) {
2628
- var o = ce(s[i], 2),
2631
+ var o = ue(s[i], 2),
2629
2632
  a = o[0],
2630
2633
  c = o[1];
2631
2634
  if (c.derive) {
2632
2635
  var u = c.derive(r);
2633
2636
  void 0 !== u && (r[a] = u);
2634
2637
  }
2635
- if (a in r) null != r[a] ? n[a] = dt(e, c.schema, r[a]) : n[a] = null;else if (c.required) throw new Error("Missing key: ".concat(a));
2638
+ if (a in r) null != r[a] ? n[a] = ht(e, c.schema, r[a]) : n[a] = null;else if (c.required) throw new Error("Missing key: ".concat(a));
2636
2639
  }
2637
2640
  return n;
2638
2641
  }
2639
2642
  }
2640
- function ht(e, t) {
2643
+ function pt(e, t) {
2641
2644
  return {
2642
2645
  required: !0,
2643
2646
  schema: e,
2644
2647
  derive: t
2645
2648
  };
2646
2649
  }
2647
- function pt(e) {
2650
+ function ft(e) {
2648
2651
  return {
2649
2652
  required: !0,
2650
2653
  schema: e
2651
2654
  };
2652
2655
  }
2653
- function ft(e) {
2656
+ function _t(e) {
2654
2657
  return {
2655
2658
  required: !1,
2656
2659
  schema: e
2657
2660
  };
2658
2661
  }
2659
- var _t = {
2660
- type: pt(ut),
2661
- id: pt(lt),
2662
- transports: ft(ut)
2663
- },
2664
- mt = {
2665
- appid: ft(ut),
2666
- appidExclude: ft(ut),
2667
- credProps: ft(ut)
2662
+ var mt = {
2663
+ type: ft(lt),
2664
+ id: ft(dt),
2665
+ transports: _t(lt)
2668
2666
  },
2669
2667
  vt = {
2670
- appid: ft(ut),
2671
- appidExclude: ft(ut),
2672
- credProps: ft(ut)
2668
+ appid: _t(lt),
2669
+ appidExclude: _t(lt),
2670
+ credProps: _t(lt)
2673
2671
  },
2674
2672
  yt = {
2675
- publicKey: pt({
2676
- rp: pt(ut),
2677
- user: pt({
2678
- id: pt(lt),
2679
- name: pt(ut),
2680
- displayName: pt(ut)
2673
+ appid: _t(lt),
2674
+ appidExclude: _t(lt),
2675
+ credProps: _t(lt)
2676
+ },
2677
+ gt = {
2678
+ publicKey: ft({
2679
+ rp: ft(lt),
2680
+ user: ft({
2681
+ id: ft(dt),
2682
+ name: ft(lt),
2683
+ displayName: ft(lt)
2681
2684
  }),
2682
- challenge: pt(lt),
2683
- pubKeyCredParams: pt(ut),
2684
- timeout: ft(ut),
2685
- excludeCredentials: ft([_t]),
2686
- authenticatorSelection: ft(ut),
2687
- attestation: ft(ut),
2688
- extensions: ft(mt)
2685
+ challenge: ft(dt),
2686
+ pubKeyCredParams: ft(lt),
2687
+ timeout: _t(lt),
2688
+ excludeCredentials: _t([mt]),
2689
+ authenticatorSelection: _t(lt),
2690
+ attestation: _t(lt),
2691
+ extensions: _t(vt)
2689
2692
  }),
2690
- signal: ft(ut)
2693
+ signal: _t(lt)
2691
2694
  },
2692
- gt = {
2693
- type: pt(ut),
2694
- id: pt(ut),
2695
- rawId: pt(lt),
2696
- authenticatorAttachment: ft(ut),
2697
- response: pt({
2698
- clientDataJSON: pt(lt),
2699
- attestationObject: pt(lt),
2700
- transports: ht(ut, function (e) {
2695
+ bt = {
2696
+ type: ft(lt),
2697
+ id: ft(lt),
2698
+ rawId: ft(dt),
2699
+ authenticatorAttachment: _t(lt),
2700
+ response: ft({
2701
+ clientDataJSON: ft(dt),
2702
+ attestationObject: ft(dt),
2703
+ transports: pt(lt, function (e) {
2701
2704
  var t;
2702
2705
  return (null == (t = e.getTransports) ? void 0 : t.call(e)) || [];
2703
2706
  })
2704
2707
  }),
2705
- clientExtensionResults: ht(vt, function (e) {
2708
+ clientExtensionResults: pt(yt, function (e) {
2706
2709
  return e.getClientExtensionResults();
2707
2710
  })
2708
2711
  },
2709
- bt = {
2710
- mediation: ft(ut),
2711
- publicKey: pt({
2712
- challenge: pt(lt),
2713
- timeout: ft(ut),
2714
- rpId: ft(ut),
2715
- allowCredentials: ft([_t]),
2716
- userVerification: ft(ut),
2717
- extensions: ft(mt)
2712
+ kt = {
2713
+ mediation: _t(lt),
2714
+ publicKey: ft({
2715
+ challenge: ft(dt),
2716
+ timeout: _t(lt),
2717
+ rpId: _t(lt),
2718
+ allowCredentials: _t([mt]),
2719
+ userVerification: _t(lt),
2720
+ extensions: _t(vt)
2718
2721
  }),
2719
- signal: ft(ut)
2722
+ signal: _t(lt)
2720
2723
  },
2721
- kt = {
2722
- type: pt(ut),
2723
- id: pt(ut),
2724
- rawId: pt(lt),
2725
- authenticatorAttachment: ft(ut),
2726
- response: pt({
2727
- clientDataJSON: pt(lt),
2728
- authenticatorData: pt(lt),
2729
- signature: pt(lt),
2730
- userHandle: pt(lt)
2724
+ wt = {
2725
+ type: ft(lt),
2726
+ id: ft(lt),
2727
+ rawId: ft(dt),
2728
+ authenticatorAttachment: _t(lt),
2729
+ response: ft({
2730
+ clientDataJSON: ft(dt),
2731
+ authenticatorData: ft(dt),
2732
+ signature: ft(dt),
2733
+ userHandle: ft(dt)
2731
2734
  }),
2732
- clientExtensionResults: ht(vt, function (e) {
2735
+ clientExtensionResults: pt(yt, function (e) {
2733
2736
  return e.getClientExtensionResults();
2734
2737
  })
2735
2738
  };
2736
- function wt(e) {
2737
- return dt(at, yt, e);
2738
- }
2739
2739
  function St(e) {
2740
- return dt(ct, gt, e);
2740
+ return ht(ct, gt, e);
2741
2741
  }
2742
2742
  function Ct(e) {
2743
- return Oe(this, void 0, void 0, he().mark(function t() {
2743
+ return ht(ut, bt, e);
2744
+ }
2745
+ function Tt(e) {
2746
+ return Pe(this, void 0, void 0, pe().mark(function t() {
2744
2747
  var r;
2745
- return he().wrap(function (t) {
2748
+ return pe().wrap(function (t) {
2746
2749
  for (;;) switch (t.prev = t.next) {
2747
2750
  case 0:
2748
- return t.next = 2, navigator.credentials.create(wt(e));
2751
+ return t.next = 2, navigator.credentials.create(St(e));
2749
2752
  case 2:
2750
- return r = t.sent, t.abrupt("return", St(r));
2753
+ return r = t.sent, t.abrupt("return", Ct(r));
2751
2754
  case 4:
2752
2755
  case "end":
2753
2756
  return t.stop();
@@ -2755,21 +2758,21 @@ function Ct(e) {
2755
2758
  }, t);
2756
2759
  }));
2757
2760
  }
2758
- function Tt(e) {
2759
- return dt(at, bt, e);
2760
- }
2761
2761
  function Ot(e) {
2762
- return dt(ct, kt, e);
2762
+ return ht(ct, kt, e);
2763
2763
  }
2764
2764
  function Pt(e) {
2765
- return Oe(this, void 0, void 0, he().mark(function t() {
2765
+ return ht(ut, wt, e);
2766
+ }
2767
+ function At(e) {
2768
+ return Pe(this, void 0, void 0, pe().mark(function t() {
2766
2769
  var r;
2767
- return he().wrap(function (t) {
2770
+ return pe().wrap(function (t) {
2768
2771
  for (;;) switch (t.prev = t.next) {
2769
2772
  case 0:
2770
- return t.next = 2, navigator.credentials.get(Tt(e));
2773
+ return t.next = 2, navigator.credentials.get(Ot(e));
2771
2774
  case 2:
2772
- return r = t.sent, t.abrupt("return", Ot(r));
2775
+ return r = t.sent, t.abrupt("return", Pt(r));
2773
2776
  case 4:
2774
2777
  case "end":
2775
2778
  return t.stop();
@@ -2777,22 +2780,22 @@ function Pt(e) {
2777
2780
  }, t);
2778
2781
  }));
2779
2782
  }
2780
- var At = function () {
2783
+ var xt = function () {
2781
2784
  function e(t, r, n) {
2782
- me(this, e), this._networkClient = t, this._subscriptionService = r, this.dfpProtectedAuth = n, this.checkEligibleInputs = function () {
2785
+ ve(this, e), this._networkClient = t, this._subscriptionService = r, this.dfpProtectedAuth = n, this.checkEligibleInputs = function () {
2783
2786
  return !(document.querySelectorAll("input[autocomplete*='webauthn']").length < 1) || (console.error('No <input> with `"webauthn"` in its `autocomplete` attribute was detected'), !1);
2784
2787
  };
2785
2788
  }
2786
- return fe(e, [{
2789
+ return _e(e, [{
2787
2790
  key: "register",
2788
2791
  value: function value(e) {
2789
2792
  var t, r;
2790
- return Oe(this, void 0, void 0, he().mark(function n() {
2793
+ return Pe(this, void 0, void 0, pe().mark(function n() {
2791
2794
  var i, s, o, a, c;
2792
- return he().wrap(function (n) {
2795
+ return pe().wrap(function (n) {
2793
2796
  for (;;) switch (n.prev = n.next) {
2794
2797
  case 0:
2795
- return ze("stytch.webauthn.register").isOptionalString("domain", null == e ? void 0 : e.domain).isOptionalString("authenticator_type", null == e ? void 0 : e.authenticator_type).isOptionalBoolean("is_passkey", null == e ? void 0 : e.is_passkey).isOptionalNumber("session_duration_minutes", null == e ? void 0 : e.session_duration_minutes), n.next = 3, this._networkClient.fetchSDK({
2798
+ return Ve("stytch.webauthn.register").isOptionalString("domain", null == e ? void 0 : e.domain).isOptionalString("authenticator_type", null == e ? void 0 : e.authenticator_type).isOptionalBoolean("is_passkey", null == e ? void 0 : e.is_passkey).isOptionalNumber("session_duration_minutes", null == e ? void 0 : e.session_duration_minutes), n.next = 3, this._networkClient.fetchSDK({
2796
2799
  url: "/webauthn/register/start",
2797
2800
  method: "POST",
2798
2801
  errorMessage: "Failed to start WebAuthn registration",
@@ -2804,7 +2807,7 @@ var At = function () {
2804
2807
  }
2805
2808
  });
2806
2809
  case 3:
2807
- return i = n.sent, s = i.public_key_credential_creation_options, o = JSON.parse(s), n.next = 8, Ct({
2810
+ return i = n.sent, s = i.public_key_credential_creation_options, o = JSON.parse(s), n.next = 8, Tt({
2808
2811
  publicKey: o
2809
2812
  });
2810
2813
  case 8:
@@ -2826,7 +2829,7 @@ var At = function () {
2826
2829
  session_token: c.session_token,
2827
2830
  session_jwt: c.session_jwt,
2828
2831
  intermediate_session_token: null
2829
- }), n.abrupt("return", Ve(c));
2832
+ }), n.abrupt("return", Je(c));
2830
2833
  case 14:
2831
2834
  case "end":
2832
2835
  return n.stop();
@@ -2838,12 +2841,12 @@ var At = function () {
2838
2841
  key: "authenticate",
2839
2842
  value: function value(e) {
2840
2843
  var t, r;
2841
- return Oe(this, void 0, void 0, he().mark(function n() {
2844
+ return Pe(this, void 0, void 0, pe().mark(function n() {
2842
2845
  var i, s, o, a, c, u, l, d, h, p, f, _;
2843
- return he().wrap(function (n) {
2846
+ return pe().wrap(function (n) {
2844
2847
  for (;;) switch (n.prev = n.next) {
2845
2848
  case 0:
2846
- return ze("stytch.webauthn.authenticate").isOptionalString("domain", e.domain).isNumber("session_duration_minutes", e.session_duration_minutes).isOptionalBoolean("is_passkey", e.is_passkey).isOptionalObject("signal", e.signal), n.next = 3, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
2849
+ return Ve("stytch.webauthn.authenticate").isOptionalString("domain", e.domain).isNumber("session_duration_minutes", e.session_duration_minutes).isOptionalBoolean("is_passkey", e.is_passkey).isOptionalObject("signal", e.signal), n.next = 3, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
2847
2850
  case 3:
2848
2851
  if (i = n.sent, s = i.dfp_telemetry_id, o = i.captcha_token, !e.conditional_mediation) {
2849
2852
  n.next = 14;
@@ -2878,7 +2881,7 @@ var At = function () {
2878
2881
  signal: null !== (r = e.signal) && void 0 !== r ? r : d.signal
2879
2882
  }, p = Object.assign(Object.assign({}, h), {
2880
2883
  mediation: "conditional"
2881
- }), n.next = 25, Pt(e.conditional_mediation ? p : h);
2884
+ }), n.next = 25, At(e.conditional_mediation ? p : h);
2882
2885
  case 25:
2883
2886
  return f = n.sent, n.next = 28, this._networkClient.retriableFetchSDK({
2884
2887
  url: "/webauthn/authenticate",
@@ -2901,7 +2904,7 @@ var At = function () {
2901
2904
  session_token: _.session_token,
2902
2905
  session_jwt: _.session_jwt,
2903
2906
  intermediate_session_token: null
2904
- }), n.abrupt("return", Ve(_));
2907
+ }), n.abrupt("return", Je(_));
2905
2908
  case 31:
2906
2909
  case "end":
2907
2910
  return n.stop();
@@ -2912,9 +2915,9 @@ var At = function () {
2912
2915
  }, {
2913
2916
  key: "update",
2914
2917
  value: function value(e) {
2915
- return Oe(this, void 0, void 0, he().mark(function t() {
2918
+ return Pe(this, void 0, void 0, pe().mark(function t() {
2916
2919
  var r;
2917
- return he().wrap(function (t) {
2920
+ return pe().wrap(function (t) {
2918
2921
  for (;;) switch (t.prev = t.next) {
2919
2922
  case 0:
2920
2923
  return r = "/webauthn/update/" + e.webauthn_registration_id, t.next = 3, this._networkClient.fetchSDK({
@@ -2937,9 +2940,9 @@ var At = function () {
2937
2940
  }, {
2938
2941
  key: "browserSupportsAutofill",
2939
2942
  value: function value() {
2940
- return Oe(this, void 0, void 0, he().mark(function e() {
2943
+ return Pe(this, void 0, void 0, pe().mark(function e() {
2941
2944
  var t;
2942
- return he().wrap(function (e) {
2945
+ return pe().wrap(function (e) {
2943
2946
  for (;;) switch (e.prev = e.next) {
2944
2947
  case 0:
2945
2948
  if (void 0 !== (t = window.PublicKeyCredential) && void 0 !== t.isConditionalMediationAvailable) {
@@ -2960,21 +2963,21 @@ var At = function () {
2960
2963
  }
2961
2964
  }]), e;
2962
2965
  }(),
2963
- xt = Promise.resolve({
2966
+ Et = Promise.resolve({
2964
2967
  pkceRequiredForPasswordResets: !1
2965
2968
  }),
2966
- Et = function () {
2969
+ Dt = function () {
2967
2970
  function e(t, r, n) {
2968
- var i = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : xt,
2969
- s = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : $e();
2970
- me(this, e), this._networkClient = t, this._subscriptionService = r, this._pkceManager = n, this._config = i, this.dfpProtectedAuth = s;
2971
+ var i = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : Et,
2972
+ s = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : Xe();
2973
+ ve(this, e), this._networkClient = t, this._subscriptionService = r, this._pkceManager = n, this._config = i, this.dfpProtectedAuth = s;
2971
2974
  }
2972
- return fe(e, [{
2975
+ return _e(e, [{
2973
2976
  key: "getCodeChallenge",
2974
2977
  value: function value() {
2975
- return Oe(this, void 0, void 0, he().mark(function e() {
2978
+ return Pe(this, void 0, void 0, pe().mark(function e() {
2976
2979
  var t, r;
2977
- return he().wrap(function (e) {
2980
+ return pe().wrap(function (e) {
2978
2981
  for (;;) switch (e.prev = e.next) {
2979
2982
  case 0:
2980
2983
  return e.next = 2, this._config;
@@ -3006,12 +3009,12 @@ var At = function () {
3006
3009
  }, {
3007
3010
  key: "create",
3008
3011
  value: function value(e) {
3009
- return Oe(this, void 0, void 0, he().mark(function t() {
3012
+ return Pe(this, void 0, void 0, pe().mark(function t() {
3010
3013
  var r, n, i, s;
3011
- return he().wrap(function (t) {
3014
+ return pe().wrap(function (t) {
3012
3015
  for (;;) switch (t.prev = t.next) {
3013
3016
  case 0:
3014
- return ze("stytch.passwords.create").isString("password", e.password).isString("email", e.email).isNumber("session_duration_minutes", e.session_duration_minutes), t.next = 3, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
3017
+ return Ve("stytch.passwords.create").isString("password", e.password).isString("email", e.email).isNumber("session_duration_minutes", e.session_duration_minutes), t.next = 3, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
3015
3018
  case 3:
3016
3019
  return r = t.sent, n = r.dfp_telemetry_id, i = r.captcha_token, t.next = 8, this._networkClient.retriableFetchSDK({
3017
3020
  url: "/passwords",
@@ -3035,7 +3038,7 @@ var At = function () {
3035
3038
  session_token: s.session_token,
3036
3039
  session_jwt: s.session_jwt,
3037
3040
  intermediate_session_token: null
3038
- }), t.abrupt("return", Ve(s));
3041
+ }), t.abrupt("return", Je(s));
3039
3042
  case 11:
3040
3043
  case "end":
3041
3044
  return t.stop();
@@ -3046,12 +3049,12 @@ var At = function () {
3046
3049
  }, {
3047
3050
  key: "authenticate",
3048
3051
  value: function value(e) {
3049
- return Oe(this, void 0, void 0, he().mark(function t() {
3052
+ return Pe(this, void 0, void 0, pe().mark(function t() {
3050
3053
  var r, n, i, s;
3051
- return he().wrap(function (t) {
3054
+ return pe().wrap(function (t) {
3052
3055
  for (;;) switch (t.prev = t.next) {
3053
3056
  case 0:
3054
- return ze("stytch.passwords.authenticate").isString("password", e.password).isString("email", e.email).isNumber("session_duration_minutes", e.session_duration_minutes), t.next = 3, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
3057
+ return Ve("stytch.passwords.authenticate").isString("password", e.password).isString("email", e.email).isNumber("session_duration_minutes", e.session_duration_minutes), t.next = 3, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
3055
3058
  case 3:
3056
3059
  return r = t.sent, n = r.dfp_telemetry_id, i = r.captcha_token, t.next = 8, this._networkClient.retriableFetchSDK({
3057
3060
  url: "/passwords/authenticate",
@@ -3075,7 +3078,7 @@ var At = function () {
3075
3078
  session_token: s.session_token,
3076
3079
  session_jwt: s.session_jwt,
3077
3080
  intermediate_session_token: null
3078
- }), t.abrupt("return", Ve(s));
3081
+ }), t.abrupt("return", Je(s));
3079
3082
  case 11:
3080
3083
  case "end":
3081
3084
  return t.stop();
@@ -3086,12 +3089,12 @@ var At = function () {
3086
3089
  }, {
3087
3090
  key: "resetByEmailStart",
3088
3091
  value: function value(e) {
3089
- return Oe(this, void 0, void 0, he().mark(function t() {
3092
+ return Pe(this, void 0, void 0, pe().mark(function t() {
3090
3093
  var r, n, i, s;
3091
- return he().wrap(function (t) {
3094
+ return pe().wrap(function (t) {
3092
3095
  for (;;) switch (t.prev = t.next) {
3093
3096
  case 0:
3094
- return ze("stytch.passwords.resetByEmailStart").isString("email", e.email).isOptionalString("login_redirect_url", e.login_redirect_url).isOptionalString("reset_password_redirect_url", e.reset_password_redirect_url).isOptionalString("reset_password_template_id", e.reset_password_template_id).isOptionalNumber("reset_password_expiration_minutes", e.reset_password_expiration_minutes), t.next = 3, this.getCodeChallenge();
3097
+ return Ve("stytch.passwords.resetByEmailStart").isString("email", e.email).isOptionalString("login_redirect_url", e.login_redirect_url).isOptionalString("reset_password_redirect_url", e.reset_password_redirect_url).isOptionalString("reset_password_template_id", e.reset_password_template_id).isOptionalNumber("reset_password_expiration_minutes", e.reset_password_expiration_minutes), t.next = 3, this.getCodeChallenge();
3095
3098
  case 3:
3096
3099
  return r = t.sent, t.next = 6, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
3097
3100
  case 6:
@@ -3121,12 +3124,12 @@ var At = function () {
3121
3124
  }, {
3122
3125
  key: "resetByEmail",
3123
3126
  value: function value(e) {
3124
- return Oe(this, void 0, void 0, he().mark(function t() {
3127
+ return Pe(this, void 0, void 0, pe().mark(function t() {
3125
3128
  var r, n, i, s, o, a;
3126
- return he().wrap(function (t) {
3129
+ return pe().wrap(function (t) {
3127
3130
  for (;;) switch (t.prev = t.next) {
3128
3131
  case 0:
3129
- return ze("stytch.passwords.resetByEmail").isString("token", e.token).isString("password", e.password).isNumber("session_duration_minutes", e.session_duration_minutes), t.next = 3, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
3132
+ return Ve("stytch.passwords.resetByEmail").isString("token", e.token).isString("password", e.password).isNumber("session_duration_minutes", e.session_duration_minutes), t.next = 3, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
3130
3133
  case 3:
3131
3134
  return r = t.sent, n = r.dfp_telemetry_id, i = r.captcha_token, t.next = 8, this._pkceManager.getPKPair();
3132
3135
  case 8:
@@ -3153,7 +3156,7 @@ var At = function () {
3153
3156
  session_token: a.session_token,
3154
3157
  session_jwt: a.session_jwt,
3155
3158
  intermediate_session_token: null
3156
- }), t.abrupt("return", Ve(a));
3159
+ }), t.abrupt("return", Je(a));
3157
3160
  case 16:
3158
3161
  case "end":
3159
3162
  return t.stop();
@@ -3164,12 +3167,12 @@ var At = function () {
3164
3167
  }, {
3165
3168
  key: "resetByExistingPassword",
3166
3169
  value: function value(e) {
3167
- return Oe(this, void 0, void 0, he().mark(function t() {
3170
+ return Pe(this, void 0, void 0, pe().mark(function t() {
3168
3171
  var r, n, i, s;
3169
- return he().wrap(function (t) {
3172
+ return pe().wrap(function (t) {
3170
3173
  for (;;) switch (t.prev = t.next) {
3171
3174
  case 0:
3172
- return ze("stytch.passwords.resetByExistingPassword").isString("email", e.email).isString("existing_password", e.existing_password).isString("new_password", e.new_password).isNumber("session_duration_minutes", e.session_duration_minutes), t.next = 3, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
3175
+ return Ve("stytch.passwords.resetByExistingPassword").isString("email", e.email).isString("existing_password", e.existing_password).isString("new_password", e.new_password).isNumber("session_duration_minutes", e.session_duration_minutes), t.next = 3, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
3173
3176
  case 3:
3174
3177
  return r = t.sent, n = r.dfp_telemetry_id, i = r.captcha_token, t.next = 8, this._networkClient.retriableFetchSDK({
3175
3178
  url: "/passwords/existing_password/reset",
@@ -3194,7 +3197,7 @@ var At = function () {
3194
3197
  session_token: s.session_token,
3195
3198
  session_jwt: s.session_jwt,
3196
3199
  intermediate_session_token: null
3197
- }), t.abrupt("return", Ve(s));
3200
+ }), t.abrupt("return", Je(s));
3198
3201
  case 11:
3199
3202
  case "end":
3200
3203
  return t.stop();
@@ -3205,12 +3208,12 @@ var At = function () {
3205
3208
  }, {
3206
3209
  key: "resetBySession",
3207
3210
  value: function value(e) {
3208
- return Oe(this, void 0, void 0, he().mark(function t() {
3211
+ return Pe(this, void 0, void 0, pe().mark(function t() {
3209
3212
  var r, n, i, s;
3210
- return he().wrap(function (t) {
3213
+ return pe().wrap(function (t) {
3211
3214
  for (;;) switch (t.prev = t.next) {
3212
3215
  case 0:
3213
- return ze("stytch.passwords.resetBySession").isString("password", e.password), t.next = 3, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
3216
+ return Ve("stytch.passwords.resetBySession").isString("password", e.password), t.next = 3, this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
3214
3217
  case 3:
3215
3218
  return r = t.sent, n = r.dfp_telemetry_id, i = r.captcha_token, t.next = 8, this._networkClient.retriableFetchSDK({
3216
3219
  url: "/passwords/session/reset",
@@ -3244,11 +3247,11 @@ var At = function () {
3244
3247
  }, {
3245
3248
  key: "strengthCheck",
3246
3249
  value: function value(e) {
3247
- return Oe(this, void 0, void 0, he().mark(function t() {
3248
- return he().wrap(function (t) {
3250
+ return Pe(this, void 0, void 0, pe().mark(function t() {
3251
+ return pe().wrap(function (t) {
3249
3252
  for (;;) switch (t.prev = t.next) {
3250
3253
  case 0:
3251
- return ze("stytch.passwords.strengthCheck").isOptionalString("email", e.email).isString("password", e.password), t.abrupt("return", this._networkClient.fetchSDK({
3254
+ return Ve("stytch.passwords.strengthCheck").isOptionalString("email", e.email).isString("password", e.password), t.abrupt("return", this._networkClient.fetchSDK({
3252
3255
  url: "/passwords/strength_check",
3253
3256
  method: "POST",
3254
3257
  errorMessage: "Failed to check password strength.",
@@ -3271,15 +3274,15 @@ Promise.resolve({
3271
3274
  }), Promise.resolve({
3272
3275
  pkceRequiredForPasswordResets: !1
3273
3276
  });
3274
- var Dt = function () {
3277
+ var Rt = function () {
3275
3278
  function e(t) {
3276
- me(this, e), this.iframeURL = t, this.createIframe();
3279
+ ve(this, e), this.iframeURL = t, this.createIframe();
3277
3280
  }
3278
- return fe(e, [{
3281
+ return _e(e, [{
3279
3282
  key: "createIframe",
3280
3283
  value: function value() {
3281
3284
  var e = document.querySelector('[src~="'.concat(this.iframeURL, '"]'));
3282
- e ? We("It looks like you're creating multiple copies of the Stytch client. This behavior is unsupported, and unintended side effects may occur. Make sure you are creating the Stytch client at the global level, and not inside a component's render function.") : ((e = document.createElement("iframe")).src = this.iframeURL, e.style.position = "absolute", e.style.width = "0", e.style.height = "0", e.style.border = "0", document.body.appendChild(e)), "true" !== e.dataset.loaded ? this.frame = new Promise(function (t) {
3285
+ e ? He("It looks like you're creating multiple copies of the Stytch client. This behavior is unsupported, and unintended side effects may occur. Make sure you are creating the Stytch client at the global level, and not inside a component's render function.") : ((e = document.createElement("iframe")).src = this.iframeURL, e.style.position = "absolute", e.style.width = "0", e.style.height = "0", e.style.border = "0", document.body.appendChild(e)), "true" !== e.dataset.loaded ? this.frame = new Promise(function (t) {
3283
3286
  e.addEventListener("load", function () {
3284
3287
  e.dataset.loaded = "true", t(e);
3285
3288
  }, {
@@ -3290,11 +3293,11 @@ var Dt = function () {
3290
3293
  }, {
3291
3294
  key: "call",
3292
3295
  value: function value(e, t) {
3293
- return Oe(this, void 0, void 0, he().mark(function r() {
3296
+ return Pe(this, void 0, void 0, pe().mark(function r() {
3294
3297
  var n,
3295
3298
  i,
3296
3299
  s = this;
3297
- return he().wrap(function (r) {
3300
+ return pe().wrap(function (r) {
3298
3301
  for (;;) switch (r.prev = r.next) {
3299
3302
  case 0:
3300
3303
  return r.next = 2, this.frame;
@@ -3303,7 +3306,7 @@ var Dt = function () {
3303
3306
  var a;
3304
3307
  i.port1.onmessage = function (e) {
3305
3308
  var t = e.data;
3306
- i.port1.close(), t.success ? r(t.payload) : o(Xe.unmarshall(t.error));
3309
+ i.port1.close(), t.success ? r(t.payload) : o(Ze.unmarshall(t.error));
3307
3310
  };
3308
3311
  var c = {
3309
3312
  method: e,
@@ -3320,15 +3323,15 @@ var Dt = function () {
3320
3323
  }
3321
3324
  }]), e;
3322
3325
  }(),
3323
- Rt = function () {
3326
+ It = function () {
3324
3327
  function e(t, r) {
3325
3328
  var n = this;
3326
- me(this, e), this._subscriptionService = t, this._headlessSessionClient = r, this._onDataChange = function (e) {
3329
+ ve(this, e), this._subscriptionService = t, this._headlessSessionClient = r, this._onDataChange = function (e) {
3327
3330
  (null == e ? void 0 : e.session) ? n.scheduleBackgroundRefresh() : n.cancelBackgroundRefresh();
3328
3331
  }, this._reauthenticateWithBackoff = function () {
3329
- return Oe(n, void 0, void 0, he().mark(function t() {
3332
+ return Pe(n, void 0, void 0, pe().mark(function t() {
3330
3333
  var r;
3331
- return he().wrap(function (t) {
3334
+ return pe().wrap(function (t) {
3332
3335
  for (;;) switch (t.prev = t.next) {
3333
3336
  case 0:
3334
3337
  r = 0;
@@ -3357,14 +3360,14 @@ var Dt = function () {
3357
3360
  }));
3358
3361
  }, this.timeout = null, this._subscriptionService.subscribeToState(this._onDataChange);
3359
3362
  }
3360
- return fe(e, [{
3363
+ return _e(e, [{
3361
3364
  key: "performBackgroundRefresh",
3362
3365
  value: function value() {
3363
3366
  var e = this;
3364
3367
  this._reauthenticateWithBackoff().then(function () {
3365
3368
  e.scheduleBackgroundRefresh();
3366
3369
  })["catch"](function (t) {
3367
- We("Session background refresh failed. Signalling to app that user is logged out.", {
3370
+ He("Session background refresh failed. Signalling to app that user is logged out.", {
3368
3371
  error: t
3369
3372
  }), e._subscriptionService.destroySession();
3370
3373
  });
@@ -3390,22 +3393,22 @@ var Dt = function () {
3390
3393
  }, {
3391
3394
  key: "isUnrecoverableError",
3392
3395
  value: function value(e) {
3393
- return T.includes(e.error_type);
3396
+ return O.includes(e.error_type);
3394
3397
  }
3395
3398
  }]), e;
3396
3399
  }();
3397
- Rt.REFRESH_INTERVAL_MS = 18e4;
3398
- var It = "bootstrap";
3399
- var Ft = /*#__PURE__*/function () {
3400
- function Ft(e, t, r) {
3400
+ It.REFRESH_INTERVAL_MS = 18e4;
3401
+ var Ft = "bootstrap";
3402
+ var jt = /*#__PURE__*/function () {
3403
+ function jt(e, t, r) {
3401
3404
  var _this = this;
3402
- _classCallCheck(this, Ft);
3405
+ _classCallCheck(this, jt);
3403
3406
  this._publicToken = e, this._networkClient = t, this._dataLayer = r, this._bootstrapDataPromise = this._networkClient.fetchSDK({
3404
3407
  url: "/projects/bootstrap/".concat(this._publicToken),
3405
3408
  method: "GET",
3406
3409
  errorMessage: "Error fetching bootstrap data for SDK for ".concat(this._publicToken)
3407
- }).then(Ft.mapBootstrapData).then(function (e) {
3408
- return _this._dataLayer.setItem(It, JSON.stringify(e)), e;
3410
+ }).then(jt.mapBootstrapData).then(function (e) {
3411
+ return _this._dataLayer.setItem(Ft, JSON.stringify(e)), e;
3409
3412
  })["catch"](function (e) {
3410
3413
  return Ge(e), {
3411
3414
  displayWatermark: !1,
@@ -3426,10 +3429,10 @@ var Ft = /*#__PURE__*/function () {
3426
3429
  };
3427
3430
  });
3428
3431
  }
3429
- _createClass(Ft, [{
3432
+ _createClass(jt, [{
3430
3433
  key: "getSync",
3431
3434
  value: function getSync() {
3432
- var e = this._dataLayer.getItem(It);
3435
+ var e = this._dataLayer.getItem(Ft);
3433
3436
  if (null === e) return {
3434
3437
  displayWatermark: !1,
3435
3438
  cnameDomain: null,
@@ -3500,9 +3503,9 @@ var Ft = /*#__PURE__*/function () {
3500
3503
  };
3501
3504
  }
3502
3505
  }]);
3503
- return Ft;
3506
+ return jt;
3504
3507
  }();
3505
- function jt(e, t, r, n) {
3508
+ function Lt(e, t, r, n) {
3506
3509
  return new (r || (r = Promise))(function (i, s) {
3507
3510
  function o(e) {
3508
3511
  try {
@@ -3528,11 +3531,11 @@ function jt(e, t, r, n) {
3528
3531
  });
3529
3532
  }
3530
3533
  "function" == typeof SuppressedError && SuppressedError;
3531
- var Lt = /*#__PURE__*/_createClass(function Lt(e) {
3534
+ var Bt = /*#__PURE__*/_createClass(function Bt(e) {
3532
3535
  var _this2 = this;
3533
- _classCallCheck(this, Lt);
3536
+ _classCallCheck(this, Bt);
3534
3537
  this.bootstrapPromise = e, this.executeRecaptcha = function () {
3535
- return jt(_this2, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
3538
+ return Lt(_this2, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
3536
3539
  var _yield$this$state, e, t, r;
3537
3540
  return _regeneratorRuntime().wrap(function _callee$(_context) {
3538
3541
  while (1) switch (_context.prev = _context.next) {
@@ -3563,7 +3566,7 @@ var Lt = /*#__PURE__*/_createClass(function Lt(e) {
3563
3566
  }, _callee, this);
3564
3567
  }));
3565
3568
  }, this.state = e.then(function (e) {
3566
- return jt(_this2, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
3569
+ return Lt(_this2, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
3567
3570
  var t;
3568
3571
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
3569
3572
  while (1) switch (_context2.prev = _context2.next) {
@@ -3574,7 +3577,7 @@ var Lt = /*#__PURE__*/_createClass(function Lt(e) {
3574
3577
  }
3575
3578
  _context2.t1 = !0;
3576
3579
  _context2.next = 4;
3577
- return t = e.captchaSettings.siteKey, Me("https://www.google.com/recaptcha/enterprise.js?render=".concat(t), function () {
3580
+ return t = e.captchaSettings.siteKey, Ne("https://www.google.com/recaptcha/enterprise.js?render=".concat(t), function () {
3578
3581
  return window.grecaptcha.enterprise;
3579
3582
  });
3580
3583
  case 4:
@@ -3601,10 +3604,10 @@ var Lt = /*#__PURE__*/_createClass(function Lt(e) {
3601
3604
  }));
3602
3605
  });
3603
3606
  });
3604
- var Bt = /*#__PURE__*/function () {
3605
- function Bt(e) {
3607
+ var Mt = /*#__PURE__*/function () {
3608
+ function Mt(e) {
3606
3609
  var _this3 = this;
3607
- _classCallCheck(this, Bt);
3610
+ _classCallCheck(this, Mt);
3608
3611
  this.iframeURL = e, this.oneTapStart = function (e) {
3609
3612
  return _this3.call("oneTapStart", e);
3610
3613
  }, this.oneTapSubmit = function (e) {
@@ -3613,11 +3616,11 @@ var Bt = /*#__PURE__*/function () {
3613
3616
  return _this3.call("parsedPhoneNumber", e);
3614
3617
  };
3615
3618
  }
3616
- _createClass(Bt, [{
3619
+ _createClass(Mt, [{
3617
3620
  key: "frameClient",
3618
3621
  get: function get() {
3619
3622
  var e;
3620
- return this._frameClient = null !== (e = this._frameClient) && void 0 !== e ? e : new Dt(this.iframeURL), this._frameClient;
3623
+ return this._frameClient = null !== (e = this._frameClient) && void 0 !== e ? e : new Rt(this.iframeURL), this._frameClient;
3621
3624
  }
3622
3625
  }, {
3623
3626
  key: "call",
@@ -3625,15 +3628,15 @@ var Bt = /*#__PURE__*/function () {
3625
3628
  return this.frameClient.call(e, [t]);
3626
3629
  }
3627
3630
  }]);
3628
- return Bt;
3631
+ return Mt;
3629
3632
  }();
3630
- var Mt = /*#__PURE__*/function (_it) {
3631
- _inherits(Mt, _it);
3632
- function Mt(e, t, r, n, i, s) {
3633
+ var Nt = /*#__PURE__*/function (_st) {
3634
+ _inherits(Nt, _st);
3635
+ function Nt(e, t, r, n, i, s) {
3633
3636
  var _this4;
3634
- _classCallCheck(this, Mt);
3635
- _this4 = _callSuper(this, Mt, [e, t, r, n, i]), _this4._oneTap = s, _this4.startOneTap = function (e) {
3636
- return jt(_assertThisInitialized(_this4), void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
3637
+ _classCallCheck(this, Nt);
3638
+ _this4 = _callSuper(this, Nt, [e, t, r, n, i]), _this4._oneTap = s, _this4.startOneTap = function (e) {
3639
+ return Lt(_assertThisInitialized(_this4), void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
3637
3640
  var t, r, n;
3638
3641
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
3639
3642
  while (1) switch (_context3.prev = _context3.next) {
@@ -3671,20 +3674,20 @@ var Mt = /*#__PURE__*/function (_it) {
3671
3674
  };
3672
3675
  return _this4;
3673
3676
  }
3674
- return _createClass(Mt);
3675
- }(it);
3676
- var Nt = /*#__PURE__*/function () {
3677
- function Nt(e, t, r, n) {
3678
- _classCallCheck(this, Nt);
3677
+ return _createClass(Nt);
3678
+ }(st);
3679
+ var Ut = /*#__PURE__*/function () {
3680
+ function Ut(e, t, r, n) {
3681
+ _classCallCheck(this, Ut);
3679
3682
  this._publicToken = e, this._subscriptionDataLayer = t, this.baseURL = r, this.additionalTelemetryDataFn = n, this.updateSessionToken = function () {
3680
3683
  return null;
3681
- }, this.eventLogger = new Ze({
3684
+ }, this.eventLogger = new Qe({
3682
3685
  maxBatchSize: 15,
3683
3686
  intervalDurationMs: 800,
3684
3687
  logEventURL: this.buildSDKUrl("/events")
3685
3688
  });
3686
3689
  }
3687
- _createClass(Nt, [{
3690
+ _createClass(Ut, [{
3688
3691
  key: "logEvent",
3689
3692
  value: function logEvent(_ref) {
3690
3693
  var e = _ref.name,
@@ -3704,9 +3707,9 @@ var Nt = /*#__PURE__*/function () {
3704
3707
  key: "createTelemetryBlob",
3705
3708
  value: function createTelemetryBlob() {
3706
3709
  return Object.assign(Object.assign({
3707
- event_id: "event-id-".concat(Le()),
3708
- app_session_id: "app-session-id-".concat(Le()),
3709
- persistent_id: "persistent-id-".concat(Le()),
3710
+ event_id: "event-id-".concat(Be()),
3711
+ app_session_id: "app-session-id-".concat(Be()),
3712
+ persistent_id: "persistent-id-".concat(Be()),
3710
3713
  client_sent_at: new Date().toISOString(),
3711
3714
  timezone: Intl.DateTimeFormat().resolvedOptions().timeZone
3712
3715
  }, this.additionalTelemetryDataFn()), {
@@ -3715,7 +3718,7 @@ var Nt = /*#__PURE__*/function () {
3715
3718
  },
3716
3719
  sdk: {
3717
3720
  identifier: "Stytch.js Javascript SDK",
3718
- version: "4.5.5"
3721
+ version: "4.6.0"
3719
3722
  }
3720
3723
  });
3721
3724
  }
@@ -3726,13 +3729,13 @@ var Nt = /*#__PURE__*/function () {
3726
3729
  t = _ref2.body,
3727
3730
  r = _ref2.errorMessage,
3728
3731
  n = _ref2.method;
3729
- return jt(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
3732
+ return Lt(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
3730
3733
  var i, s, o, a;
3731
3734
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
3732
3735
  while (1) switch (_context4.prev = _context4.next) {
3733
3736
  case 0:
3734
3737
  i = this._subscriptionDataLayer.readSessionCookie().session_token, s = "Basic " + window.btoa(this._publicToken + ":" + (i || this._publicToken)), o = window.btoa(JSON.stringify(this.createTelemetryBlob())), a = window.location.origin;
3735
- return _context4.abrupt("return", xe({
3738
+ return _context4.abrupt("return", Ee({
3736
3739
  basicAuthHeader: s,
3737
3740
  body: t,
3738
3741
  errorMessage: r,
@@ -3756,7 +3759,7 @@ var Nt = /*#__PURE__*/function () {
3756
3759
  r = _ref3.errorMessage,
3757
3760
  n = _ref3.method,
3758
3761
  i = _ref3.retryCallback;
3759
- return jt(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
3762
+ return Lt(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
3760
3763
  var s, o, a, c;
3761
3764
  return _regeneratorRuntime().wrap(function _callee5$(_context5) {
3762
3765
  while (1) switch (_context5.prev = _context5.next) {
@@ -3771,9 +3774,9 @@ var Nt = /*#__PURE__*/function () {
3771
3774
  o = e.xSDKParentHostHeader,
3772
3775
  a = e.body,
3773
3776
  c = e.retryCallback;
3774
- return Oe(this, void 0, void 0, he().mark(function e() {
3777
+ return Pe(this, void 0, void 0, pe().mark(function e() {
3775
3778
  var u;
3776
- return he().wrap(function (e) {
3779
+ return pe().wrap(function (e) {
3777
3780
  for (;;) switch (e.prev = e.next) {
3778
3781
  case 0:
3779
3782
  return u = {
@@ -3784,18 +3787,18 @@ var Nt = /*#__PURE__*/function () {
3784
3787
  xSDKClientHeader: s,
3785
3788
  xSDKParentHostHeader: o,
3786
3789
  body: a
3787
- }, e.prev = 1, e.next = 4, xe(u);
3790
+ }, e.prev = 1, e.next = 4, Ee(u);
3788
3791
  case 4:
3789
3792
  case 15:
3790
3793
  return e.abrupt("return", e.sent);
3791
3794
  case 7:
3792
- if (e.prev = 7, e.t0 = e["catch"](1), !(e.t0 instanceof Ae)) {
3795
+ if (e.prev = 7, e.t0 = e["catch"](1), !(e.t0 instanceof xe)) {
3793
3796
  e.next = 16;
3794
3797
  break;
3795
3798
  }
3796
3799
  return e.next = 12, c(e.t0, u);
3797
3800
  case 12:
3798
- return u = e.sent, e.next = 15, xe(u);
3801
+ return u = e.sent, e.next = 15, Ee(u);
3799
3802
  case 16:
3800
3803
  throw e.t0;
3801
3804
  case 17:
@@ -3827,14 +3830,14 @@ var Nt = /*#__PURE__*/function () {
3827
3830
  return "".concat(this.baseURL, "/sdk/v1").concat(e);
3828
3831
  }
3829
3832
  }]);
3830
- return Nt;
3833
+ return Ut;
3831
3834
  }();
3832
- var Ut = /*#__PURE__*/function () {
3833
- function Ut(e, t, r) {
3834
- _classCallCheck(this, Ut);
3835
+ var Kt = /*#__PURE__*/function () {
3836
+ function Kt(e, t, r) {
3837
+ _classCallCheck(this, Kt);
3835
3838
  this._googleClient = e, this._publicToken = t, this._clientId = r;
3836
3839
  }
3837
- _createClass(Ut, [{
3840
+ _createClass(Kt, [{
3838
3841
  key: "cancel",
3839
3842
  value: function cancel() {
3840
3843
  this._googleClient.cancel();
@@ -3845,7 +3848,7 @@ var Ut = /*#__PURE__*/function () {
3845
3848
  var e = _ref4.callback,
3846
3849
  t = _ref4.onOneTapCancelled,
3847
3850
  r = _ref4.style;
3848
- return jt(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
3851
+ return Lt(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
3849
3852
  var _this5 = this;
3850
3853
  var n;
3851
3854
  return _regeneratorRuntime().wrap(function _callee6$(_context6) {
@@ -3883,22 +3886,22 @@ var Ut = /*#__PURE__*/function () {
3883
3886
  key: "styleFrame",
3884
3887
  value: function styleFrame(e) {
3885
3888
  e.position === _.embedded && Array.from(document.getElementsByTagName("iframe")).forEach(function (e) {
3886
- e.src.includes(Se) && (e.style.width = "100%");
3889
+ e.src.includes(Ce) && (e.style.width = "100%");
3887
3890
  });
3888
3891
  }
3889
3892
  }]);
3890
- return Ut;
3893
+ return Kt;
3891
3894
  }();
3892
- var Kt = /*#__PURE__*/function () {
3893
- function Kt(e, t) {
3895
+ var qt = /*#__PURE__*/function () {
3896
+ function qt(e, t) {
3894
3897
  var _this6 = this;
3895
- _classCallCheck(this, Kt);
3898
+ _classCallCheck(this, qt);
3896
3899
  this._publicToken = e, this.clientsideServices = t, this.createOnSuccessHandler = function (_ref5) {
3897
3900
  var e = _ref5.loginRedirectUrl,
3898
3901
  t = _ref5.signupRedirectUrl,
3899
3902
  r = _ref5.onSuccess;
3900
3903
  return function (n) {
3901
- return jt(_this6, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
3904
+ return Lt(_this6, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
3902
3905
  var i, _yield$this$submitGoo, s;
3903
3906
  return _regeneratorRuntime().wrap(function _callee7$(_context7) {
3904
3907
  while (1) switch (_context7.prev = _context7.next) {
@@ -3925,10 +3928,10 @@ var Kt = /*#__PURE__*/function () {
3925
3928
  window.location.href = e;
3926
3929
  };
3927
3930
  }
3928
- _createClass(Kt, [{
3931
+ _createClass(qt, [{
3929
3932
  key: "createOneTapClient",
3930
3933
  value: function createOneTapClient() {
3931
- return jt(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
3934
+ return Lt(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
3932
3935
  var e, _yield$this$fetchGoog;
3933
3936
  return _regeneratorRuntime().wrap(function _callee8$(_context8) {
3934
3937
  while (1) switch (_context8.prev = _context8.next) {
@@ -3959,9 +3962,9 @@ var Kt = /*#__PURE__*/function () {
3959
3962
  });
3960
3963
  case 12:
3961
3964
  _context8.t1 = !0;
3962
- _context8.t2 = Ut;
3965
+ _context8.t2 = Kt;
3963
3966
  _context8.next = 16;
3964
- return Me(Ce, function () {
3967
+ return Ne(Te, function () {
3965
3968
  return window.google.accounts.id;
3966
3969
  });
3967
3970
  case 16:
@@ -3993,7 +3996,7 @@ var Kt = /*#__PURE__*/function () {
3993
3996
  var e = _ref6.credential,
3994
3997
  t = _ref6.loginRedirectUrl,
3995
3998
  r = _ref6.signupRedirectUrl;
3996
- return jt(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
3999
+ return Lt(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
3997
4000
  var _yield$this$fetchGoog2, n;
3998
4001
  return _regeneratorRuntime().wrap(function _callee9$(_context9) {
3999
4002
  while (1) switch (_context9.prev = _context9.next) {
@@ -4030,21 +4033,21 @@ var Kt = /*#__PURE__*/function () {
4030
4033
  }, {
4031
4034
  key: "WillGoogleOneTapShowEmbedded",
4032
4035
  value: function WillGoogleOneTapShowEmbedded() {
4033
- return !Kt.WillGoogleOneTapShowBannerForUA(navigator.userAgent);
4036
+ return !qt.WillGoogleOneTapShowBannerForUA(navigator.userAgent);
4034
4037
  }
4035
4038
  }]);
4036
- return Kt;
4039
+ return qt;
4037
4040
  }();
4038
- function qt(e) {
4041
+ function Wt(e) {
4039
4042
  var t = e.toString(16);
4040
4043
  return 1 === t.length && (t = "0" + t), t;
4041
4044
  }
4042
- var Wt = /*#__PURE__*/function () {
4043
- function Wt(e, t) {
4044
- _classCallCheck(this, Wt);
4045
+ var Ht = /*#__PURE__*/function () {
4046
+ function Ht(e, t) {
4047
+ _classCallCheck(this, Ht);
4045
4048
  this._dataLayer = e, this.namespace = t;
4046
4049
  }
4047
- _createClass(Wt, [{
4050
+ _createClass(Ht, [{
4048
4051
  key: "key",
4049
4052
  value: function key() {
4050
4053
  return "PKCE_VERIFIER:" + this.namespace;
@@ -4052,13 +4055,13 @@ var Wt = /*#__PURE__*/function () {
4052
4055
  }, {
4053
4056
  key: "startPKCETransaction",
4054
4057
  value: function startPKCETransaction() {
4055
- return jt(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
4058
+ return Lt(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
4056
4059
  var e;
4057
4060
  return _regeneratorRuntime().wrap(function _callee10$(_context10) {
4058
4061
  while (1) switch (_context10.prev = _context10.next) {
4059
4062
  case 0:
4060
4063
  _context10.next = 2;
4061
- return Wt.createProofkeyPair();
4064
+ return Ht.createProofkeyPair();
4062
4065
  case 2:
4063
4066
  e = _context10.sent;
4064
4067
  return _context10.abrupt("return", (this._dataLayer.setItem(this.key(), JSON.stringify(e)), e));
@@ -4076,7 +4079,7 @@ var Wt = /*#__PURE__*/function () {
4076
4079
  if (null !== e) try {
4077
4080
  return JSON.parse(e);
4078
4081
  } catch (e) {
4079
- return void We("Found malformed Proof Key pair in localstorage.");
4082
+ return void He("Found malformed Proof Key pair in localstorage.");
4080
4083
  }
4081
4084
  }
4082
4085
  }, {
@@ -4087,7 +4090,7 @@ var Wt = /*#__PURE__*/function () {
4087
4090
  }], [{
4088
4091
  key: "createProofkeyPair",
4089
4092
  value: function createProofkeyPair() {
4090
- return jt(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
4093
+ return Lt(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
4091
4094
  var _String$fromCharCode;
4092
4095
  var e, t, r, n;
4093
4096
  return _regeneratorRuntime().wrap(function _callee11$(_context11) {
@@ -4095,7 +4098,7 @@ var Wt = /*#__PURE__*/function () {
4095
4098
  case 0:
4096
4099
  e = new Uint32Array(16);
4097
4100
  window.crypto.getRandomValues(e);
4098
- t = Array.from(e).map(qt).join("");
4101
+ t = Array.from(e).map(Wt).join("");
4099
4102
  _context11.next = 5;
4100
4103
  return window.crypto.subtle.digest("SHA-256", new TextEncoder().encode(t));
4101
4104
  case 5:
@@ -4112,7 +4115,7 @@ var Wt = /*#__PURE__*/function () {
4112
4115
  }));
4113
4116
  }
4114
4117
  }]);
4115
- return Wt;
4118
+ return Ht;
4116
4119
  }();
4117
4120
  var Gt = /*#__PURE__*/function () {
4118
4121
  function Gt(e) {
@@ -4159,7 +4162,7 @@ var Gt = /*#__PURE__*/function () {
4159
4162
  }]);
4160
4163
  return Gt;
4161
4164
  }();
4162
- var Ht = function Ht(e) {
4165
+ var zt = function zt(e) {
4163
4166
  return (document.cookie ? document.cookie.split("; ") : []).filter(function (t) {
4164
4167
  var _t$split = t.split("="),
4165
4168
  _t$split2 = _slicedToArray(_t$split, 1),
@@ -4168,7 +4171,7 @@ var Ht = function Ht(e) {
4168
4171
  }).length > 1;
4169
4172
  };
4170
4173
  /*! js-cookie v3.0.1 | MIT */
4171
- function zt(e) {
4174
+ function Vt(e) {
4172
4175
  for (var t = 1; t < arguments.length; t++) {
4173
4176
  var r = arguments[t];
4174
4177
  for (var n in r) e[n] = r[n];
@@ -4178,7 +4181,7 @@ function zt(e) {
4178
4181
  var Yt = function e(t, r) {
4179
4182
  function n(e, n, i) {
4180
4183
  if ("undefined" != typeof document) {
4181
- "number" == typeof (i = zt({}, r, i)).expires && (i.expires = new Date(Date.now() + 864e5 * i.expires)), i.expires && (i.expires = i.expires.toUTCString()), e = encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
4184
+ "number" == typeof (i = Vt({}, r, i)).expires && (i.expires = new Date(Date.now() + 864e5 * i.expires)), i.expires && (i.expires = i.expires.toUTCString()), e = encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
4182
4185
  var s = "";
4183
4186
  for (var o in i) i[o] && (s += "; " + o, !0 !== i[o] && (s += "=" + i[o].split(";")[0]));
4184
4187
  return document.cookie = e + "=" + t.write(n, e) + s;
@@ -4200,15 +4203,15 @@ var Yt = function e(t, r) {
4200
4203
  }
4201
4204
  },
4202
4205
  remove: function remove(e, t) {
4203
- n(e, "", zt({}, t, {
4206
+ n(e, "", Vt({}, t, {
4204
4207
  expires: -1
4205
4208
  }));
4206
4209
  },
4207
4210
  withAttributes: function withAttributes(t) {
4208
- return e(this.converter, zt({}, this.attributes, t));
4211
+ return e(this.converter, Vt({}, this.attributes, t));
4209
4212
  },
4210
4213
  withConverter: function withConverter(t) {
4211
- return e(zt({}, this.converter, t), this.attributes);
4214
+ return e(Vt({}, this.converter, t), this.attributes);
4212
4215
  }
4213
4216
  }, {
4214
4217
  attributes: {
@@ -4228,37 +4231,37 @@ var Yt = function e(t, r) {
4228
4231
  }, {
4229
4232
  path: "/"
4230
4233
  });
4231
- var Vt = function Vt(e) {
4234
+ var Jt = function Jt(e) {
4232
4235
  var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
4233
4236
  return "stytch_sdk_state_".concat(e).concat(t ? "::".concat(t) : "");
4234
4237
  },
4235
- Jt = new Map(),
4236
- $t = function $t(e) {
4237
- clearTimeout(Jt.get(e));
4238
+ $t = new Map(),
4239
+ Xt = function Xt(e) {
4240
+ clearTimeout($t.get(e));
4238
4241
  },
4239
- Xt = function Xt(e, t, r) {
4240
- $t(e);
4242
+ Zt = function Zt(e, t, r) {
4243
+ Xt(e);
4241
4244
  var n = setTimeout(function () {
4242
4245
  void 0 === Yt.get(e) && Yt.set(e, t, r);
4243
4246
  }, 10);
4244
- return Jt.set(e, n), Yt.set(e, t, r);
4247
+ return $t.set(e, n), Yt.set(e, t, r);
4245
4248
  };
4246
- var Zt = /*#__PURE__*/function () {
4247
- function Zt(e, t) {
4249
+ var Qt = /*#__PURE__*/function () {
4250
+ function Qt(e, t) {
4248
4251
  var _this7 = this;
4249
- _classCallCheck(this, Zt);
4252
+ _classCallCheck(this, Qt);
4250
4253
  this.browserSessionStorage = {
4251
4254
  getItem: function getItem(e) {
4252
- return sessionStorage.getItem(Vt(_this7.publicToken, e));
4255
+ return sessionStorage.getItem(Jt(_this7.publicToken, e));
4253
4256
  },
4254
4257
  setItem: function setItem(e, t) {
4255
- return sessionStorage.setItem(Vt(_this7.publicToken, e), t);
4258
+ return sessionStorage.setItem(Jt(_this7.publicToken, e), t);
4256
4259
  },
4257
4260
  removeItem: function removeItem(e) {
4258
- return sessionStorage.removeItem(Vt(_this7.publicToken, e));
4261
+ return sessionStorage.removeItem(Jt(_this7.publicToken, e));
4259
4262
  }
4260
- }, this.publicToken = e, this.state = null, this.stateKeysUpdated = new Set(), this.subscriptions = {}, (null == t ? void 0 : t.cookieOptions) ? (ze("SubscriptionDataLayer").isOptionalString("cookieOptions.opaqueTokenCookieName", t.cookieOptions.opaqueTokenCookieName).isOptionalString("cookieOptions.jwtCookieName", t.cookieOptions.jwtCookieName).isOptionalString("cookieOptions.istCookieName", t.cookieOptions.istCookieName).isOptionalString("cookieOptions.path", t.cookieOptions.path).isOptionalString("cookieOptions.domain", t.cookieOptions.domain), this._jwtCookieName = t.cookieOptions.jwtCookieName || null, this._opaqueTokenCookieName = t.cookieOptions.opaqueTokenCookieName || null, this._cookiePath = t.cookieOptions.path || null, this._domain = t.cookieOptions.domain || null, this._cookieAvailableToSubdomains = t.cookieOptions.availableToSubdomains || !1, this._istCookieName = t.cookieOptions.istCookieName || null) : (this._opaqueTokenCookieName = null, this._jwtCookieName = null, this._cookiePath = null, this._domain = null, this._cookieAvailableToSubdomains = !1, this._istCookieName = null);
4261
- var r = localStorage.getItem(Vt(this.publicToken));
4263
+ }, this.publicToken = e, this.state = null, this.stateKeysUpdated = new Set(), this.subscriptions = {}, (null == t ? void 0 : t.cookieOptions) ? (Ve("SubscriptionDataLayer").isOptionalString("cookieOptions.opaqueTokenCookieName", t.cookieOptions.opaqueTokenCookieName).isOptionalString("cookieOptions.jwtCookieName", t.cookieOptions.jwtCookieName).isOptionalString("cookieOptions.istCookieName", t.cookieOptions.istCookieName).isOptionalString("cookieOptions.path", t.cookieOptions.path).isOptionalString("cookieOptions.domain", t.cookieOptions.domain), this._jwtCookieName = t.cookieOptions.jwtCookieName || null, this._opaqueTokenCookieName = t.cookieOptions.opaqueTokenCookieName || null, this._cookiePath = t.cookieOptions.path || null, this._domain = t.cookieOptions.domain || null, this._cookieAvailableToSubdomains = t.cookieOptions.availableToSubdomains || !1, this._istCookieName = t.cookieOptions.istCookieName || null) : (this._opaqueTokenCookieName = null, this._jwtCookieName = null, this._cookiePath = null, this._domain = null, this._cookieAvailableToSubdomains = !1, this._istCookieName = null);
4264
+ var r = localStorage.getItem(Jt(this.publicToken));
4262
4265
  if (!r) return;
4263
4266
  var n;
4264
4267
  try {
@@ -4268,7 +4271,7 @@ var Zt = /*#__PURE__*/function () {
4268
4271
  }
4269
4272
  this.state = n;
4270
4273
  }
4271
- _createClass(Zt, [{
4274
+ _createClass(Qt, [{
4272
4275
  key: "opaqueTokenCookieName",
4273
4276
  get: function get() {
4274
4277
  var e;
@@ -4306,32 +4309,32 @@ var Zt = /*#__PURE__*/function () {
4306
4309
  var s = e.state,
4307
4310
  o = e.session_token,
4308
4311
  a = e.session_jwt,
4309
- c = Zt.generateCookieOpts({
4312
+ c = Qt.generateCookieOpts({
4310
4313
  expiresAt: null !== (r = null === (t = null == s ? void 0 : s.session) || void 0 === t ? void 0 : t.expires_at) && void 0 !== r ? r : "",
4311
4314
  availableToSubdomains: this._cookieAvailableToSubdomains,
4312
4315
  path: this._cookiePath,
4313
4316
  domain: this._domain
4314
4317
  });
4315
- Xt(this.opaqueTokenCookieName, o, c), Xt(this.jwtCookieName, a, c);
4316
- var u = Zt.generateCookieOpts({
4318
+ Zt(this.opaqueTokenCookieName, o, c), Zt(this.jwtCookieName, a, c);
4319
+ var u = Qt.generateCookieOpts({
4317
4320
  expiresAt: null !== (i = null === (n = null == s ? void 0 : s.session) || void 0 === n ? void 0 : n.expires_at) && void 0 !== i ? i : "",
4318
4321
  availableToSubdomains: !this._cookieAvailableToSubdomains,
4319
4322
  path: this._cookiePath,
4320
4323
  domain: this._domain
4321
4324
  });
4322
- Ht(this.jwtCookieName) && Yt.remove(this.jwtCookieName, u), Ht(this.opaqueTokenCookieName) && Yt.remove(this.opaqueTokenCookieName, u), Ht(this.jwtCookieName) && We("Could not remove extraneous JWT cookie. This might happen if the cookie has been set using multiple `path` settings, and may produce unwanted behavior."), Ht(this.opaqueTokenCookieName) && We("Could not remove extraneous opaque token cookie.");
4325
+ zt(this.jwtCookieName) && Yt.remove(this.jwtCookieName, u), zt(this.opaqueTokenCookieName) && Yt.remove(this.opaqueTokenCookieName, u), zt(this.jwtCookieName) && He("Could not remove extraneous JWT cookie. This might happen if the cookie has been set using multiple `path` settings, and may produce unwanted behavior."), zt(this.opaqueTokenCookieName) && He("Could not remove extraneous opaque token cookie.");
4323
4326
  }
4324
4327
  }, {
4325
4328
  key: "writeIntermediateSessionTokenCookie",
4326
4329
  value: function writeIntermediateSessionTokenCookie(e) {
4327
4330
  var t = new Date(Date.now() + 6e5),
4328
- r = Zt.generateCookieOpts({
4331
+ r = Qt.generateCookieOpts({
4329
4332
  expiresAt: t.toString(),
4330
4333
  availableToSubdomains: this._cookieAvailableToSubdomains,
4331
4334
  path: this._cookiePath,
4332
4335
  domain: this._domain
4333
4336
  });
4334
- Xt(this.istCookieName, e, r);
4337
+ Zt(this.istCookieName, e, r);
4335
4338
  }
4336
4339
  }, {
4337
4340
  key: "removeSessionCookie",
@@ -4350,7 +4353,7 @@ var Zt = /*#__PURE__*/function () {
4350
4353
  [!0, !1].forEach(function (t) {
4351
4354
  [_this8._cookiePath, null].forEach(function (r) {
4352
4355
  [_this8._domain, null].forEach(function (n) {
4353
- var i = Zt.generateCookieOpts({
4356
+ var i = Qt.generateCookieOpts({
4354
4357
  expiresAt: new Date(0).toString(),
4355
4358
  availableToSubdomains: t,
4356
4359
  path: r,
@@ -4361,27 +4364,27 @@ var Zt = /*#__PURE__*/function () {
4361
4364
  });
4362
4365
  });
4363
4366
  });
4364
- }), e.forEach($t);
4367
+ }), e.forEach(Xt);
4365
4368
  }
4366
4369
  }, {
4367
4370
  key: "syncToLocalStorage",
4368
4371
  value: function syncToLocalStorage() {
4369
- localStorage.setItem(Vt(this.publicToken), JSON.stringify(this.state));
4372
+ localStorage.setItem(Jt(this.publicToken), JSON.stringify(this.state));
4370
4373
  }
4371
4374
  }, {
4372
4375
  key: "getItem",
4373
4376
  value: function getItem(e) {
4374
- return localStorage.getItem(Vt(this.publicToken, e));
4377
+ return localStorage.getItem(Jt(this.publicToken, e));
4375
4378
  }
4376
4379
  }, {
4377
4380
  key: "setItem",
4378
4381
  value: function setItem(e, t) {
4379
- return localStorage.setItem(Vt(this.publicToken, e), t);
4382
+ return localStorage.setItem(Jt(this.publicToken, e), t);
4380
4383
  }
4381
4384
  }, {
4382
4385
  key: "removeItem",
4383
4386
  value: function removeItem(e) {
4384
- return localStorage.removeItem(Vt(this.publicToken, e));
4387
+ return localStorage.removeItem(Jt(this.publicToken, e));
4385
4388
  }
4386
4389
  }, {
4387
4390
  key: "markStateKeysUpdated",
@@ -4406,40 +4409,40 @@ var Zt = /*#__PURE__*/function () {
4406
4409
  return e && (i.path = e), Boolean("localhost" === window.location.hostname || "[::1]" === window.location.hostname || window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/)) ? i.secure = !1 : (r && (i.domain = t || window.location.host), i.secure = !0), i;
4407
4410
  }
4408
4411
  }]);
4409
- return Zt;
4412
+ return Qt;
4410
4413
  }();
4411
- var Qt = /*#__PURE__*/function (_Zt) {
4412
- _inherits(Qt, _Zt);
4413
- function Qt() {
4414
- _classCallCheck(this, Qt);
4415
- return _callSuper(this, Qt, arguments);
4414
+ var er = /*#__PURE__*/function (_Qt) {
4415
+ _inherits(er, _Qt);
4416
+ function er() {
4417
+ _classCallCheck(this, er);
4418
+ return _callSuper(this, er, arguments);
4416
4419
  }
4417
- return _createClass(Qt);
4418
- }(Zt);
4419
- var er = Symbol["for"]("__stytch_DataLayer"),
4420
- tr = function tr(e, t) {
4420
+ return _createClass(er);
4421
+ }(Qt);
4422
+ var tr = Symbol["for"]("__stytch_DataLayer"),
4423
+ rr = function rr(e, t) {
4421
4424
  var r = function () {
4422
4425
  var e = window;
4423
- return e[er] || (e[er] = {}), e[er];
4426
+ return e[tr] || (e[tr] = {}), e[tr];
4424
4427
  }();
4425
- return r[e] || (r[e] = new Qt(e, t)), r[e];
4428
+ return r[e] || (r[e] = new er(e, t)), r[e];
4426
4429
  },
4427
- rr = function rr(e, t) {
4430
+ nr = function nr(e, t) {
4428
4431
  Object.values(e).forEach(function (e) {
4429
4432
  return e(t);
4430
4433
  });
4431
4434
  },
4432
- nr = function () {
4435
+ ir = function () {
4433
4436
  var e = (arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}).KEYS_TO_EXCLUDE,
4434
4437
  t = void 0 === e ? [] : e;
4435
4438
  return function e(r, n) {
4436
- return de(r) === de(n) && (null === r || null === n ? r === n : "object" === de(r) ? Object.keys(r).length === Object.keys(n).length && !Object.keys(r).some(function (e) {
4439
+ return he(r) === he(n) && (null === r || null === n ? r === n : "object" === he(r) ? Object.keys(r).length === Object.keys(n).length && !Object.keys(r).some(function (e) {
4437
4440
  return !(e in n);
4438
4441
  }) && Object.entries(r).filter(function (e) {
4439
- var r = ce(e, 1)[0];
4442
+ var r = ue(e, 1)[0];
4440
4443
  return !t.includes(r);
4441
4444
  }).every(function (t) {
4442
- var r = ce(t, 2),
4445
+ var r = ue(t, 2),
4443
4446
  i = r[0],
4444
4447
  s = r[1];
4445
4448
  return e(s, n[i]);
@@ -4448,12 +4451,12 @@ var er = Symbol["for"]("__stytch_DataLayer"),
4448
4451
  }({
4449
4452
  KEYS_TO_EXCLUDE: ["last_accessed_at"]
4450
4453
  });
4451
- var ir = /*#__PURE__*/function () {
4452
- function ir(e, t) {
4454
+ var sr = /*#__PURE__*/function () {
4455
+ function sr(e, t) {
4453
4456
  var _this10 = this;
4454
- _classCallCheck(this, ir);
4457
+ _classCallCheck(this, sr);
4455
4458
  this._publicToken = e, this._datalayer = t, this._listen = function (e) {
4456
- if (e.key !== Vt(_this10._publicToken)) return;
4459
+ if (e.key !== Jt(_this10._publicToken)) return;
4457
4460
  var t = null === e.newValue || "null" === e.newValue ? null : JSON.parse(e.newValue);
4458
4461
  _this10.updateState(t);
4459
4462
  }, window.addEventListener("storage", this._listen);
@@ -4461,7 +4464,7 @@ var ir = /*#__PURE__*/function () {
4461
4464
  r = _this$_datalayer$read.session_token;
4462
4465
  r || this.destroySession();
4463
4466
  }
4464
- _createClass(ir, [{
4467
+ _createClass(sr, [{
4465
4468
  key: "getTokens",
4466
4469
  value: function getTokens() {
4467
4470
  var _this$_datalayer$read2 = this._datalayer.readSessionCookie(),
@@ -4499,7 +4502,7 @@ var ir = /*#__PURE__*/function () {
4499
4502
  r = null === e.state ? null : Object.assign(Object.assign({}, this._datalayer.state), e.state);
4500
4503
  this._datalayer.state = r;
4501
4504
  var n = e.state ? Object.keys(e.state) : [];
4502
- !this._datalayer.markStateKeysUpdated(n) && nr(t, r) || rr(this._datalayer.subscriptions, r);
4505
+ !this._datalayer.markStateKeysUpdated(n) && ir(t, r) || nr(this._datalayer.subscriptions, r);
4503
4506
  }
4504
4507
  }, {
4505
4508
  key: "updateStateAndTokens",
@@ -4514,8 +4517,8 @@ var ir = /*#__PURE__*/function () {
4514
4517
  this._datalayer.state = r;
4515
4518
  var n = e ? Object.keys(e) : [],
4516
4519
  i = this._datalayer.markStateKeysUpdated(n),
4517
- s = !nr(t, r);
4518
- (i || s) && (rr(this._datalayer.subscriptions, r), s && this._datalayer.syncToLocalStorage());
4520
+ s = !ir(t, r);
4521
+ (i || s) && (nr(this._datalayer.subscriptions, r), s && this._datalayer.syncToLocalStorage());
4519
4522
  }
4520
4523
  }, {
4521
4524
  key: "updateTokens",
@@ -4555,14 +4558,14 @@ var ir = /*#__PURE__*/function () {
4555
4558
  return null;
4556
4559
  }
4557
4560
  }]);
4558
- return ir;
4561
+ return sr;
4559
4562
  }();
4560
- var sr = /*#__PURE__*/function (_ir) {
4561
- _inherits(sr, _ir);
4562
- function sr() {
4563
+ var or = /*#__PURE__*/function (_sr) {
4564
+ _inherits(or, _sr);
4565
+ function or() {
4563
4566
  var _this11;
4564
- _classCallCheck(this, sr);
4565
- _this11 = _callSuper(this, sr, arguments), _this11.updateUser = function (e) {
4567
+ _classCallCheck(this, or);
4568
+ _this11 = _callSuper(this, or, arguments), _this11.updateUser = function (e) {
4566
4569
  return _this11.updateState({
4567
4570
  user: e
4568
4571
  });
@@ -4575,17 +4578,17 @@ var sr = /*#__PURE__*/function (_ir) {
4575
4578
  };
4576
4579
  return _this11;
4577
4580
  }
4578
- return _createClass(sr);
4579
- }(ir);
4580
- var or = Symbol["for"]("stytch__internal_b2c");
4581
- var ar = /*#__PURE__*/_createClass(function ar(e, t) {
4581
+ return _createClass(or);
4582
+ }(sr);
4583
+ var ar = Symbol["for"]("stytch__internal_b2c");
4584
+ var cr = /*#__PURE__*/_createClass(function cr(e, t) {
4582
4585
  var _this12 = this;
4583
- _classCallCheck(this, ar);
4586
+ _classCallCheck(this, cr);
4584
4587
  var r;
4585
4588
  !function (e) {
4586
4589
  var t = "StytchUIClient" === e ? "import { createStytchUIClient } from '@stytch/nextjs/ui';\n \nconst stytch = createStytchUIClient('public-token-...');\n" : "import { createStytchHeadlessClient } from '@stytch/nextjs/ui';\n \nconst stytch = createStytchHeadlessClient('public-token-...');\n";
4587
4590
  if ("undefined" == typeof window) throw new Error("The ".concat(e, " is not compatible with server-side environments.\nIf using nextjs, use the create").concat(e, " method instead.\n```\n").concat(t, "\n```\n"));
4588
- }("StytchHeadlessClient"), "string" != typeof (r = e) ? We("Public token is malformed. Expected a string, got ".concat(de(r), ".").concat(He)) : "" === r ? We('Public token is malformed. Expected "public-token-...", got an empty string.'.concat(He)) : r.startsWith("public-token-") || We('Public token is malformed. Expected "public-token-...", got '.concat(r, ".").concat(He));
4591
+ }("StytchHeadlessClient"), "string" != typeof (r = e) ? He("Public token is malformed. Expected a string, got ".concat(he(r), ".").concat(ze)) : "" === r ? He('Public token is malformed. Expected "public-token-...", got an empty string.'.concat(ze)) : r.startsWith("public-token-") || He('Public token is malformed. Expected "public-token-...", got '.concat(r, ".").concat(ze));
4589
4592
  var n = t,
4590
4593
  i = {
4591
4594
  cookieOptions: null == (s = n) ? void 0 : s.cookieOptions,
@@ -4598,27 +4601,27 @@ var ar = /*#__PURE__*/_createClass(function ar(e, t) {
4598
4601
  }
4599
4602
  };
4600
4603
  var s, o, a, c, u, l, d, h, p, f, _;
4601
- this._dataLayer = tr(e, n), this._subscriptionService = new sr(e, this._dataLayer);
4602
- var m = new Wt(this._dataLayer, "passwords");
4603
- this._networkClient = new Nt(e, this._dataLayer, i.endpoints.sdkBackendURL, function () {
4604
+ this._dataLayer = rr(e, n), this._subscriptionService = new or(e, this._dataLayer);
4605
+ var m = new Ht(this._dataLayer, "passwords");
4606
+ this._networkClient = new Ut(e, this._dataLayer, i.endpoints.sdkBackendURL, function () {
4604
4607
  var e, t, r, n;
4605
4608
  return {
4606
4609
  stytch_user_id: null === (t = null === (e = _this12._dataLayer.state) || void 0 === e ? void 0 : e.user) || void 0 === t ? void 0 : t.user_id,
4607
4610
  stytch_session_id: null === (n = null === (r = _this12._dataLayer.state) || void 0 === r ? void 0 : r.session) || void 0 === n ? void 0 : n.session_id
4608
4611
  };
4609
4612
  });
4610
- var v = new Ft(e, this._networkClient, this._dataLayer),
4611
- y = new Lt(v.getAsync()),
4612
- g = new Je(e, i.endpoints.dfpBackendURL, v.getAsync(), y.executeRecaptcha),
4613
- b = new Bt(i.endpoints.clientsideServicesIframeURL),
4614
- k = new Kt(e, b),
4613
+ var v = new jt(e, this._networkClient, this._dataLayer),
4614
+ y = new Bt(v.getAsync()),
4615
+ g = new $e(e, i.endpoints.dfpBackendURL, v.getAsync(), y.executeRecaptcha),
4616
+ b = new Mt(i.endpoints.clientsideServicesIframeURL),
4617
+ k = new qt(e, b),
4615
4618
  w = new Gt(this._networkClient);
4616
4619
  var S, C;
4617
- this.user = new Qe(this._networkClient, this._subscriptionService), this.session = new et(this._networkClient, this._subscriptionService), this.magicLinks = new rt(this._networkClient, this._subscriptionService, new Wt(this._dataLayer, "magic_links"), m, v.getAsync(), g), this.otps = new nt(this._networkClient, this._subscriptionService, y.executeRecaptcha, g), this.oauth = new Mt(this._networkClient, this._subscriptionService, new Wt(this._dataLayer, "oauth"), v.getAsync(), {
4620
+ this.user = new et(this._networkClient, this._subscriptionService), this.session = new tt(this._networkClient, this._subscriptionService), this.magicLinks = new nt(this._networkClient, this._subscriptionService, new Ht(this._dataLayer, "magic_links"), m, v.getAsync(), g), this.otps = new it(this._networkClient, this._subscriptionService, y.executeRecaptcha, g), this.oauth = new Nt(this._networkClient, this._subscriptionService, new Ht(this._dataLayer, "oauth"), v.getAsync(), {
4618
4621
  publicToken: e,
4619
4622
  testAPIURL: i.endpoints.testAPIURL,
4620
4623
  liveAPIURL: i.endpoints.liveAPIURL
4621
- }, k), this.cryptoWallets = new st(this._networkClient, this._subscriptionService, y.executeRecaptcha, g), this.totps = new ot(this._networkClient, this._subscriptionService, g), this.webauthn = new At(this._networkClient, this._subscriptionService, g), this.passwords = new Et(this._networkClient, this._subscriptionService, m, v.getAsync(), g), this._sessionManager = new Rt(this._subscriptionService, this.session), this._dataLayer.readSessionCookie().session_token && this._sessionManager.performBackgroundRefresh(), this._networkClient.logEvent({
4624
+ }, k), this.cryptoWallets = new ot(this._networkClient, this._subscriptionService, y.executeRecaptcha, g), this.totps = new at(this._networkClient, this._subscriptionService, g), this.webauthn = new xt(this._networkClient, this._subscriptionService, g), this.passwords = new Dt(this._networkClient, this._subscriptionService, m, v.getAsync(), g), this._sessionManager = new It(this._subscriptionService, this.session), this._dataLayer.readSessionCookie().session_token && this._sessionManager.performBackgroundRefresh(), this._networkClient.logEvent({
4622
4625
  name: "sdk_instance_instantiated",
4623
4626
  details: {
4624
4627
  event_callback_registered: !1,
@@ -4634,6 +4637,6 @@ var ar = /*#__PURE__*/_createClass(function ar(e, t) {
4634
4637
  publicToken: e,
4635
4638
  dataLayer: this._dataLayer,
4636
4639
  networkClient: this._networkClient
4637
- }, Object.assign(S, _defineProperty({}, or, C));
4640
+ }, Object.assign(S, _defineProperty({}, ar, C));
4638
4641
  });
4639
- export { g as AuthFlowType, b as B2BOAuthProviders, y as B2BProducts, X as BiometricsFailedError, F as BiometricsUnavailableError, z as ChallengeSigningFailedError, U as DeviceCredentialsNotAllowedError, V as FailedCodeChallengeError, $ as FailedToDecryptDataError, R as InternalError, G as InvalidAuthorizationCredentialError, te as InvalidCredentialTypeError, Q as InvalidRedirectSchemeError, Z as InvalidStartUrlError, ne as JSONDataNotConvertibleToStringError, j as KeyInvalidatedError, L as KeystoreUnavailableError, re as MissingAttestationObjectError, W as MissingAuthorizationCredentialIDTokenError, K as MissingGoogleClientIDError, q as MissingPKCEError, H as MissingPublicKeyError, ee as MissingUrlError, B as NoBiometricsEnrolledError, I as NoBiometricsRegistrationError, D as NoCurrentSessionError, p as OAuthProviders, m as OTPMethods, _ as OneTapPositions, se as PasskeysInvalidEncoding, J as PasskeysUnsupportedError, h as Products, ie as RandomNumberGenerationFailed, k as SDKAPIUnreachableError, Y as SDKNotConfiguredError, x as StytchAPIError, A as StytchAPISchemaError, P as StytchAPIUnreachableError, O as StytchError, v as StytchEventType, ar as StytchHeadlessClient, C as StytchSDKAPIError, E as StytchSDKError, S as StytchSDKSchemaError, w as StytchSDKUsageError, T as UNRECOVERABLE_ERROR_TYPES, M as UserCancellationError, N as UserLockedOutError, f as Wallets, oe as errorToStytchError };
4642
+ export { g as AuthFlowType, b as B2BMFAProducts, k as B2BOAuthProviders, y as B2BProducts, Z as BiometricsFailedError, j as BiometricsUnavailableError, V as ChallengeSigningFailedError, K as DeviceCredentialsNotAllowedError, J as FailedCodeChallengeError, X as FailedToDecryptDataError, I as InternalError, G as InvalidAuthorizationCredentialError, re as InvalidCredentialTypeError, ee as InvalidRedirectSchemeError, Q as InvalidStartUrlError, ie as JSONDataNotConvertibleToStringError, L as KeyInvalidatedError, B as KeystoreUnavailableError, ne as MissingAttestationObjectError, H as MissingAuthorizationCredentialIDTokenError, q as MissingGoogleClientIDError, W as MissingPKCEError, z as MissingPublicKeyError, te as MissingUrlError, M as NoBiometricsEnrolledError, F as NoBiometricsRegistrationError, R as NoCurrentSessionError, p as OAuthProviders, m as OTPMethods, _ as OneTapPositions, oe as PasskeysInvalidEncoding, $ as PasskeysUnsupportedError, h as Products, se as RandomNumberGenerationFailed, w as SDKAPIUnreachableError, Y as SDKNotConfiguredError, E as StytchAPIError, x as StytchAPISchemaError, A as StytchAPIUnreachableError, P as StytchError, v as StytchEventType, cr as StytchHeadlessClient, T as StytchSDKAPIError, D as StytchSDKError, C as StytchSDKSchemaError, S as StytchSDKUsageError, O as UNRECOVERABLE_ERROR_TYPES, N as UserCancellationError, U as UserLockedOutError, f as Wallets, ae as errorToStytchError };