@stytch/vanilla-js 3.2.1 → 3.2.2

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.
@@ -157,7 +157,7 @@ function s() {
157
157
  };
158
158
  }
159
159
  function h(e, t, r, n) {
160
- var i = t && t.prototype instanceof g ? t : g,
160
+ var i = t && t.prototype instanceof b ? t : b,
161
161
  s = Object.create(i.prototype),
162
162
  a = new D(n || []);
163
163
  return o(s, "_invoke", {
@@ -183,8 +183,8 @@ function s() {
183
183
  m = "executing",
184
184
  v = "completed",
185
185
  y = {};
186
- function g() {}
187
186
  function b() {}
187
+ function g() {}
188
188
  function k() {}
189
189
  var w = {};
190
190
  d(w, c, function () {
@@ -193,7 +193,7 @@ function s() {
193
193
  var S = Object.getPrototypeOf,
194
194
  A = S && S(S(I([])));
195
195
  A && A !== r && n.call(A, c) && (w = A);
196
- var T = k.prototype = g.prototype = Object.create(w);
196
+ var T = k.prototype = b.prototype = Object.create(w);
197
197
  function O(e) {
198
198
  ["next", "throw", "return"].forEach(function (t) {
199
199
  d(e, t, function (e) {
@@ -308,15 +308,15 @@ function s() {
308
308
  }
309
309
  throw new TypeError(i(t) + " is not iterable");
310
310
  }
311
- return b.prototype = k, o(T, "constructor", {
311
+ return g.prototype = k, o(T, "constructor", {
312
312
  value: k,
313
313
  configurable: !0
314
314
  }), o(k, "constructor", {
315
- value: b,
315
+ value: g,
316
316
  configurable: !0
317
- }), b.displayName = d(k, l, "GeneratorFunction"), t.isGeneratorFunction = function (e) {
317
+ }), g.displayName = d(k, l, "GeneratorFunction"), t.isGeneratorFunction = function (e) {
318
318
  var t = "function" == typeof e && e.constructor;
319
- return !!t && (t === b || "GeneratorFunction" === (t.displayName || t.name));
319
+ return !!t && (t === g || "GeneratorFunction" === (t.displayName || t.name));
320
320
  }, t.mark = function (e) {
321
321
  return Object.setPrototypeOf ? Object.setPrototypeOf(e, k) : (e.__proto__ = k, d(e, l, "GeneratorFunction")), e.prototype = Object.create(T), e;
322
322
  }, t.awrap = function (e) {
@@ -539,8 +539,8 @@ Object.defineProperty(exports, "__esModule", {
539
539
  });
540
540
  var v,
541
541
  y,
542
- g,
543
542
  b,
543
+ g,
544
544
  k,
545
545
  w,
546
546
  S = "https://accounts.google.com/gsi",
@@ -585,9 +585,9 @@ function O(e, t, r, n) {
585
585
  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";
586
586
  }(y || (y = {})), function (e) {
587
587
  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";
588
- }(g || (g = {})), function (e) {
589
- e.embedded = "embedded", e.floating = "floating";
590
588
  }(b || (b = {})), function (e) {
589
+ e.embedded = "embedded", e.floating = "floating";
590
+ }(g || (g = {})), function (e) {
591
591
  e.SMS = "sms", e.WhatsApp = "whatsapp", e.Email = "email";
592
592
  }(k || (k = {})), function (e) {
593
593
  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";
@@ -2224,11 +2224,11 @@ function ye(t) {
2224
2224
  }
2225
2225
  return btoa(n).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
2226
2226
  }
2227
- var ge = "copy",
2228
- be = "convert";
2227
+ var be = "copy",
2228
+ ge = "convert";
2229
2229
  function ke(e, r, n) {
2230
- if (r === ge) return n;
2231
- if (r === be) return e(n);
2230
+ if (r === be) return n;
2231
+ if (r === ge) return e(n);
2232
2232
  if (r instanceof Array) return n.map(function (t) {
2233
2233
  return ke(e, r[0], t);
2234
2234
  });
@@ -2266,47 +2266,47 @@ function Ae(e) {
2266
2266
  };
2267
2267
  }
2268
2268
  var Te = {
2269
- type: Se(ge),
2270
- id: Se(be),
2271
- transports: Ae(ge)
2269
+ type: Se(be),
2270
+ id: Se(ge),
2271
+ transports: Ae(be)
2272
2272
  },
2273
2273
  Oe = {
2274
- appid: Ae(ge),
2275
- appidExclude: Ae(ge),
2276
- credProps: Ae(ge)
2274
+ appid: Ae(be),
2275
+ appidExclude: Ae(be),
2276
+ credProps: Ae(be)
2277
2277
  },
2278
2278
  Ce = {
2279
- appid: Ae(ge),
2280
- appidExclude: Ae(ge),
2281
- credProps: Ae(ge)
2279
+ appid: Ae(be),
2280
+ appidExclude: Ae(be),
2281
+ credProps: Ae(be)
2282
2282
  },
2283
2283
  Ee = {
2284
2284
  publicKey: Se({
2285
- rp: Se(ge),
2285
+ rp: Se(be),
2286
2286
  user: Se({
2287
- id: Se(be),
2288
- name: Se(ge),
2289
- displayName: Se(ge)
2287
+ id: Se(ge),
2288
+ name: Se(be),
2289
+ displayName: Se(be)
2290
2290
  }),
2291
- challenge: Se(be),
2292
- pubKeyCredParams: Se(ge),
2293
- timeout: Ae(ge),
2291
+ challenge: Se(ge),
2292
+ pubKeyCredParams: Se(be),
2293
+ timeout: Ae(be),
2294
2294
  excludeCredentials: Ae([Te]),
2295
- authenticatorSelection: Ae(ge),
2296
- attestation: Ae(ge),
2295
+ authenticatorSelection: Ae(be),
2296
+ attestation: Ae(be),
2297
2297
  extensions: Ae(Oe)
2298
2298
  }),
2299
- signal: Ae(ge)
2299
+ signal: Ae(be)
2300
2300
  },
2301
2301
  Pe = {
2302
- type: Se(ge),
2303
- id: Se(ge),
2304
- rawId: Se(be),
2305
- authenticatorAttachment: Ae(ge),
2302
+ type: Se(be),
2303
+ id: Se(be),
2304
+ rawId: Se(ge),
2305
+ authenticatorAttachment: Ae(be),
2306
2306
  response: Se({
2307
- clientDataJSON: Se(be),
2308
- attestationObject: Se(be),
2309
- transports: we(ge, function (e) {
2307
+ clientDataJSON: Se(ge),
2308
+ attestationObject: Se(ge),
2309
+ transports: we(be, function (e) {
2310
2310
  var t;
2311
2311
  return (null == (t = e.getTransports) ? void 0 : t.call(e)) || [];
2312
2312
  })
@@ -2316,27 +2316,27 @@ var Te = {
2316
2316
  })
2317
2317
  },
2318
2318
  xe = {
2319
- mediation: Ae(ge),
2319
+ mediation: Ae(be),
2320
2320
  publicKey: Se({
2321
- challenge: Se(be),
2322
- timeout: Ae(ge),
2323
- rpId: Ae(ge),
2321
+ challenge: Se(ge),
2322
+ timeout: Ae(be),
2323
+ rpId: Ae(be),
2324
2324
  allowCredentials: Ae([Te]),
2325
- userVerification: Ae(ge),
2325
+ userVerification: Ae(be),
2326
2326
  extensions: Ae(Oe)
2327
2327
  }),
2328
- signal: Ae(ge)
2328
+ signal: Ae(be)
2329
2329
  },
2330
2330
  Re = {
2331
- type: Se(ge),
2332
- id: Se(ge),
2333
- rawId: Se(be),
2334
- authenticatorAttachment: Ae(ge),
2331
+ type: Se(be),
2332
+ id: Se(be),
2333
+ rawId: Se(ge),
2334
+ authenticatorAttachment: Ae(be),
2335
2335
  response: Se({
2336
- clientDataJSON: Se(be),
2337
- authenticatorData: Se(be),
2338
- signature: Se(be),
2339
- userHandle: Se(be)
2336
+ clientDataJSON: Se(ge),
2337
+ authenticatorData: Se(ge),
2338
+ signature: Se(ge),
2339
+ userHandle: Se(ge)
2340
2340
  }),
2341
2341
  clientExtensionResults: we(Ce, function (e) {
2342
2342
  return e.getClientExtensionResults();
@@ -3214,6 +3214,8 @@ var ze = /*#__PURE__*/function () {
3214
3214
  return _this3.call("oneTapStart", e);
3215
3215
  }, this.oneTapSubmit = function (e) {
3216
3216
  return _this3.call("oneTapSubmit", e);
3217
+ }, this.parsedPhoneNumber = function (e) {
3218
+ return _this3.call("parsedPhoneNumber", e);
3217
3219
  };
3218
3220
  }
3219
3221
  _createClass(ze, [{
@@ -3510,7 +3512,7 @@ var ht = /*#__PURE__*/function () {
3510
3512
  },
3511
3513
  sdk: {
3512
3514
  identifier: "Stytch.js Javascript SDK",
3513
- version: "3.2.1"
3515
+ version: "3.2.2"
3514
3516
  }
3515
3517
  });
3516
3518
  }
@@ -3962,17 +3964,17 @@ var yt = function yt(e) {
3962
3964
  }).length > 1;
3963
3965
  };
3964
3966
  /*! js-cookie v3.0.1 | MIT */
3965
- function gt(e) {
3967
+ function bt(e) {
3966
3968
  for (var t = 1; t < arguments.length; t++) {
3967
3969
  var r = arguments[t];
3968
3970
  for (var n in r) e[n] = r[n];
3969
3971
  }
3970
3972
  return e;
3971
3973
  }
3972
- var bt = function e(t, r) {
3974
+ var gt = function e(t, r) {
3973
3975
  function n(e, n, i) {
3974
3976
  if ("undefined" != typeof document) {
3975
- "number" == typeof (i = gt({}, 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);
3977
+ "number" == typeof (i = bt({}, 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);
3976
3978
  var s = "";
3977
3979
  for (var o in i) i[o] && (s += "; " + o, !0 !== i[o] && (s += "=" + i[o].split(";")[0]));
3978
3980
  return document.cookie = e + "=" + t.write(n, e) + s;
@@ -3994,15 +3996,15 @@ var bt = function e(t, r) {
3994
3996
  }
3995
3997
  },
3996
3998
  remove: function remove(e, t) {
3997
- n(e, "", gt({}, t, {
3999
+ n(e, "", bt({}, t, {
3998
4000
  expires: -1
3999
4001
  }));
4000
4002
  },
4001
4003
  withAttributes: function withAttributes(t) {
4002
- return e(this.converter, gt({}, this.attributes, t));
4004
+ return e(this.converter, bt({}, this.attributes, t));
4003
4005
  },
4004
4006
  withConverter: function withConverter(t) {
4005
- return e(gt({}, this.converter, t), this.attributes);
4007
+ return e(bt({}, this.converter, t), this.attributes);
4006
4008
  }
4007
4009
  }, {
4008
4010
  attributes: {
@@ -4073,14 +4075,14 @@ var wt = /*#__PURE__*/function () {
4073
4075
  key: "readSessionCookie",
4074
4076
  value: function readSessionCookie() {
4075
4077
  return {
4076
- session_token: bt.get(this.opaqueTokenCookieName),
4077
- session_jwt: bt.get(this.jwtCookieName)
4078
+ session_token: gt.get(this.opaqueTokenCookieName),
4079
+ session_jwt: gt.get(this.jwtCookieName)
4078
4080
  };
4079
4081
  }
4080
4082
  }, {
4081
4083
  key: "readIntermediateSessionTokenCookie",
4082
4084
  value: function readIntermediateSessionTokenCookie() {
4083
- return bt.get(this.istCookieName);
4085
+ return gt.get(this.istCookieName);
4084
4086
  }
4085
4087
  }, {
4086
4088
  key: "writeSessionCookie",
@@ -4095,14 +4097,14 @@ var wt = /*#__PURE__*/function () {
4095
4097
  path: this._cookiePath,
4096
4098
  domain: this._domain
4097
4099
  });
4098
- bt.set(this.opaqueTokenCookieName, o, c), bt.set(this.jwtCookieName, a, c);
4100
+ gt.set(this.opaqueTokenCookieName, o, c), gt.set(this.jwtCookieName, a, c);
4099
4101
  var u = wt.generateCookieOpts({
4100
4102
  expiresAt: null !== (i = null === (n = null == s ? void 0 : s.session) || void 0 === n ? void 0 : n.expires_at) && void 0 !== i ? i : "",
4101
4103
  availableToSubdomains: !this._cookieAvailableToSubdomains,
4102
4104
  path: this._cookiePath,
4103
4105
  domain: this._domain
4104
4106
  });
4105
- yt(this.jwtCookieName) && bt.remove(this.jwtCookieName, u), yt(this.opaqueTokenCookieName) && bt.remove(this.opaqueTokenCookieName, u), yt(this.jwtCookieName) && Q("Could not remove extraneous JWT cookie. This might happen if the cookie has been set using multiple `path` settings, and may produce unwanted behavior."), yt(this.opaqueTokenCookieName) && Q("Could not remove extraneous opaque token cookie.");
4107
+ yt(this.jwtCookieName) && gt.remove(this.jwtCookieName, u), yt(this.opaqueTokenCookieName) && gt.remove(this.opaqueTokenCookieName, u), yt(this.jwtCookieName) && Q("Could not remove extraneous JWT cookie. This might happen if the cookie has been set using multiple `path` settings, and may produce unwanted behavior."), yt(this.opaqueTokenCookieName) && Q("Could not remove extraneous opaque token cookie.");
4106
4108
  }
4107
4109
  }, {
4108
4110
  key: "writeIntermediateSessionTokenCookie",
@@ -4114,7 +4116,7 @@ var wt = /*#__PURE__*/function () {
4114
4116
  path: this._cookiePath,
4115
4117
  domain: this._domain
4116
4118
  });
4117
- bt.set(this.istCookieName, e, r);
4119
+ gt.set(this.istCookieName, e, r);
4118
4120
  }
4119
4121
  }, {
4120
4122
  key: "removeSessionCookie",
@@ -4140,7 +4142,7 @@ var wt = /*#__PURE__*/function () {
4140
4142
  domain: n
4141
4143
  });
4142
4144
  e.forEach(function (e) {
4143
- bt.remove(e, i);
4145
+ gt.remove(e, i);
4144
4146
  });
4145
4147
  });
4146
4148
  });
@@ -4375,17 +4377,17 @@ exports.SDKAPIUnreachableError = ot, exports.StytchHeadlessClient = /*#__PURE__*
4375
4377
  };
4376
4378
  });
4377
4379
  var y = new Ge(e, this._networkClient, this._dataLayer),
4378
- g = new Ye(y.getAsync()),
4379
- b = new se(e, s.endpoints.dfpBackendURL, y.getAsync(), g.executeRecaptcha),
4380
+ b = new Ye(y.getAsync()),
4381
+ g = new se(e, s.endpoints.dfpBackendURL, y.getAsync(), b.executeRecaptcha),
4380
4382
  k = new ze(s.endpoints.clientsideServicesIframeURL),
4381
4383
  w = new ft(e, k),
4382
4384
  S = new vt(this._networkClient);
4383
4385
  var A, T;
4384
- this.user = new ue(this._networkClient, this._subscriptionService), this.session = new le(this._networkClient, this._subscriptionService), this.magicLinks = new he(this._networkClient, this._subscriptionService, new mt(this._dataLayer, "magic_links"), v, y.getAsync(), b), this.otps = new pe(this._networkClient, this._subscriptionService, g.executeRecaptcha, b), this.oauth = new dt(this._networkClient, this._subscriptionService, new mt(this._dataLayer, "oauth"), y.getAsync(), {
4386
+ this.user = new ue(this._networkClient, this._subscriptionService), this.session = new le(this._networkClient, this._subscriptionService), this.magicLinks = new he(this._networkClient, this._subscriptionService, new mt(this._dataLayer, "magic_links"), v, y.getAsync(), g), this.otps = new pe(this._networkClient, this._subscriptionService, b.executeRecaptcha, g), this.oauth = new dt(this._networkClient, this._subscriptionService, new mt(this._dataLayer, "oauth"), y.getAsync(), {
4385
4387
  publicToken: e,
4386
4388
  testAPIURL: s.endpoints.testAPIURL,
4387
4389
  liveAPIURL: s.endpoints.liveAPIURL
4388
- }, w), this.cryptoWallets = new _e(this._networkClient, this._subscriptionService, g.executeRecaptcha, b), this.totps = new me(this._networkClient, this._subscriptionService, b), this.webauthn = new Me(this._networkClient, this._subscriptionService, b), this.passwords = new Ke(this._networkClient, this._subscriptionService, v, y.getAsync(), b), this._sessionManager = new We(this._subscriptionService, this.session), this._dataLayer.readSessionCookie().session_token && this._sessionManager.performBackgroundRefresh(), this._networkClient.logEvent({
4390
+ }, w), this.cryptoWallets = new _e(this._networkClient, this._subscriptionService, b.executeRecaptcha, g), this.totps = new me(this._networkClient, this._subscriptionService, g), this.webauthn = new Me(this._networkClient, this._subscriptionService, g), this.passwords = new Ke(this._networkClient, this._subscriptionService, v, y.getAsync(), g), this._sessionManager = new We(this._subscriptionService, this.session), this._dataLayer.readSessionCookie().session_token && this._sessionManager.performBackgroundRefresh(), this._networkClient.logEvent({
4389
4391
  name: "sdk_instance_instantiated",
4390
4392
  details: {
4391
4393
  event_callback_registered: !1,
@@ -4395,7 +4397,7 @@ exports.SDKAPIUnreachableError = ot, exports.StytchHeadlessClient = /*#__PURE__*
4395
4397
  }), A = this, T = {
4396
4398
  bootstrap: y,
4397
4399
  clientsideServices: k,
4398
- captcha: g,
4400
+ captcha: b,
4399
4401
  oneTap: w,
4400
4402
  searchManager: S,
4401
4403
  publicToken: e,