@posiwise/dashboard-module 0.0.146 → 0.0.148

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.
@@ -1,1072 +1,1964 @@
1
- import * as i2$2 from '@angular/common';
2
- import { CommonModule } from '@angular/common';
3
- import * as i0 from '@angular/core';
4
- import { Component, CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
5
- import * as i2$1 from '@angular/forms';
6
- import { FormsModule, ReactiveFormsModule } from '@angular/forms';
7
- import * as i1 from '@posiwise/common-services';
8
- import { PermissionService, SubscriptionService } from '@posiwise/common-services';
9
- import { CoreTranslocoModule } from '@posiwise/core-transloco';
10
- import { DirectivesModule } from '@posiwise/directives';
11
- import * as i5$1 from '@posiwise/pipes';
12
- import { PipesModule } from '@posiwise/pipes';
13
- import { UserModuleModule } from '@posiwise/user-module';
14
- import * as i3 from 'primeng/progressspinner';
15
- import { ProgressSpinnerModule } from 'primeng/progressspinner';
16
- import * as i3$1 from 'primeng/radiobutton';
17
- import { RadioButtonModule } from 'primeng/radiobutton';
18
- import { SelectModule } from 'primeng/select';
19
- import * as i1$2 from '@ng-bootstrap/ng-bootstrap';
20
- import { NgbNavModule, NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
21
- import * as i1$1 from '@angular/router';
22
- import { RouterModule } from '@angular/router';
23
- import * as i4 from '@posiwise/shared-components';
24
- import { ResourceSharedComponentsModule } from '@posiwise/shared-components';
25
- import * as i5 from 'primeng/tooltip';
26
- import { TooltipModule } from 'primeng/tooltip';
27
- import * as i2 from '@angular/platform-browser';
28
- import { AppBaseComponent } from '@posiwise/app-base-component';
29
- import { ADMIN_ROUTERS } from '@posiwise/common-utilities';
30
- import { HelperService } from '@posiwise/helper-service';
31
- import { Subject, forkJoin } from 'rxjs';
32
- import { debounceTime, takeUntil, finalize } from 'rxjs/operators';
33
- import groupBy from 'lodash/groupBy';
34
- import sortBy from 'lodash/sortBy';
35
- import * as i7 from '@jsverse/transloco';
36
- import moment from 'moment';
37
-
38
- class DocumentationComponent {
39
- constructor(sanitizer) {
40
- this.sanitizer = sanitizer;
41
- this.isLoaded = false;
42
- }
43
- ngOnInit() {
44
- // Read from sessionStorage - don't clear it so it persists on refresh
45
- const sessionStorageUrl = sessionStorage.getItem('documentation_url');
46
- const rawUrl = sessionStorageUrl;
47
- if (rawUrl) {
48
- // baseUrl is a trusted internal source (e.g. YouTube embed URL)
49
- this.iframeUrl = this.sanitizer.bypassSecurityTrustResourceUrl(rawUrl); //NOSONAR
50
- }
51
- else {
52
- // If no URL is available, mark as loaded to hide spinner
53
- this.isLoaded = true;
54
- }
55
- }
56
- onIframeLoad() {
57
- // Defer change to next tick to avoid ExpressionChangedAfterItHasBeenCheckedError
58
- setTimeout(() => {
59
- this.isLoaded = true;
60
- }, 0);
61
- }
62
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: DocumentationComponent, deps: [{ token: i2.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component }); }
63
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.19", type: DocumentationComponent, isStandalone: false, selector: "pw-documentation", ngImport: i0, template: "@if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\">\n <p-progressSpinner strokeWidth=\"2\"></p-progressSpinner>\n </div>\n}\n\n<div class=\"documentation-wrapper\" [hidden]=\"!isLoaded || !iframeUrl\">\n @if (iframeUrl) {\n <iframe\n [src]=\"iframeUrl\"\n width=\"100%\"\n height=\"100%\"\n allowfullscreen\n title=\"Documentation Frame\"\n (load)=\"onIframeLoad()\"\n ></iframe>\n }\n</div>\n", styles: [".documentation-wrapper{width:100%;height:100vh}.documentation-wrapper iframe{width:100%;height:100%;border:none}\n"], dependencies: [{ kind: "component", type: i3.ProgressSpinner, selector: "p-progressSpinner, p-progress-spinner, p-progressspinner", inputs: ["styleClass", "strokeWidth", "fill", "animationDuration", "ariaLabel"] }] }); }
64
- }
65
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: DocumentationComponent, decorators: [{
66
- type: Component,
67
- args: [{ selector: 'pw-documentation', standalone: false, template: "@if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\">\n <p-progressSpinner strokeWidth=\"2\"></p-progressSpinner>\n </div>\n}\n\n<div class=\"documentation-wrapper\" [hidden]=\"!isLoaded || !iframeUrl\">\n @if (iframeUrl) {\n <iframe\n [src]=\"iframeUrl\"\n width=\"100%\"\n height=\"100%\"\n allowfullscreen\n title=\"Documentation Frame\"\n (load)=\"onIframeLoad()\"\n ></iframe>\n }\n</div>\n", styles: [".documentation-wrapper{width:100%;height:100vh}.documentation-wrapper iframe{width:100%;height:100%;border:none}\n"] }]
68
- }], ctorParameters: () => [{ type: i2.DomSanitizer }] });
69
-
70
- /// The permission expression guarding the admin FAQ routes. Kept verbatim in
71
- /// step with `libs/admin-module/src/lib/admin-module.routing.ts`, where the
72
- /// `faq` parent and its `add` / `:id` children all carry this exact string.
73
- /// Offering an edit affordance to anyone `PageAccessGuard` would then bounce
74
- /// to `notfound` is the failure mode this mirroring exists to prevent.
75
- ///
76
- /// Shared by the public FAQ list (`FaqComponent`) and the public FAQ detail
77
- /// page (`FaqDetailsComponent`) so the two surfaces can never drift apart.
78
- const FAQ_ADMIN_PERMISSION = 'Pages.Admin.FAQ || Pages.Role.MarketingManager || Pages.Role.CustomerSuccessManager';
79
-
80
- /// Non-product FAQs first, then product-scoped ones, grouped by category and
81
- /// ordered by `position` within each group.
1
+ import * as i2 from "@angular/common";
2
+ import { CommonModule } from "@angular/common";
3
+ import * as i0 from "@angular/core";
4
+ import { CUSTOM_ELEMENTS_SCHEMA, Component, NgModule } from "@angular/core";
5
+ import * as i2$1 from "@angular/forms";
6
+ import { FormsModule, ReactiveFormsModule } from "@angular/forms";
7
+ import * as i1$1 from "@posiwise/common-services";
8
+ import { PermissionService, SubscriptionService } from "@posiwise/common-services";
9
+ import { CoreTranslocoModule } from "@posiwise/core-transloco";
10
+ import * as i4 from "@posiwise/directives";
11
+ import { DirectivesModule } from "@posiwise/directives";
12
+ import * as i5 from "@posiwise/pipes";
13
+ import { PipesModule } from "@posiwise/pipes";
14
+ import { UserModuleModule } from "@posiwise/user-module";
15
+ import * as i2$2 from "primeng/progressspinner";
16
+ import { ProgressSpinnerModule } from "primeng/progressspinner";
17
+ import * as i3 from "primeng/radiobutton";
18
+ import { RadioButtonModule } from "primeng/radiobutton";
19
+ import { SelectModule } from "primeng/select";
20
+ import * as i1 from "@ng-bootstrap/ng-bootstrap";
21
+ import { NgbDropdownModule, NgbNavModule } from "@ng-bootstrap/ng-bootstrap";
22
+ import * as i3$1 from "@angular/router";
23
+ import { RouterModule } from "@angular/router";
24
+ import * as i6 from "@posiwise/shared-components";
25
+ import { ResourceSharedComponentsModule } from "@posiwise/shared-components";
26
+ import * as i5$1 from "primeng/tooltip";
27
+ import { TooltipModule } from "primeng/tooltip";
28
+ import * as i1$2 from "@angular/platform-browser";
29
+ import { AppBaseComponent } from "@posiwise/app-base-component";
30
+ import { ADMIN_ROUTERS } from "@posiwise/common-utilities";
31
+ import { HelperService } from "@posiwise/helper-service";
32
+ import { Subject, forkJoin, of } from "rxjs";
33
+ import { catchError, debounceTime, finalize, map, switchMap, take, takeUntil } from "rxjs/operators";
34
+ import groupBy from "lodash/groupBy";
35
+ import sortBy from "lodash/sortBy";
36
+ import * as i7 from "@jsverse/transloco";
37
+ import moment from "moment";
38
+ var DocumentationComponent = class DocumentationComponent {
39
+ constructor(sanitizer) {
40
+ this.sanitizer = sanitizer;
41
+ this.isLoaded = false;
42
+ }
43
+ ngOnInit() {
44
+ const rawUrl = sessionStorage.getItem("documentation_url");
45
+ if (rawUrl) this.iframeUrl = this.sanitizer.bypassSecurityTrustResourceUrl(rawUrl);
46
+ else this.isLoaded = true;
47
+ }
48
+ onIframeLoad() {
49
+ setTimeout(() => {
50
+ this.isLoaded = true;
51
+ }, 0);
52
+ }
53
+ static {
54
+ this.ɵfac = i0.ɵɵngDeclareFactory({
55
+ minVersion: "12.0.0",
56
+ version: "22.2.0",
57
+ ngImport: i0,
58
+ type: DocumentationComponent,
59
+ deps: [{ token: i1$2.DomSanitizer }],
60
+ target: i0.ɵɵFactoryTarget.Component
61
+ });
62
+ }
63
+ static {
64
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
65
+ minVersion: "17.0.0",
66
+ version: "22.2.0",
67
+ type: DocumentationComponent,
68
+ isStandalone: false,
69
+ selector: "pw-documentation",
70
+ ngImport: i0,
71
+ template: "@if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\">\n <p-progress-spinner strokeWidth=\"2\"></p-progress-spinner>\n </div>\n}\n\n<div class=\"documentation-wrapper\" [hidden]=\"!isLoaded || !iframeUrl\">\n @if (iframeUrl) {\n <iframe\n [src]=\"iframeUrl\"\n width=\"100%\"\n height=\"100%\"\n allowfullscreen\n title=\"Documentation Frame\"\n (load)=\"onIframeLoad()\"\n ></iframe>\n }\n</div>\n",
72
+ styles: [".documentation-wrapper{width:100%;height:100vh}.documentation-wrapper iframe{width:100%;height:100%;border:none}\n"],
73
+ dependencies: [{
74
+ kind: "component",
75
+ type: i2$2.ProgressSpinner,
76
+ selector: "p-progress-spinner, p-progressspinner",
77
+ inputs: [
78
+ "value",
79
+ "strokeWidth",
80
+ "animationDuration",
81
+ "min",
82
+ "max",
83
+ "ariaLabel",
84
+ "fill"
85
+ ]
86
+ }]
87
+ });
88
+ }
89
+ };
90
+ i0.ɵɵngDeclareClassMetadata({
91
+ minVersion: "12.0.0",
92
+ version: "22.2.0",
93
+ ngImport: i0,
94
+ type: DocumentationComponent,
95
+ decorators: [{
96
+ type: Component,
97
+ args: [{
98
+ selector: "pw-documentation",
99
+ standalone: false,
100
+ template: "@if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\">\n <p-progress-spinner strokeWidth=\"2\"></p-progress-spinner>\n </div>\n}\n\n<div class=\"documentation-wrapper\" [hidden]=\"!isLoaded || !iframeUrl\">\n @if (iframeUrl) {\n <iframe\n [src]=\"iframeUrl\"\n width=\"100%\"\n height=\"100%\"\n allowfullscreen\n title=\"Documentation Frame\"\n (load)=\"onIframeLoad()\"\n ></iframe>\n }\n</div>\n",
101
+ styles: [".documentation-wrapper{width:100%;height:100vh}.documentation-wrapper iframe{width:100%;height:100%;border:none}\n"]
102
+ }]
103
+ }],
104
+ ctorParameters: () => [{ type: i1$2.DomSanitizer }]
105
+ });
106
+ const FAQ_ADMIN_PERMISSION = "Pages.Admin.FAQ || Pages.Role.MarketingManager || Pages.Role.CustomerSuccessManager";
82
107
  function groupFaqsByCategory(nonProductFaqs, productFaqs) {
83
- const grouped = groupBy([...nonProductFaqs, ...productFaqs], 'category');
84
- Object.keys(grouped).forEach(category => {
85
- grouped[category] = sortBy(grouped[category], 'position');
86
- });
87
- return grouped;
108
+ const grouped = groupBy([...nonProductFaqs, ...productFaqs], "category");
109
+ Object.keys(grouped).forEach((category) => {
110
+ grouped[category] = sortBy(grouped[category], "position");
111
+ });
112
+ return grouped;
88
113
  }
89
- /// Sanitize every answer up front so the markup is present before the collapse
90
- /// measures its target height — prevents the end-of-animation height snap that
91
- /// made expand/collapse feel clunky. Keyed `{itemIndex}-{categoryIndex}` to
92
- /// match the template's collapse ids.
93
114
  function buildSanitizedAnswers(faqs, sanitize) {
94
- const answers = {};
95
- Object.keys(faqs).forEach((category, categoryIndex) => {
96
- faqs[category].forEach((faq, itemIndex) => {
97
- if (faq?.answer) {
98
- answers[`${itemIndex}-${categoryIndex}`] = sanitize(faq.answer);
99
- }
100
- });
101
- });
102
- return answers;
103
- }
104
-
105
- class FaqComponent extends AppBaseComponent {
106
- constructor(commonService, injector, productService, sanitizer, cdr) {
107
- super(injector);
108
- this.commonService = commonService;
109
- this.productService = productService;
110
- this.sanitizer = sanitizer;
111
- this.cdr = cdr;
112
- this.searchSubject = new Subject();
113
- this.destroy$ = new Subject();
114
- this.sanitizedFaqAnswers = {};
115
- this.subscriptions = [];
116
- this.objectKeys = Object.keys;
117
- this.isLoaded = false;
118
- this.faqsResponse = [];
119
- this.faqHashMap = {};
120
- this.routers = ADMIN_ROUTERS;
121
- /// Whether to offer the inline link through to the admin edit form. Unlike
122
- /// the detail page, the list endpoint returns each FAQ's `id`, so no
123
- /// fallback is needed here.
124
- this.canEditFaq = false;
125
- }
126
- ngOnInit() {
127
- this.faqHashMap = {};
128
- this.showSupport = PermissionService.selectedProduct?.gitlab_service_desk_email;
129
- this.showDocumentation = PermissionService.selectedProduct?.documentation_url;
130
- this.slug = PermissionService.selectedSubscription?.slug;
131
- this.subscriptionId = PermissionService?.selectedSubscription?.id;
132
- this.masterProductId = this.appConfig.master_subscription.product_id;
133
- this.canEditFaq = this.permissionService.evaluatePermissions(FAQ_ADMIN_PERMISSION);
134
- this.getProducts();
135
- this.searchSubject
136
- .pipe(debounceTime(1000), takeUntil(this.destroy$))
137
- .subscribe(searchValue => {
138
- this.search_term = searchValue;
139
- this.loadFaqData();
140
- this.cdr.markForCheck();
141
- });
142
- this.loadFaqData();
143
- }
144
- loadFaqData() {
145
- this.isLoaded = false;
146
- forkJoin({
147
- faqs: this.commonService.getPublicFaq(this.subscriptionId, this.search_term),
148
- products: this.productService.getProducts({ master_product_id: this.masterProductId })
149
- })
150
- .pipe(finalize(() => {
151
- this.isLoaded = true;
152
- this.cdr.markForCheck();
153
- }))
154
- .subscribe(({ faqs, products }) => {
155
- this.faqsResponse = faqs.faqs;
156
- faqs?.available_category?.forEach(x => {
157
- this.faqHashMap[x.key] = x;
158
- });
159
- this.totalRecords = faqs.faqs.length;
160
- this.nonProductFaqs = this.faqsResponse.filter(x => x.visible && !x.product_id);
161
- this.allProductFaqs = this.faqsResponse.filter(x => x.visible && x.product_id);
162
- const noProductObjects = this.faqsResponse.every(x => x.product === null);
163
- this.allFaqFalse = this.faqsResponse.every(x => x.visible === false);
164
- if (!noProductObjects) {
165
- this.products = products.products;
166
- this.faqValidation();
167
- }
168
- else {
169
- this.products = [];
170
- this.faqValidation();
171
- }
172
- this.cdr.markForCheck();
173
- });
174
- }
175
- faqValidation() {
176
- this.faqs = groupFaqsByCategory(this.nonProductFaqs, this.allProductFaqs);
177
- this.sanitizedFaqAnswers = buildSanitizedAnswers(this.faqs, body => this.sanitizeFaqAnswer(body));
178
- }
179
- getProducts() {
180
- this.subscriptions = [];
181
- this.userStore().subscribe((user) => {
182
- if (user) {
183
- this.subscriptions = user.subscriptions;
184
- }
185
- this.cdr.markForCheck();
186
- });
187
- }
188
- filter(searchValue) {
189
- this.searchSubject.next(searchValue);
190
- }
191
- navigateToSupport() {
192
- this.router.navigate(['/support']);
193
- }
194
- navigateToDocumentation() {
195
- sessionStorage.setItem('documentation_url', this.showDocumentation);
196
- const documentationRoute = this.router.createUrlTree([this.slug, 'documentation']);
197
- const url = window.location.origin + this.router.serializeUrl(documentationRoute);
198
- window.open(url, '_blank');
199
- }
200
- trackByProductFaqId(_index, item) {
201
- return item.id;
202
- }
203
- onCollapseToggle(key, answer) {
204
- if (!this.sanitizedFaqAnswers[key] && answer) {
205
- this.sanitizedFaqAnswers[key] = this.sanitizeFaqAnswer(answer);
206
- }
207
- }
208
- sanitizeFaqAnswer(body) {
209
- return HelperService.sanitizeQuillBody(body, this.sanitizer);
210
- }
211
- ngOnDestroy() {
212
- this.destroy$.next();
213
- this.destroy$.complete();
214
- super.ngOnDestroy();
215
- }
216
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: FaqComponent, deps: [{ token: i1.CommonService }, { token: i0.Injector }, { token: i1.ProductService }, { token: i2.DomSanitizer }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
217
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.19", type: FaqComponent, isStandalone: false, selector: "pw-faq", usesInheritance: true, ngImport: i0, template: "<div class=\"mt-md-4 mt-4\">\n <div class=\"row mb-3\">\n <div class=\"col-12\">\n <div class=\"card gradient-custom-branding white text-center p-1 p-sm-2\">\n <div class=\"card-header p-1 p-sm-2\">\n <div class=\"d-flex justify-content-between align-items-start mb-3 mb-md-0\">\n <div>\n @if (showDocumentation) {\n <button\n class=\"btn btn-sm document-btn\"\n (click)=\"navigateToDocumentation()\">\n Documentation\n </button>\n }\n </div>\n <div>\n @if (showSupport) {\n <button\n class=\"btn btn-sm btn-primary\"\n (click)=\"navigateToSupport()\">\n Support\n </button>\n }\n </div>\n </div>\n\n <h1>You need help?</h1>\n <p><em>Please search through our frequently asked questions first.</em></p>\n </div>\n <div class=\"card-block p-2 p-sm-2\">\n <fieldset>\n <legend></legend>\n <label for=\"faq-search\" class=\"visually-hidden\">Search in FAQs</label>\n <input type=\"text\"\n id=\"faq-search\"\n name=\"faq-search\"\n class=\"form-control bg-white\"\n placeholder=\"Search FAQs...\"\n (input)=\"filter($event.target.value)\"\n #messageInput\n aria-label=\"Search FAQs...\" />\n </fieldset>\n </div>\n </div>\n </div>\n </div>\n @if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\"\n >\n <p-progressSpinner strokeWidth=\"2\"> </p-progressSpinner>\n </div>\n }\n @if (faqs) {\n @for (category of objectKeys(faqs); track category; let idx1 = $index) {\n <div>\n @if (faqs[category]?.length) {\n <h6 class=\"text-uppercase mt-3 p-1\">{{ faqHashMap[category]?.name }}</h6>\n <div class=\"dashboard\">\n @for (\n faq of faqs[category]; track trackByProductFaqId(idx,\n faq); let idx = $index) {\n <div class=\"faq-item\"\n >\n <div class=\"dashboard-header p-2\">\n <h5 class=\"accordion-title mt-2\">\n <a class=\"accordion-toggle collapsed\"\n data-bs-toggle=\"collapse\"\n (click)=\"onCollapseToggle(idx + '-' + idx1, faq?.answer)\"\n [href]=\"'#collapse' + idx + idx1\">\n {{ faq.question }}\n </a>\n </h5>\n @if (canEditFaq && faq?.id) {\n <a class=\"faq-edit-link\"\n [pTooltip]=\"'Admin.Faq.EditTitle' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n [attr.aria-label]=\"'Admin.Faq.EditTitle' | transloco\"\n [routerLink]=\"[routers.faqDetails + faq.id]\"\n target=\"_blank\">\n <i class=\"fa fa-edit edit-icon\" aria-hidden=\"true\"></i>\n </a>\n }\n </div>\n <div [id]=\"'collapse' + idx + idx1\"\n class=\"panel-collapse p-3 collapse in\">\n <div class=\"card-block\">\n @if (faq?.answer) {\n <div class=\"ql-container ql-snow no-border\">\n <div class=\"ql-editor\"\n [innerHTML]=\"sanitizedFaqAnswers[idx + '-' + idx1]\">\n </div>\n </div>\n }\n </div>\n </div>\n </div>\n }\n </div>\n }\n </div>\n }\n }\n @if (isLoaded && (totalRecords === 0 || allFaqFalse)) {\n <div>\n <pw-no-data [withImage]=\"true\" message=\"This is embarrassing - we couldn't find any FAQ.\"> </pw-no-data>\n </div>\n }\n</div>\n", styles: ["@charset \"UTF-8\";:root{--first: rgb(23 105 225);--second: rgb(54 194 131);--third: rgb(255 171 0);--text: rgb(34 34 34);--tabs_bg: rgb(23 105 225);--tabs_sub_bg: color-mix(in srgb, var(--first, rgb(23 105 225)) 85%, #000000);--tabs_text: rgb(255 255 255);--titles: rgb(34 34 34);--sidebar_bg: rgb(0, 48, 63);--sidebar_text: rgb(255 255 255);--dashboard_bg: rgb(255 255 255);--public-btn-radius: 24px}.card-header h1,.card-header p{color:#fff!important}.faq-item{border:1px solid rgb(224,224,224);background-color:#fff;border-radius:8px;margin:8px 0;overflow:hidden;transition:border-color .16s ease-out,box-shadow .16s ease-out}.faq-item:hover{border-color:#bdbdbd}.faq-item .dashboard-header{background:transparent;padding:0;display:flex;align-items:center;position:relative}.faq-item .dashboard-header:after{content:\"\\f078\";font-family:\"Font Awesome 5 Pro\",sans-serif;font-weight:600;font-size:13px;color:#9e9e9e;flex:0 0 auto;margin-left:auto;margin-right:18px;transition:transform .18s ease-out,color .18s ease-out}.faq-item .dashboard-header:hover:after{color:var(--titles)}.faq-item .dashboard-header:has(.accordion-toggle:not(.collapsed)):after{transform:rotate(180deg);color:var(--titles)}.faq-item .accordion-title{margin:0;flex:0 1 auto;min-width:0}.faq-item .faq-edit-link{position:relative;z-index:1;display:inline-flex;align-items:center;flex:0 0 auto;padding:14px 8px;text-decoration:none}.faq-item .faq-edit-link .edit-icon{font-size:14px}.faq-item .accordion-toggle{display:flex;align-items:center;padding:14px 4px 14px 18px;font-size:15px;font-weight:600;line-height:1.45;color:var(--titles);text-decoration:none;cursor:pointer}.faq-item .accordion-toggle:before{content:\"\"!important;position:absolute;inset:0;width:auto;padding:0}.faq-item .accordion-toggle:focus-visible{outline:2px solid var(--first);outline-offset:-2px}.faq-item .panel-collapse{padding:0!important}.faq-item .card-block{padding:4px 18px 16px;border-top:1px solid rgb(238,238,238)}.faq-item .ql-editor{font-size:14px;line-height:1.65;color:#616161;text-align:left}.document-btn{background-color:var(--second);border-color:var(--second)!important;color:#fff}.document-btn:hover{color:var(--second)!important;background-color:transparent!important}.card{background:var(--sidebar_bg)!important;color:var(--sidebar_text)!important;padding:.8rem!important}.card .accordion-toggle:before{content:\"\\f078\"}.card .accordion-toggle.collapsed{transition:all .3s ease-in-out}.card .accordion-toggle.collapsed:before{content:\"\\f054\"}h6{color:var(--titles)!important;font-size:17px;font-weight:700;letter-spacing:.04em;padding:0 0 10px!important;margin:32px 0 14px!important;border-bottom:1px solid rgb(224,224,224)}.accordion-title a{color:var(--titles)!important}.ql-container{resize:none!important;max-width:1000px;margin:0 auto}\n"], dependencies: [{ kind: "directive", type: i1$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: i3.ProgressSpinner, selector: "p-progressSpinner, p-progress-spinner, p-progressspinner", inputs: ["styleClass", "strokeWidth", "fill", "animationDuration", "ariaLabel"] }, { kind: "directive", type: i5.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip", "pTooltipPT", "pTooltipUnstyled"] }, { kind: "component", type: i4.NoDataComponent, selector: "pw-no-data", inputs: ["message", "description", "withImage"] }, { kind: "pipe", type: i7.TranslocoPipe, name: "transloco" }] }); }
218
- }
219
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: FaqComponent, decorators: [{
220
- type: Component,
221
- args: [{ selector: 'pw-faq', standalone: false, template: "<div class=\"mt-md-4 mt-4\">\n <div class=\"row mb-3\">\n <div class=\"col-12\">\n <div class=\"card gradient-custom-branding white text-center p-1 p-sm-2\">\n <div class=\"card-header p-1 p-sm-2\">\n <div class=\"d-flex justify-content-between align-items-start mb-3 mb-md-0\">\n <div>\n @if (showDocumentation) {\n <button\n class=\"btn btn-sm document-btn\"\n (click)=\"navigateToDocumentation()\">\n Documentation\n </button>\n }\n </div>\n <div>\n @if (showSupport) {\n <button\n class=\"btn btn-sm btn-primary\"\n (click)=\"navigateToSupport()\">\n Support\n </button>\n }\n </div>\n </div>\n\n <h1>You need help?</h1>\n <p><em>Please search through our frequently asked questions first.</em></p>\n </div>\n <div class=\"card-block p-2 p-sm-2\">\n <fieldset>\n <legend></legend>\n <label for=\"faq-search\" class=\"visually-hidden\">Search in FAQs</label>\n <input type=\"text\"\n id=\"faq-search\"\n name=\"faq-search\"\n class=\"form-control bg-white\"\n placeholder=\"Search FAQs...\"\n (input)=\"filter($event.target.value)\"\n #messageInput\n aria-label=\"Search FAQs...\" />\n </fieldset>\n </div>\n </div>\n </div>\n </div>\n @if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\"\n >\n <p-progressSpinner strokeWidth=\"2\"> </p-progressSpinner>\n </div>\n }\n @if (faqs) {\n @for (category of objectKeys(faqs); track category; let idx1 = $index) {\n <div>\n @if (faqs[category]?.length) {\n <h6 class=\"text-uppercase mt-3 p-1\">{{ faqHashMap[category]?.name }}</h6>\n <div class=\"dashboard\">\n @for (\n faq of faqs[category]; track trackByProductFaqId(idx,\n faq); let idx = $index) {\n <div class=\"faq-item\"\n >\n <div class=\"dashboard-header p-2\">\n <h5 class=\"accordion-title mt-2\">\n <a class=\"accordion-toggle collapsed\"\n data-bs-toggle=\"collapse\"\n (click)=\"onCollapseToggle(idx + '-' + idx1, faq?.answer)\"\n [href]=\"'#collapse' + idx + idx1\">\n {{ faq.question }}\n </a>\n </h5>\n @if (canEditFaq && faq?.id) {\n <a class=\"faq-edit-link\"\n [pTooltip]=\"'Admin.Faq.EditTitle' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n [attr.aria-label]=\"'Admin.Faq.EditTitle' | transloco\"\n [routerLink]=\"[routers.faqDetails + faq.id]\"\n target=\"_blank\">\n <i class=\"fa fa-edit edit-icon\" aria-hidden=\"true\"></i>\n </a>\n }\n </div>\n <div [id]=\"'collapse' + idx + idx1\"\n class=\"panel-collapse p-3 collapse in\">\n <div class=\"card-block\">\n @if (faq?.answer) {\n <div class=\"ql-container ql-snow no-border\">\n <div class=\"ql-editor\"\n [innerHTML]=\"sanitizedFaqAnswers[idx + '-' + idx1]\">\n </div>\n </div>\n }\n </div>\n </div>\n </div>\n }\n </div>\n }\n </div>\n }\n }\n @if (isLoaded && (totalRecords === 0 || allFaqFalse)) {\n <div>\n <pw-no-data [withImage]=\"true\" message=\"This is embarrassing - we couldn't find any FAQ.\"> </pw-no-data>\n </div>\n }\n</div>\n", styles: ["@charset \"UTF-8\";:root{--first: rgb(23 105 225);--second: rgb(54 194 131);--third: rgb(255 171 0);--text: rgb(34 34 34);--tabs_bg: rgb(23 105 225);--tabs_sub_bg: color-mix(in srgb, var(--first, rgb(23 105 225)) 85%, #000000);--tabs_text: rgb(255 255 255);--titles: rgb(34 34 34);--sidebar_bg: rgb(0, 48, 63);--sidebar_text: rgb(255 255 255);--dashboard_bg: rgb(255 255 255);--public-btn-radius: 24px}.card-header h1,.card-header p{color:#fff!important}.faq-item{border:1px solid rgb(224,224,224);background-color:#fff;border-radius:8px;margin:8px 0;overflow:hidden;transition:border-color .16s ease-out,box-shadow .16s ease-out}.faq-item:hover{border-color:#bdbdbd}.faq-item .dashboard-header{background:transparent;padding:0;display:flex;align-items:center;position:relative}.faq-item .dashboard-header:after{content:\"\\f078\";font-family:\"Font Awesome 5 Pro\",sans-serif;font-weight:600;font-size:13px;color:#9e9e9e;flex:0 0 auto;margin-left:auto;margin-right:18px;transition:transform .18s ease-out,color .18s ease-out}.faq-item .dashboard-header:hover:after{color:var(--titles)}.faq-item .dashboard-header:has(.accordion-toggle:not(.collapsed)):after{transform:rotate(180deg);color:var(--titles)}.faq-item .accordion-title{margin:0;flex:0 1 auto;min-width:0}.faq-item .faq-edit-link{position:relative;z-index:1;display:inline-flex;align-items:center;flex:0 0 auto;padding:14px 8px;text-decoration:none}.faq-item .faq-edit-link .edit-icon{font-size:14px}.faq-item .accordion-toggle{display:flex;align-items:center;padding:14px 4px 14px 18px;font-size:15px;font-weight:600;line-height:1.45;color:var(--titles);text-decoration:none;cursor:pointer}.faq-item .accordion-toggle:before{content:\"\"!important;position:absolute;inset:0;width:auto;padding:0}.faq-item .accordion-toggle:focus-visible{outline:2px solid var(--first);outline-offset:-2px}.faq-item .panel-collapse{padding:0!important}.faq-item .card-block{padding:4px 18px 16px;border-top:1px solid rgb(238,238,238)}.faq-item .ql-editor{font-size:14px;line-height:1.65;color:#616161;text-align:left}.document-btn{background-color:var(--second);border-color:var(--second)!important;color:#fff}.document-btn:hover{color:var(--second)!important;background-color:transparent!important}.card{background:var(--sidebar_bg)!important;color:var(--sidebar_text)!important;padding:.8rem!important}.card .accordion-toggle:before{content:\"\\f078\"}.card .accordion-toggle.collapsed{transition:all .3s ease-in-out}.card .accordion-toggle.collapsed:before{content:\"\\f054\"}h6{color:var(--titles)!important;font-size:17px;font-weight:700;letter-spacing:.04em;padding:0 0 10px!important;margin:32px 0 14px!important;border-bottom:1px solid rgb(224,224,224)}.accordion-title a{color:var(--titles)!important}.ql-container{resize:none!important;max-width:1000px;margin:0 auto}\n"] }]
222
- }], ctorParameters: () => [{ type: i1.CommonService }, { type: i0.Injector }, { type: i1.ProductService }, { type: i2.DomSanitizer }, { type: i0.ChangeDetectorRef }] });
223
-
224
- class FaqDetailsComponent extends AppBaseComponent {
225
- constructor(commonService, injector, sanitizer, cdr) {
226
- super(injector);
227
- this.commonService = commonService;
228
- this.sanitizer = sanitizer;
229
- this.cdr = cdr;
230
- this.isLoading = false;
231
- this.routers = ADMIN_ROUTERS;
232
- /// Whether to offer the inline link through to the admin edit form.
233
- this.canEditFaq = false;
234
- /// Numeric id for the admin edit route, or null when none can be resolved.
235
- this.editFaqId = null;
236
- this.faqRef = this.route.snapshot.params['id'];
237
- this.slug = PermissionService.selectedSubscription?.slug;
238
- }
239
- ngOnInit() {
240
- this.getFaq();
241
- }
242
- getFaq() {
243
- this.isLoading = true;
244
- this.commonService
245
- .getPublicFaqById(this.faqRef)
246
- .subscribe(res => {
247
- let faqAnswer;
248
- if (res?.answer) {
249
- const parser = new DOMParser();
250
- const doc = parser.parseFromString(res.answer, 'text/html');
251
- // Remove all button elements
252
- const buttons = doc.querySelectorAll('button');
253
- buttons.forEach(button => button.remove());
254
- // Return sanitized HTML
255
- // NOSONAR: Trusted HTML content is handled safely here
256
- faqAnswer = this.sanitizer.bypassSecurityTrustHtml(doc.body.innerHTML); // NOSONAR
257
- }
258
- this.faq = { ...res, answer: faqAnswer };
259
- // Only offer the edit affordance once a FAQ actually resolved —
260
- // a miss still leaves `faq` truthy (spreading null yields
261
- // `{answer: undefined}`), so key off the question itself.
262
- const loaded = !!res?.question;
263
- this.canEditFaq =
264
- loaded && this.permissionService.evaluatePermissions(FAQ_ADMIN_PERMISSION);
265
- this.editFaqId = loaded ? this.resolveEditFaqId(res) : null;
266
- this.cdr.markForCheck();
267
- })
268
- .add(() => {
269
- this.isLoading = false;
270
- this.cdr.markForCheck();
271
- });
272
- }
273
- /// The admin edit route resolves a NUMERIC id (`+params['id'] || 0` in
274
- /// `AddEditFaqComponent`), but this page is reachable by slug too and the
275
- /// public endpoint does not return the id at all — main-api's
276
- /// `FaqHelpers#faq_attributes_to_return` whitelists `slug`, not `id`. So
277
- /// prefer a payload id if one ever appears, then fall back to the route
278
- /// param only when it is already numeric. Returning null hides the link
279
- /// rather than opening the admin form in "add a new FAQ" mode.
280
- resolveEditFaqId(faq) {
281
- const fromPayload = Number(faq?.id);
282
- if (Number.isInteger(fromPayload) && fromPayload > 0) {
283
- return fromPayload;
284
- }
285
- const fromRoute = Number(this.faqRef);
286
- return Number.isInteger(fromRoute) && fromRoute > 0 ? fromRoute : null;
287
- }
288
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: FaqDetailsComponent, deps: [{ token: i1.CommonService }, { token: i0.Injector }, { token: i2.DomSanitizer }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
289
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.19", type: FaqDetailsComponent, isStandalone: false, selector: "pw-faq-details", usesInheritance: true, ngImport: i0, template: "@if (!isLoading) {\n <div class=\"content-quill-wrapper overflow-hidden mt-5 p-3\">\n <div class=\"content-quill-box\">\n <h2 class=\"mb-3\">\n {{faq?.question}}\n @if (canEditFaq && editFaqId) {\n <a class=\"faq-edit-link ms-3\"\n [pTooltip]=\"'Admin.Faq.EditTitle' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n [attr.aria-label]=\"'Admin.Faq.EditTitle' | transloco\"\n [routerLink]=\"[routers.faqDetails + editFaqId]\"\n target=\"_blank\">\n <i class=\"fa fa-edit edit-icon\" aria-hidden=\"true\"></i>\n </a>\n }\n </h2>\n <ng-container>\n <div class=\"ql-container ql-snow no-border\">\n <div class=\"ql-editor\"\n [innerHTML]=\"faq?.answer\">\n </div>\n </div>\n </ng-container>\n </div>\n @if (!faq && !isLoading) {\n <pw-no-data\n message=\"No Faq found\">\n </pw-no-data>\n }\n <div class=\"text-end mt-3\">\n <button class=\"btn btn-outline-primary\"\n [routerLink]=\"['/',slug,'faq']\">See all FAQs</button>\n </div>\n </div>\n}\n@if (isLoading) {\n <div class=\"w-100 text-center mt-3\"\n >\n <p-progressSpinner strokeWidth=\"2\"> </p-progressSpinner>\n </div>\n}\n", styles: [".ql-container{resize:none!important}.faq-edit-link{text-decoration:none;vertical-align:middle}.faq-edit-link .edit-icon{font-size:16px}\n"], dependencies: [{ kind: "directive", type: i1$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: i3.ProgressSpinner, selector: "p-progressSpinner, p-progress-spinner, p-progressspinner", inputs: ["styleClass", "strokeWidth", "fill", "animationDuration", "ariaLabel"] }, { kind: "directive", type: i5.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip", "pTooltipPT", "pTooltipUnstyled"] }, { kind: "component", type: i4.NoDataComponent, selector: "pw-no-data", inputs: ["message", "description", "withImage"] }, { kind: "pipe", type: i7.TranslocoPipe, name: "transloco" }] }); }
290
- }
291
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: FaqDetailsComponent, decorators: [{
292
- type: Component,
293
- args: [{ selector: 'pw-faq-details', standalone: false, template: "@if (!isLoading) {\n <div class=\"content-quill-wrapper overflow-hidden mt-5 p-3\">\n <div class=\"content-quill-box\">\n <h2 class=\"mb-3\">\n {{faq?.question}}\n @if (canEditFaq && editFaqId) {\n <a class=\"faq-edit-link ms-3\"\n [pTooltip]=\"'Admin.Faq.EditTitle' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n [attr.aria-label]=\"'Admin.Faq.EditTitle' | transloco\"\n [routerLink]=\"[routers.faqDetails + editFaqId]\"\n target=\"_blank\">\n <i class=\"fa fa-edit edit-icon\" aria-hidden=\"true\"></i>\n </a>\n }\n </h2>\n <ng-container>\n <div class=\"ql-container ql-snow no-border\">\n <div class=\"ql-editor\"\n [innerHTML]=\"faq?.answer\">\n </div>\n </div>\n </ng-container>\n </div>\n @if (!faq && !isLoading) {\n <pw-no-data\n message=\"No Faq found\">\n </pw-no-data>\n }\n <div class=\"text-end mt-3\">\n <button class=\"btn btn-outline-primary\"\n [routerLink]=\"['/',slug,'faq']\">See all FAQs</button>\n </div>\n </div>\n}\n@if (isLoading) {\n <div class=\"w-100 text-center mt-3\"\n >\n <p-progressSpinner strokeWidth=\"2\"> </p-progressSpinner>\n </div>\n}\n", styles: [".ql-container{resize:none!important}.faq-edit-link{text-decoration:none;vertical-align:middle}.faq-edit-link .edit-icon{font-size:16px}\n"] }]
294
- }], ctorParameters: () => [{ type: i1.CommonService }, { type: i0.Injector }, { type: i2.DomSanitizer }, { type: i0.ChangeDetectorRef }] });
295
-
296
- class UserFeedbackComponent extends AppBaseComponent {
297
- constructor(injector, commonService, cdr) {
298
- super(injector);
299
- this.commonService = commonService;
300
- this.cdr = cdr;
301
- this.rating = 3;
302
- this.selectedValue = null;
303
- this.questions = [];
304
- this.counter = Array;
305
- this.showSection = true;
306
- }
307
- ngOnInit() {
308
- this.subscriptionId = PermissionService.selectedSubscription?.id;
309
- this.getFeedbackQuestions();
310
- this.userService.getUserInfo().subscribe({
311
- next: user => {
312
- this.user = user;
313
- this.cdr.markForCheck();
314
- }
315
- });
316
- this.checkFeedBackExpiry();
317
- }
318
- checkFeedBackExpiry() {
319
- const item = localStorage.getItem('showFeedBack');
320
- if (item) {
321
- const currentDate = Date.now();
322
- const expiryDate = new Date(JSON.parse(item)).getTime();
323
- this.showSection = currentDate > expiryDate;
324
- }
325
- }
326
- closeSection() {
327
- this.showSection = false;
328
- const addedTime = moment(new Date()).add(7, 'days').toDate();
329
- localStorage.setItem('showFeedBack', JSON.stringify(addedTime));
330
- }
331
- getFeedbackQuestions() {
332
- if (this.subscriptionId) {
333
- this.commonService.feedbackQuestions(this.subscriptionId).subscribe(res => {
334
- this.questions = res;
335
- this.cdr.markForCheck();
336
- });
337
- }
338
- }
339
- onSubmit(questionId, formValue) {
340
- if (formValue?.feedback) {
341
- const data = {
342
- subscription_id: this.subscriptionId,
343
- feedback_question_id: questionId,
344
- value: Number(formValue?.feedback),
345
- comment: formValue?.description
346
- };
347
- this.commonService.userFeedbacks(data).subscribe(() => {
348
- this.getFeedbackQuestions();
349
- this.cdr.markForCheck();
350
- });
351
- }
352
- }
353
- trackByQuestion(_index, item) {
354
- return item.id;
355
- }
356
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: UserFeedbackComponent, deps: [{ token: i0.Injector }, { token: i1.CommonService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
357
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.19", type: UserFeedbackComponent, isStandalone: false, selector: "pw-user-feedback", usesInheritance: true, ngImport: i0, template: "@if (showSection) {\n @if (questions?.length) {\n <div class=\"mt-4\"\n >\n <div class=\"card pb-1\">\n <h3 class=\"text-end me-3 pt-2 cursor-pointer\"\n (keydown.enter)=\"closeSection()\"\n (click)=\"closeSection()\">&times;</h3>\n @for (question of questions; track trackByQuestion($index, question); let first = $first) {\n <div class=\"card-content p-0\"\n >\n <div class=\"card-header\">\n <form #feedbackForm=\"ngForm\">\n <div class=\"col-lg-8 p-0 mx-auto\">\n @if (first) {\n <h3 class=\"mb-1\"\n >Your input is valuable to us</h3>\n }\n @if (first) {\n <p class=\"mb-4\"\n >\n Please take a moment to answer these questions\n </p>\n }\n <h6 class=\"fw-bold pb-3 mx-auto\">{{ question?.question }}</h6>\n <div class=\"text-center row p-2 mx-md-2 feedback-value\">\n <span class=\"col-auto me-0\">Not at all</span>\n @for (val of counter(11); track val; let i = $index) {\n <div class=\"p-field-checkbox col-auto ms-0 me-0\">\n <p-radioButton name=\"feedback\" [(ngModel)]=\"selectedValue\" [value]=\"i\" [inputId]=\"i\"></p-radioButton>\n <br />\n <label [for]=\"i\">{{ i }}</label>\n </div>\n }\n <span class=\"col-auto ms-0\">Extremely</span>\n </div>\n <div class=\"text mt-3\">\n <h6>Can you tell us the reason for your score? Do you have any particular features you want us to build or fix?</h6>\n <label for=\"user-feedback-description\" class=\"visually-hidden\">Reason for your score</label>\n <textarea id=\"user-feedback-description\"\n rows=\"4\"\n name=\"description\"\n placeholder=\"\u201CWhat is the primary reason for your score?\u201D\"\n ngModel\n type=\"text\"\n pInputTextarea\n class=\"form-control\"\n aria-label=\"\u201CWhat is the primary reason for your score?\u201D\">\n </textarea>\n </div>\n <div class=\"mt-3\">\n <button class=\"btn btn-primary d-block mx-auto\"\n (click)=\"onSubmit(question?.id, feedbackForm.value)\">\n Submit\n </button>\n </div>\n </div>\n </form>\n </div>\n </div>\n }\n </div>\n </div>\n }\n}\n", styles: ["::ng-deep .p-radiobutton-checked .p-radiobutton-box{border-color:var(--first)!important;background:var(--first)!important}.feedback-value{justify-content:center}.feedback-value label{color:#000000de;cursor:pointer;font-size:1rem;font-weight:400;letter-spacing:normal;margin-left:10px;margin-right:10px;text-transform:none}.feedback-value .p-field-checkbox{margin:0 10px}\n"], dependencies: [{ kind: "directive", type: i2$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2$1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]):not([formArray]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i3$1.RadioButton, selector: "p-radioButton, p-radiobutton, p-radio-button", inputs: ["value", "tabindex", "inputId", "ariaLabelledBy", "ariaLabel", "styleClass", "autofocus", "binary", "variant", "size"], outputs: ["onClick", "onFocus", "onBlur"] }] }); }
358
- }
359
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: UserFeedbackComponent, decorators: [{
360
- type: Component,
361
- args: [{ selector: 'pw-user-feedback', standalone: false, template: "@if (showSection) {\n @if (questions?.length) {\n <div class=\"mt-4\"\n >\n <div class=\"card pb-1\">\n <h3 class=\"text-end me-3 pt-2 cursor-pointer\"\n (keydown.enter)=\"closeSection()\"\n (click)=\"closeSection()\">&times;</h3>\n @for (question of questions; track trackByQuestion($index, question); let first = $first) {\n <div class=\"card-content p-0\"\n >\n <div class=\"card-header\">\n <form #feedbackForm=\"ngForm\">\n <div class=\"col-lg-8 p-0 mx-auto\">\n @if (first) {\n <h3 class=\"mb-1\"\n >Your input is valuable to us</h3>\n }\n @if (first) {\n <p class=\"mb-4\"\n >\n Please take a moment to answer these questions\n </p>\n }\n <h6 class=\"fw-bold pb-3 mx-auto\">{{ question?.question }}</h6>\n <div class=\"text-center row p-2 mx-md-2 feedback-value\">\n <span class=\"col-auto me-0\">Not at all</span>\n @for (val of counter(11); track val; let i = $index) {\n <div class=\"p-field-checkbox col-auto ms-0 me-0\">\n <p-radioButton name=\"feedback\" [(ngModel)]=\"selectedValue\" [value]=\"i\" [inputId]=\"i\"></p-radioButton>\n <br />\n <label [for]=\"i\">{{ i }}</label>\n </div>\n }\n <span class=\"col-auto ms-0\">Extremely</span>\n </div>\n <div class=\"text mt-3\">\n <h6>Can you tell us the reason for your score? Do you have any particular features you want us to build or fix?</h6>\n <label for=\"user-feedback-description\" class=\"visually-hidden\">Reason for your score</label>\n <textarea id=\"user-feedback-description\"\n rows=\"4\"\n name=\"description\"\n placeholder=\"\u201CWhat is the primary reason for your score?\u201D\"\n ngModel\n type=\"text\"\n pInputTextarea\n class=\"form-control\"\n aria-label=\"\u201CWhat is the primary reason for your score?\u201D\">\n </textarea>\n </div>\n <div class=\"mt-3\">\n <button class=\"btn btn-primary d-block mx-auto\"\n (click)=\"onSubmit(question?.id, feedbackForm.value)\">\n Submit\n </button>\n </div>\n </div>\n </form>\n </div>\n </div>\n }\n </div>\n </div>\n }\n}\n", styles: ["::ng-deep .p-radiobutton-checked .p-radiobutton-box{border-color:var(--first)!important;background:var(--first)!important}.feedback-value{justify-content:center}.feedback-value label{color:#000000de;cursor:pointer;font-size:1rem;font-weight:400;letter-spacing:normal;margin-left:10px;margin-right:10px;text-transform:none}.feedback-value .p-field-checkbox{margin:0 10px}\n"] }]
362
- }], ctorParameters: () => [{ type: i0.Injector }, { type: i1.CommonService }, { type: i0.ChangeDetectorRef }] });
363
-
364
- class HomeComponent extends AppBaseComponent {
365
- constructor(injector, hopscotchService, cdr) {
366
- super(injector);
367
- this.hopscotchService = hopscotchService;
368
- this.cdr = cdr;
369
- this.componentActive = true;
370
- }
371
- sanitizeContent(jsonString) {
372
- let sanitizedString = jsonString.replaceAll("'", '"');
373
- sanitizedString = sanitizedString.replace(/<img\s+src="([^"]+)"/g, String.raw `<img src=\"$1\"`);
374
- sanitizedString = sanitizedString.replace(/,\s*([}\]])/g, '$1');
375
- return sanitizedString;
376
- }
377
- ngOnInit() {
378
- this.selectedSubscriptionSlug = PermissionService.selectedSubscription?.slug;
379
- this.subscriptionId = PermissionService.selectedSubscription?.id;
380
- this.userStore().subscribe(state => {
381
- if (state) {
382
- this.userService.getCurrentUserObject('active_tips').subscribe(response => {
383
- if (response?.length) {
384
- const welcomeTips = response.find(x => x.name === 'welcome');
385
- if (welcomeTips) {
386
- const steps = JSON.parse(this.sanitizeContent(welcomeTips.instructions)).steps;
387
- try {
388
- this.hopscotchService.initializeTour('dashboard', steps, {
389
- tip_id: welcomeTips.id,
390
- disregarded: true
391
- }, this.subscriptionId);
392
- }
393
- catch (error) {
394
- console.error('Error parsing JSON:', error);
395
- }
396
- }
397
- }
398
- this.cdr.markForCheck();
399
- });
400
- }
401
- this.cdr.markForCheck();
402
- });
403
- this.userStore().subscribe({
404
- next: user => {
405
- this.user = user;
406
- if (this.user) {
407
- this.userSlug = user.slug;
408
- }
409
- this.cdr.markForCheck();
410
- },
411
- error: error => {
412
- this.toast.showToast(error);
413
- this.cdr.markForCheck();
414
- }
415
- });
416
- }
417
- ngOnDestroy() {
418
- this.hopscotchService.endTour();
419
- super.ngOnDestroy();
420
- }
421
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: HomeComponent, deps: [{ token: i0.Injector }, { token: i1.HopscotchService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
422
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.19", type: HomeComponent, isStandalone: false, selector: "pw-home", usesInheritance: true, ngImport: i0, template: "<pw-user-feedback></pw-user-feedback>\n<div class=\"row mt-3\">\n <div class=\"col-12 col-lg-6 mt-2 mb-4\">\n <div class=\"card\">\n <div class=\"card-content p-0\">\n <div class=\"card-header d-flex mt-0\">\n <div class=\"w-100\">\n <div id=\"cards\"></div>\n <h3 class=\"mb-3\">{{'ManageYourAccount'|transloco}}</h3>\n <p>{{'ManageYourAccountDescription'|transloco}}</p>\n </div>\n <div class=\"ms-3 img-wrapper\">\n <img src=\"assets/img/products/hyper-dashboard/ManageYourAccount.png\"\n alt=\"img\"\n class=\"img-fluid\" />\n </div>\n </div>\n <div class=\"card-footer px-3\">\n <a routerLink=\"/account/details\"\n class=\"d-block\">{{'ManageYourAccount'|transloco}}</a>\n </div>\n <div id=\"tips-onboarding-step2\"></div>\n </div>\n </div>\n </div>\n <div class=\"col-12 col-lg-6 mt-2 mb-4\">\n <div class=\"card\">\n <div class=\"card-content p-0\">\n <div class=\"card-header d-flex mt-0\">\n <div class=\"w-100\">\n <h3 class=\"mb-3\">{{'UpdateYourProfile'|transloco}}</h3>\n <p>{{'UpdateYourProfileDescription'|transloco}}</p>\n </div>\n <div class=\"ms-3 img-wrapper\">\n <img src=\"assets/img/products/hyper-dashboard/UpdateYourProfile.png\"\n alt=\"img\"\n class=\"img-fluid\" />\n </div>\n </div>\n <div class=\"card-footer px-3\">\n <a [routerLink]=\"['/members', userSlug]\"\n class=\"d-block\">{{'UpdateYourProfile'|transloco}}</a>\n </div>\n </div>\n </div>\n </div>\n <div class=\"col-12 col-lg-6 mt-2 mb-4\">\n <div class=\"card\">\n <div class=\"card-content p-0\">\n <div class=\"card-header d-flex mt-0\">\n <div class=\"w-100\">\n <h3 class=\"mb-3\">{{'CommunicationSettings'|transloco}}</h3>\n <p>\n {{'CommunicationSettingsDescription'|transloco}}\n </p>\n </div>\n <div class=\"ms-3 img-wrapper\">\n <img src=\"assets/img/products/hyper-dashboard/CommunicationSettings.png\"\n alt=\"img\"\n class=\"img-fluid\" />\n </div>\n </div>\n <div class=\"card-footer px-3\">\n <a routerLink=\"/settings/communication\"\n class=\"d-block\">{{'GotoCommunicationSettings'|transloco}}</a>\n </div>\n <div id=\"tips-onboarding-step3\"></div>\n </div>\n </div>\n </div>\n <div class=\"col-12 col-lg-6 mt-2 mb-4\">\n <div class=\"card\">\n <div class=\"card-content p-0\">\n <div class=\"card-header d-flex mt-0\">\n <div class=\"w-100\">\n <h3 class=\"mb-3\">{{'NeedHelp'|transloco}}</h3>\n <p>{{'NeedHelpDescription'|transloco}}</p>\n </div>\n <div class=\"ms-3 img-wrapper\">\n <img src=\"assets/img/products/hyper-dashboard/NeedHelp.png\"\n alt=\"img\"\n class=\"img-fluid\" />\n </div>\n </div>\n <div class=\"card-footer px-3\">\n <a [routerLink]=\"'/' + selectedSubscriptionSlug + '/faq'\"\n class=\"d-block\">{{'SeeAllOurFaq'|transloco}}</a>\n </div>\n <div id=\"tips-onboarding-step4\"></div>\n </div>\n </div>\n </div>\n</div>\n", styles: ["::ng-deep .hopscotch-title{text-align:center!important;margin-bottom:20px!important}::ng-deep .hopscotch-title h2{margin:0}::ng-deep .hopscotch-content{text-align:center;padding:20px;margin:0!important}::ng-deep .hopscotch-content img{width:150px;margin:20px 0}::ng-deep .hopscotch-content p{font-size:16px;color:#555}::ng-deep .hopscotch-step-title{text-align:left;margin-bottom:15px}::ng-deep .hopscotch-step-content{padding:20px;text-align:left!important}::ng-deep .hopscotch-step-content p{font-size:14px;color:#555;margin-bottom:10px;text-align:left!important}\n"], dependencies: [{ kind: "directive", type: i1$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: UserFeedbackComponent, selector: "pw-user-feedback" }, { kind: "pipe", type: i7.TranslocoPipe, name: "transloco" }] }); }
423
- }
424
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: HomeComponent, decorators: [{
425
- type: Component,
426
- args: [{ selector: 'pw-home', standalone: false, template: "<pw-user-feedback></pw-user-feedback>\n<div class=\"row mt-3\">\n <div class=\"col-12 col-lg-6 mt-2 mb-4\">\n <div class=\"card\">\n <div class=\"card-content p-0\">\n <div class=\"card-header d-flex mt-0\">\n <div class=\"w-100\">\n <div id=\"cards\"></div>\n <h3 class=\"mb-3\">{{'ManageYourAccount'|transloco}}</h3>\n <p>{{'ManageYourAccountDescription'|transloco}}</p>\n </div>\n <div class=\"ms-3 img-wrapper\">\n <img src=\"assets/img/products/hyper-dashboard/ManageYourAccount.png\"\n alt=\"img\"\n class=\"img-fluid\" />\n </div>\n </div>\n <div class=\"card-footer px-3\">\n <a routerLink=\"/account/details\"\n class=\"d-block\">{{'ManageYourAccount'|transloco}}</a>\n </div>\n <div id=\"tips-onboarding-step2\"></div>\n </div>\n </div>\n </div>\n <div class=\"col-12 col-lg-6 mt-2 mb-4\">\n <div class=\"card\">\n <div class=\"card-content p-0\">\n <div class=\"card-header d-flex mt-0\">\n <div class=\"w-100\">\n <h3 class=\"mb-3\">{{'UpdateYourProfile'|transloco}}</h3>\n <p>{{'UpdateYourProfileDescription'|transloco}}</p>\n </div>\n <div class=\"ms-3 img-wrapper\">\n <img src=\"assets/img/products/hyper-dashboard/UpdateYourProfile.png\"\n alt=\"img\"\n class=\"img-fluid\" />\n </div>\n </div>\n <div class=\"card-footer px-3\">\n <a [routerLink]=\"['/members', userSlug]\"\n class=\"d-block\">{{'UpdateYourProfile'|transloco}}</a>\n </div>\n </div>\n </div>\n </div>\n <div class=\"col-12 col-lg-6 mt-2 mb-4\">\n <div class=\"card\">\n <div class=\"card-content p-0\">\n <div class=\"card-header d-flex mt-0\">\n <div class=\"w-100\">\n <h3 class=\"mb-3\">{{'CommunicationSettings'|transloco}}</h3>\n <p>\n {{'CommunicationSettingsDescription'|transloco}}\n </p>\n </div>\n <div class=\"ms-3 img-wrapper\">\n <img src=\"assets/img/products/hyper-dashboard/CommunicationSettings.png\"\n alt=\"img\"\n class=\"img-fluid\" />\n </div>\n </div>\n <div class=\"card-footer px-3\">\n <a routerLink=\"/settings/communication\"\n class=\"d-block\">{{'GotoCommunicationSettings'|transloco}}</a>\n </div>\n <div id=\"tips-onboarding-step3\"></div>\n </div>\n </div>\n </div>\n <div class=\"col-12 col-lg-6 mt-2 mb-4\">\n <div class=\"card\">\n <div class=\"card-content p-0\">\n <div class=\"card-header d-flex mt-0\">\n <div class=\"w-100\">\n <h3 class=\"mb-3\">{{'NeedHelp'|transloco}}</h3>\n <p>{{'NeedHelpDescription'|transloco}}</p>\n </div>\n <div class=\"ms-3 img-wrapper\">\n <img src=\"assets/img/products/hyper-dashboard/NeedHelp.png\"\n alt=\"img\"\n class=\"img-fluid\" />\n </div>\n </div>\n <div class=\"card-footer px-3\">\n <a [routerLink]=\"'/' + selectedSubscriptionSlug + '/faq'\"\n class=\"d-block\">{{'SeeAllOurFaq'|transloco}}</a>\n </div>\n <div id=\"tips-onboarding-step4\"></div>\n </div>\n </div>\n </div>\n</div>\n", styles: ["::ng-deep .hopscotch-title{text-align:center!important;margin-bottom:20px!important}::ng-deep .hopscotch-title h2{margin:0}::ng-deep .hopscotch-content{text-align:center;padding:20px;margin:0!important}::ng-deep .hopscotch-content img{width:150px;margin:20px 0}::ng-deep .hopscotch-content p{font-size:16px;color:#555}::ng-deep .hopscotch-step-title{text-align:left;margin-bottom:15px}::ng-deep .hopscotch-step-content{padding:20px;text-align:left!important}::ng-deep .hopscotch-step-content p{font-size:14px;color:#555;margin-bottom:10px;text-align:left!important}\n"] }]
427
- }], ctorParameters: () => [{ type: i0.Injector }, { type: i1.HopscotchService }, { type: i0.ChangeDetectorRef }] });
428
-
429
- class CurrentNotificationsComponent {
430
- constructor(notificationService, cdr) {
431
- this.notificationService = notificationService;
432
- this.cdr = cdr;
433
- this.notificationCount = 0;
434
- this.noNoti = true;
435
- this.itemsPerPage = 100;
436
- this.notifications = [];
437
- this.currentPage = 1;
438
- this.isLoaded = false;
439
- this.totalPages = 1;
440
- this.totalRecords = 0;
441
- }
442
- ngOnInit() {
443
- this.getNotifications();
444
- }
445
- getNotifications() {
446
- this.notificationService
447
- .getNotifications({ page: this.currentPage, page_size: this.itemsPerPage })
448
- .subscribe(data => {
449
- if (Array.isArray(data?.notes) && data?.notes?.length > 0) {
450
- this.totalRecords = data.unfiltered_count;
451
- this.notifications = data.notes?.filter(note => !note.dismissed && note.show_on_dashboard);
452
- this.totalPages = Math.ceil(data.unfiltered_count / this.itemsPerPage);
453
- this.noNoti = true;
454
- if (this.notifications?.length) {
455
- this.noNoti = false;
456
- }
457
- }
458
- this.cdr.markForCheck();
459
- })
460
- .add(() => {
461
- this.isLoaded = true;
462
- this.cdr.markForCheck();
463
- });
464
- }
465
- nextPage() {
466
- if (this.currentPage < this.totalPages) {
467
- this.currentPage++;
468
- this.getNotifications();
469
- }
470
- }
471
- previousPage() {
472
- if (this.currentPage > 1) {
473
- this.currentPage--;
474
- this.getNotifications();
475
- }
476
- }
477
- dismiss(id, e) {
478
- this.notificationService.dismissNotification(id).subscribe(() => {
479
- // Remove notification from notification array
480
- const index = this.notifications.indexOf(e);
481
- this.notifications.splice(index, 1);
482
- if (this.notifications.length === 0) {
483
- this.noNoti = true;
484
- }
485
- this.cdr.markForCheck();
486
- $('#noty').slideUp('slow', () => {
487
- $('#noty').remove();
488
- });
489
- });
490
- }
491
- trackByNotification(_index, item) {
492
- return item.id;
493
- }
494
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: CurrentNotificationsComponent, deps: [{ token: i1.NotificationService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
495
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.19", type: CurrentNotificationsComponent, isStandalone: false, selector: "pw-current-notifications", ngImport: i0, template: "<div class=\"row main-div\">\n <div class=\"w-100 text-center mt-3\">\n @if (!isLoaded) {\n <p-progressSpinner strokeWidth=\"2\"> </p-progressSpinner>\n }\n </div>\n @if (notifications?.length && isLoaded) {\n <div class=\"col-12 col-sm-12 col-md-12 mb-5\"\n >\n <div class=\"card\">\n <div class=\"card-body\">\n <ul class=\"noti-list\">\n @for (item of notifications; track trackByNotification($index, item)) {\n <li\n class=\"p-3 border-bottom border-bottom-blue-grey border-bottom-lighten-4 d-flex align-items-center\">\n <span class=\"btn btn-circle me-2\"\n [ngClass]=\"{\n 'btn-danger': item.note_type === 'administrative',\n 'btn-secondary': item.note_type === 'object_event',\n 'btn-primary': item.note_type === 'user_generated'\n }\">\n <i\n class=\"fal float-start\"\n [ngClass]=\"{\n 'fa-bell': item.note_type === 'administrative',\n 'fa-share-alt': item.note_type === 'object_event',\n 'fa-bells': item.note_type === 'user_generated'\n }\"\n aria-hidden=\"true\"\n ></i>\n </span>\n <span class=\"d-inline-block noty-body\">\n <span class=\"noti-title line-height-1p5 d-block text-bold-400\">{{\n item.content\n }}</span>\n <span class=\"noti-text\"><span class=\"fal fa-clock\"></span>\n {{ item?.created_at | sinceAgo }}</span>\n </span>\n <span class=\"noti-buttons\">\n <button class=\"btn float-end\">\n <i\n class=\"far fa-trash-alt\"\n (click)=\"dismiss(item.id, item)\"\n (keydown.enter)=\"dismiss(item.id, item)\"\n aria-hidden=\"true\"\n ></i>\n </button>\n </span>\n </li>\n }\n </ul>\n </div>\n <div class=\"pagination-container d-flex justify-content-between align-items-center mt-3 mb-3\">\n <pw-records-summary [showing]=\"totalRecords\" [total]=\"totalRecords\" />\n <div class=\"d-flex align-items-center\">\n <button class=\"btn btn-outline-primary me-2\" (click)=\"previousPage()\" [disabled]=\"currentPage === 1\">\n <i class=\"fas fa-chevron-left\"></i>\n </button>\n <span>Page {{ currentPage }} of {{ totalPages }}</span>\n <button class=\"btn btn-outline-primary ms-2\" (click)=\"nextPage()\" [disabled]=\"currentPage === totalPages\">\n <i class=\"fas fa-chevron-right\"></i>\n </button>\n </div>\n </div>\n </div>\n </div>\n}\n\n@if (noNoti && isLoaded) {\n <div class=\"col-12 col-sm-12 col-md-12\"\n >\n <pw-no-data [withImage]=\"true\" message=\"You are all caught up\" description=\"You currently do not have any notifications.\">\n </pw-no-data>\n </div>\n}\n</div>\n", styles: [".icon-dismiss{position:relative;right:15px;top:30px;z-index:9}.noti-list{overflow-x:hidden!important}.noti-buttons{flex:auto}.main-div{padding:0 20px}.card{padding-bottom:0}@media screen and (max-width:480px){.noty-body{width:240px}}.pagination-container{padding:0 1rem}\n"], dependencies: [{ kind: "directive", type: i2$2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: i3.ProgressSpinner, selector: "p-progressSpinner, p-progress-spinner, p-progressspinner", inputs: ["styleClass", "strokeWidth", "fill", "animationDuration", "ariaLabel"] }, { kind: "component", type: i4.NoDataComponent, selector: "pw-no-data", inputs: ["message", "description", "withImage"] }, { kind: "component", type: i4.RecordsSummaryComponent, selector: "pw-records-summary", inputs: ["showing", "total"] }, { kind: "pipe", type: i5$1.SinceAgoPipe, name: "sinceAgo" }] }); }
496
- }
497
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: CurrentNotificationsComponent, decorators: [{
498
- type: Component,
499
- args: [{ selector: 'pw-current-notifications', standalone: false, template: "<div class=\"row main-div\">\n <div class=\"w-100 text-center mt-3\">\n @if (!isLoaded) {\n <p-progressSpinner strokeWidth=\"2\"> </p-progressSpinner>\n }\n </div>\n @if (notifications?.length && isLoaded) {\n <div class=\"col-12 col-sm-12 col-md-12 mb-5\"\n >\n <div class=\"card\">\n <div class=\"card-body\">\n <ul class=\"noti-list\">\n @for (item of notifications; track trackByNotification($index, item)) {\n <li\n class=\"p-3 border-bottom border-bottom-blue-grey border-bottom-lighten-4 d-flex align-items-center\">\n <span class=\"btn btn-circle me-2\"\n [ngClass]=\"{\n 'btn-danger': item.note_type === 'administrative',\n 'btn-secondary': item.note_type === 'object_event',\n 'btn-primary': item.note_type === 'user_generated'\n }\">\n <i\n class=\"fal float-start\"\n [ngClass]=\"{\n 'fa-bell': item.note_type === 'administrative',\n 'fa-share-alt': item.note_type === 'object_event',\n 'fa-bells': item.note_type === 'user_generated'\n }\"\n aria-hidden=\"true\"\n ></i>\n </span>\n <span class=\"d-inline-block noty-body\">\n <span class=\"noti-title line-height-1p5 d-block text-bold-400\">{{\n item.content\n }}</span>\n <span class=\"noti-text\"><span class=\"fal fa-clock\"></span>\n {{ item?.created_at | sinceAgo }}</span>\n </span>\n <span class=\"noti-buttons\">\n <button class=\"btn float-end\">\n <i\n class=\"far fa-trash-alt\"\n (click)=\"dismiss(item.id, item)\"\n (keydown.enter)=\"dismiss(item.id, item)\"\n aria-hidden=\"true\"\n ></i>\n </button>\n </span>\n </li>\n }\n </ul>\n </div>\n <div class=\"pagination-container d-flex justify-content-between align-items-center mt-3 mb-3\">\n <pw-records-summary [showing]=\"totalRecords\" [total]=\"totalRecords\" />\n <div class=\"d-flex align-items-center\">\n <button class=\"btn btn-outline-primary me-2\" (click)=\"previousPage()\" [disabled]=\"currentPage === 1\">\n <i class=\"fas fa-chevron-left\"></i>\n </button>\n <span>Page {{ currentPage }} of {{ totalPages }}</span>\n <button class=\"btn btn-outline-primary ms-2\" (click)=\"nextPage()\" [disabled]=\"currentPage === totalPages\">\n <i class=\"fas fa-chevron-right\"></i>\n </button>\n </div>\n </div>\n </div>\n </div>\n}\n\n@if (noNoti && isLoaded) {\n <div class=\"col-12 col-sm-12 col-md-12\"\n >\n <pw-no-data [withImage]=\"true\" message=\"You are all caught up\" description=\"You currently do not have any notifications.\">\n </pw-no-data>\n </div>\n}\n</div>\n", styles: [".icon-dismiss{position:relative;right:15px;top:30px;z-index:9}.noti-list{overflow-x:hidden!important}.noti-buttons{flex:auto}.main-div{padding:0 20px}.card{padding-bottom:0}@media screen and (max-width:480px){.noty-body{width:240px}}.pagination-container{padding:0 1rem}\n"] }]
500
- }], ctorParameters: () => [{ type: i1.NotificationService }, { type: i0.ChangeDetectorRef }] });
501
-
502
- class DismissedNotificationsComponent {
503
- constructor(notificationService, cdr) {
504
- this.notificationService = notificationService;
505
- this.cdr = cdr;
506
- this.notificationCount = 0;
507
- this.noNoti = true;
508
- this.dismissedNotifications = [];
509
- this.isLoaded = false;
510
- this.itemsPerPage = 100;
511
- this.currentPage = 1;
512
- this.totalPages = 1;
513
- this.totalRecords = 0;
514
- }
515
- ngOnInit() {
516
- this.getNotifications();
517
- }
518
- getNotifications() {
519
- this.notificationService
520
- .getDismissedNotifications({ page: this.currentPage, page_size: this.itemsPerPage })
521
- .subscribe(data => {
522
- if (Array.isArray(data?.notes) && data?.notes?.length > 0) {
523
- this.noNoti = false;
524
- this.dismissedNotifications = data?.notes;
525
- this.totalRecords = data?.unfiltered_count;
526
- this.totalPages = Math.ceil(data.unfiltered_count / this.itemsPerPage);
527
- }
528
- this.cdr.markForCheck();
529
- })
530
- .add(() => {
531
- this.isLoaded = true;
532
- this.cdr.markForCheck();
533
- });
534
- }
535
- nextPage() {
536
- if (this.currentPage < this.totalPages) {
537
- this.currentPage++;
538
- this.getNotifications();
539
- }
540
- }
541
- previousPage() {
542
- if (this.currentPage > 1) {
543
- this.currentPage--;
544
- this.getNotifications();
545
- }
546
- }
547
- dismiss(id, e) {
548
- HelperService.raiseDeletePopup().then(res => {
549
- if (res.value) {
550
- this.notificationService.deleteNotifications(id).subscribe(() => {
551
- // Remove notification from notification array
552
- const index = this.dismissedNotifications.indexOf(e);
553
- this.dismissedNotifications.splice(index, 1);
554
- if (this.dismissedNotifications.length === 0) {
555
- this.noNoti = true;
556
- }
557
- this.cdr.markForCheck();
558
- $('#noty').slideUp('slow', () => {
559
- $('#noty').remove();
560
- });
561
- });
562
- }
563
- });
564
- }
565
- restoreNotification(id, e) {
566
- this.notificationService.reinstateNotification(id).subscribe(() => {
567
- // Remove notification from dismissed notification array
568
- const index = this.dismissedNotifications.indexOf(e);
569
- this.dismissedNotifications.splice(index, 1);
570
- if (this.dismissedNotifications.length === 0) {
571
- this.noNoti = true;
572
- }
573
- this.cdr.markForCheck();
574
- $('#noty').slideUp('slow', () => {
575
- $('#noty').remove();
576
- });
577
- });
578
- }
579
- trackByNotification(_index, item) {
580
- return item.id;
581
- }
582
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: DismissedNotificationsComponent, deps: [{ token: i1.NotificationService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
583
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.19", type: DismissedNotificationsComponent, isStandalone: false, selector: "pw-dismissed-notifications", ngImport: i0, template: "<div class=\"row main-div\">\n <div class=\"w-100 text-center mt-3\">\n @if (!isLoaded) {\n <p-progressSpinner strokeWidth=\"2\"> </p-progressSpinner>\n }\n </div>\n @if (dismissedNotifications?.length && isLoaded) {\n <div class=\"col-12 col-sm-12 col-md-12 mb-5\"\n >\n <div class=\"card\">\n <div class=\"card-body\">\n <ul class=\"noti-list\">\n @for (item of dismissedNotifications; track trackByNotification($index, item)) {\n <li\n class=\"p-3 border-bottom border-bottom-blue-grey border-bottom-lighten-4 d-flex align-items-center\">\n <span class=\"btn btn-circle me-2\"\n [ngClass]=\"{\n 'btn-danger': item.note_type === 'administrative',\n 'btn-secondary': item.note_type === 'object_event',\n 'btn-primary': item.note_type === 'user_generated'\n }\">\n <i\n class=\"fal float-start\"\n [ngClass]=\"{\n 'fa-bell': item.note_type === 'administrative',\n 'fa-share-alt': item.note_type === 'object_event',\n 'fa-bells': item.note_type === 'user_generated'\n }\"\n aria-hidden=\"true\"\n ></i>\n </span>\n <span class=\"d-inline-block noty-body\">\n <span class=\"noti-title line-height-1p5 d-block text-bold-400\">{{\n item.content\n }}</span>\n <span class=\"noti-text\"><span class=\"fal fa-clock\"></span>\n {{ item?.created_at | sinceAgo }}</span>\n </span>\n <span class=\"noti-buttons\">\n <button class=\"btn float-end\">\n <i\n class=\"far fa-trash-alt\"\n (click)=\"dismiss(item.id, item)\"\n (keydown.enter)=\"dismiss(item.id, item)\"\n aria-hidden=\"true\"\n ></i>\n </button>\n <button class=\"btn float-end\">\n <i\n class=\"fas fa-trash-restore-alt\"\n (click)=\"restoreNotification(item.id, item)\"\n (keydown.enter)=\"restoreNotification(item.id, item)\"\n aria-hidden=\"true\"\n ></i>\n </button>\n </span>\n </li>\n }\n </ul>\n </div>\n <div class=\"pagination-container d-flex justify-content-between align-items-center mt-3 mb-3\">\n <pw-records-summary [showing]=\"totalRecords\" [total]=\"totalRecords\" />\n <div class=\"d-flex align-items-center\">\n <button class=\"btn btn-outline-primary me-2\" (click)=\"previousPage()\" [disabled]=\"currentPage === 1\">\n <i class=\"fas fa-chevron-left\"></i>\n </button>\n <span>Page {{ currentPage }} of {{ totalPages }}</span>\n <button class=\"btn btn-outline-primary ms-2\" (click)=\"nextPage()\" [disabled]=\"currentPage === totalPages\">\n <i class=\"fas fa-chevron-right\"></i>\n </button>\n </div>\n </div>\n </div>\n </div>\n}\n\n@if (noNoti && isLoaded) {\n <div class=\"col-12 col-sm-12 col-md-12\"\n >\n <pw-no-data [withImage]=\"true\" message=\"You currently do not have any dismissed notifications\">\n </pw-no-data>\n </div>\n}\n</div>\n", styles: [".icon-dismiss{position:relative;right:15px;top:30px;z-index:9}.noti-list{overflow-x:hidden!important}.noti-buttons{flex:auto}.main-div{padding:0 20px}.card{padding-bottom:0}@media screen and (max-width:480px){.noty-body{width:240px}}.pagination-container{padding:0 1rem}\n"], dependencies: [{ kind: "directive", type: i2$2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: i3.ProgressSpinner, selector: "p-progressSpinner, p-progress-spinner, p-progressspinner", inputs: ["styleClass", "strokeWidth", "fill", "animationDuration", "ariaLabel"] }, { kind: "component", type: i4.NoDataComponent, selector: "pw-no-data", inputs: ["message", "description", "withImage"] }, { kind: "component", type: i4.RecordsSummaryComponent, selector: "pw-records-summary", inputs: ["showing", "total"] }, { kind: "pipe", type: i5$1.SinceAgoPipe, name: "sinceAgo" }] }); }
584
- }
585
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: DismissedNotificationsComponent, decorators: [{
586
- type: Component,
587
- args: [{ selector: 'pw-dismissed-notifications', standalone: false, template: "<div class=\"row main-div\">\n <div class=\"w-100 text-center mt-3\">\n @if (!isLoaded) {\n <p-progressSpinner strokeWidth=\"2\"> </p-progressSpinner>\n }\n </div>\n @if (dismissedNotifications?.length && isLoaded) {\n <div class=\"col-12 col-sm-12 col-md-12 mb-5\"\n >\n <div class=\"card\">\n <div class=\"card-body\">\n <ul class=\"noti-list\">\n @for (item of dismissedNotifications; track trackByNotification($index, item)) {\n <li\n class=\"p-3 border-bottom border-bottom-blue-grey border-bottom-lighten-4 d-flex align-items-center\">\n <span class=\"btn btn-circle me-2\"\n [ngClass]=\"{\n 'btn-danger': item.note_type === 'administrative',\n 'btn-secondary': item.note_type === 'object_event',\n 'btn-primary': item.note_type === 'user_generated'\n }\">\n <i\n class=\"fal float-start\"\n [ngClass]=\"{\n 'fa-bell': item.note_type === 'administrative',\n 'fa-share-alt': item.note_type === 'object_event',\n 'fa-bells': item.note_type === 'user_generated'\n }\"\n aria-hidden=\"true\"\n ></i>\n </span>\n <span class=\"d-inline-block noty-body\">\n <span class=\"noti-title line-height-1p5 d-block text-bold-400\">{{\n item.content\n }}</span>\n <span class=\"noti-text\"><span class=\"fal fa-clock\"></span>\n {{ item?.created_at | sinceAgo }}</span>\n </span>\n <span class=\"noti-buttons\">\n <button class=\"btn float-end\">\n <i\n class=\"far fa-trash-alt\"\n (click)=\"dismiss(item.id, item)\"\n (keydown.enter)=\"dismiss(item.id, item)\"\n aria-hidden=\"true\"\n ></i>\n </button>\n <button class=\"btn float-end\">\n <i\n class=\"fas fa-trash-restore-alt\"\n (click)=\"restoreNotification(item.id, item)\"\n (keydown.enter)=\"restoreNotification(item.id, item)\"\n aria-hidden=\"true\"\n ></i>\n </button>\n </span>\n </li>\n }\n </ul>\n </div>\n <div class=\"pagination-container d-flex justify-content-between align-items-center mt-3 mb-3\">\n <pw-records-summary [showing]=\"totalRecords\" [total]=\"totalRecords\" />\n <div class=\"d-flex align-items-center\">\n <button class=\"btn btn-outline-primary me-2\" (click)=\"previousPage()\" [disabled]=\"currentPage === 1\">\n <i class=\"fas fa-chevron-left\"></i>\n </button>\n <span>Page {{ currentPage }} of {{ totalPages }}</span>\n <button class=\"btn btn-outline-primary ms-2\" (click)=\"nextPage()\" [disabled]=\"currentPage === totalPages\">\n <i class=\"fas fa-chevron-right\"></i>\n </button>\n </div>\n </div>\n </div>\n </div>\n}\n\n@if (noNoti && isLoaded) {\n <div class=\"col-12 col-sm-12 col-md-12\"\n >\n <pw-no-data [withImage]=\"true\" message=\"You currently do not have any dismissed notifications\">\n </pw-no-data>\n </div>\n}\n</div>\n", styles: [".icon-dismiss{position:relative;right:15px;top:30px;z-index:9}.noti-list{overflow-x:hidden!important}.noti-buttons{flex:auto}.main-div{padding:0 20px}.card{padding-bottom:0}@media screen and (max-width:480px){.noty-body{width:240px}}.pagination-container{padding:0 1rem}\n"] }]
588
- }], ctorParameters: () => [{ type: i1.NotificationService }, { type: i0.ChangeDetectorRef }] });
589
-
590
- class NotificationsPageComponent {
591
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: NotificationsPageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
592
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.19", type: NotificationsPageComponent, isStandalone: false, selector: "pw-notifications-page", ngImport: i0, template: "<div class=\"row\">\n <div class=\"col-12 col-sm-12 col-md-12 mt-4\">\n <h2 class=\"p-2\">Notifications</h2>\n </div>\n</div>\n\n<ul ngbNav\n #nav=\"ngbNav\"\n class=\"nav-tabs\">\n <li [ngbNavItem]=\"1\">\n <a ngbNavLink>Current Notifications</a>\n <ng-template ngbNavContent>\n <pw-current-notifications></pw-current-notifications>\n </ng-template>\n </li>\n <li [ngbNavItem]=\"2\">\n <a ngbNavLink>Dismissed Notifications</a>\n <ng-template ngbNavContent>\n <pw-dismissed-notifications></pw-dismissed-notifications>\n </ng-template>\n </li>\n</ul>\n\n<div [ngbNavOutlet]=\"nav\"></div>\n", styles: [".icon-dismiss{position:relative;right:15px;top:30px;z-index:9}.noti-list{overflow-x:hidden!important}.noti-buttons{flex:auto}.main-div{padding:0 20px}.card{padding-bottom:0}@media screen and (max-width:480px){.noty-body{width:240px}}.pagination-container{padding:0 1rem}\n"], dependencies: [{ kind: "directive", type: i1$2.NgbNavContent, selector: "ng-template[ngbNavContent]" }, { kind: "directive", type: i1$2.NgbNav, selector: "[ngbNav]", inputs: ["activeId", "animation", "destroyOnHide", "orientation", "roles", "keyboard"], outputs: ["activeIdChange", "shown", "hidden", "navChange"], exportAs: ["ngbNav"] }, { kind: "directive", type: i1$2.NgbNavItem, selector: "[ngbNavItem]", inputs: ["destroyOnHide", "disabled", "domId", "ngbNavItem"], outputs: ["shown", "hidden"], exportAs: ["ngbNavItem"] }, { kind: "directive", type: i1$2.NgbNavItemRole, selector: "[ngbNavItem]:not(ng-container)" }, { kind: "directive", type: i1$2.NgbNavLink, selector: "a[ngbNavLink]" }, { kind: "directive", type: i1$2.NgbNavLinkBase, selector: "[ngbNavLink]" }, { kind: "component", type: i1$2.NgbNavOutlet, selector: "[ngbNavOutlet]", inputs: ["paneRole", "ngbNavOutlet"] }, { kind: "component", type: CurrentNotificationsComponent, selector: "pw-current-notifications" }, { kind: "component", type: DismissedNotificationsComponent, selector: "pw-dismissed-notifications" }] }); }
115
+ const answers = {};
116
+ Object.keys(faqs).forEach((category, categoryIndex) => {
117
+ faqs[category].forEach((faq, itemIndex) => {
118
+ if (faq?.answer) answers[`${itemIndex}-${categoryIndex}`] = sanitize(faq.answer);
119
+ });
120
+ });
121
+ return answers;
593
122
  }
594
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: NotificationsPageComponent, decorators: [{
595
- type: Component,
596
- args: [{ selector: 'pw-notifications-page', standalone: false, template: "<div class=\"row\">\n <div class=\"col-12 col-sm-12 col-md-12 mt-4\">\n <h2 class=\"p-2\">Notifications</h2>\n </div>\n</div>\n\n<ul ngbNav\n #nav=\"ngbNav\"\n class=\"nav-tabs\">\n <li [ngbNavItem]=\"1\">\n <a ngbNavLink>Current Notifications</a>\n <ng-template ngbNavContent>\n <pw-current-notifications></pw-current-notifications>\n </ng-template>\n </li>\n <li [ngbNavItem]=\"2\">\n <a ngbNavLink>Dismissed Notifications</a>\n <ng-template ngbNavContent>\n <pw-dismissed-notifications></pw-dismissed-notifications>\n </ng-template>\n </li>\n</ul>\n\n<div [ngbNavOutlet]=\"nav\"></div>\n", styles: [".icon-dismiss{position:relative;right:15px;top:30px;z-index:9}.noti-list{overflow-x:hidden!important}.noti-buttons{flex:auto}.main-div{padding:0 20px}.card{padding-bottom:0}@media screen and (max-width:480px){.noty-body{width:240px}}.pagination-container{padding:0 1rem}\n"] }]
597
- }] });
598
-
599
- class SearchComponent {
600
- constructor(route, service, cdr) {
601
- this.route = route;
602
- this.service = service;
603
- this.cdr = cdr;
604
- this.emptySearchResult = {
605
- users: [],
606
- faqs: [],
607
- recipients: []
608
- };
609
- this.isLoaded = false;
610
- this.objectKeys = Object.keys;
611
- }
612
- ngOnInit() {
613
- this.subscriptionId = PermissionService.selectedSubscription.id;
614
- this.route.queryParams.subscribe(response => {
615
- this.keyword = response['keyword'];
616
- if (this.keyword) {
617
- this.search();
618
- }
619
- this.cdr.markForCheck();
620
- });
621
- }
622
- search() {
623
- this.isLoaded = false;
624
- this.service
625
- .search(this.keyword, this.subscriptionId)
626
- .subscribe(response => {
627
- this.result = {
628
- ...this.emptySearchResult,
629
- ...response
630
- };
631
- this.cdr.markForCheck();
632
- })
633
- .add(() => {
634
- this.isLoaded = true;
635
- this.cdr.markForCheck();
636
- });
637
- }
638
- get hasResults() {
639
- return this.searchGroups.some(group => group.length > 0);
640
- }
641
- get searchGroups() {
642
- return ['users', 'faqs', 'recipients'].map(group => this.getResultGroup(group));
643
- }
644
- getResultGroup(group) {
645
- if (!this.isSearchGroupKey(group)) {
646
- return [];
647
- }
648
- const resultGroup = this.result?.[group];
649
- if (!Array.isArray(resultGroup)) {
650
- return [];
651
- }
652
- return resultGroup.filter(item => this.isRenderableResult(item));
653
- }
654
- isSearchGroupKey(group) {
655
- return group === 'users' || group === 'faqs' || group === 'recipients';
656
- }
657
- isRenderableResult(item) {
658
- if (item == null) {
659
- return false;
660
- }
661
- if (typeof item !== 'object') {
662
- return true;
663
- }
664
- return Object.values(item).some(value => {
665
- if (Array.isArray(value)) {
666
- return value.length > 0;
667
- }
668
- return value !== null && value !== undefined && value !== '';
669
- });
670
- }
671
- handleImageError(event, fallbackPath) {
672
- HelperService.handleImageFallbackPath(event, fallbackPath);
673
- }
674
- trackByUserId(_index, item) {
675
- return item.id;
676
- }
677
- trackByFaqId(_index, item) {
678
- return item.id;
679
- }
680
- trackBySkill(_index, item) {
681
- return item.id;
682
- }
683
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: SearchComponent, deps: [{ token: i1$1.ActivatedRoute }, { token: i1.DashboardService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
684
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.19", type: SearchComponent, isStandalone: false, selector: "pw-search", ngImport: i0, template: "<div class=\"container-fluid dashboard-card overflow-hidden\">\n <div class=\"dashboard\">\n <div class=\"dashboard-body\">\n <div class=\"row\">\n <div class=\"col-12 my-3 mt-4\">\n <h2>Search Results</h2>\n </div>\n </div>\n @if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\">\n <p-progressSpinner strokeWidth=\"2\"> </p-progressSpinner>\n </div>\n }\n @if (isLoaded) {\n <div class=\"row faqlist search-result\">\n <div class=\"col-12\">\n <div data-cy=\"faq-list\">\n @if (result) {\n @for (group of objectKeys(result); track group; let idx = $index) {\n <div>\n @switch (group) {\n @case ('users') {\n @if (getResultGroup(group).length) {\n <h6 class=\"text-uppercase mt-3 p-1\">{{ group }}</h6>\n <div class=\"dashboard\">\n @for (\n user of getResultGroup(group); track trackByUserId($index, user); let idx1 = $index) {\n <div class=\"faq-item\">\n <div class=\"dashboard-header p-2\">\n <h5 class=\"accordion-title mt-2\">\n <a\n class=\"accordion-toggle collapsed\"\n data-bs-toggle=\"collapse\"\n [href]=\"'#collapse' + idx1 + idx\"><span>{{\n user.first_name !== null\n ? user.first_name\n : user?.email\n }}</span></a>\n </h5>\n <p class=\"m-0 title-font\">\n @if (user.user_skills?.length > 0) {\n <strong>Skills :\n </strong>\n }\n @for (\n skill of (user.user_skills ?? []); track trackBySkill($index, skill); let isLast = $last) {\n <span class=\"badge bg-success m-1\">\n {{ skill.name\n }}{{ isLast ? '' : ', ' }}</span>\n }\n </p>\n @if (\n user?.user_profile?.headline\n ?.length > 0\n ) {\n <p class=\"m-0 title-font\">\n {{ user?.user_profile?.headline }}\n </p>\n }\n @if (\n user?.user_profile?.country\n ?.length > 0\n ) {\n <p class=\"m-0 title-font\">\n <strong>Location : </strong>{{ user?.user_profile?.country }}\n </p>\n }\n </div>\n <div [id]=\"'collapse' + idx1 + idx\"\n class=\"panel-collapse collapse in p-3\">\n <div class=\"display-block overflow-hidden\">\n <div class=\"row align-items-center\">\n <div class=\"col-sm-3\">\n @if (user?.user_avatar?.length > 0) {\n @for (\n profile_image of user.user_avatar; track profile_image) {\n @if (profile_image.width === 200) {\n <div class=\"text-center my-2\">\n <div class=\"avatar\">\n <img class=\"img-fluid\"\n [src]=\"profile_image.url\"\n alt=\"Male Icon\"\n (error)=\"handleImageError($event, 'assets/img/icons/male.png')\" />\n </div>\n </div>\n }\n }\n } @else {\n <div class=\"text-center my-2\">\n <div class=\"avatar\">\n <img src=\"/assets/img/icons/male.png\"\n alt=\"\"\n class=\"img-fluid\" />\n </div>\n </div>\n }\n </div>\n <div class=\"col-sm-9\">\n <ul class=\"name-fl\">\n <li>\n <strong>First Name:\n </strong>\n <span>{{\n user.first_name !== null\n ? user.first_name\n : 'N/A'\n }}</span>\n </li>\n <li>\n <strong>Last Name:\n </strong>\n <span>{{\n user.last_name !== null\n ? user.last_name\n : 'N/A'\n }}</span>\n </li>\n </ul>\n <p>\n <strong>Email: </strong>\n <span>{{\n user.email !== null\n ? user.email\n : 'N/A'\n }}</span>\n </p>\n <p>\n <strong>Description:\n </strong>\n <span>{{\n user?.user_profile\n ?.description !== null\n ? user?.user_profile\n ?.description\n : 'N/A'\n }}</span>\n </p>\n <div class=\"view-btn text-end\">\n <a class=\"btn btn-outline-primary inline-block\"\n [routerLink]=\"[\n '/members/' +\n user.slug\n ]\">View More</a>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n }\n </div>\n }\n }\n @case ('faqs') {\n @if (getResultGroup(group).length) {\n <h6>\n {{ group | uppercase }}\n </h6>\n @for (\n faq of getResultGroup(group); track trackByFaqId($index, faq); let idx2 = $index) {\n <div class=\"faq-item\">\n <div class=\"dashboard-header p-2\">\n <h5 class=\"accordion-title mt-2\">\n <a\n class=\"accordion-toggle collapsed\"\n data-bs-toggle=\"collapse\"\n [href]=\"'#collapse' + idx2 + idx\">{{ faq.question }}</a>\n </h5>\n </div>\n <div [id]=\"'collapse' + idx2 + idx\"\n class=\"panel-collapse collapse in\">\n @if (faq?.answer) {\n <div class=\"ql-container ql-snow no-border\">\n <div class=\"ql-editor\"\n [innerHTML]=\"faq?.answer |safe:'html'\">\n </div>\n </div>\n }\n </div>\n </div>\n }\n }\n }\n }\n </div>\n }\n @if (!hasResults) {\n <pw-no-data [withImage]=\"true\" [message]=\"'Search.NoDataMessage' | transloco\" [description]=\"'Search.NoDataDescription' | transloco\">\n </pw-no-data>\n }\n }\n </div>\n </div>\n </div>\n }\n </div>\n </div>\n</div>\n", styles: ["@charset \"UTF-8\";:root{--first: rgb(23 105 225);--second: rgb(54 194 131);--third: rgb(255 171 0);--text: rgb(34 34 34);--tabs_bg: rgb(23 105 225);--tabs_sub_bg: color-mix(in srgb, var(--first, rgb(23 105 225)) 85%, #000000);--tabs_text: rgb(255 255 255);--titles: rgb(34 34 34);--sidebar_bg: rgb(0, 48, 63);--sidebar_text: rgb(255 255 255);--dashboard_bg: rgb(255 255 255);--public-btn-radius: 24px}h6{background:var(--sidebar_bg)!important;color:var(--sidebar_text)!important;padding:.8rem!important}.faq-search-answer a{color:#144086;display:inline-block;float:right;font-size:14px;margin-right:15px}::ng-deep .ql-snow *{font-size:16px!important}.faq-search-answer a:after{right:-10px}.faq-item{border:1px dashed rgba(0,0,0,.1);background-color:#fff;border-radius:3px;margin:10px 0;transition:all .2s ease-in-out}.faq-item .dashboard-header{background:#fff}.accord-title1 .faq-search-answer a{margin-right:0!important}a.accordion-toggle:after{display:none}.accord-title p.title-font{font-size:.8rem}.panel-collapse.show{border-top:1px dashed rgba(0,0,0,.1);padding-top:20px;padding-bottom:20px}.panel-collapse ul{margin-bottom:1rem}.panel-collapse ul.name-fl li{display:inline-block;padding-right:15px}.view-btn a{display:inline-block}.avatar{width:130px;margin:0 auto;display:block}.accordion-title a{color:var(--sidebar_bg)!important}.card-header h1,.card-header p{color:#fff!important}.card .accordion-toggle:before{content:\"\\f078\"}.card .accordion-toggle.collapsed{transition:all .3s ease-in-out}.card .accordion-toggle.collapsed:before{content:\"\\f054\"}.card-block p{font-size:16px}.card,h6{background:var(--sidebar_bg)!important;color:var(--sidebar_text)!important;padding:.8rem!important}.ql-container{resize:none!important;max-width:1000px;margin:0 auto}\n"], dependencies: [{ kind: "directive", type: i1$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: i3.ProgressSpinner, selector: "p-progressSpinner, p-progress-spinner, p-progressspinner", inputs: ["styleClass", "strokeWidth", "fill", "animationDuration", "ariaLabel"] }, { kind: "component", type: i4.NoDataComponent, selector: "pw-no-data", inputs: ["message", "description", "withImage"] }, { kind: "pipe", type: i2$2.UpperCasePipe, name: "uppercase" }, { kind: "pipe", type: i7.TranslocoPipe, name: "transloco" }, { kind: "pipe", type: i5$1.DOMSanitizerPipe, name: "safe" }] }); }
685
- }
686
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: SearchComponent, decorators: [{
687
- type: Component,
688
- args: [{ selector: 'pw-search', standalone: false, template: "<div class=\"container-fluid dashboard-card overflow-hidden\">\n <div class=\"dashboard\">\n <div class=\"dashboard-body\">\n <div class=\"row\">\n <div class=\"col-12 my-3 mt-4\">\n <h2>Search Results</h2>\n </div>\n </div>\n @if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\">\n <p-progressSpinner strokeWidth=\"2\"> </p-progressSpinner>\n </div>\n }\n @if (isLoaded) {\n <div class=\"row faqlist search-result\">\n <div class=\"col-12\">\n <div data-cy=\"faq-list\">\n @if (result) {\n @for (group of objectKeys(result); track group; let idx = $index) {\n <div>\n @switch (group) {\n @case ('users') {\n @if (getResultGroup(group).length) {\n <h6 class=\"text-uppercase mt-3 p-1\">{{ group }}</h6>\n <div class=\"dashboard\">\n @for (\n user of getResultGroup(group); track trackByUserId($index, user); let idx1 = $index) {\n <div class=\"faq-item\">\n <div class=\"dashboard-header p-2\">\n <h5 class=\"accordion-title mt-2\">\n <a\n class=\"accordion-toggle collapsed\"\n data-bs-toggle=\"collapse\"\n [href]=\"'#collapse' + idx1 + idx\"><span>{{\n user.first_name !== null\n ? user.first_name\n : user?.email\n }}</span></a>\n </h5>\n <p class=\"m-0 title-font\">\n @if (user.user_skills?.length > 0) {\n <strong>Skills :\n </strong>\n }\n @for (\n skill of (user.user_skills ?? []); track trackBySkill($index, skill); let isLast = $last) {\n <span class=\"badge bg-success m-1\">\n {{ skill.name\n }}{{ isLast ? '' : ', ' }}</span>\n }\n </p>\n @if (\n user?.user_profile?.headline\n ?.length > 0\n ) {\n <p class=\"m-0 title-font\">\n {{ user?.user_profile?.headline }}\n </p>\n }\n @if (\n user?.user_profile?.country\n ?.length > 0\n ) {\n <p class=\"m-0 title-font\">\n <strong>Location : </strong>{{ user?.user_profile?.country }}\n </p>\n }\n </div>\n <div [id]=\"'collapse' + idx1 + idx\"\n class=\"panel-collapse collapse in p-3\">\n <div class=\"display-block overflow-hidden\">\n <div class=\"row align-items-center\">\n <div class=\"col-sm-3\">\n @if (user?.user_avatar?.length > 0) {\n @for (\n profile_image of user.user_avatar; track profile_image) {\n @if (profile_image.width === 200) {\n <div class=\"text-center my-2\">\n <div class=\"avatar\">\n <img class=\"img-fluid\"\n [src]=\"profile_image.url\"\n alt=\"Male Icon\"\n (error)=\"handleImageError($event, 'assets/img/icons/male.png')\" />\n </div>\n </div>\n }\n }\n } @else {\n <div class=\"text-center my-2\">\n <div class=\"avatar\">\n <img src=\"/assets/img/icons/male.png\"\n alt=\"\"\n class=\"img-fluid\" />\n </div>\n </div>\n }\n </div>\n <div class=\"col-sm-9\">\n <ul class=\"name-fl\">\n <li>\n <strong>First Name:\n </strong>\n <span>{{\n user.first_name !== null\n ? user.first_name\n : 'N/A'\n }}</span>\n </li>\n <li>\n <strong>Last Name:\n </strong>\n <span>{{\n user.last_name !== null\n ? user.last_name\n : 'N/A'\n }}</span>\n </li>\n </ul>\n <p>\n <strong>Email: </strong>\n <span>{{\n user.email !== null\n ? user.email\n : 'N/A'\n }}</span>\n </p>\n <p>\n <strong>Description:\n </strong>\n <span>{{\n user?.user_profile\n ?.description !== null\n ? user?.user_profile\n ?.description\n : 'N/A'\n }}</span>\n </p>\n <div class=\"view-btn text-end\">\n <a class=\"btn btn-outline-primary inline-block\"\n [routerLink]=\"[\n '/members/' +\n user.slug\n ]\">View More</a>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n }\n </div>\n }\n }\n @case ('faqs') {\n @if (getResultGroup(group).length) {\n <h6>\n {{ group | uppercase }}\n </h6>\n @for (\n faq of getResultGroup(group); track trackByFaqId($index, faq); let idx2 = $index) {\n <div class=\"faq-item\">\n <div class=\"dashboard-header p-2\">\n <h5 class=\"accordion-title mt-2\">\n <a\n class=\"accordion-toggle collapsed\"\n data-bs-toggle=\"collapse\"\n [href]=\"'#collapse' + idx2 + idx\">{{ faq.question }}</a>\n </h5>\n </div>\n <div [id]=\"'collapse' + idx2 + idx\"\n class=\"panel-collapse collapse in\">\n @if (faq?.answer) {\n <div class=\"ql-container ql-snow no-border\">\n <div class=\"ql-editor\"\n [innerHTML]=\"faq?.answer |safe:'html'\">\n </div>\n </div>\n }\n </div>\n </div>\n }\n }\n }\n }\n </div>\n }\n @if (!hasResults) {\n <pw-no-data [withImage]=\"true\" [message]=\"'Search.NoDataMessage' | transloco\" [description]=\"'Search.NoDataDescription' | transloco\">\n </pw-no-data>\n }\n }\n </div>\n </div>\n </div>\n }\n </div>\n </div>\n</div>\n", styles: ["@charset \"UTF-8\";:root{--first: rgb(23 105 225);--second: rgb(54 194 131);--third: rgb(255 171 0);--text: rgb(34 34 34);--tabs_bg: rgb(23 105 225);--tabs_sub_bg: color-mix(in srgb, var(--first, rgb(23 105 225)) 85%, #000000);--tabs_text: rgb(255 255 255);--titles: rgb(34 34 34);--sidebar_bg: rgb(0, 48, 63);--sidebar_text: rgb(255 255 255);--dashboard_bg: rgb(255 255 255);--public-btn-radius: 24px}h6{background:var(--sidebar_bg)!important;color:var(--sidebar_text)!important;padding:.8rem!important}.faq-search-answer a{color:#144086;display:inline-block;float:right;font-size:14px;margin-right:15px}::ng-deep .ql-snow *{font-size:16px!important}.faq-search-answer a:after{right:-10px}.faq-item{border:1px dashed rgba(0,0,0,.1);background-color:#fff;border-radius:3px;margin:10px 0;transition:all .2s ease-in-out}.faq-item .dashboard-header{background:#fff}.accord-title1 .faq-search-answer a{margin-right:0!important}a.accordion-toggle:after{display:none}.accord-title p.title-font{font-size:.8rem}.panel-collapse.show{border-top:1px dashed rgba(0,0,0,.1);padding-top:20px;padding-bottom:20px}.panel-collapse ul{margin-bottom:1rem}.panel-collapse ul.name-fl li{display:inline-block;padding-right:15px}.view-btn a{display:inline-block}.avatar{width:130px;margin:0 auto;display:block}.accordion-title a{color:var(--sidebar_bg)!important}.card-header h1,.card-header p{color:#fff!important}.card .accordion-toggle:before{content:\"\\f078\"}.card .accordion-toggle.collapsed{transition:all .3s ease-in-out}.card .accordion-toggle.collapsed:before{content:\"\\f054\"}.card-block p{font-size:16px}.card,h6{background:var(--sidebar_bg)!important;color:var(--sidebar_text)!important;padding:.8rem!important}.ql-container{resize:none!important;max-width:1000px;margin:0 auto}\n"] }]
689
- }], ctorParameters: () => [{ type: i1$1.ActivatedRoute }, { type: i1.DashboardService }, { type: i0.ChangeDetectorRef }] });
690
-
691
- // Note: CurrentNotificationsComponent and DismissedNotificationsComponent
692
- // are declared in DashboardLibModule and exported from there
693
- // They are needed by NotificationsPageComponent but kept in the main dashboard module
694
- class DashboardContentModule {
695
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: DashboardContentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
696
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.19", ngImport: i0, type: DashboardContentModule, declarations: [DocumentationComponent,
697
- FaqComponent,
698
- FaqDetailsComponent,
699
- HomeComponent,
700
- NotificationsPageComponent,
701
- CurrentNotificationsComponent,
702
- NotificationsPageComponent,
703
- DismissedNotificationsComponent,
704
- SearchComponent,
705
- UserFeedbackComponent], imports: [CommonModule,
706
- FormsModule,
707
- RouterModule,
708
- CoreTranslocoModule,
709
- PipesModule,
710
- ProgressSpinnerModule,
711
- NgbNavModule,
712
- RadioButtonModule,
713
- TooltipModule,
714
- ResourceSharedComponentsModule], exports: [DocumentationComponent,
715
- FaqComponent,
716
- FaqDetailsComponent,
717
- HomeComponent,
718
- NotificationsPageComponent,
719
- CurrentNotificationsComponent,
720
- NotificationsPageComponent,
721
- DismissedNotificationsComponent,
722
- SearchComponent,
723
- RadioButtonModule] }); }
724
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: DashboardContentModule, imports: [CommonModule,
725
- FormsModule,
726
- RouterModule,
727
- CoreTranslocoModule,
728
- PipesModule,
729
- ProgressSpinnerModule,
730
- NgbNavModule,
731
- RadioButtonModule,
732
- TooltipModule,
733
- ResourceSharedComponentsModule, RadioButtonModule] }); }
734
- }
735
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: DashboardContentModule, decorators: [{
736
- type: NgModule,
737
- args: [{
738
- imports: [
739
- CommonModule,
740
- FormsModule,
741
- RouterModule,
742
- CoreTranslocoModule,
743
- PipesModule,
744
- ProgressSpinnerModule,
745
- NgbNavModule,
746
- RadioButtonModule,
747
- TooltipModule,
748
- ResourceSharedComponentsModule
749
- ],
750
- declarations: [
751
- DocumentationComponent,
752
- FaqComponent,
753
- FaqDetailsComponent,
754
- HomeComponent,
755
- NotificationsPageComponent,
756
- CurrentNotificationsComponent,
757
- NotificationsPageComponent,
758
- DismissedNotificationsComponent,
759
- SearchComponent,
760
- UserFeedbackComponent
761
- ],
762
- exports: [
763
- DocumentationComponent,
764
- FaqComponent,
765
- FaqDetailsComponent,
766
- HomeComponent,
767
- NotificationsPageComponent,
768
- CurrentNotificationsComponent,
769
- NotificationsPageComponent,
770
- DismissedNotificationsComponent,
771
- SearchComponent,
772
- RadioButtonModule
773
- ],
774
- schemas: [CUSTOM_ELEMENTS_SCHEMA]
775
- }]
776
- }] });
777
-
778
- // Core Angular modules
779
- class DashboardLibModule {
780
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: DashboardLibModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
781
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.19", ngImport: i0, type: DashboardLibModule, imports: [CommonModule,
782
- FormsModule,
783
- PipesModule,
784
- SelectModule,
785
- DirectivesModule,
786
- ReactiveFormsModule,
787
- CoreTranslocoModule,
788
- NgbNavModule,
789
- NgbDropdownModule,
790
- UserModuleModule,
791
- RadioButtonModule,
792
- ProgressSpinnerModule,
793
- DashboardContentModule] }); }
794
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: DashboardLibModule, providers: [SubscriptionService], imports: [CommonModule,
795
- FormsModule,
796
- PipesModule,
797
- SelectModule,
798
- DirectivesModule,
799
- ReactiveFormsModule,
800
- CoreTranslocoModule,
801
- NgbNavModule,
802
- NgbDropdownModule,
803
- UserModuleModule,
804
- RadioButtonModule,
805
- ProgressSpinnerModule,
806
- DashboardContentModule] }); }
123
+ var FaqComponent = class FaqComponent extends AppBaseComponent {
124
+ constructor(commonService, injector, productService, sanitizer, cdr) {
125
+ super(injector);
126
+ this.commonService = commonService;
127
+ this.productService = productService;
128
+ this.sanitizer = sanitizer;
129
+ this.cdr = cdr;
130
+ this.searchSubject = new Subject();
131
+ this.destroy$ = new Subject();
132
+ this.sanitizedFaqAnswers = {};
133
+ this.subscriptions = [];
134
+ this.objectKeys = Object.keys;
135
+ this.isLoaded = false;
136
+ this.faqsResponse = [];
137
+ this.faqHashMap = {};
138
+ this.routers = ADMIN_ROUTERS;
139
+ this.canEditFaq = false;
140
+ }
141
+ ngOnInit() {
142
+ this.faqHashMap = {};
143
+ this.showSupport = PermissionService.selectedProduct?.gitlab_service_desk_email;
144
+ this.showDocumentation = PermissionService.selectedProduct?.documentation_url;
145
+ this.slug = PermissionService.selectedSubscription?.slug;
146
+ this.subscriptionId = PermissionService?.selectedSubscription?.id;
147
+ this.masterProductId = this.appConfig.master_subscription.product_id;
148
+ this.canEditFaq = this.permissionService.evaluatePermissions(FAQ_ADMIN_PERMISSION);
149
+ this.getProducts();
150
+ this.searchSubject.pipe(debounceTime(1e3), takeUntil(this.destroy$)).subscribe((searchValue) => {
151
+ this.search_term = searchValue;
152
+ this.loadFaqData();
153
+ this.cdr.markForCheck();
154
+ });
155
+ this.loadFaqData();
156
+ }
157
+ loadFaqData() {
158
+ this.isLoaded = false;
159
+ forkJoin({
160
+ faqs: this.commonService.getPublicFaq(this.subscriptionId, this.search_term),
161
+ products: this.productService.getProducts({ master_product_id: this.masterProductId })
162
+ }).pipe(finalize(() => {
163
+ this.isLoaded = true;
164
+ this.cdr.markForCheck();
165
+ })).subscribe(({ faqs, products }) => {
166
+ this.faqsResponse = faqs.faqs;
167
+ faqs?.available_category?.forEach((x) => {
168
+ this.faqHashMap[x.key] = x;
169
+ });
170
+ this.totalRecords = faqs.faqs.length;
171
+ this.nonProductFaqs = this.faqsResponse.filter((x) => x.visible && !x.product_id);
172
+ this.allProductFaqs = this.faqsResponse.filter((x) => x.visible && x.product_id);
173
+ const noProductObjects = this.faqsResponse.every((x) => x.product === null);
174
+ this.allFaqFalse = this.faqsResponse.every((x) => x.visible === false);
175
+ if (!noProductObjects) {
176
+ this.products = products.products;
177
+ this.faqValidation();
178
+ } else {
179
+ this.products = [];
180
+ this.faqValidation();
181
+ }
182
+ this.cdr.markForCheck();
183
+ });
184
+ }
185
+ faqValidation() {
186
+ this.faqs = groupFaqsByCategory(this.nonProductFaqs, this.allProductFaqs);
187
+ this.sanitizedFaqAnswers = buildSanitizedAnswers(this.faqs, (body) => this.sanitizeFaqAnswer(body));
188
+ }
189
+ getProducts() {
190
+ this.subscriptions = [];
191
+ this.userStore().subscribe((user) => {
192
+ if (user) this.subscriptions = user.subscriptions;
193
+ this.cdr.markForCheck();
194
+ });
195
+ }
196
+ filter(searchValue) {
197
+ this.searchSubject.next(searchValue);
198
+ }
199
+ navigateToSupport() {
200
+ this.router.navigate(["/support"]);
201
+ }
202
+ navigateToDocumentation() {
203
+ sessionStorage.setItem("documentation_url", this.showDocumentation);
204
+ const documentationRoute = this.router.createUrlTree([this.slug, "documentation"]);
205
+ const url = window.location.origin + this.router.serializeUrl(documentationRoute);
206
+ window.open(url, "_blank");
207
+ }
208
+ trackByProductFaqId(_index, item) {
209
+ return item.id;
210
+ }
211
+ onCollapseToggle(key, answer) {
212
+ if (!this.sanitizedFaqAnswers[key] && answer) this.sanitizedFaqAnswers[key] = this.sanitizeFaqAnswer(answer);
213
+ }
214
+ sanitizeFaqAnswer(body) {
215
+ return HelperService.sanitizeQuillBody(body, this.sanitizer);
216
+ }
217
+ ngOnDestroy() {
218
+ this.destroy$.next();
219
+ this.destroy$.complete();
220
+ super.ngOnDestroy();
221
+ }
222
+ static {
223
+ this.ɵfac = i0.ɵɵngDeclareFactory({
224
+ minVersion: "12.0.0",
225
+ version: "22.2.0",
226
+ ngImport: i0,
227
+ type: FaqComponent,
228
+ deps: [
229
+ { token: i1$1.CommonService },
230
+ { token: i0.Injector },
231
+ { token: i1$1.ProductService },
232
+ { token: i1$2.DomSanitizer },
233
+ { token: i0.ChangeDetectorRef }
234
+ ],
235
+ target: i0.ɵɵFactoryTarget.Component
236
+ });
237
+ }
238
+ static {
239
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
240
+ minVersion: "17.0.0",
241
+ version: "22.2.0",
242
+ type: FaqComponent,
243
+ isStandalone: false,
244
+ selector: "pw-faq",
245
+ usesInheritance: true,
246
+ ngImport: i0,
247
+ template: "<div class=\"mt-md-4 mt-4\">\n <div class=\"row mb-3\">\n <div class=\"col-12\">\n <div class=\"card gradient-custom-branding white text-center p-1 p-sm-2\">\n <div class=\"card-header p-1 p-sm-2\">\n <div class=\"d-flex justify-content-between align-items-start mb-3 mb-md-0\">\n <div>\n @if (showDocumentation) {\n <button\n class=\"btn btn-sm document-btn\"\n (click)=\"navigateToDocumentation()\">\n Documentation\n </button>\n }\n </div>\n <div>\n @if (showSupport) {\n <button\n class=\"btn btn-sm btn-primary\"\n (click)=\"navigateToSupport()\">\n Support\n </button>\n }\n </div>\n </div>\n\n <h1>You need help?</h1>\n <p><em>Please search through our frequently asked questions first.</em></p>\n </div>\n <div class=\"card-block p-2 p-sm-2\">\n <fieldset>\n <legend></legend>\n <label for=\"faq-search\" class=\"visually-hidden\">Search in FAQs</label>\n <input type=\"text\"\n id=\"faq-search\"\n name=\"faq-search\"\n class=\"form-control bg-white\"\n placeholder=\"Search FAQs...\"\n (input)=\"filter($event.target.value)\"\n #messageInput\n aria-label=\"Search FAQs...\" />\n </fieldset>\n </div>\n </div>\n </div>\n </div>\n @if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\"\n >\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n </div>\n }\n @if (faqs) {\n @for (category of objectKeys(faqs); track category; let idx1 = $index) {\n <div>\n @if (faqs[category]?.length) {\n <h6 class=\"text-uppercase mt-3 p-1\">{{ faqHashMap[category]?.name }}</h6>\n <div class=\"dashboard\">\n @for (\n faq of faqs[category]; track trackByProductFaqId(idx,\n faq); let idx = $index) {\n <div class=\"faq-item\"\n >\n <div class=\"dashboard-header p-2\">\n <h5 class=\"accordion-title mt-2\">\n <a class=\"accordion-toggle collapsed\"\n data-bs-toggle=\"collapse\"\n (click)=\"onCollapseToggle(idx + '-' + idx1, faq?.answer)\"\n [href]=\"'#collapse' + idx + idx1\">\n {{ faq.question }}\n </a>\n </h5>\n @if (canEditFaq && faq?.id) {\n <a class=\"faq-edit-link\"\n [pTooltip]=\"'Admin.Faq.EditTitle' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n [attr.aria-label]=\"'Admin.Faq.EditTitle' | transloco\"\n [routerLink]=\"[routers.faqDetails + faq.id]\"\n target=\"_blank\">\n <i class=\"fa fa-edit edit-icon\" aria-hidden=\"true\"></i>\n </a>\n }\n </div>\n <div [id]=\"'collapse' + idx + idx1\"\n class=\"panel-collapse p-3 collapse in\">\n <div class=\"card-block\">\n @if (faq?.answer) {\n <div class=\"ql-container ql-snow no-border\">\n <div class=\"ql-editor\"\n [innerHTML]=\"sanitizedFaqAnswers[idx + '-' + idx1]\">\n </div>\n </div>\n }\n </div>\n </div>\n </div>\n }\n </div>\n }\n </div>\n }\n }\n @if (isLoaded && (totalRecords === 0 || allFaqFalse)) {\n <div>\n <pw-no-data [withImage]=\"true\" message=\"This is embarrassing - we couldn't find any FAQ.\"> </pw-no-data>\n </div>\n }\n</div>\n",
248
+ styles: ["@charset \"UTF-8\";:root{--first: rgb(23 105 225);--second: rgb(54 194 131);--third: rgb(255 171 0);--text: rgb(34 34 34);--tabs_bg: rgb(23 105 225);--tabs_sub_bg: color-mix(in srgb, var(--first, rgb(23 105 225)) 85%, #000000);--tabs_text: rgb(255 255 255);--titles: rgb(34 34 34);--sidebar_bg: rgb(0, 48, 63);--sidebar_text: rgb(255 255 255);--dashboard_bg: rgb(255 255 255);--public-btn-radius: 24px}.card-header h1,.card-header p{color:#fff!important}.faq-item{border:1px solid rgb(224,224,224);background-color:#fff;border-radius:8px;margin:8px 0;overflow:hidden;transition:border-color .16s ease-out,box-shadow .16s ease-out}.faq-item:hover{border-color:#bdbdbd}.faq-item .dashboard-header{background:transparent;padding:0;display:flex;align-items:center;position:relative}.faq-item .dashboard-header:after{content:\"\\f078\";font-family:\"Font Awesome 5 Pro\",sans-serif;font-weight:600;font-size:13px;color:#9e9e9e;flex:0 0 auto;margin-left:auto;margin-right:18px;transition:transform .18s ease-out,color .18s ease-out}.faq-item .dashboard-header:hover:after{color:var(--titles)}.faq-item .dashboard-header:has(.accordion-toggle:not(.collapsed)):after{transform:rotate(180deg);color:var(--titles)}.faq-item .accordion-title{margin:0;flex:0 1 auto;min-width:0}.faq-item .faq-edit-link{position:relative;z-index:1;display:inline-flex;align-items:center;flex:0 0 auto;padding:14px 8px;text-decoration:none}.faq-item .faq-edit-link .edit-icon{font-size:14px}.faq-item .accordion-toggle{display:flex;align-items:center;padding:14px 4px 14px 18px;font-size:15px;font-weight:600;line-height:1.45;color:var(--titles);text-decoration:none;cursor:pointer}.faq-item .accordion-toggle:before{content:\"\"!important;position:absolute;inset:0;width:auto;padding:0}.faq-item .accordion-toggle:focus-visible{outline:2px solid var(--first);outline-offset:-2px}.faq-item .panel-collapse{padding:0!important}.faq-item .card-block{padding:4px 18px 16px;border-top:1px solid rgb(238,238,238)}.faq-item .ql-editor{font-size:14px;line-height:1.65;color:#616161;text-align:left}.document-btn{background-color:var(--second);border-color:var(--second)!important;color:#fff}.document-btn:hover{color:var(--second)!important;background-color:transparent!important}.card{background:var(--sidebar_bg)!important;color:var(--sidebar_text)!important;padding:.8rem!important}.card .accordion-toggle:before{content:\"\\f078\"}.card .accordion-toggle.collapsed{transition:all .3s ease-in-out}.card .accordion-toggle.collapsed:before{content:\"\\f054\"}h6{color:var(--titles)!important;font-size:17px;font-weight:700;letter-spacing:.04em;padding:0 0 10px!important;margin:32px 0 14px!important;border-bottom:1px solid rgb(224,224,224)}.accordion-title a{color:var(--titles)!important}.ql-container{resize:none!important;max-width:1000px;margin:0 auto}\n"],
249
+ dependencies: [
250
+ {
251
+ kind: "directive",
252
+ type: i3$1.RouterLink,
253
+ selector: "[routerLink]",
254
+ inputs: [
255
+ "target",
256
+ "queryParams",
257
+ "fragment",
258
+ "queryParamsHandling",
259
+ "state",
260
+ "info",
261
+ "relativeTo",
262
+ "preserveFragment",
263
+ "skipLocationChange",
264
+ "replaceUrl",
265
+ "browserUrl",
266
+ "routerLink"
267
+ ]
268
+ },
269
+ {
270
+ kind: "component",
271
+ type: i2$2.ProgressSpinner,
272
+ selector: "p-progress-spinner, p-progressspinner",
273
+ inputs: [
274
+ "value",
275
+ "strokeWidth",
276
+ "animationDuration",
277
+ "min",
278
+ "max",
279
+ "ariaLabel",
280
+ "fill"
281
+ ]
282
+ },
283
+ {
284
+ kind: "directive",
285
+ type: i5$1.Tooltip,
286
+ selector: "[pTooltip]",
287
+ inputs: [
288
+ "tooltipPosition",
289
+ "tooltipEvent",
290
+ "positionStyle",
291
+ "tooltipStyleClass",
292
+ "tooltipZIndex",
293
+ "escape",
294
+ "showDelay",
295
+ "hideDelay",
296
+ "life",
297
+ "positionTop",
298
+ "positionLeft",
299
+ "autoHide",
300
+ "fitContent",
301
+ "hideOnEscape",
302
+ "showOnEllipsis",
303
+ "pTooltip",
304
+ "tooltipDisabled",
305
+ "tooltipOptions",
306
+ "appendTo",
307
+ "pTooltipPT",
308
+ "pTooltipUnstyled"
309
+ ]
310
+ },
311
+ {
312
+ kind: "component",
313
+ type: i6.NoDataComponent,
314
+ selector: "pw-no-data",
315
+ inputs: [
316
+ "message",
317
+ "description",
318
+ "withImage"
319
+ ]
320
+ },
321
+ {
322
+ kind: "pipe",
323
+ type: i7.TranslocoPipe,
324
+ name: "transloco"
325
+ }
326
+ ]
327
+ });
328
+ }
329
+ };
330
+ i0.ɵɵngDeclareClassMetadata({
331
+ minVersion: "12.0.0",
332
+ version: "22.2.0",
333
+ ngImport: i0,
334
+ type: FaqComponent,
335
+ decorators: [{
336
+ type: Component,
337
+ args: [{
338
+ selector: "pw-faq",
339
+ standalone: false,
340
+ template: "<div class=\"mt-md-4 mt-4\">\n <div class=\"row mb-3\">\n <div class=\"col-12\">\n <div class=\"card gradient-custom-branding white text-center p-1 p-sm-2\">\n <div class=\"card-header p-1 p-sm-2\">\n <div class=\"d-flex justify-content-between align-items-start mb-3 mb-md-0\">\n <div>\n @if (showDocumentation) {\n <button\n class=\"btn btn-sm document-btn\"\n (click)=\"navigateToDocumentation()\">\n Documentation\n </button>\n }\n </div>\n <div>\n @if (showSupport) {\n <button\n class=\"btn btn-sm btn-primary\"\n (click)=\"navigateToSupport()\">\n Support\n </button>\n }\n </div>\n </div>\n\n <h1>You need help?</h1>\n <p><em>Please search through our frequently asked questions first.</em></p>\n </div>\n <div class=\"card-block p-2 p-sm-2\">\n <fieldset>\n <legend></legend>\n <label for=\"faq-search\" class=\"visually-hidden\">Search in FAQs</label>\n <input type=\"text\"\n id=\"faq-search\"\n name=\"faq-search\"\n class=\"form-control bg-white\"\n placeholder=\"Search FAQs...\"\n (input)=\"filter($event.target.value)\"\n #messageInput\n aria-label=\"Search FAQs...\" />\n </fieldset>\n </div>\n </div>\n </div>\n </div>\n @if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\"\n >\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n </div>\n }\n @if (faqs) {\n @for (category of objectKeys(faqs); track category; let idx1 = $index) {\n <div>\n @if (faqs[category]?.length) {\n <h6 class=\"text-uppercase mt-3 p-1\">{{ faqHashMap[category]?.name }}</h6>\n <div class=\"dashboard\">\n @for (\n faq of faqs[category]; track trackByProductFaqId(idx,\n faq); let idx = $index) {\n <div class=\"faq-item\"\n >\n <div class=\"dashboard-header p-2\">\n <h5 class=\"accordion-title mt-2\">\n <a class=\"accordion-toggle collapsed\"\n data-bs-toggle=\"collapse\"\n (click)=\"onCollapseToggle(idx + '-' + idx1, faq?.answer)\"\n [href]=\"'#collapse' + idx + idx1\">\n {{ faq.question }}\n </a>\n </h5>\n @if (canEditFaq && faq?.id) {\n <a class=\"faq-edit-link\"\n [pTooltip]=\"'Admin.Faq.EditTitle' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n [attr.aria-label]=\"'Admin.Faq.EditTitle' | transloco\"\n [routerLink]=\"[routers.faqDetails + faq.id]\"\n target=\"_blank\">\n <i class=\"fa fa-edit edit-icon\" aria-hidden=\"true\"></i>\n </a>\n }\n </div>\n <div [id]=\"'collapse' + idx + idx1\"\n class=\"panel-collapse p-3 collapse in\">\n <div class=\"card-block\">\n @if (faq?.answer) {\n <div class=\"ql-container ql-snow no-border\">\n <div class=\"ql-editor\"\n [innerHTML]=\"sanitizedFaqAnswers[idx + '-' + idx1]\">\n </div>\n </div>\n }\n </div>\n </div>\n </div>\n }\n </div>\n }\n </div>\n }\n }\n @if (isLoaded && (totalRecords === 0 || allFaqFalse)) {\n <div>\n <pw-no-data [withImage]=\"true\" message=\"This is embarrassing - we couldn't find any FAQ.\"> </pw-no-data>\n </div>\n }\n</div>\n",
341
+ styles: ["@charset \"UTF-8\";:root{--first: rgb(23 105 225);--second: rgb(54 194 131);--third: rgb(255 171 0);--text: rgb(34 34 34);--tabs_bg: rgb(23 105 225);--tabs_sub_bg: color-mix(in srgb, var(--first, rgb(23 105 225)) 85%, #000000);--tabs_text: rgb(255 255 255);--titles: rgb(34 34 34);--sidebar_bg: rgb(0, 48, 63);--sidebar_text: rgb(255 255 255);--dashboard_bg: rgb(255 255 255);--public-btn-radius: 24px}.card-header h1,.card-header p{color:#fff!important}.faq-item{border:1px solid rgb(224,224,224);background-color:#fff;border-radius:8px;margin:8px 0;overflow:hidden;transition:border-color .16s ease-out,box-shadow .16s ease-out}.faq-item:hover{border-color:#bdbdbd}.faq-item .dashboard-header{background:transparent;padding:0;display:flex;align-items:center;position:relative}.faq-item .dashboard-header:after{content:\"\\f078\";font-family:\"Font Awesome 5 Pro\",sans-serif;font-weight:600;font-size:13px;color:#9e9e9e;flex:0 0 auto;margin-left:auto;margin-right:18px;transition:transform .18s ease-out,color .18s ease-out}.faq-item .dashboard-header:hover:after{color:var(--titles)}.faq-item .dashboard-header:has(.accordion-toggle:not(.collapsed)):after{transform:rotate(180deg);color:var(--titles)}.faq-item .accordion-title{margin:0;flex:0 1 auto;min-width:0}.faq-item .faq-edit-link{position:relative;z-index:1;display:inline-flex;align-items:center;flex:0 0 auto;padding:14px 8px;text-decoration:none}.faq-item .faq-edit-link .edit-icon{font-size:14px}.faq-item .accordion-toggle{display:flex;align-items:center;padding:14px 4px 14px 18px;font-size:15px;font-weight:600;line-height:1.45;color:var(--titles);text-decoration:none;cursor:pointer}.faq-item .accordion-toggle:before{content:\"\"!important;position:absolute;inset:0;width:auto;padding:0}.faq-item .accordion-toggle:focus-visible{outline:2px solid var(--first);outline-offset:-2px}.faq-item .panel-collapse{padding:0!important}.faq-item .card-block{padding:4px 18px 16px;border-top:1px solid rgb(238,238,238)}.faq-item .ql-editor{font-size:14px;line-height:1.65;color:#616161;text-align:left}.document-btn{background-color:var(--second);border-color:var(--second)!important;color:#fff}.document-btn:hover{color:var(--second)!important;background-color:transparent!important}.card{background:var(--sidebar_bg)!important;color:var(--sidebar_text)!important;padding:.8rem!important}.card .accordion-toggle:before{content:\"\\f078\"}.card .accordion-toggle.collapsed{transition:all .3s ease-in-out}.card .accordion-toggle.collapsed:before{content:\"\\f054\"}h6{color:var(--titles)!important;font-size:17px;font-weight:700;letter-spacing:.04em;padding:0 0 10px!important;margin:32px 0 14px!important;border-bottom:1px solid rgb(224,224,224)}.accordion-title a{color:var(--titles)!important}.ql-container{resize:none!important;max-width:1000px;margin:0 auto}\n"]
342
+ }]
343
+ }],
344
+ ctorParameters: () => [
345
+ { type: i1$1.CommonService },
346
+ { type: i0.Injector },
347
+ { type: i1$1.ProductService },
348
+ { type: i1$2.DomSanitizer },
349
+ { type: i0.ChangeDetectorRef }
350
+ ]
351
+ });
352
+ const EMPTY_FAQ_STATUS_BADGES = {
353
+ isPublic: false,
354
+ isHidden: false,
355
+ category: void 0,
356
+ categoryLabel: "",
357
+ categoryKeys: [],
358
+ featureKeys: []
359
+ };
360
+ function buildStatusBadges(faq, categories) {
361
+ if (!faq) return { ...EMPTY_FAQ_STATUS_BADGES };
362
+ const resolved = categories ?? [];
363
+ const category = faq.category;
364
+ const named = resolved.find((entry) => entry.key === category);
365
+ return {
366
+ isPublic: faq.public === true,
367
+ isHidden: faq.visible === false,
368
+ category,
369
+ categoryLabel: named?.name || category || "",
370
+ categoryKeys: resolved.map((entry) => entry.key),
371
+ featureKeys: Array.isArray(faq.feature_keys) ? faq.feature_keys : []
372
+ };
807
373
  }
808
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.19", ngImport: i0, type: DashboardLibModule, decorators: [{
809
- type: NgModule,
810
- args: [{
811
- imports: [
812
- CommonModule,
813
- FormsModule,
814
- PipesModule,
815
- SelectModule,
816
- DirectivesModule,
817
- ReactiveFormsModule,
818
- CoreTranslocoModule,
819
- NgbNavModule,
820
- NgbDropdownModule,
821
- UserModuleModule,
822
- RadioButtonModule,
823
- ProgressSpinnerModule,
824
- DashboardContentModule
825
- ],
826
- declarations: [],
827
- providers: [SubscriptionService],
828
- schemas: [CUSTOM_ELEMENTS_SCHEMA]
829
- }]
830
- }] });
831
-
832
- /**
833
- * Drops menu items gated behind a feature flag the current user isn't entitled
834
- * to. An item with no `featureFlag` always passes; one with a `featureFlag`
835
- * passes only when `isEnabled(item.featureFlag)` returns true. Non-destructive
836
- * — returns a new array and never mutates the input.
837
- *
838
- * Shared so every frontend's sidebar gates flag-protected menus identically
839
- * (e.g. alpha-only pages) instead of copy-pasting the predicate.
840
- *
841
- * @param menus - the menu items to filter (one level; pass the specific list to gate)
842
- * @param isEnabled - predicate resolving a flag key to enabled/disabled for the user
843
- */
844
- const filterMenusByFeatureFlag = (menus, isEnabled) => (menus ?? []).filter(menu => !menu.featureFlag || isEnabled(menu.featureFlag));
845
- /**
846
- * Helper function to create menu items with default values
847
- * @param overrides - Partial RouteInfo object with overrides
848
- * @returns RouteInfo object with defaults applied
849
- */
374
+ var FaqDetailsComponent = class FaqDetailsComponent extends AppBaseComponent {
375
+ constructor(commonService, injector, sanitizer, cdr) {
376
+ super(injector);
377
+ this.commonService = commonService;
378
+ this.sanitizer = sanitizer;
379
+ this.cdr = cdr;
380
+ this.isLoading = false;
381
+ this.routers = ADMIN_ROUTERS;
382
+ this.canEditFaq = false;
383
+ this.editFaqId = null;
384
+ this.badges = { ...EMPTY_FAQ_STATUS_BADGES };
385
+ this.hasFaqAdminPermission = false;
386
+ this.faqRef = this.route.snapshot.params["id"];
387
+ this.slug = PermissionService.selectedSubscription?.slug;
388
+ }
389
+ ngOnInit() {
390
+ this.hasFaqAdminPermission = this.permissionService.evaluatePermissions(FAQ_ADMIN_PERMISSION);
391
+ this.getFaq();
392
+ }
393
+ get showStatusBadges() {
394
+ return this.canEditFaq && (this.badges.isPublic || this.badges.isHidden || !!this.badges.categoryLabel);
395
+ }
396
+ getFaq() {
397
+ this.isLoading = true;
398
+ forkJoin({
399
+ faq: this.commonService.getPublicFaqById(this.faqRef),
400
+ categories: this.faqCategories$()
401
+ }).pipe(finalize(() => {
402
+ this.isLoading = false;
403
+ this.cdr.markForCheck();
404
+ })).subscribe(({ faq, categories }) => {
405
+ this.faq = {
406
+ ...faq,
407
+ answer: this.sanitizeAnswer(faq)
408
+ };
409
+ const loaded = !!faq?.question;
410
+ this.canEditFaq = loaded && this.hasFaqAdminPermission;
411
+ this.editFaqId = loaded ? this.resolveEditFaqId(faq) : null;
412
+ this.badges = buildStatusBadges(loaded ? faq : null, categories);
413
+ this.cdr.markForCheck();
414
+ });
415
+ }
416
+ faqCategories$() {
417
+ if (!this.hasFaqAdminPermission) return of(null);
418
+ return this.getUserSubscriptionId().pipe(take(1), map((id) => id ?? PermissionService.selectedSubscription?.id), switchMap((id) => id ? this.commonService.getFaqCategories(id) : of(null)), catchError(() => of(null)));
419
+ }
420
+ sanitizeAnswer(faq) {
421
+ if (!faq?.answer) return;
422
+ const doc = new DOMParser().parseFromString(faq.answer, "text/html");
423
+ doc.querySelectorAll("button").forEach((button) => button.remove());
424
+ return this.sanitizer.bypassSecurityTrustHtml(doc.body.innerHTML);
425
+ }
426
+ resolveEditFaqId(faq) {
427
+ const fromPayload = Number(faq?.id);
428
+ if (Number.isInteger(fromPayload) && fromPayload > 0) return fromPayload;
429
+ const fromRoute = Number(this.faqRef);
430
+ return Number.isInteger(fromRoute) && fromRoute > 0 ? fromRoute : null;
431
+ }
432
+ static {
433
+ this.ɵfac = i0.ɵɵngDeclareFactory({
434
+ minVersion: "12.0.0",
435
+ version: "22.2.0",
436
+ ngImport: i0,
437
+ type: FaqDetailsComponent,
438
+ deps: [
439
+ { token: i1$1.CommonService },
440
+ { token: i0.Injector },
441
+ { token: i1$2.DomSanitizer },
442
+ { token: i0.ChangeDetectorRef }
443
+ ],
444
+ target: i0.ɵɵFactoryTarget.Component
445
+ });
446
+ }
447
+ static {
448
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
449
+ minVersion: "17.0.0",
450
+ version: "22.2.0",
451
+ type: FaqDetailsComponent,
452
+ isStandalone: false,
453
+ selector: "pw-faq-details",
454
+ usesInheritance: true,
455
+ ngImport: i0,
456
+ template: "@if (!isLoading) {\n <div class=\"content-quill-wrapper overflow-hidden mt-5 p-3\">\n <div class=\"content-quill-box\">\n <h2 [class.mb-3]=\"!showStatusBadges\" [class.mb-2]=\"showStatusBadges\">\n {{faq?.question}}\n @if (canEditFaq && editFaqId) {\n <a class=\"faq-edit-link ms-3\"\n [pTooltip]=\"'Admin.Faq.EditTitle' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n [attr.aria-label]=\"'Admin.Faq.EditTitle' | transloco\"\n [routerLink]=\"[routers.faqDetails + editFaqId]\"\n target=\"_blank\">\n <i class=\"fa fa-edit edit-icon\" aria-hidden=\"true\"></i>\n </a>\n }\n </h2>\n @if (showStatusBadges) {\n <!-- `badge-soft` opts these out of Bootstrap's saturated fills and into\n the platform badge doctrine (admin-list-view §B-1..B-5: light tint +\n dark ink, status dot on success/danger, no dot on a taxonomy value).\n Defined once in @posiwise/core-styles — never restate the hexes. -->\n <div class=\"faq-status-badges d-flex flex-wrap align-items-center gap-2 mb-3\">\n @if (badges.categoryLabel) {\n <span class=\"badge badge-soft\"\n [appDynamicBadge]=\"{ itemsArray: badges.categoryKeys, item: badges.category }\"\n color=\"cyan\"\n [pTooltip]=\"badges.featureKeys.length ? badges.featureKeys.join(', ') : ''\"\n tooltipPosition=\"top\"\n appendTo=\"body\">{{ badges.categoryLabel }}</span>\n }\n @if (badges.isPublic) {\n <span class=\"badge badge-soft bg-success\"\n [pTooltip]=\"'Admin.Faq.Tooltip.Public' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">{{ 'Admin.Faq.Public' | transloco }}</span>\n }\n @if (badges.isHidden) {\n <span class=\"badge badge-soft bg-danger\"\n [pTooltip]=\"'Admin.Faq.Tooltip.Hidden' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">{{ 'Admin.Faq.Hidden' | transloco }}</span>\n }\n </div>\n }\n <ng-container>\n <div class=\"ql-container ql-snow no-border\">\n <div class=\"ql-editor\"\n [innerHTML]=\"faq?.answer\">\n </div>\n </div>\n </ng-container>\n </div>\n @if (!faq && !isLoading) {\n <pw-no-data\n message=\"No Faq found\">\n </pw-no-data>\n }\n <div class=\"text-end mt-3\">\n <button class=\"btn btn-outline-primary\"\n [routerLink]=\"['/',slug,'faq']\">See all FAQs</button>\n </div>\n </div>\n}\n@if (isLoading) {\n <div class=\"w-100 text-center mt-3\"\n >\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n </div>\n}\n",
457
+ styles: [".ql-container{resize:none!important}.faq-edit-link{text-decoration:none;vertical-align:middle}.faq-edit-link .edit-icon{font-size:16px}\n"],
458
+ dependencies: [
459
+ {
460
+ kind: "directive",
461
+ type: i3$1.RouterLink,
462
+ selector: "[routerLink]",
463
+ inputs: [
464
+ "target",
465
+ "queryParams",
466
+ "fragment",
467
+ "queryParamsHandling",
468
+ "state",
469
+ "info",
470
+ "relativeTo",
471
+ "preserveFragment",
472
+ "skipLocationChange",
473
+ "replaceUrl",
474
+ "browserUrl",
475
+ "routerLink"
476
+ ]
477
+ },
478
+ {
479
+ kind: "directive",
480
+ type: i4.DynamicBadgeDirective,
481
+ selector: "[appDynamicBadge]",
482
+ inputs: [
483
+ "appDynamicBadge",
484
+ "color",
485
+ "colorByName",
486
+ "dataName"
487
+ ]
488
+ },
489
+ {
490
+ kind: "component",
491
+ type: i2$2.ProgressSpinner,
492
+ selector: "p-progress-spinner, p-progressspinner",
493
+ inputs: [
494
+ "value",
495
+ "strokeWidth",
496
+ "animationDuration",
497
+ "min",
498
+ "max",
499
+ "ariaLabel",
500
+ "fill"
501
+ ]
502
+ },
503
+ {
504
+ kind: "directive",
505
+ type: i5$1.Tooltip,
506
+ selector: "[pTooltip]",
507
+ inputs: [
508
+ "tooltipPosition",
509
+ "tooltipEvent",
510
+ "positionStyle",
511
+ "tooltipStyleClass",
512
+ "tooltipZIndex",
513
+ "escape",
514
+ "showDelay",
515
+ "hideDelay",
516
+ "life",
517
+ "positionTop",
518
+ "positionLeft",
519
+ "autoHide",
520
+ "fitContent",
521
+ "hideOnEscape",
522
+ "showOnEllipsis",
523
+ "pTooltip",
524
+ "tooltipDisabled",
525
+ "tooltipOptions",
526
+ "appendTo",
527
+ "pTooltipPT",
528
+ "pTooltipUnstyled"
529
+ ]
530
+ },
531
+ {
532
+ kind: "component",
533
+ type: i6.NoDataComponent,
534
+ selector: "pw-no-data",
535
+ inputs: [
536
+ "message",
537
+ "description",
538
+ "withImage"
539
+ ]
540
+ },
541
+ {
542
+ kind: "pipe",
543
+ type: i7.TranslocoPipe,
544
+ name: "transloco"
545
+ }
546
+ ]
547
+ });
548
+ }
549
+ };
550
+ i0.ɵɵngDeclareClassMetadata({
551
+ minVersion: "12.0.0",
552
+ version: "22.2.0",
553
+ ngImport: i0,
554
+ type: FaqDetailsComponent,
555
+ decorators: [{
556
+ type: Component,
557
+ args: [{
558
+ selector: "pw-faq-details",
559
+ standalone: false,
560
+ template: "@if (!isLoading) {\n <div class=\"content-quill-wrapper overflow-hidden mt-5 p-3\">\n <div class=\"content-quill-box\">\n <h2 [class.mb-3]=\"!showStatusBadges\" [class.mb-2]=\"showStatusBadges\">\n {{faq?.question}}\n @if (canEditFaq && editFaqId) {\n <a class=\"faq-edit-link ms-3\"\n [pTooltip]=\"'Admin.Faq.EditTitle' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n [attr.aria-label]=\"'Admin.Faq.EditTitle' | transloco\"\n [routerLink]=\"[routers.faqDetails + editFaqId]\"\n target=\"_blank\">\n <i class=\"fa fa-edit edit-icon\" aria-hidden=\"true\"></i>\n </a>\n }\n </h2>\n @if (showStatusBadges) {\n <!-- `badge-soft` opts these out of Bootstrap's saturated fills and into\n the platform badge doctrine (admin-list-view §B-1..B-5: light tint +\n dark ink, status dot on success/danger, no dot on a taxonomy value).\n Defined once in @posiwise/core-styles — never restate the hexes. -->\n <div class=\"faq-status-badges d-flex flex-wrap align-items-center gap-2 mb-3\">\n @if (badges.categoryLabel) {\n <span class=\"badge badge-soft\"\n [appDynamicBadge]=\"{ itemsArray: badges.categoryKeys, item: badges.category }\"\n color=\"cyan\"\n [pTooltip]=\"badges.featureKeys.length ? badges.featureKeys.join(', ') : ''\"\n tooltipPosition=\"top\"\n appendTo=\"body\">{{ badges.categoryLabel }}</span>\n }\n @if (badges.isPublic) {\n <span class=\"badge badge-soft bg-success\"\n [pTooltip]=\"'Admin.Faq.Tooltip.Public' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">{{ 'Admin.Faq.Public' | transloco }}</span>\n }\n @if (badges.isHidden) {\n <span class=\"badge badge-soft bg-danger\"\n [pTooltip]=\"'Admin.Faq.Tooltip.Hidden' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\">{{ 'Admin.Faq.Hidden' | transloco }}</span>\n }\n </div>\n }\n <ng-container>\n <div class=\"ql-container ql-snow no-border\">\n <div class=\"ql-editor\"\n [innerHTML]=\"faq?.answer\">\n </div>\n </div>\n </ng-container>\n </div>\n @if (!faq && !isLoading) {\n <pw-no-data\n message=\"No Faq found\">\n </pw-no-data>\n }\n <div class=\"text-end mt-3\">\n <button class=\"btn btn-outline-primary\"\n [routerLink]=\"['/',slug,'faq']\">See all FAQs</button>\n </div>\n </div>\n}\n@if (isLoading) {\n <div class=\"w-100 text-center mt-3\"\n >\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n </div>\n}\n",
561
+ styles: [".ql-container{resize:none!important}.faq-edit-link{text-decoration:none;vertical-align:middle}.faq-edit-link .edit-icon{font-size:16px}\n"]
562
+ }]
563
+ }],
564
+ ctorParameters: () => [
565
+ { type: i1$1.CommonService },
566
+ { type: i0.Injector },
567
+ { type: i1$2.DomSanitizer },
568
+ { type: i0.ChangeDetectorRef }
569
+ ]
570
+ });
571
+ var UserFeedbackComponent = class UserFeedbackComponent extends AppBaseComponent {
572
+ constructor(injector, commonService, cdr) {
573
+ super(injector);
574
+ this.commonService = commonService;
575
+ this.cdr = cdr;
576
+ this.rating = 3;
577
+ this.selectedValue = null;
578
+ this.questions = [];
579
+ this.counter = Array;
580
+ this.showSection = true;
581
+ }
582
+ ngOnInit() {
583
+ this.subscriptionId = PermissionService.selectedSubscription?.id;
584
+ this.getFeedbackQuestions();
585
+ this.userService.getUserInfo().subscribe({ next: (user) => {
586
+ this.user = user;
587
+ this.cdr.markForCheck();
588
+ } });
589
+ this.checkFeedBackExpiry();
590
+ }
591
+ checkFeedBackExpiry() {
592
+ const item = localStorage.getItem("showFeedBack");
593
+ if (item) {
594
+ const currentDate = Date.now();
595
+ const expiryDate = new Date(JSON.parse(item)).getTime();
596
+ this.showSection = currentDate > expiryDate;
597
+ }
598
+ }
599
+ closeSection() {
600
+ this.showSection = false;
601
+ const addedTime = moment(/* @__PURE__ */ new Date()).add(7, "days").toDate();
602
+ localStorage.setItem("showFeedBack", JSON.stringify(addedTime));
603
+ }
604
+ getFeedbackQuestions() {
605
+ if (this.subscriptionId) this.commonService.feedbackQuestions(this.subscriptionId).subscribe((res) => {
606
+ this.questions = res;
607
+ this.cdr.markForCheck();
608
+ });
609
+ }
610
+ onSubmit(questionId, formValue) {
611
+ if (formValue?.feedback) {
612
+ const data = {
613
+ subscription_id: this.subscriptionId,
614
+ feedback_question_id: questionId,
615
+ value: Number(formValue?.feedback),
616
+ comment: formValue?.description
617
+ };
618
+ this.commonService.userFeedbacks(data).subscribe(() => {
619
+ this.getFeedbackQuestions();
620
+ this.cdr.markForCheck();
621
+ });
622
+ }
623
+ }
624
+ trackByQuestion(_index, item) {
625
+ return item.id;
626
+ }
627
+ static {
628
+ this.ɵfac = i0.ɵɵngDeclareFactory({
629
+ minVersion: "12.0.0",
630
+ version: "22.2.0",
631
+ ngImport: i0,
632
+ type: UserFeedbackComponent,
633
+ deps: [
634
+ { token: i0.Injector },
635
+ { token: i1$1.CommonService },
636
+ { token: i0.ChangeDetectorRef }
637
+ ],
638
+ target: i0.ɵɵFactoryTarget.Component
639
+ });
640
+ }
641
+ static {
642
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
643
+ minVersion: "17.0.0",
644
+ version: "22.2.0",
645
+ type: UserFeedbackComponent,
646
+ isStandalone: false,
647
+ selector: "pw-user-feedback",
648
+ usesInheritance: true,
649
+ ngImport: i0,
650
+ template: "@if (showSection) {\n @if (questions?.length) {\n <div class=\"mt-4\"\n >\n <div class=\"card pb-1\">\n <h3 class=\"text-end me-3 pt-2 cursor-pointer\"\n (keydown.enter)=\"closeSection()\"\n (click)=\"closeSection()\">&times;</h3>\n @for (question of questions; track trackByQuestion($index, question); let first = $first) {\n <div class=\"card-content p-0\"\n >\n <div class=\"card-header\">\n <form #feedbackForm=\"ngForm\">\n <div class=\"col-lg-8 p-0 mx-auto\">\n @if (first) {\n <h3 class=\"mb-1\"\n >Your input is valuable to us</h3>\n }\n @if (first) {\n <p class=\"mb-4\"\n >\n Please take a moment to answer these questions\n </p>\n }\n <h6 class=\"fw-bold pb-3 mx-auto\">{{ question?.question }}</h6>\n <div class=\"text-center row p-2 mx-md-2 feedback-value\">\n <span class=\"col-auto me-0\">Not at all</span>\n @for (val of counter(11); track val; let i = $index) {\n <div class=\"p-field-checkbox col-auto ms-0 me-0\">\n <p-radio-button name=\"feedback\" [(ngModel)]=\"selectedValue\" [value]=\"i\" [inputId]=\"i\"></p-radio-button>\n <br />\n <label [for]=\"i\">{{ i }}</label>\n </div>\n }\n <span class=\"col-auto ms-0\">Extremely</span>\n </div>\n <div class=\"text mt-3\">\n <h6>Can you tell us the reason for your score? Do you have any particular features you want us to build or fix?</h6>\n <label for=\"user-feedback-description\" class=\"visually-hidden\">Reason for your score</label>\n <textarea id=\"user-feedback-description\"\n rows=\"4\"\n name=\"description\"\n placeholder=\"“What is the primary reason for your score?”\"\n ngModel\n type=\"text\"\n pInputTextarea\n class=\"form-control\"\n aria-label=\"“What is the primary reason for your score?”\">\n </textarea>\n </div>\n <div class=\"mt-3\">\n <button class=\"btn btn-primary d-block mx-auto\"\n (click)=\"onSubmit(question?.id, feedbackForm.value)\">\n Submit\n </button>\n </div>\n </div>\n </form>\n </div>\n </div>\n }\n </div>\n </div>\n }\n}\n",
651
+ styles: ["::ng-deep .p-radiobutton-checked .p-radiobutton-box{border-color:var(--first)!important;background:var(--first)!important}.feedback-value{justify-content:center}.feedback-value label{color:#000000de;cursor:pointer;font-size:1rem;font-weight:400;letter-spacing:normal;margin-left:10px;margin-right:10px;text-transform:none}.feedback-value .p-field-checkbox{margin:0 10px}\n"],
652
+ dependencies: [
653
+ {
654
+ kind: "directive",
655
+ type: i2$1.ɵNgNoValidate,
656
+ selector: "form:not([ngNoForm]):not([ngNativeValidate])"
657
+ },
658
+ {
659
+ kind: "directive",
660
+ type: i2$1.DefaultValueAccessor,
661
+ selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
662
+ },
663
+ {
664
+ kind: "directive",
665
+ type: i2$1.NgControlStatus,
666
+ selector: "[formControlName],[ngModel],[formControl]"
667
+ },
668
+ {
669
+ kind: "directive",
670
+ type: i2$1.NgControlStatusGroup,
671
+ selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"
672
+ },
673
+ {
674
+ kind: "directive",
675
+ type: i2$1.NgModel,
676
+ selector: "[ngModel]:not([formControlName]):not([formControl])",
677
+ inputs: [
678
+ "name",
679
+ "disabled",
680
+ "ngModel",
681
+ "ngModelOptions"
682
+ ],
683
+ outputs: ["ngModelChange"],
684
+ exportAs: ["ngModel"]
685
+ },
686
+ {
687
+ kind: "directive",
688
+ type: i2$1.NgForm,
689
+ selector: "form:not([ngNoForm]):not([formGroup]):not([formArray]),ng-form,[ngForm]",
690
+ inputs: ["ngFormOptions"],
691
+ outputs: ["ngSubmit"],
692
+ exportAs: ["ngForm"]
693
+ },
694
+ {
695
+ kind: "component",
696
+ type: i3.RadioButton,
697
+ selector: "p-radiobutton, p-radio-button",
698
+ inputs: [
699
+ "value",
700
+ "tabindex",
701
+ "inputId",
702
+ "ariaLabelledBy",
703
+ "ariaLabel",
704
+ "autofocus",
705
+ "binary",
706
+ "variant",
707
+ "size"
708
+ ],
709
+ outputs: [
710
+ "onClick",
711
+ "onFocus",
712
+ "onBlur"
713
+ ]
714
+ }
715
+ ]
716
+ });
717
+ }
718
+ };
719
+ i0.ɵɵngDeclareClassMetadata({
720
+ minVersion: "12.0.0",
721
+ version: "22.2.0",
722
+ ngImport: i0,
723
+ type: UserFeedbackComponent,
724
+ decorators: [{
725
+ type: Component,
726
+ args: [{
727
+ selector: "pw-user-feedback",
728
+ standalone: false,
729
+ template: "@if (showSection) {\n @if (questions?.length) {\n <div class=\"mt-4\"\n >\n <div class=\"card pb-1\">\n <h3 class=\"text-end me-3 pt-2 cursor-pointer\"\n (keydown.enter)=\"closeSection()\"\n (click)=\"closeSection()\">&times;</h3>\n @for (question of questions; track trackByQuestion($index, question); let first = $first) {\n <div class=\"card-content p-0\"\n >\n <div class=\"card-header\">\n <form #feedbackForm=\"ngForm\">\n <div class=\"col-lg-8 p-0 mx-auto\">\n @if (first) {\n <h3 class=\"mb-1\"\n >Your input is valuable to us</h3>\n }\n @if (first) {\n <p class=\"mb-4\"\n >\n Please take a moment to answer these questions\n </p>\n }\n <h6 class=\"fw-bold pb-3 mx-auto\">{{ question?.question }}</h6>\n <div class=\"text-center row p-2 mx-md-2 feedback-value\">\n <span class=\"col-auto me-0\">Not at all</span>\n @for (val of counter(11); track val; let i = $index) {\n <div class=\"p-field-checkbox col-auto ms-0 me-0\">\n <p-radio-button name=\"feedback\" [(ngModel)]=\"selectedValue\" [value]=\"i\" [inputId]=\"i\"></p-radio-button>\n <br />\n <label [for]=\"i\">{{ i }}</label>\n </div>\n }\n <span class=\"col-auto ms-0\">Extremely</span>\n </div>\n <div class=\"text mt-3\">\n <h6>Can you tell us the reason for your score? Do you have any particular features you want us to build or fix?</h6>\n <label for=\"user-feedback-description\" class=\"visually-hidden\">Reason for your score</label>\n <textarea id=\"user-feedback-description\"\n rows=\"4\"\n name=\"description\"\n placeholder=\"“What is the primary reason for your score?”\"\n ngModel\n type=\"text\"\n pInputTextarea\n class=\"form-control\"\n aria-label=\"“What is the primary reason for your score?”\">\n </textarea>\n </div>\n <div class=\"mt-3\">\n <button class=\"btn btn-primary d-block mx-auto\"\n (click)=\"onSubmit(question?.id, feedbackForm.value)\">\n Submit\n </button>\n </div>\n </div>\n </form>\n </div>\n </div>\n }\n </div>\n </div>\n }\n}\n",
730
+ styles: ["::ng-deep .p-radiobutton-checked .p-radiobutton-box{border-color:var(--first)!important;background:var(--first)!important}.feedback-value{justify-content:center}.feedback-value label{color:#000000de;cursor:pointer;font-size:1rem;font-weight:400;letter-spacing:normal;margin-left:10px;margin-right:10px;text-transform:none}.feedback-value .p-field-checkbox{margin:0 10px}\n"]
731
+ }]
732
+ }],
733
+ ctorParameters: () => [
734
+ { type: i0.Injector },
735
+ { type: i1$1.CommonService },
736
+ { type: i0.ChangeDetectorRef }
737
+ ]
738
+ });
739
+ var HomeComponent = class HomeComponent extends AppBaseComponent {
740
+ constructor(injector, hopscotchService, cdr) {
741
+ super(injector);
742
+ this.hopscotchService = hopscotchService;
743
+ this.cdr = cdr;
744
+ this.componentActive = true;
745
+ }
746
+ sanitizeContent(jsonString) {
747
+ let sanitizedString = jsonString.replaceAll("'", "\"");
748
+ sanitizedString = sanitizedString.replace(/<img\s+src="([^"]+)"/g, String.raw`<img src=\"$1\"`);
749
+ sanitizedString = sanitizedString.replace(/,\s*([}\]])/g, "$1");
750
+ return sanitizedString;
751
+ }
752
+ ngOnInit() {
753
+ this.selectedSubscriptionSlug = PermissionService.selectedSubscription?.slug;
754
+ this.subscriptionId = PermissionService.selectedSubscription?.id;
755
+ this.userStore().subscribe((state) => {
756
+ if (state) this.userService.getCurrentUserObject("active_tips").subscribe((response) => {
757
+ if (response?.length) {
758
+ const welcomeTips = response.find((x) => x.name === "welcome");
759
+ if (welcomeTips) {
760
+ const steps = JSON.parse(this.sanitizeContent(welcomeTips.instructions)).steps;
761
+ try {
762
+ this.hopscotchService.initializeTour("dashboard", steps, {
763
+ tip_id: welcomeTips.id,
764
+ disregarded: true
765
+ }, this.subscriptionId);
766
+ } catch (error) {
767
+ console.error("Error parsing JSON:", error);
768
+ }
769
+ }
770
+ }
771
+ this.cdr.markForCheck();
772
+ });
773
+ this.cdr.markForCheck();
774
+ });
775
+ this.userStore().subscribe({
776
+ next: (user) => {
777
+ this.user = user;
778
+ if (this.user) this.userSlug = user.slug;
779
+ this.cdr.markForCheck();
780
+ },
781
+ error: (error) => {
782
+ this.toast.showToast(error);
783
+ this.cdr.markForCheck();
784
+ }
785
+ });
786
+ }
787
+ ngOnDestroy() {
788
+ this.hopscotchService.endTour();
789
+ super.ngOnDestroy();
790
+ }
791
+ static {
792
+ this.ɵfac = i0.ɵɵngDeclareFactory({
793
+ minVersion: "12.0.0",
794
+ version: "22.2.0",
795
+ ngImport: i0,
796
+ type: HomeComponent,
797
+ deps: [
798
+ { token: i0.Injector },
799
+ { token: i1$1.HopscotchService },
800
+ { token: i0.ChangeDetectorRef }
801
+ ],
802
+ target: i0.ɵɵFactoryTarget.Component
803
+ });
804
+ }
805
+ static {
806
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
807
+ minVersion: "14.0.0",
808
+ version: "22.2.0",
809
+ type: HomeComponent,
810
+ isStandalone: false,
811
+ selector: "pw-home",
812
+ usesInheritance: true,
813
+ ngImport: i0,
814
+ template: "<pw-user-feedback></pw-user-feedback>\n<div class=\"row mt-3\">\n <div class=\"col-12 col-lg-6 mt-2 mb-4\">\n <div class=\"card\">\n <div class=\"card-content p-0\">\n <div class=\"card-header d-flex mt-0\">\n <div class=\"w-100\">\n <div id=\"cards\"></div>\n <h3 class=\"mb-3\">{{'ManageYourAccount'|transloco}}</h3>\n <p>{{'ManageYourAccountDescription'|transloco}}</p>\n </div>\n <div class=\"ms-3 img-wrapper\">\n <img src=\"assets/img/products/hyper-dashboard/ManageYourAccount.png\"\n alt=\"img\"\n class=\"img-fluid\" />\n </div>\n </div>\n <div class=\"card-footer px-3\">\n <a routerLink=\"/account/details\"\n class=\"d-block\">{{'ManageYourAccount'|transloco}}</a>\n </div>\n <div id=\"tips-onboarding-step2\"></div>\n </div>\n </div>\n </div>\n <div class=\"col-12 col-lg-6 mt-2 mb-4\">\n <div class=\"card\">\n <div class=\"card-content p-0\">\n <div class=\"card-header d-flex mt-0\">\n <div class=\"w-100\">\n <h3 class=\"mb-3\">{{'UpdateYourProfile'|transloco}}</h3>\n <p>{{'UpdateYourProfileDescription'|transloco}}</p>\n </div>\n <div class=\"ms-3 img-wrapper\">\n <img src=\"assets/img/products/hyper-dashboard/UpdateYourProfile.png\"\n alt=\"img\"\n class=\"img-fluid\" />\n </div>\n </div>\n <div class=\"card-footer px-3\">\n <a [routerLink]=\"['/members', userSlug]\"\n class=\"d-block\">{{'UpdateYourProfile'|transloco}}</a>\n </div>\n </div>\n </div>\n </div>\n <div class=\"col-12 col-lg-6 mt-2 mb-4\">\n <div class=\"card\">\n <div class=\"card-content p-0\">\n <div class=\"card-header d-flex mt-0\">\n <div class=\"w-100\">\n <h3 class=\"mb-3\">{{'CommunicationSettings'|transloco}}</h3>\n <p>\n {{'CommunicationSettingsDescription'|transloco}}\n </p>\n </div>\n <div class=\"ms-3 img-wrapper\">\n <img src=\"assets/img/products/hyper-dashboard/CommunicationSettings.png\"\n alt=\"img\"\n class=\"img-fluid\" />\n </div>\n </div>\n <div class=\"card-footer px-3\">\n <a routerLink=\"/settings/communication\"\n class=\"d-block\">{{'GotoCommunicationSettings'|transloco}}</a>\n </div>\n <div id=\"tips-onboarding-step3\"></div>\n </div>\n </div>\n </div>\n <div class=\"col-12 col-lg-6 mt-2 mb-4\">\n <div class=\"card\">\n <div class=\"card-content p-0\">\n <div class=\"card-header d-flex mt-0\">\n <div class=\"w-100\">\n <h3 class=\"mb-3\">{{'NeedHelp'|transloco}}</h3>\n <p>{{'NeedHelpDescription'|transloco}}</p>\n </div>\n <div class=\"ms-3 img-wrapper\">\n <img src=\"assets/img/products/hyper-dashboard/NeedHelp.png\"\n alt=\"img\"\n class=\"img-fluid\" />\n </div>\n </div>\n <div class=\"card-footer px-3\">\n <a [routerLink]=\"'/' + selectedSubscriptionSlug + '/faq'\"\n class=\"d-block\">{{'SeeAllOurFaq'|transloco}}</a>\n </div>\n <div id=\"tips-onboarding-step4\"></div>\n </div>\n </div>\n </div>\n</div>\n",
815
+ styles: ["::ng-deep .hopscotch-title{text-align:center!important;margin-bottom:20px!important}::ng-deep .hopscotch-title h2{margin:0}::ng-deep .hopscotch-content{text-align:center;padding:20px;margin:0!important}::ng-deep .hopscotch-content img{width:150px;margin:20px 0}::ng-deep .hopscotch-content p{font-size:16px;color:#555}::ng-deep .hopscotch-step-title{text-align:left;margin-bottom:15px}::ng-deep .hopscotch-step-content{padding:20px;text-align:left!important}::ng-deep .hopscotch-step-content p{font-size:14px;color:#555;margin-bottom:10px;text-align:left!important}\n"],
816
+ dependencies: [
817
+ {
818
+ kind: "directive",
819
+ type: i3$1.RouterLink,
820
+ selector: "[routerLink]",
821
+ inputs: [
822
+ "target",
823
+ "queryParams",
824
+ "fragment",
825
+ "queryParamsHandling",
826
+ "state",
827
+ "info",
828
+ "relativeTo",
829
+ "preserveFragment",
830
+ "skipLocationChange",
831
+ "replaceUrl",
832
+ "browserUrl",
833
+ "routerLink"
834
+ ]
835
+ },
836
+ {
837
+ kind: "directive",
838
+ type: i4.LazyImgDirective,
839
+ selector: "img"
840
+ },
841
+ {
842
+ kind: "component",
843
+ type: UserFeedbackComponent,
844
+ selector: "pw-user-feedback"
845
+ },
846
+ {
847
+ kind: "pipe",
848
+ type: i7.TranslocoPipe,
849
+ name: "transloco"
850
+ }
851
+ ]
852
+ });
853
+ }
854
+ };
855
+ i0.ɵɵngDeclareClassMetadata({
856
+ minVersion: "12.0.0",
857
+ version: "22.2.0",
858
+ ngImport: i0,
859
+ type: HomeComponent,
860
+ decorators: [{
861
+ type: Component,
862
+ args: [{
863
+ selector: "pw-home",
864
+ standalone: false,
865
+ template: "<pw-user-feedback></pw-user-feedback>\n<div class=\"row mt-3\">\n <div class=\"col-12 col-lg-6 mt-2 mb-4\">\n <div class=\"card\">\n <div class=\"card-content p-0\">\n <div class=\"card-header d-flex mt-0\">\n <div class=\"w-100\">\n <div id=\"cards\"></div>\n <h3 class=\"mb-3\">{{'ManageYourAccount'|transloco}}</h3>\n <p>{{'ManageYourAccountDescription'|transloco}}</p>\n </div>\n <div class=\"ms-3 img-wrapper\">\n <img src=\"assets/img/products/hyper-dashboard/ManageYourAccount.png\"\n alt=\"img\"\n class=\"img-fluid\" />\n </div>\n </div>\n <div class=\"card-footer px-3\">\n <a routerLink=\"/account/details\"\n class=\"d-block\">{{'ManageYourAccount'|transloco}}</a>\n </div>\n <div id=\"tips-onboarding-step2\"></div>\n </div>\n </div>\n </div>\n <div class=\"col-12 col-lg-6 mt-2 mb-4\">\n <div class=\"card\">\n <div class=\"card-content p-0\">\n <div class=\"card-header d-flex mt-0\">\n <div class=\"w-100\">\n <h3 class=\"mb-3\">{{'UpdateYourProfile'|transloco}}</h3>\n <p>{{'UpdateYourProfileDescription'|transloco}}</p>\n </div>\n <div class=\"ms-3 img-wrapper\">\n <img src=\"assets/img/products/hyper-dashboard/UpdateYourProfile.png\"\n alt=\"img\"\n class=\"img-fluid\" />\n </div>\n </div>\n <div class=\"card-footer px-3\">\n <a [routerLink]=\"['/members', userSlug]\"\n class=\"d-block\">{{'UpdateYourProfile'|transloco}}</a>\n </div>\n </div>\n </div>\n </div>\n <div class=\"col-12 col-lg-6 mt-2 mb-4\">\n <div class=\"card\">\n <div class=\"card-content p-0\">\n <div class=\"card-header d-flex mt-0\">\n <div class=\"w-100\">\n <h3 class=\"mb-3\">{{'CommunicationSettings'|transloco}}</h3>\n <p>\n {{'CommunicationSettingsDescription'|transloco}}\n </p>\n </div>\n <div class=\"ms-3 img-wrapper\">\n <img src=\"assets/img/products/hyper-dashboard/CommunicationSettings.png\"\n alt=\"img\"\n class=\"img-fluid\" />\n </div>\n </div>\n <div class=\"card-footer px-3\">\n <a routerLink=\"/settings/communication\"\n class=\"d-block\">{{'GotoCommunicationSettings'|transloco}}</a>\n </div>\n <div id=\"tips-onboarding-step3\"></div>\n </div>\n </div>\n </div>\n <div class=\"col-12 col-lg-6 mt-2 mb-4\">\n <div class=\"card\">\n <div class=\"card-content p-0\">\n <div class=\"card-header d-flex mt-0\">\n <div class=\"w-100\">\n <h3 class=\"mb-3\">{{'NeedHelp'|transloco}}</h3>\n <p>{{'NeedHelpDescription'|transloco}}</p>\n </div>\n <div class=\"ms-3 img-wrapper\">\n <img src=\"assets/img/products/hyper-dashboard/NeedHelp.png\"\n alt=\"img\"\n class=\"img-fluid\" />\n </div>\n </div>\n <div class=\"card-footer px-3\">\n <a [routerLink]=\"'/' + selectedSubscriptionSlug + '/faq'\"\n class=\"d-block\">{{'SeeAllOurFaq'|transloco}}</a>\n </div>\n <div id=\"tips-onboarding-step4\"></div>\n </div>\n </div>\n </div>\n</div>\n",
866
+ styles: ["::ng-deep .hopscotch-title{text-align:center!important;margin-bottom:20px!important}::ng-deep .hopscotch-title h2{margin:0}::ng-deep .hopscotch-content{text-align:center;padding:20px;margin:0!important}::ng-deep .hopscotch-content img{width:150px;margin:20px 0}::ng-deep .hopscotch-content p{font-size:16px;color:#555}::ng-deep .hopscotch-step-title{text-align:left;margin-bottom:15px}::ng-deep .hopscotch-step-content{padding:20px;text-align:left!important}::ng-deep .hopscotch-step-content p{font-size:14px;color:#555;margin-bottom:10px;text-align:left!important}\n"]
867
+ }]
868
+ }],
869
+ ctorParameters: () => [
870
+ { type: i0.Injector },
871
+ { type: i1$1.HopscotchService },
872
+ { type: i0.ChangeDetectorRef }
873
+ ]
874
+ });
875
+ var CurrentNotificationsComponent = class CurrentNotificationsComponent {
876
+ constructor(notificationService, cdr) {
877
+ this.notificationService = notificationService;
878
+ this.cdr = cdr;
879
+ this.notificationCount = 0;
880
+ this.noNoti = true;
881
+ this.itemsPerPage = 100;
882
+ this.notifications = [];
883
+ this.currentPage = 1;
884
+ this.isLoaded = false;
885
+ this.totalPages = 1;
886
+ this.totalRecords = 0;
887
+ }
888
+ ngOnInit() {
889
+ this.getNotifications();
890
+ }
891
+ getNotifications() {
892
+ this.notificationService.getNotifications({
893
+ page: this.currentPage,
894
+ page_size: this.itemsPerPage
895
+ }).subscribe((data) => {
896
+ if (Array.isArray(data?.notes) && data?.notes?.length > 0) {
897
+ this.totalRecords = data.unfiltered_count;
898
+ this.notifications = data.notes?.filter((note) => !note.dismissed && note.show_on_dashboard);
899
+ this.totalPages = Math.ceil(data.unfiltered_count / this.itemsPerPage);
900
+ this.noNoti = true;
901
+ if (this.notifications?.length) this.noNoti = false;
902
+ }
903
+ this.cdr.markForCheck();
904
+ }).add(() => {
905
+ this.isLoaded = true;
906
+ this.cdr.markForCheck();
907
+ });
908
+ }
909
+ nextPage() {
910
+ if (this.currentPage < this.totalPages) {
911
+ this.currentPage++;
912
+ this.getNotifications();
913
+ }
914
+ }
915
+ previousPage() {
916
+ if (this.currentPage > 1) {
917
+ this.currentPage--;
918
+ this.getNotifications();
919
+ }
920
+ }
921
+ dismiss(id, e) {
922
+ this.notificationService.dismissNotification(id).subscribe(() => {
923
+ const index = this.notifications.indexOf(e);
924
+ this.notifications.splice(index, 1);
925
+ if (this.notifications.length === 0) this.noNoti = true;
926
+ this.cdr.markForCheck();
927
+ $("#noty").slideUp("slow", () => {
928
+ $("#noty").remove();
929
+ });
930
+ });
931
+ }
932
+ trackByNotification(_index, item) {
933
+ return item.id;
934
+ }
935
+ static {
936
+ this.ɵfac = i0.ɵɵngDeclareFactory({
937
+ minVersion: "12.0.0",
938
+ version: "22.2.0",
939
+ ngImport: i0,
940
+ type: CurrentNotificationsComponent,
941
+ deps: [{ token: i1$1.NotificationService }, { token: i0.ChangeDetectorRef }],
942
+ target: i0.ɵɵFactoryTarget.Component
943
+ });
944
+ }
945
+ static {
946
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
947
+ minVersion: "17.0.0",
948
+ version: "22.2.0",
949
+ type: CurrentNotificationsComponent,
950
+ isStandalone: false,
951
+ selector: "pw-current-notifications",
952
+ ngImport: i0,
953
+ template: "<div class=\"row main-div\">\n <div class=\"w-100 text-center mt-3\">\n @if (!isLoaded) {\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n }\n </div>\n @if (notifications?.length && isLoaded) {\n <div class=\"col-12 col-sm-12 col-md-12 mb-5\"\n >\n <div class=\"card\">\n <div class=\"card-body\">\n <ul class=\"noti-list\">\n @for (item of notifications; track trackByNotification($index, item)) {\n <li\n class=\"p-3 border-bottom border-bottom-blue-grey border-bottom-lighten-4 d-flex align-items-center\">\n <span class=\"btn btn-circle me-2\"\n [ngClass]=\"{\n 'btn-danger': item.note_type === 'administrative',\n 'btn-secondary': item.note_type === 'object_event',\n 'btn-primary': item.note_type === 'user_generated'\n }\">\n <i\n class=\"fal float-start\"\n [ngClass]=\"{\n 'fa-bell': item.note_type === 'administrative',\n 'fa-share-alt': item.note_type === 'object_event',\n 'fa-bells': item.note_type === 'user_generated'\n }\"\n aria-hidden=\"true\"\n ></i>\n </span>\n <span class=\"d-inline-block noty-body\">\n <span class=\"noti-title line-height-1p5 d-block text-bold-400\">{{\n item.content\n }}</span>\n <span class=\"noti-text\"><span class=\"fal fa-clock\"></span>\n {{ item?.created_at | sinceAgo }}</span>\n </span>\n <span class=\"noti-buttons\">\n <button class=\"btn float-end\">\n <i\n class=\"far fa-trash-alt\"\n (click)=\"dismiss(item.id, item)\"\n (keydown.enter)=\"dismiss(item.id, item)\"\n aria-hidden=\"true\"\n ></i>\n </button>\n </span>\n </li>\n }\n </ul>\n </div>\n <div class=\"pagination-container d-flex justify-content-between align-items-center mt-3 mb-3\">\n <pw-records-summary [showing]=\"totalRecords\" [total]=\"totalRecords\" />\n <div class=\"d-flex align-items-center\">\n <button class=\"btn btn-outline-primary me-2\" (click)=\"previousPage()\" [disabled]=\"currentPage === 1\">\n <i class=\"fas fa-chevron-left\"></i>\n </button>\n <span>Page {{ currentPage }} of {{ totalPages }}</span>\n <button class=\"btn btn-outline-primary ms-2\" (click)=\"nextPage()\" [disabled]=\"currentPage === totalPages\">\n <i class=\"fas fa-chevron-right\"></i>\n </button>\n </div>\n </div>\n </div>\n </div>\n}\n\n@if (noNoti && isLoaded) {\n <div class=\"col-12 col-sm-12 col-md-12\"\n >\n <pw-no-data [withImage]=\"true\" message=\"You are all caught up\" description=\"You currently do not have any notifications.\">\n </pw-no-data>\n </div>\n}\n</div>\n",
954
+ styles: [".icon-dismiss{position:relative;right:15px;top:30px;z-index:9}.noti-list{overflow-x:hidden!important}.noti-buttons{flex:auto}.main-div{padding:0 20px}.card{padding-bottom:0}@media screen and (max-width:480px){.noty-body{width:240px}}.pagination-container{padding:0 1rem}\n"],
955
+ dependencies: [
956
+ {
957
+ kind: "directive",
958
+ type: i2.NgClass,
959
+ selector: "[ngClass]",
960
+ inputs: ["class", "ngClass"]
961
+ },
962
+ {
963
+ kind: "component",
964
+ type: i2$2.ProgressSpinner,
965
+ selector: "p-progress-spinner, p-progressspinner",
966
+ inputs: [
967
+ "value",
968
+ "strokeWidth",
969
+ "animationDuration",
970
+ "min",
971
+ "max",
972
+ "ariaLabel",
973
+ "fill"
974
+ ]
975
+ },
976
+ {
977
+ kind: "component",
978
+ type: i6.NoDataComponent,
979
+ selector: "pw-no-data",
980
+ inputs: [
981
+ "message",
982
+ "description",
983
+ "withImage"
984
+ ]
985
+ },
986
+ {
987
+ kind: "component",
988
+ type: i6.RecordsSummaryComponent,
989
+ selector: "pw-records-summary",
990
+ inputs: ["showing", "total"]
991
+ },
992
+ {
993
+ kind: "pipe",
994
+ type: i5.SinceAgoPipe,
995
+ name: "sinceAgo"
996
+ }
997
+ ]
998
+ });
999
+ }
1000
+ };
1001
+ i0.ɵɵngDeclareClassMetadata({
1002
+ minVersion: "12.0.0",
1003
+ version: "22.2.0",
1004
+ ngImport: i0,
1005
+ type: CurrentNotificationsComponent,
1006
+ decorators: [{
1007
+ type: Component,
1008
+ args: [{
1009
+ selector: "pw-current-notifications",
1010
+ standalone: false,
1011
+ template: "<div class=\"row main-div\">\n <div class=\"w-100 text-center mt-3\">\n @if (!isLoaded) {\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n }\n </div>\n @if (notifications?.length && isLoaded) {\n <div class=\"col-12 col-sm-12 col-md-12 mb-5\"\n >\n <div class=\"card\">\n <div class=\"card-body\">\n <ul class=\"noti-list\">\n @for (item of notifications; track trackByNotification($index, item)) {\n <li\n class=\"p-3 border-bottom border-bottom-blue-grey border-bottom-lighten-4 d-flex align-items-center\">\n <span class=\"btn btn-circle me-2\"\n [ngClass]=\"{\n 'btn-danger': item.note_type === 'administrative',\n 'btn-secondary': item.note_type === 'object_event',\n 'btn-primary': item.note_type === 'user_generated'\n }\">\n <i\n class=\"fal float-start\"\n [ngClass]=\"{\n 'fa-bell': item.note_type === 'administrative',\n 'fa-share-alt': item.note_type === 'object_event',\n 'fa-bells': item.note_type === 'user_generated'\n }\"\n aria-hidden=\"true\"\n ></i>\n </span>\n <span class=\"d-inline-block noty-body\">\n <span class=\"noti-title line-height-1p5 d-block text-bold-400\">{{\n item.content\n }}</span>\n <span class=\"noti-text\"><span class=\"fal fa-clock\"></span>\n {{ item?.created_at | sinceAgo }}</span>\n </span>\n <span class=\"noti-buttons\">\n <button class=\"btn float-end\">\n <i\n class=\"far fa-trash-alt\"\n (click)=\"dismiss(item.id, item)\"\n (keydown.enter)=\"dismiss(item.id, item)\"\n aria-hidden=\"true\"\n ></i>\n </button>\n </span>\n </li>\n }\n </ul>\n </div>\n <div class=\"pagination-container d-flex justify-content-between align-items-center mt-3 mb-3\">\n <pw-records-summary [showing]=\"totalRecords\" [total]=\"totalRecords\" />\n <div class=\"d-flex align-items-center\">\n <button class=\"btn btn-outline-primary me-2\" (click)=\"previousPage()\" [disabled]=\"currentPage === 1\">\n <i class=\"fas fa-chevron-left\"></i>\n </button>\n <span>Page {{ currentPage }} of {{ totalPages }}</span>\n <button class=\"btn btn-outline-primary ms-2\" (click)=\"nextPage()\" [disabled]=\"currentPage === totalPages\">\n <i class=\"fas fa-chevron-right\"></i>\n </button>\n </div>\n </div>\n </div>\n </div>\n}\n\n@if (noNoti && isLoaded) {\n <div class=\"col-12 col-sm-12 col-md-12\"\n >\n <pw-no-data [withImage]=\"true\" message=\"You are all caught up\" description=\"You currently do not have any notifications.\">\n </pw-no-data>\n </div>\n}\n</div>\n",
1012
+ styles: [".icon-dismiss{position:relative;right:15px;top:30px;z-index:9}.noti-list{overflow-x:hidden!important}.noti-buttons{flex:auto}.main-div{padding:0 20px}.card{padding-bottom:0}@media screen and (max-width:480px){.noty-body{width:240px}}.pagination-container{padding:0 1rem}\n"]
1013
+ }]
1014
+ }],
1015
+ ctorParameters: () => [{ type: i1$1.NotificationService }, { type: i0.ChangeDetectorRef }]
1016
+ });
1017
+ var DismissedNotificationsComponent = class DismissedNotificationsComponent {
1018
+ constructor(notificationService, cdr) {
1019
+ this.notificationService = notificationService;
1020
+ this.cdr = cdr;
1021
+ this.notificationCount = 0;
1022
+ this.noNoti = true;
1023
+ this.dismissedNotifications = [];
1024
+ this.isLoaded = false;
1025
+ this.itemsPerPage = 100;
1026
+ this.currentPage = 1;
1027
+ this.totalPages = 1;
1028
+ this.totalRecords = 0;
1029
+ }
1030
+ ngOnInit() {
1031
+ this.getNotifications();
1032
+ }
1033
+ getNotifications() {
1034
+ this.notificationService.getDismissedNotifications({
1035
+ page: this.currentPage,
1036
+ page_size: this.itemsPerPage
1037
+ }).subscribe((data) => {
1038
+ if (Array.isArray(data?.notes) && data?.notes?.length > 0) {
1039
+ this.noNoti = false;
1040
+ this.dismissedNotifications = data?.notes;
1041
+ this.totalRecords = data?.unfiltered_count;
1042
+ this.totalPages = Math.ceil(data.unfiltered_count / this.itemsPerPage);
1043
+ }
1044
+ this.cdr.markForCheck();
1045
+ }).add(() => {
1046
+ this.isLoaded = true;
1047
+ this.cdr.markForCheck();
1048
+ });
1049
+ }
1050
+ nextPage() {
1051
+ if (this.currentPage < this.totalPages) {
1052
+ this.currentPage++;
1053
+ this.getNotifications();
1054
+ }
1055
+ }
1056
+ previousPage() {
1057
+ if (this.currentPage > 1) {
1058
+ this.currentPage--;
1059
+ this.getNotifications();
1060
+ }
1061
+ }
1062
+ dismiss(id, e) {
1063
+ HelperService.raiseDeletePopup().then((res) => {
1064
+ if (res.value) this.notificationService.deleteNotifications(id).subscribe(() => {
1065
+ const index = this.dismissedNotifications.indexOf(e);
1066
+ this.dismissedNotifications.splice(index, 1);
1067
+ if (this.dismissedNotifications.length === 0) this.noNoti = true;
1068
+ this.cdr.markForCheck();
1069
+ $("#noty").slideUp("slow", () => {
1070
+ $("#noty").remove();
1071
+ });
1072
+ });
1073
+ });
1074
+ }
1075
+ restoreNotification(id, e) {
1076
+ this.notificationService.reinstateNotification(id).subscribe(() => {
1077
+ const index = this.dismissedNotifications.indexOf(e);
1078
+ this.dismissedNotifications.splice(index, 1);
1079
+ if (this.dismissedNotifications.length === 0) this.noNoti = true;
1080
+ this.cdr.markForCheck();
1081
+ $("#noty").slideUp("slow", () => {
1082
+ $("#noty").remove();
1083
+ });
1084
+ });
1085
+ }
1086
+ trackByNotification(_index, item) {
1087
+ return item.id;
1088
+ }
1089
+ static {
1090
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1091
+ minVersion: "12.0.0",
1092
+ version: "22.2.0",
1093
+ ngImport: i0,
1094
+ type: DismissedNotificationsComponent,
1095
+ deps: [{ token: i1$1.NotificationService }, { token: i0.ChangeDetectorRef }],
1096
+ target: i0.ɵɵFactoryTarget.Component
1097
+ });
1098
+ }
1099
+ static {
1100
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
1101
+ minVersion: "17.0.0",
1102
+ version: "22.2.0",
1103
+ type: DismissedNotificationsComponent,
1104
+ isStandalone: false,
1105
+ selector: "pw-dismissed-notifications",
1106
+ ngImport: i0,
1107
+ template: "<div class=\"row main-div\">\n <div class=\"w-100 text-center mt-3\">\n @if (!isLoaded) {\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n }\n </div>\n @if (dismissedNotifications?.length && isLoaded) {\n <div class=\"col-12 col-sm-12 col-md-12 mb-5\"\n >\n <div class=\"card\">\n <div class=\"card-body\">\n <ul class=\"noti-list\">\n @for (item of dismissedNotifications; track trackByNotification($index, item)) {\n <li\n class=\"p-3 border-bottom border-bottom-blue-grey border-bottom-lighten-4 d-flex align-items-center\">\n <span class=\"btn btn-circle me-2\"\n [ngClass]=\"{\n 'btn-danger': item.note_type === 'administrative',\n 'btn-secondary': item.note_type === 'object_event',\n 'btn-primary': item.note_type === 'user_generated'\n }\">\n <i\n class=\"fal float-start\"\n [ngClass]=\"{\n 'fa-bell': item.note_type === 'administrative',\n 'fa-share-alt': item.note_type === 'object_event',\n 'fa-bells': item.note_type === 'user_generated'\n }\"\n aria-hidden=\"true\"\n ></i>\n </span>\n <span class=\"d-inline-block noty-body\">\n <span class=\"noti-title line-height-1p5 d-block text-bold-400\">{{\n item.content\n }}</span>\n <span class=\"noti-text\"><span class=\"fal fa-clock\"></span>\n {{ item?.created_at | sinceAgo }}</span>\n </span>\n <span class=\"noti-buttons\">\n <button class=\"btn float-end\">\n <i\n class=\"far fa-trash-alt\"\n (click)=\"dismiss(item.id, item)\"\n (keydown.enter)=\"dismiss(item.id, item)\"\n aria-hidden=\"true\"\n ></i>\n </button>\n <button class=\"btn float-end\">\n <i\n class=\"fas fa-trash-restore-alt\"\n (click)=\"restoreNotification(item.id, item)\"\n (keydown.enter)=\"restoreNotification(item.id, item)\"\n aria-hidden=\"true\"\n ></i>\n </button>\n </span>\n </li>\n }\n </ul>\n </div>\n <div class=\"pagination-container d-flex justify-content-between align-items-center mt-3 mb-3\">\n <pw-records-summary [showing]=\"totalRecords\" [total]=\"totalRecords\" />\n <div class=\"d-flex align-items-center\">\n <button class=\"btn btn-outline-primary me-2\" (click)=\"previousPage()\" [disabled]=\"currentPage === 1\">\n <i class=\"fas fa-chevron-left\"></i>\n </button>\n <span>Page {{ currentPage }} of {{ totalPages }}</span>\n <button class=\"btn btn-outline-primary ms-2\" (click)=\"nextPage()\" [disabled]=\"currentPage === totalPages\">\n <i class=\"fas fa-chevron-right\"></i>\n </button>\n </div>\n </div>\n </div>\n </div>\n}\n\n@if (noNoti && isLoaded) {\n <div class=\"col-12 col-sm-12 col-md-12\"\n >\n <pw-no-data [withImage]=\"true\" message=\"You currently do not have any dismissed notifications\">\n </pw-no-data>\n </div>\n}\n</div>\n",
1108
+ styles: [".icon-dismiss{position:relative;right:15px;top:30px;z-index:9}.noti-list{overflow-x:hidden!important}.noti-buttons{flex:auto}.main-div{padding:0 20px}.card{padding-bottom:0}@media screen and (max-width:480px){.noty-body{width:240px}}.pagination-container{padding:0 1rem}\n"],
1109
+ dependencies: [
1110
+ {
1111
+ kind: "directive",
1112
+ type: i2.NgClass,
1113
+ selector: "[ngClass]",
1114
+ inputs: ["class", "ngClass"]
1115
+ },
1116
+ {
1117
+ kind: "component",
1118
+ type: i2$2.ProgressSpinner,
1119
+ selector: "p-progress-spinner, p-progressspinner",
1120
+ inputs: [
1121
+ "value",
1122
+ "strokeWidth",
1123
+ "animationDuration",
1124
+ "min",
1125
+ "max",
1126
+ "ariaLabel",
1127
+ "fill"
1128
+ ]
1129
+ },
1130
+ {
1131
+ kind: "component",
1132
+ type: i6.NoDataComponent,
1133
+ selector: "pw-no-data",
1134
+ inputs: [
1135
+ "message",
1136
+ "description",
1137
+ "withImage"
1138
+ ]
1139
+ },
1140
+ {
1141
+ kind: "component",
1142
+ type: i6.RecordsSummaryComponent,
1143
+ selector: "pw-records-summary",
1144
+ inputs: ["showing", "total"]
1145
+ },
1146
+ {
1147
+ kind: "pipe",
1148
+ type: i5.SinceAgoPipe,
1149
+ name: "sinceAgo"
1150
+ }
1151
+ ]
1152
+ });
1153
+ }
1154
+ };
1155
+ i0.ɵɵngDeclareClassMetadata({
1156
+ minVersion: "12.0.0",
1157
+ version: "22.2.0",
1158
+ ngImport: i0,
1159
+ type: DismissedNotificationsComponent,
1160
+ decorators: [{
1161
+ type: Component,
1162
+ args: [{
1163
+ selector: "pw-dismissed-notifications",
1164
+ standalone: false,
1165
+ template: "<div class=\"row main-div\">\n <div class=\"w-100 text-center mt-3\">\n @if (!isLoaded) {\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n }\n </div>\n @if (dismissedNotifications?.length && isLoaded) {\n <div class=\"col-12 col-sm-12 col-md-12 mb-5\"\n >\n <div class=\"card\">\n <div class=\"card-body\">\n <ul class=\"noti-list\">\n @for (item of dismissedNotifications; track trackByNotification($index, item)) {\n <li\n class=\"p-3 border-bottom border-bottom-blue-grey border-bottom-lighten-4 d-flex align-items-center\">\n <span class=\"btn btn-circle me-2\"\n [ngClass]=\"{\n 'btn-danger': item.note_type === 'administrative',\n 'btn-secondary': item.note_type === 'object_event',\n 'btn-primary': item.note_type === 'user_generated'\n }\">\n <i\n class=\"fal float-start\"\n [ngClass]=\"{\n 'fa-bell': item.note_type === 'administrative',\n 'fa-share-alt': item.note_type === 'object_event',\n 'fa-bells': item.note_type === 'user_generated'\n }\"\n aria-hidden=\"true\"\n ></i>\n </span>\n <span class=\"d-inline-block noty-body\">\n <span class=\"noti-title line-height-1p5 d-block text-bold-400\">{{\n item.content\n }}</span>\n <span class=\"noti-text\"><span class=\"fal fa-clock\"></span>\n {{ item?.created_at | sinceAgo }}</span>\n </span>\n <span class=\"noti-buttons\">\n <button class=\"btn float-end\">\n <i\n class=\"far fa-trash-alt\"\n (click)=\"dismiss(item.id, item)\"\n (keydown.enter)=\"dismiss(item.id, item)\"\n aria-hidden=\"true\"\n ></i>\n </button>\n <button class=\"btn float-end\">\n <i\n class=\"fas fa-trash-restore-alt\"\n (click)=\"restoreNotification(item.id, item)\"\n (keydown.enter)=\"restoreNotification(item.id, item)\"\n aria-hidden=\"true\"\n ></i>\n </button>\n </span>\n </li>\n }\n </ul>\n </div>\n <div class=\"pagination-container d-flex justify-content-between align-items-center mt-3 mb-3\">\n <pw-records-summary [showing]=\"totalRecords\" [total]=\"totalRecords\" />\n <div class=\"d-flex align-items-center\">\n <button class=\"btn btn-outline-primary me-2\" (click)=\"previousPage()\" [disabled]=\"currentPage === 1\">\n <i class=\"fas fa-chevron-left\"></i>\n </button>\n <span>Page {{ currentPage }} of {{ totalPages }}</span>\n <button class=\"btn btn-outline-primary ms-2\" (click)=\"nextPage()\" [disabled]=\"currentPage === totalPages\">\n <i class=\"fas fa-chevron-right\"></i>\n </button>\n </div>\n </div>\n </div>\n </div>\n}\n\n@if (noNoti && isLoaded) {\n <div class=\"col-12 col-sm-12 col-md-12\"\n >\n <pw-no-data [withImage]=\"true\" message=\"You currently do not have any dismissed notifications\">\n </pw-no-data>\n </div>\n}\n</div>\n",
1166
+ styles: [".icon-dismiss{position:relative;right:15px;top:30px;z-index:9}.noti-list{overflow-x:hidden!important}.noti-buttons{flex:auto}.main-div{padding:0 20px}.card{padding-bottom:0}@media screen and (max-width:480px){.noty-body{width:240px}}.pagination-container{padding:0 1rem}\n"]
1167
+ }]
1168
+ }],
1169
+ ctorParameters: () => [{ type: i1$1.NotificationService }, { type: i0.ChangeDetectorRef }]
1170
+ });
1171
+ var NotificationsPageComponent = class NotificationsPageComponent {
1172
+ static {
1173
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1174
+ minVersion: "12.0.0",
1175
+ version: "22.2.0",
1176
+ ngImport: i0,
1177
+ type: NotificationsPageComponent,
1178
+ deps: [],
1179
+ target: i0.ɵɵFactoryTarget.Component
1180
+ });
1181
+ }
1182
+ static {
1183
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
1184
+ minVersion: "14.0.0",
1185
+ version: "22.2.0",
1186
+ type: NotificationsPageComponent,
1187
+ isStandalone: false,
1188
+ selector: "pw-notifications-page",
1189
+ ngImport: i0,
1190
+ template: "<div class=\"row\">\n <div class=\"col-12 col-sm-12 col-md-12 mt-4\">\n <h2 class=\"p-2\">Notifications</h2>\n </div>\n</div>\n\n<ul ngbNav\n #nav=\"ngbNav\"\n class=\"nav-tabs\">\n <li [ngbNavItem]=\"1\">\n <a ngbNavLink>Current Notifications</a>\n <ng-template ngbNavContent>\n <pw-current-notifications></pw-current-notifications>\n </ng-template>\n </li>\n <li [ngbNavItem]=\"2\">\n <a ngbNavLink>Dismissed Notifications</a>\n <ng-template ngbNavContent>\n <pw-dismissed-notifications></pw-dismissed-notifications>\n </ng-template>\n </li>\n</ul>\n\n<div [ngbNavOutlet]=\"nav\"></div>\n",
1191
+ styles: [".icon-dismiss{position:relative;right:15px;top:30px;z-index:9}.noti-list{overflow-x:hidden!important}.noti-buttons{flex:auto}.main-div{padding:0 20px}.card{padding-bottom:0}@media screen and (max-width:480px){.noty-body{width:240px}}.pagination-container{padding:0 1rem}\n"],
1192
+ dependencies: [
1193
+ {
1194
+ kind: "directive",
1195
+ type: i1.NgbNavContent,
1196
+ selector: "ng-template[ngbNavContent]"
1197
+ },
1198
+ {
1199
+ kind: "directive",
1200
+ type: i1.NgbNav,
1201
+ selector: "[ngbNav]",
1202
+ inputs: [
1203
+ "activeId",
1204
+ "animation",
1205
+ "destroyOnHide",
1206
+ "orientation",
1207
+ "roles",
1208
+ "keyboard"
1209
+ ],
1210
+ outputs: [
1211
+ "activeIdChange",
1212
+ "shown",
1213
+ "hidden",
1214
+ "navChange"
1215
+ ],
1216
+ exportAs: ["ngbNav"]
1217
+ },
1218
+ {
1219
+ kind: "directive",
1220
+ type: i1.NgbNavItem,
1221
+ selector: "[ngbNavItem]",
1222
+ inputs: [
1223
+ "destroyOnHide",
1224
+ "disabled",
1225
+ "domId",
1226
+ "ngbNavItem"
1227
+ ],
1228
+ outputs: ["shown", "hidden"],
1229
+ exportAs: ["ngbNavItem"]
1230
+ },
1231
+ {
1232
+ kind: "directive",
1233
+ type: i1.NgbNavItemRole,
1234
+ selector: "[ngbNavItem]:not(ng-container)"
1235
+ },
1236
+ {
1237
+ kind: "directive",
1238
+ type: i1.NgbNavLink,
1239
+ selector: "a[ngbNavLink]"
1240
+ },
1241
+ {
1242
+ kind: "directive",
1243
+ type: i1.NgbNavLinkBase,
1244
+ selector: "[ngbNavLink]"
1245
+ },
1246
+ {
1247
+ kind: "component",
1248
+ type: i1.NgbNavOutlet,
1249
+ selector: "[ngbNavOutlet]",
1250
+ inputs: ["paneRole", "ngbNavOutlet"]
1251
+ },
1252
+ {
1253
+ kind: "component",
1254
+ type: CurrentNotificationsComponent,
1255
+ selector: "pw-current-notifications"
1256
+ },
1257
+ {
1258
+ kind: "component",
1259
+ type: DismissedNotificationsComponent,
1260
+ selector: "pw-dismissed-notifications"
1261
+ }
1262
+ ]
1263
+ });
1264
+ }
1265
+ };
1266
+ i0.ɵɵngDeclareClassMetadata({
1267
+ minVersion: "12.0.0",
1268
+ version: "22.2.0",
1269
+ ngImport: i0,
1270
+ type: NotificationsPageComponent,
1271
+ decorators: [{
1272
+ type: Component,
1273
+ args: [{
1274
+ selector: "pw-notifications-page",
1275
+ standalone: false,
1276
+ template: "<div class=\"row\">\n <div class=\"col-12 col-sm-12 col-md-12 mt-4\">\n <h2 class=\"p-2\">Notifications</h2>\n </div>\n</div>\n\n<ul ngbNav\n #nav=\"ngbNav\"\n class=\"nav-tabs\">\n <li [ngbNavItem]=\"1\">\n <a ngbNavLink>Current Notifications</a>\n <ng-template ngbNavContent>\n <pw-current-notifications></pw-current-notifications>\n </ng-template>\n </li>\n <li [ngbNavItem]=\"2\">\n <a ngbNavLink>Dismissed Notifications</a>\n <ng-template ngbNavContent>\n <pw-dismissed-notifications></pw-dismissed-notifications>\n </ng-template>\n </li>\n</ul>\n\n<div [ngbNavOutlet]=\"nav\"></div>\n",
1277
+ styles: [".icon-dismiss{position:relative;right:15px;top:30px;z-index:9}.noti-list{overflow-x:hidden!important}.noti-buttons{flex:auto}.main-div{padding:0 20px}.card{padding-bottom:0}@media screen and (max-width:480px){.noty-body{width:240px}}.pagination-container{padding:0 1rem}\n"]
1278
+ }]
1279
+ }]
1280
+ });
1281
+ var SearchComponent = class SearchComponent {
1282
+ constructor(route, service, cdr) {
1283
+ this.route = route;
1284
+ this.service = service;
1285
+ this.cdr = cdr;
1286
+ this.emptySearchResult = {
1287
+ users: [],
1288
+ faqs: [],
1289
+ recipients: []
1290
+ };
1291
+ this.isLoaded = false;
1292
+ this.objectKeys = Object.keys;
1293
+ }
1294
+ ngOnInit() {
1295
+ this.subscriptionId = PermissionService.selectedSubscription.id;
1296
+ this.route.queryParams.subscribe((response) => {
1297
+ this.keyword = response["keyword"];
1298
+ if (this.keyword) this.search();
1299
+ this.cdr.markForCheck();
1300
+ });
1301
+ }
1302
+ search() {
1303
+ this.isLoaded = false;
1304
+ this.service.search(this.keyword, this.subscriptionId).subscribe((response) => {
1305
+ this.result = {
1306
+ ...this.emptySearchResult,
1307
+ ...response
1308
+ };
1309
+ this.cdr.markForCheck();
1310
+ }).add(() => {
1311
+ this.isLoaded = true;
1312
+ this.cdr.markForCheck();
1313
+ });
1314
+ }
1315
+ get hasResults() {
1316
+ return this.searchGroups.some((group) => group.length > 0);
1317
+ }
1318
+ get searchGroups() {
1319
+ return [
1320
+ "users",
1321
+ "faqs",
1322
+ "recipients"
1323
+ ].map((group) => this.getResultGroup(group));
1324
+ }
1325
+ getResultGroup(group) {
1326
+ if (!this.isSearchGroupKey(group)) return [];
1327
+ const resultGroup = this.result?.[group];
1328
+ if (!Array.isArray(resultGroup)) return [];
1329
+ return resultGroup.filter((item) => this.isRenderableResult(item));
1330
+ }
1331
+ isSearchGroupKey(group) {
1332
+ return group === "users" || group === "faqs" || group === "recipients";
1333
+ }
1334
+ isRenderableResult(item) {
1335
+ if (item == null) return false;
1336
+ if (typeof item !== "object") return true;
1337
+ return Object.values(item).some((value) => {
1338
+ if (Array.isArray(value)) return value.length > 0;
1339
+ return value !== null && value !== void 0 && value !== "";
1340
+ });
1341
+ }
1342
+ handleImageError(event, fallbackPath) {
1343
+ HelperService.handleImageFallbackPath(event, fallbackPath);
1344
+ }
1345
+ trackByUserId(_index, item) {
1346
+ return item.id;
1347
+ }
1348
+ trackByFaqId(_index, item) {
1349
+ return item.id;
1350
+ }
1351
+ trackBySkill(_index, item) {
1352
+ return item.id;
1353
+ }
1354
+ static {
1355
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1356
+ minVersion: "12.0.0",
1357
+ version: "22.2.0",
1358
+ ngImport: i0,
1359
+ type: SearchComponent,
1360
+ deps: [
1361
+ { token: i3$1.ActivatedRoute },
1362
+ { token: i1$1.DashboardService },
1363
+ { token: i0.ChangeDetectorRef }
1364
+ ],
1365
+ target: i0.ɵɵFactoryTarget.Component
1366
+ });
1367
+ }
1368
+ static {
1369
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
1370
+ minVersion: "17.0.0",
1371
+ version: "22.2.0",
1372
+ type: SearchComponent,
1373
+ isStandalone: false,
1374
+ selector: "pw-search",
1375
+ ngImport: i0,
1376
+ template: "<div class=\"container-fluid dashboard-card overflow-hidden\">\n <div class=\"dashboard\">\n <div class=\"dashboard-body\">\n <div class=\"row\">\n <div class=\"col-12 my-3 mt-4\">\n <h2>Search Results</h2>\n </div>\n </div>\n @if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\">\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n </div>\n }\n @if (isLoaded) {\n <div class=\"row faqlist search-result\">\n <div class=\"col-12\">\n <div data-cy=\"faq-list\">\n @if (result) {\n @for (group of objectKeys(result); track group; let idx = $index) {\n <div>\n @switch (group) {\n @case ('users') {\n @if (getResultGroup(group).length) {\n <h6 class=\"text-uppercase mt-3 p-1\">{{ group }}</h6>\n <div class=\"dashboard\">\n @for (\n user of getResultGroup(group); track trackByUserId($index, user); let idx1 = $index) {\n <div class=\"faq-item\">\n <div class=\"dashboard-header p-2\">\n <h5 class=\"accordion-title mt-2\">\n <a\n class=\"accordion-toggle collapsed\"\n data-bs-toggle=\"collapse\"\n [href]=\"'#collapse' + idx1 + idx\"><span>{{\n user.first_name !== null\n ? user.first_name\n : user?.email\n }}</span></a>\n </h5>\n <p class=\"m-0 title-font\">\n @if (user.user_skills?.length > 0) {\n <strong>Skills :\n </strong>\n }\n @for (\n skill of (user.user_skills ?? []); track trackBySkill($index, skill); let isLast = $last) {\n <span class=\"badge bg-success m-1\">\n {{ skill.name\n }}{{ isLast ? '' : ', ' }}</span>\n }\n </p>\n @if (\n user?.user_profile?.headline\n ?.length > 0\n ) {\n <p class=\"m-0 title-font\">\n {{ user?.user_profile?.headline }}\n </p>\n }\n @if (\n user?.user_profile?.country\n ?.length > 0\n ) {\n <p class=\"m-0 title-font\">\n <strong>Location : </strong>{{ user?.user_profile?.country }}\n </p>\n }\n </div>\n <div [id]=\"'collapse' + idx1 + idx\"\n class=\"panel-collapse collapse in p-3\">\n <div class=\"display-block overflow-hidden\">\n <div class=\"row align-items-center\">\n <div class=\"col-sm-3\">\n @if (user?.user_avatar?.length > 0) {\n @for (\n profile_image of user.user_avatar; track profile_image) {\n @if (profile_image.width === 200) {\n <div class=\"text-center my-2\">\n <div class=\"avatar\">\n <img class=\"img-fluid\"\n [src]=\"profile_image.url\"\n alt=\"Male Icon\"\n (error)=\"handleImageError($event, 'assets/img/icons/male.png')\" />\n </div>\n </div>\n }\n }\n } @else {\n <div class=\"text-center my-2\">\n <div class=\"avatar\">\n <img src=\"/assets/img/icons/male.png\"\n alt=\"\"\n class=\"img-fluid\" />\n </div>\n </div>\n }\n </div>\n <div class=\"col-sm-9\">\n <ul class=\"name-fl\">\n <li>\n <strong>First Name:\n </strong>\n <span>{{\n user.first_name !== null\n ? user.first_name\n : 'N/A'\n }}</span>\n </li>\n <li>\n <strong>Last Name:\n </strong>\n <span>{{\n user.last_name !== null\n ? user.last_name\n : 'N/A'\n }}</span>\n </li>\n </ul>\n <p>\n <strong>Email: </strong>\n <span>{{\n user.email !== null\n ? user.email\n : 'N/A'\n }}</span>\n </p>\n <p>\n <strong>Description:\n </strong>\n <span>{{\n user?.user_profile\n ?.description !== null\n ? user?.user_profile\n ?.description\n : 'N/A'\n }}</span>\n </p>\n <div class=\"view-btn text-end\">\n <a class=\"btn btn-outline-primary inline-block\"\n [routerLink]=\"[\n '/members/' +\n user.slug\n ]\">View More</a>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n }\n </div>\n }\n }\n @case ('faqs') {\n @if (getResultGroup(group).length) {\n <h6>\n {{ group | uppercase }}\n </h6>\n @for (\n faq of getResultGroup(group); track trackByFaqId($index, faq); let idx2 = $index) {\n <div class=\"faq-item\">\n <div class=\"dashboard-header p-2\">\n <h5 class=\"accordion-title mt-2\">\n <a\n class=\"accordion-toggle collapsed\"\n data-bs-toggle=\"collapse\"\n [href]=\"'#collapse' + idx2 + idx\">{{ faq.question }}</a>\n </h5>\n </div>\n <div [id]=\"'collapse' + idx2 + idx\"\n class=\"panel-collapse collapse in\">\n @if (faq?.answer) {\n <div class=\"ql-container ql-snow no-border\">\n <div class=\"ql-editor\"\n [innerHTML]=\"faq?.answer |safe:'html'\">\n </div>\n </div>\n }\n </div>\n </div>\n }\n }\n }\n }\n </div>\n }\n @if (!hasResults) {\n <pw-no-data [withImage]=\"true\" [message]=\"'Search.NoDataMessage' | transloco\" [description]=\"'Search.NoDataDescription' | transloco\">\n </pw-no-data>\n }\n }\n </div>\n </div>\n </div>\n }\n </div>\n </div>\n</div>\n",
1377
+ styles: ["@charset \"UTF-8\";:root{--first: rgb(23 105 225);--second: rgb(54 194 131);--third: rgb(255 171 0);--text: rgb(34 34 34);--tabs_bg: rgb(23 105 225);--tabs_sub_bg: color-mix(in srgb, var(--first, rgb(23 105 225)) 85%, #000000);--tabs_text: rgb(255 255 255);--titles: rgb(34 34 34);--sidebar_bg: rgb(0, 48, 63);--sidebar_text: rgb(255 255 255);--dashboard_bg: rgb(255 255 255);--public-btn-radius: 24px}h6{background:var(--sidebar_bg)!important;color:var(--sidebar_text)!important;padding:.8rem!important}.faq-search-answer a{color:#144086;display:inline-block;float:right;font-size:14px;margin-right:15px}::ng-deep .ql-snow *{font-size:16px!important}.faq-search-answer a:after{right:-10px}.faq-item{border:1px dashed rgba(0,0,0,.1);background-color:#fff;border-radius:3px;margin:10px 0;transition:all .2s ease-in-out}.faq-item .dashboard-header{background:#fff}.accord-title1 .faq-search-answer a{margin-right:0!important}a.accordion-toggle:after{display:none}.accord-title p.title-font{font-size:.8rem}.panel-collapse.show{border-top:1px dashed rgba(0,0,0,.1);padding-top:20px;padding-bottom:20px}.panel-collapse ul{margin-bottom:1rem}.panel-collapse ul.name-fl li{display:inline-block;padding-right:15px}.view-btn a{display:inline-block}.avatar{width:130px;margin:0 auto;display:block}.accordion-title a{color:var(--sidebar_bg)!important}.card-header h1,.card-header p{color:#fff!important}.card .accordion-toggle:before{content:\"\\f078\"}.card .accordion-toggle.collapsed{transition:all .3s ease-in-out}.card .accordion-toggle.collapsed:before{content:\"\\f054\"}.card-block p{font-size:16px}.card,h6{background:var(--sidebar_bg)!important;color:var(--sidebar_text)!important;padding:.8rem!important}.ql-container{resize:none!important;max-width:1000px;margin:0 auto}\n"],
1378
+ dependencies: [
1379
+ {
1380
+ kind: "directive",
1381
+ type: i3$1.RouterLink,
1382
+ selector: "[routerLink]",
1383
+ inputs: [
1384
+ "target",
1385
+ "queryParams",
1386
+ "fragment",
1387
+ "queryParamsHandling",
1388
+ "state",
1389
+ "info",
1390
+ "relativeTo",
1391
+ "preserveFragment",
1392
+ "skipLocationChange",
1393
+ "replaceUrl",
1394
+ "browserUrl",
1395
+ "routerLink"
1396
+ ]
1397
+ },
1398
+ {
1399
+ kind: "directive",
1400
+ type: i4.LazyImgDirective,
1401
+ selector: "img"
1402
+ },
1403
+ {
1404
+ kind: "component",
1405
+ type: i2$2.ProgressSpinner,
1406
+ selector: "p-progress-spinner, p-progressspinner",
1407
+ inputs: [
1408
+ "value",
1409
+ "strokeWidth",
1410
+ "animationDuration",
1411
+ "min",
1412
+ "max",
1413
+ "ariaLabel",
1414
+ "fill"
1415
+ ]
1416
+ },
1417
+ {
1418
+ kind: "component",
1419
+ type: i6.NoDataComponent,
1420
+ selector: "pw-no-data",
1421
+ inputs: [
1422
+ "message",
1423
+ "description",
1424
+ "withImage"
1425
+ ]
1426
+ },
1427
+ {
1428
+ kind: "pipe",
1429
+ type: i2.UpperCasePipe,
1430
+ name: "uppercase"
1431
+ },
1432
+ {
1433
+ kind: "pipe",
1434
+ type: i7.TranslocoPipe,
1435
+ name: "transloco"
1436
+ },
1437
+ {
1438
+ kind: "pipe",
1439
+ type: i5.DOMSanitizerPipe,
1440
+ name: "safe"
1441
+ }
1442
+ ]
1443
+ });
1444
+ }
1445
+ };
1446
+ i0.ɵɵngDeclareClassMetadata({
1447
+ minVersion: "12.0.0",
1448
+ version: "22.2.0",
1449
+ ngImport: i0,
1450
+ type: SearchComponent,
1451
+ decorators: [{
1452
+ type: Component,
1453
+ args: [{
1454
+ selector: "pw-search",
1455
+ standalone: false,
1456
+ template: "<div class=\"container-fluid dashboard-card overflow-hidden\">\n <div class=\"dashboard\">\n <div class=\"dashboard-body\">\n <div class=\"row\">\n <div class=\"col-12 my-3 mt-4\">\n <h2>Search Results</h2>\n </div>\n </div>\n @if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\">\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n </div>\n }\n @if (isLoaded) {\n <div class=\"row faqlist search-result\">\n <div class=\"col-12\">\n <div data-cy=\"faq-list\">\n @if (result) {\n @for (group of objectKeys(result); track group; let idx = $index) {\n <div>\n @switch (group) {\n @case ('users') {\n @if (getResultGroup(group).length) {\n <h6 class=\"text-uppercase mt-3 p-1\">{{ group }}</h6>\n <div class=\"dashboard\">\n @for (\n user of getResultGroup(group); track trackByUserId($index, user); let idx1 = $index) {\n <div class=\"faq-item\">\n <div class=\"dashboard-header p-2\">\n <h5 class=\"accordion-title mt-2\">\n <a\n class=\"accordion-toggle collapsed\"\n data-bs-toggle=\"collapse\"\n [href]=\"'#collapse' + idx1 + idx\"><span>{{\n user.first_name !== null\n ? user.first_name\n : user?.email\n }}</span></a>\n </h5>\n <p class=\"m-0 title-font\">\n @if (user.user_skills?.length > 0) {\n <strong>Skills :\n </strong>\n }\n @for (\n skill of (user.user_skills ?? []); track trackBySkill($index, skill); let isLast = $last) {\n <span class=\"badge bg-success m-1\">\n {{ skill.name\n }}{{ isLast ? '' : ', ' }}</span>\n }\n </p>\n @if (\n user?.user_profile?.headline\n ?.length > 0\n ) {\n <p class=\"m-0 title-font\">\n {{ user?.user_profile?.headline }}\n </p>\n }\n @if (\n user?.user_profile?.country\n ?.length > 0\n ) {\n <p class=\"m-0 title-font\">\n <strong>Location : </strong>{{ user?.user_profile?.country }}\n </p>\n }\n </div>\n <div [id]=\"'collapse' + idx1 + idx\"\n class=\"panel-collapse collapse in p-3\">\n <div class=\"display-block overflow-hidden\">\n <div class=\"row align-items-center\">\n <div class=\"col-sm-3\">\n @if (user?.user_avatar?.length > 0) {\n @for (\n profile_image of user.user_avatar; track profile_image) {\n @if (profile_image.width === 200) {\n <div class=\"text-center my-2\">\n <div class=\"avatar\">\n <img class=\"img-fluid\"\n [src]=\"profile_image.url\"\n alt=\"Male Icon\"\n (error)=\"handleImageError($event, 'assets/img/icons/male.png')\" />\n </div>\n </div>\n }\n }\n } @else {\n <div class=\"text-center my-2\">\n <div class=\"avatar\">\n <img src=\"/assets/img/icons/male.png\"\n alt=\"\"\n class=\"img-fluid\" />\n </div>\n </div>\n }\n </div>\n <div class=\"col-sm-9\">\n <ul class=\"name-fl\">\n <li>\n <strong>First Name:\n </strong>\n <span>{{\n user.first_name !== null\n ? user.first_name\n : 'N/A'\n }}</span>\n </li>\n <li>\n <strong>Last Name:\n </strong>\n <span>{{\n user.last_name !== null\n ? user.last_name\n : 'N/A'\n }}</span>\n </li>\n </ul>\n <p>\n <strong>Email: </strong>\n <span>{{\n user.email !== null\n ? user.email\n : 'N/A'\n }}</span>\n </p>\n <p>\n <strong>Description:\n </strong>\n <span>{{\n user?.user_profile\n ?.description !== null\n ? user?.user_profile\n ?.description\n : 'N/A'\n }}</span>\n </p>\n <div class=\"view-btn text-end\">\n <a class=\"btn btn-outline-primary inline-block\"\n [routerLink]=\"[\n '/members/' +\n user.slug\n ]\">View More</a>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n }\n </div>\n }\n }\n @case ('faqs') {\n @if (getResultGroup(group).length) {\n <h6>\n {{ group | uppercase }}\n </h6>\n @for (\n faq of getResultGroup(group); track trackByFaqId($index, faq); let idx2 = $index) {\n <div class=\"faq-item\">\n <div class=\"dashboard-header p-2\">\n <h5 class=\"accordion-title mt-2\">\n <a\n class=\"accordion-toggle collapsed\"\n data-bs-toggle=\"collapse\"\n [href]=\"'#collapse' + idx2 + idx\">{{ faq.question }}</a>\n </h5>\n </div>\n <div [id]=\"'collapse' + idx2 + idx\"\n class=\"panel-collapse collapse in\">\n @if (faq?.answer) {\n <div class=\"ql-container ql-snow no-border\">\n <div class=\"ql-editor\"\n [innerHTML]=\"faq?.answer |safe:'html'\">\n </div>\n </div>\n }\n </div>\n </div>\n }\n }\n }\n }\n </div>\n }\n @if (!hasResults) {\n <pw-no-data [withImage]=\"true\" [message]=\"'Search.NoDataMessage' | transloco\" [description]=\"'Search.NoDataDescription' | transloco\">\n </pw-no-data>\n }\n }\n </div>\n </div>\n </div>\n }\n </div>\n </div>\n</div>\n",
1457
+ styles: ["@charset \"UTF-8\";:root{--first: rgb(23 105 225);--second: rgb(54 194 131);--third: rgb(255 171 0);--text: rgb(34 34 34);--tabs_bg: rgb(23 105 225);--tabs_sub_bg: color-mix(in srgb, var(--first, rgb(23 105 225)) 85%, #000000);--tabs_text: rgb(255 255 255);--titles: rgb(34 34 34);--sidebar_bg: rgb(0, 48, 63);--sidebar_text: rgb(255 255 255);--dashboard_bg: rgb(255 255 255);--public-btn-radius: 24px}h6{background:var(--sidebar_bg)!important;color:var(--sidebar_text)!important;padding:.8rem!important}.faq-search-answer a{color:#144086;display:inline-block;float:right;font-size:14px;margin-right:15px}::ng-deep .ql-snow *{font-size:16px!important}.faq-search-answer a:after{right:-10px}.faq-item{border:1px dashed rgba(0,0,0,.1);background-color:#fff;border-radius:3px;margin:10px 0;transition:all .2s ease-in-out}.faq-item .dashboard-header{background:#fff}.accord-title1 .faq-search-answer a{margin-right:0!important}a.accordion-toggle:after{display:none}.accord-title p.title-font{font-size:.8rem}.panel-collapse.show{border-top:1px dashed rgba(0,0,0,.1);padding-top:20px;padding-bottom:20px}.panel-collapse ul{margin-bottom:1rem}.panel-collapse ul.name-fl li{display:inline-block;padding-right:15px}.view-btn a{display:inline-block}.avatar{width:130px;margin:0 auto;display:block}.accordion-title a{color:var(--sidebar_bg)!important}.card-header h1,.card-header p{color:#fff!important}.card .accordion-toggle:before{content:\"\\f078\"}.card .accordion-toggle.collapsed{transition:all .3s ease-in-out}.card .accordion-toggle.collapsed:before{content:\"\\f054\"}.card-block p{font-size:16px}.card,h6{background:var(--sidebar_bg)!important;color:var(--sidebar_text)!important;padding:.8rem!important}.ql-container{resize:none!important;max-width:1000px;margin:0 auto}\n"]
1458
+ }]
1459
+ }],
1460
+ ctorParameters: () => [
1461
+ { type: i3$1.ActivatedRoute },
1462
+ { type: i1$1.DashboardService },
1463
+ { type: i0.ChangeDetectorRef }
1464
+ ]
1465
+ });
1466
+ var DashboardContentModule = class DashboardContentModule {
1467
+ static {
1468
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1469
+ minVersion: "12.0.0",
1470
+ version: "22.2.0",
1471
+ ngImport: i0,
1472
+ type: DashboardContentModule,
1473
+ deps: [],
1474
+ target: i0.ɵɵFactoryTarget.NgModule
1475
+ });
1476
+ }
1477
+ static {
1478
+ this.ɵmod = i0.ɵɵngDeclareNgModule({
1479
+ minVersion: "14.0.0",
1480
+ version: "22.2.0",
1481
+ ngImport: i0,
1482
+ type: DashboardContentModule,
1483
+ declarations: [
1484
+ DocumentationComponent,
1485
+ FaqComponent,
1486
+ FaqDetailsComponent,
1487
+ HomeComponent,
1488
+ NotificationsPageComponent,
1489
+ CurrentNotificationsComponent,
1490
+ NotificationsPageComponent,
1491
+ DismissedNotificationsComponent,
1492
+ SearchComponent,
1493
+ UserFeedbackComponent
1494
+ ],
1495
+ imports: [
1496
+ CommonModule,
1497
+ FormsModule,
1498
+ RouterModule,
1499
+ CoreTranslocoModule,
1500
+ DirectivesModule,
1501
+ PipesModule,
1502
+ ProgressSpinnerModule,
1503
+ NgbNavModule,
1504
+ RadioButtonModule,
1505
+ TooltipModule,
1506
+ ResourceSharedComponentsModule
1507
+ ],
1508
+ exports: [
1509
+ DocumentationComponent,
1510
+ FaqComponent,
1511
+ FaqDetailsComponent,
1512
+ HomeComponent,
1513
+ NotificationsPageComponent,
1514
+ CurrentNotificationsComponent,
1515
+ NotificationsPageComponent,
1516
+ DismissedNotificationsComponent,
1517
+ SearchComponent,
1518
+ RadioButtonModule
1519
+ ]
1520
+ });
1521
+ }
1522
+ static {
1523
+ this.ɵinj = i0.ɵɵngDeclareInjector({
1524
+ minVersion: "12.0.0",
1525
+ version: "22.2.0",
1526
+ ngImport: i0,
1527
+ type: DashboardContentModule,
1528
+ imports: [
1529
+ CommonModule,
1530
+ FormsModule,
1531
+ RouterModule,
1532
+ CoreTranslocoModule,
1533
+ DirectivesModule,
1534
+ PipesModule,
1535
+ ProgressSpinnerModule,
1536
+ NgbNavModule,
1537
+ RadioButtonModule,
1538
+ TooltipModule,
1539
+ ResourceSharedComponentsModule,
1540
+ RadioButtonModule
1541
+ ]
1542
+ });
1543
+ }
1544
+ };
1545
+ i0.ɵɵngDeclareClassMetadata({
1546
+ minVersion: "12.0.0",
1547
+ version: "22.2.0",
1548
+ ngImport: i0,
1549
+ type: DashboardContentModule,
1550
+ decorators: [{
1551
+ type: NgModule,
1552
+ args: [{
1553
+ imports: [
1554
+ CommonModule,
1555
+ FormsModule,
1556
+ RouterModule,
1557
+ CoreTranslocoModule,
1558
+ DirectivesModule,
1559
+ PipesModule,
1560
+ ProgressSpinnerModule,
1561
+ NgbNavModule,
1562
+ RadioButtonModule,
1563
+ TooltipModule,
1564
+ ResourceSharedComponentsModule
1565
+ ],
1566
+ declarations: [
1567
+ DocumentationComponent,
1568
+ FaqComponent,
1569
+ FaqDetailsComponent,
1570
+ HomeComponent,
1571
+ NotificationsPageComponent,
1572
+ CurrentNotificationsComponent,
1573
+ NotificationsPageComponent,
1574
+ DismissedNotificationsComponent,
1575
+ SearchComponent,
1576
+ UserFeedbackComponent
1577
+ ],
1578
+ exports: [
1579
+ DocumentationComponent,
1580
+ FaqComponent,
1581
+ FaqDetailsComponent,
1582
+ HomeComponent,
1583
+ NotificationsPageComponent,
1584
+ CurrentNotificationsComponent,
1585
+ NotificationsPageComponent,
1586
+ DismissedNotificationsComponent,
1587
+ SearchComponent,
1588
+ RadioButtonModule
1589
+ ],
1590
+ schemas: [CUSTOM_ELEMENTS_SCHEMA]
1591
+ }]
1592
+ }]
1593
+ });
1594
+ var DashboardLibModule = class DashboardLibModule {
1595
+ static {
1596
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1597
+ minVersion: "12.0.0",
1598
+ version: "22.2.0",
1599
+ ngImport: i0,
1600
+ type: DashboardLibModule,
1601
+ deps: [],
1602
+ target: i0.ɵɵFactoryTarget.NgModule
1603
+ });
1604
+ }
1605
+ static {
1606
+ this.ɵmod = i0.ɵɵngDeclareNgModule({
1607
+ minVersion: "14.0.0",
1608
+ version: "22.2.0",
1609
+ ngImport: i0,
1610
+ type: DashboardLibModule,
1611
+ imports: [
1612
+ CommonModule,
1613
+ FormsModule,
1614
+ PipesModule,
1615
+ SelectModule,
1616
+ DirectivesModule,
1617
+ ReactiveFormsModule,
1618
+ CoreTranslocoModule,
1619
+ NgbNavModule,
1620
+ NgbDropdownModule,
1621
+ UserModuleModule,
1622
+ RadioButtonModule,
1623
+ ProgressSpinnerModule,
1624
+ DashboardContentModule
1625
+ ]
1626
+ });
1627
+ }
1628
+ static {
1629
+ this.ɵinj = i0.ɵɵngDeclareInjector({
1630
+ minVersion: "12.0.0",
1631
+ version: "22.2.0",
1632
+ ngImport: i0,
1633
+ type: DashboardLibModule,
1634
+ providers: [SubscriptionService],
1635
+ imports: [
1636
+ CommonModule,
1637
+ FormsModule,
1638
+ PipesModule,
1639
+ SelectModule,
1640
+ DirectivesModule,
1641
+ ReactiveFormsModule,
1642
+ CoreTranslocoModule,
1643
+ NgbNavModule,
1644
+ NgbDropdownModule,
1645
+ UserModuleModule,
1646
+ RadioButtonModule,
1647
+ ProgressSpinnerModule,
1648
+ DashboardContentModule
1649
+ ]
1650
+ });
1651
+ }
1652
+ };
1653
+ i0.ɵɵngDeclareClassMetadata({
1654
+ minVersion: "12.0.0",
1655
+ version: "22.2.0",
1656
+ ngImport: i0,
1657
+ type: DashboardLibModule,
1658
+ decorators: [{
1659
+ type: NgModule,
1660
+ args: [{
1661
+ imports: [
1662
+ CommonModule,
1663
+ FormsModule,
1664
+ PipesModule,
1665
+ SelectModule,
1666
+ DirectivesModule,
1667
+ ReactiveFormsModule,
1668
+ CoreTranslocoModule,
1669
+ NgbNavModule,
1670
+ NgbDropdownModule,
1671
+ UserModuleModule,
1672
+ RadioButtonModule,
1673
+ ProgressSpinnerModule,
1674
+ DashboardContentModule
1675
+ ],
1676
+ declarations: [],
1677
+ providers: [SubscriptionService],
1678
+ schemas: [CUSTOM_ELEMENTS_SCHEMA]
1679
+ }]
1680
+ }]
1681
+ });
1682
+ const filterMenusByFeatureFlag = (menus, isEnabled) => (menus ?? []).filter((menu) => !menu.featureFlag || isEnabled(menu.featureFlag));
850
1683
  const createMenuItem = (overrides) => ({
851
- permission: '',
852
- path: '',
853
- title: '',
854
- icon: '',
855
- class: '',
856
- badge: '',
857
- badgeClass: '',
858
- isExternalLink: false,
859
- submenu: [],
860
- visible: true,
861
- order: 0,
862
- ...overrides
1684
+ permission: "",
1685
+ path: "",
1686
+ title: "",
1687
+ icon: "",
1688
+ class: "",
1689
+ badge: "",
1690
+ badgeClass: "",
1691
+ isExternalLink: false,
1692
+ submenu: [],
1693
+ visible: true,
1694
+ order: 0,
1695
+ ...overrides
863
1696
  });
864
- /**
865
- * Helper function to create submenu items with default values
866
- * @param overrides - Partial RouteInfo object with overrides
867
- * @returns RouteInfo object with defaults applied
868
- */
869
1697
  const createSubMenuItem = (overrides) => ({
870
- permission: '',
871
- path: '',
872
- title: '',
873
- icon: '',
874
- class: '',
875
- badge: '',
876
- badgeClass: '',
877
- isExternalLink: false,
878
- submenu: [],
879
- visible: true,
880
- ...overrides
1698
+ permission: "",
1699
+ path: "",
1700
+ title: "",
1701
+ icon: "",
1702
+ class: "",
1703
+ badge: "",
1704
+ badgeClass: "",
1705
+ isExternalLink: false,
1706
+ submenu: [],
1707
+ visible: true,
1708
+ ...overrides
881
1709
  });
882
- /**
883
- * Common menu items that can be reused across modules
884
- */
885
1710
  const COMMON_MENUS = {
886
- FAQ_Menu: createMenuItem({
887
- permission: 'Pages.Product.{permission_key}.{feature_key}.FAQ',
888
- path: '/faq',
889
- title: 'FAQ',
890
- icon: 'ft-info',
891
- order: 999
892
- }),
893
- ENTERPRISE_MENU: createMenuItem({
894
- permission: 'Pages.Product.{permission_key}.{feature_key}.Enterprise',
895
- path: '/enterprise',
896
- title: 'Enterprise',
897
- icon: 'ft-package',
898
- class: 'has-sub',
899
- badgeClass: 'badge rounded-pill bg-danger float-end mt-1',
900
- order: 5,
901
- submenu: [
902
- createSubMenuItem({
903
- path: ':slug/enterprise/members',
904
- title: 'Members',
905
- icon: 'far fa-users'
906
- }),
907
- createSubMenuItem({
908
- permission: 'Pages.Alpha',
909
- path: ':slug/enterprise/partners',
910
- title: 'Partners',
911
- icon: 'far fa-users'
912
- }),
913
- createSubMenuItem({
914
- permission: 'Pages.Beta',
915
- path: ':slug/enterprise/groups',
916
- title: 'Teams',
917
- icon: 'far fa-users-class'
918
- }),
919
- createSubMenuItem({
920
- permission: 'Pages.Beta',
921
- path: ':slug/enterprise/communications',
922
- title: 'Communications',
923
- icon: 'fas fa-comments'
924
- }),
925
- createSubMenuItem({
926
- permission: 'Pages.Beta',
927
- path: ':slug/enterprise/wiki',
928
- title: 'Documentation',
929
- icon: 'fab fa-wikipedia-w'
930
- }),
931
- createSubMenuItem({
932
- permission: 'Pages.Beta',
933
- path: ':slug/enterprise/insights',
934
- title: 'Insights',
935
- icon: 'far fa-tag'
936
- })
937
- ]
938
- }),
939
- CHAT_MENU: createMenuItem({
940
- permission: 'Pages.Product.{permission_key}.{feature_key}.Chat',
941
- path: '/message',
942
- title: 'Chat',
943
- icon: 'ft-message-square',
944
- badgeClass: 'badge rounded-pill bg-danger float-end mt-1',
945
- order: 2
946
- }),
947
- BLOG_MENU: createMenuItem({
948
- permission: 'Pages.Product.{permission_key}.{feature_key}.Blog || Pages.Role.MarketingManager || Pages.Role.CustomerSuccessManager',
949
- path: '/posts/list',
950
- title: 'Blog',
951
- icon: 'far fa-blog'
952
- })
1711
+ FAQ_Menu: createMenuItem({
1712
+ permission: "Pages.Product.{permission_key}.{feature_key}.FAQ",
1713
+ path: "/faq",
1714
+ title: "FAQ",
1715
+ icon: "ft-info",
1716
+ order: 999
1717
+ }),
1718
+ ENTERPRISE_MENU: createMenuItem({
1719
+ permission: "Pages.Product.{permission_key}.{feature_key}.Enterprise",
1720
+ path: "/enterprise",
1721
+ title: "Enterprise",
1722
+ icon: "ft-package",
1723
+ class: "has-sub",
1724
+ badgeClass: "badge rounded-pill bg-danger float-end mt-1",
1725
+ order: 5,
1726
+ submenu: [
1727
+ createSubMenuItem({
1728
+ path: ":slug/enterprise/members",
1729
+ title: "Members",
1730
+ icon: "far fa-users"
1731
+ }),
1732
+ createSubMenuItem({
1733
+ permission: "Pages.Alpha",
1734
+ path: ":slug/enterprise/partners",
1735
+ title: "Partners",
1736
+ icon: "far fa-users"
1737
+ }),
1738
+ createSubMenuItem({
1739
+ permission: "Pages.Beta",
1740
+ path: ":slug/enterprise/groups",
1741
+ title: "Teams",
1742
+ icon: "far fa-users-class"
1743
+ }),
1744
+ createSubMenuItem({
1745
+ permission: "Pages.Beta",
1746
+ path: ":slug/enterprise/communications",
1747
+ title: "Communications",
1748
+ icon: "fas fa-comments"
1749
+ }),
1750
+ createSubMenuItem({
1751
+ permission: "Pages.Beta",
1752
+ path: ":slug/enterprise/wiki",
1753
+ title: "Documentation",
1754
+ icon: "fab fa-wikipedia-w"
1755
+ }),
1756
+ createSubMenuItem({
1757
+ permission: "Pages.Beta",
1758
+ path: ":slug/enterprise/insights",
1759
+ title: "Insights",
1760
+ icon: "far fa-tag"
1761
+ })
1762
+ ]
1763
+ }),
1764
+ CHAT_MENU: createMenuItem({
1765
+ permission: "Pages.Product.{permission_key}.{feature_key}.Chat",
1766
+ path: "/message",
1767
+ title: "Chat",
1768
+ icon: "ft-message-square",
1769
+ badgeClass: "badge rounded-pill bg-danger float-end mt-1",
1770
+ order: 2
1771
+ }),
1772
+ BLOG_MENU: createMenuItem({
1773
+ permission: "Pages.Product.{permission_key}.{feature_key}.Blog || Pages.Role.MarketingManager || Pages.Role.CustomerSuccessManager",
1774
+ path: "/posts/list",
1775
+ title: "Blog",
1776
+ icon: "far fa-blog"
1777
+ })
953
1778
  };
954
-
955
- // Centralized admin permissions
956
1779
  const ADMIN_PERMISSIONS = {
957
- GENERIC: 'Pages.Admin',
958
- DOMAIN_CONFIG: 'Pages.Admin.DomainConfig || Pages.Role.MarketingManager',
959
- USERS: 'Pages.Admin.Users',
960
- SUBSCRIPTION: 'Pages.Admin.Subscription',
961
- PRODUCT: 'Pages.Admin.Product',
962
- LOGIN_NOTIFICATION: 'Pages.Admin.LoginNotification || Pages.Role.MarketingManager || Pages.Role.CustomerSuccessManager',
963
- NEWSLETTER: 'Pages.Admin.Newsletter || Pages.Role.MarketingManager || Pages.Role.CustomerSuccessManager',
964
- MAILER: 'Pages.Admin.Mailer',
965
- BLOG: 'Pages.Admin.Blog || Pages.Role.MarketingManager || Pages.Role.CustomerSuccessManager',
966
- FEATURE_FLAGS: 'Pages.Admin.FeatureFlags',
967
- FAQ: 'Pages.Admin.FAQ || Pages.Role.MarketingManager || Pages.Role.CustomerSuccessManager',
968
- INCIDENT: 'Pages.Admin.Incident',
969
- CONTACT_US: 'Pages.Admin.ContactUs',
970
- TIPS: 'Pages.Admin.Tips',
971
- TAGS: 'Pages.Admin.Tags',
972
- ROLES: 'Pages.Admin.Roles',
973
- TOS: 'Pages.Admin.Tos',
974
- CREDENTIAL: 'Pages.Admin.Credential',
975
- OAUTH_CLIENTS: 'Pages.Admin.Oauth',
976
- AMBASSADOR_PAYOUTS: 'Pages.Admin.AmbassadorPayouts',
977
- TRACKING: 'Pages.Admin.Tracking',
978
- GLOBAL_CONFIG: 'Pages.Admin.Global-Config'
1780
+ GENERIC: "Pages.Admin",
1781
+ DOMAIN_CONFIG: "Pages.Admin.DomainConfig || Pages.Role.MarketingManager",
1782
+ USERS: "Pages.Admin.Users",
1783
+ SUBSCRIPTION: "Pages.Admin.Subscription",
1784
+ PRODUCT: "Pages.Admin.Product",
1785
+ LOGIN_NOTIFICATION: "Pages.Admin.LoginNotification || Pages.Role.MarketingManager || Pages.Role.CustomerSuccessManager",
1786
+ NEWSLETTER: "Pages.Admin.Newsletter || Pages.Role.MarketingManager || Pages.Role.CustomerSuccessManager",
1787
+ MAILER: "Pages.Admin.Mailer",
1788
+ BLOG: "Pages.Admin.Blog || Pages.Role.MarketingManager || Pages.Role.CustomerSuccessManager",
1789
+ FEATURE_FLAGS: "Pages.Admin.FeatureFlags",
1790
+ FAQ: "Pages.Admin.FAQ || Pages.Role.MarketingManager || Pages.Role.CustomerSuccessManager",
1791
+ INCIDENT: "Pages.Admin.Incident",
1792
+ CONTACT_US: "Pages.Admin.ContactUs",
1793
+ TIPS: "Pages.Admin.Tips",
1794
+ TAGS: "Pages.Admin.Tags",
1795
+ ROLES: "Pages.Admin.Roles",
1796
+ TOS: "Pages.Admin.Tos",
1797
+ CREDENTIAL: "Pages.Admin.Credential",
1798
+ OAUTH_CLIENTS: "Pages.Admin.Oauth",
1799
+ AMBASSADOR_PAYOUTS: "Pages.Admin.AmbassadorPayouts",
1800
+ TRACKING: "Pages.Admin.Tracking",
1801
+ GLOBAL_CONFIG: "Pages.Admin.Global-Config"
979
1802
  };
980
- // Centralized admin paths
981
1803
  const ADMIN_PATHS = {
982
- GENERIC: '/admin/generic',
983
- DOMAIN_CONFIG: '/admin/domain-config/list',
984
- USERS: '/admin/users',
985
- SUBSCRIPTION: '/admin/subscriptions',
986
- PRODUCT: '/admin/products',
987
- LOGIN_NOTIFICATION: '/admin/login-notifications/list',
988
- NEWSLETTER: '/admin/newsletter',
989
- MAILER: '/admin/mailers',
990
- BLOG: '/admin/resources',
991
- FEATURE_FLAGS: '/admin/feature-flags/list',
992
- FAQ: '/admin/faq/list',
993
- INCIDENT: '/admin/incident/list',
994
- CONTACT_US: '/admin/contact-us/list',
995
- TIPS: '/admin/tips/list',
996
- TAGS: '/admin/tags',
997
- ROLES: '/admin/permissions',
998
- // Section root (redirects to /list) so routerLinkActive also matches the
999
- // /admin/tos/:id edit route — keeps the menu item highlighted when deep-linked.
1000
- TOS: '/admin/tos',
1001
- CREDENTIAL: '/admin/credentials',
1002
- OAUTH_CLIENTS: '/admin/oauth-clients',
1003
- // Section root (redirects to /list), so routerLinkActive also matches the
1004
- // /admin/ambassador-payouts/:id detail route — keeps the menu item
1005
- // highlighted when a payout is opened or deep-linked. Same reason as TOS.
1006
- AMBASSADOR_PAYOUTS: '/admin/ambassador-payouts',
1007
- TRACKING: '/admin/tracking',
1008
- GLOBAL_CONFIG: '/admin/global-config'
1804
+ GENERIC: "/admin/generic",
1805
+ DOMAIN_CONFIG: "/admin/domain-config/list",
1806
+ USERS: "/admin/users",
1807
+ SUBSCRIPTION: "/admin/subscriptions",
1808
+ PRODUCT: "/admin/products",
1809
+ LOGIN_NOTIFICATION: "/admin/login-notifications/list",
1810
+ NEWSLETTER: "/admin/newsletter",
1811
+ MAILER: "/admin/mailers",
1812
+ BLOG: "/admin/resources",
1813
+ FEATURE_FLAGS: "/admin/feature-flags/list",
1814
+ FAQ: "/admin/faq/list",
1815
+ INCIDENT: "/admin/incident/list",
1816
+ CONTACT_US: "/admin/contact-us/list",
1817
+ TIPS: "/admin/tips/list",
1818
+ TAGS: "/admin/tags",
1819
+ ROLES: "/admin/permissions",
1820
+ TOS: "/admin/tos",
1821
+ CREDENTIAL: "/admin/credentials",
1822
+ OAUTH_CLIENTS: "/admin/oauth-clients",
1823
+ AMBASSADOR_PAYOUTS: "/admin/ambassador-payouts",
1824
+ TRACKING: "/admin/tracking",
1825
+ GLOBAL_CONFIG: "/admin/global-config"
1009
1826
  };
1010
- // Centralized admin menu data
1011
1827
  const ADMIN_MENU_DATA = [
1012
- { key: 'GENERIC', title: 'Generic', icon: 'far fa-book' },
1013
- { key: 'DOMAIN_CONFIG', title: 'Domains', icon: 'fa fa-fw fa-cog' },
1014
- { key: 'USERS', title: 'Users', icon: 'far fa-user-cog' },
1015
- { key: 'SUBSCRIPTION', title: 'Subscriptions', icon: 'ft-box' },
1016
- { key: 'PRODUCT', title: 'Products', icon: 'far fa-parking' },
1017
- { key: 'LOGIN_NOTIFICATION', title: 'Notifications', icon: 'fa fa-fw fa-bell' },
1018
- { key: 'NEWSLETTER', title: 'Newsletters', icon: 'far fa-newspaper' },
1019
- { key: 'MAILER', title: 'Mailers', icon: 'far fa-envelope' },
1020
- { key: 'BLOG', title: 'Resources', icon: 'far fa-blog' },
1021
- { key: 'FEATURE_FLAGS', title: 'Feature Flags', icon: 'fa fa-fw fa-toggle-on' },
1022
- { key: 'FAQ', title: 'FAQs', icon: 'fa fa-question' },
1023
- { key: 'INCIDENT', title: 'Incidents', icon: 'fa fa-solid fa-triangle-exclamation' },
1024
- { key: 'CONTACT_US', title: 'Contact Us', icon: 'fa fa-address-book' },
1025
- { key: 'TIPS', title: 'Tours', icon: 'far fa-lightbulb' },
1026
- { key: 'TAGS', title: 'Tags', icon: 'far fa-tags' },
1027
- { key: 'ROLES', title: 'Permissions', icon: 'fas fa-key' },
1028
- { key: 'TOS', title: 'Privacy & TOS', icon: 'fas fa-sticky-note' },
1029
- { key: 'CREDENTIAL', title: 'Credentials', icon: 'fas fa-file-signature' },
1030
- { key: 'OAUTH_CLIENTS', title: 'MCP OAuth Clients', icon: 'fas fa-robot' },
1031
- // fa-handshake is already the ambassador icon in the users list.
1032
- { key: 'AMBASSADOR_PAYOUTS', title: 'Ambassador Payouts', icon: 'fa fa-handshake' },
1033
- { key: 'TRACKING', title: 'Tracking', icon: 'fa fa-map-marker' },
1034
- { key: 'GLOBAL_CONFIG', title: 'Global Configs', icon: 'fa fa-fw fa-cog' }
1828
+ {
1829
+ key: "GENERIC",
1830
+ title: "Generic",
1831
+ icon: "far fa-book"
1832
+ },
1833
+ {
1834
+ key: "DOMAIN_CONFIG",
1835
+ title: "Domains",
1836
+ icon: "fa fa-fw fa-cog"
1837
+ },
1838
+ {
1839
+ key: "USERS",
1840
+ title: "Users",
1841
+ icon: "far fa-user-cog"
1842
+ },
1843
+ {
1844
+ key: "SUBSCRIPTION",
1845
+ title: "Subscriptions",
1846
+ icon: "ft-box"
1847
+ },
1848
+ {
1849
+ key: "PRODUCT",
1850
+ title: "Products",
1851
+ icon: "far fa-parking"
1852
+ },
1853
+ {
1854
+ key: "LOGIN_NOTIFICATION",
1855
+ title: "Notifications",
1856
+ icon: "fa fa-fw fa-bell"
1857
+ },
1858
+ {
1859
+ key: "NEWSLETTER",
1860
+ title: "Newsletters",
1861
+ icon: "far fa-newspaper"
1862
+ },
1863
+ {
1864
+ key: "MAILER",
1865
+ title: "Mailers",
1866
+ icon: "far fa-envelope"
1867
+ },
1868
+ {
1869
+ key: "BLOG",
1870
+ title: "Resources",
1871
+ icon: "far fa-blog"
1872
+ },
1873
+ {
1874
+ key: "FEATURE_FLAGS",
1875
+ title: "Feature Flags",
1876
+ icon: "fa fa-fw fa-toggle-on"
1877
+ },
1878
+ {
1879
+ key: "FAQ",
1880
+ title: "FAQs",
1881
+ icon: "fa fa-question"
1882
+ },
1883
+ {
1884
+ key: "INCIDENT",
1885
+ title: "Incidents",
1886
+ icon: "fa fa-solid fa-triangle-exclamation"
1887
+ },
1888
+ {
1889
+ key: "CONTACT_US",
1890
+ title: "Contact Us",
1891
+ icon: "fa fa-address-book"
1892
+ },
1893
+ {
1894
+ key: "TIPS",
1895
+ title: "Tours",
1896
+ icon: "far fa-lightbulb"
1897
+ },
1898
+ {
1899
+ key: "TAGS",
1900
+ title: "Tags",
1901
+ icon: "far fa-tags"
1902
+ },
1903
+ {
1904
+ key: "ROLES",
1905
+ title: "Permissions",
1906
+ icon: "fas fa-key"
1907
+ },
1908
+ {
1909
+ key: "TOS",
1910
+ title: "Privacy & TOS",
1911
+ icon: "fas fa-sticky-note"
1912
+ },
1913
+ {
1914
+ key: "CREDENTIAL",
1915
+ title: "Credentials",
1916
+ icon: "fas fa-file-signature"
1917
+ },
1918
+ {
1919
+ key: "OAUTH_CLIENTS",
1920
+ title: "MCP OAuth Clients",
1921
+ icon: "fas fa-robot"
1922
+ },
1923
+ {
1924
+ key: "AMBASSADOR_PAYOUTS",
1925
+ title: "Ambassador Payouts",
1926
+ icon: "fa fa-handshake"
1927
+ },
1928
+ {
1929
+ key: "TRACKING",
1930
+ title: "Tracking",
1931
+ icon: "fa fa-map-marker"
1932
+ },
1933
+ {
1934
+ key: "GLOBAL_CONFIG",
1935
+ title: "Global Configs",
1936
+ icon: "fa fa-fw fa-cog"
1937
+ }
1035
1938
  ];
1036
- // Helper function to create admin submenu items
1037
1939
  const createAdminSubMenuItem = (menuKey) => createSubMenuItem({
1038
- permission: ADMIN_PERMISSIONS[menuKey],
1039
- path: ADMIN_PATHS[menuKey],
1040
- title: ADMIN_MENU_DATA.find(item => item.key === menuKey)?.title || '',
1041
- icon: ADMIN_MENU_DATA.find(item => item.key === menuKey)?.icon || ''
1940
+ permission: ADMIN_PERMISSIONS[menuKey],
1941
+ path: ADMIN_PATHS[menuKey],
1942
+ title: ADMIN_MENU_DATA.find((item) => item.key === menuKey)?.title || "",
1943
+ icon: ADMIN_MENU_DATA.find((item) => item.key === menuKey)?.icon || ""
1042
1944
  });
1043
- // Generate admin submenu from centralized data
1044
- const generateAdminSubmenu = () => ADMIN_MENU_DATA.map(item => createAdminSubMenuItem(item.key));
1045
- // Sidebar menu Routes and data
1046
- const ROUTES = [
1047
- createMenuItem({
1048
- permission: 'Pages.Dashboard',
1049
- path: '/home',
1050
- title: 'Home',
1051
- icon: 'ft-home',
1052
- order: 1
1053
- }),
1054
- createMenuItem({
1055
- permission: 'Pages.Admin',
1056
- path: null,
1057
- title: 'Admin',
1058
- icon: 'ft-user',
1059
- class: 'has-sub',
1060
- order: 3,
1061
- submenu: generateAdminSubmenu()
1062
- })
1063
- ];
1064
- // Export common menus from shared utilities
1945
+ const generateAdminSubmenu = () => ADMIN_MENU_DATA.map((item) => createAdminSubMenuItem(item.key));
1946
+ const ROUTES = [createMenuItem({
1947
+ permission: "Pages.Dashboard",
1948
+ path: "/home",
1949
+ title: "Home",
1950
+ icon: "ft-home",
1951
+ order: 1
1952
+ }), createMenuItem({
1953
+ permission: "Pages.Admin",
1954
+ path: null,
1955
+ title: "Admin",
1956
+ icon: "ft-user",
1957
+ class: "has-sub",
1958
+ order: 3,
1959
+ submenu: generateAdminSubmenu()
1960
+ })];
1065
1961
  const { FAQ_Menu, ENTERPRISE_MENU, CHAT_MENU, BLOG_MENU } = COMMON_MENUS;
1066
-
1067
- /**
1068
- * Generated bundle index. Do not edit.
1069
- */
1070
-
1071
1962
  export { BLOG_MENU, CHAT_MENU, CurrentNotificationsComponent, DashboardContentModule, DashboardLibModule, DismissedNotificationsComponent, DocumentationComponent, ENTERPRISE_MENU, FAQ_Menu, FaqComponent, FaqDetailsComponent, HomeComponent, NotificationsPageComponent, ROUTES, SearchComponent, UserFeedbackComponent, filterMenusByFeatureFlag };
1072
- //# sourceMappingURL=posiwise-dashboard-module.mjs.map
1963
+
1964
+ //# sourceMappingURL=posiwise-dashboard-module.mjs.map