import{makeGlobalSize as t,composeSize as e,removePaddingYInStyle as r,makeStyle as o,getSingleColorVariable as l,getGlobalColorStateStyle as i}from"@gem-sdk/core";let a=1,n=0,s="<svg width='16' height='16' fill='currentColor' viewBox=\"0 0 448 512\"><path fill='currentColor' d=\"M400 288h-352c-17.69 0-32-14.32-32-32.01s14.31-31.99 32-31.99h352c17.69 0 32 14.3 32 31.99S417.7 288 400 288z\"/></svg>",c="<svg fill='currentColor' width='16' height='16' xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\"><path fill='currentColor' d=\"M432 256c0 17.69-14.33 32.01-32 32.01H256v144c0 17.69-14.33 31.99-32 31.99s-32-14.3-32-31.99v-144H48c-17.67 0-32-14.32-32-32.01s14.33-31.99 32-31.99H192v-144c0-17.69 14.33-32.01 32-32.01s32 14.32 32 32.01v144h144C417.7 224 432 238.3 432 256z\"/></svg>",p=(t,e)=>{let{setting:r={},styles:o={},builderProps:l}=t,{activeKey:i,iconSvg:a,expandItem:n,iconPosition:s,iconCollapseSize:c,iconGlobalSize:p,iconExpand:g,iconCollapse:u,layoutHeader:d,expandedMode:m,configIconSize:v}=r,{bgColor:S,color:h,headerBorder:C,width:I,fullWidth:w,textColor:L,itemHeaderSpacing:M,contentSizePadding:N,iconColor:f,headerContentPadding:D,widthHeightSize:H}=o,U="multiple"===m,_=n&&i?i.toString().toLowerCase().split(",").map(t=>parseInt(t.trim())-1).map(t=>t.toString()):[],x=U?[..._]:_;return{uidState:l?.uid,settingState:{iconSvg:a,isIconPlus:"plus"===a,activeKey:i,expanded:U,expandItem:n,iconPosition:s,iconGlobalSize:p,iconCollapse:u,iconExpand:g,iconCollapseSize:c,layoutHeader:d,expandedMode:m,configIconSize:v,parentUid:l?.uid,childListNumber:n?i?.toString().toLowerCase()==="all"?e?.map((t,e)=>e.toString()):x:[],chidlrenUid:e?.map(t=>t.uid)},stylesState:{bgColor:S,color:h,headerBorder:C,fullWidth:w,width:I,itemHeaderSpacing:M,textColor:L,iconColor:f,contentSizePadding:N,headerContentPadding:D,widthHeightSize:H},accordions:x}},g=(t={})=>{let{iconSvg:e,titleTypo:r,layoutHeader:o,iconGlobalSize:l,iconCollapseSize:i,iconCollapse:a,iconExpand:n,alignment:s,configIconSize:c,iconPosition:p}=t,g=r?{...r,attrs:{...r.attrs}}:void 0;return g?.attrs?.color&&delete g.attrs.color,{iconSvg:e,titleTypo:g,layoutHeader:o,iconGlobalSize:l,iconCollapseSize:i,iconCollapse:a,iconExpand:n,alignment:s,configIconSize:c,iconPosition:p}},u=({isShow:t,iconExpand:e,iconCollapse:r,iconSvg:o})=>e&&t?e:r&&!t?r:"plus"===o?t?s:c:o,d=a=>{let{index:n,accordions:s,parentSetting:c,parentStyle:p}=a,{titleTypo:g,iconCollapse:d,iconExpand:m,activeKey:v,expandItem:S,iconSvg:h}=c??{};delete g?.attrs?.color;let{itemContentSpacing:C,iconColor:I,contentSizePadding:w}=p??{},L=!!S&&(v?.toString()?.toLowerCase()==="all"||s?.includes(n?.toString()??"")),M=t(w),N=u({isShow:L,iconExpand:m,iconCollapse:d,iconSvg:h});return{isShow:L,composeContentSizeStyle:()=>{let t={...w&&M.padding,...C?.type||w?{}:e(C?.custom)};return L?t:r(t)},collapsibleIcon:N,composeIconColor:(()=>{let t={normal:I?.normal??"transparent",hover:I?.hover??I?.active??I?.normal??"transparent",active:I?.active??"transparent"};return L?o({c:l(t?.active)}):i("c",t)})(),makeIcon:N}};export{n as BODY_CHILD_INDEX,s as ICON_MINUS,c as ICON_PLUS,a as MINIMUM_CHILD,u as composeIconSvg,p as getDataState,g as getParentSettings,d as getSettingItemLiquid};
