@igo2/core 19.0.0-next.8 → 19.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/environment/environment.interface.d.ts +2 -0
- package/fesm2022/igo2-core-activity.mjs +10 -10
- package/fesm2022/igo2-core-activity.mjs.map +1 -1
- package/fesm2022/igo2-core-analytics.mjs +3 -3
- package/fesm2022/igo2-core-analytics.mjs.map +1 -1
- package/fesm2022/igo2-core-config.mjs +9 -9
- package/fesm2022/igo2-core-config.mjs.map +1 -1
- package/fesm2022/igo2-core-language.mjs +66 -24
- package/fesm2022/igo2-core-language.mjs.map +1 -1
- package/fesm2022/igo2-core-media.mjs +3 -3
- package/fesm2022/igo2-core-media.mjs.map +1 -1
- package/fesm2022/igo2-core-message.mjs +8 -8
- package/fesm2022/igo2-core-message.mjs.map +1 -1
- package/fesm2022/igo2-core-monitoring.mjs +52 -53
- package/fesm2022/igo2-core-monitoring.mjs.map +1 -1
- package/fesm2022/igo2-core-network.mjs +3 -3
- package/fesm2022/igo2-core-network.mjs.map +1 -1
- package/fesm2022/igo2-core-regex.mjs +3 -3
- package/fesm2022/igo2-core-regex.mjs.map +1 -1
- package/fesm2022/igo2-core-request.mjs +14 -14
- package/fesm2022/igo2-core-request.mjs.map +1 -1
- package/fesm2022/igo2-core-route.mjs +45 -29
- package/fesm2022/igo2-core-route.mjs.map +1 -1
- package/fesm2022/igo2-core-storage.mjs +3 -3
- package/fesm2022/igo2-core-storage.mjs.map +1 -1
- package/fesm2022/igo2-core.mjs +4 -4
- package/fesm2022/igo2-core.mjs.map +1 -1
- package/language/shared/language.loader.d.ts +2 -0
- package/language/shared/language.provider.d.ts +8 -2
- package/locale/en.json +1 -1
- package/locale/fr.json +1 -1
- package/message/src/message.theme.scss +21 -0
- package/monitoring/public_api.d.ts +0 -1
- package/monitoring/sentry/sentry.interface.d.ts +3 -1
- package/monitoring/sentry/sentry.provider.d.ts +14 -2
- package/monitoring/sentry/sentry.utils.d.ts +0 -3
- package/monitoring/shared/index.d.ts +1 -0
- package/monitoring/shared/monitoring.d.ts +3 -0
- package/package.json +11 -6
- package/route/route.interface.d.ts +34 -21
- package/route/route.service.d.ts +5 -1
- package/src/core.theme.scss +5 -0
- package/src/packages.import.scss +4 -5
- package/src/theming/all-theme.scss +1 -6
- package/src/theming/prebuilt-themes/blue-theme.scss +5 -27
- package/src/theming/prebuilt-themes/bluedark-theme.scss +10 -61
- package/src/theming/prebuilt-themes/bluedq-theme.scss +10 -61
- package/src/theming/prebuilt-themes/teal-theme.scss +5 -26
- package/src/theming/themes/_blue-theme.scss +139 -0
- package/src/theming/themes/_bluedark-theme.scss +139 -0
- package/src/theming/themes/_bluedq-theme.scss +139 -0
- package/src/theming/themes/_index.scss +5 -0
- package/src/theming/themes/_teal-theme.scss +157 -0
- package/src/theming/themes/_theme.scss +49 -0
- package/src/theming/themes/overrides/_button.scss +79 -0
- package/src/theming/themes/overrides/_index.scss +7 -0
- package/src/theming/themes/overrides/_sidenav.scss +9 -0
- package/style/all-style.css +4 -0
- package/theming/prebuilt-themes/blue-theme.css +1000 -2741
- package/theming/prebuilt-themes/bluedark-theme.css +1000 -2741
- package/theming/prebuilt-themes/bluedq-theme.css +1000 -2741
- package/theming/prebuilt-themes/teal-theme.css +1000 -2741
- package/message/src/message.theming.scss +0 -26
- package/monitoring/monitoring.provider.d.ts +0 -4
- package/src/core-theme.scss +0 -5
- package/src/theming/material-theme-override.scss +0 -39
- package/src/theming/prebuilt-themes/bluegrey-theme.scss +0 -27
- package/src/theming/prebuilt-themes/dark-theme.scss +0 -27
- package/src/theming/prebuilt-themes/deeppurple-theme.scss +0 -27
- package/src/theming/prebuilt-themes/indigo-theme.scss +0 -27
- package/src/theming/prebuilt-themes/orange-theme.scss +0 -27
- package/src/theming/typography.scss +0 -28
- package/theming/prebuilt-themes/bluegrey-theme.css +0 -2964
- package/theming/prebuilt-themes/dark-theme.css +0 -2964
- package/theming/prebuilt-themes/deeppurple-theme.css +0 -2964
- package/theming/prebuilt-themes/indigo-theme.css +0 -2964
- package/theming/prebuilt-themes/orange-theme.css +0 -2964
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"igo2-core-message.mjs","sources":["../../../packages/core/message/src/shared/message.provider.ts","../../../packages/core/message/src/message.module.ts","../../../packages/core/message/src/shared/message.enum.ts","../../../packages/core/message/src/shared/message.service.ts","../../../packages/core/message/src/igo2-core-message.ts"],"sourcesContent":["import { EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\n\nimport { GlobalConfig, provideToastr } from 'ngx-toastr';\n\nconst TOASTR_CONFIG: Partial<GlobalConfig> = {\n positionClass: 'toast-bottom-right',\n timeOut: 10000,\n extendedTimeOut: 10000,\n titleClass: 'mat-subtitle-2',\n messageClass: 'toast-message',\n closeButton: true,\n progressBar: true,\n enableHtml: true,\n tapToDismiss: true,\n maxOpened: 4,\n preventDuplicates: true,\n resetTimeoutOnDuplicate: true,\n countDuplicates: false,\n includeTitleDuplicates: true\n};\n\nexport function provideMessage(): EnvironmentProviders {\n return makeEnvironmentProviders([provideToastr(TOASTR_CONFIG)]);\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\n\nimport { provideMessage } from './shared/message.provider';\n\n/**\n * @deprecated import the provideMessage directly\n */\n@NgModule({\n imports: [],\n providers: [provideMessage()],\n exports: []\n})\nexport class IgoMessageModule {\n static forRoot(): ModuleWithProviders<IgoMessageModule> {\n return {\n ngModule: IgoMessageModule,\n providers: []\n };\n }\n}\n","export enum MessageType {\n ERROR = 'error',\n ALERT = 'warning', // todo delete (transition to ngx-toastr)\n // eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values\n WARNING = 'warning',\n INFO = 'info',\n SUCCESS = 'success',\n SHOW = 'show'\n}\n","import { HttpErrorResponse } from '@angular/common/http';\nimport { Inject, Injectable, Injector } from '@angular/core';\n\nimport { ConfigService } from '@igo2/core/config';\nimport { LanguageService } from '@igo2/core/language';\n\nimport { ActiveToast, IndividualConfig, ToastrService } from 'ngx-toastr';\nimport { BehaviorSubject, forkJoin } from 'rxjs';\nimport { debounceTime, first } from 'rxjs/operators';\n\nimport { MessageType } from './message.enum';\nimport { Message, MessageOptions } from './message.interface';\n\ninterface ActiveMessageTranslation {\n id: number;\n titleKey: string;\n textKey: string;\n textInterpolateParams?: object;\n titleInterpolateParams?: object;\n}\n@Injectable({\n providedIn: 'root'\n})\nexport class MessageService {\n public messages$ = new BehaviorSubject<Message[]>([]);\n private options?: MessageOptions;\n private activeMessageTranslations: ActiveMessageTranslation[] = [];\n\n constructor(\n @Inject(Injector) private injector: Injector,\n private configService: ConfigService,\n private languageService: LanguageService\n ) {\n this.options = this.configService.getConfig('message');\n this.languageService.language$.pipe(debounceTime(500)).subscribe(() => {\n if (this.toastr.toasts.length === 0) {\n this.activeMessageTranslations = [];\n }\n this.toastr.toasts.map((toast) => {\n const activeMessageTranslation = this.activeMessageTranslations.find(\n (amt) => amt.id === toast.toastId\n );\n if (activeMessageTranslation) {\n const translatedTextInterpolateParams = {\n ...activeMessageTranslation.textInterpolateParams\n };\n const translatedTitleInterpolateParams = {\n ...activeMessageTranslation.titleInterpolateParams\n };\n\n if (activeMessageTranslation.textInterpolateParams) {\n Object.keys(activeMessageTranslation.textInterpolateParams).map(\n (k) => {\n if (k) {\n translatedTextInterpolateParams[k] =\n this.languageService.translate.instant(\n activeMessageTranslation.textInterpolateParams[k]\n );\n }\n }\n );\n }\n if (activeMessageTranslation.titleInterpolateParams) {\n Object.keys(activeMessageTranslation.titleInterpolateParams).map(\n (k) => {\n if (k) {\n translatedTitleInterpolateParams[k] =\n this.languageService.translate.instant(\n activeMessageTranslation.titleInterpolateParams[k]\n );\n }\n }\n );\n }\n\n forkJoin([\n this.languageService.translate.get(\n activeMessageTranslation.textKey,\n translatedTextInterpolateParams\n ),\n this.languageService.translate.get(\n activeMessageTranslation.titleKey,\n translatedTitleInterpolateParams\n )\n ])\n .pipe(first())\n .subscribe((res: [string, string]) => {\n toast.toastRef.componentInstance.message = res[0];\n toast.toastRef.componentInstance.title = res[1];\n });\n }\n });\n });\n }\n\n private get toastr(): ToastrService {\n return this.injector.get(ToastrService);\n }\n\n showError(httpError: HttpErrorResponse) {\n httpError.error.caught = true;\n return this.error(httpError.error.message, httpError.error.title);\n }\n\n message(message: Message) {\n const messageType = message.type;\n this.toastr.toastrConfig.iconClasses[messageType] = `toast-${messageType}`;\n\n this.messages$.next(this.messages$.value.concat([message]));\n\n message.options = message.options || ({} as MessageOptions);\n const currentDate = new Date();\n\n message.options.from = message.options.from\n ? message.options.from\n : new Date('1 jan 1900');\n message.options.to = message.options.to\n ? message.options.to\n : new Date('1 jan 3000');\n if (typeof message.options.from === 'string') {\n message.options.from = new Date(\n Date.parse(message.options.from.replace(/-/g, ' '))\n );\n }\n if (typeof message.options.to === 'string') {\n message.options.to = new Date(\n Date.parse(message.options.to.replace(/-/g, ' '))\n );\n }\n if (\n currentDate > message.options.from &&\n currentDate < message.options.to\n ) {\n if (message.showIcon === false) {\n this.toastr.toastrConfig.iconClasses[messageType] =\n `toast-${messageType} toast-no-icon`;\n }\n message = this.handleTemplate(message);\n\n if (message.text) {\n let messageShown: ActiveToast<any>;\n switch (message.type) {\n case MessageType.SUCCESS:\n messageShown = this.success(\n message.text,\n message.title,\n message.options,\n message.textInterpolateParams,\n message.titleInterpolateParams\n );\n break;\n case MessageType.ERROR:\n messageShown = this.error(\n message.text,\n message.title,\n message.options,\n message.textInterpolateParams,\n message.titleInterpolateParams\n );\n break;\n case MessageType.INFO:\n messageShown = this.info(\n message.text,\n message.title,\n message.options,\n message.textInterpolateParams,\n message.titleInterpolateParams\n );\n break;\n case MessageType.SHOW:\n messageShown = this.show(\n message.text,\n message.title,\n message.options,\n message.textInterpolateParams,\n message.titleInterpolateParams\n );\n break;\n case MessageType.ALERT:\n case MessageType.WARNING:\n messageShown = this.alert(\n message.text,\n message.title,\n message.options,\n message.textInterpolateParams,\n message.titleInterpolateParams\n );\n break;\n default:\n messageShown = this.info(\n message.text,\n message.title,\n message.options,\n message.textInterpolateParams,\n message.titleInterpolateParams\n );\n break;\n }\n message.options.id = messageShown.toastId;\n }\n }\n }\n\n success(\n text: string,\n title = 'igo.core.message.success',\n options: Partial<IndividualConfig> = {},\n textInterpolateParams?: object,\n titleInterpolateParams?: object\n ): ActiveToast<any> {\n return this.handleNgxToastr(\n 'success',\n text,\n title,\n options,\n textInterpolateParams,\n titleInterpolateParams\n );\n }\n\n error(\n text: string,\n title = 'igo.core.message.error',\n options: Partial<IndividualConfig> = {},\n textInterpolateParams?: object,\n titleInterpolateParams?: object\n ): ActiveToast<any> {\n return this.handleNgxToastr(\n 'error',\n text,\n title,\n options,\n textInterpolateParams,\n titleInterpolateParams\n );\n }\n\n info(\n text: string,\n title = 'igo.core.message.info',\n options: Partial<IndividualConfig> = {},\n textInterpolateParams?: object,\n titleInterpolateParams?: object\n ): ActiveToast<any> {\n return this.handleNgxToastr(\n 'info',\n text,\n title,\n options,\n textInterpolateParams,\n titleInterpolateParams\n );\n }\n\n alert(\n text: string,\n title = 'igo.core.message.alert',\n options: Partial<IndividualConfig> = {},\n textInterpolateParams?: object,\n titleInterpolateParams?: object\n ): ActiveToast<any> {\n return this.handleNgxToastr(\n 'alert',\n text,\n title,\n options,\n textInterpolateParams,\n titleInterpolateParams\n );\n }\n\n show(\n text: string,\n title = 'igo.core.message.info',\n options: Partial<IndividualConfig> = {},\n textInterpolateParams?: object,\n titleInterpolateParams?: object\n ): ActiveToast<any> {\n return this.handleNgxToastr(\n 'show',\n text,\n title,\n options,\n textInterpolateParams,\n titleInterpolateParams\n );\n }\n\n private handleNgxToastr(\n type: 'alert' | 'info' | 'error' | 'success' | 'show',\n text: string,\n title: string,\n options: Partial<IndividualConfig> = {},\n textInterpolateParams?: object,\n titleInterpolateParams?: object\n ): ActiveToast<any> {\n const translatedTextInterpolateParams = { ...textInterpolateParams };\n const translatedTitlenterpolateParams = { ...titleInterpolateParams };\n\n if (textInterpolateParams) {\n Object.keys(textInterpolateParams).map((k) => {\n const value = textInterpolateParams[k];\n if (value) {\n translatedTextInterpolateParams[k] =\n typeof value === 'string'\n ? this.languageService.translate.instant(value)\n : value;\n }\n });\n }\n if (titleInterpolateParams) {\n Object.keys(titleInterpolateParams).map((k) => {\n if (k) {\n const value = titleInterpolateParams[k];\n translatedTitlenterpolateParams[k] =\n typeof value === 'string'\n ? this.languageService.translate.instant(value)\n : value;\n }\n });\n }\n\n const message = this.languageService.translate.instant(\n text,\n translatedTextInterpolateParams\n );\n const translatedTitle = this.languageService.translate.instant(\n title,\n translatedTitlenterpolateParams\n );\n\n let activeToast;\n switch (type) {\n case 'success':\n activeToast = this.toastr.success(message, translatedTitle, options);\n break;\n case 'error':\n activeToast = this.toastr.error(message, translatedTitle, options);\n break;\n case 'show':\n case 'info':\n activeToast = this.toastr.info(message, translatedTitle, options);\n break;\n case 'alert':\n activeToast = this.toastr.warning(message, translatedTitle, options);\n break;\n }\n this.activeMessageTranslations.push({\n id: activeToast.toastId,\n titleKey: title,\n textKey: text,\n textInterpolateParams,\n titleInterpolateParams\n });\n return activeToast;\n }\n\n remove(id?: number) {\n this.toastr.remove(id);\n }\n\n removeAllAreNotError() {\n for (const mess of this.messages$.value) {\n if (mess.type !== MessageType.ERROR) {\n this.remove(mess.options.id);\n }\n }\n }\n\n private handleTemplate(message: Message): Message {\n if (!this.options?.template || message.html) {\n return message;\n }\n\n let html = this.options?.template;\n html = html.replace('${text}', message.text);\n html = html.replace('${title}', message.title);\n\n message.html = undefined;\n message.text = html;\n message.title = undefined;\n return message;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;AAIA,MAAM,aAAa,GAA0B;AAC3C,IAAA,aAAa,EAAE,oBAAoB;AACnC,IAAA,OAAO,EAAE,KAAK;AACd,IAAA,eAAe,EAAE,KAAK;AACtB,IAAA,UAAU,EAAE,gBAAgB;AAC5B,IAAA,YAAY,EAAE,eAAe;AAC7B,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aAAA,EAAA,EAAA,EAAA,KAAA,EAAA,EAAA,CAAA,eAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AANP,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,cAFb,MAAM,EAAA,CAAA;;2FAEP,cAAc,EAAA,UAAA,EAAA,CAAA;kBAH1B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE;AACb,iBAAA;;0BAOI,MAAM;2BAAC,QAAQ;;;AC7BpB;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"igo2-core-message.mjs","sources":["../../../packages/core/message/src/shared/message.provider.ts","../../../packages/core/message/src/message.module.ts","../../../packages/core/message/src/shared/message.enum.ts","../../../packages/core/message/src/shared/message.service.ts","../../../packages/core/message/src/igo2-core-message.ts"],"sourcesContent":["import { EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\n\nimport { GlobalConfig, provideToastr } from 'ngx-toastr';\n\nconst TOASTR_CONFIG: Partial<GlobalConfig> = {\n positionClass: 'toast-bottom-right',\n timeOut: 10000,\n extendedTimeOut: 10000,\n titleClass: 'toastr-message-title',\n messageClass: 'toast-message',\n closeButton: true,\n progressBar: true,\n enableHtml: true,\n tapToDismiss: true,\n maxOpened: 4,\n preventDuplicates: true,\n resetTimeoutOnDuplicate: true,\n countDuplicates: false,\n includeTitleDuplicates: true\n};\n\nexport function provideMessage(): EnvironmentProviders {\n return makeEnvironmentProviders([provideToastr(TOASTR_CONFIG)]);\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\n\nimport { provideMessage } from './shared/message.provider';\n\n/**\n * @deprecated import the provideMessage directly\n */\n@NgModule({\n imports: [],\n providers: [provideMessage()],\n exports: []\n})\nexport class IgoMessageModule {\n static forRoot(): ModuleWithProviders<IgoMessageModule> {\n return {\n ngModule: IgoMessageModule,\n providers: []\n };\n }\n}\n","export enum MessageType {\n ERROR = 'error',\n ALERT = 'warning', // todo delete (transition to ngx-toastr)\n // eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values\n WARNING = 'warning',\n INFO = 'info',\n SUCCESS = 'success',\n SHOW = 'show'\n}\n","import { HttpErrorResponse } from '@angular/common/http';\nimport { Inject, Injectable, Injector } from '@angular/core';\n\nimport { ConfigService } from '@igo2/core/config';\nimport { LanguageService } from '@igo2/core/language';\n\nimport { ActiveToast, IndividualConfig, ToastrService } from 'ngx-toastr';\nimport { BehaviorSubject, forkJoin } from 'rxjs';\nimport { debounceTime, first } from 'rxjs/operators';\n\nimport { MessageType } from './message.enum';\nimport { Message, MessageOptions } from './message.interface';\n\ninterface ActiveMessageTranslation {\n id: number;\n titleKey: string;\n textKey: string;\n textInterpolateParams?: object;\n titleInterpolateParams?: object;\n}\n@Injectable({\n providedIn: 'root'\n})\nexport class MessageService {\n public messages$ = new BehaviorSubject<Message[]>([]);\n private options?: MessageOptions;\n private activeMessageTranslations: ActiveMessageTranslation[] = [];\n\n constructor(\n @Inject(Injector) private injector: Injector,\n private configService: ConfigService,\n private languageService: LanguageService\n ) {\n this.options = this.configService.getConfig('message');\n this.languageService.language$.pipe(debounceTime(500)).subscribe(() => {\n if (this.toastr.toasts.length === 0) {\n this.activeMessageTranslations = [];\n }\n this.toastr.toasts.map((toast) => {\n const activeMessageTranslation = this.activeMessageTranslations.find(\n (amt) => amt.id === toast.toastId\n );\n if (activeMessageTranslation) {\n const translatedTextInterpolateParams = {\n ...activeMessageTranslation.textInterpolateParams\n };\n const translatedTitleInterpolateParams = {\n ...activeMessageTranslation.titleInterpolateParams\n };\n\n if (activeMessageTranslation.textInterpolateParams) {\n Object.keys(activeMessageTranslation.textInterpolateParams).map(\n (k) => {\n if (k) {\n translatedTextInterpolateParams[k] =\n this.languageService.translate.instant(\n activeMessageTranslation.textInterpolateParams[k]\n );\n }\n }\n );\n }\n if (activeMessageTranslation.titleInterpolateParams) {\n Object.keys(activeMessageTranslation.titleInterpolateParams).map(\n (k) => {\n if (k) {\n translatedTitleInterpolateParams[k] =\n this.languageService.translate.instant(\n activeMessageTranslation.titleInterpolateParams[k]\n );\n }\n }\n );\n }\n\n forkJoin([\n this.languageService.translate.get(\n activeMessageTranslation.textKey,\n translatedTextInterpolateParams\n ),\n this.languageService.translate.get(\n activeMessageTranslation.titleKey,\n translatedTitleInterpolateParams\n )\n ])\n .pipe(first())\n .subscribe((res: [string, string]) => {\n toast.toastRef.componentInstance.message = res[0];\n toast.toastRef.componentInstance.title = res[1];\n });\n }\n });\n });\n }\n\n private get toastr(): ToastrService {\n return this.injector.get(ToastrService);\n }\n\n showError(httpError: HttpErrorResponse) {\n httpError.error.caught = true;\n return this.error(httpError.error.message, httpError.error.title);\n }\n\n message(message: Message) {\n const messageType = message.type;\n this.toastr.toastrConfig.iconClasses[messageType] = `toast-${messageType}`;\n\n this.messages$.next(this.messages$.value.concat([message]));\n\n message.options = message.options || ({} as MessageOptions);\n const currentDate = new Date();\n\n message.options.from = message.options.from\n ? message.options.from\n : new Date('1 jan 1900');\n message.options.to = message.options.to\n ? message.options.to\n : new Date('1 jan 3000');\n if (typeof message.options.from === 'string') {\n message.options.from = new Date(\n Date.parse(message.options.from.replace(/-/g, ' '))\n );\n }\n if (typeof message.options.to === 'string') {\n message.options.to = new Date(\n Date.parse(message.options.to.replace(/-/g, ' '))\n );\n }\n if (\n currentDate > message.options.from &&\n currentDate < message.options.to\n ) {\n if (message.showIcon === false) {\n this.toastr.toastrConfig.iconClasses[messageType] =\n `toast-${messageType} toast-no-icon`;\n }\n message = this.handleTemplate(message);\n\n if (message.text) {\n let messageShown: ActiveToast<any>;\n switch (message.type) {\n case MessageType.SUCCESS:\n messageShown = this.success(\n message.text,\n message.title,\n message.options,\n message.textInterpolateParams,\n message.titleInterpolateParams\n );\n break;\n case MessageType.ERROR:\n messageShown = this.error(\n message.text,\n message.title,\n message.options,\n message.textInterpolateParams,\n message.titleInterpolateParams\n );\n break;\n case MessageType.INFO:\n messageShown = this.info(\n message.text,\n message.title,\n message.options,\n message.textInterpolateParams,\n message.titleInterpolateParams\n );\n break;\n case MessageType.SHOW:\n messageShown = this.show(\n message.text,\n message.title,\n message.options,\n message.textInterpolateParams,\n message.titleInterpolateParams\n );\n break;\n case MessageType.ALERT:\n case MessageType.WARNING:\n messageShown = this.alert(\n message.text,\n message.title,\n message.options,\n message.textInterpolateParams,\n message.titleInterpolateParams\n );\n break;\n default:\n messageShown = this.info(\n message.text,\n message.title,\n message.options,\n message.textInterpolateParams,\n message.titleInterpolateParams\n );\n break;\n }\n message.options.id = messageShown.toastId;\n }\n }\n }\n\n success(\n text: string,\n title = 'igo.core.message.success',\n options: Partial<IndividualConfig> = {},\n textInterpolateParams?: object,\n titleInterpolateParams?: object\n ): ActiveToast<any> {\n return this.handleNgxToastr(\n 'success',\n text,\n title,\n options,\n textInterpolateParams,\n titleInterpolateParams\n );\n }\n\n error(\n text: string,\n title = 'igo.core.message.error',\n options: Partial<IndividualConfig> = {},\n textInterpolateParams?: object,\n titleInterpolateParams?: object\n ): ActiveToast<any> {\n return this.handleNgxToastr(\n 'error',\n text,\n title,\n options,\n textInterpolateParams,\n titleInterpolateParams\n );\n }\n\n info(\n text: string,\n title = 'igo.core.message.info',\n options: Partial<IndividualConfig> = {},\n textInterpolateParams?: object,\n titleInterpolateParams?: object\n ): ActiveToast<any> {\n return this.handleNgxToastr(\n 'info',\n text,\n title,\n options,\n textInterpolateParams,\n titleInterpolateParams\n );\n }\n\n alert(\n text: string,\n title = 'igo.core.message.alert',\n options: Partial<IndividualConfig> = {},\n textInterpolateParams?: object,\n titleInterpolateParams?: object\n ): ActiveToast<any> {\n return this.handleNgxToastr(\n 'alert',\n text,\n title,\n options,\n textInterpolateParams,\n titleInterpolateParams\n );\n }\n\n show(\n text: string,\n title = 'igo.core.message.info',\n options: Partial<IndividualConfig> = {},\n textInterpolateParams?: object,\n titleInterpolateParams?: object\n ): ActiveToast<any> {\n return this.handleNgxToastr(\n 'show',\n text,\n title,\n options,\n textInterpolateParams,\n titleInterpolateParams\n );\n }\n\n private handleNgxToastr(\n type: 'alert' | 'info' | 'error' | 'success' | 'show',\n text: string,\n title: string,\n options: Partial<IndividualConfig> = {},\n textInterpolateParams?: object,\n titleInterpolateParams?: object\n ): ActiveToast<any> {\n const translatedTextInterpolateParams = { ...textInterpolateParams };\n const translatedTitlenterpolateParams = { ...titleInterpolateParams };\n\n if (textInterpolateParams) {\n Object.keys(textInterpolateParams).map((k) => {\n const value = textInterpolateParams[k];\n if (value) {\n translatedTextInterpolateParams[k] =\n typeof value === 'string'\n ? this.languageService.translate.instant(value)\n : value;\n }\n });\n }\n if (titleInterpolateParams) {\n Object.keys(titleInterpolateParams).map((k) => {\n if (k) {\n const value = titleInterpolateParams[k];\n translatedTitlenterpolateParams[k] =\n typeof value === 'string'\n ? this.languageService.translate.instant(value)\n : value;\n }\n });\n }\n\n const message = this.languageService.translate.instant(\n text,\n translatedTextInterpolateParams\n );\n const translatedTitle = this.languageService.translate.instant(\n title,\n translatedTitlenterpolateParams\n );\n\n let activeToast;\n switch (type) {\n case 'success':\n activeToast = this.toastr.success(message, translatedTitle, options);\n break;\n case 'error':\n activeToast = this.toastr.error(message, translatedTitle, options);\n break;\n case 'show':\n case 'info':\n activeToast = this.toastr.info(message, translatedTitle, options);\n break;\n case 'alert':\n activeToast = this.toastr.warning(message, translatedTitle, options);\n break;\n }\n this.activeMessageTranslations.push({\n id: activeToast.toastId,\n titleKey: title,\n textKey: text,\n textInterpolateParams,\n titleInterpolateParams\n });\n return activeToast;\n }\n\n remove(id?: number) {\n this.toastr.remove(id);\n }\n\n removeAllAreNotError() {\n for (const mess of this.messages$.value) {\n if (mess.type !== MessageType.ERROR) {\n this.remove(mess.options.id);\n }\n }\n }\n\n private handleTemplate(message: Message): Message {\n if (!this.options?.template || message.html) {\n return message;\n }\n\n let html = this.options?.template;\n html = html.replace('${text}', message.text);\n html = html.replace('${title}', message.title);\n\n message.html = undefined;\n message.text = html;\n message.title = undefined;\n return message;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;AAIA,MAAM,aAAa,GAA0B;AAC3C,IAAA,aAAa,EAAE,oBAAoB;AACnC,IAAA,OAAO,EAAE,KAAK;AACd,IAAA,eAAe,EAAE,KAAK;AACtB,IAAA,UAAU,EAAE,sBAAsB;AAClC,IAAA,YAAY,EAAE,eAAe;AAC7B,IAAA,WAAW,EAAE,IAAI;AACjB,IAAA,WAAW,EAAE,IAAI;AACjB,IAAA,UAAU,EAAE,IAAI;AAChB,IAAA,YAAY,EAAE,IAAI;AAClB,IAAA,SAAS,EAAE,CAAC;AACZ,IAAA,iBAAiB,EAAE,IAAI;AACvB,IAAA,uBAAuB,EAAE,IAAI;AAC7B,IAAA,eAAe,EAAE,KAAK;AACtB,IAAA,sBAAsB,EAAE;CACzB;SAEe,cAAc,GAAA;IAC5B,OAAO,wBAAwB,CAAC,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC,CAAC;AACjE;;ACnBA;;AAEG;MAMU,gBAAgB,CAAA;AAC3B,IAAA,OAAO,OAAO,GAAA;QACZ,OAAO;AACL,YAAA,QAAQ,EAAE,gBAAgB;AAC1B,YAAA,SAAS,EAAE;SACZ;;wGALQ,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;yGAAhB,gBAAgB,EAAA,CAAA;AAAhB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,EAHhB,SAAA,EAAA,CAAC,cAAc,EAAE,CAAC,EAAA,CAAA;;4FAGlB,g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K,CAAC;AAE9C,QAAA,OAAO,CAAC,IAAI,GAAG,SAAS;AACxB,QAAA,OAAO,CAAC,IAAI,GAAG,IAAI;AACnB,QAAA,OAAO,CAAC,KAAK,GAAG,SAAS;AACzB,QAAA,OAAO,OAAO;;AAtWL,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,kBAMf,QAAQ,EAAA,EAAA,EAAA,KAAA,EAAA,EAAA,CAAA,aAAA,EAAA,EAAA,EAAA,KAAA,EAAA,EAAA,CAAA,eAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AANP,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,cAFb,MAAM,EAAA,CAAA;;4FAEP,cAAc,EAAA,UAAA,EAAA,CAAA;kBAH1B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE;AACb,iBAAA;;0BAOI,MAAM;2BAAC,QAAQ;;;AC7BpB;;AAEG;;;;"}
|
|
@@ -1,18 +1,8 @@
|
|
|
1
|
-
import { ErrorHandler, provideAppInitializer, inject
|
|
1
|
+
import { InjectionToken, ErrorHandler, provideAppInitializer, inject } from '@angular/core';
|
|
2
2
|
import { Router } from '@angular/router';
|
|
3
|
-
import {
|
|
3
|
+
import { createErrorHandler, getClient, init, browserTracingIntegration, TraceService, setUser } from '@sentry/angular';
|
|
4
4
|
|
|
5
|
-
const
|
|
6
|
-
const isReplayEnabled = (options) => !!options.replaysSessionSampleRate || !!options.replaysOnErrorSampleRate;
|
|
7
|
-
const identifySentryUser = (user) => {
|
|
8
|
-
setUser(user
|
|
9
|
-
? {
|
|
10
|
-
id: user.id,
|
|
11
|
-
username: `${user.firstName} ${user.lastName}`,
|
|
12
|
-
email: user.email
|
|
13
|
-
}
|
|
14
|
-
: null);
|
|
15
|
-
};
|
|
5
|
+
const MONITORING_OPTIONS = new InjectionToken('monitoring.options');
|
|
16
6
|
|
|
17
7
|
const createSentryErrorHandler = (options) => {
|
|
18
8
|
return createErrorHandler({
|
|
@@ -25,59 +15,68 @@ const initSentry = (options, force) => {
|
|
|
25
15
|
if (!force && client) {
|
|
26
16
|
return;
|
|
27
17
|
}
|
|
28
|
-
|
|
29
|
-
...options,
|
|
30
|
-
integrations: [
|
|
31
|
-
isTracingEnabled(options) && browserTracingIntegration(),
|
|
32
|
-
isReplayEnabled(options) && replayIntegration()
|
|
33
|
-
].filter(Boolean)
|
|
34
|
-
};
|
|
35
|
-
init(baseConfig);
|
|
18
|
+
init(options);
|
|
36
19
|
};
|
|
37
20
|
|
|
38
|
-
const provideSentryMonitoring = (options) => {
|
|
21
|
+
const provideSentryMonitoring = (options, integrations) => {
|
|
39
22
|
const isEnabled = options.enabled !== undefined ? options.enabled : true;
|
|
40
23
|
if (!isEnabled) {
|
|
41
24
|
return [];
|
|
42
25
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return [
|
|
26
|
+
const providers = [
|
|
27
|
+
{ provide: MONITORING_OPTIONS, useValue: options },
|
|
46
28
|
{
|
|
47
29
|
provide: ErrorHandler,
|
|
48
30
|
useFactory: () => createSentryErrorHandler(options)
|
|
49
|
-
}
|
|
50
|
-
tracingEnabled && {
|
|
51
|
-
provide: TraceService,
|
|
52
|
-
deps: [Router]
|
|
53
|
-
},
|
|
54
|
-
// Force instantiate TraceService to avoid require it in any constructor.
|
|
55
|
-
tracingEnabled &&
|
|
56
|
-
provideAppInitializer(() => {
|
|
57
|
-
inject(TraceService);
|
|
58
|
-
return;
|
|
59
|
-
})
|
|
60
|
-
].filter(Boolean);
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
const MONITORING_OPTIONS = new InjectionToken('monitoring.options');
|
|
64
|
-
function provideMonitoring(options) {
|
|
65
|
-
if (!options) {
|
|
66
|
-
return [];
|
|
67
|
-
}
|
|
68
|
-
const providers = [
|
|
69
|
-
{ provide: MONITORING_OPTIONS, useValue: options }
|
|
31
|
+
}
|
|
70
32
|
];
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
break;
|
|
33
|
+
if (integrations) {
|
|
34
|
+
for (const integration of integrations) {
|
|
35
|
+
const value = integration(options);
|
|
36
|
+
providers.push(...value.providers);
|
|
37
|
+
}
|
|
77
38
|
}
|
|
39
|
+
initSentry(options);
|
|
78
40
|
return providers;
|
|
41
|
+
};
|
|
42
|
+
var SentryIntegrationKind;
|
|
43
|
+
(function (SentryIntegrationKind) {
|
|
44
|
+
SentryIntegrationKind[SentryIntegrationKind["Tracing"] = 0] = "Tracing";
|
|
45
|
+
SentryIntegrationKind[SentryIntegrationKind["Replay"] = 1] = "Replay";
|
|
46
|
+
})(SentryIntegrationKind || (SentryIntegrationKind = {}));
|
|
47
|
+
function withTracingIntegration(options) {
|
|
48
|
+
return (sentryOptions) => {
|
|
49
|
+
sentryOptions.integrations = [
|
|
50
|
+
...(sentryOptions.integrations ?? []),
|
|
51
|
+
browserTracingIntegration(options)
|
|
52
|
+
];
|
|
53
|
+
return {
|
|
54
|
+
kind: SentryIntegrationKind.Tracing,
|
|
55
|
+
providers: [
|
|
56
|
+
{
|
|
57
|
+
provide: TraceService,
|
|
58
|
+
deps: [Router]
|
|
59
|
+
},
|
|
60
|
+
// Force instantiate TraceService to avoid require it in any constructor.
|
|
61
|
+
provideAppInitializer(() => {
|
|
62
|
+
inject(TraceService);
|
|
63
|
+
return;
|
|
64
|
+
})
|
|
65
|
+
]
|
|
66
|
+
};
|
|
67
|
+
};
|
|
79
68
|
}
|
|
80
69
|
|
|
70
|
+
const identifySentryUser = (user) => {
|
|
71
|
+
setUser(user
|
|
72
|
+
? {
|
|
73
|
+
id: user.id,
|
|
74
|
+
username: `${user.firstName} ${user.lastName}`,
|
|
75
|
+
email: user.email
|
|
76
|
+
}
|
|
77
|
+
: null);
|
|
78
|
+
};
|
|
79
|
+
|
|
81
80
|
const MOCK_SENTRY_OPTIONS = {
|
|
82
81
|
provider: 'sentry',
|
|
83
82
|
dsn: 'https://examplePublicKey@o0.ingest.sentry.io/0',
|
|
@@ -89,5 +88,5 @@ const MOCK_MONITORING_OPTIONS = MOCK_SENTRY_OPTIONS;
|
|
|
89
88
|
* Generated bundle index. Do not edit.
|
|
90
89
|
*/
|
|
91
90
|
|
|
92
|
-
export { MOCK_MONITORING_OPTIONS, MOCK_SENTRY_OPTIONS, MONITORING_OPTIONS,
|
|
91
|
+
export { MOCK_MONITORING_OPTIONS, MOCK_SENTRY_OPTIONS, MONITORING_OPTIONS, SentryIntegrationKind, identifySentryUser, provideSentryMonitoring, withTracingIntegration };
|
|
93
92
|
//# sourceMappingURL=igo2-core-monitoring.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"igo2-core-monitoring.mjs","sources":["../../../packages/core/monitoring/src/
|
|
1
|
+
{"version":3,"file":"igo2-core-monitoring.mjs","sources":["../../../packages/core/monitoring/src/shared/monitoring.ts","../../../packages/core/monitoring/src/sentry/sentry.ts","../../../packages/core/monitoring/src/sentry/sentry.provider.ts","../../../packages/core/monitoring/src/sentry/sentry.utils.ts","../../../packages/core/monitoring/src/__mocks__/monitoring-mock.ts","../../../packages/core/monitoring/src/igo2-core-monitoring.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nimport { MonitoringOptions } from './monitoring.interface';\n\nexport const MONITORING_OPTIONS = new InjectionToken<MonitoringOptions | null>(\n 'monitoring.options'\n);\n","import {\n BrowserOptions,\n SentryErrorHandler,\n createErrorHandler,\n getClient,\n init\n} from '@sentry/angular';\n\nimport { SentryMonitoringOptions } from './sentry.interface';\n\nexport const createSentryErrorHandler = (\n options: SentryMonitoringOptions\n): SentryErrorHandler => {\n return createErrorHandler({\n logErrors: options.logErrors,\n ...(options.errorHandlerOptions ?? {})\n });\n};\n\nexport const initSentry = (\n options: SentryMonitoringOptions,\n force?: boolean\n): void => {\n const client = getClient();\n if (!force && client) {\n return;\n }\n\n init(options as unknown as BrowserOptions);\n};\n","import {\n EnvironmentProviders,\n ErrorHandler,\n Provider,\n inject,\n provideAppInitializer\n} from '@angular/core';\nimport { Router } from '@angular/router';\n\nimport { TraceService, browserTracingIntegration } from '@sentry/angular';\n\nimport { MONITORING_OPTIONS } from '../shared';\nimport { createSentryErrorHandler, initSentry } from './sentry';\nimport { SentryMonitoringOptions } from './sentry.interface';\n\nexport const provideSentryMonitoring = (\n options: SentryMonitoringOptions,\n integrations?: SentryIntegrationFactory<SentryIntegrationKind>[]\n): (Provider | EnvironmentProviders)[] => {\n const isEnabled = options.enabled !== undefined ? options.enabled : true;\n if (!isEnabled) {\n return [];\n }\n\n const providers: (Provider | EnvironmentProviders)[] = [\n { provide: MONITORING_OPTIONS, useValue: options },\n {\n provide: ErrorHandler,\n useFactory: () => createSentryErrorHandler(options)\n }\n ];\n\n if (integrations) {\n for (const integration of integrations) {\n const value = integration(options);\n providers.push(...value.providers);\n }\n }\n\n initSentry(options);\n\n return providers;\n};\n\nexport interface SentryIntegration<KindT extends SentryIntegrationKind> {\n kind: KindT;\n providers: (Provider | EnvironmentProviders)[];\n}\n\ntype SentryIntegrationFactory<KindT extends SentryIntegrationKind> = (\n sentryOptions: SentryMonitoringOptions\n) => SentryIntegration<KindT>;\n\nexport enum SentryIntegrationKind {\n Tracing = 0,\n Replay = 1\n}\n\nexport function withTracingIntegration(\n options: Parameters<typeof browserTracingIntegration>[0]\n): SentryIntegrationFactory<SentryIntegrationKind.Tracing> {\n return (sentryOptions: SentryMonitoringOptions) => {\n sentryOptions.integrations = [\n ...(sentryOptions.integrations ?? []),\n browserTracingIntegration(options)\n ];\n\n return {\n kind: SentryIntegrationKind.Tracing,\n providers: [\n {\n provide: TraceService,\n deps: [Router]\n },\n // Force instantiate TraceService to avoid require it in any constructor.\n provideAppInitializer(() => {\n inject(TraceService);\n return;\n })\n ]\n };\n };\n}\n","import { BaseUser } from '@igo2/core/user';\n\nimport { setUser } from '@sentry/angular';\n\nexport const identifySentryUser = (user: BaseUser | null): void => {\n setUser(\n user\n ? {\n id: user.id,\n username: `${user.firstName} ${user.lastName}`,\n email: user.email\n }\n : null\n );\n};\n","import { SentryMonitoringOptions } from '../sentry';\nimport { AnyMonitoringOptions } from '../shared';\n\nexport const MOCK_SENTRY_OPTIONS: SentryMonitoringOptions = {\n provider: 'sentry',\n dsn: 'https://examplePublicKey@o0.ingest.sentry.io/0',\n identifyUser: true\n};\n\nexport const MOCK_MONITORING_OPTIONS: AnyMonitoringOptions =\n MOCK_SENTRY_OPTIONS;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;MAIa,kBAAkB,GAAG,IAAI,cAAc,CAClD,oBAAoB;;ACKf,MAAM,wBAAwB,GAAG,CACtC,OAAgC,KACV;AACtB,IAAA,OAAO,kBAAkB,CAAC;QACxB,SAAS,EAAE,OAAO,CAAC,SAAS;AAC5B,QAAA,IAAI,OAAO,CAAC,mBAAmB,IAAI,EAAE;AACtC,KAAA,CAAC;AACJ,CAAC;AAEM,MAAM,UAAU,GAAG,CACxB,OAAgC,EAChC,KAAe,KACP;AACR,IAAA,MAAM,MAAM,GAAG,SAAS,EAAE;AAC1B,IAAA,IAAI,CAAC,KAAK,IAAI,MAAM,EAAE;QACpB;;IAGF,IAAI,CAAC,OAAoC,CAAC;AAC5C,CAAC;;MCdY,uBAAuB,GAAG,CACrC,OAAgC,EAChC,YAAgE,KACzB;AACvC,IAAA,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,KAAK,SAAS,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI;IACxE,IAAI,CAAC,SAAS,EAAE;AACd,QAAA,OAAO,EA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AA,OAAO,CACL;AACE,UAAE;YACE,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,QAAQ,EAAE,GAAG,IAAI,CAAC,SAAS,CAAI,CAAA,EAAA,IAAI,CAAC,QAAQ,CAAE,CAAA;YAC9C,KAAK,EAAE,IAAI,CAAC;AACb;UACD,IAAI,CACT;AACH;;ACXa,MAAA,mBAAmB,GAA4B;AAC1D,IAAA,QAAQ,EAAE,QAAQ;AAClB,IAAA,GAAG,EAAE,gDAAgD;AACrD,IAAA,YAAY,EAAE;;AAGT,MAAM,uBAAuB,GAClC;;ACVF;;AAEG;;;;"}
|
|
@@ -56,10 +56,10 @@ class NetworkService {
|
|
|
56
56
|
? this.stateChangeEventEmitter.pipe(debounceTime(300), startWith(this.state))
|
|
57
57
|
: this.stateChangeEventEmitter.pipe(debounceTime(300));
|
|
58
58
|
}
|
|
59
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
60
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.
|
|
59
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: NetworkService, deps: [{ token: i1.MessageService }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
60
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: NetworkService, providedIn: 'root' });
|
|
61
61
|
}
|
|
62
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
62
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: NetworkService, decorators: [{
|
|
63
63
|
type: Injectable,
|
|
64
64
|
args: [{
|
|
65
65
|
providedIn: 'root'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"igo2-core-network.mjs","sources":["../../../packages/core/network/src/network.service.ts","../../../packages/core/network/src/igo2-core-network.ts"],"sourcesContent":["import { EventEmitter, Injectable, Injector, OnDestroy } from '@angular/core';\n\nimport { MessageService } from '@igo2/core/message';\n\nimport { Observable, Subscription, fromEvent } from 'rxjs';\nimport { debounceTime, startWith } from 'rxjs/operators';\n\nimport { ConnectionState } from './network.interfaces';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class NetworkService implements OnDestroy {\n private stateChangeEventEmitter = new EventEmitter<ConnectionState>();\n private onlineSubscription: Subscription;\n private offlineSubscription: Subscription;\n private previousMessageId;\n\n private state: ConnectionState = {\n connection: window.navigator.onLine\n };\n\n constructor(\n private messageService: MessageService,\n private injector: Injector\n ) {\n this.checkNetworkState();\n }\n\n private checkNetworkState() {\n this.onlineSubscription = fromEvent(window, 'online').subscribe(() => {\n if (this.previousMessageId) {\n this.messageService.remove(this.previousMessageId);\n }\n const messageObj = this.messageService.info(\n 'igo.core.network.online.message',\n 'igo.core.network.online.title'\n );\n this.previousMessageId = messageObj.toastId;\n this.state.connection = true;\n this.emitEvent();\n });\n\n this.offlineSubscription = fromEvent(window, 'offline').subscribe(() => {\n if (this.previousMessageId) {\n this.messageService.remove(this.previousMessageId);\n }\n const messageObj = this.messageService.info(\n 'igo.core.network.offline.message',\n 'igo.core.network.offline.title'\n );\n this.previousMessageId = messageObj.toastId;\n this.state.connection = false;\n this.emitEvent();\n });\n }\n\n private emitEvent() {\n this.stateChangeEventEmitter.emit(this.state);\n }\n\n ngOnDestroy(): void {\n try {\n this.offlineSubscription.unsubscribe();\n this.onlineSubscription.unsubscribe();\n } catch {\n // empty\n }\n }\n\n currentState(reportState = true): Observable<ConnectionState> {\n return reportState\n ? this.stateChangeEventEmitter.pipe(\n debounceTime(300),\n startWith(this.state)\n )\n : this.stateChangeEventEmitter.pipe(debounceTime(300));\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;MAYa,cAAc,CAAA;AAWf,IAAA,cAAA;AAC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IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,KAAK;YAC7B,IAAI,CAAC,SAAS,EAAE;AAClB,SAAC,CAAC;;IAGI,SAAS,GAAA;QACf,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;;IAG/C,WAAW,GAAA;AACT,QAAA,IAAI;AACF,YAAA,IAAI,CAAC,mBAAmB,CAAC,WAAW,EAAE;AACtC,YAAA,IAAI,CAAC,kBAAkB,CAAC,WAAW,EAAE;;AACrC,QAAA,MAAM;;;;IAKV,YAAY,CAAC,WAAW,GAAG,IAAI,EAAA;AAC7B,QAAA,OAAO;AACL,cAAE,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAC/B,YAAY,CAAC,GAAG,CAAC,EACjB,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC;AAEzB,cAAE,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;;
|
|
1
|
+
{"version":3,"file":"igo2-core-network.mjs","sources":["../../../packages/core/network/src/network.service.ts","../../../packages/core/network/src/igo2-core-network.ts"],"sourcesContent":["import { EventEmitter, Injectable, Injector, OnDestroy } from '@angular/core';\n\nimport { MessageService } from '@igo2/core/message';\n\nimport { Observable, Subscription, fromEvent } from 'rxjs';\nimport { debounceTime, startWith } from 'rxjs/operators';\n\nimport { ConnectionState } from './network.interfaces';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class NetworkService implements OnDestroy {\n private stateChangeEventEmitter = new EventEmitter<ConnectionState>();\n private onlineSubscription: Subscription;\n private offlineSubscription: Subscription;\n private previousMessageId;\n\n private state: ConnectionState = {\n connection: window.navigator.onLine\n };\n\n constructor(\n private messageService: MessageService,\n private injector: Injector\n ) {\n this.checkNetworkState();\n }\n\n private checkNetworkState() {\n this.onlineSubscription = fromEvent(window, 'online').subscribe(() => {\n if (this.previousMessageId) {\n this.messageService.remove(this.previousMessageId);\n }\n const messageObj = this.messageService.info(\n 'igo.core.network.online.message',\n 'igo.core.network.online.title'\n );\n this.previousMessageId = messageObj.toastId;\n this.state.connection = true;\n this.emitEvent();\n });\n\n this.offlineSubscription = fromEvent(window, 'offline').subscribe(() => {\n if (this.previousMessageId) {\n this.messageService.remove(this.previousMessageId);\n }\n const messageObj = this.messageService.info(\n 'igo.core.network.offline.message',\n 'igo.core.network.offline.title'\n );\n this.previousMessageId = messageObj.toastId;\n this.state.connection = false;\n this.emitEvent();\n });\n }\n\n private emitEvent() {\n this.stateChangeEventEmitter.emit(this.state);\n }\n\n ngOnDestroy(): void {\n try {\n this.offlineSubscription.unsubscribe();\n this.onlineSubscription.unsubscribe();\n } catch {\n // empty\n }\n }\n\n currentState(reportState = true): Observable<ConnectionState> {\n return reportState\n ? this.stateChangeEventEmitter.pipe(\n debounceTime(300),\n startWith(this.state)\n )\n : this.stateChangeEventEmitter.pipe(debounceTime(300));\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;MAYa,cAAc,CAAA;AAWf,IAAA,cAAA;AACA,IAAA,QAAA;AAXF,IAAA,uBAAuB,GAAG,IAAI,YAAY,EAAmB;AAC7D,IAAA,kBAAkB;AAClB,IAAA,mBAAmB;AACnB,IAAA,iBAAiB;AAEjB,IAAA,KAAK,GAAoB;AAC/B,QAAA,UAAU,EAAE,MAAM,CAAC,SAAS,CAAC;KAC9B;IAED,WACU,CAAA,cAA8B,EAC9B,QAAkB,EAAA;QADlB,IAAc,CAAA,cAAA,GAAd,cAAc;QACd,IAAQ,CAAA,QAAA,GAAR,QAAQ;QAEhB,IAAI,CAAC,iBAAiB,EAAE;;IAGlB,iBAAiB,GAAA;AACvB,QAAA,IAAI,CAAC,kBAAkB,GAAG,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,SAAS,CAAC,MAAK;AACnE,YAAA,IAAI,IAAI,CAAC,iBAAiB,EAAE;gBAC1B,IAAI,CAAC,cAAc,CAAC,MAAM,C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AAC,YAAY,CAAC,GAAG,CAAC,CAAC;;wGAhE/C,cAAc,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,cAAA,EAAA,EAAA,EAAA,KAAA,EAAA,EAAA,CAAA,QAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAd,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,cAFb,MAAM,EAAA,CAAA;;4FAEP,cAAc,EAAA,UAAA,EAAA,CAAA;kBAH1B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE;AACb,iBAAA;;;ACXD;;AAEG;;;;"}
|
|
@@ -18,10 +18,10 @@ class RegexService {
|
|
|
18
18
|
}
|
|
19
19
|
return;
|
|
20
20
|
}
|
|
21
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
22
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.
|
|
21
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: RegexService, deps: [{ token: i1.ConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
22
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: RegexService, providedIn: 'root' });
|
|
23
23
|
}
|
|
24
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
24
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: RegexService, decorators: [{
|
|
25
25
|
type: Injectable,
|
|
26
26
|
args: [{
|
|
27
27
|
providedIn: 'root'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"igo2-core-regex.mjs","sources":["../../../packages/core/regex/src/regex.service.ts","../../../packages/core/regex/src/igo2-core-regex.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\n\nimport { ConfigService } from '@igo2/core/config';\n\nimport { RegexOptions } from './regex.interface';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class RegexService {\n protected options: RegexOptions;\n\n constructor(private config: ConfigService) {\n this.options = this.config.getConfig('regex');\n }\n\n getAll() {\n return this.options;\n }\n\n get(key) {\n if (this.options) {\n return this.options[key];\n }\n return;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;MASa,YAAY,CAAA;AAGH,IAAA,MAAA;AAFV,IAAA,OAAO;AAEjB,IAAA,WAAA,CAAoB,MAAqB,EAAA;QAArB,IAAM,CAAA,MAAA,GAAN,MAAM;QACxB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC;;IAG/C,MAAM,GAAA;QACJ,OAAO,IAAI,CAAC,OAAO;;AAGrB,IAAA,GAAG,CAAC,GAAG,EAAA;AACL,QAAA,IAAI,IAAI,CAAC,OAAO,EAAE;AAChB,YAAA,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC;;QAE1B;;
|
|
1
|
+
{"version":3,"file":"igo2-core-regex.mjs","sources":["../../../packages/core/regex/src/regex.service.ts","../../../packages/core/regex/src/igo2-core-regex.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\n\nimport { ConfigService } from '@igo2/core/config';\n\nimport { RegexOptions } from './regex.interface';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class RegexService {\n protected options: RegexOptions;\n\n constructor(private config: ConfigService) {\n this.options = this.config.getConfig('regex');\n }\n\n getAll() {\n return this.options;\n }\n\n get(key) {\n if (this.options) {\n return this.options[key];\n }\n return;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;MASa,YAAY,CAAA;AAGH,IAAA,MAAA;AAFV,IAAA,OAAO;AAEjB,IAAA,WAAA,CAAoB,MAAqB,EAAA;QAArB,IAAM,CAAA,MAAA,GAAN,MAAM;QACxB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC;;IAG/C,MAAM,GAAA;QACJ,OAAO,IAAI,CAAC,OAAO;;AAGrB,IAAA,GAAG,CAAC,GAAG,EAAA;AACL,QAAA,IAAI,IAAI,CAAC,OAAO,EAAE;AAChB,YAAA,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC;;QAE1B;;wGAfS,YAAY,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,aAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAZ,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,YAAY,cAFX,MAAM,EAAA,CAAA;;4FAEP,YAAY,EAAA,UAAA,EAAA,CAAA;kBAHxB,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE;AACb,iBAAA;;;ACRD;;AAEG;;;;"}
|
|
@@ -60,10 +60,10 @@ class ErrorInterceptor {
|
|
|
60
60
|
progressBar: false
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
64
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.
|
|
63
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ErrorInterceptor, deps: [{ token: i1.MessageService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
64
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ErrorInterceptor, providedIn: 'root' });
|
|
65
65
|
}
|
|
66
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
66
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ErrorInterceptor, decorators: [{
|
|
67
67
|
type: Injectable,
|
|
68
68
|
args: [{
|
|
69
69
|
providedIn: 'root'
|
|
@@ -88,11 +88,11 @@ class IgoErrorModule {
|
|
|
88
88
|
throw new Error('IgoErrorModule is already loaded. Import it in the AppModule only');
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
92
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.
|
|
93
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.
|
|
91
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IgoErrorModule, deps: [{ token: IgoErrorModule, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.NgModule });
|
|
92
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.15", ngImport: i0, type: IgoErrorModule });
|
|
93
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IgoErrorModule });
|
|
94
94
|
}
|
|
95
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
95
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IgoErrorModule, decorators: [{
|
|
96
96
|
type: NgModule,
|
|
97
97
|
args: [{
|
|
98
98
|
imports: [],
|
|
@@ -123,10 +123,10 @@ class LoggingInterceptor {
|
|
|
123
123
|
console.log(msg);
|
|
124
124
|
}));
|
|
125
125
|
}
|
|
126
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
127
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.
|
|
126
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: LoggingInterceptor, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
127
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: LoggingInterceptor });
|
|
128
128
|
}
|
|
129
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
129
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: LoggingInterceptor, decorators: [{
|
|
130
130
|
type: Injectable
|
|
131
131
|
}] });
|
|
132
132
|
|
|
@@ -143,11 +143,11 @@ class IgoLoggingModule {
|
|
|
143
143
|
]
|
|
144
144
|
};
|
|
145
145
|
}
|
|
146
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
147
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.
|
|
148
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.
|
|
146
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IgoLoggingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
147
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.15", ngImport: i0, type: IgoLoggingModule });
|
|
148
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IgoLoggingModule });
|
|
149
149
|
}
|
|
150
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
150
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: IgoLoggingModule, decorators: [{
|
|
151
151
|
type: NgModule,
|
|
152
152
|
args: [{
|
|
153
153
|
imports: [],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"igo2-core-request.mjs","sources":["../../../packages/core/request/src/error.interceptor.ts","../../../packages/core/request/src/error.module.ts","../../../packages/core/request/src/logging.interceptor.ts","../../../packages/core/request/src/logging.module.ts","../../../packages/core/request/src/igo2-core-request.ts"],"sourcesContent":["import {\n HttpErrorResponse,\n HttpEvent,\n HttpHandler,\n HttpInterceptor,\n HttpRequest\n} from '@angular/common/http';\nimport { Injectable } from '@angular/core';\n\nimport { MessageService } from '@igo2/core/message';\n\nimport { Observable, throwError } from 'rxjs';\nimport { catchError, finalize } from 'rxjs/operators';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ErrorInterceptor implements HttpInterceptor {\n constructor(private messageService: MessageService) {}\n\n intercept(\n originalReq: HttpRequest<any>,\n next: HttpHandler\n ): Observable<HttpEvent<any>> {\n const interceptError = originalReq.headers.get('interceptError');\n const req = originalReq.clone({\n headers: originalReq.headers.delete('interceptError')\n });\n if (interceptError === 'false') {\n return next.handle(req);\n }\n const errorContainer = { httpError: undefined };\n return next.handle(req).pipe(\n catchError((error) => this.handleError(error, errorContainer)),\n finalize(() => {\n const httpError = errorContainer.httpError;\n if (!httpError) {\n return;\n }\n\n if (httpError.error.toDisplay) {\n this.handleCaughtError(httpError);\n } else if (!httpError.error.caught) {\n this.handleUncaughtError(httpError);\n }\n })\n );\n }\n\n private handleError(\n httpError: HttpErrorResponse,\n errorContainer: { httpError: HttpErrorResponse }\n ) {\n if (httpError instanceof HttpErrorResponse) {\n const errorObj = httpError.error === 'object' ? httpError.error : {};\n errorObj.message = httpError.error?.message || httpError.statusText;\n errorObj.caught = false;\n\n httpError = new HttpErrorResponse({\n error: errorObj,\n headers: httpError.headers,\n status: httpError.status,\n statusText: httpError.statusText,\n url: httpError.url\n });\n }\n\n errorContainer.httpError = httpError;\n return throwError(httpError);\n }\n\n private handleCaughtError(httpError: HttpErrorResponse) {\n httpError.error.caught = true;\n this.messageService.error(httpError.error.message, httpError.error.title, {\n progressBar: false\n });\n }\n\n private handleUncaughtError(httpError: HttpErrorResponse) {\n httpError.error.caught = true;\n this.messageService.error(\n 'igo.core.errors.uncaught.message',\n 'igo.core.errors.uncaught.title',\n {\n progressBar: false\n }\n );\n }\n}\n","import { HTTP_INTERCEPTORS } from '@angular/common/http';\nimport {\n ModuleWithProviders,\n NgModule,\n Optional,\n SkipSelf\n} from '@angular/core';\n\nimport { ErrorInterceptor } from './error.interceptor';\n\n@NgModule({\n imports: [],\n declarations: [],\n exports: []\n})\nexport class IgoErrorModule {\n static forRoot(): ModuleWithProviders<IgoErrorModule> {\n return {\n ngModule: IgoErrorModule,\n providers: [\n {\n provide: HTTP_INTERCEPTORS,\n useClass: ErrorInterceptor,\n multi: true\n }\n ]\n };\n }\n\n constructor(@Optional() @SkipSelf() parentModule: IgoErrorModule) {\n if (parentModule) {\n throw new Error(\n 'IgoErrorModule is already loaded. Import it in the AppModule only'\n );\n }\n }\n}\n","import {\n HttpEvent,\n HttpHandler,\n HttpInterceptor,\n HttpRequest,\n HttpResponse\n} from '@angular/common/http';\nimport { Injectable } from '@angular/core';\n\nimport { Observable } from 'rxjs';\nimport { finalize, tap } from 'rxjs/operators';\n\n@Injectable()\nexport class LoggingInterceptor implements HttpInterceptor {\n intercept(\n req: HttpRequest<any>,\n next: HttpHandler\n ): Observable<HttpEvent<any>> {\n const started = Date.now();\n let ok: string;\n\n // extend server response observable with logging\n return next.handle(req).pipe(\n tap(\n // Succeeds when there is a response; ignore other events\n (event) => (ok = event instanceof HttpResponse ? 'succeeded' : ''),\n // Operation failed; error is an HttpErrorResponse\n () => (ok = 'failed')\n ),\n // Log when response observable either completes or errors\n finalize(() => {\n const elapsed = Date.now() - started;\n const msg = `${req.method} \"${req.urlWithParams}\"\n ${ok} in ${elapsed} ms.`;\n\n console.log(msg);\n })\n );\n }\n}\n","import { HTTP_INTERCEPTORS } from '@angular/common/http';\nimport { ModuleWithProviders, NgModule } from '@angular/core';\n\nimport { LoggingInterceptor } from './logging.interceptor';\n\n@NgModule({\n imports: [],\n declarations: [],\n exports: []\n})\nexport class IgoLoggingModule {\n static forRoot(): ModuleWithProviders<IgoLoggingModule> {\n return {\n ngModule: IgoLoggingModule,\n providers: [\n {\n provide: HTTP_INTERCEPTORS,\n useClass: LoggingInterceptor,\n multi: true\n }\n ]\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;MAiBa,gBAAgB,CAAA;AACP,IAAA,cAAA;AAApB,IAAA,WAAA,CAAoB,cAA8B,EAAA;QAA9B,IAAc,CAAA,cAAA,GAAd,cAAc;;IAElC,SAAS,CACP,WAA6B,EAC7B,IAAiB,EAAA;QAEjB,MAAM,cAAc,GAAG,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC;AAChE,QAAA,MAAM,GAAG,GAAG,WAAW,CAAC,KAAK,CAAC;YAC5B,OAAO,EAAE,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,gBAAgB;AACrD,SAAA,CAAC;AACF,QAAA,IAAI,cAAc,KAAK,OAAO,EAAE;AAC9B,YAAA,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC;;AAEzB,QAAA,MAAM,cAAc,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE;AAC/C,QAAA,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAC1B,UAAU,CAAC,CAAC,KAAK,KAAK,IAAI,CAAC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,CAAC,KAAK,CAAC,KAAK,EAAE;AACxE,YAAA,WAAW,EAAE;AACd,SAAA,CAAC;;AAGI,IAAA,mBAAmB,CAAC,SAA4B,EAAA;AACtD,QAAA,SAAS,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI;QAC7B,IAAI,CAAC,cAAc,CAAC,KAAK,CACvB,kCAAkC,EAClC,gCAAgC,EAChC;AACE,YAAA,WAAW,EAAE;AACd,SAAA,CACF;;
|
|
1
|
+
{"version":3,"file":"igo2-core-request.mjs","sources":["../../../packages/core/request/src/error.interceptor.ts","../../../packages/core/request/src/error.module.ts","../../../packages/core/request/src/logging.interceptor.ts","../../../packages/core/request/src/logging.module.ts","../../../packages/core/request/src/igo2-core-request.ts"],"sourcesContent":["import {\n HttpErrorResponse,\n HttpEvent,\n HttpHandler,\n HttpInterceptor,\n HttpRequest\n} from '@angular/common/http';\nimport { Injectable } from '@angular/core';\n\nimport { MessageService } from '@igo2/core/message';\n\nimport { Observable, throwError } from 'rxjs';\nimport { catchError, finalize } from 'rxjs/operators';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ErrorInterceptor implements HttpInterceptor {\n constructor(private messageService: MessageService) {}\n\n intercept(\n originalReq: HttpRequest<any>,\n next: HttpHandler\n ): Observable<HttpEvent<any>> {\n const interceptError = originalReq.headers.get('interceptError');\n const req = originalReq.clone({\n headers: originalReq.headers.delete('interceptError')\n });\n if (interceptError === 'false') {\n return next.handle(req);\n }\n const errorContainer = { httpError: undefined };\n return next.handle(req).pipe(\n catchError((error) => this.handleError(error, errorContainer)),\n finalize(() => {\n const httpError = errorContainer.httpError;\n if (!httpError) {\n return;\n }\n\n if (httpError.error.toDisplay) {\n this.handleCaughtError(httpError);\n } else if (!httpError.error.caught) {\n this.handleUncaughtError(httpError);\n }\n })\n );\n }\n\n private handleError(\n httpError: HttpErrorResponse,\n errorContainer: { httpError: HttpErrorResponse }\n ) {\n if (httpError instanceof HttpErrorResponse) {\n const errorObj = httpError.error === 'object' ? httpError.error : {};\n errorObj.message = httpError.error?.message || httpError.statusText;\n errorObj.caught = false;\n\n httpError = new HttpErrorResponse({\n error: errorObj,\n headers: httpError.headers,\n status: httpError.status,\n statusText: httpError.statusText,\n url: httpError.url\n });\n }\n\n errorContainer.httpError = httpError;\n return throwError(httpError);\n }\n\n private handleCaughtError(httpError: HttpErrorResponse) {\n httpError.error.caught = true;\n this.messageService.error(httpError.error.message, httpError.error.title, {\n progressBar: false\n });\n }\n\n private handleUncaughtError(httpError: HttpErrorResponse) {\n httpError.error.caught = true;\n this.messageService.error(\n 'igo.core.errors.uncaught.message',\n 'igo.core.errors.uncaught.title',\n {\n progressBar: false\n }\n );\n }\n}\n","import { HTTP_INTERCEPTORS } from '@angular/common/http';\nimport {\n ModuleWithProviders,\n NgModule,\n Optional,\n SkipSelf\n} from '@angular/core';\n\nimport { ErrorInterceptor } from './error.interceptor';\n\n@NgModule({\n imports: [],\n declarations: [],\n exports: []\n})\nexport class IgoErrorModule {\n static forRoot(): ModuleWithProviders<IgoErrorModule> {\n return {\n ngModule: IgoErrorModule,\n providers: [\n {\n provide: HTTP_INTERCEPTORS,\n useClass: ErrorInterceptor,\n multi: true\n }\n ]\n };\n }\n\n constructor(@Optional() @SkipSelf() parentModule: IgoErrorModule) {\n if (parentModule) {\n throw new Error(\n 'IgoErrorModule is already loaded. Import it in the AppModule only'\n );\n }\n }\n}\n","import {\n HttpEvent,\n HttpHandler,\n HttpInterceptor,\n HttpRequest,\n HttpResponse\n} from '@angular/common/http';\nimport { Injectable } from '@angular/core';\n\nimport { Observable } from 'rxjs';\nimport { finalize, tap } from 'rxjs/operators';\n\n@Injectable()\nexport class LoggingInterceptor implements HttpInterceptor {\n intercept(\n req: HttpRequest<any>,\n next: HttpHandler\n ): Observable<HttpEvent<any>> {\n const started = Date.now();\n let ok: string;\n\n // extend server response observable with logging\n return next.handle(req).pipe(\n tap(\n // Succeeds when there is a response; ignore other events\n (event) => (ok = event instanceof HttpResponse ? 'succeeded' : ''),\n // Operation failed; error is an HttpErrorResponse\n () => (ok = 'failed')\n ),\n // Log when response observable either completes or errors\n finalize(() => {\n const elapsed = Date.now() - started;\n const msg = `${req.method} \"${req.urlWithParams}\"\n ${ok} in ${elapsed} ms.`;\n\n console.log(msg);\n })\n );\n }\n}\n","import { HTTP_INTERCEPTORS } from '@angular/common/http';\nimport { ModuleWithProviders, NgModule } from '@angular/core';\n\nimport { LoggingInterceptor } from './logging.interceptor';\n\n@NgModule({\n imports: [],\n declarations: [],\n exports: []\n})\nexport class IgoLoggingModule {\n static forRoot(): ModuleWithProviders<IgoLoggingModule> {\n return {\n ngModule: IgoLoggingModule,\n providers: [\n {\n provide: HTTP_INTERCEPTORS,\n useClass: LoggingInterceptor,\n multi: true\n }\n ]\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;MAiBa,gBAAgB,CAAA;AACP,IAAA,cAAA;AAApB,IAAA,WAAA,CAAoB,cAA8B,EAAA;QAA9B,IAAc,CAAA,cAAA,GAAd,cAAc;;IAElC,SAAS,CACP,WAA6B,EAC7B,IAAiB,EAAA;QAEjB,MAAM,cAAc,GAAG,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC;AAChE,QAAA,MAAM,GAAG,GAAG,WAAW,CAAC,KAAK,CAAC;YAC5B,OAAO,EAAE,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,gBAAgB;AACrD,SAAA,CAAC;AACF,QAAA,IAAI,cAAc,KAAK,OAAO,EAAE;AAC9B,YAAA,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC;;AAEzB,QAAA,MAAM,cAAc,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE;AAC/C,QAAA,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAC1B,UAAU,CAAC,CAAC,KAAK,KAAK,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,cAAc,CAAC,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E,oBAAA,OAAO,EAAE,iBAAiB;AAC1B,oBAAA,QAAQ,EAAE,kBAAkB;AAC5B,oBAAA,KAAK,EAAE;AACR;AACF;SACF;;wGAXQ,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;yGAAhB,gBAAgB,EAAA,CAAA;yGAAhB,gBAAgB,EAAA,CAAA;;4FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAL5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,EAAE;AACX,oBAAA,YAAY,EAAE,EAAE;AAChB,oBAAA,OAAO,EAAE;AACV,iBAAA;;;ACTD;;AAEG;;;;"}
|
|
@@ -2,6 +2,40 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { InjectionToken, Inject, Optional, Injectable } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/router';
|
|
4
4
|
|
|
5
|
+
const ROUTE_OPTIONS = {
|
|
6
|
+
languageKey: 'lang',
|
|
7
|
+
searchKey: 'search',
|
|
8
|
+
searchGeomKey: 'searchGeom',
|
|
9
|
+
exactMatchKey: 'exactMatch',
|
|
10
|
+
zoomExtentKey: 'zoomExtent',
|
|
11
|
+
focusFirstResultKey: 'sf',
|
|
12
|
+
toolKey: 'tool',
|
|
13
|
+
directionsCoordKey: 'routing',
|
|
14
|
+
directionsOptionsKey: 'routingOptions',
|
|
15
|
+
sidenavKey: 'sidenav',
|
|
16
|
+
visibleOnLayersKey: 'visiblelayers',
|
|
17
|
+
visibleOffLayersKey: 'invisiblelayers',
|
|
18
|
+
vectorKey: 'vector'
|
|
19
|
+
};
|
|
20
|
+
const LEGACY_ROUTE_OPTIONS = {
|
|
21
|
+
projectionKey: 'projection',
|
|
22
|
+
rotationKey: 'rotation',
|
|
23
|
+
zoomKey: 'zoom',
|
|
24
|
+
centerKey: 'center',
|
|
25
|
+
contextKey: 'context',
|
|
26
|
+
layersKey: 'layers',
|
|
27
|
+
wmsUrlKey: 'wmsUrl',
|
|
28
|
+
wmsLayersKey: 'wmsLayers',
|
|
29
|
+
wmtsUrlKey: 'wmtsUrl',
|
|
30
|
+
wmtsLayersKey: 'wmtsLayers',
|
|
31
|
+
arcgisUrlKey: 'arcgisUrl',
|
|
32
|
+
arcgisLayersKey: 'arcgisLayers',
|
|
33
|
+
iarcgisUrlKey: 'iarcgisUrl',
|
|
34
|
+
iarcgisLayersKey: 'iarcgisLayers',
|
|
35
|
+
tarcgisUrlKey: 'tarcgisUrl',
|
|
36
|
+
tarcgisLayersKey: 'tarcgisLayers'
|
|
37
|
+
};
|
|
38
|
+
|
|
5
39
|
const ROUTE_SERVICE_OPTIONS = new InjectionToken('routeServiceOptions');
|
|
6
40
|
function provideRouteServiceOptions(options) {
|
|
7
41
|
return {
|
|
@@ -13,33 +47,15 @@ class RouteService {
|
|
|
13
47
|
router;
|
|
14
48
|
route;
|
|
15
49
|
options;
|
|
16
|
-
|
|
50
|
+
/**
|
|
51
|
+
* @deprecated use the new option of context-service
|
|
52
|
+
*/
|
|
53
|
+
legacyOptions;
|
|
54
|
+
constructor(router, route, configs) {
|
|
17
55
|
this.router = router;
|
|
18
56
|
this.route = route;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
zoomKey: 'zoom',
|
|
22
|
-
projectionKey: 'projection',
|
|
23
|
-
contextKey: 'context',
|
|
24
|
-
searchKey: 'search',
|
|
25
|
-
visibleOnLayersKey: 'visiblelayers',
|
|
26
|
-
visibleOffLayersKey: 'invisiblelayers',
|
|
27
|
-
directionsCoordKey: 'routing',
|
|
28
|
-
directionsOptionsKey: 'routingOptions',
|
|
29
|
-
toolKey: 'tool',
|
|
30
|
-
wmsUrlKey: 'wmsUrl',
|
|
31
|
-
wmsLayersKey: 'wmsLayers',
|
|
32
|
-
wmtsUrlKey: 'wmtsUrl',
|
|
33
|
-
wmtsLayersKey: 'wmtsLayers',
|
|
34
|
-
arcgisUrlKey: 'arcgisUrl',
|
|
35
|
-
arcgisLayersKey: 'arcgisLayers',
|
|
36
|
-
iarcgisUrlKey: 'iarcgisUrl',
|
|
37
|
-
iarcgisLayersKey: 'iarcgisLayers',
|
|
38
|
-
tarcgisUrlKey: 'tarcgisUrl',
|
|
39
|
-
tarcgisLayersKey: 'tarcgisLayers',
|
|
40
|
-
vectorKey: 'vector'
|
|
41
|
-
};
|
|
42
|
-
this.options = Object.assign({}, defaultOptions, options);
|
|
57
|
+
this.options = { ...ROUTE_OPTIONS, ...configs };
|
|
58
|
+
this.legacyOptions = LEGACY_ROUTE_OPTIONS;
|
|
43
59
|
}
|
|
44
60
|
get queryParams() {
|
|
45
61
|
let url = decodeURIComponent(location.search);
|
|
@@ -58,10 +74,10 @@ class RouteService {
|
|
|
58
74
|
}
|
|
59
75
|
return this.route.queryParams;
|
|
60
76
|
}
|
|
61
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
62
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.
|
|
77
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: RouteService, deps: [{ token: i1.Router }, { token: i1.ActivatedRoute }, { token: ROUTE_SERVICE_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
78
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: RouteService, providedIn: 'root' });
|
|
63
79
|
}
|
|
64
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
80
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: RouteService, decorators: [{
|
|
65
81
|
type: Injectable,
|
|
66
82
|
args: [{
|
|
67
83
|
providedIn: 'root'
|
|
@@ -77,5 +93,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImpor
|
|
|
77
93
|
* Generated bundle index. Do not edit.
|
|
78
94
|
*/
|
|
79
95
|
|
|
80
|
-
export { ROUTE_SERVICE_OPTIONS, RouteService, provideRouteServiceOptions };
|
|
96
|
+
export { LEGACY_ROUTE_OPTIONS, ROUTE_OPTIONS, ROUTE_SERVICE_OPTIONS, RouteService, provideRouteServiceOptions };
|
|
81
97
|
//# sourceMappingURL=igo2-core-route.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"igo2-core-route.mjs","sources":["../../../packages/core/route/src/route.service.ts","../../../packages/core/route/src/igo2-core-route.ts"],"sourcesContent":["import { Inject, Injectable, InjectionToken, Optional } from '@angular/core';\nimport { ActivatedRoute, Params, Router } from '@angular/router';\n\nimport { Observable } from 'rxjs';\n\nimport {
|
|
1
|
+
{"version":3,"file":"igo2-core-route.mjs","sources":["../../../packages/core/route/src/route.interface.ts","../../../packages/core/route/src/route.service.ts","../../../packages/core/route/src/igo2-core-route.ts"],"sourcesContent":["export interface RouteServiceOptions {\n centerKey?: string;\n zoomKey?: string;\n projectionKey?: string;\n contextKey?: string;\n searchKey?: string;\n visibleOnLayersKey?: string;\n visibleOffLayersKey?: string;\n directionsCoordKey?: string;\n directionsOptionsKey?: string;\n toolKey?: string;\n wmsUrlKey?: string;\n wmsLayersKey?: string;\n wmtsUrlKey?: string;\n wmtsLayersKey?: string;\n arcgisUrlKey?: string;\n arcgisLayersKey?: string;\n iarcgisUrlKey?: string;\n iarcgisLayersKey?: string;\n tarcgisUrlKey?: string;\n tarcgisLayersKey?: string;\n vectorKey?: string;\n zoomExtentKey?: string;\n exactMatchKey?: string;\n focusFirstResultKey?: string;\n searchGeomKey?: string;\n sidenavKey?: string;\n urlsKey?: string;\n languageKey?: string;\n positionKey?: string;\n layersKey?: string;\n groupsKey?: string;\n rotationKey?: string;\n}\n\nexport const ROUTE_OPTIONS: RouteServiceOptions = {\n languageKey: 'lang',\n searchKey: 'search',\n searchGeomKey: 'searchGeom',\n exactMatchKey: 'exactMatch',\n zoomExtentKey: 'zoomExtent',\n focusFirstResultKey: 'sf',\n toolKey: 'tool',\n directionsCoordKey: 'routing',\n directionsOptionsKey: 'routingOptions',\n sidenavKey: 'sidenav',\n visibleOnLayersKey: 'visiblelayers',\n visibleOffLayersKey: 'invisiblelayers',\n vectorKey: 'vector'\n};\n\nexport const LEGACY_ROUTE_OPTIONS: RouteServiceOptions = {\n projectionKey: 'projection',\n rotationKey: 'rotation',\n zoomKey: 'zoom',\n centerKey: 'center',\n contextKey: 'context',\n layersKey: 'layers',\n wmsUrlKey: 'wmsUrl',\n wmsLayersKey: 'wmsLayers',\n wmtsUrlKey: 'wmtsUrl',\n wmtsLayersKey: 'wmtsLayers',\n arcgisUrlKey: 'arcgisUrl',\n arcgisLayersKey: 'arcgisLayers',\n iarcgisUrlKey: 'iarcgisUrl',\n iarcgisLayersKey: 'iarcgisLayers',\n tarcgisUrlKey: 'tarcgisUrl',\n tarcgisLayersKey: 'tarcgisLayers'\n};\n","import { Inject, Injectable, InjectionToken, Optional } from '@angular/core';\nimport { ActivatedRoute, Params, Router } from '@angular/router';\n\nimport { Observable } from 'rxjs';\n\nimport {\n LEGACY_ROUTE_OPTIONS,\n ROUTE_OPTIONS,\n RouteServiceOptions\n} from './route.interface';\n\nexport const ROUTE_SERVICE_OPTIONS = new InjectionToken<RouteServiceOptions>(\n 'routeServiceOptions'\n);\n\nexport function provideRouteServiceOptions(options: RouteServiceOptions) {\n return {\n provide: ROUTE_SERVICE_OPTIONS,\n useValue: options\n };\n}\n\n@Injectable({\n providedIn: 'root'\n})\nexport class RouteService {\n public options: RouteServiceOptions;\n\n /**\n * @deprecated use the new option of context-service\n */\n public legacyOptions: RouteServiceOptions;\n\n constructor(\n private router: Router,\n public route: ActivatedRoute,\n @Inject(ROUTE_SERVICE_OPTIONS)\n @Optional()\n configs: RouteServiceOptions\n ) {\n this.options = { ...ROUTE_OPTIONS, ...configs };\n this.legacyOptions = LEGACY_ROUTE_OPTIONS;\n }\n\n get queryParams(): Observable<Params> {\n let url = decodeURIComponent(location.search);\n if (url.includes('¢er=')) {\n url = url.replace('¢er', '¢er');\n const queryParams: any = url\n .slice(1)\n .split('&')\n .map((p) => p.split('='))\n .reduce((obj, pair) => {\n const [key, value] = pair.map(decodeURIComponent);\n obj[key] = value;\n return obj;\n }, {});\n this.router.navigate([], { queryParams });\n }\n return this.route.queryParams;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;AAmCa,MAAA,aAAa,GAAwB;AAChD,IAAA,WAAW,EAAE,MAAM;AACnB,IAAA,SAAS,EAAE,QAAQ;AACnB,IAAA,aAAa,EAAE,YAAY;AAC3B,IAAA,aAAa,EAAE,YAAY;AAC3B,IAAA,aAAa,EAAE,YAAY;AAC3B,IAAA,mBAAmB,EAAE,IAAI;AACzB,IAAA,OAAO,EAAE,MAAM;AACf,IAAA,kBAAkB,EAAE,SAAS;AAC7B,IAAA,oBAAoB,EAAE,gBAAgB;AACtC,IAAA,UAAU,EAAE,SAAS;AACrB,IAAA,kBAAkB,EAAE,eAAe;AACnC,IAAA,mBAAmB,EAAE,iBAAiB;AACtC,IAAA,SAAS,EAAE;;AAGA,MAAA,oBAAoB,GAAwB;AACvD,IAAA,aAAa,EAAE,YAAY;AAC3B,IAAA,WAAW,EAAE,UAAU;AACvB,IAAA,OAAO,EAAE,MAAM;AACf,IAAA,SAAS,EAAE,QAAQ;AACnB,IAAA,UAAU,EAAE,SAAS;AACrB,IAAA,SAAS,EAAE,QAAQ;AACnB,IAAA,SAAS,EAAE,QAAQ;AACnB,IAAA,YAAY,EAAE,WAAW;AACzB,IAAA,UAAU,EAAE,SAAS;AACrB,IAAA,aAAa,EAAE,YAAY;AAC3B,IAAA,YAAY,EAAE,WAAW;AACzB,IAAA,eAAe,EAAE,cAAc;AAC/B,IAAA,aAAa,EAAE,YAAY;AAC3B,IA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