{"version":3,"file":"ErrorMessage-CARlJzA3.js","sources":["../../src/components/atoms/error-message/headline-h3/HeadlineH3.vue","../../src/components/atoms/error-message/ErrorMessage.vue"],"sourcesContent":["<template>\n <div>\n <!-- eslint-disable vue/no-v-html -->\n <p\n :class=\"headlineClass\"\n class=\"h3\"\n :style=\"headlineStyle\"\n v-html=\"headline\"\n />\n <!-- eslint-enable vue/no-v-html -->\n </div>\n</template>\n\n<script>\nexport default {\n name: 'HeadlineH3',\n props: {\n headline: {\n type: String,\n required: true,\n },\n headlineClass: {\n type: String,\n default: '',\n },\n headlineStyle: {\n type: String,\n default: null,\n },\n },\n};\n</script>\n\n<style scoped lang=\"scss\">\n@import './headline-h3';\n</style>\n","<template>\n <div\n v-if=\"!hideInitially || revealed\"\n class=\"error-message d-flex justify-center\"\n :class=\"{ 'error-message--inline': inline }\"\n :data-test=\"dataTest\"\n >\n <div ref=\"topMarker\" />\n <div\n ref=\"container\"\n :key=\"triggerCount\"\n :class=\"{ shake: triggerCount }\"\n class=\"error-message__container animated fast\"\n >\n <headline-h3\n v-if=\"title\"\n headline-class=\"error-headline ma-0\"\n headline-seo\n :headline=\"title\"\n />\n <div class=\"error-message__text\">\n <slot />\n </div>\n <div\n v-if=\"code\"\n class=\"error-message__code pt-3\"\n >\n {{ $dict.get('online-Shop.Global-Labels.Error-Code') }}\n {{ code }}\n </div>\n </div>\n <div ref=\"bottomMarker\" />\n </div>\n</template>\n\n<script>\n// HeadlineH3 fails because of \"Dependency cycle detected (import/no-cycle)\"\n// Solution might be: https://medium.com/visual-development/how-to-fix-nasty-circular-dependency-issues-once-and-for-all-in-javascript-typescript-a04c987cf0de\nimport { scrollToElement } from '@/utils/pageScrolling';\n\nimport HeadlineH3 from './headline-h3/HeadlineH3';\n\nexport default {\n name: 'ErrorMessage',\n components: {\n HeadlineH3,\n },\n props: {\n title: {\n type: String,\n required: false,\n default: null,\n },\n inline: {\n type: Boolean,\n },\n code: {\n type: String,\n default: null,\n },\n hideInitially: Boolean,\n dataTest: {\n type: String,\n default: null,\n },\n triggerOnCreation: Boolean,\n scrollTo: {\n type: String,\n default: '',\n },\n },\n data() {\n return {\n revealed: false,\n triggerCount: 0,\n };\n },\n mounted() {\n if (this.triggerOnCreation) {\n this.trigger();\n }\n },\n methods: {\n async trigger() {\n // :key=\"triggerCount\" wil re-insert the element in the dom when the\n // message gets triggered a second time. This is more reliable than\n // removing and re-adding the shake class.\n this.triggerCount += 1;\n this.revealed = true;\n if (IS_SSR) {\n return;\n }\n await this.$nextTick();\n if (!this.scrollTo) {\n const boundingClientRect = this.$refs.container.getBoundingClientRect();\n if (boundingClientRect.y <= 200) {\n scrollToElement(this.$refs.topMarker, {\n offset: 200,\n });\n } else if (boundingClientRect.bottom > document.documentElement.clientHeight - 200) {\n scrollToElement(this.$refs.bottomMarker);\n }\n } else {\n scrollToElement(document.querySelector(`#${this.scrollTo}`));\n }\n },\n hide() {\n this.revealed = false;\n this.shake = false;\n },\n },\n};\n</script>\n\n<style lang=\"scss\" scoped>\n@import './error-messages';\n</style>\n"],"names":["_sfc_main","_hoisted_1","_createElementBlock","_createElementVNode","_normalizeClass","$props","_normalizeStyle","HeadlineH3","scrollToElement","boundingClientRect","_hoisted_2","_hoisted_3","_hoisted_5","$data","_createBlock","_component_headline_h3","_createCommentVNode","_renderSlot","_ctx","_hoisted_4","_toDisplayString"],"mappings":"6JAcA,MAAKA,EAAU,CACb,KAAM,aACN,MAAO,CACL,SAAU,CACR,KAAM,OACN,SAAU,EACX,EACD,cAAe,CACb,KAAM,OACN,QAAS,EACV,EACD,cAAe,CACb,KAAM,OACN,QAAS,IACV,CACF,CACH,EA9BAC,EAAA,CAAA,WAAA,qCACEC,EASM,MAAA,KAAA,CAPJC,EAKE,IAAA,CAJC,MAJPC,EAAA,CAIcC,EAAa,cACf,IAAI,CAAA,EACT,MANPC,EAMcD,EAAa,aAAA,EACrB,UAAQA,EAAQ,QAPtB,EAAA,KAAA,GAAAJ,CAAA,gEC0CKD,EAAU,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