@osovitny/anatoly 3.17.111 → 3.17.113

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 (35) hide show
  1. package/esm2022/lib/billing/billing.module.mjs +19 -13
  2. package/esm2022/lib/billing/components/buttons/buyaccess-button.component.mjs +108 -0
  3. package/esm2022/lib/billing/components/buttons/subscribe-plan-button.component.mjs +119 -0
  4. package/esm2022/lib/billing/components/exports.mjs +7 -5
  5. package/esm2022/lib/billing/components/index.mjs +9 -7
  6. package/esm2022/lib/billing/components/pm/braintree/braintree.component.mjs +155 -0
  7. package/esm2022/lib/billing/components/pm/paypal/paypal-button.component.mjs +157 -0
  8. package/esm2022/lib/billing/components/pm/paypal/paypal.component.mjs +316 -0
  9. package/esm2022/lib/billing/components/pm/stripe/stripe.component.mjs +109 -0
  10. package/esm2022/lib/ui/components/exports.mjs +1 -4
  11. package/esm2022/lib/ui/components/index.mjs +1 -6
  12. package/esm2022/lib/ui/ui.module.mjs +37 -39
  13. package/fesm2022/osovitny-anatoly.mjs +1697 -1695
  14. package/fesm2022/osovitny-anatoly.mjs.map +1 -1
  15. package/lib/billing/billing.module.d.ts +15 -12
  16. package/lib/{ui/components/billing → billing/components/buttons}/buyaccess-button.component.d.ts +1 -1
  17. package/lib/{ui/components/billing → billing/components/buttons}/subscribe-plan-button.component.d.ts +1 -1
  18. package/lib/billing/components/exports.d.ts +6 -4
  19. package/lib/billing/components/index.d.ts +2 -2
  20. package/lib/billing/components/{braintree → pm/braintree}/braintree.component.d.ts +3 -3
  21. package/lib/billing/components/{paypal → pm/paypal}/paypal-button.component.d.ts +3 -3
  22. package/lib/billing/components/{paypal → pm/paypal}/paypal.component.d.ts +2 -2
  23. package/lib/billing/components/{stripe → pm/stripe}/stripe.component.d.ts +2 -2
  24. package/lib/ui/components/exports.d.ts +0 -2
  25. package/lib/ui/components/index.d.ts +2 -2
  26. package/lib/ui/forms/index.d.ts +1 -1
  27. package/lib/ui/pipes/index.d.ts +1 -1
  28. package/lib/ui/ui.module.d.ts +42 -44
  29. package/package.json +2 -2
  30. package/esm2022/lib/billing/components/braintree/braintree.component.mjs +0 -155
  31. package/esm2022/lib/billing/components/paypal/paypal-button.component.mjs +0 -157
  32. package/esm2022/lib/billing/components/paypal/paypal.component.mjs +0 -316
  33. package/esm2022/lib/billing/components/stripe/stripe.component.mjs +0 -109
  34. package/esm2022/lib/ui/components/billing/buyaccess-button.component.mjs +0 -108
  35. package/esm2022/lib/ui/components/billing/subscribe-plan-button.component.mjs +0 -119
@@ -1,18 +1,18 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Injectable, Inject, EventEmitter, Output, Pipe, APP_INITIALIZER, Injector, NgModule, Component, Input, ChangeDetectionStrategy, ViewChild, Directive, ViewEncapsulation, HostBinding, HostListener, Optional, SkipSelf } from '@angular/core';
3
+ import { BehaviorSubject, Subject, filter, takeUntil, map as map$1, catchError, of, merge, forkJoin, timer, fromEvent, firstValueFrom } from 'rxjs';
4
+ import { map, tap, mergeMap } from 'rxjs/operators';
5
+ import * as i1 from '@angular/common/http';
6
+ import { HttpResponse, HttpClientModule, HttpClient, HTTP_INTERCEPTORS } from '@angular/common/http';
7
+ import * as i1$2 from '@angular/common';
8
+ import { LOCATION_INITIALIZED, DOCUMENT, CommonModule } from '@angular/common';
3
9
  import js_beautify from 'js-beautify';
4
- import * as i1 from '@angular/router';
10
+ import * as i1$1 from '@angular/router';
5
11
  import { NavigationEnd, NavigationStart, NavigationCancel, NavigationError, RouterModule } from '@angular/router';
6
12
  import { v4 } from 'uuid';
7
- import { BehaviorSubject, Subject, filter, takeUntil, map as map$1, catchError, of, merge, forkJoin, timer, fromEvent, firstValueFrom } from 'rxjs';
8
13
  import * as i4 from '@azure/msal-angular';
9
14
  import { MSAL_GUARD_CONFIG, MsalGuard, MsalInterceptor, MSAL_INTERCEPTOR_CONFIG, MSAL_INSTANCE, MsalService, MsalBroadcastService, MsalModule } from '@azure/msal-angular';
10
15
  import { BrowserUtils, EventType, InteractionStatus, InteractionType, InteractionRequiredAuthError, PromptValue, PublicClientApplication, LogLevel } from '@azure/msal-browser';
11
- import { map, tap, mergeMap } from 'rxjs/operators';
12
- import * as i1$1 from '@angular/common/http';
13
- import { HttpResponse, HttpClientModule, HttpClient, HTTP_INTERCEPTORS } from '@angular/common/http';
14
- import * as i1$2 from '@angular/common';
15
- import { LOCATION_INITIALIZED, DOCUMENT, CommonModule } from '@angular/common';
16
16
  import { format, formatDistance, formatDistanceToNow } from 'date-fns';
17
17
  import enUS from 'date-fns/locale/en-US';
18
18
  import * as i1$3 from '@ngx-translate/core';
@@ -94,40 +94,85 @@ const ApiUrl = `${AppCoreSettings?.api.url}`;
94
94
 
95
95
  Authors:
96
96
  Vadim Osovitny vadim.osovitny@osovitny.com
97
- Anatoly Osovitny anatoly.osovitny@osovitny.com
98
97
 
99
98
  Created:
100
- 1 Apr 2024
99
+ 13 Nov 2017
101
100
 
102
101
  Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
103
102
  </file>
104
103
  */
105
- function getAppSettingsById(id) {
106
- let apps = ClientApps;
107
- if (apps && id) {
108
- for (let i = 0; i < apps.length; i++) {
109
- let app = apps[i];
110
- if (app.id == id) {
111
- return app;
112
- }
104
+ //Node
105
+ class ApiServiceBase {
106
+ constructor(http) {
107
+ this.http = http;
108
+ }
109
+ serializeParams(data) {
110
+ return data ? ('?' + $.param(data)) : "";
111
+ }
112
+ //api
113
+ get(action, data, responseType) {
114
+ if (!responseType) {
115
+ responseType = 'json';
113
116
  }
117
+ var url = `${this.baseUrl}/${action}${this.serializeParams(data)}`;
118
+ return this.http.get(url, { responseType: responseType }).pipe(map(res => res));
114
119
  }
115
- return null;
116
- }
117
- function getAppSettingsByName(name) {
118
- let apps = ClientApps;
119
- if (apps && name) {
120
- for (let i = 0; i < apps.length; i++) {
121
- let app = apps[i];
122
- if (app.name == name) {
123
- return app;
124
- }
120
+ post(action, data, responseType) {
121
+ if (!responseType) {
122
+ responseType = 'text';
125
123
  }
124
+ var url = `${this.baseUrl}/${action}`;
125
+ return this.http.post(url, data, { responseType: responseType });
126
126
  }
127
- return null;
127
+ postQS(action, data, responseType) {
128
+ if (!responseType) {
129
+ responseType = 'text';
130
+ }
131
+ var url = `${this.baseUrl}/${action}${this.serializeParams(data)}`;
132
+ return this.http.post(url, null, { responseType: responseType });
133
+ }
134
+ delete(action, data, responseType) {
135
+ if (!responseType) {
136
+ responseType = 'text';
137
+ }
138
+ var url = `${this.baseUrl}/${action}${this.serializeParams(data)}`;
139
+ return this.http.delete(url, { responseType: responseType });
140
+ }
141
+ //gets
142
+ getExternalTextFile(url) {
143
+ return this.http.get(url);
144
+ }
145
+ //Json Files
146
+ __getJsonFile(url) {
147
+ const version = AppCoreSettings.version;
148
+ const isCDNEnabled = AppCoreSettings.isCDNEnabled;
149
+ const cdnSasToken = AppCoreSettings.cdnSasToken;
150
+ if (isCDNEnabled) {
151
+ url = url + cdnSasToken;
152
+ }
153
+ else {
154
+ url = url + '?v=' + version;
155
+ }
156
+ return this.http.get(url);
157
+ }
158
+ getLibJsonFile(fileName) {
159
+ const url = AppCoreSettings.libUrl + '/jsons';
160
+ return this.__getJsonFile(url + "/" + fileName);
161
+ }
162
+ getJsonFile(fileName) {
163
+ const url = AppCoreSettings.assetsUrl + '/jsons';
164
+ return this.__getJsonFile(url + "/" + fileName);
165
+ }
166
+ getExternalJsonFile(libname, fileName) {
167
+ const url = AppCoreSettings.externalUrl + "/" + libname + "/jsons";
168
+ return this.__getJsonFile(url + "/" + fileName);
169
+ }
170
+ static { this.ɵfac = function ApiServiceBase_Factory(t) { return new (t || ApiServiceBase)(i0.ɵɵinject(i1.HttpClient)); }; }
171
+ static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ApiServiceBase, factory: ApiServiceBase.ɵfac }); }
128
172
  }
129
- const AppName = document.getElementById('appName').getAttribute('data-appname');
130
- const AppSettings = getAppSettingsByName(AppName);
173
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ApiServiceBase, [{
174
+ type: Injectable
175
+ }], () => [{ type: i1.HttpClient }], null); })();
131
176
 
132
177
  /*
133
178
  <file>
@@ -139,22 +184,45 @@ const AppSettings = getAppSettingsByName(AppName);
139
184
  Anatoly Osovitny anatoly.osovitny@osovitny.com
140
185
 
141
186
  Created:
142
- 1 Apr 2024
187
+ 17 Apr 2023
143
188
 
144
189
  Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
145
190
  </file>
146
191
  */
147
- const dateTimeFormats = {
148
- medium: 'dd MMM yyyy HH:mm'
149
- };
150
- const dateFormats = {
151
- medium: "dd MMM yyyy",
152
- short: "dd/MM/yyyy"
153
- };
154
- const timeFormats = {
155
- medium: "HH:mm:ss",
156
- short: "HH:mm"
157
- };
192
+ class Stopwatch {
193
+ constructor(name) {
194
+ this.name = name;
195
+ this.startTime = 0;
196
+ this.stopTime = 0;
197
+ this.running = false;
198
+ this.performance = !!window.performance;
199
+ console.log(this.name + ' started.');
200
+ }
201
+ currentTime() {
202
+ return this.performance ? window.performance.now() : new Date().getTime();
203
+ }
204
+ start() {
205
+ this.startTime = this.currentTime();
206
+ this.running = true;
207
+ }
208
+ stop() {
209
+ this.stopTime = this.currentTime();
210
+ this.running = false;
211
+ }
212
+ getElapsedMilliseconds() {
213
+ if (this.running) {
214
+ this.stopTime = this.currentTime();
215
+ }
216
+ return this.stopTime - this.startTime;
217
+ }
218
+ getElapsedSeconds() {
219
+ return this.getElapsedMilliseconds() / 1000;
220
+ }
221
+ printElapsedAsMilliseconds() {
222
+ let elapsed = this.getElapsedMilliseconds();
223
+ console.log(`${this.name} stopped. Execution time: ${elapsed} ms`);
224
+ }
225
+ }
158
226
 
159
227
  /*
160
228
  <file>
@@ -163,23 +231,20 @@ const timeFormats = {
163
231
 
164
232
  Authors:
165
233
  Vadim Osovitny vadim.osovitny@osovitny.com
234
+ Anatoly Osovitny anatoly.osovitny@osovitny.com
166
235
 
167
236
  Created:
168
- 11 Nov 2024
237
+ 28 Apr 2024
169
238
 
170
239
  Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
171
240
  </file>
172
241
  */
173
- const GAEvents = {
174
- login: {
175
- signin: 'osa_login_signin',
176
- signin_success: 'osa_login_signin_success',
177
- signup: 'osa_login_signup',
178
- signup_success: 'osa_login_signup_success'
179
- }
180
- };
181
- const GABillingEvents = {
182
- payment: 'osa_billing_payment'
242
+ const AppContextStorageKeys = {
243
+ version: 'version',
244
+ currency: 'currency',
245
+ //Lists
246
+ countries: 'countries',
247
+ languages: 'languages'
183
248
  };
184
249
 
185
250
  /*
@@ -192,92 +257,59 @@ const GABillingEvents = {
192
257
  Anatoly Osovitny anatoly.osovitny@osovitny.com
193
258
 
194
259
  Created:
195
- 29 June 2020
260
+ 26 Jun 2020
196
261
 
197
262
  Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
198
263
  </file>
199
264
  */
200
- class Convert {
201
- static pad(number) {
202
- if (number < 10) {
203
- return '0' + number;
204
- }
205
- return number;
265
+ //Node
266
+ class WebStorageService {
267
+ constructor(storage) {
268
+ this.storage = storage === 'local' || storage === 'localStorage' ? localStorage : sessionStorage;
206
269
  }
207
- static enumToString(enumeration, value) {
208
- for (let k in enumeration)
209
- if (enumeration[k] == value)
210
- return k;
211
- return null;
270
+ setItem(key, value) {
271
+ this.storage.setItem(key, value);
212
272
  }
213
- static enumToArray(enumeration, valueAsInt = true, notIncludes) {
214
- const notIncludeFiler = (value) => {
215
- if (isNaN(Number(value))) {
216
- return false;
217
- }
218
- if (notIncludes) {
219
- for (let i in notIncludes) {
220
- if (notIncludes[i] == value)
221
- return false;
222
- }
223
- }
224
- return true;
225
- };
226
- if (valueAsInt) {
227
- return Object.keys(enumeration)
228
- .filter(notIncludeFiler)
229
- .map(key => ({
230
- value: parseInt(key),
231
- text: enumeration[key]
232
- }));
233
- }
234
- else {
235
- return Object.keys(enumeration)
236
- .filter(notIncludeFiler)
237
- .map(key => ({
238
- value: key,
239
- text: enumeration[key]
240
- }));
241
- }
273
+ setObject(key, value) {
274
+ this.storage.setItem(key, JSON.stringify(value));
242
275
  }
243
- static stringToArray(str, separator = ',') {
244
- if (str) {
245
- return str.split(separator).filter(element => element);
246
- }
247
- return [];
276
+ getItem(key) {
277
+ return this.storage.getItem(key);
248
278
  }
249
- static stringToIntArray(str, separator = ',') {
250
- if (str) {
251
- return str.split(separator).filter(element => element).map(value => parseInt(value));
279
+ getObject(key) {
280
+ let value = this.storage.getItem(key);
281
+ if (!value) {
282
+ return null;
252
283
  }
253
- return [];
284
+ return JSON.parse(value);
254
285
  }
255
- static company2String(comp) {
256
- let company = JSON.parse(comp);
257
- if (company) {
258
- return `${company.name} ${company.phone} ${company.email} ${company.websiteUrl}`;
259
- }
286
+ remove(key) {
287
+ this.storage.removeItem(key);
260
288
  }
261
- static address2String(adr) {
262
- let address = JSON.parse(adr);
263
- return `${address.street} ${address.street2} ${address.city} ${address.stateOrRegion} ${address.zipcode} ${address.country}`;
289
+ clear() {
290
+ this.storage.clear();
264
291
  }
265
- static stringToBoolean(value) {
266
- switch (value.toLowerCase().trim()) {
267
- case "true":
268
- case "yes":
269
- case "1":
270
- return true;
271
- case "false":
272
- case "no":
273
- case "0":
274
- case null:
275
- return false;
276
- default:
277
- return Boolean(value);
278
- }
292
+ }
293
+ class LocalStorageService extends WebStorageService {
294
+ constructor() {
295
+ super('localStorage');
296
+ }
297
+ static { this.ɵfac = function LocalStorageService_Factory(t) { return new (t || LocalStorageService)(); }; }
298
+ static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: LocalStorageService, factory: LocalStorageService.ɵfac }); }
299
+ }
300
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LocalStorageService, [{
301
+ type: Injectable
302
+ }], () => [], null); })();
303
+ class SessionStorageService extends WebStorageService {
304
+ constructor() {
305
+ super('sessionStorage');
279
306
  }
307
+ static { this.ɵfac = function SessionStorageService_Factory(t) { return new (t || SessionStorageService)(); }; }
308
+ static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: SessionStorageService, factory: SessionStorageService.ɵfac }); }
280
309
  }
310
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SessionStorageService, [{
311
+ type: Injectable
312
+ }], () => [], null); })();
281
313
 
282
314
  /*
283
315
  <file>
@@ -289,96 +321,171 @@ class Convert {
289
321
  Anatoly Osovitny anatoly.osovitny@osovitny.com
290
322
 
291
323
  Created:
292
- 10 Feb 2024
324
+ 13 Nov 2017
293
325
 
294
326
  Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
295
327
  </file>
296
328
  */
297
- /**
298
- * Returns the [year, month, day, hour, minute, seconds] tokens of the provided
299
- * `date` as it will be rendered in the `timeZone`.
300
- */
301
- function tzTokenizeDate(date, timeZone) {
302
- var dtf = getDateTimeFormat(timeZone);
303
- return dtf.formatToParts ? partsOffset(dtf, date) : hackyOffset(dtf, date);
304
- }
305
- var typeToPos = {
306
- year: 0,
307
- month: 1,
308
- day: 2,
309
- hour: 3,
310
- minute: 4,
311
- second: 5,
312
- };
313
- function partsOffset(dtf, date) {
314
- try {
315
- var formatted = dtf.formatToParts(date);
316
- var filled = [];
317
- for (var i = 0; i < formatted.length; i++) {
318
- var pos = typeToPos[formatted[i].type];
319
- if (pos >= 0) {
320
- filled[pos] = parseInt(formatted[i].value, 10);
329
+ //Node
330
+ class AppContextService extends ApiServiceBase {
331
+ constructor(http, localStorage, sessionStorage) {
332
+ super(http);
333
+ this.http = http;
334
+ this.localStorage = localStorage;
335
+ this.sessionStorage = sessionStorage;
336
+ this.storageKeyName = 'appContext';
337
+ this.subscription = null;
338
+ //Private Streams
339
+ this._updated = new BehaviorSubject(null);
340
+ this._userUpdated = new BehaviorSubject(null);
341
+ //Public Streams
342
+ this.updated$ = this._updated.asObservable();
343
+ this.userUpdated$ = this._userUpdated.asObservable();
344
+ this.baseUrl = `${ApiUrl}/appContext`;
345
+ }
346
+ fireUpdated(data) {
347
+ if (!data) {
348
+ return;
349
+ }
350
+ this._updated.next(data);
351
+ }
352
+ fireUserUpdated() {
353
+ this._userUpdated.next(null);
354
+ }
355
+ //Session
356
+ getCurrent4Session() {
357
+ return this.sessionStorage.getObject(this.storageKeyName);
358
+ }
359
+ setCurrent2Session(value) {
360
+ this.sessionStorage.setObject(this.storageKeyName, value);
361
+ }
362
+ dataReceived(data) {
363
+ this.current = data;
364
+ this.subscription.unsubscribe();
365
+ this.subscription = null;
366
+ }
367
+ getCurrentContext() {
368
+ if (this.subscription != null) {
369
+ return;
370
+ }
371
+ //Logging
372
+ let stopwatch = new Stopwatch("AppContextService: Requesting a new AppContext");
373
+ stopwatch.start();
374
+ this.subscription = this.get('getCurrentContext', null).subscribe({
375
+ next: (data) => {
376
+ //Logging
377
+ stopwatch.stop();
378
+ stopwatch.printElapsedAsMilliseconds();
379
+ this.dataReceived(data);
321
380
  }
381
+ });
382
+ }
383
+ updateCurrentIfExpired() {
384
+ let context = this.getCurrent4Session();
385
+ if (!context) {
386
+ return;
387
+ }
388
+ let shouldBeUpdated = false;
389
+ let lr = context.lastRequested;
390
+ if (lr) {
391
+ let now = new Date();
392
+ let lastRequested = new Date(context.lastRequested);
393
+ let in60Mins = new Date(lastRequested.getFullYear(), lastRequested.getMonth(), lastRequested.getDate(), lastRequested.getHours(), lastRequested.getMinutes() + 60, 0, 0);
394
+ if (in60Mins.getTime() < now.getTime()) {
395
+ shouldBeUpdated = true;
396
+ }
397
+ }
398
+ else {
399
+ shouldBeUpdated = true;
400
+ }
401
+ if (shouldBeUpdated) {
402
+ this.updateCurrent();
322
403
  }
323
- return filled;
324
404
  }
325
- catch (error) {
326
- if (error instanceof RangeError) {
327
- return [NaN];
405
+ //Public
406
+ init(context = null) {
407
+ if (context) {
408
+ this.current = context;
328
409
  }
329
- throw error;
330
410
  }
331
- }
332
- function hackyOffset(dtf, date) {
333
- var formatted = dtf.format(date).replace(/\u200E/g, '');
334
- var parsed = /(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(formatted);
335
- // var [, fMonth, fDay, fYear, fHour, fMinute, fSecond] = parsed
336
- // return [fYear, fMonth, fDay, fHour, fMinute, fSecond]
337
- return [parsed[3], parsed[1], parsed[2], parsed[4], parsed[5], parsed[6]];
338
- }
339
- // Get a cached Intl.DateTimeFormat instance for the IANA `timeZone`. This can be used
340
- // to get deterministic local date/time output according to the `en-US` locale which
341
- // can be used to extract local time parts as necessary.
342
- var dtfCache = {};
343
- function getDateTimeFormat(timeZone) {
344
- if (!dtfCache[timeZone]) {
345
- // New browsers use `hourCycle`, IE and Chrome <73 does not support it and uses `hour12`
346
- var testDateFormatted = new Intl.DateTimeFormat('en-US', {
347
- hour12: false,
348
- timeZone: 'America/New_York',
349
- year: 'numeric',
350
- month: 'numeric',
351
- day: '2-digit',
352
- hour: '2-digit',
353
- minute: '2-digit',
354
- second: '2-digit',
355
- }).format(new Date('2014-06-25T04:00:00.123Z'));
356
- var hourCycleSupported = testDateFormatted === '06/25/2014, 00:00:00' ||
357
- testDateFormatted === '06/25/2014 00:00:00';
358
- dtfCache[timeZone] = hourCycleSupported
359
- ? new Intl.DateTimeFormat('en-US', {
360
- hour12: false,
361
- timeZone: timeZone,
362
- year: 'numeric',
363
- month: 'numeric',
364
- day: '2-digit',
365
- hour: '2-digit',
366
- minute: '2-digit',
367
- second: '2-digit',
368
- })
369
- : new Intl.DateTimeFormat('en-US', {
370
- hourCycle: 'h23',
371
- timeZone: timeZone,
372
- year: 'numeric',
373
- month: 'numeric',
374
- day: '2-digit',
375
- hour: '2-digit',
376
- minute: '2-digit',
377
- second: '2-digit',
378
- });
411
+ loadRequiredJsonFiles() {
412
+ return null;
379
413
  }
380
- return dtfCache[timeZone];
414
+ loadRequiredItems() {
415
+ return null;
416
+ }
417
+ updateCurrent() {
418
+ this.getCurrentContext();
419
+ }
420
+ //Storage
421
+ clearLocalStorage() {
422
+ this.localStorage.clear();
423
+ }
424
+ clearSessionStorage() {
425
+ this.sessionStorage.clear();
426
+ }
427
+ clearWebStorage() {
428
+ this.clearLocalStorage();
429
+ this.clearSessionStorage();
430
+ }
431
+ //current
432
+ get current() {
433
+ this.updateCurrentIfExpired();
434
+ return this.getCurrent4Session();
435
+ }
436
+ set current(value) {
437
+ this.setCurrent2Session(value);
438
+ this.fireUpdated(value);
439
+ }
440
+ //user
441
+ get user() {
442
+ let current = this.current;
443
+ return current?.user;
444
+ }
445
+ /* Storage Caching ----------------------------------------------------------BEGIN */
446
+ //version => localStorage
447
+ get version() {
448
+ return this.localStorage.getObject(AppContextStorageKeys.version);
449
+ }
450
+ set version(value) {
451
+ this.localStorage.setObject(AppContextStorageKeys.version, value);
452
+ }
453
+ //currency => localStorage
454
+ get currency() {
455
+ return this.localStorage.getObject(AppContextStorageKeys.currency);
456
+ }
457
+ set currency(value) {
458
+ this.localStorage.setObject(AppContextStorageKeys.currency, value);
459
+ }
460
+ clearCurrency() {
461
+ this.localStorage.remove(AppContextStorageKeys.currency);
462
+ }
463
+ //countries => localStorage
464
+ get countries() {
465
+ return this.localStorage.getObject(AppContextStorageKeys.countries);
466
+ }
467
+ set countries(value) {
468
+ this.localStorage.setObject(AppContextStorageKeys.countries, value);
469
+ }
470
+ clearCountries() {
471
+ this.localStorage.remove(AppContextStorageKeys.countries);
472
+ }
473
+ //languages => localStorage
474
+ get languages() {
475
+ return this.localStorage.getObject(AppContextStorageKeys.languages);
476
+ }
477
+ set languages(value) {
478
+ this.localStorage.setObject(AppContextStorageKeys.languages, value);
479
+ }
480
+ clearLanguages() {
481
+ this.localStorage.remove(AppContextStorageKeys.languages);
482
+ }
483
+ static { this.ɵfac = function AppContextService_Factory(t) { return new (t || AppContextService)(i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(LocalStorageService), i0.ɵɵinject(SessionStorageService)); }; }
484
+ static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: AppContextService, factory: AppContextService.ɵfac }); }
381
485
  }
486
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AppContextService, [{
487
+ type: Injectable
488
+ }], () => [{ type: i1.HttpClient }, { type: LocalStorageService }, { type: SessionStorageService }], null); })();
382
489
 
383
490
  /*
384
491
  <file>
@@ -390,175 +497,37 @@ function getDateTimeFormat(timeZone) {
390
497
  Anatoly Osovitny anatoly.osovitny@osovitny.com
391
498
 
392
499
  Created:
393
- 10 Feb 2024
500
+ 1 Apr 2024
394
501
 
395
502
  Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
396
503
  </file>
397
504
  */
398
- function tzParseTimezone(timezoneString, date, isUtcDate) {
399
- var token;
400
- var absoluteOffset;
401
- // Empty string
402
- if (!timezoneString) {
403
- return 0;
404
- }
405
- // Z
406
- token = patterns.timezoneZ.exec(timezoneString);
407
- if (token) {
408
- return 0;
409
- }
410
- var hours;
411
- // ±hh
412
- token = patterns.timezoneHH.exec(timezoneString);
413
- if (token) {
414
- hours = parseInt(token[1], 10);
415
- if (!validateTimezone(hours)) {
416
- return NaN;
417
- }
418
- return -(hours * MILLISECONDS_IN_HOUR);
419
- }
420
- // ±hh:mm or ±hhmm
421
- token = patterns.timezoneHHMM.exec(timezoneString);
422
- if (token) {
423
- hours = parseInt(token[1], 10);
424
- var minutes = parseInt(token[2], 10);
425
- if (!validateTimezone(hours, minutes)) {
426
- return NaN;
505
+ function getAppSettingsById(id) {
506
+ let apps = ClientApps;
507
+ if (apps && id) {
508
+ for (let i = 0; i < apps.length; i++) {
509
+ let app = apps[i];
510
+ if (app.id == id) {
511
+ return app;
512
+ }
427
513
  }
428
- absoluteOffset = Math.abs(hours) * MILLISECONDS_IN_HOUR + minutes * MILLISECONDS_IN_MINUTE;
429
- return hours > 0 ? -absoluteOffset : absoluteOffset;
430
- }
431
- // IANA time zone
432
- if (isValidTimezoneIANAString(timezoneString)) {
433
- date = new Date(date || Date.now());
434
- var utcDate = isUtcDate ? date : toUtcDate(date);
435
- var offset = calcOffset(utcDate, timezoneString);
436
- var fixedOffset = isUtcDate ? offset : fixOffset(date, offset, timezoneString);
437
- return -fixedOffset;
438
- }
439
- return NaN;
440
- }
441
- var MILLISECONDS_IN_HOUR = 3600000;
442
- var MILLISECONDS_IN_MINUTE = 60000;
443
- var patterns = {
444
- timezone: /([Z+-].*)$/,
445
- timezoneZ: /^(Z)$/,
446
- timezoneHH: /^([+-]\d{2})$/,
447
- timezoneHHMM: /^([+-]\d{2}):?(\d{2})$/,
448
- };
449
- function newDateUTC(fullYear, month, day, hour, minute, second, millisecond) {
450
- var utcDate = new Date(0);
451
- utcDate.setUTCFullYear(fullYear, month, day);
452
- utcDate.setUTCHours(hour, minute, second, millisecond);
453
- return utcDate;
454
- }
455
- function toUtcDate(date) {
456
- return newDateUTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());
457
- }
458
- function calcOffset(date, timezoneString) {
459
- var tokens = tzTokenizeDate(date, timezoneString);
460
- // ms dropped because it's not provided by tzTokenizeDate
461
- var asUTC = newDateUTC(tokens[0], tokens[1] - 1, tokens[2], tokens[3] % 24, tokens[4], tokens[5], 0).getTime();
462
- var asTS = date.getTime();
463
- var over = asTS % 1000;
464
- asTS -= over >= 0 ? over : 1000 + over;
465
- return asUTC - asTS;
466
- }
467
- function fixOffset(date, offset, timezoneString) {
468
- var localTS = date.getTime();
469
- // Our UTC time is just a guess because our offset is just a guess
470
- var utcGuess = localTS - offset;
471
- // Test whether the zone matches the offset for this ts
472
- var o2 = calcOffset(new Date(utcGuess), timezoneString);
473
- // If so, offset didn't change, and we're done
474
- if (offset === o2) {
475
- return offset;
476
- }
477
- // If not, change the ts by the difference in the offset
478
- utcGuess -= o2 - offset;
479
- // If that gives us the local time we want, we're done
480
- var o3 = calcOffset(new Date(utcGuess), timezoneString);
481
- if (o2 === o3) {
482
- return o2;
483
- }
484
- // If it's different, we're in a hole time. The offset has changed, but we don't adjust the time
485
- return Math.max(o2, o3);
486
- }
487
- function validateTimezone(hours, minutes = null) {
488
- return -23 <= hours && hours <= 23 && (minutes == null || (0 <= minutes && minutes <= 59));
489
- }
490
- var validIANATimezoneCache = {};
491
- function isValidTimezoneIANAString(timeZoneString) {
492
- if (validIANATimezoneCache[timeZoneString])
493
- return true;
494
- try {
495
- new Intl.DateTimeFormat(undefined, { timeZone: timeZoneString });
496
- validIANATimezoneCache[timeZoneString] = true;
497
- return true;
498
- }
499
- catch (error) {
500
- return false;
501
514
  }
515
+ return null;
502
516
  }
503
-
504
- /*
505
- <file>
506
- Project:
507
- @osovitny/anatoly
508
-
509
- Authors:
510
- Vadim Osovitny vadim.osovitny@osovitny.com
511
-
512
- Created:
513
- 09 Feb 2024
514
-
515
- Source:
516
- https://github.com/date-fns/date-fns/blob/main/src/toDate/index.ts
517
-
518
- tz:
519
- https://www.npmjs.com/package/date-fns-tz
520
- https://github.com/marnusw/date-fns-tz/blob/master/src/utcToZonedTime/index.js
521
- https://github.com/marnusw/date-fns-tz/blob/master/src/_lib/tzParseTimezone/index.js
522
-
523
- Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
524
- </file>
525
- */
526
- class DateConvert {
527
- static toDate(argument) {
528
- const argStr = Object.prototype.toString.call(argument);
529
- if (argument instanceof Date || (typeof argument === "object" && argStr === "[object Date]")) {
530
- return argument;
531
- }
532
- else if (typeof argument === "number" || argStr === "[object Number]" ||
533
- typeof argument === "string" || argStr === "[object String]") {
534
- return new Date(argument);
535
- }
536
- else {
537
- return new Date(NaN);
538
- }
539
- }
540
- static utcToLocal(dirtyDate) {
541
- if (typeof dirtyDate === 'string') {
542
- if (dirtyDate.indexOf("T") > -1) {
543
- dirtyDate = dirtyDate.replace("T", " ");
544
- }
545
- if (dirtyDate.indexOf("Z") == -1) {
546
- dirtyDate = dirtyDate + "Z";
517
+ function getAppSettingsByName(name) {
518
+ let apps = ClientApps;
519
+ if (apps && name) {
520
+ for (let i = 0; i < apps.length; i++) {
521
+ let app = apps[i];
522
+ if (app.name == name) {
523
+ return app;
547
524
  }
548
525
  }
549
- let browserTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
550
- if (browserTimeZone) {
551
- let date = DateConvert.toDate(dirtyDate);
552
- let offsetMilliseconds = tzParseTimezone(browserTimeZone, date, true);
553
- let d = new Date(date.getTime() - offsetMilliseconds);
554
- let resultDate = new Date(0);
555
- resultDate.setFullYear(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate());
556
- resultDate.setHours(d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds(), d.getUTCMilliseconds());
557
- return resultDate;
558
- }
559
- return new Date(dirtyDate);
560
526
  }
527
+ return null;
561
528
  }
529
+ const AppName = document.getElementById('appName').getAttribute('data-appname');
530
+ const AppSettings = getAppSettingsByName(AppName);
562
531
 
563
532
  /*
564
533
  <file>
@@ -570,28 +539,22 @@ class DateConvert {
570
539
  Anatoly Osovitny anatoly.osovitny@osovitny.com
571
540
 
572
541
  Created:
573
- 10 Sep 2022
574
-
575
- Code:
576
- https://www.npmjs.com/package/js-beautify
577
- https://beautifier.io
542
+ 1 Apr 2024
578
543
 
579
544
  Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
580
545
  </file>
581
546
  */
582
- //var beautify_html = require('js-beautify').html;
583
- class XmlFormatter {
584
- static toPrettyXML(s, options) {
585
- if (!options) {
586
- options = {
587
- indent_size: 2,
588
- indent_char: " ",
589
- wrap_line_length: 110
590
- };
591
- }
592
- return js_beautify.html(s, options);
593
- }
594
- }
547
+ const dateTimeFormats = {
548
+ medium: 'dd MMM yyyy HH:mm'
549
+ };
550
+ const dateFormats = {
551
+ medium: "dd MMM yyyy",
552
+ short: "dd/MM/yyyy"
553
+ };
554
+ const timeFormats = {
555
+ medium: "HH:mm:ss",
556
+ short: "HH:mm"
557
+ };
595
558
 
596
559
  /*
597
560
  <file>
@@ -600,7 +563,6 @@ class XmlFormatter {
600
563
 
601
564
  Authors:
602
565
  Vadim Osovitny vadim.osovitny@osovitny.com
603
- Anatoly Osovitny anatoly.osovitny@osovitny.com
604
566
 
605
567
  Created:
606
568
  11 Nov 2024
@@ -608,41 +570,17 @@ class XmlFormatter {
608
570
  Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
609
571
  </file>
610
572
  */
611
- var DiscountCodeType;
612
- (function (DiscountCodeType) {
613
- DiscountCodeType[DiscountCodeType["Standard"] = 1] = "Standard";
614
- DiscountCodeType[DiscountCodeType["UseOnce"] = 2] = "UseOnce";
615
- })(DiscountCodeType || (DiscountCodeType = {}));
616
- var DiscountCodeStatus;
617
- (function (DiscountCodeStatus) {
618
- DiscountCodeStatus[DiscountCodeStatus["Exist"] = 1] = "Exist";
619
- DiscountCodeStatus[DiscountCodeStatus["NotFound"] = 2] = "NotFound";
620
- DiscountCodeStatus[DiscountCodeStatus["AlreadyUsed"] = 3] = "AlreadyUsed";
621
- })(DiscountCodeStatus || (DiscountCodeStatus = {}));
622
- var PaymentType;
623
- (function (PaymentType) {
624
- PaymentType[PaymentType["FullPayment"] = 1] = "FullPayment";
625
- PaymentType[PaymentType["WeeklyPayment"] = 2] = "WeeklyPayment";
626
- PaymentType[PaymentType["BiWeeklyPayment"] = 3] = "BiWeeklyPayment";
627
- PaymentType[PaymentType["MonthlyPayment"] = 4] = "MonthlyPayment";
628
- })(PaymentType || (PaymentType = {}));
629
- var PaymentMethod;
630
- (function (PaymentMethod) {
631
- PaymentMethod[PaymentMethod["None"] = 1] = "None";
632
- PaymentMethod[PaymentMethod["DigitalWallet"] = 2] = "DigitalWallet";
633
- PaymentMethod[PaymentMethod["CreditCard"] = 3] = "CreditCard";
634
- PaymentMethod[PaymentMethod["PayPal"] = 4] = "PayPal";
635
- PaymentMethod[PaymentMethod["Stripe"] = 5] = "Stripe";
636
- PaymentMethod[PaymentMethod["Venmo"] = 6] = "Venmo";
637
- PaymentMethod[PaymentMethod["ApplePay"] = 7] = "ApplePay";
638
- PaymentMethod[PaymentMethod["GooglePay"] = 8] = "GooglePay";
639
- })(PaymentMethod || (PaymentMethod = {}));
640
- var PaymentStage;
641
- (function (PaymentStage) {
642
- //PayPal/Stripe
643
- PaymentStage[PaymentStage["External"] = 1] = "External";
644
- PaymentStage[PaymentStage["Internal"] = 2] = "Internal";
645
- })(PaymentStage || (PaymentStage = {}));
573
+ const GAEvents = {
574
+ login: {
575
+ signin: 'osa_login_signin',
576
+ signin_success: 'osa_login_signin_success',
577
+ signup: 'osa_login_signup',
578
+ signup_success: 'osa_login_signup_success'
579
+ }
580
+ };
581
+ const GABillingEvents = {
582
+ payment: 'osa_billing_payment'
583
+ };
646
584
 
647
585
  /*
648
586
  <file>
@@ -651,116 +589,95 @@ var PaymentStage;
651
589
 
652
590
  Authors:
653
591
  Vadim Osovitny vadim.osovitny@osovitny.com
654
-
592
+ Anatoly Osovitny anatoly.osovitny@osovitny.com
593
+
655
594
  Created:
656
- 11 Nov 2024
595
+ 29 June 2020
657
596
 
658
597
  Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
659
598
  </file>
660
599
  */
661
- var DataViewType;
662
- (function (DataViewType) {
663
- DataViewType["Grid"] = "grid";
664
- DataViewType["List"] = "list";
665
- })(DataViewType || (DataViewType = {}));
666
- var PublishStatus;
667
- (function (PublishStatus) {
668
- PublishStatus[PublishStatus["Draft"] = 1] = "Draft";
669
- PublishStatus[PublishStatus["PendingReview"] = 2] = "PendingReview";
670
- PublishStatus[PublishStatus["Published"] = 3] = "Published";
671
- PublishStatus[PublishStatus["Archived"] = 4] = "Archived";
672
- })(PublishStatus || (PublishStatus = {}));
673
- var ModerationStatus;
674
- (function (ModerationStatus) {
675
- ModerationStatus[ModerationStatus["Draft"] = 1] = "Draft";
676
- ModerationStatus[ModerationStatus["PendingReview"] = 2] = "PendingReview";
677
- ModerationStatus[ModerationStatus["Approved"] = 3] = "Approved";
678
- ModerationStatus[ModerationStatus["Rejected"] = 4] = "Rejected"; //item is rejected by Moderator
679
- })(ModerationStatus || (ModerationStatus = {}));
680
-
681
- /*
682
- <file>
683
- Project:
684
- @osovitny/anatoly
685
-
686
- Authors:
687
- Vadim Osovitny vadim.osovitny@osovitny.com
688
-
689
- Created:
690
- 17 Jun 2018
691
-
692
- Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
693
- </file>
694
- */
695
- //Node
696
- class GoServiceBase {
697
- constructor(route, router) {
698
- this.route = route;
699
- this.router = router;
700
- this.rootRoute = '/';
701
- this.init();
702
- }
703
- init() {
704
- if (AppSettings?.root != '/') {
705
- this.rootRoute = AppSettings.root;
600
+ class Convert {
601
+ static pad(number) {
602
+ if (number < 10) {
603
+ return '0' + number;
706
604
  }
605
+ return number;
707
606
  }
708
- getHomeUrl() {
709
- return this.rootRoute;
607
+ static enumToString(enumeration, value) {
608
+ for (let k in enumeration)
609
+ if (enumeration[k] == value)
610
+ return k;
611
+ return null;
710
612
  }
711
- navigate(commands, reload = false) {
712
- if (reload) {
713
- this.router.navigate(commands).then(() => {
714
- this.locationReload();
715
- });
613
+ static enumToArray(enumeration, valueAsInt = true, notIncludes) {
614
+ const notIncludeFiler = (value) => {
615
+ if (isNaN(Number(value))) {
616
+ return false;
617
+ }
618
+ if (notIncludes) {
619
+ for (let i in notIncludes) {
620
+ if (notIncludes[i] == value)
621
+ return false;
622
+ }
623
+ }
624
+ return true;
625
+ };
626
+ if (valueAsInt) {
627
+ return Object.keys(enumeration)
628
+ .filter(notIncludeFiler)
629
+ .map(key => ({
630
+ value: parseInt(key),
631
+ text: enumeration[key]
632
+ }));
716
633
  }
717
634
  else {
718
- this.router.navigate(commands);
635
+ return Object.keys(enumeration)
636
+ .filter(notIncludeFiler)
637
+ .map(key => ({
638
+ value: key,
639
+ text: enumeration[key]
640
+ }));
719
641
  }
720
642
  }
721
- homeReload() {
722
- window.location.href = "/";
723
- }
724
- locationReload() {
725
- window.location.reload();
726
- }
727
- home() {
728
- this.router.navigate([this.rootRoute]);
729
- }
730
- //Accounts
731
- accountClosed() {
732
- this.navigate([this.rootRoute + '/accounts/closed']);
733
- }
734
- //Errors
735
- error() {
736
- this.navigate([this.rootRoute + '/errors/error']);
737
- }
738
- //401 Unauthorized
739
- error401() {
740
- this.navigate([this.rootRoute + '/errors/401']);
643
+ static stringToArray(str, separator = ',') {
644
+ if (str) {
645
+ return str.split(separator).filter(element => element);
646
+ }
647
+ return [];
741
648
  }
742
- //402 Payment Required
743
- error402() {
744
- this.navigate([this.rootRoute + '/errors/402']);
649
+ static stringToIntArray(str, separator = ',') {
650
+ if (str) {
651
+ return str.split(separator).filter(element => element).map(value => parseInt(value));
652
+ }
653
+ return [];
745
654
  }
746
- //403 Forbidden
747
- error403() {
748
- this.navigate([this.rootRoute + '/errors/403']);
655
+ static company2String(comp) {
656
+ let company = JSON.parse(comp);
657
+ if (company) {
658
+ return `${company.name} ${company.phone} ${company.email} ${company.websiteUrl}`;
659
+ }
749
660
  }
750
- //404 Not Found
751
- error404() {
752
- this.navigate([this.rootRoute + '/errors/404']);
661
+ static address2String(adr) {
662
+ let address = JSON.parse(adr);
663
+ return `${address.street} ${address.street2} ${address.city} ${address.stateOrRegion} ${address.zipcode} ${address.country}`;
753
664
  }
754
- //500 Internal Server Error
755
- error500() {
756
- this.navigate([this.rootRoute + '/errors/500']);
665
+ static stringToBoolean(value) {
666
+ switch (value.toLowerCase().trim()) {
667
+ case "true":
668
+ case "yes":
669
+ case "1":
670
+ return true;
671
+ case "false":
672
+ case "no":
673
+ case "0":
674
+ case null:
675
+ return false;
676
+ default:
677
+ return Boolean(value);
678
+ }
757
679
  }
758
- static { this.ɵfac = function GoServiceBase_Factory(t) { return new (t || GoServiceBase)(i0.ɵɵinject(i1.ActivatedRoute), i0.ɵɵinject(i1.Router)); }; }
759
- static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: GoServiceBase, factory: GoServiceBase.ɵfac }); }
760
680
  }
761
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(GoServiceBase, [{
762
- type: Injectable
763
- }], () => [{ type: i1.ActivatedRoute }, { type: i1.Router }], null); })();
764
681
 
765
682
  /*
766
683
  <file>
@@ -772,15 +689,95 @@ class GoServiceBase {
772
689
  Anatoly Osovitny anatoly.osovitny@osovitny.com
773
690
 
774
691
  Created:
775
- 26 Jun 2020
692
+ 10 Feb 2024
776
693
 
777
694
  Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
778
695
  </file>
779
696
  */
780
- class Guid {
781
- static newGuid() {
782
- return v4();
697
+ /**
698
+ * Returns the [year, month, day, hour, minute, seconds] tokens of the provided
699
+ * `date` as it will be rendered in the `timeZone`.
700
+ */
701
+ function tzTokenizeDate(date, timeZone) {
702
+ var dtf = getDateTimeFormat(timeZone);
703
+ return dtf.formatToParts ? partsOffset(dtf, date) : hackyOffset(dtf, date);
704
+ }
705
+ var typeToPos = {
706
+ year: 0,
707
+ month: 1,
708
+ day: 2,
709
+ hour: 3,
710
+ minute: 4,
711
+ second: 5,
712
+ };
713
+ function partsOffset(dtf, date) {
714
+ try {
715
+ var formatted = dtf.formatToParts(date);
716
+ var filled = [];
717
+ for (var i = 0; i < formatted.length; i++) {
718
+ var pos = typeToPos[formatted[i].type];
719
+ if (pos >= 0) {
720
+ filled[pos] = parseInt(formatted[i].value, 10);
721
+ }
722
+ }
723
+ return filled;
724
+ }
725
+ catch (error) {
726
+ if (error instanceof RangeError) {
727
+ return [NaN];
728
+ }
729
+ throw error;
730
+ }
731
+ }
732
+ function hackyOffset(dtf, date) {
733
+ var formatted = dtf.format(date).replace(/\u200E/g, '');
734
+ var parsed = /(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(formatted);
735
+ // var [, fMonth, fDay, fYear, fHour, fMinute, fSecond] = parsed
736
+ // return [fYear, fMonth, fDay, fHour, fMinute, fSecond]
737
+ return [parsed[3], parsed[1], parsed[2], parsed[4], parsed[5], parsed[6]];
738
+ }
739
+ // Get a cached Intl.DateTimeFormat instance for the IANA `timeZone`. This can be used
740
+ // to get deterministic local date/time output according to the `en-US` locale which
741
+ // can be used to extract local time parts as necessary.
742
+ var dtfCache = {};
743
+ function getDateTimeFormat(timeZone) {
744
+ if (!dtfCache[timeZone]) {
745
+ // New browsers use `hourCycle`, IE and Chrome <73 does not support it and uses `hour12`
746
+ var testDateFormatted = new Intl.DateTimeFormat('en-US', {
747
+ hour12: false,
748
+ timeZone: 'America/New_York',
749
+ year: 'numeric',
750
+ month: 'numeric',
751
+ day: '2-digit',
752
+ hour: '2-digit',
753
+ minute: '2-digit',
754
+ second: '2-digit',
755
+ }).format(new Date('2014-06-25T04:00:00.123Z'));
756
+ var hourCycleSupported = testDateFormatted === '06/25/2014, 00:00:00' ||
757
+ testDateFormatted === '06/25/2014 00:00:00';
758
+ dtfCache[timeZone] = hourCycleSupported
759
+ ? new Intl.DateTimeFormat('en-US', {
760
+ hour12: false,
761
+ timeZone: timeZone,
762
+ year: 'numeric',
763
+ month: 'numeric',
764
+ day: '2-digit',
765
+ hour: '2-digit',
766
+ minute: '2-digit',
767
+ second: '2-digit',
768
+ })
769
+ : new Intl.DateTimeFormat('en-US', {
770
+ hourCycle: 'h23',
771
+ timeZone: timeZone,
772
+ year: 'numeric',
773
+ month: 'numeric',
774
+ day: '2-digit',
775
+ hour: '2-digit',
776
+ minute: '2-digit',
777
+ second: '2-digit',
778
+ });
783
779
  }
780
+ return dtfCache[timeZone];
784
781
  }
785
782
 
786
783
  /*
@@ -790,85 +787,119 @@ class Guid {
790
787
 
791
788
  Authors:
792
789
  Vadim Osovitny vadim.osovitny@osovitny.com
790
+ Anatoly Osovitny anatoly.osovitny@osovitny.com
793
791
 
794
792
  Created:
795
- 13 Nov 2017
793
+ 10 Feb 2024
796
794
 
797
795
  Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
798
796
  </file>
799
797
  */
800
- //Node
801
- class ApiServiceBase {
802
- constructor(http) {
803
- this.http = http;
798
+ function tzParseTimezone(timezoneString, date, isUtcDate) {
799
+ var token;
800
+ var absoluteOffset;
801
+ // Empty string
802
+ if (!timezoneString) {
803
+ return 0;
804
804
  }
805
- serializeParams(data) {
806
- return data ? ('?' + $.param(data)) : "";
807
- }
808
- //api
809
- get(action, data, responseType) {
810
- if (!responseType) {
811
- responseType = 'json';
812
- }
813
- var url = `${this.baseUrl}/${action}${this.serializeParams(data)}`;
814
- return this.http.get(url, { responseType: responseType }).pipe(map(res => res));
815
- }
816
- post(action, data, responseType) {
817
- if (!responseType) {
818
- responseType = 'text';
819
- }
820
- var url = `${this.baseUrl}/${action}`;
821
- return this.http.post(url, data, { responseType: responseType });
805
+ // Z
806
+ token = patterns.timezoneZ.exec(timezoneString);
807
+ if (token) {
808
+ return 0;
822
809
  }
823
- postQS(action, data, responseType) {
824
- if (!responseType) {
825
- responseType = 'text';
810
+ var hours;
811
+ // ±hh
812
+ token = patterns.timezoneHH.exec(timezoneString);
813
+ if (token) {
814
+ hours = parseInt(token[1], 10);
815
+ if (!validateTimezone(hours)) {
816
+ return NaN;
826
817
  }
827
- var url = `${this.baseUrl}/${action}${this.serializeParams(data)}`;
828
- return this.http.post(url, null, { responseType: responseType });
818
+ return -(hours * MILLISECONDS_IN_HOUR);
829
819
  }
830
- delete(action, data, responseType) {
831
- if (!responseType) {
832
- responseType = 'text';
820
+ // ±hh:mm or ±hhmm
821
+ token = patterns.timezoneHHMM.exec(timezoneString);
822
+ if (token) {
823
+ hours = parseInt(token[1], 10);
824
+ var minutes = parseInt(token[2], 10);
825
+ if (!validateTimezone(hours, minutes)) {
826
+ return NaN;
833
827
  }
834
- var url = `${this.baseUrl}/${action}${this.serializeParams(data)}`;
835
- return this.http.delete(url, { responseType: responseType });
828
+ absoluteOffset = Math.abs(hours) * MILLISECONDS_IN_HOUR + minutes * MILLISECONDS_IN_MINUTE;
829
+ return hours > 0 ? -absoluteOffset : absoluteOffset;
836
830
  }
837
- //gets
838
- getExternalTextFile(url) {
839
- return this.http.get(url);
831
+ // IANA time zone
832
+ if (isValidTimezoneIANAString(timezoneString)) {
833
+ date = new Date(date || Date.now());
834
+ var utcDate = isUtcDate ? date : toUtcDate(date);
835
+ var offset = calcOffset(utcDate, timezoneString);
836
+ var fixedOffset = isUtcDate ? offset : fixOffset(date, offset, timezoneString);
837
+ return -fixedOffset;
840
838
  }
841
- //Json Files
842
- __getJsonFile(url) {
843
- const version = AppCoreSettings.version;
844
- const isCDNEnabled = AppCoreSettings.isCDNEnabled;
845
- const cdnSasToken = AppCoreSettings.cdnSasToken;
846
- if (isCDNEnabled) {
847
- url = url + cdnSasToken;
848
- }
849
- else {
850
- url = url + '?v=' + version;
851
- }
852
- return this.http.get(url);
839
+ return NaN;
840
+ }
841
+ var MILLISECONDS_IN_HOUR = 3600000;
842
+ var MILLISECONDS_IN_MINUTE = 60000;
843
+ var patterns = {
844
+ timezone: /([Z+-].*)$/,
845
+ timezoneZ: /^(Z)$/,
846
+ timezoneHH: /^([+-]\d{2})$/,
847
+ timezoneHHMM: /^([+-]\d{2}):?(\d{2})$/,
848
+ };
849
+ function newDateUTC(fullYear, month, day, hour, minute, second, millisecond) {
850
+ var utcDate = new Date(0);
851
+ utcDate.setUTCFullYear(fullYear, month, day);
852
+ utcDate.setUTCHours(hour, minute, second, millisecond);
853
+ return utcDate;
854
+ }
855
+ function toUtcDate(date) {
856
+ return newDateUTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());
857
+ }
858
+ function calcOffset(date, timezoneString) {
859
+ var tokens = tzTokenizeDate(date, timezoneString);
860
+ // ms dropped because it's not provided by tzTokenizeDate
861
+ var asUTC = newDateUTC(tokens[0], tokens[1] - 1, tokens[2], tokens[3] % 24, tokens[4], tokens[5], 0).getTime();
862
+ var asTS = date.getTime();
863
+ var over = asTS % 1000;
864
+ asTS -= over >= 0 ? over : 1000 + over;
865
+ return asUTC - asTS;
866
+ }
867
+ function fixOffset(date, offset, timezoneString) {
868
+ var localTS = date.getTime();
869
+ // Our UTC time is just a guess because our offset is just a guess
870
+ var utcGuess = localTS - offset;
871
+ // Test whether the zone matches the offset for this ts
872
+ var o2 = calcOffset(new Date(utcGuess), timezoneString);
873
+ // If so, offset didn't change, and we're done
874
+ if (offset === o2) {
875
+ return offset;
853
876
  }
854
- getLibJsonFile(fileName) {
855
- const url = AppCoreSettings.libUrl + '/jsons';
856
- return this.__getJsonFile(url + "/" + fileName);
877
+ // If not, change the ts by the difference in the offset
878
+ utcGuess -= o2 - offset;
879
+ // If that gives us the local time we want, we're done
880
+ var o3 = calcOffset(new Date(utcGuess), timezoneString);
881
+ if (o2 === o3) {
882
+ return o2;
857
883
  }
858
- getJsonFile(fileName) {
859
- const url = AppCoreSettings.assetsUrl + '/jsons';
860
- return this.__getJsonFile(url + "/" + fileName);
884
+ // If it's different, we're in a hole time. The offset has changed, but we don't adjust the time
885
+ return Math.max(o2, o3);
886
+ }
887
+ function validateTimezone(hours, minutes = null) {
888
+ return -23 <= hours && hours <= 23 && (minutes == null || (0 <= minutes && minutes <= 59));
889
+ }
890
+ var validIANATimezoneCache = {};
891
+ function isValidTimezoneIANAString(timeZoneString) {
892
+ if (validIANATimezoneCache[timeZoneString])
893
+ return true;
894
+ try {
895
+ new Intl.DateTimeFormat(undefined, { timeZone: timeZoneString });
896
+ validIANATimezoneCache[timeZoneString] = true;
897
+ return true;
861
898
  }
862
- getExternalJsonFile(libname, fileName) {
863
- const url = AppCoreSettings.externalUrl + "/" + libname + "/jsons";
864
- return this.__getJsonFile(url + "/" + fileName);
899
+ catch (error) {
900
+ return false;
865
901
  }
866
- static { this.ɵfac = function ApiServiceBase_Factory(t) { return new (t || ApiServiceBase)(i0.ɵɵinject(i1$1.HttpClient)); }; }
867
- static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ApiServiceBase, factory: ApiServiceBase.ɵfac }); }
868
902
  }
869
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ApiServiceBase, [{
870
- type: Injectable
871
- }], () => [{ type: i1$1.HttpClient }], null); })();
872
903
 
873
904
  /*
874
905
  <file>
@@ -877,38 +908,55 @@ class ApiServiceBase {
877
908
 
878
909
  Authors:
879
910
  Vadim Osovitny vadim.osovitny@osovitny.com
880
- Anatoly Osovitny anatoly.osovitny@osovitny.com
881
911
 
882
- Created:
883
- 20 Sep 2023
912
+ Created:
913
+ 09 Feb 2024
884
914
 
885
- Description:
886
- Identity and Access Management
915
+ Source:
916
+ https://github.com/date-fns/date-fns/blob/main/src/toDate/index.ts
887
917
 
888
- Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
918
+ tz:
919
+ https://www.npmjs.com/package/date-fns-tz
920
+ https://github.com/marnusw/date-fns-tz/blob/master/src/utcToZonedTime/index.js
921
+ https://github.com/marnusw/date-fns-tz/blob/master/src/_lib/tzParseTimezone/index.js
922
+
923
+ Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
889
924
  </file>
890
925
  */
891
- const MSALStorageKeys = {
892
- //LocalStorage
893
- redirectTo: 'msal.app.redirectTo'
894
- //SessionStorage
895
- };
896
- class MSALStorage {
897
- static saveRedirectState(redirectTo, calledBy) {
898
- if (redirectTo.indexOf('iam') >= 0) {
899
- return;
926
+ class DateConvert {
927
+ static toDate(argument) {
928
+ const argStr = Object.prototype.toString.call(argument);
929
+ if (argument instanceof Date || (typeof argument === "object" && argStr === "[object Date]")) {
930
+ return argument;
931
+ }
932
+ else if (typeof argument === "number" || argStr === "[object Number]" ||
933
+ typeof argument === "string" || argStr === "[object String]") {
934
+ return new Date(argument);
935
+ }
936
+ else {
937
+ return new Date(NaN);
900
938
  }
901
- localStorage.setItem(MSALStorageKeys.redirectTo, redirectTo);
902
- console.log(`msal.app: redirect state saved: ${redirectTo}. Called by: ${calledBy}`);
903
- }
904
- static getRedirectState(calledBy) {
905
- let redirectTo = localStorage.getItem(MSALStorageKeys.redirectTo);
906
- console.log(`msal.app: redirect state requested: ${redirectTo}. Called by: ${calledBy}`);
907
- return redirectTo;
908
939
  }
909
- static clearRedirectState(calledBy) {
910
- localStorage.removeItem(MSALStorageKeys.redirectTo);
911
- console.log(`msal.app: redirect state cleared. Called by: ${calledBy}`);
940
+ static utcToLocal(dirtyDate) {
941
+ if (typeof dirtyDate === 'string') {
942
+ if (dirtyDate.indexOf("T") > -1) {
943
+ dirtyDate = dirtyDate.replace("T", " ");
944
+ }
945
+ if (dirtyDate.indexOf("Z") == -1) {
946
+ dirtyDate = dirtyDate + "Z";
947
+ }
948
+ }
949
+ let browserTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
950
+ if (browserTimeZone) {
951
+ let date = DateConvert.toDate(dirtyDate);
952
+ let offsetMilliseconds = tzParseTimezone(browserTimeZone, date, true);
953
+ let d = new Date(date.getTime() - offsetMilliseconds);
954
+ let resultDate = new Date(0);
955
+ resultDate.setFullYear(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate());
956
+ resultDate.setHours(d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds(), d.getUTCMilliseconds());
957
+ return resultDate;
958
+ }
959
+ return new Date(dirtyDate);
912
960
  }
913
961
  }
914
962
 
@@ -921,22 +969,27 @@ class MSALStorage {
921
969
  Vadim Osovitny vadim.osovitny@osovitny.com
922
970
  Anatoly Osovitny anatoly.osovitny@osovitny.com
923
971
 
924
- Created:
925
- 20 Sep 2023
972
+ Created:
973
+ 10 Sep 2022
926
974
 
927
- Description:
928
- Identity and Access Management
975
+ Code:
976
+ https://www.npmjs.com/package/js-beautify
977
+ https://beautifier.io
929
978
 
930
- Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
979
+ Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
931
980
  </file>
932
981
  */
933
- class MSALRedirect {
934
- static handle(router, calledBy) {
935
- let redirectTo = MSALStorage.getRedirectState(calledBy);
936
- if (redirectTo) {
937
- MSALStorage.clearRedirectState(calledBy);
938
- router.navigate([redirectTo]);
982
+ //var beautify_html = require('js-beautify').html;
983
+ class XmlFormatter {
984
+ static toPrettyXML(s, options) {
985
+ if (!options) {
986
+ options = {
987
+ indent_size: 2,
988
+ indent_char: " ",
989
+ wrap_line_length: 110
990
+ };
939
991
  }
992
+ return js_beautify.html(s, options);
940
993
  }
941
994
  }
942
995
 
@@ -947,64 +1000,186 @@ class MSALRedirect {
947
1000
 
948
1001
  Authors:
949
1002
  Vadim Osovitny vadim.osovitny@osovitny.com
1003
+ Anatoly Osovitny anatoly.osovitny@osovitny.com
950
1004
 
951
- Created:
952
- 20 Sep 2023
953
-
954
- Description:
955
- Identity and Access Management
1005
+ Created:
1006
+ 11 Nov 2024
956
1007
 
957
- Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
1008
+ Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
958
1009
  </file>
959
1010
  */
960
- let msalSettings = document.getElementById("msalSettings").getAttribute('data-msalsettings');
961
- let MSALConfig = JSON.parse(msalSettings);
962
- let MSALApiConfig = MSALConfig?.api;
963
- let MSALB2CConfig = MSALConfig?.b2c;
964
-
965
- /*
966
- <file>
967
- Project:
968
- @osovitny/anatoly
969
-
970
- Authors:
1011
+ var DiscountCodeType;
1012
+ (function (DiscountCodeType) {
1013
+ DiscountCodeType[DiscountCodeType["Standard"] = 1] = "Standard";
1014
+ DiscountCodeType[DiscountCodeType["UseOnce"] = 2] = "UseOnce";
1015
+ })(DiscountCodeType || (DiscountCodeType = {}));
1016
+ var DiscountCodeStatus;
1017
+ (function (DiscountCodeStatus) {
1018
+ DiscountCodeStatus[DiscountCodeStatus["Exist"] = 1] = "Exist";
1019
+ DiscountCodeStatus[DiscountCodeStatus["NotFound"] = 2] = "NotFound";
1020
+ DiscountCodeStatus[DiscountCodeStatus["AlreadyUsed"] = 3] = "AlreadyUsed";
1021
+ })(DiscountCodeStatus || (DiscountCodeStatus = {}));
1022
+ var PaymentType;
1023
+ (function (PaymentType) {
1024
+ PaymentType[PaymentType["FullPayment"] = 1] = "FullPayment";
1025
+ PaymentType[PaymentType["WeeklyPayment"] = 2] = "WeeklyPayment";
1026
+ PaymentType[PaymentType["BiWeeklyPayment"] = 3] = "BiWeeklyPayment";
1027
+ PaymentType[PaymentType["MonthlyPayment"] = 4] = "MonthlyPayment";
1028
+ })(PaymentType || (PaymentType = {}));
1029
+ var PaymentMethod;
1030
+ (function (PaymentMethod) {
1031
+ PaymentMethod[PaymentMethod["None"] = 1] = "None";
1032
+ PaymentMethod[PaymentMethod["DigitalWallet"] = 2] = "DigitalWallet";
1033
+ PaymentMethod[PaymentMethod["CreditCard"] = 3] = "CreditCard";
1034
+ PaymentMethod[PaymentMethod["PayPal"] = 4] = "PayPal";
1035
+ PaymentMethod[PaymentMethod["Stripe"] = 5] = "Stripe";
1036
+ PaymentMethod[PaymentMethod["Venmo"] = 6] = "Venmo";
1037
+ PaymentMethod[PaymentMethod["ApplePay"] = 7] = "ApplePay";
1038
+ PaymentMethod[PaymentMethod["GooglePay"] = 8] = "GooglePay";
1039
+ })(PaymentMethod || (PaymentMethod = {}));
1040
+ var PaymentStage;
1041
+ (function (PaymentStage) {
1042
+ //PayPal/Stripe
1043
+ PaymentStage[PaymentStage["External"] = 1] = "External";
1044
+ PaymentStage[PaymentStage["Internal"] = 2] = "Internal";
1045
+ })(PaymentStage || (PaymentStage = {}));
1046
+
1047
+ /*
1048
+ <file>
1049
+ Project:
1050
+ @osovitny/anatoly
1051
+
1052
+ Authors:
971
1053
  Vadim Osovitny vadim.osovitny@osovitny.com
972
- Anatoly Osovitny anatoly.osovitny@osovitny.com
1054
+
1055
+ Created:
1056
+ 11 Nov 2024
973
1057
 
974
- Created:
975
- 27 Nov 2023
1058
+ Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
1059
+ </file>
1060
+ */
1061
+ var DataViewType;
1062
+ (function (DataViewType) {
1063
+ DataViewType["Grid"] = "grid";
1064
+ DataViewType["List"] = "list";
1065
+ })(DataViewType || (DataViewType = {}));
1066
+ var PublishStatus;
1067
+ (function (PublishStatus) {
1068
+ PublishStatus[PublishStatus["Draft"] = 1] = "Draft";
1069
+ PublishStatus[PublishStatus["PendingReview"] = 2] = "PendingReview";
1070
+ PublishStatus[PublishStatus["Published"] = 3] = "Published";
1071
+ PublishStatus[PublishStatus["Archived"] = 4] = "Archived";
1072
+ })(PublishStatus || (PublishStatus = {}));
1073
+ var ModerationStatus;
1074
+ (function (ModerationStatus) {
1075
+ ModerationStatus[ModerationStatus["Draft"] = 1] = "Draft";
1076
+ ModerationStatus[ModerationStatus["PendingReview"] = 2] = "PendingReview";
1077
+ ModerationStatus[ModerationStatus["Approved"] = 3] = "Approved";
1078
+ ModerationStatus[ModerationStatus["Rejected"] = 4] = "Rejected"; //item is rejected by Moderator
1079
+ })(ModerationStatus || (ModerationStatus = {}));
976
1080
 
977
- Description:
978
- Identity and Access Management
1081
+ /*
1082
+ <file>
1083
+ Project:
1084
+ @osovitny/anatoly
979
1085
 
980
- Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
1086
+ Authors:
1087
+ Vadim Osovitny vadim.osovitny@osovitny.com
1088
+
1089
+ Created:
1090
+ 17 Jun 2018
1091
+
1092
+ Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
981
1093
  </file>
982
1094
  */
983
1095
  //Node
984
- class MSALUtils {
985
- static isB2C() {
986
- if (MSALB2CConfig) {
987
- return true;
988
- }
989
- return false;
1096
+ class GoServiceBase {
1097
+ constructor(route, router) {
1098
+ this.route = route;
1099
+ this.router = router;
1100
+ this.rootRoute = '/';
1101
+ this.init();
990
1102
  }
991
- // Don't perform initial navigation in iframes or popups
992
- static initialNavigation() {
993
- return !BrowserUtils.isInIframe() && !BrowserUtils.isInPopup() ? 'enabledNonBlocking' : 'disabled';
1103
+ init() {
1104
+ if (AppSettings?.root != '/') {
1105
+ this.rootRoute = AppSettings.root;
1106
+ }
994
1107
  }
995
- static getApi() {
996
- let map = new Map();
997
- let api = MSALApiConfig;
998
- map.set(api.uri, api.scopes);
999
- return map;
1108
+ getHomeUrl() {
1109
+ return this.rootRoute;
1000
1110
  }
1001
- static getApiScopes() {
1002
- let scopes = [];
1003
- let api = MSALApiConfig;
1004
- for (const scope of api.scopes) {
1005
- scopes.push(scope);
1111
+ navigate(commands, reload = false) {
1112
+ if (reload) {
1113
+ this.router.navigate(commands).then(() => {
1114
+ this.locationReload();
1115
+ });
1006
1116
  }
1007
- return scopes;
1117
+ else {
1118
+ this.router.navigate(commands);
1119
+ }
1120
+ }
1121
+ homeReload() {
1122
+ window.location.href = "/";
1123
+ }
1124
+ locationReload() {
1125
+ window.location.reload();
1126
+ }
1127
+ home() {
1128
+ this.router.navigate([this.rootRoute]);
1129
+ }
1130
+ //Accounts
1131
+ accountClosed() {
1132
+ this.navigate([this.rootRoute + '/accounts/closed']);
1133
+ }
1134
+ //Errors
1135
+ error() {
1136
+ this.navigate([this.rootRoute + '/errors/error']);
1137
+ }
1138
+ //401 Unauthorized
1139
+ error401() {
1140
+ this.navigate([this.rootRoute + '/errors/401']);
1141
+ }
1142
+ //402 Payment Required
1143
+ error402() {
1144
+ this.navigate([this.rootRoute + '/errors/402']);
1145
+ }
1146
+ //403 Forbidden
1147
+ error403() {
1148
+ this.navigate([this.rootRoute + '/errors/403']);
1149
+ }
1150
+ //404 Not Found
1151
+ error404() {
1152
+ this.navigate([this.rootRoute + '/errors/404']);
1153
+ }
1154
+ //500 Internal Server Error
1155
+ error500() {
1156
+ this.navigate([this.rootRoute + '/errors/500']);
1157
+ }
1158
+ static { this.ɵfac = function GoServiceBase_Factory(t) { return new (t || GoServiceBase)(i0.ɵɵinject(i1$1.ActivatedRoute), i0.ɵɵinject(i1$1.Router)); }; }
1159
+ static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: GoServiceBase, factory: GoServiceBase.ɵfac }); }
1160
+ }
1161
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(GoServiceBase, [{
1162
+ type: Injectable
1163
+ }], () => [{ type: i1$1.ActivatedRoute }, { type: i1$1.Router }], null); })();
1164
+
1165
+ /*
1166
+ <file>
1167
+ Project:
1168
+ @osovitny/anatoly
1169
+
1170
+ Authors:
1171
+ Vadim Osovitny vadim.osovitny@osovitny.com
1172
+ Anatoly Osovitny anatoly.osovitny@osovitny.com
1173
+
1174
+ Created:
1175
+ 26 Jun 2020
1176
+
1177
+ Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
1178
+ </file>
1179
+ */
1180
+ class Guid {
1181
+ static newGuid() {
1182
+ return v4();
1008
1183
  }
1009
1184
  }
1010
1185
 
@@ -1026,24 +1201,27 @@ class MSALUtils {
1026
1201
  Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
1027
1202
  </file>
1028
1203
  */
1029
- //App
1030
- class MSALB2C {
1031
- static getAuthorityByType(type) {
1032
- let policy = MSALB2C.getPolicyByType(type);
1033
- return policy?.authority;
1034
- }
1035
- static getPolicyByType(type) {
1036
- let policies = MSALB2CConfig?.policies;
1037
- if (!policies) {
1038
- return null;
1039
- }
1040
- for (let i = 0; i < policies.length; i++) {
1041
- let policy = policies[i];
1042
- if (policy.type == type) {
1043
- return policy;
1044
- }
1204
+ const MSALStorageKeys = {
1205
+ //LocalStorage
1206
+ redirectTo: 'msal.app.redirectTo'
1207
+ //SessionStorage
1208
+ };
1209
+ class MSALStorage {
1210
+ static saveRedirectState(redirectTo, calledBy) {
1211
+ if (redirectTo.indexOf('iam') >= 0) {
1212
+ return;
1045
1213
  }
1046
- return null;
1214
+ localStorage.setItem(MSALStorageKeys.redirectTo, redirectTo);
1215
+ console.log(`msal.app: redirect state saved: ${redirectTo}. Called by: ${calledBy}`);
1216
+ }
1217
+ static getRedirectState(calledBy) {
1218
+ let redirectTo = localStorage.getItem(MSALStorageKeys.redirectTo);
1219
+ console.log(`msal.app: redirect state requested: ${redirectTo}. Called by: ${calledBy}`);
1220
+ return redirectTo;
1221
+ }
1222
+ static clearRedirectState(calledBy) {
1223
+ localStorage.removeItem(MSALStorageKeys.redirectTo);
1224
+ console.log(`msal.app: redirect state cleared. Called by: ${calledBy}`);
1047
1225
  }
1048
1226
  }
1049
1227
 
@@ -1065,12 +1243,15 @@ class MSALB2C {
1065
1243
  Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
1066
1244
  </file>
1067
1245
  */
1068
- const PolicyType = {
1069
- signUpSignIn: 'signUpSignIn',
1070
- signUp: 'signUp',
1071
- editProfile: 'editProfile',
1072
- resetPassword: 'resetPassword'
1073
- };
1246
+ class MSALRedirect {
1247
+ static handle(router, calledBy) {
1248
+ let redirectTo = MSALStorage.getRedirectState(calledBy);
1249
+ if (redirectTo) {
1250
+ MSALStorage.clearRedirectState(calledBy);
1251
+ router.navigate([redirectTo]);
1252
+ }
1253
+ }
1254
+ }
1074
1255
 
1075
1256
  /*
1076
1257
  <file>
@@ -1079,17 +1260,20 @@ const PolicyType = {
1079
1260
 
1080
1261
  Authors:
1081
1262
  Vadim Osovitny vadim.osovitny@osovitny.com
1082
- Anatoly Osovitny anatoly.osovitny@osovitny.com
1083
1263
 
1084
- Created:
1085
- 20 Sep 2023
1264
+ Created:
1265
+ 20 Sep 2023
1086
1266
 
1087
1267
  Description:
1088
1268
  Identity and Access Management
1089
1269
 
1090
- Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
1270
+ Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
1091
1271
  </file>
1092
1272
  */
1273
+ let msalSettings = document.getElementById("msalSettings").getAttribute('data-msalsettings');
1274
+ let MSALConfig = JSON.parse(msalSettings);
1275
+ let MSALApiConfig = MSALConfig?.api;
1276
+ let MSALB2CConfig = MSALConfig?.b2c;
1093
1277
 
1094
1278
  /*
1095
1279
  <file>
@@ -1100,44 +1284,40 @@ const PolicyType = {
1100
1284
  Vadim Osovitny vadim.osovitny@osovitny.com
1101
1285
  Anatoly Osovitny anatoly.osovitny@osovitny.com
1102
1286
 
1103
- Created:
1104
- 17 Apr 2023
1287
+ Created:
1288
+ 27 Nov 2023
1105
1289
 
1106
- Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
1107
- </file>
1108
- */
1109
- class Stopwatch {
1110
- constructor(name) {
1111
- this.name = name;
1112
- this.startTime = 0;
1113
- this.stopTime = 0;
1114
- this.running = false;
1115
- this.performance = !!window.performance;
1116
- console.log(this.name + ' started.');
1117
- }
1118
- currentTime() {
1119
- return this.performance ? window.performance.now() : new Date().getTime();
1290
+ Description:
1291
+ Identity and Access Management
1292
+
1293
+ Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
1294
+ </file>
1295
+ */
1296
+ //Node
1297
+ class MSALUtils {
1298
+ static isB2C() {
1299
+ if (MSALB2CConfig) {
1300
+ return true;
1301
+ }
1302
+ return false;
1120
1303
  }
1121
- start() {
1122
- this.startTime = this.currentTime();
1123
- this.running = true;
1304
+ // Don't perform initial navigation in iframes or popups
1305
+ static initialNavigation() {
1306
+ return !BrowserUtils.isInIframe() && !BrowserUtils.isInPopup() ? 'enabledNonBlocking' : 'disabled';
1124
1307
  }
1125
- stop() {
1126
- this.stopTime = this.currentTime();
1127
- this.running = false;
1308
+ static getApi() {
1309
+ let map = new Map();
1310
+ let api = MSALApiConfig;
1311
+ map.set(api.uri, api.scopes);
1312
+ return map;
1128
1313
  }
1129
- getElapsedMilliseconds() {
1130
- if (this.running) {
1131
- this.stopTime = this.currentTime();
1314
+ static getApiScopes() {
1315
+ let scopes = [];
1316
+ let api = MSALApiConfig;
1317
+ for (const scope of api.scopes) {
1318
+ scopes.push(scope);
1132
1319
  }
1133
- return this.stopTime - this.startTime;
1134
- }
1135
- getElapsedSeconds() {
1136
- return this.getElapsedMilliseconds() / 1000;
1137
- }
1138
- printElapsedAsMilliseconds() {
1139
- let elapsed = this.getElapsedMilliseconds();
1140
- console.log(`${this.name} stopped. Execution time: ${elapsed} ms`);
1320
+ return scopes;
1141
1321
  }
1142
1322
  }
1143
1323
 
@@ -1150,19 +1330,35 @@ class Stopwatch {
1150
1330
  Vadim Osovitny vadim.osovitny@osovitny.com
1151
1331
  Anatoly Osovitny anatoly.osovitny@osovitny.com
1152
1332
 
1153
- Created:
1154
- 28 Apr 2024
1333
+ Created:
1334
+ 20 Sep 2023
1155
1335
 
1156
- Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
1336
+ Description:
1337
+ Identity and Access Management
1338
+
1339
+ Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
1157
1340
  </file>
1158
1341
  */
1159
- const AppContextStorageKeys = {
1160
- version: 'version',
1161
- currency: 'currency',
1162
- //Lists
1163
- countries: 'countries',
1164
- languages: 'languages'
1165
- };
1342
+ //App
1343
+ class MSALB2C {
1344
+ static getAuthorityByType(type) {
1345
+ let policy = MSALB2C.getPolicyByType(type);
1346
+ return policy?.authority;
1347
+ }
1348
+ static getPolicyByType(type) {
1349
+ let policies = MSALB2CConfig?.policies;
1350
+ if (!policies) {
1351
+ return null;
1352
+ }
1353
+ for (let i = 0; i < policies.length; i++) {
1354
+ let policy = policies[i];
1355
+ if (policy.type == type) {
1356
+ return policy;
1357
+ }
1358
+ }
1359
+ return null;
1360
+ }
1361
+ }
1166
1362
 
1167
1363
  /*
1168
1364
  <file>
@@ -1173,60 +1369,21 @@ const AppContextStorageKeys = {
1173
1369
  Vadim Osovitny vadim.osovitny@osovitny.com
1174
1370
  Anatoly Osovitny anatoly.osovitny@osovitny.com
1175
1371
 
1176
- Created:
1177
- 26 Jun 2020
1372
+ Created:
1373
+ 20 Sep 2023
1178
1374
 
1179
- Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
1375
+ Description:
1376
+ Identity and Access Management
1377
+
1378
+ Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
1180
1379
  </file>
1181
1380
  */
1182
- //Node
1183
- class WebStorageService {
1184
- constructor(storage) {
1185
- this.storage = storage === 'local' || storage === 'localStorage' ? localStorage : sessionStorage;
1186
- }
1187
- setItem(key, value) {
1188
- this.storage.setItem(key, value);
1189
- }
1190
- setObject(key, value) {
1191
- this.storage.setItem(key, JSON.stringify(value));
1192
- }
1193
- getItem(key) {
1194
- return this.storage.getItem(key);
1195
- }
1196
- getObject(key) {
1197
- let value = this.storage.getItem(key);
1198
- if (!value) {
1199
- return null;
1200
- }
1201
- return JSON.parse(value);
1202
- }
1203
- remove(key) {
1204
- this.storage.removeItem(key);
1205
- }
1206
- clear() {
1207
- this.storage.clear();
1208
- }
1209
- }
1210
- class LocalStorageService extends WebStorageService {
1211
- constructor() {
1212
- super('localStorage');
1213
- }
1214
- static { this.ɵfac = function LocalStorageService_Factory(t) { return new (t || LocalStorageService)(); }; }
1215
- static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: LocalStorageService, factory: LocalStorageService.ɵfac }); }
1216
- }
1217
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LocalStorageService, [{
1218
- type: Injectable
1219
- }], () => [], null); })();
1220
- class SessionStorageService extends WebStorageService {
1221
- constructor() {
1222
- super('sessionStorage');
1223
- }
1224
- static { this.ɵfac = function SessionStorageService_Factory(t) { return new (t || SessionStorageService)(); }; }
1225
- static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: SessionStorageService, factory: SessionStorageService.ɵfac }); }
1226
- }
1227
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SessionStorageService, [{
1228
- type: Injectable
1229
- }], () => [], null); })();
1381
+ const PolicyType = {
1382
+ signUpSignIn: 'signUpSignIn',
1383
+ signUp: 'signUp',
1384
+ editProfile: 'editProfile',
1385
+ resetPassword: 'resetPassword'
1386
+ };
1230
1387
 
1231
1388
  /*
1232
1389
  <file>
@@ -1238,225 +1395,68 @@ class SessionStorageService extends WebStorageService {
1238
1395
  Anatoly Osovitny anatoly.osovitny@osovitny.com
1239
1396
 
1240
1397
  Created:
1241
- 13 Nov 2017
1398
+ 20 Sep 2023
1399
+
1400
+ Description:
1401
+ Identity and Access Management
1242
1402
 
1243
1403
  Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
1244
1404
  </file>
1245
1405
  */
1246
- //Node
1247
- class AppContextService extends ApiServiceBase {
1248
- constructor(http, localStorage, sessionStorage) {
1406
+
1407
+ class AuthService extends ApiServiceBase {
1408
+ constructor(http, router, appContext, msalGuardConfig, msalService, msalBroadcastService) {
1249
1409
  super(http);
1250
1410
  this.http = http;
1251
- this.localStorage = localStorage;
1252
- this.sessionStorage = sessionStorage;
1253
- this.storageKeyName = 'appContext';
1254
- this.subscription = null;
1255
- //Private Streams
1256
- this._updated = new BehaviorSubject(null);
1257
- this._userUpdated = new BehaviorSubject(null);
1258
- //Public Streams
1259
- this.updated$ = this._updated.asObservable();
1260
- this.userUpdated$ = this._userUpdated.asObservable();
1261
- this.baseUrl = `${ApiUrl}/appContext`;
1262
- }
1263
- fireUpdated(data) {
1264
- if (!data) {
1265
- return;
1266
- }
1267
- this._updated.next(data);
1268
- }
1269
- fireUserUpdated() {
1270
- this._userUpdated.next(null);
1411
+ this.router = router;
1412
+ this.appContext = appContext;
1413
+ this.msalGuardConfig = msalGuardConfig;
1414
+ this.msalService = msalService;
1415
+ this.msalBroadcastService = msalBroadcastService;
1416
+ this.msalDestroying$ = new Subject();
1417
+ this.initialized = false;
1418
+ this.init();
1271
1419
  }
1272
- //Session
1273
- getCurrent4Session() {
1274
- return this.sessionStorage.getObject(this.storageKeyName);
1420
+ ngOnDestroy() {
1421
+ this.msalDestroying$.next(undefined);
1422
+ this.msalDestroying$.complete();
1275
1423
  }
1276
- setCurrent2Session(value) {
1277
- this.sessionStorage.setObject(this.storageKeyName, value);
1424
+ init() {
1425
+ this.setDefaults();
1426
+ this.msalService.initialize().subscribe(() => {
1427
+ this.initialized = true;
1428
+ console.log(`msal.app: initMSAL started`);
1429
+ this.initMSAL();
1430
+ console.log(`msal.app: initMSAL finished`);
1431
+ });
1278
1432
  }
1279
- dataReceived(data) {
1280
- this.current = data;
1281
- this.subscription.unsubscribe();
1282
- this.subscription = null;
1433
+ setDefaults() {
1283
1434
  }
1284
- getCurrentContext() {
1285
- if (this.subscription != null) {
1286
- return;
1287
- }
1288
- //Logging
1289
- let stopwatch = new Stopwatch("AppContextService: Requesting a new AppContext");
1290
- stopwatch.start();
1291
- this.subscription = this.get('getCurrentContext', null).subscribe({
1292
- next: (data) => {
1293
- //Logging
1294
- stopwatch.stop();
1295
- stopwatch.printElapsedAsMilliseconds();
1296
- this.dataReceived(data);
1297
- }
1298
- });
1299
- }
1300
- updateCurrentIfExpired() {
1301
- let context = this.getCurrent4Session();
1302
- if (!context) {
1303
- return;
1304
- }
1305
- let shouldBeUpdated = false;
1306
- let lr = context.lastRequested;
1307
- if (lr) {
1308
- let now = new Date();
1309
- let lastRequested = new Date(context.lastRequested);
1310
- let in60Mins = new Date(lastRequested.getFullYear(), lastRequested.getMonth(), lastRequested.getDate(), lastRequested.getHours(), lastRequested.getMinutes() + 60, 0, 0);
1311
- if (in60Mins.getTime() < now.getTime()) {
1312
- shouldBeUpdated = true;
1313
- }
1314
- }
1315
- else {
1316
- shouldBeUpdated = true;
1317
- }
1318
- if (shouldBeUpdated) {
1319
- this.updateCurrent();
1320
- }
1321
- }
1322
- //Public
1323
- init(context = null) {
1324
- if (context) {
1325
- this.current = context;
1326
- }
1327
- }
1328
- loadRequiredJsonFiles() {
1329
- return null;
1330
- }
1331
- loadRequiredItems() {
1332
- return null;
1333
- }
1334
- updateCurrent() {
1335
- this.getCurrentContext();
1336
- }
1337
- //Storage
1338
- clearLocalStorage() {
1339
- this.localStorage.clear();
1340
- }
1341
- clearSessionStorage() {
1342
- this.sessionStorage.clear();
1343
- }
1344
- clearWebStorage() {
1345
- this.clearLocalStorage();
1346
- this.clearSessionStorage();
1347
- }
1348
- //current
1349
- get current() {
1350
- this.updateCurrentIfExpired();
1351
- return this.getCurrent4Session();
1352
- }
1353
- set current(value) {
1354
- this.setCurrent2Session(value);
1355
- this.fireUpdated(value);
1356
- }
1357
- //user
1358
- get user() {
1359
- let current = this.current;
1360
- return current?.user;
1361
- }
1362
- /* Storage Caching ----------------------------------------------------------BEGIN */
1363
- //version => localStorage
1364
- get version() {
1365
- return this.localStorage.getObject(AppContextStorageKeys.version);
1366
- }
1367
- set version(value) {
1368
- this.localStorage.setObject(AppContextStorageKeys.version, value);
1369
- }
1370
- //currency => localStorage
1371
- get currency() {
1372
- return this.localStorage.getObject(AppContextStorageKeys.currency);
1373
- }
1374
- set currency(value) {
1375
- this.localStorage.setObject(AppContextStorageKeys.currency, value);
1376
- }
1377
- clearCurrency() {
1378
- this.localStorage.remove(AppContextStorageKeys.currency);
1379
- }
1380
- //countries => localStorage
1381
- get countries() {
1382
- return this.localStorage.getObject(AppContextStorageKeys.countries);
1383
- }
1384
- set countries(value) {
1385
- this.localStorage.setObject(AppContextStorageKeys.countries, value);
1386
- }
1387
- clearCountries() {
1388
- this.localStorage.remove(AppContextStorageKeys.countries);
1389
- }
1390
- //languages => localStorage
1391
- get languages() {
1392
- return this.localStorage.getObject(AppContextStorageKeys.languages);
1393
- }
1394
- set languages(value) {
1395
- this.localStorage.setObject(AppContextStorageKeys.languages, value);
1396
- }
1397
- clearLanguages() {
1398
- this.localStorage.remove(AppContextStorageKeys.languages);
1399
- }
1400
- static { this.ɵfac = function AppContextService_Factory(t) { return new (t || AppContextService)(i0.ɵɵinject(i1$1.HttpClient), i0.ɵɵinject(LocalStorageService), i0.ɵɵinject(SessionStorageService)); }; }
1401
- static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: AppContextService, factory: AppContextService.ɵfac }); }
1402
- }
1403
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AppContextService, [{
1404
- type: Injectable
1405
- }], () => [{ type: i1$1.HttpClient }, { type: LocalStorageService }, { type: SessionStorageService }], null); })();
1406
-
1407
- class AuthService extends ApiServiceBase {
1408
- constructor(http, router, appContext, msalGuardConfig, msalService, msalBroadcastService) {
1409
- super(http);
1410
- this.http = http;
1411
- this.router = router;
1412
- this.appContext = appContext;
1413
- this.msalGuardConfig = msalGuardConfig;
1414
- this.msalService = msalService;
1415
- this.msalBroadcastService = msalBroadcastService;
1416
- this.msalDestroying$ = new Subject();
1417
- this.initialized = false;
1418
- this.init();
1419
- }
1420
- ngOnDestroy() {
1421
- this.msalDestroying$.next(undefined);
1422
- this.msalDestroying$.complete();
1423
- }
1424
- init() {
1425
- this.setDefaults();
1426
- this.msalService.initialize().subscribe(() => {
1427
- this.initialized = true;
1428
- console.log(`msal.app: initMSAL started`);
1429
- this.initMSAL();
1430
- console.log(`msal.app: initMSAL finished`);
1431
- });
1432
- }
1433
- setDefaults() {
1434
- }
1435
- /*
1436
- https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/samples/msal-angular-v3-samples/angular-b2c-sample-app/src/app/app.component.ts
1437
-
1438
- Token Validation:
1439
- https://jwt.io
1440
-
1441
- Token types:
1442
- https://learn.microsoft.com/en-us/azure/active-directory-b2c/tokens-overview
1443
- ID token - A JWT that contains claims that you can use to identify users in your application
1444
- Access token - A JWT that contains claims that you can use to identify the granted permissions to your APIs.
1445
- Access tokens are signed, but they aren't encrypted
1446
- Refresh token - Refresh tokens are used to acquire new ID tokens and access tokens in an OAuth 2.0 flow.
1447
- */
1448
- initMSAL() {
1449
- //B2C
1450
- this.signUpSignInPolicy = MSALB2C.getPolicyByType(PolicyType.signUpSignIn);
1451
- this.signUpPolicy = MSALB2C.getPolicyByType(PolicyType.signUp);
1452
- this.editProfilePolicy = MSALB2C.getPolicyByType(PolicyType.editProfile);
1453
- this.resetPasswordPolicy = MSALB2C.getPolicyByType(PolicyType.resetPassword);
1454
- this.msalService.handleRedirectObservable().subscribe({
1455
- next: (result) => {
1456
- console.log(`msal.app: handleRedirectObservable`);
1457
- },
1458
- error: (error) => {
1459
- console.log(error);
1435
+ /*
1436
+ https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/samples/msal-angular-v3-samples/angular-b2c-sample-app/src/app/app.component.ts
1437
+
1438
+ Token Validation:
1439
+ https://jwt.io
1440
+
1441
+ Token types:
1442
+ https://learn.microsoft.com/en-us/azure/active-directory-b2c/tokens-overview
1443
+ ID token - A JWT that contains claims that you can use to identify users in your application
1444
+ Access token - A JWT that contains claims that you can use to identify the granted permissions to your APIs.
1445
+ Access tokens are signed, but they aren't encrypted
1446
+ Refresh token - Refresh tokens are used to acquire new ID tokens and access tokens in an OAuth 2.0 flow.
1447
+ */
1448
+ initMSAL() {
1449
+ //B2C
1450
+ this.signUpSignInPolicy = MSALB2C.getPolicyByType(PolicyType.signUpSignIn);
1451
+ this.signUpPolicy = MSALB2C.getPolicyByType(PolicyType.signUp);
1452
+ this.editProfilePolicy = MSALB2C.getPolicyByType(PolicyType.editProfile);
1453
+ this.resetPasswordPolicy = MSALB2C.getPolicyByType(PolicyType.resetPassword);
1454
+ this.msalService.handleRedirectObservable().subscribe({
1455
+ next: (result) => {
1456
+ console.log(`msal.app: handleRedirectObservable`);
1457
+ },
1458
+ error: (error) => {
1459
+ console.log(error);
1460
1460
  }
1461
1461
  });
1462
1462
  this.msalService.instance.enableAccountStorageEvents();
@@ -1812,7 +1812,7 @@ class AuthService extends ApiServiceBase {
1812
1812
  };
1813
1813
  this.login(resetPasswordFlowRequest);
1814
1814
  }
1815
- static { this.ɵfac = function AuthService_Factory(t) { return new (t || AuthService)(i0.ɵɵinject(i1$1.HttpClient), i0.ɵɵinject(i1.Router), i0.ɵɵinject(AppContextService), i0.ɵɵinject(MSAL_GUARD_CONFIG), i0.ɵɵinject(i4.MsalService), i0.ɵɵinject(i4.MsalBroadcastService)); }; }
1815
+ static { this.ɵfac = function AuthService_Factory(t) { return new (t || AuthService)(i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(i1$1.Router), i0.ɵɵinject(AppContextService), i0.ɵɵinject(MSAL_GUARD_CONFIG), i0.ɵɵinject(i4.MsalService), i0.ɵɵinject(i4.MsalBroadcastService)); }; }
1816
1816
  static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: AuthService, factory: AuthService.ɵfac, providedIn: 'root' }); }
1817
1817
  }
1818
1818
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AuthService, [{
@@ -1820,7 +1820,7 @@ class AuthService extends ApiServiceBase {
1820
1820
  args: [{
1821
1821
  providedIn: 'root'
1822
1822
  }]
1823
- }], () => [{ type: i1$1.HttpClient }, { type: i1.Router }, { type: AppContextService }, { type: undefined, decorators: [{
1823
+ }], () => [{ type: i1.HttpClient }, { type: i1$1.Router }, { type: AppContextService }, { type: undefined, decorators: [{
1824
1824
  type: Inject,
1825
1825
  args: [MSAL_GUARD_CONFIG]
1826
1826
  }] }, { type: i4.MsalService }, { type: i4.MsalBroadcastService }], null); })();
@@ -1935,12 +1935,12 @@ class AppsGoServiceBase extends GoServiceBase {
1935
1935
  }
1936
1936
  }
1937
1937
  }
1938
- static { this.ɵfac = function AppsGoServiceBase_Factory(t) { return new (t || AppsGoServiceBase)(i0.ɵɵinject(i1.ActivatedRoute), i0.ɵɵinject(i1.Router), i0.ɵɵinject(AuthService), i0.ɵɵinject(LoggingService)); }; }
1938
+ static { this.ɵfac = function AppsGoServiceBase_Factory(t) { return new (t || AppsGoServiceBase)(i0.ɵɵinject(i1$1.ActivatedRoute), i0.ɵɵinject(i1$1.Router), i0.ɵɵinject(AuthService), i0.ɵɵinject(LoggingService)); }; }
1939
1939
  static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: AppsGoServiceBase, factory: AppsGoServiceBase.ɵfac }); }
1940
1940
  }
1941
1941
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AppsGoServiceBase, [{
1942
1942
  type: Injectable
1943
- }], () => [{ type: i1.ActivatedRoute }, { type: i1.Router }, { type: AuthService }, { type: LoggingService }], null); })();
1943
+ }], () => [{ type: i1$1.ActivatedRoute }, { type: i1$1.Router }, { type: AuthService }, { type: LoggingService }], null); })();
1944
1944
 
1945
1945
  /*
1946
1946
  <file>
@@ -1997,7 +1997,7 @@ class AuthenticationGuard extends MsalGuard {
1997
1997
  this.setInteractionType(route);
1998
1998
  return super.canActivate(route, state);
1999
1999
  }
2000
- static { this.ɵfac = function AuthenticationGuard_Factory(t) { return new (t || AuthenticationGuard)(i0.ɵɵinject(MSAL_GUARD_CONFIG), i0.ɵɵinject(i4.MsalBroadcastService), i0.ɵɵinject(i4.MsalService), i0.ɵɵinject(i1$2.Location), i0.ɵɵinject(i1.Router)); }; }
2000
+ static { this.ɵfac = function AuthenticationGuard_Factory(t) { return new (t || AuthenticationGuard)(i0.ɵɵinject(MSAL_GUARD_CONFIG), i0.ɵɵinject(i4.MsalBroadcastService), i0.ɵɵinject(i4.MsalService), i0.ɵɵinject(i1$2.Location), i0.ɵɵinject(i1$1.Router)); }; }
2001
2001
  static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: AuthenticationGuard, factory: AuthenticationGuard.ɵfac }); }
2002
2002
  }
2003
2003
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AuthenticationGuard, [{
@@ -2005,7 +2005,7 @@ class AuthenticationGuard extends MsalGuard {
2005
2005
  }], () => [{ type: undefined, decorators: [{
2006
2006
  type: Inject,
2007
2007
  args: [MSAL_GUARD_CONFIG]
2008
- }] }, { type: i4.MsalBroadcastService }, { type: i4.MsalService }, { type: i1$2.Location }, { type: i1.Router }], null); })();
2008
+ }] }, { type: i4.MsalBroadcastService }, { type: i4.MsalService }, { type: i1$2.Location }, { type: i1$1.Router }], null); })();
2009
2009
 
2010
2010
  /*
2011
2011
  <file>
@@ -2435,12 +2435,12 @@ class StarterService extends ApiServiceBase {
2435
2435
  stopwatch.printElapsedAsMilliseconds();
2436
2436
  }));
2437
2437
  }
2438
- static { this.ɵfac = function StarterService_Factory(t) { return new (t || StarterService)(i0.ɵɵinject(i1$1.HttpClient), i0.ɵɵinject(AppContextService), i0.ɵɵinject(LoggingService)); }; }
2438
+ static { this.ɵfac = function StarterService_Factory(t) { return new (t || StarterService)(i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(AppContextService), i0.ɵɵinject(LoggingService)); }; }
2439
2439
  static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: StarterService, factory: StarterService.ɵfac }); }
2440
2440
  }
2441
2441
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(StarterService, [{
2442
2442
  type: Injectable
2443
- }], () => [{ type: i1$1.HttpClient }, { type: AppContextService }, { type: LoggingService }], null); })();
2443
+ }], () => [{ type: i1.HttpClient }, { type: AppContextService }, { type: LoggingService }], null); })();
2444
2444
 
2445
2445
  /*
2446
2446
  <file>
@@ -3284,12 +3284,12 @@ class GoogleAnalyticsService {
3284
3284
  let ga = window.gtag;
3285
3285
  return ga;
3286
3286
  }
3287
- static { this.ɵfac = function GoogleAnalyticsService_Factory(t) { return new (t || GoogleAnalyticsService)(i0.ɵɵinject(i1.Router)); }; }
3287
+ static { this.ɵfac = function GoogleAnalyticsService_Factory(t) { return new (t || GoogleAnalyticsService)(i0.ɵɵinject(i1$1.Router)); }; }
3288
3288
  static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: GoogleAnalyticsService, factory: GoogleAnalyticsService.ɵfac }); }
3289
3289
  }
3290
3290
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(GoogleAnalyticsService, [{
3291
3291
  type: Injectable
3292
- }], () => [{ type: i1.Router }], null); })();
3292
+ }], () => [{ type: i1$1.Router }], null); })();
3293
3293
 
3294
3294
  /*
3295
3295
  <file>
@@ -3873,43 +3873,357 @@ class ComponentBase {
3873
3873
  }
3874
3874
  ngOnInit() {
3875
3875
  }
3876
- ngOnDestroy() {
3877
- this.subs.unsubscribe();
3878
- }
3879
- getEntityId() {
3880
- return QSUtils.getValueByName("id");
3881
- }
3882
- dataStartedLoading() {
3883
- this.dataLoading = true;
3884
- this.dataLoaded = false;
3885
- this.dataFound = false;
3886
- }
3887
- dataLoadedAndNothingFound() {
3888
- this.dataLoadedAndFound(false);
3889
- }
3890
- dataLoadedAndFound(found = true) {
3891
- this.dataLoading = false;
3892
- this.dataLoaded = true;
3893
- this.dataFound = found;
3876
+ ngOnDestroy() {
3877
+ this.subs.unsubscribe();
3878
+ }
3879
+ getEntityId() {
3880
+ return QSUtils.getValueByName("id");
3881
+ }
3882
+ dataStartedLoading() {
3883
+ this.dataLoading = true;
3884
+ this.dataLoaded = false;
3885
+ this.dataFound = false;
3886
+ }
3887
+ dataLoadedAndNothingFound() {
3888
+ this.dataLoadedAndFound(false);
3889
+ }
3890
+ dataLoadedAndFound(found = true) {
3891
+ this.dataLoading = false;
3892
+ this.dataLoaded = true;
3893
+ this.dataFound = found;
3894
+ }
3895
+ static { this.ɵfac = function ComponentBase_Factory(t) { return new (t || ComponentBase)(); }; }
3896
+ static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ComponentBase, selectors: [["ng-component"]], inputs: { classes: "classes", title: "title", isTitleVisible: "isTitleVisible", isRequired: "isRequired" }, decls: 0, vars: 0, template: function ComponentBase_Template(rf, ctx) { }, encapsulation: 2 }); }
3897
+ }
3898
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ComponentBase, [{
3899
+ type: Component,
3900
+ args: [{
3901
+ template: ''
3902
+ }]
3903
+ }], () => [], { classes: [{
3904
+ type: Input
3905
+ }], title: [{
3906
+ type: Input
3907
+ }], isTitleVisible: [{
3908
+ type: Input
3909
+ }], isRequired: [{
3910
+ type: Input
3911
+ }] }); })();
3912
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ComponentBase, { className: "ComponentBase", filePath: "lib\\ui\\components\\base\\components\\component.ts", lineNumber: 26 }); })();
3913
+
3914
+ /*
3915
+ <file>
3916
+ Project:
3917
+ @osovitny/anatoly
3918
+
3919
+ Authors:
3920
+ Vadim Osovitny vadim.osovitny@osovitny.com
3921
+ Anatoly Osovitny anatoly.osovitny@osovitny.com
3922
+
3923
+ Created:
3924
+ 4 Jul 2018
3925
+
3926
+ Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
3927
+ </file>
3928
+ */
3929
+ //Node
3930
+ function SignUpButtonComponent_a_0_ng_container_1_Template(rf, ctx) { if (rf & 1) {
3931
+ i0.ɵɵelementContainer(0);
3932
+ } }
3933
+ function SignUpButtonComponent_a_0_Template(rf, ctx) { if (rf & 1) {
3934
+ i0.ɵɵelementStart(0, "a", 3);
3935
+ i0.ɵɵtemplate(1, SignUpButtonComponent_a_0_ng_container_1_Template, 1, 0, "ng-container", 4);
3936
+ i0.ɵɵelementEnd();
3937
+ } if (rf & 2) {
3938
+ const ctx_r0 = i0.ɵɵnextContext();
3939
+ const _r3 = i0.ɵɵreference(3);
3940
+ i0.ɵɵclassMap(ctx_r0.classes);
3941
+ i0.ɵɵproperty("href", ctx_r0.url, i0.ɵɵsanitizeUrl);
3942
+ i0.ɵɵadvance();
3943
+ i0.ɵɵproperty("ngTemplateOutlet", _r3);
3944
+ } }
3945
+ function SignUpButtonComponent_a_1_ng_container_1_Template(rf, ctx) { if (rf & 1) {
3946
+ i0.ɵɵelementContainer(0);
3947
+ } }
3948
+ function SignUpButtonComponent_a_1_Template(rf, ctx) { if (rf & 1) {
3949
+ i0.ɵɵelementStart(0, "a", 5);
3950
+ i0.ɵɵtemplate(1, SignUpButtonComponent_a_1_ng_container_1_Template, 1, 0, "ng-container", 4);
3951
+ i0.ɵɵelementEnd();
3952
+ } if (rf & 2) {
3953
+ const ctx_r1 = i0.ɵɵnextContext();
3954
+ const _r3 = i0.ɵɵreference(3);
3955
+ i0.ɵɵclassMap(ctx_r1.classes);
3956
+ i0.ɵɵproperty("routerLink", ctx_r1.url);
3957
+ i0.ɵɵadvance();
3958
+ i0.ɵɵproperty("ngTemplateOutlet", _r3);
3959
+ } }
3960
+ function SignUpButtonComponent_ng_template_2_span_3_Template(rf, ctx) { if (rf & 1) {
3961
+ i0.ɵɵelementStart(0, "span");
3962
+ i0.ɵɵtext(1, "Sign Up");
3963
+ i0.ɵɵelementEnd();
3964
+ } }
3965
+ function SignUpButtonComponent_ng_template_2_Template(rf, ctx) { if (rf & 1) {
3966
+ i0.ɵɵelementStart(0, "span", null, 6);
3967
+ i0.ɵɵprojection(2);
3968
+ i0.ɵɵelementEnd();
3969
+ i0.ɵɵtemplate(3, SignUpButtonComponent_ng_template_2_span_3_Template, 2, 0, "span", 7);
3970
+ } if (rf & 2) {
3971
+ const _r6 = i0.ɵɵreference(1);
3972
+ i0.ɵɵadvance(3);
3973
+ i0.ɵɵproperty("ngIf", !_r6.innerHTML.trim());
3974
+ } }
3975
+ const _c0$h = ["*"];
3976
+ class SignUpButtonComponent extends ComponentBase {
3977
+ constructor() {
3978
+ super();
3979
+ this.external = false;
3980
+ }
3981
+ ngOnInit() {
3982
+ let url = MSALConfig.ui.signup;
3983
+ if (url) {
3984
+ this.external = url.indexOf('http') > -1;
3985
+ if (this.external) {
3986
+ this.url = url + (this.qs ? '?' + this.qs : '');
3987
+ }
3988
+ else {
3989
+ this.url = url;
3990
+ }
3991
+ }
3992
+ }
3993
+ static { this.ɵfac = function SignUpButtonComponent_Factory(t) { return new (t || SignUpButtonComponent)(); }; }
3994
+ static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SignUpButtonComponent, selectors: [["anatoly-signup-button"]], inputs: { qs: "qs" }, features: [i0.ɵɵInheritDefinitionFeature], ngContentSelectors: _c0$h, decls: 4, vars: 2, consts: [[3, "href", "class", 4, "ngIf"], [3, "routerLink", "class", 4, "ngIf"], ["contentTemplate", ""], [3, "href"], [4, "ngTemplateOutlet"], [3, "routerLink"], ["ref", ""], [4, "ngIf"]], template: function SignUpButtonComponent_Template(rf, ctx) { if (rf & 1) {
3995
+ i0.ɵɵprojectionDef();
3996
+ i0.ɵɵtemplate(0, SignUpButtonComponent_a_0_Template, 2, 5, "a", 0)(1, SignUpButtonComponent_a_1_Template, 2, 5, "a", 1)(2, SignUpButtonComponent_ng_template_2_Template, 4, 1, "ng-template", null, 2, i0.ɵɵtemplateRefExtractor);
3997
+ } if (rf & 2) {
3998
+ i0.ɵɵproperty("ngIf", ctx.external);
3999
+ i0.ɵɵadvance();
4000
+ i0.ɵɵproperty("ngIf", !ctx.external);
4001
+ } }, dependencies: [i1$2.NgIf, i1$2.NgTemplateOutlet, i1$1.RouterLink], encapsulation: 2 }); }
4002
+ }
4003
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SignUpButtonComponent, [{
4004
+ type: Component,
4005
+ args: [{ selector: "anatoly-signup-button", template: "<a [href]=\"url\" class=\"{{ classes }}\" *ngIf=\"external\">\r\n <ng-container *ngTemplateOutlet=\"contentTemplate\"></ng-container>\r\n</a>\r\n\r\n<a [routerLink]=\"url\" class=\"{{ classes }}\" *ngIf=\"!external\">\r\n <ng-container *ngTemplateOutlet=\"contentTemplate\"></ng-container>\r\n</a>\r\n\r\n<ng-template #contentTemplate>\r\n <span #ref><ng-content></ng-content></span>\r\n <span *ngIf=\"!ref.innerHTML.trim()\">Sign Up</span>\r\n</ng-template>\r\n" }]
4006
+ }], () => [], { qs: [{
4007
+ type: Input
4008
+ }] }); })();
4009
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SignUpButtonComponent, { className: "SignUpButtonComponent", filePath: "lib\\ui\\components\\identity\\signup-button.component.ts", lineNumber: 28 }); })();
4010
+
4011
+ /*
4012
+ <file>
4013
+ Project:
4014
+ @osovitny/anatoly
4015
+
4016
+ Authors:
4017
+ Vadim Osovitny vadim.osovitny@osovitny.com
4018
+ Anatoly Osovitny anatoly.osovitny@osovitny.com
4019
+
4020
+ Created:
4021
+ 14 Aug 2018
4022
+
4023
+ Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
4024
+ </file>
4025
+ */
4026
+ //Node
4027
+ function BuyAccessButtonComponent_div_0_div_1_Template(rf, ctx) { if (rf & 1) {
4028
+ i0.ɵɵelementStart(0, "div");
4029
+ i0.ɵɵelement(1, "anatoly-signup-button", 1);
4030
+ i0.ɵɵelementEnd();
4031
+ } }
4032
+ function BuyAccessButtonComponent_div_0_div_2_button_1_Template(rf, ctx) { if (rf & 1) {
4033
+ i0.ɵɵelementStart(0, "button", 4);
4034
+ i0.ɵɵtext(1, " Your Plan ");
4035
+ i0.ɵɵelementEnd();
4036
+ } }
4037
+ function BuyAccessButtonComponent_div_0_div_2_button_2_Template(rf, ctx) { if (rf & 1) {
4038
+ const _r6 = i0.ɵɵgetCurrentView();
4039
+ i0.ɵɵelementStart(0, "button", 5);
4040
+ i0.ɵɵlistener("click", function BuyAccessButtonComponent_div_0_div_2_button_2_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r6); const ctx_r5 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r5.onPlanSelect()); });
4041
+ i0.ɵɵtext(1, " Buy Now ");
4042
+ i0.ɵɵelementEnd();
4043
+ } }
4044
+ function BuyAccessButtonComponent_div_0_div_2_Template(rf, ctx) { if (rf & 1) {
4045
+ i0.ɵɵelementStart(0, "div");
4046
+ i0.ɵɵtemplate(1, BuyAccessButtonComponent_div_0_div_2_button_1_Template, 2, 0, "button", 2)(2, BuyAccessButtonComponent_div_0_div_2_button_2_Template, 2, 0, "button", 3);
4047
+ i0.ɵɵelementEnd();
4048
+ } if (rf & 2) {
4049
+ const ctx_r2 = i0.ɵɵnextContext(2);
4050
+ i0.ɵɵadvance();
4051
+ i0.ɵɵproperty("ngIf", ctx_r2.plan == ctx_r2.currentPlan);
4052
+ i0.ɵɵadvance();
4053
+ i0.ɵɵproperty("ngIf", ctx_r2.plan != ctx_r2.currentPlan && ctx_r2.currentPlan == 1);
4054
+ } }
4055
+ function BuyAccessButtonComponent_div_0_Template(rf, ctx) { if (rf & 1) {
4056
+ i0.ɵɵelementStart(0, "div");
4057
+ i0.ɵɵtemplate(1, BuyAccessButtonComponent_div_0_div_1_Template, 2, 0, "div", 0)(2, BuyAccessButtonComponent_div_0_div_2_Template, 3, 2, "div", 0);
4058
+ i0.ɵɵelementEnd();
4059
+ } if (rf & 2) {
4060
+ const ctx_r0 = i0.ɵɵnextContext();
4061
+ i0.ɵɵadvance();
4062
+ i0.ɵɵproperty("ngIf", !ctx_r0.isUserSignedIn);
4063
+ i0.ɵɵadvance();
4064
+ i0.ɵɵproperty("ngIf", ctx_r0.isUserSignedIn && ctx_r0.visibleIfUserSignedIn);
4065
+ } }
4066
+ class BuyAccessButtonComponent {
4067
+ constructor(appContext) {
4068
+ this.appContext = appContext;
4069
+ this.contextUpdated = false;
4070
+ this.isUserSignedIn = false;
4071
+ this.currentPlan = -1;
4072
+ this.currentPlanTitle = '';
4073
+ this.visibleIfUserSignedIn = false;
4074
+ this.planselect = new EventEmitter();
4075
+ }
4076
+ ngOnInit() {
4077
+ this.appContext.updated$.subscribe((context) => {
4078
+ if (!context) {
4079
+ return;
4080
+ }
4081
+ this.isUserSignedIn = context.isUserSignedIn;
4082
+ if (this.isUserSignedIn) {
4083
+ this.currentPlan = context.account.billingPlan;
4084
+ this.currentPlanTitle = context.account.billingPlanAsString;
4085
+ }
4086
+ this.contextUpdated = true;
4087
+ });
4088
+ }
4089
+ //Events
4090
+ onPlanSelect() {
4091
+ this.planselect.emit(this.plan);
4092
+ }
4093
+ static { this.ɵfac = function BuyAccessButtonComponent_Factory(t) { return new (t || BuyAccessButtonComponent)(i0.ɵɵdirectiveInject(AppContextService)); }; }
4094
+ static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: BuyAccessButtonComponent, selectors: [["anatoly-billing-buyaccess-button"]], inputs: { plan: "plan", planTitle: "planTitle", visibleIfUserSignedIn: "visibleIfUserSignedIn" }, outputs: { planselect: "planselect" }, decls: 1, vars: 1, consts: [[4, "ngIf"], ["classes", "btn btn-block btn-primary"], ["class", "btn btn-block btn-success selectPlan", 4, "ngIf"], ["class", "btn btn-block btn-warning selectPlan", 3, "click", 4, "ngIf"], [1, "btn", "btn-block", "btn-success", "selectPlan"], [1, "btn", "btn-block", "btn-warning", "selectPlan", 3, "click"]], template: function BuyAccessButtonComponent_Template(rf, ctx) { if (rf & 1) {
4095
+ i0.ɵɵtemplate(0, BuyAccessButtonComponent_div_0_Template, 3, 2, "div", 0);
4096
+ } if (rf & 2) {
4097
+ i0.ɵɵproperty("ngIf", ctx.contextUpdated);
4098
+ } }, dependencies: [i1$2.NgIf, SignUpButtonComponent], encapsulation: 2 }); }
4099
+ }
4100
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(BuyAccessButtonComponent, [{
4101
+ type: Component,
4102
+ args: [{ selector: 'anatoly-billing-buyaccess-button', template: "<div *ngIf=\"contextUpdated\">\r\n <div *ngIf=\"!isUserSignedIn\">\r\n <anatoly-signup-button classes=\"btn btn-block btn-primary\"></anatoly-signup-button>\r\n </div>\r\n\r\n <div *ngIf=\"isUserSignedIn && visibleIfUserSignedIn\">\r\n <button class=\"btn btn-block btn-success selectPlan\"\r\n *ngIf=\"plan == currentPlan\">\r\n Your Plan\r\n </button>\r\n\r\n <button class=\"btn btn-block btn-warning selectPlan\"\r\n *ngIf=\"plan != currentPlan && currentPlan == 1\"\r\n (click)=\"onPlanSelect()\">\r\n Buy Now\r\n </button>\r\n </div>\r\n</div>\r\n" }]
4103
+ }], () => [{ type: AppContextService }], { plan: [{
4104
+ type: Input
4105
+ }], planTitle: [{
4106
+ type: Input
4107
+ }], visibleIfUserSignedIn: [{
4108
+ type: Input
4109
+ }], planselect: [{
4110
+ type: Output
4111
+ }] }); })();
4112
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(BuyAccessButtonComponent, { className: "BuyAccessButtonComponent", filePath: "lib\\billing\\components\\buttons\\buyaccess-button.component.ts", lineNumber: 27 }); })();
4113
+
4114
+ /*
4115
+ <file>
4116
+ Project:
4117
+ @osovitny/anatoly
4118
+
4119
+ Authors:
4120
+ Vadim Osovitny vadim.osovitny@osovitny.com
4121
+ Anatoly Osovitny anatoly.osovitny@osovitny.com
4122
+
4123
+ Created:
4124
+ 1 Jun 2018
4125
+
4126
+ Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
4127
+ </file>
4128
+ */
4129
+ //Node
4130
+ function SubscribePlanButtonComponent_div_0_div_1_Template(rf, ctx) { if (rf & 1) {
4131
+ i0.ɵɵelementStart(0, "div");
4132
+ i0.ɵɵelement(1, "anatoly-signup-button", 1);
4133
+ i0.ɵɵelementEnd();
4134
+ } }
4135
+ function SubscribePlanButtonComponent_div_0_div_2_button_1_Template(rf, ctx) { if (rf & 1) {
4136
+ i0.ɵɵelementStart(0, "button", 5);
4137
+ i0.ɵɵtext(1, " Your Plan ");
4138
+ i0.ɵɵelementEnd();
4139
+ } }
4140
+ function SubscribePlanButtonComponent_div_0_div_2_button_2_Template(rf, ctx) { if (rf & 1) {
4141
+ i0.ɵɵelementStart(0, "button", 6);
4142
+ i0.ɵɵtext(1, " Requested ");
4143
+ i0.ɵɵelementEnd();
4144
+ } }
4145
+ function SubscribePlanButtonComponent_div_0_div_2_button_3_Template(rf, ctx) { if (rf & 1) {
4146
+ const _r7 = i0.ɵɵgetCurrentView();
4147
+ i0.ɵɵelementStart(0, "button", 7);
4148
+ i0.ɵɵlistener("click", function SubscribePlanButtonComponent_div_0_div_2_button_3_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r7); const ctx_r6 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r6.onPlanSelect()); });
4149
+ i0.ɵɵtext(1, " Subscribe ");
4150
+ i0.ɵɵelementEnd();
4151
+ } }
4152
+ function SubscribePlanButtonComponent_div_0_div_2_Template(rf, ctx) { if (rf & 1) {
4153
+ i0.ɵɵelementStart(0, "div");
4154
+ i0.ɵɵtemplate(1, SubscribePlanButtonComponent_div_0_div_2_button_1_Template, 2, 0, "button", 2)(2, SubscribePlanButtonComponent_div_0_div_2_button_2_Template, 2, 0, "button", 3)(3, SubscribePlanButtonComponent_div_0_div_2_button_3_Template, 2, 0, "button", 4);
4155
+ i0.ɵɵelementEnd();
4156
+ } if (rf & 2) {
4157
+ const ctx_r2 = i0.ɵɵnextContext(2);
4158
+ i0.ɵɵadvance();
4159
+ i0.ɵɵproperty("ngIf", ctx_r2.plan == ctx_r2.currentPlan);
4160
+ i0.ɵɵadvance();
4161
+ i0.ɵɵproperty("ngIf", ctx_r2.plan == ctx_r2.requestedPlan);
4162
+ i0.ɵɵadvance();
4163
+ i0.ɵɵproperty("ngIf", ctx_r2.plan != ctx_r2.currentPlan && ctx_r2.plan != ctx_r2.requestedPlan);
4164
+ } }
4165
+ function SubscribePlanButtonComponent_div_0_Template(rf, ctx) { if (rf & 1) {
4166
+ i0.ɵɵelementStart(0, "div");
4167
+ i0.ɵɵtemplate(1, SubscribePlanButtonComponent_div_0_div_1_Template, 2, 0, "div", 0)(2, SubscribePlanButtonComponent_div_0_div_2_Template, 4, 3, "div", 0);
4168
+ i0.ɵɵelementEnd();
4169
+ } if (rf & 2) {
4170
+ const ctx_r0 = i0.ɵɵnextContext();
4171
+ i0.ɵɵadvance();
4172
+ i0.ɵɵproperty("ngIf", !ctx_r0.isUserSignedIn);
4173
+ i0.ɵɵadvance();
4174
+ i0.ɵɵproperty("ngIf", ctx_r0.isUserSignedIn && ctx_r0.visibleIfUserSignedIn);
4175
+ } }
4176
+ class SubscribePlanButtonComponent {
4177
+ constructor(appContext) {
4178
+ this.appContext = appContext;
4179
+ this.contextUpdated = false;
4180
+ this.isUserSignedIn = false;
4181
+ this.currentPlan = -1;
4182
+ this.currentPlanTitle = "";
4183
+ this.requestedPlan = -1;
4184
+ this.requestedPlanTitle = "";
4185
+ this.visibleIfUserSignedIn = false;
4186
+ this.planselect = new EventEmitter();
4187
+ }
4188
+ ngOnInit() {
4189
+ this.appContext.updated$.subscribe((context) => {
4190
+ if (!context) {
4191
+ return;
4192
+ }
4193
+ this.isUserSignedIn = context.isUserSignedIn;
4194
+ if (this.isUserSignedIn) {
4195
+ this.currentPlan = context.account.billingPlan;
4196
+ this.currentPlanTitle = context.account.billingPlanAsString;
4197
+ this.requestedPlan = context.account.requestedBillingPlan;
4198
+ this.requestedPlanTitle = context.account.requestedBillingPlanAsString;
4199
+ }
4200
+ this.contextUpdated = true;
4201
+ });
4202
+ }
4203
+ //Events
4204
+ onPlanSelect() {
4205
+ this.planselect.emit(this.plan);
3894
4206
  }
3895
- static { this.ɵfac = function ComponentBase_Factory(t) { return new (t || ComponentBase)(); }; }
3896
- static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ComponentBase, selectors: [["ng-component"]], inputs: { classes: "classes", title: "title", isTitleVisible: "isTitleVisible", isRequired: "isRequired" }, decls: 0, vars: 0, template: function ComponentBase_Template(rf, ctx) { }, encapsulation: 2 }); }
4207
+ static { this.ɵfac = function SubscribePlanButtonComponent_Factory(t) { return new (t || SubscribePlanButtonComponent)(i0.ɵɵdirectiveInject(AppContextService)); }; }
4208
+ static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SubscribePlanButtonComponent, selectors: [["anatoly-billing-subscribe-plan-button"]], inputs: { plan: "plan", planTitle: "planTitle", visibleIfUserSignedIn: "visibleIfUserSignedIn" }, outputs: { planselect: "planselect" }, decls: 1, vars: 1, consts: [[4, "ngIf"], ["classes", "btn btn-block btn-primary"], ["class", "btn btn-block btn-success selectPlan", 4, "ngIf"], ["class", "btn btn-block btn-warning selectPlan", 4, "ngIf"], ["class", "btn btn-block btn-warning selectPlan", 3, "click", 4, "ngIf"], [1, "btn", "btn-block", "btn-success", "selectPlan"], [1, "btn", "btn-block", "btn-warning", "selectPlan"], [1, "btn", "btn-block", "btn-warning", "selectPlan", 3, "click"]], template: function SubscribePlanButtonComponent_Template(rf, ctx) { if (rf & 1) {
4209
+ i0.ɵɵtemplate(0, SubscribePlanButtonComponent_div_0_Template, 3, 2, "div", 0);
4210
+ } if (rf & 2) {
4211
+ i0.ɵɵproperty("ngIf", ctx.contextUpdated);
4212
+ } }, dependencies: [i1$2.NgIf, SignUpButtonComponent], encapsulation: 2 }); }
3897
4213
  }
3898
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ComponentBase, [{
4214
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SubscribePlanButtonComponent, [{
3899
4215
  type: Component,
3900
- args: [{
3901
- template: ''
3902
- }]
3903
- }], () => [], { classes: [{
3904
- type: Input
3905
- }], title: [{
4216
+ args: [{ selector: "anatoly-billing-subscribe-plan-button", template: "<div *ngIf=\"contextUpdated\">\r\n <div *ngIf=\"!isUserSignedIn\">\r\n <anatoly-signup-button classes=\"btn btn-block btn-primary\"></anatoly-signup-button>\r\n </div>\r\n\r\n <div *ngIf=\"isUserSignedIn && visibleIfUserSignedIn\">\r\n <button class=\"btn btn-block btn-success selectPlan\"\r\n *ngIf=\"plan == currentPlan\">\r\n Your Plan\r\n </button>\r\n\r\n <button class=\"btn btn-block btn-warning selectPlan\"\r\n *ngIf=\"plan == requestedPlan\">\r\n Requested\r\n </button>\r\n\r\n <button class=\"btn btn-block btn-warning selectPlan\"\r\n *ngIf=\"plan != currentPlan && plan != requestedPlan\"\r\n (click)=\"onPlanSelect()\">\r\n Subscribe\r\n </button>\r\n </div>\r\n</div>\r\n" }]
4217
+ }], () => [{ type: AppContextService }], { plan: [{
3906
4218
  type: Input
3907
- }], isTitleVisible: [{
4219
+ }], planTitle: [{
3908
4220
  type: Input
3909
- }], isRequired: [{
4221
+ }], visibleIfUserSignedIn: [{
3910
4222
  type: Input
4223
+ }], planselect: [{
4224
+ type: Output
3911
4225
  }] }); })();
3912
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ComponentBase, { className: "ComponentBase", filePath: "lib\\ui\\components\\base\\components\\component.ts", lineNumber: 26 }); })();
4226
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SubscribePlanButtonComponent, { className: "SubscribePlanButtonComponent", filePath: "lib\\billing\\components\\buttons\\subscribe-plan-button.component.ts", lineNumber: 27 }); })();
3913
4227
 
3914
4228
  /*
3915
4229
  <file>
@@ -3965,12 +4279,12 @@ class PaymentsApiService extends ApiServiceBase {
3965
4279
  }
3966
4280
  });
3967
4281
  }
3968
- static { this.ɵfac = function PaymentsApiService_Factory(t) { return new (t || PaymentsApiService)(i0.ɵɵinject(i1$1.HttpClient)); }; }
4282
+ static { this.ɵfac = function PaymentsApiService_Factory(t) { return new (t || PaymentsApiService)(i0.ɵɵinject(i1.HttpClient)); }; }
3969
4283
  static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: PaymentsApiService, factory: PaymentsApiService.ɵfac }); }
3970
4284
  }
3971
4285
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PaymentsApiService, [{
3972
4286
  type: Injectable
3973
- }], () => [{ type: i1$1.HttpClient }], null); })();
4287
+ }], () => [{ type: i1.HttpClient }], null); })();
3974
4288
 
3975
4289
  /*
3976
4290
  <file>
@@ -4160,12 +4474,12 @@ class DiscountCodesApiService extends ApiServiceBase {
4160
4474
  getDiscountCode(code) {
4161
4475
  return this.get('getDiscountCode', { code });
4162
4476
  }
4163
- static { this.ɵfac = function DiscountCodesApiService_Factory(t) { return new (t || DiscountCodesApiService)(i0.ɵɵinject(i1$1.HttpClient)); }; }
4477
+ static { this.ɵfac = function DiscountCodesApiService_Factory(t) { return new (t || DiscountCodesApiService)(i0.ɵɵinject(i1.HttpClient)); }; }
4164
4478
  static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: DiscountCodesApiService, factory: DiscountCodesApiService.ɵfac }); }
4165
4479
  }
4166
4480
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DiscountCodesApiService, [{
4167
4481
  type: Injectable
4168
- }], () => [{ type: i1$1.HttpClient }], null); })();
4482
+ }], () => [{ type: i1.HttpClient }], null); })();
4169
4483
 
4170
4484
  /*
4171
4485
  <file>
@@ -4183,7 +4497,7 @@ class DiscountCodesApiService extends ApiServiceBase {
4183
4497
  </file>
4184
4498
  */
4185
4499
  //Node
4186
- const _c0$h = a0 => ({ "show": a0 });
4500
+ const _c0$g = a0 => ({ "show": a0 });
4187
4501
  function OrderSummaryComponent_Conditional_17_Template(rf, ctx) { if (rf & 1) {
4188
4502
  const _r2 = i0.ɵɵgetCurrentView();
4189
4503
  i0.ɵɵelementStart(0, "div", 12)(1, "div", 13)(2, "input", 14);
@@ -4195,7 +4509,7 @@ function OrderSummaryComponent_Conditional_17_Template(rf, ctx) { if (rf & 1) {
4195
4509
  i0.ɵɵelementEnd()()();
4196
4510
  } if (rf & 2) {
4197
4511
  const ctx_r0 = i0.ɵɵnextContext();
4198
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(2, _c0$h, ctx_r0.showPromoCode));
4512
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(2, _c0$g, ctx_r0.showPromoCode));
4199
4513
  i0.ɵɵadvance(2);
4200
4514
  i0.ɵɵproperty("ngModel", ctx_r0.promoCode);
4201
4515
  } }
@@ -4294,7 +4608,7 @@ class OrderSummaryComponent extends ComponentBase {
4294
4608
  i0.ɵɵadvance(12);
4295
4609
  i0.ɵɵtextInterpolate1("$", ctx.ps.subtotal, "");
4296
4610
  i0.ɵɵadvance(2);
4297
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(5, _c0$h, ctx.showPromoCode));
4611
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(5, _c0$g, ctx.showPromoCode));
4298
4612
  i0.ɵɵadvance(3);
4299
4613
  i0.ɵɵconditional(17, ctx.showPromoCode ? 17 : -1);
4300
4614
  i0.ɵɵadvance(6);
@@ -4424,7 +4738,7 @@ class PaymentMethodsComponent extends ComponentBase {
4424
4738
  </file>
4425
4739
  */
4426
4740
  //Node
4427
- const _c0$g = a0 => ({ "active": a0 });
4741
+ const _c0$f = a0 => ({ "active": a0 });
4428
4742
  class PaymentOptionsComponent extends ComponentBase {
4429
4743
  constructor(ps) {
4430
4744
  super();
@@ -4473,11 +4787,11 @@ class PaymentOptionsComponent extends ComponentBase {
4473
4787
  i0.ɵɵelementEnd()()();
4474
4788
  } if (rf & 2) {
4475
4789
  i0.ɵɵadvance(3);
4476
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(5, _c0$g, ctx.ps.selectedPaymentType == 2));
4790
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(5, _c0$f, ctx.ps.selectedPaymentType == 2));
4477
4791
  i0.ɵɵadvance(7);
4478
4792
  i0.ɵɵtextInterpolate1("$", ctx.priceWeekly, "");
4479
4793
  i0.ɵɵadvance();
4480
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(7, _c0$g, ctx.ps.selectedPaymentType == 1));
4794
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(7, _c0$f, ctx.ps.selectedPaymentType == 1));
4481
4795
  i0.ɵɵadvance(5);
4482
4796
  i0.ɵɵtextInterpolate1("Covers the full ", ctx.numberOfWeeks, " weeks ");
4483
4797
  i0.ɵɵadvance(2);
@@ -4850,7 +5164,7 @@ class BraintreeDialog extends DialogBase {
4850
5164
  }], image: [{
4851
5165
  type: Input
4852
5166
  }] }); })();
4853
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(BraintreeDialog, { className: "BraintreeDialog", filePath: "lib\\billing\\components\\braintree\\braintree.component.ts", lineNumber: 32 }); })();
5167
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(BraintreeDialog, { className: "BraintreeDialog", filePath: "lib\\billing\\components\\pm\\braintree\\braintree.component.ts", lineNumber: 32 }); })();
4854
5168
 
4855
5169
  /*
4856
5170
  <file>
@@ -4947,7 +5261,7 @@ class PayPalScriptService {
4947
5261
  Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
4948
5262
  </file>
4949
5263
  */
4950
- const _c0$f = ["payPalButtonContainer"];
5264
+ const _c0$e = ["payPalButtonContainer"];
4951
5265
  class PayPalComponent {
4952
5266
  set payPalButtonContainer(content) {
4953
5267
  this.payPalButtonContainerElem = content;
@@ -5214,7 +5528,7 @@ class PayPalComponent {
5214
5528
  }
5215
5529
  static { this.ɵfac = function PayPalComponent_Factory(t) { return new (t || PayPalComponent)(i0.ɵɵdirectiveInject(PayPalScriptService), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(i0.NgZone)); }; }
5216
5530
  static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: PayPalComponent, selectors: [["anatoly-billing-paypal-container"]], viewQuery: function PayPalComponent_Query(rf, ctx) { if (rf & 1) {
5217
- i0.ɵɵviewQuery(_c0$f, 5);
5531
+ i0.ɵɵviewQuery(_c0$e, 5);
5218
5532
  } if (rf & 2) {
5219
5533
  let _t;
5220
5534
  i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.payPalButtonContainer = _t.first);
@@ -5243,7 +5557,7 @@ class PayPalComponent {
5243
5557
  type: ViewChild,
5244
5558
  args: ["payPalButtonContainer", { static: false }]
5245
5559
  }] }); })();
5246
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PayPalComponent, { className: "PayPalComponent", filePath: "lib\\billing\\components\\paypal\\paypal.component.ts", lineNumber: 57 }); })();
5560
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PayPalComponent, { className: "PayPalComponent", filePath: "lib\\billing\\components\\pm\\paypal\\paypal.component.ts", lineNumber: 57 }); })();
5247
5561
 
5248
5562
  /*
5249
5563
  <file>
@@ -5392,7 +5706,7 @@ class PaypalButtonComponent extends ComponentBase {
5392
5706
  }], paidFor: [{
5393
5707
  type: Input
5394
5708
  }] }); })();
5395
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PaypalButtonComponent, { className: "PaypalButtonComponent", filePath: "lib\\billing\\components\\paypal\\paypal-button.component.ts", lineNumber: 42 }); })();
5709
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PaypalButtonComponent, { className: "PaypalButtonComponent", filePath: "lib\\billing\\components\\pm\\paypal\\paypal-button.component.ts", lineNumber: 42 }); })();
5396
5710
 
5397
5711
  /*
5398
5712
  <file>
@@ -5492,7 +5806,7 @@ class StripeDialog extends DialogBase {
5492
5806
  }], image: [{
5493
5807
  type: Input
5494
5808
  }] }); })();
5495
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(StripeDialog, { className: "StripeDialog", filePath: "lib\\billing\\components\\stripe\\stripe.component.ts", lineNumber: 33 }); })();
5809
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(StripeDialog, { className: "StripeDialog", filePath: "lib\\billing\\components\\pm\\stripe\\stripe.component.ts", lineNumber: 33 }); })();
5496
5810
 
5497
5811
  /*
5498
5812
  <file>
@@ -5600,12 +5914,12 @@ class GridReadServiceBase extends BehaviorSubject {
5600
5914
  }
5601
5915
  });
5602
5916
  }
5603
- static { this.ɵfac = function GridReadServiceBase_Factory(t) { return new (t || GridReadServiceBase)(i0.ɵɵinject(i1$1.HttpClient)); }; }
5917
+ static { this.ɵfac = function GridReadServiceBase_Factory(t) { return new (t || GridReadServiceBase)(i0.ɵɵinject(i1.HttpClient)); }; }
5604
5918
  static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: GridReadServiceBase, factory: GridReadServiceBase.ɵfac }); }
5605
5919
  }
5606
5920
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(GridReadServiceBase, [{
5607
5921
  type: Injectable
5608
- }], () => [{ type: i1$1.HttpClient }], null); })();
5922
+ }], () => [{ type: i1.HttpClient }], null); })();
5609
5923
 
5610
5924
  /*
5611
5925
  <file>
@@ -5674,12 +5988,12 @@ class GridEditServiceBase extends GridReadServiceBase {
5674
5988
  const url = `${this.baseUrl}/${action}${this.serializeParams(data)}`;
5675
5989
  return this.http.post(url, data).pipe(map(res => res));
5676
5990
  }
5677
- static { this.ɵfac = function GridEditServiceBase_Factory(t) { return new (t || GridEditServiceBase)(i0.ɵɵinject(i1$1.HttpClient)); }; }
5991
+ static { this.ɵfac = function GridEditServiceBase_Factory(t) { return new (t || GridEditServiceBase)(i0.ɵɵinject(i1.HttpClient)); }; }
5678
5992
  static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: GridEditServiceBase, factory: GridEditServiceBase.ɵfac }); }
5679
5993
  }
5680
5994
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(GridEditServiceBase, [{
5681
5995
  type: Injectable
5682
- }], () => [{ type: i1$1.HttpClient }], null); })();
5996
+ }], () => [{ type: i1.HttpClient }], null); })();
5683
5997
 
5684
5998
  /*
5685
5999
  <file>
@@ -5709,12 +6023,12 @@ class CurrenciesApiService extends ApiServiceBase {
5709
6023
  getRates() {
5710
6024
  return this.get('getRates');
5711
6025
  }
5712
- static { this.ɵfac = function CurrenciesApiService_Factory(t) { return new (t || CurrenciesApiService)(i0.ɵɵinject(i1$1.HttpClient)); }; }
6026
+ static { this.ɵfac = function CurrenciesApiService_Factory(t) { return new (t || CurrenciesApiService)(i0.ɵɵinject(i1.HttpClient)); }; }
5713
6027
  static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: CurrenciesApiService, factory: CurrenciesApiService.ɵfac }); }
5714
6028
  }
5715
6029
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CurrenciesApiService, [{
5716
6030
  type: Injectable
5717
- }], () => [{ type: i1$1.HttpClient }], null); })();
6031
+ }], () => [{ type: i1.HttpClient }], null); })();
5718
6032
 
5719
6033
  /*
5720
6034
  <file>
@@ -5839,12 +6153,12 @@ class SubscriptionsApiService extends ApiServiceBase {
5839
6153
  }
5840
6154
  });
5841
6155
  }
5842
- static { this.ɵfac = function SubscriptionsApiService_Factory(t) { return new (t || SubscriptionsApiService)(i0.ɵɵinject(i1$1.HttpClient)); }; }
6156
+ static { this.ɵfac = function SubscriptionsApiService_Factory(t) { return new (t || SubscriptionsApiService)(i0.ɵɵinject(i1.HttpClient)); }; }
5843
6157
  static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: SubscriptionsApiService, factory: SubscriptionsApiService.ɵfac }); }
5844
6158
  }
5845
6159
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SubscriptionsApiService, [{
5846
6160
  type: Injectable
5847
- }], () => [{ type: i1$1.HttpClient }], null); })();
6161
+ }], () => [{ type: i1.HttpClient }], null); })();
5848
6162
 
5849
6163
  /*
5850
6164
  <file>
@@ -5876,12 +6190,12 @@ class TransactionsApiService extends ApiServiceBase {
5876
6190
  getTransactions(data) {
5877
6191
  return this.get('getTransactions', data);
5878
6192
  }
5879
- static { this.ɵfac = function TransactionsApiService_Factory(t) { return new (t || TransactionsApiService)(i0.ɵɵinject(i1$1.HttpClient)); }; }
6193
+ static { this.ɵfac = function TransactionsApiService_Factory(t) { return new (t || TransactionsApiService)(i0.ɵɵinject(i1.HttpClient)); }; }
5880
6194
  static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: TransactionsApiService, factory: TransactionsApiService.ɵfac }); }
5881
6195
  }
5882
6196
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TransactionsApiService, [{
5883
6197
  type: Injectable
5884
- }], () => [{ type: i1$1.HttpClient }], null); })();
6198
+ }], () => [{ type: i1.HttpClient }], null); })();
5885
6199
 
5886
6200
  /*
5887
6201
  <file>
@@ -5914,12 +6228,12 @@ class CoreApiService extends ApiServiceBase {
5914
6228
  getUSStatesJsonFile() {
5915
6229
  return this.getExternalJsonFile('anatoly', 'usStates.json');
5916
6230
  }
5917
- static { this.ɵfac = function CoreApiService_Factory(t) { return new (t || CoreApiService)(i0.ɵɵinject(i1$1.HttpClient)); }; }
6231
+ static { this.ɵfac = function CoreApiService_Factory(t) { return new (t || CoreApiService)(i0.ɵɵinject(i1.HttpClient)); }; }
5918
6232
  static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: CoreApiService, factory: CoreApiService.ɵfac }); }
5919
6233
  }
5920
6234
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CoreApiService, [{
5921
6235
  type: Injectable
5922
- }], () => [{ type: i1$1.HttpClient }], null); })();
6236
+ }], () => [{ type: i1.HttpClient }], null); })();
5923
6237
 
5924
6238
  /*
5925
6239
  <file>
@@ -5947,179 +6261,20 @@ class EmailsApiService extends ApiServiceBase {
5947
6261
  return this.post('sendContactUs', { captcha, name, email, topic, subject, message }).subscribe({
5948
6262
  next: (data) => {
5949
6263
  if (success)
5950
- success(data);
5951
- },
5952
- error: (e) => {
5953
- if (error)
5954
- error(e);
5955
- }
5956
- });
5957
- }
5958
- static { this.ɵfac = function EmailsApiService_Factory(t) { return new (t || EmailsApiService)(i0.ɵɵinject(i1$1.HttpClient)); }; }
5959
- static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: EmailsApiService, factory: EmailsApiService.ɵfac }); }
5960
- }
5961
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(EmailsApiService, [{
5962
- type: Injectable
5963
- }], () => [{ type: i1$1.HttpClient }], null); })();
5964
-
5965
- /*
5966
- <file>
5967
- Project:
5968
- @osovitny/anatoly
5969
-
5970
- Authors:
5971
- Anatoly Osovitny anatoly.osovitny@osovitny.com
5972
-
5973
- Created:
5974
- 2 Aug 2022
5975
-
5976
- Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
5977
- </file>
5978
- */
5979
- //base
5980
-
5981
- /*
5982
- <file>
5983
- Project:
5984
- @osovitny/anatoly
5985
-
5986
- Authors:
5987
- Vadim Osovitny vadim.osovitny@osovitny.com
5988
- Anatoly Osovitny anatoly.osovitny@osovitny.com
5989
-
5990
- Created:
5991
- 20 Jan 2024
5992
-
5993
- Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
5994
- </file>
5995
- */
5996
- //Node
5997
- class EnumEditComponentBase extends EditComponentBase {
5998
- constructor() {
5999
- super(...arguments);
6000
- this.items = [];
6001
- this.defaultValue = -1;
6002
- //Outputs
6003
- this.valueChange = new EventEmitter();
6004
- }
6005
- ngOnInit() {
6006
- this.setDefaults();
6007
- this.setValues();
6008
- }
6009
- setDefaults() {
6010
- this.renderItems();
6011
- }
6012
- setValues() {
6013
- if (!this.selectedValue) {
6014
- this.reset();
6015
- }
6016
- }
6017
- fireValueChange(value) {
6018
- this.valueChange.emit(value);
6019
- }
6020
- renderItems() {
6021
- let all = [];
6022
- let data = Convert.enumToArray(this.enumeration);
6023
- if (this.isNgModelBased) {
6024
- all = [{ value: -1, text: 'All' }];
6025
- }
6026
- this.items = [];
6027
- this.items = all.concat(data);
6028
- }
6029
- //Public
6030
- reset() {
6031
- this.selectedValue = this.defaultValue;
6032
- }
6033
- //Events
6034
- onChange(value) {
6035
- this.fireValueChange(value);
6036
- }
6037
- //Properties
6038
- get selectedValue() {
6039
- if (this.isNgModelBased) {
6040
- return this.sv;
6041
- }
6042
- let value = this.getFormValue(this.controlName);
6043
- return value;
6044
- }
6045
- set selectedValue(value) {
6046
- if (!value) {
6047
- return;
6048
- }
6049
- if (value != this.sv) {
6050
- this.sv = value;
6051
- }
6052
- }
6053
- static { this.ɵfac = /*@__PURE__*/ (() => { let ɵEnumEditComponentBase_BaseFactory; return function EnumEditComponentBase_Factory(t) { return (ɵEnumEditComponentBase_BaseFactory || (ɵEnumEditComponentBase_BaseFactory = i0.ɵɵgetInheritedFactory(EnumEditComponentBase)))(t || EnumEditComponentBase); }; })(); }
6054
- static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: EnumEditComponentBase, selectors: [["ng-component"]], inputs: { defaultValue: "defaultValue" }, outputs: { valueChange: "valueChange" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 0, vars: 0, template: function EnumEditComponentBase_Template(rf, ctx) { }, encapsulation: 2 }); }
6055
- }
6056
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(EnumEditComponentBase, [{
6057
- type: Component,
6058
- args: [{
6059
- template: ''
6060
- }]
6061
- }], null, { defaultValue: [{
6062
- type: Input
6063
- }], valueChange: [{
6064
- type: Output
6065
- }] }); })();
6066
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(EnumEditComponentBase, { className: "EnumEditComponentBase", filePath: "lib\\ui\\components\\base\\components\\enum-edit.component.ts", lineNumber: 27 }); })();
6067
-
6068
- /*
6069
- <file>
6070
- Project:
6071
- @osovitny/anatoly
6072
-
6073
- Authors:
6074
- Vadim Osovitny vadim.osovitny@osovitny.com
6075
- Anatoly Osovitny anatoly.osovitny@osovitny.com
6076
-
6077
- Created:
6078
- 20 Aug 2022
6079
-
6080
- Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
6081
- </file>
6082
- */
6083
- //Node
6084
- class PageBase extends ComponentBase {
6085
- static { this.ɵfac = /*@__PURE__*/ (() => { let ɵPageBase_BaseFactory; return function PageBase_Factory(t) { return (ɵPageBase_BaseFactory || (ɵPageBase_BaseFactory = i0.ɵɵgetInheritedFactory(PageBase)))(t || PageBase); }; })(); }
6086
- static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: PageBase, selectors: [["ng-component"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 0, vars: 0, template: function PageBase_Template(rf, ctx) { }, encapsulation: 2 }); }
6087
- }
6088
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PageBase, [{
6089
- type: Component,
6090
- args: [{
6091
- template: ''
6092
- }]
6093
- }], null, null); })();
6094
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PageBase, { className: "PageBase", filePath: "lib\\ui\\components\\base\\pages\\page.ts", lineNumber: 26 }); })();
6095
-
6096
- /*
6097
- <file>
6098
- Project:
6099
- @osovitny/anatoly
6100
-
6101
- Authors:
6102
- Vadim Osovitny vadim.osovitny@osovitny.com
6103
- Anatoly Osovitny anatoly.osovitny@osovitny.com
6104
-
6105
- Created:
6106
- 20 Aug 2022
6107
-
6108
- Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
6109
- </file>
6110
- */
6111
- //Node
6112
- class EditPageBase extends EditComponentBase {
6113
- static { this.ɵfac = /*@__PURE__*/ (() => { let ɵEditPageBase_BaseFactory; return function EditPageBase_Factory(t) { return (ɵEditPageBase_BaseFactory || (ɵEditPageBase_BaseFactory = i0.ɵɵgetInheritedFactory(EditPageBase)))(t || EditPageBase); }; })(); }
6114
- static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: EditPageBase, selectors: [["ng-component"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 0, vars: 0, template: function EditPageBase_Template(rf, ctx) { }, encapsulation: 2 }); }
6264
+ success(data);
6265
+ },
6266
+ error: (e) => {
6267
+ if (error)
6268
+ error(e);
6269
+ }
6270
+ });
6271
+ }
6272
+ static { this.ɵfac = function EmailsApiService_Factory(t) { return new (t || EmailsApiService)(i0.ɵɵinject(i1.HttpClient)); }; }
6273
+ static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: EmailsApiService, factory: EmailsApiService.ɵfac }); }
6115
6274
  }
6116
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(EditPageBase, [{
6117
- type: Component,
6118
- args: [{
6119
- template: ''
6120
- }]
6121
- }], null, null); })();
6122
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(EditPageBase, { className: "EditPageBase", filePath: "lib\\ui\\components\\base\\pages\\edit.page.ts", lineNumber: 26 }); })();
6275
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(EmailsApiService, [{
6276
+ type: Injectable
6277
+ }], () => [{ type: i1.HttpClient }], null); })();
6123
6278
 
6124
6279
  /*
6125
6280
  <file>
@@ -6127,63 +6282,15 @@ class EditPageBase extends EditComponentBase {
6127
6282
  @osovitny/anatoly
6128
6283
 
6129
6284
  Authors:
6130
- Vadim Osovitny vadim.osovitny@osovitny.com
6131
6285
  Anatoly Osovitny anatoly.osovitny@osovitny.com
6132
6286
 
6133
6287
  Created:
6134
- 20 Aug 2022
6288
+ 2 Aug 2022
6135
6289
 
6136
6290
  Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
6137
6291
  </file>
6138
6292
  */
6139
- //Node
6140
- class PagedPageBase extends PageBase {
6141
- constructor() {
6142
- super(...arguments);
6143
- this.currentFilter = null;
6144
- this.totalItems = 0;
6145
- this.pageSize = 10;
6146
- this.skipItems = 0;
6147
- this.currentPage = 1;
6148
- }
6149
- loadPageOne() {
6150
- this.skipItems = 0;
6151
- this.currentPage = 1;
6152
- this.loadPage();
6153
- }
6154
- reloadPage(drop2pageOne = false) {
6155
- if (drop2pageOne) {
6156
- this.loadPageOne();
6157
- }
6158
- else {
6159
- this.loadPage();
6160
- }
6161
- }
6162
- setFilter(filter) {
6163
- this.currentFilter = filter;
6164
- this.loadPageOne();
6165
- }
6166
- //Tos
6167
- toIndex(index) {
6168
- return ((this.currentPage - 1) * this.pageSize) + index + 1;
6169
- }
6170
- //Events
6171
- onPageChange(e) {
6172
- this.pageSize = e.take;
6173
- this.skipItems = e.skip;
6174
- this.currentPage = (this.skipItems / this.pageSize) + 1;
6175
- this.loadPage();
6176
- }
6177
- static { this.ɵfac = /*@__PURE__*/ (() => { let ɵPagedPageBase_BaseFactory; return function PagedPageBase_Factory(t) { return (ɵPagedPageBase_BaseFactory || (ɵPagedPageBase_BaseFactory = i0.ɵɵgetInheritedFactory(PagedPageBase)))(t || PagedPageBase); }; })(); }
6178
- static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: PagedPageBase, selectors: [["ng-component"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 0, vars: 0, template: function PagedPageBase_Template(rf, ctx) { }, encapsulation: 2 }); }
6179
- }
6180
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PagedPageBase, [{
6181
- type: Component,
6182
- args: [{
6183
- template: ''
6184
- }]
6185
- }], null, null); })();
6186
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PagedPageBase, { className: "PagedPageBase", filePath: "lib\\ui\\components\\base\\pages\\paged.page.ts", lineNumber: 26 }); })();
6293
+ //base
6187
6294
 
6188
6295
  /*
6189
6296
  <file>
@@ -6195,188 +6302,82 @@ class PagedPageBase extends PageBase {
6195
6302
  Anatoly Osovitny anatoly.osovitny@osovitny.com
6196
6303
 
6197
6304
  Created:
6198
- 20 Aug 2022
6305
+ 20 Jan 2024
6199
6306
 
6200
6307
  Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
6201
6308
  </file>
6202
6309
  */
6203
6310
  //Node
6204
- class ListBase extends ComponentBase {
6311
+ class EnumEditComponentBase extends EditComponentBase {
6205
6312
  constructor() {
6206
6313
  super(...arguments);
6207
- this.currentFilter = null;
6208
- this.dataLoaded = false;
6209
- this.totalItems = 0;
6210
- this.skipItems = 0;
6211
- this.currentPage = 1;
6212
- //Inputs
6213
- this.pageSize = 10;
6214
- this.autoDataLoading = false;
6314
+ this.items = [];
6315
+ this.defaultValue = -1;
6215
6316
  //Outputs
6216
- this.filterRequest = new EventEmitter();
6217
- this.dataChange = new EventEmitter();
6317
+ this.valueChange = new EventEmitter();
6218
6318
  }
6219
6319
  ngOnInit() {
6220
- this.init();
6221
- }
6222
- init() {
6223
- if (this.autoDataLoading && !this.dataLoaded) {
6224
- this.loadPageOne();
6225
- }
6226
- else {
6227
- this.fireFilterRequest();
6228
- }
6320
+ this.setDefaults();
6321
+ this.setValues();
6229
6322
  }
6230
- fireFilterRequest() {
6231
- this.filterRequest.emit();
6323
+ setDefaults() {
6324
+ this.renderItems();
6232
6325
  }
6233
- fireDataChange(e = null) {
6234
- this.dataChange.emit(e);
6326
+ setValues() {
6327
+ if (!this.selectedValue) {
6328
+ this.reset();
6329
+ }
6235
6330
  }
6236
- loadPageOne() {
6237
- this.skipItems = 0;
6238
- this.currentPage = 1;
6239
- this.dataLoaded = true;
6240
- this.loadPage();
6331
+ fireValueChange(value) {
6332
+ this.valueChange.emit(value);
6241
6333
  }
6242
- reloadPage(drop2pageOne = false) {
6243
- if (drop2pageOne) {
6244
- this.loadPageOne();
6245
- }
6246
- else {
6247
- this.loadPage();
6334
+ renderItems() {
6335
+ let all = [];
6336
+ let data = Convert.enumToArray(this.enumeration);
6337
+ if (this.isNgModelBased) {
6338
+ all = [{ value: -1, text: 'All' }];
6248
6339
  }
6340
+ this.items = [];
6341
+ this.items = all.concat(data);
6249
6342
  }
6250
- setFilter(filter) {
6251
- this.currentFilter = filter;
6252
- this.loadPageOne();
6253
- }
6254
- //Tos
6255
- toIndex(index) {
6256
- return ((this.currentPage - 1) * this.pageSize) + index + 1;
6343
+ //Public
6344
+ reset() {
6345
+ this.selectedValue = this.defaultValue;
6257
6346
  }
6258
6347
  //Events
6259
- onPageChange(e) {
6260
- this.pageSize = e.take;
6261
- this.skipItems = e.skip;
6262
- this.currentPage = (this.skipItems / this.pageSize) + 1;
6263
- this.loadPage();
6264
- }
6265
- static { this.ɵfac = /*@__PURE__*/ (() => { let ɵListBase_BaseFactory; return function ListBase_Factory(t) { return (ɵListBase_BaseFactory || (ɵListBase_BaseFactory = i0.ɵɵgetInheritedFactory(ListBase)))(t || ListBase); }; })(); }
6266
- static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ListBase, selectors: [["ng-component"]], inputs: { pageSize: "pageSize", autoDataLoading: "autoDataLoading" }, outputs: { filterRequest: "filterRequest", dataChange: "dataChange" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 0, vars: 0, template: function ListBase_Template(rf, ctx) { }, encapsulation: 2 }); }
6267
- }
6268
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ListBase, [{
6269
- type: Component,
6270
- args: [{
6271
- template: ''
6272
- }]
6273
- }], null, { pageSize: [{
6274
- type: Input
6275
- }], autoDataLoading: [{
6276
- type: Input
6277
- }], filterRequest: [{
6278
- type: Output
6279
- }], dataChange: [{
6280
- type: Output
6281
- }] }); })();
6282
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ListBase, { className: "ListBase", filePath: "lib\\ui\\components\\base\\list.ts", lineNumber: 26 }); })();
6283
-
6284
- /*
6285
- <file>
6286
- Project:
6287
- @osovitny/anatoly
6288
-
6289
- Authors:
6290
- Vadim Osovitny vadim.osovitny@osovitny.com
6291
- Anatoly Osovitny anatoly.osovitny@osovitny.com
6292
-
6293
- Created:
6294
- 4 Jul 2018
6295
-
6296
- Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
6297
- </file>
6298
- */
6299
- //Node
6300
- function SignUpButtonComponent_a_0_ng_container_1_Template(rf, ctx) { if (rf & 1) {
6301
- i0.ɵɵelementContainer(0);
6302
- } }
6303
- function SignUpButtonComponent_a_0_Template(rf, ctx) { if (rf & 1) {
6304
- i0.ɵɵelementStart(0, "a", 3);
6305
- i0.ɵɵtemplate(1, SignUpButtonComponent_a_0_ng_container_1_Template, 1, 0, "ng-container", 4);
6306
- i0.ɵɵelementEnd();
6307
- } if (rf & 2) {
6308
- const ctx_r0 = i0.ɵɵnextContext();
6309
- const _r3 = i0.ɵɵreference(3);
6310
- i0.ɵɵclassMap(ctx_r0.classes);
6311
- i0.ɵɵproperty("href", ctx_r0.url, i0.ɵɵsanitizeUrl);
6312
- i0.ɵɵadvance();
6313
- i0.ɵɵproperty("ngTemplateOutlet", _r3);
6314
- } }
6315
- function SignUpButtonComponent_a_1_ng_container_1_Template(rf, ctx) { if (rf & 1) {
6316
- i0.ɵɵelementContainer(0);
6317
- } }
6318
- function SignUpButtonComponent_a_1_Template(rf, ctx) { if (rf & 1) {
6319
- i0.ɵɵelementStart(0, "a", 5);
6320
- i0.ɵɵtemplate(1, SignUpButtonComponent_a_1_ng_container_1_Template, 1, 0, "ng-container", 4);
6321
- i0.ɵɵelementEnd();
6322
- } if (rf & 2) {
6323
- const ctx_r1 = i0.ɵɵnextContext();
6324
- const _r3 = i0.ɵɵreference(3);
6325
- i0.ɵɵclassMap(ctx_r1.classes);
6326
- i0.ɵɵproperty("routerLink", ctx_r1.url);
6327
- i0.ɵɵadvance();
6328
- i0.ɵɵproperty("ngTemplateOutlet", _r3);
6329
- } }
6330
- function SignUpButtonComponent_ng_template_2_span_3_Template(rf, ctx) { if (rf & 1) {
6331
- i0.ɵɵelementStart(0, "span");
6332
- i0.ɵɵtext(1, "Sign Up");
6333
- i0.ɵɵelementEnd();
6334
- } }
6335
- function SignUpButtonComponent_ng_template_2_Template(rf, ctx) { if (rf & 1) {
6336
- i0.ɵɵelementStart(0, "span", null, 6);
6337
- i0.ɵɵprojection(2);
6338
- i0.ɵɵelementEnd();
6339
- i0.ɵɵtemplate(3, SignUpButtonComponent_ng_template_2_span_3_Template, 2, 0, "span", 7);
6340
- } if (rf & 2) {
6341
- const _r6 = i0.ɵɵreference(1);
6342
- i0.ɵɵadvance(3);
6343
- i0.ɵɵproperty("ngIf", !_r6.innerHTML.trim());
6344
- } }
6345
- const _c0$e = ["*"];
6346
- class SignUpButtonComponent extends ComponentBase {
6347
- constructor() {
6348
- super();
6349
- this.external = false;
6348
+ onChange(value) {
6349
+ this.fireValueChange(value);
6350
6350
  }
6351
- ngOnInit() {
6352
- let url = MSALConfig.ui.signup;
6353
- if (url) {
6354
- this.external = url.indexOf('http') > -1;
6355
- if (this.external) {
6356
- this.url = url + (this.qs ? '?' + this.qs : '');
6357
- }
6358
- else {
6359
- this.url = url;
6360
- }
6351
+ //Properties
6352
+ get selectedValue() {
6353
+ if (this.isNgModelBased) {
6354
+ return this.sv;
6361
6355
  }
6356
+ let value = this.getFormValue(this.controlName);
6357
+ return value;
6362
6358
  }
6363
- static { this.ɵfac = function SignUpButtonComponent_Factory(t) { return new (t || SignUpButtonComponent)(); }; }
6364
- static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SignUpButtonComponent, selectors: [["anatoly-signup-button"]], inputs: { qs: "qs" }, features: [i0.ɵɵInheritDefinitionFeature], ngContentSelectors: _c0$e, decls: 4, vars: 2, consts: [[3, "href", "class", 4, "ngIf"], [3, "routerLink", "class", 4, "ngIf"], ["contentTemplate", ""], [3, "href"], [4, "ngTemplateOutlet"], [3, "routerLink"], ["ref", ""], [4, "ngIf"]], template: function SignUpButtonComponent_Template(rf, ctx) { if (rf & 1) {
6365
- i0.ɵɵprojectionDef();
6366
- i0.ɵɵtemplate(0, SignUpButtonComponent_a_0_Template, 2, 5, "a", 0)(1, SignUpButtonComponent_a_1_Template, 2, 5, "a", 1)(2, SignUpButtonComponent_ng_template_2_Template, 4, 1, "ng-template", null, 2, i0.ɵɵtemplateRefExtractor);
6367
- } if (rf & 2) {
6368
- i0.ɵɵproperty("ngIf", ctx.external);
6369
- i0.ɵɵadvance();
6370
- i0.ɵɵproperty("ngIf", !ctx.external);
6371
- } }, dependencies: [i1$2.NgIf, i1$2.NgTemplateOutlet, i1.RouterLink], encapsulation: 2 }); }
6359
+ set selectedValue(value) {
6360
+ if (!value) {
6361
+ return;
6362
+ }
6363
+ if (value != this.sv) {
6364
+ this.sv = value;
6365
+ }
6366
+ }
6367
+ static { this.ɵfac = /*@__PURE__*/ (() => { let ɵEnumEditComponentBase_BaseFactory; return function EnumEditComponentBase_Factory(t) { return (ɵEnumEditComponentBase_BaseFactory || (ɵEnumEditComponentBase_BaseFactory = i0.ɵɵgetInheritedFactory(EnumEditComponentBase)))(t || EnumEditComponentBase); }; })(); }
6368
+ static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: EnumEditComponentBase, selectors: [["ng-component"]], inputs: { defaultValue: "defaultValue" }, outputs: { valueChange: "valueChange" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 0, vars: 0, template: function EnumEditComponentBase_Template(rf, ctx) { }, encapsulation: 2 }); }
6372
6369
  }
6373
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SignUpButtonComponent, [{
6370
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(EnumEditComponentBase, [{
6374
6371
  type: Component,
6375
- args: [{ selector: "anatoly-signup-button", template: "<a [href]=\"url\" class=\"{{ classes }}\" *ngIf=\"external\">\r\n <ng-container *ngTemplateOutlet=\"contentTemplate\"></ng-container>\r\n</a>\r\n\r\n<a [routerLink]=\"url\" class=\"{{ classes }}\" *ngIf=\"!external\">\r\n <ng-container *ngTemplateOutlet=\"contentTemplate\"></ng-container>\r\n</a>\r\n\r\n<ng-template #contentTemplate>\r\n <span #ref><ng-content></ng-content></span>\r\n <span *ngIf=\"!ref.innerHTML.trim()\">Sign Up</span>\r\n</ng-template>\r\n" }]
6376
- }], () => [], { qs: [{
6372
+ args: [{
6373
+ template: ''
6374
+ }]
6375
+ }], null, { defaultValue: [{
6377
6376
  type: Input
6377
+ }], valueChange: [{
6378
+ type: Output
6378
6379
  }] }); })();
6379
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SignUpButtonComponent, { className: "SignUpButtonComponent", filePath: "lib\\ui\\components\\identity\\signup-button.component.ts", lineNumber: 28 }); })();
6380
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(EnumEditComponentBase, { className: "EnumEditComponentBase", filePath: "lib\\ui\\components\\base\\components\\enum-edit.component.ts", lineNumber: 27 }); })();
6380
6381
 
6381
6382
  /*
6382
6383
  <file>
@@ -6388,98 +6389,115 @@ class SignUpButtonComponent extends ComponentBase {
6388
6389
  Anatoly Osovitny anatoly.osovitny@osovitny.com
6389
6390
 
6390
6391
  Created:
6391
- 14 Aug 2018
6392
+ 20 Aug 2022
6392
6393
 
6393
6394
  Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
6394
6395
  </file>
6395
6396
  */
6396
6397
  //Node
6397
- function BuyAccessButtonComponent_div_0_div_1_Template(rf, ctx) { if (rf & 1) {
6398
- i0.ɵɵelementStart(0, "div");
6399
- i0.ɵɵelement(1, "anatoly-signup-button", 1);
6400
- i0.ɵɵelementEnd();
6401
- } }
6402
- function BuyAccessButtonComponent_div_0_div_2_button_1_Template(rf, ctx) { if (rf & 1) {
6403
- i0.ɵɵelementStart(0, "button", 4);
6404
- i0.ɵɵtext(1, " Your Plan ");
6405
- i0.ɵɵelementEnd();
6406
- } }
6407
- function BuyAccessButtonComponent_div_0_div_2_button_2_Template(rf, ctx) { if (rf & 1) {
6408
- const _r6 = i0.ɵɵgetCurrentView();
6409
- i0.ɵɵelementStart(0, "button", 5);
6410
- i0.ɵɵlistener("click", function BuyAccessButtonComponent_div_0_div_2_button_2_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r6); const ctx_r5 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r5.onPlanSelect()); });
6411
- i0.ɵɵtext(1, " Buy Now ");
6412
- i0.ɵɵelementEnd();
6413
- } }
6414
- function BuyAccessButtonComponent_div_0_div_2_Template(rf, ctx) { if (rf & 1) {
6415
- i0.ɵɵelementStart(0, "div");
6416
- i0.ɵɵtemplate(1, BuyAccessButtonComponent_div_0_div_2_button_1_Template, 2, 0, "button", 2)(2, BuyAccessButtonComponent_div_0_div_2_button_2_Template, 2, 0, "button", 3);
6417
- i0.ɵɵelementEnd();
6418
- } if (rf & 2) {
6419
- const ctx_r2 = i0.ɵɵnextContext(2);
6420
- i0.ɵɵadvance();
6421
- i0.ɵɵproperty("ngIf", ctx_r2.plan == ctx_r2.currentPlan);
6422
- i0.ɵɵadvance();
6423
- i0.ɵɵproperty("ngIf", ctx_r2.plan != ctx_r2.currentPlan && ctx_r2.currentPlan == 1);
6424
- } }
6425
- function BuyAccessButtonComponent_div_0_Template(rf, ctx) { if (rf & 1) {
6426
- i0.ɵɵelementStart(0, "div");
6427
- i0.ɵɵtemplate(1, BuyAccessButtonComponent_div_0_div_1_Template, 2, 0, "div", 0)(2, BuyAccessButtonComponent_div_0_div_2_Template, 3, 2, "div", 0);
6428
- i0.ɵɵelementEnd();
6429
- } if (rf & 2) {
6430
- const ctx_r0 = i0.ɵɵnextContext();
6431
- i0.ɵɵadvance();
6432
- i0.ɵɵproperty("ngIf", !ctx_r0.isUserSignedIn);
6433
- i0.ɵɵadvance();
6434
- i0.ɵɵproperty("ngIf", ctx_r0.isUserSignedIn && ctx_r0.visibleIfUserSignedIn);
6435
- } }
6436
- class BuyAccessButtonComponent {
6437
- constructor(appContext) {
6438
- this.appContext = appContext;
6439
- this.contextUpdated = false;
6440
- this.isUserSignedIn = false;
6441
- this.currentPlan = -1;
6442
- this.currentPlanTitle = '';
6443
- this.visibleIfUserSignedIn = false;
6444
- this.planselect = new EventEmitter();
6398
+ class PageBase extends ComponentBase {
6399
+ static { this.ɵfac = /*@__PURE__*/ (() => { let ɵPageBase_BaseFactory; return function PageBase_Factory(t) { return (ɵPageBase_BaseFactory || (ɵPageBase_BaseFactory = i0.ɵɵgetInheritedFactory(PageBase)))(t || PageBase); }; })(); }
6400
+ static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: PageBase, selectors: [["ng-component"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 0, vars: 0, template: function PageBase_Template(rf, ctx) { }, encapsulation: 2 }); }
6401
+ }
6402
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PageBase, [{
6403
+ type: Component,
6404
+ args: [{
6405
+ template: ''
6406
+ }]
6407
+ }], null, null); })();
6408
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PageBase, { className: "PageBase", filePath: "lib\\ui\\components\\base\\pages\\page.ts", lineNumber: 26 }); })();
6409
+
6410
+ /*
6411
+ <file>
6412
+ Project:
6413
+ @osovitny/anatoly
6414
+
6415
+ Authors:
6416
+ Vadim Osovitny vadim.osovitny@osovitny.com
6417
+ Anatoly Osovitny anatoly.osovitny@osovitny.com
6418
+
6419
+ Created:
6420
+ 20 Aug 2022
6421
+
6422
+ Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
6423
+ </file>
6424
+ */
6425
+ //Node
6426
+ class EditPageBase extends EditComponentBase {
6427
+ static { this.ɵfac = /*@__PURE__*/ (() => { let ɵEditPageBase_BaseFactory; return function EditPageBase_Factory(t) { return (ɵEditPageBase_BaseFactory || (ɵEditPageBase_BaseFactory = i0.ɵɵgetInheritedFactory(EditPageBase)))(t || EditPageBase); }; })(); }
6428
+ static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: EditPageBase, selectors: [["ng-component"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 0, vars: 0, template: function EditPageBase_Template(rf, ctx) { }, encapsulation: 2 }); }
6429
+ }
6430
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(EditPageBase, [{
6431
+ type: Component,
6432
+ args: [{
6433
+ template: ''
6434
+ }]
6435
+ }], null, null); })();
6436
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(EditPageBase, { className: "EditPageBase", filePath: "lib\\ui\\components\\base\\pages\\edit.page.ts", lineNumber: 26 }); })();
6437
+
6438
+ /*
6439
+ <file>
6440
+ Project:
6441
+ @osovitny/anatoly
6442
+
6443
+ Authors:
6444
+ Vadim Osovitny vadim.osovitny@osovitny.com
6445
+ Anatoly Osovitny anatoly.osovitny@osovitny.com
6446
+
6447
+ Created:
6448
+ 20 Aug 2022
6449
+
6450
+ Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
6451
+ </file>
6452
+ */
6453
+ //Node
6454
+ class PagedPageBase extends PageBase {
6455
+ constructor() {
6456
+ super(...arguments);
6457
+ this.currentFilter = null;
6458
+ this.totalItems = 0;
6459
+ this.pageSize = 10;
6460
+ this.skipItems = 0;
6461
+ this.currentPage = 1;
6445
6462
  }
6446
- ngOnInit() {
6447
- this.appContext.updated$.subscribe((context) => {
6448
- if (!context) {
6449
- return;
6450
- }
6451
- this.isUserSignedIn = context.isUserSignedIn;
6452
- if (this.isUserSignedIn) {
6453
- this.currentPlan = context.account.billingPlan;
6454
- this.currentPlanTitle = context.account.billingPlanAsString;
6455
- }
6456
- this.contextUpdated = true;
6457
- });
6463
+ loadPageOne() {
6464
+ this.skipItems = 0;
6465
+ this.currentPage = 1;
6466
+ this.loadPage();
6467
+ }
6468
+ reloadPage(drop2pageOne = false) {
6469
+ if (drop2pageOne) {
6470
+ this.loadPageOne();
6471
+ }
6472
+ else {
6473
+ this.loadPage();
6474
+ }
6475
+ }
6476
+ setFilter(filter) {
6477
+ this.currentFilter = filter;
6478
+ this.loadPageOne();
6479
+ }
6480
+ //Tos
6481
+ toIndex(index) {
6482
+ return ((this.currentPage - 1) * this.pageSize) + index + 1;
6458
6483
  }
6459
6484
  //Events
6460
- onPlanSelect() {
6461
- this.planselect.emit(this.plan);
6485
+ onPageChange(e) {
6486
+ this.pageSize = e.take;
6487
+ this.skipItems = e.skip;
6488
+ this.currentPage = (this.skipItems / this.pageSize) + 1;
6489
+ this.loadPage();
6462
6490
  }
6463
- static { this.ɵfac = function BuyAccessButtonComponent_Factory(t) { return new (t || BuyAccessButtonComponent)(i0.ɵɵdirectiveInject(AppContextService)); }; }
6464
- static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: BuyAccessButtonComponent, selectors: [["anatoly-buyaccess-button"]], inputs: { plan: "plan", planTitle: "planTitle", visibleIfUserSignedIn: "visibleIfUserSignedIn" }, outputs: { planselect: "planselect" }, decls: 1, vars: 1, consts: [[4, "ngIf"], ["classes", "btn btn-block btn-primary"], ["class", "btn btn-block btn-success selectPlan", 4, "ngIf"], ["class", "btn btn-block btn-warning selectPlan", 3, "click", 4, "ngIf"], [1, "btn", "btn-block", "btn-success", "selectPlan"], [1, "btn", "btn-block", "btn-warning", "selectPlan", 3, "click"]], template: function BuyAccessButtonComponent_Template(rf, ctx) { if (rf & 1) {
6465
- i0.ɵɵtemplate(0, BuyAccessButtonComponent_div_0_Template, 3, 2, "div", 0);
6466
- } if (rf & 2) {
6467
- i0.ɵɵproperty("ngIf", ctx.contextUpdated);
6468
- } }, dependencies: [i1$2.NgIf, SignUpButtonComponent], encapsulation: 2 }); }
6491
+ static { this.ɵfac = /*@__PURE__*/ (() => { let ɵPagedPageBase_BaseFactory; return function PagedPageBase_Factory(t) { return (ɵPagedPageBase_BaseFactory || (ɵPagedPageBase_BaseFactory = i0.ɵɵgetInheritedFactory(PagedPageBase)))(t || PagedPageBase); }; })(); }
6492
+ static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: PagedPageBase, selectors: [["ng-component"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 0, vars: 0, template: function PagedPageBase_Template(rf, ctx) { }, encapsulation: 2 }); }
6469
6493
  }
6470
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(BuyAccessButtonComponent, [{
6494
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PagedPageBase, [{
6471
6495
  type: Component,
6472
- args: [{ selector: 'anatoly-buyaccess-button', template: "<div *ngIf=\"contextUpdated\">\r\n <div *ngIf=\"!isUserSignedIn\">\r\n <anatoly-signup-button classes=\"btn btn-block btn-primary\"></anatoly-signup-button>\r\n </div>\r\n\r\n <div *ngIf=\"isUserSignedIn && visibleIfUserSignedIn\">\r\n <button class=\"btn btn-block btn-success selectPlan\"\r\n *ngIf=\"plan == currentPlan\">\r\n Your Plan\r\n </button>\r\n\r\n <button class=\"btn btn-block btn-warning selectPlan\"\r\n *ngIf=\"plan != currentPlan && currentPlan == 1\"\r\n (click)=\"onPlanSelect()\">\r\n Buy Now\r\n </button>\r\n </div>\r\n</div>\r\n" }]
6473
- }], () => [{ type: AppContextService }], { plan: [{
6474
- type: Input
6475
- }], planTitle: [{
6476
- type: Input
6477
- }], visibleIfUserSignedIn: [{
6478
- type: Input
6479
- }], planselect: [{
6480
- type: Output
6481
- }] }); })();
6482
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(BuyAccessButtonComponent, { className: "BuyAccessButtonComponent", filePath: "lib\\ui\\components\\billing\\buyaccess-button.component.ts", lineNumber: 27 }); })();
6496
+ args: [{
6497
+ template: ''
6498
+ }]
6499
+ }], null, null); })();
6500
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PagedPageBase, { className: "PagedPageBase", filePath: "lib\\ui\\components\\base\\pages\\paged.page.ts", lineNumber: 26 }); })();
6483
6501
 
6484
6502
  /*
6485
6503
  <file>
@@ -6491,109 +6509,91 @@ class BuyAccessButtonComponent {
6491
6509
  Anatoly Osovitny anatoly.osovitny@osovitny.com
6492
6510
 
6493
6511
  Created:
6494
- 1 Jun 2018
6512
+ 20 Aug 2022
6495
6513
 
6496
6514
  Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
6497
6515
  </file>
6498
- */
6499
- //Node
6500
- function SubscribePlanButtonComponent_div_0_div_1_Template(rf, ctx) { if (rf & 1) {
6501
- i0.ɵɵelementStart(0, "div");
6502
- i0.ɵɵelement(1, "anatoly-signup-button", 1);
6503
- i0.ɵɵelementEnd();
6504
- } }
6505
- function SubscribePlanButtonComponent_div_0_div_2_button_1_Template(rf, ctx) { if (rf & 1) {
6506
- i0.ɵɵelementStart(0, "button", 5);
6507
- i0.ɵɵtext(1, " Your Plan ");
6508
- i0.ɵɵelementEnd();
6509
- } }
6510
- function SubscribePlanButtonComponent_div_0_div_2_button_2_Template(rf, ctx) { if (rf & 1) {
6511
- i0.ɵɵelementStart(0, "button", 6);
6512
- i0.ɵɵtext(1, " Requested ");
6513
- i0.ɵɵelementEnd();
6514
- } }
6515
- function SubscribePlanButtonComponent_div_0_div_2_button_3_Template(rf, ctx) { if (rf & 1) {
6516
- const _r7 = i0.ɵɵgetCurrentView();
6517
- i0.ɵɵelementStart(0, "button", 7);
6518
- i0.ɵɵlistener("click", function SubscribePlanButtonComponent_div_0_div_2_button_3_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r7); const ctx_r6 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r6.onPlanSelect()); });
6519
- i0.ɵɵtext(1, " Subscribe ");
6520
- i0.ɵɵelementEnd();
6521
- } }
6522
- function SubscribePlanButtonComponent_div_0_div_2_Template(rf, ctx) { if (rf & 1) {
6523
- i0.ɵɵelementStart(0, "div");
6524
- i0.ɵɵtemplate(1, SubscribePlanButtonComponent_div_0_div_2_button_1_Template, 2, 0, "button", 2)(2, SubscribePlanButtonComponent_div_0_div_2_button_2_Template, 2, 0, "button", 3)(3, SubscribePlanButtonComponent_div_0_div_2_button_3_Template, 2, 0, "button", 4);
6525
- i0.ɵɵelementEnd();
6526
- } if (rf & 2) {
6527
- const ctx_r2 = i0.ɵɵnextContext(2);
6528
- i0.ɵɵadvance();
6529
- i0.ɵɵproperty("ngIf", ctx_r2.plan == ctx_r2.currentPlan);
6530
- i0.ɵɵadvance();
6531
- i0.ɵɵproperty("ngIf", ctx_r2.plan == ctx_r2.requestedPlan);
6532
- i0.ɵɵadvance();
6533
- i0.ɵɵproperty("ngIf", ctx_r2.plan != ctx_r2.currentPlan && ctx_r2.plan != ctx_r2.requestedPlan);
6534
- } }
6535
- function SubscribePlanButtonComponent_div_0_Template(rf, ctx) { if (rf & 1) {
6536
- i0.ɵɵelementStart(0, "div");
6537
- i0.ɵɵtemplate(1, SubscribePlanButtonComponent_div_0_div_1_Template, 2, 0, "div", 0)(2, SubscribePlanButtonComponent_div_0_div_2_Template, 4, 3, "div", 0);
6538
- i0.ɵɵelementEnd();
6539
- } if (rf & 2) {
6540
- const ctx_r0 = i0.ɵɵnextContext();
6541
- i0.ɵɵadvance();
6542
- i0.ɵɵproperty("ngIf", !ctx_r0.isUserSignedIn);
6543
- i0.ɵɵadvance();
6544
- i0.ɵɵproperty("ngIf", ctx_r0.isUserSignedIn && ctx_r0.visibleIfUserSignedIn);
6545
- } }
6546
- class SubscribePlanButtonComponent {
6547
- constructor(appContext) {
6548
- this.appContext = appContext;
6549
- this.contextUpdated = false;
6550
- this.isUserSignedIn = false;
6551
- this.currentPlan = -1;
6552
- this.currentPlanTitle = "";
6553
- this.requestedPlan = -1;
6554
- this.requestedPlanTitle = "";
6555
- this.visibleIfUserSignedIn = false;
6556
- this.planselect = new EventEmitter();
6516
+ */
6517
+ //Node
6518
+ class ListBase extends ComponentBase {
6519
+ constructor() {
6520
+ super(...arguments);
6521
+ this.currentFilter = null;
6522
+ this.dataLoaded = false;
6523
+ this.totalItems = 0;
6524
+ this.skipItems = 0;
6525
+ this.currentPage = 1;
6526
+ //Inputs
6527
+ this.pageSize = 10;
6528
+ this.autoDataLoading = false;
6529
+ //Outputs
6530
+ this.filterRequest = new EventEmitter();
6531
+ this.dataChange = new EventEmitter();
6557
6532
  }
6558
6533
  ngOnInit() {
6559
- this.appContext.updated$.subscribe((context) => {
6560
- if (!context) {
6561
- return;
6562
- }
6563
- this.isUserSignedIn = context.isUserSignedIn;
6564
- if (this.isUserSignedIn) {
6565
- this.currentPlan = context.account.billingPlan;
6566
- this.currentPlanTitle = context.account.billingPlanAsString;
6567
- this.requestedPlan = context.account.requestedBillingPlan;
6568
- this.requestedPlanTitle = context.account.requestedBillingPlanAsString;
6569
- }
6570
- this.contextUpdated = true;
6571
- });
6534
+ this.init();
6535
+ }
6536
+ init() {
6537
+ if (this.autoDataLoading && !this.dataLoaded) {
6538
+ this.loadPageOne();
6539
+ }
6540
+ else {
6541
+ this.fireFilterRequest();
6542
+ }
6543
+ }
6544
+ fireFilterRequest() {
6545
+ this.filterRequest.emit();
6546
+ }
6547
+ fireDataChange(e = null) {
6548
+ this.dataChange.emit(e);
6549
+ }
6550
+ loadPageOne() {
6551
+ this.skipItems = 0;
6552
+ this.currentPage = 1;
6553
+ this.dataLoaded = true;
6554
+ this.loadPage();
6555
+ }
6556
+ reloadPage(drop2pageOne = false) {
6557
+ if (drop2pageOne) {
6558
+ this.loadPageOne();
6559
+ }
6560
+ else {
6561
+ this.loadPage();
6562
+ }
6563
+ }
6564
+ setFilter(filter) {
6565
+ this.currentFilter = filter;
6566
+ this.loadPageOne();
6567
+ }
6568
+ //Tos
6569
+ toIndex(index) {
6570
+ return ((this.currentPage - 1) * this.pageSize) + index + 1;
6572
6571
  }
6573
6572
  //Events
6574
- onPlanSelect() {
6575
- this.planselect.emit(this.plan);
6573
+ onPageChange(e) {
6574
+ this.pageSize = e.take;
6575
+ this.skipItems = e.skip;
6576
+ this.currentPage = (this.skipItems / this.pageSize) + 1;
6577
+ this.loadPage();
6576
6578
  }
6577
- static { this.ɵfac = function SubscribePlanButtonComponent_Factory(t) { return new (t || SubscribePlanButtonComponent)(i0.ɵɵdirectiveInject(AppContextService)); }; }
6578
- static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SubscribePlanButtonComponent, selectors: [["anatoly-subscribe-plan-button"]], inputs: { plan: "plan", planTitle: "planTitle", visibleIfUserSignedIn: "visibleIfUserSignedIn" }, outputs: { planselect: "planselect" }, decls: 1, vars: 1, consts: [[4, "ngIf"], ["classes", "btn btn-block btn-primary"], ["class", "btn btn-block btn-success selectPlan", 4, "ngIf"], ["class", "btn btn-block btn-warning selectPlan", 4, "ngIf"], ["class", "btn btn-block btn-warning selectPlan", 3, "click", 4, "ngIf"], [1, "btn", "btn-block", "btn-success", "selectPlan"], [1, "btn", "btn-block", "btn-warning", "selectPlan"], [1, "btn", "btn-block", "btn-warning", "selectPlan", 3, "click"]], template: function SubscribePlanButtonComponent_Template(rf, ctx) { if (rf & 1) {
6579
- i0.ɵɵtemplate(0, SubscribePlanButtonComponent_div_0_Template, 3, 2, "div", 0);
6580
- } if (rf & 2) {
6581
- i0.ɵɵproperty("ngIf", ctx.contextUpdated);
6582
- } }, dependencies: [i1$2.NgIf, SignUpButtonComponent], encapsulation: 2 }); }
6579
+ static { this.ɵfac = /*@__PURE__*/ (() => { let ɵListBase_BaseFactory; return function ListBase_Factory(t) { return (ɵListBase_BaseFactory || (ɵListBase_BaseFactory = i0.ɵɵgetInheritedFactory(ListBase)))(t || ListBase); }; })(); }
6580
+ static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ListBase, selectors: [["ng-component"]], inputs: { pageSize: "pageSize", autoDataLoading: "autoDataLoading" }, outputs: { filterRequest: "filterRequest", dataChange: "dataChange" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 0, vars: 0, template: function ListBase_Template(rf, ctx) { }, encapsulation: 2 }); }
6583
6581
  }
6584
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SubscribePlanButtonComponent, [{
6582
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ListBase, [{
6585
6583
  type: Component,
6586
- args: [{ selector: "anatoly-subscribe-plan-button", template: "<div *ngIf=\"contextUpdated\">\r\n <div *ngIf=\"!isUserSignedIn\">\r\n <anatoly-signup-button classes=\"btn btn-block btn-primary\"></anatoly-signup-button>\r\n </div>\r\n\r\n <div *ngIf=\"isUserSignedIn && visibleIfUserSignedIn\">\r\n <button class=\"btn btn-block btn-success selectPlan\"\r\n *ngIf=\"plan == currentPlan\">\r\n Your Plan\r\n </button>\r\n\r\n <button class=\"btn btn-block btn-warning selectPlan\"\r\n *ngIf=\"plan == requestedPlan\">\r\n Requested\r\n </button>\r\n\r\n <button class=\"btn btn-block btn-warning selectPlan\"\r\n *ngIf=\"plan != currentPlan && plan != requestedPlan\"\r\n (click)=\"onPlanSelect()\">\r\n Subscribe\r\n </button>\r\n </div>\r\n</div>\r\n" }]
6587
- }], () => [{ type: AppContextService }], { plan: [{
6588
- type: Input
6589
- }], planTitle: [{
6584
+ args: [{
6585
+ template: ''
6586
+ }]
6587
+ }], null, { pageSize: [{
6590
6588
  type: Input
6591
- }], visibleIfUserSignedIn: [{
6589
+ }], autoDataLoading: [{
6592
6590
  type: Input
6593
- }], planselect: [{
6591
+ }], filterRequest: [{
6592
+ type: Output
6593
+ }], dataChange: [{
6594
6594
  type: Output
6595
6595
  }] }); })();
6596
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SubscribePlanButtonComponent, { className: "SubscribePlanButtonComponent", filePath: "lib\\ui\\components\\billing\\subscribe-plan-button.component.ts", lineNumber: 27 }); })();
6596
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ListBase, { className: "ListBase", filePath: "lib\\ui\\components\\base\\list.ts", lineNumber: 26 }); })();
6597
6597
 
6598
6598
  /*
6599
6599
  <file>
@@ -7954,7 +7954,7 @@ class SignInButtonComponent extends ComponentBase {
7954
7954
  i0.ɵɵproperty("ngIf", ctx.external);
7955
7955
  i0.ɵɵadvance();
7956
7956
  i0.ɵɵproperty("ngIf", !ctx.external);
7957
- } }, dependencies: [i1$2.NgIf, i1$2.NgTemplateOutlet, i1.RouterLink], encapsulation: 2 }); }
7957
+ } }, dependencies: [i1$2.NgIf, i1$2.NgTemplateOutlet, i1$1.RouterLink], encapsulation: 2 }); }
7958
7958
  }
7959
7959
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SignInButtonComponent, [{
7960
7960
  type: Component,
@@ -8051,7 +8051,7 @@ class SignOutButtonComponent extends ComponentBase {
8051
8051
  i0.ɵɵproperty("ngIf", ctx.external);
8052
8052
  i0.ɵɵadvance();
8053
8053
  i0.ɵɵproperty("ngIf", !ctx.external);
8054
- } }, dependencies: [i1$2.NgIf, i1$2.NgTemplateOutlet, i1.RouterLink], encapsulation: 2 }); }
8054
+ } }, dependencies: [i1$2.NgIf, i1$2.NgTemplateOutlet, i1$1.RouterLink], encapsulation: 2 }); }
8055
8055
  }
8056
8056
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SignOutButtonComponent, [{
8057
8057
  type: Component,
@@ -8293,7 +8293,7 @@ class PageSpinnerComponent {
8293
8293
  ngOnDestroy() {
8294
8294
  this.isSpinnerVisible = false;
8295
8295
  }
8296
- static { this.ɵfac = function PageSpinnerComponent_Factory(t) { return new (t || PageSpinnerComponent)(i0.ɵɵdirectiveInject(i1.Router)); }; }
8296
+ static { this.ɵfac = function PageSpinnerComponent_Factory(t) { return new (t || PageSpinnerComponent)(i0.ɵɵdirectiveInject(i1$1.Router)); }; }
8297
8297
  static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: PageSpinnerComponent, selectors: [["anatoly-pagespinner"]], inputs: { backgroundColor: "backgroundColor", spinner: "spinner" }, decls: 1, vars: 1, consts: [["id", "http-loader", 4, "ngIf"], ["id", "http-loader"], [1, "loader-bg"], ["class", "sk-line-material", 3, "colored", 4, "ngIf"], [1, "sk-line-material"], [1, "sk-child", "sk-bounce1"]], template: function PageSpinnerComponent_Template(rf, ctx) { if (rf & 1) {
8298
8298
  i0.ɵɵtemplate(0, PageSpinnerComponent_div_0_Template, 3, 1, "div", 0);
8299
8299
  } if (rf & 2) {
@@ -8303,7 +8303,7 @@ class PageSpinnerComponent {
8303
8303
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PageSpinnerComponent, [{
8304
8304
  type: Component,
8305
8305
  args: [{ selector: 'anatoly-pagespinner', encapsulation: ViewEncapsulation.None, template: "<div id=\"http-loader\" *ngIf=\"isSpinnerVisible\">\r\n <div class=\"loader-bg\">\r\n <div class=\"sk-line-material\" [class.colored]=\"!backgroundColor\" *ngIf=\"spinner === Spinkit.skLine\">\r\n <div class=\"sk-child sk-bounce1\" [style.background-color]='backgroundColor'></div>\r\n </div>\r\n </div>\r\n</div>\r\n" }]
8306
- }], () => [{ type: i1.Router }], { backgroundColor: [{
8306
+ }], () => [{ type: i1$1.Router }], { backgroundColor: [{
8307
8307
  type: Input
8308
8308
  }], spinner: [{
8309
8309
  type: Input
@@ -10074,7 +10074,7 @@ class AnatolyIAMPagesModule {
10074
10074
  }], null, null); })();
10075
10075
  (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(AnatolyIAMPagesModule, { declarations: [SignInPage, SignUpPage, SignOutPage], imports: [CommonModule,
10076
10076
  RouterModule,
10077
- HttpClientModule, i1.RouterModule] }); })();
10077
+ HttpClientModule, i1$1.RouterModule] }); })();
10078
10078
 
10079
10079
  /*
10080
10080
  <file>
@@ -10271,89 +10271,6 @@ class KendoModule {
10271
10271
  TreeViewModule,
10272
10272
  TooltipsModule] }); })();
10273
10273
 
10274
- /*
10275
- <file>
10276
- Project:
10277
- @osovitny/anatoly
10278
-
10279
- Authors:
10280
- Vadim Osovitny vadim.osovitny@osovitny.com
10281
-
10282
- Created:
10283
- 8 Nov 2024
10284
-
10285
- Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
10286
- </file>
10287
- */
10288
- const COMPONENTS$1 = [
10289
- OrderSummaryComponent,
10290
- PaymentMethodsComponent,
10291
- PaymentOptionsComponent,
10292
- PaypalButtonComponent,
10293
- PayPalComponent,
10294
- //Dialogs
10295
- BraintreeDialog,
10296
- StripeDialog,
10297
- ];
10298
-
10299
- /*
10300
- <file>
10301
- Project:
10302
- @osovitny/anatoly
10303
-
10304
- Authors:
10305
- Vadim Osovitny vadim.osovitny@osovitny.com
10306
- Anatoly Osovitny anatoly.osovitny@osovitny.com
10307
-
10308
- Created:
10309
- 14 Jun 2024
10310
-
10311
- Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
10312
- </file>
10313
- */
10314
- //Node
10315
- class AnatolyBillingModule {
10316
- static { this.ɵfac = function AnatolyBillingModule_Factory(t) { return new (t || AnatolyBillingModule)(); }; }
10317
- static { this.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: AnatolyBillingModule }); }
10318
- static { this.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ providers: [
10319
- ScriptService,
10320
- PayPalScriptService,
10321
- PaymentsService
10322
- ], imports: [CommonModule,
10323
- ReactiveFormsModule,
10324
- FormsModule,
10325
- FaModule,
10326
- KendoModule] }); }
10327
- }
10328
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AnatolyBillingModule, [{
10329
- type: NgModule,
10330
- args: [{
10331
- imports: [
10332
- CommonModule,
10333
- ReactiveFormsModule,
10334
- FormsModule,
10335
- FaModule,
10336
- KendoModule
10337
- ],
10338
- declarations: [
10339
- COMPONENTS$1
10340
- ],
10341
- exports: [
10342
- COMPONENTS$1
10343
- ],
10344
- providers: [
10345
- ScriptService,
10346
- PayPalScriptService,
10347
- PaymentsService
10348
- ]
10349
- }]
10350
- }], null, null); })();
10351
- (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(AnatolyBillingModule, { declarations: [OrderSummaryComponent, PaymentMethodsComponent, PaymentOptionsComponent, PaypalButtonComponent, PayPalComponent, BraintreeDialog, StripeDialog], imports: [CommonModule,
10352
- ReactiveFormsModule,
10353
- FormsModule,
10354
- FaModule,
10355
- KendoModule], exports: [OrderSummaryComponent, PaymentMethodsComponent, PaymentOptionsComponent, PaypalButtonComponent, PayPalComponent, BraintreeDialog, StripeDialog] }); })();
10356
-
10357
10274
  /*
10358
10275
  <file>
10359
10276
  Project:
@@ -10370,9 +10287,6 @@ class AnatolyBillingModule {
10370
10287
  </file>
10371
10288
  */
10372
10289
  const MAIN_COMPONENTS = [
10373
- //Billing
10374
- BuyAccessButtonComponent,
10375
- SubscribePlanButtonComponent,
10376
10290
  //Cards
10377
10291
  CardComponent,
10378
10292
  CardHeaderComponent,
@@ -10517,7 +10431,7 @@ const VALIDATION_COMPONENTS = [
10517
10431
  </file>
10518
10432
  */
10519
10433
  //Node
10520
- const COMPONENTS = [
10434
+ const COMPONENTS$1 = [
10521
10435
  MAIN_COMPONENTS,
10522
10436
  DIALOGS,
10523
10437
  DIRECTIVES,
@@ -10553,14 +10467,14 @@ class AnatolyUIModule {
10553
10467
  KendoModule
10554
10468
  ],
10555
10469
  exports: [
10556
- ...COMPONENTS
10470
+ ...COMPONENTS$1
10557
10471
  ],
10558
10472
  declarations: [
10559
- ...COMPONENTS
10473
+ ...COMPONENTS$1
10560
10474
  ]
10561
10475
  }]
10562
10476
  }], null, null); })();
10563
- (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(AnatolyUIModule, { declarations: [BuyAccessButtonComponent, SubscribePlanButtonComponent, CardComponent, CardHeaderComponent, CardBodyComponent, CardFooterComponent, CheckIconComponent, Copy2ClipboardComponent, ControlPanelComponent, DataPagerComponent, CountryDropdownlist, ModerationStatusDropdownlist, PublishStatusDropdownlist, TimezoneDropdownlist, HtmlEditorComponent, SignInButtonComponent, SignUpButtonComponent, SignOutButtonComponent, NodataComponent, NoMobileSupportComponent, PageSpinnerComponent, LoadingComponent, UrlSlugComponent, FeatureWillBeReadyComponent, YouAgreeToOurTermsComponent, ContactUsDialog, NativeElementDirective, HoveringDirective, AddressComponent, CompanyComponent, ContactUsForm, SafeHtmlPipe, ReplaceTextPipe, FileSizePipe, FormValidationSummaryComponent, ItemValidationSummaryComponent], imports: [CommonModule,
10477
+ (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(AnatolyUIModule, { declarations: [CardComponent, CardHeaderComponent, CardBodyComponent, CardFooterComponent, CheckIconComponent, Copy2ClipboardComponent, ControlPanelComponent, DataPagerComponent, CountryDropdownlist, ModerationStatusDropdownlist, PublishStatusDropdownlist, TimezoneDropdownlist, HtmlEditorComponent, SignInButtonComponent, SignUpButtonComponent, SignOutButtonComponent, NodataComponent, NoMobileSupportComponent, PageSpinnerComponent, LoadingComponent, UrlSlugComponent, FeatureWillBeReadyComponent, YouAgreeToOurTermsComponent, ContactUsDialog, NativeElementDirective, HoveringDirective, AddressComponent, CompanyComponent, ContactUsForm, SafeHtmlPipe, ReplaceTextPipe, FileSizePipe, FormValidationSummaryComponent, ItemValidationSummaryComponent], imports: [CommonModule,
10564
10478
  RouterModule,
10565
10479
  ReactiveFormsModule,
10566
10480
  FormsModule,
@@ -10568,7 +10482,95 @@ class AnatolyUIModule {
10568
10482
  FERootModule,
10569
10483
  //External Modules
10570
10484
  FaModule,
10571
- KendoModule], exports: [BuyAccessButtonComponent, SubscribePlanButtonComponent, CardComponent, CardHeaderComponent, CardBodyComponent, CardFooterComponent, CheckIconComponent, Copy2ClipboardComponent, ControlPanelComponent, DataPagerComponent, CountryDropdownlist, ModerationStatusDropdownlist, PublishStatusDropdownlist, TimezoneDropdownlist, HtmlEditorComponent, SignInButtonComponent, SignUpButtonComponent, SignOutButtonComponent, NodataComponent, NoMobileSupportComponent, PageSpinnerComponent, LoadingComponent, UrlSlugComponent, FeatureWillBeReadyComponent, YouAgreeToOurTermsComponent, ContactUsDialog, NativeElementDirective, HoveringDirective, AddressComponent, CompanyComponent, ContactUsForm, SafeHtmlPipe, ReplaceTextPipe, FileSizePipe, FormValidationSummaryComponent, ItemValidationSummaryComponent] }); })();
10485
+ KendoModule], exports: [CardComponent, CardHeaderComponent, CardBodyComponent, CardFooterComponent, CheckIconComponent, Copy2ClipboardComponent, ControlPanelComponent, DataPagerComponent, CountryDropdownlist, ModerationStatusDropdownlist, PublishStatusDropdownlist, TimezoneDropdownlist, HtmlEditorComponent, SignInButtonComponent, SignUpButtonComponent, SignOutButtonComponent, NodataComponent, NoMobileSupportComponent, PageSpinnerComponent, LoadingComponent, UrlSlugComponent, FeatureWillBeReadyComponent, YouAgreeToOurTermsComponent, ContactUsDialog, NativeElementDirective, HoveringDirective, AddressComponent, CompanyComponent, ContactUsForm, SafeHtmlPipe, ReplaceTextPipe, FileSizePipe, FormValidationSummaryComponent, ItemValidationSummaryComponent] }); })();
10486
+
10487
+ /*
10488
+ <file>
10489
+ Project:
10490
+ @osovitny/anatoly
10491
+
10492
+ Authors:
10493
+ Vadim Osovitny vadim.osovitny@osovitny.com
10494
+
10495
+ Created:
10496
+ 8 Nov 2024
10497
+
10498
+ Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
10499
+ </file>
10500
+ */
10501
+ const COMPONENTS = [
10502
+ BuyAccessButtonComponent,
10503
+ SubscribePlanButtonComponent,
10504
+ OrderSummaryComponent,
10505
+ PaymentMethodsComponent,
10506
+ PaymentOptionsComponent,
10507
+ //PM
10508
+ BraintreeDialog,
10509
+ PaypalButtonComponent,
10510
+ PayPalComponent,
10511
+ StripeDialog
10512
+ ];
10513
+
10514
+ /*
10515
+ <file>
10516
+ Project:
10517
+ @osovitny/anatoly
10518
+
10519
+ Authors:
10520
+ Vadim Osovitny vadim.osovitny@osovitny.com
10521
+ Anatoly Osovitny anatoly.osovitny@osovitny.com
10522
+
10523
+ Created:
10524
+ 14 Jun 2024
10525
+
10526
+ Copyright (c) 2016-2025 Osovitny Inc. All rights reserved.
10527
+ </file>
10528
+ */
10529
+ //Node
10530
+ class AnatolyBillingModule {
10531
+ static { this.ɵfac = function AnatolyBillingModule_Factory(t) { return new (t || AnatolyBillingModule)(); }; }
10532
+ static { this.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: AnatolyBillingModule }); }
10533
+ static { this.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ providers: [
10534
+ ScriptService,
10535
+ PayPalScriptService,
10536
+ PaymentsService
10537
+ ], imports: [CommonModule,
10538
+ ReactiveFormsModule,
10539
+ FormsModule,
10540
+ FaModule,
10541
+ KendoModule,
10542
+ AnatolyUIModule] }); }
10543
+ }
10544
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AnatolyBillingModule, [{
10545
+ type: NgModule,
10546
+ args: [{
10547
+ imports: [
10548
+ CommonModule,
10549
+ ReactiveFormsModule,
10550
+ FormsModule,
10551
+ FaModule,
10552
+ KendoModule,
10553
+ AnatolyUIModule
10554
+ ],
10555
+ declarations: [
10556
+ COMPONENTS
10557
+ ],
10558
+ exports: [
10559
+ COMPONENTS
10560
+ ],
10561
+ providers: [
10562
+ ScriptService,
10563
+ PayPalScriptService,
10564
+ PaymentsService
10565
+ ]
10566
+ }]
10567
+ }], null, null); })();
10568
+ (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(AnatolyBillingModule, { declarations: [BuyAccessButtonComponent, SubscribePlanButtonComponent, OrderSummaryComponent, PaymentMethodsComponent, PaymentOptionsComponent, BraintreeDialog, PaypalButtonComponent, PayPalComponent, StripeDialog], imports: [CommonModule,
10569
+ ReactiveFormsModule,
10570
+ FormsModule,
10571
+ FaModule,
10572
+ KendoModule,
10573
+ AnatolyUIModule], exports: [BuyAccessButtonComponent, SubscribePlanButtonComponent, OrderSummaryComponent, PaymentMethodsComponent, PaymentOptionsComponent, BraintreeDialog, PaypalButtonComponent, PayPalComponent, StripeDialog] }); })();
10572
10574
 
10573
10575
  /*
10574
10576
  <file>