@memberjunction/ng-credentials 6.2.0-edge.0 → 6.2.0-edge.1
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/dist/lib/dialogs/credential-dialog.component.d.ts +18 -2
- package/dist/lib/dialogs/credential-dialog.component.d.ts.map +1 -1
- package/dist/lib/dialogs/credential-dialog.component.js +47 -15
- package/dist/lib/dialogs/credential-dialog.component.js.map +1 -1
- package/dist/lib/panels/credential-category-edit-panel/credential-category-edit-panel.component.d.ts +76 -8
- package/dist/lib/panels/credential-category-edit-panel/credential-category-edit-panel.component.d.ts.map +1 -1
- package/dist/lib/panels/credential-category-edit-panel/credential-category-edit-panel.component.js +164 -50
- package/dist/lib/panels/credential-category-edit-panel/credential-category-edit-panel.component.js.map +1 -1
- package/dist/lib/panels/credential-edit-panel/credential-edit-panel.component.d.ts +129 -16
- package/dist/lib/panels/credential-edit-panel/credential-edit-panel.component.d.ts.map +1 -1
- package/dist/lib/panels/credential-edit-panel/credential-edit-panel.component.js +338 -124
- package/dist/lib/panels/credential-edit-panel/credential-edit-panel.component.js.map +1 -1
- package/dist/lib/panels/credential-type-edit-panel/credential-type-edit-panel.component.d.ts +81 -9
- package/dist/lib/panels/credential-type-edit-panel/credential-type-edit-panel.component.d.ts.map +1 -1
- package/dist/lib/panels/credential-type-edit-panel/credential-type-edit-panel.component.js +207 -71
- package/dist/lib/panels/credential-type-edit-panel/credential-type-edit-panel.component.js.map +1 -1
- package/dist/lib/services/credential-dialog.service.d.ts +10 -0
- package/dist/lib/services/credential-dialog.service.d.ts.map +1 -1
- package/dist/lib/services/credential-dialog.service.js +27 -7
- package/dist/lib/services/credential-dialog.service.js.map +1 -1
- package/package.json +9 -9
|
@@ -39,7 +39,11 @@ export interface CredentialDialogResult {
|
|
|
39
39
|
}
|
|
40
40
|
export declare class CredentialDialogComponent extends BaseAngularComponent implements OnInit, OnChanges {
|
|
41
41
|
private cdr;
|
|
42
|
-
|
|
42
|
+
EditPanel: CredentialEditPanelComponent;
|
|
43
|
+
/** @deprecated Use {@link EditPanel}. */
|
|
44
|
+
get editPanel(): CredentialEditPanelComponent;
|
|
45
|
+
/** @deprecated Use {@link EditPanel}. */
|
|
46
|
+
set editPanel(value: CredentialEditPanelComponent);
|
|
43
47
|
Visible: boolean;
|
|
44
48
|
Credential: MJCredentialEntity | null;
|
|
45
49
|
PreselectedTypeId: string | undefined;
|
|
@@ -48,18 +52,30 @@ export declare class CredentialDialogComponent extends BaseAngularComponent impl
|
|
|
48
52
|
Width: number;
|
|
49
53
|
close: EventEmitter<CredentialDialogResult>;
|
|
50
54
|
IsLoading: boolean;
|
|
51
|
-
|
|
55
|
+
CredentialTypes: MJCredentialTypeEntity[];
|
|
56
|
+
/** @deprecated Use {@link CredentialTypes}. */
|
|
57
|
+
get credentialTypes(): MJCredentialTypeEntity[];
|
|
58
|
+
/** @deprecated Use {@link CredentialTypes}. */
|
|
59
|
+
set credentialTypes(value: MJCredentialTypeEntity[]);
|
|
52
60
|
private _dialogTitle;
|
|
53
61
|
constructor(cdr: ChangeDetectorRef);
|
|
54
62
|
ngOnInit(): void;
|
|
55
63
|
ngOnChanges(changes: SimpleChanges): void;
|
|
64
|
+
get DialogTitle(): string;
|
|
65
|
+
/** @deprecated Use {@link DialogTitle}. */
|
|
56
66
|
get dialogTitle(): string;
|
|
57
67
|
/**
|
|
58
68
|
* Opens the dialog with the specified options
|
|
59
69
|
*/
|
|
70
|
+
Open(options?: CredentialDialogOptions): Promise<void>;
|
|
71
|
+
/** @deprecated Use {@link Open}. */
|
|
60
72
|
open(options?: CredentialDialogOptions): Promise<void>;
|
|
61
73
|
private loadCredentialTypes;
|
|
74
|
+
OnSaved(credential: MJCredentialEntity): void;
|
|
75
|
+
/** @deprecated Use {@link OnSaved}. */
|
|
62
76
|
onSaved(credential: MJCredentialEntity): void;
|
|
77
|
+
OnDeleted(credentialId: string): void;
|
|
78
|
+
/** @deprecated Use {@link OnDeleted}. */
|
|
63
79
|
onDeleted(credentialId: string): void;
|
|
64
80
|
onCancel(): void;
|
|
65
81
|
static ɵfac: i0.ɵɵFactoryDeclaration<CredentialDialogComponent, never>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credential-dialog.component.d.ts","sourceRoot":"","sources":["../../../src/lib/dialogs/credential-dialog.component.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAA4B,YAAY,EAAE,iBAAiB,EAAsC,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAChK,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAE3F,OAAO,EAAE,4BAA4B,EAAE,MAAM,iEAAiE,CAAC;;AAE/G;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACpC,oEAAoE;IACpE,UAAU,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACvC,0DAA0D;IAC1D,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,mDAAmD;IACnD,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,4BAA4B;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6BAA6B;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACnC,gDAAgD;IAChD,OAAO,EAAE,OAAO,CAAC;IACjB,2DAA2D;IAC3D,UAAU,CAAC,EAAE,kBAAkB,CAAC;IAChC,kEAAkE;IAClE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gCAAgC;IAChC,MAAM,EAAE,OAAO,GAAG,SAAS,GAAG,WAAW,CAAC;CAC7C;AAED,qBAsCa,yBAA0B,SAAQ,oBAAqB,YAAW,MAAM,EAAE,SAAS;
|
|
1
|
+
{"version":3,"file":"credential-dialog.component.d.ts","sourceRoot":"","sources":["../../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,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,qBAAqB,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1C,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,KAAK,SAAO;IAEX,KAAK,uCAA8C;IAEtD,SAAS,UAAS;IAClB,eAAe,EAAE,sBAAsB,EAAE,CAAM;IAEtD,+CAA+C;IAC/C,IAAW,eAAe,IAAI,sBAAsB,EAAE,CAErD;IACD,+CAA+C;IAC/C,IAAW,eAAe,CAAC,KAAK,EAAE,sBAAsB,EAAE,EAEzD;IAED,OAAO,CAAC,YAAY,CAAgB;gBAEhB,GAAG,EAAE,iBAAiB;IAG1C,QAAQ,IAAI,IAAI;IAMhB,WAAW,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI;IAiBzC,IAAW,WAAW,IAAI,MAAM,CAK/B;IAED,2CAA2C;IAC3C,IAAW,WAAW,IAAI,MAAM,CAE/B;IAED;;OAEG;IACU,IAAI,CAAC,OAAO,CAAC,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC;IAsBnE,oCAAoC;IACvB,IAAI,CAAC,OAAO,CAAC,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC;YAIrD,mBAAmB;IA2B1B,OAAO,CAAC,UAAU,EAAE,kBAAkB,GAAG,IAAI;IAUpD,uCAAuC;IAChC,OAAO,CAAC,UAAU,EAAE,kBAAkB,GAAG,IAAI;IAI7C,SAAS,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;IAU5C,yCAAyC;IAClC,SAAS,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;IAIrC,QAAQ,IAAI,IAAI;yCAhKd,yBAAyB;2CAAzB,yBAAyB;CAwKrC"}
|
|
@@ -12,7 +12,15 @@ import * as i1 from "@memberjunction/ng-shared-generic";
|
|
|
12
12
|
import * as i2 from "../panels/credential-edit-panel/credential-edit-panel.component";
|
|
13
13
|
export class CredentialDialogComponent extends BaseAngularComponent {
|
|
14
14
|
cdr;
|
|
15
|
-
|
|
15
|
+
EditPanel;
|
|
16
|
+
/** @deprecated Use {@link EditPanel}. */
|
|
17
|
+
get editPanel() {
|
|
18
|
+
return this.EditPanel;
|
|
19
|
+
}
|
|
20
|
+
/** @deprecated Use {@link EditPanel}. */
|
|
21
|
+
set editPanel(value) {
|
|
22
|
+
this.EditPanel = value;
|
|
23
|
+
}
|
|
16
24
|
Visible = false;
|
|
17
25
|
Credential = null;
|
|
18
26
|
PreselectedTypeId;
|
|
@@ -21,7 +29,15 @@ export class CredentialDialogComponent extends BaseAngularComponent {
|
|
|
21
29
|
Width = 600;
|
|
22
30
|
close = new EventEmitter();
|
|
23
31
|
IsLoading = false;
|
|
24
|
-
|
|
32
|
+
CredentialTypes = [];
|
|
33
|
+
/** @deprecated Use {@link CredentialTypes}. */
|
|
34
|
+
get credentialTypes() {
|
|
35
|
+
return this.CredentialTypes;
|
|
36
|
+
}
|
|
37
|
+
/** @deprecated Use {@link CredentialTypes}. */
|
|
38
|
+
set credentialTypes(value) {
|
|
39
|
+
this.CredentialTypes = value;
|
|
40
|
+
}
|
|
25
41
|
_dialogTitle = 'Credential';
|
|
26
42
|
constructor(cdr) {
|
|
27
43
|
super();
|
|
@@ -41,23 +57,27 @@ export class CredentialDialogComponent extends BaseAngularComponent {
|
|
|
41
57
|
this.cdr.detectChanges();
|
|
42
58
|
// Use setTimeout to ensure ViewChild is resolved after render
|
|
43
59
|
setTimeout(() => {
|
|
44
|
-
if (this.
|
|
45
|
-
this.
|
|
60
|
+
if (this.EditPanel) {
|
|
61
|
+
this.EditPanel.open(this.Credential, this.PreselectedTypeId, this.PreselectedCategoryId);
|
|
46
62
|
}
|
|
47
63
|
}, 0);
|
|
48
64
|
});
|
|
49
65
|
}
|
|
50
66
|
}
|
|
51
|
-
get
|
|
67
|
+
get DialogTitle() {
|
|
52
68
|
if (this.Title) {
|
|
53
69
|
return this.Title;
|
|
54
70
|
}
|
|
55
71
|
return this.Credential?.ID ? 'Edit Credential' : 'Create Credential';
|
|
56
72
|
}
|
|
73
|
+
/** @deprecated Use {@link DialogTitle}. */
|
|
74
|
+
get dialogTitle() {
|
|
75
|
+
return this.DialogTitle;
|
|
76
|
+
}
|
|
57
77
|
/**
|
|
58
78
|
* Opens the dialog with the specified options
|
|
59
79
|
*/
|
|
60
|
-
async
|
|
80
|
+
async Open(options) {
|
|
61
81
|
this.Credential = options?.credential ?? null;
|
|
62
82
|
this.PreselectedTypeId = options?.preselectedTypeId;
|
|
63
83
|
this.PreselectedCategoryId = options?.preselectedCategoryId;
|
|
@@ -70,12 +90,16 @@ export class CredentialDialogComponent extends BaseAngularComponent {
|
|
|
70
90
|
// Force synchronous render so @if (Visible) creates the editPanel ViewChild
|
|
71
91
|
this.cdr.detectChanges();
|
|
72
92
|
// Initialize the edit panel after types are loaded and template is rendered
|
|
73
|
-
if (this.
|
|
74
|
-
await this.
|
|
93
|
+
if (this.EditPanel) {
|
|
94
|
+
await this.EditPanel.open(this.Credential, this.PreselectedTypeId, this.PreselectedCategoryId);
|
|
75
95
|
}
|
|
76
96
|
}
|
|
97
|
+
/** @deprecated Use {@link Open}. */
|
|
98
|
+
async open(options) {
|
|
99
|
+
return this.Open(options);
|
|
100
|
+
}
|
|
77
101
|
async loadCredentialTypes() {
|
|
78
|
-
if (this.
|
|
102
|
+
if (this.CredentialTypes.length > 0) {
|
|
79
103
|
return; // Already loaded
|
|
80
104
|
}
|
|
81
105
|
this.IsLoading = true;
|
|
@@ -88,7 +112,7 @@ export class CredentialDialogComponent extends BaseAngularComponent {
|
|
|
88
112
|
ResultType: 'entity_object'
|
|
89
113
|
});
|
|
90
114
|
if (result.Success) {
|
|
91
|
-
this.
|
|
115
|
+
this.CredentialTypes = result.Results;
|
|
92
116
|
}
|
|
93
117
|
}
|
|
94
118
|
catch (error) {
|
|
@@ -99,7 +123,7 @@ export class CredentialDialogComponent extends BaseAngularComponent {
|
|
|
99
123
|
this.cdr.markForCheck();
|
|
100
124
|
}
|
|
101
125
|
}
|
|
102
|
-
|
|
126
|
+
OnSaved(credential) {
|
|
103
127
|
this.Visible = false;
|
|
104
128
|
this.close.emit({
|
|
105
129
|
success: true,
|
|
@@ -108,7 +132,11 @@ export class CredentialDialogComponent extends BaseAngularComponent {
|
|
|
108
132
|
});
|
|
109
133
|
this.cdr.markForCheck();
|
|
110
134
|
}
|
|
111
|
-
|
|
135
|
+
/** @deprecated Use {@link OnSaved}. */
|
|
136
|
+
onSaved(credential) {
|
|
137
|
+
return this.OnSaved(credential);
|
|
138
|
+
}
|
|
139
|
+
OnDeleted(credentialId) {
|
|
112
140
|
this.Visible = false;
|
|
113
141
|
this.close.emit({
|
|
114
142
|
success: true,
|
|
@@ -117,6 +145,10 @@ export class CredentialDialogComponent extends BaseAngularComponent {
|
|
|
117
145
|
});
|
|
118
146
|
this.cdr.markForCheck();
|
|
119
147
|
}
|
|
148
|
+
/** @deprecated Use {@link OnDeleted}. */
|
|
149
|
+
onDeleted(credentialId) {
|
|
150
|
+
return this.OnDeleted(credentialId);
|
|
151
|
+
}
|
|
120
152
|
onCancel() {
|
|
121
153
|
this.Visible = false;
|
|
122
154
|
this.close.emit({
|
|
@@ -126,7 +158,7 @@ export class CredentialDialogComponent extends BaseAngularComponent {
|
|
|
126
158
|
this.cdr.markForCheck();
|
|
127
159
|
}
|
|
128
160
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: CredentialDialogComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
129
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: CredentialDialogComponent, isStandalone: false, selector: "mj-credential-dialog", inputs: { Visible: "Visible", Credential: "Credential", PreselectedTypeId: "PreselectedTypeId", PreselectedCategoryId: "PreselectedCategoryId", Title: "Title", Width: "Width" }, outputs: { close: "close" }, viewQueries: [{ propertyName: "
|
|
161
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: CredentialDialogComponent, isStandalone: false, selector: "mj-credential-dialog", inputs: { Visible: "Visible", Credential: "Credential", PreselectedTypeId: "PreselectedTypeId", PreselectedCategoryId: "PreselectedCategoryId", Title: "Title", Width: "Width" }, outputs: { close: "close" }, viewQueries: [{ propertyName: "EditPanel", first: true, predicate: ["editPanel"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: `
|
|
130
162
|
@if (Visible) {
|
|
131
163
|
@if (IsLoading) {
|
|
132
164
|
<div class="loading-backdrop">
|
|
@@ -144,7 +176,7 @@ export class CredentialDialogComponent extends BaseAngularComponent {
|
|
|
144
176
|
</mj-credential-edit-panel>
|
|
145
177
|
}
|
|
146
178
|
}
|
|
147
|
-
`, isInline: true, styles: ["\n .loading-backdrop {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: rgba(0, 0, 0, 0.5);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 10000;\n }\n "], dependencies: [{ kind: "component", type: i1.LoadingComponent, selector: "mj-loading", inputs: ["text", "showText", "animationDuration", "size", "textColor", "logoColor", "logoGradient", "animation"] }, { kind: "component", type: i2.CredentialEditPanelComponent, selector: "mj-credential-edit-panel", inputs: ["credential", "credentialTypes", "isOpen"], outputs: ["close", "saved", "deleted"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
179
|
+
`, isInline: true, styles: ["\n .loading-backdrop {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: rgba(0, 0, 0, 0.5);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 10000;\n }\n "], dependencies: [{ kind: "component", type: i1.LoadingComponent, selector: "mj-loading", inputs: ["Text", "text", "ShowText", "showText", "AnimationDuration", "animationDuration", "Size", "size", "TextColor", "textColor", "LogoColor", "logoColor", "LogoGradient", "logoGradient", "Animation", "animation"] }, { kind: "component", type: i2.CredentialEditPanelComponent, selector: "mj-credential-edit-panel", inputs: ["Credential", "credential", "CredentialTypes", "credentialTypes", "IsOpen", "isOpen"], outputs: ["close", "Saved", "saved", "Deleted", "deleted"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
148
180
|
}
|
|
149
181
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: CredentialDialogComponent, decorators: [{
|
|
150
182
|
type: Component,
|
|
@@ -167,7 +199,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
|
|
|
167
199
|
}
|
|
168
200
|
}
|
|
169
201
|
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: ["\n .loading-backdrop {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: rgba(0, 0, 0, 0.5);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 10000;\n }\n "] }]
|
|
170
|
-
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: {
|
|
202
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { EditPanel: [{
|
|
171
203
|
type: ViewChild,
|
|
172
204
|
args: ['editPanel']
|
|
173
205
|
}], Visible: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credential-dialog.component.js","sourceRoot":"","sources":["../../../src/lib/dialogs/credential-dialog.component.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAqB,uBAAuB,EAAE,SAAS,EAAoC,MAAM,eAAe,CAAC;AAChK,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAErE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;;;;AAuE/C,MAAM,OAAO,yBAA0B,SAAQ,oBAAoB;IAiB3C;IAhBI,SAAS,CAAgC;IAExD,OAAO,GAAG,KAAK,CAAC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yB;kBAtCrC,SAAS;iCACI,KAAK,YACL,sBAAsB,YACtB;;;;;;;;;;;;;;;;;;KAkBT,mBAegB,uBAAuB,CAAC,MAAM;;sBAG9C,SAAS;uBAAC,WAAW;;sBAErB,KAAK;;sBACL,KAAK;;sBACL,KAAK;;sBACL,KAAK;;sBACL,KAAK;;sBACL,KAAK;;sBAEL,MAAM","sourcesContent":["/**\n * @fileoverview Credential Dialog Component\n *\n * A dialog wrapper for the CredentialEditPanelComponent that provides\n * a convenient way to create or edit credentials in a modal dialog.\n */\n\nimport { Component, Input, Output, EventEmitter, ChangeDetectorRef, ChangeDetectionStrategy, ViewChild, OnInit, OnChanges, SimpleChanges } from '@angular/core';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nimport { MJCredentialEntity, MJCredentialTypeEntity } from '@memberjunction/core-entities';\nimport { RunView } from '@memberjunction/core';\nimport { CredentialEditPanelComponent } from '../panels/credential-edit-panel/credential-edit-panel.component';\n\n/**\n * Configuration options for opening the credential dialog\n */\nexport interface CredentialDialogOptions {\n /** The credential to edit, or null for creating a new credential */\n credential?: MJCredentialEntity | null;\n /** Pre-selected credential type ID for new credentials */\n preselectedTypeId?: string;\n /** Pre-selected category ID for new credentials */\n preselectedCategoryId?: string;\n /** Dialog title override */\n title?: string;\n /** Dialog width in pixels */\n width?: number;\n}\n\n/**\n * Result returned when the dialog closes\n */\nexport interface CredentialDialogResult {\n /** Whether a credential was saved or deleted */\n success: boolean;\n /** The saved credential entity (if save was successful) */\n credential?: MJCredentialEntity;\n /** The ID of the deleted credential (if delete was successful) */\n deletedId?: string;\n /** The action that was taken */\n action: 'saved' | 'deleted' | 'cancelled';\n}\n\n@Component({\n standalone: false,\n selector: 'mj-credential-dialog',\n template: `\n @if (Visible) {\n @if (IsLoading) {\n <div class=\"loading-backdrop\">\n <mj-loading text=\"Loading credential types...\"></mj-loading>\n </div>\n } @else {\n <mj-credential-edit-panel\n #editPanel\n [credential]=\"Credential\"\n [credentialTypes]=\"credentialTypes\"\n [isOpen]=\"Visible\"\n (saved)=\"onSaved($event)\"\n (deleted)=\"onDeleted($event)\"\n (close)=\"onCancel()\">\n </mj-credential-edit-panel>\n }\n }\n `,\n styles: [`\n .loading-backdrop {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: rgba(0, 0, 0, 0.5);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 10000;\n }\n `],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class CredentialDialogComponent extends BaseAngularComponent implements OnInit, OnChanges {\n @ViewChild('editPanel') editPanel!: CredentialEditPanelComponent;\n\n @Input() Visible = false;\n @Input() Credential: MJCredentialEntity | null = null;\n @Input() PreselectedTypeId: string | undefined;\n @Input() PreselectedCategoryId: string | undefined;\n @Input() Title: string | undefined;\n @Input() Width = 600;\n\n @Output() close = new EventEmitter<CredentialDialogResult>();\n\n public IsLoading = false;\n public credentialTypes: MJCredentialTypeEntity[] = [];\n\n private _dialogTitle = 'Credential';\n\n constructor(private cdr: ChangeDetectorRef) {\n super();}\n\n ngOnInit(): void {\n if (this.Visible) {\n this.loadCredentialTypes();\n }\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['Visible'] && changes['Visible'].currentValue === true) {\n // When dialog becomes visible, load credential types and initialize the panel\n this.loadCredentialTypes().then(() => {\n // Wait for next change detection cycle to ensure panel is rendered\n // (panel is only rendered when IsLoading is false)\n this.cdr.detectChanges();\n // Use setTimeout to ensure ViewChild is resolved after render\n setTimeout(() => {\n if (this.editPanel) {\n this.editPanel.open(this.Credential, this.PreselectedTypeId, this.PreselectedCategoryId);\n }\n }, 0);\n });\n }\n }\n\n public get dialogTitle(): string {\n if (this.Title) {\n return this.Title;\n }\n return this.Credential?.ID ? 'Edit Credential' : 'Create Credential';\n }\n\n /**\n * Opens the dialog with the specified options\n */\n public async open(options?: CredentialDialogOptions): Promise<void> {\n this.Credential = options?.credential ?? null;\n this.PreselectedTypeId = options?.preselectedTypeId;\n this.PreselectedCategoryId = options?.preselectedCategoryId;\n this.Title = options?.title;\n if (options?.width) {\n this.Width = options.width;\n }\n\n this.Visible = true;\n\n await this.loadCredentialTypes();\n\n // Force synchronous render so @if (Visible) creates the editPanel ViewChild\n this.cdr.detectChanges();\n\n // Initialize the edit panel after types are loaded and template is rendered\n if (this.editPanel) {\n await this.editPanel.open(this.Credential, this.PreselectedTypeId, this.PreselectedCategoryId);\n }\n }\n\n private async loadCredentialTypes(): Promise<void> {\n if (this.credentialTypes.length > 0) {\n return; // Already loaded\n }\n\n this.IsLoading = true;\n this.cdr.markForCheck();\n\n try {\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const result = await rv.RunView<MJCredentialTypeEntity>({\n EntityName: 'MJ: Credential Types',\n OrderBy: 'Category, Name',\n ResultType: 'entity_object'\n });\n\n if (result.Success) {\n this.credentialTypes = result.Results;\n }\n } catch (error) {\n console.error('Error loading credential types:', error);\n } finally {\n this.IsLoading = false;\n this.cdr.markForCheck();\n }\n }\n\n public onSaved(credential: MJCredentialEntity): void {\n this.Visible = false;\n this.close.emit({\n success: true,\n credential,\n action: 'saved'\n });\n this.cdr.markForCheck();\n }\n\n public onDeleted(credentialId: string): void {\n this.Visible = false;\n this.close.emit({\n success: true,\n deletedId: credentialId,\n action: 'deleted'\n });\n this.cdr.markForCheck();\n }\n\n public onCancel(): void {\n this.Visible = false;\n this.close.emit({\n success: false,\n action: 'cancelled'\n });\n this.cdr.markForCheck();\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"credential-dialog.component.js","sourceRoot":"","sources":["../../../src/lib/dialogs/credential-dialog.component.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAqB,uBAAuB,EAAE,SAAS,EAAoC,MAAM,eAAe,CAAC;AAChK,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAErE,OAAO,EAAE,OAAO,EAAE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AO,EAAE,IAAI;YACb,UAAU;YACV,MAAM,EAAE,OAAO;SAClB,CAAC,CAAC;QACH,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC;IAC5B,CAAC;IAED,uCAAuC;IAChC,OAAO,CAAC,UAA8B;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAClC,CAAC;IAEM,SAAS,CAAC,YAAoB;QACjC,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACrB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;YACZ,OAAO,EAAE,IAAI;YACb,SAAS,EAAE,YAAY;YACvB,MAAM,EAAE,SAAS;SACpB,CAAC,CAAC;QACH,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC;IAC5B,CAAC;IAED,yCAAyC;IAClC,SAAS,CAAC,YAAoB;QACnC,OAAO,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;IACtC,CAAC;IAEM,QAAQ;QACX,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACrB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;YACZ,OAAO,EAAE,KAAK;YACd,MAAM,EAAE,WAAW;SACtB,CAAC,CAAC;QACH,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC;IAC5B,CAAC;wGAvKQ,yBAAyB;4FAAzB,yBAAyB,obAnCxB;;;;;;;;;;;;;;;;;;KAkBT;;4FAiBQ,yBAAyB;kBAtCrC,SAAS;iCACI,KAAK,YACL,sBAAsB,YACtB;;;;;;;;;;;;;;;;;;KAkBT,mBAegB,uBAAuB,CAAC,MAAM;;sBAG9C,SAAS;uBAAC,WAAW;;sBAWrB,KAAK;;sBACL,KAAK;;sBACL,KAAK;;sBACL,KAAK;;sBACL,KAAK;;sBACL,KAAK;;sBAEL,MAAM","sourcesContent":["/**\n * @fileoverview Credential Dialog Component\n *\n * A dialog wrapper for the CredentialEditPanelComponent that provides\n * a convenient way to create or edit credentials in a modal dialog.\n */\n\nimport { Component, Input, Output, EventEmitter, ChangeDetectorRef, ChangeDetectionStrategy, ViewChild, OnInit, OnChanges, SimpleChanges } from '@angular/core';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nimport { MJCredentialEntity, MJCredentialTypeEntity } from '@memberjunction/core-entities';\nimport { RunView } from '@memberjunction/core';\nimport { CredentialEditPanelComponent } from '../panels/credential-edit-panel/credential-edit-panel.component';\n\n/**\n * Configuration options for opening the credential dialog\n */\nexport interface CredentialDialogOptions {\n /** The credential to edit, or null for creating a new credential */\n credential?: MJCredentialEntity | null;\n /** Pre-selected credential type ID for new credentials */\n preselectedTypeId?: string;\n /** Pre-selected category ID for new credentials */\n preselectedCategoryId?: string;\n /** Dialog title override */\n title?: string;\n /** Dialog width in pixels */\n width?: number;\n}\n\n/**\n * Result returned when the dialog closes\n */\nexport interface CredentialDialogResult {\n /** Whether a credential was saved or deleted */\n success: boolean;\n /** The saved credential entity (if save was successful) */\n credential?: MJCredentialEntity;\n /** The ID of the deleted credential (if delete was successful) */\n deletedId?: string;\n /** The action that was taken */\n action: 'saved' | 'deleted' | 'cancelled';\n}\n\n@Component({\n standalone: false,\n selector: 'mj-credential-dialog',\n template: `\n @if (Visible) {\n @if (IsLoading) {\n <div class=\"loading-backdrop\">\n <mj-loading text=\"Loading credential types...\"></mj-loading>\n </div>\n } @else {\n <mj-credential-edit-panel\n #editPanel\n [credential]=\"Credential\"\n [credentialTypes]=\"credentialTypes\"\n [isOpen]=\"Visible\"\n (saved)=\"onSaved($event)\"\n (deleted)=\"onDeleted($event)\"\n (close)=\"onCancel()\">\n </mj-credential-edit-panel>\n }\n }\n `,\n styles: [`\n .loading-backdrop {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: rgba(0, 0, 0, 0.5);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 10000;\n }\n `],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class CredentialDialogComponent extends BaseAngularComponent implements OnInit, OnChanges {\n @ViewChild('editPanel') EditPanel!: CredentialEditPanelComponent;\n\n /** @deprecated Use {@link EditPanel}. */\n get editPanel(): CredentialEditPanelComponent {\n return this.EditPanel;\n }\n /** @deprecated Use {@link EditPanel}. */\n set editPanel(value: CredentialEditPanelComponent) {\n this.EditPanel = value;\n }\n\n @Input() Visible = false;\n @Input() Credential: MJCredentialEntity | null = null;\n @Input() PreselectedTypeId: string | undefined;\n @Input() PreselectedCategoryId: string | undefined;\n @Input() Title: string | undefined;\n @Input() Width = 600;\n\n @Output() close = new EventEmitter<CredentialDialogResult>();\n\n public IsLoading = false;\n public CredentialTypes: MJCredentialTypeEntity[] = [];\n\n /** @deprecated Use {@link CredentialTypes}. */\n public get credentialTypes(): MJCredentialTypeEntity[] {\n return this.CredentialTypes;\n }\n /** @deprecated Use {@link CredentialTypes}. */\n public set credentialTypes(value: MJCredentialTypeEntity[]) {\n this.CredentialTypes = value;\n }\n\n private _dialogTitle = 'Credential';\n\n constructor(private cdr: ChangeDetectorRef) {\n super();}\n\n ngOnInit(): void {\n if (this.Visible) {\n this.loadCredentialTypes();\n }\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['Visible'] && changes['Visible'].currentValue === true) {\n // When dialog becomes visible, load credential types and initialize the panel\n this.loadCredentialTypes().then(() => {\n // Wait for next change detection cycle to ensure panel is rendered\n // (panel is only rendered when IsLoading is false)\n this.cdr.detectChanges();\n // Use setTimeout to ensure ViewChild is resolved after render\n setTimeout(() => {\n if (this.EditPanel) {\n this.EditPanel.open(this.Credential, this.PreselectedTypeId, this.PreselectedCategoryId);\n }\n }, 0);\n });\n }\n }\n\n public get DialogTitle(): string {\n if (this.Title) {\n return this.Title;\n }\n return this.Credential?.ID ? 'Edit Credential' : 'Create Credential';\n }\n\n /** @deprecated Use {@link DialogTitle}. */\n public get dialogTitle(): string {\n return this.DialogTitle;\n }\n\n /**\n * Opens the dialog with the specified options\n */\n public async Open(options?: CredentialDialogOptions): Promise<void> {\n this.Credential = options?.credential ?? null;\n this.PreselectedTypeId = options?.preselectedTypeId;\n this.PreselectedCategoryId = options?.preselectedCategoryId;\n this.Title = options?.title;\n if (options?.width) {\n this.Width = options.width;\n }\n\n this.Visible = true;\n\n await this.loadCredentialTypes();\n\n // Force synchronous render so @if (Visible) creates the editPanel ViewChild\n this.cdr.detectChanges();\n\n // Initialize the edit panel after types are loaded and template is rendered\n if (this.EditPanel) {\n await this.EditPanel.open(this.Credential, this.PreselectedTypeId, this.PreselectedCategoryId);\n }\n }\n\n /** @deprecated Use {@link Open}. */\n public async open(options?: CredentialDialogOptions): Promise<void> {\n return this.Open(options);\n }\n\n private async loadCredentialTypes(): Promise<void> {\n if (this.CredentialTypes.length > 0) {\n return; // Already loaded\n }\n\n this.IsLoading = true;\n this.cdr.markForCheck();\n\n try {\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const result = await rv.RunView<MJCredentialTypeEntity>({\n EntityName: 'MJ: Credential Types',\n OrderBy: 'Category, Name',\n ResultType: 'entity_object'\n });\n\n if (result.Success) {\n this.CredentialTypes = result.Results;\n }\n } catch (error) {\n console.error('Error loading credential types:', error);\n } finally {\n this.IsLoading = false;\n this.cdr.markForCheck();\n }\n }\n\n public OnSaved(credential: MJCredentialEntity): void {\n this.Visible = false;\n this.close.emit({\n success: true,\n credential,\n action: 'saved'\n });\n this.cdr.markForCheck();\n }\n\n /** @deprecated Use {@link OnSaved}. */\n public onSaved(credential: MJCredentialEntity): void {\n return this.OnSaved(credential);\n }\n\n public OnDeleted(credentialId: string): void {\n this.Visible = false;\n this.close.emit({\n success: true,\n deletedId: credentialId,\n action: 'deleted'\n });\n this.cdr.markForCheck();\n }\n\n /** @deprecated Use {@link OnDeleted}. */\n public onDeleted(credentialId: string): void {\n return this.OnDeleted(credentialId);\n }\n\n public onCancel(): void {\n this.Visible = false;\n this.close.emit({\n success: false,\n action: 'cancelled'\n });\n this.cdr.markForCheck();\n }\n}\n"]}
|
package/dist/lib/panels/credential-category-edit-panel/credential-category-edit-panel.component.d.ts
CHANGED
|
@@ -7,40 +7,108 @@ export declare class CredentialCategoryEditPanelComponent extends BaseAngularCom
|
|
|
7
7
|
private cdr;
|
|
8
8
|
private confirmService;
|
|
9
9
|
category: MJCredentialCategoryEntity | null;
|
|
10
|
-
|
|
10
|
+
IsOpen: boolean;
|
|
11
|
+
/** @deprecated Use {@link IsOpen}. */
|
|
12
|
+
set isOpen(value: CredentialCategoryEditPanelComponent['IsOpen']);
|
|
13
|
+
/** @deprecated Use {@link IsOpen}. */
|
|
14
|
+
get isOpen(): CredentialCategoryEditPanelComponent['IsOpen'];
|
|
11
15
|
close: EventEmitter<void>;
|
|
16
|
+
Saved: EventEmitter<MJCredentialCategoryEntity>;
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated Use {@link Saved}.
|
|
19
|
+
*
|
|
20
|
+
* The same emitter under the old binding name, so a template still binding
|
|
21
|
+
* (saved) keeps working. Must stay AFTER Saved: class fields
|
|
22
|
+
* initialise in order, and the other way round this captures undefined.
|
|
23
|
+
*/
|
|
12
24
|
saved: EventEmitter<MJCredentialCategoryEntity>;
|
|
25
|
+
Deleted: EventEmitter<string>;
|
|
26
|
+
/**
|
|
27
|
+
* @deprecated Use {@link Deleted}.
|
|
28
|
+
*
|
|
29
|
+
* The same emitter under the old binding name, so a template still binding
|
|
30
|
+
* (deleted) keeps working. Must stay AFTER Deleted: class fields
|
|
31
|
+
* initialise in order, and the other way round this captures undefined.
|
|
32
|
+
*/
|
|
13
33
|
deleted: EventEmitter<string>;
|
|
14
34
|
isLoading: boolean;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
35
|
+
IsSaving: boolean;
|
|
36
|
+
/** @deprecated Use {@link IsSaving}. */
|
|
37
|
+
get isSaving(): boolean;
|
|
38
|
+
/** @deprecated Use {@link IsSaving}. */
|
|
39
|
+
set isSaving(value: boolean);
|
|
40
|
+
IsNew: boolean;
|
|
41
|
+
/** @deprecated Use {@link IsNew}. */
|
|
42
|
+
get isNew(): boolean;
|
|
43
|
+
/** @deprecated Use {@link IsNew}. */
|
|
44
|
+
set isNew(value: boolean);
|
|
45
|
+
AllCategories: MJCredentialCategoryEntity[];
|
|
46
|
+
/** @deprecated Use {@link AllCategories}. */
|
|
47
|
+
get allCategories(): MJCredentialCategoryEntity[];
|
|
48
|
+
/** @deprecated Use {@link AllCategories}. */
|
|
49
|
+
set allCategories(value: MJCredentialCategoryEntity[]);
|
|
18
50
|
name: string;
|
|
19
51
|
description: string;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
52
|
+
ParentId: string;
|
|
53
|
+
/** @deprecated Use {@link ParentId}. */
|
|
54
|
+
get parentId(): string;
|
|
55
|
+
/** @deprecated Use {@link ParentId}. */
|
|
56
|
+
set parentId(value: string);
|
|
57
|
+
IconClass: string;
|
|
58
|
+
/** @deprecated Use {@link IconClass}. */
|
|
59
|
+
get iconClass(): string;
|
|
60
|
+
/** @deprecated Use {@link IconClass}. */
|
|
61
|
+
set iconClass(value: string);
|
|
62
|
+
IconSuggestions: {
|
|
23
63
|
icon: string;
|
|
24
64
|
label: string;
|
|
25
65
|
}[];
|
|
66
|
+
/** @deprecated Use {@link IconSuggestions}. */
|
|
67
|
+
get iconSuggestions(): {
|
|
68
|
+
icon: string;
|
|
69
|
+
label: string;
|
|
70
|
+
}[];
|
|
71
|
+
/** @deprecated Use {@link IconSuggestions}. */
|
|
72
|
+
set iconSuggestions(value: {
|
|
73
|
+
icon: string;
|
|
74
|
+
label: string;
|
|
75
|
+
}[]);
|
|
26
76
|
private get _metadata();
|
|
27
77
|
constructor(cdr: ChangeDetectorRef, confirmService: MJConfirmService);
|
|
28
78
|
ngOnInit(): void;
|
|
79
|
+
get PanelTitle(): string;
|
|
80
|
+
/** @deprecated Use {@link PanelTitle}. */
|
|
29
81
|
get panelTitle(): string;
|
|
82
|
+
get CanSave(): boolean;
|
|
83
|
+
/** @deprecated Use {@link CanSave}. */
|
|
30
84
|
get canSave(): boolean;
|
|
85
|
+
get AvailableParentCategories(): MJCredentialCategoryEntity[];
|
|
86
|
+
/** @deprecated Use {@link AvailableParentCategories}. */
|
|
31
87
|
get availableParentCategories(): MJCredentialCategoryEntity[];
|
|
32
88
|
private getDescendantIds;
|
|
89
|
+
Open(category: MJCredentialCategoryEntity | null, preselectedParentId?: string): Promise<void>;
|
|
90
|
+
/** @deprecated Use {@link Open}. */
|
|
33
91
|
open(category: MJCredentialCategoryEntity | null, preselectedParentId?: string): Promise<void>;
|
|
34
92
|
private loadCategories;
|
|
35
93
|
private resetForm;
|
|
36
94
|
private populateFromCategory;
|
|
95
|
+
SelectIcon(icon: string): void;
|
|
96
|
+
/** @deprecated Use {@link SelectIcon}. */
|
|
37
97
|
selectIcon(icon: string): void;
|
|
38
98
|
save(): Promise<void>;
|
|
99
|
+
DeleteCategory(): Promise<void>;
|
|
100
|
+
/** @deprecated Use {@link DeleteCategory}. */
|
|
39
101
|
deleteCategory(): Promise<void>;
|
|
102
|
+
ClosePanel(): void;
|
|
103
|
+
/** @deprecated Use {@link ClosePanel}. */
|
|
40
104
|
closePanel(): void;
|
|
105
|
+
OnBackdropClick(event: MouseEvent): void;
|
|
106
|
+
/** @deprecated Use {@link OnBackdropClick}. */
|
|
41
107
|
onBackdropClick(event: MouseEvent): void;
|
|
108
|
+
GetParentPath(categoryId: string): string;
|
|
109
|
+
/** @deprecated Use {@link GetParentPath}. */
|
|
42
110
|
getParentPath(categoryId: string): string;
|
|
43
111
|
static ɵfac: i0.ɵɵFactoryDeclaration<CredentialCategoryEditPanelComponent, never>;
|
|
44
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<CredentialCategoryEditPanelComponent, "mj-credential-category-edit-panel", never, { "category": { "alias": "category"; "required": false; }; "isOpen": { "alias": "isOpen"; "required": false; }; }, { "close": "close"; "saved": "saved"; "deleted": "deleted"; }, never, never, false, never>;
|
|
112
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CredentialCategoryEditPanelComponent, "mj-credential-category-edit-panel", never, { "category": { "alias": "category"; "required": false; }; "IsOpen": { "alias": "IsOpen"; "required": false; }; "isOpen": { "alias": "isOpen"; "required": false; }; }, { "close": "close"; "Saved": "Saved"; "saved": "saved"; "Deleted": "Deleted"; "deleted": "deleted"; }, never, never, false, never>;
|
|
45
113
|
}
|
|
46
114
|
//# sourceMappingURL=credential-category-edit-panel.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credential-category-edit-panel.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/panels/credential-category-edit-panel/credential-category-edit-panel.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,YAAY,EAAE,iBAAiB,EAA2B,MAAM,EAAE,MAAM,eAAe,CAAC;AAC3H,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAI3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;;AAErE,qBAOa,oCAAqC,SAAQ,oBAAqB,YAAW,MAAM;
|
|
1
|
+
{"version":3,"file":"credential-category-edit-panel.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/panels/credential-category-edit-panel/credential-category-edit-panel.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,YAAY,EAAE,iBAAiB,EAA2B,MAAM,EAAE,MAAM,eAAe,CAAC;AAC3H,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAI3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;;AAErE,qBAOa,oCAAqC,SAAQ,oBAAqB,YAAW,MAAM;IAwHhF,OAAO,CAAC,GAAG;IAAqB,OAAO,CAAC,cAAc;IAvHzD,QAAQ,EAAE,0BAA0B,GAAG,IAAI,CAAQ;IACnD,MAAM,UAAS;IAExB,sCAAsC;IACtC,IA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