@aws-amplify/ui-angular 2.4.26 → 3.1.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 (91) hide show
  1. package/README.md +0 -3
  2. package/aws-amplify-ui-angular.d.ts +1 -27
  3. package/bundles/aws-amplify-ui-angular.umd.js +1607 -1517
  4. package/bundles/aws-amplify-ui-angular.umd.js.map +1 -1
  5. package/esm2015/aws-amplify-ui-angular.js +1 -28
  6. package/esm2015/lib/common/types/auth-types.js +1 -1
  7. package/esm2015/lib/components/authenticator/authenticator.module.js +81 -44
  8. package/esm2015/lib/components/authenticator/components/authenticator/authenticator.component.js +60 -36
  9. package/esm2015/lib/components/authenticator/components/base-form-fields/base-form-fields.component.js +20 -39
  10. package/esm2015/lib/components/authenticator/components/confirm-reset-password/amplify-confirm-reset-password.component.js +28 -27
  11. package/esm2015/lib/components/authenticator/components/confirm-sign-in/confirm-sign-in.component.js +25 -30
  12. package/esm2015/lib/components/authenticator/components/confirm-sign-up/confirm-sign-up.component.js +29 -36
  13. package/esm2015/lib/components/authenticator/components/confirm-verify-user/amplify-confirm-verify-user.component.js +27 -19
  14. package/esm2015/lib/components/authenticator/components/federated-sign-in/federated-sign-in.component.js +20 -17
  15. package/esm2015/lib/components/authenticator/components/federated-sign-in-button/federated-sign-in-button.component.js +17 -15
  16. package/esm2015/lib/components/authenticator/components/force-new-password/force-new-password-form-fields/force-new-password-form-fields.component.js +12 -7
  17. package/esm2015/lib/components/authenticator/components/force-new-password/force-new-password.component.js +27 -19
  18. package/esm2015/lib/components/authenticator/components/form-field/form-field.component.js +20 -15
  19. package/esm2015/lib/components/authenticator/components/reset-password/reset-password.component.js +27 -19
  20. package/esm2015/lib/components/authenticator/components/setup-totp/setup-totp.component.js +27 -21
  21. package/esm2015/lib/components/authenticator/components/sign-in/sign-in.component.js +27 -23
  22. package/esm2015/lib/components/authenticator/components/sign-up/sign-up-form-fields/sign-up-form-fields.component.js +12 -7
  23. package/esm2015/lib/components/authenticator/components/sign-up/sign-up.component.js +24 -16
  24. package/esm2015/lib/components/authenticator/components/verify-user/verify-user.component.js +27 -20
  25. package/esm2015/lib/primitives/button/button.component.js +44 -22
  26. package/esm2015/lib/primitives/checkbox/checkbox.component.js +24 -15
  27. package/esm2015/lib/primitives/error/error.component.js +13 -7
  28. package/esm2015/lib/primitives/password-field/password-field.component.js +37 -21
  29. package/esm2015/lib/primitives/phone-number-field/phone-number-field.component.js +45 -25
  30. package/esm2015/lib/primitives/select/select.component.js +22 -14
  31. package/esm2015/lib/primitives/tab-item/tab-item.component.js +25 -15
  32. package/esm2015/lib/primitives/tabs/tabs.component.js +17 -11
  33. package/esm2015/lib/primitives/text-field/text-field.component.js +38 -22
  34. package/esm2015/lib/services/authenticator.service.js +33 -30
  35. package/esm2015/lib/services/custom-components.service.js +9 -7
  36. package/esm2015/lib/utilities/amplify-slot/amplify-slot.component.js +20 -16
  37. package/esm2015/lib/utilities/amplify-slot/amplify-slot.directive.js +13 -13
  38. package/fesm2015/aws-amplify-ui-angular.js +1066 -957
  39. package/fesm2015/aws-amplify-ui-angular.js.map +1 -1
  40. package/lib/common/types/auth-types.d.ts +2 -2
  41. package/lib/components/authenticator/authenticator.module.d.ts +33 -0
  42. package/lib/components/authenticator/components/authenticator/authenticator.component.d.ts +16 -35
  43. package/lib/components/authenticator/components/base-form-fields/base-form-fields.component.d.ts +3 -1
  44. package/lib/components/authenticator/components/confirm-reset-password/amplify-confirm-reset-password.component.d.ts +17 -41
  45. package/lib/components/authenticator/components/confirm-sign-in/confirm-sign-in.component.d.ts +16 -35
  46. package/lib/components/authenticator/components/confirm-sign-up/confirm-sign-up.component.d.ts +16 -40
  47. package/lib/components/authenticator/components/confirm-verify-user/amplify-confirm-verify-user.component.d.ts +16 -35
  48. package/lib/components/authenticator/components/federated-sign-in/federated-sign-in.component.d.ts +3 -0
  49. package/lib/components/authenticator/components/federated-sign-in-button/federated-sign-in-button.component.d.ts +3 -0
  50. package/lib/components/authenticator/components/force-new-password/force-new-password-form-fields/force-new-password-form-fields.component.d.ts +3 -0
  51. package/lib/components/authenticator/components/force-new-password/force-new-password.component.d.ts +16 -35
  52. package/lib/components/authenticator/components/form-field/form-field.component.d.ts +3 -0
  53. package/lib/components/authenticator/components/reset-password/reset-password.component.d.ts +16 -35
  54. package/lib/components/authenticator/components/setup-totp/setup-totp.component.d.ts +16 -35
  55. package/lib/components/authenticator/components/sign-in/sign-in.component.d.ts +16 -35
  56. package/lib/components/authenticator/components/sign-up/sign-up-form-fields/sign-up-form-fields.component.d.ts +3 -0
  57. package/lib/components/authenticator/components/sign-up/sign-up.component.d.ts +16 -35
  58. package/lib/components/authenticator/components/verify-user/verify-user.component.d.ts +16 -35
  59. package/lib/primitives/button/button.component.d.ts +3 -0
  60. package/lib/primitives/checkbox/checkbox.component.d.ts +3 -0
  61. package/lib/primitives/error/error.component.d.ts +3 -0
  62. package/lib/primitives/password-field/password-field.component.d.ts +3 -0
  63. package/lib/primitives/phone-number-field/phone-number-field.component.d.ts +3 -0
  64. package/lib/primitives/select/select.component.d.ts +3 -0
  65. package/lib/primitives/tab-item/tab-item.component.d.ts +3 -0
  66. package/lib/primitives/tabs/tabs.component.d.ts +3 -0
  67. package/lib/primitives/text-field/text-field.component.d.ts +3 -0
  68. package/lib/services/authenticator.service.d.ts +28 -49
  69. package/lib/services/custom-components.service.d.ts +3 -0
  70. package/lib/utilities/amplify-slot/amplify-slot.component.d.ts +3 -0
  71. package/lib/utilities/amplify-slot/amplify-slot.directive.d.ts +3 -0
  72. package/package.json +3 -6
  73. package/aws-amplify-ui-angular.metadata.json +0 -1
  74. package/bundles/aws-amplify-ui-angular-legacy.umd.js +0 -2238
  75. package/bundles/aws-amplify-ui-angular-legacy.umd.js.map +0 -1
  76. package/bundles/aws-amplify-ui-angular-legacy.umd.min.js +0 -2
  77. package/bundles/aws-amplify-ui-angular-legacy.umd.min.js.map +0 -1
  78. package/bundles/aws-amplify-ui-angular.umd.min.js +0 -2
  79. package/bundles/aws-amplify-ui-angular.umd.min.js.map +0 -1
  80. package/esm2015/legacy/aws-amplify-ui-angular-legacy.js +0 -6
  81. package/esm2015/legacy/index.js +0 -3
  82. package/esm2015/legacy/legacy-ui-angular.module.js +0 -53
  83. package/esm2015/legacy/proxies.js +0 -1839
  84. package/fesm2015/aws-amplify-ui-angular-legacy.js +0 -1846
  85. package/fesm2015/aws-amplify-ui-angular-legacy.js.map +0 -1
  86. package/legacy/aws-amplify-ui-angular-legacy.d.ts +0 -5
  87. package/legacy/aws-amplify-ui-angular-legacy.metadata.json +0 -1
  88. package/legacy/index.d.ts +0 -2
  89. package/legacy/legacy-ui-angular.module.d.ts +0 -2
  90. package/legacy/package.json +0 -11
  91. package/legacy/proxies.d.ts +0 -395
@@ -1,14 +1,15 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Directive, TemplateRef, Input, Injectable, Component, ViewEncapsulation, ChangeDetectorRef, ContentChildren, HostBinding, EventEmitter, Output, NgModule } from '@angular/core';
2
+ import { Directive, Input, Injectable, Component, HostBinding, EventEmitter, ContentChildren, Output, ViewEncapsulation, NgModule } from '@angular/core';
3
+ import * as i6 from '@angular/common';
3
4
  import { CommonModule } from '@angular/common';
4
- import { createAuthenticatorMachine, getServiceContextFacade, getSendEventAliases, translate, listenToAuthHub, defaultAuthHubHandler, hasTranslation, getFormDataFromEvent, getActorContext, FederatedIdentityProviders, countryDialCodes, getErrors, getTotpCodeURL, defaultFormFieldOptions, getActorState, getSortedFormFields, getDefaultFormFields, applyDefaults, sortFormFields } from '@aws-amplify/ui';
5
+ import { __awaiter } from 'tslib';
6
+ import { createAuthenticatorMachine, getServiceFacade, translate, authenticatorTextUtil, FederatedIdentityProviders, countryDialCodes, getErrors, getSortedFormFields, getFormDataFromEvent, getActorContext, getTotpCodeURL, defaultFormFieldOptions, getActorState, listenToAuthHub, defaultAuthHubHandler } from '@aws-amplify/ui';
5
7
  export { translations } from '@aws-amplify/ui';
6
8
  import { Logger } from '@aws-amplify/core';
7
9
  import { interpret } from 'xstate';
8
- import { Logger as Logger$1, Auth } from 'aws-amplify';
9
10
  import { nanoid } from 'nanoid';
10
- import { __awaiter } from 'tslib';
11
11
  import QRCode from 'qrcode';
12
+ import { Logger as Logger$1, Auth } from 'aws-amplify';
12
13
 
13
14
  class AmplifySlotDirective {
14
15
  constructor(template) {
@@ -18,17 +19,16 @@ class AmplifySlotDirective {
18
19
  this.name = component;
19
20
  }
20
21
  }
21
- AmplifySlotDirective.decorators = [
22
- { type: Directive, args: [{
23
- selector: '[amplifySlot]',
24
- },] }
25
- ];
26
- AmplifySlotDirective.ctorParameters = () => [
27
- { type: TemplateRef }
28
- ];
29
- AmplifySlotDirective.propDecorators = {
30
- amplifySlot: [{ type: Input }]
31
- };
22
+ AmplifySlotDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: AmplifySlotDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
23
+ AmplifySlotDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: AmplifySlotDirective, selector: "[amplifySlot]", inputs: { amplifySlot: "amplifySlot" }, ngImport: i0 });
24
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: AmplifySlotDirective, decorators: [{
25
+ type: Directive,
26
+ args: [{
27
+ selector: '[amplifySlot]',
28
+ }]
29
+ }], ctorParameters: function () { return [{ type: i0.TemplateRef }]; }, propDecorators: { amplifySlot: [{
30
+ type: Input
31
+ }] } });
32
32
 
33
33
  /**
34
34
  * Stores and provides custom components that users provide with `amplify-slot`.
@@ -44,14 +44,16 @@ class CustomComponentsService {
44
44
  this._customComponents = Object.assign(Object.assign({}, this._customComponents), customComponents);
45
45
  }
46
46
  }
47
- CustomComponentsService.ɵprov = i0.ɵɵdefineInjectable({ factory: function CustomComponentsService_Factory() { return new CustomComponentsService(); }, token: CustomComponentsService, providedIn: "root" });
48
- CustomComponentsService.decorators = [
49
- { type: Injectable, args: [{
50
- providedIn: 'root',
51
- },] }
52
- ];
47
+ CustomComponentsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CustomComponentsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
48
+ CustomComponentsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CustomComponentsService, providedIn: 'root' });
49
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CustomComponentsService, decorators: [{
50
+ type: Injectable,
51
+ args: [{
52
+ providedIn: 'root',
53
+ }]
54
+ }] });
53
55
 
54
- const logger$2 = new Logger('state-machine');
56
+ const logger$1 = new Logger('state-machine');
55
57
  /**
56
58
  * AuthenticatorService provides access to the authenticator state and context.
57
59
  */
@@ -60,10 +62,13 @@ class AuthenticatorService {
60
62
  const machine = createAuthenticatorMachine();
61
63
  const authService = interpret(machine).start();
62
64
  this._machineSubscription = authService.subscribe((state) => {
63
- this._authState = state;
64
- this._facade = getServiceContextFacade(state);
65
+ const newState = state;
66
+ this._authState = newState;
67
+ this._facade = getServiceFacade({
68
+ send: authService.send,
69
+ state: newState,
70
+ });
65
71
  });
66
- this._sendEventAliases = getSendEventAliases(authService.send);
67
72
  this._authService = authService;
68
73
  }
69
74
  ngOnDestroy() {
@@ -109,40 +114,40 @@ class AuthenticatorService {
109
114
  * Service facades
110
115
  */
111
116
  get initializeMachine() {
112
- return this._sendEventAliases.initializeMachine;
117
+ return this._facade.initializeMachine;
113
118
  }
114
119
  get updateForm() {
115
- return this._sendEventAliases.updateForm;
120
+ return this._facade.updateForm;
116
121
  }
117
122
  get updateBlur() {
118
- return this._sendEventAliases.updateBlur;
123
+ return this._facade.updateBlur;
119
124
  }
120
125
  get resendCode() {
121
- return this._sendEventAliases.resendCode;
126
+ return this._facade.resendCode;
122
127
  }
123
128
  get signOut() {
124
- return this._sendEventAliases.signOut;
129
+ return this._facade.signOut;
125
130
  }
126
131
  get submitForm() {
127
- return this._sendEventAliases.submitForm;
132
+ return this._facade.submitForm;
128
133
  }
129
134
  /**
130
135
  * Transition facades
131
136
  */
132
137
  get toFederatedSignIn() {
133
- return this._sendEventAliases.toFederatedSignIn;
138
+ return this._facade.toFederatedSignIn;
134
139
  }
135
140
  get toResetPassword() {
136
- return this._sendEventAliases.toResetPassword;
141
+ return this._facade.toResetPassword;
137
142
  }
138
143
  get toSignIn() {
139
- return this._sendEventAliases.toSignIn;
144
+ return this._facade.toSignIn;
140
145
  }
141
146
  get toSignUp() {
142
- return this._sendEventAliases.toSignUp;
147
+ return this._facade.toSignUp;
143
148
  }
144
149
  get skipVerification() {
145
- return this._sendEventAliases.skipVerification;
150
+ return this._facade.skipVerification;
146
151
  }
147
152
  /**
148
153
  * Internal utility functions
@@ -161,404 +166,252 @@ class AuthenticatorService {
161
166
  }
162
167
  /** @deprecated For internal use only */
163
168
  get slotContext() {
164
- const slotContext = Object.assign(Object.assign({}, this._facade), this._sendEventAliases);
165
- return Object.assign(Object.assign({}, slotContext), { $implicit: Object.assign({}, slotContext) });
169
+ return Object.assign(Object.assign({}, this._facade), { $implicit: this._facade });
166
170
  }
167
- /** @deprecated For internal use only */
168
171
  subscribe(callback) {
169
- if (this._authService) {
170
- return this._authService.subscribe(callback);
171
- }
172
- else {
173
- logger$2.error('Subscription attempted before machine was created. This is likely a bug on the library, please consider filing a bug.');
172
+ if (!this._authService) {
173
+ logger$1.error('Subscription attempted before machine was created. This is likely a bug on the library, please consider filing a bug.');
174
174
  }
175
+ const subscription = this._authService.subscribe(() => {
176
+ callback(this._facade);
177
+ });
178
+ return subscription;
175
179
  }
176
180
  /** @deprecated For internal use only */
177
181
  send(event) {
178
182
  this.authService.send(event);
179
183
  }
180
184
  }
181
- AuthenticatorService.ɵprov = i0.ɵɵdefineInjectable({ factory: function AuthenticatorService_Factory() { return new AuthenticatorService(); }, token: AuthenticatorService, providedIn: "root" });
182
- AuthenticatorService.decorators = [
183
- { type: Injectable, args: [{
184
- providedIn: 'root',
185
- },] }
186
- ];
187
- AuthenticatorService.ctorParameters = () => [];
185
+ AuthenticatorService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: AuthenticatorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
186
+ AuthenticatorService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: AuthenticatorService, providedIn: 'root' });
187
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: AuthenticatorService, decorators: [{
188
+ type: Injectable,
189
+ args: [{
190
+ providedIn: 'root', // ensure we have a singleton service
191
+ }]
192
+ }], ctorParameters: function () { return []; } });
188
193
 
189
- class AuthenticatorComponent {
190
- constructor(authenticator, contextService, changeDetector) {
191
- this.authenticator = authenticator;
192
- this.contextService = contextService;
193
- this.changeDetector = changeDetector;
194
- this.customComponentQuery = null;
195
- // translated texts
196
- this.signInTitle = translate('Sign In');
197
- this.signUpTitle = translate('Create Account');
198
- this.hasInitialized = false;
199
- this.isHandlingHubEvent = false;
200
- }
201
- ngOnInit() {
202
- const { initialState, loginMechanisms, services, signUpAttributes, socialProviders, formFields, } = this;
203
- const { authService, initializeMachine } = this.authenticator;
204
- this.unsubscribeHub = listenToAuthHub(authService, (data, service) => {
205
- defaultAuthHubHandler(data, service);
206
- /**
207
- * Hub events aren't properly caught by Angular, because they are
208
- * synchronous events. Angular tracks async network events and
209
- * html events, but not synchronous events like hub.
210
- *
211
- * On any notable hub events, we run change detection manually.
212
- */
213
- this.changeDetector.detectChanges();
214
- /**
215
- * Hub events that we handle can lead to multiple state changes:
216
- * e.g. `authenticated` -> `signOut` -> initialState.
217
- *
218
- * We want to ensure change detection runs all the way, until
219
- * we reach back to the initial state. Setting the below flag
220
- * to true to until we reach initial state.
221
- */
222
- this.isHandlingHubEvent = true;
223
- });
224
- /**
225
- * Subscribes to state machine changes and sends INIT event
226
- * once machine reaches 'setup' state.
227
- */
228
- this.unsubscribeMachine = this.authenticator.subscribe(() => {
229
- const { route } = this.authenticator;
230
- if (this.isHandlingHubEvent) {
231
- this.changeDetector.detectChanges();
232
- const initialStateWithDefault = initialState !== null && initialState !== void 0 ? initialState : 'signIn';
233
- // We can stop manual change detection if we're back to the initial state
234
- if (route === initialStateWithDefault) {
235
- this.isHandlingHubEvent = false;
236
- }
237
- }
238
- if (!this.hasInitialized && route === 'setup') {
239
- initializeMachine({
240
- initialState,
241
- loginMechanisms,
242
- services,
243
- signUpAttributes,
244
- socialProviders,
245
- formFields,
246
- });
247
- this.hasInitialized = true;
248
- }
249
- }).unsubscribe;
250
- /**
251
- * handling translations after content init, because authenticator and its
252
- * translations might be initialized before the main app's `ngOnInit` is run.
253
- */
254
- this.signInTitle = translate('Sign In');
255
- this.signUpTitle = translate('Create Account');
194
+ class AmplifySlotComponent {
195
+ constructor(propService) {
196
+ this.propService = propService;
197
+ this.display = 'contents';
198
+ this.isOverriden = false;
256
199
  }
257
- /**
258
- * Lifecycle Methods
259
- */
260
200
  ngAfterContentInit() {
261
- this.contextService.customComponents = this.mapCustomComponents(this.customComponentQuery);
262
- }
263
- ngOnDestroy() {
264
- if (this.unsubscribeMachine)
265
- this.unsubscribeMachine();
266
- if (this.unsubscribeHub)
267
- this.unsubscribeHub();
268
- }
269
- /**
270
- * Class Functions
271
- */
272
- // context passed to "authenticated" slot
273
- get context() {
274
- return this.authenticator.slotContext;
275
- }
276
- get route() {
277
- return this.authenticator.route;
278
- }
279
- onTabChange() {
280
- const route = this.authenticator.route;
281
- if (route === 'signIn') {
282
- this.authenticator.toSignUp();
283
- }
284
- else {
285
- this.authenticator.toSignIn();
201
+ const customComponents = this.propService.customComponents;
202
+ const overridingComponent = customComponents[this.name];
203
+ if (overridingComponent) {
204
+ this.overridingComponent = overridingComponent;
205
+ this.isOverriden = true;
286
206
  }
287
207
  }
288
- hasTabs() {
289
- const { route } = this.authenticator;
290
- return route === 'signIn' || route === 'signUp';
208
+ }
209
+ AmplifySlotComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: AmplifySlotComponent, deps: [{ token: CustomComponentsService }], target: i0.ɵɵFactoryTarget.Component });
210
+ AmplifySlotComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: AmplifySlotComponent, selector: "amplify-slot", inputs: { name: "name", context: "context" }, host: { properties: { "style.display": "this.display" } }, ngImport: i0, template: "<!-- \n if slot isn't overwritten, we display the the default coponent, which is the \n children passed onto this component.\n-->\n<ng-content *ngIf=\"!isOverriden\"></ng-content>\n\n<!-- If slot is overwritten, we render that instead. -->\n<ng-container\n *ngIf=\"isOverriden\"\n [ngTemplateOutlet]=\"overridingComponent\"\n [ngTemplateOutletContext]=\"context\"\n></ng-container>\n", directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
211
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: AmplifySlotComponent, decorators: [{
212
+ type: Component,
213
+ args: [{
214
+ selector: 'amplify-slot',
215
+ templateUrl: './amplify-slot.component.html',
216
+ }]
217
+ }], ctorParameters: function () { return [{ type: CustomComponentsService }]; }, propDecorators: { name: [{
218
+ type: Input
219
+ }], context: [{
220
+ type: Input
221
+ }], display: [{
222
+ type: HostBinding,
223
+ args: ['style.display']
224
+ }] } });
225
+
226
+ class TabItemComponent {
227
+ constructor() {
228
+ this.active = false;
229
+ this.display = 'block'; // emulate div behavior
291
230
  }
292
- hasRouteComponent() {
293
- const { route } = this.authenticator;
294
- switch (route) {
295
- case 'authenticated':
296
- case 'idle':
297
- case 'setup':
298
- case 'signOut':
299
- case 'autoSignIn':
300
- return false;
301
- default:
302
- return true;
231
+ }
232
+ TabItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TabItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
233
+ TabItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: TabItemComponent, selector: "amplify-tab-item", inputs: { title: "title", active: "active", id: "id", labelledById: "labelledById", tabIndex: "tabIndex" }, host: { properties: { "style.display": "this.display" } }, ngImport: i0, template: "<div\n data-orientation=\"horizontal\"\n role=\"tabpanel\"\n [id]=\"id\"\n [attr.aria-labelledby]=\"labelledById\"\n [attr.data-state]=\"active ? 'active' : 'inactive'\"\n [attr.tabindex]=\"tabIndex\"\n>\n <ng-content *ngIf=\"active\"></ng-content>\n</div>\n", directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
234
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TabItemComponent, decorators: [{
235
+ type: Component,
236
+ args: [{
237
+ selector: 'amplify-tab-item',
238
+ templateUrl: './tab-item.component.html',
239
+ }]
240
+ }], propDecorators: { title: [{
241
+ type: Input
242
+ }], active: [{
243
+ type: Input
244
+ }], id: [{
245
+ type: Input
246
+ }], labelledById: [{
247
+ type: Input
248
+ }], tabIndex: [{
249
+ type: Input
250
+ }], display: [{
251
+ type: HostBinding,
252
+ args: ['style.display']
253
+ }] } });
254
+
255
+ class TabsComponent {
256
+ constructor() {
257
+ this.tabChange = new EventEmitter();
258
+ }
259
+ ngAfterContentInit() {
260
+ // assign ids
261
+ this.tabs.forEach((tab, index) => {
262
+ tab.id = `radix-id-${nanoid(12)}-1-content-${index}`;
263
+ tab.labelledById = `radix-id-${nanoid(12)}-1-trigger-${index}`;
264
+ });
265
+ // find active tab
266
+ // TODO(enhancement): more declarative way for choosing the initial tab to render
267
+ const activeTabs = this.tabs.filter((tab) => tab.active);
268
+ // set active tab
269
+ if (activeTabs.length !== 1) {
270
+ this.selectTab(this.tabs.first);
303
271
  }
304
272
  }
305
- mapCustomComponents(componentQuery) {
306
- if (!componentQuery)
307
- return {};
308
- const customComponents = {};
309
- componentQuery.forEach((component) => {
310
- customComponents[component.name] = component.template;
273
+ selectTab(tab) {
274
+ this.tabs.forEach((tab) => {
275
+ tab.active = false;
311
276
  });
312
- return customComponents;
277
+ tab.active = true;
278
+ }
279
+ handleTabClick(tab) {
280
+ if (tab.active)
281
+ return; // don't do anything if clicks the current active tab
282
+ this.tabChange.emit();
283
+ this.selectTab(tab);
313
284
  }
314
285
  }
315
- AuthenticatorComponent.decorators = [
316
- { type: Component, args: [{
317
- selector: 'amplify-authenticator',
318
- template: "<div\n data-amplify-authenticator\n [attr.data-variation]=\"variation\"\n *ngIf=\"hasRouteComponent()\"\n>\n <div data-amplify-container>\n <amplify-slot name=\"header\" [context]=\"context\"></amplify-slot>\n <div\n data-amplify-router\n [attr.data-amplify-router-content]=\"hasTabs() ? undefined : ''\"\n >\n <amplify-tabs\n (tabChange)=\"onTabChange()\"\n *ngIf=\"(route === 'signIn' || route === 'signUp') && !hideSignUp\"\n >\n <amplify-tab-item\n [title]=\"signInTitle\"\n [active]=\"route === 'signIn'\"\n data-amplify-router-content\n >\n <!-- signIn component -->\n <amplify-slot\n name=\"sign-in\"\n [context]=\"context\"\n *ngIf=\"route === 'signIn'\"\n >\n <amplify-sign-in></amplify-sign-in>\n </amplify-slot>\n </amplify-tab-item>\n <amplify-tab-item\n [title]=\"signUpTitle\"\n [active]=\"route === 'signUp'\"\n data-amplify-router-content\n >\n <!-- signUp component -->\n <amplify-slot\n name=\"sign-up\"\n [context]=\"context\"\n *ngIf=\"route === 'signUp'\"\n >\n <amplify-sign-up></amplify-sign-up>\n </amplify-slot>\n </amplify-tab-item>\n </amplify-tabs>\n\n <amplify-slot\n name=\"sign-in\"\n [context]=\"context\"\n *ngIf=\"route === 'signIn' && hideSignUp\"\n >\n <amplify-sign-in></amplify-sign-in>\n </amplify-slot>\n\n <!-- confirmSignUp content -->\n <amplify-slot\n name=\"confirm-sign-up\"\n [context]=\"context\"\n *ngIf=\"route === 'confirmSignUp'\"\n >\n <amplify-confirm-sign-up></amplify-confirm-sign-up>\n </amplify-slot>\n\n <!-- confirmSignIn content -->\n <amplify-slot\n name=\"confirm-sign-in\"\n [context]=\"context\"\n *ngIf=\"route === 'confirmSignIn'\"\n >\n <amplify-confirm-sign-in></amplify-confirm-sign-in>\n </amplify-slot>\n\n <!-- setupTotp content -->\n <amplify-slot\n name=\"setup-totp\"\n [context]=\"context\"\n *ngIf=\"route === 'setupTOTP'\"\n >\n <amplify-setup-totp></amplify-setup-totp>\n </amplify-slot>\n\n <!-- forceNewPassword content -->\n <amplify-slot\n name=\"force-new-password\"\n [context]=\"context\"\n *ngIf=\"route === 'forceNewPassword'\"\n >\n <amplify-force-new-password></amplify-force-new-password>\n </amplify-slot>\n\n <!-- resetPassword content -->\n <amplify-slot\n name=\"reset-password\"\n [context]=\"context\"\n *ngIf=\"route === 'resetPassword'\"\n >\n <amplify-reset-password></amplify-reset-password>\n </amplify-slot>\n\n <!-- confirmResetPassword content -->\n <amplify-slot\n name=\"confirm-reset-password\"\n [context]=\"context\"\n *ngIf=\"route === 'confirmResetPassword'\"\n >\n <amplify-confirm-reset-password></amplify-confirm-reset-password>\n </amplify-slot>\n\n <!-- verifyUser content -->\n <amplify-slot\n name=\"verify-user\"\n [context]=\"context\"\n *ngIf=\"route === 'verifyUser'\"\n >\n <amplify-verify-user></amplify-verify-user>\n </amplify-slot>\n\n <!-- confirmVerifyUser content -->\n <amplify-slot\n name=\"confirm-verify-user\"\n [context]=\"context\"\n *ngIf=\"route === 'confirmVerifyUser'\"\n >\n <amplify-confirm-verify-user></amplify-confirm-verify-user>\n </amplify-slot>\n </div>\n\n <amplify-slot name=\"footer\" [context]=\"context\"></amplify-slot>\n </div>\n</div>\n\n<!-- signedIn content is rendered outside authenticator so it's not styled by authenticator -->\n<amplify-slot\n name=\"authenticated\"\n [context]=\"context\"\n *ngIf=\"route === 'authenticated'\"\n>\n <ng-content></ng-content>\n</amplify-slot>\n",
319
- providers: [CustomComponentsService],
320
- encapsulation: ViewEncapsulation.None
321
- },] }
322
- ];
323
- AuthenticatorComponent.ctorParameters = () => [
324
- { type: AuthenticatorService },
325
- { type: CustomComponentsService },
326
- { type: ChangeDetectorRef }
327
- ];
328
- AuthenticatorComponent.propDecorators = {
329
- formFields: [{ type: Input }],
330
- initialState: [{ type: Input }],
331
- loginMechanisms: [{ type: Input }],
332
- services: [{ type: Input }],
333
- signUpAttributes: [{ type: Input }],
334
- socialProviders: [{ type: Input }],
335
- variation: [{ type: Input }],
336
- hideSignUp: [{ type: Input }],
337
- customComponentQuery: [{ type: ContentChildren, args: [AmplifySlotDirective,] }]
338
- };
286
+ TabsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TabsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
287
+ TabsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: TabsComponent, selector: "amplify-tabs", outputs: { tabChange: "tabChange" }, queries: [{ propertyName: "tabs", predicate: TabItemComponent }], ngImport: i0, template: "<div\n tabindex=\"0\"\n aria-orientation=\"horizontal\"\n data-orientation=\"horizontal\"\n role=\"tablist\"\n style=\"outline: none\"\n>\n <div\n class=\"amplify-flex amplify-tabs\"\n data-indicator-position=\"top\"\n style=\"gap: 0px; justify-content: center\"\n >\n <div\n *ngFor=\"let tab of tabs\"\n class=\"amplify-tabs-item\"\n data-spacing=\"equal\"\n data-orientation=\"horizontal\"\n role=\"tab\"\n [id]=\"tab.labelledById\"\n [tabindex]=\"tab.active ? '0' : '1'\"\n [attr.aria-selected]=\"tab.active\"\n [attr.aria-controls]=\"tab.id\"\n [attr.data-state]=\"tab.active ? 'active' : 'inactive'\"\n (click)=\"handleTabClick(tab)\"\n >\n {{ tab.title }}\n </div>\n </div>\n</div>\n\n<ng-content></ng-content>\n", directives: [{ type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
288
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TabsComponent, decorators: [{
289
+ type: Component,
290
+ args: [{
291
+ selector: 'amplify-tabs',
292
+ templateUrl: './tabs.component.html',
293
+ }]
294
+ }], propDecorators: { tabs: [{
295
+ type: ContentChildren,
296
+ args: [TabItemComponent]
297
+ }], tabChange: [{
298
+ type: Output
299
+ }] } });
339
300
 
340
- class ConfirmResetPasswordComponent {
341
- constructor(authenticator) {
342
- this.authenticator = authenticator;
343
- this.dataAttr = '';
344
- this.headerText = translate('Reset your password');
345
- // translated strings
346
- this.backToSignInText = translate('Back to Sign In');
347
- this.resendCodeText = translate('Resend Code');
348
- /**
349
- * Support backwards compatibility for erroneous 'Send Code' text
350
- * See https://github.com/aws-amplify/amplify-ui/issues/1784
351
- * TODO: Remove support for 'Send Code' translation in next Major release
352
- */
353
- this.submitText = !hasTranslation('Send Code')
354
- ? translate('Submit')
355
- : translate('Send Code');
301
+ class ButtonComponent {
302
+ constructor() {
303
+ this.type = 'button';
304
+ this.fullWidth = false;
305
+ this.isDisabled = false;
306
+ this.size = 'medium';
307
+ this.variation = 'default';
308
+ this.fontWeight = 'normal';
356
309
  }
357
- get context() {
358
- return this.authenticator.slotContext;
310
+ get getDisabled() {
311
+ return this.isDisabled ? '' : null;
359
312
  }
360
- onInput(event) {
361
- event.preventDefault();
362
- const { name, value } = event.target;
363
- this.authenticator.updateForm({ name, value });
313
+ get classNames() {
314
+ let className = 'amplify-button';
315
+ if (this.variation) {
316
+ className += ` amplify-button--${this.variation}`;
317
+ }
318
+ if (this.size) {
319
+ className += ` amplify-button--${this.size}`;
320
+ }
321
+ if (this.fullWidth) {
322
+ className += ` amplify-button--fullwidth`;
323
+ }
324
+ if (this.isDisabled) {
325
+ className += ` amplify-button--disabled amplify-button--loading`;
326
+ }
327
+ return className;
364
328
  }
365
- onSubmit(event) {
366
- event.preventDefault();
367
- this.authenticator.submitForm(getFormDataFromEvent(event));
329
+ ngOnInit() {
330
+ this.typeAttr = this.type;
331
+ this.fullWidthAttr = this.fullWidth;
332
+ this.sizeAttr = this.size;
333
+ this.variationAttr = this.variation;
334
+ this.fontWeightAttr = this.fontWeight;
368
335
  }
369
336
  }
370
- ConfirmResetPasswordComponent.decorators = [
371
- { type: Component, args: [{
372
- selector: 'amplify-confirm-reset-password',
373
- template: "<form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex amplify-authenticator__column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-slot name=\"confirm-reset-password-header\" [context]=\"context\">\n <h3 class=\"amplify-heading amplify-heading--3\">{{ headerText }}</h3>\n </amplify-slot>\n\n <amplify-base-form-fields\n route=\"confirmResetPassword\"\n ></amplify-base-form-fields>\n\n <button\n amplify-button\n variation=\"primary\"\n fullWidth=\"true\"\n type=\"submit\"\n [isDisabled]=\"authenticator.isPending\"\n >\n {{ submitText }}\n </button>\n\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n type=\"button\"\n (click)=\"authenticator.resendCode()\"\n >\n {{ resendCodeText }}\n </button>\n\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n <amplify-slot name=\"confirm-reset-password-footer\" [context]=\"context\">\n </amplify-slot>\n</form>\n"
374
- },] }
375
- ];
376
- ConfirmResetPasswordComponent.ctorParameters = () => [
377
- { type: AuthenticatorService }
378
- ];
379
- ConfirmResetPasswordComponent.propDecorators = {
380
- dataAttr: [{ type: HostBinding, args: ['attr.data-amplify-authenticator-confirmsignin',] }],
381
- headerText: [{ type: Input }]
382
- };
337
+ ButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
338
+ ButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ButtonComponent, selector: "button[amplify-button]", inputs: { type: "type", fullWidth: "fullWidth", isDisabled: "isDisabled", size: "size", variation: "variation", fontWeight: "fontWeight" }, host: { properties: { "type": "this.typeAttr", "attr.data-fullwidth": "this.fullWidthAttr", "attr.data-size": "this.sizeAttr", "attr.data-variation": "this.variationAttr", "style.font-weight": "this.fontWeightAttr", "attr.disabled": "this.getDisabled", "class": "this.classNames" } }, ngImport: i0, template: "<ng-content></ng-content>\n" });
339
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ButtonComponent, decorators: [{
340
+ type: Component,
341
+ args: [{
342
+ selector: 'button[amplify-button]',
343
+ templateUrl: './button.component.html',
344
+ }]
345
+ }], propDecorators: { type: [{
346
+ type: Input
347
+ }], fullWidth: [{
348
+ type: Input
349
+ }], isDisabled: [{
350
+ type: Input
351
+ }], size: [{
352
+ type: Input
353
+ }], variation: [{
354
+ type: Input
355
+ }], fontWeight: [{
356
+ type: Input
357
+ }], typeAttr: [{
358
+ type: HostBinding,
359
+ args: ['type']
360
+ }], fullWidthAttr: [{
361
+ type: HostBinding,
362
+ args: ['attr.data-fullwidth']
363
+ }], sizeAttr: [{
364
+ type: HostBinding,
365
+ args: ['attr.data-size']
366
+ }], variationAttr: [{
367
+ type: HostBinding,
368
+ args: ['attr.data-variation']
369
+ }], fontWeightAttr: [{
370
+ type: HostBinding,
371
+ args: ['style.font-weight']
372
+ }], getDisabled: [{
373
+ type: HostBinding,
374
+ args: ['attr.disabled']
375
+ }], classNames: [{
376
+ type: HostBinding,
377
+ args: ['class']
378
+ }] } });
383
379
 
384
- const logger$1 = new Logger$1('ConfirmSignIn');
385
- class ConfirmSignInComponent {
380
+ class FederatedSignInButtonComponent {
386
381
  constructor(authenticator) {
387
382
  this.authenticator = authenticator;
388
- this.dataAttr = '';
389
- this.confirmText = translate('Confirm');
390
- this.backToSignInText = translate('Back to Sign In');
391
- }
392
- ngOnInit() {
393
- this.setHeaderText();
394
- }
395
- get context() {
396
- return this.authenticator.slotContext;
397
- }
398
- setHeaderText() {
399
- const state = this.authenticator.authState;
400
- const actorContext = getActorContext(state);
401
- const { challengeName } = actorContext;
402
- switch (challengeName) {
403
- case 'SOFTWARE_TOKEN_MFA':
404
- this.headerText = translate('Confirm TOTP Code');
405
- break;
406
- case 'SMS_MFA':
407
- this.headerText = translate('Confirm SMS Code');
408
- break;
409
- default:
410
- logger$1.error('Unexpected challengeName', challengeName);
411
- }
412
- }
413
- onInput(event) {
414
- event.preventDefault();
415
- const { name, value } = event.target;
416
- this.authenticator.updateForm({ name, value });
417
- }
418
- onSubmit(event) {
419
- event.preventDefault();
420
- this.authenticator.submitForm(getFormDataFromEvent(event));
383
+ this.onClick = () => {
384
+ this.authenticator.send({
385
+ type: 'FEDERATED_SIGN_IN',
386
+ data: { provider: this.provider },
387
+ });
388
+ };
421
389
  }
422
390
  }
423
- ConfirmSignInComponent.decorators = [
424
- { type: Component, args: [{
425
- selector: 'amplify-confirm-sign-in',
426
- template: "<form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex amplify-authenticator__column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-slot name=\"confirm-sign-in-header\" [context]=\"context\">\n <h3 class=\"amplify-heading amplify-heading--3\">{{ headerText }}</h3>\n </amplify-slot>\n <amplify-base-form-fields route=\"confirmSignIn\"></amplify-base-form-fields>\n\n <button\n amplify-button\n variation=\"primary\"\n fullWidth=\"true\"\n type=\"submit\"\n [isDisabled]=\"authenticator.isPending\"\n >\n {{ confirmText }}\n </button>\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"authenticator.toSignIn()\"\n >\n {{ backToSignInText }}\n </button>\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n <amplify-slot\n name=\"confirm-sign-in-footer\"\n [context]=\"context\"\n ></amplify-slot>\n</form>\n"
427
- },] }
428
- ];
429
- ConfirmSignInComponent.ctorParameters = () => [
430
- { type: AuthenticatorService }
431
- ];
432
- ConfirmSignInComponent.propDecorators = {
433
- dataAttr: [{ type: HostBinding, args: ['attr.data-amplify-authenticator-confirmsignin',] }]
434
- };
391
+ FederatedSignInButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FederatedSignInButtonComponent, deps: [{ token: AuthenticatorService }], target: i0.ɵɵFactoryTarget.Component });
392
+ FederatedSignInButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FederatedSignInButtonComponent, selector: "amplify-federated-sign-in-button", inputs: { provider: "provider", text: "text" }, ngImport: i0, template: "<button\n amplify-button\n class=\"amplify-field-group__control federated-sign-in-button\"\n fullWidth=\"true\"\n fontWeight=\"normal\"\n (click)=\"onClick()\"\n>\n <div class=\"amplify-flex federated-sign-in-button-row\">\n <ng-content></ng-content>\n </div>\n</button>\n", components: [{ type: ButtonComponent, selector: "button[amplify-button]", inputs: ["type", "fullWidth", "isDisabled", "size", "variation", "fontWeight"] }] });
393
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FederatedSignInButtonComponent, decorators: [{
394
+ type: Component,
395
+ args: [{
396
+ selector: 'amplify-federated-sign-in-button',
397
+ templateUrl: './federated-sign-in-button.component.html',
398
+ }]
399
+ }], ctorParameters: function () { return [{ type: AuthenticatorService }]; }, propDecorators: { provider: [{
400
+ type: Input
401
+ }], text: [{
402
+ type: Input
403
+ }] } });
435
404
 
436
- class ConfirmSignUpComponent {
405
+ const { getSignInWithFederationText } = authenticatorTextUtil;
406
+ class FederatedSignInComponent {
437
407
  constructor(authenticator) {
438
408
  this.authenticator = authenticator;
439
- this.headerText = translate('Confirm Sign Up');
440
- this.dataAttr = '';
441
- // translated texts
442
- this.resendCodeText = translate('Resend Code');
443
- this.confirmText = translate('Confirm');
444
- this.emailMessage = translate('Your code is on the way. To log in, enter the code we emailed to');
445
- this.textedMessage = translate('Your code is on the way. To log in, enter the code we texted to');
446
- this.defaultMessage = translate('Your code is on the way. To log in, enter the code we sent you. It may take a minute to arrive.');
447
- this.minutesMessage = translate('It may take a minute to arrive.');
448
- }
449
- get context() {
450
- return this.authenticator.slotContext;
451
- }
452
- get confirmSignUpHeading() {
453
- const { codeDeliveryDetails: { DeliveryMedium } = {} } = this.authenticator;
454
- return DeliveryMedium === 'EMAIL'
455
- ? translate('We Emailed You')
456
- : DeliveryMedium === 'SMS'
457
- ? translate('We Texted You')
458
- : translate('We Sent A Code');
459
- }
460
- get subtitleText() {
461
- const { codeDeliveryDetails: { DeliveryMedium, Destination } = {} } = this.authenticator;
462
- return DeliveryMedium === 'EMAIL'
463
- ? `${this.emailMessage} ${Destination}. ${this.minutesMessage}`
464
- : DeliveryMedium === 'SMS'
465
- ? `${this.textedMessage} ${Destination}. ${this.minutesMessage}`
466
- : translate(`${this.defaultMessage}`);
467
- }
468
- onInput(event) {
469
- event.preventDefault();
470
- const { name, value } = event.target;
471
- this.authenticator.updateForm({ name, value });
472
- }
473
- onSubmit(event) {
474
- event.preventDefault();
475
- this.authenticator.submitForm(getFormDataFromEvent(event));
476
- }
477
- }
478
- ConfirmSignUpComponent.decorators = [
479
- { type: Component, args: [{
480
- selector: 'amplify-confirm-sign-up',
481
- template: "<ng-container>\n <form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex amplify-authenticator__column\"\n data-amplify-fieldset\n [disabled]=\"context.isPending\"\n >\n <amplify-slot name=\"confirm-sign-up-header\" [context]=\"context\">\n <h3\n class=\"amplify-heading amplify-authenticator__heading\"\n style=\"font-size: 1.5rem\"\n >\n {{ confirmSignUpHeading }}\n </h3>\n </amplify-slot>\n <span class=\"amplify-authenticator__subtitle\">\n {{ subtitleText }}\n </span>\n <amplify-base-form-fields\n route=\"confirmSignUp\"\n ></amplify-base-form-fields>\n\n <button\n amplify-button\n variation=\"primary\"\n fullWidth=\"true\"\n type=\"submit\"\n [isDisabled]=\"authenticator.isPending\"\n >\n {{ confirmText }}\n </button>\n <button\n amplify-button\n fontWeight=\"normal\"\n (click)=\"authenticator.resendCode()\"\n >\n {{ resendCodeText }}\n </button>\n </fieldset>\n\n <amplify-error *ngIf=\"context.error\">\n {{ authenticator.error }}\n </amplify-error>\n <amplify-slot\n name=\"confirm-sign-up-footer\"\n [context]=\"context\"\n ></amplify-slot>\n </form>\n</ng-container>\n"
482
- },] }
483
- ];
484
- ConfirmSignUpComponent.ctorParameters = () => [
485
- { type: AuthenticatorService }
486
- ];
487
- ConfirmSignUpComponent.propDecorators = {
488
- headerText: [{ type: Input }],
489
- dataAttr: [{ type: HostBinding, args: ['attr.data-amplify-authenticator-confirmsignup',] }]
490
- };
491
-
492
- class ConfirmVerifyUserComponent {
493
- constructor(authenticator) {
494
- this.authenticator = authenticator;
495
- this.dataAttr = '';
496
- this.headerText = translate('Account recovery requires verified contact information');
497
- // translated texts
498
- this.skipText = translate('Skip');
499
- this.submitText = translate('Submit');
500
- }
501
- get context() {
502
- return this.authenticator.slotContext;
503
- }
504
- onInput(event) {
505
- event.preventDefault();
506
- const { name, value } = event.target;
507
- this.authenticator.updateForm({ name, value });
508
- }
509
- onSubmit(event) {
510
- event.preventDefault();
511
- this.authenticator.submitForm(getFormDataFromEvent(event));
512
- }
513
- }
514
- ConfirmVerifyUserComponent.decorators = [
515
- { type: Component, args: [{
516
- selector: 'amplify-confirm-verify-user',
517
- template: "<form data-amplify-form (input)=\"onInput($event)\" (submit)=\"onSubmit($event)\">\n <fieldset\n class=\"amplify-flex amplify-authenticator__column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-slot name=\"confirm-verify-user-header\" [context]=\"context\">\n <h3 class=\"amplify-heading amplify-heading--3\">{{ this.headerText }}</h3>\n </amplify-slot>\n <amplify-base-form-fields\n route=\"confirmVerifyUser\"\n ></amplify-base-form-fields>\n <button\n amplify-button\n variation=\"primary\"\n fullWidth=\"true\"\n type=\"submit\"\n [isDisabled]=\"authenticator.isPending\"\n >\n {{ submitText }}\n </button>\n\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"authenticator.skipVerification()\"\n >\n {{ skipText }}\n </button>\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n <amplify-slot name=\"confirm-verify-user-footer\" [context]=\"context\">\n </amplify-slot>\n</form>\n"
518
- },] }
519
- ];
520
- ConfirmVerifyUserComponent.ctorParameters = () => [
521
- { type: AuthenticatorService }
522
- ];
523
- ConfirmVerifyUserComponent.propDecorators = {
524
- dataAttr: [{ type: HostBinding, args: ['attr.data-amplify-authenticator-confirmverifyuser',] }],
525
- headerText: [{ type: Input }]
526
- };
527
-
528
- class FederatedSignInButtonComponent {
529
- constructor(authenticator) {
530
- this.authenticator = authenticator;
531
- this.onClick = () => {
532
- this.authenticator.send({
533
- type: 'FEDERATED_SIGN_IN',
534
- data: { provider: this.provider },
535
- });
536
- };
537
- }
538
- }
539
- FederatedSignInButtonComponent.decorators = [
540
- { type: Component, args: [{
541
- selector: 'amplify-federated-sign-in-button',
542
- template: "<button\n amplify-button\n class=\"amplify-field-group__control federated-sign-in-button\"\n fullWidth=\"true\"\n fontWeight=\"normal\"\n (click)=\"onClick()\"\n>\n <div class=\"amplify-flex federated-sign-in-button-row\">\n <ng-content></ng-content>\n </div>\n</button>\n"
543
- },] }
544
- ];
545
- FederatedSignInButtonComponent.ctorParameters = () => [
546
- { type: AuthenticatorService }
547
- ];
548
- FederatedSignInButtonComponent.propDecorators = {
549
- provider: [{ type: Input }],
550
- text: [{ type: Input }]
551
- };
552
-
553
- class FederatedSignInComponent {
554
- constructor(authenticator) {
555
- this.authenticator = authenticator;
556
- this.FederatedProviders = FederatedIdentityProviders;
557
- this.includeAmazon = false;
558
- this.includeApple = false;
559
- this.includeFacebook = false;
560
- this.includeGoogle = false;
561
- this.shouldShowFederatedSignIn = false;
409
+ this.FederatedProviders = FederatedIdentityProviders;
410
+ this.includeAmazon = false;
411
+ this.includeApple = false;
412
+ this.includeFacebook = false;
413
+ this.includeGoogle = false;
414
+ this.shouldShowFederatedSignIn = false;
562
415
  }
563
416
  ngOnInit() {
564
417
  var _a;
@@ -576,67 +429,211 @@ class FederatedSignInComponent {
576
429
  }
577
430
  setFederatedTexts() {
578
431
  const { route } = this.authenticator;
579
- const federatedText = route === 'signUp' ? 'Up' : 'In';
580
- this.signInAmazonText = translate(`Sign ${federatedText} with Amazon`);
581
- this.signInAppleText = translate(`Sign ${federatedText} with Apple`);
582
- this.signInFacebookText = translate(`Sign ${federatedText} with Facebook`);
583
- this.signInGoogleText = translate(`Sign ${federatedText} with Google`);
432
+ this.signInAmazonText = getSignInWithFederationText(route, 'amazon');
433
+ this.signInAppleText = getSignInWithFederationText(route, 'apple');
434
+ this.signInFacebookText = getSignInWithFederationText(route, 'facebook');
435
+ this.signInGoogleText = getSignInWithFederationText(route, 'google');
584
436
  }
585
437
  }
586
- FederatedSignInComponent.decorators = [
587
- { type: Component, args: [{
588
- selector: 'amplify-federated-sign-in',
589
- template: "<div\n class=\"amplify-flex federated-sign-in-container\"\n *ngIf=\"shouldShowFederatedSignIn\"\n data-orientation=\"horizontal\"\n data-size=\"small\"\n>\n <amplify-federated-sign-in-button\n *ngIf=\"includeAmazon\"\n [text]=\"signInAmazonText\"\n [provider]=\"FederatedProviders.Amazon\"\n >\n <svg\n aria-label=\"Amazon icon\"\n class=\"amplify-icon federated-sign-in-icon\"\n viewBox=\"0 0 248 268\"\n >\n <path\n d=\"M139.056521,147.024612 C133.548808,156.744524 124.782731,162.726926 115.087401,162.726926 C101.790721,162.726926 93.9937779,152.612964 93.9937779,137.68681 C93.9937779,108.224571 120.447551,102.879017 145.533369,102.879017 L145.533369,110.365976 C145.533369,123.831358 145.876354,135.063787 139.056521,147.024612 M207.206992,162.579655 C209.400505,165.692256 209.887066,169.437725 207.063416,171.770186 C199.996315,177.653081 187.429476,188.590967 180.513926,194.716661 L180.46208,194.621133 C178.176838,196.663031 174.862638,196.810303 172.27828,195.445057 C160.780281,185.9162 158.686473,181.494078 152.405048,172.403055 C133.405233,191.751331 119.909143,197.534719 95.309886,197.534719 C66.1281801,197.534719 43.4791563,179.599451 43.4791563,143.669212 C43.4791563,115.616003 58.6782107,96.5105248 80.4019706,87.1727225 C99.2063636,78.9096034 125.464714,77.4528107 145.533369,75.1641337 L145.533369,70.694248 C145.533369,62.4749122 146.167493,52.7510201 141.297893,45.6541312 C137.110277,39.2856386 129.018206,36.6586354 121.859376,36.6586354 C108.658413,36.6586354 96.9171331,43.4171982 94.0416364,57.4199213 C93.4593582,60.532522 91.1701278,63.5933787 88.003492,63.7406501 L54.4387473,60.1424518 C51.6150972,59.5095829 48.4484614,57.2248862 49.2740201,52.8982915 C56.9712583,12.2553679 93.7983558,0 126.732964,0 C143.587124,0 165.606011,4.47386604 178.902691,17.2148315 C195.760839,32.917146 194.149604,53.8694866 194.149604,76.6726704 L194.149604,130.542157 C194.149604,146.734049 200.87372,153.830938 207.206992,162.579655 Z M233.826346,208.038962 C230.467669,203.683255 211.550709,205.9821 203.056405,206.998432 C200.470662,207.321077 200.076227,205.042397 202.406981,203.404973 C217.475208,192.664928 242.201125,195.766353 245.081698,199.363845 C247.966255,202.981502 244.336653,228.071183 230.172839,240.049379 C228.001452,241.888455 225.929671,240.904388 226.89783,238.468418 C230.077218,230.430525 237.204944,212.418868 233.826346,208.038962 Z M126.768855,264 C74.0234043,264 42.0764048,241.955028 17.7852554,217.541992 C12.9733903,212.705982 6.71799208,206.295994 3.31151296,200.690918 C1.90227474,198.372135 5.59096074,195.021875 8.0442063,196.84375 C38.2390146,219.267578 82.1011654,239.538304 125.529506,239.538304 C154.819967,239.538304 191.046475,227.469543 220.66851,214.867659 C225.146771,212.966167 225.146771,219.180222 224.511585,221.060516 C224.183264,222.03242 209.514625,236.221149 189.247207,247.047411 C170.304273,257.166172 146.397132,264 126.768855,264 Z\"\n fill=\"#FF9900\"\n ></path>\n </svg>\n\n <p class=\"amplify-text amplify-authenticator__federated-text\">\n {{ signInAmazonText }}\n </p>\n </amplify-federated-sign-in-button>\n\n <amplify-federated-sign-in-button\n *ngIf=\"includeApple\"\n [provider]=\"FederatedProviders.Apple\"\n >\n <svg\n aria-label=\"Apple icon\"\n class=\"amplify-icon federated-sign-in-icon\"\n fill=\"#000\"\n preserveAspectRatio=\"xMidYMid\"\n stroke=\"#000\"\n strokeWidth=\"0\"\n viewBox=\"0 0 1024 1024\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M747.4 535.7c-.4-68.2 30.5-119.6 92.9-157.5-34.9-50-87.7-77.5-157.3-82.8-65.9-5.2-138 38.4-164.4 38.4-27.9 0-91.7-36.6-141.9-36.6C273.1 298.8 163 379.8 163 544.6c0 48.7 8.9 99 26.7 150.8 23.8 68.2 109.6 235.3 199.1 232.6 46.8-1.1 79.9-33.2 140.8-33.2 59.1 0 89.7 33.2 141.9 33.2 90.3-1.3 167.9-153.2 190.5-221.6-121.1-57.1-114.6-167.2-114.6-170.7zm-105.1-305c50.7-60.2 46.1-115 44.6-134.7-44.8 2.6-96.6 30.5-126.1 64.8-32.5 36.8-51.6 82.3-47.5 133.6 48.4 3.7 92.6-21.2 129-63.7z\"\n ></path>\n </svg>\n <p class=\"amplify-text amplify-authenticator__federated-text\">\n {{ signInAppleText }}\n </p>\n </amplify-federated-sign-in-button>\n\n <amplify-federated-sign-in-button\n *ngIf=\"includeFacebook\"\n [text]=\"signInFacebookText\"\n [provider]=\"FederatedProviders.Facebook\"\n >\n <svg\n aria-label=\"Facebook icon\"\n class=\"amplify-icon federated-sign-in-icon\"\n viewBox=\"0 0 279 538\"\n >\n <path\n d=\"M82.3409742,538 L82.3409742,292.936652 L0,292.936652 L0,196.990154 L82.2410458,196.990154 L82.2410458,126.4295 C82.2410458,44.575144 132.205229,0 205.252865,0 C240.227794,0 270.306232,2.59855099 279,3.79788222 L279,89.2502322 L228.536175,89.2502322 C188.964542,89.2502322 181.270057,108.139699 181.270057,135.824262 L181.270057,196.89021 L276.202006,196.89021 L263.810888,292.836708 L181.16913,292.836708 L181.16913,538 L82.3409742,538 Z\"\n fill=\"#1877F2\"\n ></path>\n </svg>\n <p class=\"amplify-text amplify-authenticator__federated-text\">\n {{ signInFacebookText }}\n </p>\n </amplify-federated-sign-in-button>\n\n <amplify-federated-sign-in-button\n *ngIf=\"includeGoogle\"\n [provider]=\"FederatedProviders.Google\"\n >\n <svg\n aria-label=\"Google icon\"\n class=\"amplify-icon federated-sign-in-icon\"\n viewBox=\"0 0 256 262\"\n xmlns=\"http://www.w3.org/2000/svg\"\n preserveAspectRatio=\"xMidYMid\"\n >\n <path\n d=\"M255.878 133.451c0-10.734-.871-18.567-2.756-26.69H130.55v48.448h71.947c-1.45 12.04-9.283 30.172-26.69 42.356l-.244 1.622 38.755 30.023 2.685.268c24.659-22.774 38.875-56.282 38.875-96.027\"\n fill=\"#4285F4\"\n ></path>\n <path\n d=\"M130.55 261.1c35.248 0 64.839-11.605 86.453-31.622l-41.196-31.913c-11.024 7.688-25.82 13.055-45.257 13.055-34.523 0-63.824-22.773-74.269-54.25l-1.531.13-40.298 31.187-.527 1.465C35.393 231.798 79.49 261.1 130.55 261.1\"\n fill=\"#34A853\"\n ></path>\n <path\n d=\"M56.281 156.37c-2.756-8.123-4.351-16.827-4.351-25.82 0-8.994 1.595-17.697 4.206-25.82l-.073-1.73L15.26 71.312l-1.335.635C5.077 89.644 0 109.517 0 130.55s5.077 40.905 13.925 58.602l42.356-32.782\"\n fill=\"#FBBC05\"\n ></path>\n <path\n d=\"M130.55 50.479c24.514 0 41.05 10.589 50.479 19.438l36.844-35.974C195.245 12.91 165.798 0 130.55 0 79.49 0 35.393 29.301 13.925 71.947l42.211 32.783c10.59-31.477 39.891-54.251 74.414-54.251\"\n fill=\"#EB4335\"\n ></path>\n </svg>\n <p class=\"amplify-text amplify-authenticator__federated-text\">\n {{ signInGoogleText }}\n </p>\n </amplify-federated-sign-in-button>\n\n <hr\n class=\"amplify-divider amplify-divider--label amplify-divider--small\"\n aria-orientation=\"horizontal\"\n data-size=\"small\"\n data-label=\"or\"\n />\n</div>\n"
590
- },] }
591
- ];
592
- FederatedSignInComponent.ctorParameters = () => [
593
- { type: AuthenticatorService }
594
- ];
438
+ FederatedSignInComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FederatedSignInComponent, deps: [{ token: AuthenticatorService }], target: i0.ɵɵFactoryTarget.Component });
439
+ FederatedSignInComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FederatedSignInComponent, selector: "amplify-federated-sign-in", ngImport: i0, template: "<div\n class=\"amplify-flex federated-sign-in-container\"\n *ngIf=\"shouldShowFederatedSignIn\"\n data-orientation=\"horizontal\"\n data-size=\"small\"\n>\n <amplify-federated-sign-in-button\n *ngIf=\"includeAmazon\"\n [text]=\"signInAmazonText\"\n [provider]=\"FederatedProviders.Amazon\"\n >\n <svg\n aria-label=\"Amazon icon\"\n class=\"amplify-icon federated-sign-in-icon\"\n viewBox=\"0 0 248 268\"\n >\n <path\n d=\"M139.056521,147.024612 C133.548808,156.744524 124.782731,162.726926 115.087401,162.726926 C101.790721,162.726926 93.9937779,152.612964 93.9937779,137.68681 C93.9937779,108.224571 120.447551,102.879017 145.533369,102.879017 L145.533369,110.365976 C145.533369,123.831358 145.876354,135.063787 139.056521,147.024612 M207.206992,162.579655 C209.400505,165.692256 209.887066,169.437725 207.063416,171.770186 C199.996315,177.653081 187.429476,188.590967 180.513926,194.716661 L180.46208,194.621133 C178.176838,196.663031 174.862638,196.810303 172.27828,195.445057 C160.780281,185.9162 158.686473,181.494078 152.405048,172.403055 C133.405233,191.751331 119.909143,197.534719 95.309886,197.534719 C66.1281801,197.534719 43.4791563,179.599451 43.4791563,143.669212 C43.4791563,115.616003 58.6782107,96.5105248 80.4019706,87.1727225 C99.2063636,78.9096034 125.464714,77.4528107 145.533369,75.1641337 L145.533369,70.694248 C145.533369,62.4749122 146.167493,52.7510201 141.297893,45.6541312 C137.110277,39.2856386 129.018206,36.6586354 121.859376,36.6586354 C108.658413,36.6586354 96.9171331,43.4171982 94.0416364,57.4199213 C93.4593582,60.532522 91.1701278,63.5933787 88.003492,63.7406501 L54.4387473,60.1424518 C51.6150972,59.5095829 48.4484614,57.2248862 49.2740201,52.8982915 C56.9712583,12.2553679 93.7983558,0 126.732964,0 C143.587124,0 165.606011,4.47386604 178.902691,17.2148315 C195.760839,32.917146 194.149604,53.8694866 194.149604,76.6726704 L194.149604,130.542157 C194.149604,146.734049 200.87372,153.830938 207.206992,162.579655 Z M233.826346,208.038962 C230.467669,203.683255 211.550709,205.9821 203.056405,206.998432 C200.470662,207.321077 200.076227,205.042397 202.406981,203.404973 C217.475208,192.664928 242.201125,195.766353 245.081698,199.363845 C247.966255,202.981502 244.336653,228.071183 230.172839,240.049379 C228.001452,241.888455 225.929671,240.904388 226.89783,238.468418 C230.077218,230.430525 237.204944,212.418868 233.826346,208.038962 Z M126.768855,264 C74.0234043,264 42.0764048,241.955028 17.7852554,217.541992 C12.9733903,212.705982 6.71799208,206.295994 3.31151296,200.690918 C1.90227474,198.372135 5.59096074,195.021875 8.0442063,196.84375 C38.2390146,219.267578 82.1011654,239.538304 125.529506,239.538304 C154.819967,239.538304 191.046475,227.469543 220.66851,214.867659 C225.146771,212.966167 225.146771,219.180222 224.511585,221.060516 C224.183264,222.03242 209.514625,236.221149 189.247207,247.047411 C170.304273,257.166172 146.397132,264 126.768855,264 Z\"\n fill=\"#FF9900\"\n ></path>\n </svg>\n\n <p class=\"amplify-text amplify-authenticator__federated-text\">\n {{ signInAmazonText }}\n </p>\n </amplify-federated-sign-in-button>\n\n <amplify-federated-sign-in-button\n *ngIf=\"includeApple\"\n [provider]=\"FederatedProviders.Apple\"\n >\n <svg\n aria-label=\"Apple icon\"\n class=\"amplify-icon federated-sign-in-icon\"\n fill=\"#000\"\n preserveAspectRatio=\"xMidYMid\"\n stroke=\"#000\"\n strokeWidth=\"0\"\n viewBox=\"0 0 1024 1024\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M747.4 535.7c-.4-68.2 30.5-119.6 92.9-157.5-34.9-50-87.7-77.5-157.3-82.8-65.9-5.2-138 38.4-164.4 38.4-27.9 0-91.7-36.6-141.9-36.6C273.1 298.8 163 379.8 163 544.6c0 48.7 8.9 99 26.7 150.8 23.8 68.2 109.6 235.3 199.1 232.6 46.8-1.1 79.9-33.2 140.8-33.2 59.1 0 89.7 33.2 141.9 33.2 90.3-1.3 167.9-153.2 190.5-221.6-121.1-57.1-114.6-167.2-114.6-170.7zm-105.1-305c50.7-60.2 46.1-115 44.6-134.7-44.8 2.6-96.6 30.5-126.1 64.8-32.5 36.8-51.6 82.3-47.5 133.6 48.4 3.7 92.6-21.2 129-63.7z\"\n ></path>\n </svg>\n <p class=\"amplify-text amplify-authenticator__federated-text\">\n {{ signInAppleText }}\n </p>\n </amplify-federated-sign-in-button>\n\n <amplify-federated-sign-in-button\n *ngIf=\"includeFacebook\"\n [text]=\"signInFacebookText\"\n [provider]=\"FederatedProviders.Facebook\"\n >\n <svg\n aria-label=\"Facebook icon\"\n class=\"amplify-icon federated-sign-in-icon\"\n viewBox=\"0 0 279 538\"\n >\n <path\n d=\"M82.3409742,538 L82.3409742,292.936652 L0,292.936652 L0,196.990154 L82.2410458,196.990154 L82.2410458,126.4295 C82.2410458,44.575144 132.205229,0 205.252865,0 C240.227794,0 270.306232,2.59855099 279,3.79788222 L279,89.2502322 L228.536175,89.2502322 C188.964542,89.2502322 181.270057,108.139699 181.270057,135.824262 L181.270057,196.89021 L276.202006,196.89021 L263.810888,292.836708 L181.16913,292.836708 L181.16913,538 L82.3409742,538 Z\"\n fill=\"#1877F2\"\n ></path>\n </svg>\n <p class=\"amplify-text amplify-authenticator__federated-text\">\n {{ signInFacebookText }}\n </p>\n </amplify-federated-sign-in-button>\n\n <amplify-federated-sign-in-button\n *ngIf=\"includeGoogle\"\n [provider]=\"FederatedProviders.Google\"\n >\n <svg\n aria-label=\"Google icon\"\n class=\"amplify-icon federated-sign-in-icon\"\n viewBox=\"0 0 256 262\"\n xmlns=\"http://www.w3.org/2000/svg\"\n preserveAspectRatio=\"xMidYMid\"\n >\n <path\n d=\"M255.878 133.451c0-10.734-.871-18.567-2.756-26.69H130.55v48.448h71.947c-1.45 12.04-9.283 30.172-26.69 42.356l-.244 1.622 38.755 30.023 2.685.268c24.659-22.774 38.875-56.282 38.875-96.027\"\n fill=\"#4285F4\"\n ></path>\n <path\n d=\"M130.55 261.1c35.248 0 64.839-11.605 86.453-31.622l-41.196-31.913c-11.024 7.688-25.82 13.055-45.257 13.055-34.523 0-63.824-22.773-74.269-54.25l-1.531.13-40.298 31.187-.527 1.465C35.393 231.798 79.49 261.1 130.55 261.1\"\n fill=\"#34A853\"\n ></path>\n <path\n d=\"M56.281 156.37c-2.756-8.123-4.351-16.827-4.351-25.82 0-8.994 1.595-17.697 4.206-25.82l-.073-1.73L15.26 71.312l-1.335.635C5.077 89.644 0 109.517 0 130.55s5.077 40.905 13.925 58.602l42.356-32.782\"\n fill=\"#FBBC05\"\n ></path>\n <path\n d=\"M130.55 50.479c24.514 0 41.05 10.589 50.479 19.438l36.844-35.974C195.245 12.91 165.798 0 130.55 0 79.49 0 35.393 29.301 13.925 71.947l42.211 32.783c10.59-31.477 39.891-54.251 74.414-54.251\"\n fill=\"#EB4335\"\n ></path>\n </svg>\n <p class=\"amplify-text amplify-authenticator__federated-text\">\n {{ signInGoogleText }}\n </p>\n </amplify-federated-sign-in-button>\n\n <hr\n class=\"amplify-divider amplify-divider--label amplify-divider--small\"\n aria-orientation=\"horizontal\"\n data-size=\"small\"\n data-label=\"or\"\n />\n</div>\n", components: [{ type: FederatedSignInButtonComponent, selector: "amplify-federated-sign-in-button", inputs: ["provider", "text"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
440
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FederatedSignInComponent, decorators: [{
441
+ type: Component,
442
+ args: [{
443
+ selector: 'amplify-federated-sign-in',
444
+ templateUrl: './federated-sign-in.component.html',
445
+ }]
446
+ }], ctorParameters: function () { return [{ type: AuthenticatorService }]; } });
595
447
 
596
- class ForceNewPasswordComponent {
597
- constructor(authenticator) {
598
- this.authenticator = authenticator;
599
- this.dataAttr = '';
600
- this.headerText = translate('Change Password');
601
- // translated texts
602
- this.changePasswordText = translate('Change Password');
603
- this.backToSignInText = translate('Back to Sign In');
448
+ class SelectComponent {
449
+ }
450
+ SelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
451
+ SelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SelectComponent, selector: "amplify-form-select", inputs: { items: "items", name: "name", label: "label", id: "id", defaultValue: "defaultValue" }, ngImport: i0, template: "<label class=\"amplify-label amplify-visually-hidden\" [for]=\"id\">{{\n label\n}}</label>\n<div class=\"amplify-select__wrapper\">\n <select\n class=\"amplify-select amplify-field-group__control\"\n autocomplete=\"tel-country-code\"\n [id]=\"id\"\n [name]=\"name\"\n >\n <option\n *ngFor=\"let item of items\"\n [value]=\"item\"\n [selected]=\"item === defaultValue\"\n >\n {{ item }}\n </option>\n </select>\n <div\n class=\"amplify-flex amplify-select__icon-wrapper\"\n style=\"align-items: center; justify-content: center\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"amplify-icon amplify-icon--large\"\n viewBox=\"0 0 24 24\"\n data-size=\"large\"\n fill=\"currentColor\"\n >\n <path d=\"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z\"></path>\n </svg>\n </div>\n</div>\n", directives: [{ type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
452
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SelectComponent, decorators: [{
453
+ type: Component,
454
+ args: [{
455
+ selector: 'amplify-form-select',
456
+ templateUrl: './select.component.html',
457
+ }]
458
+ }], propDecorators: { items: [{
459
+ type: Input
460
+ }], name: [{
461
+ type: Input
462
+ }], label: [{
463
+ type: Input
464
+ }], id: [{
465
+ type: Input
466
+ }], defaultValue: [{
467
+ type: Input
468
+ }] } });
469
+
470
+ class PhoneNumberFieldComponent {
471
+ constructor() {
472
+ this.autocomplete = 'new-password';
473
+ this.disabled = false;
474
+ this.selectFieldId = `amplify-field-${nanoid(12)}`;
475
+ this.textFieldId = `amplify-field-${nanoid(12)}`;
476
+ this.initialValue = '';
477
+ this.label = '';
478
+ this.placeholder = '';
479
+ this.required = true;
480
+ this.labelHidden = false;
481
+ this.display = 'contents';
604
482
  }
605
- get context() {
606
- return this.authenticator.slotContext;
483
+ ngOnInit() {
484
+ var _a;
485
+ this.countryDialCodesValues = (_a = this.dialCodeList) !== null && _a !== void 0 ? _a : countryDialCodes;
607
486
  }
608
- onInput(event) {
609
- event.preventDefault();
610
- const { name, value } = event.target;
611
- this.authenticator.updateForm({ name, value });
487
+ }
488
+ PhoneNumberFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PhoneNumberFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
489
+ PhoneNumberFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: PhoneNumberFieldComponent, selector: "amplify-phone-number-field", inputs: { autocomplete: "autocomplete", disabled: "disabled", defaultCountryCode: "defaultCountryCode", selectFieldId: "selectFieldId", textFieldId: "textFieldId", initialValue: "initialValue", label: "label", name: "name", placeholder: "placeholder", required: "required", type: "type", labelHidden: "labelHidden", dialCodeList: "dialCodeList", hasError: "hasError", describedBy: "describedBy" }, host: { properties: { "style.display": "this.display" } }, ngImport: i0, template: "<label\n class=\"amplify-label\"\n [class.amplify-visually-hidden]=\"labelHidden\"\n [for]=\"textFieldId\"\n>\n {{ label }}\n</label>\n<div\n class=\"amplify-flex amplify-phonenumberfield\"\n amplify-field-group\n style=\"gap: 0px\"\n>\n <div class=\"amplify-field-group__outer-start\">\n <div\n class=\"\n amplify-flex\n amplify-field\n amplify-selectfield\n amplify-countrycodeselect\n amplify-dialcodeselect\n \"\n style=\"flex-direction: column\"\n >\n <amplify-form-select\n name=\"country_code\"\n label=\"Country Code\"\n [id]=\"selectFieldId\"\n [items]=\"countryDialCodesValues\"\n [defaultValue]=\"defaultCountryCode\"\n ></amplify-form-select>\n </div>\n </div>\n\n <input\n class=\"amplify-input\"\n [id]=\"textFieldId\"\n [type]=\"type\"\n [name]=\"name\"\n [placeholder]=\"placeholder\"\n [required]=\"required\"\n [value]=\"initialValue\"\n [autocomplete]=\"autocomplete\"\n [attr.disabled]=\"disabled ? '' : null\"\n [attr.aria-invalid]=\"hasError ? 'true' : 'false'\"\n [attr.aria-describedby]=\"describedBy\"\n />\n</div>\n", components: [{ type: SelectComponent, selector: "amplify-form-select", inputs: ["items", "name", "label", "id", "defaultValue"] }] });
490
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PhoneNumberFieldComponent, decorators: [{
491
+ type: Component,
492
+ args: [{
493
+ selector: 'amplify-phone-number-field',
494
+ templateUrl: './phone-number-field.component.html',
495
+ }]
496
+ }], propDecorators: { autocomplete: [{
497
+ type: Input
498
+ }], disabled: [{
499
+ type: Input
500
+ }], defaultCountryCode: [{
501
+ type: Input
502
+ }], selectFieldId: [{
503
+ type: Input
504
+ }], textFieldId: [{
505
+ type: Input
506
+ }], initialValue: [{
507
+ type: Input
508
+ }], label: [{
509
+ type: Input
510
+ }], name: [{
511
+ type: Input
512
+ }], placeholder: [{
513
+ type: Input
514
+ }], required: [{
515
+ type: Input
516
+ }], type: [{
517
+ type: Input
518
+ }], labelHidden: [{
519
+ type: Input
520
+ }], dialCodeList: [{
521
+ type: Input
522
+ }], hasError: [{
523
+ type: Input
524
+ }], describedBy: [{
525
+ type: Input
526
+ }], display: [{
527
+ type: HostBinding,
528
+ args: ['style.display']
529
+ }] } });
530
+
531
+ class PasswordFieldComponent {
532
+ constructor() {
533
+ this.autocomplete = 'new-password';
534
+ this.disabled = false;
535
+ this.fieldId = `amplify-field-${nanoid(12)}`;
536
+ this.initialValue = '';
537
+ this.label = '';
538
+ this.placeholder = '';
539
+ this.required = true;
540
+ this.labelHidden = false;
541
+ this.setBlur = new EventEmitter();
542
+ this.type = 'password';
543
+ this.showPassword = false;
544
+ this.showPasswordButtonlabel = translate('Show password');
612
545
  }
613
- onSubmit(event) {
614
- event.preventDefault();
615
- this.authenticator.submitForm(getFormDataFromEvent(event));
546
+ togglePasswordText() {
547
+ this.showPassword = !this.showPassword;
548
+ this.showPasswordButtonlabel = this.showPassword
549
+ ? translate('Show password')
550
+ : translate('Hide password');
551
+ this.type = this.showPassword ? 'text' : 'password';
616
552
  }
617
553
  }
618
- ForceNewPasswordComponent.decorators = [
619
- { type: Component, args: [{
620
- selector: 'amplify-force-new-password',
621
- template: "<form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex amplify-authenticator__column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-slot name=\"force-new-password-header\" [context]=\"context\">\n <h3 class=\"amplify-heading amplify-heading--3\">{{ this.headerText }}</h3>\n </amplify-slot>\n\n <amplify-slot name=\"force-new-form-fields\" [context]=\"context\">\n <amplify-force-new-password-form-fields></amplify-force-new-password-form-fields>\n </amplify-slot>\n\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\n {{ changePasswordText }}\n </button>\n\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"authenticator.toSignIn()\"\n >\n {{ backToSignInText }}\n </button>\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n <amplify-slot name=\"force-new-password-footer\" [context]=\"context\">\n </amplify-slot>\n</form>\n"
622
- },] }
623
- ];
624
- ForceNewPasswordComponent.ctorParameters = () => [
625
- { type: AuthenticatorService }
626
- ];
627
- ForceNewPasswordComponent.propDecorators = {
628
- dataAttr: [{ type: HostBinding, args: ['attr.data-amplify-authenticator-forcenewpassword',] }],
629
- headerText: [{ type: Input }]
630
- };
554
+ PasswordFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PasswordFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
555
+ PasswordFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: PasswordFieldComponent, selector: "amplify-password-field", inputs: { autocomplete: "autocomplete", disabled: "disabled", fieldId: "fieldId", initialValue: "initialValue", label: "label", name: "name", placeholder: "placeholder", required: "required", labelHidden: "labelHidden", hasError: "hasError", describedBy: "describedBy" }, outputs: { setBlur: "setBlur" }, ngImport: i0, template: "<label\n class=\"amplify-label\"\n [class.amplify-visually-hidden]=\"labelHidden\"\n [for]=\"fieldId\"\n>\n {{ label }}\n</label>\n<div class=\"amplify-flex amplify-field-group\">\n <input\n class=\"amplify-input amplify-field-group__control\"\n [id]=\"fieldId\"\n [type]=\"type\"\n [name]=\"name\"\n [placeholder]=\"placeholder\"\n [required]=\"required\"\n [value]=\"initialValue\"\n [autocomplete]=\"autocomplete\"\n [attr.disabled]=\"disabled ? '' : null\"\n [attr.aria-invalid]=\"hasError ? 'true' : 'false'\"\n [attr.aria-describedby]=\"describedBy\"\n (blur)=\"setBlur.emit($event)\"\n />\n <div class=\"amplify-field-group__outer-end\">\n <button\n amplify-button\n [attr.aria-label]=\"showPasswordButtonlabel\"\n class=\"amplify-field-group__control amplify-field__show-password\"\n (click)=\"togglePasswordText()\"\n >\n <svg\n *ngIf=\"!showPassword\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n viewBox=\"0 0 24 24\"\n class=\"amplify-icon\"\n >\n <path\n d=\"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z\"\n ></path>\n </svg>\n <svg\n *ngIf=\"showPassword\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n viewBox=\"0 0 24 24\"\n class=\"amplify-icon\"\n >\n <path\n d=\"M0 0h24v24H0zm0 0h24v24H0zm0 0h24v24H0zm0 0h24v24H0z\"\n fill=\"none\"\n ></path>\n <path\n d=\"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z\"\n ></path>\n </svg>\n </button>\n </div>\n</div>\n", components: [{ type: ButtonComponent, selector: "button[amplify-button]", inputs: ["type", "fullWidth", "isDisabled", "size", "variation", "fontWeight"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
556
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PasswordFieldComponent, decorators: [{
557
+ type: Component,
558
+ args: [{
559
+ selector: 'amplify-password-field',
560
+ templateUrl: './password-field.component.html',
561
+ }]
562
+ }], propDecorators: { autocomplete: [{
563
+ type: Input
564
+ }], disabled: [{
565
+ type: Input
566
+ }], fieldId: [{
567
+ type: Input
568
+ }], initialValue: [{
569
+ type: Input
570
+ }], label: [{
571
+ type: Input
572
+ }], name: [{
573
+ type: Input
574
+ }], placeholder: [{
575
+ type: Input
576
+ }], required: [{
577
+ type: Input
578
+ }], labelHidden: [{
579
+ type: Input
580
+ }], hasError: [{
581
+ type: Input
582
+ }], describedBy: [{
583
+ type: Input
584
+ }], setBlur: [{
585
+ type: Output
586
+ }] } });
631
587
 
632
- class ForceNewPasswordFormFieldsComponent {
588
+ class TextFieldComponent {
589
+ constructor() {
590
+ this.autocomplete = 'new-password';
591
+ this.disabled = false;
592
+ this.fieldId = `amplify-field-${nanoid(12)}`;
593
+ this.initialValue = '';
594
+ this.label = '';
595
+ this.placeholder = '';
596
+ this.required = true;
597
+ this.labelHidden = false;
598
+ this.display = 'contents';
599
+ }
633
600
  }
634
- ForceNewPasswordFormFieldsComponent.decorators = [
635
- { type: Component, args: [{
636
- selector: 'amplify-force-new-password-form-fields',
637
- template: "<div class=\"amplify-flex amplify-authenticator__column\" data-amplify-fieldset>\n <amplify-base-form-fields route=\"forceNewPassword\"></amplify-base-form-fields>\n</div>\n"
638
- },] }
639
- ];
601
+ TextFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TextFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
602
+ TextFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: TextFieldComponent, selector: "amplify-text-field", inputs: { autocomplete: "autocomplete", disabled: "disabled", fieldId: "fieldId", initialValue: "initialValue", label: "label", name: "name", placeholder: "placeholder", required: "required", type: "type", labelHidden: "labelHidden", hasError: "hasError", describedBy: "describedBy" }, host: { properties: { "style.display": "this.display" } }, ngImport: i0, template: "<label\n class=\"amplify-label\"\n [class.amplify-visually-hidden]=\"labelHidden\"\n [for]=\"fieldId\"\n>\n {{ label }}\n</label>\n<input\n class=\"amplify-input\"\n [id]=\"fieldId\"\n [type]=\"type\"\n [name]=\"name\"\n [placeholder]=\"placeholder\"\n [required]=\"required\"\n [value]=\"initialValue\"\n [autocomplete]=\"autocomplete\"\n [attr.disabled]=\"disabled ? '' : null\"\n [attr.aria-invalid]=\"hasError ? 'true' : 'false'\"\n [attr.aria-describedby]=\"describedBy\"\n/>\n" });
603
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TextFieldComponent, decorators: [{
604
+ type: Component,
605
+ args: [{
606
+ selector: 'amplify-text-field',
607
+ templateUrl: './text-field.component.html',
608
+ }]
609
+ }], propDecorators: { autocomplete: [{
610
+ type: Input
611
+ }], disabled: [{
612
+ type: Input
613
+ }], fieldId: [{
614
+ type: Input
615
+ }], initialValue: [{
616
+ type: Input
617
+ }], label: [{
618
+ type: Input
619
+ }], name: [{
620
+ type: Input
621
+ }], placeholder: [{
622
+ type: Input
623
+ }], required: [{
624
+ type: Input
625
+ }], type: [{
626
+ type: Input
627
+ }], labelHidden: [{
628
+ type: Input
629
+ }], hasError: [{
630
+ type: Input
631
+ }], describedBy: [{
632
+ type: Input
633
+ }], display: [{
634
+ type: HostBinding,
635
+ args: ['style.display']
636
+ }] } });
640
637
 
641
638
  class FormFieldComponent {
642
639
  constructor(authenticator) {
@@ -669,32 +666,213 @@ class FormFieldComponent {
669
666
  return translate(phrase);
670
667
  }
671
668
  }
672
- FormFieldComponent.decorators = [
673
- { type: Component, args: [{
674
- selector: 'amplify-form-field',
675
- template: "<div class=\"amplify-flex amplify-field amplify-authenticator__column\">\n <!-- Country code field -->\n <amplify-phone-number-field\n *ngIf=\"isPhoneField()\"\n [name]=\"name\"\n [label]=\"formField.label\"\n [defaultCountryCode]=\"formField.dialCode\"\n [dialCodeList]=\"formField.dialCodeList\"\n [placeholder]=\"formField.placeholder\"\n [required]=\"formField.isRequired\"\n [labelHidden]=\"formField.labelHidden\"\n [autocomplete]=\"formField.autocomplete\"\n [hasError]=\"hasError\"\n [describedBy]=\"ariaDescribedBy\"\n type=\"tel\"\n ></amplify-phone-number-field>\n\n <amplify-password-field\n *ngIf=\"isPasswordField()\"\n [name]=\"name\"\n [label]=\"formField.label\"\n [placeholder]=\"formField.placeholder\"\n [required]=\"formField.isRequired\"\n [labelHidden]=\"formField.labelHidden\"\n [autocomplete]=\"formField.autocomplete\"\n [hasError]=\"hasError\"\n [describedBy]=\"ariaDescribedBy\"\n (setBlur)=\"onBlur($event)\"\n ></amplify-password-field>\n\n <amplify-text-field\n *ngIf=\"!isPasswordField() && !isPhoneField()\"\n [name]=\"name\"\n [label]=\"formField.label\"\n [placeholder]=\"formField.placeholder\"\n [required]=\"formField.isRequired\"\n [labelHidden]=\"formField.labelHidden\"\n [autocomplete]=\"formField.autocomplete\"\n [type]=\"formField.type\"\n [hasError]=\"hasError\"\n [describedBy]=\"ariaDescribedBy\"\n ></amplify-text-field>\n\n <div data-amplify-sign-up-errors *ngIf=\"hasError()\" [id]=\"errorId\">\n <div\n class=\"amplify-text amplify-text--error\"\n data-variation=\"error\"\n *ngFor=\"let error of errors\"\n >\n {{ translate(error) }}\n </div>\n </div>\n</div>\n"
676
- },] }
677
- ];
678
- FormFieldComponent.ctorParameters = () => [
679
- { type: AuthenticatorService }
680
- ];
681
- FormFieldComponent.propDecorators = {
682
- name: [{ type: Input }],
683
- formField: [{ type: Input }]
684
- };
669
+ FormFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FormFieldComponent, deps: [{ token: AuthenticatorService }], target: i0.ɵɵFactoryTarget.Component });
670
+ FormFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: FormFieldComponent, selector: "amplify-form-field", inputs: { name: "name", formField: "formField" }, ngImport: i0, template: "<div class=\"amplify-flex amplify-field amplify-authenticator__column\">\n <!-- Country code field -->\n <amplify-phone-number-field\n *ngIf=\"isPhoneField()\"\n [name]=\"name\"\n [label]=\"formField.label\"\n [defaultCountryCode]=\"formField.dialCode\"\n [dialCodeList]=\"formField.dialCodeList\"\n [placeholder]=\"formField.placeholder\"\n [required]=\"formField.isRequired\"\n [labelHidden]=\"formField.labelHidden\"\n [autocomplete]=\"formField.autocomplete\"\n [hasError]=\"hasError\"\n [describedBy]=\"ariaDescribedBy\"\n type=\"tel\"\n ></amplify-phone-number-field>\n\n <amplify-password-field\n *ngIf=\"isPasswordField()\"\n [name]=\"name\"\n [label]=\"formField.label\"\n [placeholder]=\"formField.placeholder\"\n [required]=\"formField.isRequired\"\n [labelHidden]=\"formField.labelHidden\"\n [autocomplete]=\"formField.autocomplete\"\n [hasError]=\"hasError\"\n [describedBy]=\"ariaDescribedBy\"\n (setBlur)=\"onBlur($event)\"\n ></amplify-password-field>\n\n <amplify-text-field\n *ngIf=\"!isPasswordField() && !isPhoneField()\"\n [name]=\"name\"\n [label]=\"formField.label\"\n [placeholder]=\"formField.placeholder\"\n [required]=\"formField.isRequired\"\n [labelHidden]=\"formField.labelHidden\"\n [autocomplete]=\"formField.autocomplete\"\n [type]=\"formField.type\"\n [hasError]=\"hasError\"\n [describedBy]=\"ariaDescribedBy\"\n ></amplify-text-field>\n\n <div data-amplify-sign-up-errors *ngIf=\"hasError()\" [id]=\"errorId\">\n <div\n class=\"amplify-text amplify-text--error\"\n data-variation=\"error\"\n *ngFor=\"let error of errors\"\n >\n {{ translate(error) }}\n </div>\n </div>\n</div>\n", components: [{ type: PhoneNumberFieldComponent, selector: "amplify-phone-number-field", inputs: ["autocomplete", "disabled", "defaultCountryCode", "selectFieldId", "textFieldId", "initialValue", "label", "name", "placeholder", "required", "type", "labelHidden", "dialCodeList", "hasError", "describedBy"] }, { type: PasswordFieldComponent, selector: "amplify-password-field", inputs: ["autocomplete", "disabled", "fieldId", "initialValue", "label", "name", "placeholder", "required", "labelHidden", "hasError", "describedBy"], outputs: ["setBlur"] }, { type: TextFieldComponent, selector: "amplify-text-field", inputs: ["autocomplete", "disabled", "fieldId", "initialValue", "label", "name", "placeholder", "required", "type", "labelHidden", "hasError", "describedBy"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
671
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: FormFieldComponent, decorators: [{
672
+ type: Component,
673
+ args: [{
674
+ selector: 'amplify-form-field',
675
+ templateUrl: './form-field.component.html',
676
+ }]
677
+ }], ctorParameters: function () { return [{ type: AuthenticatorService }]; }, propDecorators: { name: [{
678
+ type: Input
679
+ }], formField: [{
680
+ type: Input
681
+ }] } });
685
682
 
686
- class ResetPasswordComponent {
683
+ /**
684
+ * Sorts the given formFields, then renders them in order.
685
+ */
686
+ class BaseFormFieldsComponent {
687
+ constructor(authenticator) {
688
+ this.authenticator = authenticator;
689
+ this.display = 'contents';
690
+ this.formFields = [];
691
+ }
692
+ ngOnInit() {
693
+ const state = this.authenticator.authState;
694
+ this.formFields = getSortedFormFields(this.route, state);
695
+ }
696
+ }
697
+ BaseFormFieldsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: BaseFormFieldsComponent, deps: [{ token: AuthenticatorService }], target: i0.ɵɵFactoryTarget.Component });
698
+ BaseFormFieldsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: BaseFormFieldsComponent, selector: "amplify-base-form-fields", inputs: { route: "route" }, host: { properties: { "style.display": "this.display" } }, ngImport: i0, template: "<ng-container *ngFor=\"let formField of formFields\">\n <amplify-form-field\n [name]=\"formField[0]\"\n [formField]=\"formField[1]\"\n ></amplify-form-field>\n</ng-container>\n", components: [{ type: FormFieldComponent, selector: "amplify-form-field", inputs: ["name", "formField"] }], directives: [{ type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
699
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: BaseFormFieldsComponent, decorators: [{
700
+ type: Component,
701
+ args: [{
702
+ selector: 'amplify-base-form-fields',
703
+ templateUrl: './base-form-fields.component.html',
704
+ }]
705
+ }], ctorParameters: function () { return [{ type: AuthenticatorService }]; }, propDecorators: { route: [{
706
+ type: Input
707
+ }], display: [{
708
+ type: HostBinding,
709
+ args: ['style.display']
710
+ }] } });
711
+
712
+ class ErrorComponent {
713
+ constructor() {
714
+ this.isVisible = true;
715
+ this.dismissAriaLabel = translate('Dismiss alert');
716
+ }
717
+ close() {
718
+ this.isVisible = false;
719
+ }
720
+ }
721
+ ErrorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ErrorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
722
+ ErrorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ErrorComponent, selector: "amplify-error", ngImport: i0, template: "<div\n class=\"amplify-flex amplify-alert amplify-alert--error\"\n data-variation=\"error\"\n style=\"align-items: center; justify-content: space-between\"\n *ngIf=\"isVisible\"\n role=\"alert\"\n>\n <div class=\"amplify-flex\" style=\"align-items: center\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"amplify-icon\"\n [attr.aria-hidden]=\"true\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n >\n <path\n d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z\"\n ></path>\n </svg>\n <div><ng-content></ng-content></div>\n </div>\n <button\n amplify-button\n class=\"amplify-field-group__control amplify-alert__dismiss\"\n [attr.aria-label]=\"dismissAriaLabel\"\n variation=\"link\"\n [fullWidth]=\"false\"\n (click)=\"close()\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"amplify-icon\"\n [attr.aria-hidden]=\"true\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n >\n <path\n d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"\n ></path>\n </svg>\n </button>\n</div>\n", components: [{ type: ButtonComponent, selector: "button[amplify-button]", inputs: ["type", "fullWidth", "isDisabled", "size", "variation", "fontWeight"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
723
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ErrorComponent, decorators: [{
724
+ type: Component,
725
+ args: [{
726
+ selector: 'amplify-error',
727
+ templateUrl: './error.component.html',
728
+ }]
729
+ }] });
730
+
731
+ const { getForgotPasswordText, getSignInText } = authenticatorTextUtil;
732
+ class SignInComponent {
733
+ constructor(authenticator) {
734
+ this.authenticator = authenticator;
735
+ this.dataAttr = '';
736
+ this.forgotPasswordText = getForgotPasswordText();
737
+ this.signInButtonText = getSignInText();
738
+ }
739
+ get context() {
740
+ return this.authenticator.slotContext;
741
+ }
742
+ onInput(event) {
743
+ event.preventDefault();
744
+ const { name, value } = event.target;
745
+ this.authenticator.updateForm({ name, value });
746
+ }
747
+ onSubmit(event) {
748
+ event.preventDefault();
749
+ this.authenticator.submitForm(getFormDataFromEvent(event));
750
+ }
751
+ }
752
+ SignInComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SignInComponent, deps: [{ token: AuthenticatorService }], target: i0.ɵɵFactoryTarget.Component });
753
+ SignInComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SignInComponent, selector: "amplify-sign-in", host: { properties: { "attr.data-amplify-authenticator-signin": "this.dataAttr" } }, ngImport: i0, template: "<amplify-slot name=\"sign-in-header\" [context]=\"context\"></amplify-slot>\n\n<form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <amplify-federated-sign-in></amplify-federated-sign-in>\n <fieldset\n class=\"amplify-flex amplify-authenticator__column\"\n style=\"flex-direction: column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <legend class=\"amplify-visually-hidden\">Sign in</legend>\n <amplify-base-form-fields route=\"signIn\"></amplify-base-form-fields>\n <button\n amplify-button\n variation=\"primary\"\n fullWidth=\"true\"\n type=\"submit\"\n [isDisabled]=\"authenticator.isPending\"\n >\n {{ signInButtonText }}\n </button>\n\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n</form>\n\n<amplify-slot name=\"sign-in-footer\" [context]=\"context\">\n <div data-amplify-footer>\n <button\n amplify-button\n fontWeight=\"normal\"\n size=\"small\"\n variation=\"link\"\n fullWidth=\"true\"\n (click)=\"authenticator.toResetPassword()\"\n >\n {{ forgotPasswordText }}\n </button>\n </div>\n</amplify-slot>\n", components: [{ type: AmplifySlotComponent, selector: "amplify-slot", inputs: ["name", "context"] }, { type: FederatedSignInComponent, selector: "amplify-federated-sign-in" }, { type: BaseFormFieldsComponent, selector: "amplify-base-form-fields", inputs: ["route"] }, { type: ButtonComponent, selector: "button[amplify-button]", inputs: ["type", "fullWidth", "isDisabled", "size", "variation", "fontWeight"] }, { type: ErrorComponent, selector: "amplify-error" }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], encapsulation: i0.ViewEncapsulation.None });
754
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SignInComponent, decorators: [{
755
+ type: Component,
756
+ args: [{
757
+ selector: 'amplify-sign-in',
758
+ templateUrl: './sign-in.component.html',
759
+ encapsulation: ViewEncapsulation.None,
760
+ }]
761
+ }], ctorParameters: function () { return [{ type: AuthenticatorService }]; }, propDecorators: { dataAttr: [{
762
+ type: HostBinding,
763
+ args: ['attr.data-amplify-authenticator-signin']
764
+ }] } });
765
+
766
+ class SignUpFormFieldsComponent {
767
+ }
768
+ SignUpFormFieldsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SignUpFormFieldsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
769
+ SignUpFormFieldsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SignUpFormFieldsComponent, selector: "amplify-sign-up-form-fields", ngImport: i0, template: "<div class=\"amplify-flex amplify-authenticator__column\" data-amplify-fieldset>\n <amplify-base-form-fields route=\"signUp\"></amplify-base-form-fields>\n</div>\n", components: [{ type: BaseFormFieldsComponent, selector: "amplify-base-form-fields", inputs: ["route"] }] });
770
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SignUpFormFieldsComponent, decorators: [{
771
+ type: Component,
772
+ args: [{
773
+ selector: 'amplify-sign-up-form-fields',
774
+ templateUrl: './sign-up-form-fields.component.html',
775
+ }]
776
+ }] });
777
+
778
+ const { getCreateAccountText } = authenticatorTextUtil;
779
+ class SignUpComponent {
780
+ constructor(authenticator) {
781
+ this.authenticator = authenticator;
782
+ this.dataAttr = '';
783
+ // translated texts
784
+ this.createAccountText = getCreateAccountText();
785
+ }
786
+ get context() {
787
+ return this.authenticator.slotContext;
788
+ }
789
+ onInput(event) {
790
+ let { checked, name, type, value } = event.target;
791
+ if (type === 'checkbox' && !checked)
792
+ value = undefined;
793
+ this.authenticator.updateForm({ name, value });
794
+ }
795
+ onSubmit(event) {
796
+ event.preventDefault();
797
+ this.authenticator.submitForm(getFormDataFromEvent(event));
798
+ }
799
+ }
800
+ SignUpComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SignUpComponent, deps: [{ token: AuthenticatorService }], target: i0.ɵɵFactoryTarget.Component });
801
+ SignUpComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SignUpComponent, selector: "amplify-sign-up", host: { properties: { "attr.data-amplify-authenticator-signup": "this.dataAttr" } }, ngImport: i0, template: "<amplify-slot name=\"sign-up-header\" [context]=\"context\"></amplify-slot>\n\n<form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <amplify-federated-sign-in></amplify-federated-sign-in>\n <div class=\"amplify-flex amplify-authenticator__column\">\n <div class=\"amplify-flex amplify-authenticator__column\">\n <amplify-slot name=\"sign-up-form-fields\" [context]=\"context\">\n <amplify-sign-up-form-fields></amplify-sign-up-form-fields>\n </amplify-slot>\n\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </div>\n\n <amplify-slot name=\"sign-up-button\" [context]=\"context\">\n <button\n [isDisabled]=\"\n authenticator.isPending || authenticator.hasValidationErrors\n \"\n amplify-button\n variation=\"primary\"\n fullWidth=\"true\"\n type=\"submit\"\n >\n {{ createAccountText }}\n </button>\n </amplify-slot>\n </div>\n</form>\n\n<amplify-slot name=\"sign-up-footer\" [context]=\"context\"> </amplify-slot>\n", components: [{ type: AmplifySlotComponent, selector: "amplify-slot", inputs: ["name", "context"] }, { type: FederatedSignInComponent, selector: "amplify-federated-sign-in" }, { type: SignUpFormFieldsComponent, selector: "amplify-sign-up-form-fields" }, { type: ErrorComponent, selector: "amplify-error" }, { type: ButtonComponent, selector: "button[amplify-button]", inputs: ["type", "fullWidth", "isDisabled", "size", "variation", "fontWeight"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
802
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SignUpComponent, decorators: [{
803
+ type: Component,
804
+ args: [{
805
+ selector: 'amplify-sign-up',
806
+ templateUrl: './sign-up.component.html',
807
+ }]
808
+ }], ctorParameters: function () { return [{ type: AuthenticatorService }]; }, propDecorators: { dataAttr: [{
809
+ type: HostBinding,
810
+ args: ['attr.data-amplify-authenticator-signup']
811
+ }] } });
812
+
813
+ const { getResendCodeText: getResendCodeText$1, getConfirmText: getConfirmText$2, getDeliveryMethodText, getDeliveryMessageText, } = authenticatorTextUtil;
814
+ class ConfirmSignUpComponent {
687
815
  constructor(authenticator) {
688
816
  this.authenticator = authenticator;
689
817
  this.dataAttr = '';
690
- this.headerText = translate('Reset your password');
691
818
  // translated texts
692
- this.sendCodeText = translate('Send Code');
693
- this.backToSignInText = translate('Back to Sign In');
819
+ this.resendCodeText = getResendCodeText$1();
820
+ this.confirmText = getConfirmText$2();
821
+ }
822
+ get context() {
823
+ return this.authenticator.slotContext;
824
+ }
825
+ get confirmSignUpHeading() {
826
+ const { codeDeliveryDetails } = this.authenticator;
827
+ return getDeliveryMethodText(codeDeliveryDetails);
828
+ }
829
+ get subtitleText() {
830
+ const { codeDeliveryDetails } = this.authenticator;
831
+ return getDeliveryMessageText(codeDeliveryDetails);
832
+ }
833
+ onInput(event) {
834
+ event.preventDefault();
835
+ const { name, value } = event.target;
836
+ this.authenticator.updateForm({ name, value });
837
+ }
838
+ onSubmit(event) {
839
+ event.preventDefault();
840
+ this.authenticator.submitForm(getFormDataFromEvent(event));
841
+ }
842
+ }
843
+ ConfirmSignUpComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ConfirmSignUpComponent, deps: [{ token: AuthenticatorService }], target: i0.ɵɵFactoryTarget.Component });
844
+ ConfirmSignUpComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ConfirmSignUpComponent, selector: "amplify-confirm-sign-up", host: { properties: { "attr.data-amplify-authenticator-confirmsignup": "this.dataAttr" } }, ngImport: i0, template: "<ng-container>\n <form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex amplify-authenticator__column\"\n data-amplify-fieldset\n [disabled]=\"context.isPending\"\n >\n <amplify-slot name=\"confirm-sign-up-header\" [context]=\"context\">\n <h3\n class=\"amplify-heading amplify-authenticator__heading\"\n style=\"font-size: 1.5rem\"\n >\n {{ confirmSignUpHeading }}\n </h3>\n </amplify-slot>\n <span class=\"amplify-authenticator__subtitle\">\n {{ subtitleText }}\n </span>\n <amplify-base-form-fields\n route=\"confirmSignUp\"\n ></amplify-base-form-fields>\n\n <button\n amplify-button\n variation=\"primary\"\n fullWidth=\"true\"\n type=\"submit\"\n [isDisabled]=\"authenticator.isPending\"\n >\n {{ confirmText }}\n </button>\n <button\n amplify-button\n fontWeight=\"normal\"\n (click)=\"authenticator.resendCode()\"\n >\n {{ resendCodeText }}\n </button>\n </fieldset>\n\n <amplify-error *ngIf=\"context.error\">\n {{ authenticator.error }}\n </amplify-error>\n <amplify-slot\n name=\"confirm-sign-up-footer\"\n [context]=\"context\"\n ></amplify-slot>\n </form>\n</ng-container>\n", components: [{ type: AmplifySlotComponent, selector: "amplify-slot", inputs: ["name", "context"] }, { type: BaseFormFieldsComponent, selector: "amplify-base-form-fields", inputs: ["route"] }, { type: ButtonComponent, selector: "button[amplify-button]", inputs: ["type", "fullWidth", "isDisabled", "size", "variation", "fontWeight"] }, { type: ErrorComponent, selector: "amplify-error" }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
845
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ConfirmSignUpComponent, decorators: [{
846
+ type: Component,
847
+ args: [{
848
+ selector: 'amplify-confirm-sign-up',
849
+ templateUrl: './confirm-sign-up.component.html',
850
+ }]
851
+ }], ctorParameters: function () { return [{ type: AuthenticatorService }]; }, propDecorators: { dataAttr: [{
852
+ type: HostBinding,
853
+ args: ['attr.data-amplify-authenticator-confirmsignup']
854
+ }] } });
855
+
856
+ const { getConfirmText: getConfirmText$1, getBackToSignInText: getBackToSignInText$4, getChallengeText } = authenticatorTextUtil;
857
+ class ConfirmSignInComponent {
858
+ constructor(authenticator) {
859
+ this.authenticator = authenticator;
860
+ this.dataAttr = '';
861
+ this.confirmText = getConfirmText$1();
862
+ this.backToSignInText = getBackToSignInText$4();
863
+ }
864
+ ngOnInit() {
865
+ this.setHeaderText();
694
866
  }
695
867
  get context() {
696
868
  return this.authenticator.slotContext;
697
869
  }
870
+ setHeaderText() {
871
+ const state = this.authenticator.authState;
872
+ const actorContext = getActorContext(state);
873
+ const { challengeName } = actorContext;
874
+ this.headerText = getChallengeText(challengeName);
875
+ }
698
876
  onInput(event) {
699
877
  event.preventDefault();
700
878
  const { name, value } = event.target;
@@ -705,32 +883,32 @@ class ResetPasswordComponent {
705
883
  this.authenticator.submitForm(getFormDataFromEvent(event));
706
884
  }
707
885
  }
708
- ResetPasswordComponent.decorators = [
709
- { type: Component, args: [{
710
- selector: 'amplify-reset-password',
711
- template: "<form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex amplify-authenticator__column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-slot\n class=\"amplify-flex\"\n name=\"reset-password-header\"\n [context]=\"context\"\n >\n <h3 class=\"amplify-heading amplify-heading--3\">{{ this.headerText }}</h3>\n </amplify-slot>\n\n <amplify-base-form-fields route=\"resetPassword\"></amplify-base-form-fields>\n <button\n amplify-button\n variation=\"primary\"\n fullWidth=\"true\"\n type=\"submit\"\n [isDisabled]=\"authenticator.isPending\"\n >\n {{ sendCodeText }}\n </button>\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"authenticator.toSignIn()\"\n >\n {{ backToSignInText }}\n </button>\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n\n <amplify-slot name=\"reset-password-footer\" [context]=\"context\">\n </amplify-slot>\n</form>\n"
712
- },] }
713
- ];
714
- ResetPasswordComponent.ctorParameters = () => [
715
- { type: AuthenticatorService }
716
- ];
717
- ResetPasswordComponent.propDecorators = {
718
- dataAttr: [{ type: HostBinding, args: ['attr.data-amplify-authenticator-resetPassword',] }],
719
- headerText: [{ type: Input }]
720
- };
886
+ ConfirmSignInComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ConfirmSignInComponent, deps: [{ token: AuthenticatorService }], target: i0.ɵɵFactoryTarget.Component });
887
+ ConfirmSignInComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ConfirmSignInComponent, selector: "amplify-confirm-sign-in", host: { properties: { "attr.data-amplify-authenticator-confirmsignin": "this.dataAttr" } }, ngImport: i0, template: "<form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex amplify-authenticator__column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-slot name=\"confirm-sign-in-header\" [context]=\"context\">\n <h3 class=\"amplify-heading amplify-heading--3\">{{ headerText }}</h3>\n </amplify-slot>\n <amplify-base-form-fields route=\"confirmSignIn\"></amplify-base-form-fields>\n\n <button\n amplify-button\n variation=\"primary\"\n fullWidth=\"true\"\n type=\"submit\"\n [isDisabled]=\"authenticator.isPending\"\n >\n {{ confirmText }}\n </button>\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"authenticator.toSignIn()\"\n >\n {{ backToSignInText }}\n </button>\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n <amplify-slot\n name=\"confirm-sign-in-footer\"\n [context]=\"context\"\n ></amplify-slot>\n</form>\n", components: [{ type: AmplifySlotComponent, selector: "amplify-slot", inputs: ["name", "context"] }, { type: BaseFormFieldsComponent, selector: "amplify-base-form-fields", inputs: ["route"] }, { type: ButtonComponent, selector: "button[amplify-button]", inputs: ["type", "fullWidth", "isDisabled", "size", "variation", "fontWeight"] }, { type: ErrorComponent, selector: "amplify-error" }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
888
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ConfirmSignInComponent, decorators: [{
889
+ type: Component,
890
+ args: [{
891
+ selector: 'amplify-confirm-sign-in',
892
+ templateUrl: './confirm-sign-in.component.html',
893
+ }]
894
+ }], ctorParameters: function () { return [{ type: AuthenticatorService }]; }, propDecorators: { dataAttr: [{
895
+ type: HostBinding,
896
+ args: ['attr.data-amplify-authenticator-confirmsignin']
897
+ }] } });
721
898
 
722
899
  const logger = new Logger$1('SetupTotp');
900
+ const { getSetupTOTPText, getCopyText, getBackToSignInText: getBackToSignInText$3, getConfirmText, getCopiedText, } = authenticatorTextUtil;
723
901
  class SetupTotpComponent {
724
902
  constructor(authenticator) {
725
903
  this.authenticator = authenticator;
726
904
  this.dataAttr = '';
727
- this.headerText = translate('Setup TOTP');
905
+ this.headerText = getSetupTOTPText();
728
906
  this.qrCodeSource = '';
729
907
  this.secretKey = '';
730
- this.copyTextLabel = translate('COPY');
908
+ this.copyTextLabel = getCopyText();
731
909
  // translated texts
732
- this.backToSignInText = translate('Back to Sign In');
733
- this.confirmText = translate('Confirm');
910
+ this.backToSignInText = getBackToSignInText$3();
911
+ this.confirmText = getConfirmText();
734
912
  }
735
913
  ngOnInit() {
736
914
  return __awaiter(this, void 0, void 0, function* () {
@@ -770,32 +948,43 @@ class SetupTotpComponent {
770
948
  }
771
949
  copyText() {
772
950
  navigator.clipboard.writeText(this.secretKey);
773
- this.copyTextLabel = translate('COPIED');
951
+ this.copyTextLabel = getCopiedText();
774
952
  }
775
953
  }
776
- SetupTotpComponent.decorators = [
777
- { type: Component, args: [{
778
- selector: 'amplify-setup-totp',
779
- template: "<form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex amplify-authenticator__column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-slot name=\"setup-totp-header\" [context]=\"context\">\n <h3 class=\"amplify-heading amplify-heading--3\">{{ this.headerText }}</h3>\n </amplify-slot>\n <p *ngIf=\"!qrCodeSource\">Loading...</p>\n <img\n *ngIf=\"qrCodeSource\"\n [src]=\"qrCodeSource\"\n alt=\"qr code\"\n data-amplify-qrcode\n width=\"228\"\n height=\"228\"\n />\n <div class=\"amplify-flex\" data-amplify-copy>\n <div>{{ secretKey }}</div>\n <div data-amplify-copy-svg (click)=\"copyText()\">\n <div data-amplify-copy-tooltip>{{ copyTextLabel }}</div>\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M16 1H4C2.9 1 2 1.9 2 3V17H4V3H16V1ZM15 5H8C6.9 5 6.01 5.9 6.01 7L6 21C6 22.1 6.89 23 7.99 23H19C20.1 23 21 22.1 21 21V11L15 5ZM8 21V7H14V12H19V21H8Z\"\n />\n </svg>\n </div>\n </div>\n\n <amplify-base-form-fields route=\"setupTOTP\"></amplify-base-form-fields>\n <button\n amplify-button\n variation=\"primary\"\n fullWidth=\"true\"\n type=\"submit\"\n [isDisabled]=\"authenticator.isPending\"\n >\n {{ confirmText }}\n </button>\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"authenticator.toSignIn()\"\n >\n {{ backToSignInText }}\n </button>\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n <amplify-slot name=\"setup-totp-footer\" [context]=\"context\"> </amplify-slot>\n</form>\n"
780
- },] }
781
- ];
782
- SetupTotpComponent.ctorParameters = () => [
783
- { type: AuthenticatorService }
784
- ];
785
- SetupTotpComponent.propDecorators = {
786
- dataAttr: [{ type: HostBinding, args: ['attr.data-amplify-authenticator-setup-totp',] }]
787
- };
954
+ SetupTotpComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SetupTotpComponent, deps: [{ token: AuthenticatorService }], target: i0.ɵɵFactoryTarget.Component });
955
+ SetupTotpComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SetupTotpComponent, selector: "amplify-setup-totp", host: { properties: { "attr.data-amplify-authenticator-setup-totp": "this.dataAttr" } }, ngImport: i0, template: "<form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex amplify-authenticator__column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-slot name=\"setup-totp-header\" [context]=\"context\">\n <h3 class=\"amplify-heading amplify-heading--3\">{{ this.headerText }}</h3>\n </amplify-slot>\n <p *ngIf=\"!qrCodeSource\">Loading...</p>\n <img\n *ngIf=\"qrCodeSource\"\n [src]=\"qrCodeSource\"\n alt=\"qr code\"\n data-amplify-qrcode\n width=\"228\"\n height=\"228\"\n />\n <div class=\"amplify-flex\" data-amplify-copy>\n <div>{{ secretKey }}</div>\n <div data-amplify-copy-svg (click)=\"copyText()\">\n <div data-amplify-copy-tooltip>{{ copyTextLabel }}</div>\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M16 1H4C2.9 1 2 1.9 2 3V17H4V3H16V1ZM15 5H8C6.9 5 6.01 5.9 6.01 7L6 21C6 22.1 6.89 23 7.99 23H19C20.1 23 21 22.1 21 21V11L15 5ZM8 21V7H14V12H19V21H8Z\"\n />\n </svg>\n </div>\n </div>\n\n <amplify-base-form-fields route=\"setupTOTP\"></amplify-base-form-fields>\n <button\n amplify-button\n variation=\"primary\"\n fullWidth=\"true\"\n type=\"submit\"\n [isDisabled]=\"authenticator.isPending\"\n >\n {{ confirmText }}\n </button>\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"authenticator.toSignIn()\"\n >\n {{ backToSignInText }}\n </button>\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n <amplify-slot name=\"setup-totp-footer\" [context]=\"context\"> </amplify-slot>\n</form>\n", components: [{ type: AmplifySlotComponent, selector: "amplify-slot", inputs: ["name", "context"] }, { type: BaseFormFieldsComponent, selector: "amplify-base-form-fields", inputs: ["route"] }, { type: ButtonComponent, selector: "button[amplify-button]", inputs: ["type", "fullWidth", "isDisabled", "size", "variation", "fontWeight"] }, { type: ErrorComponent, selector: "amplify-error" }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
956
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SetupTotpComponent, decorators: [{
957
+ type: Component,
958
+ args: [{
959
+ selector: 'amplify-setup-totp',
960
+ templateUrl: './setup-totp.component.html',
961
+ }]
962
+ }], ctorParameters: function () { return [{ type: AuthenticatorService }]; }, propDecorators: { dataAttr: [{
963
+ type: HostBinding,
964
+ args: ['attr.data-amplify-authenticator-setup-totp']
965
+ }] } });
788
966
 
789
- class SignInComponent {
967
+ class ForceNewPasswordFormFieldsComponent {
968
+ }
969
+ ForceNewPasswordFormFieldsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ForceNewPasswordFormFieldsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
970
+ ForceNewPasswordFormFieldsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ForceNewPasswordFormFieldsComponent, selector: "amplify-force-new-password-form-fields", ngImport: i0, template: "<div class=\"amplify-flex amplify-authenticator__column\" data-amplify-fieldset>\n <amplify-base-form-fields route=\"forceNewPassword\"></amplify-base-form-fields>\n</div>\n", components: [{ type: BaseFormFieldsComponent, selector: "amplify-base-form-fields", inputs: ["route"] }] });
971
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ForceNewPasswordFormFieldsComponent, decorators: [{
972
+ type: Component,
973
+ args: [{
974
+ selector: 'amplify-force-new-password-form-fields',
975
+ templateUrl: './force-new-password-form-fields.component.html',
976
+ }]
977
+ }] });
978
+
979
+ const { getChangePasswordText, getBackToSignInText: getBackToSignInText$2 } = authenticatorTextUtil;
980
+ class ForceNewPasswordComponent {
790
981
  constructor(authenticator) {
791
982
  this.authenticator = authenticator;
792
983
  this.dataAttr = '';
793
- // translated phrases
794
- // Support backwards compatibility for legacy key with trailing space
795
- this.forgotPasswordText = !hasTranslation('Forgot your password? ')
796
- ? translate('Forgot your password?')
797
- : translate('Forgot your password? ');
798
- this.signInButtonText = translate('Sign in');
984
+ this.headerText = getChangePasswordText();
985
+ // translated texts
986
+ this.changePasswordText = getChangePasswordText();
987
+ this.backToSignInText = getBackToSignInText$2();
799
988
  }
800
989
  get context() {
801
990
  return this.authenticator.slotContext;
@@ -810,34 +999,37 @@ class SignInComponent {
810
999
  this.authenticator.submitForm(getFormDataFromEvent(event));
811
1000
  }
812
1001
  }
813
- SignInComponent.decorators = [
814
- { type: Component, args: [{
815
- selector: 'amplify-sign-in',
816
- template: "<amplify-slot name=\"sign-in-header\" [context]=\"context\"></amplify-slot>\n\n<form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <amplify-federated-sign-in></amplify-federated-sign-in>\n <fieldset\n class=\"amplify-flex amplify-authenticator__column\"\n style=\"flex-direction: column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <legend class=\"amplify-visually-hidden\">Sign in</legend>\n <amplify-base-form-fields route=\"signIn\"></amplify-base-form-fields>\n <button\n amplify-button\n variation=\"primary\"\n fullWidth=\"true\"\n type=\"submit\"\n [isDisabled]=\"authenticator.isPending\"\n >\n {{ signInButtonText }}\n </button>\n\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n</form>\n\n<amplify-slot name=\"sign-in-footer\" [context]=\"context\">\n <div data-amplify-footer>\n <button\n amplify-button\n fontWeight=\"normal\"\n size=\"small\"\n variation=\"link\"\n fullWidth=\"true\"\n (click)=\"authenticator.toResetPassword()\"\n >\n {{ forgotPasswordText }}\n </button>\n </div>\n</amplify-slot>\n",
817
- encapsulation: ViewEncapsulation.None
818
- },] }
819
- ];
820
- SignInComponent.ctorParameters = () => [
821
- { type: AuthenticatorService }
822
- ];
823
- SignInComponent.propDecorators = {
824
- dataAttr: [{ type: HostBinding, args: ['attr.data-amplify-authenticator-signin',] }]
825
- };
1002
+ ForceNewPasswordComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ForceNewPasswordComponent, deps: [{ token: AuthenticatorService }], target: i0.ɵɵFactoryTarget.Component });
1003
+ ForceNewPasswordComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ForceNewPasswordComponent, selector: "amplify-force-new-password", inputs: { headerText: "headerText" }, host: { properties: { "attr.data-amplify-authenticator-forcenewpassword": "this.dataAttr" } }, ngImport: i0, template: "<form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex amplify-authenticator__column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-slot name=\"force-new-password-header\" [context]=\"context\">\n <h3 class=\"amplify-heading amplify-heading--3\">{{ this.headerText }}</h3>\n </amplify-slot>\n\n <amplify-slot name=\"force-new-form-fields\" [context]=\"context\">\n <amplify-force-new-password-form-fields></amplify-force-new-password-form-fields>\n </amplify-slot>\n\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\n {{ changePasswordText }}\n </button>\n\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"authenticator.toSignIn()\"\n >\n {{ backToSignInText }}\n </button>\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n <amplify-slot name=\"force-new-password-footer\" [context]=\"context\">\n </amplify-slot>\n</form>\n", components: [{ type: AmplifySlotComponent, selector: "amplify-slot", inputs: ["name", "context"] }, { type: ForceNewPasswordFormFieldsComponent, selector: "amplify-force-new-password-form-fields" }, { type: ButtonComponent, selector: "button[amplify-button]", inputs: ["type", "fullWidth", "isDisabled", "size", "variation", "fontWeight"] }, { type: ErrorComponent, selector: "amplify-error" }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
1004
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ForceNewPasswordComponent, decorators: [{
1005
+ type: Component,
1006
+ args: [{
1007
+ selector: 'amplify-force-new-password',
1008
+ templateUrl: './force-new-password.component.html',
1009
+ }]
1010
+ }], ctorParameters: function () { return [{ type: AuthenticatorService }]; }, propDecorators: { dataAttr: [{
1011
+ type: HostBinding,
1012
+ args: ['attr.data-amplify-authenticator-forcenewpassword']
1013
+ }], headerText: [{
1014
+ type: Input
1015
+ }] } });
826
1016
 
827
- class SignUpComponent {
1017
+ const { getResetYourPasswordText: getResetYourPasswordText$1, getSendCodeText, getBackToSignInText: getBackToSignInText$1 } = authenticatorTextUtil;
1018
+ class ResetPasswordComponent {
828
1019
  constructor(authenticator) {
829
1020
  this.authenticator = authenticator;
830
1021
  this.dataAttr = '';
1022
+ this.headerText = getResetYourPasswordText$1();
831
1023
  // translated texts
832
- this.createAccountText = translate('Create Account');
1024
+ this.sendCodeText = getSendCodeText();
1025
+ this.backToSignInText = getBackToSignInText$1();
833
1026
  }
834
1027
  get context() {
835
1028
  return this.authenticator.slotContext;
836
1029
  }
837
1030
  onInput(event) {
838
- let { checked, name, type, value } = event.target;
839
- if (type === 'checkbox' && !checked)
840
- value = undefined;
1031
+ event.preventDefault();
1032
+ const { name, value } = event.target;
841
1033
  this.authenticator.updateForm({ name, value });
842
1034
  }
843
1035
  onSubmit(event) {
@@ -845,40 +1037,73 @@ class SignUpComponent {
845
1037
  this.authenticator.submitForm(getFormDataFromEvent(event));
846
1038
  }
847
1039
  }
848
- SignUpComponent.decorators = [
849
- { type: Component, args: [{
850
- selector: 'amplify-sign-up',
851
- template: "<amplify-slot name=\"sign-up-header\" [context]=\"context\"></amplify-slot>\n\n<form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <amplify-federated-sign-in></amplify-federated-sign-in>\n <div class=\"amplify-flex amplify-authenticator__column\">\n <div class=\"amplify-flex amplify-authenticator__column\">\n <amplify-slot name=\"sign-up-form-fields\" [context]=\"context\">\n <amplify-sign-up-form-fields></amplify-sign-up-form-fields>\n </amplify-slot>\n\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </div>\n\n <amplify-slot name=\"sign-up-button\" [context]=\"context\">\n <button\n [isDisabled]=\"\n authenticator.isPending || authenticator.hasValidationErrors\n \"\n amplify-button\n variation=\"primary\"\n fullWidth=\"true\"\n type=\"submit\"\n >\n {{ createAccountText }}\n </button>\n </amplify-slot>\n </div>\n</form>\n\n<amplify-slot name=\"sign-up-footer\" [context]=\"context\"> </amplify-slot>\n"
852
- },] }
853
- ];
854
- SignUpComponent.ctorParameters = () => [
855
- { type: AuthenticatorService }
856
- ];
857
- SignUpComponent.propDecorators = {
858
- dataAttr: [{ type: HostBinding, args: ['attr.data-amplify-authenticator-signup',] }]
859
- };
1040
+ ResetPasswordComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ResetPasswordComponent, deps: [{ token: AuthenticatorService }], target: i0.ɵɵFactoryTarget.Component });
1041
+ ResetPasswordComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ResetPasswordComponent, selector: "amplify-reset-password", inputs: { headerText: "headerText" }, host: { properties: { "attr.data-amplify-authenticator-resetPassword": "this.dataAttr" } }, ngImport: i0, template: "<form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex amplify-authenticator__column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-slot\n class=\"amplify-flex\"\n name=\"reset-password-header\"\n [context]=\"context\"\n >\n <h3 class=\"amplify-heading amplify-heading--3\">{{ this.headerText }}</h3>\n </amplify-slot>\n\n <amplify-base-form-fields route=\"resetPassword\"></amplify-base-form-fields>\n <button\n amplify-button\n variation=\"primary\"\n fullWidth=\"true\"\n type=\"submit\"\n [isDisabled]=\"authenticator.isPending\"\n >\n {{ sendCodeText }}\n </button>\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"authenticator.toSignIn()\"\n >\n {{ backToSignInText }}\n </button>\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n\n <amplify-slot name=\"reset-password-footer\" [context]=\"context\">\n </amplify-slot>\n</form>\n", components: [{ type: AmplifySlotComponent, selector: "amplify-slot", inputs: ["name", "context"] }, { type: BaseFormFieldsComponent, selector: "amplify-base-form-fields", inputs: ["route"] }, { type: ButtonComponent, selector: "button[amplify-button]", inputs: ["type", "fullWidth", "isDisabled", "size", "variation", "fontWeight"] }, { type: ErrorComponent, selector: "amplify-error" }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
1042
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ResetPasswordComponent, decorators: [{
1043
+ type: Component,
1044
+ args: [{
1045
+ selector: 'amplify-reset-password',
1046
+ templateUrl: './reset-password.component.html',
1047
+ }]
1048
+ }], ctorParameters: function () { return [{ type: AuthenticatorService }]; }, propDecorators: { dataAttr: [{
1049
+ type: HostBinding,
1050
+ args: ['attr.data-amplify-authenticator-resetPassword']
1051
+ }], headerText: [{
1052
+ type: Input
1053
+ }] } });
860
1054
 
861
- class SignUpFormFieldsComponent {
1055
+ const { getBackToSignInText, getResendCodeText, getSubmitText: getSubmitText$1, getResetYourPasswordText, } = authenticatorTextUtil;
1056
+ class ConfirmResetPasswordComponent {
1057
+ constructor(authenticator) {
1058
+ this.authenticator = authenticator;
1059
+ this.dataAttr = '';
1060
+ this.headerText = getResetYourPasswordText();
1061
+ // translated strings
1062
+ this.backToSignInText = getBackToSignInText();
1063
+ this.resendCodeText = getResendCodeText();
1064
+ this.submitText = getSubmitText$1();
1065
+ }
1066
+ get context() {
1067
+ return this.authenticator.slotContext;
1068
+ }
1069
+ onInput(event) {
1070
+ event.preventDefault();
1071
+ const { name, value } = event.target;
1072
+ this.authenticator.updateForm({ name, value });
1073
+ }
1074
+ onSubmit(event) {
1075
+ event.preventDefault();
1076
+ this.authenticator.submitForm(getFormDataFromEvent(event));
1077
+ }
862
1078
  }
863
- SignUpFormFieldsComponent.decorators = [
864
- { type: Component, args: [{
865
- selector: 'amplify-sign-up-form-fields',
866
- template: "<div class=\"amplify-flex amplify-authenticator__column\" data-amplify-fieldset>\n <amplify-base-form-fields route=\"signUp\"></amplify-base-form-fields>\n</div>\n"
867
- },] }
868
- ];
1079
+ ConfirmResetPasswordComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ConfirmResetPasswordComponent, deps: [{ token: AuthenticatorService }], target: i0.ɵɵFactoryTarget.Component });
1080
+ ConfirmResetPasswordComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ConfirmResetPasswordComponent, selector: "amplify-confirm-reset-password", inputs: { headerText: "headerText" }, host: { properties: { "attr.data-amplify-authenticator-confirmsignin": "this.dataAttr" } }, ngImport: i0, template: "<form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex amplify-authenticator__column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-slot name=\"confirm-reset-password-header\" [context]=\"context\">\n <h3 class=\"amplify-heading amplify-heading--3\">{{ headerText }}</h3>\n </amplify-slot>\n\n <amplify-base-form-fields\n route=\"confirmResetPassword\"\n ></amplify-base-form-fields>\n\n <button\n amplify-button\n variation=\"primary\"\n fullWidth=\"true\"\n type=\"submit\"\n [isDisabled]=\"authenticator.isPending\"\n >\n {{ submitText }}\n </button>\n\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n type=\"button\"\n (click)=\"authenticator.resendCode()\"\n >\n {{ resendCodeText }}\n </button>\n\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n <amplify-slot name=\"confirm-reset-password-footer\" [context]=\"context\">\n </amplify-slot>\n</form>\n", components: [{ type: AmplifySlotComponent, selector: "amplify-slot", inputs: ["name", "context"] }, { type: BaseFormFieldsComponent, selector: "amplify-base-form-fields", inputs: ["route"] }, { type: ButtonComponent, selector: "button[amplify-button]", inputs: ["type", "fullWidth", "isDisabled", "size", "variation", "fontWeight"] }, { type: ErrorComponent, selector: "amplify-error" }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
1081
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ConfirmResetPasswordComponent, decorators: [{
1082
+ type: Component,
1083
+ args: [{
1084
+ selector: 'amplify-confirm-reset-password',
1085
+ templateUrl: './amplify-confirm-reset-password.component.html',
1086
+ }]
1087
+ }], ctorParameters: function () { return [{ type: AuthenticatorService }]; }, propDecorators: { dataAttr: [{
1088
+ type: HostBinding,
1089
+ args: ['attr.data-amplify-authenticator-confirmsignin']
1090
+ }], headerText: [{
1091
+ type: Input
1092
+ }] } });
869
1093
 
870
1094
  const getAttributeMap = () => defaultFormFieldOptions;
871
1095
 
1096
+ const { getSkipText: getSkipText$1, getVerifyText, getAccountRecoveryInfoText: getAccountRecoveryInfoText$1 } = authenticatorTextUtil;
872
1097
  class VerifyUserComponent {
873
1098
  constructor(authenticator) {
874
1099
  this.authenticator = authenticator;
875
1100
  this.dataAttr = '';
876
- this.headerText = translate('Account recovery requires verified contact information');
1101
+ this.headerText = getAccountRecoveryInfoText$1();
877
1102
  this.unverifiedContactMethods = {};
878
1103
  this.labelId = nanoid(12);
879
1104
  // translated texts
880
- this.skipText = translate('Skip');
881
- this.verifyText = translate('Verify');
1105
+ this.skipText = getSkipText$1();
1106
+ this.verifyText = getVerifyText();
882
1107
  }
883
1108
  ngOnInit() {
884
1109
  const actorState = getActorState(this.authenticator.authState);
@@ -903,129 +1128,217 @@ class VerifyUserComponent {
903
1128
  this.authenticator.submitForm(getFormDataFromEvent(event));
904
1129
  }
905
1130
  }
906
- VerifyUserComponent.decorators = [
907
- { type: Component, args: [{
908
- selector: 'amplify-verify-user',
909
- template: "<form data-amplify-form (input)=\"onInput($event)\" (submit)=\"onSubmit($event)\">\n <fieldset\n class=\"amplify-flex amplify-authenticator__column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-slot name=\"verify-user-header\" [context]=\"context\">\n <h3 class=\"amplify-heading amplify-heading--3\">{{ this.headerText }}</h3>\n </amplify-slot>\n\n <div\n *ngFor=\"\n let unverifiedContactMethod of unverifiedContactMethods | keyvalue\n \"\n >\n <input\n name=\"unverifiedAttr\"\n type=\"radio\"\n [value]=\"unverifiedContactMethod.key\"\n [id]=\"labelId\"\n />\n <label [for]=\"labelId\">{{\n getLabelForAttr(unverifiedContactMethod.key)\n }}</label>\n </div>\n\n <button\n amplify-button\n variation=\"primary\"\n fullWidth=\"true\"\n type=\"submit\"\n [isDisabled]=\"authenticator.isPending\"\n >\n {{ verifyText }}\n </button>\n\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"authenticator.skipVerification()\"\n >\n {{ skipText }}\n </button>\n\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n <amplify-slot name=\"verify-user-footer\" [context]=\"context\"> </amplify-slot>\n</form>\n",
910
- encapsulation: ViewEncapsulation.None
911
- },] }
912
- ];
913
- VerifyUserComponent.ctorParameters = () => [
914
- { type: AuthenticatorService }
915
- ];
916
- VerifyUserComponent.propDecorators = {
917
- dataAttr: [{ type: HostBinding, args: ['attr.data-amplify-authenticator-verifyuser',] }],
918
- headerText: [{ type: Input }]
919
- };
1131
+ VerifyUserComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: VerifyUserComponent, deps: [{ token: AuthenticatorService }], target: i0.ɵɵFactoryTarget.Component });
1132
+ VerifyUserComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: VerifyUserComponent, selector: "amplify-verify-user", inputs: { headerText: "headerText" }, host: { properties: { "attr.data-amplify-authenticator-verifyuser": "this.dataAttr" } }, ngImport: i0, template: "<form data-amplify-form (input)=\"onInput($event)\" (submit)=\"onSubmit($event)\">\n <fieldset\n class=\"amplify-flex amplify-authenticator__column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-slot name=\"verify-user-header\" [context]=\"context\">\n <h3 class=\"amplify-heading amplify-heading--3\">{{ this.headerText }}</h3>\n </amplify-slot>\n\n <div\n *ngFor=\"\n let unverifiedContactMethod of unverifiedContactMethods | keyvalue\n \"\n >\n <input\n name=\"unverifiedAttr\"\n type=\"radio\"\n [value]=\"unverifiedContactMethod.key\"\n [id]=\"labelId\"\n />\n <label [for]=\"labelId\">{{\n getLabelForAttr(unverifiedContactMethod.key)\n }}</label>\n </div>\n\n <button\n amplify-button\n variation=\"primary\"\n fullWidth=\"true\"\n type=\"submit\"\n [isDisabled]=\"authenticator.isPending\"\n >\n {{ verifyText }}\n </button>\n\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"authenticator.skipVerification()\"\n >\n {{ skipText }}\n </button>\n\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n <amplify-slot name=\"verify-user-footer\" [context]=\"context\"> </amplify-slot>\n</form>\n", components: [{ type: AmplifySlotComponent, selector: "amplify-slot", inputs: ["name", "context"] }, { type: ButtonComponent, selector: "button[amplify-button]", inputs: ["type", "fullWidth", "isDisabled", "size", "variation", "fontWeight"] }, { type: ErrorComponent, selector: "amplify-error" }], directives: [{ type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "keyvalue": i6.KeyValuePipe }, encapsulation: i0.ViewEncapsulation.None });
1133
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: VerifyUserComponent, decorators: [{
1134
+ type: Component,
1135
+ args: [{
1136
+ selector: 'amplify-verify-user',
1137
+ templateUrl: './verify-user.component.html',
1138
+ encapsulation: ViewEncapsulation.None,
1139
+ }]
1140
+ }], ctorParameters: function () { return [{ type: AuthenticatorService }]; }, propDecorators: { dataAttr: [{
1141
+ type: HostBinding,
1142
+ args: ['attr.data-amplify-authenticator-verifyuser']
1143
+ }], headerText: [{
1144
+ type: Input
1145
+ }] } });
920
1146
 
921
- /**
922
- * Sorts the given formFields, then renders them in order.
923
- */
924
- class BaseFormFieldsComponent {
1147
+ const { getAccountRecoveryInfoText, getSkipText, getSubmitText } = authenticatorTextUtil;
1148
+ class ConfirmVerifyUserComponent {
925
1149
  constructor(authenticator) {
926
1150
  this.authenticator = authenticator;
927
- this.display = 'contents';
928
- this.formFields = [];
1151
+ this.dataAttr = '';
1152
+ this.headerText = getAccountRecoveryInfoText();
1153
+ // translated texts
1154
+ this.skipText = getSkipText();
1155
+ this.submitText = getSubmitText();
929
1156
  }
930
- ngOnInit() {
931
- const state = this.authenticator.authState;
932
- this.formFields = getSortedFormFields(this.route, state);
933
- if (this.route === 'confirmSignUp') {
934
- this.handleConfirmSignUp();
935
- }
1157
+ get context() {
1158
+ return this.authenticator.slotContext;
936
1159
  }
937
- handleConfirmSignUp() {
938
- /**
939
- * @todo(breaking): Angular `confirmSignUp` has different placholder here from other frameworks.
940
- *
941
- * Translating here in a backwards-compatible manner, but should be resolved in next major version.
942
- */
943
- var _a;
944
- const state = this.authenticator.authState;
945
- // backwards compatible placeholder text
946
- const placeholder = !hasTranslation('Confirmation Code')
947
- ? translate('Enter your code') // prioritize new placeholder
948
- : translate('Confirmation Code'); // legacy placeholder
949
- let defaultFormFields = getDefaultFormFields(this.route, state);
950
- if (defaultFormFields.confirmation_code.placeholder) {
951
- defaultFormFields.confirmation_code.placeholder = placeholder;
952
- }
953
- const customFormFields = ((_a = getActorContext(state).formFields) === null || _a === void 0 ? void 0 : _a.confirmSignUp) || {};
954
- const newFormFields = applyDefaults(defaultFormFields, customFormFields);
955
- this.formFields = sortFormFields(newFormFields);
1160
+ onInput(event) {
1161
+ event.preventDefault();
1162
+ const { name, value } = event.target;
1163
+ this.authenticator.updateForm({ name, value });
1164
+ }
1165
+ onSubmit(event) {
1166
+ event.preventDefault();
1167
+ this.authenticator.submitForm(getFormDataFromEvent(event));
956
1168
  }
957
1169
  }
958
- BaseFormFieldsComponent.decorators = [
959
- { type: Component, args: [{
960
- selector: 'amplify-base-form-fields',
961
- template: "<ng-container *ngFor=\"let formField of formFields\">\n <amplify-form-field\n [name]=\"formField[0]\"\n [formField]=\"formField[1]\"\n ></amplify-form-field>\n</ng-container>\n"
962
- },] }
963
- ];
964
- BaseFormFieldsComponent.ctorParameters = () => [
965
- { type: AuthenticatorService }
966
- ];
967
- BaseFormFieldsComponent.propDecorators = {
968
- route: [{ type: Input }],
969
- display: [{ type: HostBinding, args: ['style.display',] }]
970
- };
1170
+ ConfirmVerifyUserComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ConfirmVerifyUserComponent, deps: [{ token: AuthenticatorService }], target: i0.ɵɵFactoryTarget.Component });
1171
+ ConfirmVerifyUserComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: ConfirmVerifyUserComponent, selector: "amplify-confirm-verify-user", inputs: { headerText: "headerText" }, host: { properties: { "attr.data-amplify-authenticator-confirmverifyuser": "this.dataAttr" } }, ngImport: i0, template: "<form data-amplify-form (input)=\"onInput($event)\" (submit)=\"onSubmit($event)\">\n <fieldset\n class=\"amplify-flex amplify-authenticator__column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-slot name=\"confirm-verify-user-header\" [context]=\"context\">\n <h3 class=\"amplify-heading amplify-heading--3\">{{ this.headerText }}</h3>\n </amplify-slot>\n <amplify-base-form-fields\n route=\"confirmVerifyUser\"\n ></amplify-base-form-fields>\n <button\n amplify-button\n variation=\"primary\"\n fullWidth=\"true\"\n type=\"submit\"\n [isDisabled]=\"authenticator.isPending\"\n >\n {{ submitText }}\n </button>\n\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"authenticator.skipVerification()\"\n >\n {{ skipText }}\n </button>\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n <amplify-slot name=\"confirm-verify-user-footer\" [context]=\"context\">\n </amplify-slot>\n</form>\n", components: [{ type: AmplifySlotComponent, selector: "amplify-slot", inputs: ["name", "context"] }, { type: BaseFormFieldsComponent, selector: "amplify-base-form-fields", inputs: ["route"] }, { type: ButtonComponent, selector: "button[amplify-button]", inputs: ["type", "fullWidth", "isDisabled", "size", "variation", "fontWeight"] }, { type: ErrorComponent, selector: "amplify-error" }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
1172
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: ConfirmVerifyUserComponent, decorators: [{
1173
+ type: Component,
1174
+ args: [{
1175
+ selector: 'amplify-confirm-verify-user',
1176
+ templateUrl: './amplify-confirm-verify-user.component.html',
1177
+ }]
1178
+ }], ctorParameters: function () { return [{ type: AuthenticatorService }]; }, propDecorators: { dataAttr: [{
1179
+ type: HostBinding,
1180
+ args: ['attr.data-amplify-authenticator-confirmverifyuser']
1181
+ }], headerText: [{
1182
+ type: Input
1183
+ }] } });
971
1184
 
972
- class ButtonComponent {
973
- constructor() {
974
- this.type = 'button';
975
- this.fullWidth = false;
976
- this.isDisabled = false;
977
- this.size = 'medium';
978
- this.variation = 'default';
979
- this.fontWeight = 'normal';
1185
+ const { getSignInTabText, getSignUpTabText } = authenticatorTextUtil;
1186
+ class AuthenticatorComponent {
1187
+ constructor(authenticator, contextService, changeDetector) {
1188
+ this.authenticator = authenticator;
1189
+ this.contextService = contextService;
1190
+ this.changeDetector = changeDetector;
1191
+ this.customComponentQuery = null;
1192
+ // translated texts
1193
+ this.signInTitle = getSignInTabText();
1194
+ this.signUpTitle = getSignUpTabText();
1195
+ this.hasInitialized = false;
1196
+ this.isHandlingHubEvent = false;
980
1197
  }
981
- get getDisabled() {
982
- return this.isDisabled ? '' : null;
1198
+ ngOnInit() {
1199
+ const { initialState, loginMechanisms, services, signUpAttributes, socialProviders, formFields, } = this;
1200
+ const { authService, initializeMachine } = this.authenticator;
1201
+ this.unsubscribeHub = listenToAuthHub(authService, (data, service) => __awaiter(this, void 0, void 0, function* () {
1202
+ yield defaultAuthHubHandler(data, service);
1203
+ /**
1204
+ * Hub events aren't properly caught by Angular, because they are
1205
+ * synchronous events. Angular tracks async network events and
1206
+ * html events, but not synchronous events like hub.
1207
+ *
1208
+ * On any notable hub events, we run change detection manually.
1209
+ */
1210
+ this.changeDetector.detectChanges();
1211
+ /**
1212
+ * Hub events that we handle can lead to multiple state changes:
1213
+ * e.g. `authenticated` -> `signOut` -> initialState.
1214
+ *
1215
+ * We want to ensure change detection runs all the way, until
1216
+ * we reach back to the initial state. Setting the below flag
1217
+ * to true to until we reach initial state.
1218
+ */
1219
+ this.isHandlingHubEvent = true;
1220
+ }));
1221
+ /**
1222
+ * Subscribes to state machine changes and sends INIT event
1223
+ * once machine reaches 'setup' state.
1224
+ */
1225
+ this.unsubscribeMachine = this.authenticator.subscribe(() => {
1226
+ const { route } = this.authenticator;
1227
+ if (this.isHandlingHubEvent) {
1228
+ this.changeDetector.detectChanges();
1229
+ const initialStateWithDefault = initialState !== null && initialState !== void 0 ? initialState : 'signIn';
1230
+ // We can stop manual change detection if we're back to the initial state
1231
+ if (route === initialStateWithDefault) {
1232
+ this.isHandlingHubEvent = false;
1233
+ }
1234
+ }
1235
+ if (!this.hasInitialized && route === 'setup') {
1236
+ initializeMachine({
1237
+ initialState,
1238
+ loginMechanisms,
1239
+ services,
1240
+ signUpAttributes,
1241
+ socialProviders,
1242
+ formFields,
1243
+ });
1244
+ this.hasInitialized = true;
1245
+ }
1246
+ }).unsubscribe;
1247
+ /**
1248
+ * handling translations after content init, because authenticator and its
1249
+ * translations might be initialized before the main app's `ngOnInit` is run.
1250
+ */
1251
+ this.signInTitle = getSignInTabText();
1252
+ this.signUpTitle = getSignUpTabText();
983
1253
  }
984
- get classNames() {
985
- let className = 'amplify-button';
986
- if (this.variation) {
987
- className += ` amplify-button--${this.variation}`;
988
- }
989
- if (this.size) {
990
- className += ` amplify-button--${this.size}`;
1254
+ /**
1255
+ * Lifecycle Methods
1256
+ */
1257
+ ngAfterContentInit() {
1258
+ this.contextService.customComponents = this.mapCustomComponents(this.customComponentQuery);
1259
+ }
1260
+ ngOnDestroy() {
1261
+ if (this.unsubscribeMachine)
1262
+ this.unsubscribeMachine();
1263
+ if (this.unsubscribeHub)
1264
+ this.unsubscribeHub();
1265
+ }
1266
+ /**
1267
+ * Class Functions
1268
+ */
1269
+ // context passed to "authenticated" slot
1270
+ get context() {
1271
+ return this.authenticator.slotContext;
1272
+ }
1273
+ get route() {
1274
+ return this.authenticator.route;
1275
+ }
1276
+ onTabChange() {
1277
+ const route = this.authenticator.route;
1278
+ if (route === 'signIn') {
1279
+ this.authenticator.toSignUp();
991
1280
  }
992
- if (this.fullWidth) {
993
- className += ` amplify-button--fullwidth`;
1281
+ else {
1282
+ this.authenticator.toSignIn();
994
1283
  }
995
- if (this.isDisabled) {
996
- className += ` amplify-button--disabled amplify-button--loading`;
1284
+ }
1285
+ hasTabs() {
1286
+ const { route } = this.authenticator;
1287
+ return route === 'signIn' || route === 'signUp';
1288
+ }
1289
+ hasRouteComponent() {
1290
+ const { route } = this.authenticator;
1291
+ switch (route) {
1292
+ case 'authenticated':
1293
+ case 'idle':
1294
+ case 'setup':
1295
+ case 'signOut':
1296
+ case 'transition':
1297
+ return false;
1298
+ default:
1299
+ return true;
997
1300
  }
998
- return className;
999
1301
  }
1000
- ngOnInit() {
1001
- this.typeAttr = this.type;
1002
- this.fullWidthAttr = this.fullWidth;
1003
- this.sizeAttr = this.size;
1004
- this.variationAttr = this.variation;
1005
- this.fontWeightAttr = this.fontWeight;
1302
+ mapCustomComponents(componentQuery) {
1303
+ if (!componentQuery)
1304
+ return {};
1305
+ const customComponents = {};
1306
+ componentQuery.forEach((component) => {
1307
+ customComponents[component.name] = component.template;
1308
+ });
1309
+ return customComponents;
1006
1310
  }
1007
1311
  }
1008
- ButtonComponent.decorators = [
1009
- { type: Component, args: [{
1010
- selector: 'button[amplify-button]',
1011
- template: "<ng-content></ng-content>\n"
1012
- },] }
1013
- ];
1014
- ButtonComponent.propDecorators = {
1015
- type: [{ type: Input }],
1016
- fullWidth: [{ type: Input }],
1017
- isDisabled: [{ type: Input }],
1018
- size: [{ type: Input }],
1019
- variation: [{ type: Input }],
1020
- fontWeight: [{ type: Input }],
1021
- typeAttr: [{ type: HostBinding, args: ['type',] }],
1022
- fullWidthAttr: [{ type: HostBinding, args: ['attr.data-fullwidth',] }],
1023
- sizeAttr: [{ type: HostBinding, args: ['attr.data-size',] }],
1024
- variationAttr: [{ type: HostBinding, args: ['attr.data-variation',] }],
1025
- fontWeightAttr: [{ type: HostBinding, args: ['style.font-weight',] }],
1026
- getDisabled: [{ type: HostBinding, args: ['attr.disabled',] }],
1027
- classNames: [{ type: HostBinding, args: ['class',] }]
1028
- };
1312
+ AuthenticatorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: AuthenticatorComponent, deps: [{ token: AuthenticatorService }, { token: CustomComponentsService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1313
+ AuthenticatorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: AuthenticatorComponent, selector: "amplify-authenticator", inputs: { formFields: "formFields", initialState: "initialState", loginMechanisms: "loginMechanisms", services: "services", signUpAttributes: "signUpAttributes", socialProviders: "socialProviders", variation: "variation", hideSignUp: "hideSignUp" }, providers: [CustomComponentsService], queries: [{ propertyName: "customComponentQuery", predicate: AmplifySlotDirective }], ngImport: i0, template: "<div\n data-amplify-authenticator\n [attr.data-variation]=\"variation\"\n *ngIf=\"hasRouteComponent()\"\n>\n <div data-amplify-container>\n <amplify-slot name=\"header\" [context]=\"context\"></amplify-slot>\n <div\n data-amplify-router\n [attr.data-amplify-router-content]=\"hasTabs() ? undefined : ''\"\n >\n <amplify-tabs\n (tabChange)=\"onTabChange()\"\n *ngIf=\"(route === 'signIn' || route === 'signUp') && !hideSignUp\"\n >\n <amplify-tab-item\n [title]=\"signInTitle\"\n [active]=\"route === 'signIn'\"\n data-amplify-router-content\n >\n <!-- signIn component -->\n <amplify-slot\n name=\"sign-in\"\n [context]=\"context\"\n *ngIf=\"route === 'signIn'\"\n >\n <amplify-sign-in></amplify-sign-in>\n </amplify-slot>\n </amplify-tab-item>\n <amplify-tab-item\n [title]=\"signUpTitle\"\n [active]=\"route === 'signUp'\"\n data-amplify-router-content\n >\n <!-- signUp component -->\n <amplify-slot\n name=\"sign-up\"\n [context]=\"context\"\n *ngIf=\"route === 'signUp'\"\n >\n <amplify-sign-up></amplify-sign-up>\n </amplify-slot>\n </amplify-tab-item>\n </amplify-tabs>\n\n <amplify-slot\n name=\"sign-in\"\n [context]=\"context\"\n *ngIf=\"route === 'signIn' && hideSignUp\"\n >\n <amplify-sign-in></amplify-sign-in>\n </amplify-slot>\n\n <!-- confirmSignUp content -->\n <amplify-slot\n name=\"confirm-sign-up\"\n [context]=\"context\"\n *ngIf=\"route === 'confirmSignUp'\"\n >\n <amplify-confirm-sign-up></amplify-confirm-sign-up>\n </amplify-slot>\n\n <!-- confirmSignIn content -->\n <amplify-slot\n name=\"confirm-sign-in\"\n [context]=\"context\"\n *ngIf=\"route === 'confirmSignIn'\"\n >\n <amplify-confirm-sign-in></amplify-confirm-sign-in>\n </amplify-slot>\n\n <!-- setupTotp content -->\n <amplify-slot\n name=\"setup-totp\"\n [context]=\"context\"\n *ngIf=\"route === 'setupTOTP'\"\n >\n <amplify-setup-totp></amplify-setup-totp>\n </amplify-slot>\n\n <!-- forceNewPassword content -->\n <amplify-slot\n name=\"force-new-password\"\n [context]=\"context\"\n *ngIf=\"route === 'forceNewPassword'\"\n >\n <amplify-force-new-password></amplify-force-new-password>\n </amplify-slot>\n\n <!-- resetPassword content -->\n <amplify-slot\n name=\"reset-password\"\n [context]=\"context\"\n *ngIf=\"route === 'resetPassword'\"\n >\n <amplify-reset-password></amplify-reset-password>\n </amplify-slot>\n\n <!-- confirmResetPassword content -->\n <amplify-slot\n name=\"confirm-reset-password\"\n [context]=\"context\"\n *ngIf=\"route === 'confirmResetPassword'\"\n >\n <amplify-confirm-reset-password></amplify-confirm-reset-password>\n </amplify-slot>\n\n <!-- verifyUser content -->\n <amplify-slot\n name=\"verify-user\"\n [context]=\"context\"\n *ngIf=\"route === 'verifyUser'\"\n >\n <amplify-verify-user></amplify-verify-user>\n </amplify-slot>\n\n <!-- confirmVerifyUser content -->\n <amplify-slot\n name=\"confirm-verify-user\"\n [context]=\"context\"\n *ngIf=\"route === 'confirmVerifyUser'\"\n >\n <amplify-confirm-verify-user></amplify-confirm-verify-user>\n </amplify-slot>\n </div>\n\n <amplify-slot name=\"footer\" [context]=\"context\"></amplify-slot>\n </div>\n</div>\n\n<!-- signedIn content is rendered outside authenticator so it's not styled by authenticator -->\n<amplify-slot\n name=\"authenticated\"\n [context]=\"context\"\n *ngIf=\"route === 'authenticated'\"\n>\n <ng-content></ng-content>\n</amplify-slot>\n", components: [{ type: AmplifySlotComponent, selector: "amplify-slot", inputs: ["name", "context"] }, { type: TabsComponent, selector: "amplify-tabs", outputs: ["tabChange"] }, { type: TabItemComponent, selector: "amplify-tab-item", inputs: ["title", "active", "id", "labelledById", "tabIndex"] }, { type: SignInComponent, selector: "amplify-sign-in" }, { type: SignUpComponent, selector: "amplify-sign-up" }, { type: ConfirmSignUpComponent, selector: "amplify-confirm-sign-up" }, { type: ConfirmSignInComponent, selector: "amplify-confirm-sign-in" }, { type: SetupTotpComponent, selector: "amplify-setup-totp" }, { type: ForceNewPasswordComponent, selector: "amplify-force-new-password", inputs: ["headerText"] }, { type: ResetPasswordComponent, selector: "amplify-reset-password", inputs: ["headerText"] }, { type: ConfirmResetPasswordComponent, selector: "amplify-confirm-reset-password", inputs: ["headerText"] }, { type: VerifyUserComponent, selector: "amplify-verify-user", inputs: ["headerText"] }, { type: ConfirmVerifyUserComponent, selector: "amplify-confirm-verify-user", inputs: ["headerText"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], encapsulation: i0.ViewEncapsulation.None });
1314
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: AuthenticatorComponent, decorators: [{
1315
+ type: Component,
1316
+ args: [{
1317
+ selector: 'amplify-authenticator',
1318
+ templateUrl: './authenticator.component.html',
1319
+ providers: [CustomComponentsService],
1320
+ encapsulation: ViewEncapsulation.None,
1321
+ }]
1322
+ }], ctorParameters: function () { return [{ type: AuthenticatorService }, { type: CustomComponentsService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { formFields: [{
1323
+ type: Input
1324
+ }], initialState: [{
1325
+ type: Input
1326
+ }], loginMechanisms: [{
1327
+ type: Input
1328
+ }], services: [{
1329
+ type: Input
1330
+ }], signUpAttributes: [{
1331
+ type: Input
1332
+ }], socialProviders: [{
1333
+ type: Input
1334
+ }], variation: [{
1335
+ type: Input
1336
+ }], hideSignUp: [{
1337
+ type: Input
1338
+ }], customComponentQuery: [{
1339
+ type: ContentChildren,
1340
+ args: [AmplifySlotDirective]
1341
+ }] } });
1029
1342
 
1030
1343
  class CheckboxComponent {
1031
1344
  constructor() {
@@ -1042,313 +1355,109 @@ class CheckboxComponent {
1042
1355
  this.isChecked = !this.isChecked;
1043
1356
  }
1044
1357
  }
1045
- CheckboxComponent.decorators = [
1046
- { type: Component, args: [{
1047
- selector: 'amplify-checkbox',
1048
- template: "<div class=\"amplify-flex amplify-field amplify-checkboxfield\">\n <label class=\"amplify-flex amplify-checkbox\">\n <span class=\"amplify-visually-hidden\">\n <input\n (click)=\"handleClick()\"\n class=\"\n amplify-input\n amplify-field-group__control\n amplify-checkbox__input\n \"\n aria-invalid=\"false\"\n type=\"checkbox\"\n [name]=\"name\"\n [value]=\"value\"\n />\n </span>\n <span\n class=\"amplify-flex amplify-checkbox__button\"\n aria-hidden=\"true\"\n data-focus=\"false\"\n [ngClass]=\"{\n 'amplify-checkbox__button--error': hasError\n }\"\n [attr.data-error]=\"hasError\"\n [attr.data-checked]=\"isChecked\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"amplify-icon amplify-checkbox__icon\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n [attr.data-checked]=\"isChecked\"\n [ngClass]=\"{\n 'amplify-checkbox__icon--checked': isChecked\n }\"\n >\n <path d=\"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z\"></path>\n </svg>\n </span>\n <span class=\"amplify-text amplify-checkbox__label\">\n <ng-content></ng-content>\n </span>\n </label>\n <p *ngIf=\"hasError\" class=\"amplify-text amplify-field__error-message\">\n {{ errorMessage }}\n </p>\n</div>\n"
1049
- },] }
1050
- ];
1051
- CheckboxComponent.propDecorators = {
1052
- defaultChecked: [{ type: Input }],
1053
- errorMessage: [{ type: Input }],
1054
- hasError: [{ type: Input }],
1055
- label: [{ type: Input }],
1056
- name: [{ type: Input }],
1057
- value: [{ type: Input }]
1058
- };
1059
-
1060
- class ErrorComponent {
1061
- constructor() {
1062
- this.isVisible = true;
1063
- this.dismissAriaLabel = translate('Dismiss alert');
1064
- }
1065
- close() {
1066
- this.isVisible = false;
1067
- }
1068
- }
1069
- ErrorComponent.decorators = [
1070
- { type: Component, args: [{
1071
- selector: 'amplify-error',
1072
- template: "<div\n class=\"amplify-flex amplify-alert amplify-alert--error\"\n data-variation=\"error\"\n style=\"align-items: center; justify-content: space-between\"\n *ngIf=\"isVisible\"\n role=\"alert\"\n>\n <div class=\"amplify-flex\" style=\"align-items: center\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"amplify-icon\"\n [attr.aria-hidden]=\"true\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n >\n <path\n d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z\"\n ></path>\n </svg>\n <div><ng-content></ng-content></div>\n </div>\n <button\n amplify-button\n class=\"amplify-field-group__control amplify-alert__dismiss\"\n [attr.aria-label]=\"dismissAriaLabel\"\n variation=\"link\"\n [fullWidth]=\"false\"\n (click)=\"close()\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"amplify-icon\"\n [attr.aria-hidden]=\"true\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n >\n <path\n d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"\n ></path>\n </svg>\n </button>\n</div>\n"
1073
- },] }
1074
- ];
1075
-
1076
- class PasswordFieldComponent {
1077
- constructor() {
1078
- this.autocomplete = 'new-password';
1079
- this.disabled = false;
1080
- this.fieldId = `amplify-field-${nanoid(12)}`;
1081
- this.initialValue = '';
1082
- this.label = '';
1083
- this.placeholder = '';
1084
- this.required = true;
1085
- this.labelHidden = false;
1086
- this.setBlur = new EventEmitter();
1087
- this.type = 'password';
1088
- this.showPassword = false;
1089
- this.showPasswordButtonlabel = translate('Show password');
1090
- }
1091
- togglePasswordText() {
1092
- this.showPassword = !this.showPassword;
1093
- this.showPasswordButtonlabel = this.showPassword
1094
- ? translate('Show password')
1095
- : translate('Hide password');
1096
- this.type = this.showPassword ? 'text' : 'password';
1097
- }
1098
- }
1099
- PasswordFieldComponent.decorators = [
1100
- { type: Component, args: [{
1101
- selector: 'amplify-password-field',
1102
- template: "<label\n class=\"amplify-label\"\n [class.amplify-visually-hidden]=\"labelHidden\"\n [for]=\"fieldId\"\n>\n {{ label }}\n</label>\n<div class=\"amplify-flex amplify-field-group\">\n <input\n class=\"amplify-input amplify-field-group__control\"\n [id]=\"fieldId\"\n [type]=\"type\"\n [name]=\"name\"\n [placeholder]=\"placeholder\"\n [required]=\"required\"\n [value]=\"initialValue\"\n [autocomplete]=\"autocomplete\"\n [attr.disabled]=\"disabled ? '' : null\"\n [attr.aria-invalid]=\"hasError ? 'true' : 'false'\"\n [attr.aria-describedby]=\"describedBy\"\n (blur)=\"setBlur.emit($event)\"\n />\n <div class=\"amplify-field-group__outer-end\">\n <button\n amplify-button\n [attr.aria-label]=\"showPasswordButtonlabel\"\n class=\"amplify-field-group__control amplify-field__show-password\"\n (click)=\"togglePasswordText()\"\n >\n <svg\n *ngIf=\"!showPassword\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n viewBox=\"0 0 24 24\"\n class=\"amplify-icon\"\n >\n <path\n d=\"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z\"\n ></path>\n </svg>\n <svg\n *ngIf=\"showPassword\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n viewBox=\"0 0 24 24\"\n class=\"amplify-icon\"\n >\n <path\n d=\"M0 0h24v24H0zm0 0h24v24H0zm0 0h24v24H0zm0 0h24v24H0z\"\n fill=\"none\"\n ></path>\n <path\n d=\"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z\"\n ></path>\n </svg>\n </button>\n </div>\n</div>\n"
1103
- },] }
1104
- ];
1105
- PasswordFieldComponent.propDecorators = {
1106
- autocomplete: [{ type: Input }],
1107
- disabled: [{ type: Input }],
1108
- fieldId: [{ type: Input }],
1109
- initialValue: [{ type: Input }],
1110
- label: [{ type: Input }],
1111
- name: [{ type: Input }],
1112
- placeholder: [{ type: Input }],
1113
- required: [{ type: Input }],
1114
- labelHidden: [{ type: Input }],
1115
- hasError: [{ type: Input }],
1116
- describedBy: [{ type: Input }],
1117
- setBlur: [{ type: Output }]
1118
- };
1119
-
1120
- class PhoneNumberFieldComponent {
1121
- constructor() {
1122
- this.autocomplete = 'new-password';
1123
- this.disabled = false;
1124
- this.selectFieldId = `amplify-field-${nanoid(12)}`;
1125
- this.textFieldId = `amplify-field-${nanoid(12)}`;
1126
- this.initialValue = '';
1127
- this.label = '';
1128
- this.placeholder = '';
1129
- this.required = true;
1130
- this.labelHidden = false;
1131
- this.display = 'contents';
1132
- }
1133
- ngOnInit() {
1134
- var _a;
1135
- this.countryDialCodesValues = (_a = this.dialCodeList) !== null && _a !== void 0 ? _a : countryDialCodes;
1136
- }
1137
- }
1138
- PhoneNumberFieldComponent.decorators = [
1139
- { type: Component, args: [{
1140
- selector: 'amplify-phone-number-field',
1141
- template: "<label\n class=\"amplify-label\"\n [class.amplify-visually-hidden]=\"labelHidden\"\n [for]=\"textFieldId\"\n>\n {{ label }}\n</label>\n<div\n class=\"amplify-flex amplify-phonenumberfield\"\n amplify-field-group\n style=\"gap: 0px\"\n>\n <div class=\"amplify-field-group__outer-start\">\n <div\n class=\"\n amplify-flex\n amplify-field\n amplify-selectfield\n amplify-countrycodeselect\n amplify-dialcodeselect\n \"\n style=\"flex-direction: column\"\n >\n <amplify-form-select\n name=\"country_code\"\n label=\"Country Code\"\n [id]=\"selectFieldId\"\n [items]=\"countryDialCodesValues\"\n [defaultValue]=\"defaultCountryCode\"\n ></amplify-form-select>\n </div>\n </div>\n\n <input\n class=\"amplify-input\"\n [id]=\"textFieldId\"\n [type]=\"type\"\n [name]=\"name\"\n [placeholder]=\"placeholder\"\n [required]=\"required\"\n [value]=\"initialValue\"\n [autocomplete]=\"autocomplete\"\n [attr.disabled]=\"disabled ? '' : null\"\n [attr.aria-invalid]=\"hasError ? 'true' : 'false'\"\n [attr.aria-describedby]=\"describedBy\"\n />\n</div>\n"
1142
- },] }
1143
- ];
1144
- PhoneNumberFieldComponent.propDecorators = {
1145
- autocomplete: [{ type: Input }],
1146
- disabled: [{ type: Input }],
1147
- defaultCountryCode: [{ type: Input }],
1148
- selectFieldId: [{ type: Input }],
1149
- textFieldId: [{ type: Input }],
1150
- initialValue: [{ type: Input }],
1151
- label: [{ type: Input }],
1152
- name: [{ type: Input }],
1153
- placeholder: [{ type: Input }],
1154
- required: [{ type: Input }],
1155
- type: [{ type: Input }],
1156
- labelHidden: [{ type: Input }],
1157
- dialCodeList: [{ type: Input }],
1158
- hasError: [{ type: Input }],
1159
- describedBy: [{ type: Input }],
1160
- display: [{ type: HostBinding, args: ['style.display',] }]
1161
- };
1162
-
1163
- class SelectComponent {
1164
- }
1165
- SelectComponent.decorators = [
1166
- { type: Component, args: [{
1167
- selector: 'amplify-form-select',
1168
- template: "<label class=\"amplify-label amplify-visually-hidden\" [for]=\"id\">{{\n label\n}}</label>\n<div class=\"amplify-select__wrapper\">\n <select\n class=\"amplify-select amplify-field-group__control\"\n autocomplete=\"tel-country-code\"\n [id]=\"id\"\n [name]=\"name\"\n >\n <option\n *ngFor=\"let item of items\"\n [value]=\"item\"\n [selected]=\"item === defaultValue\"\n >\n {{ item }}\n </option>\n </select>\n <div\n class=\"amplify-flex amplify-select__icon-wrapper\"\n style=\"align-items: center; justify-content: center\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"amplify-icon amplify-icon--large\"\n viewBox=\"0 0 24 24\"\n data-size=\"large\"\n fill=\"currentColor\"\n >\n <path d=\"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z\"></path>\n </svg>\n </div>\n</div>\n"
1169
- },] }
1170
- ];
1171
- SelectComponent.propDecorators = {
1172
- items: [{ type: Input }],
1173
- name: [{ type: Input }],
1174
- label: [{ type: Input }],
1175
- id: [{ type: Input }],
1176
- defaultValue: [{ type: Input }]
1177
- };
1178
-
1179
- class TabItemComponent {
1180
- constructor() {
1181
- this.active = false;
1182
- this.display = 'block'; // emulate div behavior
1183
- }
1184
- }
1185
- TabItemComponent.decorators = [
1186
- { type: Component, args: [{
1187
- selector: 'amplify-tab-item',
1188
- template: "<div\n data-orientation=\"horizontal\"\n role=\"tabpanel\"\n [id]=\"id\"\n [attr.aria-labelledby]=\"labelledById\"\n [attr.data-state]=\"active ? 'active' : 'inactive'\"\n [attr.tabindex]=\"tabIndex\"\n>\n <ng-content *ngIf=\"active\"></ng-content>\n</div>\n"
1189
- },] }
1190
- ];
1191
- TabItemComponent.propDecorators = {
1192
- title: [{ type: Input }],
1193
- active: [{ type: Input }],
1194
- id: [{ type: Input }],
1195
- labelledById: [{ type: Input }],
1196
- tabIndex: [{ type: Input }],
1197
- display: [{ type: HostBinding, args: ['style.display',] }]
1198
- };
1199
-
1200
- class TabsComponent {
1201
- constructor() {
1202
- this.tabChange = new EventEmitter();
1203
- }
1204
- ngAfterContentInit() {
1205
- // assign ids
1206
- this.tabs.forEach((tab, index) => {
1207
- tab.id = `radix-id-${nanoid(12)}-1-content-${index}`;
1208
- tab.labelledById = `radix-id-${nanoid(12)}-1-trigger-${index}`;
1209
- });
1210
- // find active tab
1211
- // TODO(enhancement): more declarative way for choosing the initial tab to render
1212
- const activeTabs = this.tabs.filter((tab) => tab.active);
1213
- // set active tab
1214
- if (activeTabs.length !== 1) {
1215
- this.selectTab(this.tabs.first);
1216
- }
1217
- }
1218
- selectTab(tab) {
1219
- this.tabs.forEach((tab) => {
1220
- tab.active = false;
1221
- });
1222
- tab.active = true;
1223
- }
1224
- handleTabClick(tab) {
1225
- if (tab.active)
1226
- return; // don't do anything if clicks the current active tab
1227
- this.tabChange.emit();
1228
- this.selectTab(tab);
1229
- }
1230
- }
1231
- TabsComponent.decorators = [
1232
- { type: Component, args: [{
1233
- selector: 'amplify-tabs',
1234
- template: "<div\n tabindex=\"0\"\n aria-orientation=\"horizontal\"\n data-orientation=\"horizontal\"\n role=\"tablist\"\n style=\"outline: none\"\n>\n <div\n class=\"amplify-flex amplify-tabs\"\n data-indicator-position=\"top\"\n style=\"gap: 0px; justify-content: center\"\n >\n <div\n *ngFor=\"let tab of tabs\"\n class=\"amplify-tabs-item\"\n data-spacing=\"equal\"\n data-orientation=\"horizontal\"\n role=\"tab\"\n [id]=\"tab.labelledById\"\n [tabindex]=\"tab.active ? '0' : '1'\"\n [attr.aria-selected]=\"tab.active\"\n [attr.aria-controls]=\"tab.id\"\n [attr.data-state]=\"tab.active ? 'active' : 'inactive'\"\n (click)=\"handleTabClick(tab)\"\n >\n {{ tab.title }}\n </div>\n </div>\n</div>\n\n<ng-content></ng-content>\n"
1235
- },] }
1236
- ];
1237
- TabsComponent.propDecorators = {
1238
- tabs: [{ type: ContentChildren, args: [TabItemComponent,] }],
1239
- tabChange: [{ type: Output }]
1240
- };
1241
-
1242
- class TextFieldComponent {
1243
- constructor() {
1244
- this.autocomplete = 'new-password';
1245
- this.disabled = false;
1246
- this.fieldId = `amplify-field-${nanoid(12)}`;
1247
- this.initialValue = '';
1248
- this.label = '';
1249
- this.placeholder = '';
1250
- this.required = true;
1251
- this.labelHidden = false;
1252
- this.display = 'contents';
1253
- }
1254
- }
1255
- TextFieldComponent.decorators = [
1256
- { type: Component, args: [{
1257
- selector: 'amplify-text-field',
1258
- template: "<label\n class=\"amplify-label\"\n [class.amplify-visually-hidden]=\"labelHidden\"\n [for]=\"fieldId\"\n>\n {{ label }}\n</label>\n<input\n class=\"amplify-input\"\n [id]=\"fieldId\"\n [type]=\"type\"\n [name]=\"name\"\n [placeholder]=\"placeholder\"\n [required]=\"required\"\n [value]=\"initialValue\"\n [autocomplete]=\"autocomplete\"\n [attr.disabled]=\"disabled ? '' : null\"\n [attr.aria-invalid]=\"hasError ? 'true' : 'false'\"\n [attr.aria-describedby]=\"describedBy\"\n/>\n"
1259
- },] }
1260
- ];
1261
- TextFieldComponent.propDecorators = {
1262
- autocomplete: [{ type: Input }],
1263
- disabled: [{ type: Input }],
1264
- fieldId: [{ type: Input }],
1265
- initialValue: [{ type: Input }],
1266
- label: [{ type: Input }],
1267
- name: [{ type: Input }],
1268
- placeholder: [{ type: Input }],
1269
- required: [{ type: Input }],
1270
- type: [{ type: Input }],
1271
- labelHidden: [{ type: Input }],
1272
- hasError: [{ type: Input }],
1273
- describedBy: [{ type: Input }],
1274
- display: [{ type: HostBinding, args: ['style.display',] }]
1275
- };
1276
-
1277
- class AmplifySlotComponent {
1278
- constructor(propService) {
1279
- this.propService = propService;
1280
- this.display = 'contents';
1281
- this.isOverriden = false;
1282
- }
1283
- ngAfterContentInit() {
1284
- const customComponents = this.propService.customComponents;
1285
- const overridingComponent = customComponents[this.name];
1286
- if (overridingComponent) {
1287
- this.overridingComponent = overridingComponent;
1288
- this.isOverriden = true;
1289
- }
1290
- }
1291
- }
1292
- AmplifySlotComponent.decorators = [
1293
- { type: Component, args: [{
1294
- selector: 'amplify-slot',
1295
- template: "<!-- \n if slot isn't overwritten, we display the the default coponent, which is the \n children passed onto this component.\n-->\n<ng-content *ngIf=\"!isOverriden\"></ng-content>\n\n<!-- If slot is overwritten, we render that instead. -->\n<ng-container\n *ngIf=\"isOverriden\"\n [ngTemplateOutlet]=\"overridingComponent\"\n [ngTemplateOutletContext]=\"context\"\n></ng-container>\n"
1296
- },] }
1297
- ];
1298
- AmplifySlotComponent.ctorParameters = () => [
1299
- { type: CustomComponentsService }
1300
- ];
1301
- AmplifySlotComponent.propDecorators = {
1302
- name: [{ type: Input }],
1303
- context: [{ type: Input }],
1304
- display: [{ type: HostBinding, args: ['style.display',] }]
1305
- };
1358
+ CheckboxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1359
+ CheckboxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: CheckboxComponent, selector: "amplify-checkbox", inputs: { defaultChecked: "defaultChecked", errorMessage: "errorMessage", hasError: "hasError", label: "label", name: "name", value: "value" }, ngImport: i0, template: "<div class=\"amplify-flex amplify-field amplify-checkboxfield\">\n <label class=\"amplify-flex amplify-checkbox\">\n <span class=\"amplify-visually-hidden\">\n <input\n (click)=\"handleClick()\"\n class=\"\n amplify-input\n amplify-field-group__control\n amplify-checkbox__input\n \"\n aria-invalid=\"false\"\n type=\"checkbox\"\n [name]=\"name\"\n [value]=\"value\"\n />\n </span>\n <span\n class=\"amplify-flex amplify-checkbox__button\"\n aria-hidden=\"true\"\n data-focus=\"false\"\n [ngClass]=\"{\n 'amplify-checkbox__button--error': hasError\n }\"\n [attr.data-error]=\"hasError\"\n [attr.data-checked]=\"isChecked\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"amplify-icon amplify-checkbox__icon\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n [attr.data-checked]=\"isChecked\"\n [ngClass]=\"{\n 'amplify-checkbox__icon--checked': isChecked\n }\"\n >\n <path d=\"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z\"></path>\n </svg>\n </span>\n <span class=\"amplify-text amplify-checkbox__label\">\n <ng-content></ng-content>\n </span>\n </label>\n <p *ngIf=\"hasError\" class=\"amplify-text amplify-field__error-message\">\n {{ errorMessage }}\n </p>\n</div>\n", directives: [{ type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
1360
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: CheckboxComponent, decorators: [{
1361
+ type: Component,
1362
+ args: [{
1363
+ selector: 'amplify-checkbox',
1364
+ templateUrl: './checkbox.component.html',
1365
+ }]
1366
+ }], propDecorators: { defaultChecked: [{
1367
+ type: Input
1368
+ }], errorMessage: [{
1369
+ type: Input
1370
+ }], hasError: [{
1371
+ type: Input
1372
+ }], label: [{
1373
+ type: Input
1374
+ }], name: [{
1375
+ type: Input
1376
+ }], value: [{
1377
+ type: Input
1378
+ }] } });
1306
1379
 
1307
1380
  class AmplifyAuthenticatorModule {
1308
1381
  }
1309
- AmplifyAuthenticatorModule.decorators = [
1310
- { type: NgModule, args: [{
1311
- declarations: [
1312
- AmplifySlotComponent,
1313
- AmplifySlotDirective,
1314
- AuthenticatorComponent,
1315
- BaseFormFieldsComponent,
1316
- ButtonComponent,
1317
- CheckboxComponent,
1318
- ConfirmResetPasswordComponent,
1319
- ConfirmSignInComponent,
1320
- ConfirmSignUpComponent,
1321
- ConfirmVerifyUserComponent,
1322
- ErrorComponent,
1323
- FederatedSignInButtonComponent,
1324
- FederatedSignInComponent,
1325
- ForceNewPasswordComponent,
1326
- ForceNewPasswordFormFieldsComponent,
1327
- FormFieldComponent,
1328
- PasswordFieldComponent,
1329
- PhoneNumberFieldComponent,
1330
- ResetPasswordComponent,
1331
- SelectComponent,
1332
- SetupTotpComponent,
1333
- SignInComponent,
1334
- SignUpComponent,
1335
- SignUpFormFieldsComponent,
1336
- TabItemComponent,
1337
- TabsComponent,
1338
- TextFieldComponent,
1339
- VerifyUserComponent,
1340
- ],
1341
- imports: [CommonModule],
1342
- exports: [
1343
- AmplifySlotDirective,
1344
- AuthenticatorComponent,
1345
- CheckboxComponent,
1346
- SignUpFormFieldsComponent,
1347
- ForceNewPasswordFormFieldsComponent,
1348
- TextFieldComponent,
1349
- ],
1350
- },] }
1351
- ];
1382
+ AmplifyAuthenticatorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: AmplifyAuthenticatorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1383
+ AmplifyAuthenticatorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: AmplifyAuthenticatorModule, declarations: [AmplifySlotComponent,
1384
+ AmplifySlotDirective,
1385
+ AuthenticatorComponent,
1386
+ BaseFormFieldsComponent,
1387
+ ButtonComponent,
1388
+ CheckboxComponent,
1389
+ ConfirmResetPasswordComponent,
1390
+ ConfirmSignInComponent,
1391
+ ConfirmSignUpComponent,
1392
+ ConfirmVerifyUserComponent,
1393
+ ErrorComponent,
1394
+ FederatedSignInButtonComponent,
1395
+ FederatedSignInComponent,
1396
+ ForceNewPasswordComponent,
1397
+ ForceNewPasswordFormFieldsComponent,
1398
+ FormFieldComponent,
1399
+ PasswordFieldComponent,
1400
+ PhoneNumberFieldComponent,
1401
+ ResetPasswordComponent,
1402
+ SelectComponent,
1403
+ SetupTotpComponent,
1404
+ SignInComponent,
1405
+ SignUpComponent,
1406
+ SignUpFormFieldsComponent,
1407
+ TabItemComponent,
1408
+ TabsComponent,
1409
+ TextFieldComponent,
1410
+ VerifyUserComponent], imports: [CommonModule], exports: [AmplifySlotDirective,
1411
+ AuthenticatorComponent,
1412
+ CheckboxComponent,
1413
+ SignUpFormFieldsComponent,
1414
+ ForceNewPasswordFormFieldsComponent,
1415
+ TextFieldComponent] });
1416
+ AmplifyAuthenticatorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: AmplifyAuthenticatorModule, imports: [[CommonModule]] });
1417
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: AmplifyAuthenticatorModule, decorators: [{
1418
+ type: NgModule,
1419
+ args: [{
1420
+ declarations: [
1421
+ AmplifySlotComponent,
1422
+ AmplifySlotDirective,
1423
+ AuthenticatorComponent,
1424
+ BaseFormFieldsComponent,
1425
+ ButtonComponent,
1426
+ CheckboxComponent,
1427
+ ConfirmResetPasswordComponent,
1428
+ ConfirmSignInComponent,
1429
+ ConfirmSignUpComponent,
1430
+ ConfirmVerifyUserComponent,
1431
+ ErrorComponent,
1432
+ FederatedSignInButtonComponent,
1433
+ FederatedSignInComponent,
1434
+ ForceNewPasswordComponent,
1435
+ ForceNewPasswordFormFieldsComponent,
1436
+ FormFieldComponent,
1437
+ PasswordFieldComponent,
1438
+ PhoneNumberFieldComponent,
1439
+ ResetPasswordComponent,
1440
+ SelectComponent,
1441
+ SetupTotpComponent,
1442
+ SignInComponent,
1443
+ SignUpComponent,
1444
+ SignUpFormFieldsComponent,
1445
+ TabItemComponent,
1446
+ TabsComponent,
1447
+ TextFieldComponent,
1448
+ VerifyUserComponent,
1449
+ ],
1450
+ imports: [CommonModule],
1451
+ exports: [
1452
+ AmplifySlotDirective,
1453
+ AuthenticatorComponent,
1454
+ CheckboxComponent,
1455
+ SignUpFormFieldsComponent,
1456
+ ForceNewPasswordFormFieldsComponent,
1457
+ TextFieldComponent,
1458
+ ],
1459
+ }]
1460
+ }] });
1352
1461
 
1353
1462
  /*
1354
1463
  * Public API Surface of ui-angular
@@ -1358,5 +1467,5 @@ AmplifyAuthenticatorModule.decorators = [
1358
1467
  * Generated bundle index. Do not edit.
1359
1468
  */
1360
1469
 
1361
- export { AmplifyAuthenticatorModule, AmplifySlotDirective, AuthenticatorComponent, AuthenticatorService, BaseFormFieldsComponent, ButtonComponent, CheckboxComponent, ConfirmResetPasswordComponent, ConfirmSignInComponent, ConfirmSignUpComponent, ConfirmVerifyUserComponent, CustomComponentsService, ErrorComponent, FederatedSignInButtonComponent, FederatedSignInComponent, ForceNewPasswordComponent, ForceNewPasswordFormFieldsComponent, FormFieldComponent, PasswordFieldComponent, PhoneNumberFieldComponent, ResetPasswordComponent, SelectComponent, SetupTotpComponent, SignInComponent, SignUpComponent, SignUpFormFieldsComponent, TabItemComponent, TabsComponent, TextFieldComponent, VerifyUserComponent, getAttributeMap, AmplifySlotComponent as ɵa, AuthenticatorComponent as ɵb, VerifyUserComponent as ɵba, BaseFormFieldsComponent as ɵc, ButtonComponent as ɵd, CheckboxComponent as ɵe, ConfirmResetPasswordComponent as ɵf, ConfirmSignInComponent as ɵg, ConfirmSignUpComponent as ɵh, ConfirmVerifyUserComponent as ɵi, ErrorComponent as ɵj, FederatedSignInButtonComponent as ɵk, FederatedSignInComponent as ɵl, ForceNewPasswordComponent as ɵm, ForceNewPasswordFormFieldsComponent as ɵn, FormFieldComponent as ɵo, PasswordFieldComponent as ɵp, PhoneNumberFieldComponent as ɵq, ResetPasswordComponent as ɵr, SelectComponent as ɵs, SetupTotpComponent as ɵt, SignInComponent as ɵu, SignUpComponent as ɵv, SignUpFormFieldsComponent as ɵw, TabItemComponent as ɵx, TabsComponent as ɵy, TextFieldComponent as ɵz };
1470
+ export { AmplifyAuthenticatorModule, AmplifySlotDirective, AuthenticatorComponent, AuthenticatorService, BaseFormFieldsComponent, ButtonComponent, CheckboxComponent, ConfirmResetPasswordComponent, ConfirmSignInComponent, ConfirmSignUpComponent, ConfirmVerifyUserComponent, CustomComponentsService, ErrorComponent, FederatedSignInButtonComponent, FederatedSignInComponent, ForceNewPasswordComponent, ForceNewPasswordFormFieldsComponent, FormFieldComponent, PasswordFieldComponent, PhoneNumberFieldComponent, ResetPasswordComponent, SelectComponent, SetupTotpComponent, SignInComponent, SignUpComponent, SignUpFormFieldsComponent, TabItemComponent, TabsComponent, TextFieldComponent, VerifyUserComponent, getAttributeMap };
1362
1471
  //# sourceMappingURL=aws-amplify-ui-angular.js.map