import{r as e,h as t,a as r,g as a}from"./p-c18ee3cd.js";import{c as o}from"./p-c608c6dc.js";import{i as s}from"./p-dc2600db.js";import{s as i}from"./p-bf956c1d.js";let l=0;const d=class{constructor(t){e(this,t),this.generatedId=l++,this.disabled=!1,this.small=!1,this.size="large",this.hasFocus=!1}selectedChanged(e){this.disabled||(!0===e&&this.hostElement.focus(),this.updateSlottedIcon())}componentDidLoad(){this.setChildrenIconSize()}componentDidRender(){!1!==this.small&&i({tag:"deprecated",message:'Property "small" is deprecated. Please use the "size" property!',type:"warn",source:this.hostElement})}updateSlottedIcon(){const e=this.container.querySelector("slot");if(null===e)return;const t=Array.from(e.assignedNodes()).filter((e=>1===e.nodeType)).filter((e=>e.nodeName.toUpperCase().indexOf("ICON")>-1));if(0===t.length)return;const r=this.selected?"setAttribute":"removeAttribute";t.forEach((e=>e[r]("selected","")))}setChildrenIconSize(){Array.from(this.hostElement.children).filter(s).forEach((e=>{24===e.size&&(e.size=16)}))}render(){return t(r,{id:`scale-tab-header-${this.generatedId}`,role:!this.disabled&&"tab","aria-selected":this.selected?"true":"false",tabindex:!this.disabled&&(this.selected?"0":"-1"),onFocus:()=>this.hasFocus=!0,onBlur:()=>this.hasFocus=!1},this.styles&&t("style",null,this.styles),t("span",{part:this.getBasePartMap(),ref:e=>this.container=e,class:this.getCssClassMap()},t("slot",null)))}getBasePartMap(){return this.getCssOrBasePartMap("basePart")}getCssClassMap(){return this.getCssOrBasePartMap("css")}getCssOrBasePartMap(e){const t="basePart"===e?"":"tab-header--";return o("tab-header",this.selected&&`${t}selected`,("small"===this.size||this.small)&&`${t}small`,this.hasFocus&&`${t}has-focus`,this.disabled&&`${t}disabled`)}get hostElement(){return a(this)}static get watchers(){return{selected:["selectedChanged"]}}};d.style=":host{outline:none;--font-family:var(--telekom-typography-font-family-sans, TeleNeoWeb);--font-weight:var(--telekom-typography-font-weight-bold);--height-small:2rem;--color:var(--telekom-color-text-and-icon-standard);--color-hover:var(--telekom-color-text-and-icon-primary-hovered);--color-active:var(--telekom-color-text-and-icon-primary-pressed);--color-selected:var(--telekom-color-text-and-icon-primary-standard);--box-shadow-focus:0 0 0 var(--telekom-line-weight-highlight)\n    var(--telekom-color-functional-focus);--spacing-right-slotted:var(--telekom-spacing-unit-x2);--color-disabled:var(--telekom-color-text-and-icon-disabled);--radius:var(--telekom-radius-standard)}.tab-header{color:var(--color);cursor:pointer;display:inline-flex;outline:none;position:relative;box-sizing:border-box;align-items:center;padding-left:0;height:var(--tab-height);margin-right:var(--tab-spacing);padding-right:var(--tab-spacing);font-family:var(--font-family);font-size:calc(var(--tab-height) / 2);font-weight:var(--font-weight);border-radius:var(--tab-radius)}.tab-header--small{--tab-height:var(--height-small)}.tab-header--disabled{cursor:auto;color:var(--color-disabled)}.tab-header--disabled:after{cursor:auto;background-color:var(--telekom-color-ui-border-disabled) !important}.tab-header--disabled:active{color:var(--color-disabled)}.tab-header--disabled:hover{color:var(--color-disabled) !important}.tab-header--disabled:hover:after{background-color:var(--telekom-color-ui-border-disabled) !important}.tab-header:after{left:0;right:0;width:100%;bottom:0;content:'';display:block;position:absolute;height:var(--tab-border-size);background-color:var(--tab-border-color)}.tab-header:before{left:0;right:0;width:100%;bottom:0;height:0;content:'';display:block;z-index:1;position:absolute;border-top:1px solid transparent}.tab-header:hover{color:var(--color-hover)}.tab-header:hover:after{background-color:var(--color-hover)}.tab-header:active{color:var(--color-active)}.tab-header:active:after{background-color:var(--color-active)}.tab-header:active:after{background-color:var(--color-active)}.tab-header ::slotted(*){margin-right:var(--spacing-right-slotted)}.tab-header--has-focus{box-shadow:var(--box-shadow-focus)}.tab-header--selected{color:var(--color-selected)}.tab-header--selected:after{border-top-left-radius:var(--radius);border-top-right-radius:var(--radius);height:var(--tab-border-size-selected);background-color:var(--color-selected)}.tab-header--selected:before{border-top:var(--tab-border-size-selected) solid transparent}";export{d as scale_tab_header}