@transcommerce/cwm-shared 1.1.78 → 1.1.80
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,8 +1,10 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Component, Injectable, InjectionToken, Pipe, NgModule, Inject } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/router';
|
|
4
|
+
import { RouterModule } from '@angular/router';
|
|
4
5
|
import * as i2 from '@angular/forms';
|
|
5
6
|
import { FormsModule } from '@angular/forms';
|
|
7
|
+
import { Subject, firstValueFrom } from 'rxjs';
|
|
6
8
|
import { InteractionType, PublicClientApplication, LogLevel } from '@azure/msal-browser';
|
|
7
9
|
import * as i2$1 from '@angular/common/http';
|
|
8
10
|
import { HttpResponseBase, HttpResponse, HttpErrorResponse, HttpHeaders, HttpStatusCode } from '@angular/common/http';
|
|
@@ -13,7 +15,6 @@ export * from '@azure/msal-angular';
|
|
|
13
15
|
import * as i1$1 from '@angular/platform-browser';
|
|
14
16
|
import { BrowserModule } from '@angular/platform-browser';
|
|
15
17
|
import { AppConfigurationClient } from '@azure/app-configuration';
|
|
16
|
-
import { firstValueFrom, Subject } from 'rxjs';
|
|
17
18
|
import { keys, countBy } from 'lodash';
|
|
18
19
|
|
|
19
20
|
class ExternalNavigationComponent {
|
|
@@ -105,13 +106,41 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
|
|
|
105
106
|
}], ctorParameters: () => [{ type: i1.Router }] });
|
|
106
107
|
|
|
107
108
|
class PageNotFoundComponent {
|
|
108
|
-
|
|
109
|
-
|
|
109
|
+
router;
|
|
110
|
+
redirectCountdown = 10;
|
|
111
|
+
requestedUrl = '';
|
|
112
|
+
destroy$ = new Subject();
|
|
113
|
+
redirectTimer;
|
|
114
|
+
constructor(router) {
|
|
115
|
+
this.router = router;
|
|
116
|
+
this.requestedUrl = this.router.url || 'Unknown URL';
|
|
117
|
+
}
|
|
118
|
+
ngOnInit() {
|
|
119
|
+
this.startRedirectTimer();
|
|
120
|
+
}
|
|
121
|
+
ngOnDestroy() {
|
|
122
|
+
if (this.redirectTimer) {
|
|
123
|
+
clearInterval(this.redirectTimer);
|
|
124
|
+
}
|
|
125
|
+
this.destroy$.next();
|
|
126
|
+
this.destroy$.complete();
|
|
127
|
+
}
|
|
128
|
+
startRedirectTimer() {
|
|
129
|
+
this.redirectTimer = setInterval(() => {
|
|
130
|
+
this.redirectCountdown--;
|
|
131
|
+
if (this.redirectCountdown <= 0) {
|
|
132
|
+
clearInterval(this.redirectTimer);
|
|
133
|
+
this.router.navigate(['/']);
|
|
134
|
+
}
|
|
135
|
+
}, 1000);
|
|
136
|
+
}
|
|
137
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: PageNotFoundComponent, deps: [{ token: i1.Router }], target: i0.ɵɵFactoryTarget.Component });
|
|
138
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: PageNotFoundComponent, isStandalone: false, selector: "cwm-page-not-found", ngImport: i0, template: "<div class=\"not-found-container\">\n <div class=\"not-found-card\">\n <div class=\"emoji-icon\">\uD83D\uDD0E</div>\n <div class=\"error-code\">404</div>\n <h1 class=\"error-title\">Page Not Found</h1>\n <p class=\"error-description\">\n The page you're looking for doesn't exist or has been moved. Let's get you back on track!\n </p>\n\n <div class=\"button-group\">\n <a routerLink=\"/\" class=\"btn btn-primary\">\uD83C\uDFE0 Go to Home</a>\n <a routerLink=\"/dashboard\" class=\"btn btn-secondary\">\uD83D\uDCCA Dashboard</a>\n <a href=\"javascript:history.back()\" class=\"btn btn-outline\">\u2190 Go Back</a>\n <a href=\"mailto:support@cheapweedmenu.com?subject=Broken%20link%20-%20404&body=I%20found%20a%20broken%20link\" class=\"btn btn-ghost\">\uD83D\uDCE7 Report Issue</a>\n </div>\n\n <div class=\"redirect-info\">\n <small class=\"redirect-timer\">You will be redirected to home in <span class=\"timer-badge\">{{ redirectCountdown }}</span> seconds</small>\n <div class=\"breadcrumb\">\n Requested URL: <code>{{ requestedUrl }}</code>\n </div>\n </div>\n </div>\n</div>\n", styles: [".menu{color:#fff}.menu-bg{background-color:#333}.hybrid{color:#375b2b}.hybrid-bg{background-color:#375b2b}.shake{color:#4e544c}.shake-bg{background-color:#4e544c}.indica{color:#1c2e16}.indica-bg{background-color:#1c2e16}.sativa{color:#d7d0c4}.sativa-bg{background-color:#d7d0c4}@keyframes float{0%,to{transform:translateY(0)}50%{transform:translateY(-20px)}}@keyframes fadeInUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}.not-found-container{min-height:70vh;display:flex;align-items:center;justify-content:center;padding:24px;background:linear-gradient(135deg,#1c2e16,#375b2b)}.not-found-card{max-width:720px;width:100%;text-align:center;border-radius:12px;box-shadow:0 8px 30px #0000004d;padding:36px;background:linear-gradient(180deg,#d7d0c4,#e8e2d8);animation:fadeInUp .6s ease-out}.emoji-icon{font-size:80px;line-height:1;margin-bottom:16px;animation:float 3s ease-in-out infinite;display:inline-block}.error-code{margin:0;font-size:48px;font-weight:700;color:#1c2e16;letter-spacing:-1px}.error-title{margin:8px 0;font-size:28px;font-weight:600;color:#1c2e16}.error-description{color:#4e544c;margin:12px 0 28px;line-height:1.6;font-size:16px}.button-group{display:flex;gap:12px;justify-content:center;flex-wrap:wrap;margin:32px 0}.btn{padding:12px 24px;border-radius:8px;text-decoration:none;font-weight:600;font-size:14px;transition:all .5s ease;cursor:pointer;border:none;display:inline-block}.btn-primary{background-color:#1c2e16;color:#d7d0c4;transition-property:all;transition-duration:.5s}.btn-primary:hover{background-color:#160816;color:#d7d0c4;transform:translateY(-2px);box-shadow:0 4px 12px #1c2e1666}.btn-secondary{background-color:#375b2b;color:#d7d0c4;transition-property:all;transition-duration:.5s}.btn-secondary:hover{background-color:#1c2e16;color:#d7d0c4;transform:translateY(-2px)}.btn-outline{background-color:#d7d0c4;color:#1c2e16;transition-property:all;transition-duration:.5s}.btn-outline:hover{background-color:#1c2e16;color:#d7d0c4;transform:translateY(-2px)}.btn-ghost{background:transparent;border:2px solid #1c2e16;color:#1c2e16;transition-property:all;transition-duration:.5s}.btn-ghost:hover{border-color:#375b2b;background-color:#375b2b;color:#d7d0c4;transform:translateY(-2px)}.redirect-info{margin-top:24px;padding-top:24px;border-top:2px solid #1c2e16}.redirect-timer{font-size:14px;color:#4e544c;margin-top:12px}.timer-badge{display:inline-block;background-color:#1c2e16;color:#d7d0c4;padding:4px 10px;border-radius:4px;font-weight:600;margin-left:4px}.breadcrumb{margin-top:20px;font-size:12px;color:#4e544c}.breadcrumb code{background-color:#1c2e16;color:#d7d0c4;padding:2px 6px;border-radius:4px}\n"], dependencies: [{ kind: "directive", type: i1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }] });
|
|
110
139
|
}
|
|
111
140
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: PageNotFoundComponent, decorators: [{
|
|
112
141
|
type: Component,
|
|
113
|
-
args: [{ selector: 'cwm-page-not-found', standalone: false, template: "<
|
|
114
|
-
}] });
|
|
142
|
+
args: [{ selector: 'cwm-page-not-found', standalone: false, template: "<div class=\"not-found-container\">\n <div class=\"not-found-card\">\n <div class=\"emoji-icon\">\uD83D\uDD0E</div>\n <div class=\"error-code\">404</div>\n <h1 class=\"error-title\">Page Not Found</h1>\n <p class=\"error-description\">\n The page you're looking for doesn't exist or has been moved. Let's get you back on track!\n </p>\n\n <div class=\"button-group\">\n <a routerLink=\"/\" class=\"btn btn-primary\">\uD83C\uDFE0 Go to Home</a>\n <a routerLink=\"/dashboard\" class=\"btn btn-secondary\">\uD83D\uDCCA Dashboard</a>\n <a href=\"javascript:history.back()\" class=\"btn btn-outline\">\u2190 Go Back</a>\n <a href=\"mailto:support@cheapweedmenu.com?subject=Broken%20link%20-%20404&body=I%20found%20a%20broken%20link\" class=\"btn btn-ghost\">\uD83D\uDCE7 Report Issue</a>\n </div>\n\n <div class=\"redirect-info\">\n <small class=\"redirect-timer\">You will be redirected to home in <span class=\"timer-badge\">{{ redirectCountdown }}</span> seconds</small>\n <div class=\"breadcrumb\">\n Requested URL: <code>{{ requestedUrl }}</code>\n </div>\n </div>\n </div>\n</div>\n", styles: [".menu{color:#fff}.menu-bg{background-color:#333}.hybrid{color:#375b2b}.hybrid-bg{background-color:#375b2b}.shake{color:#4e544c}.shake-bg{background-color:#4e544c}.indica{color:#1c2e16}.indica-bg{background-color:#1c2e16}.sativa{color:#d7d0c4}.sativa-bg{background-color:#d7d0c4}@keyframes float{0%,to{transform:translateY(0)}50%{transform:translateY(-20px)}}@keyframes fadeInUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}.not-found-container{min-height:70vh;display:flex;align-items:center;justify-content:center;padding:24px;background:linear-gradient(135deg,#1c2e16,#375b2b)}.not-found-card{max-width:720px;width:100%;text-align:center;border-radius:12px;box-shadow:0 8px 30px #0000004d;padding:36px;background:linear-gradient(180deg,#d7d0c4,#e8e2d8);animation:fadeInUp .6s ease-out}.emoji-icon{font-size:80px;line-height:1;margin-bottom:16px;animation:float 3s ease-in-out infinite;display:inline-block}.error-code{margin:0;font-size:48px;font-weight:700;color:#1c2e16;letter-spacing:-1px}.error-title{margin:8px 0;font-size:28px;font-weight:600;color:#1c2e16}.error-description{color:#4e544c;margin:12px 0 28px;line-height:1.6;font-size:16px}.button-group{display:flex;gap:12px;justify-content:center;flex-wrap:wrap;margin:32px 0}.btn{padding:12px 24px;border-radius:8px;text-decoration:none;font-weight:600;font-size:14px;transition:all .5s ease;cursor:pointer;border:none;display:inline-block}.btn-primary{background-color:#1c2e16;color:#d7d0c4;transition-property:all;transition-duration:.5s}.btn-primary:hover{background-color:#160816;color:#d7d0c4;transform:translateY(-2px);box-shadow:0 4px 12px #1c2e1666}.btn-secondary{background-color:#375b2b;color:#d7d0c4;transition-property:all;transition-duration:.5s}.btn-secondary:hover{background-color:#1c2e16;color:#d7d0c4;transform:translateY(-2px)}.btn-outline{background-color:#d7d0c4;color:#1c2e16;transition-property:all;transition-duration:.5s}.btn-outline:hover{background-color:#1c2e16;color:#d7d0c4;transform:translateY(-2px)}.btn-ghost{background:transparent;border:2px solid #1c2e16;color:#1c2e16;transition-property:all;transition-duration:.5s}.btn-ghost:hover{border-color:#375b2b;background-color:#375b2b;color:#d7d0c4;transform:translateY(-2px)}.redirect-info{margin-top:24px;padding-top:24px;border-top:2px solid #1c2e16}.redirect-timer{font-size:14px;color:#4e544c;margin-top:12px}.timer-badge{display:inline-block;background-color:#1c2e16;color:#d7d0c4;padding:4px 10px;border-radius:4px;font-weight:600;margin-left:4px}.breadcrumb{margin-top:20px;font-size:12px;color:#4e544c}.breadcrumb code{background-color:#1c2e16;color:#d7d0c4;padding:2px 6px;border-radius:4px}\n"] }]
|
|
143
|
+
}], ctorParameters: () => [{ type: i1.Router }] });
|
|
115
144
|
|
|
116
145
|
/*
|
|
117
146
|
* A simple generic LIFO stack.
|
|
@@ -27650,18 +27679,22 @@ class CwmSharedModule {
|
|
|
27650
27679
|
NavigateToRouteComponent,
|
|
27651
27680
|
PageNotFoundComponent,
|
|
27652
27681
|
SafeHtmlPipe], imports: [CommonModule,
|
|
27682
|
+
RouterModule,
|
|
27653
27683
|
MsalModule,
|
|
27654
27684
|
BrowserModule,
|
|
27655
27685
|
FormsModule], exports: [CommonModule,
|
|
27686
|
+
RouterModule,
|
|
27656
27687
|
MsalModule,
|
|
27657
27688
|
ExternalNavigationComponent,
|
|
27658
27689
|
NavigateToRouteComponent,
|
|
27659
27690
|
PageNotFoundComponent,
|
|
27660
27691
|
SafeHtmlPipe] });
|
|
27661
27692
|
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: CwmSharedModule, imports: [CommonModule,
|
|
27693
|
+
RouterModule,
|
|
27662
27694
|
MsalModule,
|
|
27663
27695
|
BrowserModule,
|
|
27664
27696
|
FormsModule, CommonModule,
|
|
27697
|
+
RouterModule,
|
|
27665
27698
|
MsalModule] });
|
|
27666
27699
|
}
|
|
27667
27700
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: CwmSharedModule, decorators: [{
|
|
@@ -27675,12 +27708,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImpo
|
|
|
27675
27708
|
],
|
|
27676
27709
|
imports: [
|
|
27677
27710
|
CommonModule,
|
|
27711
|
+
RouterModule,
|
|
27678
27712
|
MsalModule,
|
|
27679
27713
|
BrowserModule,
|
|
27680
27714
|
FormsModule
|
|
27681
27715
|
],
|
|
27682
27716
|
exports: [
|
|
27683
27717
|
CommonModule,
|
|
27718
|
+
RouterModule,
|
|
27684
27719
|
MsalModule,
|
|
27685
27720
|
ExternalNavigationComponent,
|
|
27686
27721
|
NavigateToRouteComponent,
|
|
@@ -27750,7 +27785,8 @@ class ConfigService {
|
|
|
27750
27785
|
// --- FIX: AUTO-PARSE JSON IF APPLICABLE ---
|
|
27751
27786
|
if (setting.contentType === "application/json" || setting.contentType === "JSON") {
|
|
27752
27787
|
try {
|
|
27753
|
-
|
|
27788
|
+
this.configCache = JSON.parse(setting.value ?? "{}");
|
|
27789
|
+
return this.configCache;
|
|
27754
27790
|
}
|
|
27755
27791
|
catch (err) {
|
|
27756
27792
|
this.logger.error("Failed to parse JSON configuration value", err);
|