import{proxyCustomElement,HTMLElement,createEvent,h,Host}from"@stencil/core/internal/client";import{c as classnames}from"./index2.js";const vaTabItemCss=':host{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background-color:transparent;color:var(--vads-color-primary);position:relative;padding:1rem;padding-bottom:calc(1rem - 4px);border:none;border-bottom:4px solid transparent;min-width:2.75rem;max-width:10rem;font-family:var(--font-source-sans);font-size:var(--vads-font-size-source-sans-normalized);text-align:center;line-height:var(--vads-font-line-height-2)}@media (forced-colors: active){:host{background-color:ButtonFace;color:ButtonText;border-bottom-color:ButtonFace}}:host(:focus){outline-offset:-2px !important}:host([aria-selected=false]:hover){cursor:pointer;background:var(--vads-color-base-lightest);border-bottom-color:var(--vads-color-primary)}:host([aria-selected=true]){border-bottom-color:var(--vads-color-primary);color:transparent}:host([aria-selected=true]:hover){cursor:pointer;background:var(--vads-color-base-lightest);border-bottom-color:var(--vads-color-primary)}:host([aria-selected=true])::after{content:attr(data-label)/"";display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;position:absolute;height:calc(100% - (2rem - 4px));top:1rem;width:calc(100% - 4px);left:2px;font-weight:700;color:var(--vads-color-link)}:host([aria-selected=true]:hover)::after{background-color:var(--vads-color-base-lightest)}@media screen and (min-width: 320px){:host{min-width:4rem}}@media screen and (min-width: 768px){:host{max-width:unset}}',VaTabItemStyle0=vaTabItemCss,VaTabItem$1=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.tabItemSelected=createEvent(this,"tabItemSelected",7),this.tabItemKeyNavigated=createEvent(this,"tabItemKeyNavigated",7),this.buttonText=void 0,this.targetId=void 0,this.selected=!1}handleClick(e){e.preventDefault(),this.tabItemSelected.emit(e)}handleKeyDown(e){"ArrowLeft"===e.key||"ArrowRight"===e.key?(e.preventDefault(),this.tabItemKeyNavigated.emit(e)):"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.handleClick(new MouseEvent("click",{bubbles:!0,cancelable:!0})))}render(){const{buttonText:e,targetId:t,selected:a}=this,o=classnames({"va-tabs__tab_item":!0});return h(Host,{key:"4bc83e092de4b77b228c5234c38ca74f410b15c0",role:"tab",class:o,"aria-selected":a?"true":"false","aria-controls":t,id:`${t}-tab`,ref:e=>this.buttonElement=e,tabIndex:a?0:-1,onClick:e=>this.handleClick(e),onKeyDown:e=>this.handleKeyDown(e),"data-label":e},e)}get el(){return this}static get style(){return VaTabItemStyle0}},[1,"va-tab-item",{buttonText:[1,"button-text"],targetId:[1,"target-id"],selected:[516]}]);function defineCustomElement$1(){"undefined"!=typeof customElements&&["va-tab-item"].forEach(e=>{"va-tab-item"===e&&(customElements.get(e)||customElements.define(e,VaTabItem$1))})}const VaTabItem=VaTabItem$1,defineCustomElement=defineCustomElement$1;export{VaTabItem,defineCustomElement};