import{p as e,H as a,c as s,h as i,t as r}from"./p-CHfEnK-2.js";import{i as t,d as o,t as n}from"./p-94ZtGp9D.js";import{d as c}from"./p-B5hDbbCP.js";import{d as h}from"./p-B92aihLU.js";const l=e(class extends a{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.ifxInput=s(this,"ifxInput",7),this.ifxOpen=s(this,"ifxOpen",7)}get el(){return this}isOpen=!0;disabled=!1;value;maxlength;autocomplete="on";ifxInput;ifxOpen;internalState;async onNavbarMobile(){this.ifxOpen.emit(!1),this.internalState=!1}handlePropChange(){this.internalState=this.isOpen}handleCloseButton=()=>{this.internalState=!this.internalState,this.ifxOpen.emit(this.internalState)};setInitialState(){this.internalState=this.isOpen}componentWillLoad(){this.setInitialState(),this.ifxOpen.emit(this.internalState)}async componentDidLoad(){if(!t(this.el)){const e=o();n("ifx-search-bar",await e)}}handleInput(e){this.value=e.detail}render(){return i("div",{key:"92f8e0c36599468265e04cf08a9e350f4d49266b",role:"search","aria-label":"a search field for user input","aria-disabled":this.disabled,class:"search-bar "+(this.internalState?"open":"closed")},this.internalState?i("div",{class:"search-bar-wrapper"},i("ifx-search-field",{autocomplete:this.autocomplete,disabled:this.disabled,value:this.value,maxlength:this.maxlength,onIfxInput:this.handleInput.bind(this)},i("ifx-icon",{icon:"search-16",slot:"search-icon"})),i("a",{"aria-label":"Close button",href:"javascript:void(0)",onClick:this.handleCloseButton},"Close")):i("div",{class:"search-bar_icon-wrapper",onClick:this.handleCloseButton},i("ifx-icon",{icon:"search-16"})))}static get watchers(){return{isOpen:[{handlePropChange:0}]}}static get style(){return":host{width:100%;display:flex}.search-bar{box-sizing:border-box;height:40px;background-color:#FFFFFF;display:flex;flex-direction:row;align-items:center;width:100%;font-family:var(--ifx-font-family)}.search-bar.closed{display:flex;width:auto;justify-content:flex-start}.search-bar .search-bar-wrapper{display:flex;align-items:center;gap:16px;width:100%}.search-bar .search-bar-wrapper a{text-decoration:none;font-size:1rem;font-style:normal;font-weight:600;line-height:1.5rem;color:#0A8276;cursor:pointer}.search-bar .search-bar-wrapper a:focus{outline:none;box-shadow:0 0 0 2px #FFFFFF, 0 0 0 4px #0A8276}.search-bar .search-bar-wrapper ifx-search-field{width:100%}.search-bar .search-bar__icon-wrapper{display:none;flex-direction:row;align-items:center}.search-bar .search-bar__icon-wrapper ifx-icon:hover{cursor:pointer}.search-bar.closed .search-bar__icon-wrapper{display:flex}.search-bar.closed .search-bar-wrapper{display:none}"}},[513,"ifx-search-bar",{isOpen:[4,"is-open"],disabled:[4],value:[1025],maxlength:[2],autocomplete:[1],internalState:[32],onNavbarMobile:[64]},void 0,{isOpen:[{handlePropChange:0}]}]),p=l,d=function(){"undefined"!=typeof customElements&&["ifx-search-bar","ifx-icon","ifx-search-field"].forEach((e=>{switch(e){case"ifx-search-bar":customElements.get(r(e))||customElements.define(r(e),l);break;case"ifx-icon":customElements.get(r(e))||c();break;case"ifx-search-field":customElements.get(r(e))||h()}}))};export{p as IfxSearchBar,d as defineCustomElement}