@juice-js/layout 1.0.0-alpha.10

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 (49) hide show
  1. package/README.md +24 -0
  2. package/esm2022/juice-js-layout.mjs +5 -0
  3. package/esm2022/lib/components/dark-mode/dark-mode.component.mjs +53 -0
  4. package/esm2022/lib/components/expandable-menu/expandable-menu.component.mjs +27 -0
  5. package/esm2022/lib/components/nav-menu/nav-menu.component.mjs +67 -0
  6. package/esm2022/lib/components/search-bar/search-bar.component.mjs +48 -0
  7. package/esm2022/lib/components/tooltip/tooltip.component.mjs +48 -0
  8. package/esm2022/lib/components/tooltip/tooltip.directive.mjs +84 -0
  9. package/esm2022/lib/components/tooltip/tooltip.module.mjs +31 -0
  10. package/esm2022/lib/components/user-profile/profile-dialog.service.mjs +4 -0
  11. package/esm2022/lib/components/user-profile/user-profile.component.mjs +80 -0
  12. package/esm2022/lib/components/user-profile/user-profile.model.mjs +2 -0
  13. package/esm2022/lib/components/user-profile-dialog/user-profile-dialog.component.mjs +53 -0
  14. package/esm2022/lib/components/user-profile-dialog/user-profile-dialog.module.mjs +46 -0
  15. package/esm2022/lib/components/user-profile-dialog/user-profile-dialog.service.mjs +19 -0
  16. package/esm2022/lib/dev.guard.mjs +25 -0
  17. package/esm2022/lib/layout.config.mjs +22 -0
  18. package/esm2022/lib/layout.module.mjs +111 -0
  19. package/esm2022/lib/layout.service.mjs +75 -0
  20. package/esm2022/lib/page/page.component.mjs +118 -0
  21. package/esm2022/lib/pages/page-notfound/page-notfound.component.mjs +12 -0
  22. package/esm2022/lib/services/search.service.mjs +37 -0
  23. package/esm2022/public-api.mjs +16 -0
  24. package/fesm2022/juice-js-layout.mjs +865 -0
  25. package/fesm2022/juice-js-layout.mjs.map +1 -0
  26. package/index.d.ts +5 -0
  27. package/lib/components/dark-mode/dark-mode.component.d.ts +17 -0
  28. package/lib/components/expandable-menu/expandable-menu.component.d.ts +13 -0
  29. package/lib/components/nav-menu/nav-menu.component.d.ts +24 -0
  30. package/lib/components/search-bar/search-bar.component.d.ts +11 -0
  31. package/lib/components/tooltip/tooltip.component.d.ts +15 -0
  32. package/lib/components/tooltip/tooltip.directive.d.ts +28 -0
  33. package/lib/components/tooltip/tooltip.module.d.ts +9 -0
  34. package/lib/components/user-profile/profile-dialog.service.d.ts +3 -0
  35. package/lib/components/user-profile/user-profile.component.d.ts +19 -0
  36. package/lib/components/user-profile/user-profile.model.d.ts +6 -0
  37. package/lib/components/user-profile-dialog/user-profile-dialog.component.d.ts +16 -0
  38. package/lib/components/user-profile-dialog/user-profile-dialog.module.d.ts +11 -0
  39. package/lib/components/user-profile-dialog/user-profile-dialog.service.d.ts +9 -0
  40. package/lib/dev.guard.d.ts +8 -0
  41. package/lib/layout.config.d.ts +28 -0
  42. package/lib/layout.module.d.ts +29 -0
  43. package/lib/layout.service.d.ts +22 -0
  44. package/lib/page/page.component.d.ts +16 -0
  45. package/lib/pages/page-notfound/page-notfound.component.d.ts +5 -0
  46. package/lib/services/search.service.d.ts +12 -0
  47. package/package.json +45 -0
  48. package/public-api.d.ts +12 -0
  49. package/styles/_theming.scss +94 -0
@@ -0,0 +1,865 @@
1
+ import * as i0 from '@angular/core';
2
+ import { InjectionToken, Injectable, Optional, Component, booleanAttribute, Directive, Input, HostListener, inject, NgModule } from '@angular/core';
3
+ import * as i1 from '@juice-js/core';
4
+ import { AsyncDialog } from '@juice-js/core';
5
+ import * as i4$2 from '@angular/cdk/layout';
6
+ import { Breakpoints } from '@angular/cdk/layout';
7
+ import { trigger, transition, style, animate, state } from '@angular/animations';
8
+ import * as i1$1 from '@angular/router';
9
+ import { NavigationStart, RouterModule } from '@angular/router';
10
+ import * as i2$1 from '@angular/common';
11
+ import { CommonModule } from '@angular/common';
12
+ import * as i2 from '@angular/material/icon';
13
+ import { MatIconModule } from '@angular/material/icon';
14
+ import * as i6 from '@angular/material/toolbar';
15
+ import { MatToolbarModule } from '@angular/material/toolbar';
16
+ import * as i7$1 from '@angular/material/sidenav';
17
+ import { MatSidenavModule } from '@angular/material/sidenav';
18
+ import * as i3 from '@angular/material/button';
19
+ import { MatButtonModule } from '@angular/material/button';
20
+ import * as i4 from '@angular/material/tooltip';
21
+ import { MatTooltipModule } from '@angular/material/tooltip';
22
+ import * as i5 from '@ngx-translate/core';
23
+ import { TranslateModule } from '@ngx-translate/core';
24
+ import * as i7 from '@angular/material/list';
25
+ import { MatListModule } from '@angular/material/list';
26
+ import * as i8 from '@angular/material/divider';
27
+ import * as i4$1 from '@angular/material/expansion';
28
+ import { MatExpansionModule } from '@angular/material/expansion';
29
+ import * as i3$1 from '@angular/forms';
30
+ import { FormsModule } from '@angular/forms';
31
+ import { filter } from 'rxjs/operators';
32
+ import * as i3$2 from 'angular-oauth2-oidc';
33
+ import { MatFormFieldModule } from '@angular/material/form-field';
34
+ import { MatInputModule } from '@angular/material/input';
35
+ import * as i2$2 from '@angular/material/dialog';
36
+ import { MatDialogModule } from '@angular/material/dialog';
37
+
38
+ var ThemeMode;
39
+ (function (ThemeMode) {
40
+ ThemeMode["Light"] = "light";
41
+ ThemeMode["Dark"] = "dark";
42
+ ThemeMode["Auto"] = "auto";
43
+ })(ThemeMode || (ThemeMode = {}));
44
+ class LayoutConfig {
45
+ constructor(options) {
46
+ this.favicon = "favicon.ico";
47
+ this.brand = "Juice";
48
+ this.brandLogo = "assets/images/logo.png";
49
+ this.defaultThemeMode = ThemeMode.Auto;
50
+ this.defaultLanguage = "en-US";
51
+ this.defaultMenuOpen = false;
52
+ if (options) {
53
+ Object.assign(this, options);
54
+ }
55
+ }
56
+ }
57
+ const IS_PRODUCTION = new InjectionToken('production');
58
+
59
+ class LayoutService {
60
+ static { this.DARK_MODE = "IS_DARK_MODE"; }
61
+ static { this.MENU_OPEN = "IS_MENU_OPEN"; }
62
+ constructor(options, tenantService) {
63
+ this.tenantIdentifier = "";
64
+ this._tenant = null;
65
+ tenantService?.getTenantInfo().then(tenantInfo => {
66
+ this.tenantIdentifier = tenantInfo?.identifier ?? "";
67
+ this._tenant = tenantInfo;
68
+ });
69
+ this._options = options ?? new LayoutConfig();
70
+ }
71
+ getThemeMode() {
72
+ let mode = localStorage.getItem(LayoutService.DARK_MODE);
73
+ if (mode) {
74
+ return JSON.parse(mode);
75
+ }
76
+ return this._options.defaultThemeMode;
77
+ }
78
+ toggleDarkMode() {
79
+ var state = this.getThemeMode();
80
+ if (state == ThemeMode.Auto) {
81
+ state = ThemeMode.Light;
82
+ }
83
+ else if (state == ThemeMode.Light) {
84
+ state = ThemeMode.Dark;
85
+ }
86
+ else {
87
+ state = ThemeMode.Auto;
88
+ }
89
+ localStorage.setItem(LayoutService.DARK_MODE, JSON.stringify(state));
90
+ }
91
+ isMenuOpen() {
92
+ let isMenuOpen = localStorage.getItem(LayoutService.MENU_OPEN);
93
+ if (isMenuOpen) {
94
+ return JSON.parse(isMenuOpen);
95
+ }
96
+ return this._options.defaultMenuOpen;
97
+ }
98
+ toggleMenu() {
99
+ let state = !this.isMenuOpen();
100
+ localStorage.setItem(LayoutService.MENU_OPEN, JSON.stringify(state));
101
+ }
102
+ favicon() {
103
+ return this._tenant?.favicon ?? this._options.favicon;
104
+ }
105
+ brandName() {
106
+ return this._tenant?.name ?? this._options.brand;
107
+ }
108
+ brandLogo() {
109
+ return this._tenant?.logo ?? this._options.brandLogo;
110
+ }
111
+ settingUrl() {
112
+ return this._options.settingUrl;
113
+ }
114
+ userImageUrl(username) {
115
+ return this._options.userImageUrl ? this._options.userImageUrl.replace("{username}", username) : "";
116
+ }
117
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LayoutService, deps: [{ token: LayoutConfig, optional: true }, { token: i1.TenantService }], target: i0.ɵɵFactoryTarget.Injectable }); }
118
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LayoutService, providedIn: 'root' }); }
119
+ }
120
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LayoutService, decorators: [{
121
+ type: Injectable,
122
+ args: [{
123
+ providedIn: 'root'
124
+ }]
125
+ }], ctorParameters: function () { return [{ type: LayoutConfig, decorators: [{
126
+ type: Optional
127
+ }] }, { type: i1.TenantService }]; } });
128
+
129
+ class DarkModeComponent {
130
+ constructor(service) {
131
+ this.service = service;
132
+ this.ThemeMode = ThemeMode;
133
+ this.prefersDark = window.matchMedia("(prefers-color-scheme: dark)");
134
+ this.icons = new Map([
135
+ [ThemeMode.Light, "light_mode"],
136
+ [ThemeMode.Dark, "dark_mode"],
137
+ [ThemeMode.Auto, "adjust"]
138
+ ]);
139
+ this.names = new Map([
140
+ [ThemeMode.Light, "Light"],
141
+ [ThemeMode.Dark, "Dark"],
142
+ [ThemeMode.Auto, "Adaptive"]
143
+ ]);
144
+ this.name = "";
145
+ this.icon = "light_mode";
146
+ this.prefersDark.addEventListener("change", e => {
147
+ this.initTheme(e.matches);
148
+ });
149
+ this.initTheme(this.prefersDark.matches);
150
+ }
151
+ toggleDarkMode() {
152
+ this.service.toggleDarkMode();
153
+ this.initTheme(this.prefersDark.matches);
154
+ }
155
+ initTheme(prefersDark = false) {
156
+ var mode = this.service.getThemeMode();
157
+ var scheme = mode == ThemeMode.Auto ? prefersDark ? ThemeMode.Dark : ThemeMode.Light
158
+ : mode;
159
+ document.body.classList.remove("dark");
160
+ if (scheme == ThemeMode.Dark) {
161
+ document.body.classList.add(scheme);
162
+ }
163
+ this.icon = this.icons.get(mode) ?? "";
164
+ this.name = this.names.get(mode) ?? "";
165
+ }
166
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DarkModeComponent, deps: [{ token: LayoutService }], target: i0.ɵɵFactoryTarget.Component }); }
167
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DarkModeComponent, selector: "juice-dark-mode", ngImport: i0, template: "<button mat-icon-button (click)=\"toggleDarkMode()\" matTooltip=\"{{ name | translate }}\" matTooltipPosition=\"left\"><mat-icon>{{icon}}</mat-icon></button>", dependencies: [{ kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }] }); }
168
+ }
169
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DarkModeComponent, decorators: [{
170
+ type: Component,
171
+ args: [{ selector: 'juice-dark-mode', template: "<button mat-icon-button (click)=\"toggleDarkMode()\" matTooltip=\"{{ name | translate }}\" matTooltipPosition=\"left\"><mat-icon>{{icon}}</mat-icon></button>" }]
172
+ }], ctorParameters: function () { return [{ type: LayoutService }]; } });
173
+
174
+ class TooltipComponent {
175
+ constructor(elementRef) {
176
+ this.elementRef = elementRef;
177
+ this.tooltip = '';
178
+ this.position = TooltipPosition.DEFAULT;
179
+ this.left = 0;
180
+ this.top = 0;
181
+ this.display = true;
182
+ }
183
+ calculatePosition(left, right, top, bottom) {
184
+ switch (this.position) {
185
+ case TooltipPosition.BELOW: {
186
+ this.left = Math.round((right - left) / 2 + left);
187
+ this.top = Math.round(bottom);
188
+ break;
189
+ }
190
+ case TooltipPosition.ABOVE: {
191
+ this.left = Math.round((right - left) / 2 + left);
192
+ this.top = Math.round(top);
193
+ break;
194
+ }
195
+ case TooltipPosition.RIGHT: {
196
+ this.left = Math.round(right);
197
+ this.top = Math.round(top + (bottom - top) / 2);
198
+ break;
199
+ }
200
+ case TooltipPosition.LEFT: {
201
+ this.left = Math.round(left);
202
+ this.top = Math.round(top + (bottom - top) / 2);
203
+ break;
204
+ }
205
+ default: {
206
+ break;
207
+ }
208
+ }
209
+ }
210
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TooltipComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
211
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TooltipComponent, selector: "tooltip", ngImport: i0, template: "<div #tooltipId *ngIf=\"display\" class=\"tooltip\" [ngClass]=\"['tooltip--'+position]\"\n [style.left]=\"left + 'px'\" [style.top]=\"top + 'px'\">\n {{tooltip}}\n</div>", styles: [".tooltip{position:fixed;background-color:#000;border-radius:4px;color:#fff;font-family:Arial;padding:3px 6px;font-size:13px;z-index:9999}.tooltip:before{content:\"\";width:0;height:0;position:absolute}.tooltip--visible{opacity:1;transition:opacity .3s}.tooltip--light{background-color:#fff;color:#000}.tooltip--light:before{border:5px solid white}.tooltip--dark{background-color:#000;color:#fff}.tooltip--dark:before{border:5px solid black}.tooltip--below{transform:translate(-50%);margin-top:7px}.tooltip--below:before{border-left-color:transparent;border-right-color:transparent;border-top:none;left:calc(50% - 5px);top:-5px}.tooltip--above{transform:translate(-50%,-100%);margin-bottom:7px}.tooltip--above:before{border-left-color:transparent;border-right-color:transparent;border-bottom:none;left:calc(50% - 5px);bottom:-5px}.tooltip--left{transform:translate(calc(-100% - 7px),-50%)}.tooltip--left:before{border-top-color:transparent;border-bottom-color:transparent;border-right:none;right:-5px;top:calc(50% - 5px)}.tooltip--right{transform:translateY(-50%);margin-left:7px}.tooltip--right:before{border-top-color:transparent;border-bottom-color:transparent;border-left:none;left:-5px;top:calc(50% - 5px)}.tooltip--dynamic{margin-left:20px}.tooltip--dynamic:before{display:none}\n"], dependencies: [{ kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
212
+ }
213
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TooltipComponent, decorators: [{
214
+ type: Component,
215
+ args: [{ selector: 'tooltip', template: "<div #tooltipId *ngIf=\"display\" class=\"tooltip\" [ngClass]=\"['tooltip--'+position]\"\n [style.left]=\"left + 'px'\" [style.top]=\"top + 'px'\">\n {{tooltip}}\n</div>", styles: [".tooltip{position:fixed;background-color:#000;border-radius:4px;color:#fff;font-family:Arial;padding:3px 6px;font-size:13px;z-index:9999}.tooltip:before{content:\"\";width:0;height:0;position:absolute}.tooltip--visible{opacity:1;transition:opacity .3s}.tooltip--light{background-color:#fff;color:#000}.tooltip--light:before{border:5px solid white}.tooltip--dark{background-color:#000;color:#fff}.tooltip--dark:before{border:5px solid black}.tooltip--below{transform:translate(-50%);margin-top:7px}.tooltip--below:before{border-left-color:transparent;border-right-color:transparent;border-top:none;left:calc(50% - 5px);top:-5px}.tooltip--above{transform:translate(-50%,-100%);margin-bottom:7px}.tooltip--above:before{border-left-color:transparent;border-right-color:transparent;border-bottom:none;left:calc(50% - 5px);bottom:-5px}.tooltip--left{transform:translate(calc(-100% - 7px),-50%)}.tooltip--left:before{border-top-color:transparent;border-bottom-color:transparent;border-right:none;right:-5px;top:calc(50% - 5px)}.tooltip--right{transform:translateY(-50%);margin-left:7px}.tooltip--right:before{border-top-color:transparent;border-bottom-color:transparent;border-left:none;left:-5px;top:calc(50% - 5px)}.tooltip--dynamic{margin-left:20px}.tooltip--dynamic:before{display:none}\n"] }]
216
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
217
+
218
+ var TooltipPosition;
219
+ (function (TooltipPosition) {
220
+ TooltipPosition["ABOVE"] = "above";
221
+ TooltipPosition["BELOW"] = "below";
222
+ TooltipPosition["LEFT"] = "left";
223
+ TooltipPosition["RIGHT"] = "right";
224
+ TooltipPosition["DEFAULT"] = "above";
225
+ })(TooltipPosition || (TooltipPosition = {}));
226
+ function tooltipPosition(position) {
227
+ switch (position) {
228
+ case TooltipPosition.ABOVE: return TooltipPosition.ABOVE;
229
+ case TooltipPosition.BELOW: return TooltipPosition.BELOW;
230
+ case TooltipPosition.LEFT: return TooltipPosition.LEFT;
231
+ case TooltipPosition.RIGHT: return TooltipPosition.RIGHT;
232
+ default: return TooltipPosition.DEFAULT;
233
+ }
234
+ }
235
+ class TooltipDirective {
236
+ constructor(elementRef, viewContainerRef) {
237
+ this.elementRef = elementRef;
238
+ this.viewContainerRef = viewContainerRef;
239
+ this.tooltip = '';
240
+ this.tooltipPosition = TooltipPosition.DEFAULT;
241
+ }
242
+ onMouseEnter() {
243
+ if (!this.componentRef) {
244
+ this.componentRef = this.viewContainerRef.createComponent(TooltipComponent);
245
+ const domElem = this.componentRef.hostView
246
+ .rootNodes[0];
247
+ document.body.appendChild(domElem);
248
+ this.setTooltipComponentProperties();
249
+ }
250
+ }
251
+ getPosition() {
252
+ return this.tooltipPosition;
253
+ }
254
+ setTooltipComponentProperties() {
255
+ if (this.componentRef) {
256
+ this.componentRef.instance.tooltip = this.tooltip;
257
+ this.componentRef.instance.position = this.getPosition();
258
+ this.componentRef.instance.display = this.tooltipDisplay;
259
+ const { left, right, top, bottom } = this.elementRef.nativeElement.getBoundingClientRect();
260
+ this.componentRef.instance.calculatePosition(left, right, top, bottom);
261
+ }
262
+ }
263
+ onMouseLeave() {
264
+ this.destroy();
265
+ }
266
+ ngOnDestroy() {
267
+ this.destroy();
268
+ }
269
+ destroy() {
270
+ if (this.componentRef) {
271
+ this.componentRef.destroy();
272
+ this.componentRef = undefined;
273
+ }
274
+ }
275
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TooltipDirective, deps: [{ token: i0.ElementRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
276
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "16.2.12", type: TooltipDirective, selector: "[tooltip]", inputs: { tooltip: "tooltip", tooltipPosition: ["tooltipPosition", "tooltipPosition", tooltipPosition], tooltipDisplay: ["tooltipDisplay", "tooltipDisplay", booleanAttribute] }, host: { listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave()" } }, ngImport: i0 }); }
277
+ }
278
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TooltipDirective, decorators: [{
279
+ type: Directive,
280
+ args: [{
281
+ selector: '[tooltip]'
282
+ }]
283
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ViewContainerRef }]; }, propDecorators: { tooltip: [{
284
+ type: Input
285
+ }], tooltipPosition: [{
286
+ type: Input,
287
+ args: [{ transform: tooltipPosition }]
288
+ }], tooltipDisplay: [{
289
+ type: Input,
290
+ args: [{ transform: booleanAttribute }]
291
+ }], onMouseEnter: [{
292
+ type: HostListener,
293
+ args: ['mouseenter']
294
+ }], onMouseLeave: [{
295
+ type: HostListener,
296
+ args: ['mouseleave']
297
+ }] } });
298
+
299
+ class ExpandableMenuComponent {
300
+ constructor(router) {
301
+ this.router = router;
302
+ this.isExpanded = false;
303
+ this.item = {};
304
+ this.TooltipPosition = TooltipPosition;
305
+ }
306
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ExpandableMenuComponent, deps: [{ token: i1$1.Router }], target: i0.ɵɵFactoryTarget.Component }); }
307
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ExpandableMenuComponent, selector: "juice-expandable-menu", inputs: { isExpanded: "isExpanded", item: "item" }, ngImport: i0, template: "<mat-expansion-panel [expanded]=\"router.isActive(item.routerLink, false)\" [hideToggle]=\"!isExpanded\" [ngClass]=\"router.isActive(item.routerLink, false)?'active':''\">\n <mat-expansion-panel-header >\n <mat-list-item routerLink=\"{{ item.routerLink }}\" [routerLinkActive]=\"['active']\" \n [routerLinkActiveOptions]=\"{exact: true}\">\n <mat-icon matListItemIcon>{{ item.icon }}</mat-icon>\n <span matListItemTitle *ngIf=\"isExpanded\" style=\"margin-left: 4px;\"> {{ item.label }}</span>\n </mat-list-item>\n </mat-expansion-panel-header>\n <mat-nav-list>\n <mat-list-item routerLink=\"{{ subitem.routerLink }}\" [routerLinkActive]=\"['active']\"\n [routerLinkActiveOptions]=\"{exact: true}\" *ngFor=\" let subitem of item.children \">\n <mat-icon matListItemIcon>{{ subitem.icon }}</mat-icon>\n <span matListItemTitle *ngIf=\"isExpanded\" style=\"margin-left: 4px;\"> {{ subitem.label }}</span>\n </mat-list-item>\n </mat-nav-list>\n</mat-expansion-panel>\n", styles: [":host ::ng-deep .mat-expansion-panel-header{padding:0}:host ::ng-deep .mat-expansion-panel-header .mdc-list-item{padding:0}:host ::ng-deep .mat-expansion-panel-header .mat-expansion-indicator{position:absolute;right:0;padding:16px}:host ::ng-deep .mat-expansion-panel-body{padding:0}:host ::ng-deep .mat-content.mat-content-hide-toggle{margin-right:0}\n"], dependencies: [{ kind: "directive", type: i1$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i1$1.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i4$1.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["disabled", "expanded", "hideToggle", "togglePosition"], outputs: ["opened", "closed", "expandedChange", "afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i4$1.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["tabIndex", "expandedHeight", "collapsedHeight"] }, { kind: "component", type: i7.MatNavList, selector: "mat-nav-list", exportAs: ["matNavList"] }, { kind: "component", type: i7.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["activated"], exportAs: ["matListItem"] }, { kind: "directive", type: i7.MatListItemIcon, selector: "[matListItemIcon]" }, { kind: "directive", type: i7.MatListItemTitle, selector: "[matListItemTitle]" }] }); }
308
+ }
309
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ExpandableMenuComponent, decorators: [{
310
+ type: Component,
311
+ args: [{ selector: 'juice-expandable-menu', template: "<mat-expansion-panel [expanded]=\"router.isActive(item.routerLink, false)\" [hideToggle]=\"!isExpanded\" [ngClass]=\"router.isActive(item.routerLink, false)?'active':''\">\n <mat-expansion-panel-header >\n <mat-list-item routerLink=\"{{ item.routerLink }}\" [routerLinkActive]=\"['active']\" \n [routerLinkActiveOptions]=\"{exact: true}\">\n <mat-icon matListItemIcon>{{ item.icon }}</mat-icon>\n <span matListItemTitle *ngIf=\"isExpanded\" style=\"margin-left: 4px;\"> {{ item.label }}</span>\n </mat-list-item>\n </mat-expansion-panel-header>\n <mat-nav-list>\n <mat-list-item routerLink=\"{{ subitem.routerLink }}\" [routerLinkActive]=\"['active']\"\n [routerLinkActiveOptions]=\"{exact: true}\" *ngFor=\" let subitem of item.children \">\n <mat-icon matListItemIcon>{{ subitem.icon }}</mat-icon>\n <span matListItemTitle *ngIf=\"isExpanded\" style=\"margin-left: 4px;\"> {{ subitem.label }}</span>\n </mat-list-item>\n </mat-nav-list>\n</mat-expansion-panel>\n", styles: [":host ::ng-deep .mat-expansion-panel-header{padding:0}:host ::ng-deep .mat-expansion-panel-header .mdc-list-item{padding:0}:host ::ng-deep .mat-expansion-panel-header .mat-expansion-indicator{position:absolute;right:0;padding:16px}:host ::ng-deep .mat-expansion-panel-body{padding:0}:host ::ng-deep .mat-content.mat-content-hide-toggle{margin-right:0}\n"] }]
312
+ }], ctorParameters: function () { return [{ type: i1$1.Router }]; }, propDecorators: { isExpanded: [{
313
+ type: Input
314
+ }], item: [{
315
+ type: Input
316
+ }] } });
317
+
318
+ class NavMenuComponent {
319
+ constructor(service, layout, tenantService, route, breakpointObserver) {
320
+ this.service = service;
321
+ this.layout = layout;
322
+ this.tenantService = tenantService;
323
+ this.route = route;
324
+ this.breakpointObserver = breakpointObserver;
325
+ this.isExpanded = false;
326
+ this.isMobile = false;
327
+ this.items = [];
328
+ this.TooltipPosition = TooltipPosition;
329
+ if (route.snapshot.data['settingUrl']) {
330
+ this.settingUrl = route.snapshot.data['settingUrl'];
331
+ }
332
+ else {
333
+ this.settingUrl = layout.settingUrl();
334
+ }
335
+ tenantService.getTenantIdentifier().then(tenant => { this.settingUrl = this.settingUrl?.injectTenant(tenant); });
336
+ breakpointObserver.observe([
337
+ Breakpoints.HandsetLandscape,
338
+ Breakpoints.HandsetPortrait
339
+ ]).subscribe(result => {
340
+ this.isMobile = result.matches;
341
+ this.isExpanded = result.matches ? true : this.layout.isMenuOpen();
342
+ });
343
+ this.service.getMenu().subscribe(items => {
344
+ console.debug('Menu items', JSON.parse(JSON.stringify(items)));
345
+ this.items = items;
346
+ });
347
+ }
348
+ toggle() {
349
+ this.layout.toggleMenu();
350
+ this.isExpanded = this.layout.isMenuOpen();
351
+ }
352
+ mouseEnter() {
353
+ if (!this.isMobile) {
354
+ this.isExpanded = true;
355
+ }
356
+ }
357
+ mouseLeave() {
358
+ if (!this.isMobile) {
359
+ this.isExpanded = this.layout.isMenuOpen();
360
+ }
361
+ }
362
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NavMenuComponent, deps: [{ token: i1.MenuService }, { token: LayoutService }, { token: i1.TenantService }, { token: i1$1.ActivatedRoute }, { token: i4$2.BreakpointObserver }], target: i0.ɵɵFactoryTarget.Component }); }
363
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: NavMenuComponent, selector: "juice-nav-menu", ngImport: i0, template: "<mat-nav-list class=\"menu-scroll\" (mouseenter)=\"mouseEnter()\" (mouseleave)=\"mouseLeave()\">\n <ng-container *ngFor=\"let item of items\">\n <mat-list-item *ngIf=\"!item.children || item.children.length==0\" \n routerLink=\"{{ item.routerLink }}\" [routerLinkActive]=\"['active']\" \n [routerLinkActiveOptions]=\"{exact:true}\">\n <mat-icon matListItemIcon color=\"accent\">{{ item.icon }}</mat-icon>\n <span matListItemTitle style=\"margin-left: 4px;\"> {{ item.label }}</span>\n </mat-list-item>\n <juice-expandable-menu *ngIf=\"item.children && item.children.length>0\" \n [item]=\"item\" [isExpanded]=\"isExpanded\"></juice-expandable-menu>\n </ng-container>\n</mat-nav-list>\n<mat-divider></mat-divider>\n<mat-action-list class=\"list-horizontal bottom-menu\">\n <a mat-list-item *ngIf=\"settingUrl\" [href]=\"settingUrl\"\n matTooltip=\"{{'Settings' | translate}}\" matTooltipPosition=\"right\" [matTooltipDisabled]=\"isExpanded\">\n <mat-icon>settings</mat-icon>\n </a>\n <button mat-list-item (click)=\"toggle()\" *ngIf=\"!isMobile\">\n <mat-icon [style.transform]= \"isExpanded ? 'rotate(-180deg)':'rotate(0)'\">double_arrow</mat-icon>\n </button>\n</mat-action-list>", styles: [":host ::ng-deep{display:flex;flex-direction:column;justify-content:space-between;height:100%}:host ::ng-deep .menu-scroll{overflow-y:auto;overflow-x:hidden;flex:1}:host ::ng-deep .menu-scroll .mdc-list-item.mdc-list-item--with-one-line .mdc-list-item__start{margin-right:10px}:host ::ng-deep .list-horizontal{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:flex-end}:host ::ng-deep .list-horizontal .mat-mdc-list-item{width:auto;flex:1 auto}:host ::ng-deep .list-horizontal .mat-mdc-list-item .mdc-list-item__content{display:flex;justify-content:center}:host ::ng-deep .list-horizontal .mat-mdc-list-item .mdc-list-item__content .mat-mdc-list-item-unscoped-content{padding-top:5px}:host ::ng-deep .mat-mdc-list-base{padding:0}\n"], dependencies: [{ kind: "directive", type: i1$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i1$1.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i7.MatActionList, selector: "mat-action-list", exportAs: ["matActionList"] }, { kind: "component", type: i7.MatNavList, selector: "mat-nav-list", exportAs: ["matNavList"] }, { kind: "component", type: i7.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["activated"], exportAs: ["matListItem"] }, { kind: "directive", type: i7.MatListItemIcon, selector: "[matListItemIcon]" }, { kind: "component", type: i8.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "directive", type: i7.MatListItemTitle, selector: "[matListItemTitle]" }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "component", type: ExpandableMenuComponent, selector: "juice-expandable-menu", inputs: ["isExpanded", "item"] }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }] }); }
364
+ }
365
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: NavMenuComponent, decorators: [{
366
+ type: Component,
367
+ args: [{ selector: 'juice-nav-menu', template: "<mat-nav-list class=\"menu-scroll\" (mouseenter)=\"mouseEnter()\" (mouseleave)=\"mouseLeave()\">\n <ng-container *ngFor=\"let item of items\">\n <mat-list-item *ngIf=\"!item.children || item.children.length==0\" \n routerLink=\"{{ item.routerLink }}\" [routerLinkActive]=\"['active']\" \n [routerLinkActiveOptions]=\"{exact:true}\">\n <mat-icon matListItemIcon color=\"accent\">{{ item.icon }}</mat-icon>\n <span matListItemTitle style=\"margin-left: 4px;\"> {{ item.label }}</span>\n </mat-list-item>\n <juice-expandable-menu *ngIf=\"item.children && item.children.length>0\" \n [item]=\"item\" [isExpanded]=\"isExpanded\"></juice-expandable-menu>\n </ng-container>\n</mat-nav-list>\n<mat-divider></mat-divider>\n<mat-action-list class=\"list-horizontal bottom-menu\">\n <a mat-list-item *ngIf=\"settingUrl\" [href]=\"settingUrl\"\n matTooltip=\"{{'Settings' | translate}}\" matTooltipPosition=\"right\" [matTooltipDisabled]=\"isExpanded\">\n <mat-icon>settings</mat-icon>\n </a>\n <button mat-list-item (click)=\"toggle()\" *ngIf=\"!isMobile\">\n <mat-icon [style.transform]= \"isExpanded ? 'rotate(-180deg)':'rotate(0)'\">double_arrow</mat-icon>\n </button>\n</mat-action-list>", styles: [":host ::ng-deep{display:flex;flex-direction:column;justify-content:space-between;height:100%}:host ::ng-deep .menu-scroll{overflow-y:auto;overflow-x:hidden;flex:1}:host ::ng-deep .menu-scroll .mdc-list-item.mdc-list-item--with-one-line .mdc-list-item__start{margin-right:10px}:host ::ng-deep .list-horizontal{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:flex-end}:host ::ng-deep .list-horizontal .mat-mdc-list-item{width:auto;flex:1 auto}:host ::ng-deep .list-horizontal .mat-mdc-list-item .mdc-list-item__content{display:flex;justify-content:center}:host ::ng-deep .list-horizontal .mat-mdc-list-item .mdc-list-item__content .mat-mdc-list-item-unscoped-content{padding-top:5px}:host ::ng-deep .mat-mdc-list-base{padding:0}\n"] }]
368
+ }], ctorParameters: function () { return [{ type: i1.MenuService }, { type: LayoutService }, { type: i1.TenantService }, { type: i1$1.ActivatedRoute }, { type: i4$2.BreakpointObserver }]; } });
369
+
370
+ class SearchService {
371
+ constructor(router) {
372
+ this.isEnabled = false;
373
+ this._callback = undefined;
374
+ router.events.subscribe((event) => {
375
+ if (event instanceof NavigationStart) {
376
+ this.disable();
377
+ }
378
+ });
379
+ }
380
+ disable() {
381
+ this.isEnabled = false;
382
+ this._callback = undefined;
383
+ }
384
+ enable(callback) {
385
+ this.isEnabled = true;
386
+ this._callback = callback;
387
+ }
388
+ callback(searchText, event) {
389
+ if (this._callback) {
390
+ this._callback(searchText, event);
391
+ }
392
+ }
393
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SearchService, deps: [{ token: i1$1.Router }], target: i0.ɵɵFactoryTarget.Injectable }); }
394
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SearchService, providedIn: 'root' }); }
395
+ }
396
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SearchService, decorators: [{
397
+ type: Injectable,
398
+ args: [{
399
+ providedIn: 'root'
400
+ }]
401
+ }], ctorParameters: function () { return [{ type: i1$1.Router }]; } });
402
+
403
+ class SearchBarComponent {
404
+ constructor(service) {
405
+ this.service = service;
406
+ this.searchText = "";
407
+ }
408
+ isEnabled() {
409
+ return this.service.isEnabled;
410
+ }
411
+ onSearchTextChange(event) {
412
+ this.service.callback(this.searchText, event);
413
+ }
414
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SearchBarComponent, deps: [{ token: SearchService }], target: i0.ɵɵFactoryTarget.Component }); }
415
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: SearchBarComponent, selector: "juice-search-bar", ngImport: i0, template: "<div @enableTrigger *ngIf=\"isEnabled()\" class=\"search-container\">\n <input type=\"search\" [(ngModel)] =\"searchText\"\n (keyup)=\"onSearchTextChange($event)\" placeholder=\"Search\">\n <mat-icon *ngIf=\"searchText\" (click)=\"searchText='';onSearchTextChange($event)\" color=\"primary\">\n close</mat-icon>\n</div>", styles: [".search-container{width:200px;min-width:150px;height:100%;margin-left:2rem;margin-right:2rem;position:relative;display:flex;align-items:center;transition:width .2s ease-in-out}.search-container input{border:none;border-radius:100px;padding:5px 3em 5px 16px;line-height:normal;font-size:1rem;width:100%;max-width:240px}.search-container input:focus{border:0;outline:none}.search-container input[type=search]::-webkit-search-decoration,.search-container input[type=search]::-webkit-search-cancel-button,.search-container input[type=search]::-webkit-search-results-button,.search-container input[type=search]::-webkit-search-results-decoration{-webkit-appearance:none}.search-container:focus-within,.search-container:has(.mat-icon){width:240px}.search-container .mat-icon{position:absolute;right:.7rem;font-size:1.4rem;cursor:pointer}@media screen and (max-width: 600px){.search-container{margin-left:.5rem;margin-right:.5rem}}\n"], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], animations: [
416
+ trigger('enableTrigger', [
417
+ transition(':enter', [
418
+ style({ opacity: 0 }),
419
+ animate('100ms', style({ opacity: 1 })),
420
+ ]),
421
+ transition(':leave', [
422
+ animate('100ms', style({ opacity: 0 }))
423
+ ])
424
+ ]),
425
+ ] }); }
426
+ }
427
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SearchBarComponent, decorators: [{
428
+ type: Component,
429
+ args: [{ selector: 'juice-search-bar', animations: [
430
+ trigger('enableTrigger', [
431
+ transition(':enter', [
432
+ style({ opacity: 0 }),
433
+ animate('100ms', style({ opacity: 1 })),
434
+ ]),
435
+ transition(':leave', [
436
+ animate('100ms', style({ opacity: 0 }))
437
+ ])
438
+ ]),
439
+ ], template: "<div @enableTrigger *ngIf=\"isEnabled()\" class=\"search-container\">\n <input type=\"search\" [(ngModel)] =\"searchText\"\n (keyup)=\"onSearchTextChange($event)\" placeholder=\"Search\">\n <mat-icon *ngIf=\"searchText\" (click)=\"searchText='';onSearchTextChange($event)\" color=\"primary\">\n close</mat-icon>\n</div>", styles: [".search-container{width:200px;min-width:150px;height:100%;margin-left:2rem;margin-right:2rem;position:relative;display:flex;align-items:center;transition:width .2s ease-in-out}.search-container input{border:none;border-radius:100px;padding:5px 3em 5px 16px;line-height:normal;font-size:1rem;width:100%;max-width:240px}.search-container input:focus{border:0;outline:none}.search-container input[type=search]::-webkit-search-decoration,.search-container input[type=search]::-webkit-search-cancel-button,.search-container input[type=search]::-webkit-search-results-button,.search-container input[type=search]::-webkit-search-results-decoration{-webkit-appearance:none}.search-container:focus-within,.search-container:has(.mat-icon){width:240px}.search-container .mat-icon{position:absolute;right:.7rem;font-size:1.4rem;cursor:pointer}@media screen and (max-width: 600px){.search-container{margin-left:.5rem;margin-right:.5rem}}\n"] }]
440
+ }], ctorParameters: function () { return [{ type: SearchService }]; } });
441
+
442
+ class ProfileDialogService extends AsyncDialog {
443
+ }
444
+
445
+ class UserProfileComponent {
446
+ constructor(dialogService, layoutService, oauthService) {
447
+ this.dialogService = dialogService;
448
+ this.layoutService = layoutService;
449
+ this.oauthService = oauthService;
450
+ this.imageUrl = "";
451
+ this.isProduction = inject(IS_PRODUCTION);
452
+ this.oauthService.events.pipe(filter(e => e.type === "token_received")).subscribe((e) => {
453
+ if (!this.isProduction)
454
+ console.debug('Token received', e);
455
+ this.initImageUrl();
456
+ });
457
+ }
458
+ ngOnInit() {
459
+ if (this.hasValidToken()) {
460
+ this.initImageUrl();
461
+ }
462
+ else {
463
+ if (!this.isProduction)
464
+ console.debug('No valid token', this.oauthService.hasValidAccessToken(), this.oauthService.hasValidIdToken());
465
+ }
466
+ }
467
+ initImageUrl() {
468
+ if (this.imageUrl) {
469
+ return;
470
+ }
471
+ const claims = this.oauthService.getIdentityClaims();
472
+ if (!this.isProduction)
473
+ console.debug('Trying to get avatar from claims');
474
+ if (claims["picture"]) {
475
+ this.imageUrl = claims["picture"];
476
+ }
477
+ else if (claims["avatar"]) {
478
+ this.imageUrl = claims["avatar"];
479
+ }
480
+ else {
481
+ const username = claims["preferred_username"];
482
+ if (username) {
483
+ this.imageUrl = this.layoutService.userImageUrl(username);
484
+ }
485
+ else {
486
+ if (!this.isProduction)
487
+ console.debug('Trying to load user profile to get avatar');
488
+ this.oauthService.loadUserProfile().then(info => {
489
+ var userProfile = info;
490
+ if (userProfile) {
491
+ this.imageUrl = this.layoutService.userImageUrl(userProfile.info.preferred_username);
492
+ }
493
+ else {
494
+ console.warn('No user profile found', info);
495
+ }
496
+ });
497
+ }
498
+ }
499
+ }
500
+ onClick() {
501
+ if (this.dialogService) {
502
+ this.dialogService.open(this.imageUrl);
503
+ }
504
+ }
505
+ hasValidToken() {
506
+ return this.oauthService.hasValidAccessToken() && this.oauthService.hasValidIdToken();
507
+ }
508
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UserProfileComponent, deps: [{ token: ProfileDialogService, optional: true }, { token: LayoutService }, { token: i3$2.OAuthService }], target: i0.ɵɵFactoryTarget.Component }); }
509
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: UserProfileComponent, selector: "juice-user-profile", ngImport: i0, template: "<button class=\"user-image\" (click)=\"onClick()\">\n <img [src]=\"imageUrl\"/>\n</button>", styles: [":host{height:100%;aspect-ratio:1/1;display:flex;padding:3px;box-sizing:border-box}.user-image{flex:1 auto;border:0;padding:0;background:none}.user-image img{width:100%;height:100%;border-radius:50%;object-fit:cover;cursor:pointer}\n"] }); }
510
+ }
511
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UserProfileComponent, decorators: [{
512
+ type: Component,
513
+ args: [{ selector: 'juice-user-profile', template: "<button class=\"user-image\" (click)=\"onClick()\">\n <img [src]=\"imageUrl\"/>\n</button>", styles: [":host{height:100%;aspect-ratio:1/1;display:flex;padding:3px;box-sizing:border-box}.user-image{flex:1 auto;border:0;padding:0;background:none}.user-image img{width:100%;height:100%;border-radius:50%;object-fit:cover;cursor:pointer}\n"] }]
514
+ }], ctorParameters: function () { return [{ type: ProfileDialogService, decorators: [{
515
+ type: Optional
516
+ }] }, { type: LayoutService }, { type: i3$2.OAuthService }]; } });
517
+
518
+ class PageComponent {
519
+ constructor(service, breakpointObserver) {
520
+ this.service = service;
521
+ this.breakpointObserver = breakpointObserver;
522
+ this.isMobile = false;
523
+ this.isSnavOpenned = false;
524
+ breakpointObserver.observe([
525
+ Breakpoints.HandsetLandscape,
526
+ Breakpoints.HandsetPortrait
527
+ ]).subscribe(result => {
528
+ this.isMobile = result.matches;
529
+ this.isSnavOpenned = !this.isMobile;
530
+ });
531
+ }
532
+ hideSidenavOnMobile() {
533
+ if (this.isMobile) {
534
+ this.isSnavOpenned = false;
535
+ }
536
+ }
537
+ toggleSidenav() {
538
+ this.isSnavOpenned = !this.isSnavOpenned;
539
+ }
540
+ toolbarHeight() {
541
+ return "48px"; // this.isMobile ? "42px" : "48px";
542
+ }
543
+ onAttach(e) {
544
+ console.log("attached", e);
545
+ }
546
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PageComponent, deps: [{ token: LayoutService }, { token: i4$2.BreakpointObserver }], target: i0.ɵɵFactoryTarget.Component }); }
547
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: PageComponent, selector: "app-page", ngImport: i0, template: "<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->\n<!-- * * * * * * * * * * * The content below * * * * * * * * * * * -->\n<!-- * * * * * * * * * * is only a placeholder * * * * * * * * * * -->\n<!-- * * * * * * * * * * and can be replaced. * * * * * * * * * * * -->\n<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->\n<!-- * * * * * * * * * Delete the template below * * * * * * * * * * -->\n<!-- * * * * * * * to get started with your project! * * * * * * * * -->\n<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->\n<div class=\"container\" [class.mobile]=\"isMobile\">\n <!-- Toolbar -->\n <mat-toolbar color=\"primary\" [style.height]=\"toolbarHeight()\">\n <button *ngIf=\"isMobile\" mat-icon-button (click)=\"toggleSidenav()\" class=\"m-r\">\n <mat-icon aria-hidden=\"false\" fontIcon=\"menu\"></mat-icon>\n </button>\n <a *ngIf=\"!isMobile\" [routerLink]=\"['/',service.tenantIdentifier]\" class=\"nav-link home\">\n <img height=\"40 \" alt=\"{{service.brandName()}} Logo \" [src]=\"service.brandLogo() \" class=\"p-r \" />\n </a>\n <span *ngIf=\"!isMobile\">{{service.brandName()}}</span>\n <juice-search-bar></juice-search-bar>\n <span class=\"toolbar-spacer \"></span>\n <juice-dark-mode></juice-dark-mode>\n <juice-user-profile></juice-user-profile>\n </mat-toolbar>\n\n <mat-sidenav-container>\n <mat-sidenav [opened]=\"isSnavOpenned\" (closed)=\"isSnavOpenned = false\" #snav \n (navigate)=\"hideSidenavOnMobile\" (click)=\"hideSidenavOnMobile\" (swipeRight)=\"hideSidenavOnMobile\"\n [mode]=\"isMobile ? 'over': 'side' \" \n [@menuTransition]=\" menu.isExpanded ? 'expand' : 'collapsed' \" [fixedInViewport]=\"true\" \n [style.top]=\"isMobile ? toolbarHeight():0\">\n <juice-nav-menu #menu [class.menu-expanded]=\"isSnavOpenned\" \n [class.menu-collapsed]=\"!isSnavOpenned\"></juice-nav-menu>\n </mat-sidenav>\n\n <mat-sidenav-content style=\"margin-left: 0;\">\n <router-outlet (activate)=\"onAttach\"></router-outlet>\n </mat-sidenav-content>\n\n </mat-sidenav-container>\n</div>\n<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->\n<!-- * * * * * * * * * * * The content above * * * * * * * * * * * -->\n<!-- * * * * * * * * * * is only a placeholder * * * * * * * * * * -->\n<!-- * * * * * * * * * * and can be replaced. * * * * * * * * * * * -->\n<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->\n<!-- * * * * * * * * * * End of Placeholder * * * * * * * * * * * -->\n<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->", styles: [":host .toolbar-spacer{flex:1 1 auto}:host .nav-link{display:flex;margin-right:.5em}:host .mat-sidenav-container{display:flex;flex-direction:row}:host .mat-sidenav-container .mat-drawer-side{position:relative;flex:0 auto}:host .mat-sidenav-container .mat-drawer-over{position:fixed}:host .mat-sidenav-container .mat-sidenav-content{flex:1;height:auto}:host .container{display:flex;flex-direction:column}:host .container .mat-toolbar{flex:0 0 auto}:host .container .mat-sidenav-container{flex:1 1 auto;display:flex;flex-direction:row}\n"], dependencies: [{ kind: "directive", type: i1$1.RouterOutlet, selector: "router-outlet", inputs: ["name"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "directive", type: i1$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i6.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "component", type: i7$1.MatSidenav, selector: "mat-sidenav", inputs: ["fixedInViewport", "fixedTopGap", "fixedBottomGap"], exportAs: ["matSidenav"] }, { kind: "component", type: i7$1.MatSidenavContainer, selector: "mat-sidenav-container", exportAs: ["matSidenavContainer"] }, { kind: "component", type: i7$1.MatSidenavContent, selector: "mat-sidenav-content" }, { kind: "component", type: i3.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: DarkModeComponent, selector: "juice-dark-mode" }, { kind: "component", type: NavMenuComponent, selector: "juice-nav-menu" }, { kind: "component", type: SearchBarComponent, selector: "juice-search-bar" }, { kind: "component", type: UserProfileComponent, selector: "juice-user-profile" }], animations: [
548
+ trigger('menuTransition', [
549
+ state('expand', style({
550
+ width: '220px'
551
+ })),
552
+ state('collapsed', style({
553
+ width: '60px'
554
+ })),
555
+ transition('* => collapsed', [
556
+ animate('0.15s')
557
+ ]),
558
+ transition('* => expand', [
559
+ animate('0.15s')
560
+ ])
561
+ ]),
562
+ trigger('contentTransition', [
563
+ state('expand', style({
564
+ "margin-left": "60px"
565
+ })),
566
+ state('collapsed', style({
567
+ "margin-left": "220px"
568
+ })),
569
+ state("full", style({
570
+ "margin-left": "0"
571
+ })),
572
+ transition('* => collapsed', [
573
+ animate('0.15s')
574
+ ]),
575
+ transition('* => expand', [
576
+ animate('0.15s')
577
+ ])
578
+ ])
579
+ ] }); }
580
+ }
581
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PageComponent, decorators: [{
582
+ type: Component,
583
+ args: [{ selector: 'app-page', animations: [
584
+ trigger('menuTransition', [
585
+ state('expand', style({
586
+ width: '220px'
587
+ })),
588
+ state('collapsed', style({
589
+ width: '60px'
590
+ })),
591
+ transition('* => collapsed', [
592
+ animate('0.15s')
593
+ ]),
594
+ transition('* => expand', [
595
+ animate('0.15s')
596
+ ])
597
+ ]),
598
+ trigger('contentTransition', [
599
+ state('expand', style({
600
+ "margin-left": "60px"
601
+ })),
602
+ state('collapsed', style({
603
+ "margin-left": "220px"
604
+ })),
605
+ state("full", style({
606
+ "margin-left": "0"
607
+ })),
608
+ transition('* => collapsed', [
609
+ animate('0.15s')
610
+ ]),
611
+ transition('* => expand', [
612
+ animate('0.15s')
613
+ ])
614
+ ])
615
+ ], template: "<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->\n<!-- * * * * * * * * * * * The content below * * * * * * * * * * * -->\n<!-- * * * * * * * * * * is only a placeholder * * * * * * * * * * -->\n<!-- * * * * * * * * * * and can be replaced. * * * * * * * * * * * -->\n<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->\n<!-- * * * * * * * * * Delete the template below * * * * * * * * * * -->\n<!-- * * * * * * * to get started with your project! * * * * * * * * -->\n<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->\n<div class=\"container\" [class.mobile]=\"isMobile\">\n <!-- Toolbar -->\n <mat-toolbar color=\"primary\" [style.height]=\"toolbarHeight()\">\n <button *ngIf=\"isMobile\" mat-icon-button (click)=\"toggleSidenav()\" class=\"m-r\">\n <mat-icon aria-hidden=\"false\" fontIcon=\"menu\"></mat-icon>\n </button>\n <a *ngIf=\"!isMobile\" [routerLink]=\"['/',service.tenantIdentifier]\" class=\"nav-link home\">\n <img height=\"40 \" alt=\"{{service.brandName()}} Logo \" [src]=\"service.brandLogo() \" class=\"p-r \" />\n </a>\n <span *ngIf=\"!isMobile\">{{service.brandName()}}</span>\n <juice-search-bar></juice-search-bar>\n <span class=\"toolbar-spacer \"></span>\n <juice-dark-mode></juice-dark-mode>\n <juice-user-profile></juice-user-profile>\n </mat-toolbar>\n\n <mat-sidenav-container>\n <mat-sidenav [opened]=\"isSnavOpenned\" (closed)=\"isSnavOpenned = false\" #snav \n (navigate)=\"hideSidenavOnMobile\" (click)=\"hideSidenavOnMobile\" (swipeRight)=\"hideSidenavOnMobile\"\n [mode]=\"isMobile ? 'over': 'side' \" \n [@menuTransition]=\" menu.isExpanded ? 'expand' : 'collapsed' \" [fixedInViewport]=\"true\" \n [style.top]=\"isMobile ? toolbarHeight():0\">\n <juice-nav-menu #menu [class.menu-expanded]=\"isSnavOpenned\" \n [class.menu-collapsed]=\"!isSnavOpenned\"></juice-nav-menu>\n </mat-sidenav>\n\n <mat-sidenav-content style=\"margin-left: 0;\">\n <router-outlet (activate)=\"onAttach\"></router-outlet>\n </mat-sidenav-content>\n\n </mat-sidenav-container>\n</div>\n<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->\n<!-- * * * * * * * * * * * The content above * * * * * * * * * * * -->\n<!-- * * * * * * * * * * is only a placeholder * * * * * * * * * * -->\n<!-- * * * * * * * * * * and can be replaced. * * * * * * * * * * * -->\n<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->\n<!-- * * * * * * * * * * End of Placeholder * * * * * * * * * * * -->\n<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->", styles: [":host .toolbar-spacer{flex:1 1 auto}:host .nav-link{display:flex;margin-right:.5em}:host .mat-sidenav-container{display:flex;flex-direction:row}:host .mat-sidenav-container .mat-drawer-side{position:relative;flex:0 auto}:host .mat-sidenav-container .mat-drawer-over{position:fixed}:host .mat-sidenav-container .mat-sidenav-content{flex:1;height:auto}:host .container{display:flex;flex-direction:column}:host .container .mat-toolbar{flex:0 0 auto}:host .container .mat-sidenav-container{flex:1 1 auto;display:flex;flex-direction:row}\n"] }]
616
+ }], ctorParameters: function () { return [{ type: LayoutService }, { type: i4$2.BreakpointObserver }]; } });
617
+
618
+ class PageNotfoundComponent {
619
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PageNotfoundComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
620
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: PageNotfoundComponent, selector: "juice-page-notfound", ngImport: i0, template: "<div class=\"container pt-4\">\n <h1>{{'Not found' | translate }}</h1>\n <p>{{ 'Your requested resource could not be found' | translate}}</p>\n </div>\n ", styles: [""], dependencies: [{ kind: "pipe", type: i5.TranslatePipe, name: "translate" }] }); }
621
+ }
622
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PageNotfoundComponent, decorators: [{
623
+ type: Component,
624
+ args: [{ selector: 'juice-page-notfound', template: "<div class=\"container pt-4\">\n <h1>{{'Not found' | translate }}</h1>\n <p>{{ 'Your requested resource could not be found' | translate}}</p>\n </div>\n " }]
625
+ }] });
626
+
627
+ const routes = [];
628
+ class LayoutModule {
629
+ static forRoot(production, options) {
630
+ let config = new LayoutConfig(options);
631
+ return {
632
+ ngModule: LayoutModule,
633
+ providers: [
634
+ LayoutService,
635
+ {
636
+ provide: IS_PRODUCTION,
637
+ useValue: production
638
+ },
639
+ {
640
+ provide: LayoutConfig,
641
+ useValue: config
642
+ }
643
+ ]
644
+ };
645
+ }
646
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LayoutModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
647
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: LayoutModule, declarations: [PageComponent,
648
+ DarkModeComponent,
649
+ NavMenuComponent,
650
+ ExpandableMenuComponent,
651
+ PageNotfoundComponent,
652
+ SearchBarComponent,
653
+ UserProfileComponent], imports: [i1$1.RouterModule, CommonModule,
654
+ FormsModule, i5.TranslateModule, MatIconModule,
655
+ MatToolbarModule,
656
+ MatSidenavModule,
657
+ MatButtonModule,
658
+ MatExpansionModule,
659
+ MatListModule,
660
+ MatFormFieldModule,
661
+ MatInputModule,
662
+ MatTooltipModule], exports: [PageComponent,
663
+ RouterModule] }); }
664
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LayoutModule, imports: [RouterModule.forChild(routes),
665
+ CommonModule,
666
+ FormsModule,
667
+ TranslateModule.forChild(),
668
+ MatIconModule,
669
+ MatToolbarModule,
670
+ MatSidenavModule,
671
+ MatButtonModule,
672
+ MatExpansionModule,
673
+ MatListModule,
674
+ MatFormFieldModule,
675
+ MatInputModule,
676
+ MatTooltipModule, RouterModule] }); }
677
+ }
678
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LayoutModule, decorators: [{
679
+ type: NgModule,
680
+ args: [{
681
+ declarations: [
682
+ PageComponent,
683
+ DarkModeComponent,
684
+ NavMenuComponent,
685
+ ExpandableMenuComponent,
686
+ PageNotfoundComponent,
687
+ SearchBarComponent,
688
+ UserProfileComponent,
689
+ ],
690
+ imports: [
691
+ RouterModule.forChild(routes),
692
+ CommonModule,
693
+ FormsModule,
694
+ TranslateModule.forChild(),
695
+ MatIconModule,
696
+ MatToolbarModule,
697
+ MatSidenavModule,
698
+ MatButtonModule,
699
+ MatExpansionModule,
700
+ MatListModule,
701
+ MatFormFieldModule,
702
+ MatInputModule,
703
+ MatTooltipModule
704
+ ],
705
+ exports: [
706
+ PageComponent,
707
+ RouterModule
708
+ ]
709
+ }]
710
+ }] });
711
+
712
+ /**
713
+ * This module for study purpose only.
714
+ * Consider using matTooltip from @angular/material
715
+ */
716
+ class TooltipModule {
717
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TooltipModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
718
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: TooltipModule, declarations: [TooltipComponent,
719
+ TooltipDirective], imports: [CommonModule], exports: [TooltipDirective] }); }
720
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TooltipModule, imports: [CommonModule] }); }
721
+ }
722
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TooltipModule, decorators: [{
723
+ type: NgModule,
724
+ args: [{
725
+ declarations: [
726
+ TooltipComponent,
727
+ TooltipDirective
728
+ ],
729
+ imports: [
730
+ CommonModule
731
+ ],
732
+ exports: [
733
+ TooltipDirective
734
+ ]
735
+ }]
736
+ }] });
737
+
738
+ class DevGuard {
739
+ constructor() {
740
+ this.isProduction = inject(IS_PRODUCTION);
741
+ }
742
+ canActivate() {
743
+ console.log('DevGuard: this route is available in development environment only!', this.isProduction);
744
+ return !this.isProduction;
745
+ }
746
+ canDisplay() {
747
+ console.log('DevGuard: this menu is available in development environment only!', this.isProduction);
748
+ return !this.isProduction;
749
+ }
750
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DevGuard, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
751
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DevGuard, providedIn: 'root' }); }
752
+ }
753
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DevGuard, decorators: [{
754
+ type: Injectable,
755
+ args: [{
756
+ providedIn: 'root'
757
+ }]
758
+ }] });
759
+
760
+ class UserProfileDialogComponent {
761
+ constructor(auth) {
762
+ this.auth = auth;
763
+ this.username = '';
764
+ this.name = '';
765
+ this.email = '';
766
+ this.loggedin = false;
767
+ }
768
+ ngOnInit() {
769
+ if (this.auth.hasValidIdToken()) {
770
+ const claims = this.auth.getIdentityClaims();
771
+ if (claims['preferred_username']) {
772
+ this.setValues(claims);
773
+ }
774
+ else {
775
+ this.auth.loadUserProfile().then(info => {
776
+ var userProfile = info;
777
+ if (userProfile) {
778
+ this.setValues(userProfile.info);
779
+ }
780
+ else {
781
+ console.debug('No user profile', info);
782
+ }
783
+ });
784
+ }
785
+ }
786
+ }
787
+ setValues(claims) {
788
+ this.username = claims['preferred_username'];
789
+ this.name = claims['name'];
790
+ this.email = claims['email'] ?? '';
791
+ this.loggedin = true;
792
+ }
793
+ logout() {
794
+ this.auth.loadDiscoveryDocument().then(() => {
795
+ this.auth.logOut();
796
+ });
797
+ }
798
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UserProfileDialogComponent, deps: [{ token: i3$2.OAuthService }], target: i0.ɵɵFactoryTarget.Component }); }
799
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: UserProfileDialogComponent, selector: "app-user-profile", ngImport: i0, template: "<h3 mat-dialog-title *ngIf=\"loggedin\">{{name}}</h3>\n<div mat-dialog-content>\n <div *ngIf=\"loggedin\">\n <p *ngIf=\"name\">{{'Welcome' | translate}} {{name}}</p>\n <p *ngIf=\"email\">{{ 'Email' | translate}}: {{email}}</p>\n <!-- Logout -->\n </div>\n <div *ngIf=\"!loggedin\">\n <p>{{ 'Please login to view your profile' | translate}}</p>\n </div>\n</div>\n<div mat-dialog-actions>\n <button mat-raised-button *ngIf=\"loggedin\" color=\"primary\" (click)=\"logout()\">{{ 'Logout' | translate}}</button>\n <button mat-button mat-dialog-close cdkFocusInitial>{{ 'Close' | translate}}</button>\n</div>", styles: [""], dependencies: [{ kind: "directive", type: i2$2.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i2$2.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i2$2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i2$2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: i3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }] }); }
800
+ }
801
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UserProfileDialogComponent, decorators: [{
802
+ type: Component,
803
+ args: [{ selector: 'app-user-profile', template: "<h3 mat-dialog-title *ngIf=\"loggedin\">{{name}}</h3>\n<div mat-dialog-content>\n <div *ngIf=\"loggedin\">\n <p *ngIf=\"name\">{{'Welcome' | translate}} {{name}}</p>\n <p *ngIf=\"email\">{{ 'Email' | translate}}: {{email}}</p>\n <!-- Logout -->\n </div>\n <div *ngIf=\"!loggedin\">\n <p>{{ 'Please login to view your profile' | translate}}</p>\n </div>\n</div>\n<div mat-dialog-actions>\n <button mat-raised-button *ngIf=\"loggedin\" color=\"primary\" (click)=\"logout()\">{{ 'Logout' | translate}}</button>\n <button mat-button mat-dialog-close cdkFocusInitial>{{ 'Close' | translate}}</button>\n</div>" }]
804
+ }], ctorParameters: function () { return [{ type: i3$2.OAuthService }]; } });
805
+
806
+ class UserProfileDialogService extends ProfileDialogService {
807
+ constructor(matDialog) {
808
+ super(matDialog);
809
+ }
810
+ async open(data) {
811
+ return this.matDialog.open(UserProfileDialogComponent, { position: { top: '50px', right: '10px' } });
812
+ }
813
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UserProfileDialogService, deps: [{ token: i2$2.MatDialog }], target: i0.ɵɵFactoryTarget.Injectable }); }
814
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UserProfileDialogService }); }
815
+ }
816
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UserProfileDialogService, decorators: [{
817
+ type: Injectable
818
+ }], ctorParameters: function () { return [{ type: i2$2.MatDialog }]; } });
819
+
820
+ class UserProfileDialogModule {
821
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UserProfileDialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
822
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: UserProfileDialogModule, declarations: [UserProfileDialogComponent], imports: [MatDialogModule,
823
+ MatButtonModule, i5.TranslateModule, CommonModule] }); }
824
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UserProfileDialogModule, providers: [
825
+ {
826
+ provide: ProfileDialogService,
827
+ useClass: UserProfileDialogService
828
+ }
829
+ ], imports: [MatDialogModule,
830
+ MatButtonModule,
831
+ TranslateModule.forChild(),
832
+ CommonModule] }); }
833
+ }
834
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UserProfileDialogModule, decorators: [{
835
+ type: NgModule,
836
+ args: [{
837
+ declarations: [
838
+ UserProfileDialogComponent
839
+ ],
840
+ imports: [
841
+ MatDialogModule,
842
+ MatButtonModule,
843
+ TranslateModule.forChild(),
844
+ CommonModule
845
+ ],
846
+ exports: [],
847
+ providers: [
848
+ {
849
+ provide: ProfileDialogService,
850
+ useClass: UserProfileDialogService
851
+ }
852
+ ]
853
+ }]
854
+ }] });
855
+
856
+ /*
857
+ * Public API Surface of layout
858
+ */
859
+
860
+ /**
861
+ * Generated bundle index. Do not edit.
862
+ */
863
+
864
+ export { DevGuard, ExpandableMenuComponent, LayoutModule, LayoutService, NavMenuComponent, PageComponent, PageNotfoundComponent, ProfileDialogService, SearchService, TooltipDirective, TooltipModule, TooltipPosition, UserProfileDialogModule };
865
+ //# sourceMappingURL=juice-js-layout.mjs.map