@stytch/vanilla-js 4.4.3 → 4.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,19 +9,19 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
9
9
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
10
10
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
11
11
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
12
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
13
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
14
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
12
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
15
13
  function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
16
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
17
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
14
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
18
15
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
16
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
17
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
18
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
19
19
  function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
20
20
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
21
21
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
22
22
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
23
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
24
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
23
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
24
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
25
25
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
26
26
  function e(t) {
27
27
  return e = "function" == typeof Symbol && "symbol" == _typeof(Symbol.iterator) ? function (e) {
@@ -30,31 +30,45 @@ function e(t) {
30
30
  return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : _typeof(e);
31
31
  }, e(t);
32
32
  }
33
- function t(t, r) {
34
- for (var n = 0; n < r.length; n++) {
35
- var i = r[n];
36
- i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(t, (s = i.key, o = void 0, o = function (t, r) {
37
- if ("object" !== e(t) || null === t) return t;
38
- var n = t[Symbol.toPrimitive];
39
- if (void 0 !== n) {
40
- var i = n.call(t, r || "default");
41
- if ("object" !== e(i)) return i;
42
- throw new TypeError("@@toPrimitive must return a primitive value.");
43
- }
44
- return ("string" === r ? String : Number)(t);
45
- }(s, "string"), "symbol" === e(o) ? o : String(o)), i);
33
+ function t(e, t) {
34
+ for (var r = 0; r < t.length; r++) {
35
+ var i = t[r];
36
+ i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, n(i.key), i);
46
37
  }
47
- var s, o;
48
38
  }
49
39
  function r(e, r, n) {
50
40
  return r && t(e.prototype, r), n && t(e, n), Object.defineProperty(e, "prototype", {
51
41
  writable: !1
52
42
  }), e;
53
43
  }
54
- function n(e, t) {
55
- if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
44
+ function n(t) {
45
+ var r = function (t, r) {
46
+ if ("object" != e(t) || !t) return t;
47
+ var n = t[Symbol.toPrimitive];
48
+ if (void 0 !== n) {
49
+ var i = n.call(t, r || "default");
50
+ if ("object" != e(i)) return i;
51
+ throw new TypeError("@@toPrimitive must return a primitive value.");
52
+ }
53
+ return ("string" === r ? String : Number)(t);
54
+ }(t, "string");
55
+ return "symbol" == e(r) ? r : String(r);
56
56
  }
57
57
  function i(e, t) {
58
+ if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
59
+ }
60
+ function s(t, r, n) {
61
+ return r = d(r), function (t, r) {
62
+ if (r && ("object" === e(r) || "function" == typeof r)) return r;
63
+ if (void 0 !== r) throw new TypeError("Derived constructors may only return object or undefined");
64
+ return o(t);
65
+ }(t, u() ? Reflect.construct(r, n || [], d(t).constructor) : r.apply(t, n));
66
+ }
67
+ function o(e) {
68
+ if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
69
+ return e;
70
+ }
71
+ function a(e, t) {
58
72
  if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
59
73
  e.prototype = Object.create(t && t.prototype, {
60
74
  constructor: {
@@ -66,29 +80,9 @@ function i(e, t) {
66
80
  writable: !1
67
81
  }), t && l(e, t);
68
82
  }
69
- function s(t) {
70
- var r = u();
71
- return function () {
72
- var n,
73
- i = d(t);
74
- if (r) {
75
- var s = d(this).constructor;
76
- n = Reflect.construct(i, arguments, s);
77
- } else n = i.apply(this, arguments);
78
- return function (t, r) {
79
- if (r && ("object" === e(r) || "function" == typeof r)) return r;
80
- if (void 0 !== r) throw new TypeError("Derived constructors may only return object or undefined");
81
- return o(t);
82
- }(this, n);
83
- };
84
- }
85
- function o(e) {
86
- if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
87
- return e;
88
- }
89
- function a(e) {
83
+ function c(e) {
90
84
  var t = "function" == typeof Map ? new Map() : void 0;
91
- return a = function a(e) {
85
+ return c = function c(e) {
92
86
  if (null === e || !function (e) {
93
87
  try {
94
88
  return -1 !== Function.toString.call(e).indexOf("[native code]");
@@ -102,7 +96,13 @@ function a(e) {
102
96
  t.set(e, r);
103
97
  }
104
98
  function r() {
105
- return c(e, arguments, d(this).constructor);
99
+ return function (e, t, r) {
100
+ if (u()) return Reflect.construct.apply(null, arguments);
101
+ var n = [null];
102
+ n.push.apply(n, t);
103
+ var i = new (e.bind.apply(e, n))();
104
+ return r && l(i, r.prototype), i;
105
+ }(e, arguments, d(this).constructor);
106
106
  }
107
107
  return r.prototype = Object.create(e.prototype, {
108
108
  constructor: {
@@ -112,25 +112,15 @@ function a(e) {
112
112
  configurable: !0
113
113
  }
114
114
  }), l(r, e);
115
- }, a(e);
116
- }
117
- function c(e, t, r) {
118
- return c = u() ? Reflect.construct.bind() : function (e, t, r) {
119
- var n = [null];
120
- n.push.apply(n, t);
121
- var i = new (Function.bind.apply(e, n))();
122
- return r && l(i, r.prototype), i;
123
- }, c.apply(null, arguments);
115
+ }, c(e);
124
116
  }
125
117
  function u() {
126
- if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
127
- if (Reflect.construct.sham) return !1;
128
- if ("function" == typeof Proxy) return !0;
129
118
  try {
130
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})), !0;
131
- } catch (e) {
132
- return !1;
133
- }
119
+ var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
120
+ } catch (e) {}
121
+ return (u = function u() {
122
+ return !!e;
123
+ })();
134
124
  }
135
125
  function l(e, t) {
136
126
  return l = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (e, t) {
@@ -157,341 +147,265 @@ var h, p, f, _, m, v;
157
147
  e.MagicLinkLoginOrCreateEvent = "MAGIC_LINK_LOGIN_OR_CREATE", e.OTPsLoginOrCreateEvent = "OTP_LOGIN_OR_CREATE", e.OTPsAuthenticate = "OTP_AUTHENTICATE", e.CryptoWalletAuthenticateStart = "CRYPTO_WALLET_AUTHENTICATE_START", e.CryptoWalletAuthenticate = "CRYPTO_WALLET_AUTHENTICATE", e.PasswordCreate = "PASSWORD_CREATE", e.PasswordAuthenticate = "PASSWORD_AUTHENTICATE", e.PasswordResetByEmailStart = "PASSWORD_RESET_BY_EMAIL_START", e.PasswordResetByEmail = "PASSWORD_RESET_BY_EMAIL", e.PasskeyRegister = "PASSKEY_REGISTER", e.PasskeyAuthenticate = "PASSKEY_AUTHENTICATE", e.PasskeySkip = "PASSKEY_SKIP", e.PasskeyDone = "PASSKEY_DONE", e.B2BMagicLinkEmailLoginOrSignup = "B2B_MAGIC_LINK_EMAIL_LOGIN_OR_SIGNUP", e.B2BMagicLinkAuthenticate = "B2B_MAGIC_LINK_AUTHENTICATE", e.B2BMagicLinkEmailDiscoverySend = "B2B_MAGIC_LINK_EMAIL_DISCOVERY_SEND", e.B2BMagicLinkDiscoveryAuthenticate = "B2B_MAGIC_LINK_DISCOVERY_AUTHENTICATE", e.B2BSSOStart = "B2B_SSO_START", e.B2BSSOAuthenticate = "B2B_SSO_AUTHENTICATE", e.B2BOAuthAuthenticate = "B2B_OAUTH_AUTHENTICATE", e.B2BOAuthDiscoveryAuthenticate = "B2B_OAUTH_DISCOVERY_AUTHENTICATE", e.B2BDiscoveryOrganizationsCreate = "B2B_DISCOVERY_ORGANIZATIONS_CREATE", e.B2BDiscoveryIntermediateSessionExchange = "B2B_DISCOVERY_INTERMEDIATE_SESSION_EXCHANGE", e.B2BPasswordAuthenticate = "B2B_PASSWORD_AUTHENTICATE", e.B2BPasswordResetByEmailStart = "B2B_PASSWORD_RESET_BY_EMAIL_START", e.B2BPasswordResetByEmail = "B2B_PASSWORD_RESET_BY_EMAIL", e.B2BPasswordResetBySession = "B2B_PASSWORD_RESET_BY_SESSION";
158
148
  }(v || (v = {}));
159
149
  var y,
160
- b,
161
150
  g,
151
+ b,
162
152
  k = function (e) {
163
- i(c, a(Error));
164
- var t = s(c);
165
- function c(e, r) {
166
- var i;
167
- return n(this, c), (i = t.call(this, e + "\n" + r)).message = e + "\n" + r, i.name = "SDKAPIUnreachableError", i.details = r, Object.setPrototypeOf(o(i), c.prototype), i;
153
+ function t(e, r) {
154
+ var n;
155
+ return i(this, t), (n = s(this, t, [e + "\n" + r])).message = e + "\n" + r, n.name = "SDKAPIUnreachableError", n.details = r, Object.setPrototypeOf(o(n), t.prototype), n;
168
156
  }
169
- return r(c);
157
+ return a(t, c(Error)), r(t);
170
158
  }(),
171
159
  w = function (e) {
172
- i(o, a(Error));
173
- var t = s(o);
174
- function o(e, r) {
175
- var i;
176
- return n(this, o), (i = t.call(this)).name = "StytchSDKUsageError", i.message = "Invalid call to ".concat(e, "\n") + r, i;
160
+ function t(e, r) {
161
+ var n;
162
+ return i(this, t), (n = s(this, t)).name = "StytchSDKUsageError", n.message = "Invalid call to ".concat(e, "\n") + r, n;
177
163
  }
178
- return r(o);
164
+ return a(t, c(Error)), r(t);
179
165
  }(),
180
166
  S = function (e) {
181
- i(o, a(Error));
182
- var t = s(o);
183
- function o(e) {
184
- var r, i;
185
- n(this, o), (r = t.call(this)).name = "StytchSDKSchemaError";
186
- var s = null === (i = e.body) || void 0 === i ? void 0 : i.map(function (e) {
167
+ function t(e) {
168
+ var r, n;
169
+ i(this, t), (r = s(this, t)).name = "StytchSDKSchemaError";
170
+ var o = null === (n = e.body) || void 0 === n ? void 0 : n.map(function (e) {
187
171
  return "".concat(e.dataPath, ": ").concat(e.message);
188
172
  }).join("\n");
189
- return r.message = "[400] Request does not match expected schema\n".concat(s), r;
173
+ return r.message = "[400] Request does not match expected schema\n".concat(o), r;
190
174
  }
191
- return r(o);
175
+ return a(t, c(Error)), r(t);
192
176
  }(),
193
177
  C = function (e) {
194
- i(o, a(Error));
195
- var t = s(o);
196
- function o(e) {
178
+ function t(e) {
197
179
  var r;
198
- n(this, o), (r = t.call(this)).name = "StytchSDKAPIError";
199
- var i = e.status_code,
200
- s = e.error_type,
180
+ i(this, t), (r = s(this, t)).name = "StytchSDKAPIError";
181
+ var n = e.status_code,
182
+ o = e.error_type,
201
183
  a = e.error_message,
202
184
  c = e.error_url,
203
185
  u = e.request_id;
204
- return r.error_type = s, r.error_message = a, r.error_url = c, r.request_id = u, r.status_code = i, r.message = "[".concat(i, "] ").concat(s, "\n") + "".concat(a, "\n") + "See ".concat(c, " for more information.\n") + (u ? "request_id: ".concat(u, "\n") : ""), r;
186
+ return r.error_type = o, r.error_message = a, r.error_url = c, r.request_id = u, r.status_code = n, r.message = "[".concat(n, "] ").concat(o, "\n") + "".concat(a, "\n") + "See ".concat(c, " for more information.\n") + (u ? "request_id: ".concat(u, "\n") : ""), r;
205
187
  }
206
- return r(o);
188
+ return a(t, c(Error)), r(t);
207
189
  }(),
208
190
  T = ["unauthorized_credentials", "user_unauthenticated", "invalid_secret_authentication", "session_not_found"],
209
191
  O = function (e) {
210
- i(o, a(Error));
211
- var t = s(o);
212
- function o(e, r) {
213
- var i;
214
- return n(this, o), (i = t.call(this, r)).name = e, i;
192
+ function t(e, r) {
193
+ var n;
194
+ return i(this, t), (n = s(this, t, [r])).name = e, n;
215
195
  }
216
- return r(o);
196
+ return a(t, c(Error)), r(t);
217
197
  }(),
218
198
  P = function (e) {
219
- i(a, O);
220
- var t = s(a);
221
- function a(e) {
199
+ function t(e) {
222
200
  var r;
223
- return n(this, a), r = t.call(this, "StytchAPIUnreachableError", e), Object.setPrototypeOf(o(r), a.prototype), r;
201
+ return i(this, t), r = s(this, t, ["StytchAPIUnreachableError", e]), Object.setPrototypeOf(o(r), t.prototype), r;
224
202
  }
225
- return r(a);
203
+ return a(t, O), r(t);
226
204
  }(),
227
205
  A = function (e) {
228
- i(o, O);
229
- var t = s(o);
230
- function o(e) {
206
+ function t(e) {
231
207
  var r;
232
- n(this, o);
233
- var i = null === (r = e.body) || void 0 === r ? void 0 : r.map(function (e) {
208
+ i(this, t);
209
+ var n = null === (r = e.body) || void 0 === r ? void 0 : r.map(function (e) {
234
210
  return "".concat(e.dataPath, ": ").concat(e.message);
235
211
  }).join("\n");
236
- return t.call(this, "StytchAPISchemaError", "Request does not match expected schema\n".concat(i));
212
+ return s(this, t, ["StytchAPISchemaError", "Request does not match expected schema\n".concat(n)]);
237
213
  }
238
- return r(o);
214
+ return a(t, O), r(t);
239
215
  }(),
240
216
  x = function (e) {
241
- i(o, O);
242
- var t = s(o);
243
- function o(e) {
217
+ function t(e) {
244
218
  var r;
245
- n(this, o);
246
- var i = e.status_code,
247
- s = e.error_type,
219
+ i(this, t);
220
+ var n = e.status_code,
221
+ o = e.error_type,
248
222
  a = e.error_message,
249
223
  c = e.error_url,
250
224
  u = e.request_id;
251
- return (r = t.call(this, "StytchAPIError", "[".concat(i, "] ").concat(s, "\n") + "".concat(a, "\n") + "See ".concat(c, " for more information.\n") + (u ? "request_id: ".concat(u, "\n") : ""))).error_type = s, r.error_message = a, r.error_url = c, r.request_id = u, r.status_code = i, r;
225
+ return (r = s(this, t, ["StytchAPIError", "[".concat(n, "] ").concat(o, "\n") + "".concat(a, "\n") + "See ".concat(c, " for more information.\n") + (u ? "request_id: ".concat(u, "\n") : "")])).error_type = o, r.error_message = a, r.error_url = c, r.request_id = u, r.status_code = n, r;
252
226
  }
253
- return r(o);
227
+ return a(t, O), r(t);
254
228
  }(),
255
229
  E = function (e) {
256
- i(o, O);
257
- var t = s(o);
258
- function o(e, r, i) {
259
- var s;
260
- return n(this, o), (s = t.call(this, e, r)).options = i, s;
230
+ function t(e, r, n) {
231
+ var o;
232
+ return i(this, t), (o = s(this, t, [e, r])).options = n, o;
261
233
  }
262
- return r(o);
234
+ return a(t, O), r(t);
263
235
  }(),
264
236
  D = function (e) {
265
- i(o, E);
266
- var t = s(o);
267
- function o() {
268
- return n(this, o), t.call(this, "NoCurrentSessionError", "There is no session currently available. Make sure the user is authenticated with a valid session.");
237
+ function t() {
238
+ return i(this, t), s(this, t, ["NoCurrentSessionError", "There is no session currently available. Make sure the user is authenticated with a valid session."]);
269
239
  }
270
- return r(o);
240
+ return a(t, E), r(t);
271
241
  }(),
272
242
  R = function (e) {
273
- i(o, E);
274
- var t = s(o);
275
- function o(e) {
276
- return n(this, o), t.call(this, "InternalError", e || "An internal error has occurred. Please contact Stytch if this occurs.");
243
+ function t(e) {
244
+ return i(this, t), s(this, t, ["InternalError", e || "An internal error has occurred. Please contact Stytch if this occurs."]);
277
245
  }
278
- return r(o);
246
+ return a(t, E), r(t);
279
247
  }(),
280
248
  I = function (e) {
281
- i(o, E);
282
- var t = s(o);
283
- function o() {
284
- return n(this, o), t.call(this, "NoBiometricsRegistrationError", "There is no biometric registration available. Authenticate with another method and add a new biometric registration first.");
249
+ function t() {
250
+ return i(this, t), s(this, t, ["NoBiometricsRegistrationError", "There is no biometric registration available. Authenticate with another method and add a new biometric registration first."]);
285
251
  }
286
- return r(o);
252
+ return a(t, E), r(t);
287
253
  }(),
288
254
  F = function (e) {
289
- i(o, E);
290
- var t = s(o);
291
- function o() {
292
- return n(this, o), t.call(this, "BiometricsUnavailableError", "Biometrics is not available on the device.");
255
+ function t() {
256
+ return i(this, t), s(this, t, ["BiometricsUnavailableError", "Biometrics is not available on the device."]);
293
257
  }
294
- return r(o);
258
+ return a(t, E), r(t);
295
259
  }(),
296
260
  j = function (e) {
297
- i(o, E);
298
- var t = s(o);
299
- function o() {
300
- return n(this, o), t.call(this, "KeyInvalidatedError", "The biometrics enrollment on the device has changed.");
261
+ function t() {
262
+ return i(this, t), s(this, t, ["KeyInvalidatedError", "The biometrics enrollment on the device has changed."]);
301
263
  }
302
- return r(o);
264
+ return a(t, E), r(t);
303
265
  }(),
304
266
  L = function (e) {
305
- i(o, E);
306
- var t = s(o);
307
- function o() {
308
- return n(this, o), t.call(this, "KeystoreUnavailableError", "The Android keystore is unavailable on the device. Consider setting allowFallbackToCleartext to true.");
267
+ function t() {
268
+ return i(this, t), s(this, t, ["KeystoreUnavailableError", "The Android keystore is unavailable on the device. Consider setting allowFallbackToCleartext to true."]);
309
269
  }
310
- return r(o);
270
+ return a(t, E), r(t);
311
271
  }(),
312
272
  B = function (e) {
313
- i(o, E);
314
- var t = s(o);
315
- function o() {
316
- return n(this, o), t.call(this, "NoBiometricsEnrolledError", "There is no biometric factor enrolled on the device. Add a biometric factor in the device settings.");
273
+ function t() {
274
+ return i(this, t), s(this, t, ["NoBiometricsEnrolledError", "There is no biometric factor enrolled on the device. Add a biometric factor in the device settings."]);
317
275
  }
318
- return r(o);
276
+ return a(t, E), r(t);
319
277
  }(),
320
278
  M = function (e) {
321
- i(o, E);
322
- var t = s(o);
323
- function o() {
324
- return n(this, o), t.call(this, "UserCancellationError", "The user canceled the prompt. Ask the user to try again.");
279
+ function t() {
280
+ return i(this, t), s(this, t, ["UserCancellationError", "The user canceled the prompt. Ask the user to try again."]);
325
281
  }
326
- return r(o);
282
+ return a(t, E), r(t);
327
283
  }(),
328
284
  N = function (e) {
329
- i(o, E);
330
- var t = s(o);
331
- function o() {
332
- return n(this, o), t.call(this, "UserLockedOutError", "The user has been locked out due to too many failed attempts. Ask the user to try again later.");
285
+ function t() {
286
+ return i(this, t), s(this, t, ["UserLockedOutError", "The user has been locked out due to too many failed attempts. Ask the user to try again later."]);
333
287
  }
334
- return r(o);
288
+ return a(t, E), r(t);
335
289
  }(),
336
290
  U = function (e) {
337
- i(o, E);
338
- var t = s(o);
339
- function o() {
340
- return n(this, o), t.call(this, "DeviceCredentialsNotAllowedError", "The device credentials allowment is mismatched. Change the allowDeviceCredentials parameter to be the same in both the register and authenticate methods.");
291
+ function t() {
292
+ return i(this, t), s(this, t, ["DeviceCredentialsNotAllowedError", "The device credentials allowment is mismatched. Change the allowDeviceCredentials parameter to be the same in both the register and authenticate methods."]);
341
293
  }
342
- return r(o);
294
+ return a(t, E), r(t);
343
295
  }(),
344
296
  K = function (e) {
345
- i(o, E);
346
- var t = s(o);
347
- function o() {
348
- return n(this, o), t.call(this, "MissingGoogleClientIDError", "No Google client ID was found in the project.");
297
+ function t() {
298
+ return i(this, t), s(this, t, ["MissingGoogleClientIDError", "No Google client ID was found in the project."]);
349
299
  }
350
- return r(o);
300
+ return a(t, E), r(t);
351
301
  }(),
352
302
  q = function (e) {
353
- i(o, E);
354
- var t = s(o);
355
- function o() {
356
- return n(this, o), t.call(this, "MissingPKCEError", "Make sure this flow is completed on the same device on which it was started.");
303
+ function t() {
304
+ return i(this, t), s(this, t, ["MissingPKCEError", "Make sure this flow is completed on the same device on which it was started."]);
357
305
  }
358
- return r(o);
306
+ return a(t, E), r(t);
359
307
  }(),
360
308
  W = function (e) {
361
- i(o, E);
362
- var t = s(o);
363
- function o() {
364
- return n(this, o), t.call(this, "MissingAuthorizationCredentialIDTokenError", "The authorization credential is missing an ID token.");
309
+ function t() {
310
+ return i(this, t), s(this, t, ["MissingAuthorizationCredentialIDTokenError", "The authorization credential is missing an ID token."]);
365
311
  }
366
- return r(o);
312
+ return a(t, E), r(t);
367
313
  }(),
368
314
  G = function (e) {
369
- i(o, E);
370
- var t = s(o);
371
- function o() {
372
- return n(this, o), t.call(this, "InvalidAuthorizationCredentialError", "The authorization credential is invalid. Verify that OAuth is set up correctly in the developer console, and call the start flow method.");
315
+ function t() {
316
+ return i(this, t), s(this, t, ["InvalidAuthorizationCredentialError", "The authorization credential is invalid. Verify that OAuth is set up correctly in the developer console, and call the start flow method."]);
373
317
  }
374
- return r(o);
318
+ return a(t, E), r(t);
375
319
  }(),
376
320
  H = function (e) {
377
- i(o, E);
378
- var t = s(o);
379
- function o() {
380
- return n(this, o), t.call(this, "MissingPublicKeyError", "Failed to retrieve the public key. Add a new biometric registration.");
321
+ function t() {
322
+ return i(this, t), s(this, t, ["MissingPublicKeyError", "Failed to retrieve the public key. Add a new biometric registration."]);
381
323
  }
382
- return r(o);
324
+ return a(t, E), r(t);
383
325
  }(),
384
326
  z = function (e) {
385
- i(o, E);
386
- var t = s(o);
387
- function o() {
388
- return n(this, o), t.call(this, "ChallengeSigningFailedError", "Failed to sign the challenge with the key.");
327
+ function t() {
328
+ return i(this, t), s(this, t, ["ChallengeSigningFailedError", "Failed to sign the challenge with the key."]);
389
329
  }
390
- return r(o);
330
+ return a(t, E), r(t);
391
331
  }(),
392
332
  Y = function (e) {
393
- i(o, E);
394
- var t = s(o);
395
- function o() {
396
- return n(this, o), t.call(this, "SDKNotConfiguredError", "Stytch client is not confiured. You must call the configure method before using the SDK");
333
+ function t() {
334
+ return i(this, t), s(this, t, ["SDKNotConfiguredError", "Stytch client is not confiured. You must call the configure method before using the SDK"]);
397
335
  }
398
- return r(o);
336
+ return a(t, E), r(t);
399
337
  }(),
400
338
  V = function (e) {
401
- i(o, E);
402
- var t = s(o);
403
- function o() {
404
- return n(this, o), t.call(this, "FailedCodeChallengeError", "Failed to create a code challenge");
339
+ function t() {
340
+ return i(this, t), s(this, t, ["FailedCodeChallengeError", "Failed to create a code challenge"]);
405
341
  }
406
- return r(o);
342
+ return a(t, E), r(t);
407
343
  }(),
408
344
  J = function (e) {
409
- i(o, E);
410
- var t = s(o);
411
- function o() {
412
- return n(this, o), t.call(this, "PasskeysUnsupportedError", "Passkeys are not supported on this device");
345
+ function t() {
346
+ return i(this, t), s(this, t, ["PasskeysUnsupportedError", "Passkeys are not supported on this device"]);
413
347
  }
414
- return r(o);
348
+ return a(t, E), r(t);
415
349
  }(),
416
350
  $ = function (e) {
417
- i(o, E);
418
- var t = s(o);
419
- function o() {
420
- return n(this, o), t.call(this, "FailedToDecryptDataError", "Failed to decrypt user data");
351
+ function t() {
352
+ return i(this, t), s(this, t, ["FailedToDecryptDataError", "Failed to decrypt user data"]);
421
353
  }
422
- return r(o);
354
+ return a(t, E), r(t);
423
355
  }(),
424
356
  X = function (e) {
425
- i(o, E);
426
- var t = s(o);
427
- function o() {
428
- return n(this, o), t.call(this, "BiometricsFailedError", "Biometric authentication failed");
357
+ function t() {
358
+ return i(this, t), s(this, t, ["BiometricsFailedError", "Biometric authentication failed"]);
429
359
  }
430
- return r(o);
360
+ return a(t, E), r(t);
431
361
  }(),
432
362
  Z = function (e) {
433
- i(o, E);
434
- var t = s(o);
435
- function o() {
436
- return n(this, o), t.call(this, "InvalidStartUrlError", "The start URL was invalid or improperly formatted.");
363
+ function t() {
364
+ return i(this, t), s(this, t, ["InvalidStartUrlError", "The start URL was invalid or improperly formatted."]);
437
365
  }
438
- return r(o);
366
+ return a(t, E), r(t);
439
367
  }(),
440
368
  Q = function (e) {
441
- i(o, E);
442
- var t = s(o);
443
- function o() {
444
- return n(this, o), t.call(this, "InvalidRedirectSchemeError", "The scheme from the given redirect urls was invalid. Possible reasons include: nil scheme, non-custom scheme (using http or https), or differing schemes for login/signup urls.");
369
+ function t() {
370
+ return i(this, t), s(this, t, ["InvalidRedirectSchemeError", "The scheme from the given redirect urls was invalid. Possible reasons include: nil scheme, non-custom scheme (using http or https), or differing schemes for login/signup urls."]);
445
371
  }
446
- return r(o);
372
+ return a(t, E), r(t);
447
373
  }(),
448
374
  ee = function (e) {
449
- i(o, E);
450
- var t = s(o);
451
- function o() {
452
- return n(this, o), t.call(this, "MissingUrlError", "The underlying web authentication service failed to return a URL.");
375
+ function t() {
376
+ return i(this, t), s(this, t, ["MissingUrlError", "The underlying web authentication service failed to return a URL."]);
453
377
  }
454
- return r(o);
378
+ return a(t, E), r(t);
455
379
  }(),
456
380
  te = function (e) {
457
- i(o, E);
458
- var t = s(o);
459
- function o() {
460
- return n(this, o), t.call(this, "InvalidCredentialTypeError", "The public key credential type was not of the expected type.");
381
+ function t() {
382
+ return i(this, t), s(this, t, ["InvalidCredentialTypeError", "The public key credential type was not of the expected type."]);
461
383
  }
462
- return r(o);
384
+ return a(t, E), r(t);
463
385
  }(),
464
386
  re = function (e) {
465
- i(o, E);
466
- var t = s(o);
467
- function o() {
468
- return n(this, o), t.call(this, "MissingAttestationObjectError", "The public key credential is missing the attestation object.");
387
+ function t() {
388
+ return i(this, t), s(this, t, ["MissingAttestationObjectError", "The public key credential is missing the attestation object."]);
469
389
  }
470
- return r(o);
390
+ return a(t, E), r(t);
471
391
  }(),
472
392
  ne = function (e) {
473
- i(o, E);
474
- var t = s(o);
475
- function o() {
476
- return n(this, o), t.call(this, "JSONDataNotConvertibleToStringError", "JSON data unable to be converted to String type.");
393
+ function t() {
394
+ return i(this, t), s(this, t, ["JSONDataNotConvertibleToStringError", "JSON data unable to be converted to String type."]);
477
395
  }
478
- return r(o);
396
+ return a(t, E), r(t);
479
397
  }(),
480
398
  ie = function (e) {
481
- i(o, E);
482
- var t = s(o);
483
- function o() {
484
- return n(this, o), t.call(this, "RandomNumberGenerationFailed", "Random number generation failed");
399
+ function t() {
400
+ return i(this, t), s(this, t, ["RandomNumberGenerationFailed", "Random number generation failed"]);
485
401
  }
486
- return r(o);
402
+ return a(t, E), r(t);
487
403
  }(),
488
404
  se = function (e) {
489
- i(o, E);
490
- var t = s(o);
491
- function o() {
492
- return n(this, o), t.call(this, "PasskeysInvalidEncoding", "Invalid passkey encoding");
405
+ function t() {
406
+ return i(this, t), s(this, t, ["PasskeysInvalidEncoding", "Invalid passkey encoding"]);
493
407
  }
494
- return r(o);
408
+ return a(t, E), r(t);
495
409
  }();
496
410
  function oe(e) {
497
411
  switch (e.message) {
@@ -721,15 +635,15 @@ function he() {
721
635
  m = {};
722
636
  function v() {}
723
637
  function y() {}
724
- function b() {}
725
- var g = {};
726
- u(g, o, function () {
638
+ function g() {}
639
+ var b = {};
640
+ u(b, o, function () {
727
641
  return this;
728
642
  });
729
643
  var k = Object.getPrototypeOf,
730
644
  w = k && k(k(D([])));
731
- w && w !== r && n.call(w, o) && (g = w);
732
- var S = b.prototype = v.prototype = Object.create(g);
645
+ w && w !== r && n.call(w, o) && (b = w);
646
+ var S = g.prototype = v.prototype = Object.create(b);
733
647
  function C(e) {
734
648
  ["next", "throw", "return"].forEach(function (t) {
735
649
  u(e, t, function (e) {
@@ -844,17 +758,17 @@ function he() {
844
758
  }
845
759
  throw new TypeError(de(t) + " is not iterable");
846
760
  }
847
- return y.prototype = b, i(S, "constructor", {
848
- value: b,
761
+ return y.prototype = g, i(S, "constructor", {
762
+ value: g,
849
763
  configurable: !0
850
- }), i(b, "constructor", {
764
+ }), i(g, "constructor", {
851
765
  value: y,
852
766
  configurable: !0
853
- }), y.displayName = u(b, c, "GeneratorFunction"), t.isGeneratorFunction = function (e) {
767
+ }), y.displayName = u(g, c, "GeneratorFunction"), t.isGeneratorFunction = function (e) {
854
768
  var t = "function" == typeof e && e.constructor;
855
769
  return !!t && (t === y || "GeneratorFunction" === (t.displayName || t.name));
856
770
  }, t.mark = function (e) {
857
- return Object.setPrototypeOf ? Object.setPrototypeOf(e, b) : (e.__proto__ = b, u(e, c, "GeneratorFunction")), e.prototype = Object.create(S), e;
771
+ return Object.setPrototypeOf ? Object.setPrototypeOf(e, g) : (e.__proto__ = g, u(e, c, "GeneratorFunction")), e.prototype = Object.create(S), e;
858
772
  }, t.awrap = function (e) {
859
773
  return {
860
774
  __await: e
@@ -966,49 +880,43 @@ function he() {
966
880
  function pe(e, t) {
967
881
  for (var r = 0; r < t.length; r++) {
968
882
  var n = t[r];
969
- 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) {
970
- if ("object" !== de(e) || null === e) return e;
971
- var r = e[Symbol.toPrimitive];
972
- if (void 0 !== r) {
973
- var n = r.call(e, t || "default");
974
- if ("object" !== de(n)) return n;
975
- throw new TypeError("@@toPrimitive must return a primitive value.");
976
- }
977
- return ("string" === t ? String : Number)(e);
978
- }(i, "string"), "symbol" === de(s) ? s : String(s)), n);
883
+ n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, _e(n.key), n);
979
884
  }
980
- var i, s;
981
885
  }
982
886
  function fe(e, t, r) {
983
887
  return t && pe(e.prototype, t), r && pe(e, r), Object.defineProperty(e, "prototype", {
984
888
  writable: !1
985
889
  }), e;
986
890
  }
987
- function _e(e, t) {
891
+ function _e(e) {
892
+ var t = function (e, t) {
893
+ if ("object" != de(e) || !e) return e;
894
+ var r = e[Symbol.toPrimitive];
895
+ if (void 0 !== r) {
896
+ var n = r.call(e, t || "default");
897
+ if ("object" != de(n)) return n;
898
+ throw new TypeError("@@toPrimitive must return a primitive value.");
899
+ }
900
+ return ("string" === t ? String : Number)(e);
901
+ }(e, "string");
902
+ return "symbol" == de(t) ? t : String(t);
903
+ }
904
+ function me(e, t) {
988
905
  if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
989
906
  }
990
- function me(e) {
991
- var t = be();
992
- return function () {
993
- var r,
994
- n = ke(e);
995
- if (t) {
996
- var i = ke(this).constructor;
997
- r = Reflect.construct(n, arguments, i);
998
- } else r = n.apply(this, arguments);
999
- return function (e, t) {
1000
- if (t && ("object" === de(t) || "function" == typeof t)) return t;
1001
- if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
1002
- return function (e) {
1003
- if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1004
- return e;
1005
- }(e);
1006
- }(this, r);
1007
- };
907
+ function ve(e, t, r) {
908
+ return t = ke(t), function (e, t) {
909
+ if (t && ("object" === de(t) || "function" == typeof t)) return t;
910
+ if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
911
+ return function (e) {
912
+ if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
913
+ return e;
914
+ }(e);
915
+ }(e, ge() ? Reflect.construct(t, r || [], ke(e).constructor) : t.apply(e, r));
1008
916
  }
1009
- function ve(e) {
917
+ function ye(e) {
1010
918
  var t = "function" == typeof Map ? new Map() : void 0;
1011
- return ve = function ve(e) {
919
+ return ye = function ye(e) {
1012
920
  if (null === e || !function (e) {
1013
921
  try {
1014
922
  return -1 !== Function.toString.call(e).indexOf("[native code]");
@@ -1022,7 +930,13 @@ function ve(e) {
1022
930
  t.set(e, r);
1023
931
  }
1024
932
  function r() {
1025
- return ye(e, arguments, ke(this).constructor);
933
+ return function (e, t, r) {
934
+ if (ge()) return Reflect.construct.apply(null, arguments);
935
+ var n = [null];
936
+ n.push.apply(n, t);
937
+ var i = new (e.bind.apply(e, n))();
938
+ return r && be(i, r.prototype), i;
939
+ }(e, arguments, ke(this).constructor);
1026
940
  }
1027
941
  return r.prototype = Object.create(e.prototype, {
1028
942
  constructor: {
@@ -1031,31 +945,21 @@ function ve(e) {
1031
945
  writable: !0,
1032
946
  configurable: !0
1033
947
  }
1034
- }), ge(r, e);
1035
- }, ve(e);
948
+ }), be(r, e);
949
+ }, ye(e);
1036
950
  }
1037
- function ye(e, t, r) {
1038
- return ye = be() ? Reflect.construct.bind() : function (e, t, r) {
1039
- var n = [null];
1040
- n.push.apply(n, t);
1041
- var i = new (Function.bind.apply(e, n))();
1042
- return r && ge(i, r.prototype), i;
1043
- }, ye.apply(null, arguments);
1044
- }
1045
- function be() {
1046
- if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
1047
- if (Reflect.construct.sham) return !1;
1048
- if ("function" == typeof Proxy) return !0;
951
+ function ge() {
1049
952
  try {
1050
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})), !0;
1051
- } catch (e) {
1052
- return !1;
1053
- }
953
+ var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
954
+ } catch (e) {}
955
+ return (ge = function ge() {
956
+ return !!e;
957
+ })();
1054
958
  }
1055
- function ge(e, t) {
1056
- return ge = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (e, t) {
959
+ function be(e, t) {
960
+ return be = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (e, t) {
1057
961
  return e.__proto__ = t, e;
1058
- }, ge(e, t);
962
+ }, be(e, t);
1059
963
  }
1060
964
  function ke(e) {
1061
965
  return ke = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (e) {
@@ -1066,9 +970,9 @@ function ke(e) {
1066
970
  e.emailMagicLinks = "emailMagicLinks", e.sso = "sso", e.passwords = "passwords", e.oauth = "oauth";
1067
971
  }(y || (y = {})), function (e) {
1068
972
  e.Discovery = "Discovery", e.Organization = "Organization", e.PasswordReset = "PasswordReset";
1069
- }(b || (b = {})), function (e) {
973
+ }(g || (g = {})), function (e) {
1070
974
  e.Google = "google", e.Microsoft = "microsoft";
1071
- }(g || (g = {}));
975
+ }(b || (b = {}));
1072
976
  var we,
1073
977
  Se = "https://accounts.google.com/gsi",
1074
978
  Ce = "".concat(Se, "/client");
@@ -1111,7 +1015,11 @@ function Oe(e, t, r, n) {
1111
1015
  }(we || (we = {}));
1112
1016
  var Pe,
1113
1017
  Ae = function (e) {
1114
- !function (e, t) {
1018
+ function t(e) {
1019
+ var r;
1020
+ return me(this, t), (r = ve(this, t, [e])).type = e, r;
1021
+ }
1022
+ return function (e, t) {
1115
1023
  if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
1116
1024
  e.prototype = Object.create(t && t.prototype, {
1117
1025
  constructor: {
@@ -1121,14 +1029,8 @@ var Pe,
1121
1029
  }
1122
1030
  }), Object.defineProperty(e, "prototype", {
1123
1031
  writable: !1
1124
- }), t && ge(e, t);
1125
- }(r, ve(Error));
1126
- var t = me(r);
1127
- function r(e) {
1128
- var n;
1129
- return _e(this, r), (n = t.call(this, e)).type = e, n;
1130
- }
1131
- return fe(r);
1032
+ }), t && be(e, t);
1033
+ }(t, ye(Error)), fe(t);
1132
1034
  }();
1133
1035
  function xe(e) {
1134
1036
  var t,
@@ -1362,7 +1264,7 @@ var Ke,
1362
1264
  s = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : function () {
1363
1265
  return Promise.resolve(void 0);
1364
1266
  };
1365
- _e(this, e), this.bootstrapPromise = n, this.isEnabled = function () {
1267
+ me(this, e), this.bootstrapPromise = n, this.isEnabled = function () {
1366
1268
  return Oe(i, void 0, void 0, he().mark(function e() {
1367
1269
  return he().wrap(function (e) {
1368
1270
  for (;;) switch (e.prev = e.next) {
@@ -1573,7 +1475,7 @@ var Ke,
1573
1475
  },
1574
1476
  Xe = function () {
1575
1477
  function e() {
1576
- _e(this, e);
1478
+ me(this, e);
1577
1479
  }
1578
1480
  return fe(e, null, [{
1579
1481
  key: "marshall",
@@ -1625,7 +1527,7 @@ var Ke,
1625
1527
  }(),
1626
1528
  Ze = function () {
1627
1529
  function e(t) {
1628
- _e(this, e), this.maxBatchSize = t.maxBatchSize, this.logEventURL = t.logEventURL, setInterval(this.flush.bind(this), t.intervalDurationMs), this.batch = [];
1530
+ me(this, e), this.maxBatchSize = t.maxBatchSize, this.logEventURL = t.logEventURL, setInterval(this.flush.bind(this), t.intervalDurationMs), this.batch = [];
1629
1531
  }
1630
1532
  return fe(e, [{
1631
1533
  key: "logEvent",
@@ -1675,7 +1577,7 @@ var Ke,
1675
1577
  }(Ke || (Ke = {}));
1676
1578
  var Qe = fe(function e(t, r) {
1677
1579
  var n = this;
1678
- _e(this, e), this._networkClient = t, this._subscriptionService = r, this.get = function () {
1580
+ me(this, e), this._networkClient = t, this._subscriptionService = r, this.get = function () {
1679
1581
  return Oe(n, void 0, void 0, he().mark(function e() {
1680
1582
  var t, r;
1681
1583
  return he().wrap(function (e) {
@@ -1841,7 +1743,7 @@ var Qe = fe(function e(t, r) {
1841
1743
  et = function () {
1842
1744
  function e(t, r) {
1843
1745
  var n = this;
1844
- _e(this, e), this._networkClient = t, this._subscriptionService = r, this.getSync = function () {
1746
+ me(this, e), this._networkClient = t, this._subscriptionService = r, this.getSync = function () {
1845
1747
  return n._subscriptionService.getSession();
1846
1748
  }, this.onChange = function (e) {
1847
1749
  var t = n._subscriptionService.getSession();
@@ -1943,7 +1845,7 @@ var Qe = fe(function e(t, r) {
1943
1845
  var s = this,
1944
1846
  o = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : tt,
1945
1847
  a = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : $e();
1946
- _e(this, e), this._networkClient = t, this._subscriptionService = r, this._pkceManager = n, this._passwordResetPKCEManager = i, this._config = o, this.dfpProtectedAuth = a, this.email = {
1848
+ me(this, e), this._networkClient = t, this._subscriptionService = r, this._pkceManager = n, this._passwordResetPKCEManager = i, this._config = o, this.dfpProtectedAuth = a, this.email = {
1947
1849
  loginOrCreate: function loginOrCreate(e) {
1948
1850
  var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
1949
1851
  return Oe(s, void 0, void 0, he().mark(function r() {
@@ -2136,7 +2038,7 @@ var Qe = fe(function e(t, r) {
2136
2038
  return Promise.resolve(void 0);
2137
2039
  },
2138
2040
  s = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : $e();
2139
- _e(this, e), this._networkClient = t, this._subscriptionService = r, this.executeRecaptcha = i, this.dfpProtectedAuth = s, this.sms = {
2041
+ me(this, e), this._networkClient = t, this._subscriptionService = r, this.executeRecaptcha = i, this.dfpProtectedAuth = s, this.sms = {
2140
2042
  loginOrCreate: function loginOrCreate(e, t) {
2141
2043
  return Oe(n, void 0, void 0, he().mark(function r() {
2142
2044
  var n, i, s, o;
@@ -2331,7 +2233,7 @@ var Qe = fe(function e(t, r) {
2331
2233
  }),
2332
2234
  it = function () {
2333
2235
  function e(t, r, n, i, s) {
2334
- _e(this, e), this._networkClient = t, this._subscriptionService = r, this._pkceManager = n, this._dynamicConfig = i, this._config = s, this.google = {
2236
+ me(this, e), this._networkClient = t, this._subscriptionService = r, this._pkceManager = n, this._dynamicConfig = i, this._config = s, this.google = {
2335
2237
  start: this.startOAuthFlow(p.Google)
2336
2238
  }, this.apple = {
2337
2239
  start: this.startOAuthFlow(p.Apple)
@@ -2494,7 +2396,7 @@ var Qe = fe(function e(t, r) {
2494
2396
  return Promise.resolve(void 0);
2495
2397
  },
2496
2398
  i = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : $e();
2497
- _e(this, e), this._networkClient = t, this._subscriptionService = r, this.executeRecaptcha = n, this.dfpProtectedAuth = i;
2399
+ me(this, e), this._networkClient = t, this._subscriptionService = r, this.executeRecaptcha = n, this.dfpProtectedAuth = i;
2498
2400
  }
2499
2401
  return fe(e, [{
2500
2402
  key: "authenticateStart",
@@ -2568,7 +2470,7 @@ var Qe = fe(function e(t, r) {
2568
2470
  }(),
2569
2471
  ot = function () {
2570
2472
  function e(t, r, n) {
2571
- _e(this, e), this._networkClient = t, this._subscriptionService = r, this.dfpProtectedAuth = n;
2473
+ me(this, e), this._networkClient = t, this._subscriptionService = r, this.dfpProtectedAuth = n;
2572
2474
  }
2573
2475
  return fe(e, [{
2574
2476
  key: "create",
@@ -2788,7 +2690,7 @@ var _t = {
2788
2690
  }),
2789
2691
  signal: ft(ut)
2790
2692
  },
2791
- bt = {
2693
+ gt = {
2792
2694
  type: pt(ut),
2793
2695
  id: pt(ut),
2794
2696
  rawId: pt(lt),
@@ -2805,7 +2707,7 @@ var _t = {
2805
2707
  return e.getClientExtensionResults();
2806
2708
  })
2807
2709
  },
2808
- gt = {
2710
+ bt = {
2809
2711
  mediation: ft(ut),
2810
2712
  publicKey: pt({
2811
2713
  challenge: pt(lt),
@@ -2836,7 +2738,7 @@ function wt(e) {
2836
2738
  return dt(at, yt, e);
2837
2739
  }
2838
2740
  function St(e) {
2839
- return dt(ct, bt, e);
2741
+ return dt(ct, gt, e);
2840
2742
  }
2841
2743
  function Ct(e) {
2842
2744
  return Oe(this, void 0, void 0, he().mark(function t() {
@@ -2855,7 +2757,7 @@ function Ct(e) {
2855
2757
  }));
2856
2758
  }
2857
2759
  function Tt(e) {
2858
- return dt(at, gt, e);
2760
+ return dt(at, bt, e);
2859
2761
  }
2860
2762
  function Ot(e) {
2861
2763
  return dt(ct, kt, e);
@@ -2878,7 +2780,7 @@ function Pt(e) {
2878
2780
  }
2879
2781
  var At = function () {
2880
2782
  function e(t, r, n) {
2881
- _e(this, e), this._networkClient = t, this._subscriptionService = r, this.dfpProtectedAuth = n, this.checkEligibleInputs = function () {
2783
+ me(this, e), this._networkClient = t, this._subscriptionService = r, this.dfpProtectedAuth = n, this.checkEligibleInputs = function () {
2882
2784
  return !(document.querySelectorAll("input[autocomplete*='webauthn']").length < 1) || (console.error('No <input> with `"webauthn"` in its `autocomplete` attribute was detected'), !1);
2883
2785
  };
2884
2786
  }
@@ -3066,7 +2968,7 @@ var At = function () {
3066
2968
  function e(t, r, n) {
3067
2969
  var i = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : xt,
3068
2970
  s = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : $e();
3069
- _e(this, e), this._networkClient = t, this._subscriptionService = r, this._pkceManager = n, this._config = i, this.dfpProtectedAuth = s;
2971
+ me(this, e), this._networkClient = t, this._subscriptionService = r, this._pkceManager = n, this._config = i, this.dfpProtectedAuth = s;
3070
2972
  }
3071
2973
  return fe(e, [{
3072
2974
  key: "getCodeChallenge",
@@ -3372,7 +3274,7 @@ Promise.resolve({
3372
3274
  });
3373
3275
  var Dt = function () {
3374
3276
  function e(t) {
3375
- _e(this, e), this.iframeURL = t, this.createIframe();
3277
+ me(this, e), this.iframeURL = t, this.createIframe();
3376
3278
  }
3377
3279
  return fe(e, [{
3378
3280
  key: "createIframe",
@@ -3422,7 +3324,7 @@ var Dt = function () {
3422
3324
  Rt = function () {
3423
3325
  function e(t, r) {
3424
3326
  var n = this;
3425
- _e(this, e), this._subscriptionService = t, this._headlessSessionClient = r, this._onDataChange = function (e) {
3327
+ me(this, e), this._subscriptionService = t, this._headlessSessionClient = r, this._onDataChange = function (e) {
3426
3328
  (null == e ? void 0 : e.session) ? n.scheduleBackgroundRefresh() : n.cancelBackgroundRefresh();
3427
3329
  }, this._reauthenticateWithBackoff = function () {
3428
3330
  return Oe(n, void 0, void 0, he().mark(function t() {
@@ -3728,11 +3630,10 @@ var Bt = /*#__PURE__*/function () {
3728
3630
  }();
3729
3631
  var Mt = /*#__PURE__*/function (_it) {
3730
3632
  _inherits(Mt, _it);
3731
- var _super = _createSuper(Mt);
3732
3633
  function Mt(e, t, r, n, i, s) {
3733
3634
  var _this4;
3734
3635
  _classCallCheck(this, Mt);
3735
- _this4 = _super.call(this, e, t, r, n, i), _this4._oneTap = s, _this4.startOneTap = function (e) {
3636
+ _this4 = _callSuper(this, Mt, [e, t, r, n, i]), _this4._oneTap = s, _this4.startOneTap = function (e) {
3736
3637
  return jt(_assertThisInitialized(_this4), void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
3737
3638
  var t, r, n;
3738
3639
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
@@ -3815,7 +3716,7 @@ var Nt = /*#__PURE__*/function () {
3815
3716
  },
3816
3717
  sdk: {
3817
3718
  identifier: "Stytch.js Javascript SDK",
3818
- version: "4.4.3"
3719
+ version: "4.5.0"
3819
3720
  }
3820
3721
  });
3821
3722
  }
@@ -4328,13 +4229,24 @@ var Yt = function e(t, r) {
4328
4229
  path: "/"
4329
4230
  });
4330
4231
  var Vt = function Vt(e) {
4331
- var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
4332
- return "stytch_sdk_state_".concat(e).concat(t ? "::".concat(t) : "");
4333
- };
4334
- var Jt = /*#__PURE__*/function () {
4335
- function Jt(e, t) {
4232
+ var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
4233
+ return "stytch_sdk_state_".concat(e).concat(t ? "::".concat(t) : "");
4234
+ },
4235
+ Jt = new Map(),
4236
+ $t = function $t(e) {
4237
+ clearTimeout(Jt.get(e));
4238
+ },
4239
+ Xt = function Xt(e, t, r) {
4240
+ $t(e);
4241
+ var n = setTimeout(function () {
4242
+ void 0 === Yt.get(e) && Yt.set(e, t, r);
4243
+ }, 10);
4244
+ return Jt.set(e, n), Yt.set(e, t, r);
4245
+ };
4246
+ var Zt = /*#__PURE__*/function () {
4247
+ function Zt(e, t) {
4336
4248
  var _this7 = this;
4337
- _classCallCheck(this, Jt);
4249
+ _classCallCheck(this, Zt);
4338
4250
  this.browserSessionStorage = {
4339
4251
  getItem: function getItem(e) {
4340
4252
  return sessionStorage.getItem(Vt(_this7.publicToken, e));
@@ -4356,7 +4268,7 @@ var Jt = /*#__PURE__*/function () {
4356
4268
  }
4357
4269
  this.state = n;
4358
4270
  }
4359
- _createClass(Jt, [{
4271
+ _createClass(Zt, [{
4360
4272
  key: "opaqueTokenCookieName",
4361
4273
  get: function get() {
4362
4274
  var e;
@@ -4394,14 +4306,14 @@ var Jt = /*#__PURE__*/function () {
4394
4306
  var s = e.state,
4395
4307
  o = e.session_token,
4396
4308
  a = e.session_jwt,
4397
- c = Jt.generateCookieOpts({
4309
+ c = Zt.generateCookieOpts({
4398
4310
  expiresAt: null !== (r = null === (t = null == s ? void 0 : s.session) || void 0 === t ? void 0 : t.expires_at) && void 0 !== r ? r : "",
4399
4311
  availableToSubdomains: this._cookieAvailableToSubdomains,
4400
4312
  path: this._cookiePath,
4401
4313
  domain: this._domain
4402
4314
  });
4403
- Yt.set(this.opaqueTokenCookieName, o, c), Yt.set(this.jwtCookieName, a, c);
4404
- var u = Jt.generateCookieOpts({
4315
+ Xt(this.opaqueTokenCookieName, o, c), Xt(this.jwtCookieName, a, c);
4316
+ var u = Zt.generateCookieOpts({
4405
4317
  expiresAt: null !== (i = null === (n = null == s ? void 0 : s.session) || void 0 === n ? void 0 : n.expires_at) && void 0 !== i ? i : "",
4406
4318
  availableToSubdomains: !this._cookieAvailableToSubdomains,
4407
4319
  path: this._cookiePath,
@@ -4413,13 +4325,13 @@ var Jt = /*#__PURE__*/function () {
4413
4325
  key: "writeIntermediateSessionTokenCookie",
4414
4326
  value: function writeIntermediateSessionTokenCookie(e) {
4415
4327
  var t = new Date(Date.now() + 6e5),
4416
- r = Jt.generateCookieOpts({
4328
+ r = Zt.generateCookieOpts({
4417
4329
  expiresAt: t.toString(),
4418
4330
  availableToSubdomains: this._cookieAvailableToSubdomains,
4419
4331
  path: this._cookiePath,
4420
4332
  domain: this._domain
4421
4333
  });
4422
- Yt.set(this.istCookieName, e, r);
4334
+ Xt(this.istCookieName, e, r);
4423
4335
  }
4424
4336
  }, {
4425
4337
  key: "removeSessionCookie",
@@ -4438,7 +4350,7 @@ var Jt = /*#__PURE__*/function () {
4438
4350
  [!0, !1].forEach(function (t) {
4439
4351
  [_this8._cookiePath, null].forEach(function (r) {
4440
4352
  [_this8._domain, null].forEach(function (n) {
4441
- var i = Jt.generateCookieOpts({
4353
+ var i = Zt.generateCookieOpts({
4442
4354
  expiresAt: new Date(0).toString(),
4443
4355
  availableToSubdomains: t,
4444
4356
  path: r,
@@ -4449,7 +4361,7 @@ var Jt = /*#__PURE__*/function () {
4449
4361
  });
4450
4362
  });
4451
4363
  });
4452
- });
4364
+ }), e.forEach($t);
4453
4365
  }
4454
4366
  }, {
4455
4367
  key: "syncToLocalStorage",
@@ -4494,31 +4406,30 @@ var Jt = /*#__PURE__*/function () {
4494
4406
  return e && (i.path = e), Boolean("localhost" === window.location.hostname || "[::1]" === window.location.hostname || window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/)) ? i.secure = !1 : (r && (i.domain = t || window.location.host), i.secure = !0), i;
4495
4407
  }
4496
4408
  }]);
4497
- return Jt;
4409
+ return Zt;
4498
4410
  }();
4499
- var $t = /*#__PURE__*/function (_Jt) {
4500
- _inherits($t, _Jt);
4501
- var _super2 = _createSuper($t);
4502
- function $t() {
4503
- _classCallCheck(this, $t);
4504
- return _super2.apply(this, arguments);
4411
+ var Qt = /*#__PURE__*/function (_Zt) {
4412
+ _inherits(Qt, _Zt);
4413
+ function Qt() {
4414
+ _classCallCheck(this, Qt);
4415
+ return _callSuper(this, Qt, arguments);
4505
4416
  }
4506
- return _createClass($t);
4507
- }(Jt);
4508
- var Xt = Symbol["for"]("__stytch_DataLayer"),
4509
- Zt = function Zt(e, t) {
4417
+ return _createClass(Qt);
4418
+ }(Zt);
4419
+ var er = Symbol["for"]("__stytch_DataLayer"),
4420
+ tr = function tr(e, t) {
4510
4421
  var r = function () {
4511
4422
  var e = window;
4512
- return e[Xt] || (e[Xt] = {}), e[Xt];
4423
+ return e[er] || (e[er] = {}), e[er];
4513
4424
  }();
4514
- return r[e] || (r[e] = new $t(e, t)), r[e];
4425
+ return r[e] || (r[e] = new Qt(e, t)), r[e];
4515
4426
  },
4516
- Qt = function Qt(e, t) {
4427
+ rr = function rr(e, t) {
4517
4428
  Object.values(e).forEach(function (e) {
4518
4429
  return e(t);
4519
4430
  });
4520
4431
  },
4521
- er = function () {
4432
+ nr = function () {
4522
4433
  var e = (arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}).KEYS_TO_EXCLUDE,
4523
4434
  t = void 0 === e ? [] : e;
4524
4435
  return function e(r, n) {
@@ -4537,10 +4448,10 @@ var Xt = Symbol["for"]("__stytch_DataLayer"),
4537
4448
  }({
4538
4449
  KEYS_TO_EXCLUDE: ["last_accessed_at"]
4539
4450
  });
4540
- var tr = /*#__PURE__*/function () {
4541
- function tr(e, t) {
4451
+ var ir = /*#__PURE__*/function () {
4452
+ function ir(e, t) {
4542
4453
  var _this10 = this;
4543
- _classCallCheck(this, tr);
4454
+ _classCallCheck(this, ir);
4544
4455
  this._publicToken = e, this._datalayer = t, this._listen = function (e) {
4545
4456
  if (e.key !== Vt(_this10._publicToken)) return;
4546
4457
  var t = null === e.newValue || "null" === e.newValue ? null : JSON.parse(e.newValue);
@@ -4550,7 +4461,7 @@ var tr = /*#__PURE__*/function () {
4550
4461
  r = _this$_datalayer$read.session_token;
4551
4462
  r || this.destroySession();
4552
4463
  }
4553
- _createClass(tr, [{
4464
+ _createClass(ir, [{
4554
4465
  key: "getTokens",
4555
4466
  value: function getTokens() {
4556
4467
  var _this$_datalayer$read2 = this._datalayer.readSessionCookie(),
@@ -4588,7 +4499,7 @@ var tr = /*#__PURE__*/function () {
4588
4499
  r = null === e.state ? null : Object.assign(Object.assign({}, this._datalayer.state), e.state);
4589
4500
  this._datalayer.state = r;
4590
4501
  var n = e.state ? Object.keys(e.state) : [];
4591
- !this._datalayer.markStateKeysUpdated(n) && er(t, r) || Qt(this._datalayer.subscriptions, r);
4502
+ !this._datalayer.markStateKeysUpdated(n) && nr(t, r) || rr(this._datalayer.subscriptions, r);
4592
4503
  }
4593
4504
  }, {
4594
4505
  key: "updateStateAndTokens",
@@ -4603,8 +4514,8 @@ var tr = /*#__PURE__*/function () {
4603
4514
  this._datalayer.state = r;
4604
4515
  var n = e ? Object.keys(e) : [],
4605
4516
  i = this._datalayer.markStateKeysUpdated(n),
4606
- s = !er(t, r);
4607
- (i || s) && (Qt(this._datalayer.subscriptions, r), s && this._datalayer.syncToLocalStorage());
4517
+ s = !nr(t, r);
4518
+ (i || s) && (rr(this._datalayer.subscriptions, r), s && this._datalayer.syncToLocalStorage());
4608
4519
  }
4609
4520
  }, {
4610
4521
  key: "updateTokens",
@@ -4644,15 +4555,14 @@ var tr = /*#__PURE__*/function () {
4644
4555
  return null;
4645
4556
  }
4646
4557
  }]);
4647
- return tr;
4558
+ return ir;
4648
4559
  }();
4649
- var rr = /*#__PURE__*/function (_tr) {
4650
- _inherits(rr, _tr);
4651
- var _super3 = _createSuper(rr);
4652
- function rr() {
4560
+ var sr = /*#__PURE__*/function (_ir) {
4561
+ _inherits(sr, _ir);
4562
+ function sr() {
4653
4563
  var _this11;
4654
- _classCallCheck(this, rr);
4655
- _this11 = _super3.apply(this, arguments), _this11.updateUser = function (e) {
4564
+ _classCallCheck(this, sr);
4565
+ _this11 = _callSuper(this, sr, arguments), _this11.updateUser = function (e) {
4656
4566
  return _this11.updateState({
4657
4567
  user: e
4658
4568
  });
@@ -4665,12 +4575,12 @@ var rr = /*#__PURE__*/function (_tr) {
4665
4575
  };
4666
4576
  return _this11;
4667
4577
  }
4668
- return _createClass(rr);
4669
- }(tr);
4670
- var nr = Symbol["for"]("stytch__internal_b2c");
4671
- var ir = /*#__PURE__*/_createClass(function ir(e, t) {
4578
+ return _createClass(sr);
4579
+ }(ir);
4580
+ var or = Symbol["for"]("stytch__internal_b2c");
4581
+ var ar = /*#__PURE__*/_createClass(function ar(e, t) {
4672
4582
  var _this12 = this;
4673
- _classCallCheck(this, ir);
4583
+ _classCallCheck(this, ar);
4674
4584
  var r;
4675
4585
  !function (e) {
4676
4586
  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";
@@ -4688,7 +4598,7 @@ var ir = /*#__PURE__*/_createClass(function ir(e, t) {
4688
4598
  }
4689
4599
  };
4690
4600
  var s, o, a, c, u, l, d, h, p, f, _;
4691
- this._dataLayer = Zt(e, n), this._subscriptionService = new rr(e, this._dataLayer);
4601
+ this._dataLayer = tr(e, n), this._subscriptionService = new sr(e, this._dataLayer);
4692
4602
  var m = new Wt(this._dataLayer, "passwords");
4693
4603
  this._networkClient = new Nt(e, this._dataLayer, i.endpoints.sdkBackendURL, function () {
4694
4604
  var e, t, r, n;
@@ -4699,16 +4609,16 @@ var ir = /*#__PURE__*/_createClass(function ir(e, t) {
4699
4609
  });
4700
4610
  var v = new Ft(e, this._networkClient, this._dataLayer),
4701
4611
  y = new Lt(v.getAsync()),
4702
- b = new Je(e, i.endpoints.dfpBackendURL, v.getAsync(), y.executeRecaptcha),
4703
- g = new Bt(i.endpoints.clientsideServicesIframeURL),
4704
- k = new Kt(e, g),
4612
+ g = new Je(e, i.endpoints.dfpBackendURL, v.getAsync(), y.executeRecaptcha),
4613
+ b = new Bt(i.endpoints.clientsideServicesIframeURL),
4614
+ k = new Kt(e, b),
4705
4615
  w = new Gt(this._networkClient);
4706
4616
  var S, C;
4707
- this.user = new Qe(this._networkClient, this._subscriptionService), this.session = new et(this._networkClient, this._subscriptionService), this.magicLinks = new rt(this._networkClient, this._subscriptionService, new Wt(this._dataLayer, "magic_links"), m, v.getAsync(), b), this.otps = new nt(this._networkClient, this._subscriptionService, y.executeRecaptcha, b), this.oauth = new Mt(this._networkClient, this._subscriptionService, new Wt(this._dataLayer, "oauth"), v.getAsync(), {
4617
+ this.user = new Qe(this._networkClient, this._subscriptionService), this.session = new et(this._networkClient, this._subscriptionService), this.magicLinks = new rt(this._networkClient, this._subscriptionService, new Wt(this._dataLayer, "magic_links"), m, v.getAsync(), g), this.otps = new nt(this._networkClient, this._subscriptionService, y.executeRecaptcha, g), this.oauth = new Mt(this._networkClient, this._subscriptionService, new Wt(this._dataLayer, "oauth"), v.getAsync(), {
4708
4618
  publicToken: e,
4709
4619
  testAPIURL: i.endpoints.testAPIURL,
4710
4620
  liveAPIURL: i.endpoints.liveAPIURL
4711
- }, k), this.cryptoWallets = new st(this._networkClient, this._subscriptionService, y.executeRecaptcha, b), this.totps = new ot(this._networkClient, this._subscriptionService, b), this.webauthn = new At(this._networkClient, this._subscriptionService, b), this.passwords = new Et(this._networkClient, this._subscriptionService, m, v.getAsync(), b), this._sessionManager = new Rt(this._subscriptionService, this.session), this._dataLayer.readSessionCookie().session_token && this._sessionManager.performBackgroundRefresh(), this._networkClient.logEvent({
4621
+ }, k), this.cryptoWallets = new st(this._networkClient, this._subscriptionService, y.executeRecaptcha, g), this.totps = new ot(this._networkClient, this._subscriptionService, g), this.webauthn = new At(this._networkClient, this._subscriptionService, g), this.passwords = new Et(this._networkClient, this._subscriptionService, m, v.getAsync(), g), this._sessionManager = new Rt(this._subscriptionService, this.session), this._dataLayer.readSessionCookie().session_token && this._sessionManager.performBackgroundRefresh(), this._networkClient.logEvent({
4712
4622
  name: "sdk_instance_instantiated",
4713
4623
  details: {
4714
4624
  event_callback_registered: !1,
@@ -4717,13 +4627,13 @@ var ir = /*#__PURE__*/_createClass(function ir(e, t) {
4717
4627
  }
4718
4628
  }), S = this, C = {
4719
4629
  bootstrap: v,
4720
- clientsideServices: g,
4630
+ clientsideServices: b,
4721
4631
  captcha: y,
4722
4632
  oneTap: k,
4723
4633
  searchManager: w,
4724
4634
  publicToken: e,
4725
4635
  dataLayer: this._dataLayer,
4726
4636
  networkClient: this._networkClient
4727
- }, Object.assign(S, _defineProperty({}, nr, C));
4637
+ }, Object.assign(S, _defineProperty({}, or, C));
4728
4638
  });
4729
- export { b as AuthFlowType, g as B2BOAuthProviders, y as B2BProducts, X as BiometricsFailedError, F as BiometricsUnavailableError, z as ChallengeSigningFailedError, U as DeviceCredentialsNotAllowedError, V as FailedCodeChallengeError, $ as FailedToDecryptDataError, R as InternalError, G as InvalidAuthorizationCredentialError, te as InvalidCredentialTypeError, Q as InvalidRedirectSchemeError, Z as InvalidStartUrlError, ne as JSONDataNotConvertibleToStringError, j as KeyInvalidatedError, L as KeystoreUnavailableError, re as MissingAttestationObjectError, W as MissingAuthorizationCredentialIDTokenError, K as MissingGoogleClientIDError, q as MissingPKCEError, H as MissingPublicKeyError, ee as MissingUrlError, B as NoBiometricsEnrolledError, I as NoBiometricsRegistrationError, D as NoCurrentSessionError, p as OAuthProviders, m as OTPMethods, _ as OneTapPositions, se as PasskeysInvalidEncoding, J as PasskeysUnsupportedError, h as Products, ie as RandomNumberGenerationFailed, k as SDKAPIUnreachableError, Y as SDKNotConfiguredError, x as StytchAPIError, A as StytchAPISchemaError, P as StytchAPIUnreachableError, O as StytchError, v as StytchEventType, ir as StytchHeadlessClient, C as StytchSDKAPIError, E as StytchSDKError, S as StytchSDKSchemaError, w as StytchSDKUsageError, T as UNRECOVERABLE_ERROR_TYPES, M as UserCancellationError, N as UserLockedOutError, f as Wallets, oe as errorToStytchError };
4639
+ export { g as AuthFlowType, b as B2BOAuthProviders, y as B2BProducts, X as BiometricsFailedError, F as BiometricsUnavailableError, z as ChallengeSigningFailedError, U as DeviceCredentialsNotAllowedError, V as FailedCodeChallengeError, $ as FailedToDecryptDataError, R as InternalError, G as InvalidAuthorizationCredentialError, te as InvalidCredentialTypeError, Q as InvalidRedirectSchemeError, Z as InvalidStartUrlError, ne as JSONDataNotConvertibleToStringError, j as KeyInvalidatedError, L as KeystoreUnavailableError, re as MissingAttestationObjectError, W as MissingAuthorizationCredentialIDTokenError, K as MissingGoogleClientIDError, q as MissingPKCEError, H as MissingPublicKeyError, ee as MissingUrlError, B as NoBiometricsEnrolledError, I as NoBiometricsRegistrationError, D as NoCurrentSessionError, p as OAuthProviders, m as OTPMethods, _ as OneTapPositions, se as PasskeysInvalidEncoding, J as PasskeysUnsupportedError, h as Products, ie as RandomNumberGenerationFailed, k as SDKAPIUnreachableError, Y as SDKNotConfiguredError, x as StytchAPIError, A as StytchAPISchemaError, P as StytchAPIUnreachableError, O as StytchError, v as StytchEventType, ar as StytchHeadlessClient, C as StytchSDKAPIError, E as StytchSDKError, S as StytchSDKSchemaError, w as StytchSDKUsageError, T as UNRECOVERABLE_ERROR_TYPES, M as UserCancellationError, N as UserLockedOutError, f as Wallets, oe as errorToStytchError };