"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),p=require("./BaseIcon-DO69J5Rk.cjs"),g=require("./useNestedProp-C14rfl0j.cjs"),l=require("./index-ZfICPrrM.cjs"),m=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),v=["id"],h={key:0,class:"vue-ui-accordion-arrow"},k={__name:"vue-ui-accordion",props:{config:{type:Object,default(){return{}}},hideDetails:{type:Boolean,default:!1}},setup(t){e.useCssVars(r=>({d7cf4950:e.unref(f)}));const{vue_ui_accordion:c}=l.useConfig(),d=t,o=e.computed(()=>g.useNestedProp({userConfig:d.config,defaultConfig:c})),n=e.ref(o.value.open),i=e.ref(l.createUid()),a=e.ref(null),u=e.ref(0);e.onMounted(()=>{a.value.open=o.value.open}),e.watch(()=>o.value.open,r=>{a.value.open=r});function s(){(u.value>0||!o.value.open)&&(n.value=!n.value),u.value+=1}const f=e.computed(()=>`${o.value.maxHeight}px`);return(r,C)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("details",{id:`details_${e.unref(i)}`,ref_key:"details",ref:a,onToggle:s},[e.createElementVNode("summary",{class:e.normalizeClass({"vue-ui-accordion-headless":t.hideDetails})},[e.createElementVNode("div",{class:"vue-ui-accordion-head",style:e.normalizeStyle(`background:${e.unref(o).head.backgroundColor};padding:${e.unref(o).head.padding}; ${t.hideDetails?"height: 0px !important; padding: 0 !important;":""}`)},[t.hideDetails?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",h,[e.unref(o).head.useArrowSlot?e.renderSlot(r.$slots,"arrow",e.normalizeProps(e.mergeProps({key:0},{backgroundColor:e.unref(o).head.backgroundColor,color:e.unref(o).head.color,iconColor:e.unref(o).head.iconColor,isOpen:e.unref(n)})),void 0,!0):(e.openBlock(),e.createBlock(p.default,{key:1,name:"arrowRight",stroke:e.unref(o).head.iconColor},null,8,["stroke"]))])),e.renderSlot(r.$slots,"title",e.normalizeProps(e.guardReactiveProps({color:e.unref(o).head.color,isOpen:e.unref(n)})),void 0,!0)],4)],2)],40,v),e.createElementVNode("div",{class:"vue-ui-accordion-content",style:e.normalizeStyle(`background:${e.unref(o).body.backgroundColor};color:${e.unref(o).body.color}`)},[e.renderSlot(r.$slots,"content",e.normalizeProps(e.guardReactiveProps({backgroundColor:e.unref(o).body.backgroundColor,color:e.unref(o).body.color,isOpen:e.unref(n)})),void 0,!0)],4)]))}},y=m._export_sfc(k,[["__scopeId","data-v-eac1d579"]]);exports.default=y;
