ngx-firebase 1.1.12 → 22.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (274) hide show
  1. package/README.md +51 -11
  2. package/fesm2022/ngx-firebase.mjs +158 -0
  3. package/fesm2022/ngx-firebase.mjs.map +1 -0
  4. package/package.json +40 -30
  5. package/types/ngx-firebase.d.ts +55 -0
  6. package/bundles/ngx-firebase-capacitor.umd.js +0 -763
  7. package/bundles/ngx-firebase-capacitor.umd.js.map +0 -1
  8. package/bundles/ngx-firebase-capacitor.umd.min.js +0 -16
  9. package/bundles/ngx-firebase-capacitor.umd.min.js.map +0 -1
  10. package/bundles/ngx-firebase-iap.umd.js +0 -718
  11. package/bundles/ngx-firebase-iap.umd.js.map +0 -1
  12. package/bundles/ngx-firebase-iap.umd.min.js +0 -2
  13. package/bundles/ngx-firebase-iap.umd.min.js.map +0 -1
  14. package/bundles/ngx-firebase-ionic-auth-ui.umd.js +0 -2116
  15. package/bundles/ngx-firebase-ionic-auth-ui.umd.js.map +0 -1
  16. package/bundles/ngx-firebase-ionic-auth-ui.umd.min.js +0 -16
  17. package/bundles/ngx-firebase-ionic-auth-ui.umd.min.js.map +0 -1
  18. package/bundles/ngx-firebase-ionic.umd.js +0 -979
  19. package/bundles/ngx-firebase-ionic.umd.js.map +0 -1
  20. package/bundles/ngx-firebase-ionic.umd.min.js +0 -16
  21. package/bundles/ngx-firebase-ionic.umd.min.js.map +0 -1
  22. package/bundles/ngx-firebase-testing.umd.js +0 -801
  23. package/bundles/ngx-firebase-testing.umd.js.map +0 -1
  24. package/bundles/ngx-firebase-testing.umd.min.js +0 -2
  25. package/bundles/ngx-firebase-testing.umd.min.js.map +0 -1
  26. package/bundles/ngx-firebase.umd.js +0 -2271
  27. package/bundles/ngx-firebase.umd.js.map +0 -1
  28. package/bundles/ngx-firebase.umd.min.js +0 -2
  29. package/bundles/ngx-firebase.umd.min.js.map +0 -1
  30. package/capacitor/capacitor.module.d.ts +0 -9
  31. package/capacitor/interfaces/config.d.ts +0 -12
  32. package/capacitor/interfaces/index.d.ts +0 -1
  33. package/capacitor/ngx-firebase-capacitor.d.ts +0 -5
  34. package/capacitor/ngx-firebase-capacitor.metadata.json +0 -1
  35. package/capacitor/package.json +0 -25
  36. package/capacitor/public-api.d.ts +0 -3
  37. package/capacitor/services/analytics-firebase-capacitor.service.d.ts +0 -9
  38. package/capacitor/services/crashlytics-firebase-capacitor.service.d.ts +0 -8
  39. package/capacitor/services/credential-factory-capacitor.service.d.ts +0 -18
  40. package/capacitor/services/index.d.ts +0 -3
  41. package/esm2015/capacitor/capacitor.module.js +0 -78
  42. package/esm2015/capacitor/interfaces/config.js +0 -3
  43. package/esm2015/capacitor/interfaces/index.js +0 -2
  44. package/esm2015/capacitor/ngx-firebase-capacitor.js +0 -6
  45. package/esm2015/capacitor/public-api.js +0 -4
  46. package/esm2015/capacitor/services/analytics-firebase-capacitor.service.js +0 -43
  47. package/esm2015/capacitor/services/crashlytics-firebase-capacitor.service.js +0 -40
  48. package/esm2015/capacitor/services/credential-factory-capacitor.service.js +0 -182
  49. package/esm2015/capacitor/services/index.js +0 -4
  50. package/esm2015/iap/iap.module.js +0 -32
  51. package/esm2015/iap/interfaces/index.js +0 -5
  52. package/esm2015/iap/ngx-firebase-iap.js +0 -5
  53. package/esm2015/iap/public-api.js +0 -5
  54. package/esm2015/iap/services/iap.service.js +0 -317
  55. package/esm2015/iap/tokens/index.js +0 -4
  56. package/esm2015/ionic/animations/index.js +0 -30
  57. package/esm2015/ionic/components/avatar/avatar.component.js +0 -98
  58. package/esm2015/ionic/components/avatar/index.js +0 -2
  59. package/esm2015/ionic/components/index.js +0 -3
  60. package/esm2015/ionic/components/popover-menu/index.js +0 -3
  61. package/esm2015/ionic/components/popover-menu/interface.js +0 -2
  62. package/esm2015/ionic/components/popover-menu/popover-menu.component.js +0 -34
  63. package/esm2015/ionic/ionic.module.js +0 -46
  64. package/esm2015/ionic/ngx-firebase-ionic.js +0 -5
  65. package/esm2015/ionic/public-api.js +0 -5
  66. package/esm2015/ionic/services/alerts-ionic.service.js +0 -107
  67. package/esm2015/ionic/services/index.js +0 -6
  68. package/esm2015/ionic/services/legality-dialog-ionic.service.js +0 -85
  69. package/esm2015/ionic/services/loading-ionic.service.js +0 -46
  70. package/esm2015/ionic/services/picker-ionic.service.js +0 -44
  71. package/esm2015/ionic/services/toast-ionic.service.js +0 -49
  72. package/esm2015/ionic-auth-ui/animations/index.js +0 -30
  73. package/esm2015/ionic-auth-ui/components/email-confirmation/email-confirmation.component.js +0 -99
  74. package/esm2015/ionic-auth-ui/components/email-field/email-field.component.js +0 -25
  75. package/esm2015/ionic-auth-ui/components/form-field/form-field.component.js +0 -82
  76. package/esm2015/ionic-auth-ui/components/index.js +0 -12
  77. package/esm2015/ionic-auth-ui/components/name-field/name-field.component.js +0 -30
  78. package/esm2015/ionic-auth-ui/components/or-divider/or-divider.component.js +0 -11
  79. package/esm2015/ionic-auth-ui/components/password-field/password-field.component.js +0 -138
  80. package/esm2015/ionic-auth-ui/components/password-field/passwordValidatorFunctions.js +0 -62
  81. package/esm2015/ionic-auth-ui/components/providers/providers.component.js +0 -70
  82. package/esm2015/ionic-auth-ui/components/reauthenticate/reauthenticate.component.js +0 -99
  83. package/esm2015/ionic-auth-ui/components/register/register.component.js +0 -142
  84. package/esm2015/ionic-auth-ui/components/register-with-email/register-with-email.component.js +0 -60
  85. package/esm2015/ionic-auth-ui/components/register-with-email-popover/register-with-email-popover.component.js +0 -26
  86. package/esm2015/ionic-auth-ui/components/signin/signin.component.js +0 -92
  87. package/esm2015/ionic-auth-ui/components/terms-field/terms-field.component.js +0 -99
  88. package/esm2015/ionic-auth-ui/components/user/user.component.js +0 -195
  89. package/esm2015/ionic-auth-ui/ionic-auth-ui.module.js +0 -92
  90. package/esm2015/ionic-auth-ui/ngx-firebase-ionic-auth-ui.js +0 -23
  91. package/esm2015/ionic-auth-ui/pages/index.js +0 -5
  92. package/esm2015/ionic-auth-ui/pages/register/index.js +0 -2
  93. package/esm2015/ionic-auth-ui/pages/register/register.page.js +0 -56
  94. package/esm2015/ionic-auth-ui/pages/signin/index.js +0 -2
  95. package/esm2015/ionic-auth-ui/pages/signin/signin.page.js +0 -78
  96. package/esm2015/ionic-auth-ui/pages/user/index.js +0 -2
  97. package/esm2015/ionic-auth-ui/pages/user/user.page.js +0 -11
  98. package/esm2015/ionic-auth-ui/pages/verifyemail/index.js +0 -2
  99. package/esm2015/ionic-auth-ui/pages/verifyemail/verifyemail.page.js +0 -85
  100. package/esm2015/ionic-auth-ui/public-api.js +0 -5
  101. package/esm2015/ngx-firebase.js +0 -6
  102. package/esm2015/public-api.js +0 -6
  103. package/esm2015/shared/guards/index.js +0 -3
  104. package/esm2015/shared/guards/logged-in.guard.js +0 -60
  105. package/esm2015/shared/guards/verify-email.guard.js +0 -41
  106. package/esm2015/shared/interfaces/accounts.enum.js +0 -9
  107. package/esm2015/shared/interfaces/authprovider.enum.js +0 -15
  108. package/esm2015/shared/interfaces/config.interface.js +0 -61
  109. package/esm2015/shared/interfaces/index.js +0 -8
  110. package/esm2015/shared/interfaces/main.interface.js +0 -7
  111. package/esm2015/shared/interfaces/providers.interface.js +0 -2
  112. package/esm2015/shared/interfaces/tokens.js +0 -19
  113. package/esm2015/shared/interfaces/ui-providers.interface.js +0 -2
  114. package/esm2015/shared/services/analytics.service.js +0 -24
  115. package/esm2015/shared/services/auth-process.service.js +0 -752
  116. package/esm2015/shared/services/crashlytics.service.js +0 -42
  117. package/esm2015/shared/services/device-info.service.js +0 -14
  118. package/esm2015/shared/services/firebase.service.js +0 -37
  119. package/esm2015/shared/services/firestore-sync.service.js +0 -60
  120. package/esm2015/shared/services/index.js +0 -10
  121. package/esm2015/shared/services/performance.service.js +0 -28
  122. package/esm2015/shared/services/remoteconfig.service.js +0 -49
  123. package/esm2015/shared/services/ui.service.js +0 -45
  124. package/esm2015/shared/shared.module.js +0 -175
  125. package/esm2015/shared/types/DisplayWidth.js +0 -9
  126. package/esm2015/shared/types/Location.js +0 -2
  127. package/esm2015/shared/types/ValueAccessorControlComponent.js +0 -85
  128. package/esm2015/shared/types/ValueAccessorValueComponent.js +0 -40
  129. package/esm2015/shared/types/index.js +0 -5
  130. package/esm2015/testing/fakeavatar.module.js +0 -22
  131. package/esm2015/testing/fakes/FakeAuthProcessService.js +0 -31
  132. package/esm2015/testing/fakes/FakeAvatarComponent.js +0 -13
  133. package/esm2015/testing/fakes/FakeFireService.js +0 -21
  134. package/esm2015/testing/fakes/FakeFirestoreSyncService.js +0 -11
  135. package/esm2015/testing/fakes/FakeIAPurchaseService.js +0 -11
  136. package/esm2015/testing/fakes/FakePickerService.js +0 -9
  137. package/esm2015/testing/fakes/FakeRemoteConfigService.js +0 -44
  138. package/esm2015/testing/fakes/FakeTranslateService.js +0 -21
  139. package/esm2015/testing/fakes/FakeUiService.js +0 -26
  140. package/esm2015/testing/fakes/angular-fire/FakeAngularFireAuth.js +0 -30
  141. package/esm2015/testing/fakes/angular-fire/FakeAngularFireFunctions.js +0 -17
  142. package/esm2015/testing/fakes/angular-fire/FakeAngularFirePerformance.js +0 -17
  143. package/esm2015/testing/fakes/angular-fire/FakeAngularFireStorage.js +0 -8
  144. package/esm2015/testing/fakes/angular-fire/FakeAngularFirestore.js +0 -8
  145. package/esm2015/testing/fakes/angular-fire/FakeUserCredential.js +0 -18
  146. package/esm2015/testing/fakes/index.js +0 -19
  147. package/esm2015/testing/ngx-firebase-testing.js +0 -6
  148. package/esm2015/testing/public-api.js +0 -5
  149. package/esm2015/testing/test.module.js +0 -66
  150. package/esm2015/testing/utils/index.js +0 -17
  151. package/esm2015/testing/utils/patchConsole.js +0 -14
  152. package/fesm2015/ngx-firebase-capacitor.js +0 -328
  153. package/fesm2015/ngx-firebase-capacitor.js.map +0 -1
  154. package/fesm2015/ngx-firebase-iap.js +0 -354
  155. package/fesm2015/ngx-firebase-iap.js.map +0 -1
  156. package/fesm2015/ngx-firebase-ionic-auth-ui.js +0 -1482
  157. package/fesm2015/ngx-firebase-ionic-auth-ui.js.map +0 -1
  158. package/fesm2015/ngx-firebase-ionic.js +0 -495
  159. package/fesm2015/ngx-firebase-ionic.js.map +0 -1
  160. package/fesm2015/ngx-firebase-testing.js +0 -388
  161. package/fesm2015/ngx-firebase-testing.js.map +0 -1
  162. package/fesm2015/ngx-firebase.js +0 -1482
  163. package/fesm2015/ngx-firebase.js.map +0 -1
  164. package/iap/iap.module.d.ts +0 -5
  165. package/iap/interfaces/index.d.ts +0 -11
  166. package/iap/ngx-firebase-iap.d.ts +0 -4
  167. package/iap/ngx-firebase-iap.metadata.json +0 -1
  168. package/iap/package.json +0 -23
  169. package/iap/public-api.d.ts +0 -4
  170. package/iap/services/iap.service.d.ts +0 -47
  171. package/iap/tokens/index.d.ts +0 -3
  172. package/ionic/animations/index.d.ts +0 -1
  173. package/ionic/components/avatar/avatar.component.d.ts +0 -27
  174. package/ionic/components/avatar/index.d.ts +0 -1
  175. package/ionic/components/index.d.ts +0 -2
  176. package/ionic/components/popover-menu/index.d.ts +0 -2
  177. package/ionic/components/popover-menu/interface.d.ts +0 -6
  178. package/ionic/components/popover-menu/popover-menu.component.d.ts +0 -10
  179. package/ionic/ionic.module.d.ts +0 -2
  180. package/ionic/ngx-firebase-ionic.d.ts +0 -4
  181. package/ionic/ngx-firebase-ionic.metadata.json +0 -1
  182. package/ionic/package.json +0 -30
  183. package/ionic/public-api.d.ts +0 -4
  184. package/ionic/services/alerts-ionic.service.d.ts +0 -13
  185. package/ionic/services/index.d.ts +0 -5
  186. package/ionic/services/legality-dialog-ionic.service.d.ts +0 -10
  187. package/ionic/services/loading-ionic.service.d.ts +0 -17
  188. package/ionic/services/picker-ionic.service.d.ts +0 -9
  189. package/ionic/services/toast-ionic.service.d.ts +0 -11
  190. package/ionic-auth-ui/animations/index.d.ts +0 -1
  191. package/ionic-auth-ui/components/email-confirmation/email-confirmation.component.d.ts +0 -31
  192. package/ionic-auth-ui/components/email-field/email-field.component.d.ts +0 -7
  193. package/ionic-auth-ui/components/form-field/form-field.component.d.ts +0 -28
  194. package/ionic-auth-ui/components/index.d.ts +0 -11
  195. package/ionic-auth-ui/components/name-field/name-field.component.d.ts +0 -8
  196. package/ionic-auth-ui/components/or-divider/or-divider.component.d.ts +0 -2
  197. package/ionic-auth-ui/components/password-field/password-field.component.d.ts +0 -34
  198. package/ionic-auth-ui/components/password-field/passwordValidatorFunctions.d.ts +0 -4
  199. package/ionic-auth-ui/components/providers/providers.component.d.ts +0 -26
  200. package/ionic-auth-ui/components/reauthenticate/reauthenticate.component.d.ts +0 -30
  201. package/ionic-auth-ui/components/register/register.component.d.ts +0 -26
  202. package/ionic-auth-ui/components/register-with-email/register-with-email.component.d.ts +0 -24
  203. package/ionic-auth-ui/components/register-with-email-popover/register-with-email-popover.component.d.ts +0 -7
  204. package/ionic-auth-ui/components/signin/signin.component.d.ts +0 -28
  205. package/ionic-auth-ui/components/terms-field/terms-field.component.d.ts +0 -27
  206. package/ionic-auth-ui/components/user/user.component.d.ts +0 -45
  207. package/ionic-auth-ui/ionic-auth-ui.module.d.ts +0 -32
  208. package/ionic-auth-ui/ngx-firebase-ionic-auth-ui.d.ts +0 -22
  209. package/ionic-auth-ui/ngx-firebase-ionic-auth-ui.metadata.json +0 -1
  210. package/ionic-auth-ui/package.json +0 -30
  211. package/ionic-auth-ui/pages/index.d.ts +0 -4
  212. package/ionic-auth-ui/pages/register/index.d.ts +0 -1
  213. package/ionic-auth-ui/pages/register/register.page.d.ts +0 -16
  214. package/ionic-auth-ui/pages/signin/index.d.ts +0 -1
  215. package/ionic-auth-ui/pages/signin/signin.page.d.ts +0 -22
  216. package/ionic-auth-ui/pages/user/index.d.ts +0 -1
  217. package/ionic-auth-ui/pages/user/user.page.d.ts +0 -3
  218. package/ionic-auth-ui/pages/verifyemail/index.d.ts +0 -1
  219. package/ionic-auth-ui/pages/verifyemail/verifyemail.page.d.ts +0 -19
  220. package/ionic-auth-ui/public-api.d.ts +0 -4
  221. package/ngx-firebase.d.ts +0 -5
  222. package/ngx-firebase.metadata.json +0 -1
  223. package/public-api.d.ts +0 -5
  224. package/shared/guards/index.d.ts +0 -2
  225. package/shared/guards/logged-in.guard.d.ts +0 -13
  226. package/shared/guards/verify-email.guard.d.ts +0 -11
  227. package/shared/interfaces/accounts.enum.d.ts +0 -7
  228. package/shared/interfaces/authprovider.enum.d.ts +0 -13
  229. package/shared/interfaces/config.interface.d.ts +0 -63
  230. package/shared/interfaces/index.d.ts +0 -7
  231. package/shared/interfaces/main.interface.d.ts +0 -13
  232. package/shared/interfaces/providers.interface.d.ts +0 -63
  233. package/shared/interfaces/tokens.d.ts +0 -16
  234. package/shared/interfaces/ui-providers.interface.d.ts +0 -65
  235. package/shared/services/analytics.service.d.ts +0 -10
  236. package/shared/services/auth-process.service.d.ts +0 -172
  237. package/shared/services/crashlytics.service.d.ts +0 -11
  238. package/shared/services/device-info.service.d.ts +0 -3
  239. package/shared/services/firebase.service.d.ts +0 -16
  240. package/shared/services/firestore-sync.service.d.ts +0 -16
  241. package/shared/services/index.d.ts +0 -9
  242. package/shared/services/performance.service.d.ts +0 -12
  243. package/shared/services/remoteconfig.service.d.ts +0 -18
  244. package/shared/services/ui.service.d.ts +0 -22
  245. package/shared/shared.module.d.ts +0 -14
  246. package/shared/types/DisplayWidth.d.ts +0 -7
  247. package/shared/types/Location.d.ts +0 -8
  248. package/shared/types/ValueAccessorControlComponent.d.ts +0 -27
  249. package/shared/types/ValueAccessorValueComponent.d.ts +0 -19
  250. package/shared/types/index.d.ts +0 -4
  251. package/testing/fakeavatar.module.d.ts +0 -2
  252. package/testing/fakes/FakeAuthProcessService.d.ts +0 -28
  253. package/testing/fakes/FakeAvatarComponent.d.ts +0 -3
  254. package/testing/fakes/FakeFireService.d.ts +0 -20
  255. package/testing/fakes/FakeFirestoreSyncService.d.ts +0 -9
  256. package/testing/fakes/FakeIAPurchaseService.d.ts +0 -9
  257. package/testing/fakes/FakePickerService.d.ts +0 -6
  258. package/testing/fakes/FakeRemoteConfigService.d.ts +0 -19
  259. package/testing/fakes/FakeTranslateService.d.ts +0 -15
  260. package/testing/fakes/FakeUiService.d.ts +0 -25
  261. package/testing/fakes/angular-fire/FakeAngularFireAuth.d.ts +0 -52
  262. package/testing/fakes/angular-fire/FakeAngularFireFunctions.d.ts +0 -11
  263. package/testing/fakes/angular-fire/FakeAngularFirePerformance.d.ts +0 -10
  264. package/testing/fakes/angular-fire/FakeAngularFireStorage.d.ts +0 -5
  265. package/testing/fakes/angular-fire/FakeAngularFirestore.d.ts +0 -5
  266. package/testing/fakes/angular-fire/FakeUserCredential.d.ts +0 -9
  267. package/testing/fakes/index.d.ts +0 -16
  268. package/testing/ngx-firebase-testing.d.ts +0 -5
  269. package/testing/ngx-firebase-testing.metadata.json +0 -1
  270. package/testing/package.json +0 -29
  271. package/testing/public-api.d.ts +0 -4
  272. package/testing/test.module.d.ts +0 -4
  273. package/testing/utils/index.d.ts +0 -5
  274. package/testing/utils/patchConsole.d.ts +0 -4
@@ -1,1482 +0,0 @@
1
- import { __awaiter } from 'tslib';
2
- import { EventEmitter, Component, ChangeDetectionStrategy, ChangeDetectorRef, Inject, forwardRef, Input, Output, ViewChild, ViewEncapsulation, Injector, NgModule } from '@angular/core';
3
- import { NavController, PopoverController, IonicModule } from '@ionic/angular';
4
- import { AuthProcessService, FirebaseService, UiService, MalSharedConfigToken, AuthProvider, PHONE_NUMBER_REGEX, FirebaseErrorCodes, ValueAccessorControlComponent, MalSharedModule } from 'ngx-firebase';
5
- import { FormGroup, FormControl, Validators, NG_VALUE_ACCESSOR, NG_VALIDATORS, NgControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
6
- import { MalIonicAlertsService, MalIonicModule } from 'ngx-firebase/ionic';
7
- import { animation, style, animate, trigger, transition, useAnimation, state, query, stagger, animateChild } from '@angular/animations';
8
- import { Subject, BehaviorSubject, of } from 'rxjs';
9
- import { takeUntil, map, switchMap, catchError, startWith } from 'rxjs/operators';
10
- import { ActivatedRoute } from '@angular/router';
11
- import { HttpClientModule } from '@angular/common/http';
12
- import { CommonModule } from '@angular/common';
13
- import { TooltipsModule } from 'ionic4-tooltips';
14
- import { FlexLayoutModule } from '@angular/flex-layout';
15
-
16
- class EmailConfirmationComponent {
17
- constructor(aps, changeDetectorRef, navController, fire, ui, config) {
18
- this.aps = aps;
19
- this.changeDetectorRef = changeDetectorRef;
20
- this.navController = navController;
21
- this.fire = fire;
22
- this.ui = ui;
23
- this.config = config;
24
- this.signOut = new EventEmitter();
25
- // Context hash to use for verifyEmailTemplate.
26
- this.verifyEmailContext = this.createTemplateContext();
27
- this.isLoading = false;
28
- }
29
- ngOnChanges(changes) {
30
- if (changes.verifyEmailTemplate && changes.verifyEmailTemplate.currentValue == null) {
31
- this.verifyEmailTemplate = this.defaultTemplate;
32
- // console.log('ngOnChanges - defaultTemplate:', this.verifyEmailTemplate);
33
- }
34
- this.verifyEmailContext = this.createTemplateContext();
35
- }
36
- ngOnInit() {
37
- if (!this.verifyEmailTemplate) {
38
- // console.log('ngOnInit - defaultTemplate');
39
- this.verifyEmailTemplate = this.defaultTemplate;
40
- }
41
- this.verifyEmailContext = this.createTemplateContext();
42
- // console.log('verifyEmailTemplate:', this.verifyEmailTemplate);
43
- // console.log('verifyEmailContext:', this.verifyEmailContext);
44
- }
45
- continue() {
46
- return __awaiter(this, void 0, void 0, function* () {
47
- try {
48
- yield this.aps.reloadUserInfo();
49
- yield this.navController.navigateBack([this.goBackURL]);
50
- }
51
- catch (error) {
52
- this.notifyError(error);
53
- }
54
- });
55
- }
56
- sendNewVerificationEmail() {
57
- return __awaiter(this, void 0, void 0, function* () {
58
- try {
59
- this.isLoading = true;
60
- this.changeDetectorRef.markForCheck();
61
- yield this.aps.sendNewVerificationEmail();
62
- this.ui.toast('auth.emailConfirmation.onConfirmationSuccess');
63
- }
64
- catch (error) {
65
- this.notifyError(error);
66
- }
67
- finally {
68
- this.isLoading = false;
69
- this.changeDetectorRef.markForCheck();
70
- }
71
- });
72
- }
73
- createTemplateContext() {
74
- return {
75
- email: this.email,
76
- goBackURL: this.goBackURL,
77
- };
78
- }
79
- notifyError(error) {
80
- this.fire.recordException(error);
81
- if (this.config.authUi.toastMessageOnAuthError) {
82
- const message = error.toString() || 'Sorry, something went wrong. Please retry later.';
83
- this.ui.toast(message, { duration: this.config.authUi.toastDefaultDurationMil });
84
- }
85
- }
86
- }
87
- EmailConfirmationComponent.decorators = [
88
- { type: Component, args: [{
89
- selector: 'mal-authui-email-confirmation',
90
- template: "<ng-container *ngTemplateOutlet=\"verifyEmailTemplate; context: verifyEmailContext\"></ng-container>\n<ng-template #defaultVerifyEmail let-email=\"email\" let-goBackURL=\"goBackURL\">\n <ion-card class=\"verify-email\">\n <ion-card-content fxLayout=\"column\" fxLayoutAlign=\"center center\">\n <ion-icon color=\"text\" name=\"mail-outline\"></ion-icon>\n <p class=\"title\" fxLayout=\"column\" fxLayoutAlign=\"center center\">\n <span class=\"mat-subheading-2\">{{ \"auth.emailConfirmation.title\" | translate }}</span>\n <span class=\"mat-body-2\">{{ \"auth.email.label\" | translate }}</span>\n </p>\n <p class=\"subtitle\">{{ \"auth.emailConfirmation.bodyText\" | translate }}</p>\n <ion-progress-bar *ngIf=\"isLoading\" type=\"indeterminate\"></ion-progress-bar>\n </ion-card-content>\n <ion-button color=\"primary\" (click)=\"continue()\" *ngIf=\"goBackURL\" class=\"go-back-button action-button\">\n {{ \"auth.emailConfirmation.goBack\" | translate }}\n </ion-button>\n <ion-button (color=\"primary\" click)=\"sendNewVerificationEmail()\" class=\"send-new-mail-button action-button\">\n {{ \"auth.emailConfirmation.sendNewVerificationEmail\" | translate }}\n </ion-button>\n <ion-button color=\"primary\" (click)=\"this.signOut.emit()\" class=\"sign-out-button action-button\" color=\"warn\">\n {{ \"auth.emailConfirmation.signOut\" | translate }}\n </ion-button>\n </ion-card>\n</ng-template>",
91
- changeDetection: ChangeDetectionStrategy.OnPush,
92
- styles: [".verify-email{width:360px}.verify-email .mat-icon{height:4rem;width:4rem;color:#444}.verify-email .title{margin-top:16px}.verify-email .title .mat-subheading-2{margin-bottom:0}.verify-email .subtitle{margin:16px auto;text-align:justify}.verify-email p{display:block;-webkit-margin-before:1em;-webkit-margin-after:1em;-webkit-margin-start:0;-webkit-margin-end:0}"]
93
- },] }
94
- ];
95
- EmailConfirmationComponent.ctorParameters = () => [
96
- { type: AuthProcessService },
97
- { type: ChangeDetectorRef },
98
- { type: NavController },
99
- { type: FirebaseService },
100
- { type: UiService },
101
- { type: undefined, decorators: [{ type: Inject, args: [forwardRef(() => MalSharedConfigToken),] }] }
102
- ];
103
- EmailConfirmationComponent.propDecorators = {
104
- email: [{ type: Input }],
105
- goBackURL: [{ type: Input }],
106
- template: [{ type: Input }],
107
- signOut: [{ type: Output }],
108
- defaultTemplate: [{ type: ViewChild, args: ['defaultVerifyEmail', { static: true },] }]
109
- };
110
-
111
- const customAnimation = animation([
112
- style({
113
- opacity: '{{opacity}}',
114
- transform: 'scale({{scale}}) translate3d({{x}}, {{y}}, {{z}})'
115
- }),
116
- animate('{{duration}} {{delay}} cubic-bezier(0.0, 0.0, 0.2, 1)', style('*'))
117
- ], {
118
- params: {
119
- duration: '200ms',
120
- delay: '0ms',
121
- opacity: '0',
122
- scale: '1',
123
- x: '0',
124
- y: '0',
125
- z: '0'
126
- }
127
- });
128
- const NgxAuthFirebaseuiAnimations = [
129
- trigger('animate', [transition('void => *', [useAnimation(customAnimation)])]),
130
- trigger('animateStagger', [
131
- state('50', style('*')),
132
- state('100', style('*')),
133
- state('200', style('*')),
134
- transition('void => 50', query('@*', [stagger('50ms', [animateChild()])], { optional: true })),
135
- transition('void => 100', query('@*', [stagger('100ms', [animateChild()])], { optional: true })),
136
- transition('void => 200', query('@*', [stagger('200ms', [animateChild()])], { optional: true }))
137
- ]),
138
- ];
139
-
140
- class AuthUISignInComponent {
141
- constructor(
142
- // tslint:disable-next-line @typescript-eslint/ban-types
143
- aps, alert, changeDetectorRef, config) {
144
- this.aps = aps;
145
- this.alert = alert;
146
- this.changeDetectorRef = changeDetectorRef;
147
- this.config = config;
148
- this.providers = AuthProvider.ALL; // google, facebook, twitter, github as array or all as one single string
149
- this.registrationEnabled = true;
150
- this.resetPasswordEnabled = true;
151
- this.tosUrl = '';
152
- this.privacyPolicyUrl = '';
153
- // Events
154
- // tslint:disable no-output-on-prefix
155
- this.onSuccess = this.aps.onSignInEmitter;
156
- this.onError = this.aps.onErrorEmitter;
157
- this.onCreateAccountRequested = new EventEmitter();
158
- this.onResetPasswordRequested = new EventEmitter();
159
- // tslint:enable no-output-on-prefix
160
- this.signInForm = new FormGroup({
161
- email: new FormControl('', [Validators.required]),
162
- password: new FormControl('', [Validators.required])
163
- });
164
- this.authProviders = AuthProvider;
165
- }
166
- signIn() {
167
- return __awaiter(this, void 0, void 0, function* () {
168
- try {
169
- this.changeDetectorRef.markForCheck();
170
- yield this.aps.signInWith(AuthProvider.EmailAndPassword, {
171
- credentials: {
172
- email: this.signInForm.value.email,
173
- password: this.signInForm.value.password
174
- }
175
- });
176
- }
177
- finally {
178
- this.changeDetectorRef.markForCheck();
179
- }
180
- });
181
- }
182
- providerClick(provider) {
183
- this.aps.signInWith(provider);
184
- }
185
- ngAfterViewInit() {
186
- this.changeDetectorRef.detectChanges();
187
- }
188
- doPasswordReset() {
189
- return __awaiter(this, void 0, void 0, function* () {
190
- if (this.signInForm.controls.email.invalid) {
191
- yield this.alert.errorAlert('auth.resetPassword.errors.pattern');
192
- }
193
- else {
194
- yield this.aps.resetPassword(this.signInForm.value.email);
195
- }
196
- });
197
- }
198
- }
199
- AuthUISignInComponent.decorators = [
200
- { type: Component, args: [{
201
- selector: 'mal-authui-signin',
202
- template: "<div fxLayout=\"column\" fxLayoutAlign=\"center center\" id=\"signin-wrapper\" class=\"authui-wrapper\">\n <div [@animateStagger]=\"{ value: '50' }\" id=\"signin-inner\" class=\"authui-inner-wrapper\">\n\n <form [@animate]=\"{value:'*',params:{duration:'300ms',y:'100px'}}\" [formGroup]=\"signInForm\" name=\"signInForm\"\n novalidate>\n\n <mal-authui-email-field formControlName=\"email\"\n [@animate]=\"{ value: '*', params: { x: '50px' } }\">\n </mal-authui-email-field>\n\n <mal-authui-password-field formControlName=\"password\"\n [@animate]=\"{ value: '*', params: { x: '50px' } }\">\n </mal-authui-password-field>\n\n <div [@animate]=\"{ value: '*', params: { x: '50px' } }\"\n class=\"forgot-password\"\n fxLayout=\"row\"\n fxLayout.xs=\"column\"\n fxLayoutAlign=\"space-between center\">\n\n <a (click)=\"doPasswordReset()\"\n *ngIf=\"resetPasswordEnabled\"\n [@animate]=\"{ value: '*', params: { x: '-50px' } }\"\n class=\"forgot-password\"\n type=\"button\">\n {{ \"auth.signIn.forgotPassword\" | translate }}\n </a>\n </div>\n\n <ion-button (click)=\"signIn()\"\n color=\"primary\"\n [disabled]=\"signInForm.invalid\"\n aria-label=\"LOG IN\"\n fxLayoutAlign=\"center center\"\n class=\"authui-submit-button\"\n id=\"auth_signin_btn\">\n {{\"auth.signIn.signInButton\" | translate }}\n </ion-button>\n\n </form>\n\n <!--mal-authui-or-divider *ngIf=\"providers.length > 0\"\n [@animate]=\"{ value: '*', params: { z: '50px', delay: '50ms', scale: '0.2' } }\">\n </mal-authui-or-divider> -->\n\n <mal-authui-providers [providers]=\"providers\"\n (providerClick)=\"providerClick($event)\"\n layout=\"column\"></mal-authui-providers>\n\n <div *ngIf=\" registrationEnabled\" [@animateStagger]=\"{ value: '100' }\"\n class=\"authui-alternate-action\"\n fxLayout=\"column\"\n fxLayoutAlign=\"center center\">\n <ion-text [@animate]=\"{ value: '*', params: { x: '100px' } }\"\n color=\"text\"\n class=\"text\">\n {{\"auth.signIn.dontHaveAccount\" | translate}}\n </ion-text>\n <a (click)=\"onCreateAccountRequested.emit()\"\n [@animate]=\"{ value: '*', params: { x: '-100px' } }\"\n id=\"createAccountButton\">\n {{\"auth.signIn.createAccountButton\" | translate}}\n </a>\n </div>\n\n </div>\n</div>",
203
- encapsulation: ViewEncapsulation.None,
204
- animations: NgxAuthFirebaseuiAnimations,
205
- styles: ["div.authui-logo{margin:32px auto;width:30%}div.authui-logo img{display:block;max-width:120px;border-radius:20px;margin-left:auto;margin-right:auto}div.authui-title{font-size:20px;margin:16px 0}div.authui-alternate-action{margin:32px auto 24px;font-weight:500}div.authui-alternate-action .text{margin-right:8px}ion-content.auth-page{--background:var(--auth-pages-background,--background)}div.resend-confirmation{margin:24px 0;font-size:.9em;text-align:center}ion-button.authui-provider-button{width:220px;margin:8px auto;display:block;text-align:center;--background:var(--auth-provider-background-color,#fff)}@media screen and (max-width:599px){ion-button.authui-provider-button{width:100%}}ion-button.authui-submit-button{width:220px;margin:16px auto;display:block}@media screen and (max-width:599px){ion-button.authui-submit-button{width:100%}}ion-grid.terms{width:100%;margin:24px 0;text-align:left;font-size:.9em}ion-grid.terms ion-col ion-row a{font-size:16px;margin-left:4px}div.forgot-password{margin:24px 0;font-size:.9em}@media (prefers-color-scheme:dark){a{color:#fff}}div.auth-ui-form{width:384px;max-width:384px;padding:32px;text-align:center;flex:1 0 auto}@media screen and (max-width:599px){div.auth-ui-form{padding:24px;width:100%}}div.auth-ui-form form{width:100%;text-align:left}div.authui-wrapper{width:100%;background-size:cover;flex:1 0 auto;padding:32px}@media screen and (max-width:599px){div.authui-wrapper{padding:16px}}button.confirm:disabled{color:grey}div.email-popover-outer{width:100%}div.email-popover-outer div.email-popover-inner{padding:10%}"]
206
- },] }
207
- ];
208
- AuthUISignInComponent.ctorParameters = () => [
209
- { type: AuthProcessService },
210
- { type: MalIonicAlertsService },
211
- { type: ChangeDetectorRef },
212
- { type: undefined, decorators: [{ type: Inject, args: [forwardRef(() => MalSharedConfigToken),] }] }
213
- ];
214
- AuthUISignInComponent.propDecorators = {
215
- providers: [{ type: Input }],
216
- registrationEnabled: [{ type: Input }],
217
- resetPasswordEnabled: [{ type: Input }],
218
- tosUrl: [{ type: Input }],
219
- privacyPolicyUrl: [{ type: Input }],
220
- onSuccess: [{ type: Output }],
221
- onError: [{ type: Output }],
222
- onCreateAccountRequested: [{ type: Output }],
223
- onResetPasswordRequested: [{ type: Output }]
224
- };
225
-
226
- function isCreateAccountFormData(x) {
227
- return x && x.email && x.password;
228
- }
229
- class AuthUIRegisterComponent {
230
- // tslint:disable-next-line @typescript-eslint/ban-types
231
- constructor(config, aps, ui, popover, changeDetectorRef) {
232
- this.config = config;
233
- this.aps = aps;
234
- this.ui = ui;
235
- this.popover = popover;
236
- this.changeDetectorRef = changeDetectorRef;
237
- this.showEmail = 'popover';
238
- this.providers = AuthProvider.ALL; // google, facebook, twitter, github as array or all as one single string
239
- // Events
240
- // tslint:disable no-output-on-prefix
241
- this.onSuccess = this.aps.onRegisterEmitter;
242
- this.onError = this.aps.onErrorEmitter;
243
- this.onLoginRequested = new EventEmitter();
244
- // tslint:enable no-output-on-prefix
245
- // Prevent somebody already logged in as guest - relogging in as gyest
246
- this.guestEnabled$ = this.aps.canSignInAsGuest$;
247
- // Private
248
- this.destroy$ = new Subject();
249
- }
250
- ngAfterViewInit() {
251
- this.changeDetectorRef.detectChanges();
252
- }
253
- ngOnDestroy() {
254
- this.destroy$.next();
255
- this.destroy$.complete();
256
- }
257
- doCreateAccount(data) {
258
- return __awaiter(this, void 0, void 0, function* () {
259
- try {
260
- this.changeDetectorRef.markForCheck();
261
- yield this.aps.registerWith(AuthProvider.EmailAndPassword, {
262
- credentials: {
263
- email: data.email,
264
- password: data.password
265
- },
266
- displayName: data.name,
267
- skipTosCheck: true
268
- });
269
- }
270
- catch (error) {
271
- this.ui.logError(error);
272
- }
273
- finally {
274
- this.changeDetectorRef.markForCheck();
275
- }
276
- });
277
- }
278
- doRegisterAnonymously() {
279
- return __awaiter(this, void 0, void 0, function* () {
280
- try {
281
- this.changeDetectorRef.markForCheck();
282
- yield this.aps.signInWith(AuthProvider.ANONYMOUS);
283
- }
284
- catch (error) {
285
- this.ui.logError(error);
286
- }
287
- finally {
288
- this.changeDetectorRef.markForCheck();
289
- }
290
- });
291
- }
292
- doRegisterWithEmailPopover() {
293
- return __awaiter(this, void 0, void 0, function* () {
294
- try {
295
- const data = yield new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
296
- try {
297
- const { AuthUIRegisterWithEmailPopoverComponent } = yield Promise.resolve().then(function () { return registerWithEmailPopover_component; });
298
- const popover = yield this.popover.create({
299
- component: AuthUIRegisterWithEmailPopoverComponent,
300
- cssClass: ['wide-popover', 'dark-backdrop']
301
- });
302
- popover.onDidDismiss().then((resp) => {
303
- if (isCreateAccountFormData(resp === null || resp === void 0 ? void 0 : resp.data)) {
304
- resolve(resp.data);
305
- }
306
- else {
307
- resolve(null);
308
- }
309
- });
310
- yield popover.present();
311
- }
312
- catch (error) {
313
- this.ui.logError(error);
314
- reject(error);
315
- }
316
- }));
317
- if (data) {
318
- yield this.doCreateAccount(data);
319
- }
320
- }
321
- catch (error) {
322
- this.ui.logError(error);
323
- }
324
- });
325
- }
326
- doProviderClick(provider) {
327
- try {
328
- this.aps.registerWith(provider);
329
- }
330
- catch (error) {
331
- this.ui.logError(error);
332
- }
333
- }
334
- }
335
- AuthUIRegisterComponent.decorators = [
336
- { type: Component, args: [{
337
- selector: 'mal-authui-register',
338
- template: "<div fxLayout=\"column\" fxLayoutAlign=\"center center\" id=\"register-wrapper\" class=\"authui-wrapper\">\n <div [@animateStagger]=\"{ value: '50' }\" id=\"register-inner\" class=\"authui-inner-wrapper\">\n\n <mal-authui-register-with-email *ngIf=\"showEmail === 'inline'\">\n (createAccountClick)=\"doCreateAccount($event)\">\n </mal-authui-register-with-email>\n\n <div fxLayoutAlign=\"stretch\"\n fxLayout=\"column\"\n class=\"provider-buttons\">\n\n <div *ngIf=\"showEmail === 'popover'\">\n <ion-button id=\"auth_register_email_btn\"\n (click)=\"doRegisterWithEmailPopover()\"\n [@animate]=\"{ value: '*', params: { x: '-100px' } }\"\n color=\"primary\"\n class=\"authui-provider-button\">\n <ion-icon name=\"mail-outline\"></ion-icon>\n <ion-label slot=\"end\">{{ \"auth.register.emailButton\" | translate }}</ion-label>\n </ion-button>\n </div>\n\n <div *ngIf=\"guestEnabled$ | async\">\n <ion-button id=\"auth_register_anon_btn\"\n (click)=\"doRegisterAnonymously()\"\n [@animate]=\"{ value: '*', params: { x: '-100px' } }\"\n color=\"primary\"\n class=\"authui-provider-button\">\n <ion-icon name=\"finger-print-outline\"></ion-icon>\n <ion-label slot=\"end\">{{ \"auth.register.guestButton\" | translate }}</ion-label>\n </ion-button>\n </div>\n </div>\n\n <mal-authui-providers [providers]=\"providers\"\n (providerClick)=\"doProviderClick($event)\"\n layout=\"column\">\n </mal-authui-providers>\n\n <div [@animate]=\"{value:'*',params:{duration:'300ms',y:'100px'}}\"\n class=\"alternate-action\"\n fxLayout=\"column\"\n fxLayoutAlign=\"center center\">\n\n <ion-text color=\"text\" [@animate]=\"{ value: '*', params: { x: '100px' } }\">\n {{ \"auth.register.alreadyHaveAccount\" | translate }}\n </ion-text>\n\n <a (click)=\"onLoginRequested.emit()\"\n [@animate]=\"{ value: '*', params: { x: '-100px' } }\"\n id=\"loginButton\">\n {{\"auth.register.signInButton\" | translate}}\n </a>\n\n </div>\n </div>",
339
- encapsulation: ViewEncapsulation.None,
340
- animations: NgxAuthFirebaseuiAnimations,
341
- styles: ["div.authui-logo{margin:32px auto;width:30%}div.authui-logo img{display:block;max-width:120px;border-radius:20px;margin-left:auto;margin-right:auto}div.authui-title{font-size:20px;margin:16px 0}div.authui-alternate-action{margin:32px auto 24px;font-weight:500}div.authui-alternate-action .text{margin-right:8px}ion-content.auth-page{--background:var(--auth-pages-background,--background)}div.resend-confirmation{margin:24px 0;font-size:.9em;text-align:center}ion-button.authui-provider-button{width:220px;margin:8px auto;display:block;text-align:center;--background:var(--auth-provider-background-color,#fff)}@media screen and (max-width:599px){ion-button.authui-provider-button{width:100%}}ion-button.authui-submit-button{width:220px;margin:16px auto;display:block}@media screen and (max-width:599px){ion-button.authui-submit-button{width:100%}}ion-grid.terms{width:100%;margin:24px 0;text-align:left;font-size:.9em}ion-grid.terms ion-col ion-row a{font-size:16px;margin-left:4px}div.forgot-password{margin:24px 0;font-size:.9em}@media (prefers-color-scheme:dark){a{color:#fff}}div.auth-ui-form{width:384px;max-width:384px;padding:32px;text-align:center;flex:1 0 auto}@media screen and (max-width:599px){div.auth-ui-form{padding:24px;width:100%}}div.auth-ui-form form{width:100%;text-align:left}div.authui-wrapper{width:100%;background-size:cover;flex:1 0 auto;padding:32px}@media screen and (max-width:599px){div.authui-wrapper{padding:16px}}button.confirm:disabled{color:grey}div.email-popover-outer{width:100%}div.email-popover-outer div.email-popover-inner{padding:10%}"]
342
- },] }
343
- ];
344
- AuthUIRegisterComponent.ctorParameters = () => [
345
- { type: undefined, decorators: [{ type: Inject, args: [forwardRef(() => MalSharedConfigToken),] }] },
346
- { type: AuthProcessService },
347
- { type: UiService },
348
- { type: PopoverController },
349
- { type: ChangeDetectorRef }
350
- ];
351
- AuthUIRegisterComponent.propDecorators = {
352
- showEmail: [{ type: Input }],
353
- providers: [{ type: Input }],
354
- onSuccess: [{ type: Output }],
355
- onError: [{ type: Output }],
356
- onLoginRequested: [{ type: Output }]
357
- };
358
-
359
- class AuthUIUserComponent {
360
- constructor(aps, ui, navController, config, popoverController, fire) {
361
- this.aps = aps;
362
- this.ui = ui;
363
- this.navController = navController;
364
- this.config = config;
365
- this.popoverController = popoverController;
366
- this.fire = fire;
367
- this._editMode$ = new BehaviorSubject(false);
368
- this.canEditAccount = this.config.authUi.allowAccountEdit;
369
- this.canLogout = this.config.authUi.allowAccountLogout;
370
- this.canDeleteAccount = this.config.authUi.allowAccountDelete;
371
- // tslint:disable no-output-on-prefix
372
- this.onSignOut = this.aps.onSignOutEmitter;
373
- this.onAccountEdited = this.aps.onUserUpdatedEmitter;
374
- this.onAccountDeleted = this.aps.onUserDeletedEmitter;
375
- // tslint:enable no-output-on-prefix
376
- this.destroy$ = new Subject();
377
- this.userPhotoUrl$ = this.aps.getUserPhotoUrl();
378
- this.user$ = this.aps.user$;
379
- this.updateFormGroup = new FormGroup({
380
- name: new FormControl('', [Validators.required]),
381
- email: new FormControl('', [Validators.required]),
382
- phoneNumber: new FormControl('', [Validators.pattern(PHONE_NUMBER_REGEX)])
383
- });
384
- }
385
- get editMode() { return this._editMode$.value; }
386
- set editMode(val) { this._editMode$.next(val); }
387
- get editMode$() { return this._editMode$.asObservable(); }
388
- ngOnInit() {
389
- this.aps.user$
390
- .pipe(takeUntil(this.destroy$))
391
- .subscribe(currentUser => {
392
- if (currentUser) {
393
- this.updateFormGroup.patchValue({
394
- name: currentUser.displayName,
395
- email: currentUser.email,
396
- phoneNumber: currentUser.phoneNumber
397
- });
398
- this.updateFormGroup.markAsPristine();
399
- }
400
- else {
401
- this.updateFormGroup.reset();
402
- this.editMode = false;
403
- }
404
- });
405
- this.editMode$
406
- .pipe(takeUntil(this.destroy$))
407
- .subscribe(editMode => {
408
- if (editMode) {
409
- this.updateFormGroup.enable();
410
- }
411
- else {
412
- this.updateFormGroup.disable();
413
- }
414
- });
415
- this.editMode = false;
416
- this.updateFormGroup.disable();
417
- }
418
- ngOnDestroy() {
419
- this.destroy$.next();
420
- this.destroy$.complete();
421
- }
422
- changeEditMode() {
423
- this.editMode = !this.editMode;
424
- }
425
- dismiss() {
426
- return __awaiter(this, void 0, void 0, function* () {
427
- if (this.popoverController.getTop() !== null) {
428
- yield this.popoverController.dismiss();
429
- }
430
- });
431
- }
432
- save() {
433
- return __awaiter(this, void 0, void 0, function* () {
434
- if (this.updateFormGroup.dirty) {
435
- try {
436
- yield this.aps.updateUserInfo({
437
- displayName: (this.updateFormGroup.controls.name.dirty) ? this.updateFormGroup.controls.name.value : undefined,
438
- email: (this.updateFormGroup.controls.email.dirty) ? this.updateFormGroup.controls.email.value : undefined,
439
- phoneNumber: (this.updateFormGroup.controls.phoneNumber.dirty) ? this.updateFormGroup.controls.phoneNumber.value : undefined,
440
- });
441
- }
442
- catch (error) {
443
- this.fire.recordException(error);
444
- this.ui.toast(error && error.message ? error.message : error);
445
- }
446
- yield this.dismiss();
447
- }
448
- else {
449
- this.editMode = false;
450
- }
451
- });
452
- }
453
- signOut() {
454
- return __awaiter(this, void 0, void 0, function* () {
455
- try {
456
- yield Promise.all([
457
- this.aps.signOut(),
458
- this.dismiss(),
459
- this.navController.navigateRoot(this.config.authUi.authGuardFallbackURL)
460
- ]);
461
- }
462
- catch (error) {
463
- this.fire.recordException(error);
464
- }
465
- });
466
- }
467
- /**
468
- * Delete the account of the current firebase ngx-auth-firebaseui-user
469
- *
470
- * On Success, emit the <onAccountDeleted> event and toast a msg!#
471
- * Otherwise, log the and toast and error msg!
472
- *
473
- * If the operation fails due to not having current enough signIn, redrect to reSignInUrl, providing forOperation=deleteUser
474
- *
475
- */
476
- deleteAccount() {
477
- var _a;
478
- return __awaiter(this, void 0, void 0, function* () {
479
- try {
480
- if (yield this.ui.yesNoAlert('auth.user.message.confirmDelete', { defaultToNo: true, interpolateParams: { userName: (_a = this.aps.user) === null || _a === void 0 ? void 0 : _a.displayName } })) {
481
- yield this.aps.deleteUser();
482
- yield Promise.all([
483
- this.dismiss(),
484
- this.ui.toast('auth.user.message.acountDeleted'),
485
- this.navController.navigateRoot(this.config.authUi.authGuardFallbackURL)
486
- ]);
487
- }
488
- }
489
- catch (error) {
490
- if (error.code === FirebaseErrorCodes.requiresRecentLogin) {
491
- // If we've failed due to lack of current credentials ask the user to reauthenticate and try again.
492
- yield new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
493
- const popover = yield this.popoverController.create({
494
- component: yield Promise.resolve().then(function () { return reauthenticate_component; }).then(m => m.AuthUIReauthenticateComponent),
495
- componentProps: {
496
- message: error.message
497
- },
498
- cssClass: 'wide-popover'
499
- });
500
- popover.onDidDismiss().then(() => __awaiter(this, void 0, void 0, function* () {
501
- try {
502
- yield this.aps.deleteUser();
503
- yield Promise.all([
504
- this.dismiss(),
505
- this.ui.toast('auth.user.message.acountDeleted'),
506
- this.navController.navigateRoot(this.config.authUi.authGuardFallbackURL)
507
- ]);
508
- }
509
- catch (error) {
510
- yield this.ui.toast('auth.user.message.acountDeleted', { interpolateParams: { error: error.message } });
511
- }
512
- resolve();
513
- }));
514
- yield popover.present();
515
- }));
516
- }
517
- else {
518
- this.fire.recordException(error);
519
- yield this.ui.toast('auth.user.message.acountDeleted', { interpolateParams: { error: error.message } });
520
- }
521
- }
522
- });
523
- }
524
- }
525
- AuthUIUserComponent.decorators = [
526
- { type: Component, args: [{
527
- selector: 'mal-authui-user',
528
- template: "<div *ngIf=\"user$ | async; then authenticated else none\" class=\"authui-form\">\n</div>\n\n<ng-template #authenticated>\n <ion-card *ngIf=\"(user$ | async) as user\">\n\n <!--card header-->\n <ion-card-header fxLayout=\"column\" fxLayoutAlign=\"center center\">\n\n <ion-avatar>\n <img [alt]=\"user.name\" *ngIf=\"(userPhotoUrl$ | async) as photoUrl\" [src]=\"photoUrl\">\n </ion-avatar>\n\n <div *ngIf=\"user.emailVerified; then emailVerified else emailNotVerified\"></div>\n <ng-template #emailVerified>\n <ion-icon name=\"shield-checkmark-outline\" color=\"primary\" [tooltip]=\"'auth.email.isVerified' | translate\"> </ion-icon>\n </ng-template>\n <ng-template #emailNotVerified>\n <ion-icon name=\"warning-outline\" color=\"warn\" [tooltip]=\"'auth.email.notVerified' | translate\"> </ion-icon>\n </ng-template>\n\n </ion-card-header>\n\n <!--card content-->\n <ion-card-content>\n\n <form (submit)=\"save()\" [formGroup]=\"updateFormGroup\" name=\"updateFormGroup\">\n\n <div fxLayout=\"column\" fxLayoutAlign=\"center center\">\n\n <ion-button *ngIf=\"canEditAccount && !editMode\" (click)=\"changeEditMode()\" class=\"edit-button\"\n color=\"primary\">\n {{ \"auth.user.edit\" | translate }}\n </ion-button>\n </div>\n\n <mal-authui-name-field formControlName=\"name\"></mal-authui-name-field>\n <mal-authui-email-field formControlName=\"email\"></mal-authui-email-field>\n\n <!--phone number-->\n <mal-authui-form-field [control]=\"updateFormGroup.controls.phoneNumber\"\n icon=\"call-outline\"\n label=\"auth.phoneNumber.label\"\n *ngIf=\"false\"\n class=\"full-width\"\n hintEnd=\"auth.phoneNumber.hintEnd\"\n errorPrefix=\"auth.phoneNumber.errors\">\n <ion-input formControlName=\"phoneNumber\" [placeholder]=\"'auth.phoneNumber.placeholder' | translate\" type=\"tel\">\n </ion-input>\n </mal-authui-form-field>\n\n </form>\n\n <div class=\"card-actions\" fxLayout=\"row\" fxLayoutAlign=\"center center\">\n <ion-button *ngIf=\"editMode\" (click)=\"changeEditMode()\" class=\"edit-button\" color=\"warning\">\n {{ \"shared.button.cancel\" | translate }}\n </ion-button>\n <ion-button expand=\"block\" *ngIf=\"editMode\" color=\"primary\" (click)=\"save()\">{{ \"auth.user.actions.save\" | translate }} </ion-button>\n </div>\n <div class=\"card-actions\" fxLayout=\"row\" fxLayoutAlign=\"center center\">\n <a expand=\"block\" (click)=\"signOut()\" *ngIf=\"canLogout\" color=\"primary\">{{ \"auth.user.actions.signOut\" | translate }}</a>\n <a expand=\"block\" (click)=\"deleteAccount()\" *ngIf=\"canDeleteAccount\" color=\"warning\">{{ \"auth.user.actions.deleteAccount\" | translate }} </a>\n </div>\n\n </ion-card-content>\n </ion-card>\n</ng-template>\n\n<ng-template #none>\n <ion-card class=\"none-card\" fxLayout=\"row\" fxLayoutAlign=\"center center\">\n <ion-card-content fxLayout=\"row\" fxLayoutAlign=\"center center\">\n <ion-icon color=\"accent\">warning</ion-icon>\n <span>{{ \"auth.user.notLoggedIn\" | translate }}</span>\n </ion-card-content>\n </ion-card>\n</ng-template>",
529
- styles: [".edit-button{margin:1rem}.full-width{width:100%}.cut-text{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.none-card{min-height:430px}.none-card span{font-size:24px;text-align:center;color:rgba(0,0,0,.54)}.card-actions a{margin-left:4px;margin-right:4px}", "div.authui-logo{margin:32px auto;width:30%}div.authui-logo img{display:block;max-width:120px;border-radius:20px;margin-left:auto;margin-right:auto}div.authui-title{font-size:20px;margin:16px 0}div.authui-alternate-action{margin:32px auto 24px;font-weight:500}div.authui-alternate-action .text{margin-right:8px}ion-content.auth-page{--background:var(--auth-pages-background,--background)}div.resend-confirmation{margin:24px 0;font-size:.9em;text-align:center}ion-button.authui-provider-button{width:220px;margin:8px auto;display:block;text-align:center;--background:var(--auth-provider-background-color,#fff)}@media screen and (max-width:599px){ion-button.authui-provider-button{width:100%}}ion-button.authui-submit-button{width:220px;margin:16px auto;display:block}@media screen and (max-width:599px){ion-button.authui-submit-button{width:100%}}ion-grid.terms{width:100%;margin:24px 0;text-align:left;font-size:.9em}ion-grid.terms ion-col ion-row a{font-size:16px;margin-left:4px}div.forgot-password{margin:24px 0;font-size:.9em}@media (prefers-color-scheme:dark){a{color:#fff}}div.auth-ui-form{width:384px;max-width:384px;padding:32px;text-align:center;flex:1 0 auto}@media screen and (max-width:599px){div.auth-ui-form{padding:24px;width:100%}}div.auth-ui-form form{width:100%;text-align:left}div.authui-wrapper{width:100%;background-size:cover;flex:1 0 auto;padding:32px}@media screen and (max-width:599px){div.authui-wrapper{padding:16px}}button.confirm:disabled{color:grey}div.email-popover-outer{width:100%}div.email-popover-outer div.email-popover-inner{padding:10%}"]
530
- },] }
531
- ];
532
- AuthUIUserComponent.ctorParameters = () => [
533
- { type: AuthProcessService },
534
- { type: UiService },
535
- { type: NavController },
536
- { type: undefined, decorators: [{ type: Inject, args: [forwardRef(() => MalSharedConfigToken),] }] },
537
- { type: PopoverController },
538
- { type: FirebaseService }
539
- ];
540
- AuthUIUserComponent.propDecorators = {
541
- editMode: [{ type: Input }],
542
- onSignOut: [{ type: Output }],
543
- onAccountEdited: [{ type: Output }],
544
- onAccountDeleted: [{ type: Output }]
545
- };
546
-
547
- class AuthUIReauthenticateComponent {
548
- constructor(
549
- // tslint:disable-next-line @typescript-eslint/ban-types
550
- aps, ui, changeDetectorRef, popoverController) {
551
- this.aps = aps;
552
- this.ui = ui;
553
- this.changeDetectorRef = changeDetectorRef;
554
- this.popoverController = popoverController;
555
- this.providers = AuthProvider.ALL; // google, facebook, twitter, github as array or all as one single string
556
- this.registrationEnabled = true;
557
- this.resetPasswordEnabled = true;
558
- this.tosUrl = '';
559
- this.privacyPolicyUrl = '';
560
- // Events
561
- // tslint:disable no-output-on-prefix
562
- this.onSuccess = this.aps.onSignInEmitter;
563
- this.onError = this.aps.onErrorEmitter;
564
- this.onCreateAccountRequested = new EventEmitter();
565
- this.onResetPasswordRequested = new EventEmitter();
566
- // tslint:enable no-output-on-prefix
567
- this.providers$ = this.aps.reauthenticateProviders$;
568
- this.showPasswordProvider$ = this.providers$.pipe(map(providers => providers.includes(AuthProvider.EmailAndPassword)));
569
- this.showDivider$ = this.providers$.pipe(map(providers => providers.length > 1 && providers.includes(AuthProvider.EmailAndPassword)));
570
- this.message = '';
571
- this.reauthForm = new FormGroup({
572
- password: new FormControl(null, [Validators.required])
573
- });
574
- }
575
- ngAfterViewInit() {
576
- this.changeDetectorRef.detectChanges();
577
- }
578
- dismiss() {
579
- return __awaiter(this, void 0, void 0, function* () {
580
- if (this.popoverController.getTop() !== null) {
581
- yield this.popoverController.dismiss();
582
- }
583
- });
584
- }
585
- doReauthenticateWithPassword() {
586
- var _a;
587
- return __awaiter(this, void 0, void 0, function* () {
588
- try {
589
- if (!((_a = this.aps.user) === null || _a === void 0 ? void 0 : _a.email) || !this.reauthForm.value.password) {
590
- throw new Error('Trying to reauth with email/password when not valid');
591
- }
592
- yield this.aps.reauthenicateWithProvider(AuthProvider.EmailAndPassword, { credentials: { email: this.aps.user.email, password: this.reauthForm.value.password } });
593
- }
594
- catch (error) {
595
- this.ui.logError(error);
596
- }
597
- finally {
598
- yield this.dismiss();
599
- }
600
- });
601
- }
602
- doProviderClick(provider) {
603
- try {
604
- this.aps.reauthenicateWithProvider(provider);
605
- }
606
- catch (error) {
607
- this.ui.logError(error);
608
- }
609
- }
610
- }
611
- AuthUIReauthenticateComponent.decorators = [
612
- { type: Component, args: [{
613
- selector: 'mal-authui-reauthenticate',
614
- template: "<div fxLayout=\"column\" fxLayoutAlign=\"center center\" id=\"signin-wrapper\" class=\"authui-wrapper\">\n <div [@animateStagger]=\"{ value: '50' }\" id=\"signin-inner\" class=\"authui-inner-wrapper\">\n\n <div *ngIf=\"logoUrl\" class=\"authui-logo\">\n <img [@animate]=\"{ value: '*', params: { x: '50px' } }\" [src]=\"logoUrl\" alt=\"logo\">\n </div>\n\n <div [@animate]=\"{ value: '*', params: { x: '-50px' } }\" class=\"authui-title\">\n {{ \"auth.reauthenticate.tabTitle\" | translate }}\n </div>\n\n {{ message }}\n\n <form *ngIf=\"showPasswordProvider$ | async\"\n [@animate]=\"{value:'*',params:{duration:'300ms',y:'100px'}}\"\n [formGroup]=\"reauthForm\"\n name=\"reauthForm\"\n novalidate>\n\n <mal-authui-password-field formControlName=\"password\"\n [@animate]=\"{ value: '*', params: { x: '50px' } }\">\n </mal-authui-password-field>\n\n <ion-button (click)=\"doReauthenticateWithPassword()\"\n color=\"primary\"\n [disabled]=\"reauthForm.invalid\"\n aria-label=\"LOG IN\"\n fxLayoutAlign=\"center center\"\n class=\"authui-submit-button\"\n id=\"loginButton\">\n {{\"auth.signIn.loginButton\" | translate }}\n </ion-button>\n\n </form>\n\n <mal-authui-or-divider *ngIf=\"showDivider$ | async\"\n [@animate]=\"{ value: '*', params: { z: '50px', delay: '50ms', scale: '0.2' } }\">\n </mal-authui-or-divider>\n\n <mal-authui-providers [providers]=\"providers$ | async\"\n (providerClick)=\"doProviderClick($event)\"\n fxLayoutAlign=\"center center\"\n layout=\"column\"></mal-authui-providers>\n\n </div>\n</div>",
615
- encapsulation: ViewEncapsulation.None,
616
- animations: NgxAuthFirebaseuiAnimations,
617
- styles: ["div.authui-logo{margin:32px auto;width:30%}div.authui-logo img{display:block;max-width:120px;border-radius:20px;margin-left:auto;margin-right:auto}div.authui-title{font-size:20px;margin:16px 0}div.authui-alternate-action{margin:32px auto 24px;font-weight:500}div.authui-alternate-action .text{margin-right:8px}ion-content.auth-page{--background:var(--auth-pages-background,--background)}div.resend-confirmation{margin:24px 0;font-size:.9em;text-align:center}ion-button.authui-provider-button{width:220px;margin:8px auto;display:block;text-align:center;--background:var(--auth-provider-background-color,#fff)}@media screen and (max-width:599px){ion-button.authui-provider-button{width:100%}}ion-button.authui-submit-button{width:220px;margin:16px auto;display:block}@media screen and (max-width:599px){ion-button.authui-submit-button{width:100%}}ion-grid.terms{width:100%;margin:24px 0;text-align:left;font-size:.9em}ion-grid.terms ion-col ion-row a{font-size:16px;margin-left:4px}div.forgot-password{margin:24px 0;font-size:.9em}@media (prefers-color-scheme:dark){a{color:#fff}}div.auth-ui-form{width:384px;max-width:384px;padding:32px;text-align:center;flex:1 0 auto}@media screen and (max-width:599px){div.auth-ui-form{padding:24px;width:100%}}div.auth-ui-form form{width:100%;text-align:left}div.authui-wrapper{width:100%;background-size:cover;flex:1 0 auto;padding:32px}@media screen and (max-width:599px){div.authui-wrapper{padding:16px}}button.confirm:disabled{color:grey}div.email-popover-outer{width:100%}div.email-popover-outer div.email-popover-inner{padding:10%}"]
618
- },] }
619
- ];
620
- AuthUIReauthenticateComponent.ctorParameters = () => [
621
- { type: AuthProcessService },
622
- { type: UiService },
623
- { type: ChangeDetectorRef },
624
- { type: PopoverController }
625
- ];
626
- AuthUIReauthenticateComponent.propDecorators = {
627
- logoUrl: [{ type: Input }],
628
- providers: [{ type: Input }],
629
- registrationEnabled: [{ type: Input }],
630
- resetPasswordEnabled: [{ type: Input }],
631
- tosUrl: [{ type: Input }],
632
- privacyPolicyUrl: [{ type: Input }],
633
- onSuccess: [{ type: Output }],
634
- onError: [{ type: Output }],
635
- onCreateAccountRequested: [{ type: Output }],
636
- onResetPasswordRequested: [{ type: Output }]
637
- };
638
-
639
- var reauthenticate_component = /*#__PURE__*/Object.freeze({
640
- __proto__: null,
641
- AuthUIReauthenticateComponent: AuthUIReauthenticateComponent
642
- });
643
-
644
- var Layout;
645
- (function (Layout) {
646
- Layout["ROW"] = "row";
647
- Layout["COLUMN"] = "column";
648
- })(Layout || (Layout = {}));
649
- const displayProviders = {
650
- google: { name: AuthProvider.Google, icon: 'logo-google', label: 'Google' },
651
- apple: { name: AuthProvider.Apple, icon: 'logo-apple', label: 'Apple' },
652
- facebook: { name: AuthProvider.Facebook, icon: 'logo-facebook', label: 'Facebook' },
653
- twitter: { name: AuthProvider.Twitter, icon: 'logo-twitter', label: 'Twitter' },
654
- github: { name: AuthProvider.Github, icon: 'logo-github', label: 'GitHub' },
655
- microsoft: { name: AuthProvider.Microsoft, label: 'Microsoft' },
656
- yahoo: { name: AuthProvider.Yahoo, icon: 'logo-yahoo', label: 'Yahoo' }
657
- };
658
- class AuthProvidersComponent {
659
- constructor(aps, ui, config) {
660
- this.aps = aps;
661
- this.ui = ui;
662
- this.config = config;
663
- this.layout = Layout.ROW;
664
- this.providers$ = new BehaviorSubject(AuthProvider.ALL);
665
- this.providerClick = new EventEmitter();
666
- this.displayProviders$ = this.providers$.pipe(
667
- // Filter for those in config
668
- map(providerOrArray => {
669
- if (providerOrArray === AuthProvider.ALL) {
670
- providerOrArray = this.config.authUi.supportedProviders;
671
- }
672
- const providers = Array.isArray(providerOrArray) ? providerOrArray : [providerOrArray];
673
- return providers.filter(item => this.providers === AuthProvider.ALL || this.providers.includes(item));
674
- }),
675
- // Filter for those valid on platform
676
- switchMap((providers) => __awaiter(this, void 0, void 0, function* () {
677
- const providerFilter = yield Promise.all(providers.map(item => this.aps.isProviderSupported(item)));
678
- return providers.filter((_item, index) => providerFilter[index]);
679
- })),
680
- // Map to display type
681
- map(providers => providers.map(item => displayProviders[item])), catchError(error => {
682
- this.ui.logError(error);
683
- return of([]);
684
- }));
685
- }
686
- get providers() { return this.providers$.value; }
687
- set providers(val) { this.providers$.next(val); }
688
- }
689
- AuthProvidersComponent.decorators = [
690
- { type: Component, args: [{
691
- selector: 'mal-authui-providers',
692
- template: "<div [@animateStagger]=\"{ value: '50' }\">\n\n <!--default icon buttons-->\n <div [fxLayoutAlign]=\"layout == 'row' ? 'center' : 'stretch'\"\n [fxLayout]=\"layout\"\n fxLayout.xs=\"column\"\n class=\"provider-buttons\">\n\n <div *ngFor=\"let provider of (displayProviders$ | async)\">\n <ion-button [id]=\"'auth_provider_' + provider.name + '_btn'\"\n (click)=\"providerClick.emit(provider.name)\"\n [@animate]=\"{value:'*',params:{duration:'300ms',y:'100px'}}\"\n [class]=\"provider.name + ' authui-provider-button'\">\n\n <ion-icon *ngIf=\"provider.icon\" slot=\"start\" [name]=\"provider.icon\"></ion-icon>\n <ion-label slot=\"end\">{{ 'auth.provider.' + provider.name | translate }}</ion-label>\n\n </ion-button>\n </div>\n\n </div>\n</div>",
693
- animations: NgxAuthFirebaseuiAnimations,
694
- styles: [":host{display:block}ion-button.google{color:#db4437!important}ion-button.apple{color:#000!important}ion-button.facebook{color:#385899!important}ion-button.twitter{color:#1da1f2!important}ion-button.github{color:#000!important}ion-button.microsoft{color:#0078d4!important}ion-button.yahoo{color:#720e9e!important}ion-button.phone{color:#02bd7e}", "div.authui-logo{margin:32px auto;width:30%}div.authui-logo img{display:block;max-width:120px;border-radius:20px;margin-left:auto;margin-right:auto}div.authui-title{font-size:20px;margin:16px 0}div.authui-alternate-action{margin:32px auto 24px;font-weight:500}div.authui-alternate-action .text{margin-right:8px}ion-content.auth-page{--background:var(--auth-pages-background,--background)}div.resend-confirmation{margin:24px 0;font-size:.9em;text-align:center}ion-button.authui-provider-button{width:220px;margin:8px auto;display:block;text-align:center;--background:var(--auth-provider-background-color,#fff)}@media screen and (max-width:599px){ion-button.authui-provider-button{width:100%}}ion-button.authui-submit-button{width:220px;margin:16px auto;display:block}@media screen and (max-width:599px){ion-button.authui-submit-button{width:100%}}ion-grid.terms{width:100%;margin:24px 0;text-align:left;font-size:.9em}ion-grid.terms ion-col ion-row a{font-size:16px;margin-left:4px}div.forgot-password{margin:24px 0;font-size:.9em}@media (prefers-color-scheme:dark){a{color:#fff}}div.auth-ui-form{width:384px;max-width:384px;padding:32px;text-align:center;flex:1 0 auto}@media screen and (max-width:599px){div.auth-ui-form{padding:24px;width:100%}}div.auth-ui-form form{width:100%;text-align:left}div.authui-wrapper{width:100%;background-size:cover;flex:1 0 auto;padding:32px}@media screen and (max-width:599px){div.authui-wrapper{padding:16px}}button.confirm:disabled{color:grey}div.email-popover-outer{width:100%}div.email-popover-outer div.email-popover-inner{padding:10%}"]
695
- },] }
696
- ];
697
- AuthProvidersComponent.ctorParameters = () => [
698
- { type: AuthProcessService },
699
- { type: UiService },
700
- { type: undefined, decorators: [{ type: Inject, args: [forwardRef(() => MalSharedConfigToken),] }] }
701
- ];
702
- AuthProvidersComponent.propDecorators = {
703
- layout: [{ type: Input }],
704
- providers: [{ type: Input }],
705
- providerClick: [{ type: Output }]
706
- };
707
-
708
- class AuthUIEmailFieldComponent extends ValueAccessorControlComponent {
709
- constructor(injector, cdRef) {
710
- super(injector, cdRef);
711
- this.control = new FormControl('', [Validators.email]);
712
- }
713
- }
714
- AuthUIEmailFieldComponent.decorators = [
715
- { type: Component, args: [{
716
- selector: 'mal-authui-email-field',
717
- template: "<mal-authui-form-field [control]=\"parentControl\"\n label=\"auth.email.label\"\n errorPrefix=\"auth.email.errors\">\n\n <ion-input [placeholder]=\"'auth.email.placeholder' | translate\"\n [formControl]=\"control\"\n type=\"email\"\n color=\"text\"\n autocomplete=\"email\">\n </ion-input>\n\n</mal-authui-form-field>",
718
- providers: [
719
- { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => AuthUIEmailFieldComponent), multi: true },
720
- { provide: NG_VALIDATORS, useExisting: AuthUIEmailFieldComponent, multi: true }
721
- ],
722
- styles: ["div.authui-logo{margin:32px auto;width:30%}div.authui-logo img{display:block;max-width:120px;border-radius:20px;margin-left:auto;margin-right:auto}div.authui-title{font-size:20px;margin:16px 0}div.authui-alternate-action{margin:32px auto 24px;font-weight:500}div.authui-alternate-action .text{margin-right:8px}ion-content.auth-page{--background:var(--auth-pages-background,--background)}div.resend-confirmation{margin:24px 0;font-size:.9em;text-align:center}ion-button.authui-provider-button{width:220px;margin:8px auto;display:block;text-align:center;--background:var(--auth-provider-background-color,#fff)}@media screen and (max-width:599px){ion-button.authui-provider-button{width:100%}}ion-button.authui-submit-button{width:220px;margin:16px auto;display:block}@media screen and (max-width:599px){ion-button.authui-submit-button{width:100%}}ion-grid.terms{width:100%;margin:24px 0;text-align:left;font-size:.9em}ion-grid.terms ion-col ion-row a{font-size:16px;margin-left:4px}div.forgot-password{margin:24px 0;font-size:.9em}@media (prefers-color-scheme:dark){a{color:#fff}}div.auth-ui-form{width:384px;max-width:384px;padding:32px;text-align:center;flex:1 0 auto}@media screen and (max-width:599px){div.auth-ui-form{padding:24px;width:100%}}div.auth-ui-form form{width:100%;text-align:left}div.authui-wrapper{width:100%;background-size:cover;flex:1 0 auto;padding:32px}@media screen and (max-width:599px){div.authui-wrapper{padding:16px}}button.confirm:disabled{color:grey}div.email-popover-outer{width:100%}div.email-popover-outer div.email-popover-inner{padding:10%}"]
723
- },] }
724
- ];
725
- AuthUIEmailFieldComponent.ctorParameters = () => [
726
- { type: Injector },
727
- { type: ChangeDetectorRef }
728
- ];
729
-
730
- class AuthUIFormFieldComponent {
731
- constructor(ui) {
732
- this.ui = ui;
733
- this.label = '';
734
- this.control$ = new BehaviorSubject(undefined);
735
- this.errors$ = this.control$.pipe(switchMap(control => (control && control.statusChanges)
736
- ? control.statusChanges.pipe(startWith(control.errors), map(_ => this.errorMessageFn(control.errors)))
737
- : of([])), catchError(error => {
738
- this.ui.logError(error);
739
- return of([error.message]);
740
- }));
741
- this.isValid$ = this.control$.pipe(switchMap(control => (control && control.statusChanges)
742
- ? control.statusChanges.pipe(startWith(control.valid), map(() => control.valid || false))
743
- : of(true)));
744
- this.isDisabled$ = this.control$.pipe(switchMap(control => (control && control.statusChanges)
745
- ? control.statusChanges.pipe(startWith(control.disabled), map(() => control.disabled || false))
746
- : of(true)));
747
- this.errorMessageFn = this.flattenErrors.bind(this);
748
- this.translateParams = {};
749
- }
750
- get control() { return this.control$.value; }
751
- set control(val) { this.control$.next(val); }
752
- flattenErrors(errors) {
753
- if (errors) {
754
- if (this.customErrors || this.errorPrefix) {
755
- return Object.keys(errors)
756
- .map(key => {
757
- if (this.customErrors) {
758
- if (undefined !== this.customErrors[key]) {
759
- return this.customErrors[key];
760
- }
761
- else if (undefined !== this.customErrors.default) {
762
- return this.customErrors.default;
763
- }
764
- else {
765
- return '';
766
- }
767
- }
768
- else if (this.errorPrefix) {
769
- return `${this.errorPrefix}.${key}`;
770
- }
771
- })
772
- .filter(item => !!item) || [];
773
- }
774
- else if (this.errorMessage) {
775
- return [this.errorMessage];
776
- }
777
- else {
778
- return [];
779
- }
780
- }
781
- else {
782
- return [];
783
- }
784
- }
785
- }
786
- AuthUIFormFieldComponent.decorators = [
787
- { type: Component, args: [{
788
- selector: 'mal-authui-form-field',
789
- template: "<ion-item class=\"ion-no-padding input form-field\">\n <ion-label color=\"text\" class=\"text-size-xs\" position=\"floating\">{{ label | translate }}</ion-label>\n <div class=\"input-wrap\">\n <ng-content></ng-content>\n <ion-icon size=\"large\" *ngIf=\"!(isValid$ | async) && !(isDisabled$ | async)\" class=\"invalid\" name=\"remove-circle\"></ion-icon>\n <ion-icon size=\"large\" *ngIf=\"icon\" class=\"custom\" [name]=\"icon\"></ion-icon>\n </div>\n</ion-item>\n<ion-grid class=\"footer-messages\">\n <span class=\"hint-end\" *ngIf=\"hintEnd\">{{ hintEnd | translate:translateParams }}</span>\n <ion-row *ngFor=\"let error of (errors$ | async)\" class=\"error-message\">\n <ion-col>{{ error | translate:translateParams }} </ion-col>\n </ion-row>\n</ion-grid>",
790
- styles: ["ion-item.form-field{width:100%}ion-item.form-field div.input-wrap{display:flex;flex-wrap:nowrap;width:100%}ion-item.form-field div.input-wrap ion-icon.invalid{color:var(--ion-color-danger,red);align-items:right;height:100%}ion-grid.footer-messages{text-align:left;margin:0;padding:0;font-size:small}ion-grid.footer-messages ion-row.error-message ion-col{color:var(--ion-color-danger,red);margin:0;padding:0}ion-grid.footer-messages span.hint-end{float:right}", "div.authui-logo{margin:32px auto;width:30%}div.authui-logo img{display:block;max-width:120px;border-radius:20px;margin-left:auto;margin-right:auto}div.authui-title{font-size:20px;margin:16px 0}div.authui-alternate-action{margin:32px auto 24px;font-weight:500}div.authui-alternate-action .text{margin-right:8px}ion-content.auth-page{--background:var(--auth-pages-background,--background)}div.resend-confirmation{margin:24px 0;font-size:.9em;text-align:center}ion-button.authui-provider-button{width:220px;margin:8px auto;display:block;text-align:center;--background:var(--auth-provider-background-color,#fff)}@media screen and (max-width:599px){ion-button.authui-provider-button{width:100%}}ion-button.authui-submit-button{width:220px;margin:16px auto;display:block}@media screen and (max-width:599px){ion-button.authui-submit-button{width:100%}}ion-grid.terms{width:100%;margin:24px 0;text-align:left;font-size:.9em}ion-grid.terms ion-col ion-row a{font-size:16px;margin-left:4px}div.forgot-password{margin:24px 0;font-size:.9em}@media (prefers-color-scheme:dark){a{color:#fff}}div.auth-ui-form{width:384px;max-width:384px;padding:32px;text-align:center;flex:1 0 auto}@media screen and (max-width:599px){div.auth-ui-form{padding:24px;width:100%}}div.auth-ui-form form{width:100%;text-align:left}div.authui-wrapper{width:100%;background-size:cover;flex:1 0 auto;padding:32px}@media screen and (max-width:599px){div.authui-wrapper{padding:16px}}button.confirm:disabled{color:grey}div.email-popover-outer{width:100%}div.email-popover-outer div.email-popover-inner{padding:10%}"]
791
- },] }
792
- ];
793
- AuthUIFormFieldComponent.ctorParameters = () => [
794
- { type: UiService }
795
- ];
796
- AuthUIFormFieldComponent.propDecorators = {
797
- label: [{ type: Input }],
798
- control: [{ type: Input }],
799
- errorMessage: [{ type: Input }],
800
- errorMessageFn: [{ type: Input }],
801
- errorPrefix: [{ type: Input }],
802
- customErrors: [{ type: Input }],
803
- translateParams: [{ type: Input }],
804
- icon: [{ type: Input }],
805
- hintEnd: [{ type: Input }]
806
- };
807
-
808
- class AuthUINameFieldComponent extends ValueAccessorControlComponent {
809
- constructor(config, injector, cdRef) {
810
- super(injector, cdRef);
811
- this.config = config;
812
- this.control = new FormControl('', [
813
- Validators.minLength(this.config.authUi.nameMinLength),
814
- Validators.maxLength(this.config.authUi.nameMaxLength)
815
- ]);
816
- }
817
- }
818
- AuthUINameFieldComponent.decorators = [
819
- { type: Component, args: [{
820
- selector: 'mal-authui-name-field',
821
- template: "<mal-authui-form-field [control]=\"parentControl\"\n label=\"auth.name.label\"\n [hintEnd]=\"(control.value?.length || 0 ) + ' / ' + config.authUi.nameMaxLength\"\n errorPrefix=\"auth.name.errors\">\n\n <ion-input [placeholder]=\"'auth.name.placeholder' | translate\"\n [maxlength]=\"config.authUi.nameMaxLength\"\n [minlength]=\"config.authUi.nameMinLength\"\n color=\"text\"\n [formControl]=\"control\">\n </ion-input>\n\n</mal-authui-form-field>",
822
- providers: [
823
- { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => AuthUINameFieldComponent), multi: true },
824
- { provide: NG_VALIDATORS, useExisting: AuthUINameFieldComponent, multi: true }
825
- ],
826
- styles: ["div.authui-logo{margin:32px auto;width:30%}div.authui-logo img{display:block;max-width:120px;border-radius:20px;margin-left:auto;margin-right:auto}div.authui-title{font-size:20px;margin:16px 0}div.authui-alternate-action{margin:32px auto 24px;font-weight:500}div.authui-alternate-action .text{margin-right:8px}ion-content.auth-page{--background:var(--auth-pages-background,--background)}div.resend-confirmation{margin:24px 0;font-size:.9em;text-align:center}ion-button.authui-provider-button{width:220px;margin:8px auto;display:block;text-align:center;--background:var(--auth-provider-background-color,#fff)}@media screen and (max-width:599px){ion-button.authui-provider-button{width:100%}}ion-button.authui-submit-button{width:220px;margin:16px auto;display:block}@media screen and (max-width:599px){ion-button.authui-submit-button{width:100%}}ion-grid.terms{width:100%;margin:24px 0;text-align:left;font-size:.9em}ion-grid.terms ion-col ion-row a{font-size:16px;margin-left:4px}div.forgot-password{margin:24px 0;font-size:.9em}@media (prefers-color-scheme:dark){a{color:#fff}}div.auth-ui-form{width:384px;max-width:384px;padding:32px;text-align:center;flex:1 0 auto}@media screen and (max-width:599px){div.auth-ui-form{padding:24px;width:100%}}div.auth-ui-form form{width:100%;text-align:left}div.authui-wrapper{width:100%;background-size:cover;flex:1 0 auto;padding:32px}@media screen and (max-width:599px){div.authui-wrapper{padding:16px}}button.confirm:disabled{color:grey}div.email-popover-outer{width:100%}div.email-popover-outer div.email-popover-inner{padding:10%}"]
827
- },] }
828
- ];
829
- AuthUINameFieldComponent.ctorParameters = () => [
830
- { type: undefined, decorators: [{ type: Inject, args: [forwardRef(() => MalSharedConfigToken),] }] },
831
- { type: Injector },
832
- { type: ChangeDetectorRef }
833
- ];
834
-
835
- class AuthUIOrDividerComponent {
836
- }
837
- AuthUIOrDividerComponent.decorators = [
838
- { type: Component, args: [{
839
- selector: 'mal-authui-or-divider',
840
- template: "<div \n class=\"separator\">\n <ion-text color=\"text\" class=\"text\">{{ \"auth.common.orLabel\" | translate }}</ion-text>\n</div>",
841
- styles: [".separator{font-size:15px;font-weight:600;margin:20px auto 6px;position:relative;overflow:hidden;width:100px}.separator .text{display:inline-flex;position:relative;padding:0 8px;z-index:9999}.separator .text:after,.separator .text:before{content:\"\";display:block;width:30px;position:absolute;top:10px;border-top:1px solid}.separator .text:before{right:100%}.separator .text:after{left:100%}", "div.authui-logo{margin:32px auto;width:30%}div.authui-logo img{display:block;max-width:120px;border-radius:20px;margin-left:auto;margin-right:auto}div.authui-title{font-size:20px;margin:16px 0}div.authui-alternate-action{margin:32px auto 24px;font-weight:500}div.authui-alternate-action .text{margin-right:8px}ion-content.auth-page{--background:var(--auth-pages-background,--background)}div.resend-confirmation{margin:24px 0;font-size:.9em;text-align:center}ion-button.authui-provider-button{width:220px;margin:8px auto;display:block;text-align:center;--background:var(--auth-provider-background-color,#fff)}@media screen and (max-width:599px){ion-button.authui-provider-button{width:100%}}ion-button.authui-submit-button{width:220px;margin:16px auto;display:block}@media screen and (max-width:599px){ion-button.authui-submit-button{width:100%}}ion-grid.terms{width:100%;margin:24px 0;text-align:left;font-size:.9em}ion-grid.terms ion-col ion-row a{font-size:16px;margin-left:4px}div.forgot-password{margin:24px 0;font-size:.9em}@media (prefers-color-scheme:dark){a{color:#fff}}div.auth-ui-form{width:384px;max-width:384px;padding:32px;text-align:center;flex:1 0 auto}@media screen and (max-width:599px){div.auth-ui-form{padding:24px;width:100%}}div.auth-ui-form form{width:100%;text-align:left}div.authui-wrapper{width:100%;background-size:cover;flex:1 0 auto;padding:32px}@media screen and (max-width:599px){div.authui-wrapper{padding:16px}}button.confirm:disabled{color:grey}div.email-popover-outer{width:100%}div.email-popover-outer div.email-popover-inner{padding:10%}"]
842
- },] }
843
- ];
844
-
845
- function passwordStrengthValidator(config) {
846
- return (control) => {
847
- let strengthErrors = null;
848
- if (control.value) {
849
- if (config.passwordMinLength && control.value.length < config.passwordMinLength) {
850
- return { minlength: true };
851
- }
852
- if (config.passwordMaxLength && control.value.length > config.passwordMaxLength) {
853
- return { maxlength: true };
854
- }
855
- if (config.passwordRequireLowercase && (!/[a-z]/.test(control.value))) {
856
- if (!strengthErrors) {
857
- strengthErrors = {};
858
- }
859
- strengthErrors.requireLowercase = true;
860
- }
861
- if (config.passwordRequireUppercase && (!/[A-Z]/.test(control.value))) {
862
- if (!strengthErrors) {
863
- strengthErrors = {};
864
- }
865
- strengthErrors.requireUppercase = true;
866
- }
867
- if (config.passwordRequireSpecial && (!/[!@#\$%\^&]/.test(control.value))) {
868
- if (!strengthErrors) {
869
- strengthErrors = {};
870
- }
871
- strengthErrors.requireSpecial = true;
872
- }
873
- if (config.passwordRequireNumbers && (!/[0-9]/.test(control.value))) {
874
- if (!strengthErrors) {
875
- strengthErrors = {};
876
- }
877
- strengthErrors.requireNumbers = true;
878
- }
879
- if (strengthErrors) {
880
- return { passwordStrength: strengthErrors };
881
- }
882
- }
883
- return null;
884
- };
885
- }
886
- function confirmPasswordValidator(control) {
887
- if (!control.parent || !control) {
888
- return null;
889
- }
890
- const password = control.parent.get('password');
891
- const passwordConfirm = control.parent.get('passwordConfirm');
892
- if (!password || !passwordConfirm) {
893
- return null;
894
- }
895
- if (!password.value && !passwordConfirm.value) {
896
- return null;
897
- }
898
- if (password.value === passwordConfirm.value) {
899
- return null;
900
- }
901
- if (password.value && !passwordConfirm.value) {
902
- return { passwordConfirmationRequired: true };
903
- }
904
- return { passwordsNotMatching: true };
905
- }
906
-
907
- class AuthUIPasswordFieldComponent {
908
- constructor(config, injector, cdRef, ui) {
909
- this.config = config;
910
- this.injector = injector;
911
- this.cdRef = cdRef;
912
- this.ui = ui;
913
- // Validators are added by set validators function
914
- this.form = new FormGroup({
915
- password: new FormControl('', []),
916
- passwordConfirm: new FormControl('', [])
917
- });
918
- this.autocomplete = 'current-password';
919
- this._forUpdate = false;
920
- this.isDisabled = false;
921
- this.destroy$ = new Subject();
922
- this.propogateChange = (val) => { };
923
- this.propogateTouch = () => { };
924
- this.propogateValidationChange = () => { };
925
- this.setValidators();
926
- this.form.controls.password.valueChanges
927
- .pipe(takeUntil(this.destroy$))
928
- .subscribe(val => {
929
- try {
930
- this.form.controls.passwordConfirm.updateValueAndValidity();
931
- this.propogateChange(val);
932
- }
933
- catch (error) {
934
- this.ui.logError(error);
935
- }
936
- });
937
- this.form.statusChanges
938
- .pipe(takeUntil(this.destroy$))
939
- .subscribe(_ => {
940
- try {
941
- this.propogateValidationChange();
942
- }
943
- catch (error) {
944
- this.ui.logError(error);
945
- }
946
- });
947
- }
948
- set forUpdate(val) {
949
- this._forUpdate = val;
950
- this.setValidators();
951
- if (val) {
952
- this.autocomplete = 'new-password';
953
- }
954
- else {
955
- this.autocomplete = 'current-password';
956
- }
957
- }
958
- get forUpdate() {
959
- return this._forUpdate;
960
- }
961
- set value(val) {
962
- if (val) {
963
- this.form.patchValue({
964
- password: val,
965
- passwordConfirm: val
966
- });
967
- }
968
- else {
969
- this.form.reset();
970
- }
971
- }
972
- get value() {
973
- return this.form.controls.password.value;
974
- }
975
- ngOnDestroy() {
976
- this.destroy$.next();
977
- this.destroy$.complete();
978
- }
979
- ngAfterViewInit() {
980
- this.parentControl = this.injector.get(NgControl, null);
981
- this.setValidators();
982
- this.cdRef.detectChanges();
983
- }
984
- // Form Accessor functions
985
- registerOnChange(fn) { this.propogateChange = fn; }
986
- registerOnTouched(fn) { this.propogateTouch = fn; }
987
- registerOnValidatorChange(fn) { this.propogateValidationChange = fn; }
988
- writeValue(val) { this.value = val; }
989
- setDisabledState(isDisabled) { this.isDisabled = isDisabled; }
990
- validate(control) {
991
- if (this.form.controls.password.errors || this.form.controls.passwordConfirm.errors) {
992
- return Object.assign(this.form.controls.password.errors || {}, this.form.controls.passwordConfirm.errors || {});
993
- }
994
- else {
995
- return null;
996
- }
997
- }
998
- setValidators() {
999
- if (this.forUpdate) {
1000
- this.form.controls.password.setValidators([
1001
- Validators.maxLength(this.config.authUi.passwordMaxLength),
1002
- Validators.minLength(this.config.authUi.passwordMinLength),
1003
- passwordStrengthValidator(this.config.authUi)
1004
- ]);
1005
- this.form.controls.passwordConfirm.setValidators([
1006
- confirmPasswordValidator
1007
- ]);
1008
- }
1009
- else {
1010
- this.form.controls.password.setValidators([]);
1011
- this.form.controls.passwordConfirm.setValidators([]);
1012
- }
1013
- this.form.controls.password.updateValueAndValidity();
1014
- this.form.controls.passwordConfirm.updateValueAndValidity();
1015
- }
1016
- }
1017
- AuthUIPasswordFieldComponent.decorators = [
1018
- { type: Component, args: [{
1019
- selector: 'mal-authui-password-field',
1020
- template: "<form name=\"form\" [formGroup]=\"form\">\n <mal-authui-form-field [control]=\"parentControl\"\n label=\"auth.password.label\"\n [hintEnd]=\"form.value.password?.length || 0 + ' / ' + config.authUi.passwordMaxLength\"\n errorPrefix=\"auth.password.errors\">\n\n <ion-input (onBlur)=\"propogateTouch()\"\n [maxlength]=\"config.authUi.passwordMaxLength\"\n [minlength]=\"config.authUi.passwordMinLength\"\n [placeholder]=\"'auth.password.placeholder' | translate\"\n formControlName=\"password\"\n color=\"text\"\n type=\"password\"\n [autocomplete]=\"autocomplete\">\n </ion-input>\n\n </mal-authui-form-field>\n\n <mal-authui-form-field *ngIf=\"forUpdate\"\n label=\"auth.password.confirmLabel\"\n errorPrefix=\"auth.password.errors\">\n\n <ion-input (onBlur)=\"propogateTouch()\"\n [placeholder]=\"'auth.password.confirmPlaceholder' | translate\"\n formControlName=\"passwordConfirm\"\n color=\"text\"\n type=\"password\">\n </ion-input>\n\n </mal-authui-form-field>\n</form>\n\n<!-- TODO <mat-pass-toggle-visibility #toggle matSuffix></mat-pass-toggle-visibility> -->\n<!-- TODO <mat-password-strength #passwordStrength\n [customValidator]=\"customValidator\"\n [enableDigitRule]=\"enableDigitRule\"\n [enableLengthRule]=\"enableLengthRule\"\n [enableLowerCaseLetterRule]=\"enableLowerCaseLetterRule\"\n [enableSpecialCharRule]=\"enableSpecialCharRule\"\n [enableUpperCaseLetterRule]=\"enableUpperCaseLetterRule\"\n [externalError]=\"signUpFormGroup.controls.password.dirty\"\n [max]=\"max\"\n [min]=\"min\"\n [password]=\"signUpFormGroup.value.password\">\n </mat-password-strength> -->",
1021
- providers: [
1022
- { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => AuthUIPasswordFieldComponent), multi: true },
1023
- { provide: NG_VALIDATORS, useExisting: AuthUIPasswordFieldComponent, multi: true }
1024
- ],
1025
- styles: ["div.authui-logo{margin:32px auto;width:30%}div.authui-logo img{display:block;max-width:120px;border-radius:20px;margin-left:auto;margin-right:auto}div.authui-title{font-size:20px;margin:16px 0}div.authui-alternate-action{margin:32px auto 24px;font-weight:500}div.authui-alternate-action .text{margin-right:8px}ion-content.auth-page{--background:var(--auth-pages-background,--background)}div.resend-confirmation{margin:24px 0;font-size:.9em;text-align:center}ion-button.authui-provider-button{width:220px;margin:8px auto;display:block;text-align:center;--background:var(--auth-provider-background-color,#fff)}@media screen and (max-width:599px){ion-button.authui-provider-button{width:100%}}ion-button.authui-submit-button{width:220px;margin:16px auto;display:block}@media screen and (max-width:599px){ion-button.authui-submit-button{width:100%}}ion-grid.terms{width:100%;margin:24px 0;text-align:left;font-size:.9em}ion-grid.terms ion-col ion-row a{font-size:16px;margin-left:4px}div.forgot-password{margin:24px 0;font-size:.9em}@media (prefers-color-scheme:dark){a{color:#fff}}div.auth-ui-form{width:384px;max-width:384px;padding:32px;text-align:center;flex:1 0 auto}@media screen and (max-width:599px){div.auth-ui-form{padding:24px;width:100%}}div.auth-ui-form form{width:100%;text-align:left}div.authui-wrapper{width:100%;background-size:cover;flex:1 0 auto;padding:32px}@media screen and (max-width:599px){div.authui-wrapper{padding:16px}}button.confirm:disabled{color:grey}div.email-popover-outer{width:100%}div.email-popover-outer div.email-popover-inner{padding:10%}"]
1026
- },] }
1027
- ];
1028
- AuthUIPasswordFieldComponent.ctorParameters = () => [
1029
- { type: undefined, decorators: [{ type: Inject, args: [forwardRef(() => MalSharedConfigToken),] }] },
1030
- { type: Injector },
1031
- { type: ChangeDetectorRef },
1032
- { type: UiService }
1033
- ];
1034
- AuthUIPasswordFieldComponent.propDecorators = {
1035
- forUpdate: [{ type: Input }],
1036
- value: [{ type: Input }]
1037
- };
1038
-
1039
- class AuthRegisterPage {
1040
- constructor(ui, fire, activatedRoute, navController, config) {
1041
- this.ui = ui;
1042
- this.fire = fire;
1043
- this.activatedRoute = activatedRoute;
1044
- this.navController = navController;
1045
- this.config = config;
1046
- this.logoUrl = this.config.authUi.logoUrl;
1047
- }
1048
- ngOnInit() {
1049
- this.fire.setScreenName('register', 'AuthRegisterPage');
1050
- }
1051
- doSuccess() {
1052
- try {
1053
- const redirectUrl = this.activatedRoute.snapshot.queryParamMap.get('redirectUrl');
1054
- if (redirectUrl) {
1055
- console.log('Redirecting logged in user to>', redirectUrl);
1056
- this.navController.navigateRoot(redirectUrl);
1057
- }
1058
- else {
1059
- this.navController.navigateRoot(['/']);
1060
- }
1061
- }
1062
- catch (error) {
1063
- this.ui.logError(error);
1064
- }
1065
- }
1066
- doLoginRequested() {
1067
- try {
1068
- this.navController.navigateRoot(['/auth', 'signin'], { queryParams: { redirectUrl: this.activatedRoute.snapshot.queryParamMap.get('redirectUrl') } });
1069
- }
1070
- catch (error) {
1071
- this.ui.logError(error);
1072
- }
1073
- }
1074
- }
1075
- AuthRegisterPage.decorators = [
1076
- { type: Component, args: [{
1077
- template: "<ion-header>\r\n <ion-toolbar class=\"box-shadow\" color=\"toolbar\">\r\n <ion-buttons slot=\"start\">\r\n <ion-back-button defaultHref=\"/\"></ion-back-button>\r\n </ion-buttons>\r\n <ion-title>{{ \"auth.register.pageTitle\" | translate }}</ion-title>\r\n </ion-toolbar>\r\n</ion-header>\r\n\r\n<ion-content [fullscreen]=\"true\" class=\"auth-page\">\r\n <div fxLayout=\"column\" fxLayoutAlign=\"center center\" id=\"register-page-wrapper\">\r\n\r\n <div *ngIf=\"logoUrl\" class=\"authui-logo\">\r\n <img [@animate]=\"{ value: '*', params: { x: '50px' } }\" [src]=\"logoUrl\" alt=\"logo\">\r\n </div>\r\n\r\n <mal-authui-register (onSuccess)=\"doSuccess()\" (onLoginRequested)=\"doLoginRequested()\">\r\n </mal-authui-register>\r\n\r\n </div>\r\n</ion-content>",
1078
- animations: NgxAuthFirebaseuiAnimations,
1079
- styles: ["div.authui-logo{margin:32px auto;width:30%}div.authui-logo img{display:block;max-width:120px;border-radius:20px;margin-left:auto;margin-right:auto}div.authui-title{font-size:20px;margin:16px 0}div.authui-alternate-action{margin:32px auto 24px;font-weight:500}div.authui-alternate-action .text{margin-right:8px}ion-content.auth-page{--background:var(--auth-pages-background,--background)}div.resend-confirmation{margin:24px 0;font-size:.9em;text-align:center}ion-button.authui-provider-button{width:220px;margin:8px auto;display:block;text-align:center;--background:var(--auth-provider-background-color,#fff)}@media screen and (max-width:599px){ion-button.authui-provider-button{width:100%}}ion-button.authui-submit-button{width:220px;margin:16px auto;display:block}@media screen and (max-width:599px){ion-button.authui-submit-button{width:100%}}ion-grid.terms{width:100%;margin:24px 0;text-align:left;font-size:.9em}ion-grid.terms ion-col ion-row a{font-size:16px;margin-left:4px}div.forgot-password{margin:24px 0;font-size:.9em}@media (prefers-color-scheme:dark){a{color:#fff}}div.auth-ui-form{width:384px;max-width:384px;padding:32px;text-align:center;flex:1 0 auto}@media screen and (max-width:599px){div.auth-ui-form{padding:24px;width:100%}}div.auth-ui-form form{width:100%;text-align:left}div.authui-wrapper{width:100%;background-size:cover;flex:1 0 auto;padding:32px}@media screen and (max-width:599px){div.authui-wrapper{padding:16px}}button.confirm:disabled{color:grey}div.email-popover-outer{width:100%}div.email-popover-outer div.email-popover-inner{padding:10%}"]
1080
- },] }
1081
- ];
1082
- AuthRegisterPage.ctorParameters = () => [
1083
- { type: UiService },
1084
- { type: FirebaseService },
1085
- { type: ActivatedRoute },
1086
- { type: NavController },
1087
- { type: undefined, decorators: [{ type: Inject, args: [forwardRef(() => MalSharedConfigToken),] }] }
1088
- ];
1089
-
1090
- class AuthSignInPage {
1091
- constructor(activatedRoute, aps, navController, ui, fire, config) {
1092
- this.activatedRoute = activatedRoute;
1093
- this.aps = aps;
1094
- this.navController = navController;
1095
- this.ui = ui;
1096
- this.fire = fire;
1097
- this.config = config;
1098
- this.logoUrl = this.config.authUi.logoUrl;
1099
- }
1100
- ngOnInit() {
1101
- this.fire.setScreenName('signin', 'AuthSignInPage');
1102
- }
1103
- doSuccess(e) {
1104
- var _a;
1105
- return __awaiter(this, void 0, void 0, function* () {
1106
- const redirectUrl = this.activatedRoute.snapshot.queryParamMap.get('redirectUrl');
1107
- const forOperation = this.activatedRoute.snapshot.queryParamMap.get('forOperation');
1108
- if (redirectUrl) {
1109
- // Ridirect to page on SignIn
1110
- this.fire.addLogMessage(`Redirecting logged in user to> ${redirectUrl}`);
1111
- yield this.navController.navigateRoot(redirectUrl);
1112
- }
1113
- else {
1114
- try {
1115
- switch (forOperation) {
1116
- case 'deleteUser':
1117
- if (yield this.ui.yesNoAlert('auth.user.message.confirmDelete', { interpolateParams: { userName: (_a = this.aps.user) === null || _a === void 0 ? void 0 : _a.displayName } })) {
1118
- yield this.aps.deleteUser();
1119
- }
1120
- break;
1121
- case undefined:
1122
- case null:
1123
- break;
1124
- default:
1125
- throw new Error(`Unknown forOperation: ${forOperation}`);
1126
- }
1127
- }
1128
- catch (error) {
1129
- this.ui.logError(error);
1130
- }
1131
- finally {
1132
- yield this.navController.navigateRoot(this.config.authUi.authGuardLoggedInURL);
1133
- }
1134
- }
1135
- });
1136
- }
1137
- doCreateAccountRequested() {
1138
- try {
1139
- return this.navController.navigateRoot(['/auth', 'register'], { queryParams: { redirectUrl: this.activatedRoute.snapshot.queryParamMap.get('redirectUrl') } });
1140
- }
1141
- catch (error) {
1142
- this.ui.logError(error);
1143
- }
1144
- }
1145
- }
1146
- AuthSignInPage.decorators = [
1147
- { type: Component, args: [{
1148
- template: "<ion-header>\r\n <ion-toolbar class=\"box-shadow\" color=\"toolbar\">\r\n <ion-buttons slot=\"start\">\r\n <ion-back-button defaultHref=\"/\"></ion-back-button>\r\n </ion-buttons>\r\n <ion-title id=\"auth_signin_title\">{{ \"auth.signIn.pageTitle\" | translate }}</ion-title>\r\n </ion-toolbar>\r\n</ion-header>\r\n\r\n<ion-content [fullscreen]=\"true\" class=\"auth-page\">\r\n <div fxLayout=\"column\" fxLayoutAlign=\"center center\" id=\"register-wrapper\" class=\"authui-wrapper\">\r\n\r\n <div *ngIf=\"logoUrl\" class=\"authui-logo\">\r\n <img [@animate]=\"{ value: '*', params: { x: '50px' } }\" [src]=\"logoUrl\" alt=\"logo\">\r\n </div>\r\n\r\n <mal-authui-signin (onCreateAccountRequested)=\"doCreateAccountRequested()\" (onSuccess)=\"doSuccess($event)\"\r\n [providers]=\"['google', 'apple', 'facebook']\"></mal-authui-signin>\r\n\r\n </div>\r\n</ion-content>",
1149
- animations: NgxAuthFirebaseuiAnimations,
1150
- styles: ["div.authui-logo{margin:32px auto;width:30%}div.authui-logo img{display:block;max-width:120px;border-radius:20px;margin-left:auto;margin-right:auto}div.authui-title{font-size:20px;margin:16px 0}div.authui-alternate-action{margin:32px auto 24px;font-weight:500}div.authui-alternate-action .text{margin-right:8px}ion-content.auth-page{--background:var(--auth-pages-background,--background)}div.resend-confirmation{margin:24px 0;font-size:.9em;text-align:center}ion-button.authui-provider-button{width:220px;margin:8px auto;display:block;text-align:center;--background:var(--auth-provider-background-color,#fff)}@media screen and (max-width:599px){ion-button.authui-provider-button{width:100%}}ion-button.authui-submit-button{width:220px;margin:16px auto;display:block}@media screen and (max-width:599px){ion-button.authui-submit-button{width:100%}}ion-grid.terms{width:100%;margin:24px 0;text-align:left;font-size:.9em}ion-grid.terms ion-col ion-row a{font-size:16px;margin-left:4px}div.forgot-password{margin:24px 0;font-size:.9em}@media (prefers-color-scheme:dark){a{color:#fff}}div.auth-ui-form{width:384px;max-width:384px;padding:32px;text-align:center;flex:1 0 auto}@media screen and (max-width:599px){div.auth-ui-form{padding:24px;width:100%}}div.auth-ui-form form{width:100%;text-align:left}div.authui-wrapper{width:100%;background-size:cover;flex:1 0 auto;padding:32px}@media screen and (max-width:599px){div.authui-wrapper{padding:16px}}button.confirm:disabled{color:grey}div.email-popover-outer{width:100%}div.email-popover-outer div.email-popover-inner{padding:10%}"]
1151
- },] }
1152
- ];
1153
- AuthSignInPage.ctorParameters = () => [
1154
- { type: ActivatedRoute },
1155
- { type: AuthProcessService },
1156
- { type: NavController },
1157
- { type: UiService },
1158
- { type: FirebaseService },
1159
- { type: undefined, decorators: [{ type: Inject, args: [forwardRef(() => MalSharedConfigToken),] }] }
1160
- ];
1161
-
1162
- class AuthUserPage {
1163
- constructor() { }
1164
- }
1165
- AuthUserPage.decorators = [
1166
- { type: Component, args: [{
1167
- template: "<!-- Header -->\r\n<ion-header>\r\n <ion-toolbar class=\"box-shadow\">\r\n <ion-buttons slot=\"start\">\r\n <ion-back-button defaultHref=\"/\"></ion-back-button>\r\n </ion-buttons>\r\n <ion-title class=\"ion-text-uppercase\">{{ \"auth.user.title\" | translate }}</ion-title>\r\n </ion-toolbar>\r\n</ion-header>\r\n<!-- Content -->\r\n<ion-content>\r\n <mal-authui-user></mal-authui-user>\r\n</ion-content>"
1168
- },] }
1169
- ];
1170
- AuthUserPage.ctorParameters = () => [];
1171
-
1172
- class AuthVerifyEmailPage {
1173
- constructor(ui, fire, aps, route, navCtrl, config) {
1174
- var _a;
1175
- this.ui = ui;
1176
- this.fire = fire;
1177
- this.aps = aps;
1178
- this.route = route;
1179
- this.navCtrl = navCtrl;
1180
- this.config = config;
1181
- this.backgroundClass = ((_a = this.config) === null || _a === void 0 ? void 0 : _a.authUi.verifyEmailBackground) || '';
1182
- this.destroy$ = new Subject();
1183
- }
1184
- ngOnInit() {
1185
- this.fire.setScreenName('verifyemail', 'VerifyEmailPage');
1186
- this.aps.user$.pipe(takeUntil(this.destroy$)).subscribe(user => {
1187
- try {
1188
- if (user && user.emailVerified) {
1189
- this.doRetry();
1190
- }
1191
- }
1192
- catch (error) {
1193
- this.ui.logError(error);
1194
- }
1195
- });
1196
- this.aps.onSignOutEmitter.pipe(takeUntil(this.destroy$)).subscribe(() => {
1197
- try {
1198
- this.navCtrl.navigateRoot(this.config.authUi.authGuardFallbackURL || '/');
1199
- }
1200
- catch (error) {
1201
- this.ui.logError(error);
1202
- }
1203
- });
1204
- }
1205
- ngOnDestroy() {
1206
- this.destroy$.next();
1207
- this.destroy$.complete();
1208
- }
1209
- doRetry() {
1210
- return __awaiter(this, void 0, void 0, function* () {
1211
- try {
1212
- yield this.aps.reloadUserInfo();
1213
- const redirect = this.route.snapshot.queryParamMap.get('redirectUrl');
1214
- this.navCtrl.navigateRoot(redirect);
1215
- }
1216
- catch (error) {
1217
- this.ui.logError(error);
1218
- }
1219
- });
1220
- }
1221
- doResendVerification() {
1222
- return __awaiter(this, void 0, void 0, function* () {
1223
- try {
1224
- yield this.aps.sendNewVerificationEmail();
1225
- yield this.ui.toast('auth.emailConfirmation.onConfirmationSuccess');
1226
- }
1227
- catch (error) {
1228
- this.ui.logError(error);
1229
- }
1230
- });
1231
- }
1232
- }
1233
- AuthVerifyEmailPage.decorators = [
1234
- { type: Component, args: [{
1235
- template: "<ion-header>\n <ion-toolbar color=\"toolbar\">\n <ion-title>\n {{ \"auth.emailConfirmation.pageTitle\" | translate }}\n </ion-title>\n <ion-buttons slot=\"start\">\n </ion-buttons>\n <ion-buttons slot=\"end\">\n <mal-auth-avatar></mal-auth-avatar>\n </ion-buttons>\n </ion-toolbar>\n</ion-header>\n\n<ion-content [fullscreen]=\"true\" [class]=\"backgroundClass\">\n <div class=\"message-area\">\n <h2>{{ \"auth.emailConfirmation.title\" | translate }}</h2>\n <ion-text [innerHtml]=\"'auth.emailConfirmation.bodyHtml' | translate\"></ion-text>\n <div class=\"resend-confirmation\">\n <a (click)=\"doResendVerification()\">{{ \"auth.emailConfirmation.sendNewVerificationEmail\" | translate }}</a>\n </div>\n <ion-button expand=\"block\" (click)=\"doRetry()\">{{ \"auth.emailConfirmation.refreshStatus\" | translate }}</ion-button>\n </div>\n</ion-content>",
1236
- styles: ["div.authui-logo{margin:32px auto;width:30%}div.authui-logo img{display:block;max-width:120px;border-radius:20px;margin-left:auto;margin-right:auto}div.authui-title{font-size:20px;margin:16px 0}div.authui-alternate-action{margin:32px auto 24px;font-weight:500}div.authui-alternate-action .text{margin-right:8px}ion-content.auth-page{--background:var(--auth-pages-background,--background)}div.resend-confirmation{margin:24px 0;font-size:.9em;text-align:center}ion-button.authui-provider-button{width:220px;margin:8px auto;display:block;text-align:center;--background:var(--auth-provider-background-color,#fff)}@media screen and (max-width:599px){ion-button.authui-provider-button{width:100%}}ion-button.authui-submit-button{width:220px;margin:16px auto;display:block}@media screen and (max-width:599px){ion-button.authui-submit-button{width:100%}}ion-grid.terms{width:100%;margin:24px 0;text-align:left;font-size:.9em}ion-grid.terms ion-col ion-row a{font-size:16px;margin-left:4px}div.forgot-password{margin:24px 0;font-size:.9em}@media (prefers-color-scheme:dark){a{color:#fff}}div.auth-ui-form{width:384px;max-width:384px;padding:32px;text-align:center;flex:1 0 auto}@media screen and (max-width:599px){div.auth-ui-form{padding:24px;width:100%}}div.auth-ui-form form{width:100%;text-align:left}div.authui-wrapper{width:100%;background-size:cover;flex:1 0 auto;padding:32px}@media screen and (max-width:599px){div.authui-wrapper{padding:16px}}button.confirm:disabled{color:grey}div.email-popover-outer{width:100%}div.email-popover-outer div.email-popover-inner{padding:10%}"]
1237
- },] }
1238
- ];
1239
- AuthVerifyEmailPage.ctorParameters = () => [
1240
- { type: UiService },
1241
- { type: FirebaseService },
1242
- { type: AuthProcessService },
1243
- { type: ActivatedRoute },
1244
- { type: NavController },
1245
- { type: undefined, decorators: [{ type: Inject, args: [forwardRef(() => MalSharedConfigToken),] }] }
1246
- ];
1247
-
1248
- // Angular & Inionc
1249
- class AuthUITermsFieldComponent {
1250
- // tslint:disable-next-line @typescript-eslint/ban-types
1251
- constructor(config, aps, ui) {
1252
- this.config = config;
1253
- this.aps = aps;
1254
- this.ui = ui;
1255
- this.termsForm = new FormGroup({
1256
- tos: new FormControl(true, []),
1257
- privacyPolicy: new FormControl(true, [])
1258
- });
1259
- // Config
1260
- this.tosUrl = this.config.authUi.tosUrl;
1261
- this.privacyPolicyUrl = this.config.authUi.privacyPolicyUrl;
1262
- // Private
1263
- this.destroy$ = new Subject();
1264
- this.propogateChange = (val) => { };
1265
- this.propogateTouch = () => { };
1266
- this.propogateValidationChange = () => { };
1267
- this.termsForm.statusChanges
1268
- .pipe(takeUntil(this.destroy$))
1269
- .subscribe(_ => {
1270
- try {
1271
- this.propogateValidationChange();
1272
- }
1273
- catch (error) {
1274
- this.ui.logError(error);
1275
- }
1276
- });
1277
- }
1278
- set value(val) {
1279
- if (val) {
1280
- this.termsForm.patchValue({
1281
- tos: val,
1282
- privacyPolicy: val
1283
- });
1284
- }
1285
- else {
1286
- this.termsForm.reset();
1287
- }
1288
- }
1289
- get value() {
1290
- return this.termsForm.controls.tos.value && this.termsForm.controls.privacyPolicy.value;
1291
- }
1292
- // Form Accessor functions
1293
- registerOnChange(fn) { this.propogateChange = fn; }
1294
- registerOnTouched(fn) { this.propogateTouch = fn; }
1295
- registerOnValidatorChange(fn) { this.propogateValidationChange = fn; }
1296
- writeValue(val) { this.value = val; }
1297
- validate(control) {
1298
- if (this.termsForm.controls.tos.errors || this.termsForm.controls.privacyPolicy.errors) {
1299
- return Object.assign(this.termsForm.controls.tos.errors || {}, this.termsForm.controls.privacyPolicy.errors || {});
1300
- }
1301
- else {
1302
- return null;
1303
- }
1304
- }
1305
- ngOnInit() {
1306
- // If tos or privacy policy url set, ensure that the two form items are required
1307
- if (this.config.authUi.tosUrl) {
1308
- this.termsForm.controls.tos.setValidators(Validators.requiredTrue);
1309
- }
1310
- if (this.config.authUi.privacyPolicyUrl) {
1311
- this.termsForm.controls.privacyPolicy.setValidators(Validators.requiredTrue);
1312
- }
1313
- this.termsForm.updateValueAndValidity();
1314
- }
1315
- ngOnDestroy() {
1316
- this.destroy$.next();
1317
- this.destroy$.complete();
1318
- }
1319
- }
1320
- AuthUITermsFieldComponent.decorators = [
1321
- { type: Component, args: [{
1322
- selector: 'mal-authui-terms-field',
1323
- template: "<form [formGroup]=\"termsForm\">\n <ion-grid class=\"terms\">\n <ion-row *ngIf=\"this.tosUrl\">\n <ion-col size=\"2\">\n <ion-checkbox color=\"primary\" attr.aria-label=\"{{ 'auth.legal.readAndAccept' | translate }} {{ 'auth.legal.termsAndConditions'\n | translate }}\" formControlName=\"tos\"> </ion-checkbox>\n </ion-col>\n <ion-col>\n <ion-text color=\"text\"> {{ \"auth.legal.readAndAccept\" | translate }}</ion-text>\n <a target=\"_blank\" [href]=\"this.tosUrl\">\n {{ \"auth.legal.termsAndConditions\" | translate }}\n </a>\n </ion-col>\n </ion-row>\n <ion-row *ngIf=\"this.privacyPolicyUrl\">\n <ion-col size=\"2\">\n <ion-checkbox color=\"primary\" attr.aria-label=\"{{ 'auth.legal.readAndAccept' | translate }} {{ 'auth.legal.privacyPolicy'\n | translate }}\" formControlName=\"privacyPolicy\"></ion-checkbox>\n </ion-col>\n <ion-col>\n <ion-text color=\"text\">{{ \"auth.legal.readAndAccept\" | translate }}</ion-text>\n <a target=\"_blank\" [href]=\"this.privacyPolicyUrl\">\n {{ \"auth.legal.privacyPolicy\" | translate }}\n </a>\n </ion-col>\n </ion-row>\n </ion-grid>\n</form>",
1324
- providers: [
1325
- { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => AuthUITermsFieldComponent), multi: true },
1326
- { provide: NG_VALIDATORS, useExisting: AuthUITermsFieldComponent, multi: true }
1327
- ],
1328
- styles: ["div.authui-logo{margin:32px auto;width:30%}div.authui-logo img{display:block;max-width:120px;border-radius:20px;margin-left:auto;margin-right:auto}div.authui-title{font-size:20px;margin:16px 0}div.authui-alternate-action{margin:32px auto 24px;font-weight:500}div.authui-alternate-action .text{margin-right:8px}ion-content.auth-page{--background:var(--auth-pages-background,--background)}div.resend-confirmation{margin:24px 0;font-size:.9em;text-align:center}ion-button.authui-provider-button{width:220px;margin:8px auto;display:block;text-align:center;--background:var(--auth-provider-background-color,#fff)}@media screen and (max-width:599px){ion-button.authui-provider-button{width:100%}}ion-button.authui-submit-button{width:220px;margin:16px auto;display:block}@media screen and (max-width:599px){ion-button.authui-submit-button{width:100%}}ion-grid.terms{width:100%;margin:24px 0;text-align:left;font-size:.9em}ion-grid.terms ion-col ion-row a{font-size:16px;margin-left:4px}div.forgot-password{margin:24px 0;font-size:.9em}@media (prefers-color-scheme:dark){a{color:#fff}}div.auth-ui-form{width:384px;max-width:384px;padding:32px;text-align:center;flex:1 0 auto}@media screen and (max-width:599px){div.auth-ui-form{padding:24px;width:100%}}div.auth-ui-form form{width:100%;text-align:left}div.authui-wrapper{width:100%;background-size:cover;flex:1 0 auto;padding:32px}@media screen and (max-width:599px){div.authui-wrapper{padding:16px}}button.confirm:disabled{color:grey}div.email-popover-outer{width:100%}div.email-popover-outer div.email-popover-inner{padding:10%}"]
1329
- },] }
1330
- ];
1331
- AuthUITermsFieldComponent.ctorParameters = () => [
1332
- { type: undefined, decorators: [{ type: Inject, args: [forwardRef(() => MalSharedConfigToken),] }] },
1333
- { type: AuthProcessService },
1334
- { type: UiService }
1335
- ];
1336
- AuthUITermsFieldComponent.propDecorators = {
1337
- value: [{ type: Input }]
1338
- };
1339
-
1340
- class AuthUIRegisterWithEmailComponent {
1341
- // tslint:disable-next-line @typescript-eslint/ban-types
1342
- constructor(config, aps, ui, changeDetectorRef) {
1343
- this.config = config;
1344
- this.aps = aps;
1345
- this.ui = ui;
1346
- this.changeDetectorRef = changeDetectorRef;
1347
- this.createAccountClick = new EventEmitter();
1348
- this.registerForm = new FormGroup({
1349
- name: new FormControl('', [Validators.required]),
1350
- email: new FormControl('', [Validators.required]),
1351
- password: new FormControl('', [Validators.required]),
1352
- terms: new FormControl(true, []),
1353
- });
1354
- // Prevent somebody already logged in as guest - relogging in as gyest
1355
- this.guestEnabled$ = this.aps.canSignInAsGuest$;
1356
- // Private
1357
- this.destroy$ = new Subject();
1358
- }
1359
- ngAfterViewInit() {
1360
- this.changeDetectorRef.detectChanges();
1361
- }
1362
- ngOnDestroy() {
1363
- this.destroy$.next();
1364
- this.destroy$.complete();
1365
- }
1366
- doCreateAccount() {
1367
- return __awaiter(this, void 0, void 0, function* () {
1368
- this.createAccountClick.emit(this.registerForm.value);
1369
- });
1370
- }
1371
- }
1372
- AuthUIRegisterWithEmailComponent.decorators = [
1373
- { type: Component, args: [{
1374
- selector: 'mal-authui-register-with-email',
1375
- template: "<form [@animate]=\"{value:'*',params:{duration:'300ms',y:'100px'}}\"\n [formGroup]=\"registerForm\"\n novalidate>\n\n <mal-authui-name-field formControlName=\"name\"\n [@animate]=\"{ value: '*', params: { x: '50px' } }\">\n </mal-authui-name-field>\n\n <mal-authui-email-field formControlName=\"email\"\n [@animate]=\"{ value: '*', params: { x: '50px' } }\">\n </mal-authui-email-field>\n\n <mal-authui-password-field formControlName=\"password\"\n [forUpdate]=\"true\"\n [@animate]=\"{ value: '*', params: { x: '50px' } }\">\n </mal-authui-password-field>\n\n <mal-authui-terms-field formControlName=\"terms\"\n [@animate]=\"{ value: '*', params: { x: '50px' } }\">\n </mal-authui-terms-field>\n\n <ion-button (click)=\"doCreateAccount()\"\n color=\"primary\"\n [disabled]=\"registerForm.invalid\"\n aria-label=\"CREATE AN ACCOUNT\"\n class=\"authui-submit-button\"\n id=\"createAccountButton\">\n {{ \"auth.register.createAccountButton\" | translate }}\n </ion-button>\n\n</form>",
1376
- encapsulation: ViewEncapsulation.None,
1377
- animations: NgxAuthFirebaseuiAnimations,
1378
- styles: ["div.authui-logo{margin:32px auto;width:30%}div.authui-logo img{display:block;max-width:120px;border-radius:20px;margin-left:auto;margin-right:auto}div.authui-title{font-size:20px;margin:16px 0}div.authui-alternate-action{margin:32px auto 24px;font-weight:500}div.authui-alternate-action .text{margin-right:8px}ion-content.auth-page{--background:var(--auth-pages-background,--background)}div.resend-confirmation{margin:24px 0;font-size:.9em;text-align:center}ion-button.authui-provider-button{width:220px;margin:8px auto;display:block;text-align:center;--background:var(--auth-provider-background-color,#fff)}@media screen and (max-width:599px){ion-button.authui-provider-button{width:100%}}ion-button.authui-submit-button{width:220px;margin:16px auto;display:block}@media screen and (max-width:599px){ion-button.authui-submit-button{width:100%}}ion-grid.terms{width:100%;margin:24px 0;text-align:left;font-size:.9em}ion-grid.terms ion-col ion-row a{font-size:16px;margin-left:4px}div.forgot-password{margin:24px 0;font-size:.9em}@media (prefers-color-scheme:dark){a{color:#fff}}div.auth-ui-form{width:384px;max-width:384px;padding:32px;text-align:center;flex:1 0 auto}@media screen and (max-width:599px){div.auth-ui-form{padding:24px;width:100%}}div.auth-ui-form form{width:100%;text-align:left}div.authui-wrapper{width:100%;background-size:cover;flex:1 0 auto;padding:32px}@media screen and (max-width:599px){div.authui-wrapper{padding:16px}}button.confirm:disabled{color:grey}div.email-popover-outer{width:100%}div.email-popover-outer div.email-popover-inner{padding:10%}"]
1379
- },] }
1380
- ];
1381
- AuthUIRegisterWithEmailComponent.ctorParameters = () => [
1382
- { type: undefined, decorators: [{ type: Inject, args: [forwardRef(() => MalSharedConfigToken),] }] },
1383
- { type: AuthProcessService },
1384
- { type: UiService },
1385
- { type: ChangeDetectorRef }
1386
- ];
1387
- AuthUIRegisterWithEmailComponent.propDecorators = {
1388
- createAccountClick: [{ type: Output }]
1389
- };
1390
-
1391
- // Angular & Inionc
1392
- class AuthUIRegisterWithEmailPopoverComponent {
1393
- constructor(popoverController) {
1394
- this.popoverController = popoverController;
1395
- }
1396
- doCreateAccountClick(data) {
1397
- this.popoverController.dismiss(data);
1398
- }
1399
- }
1400
- AuthUIRegisterWithEmailPopoverComponent.decorators = [
1401
- { type: Component, args: [{
1402
- template: "<div class=\"email-popover-outer\">\n <div class=\"email-popover-inner\">\n <mal-authui-register-with-email (createAccountClick)=\"doCreateAccountClick($event)\">\n </mal-authui-register-with-email>\n </div>\n</div>",
1403
- encapsulation: ViewEncapsulation.None,
1404
- animations: NgxAuthFirebaseuiAnimations,
1405
- styles: ["div.authui-logo{margin:32px auto;width:30%}div.authui-logo img{display:block;max-width:120px;border-radius:20px;margin-left:auto;margin-right:auto}div.authui-title{font-size:20px;margin:16px 0}div.authui-alternate-action{margin:32px auto 24px;font-weight:500}div.authui-alternate-action .text{margin-right:8px}ion-content.auth-page{--background:var(--auth-pages-background,--background)}div.resend-confirmation{margin:24px 0;font-size:.9em;text-align:center}ion-button.authui-provider-button{width:220px;margin:8px auto;display:block;text-align:center;--background:var(--auth-provider-background-color,#fff)}@media screen and (max-width:599px){ion-button.authui-provider-button{width:100%}}ion-button.authui-submit-button{width:220px;margin:16px auto;display:block}@media screen and (max-width:599px){ion-button.authui-submit-button{width:100%}}ion-grid.terms{width:100%;margin:24px 0;text-align:left;font-size:.9em}ion-grid.terms ion-col ion-row a{font-size:16px;margin-left:4px}div.forgot-password{margin:24px 0;font-size:.9em}@media (prefers-color-scheme:dark){a{color:#fff}}div.auth-ui-form{width:384px;max-width:384px;padding:32px;text-align:center;flex:1 0 auto}@media screen and (max-width:599px){div.auth-ui-form{padding:24px;width:100%}}div.auth-ui-form form{width:100%;text-align:left}div.authui-wrapper{width:100%;background-size:cover;flex:1 0 auto;padding:32px}@media screen and (max-width:599px){div.authui-wrapper{padding:16px}}button.confirm:disabled{color:grey}div.email-popover-outer{width:100%}div.email-popover-outer div.email-popover-inner{padding:10%}"]
1406
- },] }
1407
- ];
1408
- AuthUIRegisterWithEmailPopoverComponent.ctorParameters = () => [
1409
- { type: PopoverController }
1410
- ];
1411
-
1412
- var registerWithEmailPopover_component = /*#__PURE__*/Object.freeze({
1413
- __proto__: null,
1414
- AuthUIRegisterWithEmailPopoverComponent: AuthUIRegisterWithEmailPopoverComponent
1415
- });
1416
-
1417
- // @angular/*
1418
- const COMPONENTS = [
1419
- AuthUIUserComponent,
1420
- EmailConfirmationComponent,
1421
- AuthUISignInComponent,
1422
- AuthUIRegisterComponent,
1423
- AuthUIReauthenticateComponent,
1424
- AuthSignInPage,
1425
- AuthRegisterPage,
1426
- AuthUserPage,
1427
- AuthVerifyEmailPage,
1428
- AuthUIPasswordFieldComponent,
1429
- AuthUIEmailFieldComponent,
1430
- AuthUINameFieldComponent,
1431
- AuthUIFormFieldComponent,
1432
- AuthUITermsFieldComponent,
1433
- AuthUIRegisterWithEmailComponent,
1434
- AuthUIRegisterWithEmailPopoverComponent,
1435
- AuthUIOrDividerComponent,
1436
- AuthProvidersComponent
1437
- ];
1438
- const IONIC_AUTH_UI_ROUTER_CONFIG = [
1439
- { path: 'signin', component: AuthSignInPage },
1440
- { path: 'register', component: AuthRegisterPage },
1441
- { path: 'user', component: AuthUserPage },
1442
- { path: 'verify', component: AuthVerifyEmailPage },
1443
- { path: '', pathMatch: 'full', redirectTo: 'signin' }
1444
- ];
1445
- class MalIonicAuthUiModule {
1446
- }
1447
- MalIonicAuthUiModule.decorators = [
1448
- { type: NgModule, args: [{
1449
- imports: [
1450
- MalSharedModule,
1451
- MalIonicModule,
1452
- IonicModule,
1453
- CommonModule,
1454
- TooltipsModule,
1455
- HttpClientModule,
1456
- FormsModule,
1457
- ReactiveFormsModule,
1458
- FlexLayoutModule,
1459
- ],
1460
- exports: [
1461
- ...COMPONENTS,
1462
- FormsModule,
1463
- ReactiveFormsModule,
1464
- FlexLayoutModule,
1465
- IonicModule
1466
- ],
1467
- declarations: COMPONENTS,
1468
- entryComponents: [
1469
- AuthUIUserComponent
1470
- ]
1471
- },] }
1472
- ];
1473
- // Guards
1474
- // Components
1475
- // services
1476
-
1477
- /**
1478
- * Generated bundle index. Do not edit.
1479
- */
1480
-
1481
- export { AuthProvidersComponent, AuthRegisterPage, AuthSignInPage, AuthUIEmailFieldComponent, AuthUIFormFieldComponent, AuthUINameFieldComponent, AuthUIOrDividerComponent, AuthUIPasswordFieldComponent, AuthUIReauthenticateComponent, AuthUIRegisterComponent, AuthUISignInComponent, AuthUIUserComponent, AuthUserPage, AuthVerifyEmailPage, EmailConfirmationComponent, IONIC_AUTH_UI_ROUTER_CONFIG, Layout, MalIonicAuthUiModule, NgxAuthFirebaseuiAnimations, AuthSignInPage as ɵa, AuthRegisterPage as ɵb, AuthUserPage as ɵc, AuthVerifyEmailPage as ɵd, AuthUIUserComponent as ɵe, EmailConfirmationComponent as ɵf, AuthUISignInComponent as ɵg, AuthUIRegisterComponent as ɵh, AuthUIReauthenticateComponent as ɵi, AuthUIPasswordFieldComponent as ɵj, AuthUIEmailFieldComponent as ɵk, AuthUINameFieldComponent as ɵl, AuthUIFormFieldComponent as ɵm, AuthUITermsFieldComponent as ɵn, AuthUIRegisterWithEmailComponent as ɵo, AuthUIRegisterWithEmailPopoverComponent as ɵp, AuthUIOrDividerComponent as ɵq, AuthProvidersComponent as ɵr };
1482
- //# sourceMappingURL=ngx-firebase-ionic-auth-ui.js.map