@stytch/nextjs 12.0.0 → 13.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/dist/Stytch.d.ts +172 -0
- package/dist/Stytch.js +214 -0
- package/dist/Stytch.js.map +1 -0
- package/dist/Stytch.spec.d.ts +1 -0
- package/dist/Stytch.spec.js +130 -0
- package/dist/Stytch.spec.js.map +1 -0
- package/dist/StytchContext.d.ts +104 -0
- package/dist/StytchContext.js +180 -0
- package/dist/StytchContext.js.map +1 -0
- package/dist/StytchContext.serverside.spec.d.ts +4 -0
- package/dist/StytchContext.serverside.spec.js +51 -0
- package/dist/StytchContext.serverside.spec.js.map +1 -0
- package/dist/StytchContext.spec.d.ts +1 -0
- package/dist/StytchContext.spec.js +212 -0
- package/dist/StytchContext.spec.js.map +1 -0
- package/dist/StytchSSRProxy.d.ts +2 -0
- package/dist/StytchSSRProxy.js +29 -0
- package/dist/StytchSSRProxy.js.map +1 -0
- package/dist/StytchSSRProxy.spec.d.ts +1 -0
- package/dist/StytchSSRProxy.spec.js +16 -0
- package/dist/StytchSSRProxy.spec.js.map +1 -0
- package/dist/b2b/Stytch.d.ts +104 -0
- package/dist/b2b/Stytch.js +90 -0
- package/dist/b2b/Stytch.js.map +1 -0
- package/dist/b2b/StytchB2BContext.d.ts +104 -0
- package/dist/b2b/StytchB2BContext.js +179 -0
- package/dist/b2b/StytchB2BContext.js.map +1 -0
- package/dist/b2b/StytchB2BContext.spec.d.ts +1 -0
- package/dist/b2b/StytchB2BContext.spec.js +217 -0
- package/dist/b2b/StytchB2BContext.spec.js.map +1 -0
- package/dist/b2b/createStytchB2BHeadlessClient.d.ts +15 -0
- package/dist/b2b/createStytchB2BHeadlessClient.js +26 -0
- package/dist/b2b/createStytchB2BHeadlessClient.js.map +1 -0
- package/dist/b2b/createStytchB2BUIClient.d.ts +16 -0
- package/dist/b2b/createStytchB2BUIClient.js +27 -0
- package/dist/b2b/createStytchB2BUIClient.js.map +1 -0
- package/dist/b2b/index.d.ts +3 -208
- package/dist/b2b/index.headless.d.ts +1 -16
- package/dist/b2b/index.headless.esm.js +569 -612
- package/dist/b2b/index.headless.js +17 -4164
- package/dist/b2b/index.headless.js.map +1 -0
- package/dist/b2b/index.js +14 -250
- package/dist/b2b/index.js.map +1 -0
- package/dist/b2b/index.ui.d.ts +1 -17
- package/dist/b2b/index.ui.js +16 -64
- package/dist/b2b/index.ui.js.map +1 -0
- package/dist/createStytchHeadlessClient.d.ts +15 -0
- package/dist/createStytchHeadlessClient.js +26 -0
- package/dist/createStytchHeadlessClient.js.map +1 -0
- package/dist/createStytchUIClient.d.ts +16 -0
- package/dist/createStytchUIClient.js +27 -0
- package/dist/createStytchUIClient.js.map +1 -0
- package/dist/index.d.ts +3 -244
- package/dist/index.esm.d.ts +32 -1
- package/dist/index.esm.js +56 -1
- package/dist/index.headless.d.ts +1 -16
- package/dist/index.headless.js +16 -63
- package/dist/index.headless.js.map +1 -0
- package/dist/index.js +16 -318
- package/dist/index.js.map +1 -0
- package/dist/index.ui.d.ts +1 -17
- package/dist/index.ui.js +16 -64
- package/dist/index.ui.js.map +1 -0
- package/dist/utils/async.d.ts +2 -0
- package/dist/utils/async.js +22 -0
- package/dist/utils/async.js.map +1 -0
- package/dist/utils/errors.d.ts +3 -0
- package/dist/utils/errors.js +28 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/invariant.d.ts +1 -0
- package/dist/utils/invariant.js +10 -0
- package/dist/utils/invariant.js.map +1 -0
- package/dist/utils/useIsomorphicLayoutEffect.d.ts +3 -0
- package/dist/utils/useIsomorphicLayoutEffect.js +7 -0
- package/dist/utils/useIsomorphicLayoutEffect.js.map +1 -0
- package/package.json +3 -3
|
@@ -6,32 +6,32 @@ else {
|
|
|
6
6
|
} return obj; }
|
|
7
7
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
8
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
-
function _iterableToArrayLimit(
|
|
10
|
-
var
|
|
9
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) {
|
|
10
|
+
var e, n, i, u, a = [], f = !0, o = !1;
|
|
11
11
|
try {
|
|
12
|
-
if (
|
|
13
|
-
if (Object(
|
|
12
|
+
if (i = (t = t.call(r)).next, 0 === l) {
|
|
13
|
+
if (Object(t) !== t)
|
|
14
14
|
return;
|
|
15
|
-
|
|
15
|
+
f = !1;
|
|
16
16
|
}
|
|
17
17
|
else
|
|
18
|
-
for (; !(
|
|
18
|
+
for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0)
|
|
19
19
|
;
|
|
20
20
|
}
|
|
21
|
-
catch (
|
|
22
|
-
|
|
21
|
+
catch (r) {
|
|
22
|
+
o = !0, n = r;
|
|
23
23
|
}
|
|
24
24
|
finally {
|
|
25
25
|
try {
|
|
26
|
-
if (!
|
|
26
|
+
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u))
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
29
|
finally {
|
|
30
|
-
if (
|
|
31
|
-
throw
|
|
30
|
+
if (o)
|
|
31
|
+
throw n;
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
return
|
|
34
|
+
return a;
|
|
35
35
|
} }
|
|
36
36
|
function _arrayWithHoles(arr) { if (Array.isArray(arr))
|
|
37
37
|
return arr; }
|
|
@@ -42,144 +42,143 @@ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symb
|
|
|
42
42
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr))
|
|
43
43
|
return _arrayLikeToArray(arr); }
|
|
44
44
|
function _regeneratorRuntime() {
|
|
45
|
-
_regeneratorRuntime = function _regeneratorRuntime() { return
|
|
46
|
-
var
|
|
47
|
-
function define(
|
|
45
|
+
_regeneratorRuntime = function _regeneratorRuntime() { return e; };
|
|
46
|
+
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";
|
|
47
|
+
function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; }
|
|
48
48
|
try {
|
|
49
49
|
define({}, "");
|
|
50
50
|
}
|
|
51
|
-
catch (
|
|
52
|
-
define = function define(
|
|
51
|
+
catch (t) {
|
|
52
|
+
define = function define(t, e, r) { return t[e] = r; };
|
|
53
53
|
}
|
|
54
|
-
function wrap(
|
|
55
|
-
function tryCatch(
|
|
56
|
-
return { type: "normal", arg:
|
|
54
|
+
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; }
|
|
55
|
+
function tryCatch(t, e, r) { try {
|
|
56
|
+
return { type: "normal", arg: t.call(e, r) };
|
|
57
57
|
}
|
|
58
|
-
catch (
|
|
59
|
-
return { type: "throw", arg:
|
|
58
|
+
catch (t) {
|
|
59
|
+
return { type: "throw", arg: t };
|
|
60
60
|
} }
|
|
61
|
-
|
|
62
|
-
var
|
|
61
|
+
e.wrap = wrap;
|
|
62
|
+
var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {};
|
|
63
63
|
function Generator() { }
|
|
64
64
|
function GeneratorFunction() { }
|
|
65
65
|
function GeneratorFunctionPrototype() { }
|
|
66
|
-
var
|
|
67
|
-
define(
|
|
68
|
-
var
|
|
69
|
-
|
|
70
|
-
var
|
|
71
|
-
function defineIteratorMethods(
|
|
72
|
-
function AsyncIterator(
|
|
73
|
-
var
|
|
74
|
-
return
|
|
75
|
-
}
|
|
76
|
-
function makeInvokeMethod(
|
|
77
|
-
throw new Error("Generator is already running"); if (
|
|
78
|
-
if ("throw" ===
|
|
79
|
-
throw
|
|
80
|
-
return
|
|
81
|
-
} for (
|
|
82
|
-
var
|
|
83
|
-
if (
|
|
84
|
-
var
|
|
85
|
-
if (
|
|
86
|
-
if (
|
|
66
|
+
var p = {};
|
|
67
|
+
define(p, a, function () { return this; });
|
|
68
|
+
var d = Object.getPrototypeOf, v = d && d(d(values([])));
|
|
69
|
+
v && v !== r && n.call(v, a) && (p = v);
|
|
70
|
+
var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
|
|
71
|
+
function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); }
|
|
72
|
+
function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) {
|
|
73
|
+
var u = c.arg, h = u.value;
|
|
74
|
+
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); });
|
|
75
|
+
} 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(); } }); }
|
|
76
|
+
function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f)
|
|
77
|
+
throw new Error("Generator is already running"); if (o === s) {
|
|
78
|
+
if ("throw" === i)
|
|
79
|
+
throw a;
|
|
80
|
+
return { value: t, done: !0 };
|
|
81
|
+
} for (n.method = i, n.arg = a;;) {
|
|
82
|
+
var c = n.delegate;
|
|
83
|
+
if (c) {
|
|
84
|
+
var u = maybeInvokeDelegate(c, n);
|
|
85
|
+
if (u) {
|
|
86
|
+
if (u === y)
|
|
87
87
|
continue;
|
|
88
|
-
return
|
|
88
|
+
return u;
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
if ("next" ===
|
|
92
|
-
|
|
93
|
-
else if ("throw" ===
|
|
94
|
-
if (
|
|
95
|
-
throw
|
|
96
|
-
|
|
91
|
+
if ("next" === n.method)
|
|
92
|
+
n.sent = n._sent = n.arg;
|
|
93
|
+
else if ("throw" === n.method) {
|
|
94
|
+
if (o === h)
|
|
95
|
+
throw o = s, n.arg;
|
|
96
|
+
n.dispatchException(n.arg);
|
|
97
97
|
}
|
|
98
98
|
else
|
|
99
|
-
"return" ===
|
|
100
|
-
|
|
101
|
-
var
|
|
102
|
-
if ("normal" ===
|
|
103
|
-
if (
|
|
99
|
+
"return" === n.method && n.abrupt("return", n.arg);
|
|
100
|
+
o = f;
|
|
101
|
+
var p = tryCatch(e, r, n);
|
|
102
|
+
if ("normal" === p.type) {
|
|
103
|
+
if (o = n.done ? s : l, p.arg === y)
|
|
104
104
|
continue;
|
|
105
|
-
return { value:
|
|
105
|
+
return { value: p.arg, done: n.done };
|
|
106
106
|
}
|
|
107
|
-
"throw" ===
|
|
107
|
+
"throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
|
|
108
108
|
} }; }
|
|
109
|
-
function maybeInvokeDelegate(
|
|
110
|
-
return
|
|
111
|
-
return
|
|
112
|
-
function pushTryEntry(
|
|
113
|
-
function resetTryEntry(
|
|
114
|
-
function Context(
|
|
115
|
-
function values(
|
|
116
|
-
var
|
|
117
|
-
if (
|
|
118
|
-
return
|
|
119
|
-
if ("function" == typeof
|
|
120
|
-
return
|
|
121
|
-
if (!isNaN(
|
|
122
|
-
var
|
|
123
|
-
if (
|
|
124
|
-
return next.value =
|
|
125
|
-
return
|
|
109
|
+
function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t)
|
|
110
|
+
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)
|
|
111
|
+
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); }
|
|
112
|
+
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); }
|
|
113
|
+
function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; }
|
|
114
|
+
function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); }
|
|
115
|
+
function values(e) { if (e || "" === e) {
|
|
116
|
+
var r = e[a];
|
|
117
|
+
if (r)
|
|
118
|
+
return r.call(e);
|
|
119
|
+
if ("function" == typeof e.next)
|
|
120
|
+
return e;
|
|
121
|
+
if (!isNaN(e.length)) {
|
|
122
|
+
var o = -1, i = function next() { for (; ++o < e.length;)
|
|
123
|
+
if (n.call(e, o))
|
|
124
|
+
return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; };
|
|
125
|
+
return i.next = i;
|
|
126
126
|
}
|
|
127
|
-
}
|
|
128
|
-
function
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
throw
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
if ("root" === entry.tryLoc)
|
|
127
|
+
} throw new TypeError(_typeof(e) + " is not iterable"); }
|
|
128
|
+
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)
|
|
129
|
+
r.push(n); return r.reverse(), function next() { for (; r.length;) {
|
|
130
|
+
var t = r.pop();
|
|
131
|
+
if (t in e)
|
|
132
|
+
return next.value = t, next.done = !1, next;
|
|
133
|
+
} 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)
|
|
134
|
+
for (var r in this)
|
|
135
|
+
"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)
|
|
136
|
+
throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done)
|
|
137
|
+
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) {
|
|
138
|
+
var i = this.tryEntries[o], a = i.completion;
|
|
139
|
+
if ("root" === i.tryLoc)
|
|
141
140
|
return handle("end");
|
|
142
|
-
if (
|
|
143
|
-
var
|
|
144
|
-
if (
|
|
145
|
-
if (this.prev <
|
|
146
|
-
return handle(
|
|
147
|
-
if (this.prev <
|
|
148
|
-
return handle(
|
|
141
|
+
if (i.tryLoc <= this.prev) {
|
|
142
|
+
var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc");
|
|
143
|
+
if (c && u) {
|
|
144
|
+
if (this.prev < i.catchLoc)
|
|
145
|
+
return handle(i.catchLoc, !0);
|
|
146
|
+
if (this.prev < i.finallyLoc)
|
|
147
|
+
return handle(i.finallyLoc);
|
|
149
148
|
}
|
|
150
|
-
else if (
|
|
151
|
-
if (this.prev <
|
|
152
|
-
return handle(
|
|
149
|
+
else if (c) {
|
|
150
|
+
if (this.prev < i.catchLoc)
|
|
151
|
+
return handle(i.catchLoc, !0);
|
|
153
152
|
}
|
|
154
153
|
else {
|
|
155
|
-
if (!
|
|
154
|
+
if (!u)
|
|
156
155
|
throw new Error("try statement without catch or finally");
|
|
157
|
-
if (this.prev <
|
|
158
|
-
return handle(
|
|
156
|
+
if (this.prev < i.finallyLoc)
|
|
157
|
+
return handle(i.finallyLoc);
|
|
159
158
|
}
|
|
160
159
|
}
|
|
161
|
-
} }, abrupt: function abrupt(
|
|
162
|
-
var
|
|
163
|
-
if (
|
|
164
|
-
var
|
|
160
|
+
} }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
|
161
|
+
var o = this.tryEntries[r];
|
|
162
|
+
if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
|
|
163
|
+
var i = o;
|
|
165
164
|
break;
|
|
166
165
|
}
|
|
167
|
-
}
|
|
168
|
-
throw
|
|
169
|
-
var
|
|
170
|
-
if (
|
|
171
|
-
return this.complete(
|
|
172
|
-
} }, "catch": function _catch(
|
|
173
|
-
var
|
|
174
|
-
if (
|
|
175
|
-
var
|
|
176
|
-
if ("throw" ===
|
|
177
|
-
var
|
|
178
|
-
resetTryEntry(
|
|
166
|
+
} 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)
|
|
167
|
+
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) {
|
|
168
|
+
var r = this.tryEntries[e];
|
|
169
|
+
if (r.finallyLoc === t)
|
|
170
|
+
return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
|
|
171
|
+
} }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
172
|
+
var r = this.tryEntries[e];
|
|
173
|
+
if (r.tryLoc === t) {
|
|
174
|
+
var n = r.completion;
|
|
175
|
+
if ("throw" === n.type) {
|
|
176
|
+
var o = n.arg;
|
|
177
|
+
resetTryEntry(r);
|
|
179
178
|
}
|
|
180
|
-
return
|
|
179
|
+
return o;
|
|
181
180
|
}
|
|
182
|
-
} throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(
|
|
181
|
+
} 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;
|
|
183
182
|
}
|
|
184
183
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) {
|
|
185
184
|
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
@@ -278,9 +277,9 @@ catch (e) {
|
|
|
278
277
|
function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
|
|
279
278
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
280
279
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
281
|
-
function _typeof(
|
|
280
|
+
function _typeof(o) {
|
|
282
281
|
"@babel/helpers - typeof";
|
|
283
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (
|
|
282
|
+
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);
|
|
284
283
|
}
|
|
285
284
|
function e(e, r) {
|
|
286
285
|
return function (e) {
|
|
@@ -343,12 +342,12 @@ function n(e) {
|
|
|
343
342
|
function i() {
|
|
344
343
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
345
344
|
i = function i() {
|
|
346
|
-
return
|
|
345
|
+
return t;
|
|
347
346
|
};
|
|
348
|
-
var e = {},
|
|
347
|
+
var e, t = {}, r = Object.prototype, o = r.hasOwnProperty, s = Object.defineProperty || function (e, t, r) {
|
|
349
348
|
e[t] = r.value;
|
|
350
|
-
},
|
|
351
|
-
function
|
|
349
|
+
}, a = "function" == typeof Symbol ? Symbol : {}, c = a.iterator || "@@iterator", u = a.asyncIterator || "@@asyncIterator", l = a.toStringTag || "@@toStringTag";
|
|
350
|
+
function d(e, t, r) {
|
|
352
351
|
return Object.defineProperty(e, t, {
|
|
353
352
|
value: r,
|
|
354
353
|
enumerable: !0,
|
|
@@ -357,20 +356,20 @@ function i() {
|
|
|
357
356
|
}), e[t];
|
|
358
357
|
}
|
|
359
358
|
try {
|
|
360
|
-
|
|
359
|
+
d({}, "");
|
|
361
360
|
}
|
|
362
361
|
catch (e) {
|
|
363
|
-
|
|
362
|
+
d = function d(e, t, r) {
|
|
364
363
|
return e[t] = r;
|
|
365
364
|
};
|
|
366
365
|
}
|
|
367
|
-
function
|
|
368
|
-
var i = t && t.prototype instanceof
|
|
369
|
-
return o
|
|
370
|
-
value:
|
|
371
|
-
}),
|
|
366
|
+
function h(e, t, r, n) {
|
|
367
|
+
var i = t && t.prototype instanceof g ? t : g, o = Object.create(i.prototype), a = new x(n || []);
|
|
368
|
+
return s(o, "_invoke", {
|
|
369
|
+
value: P(e, r, a)
|
|
370
|
+
}), o;
|
|
372
371
|
}
|
|
373
|
-
function
|
|
372
|
+
function p(e, t, r) {
|
|
374
373
|
try {
|
|
375
374
|
return {
|
|
376
375
|
type: "normal",
|
|
@@ -384,177 +383,172 @@ function i() {
|
|
|
384
383
|
};
|
|
385
384
|
}
|
|
386
385
|
}
|
|
387
|
-
|
|
388
|
-
var _ = {};
|
|
389
|
-
function
|
|
390
|
-
function
|
|
391
|
-
function
|
|
392
|
-
var
|
|
393
|
-
|
|
386
|
+
t.wrap = h;
|
|
387
|
+
var _ = "suspendedStart", m = "suspendedYield", f = "executing", v = "completed", b = {};
|
|
388
|
+
function g() { }
|
|
389
|
+
function y() { }
|
|
390
|
+
function k() { }
|
|
391
|
+
var S = {};
|
|
392
|
+
d(S, c, function () {
|
|
394
393
|
return this;
|
|
395
394
|
});
|
|
396
|
-
var
|
|
397
|
-
|
|
398
|
-
var
|
|
399
|
-
function
|
|
395
|
+
var w = Object.getPrototypeOf, A = w && w(w(I([])));
|
|
396
|
+
A && A !== r && o.call(A, c) && (S = A);
|
|
397
|
+
var E = k.prototype = g.prototype = Object.create(S);
|
|
398
|
+
function T(e) {
|
|
400
399
|
["next", "throw", "return"].forEach(function (t) {
|
|
401
|
-
|
|
400
|
+
d(e, t, function (e) {
|
|
402
401
|
return this._invoke(t, e);
|
|
403
402
|
});
|
|
404
403
|
});
|
|
405
404
|
}
|
|
406
|
-
function
|
|
407
|
-
function i
|
|
408
|
-
var u =
|
|
405
|
+
function O(e, t) {
|
|
406
|
+
function r(i, s, a, c) {
|
|
407
|
+
var u = p(e[i], e, s);
|
|
409
408
|
if ("throw" !== u.type) {
|
|
410
409
|
var l = u.arg, d = l.value;
|
|
411
|
-
return d && "object" == n(d) &&
|
|
412
|
-
|
|
410
|
+
return d && "object" == n(d) && o.call(d, "__await") ? t.resolve(d.__await).then(function (e) {
|
|
411
|
+
r("next", e, a, c);
|
|
413
412
|
}, function (e) {
|
|
414
|
-
|
|
413
|
+
r("throw", e, a, c);
|
|
415
414
|
}) : t.resolve(d).then(function (e) {
|
|
416
415
|
l.value = e, a(l);
|
|
417
416
|
}, function (e) {
|
|
418
|
-
return
|
|
417
|
+
return r("throw", e, a, c);
|
|
419
418
|
});
|
|
420
419
|
}
|
|
421
420
|
c(u.arg);
|
|
422
421
|
}
|
|
423
|
-
var
|
|
424
|
-
|
|
425
|
-
value: function value(e,
|
|
426
|
-
function
|
|
427
|
-
return new t(function (t,
|
|
428
|
-
|
|
422
|
+
var i;
|
|
423
|
+
s(this, "_invoke", {
|
|
424
|
+
value: function value(e, n) {
|
|
425
|
+
function o() {
|
|
426
|
+
return new t(function (t, i) {
|
|
427
|
+
r(e, n, t, i);
|
|
429
428
|
});
|
|
430
429
|
}
|
|
431
|
-
return
|
|
430
|
+
return i = i ? i.then(o, o) : o();
|
|
432
431
|
}
|
|
433
432
|
});
|
|
434
433
|
}
|
|
435
|
-
function
|
|
436
|
-
var
|
|
437
|
-
return function (
|
|
438
|
-
if (
|
|
434
|
+
function P(t, r, n) {
|
|
435
|
+
var i = _;
|
|
436
|
+
return function (o, s) {
|
|
437
|
+
if (i === f)
|
|
439
438
|
throw new Error("Generator is already running");
|
|
440
|
-
if (
|
|
441
|
-
if ("throw" ===
|
|
442
|
-
throw
|
|
443
|
-
return
|
|
439
|
+
if (i === v) {
|
|
440
|
+
if ("throw" === o)
|
|
441
|
+
throw s;
|
|
442
|
+
return {
|
|
443
|
+
value: e,
|
|
444
|
+
done: !0
|
|
445
|
+
};
|
|
444
446
|
}
|
|
445
|
-
for (
|
|
446
|
-
var
|
|
447
|
-
if (
|
|
448
|
-
var
|
|
449
|
-
if (
|
|
450
|
-
if (
|
|
447
|
+
for (n.method = o, n.arg = s;;) {
|
|
448
|
+
var a = n.delegate;
|
|
449
|
+
if (a) {
|
|
450
|
+
var c = C(a, n);
|
|
451
|
+
if (c) {
|
|
452
|
+
if (c === b)
|
|
451
453
|
continue;
|
|
452
|
-
return
|
|
454
|
+
return c;
|
|
453
455
|
}
|
|
454
456
|
}
|
|
455
|
-
if ("next" ===
|
|
456
|
-
|
|
457
|
-
else if ("throw" ===
|
|
458
|
-
if (
|
|
459
|
-
throw
|
|
460
|
-
|
|
457
|
+
if ("next" === n.method)
|
|
458
|
+
n.sent = n._sent = n.arg;
|
|
459
|
+
else if ("throw" === n.method) {
|
|
460
|
+
if (i === _)
|
|
461
|
+
throw i = v, n.arg;
|
|
462
|
+
n.dispatchException(n.arg);
|
|
461
463
|
}
|
|
462
464
|
else
|
|
463
|
-
"return" ===
|
|
464
|
-
|
|
465
|
-
var
|
|
466
|
-
if ("normal" ===
|
|
467
|
-
if (
|
|
465
|
+
"return" === n.method && n.abrupt("return", n.arg);
|
|
466
|
+
i = f;
|
|
467
|
+
var u = p(t, r, n);
|
|
468
|
+
if ("normal" === u.type) {
|
|
469
|
+
if (i = n.done ? v : m, u.arg === b)
|
|
468
470
|
continue;
|
|
469
471
|
return {
|
|
470
|
-
value:
|
|
471
|
-
done:
|
|
472
|
+
value: u.arg,
|
|
473
|
+
done: n.done
|
|
472
474
|
};
|
|
473
475
|
}
|
|
474
|
-
"throw" ===
|
|
476
|
+
"throw" === u.type && (i = v, n.method = "throw", n.arg = u.arg);
|
|
475
477
|
}
|
|
476
478
|
};
|
|
477
479
|
}
|
|
478
|
-
function
|
|
479
|
-
var
|
|
480
|
-
if (
|
|
481
|
-
return
|
|
482
|
-
var
|
|
483
|
-
if ("throw" ===
|
|
484
|
-
return
|
|
485
|
-
var
|
|
486
|
-
return
|
|
480
|
+
function C(t, r) {
|
|
481
|
+
var n = r.method, i = t.iterator[n];
|
|
482
|
+
if (i === e)
|
|
483
|
+
return r.delegate = null, "throw" === n && t.iterator["return"] && (r.method = "return", r.arg = e, C(t, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), b;
|
|
484
|
+
var o = p(i, t.iterator, r.arg);
|
|
485
|
+
if ("throw" === o.type)
|
|
486
|
+
return r.method = "throw", r.arg = o.arg, r.delegate = null, b;
|
|
487
|
+
var s = o.arg;
|
|
488
|
+
return s ? s.done ? (r[t.resultName] = s.value, r.next = t.nextLoc, "return" !== r.method && (r.method = "next", r.arg = e), r.delegate = null, b) : s : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, b);
|
|
487
489
|
}
|
|
488
|
-
function
|
|
490
|
+
function B(e) {
|
|
489
491
|
var t = {
|
|
490
492
|
tryLoc: e[0]
|
|
491
493
|
};
|
|
492
494
|
1 in e && (t.catchLoc = e[1]), 2 in e && (t.finallyLoc = e[2], t.afterLoc = e[3]), this.tryEntries.push(t);
|
|
493
495
|
}
|
|
494
|
-
function
|
|
496
|
+
function R(e) {
|
|
495
497
|
var t = e.completion || {};
|
|
496
498
|
t.type = "normal", delete t.arg, e.completion = t;
|
|
497
499
|
}
|
|
498
|
-
function
|
|
500
|
+
function x(e) {
|
|
499
501
|
this.tryEntries = [{
|
|
500
502
|
tryLoc: "root"
|
|
501
|
-
}], e.forEach(
|
|
503
|
+
}], e.forEach(B, this), this.reset(!0);
|
|
502
504
|
}
|
|
503
|
-
function
|
|
504
|
-
if (
|
|
505
|
-
var
|
|
506
|
-
if (
|
|
507
|
-
return
|
|
508
|
-
if ("function" == typeof
|
|
509
|
-
return
|
|
510
|
-
if (!isNaN(
|
|
511
|
-
var
|
|
512
|
-
for (; ++
|
|
513
|
-
if (
|
|
514
|
-
return
|
|
515
|
-
return
|
|
505
|
+
function I(t) {
|
|
506
|
+
if (t || "" === t) {
|
|
507
|
+
var r = t[c];
|
|
508
|
+
if (r)
|
|
509
|
+
return r.call(t);
|
|
510
|
+
if ("function" == typeof t.next)
|
|
511
|
+
return t;
|
|
512
|
+
if (!isNaN(t.length)) {
|
|
513
|
+
var i = -1, s = function r() {
|
|
514
|
+
for (; ++i < t.length;)
|
|
515
|
+
if (o.call(t, i))
|
|
516
|
+
return r.value = t[i], r.done = !1, r;
|
|
517
|
+
return r.value = e, r.done = !0, r;
|
|
516
518
|
};
|
|
517
|
-
return
|
|
519
|
+
return s.next = s;
|
|
518
520
|
}
|
|
519
521
|
}
|
|
520
|
-
|
|
521
|
-
next: P
|
|
522
|
-
};
|
|
523
|
-
}
|
|
524
|
-
function P() {
|
|
525
|
-
return {
|
|
526
|
-
value: void 0,
|
|
527
|
-
done: !0
|
|
528
|
-
};
|
|
522
|
+
throw new TypeError(n(t) + " is not iterable");
|
|
529
523
|
}
|
|
530
|
-
return
|
|
531
|
-
value:
|
|
524
|
+
return y.prototype = k, s(E, "constructor", {
|
|
525
|
+
value: k,
|
|
532
526
|
configurable: !0
|
|
533
|
-
}),
|
|
534
|
-
value:
|
|
527
|
+
}), s(k, "constructor", {
|
|
528
|
+
value: y,
|
|
535
529
|
configurable: !0
|
|
536
|
-
}),
|
|
530
|
+
}), y.displayName = d(k, l, "GeneratorFunction"), t.isGeneratorFunction = function (e) {
|
|
537
531
|
var t = "function" == typeof e && e.constructor;
|
|
538
|
-
return !!t && (t ===
|
|
539
|
-
},
|
|
540
|
-
return Object.setPrototypeOf ? Object.setPrototypeOf(e,
|
|
541
|
-
},
|
|
532
|
+
return !!t && (t === y || "GeneratorFunction" === (t.displayName || t.name));
|
|
533
|
+
}, t.mark = function (e) {
|
|
534
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(e, k) : (e.__proto__ = k, d(e, l, "GeneratorFunction")), e.prototype = Object.create(E), e;
|
|
535
|
+
}, t.awrap = function (e) {
|
|
542
536
|
return {
|
|
543
537
|
__await: e
|
|
544
538
|
};
|
|
545
|
-
},
|
|
539
|
+
}, T(O.prototype), d(O.prototype, u, function () {
|
|
546
540
|
return this;
|
|
547
|
-
}),
|
|
541
|
+
}), t.AsyncIterator = O, t.async = function (e, r, n, i, o) {
|
|
548
542
|
void 0 === o && (o = Promise);
|
|
549
|
-
var s = new
|
|
550
|
-
return
|
|
543
|
+
var s = new O(h(e, r, n, i), o);
|
|
544
|
+
return t.isGeneratorFunction(r) ? s : s.next().then(function (e) {
|
|
551
545
|
return e.done ? e.value : s.next();
|
|
552
546
|
});
|
|
553
|
-
},
|
|
547
|
+
}, T(E), d(E, l, "Generator"), d(E, c, function () {
|
|
554
548
|
return this;
|
|
555
|
-
}),
|
|
549
|
+
}), d(E, "toString", function () {
|
|
556
550
|
return "[object Generator]";
|
|
557
|
-
}),
|
|
551
|
+
}), t.keys = function (e) {
|
|
558
552
|
var t = Object(e), r = [];
|
|
559
553
|
for (var n in t)
|
|
560
554
|
r.push(n);
|
|
@@ -566,12 +560,12 @@ function i() {
|
|
|
566
560
|
}
|
|
567
561
|
return e.done = !0, e;
|
|
568
562
|
};
|
|
569
|
-
},
|
|
570
|
-
constructor:
|
|
571
|
-
reset: function reset(
|
|
572
|
-
if (this.prev = 0, this.next = 0, this.sent = this._sent =
|
|
573
|
-
for (var
|
|
574
|
-
"t" ===
|
|
563
|
+
}, t.values = I, x.prototype = {
|
|
564
|
+
constructor: x,
|
|
565
|
+
reset: function reset(t) {
|
|
566
|
+
if (this.prev = 0, this.next = 0, this.sent = this._sent = e, this.done = !1, this.delegate = null, this.method = "next", this.arg = e, this.tryEntries.forEach(R), !t)
|
|
567
|
+
for (var r in this)
|
|
568
|
+
"t" === r.charAt(0) && o.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = e);
|
|
575
569
|
},
|
|
576
570
|
stop: function stop() {
|
|
577
571
|
this.done = !0;
|
|
@@ -580,60 +574,60 @@ function i() {
|
|
|
580
574
|
throw e.arg;
|
|
581
575
|
return this.rval;
|
|
582
576
|
},
|
|
583
|
-
dispatchException: function dispatchException(
|
|
577
|
+
dispatchException: function dispatchException(t) {
|
|
584
578
|
if (this.done)
|
|
585
|
-
throw
|
|
586
|
-
var
|
|
587
|
-
function n(
|
|
588
|
-
return
|
|
579
|
+
throw t;
|
|
580
|
+
var r = this;
|
|
581
|
+
function n(n, i) {
|
|
582
|
+
return a.type = "throw", a.arg = t, r.next = n, i && (r.method = "next", r.arg = e), !!i;
|
|
589
583
|
}
|
|
590
584
|
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
591
|
-
var
|
|
592
|
-
if ("root" ===
|
|
585
|
+
var s = this.tryEntries[i], a = s.completion;
|
|
586
|
+
if ("root" === s.tryLoc)
|
|
593
587
|
return n("end");
|
|
594
|
-
if (
|
|
595
|
-
var
|
|
596
|
-
if (
|
|
597
|
-
if (this.prev <
|
|
598
|
-
return n(
|
|
599
|
-
if (this.prev <
|
|
600
|
-
return n(
|
|
588
|
+
if (s.tryLoc <= this.prev) {
|
|
589
|
+
var c = o.call(s, "catchLoc"), u = o.call(s, "finallyLoc");
|
|
590
|
+
if (c && u) {
|
|
591
|
+
if (this.prev < s.catchLoc)
|
|
592
|
+
return n(s.catchLoc, !0);
|
|
593
|
+
if (this.prev < s.finallyLoc)
|
|
594
|
+
return n(s.finallyLoc);
|
|
601
595
|
}
|
|
602
|
-
else if (
|
|
603
|
-
if (this.prev <
|
|
604
|
-
return n(
|
|
596
|
+
else if (c) {
|
|
597
|
+
if (this.prev < s.catchLoc)
|
|
598
|
+
return n(s.catchLoc, !0);
|
|
605
599
|
}
|
|
606
600
|
else {
|
|
607
|
-
if (!
|
|
601
|
+
if (!u)
|
|
608
602
|
throw new Error("try statement without catch or finally");
|
|
609
|
-
if (this.prev <
|
|
610
|
-
return n(
|
|
603
|
+
if (this.prev < s.finallyLoc)
|
|
604
|
+
return n(s.finallyLoc);
|
|
611
605
|
}
|
|
612
606
|
}
|
|
613
607
|
}
|
|
614
608
|
},
|
|
615
609
|
abrupt: function abrupt(e, t) {
|
|
616
|
-
for (var
|
|
617
|
-
var
|
|
618
|
-
if (
|
|
619
|
-
var
|
|
610
|
+
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
|
611
|
+
var n = this.tryEntries[r];
|
|
612
|
+
if (n.tryLoc <= this.prev && o.call(n, "finallyLoc") && this.prev < n.finallyLoc) {
|
|
613
|
+
var i = n;
|
|
620
614
|
break;
|
|
621
615
|
}
|
|
622
616
|
}
|
|
623
|
-
|
|
624
|
-
var s =
|
|
625
|
-
return s.type = e, s.arg = t,
|
|
617
|
+
i && ("break" === e || "continue" === e) && i.tryLoc <= t && t <= i.finallyLoc && (i = null);
|
|
618
|
+
var s = i ? i.completion : {};
|
|
619
|
+
return s.type = e, s.arg = t, i ? (this.method = "next", this.next = i.finallyLoc, b) : this.complete(s);
|
|
626
620
|
},
|
|
627
621
|
complete: function complete(e, t) {
|
|
628
622
|
if ("throw" === e.type)
|
|
629
623
|
throw e.arg;
|
|
630
|
-
return "break" === e.type || "continue" === e.type ? this.next = e.arg : "return" === e.type ? (this.rval = this.arg = e.arg, this.method = "return", this.next = "end") : "normal" === e.type && t && (this.next = t),
|
|
624
|
+
return "break" === e.type || "continue" === e.type ? this.next = e.arg : "return" === e.type ? (this.rval = this.arg = e.arg, this.method = "return", this.next = "end") : "normal" === e.type && t && (this.next = t), b;
|
|
631
625
|
},
|
|
632
626
|
finish: function finish(e) {
|
|
633
627
|
for (var t = this.tryEntries.length - 1; t >= 0; --t) {
|
|
634
628
|
var r = this.tryEntries[t];
|
|
635
629
|
if (r.finallyLoc === e)
|
|
636
|
-
return this.complete(r.completion, r.afterLoc),
|
|
630
|
+
return this.complete(r.completion, r.afterLoc), R(r), b;
|
|
637
631
|
}
|
|
638
632
|
},
|
|
639
633
|
"catch": function _catch(e) {
|
|
@@ -643,21 +637,21 @@ function i() {
|
|
|
643
637
|
var n = r.completion;
|
|
644
638
|
if ("throw" === n.type) {
|
|
645
639
|
var i = n.arg;
|
|
646
|
-
|
|
640
|
+
R(r);
|
|
647
641
|
}
|
|
648
642
|
return i;
|
|
649
643
|
}
|
|
650
644
|
}
|
|
651
645
|
throw new Error("illegal catch attempt");
|
|
652
646
|
},
|
|
653
|
-
delegateYield: function delegateYield(
|
|
647
|
+
delegateYield: function delegateYield(t, r, n) {
|
|
654
648
|
return this.delegate = {
|
|
655
|
-
iterator:
|
|
656
|
-
resultName:
|
|
657
|
-
nextLoc:
|
|
658
|
-
}, "next" === this.method && (this.arg =
|
|
649
|
+
iterator: I(t),
|
|
650
|
+
resultName: r,
|
|
651
|
+
nextLoc: n
|
|
652
|
+
}, "next" === this.method && (this.arg = e), b;
|
|
659
653
|
}
|
|
660
|
-
},
|
|
654
|
+
}, t;
|
|
661
655
|
}
|
|
662
656
|
function o(e, t) {
|
|
663
657
|
for (var r = 0; r < t.length; r++) {
|
|
@@ -697,10 +691,10 @@ function c(e, t) {
|
|
|
697
691
|
}
|
|
698
692
|
}), Object.defineProperty(e, "prototype", {
|
|
699
693
|
writable: !1
|
|
700
|
-
}), t &&
|
|
694
|
+
}), t && _(e, t);
|
|
701
695
|
}
|
|
702
696
|
function u(e) {
|
|
703
|
-
var t =
|
|
697
|
+
var t = p();
|
|
704
698
|
return function () {
|
|
705
699
|
var r, i = m(e);
|
|
706
700
|
if (t) {
|
|
@@ -746,18 +740,18 @@ function d(e) {
|
|
|
746
740
|
writable: !0,
|
|
747
741
|
configurable: !0
|
|
748
742
|
}
|
|
749
|
-
}),
|
|
743
|
+
}), _(n, e);
|
|
750
744
|
}, d(e);
|
|
751
745
|
}
|
|
752
746
|
function h(e, t, r) {
|
|
753
|
-
return h =
|
|
747
|
+
return h = p() ? Reflect.construct.bind() : function (e, t, r) {
|
|
754
748
|
var n = [null];
|
|
755
749
|
n.push.apply(n, t);
|
|
756
750
|
var i = new (Function.bind.apply(e, n))();
|
|
757
|
-
return r &&
|
|
751
|
+
return r && _(i, r.prototype), i;
|
|
758
752
|
}, h.apply(null, arguments);
|
|
759
753
|
}
|
|
760
|
-
function
|
|
754
|
+
function p() {
|
|
761
755
|
if ("undefined" == typeof Reflect || !Reflect.construct)
|
|
762
756
|
return !1;
|
|
763
757
|
if (Reflect.construct.sham)
|
|
@@ -771,10 +765,10 @@ function _() {
|
|
|
771
765
|
return !1;
|
|
772
766
|
}
|
|
773
767
|
}
|
|
774
|
-
function
|
|
775
|
-
return
|
|
768
|
+
function _(e, t) {
|
|
769
|
+
return _ = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (e, t) {
|
|
776
770
|
return e.__proto__ = t, e;
|
|
777
|
-
},
|
|
771
|
+
}, _(e, t);
|
|
778
772
|
}
|
|
779
773
|
function m(e) {
|
|
780
774
|
return m = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (e) {
|
|
@@ -809,8 +803,8 @@ function S(e, t, r, n) {
|
|
|
809
803
|
c((n = n.apply(e, t || [])).next());
|
|
810
804
|
});
|
|
811
805
|
}
|
|
812
|
-
|
|
813
|
-
e.emailMagicLinks = "emailMagicLinks", e.oauth = "oauth", e.otp = "otp", e.crypto = "crypto", e.passwords = "passwords";
|
|
806
|
+
"function" == typeof SuppressedError && SuppressedError, function (e) {
|
|
807
|
+
e.emailMagicLinks = "emailMagicLinks", e.oauth = "oauth", e.otp = "otp", e.crypto = "crypto", e.passwords = "passwords", e.passkeys = "passkeys";
|
|
814
808
|
}(f || (f = {})), function (e) {
|
|
815
809
|
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";
|
|
816
810
|
}(v || (v = {})), function (e) {
|
|
@@ -820,9 +814,9 @@ function S(e, t, r, n) {
|
|
|
820
814
|
}(g || (g = {})), function (e) {
|
|
821
815
|
e.SMS = "sms", e.WhatsApp = "whatsapp", e.Email = "email";
|
|
822
816
|
}(y || (y = {})), function (e) {
|
|
823
|
-
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";
|
|
817
|
+
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_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";
|
|
824
818
|
}(k || (k = {}));
|
|
825
|
-
var w, A, T, O,
|
|
819
|
+
var w, A, E, T, O, P = function (e) {
|
|
826
820
|
c(r, d(Error));
|
|
827
821
|
var t = u(r);
|
|
828
822
|
function r(e, n) {
|
|
@@ -830,7 +824,7 @@ var w, A, T, O, E, C = function (e) {
|
|
|
830
824
|
return a(this, r), (i = t.call(this, e + "\n" + n)).message = e + "\n" + n, i.name = "SDKAPIUnreachableError", i.details = n, Object.setPrototypeOf(l(i), r.prototype), i;
|
|
831
825
|
}
|
|
832
826
|
return s(r);
|
|
833
|
-
}(),
|
|
827
|
+
}(), C = function (e) {
|
|
834
828
|
c(r, d(Error));
|
|
835
829
|
var t = u(r);
|
|
836
830
|
function r(e, n) {
|
|
@@ -850,7 +844,7 @@ var w, A, T, O, E, C = function (e) {
|
|
|
850
844
|
return n.message = "[400] Request does not match expected schema\n".concat(o), n;
|
|
851
845
|
}
|
|
852
846
|
return s(r);
|
|
853
|
-
}(),
|
|
847
|
+
}(), R = function (e) {
|
|
854
848
|
c(r, d(Error));
|
|
855
849
|
var t = u(r);
|
|
856
850
|
function r(e) {
|
|
@@ -860,16 +854,16 @@ var w, A, T, O, E, C = function (e) {
|
|
|
860
854
|
return n.error_type = o, n.error_message = s, n.error_url = c, n.request_id = u, n.status_code = i, n.message = "[".concat(i, "] ").concat(o, "\n") + "".concat(s, "\n") + "See ".concat(c, " for more information.\n") + (u ? "request_id: ".concat(u, "\n") : ""), n;
|
|
861
855
|
}
|
|
862
856
|
return s(r);
|
|
863
|
-
}(),
|
|
857
|
+
}(), x = ["unauthorized_credentials", "user_unauthenticated", "invalid_secret_authentication", "session_not_found"];
|
|
864
858
|
!function (e) {
|
|
865
859
|
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";
|
|
866
860
|
}(w || (w = {})), function (e) {
|
|
867
861
|
e.emailMagicLinks = "emailMagicLinks", e.sso = "sso", e.passwords = "passwords", e.oauth = "oauth";
|
|
868
862
|
}(A || (A = {})), function (e) {
|
|
869
863
|
e.Discovery = "Discovery", e.Organization = "Organization", e.PasswordReset = "PasswordReset";
|
|
870
|
-
}(
|
|
864
|
+
}(E || (E = {})), function (e) {
|
|
871
865
|
e.Google = "google", e.Microsoft = "microsoft";
|
|
872
|
-
}(
|
|
866
|
+
}(T || (T = {})), (O || (O = {})).RequiredCatcha = "Catcha Required";
|
|
873
867
|
var I, D = function (e) {
|
|
874
868
|
c(r, d(Error));
|
|
875
869
|
var t = u(r);
|
|
@@ -882,7 +876,7 @@ var I, D = function (e) {
|
|
|
882
876
|
function L(e) {
|
|
883
877
|
var t = e.method, r = e.errorMessage, n = e.finalURL, o = e.basicAuthHeader, s = e.xSDKClientHeader, a = e.xSDKParentHostHeader, c = e.body;
|
|
884
878
|
return S(this, void 0, void 0, i().mark(function e() {
|
|
885
|
-
var u, l, d, h,
|
|
879
|
+
var u, l, d, h, p, _;
|
|
886
880
|
return i().wrap(function (e) {
|
|
887
881
|
for (;;)
|
|
888
882
|
switch (e.prev = e.next) {
|
|
@@ -904,7 +898,7 @@ function L(e) {
|
|
|
904
898
|
e.next = 13;
|
|
905
899
|
break;
|
|
906
900
|
}
|
|
907
|
-
throw new
|
|
901
|
+
throw new P(r, "Unable to contact the Stytch servers. Are you online?");
|
|
908
902
|
case 13:
|
|
909
903
|
throw e.t0;
|
|
910
904
|
case 14:
|
|
@@ -917,15 +911,15 @@ function L(e) {
|
|
|
917
911
|
h = e.sent, e.next = 24;
|
|
918
912
|
break;
|
|
919
913
|
case 21:
|
|
920
|
-
throw e.prev = 21, e.t1 = e["catch"](15), new
|
|
914
|
+
throw e.prev = 21, e.t1 = e["catch"](15), new P(r, "Invalid response from the Stytch servers.");
|
|
921
915
|
case 24:
|
|
922
916
|
if (!h.includes("Captcha required")) {
|
|
923
917
|
e.next = 26;
|
|
924
918
|
break;
|
|
925
919
|
}
|
|
926
|
-
throw new D(
|
|
920
|
+
throw new D(O.RequiredCatcha);
|
|
927
921
|
case 26:
|
|
928
|
-
throw new
|
|
922
|
+
throw new P(r, "Invalid response from the Stytch servers.");
|
|
929
923
|
case 27:
|
|
930
924
|
if (200 === d.status) {
|
|
931
925
|
e.next = 40;
|
|
@@ -933,24 +927,24 @@ function L(e) {
|
|
|
933
927
|
}
|
|
934
928
|
return e.prev = 28, e.next = 31, d.json();
|
|
935
929
|
case 31:
|
|
936
|
-
|
|
930
|
+
p = e.sent, e.next = 37;
|
|
937
931
|
break;
|
|
938
932
|
case 34:
|
|
939
|
-
throw e.prev = 34, e.t2 = e["catch"](28), new
|
|
933
|
+
throw e.prev = 34, e.t2 = e["catch"](28), new P(r, "Invalid or no response from server");
|
|
940
934
|
case 37:
|
|
941
|
-
if (!("body" in
|
|
935
|
+
if (!("body" in p || "params" in p || "query" in p)) {
|
|
942
936
|
e.next = 39;
|
|
943
937
|
break;
|
|
944
938
|
}
|
|
945
|
-
throw new B(
|
|
939
|
+
throw new B(p);
|
|
946
940
|
case 39:
|
|
947
|
-
throw new
|
|
941
|
+
throw new R(p);
|
|
948
942
|
case 40:
|
|
949
943
|
return e.prev = 40, e.next = 43, d.json();
|
|
950
944
|
case 43:
|
|
951
|
-
return
|
|
945
|
+
return _ = e.sent, e.abrupt("return", _.data);
|
|
952
946
|
case 47:
|
|
953
|
-
throw e.prev = 47, e.t3 = e["catch"](40), new
|
|
947
|
+
throw e.prev = 47, e.t3 = e["catch"](40), new P(r, "Invalid response from the Stytch servers.");
|
|
954
948
|
case 50:
|
|
955
949
|
case "end":
|
|
956
950
|
return e.stop();
|
|
@@ -1055,7 +1049,7 @@ var Y, V = ["[Stytch]"], $ = function $() {
|
|
|
1055
1049
|
isObject: function isObject(t, i) {
|
|
1056
1050
|
var o = "object" === n(i) && !Array.isArray(i) && null !== i;
|
|
1057
1051
|
if (!o)
|
|
1058
|
-
throw new
|
|
1052
|
+
throw new C(e, t + " must be an object.");
|
|
1059
1053
|
return r;
|
|
1060
1054
|
},
|
|
1061
1055
|
isOptionalObject: function isOptionalObject(e, t) {
|
|
@@ -1063,7 +1057,7 @@ var Y, V = ["[Stytch]"], $ = function $() {
|
|
|
1063
1057
|
},
|
|
1064
1058
|
isString: function isString(t, n) {
|
|
1065
1059
|
if ("string" != typeof n)
|
|
1066
|
-
throw new
|
|
1060
|
+
throw new C(e, t + " must be a string.");
|
|
1067
1061
|
return r;
|
|
1068
1062
|
},
|
|
1069
1063
|
isOptionalString: function isOptionalString(e, t) {
|
|
@@ -1071,7 +1065,7 @@ var Y, V = ["[Stytch]"], $ = function $() {
|
|
|
1071
1065
|
},
|
|
1072
1066
|
isStringArray: function isStringArray(n, i) {
|
|
1073
1067
|
if (!Array.isArray(i))
|
|
1074
|
-
throw new
|
|
1068
|
+
throw new C(e, n + " must be an array of strings.");
|
|
1075
1069
|
var o, s = function (e, r) {
|
|
1076
1070
|
var _n = "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
|
|
1077
1071
|
if (!_n) {
|
|
@@ -1122,7 +1116,7 @@ var Y, V = ["[Stytch]"], $ = function $() {
|
|
|
1122
1116
|
try {
|
|
1123
1117
|
for (s.s(); !(o = s.n()).done;) {
|
|
1124
1118
|
if ("string" != typeof o.value)
|
|
1125
|
-
throw new
|
|
1119
|
+
throw new C(e, n + " must be an array of strings.");
|
|
1126
1120
|
}
|
|
1127
1121
|
}
|
|
1128
1122
|
catch (e) {
|
|
@@ -1138,7 +1132,7 @@ var Y, V = ["[Stytch]"], $ = function $() {
|
|
|
1138
1132
|
},
|
|
1139
1133
|
isNumber: function isNumber(t, n) {
|
|
1140
1134
|
if ("number" != typeof n)
|
|
1141
|
-
throw new
|
|
1135
|
+
throw new C(e, t + " must be a number.");
|
|
1142
1136
|
return r;
|
|
1143
1137
|
},
|
|
1144
1138
|
isOptionalNumber: function isOptionalNumber(e, t) {
|
|
@@ -1146,7 +1140,7 @@ var Y, V = ["[Stytch]"], $ = function $() {
|
|
|
1146
1140
|
},
|
|
1147
1141
|
isBoolean: function isBoolean(t, n) {
|
|
1148
1142
|
if ("boolean" != typeof n)
|
|
1149
|
-
throw new
|
|
1143
|
+
throw new C(e, t + " must be a boolean.");
|
|
1150
1144
|
return r;
|
|
1151
1145
|
},
|
|
1152
1146
|
isOptionalBoolean: function isOptionalBoolean(e, t) {
|
|
@@ -1252,7 +1246,7 @@ var Y, V = ["[Stytch]"], $ = function $() {
|
|
|
1252
1246
|
case 0:
|
|
1253
1247
|
return r.next = 2, this.state;
|
|
1254
1248
|
case 2:
|
|
1255
|
-
if (n = r.sent, o = n.enabled, s = n.executeRecaptcha, e.type !==
|
|
1249
|
+
if (n = r.sent, o = n.enabled, s = n.executeRecaptcha, e.type !== O.RequiredCatcha || !o) {
|
|
1256
1250
|
r.next = 14;
|
|
1257
1251
|
break;
|
|
1258
1252
|
}
|
|
@@ -1891,14 +1885,14 @@ var ne = Promise.resolve({
|
|
|
1891
1885
|
}));
|
|
1892
1886
|
}
|
|
1893
1887
|
}, this.google = {
|
|
1894
|
-
start: this.startOAuthFlow(
|
|
1888
|
+
start: this.startOAuthFlow(T.Google),
|
|
1895
1889
|
discovery: {
|
|
1896
|
-
start: this.startDiscoveryOAuthFlow(
|
|
1890
|
+
start: this.startDiscoveryOAuthFlow(T.Google)
|
|
1897
1891
|
}
|
|
1898
1892
|
}, this.microsoft = {
|
|
1899
|
-
start: this.startOAuthFlow(
|
|
1893
|
+
start: this.startOAuthFlow(T.Microsoft),
|
|
1900
1894
|
discovery: {
|
|
1901
|
-
start: this.startDiscoveryOAuthFlow(
|
|
1895
|
+
start: this.startDiscoveryOAuthFlow(T.Microsoft)
|
|
1902
1896
|
}
|
|
1903
1897
|
};
|
|
1904
1898
|
}
|
|
@@ -1984,30 +1978,33 @@ var ne = Promise.resolve({
|
|
|
1984
1978
|
value: function value(e) {
|
|
1985
1979
|
var t = this;
|
|
1986
1980
|
return function (r) {
|
|
1987
|
-
var n = r.organization_id, o = r.organization_slug, s = r.login_redirect_url, a = r.signup_redirect_url, c = r.custom_scopes;
|
|
1981
|
+
var n = r.organization_id, o = r.organization_slug, s = r.login_redirect_url, a = r.signup_redirect_url, c = r.custom_scopes, u = r.provider_params;
|
|
1988
1982
|
return S(t, void 0, void 0, i().mark(function t() {
|
|
1989
|
-
var r,
|
|
1983
|
+
var r, l, d, h, p, _;
|
|
1990
1984
|
return i().wrap(function (t) {
|
|
1991
1985
|
for (;;)
|
|
1992
1986
|
switch (t.prev = t.next) {
|
|
1993
1987
|
case 0:
|
|
1994
1988
|
return t.next = 2, this._dynamicConfig;
|
|
1995
1989
|
case 2:
|
|
1996
|
-
return r = t.sent,
|
|
1990
|
+
return r = t.sent, l = r.pkceRequiredForOAuth, t.next = 6, this.getBaseApiUrl();
|
|
1997
1991
|
case 6:
|
|
1998
|
-
if (
|
|
1999
|
-
|
|
1992
|
+
if (d = t.sent, (h = new URL("".concat(d, "/v1/b2b/public/oauth/").concat(e, "/start"))).searchParams.set("public_token", this._config.publicToken), n && "" != n && h.searchParams.set("organization_id", n), o && "" != o && h.searchParams.set("slug", o), c && (Q("startOAuthFlow").isStringArray("custom_scopes", c), h.searchParams.set("custom_scopes", c.join(" "))), u)
|
|
1993
|
+
for (p in Q("startOAuthFlow").isOptionalObject("provider_params", u), u)
|
|
1994
|
+
h.searchParams.set("provider_" + p, u[p]);
|
|
1995
|
+
if (!l) {
|
|
1996
|
+
t.next = 20;
|
|
2000
1997
|
break;
|
|
2001
1998
|
}
|
|
2002
|
-
return t.next =
|
|
2003
|
-
case
|
|
2004
|
-
|
|
1999
|
+
return t.next = 16, this._pkceManager.startPKCETransaction();
|
|
2000
|
+
case 16:
|
|
2001
|
+
_ = t.sent, h.searchParams.set("pkce_code_challenge", _.code_challenge), t.next = 21;
|
|
2005
2002
|
break;
|
|
2006
|
-
case 19:
|
|
2007
|
-
this._pkceManager.clearPKPair();
|
|
2008
2003
|
case 20:
|
|
2009
|
-
|
|
2010
|
-
case
|
|
2004
|
+
this._pkceManager.clearPKPair();
|
|
2005
|
+
case 21:
|
|
2006
|
+
s && h.searchParams.set("login_redirect_url", s), a && h.searchParams.set("signup_redirect_url", a), window.location.href = h.toString();
|
|
2007
|
+
case 24:
|
|
2011
2008
|
case "end":
|
|
2012
2009
|
return t.stop();
|
|
2013
2010
|
}
|
|
@@ -2020,30 +2017,33 @@ var ne = Promise.resolve({
|
|
|
2020
2017
|
value: function value(e) {
|
|
2021
2018
|
var t = this;
|
|
2022
2019
|
return function (r) {
|
|
2023
|
-
var n = r.discovery_redirect_url, o = r.custom_scopes;
|
|
2020
|
+
var n = r.discovery_redirect_url, o = r.custom_scopes, s = r.provider_params;
|
|
2024
2021
|
return S(t, void 0, void 0, i().mark(function t() {
|
|
2025
|
-
var r,
|
|
2022
|
+
var r, a, c, u, l, d;
|
|
2026
2023
|
return i().wrap(function (t) {
|
|
2027
2024
|
for (;;)
|
|
2028
2025
|
switch (t.prev = t.next) {
|
|
2029
2026
|
case 0:
|
|
2030
2027
|
return t.next = 2, this._dynamicConfig;
|
|
2031
2028
|
case 2:
|
|
2032
|
-
return r = t.sent,
|
|
2029
|
+
return r = t.sent, a = r.pkceRequiredForOAuth, t.next = 6, this.getBaseApiUrl();
|
|
2033
2030
|
case 6:
|
|
2034
|
-
if (
|
|
2035
|
-
|
|
2031
|
+
if (c = t.sent, (u = new URL("".concat(c, "/v1/b2b/public/oauth/").concat(e, "/discovery/start"))).searchParams.set("public_token", this._config.publicToken), o && (Q("startOAuthFlow").isStringArray("custom_scopes", o), u.searchParams.set("custom_scopes", o.join(" "))), s)
|
|
2032
|
+
for (l in Q("startOAuthFlow").isOptionalObject("provider_params", s), s)
|
|
2033
|
+
u.searchParams.set("provider_" + l, s[l]);
|
|
2034
|
+
if (!a) {
|
|
2035
|
+
t.next = 18;
|
|
2036
2036
|
break;
|
|
2037
2037
|
}
|
|
2038
|
-
return t.next =
|
|
2039
|
-
case
|
|
2040
|
-
|
|
2038
|
+
return t.next = 14, this._pkceManager.startPKCETransaction();
|
|
2039
|
+
case 14:
|
|
2040
|
+
d = t.sent, u.searchParams.set("pkce_code_challenge", d.code_challenge), t.next = 19;
|
|
2041
2041
|
break;
|
|
2042
|
-
case 17:
|
|
2043
|
-
this._pkceManager.clearPKPair();
|
|
2044
2042
|
case 18:
|
|
2045
|
-
|
|
2046
|
-
case
|
|
2043
|
+
this._pkceManager.clearPKPair();
|
|
2044
|
+
case 19:
|
|
2045
|
+
n && u.searchParams.set("discovery_redirect_url", n), window.location.href = u.toString();
|
|
2046
|
+
case 21:
|
|
2047
2047
|
case "end":
|
|
2048
2048
|
return t.stop();
|
|
2049
2049
|
}
|
|
@@ -2077,7 +2077,7 @@ var ne = Promise.resolve({
|
|
|
2077
2077
|
case 3:
|
|
2078
2078
|
return r = t.sent, this._subscriptionService.destroyState(), t.abrupt("return", r);
|
|
2079
2079
|
case 8:
|
|
2080
|
-
throw t.prev = 8, t.t0 = t["catch"](0), ((null == e ? void 0 : e.forceClear) ||
|
|
2080
|
+
throw t.prev = 8, t.t0 = t["catch"](0), ((null == e ? void 0 : e.forceClear) || x.includes(t.t0.error_type)) && this._subscriptionService.destroyState(), t.t0;
|
|
2081
2081
|
case 12:
|
|
2082
2082
|
case "end":
|
|
2083
2083
|
return t.stop();
|
|
@@ -2110,7 +2110,7 @@ var ne = Promise.resolve({
|
|
|
2110
2110
|
intermediate_session_token: null
|
|
2111
2111
|
}), t.abrupt("return", n);
|
|
2112
2112
|
case 9:
|
|
2113
|
-
throw t.prev = 9, t.t0 = t["catch"](0),
|
|
2113
|
+
throw t.prev = 9, t.t0 = t["catch"](0), x.includes(t.t0.error_type) && this._subscriptionService.destroyState(), t.t0;
|
|
2114
2114
|
case 13:
|
|
2115
2115
|
case "end":
|
|
2116
2116
|
return t.stop();
|
|
@@ -2289,7 +2289,7 @@ var ne = Promise.resolve({
|
|
|
2289
2289
|
Promise.resolve({
|
|
2290
2290
|
pkceRequiredForPasswordResets: !1
|
|
2291
2291
|
});
|
|
2292
|
-
var de, he,
|
|
2292
|
+
var de, he, pe, _e, me, fe, ve, be, ge, ye, ke, Se = s(function e(t, r) {
|
|
2293
2293
|
var n = this, o = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : te();
|
|
2294
2294
|
a(this, e), this._networkClient = t, this._subscriptionService = r, this.dfpProtectedAuth = o, this.sms = {
|
|
2295
2295
|
send: function send(e) {
|
|
@@ -2435,7 +2435,7 @@ var de, he, _e, pe, me, fe, ve, be, ge, ye, ke, Se = s(function e(t, r) {
|
|
|
2435
2435
|
}, {
|
|
2436
2436
|
key: "isUnrecoverableError",
|
|
2437
2437
|
value: function value(e) {
|
|
2438
|
-
return
|
|
2438
|
+
return x.includes(e.error_type);
|
|
2439
2439
|
}
|
|
2440
2440
|
}]), e;
|
|
2441
2441
|
}();
|
|
@@ -2466,29 +2466,29 @@ function Ae(e, t, r, n) {
|
|
|
2466
2466
|
c((n = n.apply(e, t || [])).next());
|
|
2467
2467
|
});
|
|
2468
2468
|
}
|
|
2469
|
-
we.REFRESH_INTERVAL_MS = 18e4, function (e) {
|
|
2470
|
-
e.emailMagicLinks = "emailMagicLinks", e.oauth = "oauth", e.otp = "otp", e.crypto = "crypto", e.passwords = "passwords";
|
|
2469
|
+
we.REFRESH_INTERVAL_MS = 18e4, "function" == typeof SuppressedError && SuppressedError, function (e) {
|
|
2470
|
+
e.emailMagicLinks = "emailMagicLinks", e.oauth = "oauth", e.otp = "otp", e.crypto = "crypto", e.passwords = "passwords", e.passkeys = "passkeys";
|
|
2471
2471
|
}(de || (de = {})), function (e) {
|
|
2472
2472
|
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";
|
|
2473
2473
|
}(he || (he = {})), function (e) {
|
|
2474
2474
|
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";
|
|
2475
|
-
}(_e || (_e = {})), function (e) {
|
|
2476
|
-
e.embedded = "embedded", e.floating = "floating";
|
|
2477
2475
|
}(pe || (pe = {})), function (e) {
|
|
2476
|
+
e.embedded = "embedded", e.floating = "floating";
|
|
2477
|
+
}(_e || (_e = {})), function (e) {
|
|
2478
2478
|
e.SMS = "sms", e.WhatsApp = "whatsapp", e.Email = "email";
|
|
2479
2479
|
}(me || (me = {})), function (e) {
|
|
2480
|
-
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";
|
|
2480
|
+
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_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";
|
|
2481
2481
|
}(fe || (fe = {}));
|
|
2482
|
-
var
|
|
2483
|
-
_inherits(
|
|
2484
|
-
var _super = _createSuper(
|
|
2485
|
-
function
|
|
2482
|
+
var Ee = /*#__PURE__*/ function (_Error) {
|
|
2483
|
+
_inherits(Ee, _Error);
|
|
2484
|
+
var _super = _createSuper(Ee);
|
|
2485
|
+
function Ee(e, t) {
|
|
2486
2486
|
var _this;
|
|
2487
|
-
_classCallCheck(this,
|
|
2487
|
+
_classCallCheck(this, Ee);
|
|
2488
2488
|
_this = _super.call(this), _this.name = "StytchSDKUsageError", _this.message = "Invalid call to ".concat(e, "\n") + t;
|
|
2489
2489
|
return _this;
|
|
2490
2490
|
}
|
|
2491
|
-
return _createClass(
|
|
2491
|
+
return _createClass(Ee);
|
|
2492
2492
|
}(/*#__PURE__*/ _wrapNativeSuper(Error));
|
|
2493
2493
|
!function (e) {
|
|
2494
2494
|
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";
|
|
@@ -2501,11 +2501,11 @@ var Te = /*#__PURE__*/ function (_Error) {
|
|
|
2501
2501
|
}(ye || (ye = {})), function (e) {
|
|
2502
2502
|
e.RequiredCatcha = "Catcha Required";
|
|
2503
2503
|
}(ke || (ke = {}));
|
|
2504
|
-
var
|
|
2504
|
+
var Te = function Te(e) {
|
|
2505
2505
|
var t = {
|
|
2506
2506
|
isObject: function isObject(r, n) {
|
|
2507
2507
|
if (!("object" == _typeof(n) && !Array.isArray(n) && null !== n))
|
|
2508
|
-
throw new
|
|
2508
|
+
throw new Ee(e, r + " must be an object.");
|
|
2509
2509
|
return t;
|
|
2510
2510
|
},
|
|
2511
2511
|
isOptionalObject: function isOptionalObject(e, r) {
|
|
@@ -2513,7 +2513,7 @@ var Oe = function Oe(e) {
|
|
|
2513
2513
|
},
|
|
2514
2514
|
isString: function isString(r, n) {
|
|
2515
2515
|
if ("string" != typeof n)
|
|
2516
|
-
throw new
|
|
2516
|
+
throw new Ee(e, r + " must be a string.");
|
|
2517
2517
|
return t;
|
|
2518
2518
|
},
|
|
2519
2519
|
isOptionalString: function isOptionalString(e, r) {
|
|
@@ -2521,13 +2521,13 @@ var Oe = function Oe(e) {
|
|
|
2521
2521
|
},
|
|
2522
2522
|
isStringArray: function isStringArray(r, n) {
|
|
2523
2523
|
if (!Array.isArray(n))
|
|
2524
|
-
throw new
|
|
2524
|
+
throw new Ee(e, r + " must be an array of strings.");
|
|
2525
2525
|
var _iterator = _createForOfIteratorHelper(n), _step;
|
|
2526
2526
|
try {
|
|
2527
2527
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
2528
2528
|
var _t2 = _step.value;
|
|
2529
2529
|
if ("string" != typeof _t2)
|
|
2530
|
-
throw new
|
|
2530
|
+
throw new Ee(e, r + " must be an array of strings.");
|
|
2531
2531
|
}
|
|
2532
2532
|
}
|
|
2533
2533
|
catch (err) {
|
|
@@ -2543,7 +2543,7 @@ var Oe = function Oe(e) {
|
|
|
2543
2543
|
},
|
|
2544
2544
|
isNumber: function isNumber(r, n) {
|
|
2545
2545
|
if ("number" != typeof n)
|
|
2546
|
-
throw new
|
|
2546
|
+
throw new Ee(e, r + " must be a number.");
|
|
2547
2547
|
return t;
|
|
2548
2548
|
},
|
|
2549
2549
|
isOptionalNumber: function isOptionalNumber(e, r) {
|
|
@@ -2551,7 +2551,7 @@ var Oe = function Oe(e) {
|
|
|
2551
2551
|
},
|
|
2552
2552
|
isBoolean: function isBoolean(r, n) {
|
|
2553
2553
|
if ("boolean" != typeof n)
|
|
2554
|
-
throw new
|
|
2554
|
+
throw new Ee(e, r + " must be a boolean.");
|
|
2555
2555
|
return t;
|
|
2556
2556
|
},
|
|
2557
2557
|
isOptionalBoolean: function isOptionalBoolean(e, r) {
|
|
@@ -2560,22 +2560,22 @@ var Oe = function Oe(e) {
|
|
|
2560
2560
|
};
|
|
2561
2561
|
return t;
|
|
2562
2562
|
};
|
|
2563
|
-
var
|
|
2563
|
+
var Oe;
|
|
2564
2564
|
!function (e) {
|
|
2565
2565
|
e.LoginOrCreateEML = "login_or_create_eml", e.LoginOrCreateOTP = "login_or_create_otp", e.ResetPassword = "reset_password";
|
|
2566
|
-
}(
|
|
2566
|
+
}(Oe || (Oe = {})), Promise.resolve({
|
|
2567
2567
|
pkceRequiredForEmailMagicLinks: !1
|
|
2568
2568
|
}), Promise.resolve({
|
|
2569
2569
|
pkceRequiredForPasswordResets: !1
|
|
2570
2570
|
}), Promise.resolve({
|
|
2571
2571
|
pkceRequiredForEmailMagicLinks: !1
|
|
2572
2572
|
});
|
|
2573
|
-
var
|
|
2573
|
+
var Pe = Promise.resolve({
|
|
2574
2574
|
pkceRequiredForPasswordResets: !1
|
|
2575
2575
|
});
|
|
2576
|
-
var
|
|
2577
|
-
function
|
|
2578
|
-
var n = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] :
|
|
2576
|
+
var Ce = /*#__PURE__*/ function () {
|
|
2577
|
+
function Ce(e, t, r) {
|
|
2578
|
+
var n = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Pe;
|
|
2579
2579
|
var i = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : function () {
|
|
2580
2580
|
return {
|
|
2581
2581
|
isEnabled: function isEnabled() {
|
|
@@ -2637,10 +2637,10 @@ var Pe = /*#__PURE__*/ function () {
|
|
|
2637
2637
|
}
|
|
2638
2638
|
};
|
|
2639
2639
|
}();
|
|
2640
|
-
_classCallCheck(this,
|
|
2640
|
+
_classCallCheck(this, Ce);
|
|
2641
2641
|
this._networkClient = e, this._subscriptionService = t, this._pkceManager = r, this._config = n, this.dfpProtectedAuth = i;
|
|
2642
2642
|
}
|
|
2643
|
-
_createClass(
|
|
2643
|
+
_createClass(Ce, [{
|
|
2644
2644
|
key: "getCodeChallenge",
|
|
2645
2645
|
value: function getCodeChallenge() {
|
|
2646
2646
|
return Ae(this, void 0, void 0, /*#__PURE__*/ _regeneratorRuntime().mark(function _callee5() {
|
|
@@ -2691,7 +2691,7 @@ var Pe = /*#__PURE__*/ function () {
|
|
|
2691
2691
|
while (1)
|
|
2692
2692
|
switch (_context6.prev = _context6.next) {
|
|
2693
2693
|
case 0:
|
|
2694
|
-
|
|
2694
|
+
Te("stytch.passwords.authenticate").isString("org_id", e.organization_id).isString("password", e.password).isString("email_address", e.email_address).isNumber("session_duration_minutes", e.session_duration_minutes).isOptionalString("locale", e.locale);
|
|
2695
2695
|
_context6.next = 3;
|
|
2696
2696
|
return this._pkceManager.getPKPair();
|
|
2697
2697
|
case 3:
|
|
@@ -2752,7 +2752,7 @@ var Pe = /*#__PURE__*/ function () {
|
|
|
2752
2752
|
while (1)
|
|
2753
2753
|
switch (_context7.prev = _context7.next) {
|
|
2754
2754
|
case 0:
|
|
2755
|
-
|
|
2755
|
+
Te("stytch.passwords.resetByEmailStart").isString("email", e.email_address).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);
|
|
2756
2756
|
_context7.next = 3;
|
|
2757
2757
|
return this.getCodeChallenge();
|
|
2758
2758
|
case 3:
|
|
@@ -2796,7 +2796,7 @@ var Pe = /*#__PURE__*/ function () {
|
|
|
2796
2796
|
while (1)
|
|
2797
2797
|
switch (_context8.prev = _context8.next) {
|
|
2798
2798
|
case 0:
|
|
2799
|
-
|
|
2799
|
+
Te("stytch.passwords.resetByEmail").isString("password_reset_token", e.password_reset_token).isString("password", e.password).isNumber("session_duration_minutes", e.session_duration_minutes).isOptionalString("locale", e.locale);
|
|
2800
2800
|
_context8.next = 3;
|
|
2801
2801
|
return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
|
|
2802
2802
|
case 3:
|
|
@@ -2856,7 +2856,7 @@ var Pe = /*#__PURE__*/ function () {
|
|
|
2856
2856
|
while (1)
|
|
2857
2857
|
switch (_context9.prev = _context9.next) {
|
|
2858
2858
|
case 0:
|
|
2859
|
-
|
|
2859
|
+
Te("stytch.passwords.resetByExistingPassword").isString("email", e.email_address).isString("existing_password", e.existing_password).isString("new_password", e.new_password).isOptionalString("locale", e.locale);
|
|
2860
2860
|
_context9.next = 3;
|
|
2861
2861
|
return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
|
|
2862
2862
|
case 3:
|
|
@@ -2911,7 +2911,7 @@ var Pe = /*#__PURE__*/ function () {
|
|
|
2911
2911
|
while (1)
|
|
2912
2912
|
switch (_context10.prev = _context10.next) {
|
|
2913
2913
|
case 0:
|
|
2914
|
-
|
|
2914
|
+
Te("stytch.passwords.resetBySession").isString("password", e.password);
|
|
2915
2915
|
_context10.next = 3;
|
|
2916
2916
|
return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
|
|
2917
2917
|
case 3:
|
|
@@ -2922,9 +2922,8 @@ var Pe = /*#__PURE__*/ function () {
|
|
|
2922
2922
|
return this._networkClient.retriableFetchSDK({
|
|
2923
2923
|
url: "/b2b/passwords/session/reset",
|
|
2924
2924
|
method: "POST",
|
|
2925
|
-
errorMessage: "Failed to reset session.",
|
|
2925
|
+
errorMessage: "Failed to reset by session.",
|
|
2926
2926
|
body: {
|
|
2927
|
-
organization_id: e.organization_id,
|
|
2928
2927
|
password: e.password,
|
|
2929
2928
|
captcha_token: r,
|
|
2930
2929
|
dfp_telemetry_id: t
|
|
@@ -2957,7 +2956,7 @@ var Pe = /*#__PURE__*/ function () {
|
|
|
2957
2956
|
while (1)
|
|
2958
2957
|
switch (_context11.prev = _context11.next) {
|
|
2959
2958
|
case 0:
|
|
2960
|
-
return _context11.abrupt("return", (
|
|
2959
|
+
return _context11.abrupt("return", (Te("stytch.passwords.strengthCheck").isOptionalString("email", e.email_address).isString("password", e.password), this._networkClient.fetchSDK({
|
|
2961
2960
|
url: "/b2b/passwords/strength_check",
|
|
2962
2961
|
method: "POST",
|
|
2963
2962
|
errorMessage: "Failed to check password strength.",
|
|
@@ -2974,18 +2973,18 @@ var Pe = /*#__PURE__*/ function () {
|
|
|
2974
2973
|
}));
|
|
2975
2974
|
}
|
|
2976
2975
|
}]);
|
|
2977
|
-
return
|
|
2976
|
+
return Ce;
|
|
2978
2977
|
}();
|
|
2979
2978
|
var Be = "bootstrap";
|
|
2980
|
-
var
|
|
2981
|
-
function
|
|
2979
|
+
var Re = /*#__PURE__*/ function () {
|
|
2980
|
+
function Re(e, t, r) {
|
|
2982
2981
|
var _this2 = this;
|
|
2983
|
-
_classCallCheck(this,
|
|
2982
|
+
_classCallCheck(this, Re);
|
|
2984
2983
|
this._publicToken = e, this._networkClient = t, this._dataLayer = r, this._bootstrapDataPromise = this._networkClient.fetchSDK({
|
|
2985
2984
|
url: "/projects/bootstrap/".concat(this._publicToken),
|
|
2986
2985
|
method: "GET",
|
|
2987
2986
|
errorMessage: "Error fetching bootstrap data for SDK for ".concat(this._publicToken)
|
|
2988
|
-
}).then(
|
|
2987
|
+
}).then(Re.mapBootstrapData).then(function (e) {
|
|
2989
2988
|
return _this2._dataLayer.setItem(Be, JSON.stringify(e)), e;
|
|
2990
2989
|
})["catch"](function (e) {
|
|
2991
2990
|
return J(e), {
|
|
@@ -3006,7 +3005,7 @@ var xe = /*#__PURE__*/ function () {
|
|
|
3006
3005
|
};
|
|
3007
3006
|
});
|
|
3008
3007
|
}
|
|
3009
|
-
_createClass(
|
|
3008
|
+
_createClass(Re, [{
|
|
3010
3009
|
key: "getSync",
|
|
3011
3010
|
value: function getSync() {
|
|
3012
3011
|
var e = this._dataLayer.getItem(Be);
|
|
@@ -3079,11 +3078,11 @@ var xe = /*#__PURE__*/ function () {
|
|
|
3079
3078
|
};
|
|
3080
3079
|
}
|
|
3081
3080
|
}]);
|
|
3082
|
-
return
|
|
3081
|
+
return Re;
|
|
3083
3082
|
}();
|
|
3084
|
-
var
|
|
3083
|
+
var xe = /*#__PURE__*/ _createClass(function xe(e) {
|
|
3085
3084
|
var _this3 = this;
|
|
3086
|
-
_classCallCheck(this,
|
|
3085
|
+
_classCallCheck(this, xe);
|
|
3087
3086
|
this.bootstrapPromise = e, this.executeRecaptcha = function () {
|
|
3088
3087
|
return Ae(_this3, void 0, void 0, /*#__PURE__*/ _regeneratorRuntime().mark(function _callee12() {
|
|
3089
3088
|
var _yield$this$state, e, t, r;
|
|
@@ -3195,7 +3194,7 @@ var Ie = /*#__PURE__*/ function () {
|
|
|
3195
3194
|
},
|
|
3196
3195
|
sdk: {
|
|
3197
3196
|
identifier: "Stytch.js Javascript SDK",
|
|
3198
|
-
version: "3.0.
|
|
3197
|
+
version: "3.0.3"
|
|
3199
3198
|
}
|
|
3200
3199
|
});
|
|
3201
3200
|
}
|
|
@@ -3298,53 +3297,16 @@ var Ie = /*#__PURE__*/ function () {
|
|
|
3298
3297
|
}]);
|
|
3299
3298
|
return Ie;
|
|
3300
3299
|
}();
|
|
3301
|
-
|
|
3302
|
-
function De(e, t) {
|
|
3303
|
-
_classCallCheck(this, De);
|
|
3304
|
-
this._networkClient = e, this._subscriptionService = t;
|
|
3305
|
-
}
|
|
3306
|
-
_createClass(De, [{
|
|
3307
|
-
key: "resetBySession",
|
|
3308
|
-
value: function resetBySession(e) {
|
|
3309
|
-
return Ae(this, void 0, void 0, /*#__PURE__*/ _regeneratorRuntime().mark(function _callee16() {
|
|
3310
|
-
return _regeneratorRuntime().wrap(function _callee16$(_context16) {
|
|
3311
|
-
while (1)
|
|
3312
|
-
switch (_context16.prev = _context16.next) {
|
|
3313
|
-
case 0:
|
|
3314
|
-
Oe("stytch.passwords.resetBySession").isString("password", e.password);
|
|
3315
|
-
_context16.next = 3;
|
|
3316
|
-
return this._networkClient.fetchSDK({
|
|
3317
|
-
url: "/b2b/passwords/session/reset",
|
|
3318
|
-
method: "POST",
|
|
3319
|
-
errorMessage: "Failed to reset session.",
|
|
3320
|
-
body: {
|
|
3321
|
-
organization_id: e.organization_id,
|
|
3322
|
-
password: e.password,
|
|
3323
|
-
session_token: e.session_token
|
|
3324
|
-
}
|
|
3325
|
-
});
|
|
3326
|
-
case 3:
|
|
3327
|
-
return _context16.abrupt("return", _context16.sent);
|
|
3328
|
-
case 4:
|
|
3329
|
-
case "end":
|
|
3330
|
-
return _context16.stop();
|
|
3331
|
-
}
|
|
3332
|
-
}, _callee16, this);
|
|
3333
|
-
}));
|
|
3334
|
-
}
|
|
3335
|
-
}]);
|
|
3336
|
-
return De;
|
|
3337
|
-
}();
|
|
3338
|
-
function Le(e) {
|
|
3300
|
+
function De(e) {
|
|
3339
3301
|
var t = e.toString(16);
|
|
3340
3302
|
return 1 === t.length && (t = "0" + t), t;
|
|
3341
3303
|
}
|
|
3342
|
-
var
|
|
3343
|
-
function
|
|
3344
|
-
_classCallCheck(this,
|
|
3304
|
+
var Le = /*#__PURE__*/ function () {
|
|
3305
|
+
function Le(e, t) {
|
|
3306
|
+
_classCallCheck(this, Le);
|
|
3345
3307
|
this._dataLayer = e, this.namespace = t;
|
|
3346
3308
|
}
|
|
3347
|
-
_createClass(
|
|
3309
|
+
_createClass(Le, [{
|
|
3348
3310
|
key: "key",
|
|
3349
3311
|
value: function key() {
|
|
3350
3312
|
return "PKCE_VERIFIER:" + this.namespace;
|
|
@@ -3352,22 +3314,22 @@ var Me = /*#__PURE__*/ function () {
|
|
|
3352
3314
|
}, {
|
|
3353
3315
|
key: "startPKCETransaction",
|
|
3354
3316
|
value: function startPKCETransaction() {
|
|
3355
|
-
return Ae(this, void 0, void 0, /*#__PURE__*/ _regeneratorRuntime().mark(function
|
|
3317
|
+
return Ae(this, void 0, void 0, /*#__PURE__*/ _regeneratorRuntime().mark(function _callee16() {
|
|
3356
3318
|
var e;
|
|
3357
|
-
return _regeneratorRuntime().wrap(function
|
|
3319
|
+
return _regeneratorRuntime().wrap(function _callee16$(_context16) {
|
|
3358
3320
|
while (1)
|
|
3359
|
-
switch (
|
|
3321
|
+
switch (_context16.prev = _context16.next) {
|
|
3360
3322
|
case 0:
|
|
3361
|
-
|
|
3362
|
-
return
|
|
3323
|
+
_context16.next = 2;
|
|
3324
|
+
return Le.createProofkeyPair();
|
|
3363
3325
|
case 2:
|
|
3364
|
-
e =
|
|
3365
|
-
return
|
|
3326
|
+
e = _context16.sent;
|
|
3327
|
+
return _context16.abrupt("return", (this._dataLayer.setItem(this.key(), JSON.stringify(e)), e));
|
|
3366
3328
|
case 4:
|
|
3367
3329
|
case "end":
|
|
3368
|
-
return
|
|
3330
|
+
return _context16.stop();
|
|
3369
3331
|
}
|
|
3370
|
-
},
|
|
3332
|
+
}, _callee16, this);
|
|
3371
3333
|
}));
|
|
3372
3334
|
}
|
|
3373
3335
|
}, {
|
|
@@ -3390,40 +3352,40 @@ var Me = /*#__PURE__*/ function () {
|
|
|
3390
3352
|
}], [{
|
|
3391
3353
|
key: "createProofkeyPair",
|
|
3392
3354
|
value: function createProofkeyPair() {
|
|
3393
|
-
return Ae(this, void 0, void 0, /*#__PURE__*/ _regeneratorRuntime().mark(function
|
|
3355
|
+
return Ae(this, void 0, void 0, /*#__PURE__*/ _regeneratorRuntime().mark(function _callee17() {
|
|
3394
3356
|
var _String$fromCharCode;
|
|
3395
3357
|
var e, t, r, n;
|
|
3396
|
-
return _regeneratorRuntime().wrap(function
|
|
3358
|
+
return _regeneratorRuntime().wrap(function _callee17$(_context17) {
|
|
3397
3359
|
while (1)
|
|
3398
|
-
switch (
|
|
3360
|
+
switch (_context17.prev = _context17.next) {
|
|
3399
3361
|
case 0:
|
|
3400
3362
|
e = new Uint32Array(16);
|
|
3401
3363
|
window.crypto.getRandomValues(e);
|
|
3402
|
-
t = Array.from(e).map(
|
|
3403
|
-
|
|
3364
|
+
t = Array.from(e).map(De).join("");
|
|
3365
|
+
_context17.next = 5;
|
|
3404
3366
|
return window.crypto.subtle.digest("SHA-256", new TextEncoder().encode(t));
|
|
3405
3367
|
case 5:
|
|
3406
|
-
r =
|
|
3407
|
-
return
|
|
3368
|
+
r = _context17.sent;
|
|
3369
|
+
return _context17.abrupt("return", {
|
|
3408
3370
|
code_challenge: (n = r, btoa((_String$fromCharCode = String.fromCharCode).call.apply(_String$fromCharCode, [null].concat(_toConsumableArray(new Uint8Array(n))))).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "")),
|
|
3409
3371
|
code_verifier: t
|
|
3410
3372
|
});
|
|
3411
3373
|
case 7:
|
|
3412
3374
|
case "end":
|
|
3413
|
-
return
|
|
3375
|
+
return _context17.stop();
|
|
3414
3376
|
}
|
|
3415
|
-
},
|
|
3377
|
+
}, _callee17);
|
|
3416
3378
|
}));
|
|
3417
3379
|
}
|
|
3418
3380
|
}]);
|
|
3419
|
-
return
|
|
3381
|
+
return Le;
|
|
3420
3382
|
}();
|
|
3421
|
-
var
|
|
3422
|
-
function
|
|
3423
|
-
_classCallCheck(this,
|
|
3383
|
+
var Me = /*#__PURE__*/ function () {
|
|
3384
|
+
function Me(e) {
|
|
3385
|
+
_classCallCheck(this, Me);
|
|
3424
3386
|
this._networkClient = e;
|
|
3425
3387
|
}
|
|
3426
|
-
_createClass(
|
|
3388
|
+
_createClass(Me, [{
|
|
3427
3389
|
key: "searchUser",
|
|
3428
3390
|
value: function searchUser(e) {
|
|
3429
3391
|
return this._networkClient.fetchSDK({
|
|
@@ -3461,16 +3423,16 @@ var Ne = /*#__PURE__*/ function () {
|
|
|
3461
3423
|
});
|
|
3462
3424
|
}
|
|
3463
3425
|
}]);
|
|
3464
|
-
return
|
|
3426
|
+
return Me;
|
|
3465
3427
|
}();
|
|
3466
|
-
var
|
|
3428
|
+
var Ne = function Ne(e) {
|
|
3467
3429
|
return (document.cookie ? document.cookie.split("; ") : []).filter(function (t) {
|
|
3468
3430
|
var _t$split = t.split("="), _t$split2 = _slicedToArray(_t$split, 1), r = _t$split2[0];
|
|
3469
3431
|
return e === r;
|
|
3470
3432
|
}).length > 1;
|
|
3471
3433
|
};
|
|
3472
3434
|
/*! js-cookie v3.0.1 | MIT */
|
|
3473
|
-
function
|
|
3435
|
+
function je(e) {
|
|
3474
3436
|
for (var t = 1; t < arguments.length; t++) {
|
|
3475
3437
|
var r = arguments[t];
|
|
3476
3438
|
for (var n in r)
|
|
@@ -3478,10 +3440,10 @@ function Fe(e) {
|
|
|
3478
3440
|
}
|
|
3479
3441
|
return e;
|
|
3480
3442
|
}
|
|
3481
|
-
var
|
|
3443
|
+
var Fe = function e(t, r) {
|
|
3482
3444
|
function n(e, n, i) {
|
|
3483
3445
|
if ("undefined" != typeof document) {
|
|
3484
|
-
"number" == typeof (i =
|
|
3446
|
+
"number" == typeof (i = je({}, 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);
|
|
3485
3447
|
var o = "";
|
|
3486
3448
|
for (var s in i)
|
|
3487
3449
|
i[s] && (o += "; " + s, !0 !== i[s] && (o += "=" + i[s].split(";")[0]));
|
|
@@ -3505,15 +3467,15 @@ var Ke = function e(t, r) {
|
|
|
3505
3467
|
}
|
|
3506
3468
|
},
|
|
3507
3469
|
remove: function remove(e, t) {
|
|
3508
|
-
n(e, "",
|
|
3470
|
+
n(e, "", je({}, t, {
|
|
3509
3471
|
expires: -1
|
|
3510
3472
|
}));
|
|
3511
3473
|
},
|
|
3512
3474
|
withAttributes: function withAttributes(t) {
|
|
3513
|
-
return e(this.converter,
|
|
3475
|
+
return e(this.converter, je({}, this.attributes, t));
|
|
3514
3476
|
},
|
|
3515
3477
|
withConverter: function withConverter(t) {
|
|
3516
|
-
return e(
|
|
3478
|
+
return e(je({}, this.converter, t), this.attributes);
|
|
3517
3479
|
}
|
|
3518
3480
|
}, {
|
|
3519
3481
|
attributes: {
|
|
@@ -3533,26 +3495,26 @@ var Ke = function e(t, r) {
|
|
|
3533
3495
|
}, {
|
|
3534
3496
|
path: "/"
|
|
3535
3497
|
});
|
|
3536
|
-
var
|
|
3498
|
+
var Ke = function Ke(e) {
|
|
3537
3499
|
var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
3538
3500
|
return "stytch_sdk_state_".concat(e).concat(t ? "::".concat(t) : "");
|
|
3539
3501
|
};
|
|
3540
|
-
var
|
|
3541
|
-
function
|
|
3502
|
+
var Ue = /*#__PURE__*/ function () {
|
|
3503
|
+
function Ue(e, t) {
|
|
3542
3504
|
var _this4 = this;
|
|
3543
|
-
_classCallCheck(this,
|
|
3505
|
+
_classCallCheck(this, Ue);
|
|
3544
3506
|
this.browserSessionStorage = {
|
|
3545
3507
|
getItem: function getItem(e) {
|
|
3546
|
-
return sessionStorage.getItem(
|
|
3508
|
+
return sessionStorage.getItem(Ke(_this4.publicToken, e));
|
|
3547
3509
|
},
|
|
3548
3510
|
setItem: function setItem(e, t) {
|
|
3549
|
-
return sessionStorage.setItem(
|
|
3511
|
+
return sessionStorage.setItem(Ke(_this4.publicToken, e), t);
|
|
3550
3512
|
},
|
|
3551
3513
|
removeItem: function removeItem(e) {
|
|
3552
|
-
return sessionStorage.removeItem(
|
|
3514
|
+
return sessionStorage.removeItem(Ke(_this4.publicToken, e));
|
|
3553
3515
|
}
|
|
3554
3516
|
}, this.publicToken = e, this.state = null, this.subscriptions = {}, (null == t ? void 0 : t.cookieOptions) ? (Q("SubscriptionDataLayer").isOptionalString("cookieOptions.opaqueTokenCookieName", t.cookieOptions.opaqueTokenCookieName).isOptionalString("cookieOptions.jwtCookieName", t.cookieOptions.jwtCookieName).isOptionalString("cookieOptions.istCookieName", t.cookieOptions.istCookieName).isOptionalString("cookieOptions.path", t.cookieOptions.path).isOptionalString("cookieOptions.domain", t.cookieOptions.domain), this._jwtCookieName = t.cookieOptions.jwtCookieName || null, this._opaqueTokenCookieName = t.cookieOptions.opaqueTokenCookieName || null, this._cookiePath = t.cookieOptions.path || null, this._domain = t.cookieOptions.domain || null, this._cookieAvailableToSubdomains = t.cookieOptions.availableToSubdomains || !1, this._istCookieName = t.cookieOptions.istCookieName || null) : (this._opaqueTokenCookieName = null, this._jwtCookieName = null, this._cookiePath = null, this._domain = null, this._cookieAvailableToSubdomains = !1, this._istCookieName = null);
|
|
3555
|
-
var r = localStorage.getItem(
|
|
3517
|
+
var r = localStorage.getItem(Ke(this.publicToken));
|
|
3556
3518
|
if (!r)
|
|
3557
3519
|
return;
|
|
3558
3520
|
var n;
|
|
@@ -3564,7 +3526,7 @@ var ze = /*#__PURE__*/ function () {
|
|
|
3564
3526
|
}
|
|
3565
3527
|
this.state = n;
|
|
3566
3528
|
}
|
|
3567
|
-
_createClass(
|
|
3529
|
+
_createClass(Ue, [{
|
|
3568
3530
|
key: "opaqueTokenCookieName",
|
|
3569
3531
|
get: function get() {
|
|
3570
3532
|
var e;
|
|
@@ -3586,44 +3548,44 @@ var ze = /*#__PURE__*/ function () {
|
|
|
3586
3548
|
key: "readSessionCookie",
|
|
3587
3549
|
value: function readSessionCookie() {
|
|
3588
3550
|
return {
|
|
3589
|
-
session_token:
|
|
3590
|
-
session_jwt:
|
|
3551
|
+
session_token: Fe.get(this.opaqueTokenCookieName),
|
|
3552
|
+
session_jwt: Fe.get(this.jwtCookieName)
|
|
3591
3553
|
};
|
|
3592
3554
|
}
|
|
3593
3555
|
}, {
|
|
3594
3556
|
key: "readIntermediateSessionTokenCookie",
|
|
3595
3557
|
value: function readIntermediateSessionTokenCookie() {
|
|
3596
|
-
return
|
|
3558
|
+
return Fe.get(this.istCookieName);
|
|
3597
3559
|
}
|
|
3598
3560
|
}, {
|
|
3599
3561
|
key: "writeSessionCookie",
|
|
3600
3562
|
value: function writeSessionCookie(e) {
|
|
3601
3563
|
var t, r, n, i;
|
|
3602
|
-
var o = e.state, s = e.session_token, a = e.session_jwt, c =
|
|
3564
|
+
var o = e.state, s = e.session_token, a = e.session_jwt, c = Ue.generateCookieOpts({
|
|
3603
3565
|
expiresAt: null !== (r = null === (t = null == o ? void 0 : o.session) || void 0 === t ? void 0 : t.expires_at) && void 0 !== r ? r : "",
|
|
3604
3566
|
availableToSubdomains: this._cookieAvailableToSubdomains,
|
|
3605
3567
|
path: this._cookiePath,
|
|
3606
3568
|
domain: this._domain
|
|
3607
3569
|
});
|
|
3608
|
-
|
|
3609
|
-
var u =
|
|
3570
|
+
Fe.set(this.opaqueTokenCookieName, s, c), Fe.set(this.jwtCookieName, a, c);
|
|
3571
|
+
var u = Ue.generateCookieOpts({
|
|
3610
3572
|
expiresAt: null !== (i = null === (n = null == o ? void 0 : o.session) || void 0 === n ? void 0 : n.expires_at) && void 0 !== i ? i : "",
|
|
3611
3573
|
availableToSubdomains: !this._cookieAvailableToSubdomains,
|
|
3612
3574
|
path: this._cookiePath,
|
|
3613
3575
|
domain: this._domain
|
|
3614
3576
|
});
|
|
3615
|
-
|
|
3577
|
+
Ne(this.jwtCookieName) && Fe.remove(this.jwtCookieName, u), Ne(this.opaqueTokenCookieName) && Fe.remove(this.opaqueTokenCookieName, u), Ne(this.jwtCookieName) && $("Could not remove extraneous JWT cookie. This might happen if the cookie has been set using multiple `path` settings, and may produce unwanted behavior."), Ne(this.opaqueTokenCookieName) && $("Could not remove extraneous opaque token cookie.");
|
|
3616
3578
|
}
|
|
3617
3579
|
}, {
|
|
3618
3580
|
key: "writeIntermediateSessionTokenCookie",
|
|
3619
3581
|
value: function writeIntermediateSessionTokenCookie(e) {
|
|
3620
|
-
var t = new Date(Date.now() + 6e5), r =
|
|
3582
|
+
var t = new Date(Date.now() + 6e5), r = Ue.generateCookieOpts({
|
|
3621
3583
|
expiresAt: t.toString(),
|
|
3622
3584
|
availableToSubdomains: this._cookieAvailableToSubdomains,
|
|
3623
3585
|
path: this._cookiePath,
|
|
3624
3586
|
domain: this._domain
|
|
3625
3587
|
});
|
|
3626
|
-
|
|
3588
|
+
Fe.set(this.istCookieName, e, r);
|
|
3627
3589
|
}
|
|
3628
3590
|
}, {
|
|
3629
3591
|
key: "removeSessionCookie",
|
|
@@ -3642,14 +3604,14 @@ var ze = /*#__PURE__*/ function () {
|
|
|
3642
3604
|
[!0, !1].forEach(function (t) {
|
|
3643
3605
|
[_this5._cookiePath, null].forEach(function (r) {
|
|
3644
3606
|
[_this5._domain, null].forEach(function (n) {
|
|
3645
|
-
var i =
|
|
3607
|
+
var i = Ue.generateCookieOpts({
|
|
3646
3608
|
expiresAt: new Date(0).toString(),
|
|
3647
3609
|
availableToSubdomains: t,
|
|
3648
3610
|
path: r,
|
|
3649
3611
|
domain: n
|
|
3650
3612
|
});
|
|
3651
3613
|
e.forEach(function (e) {
|
|
3652
|
-
|
|
3614
|
+
Fe.remove(e, i);
|
|
3653
3615
|
});
|
|
3654
3616
|
});
|
|
3655
3617
|
});
|
|
@@ -3658,22 +3620,22 @@ var ze = /*#__PURE__*/ function () {
|
|
|
3658
3620
|
}, {
|
|
3659
3621
|
key: "syncToLocalStorage",
|
|
3660
3622
|
value: function syncToLocalStorage() {
|
|
3661
|
-
localStorage.setItem(
|
|
3623
|
+
localStorage.setItem(Ke(this.publicToken), JSON.stringify(this.state));
|
|
3662
3624
|
}
|
|
3663
3625
|
}, {
|
|
3664
3626
|
key: "getItem",
|
|
3665
3627
|
value: function getItem(e) {
|
|
3666
|
-
return localStorage.getItem(
|
|
3628
|
+
return localStorage.getItem(Ke(this.publicToken, e));
|
|
3667
3629
|
}
|
|
3668
3630
|
}, {
|
|
3669
3631
|
key: "setItem",
|
|
3670
3632
|
value: function setItem(e, t) {
|
|
3671
|
-
return localStorage.setItem(
|
|
3633
|
+
return localStorage.setItem(Ke(this.publicToken, e), t);
|
|
3672
3634
|
}
|
|
3673
3635
|
}, {
|
|
3674
3636
|
key: "removeItem",
|
|
3675
3637
|
value: function removeItem(e) {
|
|
3676
|
-
return localStorage.removeItem(
|
|
3638
|
+
return localStorage.removeItem(Ke(this.publicToken, e));
|
|
3677
3639
|
}
|
|
3678
3640
|
}], [{
|
|
3679
3641
|
key: "generateCookieOpts",
|
|
@@ -3686,28 +3648,28 @@ var ze = /*#__PURE__*/ function () {
|
|
|
3686
3648
|
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;
|
|
3687
3649
|
}
|
|
3688
3650
|
}]);
|
|
3689
|
-
return
|
|
3651
|
+
return Ue;
|
|
3690
3652
|
}();
|
|
3691
|
-
var
|
|
3692
|
-
_inherits(
|
|
3693
|
-
var _super2 = _createSuper(
|
|
3694
|
-
function
|
|
3695
|
-
_classCallCheck(this,
|
|
3653
|
+
var ze = /*#__PURE__*/ function (_Ue) {
|
|
3654
|
+
_inherits(ze, _Ue);
|
|
3655
|
+
var _super2 = _createSuper(ze);
|
|
3656
|
+
function ze() {
|
|
3657
|
+
_classCallCheck(this, ze);
|
|
3696
3658
|
return _super2.apply(this, arguments);
|
|
3697
3659
|
}
|
|
3698
|
-
return _createClass(
|
|
3699
|
-
}(
|
|
3700
|
-
var
|
|
3660
|
+
return _createClass(ze);
|
|
3661
|
+
}(Ue);
|
|
3662
|
+
var We = Symbol["for"]("__stytch_b2b_DataLayer"), Ge = function Ge(e, t) {
|
|
3701
3663
|
var r = function () {
|
|
3702
3664
|
var e = window;
|
|
3703
|
-
return e[
|
|
3665
|
+
return e[We] || (e[We] = {}), e[We];
|
|
3704
3666
|
}();
|
|
3705
|
-
return r[e] || (r[e] = new
|
|
3706
|
-
},
|
|
3667
|
+
return r[e] || (r[e] = new ze(e, t)), r[e];
|
|
3668
|
+
}, He = function He(e, t) {
|
|
3707
3669
|
Object.values(e).forEach(function (e) {
|
|
3708
3670
|
return e(t);
|
|
3709
3671
|
});
|
|
3710
|
-
},
|
|
3672
|
+
}, qe = function () {
|
|
3711
3673
|
var t = (arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}).KEYS_TO_EXCLUDE, r = void 0 === t ? [] : t;
|
|
3712
3674
|
return function t(i, o) {
|
|
3713
3675
|
return n(i) === n(o) && (null === i || null === o ? i === o : "object" === n(i) ? Object.keys(i).length === Object.keys(o).length && !Object.keys(i).some(function (e) {
|
|
@@ -3723,26 +3685,22 @@ var Ge = Symbol["for"]("__stytch_b2b_DataLayer"), He = function He(e, t) {
|
|
|
3723
3685
|
}({
|
|
3724
3686
|
KEYS_TO_EXCLUDE: ["last_accessed_at"]
|
|
3725
3687
|
});
|
|
3726
|
-
var
|
|
3727
|
-
function
|
|
3688
|
+
var Ye = /*#__PURE__*/ function () {
|
|
3689
|
+
function Ye(e, t) {
|
|
3728
3690
|
var _this6 = this;
|
|
3729
|
-
_classCallCheck(this,
|
|
3730
|
-
var r;
|
|
3691
|
+
_classCallCheck(this, Ye);
|
|
3731
3692
|
this._publicToken = e, this._datalayer = t, this._listen = function (e) {
|
|
3732
|
-
if (e.key !==
|
|
3693
|
+
if (e.key !== Ke(_this6._publicToken))
|
|
3733
3694
|
return;
|
|
3734
3695
|
if (null === e.newValue || "null" === e.newValue)
|
|
3735
3696
|
return void _this6.destroyState();
|
|
3736
3697
|
var t = JSON.parse(e.newValue);
|
|
3737
3698
|
_this6.updateState(t);
|
|
3738
3699
|
}, window.addEventListener("storage", this._listen);
|
|
3739
|
-
var
|
|
3740
|
-
|
|
3741
|
-
return void this.destroyState();
|
|
3742
|
-
var _this$_datalayer$read = this._datalayer.readSessionCookie(), i = _this$_datalayer$read.session_token;
|
|
3743
|
-
i || this.destroyState();
|
|
3700
|
+
var _this$_datalayer$read = this._datalayer.readSessionCookie(), r = _this$_datalayer$read.session_token;
|
|
3701
|
+
r || this.destroyState();
|
|
3744
3702
|
}
|
|
3745
|
-
_createClass(
|
|
3703
|
+
_createClass(Ye, [{
|
|
3746
3704
|
key: "getTokens",
|
|
3747
3705
|
value: function getTokens() {
|
|
3748
3706
|
var _this$_datalayer$read2 = this._datalayer.readSessionCookie(), e = _this$_datalayer$read2.session_token, t = _this$_datalayer$read2.session_jwt;
|
|
@@ -3770,7 +3728,7 @@ var Ve = /*#__PURE__*/ function () {
|
|
|
3770
3728
|
key: "_updateStateAndTokensInternal",
|
|
3771
3729
|
value: function _updateStateAndTokensInternal(e) {
|
|
3772
3730
|
var t = this._datalayer.state, r = null === e.state ? null : Object.assign(Object.assign({}, this._datalayer.state), e.state);
|
|
3773
|
-
this._datalayer.state = r,
|
|
3731
|
+
this._datalayer.state = r, qe(t, r) || He(this._datalayer.subscriptions, r);
|
|
3774
3732
|
}
|
|
3775
3733
|
}, {
|
|
3776
3734
|
key: "updateStateAndTokens",
|
|
@@ -3781,7 +3739,7 @@ var Ve = /*#__PURE__*/ function () {
|
|
|
3781
3739
|
key: "updateState",
|
|
3782
3740
|
value: function updateState(e) {
|
|
3783
3741
|
var t = this._datalayer.state, r = null === e ? null : Object.assign(Object.assign({}, this._datalayer.state), e);
|
|
3784
|
-
this._datalayer.state = r,
|
|
3742
|
+
this._datalayer.state = r, qe(t, r) || (He(this._datalayer.subscriptions, r), this._datalayer.syncToLocalStorage());
|
|
3785
3743
|
}
|
|
3786
3744
|
}, {
|
|
3787
3745
|
key: "updateTokens",
|
|
@@ -3818,14 +3776,14 @@ var Ve = /*#__PURE__*/ function () {
|
|
|
3818
3776
|
return null;
|
|
3819
3777
|
}
|
|
3820
3778
|
}]);
|
|
3821
|
-
return
|
|
3779
|
+
return Ye;
|
|
3822
3780
|
}();
|
|
3823
|
-
var
|
|
3824
|
-
_inherits(
|
|
3825
|
-
var _super3 = _createSuper(
|
|
3826
|
-
function
|
|
3781
|
+
var Ve = /*#__PURE__*/ function (_Ye) {
|
|
3782
|
+
_inherits(Ve, _Ye);
|
|
3783
|
+
var _super3 = _createSuper(Ve);
|
|
3784
|
+
function Ve() {
|
|
3827
3785
|
var _this7;
|
|
3828
|
-
_classCallCheck(this,
|
|
3786
|
+
_classCallCheck(this, Ve);
|
|
3829
3787
|
_this7 = _super3.apply(this, arguments), _this7.updateMember = function (e) {
|
|
3830
3788
|
return _this7.updateState({
|
|
3831
3789
|
member: e
|
|
@@ -3839,12 +3797,12 @@ var $e = /*#__PURE__*/ function (_Ve) {
|
|
|
3839
3797
|
};
|
|
3840
3798
|
return _this7;
|
|
3841
3799
|
}
|
|
3842
|
-
return _createClass(
|
|
3843
|
-
}(
|
|
3844
|
-
var
|
|
3845
|
-
var
|
|
3800
|
+
return _createClass(Ve);
|
|
3801
|
+
}(Ye);
|
|
3802
|
+
var $e = Symbol["for"]("stytch__internal_b2b");
|
|
3803
|
+
var Je = /*#__PURE__*/ _createClass(function Je(e, t) {
|
|
3846
3804
|
var _this8 = this;
|
|
3847
|
-
_classCallCheck(this,
|
|
3805
|
+
_classCallCheck(this, Je);
|
|
3848
3806
|
var r;
|
|
3849
3807
|
!function (e) {
|
|
3850
3808
|
if ("undefined" == typeof window)
|
|
@@ -3856,13 +3814,13 @@ var Xe = /*#__PURE__*/ _createClass(function Xe(e, t) {
|
|
|
3856
3814
|
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",
|
|
3857
3815
|
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",
|
|
3858
3816
|
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",
|
|
3859
|
-
dfpBackendURL: null !== (
|
|
3817
|
+
dfpBackendURL: null !== (_ = null === (p = null == s ? void 0 : s.endpoints) || void 0 === p ? void 0 : p.dfpBackendURL) && void 0 !== _ ? _ : "https://telemetry.stytch.com",
|
|
3860
3818
|
clientsideServicesIframeURL: null !== (f = null === (m = null == s ? void 0 : s.endpoints) || void 0 === m ? void 0 : m.clientsideServicesIframeURL) && void 0 !== f ? f : "https://js.stytch.com/clientside-services/index.html"
|
|
3861
3819
|
}
|
|
3862
3820
|
};
|
|
3863
|
-
var s, a, c, u, l, d, h,
|
|
3864
|
-
this._dataLayer =
|
|
3865
|
-
var v = new
|
|
3821
|
+
var s, a, c, u, l, d, h, p, _, m, f;
|
|
3822
|
+
this._dataLayer = Ge(e, i), this._subscriptionService = new Ve(e, this._dataLayer);
|
|
3823
|
+
var v = new Le(this._dataLayer, "passwords");
|
|
3866
3824
|
this._networkClient = new Ie(e, this._dataLayer, o.endpoints.sdkBackendURL, function () {
|
|
3867
3825
|
var e, t, r, n;
|
|
3868
3826
|
return {
|
|
@@ -3870,17 +3828,17 @@ var Xe = /*#__PURE__*/ _createClass(function Xe(e, t) {
|
|
|
3870
3828
|
stytch_member_session_id: null === (n = null === (r = _this8._dataLayer.state) || void 0 === r ? void 0 : r.session) || void 0 === n ? void 0 : n.member_session_id
|
|
3871
3829
|
};
|
|
3872
3830
|
});
|
|
3873
|
-
var b = new
|
|
3874
|
-
this.organization = new ae(this._networkClient), this.member = new oe(this._networkClient, this._subscriptionService), this.session = new ue(this._networkClient, this._subscriptionService), this.magicLinks = new ie(this._networkClient, this._subscriptionService, new
|
|
3831
|
+
var b = new Re(e, this._networkClient, this._dataLayer), g = new xe(b.getAsync()), y = new ee(e, o.endpoints.dfpBackendURL, b.getAsync(), g.executeRecaptcha);
|
|
3832
|
+
this.organization = new ae(this._networkClient), this.member = new oe(this._networkClient, this._subscriptionService), this.session = new ue(this._networkClient, this._subscriptionService), this.magicLinks = new ie(this._networkClient, this._subscriptionService, new Le(this._dataLayer, "magic_links"), v, b.getAsync(), y), this.oauth = new ce(this._networkClient, this._subscriptionService, new Le(this._dataLayer, "oauth"), b.getAsync(), {
|
|
3875
3833
|
publicToken: e,
|
|
3876
3834
|
testAPIURL: o.endpoints.testAPIURL,
|
|
3877
3835
|
liveAPIURL: o.endpoints.liveAPIURL
|
|
3878
|
-
}, y), this.sso = new se(this._networkClient, this._subscriptionService, new
|
|
3836
|
+
}, y), this.sso = new se(this._networkClient, this._subscriptionService, new Le(this._dataLayer, "sso"), b.getAsync(), {
|
|
3879
3837
|
publicToken: e,
|
|
3880
3838
|
testAPIURL: o.endpoints.testAPIURL,
|
|
3881
3839
|
liveAPIURL: o.endpoints.liveAPIURL
|
|
3882
|
-
}), this.discovery = new le(this._networkClient, this._subscriptionService), this.passwords = new
|
|
3883
|
-
var
|
|
3840
|
+
}), this.discovery = new le(this._networkClient, this._subscriptionService), this.passwords = new Ce(this._networkClient, this._subscriptionService, v, b.getAsync(), y), this.otps = new Se(this._networkClient, this._subscriptionService, y), this._sessionManager = new we(this._subscriptionService, this.session);
|
|
3841
|
+
var k = new Me(this._networkClient);
|
|
3884
3842
|
this._dataLayer.readSessionCookie().session_token && this._sessionManager.performBackgroundRefresh(), this._networkClient.logEvent({
|
|
3885
3843
|
name: "b2b_sdk_instance_instantiated",
|
|
3886
3844
|
details: {
|
|
@@ -3890,51 +3848,50 @@ var Xe = /*#__PURE__*/ _createClass(function Xe(e, t) {
|
|
|
3890
3848
|
}
|
|
3891
3849
|
});
|
|
3892
3850
|
(function (e, t) {
|
|
3893
|
-
Object.assign(e, _defineProperty({},
|
|
3851
|
+
Object.assign(e, _defineProperty({}, $e, t));
|
|
3894
3852
|
})(this, {
|
|
3895
3853
|
bootstrap: b,
|
|
3896
3854
|
publicToken: e,
|
|
3897
|
-
searchManager:
|
|
3898
|
-
passwordResetClient: k,
|
|
3855
|
+
searchManager: k,
|
|
3899
3856
|
dataLayer: this._dataLayer,
|
|
3900
3857
|
networkClient: this._networkClient
|
|
3901
3858
|
});
|
|
3902
3859
|
});
|
|
3903
|
-
function
|
|
3904
|
-
return
|
|
3860
|
+
function Xe(e) {
|
|
3861
|
+
return Xe = "function" == typeof Symbol && "symbol" == _typeof(Symbol.iterator) ? function (e) {
|
|
3905
3862
|
return _typeof(e);
|
|
3906
3863
|
} : function (e) {
|
|
3907
3864
|
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : _typeof(e);
|
|
3908
|
-
},
|
|
3865
|
+
}, Xe(e);
|
|
3909
3866
|
}
|
|
3910
|
-
function
|
|
3867
|
+
function Ze(e, t) {
|
|
3911
3868
|
for (var r = 0; r < t.length; r++) {
|
|
3912
3869
|
var n = t[r];
|
|
3913
3870
|
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) {
|
|
3914
|
-
if ("object" !==
|
|
3871
|
+
if ("object" !== Xe(e) || null === e)
|
|
3915
3872
|
return e;
|
|
3916
3873
|
var r = e[Symbol.toPrimitive];
|
|
3917
3874
|
if (void 0 !== r) {
|
|
3918
3875
|
var n = r.call(e, t || "default");
|
|
3919
|
-
if ("object" !==
|
|
3876
|
+
if ("object" !== Xe(n))
|
|
3920
3877
|
return n;
|
|
3921
3878
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
3922
3879
|
}
|
|
3923
3880
|
return ("string" === t ? String : Number)(e);
|
|
3924
|
-
}(i, "string"), "symbol" ===
|
|
3881
|
+
}(i, "string"), "symbol" === Xe(o) ? o : String(o)), n);
|
|
3925
3882
|
}
|
|
3926
3883
|
var i, o;
|
|
3927
3884
|
}
|
|
3928
|
-
function
|
|
3929
|
-
return t &&
|
|
3885
|
+
function Qe(e, t, r) {
|
|
3886
|
+
return t && Ze(e.prototype, t), r && Ze(e, r), Object.defineProperty(e, "prototype", {
|
|
3930
3887
|
writable: !1
|
|
3931
3888
|
}), e;
|
|
3932
3889
|
}
|
|
3933
|
-
function
|
|
3890
|
+
function et(e, t) {
|
|
3934
3891
|
if (!(e instanceof t))
|
|
3935
3892
|
throw new TypeError("Cannot call a class as a function");
|
|
3936
3893
|
}
|
|
3937
|
-
function
|
|
3894
|
+
function tt(e, t) {
|
|
3938
3895
|
if ("function" != typeof t && null !== t)
|
|
3939
3896
|
throw new TypeError("Super expression must either be null or a function");
|
|
3940
3897
|
e.prototype = Object.create(t && t.prototype, {
|
|
@@ -3945,35 +3902,35 @@ function rt(e, t) {
|
|
|
3945
3902
|
}
|
|
3946
3903
|
}), Object.defineProperty(e, "prototype", {
|
|
3947
3904
|
writable: !1
|
|
3948
|
-
}), t &&
|
|
3905
|
+
}), t && at(e, t);
|
|
3949
3906
|
}
|
|
3950
|
-
function
|
|
3951
|
-
var t =
|
|
3907
|
+
function rt(e) {
|
|
3908
|
+
var t = st();
|
|
3952
3909
|
return function () {
|
|
3953
|
-
var r, n =
|
|
3910
|
+
var r, n = ct(e);
|
|
3954
3911
|
if (t) {
|
|
3955
|
-
var i =
|
|
3912
|
+
var i = ct(this).constructor;
|
|
3956
3913
|
r = Reflect.construct(n, arguments, i);
|
|
3957
3914
|
}
|
|
3958
3915
|
else
|
|
3959
3916
|
r = n.apply(this, arguments);
|
|
3960
3917
|
return function (e, t) {
|
|
3961
|
-
if (t && ("object" ===
|
|
3918
|
+
if (t && ("object" === Xe(t) || "function" == typeof t))
|
|
3962
3919
|
return t;
|
|
3963
3920
|
if (void 0 !== t)
|
|
3964
3921
|
throw new TypeError("Derived constructors may only return object or undefined");
|
|
3965
|
-
return
|
|
3922
|
+
return nt(e);
|
|
3966
3923
|
}(this, r);
|
|
3967
3924
|
};
|
|
3968
3925
|
}
|
|
3969
|
-
function
|
|
3926
|
+
function nt(e) {
|
|
3970
3927
|
if (void 0 === e)
|
|
3971
3928
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
3972
3929
|
return e;
|
|
3973
3930
|
}
|
|
3974
|
-
function
|
|
3931
|
+
function it(e) {
|
|
3975
3932
|
var t = "function" == typeof Map ? new Map() : void 0;
|
|
3976
|
-
return
|
|
3933
|
+
return it = function it(e) {
|
|
3977
3934
|
if (null === e || (r = e, -1 === Function.toString.call(r).indexOf("[native code]")))
|
|
3978
3935
|
return e;
|
|
3979
3936
|
var r;
|
|
@@ -3985,7 +3942,7 @@ function ot(e) {
|
|
|
3985
3942
|
t.set(e, n);
|
|
3986
3943
|
}
|
|
3987
3944
|
function n() {
|
|
3988
|
-
return
|
|
3945
|
+
return ot(e, arguments, ct(this).constructor);
|
|
3989
3946
|
}
|
|
3990
3947
|
return n.prototype = Object.create(e.prototype, {
|
|
3991
3948
|
constructor: {
|
|
@@ -3994,18 +3951,18 @@ function ot(e) {
|
|
|
3994
3951
|
writable: !0,
|
|
3995
3952
|
configurable: !0
|
|
3996
3953
|
}
|
|
3997
|
-
}),
|
|
3998
|
-
},
|
|
3954
|
+
}), at(n, e);
|
|
3955
|
+
}, it(e);
|
|
3999
3956
|
}
|
|
4000
|
-
function
|
|
4001
|
-
return
|
|
3957
|
+
function ot(e, t, r) {
|
|
3958
|
+
return ot = st() ? Reflect.construct.bind() : function (e, t, r) {
|
|
4002
3959
|
var n = [null];
|
|
4003
3960
|
n.push.apply(n, t);
|
|
4004
3961
|
var i = new (Function.bind.apply(e, n))();
|
|
4005
|
-
return r &&
|
|
4006
|
-
},
|
|
3962
|
+
return r && at(i, r.prototype), i;
|
|
3963
|
+
}, ot.apply(null, arguments);
|
|
4007
3964
|
}
|
|
4008
|
-
function
|
|
3965
|
+
function st() {
|
|
4009
3966
|
if ("undefined" == typeof Reflect || !Reflect.construct)
|
|
4010
3967
|
return !1;
|
|
4011
3968
|
if (Reflect.construct.sham)
|
|
@@ -4019,86 +3976,86 @@ function at() {
|
|
|
4019
3976
|
return !1;
|
|
4020
3977
|
}
|
|
4021
3978
|
}
|
|
4022
|
-
function
|
|
4023
|
-
return
|
|
3979
|
+
function at(e, t) {
|
|
3980
|
+
return at = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (e, t) {
|
|
4024
3981
|
return e.__proto__ = t, e;
|
|
4025
|
-
},
|
|
3982
|
+
}, at(e, t);
|
|
4026
3983
|
}
|
|
4027
|
-
function
|
|
4028
|
-
return
|
|
3984
|
+
function ct(e) {
|
|
3985
|
+
return ct = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (e) {
|
|
4029
3986
|
return e.__proto__ || Object.getPrototypeOf(e);
|
|
4030
|
-
},
|
|
3987
|
+
}, ct(e);
|
|
4031
3988
|
}
|
|
4032
|
-
var lt, dt, ht,
|
|
3989
|
+
var ut, lt, dt, ht, pt, _t;
|
|
4033
3990
|
!function (e) {
|
|
4034
|
-
e.emailMagicLinks = "emailMagicLinks", e.oauth = "oauth", e.otp = "otp", e.crypto = "crypto", e.passwords = "passwords";
|
|
4035
|
-
}(
|
|
3991
|
+
e.emailMagicLinks = "emailMagicLinks", e.oauth = "oauth", e.otp = "otp", e.crypto = "crypto", e.passwords = "passwords", e.passkeys = "passkeys";
|
|
3992
|
+
}(ut || (ut = {})), function (e) {
|
|
4036
3993
|
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";
|
|
4037
|
-
}(
|
|
3994
|
+
}(lt || (lt = {})), function (e) {
|
|
4038
3995
|
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";
|
|
4039
|
-
}(
|
|
3996
|
+
}(dt || (dt = {})), function (e) {
|
|
4040
3997
|
e.embedded = "embedded", e.floating = "floating";
|
|
4041
|
-
}(
|
|
3998
|
+
}(ht || (ht = {})), function (e) {
|
|
4042
3999
|
e.SMS = "sms", e.WhatsApp = "whatsapp", e.Email = "email";
|
|
4043
4000
|
}(pt || (pt = {})), function (e) {
|
|
4044
|
-
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";
|
|
4045
|
-
}(
|
|
4046
|
-
var ft, vt, bt
|
|
4047
|
-
|
|
4048
|
-
var t =
|
|
4001
|
+
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_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";
|
|
4002
|
+
}(_t || (_t = {}));
|
|
4003
|
+
var mt, ft, vt, bt; (function (e) {
|
|
4004
|
+
tt(r, it(Error));
|
|
4005
|
+
var t = rt(r);
|
|
4049
4006
|
function r(e, n) {
|
|
4050
4007
|
var i;
|
|
4051
|
-
return
|
|
4008
|
+
return et(this, r), (i = t.call(this, e + "\n" + n)).message = e + "\n" + n, i.name = "SDKAPIUnreachableError", i.details = n, Object.setPrototypeOf(nt(i), r.prototype), i;
|
|
4052
4009
|
}
|
|
4053
|
-
return
|
|
4010
|
+
return Qe(r);
|
|
4054
4011
|
})(); (function (e) {
|
|
4055
|
-
|
|
4056
|
-
var t =
|
|
4012
|
+
tt(r, it(Error));
|
|
4013
|
+
var t = rt(r);
|
|
4057
4014
|
function r(e, n) {
|
|
4058
4015
|
var i;
|
|
4059
|
-
return
|
|
4016
|
+
return et(this, r), (i = t.call(this)).name = "StytchSDKUsageError", i.message = "Invalid call to ".concat(e, "\n") + n, i;
|
|
4060
4017
|
}
|
|
4061
|
-
return
|
|
4018
|
+
return Qe(r);
|
|
4062
4019
|
})(); (function (e) {
|
|
4063
|
-
|
|
4064
|
-
var t =
|
|
4020
|
+
tt(r, it(Error));
|
|
4021
|
+
var t = rt(r);
|
|
4065
4022
|
function r(e) {
|
|
4066
4023
|
var n, i;
|
|
4067
|
-
|
|
4024
|
+
et(this, r), (n = t.call(this)).name = "StytchSDKSchemaError";
|
|
4068
4025
|
var o = null === (i = e.body) || void 0 === i ? void 0 : i.map(function (e) {
|
|
4069
4026
|
return "".concat(e.dataPath, ": ").concat(e.message);
|
|
4070
4027
|
}).join("\n");
|
|
4071
4028
|
return n.message = "[400] Request does not match expected schema\n".concat(o), n;
|
|
4072
4029
|
}
|
|
4073
|
-
return
|
|
4030
|
+
return Qe(r);
|
|
4074
4031
|
})(); (function (e) {
|
|
4075
|
-
|
|
4076
|
-
var t =
|
|
4032
|
+
tt(r, it(Error));
|
|
4033
|
+
var t = rt(r);
|
|
4077
4034
|
function r(e) {
|
|
4078
4035
|
var n;
|
|
4079
|
-
|
|
4036
|
+
et(this, r), (n = t.call(this)).name = "StytchSDKAPIError";
|
|
4080
4037
|
var i = e.status_code, o = e.error_type, s = e.error_message, a = e.error_url, c = e.request_id;
|
|
4081
4038
|
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;
|
|
4082
4039
|
}
|
|
4083
|
-
return
|
|
4040
|
+
return Qe(r);
|
|
4084
4041
|
})(); (function (e) {
|
|
4085
|
-
|
|
4086
|
-
var t =
|
|
4042
|
+
tt(r, it(Error));
|
|
4043
|
+
var t = rt(r);
|
|
4087
4044
|
function r(e) {
|
|
4088
4045
|
var n;
|
|
4089
|
-
return
|
|
4046
|
+
return et(this, r), (n = t.call(this)).name = "StytchSDKNativeError", n.error_type = e, n.message = "".concat(e), n;
|
|
4090
4047
|
}
|
|
4091
|
-
return
|
|
4048
|
+
return Qe(r);
|
|
4092
4049
|
})();
|
|
4093
4050
|
!function (e) {
|
|
4094
4051
|
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";
|
|
4095
|
-
}(
|
|
4052
|
+
}(mt || (mt = {})), function (e) {
|
|
4096
4053
|
e.emailMagicLinks = "emailMagicLinks", e.sso = "sso", e.passwords = "passwords", e.oauth = "oauth";
|
|
4097
|
-
}(
|
|
4054
|
+
}(ft || (ft = {})), function (e) {
|
|
4098
4055
|
e.Discovery = "Discovery", e.Organization = "Organization", e.PasswordReset = "PasswordReset";
|
|
4099
|
-
}(
|
|
4056
|
+
}(vt || (vt = {})), function (e) {
|
|
4100
4057
|
e.Google = "google", e.Microsoft = "microsoft";
|
|
4101
|
-
}(
|
|
4058
|
+
}(bt || (bt = {}));
|
|
4102
4059
|
|
|
4103
4060
|
const cannotInvokeMethodOnServerError = (path) => `[Stytch] Invalid serverside function call to ${path}.
|
|
4104
4061
|
The Stytch Javascript SDK is intended to ony be used on the client side.
|
|
@@ -4155,7 +4112,7 @@ const createStytchB2BHeadlessClient = (...args) => {
|
|
|
4155
4112
|
if (typeof window === 'undefined') {
|
|
4156
4113
|
return createStytchSSRProxy();
|
|
4157
4114
|
}
|
|
4158
|
-
return new
|
|
4115
|
+
return new Je(...args);
|
|
4159
4116
|
};
|
|
4160
4117
|
|
|
4161
4118
|
export { createStytchB2BHeadlessClient };
|