import{p as e,H as t,c as s,h as i,t as l}from"./p-CHfEnK-2.js";import{d as r}from"./p-DxZayX2R.js";import{d as a}from"./p-B5hDbbCP.js";import{d as c}from"./p-jNoCgBN3.js";import{d as f}from"./p-7DB9IJQJ.js";import{d as o}from"./p-B92aihLU.js";import{d as h}from"./p-DDxv8Xf4.js";import{d as n}from"./p-n3ZDkemz.js";const m=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.ifxFilterSelect=s(this,"ifxFilterSelect",7)}filterName;filterLabel;placeholder;type="text";options;filterValues=[];ifxFilterSelect;handleTextInputChange(e){this.ifxFilterSelect.emit({filterName:this.filterName,filterValues:[e.target.value],type:this.type})}handleSingleSelectChange(e){this.ifxFilterSelect.emit({filterName:this.filterName,filterValues:[e.detail.value],type:this.type})}handleMultiselectOptionChange(e){this.filterValues=e.detail.map((e=>({label:e.value,value:e.value}))),this.ifxFilterSelect.emit({filterName:this.filterName,filterValues:this.filterValues,type:this.type})}render(){let e=[];if("string"==typeof this.options)try{e=JSON.parse(this.options)}catch(t){console.error("Failed to parse options:",t),e=[]}else Array.isArray(this.options)&&(e=this.options);switch(this.type){case"text":return i("ifx-text-field",{error:!1,disabled:!1,placeholder:this.placeholder,onIfxInput:e=>this.handleTextInputChange(e)},this.filterLabel);case"single-select":return i("ifx-select",{placeholder:"true","search-enabled":"true","search-placeholder-value":"Search...",onIfxSelect:e=>this.handleSingleSelectChange(e),"ifx-placeholder-value":this.placeholder,"ifx-label":this.filterLabel,"ifx-options":this.options});case"multi-select":return i("ifx-multiselect",{label:this.filterLabel,placeholder:this.placeholder,onIfxSelect:e=>this.handleMultiselectOptionChange(e)},e.map((e=>i("ifx-multiselect-option",{value:e.value||e},e.label||e))));default:return null}}static get style(){return""}},[513,"ifx-set-filter",{filterName:[1,"filter-name"],filterLabel:[1,"filter-label"],placeholder:[1],type:[1],options:[1],filterValues:[32]}]),p=m,u=function(){"undefined"!=typeof customElements&&["ifx-set-filter","ifx-checkbox","ifx-icon","ifx-multiselect","ifx-multiselect-option","ifx-search-field","ifx-select","ifx-text-field"].forEach((e=>{switch(e){case"ifx-set-filter":customElements.get(l(e))||customElements.define(l(e),m);break;case"ifx-checkbox":customElements.get(l(e))||r();break;case"ifx-icon":customElements.get(l(e))||a();break;case"ifx-multiselect":customElements.get(l(e))||c();break;case"ifx-multiselect-option":customElements.get(l(e))||f();break;case"ifx-search-field":customElements.get(l(e))||o();break;case"ifx-select":customElements.get(l(e))||h();break;case"ifx-text-field":customElements.get(l(e))||n()}}))};export{p as IfxSetFilter,u as defineCustomElement}