@liquid-js/lyr-auth 0.0.0-stage → 22.0.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/LICENSE.txt +23 -0
  2. package/README.md +61 -2
  3. package/components/auth-block/_auth-block.component.theme.scss +17 -0
  4. package/components/auth-block/auth-block.component.scss +98 -0
  5. package/components/auth.component.html +22 -0
  6. package/components/auth.component.scss +54 -0
  7. package/components/login/login.component.html +154 -0
  8. package/components/logout/logout.component.html +1 -0
  9. package/components/register/register.component.html +212 -0
  10. package/components/register/register.component.scss +5 -0
  11. package/components/request-password/request-password.component.html +81 -0
  12. package/components/reset-password/reset-password.component.html +116 -0
  13. package/components/reset-password/reset-password.component.scss +5 -0
  14. package/fesm2022/liquid-js-lyr-auth.mjs +2900 -0
  15. package/fesm2022/liquid-js-lyr-auth.mjs.map +1 -0
  16. package/package.json +59 -3
  17. package/styles/_globals.scss +5 -0
  18. package/styles/global/_components.scss +6 -0
  19. package/styles/prebuilt/components-custom-properties.css +1 -0
  20. package/styles/prebuilt/components-custom-properties.scss +10 -0
  21. package/styles/prebuilt/corporate-custom-properties.css +1 -0
  22. package/styles/prebuilt/corporate-custom-properties.scss +2 -0
  23. package/styles/prebuilt/corporate.css +1 -0
  24. package/styles/prebuilt/corporate.scss +12 -0
  25. package/styles/prebuilt/cosmic-custom-properties.css +1 -0
  26. package/styles/prebuilt/cosmic-custom-properties.scss +2 -0
  27. package/styles/prebuilt/cosmic.css +1 -0
  28. package/styles/prebuilt/cosmic.scss +12 -0
  29. package/styles/prebuilt/dark-custom-properties.css +1 -0
  30. package/styles/prebuilt/dark-custom-properties.scss +2 -0
  31. package/styles/prebuilt/dark.css +1 -0
  32. package/styles/prebuilt/dark.scss +12 -0
  33. package/styles/prebuilt/default-custom-properties.css +1 -0
  34. package/styles/prebuilt/default-custom-properties.scss +2 -0
  35. package/styles/prebuilt/default.css +1 -0
  36. package/styles/prebuilt/default.scss +12 -0
  37. package/types/liquid-js-lyr-auth.d.ts +1236 -0
@@ -0,0 +1,2900 @@
1
+ import * as i0 from "@angular/core";
2
+ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, DestroyRef, InjectionToken, Injector, NgModule, PLATFORM_ID, Service, computed, inject, makeEnvironmentProviders, signal } from "@angular/core";
3
+ import { ActivatedRoute, Router, RouterLink, RouterModule, RouterOutlet } from "@angular/router";
4
+ import * as i1 from "@angular/forms";
5
+ import { FormsModule } from "@angular/forms";
6
+ import { NB_WINDOW, NbAlertComponent, NbAlertModule, NbButtonComponent, NbButtonModule, NbCardBodyComponent, NbCardComponent, NbCardHeaderComponent, NbCardModule, NbCheckboxComponent, NbCheckboxModule, NbIconComponent, NbIconModule, NbInputDirective, NbInputModule, NbLayoutColumnComponent, NbLayoutComponent, NbLayoutModule, injectNbTexts } from "@liquid-js/lyr-core";
7
+ import { BehaviorSubject, Subject, of } from "rxjs";
8
+ import { catchError, delay, filter, map, share, switchMap } from "rxjs/operators";
9
+ import { Location, isPlatformBrowser } from "@angular/common";
10
+ import { HttpClient, HttpErrorResponse, HttpHeaders, HttpResponse } from "@angular/common/http";
11
+ import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
12
+ const socialLinks = new Array();
13
+ const defaultAuthOptions = {
14
+ strategies: [],
15
+ forms: {
16
+ login: {
17
+ redirectDelay: 500,
18
+ strategy: "email",
19
+ rememberMe: true,
20
+ showMessages: {
21
+ success: true,
22
+ error: true
23
+ },
24
+ socialLinks
25
+ },
26
+ register: {
27
+ redirectDelay: 500,
28
+ strategy: "email",
29
+ showMessages: {
30
+ success: true,
31
+ error: true
32
+ },
33
+ terms: true,
34
+ socialLinks
35
+ },
36
+ requestPassword: {
37
+ redirectDelay: 500,
38
+ strategy: "email",
39
+ showMessages: {
40
+ success: true,
41
+ error: true
42
+ },
43
+ socialLinks
44
+ },
45
+ resetPassword: {
46
+ redirectDelay: 500,
47
+ strategy: "email",
48
+ showMessages: {
49
+ success: true,
50
+ error: true
51
+ },
52
+ socialLinks
53
+ },
54
+ logout: {
55
+ redirectDelay: 500,
56
+ strategy: "email"
57
+ },
58
+ validation: {
59
+ password: {
60
+ required: true,
61
+ minLength: 4,
62
+ maxLength: 50
63
+ },
64
+ email: { required: true },
65
+ fullName: {
66
+ required: false,
67
+ minLength: 4,
68
+ maxLength: 50
69
+ }
70
+ }
71
+ }
72
+ };
73
+ const NB_AUTH_OPTIONS = new InjectionToken("Lyra Auth Options");
74
+ const NB_AUTH_USER_OPTIONS = new InjectionToken("Lyra User Auth Options");
75
+ const NB_AUTH_STRATEGIES = new InjectionToken("Lyra Auth Strategies");
76
+ const NB_AUTH_TOKENS = new InjectionToken("Lyra Auth Tokens");
77
+ const NB_AUTH_INTERCEPTOR_HEADER = new InjectionToken("Lyra Simple Interceptor Header");
78
+ const NB_AUTH_TOKEN_INTERCEPTOR_FILTER = new InjectionToken("Lyra Interceptor Filter");
79
+ function isRecord(value) {
80
+ return typeof value === "object" && value !== null || typeof value === "function";
81
+ }
82
+ function deepExtend(...objects) {
83
+ const target = objects[0];
84
+ if (objects.length < 1 || typeof target !== "object" || !isRecord(target)) return false;
85
+ if (objects.length < 2) return target;
86
+ objects.slice(1).forEach((obj) => {
87
+ if (typeof obj !== "object" || obj === null || Array.isArray(obj)) return;
88
+ Object.entries(obj).forEach(([key, val]) => {
89
+ const src = target[key];
90
+ if (val === target) return;
91
+ else if (typeof val !== "object" || val === null) {
92
+ target[key] = val;
93
+ return;
94
+ } else if (Array.isArray(val)) {
95
+ target[key] = deepCloneArray(val);
96
+ return;
97
+ } else if (isSpecificValue(val)) {
98
+ target[key] = cloneSpecificValue(val);
99
+ return;
100
+ } else if (!isPlainObject(val)) {
101
+ target[key] = val;
102
+ return;
103
+ } else if (typeof src !== "object" || src === null || Array.isArray(src)) {
104
+ target[key] = deepExtend({}, val);
105
+ return;
106
+ } else {
107
+ target[key] = deepExtend(src, val);
108
+ return;
109
+ }
110
+ });
111
+ });
112
+ return target;
113
+ }
114
+ function isPlainObject(val) {
115
+ const prototype = Object.getPrototypeOf(val);
116
+ return prototype === Object.prototype || prototype === null;
117
+ }
118
+ function isSpecificValue(val) {
119
+ return val instanceof Date || val instanceof RegExp;
120
+ }
121
+ function cloneSpecificValue(val) {
122
+ if (val instanceof Date) return new Date(val.getTime());
123
+ else return new RegExp(val);
124
+ }
125
+ function deepCloneArray(arr) {
126
+ const clone = new Array();
127
+ arr.forEach((item, index) => {
128
+ if (typeof item === "object" && item !== null) {
129
+ if (Array.isArray(item)) clone[index] = deepCloneArray(item);
130
+ else if (isSpecificValue(item)) clone[index] = cloneSpecificValue(item);
131
+ else if (!isPlainObject(item)) clone[index] = item;
132
+ else clone[index] = deepExtend({}, item);
133
+ } else clone[index] = item;
134
+ });
135
+ return clone;
136
+ }
137
+ function getDeepFromObject(object = {}, name, defaultValue) {
138
+ const keys = name.split(".");
139
+ let level = deepExtend({}, object || {});
140
+ keys.forEach((k) => {
141
+ level = isRecord(level) ? level[k] : void 0;
142
+ });
143
+ return typeof level === "undefined" ? defaultValue : level;
144
+ }
145
+ function nbAuthMessages(value) {
146
+ return (Array.isArray(value) ? value : [value]).filter((message) => typeof message === "string");
147
+ }
148
+ function urlBase64Decode(str) {
149
+ let output = str.replace(/-/g, "+").replace(/_/g, "/");
150
+ switch (output.length % 4) {
151
+ case 0: break;
152
+ case 2:
153
+ output += "==";
154
+ break;
155
+ case 3:
156
+ output += "=";
157
+ break;
158
+ default: throw new Error("Illegal base64url string!");
159
+ }
160
+ return b64DecodeUnicode(output);
161
+ }
162
+ function b64decode(str) {
163
+ const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
164
+ let output = "";
165
+ str = String(str).replace(/=+$/, "");
166
+ if (str.length % 4 === 1) throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");
167
+ let bc = 0;
168
+ let bs = 0;
169
+ for (const char of str) {
170
+ const value = chars.indexOf(char);
171
+ if (value === -1) continue;
172
+ bs = bc % 4 ? bs * 64 + value : value;
173
+ if (bc++ % 4) output += String.fromCharCode(255 & bs >> (-2 * bc & 6));
174
+ }
175
+ return output;
176
+ }
177
+ function b64DecodeUnicode(str) {
178
+ return decodeURIComponent(Array.from(b64decode(str), (c) => "%" + ("00" + c.charCodeAt(0).toString(16)).slice(-2)).join(""));
179
+ }
180
+ var NbAuthToken = class {
181
+ getName() {
182
+ return this.constructor.NAME;
183
+ }
184
+ getPayload() {
185
+ return this.payload;
186
+ }
187
+ };
188
+ var NbAuthTokenNotFoundError = class extends Error {
189
+ constructor(message) {
190
+ super(message);
191
+ Object.setPrototypeOf(this, new.target.prototype);
192
+ }
193
+ };
194
+ var NbAuthIllegalTokenError = class extends Error {
195
+ constructor(message) {
196
+ super(message);
197
+ Object.setPrototypeOf(this, new.target.prototype);
198
+ }
199
+ };
200
+ var NbAuthEmptyTokenError = class extends NbAuthIllegalTokenError {
201
+ constructor(message) {
202
+ super(message);
203
+ Object.setPrototypeOf(this, new.target.prototype);
204
+ }
205
+ };
206
+ var NbAuthIllegalJWTTokenError = class extends NbAuthIllegalTokenError {
207
+ constructor(message) {
208
+ super(message);
209
+ Object.setPrototypeOf(this, new.target.prototype);
210
+ }
211
+ };
212
+ function nbAuthCreateToken(tokenClass, token, ownerStrategyName, createdAt) {
213
+ return new tokenClass(token, ownerStrategyName, createdAt);
214
+ }
215
+ function decodeJwtPayload(payload) {
216
+ if (payload.length === 0) throw new NbAuthEmptyTokenError("Cannot extract from an empty payload.");
217
+ const parts = payload.split(".");
218
+ if (parts.length !== 3) throw new NbAuthIllegalJWTTokenError(`The payload ${payload} is not valid JWT payload and must consist of three parts.`);
219
+ let decoded;
220
+ try {
221
+ decoded = urlBase64Decode(parts[1]);
222
+ } catch {
223
+ throw new NbAuthIllegalJWTTokenError(`The payload ${payload} is not valid JWT payload and cannot be parsed.`);
224
+ }
225
+ if (!decoded) throw new NbAuthIllegalJWTTokenError(`The payload ${payload} is not valid JWT payload and cannot be decoded.`);
226
+ return JSON.parse(decoded);
227
+ }
228
+ var NbAuthSimpleToken = class extends NbAuthToken {
229
+ static {
230
+ this.NAME = "nb:auth:simple:token";
231
+ }
232
+ constructor(token, ownerStrategyName, createdAt) {
233
+ super();
234
+ this.token = token;
235
+ this.ownerStrategyName = ownerStrategyName;
236
+ if (createdAt) this.createdAt = createdAt;
237
+ try {
238
+ this.parsePayload();
239
+ } catch (err) {
240
+ if (!(err instanceof NbAuthTokenNotFoundError)) throw err;
241
+ }
242
+ this.createdAt = this.prepareCreatedAt(createdAt);
243
+ }
244
+ parsePayload() {
245
+ this.payload = void 0;
246
+ }
247
+ prepareCreatedAt(date) {
248
+ return date ? date : /* @__PURE__ */ new Date();
249
+ }
250
+ getCreatedAt() {
251
+ return this.createdAt;
252
+ }
253
+ getValue() {
254
+ return typeof this.token === "string" ? this.token : "";
255
+ }
256
+ getOwnerStrategyName() {
257
+ return this.ownerStrategyName;
258
+ }
259
+ isValid() {
260
+ return !!this.getValue();
261
+ }
262
+ toString() {
263
+ return this.token ? String(this.token) : "";
264
+ }
265
+ };
266
+ var NbAuthJWTToken = class extends NbAuthSimpleToken {
267
+ static {
268
+ this.NAME = "nb:auth:jwt:token";
269
+ }
270
+ prepareCreatedAt(date) {
271
+ const decoded = this.getPayload();
272
+ return decoded && decoded.iat ? /* @__PURE__ */ new Date(Number(decoded.iat) * 1e3) : super.prepareCreatedAt(date);
273
+ }
274
+ parsePayload() {
275
+ if (!this.token) throw new NbAuthTokenNotFoundError("Token not found. ");
276
+ if (typeof this.token !== "string") throw new NbAuthIllegalJWTTokenError("The JWT token is not a string.");
277
+ this.payload = decodeJwtPayload(this.token);
278
+ }
279
+ getPayload() {
280
+ return this.payload;
281
+ }
282
+ getTokenExpDate() {
283
+ const decoded = this.getPayload();
284
+ if (decoded && !decoded.hasOwnProperty("exp")) return;
285
+ const date = /* @__PURE__ */ new Date(0);
286
+ date.setUTCSeconds(Number(decoded?.exp));
287
+ return date;
288
+ }
289
+ isValid() {
290
+ if (!super.isValid()) return false;
291
+ const expDate = this.getTokenExpDate();
292
+ return !expDate || /* @__PURE__ */ new Date() < expDate;
293
+ }
294
+ };
295
+ const prepareOAuth2Token = (data) => {
296
+ if (typeof data === "string") try {
297
+ return JSON.parse(data);
298
+ } catch {}
299
+ return data;
300
+ };
301
+ function isOAuth2TokenData(token) {
302
+ return typeof token === "object" && token !== null;
303
+ }
304
+ var NbAuthOAuth2Token = class extends NbAuthSimpleToken {
305
+ static {
306
+ this.NAME = "nb:auth:oauth2:token";
307
+ }
308
+ constructor(data = {}, ownerStrategyName, createdAt) {
309
+ super(prepareOAuth2Token(data), ownerStrategyName, createdAt);
310
+ }
311
+ get data() {
312
+ return isOAuth2TokenData(this.token) ? this.token : {};
313
+ }
314
+ getValue() {
315
+ return this.data.access_token ?? "";
316
+ }
317
+ getRefreshToken() {
318
+ return this.data.refresh_token ?? "";
319
+ }
320
+ setRefreshToken(refreshToken) {
321
+ this.data.refresh_token = refreshToken;
322
+ }
323
+ parsePayload() {
324
+ if (!this.token) throw new NbAuthTokenNotFoundError("Token not found.");
325
+ else if (!Object.keys(this.token).length) throw new NbAuthEmptyTokenError("Cannot extract payload from an empty token.");
326
+ this.payload = this.token;
327
+ }
328
+ getType() {
329
+ return this.data.token_type ?? "";
330
+ }
331
+ isValid() {
332
+ if (!super.isValid()) return false;
333
+ const expDate = this.getTokenExpDate();
334
+ return !expDate || /* @__PURE__ */ new Date() < expDate;
335
+ }
336
+ getTokenExpDate() {
337
+ const data = this.data;
338
+ if (!data.hasOwnProperty("expires_in")) return;
339
+ return new Date(this.createdAt.getTime() + Number(data.expires_in) * 1e3);
340
+ }
341
+ toString() {
342
+ return JSON.stringify(this.token);
343
+ }
344
+ };
345
+ var NbAuthOAuth2JWTToken = class extends NbAuthOAuth2Token {
346
+ static {
347
+ this.NAME = "nb:auth:oauth2:jwt:token";
348
+ }
349
+ parsePayload() {
350
+ super.parsePayload();
351
+ this.parseAccessTokenPayload();
352
+ }
353
+ parseAccessTokenPayload() {
354
+ const accessToken = this.getValue();
355
+ if (!accessToken) throw new NbAuthTokenNotFoundError("access_token key not found.");
356
+ this.accessTokenPayload = decodeJwtPayload(accessToken);
357
+ }
358
+ getAccessTokenPayload() {
359
+ return this.accessTokenPayload;
360
+ }
361
+ prepareCreatedAt(date) {
362
+ const payload = this.accessTokenPayload;
363
+ return payload && payload.iat ? /* @__PURE__ */ new Date(Number(payload.iat) * 1e3) : super.prepareCreatedAt(date);
364
+ }
365
+ isValid() {
366
+ return !!this.accessTokenPayload && super.isValid();
367
+ }
368
+ getTokenExpDate() {
369
+ if (this.accessTokenPayload && this.accessTokenPayload.hasOwnProperty("exp")) {
370
+ const date = /* @__PURE__ */ new Date(0);
371
+ date.setUTCSeconds(Number(this.accessTokenPayload.exp));
372
+ return date;
373
+ } else return super.getTokenExpDate();
374
+ }
375
+ };
376
+ const NB_AUTH_FALLBACK_TOKEN = new InjectionToken("Lyra Auth Options");
377
+ var NbAuthTokenParceler = class NbAuthTokenParceler {
378
+ constructor() {
379
+ this.fallbackClass = inject(NB_AUTH_FALLBACK_TOKEN);
380
+ this.tokenClasses = inject(NB_AUTH_TOKENS);
381
+ }
382
+ wrap(token) {
383
+ return JSON.stringify({
384
+ name: token.getName(),
385
+ ownerStrategyName: token.getOwnerStrategyName(),
386
+ createdAt: token.getCreatedAt().getTime(),
387
+ value: token.toString()
388
+ });
389
+ }
390
+ unwrap(value) {
391
+ let tokenClass = this.fallbackClass;
392
+ let tokenValue = "";
393
+ let tokenOwnerStrategyName = "";
394
+ let tokenCreatedAt;
395
+ const tokenPack = this.parseTokenPack(value);
396
+ if (tokenPack) {
397
+ tokenClass = this.getClassByName(tokenPack.name) || this.fallbackClass;
398
+ tokenValue = tokenPack.value;
399
+ tokenOwnerStrategyName = tokenPack.ownerStrategyName;
400
+ tokenCreatedAt = new Date(Number(tokenPack.createdAt));
401
+ }
402
+ return nbAuthCreateToken(tokenClass, tokenValue, tokenOwnerStrategyName, tokenCreatedAt);
403
+ }
404
+ getClassByName(name) {
405
+ return this.tokenClasses.find((tokenClass) => tokenClass.NAME === name);
406
+ }
407
+ parseTokenPack(value) {
408
+ if (value === void 0) return;
409
+ try {
410
+ return JSON.parse(value) ?? void 0;
411
+ } catch {}
412
+ }
413
+ static {
414
+ this.ɵfac = i0.ɵɵngDeclareFactory({
415
+ minVersion: "12.0.0",
416
+ version: "22.3.0",
417
+ ngImport: i0,
418
+ type: NbAuthTokenParceler,
419
+ deps: [],
420
+ target: i0.ɵɵFactoryTarget.Service
421
+ });
422
+ }
423
+ static {
424
+ this.ɵprov = i0.ɵɵngDeclareService({
425
+ minVersion: "22.0.0",
426
+ version: "22.3.0",
427
+ ngImport: i0,
428
+ type: NbAuthTokenParceler,
429
+ autoProvided: false
430
+ });
431
+ }
432
+ };
433
+ i0.ɵɵngDeclareClassMetadata({
434
+ minVersion: "12.0.0",
435
+ version: "22.3.0",
436
+ ngImport: i0,
437
+ type: NbAuthTokenParceler,
438
+ decorators: [{
439
+ type: Service,
440
+ args: [{ autoProvided: false }]
441
+ }]
442
+ });
443
+ var NbTokenStorage = class {};
444
+ var NbTokenLocalStorage = class NbTokenLocalStorage extends NbTokenStorage {
445
+ constructor() {
446
+ const platformId = inject(PLATFORM_ID, { optional: true });
447
+ super();
448
+ this.parceler = inject(NbAuthTokenParceler);
449
+ this.key = "auth_app_token";
450
+ this.changed = new Subject();
451
+ this.changes = this.changed.asObservable();
452
+ const isBrowser = !platformId || isPlatformBrowser(platformId);
453
+ this.storage = isBrowser && typeof localStorage !== "undefined" ? localStorage : void 0;
454
+ this.session = isBrowser && typeof sessionStorage !== "undefined" ? sessionStorage : void 0;
455
+ if (isBrowser && typeof BroadcastChannel !== "undefined") {
456
+ const channel = new BroadcastChannel(`nb-auth-${this.key}`);
457
+ this.channel = channel;
458
+ channel.onmessage = (event) => this.receive(event.data);
459
+ inject(DestroyRef, { optional: true })?.onDestroy(() => channel.close());
460
+ if (!this.read()) this.post({ type: "request" });
461
+ }
462
+ }
463
+ get() {
464
+ return this.parceler.unwrap(this.read());
465
+ }
466
+ set(token, options) {
467
+ const raw = this.parceler.wrap(token);
468
+ if (options?.remember ?? !this.session?.getItem(this.key)) {
469
+ this.session?.removeItem(this.key);
470
+ this.storage?.setItem(this.key, raw);
471
+ this.post({ type: "remembered" });
472
+ } else {
473
+ this.storage?.removeItem(this.key);
474
+ this.session?.setItem(this.key, raw);
475
+ this.post({
476
+ type: "session",
477
+ raw
478
+ });
479
+ }
480
+ }
481
+ clear() {
482
+ this.storage?.removeItem(this.key);
483
+ this.session?.removeItem(this.key);
484
+ this.post({ type: "clear" });
485
+ }
486
+ read() {
487
+ return this.session?.getItem(this.key) ?? this.storage?.getItem(this.key) ?? void 0;
488
+ }
489
+ post(message) {
490
+ this.channel?.postMessage(message);
491
+ }
492
+ receive(message) {
493
+ switch (message.type) {
494
+ case "request": {
495
+ const raw = this.session?.getItem(this.key);
496
+ if (raw) this.post({
497
+ type: "session",
498
+ raw
499
+ });
500
+ return;
501
+ }
502
+ case "session":
503
+ this.session?.setItem(this.key, message.raw);
504
+ break;
505
+ case "remembered":
506
+ case "clear": this.session?.removeItem(this.key);
507
+ }
508
+ this.changed.next();
509
+ }
510
+ static {
511
+ this.ɵfac = i0.ɵɵngDeclareFactory({
512
+ minVersion: "12.0.0",
513
+ version: "22.3.0",
514
+ ngImport: i0,
515
+ type: NbTokenLocalStorage,
516
+ deps: [],
517
+ target: i0.ɵɵFactoryTarget.Service
518
+ });
519
+ }
520
+ static {
521
+ this.ɵprov = i0.ɵɵngDeclareService({
522
+ minVersion: "22.0.0",
523
+ version: "22.3.0",
524
+ ngImport: i0,
525
+ type: NbTokenLocalStorage,
526
+ autoProvided: false
527
+ });
528
+ }
529
+ };
530
+ i0.ɵɵngDeclareClassMetadata({
531
+ minVersion: "12.0.0",
532
+ version: "22.3.0",
533
+ ngImport: i0,
534
+ type: NbTokenLocalStorage,
535
+ decorators: [{
536
+ type: Service,
537
+ args: [{ autoProvided: false }]
538
+ }],
539
+ ctorParameters: () => []
540
+ });
541
+ var NbTokenService = class NbTokenService {
542
+ constructor() {
543
+ this.tokenStorage = inject(NbTokenStorage);
544
+ this.token$ = new BehaviorSubject(void 0);
545
+ this.publishStoredToken();
546
+ this.tokenStorage.changes?.subscribe(() => this.publishStoredToken());
547
+ }
548
+ tokenChange() {
549
+ return this.token$.pipe(filter((value) => !!value), share());
550
+ }
551
+ set(token, options) {
552
+ this.tokenStorage.set(token, options);
553
+ this.publishStoredToken();
554
+ return of(void 0);
555
+ }
556
+ get() {
557
+ const token = this.tokenStorage.get();
558
+ return of(token);
559
+ }
560
+ clear() {
561
+ this.tokenStorage.clear();
562
+ this.publishStoredToken();
563
+ return of(void 0);
564
+ }
565
+ publishStoredToken() {
566
+ this.token$.next(this.tokenStorage.get());
567
+ }
568
+ static {
569
+ this.ɵfac = i0.ɵɵngDeclareFactory({
570
+ minVersion: "12.0.0",
571
+ version: "22.3.0",
572
+ ngImport: i0,
573
+ type: NbTokenService,
574
+ deps: [],
575
+ target: i0.ɵɵFactoryTarget.Service
576
+ });
577
+ }
578
+ static {
579
+ this.ɵprov = i0.ɵɵngDeclareService({
580
+ minVersion: "22.0.0",
581
+ version: "22.3.0",
582
+ ngImport: i0,
583
+ type: NbTokenService,
584
+ autoProvided: false
585
+ });
586
+ }
587
+ };
588
+ i0.ɵɵngDeclareClassMetadata({
589
+ minVersion: "12.0.0",
590
+ version: "22.3.0",
591
+ ngImport: i0,
592
+ type: NbTokenService,
593
+ decorators: [{
594
+ type: Service,
595
+ args: [{ autoProvided: false }]
596
+ }],
597
+ ctorParameters: () => []
598
+ });
599
+ function rememberMe(data) {
600
+ return typeof data === "object" && data !== null && "rememberMe" in data && typeof data.rememberMe === "boolean" ? data.rememberMe : void 0;
601
+ }
602
+ var NbAuthService = class NbAuthService {
603
+ constructor() {
604
+ this.tokenService = inject(NbTokenService);
605
+ this.strategies = inject(NB_AUTH_STRATEGIES);
606
+ }
607
+ getToken() {
608
+ return this.tokenService.get();
609
+ }
610
+ isAuthenticated() {
611
+ return this.getToken().pipe(map((token) => token.isValid()));
612
+ }
613
+ isAuthenticatedOrRefresh() {
614
+ return this.getToken().pipe(switchMap((token) => {
615
+ if (token.getValue() && !token.isValid()) return this.refreshToken(token.getOwnerStrategyName(), token).pipe(switchMap((res) => {
616
+ if (res.isSuccess()) return this.isAuthenticated();
617
+ else return of(false);
618
+ }));
619
+ else return of(token.isValid());
620
+ }));
621
+ }
622
+ onTokenChange() {
623
+ return this.tokenService.tokenChange();
624
+ }
625
+ onAuthenticationChange() {
626
+ return this.onTokenChange().pipe(map((token) => token.isValid()));
627
+ }
628
+ authenticate(strategyName, data) {
629
+ return this.getStrategy(strategyName).authenticate(data).pipe(switchMap((result) => this.processResultToken(result, { remember: rememberMe(data) })));
630
+ }
631
+ register(strategyName, data) {
632
+ return this.getStrategy(strategyName).register(data).pipe(switchMap((result) => this.processResultToken(result)));
633
+ }
634
+ logout(strategyName) {
635
+ return this.getStrategy(strategyName).logout().pipe(switchMap((result) => {
636
+ if (result.isSuccess()) return this.tokenService.clear().pipe(map(() => result));
637
+ return of(result);
638
+ }));
639
+ }
640
+ requestPassword(strategyName, data) {
641
+ return this.getStrategy(strategyName).requestPassword(data);
642
+ }
643
+ resetPassword(strategyName, data) {
644
+ return this.getStrategy(strategyName).resetPassword(data);
645
+ }
646
+ refreshToken(strategyName, data) {
647
+ return this.getStrategy(strategyName).refreshToken(data).pipe(switchMap((result) => this.processResultToken(result)));
648
+ }
649
+ getStrategy(strategyName) {
650
+ const found = this.strategies.find((strategy) => strategy.getName() === strategyName);
651
+ if (!found) throw new TypeError(`There is no Auth Strategy registered under '${strategyName}' name`);
652
+ return found;
653
+ }
654
+ processResultToken(result, options) {
655
+ const token = result.getToken();
656
+ if (result.isSuccess() && token) return this.tokenService.set(token, options).pipe(map(() => result));
657
+ return of(result);
658
+ }
659
+ static {
660
+ this.ɵfac = i0.ɵɵngDeclareFactory({
661
+ minVersion: "12.0.0",
662
+ version: "22.3.0",
663
+ ngImport: i0,
664
+ type: NbAuthService,
665
+ deps: [],
666
+ target: i0.ɵɵFactoryTarget.Service
667
+ });
668
+ }
669
+ static {
670
+ this.ɵprov = i0.ɵɵngDeclareService({
671
+ minVersion: "22.0.0",
672
+ version: "22.3.0",
673
+ ngImport: i0,
674
+ type: NbAuthService,
675
+ autoProvided: false
676
+ });
677
+ }
678
+ };
679
+ i0.ɵɵngDeclareClassMetadata({
680
+ minVersion: "12.0.0",
681
+ version: "22.3.0",
682
+ ngImport: i0,
683
+ type: NbAuthService,
684
+ decorators: [{
685
+ type: Service,
686
+ args: [{ autoProvided: false }]
687
+ }]
688
+ });
689
+ function injectNbAuthTexts() {
690
+ return injectNbTexts("auth", () => ({
691
+ back: $localize`:@@nb.auth.back:Back`,
692
+ loggingOut: $localize`:@@nb.auth.loggingOut:Logging out, please wait...`,
693
+ errorTitle: $localize`:@@nb.auth.errorTitle:Oh snap!`,
694
+ successTitle: $localize`:@@nb.auth.successTitle:Hooray!`,
695
+ socialLabel: $localize`:@@nb.auth.socialLabel:Social sign in`,
696
+ socialPrompt: $localize`:@@nb.auth.socialPrompt:or enter with:`,
697
+ emailLabel: $localize`:@@nb.auth.emailLabel:Email address:`,
698
+ emailPlaceholder: $localize`:@@nb.auth.emailPlaceholder:Email address`,
699
+ emailRequired: $localize`:@@nb.auth.emailRequired:Email is required!`,
700
+ emailInvalid: $localize`:@@nb.auth.emailInvalid:Email should be the real one!`,
701
+ passwordLabel: $localize`:@@nb.auth.passwordLabel:Password:`,
702
+ passwordPlaceholder: $localize`:@@nb.auth.passwordPlaceholder:Password`,
703
+ passwordRequired: $localize`:@@nb.auth.passwordRequired:Password is required!`,
704
+ passwordLength: (min, max) => $localize`:@@nb.auth.passwordLength:Password should contain from ${min}:min: to ${max}:max: characters`,
705
+ fullNameLabel: $localize`:@@nb.auth.fullNameLabel:Full name:`,
706
+ fullNamePlaceholder: $localize`:@@nb.auth.fullNamePlaceholder:Full name`,
707
+ fullNameRequired: $localize`:@@nb.auth.fullNameRequired:Full name is required!`,
708
+ fullNameLength: (min, max) => $localize`:@@nb.auth.fullNameLength:Full name should contain from ${min}:min: to ${max}:max: characters`,
709
+ confirmPasswordPlaceholder: $localize`:@@nb.auth.confirmPasswordPlaceholder:Confirm Password`,
710
+ confirmPasswordRequired: $localize`:@@nb.auth.confirmPasswordRequired:Password confirmation is required!`,
711
+ passwordMismatch: $localize`:@@nb.auth.passwordMismatch:Password does not match the confirm password.`,
712
+ loginTitle: $localize`:@@nb.auth.loginTitle:Login`,
713
+ loginSubtitle: $localize`:@@nb.auth.loginSubtitle:Hello! Log in with your email.`,
714
+ forgotPassword: $localize`:@@nb.auth.forgotPassword:Forgot Password?`,
715
+ rememberMe: $localize`:@@nb.auth.rememberMe:Remember me`,
716
+ loginSubmit: $localize`:@@nb.auth.loginSubmit:Log In`,
717
+ noAccount: $localize`:@@nb.auth.noAccount:Don't have an account?`,
718
+ registerLink: $localize`:@@nb.auth.registerLink:Register`,
719
+ registerTitle: $localize`:@@nb.auth.registerTitle:Register`,
720
+ repeatPasswordLabel: $localize`:@@nb.auth.repeatPasswordLabel:Repeat password:`,
721
+ agreeTo: $localize`:@@nb.auth.agreeTo:Agree to`,
722
+ terms: $localize`:@@nb.auth.terms:Terms & Conditions`,
723
+ registerSubmit: $localize`:@@nb.auth.registerSubmit:Register`,
724
+ haveAccount: $localize`:@@nb.auth.haveAccount:Already have an account?`,
725
+ loginLink: $localize`:@@nb.auth.loginLink:Log in`,
726
+ signInLabel: $localize`:@@nb.auth.signInLabel:Sign in`,
727
+ requestPasswordTitle: $localize`:@@nb.auth.requestPasswordTitle:Forgot Password`,
728
+ requestPasswordSubtitle: $localize`:@@nb.auth.requestPasswordSubtitle:Enter your email address and we’ll send a link to reset your password`,
729
+ requestPasswordEmailLabel: $localize`:@@nb.auth.requestPasswordEmailLabel:Enter your email address:`,
730
+ requestPasswordSubmit: $localize`:@@nb.auth.requestPasswordSubmit:Request password`,
731
+ backToLogin: $localize`:@@nb.auth.backToLogin:Back to Log In`,
732
+ signInOrUpLabel: $localize`:@@nb.auth.signInOrUpLabel:Sign in or sign up`,
733
+ resetPasswordTitle: $localize`:@@nb.auth.resetPasswordTitle:Change password`,
734
+ resetPasswordSubtitle: $localize`:@@nb.auth.resetPasswordSubtitle:Please set a new password`,
735
+ newPasswordLabel: $localize`:@@nb.auth.newPasswordLabel:New Password:`,
736
+ newPasswordPlaceholder: $localize`:@@nb.auth.newPasswordPlaceholder:New Password`,
737
+ confirmPasswordLabel: $localize`:@@nb.auth.confirmPasswordLabel:Confirm Password:`,
738
+ resetPasswordSubmit: $localize`:@@nb.auth.resetPasswordSubmit:Change password`
739
+ }));
740
+ }
741
+ function injectNbAuthStrategyTexts() {
742
+ return injectNbTexts("authStrategy", () => ({
743
+ loginError: $localize`:@@nb.authStrategy.loginError:Login/Email combination is not correct, please try again.`,
744
+ error: $localize`:@@nb.authStrategy.error:Something went wrong, please try again.`,
745
+ unknownError: $localize`:@@nb.authStrategy.unknownError:Something went wrong.`,
746
+ invalidToken: $localize`:@@nb.authStrategy.invalidToken:Token is empty or invalid.`,
747
+ invalidState: $localize`:@@nb.authStrategy.invalidState:This sign-in couldn't be verified, please try again.`,
748
+ loginSuccess: $localize`:@@nb.authStrategy.loginSuccess:You have been successfully logged in.`,
749
+ registerSuccess: $localize`:@@nb.authStrategy.registerSuccess:You have been successfully registered.`,
750
+ requestPasswordSuccess: $localize`:@@nb.authStrategy.requestPasswordSuccess:Reset password instructions have been sent to your email.`,
751
+ resetPasswordSuccess: $localize`:@@nb.authStrategy.resetPasswordSuccess:Your password has been successfully changed.`,
752
+ logoutSuccess: $localize`:@@nb.authStrategy.logoutSuccess:You have been successfully logged out.`,
753
+ refreshTokenSuccess: $localize`:@@nb.authStrategy.refreshTokenSuccess:Your token has been successfully refreshed.`,
754
+ authenticateSuccess: $localize`:@@nb.authStrategy.authenticateSuccess:You have been successfully authenticated.`
755
+ }));
756
+ }
757
+ var NbAuthStrategy = class {
758
+ constructor() {
759
+ this.texts = injectNbAuthStrategyTexts();
760
+ this.givenOptions = signal(void 0, ...ngDevMode ? [{ debugName: "givenOptions" }] : /* istanbul ignore next */ []);
761
+ this.resolvedOptions = computed(() => {
762
+ const given = this.givenOptions();
763
+ return given === void 0 ? void 0 : deepExtend({}, this.defaultOptions, this.textOptions(), given);
764
+ }, ...ngDevMode ? [{ debugName: "resolvedOptions" }] : /* istanbul ignore next */ []);
765
+ }
766
+ get options() {
767
+ return this.resolvedOptions();
768
+ }
769
+ setOptions(options) {
770
+ this.givenOptions.set(options);
771
+ }
772
+ textOptions() {
773
+ const texts = this.texts();
774
+ const messages = {
775
+ login: [texts.loginError, texts.loginSuccess],
776
+ authenticate: [texts.error, texts.authenticateSuccess],
777
+ register: [texts.error, texts.registerSuccess],
778
+ requestPass: [texts.error, texts.requestPasswordSuccess],
779
+ requestPassword: [texts.error, texts.requestPasswordSuccess],
780
+ resetPass: [texts.error, texts.resetPasswordSuccess],
781
+ resetPassword: [texts.error, texts.resetPasswordSuccess],
782
+ logout: [texts.error, texts.logoutSuccess],
783
+ refreshToken: [texts.error, texts.refreshTokenSuccess]
784
+ };
785
+ const defaults = this.defaultOptions ?? {};
786
+ return Object.fromEntries(Object.entries(messages).filter(([module]) => typeof defaults[module] === "object" && defaults[module] !== null).map(([module, [error, message]]) => [module, {
787
+ defaultErrors: [error],
788
+ defaultMessages: [message]
789
+ }]));
790
+ }
791
+ getOption(key) {
792
+ return getDeepFromObject(this.options, key);
793
+ }
794
+ createToken(value, failWhenInvalidToken) {
795
+ const tokenClass = this.options?.token?.class;
796
+ if (!tokenClass) throw new TypeError(`The '${this.getName()}' strategy has no token class.`);
797
+ const token = nbAuthCreateToken(tokenClass, value, this.getName());
798
+ if (failWhenInvalidToken && !token.isValid()) throw new NbAuthIllegalTokenError(this.texts().invalidToken);
799
+ return token;
800
+ }
801
+ getName() {
802
+ return this.options?.name ?? "";
803
+ }
804
+ createFailResponse(_data) {
805
+ return new HttpResponse({
806
+ body: {},
807
+ status: 401
808
+ });
809
+ }
810
+ createSuccessResponse(_data) {
811
+ return new HttpResponse({
812
+ body: {},
813
+ status: 200
814
+ });
815
+ }
816
+ getActionEndpoint(action) {
817
+ const actionEndpoint = getDeepFromObject(this.options, `${action}.endpoint`);
818
+ const baseEndpoint = getDeepFromObject(this.options, "baseEndpoint");
819
+ return actionEndpoint ? `${baseEndpoint}${actionEndpoint}` : "";
820
+ }
821
+ getHeaders() {
822
+ const customHeaders = this.options?.headers ?? {};
823
+ if (customHeaders instanceof HttpHeaders) return customHeaders;
824
+ let headers = new HttpHeaders();
825
+ Object.entries(customHeaders).forEach(([key, value]) => {
826
+ headers = headers.append(key, value);
827
+ });
828
+ return headers;
829
+ }
830
+ };
831
+ var NbAuthResult = class NbAuthResult {
832
+ static from(options) {
833
+ const { success, response, redirect, errors, messages, token } = options;
834
+ return new NbAuthResult(success, response, redirect, errors, messages, token);
835
+ }
836
+ constructor(success, response, redirect, errors, messages, token) {
837
+ this.success = success;
838
+ this.response = response;
839
+ this.errors = new Array();
840
+ this.messages = new Array();
841
+ this.redirect = redirect ?? void 0;
842
+ this.errors = errors ?? [];
843
+ this.messages = messages ?? [];
844
+ this.token = token;
845
+ }
846
+ getResponse() {
847
+ return this.response;
848
+ }
849
+ getToken() {
850
+ return this.token;
851
+ }
852
+ getRedirect() {
853
+ return this.redirect;
854
+ }
855
+ getErrors() {
856
+ return this.errors.filter((val) => !!val);
857
+ }
858
+ getMessages() {
859
+ return this.messages.filter((val) => !!val);
860
+ }
861
+ isSuccess() {
862
+ return this.success;
863
+ }
864
+ isFailure() {
865
+ return !this.success;
866
+ }
867
+ };
868
+ var NbAuthStrategyOptions = class {
869
+ constructor() {
870
+ this.name = "";
871
+ }
872
+ };
873
+ var NbDummyAuthStrategyOptions = class extends NbAuthStrategyOptions {
874
+ constructor() {
875
+ super(...arguments);
876
+ this.token = { class: NbAuthSimpleToken };
877
+ this.delay = 1e3;
878
+ this.alwaysFail = false;
879
+ }
880
+ };
881
+ const dummyStrategyOptions = new NbDummyAuthStrategyOptions();
882
+ var NbDummyAuthStrategy = class NbDummyAuthStrategy extends NbAuthStrategy {
883
+ constructor() {
884
+ super(...arguments);
885
+ this.defaultOptions = dummyStrategyOptions;
886
+ }
887
+ static setup(options) {
888
+ return [NbDummyAuthStrategy, options];
889
+ }
890
+ authenticate(data) {
891
+ return of(this.createDummyResult(data)).pipe(delay(this.getOption("delay") ?? 0));
892
+ }
893
+ register(data) {
894
+ return of(this.createDummyResult(data)).pipe(delay(this.getOption("delay") ?? 0));
895
+ }
896
+ requestPassword(data) {
897
+ return of(this.createDummyResult(data)).pipe(delay(this.getOption("delay") ?? 0));
898
+ }
899
+ resetPassword(data) {
900
+ return of(this.createDummyResult(data)).pipe(delay(this.getOption("delay") ?? 0));
901
+ }
902
+ logout(data) {
903
+ return of(this.createDummyResult(data)).pipe(delay(this.getOption("delay") ?? 0));
904
+ }
905
+ refreshToken(data) {
906
+ return of(this.createDummyResult(data)).pipe(delay(this.getOption("delay") ?? 0));
907
+ }
908
+ createDummyResult(data) {
909
+ if (this.getOption("alwaysFail")) return new NbAuthResult(false, this.createFailResponse(data), void 0, [this.texts().unknownError]);
910
+ try {
911
+ const token = this.createToken("test token", true);
912
+ return new NbAuthResult(true, this.createSuccessResponse(data), "/", [], [this.texts().loginSuccess], token);
913
+ } catch (err) {
914
+ return new NbAuthResult(false, this.createFailResponse(data), void 0, [err.message]);
915
+ }
916
+ }
917
+ static {
918
+ this.ɵfac = i0.ɵɵngDeclareFactory({
919
+ minVersion: "12.0.0",
920
+ version: "22.3.0",
921
+ ngImport: i0,
922
+ type: NbDummyAuthStrategy,
923
+ deps: [],
924
+ target: i0.ɵɵFactoryTarget.Service
925
+ });
926
+ }
927
+ static {
928
+ this.ɵprov = i0.ɵɵngDeclareService({
929
+ minVersion: "22.0.0",
930
+ version: "22.3.0",
931
+ ngImport: i0,
932
+ type: NbDummyAuthStrategy,
933
+ autoProvided: false
934
+ });
935
+ }
936
+ };
937
+ i0.ɵɵngDeclareClassMetadata({
938
+ minVersion: "12.0.0",
939
+ version: "22.3.0",
940
+ ngImport: i0,
941
+ type: NbDummyAuthStrategy,
942
+ decorators: [{
943
+ type: Service,
944
+ args: [{ autoProvided: false }]
945
+ }]
946
+ });
947
+ var NbOAuth2ResponseType;
948
+ (function(NbOAuth2ResponseType) {
949
+ NbOAuth2ResponseType["CODE"] = "code";
950
+ NbOAuth2ResponseType["TOKEN"] = "token";
951
+ })(NbOAuth2ResponseType || (NbOAuth2ResponseType = {}));
952
+ var NbOAuth2GrantType;
953
+ (function(NbOAuth2GrantType) {
954
+ NbOAuth2GrantType["AUTHORIZATION_CODE"] = "authorization_code";
955
+ NbOAuth2GrantType["PASSWORD"] = "password";
956
+ NbOAuth2GrantType["REFRESH_TOKEN"] = "refresh_token";
957
+ })(NbOAuth2GrantType || (NbOAuth2GrantType = {}));
958
+ var NbOAuth2ClientAuthMethod;
959
+ (function(NbOAuth2ClientAuthMethod) {
960
+ NbOAuth2ClientAuthMethod["NONE"] = "none";
961
+ NbOAuth2ClientAuthMethod["BASIC"] = "basic";
962
+ NbOAuth2ClientAuthMethod["REQUEST_BODY"] = "request-body";
963
+ })(NbOAuth2ClientAuthMethod || (NbOAuth2ClientAuthMethod = {}));
964
+ var NbOAuth2AuthStrategyOptions = class extends NbAuthStrategyOptions {
965
+ constructor() {
966
+ super(...arguments);
967
+ this.baseEndpoint = "";
968
+ this.clientId = "";
969
+ this.clientSecret = "";
970
+ this.clientAuthMethod = NbOAuth2ClientAuthMethod.NONE;
971
+ this.redirect = {
972
+ success: "/",
973
+ failure: null
974
+ };
975
+ this.defaultErrors = ["Something went wrong, please try again."];
976
+ this.defaultMessages = ["You have been successfully authenticated."];
977
+ this.authorize = {
978
+ endpoint: "authorize",
979
+ responseType: NbOAuth2ResponseType.CODE,
980
+ requireValidToken: true,
981
+ pkce: true
982
+ };
983
+ this.token = {
984
+ endpoint: "token",
985
+ grantType: NbOAuth2GrantType.AUTHORIZATION_CODE,
986
+ requireValidToken: true,
987
+ class: NbAuthOAuth2Token
988
+ };
989
+ this.refresh = {
990
+ endpoint: "token",
991
+ grantType: NbOAuth2GrantType.REFRESH_TOKEN,
992
+ requireValidToken: true
993
+ };
994
+ }
995
+ };
996
+ const auth2StrategyOptions = new NbOAuth2AuthStrategyOptions();
997
+ function isRefreshableToken(token) {
998
+ return "getRefreshToken" in token && "setRefreshToken" in token;
999
+ }
1000
+ function base64url(bytes) {
1001
+ return btoa(String.fromCharCode(...bytes)).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
1002
+ }
1003
+ function randomString(bytes) {
1004
+ return base64url(crypto.getRandomValues(new Uint8Array(bytes)));
1005
+ }
1006
+ async function pkceChallenge(verifier) {
1007
+ if (!globalThis.crypto?.subtle) return {
1008
+ challenge: verifier,
1009
+ method: "plain"
1010
+ };
1011
+ const digest = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(verifier));
1012
+ return {
1013
+ challenge: base64url(new Uint8Array(digest)),
1014
+ method: "S256"
1015
+ };
1016
+ }
1017
+ var NbOAuth2AuthStrategy = class NbOAuth2AuthStrategy extends NbAuthStrategy {
1018
+ constructor() {
1019
+ super(...arguments);
1020
+ this.http = inject(HttpClient);
1021
+ this.route = inject(ActivatedRoute);
1022
+ this.window = inject(NB_WINDOW);
1023
+ this.redirectResultHandlers = {
1024
+ [NbOAuth2ResponseType.CODE]: () => of(this.route.snapshot.queryParams).pipe(switchMap((params) => {
1025
+ const pending = this.takePendingAuthorization();
1026
+ const code = params["code"];
1027
+ if (code) {
1028
+ if (!pending || pending.state !== params["state"]) return of(this.invalidStateResult(params));
1029
+ return this.requestToken(String(code), pending.verifier);
1030
+ }
1031
+ return of(new NbAuthResult(false, params, this.getOption("redirect.failure"), this.getOption("defaultErrors"), []));
1032
+ })),
1033
+ [NbOAuth2ResponseType.TOKEN]: () => {
1034
+ const requireValidToken = this.getOption(`authorize.requireValidToken`);
1035
+ return of(this.route.snapshot.fragment).pipe(map((fragment) => this.parseHashAsQueryParams(fragment)), map((params) => {
1036
+ const pending = this.takePendingAuthorization();
1037
+ if (!params["error"] && (!pending || pending.state !== params["state"])) return this.invalidStateResult(params);
1038
+ if (!params["error"]) return new NbAuthResult(true, params, this.getOption("redirect.success"), [], this.getOption("defaultMessages"), this.createToken(params, requireValidToken));
1039
+ return new NbAuthResult(false, params, this.getOption("redirect.failure"), this.getOption("defaultErrors"), []);
1040
+ }), catchError((err) => {
1041
+ const errors = new Array();
1042
+ if (err instanceof NbAuthIllegalTokenError) errors.push(err.message);
1043
+ else errors.push(this.texts().unknownError);
1044
+ return of(new NbAuthResult(false, err, this.getOption("redirect.failure"), errors));
1045
+ }));
1046
+ }
1047
+ };
1048
+ this.redirectResults = {
1049
+ [NbOAuth2ResponseType.CODE]: () => of(this.route.snapshot.queryParams).pipe(map((params) => !!(params && (params["code"] || params["error"])))),
1050
+ [NbOAuth2ResponseType.TOKEN]: () => of(this.route.snapshot.fragment).pipe(map((fragment) => this.parseHashAsQueryParams(fragment)), map((params) => !!(params && (params["access_token"] || params["error"]))))
1051
+ };
1052
+ this.defaultOptions = auth2StrategyOptions;
1053
+ }
1054
+ textOptions() {
1055
+ const texts = this.texts();
1056
+ return {
1057
+ defaultErrors: [texts.error],
1058
+ defaultMessages: [texts.authenticateSuccess]
1059
+ };
1060
+ }
1061
+ static setup(options) {
1062
+ return [NbOAuth2AuthStrategy, options];
1063
+ }
1064
+ get responseType() {
1065
+ return this.getOption("authorize.responseType");
1066
+ }
1067
+ get clientAuthMethod() {
1068
+ return this.getOption("clientAuthMethod");
1069
+ }
1070
+ authenticate(data) {
1071
+ if (this.getOption("token.grantType") === NbOAuth2GrantType.PASSWORD) return this.passwordToken(data?.email ?? "", data?.password ?? "");
1072
+ else return this.isRedirectResult().pipe(switchMap((result) => {
1073
+ if (!result) {
1074
+ this.authorizeRedirect();
1075
+ return of(new NbAuthResult(true));
1076
+ }
1077
+ return this.getAuthorizationResult();
1078
+ }));
1079
+ }
1080
+ getAuthorizationResult() {
1081
+ const redirectResultHandler = this.redirectResultHandlers[this.responseType ?? ""];
1082
+ if (redirectResultHandler) return redirectResultHandler.call(this);
1083
+ throw new Error(`'${this.responseType}' responseType is not supported,
1084
+ only 'token' and 'code' are supported now`);
1085
+ }
1086
+ refreshToken(token) {
1087
+ const module = "refresh";
1088
+ const url = this.getActionEndpoint(module);
1089
+ const requireValidToken = this.getOption(`${module}.requireValidToken`);
1090
+ return this.http.post(url, this.buildRefreshRequestData(token), { headers: this.getHeaders() }).pipe(map((res) => new NbAuthResult(true, res, this.getOption("redirect.success"), [], this.getOption("defaultMessages"), this.createRefreshedToken(res, token, requireValidToken))), catchError((res) => this.handleResponseError(res)));
1091
+ }
1092
+ passwordToken(username, password) {
1093
+ const module = "token";
1094
+ const url = this.getActionEndpoint(module);
1095
+ const requireValidToken = this.getOption(`${module}.requireValidToken`);
1096
+ return this.http.post(url, this.buildPasswordRequestData(username, password), { headers: this.getHeaders() }).pipe(map((res) => new NbAuthResult(true, res, this.getOption("redirect.success"), [], this.getOption("defaultMessages"), this.createToken(res, requireValidToken))), catchError((res) => this.handleResponseError(res)));
1097
+ }
1098
+ authorizeRedirect() {
1099
+ this.startAuthorization().then((url) => {
1100
+ if (this.window) this.window.location.href = url;
1101
+ });
1102
+ }
1103
+ async startAuthorization() {
1104
+ const state = this.getOption("authorize.state") || randomString(16);
1105
+ const verifier = this.responseType === NbOAuth2ResponseType.CODE && this.getOption("authorize.pkce") !== false ? randomString(32) : void 0;
1106
+ const challenge = verifier ? await pkceChallenge(verifier) : void 0;
1107
+ const pending = {
1108
+ state,
1109
+ ...verifier && { verifier }
1110
+ };
1111
+ this.sessionStorage()?.setItem(this.pendingKey(), JSON.stringify(pending));
1112
+ return this.buildRedirectUrl({
1113
+ state,
1114
+ ...challenge && {
1115
+ code_challenge: challenge.challenge,
1116
+ code_challenge_method: challenge.method
1117
+ }
1118
+ });
1119
+ }
1120
+ takePendingAuthorization() {
1121
+ const storage = this.sessionStorage();
1122
+ const raw = storage?.getItem(this.pendingKey());
1123
+ storage?.removeItem(this.pendingKey());
1124
+ try {
1125
+ return raw ? JSON.parse(raw) : void 0;
1126
+ } catch {
1127
+ return;
1128
+ }
1129
+ }
1130
+ pendingKey() {
1131
+ return `nb-oauth2-${this.getName() || "oauth2"}`;
1132
+ }
1133
+ sessionStorage() {
1134
+ try {
1135
+ return this.window?.sessionStorage;
1136
+ } catch {
1137
+ return;
1138
+ }
1139
+ }
1140
+ invalidStateResult(params) {
1141
+ return new NbAuthResult(false, params, this.getOption("redirect.failure"), [this.texts().invalidState], []);
1142
+ }
1143
+ isRedirectResult() {
1144
+ return this.redirectResults[this.responseType ?? ""].call(this);
1145
+ }
1146
+ requestToken(code, verifier) {
1147
+ const module = "token";
1148
+ const url = this.getActionEndpoint(module);
1149
+ const requireValidToken = this.getOption(`${module}.requireValidToken`);
1150
+ return this.http.post(url, this.buildCodeRequestData(code, verifier), { headers: this.getHeaders() }).pipe(map((res) => new NbAuthResult(true, res, this.getOption("redirect.success"), [], this.getOption("defaultMessages"), this.createToken(res, requireValidToken))), catchError((res) => this.handleResponseError(res)));
1151
+ }
1152
+ buildCodeRequestData(code, verifier) {
1153
+ const params = {
1154
+ grant_type: this.getOption("token.grantType"),
1155
+ code,
1156
+ redirect_uri: this.getOption("token.redirectUri"),
1157
+ client_id: this.getOption("clientId"),
1158
+ code_verifier: verifier
1159
+ };
1160
+ return this.urlEncodeParameters(this.cleanParams(this.addCredentialsToParams(params)));
1161
+ }
1162
+ buildRefreshRequestData(token) {
1163
+ const params = {
1164
+ grant_type: this.getOption("refresh.grantType"),
1165
+ refresh_token: token.getRefreshToken(),
1166
+ scope: this.getOption("refresh.scope"),
1167
+ client_id: this.getOption("clientId")
1168
+ };
1169
+ return this.urlEncodeParameters(this.cleanParams(this.addCredentialsToParams(params)));
1170
+ }
1171
+ buildPasswordRequestData(username, password) {
1172
+ const params = {
1173
+ grant_type: this.getOption("token.grantType"),
1174
+ username,
1175
+ password,
1176
+ scope: this.getOption("token.scope")
1177
+ };
1178
+ return this.urlEncodeParameters(this.cleanParams(this.addCredentialsToParams(params)));
1179
+ }
1180
+ buildAuthHeader() {
1181
+ if (this.clientAuthMethod === NbOAuth2ClientAuthMethod.BASIC) {
1182
+ if (this.getOption("clientId") && this.getOption("clientSecret")) return new HttpHeaders({ Authorization: "Basic " + btoa(this.getOption("clientId") + ":" + this.getOption("clientSecret")) });
1183
+ else throw Error("For basic client authentication method, please provide both clientId & clientSecret.");
1184
+ }
1185
+ }
1186
+ getHeaders() {
1187
+ let headers = super.getHeaders();
1188
+ headers = headers.append("Content-Type", "application/x-www-form-urlencoded");
1189
+ const authHeaders = this.buildAuthHeader();
1190
+ if (authHeaders === void 0) return headers;
1191
+ for (const headerKey of authHeaders.keys()) for (const headerValue of authHeaders.getAll(headerKey) ?? []) headers = headers.append(headerKey, headerValue);
1192
+ return headers;
1193
+ }
1194
+ cleanParams(params) {
1195
+ Object.entries(params).forEach(([key, val]) => !val && delete params[key]);
1196
+ return params;
1197
+ }
1198
+ addCredentialsToParams(params) {
1199
+ if (this.clientAuthMethod === NbOAuth2ClientAuthMethod.REQUEST_BODY) {
1200
+ if (this.getOption("clientId") && this.getOption("clientSecret")) return {
1201
+ ...params,
1202
+ client_id: this.getOption("clientId"),
1203
+ client_secret: this.getOption("clientSecret")
1204
+ };
1205
+ else throw Error("For request body client authentication method, please provide both clientId & clientSecret.");
1206
+ }
1207
+ return params;
1208
+ }
1209
+ handleResponseError(res) {
1210
+ let errors = new Array();
1211
+ if (res instanceof HttpErrorResponse) {
1212
+ const error = res.error;
1213
+ const description = typeof error === "object" && error !== null && "error_description" in error ? error.error_description : void 0;
1214
+ if (description) errors.push(String(description));
1215
+ else errors = this.getOption("defaultErrors") ?? [];
1216
+ } else if (res instanceof NbAuthIllegalTokenError) errors.push(res.message);
1217
+ else errors.push(this.texts().unknownError);
1218
+ return of(new NbAuthResult(false, res, this.getOption("redirect.failure"), errors, []));
1219
+ }
1220
+ buildRedirectUrl(sign = {}) {
1221
+ const params = {
1222
+ response_type: this.getOption("authorize.responseType"),
1223
+ client_id: this.getOption("clientId"),
1224
+ redirect_uri: this.getOption("authorize.redirectUri"),
1225
+ scope: this.getOption("authorize.scope"),
1226
+ state: sign.state ?? this.getOption("authorize.state"),
1227
+ code_challenge: sign.code_challenge,
1228
+ code_challenge_method: sign.code_challenge_method,
1229
+ ...this.getOption("authorize.params")
1230
+ };
1231
+ return `${this.getActionEndpoint("authorize")}?${this.urlEncodeParameters(this.cleanParams(params))}`;
1232
+ }
1233
+ parseHashAsQueryParams(hash) {
1234
+ return hash ? hash.split("&").reduce((acc, part) => {
1235
+ const item = part.split("=");
1236
+ acc[item[0]] = decodeURIComponent(item[1]);
1237
+ return acc;
1238
+ }, {}) : {};
1239
+ }
1240
+ urlEncodeParameters(params) {
1241
+ return Object.keys(params).map((k) => `${encodeURIComponent(k)}=${encodeURIComponent(String(params[k]))}`).join("&");
1242
+ }
1243
+ createRefreshedToken(res, existingToken, requireValidToken) {
1244
+ const refreshedToken = this.createToken(res, requireValidToken);
1245
+ if (isRefreshableToken(refreshedToken) && !refreshedToken.getRefreshToken() && existingToken.getRefreshToken()) refreshedToken.setRefreshToken(existingToken.getRefreshToken());
1246
+ return refreshedToken;
1247
+ }
1248
+ register(_data) {
1249
+ throw new Error("`register` is not supported by `NbOAuth2AuthStrategy`, use `authenticate`.");
1250
+ }
1251
+ requestPassword(_data) {
1252
+ throw new Error("`requestPassword` is not supported by `NbOAuth2AuthStrategy`, use `authenticate`.");
1253
+ }
1254
+ resetPassword(_data) {
1255
+ throw new Error("`resetPassword` is not supported by `NbOAuth2AuthStrategy`, use `authenticate`.");
1256
+ }
1257
+ logout() {
1258
+ return of(new NbAuthResult(true));
1259
+ }
1260
+ static {
1261
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1262
+ minVersion: "12.0.0",
1263
+ version: "22.3.0",
1264
+ ngImport: i0,
1265
+ type: NbOAuth2AuthStrategy,
1266
+ deps: [],
1267
+ target: i0.ɵɵFactoryTarget.Service
1268
+ });
1269
+ }
1270
+ static {
1271
+ this.ɵprov = i0.ɵɵngDeclareService({
1272
+ minVersion: "22.0.0",
1273
+ version: "22.3.0",
1274
+ ngImport: i0,
1275
+ type: NbOAuth2AuthStrategy,
1276
+ autoProvided: false
1277
+ });
1278
+ }
1279
+ };
1280
+ i0.ɵɵngDeclareClassMetadata({
1281
+ minVersion: "12.0.0",
1282
+ version: "22.3.0",
1283
+ ngImport: i0,
1284
+ type: NbOAuth2AuthStrategy,
1285
+ decorators: [{
1286
+ type: Service,
1287
+ args: [{ autoProvided: false }]
1288
+ }]
1289
+ });
1290
+ var NbPasswordAuthStrategyOptions = class extends NbAuthStrategyOptions {
1291
+ constructor() {
1292
+ super(...arguments);
1293
+ this.baseEndpoint = "/api/auth/";
1294
+ this.login = {
1295
+ alwaysFail: false,
1296
+ endpoint: "login",
1297
+ method: "post",
1298
+ requireValidToken: true,
1299
+ redirect: {
1300
+ success: "/",
1301
+ failure: null
1302
+ },
1303
+ defaultErrors: ["Login/Email combination is not correct, please try again."],
1304
+ defaultMessages: ["You have been successfully logged in."]
1305
+ };
1306
+ this.register = {
1307
+ alwaysFail: false,
1308
+ endpoint: "register",
1309
+ method: "post",
1310
+ requireValidToken: true,
1311
+ redirect: {
1312
+ success: "/",
1313
+ failure: null
1314
+ },
1315
+ defaultErrors: ["Something went wrong, please try again."],
1316
+ defaultMessages: ["You have been successfully registered."]
1317
+ };
1318
+ this.requestPass = {
1319
+ endpoint: "request-pass",
1320
+ method: "post",
1321
+ redirect: {
1322
+ success: "/",
1323
+ failure: null
1324
+ },
1325
+ defaultErrors: ["Something went wrong, please try again."],
1326
+ defaultMessages: ["Reset password instructions have been sent to your email."]
1327
+ };
1328
+ this.resetPass = {
1329
+ endpoint: "reset-pass",
1330
+ method: "put",
1331
+ redirect: {
1332
+ success: "/",
1333
+ failure: null
1334
+ },
1335
+ resetPasswordTokenKey: "reset_password_token",
1336
+ defaultErrors: ["Something went wrong, please try again."],
1337
+ defaultMessages: ["Your password has been successfully changed."]
1338
+ };
1339
+ this.logout = {
1340
+ alwaysFail: false,
1341
+ endpoint: "logout",
1342
+ method: "delete",
1343
+ redirect: {
1344
+ success: "/",
1345
+ failure: null
1346
+ },
1347
+ defaultErrors: ["Something went wrong, please try again."],
1348
+ defaultMessages: ["You have been successfully logged out."]
1349
+ };
1350
+ this.refreshToken = {
1351
+ endpoint: "refresh-token",
1352
+ method: "post",
1353
+ requireValidToken: true,
1354
+ redirect: {
1355
+ success: null,
1356
+ failure: null
1357
+ },
1358
+ defaultErrors: ["Something went wrong, please try again."],
1359
+ defaultMessages: ["Your token has been successfully refreshed."]
1360
+ };
1361
+ this.token = {
1362
+ class: NbAuthSimpleToken,
1363
+ key: "data.token",
1364
+ getter: (module, res, options) => getDeepFromObject(res.body, options.token.key)
1365
+ };
1366
+ this.errors = {
1367
+ key: "data.errors",
1368
+ getter: (module, res, options) => nbAuthMessages(getDeepFromObject(res.error, options.errors.key, getDeepFromObject(options, `${module}.defaultErrors`)))
1369
+ };
1370
+ this.messages = {
1371
+ key: "data.messages",
1372
+ getter: (module, res, options) => nbAuthMessages(getDeepFromObject(res.body, options.messages.key, getDeepFromObject(options, `${module}.defaultMessages`)))
1373
+ };
1374
+ }
1375
+ };
1376
+ const passwordStrategyOptions = new NbPasswordAuthStrategyOptions();
1377
+ var NbPasswordAuthStrategy = class NbPasswordAuthStrategy extends NbAuthStrategy {
1378
+ constructor() {
1379
+ super(...arguments);
1380
+ this.http = inject(HttpClient);
1381
+ this.route = inject(ActivatedRoute);
1382
+ this.defaultOptions = passwordStrategyOptions;
1383
+ }
1384
+ static setup(options) {
1385
+ return [NbPasswordAuthStrategy, options];
1386
+ }
1387
+ authenticate(data) {
1388
+ const module = "login";
1389
+ const method = this.getOption(`${module}.method`) ?? "post";
1390
+ const url = this.getActionEndpoint(module);
1391
+ const requireValidToken = this.getOption(`${module}.requireValidToken`);
1392
+ return this.http.request(method, url, {
1393
+ body: data,
1394
+ observe: "response",
1395
+ headers: this.getHeaders()
1396
+ }).pipe(map((res) => {
1397
+ if (this.getOption(`${module}.alwaysFail`)) throw this.createFailResponse(data);
1398
+ return res;
1399
+ }), map((res) => new NbAuthResult(true, res, this.getOption(`${module}.redirect.success`), [], this.readMessages(module, res), this.createToken(this.readToken(module, res), requireValidToken))), catchError((res) => this.handleResponseError(res, module)));
1400
+ }
1401
+ register(data) {
1402
+ const module = "register";
1403
+ const method = this.getOption(`${module}.method`) ?? "post";
1404
+ const url = this.getActionEndpoint(module);
1405
+ const requireValidToken = this.getOption(`${module}.requireValidToken`);
1406
+ return this.http.request(method, url, {
1407
+ body: data,
1408
+ observe: "response",
1409
+ headers: this.getHeaders()
1410
+ }).pipe(map((res) => {
1411
+ if (this.getOption(`${module}.alwaysFail`)) throw this.createFailResponse(data);
1412
+ return res;
1413
+ }), map((res) => new NbAuthResult(true, res, this.getOption(`${module}.redirect.success`), [], this.readMessages(module, res), this.createToken(this.readToken("login", res), requireValidToken))), catchError((res) => this.handleResponseError(res, module)));
1414
+ }
1415
+ requestPassword(data) {
1416
+ const module = "requestPass";
1417
+ const method = this.getOption(`${module}.method`) ?? "post";
1418
+ const url = this.getActionEndpoint(module);
1419
+ return this.http.request(method, url, {
1420
+ body: data,
1421
+ observe: "response",
1422
+ headers: this.getHeaders()
1423
+ }).pipe(map((res) => {
1424
+ if (this.getOption(`${module}.alwaysFail`)) throw this.createFailResponse();
1425
+ return res;
1426
+ }), map((res) => new NbAuthResult(true, res, this.getOption(`${module}.redirect.success`), [], this.readMessages(module, res))), catchError((res) => this.handleResponseError(res, module)));
1427
+ }
1428
+ resetPassword(data = {}) {
1429
+ const module = "resetPass";
1430
+ const method = this.getOption(`${module}.method`) ?? "put";
1431
+ const url = this.getActionEndpoint(module);
1432
+ const tokenKey = this.getOption(`${module}.resetPasswordTokenKey`) ?? "";
1433
+ data[tokenKey] = this.route.snapshot.queryParams[tokenKey];
1434
+ return this.http.request(method, url, {
1435
+ body: data,
1436
+ observe: "response",
1437
+ headers: this.getHeaders()
1438
+ }).pipe(map((res) => {
1439
+ if (this.getOption(`${module}.alwaysFail`)) throw this.createFailResponse();
1440
+ return res;
1441
+ }), map((res) => new NbAuthResult(true, res, this.getOption(`${module}.redirect.success`), [], this.readMessages(module, res))), catchError((res) => this.handleResponseError(res, module)));
1442
+ }
1443
+ logout() {
1444
+ const module = "logout";
1445
+ const method = this.getOption(`${module}.method`) ?? "delete";
1446
+ const url = this.getActionEndpoint(module);
1447
+ return of({}).pipe(switchMap((res) => {
1448
+ if (!url) return of(res);
1449
+ return this.http.request(method, url, {
1450
+ observe: "response",
1451
+ headers: this.getHeaders()
1452
+ });
1453
+ }), map((res) => {
1454
+ if (this.getOption(`${module}.alwaysFail`)) throw this.createFailResponse();
1455
+ return res;
1456
+ }), map((res) => new NbAuthResult(true, res, this.getOption(`${module}.redirect.success`), [], this.readMessages(module, res))), catchError((res) => this.handleResponseError(res, module)));
1457
+ }
1458
+ refreshToken(data) {
1459
+ const module = "refreshToken";
1460
+ const method = this.getOption(`${module}.method`) ?? "post";
1461
+ const url = this.getActionEndpoint(module);
1462
+ const requireValidToken = this.getOption(`${module}.requireValidToken`);
1463
+ return this.http.request(method, url, {
1464
+ body: data,
1465
+ observe: "response",
1466
+ headers: this.getHeaders()
1467
+ }).pipe(map((res) => {
1468
+ if (this.getOption(`${module}.alwaysFail`)) throw this.createFailResponse(data);
1469
+ return res;
1470
+ }), map((res) => new NbAuthResult(true, res, this.getOption(`${module}.redirect.success`), [], this.readMessages(module, res), this.createToken(this.readToken(module, res), requireValidToken))), catchError((res) => this.handleResponseError(res, module)));
1471
+ }
1472
+ readMessages(module, res) {
1473
+ const options = this.options;
1474
+ const getter = options?.messages?.getter;
1475
+ return options && getter ? getter(module, res, options) : void 0;
1476
+ }
1477
+ readToken(module, res) {
1478
+ const options = this.options;
1479
+ const getter = options?.token?.getter;
1480
+ return options && getter ? getter(module, res, options) : void 0;
1481
+ }
1482
+ handleResponseError(res, module) {
1483
+ let errors = new Array();
1484
+ const options = this.options;
1485
+ const getter = options?.errors?.getter;
1486
+ if (res instanceof HttpErrorResponse) errors = options && getter ? getter(module, res, options) : [];
1487
+ else if (res instanceof NbAuthIllegalTokenError) errors.push(res.message);
1488
+ else errors.push(this.texts().unknownError);
1489
+ return of(new NbAuthResult(false, res, this.getOption(`${module}.redirect.failure`), errors));
1490
+ }
1491
+ static {
1492
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1493
+ minVersion: "12.0.0",
1494
+ version: "22.3.0",
1495
+ ngImport: i0,
1496
+ type: NbPasswordAuthStrategy,
1497
+ deps: [],
1498
+ target: i0.ɵɵFactoryTarget.Service
1499
+ });
1500
+ }
1501
+ static {
1502
+ this.ɵprov = i0.ɵɵngDeclareService({
1503
+ minVersion: "22.0.0",
1504
+ version: "22.3.0",
1505
+ ngImport: i0,
1506
+ type: NbPasswordAuthStrategy,
1507
+ autoProvided: false
1508
+ });
1509
+ }
1510
+ };
1511
+ i0.ɵɵngDeclareClassMetadata({
1512
+ minVersion: "12.0.0",
1513
+ version: "22.3.0",
1514
+ ngImport: i0,
1515
+ type: NbPasswordAuthStrategy,
1516
+ decorators: [{
1517
+ type: Service,
1518
+ args: [{ autoProvided: false }]
1519
+ }]
1520
+ });
1521
+ var NbAuthBlockComponent = class NbAuthBlockComponent {
1522
+ static {
1523
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1524
+ minVersion: "12.0.0",
1525
+ version: "22.3.0",
1526
+ ngImport: i0,
1527
+ type: NbAuthBlockComponent,
1528
+ deps: [],
1529
+ target: i0.ɵɵFactoryTarget.Component
1530
+ });
1531
+ }
1532
+ static {
1533
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
1534
+ minVersion: "14.0.0",
1535
+ version: "22.3.0",
1536
+ type: NbAuthBlockComponent,
1537
+ isStandalone: true,
1538
+ selector: "nb-auth-block",
1539
+ ngImport: i0,
1540
+ template: " <ng-content /> ",
1541
+ isInline: true,
1542
+ styles: [":host{display:block;width:100%;max-width:35rem}:host ::ng-deep form{width:100%}:host ::ng-deep .label{display:block;margin-bottom:.5rem}:host ::ng-deep .forgot-password{text-decoration:none;margin-bottom:.5rem}:host ::ng-deep .caption{margin-top:.5rem}:host ::ng-deep .alert{text-align:center}:host ::ng-deep .title{margin-top:0;margin-bottom:.75rem;text-align:center}:host ::ng-deep .sub-title{margin-bottom:2rem;text-align:center}:host ::ng-deep .form-control-group{margin-bottom:2rem}:host ::ng-deep .form-control-group.accept-group{display:flex;justify-content:space-between;margin:2rem 0}:host ::ng-deep .label-with-link{display:flex;justify-content:space-between}:host ::ng-deep .links{text-align:center;margin-top:1.75rem}:host ::ng-deep .links .socials{margin-top:1.5rem}:host ::ng-deep .links .socials a{margin:0 1rem;text-decoration:none;vertical-align:middle}:host ::ng-deep .links .socials a.with-icon{font-size:2rem}:host ::ng-deep .another-action{margin-top:2rem;text-align:center}:host ::ng-deep .sign-in-or-up{margin-top:2rem;display:flex;justify-content:space-between}:host ::ng-deep nb-alert .alert-title,:host ::ng-deep nb-alert .alert-message{margin:0 0 .5rem}:host ::ng-deep nb-alert .alert-message-list{list-style-type:none;padding:0;margin:0}\n"]
1543
+ });
1544
+ }
1545
+ };
1546
+ i0.ɵɵngDeclareClassMetadata({
1547
+ minVersion: "12.0.0",
1548
+ version: "22.3.0",
1549
+ ngImport: i0,
1550
+ type: NbAuthBlockComponent,
1551
+ decorators: [{
1552
+ type: Component,
1553
+ args: [{
1554
+ selector: "nb-auth-block",
1555
+ template: " <ng-content /> ",
1556
+ styles: [":host{display:block;width:100%;max-width:35rem}:host ::ng-deep form{width:100%}:host ::ng-deep .label{display:block;margin-bottom:.5rem}:host ::ng-deep .forgot-password{text-decoration:none;margin-bottom:.5rem}:host ::ng-deep .caption{margin-top:.5rem}:host ::ng-deep .alert{text-align:center}:host ::ng-deep .title{margin-top:0;margin-bottom:.75rem;text-align:center}:host ::ng-deep .sub-title{margin-bottom:2rem;text-align:center}:host ::ng-deep .form-control-group{margin-bottom:2rem}:host ::ng-deep .form-control-group.accept-group{display:flex;justify-content:space-between;margin:2rem 0}:host ::ng-deep .label-with-link{display:flex;justify-content:space-between}:host ::ng-deep .links{text-align:center;margin-top:1.75rem}:host ::ng-deep .links .socials{margin-top:1.5rem}:host ::ng-deep .links .socials a{margin:0 1rem;text-decoration:none;vertical-align:middle}:host ::ng-deep .links .socials a.with-icon{font-size:2rem}:host ::ng-deep .another-action{margin-top:2rem;text-align:center}:host ::ng-deep .sign-in-or-up{margin-top:2rem;display:flex;justify-content:space-between}:host ::ng-deep nb-alert .alert-title,:host ::ng-deep nb-alert .alert-message{margin:0 0 .5rem}:host ::ng-deep nb-alert .alert-message-list{list-style-type:none;padding:0;margin:0}\n"]
1557
+ }]
1558
+ }]
1559
+ });
1560
+ var NbAuthComponent = class NbAuthComponent {
1561
+ constructor() {
1562
+ this.texts = injectNbAuthTexts();
1563
+ this.destroyRef = inject(DestroyRef);
1564
+ this.auth = inject(NbAuthService);
1565
+ this.location = inject(Location);
1566
+ this.authenticated = false;
1567
+ this.token = "";
1568
+ const auth = this.auth;
1569
+ this.subscription = auth.onAuthenticationChange().pipe(takeUntilDestroyed(this.destroyRef)).subscribe((authenticated) => {
1570
+ this.authenticated = authenticated;
1571
+ });
1572
+ }
1573
+ back() {
1574
+ this.location.back();
1575
+ return false;
1576
+ }
1577
+ static {
1578
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1579
+ minVersion: "12.0.0",
1580
+ version: "22.3.0",
1581
+ ngImport: i0,
1582
+ type: NbAuthComponent,
1583
+ deps: [],
1584
+ target: i0.ɵɵFactoryTarget.Component
1585
+ });
1586
+ }
1587
+ static {
1588
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
1589
+ minVersion: "14.0.0",
1590
+ version: "22.3.0",
1591
+ type: NbAuthComponent,
1592
+ isStandalone: true,
1593
+ selector: "nb-auth",
1594
+ ngImport: i0,
1595
+ template: "<nb-layout>\n <nb-layout-column>\n <nb-card>\n <nb-card-header>\n <nav class=\"navigation\">\n <a href=\"#\"\n (click)=\"back()\"\n class=\"link back-link\"\n [attr.aria-label]=\"texts().back\">\n <nb-icon icon=\"arrow-back-outline\"\n pack=\"essentials\" />\n </a>\n </nav>\n </nb-card-header>\n <nb-card-body>\n <nb-auth-block>\n <router-outlet />\n </nb-auth-block>\n </nb-card-body>\n </nb-card>\n </nb-layout-column>\n</nb-layout>\n",
1596
+ styles: [":host nb-card{margin:0;height:calc(100dvh - 5rem)}:host .navigation .link{display:inline-block;text-decoration:none}:host .navigation .link nb-icon{font-size:2rem;vertical-align:middle}[dir=rtl] :host .navigation .link nb-icon{transform:scaleX(-1)}:host .links nb-icon{font-size:2.5rem}:host nb-card-body{display:flex;width:100%}:host nb-auth-block{margin:auto}@media(max-width:767.98px){:host nb-card{border-radius:0;height:100dvh}}:host ::ng-deep nb-layout .layout .layout-container .content .columns nb-layout-column{padding:2.5rem}@media(max-width:767.98px){:host ::ng-deep nb-layout .layout .layout-container .content .columns nb-layout-column{padding:0}}\n"],
1597
+ dependencies: [
1598
+ {
1599
+ kind: "component",
1600
+ type: NbLayoutComponent,
1601
+ selector: "nb-layout",
1602
+ inputs: [
1603
+ "center",
1604
+ "windowMode",
1605
+ "withScroll",
1606
+ "restoreScrollTop"
1607
+ ]
1608
+ },
1609
+ {
1610
+ kind: "component",
1611
+ type: NbLayoutColumnComponent,
1612
+ selector: "nb-layout-column",
1613
+ inputs: ["left", "start"]
1614
+ },
1615
+ {
1616
+ kind: "component",
1617
+ type: NbCardComponent,
1618
+ selector: "nb-card",
1619
+ inputs: [
1620
+ "size",
1621
+ "status",
1622
+ "accent",
1623
+ "appearance"
1624
+ ]
1625
+ },
1626
+ {
1627
+ kind: "component",
1628
+ type: NbCardHeaderComponent,
1629
+ selector: "nb-card-header"
1630
+ },
1631
+ {
1632
+ kind: "component",
1633
+ type: NbCardBodyComponent,
1634
+ selector: "nb-card-body"
1635
+ },
1636
+ {
1637
+ kind: "component",
1638
+ type: NbIconComponent,
1639
+ selector: "nb-icon",
1640
+ inputs: [
1641
+ "icon",
1642
+ "pack",
1643
+ "options",
1644
+ "status",
1645
+ "config"
1646
+ ]
1647
+ },
1648
+ {
1649
+ kind: "component",
1650
+ type: NbAuthBlockComponent,
1651
+ selector: "nb-auth-block"
1652
+ },
1653
+ {
1654
+ kind: "directive",
1655
+ type: RouterOutlet,
1656
+ selector: "router-outlet",
1657
+ inputs: ["name", "routerOutletData"],
1658
+ outputs: [
1659
+ "activate",
1660
+ "deactivate",
1661
+ "attach",
1662
+ "detach"
1663
+ ],
1664
+ exportAs: ["outlet"]
1665
+ }
1666
+ ],
1667
+ changeDetection: i0.ChangeDetectionStrategy.Eager
1668
+ });
1669
+ }
1670
+ };
1671
+ i0.ɵɵngDeclareClassMetadata({
1672
+ minVersion: "12.0.0",
1673
+ version: "22.3.0",
1674
+ ngImport: i0,
1675
+ type: NbAuthComponent,
1676
+ decorators: [{
1677
+ type: Component,
1678
+ args: [{
1679
+ selector: "nb-auth",
1680
+ changeDetection: ChangeDetectionStrategy.Eager,
1681
+ imports: [
1682
+ NbLayoutComponent,
1683
+ NbLayoutColumnComponent,
1684
+ NbCardComponent,
1685
+ NbCardHeaderComponent,
1686
+ NbCardBodyComponent,
1687
+ NbIconComponent,
1688
+ NbAuthBlockComponent,
1689
+ RouterOutlet
1690
+ ],
1691
+ template: "<nb-layout>\n <nb-layout-column>\n <nb-card>\n <nb-card-header>\n <nav class=\"navigation\">\n <a href=\"#\"\n (click)=\"back()\"\n class=\"link back-link\"\n [attr.aria-label]=\"texts().back\">\n <nb-icon icon=\"arrow-back-outline\"\n pack=\"essentials\" />\n </a>\n </nav>\n </nb-card-header>\n <nb-card-body>\n <nb-auth-block>\n <router-outlet />\n </nb-auth-block>\n </nb-card-body>\n </nb-card>\n </nb-layout-column>\n</nb-layout>\n",
1692
+ styles: [":host nb-card{margin:0;height:calc(100dvh - 5rem)}:host .navigation .link{display:inline-block;text-decoration:none}:host .navigation .link nb-icon{font-size:2rem;vertical-align:middle}[dir=rtl] :host .navigation .link nb-icon{transform:scaleX(-1)}:host .links nb-icon{font-size:2.5rem}:host nb-card-body{display:flex;width:100%}:host nb-auth-block{margin:auto}@media(max-width:767.98px){:host nb-card{border-radius:0;height:100dvh}}:host ::ng-deep nb-layout .layout .layout-container .content .columns nb-layout-column{padding:2.5rem}@media(max-width:767.98px){:host ::ng-deep nb-layout .layout .layout-container .content .columns nb-layout-column{padding:0}}\n"]
1693
+ }]
1694
+ }],
1695
+ ctorParameters: () => []
1696
+ });
1697
+ var NbLoginComponent = class NbLoginComponent {
1698
+ constructor() {
1699
+ this.texts = injectNbAuthTexts();
1700
+ this.service = inject(NbAuthService);
1701
+ this.options = inject(NB_AUTH_OPTIONS);
1702
+ this.cd = inject(ChangeDetectorRef);
1703
+ this.router = inject(Router);
1704
+ this.redirectDelay = this.getConfigValue("forms.login.redirectDelay");
1705
+ this.showMessages = this.getConfigValue("forms.login.showMessages");
1706
+ this.strategy = this.getConfigValue("forms.login.strategy");
1707
+ this.errors = new Array();
1708
+ this.messages = new Array();
1709
+ this.user = { rememberMe: true };
1710
+ this.submitted = false;
1711
+ this.socialLinks = this.getConfigValue("forms.login.socialLinks");
1712
+ this.rememberMe = this.getConfigValue("forms.login.rememberMe");
1713
+ }
1714
+ login() {
1715
+ this.errors = [];
1716
+ this.messages = [];
1717
+ this.submitted = true;
1718
+ this.service.authenticate(this.strategy, this.user).subscribe((result) => {
1719
+ this.submitted = false;
1720
+ if (result.isSuccess()) this.messages = result.getMessages();
1721
+ else this.errors = result.getErrors();
1722
+ const redirect = result.getRedirect();
1723
+ if (redirect) setTimeout(() => this.router.navigateByUrl(redirect), this.redirectDelay);
1724
+ this.cd.detectChanges();
1725
+ });
1726
+ }
1727
+ getConfigValue(key) {
1728
+ return getDeepFromObject(this.options, key);
1729
+ }
1730
+ static {
1731
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1732
+ minVersion: "12.0.0",
1733
+ version: "22.3.0",
1734
+ ngImport: i0,
1735
+ type: NbLoginComponent,
1736
+ deps: [],
1737
+ target: i0.ɵɵFactoryTarget.Component
1738
+ });
1739
+ }
1740
+ static {
1741
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
1742
+ minVersion: "17.0.0",
1743
+ version: "22.3.0",
1744
+ type: NbLoginComponent,
1745
+ isStandalone: true,
1746
+ selector: "nb-login",
1747
+ ngImport: i0,
1748
+ template: "<h1 id=\"title\"\n class=\"title\">{{ texts().loginTitle }}</h1>\n<p class=\"sub-title\">{{ texts().loginSubtitle }}</p>\n\n@if (showMessages.error && errors?.length && !submitted) {\n<nb-alert status=\"danger\"\n outline\n role=\"alert\">\n <p class=\"alert-title\"><b>{{ texts().errorTitle }}</b></p>\n <ul class=\"alert-message-list\">\n @for (error of errors; track $index) {\n <li class=\"alert-message\">{{ error }}</li>\n }\n </ul>\n</nb-alert>\n}\n\n@if (showMessages.success && messages?.length && !submitted) {\n<nb-alert status=\"success\"\n outline\n role=\"alert\">\n <p class=\"alert-title\"><b>{{ texts().successTitle }}</b></p>\n <ul class=\"alert-message-list\">\n @for (message of messages; track $index) {\n <li class=\"alert-message\">{{ message }}</li>\n }\n </ul>\n</nb-alert>\n}\n\n<form (ngSubmit)=\"login()\"\n #form=\"ngForm\"\n aria-labelledby=\"title\">\n\n <div class=\"form-control-group\">\n <label class=\"label\"\n for=\"input-email\">{{ texts().emailLabel }}</label>\n <input nbInput\n fullWidth\n [(ngModel)]=\"user.email\"\n #email=\"ngModel\"\n name=\"email\"\n id=\"input-email\"\n pattern=\".+@.+\\..+\"\n [placeholder]=\"texts().emailPlaceholder\"\n fieldSize=\"large\"\n autofocus\n [status]=\"email.dirty ? (email.invalid ? 'danger' : 'success') : 'basic'\"\n [required]=\"getConfigValue('forms.validation.email.required')\"\n [attr.aria-invalid]=\"email.invalid && email.touched ? true : null\">\n @if (email.invalid && email.touched) {\n @if (email.errors?.['required']) {\n <p class=\"caption status-danger\">\n {{ texts().emailRequired }}\n </p>\n }\n @if (email.errors?.['pattern']) {\n <p class=\"caption status-danger\">\n {{ texts().emailInvalid }}\n </p>\n }\n }\n </div>\n\n <div class=\"form-control-group\">\n <span class=\"label-with-link\">\n <label class=\"label\"\n for=\"input-password\">{{ texts().passwordLabel }}</label>\n <a class=\"forgot-password caption-2\"\n routerLink=\"../request-password\">{{ texts().forgotPassword }}</a>\n </span>\n <input nbInput\n fullWidth\n [(ngModel)]=\"user.password\"\n #password=\"ngModel\"\n name=\"password\"\n type=\"password\"\n id=\"input-password\"\n [placeholder]=\"texts().passwordPlaceholder\"\n fieldSize=\"large\"\n [status]=\"password.dirty ? (password.invalid ? 'danger' : 'success') : 'basic'\"\n [required]=\"getConfigValue('forms.validation.password.required')\"\n [minlength]=\"getConfigValue('forms.validation.password.minLength')\"\n [maxlength]=\"getConfigValue('forms.validation.password.maxLength')\"\n [attr.aria-invalid]=\"password.invalid && password.touched ? true : null\">\n @if (password.invalid && password.touched ) {\n @if (password.errors?.['required']) {\n <p class=\"caption status-danger\">\n {{ texts().passwordRequired }}\n </p>\n }\n @if (password.errors?.['minlength'] || password.errors?.['maxlength']) {\n <p class=\"caption status-danger\">\n {{ texts().passwordLength(getConfigValue('forms.validation.password.minLength'), getConfigValue('forms.validation.password.maxLength')) }}\n </p>\n }\n }\n </div>\n\n <div class=\"form-control-group accept-group\">\n @if (rememberMe) {\n <nb-checkbox name=\"rememberMe\"\n [(ngModel)]=\"user.rememberMe\">{{ texts().rememberMe }}</nb-checkbox>\n }\n </div>\n\n <button nbButton\n fullWidth\n status=\"primary\"\n size=\"large\"\n [disabled]=\"submitted || !form.valid\"\n [class.btn-pulse]=\"submitted\">\n {{ texts().loginSubmit }}\n </button>\n</form>\n\n@if (socialLinks && socialLinks.length > 0) {\n<section class=\"links\"\n [attr.aria-label]=\"texts().socialLabel\">\n {{ texts().socialPrompt }}\n <div class=\"socials\">\n @for (socialLink of socialLinks; track socialLink) {\n @if (socialLink.link) {\n <a [routerLink]=\"socialLink.link\"\n [attr.target]=\"socialLink.target\"\n [attr.class]=\"socialLink.icon\"\n [attr.aria-label]=\"socialLink.icon ? socialLink.title : null\"\n [class.with-icon]=\"socialLink.icon\">\n @if (socialLink.icon) {\n <nb-icon [icon]=\"socialLink.icon\" />\n } @else {{{ socialLink.title }}}\n </a>\n }\n @if (socialLink.url) {\n <a [attr.href]=\"socialLink.url\"\n [attr.target]=\"socialLink.target\"\n [attr.class]=\"socialLink.icon\"\n [attr.aria-label]=\"socialLink.icon ? socialLink.title : null\"\n [class.with-icon]=\"socialLink.icon\">\n @if (socialLink.icon) {\n <nb-icon [icon]=\"socialLink.icon\" />\n } @else {{{ socialLink.title }}}\n </a>\n }\n }\n </div>\n</section>\n}\n\n<section class=\"another-action\"\n [attr.aria-label]=\"texts().registerLink\">\n {{ texts().noAccount }} <a class=\"text-link\"\n routerLink=\"../register\">{{ texts().registerLink }}</a>\n</section>\n",
1749
+ dependencies: [
1750
+ {
1751
+ kind: "component",
1752
+ type: NbAlertComponent,
1753
+ selector: "nb-alert",
1754
+ inputs: [
1755
+ "size",
1756
+ "status",
1757
+ "appearance",
1758
+ "filled",
1759
+ "outline",
1760
+ "accent",
1761
+ "closable"
1762
+ ],
1763
+ outputs: ["close"]
1764
+ },
1765
+ {
1766
+ kind: "ngmodule",
1767
+ type: FormsModule
1768
+ },
1769
+ {
1770
+ kind: "directive",
1771
+ type: i1.ɵNgNoValidate,
1772
+ selector: "form:not([ngNoForm]):not([ngNativeValidate])"
1773
+ },
1774
+ {
1775
+ kind: "directive",
1776
+ type: i1.DefaultValueAccessor,
1777
+ selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
1778
+ },
1779
+ {
1780
+ kind: "directive",
1781
+ type: i1.NgControlStatus,
1782
+ selector: "[formControlName],[ngModel],[formControl]"
1783
+ },
1784
+ {
1785
+ kind: "directive",
1786
+ type: i1.NgControlStatusGroup,
1787
+ selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"
1788
+ },
1789
+ {
1790
+ kind: "directive",
1791
+ type: i1.RequiredValidator,
1792
+ selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]",
1793
+ inputs: ["required"]
1794
+ },
1795
+ {
1796
+ kind: "directive",
1797
+ type: i1.MinLengthValidator,
1798
+ selector: "[minlength][formControlName],[minlength][formControl],[minlength][ngModel]",
1799
+ inputs: ["minlength"]
1800
+ },
1801
+ {
1802
+ kind: "directive",
1803
+ type: i1.MaxLengthValidator,
1804
+ selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]",
1805
+ inputs: ["maxlength"]
1806
+ },
1807
+ {
1808
+ kind: "directive",
1809
+ type: i1.PatternValidator,
1810
+ selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]",
1811
+ inputs: ["pattern"]
1812
+ },
1813
+ {
1814
+ kind: "directive",
1815
+ type: i1.NgModel,
1816
+ selector: "[ngModel]:not([formControlName]):not([formControl])",
1817
+ inputs: [
1818
+ "name",
1819
+ "disabled",
1820
+ "ngModel",
1821
+ "ngModelOptions"
1822
+ ],
1823
+ outputs: ["ngModelChange"],
1824
+ exportAs: ["ngModel"]
1825
+ },
1826
+ {
1827
+ kind: "directive",
1828
+ type: i1.NgForm,
1829
+ selector: "form:not([ngNoForm]):not([formGroup]):not([formArray]),ng-form,[ngForm]",
1830
+ inputs: ["ngFormOptions"],
1831
+ outputs: ["ngSubmit"],
1832
+ exportAs: ["ngForm"]
1833
+ },
1834
+ {
1835
+ kind: "directive",
1836
+ type: NbInputDirective,
1837
+ selector: "input[nbInput],textarea[nbInput]",
1838
+ inputs: [
1839
+ "fieldSize",
1840
+ "status",
1841
+ "shape",
1842
+ "fullWidth",
1843
+ "ghost"
1844
+ ]
1845
+ },
1846
+ {
1847
+ kind: "directive",
1848
+ type: RouterLink,
1849
+ selector: "[routerLink]",
1850
+ inputs: [
1851
+ "target",
1852
+ "queryParams",
1853
+ "fragment",
1854
+ "queryParamsHandling",
1855
+ "state",
1856
+ "info",
1857
+ "relativeTo",
1858
+ "preserveFragment",
1859
+ "skipLocationChange",
1860
+ "replaceUrl",
1861
+ "browserUrl",
1862
+ "scroll",
1863
+ "routerLink"
1864
+ ]
1865
+ },
1866
+ {
1867
+ kind: "component",
1868
+ type: NbCheckboxComponent,
1869
+ selector: "nb-checkbox",
1870
+ inputs: [
1871
+ "checked",
1872
+ "disabled",
1873
+ "status",
1874
+ "size",
1875
+ "indeterminate"
1876
+ ],
1877
+ outputs: ["checkedChange"]
1878
+ },
1879
+ {
1880
+ kind: "component",
1881
+ type: NbButtonComponent,
1882
+ selector: "button[nbButton],a[nbButton],input[type=\"button\"][nbButton],input[type=\"submit\"][nbButton]",
1883
+ inputs: ["hero", "loading"]
1884
+ },
1885
+ {
1886
+ kind: "component",
1887
+ type: NbIconComponent,
1888
+ selector: "nb-icon",
1889
+ inputs: [
1890
+ "icon",
1891
+ "pack",
1892
+ "options",
1893
+ "status",
1894
+ "config"
1895
+ ]
1896
+ }
1897
+ ]
1898
+ });
1899
+ }
1900
+ };
1901
+ i0.ɵɵngDeclareClassMetadata({
1902
+ minVersion: "12.0.0",
1903
+ version: "22.3.0",
1904
+ ngImport: i0,
1905
+ type: NbLoginComponent,
1906
+ decorators: [{
1907
+ type: Component,
1908
+ args: [{
1909
+ selector: "nb-login",
1910
+ imports: [
1911
+ NbAlertComponent,
1912
+ FormsModule,
1913
+ NbInputDirective,
1914
+ RouterLink,
1915
+ NbCheckboxComponent,
1916
+ NbButtonComponent,
1917
+ NbIconComponent
1918
+ ],
1919
+ template: "<h1 id=\"title\"\n class=\"title\">{{ texts().loginTitle }}</h1>\n<p class=\"sub-title\">{{ texts().loginSubtitle }}</p>\n\n@if (showMessages.error && errors?.length && !submitted) {\n<nb-alert status=\"danger\"\n outline\n role=\"alert\">\n <p class=\"alert-title\"><b>{{ texts().errorTitle }}</b></p>\n <ul class=\"alert-message-list\">\n @for (error of errors; track $index) {\n <li class=\"alert-message\">{{ error }}</li>\n }\n </ul>\n</nb-alert>\n}\n\n@if (showMessages.success && messages?.length && !submitted) {\n<nb-alert status=\"success\"\n outline\n role=\"alert\">\n <p class=\"alert-title\"><b>{{ texts().successTitle }}</b></p>\n <ul class=\"alert-message-list\">\n @for (message of messages; track $index) {\n <li class=\"alert-message\">{{ message }}</li>\n }\n </ul>\n</nb-alert>\n}\n\n<form (ngSubmit)=\"login()\"\n #form=\"ngForm\"\n aria-labelledby=\"title\">\n\n <div class=\"form-control-group\">\n <label class=\"label\"\n for=\"input-email\">{{ texts().emailLabel }}</label>\n <input nbInput\n fullWidth\n [(ngModel)]=\"user.email\"\n #email=\"ngModel\"\n name=\"email\"\n id=\"input-email\"\n pattern=\".+@.+\\..+\"\n [placeholder]=\"texts().emailPlaceholder\"\n fieldSize=\"large\"\n autofocus\n [status]=\"email.dirty ? (email.invalid ? 'danger' : 'success') : 'basic'\"\n [required]=\"getConfigValue('forms.validation.email.required')\"\n [attr.aria-invalid]=\"email.invalid && email.touched ? true : null\">\n @if (email.invalid && email.touched) {\n @if (email.errors?.['required']) {\n <p class=\"caption status-danger\">\n {{ texts().emailRequired }}\n </p>\n }\n @if (email.errors?.['pattern']) {\n <p class=\"caption status-danger\">\n {{ texts().emailInvalid }}\n </p>\n }\n }\n </div>\n\n <div class=\"form-control-group\">\n <span class=\"label-with-link\">\n <label class=\"label\"\n for=\"input-password\">{{ texts().passwordLabel }}</label>\n <a class=\"forgot-password caption-2\"\n routerLink=\"../request-password\">{{ texts().forgotPassword }}</a>\n </span>\n <input nbInput\n fullWidth\n [(ngModel)]=\"user.password\"\n #password=\"ngModel\"\n name=\"password\"\n type=\"password\"\n id=\"input-password\"\n [placeholder]=\"texts().passwordPlaceholder\"\n fieldSize=\"large\"\n [status]=\"password.dirty ? (password.invalid ? 'danger' : 'success') : 'basic'\"\n [required]=\"getConfigValue('forms.validation.password.required')\"\n [minlength]=\"getConfigValue('forms.validation.password.minLength')\"\n [maxlength]=\"getConfigValue('forms.validation.password.maxLength')\"\n [attr.aria-invalid]=\"password.invalid && password.touched ? true : null\">\n @if (password.invalid && password.touched ) {\n @if (password.errors?.['required']) {\n <p class=\"caption status-danger\">\n {{ texts().passwordRequired }}\n </p>\n }\n @if (password.errors?.['minlength'] || password.errors?.['maxlength']) {\n <p class=\"caption status-danger\">\n {{ texts().passwordLength(getConfigValue('forms.validation.password.minLength'), getConfigValue('forms.validation.password.maxLength')) }}\n </p>\n }\n }\n </div>\n\n <div class=\"form-control-group accept-group\">\n @if (rememberMe) {\n <nb-checkbox name=\"rememberMe\"\n [(ngModel)]=\"user.rememberMe\">{{ texts().rememberMe }}</nb-checkbox>\n }\n </div>\n\n <button nbButton\n fullWidth\n status=\"primary\"\n size=\"large\"\n [disabled]=\"submitted || !form.valid\"\n [class.btn-pulse]=\"submitted\">\n {{ texts().loginSubmit }}\n </button>\n</form>\n\n@if (socialLinks && socialLinks.length > 0) {\n<section class=\"links\"\n [attr.aria-label]=\"texts().socialLabel\">\n {{ texts().socialPrompt }}\n <div class=\"socials\">\n @for (socialLink of socialLinks; track socialLink) {\n @if (socialLink.link) {\n <a [routerLink]=\"socialLink.link\"\n [attr.target]=\"socialLink.target\"\n [attr.class]=\"socialLink.icon\"\n [attr.aria-label]=\"socialLink.icon ? socialLink.title : null\"\n [class.with-icon]=\"socialLink.icon\">\n @if (socialLink.icon) {\n <nb-icon [icon]=\"socialLink.icon\" />\n } @else {{{ socialLink.title }}}\n </a>\n }\n @if (socialLink.url) {\n <a [attr.href]=\"socialLink.url\"\n [attr.target]=\"socialLink.target\"\n [attr.class]=\"socialLink.icon\"\n [attr.aria-label]=\"socialLink.icon ? socialLink.title : null\"\n [class.with-icon]=\"socialLink.icon\">\n @if (socialLink.icon) {\n <nb-icon [icon]=\"socialLink.icon\" />\n } @else {{{ socialLink.title }}}\n </a>\n }\n }\n </div>\n</section>\n}\n\n<section class=\"another-action\"\n [attr.aria-label]=\"texts().registerLink\">\n {{ texts().noAccount }} <a class=\"text-link\"\n routerLink=\"../register\">{{ texts().registerLink }}</a>\n</section>\n"
1920
+ }]
1921
+ }]
1922
+ });
1923
+ var NbRegisterComponent = class NbRegisterComponent {
1924
+ constructor() {
1925
+ this.texts = injectNbAuthTexts();
1926
+ this.service = inject(NbAuthService);
1927
+ this.options = inject(NB_AUTH_OPTIONS);
1928
+ this.cd = inject(ChangeDetectorRef);
1929
+ this.router = inject(Router);
1930
+ this.redirectDelay = this.getConfigValue("forms.register.redirectDelay");
1931
+ this.showMessages = this.getConfigValue("forms.register.showMessages");
1932
+ this.strategy = this.getConfigValue("forms.register.strategy");
1933
+ this.submitted = false;
1934
+ this.errors = new Array();
1935
+ this.messages = new Array();
1936
+ this.user = {};
1937
+ this.socialLinks = this.getConfigValue("forms.login.socialLinks");
1938
+ }
1939
+ register() {
1940
+ this.errors = this.messages = [];
1941
+ this.submitted = true;
1942
+ this.service.register(this.strategy, this.user).subscribe((result) => {
1943
+ this.submitted = false;
1944
+ if (result.isSuccess()) this.messages = result.getMessages();
1945
+ else this.errors = result.getErrors();
1946
+ const redirect = result.getRedirect();
1947
+ if (redirect) setTimeout(() => this.router.navigateByUrl(redirect), this.redirectDelay);
1948
+ this.cd.detectChanges();
1949
+ });
1950
+ }
1951
+ getConfigValue(key) {
1952
+ return getDeepFromObject(this.options, key);
1953
+ }
1954
+ static {
1955
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1956
+ minVersion: "12.0.0",
1957
+ version: "22.3.0",
1958
+ ngImport: i0,
1959
+ type: NbRegisterComponent,
1960
+ deps: [],
1961
+ target: i0.ɵɵFactoryTarget.Component
1962
+ });
1963
+ }
1964
+ static {
1965
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
1966
+ minVersion: "17.0.0",
1967
+ version: "22.3.0",
1968
+ type: NbRegisterComponent,
1969
+ isStandalone: true,
1970
+ selector: "nb-register",
1971
+ ngImport: i0,
1972
+ template: "<h1 id=\"title\"\n class=\"title\">{{ texts().registerTitle }}</h1>\n\n@if (showMessages.error && errors?.length && !submitted) {\n<nb-alert status=\"danger\"\n outline\n role=\"alert\">\n <p class=\"alert-title\"><b>{{ texts().errorTitle }}</b></p>\n <ul class=\"alert-message-list\">\n @for (error of errors; track $index) {\n <li class=\"alert-message\">{{ error }}</li>\n }\n </ul>\n</nb-alert>\n}\n\n@if (showMessages.success && messages?.length && !submitted) {\n<nb-alert status=\"success\"\n outline\n role=\"alert\">\n <p class=\"alert-title\"><b>{{ texts().successTitle }}</b></p>\n <ul class=\"alert-message-list\">\n @for (message of messages; track $index) {\n <li class=\"alert-message\">{{ message }}</li>\n }\n </ul>\n</nb-alert>\n}\n\n<form (ngSubmit)=\"register()\"\n #form=\"ngForm\"\n aria-labelledby=\"title\">\n\n <div class=\"form-control-group\">\n <label class=\"label\"\n for=\"input-name\">{{ texts().fullNameLabel }}</label>\n <input nbInput\n [(ngModel)]=\"user.fullName\"\n #fullName=\"ngModel\"\n id=\"input-name\"\n name=\"fullName\"\n [placeholder]=\"texts().fullNamePlaceholder\"\n autofocus\n fullWidth\n fieldSize=\"large\"\n [status]=\"fullName.dirty ? (fullName.invalid ? 'danger' : 'success') : 'basic'\"\n [required]=\"getConfigValue('forms.validation.fullName.required')\"\n [minlength]=\"getConfigValue('forms.validation.fullName.minLength')\"\n [maxlength]=\"getConfigValue('forms.validation.fullName.maxLength')\"\n [attr.aria-invalid]=\"fullName.invalid && fullName.touched ? true : null\">\n @if (fullName.invalid && fullName.touched) {\n @if (fullName.errors?.['required']) {\n <p class=\"caption status-danger\">\n {{ texts().fullNameRequired }}\n </p>\n }\n @if (fullName.errors?.['minlength'] || fullName.errors?.['maxlength']) {\n <p class=\"caption status-danger\">\n {{ texts().fullNameLength(getConfigValue('forms.validation.fullName.minLength'), getConfigValue('forms.validation.fullName.maxLength')) }}\n </p>\n }\n }\n </div>\n\n <div class=\"form-control-group\">\n <label class=\"label\"\n for=\"input-email\">{{ texts().emailLabel }}</label>\n <input nbInput\n [(ngModel)]=\"user.email\"\n #email=\"ngModel\"\n id=\"input-email\"\n name=\"email\"\n pattern=\".+@.+\\..+\"\n [placeholder]=\"texts().emailPlaceholder\"\n fullWidth\n fieldSize=\"large\"\n [status]=\"email.dirty ? (email.invalid ? 'danger' : 'success') : 'basic'\"\n [required]=\"getConfigValue('forms.validation.email.required')\"\n [attr.aria-invalid]=\"email.invalid && email.touched ? true : null\">\n @if (email.invalid && email.touched) {\n @if (email.errors?.['required']) {\n <p class=\"caption status-danger\">\n {{ texts().emailRequired }}\n </p>\n }\n @if (email.errors?.['pattern']) {\n <p class=\"caption status-danger\">\n {{ texts().emailInvalid }}\n </p>\n }\n }\n </div>\n\n <div class=\"form-control-group\">\n <label class=\"label\"\n for=\"input-password\">{{ texts().passwordLabel }}</label>\n <input nbInput\n [(ngModel)]=\"user.password\"\n #password=\"ngModel\"\n type=\"password\"\n id=\"input-password\"\n name=\"password\"\n [placeholder]=\"texts().passwordPlaceholder\"\n fullWidth\n fieldSize=\"large\"\n [status]=\"password.dirty ? (password.invalid ? 'danger' : 'success') : 'basic'\"\n [required]=\"getConfigValue('forms.validation.password.required')\"\n [minlength]=\"getConfigValue('forms.validation.password.minLength')\"\n [maxlength]=\"getConfigValue('forms.validation.password.maxLength')\"\n [attr.aria-invalid]=\"password.invalid && password.touched ? true : null\">\n @if (password.invalid && password.touched) {\n @if (password.errors?.['required']) {\n <p class=\"caption status-danger\">\n {{ texts().passwordRequired }}\n </p>\n }\n @if (password.errors?.['minlength'] || password.errors?.['maxlength']) {\n <p class=\"caption status-danger\">\n {{ texts().passwordLength(getConfigValue('forms.validation.password.minLength'), getConfigValue('forms.validation.password.maxLength')) }}\n </p>\n }\n }\n </div>\n\n <div class=\"form-control-group\">\n <label class=\"label\"\n for=\"input-re-password\">{{ texts().repeatPasswordLabel }}</label>\n <input nbInput\n [(ngModel)]=\"user.confirmPassword\"\n #rePass=\"ngModel\"\n type=\"password\"\n id=\"input-re-password\"\n name=\"rePass\"\n [placeholder]=\"texts().confirmPasswordPlaceholder\"\n fullWidth\n fieldSize=\"large\"\n [status]=\"rePass.dirty ? (rePass.invalid || password.value !== rePass.value ? 'danger' : 'success') : 'basic'\"\n [required]=\"getConfigValue('forms.validation.password.required')\"\n [attr.aria-invalid]=\"(rePass.invalid || password.value !== rePass.value) && rePass.touched ? true : null\">\n @if ((rePass.invalid || password.value !== rePass.value) && rePass.touched) {\n @if (rePass.errors?.['required']) {\n <p class=\"caption status-danger\">\n {{ texts().confirmPasswordRequired }}\n </p>\n }\n @if (password.value !== rePass.value && !rePass.errors?.['required']) {\n <p class=\"caption status-danger\">\n {{ texts().passwordMismatch }}\n </p>\n }\n }\n </div>\n\n @if (getConfigValue('forms.register.terms')) {\n <div class=\"form-control-group accept-group\">\n <nb-checkbox name=\"terms\"\n [(ngModel)]=\"user.terms\"\n [required]=\"getConfigValue('forms.register.terms')\">\n {{ texts().agreeTo }} <a href=\"#\"\n target=\"_blank\"><strong>{{ texts().terms }}</strong></a>\n </nb-checkbox>\n </div>\n }\n\n <button nbButton\n fullWidth\n status=\"primary\"\n size=\"large\"\n [disabled]=\"submitted || !form.valid || user.password !== user.confirmPassword\"\n [class.btn-pulse]=\"submitted\">\n {{ texts().registerSubmit }}\n </button>\n</form>\n\n@if (socialLinks && socialLinks.length > 0) {\n<section class=\"links\"\n [attr.aria-label]=\"texts().socialLabel\">\n {{ texts().socialPrompt }}\n <div class=\"socials\">\n @for (socialLink of socialLinks; track socialLink) {\n @if (socialLink.link) {\n <a [routerLink]=\"socialLink.link\"\n [attr.target]=\"socialLink.target\"\n [attr.class]=\"socialLink.icon\"\n [attr.aria-label]=\"socialLink.icon ? socialLink.title : null\"\n [class.with-icon]=\"socialLink.icon\">\n @if (socialLink.icon) {\n <nb-icon [icon]=\"socialLink.icon\" />\n } @else {{{ socialLink.title }}}\n </a>\n }\n @if (socialLink.url) {\n <a [attr.href]=\"socialLink.url\"\n [attr.target]=\"socialLink.target\"\n [attr.class]=\"socialLink.icon\"\n [attr.aria-label]=\"socialLink.icon ? socialLink.title : null\"\n [class.with-icon]=\"socialLink.icon\">\n @if (socialLink.icon) {\n <nb-icon [icon]=\"socialLink.icon\" />\n } @else {{{ socialLink.title }}}\n </a>\n }\n }\n </div>\n</section>\n}\n\n<section class=\"another-action\"\n [attr.aria-label]=\"texts().signInLabel\">\n {{ texts().haveAccount }} <a class=\"text-link\"\n routerLink=\"../login\">{{ texts().loginLink }}</a>\n</section>\n",
1973
+ styles: [":host .title{margin-bottom:2rem}\n"],
1974
+ dependencies: [
1975
+ {
1976
+ kind: "component",
1977
+ type: NbAlertComponent,
1978
+ selector: "nb-alert",
1979
+ inputs: [
1980
+ "size",
1981
+ "status",
1982
+ "appearance",
1983
+ "filled",
1984
+ "outline",
1985
+ "accent",
1986
+ "closable"
1987
+ ],
1988
+ outputs: ["close"]
1989
+ },
1990
+ {
1991
+ kind: "ngmodule",
1992
+ type: FormsModule
1993
+ },
1994
+ {
1995
+ kind: "directive",
1996
+ type: i1.ɵNgNoValidate,
1997
+ selector: "form:not([ngNoForm]):not([ngNativeValidate])"
1998
+ },
1999
+ {
2000
+ kind: "directive",
2001
+ type: i1.DefaultValueAccessor,
2002
+ selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
2003
+ },
2004
+ {
2005
+ kind: "directive",
2006
+ type: i1.NgControlStatus,
2007
+ selector: "[formControlName],[ngModel],[formControl]"
2008
+ },
2009
+ {
2010
+ kind: "directive",
2011
+ type: i1.NgControlStatusGroup,
2012
+ selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"
2013
+ },
2014
+ {
2015
+ kind: "directive",
2016
+ type: i1.RequiredValidator,
2017
+ selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]",
2018
+ inputs: ["required"]
2019
+ },
2020
+ {
2021
+ kind: "directive",
2022
+ type: i1.MinLengthValidator,
2023
+ selector: "[minlength][formControlName],[minlength][formControl],[minlength][ngModel]",
2024
+ inputs: ["minlength"]
2025
+ },
2026
+ {
2027
+ kind: "directive",
2028
+ type: i1.MaxLengthValidator,
2029
+ selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]",
2030
+ inputs: ["maxlength"]
2031
+ },
2032
+ {
2033
+ kind: "directive",
2034
+ type: i1.PatternValidator,
2035
+ selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]",
2036
+ inputs: ["pattern"]
2037
+ },
2038
+ {
2039
+ kind: "directive",
2040
+ type: i1.NgModel,
2041
+ selector: "[ngModel]:not([formControlName]):not([formControl])",
2042
+ inputs: [
2043
+ "name",
2044
+ "disabled",
2045
+ "ngModel",
2046
+ "ngModelOptions"
2047
+ ],
2048
+ outputs: ["ngModelChange"],
2049
+ exportAs: ["ngModel"]
2050
+ },
2051
+ {
2052
+ kind: "directive",
2053
+ type: i1.NgForm,
2054
+ selector: "form:not([ngNoForm]):not([formGroup]):not([formArray]),ng-form,[ngForm]",
2055
+ inputs: ["ngFormOptions"],
2056
+ outputs: ["ngSubmit"],
2057
+ exportAs: ["ngForm"]
2058
+ },
2059
+ {
2060
+ kind: "directive",
2061
+ type: NbInputDirective,
2062
+ selector: "input[nbInput],textarea[nbInput]",
2063
+ inputs: [
2064
+ "fieldSize",
2065
+ "status",
2066
+ "shape",
2067
+ "fullWidth",
2068
+ "ghost"
2069
+ ]
2070
+ },
2071
+ {
2072
+ kind: "component",
2073
+ type: NbCheckboxComponent,
2074
+ selector: "nb-checkbox",
2075
+ inputs: [
2076
+ "checked",
2077
+ "disabled",
2078
+ "status",
2079
+ "size",
2080
+ "indeterminate"
2081
+ ],
2082
+ outputs: ["checkedChange"]
2083
+ },
2084
+ {
2085
+ kind: "component",
2086
+ type: NbButtonComponent,
2087
+ selector: "button[nbButton],a[nbButton],input[type=\"button\"][nbButton],input[type=\"submit\"][nbButton]",
2088
+ inputs: ["hero", "loading"]
2089
+ },
2090
+ {
2091
+ kind: "directive",
2092
+ type: RouterLink,
2093
+ selector: "[routerLink]",
2094
+ inputs: [
2095
+ "target",
2096
+ "queryParams",
2097
+ "fragment",
2098
+ "queryParamsHandling",
2099
+ "state",
2100
+ "info",
2101
+ "relativeTo",
2102
+ "preserveFragment",
2103
+ "skipLocationChange",
2104
+ "replaceUrl",
2105
+ "browserUrl",
2106
+ "scroll",
2107
+ "routerLink"
2108
+ ]
2109
+ },
2110
+ {
2111
+ kind: "component",
2112
+ type: NbIconComponent,
2113
+ selector: "nb-icon",
2114
+ inputs: [
2115
+ "icon",
2116
+ "pack",
2117
+ "options",
2118
+ "status",
2119
+ "config"
2120
+ ]
2121
+ }
2122
+ ]
2123
+ });
2124
+ }
2125
+ };
2126
+ i0.ɵɵngDeclareClassMetadata({
2127
+ minVersion: "12.0.0",
2128
+ version: "22.3.0",
2129
+ ngImport: i0,
2130
+ type: NbRegisterComponent,
2131
+ decorators: [{
2132
+ type: Component,
2133
+ args: [{
2134
+ selector: "nb-register",
2135
+ imports: [
2136
+ NbAlertComponent,
2137
+ FormsModule,
2138
+ NbInputDirective,
2139
+ NbCheckboxComponent,
2140
+ NbButtonComponent,
2141
+ RouterLink,
2142
+ NbIconComponent
2143
+ ],
2144
+ template: "<h1 id=\"title\"\n class=\"title\">{{ texts().registerTitle }}</h1>\n\n@if (showMessages.error && errors?.length && !submitted) {\n<nb-alert status=\"danger\"\n outline\n role=\"alert\">\n <p class=\"alert-title\"><b>{{ texts().errorTitle }}</b></p>\n <ul class=\"alert-message-list\">\n @for (error of errors; track $index) {\n <li class=\"alert-message\">{{ error }}</li>\n }\n </ul>\n</nb-alert>\n}\n\n@if (showMessages.success && messages?.length && !submitted) {\n<nb-alert status=\"success\"\n outline\n role=\"alert\">\n <p class=\"alert-title\"><b>{{ texts().successTitle }}</b></p>\n <ul class=\"alert-message-list\">\n @for (message of messages; track $index) {\n <li class=\"alert-message\">{{ message }}</li>\n }\n </ul>\n</nb-alert>\n}\n\n<form (ngSubmit)=\"register()\"\n #form=\"ngForm\"\n aria-labelledby=\"title\">\n\n <div class=\"form-control-group\">\n <label class=\"label\"\n for=\"input-name\">{{ texts().fullNameLabel }}</label>\n <input nbInput\n [(ngModel)]=\"user.fullName\"\n #fullName=\"ngModel\"\n id=\"input-name\"\n name=\"fullName\"\n [placeholder]=\"texts().fullNamePlaceholder\"\n autofocus\n fullWidth\n fieldSize=\"large\"\n [status]=\"fullName.dirty ? (fullName.invalid ? 'danger' : 'success') : 'basic'\"\n [required]=\"getConfigValue('forms.validation.fullName.required')\"\n [minlength]=\"getConfigValue('forms.validation.fullName.minLength')\"\n [maxlength]=\"getConfigValue('forms.validation.fullName.maxLength')\"\n [attr.aria-invalid]=\"fullName.invalid && fullName.touched ? true : null\">\n @if (fullName.invalid && fullName.touched) {\n @if (fullName.errors?.['required']) {\n <p class=\"caption status-danger\">\n {{ texts().fullNameRequired }}\n </p>\n }\n @if (fullName.errors?.['minlength'] || fullName.errors?.['maxlength']) {\n <p class=\"caption status-danger\">\n {{ texts().fullNameLength(getConfigValue('forms.validation.fullName.minLength'), getConfigValue('forms.validation.fullName.maxLength')) }}\n </p>\n }\n }\n </div>\n\n <div class=\"form-control-group\">\n <label class=\"label\"\n for=\"input-email\">{{ texts().emailLabel }}</label>\n <input nbInput\n [(ngModel)]=\"user.email\"\n #email=\"ngModel\"\n id=\"input-email\"\n name=\"email\"\n pattern=\".+@.+\\..+\"\n [placeholder]=\"texts().emailPlaceholder\"\n fullWidth\n fieldSize=\"large\"\n [status]=\"email.dirty ? (email.invalid ? 'danger' : 'success') : 'basic'\"\n [required]=\"getConfigValue('forms.validation.email.required')\"\n [attr.aria-invalid]=\"email.invalid && email.touched ? true : null\">\n @if (email.invalid && email.touched) {\n @if (email.errors?.['required']) {\n <p class=\"caption status-danger\">\n {{ texts().emailRequired }}\n </p>\n }\n @if (email.errors?.['pattern']) {\n <p class=\"caption status-danger\">\n {{ texts().emailInvalid }}\n </p>\n }\n }\n </div>\n\n <div class=\"form-control-group\">\n <label class=\"label\"\n for=\"input-password\">{{ texts().passwordLabel }}</label>\n <input nbInput\n [(ngModel)]=\"user.password\"\n #password=\"ngModel\"\n type=\"password\"\n id=\"input-password\"\n name=\"password\"\n [placeholder]=\"texts().passwordPlaceholder\"\n fullWidth\n fieldSize=\"large\"\n [status]=\"password.dirty ? (password.invalid ? 'danger' : 'success') : 'basic'\"\n [required]=\"getConfigValue('forms.validation.password.required')\"\n [minlength]=\"getConfigValue('forms.validation.password.minLength')\"\n [maxlength]=\"getConfigValue('forms.validation.password.maxLength')\"\n [attr.aria-invalid]=\"password.invalid && password.touched ? true : null\">\n @if (password.invalid && password.touched) {\n @if (password.errors?.['required']) {\n <p class=\"caption status-danger\">\n {{ texts().passwordRequired }}\n </p>\n }\n @if (password.errors?.['minlength'] || password.errors?.['maxlength']) {\n <p class=\"caption status-danger\">\n {{ texts().passwordLength(getConfigValue('forms.validation.password.minLength'), getConfigValue('forms.validation.password.maxLength')) }}\n </p>\n }\n }\n </div>\n\n <div class=\"form-control-group\">\n <label class=\"label\"\n for=\"input-re-password\">{{ texts().repeatPasswordLabel }}</label>\n <input nbInput\n [(ngModel)]=\"user.confirmPassword\"\n #rePass=\"ngModel\"\n type=\"password\"\n id=\"input-re-password\"\n name=\"rePass\"\n [placeholder]=\"texts().confirmPasswordPlaceholder\"\n fullWidth\n fieldSize=\"large\"\n [status]=\"rePass.dirty ? (rePass.invalid || password.value !== rePass.value ? 'danger' : 'success') : 'basic'\"\n [required]=\"getConfigValue('forms.validation.password.required')\"\n [attr.aria-invalid]=\"(rePass.invalid || password.value !== rePass.value) && rePass.touched ? true : null\">\n @if ((rePass.invalid || password.value !== rePass.value) && rePass.touched) {\n @if (rePass.errors?.['required']) {\n <p class=\"caption status-danger\">\n {{ texts().confirmPasswordRequired }}\n </p>\n }\n @if (password.value !== rePass.value && !rePass.errors?.['required']) {\n <p class=\"caption status-danger\">\n {{ texts().passwordMismatch }}\n </p>\n }\n }\n </div>\n\n @if (getConfigValue('forms.register.terms')) {\n <div class=\"form-control-group accept-group\">\n <nb-checkbox name=\"terms\"\n [(ngModel)]=\"user.terms\"\n [required]=\"getConfigValue('forms.register.terms')\">\n {{ texts().agreeTo }} <a href=\"#\"\n target=\"_blank\"><strong>{{ texts().terms }}</strong></a>\n </nb-checkbox>\n </div>\n }\n\n <button nbButton\n fullWidth\n status=\"primary\"\n size=\"large\"\n [disabled]=\"submitted || !form.valid || user.password !== user.confirmPassword\"\n [class.btn-pulse]=\"submitted\">\n {{ texts().registerSubmit }}\n </button>\n</form>\n\n@if (socialLinks && socialLinks.length > 0) {\n<section class=\"links\"\n [attr.aria-label]=\"texts().socialLabel\">\n {{ texts().socialPrompt }}\n <div class=\"socials\">\n @for (socialLink of socialLinks; track socialLink) {\n @if (socialLink.link) {\n <a [routerLink]=\"socialLink.link\"\n [attr.target]=\"socialLink.target\"\n [attr.class]=\"socialLink.icon\"\n [attr.aria-label]=\"socialLink.icon ? socialLink.title : null\"\n [class.with-icon]=\"socialLink.icon\">\n @if (socialLink.icon) {\n <nb-icon [icon]=\"socialLink.icon\" />\n } @else {{{ socialLink.title }}}\n </a>\n }\n @if (socialLink.url) {\n <a [attr.href]=\"socialLink.url\"\n [attr.target]=\"socialLink.target\"\n [attr.class]=\"socialLink.icon\"\n [attr.aria-label]=\"socialLink.icon ? socialLink.title : null\"\n [class.with-icon]=\"socialLink.icon\">\n @if (socialLink.icon) {\n <nb-icon [icon]=\"socialLink.icon\" />\n } @else {{{ socialLink.title }}}\n </a>\n }\n }\n </div>\n</section>\n}\n\n<section class=\"another-action\"\n [attr.aria-label]=\"texts().signInLabel\">\n {{ texts().haveAccount }} <a class=\"text-link\"\n routerLink=\"../login\">{{ texts().loginLink }}</a>\n</section>\n",
2145
+ styles: [":host .title{margin-bottom:2rem}\n"]
2146
+ }]
2147
+ }]
2148
+ });
2149
+ var NbLogoutComponent = class NbLogoutComponent {
2150
+ constructor() {
2151
+ this.texts = injectNbAuthTexts();
2152
+ this.service = inject(NbAuthService);
2153
+ this.options = inject(NB_AUTH_OPTIONS);
2154
+ this.router = inject(Router);
2155
+ this.redirectDelay = this.getConfigValue("forms.logout.redirectDelay");
2156
+ this.strategy = this.getConfigValue("forms.logout.strategy");
2157
+ }
2158
+ ngOnInit() {
2159
+ this.logout(this.strategy);
2160
+ }
2161
+ logout(strategy) {
2162
+ this.service.logout(strategy).subscribe((result) => {
2163
+ const redirect = result.getRedirect();
2164
+ if (redirect) setTimeout(() => this.router.navigateByUrl(redirect), this.redirectDelay);
2165
+ });
2166
+ }
2167
+ getConfigValue(key) {
2168
+ return getDeepFromObject(this.options, key);
2169
+ }
2170
+ static {
2171
+ this.ɵfac = i0.ɵɵngDeclareFactory({
2172
+ minVersion: "12.0.0",
2173
+ version: "22.3.0",
2174
+ ngImport: i0,
2175
+ type: NbLogoutComponent,
2176
+ deps: [],
2177
+ target: i0.ɵɵFactoryTarget.Component
2178
+ });
2179
+ }
2180
+ static {
2181
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
2182
+ minVersion: "14.0.0",
2183
+ version: "22.3.0",
2184
+ type: NbLogoutComponent,
2185
+ isStandalone: true,
2186
+ selector: "nb-logout",
2187
+ ngImport: i0,
2188
+ template: "<div>{{ texts().loggingOut }}</div>\n"
2189
+ });
2190
+ }
2191
+ };
2192
+ i0.ɵɵngDeclareClassMetadata({
2193
+ minVersion: "12.0.0",
2194
+ version: "22.3.0",
2195
+ ngImport: i0,
2196
+ type: NbLogoutComponent,
2197
+ decorators: [{
2198
+ type: Component,
2199
+ args: [{
2200
+ selector: "nb-logout",
2201
+ template: "<div>{{ texts().loggingOut }}</div>\n"
2202
+ }]
2203
+ }]
2204
+ });
2205
+ var NbRequestPasswordComponent = class NbRequestPasswordComponent {
2206
+ constructor() {
2207
+ this.texts = injectNbAuthTexts();
2208
+ this.service = inject(NbAuthService);
2209
+ this.options = inject(NB_AUTH_OPTIONS);
2210
+ this.cd = inject(ChangeDetectorRef);
2211
+ this.router = inject(Router);
2212
+ this.redirectDelay = this.getConfigValue("forms.requestPassword.redirectDelay");
2213
+ this.showMessages = this.getConfigValue("forms.requestPassword.showMessages");
2214
+ this.strategy = this.getConfigValue("forms.requestPassword.strategy");
2215
+ this.submitted = false;
2216
+ this.errors = new Array();
2217
+ this.messages = new Array();
2218
+ this.user = {};
2219
+ }
2220
+ requestPass() {
2221
+ this.errors = this.messages = [];
2222
+ this.submitted = true;
2223
+ this.service.requestPassword(this.strategy, this.user).subscribe((result) => {
2224
+ this.submitted = false;
2225
+ if (result.isSuccess()) this.messages = result.getMessages();
2226
+ else this.errors = result.getErrors();
2227
+ const redirect = result.getRedirect();
2228
+ if (redirect) setTimeout(() => this.router.navigateByUrl(redirect), this.redirectDelay);
2229
+ this.cd.detectChanges();
2230
+ });
2231
+ }
2232
+ getConfigValue(key) {
2233
+ return getDeepFromObject(this.options, key);
2234
+ }
2235
+ static {
2236
+ this.ɵfac = i0.ɵɵngDeclareFactory({
2237
+ minVersion: "12.0.0",
2238
+ version: "22.3.0",
2239
+ ngImport: i0,
2240
+ type: NbRequestPasswordComponent,
2241
+ deps: [],
2242
+ target: i0.ɵɵFactoryTarget.Component
2243
+ });
2244
+ }
2245
+ static {
2246
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
2247
+ minVersion: "17.0.0",
2248
+ version: "22.3.0",
2249
+ type: NbRequestPasswordComponent,
2250
+ isStandalone: true,
2251
+ selector: "nb-request-password-page",
2252
+ ngImport: i0,
2253
+ template: "<h1 id=\"title\"\n class=\"title\">{{ texts().requestPasswordTitle }}</h1>\n<p class=\"sub-title\">{{ texts().requestPasswordSubtitle }}</p>\n\n@if (showMessages.error && errors?.length && !submitted) {\n<nb-alert status=\"danger\"\n outline\n role=\"alert\">\n <p class=\"alert-title\"><b>{{ texts().errorTitle }}</b></p>\n <ul class=\"alert-message-list\">\n @for (error of errors; track $index) {\n <li class=\"alert-message\">{{ error }}</li>\n }\n </ul>\n</nb-alert>\n}\n\n@if (showMessages.success && messages?.length && !submitted) {\n<nb-alert status=\"success\"\n outline\n role=\"alert\">\n <p class=\"alert-title\"><b>{{ texts().successTitle }}</b></p>\n <ul class=\"alert-message-list\">\n @for (message of messages; track $index) {\n <li class=\"alert-message\">{{ message }}</li>\n }\n </ul>\n</nb-alert>\n}\n\n<form (ngSubmit)=\"requestPass()\"\n #requestPassForm=\"ngForm\"\n aria-labelledby=\"title\">\n\n <div class=\"form-control-group\">\n <label class=\"label\"\n for=\"input-email\">{{ texts().requestPasswordEmailLabel }}</label>\n <input nbInput\n [(ngModel)]=\"user.email\"\n #email=\"ngModel\"\n id=\"input-email\"\n name=\"email\"\n pattern=\".+@.+\\..+\"\n [placeholder]=\"texts().emailPlaceholder\"\n autofocus\n fullWidth\n fieldSize=\"large\"\n [status]=\"email.dirty ? (email.invalid ? 'danger' : 'success') : 'basic'\"\n [required]=\"getConfigValue('forms.validation.email.required')\"\n [attr.aria-invalid]=\"email.invalid && email.touched ? true : null\">\n @if (email.invalid && email.touched) {\n @if (email.errors?.['required']) {\n <p class=\"caption status-danger\">\n {{ texts().emailRequired }}\n </p>\n }\n @if (email.errors?.['pattern']) {\n <p class=\"caption status-danger\">\n {{ texts().emailInvalid }}\n </p>\n }\n }\n </div>\n\n <button nbButton\n fullWidth\n status=\"primary\"\n size=\"large\"\n [disabled]=\"submitted || !requestPassForm.valid\"\n [class.btn-pulse]=\"submitted\">\n {{ texts().requestPasswordSubmit }}\n </button>\n</form>\n\n<section class=\"sign-in-or-up\"\n [attr.aria-label]=\"texts().signInOrUpLabel\">\n <p><a class=\"text-link\"\n routerLink=\"../login\">{{ texts().backToLogin }}</a></p>\n <p><a routerLink=\"../register\"\n class=\"text-link\">{{ texts().registerLink }}</a></p>\n</section>\n",
2254
+ dependencies: [
2255
+ {
2256
+ kind: "component",
2257
+ type: NbAlertComponent,
2258
+ selector: "nb-alert",
2259
+ inputs: [
2260
+ "size",
2261
+ "status",
2262
+ "appearance",
2263
+ "filled",
2264
+ "outline",
2265
+ "accent",
2266
+ "closable"
2267
+ ],
2268
+ outputs: ["close"]
2269
+ },
2270
+ {
2271
+ kind: "ngmodule",
2272
+ type: FormsModule
2273
+ },
2274
+ {
2275
+ kind: "directive",
2276
+ type: i1.ɵNgNoValidate,
2277
+ selector: "form:not([ngNoForm]):not([ngNativeValidate])"
2278
+ },
2279
+ {
2280
+ kind: "directive",
2281
+ type: i1.DefaultValueAccessor,
2282
+ selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
2283
+ },
2284
+ {
2285
+ kind: "directive",
2286
+ type: i1.NgControlStatus,
2287
+ selector: "[formControlName],[ngModel],[formControl]"
2288
+ },
2289
+ {
2290
+ kind: "directive",
2291
+ type: i1.NgControlStatusGroup,
2292
+ selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"
2293
+ },
2294
+ {
2295
+ kind: "directive",
2296
+ type: i1.RequiredValidator,
2297
+ selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]",
2298
+ inputs: ["required"]
2299
+ },
2300
+ {
2301
+ kind: "directive",
2302
+ type: i1.PatternValidator,
2303
+ selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]",
2304
+ inputs: ["pattern"]
2305
+ },
2306
+ {
2307
+ kind: "directive",
2308
+ type: i1.NgModel,
2309
+ selector: "[ngModel]:not([formControlName]):not([formControl])",
2310
+ inputs: [
2311
+ "name",
2312
+ "disabled",
2313
+ "ngModel",
2314
+ "ngModelOptions"
2315
+ ],
2316
+ outputs: ["ngModelChange"],
2317
+ exportAs: ["ngModel"]
2318
+ },
2319
+ {
2320
+ kind: "directive",
2321
+ type: i1.NgForm,
2322
+ selector: "form:not([ngNoForm]):not([formGroup]):not([formArray]),ng-form,[ngForm]",
2323
+ inputs: ["ngFormOptions"],
2324
+ outputs: ["ngSubmit"],
2325
+ exportAs: ["ngForm"]
2326
+ },
2327
+ {
2328
+ kind: "directive",
2329
+ type: NbInputDirective,
2330
+ selector: "input[nbInput],textarea[nbInput]",
2331
+ inputs: [
2332
+ "fieldSize",
2333
+ "status",
2334
+ "shape",
2335
+ "fullWidth",
2336
+ "ghost"
2337
+ ]
2338
+ },
2339
+ {
2340
+ kind: "component",
2341
+ type: NbButtonComponent,
2342
+ selector: "button[nbButton],a[nbButton],input[type=\"button\"][nbButton],input[type=\"submit\"][nbButton]",
2343
+ inputs: ["hero", "loading"]
2344
+ },
2345
+ {
2346
+ kind: "directive",
2347
+ type: RouterLink,
2348
+ selector: "[routerLink]",
2349
+ inputs: [
2350
+ "target",
2351
+ "queryParams",
2352
+ "fragment",
2353
+ "queryParamsHandling",
2354
+ "state",
2355
+ "info",
2356
+ "relativeTo",
2357
+ "preserveFragment",
2358
+ "skipLocationChange",
2359
+ "replaceUrl",
2360
+ "browserUrl",
2361
+ "scroll",
2362
+ "routerLink"
2363
+ ]
2364
+ }
2365
+ ]
2366
+ });
2367
+ }
2368
+ };
2369
+ i0.ɵɵngDeclareClassMetadata({
2370
+ minVersion: "12.0.0",
2371
+ version: "22.3.0",
2372
+ ngImport: i0,
2373
+ type: NbRequestPasswordComponent,
2374
+ decorators: [{
2375
+ type: Component,
2376
+ args: [{
2377
+ selector: "nb-request-password-page",
2378
+ imports: [
2379
+ NbAlertComponent,
2380
+ FormsModule,
2381
+ NbInputDirective,
2382
+ NbButtonComponent,
2383
+ RouterLink
2384
+ ],
2385
+ template: "<h1 id=\"title\"\n class=\"title\">{{ texts().requestPasswordTitle }}</h1>\n<p class=\"sub-title\">{{ texts().requestPasswordSubtitle }}</p>\n\n@if (showMessages.error && errors?.length && !submitted) {\n<nb-alert status=\"danger\"\n outline\n role=\"alert\">\n <p class=\"alert-title\"><b>{{ texts().errorTitle }}</b></p>\n <ul class=\"alert-message-list\">\n @for (error of errors; track $index) {\n <li class=\"alert-message\">{{ error }}</li>\n }\n </ul>\n</nb-alert>\n}\n\n@if (showMessages.success && messages?.length && !submitted) {\n<nb-alert status=\"success\"\n outline\n role=\"alert\">\n <p class=\"alert-title\"><b>{{ texts().successTitle }}</b></p>\n <ul class=\"alert-message-list\">\n @for (message of messages; track $index) {\n <li class=\"alert-message\">{{ message }}</li>\n }\n </ul>\n</nb-alert>\n}\n\n<form (ngSubmit)=\"requestPass()\"\n #requestPassForm=\"ngForm\"\n aria-labelledby=\"title\">\n\n <div class=\"form-control-group\">\n <label class=\"label\"\n for=\"input-email\">{{ texts().requestPasswordEmailLabel }}</label>\n <input nbInput\n [(ngModel)]=\"user.email\"\n #email=\"ngModel\"\n id=\"input-email\"\n name=\"email\"\n pattern=\".+@.+\\..+\"\n [placeholder]=\"texts().emailPlaceholder\"\n autofocus\n fullWidth\n fieldSize=\"large\"\n [status]=\"email.dirty ? (email.invalid ? 'danger' : 'success') : 'basic'\"\n [required]=\"getConfigValue('forms.validation.email.required')\"\n [attr.aria-invalid]=\"email.invalid && email.touched ? true : null\">\n @if (email.invalid && email.touched) {\n @if (email.errors?.['required']) {\n <p class=\"caption status-danger\">\n {{ texts().emailRequired }}\n </p>\n }\n @if (email.errors?.['pattern']) {\n <p class=\"caption status-danger\">\n {{ texts().emailInvalid }}\n </p>\n }\n }\n </div>\n\n <button nbButton\n fullWidth\n status=\"primary\"\n size=\"large\"\n [disabled]=\"submitted || !requestPassForm.valid\"\n [class.btn-pulse]=\"submitted\">\n {{ texts().requestPasswordSubmit }}\n </button>\n</form>\n\n<section class=\"sign-in-or-up\"\n [attr.aria-label]=\"texts().signInOrUpLabel\">\n <p><a class=\"text-link\"\n routerLink=\"../login\">{{ texts().backToLogin }}</a></p>\n <p><a routerLink=\"../register\"\n class=\"text-link\">{{ texts().registerLink }}</a></p>\n</section>\n"
2386
+ }]
2387
+ }]
2388
+ });
2389
+ var NbResetPasswordComponent = class NbResetPasswordComponent {
2390
+ constructor() {
2391
+ this.texts = injectNbAuthTexts();
2392
+ this.service = inject(NbAuthService);
2393
+ this.options = inject(NB_AUTH_OPTIONS);
2394
+ this.cd = inject(ChangeDetectorRef);
2395
+ this.router = inject(Router);
2396
+ this.redirectDelay = this.getConfigValue("forms.resetPassword.redirectDelay");
2397
+ this.showMessages = this.getConfigValue("forms.resetPassword.showMessages");
2398
+ this.strategy = this.getConfigValue("forms.resetPassword.strategy");
2399
+ this.submitted = false;
2400
+ this.errors = new Array();
2401
+ this.messages = new Array();
2402
+ this.user = {};
2403
+ }
2404
+ resetPass() {
2405
+ this.errors = this.messages = [];
2406
+ this.submitted = true;
2407
+ this.service.resetPassword(this.strategy, this.user).subscribe((result) => {
2408
+ this.submitted = false;
2409
+ if (result.isSuccess()) this.messages = result.getMessages();
2410
+ else this.errors = result.getErrors();
2411
+ const redirect = result.getRedirect();
2412
+ if (redirect) setTimeout(() => this.router.navigateByUrl(redirect), this.redirectDelay);
2413
+ this.cd.detectChanges();
2414
+ });
2415
+ }
2416
+ getConfigValue(key) {
2417
+ return getDeepFromObject(this.options, key);
2418
+ }
2419
+ static {
2420
+ this.ɵfac = i0.ɵɵngDeclareFactory({
2421
+ minVersion: "12.0.0",
2422
+ version: "22.3.0",
2423
+ ngImport: i0,
2424
+ type: NbResetPasswordComponent,
2425
+ deps: [],
2426
+ target: i0.ɵɵFactoryTarget.Component
2427
+ });
2428
+ }
2429
+ static {
2430
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
2431
+ minVersion: "17.0.0",
2432
+ version: "22.3.0",
2433
+ type: NbResetPasswordComponent,
2434
+ isStandalone: true,
2435
+ selector: "nb-reset-password-page",
2436
+ ngImport: i0,
2437
+ template: "<h1 id=\"title\"\n class=\"title\">{{ texts().resetPasswordTitle }}</h1>\n<p class=\"sub-title\">{{ texts().resetPasswordSubtitle }}</p>\n\n@if (showMessages.error && errors?.length && !submitted) {\n<nb-alert status=\"danger\"\n outline\n role=\"alert\">\n <p class=\"alert-title\"><b>{{ texts().errorTitle }}</b></p>\n <ul class=\"alert-message-list\">\n @for (error of errors; track $index) {\n <li class=\"alert-message\">{{ error }}</li>\n }\n </ul>\n</nb-alert>\n}\n\n@if (showMessages.success && messages?.length && !submitted) {\n<nb-alert status=\"success\"\n outline\n role=\"alert\">\n <p class=\"alert-title\"><b>{{ texts().successTitle }}</b></p>\n <ul class=\"alert-message-list\">\n @for (message of messages; track $index) {\n <li class=\"alert-message\">{{ message }}</li>\n }\n </ul>\n</nb-alert>\n}\n\n<form (ngSubmit)=\"resetPass()\"\n #resetPassForm=\"ngForm\"\n aria-labelledby=\"title\">\n\n <div class=\"form-control-group\">\n <label class=\"label\"\n for=\"input-password\">{{ texts().newPasswordLabel }}</label>\n <input nbInput\n [(ngModel)]=\"user.password\"\n #password=\"ngModel\"\n type=\"password\"\n id=\"input-password\"\n name=\"password\"\n class=\"first\"\n [placeholder]=\"texts().newPasswordPlaceholder\"\n autofocus\n fullWidth\n fieldSize=\"large\"\n [status]=\"password.dirty ? (password.invalid ? 'danger' : 'success') : 'basic'\"\n [required]=\"getConfigValue('forms.validation.password.required')\"\n [minlength]=\"getConfigValue('forms.validation.password.minLength')\"\n [maxlength]=\"getConfigValue('forms.validation.password.maxLength')\"\n [attr.aria-invalid]=\"password.invalid && password.touched ? true : null\">\n @if (password.invalid && password.touched) {\n @if (password.errors?.['required']) {\n <p class=\"caption status-danger\">\n {{ texts().passwordRequired }}\n </p>\n }\n @if (password.errors?.['minlength'] || password.errors?.['maxlength']) {\n <p class=\"caption status-danger\">\n {{ texts().passwordLength(getConfigValue('forms.validation.password.minLength'), getConfigValue('forms.validation.password.maxLength')) }}\n </p>\n }\n }\n </div>\n\n <div class=\"form-control-group\">\n <label class=\"label\"\n for=\"input-re-password\">{{ texts().confirmPasswordLabel }}</label>\n <input nbInput\n [(ngModel)]=\"user.confirmPassword\"\n #rePass=\"ngModel\"\n id=\"input-re-password\"\n name=\"rePass\"\n type=\"password\"\n class=\"last\"\n [placeholder]=\"texts().confirmPasswordPlaceholder\"\n fullWidth\n fieldSize=\"large\"\n [status]=\"rePass.touched\n ? (rePass.invalid || password.value !== rePass.value ? 'danger' : 'success')\n : 'basic'\"\n [required]=\"getConfigValue('forms.validation.password.required')\"\n [attr.aria-invalid]=\"rePass.invalid && rePass.touched ? true : null\">\n @if (rePass.touched) {\n @if (rePass.invalid && rePass.errors?.['required']) {\n <p class=\"caption status-danger\">\n {{ texts().confirmPasswordRequired }}\n </p>\n }\n @if (password.value !== rePass.value && !rePass.errors?.['required']) {\n <p class=\"caption status-danger\">\n {{ texts().passwordMismatch }}\n </p>\n }\n }\n </div>\n\n <button nbButton\n status=\"primary\"\n fullWidth\n size=\"large\"\n [disabled]=\"submitted || !resetPassForm.valid\"\n [class.btn-pulse]=\"submitted\">\n {{ texts().resetPasswordSubmit }}\n </button>\n</form>\n\n<section class=\"sign-in-or-up\"\n [attr.aria-label]=\"texts().signInOrUpLabel\">\n <p><a class=\"text-link\"\n routerLink=\"../login\">{{ texts().backToLogin }}</a></p>\n <p><a class=\"text-link\"\n routerLink=\"../register\">{{ texts().registerLink }}</a></p>\n</section>\n",
2438
+ styles: [":host .form-control-group:last-of-type{margin-bottom:3rem}\n"],
2439
+ dependencies: [
2440
+ {
2441
+ kind: "component",
2442
+ type: NbAlertComponent,
2443
+ selector: "nb-alert",
2444
+ inputs: [
2445
+ "size",
2446
+ "status",
2447
+ "appearance",
2448
+ "filled",
2449
+ "outline",
2450
+ "accent",
2451
+ "closable"
2452
+ ],
2453
+ outputs: ["close"]
2454
+ },
2455
+ {
2456
+ kind: "ngmodule",
2457
+ type: FormsModule
2458
+ },
2459
+ {
2460
+ kind: "directive",
2461
+ type: i1.ɵNgNoValidate,
2462
+ selector: "form:not([ngNoForm]):not([ngNativeValidate])"
2463
+ },
2464
+ {
2465
+ kind: "directive",
2466
+ type: i1.DefaultValueAccessor,
2467
+ selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
2468
+ },
2469
+ {
2470
+ kind: "directive",
2471
+ type: i1.NgControlStatus,
2472
+ selector: "[formControlName],[ngModel],[formControl]"
2473
+ },
2474
+ {
2475
+ kind: "directive",
2476
+ type: i1.NgControlStatusGroup,
2477
+ selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"
2478
+ },
2479
+ {
2480
+ kind: "directive",
2481
+ type: i1.RequiredValidator,
2482
+ selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]",
2483
+ inputs: ["required"]
2484
+ },
2485
+ {
2486
+ kind: "directive",
2487
+ type: i1.MinLengthValidator,
2488
+ selector: "[minlength][formControlName],[minlength][formControl],[minlength][ngModel]",
2489
+ inputs: ["minlength"]
2490
+ },
2491
+ {
2492
+ kind: "directive",
2493
+ type: i1.MaxLengthValidator,
2494
+ selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]",
2495
+ inputs: ["maxlength"]
2496
+ },
2497
+ {
2498
+ kind: "directive",
2499
+ type: i1.NgModel,
2500
+ selector: "[ngModel]:not([formControlName]):not([formControl])",
2501
+ inputs: [
2502
+ "name",
2503
+ "disabled",
2504
+ "ngModel",
2505
+ "ngModelOptions"
2506
+ ],
2507
+ outputs: ["ngModelChange"],
2508
+ exportAs: ["ngModel"]
2509
+ },
2510
+ {
2511
+ kind: "directive",
2512
+ type: i1.NgForm,
2513
+ selector: "form:not([ngNoForm]):not([formGroup]):not([formArray]),ng-form,[ngForm]",
2514
+ inputs: ["ngFormOptions"],
2515
+ outputs: ["ngSubmit"],
2516
+ exportAs: ["ngForm"]
2517
+ },
2518
+ {
2519
+ kind: "directive",
2520
+ type: NbInputDirective,
2521
+ selector: "input[nbInput],textarea[nbInput]",
2522
+ inputs: [
2523
+ "fieldSize",
2524
+ "status",
2525
+ "shape",
2526
+ "fullWidth",
2527
+ "ghost"
2528
+ ]
2529
+ },
2530
+ {
2531
+ kind: "component",
2532
+ type: NbButtonComponent,
2533
+ selector: "button[nbButton],a[nbButton],input[type=\"button\"][nbButton],input[type=\"submit\"][nbButton]",
2534
+ inputs: ["hero", "loading"]
2535
+ },
2536
+ {
2537
+ kind: "directive",
2538
+ type: RouterLink,
2539
+ selector: "[routerLink]",
2540
+ inputs: [
2541
+ "target",
2542
+ "queryParams",
2543
+ "fragment",
2544
+ "queryParamsHandling",
2545
+ "state",
2546
+ "info",
2547
+ "relativeTo",
2548
+ "preserveFragment",
2549
+ "skipLocationChange",
2550
+ "replaceUrl",
2551
+ "browserUrl",
2552
+ "scroll",
2553
+ "routerLink"
2554
+ ]
2555
+ }
2556
+ ]
2557
+ });
2558
+ }
2559
+ };
2560
+ i0.ɵɵngDeclareClassMetadata({
2561
+ minVersion: "12.0.0",
2562
+ version: "22.3.0",
2563
+ ngImport: i0,
2564
+ type: NbResetPasswordComponent,
2565
+ decorators: [{
2566
+ type: Component,
2567
+ args: [{
2568
+ selector: "nb-reset-password-page",
2569
+ imports: [
2570
+ NbAlertComponent,
2571
+ FormsModule,
2572
+ NbInputDirective,
2573
+ NbButtonComponent,
2574
+ RouterLink
2575
+ ],
2576
+ template: "<h1 id=\"title\"\n class=\"title\">{{ texts().resetPasswordTitle }}</h1>\n<p class=\"sub-title\">{{ texts().resetPasswordSubtitle }}</p>\n\n@if (showMessages.error && errors?.length && !submitted) {\n<nb-alert status=\"danger\"\n outline\n role=\"alert\">\n <p class=\"alert-title\"><b>{{ texts().errorTitle }}</b></p>\n <ul class=\"alert-message-list\">\n @for (error of errors; track $index) {\n <li class=\"alert-message\">{{ error }}</li>\n }\n </ul>\n</nb-alert>\n}\n\n@if (showMessages.success && messages?.length && !submitted) {\n<nb-alert status=\"success\"\n outline\n role=\"alert\">\n <p class=\"alert-title\"><b>{{ texts().successTitle }}</b></p>\n <ul class=\"alert-message-list\">\n @for (message of messages; track $index) {\n <li class=\"alert-message\">{{ message }}</li>\n }\n </ul>\n</nb-alert>\n}\n\n<form (ngSubmit)=\"resetPass()\"\n #resetPassForm=\"ngForm\"\n aria-labelledby=\"title\">\n\n <div class=\"form-control-group\">\n <label class=\"label\"\n for=\"input-password\">{{ texts().newPasswordLabel }}</label>\n <input nbInput\n [(ngModel)]=\"user.password\"\n #password=\"ngModel\"\n type=\"password\"\n id=\"input-password\"\n name=\"password\"\n class=\"first\"\n [placeholder]=\"texts().newPasswordPlaceholder\"\n autofocus\n fullWidth\n fieldSize=\"large\"\n [status]=\"password.dirty ? (password.invalid ? 'danger' : 'success') : 'basic'\"\n [required]=\"getConfigValue('forms.validation.password.required')\"\n [minlength]=\"getConfigValue('forms.validation.password.minLength')\"\n [maxlength]=\"getConfigValue('forms.validation.password.maxLength')\"\n [attr.aria-invalid]=\"password.invalid && password.touched ? true : null\">\n @if (password.invalid && password.touched) {\n @if (password.errors?.['required']) {\n <p class=\"caption status-danger\">\n {{ texts().passwordRequired }}\n </p>\n }\n @if (password.errors?.['minlength'] || password.errors?.['maxlength']) {\n <p class=\"caption status-danger\">\n {{ texts().passwordLength(getConfigValue('forms.validation.password.minLength'), getConfigValue('forms.validation.password.maxLength')) }}\n </p>\n }\n }\n </div>\n\n <div class=\"form-control-group\">\n <label class=\"label\"\n for=\"input-re-password\">{{ texts().confirmPasswordLabel }}</label>\n <input nbInput\n [(ngModel)]=\"user.confirmPassword\"\n #rePass=\"ngModel\"\n id=\"input-re-password\"\n name=\"rePass\"\n type=\"password\"\n class=\"last\"\n [placeholder]=\"texts().confirmPasswordPlaceholder\"\n fullWidth\n fieldSize=\"large\"\n [status]=\"rePass.touched\n ? (rePass.invalid || password.value !== rePass.value ? 'danger' : 'success')\n : 'basic'\"\n [required]=\"getConfigValue('forms.validation.password.required')\"\n [attr.aria-invalid]=\"rePass.invalid && rePass.touched ? true : null\">\n @if (rePass.touched) {\n @if (rePass.invalid && rePass.errors?.['required']) {\n <p class=\"caption status-danger\">\n {{ texts().confirmPasswordRequired }}\n </p>\n }\n @if (password.value !== rePass.value && !rePass.errors?.['required']) {\n <p class=\"caption status-danger\">\n {{ texts().passwordMismatch }}\n </p>\n }\n }\n </div>\n\n <button nbButton\n status=\"primary\"\n fullWidth\n size=\"large\"\n [disabled]=\"submitted || !resetPassForm.valid\"\n [class.btn-pulse]=\"submitted\">\n {{ texts().resetPasswordSubmit }}\n </button>\n</form>\n\n<section class=\"sign-in-or-up\"\n [attr.aria-label]=\"texts().signInOrUpLabel\">\n <p><a class=\"text-link\"\n routerLink=\"../login\">{{ texts().backToLogin }}</a></p>\n <p><a class=\"text-link\"\n routerLink=\"../register\">{{ texts().registerLink }}</a></p>\n</section>\n",
2577
+ styles: [":host .form-control-group:last-of-type{margin-bottom:3rem}\n"]
2578
+ }]
2579
+ }]
2580
+ });
2581
+ function nbStrategiesFactory(options, injector) {
2582
+ const strategies = new Array();
2583
+ options.strategies.forEach(([strategyClass, strategyOptions]) => {
2584
+ const strategy = injector.get(strategyClass);
2585
+ strategy.setOptions(strategyOptions);
2586
+ strategies.push(strategy);
2587
+ });
2588
+ return strategies;
2589
+ }
2590
+ function nbTokensFactory(strategies) {
2591
+ const tokens = new Array();
2592
+ strategies.forEach((strategy) => {
2593
+ const tokenClass = strategy.getOption("token.class");
2594
+ if (tokenClass) tokens.push(tokenClass);
2595
+ });
2596
+ return tokens;
2597
+ }
2598
+ function nbOptionsFactory(options) {
2599
+ return deepExtend({}, defaultAuthOptions, options);
2600
+ }
2601
+ function nbNoOpInterceptorFilter(_req) {
2602
+ return true;
2603
+ }
2604
+ function provideNbAuth(nbAuthOptions) {
2605
+ return makeEnvironmentProviders([
2606
+ {
2607
+ provide: NB_AUTH_USER_OPTIONS,
2608
+ useValue: nbAuthOptions
2609
+ },
2610
+ {
2611
+ provide: NB_AUTH_OPTIONS,
2612
+ useFactory: nbOptionsFactory,
2613
+ deps: [NB_AUTH_USER_OPTIONS]
2614
+ },
2615
+ {
2616
+ provide: NB_AUTH_STRATEGIES,
2617
+ useFactory: nbStrategiesFactory,
2618
+ deps: [NB_AUTH_OPTIONS, Injector]
2619
+ },
2620
+ {
2621
+ provide: NB_AUTH_TOKENS,
2622
+ useFactory: nbTokensFactory,
2623
+ deps: [NB_AUTH_STRATEGIES]
2624
+ },
2625
+ {
2626
+ provide: NB_AUTH_FALLBACK_TOKEN,
2627
+ useValue: NbAuthSimpleToken
2628
+ },
2629
+ {
2630
+ provide: NB_AUTH_INTERCEPTOR_HEADER,
2631
+ useValue: "Authorization"
2632
+ },
2633
+ {
2634
+ provide: NB_AUTH_TOKEN_INTERCEPTOR_FILTER,
2635
+ useValue: nbNoOpInterceptorFilter
2636
+ },
2637
+ {
2638
+ provide: NbTokenStorage,
2639
+ useClass: NbTokenLocalStorage
2640
+ },
2641
+ NbAuthTokenParceler,
2642
+ NbAuthService,
2643
+ NbTokenService,
2644
+ NbDummyAuthStrategy,
2645
+ NbPasswordAuthStrategy,
2646
+ NbOAuth2AuthStrategy
2647
+ ]);
2648
+ }
2649
+ var NbAuthModule = class NbAuthModule {
2650
+ static forRoot(nbAuthOptions) {
2651
+ return {
2652
+ ngModule: NbAuthModule,
2653
+ providers: [provideNbAuth(nbAuthOptions)]
2654
+ };
2655
+ }
2656
+ static {
2657
+ this.ɵfac = i0.ɵɵngDeclareFactory({
2658
+ minVersion: "12.0.0",
2659
+ version: "22.3.0",
2660
+ ngImport: i0,
2661
+ type: NbAuthModule,
2662
+ deps: [],
2663
+ target: i0.ɵɵFactoryTarget.NgModule
2664
+ });
2665
+ }
2666
+ static {
2667
+ this.ɵmod = i0.ɵɵngDeclareNgModule({
2668
+ minVersion: "14.0.0",
2669
+ version: "22.3.0",
2670
+ ngImport: i0,
2671
+ type: NbAuthModule,
2672
+ imports: [
2673
+ NbLayoutModule,
2674
+ NbCardModule,
2675
+ NbCheckboxModule,
2676
+ NbAlertModule,
2677
+ NbInputModule,
2678
+ NbButtonModule,
2679
+ RouterModule,
2680
+ FormsModule,
2681
+ NbIconModule,
2682
+ NbAuthComponent,
2683
+ NbAuthBlockComponent,
2684
+ NbLoginComponent,
2685
+ NbRegisterComponent,
2686
+ NbRequestPasswordComponent,
2687
+ NbResetPasswordComponent,
2688
+ NbLogoutComponent
2689
+ ],
2690
+ exports: [
2691
+ NbAuthComponent,
2692
+ NbAuthBlockComponent,
2693
+ NbLoginComponent,
2694
+ NbRegisterComponent,
2695
+ NbRequestPasswordComponent,
2696
+ NbResetPasswordComponent,
2697
+ NbLogoutComponent
2698
+ ]
2699
+ });
2700
+ }
2701
+ static {
2702
+ this.ɵinj = i0.ɵɵngDeclareInjector({
2703
+ minVersion: "12.0.0",
2704
+ version: "22.3.0",
2705
+ ngImport: i0,
2706
+ type: NbAuthModule,
2707
+ imports: [
2708
+ NbLayoutModule,
2709
+ NbCardModule,
2710
+ NbCheckboxModule,
2711
+ NbAlertModule,
2712
+ NbInputModule,
2713
+ NbButtonModule,
2714
+ RouterModule,
2715
+ FormsModule,
2716
+ NbIconModule,
2717
+ NbAuthComponent,
2718
+ NbLoginComponent,
2719
+ NbRegisterComponent,
2720
+ NbRequestPasswordComponent,
2721
+ NbResetPasswordComponent
2722
+ ]
2723
+ });
2724
+ }
2725
+ };
2726
+ i0.ɵɵngDeclareClassMetadata({
2727
+ minVersion: "12.0.0",
2728
+ version: "22.3.0",
2729
+ ngImport: i0,
2730
+ type: NbAuthModule,
2731
+ decorators: [{
2732
+ type: NgModule,
2733
+ args: [{
2734
+ imports: [
2735
+ NbLayoutModule,
2736
+ NbCardModule,
2737
+ NbCheckboxModule,
2738
+ NbAlertModule,
2739
+ NbInputModule,
2740
+ NbButtonModule,
2741
+ RouterModule,
2742
+ FormsModule,
2743
+ NbIconModule,
2744
+ NbAuthComponent,
2745
+ NbAuthBlockComponent,
2746
+ NbLoginComponent,
2747
+ NbRegisterComponent,
2748
+ NbRequestPasswordComponent,
2749
+ NbResetPasswordComponent,
2750
+ NbLogoutComponent
2751
+ ],
2752
+ exports: [
2753
+ NbAuthComponent,
2754
+ NbAuthBlockComponent,
2755
+ NbLoginComponent,
2756
+ NbRegisterComponent,
2757
+ NbRequestPasswordComponent,
2758
+ NbResetPasswordComponent,
2759
+ NbLogoutComponent
2760
+ ]
2761
+ }]
2762
+ }]
2763
+ });
2764
+ const routes = [{
2765
+ path: "auth",
2766
+ component: NbAuthComponent,
2767
+ children: [
2768
+ {
2769
+ path: "",
2770
+ component: NbLoginComponent
2771
+ },
2772
+ {
2773
+ path: "login",
2774
+ component: NbLoginComponent
2775
+ },
2776
+ {
2777
+ path: "register",
2778
+ component: NbRegisterComponent
2779
+ },
2780
+ {
2781
+ path: "logout",
2782
+ component: NbLogoutComponent
2783
+ },
2784
+ {
2785
+ path: "request-password",
2786
+ component: NbRequestPasswordComponent
2787
+ },
2788
+ {
2789
+ path: "reset-password",
2790
+ component: NbResetPasswordComponent
2791
+ }
2792
+ ]
2793
+ }];
2794
+ var NbAuthJWTInterceptor = class NbAuthJWTInterceptor {
2795
+ constructor() {
2796
+ this.injector = inject(Injector);
2797
+ this.filter = inject(NB_AUTH_TOKEN_INTERCEPTOR_FILTER);
2798
+ }
2799
+ intercept(req, next) {
2800
+ if (!this.filter(req)) return this.authService.isAuthenticatedOrRefresh().pipe(switchMap((authenticated) => {
2801
+ if (authenticated) return this.authService.getToken().pipe(switchMap((token) => {
2802
+ const JWT = `Bearer ${token.getValue()}`;
2803
+ req = req.clone({ setHeaders: { Authorization: JWT } });
2804
+ return next.handle(req);
2805
+ }));
2806
+ else return next.handle(req);
2807
+ }));
2808
+ else return next.handle(req);
2809
+ }
2810
+ get authService() {
2811
+ return this.injector.get(NbAuthService);
2812
+ }
2813
+ static {
2814
+ this.ɵfac = i0.ɵɵngDeclareFactory({
2815
+ minVersion: "12.0.0",
2816
+ version: "22.3.0",
2817
+ ngImport: i0,
2818
+ type: NbAuthJWTInterceptor,
2819
+ deps: [],
2820
+ target: i0.ɵɵFactoryTarget.Service
2821
+ });
2822
+ }
2823
+ static {
2824
+ this.ɵprov = i0.ɵɵngDeclareService({
2825
+ minVersion: "22.0.0",
2826
+ version: "22.3.0",
2827
+ ngImport: i0,
2828
+ type: NbAuthJWTInterceptor,
2829
+ autoProvided: false
2830
+ });
2831
+ }
2832
+ };
2833
+ i0.ɵɵngDeclareClassMetadata({
2834
+ minVersion: "12.0.0",
2835
+ version: "22.3.0",
2836
+ ngImport: i0,
2837
+ type: NbAuthJWTInterceptor,
2838
+ decorators: [{
2839
+ type: Service,
2840
+ args: [{ autoProvided: false }]
2841
+ }]
2842
+ });
2843
+ var NbAuthSimpleInterceptor = class NbAuthSimpleInterceptor {
2844
+ constructor() {
2845
+ this.injector = inject(Injector);
2846
+ this.headerName = inject(NB_AUTH_INTERCEPTOR_HEADER) ?? "Authorization";
2847
+ }
2848
+ intercept(req, next) {
2849
+ return this.authService.getToken().pipe(switchMap((token) => {
2850
+ if (token && token.getValue()) req = req.clone({ setHeaders: { [this.headerName]: token.getValue() } });
2851
+ return next.handle(req);
2852
+ }));
2853
+ }
2854
+ get authService() {
2855
+ return this.injector.get(NbAuthService);
2856
+ }
2857
+ static {
2858
+ this.ɵfac = i0.ɵɵngDeclareFactory({
2859
+ minVersion: "12.0.0",
2860
+ version: "22.3.0",
2861
+ ngImport: i0,
2862
+ type: NbAuthSimpleInterceptor,
2863
+ deps: [],
2864
+ target: i0.ɵɵFactoryTarget.Service
2865
+ });
2866
+ }
2867
+ static {
2868
+ this.ɵprov = i0.ɵɵngDeclareService({
2869
+ minVersion: "22.0.0",
2870
+ version: "22.3.0",
2871
+ ngImport: i0,
2872
+ type: NbAuthSimpleInterceptor,
2873
+ autoProvided: false
2874
+ });
2875
+ }
2876
+ };
2877
+ i0.ɵɵngDeclareClassMetadata({
2878
+ minVersion: "12.0.0",
2879
+ version: "22.3.0",
2880
+ ngImport: i0,
2881
+ type: NbAuthSimpleInterceptor,
2882
+ decorators: [{
2883
+ type: Service,
2884
+ args: [{ autoProvided: false }]
2885
+ }]
2886
+ });
2887
+ var NbUser = class {
2888
+ constructor(id, email, password, rememberMe, terms, confirmPassword, fullName) {
2889
+ this.id = id;
2890
+ this.email = email;
2891
+ this.password = password;
2892
+ this.rememberMe = rememberMe;
2893
+ this.terms = terms;
2894
+ this.confirmPassword = confirmPassword;
2895
+ this.fullName = fullName;
2896
+ }
2897
+ };
2898
+ export { NB_AUTH_FALLBACK_TOKEN, NB_AUTH_INTERCEPTOR_HEADER, NB_AUTH_OPTIONS, NB_AUTH_STRATEGIES, NB_AUTH_TOKENS, NB_AUTH_TOKEN_INTERCEPTOR_FILTER, NB_AUTH_USER_OPTIONS, NbAuthBlockComponent, NbAuthComponent, NbAuthEmptyTokenError, NbAuthIllegalJWTTokenError, NbAuthIllegalTokenError, NbAuthJWTInterceptor, NbAuthJWTToken, NbAuthModule, NbAuthOAuth2JWTToken, NbAuthOAuth2Token, NbAuthResult, NbAuthService, NbAuthSimpleInterceptor, NbAuthSimpleToken, NbAuthStrategy, NbAuthStrategyOptions, NbAuthToken, NbAuthTokenNotFoundError, NbAuthTokenParceler, NbDummyAuthStrategy, NbDummyAuthStrategyOptions, NbLoginComponent, NbLogoutComponent, NbOAuth2AuthStrategy, NbOAuth2AuthStrategyOptions, NbOAuth2ClientAuthMethod, NbOAuth2GrantType, NbOAuth2ResponseType, NbPasswordAuthStrategy, NbPasswordAuthStrategyOptions, NbRegisterComponent, NbRequestPasswordComponent, NbResetPasswordComponent, NbTokenLocalStorage, NbTokenService, NbTokenStorage, NbUser, auth2StrategyOptions, b64DecodeUnicode, b64decode, decodeJwtPayload, deepExtend, defaultAuthOptions, dummyStrategyOptions, getDeepFromObject, injectNbAuthStrategyTexts, injectNbAuthTexts, nbAuthCreateToken, nbAuthMessages, nbNoOpInterceptorFilter, nbOptionsFactory, nbStrategiesFactory, nbTokensFactory, passwordStrategyOptions, provideNbAuth, routes, urlBase64Decode };
2899
+
2900
+ //# sourceMappingURL=liquid-js-lyr-auth.mjs.map