import{r as e,c as t,h as i,H as s,g as n}from"./p-444192d7.js";import{c as o}from"./p-ab760d78.js";const r=class{constructor(i){e(this,i),this.selected=t(this,"selected",3),this.block=!1,this.fluid=void 0,this.compact=!1,this.align="left",this.active="0",this.items=[]}handleSlotChange(){this.computeChildItems()}componentWillLoad(){this.computeChildItems()}componentDidLoad(){this.items.length&&setTimeout((()=>{this.el.querySelectorAll("x-segment-item.active").length||this.selectItem(this.el.querySelectorAll("x-segment-item").item(0))}),10)}selectItem(e){this.el.querySelectorAll("x-segment-item.active").forEach((e=>{e.setAttribute("active","false"),e.classList.remove("active")})),setTimeout((()=>{e.setAttribute("active","true"),e.classList.add("active"),this.active=e.getAttribute("value"),this.selected.emit(this.active)}),10)}computeChildItems(){this.items=Array.from(this.el.children).filter((e=>"x-segment-item"===e.nodeName.toLowerCase())).map((e=>e)),this.items.forEach(((e,t)=>{e.hasAttribute("value")||e.setAttribute("value",t.toString()),this.active==e.getAttribute("value")&&this.selectItem(e),e.addEventListener("click",(()=>{this.selectItem(e)}))}))}render(){return i(s,{key:"b4b8d892824dcd4b1f853296088a0b310202b6fe",class:o(`segment-${this.align}`,{"segment-fluid":this.fluid,"segment-block":this.block,"segment-compact":this.compact})},i("div",{key:"61e4775b5c6f36b0125b901ce85a2f8f0192decf",class:"segment-container"},i("slot",{key:"d3511b1ac797aa2fdd9b28e7d5ee42a352193bf5"})))}get el(){return n(this)}};r.style="x-segment{display:inline-block;height:50px;position:relative;border-radius:0.5rem;-webkit-transition:0.4s;transition:0.4s;padding:0.35rem;overflow-y:hidden;overflow-x:auto;max-width:100%;background-color:var(--color-default-lucid, #f0f0f0)}x-segment.segment-block,x-segment.segment-fluid{display:block;width:100%}x-segment.segment-fluid{border-radius:0}x-segment.segment-compact>div>x-segment-item:not(.active) span{display:none}x-segment.segment-compact>div>x-segment-item:not(.active) x-icon{margin-left:0 !important;margin-right:0 !important}x-segment::-webkit-scrollbar{opacity:0;height:1px}.is-dark-mode x-segment{background-color:var(--color-black-tint, #262626)}x-segment.segment-left>div{-ms-flex-pack:start;justify-content:start}x-segment.segment-center>div{-ms-flex-pack:center;justify-content:center}x-segment.segment-right>div{-ms-flex-pack:end;justify-content:end}x-segment.segment-evenly>div{-ms-flex-pack:space-evenly;justify-content:space-evenly}x-segment.segment-between>div{-ms-flex-pack:justify;justify-content:space-between}x-segment>div{padding:0;margin:0;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;width:100%}x-segment>div>x-segment-item{cursor:pointer;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;height:calc(50px - 0.7rem);-webkit-transition:0.4s;transition:0.4s;border-radius:0.45rem;margin-right:0.35rem;padding-left:1rem;padding-right:1rem;color:var(--color-text-tinted, gray);white-space:nowrap}.is-dark-mode x-segment>div>x-segment-item{color:var(--color-text-light-shaded, #b2b2b2)}x-segment>div>x-segment-item:hover{color:var(--color-text-tint, #656565);background-color:rgba(var(--color-default-rgb, 155, 155, 155), 0.2)}.is-dark-mode x-segment>div>x-segment-item:hover{color:var(--color-text-light, #FEFEFE);background-color:var(--color-dark-tinted, #626262)}.is-dark-mode x-segment>div>x-segment-item:hover x-icon{color:var(--color-text-light, #FEFEFE)}x-segment>div>x-segment-item.active{-webkit-box-shadow:0 0 6px rgba(0, 0, 0, 0.1);box-shadow:0 0 6px rgba(0, 0, 0, 0.1);background-color:var(--color-white, #FFFFFF) !important;color:var(--color-text, #4A4A4A) !important}x-segment>div>x-segment-item.active x-icon{color:var(--color-text, #4A4A4A) !important}x-segment>div>x-segment-item:last-child{margin-right:0}x-segment>div>x-segment-item a{color:inherit}x-segment>div>x-segment-item a:hover{color:inherit}x-segment>div>x-segment-item x-icon{color:inherit;font-size:1.25em;margin-left:-0.25rem;margin-right:0.5rem;-webkit-transition:0.3s;transition:0.3s}.is-dark-mode x-segment>div>x-segment-item x-icon{color:var(--color-text-light-shaded, #b2b2b2)}";const a=class{constructor(t){e(this,t),this.value=void 0,this.icon=void 0,this.active=!1}render(){return i(s,{key:"2acfc541f36928f3e8178fce976979259be2625b",class:o({active:this.active})},this.icon&&i("x-icon",{key:"839ffc967b02dfa6997f6994b2bb5ebae1580cf3",name:this.icon}),i("span",{key:"9098642ab7af1fffcc7cb58d5ded22294b844286"},i("slot",{key:"a53232f523b90736cb456d4e3252ab9eb2d3bf67"})))}get el(){return n(this)}};export{r as x_segment,a as x_segment_item}