@igo2/core 1.7.2 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/__ivy_ngcc__/locale/en.auth.json +5 -1
  2. package/__ivy_ngcc__/locale/en.common.json +43 -43
  3. package/__ivy_ngcc__/locale/en.core.json +23 -23
  4. package/__ivy_ngcc__/locale/en.geo.json +36 -8
  5. package/__ivy_ngcc__/locale/en.integration.json +31 -3
  6. package/__ivy_ngcc__/locale/en.json +70 -11
  7. package/__ivy_ngcc__/locale/fr.auth.json +4 -1
  8. package/__ivy_ngcc__/locale/fr.common.json +43 -43
  9. package/__ivy_ngcc__/locale/fr.core.json +23 -23
  10. package/__ivy_ngcc__/locale/fr.geo.json +37 -9
  11. package/__ivy_ngcc__/locale/fr.integration.json +33 -4
  12. package/__ivy_ngcc__/locale/fr.json +71 -12
  13. package/bundles/igo2-core.umd.js +1492 -1422
  14. package/bundles/igo2-core.umd.js.map +1 -1
  15. package/esm2015/igo2-core.js +5 -5
  16. package/esm2015/lib/activity/activity.interceptor.js +30 -31
  17. package/esm2015/lib/activity/activity.module.js +30 -29
  18. package/esm2015/lib/activity/activity.service.js +33 -33
  19. package/esm2015/lib/activity/index.js +3 -3
  20. package/esm2015/lib/analytics/index.js +2 -2
  21. package/esm2015/lib/analytics/shared/analytics.interface.js +2 -1
  22. package/esm2015/lib/analytics/shared/analytics.service.js +74 -75
  23. package/esm2015/lib/analytics/shared/index.js +3 -3
  24. package/esm2015/lib/config/config.interface.js +2 -1
  25. package/esm2015/lib/config/config.module.js +23 -22
  26. package/esm2015/lib/config/config.provider.js +21 -21
  27. package/esm2015/lib/config/config.service.js +52 -52
  28. package/esm2015/lib/config/index.js +4 -4
  29. package/esm2015/lib/config/version.js +5 -5
  30. package/esm2015/lib/core.module.js +71 -72
  31. package/esm2015/lib/gesture/gesture.module.js +30 -29
  32. package/esm2015/lib/gesture/gesture.provider.js +16 -17
  33. package/esm2015/lib/language/index.js +2 -2
  34. package/esm2015/lib/language/language.module.js +41 -40
  35. package/esm2015/lib/language/shared/index.js +5 -5
  36. package/esm2015/lib/language/shared/language.interface.js +2 -1
  37. package/esm2015/lib/language/shared/language.loader.js +28 -28
  38. package/esm2015/lib/language/shared/language.provider.js +22 -22
  39. package/esm2015/lib/language/shared/language.service.js +28 -29
  40. package/esm2015/lib/language/shared/missing-translation.guard.js +16 -16
  41. package/esm2015/lib/media/index.js +3 -3
  42. package/esm2015/lib/media/media.enum.js +12 -12
  43. package/esm2015/lib/media/media.service.js +76 -76
  44. package/esm2015/lib/message/index.js +3 -3
  45. package/esm2015/lib/message/message-center/index.js +2 -2
  46. package/esm2015/lib/message/message-center/message-center.component.js +43 -43
  47. package/esm2015/lib/message/message.module.js +27 -26
  48. package/esm2015/lib/message/shared/index.js +4 -4
  49. package/esm2015/lib/message/shared/message.enum.js +8 -8
  50. package/esm2015/lib/message/shared/message.interface.js +2 -1
  51. package/esm2015/lib/message/shared/message.service.js +130 -124
  52. package/esm2015/lib/network/index.js +3 -3
  53. package/esm2015/lib/network/network.interfaces.js +2 -1
  54. package/esm2015/lib/network/network.service.js +59 -60
  55. package/esm2015/lib/request/error.interceptor.js +62 -63
  56. package/esm2015/lib/request/error.module.js +39 -38
  57. package/esm2015/lib/request/index.js +3 -3
  58. package/esm2015/lib/request/logging.interceptor.js +29 -29
  59. package/esm2015/lib/request/logging.module.js +30 -29
  60. package/esm2015/lib/route/route.interface.js +2 -1
  61. package/esm2015/lib/route/route.service.js +55 -56
  62. package/esm2015/lib/storage/index.js +3 -3
  63. package/esm2015/lib/storage/storage.interface.js +13 -13
  64. package/esm2015/lib/storage/storage.service.js +79 -80
  65. package/esm2015/public_api.js +26 -26
  66. package/fesm2015/igo2-core.js +1029 -1008
  67. package/fesm2015/igo2-core.js.map +1 -1
  68. package/igo2-core.d.ts +5 -5
  69. package/lib/activity/activity.interceptor.d.ts +11 -11
  70. package/lib/activity/activity.module.d.ts +8 -7
  71. package/lib/activity/activity.service.d.ts +11 -11
  72. package/lib/activity/index.d.ts +2 -2
  73. package/lib/analytics/index.d.ts +1 -1
  74. package/lib/analytics/shared/analytics.interface.d.ts +6 -6
  75. package/lib/analytics/shared/analytics.service.d.ts +19 -19
  76. package/lib/analytics/shared/index.d.ts +2 -2
  77. package/lib/config/config.interface.d.ts +6 -6
  78. package/lib/config/config.module.d.ts +8 -7
  79. package/lib/config/config.provider.d.ts +15 -15
  80. package/lib/config/config.service.d.ts +18 -18
  81. package/lib/config/index.d.ts +3 -3
  82. package/lib/config/version.d.ts +5 -5
  83. package/lib/core.module.d.ts +18 -17
  84. package/lib/gesture/gesture.module.d.ts +9 -8
  85. package/lib/gesture/gesture.provider.d.ts +7 -7
  86. package/lib/language/index.d.ts +1 -1
  87. package/lib/language/language.module.d.ts +9 -8
  88. package/lib/language/shared/index.d.ts +4 -4
  89. package/lib/language/shared/language.interface.d.ts +3 -3
  90. package/lib/language/shared/language.loader.d.ts +11 -11
  91. package/lib/language/shared/language.provider.d.ts +15 -15
  92. package/lib/language/shared/language.service.d.ts +11 -11
  93. package/lib/language/shared/missing-translation.guard.d.ts +4 -4
  94. package/lib/media/index.d.ts +2 -2
  95. package/lib/media/media.enum.d.ts +9 -9
  96. package/lib/media/media.service.d.ts +16 -16
  97. package/lib/message/index.d.ts +2 -2
  98. package/lib/message/message-center/index.d.ts +1 -1
  99. package/lib/message/message-center/message-center.component.d.ts +19 -19
  100. package/lib/message/message.module.d.ts +11 -10
  101. package/lib/message/shared/index.d.ts +4 -4
  102. package/lib/message/shared/message.enum.d.ts +6 -6
  103. package/lib/message/shared/message.interface.d.ts +18 -17
  104. package/lib/message/shared/message.service.d.ts +25 -24
  105. package/lib/network/index.d.ts +2 -2
  106. package/lib/network/network.interfaces.d.ts +3 -3
  107. package/lib/network/network.service.d.ts +20 -20
  108. package/lib/request/error.interceptor.d.ts +16 -16
  109. package/lib/request/error.module.d.ts +9 -8
  110. package/lib/request/index.d.ts +2 -2
  111. package/lib/request/logging.interceptor.d.ts +8 -8
  112. package/lib/request/logging.module.d.ts +8 -7
  113. package/lib/route/route.interface.d.ts +22 -22
  114. package/lib/route/route.service.d.ts +18 -18
  115. package/lib/storage/index.d.ts +2 -2
  116. package/lib/storage/storage.interface.d.ts +20 -20
  117. package/lib/storage/storage.service.d.ts +19 -19
  118. package/locale/en.auth.json +5 -1
  119. package/locale/en.common.json +43 -43
  120. package/locale/en.core.json +23 -23
  121. package/locale/en.geo.json +36 -8
  122. package/locale/en.integration.json +31 -3
  123. package/locale/en.json +70 -11
  124. package/locale/fr.auth.json +4 -1
  125. package/locale/fr.common.json +43 -43
  126. package/locale/fr.core.json +23 -23
  127. package/locale/fr.geo.json +37 -9
  128. package/locale/fr.integration.json +33 -4
  129. package/locale/fr.json +71 -12
  130. package/package.json +8 -8
  131. package/public_api.d.ts +22 -22
  132. package/style/all.theming.scss +0 -7649
  133. package/style/core.theming.scss +0 -43
  134. package/style/foreground.scss +1 -1
  135. package/style/index.theming.scss +1006 -0
  136. package/style/material.font.scss +9 -9
  137. package/style/partial/core.variables.scss +3 -3
  138. package/style/partial/media.scss +80 -80
  139. package/style/setup.scss +1 -0
  140. package/style/themes/blue.theme.scss +16 -11
  141. package/style/themes/bluedq.theme.scss +52 -0
  142. package/style/themes/bluegrey.theme.scss +15 -8
  143. package/style/themes/dark.theme.scss +15 -8
  144. package/style/themes/deeppurple.theme.scss +15 -8
  145. package/style/themes/indigo.theme.scss +15 -8
  146. package/style/themes/orange.theme.scss +15 -8
  147. package/style/themes/teal.theme.scss +15 -8
  148. package/style/theming.scss +2 -7180
  149. package/style/typography.scss +14 -14
  150. package/bundles/igo2-core.umd.min.js +0 -17
  151. package/bundles/igo2-core.umd.min.js.map +0 -1
@@ -1,1070 +1,1091 @@
1
- import { ɵɵdefineInjectable, ɵsetClassMetadata, Injectable, ɵɵinject, ɵɵdefineNgModule, ɵɵdefineInjector, NgModule, Injector, InjectionToken, APP_INITIALIZER, ɵɵsetNgModuleScope, ɵɵdefineComponent, ɵɵelement, ɵɵproperty, ɵɵpureFunction1, Component, Input, Optional, SkipSelf, ɵɵgetInheritedFactory, Inject, EventEmitter } from '@angular/core';
2
- import { NgClass, CommonModule } from '@angular/common';
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, NgModule, InjectionToken, APP_INITIALIZER, Component, Input, Optional, SkipSelf, Inject, EventEmitter } from '@angular/core';
3
+ import * as i2 from '@angular/common';
4
+ import { CommonModule } from '@angular/common';
3
5
  import { HTTP_INTERCEPTORS, HttpClient, HttpErrorResponse, HttpClientModule, HttpResponse } from '@angular/common/http';
4
- import { DomSanitizer, HammerGestureConfig, HAMMER_GESTURE_CONFIG, HammerModule } from '@angular/platform-browser';
5
- import { MatIconRegistry } from '@angular/material/icon';
6
6
  import { finalize, catchError, map, tap, debounceTime, startWith } from 'rxjs/operators';
7
7
  import { BehaviorSubject, throwError, of, combineLatest, fromEvent } from 'rxjs';
8
8
  import { uuid, ObjectUtils } from '@igo2/utils';
9
- import { TranslateLoader, TranslateModule, MissingTranslationHandler, TranslateService } from '@ngx-translate/core';
10
- import { SimpleNotificationsComponent, SimpleNotificationsModule, NotificationsService } from 'angular2-notifications';
11
- import { ActivatedRoute } from '@angular/router';
12
- import { Breakpoints, BreakpointObserver } from '@angular/cdk/layout';
9
+ import * as i1 from '@ngx-translate/core';
10
+ import { TranslateLoader, TranslateModule, MissingTranslationHandler } from '@ngx-translate/core';
11
+ import * as i1$1 from '@igo2/angular2-notifications';
12
+ import { SimpleNotificationsModule } from '@igo2/angular2-notifications';
13
+ import * as i1$2 from '@angular/material/icon';
14
+ import * as i2$1 from '@angular/platform-browser';
15
+ import { HammerGestureConfig, HAMMER_GESTURE_CONFIG, HammerModule } from '@angular/platform-browser';
16
+ import * as i1$3 from '@angular/router';
17
+ import * as i1$4 from '@angular/cdk/layout';
18
+ import { Breakpoints } from '@angular/cdk/layout';
13
19
 
14
- class ActivityService {
15
- constructor() {
16
- this.counter$ = new BehaviorSubject(0);
17
- this.ids = [];
18
- }
19
- register() {
20
- const id = uuid();
21
- this.ids.push(id);
22
- this.counter$.next(this.ids.length);
23
- return id;
24
- }
25
- unregister(id) {
26
- const index = this.ids.indexOf(id);
27
- if (index === -1) {
28
- return;
29
- }
30
- this.ids.splice(index, 1);
31
- this.counter$.next(this.ids.length);
32
- }
33
- }
34
- ActivityService.ɵfac = function ActivityService_Factory(t) { return new (t || ActivityService)(); };
35
- ActivityService.ɵprov = ɵɵdefineInjectable({ token: ActivityService, factory: ActivityService.ɵfac, providedIn: 'root' });
36
- /*@__PURE__*/ (function () { ɵsetClassMetadata(ActivityService, [{
37
- type: Injectable,
38
- args: [{
39
- providedIn: 'root'
40
- }]
20
+ class ActivityService {
21
+ constructor() {
22
+ this.counter$ = new BehaviorSubject(0);
23
+ this.ids = [];
24
+ }
25
+ register() {
26
+ const id = uuid();
27
+ this.ids.push(id);
28
+ this.counter$.next(this.ids.length);
29
+ return id;
30
+ }
31
+ unregister(id) {
32
+ const index = this.ids.indexOf(id);
33
+ if (index === -1) {
34
+ return;
35
+ }
36
+ this.ids.splice(index, 1);
37
+ this.counter$.next(this.ids.length);
38
+ }
39
+ }
40
+ ActivityService.ɵfac = function ActivityService_Factory(t) { return new (t || ActivityService)(); };
41
+ ActivityService.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ActivityService, factory: ActivityService.ɵfac, providedIn: 'root' });
42
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ActivityService, [{
43
+ type: Injectable,
44
+ args: [{
45
+ providedIn: 'root'
46
+ }]
41
47
  }], function () { return []; }, null); })();
42
48
 
43
- class ActivityInterceptor {
44
- constructor(activityService) {
45
- this.activityService = activityService;
46
- }
47
- intercept(req, next) {
48
- const activity = req.headers.get('activityInterceptor');
49
- if (activity) {
50
- const actReq = req.clone({
51
- headers: req.headers.delete('activityInterceptor')
52
- });
53
- if (activity === 'false') {
54
- return next.handle(actReq);
55
- }
56
- }
57
- const id = this.activityService.register();
58
- return next.handle(req).pipe(finalize(() => {
59
- this.activityService.unregister(id);
60
- }));
61
- }
62
- }
63
- ActivityInterceptor.ɵfac = function ActivityInterceptor_Factory(t) { return new (t || ActivityInterceptor)(ɵɵinject(ActivityService)); };
64
- ActivityInterceptor.ɵprov = ɵɵdefineInjectable({ token: ActivityInterceptor, factory: ActivityInterceptor.ɵfac });
65
- /*@__PURE__*/ (function () { ɵsetClassMetadata(ActivityInterceptor, [{
66
- type: Injectable
49
+ class ActivityInterceptor {
50
+ constructor(activityService) {
51
+ this.activityService = activityService;
52
+ }
53
+ intercept(req, next) {
54
+ const activity = req.headers.get('activityInterceptor');
55
+ if (activity) {
56
+ const actReq = req.clone({
57
+ headers: req.headers.delete('activityInterceptor')
58
+ });
59
+ if (activity === 'false') {
60
+ return next.handle(actReq);
61
+ }
62
+ }
63
+ const id = this.activityService.register();
64
+ return next.handle(req).pipe(finalize(() => {
65
+ this.activityService.unregister(id);
66
+ }));
67
+ }
68
+ }
69
+ ActivityInterceptor.ɵfac = function ActivityInterceptor_Factory(t) { return new (t || ActivityInterceptor)(i0.ɵɵinject(ActivityService)); };
70
+ ActivityInterceptor.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ActivityInterceptor, factory: ActivityInterceptor.ɵfac });
71
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ActivityInterceptor, [{
72
+ type: Injectable
67
73
  }], function () { return [{ type: ActivityService }]; }, null); })();
68
74
 
69
- class IgoActivityModule {
70
- static forRoot() {
71
- return {
72
- ngModule: IgoActivityModule,
73
- providers: [
74
- {
75
- provide: HTTP_INTERCEPTORS,
76
- useClass: ActivityInterceptor,
77
- multi: true
78
- }
79
- ]
80
- };
81
- }
82
- }
83
- IgoActivityModule.ɵmod = ɵɵdefineNgModule({ type: IgoActivityModule });
84
- IgoActivityModule.ɵinj = ɵɵdefineInjector({ factory: function IgoActivityModule_Factory(t) { return new (t || IgoActivityModule)(); }, imports: [[]] });
85
- /*@__PURE__*/ (function () { ɵsetClassMetadata(IgoActivityModule, [{
86
- type: NgModule,
87
- args: [{
88
- imports: [],
89
- declarations: [],
90
- exports: []
91
- }]
75
+ class IgoActivityModule {
76
+ static forRoot() {
77
+ return {
78
+ ngModule: IgoActivityModule,
79
+ providers: [
80
+ {
81
+ provide: HTTP_INTERCEPTORS,
82
+ useClass: ActivityInterceptor,
83
+ multi: true
84
+ }
85
+ ]
86
+ };
87
+ }
88
+ }
89
+ IgoActivityModule.ɵfac = function IgoActivityModule_Factory(t) { return new (t || IgoActivityModule)(); };
90
+ IgoActivityModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: IgoActivityModule });
91
+ IgoActivityModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [[]] });
92
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoActivityModule, [{
93
+ type: NgModule,
94
+ args: [{
95
+ imports: [],
96
+ declarations: [],
97
+ exports: []
98
+ }]
92
99
  }], null, null); })();
93
100
 
94
- const version = {
95
- lib: '1.7.2',
96
- releaseDate: 1621276718436
101
+ const version = {
102
+ lib: '1.9.0',
103
+ releaseDate: 1632149524409
97
104
  };
98
105
 
99
- class ConfigService {
100
- constructor(injector) {
101
- this.injector = injector;
102
- this.config = {};
103
- }
104
- /**
105
- * Use to get the data found in config file
106
- */
107
- getConfig(key) {
108
- return ObjectUtils.resolve(this.config, key);
109
- }
110
- /**
111
- * This method loads "[path]" to get all config's variables
112
- */
113
- load(options) {
114
- const baseConfig = options.default || {};
115
- if (!options.path) {
116
- this.config = baseConfig;
117
- return true;
118
- }
119
- const http = this.injector.get(HttpClient);
120
- return new Promise((resolve, _reject) => {
121
- http
122
- .get(options.path)
123
- .pipe(catchError((error) => {
124
- console.log(`Configuration file ${options.path} could not be read`);
125
- resolve(true);
126
- return throwError(error.error || 'Server error');
127
- }))
128
- .subscribe((configResponse) => {
129
- this.config = ObjectUtils.mergeDeep(ObjectUtils.mergeDeep({ version }, baseConfig), configResponse);
130
- resolve(true);
131
- });
132
- });
133
- }
134
- }
135
- ConfigService.ɵfac = function ConfigService_Factory(t) { return new (t || ConfigService)(ɵɵinject(Injector)); };
136
- ConfigService.ɵprov = ɵɵdefineInjectable({ token: ConfigService, factory: ConfigService.ɵfac, providedIn: 'root' });
137
- /*@__PURE__*/ (function () { ɵsetClassMetadata(ConfigService, [{
138
- type: Injectable,
139
- args: [{
140
- providedIn: 'root'
141
- }]
142
- }], function () { return [{ type: Injector }]; }, null); })();
106
+ class ConfigService {
107
+ constructor(injector) {
108
+ this.injector = injector;
109
+ this.config = {};
110
+ }
111
+ /**
112
+ * Use to get the data found in config file
113
+ */
114
+ getConfig(key) {
115
+ return ObjectUtils.resolve(this.config, key);
116
+ }
117
+ /**
118
+ * This method loads "[path]" to get all config's variables
119
+ */
120
+ load(options) {
121
+ const baseConfig = options.default || {};
122
+ if (!options.path) {
123
+ this.config = baseConfig;
124
+ return true;
125
+ }
126
+ const http = this.injector.get(HttpClient);
127
+ return new Promise((resolve, _reject) => {
128
+ http
129
+ .get(options.path)
130
+ .pipe(catchError((error) => {
131
+ console.log(`Configuration file ${options.path} could not be read`);
132
+ resolve(true);
133
+ return throwError(error.error || 'Server error');
134
+ }))
135
+ .subscribe((configResponse) => {
136
+ this.config = ObjectUtils.mergeDeep(ObjectUtils.mergeDeep({ version }, baseConfig), configResponse);
137
+ resolve(true);
138
+ });
139
+ });
140
+ }
141
+ }
142
+ ConfigService.ɵfac = function ConfigService_Factory(t) { return new (t || ConfigService)(i0.ɵɵinject(i0.Injector)); };
143
+ ConfigService.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ConfigService, factory: ConfigService.ɵfac, providedIn: 'root' });
144
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ConfigService, [{
145
+ type: Injectable,
146
+ args: [{
147
+ providedIn: 'root'
148
+ }]
149
+ }], function () { return [{ type: i0.Injector }]; }, null); })();
143
150
 
144
- let CONFIG_OPTIONS = new InjectionToken('configOptions');
145
- function provideConfigOptions(options) {
146
- return {
147
- provide: CONFIG_OPTIONS,
148
- useValue: options
149
- };
150
- }
151
- function configFactory(configService, options) {
152
- return () => configService.load(options);
153
- }
154
- function provideConfigLoader() {
155
- return {
156
- provide: APP_INITIALIZER,
157
- useFactory: configFactory,
158
- multi: true,
159
- deps: [ConfigService, CONFIG_OPTIONS]
160
- };
151
+ let CONFIG_OPTIONS = new InjectionToken('configOptions');
152
+ function provideConfigOptions(options) {
153
+ return {
154
+ provide: CONFIG_OPTIONS,
155
+ useValue: options
156
+ };
157
+ }
158
+ function configFactory(configService, options) {
159
+ return () => configService.load(options);
160
+ }
161
+ function provideConfigLoader() {
162
+ return {
163
+ provide: APP_INITIALIZER,
164
+ useFactory: configFactory,
165
+ multi: true,
166
+ deps: [ConfigService, CONFIG_OPTIONS]
167
+ };
161
168
  }
162
169
 
163
- class IgoConfigModule {
164
- static forRoot() {
165
- return {
166
- ngModule: IgoConfigModule,
167
- providers: [provideConfigOptions({}), provideConfigLoader()]
168
- };
169
- }
170
- }
171
- IgoConfigModule.ɵmod = ɵɵdefineNgModule({ type: IgoConfigModule });
172
- IgoConfigModule.ɵinj = ɵɵdefineInjector({ factory: function IgoConfigModule_Factory(t) { return new (t || IgoConfigModule)(); }, imports: [[]] });
173
- /*@__PURE__*/ (function () { ɵsetClassMetadata(IgoConfigModule, [{
174
- type: NgModule,
175
- args: [{
176
- imports: [],
177
- declarations: [],
178
- exports: []
179
- }]
170
+ class IgoConfigModule {
171
+ static forRoot() {
172
+ return {
173
+ ngModule: IgoConfigModule,
174
+ providers: [provideConfigOptions({}), provideConfigLoader()]
175
+ };
176
+ }
177
+ }
178
+ IgoConfigModule.ɵfac = function IgoConfigModule_Factory(t) { return new (t || IgoConfigModule)(); };
179
+ IgoConfigModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: IgoConfigModule });
180
+ IgoConfigModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [[]] });
181
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoConfigModule, [{
182
+ type: NgModule,
183
+ args: [{
184
+ imports: [],
185
+ declarations: [],
186
+ exports: []
187
+ }]
180
188
  }], null, null); })();
181
189
 
182
- class LanguageLoader {
183
- constructor(http, prefix, suffix = '.json', config) {
184
- this.http = http;
185
- this.prefix = prefix;
186
- this.suffix = suffix;
187
- this.config = config;
188
- }
189
- getTranslation(lang) {
190
- const translation = require(`../locale/${lang}.json`);
191
- const igoLocale$ = of(translation);
192
- if (this.config && !this.prefix) {
193
- const prefix = this.config.getConfig('language.prefix');
194
- this.prefix = !prefix || Array.isArray(prefix) ? prefix : [prefix];
195
- }
196
- if (!this.prefix || this.prefix.length === 0) {
197
- return igoLocale$;
198
- }
199
- const appLocale$ = this.prefix.map((prefix) => this.http.get(`${prefix}${lang}${this.suffix}`));
200
- const locale$ = combineLatest([igoLocale$, ...appLocale$]);
201
- return locale$.pipe(map((translations) => {
202
- return translations.reduce((acc, current) => ObjectUtils.mergeDeep(acc, current), {});
203
- }));
204
- }
190
+ class LanguageLoader {
191
+ constructor(http, prefix, suffix = '.json', config) {
192
+ this.http = http;
193
+ this.prefix = prefix;
194
+ this.suffix = suffix;
195
+ this.config = config;
196
+ }
197
+ getTranslation(lang) {
198
+ const translation = require(`../locale/${lang}.json`);
199
+ const igoLocale$ = of(translation);
200
+ if (this.config && !this.prefix) {
201
+ const prefix = this.config.getConfig('language.prefix');
202
+ this.prefix = !prefix || Array.isArray(prefix) ? prefix : [prefix];
203
+ }
204
+ if (!this.prefix || this.prefix.length === 0) {
205
+ return igoLocale$;
206
+ }
207
+ const appLocale$ = this.prefix.map((prefix) => this.http.get(`${prefix}${lang}${this.suffix}`));
208
+ const locale$ = combineLatest([igoLocale$, ...appLocale$]);
209
+ return locale$.pipe(map((translations) => {
210
+ return translations.reduce((acc, current) => ObjectUtils.mergeDeep(acc, current), {});
211
+ }));
212
+ }
205
213
  }
206
214
 
207
- function defaultLanguageLoader(http, config) {
208
- return new LanguageLoader(http, undefined, undefined, config);
209
- }
210
- function provideLanguageLoader(loader) {
211
- return {
212
- provide: TranslateLoader,
213
- useFactory: loader || defaultLanguageLoader,
214
- deps: [HttpClient]
215
- };
216
- }
217
- function provideDefaultLanguageLoader(loader) {
218
- return {
219
- provide: TranslateLoader,
220
- useFactory: loader || defaultLanguageLoader,
221
- deps: [HttpClient, ConfigService]
222
- };
215
+ function defaultLanguageLoader(http, config) {
216
+ return new LanguageLoader(http, undefined, undefined, config);
217
+ }
218
+ function provideLanguageLoader(loader) {
219
+ return {
220
+ provide: TranslateLoader,
221
+ useFactory: loader || defaultLanguageLoader,
222
+ deps: [HttpClient]
223
+ };
224
+ }
225
+ function provideDefaultLanguageLoader(loader) {
226
+ return {
227
+ provide: TranslateLoader,
228
+ useFactory: loader || defaultLanguageLoader,
229
+ deps: [HttpClient, ConfigService]
230
+ };
223
231
  }
224
232
 
225
- class IgoMissingTranslationHandler {
226
- handle(params) {
227
- if (!params.translateService.langs.length) {
228
- const error = 'Translations are not yet loaded. \
229
- Check that the LanguageService is injected.';
230
- throw new Error(error);
231
- }
232
- if (params.key.substr(0, 4) === 'igo.') {
233
- throw new Error(`The Key "${params.key}" is missing in locale file.`);
234
- }
235
- else {
236
- return params.key;
237
- }
238
- }
233
+ class IgoMissingTranslationHandler {
234
+ handle(params) {
235
+ if (!params.translateService.langs.length) {
236
+ const error = 'Translations are not yet loaded. \
237
+ Check that the LanguageService is injected.';
238
+ throw new Error(error);
239
+ }
240
+ if (params.key.substr(0, 4) === 'igo.') {
241
+ throw new Error(`The Key "${params.key}" is missing in locale file.`);
242
+ }
243
+ else {
244
+ return params.key;
245
+ }
246
+ }
239
247
  }
240
248
 
241
- class IgoLanguageModule {
242
- static forRoot() {
243
- return {
244
- ngModule: IgoLanguageModule,
245
- providers: [provideDefaultLanguageLoader()]
246
- };
247
- }
248
- }
249
- IgoLanguageModule.ɵmod = ɵɵdefineNgModule({ type: IgoLanguageModule });
250
- IgoLanguageModule.ɵinj = ɵɵdefineInjector({ factory: function IgoLanguageModule_Factory(t) { return new (t || IgoLanguageModule)(); }, imports: [[
251
- TranslateModule.forRoot({
252
- missingTranslationHandler: {
253
- provide: MissingTranslationHandler,
254
- useClass: IgoMissingTranslationHandler
255
- }
256
- })
257
- ], TranslateModule] });
258
- (function () { (typeof ngJitMode === "undefined" || ngJitMode) && ɵɵsetNgModuleScope(IgoLanguageModule, { imports: [TranslateModule], exports: [TranslateModule] }); })();
259
- /*@__PURE__*/ (function () { ɵsetClassMetadata(IgoLanguageModule, [{
260
- type: NgModule,
261
- args: [{
262
- imports: [
263
- TranslateModule.forRoot({
264
- missingTranslationHandler: {
265
- provide: MissingTranslationHandler,
266
- useClass: IgoMissingTranslationHandler
267
- }
268
- })
269
- ],
270
- declarations: [],
271
- exports: [TranslateModule]
272
- }]
273
- }], null, null); })();
249
+ class IgoLanguageModule {
250
+ static forRoot() {
251
+ return {
252
+ ngModule: IgoLanguageModule,
253
+ providers: [provideDefaultLanguageLoader()]
254
+ };
255
+ }
256
+ }
257
+ IgoLanguageModule.ɵfac = function IgoLanguageModule_Factory(t) { return new (t || IgoLanguageModule)(); };
258
+ IgoLanguageModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: IgoLanguageModule });
259
+ IgoLanguageModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [[
260
+ TranslateModule.forRoot({
261
+ missingTranslationHandler: {
262
+ provide: MissingTranslationHandler,
263
+ useClass: IgoMissingTranslationHandler
264
+ }
265
+ })
266
+ ], TranslateModule] });
267
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoLanguageModule, [{
268
+ type: NgModule,
269
+ args: [{
270
+ imports: [
271
+ TranslateModule.forRoot({
272
+ missingTranslationHandler: {
273
+ provide: MissingTranslationHandler,
274
+ useClass: IgoMissingTranslationHandler
275
+ }
276
+ })
277
+ ],
278
+ declarations: [],
279
+ exports: [TranslateModule]
280
+ }]
281
+ }], null, null); })();
282
+ (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(IgoLanguageModule, { imports: [i1.TranslateModule], exports: [TranslateModule] }); })();
274
283
 
275
- const _c0 = function (a0) { return { closeIcon: a0 }; };
276
- class MessageCenterComponent {
277
- constructor() {
278
- this._options = {};
279
- }
280
- get options() {
281
- return Object.assign({}, MessageCenterComponent.defaultOptions, this._options);
282
- }
283
- set options(value) {
284
- this._options = value;
285
- }
286
- }
287
- MessageCenterComponent.defaultOptions = {
288
- timeOut: 5000,
289
- hasCloseIcon: false,
290
- showProgressBar: true,
291
- pauseOnHover: true,
292
- clickToClose: true,
293
- maxLength: 100,
294
- maxStack: 3,
295
- preventDuplicates: true
296
- };
297
- MessageCenterComponent.ɵfac = function MessageCenterComponent_Factory(t) { return new (t || MessageCenterComponent)(); };
298
- MessageCenterComponent.ɵcmp = ɵɵdefineComponent({ type: MessageCenterComponent, selectors: [["igo-message-center"]], inputs: { options: "options" }, decls: 1, vars: 4, consts: [[1, "mat-typography", 3, "ngClass", "options"]], template: function MessageCenterComponent_Template(rf, ctx) { if (rf & 1) {
299
- ɵɵelement(0, "simple-notifications", 0);
300
- } if (rf & 2) {
301
- ɵɵproperty("ngClass", ɵɵpureFunction1(2, _c0, ctx.options.hasCloseIcon))("options", ctx.options);
302
- } }, directives: [SimpleNotificationsComponent, NgClass], styles: ["@charset \"UTF-8\";[_nghost-%COMP%] div.simple-notification-wrapper{bottom:0;right:calc(50% - 150px)}@media only screen and (orientation:landscape) and (max-width:959px),only screen and (orientation:portrait) and (max-width:599px){[_nghost-%COMP%] div.simple-notification-wrapper{left:0;right:0;width:100%}}[_nghost-%COMP%] div.simple-notification{margin-bottom:5px;min-height:50px;padding-left:45px;padding-right:25px}[_nghost-%COMP%] div.simple-notification.noIcon{padding-left:25px}@media only screen and (orientation:landscape) and (max-width:959px),only screen and (orientation:portrait) and (max-width:599px){[_nghost-%COMP%] div.simple-notification{margin-bottom:0}}[_nghost-%COMP%] div.simple-notification .sn-title{font-size:15px;font-weight:700;line-height:23px}[_nghost-%COMP%] div.simple-notification .sn-content{font-size:15px;line-height:18px}[_nghost-%COMP%] div.simple-notification .icon{height:100%;left:0;padding:7px;top:0;width:45px}[_nghost-%COMP%] div.simple-notification .icon\u00A0 mat-icon{align-items:center;display:flex;font-size:32px;height:100%}[_nghost-%COMP%] .closeIcon .sn-title:after{content:\"close\";font-family:Material Icons;font-feature-settings:\"liga\" 1;font-size:24px;font-weight:400;position:absolute;right:5px;top:5px}"] });
303
- /*@__PURE__*/ (function () { ɵsetClassMetadata(MessageCenterComponent, [{
304
- type: Component,
305
- args: [{
306
- selector: 'igo-message-center',
307
- templateUrl: './message-center.component.html',
308
- styleUrls: ['./message-center.component.scss']
309
- }]
310
- }], function () { return []; }, { options: [{
311
- type: Input
284
+ const _c0 = function (a0) { return { closeIcon: a0 }; };
285
+ class MessageCenterComponent {
286
+ constructor() {
287
+ this._options = {};
288
+ }
289
+ get options() {
290
+ return Object.assign({}, MessageCenterComponent.defaultOptions, this._options);
291
+ }
292
+ set options(value) {
293
+ this._options = value;
294
+ }
295
+ }
296
+ MessageCenterComponent.defaultOptions = {
297
+ timeOut: 5000,
298
+ hasCloseIcon: false,
299
+ showProgressBar: true,
300
+ pauseOnHover: true,
301
+ clickToClose: true,
302
+ maxLength: 100,
303
+ maxStack: 3,
304
+ preventDuplicates: true
305
+ };
306
+ MessageCenterComponent.ɵfac = function MessageCenterComponent_Factory(t) { return new (t || MessageCenterComponent)(); };
307
+ MessageCenterComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: MessageCenterComponent, selectors: [["igo-message-center"]], inputs: { options: "options" }, decls: 1, vars: 4, consts: [[1, "mat-typography", 3, "ngClass", "options"]], template: function MessageCenterComponent_Template(rf, ctx) { if (rf & 1) {
308
+ i0.ɵɵelement(0, "simple-notifications", 0);
309
+ } if (rf & 2) {
310
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(2, _c0, ctx.options.hasCloseIcon))("options", ctx.options);
311
+ } }, directives: [i1$1.SimpleNotificationsComponent, i2.NgClass], styles: ["[_nghost-%COMP%] div.simple-notification-wrapper{bottom:0;right:calc(50% - 150px)}@media only screen and (orientation:portrait) and (max-width: 599px),only screen and (orientation:landscape) and (max-width: 959px){[_nghost-%COMP%] div.simple-notification-wrapper{right:0;left:0;width:100%}}[_nghost-%COMP%] .closeIcon .sn-title:after{content:\"close\";font-family:\"Material Icons\";font-feature-settings:\"liga\" 1;font-size:24px;font-weight:normal;right:5px;top:5px;position:absolute}[_nghost-%COMP%] .simple-notification .icon{top:0;left:0;width:45px;height:45px;height:100%;padding:7px}[_nghost-%COMP%] .simple-notification .icon mat-icon{display:flex;align-items:center;height:100%;font-size:32px}[_nghost-%COMP%] div.simple-notification{min-height:50px;margin-bottom:5px;padding-left:45px;padding-right:25px}[_nghost-%COMP%] div.simple-notification.noIcon{padding-left:25px}@media only screen and (orientation:portrait) and (max-width: 599px),only screen and (orientation:landscape) and (max-width: 959px){[_nghost-%COMP%] div.simple-notification{margin-bottom:0}}[_nghost-%COMP%] div.simple-notification .sn-title{line-height:23px;font-size:15px;font-weight:bold}[_nghost-%COMP%] div.simple-notification .sn-content{line-height:18px;font-size:15px}"] });
312
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MessageCenterComponent, [{
313
+ type: Component,
314
+ args: [{
315
+ selector: 'igo-message-center',
316
+ templateUrl: './message-center.component.html',
317
+ styleUrls: ['./message-center.component.scss']
318
+ }]
319
+ }], function () { return []; }, { options: [{
320
+ type: Input
312
321
  }] }); })();
313
322
 
314
- class IgoMessageModule {
315
- static forRoot() {
316
- return {
317
- ngModule: IgoMessageModule,
318
- providers: []
319
- };
320
- }
321
- }
322
- IgoMessageModule.ɵmod = ɵɵdefineNgModule({ type: IgoMessageModule });
323
- IgoMessageModule.ɵinj = ɵɵdefineInjector({ factory: function IgoMessageModule_Factory(t) { return new (t || IgoMessageModule)(); }, imports: [[CommonModule, SimpleNotificationsModule.forRoot()]] });
324
- (function () { (typeof ngJitMode === "undefined" || ngJitMode) && ɵɵsetNgModuleScope(IgoMessageModule, { declarations: [MessageCenterComponent], imports: [CommonModule, SimpleNotificationsModule], exports: [MessageCenterComponent] }); })();
325
- /*@__PURE__*/ (function () { ɵsetClassMetadata(IgoMessageModule, [{
326
- type: NgModule,
327
- args: [{
328
- imports: [CommonModule, SimpleNotificationsModule.forRoot()],
329
- declarations: [MessageCenterComponent],
330
- exports: [MessageCenterComponent]
331
- }]
332
- }], null, null); })();
323
+ class IgoMessageModule {
324
+ static forRoot() {
325
+ return {
326
+ ngModule: IgoMessageModule,
327
+ providers: []
328
+ };
329
+ }
330
+ }
331
+ IgoMessageModule.ɵfac = function IgoMessageModule_Factory(t) { return new (t || IgoMessageModule)(); };
332
+ IgoMessageModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: IgoMessageModule });
333
+ IgoMessageModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [[CommonModule, SimpleNotificationsModule.forRoot()]] });
334
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoMessageModule, [{
335
+ type: NgModule,
336
+ args: [{
337
+ imports: [CommonModule, SimpleNotificationsModule.forRoot()],
338
+ declarations: [MessageCenterComponent],
339
+ exports: [MessageCenterComponent]
340
+ }]
341
+ }], null, null); })();
342
+ (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(IgoMessageModule, { declarations: [MessageCenterComponent], imports: [CommonModule, i1$1.SimpleNotificationsModule], exports: [MessageCenterComponent] }); })();
333
343
 
334
- var MessageType;
335
- (function (MessageType) {
336
- MessageType["ERROR"] = "error";
337
- MessageType["ALERT"] = "alert";
338
- MessageType["INFO"] = "info";
339
- MessageType["SUCCESS"] = "success";
344
+ class LanguageService {
345
+ constructor(translate) {
346
+ this.translate = translate;
347
+ this.language = this.translate.getBrowserLang();
348
+ const lang = this.getLanguage();
349
+ this.translate.setDefaultLang(lang);
350
+ }
351
+ getLanguage() {
352
+ return this.language.match(/en|fr/) ? this.language : 'en';
353
+ }
354
+ setLanguage(language) {
355
+ this.language = language.match(/en|fr/) ? language : 'en';
356
+ this.translate.use(this.language);
357
+ this.translate.reloadLang(this.language);
358
+ }
359
+ }
360
+ LanguageService.ɵfac = function LanguageService_Factory(t) { return new (t || LanguageService)(i0.ɵɵinject(i1.TranslateService)); };
361
+ LanguageService.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: LanguageService, factory: LanguageService.ɵfac, providedIn: 'root' });
362
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LanguageService, [{
363
+ type: Injectable,
364
+ args: [{
365
+ providedIn: 'root'
366
+ }]
367
+ }], function () { return [{ type: i1.TranslateService }]; }, null); })();
368
+
369
+ var MessageType;
370
+ (function (MessageType) {
371
+ MessageType["ERROR"] = "error";
372
+ MessageType["ALERT"] = "alert";
373
+ MessageType["INFO"] = "info";
374
+ MessageType["SUCCESS"] = "success";
340
375
  })(MessageType || (MessageType = {}));
341
376
 
342
- class MessageService {
343
- constructor(notificationService, configService) {
344
- this.notificationService = notificationService;
345
- this.configService = configService;
346
- this.messages$ = new BehaviorSubject([]);
347
- this.options = this.configService.getConfig('message') || {};
348
- }
349
- showError(httpError) {
350
- httpError.error.caught = true;
351
- return this.error(httpError.error.message, httpError.error.title);
352
- }
353
- message(message) {
354
- this.messages$.next(this.messages$.value.concat([message]));
355
- message.options = message.options || {};
356
- const currentDate = new Date();
357
- message.options.from = message.options.from ? message.options.from : new Date('1 jan 1900');
358
- message.options.to = message.options.to ? message.options.to : new Date('1 jan 3000');
359
- if (typeof message.options.from === 'string') {
360
- message.options.from = new Date(Date.parse(message.options.from.replace(/-/g, ' ')));
361
- }
362
- if (typeof message.options.to === 'string') {
363
- message.options.to = new Date(Date.parse(message.options.to.replace(/-/g, ' ')));
364
- }
365
- if (currentDate > message.options.from && currentDate < message.options.to) {
366
- message = this.handleTemplate(message);
367
- let notification;
368
- if (message.text) {
369
- notification = this.notificationService.create(message.title, message.text, message.type, message.options);
370
- }
371
- else if (message.html) {
372
- if (!message.icon) {
373
- message.options.theClass = message.options.theClass
374
- ? message.options.theClass + ' noIcon'
375
- : 'noIcon';
376
- }
377
- notification = this.notificationService.html(message.html, message.type, message.options);
378
- }
379
- else {
380
- return;
381
- }
382
- if (message.icon !== undefined) {
383
- this.addIcon(notification, message.icon);
384
- }
385
- return notification;
386
- }
387
- return;
388
- }
389
- success(text, title, options = {}) {
390
- return this.message({
391
- text,
392
- title,
393
- icon: options.icon || 'check',
394
- options,
395
- type: MessageType.SUCCESS
396
- });
397
- }
398
- error(text, title, options = {}) {
399
- return this.message({
400
- text,
401
- title,
402
- icon: options.icon || 'error_outline',
403
- options,
404
- type: MessageType.ERROR
405
- });
406
- }
407
- info(text, title, options = {}) {
408
- return this.message({
409
- text,
410
- title,
411
- icon: options.icon || 'info_outline',
412
- options,
413
- type: MessageType.INFO
414
- });
415
- }
416
- alert(text, title, options = {}) {
417
- return this.message({
418
- text,
419
- title,
420
- icon: options.icon || 'access_alarm',
421
- options,
422
- type: MessageType.ALERT
423
- });
424
- }
425
- remove(id) {
426
- this.notificationService.remove(id);
427
- }
428
- addIcon(notification, icon) {
429
- // There is no way to add an icon to a notification when reating
430
- // it so we simply set it on the notification directly.
431
- // See https://github.com/flauc/angular2-notifications/issues/165
377
+ class MessageService {
378
+ constructor(notificationService, configService) {
379
+ this.notificationService = notificationService;
380
+ this.configService = configService;
381
+ this.messages$ = new BehaviorSubject([]);
382
+ this.options = this.configService.getConfig('message') || {};
383
+ }
384
+ showError(httpError) {
385
+ httpError.error.caught = true;
386
+ return this.error(httpError.error.message, httpError.error.title);
387
+ }
388
+ message(message) {
389
+ this.messages$.next(this.messages$.value.concat([message]));
390
+ message.options = message.options || {};
391
+ const currentDate = new Date();
392
+ message.options.from = message.options.from ? message.options.from : new Date('1 jan 1900');
393
+ message.options.to = message.options.to ? message.options.to : new Date('1 jan 3000');
394
+ if (typeof message.options.from === 'string') {
395
+ message.options.from = new Date(Date.parse(message.options.from.replace(/-/g, ' ')));
396
+ }
397
+ if (typeof message.options.to === 'string') {
398
+ message.options.to = new Date(Date.parse(message.options.to.replace(/-/g, ' ')));
399
+ }
400
+ if (currentDate > message.options.from && currentDate < message.options.to) {
401
+ message = this.handleTemplate(message);
402
+ let notification;
403
+ if (message.text) {
404
+ notification = this.notificationService.create(message.title, message.text, message.type, message.options);
405
+ }
406
+ else if (message.html) {
407
+ if (!message.icon) {
408
+ message.options.theClass = message.options.theClass
409
+ ? message.options.theClass + ' noIcon'
410
+ : 'noIcon';
411
+ }
412
+ notification = this.notificationService.html(message.html, message.type, message.options);
413
+ }
414
+ else {
415
+ return;
416
+ }
417
+ if (message.icon !== undefined) {
418
+ this.addIcon(notification, message.icon);
419
+ }
420
+ message.options.id = notification.id;
421
+ return notification;
422
+ }
423
+ return;
424
+ }
425
+ success(text, title, options = {}) {
426
+ return this.message({
427
+ text,
428
+ title,
429
+ icon: options.icon || 'check',
430
+ options,
431
+ type: MessageType.SUCCESS
432
+ });
433
+ }
434
+ error(text, title, options = {}) {
435
+ return this.message({
436
+ text,
437
+ title,
438
+ icon: options.icon || 'error_outline',
439
+ options,
440
+ type: MessageType.ERROR
441
+ });
442
+ }
443
+ info(text, title, options = {}) {
444
+ return this.message({
445
+ text,
446
+ title,
447
+ icon: options.icon || 'info_outline',
448
+ options,
449
+ type: MessageType.INFO
450
+ });
451
+ }
452
+ alert(text, title, options = {}) {
453
+ return this.message({
454
+ text,
455
+ title,
456
+ icon: options.icon || 'access_alarm',
457
+ options,
458
+ type: MessageType.ALERT
459
+ });
460
+ }
461
+ remove(id) {
462
+ this.notificationService.remove(id);
463
+ }
464
+ removeAllAreNotError() {
465
+ for (const mess of this.messages$.value) {
466
+ if (mess.type !== 'error') {
467
+ this.remove(mess.options.id);
468
+ }
469
+ }
470
+ }
471
+ addIcon(notification, icon) {
472
+ // There is no way to add an icon to a notification when reating
473
+ // it so we simply set it on the notification directly.
474
+ // See https://github.com/flauc/angular2-notifications/issues/165
432
475
  notification.icon = `
433
476
  <mat-icon class="material-icons mat-icon mat-list-avatar" svgIcon="${icon}">
434
- </mat-icon>`;
435
- }
436
- handleTemplate(message) {
437
- if (!this.options.template || message.html) {
438
- return message;
439
- }
440
- let html = this.options.template;
441
- html = html.replace('${text}', message.text);
442
- html = html.replace('${title}', message.title);
443
- html = html.replace('${icon}', message.icon);
444
- message.html = html;
445
- message.text = undefined;
446
- message.title = undefined;
447
- message.icon = undefined;
448
- return message;
449
- }
450
- }
451
- MessageService.ɵfac = function MessageService_Factory(t) { return new (t || MessageService)(ɵɵinject(NotificationsService), ɵɵinject(ConfigService)); };
452
- MessageService.ɵprov = ɵɵdefineInjectable({ token: MessageService, factory: MessageService.ɵfac, providedIn: 'root' });
453
- /*@__PURE__*/ (function () { ɵsetClassMetadata(MessageService, [{
454
- type: Injectable,
455
- args: [{
456
- providedIn: 'root'
457
- }]
458
- }], function () { return [{ type: NotificationsService }, { type: ConfigService }]; }, null); })();
477
+ </mat-icon>`;
478
+ }
479
+ handleTemplate(message) {
480
+ if (!this.options.template || message.html) {
481
+ return message;
482
+ }
483
+ let html = this.options.template;
484
+ html = html.replace('${text}', message.text);
485
+ html = html.replace('${title}', message.title);
486
+ html = html.replace('${icon}', message.icon);
487
+ message.html = html;
488
+ message.text = undefined;
489
+ message.title = undefined;
490
+ message.icon = undefined;
491
+ return message;
492
+ }
493
+ }
494
+ MessageService.ɵfac = function MessageService_Factory(t) { return new (t || MessageService)(i0.ɵɵinject(i1$1.NotificationsService), i0.ɵɵinject(ConfigService)); };
495
+ MessageService.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: MessageService, factory: MessageService.ɵfac, providedIn: 'root' });
496
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MessageService, [{
497
+ type: Injectable,
498
+ args: [{
499
+ providedIn: 'root'
500
+ }]
501
+ }], function () { return [{ type: i1$1.NotificationsService }, { type: ConfigService }]; }, null); })();
459
502
 
460
- class LanguageService {
461
- constructor(translate) {
462
- this.translate = translate;
463
- this.language = this.translate.getBrowserLang();
464
- const lang = this.getLanguage();
465
- this.translate.setDefaultLang(lang);
466
- }
467
- getLanguage() {
468
- return this.language.match(/en|fr/) ? this.language : 'en';
469
- }
470
- setLanguage(language) {
471
- this.language = language.match(/en|fr/) ? language : 'en';
472
- this.translate.use(this.language);
473
- this.translate.reloadLang(this.language);
474
- }
475
- }
476
- LanguageService.ɵfac = function LanguageService_Factory(t) { return new (t || LanguageService)(ɵɵinject(TranslateService)); };
477
- LanguageService.ɵprov = ɵɵdefineInjectable({ token: LanguageService, factory: LanguageService.ɵfac, providedIn: 'root' });
478
- /*@__PURE__*/ (function () { ɵsetClassMetadata(LanguageService, [{
479
- type: Injectable,
480
- args: [{
481
- providedIn: 'root'
482
- }]
483
- }], function () { return [{ type: TranslateService }]; }, null); })();
484
-
485
- class ErrorInterceptor {
486
- constructor(messageService, injector) {
487
- this.messageService = messageService;
488
- this.injector = injector;
489
- }
490
- intercept(req, next) {
491
- const errorContainer = { httpError: undefined };
492
- return next.handle(req).pipe(catchError(error => this.handleError(error, errorContainer)), finalize(() => {
493
- this.handleCaughtError(errorContainer);
494
- this.handleUncaughtError(errorContainer);
495
- }));
496
- }
497
- handleError(httpError, errorContainer) {
498
- if (httpError instanceof HttpErrorResponse) {
499
- const errorObj = httpError.error === 'object' ? httpError.error : {};
500
- errorObj.message = httpError.error.message || httpError.statusText;
501
- errorObj.caught = false;
502
- httpError = new HttpErrorResponse({
503
- error: errorObj,
504
- headers: httpError.headers,
505
- status: httpError.status,
506
- statusText: httpError.statusText,
507
- url: httpError.url
508
- });
509
- }
510
- errorContainer.httpError = httpError;
511
- return throwError(httpError);
512
- }
513
- handleCaughtError(errorContainer) {
514
- const httpError = errorContainer.httpError;
515
- if (httpError && httpError.error.toDisplay) {
516
- httpError.error.caught = true;
517
- this.messageService.error(httpError.error.message, httpError.error.title);
518
- }
519
- }
520
- handleUncaughtError(errorContainer) {
521
- const httpError = errorContainer.httpError;
522
- if (httpError && !httpError.error.caught) {
523
- const translate = this.injector.get(LanguageService).translate;
524
- const message = translate.instant('igo.core.errors.uncaught.message');
525
- const title = translate.instant('igo.core.errors.uncaught.title');
526
- httpError.error.caught = true;
527
- this.messageService.error(message, title);
528
- }
529
- }
530
- }
531
- ErrorInterceptor.ɵfac = function ErrorInterceptor_Factory(t) { return new (t || ErrorInterceptor)(ɵɵinject(MessageService), ɵɵinject(Injector)); };
532
- ErrorInterceptor.ɵprov = ɵɵdefineInjectable({ token: ErrorInterceptor, factory: ErrorInterceptor.ɵfac, providedIn: 'root' });
533
- /*@__PURE__*/ (function () { ɵsetClassMetadata(ErrorInterceptor, [{
534
- type: Injectable,
535
- args: [{
536
- providedIn: 'root'
537
- }]
538
- }], function () { return [{ type: MessageService }, { type: Injector }]; }, null); })();
503
+ class ErrorInterceptor {
504
+ constructor(messageService, injector) {
505
+ this.messageService = messageService;
506
+ this.injector = injector;
507
+ }
508
+ intercept(req, next) {
509
+ const errorContainer = { httpError: undefined };
510
+ return next.handle(req).pipe(catchError(error => this.handleError(error, errorContainer)), finalize(() => {
511
+ this.handleCaughtError(errorContainer);
512
+ this.handleUncaughtError(errorContainer);
513
+ }));
514
+ }
515
+ handleError(httpError, errorContainer) {
516
+ if (httpError instanceof HttpErrorResponse) {
517
+ const errorObj = httpError.error === 'object' ? httpError.error : {};
518
+ errorObj.message = httpError.error.message || httpError.statusText;
519
+ errorObj.caught = false;
520
+ httpError = new HttpErrorResponse({
521
+ error: errorObj,
522
+ headers: httpError.headers,
523
+ status: httpError.status,
524
+ statusText: httpError.statusText,
525
+ url: httpError.url
526
+ });
527
+ }
528
+ errorContainer.httpError = httpError;
529
+ return throwError(httpError);
530
+ }
531
+ handleCaughtError(errorContainer) {
532
+ const httpError = errorContainer.httpError;
533
+ if (httpError && httpError.error.toDisplay) {
534
+ httpError.error.caught = true;
535
+ this.messageService.error(httpError.error.message, httpError.error.title);
536
+ }
537
+ }
538
+ handleUncaughtError(errorContainer) {
539
+ const httpError = errorContainer.httpError;
540
+ if (httpError && !httpError.error.caught) {
541
+ const translate = this.injector.get(LanguageService).translate;
542
+ const message = translate.instant('igo.core.errors.uncaught.message');
543
+ const title = translate.instant('igo.core.errors.uncaught.title');
544
+ httpError.error.caught = true;
545
+ this.messageService.error(message, title);
546
+ }
547
+ }
548
+ }
549
+ ErrorInterceptor.ɵfac = function ErrorInterceptor_Factory(t) { return new (t || ErrorInterceptor)(i0.ɵɵinject(MessageService), i0.ɵɵinject(i0.Injector)); };
550
+ ErrorInterceptor.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ErrorInterceptor, factory: ErrorInterceptor.ɵfac, providedIn: 'root' });
551
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ErrorInterceptor, [{
552
+ type: Injectable,
553
+ args: [{
554
+ providedIn: 'root'
555
+ }]
556
+ }], function () { return [{ type: MessageService }, { type: i0.Injector }]; }, null); })();
539
557
 
540
- class IgoErrorModule {
541
- constructor(parentModule) {
542
- if (parentModule) {
543
- throw new Error('IgoErrorModule is already loaded. Import it in the AppModule only');
544
- }
545
- }
546
- static forRoot() {
547
- return {
548
- ngModule: IgoErrorModule,
549
- providers: [
550
- {
551
- provide: HTTP_INTERCEPTORS,
552
- useClass: ErrorInterceptor,
553
- multi: true
554
- }
555
- ]
556
- };
557
- }
558
- }
559
- IgoErrorModule.ɵmod = ɵɵdefineNgModule({ type: IgoErrorModule });
560
- IgoErrorModule.ɵinj = ɵɵdefineInjector({ factory: function IgoErrorModule_Factory(t) { return new (t || IgoErrorModule)(ɵɵinject(IgoErrorModule, 12)); }, imports: [[]] });
561
- /*@__PURE__*/ (function () { ɵsetClassMetadata(IgoErrorModule, [{
562
- type: NgModule,
563
- args: [{
564
- imports: [],
565
- declarations: [],
566
- exports: []
567
- }]
568
- }], function () { return [{ type: IgoErrorModule, decorators: [{
569
- type: Optional
570
- }, {
571
- type: SkipSelf
558
+ class IgoErrorModule {
559
+ constructor(parentModule) {
560
+ if (parentModule) {
561
+ throw new Error('IgoErrorModule is already loaded. Import it in the AppModule only');
562
+ }
563
+ }
564
+ static forRoot() {
565
+ return {
566
+ ngModule: IgoErrorModule,
567
+ providers: [
568
+ {
569
+ provide: HTTP_INTERCEPTORS,
570
+ useClass: ErrorInterceptor,
571
+ multi: true
572
+ }
573
+ ]
574
+ };
575
+ }
576
+ }
577
+ IgoErrorModule.ɵfac = function IgoErrorModule_Factory(t) { return new (t || IgoErrorModule)(i0.ɵɵinject(IgoErrorModule, 12)); };
578
+ IgoErrorModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: IgoErrorModule });
579
+ IgoErrorModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [[]] });
580
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoErrorModule, [{
581
+ type: NgModule,
582
+ args: [{
583
+ imports: [],
584
+ declarations: [],
585
+ exports: []
586
+ }]
587
+ }], function () { return [{ type: IgoErrorModule, decorators: [{
588
+ type: Optional
589
+ }, {
590
+ type: SkipSelf
572
591
  }] }]; }, null); })();
573
592
 
574
- class IgoCoreModule {
575
- constructor(matIconRegistry, domSanitizer) {
576
- matIconRegistry.addSvgIconSet(domSanitizer.bypassSecurityTrustResourceUrl('./assets/igo2/core/icons/mdi.svg'));
577
- }
578
- static forRoot() {
579
- return {
580
- ngModule: IgoCoreModule,
581
- providers: []
582
- };
583
- }
584
- }
585
- IgoCoreModule.ɵmod = ɵɵdefineNgModule({ type: IgoCoreModule });
586
- IgoCoreModule.ɵinj = ɵɵdefineInjector({ factory: function IgoCoreModule_Factory(t) { return new (t || IgoCoreModule)(ɵɵinject(MatIconRegistry), ɵɵinject(DomSanitizer)); }, imports: [[
587
- CommonModule,
588
- HttpClientModule,
589
- IgoActivityModule.forRoot(),
590
- IgoConfigModule.forRoot(),
591
- IgoErrorModule.forRoot(),
592
- IgoLanguageModule.forRoot(),
593
- IgoMessageModule.forRoot()
594
- ], IgoActivityModule,
595
- IgoConfigModule,
596
- IgoErrorModule,
597
- IgoLanguageModule,
598
- IgoMessageModule] });
599
- (function () { (typeof ngJitMode === "undefined" || ngJitMode) && ɵɵsetNgModuleScope(IgoCoreModule, { imports: [CommonModule,
600
- HttpClientModule, IgoActivityModule, IgoConfigModule, IgoErrorModule, IgoLanguageModule, IgoMessageModule], exports: [IgoActivityModule,
601
- IgoConfigModule,
602
- IgoErrorModule,
603
- IgoLanguageModule,
593
+ class IgoCoreModule {
594
+ constructor(matIconRegistry, domSanitizer) {
595
+ matIconRegistry.addSvgIconSet(domSanitizer.bypassSecurityTrustResourceUrl('./assets/igo2/core/icons/mdi.svg'));
596
+ }
597
+ static forRoot() {
598
+ return {
599
+ ngModule: IgoCoreModule,
600
+ providers: []
601
+ };
602
+ }
603
+ }
604
+ IgoCoreModule.ɵfac = function IgoCoreModule_Factory(t) { return new (t || IgoCoreModule)(i0.ɵɵinject(i1$2.MatIconRegistry), i0.ɵɵinject(i2$1.DomSanitizer)); };
605
+ IgoCoreModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: IgoCoreModule });
606
+ IgoCoreModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [[
607
+ CommonModule,
608
+ HttpClientModule,
609
+ IgoActivityModule.forRoot(),
610
+ IgoConfigModule.forRoot(),
611
+ IgoErrorModule.forRoot(),
612
+ IgoLanguageModule.forRoot(),
613
+ IgoMessageModule.forRoot()
614
+ ], IgoActivityModule,
615
+ IgoConfigModule,
616
+ IgoErrorModule,
617
+ IgoLanguageModule,
618
+ IgoMessageModule] });
619
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoCoreModule, [{
620
+ type: NgModule,
621
+ args: [{
622
+ imports: [
623
+ CommonModule,
624
+ HttpClientModule,
625
+ IgoActivityModule.forRoot(),
626
+ IgoConfigModule.forRoot(),
627
+ IgoErrorModule.forRoot(),
628
+ IgoLanguageModule.forRoot(),
629
+ IgoMessageModule.forRoot()
630
+ ],
631
+ declarations: [],
632
+ exports: [
633
+ IgoActivityModule,
634
+ IgoConfigModule,
635
+ IgoErrorModule,
636
+ IgoLanguageModule,
637
+ IgoMessageModule
638
+ ]
639
+ }]
640
+ }], function () { return [{ type: i1$2.MatIconRegistry }, { type: i2$1.DomSanitizer }]; }, null); })();
641
+ (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(IgoCoreModule, { imports: [CommonModule,
642
+ HttpClientModule, IgoActivityModule, IgoConfigModule, IgoErrorModule, IgoLanguageModule, IgoMessageModule], exports: [IgoActivityModule,
643
+ IgoConfigModule,
644
+ IgoErrorModule,
645
+ IgoLanguageModule,
604
646
  IgoMessageModule] }); })();
605
- /*@__PURE__*/ (function () { ɵsetClassMetadata(IgoCoreModule, [{
606
- type: NgModule,
607
- args: [{
608
- imports: [
609
- CommonModule,
610
- HttpClientModule,
611
- IgoActivityModule.forRoot(),
612
- IgoConfigModule.forRoot(),
613
- IgoErrorModule.forRoot(),
614
- IgoLanguageModule.forRoot(),
615
- IgoMessageModule.forRoot()
616
- ],
617
- declarations: [],
618
- exports: [
619
- IgoActivityModule,
620
- IgoConfigModule,
621
- IgoErrorModule,
622
- IgoLanguageModule,
623
- IgoMessageModule
624
- ]
625
- }]
626
- }], function () { return [{ type: MatIconRegistry }, { type: DomSanitizer }]; }, null); })();
627
647
 
628
- class IgoGestureConfig extends HammerGestureConfig {
629
- buildHammer(element) {
630
- const mc = super.buildHammer(element);
631
- mc.set({ touchAction: 'pan-y' });
632
- return mc;
633
- }
634
- }
635
- IgoGestureConfig.ɵfac = function IgoGestureConfig_Factory(t) { return ɵIgoGestureConfig_BaseFactory(t || IgoGestureConfig); };
636
- IgoGestureConfig.ɵprov = ɵɵdefineInjectable({ token: IgoGestureConfig, factory: IgoGestureConfig.ɵfac });
637
- const ɵIgoGestureConfig_BaseFactory = /*@__PURE__*/ ɵɵgetInheritedFactory(IgoGestureConfig);
638
- /*@__PURE__*/ (function () { ɵsetClassMetadata(IgoGestureConfig, [{
639
- type: Injectable
648
+ class IgoGestureConfig extends HammerGestureConfig {
649
+ buildHammer(element) {
650
+ const mc = super.buildHammer(element);
651
+ mc.set({ touchAction: 'pan-y' });
652
+ return mc;
653
+ }
654
+ }
655
+ IgoGestureConfig.ɵfac = /*@__PURE__*/ function () { let ɵIgoGestureConfig_BaseFactory; return function IgoGestureConfig_Factory(t) { return (ɵIgoGestureConfig_BaseFactory || (ɵIgoGestureConfig_BaseFactory = i0.ɵɵgetInheritedFactory(IgoGestureConfig)))(t || IgoGestureConfig); }; }();
656
+ IgoGestureConfig.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: IgoGestureConfig, factory: IgoGestureConfig.ɵfac });
657
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoGestureConfig, [{
658
+ type: Injectable
640
659
  }], null, null); })();
641
660
 
642
- class IgoGestureModule {
643
- static forRoot() {
644
- return {
645
- ngModule: IgoGestureModule,
646
- providers: [
647
- {
648
- provide: HAMMER_GESTURE_CONFIG,
649
- useClass: IgoGestureConfig
650
- }
651
- ]
652
- };
653
- }
654
- }
655
- IgoGestureModule.ɵmod = ɵɵdefineNgModule({ type: IgoGestureModule });
656
- IgoGestureModule.ɵinj = ɵɵdefineInjector({ factory: function IgoGestureModule_Factory(t) { return new (t || IgoGestureModule)(); }, imports: [[HammerModule]] });
657
- (function () { (typeof ngJitMode === "undefined" || ngJitMode) && ɵɵsetNgModuleScope(IgoGestureModule, { imports: [HammerModule] }); })();
658
- /*@__PURE__*/ (function () { ɵsetClassMetadata(IgoGestureModule, [{
659
- type: NgModule,
660
- args: [{
661
- imports: [HammerModule],
662
- declarations: [],
663
- exports: []
664
- }]
665
- }], null, null); })();
661
+ class IgoGestureModule {
662
+ static forRoot() {
663
+ return {
664
+ ngModule: IgoGestureModule,
665
+ providers: [
666
+ {
667
+ provide: HAMMER_GESTURE_CONFIG,
668
+ useClass: IgoGestureConfig
669
+ }
670
+ ]
671
+ };
672
+ }
673
+ }
674
+ IgoGestureModule.ɵfac = function IgoGestureModule_Factory(t) { return new (t || IgoGestureModule)(); };
675
+ IgoGestureModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: IgoGestureModule });
676
+ IgoGestureModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [[HammerModule]] });
677
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoGestureModule, [{
678
+ type: NgModule,
679
+ args: [{
680
+ imports: [HammerModule],
681
+ declarations: [],
682
+ exports: []
683
+ }]
684
+ }], null, null); })();
685
+ (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(IgoGestureModule, { imports: [HammerModule] }); })();
666
686
 
667
- class LoggingInterceptor {
668
- intercept(req, next) {
669
- const started = Date.now();
670
- let ok;
671
- // extend server response observable with logging
672
- return next.handle(req).pipe(tap(
673
- // Succeeds when there is a response; ignore other events
674
- event => (ok = event instanceof HttpResponse ? 'succeeded' : ''),
675
- // Operation failed; error is an HttpErrorResponse
676
- error => (ok = 'failed')),
677
- // Log when response observable either completes or errors
678
- finalize(() => {
679
- const elapsed = Date.now() - started;
680
- const msg = `${req.method} "${req.urlWithParams}"
681
- ${ok} in ${elapsed} ms.`;
682
- console.log(msg);
683
- }));
684
- }
685
- }
686
- LoggingInterceptor.ɵfac = function LoggingInterceptor_Factory(t) { return new (t || LoggingInterceptor)(); };
687
- LoggingInterceptor.ɵprov = ɵɵdefineInjectable({ token: LoggingInterceptor, factory: LoggingInterceptor.ɵfac });
688
- /*@__PURE__*/ (function () { ɵsetClassMetadata(LoggingInterceptor, [{
689
- type: Injectable
687
+ class LoggingInterceptor {
688
+ intercept(req, next) {
689
+ const started = Date.now();
690
+ let ok;
691
+ // extend server response observable with logging
692
+ return next.handle(req).pipe(tap(
693
+ // Succeeds when there is a response; ignore other events
694
+ event => (ok = event instanceof HttpResponse ? 'succeeded' : ''),
695
+ // Operation failed; error is an HttpErrorResponse
696
+ error => (ok = 'failed')),
697
+ // Log when response observable either completes or errors
698
+ finalize(() => {
699
+ const elapsed = Date.now() - started;
700
+ const msg = `${req.method} "${req.urlWithParams}"
701
+ ${ok} in ${elapsed} ms.`;
702
+ console.log(msg);
703
+ }));
704
+ }
705
+ }
706
+ LoggingInterceptor.ɵfac = function LoggingInterceptor_Factory(t) { return new (t || LoggingInterceptor)(); };
707
+ LoggingInterceptor.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: LoggingInterceptor, factory: LoggingInterceptor.ɵfac });
708
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LoggingInterceptor, [{
709
+ type: Injectable
690
710
  }], null, null); })();
691
711
 
692
- class IgoLoggingModule {
693
- static forRoot() {
694
- return {
695
- ngModule: IgoLoggingModule,
696
- providers: [
697
- {
698
- provide: HTTP_INTERCEPTORS,
699
- useClass: LoggingInterceptor,
700
- multi: true
701
- }
702
- ]
703
- };
704
- }
705
- }
706
- IgoLoggingModule.ɵmod = ɵɵdefineNgModule({ type: IgoLoggingModule });
707
- IgoLoggingModule.ɵinj = ɵɵdefineInjector({ factory: function IgoLoggingModule_Factory(t) { return new (t || IgoLoggingModule)(); }, imports: [[]] });
708
- /*@__PURE__*/ (function () { ɵsetClassMetadata(IgoLoggingModule, [{
709
- type: NgModule,
710
- args: [{
711
- imports: [],
712
- declarations: [],
713
- exports: []
714
- }]
712
+ class IgoLoggingModule {
713
+ static forRoot() {
714
+ return {
715
+ ngModule: IgoLoggingModule,
716
+ providers: [
717
+ {
718
+ provide: HTTP_INTERCEPTORS,
719
+ useClass: LoggingInterceptor,
720
+ multi: true
721
+ }
722
+ ]
723
+ };
724
+ }
725
+ }
726
+ IgoLoggingModule.ɵfac = function IgoLoggingModule_Factory(t) { return new (t || IgoLoggingModule)(); };
727
+ IgoLoggingModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: IgoLoggingModule });
728
+ IgoLoggingModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [[]] });
729
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IgoLoggingModule, [{
730
+ type: NgModule,
731
+ args: [{
732
+ imports: [],
733
+ declarations: [],
734
+ exports: []
735
+ }]
715
736
  }], null, null); })();
716
737
 
717
- let ROUTE_SERVICE_OPTIONS = new InjectionToken('routeServiceOptions');
718
- function provideRouteServiceOptions(options) {
719
- return {
720
- provide: ROUTE_SERVICE_OPTIONS,
721
- useValue: options
722
- };
723
- }
724
- class RouteService {
725
- constructor(route, options) {
726
- this.route = route;
727
- const defaultOptions = {
728
- centerKey: 'center',
729
- zoomKey: 'zoom',
730
- projectionKey: 'projection',
731
- contextKey: 'context',
732
- searchKey: 'search',
733
- visibleOnLayersKey: 'visiblelayers',
734
- visibleOffLayersKey: 'invisiblelayers',
735
- directionsCoordKey: 'routing',
736
- toolKey: 'tool',
737
- wmsUrlKey: 'wmsUrl',
738
- wmsLayersKey: 'wmsLayers',
739
- wmtsUrlKey: 'wmtsUrl',
740
- wmtsLayersKey: 'wmtsLayers',
741
- arcgisUrlKey: 'arcgisUrl',
742
- arcgisLayersKey: 'arcgisLayers',
743
- iarcgisUrlKey: 'iarcgisUrl',
744
- iarcgisLayersKey: 'iarcgisLayers',
745
- tarcgisUrlKey: 'tarcgisUrl',
746
- tarcgisLayersKey: 'tarcgisLayers',
747
- vectorKey: 'vector'
748
- };
749
- this.options = Object.assign({}, defaultOptions, options);
750
- }
751
- get queryParams() {
752
- return this.route.queryParams;
753
- }
754
- }
755
- RouteService.ɵfac = function RouteService_Factory(t) { return new (t || RouteService)(ɵɵinject(ActivatedRoute), ɵɵinject(ROUTE_SERVICE_OPTIONS, 8)); };
756
- RouteService.ɵprov = ɵɵdefineInjectable({ token: RouteService, factory: RouteService.ɵfac, providedIn: 'root' });
757
- /*@__PURE__*/ (function () { ɵsetClassMetadata(RouteService, [{
758
- type: Injectable,
759
- args: [{
760
- providedIn: 'root'
761
- }]
762
- }], function () { return [{ type: ActivatedRoute }, { type: undefined, decorators: [{
763
- type: Inject,
764
- args: [ROUTE_SERVICE_OPTIONS]
765
- }, {
766
- type: Optional
738
+ let ROUTE_SERVICE_OPTIONS = new InjectionToken('routeServiceOptions');
739
+ function provideRouteServiceOptions(options) {
740
+ return {
741
+ provide: ROUTE_SERVICE_OPTIONS,
742
+ useValue: options
743
+ };
744
+ }
745
+ class RouteService {
746
+ constructor(route, options) {
747
+ this.route = route;
748
+ const defaultOptions = {
749
+ centerKey: 'center',
750
+ zoomKey: 'zoom',
751
+ projectionKey: 'projection',
752
+ contextKey: 'context',
753
+ searchKey: 'search',
754
+ visibleOnLayersKey: 'visiblelayers',
755
+ visibleOffLayersKey: 'invisiblelayers',
756
+ directionsCoordKey: 'routing',
757
+ toolKey: 'tool',
758
+ wmsUrlKey: 'wmsUrl',
759
+ wmsLayersKey: 'wmsLayers',
760
+ wmtsUrlKey: 'wmtsUrl',
761
+ wmtsLayersKey: 'wmtsLayers',
762
+ arcgisUrlKey: 'arcgisUrl',
763
+ arcgisLayersKey: 'arcgisLayers',
764
+ iarcgisUrlKey: 'iarcgisUrl',
765
+ iarcgisLayersKey: 'iarcgisLayers',
766
+ tarcgisUrlKey: 'tarcgisUrl',
767
+ tarcgisLayersKey: 'tarcgisLayers',
768
+ vectorKey: 'vector'
769
+ };
770
+ this.options = Object.assign({}, defaultOptions, options);
771
+ }
772
+ get queryParams() {
773
+ return this.route.queryParams;
774
+ }
775
+ }
776
+ RouteService.ɵfac = function RouteService_Factory(t) { return new (t || RouteService)(i0.ɵɵinject(i1$3.ActivatedRoute), i0.ɵɵinject(ROUTE_SERVICE_OPTIONS, 8)); };
777
+ RouteService.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: RouteService, factory: RouteService.ɵfac, providedIn: 'root' });
778
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(RouteService, [{
779
+ type: Injectable,
780
+ args: [{
781
+ providedIn: 'root'
782
+ }]
783
+ }], function () { return [{ type: i1$3.ActivatedRoute }, { type: undefined, decorators: [{
784
+ type: Inject,
785
+ args: [ROUTE_SERVICE_OPTIONS]
786
+ }, {
787
+ type: Optional
767
788
  }] }]; }, null); })();
768
789
 
769
- class AnalyticsService {
770
- constructor(config) {
771
- this.config = config;
772
- this.options = this.config.getConfig('analytics') || {};
773
- if (this.options.provider === 'matomo') {
774
- this.initMatomo();
775
- }
776
- }
777
- get paq() {
778
- return (window._paq = window._paq || []);
779
- }
780
- initMatomo() {
781
- if (!this.options.url || !this.options.id) {
782
- return;
783
- }
784
- const url = this.options.url.substr(-1) === '/'
785
- ? this.options.url + 'matomo'
786
- : this.options.url;
787
- // this.paq.push(['trackPageView']);
788
- // this.paq.push(['enableLinkTracking']);
789
- (() => {
790
- this.paq.push(['setTrackerUrl', url + '.php']);
791
- this.paq.push(['setSiteId', this.options.id]);
792
- const g = document.createElement('script');
793
- const s = document.getElementsByTagName('script')[0];
794
- g.type = 'text/javascript';
795
- g.async = true;
796
- g.defer = true;
797
- g.src = url + '.js';
798
- s.parentNode.insertBefore(g, s);
799
- })();
800
- }
801
- setUser(user, profils) {
802
- if (this.options.provider === 'matomo') {
803
- if (!user) {
804
- this.paq.push(['resetUserId']);
805
- this.paq.push(['deleteCustomVariable', 1, 'user']);
806
- this.paq.push(['deleteCustomVariable', 2, 'name']);
807
- this.paq.push(['deleteCustomVariable', 3, 'profils']);
808
- }
809
- else {
810
- this.paq.push(['setUserId', user.id]);
811
- const name = `${user.firstName} ${user.lastName}`;
812
- this.paq.push(['setCustomVariable', 1, 'user', user.sourceId, 'visit']);
813
- this.paq.push(['setCustomVariable', 2, 'name', name, 'visit']);
814
- this.paq.push(['setCustomVariable', 3, 'profils', profils, 'visit']);
815
- }
816
- this.paq.push(['trackPageView']);
817
- this.paq.push(['enableLinkTracking']);
818
- }
819
- }
820
- trackSearch(term, nbResults) {
821
- if (this.options.provider === 'matomo') {
822
- this.paq.push(['trackSiteSearch', term, false, nbResults]);
823
- }
824
- }
825
- trackEvent(category, action, name) {
826
- if (this.options.provider === 'matomo') {
827
- this.paq.push(['trackEvent', category, action, name]);
828
- }
829
- }
830
- }
831
- AnalyticsService.ɵfac = function AnalyticsService_Factory(t) { return new (t || AnalyticsService)(ɵɵinject(ConfigService)); };
832
- AnalyticsService.ɵprov = ɵɵdefineInjectable({ token: AnalyticsService, factory: AnalyticsService.ɵfac, providedIn: 'root' });
833
- /*@__PURE__*/ (function () { ɵsetClassMetadata(AnalyticsService, [{
834
- type: Injectable,
835
- args: [{
836
- providedIn: 'root'
837
- }]
790
+ class AnalyticsService {
791
+ constructor(config) {
792
+ this.config = config;
793
+ this.options = this.config.getConfig('analytics') || {};
794
+ if (this.options.provider === 'matomo') {
795
+ this.initMatomo();
796
+ }
797
+ }
798
+ get paq() {
799
+ return (window._paq = window._paq || []);
800
+ }
801
+ initMatomo() {
802
+ if (!this.options.url || !this.options.id) {
803
+ return;
804
+ }
805
+ const url = this.options.url.substr(-1) === '/'
806
+ ? this.options.url + 'matomo'
807
+ : this.options.url;
808
+ // this.paq.push(['trackPageView']);
809
+ // this.paq.push(['enableLinkTracking']);
810
+ (() => {
811
+ this.paq.push(['setTrackerUrl', url + '.php']);
812
+ this.paq.push(['setSiteId', this.options.id]);
813
+ const g = document.createElement('script');
814
+ const s = document.getElementsByTagName('script')[0];
815
+ g.type = 'text/javascript';
816
+ g.async = true;
817
+ g.defer = true;
818
+ g.src = url + '.js';
819
+ s.parentNode.insertBefore(g, s);
820
+ })();
821
+ }
822
+ setUser(user, profils) {
823
+ if (this.options.provider === 'matomo') {
824
+ if (!user) {
825
+ this.paq.push(['resetUserId']);
826
+ this.paq.push(['deleteCustomVariable', 1, 'user']);
827
+ this.paq.push(['deleteCustomVariable', 2, 'name']);
828
+ this.paq.push(['deleteCustomVariable', 3, 'profils']);
829
+ }
830
+ else {
831
+ this.paq.push(['setUserId', user.id]);
832
+ const name = `${user.firstName} ${user.lastName}`;
833
+ this.paq.push(['setCustomVariable', 1, 'user', user.sourceId, 'visit']);
834
+ this.paq.push(['setCustomVariable', 2, 'name', name, 'visit']);
835
+ this.paq.push(['setCustomVariable', 3, 'profils', profils, 'visit']);
836
+ }
837
+ this.paq.push(['trackPageView']);
838
+ this.paq.push(['enableLinkTracking']);
839
+ }
840
+ }
841
+ trackSearch(term, nbResults) {
842
+ if (this.options.provider === 'matomo') {
843
+ this.paq.push(['trackSiteSearch', term, false, nbResults]);
844
+ }
845
+ }
846
+ trackEvent(category, action, name) {
847
+ if (this.options.provider === 'matomo') {
848
+ this.paq.push(['trackEvent', category, action, name]);
849
+ }
850
+ }
851
+ }
852
+ AnalyticsService.ɵfac = function AnalyticsService_Factory(t) { return new (t || AnalyticsService)(i0.ɵɵinject(ConfigService)); };
853
+ AnalyticsService.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: AnalyticsService, factory: AnalyticsService.ɵfac, providedIn: 'root' });
854
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AnalyticsService, [{
855
+ type: Injectable,
856
+ args: [{
857
+ providedIn: 'root'
858
+ }]
838
859
  }], function () { return [{ type: ConfigService }]; }, null); })();
839
860
 
840
- var Media;
841
- (function (Media) {
842
- Media["Mobile"] = "mobile";
843
- Media["Tablet"] = "tablet";
844
- Media["Desktop"] = "desktop";
845
- })(Media || (Media = {}));
846
- var MediaOrientation;
847
- (function (MediaOrientation) {
848
- MediaOrientation["Portrait"] = "portrait";
849
- MediaOrientation["Landscape"] = "landscape";
861
+ var Media;
862
+ (function (Media) {
863
+ Media["Mobile"] = "mobile";
864
+ Media["Tablet"] = "tablet";
865
+ Media["Desktop"] = "desktop";
866
+ })(Media || (Media = {}));
867
+ var MediaOrientation;
868
+ (function (MediaOrientation) {
869
+ MediaOrientation["Portrait"] = "portrait";
870
+ MediaOrientation["Landscape"] = "landscape";
850
871
  })(MediaOrientation || (MediaOrientation = {}));
851
872
 
852
- class MediaService {
853
- constructor(breakpointObserver) {
854
- this.media$ = new BehaviorSubject(undefined);
855
- this.orientation$ = new BehaviorSubject(undefined);
856
- breakpointObserver
857
- .observe([Breakpoints.HandsetLandscape])
858
- .subscribe(res => {
859
- if (res.matches) {
860
- this.media$.next(Media.Mobile);
861
- this.orientation$.next(MediaOrientation.Landscape);
862
- }
863
- });
864
- breakpointObserver.observe([Breakpoints.HandsetPortrait]).subscribe(res => {
865
- if (res.matches) {
866
- this.media$.next(Media.Mobile);
867
- this.orientation$.next(MediaOrientation.Portrait);
868
- }
869
- });
870
- breakpointObserver.observe([Breakpoints.TabletLandscape]).subscribe(res => {
871
- if (res.matches) {
872
- this.media$.next(Media.Tablet);
873
- this.orientation$.next(MediaOrientation.Landscape);
874
- }
875
- });
876
- breakpointObserver.observe([Breakpoints.TabletPortrait]).subscribe(res => {
877
- if (res.matches) {
878
- this.media$.next(Media.Tablet);
879
- this.orientation$.next(MediaOrientation.Portrait);
880
- }
881
- });
882
- breakpointObserver.observe([Breakpoints.WebLandscape]).subscribe(res => {
883
- if (res.matches) {
884
- this.media$.next(Media.Desktop);
885
- this.orientation$.next(MediaOrientation.Landscape);
886
- }
887
- });
888
- breakpointObserver.observe([Breakpoints.WebPortrait]).subscribe(res => {
889
- if (res.matches) {
890
- this.media$.next(Media.Desktop);
891
- this.orientation$.next(MediaOrientation.Portrait);
892
- }
893
- });
894
- }
895
- getMedia() {
896
- return this.media$.value;
897
- }
898
- getOrientation() {
899
- return this.orientation$.value;
900
- }
901
- isTouchScreen() {
902
- return 'ontouchstart' in document.documentElement ? true : false;
903
- }
904
- isMobile() {
905
- const media = this.getMedia();
906
- return media === 'mobile';
907
- }
908
- isDesktop() {
909
- const media = this.getMedia();
910
- return media === 'desktop';
911
- }
912
- }
913
- MediaService.ɵfac = function MediaService_Factory(t) { return new (t || MediaService)(ɵɵinject(BreakpointObserver)); };
914
- MediaService.ɵprov = ɵɵdefineInjectable({ token: MediaService, factory: MediaService.ɵfac, providedIn: 'root' });
915
- /*@__PURE__*/ (function () { ɵsetClassMetadata(MediaService, [{
916
- type: Injectable,
917
- args: [{
918
- providedIn: 'root'
919
- }]
920
- }], function () { return [{ type: BreakpointObserver }]; }, null); })();
873
+ class MediaService {
874
+ constructor(breakpointObserver) {
875
+ this.media$ = new BehaviorSubject(undefined);
876
+ this.orientation$ = new BehaviorSubject(undefined);
877
+ breakpointObserver
878
+ .observe([Breakpoints.HandsetLandscape])
879
+ .subscribe(res => {
880
+ if (res.matches) {
881
+ this.media$.next(Media.Mobile);
882
+ this.orientation$.next(MediaOrientation.Landscape);
883
+ }
884
+ });
885
+ breakpointObserver.observe([Breakpoints.HandsetPortrait]).subscribe(res => {
886
+ if (res.matches) {
887
+ this.media$.next(Media.Mobile);
888
+ this.orientation$.next(MediaOrientation.Portrait);
889
+ }
890
+ });
891
+ breakpointObserver.observe([Breakpoints.TabletLandscape]).subscribe(res => {
892
+ if (res.matches) {
893
+ this.media$.next(Media.Tablet);
894
+ this.orientation$.next(MediaOrientation.Landscape);
895
+ }
896
+ });
897
+ breakpointObserver.observe([Breakpoints.TabletPortrait]).subscribe(res => {
898
+ if (res.matches) {
899
+ this.media$.next(Media.Tablet);
900
+ this.orientation$.next(MediaOrientation.Portrait);
901
+ }
902
+ });
903
+ breakpointObserver.observe([Breakpoints.WebLandscape]).subscribe(res => {
904
+ if (res.matches) {
905
+ this.media$.next(Media.Desktop);
906
+ this.orientation$.next(MediaOrientation.Landscape);
907
+ }
908
+ });
909
+ breakpointObserver.observe([Breakpoints.WebPortrait]).subscribe(res => {
910
+ if (res.matches) {
911
+ this.media$.next(Media.Desktop);
912
+ this.orientation$.next(MediaOrientation.Portrait);
913
+ }
914
+ });
915
+ }
916
+ getMedia() {
917
+ return this.media$.value;
918
+ }
919
+ getOrientation() {
920
+ return this.orientation$.value;
921
+ }
922
+ isTouchScreen() {
923
+ return 'ontouchstart' in document.documentElement ? true : false;
924
+ }
925
+ isMobile() {
926
+ const media = this.getMedia();
927
+ return media === 'mobile';
928
+ }
929
+ isDesktop() {
930
+ const media = this.getMedia();
931
+ return media === 'desktop';
932
+ }
933
+ }
934
+ MediaService.ɵfac = function MediaService_Factory(t) { return new (t || MediaService)(i0.ɵɵinject(i1$4.BreakpointObserver)); };
935
+ MediaService.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: MediaService, factory: MediaService.ɵfac, providedIn: 'root' });
936
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MediaService, [{
937
+ type: Injectable,
938
+ args: [{
939
+ providedIn: 'root'
940
+ }]
941
+ }], function () { return [{ type: i1$4.BreakpointObserver }]; }, null); })();
921
942
 
922
- var StorageScope;
923
- (function (StorageScope) {
924
- StorageScope["SESSION"] = "Session";
925
- StorageScope["LOCAL"] = "Local";
926
- })(StorageScope || (StorageScope = {}));
927
- var StorageServiceEventEnum;
928
- (function (StorageServiceEventEnum) {
929
- StorageServiceEventEnum["ADDED"] = "Added";
930
- StorageServiceEventEnum["MODIFIED"] = "Modified";
931
- StorageServiceEventEnum["REMOVED"] = "Removed";
932
- StorageServiceEventEnum["CLEARED"] = "Cleared";
943
+ var StorageScope;
944
+ (function (StorageScope) {
945
+ StorageScope["SESSION"] = "Session";
946
+ StorageScope["LOCAL"] = "Local";
947
+ })(StorageScope || (StorageScope = {}));
948
+ var StorageServiceEventEnum;
949
+ (function (StorageServiceEventEnum) {
950
+ StorageServiceEventEnum["ADDED"] = "Added";
951
+ StorageServiceEventEnum["MODIFIED"] = "Modified";
952
+ StorageServiceEventEnum["REMOVED"] = "Removed";
953
+ StorageServiceEventEnum["CLEARED"] = "Cleared";
933
954
  })(StorageServiceEventEnum || (StorageServiceEventEnum = {}));
934
955
 
935
- class StorageService {
936
- constructor(config) {
937
- this.config = config;
938
- this.storageChange$ = new BehaviorSubject(undefined);
939
- this.options = this.config.getConfig('storage') || { key: 'igo' };
940
- }
941
- /**
942
- * Use to get the data found in storage file
943
- */
944
- get(key, scope) {
945
- let value;
946
- if (!scope || scope === StorageScope.SESSION) {
947
- value = sessionStorage.getItem(`${this.options.key}.${key}`);
948
- }
949
- if (scope === StorageScope.LOCAL || (!value && !scope)) {
950
- value = localStorage.getItem(`${this.options.key}.${key}`);
951
- }
952
- if (value) {
953
- try {
954
- value = JSON.parse(value);
955
- }
956
- catch (_a) {
957
- value = value;
958
- }
959
- }
960
- return value;
961
- }
962
- set(key, value, scope = StorageScope.LOCAL) {
963
- const previousValue = this.get(key, scope);
964
- if (scope === StorageScope.SESSION) {
965
- sessionStorage.setItem(`${this.options.key}.${key}`, JSON.stringify(value));
966
- }
967
- else {
968
- localStorage.setItem(`${this.options.key}.${key}`, JSON.stringify(value));
969
- }
970
- const currentValue = this.get(key, scope);
971
- if (currentValue !== previousValue) {
972
- this.storageChange$.next({
973
- key, scope,
974
- event: previousValue !== undefined ? StorageServiceEventEnum.MODIFIED : StorageServiceEventEnum.ADDED,
975
- previousValue,
976
- currentValue
977
- });
978
- }
979
- }
980
- remove(key, scope = StorageScope.LOCAL) {
981
- const previousValue = this.get(key, scope);
982
- if (scope === StorageScope.SESSION) {
983
- sessionStorage.removeItem(`${this.options.key}.${key}`);
984
- }
985
- else {
986
- localStorage.removeItem(`${this.options.key}.${key}`);
987
- }
988
- this.storageChange$.next({ key, scope, event: StorageServiceEventEnum.REMOVED, previousValue });
989
- }
990
- clear(scope = StorageScope.LOCAL) {
991
- if (scope === StorageScope.SESSION) {
992
- sessionStorage.clear();
993
- }
994
- else {
995
- localStorage.clear();
996
- }
997
- this.storageChange$.next({ scope, event: StorageServiceEventEnum.CLEARED });
998
- }
999
- }
1000
- StorageService.ɵfac = function StorageService_Factory(t) { return new (t || StorageService)(ɵɵinject(ConfigService)); };
1001
- StorageService.ɵprov = ɵɵdefineInjectable({ token: StorageService, factory: StorageService.ɵfac, providedIn: 'root' });
1002
- /*@__PURE__*/ (function () { ɵsetClassMetadata(StorageService, [{
1003
- type: Injectable,
1004
- args: [{
1005
- providedIn: 'root'
1006
- }]
956
+ class StorageService {
957
+ constructor(config) {
958
+ this.config = config;
959
+ this.storageChange$ = new BehaviorSubject(undefined);
960
+ this.options = this.config.getConfig('storage') || { key: 'igo' };
961
+ }
962
+ /**
963
+ * Use to get the data found in storage file
964
+ */
965
+ get(key, scope) {
966
+ let value;
967
+ if (!scope || scope === StorageScope.SESSION) {
968
+ value = sessionStorage.getItem(`${this.options.key}.${key}`);
969
+ }
970
+ if (scope === StorageScope.LOCAL || (!value && !scope)) {
971
+ value = localStorage.getItem(`${this.options.key}.${key}`);
972
+ }
973
+ if (value) {
974
+ try {
975
+ value = JSON.parse(value);
976
+ }
977
+ catch (_a) {
978
+ value = value;
979
+ }
980
+ }
981
+ return value;
982
+ }
983
+ set(key, value, scope = StorageScope.LOCAL) {
984
+ const previousValue = this.get(key, scope);
985
+ if (scope === StorageScope.SESSION) {
986
+ sessionStorage.setItem(`${this.options.key}.${key}`, JSON.stringify(value));
987
+ }
988
+ else {
989
+ localStorage.setItem(`${this.options.key}.${key}`, JSON.stringify(value));
990
+ }
991
+ const currentValue = this.get(key, scope);
992
+ if (currentValue !== previousValue) {
993
+ this.storageChange$.next({
994
+ key, scope,
995
+ event: previousValue !== undefined ? StorageServiceEventEnum.MODIFIED : StorageServiceEventEnum.ADDED,
996
+ previousValue,
997
+ currentValue
998
+ });
999
+ }
1000
+ }
1001
+ remove(key, scope = StorageScope.LOCAL) {
1002
+ const previousValue = this.get(key, scope);
1003
+ if (scope === StorageScope.SESSION) {
1004
+ sessionStorage.removeItem(`${this.options.key}.${key}`);
1005
+ }
1006
+ else {
1007
+ localStorage.removeItem(`${this.options.key}.${key}`);
1008
+ }
1009
+ this.storageChange$.next({ key, scope, event: StorageServiceEventEnum.REMOVED, previousValue });
1010
+ }
1011
+ clear(scope = StorageScope.LOCAL) {
1012
+ if (scope === StorageScope.SESSION) {
1013
+ sessionStorage.clear();
1014
+ }
1015
+ else {
1016
+ localStorage.clear();
1017
+ }
1018
+ this.storageChange$.next({ scope, event: StorageServiceEventEnum.CLEARED });
1019
+ }
1020
+ }
1021
+ StorageService.ɵfac = function StorageService_Factory(t) { return new (t || StorageService)(i0.ɵɵinject(ConfigService)); };
1022
+ StorageService.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: StorageService, factory: StorageService.ɵfac, providedIn: 'root' });
1023
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(StorageService, [{
1024
+ type: Injectable,
1025
+ args: [{
1026
+ providedIn: 'root'
1027
+ }]
1007
1028
  }], function () { return [{ type: ConfigService }]; }, null); })();
1008
1029
 
1009
- class NetworkService {
1010
- constructor(messageService, injector) {
1011
- this.messageService = messageService;
1012
- this.injector = injector;
1013
- this.stateChangeEventEmitter = new EventEmitter();
1014
- this.state = {
1015
- connection: window.navigator.onLine
1016
- };
1017
- this.checkNetworkState();
1018
- }
1019
- checkNetworkState() {
1020
- this.onlineSubscription = fromEvent(window, 'online').subscribe(() => {
1021
- const translate = this.injector.get(LanguageService).translate;
1022
- const message = translate.instant('igo.core.network.online.message');
1023
- const title = translate.instant('igo.core.network.online.title');
1024
- this.messageService.info(message, title);
1025
- this.state.connection = true;
1026
- this.emitEvent();
1027
- });
1028
- this.offlineSubscription = fromEvent(window, 'offline').subscribe(() => {
1029
- const translate = this.injector.get(LanguageService).translate;
1030
- const message = translate.instant('igo.core.network.offline.message');
1031
- const title = translate.instant('igo.core.network.offline.title');
1032
- this.messageService.info(message, title);
1033
- this.state.connection = false;
1034
- this.emitEvent();
1035
- });
1036
- }
1037
- emitEvent() {
1038
- this.stateChangeEventEmitter.emit(this.state);
1039
- }
1040
- ngOnDestroy() {
1041
- try {
1042
- this.offlineSubscription.unsubscribe();
1043
- this.onlineSubscription.unsubscribe();
1044
- }
1045
- catch (e) { }
1046
- }
1047
- currentState(reportState = true) {
1048
- return reportState
1049
- ? this.stateChangeEventEmitter.pipe(debounceTime(300), startWith(this.state))
1050
- : this.stateChangeEventEmitter.pipe(debounceTime(300));
1051
- }
1052
- }
1053
- NetworkService.ɵfac = function NetworkService_Factory(t) { return new (t || NetworkService)(ɵɵinject(MessageService), ɵɵinject(Injector)); };
1054
- NetworkService.ɵprov = ɵɵdefineInjectable({ token: NetworkService, factory: NetworkService.ɵfac, providedIn: 'root' });
1055
- /*@__PURE__*/ (function () { ɵsetClassMetadata(NetworkService, [{
1056
- type: Injectable,
1057
- args: [{
1058
- providedIn: 'root'
1059
- }]
1060
- }], function () { return [{ type: MessageService }, { type: Injector }]; }, null); })();
1030
+ class NetworkService {
1031
+ constructor(messageService, injector) {
1032
+ this.messageService = messageService;
1033
+ this.injector = injector;
1034
+ this.stateChangeEventEmitter = new EventEmitter();
1035
+ this.state = {
1036
+ connection: window.navigator.onLine
1037
+ };
1038
+ this.checkNetworkState();
1039
+ }
1040
+ checkNetworkState() {
1041
+ this.onlineSubscription = fromEvent(window, 'online').subscribe(() => {
1042
+ const translate = this.injector.get(LanguageService).translate;
1043
+ const message = translate.instant('igo.core.network.online.message');
1044
+ const title = translate.instant('igo.core.network.online.title');
1045
+ this.messageService.info(message, title);
1046
+ this.state.connection = true;
1047
+ this.emitEvent();
1048
+ });
1049
+ this.offlineSubscription = fromEvent(window, 'offline').subscribe(() => {
1050
+ const translate = this.injector.get(LanguageService).translate;
1051
+ const message = translate.instant('igo.core.network.offline.message');
1052
+ const title = translate.instant('igo.core.network.offline.title');
1053
+ this.messageService.info(message, title);
1054
+ this.state.connection = false;
1055
+ this.emitEvent();
1056
+ });
1057
+ }
1058
+ emitEvent() {
1059
+ this.stateChangeEventEmitter.emit(this.state);
1060
+ }
1061
+ ngOnDestroy() {
1062
+ try {
1063
+ this.offlineSubscription.unsubscribe();
1064
+ this.onlineSubscription.unsubscribe();
1065
+ }
1066
+ catch (e) { }
1067
+ }
1068
+ currentState(reportState = true) {
1069
+ return reportState
1070
+ ? this.stateChangeEventEmitter.pipe(debounceTime(300), startWith(this.state))
1071
+ : this.stateChangeEventEmitter.pipe(debounceTime(300));
1072
+ }
1073
+ }
1074
+ NetworkService.ɵfac = function NetworkService_Factory(t) { return new (t || NetworkService)(i0.ɵɵinject(MessageService), i0.ɵɵinject(i0.Injector)); };
1075
+ NetworkService.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: NetworkService, factory: NetworkService.ɵfac, providedIn: 'root' });
1076
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(NetworkService, [{
1077
+ type: Injectable,
1078
+ args: [{
1079
+ providedIn: 'root'
1080
+ }]
1081
+ }], function () { return [{ type: MessageService }, { type: i0.Injector }]; }, null); })();
1061
1082
 
1062
- /*
1063
- * Public API Surface of core
1083
+ /*
1084
+ * Public API Surface of core
1064
1085
  */
1065
1086
 
1066
- /**
1067
- * Generated bundle index. Do not edit.
1087
+ /**
1088
+ * Generated bundle index. Do not edit.
1068
1089
  */
1069
1090
 
1070
1091
  export { ActivityInterceptor, ActivityService, AnalyticsService, CONFIG_OPTIONS, ConfigService, ErrorInterceptor, IgoActivityModule, IgoConfigModule, IgoCoreModule, IgoErrorModule, IgoGestureConfig, IgoGestureModule, IgoLanguageModule, IgoLoggingModule, IgoMessageModule, IgoMissingTranslationHandler, LanguageLoader, LanguageService, LoggingInterceptor, Media, MediaOrientation, MediaService, MessageCenterComponent, MessageService, MessageType, NetworkService, ROUTE_SERVICE_OPTIONS, RouteService, StorageScope, StorageService, StorageServiceEventEnum, configFactory, defaultLanguageLoader, provideConfigLoader, provideConfigOptions, provideDefaultLanguageLoader, provideLanguageLoader, provideRouteServiceOptions, version };