@opra/angular 0.6.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{esm/client.module.d.ts → client.module.d.ts} +5 -1
- package/{esm/constants.d.ts → constants.d.ts} +0 -0
- package/esm2020/client.module.mjs +94 -0
- package/esm2020/constants.mjs +2 -0
- package/esm2020/interfaces/module-options.interface.mjs +2 -0
- package/esm2020/opra-angular.mjs +5 -0
- package/esm2020/public_api.mjs +5 -0
- package/{esm/client.module.js → fesm2015/opra-angular.mjs} +26 -14
- package/fesm2015/opra-angular.mjs.map +1 -0
- package/{cjs/client.module.js → fesm2020/opra-angular.mjs} +38 -29
- package/fesm2020/opra-angular.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/{esm/interfaces → interfaces}/module-options.interface.d.ts +0 -0
- package/package.json +27 -56
- package/public_api.d.ts +3 -0
- package/cjs/constants.js +0 -4
- package/cjs/index.js +0 -6
- package/cjs/interfaces/module-options.interface.js +0 -2
- package/cjs/package.json +0 -3
- package/esm/constants.js +0 -1
- package/esm/index.d.ts +0 -3
- package/esm/index.js +0 -3
- package/esm/interfaces/module-options.interface.js +0 -1
- package/umd/opra-angular.umd.min.js +0 -2
- package/umd/opra-angular.umd.min.js.LICENSE.txt +0 -13
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { ModuleWithProviders } from '@angular/core';
|
|
2
|
-
import { OpraClientModuleAsyncOptions, OpraClientModuleOptions } from './interfaces/module-options.interface
|
|
2
|
+
import { OpraClientModuleAsyncOptions, OpraClientModuleOptions } from './interfaces/module-options.interface';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
3
4
|
export declare class OpraClientModule {
|
|
4
5
|
static forRoot(options: OpraClientModuleOptions): ModuleWithProviders<OpraClientModule>;
|
|
5
6
|
static forRootAsync(options: OpraClientModuleAsyncOptions): ModuleWithProviders<OpraClientModule>;
|
|
6
7
|
private static createAsyncProviders;
|
|
7
8
|
private static createAsyncOptionsProvider;
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<OpraClientModule, never>;
|
|
10
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<OpraClientModule, never, never, never>;
|
|
11
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<OpraClientModule>;
|
|
8
12
|
}
|
|
File without changes
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/* eslint-disable import/extensions */
|
|
2
|
+
import { HttpClient } from '@angular/common/http';
|
|
3
|
+
import { APP_INITIALIZER, NgModule } from '@angular/core';
|
|
4
|
+
import { OpraHttpClient } from '@opra/client';
|
|
5
|
+
import { OPRA_CLIENT_MODULE_OPTIONS } from './constants';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export class OpraClientModule {
|
|
8
|
+
static forRoot(options) {
|
|
9
|
+
const CLIENT_TOKEN = options.token || OpraHttpClient;
|
|
10
|
+
const client = new OpraHttpClient(options.serviceUrl, options);
|
|
11
|
+
return {
|
|
12
|
+
ngModule: OpraClientModule,
|
|
13
|
+
providers: [
|
|
14
|
+
{
|
|
15
|
+
provide: OPRA_CLIENT_MODULE_OPTIONS,
|
|
16
|
+
useValue: options,
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
provide: CLIENT_TOKEN,
|
|
20
|
+
useValue: client
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
provide: APP_INITIALIZER,
|
|
24
|
+
useFactory: () => {
|
|
25
|
+
return () => client.init();
|
|
26
|
+
},
|
|
27
|
+
multi: true
|
|
28
|
+
},
|
|
29
|
+
]
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
static forRootAsync(options) {
|
|
33
|
+
const CLIENT_TOKEN = options.token || OpraHttpClient;
|
|
34
|
+
const asyncProviders = this.createAsyncProviders(options);
|
|
35
|
+
return {
|
|
36
|
+
ngModule: OpraClientModule,
|
|
37
|
+
providers: [
|
|
38
|
+
...asyncProviders,
|
|
39
|
+
{
|
|
40
|
+
provide: CLIENT_TOKEN,
|
|
41
|
+
deps: [HttpClient, OPRA_CLIENT_MODULE_OPTIONS],
|
|
42
|
+
useFactory: (httpClient, opts) => new OpraHttpClient(opts.serviceUrl, opts)
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
provide: APP_INITIALIZER,
|
|
46
|
+
deps: [CLIENT_TOKEN],
|
|
47
|
+
useFactory: (client) => {
|
|
48
|
+
return () => client.init();
|
|
49
|
+
},
|
|
50
|
+
multi: true
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
static createAsyncProviders(options) {
|
|
56
|
+
if (options.useExisting || options.useFactory)
|
|
57
|
+
return [this.createAsyncOptionsProvider(options)];
|
|
58
|
+
if (options.useClass)
|
|
59
|
+
return [
|
|
60
|
+
this.createAsyncOptionsProvider(options),
|
|
61
|
+
{
|
|
62
|
+
provide: options.useClass,
|
|
63
|
+
useClass: options.useClass
|
|
64
|
+
}
|
|
65
|
+
];
|
|
66
|
+
throw new Error('Invalid configuration. Must provide useFactory, useClass or useExisting');
|
|
67
|
+
}
|
|
68
|
+
static createAsyncOptionsProvider(options) {
|
|
69
|
+
if (options.useFactory) {
|
|
70
|
+
return {
|
|
71
|
+
provide: OPRA_CLIENT_MODULE_OPTIONS,
|
|
72
|
+
useFactory: options.useFactory,
|
|
73
|
+
deps: options.deps || [],
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
const useClass = options.useClass || options.useExisting;
|
|
77
|
+
if (useClass) {
|
|
78
|
+
return {
|
|
79
|
+
provide: OPRA_CLIENT_MODULE_OPTIONS,
|
|
80
|
+
useFactory: (o) => o,
|
|
81
|
+
deps: [useClass],
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
throw new Error('Invalid configuration. Must provide useFactory, useClass or useExisting');
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
OpraClientModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: OpraClientModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
88
|
+
OpraClientModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: OpraClientModule });
|
|
89
|
+
OpraClientModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: OpraClientModule });
|
|
90
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: OpraClientModule, decorators: [{
|
|
91
|
+
type: NgModule,
|
|
92
|
+
args: [{}]
|
|
93
|
+
}] });
|
|
94
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2xpZW50Lm1vZHVsZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3BhY2thZ2VzL2FuZ3VsYXIvc3JjL2NsaWVudC5tb2R1bGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsc0NBQXNDO0FBQ3RDLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUNsRCxPQUFPLEVBQUUsZUFBZSxFQUF1QixRQUFRLEVBQVksTUFBTSxlQUFlLENBQUM7QUFDekYsT0FBTyxFQUFFLGNBQWMsRUFBRSxNQUFNLGNBQWMsQ0FBQztBQUM5QyxPQUFPLEVBQUUsMEJBQTBCLEVBQUUsTUFBTSxhQUFhLENBQUM7O0FBS3pELE1BQU0sT0FBTyxnQkFBZ0I7SUFFcEIsTUFBTSxDQUFDLE9BQU8sQ0FBQyxPQUFnQztRQUNwRCxNQUFNLFlBQVksR0FBRyxPQUFPLENBQUMsS0FBSyxJQUFJLGNBQWMsQ0FBQztRQUNyRCxNQUFNLE1BQU0sR0FBRyxJQUFJLGNBQWMsQ0FBQyxPQUFPLENBQUMsVUFBVSxFQUFF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5bmNQcm92aWRlcnMob3B0aW9ucyk7XG5cbiAgICByZXR1cm4ge1xuICAgICAgbmdNb2R1bGU6IE9wcmFDbGllbnRNb2R1bGUsXG4gICAgICBwcm92aWRlcnM6IFtcbiAgICAgICAgLi4uYXN5bmNQcm92aWRlcnMsXG4gICAgICAgIHtcbiAgICAgICAgICBwcm92aWRlOiBDTElFTlRfVE9LRU4sXG4gICAgICAgICAgZGVwczogW0h0dHBDbGllbnQsIE9QUkFfQ0xJRU5UX01PRFVMRV9PUFRJT05TXSxcbiAgICAgICAgICB1c2VGYWN0b3J5OiAoaHR0cENsaWVudDogSHR0cENsaWVudCwgb3B0czogT3ByYUNsaWVudE1vZHVsZU9wdGlvbnMpID0+XG4gICAgICAgICAgICAgIG5ldyBPcHJhSHR0cENsaWVudChvcHRzLnNlcnZpY2VVcmwsIG9wdHMpXG4gICAgICAgIH0sXG4gICAgICAgIHtcbiAgICAgICAgICBwcm92aWRlOiBBUFBfSU5JVElBTElaRVIsXG4gICAgICAgICAgZGVwczogW0NMSUVOVF9UT0tFTl0sXG4gICAgICAgICAgdXNlRmFjdG9yeTogKGNsaWVudDogT3ByYUh0dHBDbGllbnQpID0+IHtcbiAgICAgICAgICAgIHJldHVybiAoKSA9PiBjbGllbnQuaW5pdCgpXG4gICAgICAgICAgfSxcbiAgICAgICAgICBtdWx0aTogdHJ1ZVxuICAgICAgICB9XG4gICAgICBdXG4gICAgfTtcbiAgfVxuXG4gIHByaXZhdGUgc3RhdGljIGNyZWF0ZUFzeW5jUHJvdmlkZXJzKG9wdGlvbnM6IE9wcmFDbGllbnRNb2R1bGVBc3luY09wdGlvbnMpOiBQcm92aWRlcltdIHtcbiAgICBpZiAob3B0aW9ucy51c2VFeGlzdGluZyB8fCBvcHRpb25zLnVzZUZhY3RvcnkpXG4gICAgICByZXR1cm4gW3RoaXMuY3JlYXRlQXN5bmNPcHRpb25zUHJvdmlkZXIob3B0aW9ucyldO1xuXG4gICAgaWYgKG9wdGlvbnMudXNl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uLiBNdXN0IHByb3ZpZGUgdXNlRmFjdG9yeSwgdXNlQ2xhc3Mgb3IgdXNlRXhpc3RpbmcnKTtcbiAgfVxuXG5cbn1cbiJdfQ==
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export const OPRA_CLIENT_MODULE_OPTIONS = 'OPRA_CLIENT_MODULE_OPTIONS';
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uc3RhbnRzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vcGFja2FnZXMvYW5ndWxhci9zcmMvY29uc3RhbnRzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE1BQU0sQ0FBQyxNQUFNLDBCQUEwQixHQUFHLDRCQUE0QixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGNvbnN0IE9QUkFfQ0xJRU5UX01PRFVMRV9PUFRJT05TID0gJ09QUkFfQ0xJRU5UX01PRFVMRV9PUFRJT05TJztcbiJdfQ==
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export {};
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW9kdWxlLW9wdGlvbnMuaW50ZXJmYWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vcGFja2FnZXMvYW5ndWxhci9zcmMvaW50ZXJmYWNlcy9tb2R1bGUtb3B0aW9ucy5pbnRlcmZhY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IEluamVjdGlvblRva2VuLCBOZ01vZHVsZSwgVHlwZSB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuaW1wb3J0IHsgT3ByYUh0dHBDbGllbnRPcHRpb25zIH0gZnJvbSAnQG9wcmEvY2xpZW50JztcblxuZXhwb3J0IHR5cGUgT3ByYUNsaWVudE1vZHVsZU9wdGlvbnMgPSBPcHJhSHR0cENsaWVudE9wdGlvbnMgJiB7XG4gIHNlcnZpY2VVcmw6IHN0cmluZztcbiAgdG9rZW4/OiBzdHJpbmcgfCBJbmplY3Rpb25Ub2tlbjxhbnk+O1xufVxuXG5leHBvcnQgaW50ZXJmYWNlIE9wcmFNb2R1bGVPcHRpb25zRmFjdG9yeSB7XG4gIGNyZWF0ZU9wdGlvbnMoKTogUHJvbWlzZTxPcHJhQ2xpZW50TW9kdWxlT3B0aW9ucz4gfCBPcHJhQ2xpZW50TW9kdWxlT3B0aW9ucztcbn1cblxuZXhwb3J0IGludGVyZmFjZSBPcHJhQ2xpZW50TW9kdWxlQXN5bmNPcHRpb25zXG4gICAgZXh0ZW5kcyBQaWNrPE5nTW9kdWxlLCAnaW1wb3J0cycgfCAncHJvdmlkZXJzJz4ge1xuICB0b2tlbj86IHN0cmluZyB8IEluamVjdGlvblRva2VuPGFueT47XG4gIHVzZUV4aXN0aW5nPzogVHlwZTxPcHJhTW9kdWxlT3B0aW9uc0ZhY3Rvcnk+O1xuICB1c2VDbGFzcz86IFR5cGU8YW55PjtcbiAgdXNlRmFjdG9yeT86ICguLi5hcmdzOiBhbnlbXSkgPT4gUHJvbWlzZTxPcHJhQ2xpZW50TW9kdWxlT3B0aW9ucz4gfCBPcHJhQ2xpZW50TW9kdWxlT3B0aW9ucztcbiAgZGVwcz86IGFueVtdO1xufVxuXG4iXX0=
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated bundle index. Do not edit.
|
|
3
|
+
*/
|
|
4
|
+
export * from './public_api';
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3ByYS1hbmd1bGFyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vcGFja2FnZXMvYW5ndWxhci9zcmMvb3ByYS1hbmd1bGFyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyxjQUFjLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEdlbmVyYXRlZCBidW5kbGUgaW5kZXguIERvIG5vdCBlZGl0LlxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vcHVibGljX2FwaSc7XG4iXX0=
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/* eslint-disable import/extensions */
|
|
2
|
+
export * from './client.module';
|
|
3
|
+
export * from './interfaces/module-options.interface';
|
|
4
|
+
export * from './constants';
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3BhY2thZ2VzL2FuZ3VsYXIvc3JjL3B1YmxpY19hcGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsc0NBQXNDO0FBQ3RDLGNBQWMsaUJBQWlCLENBQUM7QUFDaEMsY0FBYyx1Q0FBdUMsQ0FBQztBQUN0RCxjQUFjLGFBQWEsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qIGVzbGludC1kaXNhYmxlIGltcG9ydC9leHRlbnNpb25zICovXG5leHBvcnQgKiBmcm9tICcuL2NsaWVudC5tb2R1bGUnO1xuZXhwb3J0ICogZnJvbSAnLi9pbnRlcmZhY2VzL21vZHVsZS1vcHRpb25zLmludGVyZmFjZSc7XG5leHBvcnQgKiBmcm9tICcuL2NvbnN0YW50cyc7XG4iXX0=
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import { HttpClient, HttpClientModule } from '@angular/common/http';
|
|
1
|
+
import { HttpClient } from '@angular/common/http';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
4
3
|
import { APP_INITIALIZER, NgModule } from '@angular/core';
|
|
5
4
|
import { OpraHttpClient } from '@opra/client';
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
|
|
6
|
+
const OPRA_CLIENT_MODULE_OPTIONS = 'OPRA_CLIENT_MODULE_OPTIONS';
|
|
7
|
+
|
|
8
|
+
/* eslint-disable import/extensions */
|
|
9
|
+
class OpraClientModule {
|
|
8
10
|
static forRoot(options) {
|
|
9
11
|
const CLIENT_TOKEN = options.token || OpraHttpClient;
|
|
10
12
|
const client = new OpraHttpClient(options.serviceUrl, options);
|
|
11
13
|
return {
|
|
12
|
-
ngModule:
|
|
14
|
+
ngModule: OpraClientModule,
|
|
13
15
|
providers: [
|
|
14
16
|
{
|
|
15
17
|
provide: OPRA_CLIENT_MODULE_OPTIONS,
|
|
@@ -33,7 +35,7 @@ let OpraClientModule = OpraClientModule_1 = class OpraClientModule {
|
|
|
33
35
|
const CLIENT_TOKEN = options.token || OpraHttpClient;
|
|
34
36
|
const asyncProviders = this.createAsyncProviders(options);
|
|
35
37
|
return {
|
|
36
|
-
ngModule:
|
|
38
|
+
ngModule: OpraClientModule,
|
|
37
39
|
providers: [
|
|
38
40
|
...asyncProviders,
|
|
39
41
|
{
|
|
@@ -83,10 +85,20 @@ let OpraClientModule = OpraClientModule_1 = class OpraClientModule {
|
|
|
83
85
|
}
|
|
84
86
|
throw new Error('Invalid configuration. Must provide useFactory, useClass or useExisting');
|
|
85
87
|
}
|
|
86
|
-
}
|
|
87
|
-
OpraClientModule =
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
88
|
+
}
|
|
89
|
+
OpraClientModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: OpraClientModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
90
|
+
OpraClientModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: OpraClientModule });
|
|
91
|
+
OpraClientModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: OpraClientModule });
|
|
92
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: OpraClientModule, decorators: [{
|
|
93
|
+
type: NgModule,
|
|
94
|
+
args: [{}]
|
|
95
|
+
}] });
|
|
96
|
+
|
|
97
|
+
/* eslint-disable import/extensions */
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Generated bundle index. Do not edit.
|
|
101
|
+
*/
|
|
102
|
+
|
|
103
|
+
export { OPRA_CLIENT_MODULE_OPTIONS, OpraClientModule };
|
|
104
|
+
//# sourceMappingURL=opra-angular.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opra-angular.mjs","sources":["../../../packages/angular/src/constants.ts","../../../packages/angular/src/client.module.ts","../../../packages/angular/src/public_api.ts","../../../packages/angular/src/opra-angular.ts"],"sourcesContent":["export const OPRA_CLIENT_MODULE_OPTIONS = 'OPRA_CLIENT_MODULE_OPTIONS';\n","/* eslint-disable import/extensions */\nimport { HttpClient } from '@angular/common/http';\nimport { APP_INITIALIZER, ModuleWithProviders, NgModule, Provider } from '@angular/core';\nimport { OpraHttpClient } from '@opra/client';\nimport { OPRA_CLIENT_MODULE_OPTIONS } from './constants';\nimport { OpraClientModuleAsyncOptions, OpraClientModuleOptions } from './interfaces/module-options.interface';\n\n@NgModule({\n})\nexport class OpraClientModule {\n\n public static forRoot(options: OpraClientModuleOptions): ModuleWithProviders<OpraClientModule> {\n const CLIENT_TOKEN = options.token || OpraHttpClient;\n const client = new OpraHttpClient(options.serviceUrl, options);\n return {\n ngModule: OpraClientModule,\n providers: [\n {\n provide: OPRA_CLIENT_MODULE_OPTIONS,\n useValue: options,\n },\n {\n provide: CLIENT_TOKEN,\n useValue: client\n },\n {\n provide: APP_INITIALIZER,\n useFactory: () => {\n return () => client.init()\n },\n multi: true\n },\n ]\n };\n }\n\n public static forRootAsync(\n options: OpraClientModuleAsyncOptions\n ): ModuleWithProviders<OpraClientModule> {\n const CLIENT_TOKEN = options.token || OpraHttpClient;\n const asyncProviders = this.createAsyncProviders(options);\n\n return {\n ngModule: OpraClientModule,\n providers: [\n ...asyncProviders,\n {\n provide: CLIENT_TOKEN,\n deps: [HttpClient, OPRA_CLIENT_MODULE_OPTIONS],\n useFactory: (httpClient: HttpClient, opts: OpraClientModuleOptions) =>\n new OpraHttpClient(opts.serviceUrl, opts)\n },\n {\n provide: APP_INITIALIZER,\n deps: [CLIENT_TOKEN],\n useFactory: (client: OpraHttpClient) => {\n return () => client.init()\n },\n multi: true\n }\n ]\n };\n }\n\n private static createAsyncProviders(options: OpraClientModuleAsyncOptions): Provider[] {\n if (options.useExisting || options.useFactory)\n return [this.createAsyncOptionsProvider(options)];\n\n if (options.useClass)\n return [\n this.createAsyncOptionsProvider(options),\n {\n provide: options.useClass,\n useClass: options.useClass\n }\n ];\n\n throw new Error('Invalid configuration. Must provide useFactory, useClass or useExisting');\n }\n\n private static createAsyncOptionsProvider(options: OpraClientModuleAsyncOptions): Provider {\n if (options.useFactory) {\n return {\n provide: OPRA_CLIENT_MODULE_OPTIONS,\n useFactory: options.useFactory,\n deps: options.deps || [],\n };\n }\n const useClass = options.useClass || options.useExisting;\n if (useClass) {\n return {\n provide: OPRA_CLIENT_MODULE_OPTIONS,\n useFactory: (o) => o,\n deps: [useClass],\n };\n }\n throw new Error('Invalid configuration. Must provide useFactory, useClass or useExisting');\n }\n\n\n}\n","/* eslint-disable import/extensions */\nexport * from './client.module';\nexport * from './interfaces/module-options.interface';\nexport * from './constants';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;AAAO,MAAM,0BAA0B,GAAG;;ACA1C;MASa,gBAAgB,CAAA;IAEpB,OAAO,OAAO,CAAC,OAAgC,EAAA;AACpD,QAAA,MAAM,YAAY,G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A,CAAA,CAAA;+GAAhB,gBAAgB,EAAA,CAAA,CAAA;4FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAF5B,QAAQ;mBAAC,EACT,CAAA;;;ACRD;;ACAA;;AAEG;;;;"}
|
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
let OpraClientModule = OpraClientModule_1 = class OpraClientModule {
|
|
1
|
+
import { HttpClient } from '@angular/common/http';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { APP_INITIALIZER, NgModule } from '@angular/core';
|
|
4
|
+
import { OpraHttpClient } from '@opra/client';
|
|
5
|
+
|
|
6
|
+
const OPRA_CLIENT_MODULE_OPTIONS = 'OPRA_CLIENT_MODULE_OPTIONS';
|
|
7
|
+
|
|
8
|
+
/* eslint-disable import/extensions */
|
|
9
|
+
class OpraClientModule {
|
|
11
10
|
static forRoot(options) {
|
|
12
|
-
const CLIENT_TOKEN = options.token ||
|
|
13
|
-
const client = new
|
|
11
|
+
const CLIENT_TOKEN = options.token || OpraHttpClient;
|
|
12
|
+
const client = new OpraHttpClient(options.serviceUrl, options);
|
|
14
13
|
return {
|
|
15
|
-
ngModule:
|
|
14
|
+
ngModule: OpraClientModule,
|
|
16
15
|
providers: [
|
|
17
16
|
{
|
|
18
|
-
provide:
|
|
17
|
+
provide: OPRA_CLIENT_MODULE_OPTIONS,
|
|
19
18
|
useValue: options,
|
|
20
19
|
},
|
|
21
20
|
{
|
|
@@ -23,7 +22,7 @@ let OpraClientModule = OpraClientModule_1 = class OpraClientModule {
|
|
|
23
22
|
useValue: client
|
|
24
23
|
},
|
|
25
24
|
{
|
|
26
|
-
provide:
|
|
25
|
+
provide: APP_INITIALIZER,
|
|
27
26
|
useFactory: () => {
|
|
28
27
|
return () => client.init();
|
|
29
28
|
},
|
|
@@ -33,19 +32,19 @@ let OpraClientModule = OpraClientModule_1 = class OpraClientModule {
|
|
|
33
32
|
};
|
|
34
33
|
}
|
|
35
34
|
static forRootAsync(options) {
|
|
36
|
-
const CLIENT_TOKEN = options.token ||
|
|
35
|
+
const CLIENT_TOKEN = options.token || OpraHttpClient;
|
|
37
36
|
const asyncProviders = this.createAsyncProviders(options);
|
|
38
37
|
return {
|
|
39
|
-
ngModule:
|
|
38
|
+
ngModule: OpraClientModule,
|
|
40
39
|
providers: [
|
|
41
40
|
...asyncProviders,
|
|
42
41
|
{
|
|
43
42
|
provide: CLIENT_TOKEN,
|
|
44
|
-
deps: [
|
|
45
|
-
useFactory: (httpClient, opts) => new
|
|
43
|
+
deps: [HttpClient, OPRA_CLIENT_MODULE_OPTIONS],
|
|
44
|
+
useFactory: (httpClient, opts) => new OpraHttpClient(opts.serviceUrl, opts)
|
|
46
45
|
},
|
|
47
46
|
{
|
|
48
|
-
provide:
|
|
47
|
+
provide: APP_INITIALIZER,
|
|
49
48
|
deps: [CLIENT_TOKEN],
|
|
50
49
|
useFactory: (client) => {
|
|
51
50
|
return () => client.init();
|
|
@@ -71,7 +70,7 @@ let OpraClientModule = OpraClientModule_1 = class OpraClientModule {
|
|
|
71
70
|
static createAsyncOptionsProvider(options) {
|
|
72
71
|
if (options.useFactory) {
|
|
73
72
|
return {
|
|
74
|
-
provide:
|
|
73
|
+
provide: OPRA_CLIENT_MODULE_OPTIONS,
|
|
75
74
|
useFactory: options.useFactory,
|
|
76
75
|
deps: options.deps || [],
|
|
77
76
|
};
|
|
@@ -79,17 +78,27 @@ let OpraClientModule = OpraClientModule_1 = class OpraClientModule {
|
|
|
79
78
|
const useClass = options.useClass || options.useExisting;
|
|
80
79
|
if (useClass) {
|
|
81
80
|
return {
|
|
82
|
-
provide:
|
|
81
|
+
provide: OPRA_CLIENT_MODULE_OPTIONS,
|
|
83
82
|
useFactory: (o) => o,
|
|
84
83
|
deps: [useClass],
|
|
85
84
|
};
|
|
86
85
|
}
|
|
87
86
|
throw new Error('Invalid configuration. Must provide useFactory, useClass or useExisting');
|
|
88
87
|
}
|
|
89
|
-
}
|
|
90
|
-
OpraClientModule =
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
88
|
+
}
|
|
89
|
+
OpraClientModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: OpraClientModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
90
|
+
OpraClientModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: OpraClientModule });
|
|
91
|
+
OpraClientModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: OpraClientModule });
|
|
92
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: OpraClientModule, decorators: [{
|
|
93
|
+
type: NgModule,
|
|
94
|
+
args: [{}]
|
|
95
|
+
}] });
|
|
96
|
+
|
|
97
|
+
/* eslint-disable import/extensions */
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Generated bundle index. Do not edit.
|
|
101
|
+
*/
|
|
102
|
+
|
|
103
|
+
export { OPRA_CLIENT_MODULE_OPTIONS, OpraClientModule };
|
|
104
|
+
//# sourceMappingURL=opra-angular.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opra-angular.mjs","sources":["../../../packages/angular/src/constants.ts","../../../packages/angular/src/client.module.ts","../../../packages/angular/src/public_api.ts","../../../packages/angular/src/opra-angular.ts"],"sourcesContent":["export const OPRA_CLIENT_MODULE_OPTIONS = 'OPRA_CLIENT_MODULE_OPTIONS';\n","/* eslint-disable import/extensions */\nimport { HttpClient } from '@angular/common/http';\nimport { APP_INITIALIZER, ModuleWithProviders, NgModule, Provider } from '@angular/core';\nimport { OpraHttpClient } from '@opra/client';\nimport { OPRA_CLIENT_MODULE_OPTIONS } from './constants';\nimport { OpraClientModuleAsyncOptions, OpraClientModuleOptions } from './interfaces/module-options.interface';\n\n@NgModule({\n})\nexport class OpraClientModule {\n\n public static forRoot(options: OpraClientModuleOptions): ModuleWithProviders<OpraClientModule> {\n const CLIENT_TOKEN = options.token || OpraHttpClient;\n const client = new OpraHttpClient(options.serviceUrl, options);\n return {\n ngModule: OpraClientModule,\n providers: [\n {\n provide: OPRA_CLIENT_MODULE_OPTIONS,\n useValue: options,\n },\n {\n provide: CLIENT_TOKEN,\n useValue: client\n },\n {\n provide: APP_INITIALIZER,\n useFactory: () => {\n return () => client.init()\n },\n multi: true\n },\n ]\n };\n }\n\n public static forRootAsync(\n options: OpraClientModuleAsyncOptions\n ): ModuleWithProviders<OpraClientModule> {\n const CLIENT_TOKEN = options.token || OpraHttpClient;\n const asyncProviders = this.createAsyncProviders(options);\n\n return {\n ngModule: OpraClientModule,\n providers: [\n ...asyncProviders,\n {\n provide: CLIENT_TOKEN,\n deps: [HttpClient, OPRA_CLIENT_MODULE_OPTIONS],\n useFactory: (httpClient: HttpClient, opts: OpraClientModuleOptions) =>\n new OpraHttpClient(opts.serviceUrl, opts)\n },\n {\n provide: APP_INITIALIZER,\n deps: [CLIENT_TOKEN],\n useFactory: (client: OpraHttpClient) => {\n return () => client.init()\n },\n multi: true\n }\n ]\n };\n }\n\n private static createAsyncProviders(options: OpraClientModuleAsyncOptions): Provider[] {\n if (options.useExisting || options.useFactory)\n return [this.createAsyncOptionsProvider(options)];\n\n if (options.useClass)\n return [\n this.createAsyncOptionsProvider(options),\n {\n provide: options.useClass,\n useClass: options.useClass\n }\n ];\n\n throw new Error('Invalid configuration. Must provide useFactory, useClass or useExisting');\n }\n\n private static createAsyncOptionsProvider(options: OpraClientModuleAsyncOptions): Provider {\n if (options.useFactory) {\n return {\n provide: OPRA_CLIENT_MODULE_OPTIONS,\n useFactory: options.useFactory,\n deps: options.deps || [],\n };\n }\n const useClass = options.useClass || options.useExisting;\n if (useClass) {\n return {\n provide: OPRA_CLIENT_MODULE_OPTIONS,\n useFactory: (o) => o,\n deps: [useClass],\n };\n }\n throw new Error('Invalid configuration. Must provide useFactory, useClass or useExisting');\n }\n\n\n}\n","/* eslint-disable import/extensions */\nexport * from './client.module';\nexport * from './interfaces/module-options.interface';\nexport * from './constants';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;AAAO,MAAM,0BAA0B,GAAG;;ACA1C;MASa,gBAAgB,CAAA;IAEpB,OAAO,OAAO,CAAC,OAAgC,EAAA;AACpD,QAAA,MAAM,YAAY,GAAG,OAAO,CAAC,KAAK,IAAI,cAAc,CAAC;QACrD,MAAM,MAAM,GAAG,IAAI,cAAc,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QAC/D,OAAO;AACL,YAAA,QAAQ,EAAE,gBAAgB;AAC1B,YAAA,SAAS,EAAE;AACT,gBAAA;AACE,oBAAA,OAAO,EAAE,0BAA0B;AACnC,oBAAA,QAAQ,EAAE,OAAO;AAClB,iBAAA;AACD,gBAAA;AACE,oBAAA,OAAO,EAAE,YAAY;AACrB,oBAAA,QAAQ,EAAE,MAAM;AACjB,iBAAA;AACD,gBAAA;AACE,oBAAA,OAAO,EAAE,eAAe;oBACxB,UAAU,EAAE,MAAK;AACf,wBAAA,OAAO,MAAM,MAAM,CAAC,IAAI,EAAE,CAAA;qBAC3B;AACD,oBAAA,KAAK,EAAE,IAAI;AACZ,iBAAA;AACF,aAAA;SACF,CAAC;KACH;IAEM,OAAO,YAAY,CACtB,OAAqC,EAAA;AAEvC,QAAA,MAAM,YAAY,GAAG,OAAO,CAAC,KAAK,IAAI,cAAc,CAAC;QACrD,MAAM,cAAc,GAAG,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAE1D,OAAO;AACL,YAAA,QAAQ,EAAE,gBAAgB;AAC1B,YAAA,SAAS,EAAE;AACT,gB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AAI,OAAO,CAAC,WAAW,CAAC;AACzD,QAAA,IAAI,QAAQ,EAAE;YACZ,OAAO;AACL,gBAAA,OAAO,EAAE,0BAA0B;AACnC,gBAAA,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC;gBACpB,IAAI,EAAE,CAAC,QAAQ,CAAC;aACjB,CAAC;AACH,SAAA;AACD,QAAA,MAAM,IAAI,KAAK,CAAC,yEAAyE,CAAC,CAAC;KAC5F;;8GAxFU,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;+GAAhB,gBAAgB,EAAA,CAAA,CAAA;+GAAhB,gBAAgB,EAAA,CAAA,CAAA;4FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAF5B,QAAQ;mBAAC,EACT,CAAA;;;ACRD;;ACAA;;AAEG;;;;"}
|
package/index.d.ts
ADDED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opra/angular",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Opra internationalization package",
|
|
5
5
|
"author": "Panates",
|
|
6
6
|
"license": "MIT",
|
|
@@ -9,72 +9,43 @@
|
|
|
9
9
|
"url": "https://github.com/panates/opra.git",
|
|
10
10
|
"directory": "packages/angular"
|
|
11
11
|
},
|
|
12
|
-
"
|
|
13
|
-
"compile": "tsc",
|
|
14
|
-
"prebuild": "npm run check && npm run lint && npm run clean",
|
|
15
|
-
"build": "npm run build:cjs && npm run build:esm && npm run bundle",
|
|
16
|
-
"build:cjs": "tsc -b tsconfig-build-cjs.json",
|
|
17
|
-
"build:esm": "tsc -b tsconfig-build-esm.json",
|
|
18
|
-
"postbuild": "cp README.md package.json ../../LICENSE ../../build/angular && cp ../../package.cjs.json ../../build/angular/cjs/package.json",
|
|
19
|
-
"lint": "eslint . --max-warnings=0",
|
|
20
|
-
"check": "madge --circular src/**",
|
|
21
|
-
"test": "jest --runInBand --detectOpenHandles",
|
|
22
|
-
"cover": "jest --collect-coverage",
|
|
23
|
-
"clean": "npm run clean:src && npm run clean:dist && npm run clean:cover",
|
|
24
|
-
"clean:src": "ts-cleanup -s src --all",
|
|
25
|
-
"clean:dist": "rimraf ../../build/angular",
|
|
26
|
-
"clean:cover": "rimraf ../../coverage/angular",
|
|
27
|
-
"bundle": "webpack"
|
|
28
|
-
},
|
|
29
|
-
"dependencies": {
|
|
12
|
+
"peerDependencies": {
|
|
30
13
|
"@angular/common": "^14.2.12",
|
|
31
14
|
"@angular/core": "^14.2.12",
|
|
32
|
-
"@opra/client": "^0.
|
|
33
|
-
},
|
|
34
|
-
"devDependencies": {
|
|
35
|
-
"@angular-devkit/build-angular": "^14.2.10",
|
|
36
|
-
"@angular/compiler": "^14.2.12",
|
|
37
|
-
"@angular/platform-browser": "^14.2.12",
|
|
38
|
-
"@angular/platform-browser-dynamic": "^14.2.12",
|
|
39
|
-
"cross-fetch": "^3.1.5",
|
|
40
|
-
"core-js": "^3.26.1",
|
|
41
|
-
"express": "^4.18.2",
|
|
42
|
-
"zone.js": "^0.12.0"
|
|
43
|
-
},
|
|
44
|
-
"type": "module",
|
|
45
|
-
"types": "esm/index.d.ts",
|
|
46
|
-
"exports": {
|
|
47
|
-
".": {
|
|
48
|
-
"default": {
|
|
49
|
-
"default": "./esm/index.js",
|
|
50
|
-
"require": "./cjs/index.js"
|
|
51
|
-
},
|
|
52
|
-
"browser": {
|
|
53
|
-
"default": "./browser/opra-angular.min.mjs",
|
|
54
|
-
"require": "./browser/opra-angular.min.cjs"
|
|
55
|
-
}
|
|
56
|
-
}
|
|
15
|
+
"@opra/client": "^0.7.0"
|
|
57
16
|
},
|
|
58
|
-
"main": "./umd/opra-angular.umd.min.js",
|
|
59
|
-
"unpkg": "./umd/opra-angular.umd.min.js",
|
|
60
17
|
"engines": {
|
|
61
18
|
"node": ">=16.0",
|
|
62
19
|
"npm": ">=7.0.0"
|
|
63
20
|
},
|
|
64
|
-
"files": [
|
|
65
|
-
"bin/",
|
|
66
|
-
"cjs/",
|
|
67
|
-
"esm/",
|
|
68
|
-
"umd/",
|
|
69
|
-
"LICENSE",
|
|
70
|
-
"README.md"
|
|
71
|
-
],
|
|
72
21
|
"keywords": [
|
|
73
22
|
"opra",
|
|
74
23
|
"client",
|
|
75
24
|
"angular",
|
|
76
25
|
"request",
|
|
77
|
-
"axios",
|
|
78
26
|
"fetch"
|
|
79
|
-
]
|
|
27
|
+
],
|
|
28
|
+
"module": "fesm2015/opra-angular.mjs",
|
|
29
|
+
"es2020": "fesm2020/opra-angular.mjs",
|
|
30
|
+
"esm2020": "esm2020/opra-angular.mjs",
|
|
31
|
+
"fesm2020": "fesm2020/opra-angular.mjs",
|
|
32
|
+
"fesm2015": "fesm2015/opra-angular.mjs",
|
|
33
|
+
"typings": "index.d.ts",
|
|
34
|
+
"exports": {
|
|
35
|
+
"./package.json": {
|
|
36
|
+
"default": "./package.json"
|
|
37
|
+
},
|
|
38
|
+
".": {
|
|
39
|
+
"types": "./index.d.ts",
|
|
40
|
+
"esm2020": "./esm2020/opra-angular.mjs",
|
|
41
|
+
"es2020": "./fesm2020/opra-angular.mjs",
|
|
42
|
+
"es2015": "./fesm2015/opra-angular.mjs",
|
|
43
|
+
"node": "./fesm2015/opra-angular.mjs",
|
|
44
|
+
"default": "./fesm2020/opra-angular.mjs"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"sideEffects": false,
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"tslib": "^2.3.0"
|
|
50
|
+
}
|
|
80
51
|
}
|
package/public_api.d.ts
ADDED
package/cjs/constants.js
DELETED
package/cjs/index.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("./client.module.js"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./interfaces/module-options.interface.js"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./constants.js"), exports);
|
package/cjs/package.json
DELETED
package/esm/constants.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const OPRA_CLIENT_MODULE_OPTIONS = 'OPRA_CLIENT_MODULE_OPTIONS';
|
package/esm/index.d.ts
DELETED
package/esm/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see opra-angular.umd.min.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@angular/core"),require("@opra/client"),require("@angular/common")):"function"==typeof define&&define.amd?define("OpraClient",["@angular/core","@opra/client","@angular/common"],t):"object"==typeof exports?exports.OpraClient=t(require("@angular/core"),require("@opra/client"),require("@angular/common")):e.OpraClient=t(e["@angular/core"],e["@opra/client"],e["@angular/common"])}(self,((e,t,r)=>(()=>{"use strict";var n,o,s={848:e=>{e.exports=r},900:t=>{t.exports=e},205:e=>{e.exports=t}},i={};function a(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={exports:{}};return s[e](r,r.exports,a),r.exports}o=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,a.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var r=Object.create(null);a.r(r);var s={};n=n||[null,o({}),o([]),o(o)];for(var i=2&t&&e;"object"==typeof i&&!~n.indexOf(i);i=o(i))Object.getOwnPropertyNames(i).forEach((t=>s[t]=()=>e[t]));return s.default=()=>e,a.d(r,s),r},a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var c={};return(()=>{a.r(c),a.d(c,{OPRA_CLIENT_MODULE_OPTIONS:()=>et,OpraClientModule:()=>rt});var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};function t(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}function r(e,t,r,n){return new(r||(r=Promise))((function(o,s){function i(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}c((n=n.apply(e,t||[])).next())}))}function n(e,t){var r,n,o,s,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}Object.create;function o(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function s(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,s=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)i.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(o)throw o.error}}return i}function i(e,t,r){if(r||2===arguments.length)for(var n,o=0,s=t.length;o<s;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}function u(e){return this instanceof u?(this.v=e,this):new u(e)}function l(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,o=r.apply(e,t||[]),s=[];return n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n;function i(e){o[e]&&(n[e]=function(t){return new Promise((function(r,n){s.push([e,t,r,n])>1||a(e,t)}))})}function a(e,t){try{(r=o[e](t)).value instanceof u?Promise.resolve(r.value.v).then(c,l):p(s[0][2],r)}catch(e){p(s[0][3],e)}var r}function c(e){a("next",e)}function l(e){a("throw",e)}function p(e,t){e(t),s.shift(),s.length&&a(s[0][0],s[0][1])}}function p(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=o(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,o){(function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)})(n,o,(t=e[r](t)).done,t.value)}))}}}Object.create;var d=a(848),h=a(900),f=a.t(h,2);function y(e){return"function"==typeof e}function m(e){return e[e.length-1]}function v(e){return(t=m(e))&&y(t.schedule)?e.pop():void 0;var t}var b=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e};function g(e){return y(null==e?void 0:e.then)}var w,x=((w=function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}}((function(e){Error.call(e),e.stack=(new Error).stack}))).prototype=Object.create(Error.prototype),w.prototype.constructor=w,w);function T(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var I=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}var t;return e.prototype.unsubscribe=function(){var e,t,r,n,a;if(!this.closed){this.closed=!0;var c=this._parentage;if(c)if(this._parentage=null,Array.isArray(c))try{for(var u=o(c),l=u.next();!l.done;l=u.next()){l.value.remove(this)}}catch(t){e={error:t}}finally{try{l&&!l.done&&(t=u.return)&&t.call(u)}finally{if(e)throw e.error}}else c.remove(this);var p=this.initialTeardown;if(y(p))try{p()}catch(e){a=e instanceof x?e.errors:[e]}var d=this._finalizers;if(d){this._finalizers=null;try{for(var h=o(d),f=h.next();!f.done;f=h.next()){var m=f.value;try{O(m)}catch(e){a=null!=a?a:[],e instanceof x?a=i(i([],s(a)),s(e.errors)):a.push(e)}}}catch(e){r={error:e}}finally{try{f&&!f.done&&(n=h.return)&&n.call(h)}finally{if(r)throw r.error}}}if(a)throw new x(a)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)O(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(r=this._finalizers)&&void 0!==r?r:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&T(t,e)},e.prototype.remove=function(t){var r=this._finalizers;r&&T(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}();I.EMPTY;function E(e){return e instanceof I||e&&"closed"in e&&y(e.remove)&&y(e.add)&&y(e.unsubscribe)}function O(e){y(e)?e():e.unsubscribe()}var P={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},j={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var o=j.delegate;return(null==o?void 0:o.setTimeout)?o.setTimeout.apply(o,i([e,t],s(r))):setTimeout.apply(void 0,i([e,t],s(r)))},clearTimeout:function(e){var t=j.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function S(e){j.setTimeout((function(){var t=P.onUnhandledError;if(!t)throw e;t(e)}))}function C(){}var N=k("C",void 0,void 0);function k(e,t,r){return{kind:e,value:t,error:r}}var _=null;var F=function(e){function r(t){var r=e.call(this)||this;return r.isStopped=!1,t?(r.destination=t,E(t)&&t.add(r)):r.destination=U,r}return t(r,e),r.create=function(e,t,r){return new R(e,t,r)},r.prototype.next=function(e){this.isStopped?L(function(e){return k("N",e,void 0)}(e),this):this._next(e)},r.prototype.error=function(e){this.isStopped?L(k("E",void 0,e),this):(this.isStopped=!0,this._error(e))},r.prototype.complete=function(){this.isStopped?L(N,this):(this.isStopped=!0,this._complete())},r.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},r.prototype._next=function(e){this.destination.next(e)},r.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},r.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},r}(I),D=Function.prototype.bind;function A(e,t){return D.call(e,t)}var M=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){V(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){V(e)}else V(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){V(e)}},e}(),R=function(e){function r(t,r,n){var o,s,i=e.call(this)||this;y(t)||!t?o={next:null!=t?t:void 0,error:null!=r?r:void 0,complete:null!=n?n:void 0}:i&&P.useDeprecatedNextContext?((s=Object.create(t)).unsubscribe=function(){return i.unsubscribe()},o={next:t.next&&A(t.next,s),error:t.error&&A(t.error,s),complete:t.complete&&A(t.complete,s)}):o=t;return i.destination=new M(o),i}return t(r,e),r}(F);function V(e){var t;P.useDeprecatedSynchronousErrorHandling?(t=e,P.useDeprecatedSynchronousErrorHandling&&_&&(_.errorThrown=!0,_.error=t)):S(e)}function L(e,t){var r=P.onStoppedNotification;r&&j.setTimeout((function(){return r(e,t)}))}var U={closed:!0,next:C,error:function(e){throw e},complete:C},z="function"==typeof Symbol&&Symbol.observable||"@@observable";function H(e){return e}function q(e){return 0===e.length?H:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}var J=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(e,t,r){var n,o=this,s=(n=e)&&n instanceof F||function(e){return e&&y(e.next)&&y(e.error)&&y(e.complete)}(n)&&E(n)?e:new R(e,t,r);return function(e){if(P.useDeprecatedSynchronousErrorHandling){var t=!_;if(t&&(_={errorThrown:!1,error:null}),e(),t){var r=_,n=r.errorThrown,o=r.error;if(_=null,n)throw o}}else e()}((function(){var e=o,t=e.operator,r=e.source;s.add(t?t.call(s,r):r?o._subscribe(s):o._trySubscribe(s))})),s},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var r=this;return new(t=K(t))((function(t,n){var o=new R({next:function(t){try{e(t)}catch(e){n(e),o.unsubscribe()}},error:n,complete:t});r.subscribe(o)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[z]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return q(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=K(e))((function(e,r){var n;t.subscribe((function(e){return n=e}),(function(e){return r(e)}),(function(){return e(n)}))}))},e.create=function(t){return new e(t)},e}();function K(e){var t;return null!==(t=null!=e?e:P.Promise)&&void 0!==t?t:Promise}function X(e){return y(e[z])}function B(e){return Symbol.asyncIterator&&y(null==e?void 0:e[Symbol.asyncIterator])}function $(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}var W="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function G(e){return y(null==e?void 0:e[W])}function Y(e){return l(this,arguments,(function(){var t,r,o;return n(this,(function(n){switch(n.label){case 0:t=e.getReader(),n.label=1;case 1:n.trys.push([1,,9,10]),n.label=2;case 2:return[4,u(t.read())];case 3:return r=n.sent(),o=r.value,r.done?[4,u(void 0)]:[3,5];case 4:return[2,n.sent()];case 5:return[4,u(o)];case 6:return[4,n.sent()];case 7:return n.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))}function Z(e){return y(null==e?void 0:e.getReader)}function Q(e){if(e instanceof J)return e;if(null!=e){if(X(e))return s=e,new J((function(e){var t=s[z]();if(y(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if(b(e))return n=e,new J((function(e){for(var t=0;t<n.length&&!e.closed;t++)e.next(n[t]);e.complete()}));if(g(e))return r=e,new J((function(e){r.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,S)}));if(B(e))return ee(e);if(G(e))return t=e,new J((function(e){var r,n;try{for(var s=o(t),i=s.next();!i.done;i=s.next()){var a=i.value;if(e.next(a),e.closed)return}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}e.complete()}));if(Z(e))return ee(Y(e))}var t,r,n,s;throw $(e)}function ee(e){return new J((function(t){(function(e,t){var o,s,i,a;return r(this,void 0,void 0,(function(){var r,c;return n(this,(function(n){switch(n.label){case 0:n.trys.push([0,5,6,11]),o=p(e),n.label=1;case 1:return[4,o.next()];case 2:if((s=n.sent()).done)return[3,4];if(r=s.value,t.next(r),t.closed)return[2];n.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return c=n.sent(),i={error:c},[3,11];case 6:return n.trys.push([6,,9,10]),s&&!s.done&&(a=o.return)?[4,a.call(o)]:[3,8];case 7:n.sent(),n.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}}))}))})(e,t).catch((function(e){return t.error(e)}))}))}function te(e,t,r,n,o){void 0===n&&(n=0),void 0===o&&(o=!1);var s=t.schedule((function(){r(),o?e.add(this.schedule(null,n)):this.unsubscribe()}),n);if(e.add(s),!o)return s}function re(e){return function(t){if(function(e){return y(null==e?void 0:e.lift)}(t))return t.lift((function(t){try{return e(t,this)}catch(e){this.error(e)}}));throw new TypeError("Unable to lift unknown Observable type")}}function ne(e,t,r,n,o){return new oe(e,t,r,n,o)}var oe=function(e){function r(t,r,n,o,s,i){var a=e.call(this,t)||this;return a.onFinalize=s,a.shouldUnsubscribe=i,a._next=r?function(e){try{r(e)}catch(e){t.error(e)}}:e.prototype._next,a._error=o?function(e){try{o(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,a._complete=n?function(){try{n()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,a}return t(r,e),r.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;e.prototype.unsubscribe.call(this),!r&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}},r}(F);function se(e,t){return void 0===t&&(t=0),re((function(r,n){r.subscribe(ne(n,(function(r){return te(n,e,(function(){return n.next(r)}),t)}),(function(){return te(n,e,(function(){return n.complete()}),t)}),(function(r){return te(n,e,(function(){return n.error(r)}),t)})))}))}function ie(e,t){return void 0===t&&(t=0),re((function(r,n){n.add(e.schedule((function(){return r.subscribe(n)}),t))}))}function ae(e,t){if(!e)throw new Error("Iterable cannot be null");return new J((function(r){te(r,t,(function(){var n=e[Symbol.asyncIterator]();te(r,t,(function(){n.next().then((function(e){e.done?r.complete():r.next(e.value)}))}),0,!0)}))}))}function ce(e,t){if(null!=e){if(X(e))return function(e,t){return Q(e).pipe(ie(t),se(t))}(e,t);if(b(e))return function(e,t){return new J((function(r){var n=0;return t.schedule((function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())}))}))}(e,t);if(g(e))return function(e,t){return Q(e).pipe(ie(t),se(t))}(e,t);if(B(e))return ae(e,t);if(G(e))return function(e,t){return new J((function(r){var n;return te(r,t,(function(){n=e[W](),te(r,t,(function(){var e,t,o;try{t=(e=n.next()).value,o=e.done}catch(e){return void r.error(e)}o?r.complete():r.next(t)}),0,!0)})),function(){return y(null==n?void 0:n.return)&&n.return()}}))}(e,t);if(Z(e))return function(e,t){return ae(Y(e),t)}(e,t)}throw $(e)}function ue(e,t){return t?ce(e,t):Q(e)}function le(e,t){return re((function(r,n){var o=0;r.subscribe(ne(n,(function(r){n.next(e.call(t,r,o++))})))}))}function pe(e,t,r){return void 0===r&&(r=1/0),y(t)?pe((function(r,n){return le((function(e,o){return t(r,e,n,o)}))(Q(e(r,n)))}),r):("number"==typeof t&&(r=t),re((function(t,n){return function(e,t,r,n,o,s,i,a){var c=[],u=0,l=0,p=!1,d=function(){!p||c.length||u||t.complete()},h=function(e){return u<n?f(e):c.push(e)},f=function(e){s&&t.next(e),u++;var a=!1;Q(r(e,l++)).subscribe(ne(t,(function(e){null==o||o(e),s?h(e):t.next(e)}),(function(){a=!0}),void 0,(function(){if(a)try{u--;for(var e=function(){var e=c.shift();i?te(t,i,(function(){return f(e)})):f(e)};c.length&&u<n;)e();d()}catch(e){t.error(e)}})))};return e.subscribe(ne(t,h,(function(){p=!0,d()}))),function(){null==a||a()}}(t,n,e,r)})))}class de{}class he{}class fe{constructor(e){this.normalizedNames=new Map,this.lazyUpdate=null,e?this.lazyInit="string"==typeof e?()=>{this.headers=new Map,e.split("\n").forEach((e=>{const t=e.indexOf(":");if(t>0){const r=e.slice(0,t),n=r.toLowerCase(),o=e.slice(t+1).trim();this.maybeSetNormalizedName(r,n),this.headers.has(n)?this.headers.get(n).push(o):this.headers.set(n,[o])}}))}:()=>{("undefined"==typeof ngDevMode||ngDevMode)&&function(e){for(const[t,r]of Object.entries(e))if("string"!=typeof r&&!Array.isArray(r))throw new Error(`Unexpected value of the \`${t}\` header provided. Expecting either a string or an array, but got: \`${r}\`.`)}(e),this.headers=new Map,Object.keys(e).forEach((t=>{let r=e[t];const n=t.toLowerCase();"string"==typeof r&&(r=[r]),r.length>0&&(this.headers.set(n,r),this.maybeSetNormalizedName(t,n))}))}:this.headers=new Map}has(e){return this.init(),this.headers.has(e.toLowerCase())}get(e){this.init();const t=this.headers.get(e.toLowerCase());return t&&t.length>0?t[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(e){return this.init(),this.headers.get(e.toLowerCase())||null}append(e,t){return this.clone({name:e,value:t,op:"a"})}set(e,t){return this.clone({name:e,value:t,op:"s"})}delete(e,t){return this.clone({name:e,value:t,op:"d"})}maybeSetNormalizedName(e,t){this.normalizedNames.has(t)||this.normalizedNames.set(t,e)}init(){this.lazyInit&&(this.lazyInit instanceof fe?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach((e=>this.applyUpdate(e))),this.lazyUpdate=null))}copyFrom(e){e.init(),Array.from(e.headers.keys()).forEach((t=>{this.headers.set(t,e.headers.get(t)),this.normalizedNames.set(t,e.normalizedNames.get(t))}))}clone(e){const t=new fe;return t.lazyInit=this.lazyInit&&this.lazyInit instanceof fe?this.lazyInit:this,t.lazyUpdate=(this.lazyUpdate||[]).concat([e]),t}applyUpdate(e){const t=e.name.toLowerCase();switch(e.op){case"a":case"s":let r=e.value;if("string"==typeof r&&(r=[r]),0===r.length)return;this.maybeSetNormalizedName(e.name,t);const n=("a"===e.op?this.headers.get(t):void 0)||[];n.push(...r),this.headers.set(t,n);break;case"d":const o=e.value;if(o){let e=this.headers.get(t);if(!e)return;e=e.filter((e=>-1===o.indexOf(e))),0===e.length?(this.headers.delete(t),this.normalizedNames.delete(t)):this.headers.set(t,e)}else this.headers.delete(t),this.normalizedNames.delete(t)}}forEach(e){this.init(),Array.from(this.normalizedNames.keys()).forEach((t=>e(this.normalizedNames.get(t),this.headers.get(t))))}}class ye{encodeKey(e){return be(e)}encodeValue(e){return be(e)}decodeKey(e){return decodeURIComponent(e)}decodeValue(e){return decodeURIComponent(e)}}const me=/%(\d[a-f0-9])/gi,ve={40:"@","3A":":",24:"$","2C":",","3B":";","3D":"=","3F":"?","2F":"/"};function be(e){return encodeURIComponent(e).replace(me,((e,t)=>ve[t]??e))}function ge(e){return`${e}`}class we{constructor(e={}){if(this.updates=null,this.cloneFrom=null,this.encoder=e.encoder||new ye,e.fromString){if(e.fromObject)throw new Error("Cannot specify both fromString and fromObject.");this.map=function(e,t){const r=new Map;e.length>0&&e.replace(/^\?/,"").split("&").forEach((e=>{const n=e.indexOf("="),[o,s]=-1==n?[t.decodeKey(e),""]:[t.decodeKey(e.slice(0,n)),t.decodeValue(e.slice(n+1))],i=r.get(o)||[];i.push(s),r.set(o,i)}));return r}(e.fromString,this.encoder)}else e.fromObject?(this.map=new Map,Object.keys(e.fromObject).forEach((t=>{const r=e.fromObject[t],n=Array.isArray(r)?r.map(ge):[ge(r)];this.map.set(t,n)}))):this.map=null}has(e){return this.init(),this.map.has(e)}get(e){this.init();const t=this.map.get(e);return t?t[0]:null}getAll(e){return this.init(),this.map.get(e)||null}keys(){return this.init(),Array.from(this.map.keys())}append(e,t){return this.clone({param:e,value:t,op:"a"})}appendAll(e){const t=[];return Object.keys(e).forEach((r=>{const n=e[r];Array.isArray(n)?n.forEach((e=>{t.push({param:r,value:e,op:"a"})})):t.push({param:r,value:n,op:"a"})})),this.clone(t)}set(e,t){return this.clone({param:e,value:t,op:"s"})}delete(e,t){return this.clone({param:e,value:t,op:"d"})}toString(){return this.init(),this.keys().map((e=>{const t=this.encoder.encodeKey(e);return this.map.get(e).map((e=>t+"="+this.encoder.encodeValue(e))).join("&")})).filter((e=>""!==e)).join("&")}clone(e){const t=new we({encoder:this.encoder});return t.cloneFrom=this.cloneFrom||this,t.updates=(this.updates||[]).concat(e),t}init(){null===this.map&&(this.map=new Map),null!==this.cloneFrom&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach((e=>this.map.set(e,this.cloneFrom.map.get(e)))),this.updates.forEach((e=>{switch(e.op){case"a":case"s":const t=("a"===e.op?this.map.get(e.param):void 0)||[];t.push(ge(e.value)),this.map.set(e.param,t);break;case"d":if(void 0===e.value){this.map.delete(e.param);break}{let t=this.map.get(e.param)||[];const r=t.indexOf(ge(e.value));-1!==r&&t.splice(r,1),t.length>0?this.map.set(e.param,t):this.map.delete(e.param)}}})),this.cloneFrom=this.updates=null)}}class xe{constructor(){this.map=new Map}set(e,t){return this.map.set(e,t),this}get(e){return this.map.has(e)||this.map.set(e,e.defaultValue()),this.map.get(e)}delete(e){return this.map.delete(e),this}has(e){return this.map.has(e)}keys(){return this.map.keys()}}function Te(e){return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer}function Ie(e){return"undefined"!=typeof Blob&&e instanceof Blob}function Ee(e){return"undefined"!=typeof FormData&&e instanceof FormData}class Oe{constructor(e,t,r,n){let o;if(this.url=t,this.body=null,this.reportProgress=!1,this.withCredentials=!1,this.responseType="json",this.method=e.toUpperCase(),function(e){switch(e){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}(this.method)||n?(this.body=void 0!==r?r:null,o=n):o=r,o&&(this.reportProgress=!!o.reportProgress,this.withCredentials=!!o.withCredentials,o.responseType&&(this.responseType=o.responseType),o.headers&&(this.headers=o.headers),o.context&&(this.context=o.context),o.params&&(this.params=o.params)),this.headers||(this.headers=new fe),this.context||(this.context=new xe),this.params){const e=this.params.toString();if(0===e.length)this.urlWithParams=t;else{const r=t.indexOf("?"),n=-1===r?"?":r<t.length-1?"&":"";this.urlWithParams=t+n+e}}else this.params=new we,this.urlWithParams=t}serializeBody(){return null===this.body?null:Te(this.body)||Ie(this.body)||Ee(this.body)||(e=this.body,"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams)||"string"==typeof this.body?this.body:this.body instanceof we?this.body.toString():"object"==typeof this.body||"boolean"==typeof this.body||Array.isArray(this.body)?JSON.stringify(this.body):this.body.toString();var e}detectContentTypeHeader(){return null===this.body||Ee(this.body)?null:Ie(this.body)?this.body.type||null:Te(this.body)?null:"string"==typeof this.body?"text/plain":this.body instanceof we?"application/x-www-form-urlencoded;charset=UTF-8":"object"==typeof this.body||"number"==typeof this.body||"boolean"==typeof this.body?"application/json":null}clone(e={}){const t=e.method||this.method,r=e.url||this.url,n=e.responseType||this.responseType,o=void 0!==e.body?e.body:this.body,s=void 0!==e.withCredentials?e.withCredentials:this.withCredentials,i=void 0!==e.reportProgress?e.reportProgress:this.reportProgress;let a=e.headers||this.headers,c=e.params||this.params;const u=e.context??this.context;return void 0!==e.setHeaders&&(a=Object.keys(e.setHeaders).reduce(((t,r)=>t.set(r,e.setHeaders[r])),a)),e.setParams&&(c=Object.keys(e.setParams).reduce(((t,r)=>t.set(r,e.setParams[r])),c)),new Oe(t,r,o,{params:c,headers:a,context:u,reportProgress:i,responseType:n,withCredentials:s})}}var Pe;!function(e){e[e.Sent=0]="Sent",e[e.UploadProgress=1]="UploadProgress",e[e.ResponseHeader=2]="ResponseHeader",e[e.DownloadProgress=3]="DownloadProgress",e[e.Response=4]="Response",e[e.User=5]="User"}(Pe||(Pe={}));class je{constructor(e,t=200,r="OK"){this.headers=e.headers||new fe,this.status=void 0!==e.status?e.status:t,this.statusText=e.statusText||r,this.url=e.url||null,this.ok=this.status>=200&&this.status<300}}class Se extends je{constructor(e={}){super(e),this.type=Pe.ResponseHeader}clone(e={}){return new Se({headers:e.headers||this.headers,status:void 0!==e.status?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0})}}class Ce extends je{constructor(e={}){super(e),this.type=Pe.Response,this.body=void 0!==e.body?e.body:null}clone(e={}){return new Ce({body:void 0!==e.body?e.body:this.body,headers:e.headers||this.headers,status:void 0!==e.status?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0})}}class Ne extends je{constructor(e){super(e,0,"Unknown Error"),this.name="HttpErrorResponse",this.ok=!1,this.status>=200&&this.status<300?this.message=`Http failure during parsing for ${e.url||"(unknown url)"}`:this.message=`Http failure response for ${e.url||"(unknown url)"}: ${e.status} ${e.statusText}`,this.error=e.error||null}}function ke(e,t){return{body:t,headers:e.headers,context:e.context,observe:e.observe,params:e.params,reportProgress:e.reportProgress,responseType:e.responseType,withCredentials:e.withCredentials}}class _e{constructor(e){this.handler=e}request(e,t,r={}){let n;if(e instanceof Oe)n=e;else{let o,s;o=r.headers instanceof fe?r.headers:new fe(r.headers),r.params&&(s=r.params instanceof we?r.params:new we({fromObject:r.params})),n=new Oe(e,t,void 0!==r.body?r.body:null,{headers:o,context:r.context,params:s,reportProgress:r.reportProgress,responseType:r.responseType||"json",withCredentials:r.withCredentials})}const o=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=v(e);return ue(e,r)}(n).pipe((s=e=>this.handler.handle(e),y(i)?pe(s,i,1):pe(s,1)));var s,i;if(e instanceof Oe||"events"===r.observe)return o;const a=o.pipe((c=e=>e instanceof Ce,re((function(e,t){var r=0;e.subscribe(ne(t,(function(e){return c.call(u,e,r++)&&t.next(e)})))}))));var c,u;switch(r.observe||"body"){case"body":switch(n.responseType){case"arraybuffer":return a.pipe(le((e=>{if(null!==e.body&&!(e.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return e.body})));case"blob":return a.pipe(le((e=>{if(null!==e.body&&!(e.body instanceof Blob))throw new Error("Response is not a Blob.");return e.body})));case"text":return a.pipe(le((e=>{if(null!==e.body&&"string"!=typeof e.body)throw new Error("Response is not a string.");return e.body})));default:return a.pipe(le((e=>e.body)))}case"response":return a;default:throw new Error(`Unreachable: unhandled observe type ${r.observe}}`)}}delete(e,t={}){return this.request("DELETE",e,t)}get(e,t={}){return this.request("GET",e,t)}head(e,t={}){return this.request("HEAD",e,t)}jsonp(e,t){return this.request("JSONP",e,{params:(new we).append(t,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(e,t={}){return this.request("OPTIONS",e,t)}patch(e,t,r={}){return this.request("PATCH",e,ke(r,t))}post(e,t,r={}){return this.request("POST",e,ke(r,t))}put(e,t,r={}){return this.request("PUT",e,ke(r,t))}}_e.ɵfac=h["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"14.2.12",ngImport:f,type:_e,deps:[{token:de}],target:h["ɵɵFactoryTarget"].Injectable}),_e.ɵprov=h["ɵɵngDeclareInjectable"]({minVersion:"12.0.0",version:"14.2.12",ngImport:f,type:_e}),h["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"14.2.12",ngImport:f,type:_e,decorators:[{type:h.Injectable}],ctorParameters:function(){return[{type:de}]}});class Fe{constructor(e,t){this.next=e,this.interceptor=t}handle(e){return this.interceptor.intercept(e,this.next)}}const De=new h.InjectionToken("HTTP_INTERCEPTORS");class Ae{intercept(e,t){return t.handle(e)}}Ae.ɵfac=h["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"14.2.12",ngImport:f,type:Ae,deps:[],target:h["ɵɵFactoryTarget"].Injectable}),Ae.ɵprov=h["ɵɵngDeclareInjectable"]({minVersion:"12.0.0",version:"14.2.12",ngImport:f,type:Ae}),h["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"14.2.12",ngImport:f,type:Ae,decorators:[{type:h.Injectable}]});let Me,Re=0;class Ve{}class Le{constructor(e,t){this.callbackMap=e,this.document=t,this.resolvedPromise=Promise.resolve()}nextCallback(){return"ng_jsonp_callback_"+Re++}handle(e){if("JSONP"!==e.method)throw new Error("JSONP requests must use JSONP request method.");if("json"!==e.responseType)throw new Error("JSONP requests must use Json response type.");if(e.headers.keys().length>0)throw new Error("JSONP requests do not support headers.");return new J((t=>{const r=this.nextCallback(),n=e.urlWithParams.replace(/=JSONP_CALLBACK(&|$)/,`=${r}$1`),o=this.document.createElement("script");o.src=n;let s=null,i=!1;this.callbackMap[r]=e=>{delete this.callbackMap[r],s=e,i=!0};const a=()=>{o.parentNode&&o.parentNode.removeChild(o),delete this.callbackMap[r]};return o.addEventListener("load",(e=>{this.resolvedPromise.then((()=>{a(),i?(t.next(new Ce({body:s,status:200,statusText:"OK",url:n})),t.complete()):t.error(new Ne({url:n,status:0,statusText:"JSONP Error",error:new Error("JSONP injected script did not invoke callback.")}))}))})),o.addEventListener("error",(e=>{a(),t.error(new Ne({error:e,status:0,statusText:"JSONP Error",url:n}))})),this.document.body.appendChild(o),t.next({type:Pe.Sent}),()=>{i||this.removeListeners(o),a()}}))}removeListeners(e){Me||(Me=this.document.implementation.createHTMLDocument()),Me.adoptNode(e)}}Le.ɵfac=h["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"14.2.12",ngImport:f,type:Le,deps:[{token:Ve},{token:d.DOCUMENT}],target:h["ɵɵFactoryTarget"].Injectable}),Le.ɵprov=h["ɵɵngDeclareInjectable"]({minVersion:"12.0.0",version:"14.2.12",ngImport:f,type:Le}),h["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"14.2.12",ngImport:f,type:Le,decorators:[{type:h.Injectable}],ctorParameters:function(){return[{type:Ve},{type:void 0,decorators:[{type:h.Inject,args:[d.DOCUMENT]}]}]}});class Ue{constructor(e){this.jsonp=e}intercept(e,t){return"JSONP"===e.method?this.jsonp.handle(e):t.handle(e)}}Ue.ɵfac=h["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"14.2.12",ngImport:f,type:Ue,deps:[{token:Le}],target:h["ɵɵFactoryTarget"].Injectable}),Ue.ɵprov=h["ɵɵngDeclareInjectable"]({minVersion:"12.0.0",version:"14.2.12",ngImport:f,type:Ue}),h["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"14.2.12",ngImport:f,type:Ue,decorators:[{type:h.Injectable}],ctorParameters:function(){return[{type:Le}]}});const ze=/^\)\]\}',?\n/;class He{constructor(e){this.xhrFactory=e}handle(e){if("JSONP"===e.method)throw new Error("Attempted to construct Jsonp request without HttpClientJsonpModule installed.");return new J((t=>{const r=this.xhrFactory.build();if(r.open(e.method,e.urlWithParams),e.withCredentials&&(r.withCredentials=!0),e.headers.forEach(((e,t)=>r.setRequestHeader(e,t.join(",")))),e.headers.has("Accept")||r.setRequestHeader("Accept","application/json, text/plain, */*"),!e.headers.has("Content-Type")){const t=e.detectContentTypeHeader();null!==t&&r.setRequestHeader("Content-Type",t)}if(e.responseType){const t=e.responseType.toLowerCase();r.responseType="json"!==t?t:"text"}const n=e.serializeBody();let o=null;const s=()=>{if(null!==o)return o;const t=r.statusText||"OK",n=new fe(r.getAllResponseHeaders()),s=function(e){return"responseURL"in e&&e.responseURL?e.responseURL:/^X-Request-URL:/m.test(e.getAllResponseHeaders())?e.getResponseHeader("X-Request-URL"):null}(r)||e.url;return o=new Se({headers:n,status:r.status,statusText:t,url:s}),o},i=()=>{let{headers:n,status:o,statusText:i,url:a}=s(),c=null;204!==o&&(c=void 0===r.response?r.responseText:r.response),0===o&&(o=c?200:0);let u=o>=200&&o<300;if("json"===e.responseType&&"string"==typeof c){const e=c;c=c.replace(ze,"");try{c=""!==c?JSON.parse(c):null}catch(t){c=e,u&&(u=!1,c={error:t,text:c})}}u?(t.next(new Ce({body:c,headers:n,status:o,statusText:i,url:a||void 0})),t.complete()):t.error(new Ne({error:c,headers:n,status:o,statusText:i,url:a||void 0}))},a=e=>{const{url:n}=s(),o=new Ne({error:e,status:r.status||0,statusText:r.statusText||"Unknown Error",url:n||void 0});t.error(o)};let c=!1;const u=n=>{c||(t.next(s()),c=!0);let o={type:Pe.DownloadProgress,loaded:n.loaded};n.lengthComputable&&(o.total=n.total),"text"===e.responseType&&r.responseText&&(o.partialText=r.responseText),t.next(o)},l=e=>{let r={type:Pe.UploadProgress,loaded:e.loaded};e.lengthComputable&&(r.total=e.total),t.next(r)};return r.addEventListener("load",i),r.addEventListener("error",a),r.addEventListener("timeout",a),r.addEventListener("abort",a),e.reportProgress&&(r.addEventListener("progress",u),null!==n&&r.upload&&r.upload.addEventListener("progress",l)),r.send(n),t.next({type:Pe.Sent}),()=>{r.removeEventListener("error",a),r.removeEventListener("abort",a),r.removeEventListener("load",i),r.removeEventListener("timeout",a),e.reportProgress&&(r.removeEventListener("progress",u),null!==n&&r.upload&&r.upload.removeEventListener("progress",l)),r.readyState!==r.DONE&&r.abort()}}))}}He.ɵfac=h["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"14.2.12",ngImport:f,type:He,deps:[{token:d.XhrFactory}],target:h["ɵɵFactoryTarget"].Injectable}),He.ɵprov=h["ɵɵngDeclareInjectable"]({minVersion:"12.0.0",version:"14.2.12",ngImport:f,type:He}),h["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"14.2.12",ngImport:f,type:He,decorators:[{type:h.Injectable}],ctorParameters:function(){return[{type:d.XhrFactory}]}});const qe=new h.InjectionToken("XSRF_COOKIE_NAME"),Je=new h.InjectionToken("XSRF_HEADER_NAME");class Ke{}class Xe{constructor(e,t,r){this.doc=e,this.platform=t,this.cookieName=r,this.lastCookieString="",this.lastToken=null,this.parseCount=0}getToken(){if("server"===this.platform)return null;const e=this.doc.cookie||"";return e!==this.lastCookieString&&(this.parseCount++,this.lastToken=(0,d["ɵparseCookieValue"])(e,this.cookieName),this.lastCookieString=e),this.lastToken}}Xe.ɵfac=h["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"14.2.12",ngImport:f,type:Xe,deps:[{token:d.DOCUMENT},{token:h.PLATFORM_ID},{token:qe}],target:h["ɵɵFactoryTarget"].Injectable}),Xe.ɵprov=h["ɵɵngDeclareInjectable"]({minVersion:"12.0.0",version:"14.2.12",ngImport:f,type:Xe}),h["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"14.2.12",ngImport:f,type:Xe,decorators:[{type:h.Injectable}],ctorParameters:function(){return[{type:void 0,decorators:[{type:h.Inject,args:[d.DOCUMENT]}]},{type:void 0,decorators:[{type:h.Inject,args:[h.PLATFORM_ID]}]},{type:void 0,decorators:[{type:h.Inject,args:[qe]}]}]}});class Be{constructor(e,t){this.tokenService=e,this.headerName=t}intercept(e,t){const r=e.url.toLowerCase();if("GET"===e.method||"HEAD"===e.method||r.startsWith("http://")||r.startsWith("https://"))return t.handle(e);const n=this.tokenService.getToken();return null===n||e.headers.has(this.headerName)||(e=e.clone({headers:e.headers.set(this.headerName,n)})),t.handle(e)}}Be.ɵfac=h["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"14.2.12",ngImport:f,type:Be,deps:[{token:Ke},{token:Je}],target:h["ɵɵFactoryTarget"].Injectable}),Be.ɵprov=h["ɵɵngDeclareInjectable"]({minVersion:"12.0.0",version:"14.2.12",ngImport:f,type:Be}),h["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"14.2.12",ngImport:f,type:Be,decorators:[{type:h.Injectable}],ctorParameters:function(){return[{type:Ke},{type:void 0,decorators:[{type:h.Inject,args:[Je]}]}]}});class $e{constructor(e,t){this.backend=e,this.injector=t,this.chain=null}handle(e){if(null===this.chain){const e=this.injector.get(De,[]);this.chain=e.reduceRight(((e,t)=>new Fe(e,t)),this.backend)}return this.chain.handle(e)}}function We(){return"object"==typeof window?window:{}}$e.ɵfac=h["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"14.2.12",ngImport:f,type:$e,deps:[{token:he},{token:h.Injector}],target:h["ɵɵFactoryTarget"].Injectable}),$e.ɵprov=h["ɵɵngDeclareInjectable"]({minVersion:"12.0.0",version:"14.2.12",ngImport:f,type:$e}),h["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"14.2.12",ngImport:f,type:$e,decorators:[{type:h.Injectable}],ctorParameters:function(){return[{type:he},{type:h.Injector}]}});class Ge{static disable(){return{ngModule:Ge,providers:[{provide:Be,useClass:Ae}]}}static withOptions(e={}){return{ngModule:Ge,providers:[e.cookieName?{provide:qe,useValue:e.cookieName}:[],e.headerName?{provide:Je,useValue:e.headerName}:[]]}}}Ge.ɵfac=h["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"14.2.12",ngImport:f,type:Ge,deps:[],target:h["ɵɵFactoryTarget"].NgModule}),Ge.ɵmod=h["ɵɵngDeclareNgModule"]({minVersion:"14.0.0",version:"14.2.12",ngImport:f,type:Ge}),Ge.ɵinj=h["ɵɵngDeclareInjector"]({minVersion:"12.0.0",version:"14.2.12",ngImport:f,type:Ge,providers:[Be,{provide:De,useExisting:Be,multi:!0},{provide:Ke,useClass:Xe},{provide:qe,useValue:"XSRF-TOKEN"},{provide:Je,useValue:"X-XSRF-TOKEN"}]}),h["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"14.2.12",ngImport:f,type:Ge,decorators:[{type:h.NgModule,args:[{providers:[Be,{provide:De,useExisting:Be,multi:!0},{provide:Ke,useClass:Xe},{provide:qe,useValue:"XSRF-TOKEN"},{provide:Je,useValue:"X-XSRF-TOKEN"}]}]}]});class Ye{}Ye.ɵfac=h["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"14.2.12",ngImport:f,type:Ye,deps:[],target:h["ɵɵFactoryTarget"].NgModule}),Ye.ɵmod=h["ɵɵngDeclareNgModule"]({minVersion:"14.0.0",version:"14.2.12",ngImport:f,type:Ye,imports:[Ge]}),Ye.ɵinj=h["ɵɵngDeclareInjector"]({minVersion:"12.0.0",version:"14.2.12",ngImport:f,type:Ye,providers:[_e,{provide:de,useClass:$e},He,{provide:he,useExisting:He}],imports:[Ge.withOptions({cookieName:"XSRF-TOKEN",headerName:"X-XSRF-TOKEN"})]}),h["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"14.2.12",ngImport:f,type:Ye,decorators:[{type:h.NgModule,args:[{imports:[Ge.withOptions({cookieName:"XSRF-TOKEN",headerName:"X-XSRF-TOKEN"})],providers:[_e,{provide:de,useClass:$e},He,{provide:he,useExisting:He}]}]}]});class Ze{}Ze.ɵfac=h["ɵɵngDeclareFactory"]({minVersion:"12.0.0",version:"14.2.12",ngImport:f,type:Ze,deps:[],target:h["ɵɵFactoryTarget"].NgModule}),Ze.ɵmod=h["ɵɵngDeclareNgModule"]({minVersion:"14.0.0",version:"14.2.12",ngImport:f,type:Ze}),Ze.ɵinj=h["ɵɵngDeclareInjector"]({minVersion:"12.0.0",version:"14.2.12",ngImport:f,type:Ze,providers:[Le,{provide:Ve,useFactory:We},{provide:De,useClass:Ue,multi:!0}]}),h["ɵɵngDeclareClassMetadata"]({minVersion:"12.0.0",version:"14.2.12",ngImport:f,type:Ze,decorators:[{type:h.NgModule,args:[{providers:[Le,{provide:Ve,useFactory:We},{provide:De,useClass:Ue,multi:!0}]}]}]});var Qe=a(205);const et="OPRA_CLIENT_MODULE_OPTIONS";var tt;let rt=tt=class{static forRoot(e){const t=e.token||Qe.OpraHttpClient,r=new Qe.OpraHttpClient(e.serviceUrl,e);return{ngModule:tt,providers:[{provide:et,useValue:e},{provide:t,useValue:r},{provide:h.APP_INITIALIZER,useFactory:()=>()=>r.init(),multi:!0}]}}static forRootAsync(e){const t=e.token||Qe.OpraHttpClient,r=this.createAsyncProviders(e);return{ngModule:tt,providers:[...r,{provide:t,deps:[_e,et],useFactory:(e,t)=>new Qe.OpraHttpClient(t.serviceUrl,t)},{provide:h.APP_INITIALIZER,deps:[t],useFactory:e=>()=>e.init(),multi:!0}]}}static createAsyncProviders(e){if(e.useExisting||e.useFactory)return[this.createAsyncOptionsProvider(e)];if(e.useClass)return[this.createAsyncOptionsProvider(e),{provide:e.useClass,useClass:e.useClass}];throw new Error("Invalid configuration. Must provide useFactory, useClass or useExisting")}static createAsyncOptionsProvider(e){if(e.useFactory)return{provide:et,useFactory:e.useFactory,deps:e.deps||[]};const t=e.useClass||e.useExisting;if(t)return{provide:et,useFactory:e=>e,deps:[t]};throw new Error("Invalid configuration. Must provide useFactory, useClass or useExisting")}};rt=tt=function(e,t,r,n){var o,s=arguments.length,i=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(i=(s<3?o(i):s>3?o(t,r,i):o(t,r))||i);return s>3&&i&&Object.defineProperty(t,r,i),i}([(0,h.NgModule)({imports:[Ye]})],rt)})(),c})()));
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.io/license
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @license Angular v14.2.12
|
|
11
|
-
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
12
|
-
* License: MIT
|
|
13
|
-
*/
|