import{__assign as o}from"tslib";import{jsxs as e,jsx as n}from"react/jsx-runtime";import{useState as i}from"react";import{Box as r,Typography as t,Collapse as l}from"@mui/material";import{ChevronUp as p,ChevronDown as c}from"lucide-react";var s=function(s){var a=s.explanation,x=s.onProceed,d=s.isSelected,f=s.proceedIcon,m=i(!0),u=m[0],h=m[1],g=i(!1),F=g[0],b=g[1],y=Array.isArray(a)?a:"string"==typeof a&&""!==a.trim()?[a]:[],C=y.length>2,k=F?y:y.slice(0,2);return e(r,o({sx:{bgcolor:"#FFFFFF"}},{children:[e(r,o({onClick:function(){return h(!u)},sx:{display:"flex",justifyContent:"space-between",alignItems:"center",p:"16px",pb:"12px",cursor:"pointer"}},{children:[n(t,o({sx:{fontWeight:500,fontSize:"14px",color:"#101828"}},{children:"Explanation"})),n(u?p:c,{size:16,color:"#667085"})]})),n(l,o({in:u},{children:e(r,o({sx:{px:"16px",pb:"16px"}},{children:[n(r,o({component:"ol",sx:{m:0,pl:"20px",display:"flex",flexDirection:"column",gap:"8px"}},{children:(k||[]).map(function(e,i){return n(r,o({component:"li",sx:{fontSize:"14px",color:"#475467",lineHeight:"1.5",fontWeight:400}},{children:e}),i)})})),C&&n(t,o({onClick:function(){return b(!F)},sx:{fontSize:"13px",color:"#5925DC",cursor:"pointer",mt:1,fontWeight:500,display:"inline-block"}},{children:F?"show less...":"more..."})),e("button",o({onClick:function(o){o.stopPropagation(),d||x()},disabled:d,style:{marginTop:"16px",display:"flex",alignItems:"center",gap:"4px",padding:"4px 8px",backgroundColor:d?"#F2F4F7":"#F4F3FF",color:d?"#667085":"#5925DC",border:"none",borderRadius:"8px",fontWeight:500,fontSize:"12px",cursor:d?"default":"pointer",transition:"all 0.2s"}},{children:[d?"Option is already selected":"Proceed with this option",f]}))]}))}))]}))};export{s as GapExplanationAccordion};
//# sourceMappingURL=GapExplanationAccordion.js.map
