@stytch/vanilla-js 2.0.2 → 2.0.3

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.
@@ -29,9 +29,9 @@ function e(e, t) {
29
29
  if (Array.isArray(e) || (_n = r(e)) || t && e && "number" == typeof e.length) {
30
30
  _n && (e = _n);
31
31
  var i = 0,
32
- o = function o() {};
32
+ s = function s() {};
33
33
  return {
34
- s: o,
34
+ s: s,
35
35
  n: function n() {
36
36
  return i >= e.length ? {
37
37
  done: !0
@@ -43,12 +43,12 @@ function e(e, t) {
43
43
  e: function e(_e2) {
44
44
  throw _e2;
45
45
  },
46
- f: o
46
+ f: s
47
47
  };
48
48
  }
49
49
  throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
50
50
  }
51
- var s,
51
+ var o,
52
52
  a = !0,
53
53
  c = !1;
54
54
  return {
@@ -60,13 +60,13 @@ function e(e, t) {
60
60
  return a = e.done, e;
61
61
  },
62
62
  e: function e(_e3) {
63
- c = !0, s = _e3;
63
+ c = !0, o = _e3;
64
64
  },
65
65
  f: function f() {
66
66
  try {
67
67
  a || null == _n["return"] || _n["return"]();
68
68
  } finally {
69
- if (c) throw s;
69
+ if (c) throw o;
70
70
  }
71
71
  }
72
72
  };
@@ -79,21 +79,21 @@ function t(e, t) {
79
79
  if (null != r) {
80
80
  var n,
81
81
  i,
82
- o,
83
82
  s,
83
+ o,
84
84
  a = [],
85
85
  c = !0,
86
86
  u = !1;
87
87
  try {
88
- if (o = (r = r.call(e)).next, 0 === t) {
88
+ if (s = (r = r.call(e)).next, 0 === t) {
89
89
  if (Object(r) !== r) return;
90
90
  c = !1;
91
- } else for (; !(c = (n = o.call(r)).done) && (a.push(n.value), a.length !== t); c = !0);
91
+ } else for (; !(c = (n = s.call(r)).done) && (a.push(n.value), a.length !== t); c = !0);
92
92
  } catch (e) {
93
93
  u = !0, i = e;
94
94
  } finally {
95
95
  try {
96
- if (!c && null != r["return"] && (s = r["return"](), Object(s) !== s)) return;
96
+ if (!c && null != r["return"] && (o = r["return"](), Object(o) !== o)) return;
97
97
  } finally {
98
98
  if (u) throw i;
99
99
  }
@@ -123,9 +123,9 @@ function i(e) {
123
123
  return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : _typeof(e);
124
124
  }, i(e);
125
125
  }
126
- function o() {
126
+ function s() {
127
127
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
128
- o = function o() {
128
+ s = function s() {
129
129
  return e;
130
130
  };
131
131
  var e = {},
@@ -134,10 +134,10 @@ function o() {
134
134
  n = Object.defineProperty || function (e, t, r) {
135
135
  e[t] = r.value;
136
136
  },
137
- s = "function" == typeof Symbol ? Symbol : {},
138
- a = s.iterator || "@@iterator",
139
- c = s.asyncIterator || "@@asyncIterator",
140
- u = s.toStringTag || "@@toStringTag";
137
+ o = "function" == typeof Symbol ? Symbol : {},
138
+ a = o.iterator || "@@iterator",
139
+ c = o.asyncIterator || "@@asyncIterator",
140
+ u = o.toStringTag || "@@toStringTag";
141
141
  function l(e, t, r) {
142
142
  return Object.defineProperty(e, t, {
143
143
  value: r,
@@ -154,12 +154,12 @@ function o() {
154
154
  };
155
155
  }
156
156
  function d(e, t, r, i) {
157
- var o = t && t.prototype instanceof f ? t : f,
158
- s = Object.create(o.prototype),
159
- a = new C(i || []);
160
- return n(s, "_invoke", {
157
+ var s = t && t.prototype instanceof f ? t : f,
158
+ o = Object.create(s.prototype),
159
+ a = new E(i || []);
160
+ return n(o, "_invoke", {
161
161
  value: S(e, r, a)
162
- }), s;
162
+ }), o;
163
163
  }
164
164
  function h(e, t, r) {
165
165
  try {
@@ -178,64 +178,64 @@ function o() {
178
178
  var p = {};
179
179
  function f() {}
180
180
  function _() {}
181
- function m() {}
182
- var v = {};
183
- l(v, a, function () {
181
+ function v() {}
182
+ var m = {};
183
+ l(m, a, function () {
184
184
  return this;
185
185
  });
186
- var g = Object.getPrototypeOf,
187
- y = g && g(g(A([])));
188
- y && y !== t && r.call(y, a) && (v = y);
189
- var b = m.prototype = f.prototype = Object.create(v);
190
- function w(e) {
186
+ var y = Object.getPrototypeOf,
187
+ g = y && y(y(x([])));
188
+ g && g !== t && r.call(g, a) && (m = g);
189
+ var b = v.prototype = f.prototype = Object.create(m);
190
+ function k(e) {
191
191
  ["next", "throw", "return"].forEach(function (t) {
192
192
  l(e, t, function (e) {
193
193
  return this._invoke(t, e);
194
194
  });
195
195
  });
196
196
  }
197
- function k(e, t) {
198
- function o(n, s, a, c) {
199
- var u = h(e[n], e, s);
197
+ function w(e, t) {
198
+ function s(n, o, a, c) {
199
+ var u = h(e[n], e, o);
200
200
  if ("throw" !== u.type) {
201
201
  var l = u.arg,
202
202
  d = l.value;
203
203
  return d && "object" == i(d) && r.call(d, "__await") ? t.resolve(d.__await).then(function (e) {
204
- o("next", e, a, c);
204
+ s("next", e, a, c);
205
205
  }, function (e) {
206
- o("throw", e, a, c);
206
+ s("throw", e, a, c);
207
207
  }) : t.resolve(d).then(function (e) {
208
208
  l.value = e, a(l);
209
209
  }, function (e) {
210
- return o("throw", e, a, c);
210
+ return s("throw", e, a, c);
211
211
  });
212
212
  }
213
213
  c(u.arg);
214
214
  }
215
- var s;
215
+ var o;
216
216
  n(this, "_invoke", {
217
217
  value: function value(e, r) {
218
218
  function n() {
219
219
  return new t(function (t, n) {
220
- o(e, r, t, n);
220
+ s(e, r, t, n);
221
221
  });
222
222
  }
223
- return s = s ? s.then(n, n) : n();
223
+ return o = o ? o.then(n, n) : n();
224
224
  }
225
225
  });
226
226
  }
227
227
  function S(e, t, r) {
228
228
  var n = "suspendedStart";
229
- return function (i, o) {
229
+ return function (i, s) {
230
230
  if ("executing" === n) throw new Error("Generator is already running");
231
231
  if ("completed" === n) {
232
- if ("throw" === i) throw o;
233
- return x();
232
+ if ("throw" === i) throw s;
233
+ return A();
234
234
  }
235
- for (r.method = i, r.arg = o;;) {
236
- var s = r.delegate;
237
- if (s) {
238
- var a = T(s, r);
235
+ for (r.method = i, r.arg = s;;) {
236
+ var o = r.delegate;
237
+ if (o) {
238
+ var a = T(o, r);
239
239
  if (a) {
240
240
  if (a === p) continue;
241
241
  return a;
@@ -264,8 +264,8 @@ function o() {
264
264
  if (void 0 === n) return t.delegate = null, "throw" === r && e.iterator["return"] && (t.method = "return", t.arg = void 0, T(e, t), "throw" === t.method) || "return" !== r && (t.method = "throw", t.arg = new TypeError("The iterator does not provide a '" + r + "' method")), p;
265
265
  var i = h(n, e.iterator, t.arg);
266
266
  if ("throw" === i.type) return t.method = "throw", t.arg = i.arg, t.delegate = null, p;
267
- var o = i.arg;
268
- return o ? o.done ? (t[e.resultName] = o.value, t.next = e.nextLoc, "return" !== t.method && (t.method = "next", t.arg = void 0), t.delegate = null, p) : o : (t.method = "throw", t.arg = new TypeError("iterator result is not an object"), t.delegate = null, p);
267
+ var s = i.arg;
268
+ return s ? s.done ? (t[e.resultName] = s.value, t.next = e.nextLoc, "return" !== t.method && (t.method = "next", t.arg = void 0), t.delegate = null, p) : s : (t.method = "throw", t.arg = new TypeError("iterator result is not an object"), t.delegate = null, p);
269
269
  }
270
270
  function O(e) {
271
271
  var t = {
@@ -273,16 +273,16 @@ function o() {
273
273
  };
274
274
  1 in e && (t.catchLoc = e[1]), 2 in e && (t.finallyLoc = e[2], t.afterLoc = e[3]), this.tryEntries.push(t);
275
275
  }
276
- function E(e) {
276
+ function C(e) {
277
277
  var t = e.completion || {};
278
278
  t.type = "normal", delete t.arg, e.completion = t;
279
279
  }
280
- function C(e) {
280
+ function E(e) {
281
281
  this.tryEntries = [{
282
282
  tryLoc: "root"
283
283
  }], e.forEach(O, this), this.reset(!0);
284
284
  }
285
- function A(e) {
285
+ function x(e) {
286
286
  if (e) {
287
287
  var t = e[a];
288
288
  if (t) return t.call(e);
@@ -297,39 +297,39 @@ function o() {
297
297
  }
298
298
  }
299
299
  return {
300
- next: x
300
+ next: A
301
301
  };
302
302
  }
303
- function x() {
303
+ function A() {
304
304
  return {
305
305
  value: void 0,
306
306
  done: !0
307
307
  };
308
308
  }
309
- return _.prototype = m, n(b, "constructor", {
310
- value: m,
309
+ return _.prototype = v, n(b, "constructor", {
310
+ value: v,
311
311
  configurable: !0
312
- }), n(m, "constructor", {
312
+ }), n(v, "constructor", {
313
313
  value: _,
314
314
  configurable: !0
315
- }), _.displayName = l(m, u, "GeneratorFunction"), e.isGeneratorFunction = function (e) {
315
+ }), _.displayName = l(v, u, "GeneratorFunction"), e.isGeneratorFunction = function (e) {
316
316
  var t = "function" == typeof e && e.constructor;
317
317
  return !!t && (t === _ || "GeneratorFunction" === (t.displayName || t.name));
318
318
  }, e.mark = function (e) {
319
- return Object.setPrototypeOf ? Object.setPrototypeOf(e, m) : (e.__proto__ = m, l(e, u, "GeneratorFunction")), e.prototype = Object.create(b), e;
319
+ return Object.setPrototypeOf ? Object.setPrototypeOf(e, v) : (e.__proto__ = v, l(e, u, "GeneratorFunction")), e.prototype = Object.create(b), e;
320
320
  }, e.awrap = function (e) {
321
321
  return {
322
322
  __await: e
323
323
  };
324
- }, w(k.prototype), l(k.prototype, c, function () {
324
+ }, k(w.prototype), l(w.prototype, c, function () {
325
325
  return this;
326
- }), e.AsyncIterator = k, e.async = function (t, r, n, i, o) {
327
- void 0 === o && (o = Promise);
328
- var s = new k(d(t, r, n, i), o);
329
- return e.isGeneratorFunction(r) ? s : s.next().then(function (e) {
330
- return e.done ? e.value : s.next();
326
+ }), e.AsyncIterator = w, e.async = function (t, r, n, i, s) {
327
+ void 0 === s && (s = Promise);
328
+ var o = new w(d(t, r, n, i), s);
329
+ return e.isGeneratorFunction(r) ? o : o.next().then(function (e) {
330
+ return e.done ? e.value : o.next();
331
331
  });
332
- }, w(b), l(b, u, "Generator"), l(b, a, function () {
332
+ }, k(b), l(b, u, "Generator"), l(b, a, function () {
333
333
  return this;
334
334
  }), l(b, "toString", function () {
335
335
  return "[object Generator]";
@@ -344,10 +344,10 @@ function o() {
344
344
  }
345
345
  return e.done = !0, e;
346
346
  };
347
- }, e.values = A, C.prototype = {
348
- constructor: C,
347
+ }, e.values = x, E.prototype = {
348
+ constructor: E,
349
349
  reset: function reset(e) {
350
- if (this.prev = 0, this.next = 0, this.sent = this._sent = void 0, this.done = !1, this.delegate = null, this.method = "next", this.arg = void 0, this.tryEntries.forEach(E), !e) for (var t in this) "t" === t.charAt(0) && r.call(this, t) && !isNaN(+t.slice(1)) && (this[t] = void 0);
350
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = void 0, this.done = !1, this.delegate = null, this.method = "next", this.arg = void 0, this.tryEntries.forEach(C), !e) for (var t in this) "t" === t.charAt(0) && r.call(this, t) && !isNaN(+t.slice(1)) && (this[t] = void 0);
351
351
  },
352
352
  stop: function stop() {
353
353
  this.done = !0;
@@ -359,23 +359,23 @@ function o() {
359
359
  if (this.done) throw e;
360
360
  var t = this;
361
361
  function n(r, n) {
362
- return s.type = "throw", s.arg = e, t.next = r, n && (t.method = "next", t.arg = void 0), !!n;
362
+ return o.type = "throw", o.arg = e, t.next = r, n && (t.method = "next", t.arg = void 0), !!n;
363
363
  }
364
364
  for (var i = this.tryEntries.length - 1; i >= 0; --i) {
365
- var o = this.tryEntries[i],
366
- s = o.completion;
367
- if ("root" === o.tryLoc) return n("end");
368
- if (o.tryLoc <= this.prev) {
369
- var a = r.call(o, "catchLoc"),
370
- c = r.call(o, "finallyLoc");
365
+ var s = this.tryEntries[i],
366
+ o = s.completion;
367
+ if ("root" === s.tryLoc) return n("end");
368
+ if (s.tryLoc <= this.prev) {
369
+ var a = r.call(s, "catchLoc"),
370
+ c = r.call(s, "finallyLoc");
371
371
  if (a && c) {
372
- if (this.prev < o.catchLoc) return n(o.catchLoc, !0);
373
- if (this.prev < o.finallyLoc) return n(o.finallyLoc);
372
+ if (this.prev < s.catchLoc) return n(s.catchLoc, !0);
373
+ if (this.prev < s.finallyLoc) return n(s.finallyLoc);
374
374
  } else if (a) {
375
- if (this.prev < o.catchLoc) return n(o.catchLoc, !0);
375
+ if (this.prev < s.catchLoc) return n(s.catchLoc, !0);
376
376
  } else {
377
377
  if (!c) throw new Error("try statement without catch or finally");
378
- if (this.prev < o.finallyLoc) return n(o.finallyLoc);
378
+ if (this.prev < s.finallyLoc) return n(s.finallyLoc);
379
379
  }
380
380
  }
381
381
  }
@@ -384,13 +384,13 @@ function o() {
384
384
  for (var n = this.tryEntries.length - 1; n >= 0; --n) {
385
385
  var i = this.tryEntries[n];
386
386
  if (i.tryLoc <= this.prev && r.call(i, "finallyLoc") && this.prev < i.finallyLoc) {
387
- var o = i;
387
+ var s = i;
388
388
  break;
389
389
  }
390
390
  }
391
- o && ("break" === e || "continue" === e) && o.tryLoc <= t && t <= o.finallyLoc && (o = null);
392
- var s = o ? o.completion : {};
393
- return s.type = e, s.arg = t, o ? (this.method = "next", this.next = o.finallyLoc, p) : this.complete(s);
391
+ s && ("break" === e || "continue" === e) && s.tryLoc <= t && t <= s.finallyLoc && (s = null);
392
+ var o = s ? s.completion : {};
393
+ return o.type = e, o.arg = t, s ? (this.method = "next", this.next = s.finallyLoc, p) : this.complete(o);
394
394
  },
395
395
  complete: function complete(e, t) {
396
396
  if ("throw" === e.type) throw e.arg;
@@ -399,7 +399,7 @@ function o() {
399
399
  finish: function finish(e) {
400
400
  for (var t = this.tryEntries.length - 1; t >= 0; --t) {
401
401
  var r = this.tryEntries[t];
402
- if (r.finallyLoc === e) return this.complete(r.completion, r.afterLoc), E(r), p;
402
+ if (r.finallyLoc === e) return this.complete(r.completion, r.afterLoc), C(r), p;
403
403
  }
404
404
  },
405
405
  "catch": function _catch(e) {
@@ -409,7 +409,7 @@ function o() {
409
409
  var n = r.completion;
410
410
  if ("throw" === n.type) {
411
411
  var i = n.arg;
412
- E(r);
412
+ C(r);
413
413
  }
414
414
  return i;
415
415
  }
@@ -418,17 +418,17 @@ function o() {
418
418
  },
419
419
  delegateYield: function delegateYield(e, t, r) {
420
420
  return this.delegate = {
421
- iterator: A(e),
421
+ iterator: x(e),
422
422
  resultName: t,
423
423
  nextLoc: r
424
424
  }, "next" === this.method && (this.arg = void 0), p;
425
425
  }
426
426
  }, e;
427
427
  }
428
- function s(e, t) {
428
+ function o(e, t) {
429
429
  for (var r = 0; r < t.length; r++) {
430
430
  var n = t[r];
431
- n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, (o = n.key, s = void 0, s = function (e, t) {
431
+ n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, (s = n.key, o = void 0, o = function (e, t) {
432
432
  if ("object" !== i(e) || null === e) return e;
433
433
  var r = e[Symbol.toPrimitive];
434
434
  if (void 0 !== r) {
@@ -437,12 +437,12 @@ function s(e, t) {
437
437
  throw new TypeError("@@toPrimitive must return a primitive value.");
438
438
  }
439
439
  return ("string" === t ? String : Number)(e);
440
- }(o, "string"), "symbol" === i(s) ? s : String(s)), n);
440
+ }(s, "string"), "symbol" === i(o) ? o : String(o)), n);
441
441
  }
442
- var o, s;
442
+ var s, o;
443
443
  }
444
444
  function a(e, t, r) {
445
- return t && s(e.prototype, t), r && s(e, r), Object.defineProperty(e, "prototype", {
445
+ return t && o(e.prototype, t), r && o(e, r), Object.defineProperty(e, "prototype", {
446
446
  writable: !1
447
447
  }), e;
448
448
  }
@@ -465,10 +465,10 @@ function l(e) {
465
465
  var t = f();
466
466
  return function () {
467
467
  var r,
468
- n = m(e);
468
+ n = v(e);
469
469
  if (t) {
470
- var o = m(this).constructor;
471
- r = Reflect.construct(n, arguments, o);
470
+ var s = v(this).constructor;
471
+ r = Reflect.construct(n, arguments, s);
472
472
  } else r = n.apply(this, arguments);
473
473
  return function (e, t) {
474
474
  if (t && ("object" === i(t) || "function" == typeof t)) return t;
@@ -492,7 +492,7 @@ function h(e) {
492
492
  t.set(e, n);
493
493
  }
494
494
  function n() {
495
- return p(e, arguments, m(this).constructor);
495
+ return p(e, arguments, v(this).constructor);
496
496
  }
497
497
  return n.prototype = Object.create(e.prototype, {
498
498
  constructor: {
@@ -527,14 +527,14 @@ function _(e, t) {
527
527
  return e.__proto__ = t, e;
528
528
  }, _(e, t);
529
529
  }
530
- function m(e) {
531
- return m = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (e) {
530
+ function v(e) {
531
+ return v = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (e) {
532
532
  return e.__proto__ || Object.getPrototypeOf(e);
533
- }, m(e);
533
+ }, v(e);
534
534
  }
535
- var v,
536
- g = "https://accounts.google.com/gsi",
537
- y = "".concat(g, "/client");
535
+ var m,
536
+ y = "https://accounts.google.com/gsi",
537
+ g = "".concat(y, "/client");
538
538
  function b(e, t) {
539
539
  var r = {};
540
540
  for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (r[n] = e[n]);
@@ -544,39 +544,39 @@ function b(e, t) {
544
544
  }
545
545
  return r;
546
546
  }
547
- function w(e, t, r, n) {
548
- return new (r || (r = Promise))(function (i, o) {
549
- function s(e) {
547
+ function k(e, t, r, n) {
548
+ return new (r || (r = Promise))(function (i, s) {
549
+ function o(e) {
550
550
  try {
551
551
  c(n.next(e));
552
552
  } catch (e) {
553
- o(e);
553
+ s(e);
554
554
  }
555
555
  }
556
556
  function a(e) {
557
557
  try {
558
558
  c(n["throw"](e));
559
559
  } catch (e) {
560
- o(e);
560
+ s(e);
561
561
  }
562
562
  }
563
563
  function c(e) {
564
564
  var t;
565
565
  e.done ? i(e.value) : (t = e.value, t instanceof r ? t : new r(function (e) {
566
566
  e(t);
567
- })).then(s, a);
567
+ })).then(o, a);
568
568
  }
569
569
  c((n = n.apply(e, t || [])).next());
570
570
  });
571
571
  }
572
- var k = new Uint8Array(16);
572
+ var w = new Uint8Array(16);
573
573
  function S() {
574
- if (!v && !(v = "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");
575
- return v(k);
574
+ if (!m && !(m = "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");
575
+ return m(w);
576
576
  }
577
577
  var T = /^(?:[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;
578
- for (var O, E, C, A, x, P, R = [], B = 0; B < 256; ++B) R.push((B + 256).toString(16).substr(1));
579
- function I(e) {
578
+ for (var O, C, E, x, A, P, R = [], D = 0; D < 256; ++D) R.push((D + 256).toString(16).substr(1));
579
+ function B(e) {
580
580
  var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0,
581
581
  r = (R[e[t + 0]] + R[e[t + 1]] + R[e[t + 2]] + R[e[t + 3]] + "-" + R[e[t + 4]] + R[e[t + 5]] + "-" + R[e[t + 6]] + R[e[t + 7]] + "-" + R[e[t + 8]] + R[e[t + 9]] + "-" + R[e[t + 10]] + R[e[t + 11]] + R[e[t + 12]] + R[e[t + 13]] + R[e[t + 14]] + R[e[t + 15]]).toLowerCase();
582
582
  if (!function (e) {
@@ -584,33 +584,33 @@ function I(e) {
584
584
  }(r)) throw TypeError("Stringified UUID is invalid");
585
585
  return r;
586
586
  }
587
- function D(e, t, r) {
587
+ function I(e, t, r) {
588
588
  var n = (e = e || {}).random || (e.rng || S)();
589
589
  if (n[6] = 15 & n[6] | 64, n[8] = 63 & n[8] | 128, t) {
590
590
  r = r || 0;
591
591
  for (var i = 0; i < 16; ++i) t[r + i] = n[i];
592
592
  return t;
593
593
  }
594
- return I(n);
594
+ return B(n);
595
595
  }
596
596
  !function (e) {
597
597
  e.emailMagicLinks = "emailMagicLinks", e.oauth = "oauth", e.otp = "otp", e.crypto = "crypto", e.passwords = "passwords";
598
598
  }(O || (O = {})), function (e) {
599
599
  e.Google = "google", e.Microsoft = "microsoft", e.Apple = "apple", e.Github = "github", e.GitLab = "gitlab", e.Facebook = "facebook", e.Discord = "discord", e.Salesforce = "salesforce", e.Slack = "slack", e.Amazon = "amazon", e.Bitbucket = "bitbucket", e.LinkedIn = "linkedin", e.Coinbase = "coinbase", e.Twitch = "twitch", e.Twitter = "twitter", e.TikTok = "tiktok", e.Snapchat = "snapchat", e.Figma = "figma", e.Yahoo = "yahoo";
600
- }(E || (E = {})), function (e) {
601
- e.Vessel = "Vessel", e.Phantom = "Phantom", e.Metamask = "Metamask", e.Coinbase = "Coinbase", e.Binance = "Binance", e.GenericEthereumWallet = "Other Ethereum Wallet", e.GenericSolanaWallet = "Other Solana Wallet";
602
600
  }(C || (C = {})), function (e) {
601
+ e.Vessel = "Vessel", e.Phantom = "Phantom", e.Metamask = "Metamask", e.Coinbase = "Coinbase", e.Binance = "Binance", e.GenericEthereumWallet = "Other Ethereum Wallet", e.GenericSolanaWallet = "Other Solana Wallet";
602
+ }(E || (E = {})), function (e) {
603
603
  e.embedded = "embedded", e.floating = "floating";
604
- }(A || (A = {})), function (e) {
605
- e.SMS = "sms", e.WhatsApp = "whatsapp", e.Email = "email";
606
604
  }(x || (x = {})), function (e) {
605
+ e.SMS = "sms", e.WhatsApp = "whatsapp", e.Email = "email";
606
+ }(A || (A = {})), function (e) {
607
607
  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.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_SSO_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";
608
608
  }(P || (P = {}));
609
609
  var L,
610
610
  j,
611
- N,
612
611
  M,
613
- U = function (e) {
612
+ N,
613
+ F = function (e) {
614
614
  u(r, h(Error));
615
615
  var t = l(r);
616
616
  function r(e, n) {
@@ -619,7 +619,7 @@ var L,
619
619
  }
620
620
  return a(r);
621
621
  }(),
622
- F = function (e) {
622
+ U = function (e) {
623
623
  u(r, h(Error));
624
624
  var t = l(r);
625
625
  function r(e, n) {
@@ -634,10 +634,10 @@ var L,
634
634
  function r(e) {
635
635
  var n, i;
636
636
  c(this, r), (n = t.call(this)).name = "StytchSDKSchemaError";
637
- var o = null === (i = e.body) || void 0 === i ? void 0 : i.map(function (e) {
637
+ var s = null === (i = e.body) || void 0 === i ? void 0 : i.map(function (e) {
638
638
  return "".concat(e.dataPath, ": ").concat(e.message);
639
639
  }).join("\n");
640
- return n.message = "[400] Request does not match expected schema\n".concat(o), n;
640
+ return n.message = "[400] Request does not match expected schema\n".concat(s), n;
641
641
  }
642
642
  return a(r);
643
643
  }(),
@@ -648,37 +648,37 @@ var L,
648
648
  var n;
649
649
  c(this, r), (n = t.call(this)).name = "StytchSDKAPIError";
650
650
  var i = e.status_code,
651
- o = e.error_type,
652
- s = e.error_message,
651
+ s = e.error_type,
652
+ o = e.error_message,
653
653
  a = e.error_url,
654
654
  u = e.request_id;
655
- return n.error_type = o, n.error_message = s, n.error_url = a, n.request_id = u, n.status_code = i, n.message = "[".concat(i, "] ").concat(o, "\n") + "".concat(s, "\n") + "See ".concat(a, " for more information.\n") + (u ? "request_id: ".concat(u, "\n") : ""), n;
655
+ return n.error_type = s, n.error_message = o, n.error_url = a, n.request_id = u, n.status_code = i, n.message = "[".concat(i, "] ").concat(s, "\n") + "".concat(o, "\n") + "See ".concat(a, " for more information.\n") + (u ? "request_id: ".concat(u, "\n") : ""), n;
656
656
  }
657
657
  return a(r);
658
658
  }(),
659
- G = ["unauthorized_credentials", "user_unauthenticated", "invalid_secret_authentication", "session_not_found"];
659
+ W = ["unauthorized_credentials", "user_unauthenticated", "invalid_secret_authentication", "session_not_found"];
660
660
  !function (e) {
661
661
  e.BiometricsSensorError = "biometrics_sensor_error", e.DeviceCredentialsNotAllowed = "device_credentials_not_allowed", e.DeviceHardwareError = "device_hardware_error", e.InternalError = "internal_error", e.KeyInvalidated = "key_invalidated", e.KeystoreUnavailable = "keystore_unavailable", e.NoBiometricsEnrolled = "no_biometrics_enrolled", e.NoBiometricsRegistration = "no_biometrics_registration", e.SessionExpired = "session_expired", e.UserCancellation = "user_cancellation", e.UserLockedOut = "user_locked_out", e.BiometricsNotAvailable = "biometrics_not_available";
662
662
  }(L || (L = {})), function (e) {
663
663
  e.emailMagicLinks = "emailMagicLinks", e.sso = "sso", e.passwords = "passwords", e.oauth = "oauth";
664
664
  }(j || (j = {})), function (e) {
665
665
  e.Discovery = "Discovery", e.Organization = "Organization", e.PasswordReset = "PasswordReset";
666
- }(N || (N = {})), function (e) {
666
+ }(M || (M = {})), function (e) {
667
667
  e.Google = "google", e.Microsoft = "microsoft";
668
- }(M || (M = {}));
669
- var W = {};
668
+ }(N || (N = {}));
669
+ var G = {};
670
670
  function H(e, t) {
671
- return w(this, void 0, void 0, o().mark(function r() {
672
- return o().wrap(function (r) {
671
+ return k(this, void 0, void 0, s().mark(function r() {
672
+ return s().wrap(function (r) {
673
673
  for (;;) switch (r.prev = r.next) {
674
674
  case 0:
675
- if (void 0 === W[e]) {
675
+ if (void 0 === G[e]) {
676
676
  r.next = 2;
677
677
  break;
678
678
  }
679
- return r.abrupt("return", W[e]);
679
+ return r.abrupt("return", G[e]);
680
680
  case 2:
681
- return W[e] = z(e, t), r.abrupt("return", W[e]);
681
+ return G[e] = z(e, t), r.abrupt("return", G[e]);
682
682
  case 4:
683
683
  case "end":
684
684
  return r.stop();
@@ -697,18 +697,18 @@ function z(e, t) {
697
697
  } catch (t) {
698
698
  return n(new Error("".concat(e, " already loaded, but module was not found in global scope: ").concat(t)));
699
699
  }
700
- var o = function (e) {
700
+ var s = function (e) {
701
701
  var t = document.createElement("script");
702
702
  return t.setAttribute("src", e), t.setAttribute("async", "true"), t.setAttribute("defer", "true"), document.head.appendChild(t), t;
703
703
  }(e);
704
- o.addEventListener("load", function () {
705
- o.dataset.loaded = "true";
704
+ s.addEventListener("load", function () {
705
+ s.dataset.loaded = "true";
706
706
  try {
707
707
  r(t());
708
708
  } catch (t) {
709
709
  n(new Error("".concat(e, " was loaded, but module was not found in global scope: ").concat(t)));
710
710
  }
711
- }), o.addEventListener("error", function (t) {
711
+ }), s.addEventListener("error", function (t) {
712
712
  n(new Error("".concat(e, " could not be loaded: ").concat(t)));
713
713
  });
714
714
  });
@@ -729,32 +729,32 @@ var V = ["[Stytch]"],
729
729
  Z = function Z(t) {
730
730
  var r = {
731
731
  isObject: function isObject(e, n) {
732
- var o = "object" === i(n) && !Array.isArray(n) && null !== n;
733
- if (!o) throw new F(t, e + " must be an object.");
732
+ var s = "object" === i(n) && !Array.isArray(n) && null !== n;
733
+ if (!s) throw new U(t, e + " must be an object.");
734
734
  return r;
735
735
  },
736
736
  isOptionalObject: function isOptionalObject(e, t) {
737
737
  return void 0 === t ? r : r.isObject(e, t);
738
738
  },
739
739
  isString: function isString(e, n) {
740
- if ("string" != typeof n) throw new F(t, e + " must be a string.");
740
+ if ("string" != typeof n) throw new U(t, e + " must be a string.");
741
741
  return r;
742
742
  },
743
743
  isOptionalString: function isOptionalString(e, t) {
744
744
  return void 0 === t ? r : r.isString(e, t);
745
745
  },
746
746
  isStringArray: function isStringArray(n, i) {
747
- if (!Array.isArray(i)) throw new F(t, n + " must be an array of strings.");
748
- var o,
749
- s = e(i);
747
+ if (!Array.isArray(i)) throw new U(t, n + " must be an array of strings.");
748
+ var s,
749
+ o = e(i);
750
750
  try {
751
- for (s.s(); !(o = s.n()).done;) {
752
- if ("string" != typeof o.value) throw new F(t, n + " must be an array of strings.");
751
+ for (o.s(); !(s = o.n()).done;) {
752
+ if ("string" != typeof s.value) throw new U(t, n + " must be an array of strings.");
753
753
  }
754
754
  } catch (e) {
755
- s.e(e);
755
+ o.e(e);
756
756
  } finally {
757
- s.f();
757
+ o.f();
758
758
  }
759
759
  return r;
760
760
  },
@@ -762,14 +762,14 @@ var V = ["[Stytch]"],
762
762
  return void 0 === t ? r : r.isStringArray(e, t);
763
763
  },
764
764
  isNumber: function isNumber(e, n) {
765
- if ("number" != typeof n) throw new F(t, e + " must be a number.");
765
+ if ("number" != typeof n) throw new U(t, e + " must be a number.");
766
766
  return r;
767
767
  },
768
768
  isOptionalNumber: function isOptionalNumber(e, t) {
769
769
  return void 0 === t ? r : r.isNumber(e, t);
770
770
  },
771
771
  isBoolean: function isBoolean(e, n) {
772
- if ("boolean" != typeof n) throw new F(t, e + " must be a boolean.");
772
+ if ("boolean" != typeof n) throw new U(t, e + " must be a boolean.");
773
773
  return r;
774
774
  },
775
775
  isOptionalBoolean: function isOptionalBoolean(e, t) {
@@ -787,8 +787,8 @@ var V = ["[Stytch]"],
787
787
  te = a(function e(t, r, n) {
788
788
  var i = this;
789
789
  c(this, e), this.bootstrapPromise = n, this.isEnabled = function () {
790
- return w(i, void 0, void 0, o().mark(function e() {
791
- return o().wrap(function (e) {
790
+ return k(i, void 0, void 0, s().mark(function e() {
791
+ return s().wrap(function (e) {
792
792
  for (;;) switch (e.prev = e.next) {
793
793
  case 0:
794
794
  return e.abrupt("return", this.state.then(function (e) {
@@ -801,9 +801,9 @@ var V = ["[Stytch]"],
801
801
  }, e, this);
802
802
  }));
803
803
  }, this.getTelemetryID = function () {
804
- return w(i, void 0, void 0, o().mark(function e() {
804
+ return k(i, void 0, void 0, s().mark(function e() {
805
805
  var t, r, n, i;
806
- return o().wrap(function (e) {
806
+ return s().wrap(function (e) {
807
807
  for (;;) switch (e.prev = e.next) {
808
808
  case 0:
809
809
  return e.next = 2, this.state;
@@ -824,8 +824,8 @@ var V = ["[Stytch]"],
824
824
  }, e, this);
825
825
  }));
826
826
  }, this.state = n.then(function (e) {
827
- return w(i, void 0, void 0, o().mark(function n() {
828
- return o().wrap(function (n) {
827
+ return k(i, void 0, void 0, s().mark(function n() {
828
+ return s().wrap(function (n) {
829
829
  for (;;) switch (n.prev = n.next) {
830
830
  case 0:
831
831
  if (e.runDFPProtectedAuth) {
@@ -881,7 +881,7 @@ var V = ["[Stytch]"],
881
881
  value: function value(t) {
882
882
  if ("name" in t) switch (t.name) {
883
883
  case "SDKAPIUnreachableError":
884
- return e.inflate(U, t);
884
+ return e.inflate(F, t);
885
885
  case "StytchSDKSchemaError":
886
886
  return e.inflate(K, t);
887
887
  case "StytchSDKAPIError":
@@ -918,9 +918,9 @@ var V = ["[Stytch]"],
918
918
  }, {
919
919
  key: "flush",
920
920
  value: function value() {
921
- return w(this, void 0, void 0, o().mark(function e() {
921
+ return k(this, void 0, void 0, s().mark(function e() {
922
922
  var t;
923
- return o().wrap(function (e) {
923
+ return s().wrap(function (e) {
924
924
  for (;;) switch (e.prev = e.next) {
925
925
  case 0:
926
926
  if (this.batch.length) {
@@ -953,9 +953,9 @@ var V = ["[Stytch]"],
953
953
  ie = a(function e(t, r) {
954
954
  var n = this;
955
955
  c(this, e), this._networkClient = t, this._subscriptionService = r, this.get = function () {
956
- return w(n, void 0, void 0, o().mark(function e() {
956
+ return k(n, void 0, void 0, s().mark(function e() {
957
957
  var t, r;
958
- return o().wrap(function (e) {
958
+ return s().wrap(function (e) {
959
959
  for (;;) switch (e.prev = e.next) {
960
960
  case 0:
961
961
  return e.next = 2, this._networkClient.fetchSDK({
@@ -974,9 +974,9 @@ var V = ["[Stytch]"],
974
974
  }, this.getSync = function () {
975
975
  return n._subscriptionService.getUser();
976
976
  }, this.update = function (e) {
977
- return w(n, void 0, void 0, o().mark(function t() {
977
+ return k(n, void 0, void 0, s().mark(function t() {
978
978
  var r, n;
979
- return o().wrap(function (t) {
979
+ return s().wrap(function (t) {
980
980
  for (;;) switch (t.prev = t.next) {
981
981
  case 0:
982
982
  return Z("stytch.user.update").isOptionalObject("untrusted_metadata", e.untrusted_metadata), t.next = 3, this._networkClient.fetchSDK({
@@ -994,9 +994,9 @@ var V = ["[Stytch]"],
994
994
  }, t, this);
995
995
  }));
996
996
  }, this.deleteEmail = function (e) {
997
- return w(n, void 0, void 0, o().mark(function t() {
997
+ return k(n, void 0, void 0, s().mark(function t() {
998
998
  var r, n;
999
- return o().wrap(function (t) {
999
+ return s().wrap(function (t) {
1000
1000
  for (;;) switch (t.prev = t.next) {
1001
1001
  case 0:
1002
1002
  return t.next = 2, this._networkClient.fetchSDK({
@@ -1013,9 +1013,9 @@ var V = ["[Stytch]"],
1013
1013
  }, t, this);
1014
1014
  }));
1015
1015
  }, this.deletePhoneNumber = function (e) {
1016
- return w(n, void 0, void 0, o().mark(function t() {
1016
+ return k(n, void 0, void 0, s().mark(function t() {
1017
1017
  var r, n;
1018
- return o().wrap(function (t) {
1018
+ return s().wrap(function (t) {
1019
1019
  for (;;) switch (t.prev = t.next) {
1020
1020
  case 0:
1021
1021
  return t.next = 2, this._networkClient.fetchSDK({
@@ -1032,9 +1032,9 @@ var V = ["[Stytch]"],
1032
1032
  }, t, this);
1033
1033
  }));
1034
1034
  }, this.deleteTOTP = function (e) {
1035
- return w(n, void 0, void 0, o().mark(function t() {
1035
+ return k(n, void 0, void 0, s().mark(function t() {
1036
1036
  var r, n;
1037
- return o().wrap(function (t) {
1037
+ return s().wrap(function (t) {
1038
1038
  for (;;) switch (t.prev = t.next) {
1039
1039
  case 0:
1040
1040
  return t.next = 2, this._networkClient.fetchSDK({
@@ -1051,9 +1051,9 @@ var V = ["[Stytch]"],
1051
1051
  }, t, this);
1052
1052
  }));
1053
1053
  }, this.deleteOAuthRegistration = function (e) {
1054
- return w(n, void 0, void 0, o().mark(function t() {
1054
+ return k(n, void 0, void 0, s().mark(function t() {
1055
1055
  var r, n;
1056
- return o().wrap(function (t) {
1056
+ return s().wrap(function (t) {
1057
1057
  for (;;) switch (t.prev = t.next) {
1058
1058
  case 0:
1059
1059
  return t.next = 2, this._networkClient.fetchSDK({
@@ -1070,9 +1070,9 @@ var V = ["[Stytch]"],
1070
1070
  }, t, this);
1071
1071
  }));
1072
1072
  }, this.deleteWebauthnRegistration = function (e) {
1073
- return w(n, void 0, void 0, o().mark(function t() {
1073
+ return k(n, void 0, void 0, s().mark(function t() {
1074
1074
  var r, n;
1075
- return o().wrap(function (t) {
1075
+ return s().wrap(function (t) {
1076
1076
  for (;;) switch (t.prev = t.next) {
1077
1077
  case 0:
1078
1078
  return t.next = 2, this._networkClient.fetchSDK({
@@ -1089,9 +1089,9 @@ var V = ["[Stytch]"],
1089
1089
  }, t, this);
1090
1090
  }));
1091
1091
  }, this.deleteBiometricRegistration = function (e) {
1092
- return w(n, void 0, void 0, o().mark(function t() {
1092
+ return k(n, void 0, void 0, s().mark(function t() {
1093
1093
  var r, n;
1094
- return o().wrap(function (t) {
1094
+ return s().wrap(function (t) {
1095
1095
  for (;;) switch (t.prev = t.next) {
1096
1096
  case 0:
1097
1097
  return t.next = 2, this._networkClient.fetchSDK({
@@ -1115,7 +1115,7 @@ var V = ["[Stytch]"],
1115
1115
  });
1116
1116
  };
1117
1117
  }),
1118
- oe = function () {
1118
+ se = function () {
1119
1119
  function e(t, r) {
1120
1120
  var n = this;
1121
1121
  c(this, e), this._networkClient = t, this._subscriptionService = r, this.getSync = function () {
@@ -1127,9 +1127,9 @@ var V = ["[Stytch]"],
1127
1127
  (null == r ? void 0 : r.session) !== t && (t = null !== (n = null == r ? void 0 : r.session) && void 0 !== n ? n : null, e(t));
1128
1128
  });
1129
1129
  }, this.revoke = function (e) {
1130
- return w(n, void 0, void 0, o().mark(function t() {
1130
+ return k(n, void 0, void 0, s().mark(function t() {
1131
1131
  var r;
1132
- return o().wrap(function (t) {
1132
+ return s().wrap(function (t) {
1133
1133
  for (;;) switch (t.prev = t.next) {
1134
1134
  case 0:
1135
1135
  return t.prev = 0, t.next = 3, this._networkClient.fetchSDK({
@@ -1140,7 +1140,7 @@ var V = ["[Stytch]"],
1140
1140
  case 3:
1141
1141
  return r = t.sent, this._subscriptionService.destroyState(), t.abrupt("return", r);
1142
1142
  case 8:
1143
- throw t.prev = 8, t.t0 = t["catch"](0), ((null == e ? void 0 : e.forceClear) || G.includes(t.t0.error_type)) && this._subscriptionService.destroyState(), t.t0;
1143
+ throw t.prev = 8, t.t0 = t["catch"](0), ((null == e ? void 0 : e.forceClear) || W.includes(t.t0.error_type)) && this._subscriptionService.destroyState(), t.t0;
1144
1144
  case 12:
1145
1145
  case "end":
1146
1146
  return t.stop();
@@ -1148,9 +1148,9 @@ var V = ["[Stytch]"],
1148
1148
  }, t, this, [[0, 8]]);
1149
1149
  }));
1150
1150
  }, this.authenticate = function (e) {
1151
- return w(n, void 0, void 0, o().mark(function t() {
1151
+ return k(n, void 0, void 0, s().mark(function t() {
1152
1152
  var r, n;
1153
- return o().wrap(function (t) {
1153
+ return s().wrap(function (t) {
1154
1154
  for (;;) switch (t.prev = t.next) {
1155
1155
  case 0:
1156
1156
  return t.prev = 0, r = {
@@ -1172,7 +1172,7 @@ var V = ["[Stytch]"],
1172
1172
  intermediate_session_token: null
1173
1173
  }), t.abrupt("return", ee(n));
1174
1174
  case 9:
1175
- throw t.prev = 9, t.t0 = t["catch"](0), G.includes(t.t0.error_type) && this._subscriptionService.destroyState(), t.t0;
1175
+ throw t.prev = 9, t.t0 = t["catch"](0), W.includes(t.t0.error_type) && this._subscriptionService.destroyState(), t.t0;
1176
1176
  case 13:
1177
1177
  case "end":
1178
1178
  return t.stop();
@@ -1193,47 +1193,85 @@ var V = ["[Stytch]"],
1193
1193
  }
1194
1194
  }]), e;
1195
1195
  }(),
1196
- se = Promise.resolve({
1196
+ oe = Promise.resolve({
1197
1197
  pkceRequiredForEmailMagicLinks: !1
1198
1198
  }),
1199
1199
  ae = function () {
1200
1200
  function e(t, r, n) {
1201
1201
  var i = this,
1202
- s = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : se,
1202
+ o = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : oe,
1203
1203
  a = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : function () {
1204
1204
  return Promise.resolve(void 0);
1205
1205
  },
1206
1206
  u = arguments.length > 5 ? arguments[5] : void 0;
1207
- c(this, e), this._networkClient = t, this._subscriptionService = r, this._pkceManager = n, this._config = s, this.executeRecaptcha = a, this._dfpProtectedAuth = u, this.email = {
1207
+ c(this, e), this._networkClient = t, this._subscriptionService = r, this._pkceManager = n, this._config = o, this.executeRecaptcha = a, this._dfpProtectedAuth = u, this.retryWithCaptchaAndDFP = function (e, t) {
1208
+ return k(i, void 0, void 0, s().mark(function r() {
1209
+ var n, i;
1210
+ return s().wrap(function (r) {
1211
+ for (;;) switch (r.prev = r.next) {
1212
+ case 0:
1213
+ if (n = this._dfpProtectedAuth, r.t0 = n, !r.t0) {
1214
+ r.next = 6;
1215
+ break;
1216
+ }
1217
+ return r.next = 5, n.isEnabled();
1218
+ case 5:
1219
+ r.t0 = r.sent;
1220
+ case 6:
1221
+ if (i = r.t0, e.type !== Be.RequiredCatcha || !i) {
1222
+ r.next = 16;
1223
+ break;
1224
+ }
1225
+ if (!t.body) {
1226
+ r.next = 15;
1227
+ break;
1228
+ }
1229
+ return r.next = 11, n.getTelemetryID();
1230
+ case 11:
1231
+ return t.body.dfp_telemetry_id = r.sent, r.next = 14, this.executeRecaptcha();
1232
+ case 14:
1233
+ t.body.captcha_token = r.sent;
1234
+ case 15:
1235
+ return r.abrupt("return", t);
1236
+ case 16:
1237
+ throw new Error("Unable to query captcha and/or dfp telemetry ID");
1238
+ case 17:
1239
+ case "end":
1240
+ return r.stop();
1241
+ }
1242
+ }, r, this);
1243
+ }));
1244
+ }, this.email = {
1208
1245
  loginOrCreate: function loginOrCreate(e) {
1209
1246
  var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
1210
- return w(i, void 0, void 0, o().mark(function r() {
1211
- var n, i, s, a, c, u, l;
1212
- return o().wrap(function (r) {
1247
+ return k(i, void 0, void 0, s().mark(function r() {
1248
+ var n, i, o, a, c, u, l;
1249
+ return s().wrap(function (r) {
1213
1250
  for (;;) switch (r.prev = r.next) {
1214
1251
  case 0:
1215
1252
  return r.next = 2, this._config;
1216
1253
  case 2:
1217
- if (n = r.sent, i = n.pkceRequiredForEmailMagicLinks, s = void 0, !i) {
1254
+ if (n = r.sent, i = n.pkceRequiredForEmailMagicLinks, o = void 0, !i) {
1218
1255
  r.next = 9;
1219
1256
  break;
1220
1257
  }
1221
1258
  return r.next = 8, this.getCodeChallenge();
1222
1259
  case 8:
1223
- s = r.sent;
1260
+ o = r.sent;
1224
1261
  case 9:
1225
1262
  return r.next = 11, this.getDFPTelemetryIDAndCaptcha();
1226
1263
  case 11:
1227
1264
  return a = r.sent, c = a.dfp_telemetry_id, u = a.captcha_token, l = Object.assign(Object.assign({}, t), {
1228
1265
  email: e,
1229
- code_challenge: s,
1266
+ code_challenge: o,
1230
1267
  captcha_token: u,
1231
1268
  dfp_telemetry_id: c
1232
- }), r.abrupt("return", this._networkClient.fetchSDK({
1269
+ }), r.abrupt("return", this._networkClient.retriableFetchSDK({
1233
1270
  url: "/magic_links/email/login_or_create",
1234
1271
  body: l,
1235
1272
  errorMessage: "Failed to send magic link",
1236
- method: "POST"
1273
+ method: "POST",
1274
+ retryCallback: this.retryWithCaptchaAndDFP
1237
1275
  }));
1238
1276
  case 16:
1239
1277
  case "end":
@@ -1244,33 +1282,34 @@ var V = ["[Stytch]"],
1244
1282
  },
1245
1283
  send: function send(e) {
1246
1284
  var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
1247
- return w(i, void 0, void 0, o().mark(function r() {
1248
- var n, i, s, a, c, u, l, d, h;
1249
- return o().wrap(function (r) {
1285
+ return k(i, void 0, void 0, s().mark(function r() {
1286
+ var n, i, o, a, c, u, l, d, h;
1287
+ return s().wrap(function (r) {
1250
1288
  for (;;) switch (r.prev = r.next) {
1251
1289
  case 0:
1252
1290
  return r.next = 2, this._config;
1253
1291
  case 2:
1254
- if (n = r.sent, i = n.pkceRequiredForEmailMagicLinks, s = void 0, !i) {
1292
+ if (n = r.sent, i = n.pkceRequiredForEmailMagicLinks, o = void 0, !i) {
1255
1293
  r.next = 9;
1256
1294
  break;
1257
1295
  }
1258
1296
  return r.next = 8, this.getCodeChallenge();
1259
1297
  case 8:
1260
- s = r.sent;
1298
+ o = r.sent;
1261
1299
  case 9:
1262
1300
  return r.next = 11, this.getDFPTelemetryIDAndCaptcha();
1263
1301
  case 11:
1264
1302
  return a = r.sent, c = a.dfp_telemetry_id, u = a.captcha_token, l = Object.assign(Object.assign({}, t), {
1265
1303
  email: e,
1266
- code_challenge: s,
1304
+ code_challenge: o,
1267
1305
  captcha_token: u,
1268
1306
  dfp_telemetry_id: c
1269
- }), d = !!this._subscriptionService.getSession(), h = d ? "/magic_links/email/send/secondary" : "/magic_links/email/send/primary", r.abrupt("return", this._networkClient.fetchSDK({
1307
+ }), d = !!this._subscriptionService.getSession(), h = d ? "/magic_links/email/send/secondary" : "/magic_links/email/send/primary", r.abrupt("return", this._networkClient.retriableFetchSDK({
1270
1308
  url: h,
1271
1309
  body: l,
1272
1310
  errorMessage: "Failed to send magic link",
1273
- method: "POST"
1311
+ method: "POST",
1312
+ retryCallback: this.retryWithCaptchaAndDFP
1274
1313
  }));
1275
1314
  case 18:
1276
1315
  case "end":
@@ -1280,9 +1319,9 @@ var V = ["[Stytch]"],
1280
1319
  }));
1281
1320
  }
1282
1321
  }, this.authenticate = function (e, t) {
1283
- return w(i, void 0, void 0, o().mark(function r() {
1284
- var n, i, s;
1285
- return o().wrap(function (r) {
1322
+ return k(i, void 0, void 0, s().mark(function r() {
1323
+ var n, i, o;
1324
+ return s().wrap(function (r) {
1286
1325
  for (;;) switch (r.prev = r.next) {
1287
1326
  case 0:
1288
1327
  return Z("stytch.magicLinks.authenticate").isString("Token", e).isNumber("session_duration_minutes", t.session_duration_minutes), r.next = 3, this._pkceManager.getPKPair();
@@ -1297,15 +1336,15 @@ var V = ["[Stytch]"],
1297
1336
  method: "POST"
1298
1337
  });
1299
1338
  case 7:
1300
- return s = r.sent, this._pkceManager.clearPKPair(), this._subscriptionService.updateStateAndTokens({
1339
+ return o = r.sent, this._pkceManager.clearPKPair(), this._subscriptionService.updateStateAndTokens({
1301
1340
  state: {
1302
- session: s.session,
1303
- user: s.user
1341
+ session: o.session,
1342
+ user: o.user
1304
1343
  },
1305
- session_token: s.session_token,
1306
- session_jwt: s.session_jwt,
1344
+ session_token: o.session_token,
1345
+ session_jwt: o.session_jwt,
1307
1346
  intermediate_session_token: null
1308
- }), r.abrupt("return", ee(s));
1347
+ }), r.abrupt("return", ee(o));
1309
1348
  case 11:
1310
1349
  case "end":
1311
1350
  return r.stop();
@@ -1317,9 +1356,9 @@ var V = ["[Stytch]"],
1317
1356
  return a(e, [{
1318
1357
  key: "getCodeChallenge",
1319
1358
  value: function value() {
1320
- return w(this, void 0, void 0, o().mark(function e() {
1359
+ return k(this, void 0, void 0, s().mark(function e() {
1321
1360
  var t;
1322
- return o().wrap(function (e) {
1361
+ return s().wrap(function (e) {
1323
1362
  for (;;) switch (e.prev = e.next) {
1324
1363
  case 0:
1325
1364
  return e.next = 2, this._pkceManager.getPKPair();
@@ -1343,9 +1382,9 @@ var V = ["[Stytch]"],
1343
1382
  }, {
1344
1383
  key: "getDFPTelemetryIDAndCaptcha",
1345
1384
  value: function value() {
1346
- return w(this, void 0, void 0, o().mark(function e() {
1385
+ return k(this, void 0, void 0, s().mark(function e() {
1347
1386
  var t, r;
1348
- return o().wrap(function (e) {
1387
+ return s().wrap(function (e) {
1349
1388
  for (;;) switch (e.prev = e.next) {
1350
1389
  case 0:
1351
1390
  if (t = void 0, r = void 0, e.t0 = this._dfpProtectedAuth, !e.t0) {
@@ -1389,9 +1428,9 @@ var V = ["[Stytch]"],
1389
1428
  };
1390
1429
  c(this, e), this._networkClient = t, this._subscriptionService = r, this.executeRecaptcha = i, this.sms = {
1391
1430
  loginOrCreate: function loginOrCreate(e, t) {
1392
- return w(n, void 0, void 0, o().mark(function r() {
1431
+ return k(n, void 0, void 0, s().mark(function r() {
1393
1432
  var n, i;
1394
- return o().wrap(function (r) {
1433
+ return s().wrap(function (r) {
1395
1434
  for (;;) switch (r.prev = r.next) {
1396
1435
  case 0:
1397
1436
  return r.next = 2, this.executeRecaptcha();
@@ -1413,9 +1452,9 @@ var V = ["[Stytch]"],
1413
1452
  }));
1414
1453
  },
1415
1454
  send: function send(e, t) {
1416
- return w(n, void 0, void 0, o().mark(function r() {
1417
- var n, i, s, a;
1418
- return o().wrap(function (r) {
1455
+ return k(n, void 0, void 0, s().mark(function r() {
1456
+ var n, i, o, a;
1457
+ return s().wrap(function (r) {
1419
1458
  for (;;) switch (r.prev = r.next) {
1420
1459
  case 0:
1421
1460
  return r.next = 2, this.executeRecaptcha();
@@ -1423,7 +1462,7 @@ var V = ["[Stytch]"],
1423
1462
  return n = r.sent, i = Object.assign(Object.assign({}, t), {
1424
1463
  phone_number: e,
1425
1464
  captcha_token: n
1426
- }), s = !!this._subscriptionService.getSession(), a = s ? "/otps/sms/send/secondary" : "/otps/sms/send/primary", r.abrupt("return", this._networkClient.fetchSDK({
1465
+ }), o = !!this._subscriptionService.getSession(), a = o ? "/otps/sms/send/secondary" : "/otps/sms/send/primary", r.abrupt("return", this._networkClient.fetchSDK({
1427
1466
  url: a,
1428
1467
  body: i,
1429
1468
  errorMessage: "Failed to send one time passcode",
@@ -1438,9 +1477,9 @@ var V = ["[Stytch]"],
1438
1477
  }
1439
1478
  }, this.whatsapp = {
1440
1479
  loginOrCreate: function loginOrCreate(e, t) {
1441
- return w(n, void 0, void 0, o().mark(function r() {
1480
+ return k(n, void 0, void 0, s().mark(function r() {
1442
1481
  var n, i;
1443
- return o().wrap(function (r) {
1482
+ return s().wrap(function (r) {
1444
1483
  for (;;) switch (r.prev = r.next) {
1445
1484
  case 0:
1446
1485
  return r.next = 2, this.executeRecaptcha();
@@ -1462,9 +1501,9 @@ var V = ["[Stytch]"],
1462
1501
  }));
1463
1502
  },
1464
1503
  send: function send(e, t) {
1465
- return w(n, void 0, void 0, o().mark(function r() {
1466
- var n, i, s, a;
1467
- return o().wrap(function (r) {
1504
+ return k(n, void 0, void 0, s().mark(function r() {
1505
+ var n, i, o, a;
1506
+ return s().wrap(function (r) {
1468
1507
  for (;;) switch (r.prev = r.next) {
1469
1508
  case 0:
1470
1509
  return r.next = 2, this.executeRecaptcha();
@@ -1472,7 +1511,7 @@ var V = ["[Stytch]"],
1472
1511
  return n = r.sent, i = Object.assign(Object.assign({}, t), {
1473
1512
  phone_number: e,
1474
1513
  captcha_token: n
1475
- }), s = !!this._subscriptionService.getSession(), a = s ? "/otps/whatsapp/send/secondary" : "/otps/whatsapp/send/primary", r.abrupt("return", this._networkClient.fetchSDK({
1514
+ }), o = !!this._subscriptionService.getSession(), a = o ? "/otps/whatsapp/send/secondary" : "/otps/whatsapp/send/primary", r.abrupt("return", this._networkClient.fetchSDK({
1476
1515
  url: a,
1477
1516
  body: i,
1478
1517
  errorMessage: "Failed to send one time passcode",
@@ -1487,9 +1526,9 @@ var V = ["[Stytch]"],
1487
1526
  }
1488
1527
  }, this.email = {
1489
1528
  loginOrCreate: function loginOrCreate(e, t) {
1490
- return w(n, void 0, void 0, o().mark(function r() {
1529
+ return k(n, void 0, void 0, s().mark(function r() {
1491
1530
  var n, i;
1492
- return o().wrap(function (r) {
1531
+ return s().wrap(function (r) {
1493
1532
  for (;;) switch (r.prev = r.next) {
1494
1533
  case 0:
1495
1534
  return r.next = 2, this.executeRecaptcha();
@@ -1511,9 +1550,9 @@ var V = ["[Stytch]"],
1511
1550
  }));
1512
1551
  },
1513
1552
  send: function send(e, t) {
1514
- return w(n, void 0, void 0, o().mark(function r() {
1515
- var n, i, s, a;
1516
- return o().wrap(function (r) {
1553
+ return k(n, void 0, void 0, s().mark(function r() {
1554
+ var n, i, o, a;
1555
+ return s().wrap(function (r) {
1517
1556
  for (;;) switch (r.prev = r.next) {
1518
1557
  case 0:
1519
1558
  return r.next = 2, this.executeRecaptcha();
@@ -1521,7 +1560,7 @@ var V = ["[Stytch]"],
1521
1560
  return n = r.sent, i = Object.assign(Object.assign({}, t), {
1522
1561
  email: e,
1523
1562
  captcha_token: n
1524
- }), s = !!this._subscriptionService.getSession(), a = s ? "/otps/email/send/secondary" : "/otps/email/send/primary", r.abrupt("return", this._networkClient.fetchSDK({
1563
+ }), o = !!this._subscriptionService.getSession(), a = o ? "/otps/email/send/secondary" : "/otps/email/send/primary", r.abrupt("return", this._networkClient.fetchSDK({
1525
1564
  url: a,
1526
1565
  body: i,
1527
1566
  errorMessage: "Failed to send one time passcode",
@@ -1535,9 +1574,9 @@ var V = ["[Stytch]"],
1535
1574
  }));
1536
1575
  }
1537
1576
  }, this.authenticate = function (e, t, r) {
1538
- return w(n, void 0, void 0, o().mark(function n() {
1539
- var i, s;
1540
- return o().wrap(function (n) {
1577
+ return k(n, void 0, void 0, s().mark(function n() {
1578
+ var i, o;
1579
+ return s().wrap(function (n) {
1541
1580
  for (;;) switch (n.prev = n.next) {
1542
1581
  case 0:
1543
1582
  return Z("stytch.otps.authenticate").isString("Code", e).isNumber("session_duration_minutes", r.session_duration_minutes), i = Object.assign({
@@ -1550,15 +1589,15 @@ var V = ["[Stytch]"],
1550
1589
  method: "POST"
1551
1590
  });
1552
1591
  case 4:
1553
- return s = n.sent, this._subscriptionService.updateStateAndTokens({
1592
+ return o = n.sent, this._subscriptionService.updateStateAndTokens({
1554
1593
  state: {
1555
- session: s.session,
1556
- user: s.user
1594
+ session: o.session,
1595
+ user: o.user
1557
1596
  },
1558
- session_token: s.session_token,
1559
- session_jwt: s.session_jwt,
1597
+ session_token: o.session_token,
1598
+ session_jwt: o.session_jwt,
1560
1599
  intermediate_session_token: null
1561
- }), n.abrupt("return", ee(s));
1600
+ }), n.abrupt("return", ee(o));
1562
1601
  case 7:
1563
1602
  case "end":
1564
1603
  return n.stop();
@@ -1568,53 +1607,53 @@ var V = ["[Stytch]"],
1568
1607
  };
1569
1608
  }),
1570
1609
  ue = function () {
1571
- function e(t, r, n, i, o) {
1572
- c(this, e), this._networkClient = t, this._subscriptionService = r, this._pkceManager = n, this._dynamicConfig = i, this._config = o, this.google = {
1573
- start: this.startOAuthFlow(E.Google)
1610
+ function e(t, r, n, i, s) {
1611
+ c(this, e), this._networkClient = t, this._subscriptionService = r, this._pkceManager = n, this._dynamicConfig = i, this._config = s, this.google = {
1612
+ start: this.startOAuthFlow(C.Google)
1574
1613
  }, this.apple = {
1575
- start: this.startOAuthFlow(E.Apple)
1614
+ start: this.startOAuthFlow(C.Apple)
1576
1615
  }, this.microsoft = {
1577
- start: this.startOAuthFlow(E.Microsoft)
1616
+ start: this.startOAuthFlow(C.Microsoft)
1578
1617
  }, this.github = {
1579
- start: this.startOAuthFlow(E.Github)
1618
+ start: this.startOAuthFlow(C.Github)
1580
1619
  }, this.gitlab = {
1581
- start: this.startOAuthFlow(E.GitLab)
1620
+ start: this.startOAuthFlow(C.GitLab)
1582
1621
  }, this.facebook = {
1583
- start: this.startOAuthFlow(E.Facebook)
1622
+ start: this.startOAuthFlow(C.Facebook)
1584
1623
  }, this.discord = {
1585
- start: this.startOAuthFlow(E.Discord)
1624
+ start: this.startOAuthFlow(C.Discord)
1586
1625
  }, this.salesforce = {
1587
- start: this.startOAuthFlow(E.Salesforce)
1626
+ start: this.startOAuthFlow(C.Salesforce)
1588
1627
  }, this.slack = {
1589
- start: this.startOAuthFlow(E.Slack)
1628
+ start: this.startOAuthFlow(C.Slack)
1590
1629
  }, this.amazon = {
1591
- start: this.startOAuthFlow(E.Amazon)
1630
+ start: this.startOAuthFlow(C.Amazon)
1592
1631
  }, this.bitbucket = {
1593
- start: this.startOAuthFlow(E.Bitbucket)
1632
+ start: this.startOAuthFlow(C.Bitbucket)
1594
1633
  }, this.linkedin = {
1595
- start: this.startOAuthFlow(E.LinkedIn)
1634
+ start: this.startOAuthFlow(C.LinkedIn)
1596
1635
  }, this.coinbase = {
1597
- start: this.startOAuthFlow(E.Coinbase)
1636
+ start: this.startOAuthFlow(C.Coinbase)
1598
1637
  }, this.twitch = {
1599
- start: this.startOAuthFlow(E.Twitch)
1638
+ start: this.startOAuthFlow(C.Twitch)
1600
1639
  }, this.twitter = {
1601
- start: this.startOAuthFlow(E.Twitter)
1640
+ start: this.startOAuthFlow(C.Twitter)
1602
1641
  }, this.tiktok = {
1603
- start: this.startOAuthFlow(E.TikTok)
1642
+ start: this.startOAuthFlow(C.TikTok)
1604
1643
  }, this.snapchat = {
1605
- start: this.startOAuthFlow(E.Snapchat)
1644
+ start: this.startOAuthFlow(C.Snapchat)
1606
1645
  }, this.figma = {
1607
- start: this.startOAuthFlow(E.Figma)
1646
+ start: this.startOAuthFlow(C.Figma)
1608
1647
  }, this.yahoo = {
1609
- start: this.startOAuthFlow(E.Yahoo)
1648
+ start: this.startOAuthFlow(C.Yahoo)
1610
1649
  };
1611
1650
  }
1612
1651
  return a(e, [{
1613
1652
  key: "authenticate",
1614
1653
  value: function value(e, t) {
1615
- return w(this, void 0, void 0, o().mark(function r() {
1654
+ return k(this, void 0, void 0, s().mark(function r() {
1616
1655
  var n, i;
1617
- return o().wrap(function (r) {
1656
+ return s().wrap(function (r) {
1618
1657
  for (;;) switch (r.prev = r.next) {
1619
1658
  case 0:
1620
1659
  return Z("stytch.oauth.authenticate").isString("Token", e).isNumber("session_duration_minutes", t.session_duration_minutes), r.next = 3, this._pkceManager.getPKPair();
@@ -1648,9 +1687,9 @@ var V = ["[Stytch]"],
1648
1687
  }, {
1649
1688
  key: "getBaseApiUrl",
1650
1689
  value: function value() {
1651
- return w(this, void 0, void 0, o().mark(function e() {
1690
+ return k(this, void 0, void 0, s().mark(function e() {
1652
1691
  var t, r;
1653
- return o().wrap(function (e) {
1692
+ return s().wrap(function (e) {
1654
1693
  for (;;) switch (e.prev = e.next) {
1655
1694
  case 0:
1656
1695
  return e.next = 2, this._dynamicConfig;
@@ -1683,10 +1722,10 @@ var V = ["[Stytch]"],
1683
1722
  var r = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {},
1684
1723
  n = r.login_redirect_url,
1685
1724
  i = r.signup_redirect_url,
1686
- s = r.custom_scopes;
1687
- return w(t, void 0, void 0, o().mark(function t() {
1725
+ o = r.custom_scopes;
1726
+ return k(t, void 0, void 0, s().mark(function t() {
1688
1727
  var r, a, c, u, l, d;
1689
- return o().wrap(function (t) {
1728
+ return s().wrap(function (t) {
1690
1729
  for (;;) switch (t.prev = t.next) {
1691
1730
  case 0:
1692
1731
  return t.next = 2, this._dynamicConfig;
@@ -1697,7 +1736,7 @@ var V = ["[Stytch]"],
1697
1736
  name: "start_oauth_flow",
1698
1737
  details: {
1699
1738
  provider_type: e,
1700
- custom_scopes: s,
1739
+ custom_scopes: o,
1701
1740
  cname_domain: a,
1702
1741
  pkce: c
1703
1742
  }
@@ -1712,7 +1751,7 @@ var V = ["[Stytch]"],
1712
1751
  case 18:
1713
1752
  this._pkceManager.clearPKPair();
1714
1753
  case 19:
1715
- s && (Z("startOAuthFlow").isStringArray("custom_scopes", s), l.searchParams.set("custom_scopes", s.join(" "))), n && l.searchParams.set("login_redirect_url", n), i && l.searchParams.set("signup_redirect_url", i), window.location.href = l.toString();
1754
+ o && (Z("startOAuthFlow").isStringArray("custom_scopes", o), l.searchParams.set("custom_scopes", o.join(" "))), n && l.searchParams.set("login_redirect_url", n), i && l.searchParams.set("signup_redirect_url", i), window.location.href = l.toString();
1716
1755
  case 23:
1717
1756
  case "end":
1718
1757
  return t.stop();
@@ -1733,9 +1772,9 @@ var V = ["[Stytch]"],
1733
1772
  return a(e, [{
1734
1773
  key: "authenticateStart",
1735
1774
  value: function value(e) {
1736
- return w(this, void 0, void 0, o().mark(function t() {
1775
+ return k(this, void 0, void 0, s().mark(function t() {
1737
1776
  var r, n, i;
1738
- return o().wrap(function (t) {
1777
+ return s().wrap(function (t) {
1739
1778
  for (;;) switch (t.prev = t.next) {
1740
1779
  case 0:
1741
1780
  return Z("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();
@@ -1760,9 +1799,9 @@ var V = ["[Stytch]"],
1760
1799
  }, {
1761
1800
  key: "authenticate",
1762
1801
  value: function value(e) {
1763
- return w(this, void 0, void 0, o().mark(function t() {
1802
+ return k(this, void 0, void 0, s().mark(function t() {
1764
1803
  var r;
1765
- return o().wrap(function (t) {
1804
+ return s().wrap(function (t) {
1766
1805
  for (;;) switch (t.prev = t.next) {
1767
1806
  case 0:
1768
1807
  return Z("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._networkClient.fetchSDK({
@@ -1802,9 +1841,9 @@ var V = ["[Stytch]"],
1802
1841
  return a(e, [{
1803
1842
  key: "create",
1804
1843
  value: function value(e) {
1805
- return w(this, void 0, void 0, o().mark(function t() {
1844
+ return k(this, void 0, void 0, s().mark(function t() {
1806
1845
  var r;
1807
- return o().wrap(function (t) {
1846
+ return s().wrap(function (t) {
1808
1847
  for (;;) switch (t.prev = t.next) {
1809
1848
  case 0:
1810
1849
  return Z("stytch.totps.create").isNumber("expiration_minutes", e.expiration_minutes), t.next = 3, this._networkClient.fetchSDK({
@@ -1827,9 +1866,9 @@ var V = ["[Stytch]"],
1827
1866
  }, {
1828
1867
  key: "authenticate",
1829
1868
  value: function value(e) {
1830
- return w(this, void 0, void 0, o().mark(function t() {
1869
+ return k(this, void 0, void 0, s().mark(function t() {
1831
1870
  var r;
1832
- return o().wrap(function (t) {
1871
+ return s().wrap(function (t) {
1833
1872
  for (;;) switch (t.prev = t.next) {
1834
1873
  case 0:
1835
1874
  return Z("stytch.totps.authenticate").isNumber("session_duration_minutes", e.session_duration_minutes).isString("totp_code", e.totp_code), t.next = 3, this._networkClient.fetchSDK({
@@ -1861,8 +1900,8 @@ var V = ["[Stytch]"],
1861
1900
  }, {
1862
1901
  key: "recoveryCodes",
1863
1902
  value: function value() {
1864
- return w(this, void 0, void 0, o().mark(function e() {
1865
- return o().wrap(function (e) {
1903
+ return k(this, void 0, void 0, s().mark(function e() {
1904
+ return s().wrap(function (e) {
1866
1905
  for (;;) switch (e.prev = e.next) {
1867
1906
  case 0:
1868
1907
  return e.abrupt("return", this._networkClient.fetchSDK({
@@ -1880,9 +1919,9 @@ var V = ["[Stytch]"],
1880
1919
  }, {
1881
1920
  key: "recover",
1882
1921
  value: function value(e) {
1883
- return w(this, void 0, void 0, o().mark(function t() {
1922
+ return k(this, void 0, void 0, s().mark(function t() {
1884
1923
  var r;
1885
- return o().wrap(function (t) {
1924
+ return s().wrap(function (t) {
1886
1925
  for (;;) switch (t.prev = t.next) {
1887
1926
  case 0:
1888
1927
  return Z("stytch.totps.recover").isNumber("session_duration_minutes", e.session_duration_minutes).isString("recovery_code", e.recovery_code), t.next = 3, this._networkClient.fetchSDK({
@@ -1914,7 +1953,7 @@ var V = ["[Stytch]"],
1914
1953
  }]), e;
1915
1954
  }();
1916
1955
  function he(e) {
1917
- 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), o = new Uint8Array(i), s = 0; s < n.length; s++) o[s] = n.charCodeAt(s);
1956
+ 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);
1918
1957
  return i;
1919
1958
  }
1920
1959
  function pe(t) {
@@ -1923,8 +1962,8 @@ function pe(t) {
1923
1962
  i = e(new Uint8Array(t));
1924
1963
  try {
1925
1964
  for (i.s(); !(r = i.n()).done;) {
1926
- var o = r.value;
1927
- n += String.fromCharCode(o);
1965
+ var s = r.value;
1966
+ n += String.fromCharCode(s);
1928
1967
  }
1929
1968
  } catch (e) {
1930
1969
  i.e(e);
@@ -1935,137 +1974,137 @@ function pe(t) {
1935
1974
  }
1936
1975
  var fe = "copy",
1937
1976
  _e = "convert";
1938
- function me(e, r, n) {
1977
+ function ve(e, r, n) {
1939
1978
  if (r === fe) return n;
1940
1979
  if (r === _e) return e(n);
1941
1980
  if (r instanceof Array) return n.map(function (t) {
1942
- return me(e, r[0], t);
1981
+ return ve(e, r[0], t);
1943
1982
  });
1944
1983
  if (r instanceof Object) {
1945
- for (var i = {}, o = 0, s = Object.entries(r); o < s.length; o++) {
1946
- var a = t(s[o], 2),
1984
+ for (var i = {}, s = 0, o = Object.entries(r); s < o.length; s++) {
1985
+ var a = t(o[s], 2),
1947
1986
  c = a[0],
1948
1987
  u = a[1];
1949
1988
  if (u.derive) {
1950
1989
  var l = u.derive(n);
1951
1990
  void 0 !== l && (n[c] = l);
1952
1991
  }
1953
- if (c in n) null != n[c] ? i[c] = me(e, u.schema, n[c]) : i[c] = null;else if (u.required) throw new Error("Missing key: ".concat(c));
1992
+ if (c in n) null != n[c] ? i[c] = ve(e, u.schema, n[c]) : i[c] = null;else if (u.required) throw new Error("Missing key: ".concat(c));
1954
1993
  }
1955
1994
  return i;
1956
1995
  }
1957
1996
  }
1958
- function ve(e, t) {
1997
+ function me(e, t) {
1959
1998
  return {
1960
1999
  required: !0,
1961
2000
  schema: e,
1962
2001
  derive: t
1963
2002
  };
1964
2003
  }
1965
- function ge(e) {
2004
+ function ye(e) {
1966
2005
  return {
1967
2006
  required: !0,
1968
2007
  schema: e
1969
2008
  };
1970
2009
  }
1971
- function ye(e) {
2010
+ function ge(e) {
1972
2011
  return {
1973
2012
  required: !1,
1974
2013
  schema: e
1975
2014
  };
1976
2015
  }
1977
2016
  var be = {
1978
- type: ge(fe),
1979
- id: ge(_e),
1980
- transports: ye(fe)
1981
- },
1982
- we = {
1983
- appid: ye(fe),
1984
- appidExclude: ye(fe),
1985
- credProps: ye(fe)
2017
+ type: ye(fe),
2018
+ id: ye(_e),
2019
+ transports: ge(fe)
1986
2020
  },
1987
2021
  ke = {
1988
- appid: ye(fe),
1989
- appidExclude: ye(fe),
1990
- credProps: ye(fe)
2022
+ appid: ge(fe),
2023
+ appidExclude: ge(fe),
2024
+ credProps: ge(fe)
2025
+ },
2026
+ we = {
2027
+ appid: ge(fe),
2028
+ appidExclude: ge(fe),
2029
+ credProps: ge(fe)
1991
2030
  },
1992
2031
  Se = {
1993
- publicKey: ge({
1994
- rp: ge(fe),
1995
- user: ge({
1996
- id: ge(_e),
1997
- name: ge(fe),
1998
- displayName: ge(fe)
2032
+ publicKey: ye({
2033
+ rp: ye(fe),
2034
+ user: ye({
2035
+ id: ye(_e),
2036
+ name: ye(fe),
2037
+ displayName: ye(fe)
1999
2038
  }),
2000
- challenge: ge(_e),
2001
- pubKeyCredParams: ge(fe),
2002
- timeout: ye(fe),
2003
- excludeCredentials: ye([be]),
2004
- authenticatorSelection: ye(fe),
2005
- attestation: ye(fe),
2006
- extensions: ye(we)
2039
+ challenge: ye(_e),
2040
+ pubKeyCredParams: ye(fe),
2041
+ timeout: ge(fe),
2042
+ excludeCredentials: ge([be]),
2043
+ authenticatorSelection: ge(fe),
2044
+ attestation: ge(fe),
2045
+ extensions: ge(ke)
2007
2046
  }),
2008
- signal: ye(fe)
2047
+ signal: ge(fe)
2009
2048
  },
2010
2049
  Te = {
2011
- type: ge(fe),
2012
- id: ge(fe),
2013
- rawId: ge(_e),
2014
- authenticatorAttachment: ye(fe),
2015
- response: ge({
2016
- clientDataJSON: ge(_e),
2017
- attestationObject: ge(_e),
2018
- transports: ve(fe, function (e) {
2050
+ type: ye(fe),
2051
+ id: ye(fe),
2052
+ rawId: ye(_e),
2053
+ authenticatorAttachment: ge(fe),
2054
+ response: ye({
2055
+ clientDataJSON: ye(_e),
2056
+ attestationObject: ye(_e),
2057
+ transports: me(fe, function (e) {
2019
2058
  var t;
2020
2059
  return (null == (t = e.getTransports) ? void 0 : t.call(e)) || [];
2021
2060
  })
2022
2061
  }),
2023
- clientExtensionResults: ve(ke, function (e) {
2062
+ clientExtensionResults: me(we, function (e) {
2024
2063
  return e.getClientExtensionResults();
2025
2064
  })
2026
2065
  },
2027
2066
  Oe = {
2028
- mediation: ye(fe),
2029
- publicKey: ge({
2030
- challenge: ge(_e),
2031
- timeout: ye(fe),
2032
- rpId: ye(fe),
2033
- allowCredentials: ye([be]),
2034
- userVerification: ye(fe),
2035
- extensions: ye(we)
2067
+ mediation: ge(fe),
2068
+ publicKey: ye({
2069
+ challenge: ye(_e),
2070
+ timeout: ge(fe),
2071
+ rpId: ge(fe),
2072
+ allowCredentials: ge([be]),
2073
+ userVerification: ge(fe),
2074
+ extensions: ge(ke)
2036
2075
  }),
2037
- signal: ye(fe)
2076
+ signal: ge(fe)
2038
2077
  },
2039
- Ee = {
2040
- type: ge(fe),
2041
- id: ge(fe),
2042
- rawId: ge(_e),
2043
- authenticatorAttachment: ye(fe),
2044
- response: ge({
2045
- clientDataJSON: ge(_e),
2046
- authenticatorData: ge(_e),
2047
- signature: ge(_e),
2048
- userHandle: ge(_e)
2078
+ Ce = {
2079
+ type: ye(fe),
2080
+ id: ye(fe),
2081
+ rawId: ye(_e),
2082
+ authenticatorAttachment: ge(fe),
2083
+ response: ye({
2084
+ clientDataJSON: ye(_e),
2085
+ authenticatorData: ye(_e),
2086
+ signature: ye(_e),
2087
+ userHandle: ye(_e)
2049
2088
  }),
2050
- clientExtensionResults: ve(ke, function (e) {
2089
+ clientExtensionResults: me(we, function (e) {
2051
2090
  return e.getClientExtensionResults();
2052
2091
  })
2053
2092
  };
2054
- function Ce(e) {
2055
- return me(he, Se, e);
2056
- }
2057
- function Ae(e) {
2058
- return me(pe, Te, e);
2093
+ function Ee(e) {
2094
+ return ve(he, Se, e);
2059
2095
  }
2060
2096
  function xe(e) {
2061
- return w(this, void 0, void 0, o().mark(function t() {
2097
+ return ve(pe, Te, e);
2098
+ }
2099
+ function Ae(e) {
2100
+ return k(this, void 0, void 0, s().mark(function t() {
2062
2101
  var r;
2063
- return o().wrap(function (t) {
2102
+ return s().wrap(function (t) {
2064
2103
  for (;;) switch (t.prev = t.next) {
2065
2104
  case 0:
2066
- return t.next = 2, navigator.credentials.create(Ce(e));
2105
+ return t.next = 2, navigator.credentials.create(Ee(e));
2067
2106
  case 2:
2068
- return r = t.sent, t.abrupt("return", Ae(r));
2107
+ return r = t.sent, t.abrupt("return", xe(r));
2069
2108
  case 4:
2070
2109
  case "end":
2071
2110
  return t.stop();
@@ -2074,15 +2113,15 @@ function xe(e) {
2074
2113
  }));
2075
2114
  }
2076
2115
  function Pe(e) {
2077
- return me(he, Oe, e);
2116
+ return ve(he, Oe, e);
2078
2117
  }
2079
2118
  function Re(e) {
2080
- return me(pe, Ee, e);
2119
+ return ve(pe, Ce, e);
2081
2120
  }
2082
- function Be(e) {
2083
- return w(this, void 0, void 0, o().mark(function t() {
2121
+ function De(e) {
2122
+ return k(this, void 0, void 0, s().mark(function t() {
2084
2123
  var r;
2085
- return o().wrap(function (t) {
2124
+ return s().wrap(function (t) {
2086
2125
  for (;;) switch (t.prev = t.next) {
2087
2126
  case 0:
2088
2127
  return t.next = 2, navigator.credentials.get(Pe(e));
@@ -2095,7 +2134,8 @@ function Be(e) {
2095
2134
  }, t);
2096
2135
  }));
2097
2136
  }
2098
- var Ie = function () {
2137
+ var Be,
2138
+ Ie = function () {
2099
2139
  function e(t, r) {
2100
2140
  c(this, e), this._networkClient = t, this._subscriptionService = r;
2101
2141
  }
@@ -2103,9 +2143,9 @@ var Ie = function () {
2103
2143
  key: "register",
2104
2144
  value: function value(e) {
2105
2145
  var t;
2106
- return w(this, void 0, void 0, o().mark(function r() {
2107
- var n, i, s, a;
2108
- return o().wrap(function (r) {
2146
+ return k(this, void 0, void 0, s().mark(function r() {
2147
+ var n, i, o, a;
2148
+ return s().wrap(function (r) {
2109
2149
  for (;;) switch (r.prev = r.next) {
2110
2150
  case 0:
2111
2151
  return Z("stytch.webauthn.register").isOptionalString("domain", null == e ? void 0 : e.domain).isOptionalString("authenticator_type", null == e ? void 0 : e.authenticator_type), r.next = 3, this._networkClient.fetchSDK({
@@ -2118,16 +2158,16 @@ var Ie = function () {
2118
2158
  }
2119
2159
  });
2120
2160
  case 3:
2121
- return n = r.sent, i = n.public_key_credential_creation_options, r.next = 7, xe({
2161
+ return n = r.sent, i = n.public_key_credential_creation_options, r.next = 7, Ae({
2122
2162
  publicKey: JSON.parse(i)
2123
2163
  });
2124
2164
  case 7:
2125
- return s = r.sent, r.next = 10, this._networkClient.fetchSDK({
2165
+ return o = r.sent, r.next = 10, this._networkClient.fetchSDK({
2126
2166
  url: "/webauthn/register",
2127
2167
  method: "POST",
2128
2168
  errorMessage: "Failed to register WebAuthn device",
2129
2169
  body: {
2130
- public_key_credential: JSON.stringify(s)
2170
+ public_key_credential: JSON.stringify(o)
2131
2171
  }
2132
2172
  });
2133
2173
  case 10:
@@ -2143,9 +2183,9 @@ var Ie = function () {
2143
2183
  key: "authenticate",
2144
2184
  value: function value(e) {
2145
2185
  var t;
2146
- return w(this, void 0, void 0, o().mark(function r() {
2147
- var n, i, s, a;
2148
- return o().wrap(function (r) {
2186
+ return k(this, void 0, void 0, s().mark(function r() {
2187
+ var n, i, o, a;
2188
+ return s().wrap(function (r) {
2149
2189
  for (;;) switch (r.prev = r.next) {
2150
2190
  case 0:
2151
2191
  return Z("stytch.webauthn.register").isOptionalString("domain", e.domain).isNumber("session_duration_minutes", e.session_duration_minutes), r.next = 3, this._networkClient.fetchSDK({
@@ -2157,16 +2197,16 @@ var Ie = function () {
2157
2197
  }
2158
2198
  });
2159
2199
  case 3:
2160
- return n = r.sent, i = n.public_key_credential_request_options, r.next = 7, Be({
2200
+ return n = r.sent, i = n.public_key_credential_request_options, r.next = 7, De({
2161
2201
  publicKey: JSON.parse(i)
2162
2202
  });
2163
2203
  case 7:
2164
- return s = r.sent, r.next = 10, this._networkClient.fetchSDK({
2204
+ return o = r.sent, r.next = 10, this._networkClient.fetchSDK({
2165
2205
  url: "/webauthn/authenticate",
2166
2206
  method: "POST",
2167
2207
  errorMessage: "Failed to authenticate WebAuthn device",
2168
2208
  body: {
2169
- public_key_credential: JSON.stringify(s),
2209
+ public_key_credential: JSON.stringify(o),
2170
2210
  session_duration_minutes: e.session_duration_minutes
2171
2211
  }
2172
2212
  });
@@ -2189,24 +2229,62 @@ var Ie = function () {
2189
2229
  }
2190
2230
  }]), e;
2191
2231
  }(),
2192
- De = Promise.resolve({
2232
+ Le = Promise.resolve({
2193
2233
  pkceRequiredForPasswordResets: !1
2194
2234
  }),
2195
- Le = function () {
2235
+ je = function () {
2196
2236
  function e(t, r, n) {
2197
- var i = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : De,
2198
- o = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : function () {
2237
+ var i = this,
2238
+ o = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : Le,
2239
+ a = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : function () {
2199
2240
  return Promise.resolve(void 0);
2200
2241
  },
2201
- s = arguments.length > 5 ? arguments[5] : void 0;
2202
- c(this, e), this._networkClient = t, this._subscriptionService = r, this._pkceManager = n, this._config = i, this.executeRecaptcha = o, this._dfpProtectedAuth = s;
2242
+ u = arguments.length > 5 ? arguments[5] : void 0;
2243
+ c(this, e), this._networkClient = t, this._subscriptionService = r, this._pkceManager = n, this._config = o, this.executeRecaptcha = a, this._dfpProtectedAuth = u, this.retryWithCaptchaAndDFP = function (e, t) {
2244
+ return k(i, void 0, void 0, s().mark(function r() {
2245
+ var n, i;
2246
+ return s().wrap(function (r) {
2247
+ for (;;) switch (r.prev = r.next) {
2248
+ case 0:
2249
+ if (n = this._dfpProtectedAuth, r.t0 = n, !r.t0) {
2250
+ r.next = 6;
2251
+ break;
2252
+ }
2253
+ return r.next = 5, n.isEnabled();
2254
+ case 5:
2255
+ r.t0 = r.sent;
2256
+ case 6:
2257
+ if (i = r.t0, e.type !== Be.RequiredCatcha || !i) {
2258
+ r.next = 16;
2259
+ break;
2260
+ }
2261
+ if (!t.body) {
2262
+ r.next = 15;
2263
+ break;
2264
+ }
2265
+ return r.next = 11, n.getTelemetryID();
2266
+ case 11:
2267
+ return t.body.dfp_telemetry_id = r.sent, r.next = 14, this.executeRecaptcha();
2268
+ case 14:
2269
+ t.body.captcha_token = r.sent;
2270
+ case 15:
2271
+ return r.abrupt("return", t);
2272
+ case 16:
2273
+ throw new Error("Unable to query captcha and/or dfp telemetry ID");
2274
+ case 17:
2275
+ case "end":
2276
+ return r.stop();
2277
+ }
2278
+ }, r, this);
2279
+ }));
2280
+ };
2203
2281
  }
2204
2282
  return a(e, [{
2205
2283
  key: "getCodeChallenge",
2206
2284
  value: function value() {
2207
- return w(this, void 0, void 0, o().mark(function e() {
2285
+ return k(this, void 0, void 0, s().mark(function e() {
2208
2286
  var t, r;
2209
- return o().wrap(function (e) {
2287
+ return s().wrap(function (e) {
2210
2288
  for (;;) switch (e.prev = e.next) {
2211
2289
  case 0:
2212
2290
  return e.next = 2, this._config;
@@ -2238,9 +2316,9 @@ var Ie = function () {
2238
2316
  }, {
2239
2317
  key: "getDFPTelemetryIDAndCaptcha",
2240
2318
  value: function value() {
2241
- return w(this, void 0, void 0, o().mark(function e() {
2319
+ return k(this, void 0, void 0, s().mark(function e() {
2242
2320
  var t, r;
2243
- return o().wrap(function (e) {
2321
+ return s().wrap(function (e) {
2244
2322
  for (;;) switch (e.prev = e.next) {
2245
2323
  case 0:
2246
2324
  if (t = void 0, r = void 0, e.t0 = this._dfpProtectedAuth, !e.t0) {
@@ -2278,14 +2356,14 @@ var Ie = function () {
2278
2356
  }, {
2279
2357
  key: "create",
2280
2358
  value: function value(e) {
2281
- return w(this, void 0, void 0, o().mark(function t() {
2282
- var r, n, i, s;
2283
- return o().wrap(function (t) {
2359
+ return k(this, void 0, void 0, s().mark(function t() {
2360
+ var r, n, i, o;
2361
+ return s().wrap(function (t) {
2284
2362
  for (;;) switch (t.prev = t.next) {
2285
2363
  case 0:
2286
2364
  return Z("stytch.passwords.create").isString("password", e.password).isString("email", e.email).isNumber("session_duration_minutes", e.session_duration_minutes), t.next = 3, this.getDFPTelemetryIDAndCaptcha();
2287
2365
  case 3:
2288
- return r = t.sent, n = r.dfp_telemetry_id, i = r.captcha_token, t.next = 8, this._networkClient.fetchSDK({
2366
+ return r = t.sent, n = r.dfp_telemetry_id, i = r.captcha_token, t.next = 8, this._networkClient.retriableFetchSDK({
2289
2367
  url: "/passwords",
2290
2368
  method: "POST",
2291
2369
  errorMessage: "Failed to create password.",
@@ -2295,18 +2373,19 @@ var Ie = function () {
2295
2373
  session_duration_minutes: e.session_duration_minutes,
2296
2374
  captcha_token: i,
2297
2375
  dfp_telemetry_id: n
2298
- }
2376
+ },
2377
+ retryCallback: this.retryWithCaptchaAndDFP
2299
2378
  });
2300
2379
  case 8:
2301
- return s = t.sent, this._subscriptionService.updateStateAndTokens({
2380
+ return o = t.sent, this._subscriptionService.updateStateAndTokens({
2302
2381
  state: {
2303
- session: s.session,
2304
- user: s.user
2382
+ session: o.session,
2383
+ user: o.user
2305
2384
  },
2306
- session_token: s.session_token,
2307
- session_jwt: s.session_jwt,
2385
+ session_token: o.session_token,
2386
+ session_jwt: o.session_jwt,
2308
2387
  intermediate_session_token: null
2309
- }), t.abrupt("return", ee(s));
2388
+ }), t.abrupt("return", ee(o));
2310
2389
  case 11:
2311
2390
  case "end":
2312
2391
  return t.stop();
@@ -2317,14 +2396,14 @@ var Ie = function () {
2317
2396
  }, {
2318
2397
  key: "authenticate",
2319
2398
  value: function value(e) {
2320
- return w(this, void 0, void 0, o().mark(function t() {
2321
- var r, n, i, s;
2322
- return o().wrap(function (t) {
2399
+ return k(this, void 0, void 0, s().mark(function t() {
2400
+ var r, n, i, o;
2401
+ return s().wrap(function (t) {
2323
2402
  for (;;) switch (t.prev = t.next) {
2324
2403
  case 0:
2325
2404
  return Z("stytch.passwords.authenticate").isString("password", e.password).isString("email", e.email).isNumber("session_duration_minutes", e.session_duration_minutes), t.next = 3, this.getDFPTelemetryIDAndCaptcha();
2326
2405
  case 3:
2327
- return r = t.sent, n = r.dfp_telemetry_id, i = r.captcha_token, t.next = 8, this._networkClient.fetchSDK({
2406
+ return r = t.sent, n = r.dfp_telemetry_id, i = r.captcha_token, t.next = 8, this._networkClient.retriableFetchSDK({
2328
2407
  url: "/passwords/authenticate",
2329
2408
  method: "POST",
2330
2409
  errorMessage: "Failed to authenticate password.",
@@ -2334,18 +2413,19 @@ var Ie = function () {
2334
2413
  session_duration_minutes: e.session_duration_minutes,
2335
2414
  captcha_token: i,
2336
2415
  dfp_telemetry_id: n
2337
- }
2416
+ },
2417
+ retryCallback: this.retryWithCaptchaAndDFP
2338
2418
  });
2339
2419
  case 8:
2340
- return s = t.sent, this._subscriptionService.updateStateAndTokens({
2420
+ return o = t.sent, this._subscriptionService.updateStateAndTokens({
2341
2421
  state: {
2342
- session: s.session,
2343
- user: s.user
2422
+ session: o.session,
2423
+ user: o.user
2344
2424
  },
2345
- session_token: s.session_token,
2346
- session_jwt: s.session_jwt,
2425
+ session_token: o.session_token,
2426
+ session_jwt: o.session_jwt,
2347
2427
  intermediate_session_token: null
2348
- }), t.abrupt("return", ee(s));
2428
+ }), t.abrupt("return", ee(o));
2349
2429
  case 11:
2350
2430
  case "end":
2351
2431
  return t.stop();
@@ -2356,16 +2436,16 @@ var Ie = function () {
2356
2436
  }, {
2357
2437
  key: "resetByEmailStart",
2358
2438
  value: function value(e) {
2359
- return w(this, void 0, void 0, o().mark(function t() {
2360
- var r, n, i, s;
2361
- return o().wrap(function (t) {
2439
+ return k(this, void 0, void 0, s().mark(function t() {
2440
+ var r, n, i, o;
2441
+ return s().wrap(function (t) {
2362
2442
  for (;;) switch (t.prev = t.next) {
2363
2443
  case 0:
2364
2444
  return Z("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();
2365
2445
  case 3:
2366
2446
  return r = t.sent, t.next = 6, this.getDFPTelemetryIDAndCaptcha();
2367
2447
  case 6:
2368
- return n = t.sent, i = n.dfp_telemetry_id, s = n.captcha_token, t.abrupt("return", this._networkClient.fetchSDK({
2448
+ return n = t.sent, i = n.dfp_telemetry_id, o = n.captcha_token, t.abrupt("return", this._networkClient.retriableFetchSDK({
2369
2449
  url: "/passwords/email/reset/start",
2370
2450
  method: "POST",
2371
2451
  errorMessage: "Failed to start password reset flow.",
@@ -2376,9 +2456,10 @@ var Ie = function () {
2376
2456
  reset_password_expiration_minutes: e.reset_password_expiration_minutes,
2377
2457
  reset_password_template_id: e.reset_password_template_id,
2378
2458
  code_challenge: r,
2379
- captcha_token: s,
2459
+ captcha_token: o,
2380
2460
  dfp_telemetry_id: i
2381
- }
2461
+ },
2462
+ retryCallback: this.retryWithCaptchaAndDFP
2382
2463
  }));
2383
2464
  case 10:
2384
2465
  case "end":
@@ -2390,16 +2471,16 @@ var Ie = function () {
2390
2471
  }, {
2391
2472
  key: "resetByEmail",
2392
2473
  value: function value(e) {
2393
- return w(this, void 0, void 0, o().mark(function t() {
2394
- var r, n, i, s, a, c;
2395
- return o().wrap(function (t) {
2474
+ return k(this, void 0, void 0, s().mark(function t() {
2475
+ var r, n, i, o, a, c;
2476
+ return s().wrap(function (t) {
2396
2477
  for (;;) switch (t.prev = t.next) {
2397
2478
  case 0:
2398
2479
  return Z("stytch.passwords.resetByEmail").isString("token", e.token).isString("password", e.password).isNumber("session_duration_minutes", e.session_duration_minutes), t.next = 3, this.getDFPTelemetryIDAndCaptcha();
2399
2480
  case 3:
2400
2481
  return r = t.sent, n = r.dfp_telemetry_id, i = r.captcha_token, t.next = 8, this._pkceManager.getPKPair();
2401
2482
  case 8:
2402
- return s = t.sent, a = null == s ? void 0 : s.code_verifier, t.next = 12, this._networkClient.fetchSDK({
2483
+ return o = t.sent, a = null == o ? void 0 : o.code_verifier, t.next = 12, this._networkClient.retriableFetchSDK({
2403
2484
  url: "/passwords/email/reset",
2404
2485
  method: "POST",
2405
2486
  errorMessage: "Failed to reset password.",
@@ -2410,7 +2491,8 @@ var Ie = function () {
2410
2491
  captcha_token: i,
2411
2492
  code_verifier: a,
2412
2493
  dfp_telemetry_id: n
2413
- }
2494
+ },
2495
+ retryCallback: this.retryWithCaptchaAndDFP
2414
2496
  });
2415
2497
  case 12:
2416
2498
  return c = t.sent, this._pkceManager.clearPKPair(), this._subscriptionService.updateStateAndTokens({
@@ -2432,9 +2514,9 @@ var Ie = function () {
2432
2514
  }, {
2433
2515
  key: "resetByExistingPassword",
2434
2516
  value: function value(e) {
2435
- return w(this, void 0, void 0, o().mark(function t() {
2517
+ return k(this, void 0, void 0, s().mark(function t() {
2436
2518
  var r;
2437
- return o().wrap(function (t) {
2519
+ return s().wrap(function (t) {
2438
2520
  for (;;) switch (t.prev = t.next) {
2439
2521
  case 0:
2440
2522
  return Z("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._networkClient.fetchSDK({
@@ -2449,8 +2531,16 @@ var Ie = function () {
2449
2531
  }
2450
2532
  });
2451
2533
  case 3:
2452
- return r = t.sent, t.abrupt("return", ee(r));
2453
- case 5:
2534
+ return r = t.sent, this._subscriptionService.updateStateAndTokens({
2535
+ state: {
2536
+ session: r.session,
2537
+ user: r.user
2538
+ },
2539
+ session_token: r.session_token,
2540
+ session_jwt: r.session_jwt,
2541
+ intermediate_session_token: null
2542
+ }), t.abrupt("return", ee(r));
2543
+ case 6:
2454
2544
  case "end":
2455
2545
  return t.stop();
2456
2546
  }
@@ -2460,8 +2550,9 @@ var Ie = function () {
2460
2550
  }, {
2461
2551
  key: "resetBySession",
2462
2552
  value: function value(e) {
2463
- return w(this, void 0, void 0, o().mark(function t() {
2464
- return o().wrap(function (t) {
2553
+ return k(this, void 0, void 0, s().mark(function t() {
2554
+ var r;
2555
+ return s().wrap(function (t) {
2465
2556
  for (;;) switch (t.prev = t.next) {
2466
2557
  case 0:
2467
2558
  return Z("stytch.passwords.resetBySession").isString("password", e.password), t.next = 3, this._networkClient.fetchSDK({
@@ -2473,8 +2564,16 @@ var Ie = function () {
2473
2564
  }
2474
2565
  });
2475
2566
  case 3:
2476
- return t.abrupt("return", t.sent);
2477
- case 4:
2567
+ return r = t.sent, this._subscriptionService.updateStateAndTokens({
2568
+ state: {
2569
+ session: r.session,
2570
+ user: r.user
2571
+ },
2572
+ session_token: r.session_token,
2573
+ session_jwt: r.session_jwt,
2574
+ intermediate_session_token: null
2575
+ }), t.abrupt("return", r);
2576
+ case 6:
2478
2577
  case "end":
2479
2578
  return t.stop();
2480
2579
  }
@@ -2484,8 +2583,8 @@ var Ie = function () {
2484
2583
  }, {
2485
2584
  key: "strengthCheck",
2486
2585
  value: function value(e) {
2487
- return w(this, void 0, void 0, o().mark(function t() {
2488
- return o().wrap(function (t) {
2586
+ return k(this, void 0, void 0, s().mark(function t() {
2587
+ return s().wrap(function (t) {
2489
2588
  for (;;) switch (t.prev = t.next) {
2490
2589
  case 0:
2491
2590
  return Z("stytch.passwords.strengthCheck").isOptionalString("email", e.email).isString("password", e.password), t.abrupt("return", this._networkClient.fetchSDK({
@@ -2510,8 +2609,103 @@ Promise.resolve({
2510
2609
  pkceRequiredForEmailMagicLinks: !1
2511
2610
  }), Promise.resolve({
2512
2611
  pkceRequiredForPasswordResets: !1
2513
- });
2514
- var je = function () {
2612
+ }), function (e) {
2613
+ e.RequiredCatcha = "Catcha Required";
2614
+ }(Be || (Be = {}));
2615
+ var Me = function (e) {
2616
+ u(r, h(Error));
2617
+ var t = l(r);
2618
+ function r(e) {
2619
+ var n;
2620
+ return c(this, r), (n = t.call(this, e)).type = e, n;
2621
+ }
2622
+ return a(r);
2623
+ }();
2624
+ function Ne(e) {
2625
+ var t = e.method,
2626
+ r = e.errorMessage,
2627
+ n = e.finalURL,
2628
+ i = e.basicAuthHeader,
2629
+ o = e.xSDKClientHeader,
2630
+ a = e.xSDKParentHostHeader,
2631
+ c = e.body;
2632
+ return k(this, void 0, void 0, s().mark(function e() {
2633
+ var u, l, d, h, p, f;
2634
+ return s().wrap(function (e) {
2635
+ for (;;) switch (e.prev = e.next) {
2636
+ case 0:
2637
+ return u = {
2638
+ Authorization: i,
2639
+ "Content-Type": "application/json",
2640
+ "X-SDK-Client": o
2641
+ }, a && (u["X-SDK-Parent-Host"] = a), l = {
2642
+ method: t,
2643
+ headers: u,
2644
+ body: c && JSON.stringify(c)
2645
+ }, e.prev = 3, e.next = 6, fetch(n, l);
2646
+ case 6:
2647
+ d = e.sent, e.next = 14;
2648
+ break;
2649
+ case 9:
2650
+ if (e.prev = 9, e.t0 = e["catch"](3), "Failed to fetch" !== e.t0.message) {
2651
+ e.next = 13;
2652
+ break;
2653
+ }
2654
+ throw new F(r, "Unable to contact the Stytch servers. Are you online?");
2655
+ case 13:
2656
+ throw e.t0;
2657
+ case 14:
2658
+ if (403 !== d.status) {
2659
+ e.next = 27;
2660
+ break;
2661
+ }
2662
+ return e.prev = 15, e.next = 18, d.text();
2663
+ case 18:
2664
+ h = e.sent, e.next = 24;
2665
+ break;
2666
+ case 21:
2667
+ throw e.prev = 21, e.t1 = e["catch"](15), new F(r, "Invalid response from the Stytch servers.");
2668
+ case 24:
2669
+ if (!h.includes("Captcha required")) {
2670
+ e.next = 26;
2671
+ break;
2672
+ }
2673
+ throw new Me(Be.RequiredCatcha);
2674
+ case 26:
2675
+ throw new F(r, "Invalid response from the Stytch servers.");
2676
+ case 27:
2677
+ if (200 === d.status) {
2678
+ e.next = 40;
2679
+ break;
2680
+ }
2681
+ return e.prev = 28, e.next = 31, d.json();
2682
+ case 31:
2683
+ p = e.sent, e.next = 37;
2684
+ break;
2685
+ case 34:
2686
+ throw e.prev = 34, e.t2 = e["catch"](28), new F(r, "Invalid or no response from server");
2687
+ case 37:
2688
+ if (!("body" in p || "params" in p || "query" in p)) {
2689
+ e.next = 39;
2690
+ break;
2691
+ }
2692
+ throw new K(p);
2693
+ case 39:
2694
+ throw new q(p);
2695
+ case 40:
2696
+ return e.prev = 40, e.next = 43, d.json();
2697
+ case 43:
2698
+ return f = e.sent, e.abrupt("return", f.data);
2699
+ case 47:
2700
+ throw e.prev = 47, e.t3 = e["catch"](40), new F(r, "Invalid response from the Stytch servers.");
2701
+ case 50:
2702
+ case "end":
2703
+ return e.stop();
2704
+ }
2705
+ }, e, null, [[3, 9], [15, 21], [28, 34], [40, 47]]);
2706
+ }));
2707
+ }
2708
+ var Fe = function () {
2515
2709
  function e(t) {
2516
2710
  c(this, e), this.iframeURL = t, this.createIframe();
2517
2711
  }
@@ -2530,26 +2724,26 @@ var je = function () {
2530
2724
  }, {
2531
2725
  key: "call",
2532
2726
  value: function value(e, t) {
2533
- return w(this, void 0, void 0, o().mark(function r() {
2727
+ return k(this, void 0, void 0, s().mark(function r() {
2534
2728
  var n,
2535
2729
  i,
2536
- s = this;
2537
- return o().wrap(function (r) {
2730
+ o = this;
2731
+ return s().wrap(function (r) {
2538
2732
  for (;;) switch (r.prev = r.next) {
2539
2733
  case 0:
2540
2734
  return r.next = 2, this.frame;
2541
2735
  case 2:
2542
- return n = r.sent, i = new MessageChannel(), r.abrupt("return", new Promise(function (r, o) {
2736
+ return n = r.sent, i = new MessageChannel(), r.abrupt("return", new Promise(function (r, s) {
2543
2737
  var a;
2544
2738
  i.port1.onmessage = function (e) {
2545
2739
  var t = e.data;
2546
- i.port1.close(), t.success ? r(t.payload) : o(re.unmarshall(t.error));
2740
+ i.port1.close(), t.success ? r(t.payload) : s(re.unmarshall(t.error));
2547
2741
  };
2548
2742
  var c = {
2549
2743
  method: e,
2550
2744
  args: t
2551
2745
  };
2552
- null === (a = n.contentWindow) || void 0 === a || a.postMessage(c, s.iframeURL, [i.port2]);
2746
+ null === (a = n.contentWindow) || void 0 === a || a.postMessage(c, o.iframeURL, [i.port2]);
2553
2747
  }));
2554
2748
  case 5:
2555
2749
  case "end":
@@ -2560,15 +2754,15 @@ var je = function () {
2560
2754
  }
2561
2755
  }]), e;
2562
2756
  }(),
2563
- Ne = function () {
2757
+ Ue = function () {
2564
2758
  function e(t, r) {
2565
2759
  var n = this;
2566
2760
  c(this, e), this._subscriptionService = t, this._headlessSessionClient = r, this._onDataChange = function (e) {
2567
2761
  (null == e ? void 0 : e.session) ? n.scheduleBackgroundRefresh() : n.cancelBackgroundRefresh();
2568
2762
  }, this._reauthenticateWithBackoff = function () {
2569
- return w(n, void 0, void 0, o().mark(function t() {
2763
+ return k(n, void 0, void 0, s().mark(function t() {
2570
2764
  var r;
2571
- return o().wrap(function (t) {
2765
+ return s().wrap(function (t) {
2572
2766
  for (;;) switch (t.prev = t.next) {
2573
2767
  case 0:
2574
2768
  r = 0;
@@ -2630,22 +2824,22 @@ var je = function () {
2630
2824
  }, {
2631
2825
  key: "isUnrecoverableError",
2632
2826
  value: function value(e) {
2633
- return G.includes(e.error_type);
2827
+ return W.includes(e.error_type);
2634
2828
  }
2635
2829
  }]), e;
2636
2830
  }();
2637
- Ne.REFRESH_INTERVAL_MS = 18e4;
2638
- var Me = "bootstrap";
2639
- var Ue = /*#__PURE__*/function () {
2640
- function Ue(e, t, r) {
2831
+ Ue.REFRESH_INTERVAL_MS = 18e4;
2832
+ var Ke = "bootstrap";
2833
+ var qe = /*#__PURE__*/function () {
2834
+ function qe(e, t, r) {
2641
2835
  var _this = this;
2642
- _classCallCheck(this, Ue);
2836
+ _classCallCheck(this, qe);
2643
2837
  this._publicToken = e, this._networkClient = t, this._dataLayer = r, this._bootstrapDataPromise = this._networkClient.fetchSDK({
2644
2838
  url: "/projects/bootstrap/".concat(this._publicToken),
2645
2839
  method: "GET",
2646
2840
  errorMessage: "Error fetching bootstrap data for SDK for ".concat(this._publicToken)
2647
- }).then(Ue.mapBootstrapData).then(function (e) {
2648
- return _this._dataLayer.setItem(Me, JSON.stringify(e)), e;
2841
+ }).then(qe.mapBootstrapData).then(function (e) {
2842
+ return _this._dataLayer.setItem(Ke, JSON.stringify(e)), e;
2649
2843
  })["catch"](function (e) {
2650
2844
  return $(e), {
2651
2845
  displayWatermark: !1,
@@ -2665,10 +2859,10 @@ var Ue = /*#__PURE__*/function () {
2665
2859
  };
2666
2860
  });
2667
2861
  }
2668
- _createClass(Ue, [{
2862
+ _createClass(qe, [{
2669
2863
  key: "getSync",
2670
2864
  value: function getSync() {
2671
- var e = this._dataLayer.getItem(Me);
2865
+ var e = this._dataLayer.getItem(Ke);
2672
2866
  if (null === e) return {
2673
2867
  displayWatermark: !1,
2674
2868
  cnameDomain: null,
@@ -2714,7 +2908,8 @@ var Ue = /*#__PURE__*/function () {
2714
2908
  }], [{
2715
2909
  key: "mapBootstrapData",
2716
2910
  value: function mapBootstrapData(e) {
2717
- var t = null !== e.password_config ? {
2911
+ var t;
2912
+ var r = null !== e.password_config ? {
2718
2913
  ludsComplexity: e.password_config.luds_complexity,
2719
2914
  ludsMinimumCount: e.password_config.luds_minimum_count
2720
2915
  } : null;
@@ -2729,43 +2924,43 @@ var Ue = /*#__PURE__*/function () {
2729
2924
  pkceRequiredForSso: e.pkce_required_for_sso,
2730
2925
  slugPattern: e.slug_pattern,
2731
2926
  createOrganizationEnabled: e.create_organization_enabled,
2732
- passwordConfig: t,
2733
- runDFPProtectedAuth: "ENABLED" === e.dfp_protected_auth_enabled || "PASSIVE" === e.dfp_protected_auth_enabled
2927
+ passwordConfig: r,
2928
+ runDFPProtectedAuth: null !== (t = e.dfp_protected_auth_enabled) && void 0 !== t && t
2734
2929
  };
2735
2930
  }
2736
2931
  }]);
2737
- return Ue;
2932
+ return qe;
2738
2933
  }();
2739
- function Fe(e, t, r, n) {
2740
- return new (r || (r = Promise))(function (i, o) {
2741
- function s(e) {
2934
+ function We(e, t, r, n) {
2935
+ return new (r || (r = Promise))(function (i, s) {
2936
+ function o(e) {
2742
2937
  try {
2743
2938
  c(n.next(e));
2744
2939
  } catch (e) {
2745
- o(e);
2940
+ s(e);
2746
2941
  }
2747
2942
  }
2748
2943
  function a(e) {
2749
2944
  try {
2750
2945
  c(n["throw"](e));
2751
2946
  } catch (e) {
2752
- o(e);
2947
+ s(e);
2753
2948
  }
2754
2949
  }
2755
2950
  function c(e) {
2756
2951
  var t;
2757
2952
  e.done ? i(e.value) : (t = e.value, t instanceof r ? t : new r(function (e) {
2758
2953
  e(t);
2759
- })).then(s, a);
2954
+ })).then(o, a);
2760
2955
  }
2761
2956
  c((n = n.apply(e, t || [])).next());
2762
2957
  });
2763
2958
  }
2764
- var Ke = /*#__PURE__*/_createClass(function Ke(e) {
2959
+ var Ge = /*#__PURE__*/_createClass(function Ge(e) {
2765
2960
  var _this2 = this;
2766
- _classCallCheck(this, Ke);
2961
+ _classCallCheck(this, Ge);
2767
2962
  this.bootstrapPromise = e, this.executeRecaptcha = function () {
2768
- return Fe(_this2, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
2963
+ return We(_this2, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
2769
2964
  var _yield$this$state, e, t, r;
2770
2965
  return _regeneratorRuntime().wrap(function _callee$(_context) {
2771
2966
  while (1) switch (_context.prev = _context.next) {
@@ -2796,7 +2991,7 @@ var Ke = /*#__PURE__*/_createClass(function Ke(e) {
2796
2991
  }, _callee, this);
2797
2992
  }));
2798
2993
  }, this.state = e.then(function (e) {
2799
- return Fe(_this2, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
2994
+ return We(_this2, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
2800
2995
  var t;
2801
2996
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2802
2997
  while (1) switch (_context2.prev = _context2.next) {
@@ -2834,21 +3029,21 @@ var Ke = /*#__PURE__*/_createClass(function Ke(e) {
2834
3029
  }));
2835
3030
  });
2836
3031
  });
2837
- var qe = /*#__PURE__*/function () {
2838
- function qe(e) {
3032
+ var He = /*#__PURE__*/function () {
3033
+ function He(e) {
2839
3034
  var _this3 = this;
2840
- _classCallCheck(this, qe);
3035
+ _classCallCheck(this, He);
2841
3036
  this.iframeURL = e, this.oneTapStart = function (e) {
2842
3037
  return _this3.call("oneTapStart", e);
2843
3038
  }, this.oneTapSubmit = function (e) {
2844
3039
  return _this3.call("oneTapSubmit", e);
2845
3040
  };
2846
3041
  }
2847
- _createClass(qe, [{
3042
+ _createClass(He, [{
2848
3043
  key: "frameClient",
2849
3044
  get: function get() {
2850
3045
  var e;
2851
- return this._frameClient = null !== (e = this._frameClient) && void 0 !== e ? e : new je(this.iframeURL), this._frameClient;
3046
+ return this._frameClient = null !== (e = this._frameClient) && void 0 !== e ? e : new Fe(this.iframeURL), this._frameClient;
2852
3047
  }
2853
3048
  }, {
2854
3049
  key: "call",
@@ -2856,40 +3051,40 @@ var qe = /*#__PURE__*/function () {
2856
3051
  return this.frameClient.call(e, [t]);
2857
3052
  }
2858
3053
  }]);
2859
- return qe;
3054
+ return He;
2860
3055
  }();
2861
- function Ge(e) {
2862
- return Ge = "function" == typeof Symbol && "symbol" == _typeof(Symbol.iterator) ? function (e) {
3056
+ function ze(e) {
3057
+ return ze = "function" == typeof Symbol && "symbol" == _typeof(Symbol.iterator) ? function (e) {
2863
3058
  return _typeof(e);
2864
3059
  } : function (e) {
2865
3060
  return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : _typeof(e);
2866
- }, Ge(e);
3061
+ }, ze(e);
2867
3062
  }
2868
- function We(e, t) {
3063
+ function Ye(e, t) {
2869
3064
  for (var r = 0; r < t.length; r++) {
2870
3065
  var n = t[r];
2871
- n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, (i = n.key, o = void 0, o = function (e, t) {
2872
- if ("object" !== Ge(e) || null === e) return e;
3066
+ n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, (i = n.key, s = void 0, s = function (e, t) {
3067
+ if ("object" !== ze(e) || null === e) return e;
2873
3068
  var r = e[Symbol.toPrimitive];
2874
3069
  if (void 0 !== r) {
2875
3070
  var n = r.call(e, t || "default");
2876
- if ("object" !== Ge(n)) return n;
3071
+ if ("object" !== ze(n)) return n;
2877
3072
  throw new TypeError("@@toPrimitive must return a primitive value.");
2878
3073
  }
2879
3074
  return ("string" === t ? String : Number)(e);
2880
- }(i, "string"), "symbol" === Ge(o) ? o : String(o)), n);
3075
+ }(i, "string"), "symbol" === ze(s) ? s : String(s)), n);
2881
3076
  }
2882
- var i, o;
3077
+ var i, s;
2883
3078
  }
2884
- function He(e, t, r) {
2885
- return t && We(e.prototype, t), r && We(e, r), Object.defineProperty(e, "prototype", {
3079
+ function Ve(e, t, r) {
3080
+ return t && Ye(e.prototype, t), r && Ye(e, r), Object.defineProperty(e, "prototype", {
2886
3081
  writable: !1
2887
3082
  }), e;
2888
3083
  }
2889
- function ze(e, t) {
3084
+ function Je(e, t) {
2890
3085
  if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
2891
3086
  }
2892
- function Ye(e, t) {
3087
+ function $e(e, t) {
2893
3088
  if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
2894
3089
  e.prototype = Object.create(t && t.prototype, {
2895
3090
  constructor: {
@@ -2899,31 +3094,31 @@ function Ye(e, t) {
2899
3094
  }
2900
3095
  }), Object.defineProperty(e, "prototype", {
2901
3096
  writable: !1
2902
- }), t && Qe(e, t);
3097
+ }), t && rt(e, t);
2903
3098
  }
2904
- function Ve(e) {
2905
- var t = Ze();
3099
+ function Xe(e) {
3100
+ var t = tt();
2906
3101
  return function () {
2907
3102
  var r,
2908
- n = et(e);
3103
+ n = nt(e);
2909
3104
  if (t) {
2910
- var i = et(this).constructor;
3105
+ var i = nt(this).constructor;
2911
3106
  r = Reflect.construct(n, arguments, i);
2912
3107
  } else r = n.apply(this, arguments);
2913
3108
  return function (e, t) {
2914
- if (t && ("object" === Ge(t) || "function" == typeof t)) return t;
3109
+ if (t && ("object" === ze(t) || "function" == typeof t)) return t;
2915
3110
  if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
2916
- return Je(e);
3111
+ return Ze(e);
2917
3112
  }(this, r);
2918
3113
  };
2919
3114
  }
2920
- function Je(e) {
3115
+ function Ze(e) {
2921
3116
  if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
2922
3117
  return e;
2923
3118
  }
2924
- function $e(e) {
3119
+ function Qe(e) {
2925
3120
  var t = "function" == typeof Map ? new Map() : void 0;
2926
- return $e = function $e(e) {
3121
+ return Qe = function Qe(e) {
2927
3122
  if (null === e || (r = e, -1 === Function.toString.call(r).indexOf("[native code]"))) return e;
2928
3123
  var r;
2929
3124
  if ("function" != typeof e) throw new TypeError("Super expression must either be null or a function");
@@ -2932,7 +3127,7 @@ function $e(e) {
2932
3127
  t.set(e, n);
2933
3128
  }
2934
3129
  function n() {
2935
- return Xe(e, arguments, et(this).constructor);
3130
+ return et(e, arguments, nt(this).constructor);
2936
3131
  }
2937
3132
  return n.prototype = Object.create(e.prototype, {
2938
3133
  constructor: {
@@ -2941,18 +3136,18 @@ function $e(e) {
2941
3136
  writable: !0,
2942
3137
  configurable: !0
2943
3138
  }
2944
- }), Qe(n, e);
2945
- }, $e(e);
3139
+ }), rt(n, e);
3140
+ }, Qe(e);
2946
3141
  }
2947
- function Xe(e, t, r) {
2948
- return Xe = Ze() ? Reflect.construct.bind() : function (e, t, r) {
3142
+ function et(e, t, r) {
3143
+ return et = tt() ? Reflect.construct.bind() : function (e, t, r) {
2949
3144
  var n = [null];
2950
3145
  n.push.apply(n, t);
2951
3146
  var i = new (Function.bind.apply(e, n))();
2952
- return r && Qe(i, r.prototype), i;
2953
- }, Xe.apply(null, arguments);
3147
+ return r && rt(i, r.prototype), i;
3148
+ }, et.apply(null, arguments);
2954
3149
  }
2955
- function Ze() {
3150
+ function tt() {
2956
3151
  if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
2957
3152
  if (Reflect.construct.sham) return !1;
2958
3153
  if ("function" == typeof Proxy) return !0;
@@ -2962,107 +3157,107 @@ function Ze() {
2962
3157
  return !1;
2963
3158
  }
2964
3159
  }
2965
- function Qe(e, t) {
2966
- return Qe = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (e, t) {
3160
+ function rt(e, t) {
3161
+ return rt = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (e, t) {
2967
3162
  return e.__proto__ = t, e;
2968
- }, Qe(e, t);
3163
+ }, rt(e, t);
2969
3164
  }
2970
- function et(e) {
2971
- return et = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (e) {
3165
+ function nt(e) {
3166
+ return nt = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (e) {
2972
3167
  return e.__proto__ || Object.getPrototypeOf(e);
2973
- }, et(e);
3168
+ }, nt(e);
2974
3169
  }
2975
- var tt, rt, nt, it, ot, st;
3170
+ var it, st, ot, at, ct, ut;
2976
3171
  !function (e) {
2977
3172
  e.emailMagicLinks = "emailMagicLinks", e.oauth = "oauth", e.otp = "otp", e.crypto = "crypto", e.passwords = "passwords";
2978
- }(tt || (tt = {})), function (e) {
3173
+ }(it || (it = {})), function (e) {
2979
3174
  e.Google = "google", e.Microsoft = "microsoft", e.Apple = "apple", e.Github = "github", e.GitLab = "gitlab", e.Facebook = "facebook", e.Discord = "discord", e.Salesforce = "salesforce", e.Slack = "slack", e.Amazon = "amazon", e.Bitbucket = "bitbucket", e.LinkedIn = "linkedin", e.Coinbase = "coinbase", e.Twitch = "twitch", e.Twitter = "twitter", e.TikTok = "tiktok", e.Snapchat = "snapchat", e.Figma = "figma", e.Yahoo = "yahoo";
2980
- }(rt || (rt = {})), function (e) {
3175
+ }(st || (st = {})), function (e) {
2981
3176
  e.Vessel = "Vessel", e.Phantom = "Phantom", e.Metamask = "Metamask", e.Coinbase = "Coinbase", e.Binance = "Binance", e.GenericEthereumWallet = "Other Ethereum Wallet", e.GenericSolanaWallet = "Other Solana Wallet";
2982
- }(nt || (nt = {})), function (e) {
3177
+ }(ot || (ot = {})), function (e) {
2983
3178
  e.embedded = "embedded", e.floating = "floating";
2984
- }(it || (it = {})), function (e) {
3179
+ }(at || (at = {})), function (e) {
2985
3180
  e.SMS = "sms", e.WhatsApp = "whatsapp", e.Email = "email";
2986
- }(ot || (ot = {})), function (e) {
3181
+ }(ct || (ct = {})), function (e) {
2987
3182
  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.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_SSO_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";
2988
- }(st || (st = {}));
2989
- var at,
2990
- ct,
2991
- ut,
2992
- lt,
2993
- dt = function (e) {
2994
- Ye(r, $e(Error));
2995
- var t = Ve(r);
3183
+ }(ut || (ut = {}));
3184
+ var lt,
3185
+ dt,
3186
+ ht,
3187
+ pt,
3188
+ ft = function (e) {
3189
+ $e(r, Qe(Error));
3190
+ var t = Xe(r);
2996
3191
  function r(e, n) {
2997
3192
  var i;
2998
- return ze(this, r), (i = t.call(this, e + "\n" + n)).message = e + "\n" + n, i.name = "SDKAPIUnreachableError", i.details = n, Object.setPrototypeOf(Je(i), r.prototype), i;
3193
+ return Je(this, r), (i = t.call(this, e + "\n" + n)).message = e + "\n" + n, i.name = "SDKAPIUnreachableError", i.details = n, Object.setPrototypeOf(Ze(i), r.prototype), i;
2999
3194
  }
3000
- return He(r);
3195
+ return Ve(r);
3001
3196
  }(),
3002
- ht = function (e) {
3003
- Ye(r, $e(Error));
3004
- var t = Ve(r);
3197
+ _t = function (e) {
3198
+ $e(r, Qe(Error));
3199
+ var t = Xe(r);
3005
3200
  function r(e, n) {
3006
3201
  var i;
3007
- return ze(this, r), (i = t.call(this)).name = "StytchSDKUsageError", i.message = "Invalid call to ".concat(e, "\n") + n, i;
3202
+ return Je(this, r), (i = t.call(this)).name = "StytchSDKUsageError", i.message = "Invalid call to ".concat(e, "\n") + n, i;
3008
3203
  }
3009
- return He(r);
3204
+ return Ve(r);
3010
3205
  }(),
3011
- pt = function (e) {
3012
- Ye(r, $e(Error));
3013
- var t = Ve(r);
3206
+ vt = function (e) {
3207
+ $e(r, Qe(Error));
3208
+ var t = Xe(r);
3014
3209
  function r(e) {
3015
3210
  var n, i;
3016
- ze(this, r), (n = t.call(this)).name = "StytchSDKSchemaError";
3017
- var o = null === (i = e.body) || void 0 === i ? void 0 : i.map(function (e) {
3211
+ Je(this, r), (n = t.call(this)).name = "StytchSDKSchemaError";
3212
+ var s = null === (i = e.body) || void 0 === i ? void 0 : i.map(function (e) {
3018
3213
  return "".concat(e.dataPath, ": ").concat(e.message);
3019
3214
  }).join("\n");
3020
- return n.message = "[400] Request does not match expected schema\n".concat(o), n;
3215
+ return n.message = "[400] Request does not match expected schema\n".concat(s), n;
3021
3216
  }
3022
- return He(r);
3217
+ return Ve(r);
3023
3218
  }(),
3024
- ft = function (e) {
3025
- Ye(r, $e(Error));
3026
- var t = Ve(r);
3219
+ mt = function (e) {
3220
+ $e(r, Qe(Error));
3221
+ var t = Xe(r);
3027
3222
  function r(e) {
3028
3223
  var n;
3029
- ze(this, r), (n = t.call(this)).name = "StytchSDKAPIError";
3224
+ Je(this, r), (n = t.call(this)).name = "StytchSDKAPIError";
3030
3225
  var i = e.status_code,
3031
- o = e.error_type,
3032
- s = e.error_message,
3226
+ s = e.error_type,
3227
+ o = e.error_message,
3033
3228
  a = e.error_url,
3034
3229
  c = e.request_id;
3035
- return n.error_type = o, n.error_message = s, n.error_url = a, n.request_id = c, n.status_code = i, n.message = "[".concat(i, "] ").concat(o, "\n") + "".concat(s, "\n") + "See ".concat(a, " for more information.\n") + (c ? "request_id: ".concat(c, "\n") : ""), n;
3230
+ return n.error_type = s, n.error_message = o, n.error_url = a, n.request_id = c, n.status_code = i, n.message = "[".concat(i, "] ").concat(s, "\n") + "".concat(o, "\n") + "See ".concat(a, " for more information.\n") + (c ? "request_id: ".concat(c, "\n") : ""), n;
3036
3231
  }
3037
- return He(r);
3232
+ return Ve(r);
3038
3233
  }(),
3039
- _t = function (e) {
3040
- Ye(r, $e(Error));
3041
- var t = Ve(r);
3234
+ yt = function (e) {
3235
+ $e(r, Qe(Error));
3236
+ var t = Xe(r);
3042
3237
  function r(e) {
3043
3238
  var n;
3044
- return ze(this, r), (n = t.call(this)).name = "StytchSDKNativeError", n.error_type = e, n.message = "".concat(e), n;
3239
+ return Je(this, r), (n = t.call(this)).name = "StytchSDKNativeError", n.error_type = e, n.message = "".concat(e), n;
3045
3240
  }
3046
- return He(r);
3241
+ return Ve(r);
3047
3242
  }(),
3048
- mt = ["unauthorized_credentials", "user_unauthenticated", "invalid_secret_authentication", "session_not_found"];
3243
+ gt = ["unauthorized_credentials", "user_unauthenticated", "invalid_secret_authentication", "session_not_found"];
3049
3244
  !function (e) {
3050
3245
  e.BiometricsSensorError = "biometrics_sensor_error", e.DeviceCredentialsNotAllowed = "device_credentials_not_allowed", e.DeviceHardwareError = "device_hardware_error", e.InternalError = "internal_error", e.KeyInvalidated = "key_invalidated", e.KeystoreUnavailable = "keystore_unavailable", e.NoBiometricsEnrolled = "no_biometrics_enrolled", e.NoBiometricsRegistration = "no_biometrics_registration", e.SessionExpired = "session_expired", e.UserCancellation = "user_cancellation", e.UserLockedOut = "user_locked_out", e.BiometricsNotAvailable = "biometrics_not_available";
3051
- }(at || (at = {})), function (e) {
3246
+ }(lt || (lt = {})), function (e) {
3052
3247
  e.emailMagicLinks = "emailMagicLinks", e.sso = "sso", e.passwords = "passwords", e.oauth = "oauth";
3053
- }(ct || (ct = {})), function (e) {
3248
+ }(dt || (dt = {})), function (e) {
3054
3249
  e.Discovery = "Discovery", e.Organization = "Organization", e.PasswordReset = "PasswordReset";
3055
- }(ut || (ut = {})), function (e) {
3250
+ }(ht || (ht = {})), function (e) {
3056
3251
  e.Google = "google", e.Microsoft = "microsoft";
3057
- }(lt || (lt = {}));
3058
- var vt = /*#__PURE__*/function (_ue) {
3059
- _inherits(vt, _ue);
3060
- var _super = _createSuper(vt);
3061
- function vt(e, t, r, n, i, o) {
3252
+ }(pt || (pt = {}));
3253
+ var bt = /*#__PURE__*/function (_ue) {
3254
+ _inherits(bt, _ue);
3255
+ var _super = _createSuper(bt);
3256
+ function bt(e, t, r, n, i, s) {
3062
3257
  var _this4;
3063
- _classCallCheck(this, vt);
3064
- _this4 = _super.call(this, e, t, r, n, i), _this4._oneTap = o, _this4.startOneTap = function (e) {
3065
- return Fe(_assertThisInitialized(_this4), void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
3258
+ _classCallCheck(this, bt);
3259
+ _this4 = _super.call(this, e, t, r, n, i), _this4._oneTap = s, _this4.startOneTap = function (e) {
3260
+ return We(_assertThisInitialized(_this4), void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
3066
3261
  var t, r, n;
3067
3262
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
3068
3263
  while (1) switch (_context3.prev = _context3.next) {
@@ -3084,7 +3279,7 @@ var vt = /*#__PURE__*/function (_ue) {
3084
3279
  });
3085
3280
  return _context3.abrupt("return", r.render({
3086
3281
  style: {
3087
- position: it.floating
3282
+ position: at.floating
3088
3283
  },
3089
3284
  onOneTapCancelled: e.onOneTapCancelled,
3090
3285
  callback: n
@@ -3100,11 +3295,11 @@ var vt = /*#__PURE__*/function (_ue) {
3100
3295
  };
3101
3296
  return _this4;
3102
3297
  }
3103
- return _createClass(vt);
3298
+ return _createClass(bt);
3104
3299
  }(ue);
3105
- var gt = /*#__PURE__*/function () {
3106
- function gt(e, t, r, n) {
3107
- _classCallCheck(this, gt);
3300
+ var kt = /*#__PURE__*/function () {
3301
+ function kt(e, t, r, n) {
3302
+ _classCallCheck(this, kt);
3108
3303
  this._publicToken = e, this._subscriptionDataLayer = t, this.baseURL = r, this.additionalTelemetryDataFn = n, this.updateSessionToken = function () {
3109
3304
  return null;
3110
3305
  }, this.eventLogger = new ne({
@@ -3113,7 +3308,7 @@ var gt = /*#__PURE__*/function () {
3113
3308
  logEventURL: this.buildSDKUrl("/events")
3114
3309
  });
3115
3310
  }
3116
- _createClass(gt, [{
3311
+ _createClass(kt, [{
3117
3312
  key: "logEvent",
3118
3313
  value: function logEvent(_ref) {
3119
3314
  var e = _ref.name,
@@ -3133,9 +3328,9 @@ var gt = /*#__PURE__*/function () {
3133
3328
  key: "createTelemetryBlob",
3134
3329
  value: function createTelemetryBlob() {
3135
3330
  return Object.assign(Object.assign({
3136
- event_id: "event-id-".concat(D()),
3137
- app_session_id: "app-session-id-".concat(D()),
3138
- persistent_id: "persistent-id-".concat(D()),
3331
+ event_id: "event-id-".concat(I()),
3332
+ app_session_id: "app-session-id-".concat(I()),
3333
+ persistent_id: "persistent-id-".concat(I()),
3139
3334
  client_sent_at: new Date().toISOString(),
3140
3335
  timezone: Intl.DateTimeFormat().resolvedOptions().timeZone
3141
3336
  }, this.additionalTelemetryDataFn()), {
@@ -3144,7 +3339,7 @@ var gt = /*#__PURE__*/function () {
3144
3339
  },
3145
3340
  sdk: {
3146
3341
  identifier: "Stytch.js Javascript SDK",
3147
- version: "2.0.2"
3342
+ version: "2.0.3"
3148
3343
  }
3149
3344
  });
3150
3345
  }
@@ -3155,90 +3350,99 @@ var gt = /*#__PURE__*/function () {
3155
3350
  t = _ref2.body,
3156
3351
  r = _ref2.errorMessage,
3157
3352
  n = _ref2.method;
3158
- return Fe(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
3159
- var i, s, a, c;
3353
+ return We(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
3354
+ var i, s, o, a;
3160
3355
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
3161
3356
  while (1) switch (_context4.prev = _context4.next) {
3162
3357
  case 0:
3163
- i = this._subscriptionDataLayer.readSessionCookie().session_token, s = "Basic " + window.btoa(this._publicToken + ":" + (i || this._publicToken)), a = window.btoa(JSON.stringify(this.createTelemetryBlob())), c = window.location.origin;
3164
- return _context4.abrupt("return", function (e) {
3358
+ 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;
3359
+ return _context4.abrupt("return", Ne({
3360
+ basicAuthHeader: s,
3361
+ body: t,
3362
+ errorMessage: r,
3363
+ finalURL: this.buildSDKUrl(e),
3364
+ method: n,
3365
+ xSDKClientHeader: o,
3366
+ xSDKParentHostHeader: a
3367
+ }));
3368
+ case 2:
3369
+ case "end":
3370
+ return _context4.stop();
3371
+ }
3372
+ }, _callee4, this);
3373
+ }));
3374
+ }
3375
+ }, {
3376
+ key: "retriableFetchSDK",
3377
+ value: function retriableFetchSDK(_ref3) {
3378
+ var e = _ref3.url,
3379
+ t = _ref3.body,
3380
+ r = _ref3.errorMessage,
3381
+ n = _ref3.method,
3382
+ i = _ref3.retryCallback;
3383
+ return We(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
3384
+ var o, a, c, u;
3385
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
3386
+ while (1) switch (_context5.prev = _context5.next) {
3387
+ case 0:
3388
+ o = this._subscriptionDataLayer.readSessionCookie().session_token, a = "Basic " + window.btoa(this._publicToken + ":" + (o || this._publicToken)), c = window.btoa(JSON.stringify(this.createTelemetryBlob())), u = window.location.origin;
3389
+ return _context5.abrupt("return", function (e) {
3165
3390
  var t = e.method,
3166
3391
  r = e.errorMessage,
3167
3392
  n = e.finalURL,
3168
3393
  i = e.basicAuthHeader,
3169
- s = e.xSDKClientHeader,
3394
+ o = e.xSDKClientHeader,
3170
3395
  a = e.xSDKParentHostHeader,
3171
- c = e.body;
3172
- return w(this, void 0, void 0, o().mark(function e() {
3173
- var u, l, d, h, p;
3174
- return o().wrap(function (e) {
3396
+ c = e.body,
3397
+ u = e.retryCallback;
3398
+ return k(this, void 0, void 0, s().mark(function e() {
3399
+ var l;
3400
+ return s().wrap(function (e) {
3175
3401
  for (;;) switch (e.prev = e.next) {
3176
3402
  case 0:
3177
- return u = {
3178
- Authorization: i,
3179
- "Content-Type": "application/json",
3180
- "X-SDK-Client": s
3181
- }, a && (u["X-SDK-Parent-Host"] = a), l = {
3403
+ return l = {
3182
3404
  method: t,
3183
- headers: u,
3184
- body: c && JSON.stringify(c)
3185
- }, e.prev = 3, e.next = 6, fetch(n, l);
3186
- case 6:
3187
- d = e.sent, e.next = 14;
3188
- break;
3189
- case 9:
3190
- if (e.prev = 9, e.t0 = e["catch"](3), "Failed to fetch" !== e.t0.message) {
3191
- e.next = 13;
3405
+ errorMessage: r,
3406
+ finalURL: n,
3407
+ basicAuthHeader: i,
3408
+ xSDKClientHeader: o,
3409
+ xSDKParentHostHeader: a,
3410
+ body: c
3411
+ }, e.prev = 1, e.next = 4, Ne(l);
3412
+ case 4:
3413
+ case 15:
3414
+ return e.abrupt("return", e.sent);
3415
+ case 7:
3416
+ if (e.prev = 7, e.t0 = e["catch"](1), !(e.t0 instanceof Me)) {
3417
+ e.next = 16;
3192
3418
  break;
3193
3419
  }
3194
- throw new U(r, "Unable to contact the Stytch servers. Are you online?");
3195
- case 13:
3420
+ return e.next = 12, u(e.t0, l);
3421
+ case 12:
3422
+ return l = e.sent, e.next = 15, Ne(l);
3423
+ case 16:
3196
3424
  throw e.t0;
3197
- case 14:
3198
- if (200 === d.status) {
3199
- e.next = 27;
3200
- break;
3201
- }
3202
- return e.prev = 15, e.next = 18, d.json();
3203
- case 18:
3204
- h = e.sent, e.next = 24;
3205
- break;
3206
- case 21:
3207
- throw e.prev = 21, e.t1 = e["catch"](15), new U(r, "Invalid or no response from server");
3208
- case 24:
3209
- if (!("body" in h || "params" in h || "query" in h)) {
3210
- e.next = 26;
3211
- break;
3212
- }
3213
- throw new K(h);
3214
- case 26:
3215
- throw new q(h);
3216
- case 27:
3217
- return e.prev = 27, e.next = 30, d.json();
3218
- case 30:
3219
- return p = e.sent, e.abrupt("return", p.data);
3220
- case 34:
3221
- throw e.prev = 34, e.t2 = e["catch"](27), new U(r, "Invalid response from the Stytch servers.");
3222
- case 37:
3425
+ case 17:
3223
3426
  case "end":
3224
3427
  return e.stop();
3225
3428
  }
3226
- }, e, null, [[3, 9], [15, 21], [27, 34]]);
3429
+ }, e, null, [[1, 7]]);
3227
3430
  }));
3228
3431
  }({
3229
- basicAuthHeader: s,
3432
+ basicAuthHeader: a,
3230
3433
  body: t,
3231
3434
  errorMessage: r,
3232
3435
  finalURL: this.buildSDKUrl(e),
3233
3436
  method: n,
3234
- xSDKClientHeader: a,
3235
- xSDKParentHostHeader: c
3437
+ xSDKClientHeader: c,
3438
+ xSDKParentHostHeader: u,
3439
+ retryCallback: i
3236
3440
  }));
3237
3441
  case 2:
3238
3442
  case "end":
3239
- return _context4.stop();
3443
+ return _context5.stop();
3240
3444
  }
3241
- }, _callee4, this);
3445
+ }, _callee5, this);
3242
3446
  }));
3243
3447
  }
3244
3448
  }, {
@@ -3247,29 +3451,29 @@ var gt = /*#__PURE__*/function () {
3247
3451
  return "".concat(this.baseURL, "/sdk/v1").concat(e);
3248
3452
  }
3249
3453
  }]);
3250
- return gt;
3454
+ return kt;
3251
3455
  }();
3252
- var yt = /*#__PURE__*/function () {
3253
- function yt(e, t, r) {
3254
- _classCallCheck(this, yt);
3456
+ var wt = /*#__PURE__*/function () {
3457
+ function wt(e, t, r) {
3458
+ _classCallCheck(this, wt);
3255
3459
  this._googleClient = e, this._publicToken = t, this._clientId = r;
3256
3460
  }
3257
- _createClass(yt, [{
3461
+ _createClass(wt, [{
3258
3462
  key: "cancel",
3259
3463
  value: function cancel() {
3260
3464
  this._googleClient.cancel();
3261
3465
  }
3262
3466
  }, {
3263
3467
  key: "render",
3264
- value: function render(_ref3) {
3265
- var e = _ref3.callback,
3266
- t = _ref3.onOneTapCancelled,
3267
- r = _ref3.style;
3268
- return Fe(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
3468
+ value: function render(_ref4) {
3469
+ var e = _ref4.callback,
3470
+ t = _ref4.onOneTapCancelled,
3471
+ r = _ref4.style;
3472
+ return We(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
3269
3473
  var _this5 = this;
3270
3474
  var n;
3271
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
3272
- while (1) switch (_context5.prev = _context5.next) {
3475
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
3476
+ while (1) switch (_context6.prev = _context6.next) {
3273
3477
  case 0:
3274
3478
  n = {
3275
3479
  client_id: this._clientId,
@@ -3278,7 +3482,7 @@ var yt = /*#__PURE__*/function () {
3278
3482
  context: "use",
3279
3483
  itp_support: !0
3280
3484
  };
3281
- return _context5.abrupt("return", (r.position === it.embedded && (n.prompt_parent_id = "google-parent-prompt", n.cancel_on_tap_outside = !1), this._googleClient.initialize(n), new Promise(function (e) {
3485
+ return _context6.abrupt("return", (r.position === at.embedded && (n.prompt_parent_id = "google-parent-prompt", n.cancel_on_tap_outside = !1), this._googleClient.initialize(n), new Promise(function (e) {
3282
3486
  _this5._googleClient.prompt(function (n) {
3283
3487
  return n.isSkippedMoment() ? ("user_cancel" === n.getSkippedReason() && (null == t || t()), e({
3284
3488
  success: !1,
@@ -3293,110 +3497,110 @@ var yt = /*#__PURE__*/function () {
3293
3497
  })));
3294
3498
  case 2:
3295
3499
  case "end":
3296
- return _context5.stop();
3500
+ return _context6.stop();
3297
3501
  }
3298
- }, _callee5, this);
3502
+ }, _callee6, this);
3299
3503
  }));
3300
3504
  }
3301
3505
  }, {
3302
3506
  key: "styleFrame",
3303
3507
  value: function styleFrame(e) {
3304
- e.position === it.embedded && Array.from(document.getElementsByTagName("iframe")).forEach(function (e) {
3305
- e.src.includes(g) && (e.style.width = "100%");
3508
+ e.position === at.embedded && Array.from(document.getElementsByTagName("iframe")).forEach(function (e) {
3509
+ e.src.includes(y) && (e.style.width = "100%");
3306
3510
  });
3307
3511
  }
3308
3512
  }]);
3309
- return yt;
3513
+ return wt;
3310
3514
  }();
3311
- var bt = /*#__PURE__*/function () {
3312
- function bt(e, t) {
3515
+ var St = /*#__PURE__*/function () {
3516
+ function St(e, t) {
3313
3517
  var _this6 = this;
3314
- _classCallCheck(this, bt);
3315
- this._publicToken = e, this.clientsideServices = t, this.createOnSuccessHandler = function (_ref4) {
3316
- var e = _ref4.loginRedirectUrl,
3317
- t = _ref4.signupRedirectUrl,
3318
- r = _ref4.onSuccess;
3518
+ _classCallCheck(this, St);
3519
+ this._publicToken = e, this.clientsideServices = t, this.createOnSuccessHandler = function (_ref5) {
3520
+ var e = _ref5.loginRedirectUrl,
3521
+ t = _ref5.signupRedirectUrl,
3522
+ r = _ref5.onSuccess;
3319
3523
  return function (n) {
3320
- return Fe(_this6, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
3321
- var i, _yield$this$submitGoo, o;
3322
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
3323
- while (1) switch (_context6.prev = _context6.next) {
3524
+ return We(_this6, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
3525
+ var i, _yield$this$submitGoo, s;
3526
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
3527
+ while (1) switch (_context7.prev = _context7.next) {
3324
3528
  case 0:
3325
3529
  i = n.credential;
3326
- _context6.next = 3;
3530
+ _context7.next = 3;
3327
3531
  return this.submitGoogleOneTapToken({
3328
3532
  credential: i,
3329
3533
  loginRedirectUrl: e,
3330
3534
  signupRedirectUrl: t
3331
3535
  });
3332
3536
  case 3:
3333
- _yield$this$submitGoo = _context6.sent;
3334
- o = _yield$this$submitGoo.redirect_url;
3335
- r(o);
3537
+ _yield$this$submitGoo = _context7.sent;
3538
+ s = _yield$this$submitGoo.redirect_url;
3539
+ r(s);
3336
3540
  case 6:
3337
3541
  case "end":
3338
- return _context6.stop();
3542
+ return _context7.stop();
3339
3543
  }
3340
- }, _callee6, this);
3544
+ }, _callee7, this);
3341
3545
  }));
3342
3546
  };
3343
3547
  }, this.RedirectOnSuccess = function (e) {
3344
3548
  window.location.href = e;
3345
3549
  };
3346
3550
  }
3347
- _createClass(bt, [{
3551
+ _createClass(St, [{
3348
3552
  key: "createOneTapClient",
3349
3553
  value: function createOneTapClient() {
3350
- return Fe(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
3554
+ return We(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
3351
3555
  var e, _yield$this$fetchGoog;
3352
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
3353
- while (1) switch (_context7.prev = _context7.next) {
3556
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
3557
+ while (1) switch (_context8.prev = _context8.next) {
3354
3558
  case 0:
3355
- _context7.prev = 0;
3356
- _context7.next = 3;
3559
+ _context8.prev = 0;
3560
+ _context8.next = 3;
3357
3561
  return this.fetchGoogleStart();
3358
3562
  case 3:
3359
- _yield$this$fetchGoog = _context7.sent;
3563
+ _yield$this$fetchGoog = _context8.sent;
3360
3564
  e = _yield$this$fetchGoog.googleClientId;
3361
- _context7.next = 10;
3565
+ _context8.next = 10;
3362
3566
  break;
3363
3567
  case 7:
3364
- _context7.prev = 7;
3365
- _context7.t0 = _context7["catch"](0);
3366
- return _context7.abrupt("return", {
3568
+ _context8.prev = 7;
3569
+ _context8.t0 = _context8["catch"](0);
3570
+ return _context8.abrupt("return", {
3367
3571
  success: !1,
3368
- reason: _context7.t0.error_type
3572
+ reason: _context8.t0.error_type
3369
3573
  });
3370
3574
  case 10:
3371
3575
  if (!("" === e)) {
3372
- _context7.next = 12;
3576
+ _context8.next = 12;
3373
3577
  break;
3374
3578
  }
3375
- return _context7.abrupt("return", {
3579
+ return _context8.abrupt("return", {
3376
3580
  success: !1,
3377
3581
  reason: "oauth_config_not_found"
3378
3582
  });
3379
3583
  case 12:
3380
- _context7.t1 = !0;
3381
- _context7.t2 = yt;
3382
- _context7.next = 16;
3383
- return H(y, function () {
3584
+ _context8.t1 = !0;
3585
+ _context8.t2 = wt;
3586
+ _context8.next = 16;
3587
+ return H(g, function () {
3384
3588
  return window.google.accounts.id;
3385
3589
  });
3386
3590
  case 16:
3387
- _context7.t3 = _context7.sent;
3388
- _context7.t4 = this._publicToken;
3389
- _context7.t5 = e;
3390
- _context7.t6 = new _context7.t2(_context7.t3, _context7.t4, _context7.t5);
3391
- return _context7.abrupt("return", {
3392
- success: _context7.t1,
3393
- client: _context7.t6
3591
+ _context8.t3 = _context8.sent;
3592
+ _context8.t4 = this._publicToken;
3593
+ _context8.t5 = e;
3594
+ _context8.t6 = new _context8.t2(_context8.t3, _context8.t4, _context8.t5);
3595
+ return _context8.abrupt("return", {
3596
+ success: _context8.t1,
3597
+ client: _context8.t6
3394
3598
  });
3395
3599
  case 21:
3396
3600
  case "end":
3397
- return _context7.stop();
3601
+ return _context8.stop();
3398
3602
  }
3399
- }, _callee7, this, [[0, 7]]);
3603
+ }, _callee8, this, [[0, 7]]);
3400
3604
  }));
3401
3605
  }
3402
3606
  }, {
@@ -3408,21 +3612,21 @@ var bt = /*#__PURE__*/function () {
3408
3612
  }
3409
3613
  }, {
3410
3614
  key: "submitGoogleOneTapToken",
3411
- value: function submitGoogleOneTapToken(_ref5) {
3412
- var e = _ref5.credential,
3413
- t = _ref5.loginRedirectUrl,
3414
- r = _ref5.signupRedirectUrl;
3415
- return Fe(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
3615
+ value: function submitGoogleOneTapToken(_ref6) {
3616
+ var e = _ref6.credential,
3617
+ t = _ref6.loginRedirectUrl,
3618
+ r = _ref6.signupRedirectUrl;
3619
+ return We(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
3416
3620
  var _yield$this$fetchGoog2, n;
3417
- return _regeneratorRuntime().wrap(function _callee8$(_context8) {
3418
- while (1) switch (_context8.prev = _context8.next) {
3621
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
3622
+ while (1) switch (_context9.prev = _context9.next) {
3419
3623
  case 0:
3420
- _context8.next = 2;
3624
+ _context9.next = 2;
3421
3625
  return this.fetchGoogleStart();
3422
3626
  case 2:
3423
- _yield$this$fetchGoog2 = _context8.sent;
3627
+ _yield$this$fetchGoog2 = _context9.sent;
3424
3628
  n = _yield$this$fetchGoog2.oauthCallbackId;
3425
- return _context8.abrupt("return", this.clientsideServices.oneTapSubmit({
3629
+ return _context9.abrupt("return", this.clientsideServices.oneTapSubmit({
3426
3630
  publicToken: this._publicToken,
3427
3631
  idToken: e,
3428
3632
  loginRedirectURL: t,
@@ -3431,9 +3635,9 @@ var bt = /*#__PURE__*/function () {
3431
3635
  }));
3432
3636
  case 5:
3433
3637
  case "end":
3434
- return _context8.stop();
3638
+ return _context9.stop();
3435
3639
  }
3436
- }, _callee8, this);
3640
+ }, _callee9, this);
3437
3641
  }));
3438
3642
  }
3439
3643
  }], [{
@@ -3449,21 +3653,21 @@ var bt = /*#__PURE__*/function () {
3449
3653
  }, {
3450
3654
  key: "WillGoogleOneTapShowEmbedded",
3451
3655
  value: function WillGoogleOneTapShowEmbedded() {
3452
- return !bt.WillGoogleOneTapShowBannerForUA(navigator.userAgent);
3656
+ return !St.WillGoogleOneTapShowBannerForUA(navigator.userAgent);
3453
3657
  }
3454
3658
  }]);
3455
- return bt;
3659
+ return St;
3456
3660
  }();
3457
- function wt(e) {
3661
+ function Tt(e) {
3458
3662
  var t = e.toString(16);
3459
3663
  return 1 === t.length && (t = "0" + t), t;
3460
3664
  }
3461
- var kt = /*#__PURE__*/function () {
3462
- function kt(e, t) {
3463
- _classCallCheck(this, kt);
3665
+ var Ot = /*#__PURE__*/function () {
3666
+ function Ot(e, t) {
3667
+ _classCallCheck(this, Ot);
3464
3668
  this._dataLayer = e, this.namespace = t;
3465
3669
  }
3466
- _createClass(kt, [{
3670
+ _createClass(Ot, [{
3467
3671
  key: "key",
3468
3672
  value: function key() {
3469
3673
  return "PKCE_VERIFIER:" + this.namespace;
@@ -3471,21 +3675,21 @@ var kt = /*#__PURE__*/function () {
3471
3675
  }, {
3472
3676
  key: "startPKCETransaction",
3473
3677
  value: function startPKCETransaction() {
3474
- return Fe(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
3678
+ return We(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
3475
3679
  var e;
3476
- return _regeneratorRuntime().wrap(function _callee9$(_context9) {
3477
- while (1) switch (_context9.prev = _context9.next) {
3680
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
3681
+ while (1) switch (_context10.prev = _context10.next) {
3478
3682
  case 0:
3479
- _context9.next = 2;
3480
- return kt.createProofkeyPair();
3683
+ _context10.next = 2;
3684
+ return Ot.createProofkeyPair();
3481
3685
  case 2:
3482
- e = _context9.sent;
3483
- return _context9.abrupt("return", (this._dataLayer.setItem(this.key(), JSON.stringify(e)), e));
3686
+ e = _context10.sent;
3687
+ return _context10.abrupt("return", (this._dataLayer.setItem(this.key(), JSON.stringify(e)), e));
3484
3688
  case 4:
3485
3689
  case "end":
3486
- return _context9.stop();
3690
+ return _context10.stop();
3487
3691
  }
3488
- }, _callee9, this);
3692
+ }, _callee10, this);
3489
3693
  }));
3490
3694
  }
3491
3695
  }, {
@@ -3506,39 +3710,39 @@ var kt = /*#__PURE__*/function () {
3506
3710
  }], [{
3507
3711
  key: "createProofkeyPair",
3508
3712
  value: function createProofkeyPair() {
3509
- return Fe(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
3713
+ return We(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
3510
3714
  var _String$fromCharCode;
3511
3715
  var e, t, r, n;
3512
- return _regeneratorRuntime().wrap(function _callee10$(_context10) {
3513
- while (1) switch (_context10.prev = _context10.next) {
3716
+ return _regeneratorRuntime().wrap(function _callee11$(_context11) {
3717
+ while (1) switch (_context11.prev = _context11.next) {
3514
3718
  case 0:
3515
3719
  e = new Uint32Array(16);
3516
3720
  window.crypto.getRandomValues(e);
3517
- t = Array.from(e).map(wt).join("");
3518
- _context10.next = 5;
3721
+ t = Array.from(e).map(Tt).join("");
3722
+ _context11.next = 5;
3519
3723
  return window.crypto.subtle.digest("SHA-256", new TextEncoder().encode(t));
3520
3724
  case 5:
3521
- r = _context10.sent;
3522
- return _context10.abrupt("return", {
3725
+ r = _context11.sent;
3726
+ return _context11.abrupt("return", {
3523
3727
  code_challenge: (n = r, btoa((_String$fromCharCode = String.fromCharCode).call.apply(_String$fromCharCode, [null].concat(_toConsumableArray(new Uint8Array(n))))).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "")),
3524
3728
  code_verifier: t
3525
3729
  });
3526
3730
  case 7:
3527
3731
  case "end":
3528
- return _context10.stop();
3732
+ return _context11.stop();
3529
3733
  }
3530
- }, _callee10);
3734
+ }, _callee11);
3531
3735
  }));
3532
3736
  }
3533
3737
  }]);
3534
- return kt;
3738
+ return Ot;
3535
3739
  }();
3536
- var St = /*#__PURE__*/function () {
3537
- function St(e) {
3538
- _classCallCheck(this, St);
3740
+ var Ct = /*#__PURE__*/function () {
3741
+ function Ct(e) {
3742
+ _classCallCheck(this, Ct);
3539
3743
  this._networkClient = e;
3540
3744
  }
3541
- _createClass(St, [{
3745
+ _createClass(Ct, [{
3542
3746
  key: "searchUser",
3543
3747
  value: function searchUser(e) {
3544
3748
  return this._networkClient.fetchSDK({
@@ -3576,9 +3780,9 @@ var St = /*#__PURE__*/function () {
3576
3780
  });
3577
3781
  }
3578
3782
  }]);
3579
- return St;
3783
+ return Ct;
3580
3784
  }();
3581
- var Tt = function Tt(e) {
3785
+ var Et = function Et(e) {
3582
3786
  return (document.cookie ? document.cookie.split("; ") : []).filter(function (t) {
3583
3787
  var _t$split = t.split("="),
3584
3788
  _t$split2 = _slicedToArray(_t$split, 1),
@@ -3587,20 +3791,20 @@ var Tt = function Tt(e) {
3587
3791
  }).length > 1;
3588
3792
  };
3589
3793
  /*! js-cookie v3.0.1 | MIT */
3590
- function Ot(e) {
3794
+ function xt(e) {
3591
3795
  for (var t = 1; t < arguments.length; t++) {
3592
3796
  var r = arguments[t];
3593
3797
  for (var n in r) e[n] = r[n];
3594
3798
  }
3595
3799
  return e;
3596
3800
  }
3597
- var Et = function e(t, r) {
3801
+ var At = function e(t, r) {
3598
3802
  function n(e, n, i) {
3599
3803
  if ("undefined" != typeof document) {
3600
- "number" == typeof (i = Ot({}, 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);
3601
- var o = "";
3602
- for (var s in i) i[s] && (o += "; " + s, !0 !== i[s] && (o += "=" + i[s].split(";")[0]));
3603
- return document.cookie = e + "=" + t.write(n, e) + o;
3804
+ "number" == typeof (i = xt({}, 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);
3805
+ var s = "";
3806
+ for (var o in i) i[o] && (s += "; " + o, !0 !== i[o] && (s += "=" + i[o].split(";")[0]));
3807
+ return document.cookie = e + "=" + t.write(n, e) + s;
3604
3808
  }
3605
3809
  }
3606
3810
  return Object.create({
@@ -3608,26 +3812,26 @@ var Et = function e(t, r) {
3608
3812
  get: function get(e) {
3609
3813
  if ("undefined" != typeof document && (!arguments.length || e)) {
3610
3814
  for (var r = document.cookie ? document.cookie.split("; ") : [], n = {}, i = 0; i < r.length; i++) {
3611
- var o = r[i].split("="),
3612
- s = o.slice(1).join("=");
3815
+ var s = r[i].split("="),
3816
+ o = s.slice(1).join("=");
3613
3817
  try {
3614
- var a = decodeURIComponent(o[0]);
3615
- if (n[a] = t.read(s, a), e === a) break;
3818
+ var a = decodeURIComponent(s[0]);
3819
+ if (n[a] = t.read(o, a), e === a) break;
3616
3820
  } catch (e) {}
3617
3821
  }
3618
3822
  return e ? n[e] : n;
3619
3823
  }
3620
3824
  },
3621
3825
  remove: function remove(e, t) {
3622
- n(e, "", Ot({}, t, {
3826
+ n(e, "", xt({}, t, {
3623
3827
  expires: -1
3624
3828
  }));
3625
3829
  },
3626
3830
  withAttributes: function withAttributes(t) {
3627
- return e(this.converter, Ot({}, this.attributes, t));
3831
+ return e(this.converter, xt({}, this.attributes, t));
3628
3832
  },
3629
3833
  withConverter: function withConverter(t) {
3630
- return e(Ot({}, this.converter, t), this.attributes);
3834
+ return e(xt({}, this.converter, t), this.attributes);
3631
3835
  }
3632
3836
  }, {
3633
3837
  attributes: {
@@ -3647,26 +3851,26 @@ var Et = function e(t, r) {
3647
3851
  }, {
3648
3852
  path: "/"
3649
3853
  });
3650
- var Ct = function Ct(e) {
3854
+ var Pt = function Pt(e) {
3651
3855
  var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
3652
3856
  return "stytch_sdk_state_".concat(e).concat(t ? "::".concat(t) : "");
3653
3857
  };
3654
- var At = /*#__PURE__*/function () {
3655
- function At(e, t) {
3858
+ var Rt = /*#__PURE__*/function () {
3859
+ function Rt(e, t) {
3656
3860
  var _this7 = this;
3657
- _classCallCheck(this, At);
3861
+ _classCallCheck(this, Rt);
3658
3862
  this.browserSessionStorage = {
3659
3863
  getItem: function getItem(e) {
3660
- return sessionStorage.getItem(Ct(_this7.publicToken, e));
3864
+ return sessionStorage.getItem(Pt(_this7.publicToken, e));
3661
3865
  },
3662
3866
  setItem: function setItem(e, t) {
3663
- return sessionStorage.setItem(Ct(_this7.publicToken, e), t);
3867
+ return sessionStorage.setItem(Pt(_this7.publicToken, e), t);
3664
3868
  },
3665
3869
  removeItem: function removeItem(e) {
3666
- return sessionStorage.removeItem(Ct(_this7.publicToken, e));
3870
+ return sessionStorage.removeItem(Pt(_this7.publicToken, e));
3667
3871
  }
3668
3872
  }, this.publicToken = e, this.state = null, this.subscriptions = {}, (null == t ? void 0 : t.cookieOptions) ? (Z("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), this._jwtCookieName = t.cookieOptions.jwtCookieName || null, this._opaqueTokenCookieName = t.cookieOptions.opaqueTokenCookieName || null, this._cookiePath = t.cookieOptions.path || null, this._cookieAvailableToSubdomains = t.cookieOptions.availableToSubdomains || !1, this._istCookieName = t.cookieOptions.istCookieName || null) : (this._opaqueTokenCookieName = null, this._jwtCookieName = null, this._cookiePath = null, this._cookieAvailableToSubdomains = !1, this._istCookieName = null);
3669
- var r = localStorage.getItem(Ct(this.publicToken));
3873
+ var r = localStorage.getItem(Pt(this.publicToken));
3670
3874
  if (!r) return this.removeSessionCookie(), void this.removeISTCookie();
3671
3875
  var n;
3672
3876
  try {
@@ -3676,7 +3880,7 @@ var At = /*#__PURE__*/function () {
3676
3880
  }
3677
3881
  this.state = n;
3678
3882
  }
3679
- _createClass(At, [{
3883
+ _createClass(Rt, [{
3680
3884
  key: "opaqueTokenCookieName",
3681
3885
  get: function get() {
3682
3886
  var e;
@@ -3698,45 +3902,45 @@ var At = /*#__PURE__*/function () {
3698
3902
  key: "readSessionCookie",
3699
3903
  value: function readSessionCookie() {
3700
3904
  return {
3701
- session_token: Et.get(this.opaqueTokenCookieName),
3702
- session_jwt: Et.get(this.jwtCookieName)
3905
+ session_token: At.get(this.opaqueTokenCookieName),
3906
+ session_jwt: At.get(this.jwtCookieName)
3703
3907
  };
3704
3908
  }
3705
3909
  }, {
3706
3910
  key: "readIntermediateSessionTokenCookie",
3707
3911
  value: function readIntermediateSessionTokenCookie() {
3708
- return Et.get(this.istCookieName);
3912
+ return At.get(this.istCookieName);
3709
3913
  }
3710
3914
  }, {
3711
3915
  key: "writeSessionCookie",
3712
3916
  value: function writeSessionCookie(e) {
3713
3917
  var t, r, n, i;
3714
- var o = e.state,
3715
- s = e.session_token,
3918
+ var s = e.state,
3919
+ o = e.session_token,
3716
3920
  a = e.session_jwt,
3717
- c = At.generateCookieOpts({
3718
- expiresAt: null !== (r = null === (t = null == o ? void 0 : o.session) || void 0 === t ? void 0 : t.expires_at) && void 0 !== r ? r : "",
3921
+ c = Rt.generateCookieOpts({
3922
+ expiresAt: null !== (r = null === (t = null == s ? void 0 : s.session) || void 0 === t ? void 0 : t.expires_at) && void 0 !== r ? r : "",
3719
3923
  availableToSubdomains: this._cookieAvailableToSubdomains,
3720
3924
  path: this._cookiePath
3721
3925
  });
3722
- Et.set(this.opaqueTokenCookieName, s, c), Et.set(this.jwtCookieName, a, c);
3723
- var u = At.generateCookieOpts({
3724
- expiresAt: null !== (i = null === (n = null == o ? void 0 : o.session) || void 0 === n ? void 0 : n.expires_at) && void 0 !== i ? i : "",
3926
+ At.set(this.opaqueTokenCookieName, o, c), At.set(this.jwtCookieName, a, c);
3927
+ var u = Rt.generateCookieOpts({
3928
+ expiresAt: null !== (i = null === (n = null == s ? void 0 : s.session) || void 0 === n ? void 0 : n.expires_at) && void 0 !== i ? i : "",
3725
3929
  availableToSubdomains: !this._cookieAvailableToSubdomains,
3726
3930
  path: this._cookiePath
3727
3931
  });
3728
- Tt(this.jwtCookieName) && Et.remove(this.jwtCookieName, u), Tt(this.opaqueTokenCookieName) && Et.remove(this.opaqueTokenCookieName, u), Tt(this.jwtCookieName) && J("Could not remove extraneous JWT cookie. This might happen if the cookie has been set using multiple `path` settings, and may produce unwanted behavior."), Tt(this.opaqueTokenCookieName) && J("Could not remove extraneous opaque token cookie.");
3932
+ Et(this.jwtCookieName) && At.remove(this.jwtCookieName, u), Et(this.opaqueTokenCookieName) && At.remove(this.opaqueTokenCookieName, u), Et(this.jwtCookieName) && J("Could not remove extraneous JWT cookie. This might happen if the cookie has been set using multiple `path` settings, and may produce unwanted behavior."), Et(this.opaqueTokenCookieName) && J("Could not remove extraneous opaque token cookie.");
3729
3933
  }
3730
3934
  }, {
3731
3935
  key: "writeIntermediateSessionTokenCookie",
3732
3936
  value: function writeIntermediateSessionTokenCookie(e) {
3733
3937
  var t = new Date(Date.now() + 6e5),
3734
- r = At.generateCookieOpts({
3938
+ r = Rt.generateCookieOpts({
3735
3939
  expiresAt: t.toString(),
3736
3940
  availableToSubdomains: this._cookieAvailableToSubdomains,
3737
3941
  path: this._cookiePath
3738
3942
  });
3739
- Et.set(this.istCookieName, e, r);
3943
+ At.set(this.istCookieName, e, r);
3740
3944
  }
3741
3945
  }, {
3742
3946
  key: "removeSessionCookie",
@@ -3754,13 +3958,13 @@ var At = /*#__PURE__*/function () {
3754
3958
  var _this8 = this;
3755
3959
  [!0, !1].forEach(function (t) {
3756
3960
  [_this8._cookiePath, null].forEach(function (r) {
3757
- var n = At.generateCookieOpts({
3961
+ var n = Rt.generateCookieOpts({
3758
3962
  expiresAt: new Date(0).toString(),
3759
3963
  availableToSubdomains: t,
3760
3964
  path: r
3761
3965
  });
3762
3966
  e.forEach(function (e) {
3763
- Et.remove(e, n);
3967
+ At.remove(e, n);
3764
3968
  });
3765
3969
  });
3766
3970
  });
@@ -3768,29 +3972,29 @@ var At = /*#__PURE__*/function () {
3768
3972
  }, {
3769
3973
  key: "syncToLocalStorage",
3770
3974
  value: function syncToLocalStorage() {
3771
- localStorage.setItem(Ct(this.publicToken), JSON.stringify(this.state));
3975
+ localStorage.setItem(Pt(this.publicToken), JSON.stringify(this.state));
3772
3976
  }
3773
3977
  }, {
3774
3978
  key: "getItem",
3775
3979
  value: function getItem(e) {
3776
- return localStorage.getItem(Ct(this.publicToken, e));
3980
+ return localStorage.getItem(Pt(this.publicToken, e));
3777
3981
  }
3778
3982
  }, {
3779
3983
  key: "setItem",
3780
3984
  value: function setItem(e, t) {
3781
- return localStorage.setItem(Ct(this.publicToken, e), t);
3985
+ return localStorage.setItem(Pt(this.publicToken, e), t);
3782
3986
  }
3783
3987
  }, {
3784
3988
  key: "removeItem",
3785
3989
  value: function removeItem(e) {
3786
- return localStorage.removeItem(Ct(this.publicToken, e));
3990
+ return localStorage.removeItem(Pt(this.publicToken, e));
3787
3991
  }
3788
3992
  }], [{
3789
3993
  key: "generateCookieOpts",
3790
- value: function generateCookieOpts(_ref6) {
3791
- var e = _ref6.path,
3792
- t = _ref6.availableToSubdomains,
3793
- r = _ref6.expiresAt;
3994
+ value: function generateCookieOpts(_ref7) {
3995
+ var e = _ref7.path,
3996
+ t = _ref7.availableToSubdomains,
3997
+ r = _ref7.expiresAt;
3794
3998
  var n = {
3795
3999
  expires: new Date(r),
3796
4000
  sameSite: "lax"
@@ -3798,56 +4002,56 @@ var At = /*#__PURE__*/function () {
3798
4002
  return e && (n.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}$/)) ? n.secure = !1 : (t && (n.domain = window.location.host), n.secure = !0), n;
3799
4003
  }
3800
4004
  }]);
3801
- return At;
4005
+ return Rt;
3802
4006
  }();
3803
- var xt = /*#__PURE__*/function (_At) {
3804
- _inherits(xt, _At);
3805
- var _super2 = _createSuper(xt);
3806
- function xt() {
3807
- _classCallCheck(this, xt);
4007
+ var Dt = /*#__PURE__*/function (_Rt) {
4008
+ _inherits(Dt, _Rt);
4009
+ var _super2 = _createSuper(Dt);
4010
+ function Dt() {
4011
+ _classCallCheck(this, Dt);
3808
4012
  return _super2.apply(this, arguments);
3809
4013
  }
3810
- return _createClass(xt);
3811
- }(At);
3812
- var Pt = Symbol["for"]("__stytch_DataLayer"),
3813
- Rt = function Rt(e, t) {
4014
+ return _createClass(Dt);
4015
+ }(Rt);
4016
+ var Bt = Symbol["for"]("__stytch_DataLayer"),
4017
+ It = function It(e, t) {
3814
4018
  var r = function () {
3815
4019
  var e = window;
3816
- return e[Pt] || (e[Pt] = {}), e[Pt];
4020
+ return e[Bt] || (e[Bt] = {}), e[Bt];
3817
4021
  }();
3818
- return r[e] || (r[e] = new xt(e, t)), r[e];
4022
+ return r[e] || (r[e] = new Dt(e, t)), r[e];
3819
4023
  },
3820
- Bt = function Bt(e, t) {
4024
+ Lt = function Lt(e, t) {
3821
4025
  Object.values(e).forEach(function (e) {
3822
4026
  return e(t);
3823
4027
  });
3824
4028
  },
3825
- It = function () {
4029
+ jt = function () {
3826
4030
  var e = (arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}).KEYS_TO_EXCLUDE,
3827
4031
  r = void 0 === e ? [] : e;
3828
- return function e(n, o) {
3829
- return i(n) === i(o) && (null === n || null === o ? n === o : "object" === i(n) ? Object.keys(n).length === Object.keys(o).length && !Object.keys(n).some(function (e) {
3830
- return !(e in o);
4032
+ return function e(n, s) {
4033
+ return i(n) === i(s) && (null === n || null === s ? n === s : "object" === i(n) ? Object.keys(n).length === Object.keys(s).length && !Object.keys(n).some(function (e) {
4034
+ return !(e in s);
3831
4035
  }) && Object.entries(n).filter(function (e) {
3832
4036
  var n = t(e, 1)[0];
3833
4037
  return !r.includes(n);
3834
4038
  }).every(function (r) {
3835
4039
  var n = t(r, 2),
3836
4040
  i = n[0],
3837
- s = n[1];
3838
- return e(s, o[i]);
3839
- }) : n === o);
4041
+ o = n[1];
4042
+ return e(o, s[i]);
4043
+ }) : n === s);
3840
4044
  };
3841
4045
  }({
3842
4046
  KEYS_TO_EXCLUDE: ["last_accessed_at"]
3843
4047
  });
3844
- var Dt = /*#__PURE__*/function () {
3845
- function Dt(e, t) {
4048
+ var Mt = /*#__PURE__*/function () {
4049
+ function Mt(e, t) {
3846
4050
  var _this9 = this;
3847
- _classCallCheck(this, Dt);
4051
+ _classCallCheck(this, Mt);
3848
4052
  var r;
3849
4053
  this._publicToken = e, this._datalayer = t, this._listen = function (e) {
3850
- if (e.key !== Ct(_this9._publicToken)) return;
4054
+ if (e.key !== Pt(_this9._publicToken)) return;
3851
4055
  if (null === e.newValue || "null" === e.newValue) return void _this9.destroyState();
3852
4056
  var t = JSON.parse(e.newValue);
3853
4057
  _this9.updateState(t);
@@ -3858,7 +4062,7 @@ var Dt = /*#__PURE__*/function () {
3858
4062
  i = _this$_datalayer$read.session_token;
3859
4063
  i || this.destroyState();
3860
4064
  }
3861
- _createClass(Dt, [{
4065
+ _createClass(Mt, [{
3862
4066
  key: "getTokens",
3863
4067
  value: function getTokens() {
3864
4068
  var _this$_datalayer$read2 = this._datalayer.readSessionCookie(),
@@ -3889,7 +4093,7 @@ var Dt = /*#__PURE__*/function () {
3889
4093
  value: function _updateStateAndTokensInternal(e) {
3890
4094
  var t = this._datalayer.state,
3891
4095
  r = null === e.state ? null : Object.assign(Object.assign({}, this._datalayer.state), e.state);
3892
- this._datalayer.state = r, It(t, r) || Bt(this._datalayer.subscriptions, r);
4096
+ this._datalayer.state = r, jt(t, r) || Lt(this._datalayer.subscriptions, r);
3893
4097
  }
3894
4098
  }, {
3895
4099
  key: "updateStateAndTokens",
@@ -3901,7 +4105,7 @@ var Dt = /*#__PURE__*/function () {
3901
4105
  value: function updateState(e) {
3902
4106
  var t = this._datalayer.state,
3903
4107
  r = null === e ? null : Object.assign(Object.assign({}, this._datalayer.state), e);
3904
- this._datalayer.state = r, It(t, r) || (Bt(this._datalayer.subscriptions, r), this._datalayer.syncToLocalStorage());
4108
+ this._datalayer.state = r, jt(t, r) || (Lt(this._datalayer.subscriptions, r), this._datalayer.syncToLocalStorage());
3905
4109
  }
3906
4110
  }, {
3907
4111
  key: "updateTokens",
@@ -3941,14 +4145,14 @@ var Dt = /*#__PURE__*/function () {
3941
4145
  return null;
3942
4146
  }
3943
4147
  }]);
3944
- return Dt;
4148
+ return Mt;
3945
4149
  }();
3946
- var Lt = /*#__PURE__*/function (_Dt) {
3947
- _inherits(Lt, _Dt);
3948
- var _super3 = _createSuper(Lt);
3949
- function Lt() {
4150
+ var Nt = /*#__PURE__*/function (_Mt) {
4151
+ _inherits(Nt, _Mt);
4152
+ var _super3 = _createSuper(Nt);
4153
+ function Nt() {
3950
4154
  var _this10;
3951
- _classCallCheck(this, Lt);
4155
+ _classCallCheck(this, Nt);
3952
4156
  _this10 = _super3.apply(this, arguments), _this10.updateUser = function (e) {
3953
4157
  return _this10.updateState({
3954
4158
  user: e
@@ -3962,49 +4166,49 @@ var Lt = /*#__PURE__*/function (_Dt) {
3962
4166
  };
3963
4167
  return _this10;
3964
4168
  }
3965
- return _createClass(Lt);
3966
- }(Dt);
3967
- var jt = Symbol["for"]("stytch__internal_b2c");
3968
- var Nt = /*#__PURE__*/_createClass(function Nt(e, t) {
4169
+ return _createClass(Nt);
4170
+ }(Mt);
4171
+ var Ft = Symbol["for"]("stytch__internal_b2c");
4172
+ var Ut = /*#__PURE__*/_createClass(function Ut(e, t) {
3969
4173
  var _this11 = this;
3970
- _classCallCheck(this, Nt);
4174
+ _classCallCheck(this, Ut);
3971
4175
  var r;
3972
4176
  !function (e) {
3973
4177
  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";
3974
4178
  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"));
3975
4179
  }("StytchHeadlessClient"), "string" != typeof (r = e) ? J("Public token is malformed. Expected a string, got ".concat(i(r), ".").concat(X)) : "" === r ? J('Public token is malformed. Expected "public-token-...", got an empty string.'.concat(X)) : r.startsWith("public-token-") || J('Public token is malformed. Expected "public-token-...", got '.concat(r, ".").concat(X));
3976
4180
  var n = t,
3977
- o = {
3978
- cookieOptions: null == (s = n) ? void 0 : s.cookieOptions,
4181
+ s = {
4182
+ cookieOptions: null == (o = n) ? void 0 : o.cookieOptions,
3979
4183
  endpoints: {
3980
- sdkBackendURL: null !== (c = null === (a = null == s ? void 0 : s.endpoints) || void 0 === a ? void 0 : a.sdkBackendURL) && void 0 !== c ? c : "https://web.stytch.com",
3981
- testAPIURL: null !== (l = null === (u = null == s ? void 0 : s.endpoints) || void 0 === u ? void 0 : u.testAPIURL) && void 0 !== l ? l : "https://test.stytch.com",
3982
- liveAPIURL: null !== (h = null === (d = null == s ? void 0 : s.endpoints) || void 0 === d ? void 0 : d.liveAPIURL) && void 0 !== h ? h : "https://api.stytch.com",
3983
- dfpBackendURL: null !== (f = null === (p = null == s ? void 0 : s.endpoints) || void 0 === p ? void 0 : p.dfpBackendURL) && void 0 !== f ? f : "https://telemetry.stytch.com",
3984
- clientsideServicesIframeURL: null !== (m = null === (_ = null == s ? void 0 : s.endpoints) || void 0 === _ ? void 0 : _.clientsideServicesIframeURL) && void 0 !== m ? m : "https://js.stytch.com/clientside-services/index.html"
4184
+ sdkBackendURL: null !== (c = null === (a = null == o ? void 0 : o.endpoints) || void 0 === a ? void 0 : a.sdkBackendURL) && void 0 !== c ? c : "https://web.stytch.com",
4185
+ testAPIURL: null !== (l = null === (u = null == o ? void 0 : o.endpoints) || void 0 === u ? void 0 : u.testAPIURL) && void 0 !== l ? l : "https://test.stytch.com",
4186
+ liveAPIURL: null !== (h = null === (d = null == o ? void 0 : o.endpoints) || void 0 === d ? void 0 : d.liveAPIURL) && void 0 !== h ? h : "https://api.stytch.com",
4187
+ dfpBackendURL: null !== (f = null === (p = null == o ? void 0 : o.endpoints) || void 0 === p ? void 0 : p.dfpBackendURL) && void 0 !== f ? f : "https://telemetry.stytch.com",
4188
+ clientsideServicesIframeURL: null !== (v = null === (_ = null == o ? void 0 : o.endpoints) || void 0 === _ ? void 0 : _.clientsideServicesIframeURL) && void 0 !== v ? v : "https://js.stytch.com/clientside-services/index.html"
3985
4189
  }
3986
4190
  };
3987
- var s, a, c, u, l, d, h, p, f, _, m;
3988
- this._dataLayer = Rt(e, n), this._subscriptionService = new Lt(e, this._dataLayer);
3989
- this._networkClient = new gt(e, this._dataLayer, o.endpoints.sdkBackendURL, function () {
4191
+ var o, a, c, u, l, d, h, p, f, _, v;
4192
+ this._dataLayer = It(e, n), this._subscriptionService = new Nt(e, this._dataLayer);
4193
+ this._networkClient = new kt(e, this._dataLayer, s.endpoints.sdkBackendURL, function () {
3990
4194
  var e, t, r, n;
3991
4195
  return {
3992
4196
  stytch_user_id: null === (t = null === (e = _this11._dataLayer.state) || void 0 === e ? void 0 : e.user) || void 0 === t ? void 0 : t.user_id,
3993
4197
  stytch_session_id: null === (n = null === (r = _this11._dataLayer.state) || void 0 === r ? void 0 : r.session) || void 0 === n ? void 0 : n.session_id
3994
4198
  };
3995
4199
  });
3996
- var v = new Ue(e, this._networkClient, this._dataLayer),
3997
- g = new Ke(v.getAsync()),
3998
- y = new te(e, o.endpoints.dfpBackendURL, v.getAsync()),
3999
- b = new qe(o.endpoints.clientsideServicesIframeURL),
4000
- w = new bt(e, b),
4001
- k = new St(this._networkClient);
4200
+ var m = new qe(e, this._networkClient, this._dataLayer),
4201
+ y = new Ge(m.getAsync()),
4202
+ g = new te(e, s.endpoints.dfpBackendURL, m.getAsync()),
4203
+ b = new He(s.endpoints.clientsideServicesIframeURL),
4204
+ k = new St(e, b),
4205
+ w = new Ct(this._networkClient);
4002
4206
  var S, T;
4003
- this.user = new ie(this._networkClient, this._subscriptionService), this.session = new oe(this._networkClient, this._subscriptionService), this.magicLinks = new ae(this._networkClient, this._subscriptionService, new kt(this._dataLayer, "magic_links"), v.getAsync(), g.executeRecaptcha, y), this.otps = new ce(this._networkClient, this._subscriptionService, g.executeRecaptcha), this.oauth = new vt(this._networkClient, this._subscriptionService, new kt(this._dataLayer, "oauth"), v.getAsync(), {
4207
+ this.user = new ie(this._networkClient, this._subscriptionService), this.session = new se(this._networkClient, this._subscriptionService), this.magicLinks = new ae(this._networkClient, this._subscriptionService, new Ot(this._dataLayer, "magic_links"), m.getAsync(), y.executeRecaptcha, g), this.otps = new ce(this._networkClient, this._subscriptionService, y.executeRecaptcha), this.oauth = new bt(this._networkClient, this._subscriptionService, new Ot(this._dataLayer, "oauth"), m.getAsync(), {
4004
4208
  publicToken: e,
4005
- testAPIURL: o.endpoints.testAPIURL,
4006
- liveAPIURL: o.endpoints.liveAPIURL
4007
- }, w), this.cryptoWallets = new le(this._networkClient, this._subscriptionService, g.executeRecaptcha), this.totps = new de(this._networkClient, this._subscriptionService), this.webauthn = new Ie(this._networkClient, this._subscriptionService), this.passwords = new Le(this._networkClient, this._subscriptionService, new kt(this._dataLayer, "passwords"), v.getAsync(), g.executeRecaptcha, y), this._sessionManager = new Ne(this._subscriptionService, this.session), this._dataLayer.readSessionCookie().session_token && this._sessionManager.performBackgroundRefresh(), this._networkClient.logEvent({
4209
+ testAPIURL: s.endpoints.testAPIURL,
4210
+ liveAPIURL: s.endpoints.liveAPIURL
4211
+ }, k), this.cryptoWallets = new le(this._networkClient, this._subscriptionService, y.executeRecaptcha), this.totps = new de(this._networkClient, this._subscriptionService), this.webauthn = new Ie(this._networkClient, this._subscriptionService), this.passwords = new je(this._networkClient, this._subscriptionService, new Ot(this._dataLayer, "passwords"), m.getAsync(), y.executeRecaptcha, g), this._sessionManager = new Ue(this._subscriptionService, this.session), this._dataLayer.readSessionCookie().session_token && this._sessionManager.performBackgroundRefresh(), this._networkClient.logEvent({
4008
4212
  name: "sdk_instance_instantiated",
4009
4213
  details: {
4010
4214
  event_callback_registered: !1,
@@ -4012,14 +4216,14 @@ var Nt = /*#__PURE__*/_createClass(function Nt(e, t) {
4012
4216
  success_callback_registered: !1
4013
4217
  }
4014
4218
  }), S = this, T = {
4015
- bootstrap: v,
4219
+ bootstrap: m,
4016
4220
  clientsideServices: b,
4017
- captcha: g,
4018
- oneTap: w,
4019
- searchManager: k,
4221
+ captcha: y,
4222
+ oneTap: k,
4223
+ searchManager: w,
4020
4224
  publicToken: e,
4021
4225
  dataLayer: this._dataLayer,
4022
4226
  networkClient: this._networkClient
4023
- }, Object.assign(S, _defineProperty({}, jt, T));
4227
+ }, Object.assign(S, _defineProperty({}, Ft, T));
4024
4228
  });
4025
- export { ut as AuthFlowType, lt as B2BOAuthProviders, ct as B2BProducts, at as BiometricsErrors, rt as OAuthProviders, ot as OTPMethods, it as OneTapPositions, tt as Products, dt as SDKAPIUnreachableError, st as StytchEventType, Nt as StytchHeadlessClient, ft as StytchSDKAPIError, _t as StytchSDKNativeError, pt as StytchSDKSchemaError, ht as StytchSDKUsageError, mt as UNRECOVERABLE_ERROR_TYPES, nt as Wallets };
4229
+ export { ht as AuthFlowType, pt as B2BOAuthProviders, dt as B2BProducts, lt as BiometricsErrors, st as OAuthProviders, ct as OTPMethods, at as OneTapPositions, it as Products, ft as SDKAPIUnreachableError, ut as StytchEventType, Ut as StytchHeadlessClient, mt as StytchSDKAPIError, yt as StytchSDKNativeError, vt as StytchSDKSchemaError, _t as StytchSDKUsageError, gt as UNRECOVERABLE_ERROR_TYPES, ot as Wallets };