@firebase/auth 1.2.0 → 1.3.0-canary.0ae010ef2

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.
Files changed (39) hide show
  1. package/dist/browser-cjs/{index-5590c19e.js → index-77c7acd1.js} +2 -2
  2. package/dist/browser-cjs/{index-5590c19e.js.map → index-77c7acd1.js.map} +1 -1
  3. package/dist/browser-cjs/index.js +1 -1
  4. package/dist/browser-cjs/index.rn.d.ts +11 -3
  5. package/dist/browser-cjs/internal.js +1 -1
  6. package/dist/cordova/index.js +2 -2
  7. package/dist/cordova/index.rn.d.ts +11 -3
  8. package/dist/cordova/internal.js +2 -2
  9. package/dist/cordova/{popup_redirect-bbfe516d.js → popup_redirect-378dee5d.js} +2 -2
  10. package/dist/cordova/{popup_redirect-bbfe516d.js.map → popup_redirect-378dee5d.js.map} +1 -1
  11. package/dist/esm2017/{index-81415345.js → index-8ae48e33.js} +2 -2
  12. package/dist/esm2017/{index-81415345.js.map → index-8ae48e33.js.map} +1 -1
  13. package/dist/esm2017/index.js +1 -1
  14. package/dist/esm2017/index.rn.d.ts +11 -3
  15. package/dist/esm2017/internal.js +2 -2
  16. package/dist/esm5/{index-2e0f742b.js → index-24e45e55.js} +2 -2
  17. package/dist/esm5/{index-2e0f742b.js.map → index-24e45e55.js.map} +1 -1
  18. package/dist/esm5/index.js +1 -1
  19. package/dist/esm5/index.rn.d.ts +11 -3
  20. package/dist/esm5/internal.js +2 -2
  21. package/dist/index.rn.d.ts +11 -3
  22. package/dist/index.webworker.esm5.js +1 -1
  23. package/dist/node/index.js +1 -1
  24. package/dist/node/index.rn.d.ts +11 -3
  25. package/dist/node/internal.js +1 -1
  26. package/dist/node/{totp-d1683767.js → totp-55649440.js} +2 -2
  27. package/dist/node/{totp-d1683767.js.map → totp-55649440.js.map} +1 -1
  28. package/dist/node-esm/index.js +1 -1
  29. package/dist/node-esm/index.rn.d.ts +11 -3
  30. package/dist/node-esm/internal.js +2 -2
  31. package/dist/node-esm/{totp-fafe3607.js → totp-4aedda59.js} +2 -2
  32. package/dist/node-esm/{totp-fafe3607.js.map → totp-4aedda59.js.map} +1 -1
  33. package/dist/rn/{phone-13539df0.js → index-dad0301e.js} +5 -4
  34. package/dist/rn/{phone-13539df0.js.map → index-dad0301e.js.map} +1 -1
  35. package/dist/rn/index.js +90 -80
  36. package/dist/rn/index.js.map +1 -1
  37. package/dist/rn/index.rn.d.ts +11 -3
  38. package/dist/rn/internal.js +198 -198
  39. package/package.json +18 -13
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var phone = require('./phone-13539df0.js');
5
+ var index = require('./index-dad0301e.js');
6
6
  var tslib = require('tslib');
7
7
  var util = require('@firebase/util');
8
8
  var app = require('@firebase/app');
@@ -38,8 +38,8 @@ var BrowserPersistenceClass = /** @class */ (function () {
38
38
  if (!this.storage) {
39
39
  return Promise.resolve(false);
40
40
  }
41
- this.storage.setItem(phone.STORAGE_AVAILABLE_KEY, '1');
42
- this.storage.removeItem(phone.STORAGE_AVAILABLE_KEY);
41
+ this.storage.setItem(index.STORAGE_AVAILABLE_KEY, '1');
42
+ this.storage.removeItem(index.STORAGE_AVAILABLE_KEY);
43
43
  return Promise.resolve(true);
44
44
  }
45
45
  catch (_a) {
@@ -86,7 +86,7 @@ var BrowserPersistenceClass = /** @class */ (function () {
86
86
  */
87
87
  function _iframeCannotSyncWebStorage() {
88
88
  var ua = util.getUA();
89
- return phone._isSafari(ua) || phone._isIOS(ua);
89
+ return index._isSafari(ua) || index._isIOS(ua);
90
90
  }
91
91
  // The polling period in case events are not supported
92
92
  var _POLLING_INTERVAL_MS$1 = 1000;
@@ -103,9 +103,9 @@ var BrowserLocalPersistence = /** @class */ (function (_super) {
103
103
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
104
104
  _this.pollTimer = null;
105
105
  // Safari or iOS browser and embedded in an iframe.
106
- _this.safariLocalStorageNotSynced = _iframeCannotSyncWebStorage() && phone._isIframe();
106
+ _this.safariLocalStorageNotSynced = _iframeCannotSyncWebStorage() && index._isIframe();
107
107
  // Whether to use polling instead of depending on window events
108
- _this.fallbackToPolling = phone._isMobileBrowser();
108
+ _this.fallbackToPolling = index._isMobileBrowser();
109
109
  _this._shouldAllowMigration = true;
110
110
  return _this;
111
111
  }
@@ -179,7 +179,7 @@ var BrowserLocalPersistence = /** @class */ (function (_super) {
179
179
  _this.notifyListeners(key, storedValue);
180
180
  };
181
181
  var storedValue = this.storage.getItem(key);
182
- if (phone._isIE10() &&
182
+ if (index._isIE10() &&
183
183
  storedValue !== event.newValue &&
184
184
  event.newValue !== event.oldValue) {
185
185
  // IE 10 has this weird bug where a storage event would trigger with the
@@ -874,7 +874,7 @@ var IndexedDBLocalPersistence = /** @class */ (function () {
874
874
  IndexedDBLocalPersistence.prototype.initializeServiceWorkerMessaging = function () {
875
875
  return tslib.__awaiter(this, void 0, void 0, function () {
876
876
  return tslib.__generator(this, function (_a) {
877
- return [2 /*return*/, phone._isWorker() ? this.initializeReceiver() : this.initializeSender()];
877
+ return [2 /*return*/, index._isWorker() ? this.initializeReceiver() : this.initializeSender()];
878
878
  });
879
879
  });
880
880
  };
@@ -885,7 +885,7 @@ var IndexedDBLocalPersistence = /** @class */ (function () {
885
885
  return tslib.__awaiter(this, void 0, void 0, function () {
886
886
  var _this = this;
887
887
  return tslib.__generator(this, function (_a) {
888
- this.receiver = Receiver._getInstance(phone._getWorkerGlobalScope());
888
+ this.receiver = Receiver._getInstance(index._getWorkerGlobalScope());
889
889
  // Refresh from persistence if we receive a KeyChanged message.
890
890
  this.receiver._subscribe("keyChanged" /* _EventType.KEY_CHANGED */, function (_origin, data) { return tslib.__awaiter(_this, void 0, void 0, function () {
891
891
  var keys;
@@ -926,7 +926,7 @@ var IndexedDBLocalPersistence = /** @class */ (function () {
926
926
  case 0:
927
927
  // Check to see if there's an active service worker.
928
928
  _c = this;
929
- return [4 /*yield*/, phone._getActiveServiceWorker()];
929
+ return [4 /*yield*/, index._getActiveServiceWorker()];
930
930
  case 1:
931
931
  // Check to see if there's an active service worker.
932
932
  _c.activeServiceWorker = _d.sent();
@@ -965,7 +965,7 @@ var IndexedDBLocalPersistence = /** @class */ (function () {
965
965
  case 0:
966
966
  if (!this.sender ||
967
967
  !this.activeServiceWorker ||
968
- phone._getServiceWorkerController() !== this.activeServiceWorker) {
968
+ index._getServiceWorkerController() !== this.activeServiceWorker) {
969
969
  return [2 /*return*/];
970
970
  }
971
971
  _b.label = 1;
@@ -1000,10 +1000,10 @@ var IndexedDBLocalPersistence = /** @class */ (function () {
1000
1000
  return [4 /*yield*/, _openDatabase()];
1001
1001
  case 1:
1002
1002
  db = _b.sent();
1003
- return [4 /*yield*/, _putObject(db, phone.STORAGE_AVAILABLE_KEY, '1')];
1003
+ return [4 /*yield*/, _putObject(db, index.STORAGE_AVAILABLE_KEY, '1')];
1004
1004
  case 2:
1005
1005
  _b.sent();
1006
- return [4 /*yield*/, _deleteObject(db, phone.STORAGE_AVAILABLE_KEY)];
1006
+ return [4 /*yield*/, _deleteObject(db, index.STORAGE_AVAILABLE_KEY)];
1007
1007
  case 3:
1008
1008
  _b.sent();
1009
1009
  return [2 /*return*/, true];
@@ -1208,9 +1208,9 @@ var indexedDBLocalPersistence = IndexedDBLocalPersistence;
1208
1208
  */
1209
1209
  function _withDefaultResolver(auth, resolverOverride) {
1210
1210
  if (resolverOverride) {
1211
- return phone._getInstance(resolverOverride);
1211
+ return index._getInstance(resolverOverride);
1212
1212
  }
1213
- phone._assert(auth._popupRedirectResolver, auth, "argument-error" /* AuthErrorCode.ARGUMENT_ERROR */);
1213
+ index._assert(auth._popupRedirectResolver, auth, "argument-error" /* AuthErrorCode.ARGUMENT_ERROR */);
1214
1214
  return auth._popupRedirectResolver;
1215
1215
  }
1216
1216
 
@@ -1238,13 +1238,13 @@ var IdpCredential = /** @class */ (function (_super) {
1238
1238
  return _this;
1239
1239
  }
1240
1240
  IdpCredential.prototype._getIdTokenResponse = function (auth) {
1241
- return phone.signInWithIdp(auth, this._buildIdpRequest());
1241
+ return index.signInWithIdp(auth, this._buildIdpRequest());
1242
1242
  };
1243
1243
  IdpCredential.prototype._linkToIdToken = function (auth, idToken) {
1244
- return phone.signInWithIdp(auth, this._buildIdpRequest(idToken));
1244
+ return index.signInWithIdp(auth, this._buildIdpRequest(idToken));
1245
1245
  };
1246
1246
  IdpCredential.prototype._getReauthenticationResolver = function (auth) {
1247
- return phone.signInWithIdp(auth, this._buildIdpRequest());
1247
+ return index.signInWithIdp(auth, this._buildIdpRequest());
1248
1248
  };
1249
1249
  IdpCredential.prototype._buildIdpRequest = function (idToken) {
1250
1250
  var request = {
@@ -1262,22 +1262,22 @@ var IdpCredential = /** @class */ (function (_super) {
1262
1262
  return request;
1263
1263
  };
1264
1264
  return IdpCredential;
1265
- }(phone.AuthCredential));
1265
+ }(index.AuthCredential));
1266
1266
  function _signIn(params) {
1267
- return phone._signInWithCredential(params.auth, new IdpCredential(params), params.bypassAuthState);
1267
+ return index._signInWithCredential(params.auth, new IdpCredential(params), params.bypassAuthState);
1268
1268
  }
1269
1269
  function _reauth(params) {
1270
1270
  var auth = params.auth, user = params.user;
1271
- phone._assert(user, auth, "internal-error" /* AuthErrorCode.INTERNAL_ERROR */);
1272
- return phone._reauthenticate(user, new IdpCredential(params), params.bypassAuthState);
1271
+ index._assert(user, auth, "internal-error" /* AuthErrorCode.INTERNAL_ERROR */);
1272
+ return index._reauthenticate(user, new IdpCredential(params), params.bypassAuthState);
1273
1273
  }
1274
1274
  function _link(params) {
1275
1275
  return tslib.__awaiter(this, void 0, void 0, function () {
1276
1276
  var auth, user;
1277
1277
  return tslib.__generator(this, function (_a) {
1278
1278
  auth = params.auth, user = params.user;
1279
- phone._assert(user, auth, "internal-error" /* AuthErrorCode.INTERNAL_ERROR */);
1280
- return [2 /*return*/, phone._link(user, new IdpCredential(params), params.bypassAuthState)];
1279
+ index._assert(user, auth, "internal-error" /* AuthErrorCode.INTERNAL_ERROR */);
1280
+ return [2 /*return*/, index._link(user, new IdpCredential(params), params.bypassAuthState)];
1281
1281
  });
1282
1282
  });
1283
1283
  }
@@ -1394,16 +1394,16 @@ var AbstractPopupRedirectOperation = /** @class */ (function () {
1394
1394
  case "reauthViaRedirect" /* AuthEventType.REAUTH_VIA_REDIRECT */:
1395
1395
  return _reauth;
1396
1396
  default:
1397
- phone._fail(this.auth, "internal-error" /* AuthErrorCode.INTERNAL_ERROR */);
1397
+ index._fail(this.auth, "internal-error" /* AuthErrorCode.INTERNAL_ERROR */);
1398
1398
  }
1399
1399
  };
1400
1400
  AbstractPopupRedirectOperation.prototype.resolve = function (cred) {
1401
- phone.debugAssert(this.pendingPromise, 'Pending promise was never set');
1401
+ index.debugAssert(this.pendingPromise, 'Pending promise was never set');
1402
1402
  this.pendingPromise.resolve(cred);
1403
1403
  this.unregisterAndCleanUp();
1404
1404
  };
1405
1405
  AbstractPopupRedirectOperation.prototype.reject = function (error) {
1406
- phone.debugAssert(this.pendingPromise, 'Pending promise was never set');
1406
+ index.debugAssert(this.pendingPromise, 'Pending promise was never set');
1407
1407
  this.pendingPromise.reject(error);
1408
1408
  this.unregisterAndCleanUp();
1409
1409
  };
@@ -1433,7 +1433,7 @@ var AbstractPopupRedirectOperation = /** @class */ (function () {
1433
1433
  * See the License for the specific language governing permissions and
1434
1434
  * limitations under the License.
1435
1435
  */
1436
- var _POLL_WINDOW_CLOSE_TIMEOUT = new phone.Delay(2000, 10000);
1436
+ var _POLL_WINDOW_CLOSE_TIMEOUT = new index.Delay(2000, 10000);
1437
1437
  /**
1438
1438
  * Authenticates a Firebase client using a popup-based OAuth authentication flow.
1439
1439
  *
@@ -1468,8 +1468,8 @@ function signInWithPopup(auth, provider, resolver) {
1468
1468
  return tslib.__awaiter(this, void 0, void 0, function () {
1469
1469
  var authInternal, resolverInternal, action;
1470
1470
  return tslib.__generator(this, function (_a) {
1471
- authInternal = phone._castAuth(auth);
1472
- phone._assertInstanceOf(auth, provider, phone.FederatedAuthProvider);
1471
+ authInternal = index._castAuth(auth);
1472
+ index._assertInstanceOf(auth, provider, index.FederatedAuthProvider);
1473
1473
  resolverInternal = _withDefaultResolver(authInternal, resolver);
1474
1474
  action = new PopupOperation(authInternal, "signInViaPopup" /* AuthEventType.SIGN_IN_VIA_POPUP */, provider, resolverInternal);
1475
1475
  return [2 /*return*/, action.executeNotNull()];
@@ -1508,7 +1508,7 @@ function reauthenticateWithPopup(user, provider, resolver) {
1508
1508
  var userInternal, resolverInternal, action;
1509
1509
  return tslib.__generator(this, function (_a) {
1510
1510
  userInternal = util.getModularInstance(user);
1511
- phone._assertInstanceOf(userInternal.auth, provider, phone.FederatedAuthProvider);
1511
+ index._assertInstanceOf(userInternal.auth, provider, index.FederatedAuthProvider);
1512
1512
  resolverInternal = _withDefaultResolver(userInternal.auth, resolver);
1513
1513
  action = new PopupOperation(userInternal.auth, "reauthViaPopup" /* AuthEventType.REAUTH_VIA_POPUP */, provider, resolverInternal, userInternal);
1514
1514
  return [2 /*return*/, action.executeNotNull()];
@@ -1545,7 +1545,7 @@ function linkWithPopup(user, provider, resolver) {
1545
1545
  var userInternal, resolverInternal, action;
1546
1546
  return tslib.__generator(this, function (_a) {
1547
1547
  userInternal = util.getModularInstance(user);
1548
- phone._assertInstanceOf(userInternal.auth, provider, phone.FederatedAuthProvider);
1548
+ index._assertInstanceOf(userInternal.auth, provider, index.FederatedAuthProvider);
1549
1549
  resolverInternal = _withDefaultResolver(userInternal.auth, resolver);
1550
1550
  action = new PopupOperation(userInternal.auth, "linkViaPopup" /* AuthEventType.LINK_VIA_POPUP */, provider, resolverInternal, userInternal);
1551
1551
  return [2 /*return*/, action.executeNotNull()];
@@ -1578,7 +1578,7 @@ var PopupOperation = /** @class */ (function (_super) {
1578
1578
  case 0: return [4 /*yield*/, this.execute()];
1579
1579
  case 1:
1580
1580
  result = _a.sent();
1581
- phone._assert(result, this.auth, "internal-error" /* AuthErrorCode.INTERNAL_ERROR */);
1581
+ index._assert(result, this.auth, "internal-error" /* AuthErrorCode.INTERNAL_ERROR */);
1582
1582
  return [2 /*return*/, result];
1583
1583
  }
1584
1584
  });
@@ -1591,7 +1591,7 @@ var PopupOperation = /** @class */ (function (_super) {
1591
1591
  return tslib.__generator(this, function (_b) {
1592
1592
  switch (_b.label) {
1593
1593
  case 0:
1594
- phone.debugAssert(this.filter.length === 1, 'Popup operations only handle one event');
1594
+ index.debugAssert(this.filter.length === 1, 'Popup operations only handle one event');
1595
1595
  eventId = _generateEventId();
1596
1596
  _a = this;
1597
1597
  return [4 /*yield*/, this.resolver._openPopup(this.auth, this.provider, this.filter[0], // There's always one, see constructor
@@ -1611,7 +1611,7 @@ var PopupOperation = /** @class */ (function (_super) {
1611
1611
  });
1612
1612
  this.resolver._isIframeWebStorageSupported(this.auth, function (isSupported) {
1613
1613
  if (!isSupported) {
1614
- _this.reject(phone._createError(_this.auth, "web-storage-unsupported" /* AuthErrorCode.WEB_STORAGE_UNSUPPORTED */));
1614
+ _this.reject(index._createError(_this.auth, "web-storage-unsupported" /* AuthErrorCode.WEB_STORAGE_UNSUPPORTED */));
1615
1615
  }
1616
1616
  });
1617
1617
  // Handle user closure. Notice this does *not* use await
@@ -1630,7 +1630,7 @@ var PopupOperation = /** @class */ (function (_super) {
1630
1630
  configurable: true
1631
1631
  });
1632
1632
  PopupOperation.prototype.cancel = function () {
1633
- this.reject(phone._createError(this.auth, "cancelled-popup-request" /* AuthErrorCode.EXPIRED_POPUP_REQUEST */));
1633
+ this.reject(index._createError(this.auth, "cancelled-popup-request" /* AuthErrorCode.EXPIRED_POPUP_REQUEST */));
1634
1634
  };
1635
1635
  PopupOperation.prototype.cleanUp = function () {
1636
1636
  if (this.authWindow) {
@@ -1655,7 +1655,7 @@ var PopupOperation = /** @class */ (function (_super) {
1655
1655
  // helper closes the popup.
1656
1656
  _this.pollId = window.setTimeout(function () {
1657
1657
  _this.pollId = null;
1658
- _this.reject(phone._createError(_this.auth, "popup-closed-by-user" /* AuthErrorCode.POPUP_CLOSED_BY_USER */));
1658
+ _this.reject(index._createError(_this.auth, "popup-closed-by-user" /* AuthErrorCode.POPUP_CLOSED_BY_USER */));
1659
1659
  }, 8000 /* _Timeout.AUTH_EVENT */);
1660
1660
  return;
1661
1661
  }
@@ -1827,10 +1827,10 @@ function _overrideRedirectResult(auth, result) {
1827
1827
  redirectOutcomeMap.set(auth._key(), result);
1828
1828
  }
1829
1829
  function resolverPersistence(resolver) {
1830
- return phone._getInstance(resolver._redirectPersistence);
1830
+ return index._getInstance(resolver._redirectPersistence);
1831
1831
  }
1832
1832
  function pendingRedirectKey(auth) {
1833
- return phone._persistenceKeyName(PENDING_REDIRECT_KEY, auth.config.apiKey, auth.name);
1833
+ return index._persistenceKeyName(PENDING_REDIRECT_KEY, auth.config.apiKey, auth.name);
1834
1834
  }
1835
1835
 
1836
1836
  /**
@@ -1901,8 +1901,8 @@ function _signInWithRedirect(auth, provider, resolver) {
1901
1901
  return tslib.__generator(this, function (_a) {
1902
1902
  switch (_a.label) {
1903
1903
  case 0:
1904
- authInternal = phone._castAuth(auth);
1905
- phone._assertInstanceOf(auth, provider, phone.FederatedAuthProvider);
1904
+ authInternal = index._castAuth(auth);
1905
+ index._assertInstanceOf(auth, provider, index.FederatedAuthProvider);
1906
1906
  // Wait for auth initialization to complete, this will process pending redirects and clear the
1907
1907
  // PENDING_REDIRECT_KEY in persistence. This should be completed before starting a new
1908
1908
  // redirect and creating a PENDING_REDIRECT_KEY entry.
@@ -1965,7 +1965,7 @@ function _reauthenticateWithRedirect(user, provider, resolver) {
1965
1965
  switch (_a.label) {
1966
1966
  case 0:
1967
1967
  userInternal = util.getModularInstance(user);
1968
- phone._assertInstanceOf(userInternal.auth, provider, phone.FederatedAuthProvider);
1968
+ index._assertInstanceOf(userInternal.auth, provider, index.FederatedAuthProvider);
1969
1969
  // Wait for auth initialization to complete, this will process pending redirects and clear the
1970
1970
  // PENDING_REDIRECT_KEY in persistence. This should be completed before starting a new
1971
1971
  // redirect and creating a PENDING_REDIRECT_KEY entry.
@@ -2027,7 +2027,7 @@ function _linkWithRedirect(user, provider, resolver) {
2027
2027
  switch (_a.label) {
2028
2028
  case 0:
2029
2029
  userInternal = util.getModularInstance(user);
2030
- phone._assertInstanceOf(userInternal.auth, provider, phone.FederatedAuthProvider);
2030
+ index._assertInstanceOf(userInternal.auth, provider, index.FederatedAuthProvider);
2031
2031
  // Wait for auth initialization to complete, this will process pending redirects and clear the
2032
2032
  // PENDING_REDIRECT_KEY in persistence. This should be completed before starting a new
2033
2033
  // redirect and creating a PENDING_REDIRECT_KEY entry.
@@ -2038,7 +2038,7 @@ function _linkWithRedirect(user, provider, resolver) {
2038
2038
  // redirect and creating a PENDING_REDIRECT_KEY entry.
2039
2039
  _a.sent();
2040
2040
  resolverInternal = _withDefaultResolver(userInternal.auth, resolver);
2041
- return [4 /*yield*/, phone._assertLinkedStatus(false, userInternal, provider.providerId)];
2041
+ return [4 /*yield*/, index._assertLinkedStatus(false, userInternal, provider.providerId)];
2042
2042
  case 2:
2043
2043
  _a.sent();
2044
2044
  return [4 /*yield*/, _setPendingRedirectStatus(resolverInternal, userInternal.auth)];
@@ -2096,7 +2096,7 @@ function getRedirectResult(auth, resolver) {
2096
2096
  return tslib.__awaiter(this, void 0, void 0, function () {
2097
2097
  return tslib.__generator(this, function (_a) {
2098
2098
  switch (_a.label) {
2099
- case 0: return [4 /*yield*/, phone._castAuth(auth)._initializationPromise];
2099
+ case 0: return [4 /*yield*/, index._castAuth(auth)._initializationPromise];
2100
2100
  case 1:
2101
2101
  _a.sent();
2102
2102
  return [2 /*return*/, _getRedirectResult(auth, resolver, false)];
@@ -2111,7 +2111,7 @@ function _getRedirectResult(auth, resolverExtern, bypassAuthState) {
2111
2111
  return tslib.__generator(this, function (_a) {
2112
2112
  switch (_a.label) {
2113
2113
  case 0:
2114
- authInternal = phone._castAuth(auth);
2114
+ authInternal = index._castAuth(auth);
2115
2115
  resolver = _withDefaultResolver(authInternal, resolverExtern);
2116
2116
  action = new RedirectAction(authInternal, resolver, bypassAuthState);
2117
2117
  return [4 /*yield*/, action.execute()];
@@ -2223,7 +2223,7 @@ var AuthEventManager = /** @class */ (function () {
2223
2223
  if (event.error && !isNullRedirectEvent(event)) {
2224
2224
  var code = ((_a = event.error.code) === null || _a === void 0 ? void 0 : _a.split('auth/')[1]) ||
2225
2225
  "internal-error" /* AuthErrorCode.INTERNAL_ERROR */;
2226
- consumer.onError(phone._createError(this.auth, code));
2226
+ consumer.onError(index._createError(this.auth, code));
2227
2227
  }
2228
2228
  else {
2229
2229
  consumer.onAuthEvent(event);
@@ -2288,7 +2288,7 @@ function _getProjectConfig(auth, request) {
2288
2288
  if (request === void 0) { request = {}; }
2289
2289
  return tslib.__awaiter(this, void 0, void 0, function () {
2290
2290
  return tslib.__generator(this, function (_a) {
2291
- return [2 /*return*/, phone._performApiRequest(auth, "GET" /* HttpMethod.GET */, "/v1/projects" /* Endpoint.GET_PROJECT_CONFIG */, request)];
2291
+ return [2 /*return*/, index._performApiRequest(auth, "GET" /* HttpMethod.GET */, "/v1/projects" /* Endpoint.GET_PROJECT_CONFIG */, request)];
2292
2292
  });
2293
2293
  });
2294
2294
  }
@@ -2336,14 +2336,14 @@ function _validateOrigin$1(auth) {
2336
2336
  }
2337
2337
  }
2338
2338
  // In the old SDK, this error also provides helpful messages.
2339
- phone._fail(auth, "unauthorized-domain" /* AuthErrorCode.INVALID_ORIGIN */);
2339
+ index._fail(auth, "unauthorized-domain" /* AuthErrorCode.INVALID_ORIGIN */);
2340
2340
  return [2 /*return*/];
2341
2341
  }
2342
2342
  });
2343
2343
  });
2344
2344
  }
2345
2345
  function matchDomain(expected) {
2346
- var currentUrl = phone._getCurrentUrl();
2346
+ var currentUrl = index._getCurrentUrl();
2347
2347
  var _a = new URL(currentUrl), protocol = _a.protocol, hostname = _a.hostname;
2348
2348
  if (expected.startsWith('chrome-extension://')) {
2349
2349
  var ceUrl = new URL(expected);
@@ -2387,7 +2387,7 @@ function matchDomain(expected) {
2387
2387
  * See the License for the specific language governing permissions and
2388
2388
  * limitations under the License.
2389
2389
  */
2390
- var NETWORK_TIMEOUT = new phone.Delay(30000, 60000);
2390
+ var NETWORK_TIMEOUT = new index.Delay(30000, 60000);
2391
2391
  /**
2392
2392
  * Reset unlaoded GApi modules. If gapi.load fails due to a network error,
2393
2393
  * it will stop working after a retrial. This is a hack to fix this issue.
@@ -2396,7 +2396,7 @@ function resetUnloadedGapiModules() {
2396
2396
  // Clear last failed gapi.load state to force next gapi.load to first
2397
2397
  // load the failed gapi.iframes module.
2398
2398
  // Get gapix.beacon context.
2399
- var beacon = phone._window().___jsl;
2399
+ var beacon = index._window().___jsl;
2400
2400
  // Get current hint.
2401
2401
  if (beacon === null || beacon === void 0 ? void 0 : beacon.H) {
2402
2402
  // Get gapi hint.
@@ -2438,16 +2438,16 @@ function loadGapi(auth) {
2438
2438
  // failed attempt.
2439
2439
  // Timeout when gapi.iframes.Iframe not loaded.
2440
2440
  resetUnloadedGapiModules();
2441
- reject(phone._createError(auth, "network-request-failed" /* AuthErrorCode.NETWORK_REQUEST_FAILED */));
2441
+ reject(index._createError(auth, "network-request-failed" /* AuthErrorCode.NETWORK_REQUEST_FAILED */));
2442
2442
  },
2443
2443
  timeout: NETWORK_TIMEOUT.get()
2444
2444
  });
2445
2445
  }
2446
- if ((_b = (_a = phone._window().gapi) === null || _a === void 0 ? void 0 : _a.iframes) === null || _b === void 0 ? void 0 : _b.Iframe) {
2446
+ if ((_b = (_a = index._window().gapi) === null || _a === void 0 ? void 0 : _a.iframes) === null || _b === void 0 ? void 0 : _b.Iframe) {
2447
2447
  // If gapi.iframes.Iframe available, resolve.
2448
2448
  resolve(gapi.iframes.getContext());
2449
2449
  }
2450
- else if (!!((_c = phone._window().gapi) === null || _c === void 0 ? void 0 : _c.load)) {
2450
+ else if (!!((_c = index._window().gapi) === null || _c === void 0 ? void 0 : _c.load)) {
2451
2451
  // Gapi loader ready, load gapi.iframes.
2452
2452
  loadGapiIframe();
2453
2453
  }
@@ -2457,20 +2457,20 @@ function loadGapi(auth) {
2457
2457
  // multiple times in parallel and could result in the later callback
2458
2458
  // overwriting the previous one. This would end up with a iframe
2459
2459
  // timeout.
2460
- var cbName = phone._generateCallbackName('iframefcb');
2460
+ var cbName = index._generateCallbackName('iframefcb');
2461
2461
  // GApi loader not available, dynamically load platform.js.
2462
- phone._window()[cbName] = function () {
2462
+ index._window()[cbName] = function () {
2463
2463
  // GApi loader should be ready.
2464
2464
  if (!!gapi.load) {
2465
2465
  loadGapiIframe();
2466
2466
  }
2467
2467
  else {
2468
2468
  // Gapi loader failed, throw error.
2469
- reject(phone._createError(auth, "network-request-failed" /* AuthErrorCode.NETWORK_REQUEST_FAILED */));
2469
+ reject(index._createError(auth, "network-request-failed" /* AuthErrorCode.NETWORK_REQUEST_FAILED */));
2470
2470
  }
2471
2471
  };
2472
2472
  // Load GApi loader.
2473
- return phone._loadJS("https://apis.google.com/js/api.js?onload=".concat(cbName))
2473
+ return index._loadJS("https://apis.google.com/js/api.js?onload=".concat(cbName))
2474
2474
  .catch(function (e) { return reject(e); });
2475
2475
  }
2476
2476
  }).catch(function (error) {
@@ -2501,7 +2501,7 @@ function _loadGapi(auth) {
2501
2501
  * See the License for the specific language governing permissions and
2502
2502
  * limitations under the License.
2503
2503
  */
2504
- var PING_TIMEOUT = new phone.Delay(5000, 15000);
2504
+ var PING_TIMEOUT = new index.Delay(5000, 15000);
2505
2505
  var IFRAME_PATH = '__/auth/iframe';
2506
2506
  var EMULATED_IFRAME_PATH = 'emulator/auth/iframe';
2507
2507
  var IFRAME_ATTRIBUTES = {
@@ -2523,9 +2523,9 @@ var EID_FROM_APIHOST = new Map([
2523
2523
  ]);
2524
2524
  function getIframeUrl(auth) {
2525
2525
  var config = auth.config;
2526
- phone._assert(config.authDomain, auth, "auth-domain-config-required" /* AuthErrorCode.MISSING_AUTH_DOMAIN */);
2526
+ index._assert(config.authDomain, auth, "auth-domain-config-required" /* AuthErrorCode.MISSING_AUTH_DOMAIN */);
2527
2527
  var url = config.emulator
2528
- ? phone._emulatorUrl(config, EMULATED_IFRAME_PATH)
2528
+ ? index._emulatorUrl(config, EMULATED_IFRAME_PATH)
2529
2529
  : "https://".concat(auth.config.authDomain, "/").concat(IFRAME_PATH);
2530
2530
  var params = {
2531
2531
  apiKey: config.apiKey,
@@ -2551,8 +2551,8 @@ function _openIframe(auth) {
2551
2551
  case 0: return [4 /*yield*/, _loadGapi(auth)];
2552
2552
  case 1:
2553
2553
  context = _a.sent();
2554
- gapi = phone._window().gapi;
2555
- phone._assert(gapi, auth, "internal-error" /* AuthErrorCode.INTERNAL_ERROR */);
2554
+ gapi = index._window().gapi;
2555
+ index._assert(gapi, auth, "internal-error" /* AuthErrorCode.INTERNAL_ERROR */);
2556
2556
  return [2 /*return*/, context.open({
2557
2557
  where: document.body,
2558
2558
  url: getIframeUrl(auth),
@@ -2563,7 +2563,7 @@ function _openIframe(auth) {
2563
2563
  return new Promise(function (resolve, reject) { return tslib.__awaiter(_this, void 0, void 0, function () {
2564
2564
  // Clear timer and resolve pending iframe ready promise.
2565
2565
  function clearTimerAndResolve() {
2566
- phone._window().clearTimeout(networkErrorTimer);
2566
+ index._window().clearTimeout(networkErrorTimer);
2567
2567
  resolve(iframe);
2568
2568
  }
2569
2569
  var networkError, networkErrorTimer;
@@ -2575,8 +2575,8 @@ function _openIframe(auth) {
2575
2575
  })];
2576
2576
  case 1:
2577
2577
  _a.sent();
2578
- networkError = phone._createError(auth, "network-request-failed" /* AuthErrorCode.NETWORK_REQUEST_FAILED */);
2579
- networkErrorTimer = phone._window().setTimeout(function () {
2578
+ networkError = index._createError(auth, "network-request-failed" /* AuthErrorCode.NETWORK_REQUEST_FAILED */);
2579
+ networkErrorTimer = index._window().setTimeout(function () {
2580
2580
  reject(networkError);
2581
2581
  }, PING_TIMEOUT.get());
2582
2582
  // This returns an IThenable. However the reject part does not call
@@ -2646,9 +2646,9 @@ function _open(auth, url, name, width, height) {
2646
2646
  // specified, even though the popup is not necessarily blocked.
2647
2647
  var ua = util.getUA().toLowerCase();
2648
2648
  if (name) {
2649
- target = phone._isChromeIOS(ua) ? TARGET_BLANK : name;
2649
+ target = index._isChromeIOS(ua) ? TARGET_BLANK : name;
2650
2650
  }
2651
- if (phone._isFirefox(ua)) {
2651
+ if (index._isFirefox(ua)) {
2652
2652
  // Firefox complains when invalid URLs are popped out. Hacky way to bypass.
2653
2653
  url = url || FIREFOX_EMPTY_URL;
2654
2654
  // Firefox disables by default scrolling on popup windows, which can create
@@ -2659,14 +2659,14 @@ function _open(auth, url, name, width, height) {
2659
2659
  var key = _a[0], value = _a[1];
2660
2660
  return "".concat(accum).concat(key, "=").concat(value, ",");
2661
2661
  }, '');
2662
- if (phone._isIOSStandalone(ua) && target !== '_self') {
2662
+ if (index._isIOSStandalone(ua) && target !== '_self') {
2663
2663
  openAsNewWindowIOS(url || '', target);
2664
2664
  return new AuthPopup(null);
2665
2665
  }
2666
2666
  // about:blank getting sanitized causing browsers like IE/Edge to display
2667
2667
  // brief error message before redirecting to handler.
2668
2668
  var newWin = window.open(url || '', target, optionsString);
2669
- phone._assert(newWin, auth, "popup-blocked" /* AuthErrorCode.POPUP_BLOCKED */);
2669
+ index._assert(newWin, auth, "popup-blocked" /* AuthErrorCode.POPUP_BLOCKED */);
2670
2670
  // Flaky on IE edge, encapsulate with a try and catch.
2671
2671
  try {
2672
2672
  newWin.focus();
@@ -2723,8 +2723,8 @@ function _getRedirectUrl(auth, provider, authType, redirectUrl, eventId, additio
2723
2723
  return tslib.__generator(this, function (_e) {
2724
2724
  switch (_e.label) {
2725
2725
  case 0:
2726
- phone._assert(auth.config.authDomain, auth, "auth-domain-config-required" /* AuthErrorCode.MISSING_AUTH_DOMAIN */);
2727
- phone._assert(auth.config.apiKey, auth, "invalid-api-key" /* AuthErrorCode.INVALID_API_KEY */);
2726
+ index._assert(auth.config.authDomain, auth, "auth-domain-config-required" /* AuthErrorCode.MISSING_AUTH_DOMAIN */);
2727
+ index._assert(auth.config.apiKey, auth, "invalid-api-key" /* AuthErrorCode.INVALID_API_KEY */);
2728
2728
  params = {
2729
2729
  apiKey: auth.config.apiKey,
2730
2730
  appName: auth.name,
@@ -2733,7 +2733,7 @@ function _getRedirectUrl(auth, provider, authType, redirectUrl, eventId, additio
2733
2733
  v: app.SDK_VERSION,
2734
2734
  eventId: eventId
2735
2735
  };
2736
- if (provider instanceof phone.FederatedAuthProvider) {
2736
+ if (provider instanceof index.FederatedAuthProvider) {
2737
2737
  provider.setDefaultLanguage(auth.languageCode);
2738
2738
  params.providerId = provider.providerId || '';
2739
2739
  if (!util.isEmpty(provider.getCustomParameters())) {
@@ -2745,7 +2745,7 @@ function _getRedirectUrl(auth, provider, authType, redirectUrl, eventId, additio
2745
2745
  params[key] = value;
2746
2746
  }
2747
2747
  }
2748
- if (provider instanceof phone.BaseOAuthProvider) {
2748
+ if (provider instanceof index.BaseOAuthProvider) {
2749
2749
  scopes = provider.getScopes().filter(function (scope) { return scope !== ''; });
2750
2750
  if (scopes.length > 0) {
2751
2751
  params.scopes = scopes.join(',');
@@ -2778,7 +2778,7 @@ function getHandlerBase(_a) {
2778
2778
  if (!config.emulator) {
2779
2779
  return "https://".concat(config.authDomain, "/").concat(WIDGET_PATH);
2780
2780
  }
2781
- return phone._emulatorUrl(config, EMULATOR_WIDGET_PATH);
2781
+ return index._emulatorUrl(config, EMULATOR_WIDGET_PATH);
2782
2782
  }
2783
2783
 
2784
2784
  /**
@@ -2820,8 +2820,8 @@ var BrowserPopupRedirectResolver = /** @class */ (function () {
2820
2820
  return tslib.__generator(this, function (_b) {
2821
2821
  switch (_b.label) {
2822
2822
  case 0:
2823
- phone.debugAssert((_a = this.eventManagers[auth._key()]) === null || _a === void 0 ? void 0 : _a.manager, '_initialize() not called before _openPopup()');
2824
- return [4 /*yield*/, _getRedirectUrl(auth, provider, authType, phone._getCurrentUrl(), eventId)];
2823
+ index.debugAssert((_a = this.eventManagers[auth._key()]) === null || _a === void 0 ? void 0 : _a.manager, '_initialize() not called before _openPopup()');
2824
+ return [4 /*yield*/, _getRedirectUrl(auth, provider, authType, index._getCurrentUrl(), eventId)];
2825
2825
  case 1:
2826
2826
  url = _b.sent();
2827
2827
  return [2 /*return*/, _open(auth, url, _generateEventId())];
@@ -2837,10 +2837,10 @@ var BrowserPopupRedirectResolver = /** @class */ (function () {
2837
2837
  case 0: return [4 /*yield*/, this._originValidation(auth)];
2838
2838
  case 1:
2839
2839
  _a.sent();
2840
- return [4 /*yield*/, _getRedirectUrl(auth, provider, authType, phone._getCurrentUrl(), eventId)];
2840
+ return [4 /*yield*/, _getRedirectUrl(auth, provider, authType, index._getCurrentUrl(), eventId)];
2841
2841
  case 2:
2842
2842
  url = _a.sent();
2843
- phone._setWindowLocation(url);
2843
+ index._setWindowLocation(url);
2844
2844
  return [2 /*return*/, new Promise(function () { })];
2845
2845
  }
2846
2846
  });
@@ -2855,7 +2855,7 @@ var BrowserPopupRedirectResolver = /** @class */ (function () {
2855
2855
  return Promise.resolve(manager);
2856
2856
  }
2857
2857
  else {
2858
- phone.debugAssert(promise_1, 'If manager is not set, promise should be');
2858
+ index.debugAssert(promise_1, 'If manager is not set, promise should be');
2859
2859
  return promise_1;
2860
2860
  }
2861
2861
  }
@@ -2878,7 +2878,7 @@ var BrowserPopupRedirectResolver = /** @class */ (function () {
2878
2878
  iframe = _a.sent();
2879
2879
  manager = new AuthEventManager(auth);
2880
2880
  iframe.register('authEvent', function (iframeEvent) {
2881
- phone._assert(iframeEvent === null || iframeEvent === void 0 ? void 0 : iframeEvent.authEvent, auth, "invalid-auth-event" /* AuthErrorCode.INVALID_AUTH_EVENT */);
2881
+ index._assert(iframeEvent === null || iframeEvent === void 0 ? void 0 : iframeEvent.authEvent, auth, "invalid-auth-event" /* AuthErrorCode.INVALID_AUTH_EVENT */);
2882
2882
  // TODO: Consider splitting redirect and popup events earlier on
2883
2883
  var handled = manager.onEvent(iframeEvent.authEvent);
2884
2884
  return { status: handled ? "ACK" /* GapiOutcome.ACK */ : "ERROR" /* GapiOutcome.ERROR */ };
@@ -2898,7 +2898,7 @@ var BrowserPopupRedirectResolver = /** @class */ (function () {
2898
2898
  if (isSupported !== undefined) {
2899
2899
  cb(!!isSupported);
2900
2900
  }
2901
- phone._fail(auth, "internal-error" /* AuthErrorCode.INTERNAL_ERROR */);
2901
+ index._fail(auth, "internal-error" /* AuthErrorCode.INTERNAL_ERROR */);
2902
2902
  }, gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER);
2903
2903
  };
2904
2904
  BrowserPopupRedirectResolver.prototype._originValidation = function (auth) {
@@ -2911,7 +2911,7 @@ var BrowserPopupRedirectResolver = /** @class */ (function () {
2911
2911
  Object.defineProperty(BrowserPopupRedirectResolver.prototype, "_shouldInitProactively", {
2912
2912
  get: function () {
2913
2913
  // Mobile browsers and Safari need to optimistically initialize
2914
- return phone._isMobileBrowser() || phone._isSafari() || phone._isIOS();
2914
+ return index._isMobileBrowser() || index._isSafari() || index._isIOS();
2915
2915
  },
2916
2916
  enumerable: false,
2917
2917
  configurable: true
@@ -2979,8 +2979,8 @@ var TotpMultiFactorGenerator = /** @class */ (function () {
2979
2979
  switch (_b.label) {
2980
2980
  case 0:
2981
2981
  mfaSession = session;
2982
- phone._assert(typeof ((_a = mfaSession.user) === null || _a === void 0 ? void 0 : _a.auth) !== 'undefined', "internal-error" /* AuthErrorCode.INTERNAL_ERROR */);
2983
- return [4 /*yield*/, phone.startEnrollTotpMfa(mfaSession.user.auth, {
2982
+ index._assert(typeof ((_a = mfaSession.user) === null || _a === void 0 ? void 0 : _a.auth) !== 'undefined', "internal-error" /* AuthErrorCode.INTERNAL_ERROR */);
2983
+ return [4 /*yield*/, index.startEnrollTotpMfa(mfaSession.user.auth, {
2984
2984
  idToken: mfaSession.credential,
2985
2985
  totpEnrollmentInfo: {}
2986
2986
  })];
@@ -3018,8 +3018,8 @@ var TotpMultiFactorAssertionImpl = /** @class */ (function (_super) {
3018
3018
  TotpMultiFactorAssertionImpl.prototype._finalizeEnroll = function (auth, idToken, displayName) {
3019
3019
  return tslib.__awaiter(this, void 0, void 0, function () {
3020
3020
  return tslib.__generator(this, function (_a) {
3021
- phone._assert(typeof this.secret !== 'undefined', auth, "argument-error" /* AuthErrorCode.ARGUMENT_ERROR */);
3022
- return [2 /*return*/, phone.finalizeEnrollTotpMfa(auth, {
3021
+ index._assert(typeof this.secret !== 'undefined', auth, "argument-error" /* AuthErrorCode.ARGUMENT_ERROR */);
3022
+ return [2 /*return*/, index.finalizeEnrollTotpMfa(auth, {
3023
3023
  idToken: idToken,
3024
3024
  displayName: displayName,
3025
3025
  totpVerificationInfo: this.secret._makeTotpVerificationInfo(this.otp)
@@ -3032,9 +3032,9 @@ var TotpMultiFactorAssertionImpl = /** @class */ (function (_super) {
3032
3032
  return tslib.__awaiter(this, void 0, void 0, function () {
3033
3033
  var totpVerificationInfo;
3034
3034
  return tslib.__generator(this, function (_a) {
3035
- phone._assert(this.enrollmentId !== undefined && this.otp !== undefined, auth, "argument-error" /* AuthErrorCode.ARGUMENT_ERROR */);
3035
+ index._assert(this.enrollmentId !== undefined && this.otp !== undefined, auth, "argument-error" /* AuthErrorCode.ARGUMENT_ERROR */);
3036
3036
  totpVerificationInfo = { verificationCode: this.otp };
3037
- return [2 /*return*/, phone.finalizeSignInTotpMfa(auth, {
3037
+ return [2 /*return*/, index.finalizeSignInTotpMfa(auth, {
3038
3038
  mfaPendingCredential: mfaPendingCredential,
3039
3039
  mfaEnrollmentId: this.enrollmentId,
3040
3040
  totpVerificationInfo: totpVerificationInfo
@@ -3043,7 +3043,7 @@ var TotpMultiFactorAssertionImpl = /** @class */ (function (_super) {
3043
3043
  });
3044
3044
  };
3045
3045
  return TotpMultiFactorAssertionImpl;
3046
- }(phone.MultiFactorAssertionImpl));
3046
+ }(index.MultiFactorAssertionImpl));
3047
3047
  /**
3048
3048
  * Provider for generating a {@link TotpMultiFactorAssertion}.
3049
3049
  *
@@ -3173,7 +3173,7 @@ function getAuth(app$1) {
3173
3173
  if (provider.isInitialized()) {
3174
3174
  return provider.getImmediate();
3175
3175
  }
3176
- var auth = phone.initializeAuth(app$1, {
3176
+ var auth = index.initializeAuth(app$1, {
3177
3177
  popupRedirectResolver: browserPopupRedirectResolver,
3178
3178
  persistence: [
3179
3179
  indexedDBLocalPersistence,
@@ -3184,18 +3184,18 @@ function getAuth(app$1) {
3184
3184
  var authTokenSyncUrl = util.getExperimentalSetting('authTokenSyncURL');
3185
3185
  if (authTokenSyncUrl) {
3186
3186
  var mintCookie_1 = mintCookieFactory(authTokenSyncUrl);
3187
- phone.beforeAuthStateChanged(auth, mintCookie_1, function () {
3187
+ index.beforeAuthStateChanged(auth, mintCookie_1, function () {
3188
3188
  return mintCookie_1(auth.currentUser);
3189
3189
  });
3190
- phone.onIdTokenChanged(auth, function (user) { return mintCookie_1(user); });
3190
+ index.onIdTokenChanged(auth, function (user) { return mintCookie_1(user); });
3191
3191
  }
3192
3192
  var authEmulatorHost = util.getDefaultEmulatorHost('auth');
3193
3193
  if (authEmulatorHost) {
3194
- phone.connectAuthEmulator(auth, "http://".concat(authEmulatorHost));
3194
+ index.connectAuthEmulator(auth, "http://".concat(authEmulatorHost));
3195
3195
  }
3196
3196
  return auth;
3197
3197
  }
3198
- phone.registerAuth("Browser" /* ClientPlatform.BROWSER */);
3198
+ index.registerAuth("Browser" /* ClientPlatform.BROWSER */);
3199
3199
 
3200
3200
  /**
3201
3201
  * @license
@@ -3249,21 +3249,21 @@ function _generateHandlerUrl(auth, event, provider) {
3249
3249
  switch (_b.label) {
3250
3250
  case 0:
3251
3251
  BuildInfo = _cordovaWindow().BuildInfo;
3252
- phone.debugAssert(event.sessionId, 'AuthEvent did not contain a session ID');
3252
+ index.debugAssert(event.sessionId, 'AuthEvent did not contain a session ID');
3253
3253
  return [4 /*yield*/, computeSha256(event.sessionId)];
3254
3254
  case 1:
3255
3255
  sessionDigest = _b.sent();
3256
3256
  additionalParams = {};
3257
- if (phone._isIOS()) {
3257
+ if (index._isIOS()) {
3258
3258
  // iOS app identifier
3259
3259
  additionalParams['ibi'] = BuildInfo.packageName;
3260
3260
  }
3261
- else if (phone._isAndroid()) {
3261
+ else if (index._isAndroid()) {
3262
3262
  // Android app identifier
3263
3263
  additionalParams['apn'] = BuildInfo.packageName;
3264
3264
  }
3265
3265
  else {
3266
- phone._fail(auth, "operation-not-supported-in-this-environment" /* AuthErrorCode.OPERATION_NOT_SUPPORTED */);
3266
+ index._fail(auth, "operation-not-supported-in-this-environment" /* AuthErrorCode.OPERATION_NOT_SUPPORTED */);
3267
3267
  }
3268
3268
  // Add the display name if available
3269
3269
  if (BuildInfo.displayName) {
@@ -3287,14 +3287,14 @@ function _validateOrigin(auth) {
3287
3287
  case 0:
3288
3288
  BuildInfo = _cordovaWindow().BuildInfo;
3289
3289
  request = {};
3290
- if (phone._isIOS()) {
3290
+ if (index._isIOS()) {
3291
3291
  request.iosBundleId = BuildInfo.packageName;
3292
3292
  }
3293
- else if (phone._isAndroid()) {
3293
+ else if (index._isAndroid()) {
3294
3294
  request.androidPackageName = BuildInfo.packageName;
3295
3295
  }
3296
3296
  else {
3297
- phone._fail(auth, "operation-not-supported-in-this-environment" /* AuthErrorCode.OPERATION_NOT_SUPPORTED */);
3297
+ index._fail(auth, "operation-not-supported-in-this-environment" /* AuthErrorCode.OPERATION_NOT_SUPPORTED */);
3298
3298
  }
3299
3299
  // Will fail automatically if package name is not authorized
3300
3300
  return [4 /*yield*/, _getProjectConfig(auth, request)];
@@ -3317,7 +3317,7 @@ function _performRedirect(handlerUrl) {
3317
3317
  }
3318
3318
  else {
3319
3319
  // TODO: Return the inappbrowser ref that's returned from the open call
3320
- iabRef = cordova.InAppBrowser.open(handlerUrl, phone._isIOS7Or8() ? '_blank' : '_system', 'location=yes');
3320
+ iabRef = cordova.InAppBrowser.open(handlerUrl, index._isIOS7Or8() ? '_blank' : '_system', 'location=yes');
3321
3321
  }
3322
3322
  resolve(iabRef);
3323
3323
  });
@@ -3365,7 +3365,7 @@ function _waitForAppResume(auth, eventListener, iabRef) {
3365
3365
  }
3366
3366
  onCloseTimer = window.setTimeout(function () {
3367
3367
  // Wait two seeconds after resume then reject.
3368
- reject(phone._createError(auth, "redirect-cancelled-by-user" /* AuthErrorCode.REDIRECT_CANCELLED_BY_USER */));
3368
+ reject(index._createError(auth, "redirect-cancelled-by-user" /* AuthErrorCode.REDIRECT_CANCELLED_BY_USER */));
3369
3369
  }, REDIRECT_TIMEOUT_MS);
3370
3370
  }
3371
3371
  function visibilityChanged() {
@@ -3378,7 +3378,7 @@ function _waitForAppResume(auth, eventListener, iabRef) {
3378
3378
  eventListener.addPassiveListener(authEventSeen);
3379
3379
  // Listen for resume and visibility events
3380
3380
  document.addEventListener('resume', resumed, false);
3381
- if (phone._isAndroid()) {
3381
+ if (index._isAndroid()) {
3382
3382
  document.addEventListener('visibilitychange', visibilityChanged, false);
3383
3383
  }
3384
3384
  // SETUP THE CLEANUP FUNCTION =====
@@ -3415,22 +3415,22 @@ function _checkCordovaConfiguration(auth) {
3415
3415
  // Note that cordova-universal-links-plugin has been abandoned.
3416
3416
  // A fork with latest fixes is available at:
3417
3417
  // https://www.npmjs.com/package/cordova-universal-links-plugin-fix
3418
- phone._assert(typeof ((_a = win === null || win === void 0 ? void 0 : win.universalLinks) === null || _a === void 0 ? void 0 : _a.subscribe) === 'function', auth, "invalid-cordova-configuration" /* AuthErrorCode.INVALID_CORDOVA_CONFIGURATION */, {
3418
+ index._assert(typeof ((_a = win === null || win === void 0 ? void 0 : win.universalLinks) === null || _a === void 0 ? void 0 : _a.subscribe) === 'function', auth, "invalid-cordova-configuration" /* AuthErrorCode.INVALID_CORDOVA_CONFIGURATION */, {
3419
3419
  missingPlugin: 'cordova-universal-links-plugin-fix'
3420
3420
  });
3421
3421
  // https://www.npmjs.com/package/cordova-plugin-buildinfo
3422
- phone._assert(typeof ((_b = win === null || win === void 0 ? void 0 : win.BuildInfo) === null || _b === void 0 ? void 0 : _b.packageName) !== 'undefined', auth, "invalid-cordova-configuration" /* AuthErrorCode.INVALID_CORDOVA_CONFIGURATION */, {
3422
+ index._assert(typeof ((_b = win === null || win === void 0 ? void 0 : win.BuildInfo) === null || _b === void 0 ? void 0 : _b.packageName) !== 'undefined', auth, "invalid-cordova-configuration" /* AuthErrorCode.INVALID_CORDOVA_CONFIGURATION */, {
3423
3423
  missingPlugin: 'cordova-plugin-buildInfo'
3424
3424
  });
3425
3425
  // https://github.com/google/cordova-plugin-browsertab
3426
- phone._assert(typeof ((_e = (_d = (_c = win === null || win === void 0 ? void 0 : win.cordova) === null || _c === void 0 ? void 0 : _c.plugins) === null || _d === void 0 ? void 0 : _d.browsertab) === null || _e === void 0 ? void 0 : _e.openUrl) === 'function', auth, "invalid-cordova-configuration" /* AuthErrorCode.INVALID_CORDOVA_CONFIGURATION */, {
3426
+ index._assert(typeof ((_e = (_d = (_c = win === null || win === void 0 ? void 0 : win.cordova) === null || _c === void 0 ? void 0 : _c.plugins) === null || _d === void 0 ? void 0 : _d.browsertab) === null || _e === void 0 ? void 0 : _e.openUrl) === 'function', auth, "invalid-cordova-configuration" /* AuthErrorCode.INVALID_CORDOVA_CONFIGURATION */, {
3427
3427
  missingPlugin: 'cordova-plugin-browsertab'
3428
3428
  });
3429
- phone._assert(typeof ((_h = (_g = (_f = win === null || win === void 0 ? void 0 : win.cordova) === null || _f === void 0 ? void 0 : _f.plugins) === null || _g === void 0 ? void 0 : _g.browsertab) === null || _h === void 0 ? void 0 : _h.isAvailable) === 'function', auth, "invalid-cordova-configuration" /* AuthErrorCode.INVALID_CORDOVA_CONFIGURATION */, {
3429
+ index._assert(typeof ((_h = (_g = (_f = win === null || win === void 0 ? void 0 : win.cordova) === null || _f === void 0 ? void 0 : _f.plugins) === null || _g === void 0 ? void 0 : _g.browsertab) === null || _h === void 0 ? void 0 : _h.isAvailable) === 'function', auth, "invalid-cordova-configuration" /* AuthErrorCode.INVALID_CORDOVA_CONFIGURATION */, {
3430
3430
  missingPlugin: 'cordova-plugin-browsertab'
3431
3431
  });
3432
3432
  // https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-inappbrowser/
3433
- phone._assert(typeof ((_k = (_j = win === null || win === void 0 ? void 0 : win.cordova) === null || _j === void 0 ? void 0 : _j.InAppBrowser) === null || _k === void 0 ? void 0 : _k.open) === 'function', auth, "invalid-cordova-configuration" /* AuthErrorCode.INVALID_CORDOVA_CONFIGURATION */, {
3433
+ index._assert(typeof ((_k = (_j = win === null || win === void 0 ? void 0 : win.cordova) === null || _j === void 0 ? void 0 : _j.InAppBrowser) === null || _k === void 0 ? void 0 : _k.open) === 'function', auth, "invalid-cordova-configuration" /* AuthErrorCode.INVALID_CORDOVA_CONFIGURATION */, {
3434
3434
  missingPlugin: 'cordova-plugin-inappbrowser'
3435
3435
  });
3436
3436
  }
@@ -3458,7 +3458,7 @@ function computeSha256(sessionId) {
3458
3458
  function stringToArrayBuffer(str) {
3459
3459
  // This function is only meant to deal with an ASCII charset and makes
3460
3460
  // certain simplifying assumptions.
3461
- phone.debugAssert(/[0-9a-zA-Z]+/.test(str), 'Can only convert alpha-numeric strings');
3461
+ index.debugAssert(/[0-9a-zA-Z]+/.test(str), 'Can only convert alpha-numeric strings');
3462
3462
  if (typeof TextEncoder !== 'undefined') {
3463
3463
  return new TextEncoder().encode(str);
3464
3464
  }
@@ -3542,7 +3542,7 @@ function _generateNewEvent(auth, type, eventId) {
3542
3542
  sessionId: generateSessionId(),
3543
3543
  postBody: null,
3544
3544
  tenantId: auth.tenantId,
3545
- error: phone._createError(auth, "no-auth-event" /* AuthErrorCode.NO_AUTH_EVENT */)
3545
+ error: index._createError(auth, "no-auth-event" /* AuthErrorCode.NO_AUTH_EVENT */)
3546
3546
  };
3547
3547
  }
3548
3548
  function _savePartialEvent(auth, event) {
@@ -3585,7 +3585,7 @@ function _eventFromPartialAndUrl(partialEvent, url) {
3585
3585
  ? parseJsonOrNull(decodeURIComponent(params['firebaseError']))
3586
3586
  : null;
3587
3587
  var code = (_b = (_a = errorObject === null || errorObject === void 0 ? void 0 : errorObject['code']) === null || _a === void 0 ? void 0 : _a.split('auth/')) === null || _b === void 0 ? void 0 : _b[1];
3588
- var error = code ? phone._createError(code) : null;
3588
+ var error = code ? index._createError(code) : null;
3589
3589
  if (error) {
3590
3590
  return {
3591
3591
  type: partialEvent.type,
@@ -3620,10 +3620,10 @@ function generateSessionId() {
3620
3620
  return chars.join('');
3621
3621
  }
3622
3622
  function storage() {
3623
- return phone._getInstance(browserLocalPersistence);
3623
+ return index._getInstance(browserLocalPersistence);
3624
3624
  }
3625
3625
  function persistenceKey(auth) {
3626
- return phone._persistenceKeyName("authEvent" /* KeyName.AUTH_EVENT */, auth.config.apiKey, auth.name);
3626
+ return index._persistenceKeyName("authEvent" /* KeyName.AUTH_EVENT */, auth.config.apiKey, auth.name);
3627
3627
  }
3628
3628
  function parseJsonOrNull(json) {
3629
3629
  try {
@@ -3704,7 +3704,7 @@ var CordovaPopupRedirectResolver = /** @class */ (function () {
3704
3704
  });
3705
3705
  };
3706
3706
  CordovaPopupRedirectResolver.prototype._openPopup = function (auth) {
3707
- phone._fail(auth, "operation-not-supported-in-this-environment" /* AuthErrorCode.OPERATION_NOT_SUPPORTED */);
3707
+ index._fail(auth, "operation-not-supported-in-this-environment" /* AuthErrorCode.OPERATION_NOT_SUPPORTED */);
3708
3708
  };
3709
3709
  CordovaPopupRedirectResolver.prototype._openRedirect = function (auth, provider, authType, eventId) {
3710
3710
  return tslib.__awaiter(this, void 0, void 0, function () {
@@ -3842,7 +3842,7 @@ function generateNoEvent() {
3842
3842
  urlResponse: null,
3843
3843
  postBody: null,
3844
3844
  tenantId: null,
3845
- error: phone._createError("no-auth-event" /* AuthErrorCode.NO_AUTH_EVENT */)
3845
+ error: index._createError("no-auth-event" /* AuthErrorCode.NO_AUTH_EVENT */)
3846
3846
  };
3847
3847
  }
3848
3848
 
@@ -3866,88 +3866,88 @@ function generateNoEvent() {
3866
3866
  // It is not intended for direct use by developer apps. NO jsdoc here to intentionally leave it out
3867
3867
  // of autogenerated documentation pages to reduce accidental misuse.
3868
3868
  function addFrameworkForLogging(auth, framework) {
3869
- phone._castAuth(auth)._logFramework(framework);
3869
+ index._castAuth(auth)._logFramework(framework);
3870
3870
  }
3871
3871
 
3872
- exports.ActionCodeOperation = phone.ActionCodeOperation;
3873
- exports.ActionCodeURL = phone.ActionCodeURL;
3874
- exports.AuthCredential = phone.AuthCredential;
3875
- exports.AuthErrorCodes = phone.AUTH_ERROR_CODES_MAP_DO_NOT_USE_INTERNALLY;
3876
- exports.AuthImpl = phone.AuthImpl;
3877
- exports.EmailAuthCredential = phone.EmailAuthCredential;
3878
- exports.EmailAuthProvider = phone.EmailAuthProvider;
3879
- exports.FacebookAuthProvider = phone.FacebookAuthProvider;
3880
- exports.FactorId = phone.FactorId;
3881
- exports.FetchProvider = phone.FetchProvider;
3882
- exports.GithubAuthProvider = phone.GithubAuthProvider;
3883
- exports.GoogleAuthProvider = phone.GoogleAuthProvider;
3884
- exports.OAuthCredential = phone.OAuthCredential;
3885
- exports.OAuthProvider = phone.OAuthProvider;
3886
- exports.OperationType = phone.OperationType;
3887
- exports.PhoneAuthCredential = phone.PhoneAuthCredential;
3888
- exports.PhoneAuthProvider = phone.PhoneAuthProvider;
3889
- exports.PhoneMultiFactorGenerator = phone.PhoneMultiFactorGenerator;
3890
- exports.ProviderId = phone.ProviderId;
3891
- exports.RecaptchaVerifier = phone.RecaptchaVerifier;
3892
- exports.SAMLAuthCredential = phone.SAMLAuthCredential;
3893
- exports.SAMLAuthProvider = phone.SAMLAuthProvider;
3894
- exports.SignInMethod = phone.SignInMethod;
3895
- exports.TwitterAuthProvider = phone.TwitterAuthProvider;
3896
- exports.UserImpl = phone.UserImpl;
3897
- exports._assert = phone._assert;
3898
- exports._castAuth = phone._castAuth;
3899
- exports._fail = phone._fail;
3900
- exports._getClientVersion = phone._getClientVersion;
3901
- exports._getInstance = phone._getInstance;
3902
- exports._persistenceKeyName = phone._persistenceKeyName;
3903
- exports.applyActionCode = phone.applyActionCode;
3904
- exports.beforeAuthStateChanged = phone.beforeAuthStateChanged;
3905
- exports.checkActionCode = phone.checkActionCode;
3906
- exports.confirmPasswordReset = phone.confirmPasswordReset;
3907
- exports.connectAuthEmulator = phone.connectAuthEmulator;
3908
- exports.createUserWithEmailAndPassword = phone.createUserWithEmailAndPassword;
3909
- exports.debugErrorMap = phone.debugErrorMap;
3910
- exports.deleteUser = phone.deleteUser;
3911
- exports.fetchSignInMethodsForEmail = phone.fetchSignInMethodsForEmail;
3912
- exports.getAdditionalUserInfo = phone.getAdditionalUserInfo;
3913
- exports.getIdToken = phone.getIdToken;
3914
- exports.getIdTokenResult = phone.getIdTokenResult;
3915
- exports.getMultiFactorResolver = phone.getMultiFactorResolver;
3916
- exports.inMemoryPersistence = phone.inMemoryPersistence;
3917
- exports.initializeAuth = phone.initializeAuth;
3918
- exports.initializeRecaptchaConfig = phone.initializeRecaptchaConfig;
3919
- exports.isSignInWithEmailLink = phone.isSignInWithEmailLink;
3920
- exports.linkWithCredential = phone.linkWithCredential;
3921
- exports.linkWithPhoneNumber = phone.linkWithPhoneNumber;
3922
- exports.multiFactor = phone.multiFactor;
3923
- exports.onAuthStateChanged = phone.onAuthStateChanged;
3924
- exports.onIdTokenChanged = phone.onIdTokenChanged;
3925
- exports.parseActionCodeURL = phone.parseActionCodeURL;
3926
- exports.prodErrorMap = phone.prodErrorMap;
3927
- exports.reauthenticateWithCredential = phone.reauthenticateWithCredential;
3928
- exports.reauthenticateWithPhoneNumber = phone.reauthenticateWithPhoneNumber;
3929
- exports.reload = phone.reload;
3930
- exports.sendEmailVerification = phone.sendEmailVerification;
3931
- exports.sendPasswordResetEmail = phone.sendPasswordResetEmail;
3932
- exports.sendSignInLinkToEmail = phone.sendSignInLinkToEmail;
3933
- exports.setPersistence = phone.setPersistence;
3934
- exports.signInAnonymously = phone.signInAnonymously;
3935
- exports.signInWithCredential = phone.signInWithCredential;
3936
- exports.signInWithCustomToken = phone.signInWithCustomToken;
3937
- exports.signInWithEmailAndPassword = phone.signInWithEmailAndPassword;
3938
- exports.signInWithEmailLink = phone.signInWithEmailLink;
3939
- exports.signInWithPhoneNumber = phone.signInWithPhoneNumber;
3940
- exports.signOut = phone.signOut;
3941
- exports.unlink = phone.unlink;
3942
- exports.updateCurrentUser = phone.updateCurrentUser;
3943
- exports.updateEmail = phone.updateEmail;
3944
- exports.updatePassword = phone.updatePassword;
3945
- exports.updatePhoneNumber = phone.updatePhoneNumber;
3946
- exports.updateProfile = phone.updateProfile;
3947
- exports.useDeviceLanguage = phone.useDeviceLanguage;
3948
- exports.validatePassword = phone.validatePassword;
3949
- exports.verifyBeforeUpdateEmail = phone.verifyBeforeUpdateEmail;
3950
- exports.verifyPasswordResetCode = phone.verifyPasswordResetCode;
3872
+ exports.ActionCodeOperation = index.ActionCodeOperation;
3873
+ exports.ActionCodeURL = index.ActionCodeURL;
3874
+ exports.AuthCredential = index.AuthCredential;
3875
+ exports.AuthErrorCodes = index.AUTH_ERROR_CODES_MAP_DO_NOT_USE_INTERNALLY;
3876
+ exports.AuthImpl = index.AuthImpl;
3877
+ exports.EmailAuthCredential = index.EmailAuthCredential;
3878
+ exports.EmailAuthProvider = index.EmailAuthProvider;
3879
+ exports.FacebookAuthProvider = index.FacebookAuthProvider;
3880
+ exports.FactorId = index.FactorId;
3881
+ exports.FetchProvider = index.FetchProvider;
3882
+ exports.GithubAuthProvider = index.GithubAuthProvider;
3883
+ exports.GoogleAuthProvider = index.GoogleAuthProvider;
3884
+ exports.OAuthCredential = index.OAuthCredential;
3885
+ exports.OAuthProvider = index.OAuthProvider;
3886
+ exports.OperationType = index.OperationType;
3887
+ exports.PhoneAuthCredential = index.PhoneAuthCredential;
3888
+ exports.PhoneAuthProvider = index.PhoneAuthProvider;
3889
+ exports.PhoneMultiFactorGenerator = index.PhoneMultiFactorGenerator;
3890
+ exports.ProviderId = index.ProviderId;
3891
+ exports.RecaptchaVerifier = index.RecaptchaVerifier;
3892
+ exports.SAMLAuthCredential = index.SAMLAuthCredential;
3893
+ exports.SAMLAuthProvider = index.SAMLAuthProvider;
3894
+ exports.SignInMethod = index.SignInMethod;
3895
+ exports.TwitterAuthProvider = index.TwitterAuthProvider;
3896
+ exports.UserImpl = index.UserImpl;
3897
+ exports._assert = index._assert;
3898
+ exports._castAuth = index._castAuth;
3899
+ exports._fail = index._fail;
3900
+ exports._getClientVersion = index._getClientVersion;
3901
+ exports._getInstance = index._getInstance;
3902
+ exports._persistenceKeyName = index._persistenceKeyName;
3903
+ exports.applyActionCode = index.applyActionCode;
3904
+ exports.beforeAuthStateChanged = index.beforeAuthStateChanged;
3905
+ exports.checkActionCode = index.checkActionCode;
3906
+ exports.confirmPasswordReset = index.confirmPasswordReset;
3907
+ exports.connectAuthEmulator = index.connectAuthEmulator;
3908
+ exports.createUserWithEmailAndPassword = index.createUserWithEmailAndPassword;
3909
+ exports.debugErrorMap = index.debugErrorMap;
3910
+ exports.deleteUser = index.deleteUser;
3911
+ exports.fetchSignInMethodsForEmail = index.fetchSignInMethodsForEmail;
3912
+ exports.getAdditionalUserInfo = index.getAdditionalUserInfo;
3913
+ exports.getIdToken = index.getIdToken;
3914
+ exports.getIdTokenResult = index.getIdTokenResult;
3915
+ exports.getMultiFactorResolver = index.getMultiFactorResolver;
3916
+ exports.inMemoryPersistence = index.inMemoryPersistence;
3917
+ exports.initializeAuth = index.initializeAuth;
3918
+ exports.initializeRecaptchaConfig = index.initializeRecaptchaConfig;
3919
+ exports.isSignInWithEmailLink = index.isSignInWithEmailLink;
3920
+ exports.linkWithCredential = index.linkWithCredential;
3921
+ exports.linkWithPhoneNumber = index.linkWithPhoneNumber;
3922
+ exports.multiFactor = index.multiFactor;
3923
+ exports.onAuthStateChanged = index.onAuthStateChanged;
3924
+ exports.onIdTokenChanged = index.onIdTokenChanged;
3925
+ exports.parseActionCodeURL = index.parseActionCodeURL;
3926
+ exports.prodErrorMap = index.prodErrorMap;
3927
+ exports.reauthenticateWithCredential = index.reauthenticateWithCredential;
3928
+ exports.reauthenticateWithPhoneNumber = index.reauthenticateWithPhoneNumber;
3929
+ exports.reload = index.reload;
3930
+ exports.sendEmailVerification = index.sendEmailVerification;
3931
+ exports.sendPasswordResetEmail = index.sendPasswordResetEmail;
3932
+ exports.sendSignInLinkToEmail = index.sendSignInLinkToEmail;
3933
+ exports.setPersistence = index.setPersistence;
3934
+ exports.signInAnonymously = index.signInAnonymously;
3935
+ exports.signInWithCredential = index.signInWithCredential;
3936
+ exports.signInWithCustomToken = index.signInWithCustomToken;
3937
+ exports.signInWithEmailAndPassword = index.signInWithEmailAndPassword;
3938
+ exports.signInWithEmailLink = index.signInWithEmailLink;
3939
+ exports.signInWithPhoneNumber = index.signInWithPhoneNumber;
3940
+ exports.signOut = index.signOut;
3941
+ exports.unlink = index.unlink;
3942
+ exports.updateCurrentUser = index.updateCurrentUser;
3943
+ exports.updateEmail = index.updateEmail;
3944
+ exports.updatePassword = index.updatePassword;
3945
+ exports.updatePhoneNumber = index.updatePhoneNumber;
3946
+ exports.updateProfile = index.updateProfile;
3947
+ exports.useDeviceLanguage = index.useDeviceLanguage;
3948
+ exports.validatePassword = index.validatePassword;
3949
+ exports.verifyBeforeUpdateEmail = index.verifyBeforeUpdateEmail;
3950
+ exports.verifyPasswordResetCode = index.verifyPasswordResetCode;
3951
3951
  exports.AuthPopup = AuthPopup;
3952
3952
  exports.TotpMultiFactorGenerator = TotpMultiFactorGenerator;
3953
3953
  exports.TotpSecret = TotpSecret;