@lenne.tech/ng-base 18.1.3 → 22.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/CLAUDE.md +55 -0
- package/LICENSE +2 -2
- package/README.md +237 -44
- package/fesm2022/lenne.tech-ng-base-ai.mjs +767 -0
- package/fesm2022/lenne.tech-ng-base-ai.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-auth-provide.mjs +939 -0
- package/fesm2022/lenne.tech-ng-base-auth-provide.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-auth.mjs +454 -0
- package/fesm2022/lenne.tech-ng-base-auth.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-bug-bug-report-dialog-BRzVmKJr.mjs +825 -0
- package/fesm2022/lenne.tech-ng-base-bug-bug-report-dialog-BRzVmKJr.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-bug-bug-report-service-DWoTb_iw.mjs +351 -0
- package/fesm2022/lenne.tech-ng-base-bug-bug-report-service-DWoTb_iw.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-bug-capture-engine-TkjMDdqj.mjs +1046 -0
- package/fesm2022/lenne.tech-ng-base-bug-capture-engine-TkjMDdqj.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-bug-constants-Brm2KGHi.mjs +4 -0
- package/fesm2022/lenne.tech-ng-base-bug-constants-Brm2KGHi.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-bug-messages-BsP4fRQU.mjs +179 -0
- package/fesm2022/lenne.tech-ng-base-bug-messages-BsP4fRQU.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-bug-provide.mjs +26 -0
- package/fesm2022/lenne.tech-ng-base-bug-provide.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-bug-report-Tzlhe1Cm.mjs +62 -0
- package/fesm2022/lenne.tech-ng-base-bug-report-Tzlhe1Cm.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-bug-server.mjs +818 -0
- package/fesm2022/lenne.tech-ng-base-bug-server.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-bug.mjs +196 -0
- package/fesm2022/lenne.tech-ng-base-bug.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-files-ui.mjs +445 -0
- package/fesm2022/lenne.tech-ng-base-files-ui.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-files.mjs +474 -0
- package/fesm2022/lenne.tech-ng-base-files.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-server.mjs +408 -0
- package/fesm2022/lenne.tech-ng-base-server.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-share.mjs +76 -0
- package/fesm2022/lenne.tech-ng-base-share.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-sync.mjs +1096 -0
- package/fesm2022/lenne.tech-ng-base-sync.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-testing.mjs +171 -0
- package/fesm2022/lenne.tech-ng-base-testing.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-ui-provide.mjs +124 -0
- package/fesm2022/lenne.tech-ng-base-ui-provide.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-ui.mjs +34611 -0
- package/fesm2022/lenne.tech-ng-base-ui.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-utils.mjs +287 -0
- package/fesm2022/lenne.tech-ng-base-utils.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base.mjs +615 -910
- package/fesm2022/lenne.tech-ng-base.mjs.map +1 -1
- package/i18n/auth/de.json +17 -0
- package/i18n/auth/en.json +17 -0
- package/i18n/bug/de.json +85 -0
- package/i18n/bug/en.json +85 -0
- package/i18n/de.json +8 -0
- package/i18n/en.json +8 -0
- package/i18n/files/de.json +27 -0
- package/i18n/files/en.json +27 -0
- package/i18n/share/de.json +8 -0
- package/i18n/share/en.json +8 -0
- package/i18n/ui/de.json +38 -0
- package/i18n/ui/en.json +38 -0
- package/package.json +127 -58
- package/types/lenne.tech-ng-base-ai.d.ts +830 -0
- package/types/lenne.tech-ng-base-auth-provide.d.ts +603 -0
- package/types/lenne.tech-ng-base-auth.d.ts +320 -0
- package/types/lenne.tech-ng-base-bug-provide.d.ts +272 -0
- package/types/lenne.tech-ng-base-bug-rolldown-runtime-C25Le4-w.d.ts +1 -0
- package/types/lenne.tech-ng-base-bug-server.d.ts +316 -0
- package/types/lenne.tech-ng-base-bug.d.ts +202 -0
- package/types/lenne.tech-ng-base-files-ui.d.ts +116 -0
- package/types/lenne.tech-ng-base-files.d.ts +288 -0
- package/types/lenne.tech-ng-base-server.d.ts +262 -0
- package/types/lenne.tech-ng-base-share.d.ts +21 -0
- package/types/lenne.tech-ng-base-sync.d.ts +380 -0
- package/types/lenne.tech-ng-base-testing.d.ts +327 -0
- package/types/lenne.tech-ng-base-ui-provide.d.ts +65 -0
- package/types/lenne.tech-ng-base-ui.d.ts +7732 -0
- package/types/lenne.tech-ng-base-utils.d.ts +150 -0
- package/types/lenne.tech-ng-base.d.ts +503 -0
- package/ui/styles/components/accordion.css +3 -0
- package/ui/styles/components/alert-dialog.css +4 -0
- package/ui/styles/components/alert.css +3 -0
- package/ui/styles/components/aspect-ratio.css +3 -0
- package/ui/styles/components/attachment.css +4 -0
- package/ui/styles/components/autocomplete.css +4 -0
- package/ui/styles/components/avatar.css +3 -0
- package/ui/styles/components/badge.css +3 -0
- package/ui/styles/components/breadcrumb.css +3 -0
- package/ui/styles/components/bubble.css +3 -0
- package/ui/styles/components/button-group.css +3 -0
- package/ui/styles/components/button.css +3 -0
- package/ui/styles/components/calendar.css +5 -0
- package/ui/styles/components/card.css +3 -0
- package/ui/styles/components/checkbox.css +3 -0
- package/ui/styles/components/code-block.css +4 -0
- package/ui/styles/components/collapsible.css +3 -0
- package/ui/styles/components/combobox.css +5 -0
- package/ui/styles/components/command.css +5 -0
- package/ui/styles/components/context-menu.css +3 -0
- package/ui/styles/components/date-picker.css +7 -0
- package/ui/styles/components/dialog.css +4 -0
- package/ui/styles/components/drawer.css +3 -0
- package/ui/styles/components/dropdown-menu.css +3 -0
- package/ui/styles/components/empty.css +3 -0
- package/ui/styles/components/field.css +5 -0
- package/ui/styles/components/hover-card.css +3 -0
- package/ui/styles/components/index.css +91 -0
- package/ui/styles/components/input-group.css +6 -0
- package/ui/styles/components/input-otp.css +3 -0
- package/ui/styles/components/input.css +3 -0
- package/ui/styles/components/item.css +4 -0
- package/ui/styles/components/kbd.css +3 -0
- package/ui/styles/components/label.css +3 -0
- package/ui/styles/components/lt-breadcrumb.css +3 -0
- package/ui/styles/components/lt-bug-attachments.css +5 -0
- package/ui/styles/components/lt-bug-journey-timeline.css +5 -0
- package/ui/styles/components/lt-bug-report-dialog.css +15 -0
- package/ui/styles/components/lt-bug-report.css +4 -0
- package/ui/styles/components/lt-color-mode-button.css +3 -0
- package/ui/styles/components/lt-confirm-dialog.css +4 -0
- package/ui/styles/components/lt-data-view.css +5 -0
- package/ui/styles/components/lt-date-picker.css +3 -0
- package/ui/styles/components/lt-date-time-picker.css +5 -0
- package/ui/styles/components/lt-enter-action.css +2 -0
- package/ui/styles/components/lt-footer.css +3 -0
- package/ui/styles/components/lt-form-field.css +4 -0
- package/ui/styles/components/lt-header.css +5 -0
- package/ui/styles/components/lt-imports.css +21 -0
- package/ui/styles/components/lt-navigation-menu.css +3 -0
- package/ui/styles/components/lt-notice.css +3 -0
- package/ui/styles/components/lt-overlay-defaults.css +3 -0
- package/ui/styles/components/lt-page-card.css +3 -0
- package/ui/styles/components/lt-page-title.css +2 -0
- package/ui/styles/components/lt-password-input.css +4 -0
- package/ui/styles/components/lt-readonly-field.css +2 -0
- package/ui/styles/components/lt-select.css +4 -0
- package/ui/styles/components/lt-text-field.css +5 -0
- package/ui/styles/components/lt-toolbar-item.css +2 -0
- package/ui/styles/components/lt-toolbar.css +3 -0
- package/ui/styles/components/lt-tus-upload-component.css +5 -0
- package/ui/styles/components/marker.css +3 -0
- package/ui/styles/components/menubar.css +3 -0
- package/ui/styles/components/message-scroller.css +4 -0
- package/ui/styles/components/message.css +3 -0
- package/ui/styles/components/native-select.css +3 -0
- package/ui/styles/components/navigation-menu.css +3 -0
- package/ui/styles/components/pagination.css +4 -0
- package/ui/styles/components/popover.css +3 -0
- package/ui/styles/components/progress.css +3 -0
- package/ui/styles/components/questionnaire.css +4 -0
- package/ui/styles/components/radio-group.css +3 -0
- package/ui/styles/components/resizable.css +3 -0
- package/ui/styles/components/select.css +3 -0
- package/ui/styles/components/separator.css +3 -0
- package/ui/styles/components/sheet.css +4 -0
- package/ui/styles/components/sidebar.css +9 -0
- package/ui/styles/components/skeleton.css +3 -0
- package/ui/styles/components/slider.css +3 -0
- package/ui/styles/components/sonner.css +4 -0
- package/ui/styles/components/spinner.css +3 -0
- package/ui/styles/components/switch.css +3 -0
- package/ui/styles/components/table.css +3 -0
- package/ui/styles/components/tabs.css +4 -0
- package/ui/styles/components/textarea.css +3 -0
- package/ui/styles/components/toggle-group.css +4 -0
- package/ui/styles/components/toggle.css +3 -0
- package/ui/styles/components/tooltip.css +3 -0
- package/ui/styles/components/trace.css +3 -0
- package/ui/styles/components/typography.css +3 -0
- package/ui/styles/components/utils.css +2 -0
- package/ui/styles/core.css +137 -0
- package/ui/styles/palette.css +94 -0
- package/ui/styles/theme.css +14 -0
- package/ui/styles/transitions.css +131 -0
- package/base-cms/index.d.ts +0 -5
- package/base-cms/interfaces/base-cms-module-config.interface.d.ts +0 -16
- package/base-cms/pages/base-cms/base-cms.component.d.ts +0 -92
- package/base-cms/public-api.d.ts +0 -5
- package/base-components/components/breadcrumb/breadcrumb.component.d.ts +0 -10
- package/base-components/components/change-password/change-password.component.d.ts +0 -24
- package/base-components/components/checkbox/checkbox.component.d.ts +0 -12
- package/base-components/components/delete-account/delete-account.component.d.ts +0 -15
- package/base-components/components/fab-button/fab-button.component.d.ts +0 -16
- package/base-components/components/input/input.component.d.ts +0 -27
- package/base-components/components/loading-bar/loading-bar.component.d.ts +0 -17
- package/base-components/components/model-form/model-form-base.component.d.ts +0 -64
- package/base-components/components/model-form/model-form.component.d.ts +0 -139
- package/base-components/components/model-form-sub/model-form-sub.component.d.ts +0 -56
- package/base-components/components/model-table/model-table.component.d.ts +0 -115
- package/base-components/components/refence-input/refence-input.component.d.ts +0 -84
- package/base-components/components/select/select.component.d.ts +0 -25
- package/base-components/components/skeleton-loader/skeleton-loader.component.d.ts +0 -10
- package/base-components/components/tags/tags.component.d.ts +0 -60
- package/base-components/components/textarea/textarea.component.d.ts +0 -21
- package/base-components/components/toast/toast.component.d.ts +0 -19
- package/base-components/components/upload-image/upload-image.component.d.ts +0 -111
- package/base-components/directives/back-button.directive.d.ts +0 -9
- package/base-components/directives/context-menu.directive.d.ts +0 -22
- package/base-components/directives/sort.directive.d.ts +0 -15
- package/base-components/directives/stop-propagation.directive.d.ts +0 -10
- package/base-components/index.d.ts +0 -5
- package/base-components/pipes/ellipses.pipe.d.ts +0 -10
- package/base-components/public-api.d.ts +0 -26
- package/base-prototype/index.d.ts +0 -5
- package/base-prototype/pages/email-verification/email-verification.component.d.ts +0 -18
- package/base-prototype/pages/forgot-password/forgot-password.component.d.ts +0 -26
- package/base-prototype/pages/login/login.component.d.ts +0 -33
- package/base-prototype/pages/profile/profile.component.d.ts +0 -24
- package/base-prototype/pages/register/register.component.d.ts +0 -31
- package/base-prototype/pages/set-password/set-password.component.d.ts +0 -29
- package/base-prototype/public-api.d.ts +0 -9
- package/esm2022/base-cms/interfaces/base-cms-module-config.interface.mjs +0 -3
- package/esm2022/base-cms/lenne.tech-ng-base-base-cms.mjs +0 -5
- package/esm2022/base-cms/pages/base-cms/base-cms.component.mjs +0 -238
- package/esm2022/base-cms/public-api.mjs +0 -8
- package/esm2022/base-components/components/breadcrumb/breadcrumb.component.mjs +0 -23
- package/esm2022/base-components/components/change-password/change-password.component.mjs +0 -97
- package/esm2022/base-components/components/checkbox/checkbox.component.mjs +0 -38
- package/esm2022/base-components/components/delete-account/delete-account.component.mjs +0 -59
- package/esm2022/base-components/components/fab-button/fab-button.component.mjs +0 -24
- package/esm2022/base-components/components/input/input.component.mjs +0 -75
- package/esm2022/base-components/components/loading-bar/loading-bar.component.mjs +0 -37
- package/esm2022/base-components/components/model-form/model-form-base.component.mjs +0 -145
- package/esm2022/base-components/components/model-form/model-form.component.mjs +0 -591
- package/esm2022/base-components/components/model-form-sub/model-form-sub.component.mjs +0 -117
- package/esm2022/base-components/components/model-table/model-table.component.mjs +0 -478
- package/esm2022/base-components/components/refence-input/refence-input.component.mjs +0 -278
- package/esm2022/base-components/components/select/select.component.mjs +0 -62
- package/esm2022/base-components/components/skeleton-loader/skeleton-loader.component.mjs +0 -33
- package/esm2022/base-components/components/tags/tags.component.mjs +0 -227
- package/esm2022/base-components/components/textarea/textarea.component.mjs +0 -79
- package/esm2022/base-components/components/toast/toast.component.mjs +0 -69
- package/esm2022/base-components/components/upload-image/upload-image.component.mjs +0 -346
- package/esm2022/base-components/directives/back-button.directive.mjs +0 -25
- package/esm2022/base-components/directives/context-menu.directive.mjs +0 -112
- package/esm2022/base-components/directives/sort.directive.mjs +0 -61
- package/esm2022/base-components/directives/stop-propagation.directive.mjs +0 -24
- package/esm2022/base-components/lenne.tech-ng-base-base-components.mjs +0 -5
- package/esm2022/base-components/pipes/ellipses.pipe.mjs +0 -23
- package/esm2022/base-components/public-api.mjs +0 -30
- package/esm2022/base-prototype/lenne.tech-ng-base-base-prototype.mjs +0 -5
- package/esm2022/base-prototype/pages/email-verification/email-verification.component.mjs +0 -60
- package/esm2022/base-prototype/pages/forgot-password/forgot-password.component.mjs +0 -78
- package/esm2022/base-prototype/pages/login/login.component.mjs +0 -114
- package/esm2022/base-prototype/pages/profile/profile.component.mjs +0 -87
- package/esm2022/base-prototype/pages/register/register.component.mjs +0 -100
- package/esm2022/base-prototype/pages/set-password/set-password.component.mjs +0 -91
- package/esm2022/base-prototype/public-api.mjs +0 -11
- package/esm2022/lenne.tech-ng-base.mjs +0 -5
- package/esm2022/public-api.mjs +0 -25
- package/esm2022/shared/classes/auth.class.mjs +0 -14
- package/esm2022/shared/classes/basic-user.class.mjs +0 -49
- package/esm2022/shared/classes/graphql-enum.class.mjs +0 -10
- package/esm2022/shared/classes/graphql-meta.class.mjs +0 -345
- package/esm2022/shared/classes/graphql-type.class.mjs +0 -14
- package/esm2022/shared/classes/helper.class.mjs +0 -307
- package/esm2022/shared/classes/sort.class.mjs +0 -38
- package/esm2022/shared/classes/standard.class.mjs +0 -40
- package/esm2022/shared/decorators/debounce.decorator.mjs +0 -12
- package/esm2022/shared/enums/comparison-operator.enum.mjs +0 -16
- package/esm2022/shared/enums/graphql-request-type.enum.mjs +0 -10
- package/esm2022/shared/enums/logical-operator.enum.mjs +0 -10
- package/esm2022/shared/enums/skeleton-type.enum.mjs +0 -7
- package/esm2022/shared/enums/sort-order.enum.mjs +0 -6
- package/esm2022/shared/enums/toast-type.enum.mjs +0 -8
- package/esm2022/shared/functions/ws-client.function.mjs +0 -39
- package/esm2022/shared/interfaces/base-module-config.interface.mjs +0 -3
- package/esm2022/shared/interfaces/breadcrumb.interface.mjs +0 -2
- package/esm2022/shared/interfaces/can-component-deactivate.interface.mjs +0 -2
- package/esm2022/shared/interfaces/cms-enum-values.interface.mjs +0 -2
- package/esm2022/shared/interfaces/cms-field-config.interface.mjs +0 -2
- package/esm2022/shared/interfaces/cms-model-config.interface.mjs +0 -2
- package/esm2022/shared/interfaces/cms-table-field.interface.mjs +0 -2
- package/esm2022/shared/interfaces/combined-filter-input.interface.mjs +0 -2
- package/esm2022/shared/interfaces/compress-options.interface.mjs +0 -2
- package/esm2022/shared/interfaces/cropping-options.interface.mjs +0 -2
- package/esm2022/shared/interfaces/field-object.interface.mjs +0 -2
- package/esm2022/shared/interfaces/field.interface.mjs +0 -2
- package/esm2022/shared/interfaces/filter-input.interface.mjs +0 -2
- package/esm2022/shared/interfaces/find-args.interface.mjs +0 -2
- package/esm2022/shared/interfaces/graphql-crud-type.interface.mjs +0 -2
- package/esm2022/shared/interfaces/graphql-fields-object.interface.mjs +0 -2
- package/esm2022/shared/interfaces/graphql-options.interface.mjs +0 -2
- package/esm2022/shared/interfaces/graphql-plus-options.interfacen.mjs +0 -2
- package/esm2022/shared/interfaces/graphql-type-collection.interface.mjs +0 -2
- package/esm2022/shared/interfaces/login-config.interface.mjs +0 -2
- package/esm2022/shared/interfaces/register-config.interface.mjs +0 -2
- package/esm2022/shared/interfaces/single-filter-input.interface.mjs +0 -2
- package/esm2022/shared/interfaces/sort-input.interface.mjs +0 -2
- package/esm2022/shared/interfaces/time-components.interface.mjs +0 -2
- package/esm2022/shared/interfaces/toast.interface.mjs +0 -2
- package/esm2022/shared/lenne.tech-ng-base-shared.mjs +0 -5
- package/esm2022/shared/public-api.mjs +0 -74
- package/esm2022/shared/services/auth.service.mjs +0 -152
- package/esm2022/shared/services/breadcrumb.service.mjs +0 -69
- package/esm2022/shared/services/cms.service.mjs +0 -82
- package/esm2022/shared/services/file.service.mjs +0 -86
- package/esm2022/shared/services/forms.service.mjs +0 -61
- package/esm2022/shared/services/graphql-meta.service.mjs +0 -132
- package/esm2022/shared/services/graphql-plus.service.mjs +0 -93
- package/esm2022/shared/services/graphql.service.mjs +0 -510
- package/esm2022/shared/services/image.service.mjs +0 -102
- package/esm2022/shared/services/loader.service.mjs +0 -78
- package/esm2022/shared/services/navigation.service.mjs +0 -38
- package/esm2022/shared/services/scroll.service.mjs +0 -207
- package/esm2022/shared/services/storage.service.mjs +0 -149
- package/esm2022/shared/services/toast.service.mjs +0 -39
- package/esm2022/shared/services/user.service.mjs +0 -160
- package/esm2022/shared/services/ws.service.mjs +0 -17
- package/esm2022/shared/types/graphql-fields.type.mjs +0 -2
- package/esm2022/shared/types/storage.type.mjs +0 -2
- package/esm2022/shared/validators/email.validator.mjs +0 -7
- package/esm2022/shared/validators/match.validator.mjs +0 -22
- package/esm2022/shared/validators/secure-password.validator.mjs +0 -7
- package/esm2022/src/base.module.mjs +0 -64
- package/esm2022/src/decorators/auto-unsubscribe.decorator.mjs +0 -23
- package/esm2022/src/directives/lazy-load.directive.mjs +0 -48
- package/esm2022/src/directives/match-height.directive.mjs +0 -92
- package/esm2022/src/directives/resizable.directive.mjs +0 -92
- package/esm2022/src/factories/apollo-options.factory.mjs +0 -108
- package/esm2022/src/functions/extract-files.function.mjs +0 -87
- package/esm2022/src/guards/auth.guard.mjs +0 -91
- package/esm2022/src/guards/can-deactivate.guard.mjs +0 -16
- package/esm2022/src/guards/logout.guard.mjs +0 -34
- package/esm2022/src/pipes/date-ago.pipe.mjs +0 -64
- package/esm2022/src/pipes/safe-html.pipe.mjs +0 -22
- package/esm2022/src/services/fullscreen.service.mjs +0 -51
- package/esm2022/src/services/seo.service.mjs +0 -117
- package/esm2022/src/services/theme.service.mjs +0 -44
- package/fesm2022/lenne.tech-ng-base-base-cms.mjs +0 -251
- package/fesm2022/lenne.tech-ng-base-base-cms.mjs.map +0 -1
- package/fesm2022/lenne.tech-ng-base-base-components.mjs +0 -2917
- package/fesm2022/lenne.tech-ng-base-base-components.mjs.map +0 -1
- package/fesm2022/lenne.tech-ng-base-base-prototype.mjs +0 -505
- package/fesm2022/lenne.tech-ng-base-base-prototype.mjs.map +0 -1
- package/fesm2022/lenne.tech-ng-base-shared.mjs +0 -2863
- package/fesm2022/lenne.tech-ng-base-shared.mjs.map +0 -1
- package/index.d.ts +0 -5
- package/public-api.d.ts +0 -17
- package/shared/classes/auth.class.d.ts +0 -10
- package/shared/classes/basic-user.class.d.ts +0 -27
- package/shared/classes/graphql-enum.class.d.ts +0 -7
- package/shared/classes/graphql-meta.class.d.ts +0 -66
- package/shared/classes/graphql-type.class.d.ts +0 -13
- package/shared/classes/helper.class.d.ts +0 -99
- package/shared/classes/sort.class.d.ts +0 -12
- package/shared/classes/standard.class.d.ts +0 -32
- package/shared/decorators/debounce.decorator.d.ts +0 -1
- package/shared/enums/comparison-operator.enum.d.ts +0 -14
- package/shared/enums/graphql-request-type.enum.d.ts +0 -8
- package/shared/enums/logical-operator.enum.d.ts +0 -8
- package/shared/enums/skeleton-type.enum.d.ts +0 -5
- package/shared/enums/sort-order.enum.d.ts +0 -4
- package/shared/enums/toast-type.enum.d.ts +0 -6
- package/shared/functions/ws-client.function.d.ts +0 -5
- package/shared/index.d.ts +0 -5
- package/shared/interfaces/base-module-config.interface.d.ts +0 -61
- package/shared/interfaces/breadcrumb.interface.d.ts +0 -4
- package/shared/interfaces/can-component-deactivate.interface.d.ts +0 -7
- package/shared/interfaces/cms-enum-values.interface.d.ts +0 -4
- package/shared/interfaces/cms-field-config.interface.d.ts +0 -45
- package/shared/interfaces/cms-model-config.interface.d.ts +0 -14
- package/shared/interfaces/cms-table-field.interface.d.ts +0 -10
- package/shared/interfaces/combined-filter-input.interface.d.ts +0 -9
- package/shared/interfaces/compress-options.interface.d.ts +0 -15
- package/shared/interfaces/cropping-options.interface.d.ts +0 -12
- package/shared/interfaces/field-object.interface.d.ts +0 -6
- package/shared/interfaces/field.interface.d.ts +0 -5
- package/shared/interfaces/filter-input.interface.d.ts +0 -9
- package/shared/interfaces/find-args.interface.d.ts +0 -11
- package/shared/interfaces/graphql-crud-type.interface.d.ts +0 -7
- package/shared/interfaces/graphql-fields-object.interface.d.ts +0 -6
- package/shared/interfaces/graphql-options.interface.d.ts +0 -11
- package/shared/interfaces/graphql-plus-options.interfacen.d.ts +0 -9
- package/shared/interfaces/graphql-type-collection.interface.d.ts +0 -7
- package/shared/interfaces/login-config.interface.d.ts +0 -6
- package/shared/interfaces/register-config.interface.d.ts +0 -4
- package/shared/interfaces/single-filter-input.interface.d.ts +0 -11
- package/shared/interfaces/sort-input.interface.d.ts +0 -5
- package/shared/interfaces/time-components.interface.d.ts +0 -6
- package/shared/interfaces/toast.interface.d.ts +0 -8
- package/shared/public-api.d.ts +0 -65
- package/shared/services/auth.service.d.ts +0 -44
- package/shared/services/breadcrumb.service.d.ts +0 -32
- package/shared/services/cms.service.d.ts +0 -27
- package/shared/services/file.service.d.ts +0 -22
- package/shared/services/forms.service.d.ts +0 -14
- package/shared/services/graphql-meta.service.d.ts +0 -45
- package/shared/services/graphql-plus.service.d.ts +0 -27
- package/shared/services/graphql.service.d.ts +0 -71
- package/shared/services/image.service.d.ts +0 -27
- package/shared/services/loader.service.d.ts +0 -32
- package/shared/services/navigation.service.d.ts +0 -15
- package/shared/services/scroll.service.d.ts +0 -85
- package/shared/services/storage.service.d.ts +0 -49
- package/shared/services/toast.service.d.ts +0 -15
- package/shared/services/user.service.d.ts +0 -77
- package/shared/services/ws.service.d.ts +0 -8
- package/shared/types/graphql-fields.type.d.ts +0 -5
- package/shared/types/storage.type.d.ts +0 -4
- package/shared/validators/email.validator.d.ts +0 -1
- package/shared/validators/match.validator.d.ts +0 -4
- package/shared/validators/secure-password.validator.d.ts +0 -1
- package/src/base.module.d.ts +0 -16
- package/src/decorators/auto-unsubscribe.decorator.d.ts +0 -5
- package/src/directives/lazy-load.directive.d.ts +0 -17
- package/src/directives/match-height.directive.d.ts +0 -20
- package/src/directives/resizable.directive.d.ts +0 -26
- package/src/factories/apollo-options.factory.d.ts +0 -16
- package/src/functions/extract-files.function.d.ts +0 -15
- package/src/guards/auth.guard.d.ts +0 -27
- package/src/guards/can-deactivate.guard.d.ts +0 -10
- package/src/guards/logout.guard.d.ts +0 -16
- package/src/pipes/date-ago.pipe.d.ts +0 -34
- package/src/pipes/safe-html.pipe.d.ts +0 -13
- package/src/services/fullscreen.service.d.ts +0 -18
- package/src/services/seo.service.d.ts +0 -61
- package/src/services/theme.service.d.ts +0 -17
|
@@ -1,928 +1,633 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import { createRestartableClient, BASE_MODULE_CONFIG, AuthService, WsService } from '@lenne.tech/ng-base/shared';
|
|
10
|
-
import { GraphQLWsLink } from '@apollo/client/link/subscriptions';
|
|
11
|
-
import { firstValueFrom, Observable, BehaviorSubject } from 'rxjs';
|
|
12
|
-
import { onError } from '@apollo/client/link/error';
|
|
13
|
-
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
|
14
|
-
import { isPlatformBrowser, DOCUMENT } from '@angular/common';
|
|
15
|
-
import * as i1 from '@angular/router';
|
|
16
|
-
import * as i1$1 from '@angular/platform-browser';
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Inspired by Inpspired by https://github.com/jaydenseric/extract-files/releases/tag/v11.0.0
|
|
20
|
-
*/
|
|
21
|
-
/**
|
|
22
|
-
* Reactive native file
|
|
23
|
-
*/
|
|
24
|
-
class ReactNativeFile {
|
|
25
|
-
uri;
|
|
26
|
-
name;
|
|
27
|
-
type;
|
|
28
|
-
constructor(uri, name, type) {
|
|
29
|
-
this.uri = uri;
|
|
30
|
-
this.name = name;
|
|
31
|
-
this.type = type;
|
|
32
|
-
}
|
|
1
|
+
import { DOCUMENT, isPlatformBrowser, isPlatformServer } from "@angular/common";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import { ApplicationRef, InjectionToken, PLATFORM_ID, REQUEST, REQUEST_CONTEXT, Service, computed, inject, isDevMode, makeEnvironmentProviders, provideAppInitializer, signal } from "@angular/core";
|
|
4
|
+
const warnedKeys = /* @__PURE__ */ new Set();
|
|
5
|
+
function warnLtOnce(key, message, level = "warn") {
|
|
6
|
+
if (warnedKeys.has(key)) return;
|
|
7
|
+
warnedKeys.add(key);
|
|
8
|
+
console[level](message);
|
|
33
9
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
*/
|
|
37
|
-
function isExtractableFile(value) {
|
|
38
|
-
return ((typeof File !== 'undefined' && value instanceof File) ||
|
|
39
|
-
(typeof Blob !== 'undefined' && value instanceof Blob) ||
|
|
40
|
-
value instanceof ReactNativeFile);
|
|
10
|
+
function resetLtWarnOnceState() {
|
|
11
|
+
warnedKeys.clear();
|
|
41
12
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
// for reusing clones of values that are referenced multiple times within the
|
|
50
|
-
// input value.
|
|
51
|
-
const clones = new Map();
|
|
52
|
-
/**
|
|
53
|
-
* Recursively clones the value, extracting files.
|
|
54
|
-
*/
|
|
55
|
-
function recurse(recurseValue, recursePath, recursed) {
|
|
56
|
-
let clone = recurseValue;
|
|
57
|
-
if (isExtractableFileFunc(recurseValue)) {
|
|
58
|
-
clone = null;
|
|
59
|
-
const filePaths = files.get(recurseValue);
|
|
60
|
-
filePaths ? filePaths.push(recursePath) : files.set(recurseValue, [recursePath]);
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
63
|
-
const isList = Array.isArray(recurseValue) || (typeof FileList !== 'undefined' && recurseValue instanceof FileList);
|
|
64
|
-
const isObject = recurseValue && recurseValue.constructor === Object;
|
|
65
|
-
if (isList || isObject) {
|
|
66
|
-
const hasClone = clones.has(recurseValue);
|
|
67
|
-
if (hasClone) {
|
|
68
|
-
clone = clones.get(recurseValue);
|
|
69
|
-
}
|
|
70
|
-
else {
|
|
71
|
-
clone = isList ? [] : {};
|
|
72
|
-
clones.set(recurseValue, clone);
|
|
73
|
-
}
|
|
74
|
-
if (!recursed.has(recurseValue)) {
|
|
75
|
-
const pathPrefix = recursePath ? `${recursePath}.` : '';
|
|
76
|
-
const recursedDeeper = new Set(recursed).add(recurseValue);
|
|
77
|
-
if (isList) {
|
|
78
|
-
let index = 0;
|
|
79
|
-
for (const item of recurseValue) {
|
|
80
|
-
const itemClone = recurse(item, pathPrefix + index++, recursedDeeper);
|
|
81
|
-
if (!hasClone) {
|
|
82
|
-
clone.push(itemClone);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
else {
|
|
87
|
-
for (const key of Object.keys(recurseValue)) {
|
|
88
|
-
const propertyClone = recurse(recurseValue[key], pathPrefix + key, recursedDeeper);
|
|
89
|
-
if (!hasClone) {
|
|
90
|
-
clone[key] = propertyClone;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
return clone;
|
|
98
|
-
}
|
|
99
|
-
return {
|
|
100
|
-
clone: recurse(value, path, new Set()),
|
|
101
|
-
files,
|
|
102
|
-
};
|
|
13
|
+
function collectLtEditedFields(root) {
|
|
14
|
+
const edited = /* @__PURE__ */ new Map();
|
|
15
|
+
for (const node of Array.from(root.querySelectorAll("input, textarea"))) {
|
|
16
|
+
const field = node;
|
|
17
|
+
if (field.value !== field.defaultValue) edited.set(field, field.value);
|
|
18
|
+
}
|
|
19
|
+
return edited;
|
|
103
20
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
const links = [];
|
|
110
|
-
const http = httpLink.create({
|
|
111
|
-
uri: baseModuleConfig.apiUrl,
|
|
112
|
-
extractFiles,
|
|
113
|
-
});
|
|
114
|
-
const authMiddleware = new ApolloLink((operation, forward) => {
|
|
115
|
-
const headers = {};
|
|
116
|
-
const operationName = operation.query.definitions[0]?.selectionSet?.selections[0]?.name?.value;
|
|
117
|
-
if (localStorage) {
|
|
118
|
-
let token;
|
|
119
|
-
if (operationName === 'refreshToken') {
|
|
120
|
-
token = authService.refreshToken || null;
|
|
121
|
-
}
|
|
122
|
-
else {
|
|
123
|
-
token = authService.token || null;
|
|
124
|
-
}
|
|
125
|
-
if (token) {
|
|
126
|
-
headers.Authorization = 'Bearer ' + token;
|
|
127
|
-
}
|
|
128
|
-
operation.setContext(() => ({ headers }));
|
|
129
|
-
}
|
|
130
|
-
return forward(operation);
|
|
131
|
-
});
|
|
132
|
-
const errorLink = onError(({ graphQLErrors, networkError, operation, forward }) => {
|
|
133
|
-
if (graphQLErrors) {
|
|
134
|
-
for (const err of graphQLErrors) {
|
|
135
|
-
switch (err.extensions.code) {
|
|
136
|
-
case 'UNAUTHENTICATED': {
|
|
137
|
-
if (err.message !== 'Expired refresh token' &&
|
|
138
|
-
err.message !== 'Expired token' &&
|
|
139
|
-
err.message !== 'Invalid token') {
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
if (err.message === 'Expired refresh token' || err.message === 'Invalid token') {
|
|
143
|
-
authService.clearSession();
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
return fromPromise(firstValueFrom(authService.requestNewToken()))
|
|
147
|
-
.filter((value) => Boolean(value))
|
|
148
|
-
.flatMap((response) => {
|
|
149
|
-
const oldHeaders = operation.getContext().headers;
|
|
150
|
-
// modify the operation context with a new token
|
|
151
|
-
operation.setContext({
|
|
152
|
-
headers: {
|
|
153
|
-
...oldHeaders,
|
|
154
|
-
Authorization: `Bearer ${response.token}`,
|
|
155
|
-
},
|
|
156
|
-
});
|
|
157
|
-
// retry the request, returning the new observable
|
|
158
|
-
return forward(operation);
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
if (baseModuleConfig.logging) {
|
|
166
|
-
console.log(baseModuleConfig);
|
|
167
|
-
}
|
|
168
|
-
if (baseModuleConfig.wsUrl) {
|
|
169
|
-
const wsLink = new GraphQLWsLink(createRestartableClient({
|
|
170
|
-
url: baseModuleConfig.wsUrl,
|
|
171
|
-
connectionParams: () => {
|
|
172
|
-
return {
|
|
173
|
-
Authorization: authService.token ? 'Bearer ' + authService.token : undefined,
|
|
174
|
-
};
|
|
175
|
-
},
|
|
176
|
-
}));
|
|
177
|
-
// Set client for reconnection on logout/login
|
|
178
|
-
wsService.client = wsLink.client;
|
|
179
|
-
// using the ability to split links, you can send data to each link
|
|
180
|
-
// depending on what kind of operation is being sent
|
|
181
|
-
links.push(split(
|
|
182
|
-
// split based on operation type
|
|
183
|
-
({ query }) => {
|
|
184
|
-
// @ts-ignore
|
|
185
|
-
const { kind, operation } = getMainDefinition(query);
|
|
186
|
-
return kind === 'OperationDefinition' && operation === 'subscription';
|
|
187
|
-
}, wsLink, concat(concat(authMiddleware, errorLink), http)));
|
|
188
|
-
}
|
|
189
|
-
else {
|
|
190
|
-
links.push(authMiddleware);
|
|
191
|
-
links.push(errorLink);
|
|
192
|
-
links.push(http);
|
|
193
|
-
}
|
|
194
|
-
return {
|
|
195
|
-
link: ApolloLink.from(links),
|
|
196
|
-
cache: new InMemoryCache(),
|
|
197
|
-
defaultOptions: {
|
|
198
|
-
query: {
|
|
199
|
-
fetchPolicy: 'network-only',
|
|
200
|
-
},
|
|
201
|
-
},
|
|
202
|
-
};
|
|
21
|
+
function restoreLtField(field, value) {
|
|
22
|
+
if (!field.isConnected || field.value === value) return false;
|
|
23
|
+
field.value = value;
|
|
24
|
+
field.dispatchEvent(new Event("input", { bubbles: true }));
|
|
25
|
+
return true;
|
|
203
26
|
}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
console.log('Config:', config);
|
|
228
|
-
}
|
|
229
|
-
// Prepare providers
|
|
230
|
-
const providers = [
|
|
231
|
-
{
|
|
232
|
-
provide: BASE_MODULE_CONFIG,
|
|
233
|
-
useValue: config,
|
|
234
|
-
},
|
|
235
|
-
];
|
|
236
|
-
// Add apollo features if API URL is set
|
|
237
|
-
if (baseModuleConfig.apiUrl) {
|
|
238
|
-
providers.push({
|
|
239
|
-
provide: APOLLO_OPTIONS,
|
|
240
|
-
useFactory: apolloOptionsFactory,
|
|
241
|
-
deps: [BASE_MODULE_CONFIG, HttpLink, AppAuthService ? AppAuthService : AuthService, WsService],
|
|
242
|
-
});
|
|
243
|
-
}
|
|
244
|
-
else if (config.logging) {
|
|
245
|
-
console.log('apiUrl is missing, ApolloLink is not initialized');
|
|
246
|
-
}
|
|
247
|
-
// Return root module
|
|
248
|
-
return {
|
|
249
|
-
ngModule: BaseModule,
|
|
250
|
-
providers,
|
|
251
|
-
};
|
|
252
|
-
}
|
|
253
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: BaseModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
254
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.2", ngImport: i0, type: BaseModule, imports: [ApolloModule], exports: [ApolloModule] });
|
|
255
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: BaseModule, providers: [provideHttpClient(withInterceptorsFromDi())], imports: [ApolloModule, ApolloModule] });
|
|
27
|
+
function provideLtPreHydrationInput(options = {}) {
|
|
28
|
+
return provideAppInitializer(() => {
|
|
29
|
+
if (options.enabled === false || !isPlatformBrowser(inject(PLATFORM_ID)) || typeof document === "undefined") return;
|
|
30
|
+
const edited = collectLtEditedFields(document);
|
|
31
|
+
if (edited.size === 0) return;
|
|
32
|
+
const configured = options.maxRestoreMs ?? 1500;
|
|
33
|
+
const maxRestoreMs = Number.isFinite(configured) && configured > 0 ? Math.min(configured, 3e4) : 0;
|
|
34
|
+
const sweep = () => {
|
|
35
|
+
for (const [field, value] of edited) if (restoreLtField(field, value) || !field.isConnected) edited.delete(field);
|
|
36
|
+
};
|
|
37
|
+
inject(ApplicationRef).whenStable().then(() => {
|
|
38
|
+
sweep();
|
|
39
|
+
if (maxRestoreMs <= 0 || edited.size === 0) {
|
|
40
|
+
edited.clear();
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const interval = setInterval(sweep, 250);
|
|
44
|
+
setTimeout(() => {
|
|
45
|
+
clearInterval(interval);
|
|
46
|
+
edited.clear();
|
|
47
|
+
}, maxRestoreMs);
|
|
48
|
+
});
|
|
49
|
+
});
|
|
256
50
|
}
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
51
|
+
const LT_PRE_HYDRATION_SUBMIT_GUARD_SCRIPT = "document.addEventListener('submit',function(e){var f=e.target;if(f instanceof HTMLFormElement&&!f.hasAttribute('action')){e.preventDefault();}},true);";
|
|
52
|
+
const LT_RUNTIME_CONFIG_DEFAULTS = {
|
|
53
|
+
apiProxy: null,
|
|
54
|
+
apiUrl: "",
|
|
55
|
+
cookiePrefix: "",
|
|
56
|
+
lt: {},
|
|
57
|
+
siteUrl: "",
|
|
58
|
+
storagePrefix: ""
|
|
59
|
+
};
|
|
60
|
+
const LT_RUNTIME_CONFIG = new InjectionToken("LT_RUNTIME_CONFIG");
|
|
61
|
+
const LT_SERVER_RUNTIME_CONFIG = new InjectionToken("LT_SERVER_RUNTIME_CONFIG", { factory: () => {
|
|
62
|
+
const context = inject(REQUEST_CONTEXT, { optional: true });
|
|
63
|
+
if (!context || typeof context !== "object" || !context.runtimeConfig) return null;
|
|
64
|
+
return {
|
|
65
|
+
public: context.runtimeConfig,
|
|
66
|
+
serverApiUrl: context.serverApiUrl ?? ""
|
|
67
|
+
};
|
|
68
|
+
} });
|
|
69
|
+
const LT_RUNTIME_CONFIG_SCRIPT_ID = "ng-runtime-config";
|
|
70
|
+
function readLtRuntimeConfigFromDocument(doc) {
|
|
71
|
+
const text = doc?.getElementById?.(LT_RUNTIME_CONFIG_SCRIPT_ID)?.textContent;
|
|
72
|
+
if (!text) return null;
|
|
73
|
+
try {
|
|
74
|
+
const parsed = JSON.parse(text);
|
|
75
|
+
return parsed && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : null;
|
|
76
|
+
} catch {
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
283
79
|
}
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
* Directive for lazy loading images
|
|
287
|
-
*/
|
|
288
|
-
class LazyLoadDirective {
|
|
289
|
-
el;
|
|
290
|
-
srcAttr = null;
|
|
291
|
-
src;
|
|
292
|
-
constructor(el) {
|
|
293
|
-
this.el = el;
|
|
294
|
-
}
|
|
295
|
-
ngAfterViewInit() {
|
|
296
|
-
this.canLazyLoad() ? this.lazyLoadImage() : this.loadImage();
|
|
297
|
-
}
|
|
298
|
-
canLazyLoad() {
|
|
299
|
-
return window && 'IntersectionObserver' in window;
|
|
300
|
-
}
|
|
301
|
-
lazyLoadImage() {
|
|
302
|
-
const obs = new IntersectionObserver((entries) => {
|
|
303
|
-
entries.forEach(({ isIntersecting }) => {
|
|
304
|
-
if (isIntersecting) {
|
|
305
|
-
this.loadImage();
|
|
306
|
-
obs.unobserve(this.el.nativeElement);
|
|
307
|
-
}
|
|
308
|
-
});
|
|
309
|
-
});
|
|
310
|
-
obs.observe(this.el.nativeElement);
|
|
311
|
-
}
|
|
312
|
-
loadImage() {
|
|
313
|
-
this.srcAttr = this.src;
|
|
314
|
-
}
|
|
315
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: LazyLoadDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
316
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.2", type: LazyLoadDirective, isStandalone: true, selector: "img[ltLazyLoad]", inputs: { src: "src" }, host: { properties: { "attr.src": "this.srcAttr" } }, ngImport: i0 });
|
|
80
|
+
function serializeLtRuntimeConfig(config) {
|
|
81
|
+
return JSON.stringify(config).replace(/</g, "\\u003c").replace(/>/g, "\\u003e").replace(/&/g, "\\u0026").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
317
82
|
}
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { srcAttr: [{
|
|
325
|
-
type: HostBinding,
|
|
326
|
-
args: ['attr.src']
|
|
327
|
-
}], src: [{
|
|
328
|
-
type: Input
|
|
329
|
-
}] } });
|
|
330
|
-
|
|
331
|
-
/**
|
|
332
|
-
* Set same height (maximum) to different elements
|
|
333
|
-
*/
|
|
334
|
-
class MatchHeightDirective {
|
|
335
|
-
el;
|
|
336
|
-
imageService;
|
|
337
|
-
// class name to match height
|
|
338
|
-
ltMatchHeight;
|
|
339
|
-
// Replace lazy loading images with immediate loading images
|
|
340
|
-
loadImages = true;
|
|
341
|
-
// Wether current platform is a browser
|
|
342
|
-
isBrowser;
|
|
343
|
-
observer;
|
|
344
|
-
constructor(el, imageService, platformId) {
|
|
345
|
-
this.el = el;
|
|
346
|
-
this.imageService = imageService;
|
|
347
|
-
this.isBrowser = isPlatformBrowser(platformId);
|
|
348
|
-
}
|
|
349
|
-
onResize() {
|
|
350
|
-
this.matchHeight(this.el.nativeElement, this.ltMatchHeight);
|
|
351
|
-
}
|
|
352
|
-
ngAfterViewInit() {
|
|
353
|
-
this.matchHeight(this.el.nativeElement, this.ltMatchHeight);
|
|
354
|
-
this.observer = new MutationObserver(() => {
|
|
355
|
-
this.matchHeight(this.el.nativeElement, this.ltMatchHeight);
|
|
356
|
-
});
|
|
357
|
-
//Observes if one or more elements get added to or removed from the childlist and applies matching heights
|
|
358
|
-
this.observer.observe(this.el.nativeElement, { childList: true });
|
|
359
|
-
}
|
|
360
|
-
async matchHeight(parent, target) {
|
|
361
|
-
if (!parent) {
|
|
362
|
-
return;
|
|
363
|
-
}
|
|
364
|
-
let classNames;
|
|
365
|
-
if (!Array.isArray(target)) {
|
|
366
|
-
classNames = [target];
|
|
367
|
-
}
|
|
368
|
-
else {
|
|
369
|
-
classNames = target;
|
|
370
|
-
}
|
|
371
|
-
for (const className of classNames) {
|
|
372
|
-
// find all child structureElements with the selected class name
|
|
373
|
-
const children = parent.getElementsByClassName(className);
|
|
374
|
-
if (!children || children.length < 2) {
|
|
375
|
-
continue;
|
|
376
|
-
}
|
|
377
|
-
// Load images of children
|
|
378
|
-
if (this.loadImages) {
|
|
379
|
-
await this.imageService.preLoadImages({ elements: children });
|
|
380
|
-
}
|
|
381
|
-
// reset all children height
|
|
382
|
-
Array.from(children).forEach((element) => {
|
|
383
|
-
element.style.height = 'initial';
|
|
384
|
-
});
|
|
385
|
-
// get all the child structureElements heights
|
|
386
|
-
const itemHeights = Array.from(children).map((element) => {
|
|
387
|
-
if (element.getBoundingClientRect) {
|
|
388
|
-
return element.getBoundingClientRect().height;
|
|
389
|
-
}
|
|
390
|
-
return 0;
|
|
391
|
-
});
|
|
392
|
-
// find out the tallest one
|
|
393
|
-
const maxHeight = itemHeights.reduce((prev, curr) => (curr > prev ? curr : prev), 0);
|
|
394
|
-
// update the child structureElements height to the tallest one
|
|
395
|
-
Array.from(children).forEach((element) => (element.style.height = `${maxHeight}px`));
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: MatchHeightDirective, deps: [{ token: i0.ElementRef }, { token: i2.ImageService }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Directive });
|
|
399
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.2", type: MatchHeightDirective, isStandalone: true, selector: "[ltMatchHeight]", inputs: { ltMatchHeight: "ltMatchHeight", loadImages: "loadImages" }, host: { listeners: { "window:resize": "onResize()" } }, ngImport: i0 });
|
|
83
|
+
function injectLtRuntimeConfigScript(html, config, options = {}) {
|
|
84
|
+
const head = /<head(\s[^>]*)?>/i.exec(html);
|
|
85
|
+
if (!head) return html;
|
|
86
|
+
const at = head.index + head[0].length;
|
|
87
|
+
const guard = options.submitGuard === false ? "" : `<script>${LT_PRE_HYDRATION_SUBMIT_GUARD_SCRIPT}<\/script>`;
|
|
88
|
+
return `${html.slice(0, at)}${guard}<script id="${LT_RUNTIME_CONFIG_SCRIPT_ID}" type="application/json">${serializeLtRuntimeConfig(config)}<\/script>${html.slice(at)}`;
|
|
400
89
|
}
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
* (inpsired by: https://stackblitz.com/edit/angular-resizable)
|
|
422
|
-
*/
|
|
423
|
-
class ResizableDirective {
|
|
424
|
-
el;
|
|
425
|
-
resizableGrabWidth = 8;
|
|
426
|
-
resizableMinWidth = 10;
|
|
427
|
-
dragging = false;
|
|
428
|
-
constructor(el) {
|
|
429
|
-
this.el = el;
|
|
430
|
-
}
|
|
431
|
-
ngOnInit() {
|
|
432
|
-
this.addListenerToDocument();
|
|
433
|
-
this.addListenerToElement();
|
|
434
|
-
}
|
|
435
|
-
mouseMoveG(evt) {
|
|
436
|
-
if (!this.dragging) {
|
|
437
|
-
return;
|
|
438
|
-
}
|
|
439
|
-
this.newWidth(evt.clientX - this.el.nativeElement.offsetLeft);
|
|
440
|
-
evt.stopPropagation();
|
|
441
|
-
}
|
|
442
|
-
newWidth(wid) {
|
|
443
|
-
const result = Math.max(this.resizableMinWidth, wid);
|
|
444
|
-
this.el.nativeElement.style.width = result + 'px';
|
|
445
|
-
}
|
|
446
|
-
mouseDown(evt) {
|
|
447
|
-
if (this.inDragRegion(evt)) {
|
|
448
|
-
this.dragging = true;
|
|
449
|
-
this.preventGlobalMouseEvents();
|
|
450
|
-
evt.stopPropagation();
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
restoreGlobalMouseEvents() {
|
|
454
|
-
document.body.style['pointer-events'] = 'auto';
|
|
455
|
-
}
|
|
456
|
-
mouseUpG(evt) {
|
|
457
|
-
if (!this.dragging) {
|
|
458
|
-
return;
|
|
459
|
-
}
|
|
460
|
-
this.restoreGlobalMouseEvents();
|
|
461
|
-
this.dragging = false;
|
|
462
|
-
evt.stopPropagation();
|
|
463
|
-
}
|
|
464
|
-
mouseMove(evt) {
|
|
465
|
-
if (this.inDragRegion(evt) || this.dragging) {
|
|
466
|
-
this.el.nativeElement.style.cursor = 'col-resize';
|
|
467
|
-
}
|
|
468
|
-
else {
|
|
469
|
-
this.el.nativeElement.style.cursor = 'default';
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
preventGlobalMouseEvents() {
|
|
473
|
-
document.body.style['pointer-events'] = 'none';
|
|
474
|
-
}
|
|
475
|
-
inDragRegion(evt) {
|
|
476
|
-
return this.el.nativeElement.clientWidth - evt.clientX + this.el.nativeElement.offsetLeft < this.resizableGrabWidth;
|
|
477
|
-
}
|
|
478
|
-
addListenerToDocument() {
|
|
479
|
-
document.addEventListener('mousemove', (e) => {
|
|
480
|
-
this.mouseMoveG(e);
|
|
481
|
-
}, true);
|
|
482
|
-
document.addEventListener('mouseup', (e) => {
|
|
483
|
-
this.mouseUpG(e);
|
|
484
|
-
}, true);
|
|
485
|
-
}
|
|
486
|
-
addListenerToElement() {
|
|
487
|
-
this.el.nativeElement.addEventListener('mousedown', (e) => {
|
|
488
|
-
this.mouseDown(e);
|
|
489
|
-
}, true);
|
|
490
|
-
this.el.nativeElement.addEventListener('mousemove', (e) => {
|
|
491
|
-
this.mouseMove(e);
|
|
492
|
-
}, true);
|
|
493
|
-
}
|
|
494
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: ResizableDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
495
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.2", type: ResizableDirective, isStandalone: true, selector: "[ltResizable]", inputs: { resizableGrabWidth: "resizableGrabWidth", resizableMinWidth: "resizableMinWidth" }, ngImport: i0 });
|
|
90
|
+
function mergeLtRuntimeConfig(base, ...overrides) {
|
|
91
|
+
const result = {
|
|
92
|
+
...base,
|
|
93
|
+
lt: { ...base.lt }
|
|
94
|
+
};
|
|
95
|
+
for (const override of overrides) {
|
|
96
|
+
if (!override) continue;
|
|
97
|
+
for (const [key, value] of Object.entries(override)) {
|
|
98
|
+
if (value === void 0) continue;
|
|
99
|
+
if (key === "lt") {
|
|
100
|
+
for (const [feature, options] of Object.entries(value ?? {})) result.lt[feature] = {
|
|
101
|
+
...result.lt[feature],
|
|
102
|
+
...definedEntries(options ?? {})
|
|
103
|
+
};
|
|
104
|
+
continue;
|
|
105
|
+
}
|
|
106
|
+
result[key] = value;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return result;
|
|
496
110
|
}
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
*/
|
|
512
|
-
class AuthGuard {
|
|
513
|
-
router;
|
|
514
|
-
authService;
|
|
515
|
-
moduleConfig;
|
|
516
|
-
platformId;
|
|
517
|
-
/**
|
|
518
|
-
* Imports
|
|
519
|
-
*/
|
|
520
|
-
constructor(router, authService, moduleConfig, platformId) {
|
|
521
|
-
this.router = router;
|
|
522
|
-
this.authService = authService;
|
|
523
|
-
this.moduleConfig = moduleConfig;
|
|
524
|
-
this.platformId = platformId;
|
|
525
|
-
}
|
|
526
|
-
/**
|
|
527
|
-
* Can activate main route
|
|
528
|
-
*/
|
|
529
|
-
canActivate(route, state) {
|
|
530
|
-
if (isPlatformBrowser(this.platformId)) {
|
|
531
|
-
return new Observable((subscriber) => {
|
|
532
|
-
let allowed = false;
|
|
533
|
-
let redirected = false;
|
|
534
|
-
/* If the user is logged in and the route is not marked as opposite, then the user is allowed to access the route. */
|
|
535
|
-
const opposite = route?.data?.opposite ? route?.data?.opposite : false;
|
|
536
|
-
const redirectAuthUrl = route?.data?.redirectAuthUrl
|
|
537
|
-
? route.data.redirectAuthUrl
|
|
538
|
-
: this.moduleConfig.authGuardRedirectUrl;
|
|
539
|
-
const redirectRoleUrl = route?.data?.redirectRoleUrl
|
|
540
|
-
? route.data.redirectRoleUrl
|
|
541
|
-
: this.moduleConfig.authGuardRedirectUrl;
|
|
542
|
-
const disableQueryParams = route?.data?.disableQueryParams ?? false;
|
|
543
|
-
const queryParams = disableQueryParams
|
|
544
|
-
? {}
|
|
545
|
-
: {
|
|
546
|
-
queryParams: {
|
|
547
|
-
redirectUrl: route['_routerState'].url,
|
|
548
|
-
},
|
|
549
|
-
};
|
|
550
|
-
if (this.authService.token && !opposite) {
|
|
551
|
-
if (route.data?.roles) {
|
|
552
|
-
const user = this.authService.currentUser;
|
|
553
|
-
allowed = !!route.data.roles.find((role) => user.roles?.includes(role));
|
|
554
|
-
if (!allowed && redirectRoleUrl) {
|
|
555
|
-
this.router.navigate([redirectRoleUrl], queryParams);
|
|
556
|
-
redirected = true;
|
|
557
|
-
}
|
|
558
|
-
}
|
|
559
|
-
else {
|
|
560
|
-
allowed = true;
|
|
561
|
-
}
|
|
562
|
-
}
|
|
563
|
-
else if (!this.authService.token && opposite) {
|
|
564
|
-
allowed = true;
|
|
565
|
-
}
|
|
566
|
-
if (!allowed && redirectAuthUrl && !redirected) {
|
|
567
|
-
this.router.navigate([redirectAuthUrl], queryParams);
|
|
568
|
-
}
|
|
569
|
-
subscriber.next(allowed);
|
|
570
|
-
subscriber.complete();
|
|
571
|
-
});
|
|
572
|
-
}
|
|
573
|
-
}
|
|
574
|
-
/**
|
|
575
|
-
* Can activate child route
|
|
576
|
-
*/
|
|
577
|
-
canActivateChild(route, state) {
|
|
578
|
-
return this.canActivate(route, state);
|
|
579
|
-
}
|
|
580
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: AuthGuard, deps: [{ token: i1.Router }, { token: i2.AuthService }, { token: BASE_MODULE_CONFIG }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
581
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: AuthGuard });
|
|
111
|
+
function mergeLtFeatureOptions(defaults, ...overrides) {
|
|
112
|
+
const result = { ...defaults };
|
|
113
|
+
for (const override of overrides) {
|
|
114
|
+
if (!override) continue;
|
|
115
|
+
for (const [key, value] of Object.entries(override)) {
|
|
116
|
+
if (value === void 0) continue;
|
|
117
|
+
const current = result[key];
|
|
118
|
+
result[key] = isPlainObject(current) && isPlainObject(value) ? {
|
|
119
|
+
...current,
|
|
120
|
+
...definedEntries(value)
|
|
121
|
+
} : value;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return result;
|
|
582
125
|
}
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
}], ctorParameters: () => [{ type: i1.Router }, { type: i2.AuthService }, { type: undefined, decorators: [{
|
|
586
|
-
type: Inject,
|
|
587
|
-
args: [BASE_MODULE_CONFIG]
|
|
588
|
-
}] }, { type: undefined, decorators: [{
|
|
589
|
-
type: Inject,
|
|
590
|
-
args: [PLATFORM_ID]
|
|
591
|
-
}] }] });
|
|
592
|
-
|
|
593
|
-
/**
|
|
594
|
-
* Guard to check if a component can be deactivated
|
|
595
|
-
*/
|
|
596
|
-
class CanDeactivateGuard {
|
|
597
|
-
canDeactivate(component) {
|
|
598
|
-
return component.canDeactivate ? component.canDeactivate() : true;
|
|
599
|
-
}
|
|
600
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: CanDeactivateGuard, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
601
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: CanDeactivateGuard });
|
|
126
|
+
function definedEntries(source) {
|
|
127
|
+
return Object.fromEntries(Object.entries(source).filter(([, value]) => value !== void 0));
|
|
602
128
|
}
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
}] });
|
|
606
|
-
|
|
607
|
-
/**
|
|
608
|
-
* Logout guard
|
|
609
|
-
*/
|
|
610
|
-
class LogoutGuard {
|
|
611
|
-
router;
|
|
612
|
-
authService;
|
|
613
|
-
constructor(router, authService) {
|
|
614
|
-
this.router = router;
|
|
615
|
-
this.authService = authService;
|
|
616
|
-
}
|
|
617
|
-
canActivate(route, state) {
|
|
618
|
-
return new Observable((subscriber) => {
|
|
619
|
-
if (this.authService.token) {
|
|
620
|
-
this.authService.logout();
|
|
621
|
-
}
|
|
622
|
-
subscriber.next(true);
|
|
623
|
-
subscriber.complete();
|
|
624
|
-
});
|
|
625
|
-
}
|
|
626
|
-
canActivateChild(route, state) {
|
|
627
|
-
return this.canActivate(route, state);
|
|
628
|
-
}
|
|
629
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: LogoutGuard, deps: [{ token: i1.Router }, { token: i2.AuthService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
630
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: LogoutGuard });
|
|
129
|
+
function isPlainObject(value) {
|
|
130
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
631
131
|
}
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
132
|
+
const MISSING_API_URL_WARNING = {
|
|
133
|
+
browser: "[@lenne.tech/ng-base] No API URL configured. Set NG_PUBLIC_API_URL. API paths stay relative and resolve against the app origin, so auth and setup calls 404 unless the app is served behind a same-origin reverse proxy.",
|
|
134
|
+
server: "[@lenne.tech/ng-base] No API URL configured for SSR. Set NG_API_URL or NG_PUBLIC_API_URL. API paths stay relative, so server-side requests never reach the backend."
|
|
135
|
+
};
|
|
136
|
+
function resolveLtApiBaseUrl(inputs) {
|
|
137
|
+
if (inputs.scope === "server") {
|
|
138
|
+
const apiUrl = inputs.serverApiUrl || inputs.apiUrl || "";
|
|
139
|
+
return {
|
|
140
|
+
baseUrl: stripTrailingSlashes(apiUrl),
|
|
141
|
+
missing: !apiUrl,
|
|
142
|
+
proxy: false,
|
|
143
|
+
scope: "server"
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
if (inputs.apiProxy === true || inputs.apiProxy === null && inputs.devMode) return {
|
|
147
|
+
baseUrl: "/api",
|
|
148
|
+
missing: false,
|
|
149
|
+
proxy: true,
|
|
150
|
+
scope: "browser"
|
|
151
|
+
};
|
|
152
|
+
const apiUrl = inputs.apiUrl || "";
|
|
153
|
+
return {
|
|
154
|
+
baseUrl: stripTrailingSlashes(apiUrl),
|
|
155
|
+
missing: !apiUrl,
|
|
156
|
+
proxy: false,
|
|
157
|
+
scope: "browser"
|
|
158
|
+
};
|
|
649
159
|
}
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
args: [{ name: 'ltSafeHtml', standalone: true }]
|
|
653
|
-
}], ctorParameters: () => [{ type: i1$1.DomSanitizer }] });
|
|
654
|
-
|
|
655
|
-
class DateAgoPipe {
|
|
656
|
-
intervals = {
|
|
657
|
-
year: 31536000,
|
|
658
|
-
month: 2592000,
|
|
659
|
-
week: 604800,
|
|
660
|
-
day: 86400,
|
|
661
|
-
hour: 3600,
|
|
662
|
-
minute: 60,
|
|
663
|
-
second: 1,
|
|
664
|
-
};
|
|
665
|
-
singular = {
|
|
666
|
-
year: 'Jahr',
|
|
667
|
-
month: 'Monat',
|
|
668
|
-
week: 'Woche',
|
|
669
|
-
day: 'Tag',
|
|
670
|
-
hour: 'Stunde',
|
|
671
|
-
minute: 'Minute',
|
|
672
|
-
second: 'Sekunde',
|
|
673
|
-
};
|
|
674
|
-
plural = {
|
|
675
|
-
year: 'Jahren',
|
|
676
|
-
month: 'Monaten',
|
|
677
|
-
week: 'Wochen',
|
|
678
|
-
day: 'Tagen',
|
|
679
|
-
hour: 'Stunden',
|
|
680
|
-
minute: 'Minuten',
|
|
681
|
-
second: 'Sekunden',
|
|
682
|
-
};
|
|
683
|
-
transform(value, currentDate) {
|
|
684
|
-
const now = currentDate ?? new Date();
|
|
685
|
-
if (value) {
|
|
686
|
-
const seconds = Math.floor((+now - +new Date(value)) / 1000);
|
|
687
|
-
if (seconds < 29) {
|
|
688
|
-
return 'gerade eben'; // less than 30 seconds ago will show as 'Just now'
|
|
689
|
-
}
|
|
690
|
-
let counter;
|
|
691
|
-
for (const i of Object.keys(this.intervals)) {
|
|
692
|
-
counter = Math.floor(seconds / this.intervals[i]);
|
|
693
|
-
if (counter > 0) {
|
|
694
|
-
if (counter === 1) {
|
|
695
|
-
return 'vor ' + counter + ' ' + this.singular[i]; // singular (1 day ago)
|
|
696
|
-
}
|
|
697
|
-
else {
|
|
698
|
-
return 'vor ' + counter + ' ' + this.plural[i]; // plural (2 days ago)
|
|
699
|
-
}
|
|
700
|
-
}
|
|
701
|
-
}
|
|
702
|
-
}
|
|
703
|
-
return value;
|
|
704
|
-
}
|
|
705
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: DateAgoPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
706
|
-
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.0.2", ngImport: i0, type: DateAgoPipe, isStandalone: true, name: "dateAgo" });
|
|
160
|
+
function isLtAbsoluteUrl(url) {
|
|
161
|
+
return /^[a-z][a-z\d+\-.]*:/i.test(url) || url.startsWith("//");
|
|
707
162
|
}
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
163
|
+
var LtApiUrlService = class LtApiUrlService {
|
|
164
|
+
runtimeConfig = inject(LT_RUNTIME_CONFIG, { optional: true });
|
|
165
|
+
serverConfig = inject(LT_SERVER_RUNTIME_CONFIG, { optional: true });
|
|
166
|
+
isServer = isPlatformServer(inject(PLATFORM_ID));
|
|
167
|
+
resolve() {
|
|
168
|
+
return resolveLtApiBaseUrl({
|
|
169
|
+
apiProxy: this.runtimeConfig?.apiProxy ?? null,
|
|
170
|
+
apiUrl: this.runtimeConfig?.apiUrl ?? "",
|
|
171
|
+
devMode: isDevMode(),
|
|
172
|
+
scope: this.isServer ? "server" : "browser",
|
|
173
|
+
serverApiUrl: this.serverConfig?.serverApiUrl
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
baseUrl() {
|
|
177
|
+
return this.resolveAndWarn().baseUrl;
|
|
178
|
+
}
|
|
179
|
+
buildUrl(path) {
|
|
180
|
+
if (isLtAbsoluteUrl(path)) return path;
|
|
181
|
+
const normalized = path.startsWith("/") ? path : `/${path}`;
|
|
182
|
+
return `${this.resolveAndWarn().baseUrl}${normalized}`;
|
|
183
|
+
}
|
|
184
|
+
isProxy() {
|
|
185
|
+
return this.resolve().proxy;
|
|
186
|
+
}
|
|
187
|
+
reportMissing() {
|
|
188
|
+
const resolution = this.resolve();
|
|
189
|
+
if (resolution.missing) warnLtOnce(`missing-api-url:${resolution.scope}`, MISSING_API_URL_WARNING[resolution.scope], isDevMode() ? "warn" : "error");
|
|
190
|
+
return resolution.missing;
|
|
191
|
+
}
|
|
192
|
+
resolveAndWarn() {
|
|
193
|
+
const resolution = this.resolve();
|
|
194
|
+
if (resolution.missing) warnLtOnce(`missing-api-url:${resolution.scope}`, MISSING_API_URL_WARNING[resolution.scope]);
|
|
195
|
+
if (resolution.proxy && this.runtimeConfig?.apiProxy === null) warnLtOnce("api-proxy-implicit", "[@lenne.tech/ng-base] API proxy (/api) activated implicitly because the app runs in dev mode. Set NG_PUBLIC_API_PROXY=true to make it explicit, or NG_PUBLIC_API_PROXY=false to call the API directly.");
|
|
196
|
+
return resolution;
|
|
197
|
+
}
|
|
198
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
199
|
+
minVersion: "12.0.0",
|
|
200
|
+
version: "22.2.4",
|
|
201
|
+
ngImport: i0,
|
|
202
|
+
type: LtApiUrlService,
|
|
203
|
+
deps: [],
|
|
204
|
+
target: i0.ɵɵFactoryTarget.Service
|
|
205
|
+
});
|
|
206
|
+
static ɵprov = i0.ɵɵngDeclareService({
|
|
207
|
+
minVersion: "22.0.0",
|
|
208
|
+
version: "22.2.4",
|
|
209
|
+
ngImport: i0,
|
|
210
|
+
type: LtApiUrlService
|
|
211
|
+
});
|
|
212
|
+
};
|
|
213
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
214
|
+
minVersion: "12.0.0",
|
|
215
|
+
version: "22.2.4",
|
|
216
|
+
ngImport: i0,
|
|
217
|
+
type: LtApiUrlService,
|
|
218
|
+
decorators: [{ type: Service }]
|
|
219
|
+
});
|
|
220
|
+
function stripTrailingSlashes(url) {
|
|
221
|
+
return url.replace(/\/+$/, "");
|
|
757
222
|
}
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
});
|
|
836
|
-
const url = this.getUrl(data);
|
|
837
|
-
if (url) {
|
|
838
|
-
this.metaTagService.updateTag({ property: 'og:url', content: url });
|
|
839
|
-
}
|
|
840
|
-
if (data.image) {
|
|
841
|
-
this.metaTagService.updateTag({
|
|
842
|
-
property: 'og:image',
|
|
843
|
-
content: data.image,
|
|
844
|
-
});
|
|
845
|
-
}
|
|
846
|
-
}
|
|
847
|
-
/**
|
|
848
|
-
* URL of the page: the given one, otherwise the one of the document (none if neither exists)
|
|
849
|
-
*
|
|
850
|
-
* @param data
|
|
851
|
-
* @private
|
|
852
|
-
*/
|
|
853
|
-
getUrl(data) {
|
|
854
|
-
return data.url || this.document?.location?.href || undefined;
|
|
855
|
-
}
|
|
856
|
-
/**
|
|
857
|
-
* Set page keywords
|
|
858
|
-
*
|
|
859
|
-
* @param keywords
|
|
860
|
-
* @private
|
|
861
|
-
*/
|
|
862
|
-
setPageKeywords(keywords) {
|
|
863
|
-
this.metaTagService.updateTag({ name: 'keywords', content: keywords });
|
|
864
|
-
}
|
|
865
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: SEOService, deps: [{ token: i1$1.Title }, { token: i1$1.Meta }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
866
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: SEOService, providedIn: 'root' });
|
|
223
|
+
var LtCookieService = class LtCookieService {
|
|
224
|
+
document = inject(DOCUMENT);
|
|
225
|
+
request = inject(REQUEST, { optional: true });
|
|
226
|
+
isServer = isPlatformServer(inject(PLATFORM_ID));
|
|
227
|
+
raw() {
|
|
228
|
+
if (this.isServer) return this.request?.headers.get("cookie") ?? "";
|
|
229
|
+
try {
|
|
230
|
+
return this.document.cookie ?? "";
|
|
231
|
+
} catch {
|
|
232
|
+
return "";
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
get(name) {
|
|
236
|
+
return this.getAll(name)[0] ?? null;
|
|
237
|
+
}
|
|
238
|
+
getAll(name) {
|
|
239
|
+
return parseLtCookies(this.raw(), name);
|
|
240
|
+
}
|
|
241
|
+
set(name, value, options = {}) {
|
|
242
|
+
if (this.isServer) return;
|
|
243
|
+
const secure = options.secure ?? this.document.location?.protocol === "https:";
|
|
244
|
+
const parts = [
|
|
245
|
+
`${name}=${encodeURIComponent(value)}`,
|
|
246
|
+
`path=${options.path ?? "/"}`,
|
|
247
|
+
`samesite=${options.sameSite ?? "lax"}`
|
|
248
|
+
];
|
|
249
|
+
if (options.maxAge !== void 0) parts.push(`max-age=${Math.max(0, Math.floor(options.maxAge))}`);
|
|
250
|
+
if (options.domain) parts.push(`domain=${options.domain}`);
|
|
251
|
+
if (secure) parts.push("secure");
|
|
252
|
+
this.document.cookie = parts.join("; ");
|
|
253
|
+
}
|
|
254
|
+
delete(name, options = {}) {
|
|
255
|
+
if (this.isServer) return;
|
|
256
|
+
const parts = [
|
|
257
|
+
`${name}=`,
|
|
258
|
+
`path=${options.path ?? "/"}`,
|
|
259
|
+
"expires=Thu, 01 Jan 1970 00:00:00 GMT",
|
|
260
|
+
"max-age=0"
|
|
261
|
+
];
|
|
262
|
+
if (options.domain) parts.push(`domain=${options.domain}`);
|
|
263
|
+
this.document.cookie = parts.join("; ");
|
|
264
|
+
}
|
|
265
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
266
|
+
minVersion: "12.0.0",
|
|
267
|
+
version: "22.2.4",
|
|
268
|
+
ngImport: i0,
|
|
269
|
+
type: LtCookieService,
|
|
270
|
+
deps: [],
|
|
271
|
+
target: i0.ɵɵFactoryTarget.Service
|
|
272
|
+
});
|
|
273
|
+
static ɵprov = i0.ɵɵngDeclareService({
|
|
274
|
+
minVersion: "22.0.0",
|
|
275
|
+
version: "22.2.4",
|
|
276
|
+
ngImport: i0,
|
|
277
|
+
type: LtCookieService
|
|
278
|
+
});
|
|
279
|
+
};
|
|
280
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
281
|
+
minVersion: "12.0.0",
|
|
282
|
+
version: "22.2.4",
|
|
283
|
+
ngImport: i0,
|
|
284
|
+
type: LtCookieService,
|
|
285
|
+
decorators: [{ type: Service }]
|
|
286
|
+
});
|
|
287
|
+
function parseLtCookies(cookieString, name) {
|
|
288
|
+
const prefix = `${name}=`;
|
|
289
|
+
const values = [];
|
|
290
|
+
for (const entry of (cookieString || "").split(/;\s*/)) {
|
|
291
|
+
if (!entry.startsWith(prefix)) continue;
|
|
292
|
+
const value = entry.slice(prefix.length);
|
|
293
|
+
try {
|
|
294
|
+
values.push(decodeURIComponent(value));
|
|
295
|
+
} catch {
|
|
296
|
+
values.push(value);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
return values;
|
|
867
300
|
}
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
}]
|
|
873
|
-
}], ctorParameters: () => [{ type: i1$1.Title }, { type: i1$1.Meta }, { type: Document, decorators: [{
|
|
874
|
-
type: Inject,
|
|
875
|
-
args: [DOCUMENT]
|
|
876
|
-
}] }] });
|
|
877
|
-
|
|
878
|
-
class ThemeService {
|
|
879
|
-
storageService;
|
|
880
|
-
_theme = new BehaviorSubject('light');
|
|
881
|
-
get theme() {
|
|
882
|
-
return this._theme.value;
|
|
883
|
-
}
|
|
884
|
-
set theme(theme) {
|
|
885
|
-
this._theme.next(theme);
|
|
886
|
-
this.storageService.save('theme', theme);
|
|
887
|
-
}
|
|
888
|
-
get themeObservable() {
|
|
889
|
-
return this._theme.asObservable();
|
|
890
|
-
}
|
|
891
|
-
constructor(storageService) {
|
|
892
|
-
this.storageService = storageService;
|
|
893
|
-
// Load from storage
|
|
894
|
-
this.theme = this.storageService.load('theme');
|
|
895
|
-
// Use system theme if no theme is set
|
|
896
|
-
if (!this.theme) {
|
|
897
|
-
this.checkSystemTheme();
|
|
898
|
-
}
|
|
899
|
-
}
|
|
900
|
-
/**
|
|
901
|
-
* Check theme from system
|
|
902
|
-
*/
|
|
903
|
-
checkSystemTheme() {
|
|
904
|
-
if (window?.matchMedia) {
|
|
905
|
-
this.theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
|
906
|
-
}
|
|
907
|
-
}
|
|
908
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: ThemeService, deps: [{ token: i2.StorageService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
909
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: ThemeService, providedIn: 'root' });
|
|
301
|
+
async function ltSha256(message) {
|
|
302
|
+
const data = new TextEncoder().encode(message);
|
|
303
|
+
const hash = await crypto.subtle.digest("SHA-256", data);
|
|
304
|
+
return Array.from(new Uint8Array(hash), (byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
910
305
|
}
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
306
|
+
function ltArrayBufferToBase64Url(buffer) {
|
|
307
|
+
const bytes = buffer instanceof Uint8Array ? buffer : new Uint8Array(buffer);
|
|
308
|
+
let binary = "";
|
|
309
|
+
for (const byte of bytes) binary += String.fromCharCode(byte);
|
|
310
|
+
return btoa(binary).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
311
|
+
}
|
|
312
|
+
function ltBase64UrlToUint8Array(base64url) {
|
|
313
|
+
const base64 = base64url.replace(/-/g, "+").replace(/_/g, "/");
|
|
314
|
+
const padded = base64 + "=".repeat((4 - base64.length % 4) % 4);
|
|
315
|
+
const binary = atob(padded);
|
|
316
|
+
const bytes = new Uint8Array(new ArrayBuffer(binary.length));
|
|
317
|
+
for (let index = 0; index < binary.length; index++) bytes[index] = binary.charCodeAt(index);
|
|
318
|
+
return bytes;
|
|
319
|
+
}
|
|
320
|
+
const LT_FETCH = new InjectionToken("LT_FETCH", { factory: () => ltCredentialsFetch });
|
|
321
|
+
const ltCredentialsFetch = (input, init) => fetch(input, {
|
|
322
|
+
credentials: "include",
|
|
323
|
+
...init
|
|
324
|
+
});
|
|
325
|
+
var de_default = { lt: { "error": {
|
|
326
|
+
"title": "Fehler",
|
|
327
|
+
"loadFailed": "Fehlerübersetzungen konnten nicht geladen werden"
|
|
328
|
+
} } };
|
|
329
|
+
var en_default = { lt: { "error": {
|
|
330
|
+
"title": "Error",
|
|
331
|
+
"loadFailed": "Failed to load error translations"
|
|
332
|
+
} } };
|
|
333
|
+
const LT_I18N_ADAPTER = new InjectionToken("LT_I18N_ADAPTER");
|
|
334
|
+
const LT_I18N_OPTIONS = new InjectionToken("LT_I18N_OPTIONS", { factory: () => ({}) });
|
|
335
|
+
const LT_I18N_MESSAGES = {
|
|
336
|
+
de: de_default,
|
|
337
|
+
en: en_default
|
|
338
|
+
};
|
|
339
|
+
var LtI18nService = class LtI18nService {
|
|
340
|
+
adapter = inject(LT_I18N_ADAPTER, { optional: true });
|
|
341
|
+
options = inject(LT_I18N_OPTIONS);
|
|
342
|
+
isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
|
|
343
|
+
explicitLocale = signal(null, ...ngDevMode ? [{ debugName: "explicitLocale" }] : /* istanbul ignore next */ []);
|
|
344
|
+
extraMessages = signal(this.options.messages ?? {}, ...ngDevMode ? [{ debugName: "extraMessages" }] : /* istanbul ignore next */ []);
|
|
345
|
+
libraryMessages = {};
|
|
346
|
+
libraryIds = /* @__PURE__ */ new Set();
|
|
347
|
+
locale = computed(() => this.adapter?.locale() || this.explicitLocale() || this.detectBrowserLocale() || this.options.defaultLocale || "de", ...ngDevMode ? [{ debugName: "locale" }] : /* istanbul ignore next */ []);
|
|
348
|
+
setLocale(locale) {
|
|
349
|
+
this.explicitLocale.set(locale);
|
|
350
|
+
}
|
|
351
|
+
registerMessages(locale, messages) {
|
|
352
|
+
this.extraMessages.update((current) => ({
|
|
353
|
+
...current,
|
|
354
|
+
[locale]: deepMerge(current[locale] ?? {}, messages)
|
|
355
|
+
}));
|
|
356
|
+
}
|
|
357
|
+
registerLibraryMessages(id, messages) {
|
|
358
|
+
if (this.libraryIds.has(id)) return;
|
|
359
|
+
this.libraryIds.add(id);
|
|
360
|
+
for (const [locale, tree] of Object.entries(messages)) this.libraryMessages[locale] = deepMerge(this.libraryMessages[locale] ?? {}, tree);
|
|
361
|
+
}
|
|
362
|
+
t(key, params) {
|
|
363
|
+
const fromAdapter = this.adapter?.translate(key, params);
|
|
364
|
+
if (fromAdapter && fromAdapter !== key) return fromAdapter;
|
|
365
|
+
const locale = this.locale();
|
|
366
|
+
return interpolate(lookup(this.extraMessages()[locale], key) ?? lookup(LT_I18N_MESSAGES[locale], key) ?? lookup(this.libraryMessages[locale], key) ?? lookup(this.extraMessages()["de"], key) ?? lookup(LT_I18N_MESSAGES.de, key) ?? lookup(this.libraryMessages["de"], key) ?? key, params);
|
|
367
|
+
}
|
|
368
|
+
detectBrowserLocale() {
|
|
369
|
+
if (!this.isBrowser || typeof navigator === "undefined" || !navigator.language) return null;
|
|
370
|
+
const language = navigator.language.split("-")[0]?.toLowerCase() ?? "";
|
|
371
|
+
return language === "de" || language === "en" ? language : null;
|
|
372
|
+
}
|
|
373
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
374
|
+
minVersion: "12.0.0",
|
|
375
|
+
version: "22.2.4",
|
|
376
|
+
ngImport: i0,
|
|
377
|
+
type: LtI18nService,
|
|
378
|
+
deps: [],
|
|
379
|
+
target: i0.ɵɵFactoryTarget.Service
|
|
380
|
+
});
|
|
381
|
+
static ɵprov = i0.ɵɵngDeclareService({
|
|
382
|
+
minVersion: "22.0.0",
|
|
383
|
+
version: "22.2.4",
|
|
384
|
+
ngImport: i0,
|
|
385
|
+
type: LtI18nService
|
|
386
|
+
});
|
|
387
|
+
};
|
|
388
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
389
|
+
minVersion: "12.0.0",
|
|
390
|
+
version: "22.2.4",
|
|
391
|
+
ngImport: i0,
|
|
392
|
+
type: LtI18nService,
|
|
393
|
+
decorators: [{ type: Service }]
|
|
394
|
+
});
|
|
395
|
+
function lookup(messages, key) {
|
|
396
|
+
let node = messages;
|
|
397
|
+
for (const part of key.split(".")) {
|
|
398
|
+
if (!node || typeof node === "string") return null;
|
|
399
|
+
node = node[part];
|
|
400
|
+
}
|
|
401
|
+
return typeof node === "string" ? node : null;
|
|
402
|
+
}
|
|
403
|
+
function interpolate(message, params) {
|
|
404
|
+
if (!params) return message;
|
|
405
|
+
return message.replace(/\{(\w+)\}/g, (match, name) => name in params ? String(params[name]) : match);
|
|
406
|
+
}
|
|
407
|
+
function deepMerge(target, source) {
|
|
408
|
+
const result = { ...target };
|
|
409
|
+
for (const [key, value] of Object.entries(source)) {
|
|
410
|
+
const current = result[key];
|
|
411
|
+
result[key] = typeof value === "object" && typeof current === "object" ? deepMerge(current, value) : value;
|
|
412
|
+
}
|
|
413
|
+
return result;
|
|
414
|
+
}
|
|
415
|
+
const LT_TOAST_ADAPTER = new InjectionToken("LT_TOAST_ADAPTER");
|
|
416
|
+
var LtToastService = class LtToastService {
|
|
417
|
+
adapter = inject(LT_TOAST_ADAPTER, { optional: true });
|
|
418
|
+
show(options) {
|
|
419
|
+
if (!this.adapter) return false;
|
|
420
|
+
try {
|
|
421
|
+
return this.adapter.show(options) !== false;
|
|
422
|
+
} catch {
|
|
423
|
+
return false;
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
success(title, description) {
|
|
427
|
+
return this.show({
|
|
428
|
+
color: "success",
|
|
429
|
+
description,
|
|
430
|
+
title
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
error(title, description) {
|
|
434
|
+
return this.show({
|
|
435
|
+
color: "error",
|
|
436
|
+
description,
|
|
437
|
+
title
|
|
438
|
+
});
|
|
439
|
+
}
|
|
440
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
441
|
+
minVersion: "12.0.0",
|
|
442
|
+
version: "22.2.4",
|
|
443
|
+
ngImport: i0,
|
|
444
|
+
type: LtToastService,
|
|
445
|
+
deps: [],
|
|
446
|
+
target: i0.ɵɵFactoryTarget.Service
|
|
447
|
+
});
|
|
448
|
+
static ɵprov = i0.ɵɵngDeclareService({
|
|
449
|
+
minVersion: "22.0.0",
|
|
450
|
+
version: "22.2.4",
|
|
451
|
+
ngImport: i0,
|
|
452
|
+
type: LtToastService
|
|
453
|
+
});
|
|
454
|
+
};
|
|
455
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
456
|
+
minVersion: "12.0.0",
|
|
457
|
+
version: "22.2.4",
|
|
458
|
+
ngImport: i0,
|
|
459
|
+
type: LtToastService,
|
|
460
|
+
decorators: [{ type: Service }]
|
|
461
|
+
});
|
|
462
|
+
const LT_ERROR_TRANSLATION_OPTIONS = new InjectionToken("LT_ERROR_TRANSLATION_OPTIONS", { factory: () => ({
|
|
463
|
+
defaultLocale: "de",
|
|
464
|
+
enabled: true,
|
|
465
|
+
preload: true
|
|
466
|
+
}) });
|
|
467
|
+
const ERROR_CODE_REGEX = /^#([A-Z_]+_\d+):\s*(.+)$/s;
|
|
468
|
+
const LT_ERROR_TRANSLATION_TIMEOUT_MS = 1e4;
|
|
469
|
+
var LtErrorTranslationService = class LtErrorTranslationService {
|
|
470
|
+
api = inject(LtApiUrlService);
|
|
471
|
+
fetch = inject(LT_FETCH);
|
|
472
|
+
i18n = inject(LtI18nService);
|
|
473
|
+
toast = inject(LtToastService);
|
|
474
|
+
options = inject(LT_ERROR_TRANSLATION_OPTIONS);
|
|
475
|
+
isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
|
|
476
|
+
translations = signal({}, ...ngDevMode ? [{ debugName: "translations" }] : /* istanbul ignore next */ []);
|
|
477
|
+
inFlight = /* @__PURE__ */ new Map();
|
|
478
|
+
currentLocale = computed(() => this.i18n.locale() || this.options.defaultLocale || "de", ...ngDevMode ? [{ debugName: "currentLocale" }] : /* istanbul ignore next */ []);
|
|
479
|
+
isLoaded = computed(() => !!this.translations()[this.currentLocale()], ...ngDevMode ? [{ debugName: "isLoaded" }] : /* istanbul ignore next */ []);
|
|
480
|
+
isLoading = signal(false, ...ngDevMode ? [{ debugName: "isLoading" }] : /* istanbul ignore next */ []);
|
|
481
|
+
async loadTranslations(locale) {
|
|
482
|
+
if (!this.options.enabled) return;
|
|
483
|
+
const target = locale || this.currentLocale();
|
|
484
|
+
if (this.translations()[target]) return;
|
|
485
|
+
const running = this.inFlight.get(target);
|
|
486
|
+
if (running) return running;
|
|
487
|
+
const load = (async () => {
|
|
488
|
+
this.isLoading.set(true);
|
|
489
|
+
try {
|
|
490
|
+
const response = await this.fetch(this.api.buildUrl(`/i18n/errors/${encodeURIComponent(target)}`), {
|
|
491
|
+
headers: { accept: "application/json" },
|
|
492
|
+
signal: AbortSignal.timeout(LT_ERROR_TRANSLATION_TIMEOUT_MS)
|
|
493
|
+
});
|
|
494
|
+
if (!response.ok) throw new Error(`HTTP ${response.status}`);
|
|
495
|
+
const body = await response.json();
|
|
496
|
+
if (body?.errors && typeof body.errors === "object") this.translations.update((current) => ({
|
|
497
|
+
...current,
|
|
498
|
+
[target]: body.errors
|
|
499
|
+
}));
|
|
500
|
+
} catch (error) {
|
|
501
|
+
console.warn(`[@lenne.tech/ng-base] Failed to load error translations for ${target}:`, error);
|
|
502
|
+
} finally {
|
|
503
|
+
this.inFlight.delete(target);
|
|
504
|
+
this.isLoading.set(this.inFlight.size > 0);
|
|
505
|
+
}
|
|
506
|
+
})();
|
|
507
|
+
this.inFlight.set(target, load);
|
|
508
|
+
return load;
|
|
509
|
+
}
|
|
510
|
+
parseError(errorOrMessage) {
|
|
511
|
+
const message = extractLtErrorMessage(errorOrMessage);
|
|
512
|
+
const match = message.match(ERROR_CODE_REGEX);
|
|
513
|
+
if (!match) return {
|
|
514
|
+
code: null,
|
|
515
|
+
developerMessage: message,
|
|
516
|
+
translatedMessage: message
|
|
517
|
+
};
|
|
518
|
+
const code = match[1] ?? "";
|
|
519
|
+
const developerMessage = (match[2] ?? "").trim();
|
|
520
|
+
return {
|
|
521
|
+
code,
|
|
522
|
+
developerMessage,
|
|
523
|
+
translatedMessage: this.translations()[this.currentLocale()]?.[code] || developerMessage
|
|
524
|
+
};
|
|
525
|
+
}
|
|
526
|
+
translateError(errorOrMessage) {
|
|
527
|
+
return this.parseError(errorOrMessage).translatedMessage;
|
|
528
|
+
}
|
|
529
|
+
showErrorToast(errorOrMessage, title) {
|
|
530
|
+
if (!this.isBrowser) return;
|
|
531
|
+
const parsed = this.parseError(errorOrMessage);
|
|
532
|
+
if (!this.toast.show({
|
|
533
|
+
color: "error",
|
|
534
|
+
description: parsed.translatedMessage,
|
|
535
|
+
title: title || this.i18n.t("lt.error.title")
|
|
536
|
+
})) console.error("[@lenne.tech/ng-base]", parsed.translatedMessage);
|
|
537
|
+
}
|
|
538
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
539
|
+
minVersion: "12.0.0",
|
|
540
|
+
version: "22.2.4",
|
|
541
|
+
ngImport: i0,
|
|
542
|
+
type: LtErrorTranslationService,
|
|
543
|
+
deps: [],
|
|
544
|
+
target: i0.ɵɵFactoryTarget.Service
|
|
545
|
+
});
|
|
546
|
+
static ɵprov = i0.ɵɵngDeclareService({
|
|
547
|
+
minVersion: "22.0.0",
|
|
548
|
+
version: "22.2.4",
|
|
549
|
+
ngImport: i0,
|
|
550
|
+
type: LtErrorTranslationService
|
|
551
|
+
});
|
|
552
|
+
};
|
|
553
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
554
|
+
minVersion: "12.0.0",
|
|
555
|
+
version: "22.2.4",
|
|
556
|
+
ngImport: i0,
|
|
557
|
+
type: LtErrorTranslationService,
|
|
558
|
+
decorators: [{ type: Service }]
|
|
559
|
+
});
|
|
560
|
+
function extractLtErrorMessage(errorOrMessage) {
|
|
561
|
+
if (typeof errorOrMessage === "string") return errorOrMessage;
|
|
562
|
+
if (errorOrMessage === null || errorOrMessage === void 0) return "";
|
|
563
|
+
if (typeof errorOrMessage !== "object") return String(errorOrMessage);
|
|
564
|
+
const source = errorOrMessage;
|
|
565
|
+
for (const candidate of [
|
|
566
|
+
source["error"],
|
|
567
|
+
source["data"],
|
|
568
|
+
source["body"]
|
|
569
|
+
]) {
|
|
570
|
+
const fromBody = messageOf(candidate);
|
|
571
|
+
if (fromBody) return fromBody;
|
|
572
|
+
}
|
|
573
|
+
return messageOf(source) || typeof source["statusText"] === "string" && source["statusText"] || String(errorOrMessage);
|
|
574
|
+
}
|
|
575
|
+
function messageOf(value) {
|
|
576
|
+
if (typeof value === "string") return value;
|
|
577
|
+
if (!value || typeof value !== "object") return "";
|
|
578
|
+
const message = value["message"];
|
|
579
|
+
if (typeof message === "string") return message;
|
|
580
|
+
if (Array.isArray(message)) return message.filter((part) => typeof part === "string").join(", ");
|
|
581
|
+
const nested = value["error"];
|
|
582
|
+
if (nested && typeof nested === "object") return messageOf(nested);
|
|
583
|
+
return "";
|
|
584
|
+
}
|
|
585
|
+
const LT_NG_BASE_VERSION = "22.0.0";
|
|
586
|
+
const LT_HYDRATED_FLAG = "__ltNgBaseHydrated";
|
|
587
|
+
function provideLtNgBase(config = {}) {
|
|
588
|
+
return makeEnvironmentProviders([
|
|
589
|
+
{
|
|
590
|
+
provide: LT_RUNTIME_CONFIG,
|
|
591
|
+
useFactory: () => {
|
|
592
|
+
const base = mergeLtRuntimeConfig(LT_RUNTIME_CONFIG_DEFAULTS, config.runtime);
|
|
593
|
+
if (!isPlatformBrowser(inject(PLATFORM_ID))) return mergeLtRuntimeConfig(base, inject(LT_SERVER_RUNTIME_CONFIG, { optional: true })?.public);
|
|
594
|
+
return mergeLtRuntimeConfig(base, readLtRuntimeConfigFromDocument(inject(DOCUMENT)));
|
|
595
|
+
}
|
|
596
|
+
},
|
|
597
|
+
{
|
|
598
|
+
provide: LT_ERROR_TRANSLATION_OPTIONS,
|
|
599
|
+
useFactory: () => mergeLtFeatureOptions({
|
|
600
|
+
defaultLocale: config.i18n?.defaultLocale ?? "de",
|
|
601
|
+
enabled: true,
|
|
602
|
+
preload: true
|
|
603
|
+
}, config.errorTranslation, inject(LT_RUNTIME_CONFIG).lt.errorTranslation)
|
|
604
|
+
},
|
|
605
|
+
{
|
|
606
|
+
provide: LT_I18N_OPTIONS,
|
|
607
|
+
useValue: config.i18n ?? {}
|
|
608
|
+
},
|
|
609
|
+
provideLtPreHydrationInput(config.preHydrationInput),
|
|
610
|
+
provideAppInitializer(() => {
|
|
611
|
+
if (config.configCheck !== false) inject(LtApiUrlService).reportMissing();
|
|
612
|
+
}),
|
|
613
|
+
provideAppInitializer(() => {
|
|
614
|
+
const options = inject(LT_ERROR_TRANSLATION_OPTIONS);
|
|
615
|
+
if (!isPlatformBrowser(inject(PLATFORM_ID)) || !options.enabled || !options.preload) return;
|
|
616
|
+
inject(LtErrorTranslationService).loadTranslations();
|
|
617
|
+
}),
|
|
618
|
+
provideAppInitializer(() => {
|
|
619
|
+
if (!isPlatformBrowser(inject(PLATFORM_ID))) return;
|
|
620
|
+
inject(ApplicationRef).whenStable().then(() => {
|
|
621
|
+
globalThis[LT_HYDRATED_FLAG] = true;
|
|
622
|
+
globalThis["__ltNgBaseVersion"] = LT_NG_BASE_VERSION;
|
|
623
|
+
});
|
|
624
|
+
})
|
|
625
|
+
]);
|
|
626
|
+
}
|
|
627
|
+
function tw(strings, ...values) {
|
|
628
|
+
if (typeof strings === "string") return strings;
|
|
629
|
+
return strings.reduce((result, part, index) => result + part + (index < values.length ? String(values[index]) : ""), "");
|
|
630
|
+
}
|
|
631
|
+
export { LT_ERROR_TRANSLATION_OPTIONS, LT_FETCH, LT_HYDRATED_FLAG, LT_I18N_ADAPTER, LT_I18N_MESSAGES, LT_I18N_OPTIONS, LT_NG_BASE_VERSION, LT_PRE_HYDRATION_SUBMIT_GUARD_SCRIPT, LT_RUNTIME_CONFIG, LT_RUNTIME_CONFIG_DEFAULTS, LT_RUNTIME_CONFIG_SCRIPT_ID, LT_SERVER_RUNTIME_CONFIG, LT_TOAST_ADAPTER, LtApiUrlService, LtCookieService, LtErrorTranslationService, LtI18nService, LtToastService, collectLtEditedFields, extractLtErrorMessage, injectLtRuntimeConfigScript, isLtAbsoluteUrl, ltArrayBufferToBase64Url, ltBase64UrlToUint8Array, ltCredentialsFetch, ltSha256, mergeLtFeatureOptions, mergeLtRuntimeConfig, parseLtCookies, provideLtNgBase, provideLtPreHydrationInput, readLtRuntimeConfigFromDocument, resetLtWarnOnceState, resolveLtApiBaseUrl, restoreLtField, serializeLtRuntimeConfig, tw, warnLtOnce };
|
|
926
632
|
|
|
927
|
-
|
|
928
|
-
//# sourceMappingURL=lenne.tech-ng-base.mjs.map
|
|
633
|
+
//# sourceMappingURL=lenne.tech-ng-base.mjs.map
|