@stytch/vanilla-js 4.7.8 → 4.9.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 +33 -0
- package/dist/b2b/index.d.ts +16 -1
- package/dist/b2b/index.esm.d.ts +16 -1
- package/dist/b2b/index.esm.js +852 -852
- package/dist/b2b/index.headless.d.ts +16 -1
- package/dist/b2b/index.headless.esm.d.ts +16 -1
- package/dist/b2b/index.headless.esm.js +532 -532
- package/dist/b2b/index.headless.js +555 -555
- package/dist/b2b/index.js +1130 -1130
- package/dist/index.d.ts +17 -1
- package/dist/index.esm.d.ts +17 -1
- package/dist/index.esm.js +3613 -3558
- package/dist/index.headless.d.ts +17 -1
- package/dist/index.headless.esm.d.ts +17 -1
- package/dist/index.headless.esm.js +354 -315
- package/dist/index.headless.js +374 -335
- package/dist/index.js +3550 -3495
- package/package.json +3 -2
package/dist/index.headless.js
CHANGED
|
@@ -137,7 +137,7 @@ function d(e) {
|
|
|
137
137
|
var h, p, f, _, m, v, y;
|
|
138
138
|
Object.defineProperty(exports, "__esModule", {
|
|
139
139
|
value: !0
|
|
140
|
-
}), exports.Products = void 0, (h = exports.Products || (exports.Products = {})).emailMagicLinks = "emailMagicLinks", h.oauth = "oauth", h.otp = "otp", h.crypto = "crypto", h.passwords = "passwords", h.passkeys = "passkeys", exports.OAuthProviders = void 0, (p = exports.OAuthProviders || (exports.OAuthProviders = {})).Google = "google", p.Microsoft = "microsoft", p.Apple = "apple", p.Github = "github", p.GitLab = "gitlab", p.Facebook = "facebook", p.Discord = "discord", p.Salesforce = "salesforce", p.Slack = "slack", p.Amazon = "amazon", p.Bitbucket = "bitbucket", p.LinkedIn = "linkedin", p.Coinbase = "coinbase", p.Twitch = "twitch", p.Twitter = "twitter", p.TikTok = "tiktok", p.Snapchat = "snapchat", p.Figma = "figma", p.Yahoo = "yahoo", exports.Wallets = void 0, (f = exports.Wallets || (exports.Wallets = {})).Vessel = "Vessel", f.Phantom = "Phantom", f.Metamask = "Metamask", f.Coinbase = "Coinbase", f.Binance = "Binance", f.GenericEthereumWallet = "Other Ethereum Wallet", f.GenericSolanaWallet = "Other Solana Wallet", exports.OneTapPositions = void 0, (_ = exports.OneTapPositions || (exports.OneTapPositions = {})).embedded = "embedded", _.floating = "floating", exports.OTPMethods = void 0, (m = exports.OTPMethods || (exports.OTPMethods = {})).SMS = "sms", m.WhatsApp = "whatsapp", m.Email = "email", exports.StytchEventType = void 0, (v = exports.StytchEventType || (exports.StytchEventType = {})).MagicLinkLoginOrCreateEvent = "MAGIC_LINK_LOGIN_OR_CREATE", v.OTPsLoginOrCreateEvent = "OTP_LOGIN_OR_CREATE", v.OTPsAuthenticate = "OTP_AUTHENTICATE", v.CryptoWalletAuthenticateStart = "CRYPTO_WALLET_AUTHENTICATE_START", v.CryptoWalletAuthenticate = "CRYPTO_WALLET_AUTHENTICATE", v.PasswordCreate = "PASSWORD_CREATE", v.PasswordAuthenticate = "PASSWORD_AUTHENTICATE", v.PasswordResetByEmailStart = "PASSWORD_RESET_BY_EMAIL_START", v.PasswordResetByEmail = "PASSWORD_RESET_BY_EMAIL", v.PasskeyRegister = "PASSKEY_REGISTER", v.PasskeyAuthenticate = "PASSKEY_AUTHENTICATE", v.PasskeySkip = "PASSKEY_SKIP", v.PasskeyDone = "PASSKEY_DONE", v.B2BMagicLinkEmailLoginOrSignup = "B2B_MAGIC_LINK_EMAIL_LOGIN_OR_SIGNUP", v.B2BMagicLinkAuthenticate = "B2B_MAGIC_LINK_AUTHENTICATE", v.B2BMagicLinkEmailDiscoverySend = "B2B_MAGIC_LINK_EMAIL_DISCOVERY_SEND", v.B2BMagicLinkDiscoveryAuthenticate = "B2B_MAGIC_LINK_DISCOVERY_AUTHENTICATE", v.B2BSSOStart = "B2B_SSO_START", v.B2BSSOAuthenticate = "B2B_SSO_AUTHENTICATE", v.B2BOAuthAuthenticate = "B2B_OAUTH_AUTHENTICATE", v.B2BOAuthDiscoveryAuthenticate = "B2B_OAUTH_DISCOVERY_AUTHENTICATE", v.B2BDiscoveryOrganizationsCreate = "B2B_DISCOVERY_ORGANIZATIONS_CREATE", v.B2BDiscoveryIntermediateSessionExchange = "B2B_DISCOVERY_INTERMEDIATE_SESSION_EXCHANGE", v.B2BPasswordAuthenticate = "B2B_PASSWORD_AUTHENTICATE", v.B2BPasswordResetByEmailStart = "B2B_PASSWORD_RESET_BY_EMAIL_START", v.B2BPasswordResetByEmail = "B2B_PASSWORD_RESET_BY_EMAIL", v.B2BPasswordResetBySession = "B2B_PASSWORD_RESET_BY_SESSION", v.B2BSMSOTPSend = "B2B_SMS_OTP_SEND", v.B2BSMSOTPAuthenticate = "B2B_SMS_OTP_AUTHENTICATE", v.B2BTOTPCreate = "B2B_TOTP_CREATE", v.B2BTOTPAuthenticate = "B2B_TOTP_AUTHENTICATE", v.B2BRecoveryCodesRecover = "B2B_RECOVERY_CODES_RECOVER", exports.RNUIProducts = void 0, (y = exports.RNUIProducts || (exports.RNUIProducts = {}))[y.emailMagicLinks = 0] = "emailMagicLinks", y[y.oauth = 1] = "oauth", y[y.otp = 2] = "otp", y[y.passwords = 3] = "passwords";
|
|
140
|
+
}), exports.Products = void 0, (h = exports.Products || (exports.Products = {})).emailMagicLinks = "emailMagicLinks", h.oauth = "oauth", h.otp = "otp", h.crypto = "crypto", h.passwords = "passwords", h.passkeys = "passkeys", exports.OAuthProviders = void 0, (p = exports.OAuthProviders || (exports.OAuthProviders = {})).Google = "google", p.Microsoft = "microsoft", p.Apple = "apple", p.Github = "github", p.GitLab = "gitlab", p.Facebook = "facebook", p.Discord = "discord", p.Salesforce = "salesforce", p.Slack = "slack", p.Amazon = "amazon", p.Bitbucket = "bitbucket", p.LinkedIn = "linkedin", p.Coinbase = "coinbase", p.Twitch = "twitch", p.Twitter = "twitter", p.TikTok = "tiktok", p.Snapchat = "snapchat", p.Figma = "figma", p.Yahoo = "yahoo", exports.Wallets = void 0, (f = exports.Wallets || (exports.Wallets = {})).Vessel = "Vessel", f.Phantom = "Phantom", f.Metamask = "Metamask", f.Coinbase = "Coinbase", f.Binance = "Binance", f.GenericEthereumWallet = "Other Ethereum Wallet", f.GenericSolanaWallet = "Other Solana Wallet", exports.OneTapPositions = void 0, (_ = exports.OneTapPositions || (exports.OneTapPositions = {})).embedded = "embedded", _.floating = "floating", _.embeddedOnly = "embeddedOnly", _.floatingOrEmbedded = "floatingOrEmbedded", _.forceLegacyEmbedded = "forceLegacyEmbedded", exports.OTPMethods = void 0, (m = exports.OTPMethods || (exports.OTPMethods = {})).SMS = "sms", m.WhatsApp = "whatsapp", m.Email = "email", exports.StytchEventType = void 0, (v = exports.StytchEventType || (exports.StytchEventType = {})).MagicLinkLoginOrCreateEvent = "MAGIC_LINK_LOGIN_OR_CREATE", v.OTPsLoginOrCreateEvent = "OTP_LOGIN_OR_CREATE", v.OTPsAuthenticate = "OTP_AUTHENTICATE", v.CryptoWalletAuthenticateStart = "CRYPTO_WALLET_AUTHENTICATE_START", v.CryptoWalletAuthenticate = "CRYPTO_WALLET_AUTHENTICATE", v.PasswordCreate = "PASSWORD_CREATE", v.PasswordAuthenticate = "PASSWORD_AUTHENTICATE", v.PasswordResetByEmailStart = "PASSWORD_RESET_BY_EMAIL_START", v.PasswordResetByEmail = "PASSWORD_RESET_BY_EMAIL", v.PasskeyRegister = "PASSKEY_REGISTER", v.PasskeyAuthenticate = "PASSKEY_AUTHENTICATE", v.PasskeySkip = "PASSKEY_SKIP", v.PasskeyDone = "PASSKEY_DONE", v.B2BMagicLinkEmailLoginOrSignup = "B2B_MAGIC_LINK_EMAIL_LOGIN_OR_SIGNUP", v.B2BMagicLinkAuthenticate = "B2B_MAGIC_LINK_AUTHENTICATE", v.B2BMagicLinkEmailDiscoverySend = "B2B_MAGIC_LINK_EMAIL_DISCOVERY_SEND", v.B2BMagicLinkDiscoveryAuthenticate = "B2B_MAGIC_LINK_DISCOVERY_AUTHENTICATE", v.B2BSSOStart = "B2B_SSO_START", v.B2BSSOAuthenticate = "B2B_SSO_AUTHENTICATE", v.B2BOAuthAuthenticate = "B2B_OAUTH_AUTHENTICATE", v.B2BOAuthDiscoveryAuthenticate = "B2B_OAUTH_DISCOVERY_AUTHENTICATE", v.B2BDiscoveryOrganizationsCreate = "B2B_DISCOVERY_ORGANIZATIONS_CREATE", v.B2BDiscoveryIntermediateSessionExchange = "B2B_DISCOVERY_INTERMEDIATE_SESSION_EXCHANGE", v.B2BPasswordAuthenticate = "B2B_PASSWORD_AUTHENTICATE", v.B2BPasswordResetByEmailStart = "B2B_PASSWORD_RESET_BY_EMAIL_START", v.B2BPasswordResetByEmail = "B2B_PASSWORD_RESET_BY_EMAIL", v.B2BPasswordResetBySession = "B2B_PASSWORD_RESET_BY_SESSION", v.B2BSMSOTPSend = "B2B_SMS_OTP_SEND", v.B2BSMSOTPAuthenticate = "B2B_SMS_OTP_AUTHENTICATE", v.B2BTOTPCreate = "B2B_TOTP_CREATE", v.B2BTOTPAuthenticate = "B2B_TOTP_AUTHENTICATE", v.B2BRecoveryCodesRecover = "B2B_RECOVERY_CODES_RECOVER", exports.RNUIProducts = void 0, (y = exports.RNUIProducts || (exports.RNUIProducts = {}))[y.emailMagicLinks = 0] = "emailMagicLinks", y[y.oauth = 1] = "oauth", y[y.otp = 2] = "otp", y[y.passwords = 3] = "passwords";
|
|
141
141
|
var g,
|
|
142
142
|
b,
|
|
143
143
|
k,
|
|
@@ -156,7 +156,7 @@ var g,
|
|
|
156
156
|
}
|
|
157
157
|
return a(t, c(Error)), r(t);
|
|
158
158
|
}(),
|
|
159
|
-
|
|
159
|
+
C = function (e) {
|
|
160
160
|
function t(e) {
|
|
161
161
|
var r, n;
|
|
162
162
|
i(this, t), (r = s(this, t)).name = "StytchSDKSchemaError";
|
|
@@ -167,7 +167,7 @@ var g,
|
|
|
167
167
|
}
|
|
168
168
|
return a(t, c(Error)), r(t);
|
|
169
169
|
}(),
|
|
170
|
-
|
|
170
|
+
P = function (e) {
|
|
171
171
|
function t(e) {
|
|
172
172
|
var r;
|
|
173
173
|
i(this, t), (r = s(this, t)).name = "StytchSDKAPIError";
|
|
@@ -181,19 +181,19 @@ var g,
|
|
|
181
181
|
return a(t, c(Error)), r(t);
|
|
182
182
|
}(),
|
|
183
183
|
O = ["unauthorized_credentials", "user_unauthenticated", "invalid_secret_authentication", "session_not_found"],
|
|
184
|
-
|
|
184
|
+
T = function (e) {
|
|
185
185
|
function t(e, r) {
|
|
186
186
|
var n;
|
|
187
187
|
return i(this, t), (n = s(this, t, [r])).name = e, n;
|
|
188
188
|
}
|
|
189
189
|
return a(t, c(Error)), r(t);
|
|
190
190
|
}(),
|
|
191
|
-
|
|
191
|
+
A = function (e) {
|
|
192
192
|
function t(e) {
|
|
193
193
|
var r;
|
|
194
194
|
return i(this, t), r = s(this, t, ["StytchAPIUnreachableError", e]), Object.setPrototypeOf(o(r), t.prototype), r;
|
|
195
195
|
}
|
|
196
|
-
return a(t,
|
|
196
|
+
return a(t, T), r(t);
|
|
197
197
|
}(),
|
|
198
198
|
E = function (e) {
|
|
199
199
|
function t(e) {
|
|
@@ -204,7 +204,7 @@ var g,
|
|
|
204
204
|
}).join("\n");
|
|
205
205
|
return s(this, t, ["StytchAPISchemaError", "Request does not match expected schema\n".concat(n)]);
|
|
206
206
|
}
|
|
207
|
-
return a(t,
|
|
207
|
+
return a(t, T), r(t);
|
|
208
208
|
}(),
|
|
209
209
|
D = function (e) {
|
|
210
210
|
function t(e) {
|
|
@@ -217,14 +217,14 @@ var g,
|
|
|
217
217
|
u = e.request_id;
|
|
218
218
|
return (r = s(this, t, ["StytchAPIError", "[".concat(n, "] ").concat(o, "\n") + "".concat(a, "\n") + "See ".concat(c, " for more information.\n") + (u ? "request_id: ".concat(u, "\n") : "")])).error_type = o, r.error_message = a, r.error_url = c, r.request_id = u, r.status_code = n, r;
|
|
219
219
|
}
|
|
220
|
-
return a(t,
|
|
220
|
+
return a(t, T), r(t);
|
|
221
221
|
}(),
|
|
222
222
|
R = function (e) {
|
|
223
223
|
function t(e, r, n) {
|
|
224
224
|
var o;
|
|
225
225
|
return i(this, t), (o = s(this, t, [e, r])).options = n, o;
|
|
226
226
|
}
|
|
227
|
-
return a(t,
|
|
227
|
+
return a(t, T), r(t);
|
|
228
228
|
}(),
|
|
229
229
|
I = function (e) {
|
|
230
230
|
function t() {
|
|
@@ -262,13 +262,13 @@ var g,
|
|
|
262
262
|
}
|
|
263
263
|
return a(t, R), r(t);
|
|
264
264
|
}(),
|
|
265
|
-
|
|
265
|
+
N = function (e) {
|
|
266
266
|
function t() {
|
|
267
267
|
return i(this, t), s(this, t, ["NoBiometricsEnrolledError", "There is no biometric factor enrolled on the device. Add a biometric factor in the device settings."]);
|
|
268
268
|
}
|
|
269
269
|
return a(t, R), r(t);
|
|
270
270
|
}(),
|
|
271
|
-
|
|
271
|
+
U = function (e) {
|
|
272
272
|
function t() {
|
|
273
273
|
return i(this, t), s(this, t, ["UserCancellationError", "The user canceled the prompt. Ask the user to try again."]);
|
|
274
274
|
}
|
|
@@ -413,6 +413,39 @@ var g,
|
|
|
413
413
|
return a(t, R), r(t);
|
|
414
414
|
}();
|
|
415
415
|
function le(e, t) {
|
|
416
|
+
return function (e) {
|
|
417
|
+
if (Array.isArray(e)) return e;
|
|
418
|
+
}(e) || function (e, t) {
|
|
419
|
+
var r = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
|
|
420
|
+
if (null != r) {
|
|
421
|
+
var n,
|
|
422
|
+
i,
|
|
423
|
+
s,
|
|
424
|
+
o,
|
|
425
|
+
a = [],
|
|
426
|
+
c = !0,
|
|
427
|
+
u = !1;
|
|
428
|
+
try {
|
|
429
|
+
if (s = (r = r.call(e)).next, 0 === t) {
|
|
430
|
+
if (Object(r) !== r) return;
|
|
431
|
+
c = !1;
|
|
432
|
+
} else for (; !(c = (n = s.call(r)).done) && (a.push(n.value), a.length !== t); c = !0);
|
|
433
|
+
} catch (e) {
|
|
434
|
+
u = !0, i = e;
|
|
435
|
+
} finally {
|
|
436
|
+
try {
|
|
437
|
+
if (!c && null != r["return"] && (o = r["return"](), Object(o) !== o)) return;
|
|
438
|
+
} finally {
|
|
439
|
+
if (u) throw i;
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
return a;
|
|
443
|
+
}
|
|
444
|
+
}(e, t) || he(e, t) || function () {
|
|
445
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
446
|
+
}();
|
|
447
|
+
}
|
|
448
|
+
function de(e, t) {
|
|
416
449
|
var r = "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
|
|
417
450
|
if (!r) {
|
|
418
451
|
if (Array.isArray(e) || (r = he(e)) || t && e && "number" == typeof e.length) {
|
|
@@ -460,39 +493,6 @@ function le(e, t) {
|
|
|
460
493
|
}
|
|
461
494
|
};
|
|
462
495
|
}
|
|
463
|
-
function de(e, t) {
|
|
464
|
-
return function (e) {
|
|
465
|
-
if (Array.isArray(e)) return e;
|
|
466
|
-
}(e) || function (e, t) {
|
|
467
|
-
var r = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
|
|
468
|
-
if (null != r) {
|
|
469
|
-
var n,
|
|
470
|
-
i,
|
|
471
|
-
s,
|
|
472
|
-
o,
|
|
473
|
-
a = [],
|
|
474
|
-
c = !0,
|
|
475
|
-
u = !1;
|
|
476
|
-
try {
|
|
477
|
-
if (s = (r = r.call(e)).next, 0 === t) {
|
|
478
|
-
if (Object(r) !== r) return;
|
|
479
|
-
c = !1;
|
|
480
|
-
} else for (; !(c = (n = s.call(r)).done) && (a.push(n.value), a.length !== t); c = !0);
|
|
481
|
-
} catch (e) {
|
|
482
|
-
u = !0, i = e;
|
|
483
|
-
} finally {
|
|
484
|
-
try {
|
|
485
|
-
if (!c && null != r["return"] && (o = r["return"](), Object(o) !== o)) return;
|
|
486
|
-
} finally {
|
|
487
|
-
if (u) throw i;
|
|
488
|
-
}
|
|
489
|
-
}
|
|
490
|
-
return a;
|
|
491
|
-
}
|
|
492
|
-
}(e, t) || he(e, t) || function () {
|
|
493
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
494
|
-
}();
|
|
495
|
-
}
|
|
496
496
|
function he(e, t) {
|
|
497
497
|
if (e) {
|
|
498
498
|
if ("string" == typeof e) return pe(e, t);
|
|
@@ -548,7 +548,7 @@ function _e() {
|
|
|
548
548
|
o = Object.create(s.prototype),
|
|
549
549
|
a = new E(n || []);
|
|
550
550
|
return i(o, "_invoke", {
|
|
551
|
-
value:
|
|
551
|
+
value: P(e, r, a)
|
|
552
552
|
}), o;
|
|
553
553
|
}
|
|
554
554
|
function d(e, t, r) {
|
|
@@ -588,7 +588,7 @@ function _e() {
|
|
|
588
588
|
});
|
|
589
589
|
});
|
|
590
590
|
}
|
|
591
|
-
function
|
|
591
|
+
function C(e, t) {
|
|
592
592
|
function r(i, s, o, a) {
|
|
593
593
|
var c = d(e[i], e, s);
|
|
594
594
|
if ("throw" !== c.type) {
|
|
@@ -618,7 +618,7 @@ function _e() {
|
|
|
618
618
|
}
|
|
619
619
|
});
|
|
620
620
|
}
|
|
621
|
-
function
|
|
621
|
+
function P(t, r, n) {
|
|
622
622
|
var i = h;
|
|
623
623
|
return function (s, o) {
|
|
624
624
|
if (i === f) throw new Error("Generator is already running");
|
|
@@ -664,20 +664,20 @@ function _e() {
|
|
|
664
664
|
var o = s.arg;
|
|
665
665
|
return o ? o.done ? (r[t.resultName] = o.value, r.next = t.nextLoc, "return" !== r.method && (r.method = "next", r.arg = e), r.delegate = null, m) : o : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, m);
|
|
666
666
|
}
|
|
667
|
-
function
|
|
667
|
+
function T(e) {
|
|
668
668
|
var t = {
|
|
669
669
|
tryLoc: e[0]
|
|
670
670
|
};
|
|
671
671
|
1 in e && (t.catchLoc = e[1]), 2 in e && (t.finallyLoc = e[2], t.afterLoc = e[3]), this.tryEntries.push(t);
|
|
672
672
|
}
|
|
673
|
-
function
|
|
673
|
+
function A(e) {
|
|
674
674
|
var t = e.completion || {};
|
|
675
675
|
t.type = "normal", delete t.arg, e.completion = t;
|
|
676
676
|
}
|
|
677
677
|
function E(e) {
|
|
678
678
|
this.tryEntries = [{
|
|
679
679
|
tryLoc: "root"
|
|
680
|
-
}], e.forEach(
|
|
680
|
+
}], e.forEach(T, this), this.reset(!0);
|
|
681
681
|
}
|
|
682
682
|
function D(t) {
|
|
683
683
|
if (t || "" === t) {
|
|
@@ -710,11 +710,11 @@ function _e() {
|
|
|
710
710
|
return {
|
|
711
711
|
__await: e
|
|
712
712
|
};
|
|
713
|
-
}, x(
|
|
713
|
+
}, x(C.prototype), u(C.prototype, a, function () {
|
|
714
714
|
return this;
|
|
715
|
-
}), t.AsyncIterator =
|
|
715
|
+
}), t.AsyncIterator = C, t.async = function (e, r, n, i, s) {
|
|
716
716
|
void 0 === s && (s = Promise);
|
|
717
|
-
var o = new
|
|
717
|
+
var o = new C(l(e, r, n, i), s);
|
|
718
718
|
return t.isGeneratorFunction(r) ? o : o.next().then(function (e) {
|
|
719
719
|
return e.done ? e.value : o.next();
|
|
720
720
|
});
|
|
@@ -736,7 +736,7 @@ function _e() {
|
|
|
736
736
|
}, t.values = D, E.prototype = {
|
|
737
737
|
constructor: E,
|
|
738
738
|
reset: function reset(t) {
|
|
739
|
-
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(
|
|
739
|
+
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(A), !t) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = e);
|
|
740
740
|
},
|
|
741
741
|
stop: function stop() {
|
|
742
742
|
this.done = !0;
|
|
@@ -788,7 +788,7 @@ function _e() {
|
|
|
788
788
|
finish: function finish(e) {
|
|
789
789
|
for (var t = this.tryEntries.length - 1; t >= 0; --t) {
|
|
790
790
|
var r = this.tryEntries[t];
|
|
791
|
-
if (r.finallyLoc === e) return this.complete(r.completion, r.afterLoc),
|
|
791
|
+
if (r.finallyLoc === e) return this.complete(r.completion, r.afterLoc), A(r), m;
|
|
792
792
|
}
|
|
793
793
|
},
|
|
794
794
|
"catch": function _catch(e) {
|
|
@@ -798,7 +798,7 @@ function _e() {
|
|
|
798
798
|
var n = r.completion;
|
|
799
799
|
if ("throw" === n.type) {
|
|
800
800
|
var i = n.arg;
|
|
801
|
-
|
|
801
|
+
A(r);
|
|
802
802
|
}
|
|
803
803
|
return i;
|
|
804
804
|
}
|
|
@@ -904,10 +904,10 @@ function xe(e) {
|
|
|
904
904
|
}, xe(e);
|
|
905
905
|
}
|
|
906
906
|
exports.B2BProducts = void 0, (g = exports.B2BProducts || (exports.B2BProducts = {})).emailMagicLinks = "emailMagicLinks", g.sso = "sso", g.passwords = "passwords", g.oauth = "oauth", exports.AuthFlowType = void 0, (b = exports.AuthFlowType || (exports.AuthFlowType = {})).Discovery = "Discovery", b.Organization = "Organization", b.PasswordReset = "PasswordReset", exports.B2BMFAProducts = void 0, (k = exports.B2BMFAProducts || (exports.B2BMFAProducts = {})).smsOtp = "smsOtp", k.totp = "totp", exports.B2BOAuthProviders = void 0, (w = exports.B2BOAuthProviders || (exports.B2BOAuthProviders = {})).Google = "google", w.Microsoft = "microsoft";
|
|
907
|
-
var
|
|
908
|
-
|
|
909
|
-
Oe = "".concat(
|
|
910
|
-
function
|
|
907
|
+
var Ce,
|
|
908
|
+
Pe = "https://accounts.google.com/gsi",
|
|
909
|
+
Oe = "".concat(Pe, "/client");
|
|
910
|
+
function Te(e, t) {
|
|
911
911
|
var r = {};
|
|
912
912
|
for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (r[n] = e[n]);
|
|
913
913
|
if (null != e && "function" == typeof Object.getOwnPropertySymbols) {
|
|
@@ -916,7 +916,7 @@ function Ae(e, t) {
|
|
|
916
916
|
}
|
|
917
917
|
return r;
|
|
918
918
|
}
|
|
919
|
-
function
|
|
919
|
+
function Ae(e, t, r, n) {
|
|
920
920
|
return new (r || (r = Promise))(function (i, s) {
|
|
921
921
|
function o(e) {
|
|
922
922
|
try {
|
|
@@ -943,7 +943,7 @@ function Te(e, t, r, n) {
|
|
|
943
943
|
}
|
|
944
944
|
"function" == typeof SuppressedError && SuppressedError, function (e) {
|
|
945
945
|
e.RequiredCatcha = "Catcha Required";
|
|
946
|
-
}(
|
|
946
|
+
}(Ce || (Ce = {}));
|
|
947
947
|
var Ee,
|
|
948
948
|
De = function (e) {
|
|
949
949
|
function t(e) {
|
|
@@ -971,7 +971,7 @@ function Re(e) {
|
|
|
971
971
|
s = e.xSDKClientHeader,
|
|
972
972
|
o = e.xSDKParentHostHeader,
|
|
973
973
|
a = e.body;
|
|
974
|
-
return
|
|
974
|
+
return Ae(this, void 0, void 0, _e().mark(function e() {
|
|
975
975
|
var c, u, l, d, h, p;
|
|
976
976
|
return _e().wrap(function (e) {
|
|
977
977
|
for (;;) switch (e.prev = e.next) {
|
|
@@ -993,7 +993,7 @@ function Re(e) {
|
|
|
993
993
|
e.next = 13;
|
|
994
994
|
break;
|
|
995
995
|
}
|
|
996
|
-
throw new
|
|
996
|
+
throw new A("Unable to contact the Stytch servers. Are you online?");
|
|
997
997
|
case 13:
|
|
998
998
|
throw e.t0;
|
|
999
999
|
case 14:
|
|
@@ -1005,7 +1005,7 @@ function Re(e) {
|
|
|
1005
1005
|
case 18:
|
|
1006
1006
|
return d = e.sent, e.abrupt("return", d.data);
|
|
1007
1007
|
case 22:
|
|
1008
|
-
throw e.prev = 22, e.t1 = e["catch"](15), new
|
|
1008
|
+
throw e.prev = 22, e.t1 = e["catch"](15), new A("Invalid JSON response from the Stytch servers.");
|
|
1009
1009
|
case 25:
|
|
1010
1010
|
if (200 === l.status || !(null === (t = l.headers.get("content-type")) || void 0 === t ? void 0 : t.includes("application/json"))) {
|
|
1011
1011
|
e.next = 38;
|
|
@@ -1016,7 +1016,7 @@ function Re(e) {
|
|
|
1016
1016
|
h = e.sent, e.next = 35;
|
|
1017
1017
|
break;
|
|
1018
1018
|
case 32:
|
|
1019
|
-
throw e.prev = 32, e.t2 = e["catch"](26), new
|
|
1019
|
+
throw e.prev = 32, e.t2 = e["catch"](26), new A("Invalid or no response from server");
|
|
1020
1020
|
case 35:
|
|
1021
1021
|
if (!("body" in h || "params" in h || "query" in h)) {
|
|
1022
1022
|
e.next = 37;
|
|
@@ -1031,15 +1031,15 @@ function Re(e) {
|
|
|
1031
1031
|
p = e.sent, e.next = 47;
|
|
1032
1032
|
break;
|
|
1033
1033
|
case 44:
|
|
1034
|
-
throw e.prev = 44, e.t3 = e["catch"](38), new
|
|
1034
|
+
throw e.prev = 44, e.t3 = e["catch"](38), new A("Invalid response from the Stytch servers.");
|
|
1035
1035
|
case 47:
|
|
1036
1036
|
if (!p.includes("Captcha required")) {
|
|
1037
1037
|
e.next = 49;
|
|
1038
1038
|
break;
|
|
1039
1039
|
}
|
|
1040
|
-
throw new De(
|
|
1040
|
+
throw new De(Ce.RequiredCatcha);
|
|
1041
1041
|
case 49:
|
|
1042
|
-
throw new
|
|
1042
|
+
throw new A("Invalid response from the Stytch servers.");
|
|
1043
1043
|
case 50:
|
|
1044
1044
|
case "end":
|
|
1045
1045
|
return e.stop();
|
|
@@ -1062,7 +1062,7 @@ function Me(e) {
|
|
|
1062
1062
|
}(r)) throw TypeError("Stringified UUID is invalid");
|
|
1063
1063
|
return r;
|
|
1064
1064
|
}
|
|
1065
|
-
function
|
|
1065
|
+
function Ne(e, t, r) {
|
|
1066
1066
|
var n = (e = e || {}).random || (e.rng || Fe)();
|
|
1067
1067
|
if (n[6] = 15 & n[6] | 64, n[8] = 63 & n[8] | 128, t) {
|
|
1068
1068
|
r = r || 0;
|
|
@@ -1071,19 +1071,19 @@ function Ue(e, t, r) {
|
|
|
1071
1071
|
}
|
|
1072
1072
|
return Me(n);
|
|
1073
1073
|
}
|
|
1074
|
-
var
|
|
1074
|
+
var Ue = {};
|
|
1075
1075
|
function Ke(e, t) {
|
|
1076
|
-
return
|
|
1076
|
+
return Ae(this, void 0, void 0, _e().mark(function r() {
|
|
1077
1077
|
return _e().wrap(function (r) {
|
|
1078
1078
|
for (;;) switch (r.prev = r.next) {
|
|
1079
1079
|
case 0:
|
|
1080
|
-
if (void 0 ===
|
|
1080
|
+
if (void 0 === Ue[e]) {
|
|
1081
1081
|
r.next = 2;
|
|
1082
1082
|
break;
|
|
1083
1083
|
}
|
|
1084
|
-
return r.abrupt("return",
|
|
1084
|
+
return r.abrupt("return", Ue[e]);
|
|
1085
1085
|
case 2:
|
|
1086
|
-
return
|
|
1086
|
+
return Ue[e] = qe(e, t), r.abrupt("return", Ue[e]);
|
|
1087
1087
|
case 4:
|
|
1088
1088
|
case "end":
|
|
1089
1089
|
return r.stop();
|
|
@@ -1152,7 +1152,7 @@ var Ge,
|
|
|
1152
1152
|
isStringArray: function isStringArray(r, n) {
|
|
1153
1153
|
if (!Array.isArray(n)) throw new x(e, r + " must be an array of strings.");
|
|
1154
1154
|
var i,
|
|
1155
|
-
s =
|
|
1155
|
+
s = de(n);
|
|
1156
1156
|
try {
|
|
1157
1157
|
for (s.s(); !(i = s.n()).done;) {
|
|
1158
1158
|
if ("string" != typeof i.value) throw new x(e, r + " must be an array of strings.");
|
|
@@ -1185,10 +1185,10 @@ var Ge,
|
|
|
1185
1185
|
return t;
|
|
1186
1186
|
},
|
|
1187
1187
|
$e = function $e(e) {
|
|
1188
|
-
return
|
|
1188
|
+
return Te(e, ["request_id", "status_code"]);
|
|
1189
1189
|
},
|
|
1190
1190
|
Xe = function Xe(e) {
|
|
1191
|
-
return
|
|
1191
|
+
return Te(e, ["__user"]);
|
|
1192
1192
|
},
|
|
1193
1193
|
Ze = ve(function e(t, r, n) {
|
|
1194
1194
|
var i = this,
|
|
@@ -1196,7 +1196,7 @@ var Ge,
|
|
|
1196
1196
|
return Promise.resolve(void 0);
|
|
1197
1197
|
};
|
|
1198
1198
|
ge(this, e), this.bootstrapPromise = n, this.isEnabled = function () {
|
|
1199
|
-
return
|
|
1199
|
+
return Ae(i, void 0, void 0, _e().mark(function e() {
|
|
1200
1200
|
return _e().wrap(function (e) {
|
|
1201
1201
|
for (;;) switch (e.prev = e.next) {
|
|
1202
1202
|
case 0:
|
|
@@ -1210,7 +1210,7 @@ var Ge,
|
|
|
1210
1210
|
}, e, this);
|
|
1211
1211
|
}));
|
|
1212
1212
|
}, this.getTelemetryID = function () {
|
|
1213
|
-
return
|
|
1213
|
+
return Ae(i, void 0, void 0, _e().mark(function e() {
|
|
1214
1214
|
var t, r, n, i;
|
|
1215
1215
|
return _e().wrap(function (e) {
|
|
1216
1216
|
for (;;) switch (e.prev = e.next) {
|
|
@@ -1233,7 +1233,7 @@ var Ge,
|
|
|
1233
1233
|
}, e, this);
|
|
1234
1234
|
}));
|
|
1235
1235
|
}, this.getDFPTelemetryIDAndCaptcha = function () {
|
|
1236
|
-
return
|
|
1236
|
+
return Ae(i, void 0, void 0, _e().mark(function e() {
|
|
1237
1237
|
var t, r, n, i, s, o;
|
|
1238
1238
|
return _e().wrap(function (e) {
|
|
1239
1239
|
for (;;) switch (e.prev = e.next) {
|
|
@@ -1278,14 +1278,14 @@ var Ge,
|
|
|
1278
1278
|
}, e, this);
|
|
1279
1279
|
}));
|
|
1280
1280
|
}, this.retryWithCaptchaAndDFP = function (e, t) {
|
|
1281
|
-
return
|
|
1281
|
+
return Ae(i, void 0, void 0, _e().mark(function r() {
|
|
1282
1282
|
var n, i, s;
|
|
1283
1283
|
return _e().wrap(function (r) {
|
|
1284
1284
|
for (;;) switch (r.prev = r.next) {
|
|
1285
1285
|
case 0:
|
|
1286
1286
|
return r.next = 2, this.state;
|
|
1287
1287
|
case 2:
|
|
1288
|
-
if (n = r.sent, i = n.enabled, s = n.executeRecaptcha, e.type !==
|
|
1288
|
+
if (n = r.sent, i = n.enabled, s = n.executeRecaptcha, e.type !== Ce.RequiredCatcha || !i) {
|
|
1289
1289
|
r.next = 14;
|
|
1290
1290
|
break;
|
|
1291
1291
|
}
|
|
@@ -1309,7 +1309,7 @@ var Ge,
|
|
|
1309
1309
|
}, r, this);
|
|
1310
1310
|
}));
|
|
1311
1311
|
}, this.state = n.then(function (e) {
|
|
1312
|
-
return
|
|
1312
|
+
return Ae(i, void 0, void 0, _e().mark(function n() {
|
|
1313
1313
|
return _e().wrap(function (n) {
|
|
1314
1314
|
for (;;) switch (n.prev = n.next) {
|
|
1315
1315
|
case 0:
|
|
@@ -1348,7 +1348,7 @@ var Ge,
|
|
|
1348
1348
|
Qe = function Qe() {
|
|
1349
1349
|
return {
|
|
1350
1350
|
isEnabled: function isEnabled() {
|
|
1351
|
-
return
|
|
1351
|
+
return Ae(void 0, void 0, void 0, _e().mark(function e() {
|
|
1352
1352
|
return _e().wrap(function (e) {
|
|
1353
1353
|
for (;;) switch (e.prev = e.next) {
|
|
1354
1354
|
case 0:
|
|
@@ -1361,7 +1361,7 @@ var Ge,
|
|
|
1361
1361
|
}));
|
|
1362
1362
|
},
|
|
1363
1363
|
getTelemetryID: function getTelemetryID() {
|
|
1364
|
-
return
|
|
1364
|
+
return Ae(void 0, void 0, void 0, _e().mark(function e() {
|
|
1365
1365
|
return _e().wrap(function (e) {
|
|
1366
1366
|
for (;;) switch (e.prev = e.next) {
|
|
1367
1367
|
case 0:
|
|
@@ -1374,7 +1374,7 @@ var Ge,
|
|
|
1374
1374
|
}));
|
|
1375
1375
|
},
|
|
1376
1376
|
getDFPTelemetryIDAndCaptcha: function getDFPTelemetryIDAndCaptcha() {
|
|
1377
|
-
return
|
|
1377
|
+
return Ae(void 0, void 0, void 0, _e().mark(function e() {
|
|
1378
1378
|
return _e().wrap(function (e) {
|
|
1379
1379
|
for (;;) switch (e.prev = e.next) {
|
|
1380
1380
|
case 0:
|
|
@@ -1390,7 +1390,7 @@ var Ge,
|
|
|
1390
1390
|
}));
|
|
1391
1391
|
},
|
|
1392
1392
|
retryWithCaptchaAndDFP: function retryWithCaptchaAndDFP() {
|
|
1393
|
-
return
|
|
1393
|
+
return Ae(void 0, void 0, void 0, _e().mark(function e() {
|
|
1394
1394
|
return _e().wrap(function (e) {
|
|
1395
1395
|
for (;;) switch (e.prev = e.next) {
|
|
1396
1396
|
case 0:
|
|
@@ -1430,13 +1430,13 @@ var Ge,
|
|
|
1430
1430
|
case "SDKAPIUnreachableError":
|
|
1431
1431
|
return e.inflate(S, t);
|
|
1432
1432
|
case "StytchSDKSchemaError":
|
|
1433
|
-
return e.inflate(
|
|
1433
|
+
return e.inflate(C, t);
|
|
1434
1434
|
case "StytchAPIUnreachableError":
|
|
1435
|
-
return e.inflate(
|
|
1435
|
+
return e.inflate(A, t);
|
|
1436
1436
|
case "StytchAPISchemaError":
|
|
1437
1437
|
return e.inflate(E, t);
|
|
1438
1438
|
case "StytchSDKAPIError":
|
|
1439
|
-
return e.inflate(
|
|
1439
|
+
return e.inflate(P, t);
|
|
1440
1440
|
case "StytchAPIError":
|
|
1441
1441
|
return e.inflate(D, t);
|
|
1442
1442
|
case "TypeError":
|
|
@@ -1471,7 +1471,7 @@ var Ge,
|
|
|
1471
1471
|
}, {
|
|
1472
1472
|
key: "flush",
|
|
1473
1473
|
value: function value() {
|
|
1474
|
-
return
|
|
1474
|
+
return Ae(this, void 0, void 0, _e().mark(function e() {
|
|
1475
1475
|
var t;
|
|
1476
1476
|
return _e().wrap(function (e) {
|
|
1477
1477
|
for (;;) switch (e.prev = e.next) {
|
|
@@ -1509,7 +1509,7 @@ var Ge,
|
|
|
1509
1509
|
var rt = ve(function e(t, r) {
|
|
1510
1510
|
var n = this;
|
|
1511
1511
|
ge(this, e), this._networkClient = t, this._subscriptionService = r, this.get = function () {
|
|
1512
|
-
return
|
|
1512
|
+
return Ae(n, void 0, void 0, _e().mark(function e() {
|
|
1513
1513
|
var t, r;
|
|
1514
1514
|
return _e().wrap(function (e) {
|
|
1515
1515
|
for (;;) switch (e.prev = e.next) {
|
|
@@ -1529,8 +1529,13 @@ var rt = ve(function e(t, r) {
|
|
|
1529
1529
|
}));
|
|
1530
1530
|
}, this.getSync = function () {
|
|
1531
1531
|
return n._subscriptionService.getUser();
|
|
1532
|
+
}, this.getInfo = function () {
|
|
1533
|
+
return {
|
|
1534
|
+
user: n.getSync(),
|
|
1535
|
+
fromCache: n._subscriptionService.getFromCache()
|
|
1536
|
+
};
|
|
1532
1537
|
}, this.update = function (e) {
|
|
1533
|
-
return
|
|
1538
|
+
return Ae(n, void 0, void 0, _e().mark(function t() {
|
|
1534
1539
|
var r, n;
|
|
1535
1540
|
return _e().wrap(function (t) {
|
|
1536
1541
|
for (;;) switch (t.prev = t.next) {
|
|
@@ -1550,7 +1555,7 @@ var rt = ve(function e(t, r) {
|
|
|
1550
1555
|
}, t, this);
|
|
1551
1556
|
}));
|
|
1552
1557
|
}, this.deleteEmail = function (e) {
|
|
1553
|
-
return
|
|
1558
|
+
return Ae(n, void 0, void 0, _e().mark(function t() {
|
|
1554
1559
|
var r, n;
|
|
1555
1560
|
return _e().wrap(function (t) {
|
|
1556
1561
|
for (;;) switch (t.prev = t.next) {
|
|
@@ -1569,7 +1574,7 @@ var rt = ve(function e(t, r) {
|
|
|
1569
1574
|
}, t, this);
|
|
1570
1575
|
}));
|
|
1571
1576
|
}, this.deletePhoneNumber = function (e) {
|
|
1572
|
-
return
|
|
1577
|
+
return Ae(n, void 0, void 0, _e().mark(function t() {
|
|
1573
1578
|
var r, n;
|
|
1574
1579
|
return _e().wrap(function (t) {
|
|
1575
1580
|
for (;;) switch (t.prev = t.next) {
|
|
@@ -1588,7 +1593,7 @@ var rt = ve(function e(t, r) {
|
|
|
1588
1593
|
}, t, this);
|
|
1589
1594
|
}));
|
|
1590
1595
|
}, this.deleteTOTP = function (e) {
|
|
1591
|
-
return
|
|
1596
|
+
return Ae(n, void 0, void 0, _e().mark(function t() {
|
|
1592
1597
|
var r, n;
|
|
1593
1598
|
return _e().wrap(function (t) {
|
|
1594
1599
|
for (;;) switch (t.prev = t.next) {
|
|
@@ -1607,7 +1612,7 @@ var rt = ve(function e(t, r) {
|
|
|
1607
1612
|
}, t, this);
|
|
1608
1613
|
}));
|
|
1609
1614
|
}, this.deleteOAuthRegistration = function (e) {
|
|
1610
|
-
return
|
|
1615
|
+
return Ae(n, void 0, void 0, _e().mark(function t() {
|
|
1611
1616
|
var r, n;
|
|
1612
1617
|
return _e().wrap(function (t) {
|
|
1613
1618
|
for (;;) switch (t.prev = t.next) {
|
|
@@ -1626,7 +1631,7 @@ var rt = ve(function e(t, r) {
|
|
|
1626
1631
|
}, t, this);
|
|
1627
1632
|
}));
|
|
1628
1633
|
}, this.deleteWebauthnRegistration = function (e) {
|
|
1629
|
-
return
|
|
1634
|
+
return Ae(n, void 0, void 0, _e().mark(function t() {
|
|
1630
1635
|
var r, n;
|
|
1631
1636
|
return _e().wrap(function (t) {
|
|
1632
1637
|
for (;;) switch (t.prev = t.next) {
|
|
@@ -1645,7 +1650,7 @@ var rt = ve(function e(t, r) {
|
|
|
1645
1650
|
}, t, this);
|
|
1646
1651
|
}));
|
|
1647
1652
|
}, this.deleteBiometricRegistration = function (e) {
|
|
1648
|
-
return
|
|
1653
|
+
return Ae(n, void 0, void 0, _e().mark(function t() {
|
|
1649
1654
|
var r, n;
|
|
1650
1655
|
return _e().wrap(function (t) {
|
|
1651
1656
|
for (;;) switch (t.prev = t.next) {
|
|
@@ -1676,6 +1681,11 @@ var rt = ve(function e(t, r) {
|
|
|
1676
1681
|
var n = this;
|
|
1677
1682
|
ge(this, e), this._networkClient = t, this._subscriptionService = r, this.getSync = function () {
|
|
1678
1683
|
return n._subscriptionService.getSession();
|
|
1684
|
+
}, this.getInfo = function () {
|
|
1685
|
+
return {
|
|
1686
|
+
session: n.getSync(),
|
|
1687
|
+
fromCache: n._subscriptionService.getFromCache()
|
|
1688
|
+
};
|
|
1679
1689
|
}, this.onChange = function (e) {
|
|
1680
1690
|
var t = n._subscriptionService.getSession();
|
|
1681
1691
|
return n._subscriptionService.subscribeToState(function (r) {
|
|
@@ -1683,7 +1693,7 @@ var rt = ve(function e(t, r) {
|
|
|
1683
1693
|
(null == r ? void 0 : r.session) !== t && (t = null !== (n = null == r ? void 0 : r.session) && void 0 !== n ? n : null, e(t));
|
|
1684
1694
|
});
|
|
1685
1695
|
}, this.revoke = function (e) {
|
|
1686
|
-
return
|
|
1696
|
+
return Ae(n, void 0, void 0, _e().mark(function t() {
|
|
1687
1697
|
var r;
|
|
1688
1698
|
return _e().wrap(function (t) {
|
|
1689
1699
|
for (;;) switch (t.prev = t.next) {
|
|
@@ -1704,7 +1714,7 @@ var rt = ve(function e(t, r) {
|
|
|
1704
1714
|
}, t, this, [[0, 8]]);
|
|
1705
1715
|
}));
|
|
1706
1716
|
}, this.authenticate = function (e) {
|
|
1707
|
-
return
|
|
1717
|
+
return Ae(n, void 0, void 0, _e().mark(function t() {
|
|
1708
1718
|
var r,
|
|
1709
1719
|
n,
|
|
1710
1720
|
i,
|
|
@@ -1779,7 +1789,7 @@ var rt = ve(function e(t, r) {
|
|
|
1779
1789
|
ge(this, e), this._networkClient = t, this._subscriptionService = r, this._pkceManager = n, this._passwordResetPKCEManager = i, this._config = o, this.dfpProtectedAuth = a, this.email = {
|
|
1780
1790
|
loginOrCreate: function loginOrCreate(e) {
|
|
1781
1791
|
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
|
|
1782
|
-
return
|
|
1792
|
+
return Ae(s, void 0, void 0, _e().mark(function r() {
|
|
1783
1793
|
var n, i, s, o, a, c, u;
|
|
1784
1794
|
return _e().wrap(function (r) {
|
|
1785
1795
|
for (;;) switch (r.prev = r.next) {
|
|
@@ -1817,7 +1827,7 @@ var rt = ve(function e(t, r) {
|
|
|
1817
1827
|
},
|
|
1818
1828
|
send: function send(e) {
|
|
1819
1829
|
var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
|
|
1820
|
-
return
|
|
1830
|
+
return Ae(s, void 0, void 0, _e().mark(function r() {
|
|
1821
1831
|
var n, i, s, o, a, c, u, l, d;
|
|
1822
1832
|
return _e().wrap(function (r) {
|
|
1823
1833
|
for (;;) switch (r.prev = r.next) {
|
|
@@ -1854,7 +1864,7 @@ var rt = ve(function e(t, r) {
|
|
|
1854
1864
|
}));
|
|
1855
1865
|
}
|
|
1856
1866
|
}, this.authenticate = function (e, t) {
|
|
1857
|
-
return
|
|
1867
|
+
return Ae(s, void 0, void 0, _e().mark(function r() {
|
|
1858
1868
|
var n, i;
|
|
1859
1869
|
return _e().wrap(function (r) {
|
|
1860
1870
|
for (;;) switch (r.prev = r.next) {
|
|
@@ -1911,7 +1921,7 @@ var rt = ve(function e(t, r) {
|
|
|
1911
1921
|
return ve(e, [{
|
|
1912
1922
|
key: "getCodeChallenge",
|
|
1913
1923
|
value: function value() {
|
|
1914
|
-
return
|
|
1924
|
+
return Ae(this, void 0, void 0, _e().mark(function e() {
|
|
1915
1925
|
var t;
|
|
1916
1926
|
return _e().wrap(function (e) {
|
|
1917
1927
|
for (;;) switch (e.prev = e.next) {
|
|
@@ -1937,7 +1947,7 @@ var rt = ve(function e(t, r) {
|
|
|
1937
1947
|
}, {
|
|
1938
1948
|
key: "handlePKCEForAuthenticate",
|
|
1939
1949
|
value: function value(e, t) {
|
|
1940
|
-
return
|
|
1950
|
+
return Ae(this, void 0, void 0, _e().mark(function r() {
|
|
1941
1951
|
var n, i, s;
|
|
1942
1952
|
return _e().wrap(function (r) {
|
|
1943
1953
|
for (;;) switch (r.prev = r.next) {
|
|
@@ -1971,7 +1981,7 @@ var rt = ve(function e(t, r) {
|
|
|
1971
1981
|
s = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : Qe();
|
|
1972
1982
|
ge(this, e), this._networkClient = t, this._subscriptionService = r, this.executeRecaptcha = i, this.dfpProtectedAuth = s, this.sms = {
|
|
1973
1983
|
loginOrCreate: function loginOrCreate(e, t) {
|
|
1974
|
-
return
|
|
1984
|
+
return Ae(n, void 0, void 0, _e().mark(function r() {
|
|
1975
1985
|
var n, i, s, o;
|
|
1976
1986
|
return _e().wrap(function (r) {
|
|
1977
1987
|
for (;;) switch (r.prev = r.next) {
|
|
@@ -1997,7 +2007,7 @@ var rt = ve(function e(t, r) {
|
|
|
1997
2007
|
}));
|
|
1998
2008
|
},
|
|
1999
2009
|
send: function send(e, t) {
|
|
2000
|
-
return
|
|
2010
|
+
return Ae(n, void 0, void 0, _e().mark(function r() {
|
|
2001
2011
|
var n, i, s, o, a, c;
|
|
2002
2012
|
return _e().wrap(function (r) {
|
|
2003
2013
|
for (;;) switch (r.prev = r.next) {
|
|
@@ -2024,7 +2034,7 @@ var rt = ve(function e(t, r) {
|
|
|
2024
2034
|
}
|
|
2025
2035
|
}, this.whatsapp = {
|
|
2026
2036
|
loginOrCreate: function loginOrCreate(e, t) {
|
|
2027
|
-
return
|
|
2037
|
+
return Ae(n, void 0, void 0, _e().mark(function r() {
|
|
2028
2038
|
var n, i, s, o;
|
|
2029
2039
|
return _e().wrap(function (r) {
|
|
2030
2040
|
for (;;) switch (r.prev = r.next) {
|
|
@@ -2050,7 +2060,7 @@ var rt = ve(function e(t, r) {
|
|
|
2050
2060
|
}));
|
|
2051
2061
|
},
|
|
2052
2062
|
send: function send(e, t) {
|
|
2053
|
-
return
|
|
2063
|
+
return Ae(n, void 0, void 0, _e().mark(function r() {
|
|
2054
2064
|
var n, i, s, o, a, c;
|
|
2055
2065
|
return _e().wrap(function (r) {
|
|
2056
2066
|
for (;;) switch (r.prev = r.next) {
|
|
@@ -2077,7 +2087,7 @@ var rt = ve(function e(t, r) {
|
|
|
2077
2087
|
}
|
|
2078
2088
|
}, this.email = {
|
|
2079
2089
|
loginOrCreate: function loginOrCreate(e, t) {
|
|
2080
|
-
return
|
|
2090
|
+
return Ae(n, void 0, void 0, _e().mark(function r() {
|
|
2081
2091
|
var n, i;
|
|
2082
2092
|
return _e().wrap(function (r) {
|
|
2083
2093
|
for (;;) switch (r.prev = r.next) {
|
|
@@ -2101,7 +2111,7 @@ var rt = ve(function e(t, r) {
|
|
|
2101
2111
|
}));
|
|
2102
2112
|
},
|
|
2103
2113
|
send: function send(e, t) {
|
|
2104
|
-
return
|
|
2114
|
+
return Ae(n, void 0, void 0, _e().mark(function r() {
|
|
2105
2115
|
var n, i, s, o;
|
|
2106
2116
|
return _e().wrap(function (r) {
|
|
2107
2117
|
for (;;) switch (r.prev = r.next) {
|
|
@@ -2125,7 +2135,7 @@ var rt = ve(function e(t, r) {
|
|
|
2125
2135
|
}));
|
|
2126
2136
|
}
|
|
2127
2137
|
}, this.authenticate = function (e, t, r) {
|
|
2128
|
-
return
|
|
2138
|
+
return Ae(n, void 0, void 0, _e().mark(function n() {
|
|
2129
2139
|
var i, s, o, a, c;
|
|
2130
2140
|
return _e().wrap(function (n) {
|
|
2131
2141
|
for (;;) switch (n.prev = n.next) {
|
|
@@ -2207,7 +2217,7 @@ var rt = ve(function e(t, r) {
|
|
|
2207
2217
|
return ve(e, [{
|
|
2208
2218
|
key: "authenticate",
|
|
2209
2219
|
value: function value(e, t) {
|
|
2210
|
-
return
|
|
2220
|
+
return Ae(this, void 0, void 0, _e().mark(function r() {
|
|
2211
2221
|
var n, i;
|
|
2212
2222
|
return _e().wrap(function (r) {
|
|
2213
2223
|
for (;;) switch (r.prev = r.next) {
|
|
@@ -2243,7 +2253,7 @@ var rt = ve(function e(t, r) {
|
|
|
2243
2253
|
}, {
|
|
2244
2254
|
key: "getBaseApiUrl",
|
|
2245
2255
|
value: function value() {
|
|
2246
|
-
return
|
|
2256
|
+
return Ae(this, void 0, void 0, _e().mark(function e() {
|
|
2247
2257
|
var t, r;
|
|
2248
2258
|
return _e().wrap(function (e) {
|
|
2249
2259
|
for (;;) switch (e.prev = e.next) {
|
|
@@ -2280,7 +2290,7 @@ var rt = ve(function e(t, r) {
|
|
|
2280
2290
|
i = r.signup_redirect_url,
|
|
2281
2291
|
s = r.custom_scopes,
|
|
2282
2292
|
o = r.provider_params;
|
|
2283
|
-
return
|
|
2293
|
+
return Ae(t, void 0, void 0, _e().mark(function t() {
|
|
2284
2294
|
var r, a, c, u, l, d, h;
|
|
2285
2295
|
return _e().wrap(function (t) {
|
|
2286
2296
|
for (;;) switch (t.prev = t.next) {
|
|
@@ -2332,7 +2342,7 @@ var rt = ve(function e(t, r) {
|
|
|
2332
2342
|
return ve(e, [{
|
|
2333
2343
|
key: "authenticateStart",
|
|
2334
2344
|
value: function value(e) {
|
|
2335
|
-
return
|
|
2345
|
+
return Ae(this, void 0, void 0, _e().mark(function t() {
|
|
2336
2346
|
var r, n, i;
|
|
2337
2347
|
return _e().wrap(function (t) {
|
|
2338
2348
|
for (;;) switch (t.prev = t.next) {
|
|
@@ -2359,7 +2369,7 @@ var rt = ve(function e(t, r) {
|
|
|
2359
2369
|
}, {
|
|
2360
2370
|
key: "authenticate",
|
|
2361
2371
|
value: function value(e) {
|
|
2362
|
-
return
|
|
2372
|
+
return Ae(this, void 0, void 0, _e().mark(function t() {
|
|
2363
2373
|
var r, n, i, s;
|
|
2364
2374
|
return _e().wrap(function (t) {
|
|
2365
2375
|
for (;;) switch (t.prev = t.next) {
|
|
@@ -2406,7 +2416,7 @@ var rt = ve(function e(t, r) {
|
|
|
2406
2416
|
return ve(e, [{
|
|
2407
2417
|
key: "create",
|
|
2408
2418
|
value: function value(e) {
|
|
2409
|
-
return
|
|
2419
|
+
return Ae(this, void 0, void 0, _e().mark(function t() {
|
|
2410
2420
|
var r;
|
|
2411
2421
|
return _e().wrap(function (t) {
|
|
2412
2422
|
for (;;) switch (t.prev = t.next) {
|
|
@@ -2431,7 +2441,7 @@ var rt = ve(function e(t, r) {
|
|
|
2431
2441
|
}, {
|
|
2432
2442
|
key: "authenticate",
|
|
2433
2443
|
value: function value(e) {
|
|
2434
|
-
return
|
|
2444
|
+
return Ae(this, void 0, void 0, _e().mark(function t() {
|
|
2435
2445
|
var r, n, i, s;
|
|
2436
2446
|
return _e().wrap(function (t) {
|
|
2437
2447
|
for (;;) switch (t.prev = t.next) {
|
|
@@ -2470,7 +2480,7 @@ var rt = ve(function e(t, r) {
|
|
|
2470
2480
|
}, {
|
|
2471
2481
|
key: "recoveryCodes",
|
|
2472
2482
|
value: function value() {
|
|
2473
|
-
return
|
|
2483
|
+
return Ae(this, void 0, void 0, _e().mark(function e() {
|
|
2474
2484
|
return _e().wrap(function (e) {
|
|
2475
2485
|
for (;;) switch (e.prev = e.next) {
|
|
2476
2486
|
case 0:
|
|
@@ -2489,7 +2499,7 @@ var rt = ve(function e(t, r) {
|
|
|
2489
2499
|
}, {
|
|
2490
2500
|
key: "recover",
|
|
2491
2501
|
value: function value(e) {
|
|
2492
|
-
return
|
|
2502
|
+
return Ae(this, void 0, void 0, _e().mark(function t() {
|
|
2493
2503
|
var r, n, i, s;
|
|
2494
2504
|
return _e().wrap(function (t) {
|
|
2495
2505
|
for (;;) switch (t.prev = t.next) {
|
|
@@ -2534,7 +2544,7 @@ function lt(e) {
|
|
|
2534
2544
|
function dt(e) {
|
|
2535
2545
|
var t,
|
|
2536
2546
|
r = "",
|
|
2537
|
-
n =
|
|
2547
|
+
n = de(new Uint8Array(e));
|
|
2538
2548
|
try {
|
|
2539
2549
|
for (n.s(); !(t = n.n()).done;) {
|
|
2540
2550
|
var i = t.value;
|
|
@@ -2557,7 +2567,7 @@ function ft(e, t, r) {
|
|
|
2557
2567
|
});
|
|
2558
2568
|
if (t instanceof Object) {
|
|
2559
2569
|
for (var n = {}, i = 0, s = Object.entries(t); i < s.length; i++) {
|
|
2560
|
-
var o =
|
|
2570
|
+
var o = le(s[i], 2),
|
|
2561
2571
|
a = o[0],
|
|
2562
2572
|
c = o[1];
|
|
2563
2573
|
if (c.derive) {
|
|
@@ -2665,21 +2675,21 @@ var yt = {
|
|
|
2665
2675
|
return e.getClientExtensionResults();
|
|
2666
2676
|
})
|
|
2667
2677
|
};
|
|
2668
|
-
function
|
|
2678
|
+
function Ct(e) {
|
|
2669
2679
|
return ft(lt, kt, e);
|
|
2670
2680
|
}
|
|
2671
|
-
function
|
|
2681
|
+
function Pt(e) {
|
|
2672
2682
|
return ft(dt, wt, e);
|
|
2673
2683
|
}
|
|
2674
2684
|
function Ot(e) {
|
|
2675
|
-
return
|
|
2685
|
+
return Ae(this, void 0, void 0, _e().mark(function t() {
|
|
2676
2686
|
var r;
|
|
2677
2687
|
return _e().wrap(function (t) {
|
|
2678
2688
|
for (;;) switch (t.prev = t.next) {
|
|
2679
2689
|
case 0:
|
|
2680
|
-
return t.next = 2, navigator.credentials.create(
|
|
2690
|
+
return t.next = 2, navigator.credentials.create(Ct(e));
|
|
2681
2691
|
case 2:
|
|
2682
|
-
return r = t.sent, t.abrupt("return",
|
|
2692
|
+
return r = t.sent, t.abrupt("return", Pt(r));
|
|
2683
2693
|
case 4:
|
|
2684
2694
|
case "end":
|
|
2685
2695
|
return t.stop();
|
|
@@ -2687,21 +2697,21 @@ function Ot(e) {
|
|
|
2687
2697
|
}, t);
|
|
2688
2698
|
}));
|
|
2689
2699
|
}
|
|
2690
|
-
function
|
|
2700
|
+
function Tt(e) {
|
|
2691
2701
|
return ft(lt, St, e);
|
|
2692
2702
|
}
|
|
2693
|
-
function
|
|
2703
|
+
function At(e) {
|
|
2694
2704
|
return ft(dt, xt, e);
|
|
2695
2705
|
}
|
|
2696
2706
|
function Et(e) {
|
|
2697
|
-
return
|
|
2707
|
+
return Ae(this, void 0, void 0, _e().mark(function t() {
|
|
2698
2708
|
var r;
|
|
2699
2709
|
return _e().wrap(function (t) {
|
|
2700
2710
|
for (;;) switch (t.prev = t.next) {
|
|
2701
2711
|
case 0:
|
|
2702
|
-
return t.next = 2, navigator.credentials.get(
|
|
2712
|
+
return t.next = 2, navigator.credentials.get(Tt(e));
|
|
2703
2713
|
case 2:
|
|
2704
|
-
return r = t.sent, t.abrupt("return",
|
|
2714
|
+
return r = t.sent, t.abrupt("return", At(r));
|
|
2705
2715
|
case 4:
|
|
2706
2716
|
case "end":
|
|
2707
2717
|
return t.stop();
|
|
@@ -2719,7 +2729,7 @@ var Dt = function () {
|
|
|
2719
2729
|
key: "register",
|
|
2720
2730
|
value: function value(e) {
|
|
2721
2731
|
var t, r;
|
|
2722
|
-
return
|
|
2732
|
+
return Ae(this, void 0, void 0, _e().mark(function n() {
|
|
2723
2733
|
var i, s, o, a, c;
|
|
2724
2734
|
return _e().wrap(function (n) {
|
|
2725
2735
|
for (;;) switch (n.prev = n.next) {
|
|
@@ -2770,7 +2780,7 @@ var Dt = function () {
|
|
|
2770
2780
|
key: "authenticate",
|
|
2771
2781
|
value: function value(e) {
|
|
2772
2782
|
var t, r;
|
|
2773
|
-
return
|
|
2783
|
+
return Ae(this, void 0, void 0, _e().mark(function n() {
|
|
2774
2784
|
var i, s, o, a, c, u, l, d, h, p, f, _;
|
|
2775
2785
|
return _e().wrap(function (n) {
|
|
2776
2786
|
for (;;) switch (n.prev = n.next) {
|
|
@@ -2844,7 +2854,7 @@ var Dt = function () {
|
|
|
2844
2854
|
}, {
|
|
2845
2855
|
key: "update",
|
|
2846
2856
|
value: function value(e) {
|
|
2847
|
-
return
|
|
2857
|
+
return Ae(this, void 0, void 0, _e().mark(function t() {
|
|
2848
2858
|
var r;
|
|
2849
2859
|
return _e().wrap(function (t) {
|
|
2850
2860
|
for (;;) switch (t.prev = t.next) {
|
|
@@ -2869,7 +2879,7 @@ var Dt = function () {
|
|
|
2869
2879
|
}, {
|
|
2870
2880
|
key: "browserSupportsAutofill",
|
|
2871
2881
|
value: function value() {
|
|
2872
|
-
return
|
|
2882
|
+
return Ae(this, void 0, void 0, _e().mark(function e() {
|
|
2873
2883
|
var t;
|
|
2874
2884
|
return _e().wrap(function (e) {
|
|
2875
2885
|
for (;;) switch (e.prev = e.next) {
|
|
@@ -2904,7 +2914,7 @@ var Dt = function () {
|
|
|
2904
2914
|
return ve(e, [{
|
|
2905
2915
|
key: "getCodeChallenge",
|
|
2906
2916
|
value: function value() {
|
|
2907
|
-
return
|
|
2917
|
+
return Ae(this, void 0, void 0, _e().mark(function e() {
|
|
2908
2918
|
var t, r;
|
|
2909
2919
|
return _e().wrap(function (e) {
|
|
2910
2920
|
for (;;) switch (e.prev = e.next) {
|
|
@@ -2938,7 +2948,7 @@ var Dt = function () {
|
|
|
2938
2948
|
}, {
|
|
2939
2949
|
key: "create",
|
|
2940
2950
|
value: function value(e) {
|
|
2941
|
-
return
|
|
2951
|
+
return Ae(this, void 0, void 0, _e().mark(function t() {
|
|
2942
2952
|
var r, n, i, s;
|
|
2943
2953
|
return _e().wrap(function (t) {
|
|
2944
2954
|
for (;;) switch (t.prev = t.next) {
|
|
@@ -2978,7 +2988,7 @@ var Dt = function () {
|
|
|
2978
2988
|
}, {
|
|
2979
2989
|
key: "authenticate",
|
|
2980
2990
|
value: function value(e) {
|
|
2981
|
-
return
|
|
2991
|
+
return Ae(this, void 0, void 0, _e().mark(function t() {
|
|
2982
2992
|
var r, n, i, s;
|
|
2983
2993
|
return _e().wrap(function (t) {
|
|
2984
2994
|
for (;;) switch (t.prev = t.next) {
|
|
@@ -3018,7 +3028,7 @@ var Dt = function () {
|
|
|
3018
3028
|
}, {
|
|
3019
3029
|
key: "resetByEmailStart",
|
|
3020
3030
|
value: function value(e) {
|
|
3021
|
-
return
|
|
3031
|
+
return Ae(this, void 0, void 0, _e().mark(function t() {
|
|
3022
3032
|
var r, n, i, s;
|
|
3023
3033
|
return _e().wrap(function (t) {
|
|
3024
3034
|
for (;;) switch (t.prev = t.next) {
|
|
@@ -3053,7 +3063,7 @@ var Dt = function () {
|
|
|
3053
3063
|
}, {
|
|
3054
3064
|
key: "resetByEmail",
|
|
3055
3065
|
value: function value(e) {
|
|
3056
|
-
return
|
|
3066
|
+
return Ae(this, void 0, void 0, _e().mark(function t() {
|
|
3057
3067
|
var r, n, i, s, o, a;
|
|
3058
3068
|
return _e().wrap(function (t) {
|
|
3059
3069
|
for (;;) switch (t.prev = t.next) {
|
|
@@ -3096,7 +3106,7 @@ var Dt = function () {
|
|
|
3096
3106
|
}, {
|
|
3097
3107
|
key: "resetByExistingPassword",
|
|
3098
3108
|
value: function value(e) {
|
|
3099
|
-
return
|
|
3109
|
+
return Ae(this, void 0, void 0, _e().mark(function t() {
|
|
3100
3110
|
var r, n, i, s;
|
|
3101
3111
|
return _e().wrap(function (t) {
|
|
3102
3112
|
for (;;) switch (t.prev = t.next) {
|
|
@@ -3137,7 +3147,7 @@ var Dt = function () {
|
|
|
3137
3147
|
}, {
|
|
3138
3148
|
key: "resetBySession",
|
|
3139
3149
|
value: function value(e) {
|
|
3140
|
-
return
|
|
3150
|
+
return Ae(this, void 0, void 0, _e().mark(function t() {
|
|
3141
3151
|
var r, n, i, s;
|
|
3142
3152
|
return _e().wrap(function (t) {
|
|
3143
3153
|
for (;;) switch (t.prev = t.next) {
|
|
@@ -3176,7 +3186,7 @@ var Dt = function () {
|
|
|
3176
3186
|
}, {
|
|
3177
3187
|
key: "strengthCheck",
|
|
3178
3188
|
value: function value(e) {
|
|
3179
|
-
return
|
|
3189
|
+
return Ae(this, void 0, void 0, _e().mark(function t() {
|
|
3180
3190
|
return _e().wrap(function (t) {
|
|
3181
3191
|
for (;;) switch (t.prev = t.next) {
|
|
3182
3192
|
case 0:
|
|
@@ -3222,7 +3232,7 @@ var Ft = function () {
|
|
|
3222
3232
|
}, {
|
|
3223
3233
|
key: "call",
|
|
3224
3234
|
value: function value(e, t) {
|
|
3225
|
-
return
|
|
3235
|
+
return Ae(this, void 0, void 0, _e().mark(function r() {
|
|
3226
3236
|
var n,
|
|
3227
3237
|
i,
|
|
3228
3238
|
s = this;
|
|
@@ -3306,9 +3316,11 @@ var Ft = function () {
|
|
|
3306
3316
|
function e(t, r) {
|
|
3307
3317
|
var n = this;
|
|
3308
3318
|
ge(this, e), this._subscriptionService = t, this._headlessSessionClient = r, this._onDataChange = function (e) {
|
|
3309
|
-
(
|
|
3319
|
+
!function (e) {
|
|
3320
|
+
return !!(null == e ? void 0 : e.session);
|
|
3321
|
+
}(e) ? n.cancelBackgroundRefresh() : n.scheduleBackgroundRefresh();
|
|
3310
3322
|
}, this._reauthenticateWithBackoff = function () {
|
|
3311
|
-
return
|
|
3323
|
+
return Ae(n, void 0, void 0, _e().mark(function t() {
|
|
3312
3324
|
var r;
|
|
3313
3325
|
return _e().wrap(function (t) {
|
|
3314
3326
|
for (;;) switch (t.prev = t.next) {
|
|
@@ -3377,17 +3389,25 @@ var Ft = function () {
|
|
|
3377
3389
|
}]), e;
|
|
3378
3390
|
}();
|
|
3379
3391
|
Bt.REFRESH_INTERVAL_MS = 18e4;
|
|
3380
|
-
var Lt =
|
|
3381
|
-
var
|
|
3382
|
-
|
|
3392
|
+
var Lt = ve(function e(t, r) {
|
|
3393
|
+
var n = this;
|
|
3394
|
+
ge(this, e), this._subscriptionService = t, this.emptyState = r, this.onStateChange = function (e) {
|
|
3395
|
+
return n._subscriptionService.subscribeToState(function (t) {
|
|
3396
|
+
e(null != t ? t : n.emptyState);
|
|
3397
|
+
});
|
|
3398
|
+
};
|
|
3399
|
+
});
|
|
3400
|
+
var Mt = "bootstrap";
|
|
3401
|
+
var Nt = /*#__PURE__*/function () {
|
|
3402
|
+
function Nt(e, t, r) {
|
|
3383
3403
|
var _this = this;
|
|
3384
|
-
_classCallCheck(this,
|
|
3404
|
+
_classCallCheck(this, Nt);
|
|
3385
3405
|
this._publicToken = e, this._networkClient = t, this._dataLayer = r, this._bootstrapDataPromise = this._networkClient.fetchSDK({
|
|
3386
3406
|
url: "/projects/bootstrap/".concat(this._publicToken),
|
|
3387
3407
|
method: "GET",
|
|
3388
3408
|
errorMessage: "Error fetching bootstrap data for SDK for ".concat(this._publicToken)
|
|
3389
|
-
}).then(
|
|
3390
|
-
return _this._dataLayer.setItem(
|
|
3409
|
+
}).then(Nt.mapBootstrapData).then(function (e) {
|
|
3410
|
+
return _this._dataLayer.setItem(Mt, JSON.stringify(e)), e;
|
|
3391
3411
|
})["catch"](function (e) {
|
|
3392
3412
|
return Ve(e), {
|
|
3393
3413
|
displayWatermark: !1,
|
|
@@ -3408,10 +3428,10 @@ var Mt = /*#__PURE__*/function () {
|
|
|
3408
3428
|
};
|
|
3409
3429
|
});
|
|
3410
3430
|
}
|
|
3411
|
-
_createClass(
|
|
3431
|
+
_createClass(Nt, [{
|
|
3412
3432
|
key: "getSync",
|
|
3413
3433
|
value: function getSync() {
|
|
3414
|
-
var e = this._dataLayer.getItem(
|
|
3434
|
+
var e = this._dataLayer.getItem(Mt);
|
|
3415
3435
|
if (null === e) return {
|
|
3416
3436
|
displayWatermark: !1,
|
|
3417
3437
|
cnameDomain: null,
|
|
@@ -3482,7 +3502,7 @@ var Mt = /*#__PURE__*/function () {
|
|
|
3482
3502
|
};
|
|
3483
3503
|
}
|
|
3484
3504
|
}]);
|
|
3485
|
-
return
|
|
3505
|
+
return Nt;
|
|
3486
3506
|
}();
|
|
3487
3507
|
function Ut(e, t, r, n) {
|
|
3488
3508
|
return new (r || (r = Promise))(function (i, s) {
|
|
@@ -3510,9 +3530,9 @@ function Ut(e, t, r, n) {
|
|
|
3510
3530
|
});
|
|
3511
3531
|
}
|
|
3512
3532
|
"function" == typeof SuppressedError && SuppressedError;
|
|
3513
|
-
var
|
|
3533
|
+
var Kt = /*#__PURE__*/_createClass(function Kt(e) {
|
|
3514
3534
|
var _this2 = this;
|
|
3515
|
-
_classCallCheck(this,
|
|
3535
|
+
_classCallCheck(this, Kt);
|
|
3516
3536
|
this.bootstrapPromise = e, this.executeRecaptcha = function () {
|
|
3517
3537
|
return Ut(_this2, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
3518
3538
|
var _yield$this$state, e, t, r;
|
|
@@ -3583,10 +3603,10 @@ var Nt = /*#__PURE__*/_createClass(function Nt(e) {
|
|
|
3583
3603
|
}));
|
|
3584
3604
|
});
|
|
3585
3605
|
});
|
|
3586
|
-
var
|
|
3587
|
-
function
|
|
3606
|
+
var qt = /*#__PURE__*/function () {
|
|
3607
|
+
function qt(e) {
|
|
3588
3608
|
var _this3 = this;
|
|
3589
|
-
_classCallCheck(this,
|
|
3609
|
+
_classCallCheck(this, qt);
|
|
3590
3610
|
this.iframeURL = e, this.oneTapStart = function (e) {
|
|
3591
3611
|
return _this3.call("oneTapStart", e);
|
|
3592
3612
|
}, this.oneTapSubmit = function (e) {
|
|
@@ -3595,7 +3615,7 @@ var Kt = /*#__PURE__*/function () {
|
|
|
3595
3615
|
return _this3.call("parsedPhoneNumber", e);
|
|
3596
3616
|
};
|
|
3597
3617
|
}
|
|
3598
|
-
_createClass(
|
|
3618
|
+
_createClass(qt, [{
|
|
3599
3619
|
key: "frameClient",
|
|
3600
3620
|
get: function get() {
|
|
3601
3621
|
var e;
|
|
@@ -3607,14 +3627,14 @@ var Kt = /*#__PURE__*/function () {
|
|
|
3607
3627
|
return this.frameClient.call(e, [t]);
|
|
3608
3628
|
}
|
|
3609
3629
|
}]);
|
|
3610
|
-
return
|
|
3630
|
+
return qt;
|
|
3611
3631
|
}();
|
|
3612
|
-
var
|
|
3613
|
-
_inherits(
|
|
3614
|
-
function
|
|
3632
|
+
var Wt = /*#__PURE__*/function (_at) {
|
|
3633
|
+
_inherits(Wt, _at);
|
|
3634
|
+
function Wt(e, t, r, n, i, s) {
|
|
3615
3635
|
var _this4;
|
|
3616
|
-
_classCallCheck(this,
|
|
3617
|
-
_this4 = _callSuper(this,
|
|
3636
|
+
_classCallCheck(this, Wt);
|
|
3637
|
+
_this4 = _callSuper(this, Wt, [e, t, r, n, i]), _this4._oneTap = s, _this4.startOneTap = function (e) {
|
|
3618
3638
|
return Ut(_assertThisInitialized(_this4), void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
3619
3639
|
var t, r, n;
|
|
3620
3640
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
@@ -3653,11 +3673,11 @@ var qt = /*#__PURE__*/function (_at) {
|
|
|
3653
3673
|
};
|
|
3654
3674
|
return _this4;
|
|
3655
3675
|
}
|
|
3656
|
-
return _createClass(
|
|
3676
|
+
return _createClass(Wt);
|
|
3657
3677
|
}(at);
|
|
3658
|
-
var
|
|
3659
|
-
function
|
|
3660
|
-
_classCallCheck(this,
|
|
3678
|
+
var Gt = /*#__PURE__*/function () {
|
|
3679
|
+
function Gt(e, t, r, n) {
|
|
3680
|
+
_classCallCheck(this, Gt);
|
|
3661
3681
|
this._publicToken = e, this._subscriptionDataLayer = t, this.baseURL = r, this.additionalTelemetryDataFn = n, this.updateSessionToken = function () {
|
|
3662
3682
|
return null;
|
|
3663
3683
|
}, this.eventLogger = new tt({
|
|
@@ -3666,7 +3686,7 @@ var Wt = /*#__PURE__*/function () {
|
|
|
3666
3686
|
logEventURL: this.buildSDKUrl("/events")
|
|
3667
3687
|
});
|
|
3668
3688
|
}
|
|
3669
|
-
_createClass(
|
|
3689
|
+
_createClass(Gt, [{
|
|
3670
3690
|
key: "logEvent",
|
|
3671
3691
|
value: function logEvent(_ref) {
|
|
3672
3692
|
var e = _ref.name,
|
|
@@ -3686,9 +3706,9 @@ var Wt = /*#__PURE__*/function () {
|
|
|
3686
3706
|
key: "createTelemetryBlob",
|
|
3687
3707
|
value: function createTelemetryBlob() {
|
|
3688
3708
|
return Object.assign(Object.assign({
|
|
3689
|
-
event_id: "event-id-".concat(
|
|
3690
|
-
app_session_id: "app-session-id-".concat(
|
|
3691
|
-
persistent_id: "persistent-id-".concat(
|
|
3709
|
+
event_id: "event-id-".concat(Ne()),
|
|
3710
|
+
app_session_id: "app-session-id-".concat(Ne()),
|
|
3711
|
+
persistent_id: "persistent-id-".concat(Ne()),
|
|
3692
3712
|
client_sent_at: new Date().toISOString(),
|
|
3693
3713
|
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone
|
|
3694
3714
|
}, this.additionalTelemetryDataFn()), {
|
|
@@ -3697,7 +3717,7 @@ var Wt = /*#__PURE__*/function () {
|
|
|
3697
3717
|
},
|
|
3698
3718
|
sdk: {
|
|
3699
3719
|
identifier: "Stytch.js Javascript SDK",
|
|
3700
|
-
version: "4.
|
|
3720
|
+
version: "4.9.0"
|
|
3701
3721
|
}
|
|
3702
3722
|
});
|
|
3703
3723
|
}
|
|
@@ -3753,7 +3773,7 @@ var Wt = /*#__PURE__*/function () {
|
|
|
3753
3773
|
o = e.xSDKParentHostHeader,
|
|
3754
3774
|
a = e.body,
|
|
3755
3775
|
c = e.retryCallback;
|
|
3756
|
-
return
|
|
3776
|
+
return Ae(this, void 0, void 0, _e().mark(function e() {
|
|
3757
3777
|
var u;
|
|
3758
3778
|
return _e().wrap(function (e) {
|
|
3759
3779
|
for (;;) switch (e.prev = e.next) {
|
|
@@ -3809,14 +3829,18 @@ var Wt = /*#__PURE__*/function () {
|
|
|
3809
3829
|
return "".concat(this.baseURL, "/sdk/v1").concat(e);
|
|
3810
3830
|
}
|
|
3811
3831
|
}]);
|
|
3812
|
-
return
|
|
3832
|
+
return Gt;
|
|
3813
3833
|
}();
|
|
3814
|
-
var
|
|
3815
|
-
function
|
|
3816
|
-
|
|
3834
|
+
var Ht = "undefined" != typeof window && "IdentityCredential" in window,
|
|
3835
|
+
zt = function zt(e) {
|
|
3836
|
+
return e === exports.OneTapPositions.forceLegacyEmbedded ? "force" : e === exports.OneTapPositions.embeddedOnly || e === exports.OneTapPositions.embedded || e === exports.OneTapPositions.floatingOrEmbedded;
|
|
3837
|
+
};
|
|
3838
|
+
var Vt = /*#__PURE__*/function () {
|
|
3839
|
+
function Vt(e, t, r) {
|
|
3840
|
+
_classCallCheck(this, Vt);
|
|
3817
3841
|
this._googleClient = e, this._publicToken = t, this._clientId = r;
|
|
3818
3842
|
}
|
|
3819
|
-
_createClass(
|
|
3843
|
+
_createClass(Vt, [{
|
|
3820
3844
|
key: "cancel",
|
|
3821
3845
|
value: function cancel() {
|
|
3822
3846
|
this._googleClient.cancel();
|
|
@@ -3829,27 +3853,35 @@ var Gt = /*#__PURE__*/function () {
|
|
|
3829
3853
|
r = _ref4.style;
|
|
3830
3854
|
return Ut(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
3831
3855
|
var _this5 = this;
|
|
3832
|
-
var n;
|
|
3856
|
+
var n, i, s;
|
|
3833
3857
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
3834
3858
|
while (1) switch (_context6.prev = _context6.next) {
|
|
3835
3859
|
case 0:
|
|
3836
|
-
n = {
|
|
3860
|
+
n = zt(r.position), i = function (e) {
|
|
3861
|
+
var t = zt(e);
|
|
3862
|
+
return "force" === t || t && !Ht;
|
|
3863
|
+
}(r.position), s = {
|
|
3837
3864
|
client_id: this._clientId,
|
|
3838
3865
|
callback: e,
|
|
3839
3866
|
auto_select: !1,
|
|
3840
3867
|
context: "use",
|
|
3841
3868
|
itp_support: !0,
|
|
3842
|
-
use_fedcm_for_prompt:
|
|
3869
|
+
use_fedcm_for_prompt: "force" !== n
|
|
3843
3870
|
};
|
|
3844
|
-
return _context6.abrupt("return", (
|
|
3845
|
-
_this5._googleClient.prompt(function (
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3871
|
+
return _context6.abrupt("return", (i && (s.prompt_parent_id = "google-parent-prompt", s.cancel_on_tap_outside = !1), this._googleClient.initialize(s), new Promise(function (e) {
|
|
3872
|
+
_this5._googleClient.prompt(function (r) {
|
|
3873
|
+
var n, s, o, a, c;
|
|
3874
|
+
if (r.isSkippedMoment()) {
|
|
3875
|
+
var _i = null !== (s = null === (n = r.getSkippedReason) || void 0 === n ? void 0 : n.call(r)) && void 0 !== s ? s : "unknown_reason";
|
|
3876
|
+
return "user_cancel" === _i && (null == t || t()), e({
|
|
3877
|
+
success: !1,
|
|
3878
|
+
reason: _i
|
|
3879
|
+
});
|
|
3880
|
+
}
|
|
3881
|
+
return !r.isNotDisplayed && i || (null === (o = r.isNotDisplayed) || void 0 === o ? void 0 : o.call(r)) ? e({
|
|
3850
3882
|
success: !1,
|
|
3851
|
-
reason:
|
|
3852
|
-
}) : (_this5.styleFrame(
|
|
3883
|
+
reason: null !== (c = null === (a = r.getNotDisplayedReason) || void 0 === a ? void 0 : a.call(r)) && void 0 !== c ? c : "unknown_reason"
|
|
3884
|
+
}) : r.isDismissedMoment() ? void 0 : (_this5.styleFrame(i), e({
|
|
3853
3885
|
success: !0
|
|
3854
3886
|
}));
|
|
3855
3887
|
});
|
|
@@ -3864,17 +3896,17 @@ var Gt = /*#__PURE__*/function () {
|
|
|
3864
3896
|
}, {
|
|
3865
3897
|
key: "styleFrame",
|
|
3866
3898
|
value: function styleFrame(e) {
|
|
3867
|
-
e
|
|
3868
|
-
e.src.includes(
|
|
3899
|
+
e && Array.from(document.getElementsByTagName("iframe")).forEach(function (e) {
|
|
3900
|
+
e.src.includes(Pe) && (e.style.width = "100%");
|
|
3869
3901
|
});
|
|
3870
3902
|
}
|
|
3871
3903
|
}]);
|
|
3872
|
-
return
|
|
3904
|
+
return Vt;
|
|
3873
3905
|
}();
|
|
3874
|
-
var
|
|
3875
|
-
function
|
|
3906
|
+
var Yt = /*#__PURE__*/function () {
|
|
3907
|
+
function Yt(e, t) {
|
|
3876
3908
|
var _this6 = this;
|
|
3877
|
-
_classCallCheck(this,
|
|
3909
|
+
_classCallCheck(this, Yt);
|
|
3878
3910
|
this._publicToken = e, this.clientsideServices = t, this.createOnSuccessHandler = function (_ref5) {
|
|
3879
3911
|
var e = _ref5.loginRedirectUrl,
|
|
3880
3912
|
t = _ref5.signupRedirectUrl,
|
|
@@ -3907,7 +3939,7 @@ var Ht = /*#__PURE__*/function () {
|
|
|
3907
3939
|
window.location.href = e;
|
|
3908
3940
|
};
|
|
3909
3941
|
}
|
|
3910
|
-
_createClass(
|
|
3942
|
+
_createClass(Yt, [{
|
|
3911
3943
|
key: "createOneTapClient",
|
|
3912
3944
|
value: function createOneTapClient() {
|
|
3913
3945
|
return Ut(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
|
@@ -3941,7 +3973,7 @@ var Ht = /*#__PURE__*/function () {
|
|
|
3941
3973
|
});
|
|
3942
3974
|
case 12:
|
|
3943
3975
|
_context8.t1 = !0;
|
|
3944
|
-
_context8.t2 =
|
|
3976
|
+
_context8.t2 = Vt;
|
|
3945
3977
|
_context8.next = 16;
|
|
3946
3978
|
return Ke(Oe, function () {
|
|
3947
3979
|
return window.google.accounts.id;
|
|
@@ -4012,21 +4044,21 @@ var Ht = /*#__PURE__*/function () {
|
|
|
4012
4044
|
}, {
|
|
4013
4045
|
key: "WillGoogleOneTapShowEmbedded",
|
|
4014
4046
|
value: function WillGoogleOneTapShowEmbedded() {
|
|
4015
|
-
return !
|
|
4047
|
+
return !Yt.WillGoogleOneTapShowBannerForUA(navigator.userAgent);
|
|
4016
4048
|
}
|
|
4017
4049
|
}]);
|
|
4018
|
-
return
|
|
4050
|
+
return Yt;
|
|
4019
4051
|
}();
|
|
4020
|
-
function
|
|
4052
|
+
function Jt(e) {
|
|
4021
4053
|
var t = e.toString(16);
|
|
4022
4054
|
return 1 === t.length && (t = "0" + t), t;
|
|
4023
4055
|
}
|
|
4024
|
-
var
|
|
4025
|
-
function
|
|
4026
|
-
_classCallCheck(this,
|
|
4056
|
+
var $t = /*#__PURE__*/function () {
|
|
4057
|
+
function $t(e, t) {
|
|
4058
|
+
_classCallCheck(this, $t);
|
|
4027
4059
|
this._dataLayer = e, this.namespace = t;
|
|
4028
4060
|
}
|
|
4029
|
-
_createClass(
|
|
4061
|
+
_createClass($t, [{
|
|
4030
4062
|
key: "key",
|
|
4031
4063
|
value: function key() {
|
|
4032
4064
|
return "PKCE_VERIFIER:" + this.namespace;
|
|
@@ -4040,7 +4072,7 @@ var Vt = /*#__PURE__*/function () {
|
|
|
4040
4072
|
while (1) switch (_context10.prev = _context10.next) {
|
|
4041
4073
|
case 0:
|
|
4042
4074
|
_context10.next = 2;
|
|
4043
|
-
return
|
|
4075
|
+
return $t.createProofkeyPair();
|
|
4044
4076
|
case 2:
|
|
4045
4077
|
e = _context10.sent;
|
|
4046
4078
|
return _context10.abrupt("return", (this._dataLayer.setItem(this.key(), JSON.stringify(e)), e));
|
|
@@ -4077,7 +4109,7 @@ var Vt = /*#__PURE__*/function () {
|
|
|
4077
4109
|
case 0:
|
|
4078
4110
|
e = new Uint32Array(16);
|
|
4079
4111
|
window.crypto.getRandomValues(e);
|
|
4080
|
-
t = Array.from(e).map(
|
|
4112
|
+
t = Array.from(e).map(Jt).join("");
|
|
4081
4113
|
_context11.next = 5;
|
|
4082
4114
|
return window.crypto.subtle.digest("SHA-256", new TextEncoder().encode(t));
|
|
4083
4115
|
case 5:
|
|
@@ -4094,9 +4126,9 @@ var Vt = /*#__PURE__*/function () {
|
|
|
4094
4126
|
}));
|
|
4095
4127
|
}
|
|
4096
4128
|
}]);
|
|
4097
|
-
return
|
|
4129
|
+
return $t;
|
|
4098
4130
|
}();
|
|
4099
|
-
var
|
|
4131
|
+
var Xt = function Xt(e) {
|
|
4100
4132
|
return (document.cookie ? document.cookie.split("; ") : []).filter(function (t) {
|
|
4101
4133
|
var _t$split = t.split("="),
|
|
4102
4134
|
_t$split2 = _slicedToArray(_t$split, 1),
|
|
@@ -4105,17 +4137,17 @@ var Yt = function Yt(e) {
|
|
|
4105
4137
|
}).length > 1;
|
|
4106
4138
|
};
|
|
4107
4139
|
/*! js-cookie v3.0.1 | MIT */
|
|
4108
|
-
function
|
|
4140
|
+
function Zt(e) {
|
|
4109
4141
|
for (var t = 1; t < arguments.length; t++) {
|
|
4110
4142
|
var r = arguments[t];
|
|
4111
4143
|
for (var n in r) e[n] = r[n];
|
|
4112
4144
|
}
|
|
4113
4145
|
return e;
|
|
4114
4146
|
}
|
|
4115
|
-
var
|
|
4147
|
+
var Qt = function e(t, r) {
|
|
4116
4148
|
function n(e, n, i) {
|
|
4117
4149
|
if ("undefined" != typeof document) {
|
|
4118
|
-
"number" == typeof (i =
|
|
4150
|
+
"number" == typeof (i = Zt({}, r, i)).expires && (i.expires = new Date(Date.now() + 864e5 * i.expires)), i.expires && (i.expires = i.expires.toUTCString()), e = encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
|
|
4119
4151
|
var s = "";
|
|
4120
4152
|
for (var o in i) i[o] && (s += "; " + o, !0 !== i[o] && (s += "=" + i[o].split(";")[0]));
|
|
4121
4153
|
return document.cookie = e + "=" + t.write(n, e) + s;
|
|
@@ -4137,15 +4169,15 @@ var $t = function e(t, r) {
|
|
|
4137
4169
|
}
|
|
4138
4170
|
},
|
|
4139
4171
|
remove: function remove(e, t) {
|
|
4140
|
-
n(e, "",
|
|
4172
|
+
n(e, "", Zt({}, t, {
|
|
4141
4173
|
expires: -1
|
|
4142
4174
|
}));
|
|
4143
4175
|
},
|
|
4144
4176
|
withAttributes: function withAttributes(t) {
|
|
4145
|
-
return e(this.converter,
|
|
4177
|
+
return e(this.converter, Zt({}, this.attributes, t));
|
|
4146
4178
|
},
|
|
4147
4179
|
withConverter: function withConverter(t) {
|
|
4148
|
-
return e(
|
|
4180
|
+
return e(Zt({}, this.converter, t), this.attributes);
|
|
4149
4181
|
}
|
|
4150
4182
|
}, {
|
|
4151
4183
|
attributes: {
|
|
@@ -4165,37 +4197,37 @@ var $t = function e(t, r) {
|
|
|
4165
4197
|
}, {
|
|
4166
4198
|
path: "/"
|
|
4167
4199
|
});
|
|
4168
|
-
var
|
|
4200
|
+
var er = function er(e) {
|
|
4169
4201
|
var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
4170
4202
|
return "stytch_sdk_state_".concat(e).concat(t ? "::".concat(t) : "");
|
|
4171
4203
|
},
|
|
4172
|
-
|
|
4173
|
-
|
|
4174
|
-
clearTimeout(
|
|
4204
|
+
tr = new Map(),
|
|
4205
|
+
rr = function rr(e) {
|
|
4206
|
+
clearTimeout(tr.get(e));
|
|
4175
4207
|
},
|
|
4176
|
-
|
|
4177
|
-
|
|
4208
|
+
nr = function nr(e, t, r) {
|
|
4209
|
+
rr(e);
|
|
4178
4210
|
var n = setTimeout(function () {
|
|
4179
|
-
void 0 ===
|
|
4211
|
+
void 0 === Qt.get(e) && Qt.set(e, t, r);
|
|
4180
4212
|
}, 10);
|
|
4181
|
-
return
|
|
4213
|
+
return tr.set(e, n), Qt.set(e, t, r);
|
|
4182
4214
|
};
|
|
4183
|
-
var
|
|
4184
|
-
function
|
|
4215
|
+
var ir = /*#__PURE__*/function () {
|
|
4216
|
+
function ir(e, t) {
|
|
4185
4217
|
var _this7 = this;
|
|
4186
|
-
_classCallCheck(this,
|
|
4218
|
+
_classCallCheck(this, ir);
|
|
4187
4219
|
this.browserSessionStorage = {
|
|
4188
4220
|
getItem: function getItem(e) {
|
|
4189
|
-
return sessionStorage.getItem(
|
|
4221
|
+
return sessionStorage.getItem(er(_this7.publicToken, e));
|
|
4190
4222
|
},
|
|
4191
4223
|
setItem: function setItem(e, t) {
|
|
4192
|
-
return sessionStorage.setItem(
|
|
4224
|
+
return sessionStorage.setItem(er(_this7.publicToken, e), t);
|
|
4193
4225
|
},
|
|
4194
4226
|
removeItem: function removeItem(e) {
|
|
4195
|
-
return sessionStorage.removeItem(
|
|
4227
|
+
return sessionStorage.removeItem(er(_this7.publicToken, e));
|
|
4196
4228
|
}
|
|
4197
4229
|
}, this.publicToken = e, this.state = null, this.stateKeysUpdated = new Set(), this.subscriptions = {}, (null == t ? void 0 : t.cookieOptions) ? (Je("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);
|
|
4198
|
-
var r = localStorage.getItem(
|
|
4230
|
+
var r = localStorage.getItem(er(this.publicToken));
|
|
4199
4231
|
if (!r) return;
|
|
4200
4232
|
var n;
|
|
4201
4233
|
try {
|
|
@@ -4205,7 +4237,7 @@ var tr = /*#__PURE__*/function () {
|
|
|
4205
4237
|
}
|
|
4206
4238
|
this.state = n;
|
|
4207
4239
|
}
|
|
4208
|
-
_createClass(
|
|
4240
|
+
_createClass(ir, [{
|
|
4209
4241
|
key: "opaqueTokenCookieName",
|
|
4210
4242
|
get: function get() {
|
|
4211
4243
|
var e;
|
|
@@ -4227,14 +4259,14 @@ var tr = /*#__PURE__*/function () {
|
|
|
4227
4259
|
key: "readSessionCookie",
|
|
4228
4260
|
value: function readSessionCookie() {
|
|
4229
4261
|
return {
|
|
4230
|
-
session_token:
|
|
4231
|
-
session_jwt:
|
|
4262
|
+
session_token: Qt.get(this.opaqueTokenCookieName),
|
|
4263
|
+
session_jwt: Qt.get(this.jwtCookieName)
|
|
4232
4264
|
};
|
|
4233
4265
|
}
|
|
4234
4266
|
}, {
|
|
4235
4267
|
key: "readIntermediateSessionTokenCookie",
|
|
4236
4268
|
value: function readIntermediateSessionTokenCookie() {
|
|
4237
|
-
return
|
|
4269
|
+
return Qt.get(this.istCookieName);
|
|
4238
4270
|
}
|
|
4239
4271
|
}, {
|
|
4240
4272
|
key: "writeSessionCookie",
|
|
@@ -4243,32 +4275,32 @@ var tr = /*#__PURE__*/function () {
|
|
|
4243
4275
|
var s = e.state,
|
|
4244
4276
|
o = e.session_token,
|
|
4245
4277
|
a = e.session_jwt,
|
|
4246
|
-
c =
|
|
4278
|
+
c = ir.generateCookieOpts({
|
|
4247
4279
|
expiresAt: null !== (r = null === (t = null == s ? void 0 : s.session) || void 0 === t ? void 0 : t.expires_at) && void 0 !== r ? r : "",
|
|
4248
4280
|
availableToSubdomains: this._cookieAvailableToSubdomains,
|
|
4249
4281
|
path: this._cookiePath,
|
|
4250
4282
|
domain: this._domain
|
|
4251
4283
|
});
|
|
4252
|
-
|
|
4253
|
-
var u =
|
|
4284
|
+
nr(this.opaqueTokenCookieName, o, c), nr(this.jwtCookieName, a, c);
|
|
4285
|
+
var u = ir.generateCookieOpts({
|
|
4254
4286
|
expiresAt: null !== (i = null === (n = null == s ? void 0 : s.session) || void 0 === n ? void 0 : n.expires_at) && void 0 !== i ? i : "",
|
|
4255
4287
|
availableToSubdomains: !this._cookieAvailableToSubdomains,
|
|
4256
4288
|
path: this._cookiePath,
|
|
4257
4289
|
domain: this._domain
|
|
4258
4290
|
});
|
|
4259
|
-
|
|
4291
|
+
Xt(this.jwtCookieName) && Qt.remove(this.jwtCookieName, u), Xt(this.opaqueTokenCookieName) && Qt.remove(this.opaqueTokenCookieName, u), Xt(this.jwtCookieName) && ze("Could not remove extraneous JWT cookie. This might happen if the cookie has been set using multiple `path` settings, and may produce unwanted behavior."), Xt(this.opaqueTokenCookieName) && ze("Could not remove extraneous opaque token cookie.");
|
|
4260
4292
|
}
|
|
4261
4293
|
}, {
|
|
4262
4294
|
key: "writeIntermediateSessionTokenCookie",
|
|
4263
4295
|
value: function writeIntermediateSessionTokenCookie(e) {
|
|
4264
4296
|
var t = new Date(Date.now() + 6e5),
|
|
4265
|
-
r =
|
|
4297
|
+
r = ir.generateCookieOpts({
|
|
4266
4298
|
expiresAt: t.toString(),
|
|
4267
4299
|
availableToSubdomains: this._cookieAvailableToSubdomains,
|
|
4268
4300
|
path: this._cookiePath,
|
|
4269
4301
|
domain: this._domain
|
|
4270
4302
|
});
|
|
4271
|
-
|
|
4303
|
+
nr(this.istCookieName, e, r);
|
|
4272
4304
|
}
|
|
4273
4305
|
}, {
|
|
4274
4306
|
key: "removeSessionCookie",
|
|
@@ -4287,47 +4319,38 @@ var tr = /*#__PURE__*/function () {
|
|
|
4287
4319
|
[!0, !1].forEach(function (t) {
|
|
4288
4320
|
[_this8._cookiePath, null].forEach(function (r) {
|
|
4289
4321
|
[_this8._domain, null].forEach(function (n) {
|
|
4290
|
-
var i =
|
|
4322
|
+
var i = ir.generateCookieOpts({
|
|
4291
4323
|
expiresAt: new Date(0).toString(),
|
|
4292
4324
|
availableToSubdomains: t,
|
|
4293
4325
|
path: r,
|
|
4294
4326
|
domain: n
|
|
4295
4327
|
});
|
|
4296
4328
|
e.forEach(function (e) {
|
|
4297
|
-
|
|
4329
|
+
Qt.remove(e, i);
|
|
4298
4330
|
});
|
|
4299
4331
|
});
|
|
4300
4332
|
});
|
|
4301
|
-
}), e.forEach(
|
|
4333
|
+
}), e.forEach(rr);
|
|
4302
4334
|
}
|
|
4303
4335
|
}, {
|
|
4304
4336
|
key: "syncToLocalStorage",
|
|
4305
4337
|
value: function syncToLocalStorage() {
|
|
4306
|
-
localStorage.setItem(
|
|
4338
|
+
localStorage.setItem(er(this.publicToken), JSON.stringify(this.state));
|
|
4307
4339
|
}
|
|
4308
4340
|
}, {
|
|
4309
4341
|
key: "getItem",
|
|
4310
4342
|
value: function getItem(e) {
|
|
4311
|
-
return localStorage.getItem(
|
|
4343
|
+
return localStorage.getItem(er(this.publicToken, e));
|
|
4312
4344
|
}
|
|
4313
4345
|
}, {
|
|
4314
4346
|
key: "setItem",
|
|
4315
4347
|
value: function setItem(e, t) {
|
|
4316
|
-
return localStorage.setItem(
|
|
4348
|
+
return localStorage.setItem(er(this.publicToken, e), t);
|
|
4317
4349
|
}
|
|
4318
4350
|
}, {
|
|
4319
4351
|
key: "removeItem",
|
|
4320
4352
|
value: function removeItem(e) {
|
|
4321
|
-
return localStorage.removeItem(
|
|
4322
|
-
}
|
|
4323
|
-
}, {
|
|
4324
|
-
key: "markStateKeysUpdated",
|
|
4325
|
-
value: function markStateKeysUpdated(e) {
|
|
4326
|
-
var _this9 = this;
|
|
4327
|
-
var t = this.stateKeysUpdated.size;
|
|
4328
|
-
return e.forEach(function (e) {
|
|
4329
|
-
return _this9.stateKeysUpdated.add(e);
|
|
4330
|
-
}), t !== this.stateKeysUpdated.size;
|
|
4353
|
+
return localStorage.removeItem(er(this.publicToken, e));
|
|
4331
4354
|
}
|
|
4332
4355
|
}], [{
|
|
4333
4356
|
key: "generateCookieOpts",
|
|
@@ -4343,62 +4366,65 @@ var tr = /*#__PURE__*/function () {
|
|
|
4343
4366
|
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;
|
|
4344
4367
|
}
|
|
4345
4368
|
}]);
|
|
4346
|
-
return
|
|
4369
|
+
return ir;
|
|
4347
4370
|
}();
|
|
4348
|
-
var
|
|
4349
|
-
_inherits(
|
|
4350
|
-
function
|
|
4351
|
-
_classCallCheck(this,
|
|
4352
|
-
return _callSuper(this,
|
|
4371
|
+
var sr = /*#__PURE__*/function (_ir) {
|
|
4372
|
+
_inherits(sr, _ir);
|
|
4373
|
+
function sr() {
|
|
4374
|
+
_classCallCheck(this, sr);
|
|
4375
|
+
return _callSuper(this, sr, arguments);
|
|
4353
4376
|
}
|
|
4354
|
-
return _createClass(
|
|
4355
|
-
}(
|
|
4356
|
-
var
|
|
4357
|
-
|
|
4377
|
+
return _createClass(sr);
|
|
4378
|
+
}(ir);
|
|
4379
|
+
var or = Symbol["for"]("__stytch_DataLayer"),
|
|
4380
|
+
ar = function ar(e, t) {
|
|
4358
4381
|
var r = function () {
|
|
4359
4382
|
var e = window;
|
|
4360
|
-
return e[
|
|
4383
|
+
return e[or] || (e[or] = {}), e[or];
|
|
4361
4384
|
}();
|
|
4362
|
-
return r[e] || (r[e] = new
|
|
4385
|
+
return r[e] || (r[e] = new sr(e, t)), r[e];
|
|
4363
4386
|
},
|
|
4364
|
-
|
|
4387
|
+
cr = function cr(e, t) {
|
|
4365
4388
|
Object.values(e).forEach(function (e) {
|
|
4366
4389
|
return e(t);
|
|
4367
4390
|
});
|
|
4368
4391
|
},
|
|
4369
|
-
|
|
4370
|
-
var
|
|
4371
|
-
|
|
4372
|
-
|
|
4373
|
-
|
|
4392
|
+
ur = function () {
|
|
4393
|
+
var _ref8 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
4394
|
+
_ref8$KEYS_TO_EXCLUDE = _ref8.KEYS_TO_EXCLUDE,
|
|
4395
|
+
e = _ref8$KEYS_TO_EXCLUDE === void 0 ? [] : _ref8$KEYS_TO_EXCLUDE;
|
|
4396
|
+
var t = function t(r, n) {
|
|
4397
|
+
return _typeof(r) == _typeof(n) && (null === r || null === n ? r === n : "object" == _typeof(r) ? Object.keys(r).length === Object.keys(n).length && !Object.keys(r).some(function (e) {
|
|
4374
4398
|
return !(e in n);
|
|
4375
|
-
}) && Object.entries(r).filter(function (
|
|
4376
|
-
var
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4399
|
+
}) && Object.entries(r).filter(function (_ref9) {
|
|
4400
|
+
var _ref10 = _slicedToArray(_ref9, 1),
|
|
4401
|
+
t = _ref10[0];
|
|
4402
|
+
return !e.includes(t);
|
|
4403
|
+
}).every(function (_ref11) {
|
|
4404
|
+
var _ref12 = _slicedToArray(_ref11, 2),
|
|
4405
|
+
e = _ref12[0],
|
|
4406
|
+
r = _ref12[1];
|
|
4407
|
+
return t(r, n[e]);
|
|
4383
4408
|
}) : r === n);
|
|
4384
4409
|
};
|
|
4410
|
+
return t;
|
|
4385
4411
|
}({
|
|
4386
4412
|
KEYS_TO_EXCLUDE: ["last_accessed_at"]
|
|
4387
4413
|
});
|
|
4388
|
-
var
|
|
4389
|
-
function
|
|
4390
|
-
var
|
|
4391
|
-
_classCallCheck(this,
|
|
4392
|
-
this._publicToken = e, this._datalayer = t, this._listen = function (e) {
|
|
4393
|
-
if (e.key !==
|
|
4414
|
+
var lr = /*#__PURE__*/function () {
|
|
4415
|
+
function lr(e, t) {
|
|
4416
|
+
var _this9 = this;
|
|
4417
|
+
_classCallCheck(this, lr);
|
|
4418
|
+
this._publicToken = e, this._datalayer = t, this.fromCache = !0, this._listen = function (e) {
|
|
4419
|
+
if (e.key !== er(_this9._publicToken)) return;
|
|
4394
4420
|
var t = null === e.newValue || "null" === e.newValue ? null : JSON.parse(e.newValue);
|
|
4395
|
-
|
|
4421
|
+
_this9.updateState(t, !0);
|
|
4396
4422
|
}, window.addEventListener("storage", this._listen);
|
|
4397
4423
|
var _this$_datalayer$read = this._datalayer.readSessionCookie(),
|
|
4398
4424
|
r = _this$_datalayer$read.session_token;
|
|
4399
4425
|
r || this.destroySession();
|
|
4400
4426
|
}
|
|
4401
|
-
_createClass(
|
|
4427
|
+
_createClass(lr, [{
|
|
4402
4428
|
key: "getTokens",
|
|
4403
4429
|
value: function getTokens() {
|
|
4404
4430
|
var _this$_datalayer$read2 = this._datalayer.readSessionCookie(),
|
|
@@ -4435,8 +4461,8 @@ var ar = /*#__PURE__*/function () {
|
|
|
4435
4461
|
var t = this._datalayer.state,
|
|
4436
4462
|
r = null === e.state ? null : Object.assign(Object.assign({}, this._datalayer.state), e.state);
|
|
4437
4463
|
this._datalayer.state = r;
|
|
4438
|
-
var n =
|
|
4439
|
-
|
|
4464
|
+
var n = this.getFromCache();
|
|
4465
|
+
this.setCacheRefreshed(), !n && ur(t, r) || cr(this._datalayer.subscriptions, r);
|
|
4440
4466
|
}
|
|
4441
4467
|
}, {
|
|
4442
4468
|
key: "updateStateAndTokens",
|
|
@@ -4450,10 +4476,10 @@ var ar = /*#__PURE__*/function () {
|
|
|
4450
4476
|
var r = this._datalayer.state,
|
|
4451
4477
|
n = null === e ? null : Object.assign(Object.assign({}, this._datalayer.state), e);
|
|
4452
4478
|
this._datalayer.state = n;
|
|
4453
|
-
var i =
|
|
4454
|
-
|
|
4455
|
-
|
|
4456
|
-
(
|
|
4479
|
+
var i = this.getFromCache();
|
|
4480
|
+
this.setCacheRefreshed();
|
|
4481
|
+
var s = !ur(r, n);
|
|
4482
|
+
(i || s) && (cr(this._datalayer.subscriptions, n), s && !t && this._datalayer.syncToLocalStorage());
|
|
4457
4483
|
}
|
|
4458
4484
|
}, {
|
|
4459
4485
|
key: "updateTokens",
|
|
@@ -4492,33 +4518,43 @@ var ar = /*#__PURE__*/function () {
|
|
|
4492
4518
|
value: function syncFromDeviceStorage() {
|
|
4493
4519
|
return null;
|
|
4494
4520
|
}
|
|
4521
|
+
}, {
|
|
4522
|
+
key: "getFromCache",
|
|
4523
|
+
value: function getFromCache() {
|
|
4524
|
+
return this.fromCache;
|
|
4525
|
+
}
|
|
4526
|
+
}, {
|
|
4527
|
+
key: "setCacheRefreshed",
|
|
4528
|
+
value: function setCacheRefreshed() {
|
|
4529
|
+
this.fromCache = !1;
|
|
4530
|
+
}
|
|
4495
4531
|
}]);
|
|
4496
|
-
return
|
|
4532
|
+
return lr;
|
|
4497
4533
|
}();
|
|
4498
|
-
var
|
|
4499
|
-
_inherits(
|
|
4500
|
-
function
|
|
4501
|
-
var
|
|
4502
|
-
_classCallCheck(this,
|
|
4503
|
-
|
|
4504
|
-
return
|
|
4534
|
+
var dr = /*#__PURE__*/function (_lr) {
|
|
4535
|
+
_inherits(dr, _lr);
|
|
4536
|
+
function dr() {
|
|
4537
|
+
var _this10;
|
|
4538
|
+
_classCallCheck(this, dr);
|
|
4539
|
+
_this10 = _callSuper(this, dr, arguments), _this10.updateUser = function (e) {
|
|
4540
|
+
return _this10.updateState({
|
|
4505
4541
|
user: e
|
|
4506
4542
|
});
|
|
4507
|
-
},
|
|
4543
|
+
}, _this10.getUser = function () {
|
|
4508
4544
|
var e, t;
|
|
4509
|
-
return null !== (t = null === (e =
|
|
4510
|
-
},
|
|
4545
|
+
return null !== (t = null === (e = _this10.getState()) || void 0 === e ? void 0 : e.user) && void 0 !== t ? t : null;
|
|
4546
|
+
}, _this10.getSession = function () {
|
|
4511
4547
|
var e, t;
|
|
4512
|
-
return null !== (t = null === (e =
|
|
4548
|
+
return null !== (t = null === (e = _this10.getState()) || void 0 === e ? void 0 : e.session) && void 0 !== t ? t : null;
|
|
4513
4549
|
};
|
|
4514
|
-
return
|
|
4550
|
+
return _this10;
|
|
4515
4551
|
}
|
|
4516
|
-
return _createClass(
|
|
4517
|
-
}(
|
|
4518
|
-
var
|
|
4519
|
-
exports.BiometricsFailedError = Q, exports.BiometricsUnavailableError = B, exports.ChallengeSigningFailedError = Y, exports.DeviceCredentialsNotAllowedError = q, exports.FailedCodeChallengeError = $, exports.FailedToDecryptDataError = Z, exports.InternalError = F, exports.InvalidAuthorizationCredentialError = z, exports.InvalidCredentialTypeError = ne, exports.InvalidRedirectSchemeError = te, exports.InvalidStartUrlError = ee, exports.JSONDataNotConvertibleToStringError = se, exports.KeyInvalidatedError = L, exports.KeystoreUnavailableError = M, exports.MissingAttestationObjectError = ie, exports.MissingAuthorizationCredentialIDTokenError = H, exports.MissingGoogleClientIDError = W, exports.MissingPKCEError = G, exports.MissingPublicKeyError = V, exports.MissingUrlError = re, exports.NoBiometricsEnrolledError =
|
|
4552
|
+
return _createClass(dr);
|
|
4553
|
+
}(lr);
|
|
4554
|
+
var hr = Symbol["for"]("stytch__internal_b2c");
|
|
4555
|
+
exports.BiometricsFailedError = Q, exports.BiometricsUnavailableError = B, exports.ChallengeSigningFailedError = Y, exports.DeviceCredentialsNotAllowedError = q, exports.FailedCodeChallengeError = $, exports.FailedToDecryptDataError = Z, exports.InternalError = F, exports.InvalidAuthorizationCredentialError = z, exports.InvalidCredentialTypeError = ne, exports.InvalidRedirectSchemeError = te, exports.InvalidStartUrlError = ee, exports.JSONDataNotConvertibleToStringError = se, exports.KeyInvalidatedError = L, exports.KeystoreUnavailableError = M, exports.MissingAttestationObjectError = ie, exports.MissingAuthorizationCredentialIDTokenError = H, exports.MissingGoogleClientIDError = W, exports.MissingPKCEError = G, exports.MissingPublicKeyError = V, exports.MissingUrlError = re, exports.NoBiometricsEnrolledError = N, exports.NoBiometricsRegistrationError = j, exports.NoCurrentSessionError = I, exports.PasskeysInvalidEncoding = ae, exports.PasskeysMisconfigured = ce, exports.PasskeysUnsupportedError = X, exports.RandomNumberGenerationFailed = oe, exports.SDKAPIUnreachableError = S, exports.SDKNotConfiguredError = J, exports.SignInWithAppleMisconfigured = ue, exports.StytchAPIError = D, exports.StytchAPISchemaError = E, exports.StytchAPIUnreachableError = A, exports.StytchError = T, exports.StytchHeadlessClient = /*#__PURE__*/function () {
|
|
4520
4556
|
function _class(e, t) {
|
|
4521
|
-
var
|
|
4557
|
+
var _this11 = this;
|
|
4522
4558
|
_classCallCheck(this, _class);
|
|
4523
4559
|
var r;
|
|
4524
4560
|
!function (e) {
|
|
@@ -4537,23 +4573,26 @@ exports.BiometricsFailedError = Q, exports.BiometricsUnavailableError = B, expor
|
|
|
4537
4573
|
}
|
|
4538
4574
|
};
|
|
4539
4575
|
var s, o, a, c, u, l, d, h, p, f, _;
|
|
4540
|
-
this._dataLayer =
|
|
4541
|
-
|
|
4542
|
-
|
|
4576
|
+
this._dataLayer = ar(e, n), this._subscriptionService = new dr(e, this._dataLayer), this._stateChangeClient = new Lt(this._subscriptionService, {}), this.onStateChange = function () {
|
|
4577
|
+
var _this11$_stateChangeC;
|
|
4578
|
+
return (_this11$_stateChangeC = _this11._stateChangeClient).onStateChange.apply(_this11$_stateChangeC, arguments);
|
|
4579
|
+
};
|
|
4580
|
+
var m = new $t(this._dataLayer, "passwords");
|
|
4581
|
+
this._networkClient = new Gt(e, this._dataLayer, i.endpoints.sdkBackendURL, function () {
|
|
4543
4582
|
var e, t, r, n;
|
|
4544
4583
|
return {
|
|
4545
|
-
stytch_user_id: null === (t = null === (e =
|
|
4546
|
-
stytch_session_id: null === (n = null === (r =
|
|
4584
|
+
stytch_user_id: null === (t = null === (e = _this11._dataLayer.state) || void 0 === e ? void 0 : e.user) || void 0 === t ? void 0 : t.user_id,
|
|
4585
|
+
stytch_session_id: null === (n = null === (r = _this11._dataLayer.state) || void 0 === r ? void 0 : r.session) || void 0 === n ? void 0 : n.session_id
|
|
4547
4586
|
};
|
|
4548
4587
|
});
|
|
4549
|
-
var v = new
|
|
4550
|
-
y = new
|
|
4588
|
+
var v = new Nt(e, this._networkClient, this._dataLayer),
|
|
4589
|
+
y = new Kt(v.getAsync()),
|
|
4551
4590
|
g = new Ze(e, i.endpoints.dfpBackendURL, v.getAsync(), y.executeRecaptcha),
|
|
4552
|
-
b = new
|
|
4553
|
-
k = new
|
|
4591
|
+
b = new qt(i.endpoints.clientsideServicesIframeURL),
|
|
4592
|
+
k = new Yt(e, b),
|
|
4554
4593
|
w = new jt(this._networkClient, g);
|
|
4555
4594
|
var S, x;
|
|
4556
|
-
this.user = new rt(this._networkClient, this._subscriptionService), this.session = new nt(this._networkClient, this._subscriptionService), this.magicLinks = new st(this._networkClient, this._subscriptionService, new
|
|
4595
|
+
this.user = new rt(this._networkClient, this._subscriptionService), this.session = new nt(this._networkClient, this._subscriptionService), this.magicLinks = new st(this._networkClient, this._subscriptionService, new $t(this._dataLayer, "magic_links"), m, v.getAsync(), g), this.otps = new ot(this._networkClient, this._subscriptionService, y.executeRecaptcha, g), this.oauth = new Wt(this._networkClient, this._subscriptionService, new $t(this._dataLayer, "oauth"), v.getAsync(), {
|
|
4557
4596
|
publicToken: e,
|
|
4558
4597
|
testAPIURL: i.endpoints.testAPIURL,
|
|
4559
4598
|
liveAPIURL: i.endpoints.liveAPIURL
|
|
@@ -4573,10 +4612,10 @@ exports.BiometricsFailedError = Q, exports.BiometricsUnavailableError = B, expor
|
|
|
4573
4612
|
publicToken: e,
|
|
4574
4613
|
dataLayer: this._dataLayer,
|
|
4575
4614
|
networkClient: this._networkClient
|
|
4576
|
-
}, Object.assign(S, _defineProperty({},
|
|
4615
|
+
}, Object.assign(S, _defineProperty({}, hr, x));
|
|
4577
4616
|
}
|
|
4578
4617
|
return _createClass(_class);
|
|
4579
|
-
}(), exports.StytchSDKAPIError =
|
|
4618
|
+
}(), exports.StytchSDKAPIError = P, exports.StytchSDKError = R, exports.StytchSDKSchemaError = C, exports.StytchSDKUsageError = x, exports.UNRECOVERABLE_ERROR_TYPES = O, exports.UserCancellationError = U, exports.UserLockedOutError = K, exports.errorToStytchError = function (e) {
|
|
4580
4619
|
switch (e.message) {
|
|
4581
4620
|
case "internal_error":
|
|
4582
4621
|
return new F(e.message);
|
|
@@ -4592,13 +4631,13 @@ exports.BiometricsFailedError = Q, exports.BiometricsUnavailableError = B, expor
|
|
|
4592
4631
|
case "no_biometric_key":
|
|
4593
4632
|
return new L();
|
|
4594
4633
|
case "no_biometrics_enrolled":
|
|
4595
|
-
return new
|
|
4634
|
+
return new N();
|
|
4596
4635
|
case "keystore_unavailable":
|
|
4597
4636
|
return new M();
|
|
4598
4637
|
case "device_credentials_not_allowed":
|
|
4599
4638
|
return new q();
|
|
4600
4639
|
case "user_cancellation":
|
|
4601
|
-
return new
|
|
4640
|
+
return new U();
|
|
4602
4641
|
case "user_locked_out":
|
|
4603
4642
|
return new K();
|
|
4604
4643
|
case "google_onetap_missing_id_token":
|