import{r as d,j as e,g as A,w as i,i as a,aX as u,aY as f,J as p,aZ as g,I as $,aa as D}from"./index-DnB1XXdB.js";function E(o,r){return e.jsx(A,{ref:r,icon:{parts:[{type:"path",props:{d:"M11.75 9 6.5 15H17L11.75 9Z",fill:"currentColor"}}],viewSize:24},...o})}const B=d.forwardRef(E),I={Wrapper:i((o,r,n)=>({root:{boxShadow:"0px 4px 6px 0px #CDD1E0","&, &:first-child":{borderRadius:8},"&:before":{content:"normal"},[`&, &.${n.expanded}`]:{margin:0},"&.Mui-disabled":{backgroundColor:a.gray.light}},expanded:{}}),"BuilderSection")(u),Summary:i((o,r,n)=>({root:{padding:"0 36px 0 24px",minHeight:97,marginBottom:0,[`&.${n.expanded}`]:{minHeight:97},[`&.${n.focusVisible}`]:{background:"transparent"},[o.breakpoints.down("md")]:{padding:"0 24px 0 12px",minHeight:80,[`&.${n.expanded}`]:{minHeight:80}}},content:{margin:"23px 0",[o.breakpoints.down("md")]:{margin:"16px 0"}},expandIconWrapper:{transform:"rotate(90deg)",color:a.black},expanded:{},focusVisible:{}}),"BuilderSection-Summary")(f),SummaryContent:p("div")(({theme:o})=>({display:"flex",alignItems:"flex-start",gap:16,[o.breakpoints.down("md")]:{gap:12}})),SummaryIcon:p("div")({display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#f3f5fe",color:a.primary.blue,padding:12,borderRadius:4}),Description:p("p")(({theme:o})=>({fontSize:14,color:a.gray.darkest,marginTop:8,[o.breakpoints.down("md")]:{fontSize:12,marginTop:4}}),"BuilderSection-Description"),Details:i(o=>({root:{display:"flex",padding:"0 24px 24px",flexDirection:"column",[o.breakpoints.down("md")]:{padding:"0 12px 12px"}}}),"BuilderSection-AccordionDetails")(g)},c={Wrapper:i((o,r,n)=>({root:{boxShadow:"none",transition:$.transition(),"&:first-child":{paddingTop:10},[`&:first-child, &.${n.expanded}:first-child`]:{marginTop:-6},"&, &:first-child":{borderRadius:0},"&:not(:last-child)":{borderBottom:"1px solid #E4E4E4"},"&:before":{content:"normal"},"&:hover":{backgroundColor:a.gray.light,"&:last-child":{borderBottom:"none",borderRadius:0}},[`&, &.${n.expanded}`]:{margin:0,backgroundColor:"#fff"},"&.Mui-disabled":{background:"none",opacity:.7}},expanded:{}}),"Accordion-Wrapper")(u),Summary:i((o,r,n)=>({root:{fontSize:16,padding:"0 0 0 26px",[`&, &.${n.expanded}`]:{minHeight:0},[`&.${n.focusVisible}`]:{background:"transparent"},[o.breakpoints.down("md")]:{fontSize:14}},content:{margin:"26px 0",[`&.${n.expanded}`]:{margin:"26px 0 24px",[o.breakpoints.down("md")]:{margin:"26px 0 16px"}},".MuiAccordion-root:first-child > .MuiAccordionSummary-root > &":{marginTop:16}},expandIconWrapper:{transform:"rotate(90deg)",color:"#5A5B70",padding:0,position:"absolute",left:0,top:26,[o.breakpoints.down("md")]:{top:24},".MuiAccordion-root:first-child > .MuiAccordionSummary-root > &":{top:16,[o.breakpoints.down("md")]:{top:14}}},expanded:{},focusVisible:{}}),"Accordion-Summary")(f),Details:i(o=>({root:{display:"flex",padding:"0 0 30px",flexDirection:"column",gap:22,[o.breakpoints.down("md")]:{padding:"0 0 26px"}}}),"Accordion-Details")(D(g,["fullBox"]))};function C({title:o,children:r,defaultExpanded:n=!1,expanded:b,onChange:s,summaryProps:h={},disabled:y=!1,...S}){const[k,w]=d.useState(n??!1),l=d.useRef(null);function m(t,x){s&&s(t,x),w(x)}return d.useEffect(()=>{function t(){m(null,!0)}l.current.addEventListener("expandErrorSection",t)},[]),e.jsxs(c.Wrapper,{expanded:b??k,onChange:m,ref:l,disabled:y,...S,children:[e.jsx(c.Summary,{expandIcon:e.jsx(B,{}),...h,children:o}),e.jsx(c.Details,{children:r})]})}const R=d.memo(C);export{R as A,B as a,I as s};