import{a as B,o as I,b as r,k as w,v as x,C as A,m as u,g as t,p as i,n as f,q as m,D as E,w as F,I as _,F as p,H as g,u as b,f as T,T as D}from"./convert-case-to-camel-case.utils-DDUpNI96.js";import{a as G}from"./WooRedirectCart-BJuCLpzi.js";import{c as V}from"./ThankYouPage-bf4cLsjC.js";import"./widget-BUAABBRb.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./_commonjs-dynamic-modules-TDtrdbi3.js";import"./translationsStore-DBJu9sBR.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./index-CEuXXsrq.js";const M=["data-accordion","data-group-id"],$={key:0,class:"ccb-group__icon"},z={key:1,class:"ccb-group__label"},H={class:"ccb-group__fields",ref:"fields"},Y=B({__name:"Group",props:{field:{}},setup(L){I(()=>{N.value&&(l.value=!0),n.value&&(l.value=!0,x(()=>{const o=document.querySelectorAll(".ccb-group");document.querySelectorAll(".ccb-group__body").forEach(s=>{s.classList.add("collapsed")}),o.forEach(s=>{s.classList.add("ccb-group-collapsed")});const e=o[0],c=e==null?void 0:e.dataset.groupId;if(c!==void 0&&Number(c)===a.value.id){e.classList.remove("ccb-group-collapsed");const s=e.querySelector(".ccb-group__body");s&&s.classList.remove("collapsed"),l.value=!1}}))});const y=L,{field:a}=A(y),l=w(!1),C=r(()=>a.value.label?a.value.label:"Group"),h=r(()=>o=>Array.from(o.values())),k=r(()=>a.value.showTitle),v=r(()=>a.value.collapsible),n=r(()=>a.value.accordion),N=r(()=>a.value.collapse),S=()=>{v.value&&(n.value?document.querySelectorAll(".ccb-group").forEach(d=>{const e=d,c=e==null?void 0:e.dataset.groupId,s=e.querySelector(".ccb-group__body");c!==void 0&&Number(c)!==+a.value.id?(e.classList.add("ccb-group-collapsed"),s==null||s.classList.add("collapsed"),l.value=!0):e.classList.contains("ccb-group-collapsed")?(e.classList.remove("ccb-group-collapsed"),s==null||s.classList.remove("collapsed"),l.value=!1):(e.classList.add("ccb-group-collapsed"),s==null||s.classList.add("collapsed"),l.value=!0)}):l.value=!l.value)},q=r(()=>{var o;return((o=a.value)==null?void 0:o.additionalStyles)||""});return(o,d)=>(t(),u("div",{class:_(["ccb-group",{"ccb-group-collapsed":l.value,[q.value]:!0}]),"data-accordion":n.value,"data-group-id":b(a).id},[i("div",{class:"ccb-group__header",onClick:S},[v.value?(t(),u("div",$,d[0]||(d[0]=[i("i",{class:"ccb-icon-Path-3514"},null,-1)]))):m("",!0),k.value?(t(),u("div",z,E(C.value),1)):m("",!0),f(V)]),f(D,{name:"fade"},{default:F(()=>[i("div",{class:_(["ccb-group__body",{collapsed:l.value}])},[i("div",H,[(t(!0),u(p,null,g(b(a).groupElements,e=>(t(),u(p,null,[(t(!0),u(p,null,g(h.value(e),c=>(t(),T(G,{name:c.fieldName,field:c},null,8,["name","field"]))),256))],64))),256))],512)],2)]),_:1})],10,M))}});export{Y as default};
//# sourceMappingURL=index-CjUECPAy.js.map
