@osovitny/anatoly 2.1.14 → 2.14.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. package/assets/styles/alerts.less +182 -0
  2. package/assets/styles/spinner.less +64 -0
  3. package/assets/styles/toastr.less +192 -0
  4. package/{esm2015/lib/core/consts/settings.js → esm2020/lib/core/consts/settings.mjs} +2 -2
  5. package/{esm2015/lib/core/convert.js → esm2020/lib/core/convert.mjs} +2 -2
  6. package/esm2020/lib/core/core.module.mjs +72 -0
  7. package/esm2020/lib/core/go/base-go.service.mjs +41 -0
  8. package/{esm2015/lib/core/guards/once-import.guard.js → esm2020/lib/core/guards/once-import.guard.mjs} +2 -2
  9. package/{esm2015/lib/core/guid.js → esm2020/lib/core/guid.mjs} +2 -2
  10. package/esm2020/lib/core/interceptors/httpInterceptor.mjs +108 -0
  11. package/esm2020/lib/core/localization/localization.module.mjs +47 -0
  12. package/esm2020/lib/core/localization/localization.service.mjs +185 -0
  13. package/esm2020/lib/core/localization/localizationSettings.module.mjs +88 -0
  14. package/esm2020/lib/core/localization/localize.pipe.mjs +78 -0
  15. package/{esm2015/lib/core/localization/utils.js → esm2020/lib/core/localization/utils.mjs} +2 -2
  16. package/esm2020/lib/core/logging/globalErrorHandler.mjs +44 -0
  17. package/esm2020/lib/core/logging/logging.service.mjs +39 -0
  18. package/{esm2015/lib/core/notifications/alerts.js → esm2020/lib/core/notifications/alerts.mjs} +2 -2
  19. package/{esm2015/lib/core/notifications/interfaces/notification.js → esm2020/lib/core/notifications/interfaces/notification.mjs} +2 -2
  20. package/esm2020/lib/core/notifications/services/notification-service.mjs +228 -0
  21. package/esm2020/lib/core/services/appcontext.service.mjs +118 -0
  22. package/esm2020/lib/core/services/dm.service.mjs +72 -0
  23. package/esm2020/lib/core/services/google-analytics.service.mjs +54 -0
  24. package/{esm2015/lib/core/services/idle.service.js → esm2020/lib/core/services/idle.service.mjs} +10 -8
  25. package/{esm2015/lib/core/services/loading.service.js → esm2020/lib/core/services/loading.service.mjs} +10 -9
  26. package/esm2020/lib/core/services/web-storage.service.mjs +69 -0
  27. package/{esm2015/lib/core/subs.js → esm2020/lib/core/subs.mjs} +2 -2
  28. package/esm2020/lib/core/utils.mjs +82 -0
  29. package/esm2020/lib/data/base/base-api.service.mjs +89 -0
  30. package/esm2020/lib/data/base/grid/base-grid-edit.service.mjs +77 -0
  31. package/esm2020/lib/data/base/grid/base-grid-read.service.mjs +62 -0
  32. package/{esm2015/lib/data/consts.js → esm2020/lib/data/consts.mjs} +2 -2
  33. package/esm2020/lib/data/data.module.mjs +51 -0
  34. package/esm2020/lib/data/services/billing-api.service.mjs +65 -0
  35. package/esm2020/lib/data/services/emails-api.service.mjs +42 -0
  36. package/esm2020/lib/data/services/notifications/notifications-api-service.mjs +43 -0
  37. package/esm2020/lib/ui/components/base-edit.component.mjs +143 -0
  38. package/esm2020/lib/ui/components/base.component.mjs +47 -0
  39. package/esm2020/lib/ui/components/base.dialog.mjs +49 -0
  40. package/esm2020/lib/ui/components/billing/buyaccess-button.component.mjs +69 -0
  41. package/esm2020/lib/ui/components/billing/subscribe-plan-button.component.mjs +63 -0
  42. package/esm2020/lib/ui/components/billing/upgrade-plan-button.component.mjs +52 -0
  43. package/esm2020/lib/ui/components/content-header/content-header.component.mjs +37 -0
  44. package/esm2020/lib/ui/components/html-editor/base-html-editor.component.mjs +111 -0
  45. package/esm2020/lib/ui/components/html-editor/forms-html-editor.component.mjs +48 -0
  46. package/esm2020/lib/ui/components/html-editor/html-editor.component.mjs +52 -0
  47. package/{esm2015/lib/ui/components/html-editor/html-editor.defaultoptions.js → esm2020/lib/ui/components/html-editor/html-editor.defaultoptions.mjs} +2 -2
  48. package/esm2020/lib/ui/components/identity/signin-button.component.mjs +32 -0
  49. package/esm2020/lib/ui/components/identity/signout-button.component.mjs +32 -0
  50. package/esm2020/lib/ui/components/identity/signup-button.component.mjs +31 -0
  51. package/esm2020/lib/ui/components/loading/loading.component.mjs +49 -0
  52. package/esm2020/lib/ui/components/spinner/spinner.component.mjs +74 -0
  53. package/esm2020/lib/ui/directives/native-element.directive.mjs +41 -0
  54. package/esm2020/lib/ui/forms/contact-us/contact-us.mjs +120 -0
  55. package/esm2020/lib/ui/pipes/filesize.pipe.mjs +45 -0
  56. package/esm2020/lib/ui/pipes/replace-text.pipe.mjs +40 -0
  57. package/esm2020/lib/ui/pipes/safeHtml.pipe.mjs +37 -0
  58. package/esm2020/lib/ui/ui.module.mjs +167 -0
  59. package/esm2020/lib/ui/validation/form-validation-summary.component.mjs +67 -0
  60. package/esm2020/lib/ui/validation/item-validation-summary.component.mjs +40 -0
  61. package/esm2020/lib/ui/validation/validation-summary.component.mjs +128 -0
  62. package/esm2020/public-api.mjs +68 -0
  63. package/fesm2015/osovitny-anatoly.mjs +3650 -0
  64. package/fesm2015/osovitny-anatoly.mjs.map +1 -0
  65. package/fesm2020/osovitny-anatoly.mjs +3658 -0
  66. package/fesm2020/osovitny-anatoly.mjs.map +1 -0
  67. package/{osovitny-anatoly.d.ts → index.d.ts} +1 -0
  68. package/lib/core/core.module.d.ts +5 -0
  69. package/lib/core/go/base-go.service.d.ts +3 -0
  70. package/lib/core/interceptors/httpInterceptor.d.ts +3 -0
  71. package/lib/core/localization/localization.module.d.ts +6 -0
  72. package/lib/core/localization/localization.service.d.ts +3 -0
  73. package/lib/core/localization/localizationSettings.module.d.ts +5 -0
  74. package/lib/core/localization/localize.pipe.d.ts +3 -0
  75. package/lib/core/logging/globalErrorHandler.d.ts +3 -0
  76. package/lib/core/logging/logging.service.d.ts +3 -0
  77. package/lib/core/notifications/services/notification-service.d.ts +3 -0
  78. package/lib/core/services/appcontext.service.d.ts +3 -0
  79. package/lib/core/services/dm.service.d.ts +3 -0
  80. package/lib/core/services/google-analytics.service.d.ts +3 -0
  81. package/lib/core/services/idle.service.d.ts +3 -0
  82. package/lib/core/services/loading.service.d.ts +3 -0
  83. package/lib/core/services/web-storage.service.d.ts +5 -0
  84. package/lib/data/base/base-api.service.d.ts +3 -0
  85. package/lib/data/base/grid/base-grid-edit.service.d.ts +3 -0
  86. package/lib/data/base/grid/base-grid-read.service.d.ts +3 -0
  87. package/lib/data/data.module.d.ts +5 -0
  88. package/lib/data/services/billing-api.service.d.ts +3 -0
  89. package/lib/data/services/emails-api.service.d.ts +10 -0
  90. package/lib/data/services/notifications/notifications-api-service.d.ts +3 -0
  91. package/lib/ui/components/base-edit.component.d.ts +5 -2
  92. package/lib/ui/components/base.component.d.ts +4 -1
  93. package/lib/ui/components/base.dialog.d.ts +3 -0
  94. package/lib/ui/components/billing/buyaccess-button.component.d.ts +5 -2
  95. package/lib/ui/components/billing/subscribe-plan-button.component.d.ts +4 -1
  96. package/lib/ui/components/billing/upgrade-plan-button.component.d.ts +4 -1
  97. package/lib/ui/components/content-header/content-header.component.d.ts +3 -0
  98. package/lib/ui/components/html-editor/base-html-editor.component.d.ts +3 -0
  99. package/lib/ui/components/html-editor/forms-html-editor.component.d.ts +3 -0
  100. package/lib/ui/components/html-editor/html-editor.component.d.ts +3 -0
  101. package/lib/ui/components/identity/signin-button.component.d.ts +3 -0
  102. package/lib/ui/components/identity/signout-button.component.d.ts +3 -0
  103. package/lib/ui/components/identity/signup-button.component.d.ts +3 -0
  104. package/lib/ui/components/loading/loading.component.d.ts +4 -1
  105. package/lib/ui/components/spinner/spinner.component.d.ts +3 -0
  106. package/lib/ui/directives/native-element.directive.d.ts +3 -0
  107. package/lib/ui/forms/contact-us/contact-us.d.ts +33 -0
  108. package/lib/ui/pipes/filesize.pipe.d.ts +3 -0
  109. package/lib/ui/pipes/replace-text.pipe.d.ts +3 -0
  110. package/lib/ui/pipes/safeHtml.pipe.d.ts +3 -0
  111. package/lib/ui/ui.module.d.ts +26 -0
  112. package/lib/ui/validation/form-validation-summary.component.d.ts +3 -0
  113. package/lib/ui/validation/item-validation-summary.component.d.ts +3 -0
  114. package/lib/ui/validation/validation-summary.component.d.ts +3 -0
  115. package/package.json +23 -11
  116. package/public-api.d.ts +3 -2
  117. package/bundles/osovitny-anatoly.umd.js +0 -3700
  118. package/bundles/osovitny-anatoly.umd.js.map +0 -1
  119. package/esm2015/lib/core/core.module.js +0 -58
  120. package/esm2015/lib/core/go/base-go.service.js +0 -42
  121. package/esm2015/lib/core/interceptors/httpInterceptor.js +0 -109
  122. package/esm2015/lib/core/localization/localization.module.js +0 -41
  123. package/esm2015/lib/core/localization/localization.service.js +0 -187
  124. package/esm2015/lib/core/localization/localizationSettings.module.js +0 -78
  125. package/esm2015/lib/core/localization/localize.pipe.js +0 -78
  126. package/esm2015/lib/core/logging/globalErrorHandler.js +0 -44
  127. package/esm2015/lib/core/logging/logging.service.js +0 -38
  128. package/esm2015/lib/core/notifications/services/notification-service.js +0 -230
  129. package/esm2015/lib/core/services/appcontext.service.js +0 -119
  130. package/esm2015/lib/core/services/dm.service.js +0 -74
  131. package/esm2015/lib/core/services/google-analytics.service.js +0 -53
  132. package/esm2015/lib/core/services/web-storage.service.js +0 -66
  133. package/esm2015/lib/core/utils.js +0 -81
  134. package/esm2015/lib/data/base/base-api.service.js +0 -89
  135. package/esm2015/lib/data/base/grid/base-grid-edit.service.js +0 -77
  136. package/esm2015/lib/data/base/grid/base-grid-read.service.js +0 -62
  137. package/esm2015/lib/data/data.module.js +0 -43
  138. package/esm2015/lib/data/services/billing-api.service.js +0 -65
  139. package/esm2015/lib/data/services/notifications/notifications-api-service.js +0 -45
  140. package/esm2015/lib/ui/components/base-edit.component.js +0 -142
  141. package/esm2015/lib/ui/components/base.component.js +0 -43
  142. package/esm2015/lib/ui/components/base.dialog.js +0 -47
  143. package/esm2015/lib/ui/components/billing/buyaccess-button.component.js +0 -71
  144. package/esm2015/lib/ui/components/billing/subscribe-plan-button.component.js +0 -63
  145. package/esm2015/lib/ui/components/billing/upgrade-plan-button.component.js +0 -54
  146. package/esm2015/lib/ui/components/content-header/content-header.component.js +0 -37
  147. package/esm2015/lib/ui/components/html-editor/base-html-editor.component.js +0 -108
  148. package/esm2015/lib/ui/components/html-editor/forms-html-editor.component.js +0 -44
  149. package/esm2015/lib/ui/components/html-editor/html-editor.component.js +0 -51
  150. package/esm2015/lib/ui/components/identity/signin-button.component.js +0 -33
  151. package/esm2015/lib/ui/components/identity/signout-button.component.js +0 -33
  152. package/esm2015/lib/ui/components/identity/signup-button.component.js +0 -31
  153. package/esm2015/lib/ui/components/loading/loading.component.js +0 -49
  154. package/esm2015/lib/ui/components/spinner/spinner.component.js +0 -73
  155. package/esm2015/lib/ui/directives/native-element.directive.js +0 -41
  156. package/esm2015/lib/ui/pipes/filesize.pipe.js +0 -41
  157. package/esm2015/lib/ui/pipes/replace-text.pipe.js +0 -36
  158. package/esm2015/lib/ui/pipes/safeHtml.pipe.js +0 -36
  159. package/esm2015/lib/ui/ui.module.js +0 -105
  160. package/esm2015/lib/ui/validation/form-validation-summary.component.js +0 -64
  161. package/esm2015/lib/ui/validation/item-validation-summary.component.js +0 -38
  162. package/esm2015/lib/ui/validation/validation-summary.component.js +0 -126
  163. package/esm2015/public-api.js +0 -62
  164. package/fesm2015/osovitny-anatoly.js +0 -3434
  165. package/fesm2015/osovitny-anatoly.js.map +0 -1
  166. package/osovitny-anatoly.metadata.json +0 -1
  167. /package/{esm2015/lib/core/consts/urls.js → esm2020/lib/core/consts/urls.mjs} +0 -0
  168. /package/{esm2015/osovitny-anatoly.js → esm2020/osovitny-anatoly.mjs} +0 -0
@@ -0,0 +1,3658 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, Pipe, APP_INITIALIZER, Injector, NgModule, Inject, Component, Input, Directive, ViewEncapsulation, EventEmitter, Output, ViewChild, Optional, SkipSelf } from '@angular/core';
3
+ import * as i1 from '@angular/router';
4
+ import { NavigationEnd, NavigationStart, NavigationCancel, NavigationError } from '@angular/router';
5
+ import * as i1$3 from '@angular/common/http';
6
+ import { HttpResponse, HttpClient } from '@angular/common/http';
7
+ import { tap, map } from 'rxjs/operators';
8
+ import { BehaviorSubject, Subject, timer, merge, fromEvent } from 'rxjs';
9
+ import { isValid, format, formatDistance, formatDistanceToNow } from 'date-fns';
10
+ import { utcToZonedTime } from 'date-fns-tz';
11
+ import enUS from 'date-fns/locale/en-US';
12
+ import * as i1$1 from '@ngx-translate/core';
13
+ import { TranslateModule, TranslateLoader, TranslateService } from '@ngx-translate/core';
14
+ import * as i1$6 from '@angular/common';
15
+ import { LOCATION_INITIALIZED, DOCUMENT, CommonModule } from '@angular/common';
16
+ import { TranslateHttpLoader } from '@ngx-translate/http-loader';
17
+ import Swal from 'sweetalert2';
18
+ import { v4 } from 'uuid';
19
+ import * as i1$2 from 'ngx-toastr';
20
+ import * as i1$4 from '@angular/platform-browser';
21
+ import { Utils as Utils$1 } from '@core/utils';
22
+ import { Subs as Subs$1 } from '@core/subs';
23
+ import * as i1$7 from '@angular/forms';
24
+ import { FormControl, Validators, ReactiveFormsModule, FormsModule } from '@angular/forms';
25
+ import { Alerts as Alerts$1 } from '@core/notifications/alerts';
26
+ import * as i1$5 from '@core/services/appcontext.service';
27
+ import * as i2 from '@data/services/billing-api.service';
28
+ import { AppCoreSettings as AppCoreSettings$1 } from '@core/consts/settings';
29
+ import * as i1$8 from 'angular-froala-wysiwyg';
30
+ import { FroalaEditorModule, FroalaViewModule } from 'angular-froala-wysiwyg';
31
+ import * as i1$9 from '@core/services/loading.service';
32
+ import { BaseEditComponent as BaseEditComponent$1 } from '@ui/components/base-edit.component';
33
+ import * as i3 from '@data/services/emails-api.service';
34
+ import * as i4 from '@core/notifications/services/notification-service';
35
+ import * as i6 from 'ngx-captcha';
36
+ import { NgxCaptchaModule } from 'ngx-captcha';
37
+ import { throwIfAlreadyLoaded as throwIfAlreadyLoaded$1 } from '@core/guards/once-import.guard';
38
+ import { BaseApiService as BaseApiService$1 } from '@data/base/base-api.service';
39
+
40
+ /*
41
+ <file>
42
+ Project:
43
+ @osovitny/anatoly
44
+
45
+ Authors:
46
+ Vadim Osovitny
47
+ Anatoly Osovitny
48
+
49
+ Created:
50
+ 26 Jun 2020
51
+
52
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
53
+ </file>
54
+ */
55
+ const ContextInitState = JSON.parse((document.getElementById('contextInitState')).getAttribute('data-contextinitstate'));
56
+ const AppCoreSettings = JSON.parse((document.getElementById('appCoreSettings')).getAttribute('data-appcoresettings'));
57
+
58
+ /*
59
+ <file>
60
+ Project:
61
+ MICE
62
+
63
+ Authors:
64
+ Vadim Osovitny vaosovitny@deloitte.com
65
+
66
+ Created:
67
+ 5 May 2020
68
+
69
+ Copyright (c) 2020 Deloitte Tax. All rights reserved.
70
+ </file>
71
+ */
72
+ const Urls = {
73
+ // SignalR Notifications
74
+ notificationsSocketUrl: '/hubs/notifications'
75
+ };
76
+
77
+ /*
78
+ <file>
79
+ Project:
80
+ @osovitny/anatoly
81
+
82
+ Authors:
83
+ Vadim Osovitny
84
+ Anatoly Osovitny
85
+
86
+ Created:
87
+ 17 Jun 2018
88
+
89
+ Version:
90
+ 1.0
91
+
92
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
93
+ </file>
94
+ */
95
+ class BaseGoService {
96
+ constructor(route, router) {
97
+ this.route = route;
98
+ this.router = router;
99
+ this.route = route;
100
+ this.router = router;
101
+ }
102
+ locationReload() {
103
+ window.location.reload();
104
+ }
105
+ homeReload() {
106
+ window.location.href = "/";
107
+ }
108
+ }
109
+ BaseGoService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BaseGoService, deps: [{ token: i1.ActivatedRoute }, { token: i1.Router }], target: i0.ɵɵFactoryTarget.Injectable });
110
+ BaseGoService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BaseGoService });
111
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BaseGoService, decorators: [{
112
+ type: Injectable
113
+ }], ctorParameters: function () { return [{ type: i1.ActivatedRoute }, { type: i1.Router }]; } });
114
+
115
+ /*
116
+ <file>
117
+ Project:
118
+ @osovitny/anatoly
119
+
120
+ Authors:
121
+ Vadim Osovitny
122
+ Anatoly Osovitny
123
+
124
+ Created:
125
+ 26 Jun 2020
126
+
127
+ Version:
128
+ 1.0
129
+
130
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
131
+ </file>
132
+ */
133
+ function throwIfAlreadyLoaded(parentModule, moduleName) {
134
+ if (parentModule) {
135
+ throw new Error(`${moduleName} has already been loaded. Import ${moduleName} modules in the AppModule only.`);
136
+ }
137
+ }
138
+
139
+ /*
140
+ <file>
141
+ Project:
142
+ @osovitny/anatoly
143
+
144
+ Authors:
145
+ Vadim Osovitny
146
+ Anatoly Osovitny
147
+
148
+ Created:
149
+ 26 Jun 2020
150
+
151
+ Version:
152
+ 1.0
153
+
154
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
155
+ </file>
156
+ */
157
+ class LoadingService extends BehaviorSubject {
158
+ constructor() {
159
+ super(false);
160
+ this.counter = 0;
161
+ //Public
162
+ this.isFreezed = false;
163
+ }
164
+ show() {
165
+ this.counter++;
166
+ let that = this;
167
+ setTimeout(() => {
168
+ if (that.counter > 0) {
169
+ that.next(true);
170
+ }
171
+ }, 500);
172
+ }
173
+ hide() {
174
+ if (this.counter <= 0) {
175
+ return;
176
+ }
177
+ this.counter--;
178
+ if (this.counter == 0) {
179
+ this.next(false);
180
+ }
181
+ }
182
+ freeze(timeout = 1000) {
183
+ this.isFreezed = true;
184
+ let that = this;
185
+ setTimeout(() => {
186
+ this.isFreezed = false;
187
+ }, timeout);
188
+ }
189
+ reset() {
190
+ if (this.counter > 0) {
191
+ this.next(false);
192
+ }
193
+ this.counter = 0;
194
+ }
195
+ }
196
+ LoadingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: LoadingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
197
+ LoadingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: LoadingService, providedIn: "root" });
198
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: LoadingService, decorators: [{
199
+ type: Injectable,
200
+ args: [{
201
+ providedIn: "root",
202
+ }]
203
+ }], ctorParameters: function () { return []; } });
204
+
205
+ /*
206
+ <file>
207
+ Project:
208
+ @osovitny/anatoly
209
+
210
+ Authors:
211
+ Vadim Osovitny
212
+ Anatoly Osovitny
213
+
214
+ Created:
215
+ 26 Jun 2020
216
+
217
+ Version:
218
+ 1.0
219
+
220
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
221
+ </file>
222
+ */
223
+ class LoggingService {
224
+ constructor() { }
225
+ logError(error) {
226
+ console.error(error);
227
+ }
228
+ logInformation(info) {
229
+ console.info(info);
230
+ }
231
+ }
232
+ LoggingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: LoggingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
233
+ LoggingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: LoggingService, providedIn: "root" });
234
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: LoggingService, decorators: [{
235
+ type: Injectable,
236
+ args: [{
237
+ providedIn: "root",
238
+ }]
239
+ }], ctorParameters: function () { return []; } });
240
+
241
+ /*
242
+ <file>
243
+ Project:
244
+ @osovitny/anatoly
245
+
246
+ Authors:
247
+ Vadim Osovitny
248
+ Anatoly Osovitny
249
+
250
+ Created:
251
+ 25 March 2020
252
+
253
+ Version:
254
+ 1.0
255
+
256
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
257
+ </file>
258
+ */
259
+ class AnatolyHttpInterceptor {
260
+ constructor(loadingService, loggingService) {
261
+ this.loadingService = loadingService;
262
+ this.loggingService = loggingService;
263
+ this.longRunningExceptionsList = [];
264
+ this.autoCDNSASTokenUrls = ['chunks', 'resources'];
265
+ this.externalSiteUrls = ['azurewebsites.net'];
266
+ }
267
+ intercept(req, next) {
268
+ const isCDNEnabled = AppCoreSettings.IsCDNEnabled;
269
+ const cdnSasToken = AppCoreSettings.CDNSASToken;
270
+ const isLoadingFreezed = this.loadingService.isFreezed;
271
+ const authorizationTokenRequired = true;
272
+ const url = req.url.toLowerCase();
273
+ const originalUrl = req.url;
274
+ let isExternalSite = false;
275
+ let loadingRequired = !isLoadingFreezed;
276
+ if (!isLoadingFreezed) {
277
+ for (const i of this.longRunningExceptionsList) {
278
+ if (url.indexOf(this.longRunningExceptionsList[i]) >= 0) {
279
+ loadingRequired = false;
280
+ break;
281
+ }
282
+ }
283
+ }
284
+ if (isCDNEnabled) {
285
+ for (const i of this.autoCDNSASTokenUrls) {
286
+ if (url.indexOf(this.autoCDNSASTokenUrls[i]) >= 0) {
287
+ req = req.clone({ url: originalUrl + cdnSasToken });
288
+ break;
289
+ }
290
+ }
291
+ }
292
+ for (const i of this.externalSiteUrls) {
293
+ if (url.indexOf(this.externalSiteUrls[i]) >= 0) {
294
+ isExternalSite = true;
295
+ break;
296
+ }
297
+ }
298
+ // VadimOS: IE11-fix
299
+ if (url.indexOf('/api/') > -1) {
300
+ let newUrl = '';
301
+ const t = new Date().getTime().toString();
302
+ if (url.indexOf('?') > -1) {
303
+ newUrl = originalUrl + '&t=' + t;
304
+ }
305
+ else {
306
+ newUrl = originalUrl + '?t=' + t;
307
+ }
308
+ req = req.clone({ url: newUrl });
309
+ }
310
+ req = req.clone({ headers: req.headers.set('Accept', 'application/json') });
311
+ req = req.clone({ headers: req.headers.set('Accept', 'application/text') });
312
+ this.onRequestStart(loadingRequired);
313
+ return next.handle(req).pipe(tap((event) => {
314
+ if (event instanceof HttpResponse) {
315
+ this.onRequestEnd(loadingRequired);
316
+ }
317
+ }, (err) => {
318
+ this.onRequestEnd(loadingRequired);
319
+ this.loggingService.logError(err);
320
+ }));
321
+ }
322
+ onRequestStart(loadingRequired) {
323
+ if (loadingRequired) {
324
+ this.loadingService.show();
325
+ }
326
+ }
327
+ onRequestEnd(loadingRequired) {
328
+ if (loadingRequired) {
329
+ this.loadingService.hide();
330
+ }
331
+ }
332
+ }
333
+ AnatolyHttpInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: AnatolyHttpInterceptor, deps: [{ token: LoadingService }, { token: LoggingService }], target: i0.ɵɵFactoryTarget.Injectable });
334
+ AnatolyHttpInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: AnatolyHttpInterceptor });
335
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: AnatolyHttpInterceptor, decorators: [{
336
+ type: Injectable
337
+ }], ctorParameters: function () { return [{ type: LoadingService }, { type: LoggingService }]; } });
338
+
339
+ /*
340
+ <file>
341
+ Project:
342
+ @osovitny/anatoly
343
+
344
+ Authors:
345
+ Vadim Osovitny
346
+ Anatoly Osovitny
347
+
348
+ Created:
349
+ 29 June 2020
350
+
351
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
352
+ </file>
353
+ */
354
+ class Convert {
355
+ static toLocalizedDateTime(value) {
356
+ if (value) {
357
+ return new Date(Date.UTC(value.getFullYear(), value.getMonth(), value.getDate(), value.getHours(), value.getMinutes(), value.getSeconds(), value.getMilliseconds()));
358
+ }
359
+ return null;
360
+ }
361
+ static enumToString(enumeration, value) {
362
+ for (var k in enumeration)
363
+ if (enumeration[k] == value)
364
+ return k;
365
+ return null;
366
+ }
367
+ static enumToArray(enumeration, notIncludes) {
368
+ const notIncludeFiler = (value) => {
369
+ if (isNaN(Number(value))) {
370
+ return false;
371
+ }
372
+ if (notIncludes) {
373
+ for (var i in notIncludes) {
374
+ if (notIncludes[i] == value)
375
+ return false;
376
+ }
377
+ }
378
+ return true;
379
+ };
380
+ return Object.keys(enumeration)
381
+ .filter(notIncludeFiler)
382
+ .map(key => ({
383
+ value: key,
384
+ text: enumeration[key]
385
+ }));
386
+ }
387
+ static stringToArray(str, separator = ',') {
388
+ if (str) {
389
+ return str.split(separator).filter(element => element);
390
+ }
391
+ return [];
392
+ }
393
+ static stringToIntArray(str, separator = ',') {
394
+ if (str) {
395
+ return str.split(separator).filter(element => element).map(value => parseInt(value));
396
+ }
397
+ return [];
398
+ }
399
+ }
400
+
401
+ /*
402
+ <file>
403
+ Project:
404
+ @osovitny/anatoly
405
+
406
+ Authors:
407
+ Vadim Osovitny
408
+ Anatoly Osovitny
409
+
410
+ Created:
411
+ 05 May 2020
412
+
413
+ Version:
414
+ 1.0
415
+
416
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
417
+ </file>
418
+ */
419
+ class LocalizationService {
420
+ constructor(translate) {
421
+ this.translate = translate;
422
+ this.setSupportedLanguages(['en']);
423
+ }
424
+ format(str, args) {
425
+ return str.replace(/{(\d+)}/g, function (match, number) {
426
+ return typeof args[number] != 'undefined'
427
+ ? args[number]
428
+ : match;
429
+ });
430
+ }
431
+ ;
432
+ configureTranslationSettings(translate) {
433
+ const languageToSet = 'en';
434
+ this.dateFnsLocale = { locale: enUS };
435
+ translate.setDefaultLang(languageToSet);
436
+ return languageToSet;
437
+ }
438
+ getBrowserLanguage() {
439
+ return this.translate.getBrowserLang();
440
+ }
441
+ getDatefnsLocale() {
442
+ let dfnLocale;
443
+ switch (this.getBrowserLanguage()) {
444
+ case 'en':
445
+ dfnLocale = { locale: enUS };
446
+ break;
447
+ default:
448
+ dfnLocale = { locale: enUS };
449
+ }
450
+ return dfnLocale;
451
+ }
452
+ setDefaultLanguage(lang) {
453
+ this.translate.setDefaultLang(lang);
454
+ }
455
+ setSupportedLanguages(languages) {
456
+ this.translate.addLangs(languages);
457
+ }
458
+ updateLanguage(language) {
459
+ this.translate.use(language);
460
+ }
461
+ getLocalizedValue(key, params) {
462
+ const value = this.translate.instant(key);
463
+ if (!params || params.length === 0) {
464
+ return value;
465
+ }
466
+ return this.format(value, params);
467
+ }
468
+ getLocalizedDate(key) {
469
+ if (isValid(new Date(key))) {
470
+ return format(new Date(key), 'dd.MM.yyyy', this.dateFnsLocale);
471
+ }
472
+ return "Invalid Date";
473
+ }
474
+ getLocalizedDateTime(key) {
475
+ let dateValue = new Date(key);
476
+ if (isValid(dateValue)) {
477
+ let localDate = Convert.toLocalizedDateTime(dateValue);
478
+ return format(localDate, 'dd.MM.yyyy HH:mm', this.dateFnsLocale);
479
+ }
480
+ return "Invalid Date";
481
+ }
482
+ getLocalizedDistanceInWords(endedDate, startedDate) {
483
+ if (isValid(new Date(endedDate)) && isValid(new Date(startedDate))) {
484
+ return formatDistance(new Date(endedDate), new Date(startedDate), this.dateFnsLocale);
485
+ }
486
+ return "Invalid Date";
487
+ }
488
+ getLocalizedDistanceToNowInWords(date) {
489
+ if (isValid(new Date(date))) {
490
+ return formatDistanceToNow(new Date(date), this.dateFnsLocale);
491
+ }
492
+ return "Invalid Date";
493
+ }
494
+ //UTC Operations --------------------------------------------------------------
495
+ getUTCToLocalizedDate(key) {
496
+ let browserTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
497
+ if (key) {
498
+ if (key.indexOf("T") == -1) {
499
+ key = key.replace(" ", "T");
500
+ }
501
+ if (key.indexOf("Z") == -1) {
502
+ key = key + "Z";
503
+ }
504
+ }
505
+ if (browserTimeZone) {
506
+ let localDateTime = utcToZonedTime(key, browserTimeZone);
507
+ return format(localDateTime, 'dd.MM.yyyy', this.dateFnsLocale);
508
+ }
509
+ else {
510
+ return format(new Date(key), 'dd.MM.yyyy', this.dateFnsLocale);
511
+ }
512
+ }
513
+ getUTCToLocalizedDateTime(key) {
514
+ let browserTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
515
+ if (key) {
516
+ if (key.indexOf("T") == -1) {
517
+ key = key.replace(" ", "T");
518
+ }
519
+ if (key.indexOf("Z") == -1) {
520
+ key = key + "Z";
521
+ }
522
+ }
523
+ if (browserTimeZone) {
524
+ let localDateTime = utcToZonedTime(key, browserTimeZone);
525
+ return format(localDateTime, 'dd.MM.yyyy HH:mm', this.dateFnsLocale);
526
+ }
527
+ else {
528
+ return format(new Date(key), 'dd.MM.yyyy HH:mm', this.dateFnsLocale);
529
+ }
530
+ }
531
+ //https://date-fns.org/v1.30.1/docs/distanceInWords
532
+ getUTCToLocalizedDistanceToNowInWords(date) {
533
+ date = this.safeUtcToZonedTime(date);
534
+ if (isValid(new Date(date))) {
535
+ return formatDistanceToNow(new Date(date), this.dateFnsLocale);
536
+ }
537
+ return "Invalid Date";
538
+ }
539
+ safeUtcToZonedTime(date) {
540
+ let result = date;
541
+ try {
542
+ if (date) {
543
+ if (date.indexOf("T") == -1) {
544
+ date = date.replace(" ", "T");
545
+ }
546
+ if (date.indexOf("Z") == -1) {
547
+ date = date + "Z";
548
+ }
549
+ }
550
+ let browserTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
551
+ if (browserTimeZone) {
552
+ result = utcToZonedTime(date, browserTimeZone).toString();
553
+ }
554
+ else {
555
+ result = new Date(date).toString();
556
+ }
557
+ }
558
+ catch {
559
+ if (date) {
560
+ console.log("UTC to Local conversion failed for :" + date.toString());
561
+ }
562
+ }
563
+ return result;
564
+ }
565
+ }
566
+ LocalizationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: LocalizationService, deps: [{ token: i1$1.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable });
567
+ LocalizationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: LocalizationService, providedIn: 'root' });
568
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: LocalizationService, decorators: [{
569
+ type: Injectable,
570
+ args: [{
571
+ providedIn: 'root'
572
+ }]
573
+ }], ctorParameters: function () { return [{ type: i1$1.TranslateService }]; } });
574
+
575
+ /*
576
+ <file>
577
+ Project:
578
+ @osovitny/anatoly
579
+
580
+ Authors:
581
+ Vadim Osovitny
582
+ Anatoly Osovitny
583
+
584
+ Created:
585
+ 10 May 2020
586
+
587
+ Version:
588
+ 1.0
589
+
590
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
591
+ </file>
592
+ */
593
+ class LocalizePipe {
594
+ constructor(localizeService) {
595
+ this.localizeService = localizeService;
596
+ }
597
+ transform(inputData, type, param2) {
598
+ if (!inputData) {
599
+ return;
600
+ }
601
+ if (!type) {
602
+ type = 'tr';
603
+ }
604
+ //Translate
605
+ if (type === 'tr') {
606
+ return this.localizeService.getLocalizedValue(inputData);
607
+ }
608
+ //Date
609
+ if (type === 'd') {
610
+ return this.localizeService.getLocalizedDate(inputData);
611
+ }
612
+ //DateTime
613
+ if (type === 'dt') {
614
+ return this.localizeService.getLocalizedDateTime(inputData);
615
+ }
616
+ //DistanceInWords
617
+ if (type === 'dis') {
618
+ return this.localizeService.getLocalizedDistanceInWords(inputData, param2);
619
+ }
620
+ //DistanceToNowInWords
621
+ if (type === 'dis2now') {
622
+ return this.localizeService.getLocalizedDistanceToNowInWords(inputData);
623
+ }
624
+ //UTC Operations --------------------------------------------------------------
625
+ //UTC Date
626
+ if (type === 'u2d') {
627
+ return this.localizeService.getUTCToLocalizedDate(inputData);
628
+ }
629
+ //UTC DateTime
630
+ if (type === 'u2dt') {
631
+ return this.localizeService.getUTCToLocalizedDateTime(inputData);
632
+ }
633
+ //UTC DistanceToNowInWords
634
+ if (type === 'u2dis2now') {
635
+ return this.localizeService.getUTCToLocalizedDistanceToNowInWords(inputData);
636
+ }
637
+ return inputData;
638
+ }
639
+ }
640
+ LocalizePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: LocalizePipe, deps: [{ token: LocalizationService }], target: i0.ɵɵFactoryTarget.Pipe });
641
+ LocalizePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.0.6", ngImport: i0, type: LocalizePipe, name: "localize" });
642
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: LocalizePipe, decorators: [{
643
+ type: Pipe,
644
+ args: [{
645
+ name: 'localize'
646
+ }]
647
+ }], ctorParameters: function () { return [{ type: LocalizationService }]; } });
648
+
649
+ /*
650
+ <file>
651
+ Project:
652
+ @osovitny/anatoly
653
+
654
+ Authors:
655
+ Vadim Osovitny
656
+ Anatoly Osovitny
657
+
658
+ Created:
659
+ 05 May 2020
660
+
661
+ Version:
662
+ 1.0
663
+
664
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
665
+ </file>
666
+ */
667
+ function customTranslateLoaderFactory(http) {
668
+ return new TranslateHttpLoader(http, AppCoreSettings.resourcesUrl + "/", '.json');
669
+ }
670
+ function localizationInitializerFactory(translate, localizationService, injector) {
671
+ return () => new Promise((resolve) => {
672
+ let locationInitialized = injector.get(LOCATION_INITIALIZED, Promise.resolve(null));
673
+ locationInitialized.then(() => {
674
+ let languageToSet = localizationService.configureTranslationSettings(translate);
675
+ translate.use(languageToSet).subscribe(() => {
676
+ }, () => {
677
+ resolve(null);
678
+ }, () => {
679
+ resolve(null);
680
+ });
681
+ });
682
+ });
683
+ }
684
+ const TranslateModuleAtRoot = TranslateModule.forRoot({
685
+ loader: {
686
+ provide: TranslateLoader,
687
+ useFactory: customTranslateLoaderFactory,
688
+ deps: [HttpClient]
689
+ }
690
+ });
691
+ let LocalizationInjectorInstance;
692
+ class LocalizationSettingsModule {
693
+ constructor(injector) {
694
+ this.injector = injector;
695
+ LocalizationInjectorInstance = this.injector;
696
+ }
697
+ }
698
+ LocalizationSettingsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: LocalizationSettingsModule, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.NgModule });
699
+ LocalizationSettingsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.6", ngImport: i0, type: LocalizationSettingsModule, imports: [i1$1.TranslateModule] });
700
+ LocalizationSettingsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: LocalizationSettingsModule, providers: [
701
+ {
702
+ provide: APP_INITIALIZER,
703
+ useFactory: localizationInitializerFactory,
704
+ deps: [TranslateService, LocalizationService, Injector],
705
+ multi: true
706
+ }
707
+ ], imports: [TranslateModuleAtRoot] });
708
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: LocalizationSettingsModule, decorators: [{
709
+ type: NgModule,
710
+ args: [{
711
+ imports: [
712
+ TranslateModuleAtRoot
713
+ ],
714
+ providers: [
715
+ {
716
+ provide: APP_INITIALIZER,
717
+ useFactory: localizationInitializerFactory,
718
+ deps: [TranslateService, LocalizationService, Injector],
719
+ multi: true
720
+ }
721
+ ],
722
+ exports: []
723
+ }]
724
+ }], ctorParameters: function () { return [{ type: i0.Injector }]; } });
725
+
726
+ /*
727
+ <file>
728
+ Project:
729
+ @osovitny/anatoly
730
+
731
+ Authors:
732
+ Vadim Osovitny
733
+ Anatoly Osovitny
734
+
735
+ Created:
736
+ 12 May 2020
737
+
738
+ Version:
739
+ 1.0
740
+
741
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
742
+ </file>
743
+ */
744
+ class LocalizationModule {
745
+ }
746
+ LocalizationModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: LocalizationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
747
+ LocalizationModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.6", ngImport: i0, type: LocalizationModule, declarations: [LocalizePipe], imports: [TranslateModule], exports: [TranslateModule,
748
+ LocalizePipe] });
749
+ LocalizationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: LocalizationModule, imports: [TranslateModule, TranslateModule] });
750
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: LocalizationModule, decorators: [{
751
+ type: NgModule,
752
+ args: [{
753
+ imports: [
754
+ TranslateModule
755
+ ],
756
+ exports: [
757
+ TranslateModule,
758
+ LocalizePipe
759
+ ],
760
+ declarations: [
761
+ LocalizePipe
762
+ ],
763
+ providers: []
764
+ }]
765
+ }] });
766
+
767
+ /*
768
+ <file>
769
+ Project:
770
+ @osovitny/anatoly
771
+
772
+ Authors:
773
+ Vadim Osovitny
774
+ Anatoly Osovitny
775
+
776
+ Created:
777
+ 26 Jun 2020
778
+
779
+ Version:
780
+ 1.0
781
+
782
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
783
+ </file>
784
+ */
785
+ class GlobalErrorHandler {
786
+ constructor(injector) {
787
+ this.injector = injector;
788
+ }
789
+ handleError(error) {
790
+ const loggingService = this.injector.get(LoggingService);
791
+ loggingService.logError(error);
792
+ // IMPORTANT: Rethrow the error otherwise it gets swallowed
793
+ throw error;
794
+ }
795
+ }
796
+ GlobalErrorHandler.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: GlobalErrorHandler, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
797
+ GlobalErrorHandler.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: GlobalErrorHandler });
798
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: GlobalErrorHandler, decorators: [{
799
+ type: Injectable
800
+ }], ctorParameters: function () { return [{ type: i0.Injector }]; } });
801
+
802
+ /*
803
+ <file>
804
+ Project:
805
+ @osovitny/anatoly
806
+
807
+ Authors:
808
+ Vadim Osovitny
809
+ Anatoly Osovitny
810
+
811
+ Created:
812
+ 2 July 2020
813
+
814
+ Version:
815
+ 1.0
816
+
817
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
818
+ </file>
819
+ */
820
+ class L10nUtils {
821
+ // @dynamic
822
+ static get localizationService() {
823
+ const ns = LocalizationInjectorInstance.get(LocalizationService);
824
+ return ns;
825
+ }
826
+ static getLocalizedValue(key, params, defaultKey) {
827
+ // VadimOS: DON'T CHANGE THIS CODE. NEED TO BE REVIEWED AND APPROVED BY VADIMOS
828
+ // defaultKey definition:
829
+ // if key is empty and defaultKey is defined => get localization for defaultKey
830
+ // Example: cancel()
831
+ if (!key && defaultKey) {
832
+ return this.localizationService.getLocalizedValue(defaultKey);
833
+ }
834
+ // VadimOS:
835
+ // if key is not empty value MUST be in localization table, othewise we will return key
836
+ if (key) {
837
+ const value = this.localizationService.getLocalizedValue(key, params);
838
+ return value;
839
+ }
840
+ return key;
841
+ }
842
+ }
843
+
844
+ /*
845
+ <file>
846
+ Project:
847
+ @osovitny/anatoly
848
+
849
+ Authors:
850
+ Vadim Osovitny
851
+ Anatoly Osovitny
852
+
853
+ Created:
854
+ 3 March 2020
855
+
856
+ Version:
857
+ 1.0
858
+
859
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
860
+ </file>
861
+ */
862
+ class Alerts {
863
+ static success(text, params, title, successAction) {
864
+ text = L10nUtils.getLocalizedValue(text, params, 'OperationSuccessFull');
865
+ title = L10nUtils.getLocalizedValue(title, null, 'Success');
866
+ Swal.fire({
867
+ text,
868
+ title,
869
+ icon: 'success',
870
+ confirmButtonText: L10nUtils.getLocalizedValue('Ok')
871
+ })
872
+ .then(() => {
873
+ if (successAction) {
874
+ successAction();
875
+ }
876
+ });
877
+ }
878
+ static info(text, params, title) {
879
+ text = L10nUtils.getLocalizedValue(text, params);
880
+ title = L10nUtils.getLocalizedValue(title, null, 'Info');
881
+ Swal.fire({
882
+ text,
883
+ title,
884
+ icon: 'info',
885
+ confirmButtonText: L10nUtils.getLocalizedValue('Ok')
886
+ });
887
+ }
888
+ static warning(text, params, title) {
889
+ text = L10nUtils.getLocalizedValue(text, params);
890
+ title = L10nUtils.getLocalizedValue(title, null, 'Warning');
891
+ Swal.fire({
892
+ text,
893
+ title,
894
+ icon: 'warning',
895
+ confirmButtonText: L10nUtils.getLocalizedValue('Ok')
896
+ });
897
+ }
898
+ static error(text, params, title) {
899
+ text = L10nUtils.getLocalizedValue(text, params, 'ErrorOccured');
900
+ title = L10nUtils.getLocalizedValue(title, null, 'Error');
901
+ Swal.fire({
902
+ text,
903
+ title,
904
+ icon: 'error',
905
+ confirmButtonText: L10nUtils.getLocalizedValue('Ok')
906
+ });
907
+ }
908
+ static cancel(text, params, title) {
909
+ text = L10nUtils.getLocalizedValue(text, params, 'OperationCancelled');
910
+ title = L10nUtils.getLocalizedValue(title, null, 'Cancelled');
911
+ Swal.fire({
912
+ text,
913
+ title,
914
+ icon: 'info'
915
+ });
916
+ }
917
+ static notImplemented() {
918
+ this.warning('Not Implemented Yet');
919
+ }
920
+ ;
921
+ static areYouSure(text, title, confirmButtonText, cancelButtonText, successAction, cancelAction) {
922
+ text = L10nUtils.getLocalizedValue(text);
923
+ title = L10nUtils.getLocalizedValue(title, null, 'AreYouSure');
924
+ confirmButtonText = L10nUtils.getLocalizedValue(confirmButtonText, null, 'AreYouSure-ConfirmButtonText');
925
+ cancelButtonText = L10nUtils.getLocalizedValue(cancelButtonText, null, 'AreYouSure-CancelButtonText');
926
+ Swal.fire({
927
+ text,
928
+ title,
929
+ icon: 'warning',
930
+ confirmButtonText,
931
+ cancelButtonText,
932
+ showCancelButton: true
933
+ })
934
+ .then((result) => {
935
+ if (result.value) {
936
+ if (successAction) {
937
+ successAction();
938
+ }
939
+ }
940
+ // result.dismiss can be 'cancel', 'overlay', 'close', and 'timer'
941
+ else if (result.dismiss == Swal.DismissReason.cancel || result.dismiss == Swal.DismissReason.close) {
942
+ if (cancelAction) {
943
+ cancelAction();
944
+ }
945
+ }
946
+ });
947
+ }
948
+ ;
949
+ }
950
+
951
+ /*
952
+ <file>
953
+ Project:
954
+ @osovitny/anatoly
955
+
956
+ Authors:
957
+ Vadim Osovitny
958
+ Anatoly Osovitny
959
+
960
+ Created:
961
+ 2 Jun 2020
962
+
963
+ Version:
964
+ 1.0
965
+
966
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
967
+ </file>
968
+ */
969
+
970
+ /*
971
+ <file>
972
+ Project:
973
+ @osovitny/anatoly
974
+
975
+ Authors:
976
+ Vadim Osovitny
977
+ Anatoly Osovitny
978
+
979
+ Created:
980
+ 26 Jun 2020
981
+
982
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
983
+ </file>
984
+ */
985
+ class Guid {
986
+ static newGuid() {
987
+ return v4();
988
+ }
989
+ }
990
+
991
+ /*
992
+ <file>
993
+ Project:
994
+ @osovitny/anatoly
995
+
996
+ Authors:
997
+ Vadim Osovitny
998
+ Anatoly Osovitny
999
+
1000
+ Created:
1001
+ 2 Jun 2020
1002
+
1003
+ Version:
1004
+ 1.0
1005
+
1006
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
1007
+ </file>
1008
+ */
1009
+ // SignalR
1010
+ // import * as signalR from '@microsoft/signalr';
1011
+ // import { NotificationsApiService } from '../../../data/services/notifications/notifications-api-service';
1012
+ class NotificationService {
1013
+ constructor(toastrService) {
1014
+ this.toastrService = toastrService;
1015
+ // SignalR
1016
+ // private hubConnection: signalR.HubConnection;
1017
+ // private socketUrl: string;
1018
+ // Notifications
1019
+ this._sessionNotifications = new BehaviorSubject([]);
1020
+ this._serverNotifications = new BehaviorSubject([]);
1021
+ // Public
1022
+ this.sessionNotifications$ = this._sessionNotifications.asObservable();
1023
+ this.serverNotifications$ = this._serverNotifications.asObservable();
1024
+ // this.onInit();
1025
+ }
1026
+ /*
1027
+ onInit() {
1028
+ if (AppCoreSettings.AzureAD) {
1029
+ this.authService.getAuthToken().subscribe((token: string) => {
1030
+ this.startSignalRConnection(token);
1031
+ });
1032
+
1033
+ return;
1034
+ }
1035
+
1036
+ this.startSignalRConnection();
1037
+ }
1038
+
1039
+ ngOnDestroy() {
1040
+ this.stopSignalRConnection();
1041
+ }
1042
+
1043
+ // SignalR
1044
+ private startSignalRConnection(accessToken?) {
1045
+ const cskii = AppCoreSettings.selectedClientID;
1046
+ // tslint:disable-next-line:variable-name
1047
+ const cskii_upn = AppCoreSettings.CSKII_UPN;
1048
+ // tslint:disable-next-line:variable-name
1049
+ const cli_sessionguid = AppCoreSettings.CLI_SessionGUID;
1050
+
1051
+ const url = this.socketUrl + '?cskii=' + cskii + '&cskii_upn=' + cskii_upn + '&cli_sessionguid=' + cli_sessionguid;
1052
+
1053
+ if (accessToken) {
1054
+ this.hubConnection = new signalR.HubConnectionBuilder()
1055
+ .withUrl(url, {
1056
+ skipNegotiation: false,
1057
+ transport: signalR.HttpTransportType.WebSockets,
1058
+ accessTokenFactory: () => accessToken
1059
+ })
1060
+ .withAutomaticReconnect()
1061
+ .configureLogging(signalR.LogLevel.Debug)
1062
+ .build();
1063
+ }
1064
+ else {
1065
+ this.hubConnection = new signalR.HubConnectionBuilder()
1066
+ .withUrl(this.socketUrl, {
1067
+ skipNegotiation: true,
1068
+ transport: signalR.HttpTransportType.WebSockets
1069
+ })
1070
+ .withAutomaticReconnect()
1071
+ .configureLogging(signalR.LogLevel.Debug)
1072
+ .build();
1073
+ }
1074
+
1075
+ this.hubConnection
1076
+ .start()
1077
+ .then(() => this.signalRConnection_onSuccess())
1078
+ .catch(err => {
1079
+ console.error('Connection failed to SignalR Notification Hub')
1080
+ })
1081
+ }
1082
+
1083
+ private signalRConnection_onSuccess() {
1084
+ this.addReceiveMessageDataListener();
1085
+
1086
+ this.notificationsApiService.retrieveNotifications().subscribe(data => {
1087
+ this.serverNotifications = data;
1088
+ });
1089
+ }
1090
+
1091
+ stopSignalRConnection() {
1092
+ if (this.hubConnection) {
1093
+ this.hubConnection.stop();
1094
+ this.hubConnection = null;
1095
+ }
1096
+ }
1097
+
1098
+ private addReceiveMessageDataListener = () => {
1099
+ this.hubConnection.on('ReceiveMessage', (message) => {
1100
+ if (message) {
1101
+ if (message.type === 'error') {
1102
+ this.error(message.text, null, null, false);
1103
+ }
1104
+ else {
1105
+ this.success(message.text, null, null, false);
1106
+ }
1107
+
1108
+ const notification = {
1109
+ id: message.id,
1110
+ isNew: message.isNew,
1111
+ isSession: true,
1112
+ text: message.text,
1113
+ type: message.type,
1114
+ createdDate: message.createdDate
1115
+ };
1116
+
1117
+ this.addSessionNotificationToList(notification);
1118
+ }
1119
+ });
1120
+ }
1121
+ */
1122
+ addSessionNotification(text, type) {
1123
+ const id = Guid.newGuid();
1124
+ const notification = { id, isNew: true, isSession: true, text, type, createdDate: new Date(Date.now()).toISOString() };
1125
+ this.addSessionNotificationToList(notification);
1126
+ }
1127
+ addSessionNotificationToList(notification) {
1128
+ this.sessionNotifications = [
1129
+ notification,
1130
+ ...this.sessionNotifications,
1131
+ ];
1132
+ }
1133
+ // Public API
1134
+ removeNotification(id, isSession) {
1135
+ if (isSession) {
1136
+ this.sessionNotifications = this.sessionNotifications.filter(notifications => notifications.id !== id);
1137
+ }
1138
+ else {
1139
+ this.serverNotifications = this.serverNotifications.filter(notifications => notifications.id !== id);
1140
+ }
1141
+ }
1142
+ success(text, params, title, createSessionNotification = true) {
1143
+ text = L10nUtils.getLocalizedValue(text, params, 'OperationSuccessFull');
1144
+ title = L10nUtils.getLocalizedValue(title);
1145
+ this.toastrService.success(text, title, {
1146
+ timeOut: 3000,
1147
+ progressBar: true
1148
+ });
1149
+ if (createSessionNotification) {
1150
+ this.addSessionNotification(text, 'success');
1151
+ }
1152
+ }
1153
+ info(text, params, title) {
1154
+ text = L10nUtils.getLocalizedValue(text, params);
1155
+ title = L10nUtils.getLocalizedValue(title);
1156
+ this.toastrService.info(text, title, {
1157
+ timeOut: 3000,
1158
+ progressBar: true
1159
+ });
1160
+ }
1161
+ warning(text, params, title) {
1162
+ text = L10nUtils.getLocalizedValue(text, params);
1163
+ title = L10nUtils.getLocalizedValue(title);
1164
+ this.toastrService.warning(text, title, {
1165
+ timeOut: 3000,
1166
+ progressBar: true
1167
+ });
1168
+ }
1169
+ error(text, params, title, createSessionNotification = true) {
1170
+ text = L10nUtils.getLocalizedValue(text, params, 'ErrorOccured');
1171
+ title = L10nUtils.getLocalizedValue(title);
1172
+ this.toastrService.error(text, title, {
1173
+ timeOut: 3000,
1174
+ progressBar: true
1175
+ });
1176
+ if (createSessionNotification) {
1177
+ this.addSessionNotification(text, 'error');
1178
+ }
1179
+ }
1180
+ cancel(text, params, title) {
1181
+ text = L10nUtils.getLocalizedValue(text, params, 'OperationCancelled');
1182
+ title = L10nUtils.getLocalizedValue(title);
1183
+ this.toastrService.info(text, title, {
1184
+ timeOut: 3000,
1185
+ progressBar: true
1186
+ });
1187
+ }
1188
+ // SessionNotifications
1189
+ get sessionNotifications() {
1190
+ return this._sessionNotifications.getValue();
1191
+ }
1192
+ set sessionNotifications(val) {
1193
+ this._sessionNotifications.next(val);
1194
+ }
1195
+ // ServerNotifications
1196
+ get serverNotifications() {
1197
+ return this._serverNotifications.getValue();
1198
+ }
1199
+ set serverNotifications(val) {
1200
+ this._serverNotifications.next(val);
1201
+ }
1202
+ }
1203
+ NotificationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: NotificationService, deps: [{ token: i1$2.ToastrService }], target: i0.ɵɵFactoryTarget.Injectable });
1204
+ NotificationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: NotificationService, providedIn: 'root' });
1205
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: NotificationService, decorators: [{
1206
+ type: Injectable,
1207
+ args: [{ providedIn: 'root' }]
1208
+ }], ctorParameters: function () { return [{ type: i1$2.ToastrService }]; } });
1209
+
1210
+ /*
1211
+ <file>
1212
+ Project:
1213
+ @osovitny/anatoly
1214
+
1215
+ Authors:
1216
+ Vadim Osovitny
1217
+ Anatoly Osovitny
1218
+
1219
+ Created:
1220
+ 13 Nov 2017
1221
+
1222
+ Version:
1223
+ 1.0
1224
+
1225
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
1226
+ </file>
1227
+ */
1228
+ class BaseApiService {
1229
+ constructor(http) {
1230
+ this.http = http;
1231
+ }
1232
+ serializeParams(data) {
1233
+ return data ? ('?' + $.param(data)) : '';
1234
+ }
1235
+ //api
1236
+ get(action, data, responseType) {
1237
+ if (!responseType) {
1238
+ responseType = 'json';
1239
+ }
1240
+ var url = `${this.baseUrl}/${action}${this.serializeParams(data)}`;
1241
+ return this.http.get(url, { responseType: responseType }).pipe(map(res => res));
1242
+ }
1243
+ post(action, data, responseType) {
1244
+ if (!responseType) {
1245
+ responseType = 'text';
1246
+ }
1247
+ var url = `${this.baseUrl}/${action}`;
1248
+ return this.http.post(url, data, { responseType: responseType });
1249
+ }
1250
+ postQS(action, data, responseType) {
1251
+ if (!responseType) {
1252
+ responseType = 'text';
1253
+ }
1254
+ var url = `${this.baseUrl}/${action}${this.serializeParams(data)}`;
1255
+ return this.http.post(url, null, { responseType: responseType });
1256
+ }
1257
+ delete(action, data, responseType) {
1258
+ if (!responseType) {
1259
+ responseType = 'text';
1260
+ }
1261
+ var url = `${this.baseUrl}/${action}${this.serializeParams(data)}`;
1262
+ return this.http.delete(url, { responseType: responseType });
1263
+ }
1264
+ //gets
1265
+ getExternalTextFile(url) {
1266
+ return this.http.get(url);
1267
+ }
1268
+ getExternalJsonFile(url) {
1269
+ return this.http.get(url);
1270
+ }
1271
+ getJsonFile(fileName) {
1272
+ const jsonsUrl = AppCoreSettings.jsonsUrl;
1273
+ const jsonVersion = AppCoreSettings.jsonVersion;
1274
+ const isCDNEnabled = AppCoreSettings.isCDNEnabled;
1275
+ const cdnSasToken = AppCoreSettings.cdnSasToken;
1276
+ let url = "";
1277
+ if (isCDNEnabled) {
1278
+ url = jsonsUrl + "/" + fileName + cdnSasToken;
1279
+ }
1280
+ else {
1281
+ url = jsonsUrl + "/" + fileName + '?' + jsonVersion;
1282
+ }
1283
+ return this.http.get(url).pipe(map(res => res));
1284
+ }
1285
+ }
1286
+ BaseApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BaseApiService, deps: [{ token: i1$3.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
1287
+ BaseApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BaseApiService });
1288
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BaseApiService, decorators: [{
1289
+ type: Injectable
1290
+ }], ctorParameters: function () { return [{ type: i1$3.HttpClient }]; } });
1291
+
1292
+ /*
1293
+ <file>
1294
+ Project:
1295
+ @osovitny/anatoly
1296
+
1297
+ Authors:
1298
+ Vadim Osovitny
1299
+ Anatoly Osovitny
1300
+
1301
+ Created:
1302
+ 26 Jun 2020
1303
+
1304
+ Version:
1305
+ 1.0
1306
+
1307
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
1308
+ </file>
1309
+ */
1310
+ class WebStorageService {
1311
+ constructor(storage) {
1312
+ this.storage =
1313
+ storage === 'local' || storage === 'localStorage'
1314
+ ? localStorage
1315
+ : sessionStorage;
1316
+ }
1317
+ setItem(key, value) {
1318
+ this.storage.setItem(key, value);
1319
+ }
1320
+ setObject(key, value) {
1321
+ this.storage.setItem(key, JSON.stringify(value));
1322
+ }
1323
+ getItem(key) {
1324
+ return this.storage.getItem(key);
1325
+ }
1326
+ getObject(key) {
1327
+ let value = this.storage.getItem(key);
1328
+ if (!value) {
1329
+ return null;
1330
+ }
1331
+ return JSON.parse(value);
1332
+ }
1333
+ remove(key) {
1334
+ this.storage.removeItem(key);
1335
+ }
1336
+ }
1337
+ class LocalStorageService extends WebStorageService {
1338
+ constructor() {
1339
+ super('localStorage');
1340
+ }
1341
+ }
1342
+ LocalStorageService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: LocalStorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1343
+ LocalStorageService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: LocalStorageService });
1344
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: LocalStorageService, decorators: [{
1345
+ type: Injectable
1346
+ }], ctorParameters: function () { return []; } });
1347
+ class SessionStorageService extends WebStorageService {
1348
+ constructor() {
1349
+ super('sessionStorage');
1350
+ }
1351
+ }
1352
+ SessionStorageService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: SessionStorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1353
+ SessionStorageService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: SessionStorageService });
1354
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: SessionStorageService, decorators: [{
1355
+ type: Injectable
1356
+ }], ctorParameters: function () { return []; } });
1357
+
1358
+ /*
1359
+ <file>
1360
+ Project:
1361
+ @osovitny/anatoly
1362
+
1363
+ Authors:
1364
+ Vadim Osovitny
1365
+ Anatoly Osovitny
1366
+
1367
+ Created:
1368
+ 13 Nov 2017
1369
+
1370
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
1371
+ </file>
1372
+ */
1373
+ class AppContextService extends BaseApiService {
1374
+ constructor(http, sessionStorage) {
1375
+ super(http);
1376
+ this.http = http;
1377
+ this.sessionStorage = sessionStorage;
1378
+ //Consts
1379
+ this.storageKeyName = 'appContext';
1380
+ this.subscription = null;
1381
+ this.successes = [];
1382
+ this.baseUrl = '/api/appContext';
1383
+ }
1384
+ //Session
1385
+ getCurrentFromSession() {
1386
+ return this.sessionStorage.getObject(this.storageKeyName);
1387
+ }
1388
+ setCurrentFromSession(value) {
1389
+ this.sessionStorage.setObject(this.storageKeyName, value);
1390
+ }
1391
+ updateCurrentIfExpired() {
1392
+ let context = this.getCurrentFromSession();
1393
+ if (!context) {
1394
+ return;
1395
+ }
1396
+ let lu = context.lastRequested;
1397
+ if (lu) {
1398
+ let now = new Date();
1399
+ let lastRequested = new Date(context.lastRequested);
1400
+ let in2Mins = new Date(lastRequested.getFullYear(), lastRequested.getMonth(), lastRequested.getDate(), lastRequested.getHours(), lastRequested.getMinutes() + 2, 0, 0);
1401
+ if (in2Mins.getTime() < now.getTime()) {
1402
+ this.updateCurrent();
1403
+ }
1404
+ }
1405
+ }
1406
+ dataReceived(data) {
1407
+ this.current = data;
1408
+ for (let i = 0; i < this.successes.length; i++) {
1409
+ let success = this.successes[i];
1410
+ if (success) {
1411
+ success(data);
1412
+ }
1413
+ }
1414
+ this.successes = [];
1415
+ this.subscription.unsubscribe();
1416
+ this.subscription = null;
1417
+ }
1418
+ //Public
1419
+ getCurrent(success = null, getCachedIfExist = true) {
1420
+ let context = this.getCurrentFromSession();
1421
+ if (getCachedIfExist && context != null) {
1422
+ if (success) {
1423
+ success(context);
1424
+ }
1425
+ return;
1426
+ }
1427
+ if (success) {
1428
+ this.successes.push(success);
1429
+ }
1430
+ if (this.subscription != null) {
1431
+ return;
1432
+ }
1433
+ let now = new Date();
1434
+ console.log('Requesting a new AppContext at ' + now);
1435
+ this.subscription = this.get('getCurrentContext', null).subscribe((data) => {
1436
+ this.dataReceived(data);
1437
+ }, (e) => {
1438
+ });
1439
+ }
1440
+ updateCurrent(success = null) {
1441
+ this.getCurrent(success, false);
1442
+ }
1443
+ clearCurrent() {
1444
+ this.sessionStorage.remove(this.storageKeyName);
1445
+ }
1446
+ isUserSignedIn() {
1447
+ return ContextInitState.isUserSignedIn;
1448
+ }
1449
+ isUserAdmin() {
1450
+ return ContextInitState.isUserAdmin;
1451
+ }
1452
+ //Properties
1453
+ //current
1454
+ get current() {
1455
+ this.updateCurrentIfExpired();
1456
+ return this.getCurrentFromSession();
1457
+ }
1458
+ set current(value) {
1459
+ this.setCurrentFromSession(value);
1460
+ }
1461
+ }
1462
+ AppContextService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: AppContextService, deps: [{ token: i1$3.HttpClient }, { token: SessionStorageService }], target: i0.ɵɵFactoryTarget.Injectable });
1463
+ AppContextService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: AppContextService });
1464
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: AppContextService, decorators: [{
1465
+ type: Injectable
1466
+ }], ctorParameters: function () { return [{ type: i1$3.HttpClient }, { type: SessionStorageService }]; } });
1467
+
1468
+ /*
1469
+ <file>
1470
+ Project:
1471
+ @osovitny/anatoly
1472
+
1473
+ Authors:
1474
+ Vadim Osovitny
1475
+ Anatoly Osovitny
1476
+
1477
+ Created:
1478
+ 26 Jun 2020
1479
+
1480
+ Version:
1481
+ 1.0
1482
+
1483
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
1484
+ </file>
1485
+ */
1486
+ class IdleService {
1487
+ constructor() {
1488
+ this.expired$ = new Subject();
1489
+ }
1490
+ //Private
1491
+ resetTimeCounters(timeOutSeconds) {
1492
+ this.timeOutSeconds = timeOutSeconds;
1493
+ this.timeOutMilliSeconds = timeOutSeconds * 1000;
1494
+ this.startDate = new Date();
1495
+ }
1496
+ startTimer() {
1497
+ this.timer$ = timer(this.timeOutMilliSeconds, 1 * 1000).subscribe((res) => {
1498
+ let nowDate = new Date();
1499
+ let exiredDate = new Date(this.startDate.getTime() + this.timeOutMilliSeconds);
1500
+ if (nowDate.getTime() >= exiredDate.getTime()) {
1501
+ //console.log("nowDate: " + nowDate);
1502
+ //console.log("exiredDate: " + exiredDate);
1503
+ this.expired$.next(true);
1504
+ }
1505
+ });
1506
+ }
1507
+ resetTimer() {
1508
+ this.startDate = new Date();
1509
+ }
1510
+ //Public
1511
+ startWatching(timeOutSeconds) {
1512
+ this.idle$ = merge(fromEvent(document, 'mousemove'), fromEvent(document, 'click'), fromEvent(document, 'mousedown'), fromEvent(document, 'keypress'), fromEvent(document, 'DOMMouseScroll'), fromEvent(document, 'mousewheel'), fromEvent(document, 'touchmove'), fromEvent(document, 'MSPointerMove'), fromEvent(window, 'mousemove'), fromEvent(window, 'resize'));
1513
+ this.resetTimeCounters(timeOutSeconds);
1514
+ this.idleSubscription = this.idle$.subscribe((res) => {
1515
+ this.resetTimer();
1516
+ });
1517
+ this.startTimer();
1518
+ return this.expired$;
1519
+ }
1520
+ stopWatching() {
1521
+ this.timer$.unsubscribe();
1522
+ this.idleSubscription.unsubscribe();
1523
+ }
1524
+ restartIdleTimer(timeOutSeconds) {
1525
+ this.timer$.unsubscribe();
1526
+ this.resetTimeCounters(timeOutSeconds);
1527
+ this.startTimer();
1528
+ }
1529
+ }
1530
+ IdleService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: IdleService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1531
+ IdleService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: IdleService, providedIn: 'root' });
1532
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: IdleService, decorators: [{
1533
+ type: Injectable,
1534
+ args: [{
1535
+ providedIn: 'root'
1536
+ }]
1537
+ }] });
1538
+
1539
+ /*
1540
+ <file>
1541
+ Project:
1542
+ @osovitny/anatoly
1543
+
1544
+ Authors:
1545
+ Vadim Osovitny
1546
+ Anatoly Osovitny
1547
+
1548
+ Created:
1549
+ 29 Щсе 2020
1550
+
1551
+ Version:
1552
+ 1.0
1553
+
1554
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
1555
+ </file>
1556
+ */
1557
+ class DigitalMarketingService {
1558
+ constructor(title, meta, dom) {
1559
+ this.title = title;
1560
+ this.meta = meta;
1561
+ this.dom = dom;
1562
+ }
1563
+ updateTitle(title) {
1564
+ this.title.setTitle(title);
1565
+ }
1566
+ updateDescription(desc) {
1567
+ this.meta.updateTag({ name: 'description', content: desc });
1568
+ }
1569
+ updateKeywords(keywords) {
1570
+ this.meta.updateTag({ name: 'keywords', content: keywords });
1571
+ }
1572
+ updateMetaTags(meta) {
1573
+ meta.forEach(m => this.meta.updateTag(m));
1574
+ }
1575
+ setCanonicalUrl(url) {
1576
+ const canUrl = url === undefined ? this.dom.URL : url;
1577
+ const link = this.dom.createElement('link');
1578
+ link.setAttribute('rel', 'canonical');
1579
+ this.dom.head.appendChild(link);
1580
+ link.setAttribute('href', canUrl);
1581
+ }
1582
+ updateCanonicalUrl(url) {
1583
+ const canUrl = url === undefined ? this.dom.URL : url;
1584
+ const head = this.dom.getElementsByTagName('head')[0];
1585
+ let link = this.dom.querySelector(`link[rel='canonical']`) || null;
1586
+ if (link == null) {
1587
+ link = this.dom.createElement('link');
1588
+ head.appendChild(link);
1589
+ }
1590
+ link.setAttribute('rel', 'canonical');
1591
+ link.setAttribute('href', canUrl);
1592
+ }
1593
+ }
1594
+ DigitalMarketingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: DigitalMarketingService, deps: [{ token: i1$4.Title }, { token: i1$4.Meta }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
1595
+ DigitalMarketingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: DigitalMarketingService, providedIn: 'root' });
1596
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: DigitalMarketingService, decorators: [{
1597
+ type: Injectable,
1598
+ args: [{
1599
+ providedIn: 'root'
1600
+ }]
1601
+ }], ctorParameters: function () { return [{ type: i1$4.Title }, { type: i1$4.Meta }, { type: undefined, decorators: [{
1602
+ type: Inject,
1603
+ args: [DOCUMENT]
1604
+ }] }]; } });
1605
+
1606
+ /*
1607
+ <file>
1608
+ Project:
1609
+ @osovitny/anatoly
1610
+
1611
+ Authors:
1612
+ Vadim Osovitny
1613
+ Anatoly Osovitny
1614
+
1615
+ Created:
1616
+ 29 Nov 2020
1617
+
1618
+ Version:
1619
+ 1.0
1620
+
1621
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
1622
+ </file>
1623
+ */
1624
+ class GoogleAnalyticsService {
1625
+ constructor(router) {
1626
+ this.router = router;
1627
+ /*
1628
+ https://yashints.dev/blog/2019/02/12/angular-ga-tagmanager
1629
+ https://developers.google.com/analytics/devguides/collection/gtagjs/pages
1630
+ https://developers.google.com/analytics/devguides/collection/upgrade/analyticsjs
1631
+ */
1632
+ }
1633
+ subscribe() {
1634
+ this.subscription = this.router.events.subscribe(event => {
1635
+ if (event instanceof NavigationEnd) {
1636
+ if (window.ga) {
1637
+ window.ga('set', 'page', event.urlAfterRedirects);
1638
+ window.ga('send', 'pageview');
1639
+ }
1640
+ }
1641
+ });
1642
+ }
1643
+ unsubscribe() {
1644
+ if (this.subscription) {
1645
+ this.subscription.unsubscribe();
1646
+ }
1647
+ }
1648
+ }
1649
+ GoogleAnalyticsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: GoogleAnalyticsService, deps: [{ token: i1.Router }], target: i0.ɵɵFactoryTarget.Injectable });
1650
+ GoogleAnalyticsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: GoogleAnalyticsService });
1651
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: GoogleAnalyticsService, decorators: [{
1652
+ type: Injectable
1653
+ }], ctorParameters: function () { return [{ type: i1.Router }]; } });
1654
+
1655
+ /*
1656
+ <file>
1657
+ Project:
1658
+ @osovitny/anatoly
1659
+
1660
+ Authors:
1661
+ Vadim Osovitny
1662
+ Anatoly Osovitny
1663
+
1664
+ Created:
1665
+ 26 Jun 2020
1666
+
1667
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
1668
+ </file>
1669
+ */
1670
+ class Subs {
1671
+ constructor() {
1672
+ this.subs = [];
1673
+ }
1674
+ add(...subscriptions) {
1675
+ this.subs = this.subs.concat(subscriptions);
1676
+ }
1677
+ set sink(subscription) {
1678
+ this.subs.push(subscription);
1679
+ }
1680
+ unsubscribe() {
1681
+ this.subs.forEach((sub) => sub && sub.unsubscribe());
1682
+ this.subs = [];
1683
+ }
1684
+ }
1685
+
1686
+ /*
1687
+ <file>
1688
+ Project:
1689
+ @osovitny/anatoly
1690
+
1691
+ Authors:
1692
+ Vadim Osovitny
1693
+ Anatoly Osovitny
1694
+
1695
+ Created:
1696
+ 19 March 2020
1697
+
1698
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
1699
+ </file>
1700
+ */
1701
+ class Utils {
1702
+ static getValueByNameInQS(name) {
1703
+ return Utils.getValueByName(location.search, name);
1704
+ }
1705
+ static getValueByName(url, name) {
1706
+ name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
1707
+ // tslint:disable-next-line:one-variable-per-declaration
1708
+ const regex = new RegExp('[\\?&]' + name + '=([^&#]*)'), results = regex.exec(url);
1709
+ return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
1710
+ }
1711
+ static copyToClipBoard(event, val) {
1712
+ event.preventDefault();
1713
+ const selBox = document.createElement('textarea');
1714
+ selBox.style.position = 'fixed';
1715
+ selBox.style.left = '0';
1716
+ selBox.style.top = '0';
1717
+ selBox.style.opacity = '0';
1718
+ selBox.value = val;
1719
+ document.body.appendChild(selBox);
1720
+ selBox.focus();
1721
+ selBox.select();
1722
+ document.execCommand('copy');
1723
+ document.body.removeChild(selBox);
1724
+ }
1725
+ static downloadFile(name, url) {
1726
+ const link = document.createElement('a');
1727
+ link.download = name;
1728
+ link.href = url;
1729
+ link.click();
1730
+ }
1731
+ static downloadBlobFile(value, fileName) {
1732
+ const nav = window.navigator;
1733
+ if (nav.msSaveOrOpenBlob) {
1734
+ nav.msSaveOrOpenBlob(value, fileName);
1735
+ }
1736
+ else {
1737
+ const downloadURL = window.URL.createObjectURL(value);
1738
+ Utils.downloadFile(fileName, downloadURL);
1739
+ }
1740
+ }
1741
+ /*
1742
+ Author:
1743
+ https://medium.com/@mhagemann/the-ultimate-way-to-slugify-a-url-string-in-javascript-b8e4a0d849e1
1744
+ */
1745
+ static slugify(text, prefix = '', postfix = '') {
1746
+ const a = 'àáâäæãåāăąçćčđďèéêëēėęěğǵḧîïíīįìłḿñńǹňôöòóœøōõőṕŕřßśšşșťțûüùúūǘůűųẃẍÿýžźż·/_,:;';
1747
+ const b = 'aaaaaaaaaacccddeeeeeeeegghiiiiiilmnnnnoooooooooprrsssssttuuuuuuuuuwxyyzzz------';
1748
+ const p = new RegExp(a.split('').join('|'), 'g');
1749
+ /*
1750
+ https://css-tricks.com/snippets/javascript/strip-html-tags-in-javascript/
1751
+ https://stackoverflow.com/questions/822452/strip-html-from-text-javascript
1752
+ */
1753
+ text = text.replace(/(<([^>]+)>)/gi, '');
1754
+ let result = text
1755
+ .toString()
1756
+ .toLowerCase()
1757
+ .replace(/\s+/g, '-') // Replace spaces with -
1758
+ .replace(p, c => b.charAt(a.indexOf(c))) // Replace special characters
1759
+ .replace(/&/g, '-and-') // Replace & with 'and'
1760
+ .replace(/[^\w\-]+/g, '') // Remove all non-word characters
1761
+ .replace(/\-\-+/g, '-') // Replace multiple - with single -
1762
+ .replace(/^-+/, '') // Trim - from start of text
1763
+ .replace(/-+$/, ''); // Trim - from end of text
1764
+ return prefix + result + postfix;
1765
+ }
1766
+ }
1767
+
1768
+ /*
1769
+ <file>
1770
+ Project:
1771
+ @osovitny/anatoly
1772
+
1773
+ Authors:
1774
+ Vadim Osovitny
1775
+ Anatoly Osovitny
1776
+
1777
+ Created:
1778
+ 29 Apr 2018
1779
+
1780
+ Version:
1781
+ 1.0
1782
+
1783
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
1784
+ </file>
1785
+ */
1786
+ class BaseGridReadService extends BehaviorSubject {
1787
+ constructor(http) {
1788
+ super([]);
1789
+ this.http = http;
1790
+ this.data = [];
1791
+ }
1792
+ serializeParams(data) {
1793
+ return data ? ('?' + $.param(data)) : '';
1794
+ }
1795
+ read(params, success, error) {
1796
+ if (this.data.length) {
1797
+ return super.next(this.data);
1798
+ }
1799
+ var url = this.baseReadUrl;
1800
+ if (typeof params === 'undefined') {
1801
+ params = this.savedReadParams;
1802
+ }
1803
+ if (params) {
1804
+ url = this.baseReadUrl + `${this.serializeParams(params)}`;
1805
+ this.savedReadParams = params;
1806
+ }
1807
+ this.http.get(url).pipe(map(res => res)).subscribe(data => {
1808
+ super.next(data);
1809
+ if (success)
1810
+ success();
1811
+ }, e => {
1812
+ if (error)
1813
+ error(e);
1814
+ });
1815
+ }
1816
+ }
1817
+ BaseGridReadService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BaseGridReadService, deps: [{ token: i1$3.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
1818
+ BaseGridReadService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BaseGridReadService });
1819
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BaseGridReadService, decorators: [{
1820
+ type: Injectable
1821
+ }], ctorParameters: function () { return [{ type: i1$3.HttpClient }]; } });
1822
+
1823
+ /*
1824
+ <file>
1825
+ Project:
1826
+ @osovitny/anatoly
1827
+
1828
+ Authors:
1829
+ Vadim Osovitny
1830
+ Anatoly Osovitny
1831
+
1832
+ Created:
1833
+ 29 Apr 2018
1834
+
1835
+ Version:
1836
+ 1.0
1837
+
1838
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
1839
+ </file>
1840
+ */
1841
+ class BaseGridEditService extends BaseGridReadService {
1842
+ constructor(http) {
1843
+ super(http);
1844
+ this.http = http;
1845
+ }
1846
+ reset() {
1847
+ this.data = [];
1848
+ }
1849
+ resetItem(dataItem) {
1850
+ if (!dataItem) {
1851
+ return;
1852
+ }
1853
+ //find orignal data item
1854
+ const originalDataItem = this.data.find(item => item.Id === dataItem.Id);
1855
+ //revert changes
1856
+ Object.assign(originalDataItem, dataItem);
1857
+ super.next(this.data);
1858
+ }
1859
+ save(data, isNew, sucess) {
1860
+ const action = isNew ? 'add' : 'update';
1861
+ this.reset();
1862
+ this.post(action, data).subscribe(() => {
1863
+ }, () => {
1864
+ this.read();
1865
+ }, () => {
1866
+ this.read();
1867
+ if (sucess)
1868
+ sucess();
1869
+ });
1870
+ }
1871
+ delete(data, sucess) {
1872
+ this.reset();
1873
+ const url = `${this.baseUrl}/delete${this.serializeParams(data)}`;
1874
+ return this.http.delete(url).subscribe(() => {
1875
+ this.read();
1876
+ if (sucess)
1877
+ sucess();
1878
+ }, () => {
1879
+ this.read();
1880
+ });
1881
+ }
1882
+ post(action, data) {
1883
+ const url = `${this.baseUrl}/${action}${this.serializeParams(data)}`;
1884
+ return this.http.post(url, data).pipe(map(res => res));
1885
+ }
1886
+ }
1887
+ BaseGridEditService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BaseGridEditService, deps: [{ token: i1$3.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
1888
+ BaseGridEditService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BaseGridEditService });
1889
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BaseGridEditService, decorators: [{
1890
+ type: Injectable
1891
+ }], ctorParameters: function () { return [{ type: i1$3.HttpClient }]; } });
1892
+
1893
+ /*
1894
+ <file>
1895
+ Project:
1896
+ @osovitny/anatoly
1897
+
1898
+ Authors:
1899
+ Vadim Osovitny
1900
+ Anatoly Osovitny
1901
+
1902
+ Created:
1903
+ 30 April 2020
1904
+
1905
+ Version:
1906
+ 1.0
1907
+
1908
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
1909
+ </file>
1910
+ */
1911
+ const consts = {
1912
+ billingApiPath: 'api/billing',
1913
+ // Notifications API
1914
+ notificationsApiPath: 'api/notifications',
1915
+ };
1916
+
1917
+ /*
1918
+ <file>
1919
+ Project:
1920
+ @osovitny/anatoly
1921
+
1922
+ Authors:
1923
+ Vadim Osovitny
1924
+ Anatoly Osovitny
1925
+
1926
+ Created:
1927
+ 30 April 2020
1928
+
1929
+ Version:
1930
+ 1.0
1931
+
1932
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
1933
+ </file>
1934
+ */
1935
+ class NotificationsApiService extends BaseApiService {
1936
+ constructor(http) {
1937
+ super(http);
1938
+ this.http = http;
1939
+ this.baseUrl = consts.notificationsApiPath;
1940
+ }
1941
+ retrieveNotifications() {
1942
+ return this.get('retrieveNotifications');
1943
+ }
1944
+ }
1945
+ NotificationsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: NotificationsApiService, deps: [{ token: i1$3.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
1946
+ NotificationsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: NotificationsApiService, providedIn: 'root' });
1947
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: NotificationsApiService, decorators: [{
1948
+ type: Injectable,
1949
+ args: [{
1950
+ providedIn: 'root'
1951
+ }]
1952
+ }], ctorParameters: function () { return [{ type: i1$3.HttpClient }]; } });
1953
+
1954
+ /*
1955
+ <file>
1956
+ Project:
1957
+ @osovitny/anatoly
1958
+
1959
+ Authors:
1960
+ Vadim Osovitny
1961
+ Anatoly Osovitny
1962
+
1963
+ Created:
1964
+ 12 Nov 2017
1965
+
1966
+ Version:
1967
+ 1.0
1968
+
1969
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
1970
+ </file>
1971
+ */
1972
+ class BillingApiService extends BaseApiService {
1973
+ constructor(http) {
1974
+ super(http);
1975
+ this.http = http;
1976
+ this.baseUrl = consts.billingApiPath;
1977
+ }
1978
+ requestNewSubscription(requestedPlan, success, error) {
1979
+ this.postQS("requestNewSubscription", { requestedPlan: requestedPlan }).subscribe((data) => {
1980
+ if (success)
1981
+ success();
1982
+ }, (e) => {
1983
+ if (error)
1984
+ error();
1985
+ });
1986
+ }
1987
+ cancelRequestedSubscription(success, error) {
1988
+ this.postQS("cancelRequestedSubscription", null).subscribe((data) => {
1989
+ if (success)
1990
+ success();
1991
+ }, (e) => {
1992
+ if (error)
1993
+ error();
1994
+ });
1995
+ }
1996
+ buyAccess(requestedPlan, success, error) {
1997
+ this.postQS("buyAccess", { requestedPlan: requestedPlan }).subscribe((data) => {
1998
+ if (success)
1999
+ success();
2000
+ }, (e) => {
2001
+ if (error)
2002
+ error();
2003
+ });
2004
+ }
2005
+ }
2006
+ BillingApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BillingApiService, deps: [{ token: i1$3.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
2007
+ BillingApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BillingApiService });
2008
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BillingApiService, decorators: [{
2009
+ type: Injectable
2010
+ }], ctorParameters: function () { return [{ type: i1$3.HttpClient }]; } });
2011
+
2012
+ /*
2013
+ <file>
2014
+ Project:
2015
+ @osovitny/anatoly
2016
+
2017
+ Authors:
2018
+ Vadim Osovitny
2019
+ Anatoly Osovitny
2020
+
2021
+ Created:
2022
+ 28 Aug 2018
2023
+
2024
+ Version:
2025
+ 1.0
2026
+
2027
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2028
+ </file>
2029
+ */
2030
+ class BaseComponent {
2031
+ constructor() {
2032
+ this.subs = new Subs$1();
2033
+ }
2034
+ getQSId() {
2035
+ var id = Utils$1.getValueByNameInQS("id");
2036
+ if (typeof id === "undefined" || id == "")
2037
+ return null;
2038
+ return id;
2039
+ }
2040
+ ngOnDestroy() {
2041
+ this.subs.unsubscribe();
2042
+ }
2043
+ }
2044
+ BaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2045
+ BaseComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: BaseComponent, selector: "ng-component", ngImport: i0, template: '', isInline: true });
2046
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BaseComponent, decorators: [{
2047
+ type: Component,
2048
+ args: [{
2049
+ template: ''
2050
+ }]
2051
+ }] });
2052
+
2053
+ /*
2054
+ <file>
2055
+ Project:
2056
+ @osovitny/anatoly
2057
+
2058
+ Authors:
2059
+ Vadim Osovitny
2060
+ Anatoly Osovitny
2061
+
2062
+ Created:
2063
+ 20 Nov 2017
2064
+
2065
+ Version:
2066
+ 1.0
2067
+
2068
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2069
+ </file>
2070
+ */
2071
+ class BaseEditComponent extends BaseComponent {
2072
+ constructor() {
2073
+ super();
2074
+ this.formSubmitted = false;
2075
+ }
2076
+ isActionAdding() {
2077
+ var id = Utils$1.getValueByNameInQS("id");
2078
+ if (typeof id === "undefined" || id == "")
2079
+ return true;
2080
+ return false;
2081
+ }
2082
+ getEntityId() {
2083
+ return this.getQSId();
2084
+ }
2085
+ isControlValid(name, frmGroup = null) {
2086
+ return !this.isControlInvalid(name, frmGroup);
2087
+ }
2088
+ isControlInvalid(name, frmGroup = null) {
2089
+ if (typeof name === "undefined" || name == "") {
2090
+ return false;
2091
+ }
2092
+ let fg = frmGroup ? frmGroup : this.formGroup;
2093
+ if (!fg) {
2094
+ return false;
2095
+ }
2096
+ if (fg.get(name)) {
2097
+ return ((this.formSubmitted && fg.get(name).invalid) ||
2098
+ (fg.get(name).touched && fg.get(name).invalid));
2099
+ }
2100
+ return false;
2101
+ }
2102
+ //FormGroup functions
2103
+ getFormValue(name, frmGroup = null) {
2104
+ let fg = frmGroup ? frmGroup : this.formGroup;
2105
+ return fg.controls[name].value;
2106
+ }
2107
+ setFormValue(name, value, frmGroup = null) {
2108
+ let fg = frmGroup ? frmGroup : this.formGroup;
2109
+ fg.controls[name].setValue(value);
2110
+ }
2111
+ getFormGroupValue(groupName, name, frmGroup = null) {
2112
+ let fg = frmGroup ? frmGroup : this.formGroup;
2113
+ return fg.controls[groupName].get(name).value;
2114
+ }
2115
+ setFormGroupValue(groupName, name, value, frmGroup = null) {
2116
+ let fg = frmGroup ? frmGroup : this.formGroup;
2117
+ fg.controls[groupName].get(name).setValue(value);
2118
+ }
2119
+ /**
2120
+ * Add control to form group
2121
+ * @param name
2122
+ * @param formControl
2123
+ * @param formGroup
2124
+ */
2125
+ addControl(name, formControl, frmGroup = null) {
2126
+ let fg = frmGroup ? frmGroup : this.formGroup;
2127
+ fg.addControl(name, formControl);
2128
+ }
2129
+ /**
2130
+ * Removes control from form group
2131
+ * @param name
2132
+ * @param formGroup
2133
+ */
2134
+ removeControl(name, frmGroup = null) {
2135
+ let fg = frmGroup ? frmGroup : this.formGroup;
2136
+ if (fg.get(name)) {
2137
+ fg.removeControl(name);
2138
+ }
2139
+ }
2140
+ /**
2141
+ * return new form control
2142
+ * @param formState
2143
+ * @param validatorOrOpts
2144
+ * @param asyncValidator
2145
+ */
2146
+ createFormControl(formState, validatorOrOpts, asyncValidator) {
2147
+ return new FormControl(formState, validatorOrOpts, asyncValidator);
2148
+ }
2149
+ /**
2150
+ * Set error to control
2151
+ * @param controlName formControl name
2152
+ * @param err error expect {erroname: boolean} format
2153
+ * @param formGroup Specific form group. default it will apply on this.formGroup property
2154
+ */
2155
+ setControlError(controlName, err, frmGroup = null) {
2156
+ let fg = frmGroup ? frmGroup : this.formGroup;
2157
+ fg.get(controlName)?.setErrors(err);
2158
+ }
2159
+ /**
2160
+ * Set {invalid: true} for the specified form
2161
+ * @param controlName form control name
2162
+ * @param formGroup
2163
+ */
2164
+ setInValidError(controlName, frmGroup = null) {
2165
+ let fg = frmGroup ? frmGroup : this.formGroup;
2166
+ fg.get(controlName)?.setErrors({ invalid: true });
2167
+ }
2168
+ /**
2169
+ * returns formgroup controls.
2170
+ * main use case is used in html pages
2171
+ */
2172
+ get fc() {
2173
+ return this.formGroup.controls;
2174
+ }
2175
+ }
2176
+ BaseEditComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BaseEditComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2177
+ BaseEditComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: BaseEditComponent, selector: "ng-component", inputs: { formGroup: "formGroup", formSubmitted: "formSubmitted" }, usesInheritance: true, ngImport: i0, template: '', isInline: true });
2178
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BaseEditComponent, decorators: [{
2179
+ type: Component,
2180
+ args: [{
2181
+ template: ''
2182
+ }]
2183
+ }], ctorParameters: function () { return []; }, propDecorators: { formGroup: [{
2184
+ type: Input
2185
+ }], formSubmitted: [{
2186
+ type: Input
2187
+ }] } });
2188
+
2189
+ /*
2190
+ <file>
2191
+ Project:
2192
+ @osovitny/anatoly
2193
+
2194
+ Authors:
2195
+ Vadim Osovitny
2196
+ Anatoly Osovitny
2197
+
2198
+ Created:
2199
+ 24 Jan 2022
2200
+
2201
+ Version:
2202
+ 1.0
2203
+
2204
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2205
+ </file>
2206
+ */
2207
+ class BaseDialog extends BaseEditComponent {
2208
+ constructor() {
2209
+ super();
2210
+ this._opened = false;
2211
+ }
2212
+ get opened() {
2213
+ return this._opened;
2214
+ }
2215
+ open() {
2216
+ this._opened = true;
2217
+ }
2218
+ close() {
2219
+ this._opened = false;
2220
+ }
2221
+ }
2222
+ BaseDialog.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BaseDialog, deps: [], target: i0.ɵɵFactoryTarget.Component });
2223
+ BaseDialog.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: BaseDialog, selector: "ng-component", inputs: { opened: "opened" }, usesInheritance: true, ngImport: i0, template: '', isInline: true });
2224
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BaseDialog, decorators: [{
2225
+ type: Component,
2226
+ args: [{
2227
+ template: ''
2228
+ }]
2229
+ }], ctorParameters: function () { return []; }, propDecorators: { opened: [{
2230
+ type: Input
2231
+ }] } });
2232
+
2233
+ /*
2234
+ <file>
2235
+ Project:
2236
+ @osovitny/anatoly
2237
+
2238
+ Authors:
2239
+ Vadim Osovitny
2240
+ Anatoly Osovitny
2241
+
2242
+ Created:
2243
+ 4 Jul 2018
2244
+
2245
+ Version:
2246
+ 1.0
2247
+
2248
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2249
+ </file>
2250
+ */
2251
+ class SignUpButtonComponent {
2252
+ }
2253
+ SignUpButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: SignUpButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2254
+ SignUpButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: SignUpButtonComponent, selector: "anatoly-signup-button", inputs: { classbtn: "classbtn" }, ngImport: i0, template: "<a href=\"identity/signup\" class=\"{{classbtn}}\">Sign Up</a>\r\n" });
2255
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: SignUpButtonComponent, decorators: [{
2256
+ type: Component,
2257
+ args: [{ selector: "anatoly-signup-button", template: "<a href=\"identity/signup\" class=\"{{classbtn}}\">Sign Up</a>\r\n" }]
2258
+ }], propDecorators: { classbtn: [{
2259
+ type: Input
2260
+ }] } });
2261
+
2262
+ /*
2263
+ <file>
2264
+ Project:
2265
+ @osovitny/anatoly
2266
+
2267
+ Authors:
2268
+ Vadim Osovitny
2269
+ Anatoly Osovitny
2270
+
2271
+ Created:
2272
+ 14 Aug 2018
2273
+
2274
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2275
+ </file>
2276
+ */
2277
+ class BuyAccessButtonComponent {
2278
+ constructor(appContext, api) {
2279
+ this.appContext = appContext;
2280
+ this.api = api;
2281
+ this.contextUpdated = false;
2282
+ this.isUserSignedIn = false;
2283
+ this.currentPlan = 0;
2284
+ this.currentPlanTitle = '';
2285
+ }
2286
+ ngOnInit() {
2287
+ if (!this.appContext.isUserSignedIn()) {
2288
+ this.contextUpdated = true;
2289
+ return;
2290
+ }
2291
+ this.appContext.getCurrent((current) => {
2292
+ this.isUserSignedIn = current.isUserSignedIn;
2293
+ if (this.isUserSignedIn) {
2294
+ this.currentPlan = current.account.billingPlan;
2295
+ this.currentPlanTitle = current.account.billingPlanAsString;
2296
+ }
2297
+ this.contextUpdated = true;
2298
+ });
2299
+ }
2300
+ onBuyPlan() {
2301
+ const text = `Requested plan: ${this.plantitle} `;
2302
+ const that = this;
2303
+ Alerts$1.areYouSure(text, 'Buying access', 'Confirm change', 'Cancel', () => {
2304
+ that.api.buyAccess(that.plan, () => {
2305
+ Alerts$1.success('Access Granted', null, null, () => {
2306
+ window.location.reload();
2307
+ });
2308
+ });
2309
+ });
2310
+ }
2311
+ }
2312
+ BuyAccessButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BuyAccessButtonComponent, deps: [{ token: i1$5.AppContextService }, { token: i2.BillingApiService }], target: i0.ɵɵFactoryTarget.Component });
2313
+ BuyAccessButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: BuyAccessButtonComponent, selector: "anatoly-buyaccess-button", inputs: { plan: "plan", plantitle: "plantitle" }, ngImport: i0, template: "<div *ngIf=\"contextUpdated\">\r\n <div *ngIf=\"!isUserSignedIn\">\r\n <anatoly-signup-button classbtn=\"btn btn-block btn-primary\"></anatoly-signup-button>\r\n </div>\r\n\r\n <div *ngIf=\"isUserSignedIn\">\r\n <button class=\"btn btn-block btn-success selectPlan\" *ngIf=\"plan == currentPlan\">\r\n Your Plan\r\n </button>\r\n\r\n <button class=\"btn btn-block btn-warning selectPlan\" *ngIf=\"plan != currentPlan && currentPlan == 1\" (click)=\"onBuyPlan()\">\r\n Buy Now\r\n </button>\r\n </div>\r\n</div>\r\n", dependencies: [{ kind: "directive", type: i1$6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: SignUpButtonComponent, selector: "anatoly-signup-button", inputs: ["classbtn"] }] });
2314
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BuyAccessButtonComponent, decorators: [{
2315
+ type: Component,
2316
+ args: [{ selector: 'anatoly-buyaccess-button', template: "<div *ngIf=\"contextUpdated\">\r\n <div *ngIf=\"!isUserSignedIn\">\r\n <anatoly-signup-button classbtn=\"btn btn-block btn-primary\"></anatoly-signup-button>\r\n </div>\r\n\r\n <div *ngIf=\"isUserSignedIn\">\r\n <button class=\"btn btn-block btn-success selectPlan\" *ngIf=\"plan == currentPlan\">\r\n Your Plan\r\n </button>\r\n\r\n <button class=\"btn btn-block btn-warning selectPlan\" *ngIf=\"plan != currentPlan && currentPlan == 1\" (click)=\"onBuyPlan()\">\r\n Buy Now\r\n </button>\r\n </div>\r\n</div>\r\n" }]
2317
+ }], ctorParameters: function () { return [{ type: i1$5.AppContextService }, { type: i2.BillingApiService }]; }, propDecorators: { plan: [{
2318
+ type: Input
2319
+ }], plantitle: [{
2320
+ type: Input
2321
+ }] } });
2322
+
2323
+ /*
2324
+ <file>
2325
+ Project:
2326
+ @osovitny/anatoly
2327
+
2328
+ Authors:
2329
+ Vadim Osovitny
2330
+ Anatoly Osovitny
2331
+
2332
+ Created:
2333
+ 12 Nov 2017
2334
+
2335
+ Version:
2336
+ 1.0
2337
+
2338
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2339
+ </file>
2340
+ */
2341
+ class UpgradePlanButtonComponent {
2342
+ constructor(api) {
2343
+ this.api = api;
2344
+ }
2345
+ onUpgradePlan() {
2346
+ const text = `Current plan: ${this.currentplantitle} New plan: ${this.requestedplantitle}`;
2347
+ const that = this;
2348
+ Alerts$1.areYouSure(text, 'Change billing plan', 'Confirm change', 'Cancel', () => {
2349
+ that.api.requestNewSubscription(that.requestedplan, () => {
2350
+ Alerts$1.success('Your request for changing plan has been sent.', null, null, () => {
2351
+ window.location.reload();
2352
+ });
2353
+ });
2354
+ });
2355
+ }
2356
+ }
2357
+ UpgradePlanButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: UpgradePlanButtonComponent, deps: [{ token: i2.BillingApiService }], target: i0.ɵɵFactoryTarget.Component });
2358
+ UpgradePlanButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: UpgradePlanButtonComponent, selector: "anatoly-upgrade-plan-button", inputs: { currentplantitle: "currentplantitle", requestedplan: "requestedplan", requestedplantitle: "requestedplantitle" }, ngImport: i0, template: "<button class=\"btn btn-block btn-primary\" (click)=\"onUpgradePlan()\">\r\n Upgrade\r\n</button>\r\n" });
2359
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: UpgradePlanButtonComponent, decorators: [{
2360
+ type: Component,
2361
+ args: [{ selector: 'anatoly-upgrade-plan-button', template: "<button class=\"btn btn-block btn-primary\" (click)=\"onUpgradePlan()\">\r\n Upgrade\r\n</button>\r\n" }]
2362
+ }], ctorParameters: function () { return [{ type: i2.BillingApiService }]; }, propDecorators: { currentplantitle: [{
2363
+ type: Input
2364
+ }], requestedplan: [{
2365
+ type: Input
2366
+ }], requestedplantitle: [{
2367
+ type: Input
2368
+ }] } });
2369
+
2370
+ /*
2371
+ <file>
2372
+ Project:
2373
+ @osovitny/anatoly
2374
+
2375
+ Authors:
2376
+ Vadim Osovitny
2377
+ Anatoly Osovitny
2378
+
2379
+ Created:
2380
+ 1 Jun 2018
2381
+
2382
+ Version:
2383
+ 1.0
2384
+
2385
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2386
+ </file>
2387
+ */
2388
+ class SubscribePlanButtonComponent {
2389
+ constructor(appcontext) {
2390
+ this.appcontext = appcontext;
2391
+ this.contextUpdated = false;
2392
+ this.isUserSignedIn = false;
2393
+ this.currentPlan = 0;
2394
+ this.currentPlanTitle = "";
2395
+ this.requestedPlan = 0;
2396
+ this.requestedPlanTitle = "";
2397
+ }
2398
+ ngOnInit() {
2399
+ if (!this.appcontext.isUserSignedIn()) {
2400
+ this.contextUpdated = true;
2401
+ return;
2402
+ }
2403
+ this.appcontext.getCurrent((current) => {
2404
+ this.isUserSignedIn = current.isUserSignedIn;
2405
+ if (this.isUserSignedIn) {
2406
+ this.currentPlan = current.account.billingPlan;
2407
+ this.currentPlanTitle = current.account.billingPlanAsString;
2408
+ this.requestedPlan = current.account.requestedBillingPlan;
2409
+ this.requestedPlanTitle = current.account.requestedBillingPlanAsString;
2410
+ }
2411
+ this.contextUpdated = true;
2412
+ });
2413
+ }
2414
+ }
2415
+ SubscribePlanButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: SubscribePlanButtonComponent, deps: [{ token: i1$5.AppContextService }], target: i0.ɵɵFactoryTarget.Component });
2416
+ SubscribePlanButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: SubscribePlanButtonComponent, selector: "anatoly-subscribe-plan-button", inputs: { plan: "plan", plantitle: "plantitle" }, ngImport: i0, template: "<div *ngIf=\"contextUpdated\">\r\n <div *ngIf=\"!isUserSignedIn\">\r\n <anatoly-signup-button classbtn=\"btn btn-block btn-primary\"></anatoly-signup-button>\r\n </div>\r\n\r\n <div *ngIf=\"isUserSignedIn\">\r\n <button class=\"btn btn-block btn-success selectPlan\" *ngIf=\"plan == currentPlan\">\r\n Your Plan\r\n </button>\r\n\r\n <button class=\"btn btn-block btn-warning selectPlan\" *ngIf=\"requestedPlan != null && requestedPlan != 0 && plan == requestedPlan\">\r\n Requested\r\n </button>\r\n\r\n <anatoly-upgrade-plan-button *ngIf=\"plan != currentPlan && plan != requestedPlan\"\r\n [currentplantitle]=\"currentPlanTitle\"\r\n [requestedplan]=plan\r\n [requestedplantitle]=\"plantitle\">\r\n </anatoly-upgrade-plan-button>\r\n </div>\r\n</div>\r\n", dependencies: [{ kind: "directive", type: i1$6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: UpgradePlanButtonComponent, selector: "anatoly-upgrade-plan-button", inputs: ["currentplantitle", "requestedplan", "requestedplantitle"] }, { kind: "component", type: SignUpButtonComponent, selector: "anatoly-signup-button", inputs: ["classbtn"] }] });
2417
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: SubscribePlanButtonComponent, decorators: [{
2418
+ type: Component,
2419
+ args: [{ selector: "anatoly-subscribe-plan-button", template: "<div *ngIf=\"contextUpdated\">\r\n <div *ngIf=\"!isUserSignedIn\">\r\n <anatoly-signup-button classbtn=\"btn btn-block btn-primary\"></anatoly-signup-button>\r\n </div>\r\n\r\n <div *ngIf=\"isUserSignedIn\">\r\n <button class=\"btn btn-block btn-success selectPlan\" *ngIf=\"plan == currentPlan\">\r\n Your Plan\r\n </button>\r\n\r\n <button class=\"btn btn-block btn-warning selectPlan\" *ngIf=\"requestedPlan != null && requestedPlan != 0 && plan == requestedPlan\">\r\n Requested\r\n </button>\r\n\r\n <anatoly-upgrade-plan-button *ngIf=\"plan != currentPlan && plan != requestedPlan\"\r\n [currentplantitle]=\"currentPlanTitle\"\r\n [requestedplan]=plan\r\n [requestedplantitle]=\"plantitle\">\r\n </anatoly-upgrade-plan-button>\r\n </div>\r\n</div>\r\n" }]
2420
+ }], ctorParameters: function () { return [{ type: i1$5.AppContextService }]; }, propDecorators: { plan: [{
2421
+ type: Input
2422
+ }], plantitle: [{
2423
+ type: Input
2424
+ }] } });
2425
+
2426
+ /*
2427
+ <file>
2428
+ Project:
2429
+ @osovitny/anatoly
2430
+
2431
+ Authors:
2432
+ Vadim Osovitny
2433
+ Anatoly Osovitny
2434
+
2435
+ Created:
2436
+ 23 Apr 2018
2437
+
2438
+ Version:
2439
+ 1.0
2440
+
2441
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2442
+ </file>
2443
+ */
2444
+ class ContentHeaderComponent {
2445
+ ngOnInit() {
2446
+ if (this.title == null) {
2447
+ this.title = "";
2448
+ }
2449
+ }
2450
+ }
2451
+ ContentHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ContentHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2452
+ ContentHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: ContentHeaderComponent, selector: "anatoly-content-header", inputs: { title: "title" }, ngImport: i0, template: "<h2 class=\"page-header\">\r\n {{title}}\r\n <!--<small>Optional {{title}}</small>-->\r\n</h2>\r\n" });
2453
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ContentHeaderComponent, decorators: [{
2454
+ type: Component,
2455
+ args: [{ selector: "anatoly-content-header", template: "<h2 class=\"page-header\">\r\n {{title}}\r\n <!--<small>Optional {{title}}</small>-->\r\n</h2>\r\n" }]
2456
+ }], propDecorators: { title: [{
2457
+ type: Input
2458
+ }] } });
2459
+
2460
+ /*
2461
+ <file>
2462
+ Project:
2463
+ @osovitny/anatoly
2464
+
2465
+ Authors:
2466
+ Vadim Osovitny
2467
+ Anatoly Osovitny
2468
+
2469
+ Created:
2470
+ 12 Dec 2017
2471
+
2472
+ Version:
2473
+ 1.0
2474
+
2475
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2476
+ </file>
2477
+ */
2478
+ const DefaultEditorOptions = {
2479
+ placeholderText: "Edit Your Content Here",
2480
+ charCounterCount: true,
2481
+ heightMin: 100,
2482
+ toolbarInline: false,
2483
+ toolbarButtons: {
2484
+ moreText: {
2485
+ buttons: [
2486
+ "bold",
2487
+ "italic",
2488
+ "underline",
2489
+ "strikeThrough",
2490
+ "subscript",
2491
+ "superscript",
2492
+ "fontFamily",
2493
+ "fontSize",
2494
+ "textColor",
2495
+ "backgroundColor",
2496
+ "inlineClass",
2497
+ "inlineStyle",
2498
+ ],
2499
+ },
2500
+ moreParagraph: {
2501
+ buttons: [
2502
+ "alignLeft",
2503
+ "alignCenter",
2504
+ "formatOLSimple",
2505
+ "alignRight",
2506
+ "alignJustify",
2507
+ "formatOL",
2508
+ "formatUL",
2509
+ "paragraphFormat",
2510
+ "paragraphStyle",
2511
+ "lineHeight",
2512
+ "outdent",
2513
+ "indent",
2514
+ "quote",
2515
+ ],
2516
+ },
2517
+ moreRich: {
2518
+ buttons: [
2519
+ "insertLink",
2520
+ "insertImage",
2521
+ "insertTable",
2522
+ "emoticons",
2523
+ "fontAwesome",
2524
+ "specialCharacters",
2525
+ "embedly",
2526
+ ],
2527
+ },
2528
+ moreMisc: {
2529
+ buttons: [
2530
+ "selectAll",
2531
+ "clearFormatting",
2532
+ "html",
2533
+ "undo",
2534
+ "redo",
2535
+ "fullscreen",
2536
+ ],
2537
+ align: "right",
2538
+ },
2539
+ },
2540
+ /*
2541
+ Upload:
2542
+ https://www.froala.com/wysiwyg-editor/docs/concepts/image/upload
2543
+ */
2544
+ imageUploadURL: "/api/htmlEditor/uploadImage",
2545
+ imageAllowedTypes: ["jpeg", "jpg", "png"],
2546
+ imageUploadParams: { uploadType: "", uploadParentId: "" },
2547
+ };
2548
+
2549
+ /*
2550
+ <file>
2551
+ Project:
2552
+ @osovitny/anatoly
2553
+
2554
+ Authors:
2555
+ Vadim Osovitny
2556
+ Anatoly Osovitny
2557
+
2558
+ Created:
2559
+ 12 Dec 2017
2560
+
2561
+ Version:
2562
+ 1.0
2563
+
2564
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2565
+ </file>
2566
+ */
2567
+ class BaseHtmlEditorComponent extends BaseEditComponent {
2568
+ constructor() {
2569
+ super();
2570
+ this.froalaEditorInitialized = false;
2571
+ this.afterInitializedActions = [];
2572
+ // Inputs
2573
+ this.editorLabelText = "Html";
2574
+ this.editorOptions = {};
2575
+ }
2576
+ ngOnInit() {
2577
+ let opt = this.editorOptions;
2578
+ if (typeof this.editorOptions == "string") {
2579
+ opt = JSON.parse(this.editorOptions);
2580
+ }
2581
+ let newOptions = $.extend({}, DefaultEditorOptions, opt);
2582
+ const key = AppCoreSettings$1.froalaEditorKey;
2583
+ if (key) {
2584
+ newOptions = $.extend({}, newOptions, JSON.parse('{ "key": "' + key + '" }'));
2585
+ }
2586
+ if (newOptions.events && newOptions.events.initialized) {
2587
+ newOptions.events.initialized.overridden = false;
2588
+ }
2589
+ this.options = newOptions;
2590
+ }
2591
+ ngAfterViewInit() {
2592
+ const that = this;
2593
+ setTimeout(function () {
2594
+ that.froalaEditorInitialized = true;
2595
+ that.onInitialized();
2596
+ }, 300);
2597
+ }
2598
+ onInitialized() {
2599
+ let actions = this.afterInitializedActions;
2600
+ // Clear actions
2601
+ this.afterInitializedActions = [];
2602
+ if (actions) {
2603
+ for (let i = 0; i < actions.length; i++) {
2604
+ actions[i]();
2605
+ }
2606
+ }
2607
+ }
2608
+ getEditor() {
2609
+ if (this.froalaEditor)
2610
+ return this.froalaEditor.getEditor();
2611
+ return null;
2612
+ }
2613
+ // Public Funcs
2614
+ doAfterInitialized(action) {
2615
+ const that = this;
2616
+ if (!this.froalaEditorInitialized) {
2617
+ this.afterInitializedActions.push(() => {
2618
+ action(that);
2619
+ });
2620
+ }
2621
+ else {
2622
+ action(that);
2623
+ }
2624
+ }
2625
+ initializeControl(control) {
2626
+ this.froalaEditor = control;
2627
+ this.froalaEditor.initialize();
2628
+ }
2629
+ setUploadParams(uploadType, uploadParentId) {
2630
+ this.doAfterInitialized(function (that) {
2631
+ const editor = that.getEditor();
2632
+ if (typeof editor == "undefined" || editor == null) {
2633
+ return;
2634
+ }
2635
+ editor.opts.imageUploadParams.uploadType = uploadType;
2636
+ editor.opts.imageUploadParams.uploadParentId = uploadParentId;
2637
+ });
2638
+ }
2639
+ }
2640
+ BaseHtmlEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BaseHtmlEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2641
+ BaseHtmlEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: BaseHtmlEditorComponent, selector: "ng-component", inputs: { editorLabelText: "editorLabelText", editorOptions: "editorOptions" }, usesInheritance: true, ngImport: i0, template: "", isInline: true });
2642
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: BaseHtmlEditorComponent, decorators: [{
2643
+ type: Component,
2644
+ args: [{
2645
+ template: "",
2646
+ }]
2647
+ }], ctorParameters: function () { return []; }, propDecorators: { editorLabelText: [{
2648
+ type: Input
2649
+ }], editorOptions: [{
2650
+ type: Input
2651
+ }] } });
2652
+
2653
+ /*
2654
+ <file>
2655
+ Project:
2656
+ @osovitny/anatoly
2657
+
2658
+ Authors:
2659
+ Vadim Osovitny
2660
+ Anatoly Osovitny
2661
+
2662
+ Created:
2663
+ 28 Jun 2020
2664
+
2665
+ Version:
2666
+ 1.0
2667
+
2668
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2669
+ </file>
2670
+ */
2671
+ class NativeElementDirective {
2672
+ constructor(el, control) {
2673
+ this.el = el;
2674
+ this.control = control;
2675
+ }
2676
+ ngOnInit() {
2677
+ // sets the localization key to the control
2678
+ this.control.control.nativeElement = this.el.nativeElement;
2679
+ }
2680
+ }
2681
+ NativeElementDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: NativeElementDirective, deps: [{ token: i0.ElementRef }, { token: i1$7.NgControl }], target: i0.ɵɵFactoryTarget.Directive });
2682
+ NativeElementDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.6", type: NativeElementDirective, selector: "[formControl], [formControlName]", ngImport: i0 });
2683
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: NativeElementDirective, decorators: [{
2684
+ type: Directive,
2685
+ args: [{
2686
+ selector: '[formControl], [formControlName]'
2687
+ }]
2688
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1$7.NgControl }]; } });
2689
+
2690
+ /*
2691
+ <file>
2692
+ Project:
2693
+ @osovitny/anatoly
2694
+
2695
+ Authors:
2696
+ Vadim Osovitny
2697
+ Anatoly Osovitny
2698
+
2699
+ Created:
2700
+ 8 Dec 2017
2701
+
2702
+ Version:
2703
+ 1.0
2704
+
2705
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2706
+ </file>
2707
+ */
2708
+ class ValidationSummaryComponent extends BaseEditComponent {
2709
+ constructor() {
2710
+ super();
2711
+ }
2712
+ getFormValidationMessages() {
2713
+ let messages = [];
2714
+ Object.keys(this.formGroup.controls).forEach((k) => {
2715
+ var control = this.formGroup.controls[k];
2716
+ if (control.controls != null) {
2717
+ Object.keys(control.controls).forEach((k) => {
2718
+ var child = control.controls[k];
2719
+ this.getValidationMessages(child, this.getControlName(child, k)).forEach((m) => messages.push(m));
2720
+ });
2721
+ }
2722
+ else {
2723
+ this.getValidationMessages(control, this.getControlName(control, k)).forEach((m) => messages.push(m));
2724
+ }
2725
+ });
2726
+ return messages;
2727
+ }
2728
+ getValidationMessages(state, thingName) {
2729
+ let thing = state.path || thingName;
2730
+ let messages = [];
2731
+ if (state.errors) {
2732
+ for (let errorName in state.errors) {
2733
+ if (state.errors.hasOwnProperty(errorName)) {
2734
+ switch (errorName) {
2735
+ case "required":
2736
+ messages.push(`${thing} is required`);
2737
+ break;
2738
+ case "minlength":
2739
+ messages.push(`${thing} must be at least ${state.errors["minlength"].requiredLength} characters`);
2740
+ break;
2741
+ case "pattern":
2742
+ messages.push(`${thing} contains illegal characters`);
2743
+ break;
2744
+ case "format":
2745
+ messages.push(`${thing} format mismatch`);
2746
+ break;
2747
+ case "maxlength":
2748
+ messages.push(`${thing} must have maximum ${state.errors["maxlength"].requiredLength} characters`);
2749
+ break;
2750
+ case "specialcharacters":
2751
+ messages.push(`${thing} contains special characters`);
2752
+ break;
2753
+ }
2754
+ }
2755
+ }
2756
+ }
2757
+ return messages;
2758
+ }
2759
+ /**
2760
+ * Get Control Name
2761
+ * @param control
2762
+ * @param thingName
2763
+ */
2764
+ getControlName(control, thingName) {
2765
+ let value = this.getControlTitle(control);
2766
+ return value ? value : thingName;
2767
+ }
2768
+ /**
2769
+ * Retrieve tilte of control
2770
+ * @param control
2771
+ */
2772
+ getControlTitle(control) {
2773
+ if (control?.nativeElement) {
2774
+ let controlTitle = this.getTitleAttribute(control.nativeElement);
2775
+ if (controlTitle) {
2776
+ return controlTitle;
2777
+ }
2778
+ }
2779
+ return undefined;
2780
+ }
2781
+ /**
2782
+ * Return title attribute of form control
2783
+ */
2784
+ getTitleAttribute(nativeElement) {
2785
+ let title;
2786
+ switch (nativeElement.tagName) {
2787
+ // For Kendo time and date picker element title is assigned to the 4th child control.
2788
+ case "KENDO-TIMEPICKER":
2789
+ case "KENDO-DATEPICKER":
2790
+ title =
2791
+ nativeElement.children[0]?.children[0]?.children[0]?.children[0]?.getAttribute("title");
2792
+ break;
2793
+ // For Kendo numaric element title is assigned to the 2nd child control.
2794
+ case "KENDO-NUMERICTEXTBOX":
2795
+ title = nativeElement.children[0]?.children[0]?.getAttribute("title");
2796
+ break;
2797
+ default:
2798
+ title = nativeElement.getAttribute("title");
2799
+ break;
2800
+ }
2801
+ return title;
2802
+ }
2803
+ }
2804
+ ValidationSummaryComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ValidationSummaryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2805
+ ValidationSummaryComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: ValidationSummaryComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: "", isInline: true });
2806
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ValidationSummaryComponent, decorators: [{
2807
+ type: Component,
2808
+ args: [{
2809
+ template: "",
2810
+ }]
2811
+ }], ctorParameters: function () { return []; } });
2812
+
2813
+ /*
2814
+ <file>
2815
+ Project:
2816
+ @osovitny/anatoly
2817
+
2818
+ Authors:
2819
+ Vadim Osovitny
2820
+ Anatoly Osovitny
2821
+
2822
+ Created:
2823
+ 6 Dec 2017
2824
+
2825
+ Version:
2826
+ 1.0
2827
+
2828
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2829
+ </file>
2830
+ */
2831
+ class ItemValidationSummaryComponent extends ValidationSummaryComponent {
2832
+ constructor() {
2833
+ super();
2834
+ }
2835
+ }
2836
+ ItemValidationSummaryComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ItemValidationSummaryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2837
+ ItemValidationSummaryComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: ItemValidationSummaryComponent, selector: "anatoly-item-validation-summary", inputs: { controlName: "controlName", controlTitle: "controlTitle" }, usesInheritance: true, ngImport: i0, template: "<ul class=\"list-unstyled\" *ngIf=\"isControlInvalid(controlName)\">\r\n <li *ngFor=\"let error of getValidationMessages(formGroup.get(controlName), controlTitle)\">\r\n <span class=\"help-block\">{{ error }}</span>\r\n </li>\r\n</ul>\r\n\r\n", dependencies: [{ kind: "directive", type: i1$6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
2838
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ItemValidationSummaryComponent, decorators: [{
2839
+ type: Component,
2840
+ args: [{ selector: "anatoly-item-validation-summary", template: "<ul class=\"list-unstyled\" *ngIf=\"isControlInvalid(controlName)\">\r\n <li *ngFor=\"let error of getValidationMessages(formGroup.get(controlName), controlTitle)\">\r\n <span class=\"help-block\">{{ error }}</span>\r\n </li>\r\n</ul>\r\n\r\n" }]
2841
+ }], ctorParameters: function () { return []; }, propDecorators: { controlName: [{
2842
+ type: Input
2843
+ }], controlTitle: [{
2844
+ type: Input
2845
+ }] } });
2846
+
2847
+ /*
2848
+ <file>
2849
+ Project:
2850
+ @osovitny/anatoly
2851
+
2852
+ Authors:
2853
+ Vadim Osovitny
2854
+ Anatoly Osovitny
2855
+
2856
+ Created:
2857
+ 12 Dec 2017
2858
+
2859
+ Version:
2860
+ 1.0
2861
+
2862
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2863
+ </file>
2864
+ */
2865
+ class FormsHtmlEditorComponent extends BaseHtmlEditorComponent {
2866
+ constructor() {
2867
+ super();
2868
+ this.editorFormKey = "html";
2869
+ }
2870
+ setFormValueAfterInitialized(name, value) {
2871
+ this.doAfterInitialized(function (that) {
2872
+ that.setFormValue(name, value);
2873
+ });
2874
+ }
2875
+ }
2876
+ FormsHtmlEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: FormsHtmlEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2877
+ FormsHtmlEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: FormsHtmlEditorComponent, selector: "anatoly-forms-html-editor", inputs: { editorFormKey: "editorFormKey" }, usesInheritance: true, ngImport: i0, template: "<div [formGroup]=\"formGroup\">\r\n <div class=\"form-group\" [ngClass]=\"{'has-error': isControlInvalid(editorFormKey) }\">\r\n <label class=\"control-label\">{{ editorLabelText }}</label>\r\n <textarea [formControlName]=\"editorFormKey\"\r\n [froalaEditor]=\"options\" (froalaInit)=\"initializeControl($event)\">\r\n </textarea>\r\n <anatoly-item-validation-summary [formGroup]=\"formGroup\"\r\n [formSubmitted]=\"formSubmitted\"\r\n [controlName]=\"editorFormKey\"\r\n [controlTitle]=\"editorLabelText\">\r\n </anatoly-item-validation-summary>\r\n </div>\r\n</div>\r\n", dependencies: [{ kind: "directive", type: i1$6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$7.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: i1$7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$7.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$7.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$7.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1$8.FroalaEditorDirective, selector: "[froalaEditor]", inputs: ["froalaEditor", "froalaModel"], outputs: ["froalaModelChange", "froalaInit"], exportAs: ["froalaEditor"] }, { kind: "directive", type: NativeElementDirective, selector: "[formControl], [formControlName]" }, { kind: "component", type: ItemValidationSummaryComponent, selector: "anatoly-item-validation-summary", inputs: ["controlName", "controlTitle"] }] });
2878
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: FormsHtmlEditorComponent, decorators: [{
2879
+ type: Component,
2880
+ args: [{ selector: "anatoly-forms-html-editor", template: "<div [formGroup]=\"formGroup\">\r\n <div class=\"form-group\" [ngClass]=\"{'has-error': isControlInvalid(editorFormKey) }\">\r\n <label class=\"control-label\">{{ editorLabelText }}</label>\r\n <textarea [formControlName]=\"editorFormKey\"\r\n [froalaEditor]=\"options\" (froalaInit)=\"initializeControl($event)\">\r\n </textarea>\r\n <anatoly-item-validation-summary [formGroup]=\"formGroup\"\r\n [formSubmitted]=\"formSubmitted\"\r\n [controlName]=\"editorFormKey\"\r\n [controlTitle]=\"editorLabelText\">\r\n </anatoly-item-validation-summary>\r\n </div>\r\n</div>\r\n" }]
2881
+ }], ctorParameters: function () { return []; }, propDecorators: { editorFormKey: [{
2882
+ type: Input
2883
+ }] } });
2884
+
2885
+ /*
2886
+ <file>
2887
+ Project:
2888
+ @osovitny/anatoly
2889
+
2890
+ Authors:
2891
+ Vadim Osovitny
2892
+ Anatoly Osovitny
2893
+
2894
+ Created:
2895
+ 12 Dec 2017
2896
+
2897
+ Version:
2898
+ 1.0
2899
+
2900
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2901
+ </file>
2902
+ */
2903
+ class HtmlEditorComponent extends BaseHtmlEditorComponent {
2904
+ constructor() {
2905
+ super();
2906
+ }
2907
+ setHtml(content) {
2908
+ this.doAfterInitialized(function (that) {
2909
+ var editor = that.getEditor();
2910
+ if (typeof editor == "undefined" || editor == null) {
2911
+ return;
2912
+ }
2913
+ editor.html.set(content);
2914
+ });
2915
+ }
2916
+ getHtml() {
2917
+ var editor = this.getEditor();
2918
+ if (typeof editor == "undefined" || editor == null) {
2919
+ return;
2920
+ }
2921
+ return editor.html.get(false);
2922
+ }
2923
+ }
2924
+ HtmlEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: HtmlEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2925
+ HtmlEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: HtmlEditorComponent, selector: "anatoly-html-editor", usesInheritance: true, ngImport: i0, template: "<div>\r\n <label>{{ editorLabelText }}</label>\r\n <textarea [froalaEditor]=\"options\" (froalaInit)=\"initializeControl($event)\">\r\n </textarea>\r\n</div>", dependencies: [{ kind: "directive", type: i1$8.FroalaEditorDirective, selector: "[froalaEditor]", inputs: ["froalaEditor", "froalaModel"], outputs: ["froalaModelChange", "froalaInit"], exportAs: ["froalaEditor"] }] });
2926
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: HtmlEditorComponent, decorators: [{
2927
+ type: Component,
2928
+ args: [{ selector: "anatoly-html-editor", template: "<div>\r\n <label>{{ editorLabelText }}</label>\r\n <textarea [froalaEditor]=\"options\" (froalaInit)=\"initializeControl($event)\">\r\n </textarea>\r\n</div>" }]
2929
+ }], ctorParameters: function () { return []; } });
2930
+
2931
+ /*
2932
+ <file>
2933
+ Project:
2934
+ @osovitny/anatoly
2935
+
2936
+ Authors:
2937
+ Vadim Osovitny
2938
+ Anatoly Osovitny
2939
+
2940
+ Created:
2941
+ 4 Jul 2018
2942
+
2943
+ Version:
2944
+ 1.0
2945
+
2946
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2947
+ </file>
2948
+ */
2949
+ class SignInButtonComponent {
2950
+ constructor() { }
2951
+ }
2952
+ SignInButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: SignInButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2953
+ SignInButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: SignInButtonComponent, selector: "anatoly-signin-button", inputs: { classbtn: "classbtn" }, ngImport: i0, template: "<a href=\"identity/signIn\" class=\"{{classbtn}}\">Sign In</a>\r\n" });
2954
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: SignInButtonComponent, decorators: [{
2955
+ type: Component,
2956
+ args: [{ selector: "anatoly-signin-button", template: "<a href=\"identity/signIn\" class=\"{{classbtn}}\">Sign In</a>\r\n" }]
2957
+ }], ctorParameters: function () { return []; }, propDecorators: { classbtn: [{
2958
+ type: Input
2959
+ }] } });
2960
+
2961
+ /*
2962
+ <file>
2963
+ Project:
2964
+ @osovitny/anatoly
2965
+
2966
+ Authors:
2967
+ Vadim Osovitny
2968
+ Anatoly Osovitny
2969
+
2970
+ Created:
2971
+ 4 Jul 2018
2972
+
2973
+ Version:
2974
+ 1.0
2975
+
2976
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2977
+ </file>
2978
+ */
2979
+ class SignOutButtonComponent {
2980
+ constructor() { }
2981
+ }
2982
+ SignOutButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: SignOutButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2983
+ SignOutButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: SignOutButtonComponent, selector: "anatoly-signout-button", inputs: { classbtn: "classbtn" }, ngImport: i0, template: "<a href=\"identity/signOut\" class=\"{{classbtn}}\">Sign Out</a>\r\n" });
2984
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: SignOutButtonComponent, decorators: [{
2985
+ type: Component,
2986
+ args: [{ selector: "anatoly-signout-button", template: "<a href=\"identity/signOut\" class=\"{{classbtn}}\">Sign Out</a>\r\n" }]
2987
+ }], ctorParameters: function () { return []; }, propDecorators: { classbtn: [{
2988
+ type: Input
2989
+ }] } });
2990
+
2991
+ /*
2992
+ <file>
2993
+ Project:
2994
+ @osovitny/anatoly
2995
+
2996
+ Authors:
2997
+ Vadim Osovitny
2998
+ Anatoly Osovitny
2999
+
3000
+ Created:
3001
+ 9 May 2020
3002
+
3003
+ Version:
3004
+ 1.0
3005
+
3006
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
3007
+ </file>
3008
+ */
3009
+ class LoadingComponent {
3010
+ constructor(loadingService) {
3011
+ this.loadingService = loadingService;
3012
+ // Private
3013
+ this.subs = new Subs$1();
3014
+ // Public
3015
+ this.show = false;
3016
+ }
3017
+ ngOnInit() {
3018
+ this.subs.sink = this.loadingService.subscribe((state) => {
3019
+ this.show = state;
3020
+ });
3021
+ }
3022
+ ngOnDestroy() {
3023
+ this.subs.unsubscribe();
3024
+ }
3025
+ }
3026
+ LoadingComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: LoadingComponent, deps: [{ token: i1$9.LoadingService }], target: i0.ɵɵFactoryTarget.Component });
3027
+ LoadingComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: LoadingComponent, selector: "anatoly-loading", ngImport: i0, template: "<div *ngIf=\"show\">\r\n <span id=\"pnlLoading\" class=\"k-icon k-i-loading\"></span>\r\n</div>\r\n", dependencies: [{ kind: "directive", type: i1$6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
3028
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: LoadingComponent, decorators: [{
3029
+ type: Component,
3030
+ args: [{ selector: 'anatoly-loading', template: "<div *ngIf=\"show\">\r\n <span id=\"pnlLoading\" class=\"k-icon k-i-loading\"></span>\r\n</div>\r\n" }]
3031
+ }], ctorParameters: function () { return [{ type: i1$9.LoadingService }]; } });
3032
+
3033
+ /*
3034
+ <file>
3035
+ Project:
3036
+ @osovitny/anatoly
3037
+
3038
+ Authors:
3039
+ Vadim Osovitny
3040
+ Anatoly Osovitny
3041
+
3042
+ Created:
3043
+ 16 May 2020
3044
+
3045
+ Version:
3046
+ 1.0
3047
+
3048
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
3049
+ </file>
3050
+ */
3051
+ const SpinnerSpinKit = {
3052
+ spinnerLine: 'spinner-line-material',
3053
+ // ToDo
3054
+ ChasingDots: 'spinner-chasing-dots',
3055
+ CubeGrid: 'spinner-cube-grid',
3056
+ DoubleBounce: 'spinner-double-bounce',
3057
+ RotatingPlane: 'spinner-rotationg-plane',
3058
+ SpinnerPulse: 'spinner-spinner-pulse',
3059
+ ThreeBounce: 'spinner-three-bounce',
3060
+ WanderingCubes: 'spinner-wandering-cubes',
3061
+ Wave: 'spinner-wave'
3062
+ };
3063
+ class SpinnerComponent {
3064
+ constructor(router, document) {
3065
+ this.router = router;
3066
+ this.document = document;
3067
+ this.isSpinnerVisible = true;
3068
+ this.spinnerSpinKit = SpinnerSpinKit;
3069
+ this.backgroundColor = '#007CB0';
3070
+ this.spinner = SpinnerSpinKit.spinnerLine;
3071
+ this.router.events.subscribe(event => {
3072
+ if (event instanceof NavigationStart) {
3073
+ this.isSpinnerVisible = true;
3074
+ }
3075
+ else if (event instanceof NavigationEnd || event instanceof NavigationCancel || event instanceof NavigationError) {
3076
+ this.isSpinnerVisible = false;
3077
+ }
3078
+ }, () => {
3079
+ this.isSpinnerVisible = false;
3080
+ });
3081
+ }
3082
+ ngOnDestroy() {
3083
+ this.isSpinnerVisible = false;
3084
+ }
3085
+ }
3086
+ SpinnerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: SpinnerComponent, deps: [{ token: i1.Router }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component });
3087
+ SpinnerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: SpinnerComponent, selector: "spinner", inputs: { backgroundColor: "backgroundColor", spinner: "spinner" }, ngImport: i0, template: "<div id=\"spinner-loader\" *ngIf=\"isSpinnerVisible\">\r\n <div class=\"loader-bg\">\r\n <div class=\"spinner-line-material\" [class.colored]=\"!backgroundColor\" *ngIf=\"spinner === spinnerSpinKit.spinnerLine\">\r\n <div class=\"spinner-child spinner-bounce1\" [style.background-color]='backgroundColor'></div>\r\n </div>\r\n </div>\r\n</div>\r\n", dependencies: [{ kind: "directive", type: i1$6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], encapsulation: i0.ViewEncapsulation.None });
3088
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: SpinnerComponent, decorators: [{
3089
+ type: Component,
3090
+ args: [{ selector: 'spinner', encapsulation: ViewEncapsulation.None, template: "<div id=\"spinner-loader\" *ngIf=\"isSpinnerVisible\">\r\n <div class=\"loader-bg\">\r\n <div class=\"spinner-line-material\" [class.colored]=\"!backgroundColor\" *ngIf=\"spinner === spinnerSpinKit.spinnerLine\">\r\n <div class=\"spinner-child spinner-bounce1\" [style.background-color]='backgroundColor'></div>\r\n </div>\r\n </div>\r\n</div>\r\n" }]
3091
+ }], ctorParameters: function () { return [{ type: i1.Router }, { type: Document, decorators: [{
3092
+ type: Inject,
3093
+ args: [DOCUMENT]
3094
+ }] }]; }, propDecorators: { backgroundColor: [{
3095
+ type: Input
3096
+ }], spinner: [{
3097
+ type: Input
3098
+ }] } });
3099
+
3100
+ /*
3101
+ <file>
3102
+ Project:
3103
+ @osovitny/anatoly
3104
+
3105
+ Authors:
3106
+ Vadim Osovitny
3107
+ Anatoly Osovitny
3108
+
3109
+ Created:
3110
+ 7 Dec 2017
3111
+
3112
+ Version:
3113
+ 1.0
3114
+
3115
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
3116
+ </file>
3117
+ */
3118
+ class FormValidationSummaryComponent extends ValidationSummaryComponent {
3119
+ constructor() {
3120
+ super();
3121
+ this.visible = false;
3122
+ this.customerrors = [];
3123
+ /*
3124
+ 0 - only FormValidation messages
3125
+ 1 - only Custom messages
3126
+ 2 - all
3127
+ */
3128
+ this.viewtype = 0;
3129
+ }
3130
+ getErrors() {
3131
+ if (this.viewtype == 1) {
3132
+ return this.customerrors;
3133
+ }
3134
+ let formValidationMessages = this.getFormValidationMessages();
3135
+ if (this.viewtype == 0) {
3136
+ return formValidationMessages;
3137
+ }
3138
+ var messages = [];
3139
+ if (formValidationMessages.length > 0) {
3140
+ messages.push(...formValidationMessages);
3141
+ }
3142
+ if (this.customerrors.length > 0) {
3143
+ messages.push(...this.customerrors);
3144
+ }
3145
+ return messages;
3146
+ }
3147
+ }
3148
+ FormValidationSummaryComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: FormValidationSummaryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3149
+ FormValidationSummaryComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: FormValidationSummaryComponent, selector: "anatoly-form-validation-summary", inputs: { visible: "visible", customerrors: "customerrors", viewtype: "viewtype" }, usesInheritance: true, ngImport: i0, template: "<div class=\"callout callout-danger\" *ngIf=\"visible\">\r\n <h6 class=\"box-title\">There are problems with the form</h6>\r\n <ul>\r\n <li *ngFor=\"let error of getErrors()\"><span>{{error}}</span></li>\r\n </ul>\r\n</div>\r\n\r\n", dependencies: [{ kind: "directive", type: i1$6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
3150
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: FormValidationSummaryComponent, decorators: [{
3151
+ type: Component,
3152
+ args: [{ selector: "anatoly-form-validation-summary", template: "<div class=\"callout callout-danger\" *ngIf=\"visible\">\r\n <h6 class=\"box-title\">There are problems with the form</h6>\r\n <ul>\r\n <li *ngFor=\"let error of getErrors()\"><span>{{error}}</span></li>\r\n </ul>\r\n</div>\r\n\r\n" }]
3153
+ }], ctorParameters: function () { return []; }, propDecorators: { visible: [{
3154
+ type: Input
3155
+ }], customerrors: [{
3156
+ type: Input
3157
+ }], viewtype: [{
3158
+ type: Input
3159
+ }] } });
3160
+
3161
+ /*
3162
+ <file>
3163
+ Project:
3164
+ @osovitny/anatoly
3165
+
3166
+ Authors:
3167
+ Vadim Osovitny
3168
+ Anatoly Osovitny
3169
+
3170
+ Created:
3171
+ 29 June 2020
3172
+
3173
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
3174
+ </file>
3175
+ */
3176
+ class ContactUsForm extends BaseEditComponent$1 {
3177
+ constructor(fb, appContext, api, notificationService) {
3178
+ super();
3179
+ this.fb = fb;
3180
+ this.appContext = appContext;
3181
+ this.api = api;
3182
+ this.notificationService = notificationService;
3183
+ this.isUserSignedIn = false;
3184
+ this.topicList = [
3185
+ { value: 'Billing & Pricing' },
3186
+ { value: 'Legal & Privacy' },
3187
+ { value: 'Repor abuse' },
3188
+ { value: 'Technical Support' },
3189
+ { value: 'Other' }
3190
+ ];
3191
+ //Inputs
3192
+ this.showActionButtons = true;
3193
+ //Outputs
3194
+ this.submit = new EventEmitter();
3195
+ }
3196
+ ngOnInit() {
3197
+ this.createFormGroup();
3198
+ this.init();
3199
+ }
3200
+ createFormGroup() {
3201
+ this.formGroup = this.fb.group({
3202
+ captcha: new FormControl(null, [Validators.required]),
3203
+ name: new FormControl('', [Validators.required]),
3204
+ email: new FormControl('', [Validators.required]),
3205
+ topic: new FormControl('', [Validators.required]),
3206
+ subject: new FormControl('', [Validators.required]),
3207
+ message: new FormControl('', [Validators.required])
3208
+ });
3209
+ }
3210
+ init() {
3211
+ this.appContext.getCurrent(context => {
3212
+ this.isUserSignedIn = context.isUserSignedIn;
3213
+ this.siteKey = context.reCaptchaSiteKey;
3214
+ this.selectedTopic = this.topicList[3].value;
3215
+ this.setFormValue('topic', this.selectedTopic);
3216
+ if (this.isUserSignedIn) {
3217
+ this.setFormValue('name', context.user.displayNameOrFullName);
3218
+ this.setFormValue('email', context.user.email);
3219
+ }
3220
+ }, false);
3221
+ }
3222
+ isValid() {
3223
+ return this.formGroup.valid;
3224
+ }
3225
+ contactUs() {
3226
+ this.formSubmitted = true;
3227
+ if (!this.isValid())
3228
+ return;
3229
+ const captcha = this.getFormValue('captcha');
3230
+ const name = this.getFormValue('name');
3231
+ const email = this.getFormValue('email');
3232
+ const topic = this.selectedTopic;
3233
+ const subject = this.getFormValue('subject');
3234
+ const message = this.getFormValue('message');
3235
+ this.api.sendContactUs(captcha, name, email, topic, subject, message, () => {
3236
+ this.formSubmitted = false;
3237
+ this.notificationService.success('Message has been sent successfully');
3238
+ this.formGroup.reset();
3239
+ this.recaptcha.resetCaptcha();
3240
+ this.submit.emit();
3241
+ }, () => {
3242
+ this.notificationService.error();
3243
+ });
3244
+ }
3245
+ //Events
3246
+ onSubmit() {
3247
+ this.contactUs();
3248
+ }
3249
+ onTopicChange(event) {
3250
+ this.selectedTopic = event.target.value;
3251
+ }
3252
+ }
3253
+ ContactUsForm.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ContactUsForm, deps: [{ token: i1$7.FormBuilder }, { token: i1$5.AppContextService }, { token: i3.EmailsApiService }, { token: i4.NotificationService }], target: i0.ɵɵFactoryTarget.Component });
3254
+ ContactUsForm.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.6", type: ContactUsForm, selector: "anatoly-forms-contactus-form", inputs: { showActionButtons: "showActionButtons" }, outputs: { submit: "submit" }, viewQueries: [{ propertyName: "recaptcha", first: true, predicate: ["recaptcha"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<form (ngSubmit)='onSubmit()' [formGroup]='formGroup' novalidate>\r\n <anatoly-form-validation-summary [formGroup]='formGroup'\r\n [visible]='formSubmitted && formGroup.invalid'></anatoly-form-validation-summary>\r\n\r\n <div class='contact-us'>\r\n <div class=\"row\">\r\n <div class='form-fields col-6'>\r\n <p>What can we help you with?</p>\r\n <div [ngClass]=\"{'has-error': isControlInvalid('topic') }\" class='form-topic'>\r\n <div class='form-select-wrapper'>\r\n <label class='assistive-text'>Topic *</label>\r\n <select (change)='onTopicChange($event)' class='form-select' formControlName='topic'>\r\n <option *ngFor='let topic of topicList' [value]='topic.value'>{{ topic.value }} </option>\r\n </select>\r\n <anatoly-item-validation-summary [formGroup]='formGroup'\r\n [formSubmitted]='formSubmitted'\r\n controlName='topic'\r\n controlTitle='topic'>\r\n </anatoly-item-validation-summary>\r\n </div>\r\n </div>\r\n <div [ngClass]=\"{'has-error': isControlInvalid('name') }\" class='form-name'>\r\n <label class='assistive-text'>Name *</label>\r\n <input class='form-control' formControlName='name' placeholder='Name *' type='text'>\r\n <anatoly-item-validation-summary [formGroup]='formGroup'\r\n [formSubmitted]='formSubmitted'\r\n controlName='name'\r\n controlTitle='name'>\r\n </anatoly-item-validation-summary>\r\n </div>\r\n <div [ngClass]=\"{'has-error': isControlInvalid('email') }\" class='form-email'>\r\n <label class='assistive-text'>E-mail * </label>\r\n <input class='form-control' formControlName='email' placeholder='E-mail *' type='text' />\r\n <p *ngIf='!isUserSignedIn'>Please indicate the email used for your MailEx login if you already have an account</p>\r\n <anatoly-item-validation-summary [formGroup]='formGroup'\r\n [formSubmitted]='formSubmitted'\r\n controlName='email'\r\n controlTitle='email'>\r\n </anatoly-item-validation-summary>\r\n </div>\r\n <div [ngClass]=\"{'has-error': isControlInvalid('subject') }\" class='form-subject'>\r\n <label class='assistive-text'>Subject *</label>\r\n <input class='form-control' formControlName='subject' placeholder='Subject *' type='text' />\r\n <anatoly-item-validation-summary [formGroup]='formGroup'\r\n [formSubmitted]='formSubmitted'\r\n controlName='subject'\r\n controlTitle='subject'>\r\n </anatoly-item-validation-summary>\r\n </div>\r\n\r\n </div>\r\n <div class='col-6'>\r\n <div [ngClass]=\"{'has-error': isControlInvalid('message') }\" class='form-message'>\r\n <label class='assistive-text'>Message *</label>\r\n <textarea formControlName='message' name='message' placeholder='Message *' rows='4'\r\n type='text'></textarea>\r\n <anatoly-item-validation-summary [formGroup]='formGroup'\r\n [formSubmitted]='formSubmitted'\r\n controlName='message'\r\n controlTitle='message'>\r\n </anatoly-item-validation-summary>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row form-footer\">\r\n <div class=\"col-6\">\r\n <div style='transform:scale(0.8);transform-origin:0;'>\r\n <ngx-recaptcha2 #recaptcha [siteKey]='siteKey' formControlName='captcha'></ngx-recaptcha2>\r\n </div>\r\n </div>\r\n <div class=\"col-6\">\r\n <button *ngIf='showActionButtons'\r\n [class.btn-primary]='!formGroup.invalid'\r\n class='btn btn-success float-right m-t-20'\r\n type='submit'>\r\n Submit\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n</form>\r\n", dependencies: [{ kind: "directive", type: i1$6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$7.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$7.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$7.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$7.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: i1$7.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1$7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$7.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$7.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$7.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i6.ReCaptcha2Component, selector: "ngx-recaptcha2", inputs: ["theme", "size", "hl"] }, { kind: "directive", type: NativeElementDirective, selector: "[formControl], [formControlName]" }, { kind: "component", type: FormValidationSummaryComponent, selector: "anatoly-form-validation-summary", inputs: ["visible", "customerrors", "viewtype"] }, { kind: "component", type: ItemValidationSummaryComponent, selector: "anatoly-item-validation-summary", inputs: ["controlName", "controlTitle"] }] });
3255
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ContactUsForm, decorators: [{
3256
+ type: Component,
3257
+ args: [{ selector: 'anatoly-forms-contactus-form', template: "<form (ngSubmit)='onSubmit()' [formGroup]='formGroup' novalidate>\r\n <anatoly-form-validation-summary [formGroup]='formGroup'\r\n [visible]='formSubmitted && formGroup.invalid'></anatoly-form-validation-summary>\r\n\r\n <div class='contact-us'>\r\n <div class=\"row\">\r\n <div class='form-fields col-6'>\r\n <p>What can we help you with?</p>\r\n <div [ngClass]=\"{'has-error': isControlInvalid('topic') }\" class='form-topic'>\r\n <div class='form-select-wrapper'>\r\n <label class='assistive-text'>Topic *</label>\r\n <select (change)='onTopicChange($event)' class='form-select' formControlName='topic'>\r\n <option *ngFor='let topic of topicList' [value]='topic.value'>{{ topic.value }} </option>\r\n </select>\r\n <anatoly-item-validation-summary [formGroup]='formGroup'\r\n [formSubmitted]='formSubmitted'\r\n controlName='topic'\r\n controlTitle='topic'>\r\n </anatoly-item-validation-summary>\r\n </div>\r\n </div>\r\n <div [ngClass]=\"{'has-error': isControlInvalid('name') }\" class='form-name'>\r\n <label class='assistive-text'>Name *</label>\r\n <input class='form-control' formControlName='name' placeholder='Name *' type='text'>\r\n <anatoly-item-validation-summary [formGroup]='formGroup'\r\n [formSubmitted]='formSubmitted'\r\n controlName='name'\r\n controlTitle='name'>\r\n </anatoly-item-validation-summary>\r\n </div>\r\n <div [ngClass]=\"{'has-error': isControlInvalid('email') }\" class='form-email'>\r\n <label class='assistive-text'>E-mail * </label>\r\n <input class='form-control' formControlName='email' placeholder='E-mail *' type='text' />\r\n <p *ngIf='!isUserSignedIn'>Please indicate the email used for your MailEx login if you already have an account</p>\r\n <anatoly-item-validation-summary [formGroup]='formGroup'\r\n [formSubmitted]='formSubmitted'\r\n controlName='email'\r\n controlTitle='email'>\r\n </anatoly-item-validation-summary>\r\n </div>\r\n <div [ngClass]=\"{'has-error': isControlInvalid('subject') }\" class='form-subject'>\r\n <label class='assistive-text'>Subject *</label>\r\n <input class='form-control' formControlName='subject' placeholder='Subject *' type='text' />\r\n <anatoly-item-validation-summary [formGroup]='formGroup'\r\n [formSubmitted]='formSubmitted'\r\n controlName='subject'\r\n controlTitle='subject'>\r\n </anatoly-item-validation-summary>\r\n </div>\r\n\r\n </div>\r\n <div class='col-6'>\r\n <div [ngClass]=\"{'has-error': isControlInvalid('message') }\" class='form-message'>\r\n <label class='assistive-text'>Message *</label>\r\n <textarea formControlName='message' name='message' placeholder='Message *' rows='4'\r\n type='text'></textarea>\r\n <anatoly-item-validation-summary [formGroup]='formGroup'\r\n [formSubmitted]='formSubmitted'\r\n controlName='message'\r\n controlTitle='message'>\r\n </anatoly-item-validation-summary>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row form-footer\">\r\n <div class=\"col-6\">\r\n <div style='transform:scale(0.8);transform-origin:0;'>\r\n <ngx-recaptcha2 #recaptcha [siteKey]='siteKey' formControlName='captcha'></ngx-recaptcha2>\r\n </div>\r\n </div>\r\n <div class=\"col-6\">\r\n <button *ngIf='showActionButtons'\r\n [class.btn-primary]='!formGroup.invalid'\r\n class='btn btn-success float-right m-t-20'\r\n type='submit'>\r\n Submit\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n</form>\r\n" }]
3258
+ }], ctorParameters: function () { return [{ type: i1$7.FormBuilder }, { type: i1$5.AppContextService }, { type: i3.EmailsApiService }, { type: i4.NotificationService }]; }, propDecorators: { showActionButtons: [{
3259
+ type: Input
3260
+ }], submit: [{
3261
+ type: Output
3262
+ }], recaptcha: [{
3263
+ type: ViewChild,
3264
+ args: ['recaptcha']
3265
+ }] } });
3266
+
3267
+ /*
3268
+ <file>
3269
+ Project:
3270
+ @osovitny/anatoly
3271
+
3272
+ Authors:
3273
+ Vadim Osovitny
3274
+ Anatoly Osovitny
3275
+
3276
+ Created:
3277
+ 26 Jun 2020
3278
+
3279
+ Version:
3280
+ 1.0
3281
+
3282
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
3283
+ </file>
3284
+ */
3285
+ class ReplaceTextPipe {
3286
+ transform(inputData, search, replacement) {
3287
+ if (inputData) {
3288
+ return inputData.replace(new RegExp(search, "g"), replacement);
3289
+ }
3290
+ else {
3291
+ return inputData;
3292
+ }
3293
+ }
3294
+ }
3295
+ ReplaceTextPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ReplaceTextPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
3296
+ ReplaceTextPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.0.6", ngImport: i0, type: ReplaceTextPipe, name: "replaceText" });
3297
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: ReplaceTextPipe, decorators: [{
3298
+ type: Pipe,
3299
+ args: [{
3300
+ name: "replaceText",
3301
+ }]
3302
+ }] });
3303
+
3304
+ /*
3305
+ <file>
3306
+ Project:
3307
+ @osovitny/anatoly
3308
+
3309
+ Authors:
3310
+ Vadim Osovitny
3311
+ Anatoly Osovitny
3312
+
3313
+ Created:
3314
+ 26 Jun 2020
3315
+
3316
+ Version:
3317
+ 1.0
3318
+
3319
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
3320
+ </file>
3321
+ */
3322
+ class FileSizePipe {
3323
+ constructor() {
3324
+ this.units = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB'];
3325
+ }
3326
+ transform(bytes = 0, precision = 0) {
3327
+ if (isNaN(parseFloat(String(bytes))) || !isFinite(bytes))
3328
+ return '';
3329
+ let unit = 0;
3330
+ while (bytes >= 1024) {
3331
+ bytes /= 1024;
3332
+ unit++;
3333
+ }
3334
+ return bytes.toFixed(+precision) + ' ' + this.units[unit];
3335
+ }
3336
+ }
3337
+ FileSizePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: FileSizePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
3338
+ FileSizePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.0.6", ngImport: i0, type: FileSizePipe, name: "filesize" });
3339
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: FileSizePipe, decorators: [{
3340
+ type: Pipe,
3341
+ args: [{
3342
+ name: 'filesize',
3343
+ }]
3344
+ }] });
3345
+
3346
+ /*
3347
+ <file>
3348
+ Project:
3349
+ @osovitny/anatoly
3350
+
3351
+ Authors:
3352
+ Vadim Osovitny
3353
+ Anatoly Osovitny
3354
+
3355
+ Created:
3356
+ 27 Oct 2019
3357
+
3358
+ Version:
3359
+ 1.0
3360
+
3361
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
3362
+ </file>
3363
+ */
3364
+ class SafeHtmlPipe {
3365
+ constructor(sanitized) {
3366
+ this.sanitized = sanitized;
3367
+ }
3368
+ transform(value) {
3369
+ return this.sanitized.bypassSecurityTrustHtml(value);
3370
+ }
3371
+ }
3372
+ SafeHtmlPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: SafeHtmlPipe, deps: [{ token: i1$4.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
3373
+ SafeHtmlPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.0.6", ngImport: i0, type: SafeHtmlPipe, name: "safeHtml" });
3374
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: SafeHtmlPipe, decorators: [{
3375
+ type: Pipe,
3376
+ args: [{ name: 'safeHtml' }]
3377
+ }], ctorParameters: function () { return [{ type: i1$4.DomSanitizer }]; } });
3378
+
3379
+ /*
3380
+ <file>
3381
+ Project:
3382
+ @osovitny/anatoly
3383
+
3384
+ Authors:
3385
+ Vadim Osovitny
3386
+ Anatoly Osovitny
3387
+
3388
+ Created:
3389
+ 29 June 2020
3390
+
3391
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
3392
+ </file>
3393
+ */
3394
+ let InjectorInstance;
3395
+ class AnatolyCoreModule {
3396
+ constructor(injector, parentModule) {
3397
+ this.injector = injector;
3398
+ throwIfAlreadyLoaded(parentModule, 'AnatolyCoreModule');
3399
+ InjectorInstance = this.injector;
3400
+ }
3401
+ }
3402
+ AnatolyCoreModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: AnatolyCoreModule, deps: [{ token: i0.Injector }, { token: AnatolyCoreModule, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.NgModule });
3403
+ AnatolyCoreModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.6", ngImport: i0, type: AnatolyCoreModule, imports: [CommonModule] });
3404
+ AnatolyCoreModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: AnatolyCoreModule, providers: [
3405
+ LoggingService,
3406
+ NotificationService,
3407
+ AppContextService,
3408
+ LoadingService,
3409
+ DigitalMarketingService,
3410
+ GoogleAnalyticsService,
3411
+ LocalStorageService,
3412
+ SessionStorageService
3413
+ ], imports: [CommonModule] });
3414
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: AnatolyCoreModule, decorators: [{
3415
+ type: NgModule,
3416
+ args: [{
3417
+ imports: [CommonModule],
3418
+ exports: [],
3419
+ providers: [
3420
+ LoggingService,
3421
+ NotificationService,
3422
+ AppContextService,
3423
+ LoadingService,
3424
+ DigitalMarketingService,
3425
+ GoogleAnalyticsService,
3426
+ LocalStorageService,
3427
+ SessionStorageService
3428
+ ],
3429
+ }]
3430
+ }], ctorParameters: function () { return [{ type: i0.Injector }, { type: AnatolyCoreModule, decorators: [{
3431
+ type: Optional
3432
+ }, {
3433
+ type: SkipSelf
3434
+ }] }]; } });
3435
+
3436
+ /*
3437
+ <file>
3438
+ Project:
3439
+ @osovitny/anatoly
3440
+
3441
+ Authors:
3442
+ Vadim Osovitny
3443
+ Anatoly Osovitny
3444
+
3445
+ Created:
3446
+ 16 Jun 2022
3447
+
3448
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
3449
+ </file>
3450
+ */
3451
+ class EmailsApiService extends BaseApiService$1 {
3452
+ constructor(http) {
3453
+ super(http);
3454
+ this.http = http;
3455
+ }
3456
+ sendContactUs(captcha, name, email, topic, subject, message, success, error) {
3457
+ return this.post('sendContactUs', { captcha, name, email, topic, subject, message }).subscribe(data => {
3458
+ if (success)
3459
+ success(data);
3460
+ }, e => {
3461
+ if (error)
3462
+ error(e);
3463
+ });
3464
+ }
3465
+ }
3466
+ EmailsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: EmailsApiService, deps: [{ token: i1$3.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
3467
+ EmailsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: EmailsApiService });
3468
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: EmailsApiService, decorators: [{
3469
+ type: Injectable
3470
+ }], ctorParameters: function () { return [{ type: i1$3.HttpClient }]; } });
3471
+
3472
+ /*
3473
+ <file>
3474
+ Project:
3475
+ @osovitny/anatoly
3476
+
3477
+ Authors:
3478
+ Vadim Osovitny
3479
+ Anatoly Osovitny
3480
+
3481
+ Created:
3482
+ 4 Mar 2020
3483
+
3484
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
3485
+ </file>
3486
+ */
3487
+ class AnatolyDataModule {
3488
+ constructor(parentModule) {
3489
+ throwIfAlreadyLoaded$1(parentModule, 'AnatolyDataModule');
3490
+ }
3491
+ }
3492
+ AnatolyDataModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: AnatolyDataModule, deps: [{ token: AnatolyDataModule, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.NgModule });
3493
+ AnatolyDataModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.6", ngImport: i0, type: AnatolyDataModule, imports: [CommonModule] });
3494
+ AnatolyDataModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: AnatolyDataModule, providers: [
3495
+ BillingApiService,
3496
+ EmailsApiService
3497
+ ], imports: [CommonModule] });
3498
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: AnatolyDataModule, decorators: [{
3499
+ type: NgModule,
3500
+ args: [{
3501
+ imports: [
3502
+ CommonModule
3503
+ ],
3504
+ providers: [
3505
+ BillingApiService,
3506
+ EmailsApiService
3507
+ ]
3508
+ }]
3509
+ }], ctorParameters: function () { return [{ type: AnatolyDataModule, decorators: [{
3510
+ type: Optional
3511
+ }, {
3512
+ type: SkipSelf
3513
+ }] }]; } });
3514
+
3515
+ /*
3516
+ <file>
3517
+ Project:
3518
+ @osovitny/anatoly
3519
+
3520
+ Authors:
3521
+ Vadim Osovitny
3522
+ Anatoly Osovitny
3523
+
3524
+ Created:
3525
+ 26 Jun 2020
3526
+
3527
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
3528
+ </file>
3529
+ */
3530
+ const FroalaEditorModuleWithProviders = FroalaEditorModule.forRoot();
3531
+ const FroalaViewModuleWithProviders = FroalaViewModule.forRoot();
3532
+ class AnatolyUIModule {
3533
+ }
3534
+ AnatolyUIModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: AnatolyUIModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3535
+ AnatolyUIModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.6", ngImport: i0, type: AnatolyUIModule, declarations: [SubscribePlanButtonComponent,
3536
+ UpgradePlanButtonComponent,
3537
+ BuyAccessButtonComponent,
3538
+ SignInButtonComponent,
3539
+ SignUpButtonComponent,
3540
+ SignOutButtonComponent,
3541
+ ContentHeaderComponent,
3542
+ SpinnerComponent,
3543
+ LoadingComponent,
3544
+ HtmlEditorComponent,
3545
+ FormsHtmlEditorComponent,
3546
+ //Directives
3547
+ NativeElementDirective,
3548
+ //Forms
3549
+ ContactUsForm,
3550
+ //Pipes
3551
+ SafeHtmlPipe,
3552
+ ReplaceTextPipe,
3553
+ FileSizePipe,
3554
+ //Validation
3555
+ FormValidationSummaryComponent,
3556
+ ItemValidationSummaryComponent], imports: [CommonModule,
3557
+ ReactiveFormsModule,
3558
+ FormsModule,
3559
+ NgxCaptchaModule, i1$8.FroalaEditorModule, i1$8.FroalaViewModule], exports: [SubscribePlanButtonComponent,
3560
+ UpgradePlanButtonComponent,
3561
+ BuyAccessButtonComponent,
3562
+ SignInButtonComponent,
3563
+ SignUpButtonComponent,
3564
+ SignOutButtonComponent,
3565
+ ContentHeaderComponent,
3566
+ SpinnerComponent,
3567
+ LoadingComponent,
3568
+ HtmlEditorComponent,
3569
+ FormsHtmlEditorComponent,
3570
+ //Directives
3571
+ NativeElementDirective,
3572
+ //Forms
3573
+ ContactUsForm,
3574
+ //Pipes
3575
+ SafeHtmlPipe,
3576
+ ReplaceTextPipe,
3577
+ FileSizePipe,
3578
+ //Validation
3579
+ FormValidationSummaryComponent,
3580
+ ItemValidationSummaryComponent] });
3581
+ AnatolyUIModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: AnatolyUIModule, imports: [CommonModule,
3582
+ ReactiveFormsModule,
3583
+ FormsModule,
3584
+ NgxCaptchaModule,
3585
+ FroalaEditorModuleWithProviders,
3586
+ FroalaViewModuleWithProviders] });
3587
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.6", ngImport: i0, type: AnatolyUIModule, decorators: [{
3588
+ type: NgModule,
3589
+ args: [{
3590
+ imports: [
3591
+ CommonModule,
3592
+ ReactiveFormsModule,
3593
+ FormsModule,
3594
+ NgxCaptchaModule,
3595
+ FroalaEditorModuleWithProviders,
3596
+ FroalaViewModuleWithProviders,
3597
+ ],
3598
+ exports: [
3599
+ SubscribePlanButtonComponent,
3600
+ UpgradePlanButtonComponent,
3601
+ BuyAccessButtonComponent,
3602
+ SignInButtonComponent,
3603
+ SignUpButtonComponent,
3604
+ SignOutButtonComponent,
3605
+ ContentHeaderComponent,
3606
+ SpinnerComponent,
3607
+ LoadingComponent,
3608
+ HtmlEditorComponent,
3609
+ FormsHtmlEditorComponent,
3610
+ //Directives
3611
+ NativeElementDirective,
3612
+ //Forms
3613
+ ContactUsForm,
3614
+ //Pipes
3615
+ SafeHtmlPipe,
3616
+ ReplaceTextPipe,
3617
+ FileSizePipe,
3618
+ //Validation
3619
+ FormValidationSummaryComponent,
3620
+ ItemValidationSummaryComponent,
3621
+ ],
3622
+ declarations: [
3623
+ SubscribePlanButtonComponent,
3624
+ UpgradePlanButtonComponent,
3625
+ BuyAccessButtonComponent,
3626
+ SignInButtonComponent,
3627
+ SignUpButtonComponent,
3628
+ SignOutButtonComponent,
3629
+ ContentHeaderComponent,
3630
+ SpinnerComponent,
3631
+ LoadingComponent,
3632
+ HtmlEditorComponent,
3633
+ FormsHtmlEditorComponent,
3634
+ //Directives
3635
+ NativeElementDirective,
3636
+ //Forms
3637
+ ContactUsForm,
3638
+ //Pipes
3639
+ SafeHtmlPipe,
3640
+ ReplaceTextPipe,
3641
+ FileSizePipe,
3642
+ //Validation
3643
+ FormValidationSummaryComponent,
3644
+ ItemValidationSummaryComponent,
3645
+ ]
3646
+ }]
3647
+ }] });
3648
+
3649
+ /*
3650
+ * Public API Surface of anatoly-lib
3651
+ */
3652
+
3653
+ /**
3654
+ * Generated bundle index. Do not edit.
3655
+ */
3656
+
3657
+ export { Alerts, AnatolyCoreModule, AnatolyDataModule, AnatolyHttpInterceptor, AnatolyUIModule, AppContextService, AppCoreSettings, BaseApiService, BaseComponent, BaseDialog, BaseEditComponent, BaseGoService, BaseGridEditService, BaseGridReadService, BaseHtmlEditorComponent, BillingApiService, BuyAccessButtonComponent, ContactUsForm, ContentHeaderComponent, ContextInitState, Convert, DefaultEditorOptions, DigitalMarketingService, FileSizePipe, FormValidationSummaryComponent, FormsHtmlEditorComponent, FroalaEditorModuleWithProviders, FroalaViewModuleWithProviders, GlobalErrorHandler, GoogleAnalyticsService, Guid, HtmlEditorComponent, IdleService, InjectorInstance, ItemValidationSummaryComponent, LoadingComponent, LoadingService, LocalStorageService, LocalizationInjectorInstance, LocalizationModule, LocalizationService, LocalizationSettingsModule, LocalizePipe, LoggingService, NativeElementDirective, NotificationService, NotificationsApiService, ReplaceTextPipe, SafeHtmlPipe, SessionStorageService, SignInButtonComponent, SignOutButtonComponent, SignUpButtonComponent, SpinnerComponent, Subs, SubscribePlanButtonComponent, TranslateModuleAtRoot, UpgradePlanButtonComponent, Urls, Utils, ValidationSummaryComponent, customTranslateLoaderFactory, localizationInitializerFactory, throwIfAlreadyLoaded };
3658
+ //# sourceMappingURL=osovitny-anatoly.mjs.map