!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/fire/remote-config"),require("rxjs"),require("@angular/fire/performance"),require("@angular/fire/firestore"),require("rxjs/operators"),require("@firebase/app"),require("firebase/auth"),require("@angular/fire/auth"),require("@angular/forms"),require("@angular/router"),require("@angular/common/http"),require("@ngx-translate/core"),require("@angular/fire"),require("@angular/fire/functions")):"function"==typeof define&&define.amd?define("ionic-firebase-auth",["exports","@angular/core","@angular/fire/remote-config","rxjs","@angular/fire/performance","@angular/fire/firestore","rxjs/operators","@firebase/app","firebase/auth","@angular/fire/auth","@angular/forms","@angular/router","@angular/common/http","@ngx-translate/core","@angular/fire","@angular/fire/functions"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["ionic-firebase-auth"]={},e.ng.core,e.ng.fire.remoteConfig,e.rxjs,e.ng.fire.performance,e.ng.fire.firestore,e.rxjs.operators,e.firebase,null,e.ng.fire.auth,e.ng.forms,e.ng.router,e.ng.common.http,e["ngx-translate"],e.ng.fire,e.ng.fire.functions)}(this,(function(e,t,r,n,i,o,s,a,u,c,l,h,d,f,p,v){"use strict";var g=function(){function e(){}return Object.defineProperty(e.prototype,"dateFormat",{get:function(){return"dd/MM/yyyy"},enumerable:!1,configurable:!0}),e}();g.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new g},token:g,providedIn:"root"}),g.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}];function m(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))}function y(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}Object.create;function b(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function w(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(b(arguments[t]));return e}Object.create;var A,E,U,P=function(){function e(e){this.value=e}return e.prototype.asBoolean=function(){return this.value},e.prototype.asString=function(){return this.value},e.prototype.asNumber=function(){return this.value},e.prototype.getSource=function(){return"static"},e}(),S=function(){function e(e,t){this.injector=t,this.defaults=this.injector.get(r.DEFAULTS)||{},this.remoteConfig$=n.of(this.defaults),this.parameters=n.of([]),e&&(this.getBoolean=e.getBoolean,this.getNumber=e.getNumber,this.getString=e.getString,this.getValue=e.getValue,this.remoteConfig$=e.parameters.pipe(r.mapToObject(this.defaults)))}return e.prototype.getBoolean=function(e){return m(this,void 0,void 0,(function(){return y(this,(function(t){switch(t.label){case 0:return[4,this.getValue(e)];case 1:return[2,t.sent().asBoolean()]}}))}))},e.prototype.getNumber=function(e){return m(this,void 0,void 0,(function(){return y(this,(function(t){switch(t.label){case 0:return[4,this.getValue(e)];case 1:return[2,t.sent().asNumber()]}}))}))},e.prototype.getString=function(e){return m(this,void 0,void 0,(function(){return y(this,(function(t){switch(t.label){case 0:return[4,this.getValue(e)];case 1:return[2,t.sent().asString()]}}))}))},e.prototype.getValue=function(e){return Promise.resolve(new P(this.defaults[e]))},e}();S.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new S(t.ɵɵinject(r.AngularFireRemoteConfig,8),t.ɵɵinject(t.INJECTOR))},token:S,providedIn:"root"}),S.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],S.ctorParameters=function(){return[{type:r.AngularFireRemoteConfig,decorators:[{type:t.Optional}]},{type:t.Injector}]},e.AuthProvider=void 0,(A=e.AuthProvider||(e.AuthProvider={})).ALL="all",A.ANONYMOUS="anonymous",A.EmailAndPassword="firebase",A.Google="google",A.Apple="apple",A.Facebook="facebook",A.Twitter="twitter",A.Github="github",A.Microsoft="microsoft",A.Yahoo="yahoo",A.PhoneNumber="phoneNumber",e.Accounts=void 0,(E=e.Accounts||(e.Accounts={})).NONE="account",E.CHECK="account-check",E.EDIT="account-edit",E.OFF="account-off",E.REMOVE="account-remove",e.MalServiceEnabled=void 0,(U=e.MalServiceEnabled||(e.MalServiceEnabled={}))[U.emulate=2]="emulate",U[U.enabled=1]="enabled",U[U.disabled=0]="disabled";var I={services:{firebaseAnalytics:!0,firebaseCrashlytics:!0,firebasePerformance:!0,firebaseRemoteConfig:!0,inAppPurchase:!0,firebaseAuth:!0,firebaseFirestore:!0,firebaseFunctions:!0},authUi:{enableFirestoreSync:!0,toastMessageOnAuthSuccess:!0,toastMessageOnAuthError:!0,toastDefaultDurationMil:3e3,authGuardFallbackURL:"/",authGuardLoggedInURL:"/",authGuardVerifyEmailURL:void 0,reSignInUrl:"/auth/signin",passwordMaxLength:60,passwordMinLength:8,passwordRequireLowercase:!0,passwordRequireUppercase:!0,passwordRequireSpecial:!0,passwordRequireNumbers:!0,nameMaxLength:50,nameMinLength:2,supportedProviders:e.AuthProvider.ALL,guestEnabled:!1,allowAccountEdit:!0,allowAccountDelete:!0,allowAccountLogout:!0,guardProtectedRoutesUntilEmailIsVerified:!0,enableEmailVerification:!0,avatarShowIfAnon:!0}};function T(e){return{firebase:e.firebase,services:Object.assign({},I.services,e.services||{}),authUi:Object.assign({},I.authUi,e.authUi||{}),configDefaults:e.configDefaults||{}}}var C=new RegExp(["^[+]{0,1}[(]{0,1}[0-9]{1,4}[)]{0,1}[-\\s\\.]{0,1}[(]{0,1}[0-9]{1,4}[)]{0,1}[-\\s\\./0-9]{4,12}$"].join(""));e.FirebaseErrorCodes=void 0,(e.FirebaseErrorCodes||(e.FirebaseErrorCodes={})).requiresRecentLogin="auth/requires-recent-login";var j=new t.InjectionToken("AuthAnalyticsProviderToken"),N=new t.InjectionToken("AuthCrashlyticsProviderToken"),k=new t.InjectionToken("AuthhServiceProviderToken"),O=new t.InjectionToken("AuthHooksProviderToken"),L=new t.InjectionToken("AuthCredentialFactoryProviderToken"),F=new t.InjectionToken("AuthUserProvidedConfigToken"),R=new t.InjectionToken("AuthSharedConfigToken"),M=new t.InjectionToken("AuthLoadingUIProviderToken"),x=new t.InjectionToken("AuthAlertsUIProviderToken"),D=new t.InjectionToken("AuthPickerUIProviderToken"),$=new t.InjectionToken("AuthToastUIProviderToken"),_=new t.InjectionToken("AuthLegaliyDialogUIProiderToken"),V=function(e){var t=this;this.analytics=e,this.logEvent=function(e,r){return m(t,void 0,void 0,(function(){return y(this,(function(t){return console.log("NotLogged:LogEvent "+e,r),[2]}))}))},this.setScreenName=function(e,t){return Promise.resolve()},this.setUserId=function(e){},this.analytics&&(this.logEvent=this.analytics.logEvent,this.setScreenName=this.analytics.setScreenName,this.setUserId=this.analytics.setUserId)};V.decorators=[{type:t.Injectable}],V.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[t.forwardRef((function(){return j}))]}]}]};var q=function(){function e(e){this.crashlyticsProvider=e,this._recordException=function(e){return Promise.resolve()},this._addLogMessage=function(e){return Promise.resolve()},this._setUserId=function(e){},this.crashlyticsProvider&&(this._recordException=this.crashlyticsProvider.recordException,this._addLogMessage=this.crashlyticsProvider.addLogMessage)}return e.prototype.setUserId=function(e){this._setUserId(e)},e.prototype.recordException=function(e){var t={message:"An unknown error occured"};return"string"==typeof e?t.message=e:e instanceof Error?t.message=e.message:t.message&&(t=e),this._recordException(t)},e.prototype.addLogMessage=function(e){return console.log("addLogMessage "+e),this._addLogMessage(e)},e}();q.decorators=[{type:t.Injectable}],q.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[t.forwardRef((function(){return N}))]}]}]};var W=function(){function e(){}return e.prototype.start=function(){},e.prototype.stop=function(){},e.prototype.putAttribute=function(e,t){},e}(),G=function(){function e(e){this.dataCollectionEnabled=Promise.resolve(!1),e&&(this.createTrace=e.trace)}return e.prototype.createTrace=function(e){return Promise.resolve(new W)},e}();G.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new G(t.ɵɵinject(i.AngularFirePerformance,8))},token:G,providedIn:"root"}),G.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],G.ctorParameters=function(){return[{type:i.AngularFirePerformance,decorators:[{type:t.Optional}]}]};var B=function(){function e(e,t,r){this.crashlyticsService=e,this.analyticsService=t,this.performanceService=r,this.recordException=this.crashlyticsService.recordException.bind(this.crashlyticsService),this.addLogMessage=this.crashlyticsService.addLogMessage.bind(this.crashlyticsService),this.setScreenName=this.analyticsService.setScreenName.bind(this.analyticsService),this.logEvent=this.analyticsService.logEvent.bind(this.analyticsService),this.createTrace=this.performanceService.createTrace}return e.prototype.setUserId=function(e){return m(this,void 0,void 0,(function(){return y(this,(function(t){return this.analyticsService.setUserId(e),this.crashlyticsService.setUserId(e),[2]}))}))},e}();B.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new B(t.ɵɵinject(q),t.ɵɵinject(V),t.ɵɵinject(G))},token:B,providedIn:"root"}),B.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],B.ctorParameters=function(){return[{type:q},{type:V},{type:G}]};var H=function(){function e(e,t){this.afs=e,this.fire=t}return e.prototype.getUserData=function(e){return m(this,void 0,void 0,(function(){var t;return y(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.getUserDocRefByUID(e).get().toPromise()];case 1:return[2,r.sent().data()||null];case 2:return t=r.sent(),this.fire.recordException(t),[2,null];case 3:return[2]}}))}))},e.prototype.getUserDocRefByUID=function(e){return this.afs.doc("/users/"+e)},e.prototype.setUserData=function(e,t,r){return m(this,void 0,void 0,(function(){return y(this,(function(n){try{return[2,this.afs.doc("/users/"+e).set(t,r)]}catch(e){this.fire.recordException(e)}return[2]}))}))},e.prototype.updateUserData=function(e,t){return m(this,void 0,void 0,(function(){return y(this,(function(r){try{return[2,this.getUserDocRefByUID(e).update(Object.assign(Object.assign({},t),{uid:e}))]}catch(e){this.fire.recordException(e)}return[2]}))}))},e}();H.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new H(t.ɵɵinject(o.AngularFirestore),t.ɵɵinject(B))},token:H,providedIn:"root"}),H.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],H.ctorParameters=function(){return[{type:o.AngularFirestore},{type:B}]};var Y=function(){function e(e,t,r,n,i){this.toastService=e,this.alertService=t,this.loadingService=r,this.legalityDialog=n,this.fire=i,this.toast=this.toastService.toast.bind(this.toastService),this.createToast=this.toastService.createToast.bind(this.toastService),this.errorToast=this.toastService.errorToast.bind(this.toastService),this.okAlert=this.alertService.okAlert.bind(this.alertService),this.infoAlert=this.alertService.infoAlert.bind(this.alertService),this.errorAlert=this.alertService.errorAlert.bind(this.alertService),this.textboxInputAlert=this.alertService.textboxInputAlert.bind(this.alertService),this.yesNoAlert=this.alertService.yesNoAlert.bind(this.alertService),this.createLoading=this.loadingService.createLoading.bind(this.loadingService),this.watchLoading=this.loadingService.watchLoading.bind(this.loadingService),this.confirmTos=this.legalityDialog.confirmTos.bind(this.legalityDialog)}return e.prototype.logError=function(e,t){var r,n=(r=e)&&r.code&&r.message?e:new Error(e);console.log(e),this.fire.recordException(n),null!==t&&this.toastService.errorToast(n,t)},e.prototype.fnWithLoading=function(e,t){return m(this,void 0,void 0,(function(){var r,n;return y(this,(function(i){switch(i.label){case 0:return[4,this.loadingService.createLoading(t)];case 1:return[4,(r=i.sent()).present()];case 2:i.sent(),i.label=3;case 3:return i.trys.push([3,6,,8]),[4,e()];case 4:return i.sent(),[4,r.dismiss()];case 5:return i.sent(),[3,8];case 6:return n=i.sent(),[4,r.dismiss()];case 7:throw i.sent(),n;case 8:return[2]}}))}))},e}();Y.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new Y(t.ɵɵinject($),t.ɵɵinject(x),t.ɵɵinject(M),t.ɵɵinject(_),t.ɵɵinject(B))},token:Y,providedIn:"root"}),Y.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],Y.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Inject,args:[t.forwardRef((function(){return $}))]}]},{type:void 0,decorators:[{type:t.Inject,args:[t.forwardRef((function(){return x}))]}]},{type:void 0,decorators:[{type:t.Inject,args:[t.forwardRef((function(){return M}))]}]},{type:void 0,decorators:[{type:t.Inject,args:[t.forwardRef((function(){return _}))]}]},{type:B}]};var J,K=function(){function r(e,r,i,o,a,u,c){var l=this;this.config=e,this.hooksService=r,this.credFactory=i,this.fireStoreService=o,this.afa=a,this.fire=u,this.ui=c,this.onErrorEmitter=new t.EventEmitter,this.onSignInEmitter=new t.EventEmitter,this.onRegisterEmitter=new t.EventEmitter,this.onSignOutEmitter=new t.EventEmitter,this.onUserUpdatedEmitter=new t.EventEmitter,this.onUserDeletedEmitter=new t.EventEmitter,this.showProfileDialog=new t.EventEmitter,this._user$=new n.BehaviorSubject(null),this.user$=this.afa.user,this._authState$=new n.BehaviorSubject(null),this.authState$=this.afa.authState,this.uid$=this.user$.pipe(s.map((function(e){return(null==e?void 0:e.uid)||null})),s.distinctUntilChanged()),this.isLoggedIn$=this.user$.pipe(s.map((function(e){return null!==e}))),this.isAnonymous$=this.user$.pipe(s.map((function(e){return null!==e&&e.isAnonymous}))),this.isNamedUser$=this.user$.pipe(s.map((function(e){return null!==e&&!e.isAnonymous}))),this.isNotNamedUser$=this.user$.pipe(s.map((function(e){return null===e||e.isAnonymous}))),this.canEdit$=this.isLoggedIn$,this.canRegister$=this.isNotNamedUser$,this.canSignIn$=this.isLoggedIn$.pipe(s.map((function(e){return!e}))),this.canSignInAsGuest$=this.isLoggedIn$.pipe(s.map((function(e){return!e&&l.config.authUi.guestEnabled}))),this.canSignOut$=this.isNamedUser$,this.onSignOut$=this.authState$.pipe(s.filter((function(e){return null===e})),s.map((function(){}))),this.onSignIn$=this.authState$.pipe(s.filter((function(e){return null!==e})),s.map((function(e){return e}))),this.tokenRefreshed$=new n.Subject,this.afa.user.subscribe((function(e){return l._user$.next(e)})),this.afa.authState.subscribe((function(e){return l._authState$.next(e)})),this.authState$.subscribe((function(e){l.fire.setUserId((null==e?void 0:e.uid)||null)})),this.onSignOut$.subscribe((function(){return l.onSignOutEmitter.emit()}))}return Object.defineProperty(r.prototype,"user",{get:function(){return this._user$.value},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"reauthenticateProviders$",{get:function(){return this.user$.pipe(s.map((function(t){return((null==t?void 0:t.providerData)||[]).map((function(t){switch(null==t?void 0:t.providerId){case"google.com":return e.AuthProvider.Google;default:return void console.log("NO MATCH",t)}})).filter((function(e){return!!e}))})))},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isWebPlatform",{get:function(){return["https:","http:","chrome-extension"].includes(location.protocol)},enumerable:!1,configurable:!0}),r.prototype.isProviderSupported=function(t){return m(this,void 0,void 0,(function(){var r,n,i;return y(this,(function(o){switch(o.label){case 0:return r=this.config.authUi.supportedProviders===e.AuthProvider.ALL||this.config.authUi.supportedProviders.includes(t),this.credFactory?[4,this.credFactory.isProviderSupported(t)]:[3,2];case 1:return i=o.sent(),[3,3];case 2:i=void 0,o.label=3;case 3:return n=i,console.log(t,r,n,this.isWebPlatform),[2,r&&(this.isWebPlatform&&!1!==n||!0===n)]}}))}))},r.prototype.refreshToken=function(){return m(this,void 0,void 0,(function(){var e;return y(this,(function(t){switch(t.label){case 0:return[4,this.afa.currentUser];case 1:return(e=t.sent())?[4,e.getIdToken(!0)]:[3,4];case 2:return t.sent(),[4,this.tokenRefreshed$.next()];case 3:t.sent(),t.label=4;case 4:return[2]}}))}))},r.prototype.selectCurrentUserClaim=function(e){var t=this;return new n.Observable((function(r){var n=function(n){return m(t,void 0,void 0,(function(){var t;return y(this,(function(i){switch(i.label){case 0:return n?[4,n.getIdTokenResult()]:[3,2];case 1:return t=i.sent(),r.next(t.claims[e]),[3,3];case 2:r.next(null),i.label=3;case 3:return[2]}}))}))};t.tokenRefreshed$.subscribe((function(){return m(t,void 0,void 0,(function(){var e;return y(this,(function(t){switch(t.label){case 0:return[4,this.afa.currentUser];case 1:return e=t.sent(),[4,n(e)];case 2:return t.sent(),[2]}}))}))})),t.afa.user.subscribe((function(e){return m(t,void 0,void 0,(function(){return y(this,(function(t){switch(t.label){case 0:return[4,n(e)];case 1:return t.sent(),[2]}}))}))}))}))},r.prototype.getCurrentUserClaim=function(e){return this.selectCurrentUserClaim(e).pipe(s.take(1)).toPromise()},r.prototype.resetPassword=function(e){return m(this,void 0,void 0,(function(){var t;return y(this,(function(r){switch(r.label){case 0:return r.trys.push([0,1,,3]),this.fire.addLogMessage("Password reset email sent"),this.afa.sendPasswordResetEmail(e),this.ui.toast("auth.resetPassword.onResetRequestedTo",{duration:this.config.authUi.toastDefaultDurationMil,interpolateParams:{email:e},position:"bottom"}),[3,3];case 1:return t=r.sent(),[4,this.handleError(t)];case 2:return r.sent(),[3,3];case 3:return[2]}}))}))},r.prototype.signInWith=function(t,r){var n,i;return m(this,void 0,void 0,(function(){var o,s,a,u,c,l,h,d=this;return y(this,(function(f){switch(f.label){case 0:return this.fire.addLogMessage("SignInWithProvider; provider="+t),[4,this.ui.createLoading()];case 1:o=f.sent(),f.label=2;case 2:return f.trys.push([2,28,,31]),s=null,[4,this.afa.currentUser];case 3:return a=f.sent(),u=null,a&&a.isAnonymous&&(null===(n=this.hooksService)||void 0===n?void 0:n.prepareMergeSource)&&t!==e.AuthProvider.ANONYMOUS?[4,this.hooksService.prepareMergeSource(a)]:[3,5];case 4:u=f.sent(),f.label=5;case 5:switch(t){case e.AuthProvider.ANONYMOUS:return[3,6];case e.AuthProvider.EmailAndPassword:return[3,12];case e.AuthProvider.PhoneNumber:return[3,18]}return[3,19];case 6:if(a)throw new Error("Cannot signIn anonymously whilst already signedIn, SignOut first");return[4,this.confirmTos(null,r)];case 7:return f.sent()?(o.present(),[4,this.afa.signInAnonymously()]):[3,11];case 8:return s=f.sent(),[4,this.confirmTos(s,{skipTosCheck:!0})];case 9:return f.sent(),[4,o.dismiss()];case 10:f.sent(),f.label=11;case 11:return[3,21];case 12:if(a&&!a.isAnonymous)throw new Error("Cannot signIn whilst already signedIn, SignOut first");if(!(null==r?void 0:r.credentials))throw new Error("Credentials are required when signing in with AuthProvider.EmailAndPassword");return o.present(),[4,this.afa.signInWithEmailAndPassword(r.credentials.email,r.credentials.password)];case 13:return s=f.sent(),[4,o.dismiss()];case 14:return f.sent(),[4,this.confirmTos(s,r)];case 15:return f.sent()?[3,17]:[4,this.signOut()];case 16:f.sent(),s=null,f.label=17;case 17:case 18:return[3,21];case 19:return o.present(),[4,this.socialAuth(t,Object.assign(Object.assign({},r),{permitNamedUserExec:!1,permitAnonUserExec:!0,permitNullUserExec:!0,withCredentialFn:function(e,t){return m(d,void 0,void 0,(function(){return y(this,(function(t){switch(t.label){case 0:return[4,this.afa.signInWithCredential(e)];case 1:return[2,t.sent()]}}))}))},withProviderFn:function(e,t){return m(d,void 0,void 0,(function(){return y(this,(function(t){switch(t.label){case 0:return[4,this.afa.signInWithPopup(e)];case 1:return[2,t.sent()]}}))}))},onSuccessFn:function(e){return m(d,void 0,void 0,(function(){return y(this,(function(t){switch(t.label){case 0:return[4,o.dismiss()];case 1:return t.sent(),[4,this.confirmTos(e,r)];case 2:return t.sent()?[3,4]:[4,this.signOut()];case 3:return t.sent(),[2,null];case 4:return[2,e]}}))}))}}))];case 20:s=f.sent(),f.label=21;case 21:if(!s||!s.user)return[3,26];if(this.config.authUi.toastMessageOnAuthSuccess&&(c="string"==typeof this.config.authUi.toastMessageOnAuthSuccess?this.config.authUi.toastMessageOnAuthSuccess:"Hello "+(s.user.displayName?s.user.displayName:"")+"!",this.ui.toast(c,{duration:this.config.authUi.toastDefaultDurationMil})),!u||!(null===(i=this.hooksService)||void 0===i?void 0:i.applyMergeToTarget))return[3,25];f.label=22;case 22:return f.trys.push([22,24,,25]),[4,this.hooksService.applyMergeToTarget(s.user,u)];case 23:return f.sent(),[3,25];case 24:return l=f.sent(),this.fire.recordException(l),[3,25];case 25:this.onSignInEmitter.emit(s.user),f.label=26;case 26:return[4,o.dismiss()];case 27:return f.sent(),[2,s||null];case 28:return h=f.sent(),[4,this.handleError(h)];case 29:return f.sent(),[4,o.dismiss()];case 30:return f.sent(),[2,null];case 31:return[2]}}))}))},r.prototype.reauthenicateWithProvider=function(t,r){return m(this,void 0,void 0,(function(){var n,i,o,s,u,c=this;return y(this,(function(l){switch(l.label){case 0:return this.fire.addLogMessage("reauthenicateWithProvider; provider="+t),[4,this.ui.createLoading()];case 1:n=l.sent(),l.label=2;case 2:return l.trys.push([2,12,,15]),i=null,[4,this.afa.currentUser];case 3:if(!(o=l.sent())||o.isAnonymous)throw new Error("Caanot reauthticate if no currentUser or currentUser is anonymous");switch(n.present(),t){case e.AuthProvider.ANONYMOUS:return[3,4];case e.AuthProvider.EmailAndPassword:return[3,5];case e.AuthProvider.PhoneNumber:return[3,7]}return[3,8];case 4:throw new Error("Cannot reauthenticate with anonymous Credentials");case 5:if(!(null==r?void 0:r.credentials))throw new Error("Credentials are required when reauthenticating with AuthProvider.EmailAndPassword");if(!o.email)throw new Error("Cannot reauthenticate with email for an account without email");if(!a.firebase.auth)throw new Error("firebase.auth is undefined");return this.fire.addLogMessage("creating email credential with firebase; email="+r.credentials.email),s=a.firebase.auth.EmailAuthProvider.credential(o.email,r.credentials.password),[4,o.reauthenticateWithCredential(s)];case 6:return i=l.sent(),[3,10];case 7:return[3,10];case 8:return[4,this.socialAuth(t,Object.assign(Object.assign({},r),{permitNamedUserExec:!0,permitNullUserExec:!1,permitAnonUserExec:!1,withCredentialFn:function(e,t){return m(c,void 0,void 0,(function(){return y(this,(function(r){switch(r.label){case 0:return t?[4,t.reauthenticateWithCredential(e)]:[3,2];case 1:return[2,r.sent()];case 2:throw new Error("Calling reauthenticate when no current user")}}))}))},withProviderFn:function(e,t){return m(c,void 0,void 0,(function(){return y(this,(function(r){switch(r.label){case 0:return t?[4,t.reauthenticateWithPopup(e)]:[3,2];case 1:return[2,r.sent()];case 2:throw new Error("Calling reauthenticate when no current user")}}))}))}}))];case 9:i=l.sent(),l.label=10;case 10:return[4,n.dismiss()];case 11:return l.sent(),[2,i||null];case 12:return u=l.sent(),[4,this.handleError(u)];case 13:return l.sent(),[4,n.dismiss()];case 14:return l.sent(),[2,null];case 15:return[2]}}))}))},r.prototype.linkCurrentUserToProvider=function(t,r){return m(this,void 0,void 0,(function(){var n,i,o,s,u,c,l=this;return y(this,(function(h){switch(h.label){case 0:return this.fire.addLogMessage("Linking current anon user to provider; provider="+t),[4,this.ui.createLoading()];case 1:n=h.sent(),h.label=2;case 2:return h.trys.push([2,15,,18]),[4,this.afa.currentUser];case 3:if(null===(i=h.sent()))throw new Error("CurrentUser is null");return[4,n.present()];case 4:switch(h.sent(),o=null,t){case e.AuthProvider.ANONYMOUS:return[3,5];case e.AuthProvider.EmailAndPassword:return[3,6];case e.AuthProvider.PhoneNumber:return[3,8]}return[3,9];case 5:throw new Error("Linking a new anonymous user makes no sense");case 6:if(!(null==r?void 0:r.credentials))throw new Error("Credentials required to link to email credentential");if(!a.firebase.auth)throw new Error("firebase.auth is undefined");return this.fire.addLogMessage("creating email credential with firebase; email="+r.credentials.email),s=a.firebase.auth.EmailAuthProvider.credential(r.credentials.email,r.credentials.password),this.fire.addLogMessage("linking userCredential to email authCredential"),[4,i.linkWithCredential(s)];case 7:return o=h.sent(),[3,11];case 8:throw new Error("Linking phone number not suported");case 9:return[4,this.socialAuth(t,Object.assign(Object.assign({},r),{permitNamedUserExec:!1,permitNullUserExec:!1,permitAnonUserExec:!0,withCredentialFn:function(e,t){return m(l,void 0,void 0,(function(){return y(this,(function(r){switch(r.label){case 0:return t?[4,t.linkWithCredential(e)]:[3,2];case 1:return[2,r.sent()];case 2:throw new Error("Trying to linkWithCrendential when no current user")}}))}))},withProviderFn:function(e,t){return m(l,void 0,void 0,(function(){return y(this,(function(r){switch(r.label){case 0:return t?[4,t.linkWithPopup(e)]:[3,2];case 1:return[2,r.sent()];case 2:throw new Error("Trying to linkWithPopup when no current user")}}))}))}}))];case 10:o=h.sent(),h.label=11;case 11:return o&&o.user?!(u=this.parseUserInfo(o.user)).displayName||o.user.displayName===u.displayName&&o.user.photoURL===u.displayName?[3,13]:(this.fire.addLogMessage("Updating user profile; displayName="+u.displayName+", photoUrl="+u.photoURL),[4,this.updateUserInfo({displayName:u.displayName,photoURL:u.photoURL})]):[3,13];case 12:h.sent(),h.label=13;case 13:return[4,n.dismiss()];case 14:return h.sent(),[2,o||null];case 15:return c=h.sent(),[4,this.handleError(c)];case 16:return h.sent(),[4,n.dismiss()];case 17:return h.sent(),[2,null];case 18:return[2]}}))}))},r.prototype.registerWith=function(t,r){return m(this,void 0,void 0,(function(){var n,i,o,s,a=this;return y(this,(function(u){switch(u.label){case 0:return this.fire.addLogMessage("SigningUp with provider; provider="+t),[4,this.ui.createLoading()];case 1:n=u.sent(),u.label=2;case 2:return u.trys.push([2,19,,21]),[4,this.afa.currentUser];case 3:return(null==(i=u.sent())?void 0:i.isAnonymous)?[2,this.linkCurrentUserToProvider(t,r)]:[3,4];case 4:if(null===i)return[3,5];throw new Error("Cannot Register whilst signed in as a non-Anonymous user. SignOut first");case 5:return[4,this.confirmTos(null,r)];case 6:if(!u.sent())return this.fire.addLogMessage("User declined TOS during register"),[2,null];u.label=7;case 7:switch(o=null,t){case e.AuthProvider.EmailAndPassword:return[3,8]}return[3,15];case 8:if(!(null==r?void 0:r.credentials)||!(null==r?void 0:r.displayName))throw new Error("Credentials & displayName required to SignUp by email");return[4,n.present()];case 9:return u.sent(),this.fire.addLogMessage("creaating user with email and password; email="+r.credentials.email),[4,this.afa.createUserWithEmailAndPassword(r.credentials.email,r.credentials.password)];case 10:if(null===(o=u.sent()).user)throw new Error("User is null following successful signUp");return[4,this.updateUserInfo({displayName:r.displayName})];case 11:return u.sent(),[4,this.confirmTos(o,{skipTosCheck:!0})];case 12:return u.sent(),this.config.authUi.enableEmailVerification?[4,o.user.sendEmailVerification()]:[3,14];case 13:u.sent(),u.label=14;case 14:return[3,18];case 15:return[4,n.present()];case 16:return u.sent(),[4,this.socialAuth(t,Object.assign(Object.assign({},r),{skipTosCheck:!0,permitNamedUserExec:!1,permitAnonUserExec:!0,permitNullUserExec:!0,withCredentialFn:function(e,t){return m(a,void 0,void 0,(function(){return y(this,(function(t){switch(t.label){case 0:return[4,this.afa.signInWithCredential(e)];case 1:return[2,t.sent()]}}))}))},withProviderFn:function(e,t){return m(a,void 0,void 0,(function(){return y(this,(function(t){switch(t.label){case 0:return[4,this.afa.signInWithPopup(e)];case 1:return[2,t.sent()]}}))}))}}))];case 17:o=u.sent(),u.label=18;case 18:return n.dismiss(),(null==o?void 0:o.user)&&this.onRegisterEmitter.emit(o.user),[2,o||null];case 19:return s=u.sent(),n.dismiss(),[4,this.handleError(s)];case 20:return u.sent(),[2,null];case 21:return[2]}}))}))},r.prototype.socialAuth=function(e,t){return m(this,void 0,void 0,(function(){var r,n,i,o,s,a,u;return y(this,(function(c){switch(c.label){case 0:return[4,this.afa.currentUser];case 1:if(r=c.sent(),n=null,i=!!r&&!r.isAnonymous,o=!!r&&r.isAnonymous,s=!r,!1===t.permitNamedUserExec&&i)throw new Error("Cannot perfom operation whilst signedIn, SignOut first");if(!1===t.permitAnonUserExec&&o)throw new Error("Cannot perfom operation whilst signedIn anonymously, SignOut first");if(!1===t.permitNullUserExec&&s)throw new Error("Cannot perfom operation whilst not signed in.");return a=void 0,this.credFactory?[4,this.credFactory.isProviderSupported(e)]:[3,3];case 2:a=c.sent(),c.label=3;case 3:return a?[4,this.credFactory.getCredential(e)]:[3,7];case 4:return(u=c.sent())?[4,t.withCredentialFn(u,r)]:[3,6];case 5:n=c.sent(),c.label=6;case 6:return[3,10];case 7:return!1!==a&&this.isWebPlatform?[4,t.withProviderFn(this.getAuthProvider(e),r)]:[3,9];case 8:return n=c.sent(),[3,10];case 9:throw new Error("Cannot perfom operation on current device.");case 10:return n&&t.onSuccessFn?[4,t.onSuccessFn(n)]:[3,12];case 11:n=c.sent(),c.label=12;case 12:return[2,n]}}))}))},r.prototype.confirmTos=function(e,t){var r;return void 0===e&&(e=null),void 0===t&&(t={}),m(this,void 0,void 0,(function(){var n,i,o;return y(this,(function(s){switch(s.label){case 0:return this.config.authUi.tosUrl||this.config.authUi.privacyPolicyUrl?(n=t.skipTosCheck?(new Date).toISOString():null)||!(null==e?void 0:e.user)||(null===(r=null==e?void 0:e.additionalUserInfo)||void 0===r?void 0:r.isNewUser)||!this.config.authUi.enableFirestoreSync?[3,2]:[4,this.fireStoreService.getUserData(e.user.uid)]:[3,7];case 1:i=s.sent(),n=(null==i?void 0:i.acceptedTos)||null,s.label=2;case 2:return(o=!n)?[4,this.ui.confirmTos()]:[3,4];case 3:o=s.sent(),s.label=4;case 4:return o&&(n=(new Date).toISOString()),(null==e?void 0:e.user)&&this.config.authUi.enableFirestoreSync?[4,this.fireStoreService.setUserData(e.user.uid,{acceptedTos:n},{merge:!0})]:[3,6];case 5:s.sent(),s.label=6;case 6:return[2,!!n];case 7:return[2,!0]}}))}))},r.prototype.sendNewVerificationEmail=function(){return m(this,void 0,void 0,(function(){var e,t;return y(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),[4,this.afa.currentUser];case 1:if(!(e=r.sent()))throw new Error("No signed in user");return[4,e.sendEmailVerification()];case 2:return r.sent(),[3,4];case 3:throw t=r.sent(),this.fire.recordException(t),t;case 4:return[2]}}))}))},r.prototype.signOut=function(){return m(this,void 0,void 0,(function(){var e;return y(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,4]),[4,this.afa.signOut()];case 1:return t.sent(),this.credFactory&&this.credFactory.signOut(),[3,4];case 2:return e=t.sent(),[4,this.handleError(e)];case 3:return t.sent(),[3,4];case 4:return[2]}}))}))},r.prototype.updateUserInfo=function(e){return m(this,void 0,void 0,(function(){var t,r;return y(this,(function(n){switch(n.label){case 0:return n.trys.push([0,11,,12]),[4,this.afa.currentUser];case 1:if(!(t=n.sent()))throw new Error("No currentUser");return e.email?[4,t.updateEmail(e.email)]:[3,3];case 2:n.sent(),n.label=3;case 3:return e.phoneNumber?[4,t.updatePhoneNumber(e.phoneNumber)]:[3,5];case 4:n.sent(),n.label=5;case 5:return e.displayName||e.photoURL?[4,t.updateProfile({displayName:e.displayName,photoURL:e.photoURL})]:[3,7];case 6:n.sent(),n.label=7;case 7:return[4,this.afa.updateCurrentUser(t)];case 8:return n.sent(),this.config.authUi.enableFirestoreSync?[4,this.fireStoreService.updateUserData(t.uid,{displayName:t.displayName,email:t.email,photoURL:t.photoURL})]:[3,10];case 9:n.sent(),n.label=10;case 10:return this.onUserUpdatedEmitter.emit(),[3,12];case 11:return r=n.sent(),this.fire.recordException(r),[3,12];case 12:return[2]}}))}))},r.prototype.parseUserInfo=function(e){var t={uid:e.uid,displayName:e.displayName,email:e.email,phoneNumber:e.phoneNumber,photoURL:e.photoURL,providerId:e.providerId};return e.providerData&&e.providerData.forEach((function(e){!t.displayName&&(null==e?void 0:e.displayName)&&(t.displayName=e.displayName),!t.email&&(null==e?void 0:e.email)&&(t.email=e.email),!t.phoneNumber&&(null==e?void 0:e.phoneNumber)&&(t.phoneNumber=e.phoneNumber),!t.photoURL&&(null==e?void 0:e.photoURL)&&(t.photoURL=e.photoURL),!t.providerId&&(null==e?void 0:e.providerId)&&(t.providerId=e.providerId)})),t},r.prototype.getUserPhotoUrl=function(){return this.user$.pipe(s.map((function(t){return t?t.photoURL?t.photoURL:t.emailVerified?"assets/user/"+e.Accounts.CHECK+".svg":t.isAnonymous?"assets/user/"+e.Accounts.OFF+".svg":"assets/user/"+e.Accounts.NONE+".svg":null})))},r.prototype.reloadUserInfo=function(){return m(this,void 0,void 0,(function(){var e;return y(this,(function(t){switch(t.label){case 0:return[4,this.user$.pipe(s.take(1)).toPromise()];case 1:return(e=t.sent())?[4,e.reload()]:[3,3];case 2:t.sent(),t.label=3;case 3:return[2]}}))}))},r.prototype.deleteUser=function(){var t;return m(this,void 0,void 0,(function(){var r,n,i,o;return y(this,(function(s){switch(s.label){case 0:return[4,this.afa.currentUser];case 1:if(r=s.sent(),n=null==r?void 0:r.uid,!r||!n)throw new Error("Unable to delete currentUser if null");return(null===(t=this.hooksService)||void 0===t?void 0:t.beforeDelete)?[4,this.hooksService.beforeDelete(r)]:[3,3];case 2:return i=s.sent(),[3,4];case 3:i=!0,s.label=4;case 4:if(!i)return[3,8];s.label=5;case 5:return s.trys.push([5,7,,8]),[4,r.delete()];case 6:return s.sent(),this.onUserDeletedEmitter.emit(),[3,8];case 7:throw(o=s.sent()).code!==e.FirebaseErrorCodes.requiresRecentLogin&&this.fire.recordException(o),o;case 8:return[2]}}))}))},r.prototype.handleError=function(e){return m(this,void 0,void 0,(function(){var t;return y(this,(function(r){switch(r.label){case 0:return[4,this.fire.recordException(e)];case 1:return r.sent(),this.onErrorEmitter.emit(e),this.config.authUi.toastMessageOnAuthError?(t="auth.common.pleaseRetry",e&&"string"==typeof e?t=e:e&&e.message?t=e.message:e&&"object"==typeof e?t=JSON.stringify(e):e&&(t=e.toString()),[4,this.ui.toast(t,{duration:this.config.authUi.toastDefaultDurationMil})]):[3,3];case 2:r.sent(),r.label=3;case 3:return[2]}}))}))},r.prototype.getAuthProvider=function(t){if(!a.firebase.auth)throw new Error("firebase.auth is undefined");switch(t){case e.AuthProvider.Google:return new a.firebase.auth.GoogleAuthProvider;case e.AuthProvider.Apple:return new a.firebase.auth.OAuthProvider("apple.com");case e.AuthProvider.Facebook:return new a.firebase.auth.FacebookAuthProvider;case e.AuthProvider.Twitter:return new a.firebase.auth.TwitterAuthProvider;case e.AuthProvider.Github:return new a.firebase.auth.GithubAuthProvider;case e.AuthProvider.Microsoft:return new a.firebase.auth.OAuthProvider("microsoft.com");case e.AuthProvider.Yahoo:return new a.firebase.auth.OAuthProvider("yahoo.com");default:throw new Error(t+" is not available as auth provider")}},r}();K.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new K(t.ɵɵinject(R),t.ɵɵinject(O,8),t.ɵɵinject(L,8),t.ɵɵinject(H),t.ɵɵinject(c.AngularFireAuth),t.ɵɵinject(B),t.ɵɵinject(Y))},token:K,providedIn:"root"}),K.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],K.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Inject,args:[t.forwardRef((function(){return R}))]}]},{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[t.forwardRef((function(){return O}))]}]},{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[t.forwardRef((function(){return L}))]}]},{type:H},{type:c.AngularFireAuth},{type:B},{type:Y}]},e.DisplayWidth=void 0,(J=e.DisplayWidth||(e.DisplayWidth={}))[J.xs=1]="xs",J[J.sm=576]="sm",J[J.md=768]="md",J[J.lg=992]="lg",J[J.xl=1200]="xl";var Z=function(){function e(){this.valueChange=new t.EventEmitter,this.propagateChange=function(e){},this.propagateTouch=function(e){},this.propagateValidatorChange=function(){}}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(e){e&&(this._value=e,this.valueChange.emit(e),this.propagateChange(e))},enumerable:!1,configurable:!0}),e.prototype.validate=function(e){return null},e.prototype.writeValue=function(e){this.value=e},e.prototype.registerOnChange=function(e){this.propagateChange=e},e.prototype.registerOnTouched=function(e){this.propagateTouch=e},e.prototype.registerOnValidatorChange=function(e){this.propagateValidatorChange=e},e}();Z.propDecorators={value:[{type:t.Input}],valueChange:[{type:t.Output}]};var X=function(){function e(e,r){this.injector=e,this.cdRef=r,this.destroy$=new n.ReplaySubject,this.valueChange=new t.EventEmitter,this.propagateChange=function(e){},this.propagateTouch=function(){},this.propagateValidatorChange=function(){}}return Object.defineProperty(e.prototype,"_control",{get:function(){if(!this.control)throw new Error("ValueAccessorControlComponent: this.control must be eclipsed in the subclass");return this.control},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this._control.value},set:function(e){e?this._control.setValue(e):this._control.reset()},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){var e=this;this._control.valueChanges.pipe(s.takeUntil(this.destroy$)).subscribe((function(t){e._control.dirty&&(e.propagateChange(t),e.propagateTouch(),e.valueChange.emit(t))})),this._control.statusChanges.pipe(s.takeUntil(this.destroy$)).subscribe((function(){return e.propagateValidatorChange()}))},e.prototype.ngAfterViewInit=function(){this.parentControl=this.injector.get(l.NgControl,null),this.cdRef.detectChanges()},e.prototype.ngOnDestroy=function(){this.destroy$.next(),this.destroy$.complete()},e.prototype.writeValue=function(e){this.value=e},e.prototype.registerOnChange=function(e){this.propagateChange=e},e.prototype.registerOnTouched=function(e){this.propagateTouch=e},e.prototype.registerOnValidatorChange=function(e){this.propagateValidatorChange=e},e.prototype.setDisabledState=function(e){e?this._control.disable():this._control.enable()},e.prototype.validate=function(e){return this._control.errors},e}();X.propDecorators={value:[{type:t.Input}],valueChange:[{type:t.Output}]};var z=function(){function e(e,t,r){this.config=e,this.router=t,this.aps=r}return e.prototype.guardOutcome=function(e){var t=this;return this.aps.user$.pipe(s.take(1),s.map((function(r){return r?!(t.config.authUi.guardProtectedRoutesUntilEmailIsVerified&&!r.emailVerified&&!r.isAnonymous)||(t.config.authUi.authGuardVerifyEmailURL?t.router.createUrlTree([""+t.config.authUi.authGuardVerifyEmailURL],{queryParams:{redirectUrl:e}}):!!t.config.authUi.authGuardFallbackURL&&t.router.createUrlTree([""+t.config.authUi.authGuardFallbackURL],{queryParams:{redirectUrl:e}})):!!t.config.authUi.authGuardFallbackURL&&t.router.createUrlTree([""+t.config.authUi.authGuardFallbackURL],{queryParams:{redirectUrl:e}})})))},e.prototype.canLoad=function(e,t){return this.guardOutcome(t[0].parameters.url)},e.prototype.canActivate=function(e,t){return this.guardOutcome(t.url)},e}();z.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new z(t.ɵɵinject(R),t.ɵɵinject(h.Router),t.ɵɵinject(K))},token:z,providedIn:"root"}),z.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],z.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Inject,args:[R]}]},{type:h.Router},{type:K}]};var Q=function(){function e(e,t,r){this.config=e,this.router=t,this.aps=r}return e.prototype.canActivate=function(e,t){var r=this;return this.aps.user$.pipe(s.map((function(e){return!(e&&!e.emailVerified&&!e.isAnonymous&&r.config.authUi.authGuardVerifyEmailURL)||r.router.createUrlTree([""+r.config.authUi.authGuardVerifyEmailURL],{queryParams:{redirectUrl:t.url}})})))},e}();Q.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new Q(t.ɵɵinject(R),t.ɵɵinject(h.Router),t.ɵɵinject(K))},token:Q,providedIn:"root"}),Q.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],Q.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Inject,args:[R]}]},{type:h.Router},{type:K}]};var ee=[d.HttpClientModule,c.AngularFireAuthModule,o.AngularFirestoreModule,v.AngularFireFunctionsModule],te=function(){function e(){}return e.forRoot=function(n,s){var a;return void 0===s&&(s=function(){}),{ngModule:e,providers:[{provide:F,useValue:n},{provide:R,useFactory:T,deps:[F]},{provide:r.DEFAULTS,useValue:n.configDefaults},{provide:r.SETTINGS,useFactory:function(){return t.isDevMode()?{minimumFetchIntervalMillis:36e5}:{}}},{provide:p.FIREBASE_OPTIONS,useValue:n.firebase},{provide:p.FIREBASE_APP_NAME,useFactory:s},{provide:c.USE_EMULATOR,useFactory:ie,deps:[R]},{provide:o.USE_EMULATOR,useFactory:oe,deps:[R]},{provide:v.USE_EMULATOR,useFactory:se,deps:[R]},{provide:v.REGION,useValue:(null===(a=n.services)||void 0===a?void 0:a.firebaseRegion)||null},{provide:i.AngularFirePerformance,useFactory:re,deps:[R,p.FirebaseApp,[new t.Optional,i.DATA_COLLECTION_ENABLED],[new t.Optional,i.INSTRUMENTATION_ENABLED],t.NgZone,t.PLATFORM_ID]},{provide:r.AngularFireRemoteConfig,useFactory:ne,deps:[R,p.FIREBASE_OPTIONS,p.FIREBASE_APP_NAME,r.SETTINGS,r.DEFAULTS,t.NgZone,t.PLATFORM_ID]},V,q,B,Y,S,K,H,G,c.AngularFireAuth,z,Q]}},e}();function re(e,t,r,n,o,s){return e.services.firebasePerformance?new i.AngularFirePerformance(t,r,n,o,s):null}function ne(e,t,n,i,o,s,a){return e.services.firebaseRemoteConfig?new r.AngularFireRemoteConfig(t,n,i,o,s,a):null}function ie(e){return!0===e.services.firebaseAuth?void 0:e.services.firebaseAuth}function oe(e){return!0===e.services.firebaseFirestore?void 0:e.services.firebaseFirestore}function se(e){return!0===e.services.firebaseFunctions?void 0:e.services.firebaseFunctions}te.decorators=[{type:t.NgModule,args:[{imports:w(ee,[f.TranslateModule.forChild(),p.AngularFireModule]),exports:w(ee,[f.TranslateModule])}]}],e.AnalyticsService=V,e.AuthAlertsUIProviderToken=x,e.AuthAnalyticsProviderToken=j,e.AuthCrashlyticsProviderToken=N,e.AuthCredentialFactoryProviderToken=L,e.AuthDeviceInfoService=g,e.AuthFirestoreSyncService=H,e.AuthHooksProviderToken=O,e.AuthLegaliyDialogUIProiderToken=_,e.AuthLoadingUIProviderToken=M,e.AuthPickerUIProviderToken=D,e.AuthProcessService=K,e.AuthSharedConfigToken=R,e.AuthSharedModule=te,e.AuthToastUIProviderToken=$,e.AuthUserProvidedConfigToken=F,e.AuthhServiceProviderToken=k,e.CrashlyticsService=q,e.FirebaseService=B,e.LoggedInGuard=z,e.PHONE_NUMBER_REGEX=C,e.PerformanceService=G,e.PerformanceTraceNoop=W,e.RemoteConfigService=S,e.UiService=Y,e.ValueAccessorControlComponent=X,e.ValueAccessorValueComponent=Z,e.VerifyEmailGuard=Q,e.authEmulatorFactory=ie,e.authSharedConfigFactory=T,e.defaultAuthFirebaseUIConfig=I,e.firestoreEmulatorFactory=oe,e.functionsEmulatorFactory=se,e.performanceProviderFactory=re,e.remoteConfigFirebaseService=ne,e.ɵa=j,e.ɵc=N,e.ɵe=R,e.ɵf=O,e.ɵg=L,e.ɵk=$,e.ɵl=x,e.ɵm=M,e.ɵn=_,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=ionic-firebase-auth.umd.min.js.map