import{r as t,c as o,h as i,a,g as e}from"./p-d52b3602.js";import{c as s}from"./p-c608c6dc.js";import{s as n}from"./p-c5a89792.js";import{e as r}from"./p-086c9d13.js";const c=class{constructor(i){t(this,i),this.scaleClose=o(this,"scale-close",7),this.variant="informational",this.dismissible=!1,this.autoHide=!1,this.autoHideDuration=3e3,this.closeButtonLabel="close",this.closeButtonTitle="close",this.close=()=>{this.opened=!1,r(this,"scaleClose")}}componentWillLoad(){this.hasSlotText=!!this.hostElement.querySelector("[slot=text]")}componentDidRender(){!0===this.autoHide&&setTimeout(this.close,this.autoHideDuration)}componentDidUpdate(){this.hasSlotText=!!this.hostElement.querySelector("[slot=text]")}connectedCallback(){n({source:this.hostElement,type:"warn"})}async open(){this.opened=!0}handleIcons(){if(this.variant)switch(this.variant){case"success":return i("scale-icon-action-success",{class:"notification-message__icon-success",color:"#187431","aria-hidden":"true"});case"informational":return i("scale-icon-alert-information",{class:"notification-message__icon-information","aria-hidden":"true"});case"error":return i("scale-icon-alert-error",{class:"notification-message__icon-error","aria-hidden":"true"});case"warning":return i("scale-icon-alert-warning",{class:"notification-message__icon-information",color:"#AE461C","aria-hidden":"true"})}}render(){return this.opened?i(a,null,i("div",{role:"alert",style:{display:this.opened?"":"none"},part:this.getBasePartMap(),class:this.getCssClassMap(),tabindex:"0"},i("div",{part:"container",class:"notification-message__container"},this.handleIcons(),i("div",{part:"heading",class:"notification-message__heading"},i("slot",null," "),this.dismissible&&i("button",{part:"button-dismissable",type:"button",class:"notification-message__icon-close",onClick:()=>this.close(),tabindex:0,"aria-label":this.closeButtonLabel,title:this.closeButtonTitle,onKeyDown:t=>{"Enter"===t.key&&this.close()}},i("scale-icon-action-circle-close",null))),this.hasSlotText&&i("div",{part:"text",class:"notification-message__text"},i("slot",{name:"text"}))))):null}getBasePartMap(){return this.getCssOrBasePartMap("basePart")}getCssClassMap(){return this.getCssOrBasePartMap("css")}getCssOrBasePartMap(t){const o="notification-message";return s(o,this.variant&&`${"basePart"===t?"":`${o}--`}variant-${this.variant}`)}get hostElement(){return e(this)}};c.style=":host{--width:100%;--radius:var(--telekom-radius-standard);--border:var(--telekom-line-weight-standard) solid transparent;--background-error:var(--telekom-color-functional-danger-subtle);--background-warning:var(--telekom-color-functional-warning-subtle);--background-informational:var(\n    --telekom-color-functional-informational-subtle\n  );--background-success:var(--telekom-color-functional-success-subtle)}.notification-message{border:var(--border);border-radius:var(--radius);width:var(--width);position:relative}.notification-message--variant-error{background:var(--background-error)}.notification-message--variant-warning{background-color:var(--background-warning)}.notification-message--variant-informational{background-color:var(--background-informational)}.notification-message--variant-success{background-color:var(--background-success)}.notification-message__heading{margin:14px 48px 14px 48px;font-weight:var(--telekom-typography-font-weight-bold);line-height:var(--telekom-typography-line-spacing-standard)}.notification-message__text{margin:8px 48px 15px 48px}::slotted(*){font-weight:var(--telekom-typography-font-weight-regular)}.notification-message__icon-close{position:absolute;top:8px;right:13.5px;border:none;cursor:pointer;margin:0;padding:0;background:transparent;color:var(--telekom-color-text-and-icon-standard)}.notification-message__icon-close svg{height:19px;width:19px;padding:6.5px;border-radius:20%}.notification-message__icon-close:hover svg{background-color:hsl(0, 0%, 100%);color:var(--telekom-color-text-and-icon-primary-hovered)}.notification-message__icon-success{position:absolute;top:12.5px;left:17px;height:20px;width:20px;color:var(--telekom-color-text-and-icon-functional-success)}.notification-message__icon-error{position:absolute;top:12px;left:17px;height:20px;width:20px;color:var(--telekom-color-text-and-icon-functional-danger)}.notification-message__icon-information{position:absolute;top:12px;left:17px;height:20px;width:20px;color:var(--telekom-color-text-and-icon-functional-informational)}@media screen and (forced-colors: active), (-ms-high-contrast: active){.notification-message__icon-close{color:hsl(0, 0%, 100%)}.notification-message{border:1px solid hsl(0, 0%, 100%)}}";export{c as scale_notification_message}