import{_ as u,o as t,c as s,a as o,t as i,n as c,F as _,d as h,b as g}from"./_plugin-vue_export-helper-CHIglDgE.js";const m={name:"Selectbox",props:{options:{type:Array,required:!0},modelValue:{type:Object,default:null},disabled:{type:Boolean,default:!1}},data(){return{isDropdownOpen:!1,selectedValue:this.modelValue}},watch:{modelValue:{handler(e){this.selectedValue=e},immediate:!0,deep:!0}},methods:{toggleDropdown(){this.disabled||(this.isDropdownOpen=!this.isDropdownOpen)},selectOption(e){this.selectedValue=e,this.$emit("update:modelValue",e),this.$emit("selected",e),this.isDropdownOpen=!1}}},f={class:"relative",ref:"dropdown",id:"selectbox"},b=["disabled"],w={class:"block truncate text-left"},x=o("path",{d:"M0 0h48v48H0z",fill:"none"},null,-1),y=o("g",{id:"Shopicon"},[o("polygon",{points:"24,29.172 9.414,14.586 6.586,17.414 24,34.828 41.414,17.414 38.586,14.586 	"})],-1),v=[x,y],V={key:0,class:"absolute mt-2 w-full bg-cream rounded-lg shadow-lg z-10"},D={class:""},O=["onClick"];function k(e,a,r,z,l,d){return t(),s("div",f,[o("button",{disabled:r.disabled,onClick:a[0]||(a[0]=(...n)=>d.toggleDropdown&&d.toggleDropdown(...n)),class:c(["relative w-full bg-cream border border-gray-300 rounded-lg py-2 px-4 pr-8 leading-tight focus:outline-none focus:border-blue-500 text-gray-900",{"cursor-not-allowed":r.disabled}])},[o("span",w,i(l.selectedValue?l.selectedValue.name:"Select an option"),1),(t(),s("svg",{width:"16px",height:"16px",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg",class:c([{rotate:l.isDropdownOpen},"absolute pointer-events-none inset-y-0 flex items-center text-gray-900 transition duration-150 ease-in-out h-full arrow"]),style:{right:"10px"}},v,2))],10,b),l.isDropdownOpen?(t(),s("div",V,[o("ul",D,[(t(!0),s(_,null,h(r.options,(n,p)=>(t(),s("li",{key:p,onClick:L=>d.selectOption(n),class:"detailed-select-item cursor-pointer px-4 py-2 hover:bg-gray-100 text-gray-900"},i(n.name),9,O))),128))])])):g("",!0)],512)}const N=u(m,[["render",k]]),S={},B={class:"loader"};function C(e,a){return t(),s("span",B)}const j=u(S,[["render",C],["__scopeId","data-v-fc20ab55"]]);export{j as L,N as S};
