"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),s=require("react/jsx-runtime"),i=require("lucide-react"),n=require("react");exports.SectionWrapper=function(r){var t=r.id,a=r.required,c=r.title,o=r.children,l=r.openSections,d=r.setOpenSections;r.dividerRequired;var p=r.defaultOpen,u=void 0===p||p,x=r.collapsible,v=void 0!==x&&x,h=r.bordered,g=void 0!==h&&h,_=r.customStyles,y=r.readOnly,f=r.headerActions,m=n.useState(u),j=m[0],b=m[1],q=void 0!==l&&void 0!==d&&l.has(t),S=!v||(q?l.has(t):j),C=n.useCallback(function(){v&&(q?d(function(e){var s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s}):b(function(e){return!e}))},[t,d,v,q]),N=g?{border:"1px solid #ccc",padding:"8px 12px",borderRadius:"8px"}:{};return s.jsxs("div",e.__assign({className:"section-wrapper",style:N},{children:[s.jsxs("div",e.__assign({className:"section-header",onClick:C,role:v?"button":"presentation",style:{cursor:v?"pointer":"default",display:"flex",alignItems:"center"}},{children:[s.jsxs("div",e.__assign({className:"section-header-title ".concat(S?"active":""),style:{display:"flex",alignItems:"center",gap:"1.5px"}},{children:[a&&s.jsx("span",e.__assign({style:{color:"#8F2C23",marginRight:"2px"}},{children:"*"})),s.jsx("span",e.__assign({style:{color:y?"#717b8c":void 0,cursor:y?"not-allowed":"pointer",flex:1}},{children:c}))]})),s.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"8px"},onClick:function(e){return e.stopPropagation()}},{children:[f,v&&s.jsx(i.ChevronDown,{size:24,className:"section-chevron ".concat(S?"open":"")})]}))]})),S&&s.jsx(s.Fragment,{children:s.jsx("div",e.__assign({className:"section-content",style:_},{children:o}))})]}))};
//# sourceMappingURL=SectionWrapper.js.map
