import{r as t,c as s,h as a,H as i}from"./p-58739bdc.js";const c=class{constructor(a){t(this,a),this.color="primary",this.options=[],this.handleOptionClick=t=>()=>{const s=this._options[t];s.disabled||(this.updateOptions(t),this.changeOption.emit(s.value))},this.changeOption=s(this,"changeOption",7)}setOptions(t,s){JSON.stringify(t)!==JSON.stringify(s)&&(this._options=t)}updateOptions(t){const s=[...this._options].map(t=>Object.assign(Object.assign({},t),{active:!1}));s[t].active=!0,this._options=s}componentWillLoad(){this._options=this.options}render(){return a(i,null,a("div",{class:{tabTags:!0}},a("div",{class:"tabTags__wrap"},this._options.map((t,s)=>a("button",{key:`tabTagItem_${s}`,class:{tabTags__button:!0,"tabTags__button--secondary":"secondary"===this.color,"tabTags__button--active":t.active,"tabTags__button--disabled":t.disabled},onClick:this.handleOptionClick(s)},t.text)))))}static get watchers(){return{options:["setOptions"]}}static get style(){return":host{display:block}.tabTags{overflow:hidden}.tabTags__wrap{margin:-1rem -.6rem}.tabTags__button{-webkit-appearance:button;padding:0;margin:0;font-family:inherit;cursor:pointer;background-color:transparent;background-image:none;color:inherit;border:none;font-size:100%;outline:0;font-weight:900;font-size:1.2rem;padding-left:1.2rem;padding-right:1.2rem;border-radius:9999px;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;background-color:var(--neutral-04);height:3.2rem;margin:1rem .6rem}.tabTags__button--active{background-color:var(--primary);color:var(--neutral-04)}.tabTags__button--active.tabTags__button--secondary{background-color:var(--secondary)}.tabTags__button--disabled{color:var(--disabled-text);background-color:var(--disabled-background)}"}};export{c as cc_tabs_tags};