import{__rest as e,__assign as i}from"tslib";import{jsx as o,jsxs as t}from"react/jsx-runtime";import{SectionWrapper as n}from"../../molecules/Sections/SectionWrapper.js";import r from"../../_svg/CognitiveDecisioning.js";import{ChevronUpIcon as l,ChevronDownIcon as s}from"lucide-react";import a from"../../TooltipComponent.js";var d=function(d){var p=d.id,c=d.title,g=void 0===c?"Scope":c,h=d.required,x=void 0!==h&&h,u=d.openSections,m=d.setOpenSections,v=d.scopeData,b=d.onScopeChange;d.stationOptions;var f=d.tierOptions,y=void 0===f?[]:f;d.stationLabel;var S=d.tierLabel,C=void 0===S?"Where should this rule apply?":S,O=d.highlights,w=void 0===O?{}:O,I=d.isOpen,k=d.onToggle,z=d.showCognitiveIcon,j=d.cognitiveIcon,D=d.tooltipDescription,L=d.errorMessage,M=d.stationErrorMessage,T=d.tierErrorMessage,E=e(d,["id","title","required","openSections","setOpenSections","scopeData","onScopeChange","stationOptions","tierOptions","stationLabel","tierLabel","highlights","isOpen","onToggle","showCognitiveIcon","cognitiveIcon","tooltipDescription","errorMessage","stationErrorMessage","tierErrorMessage"]);return o(n,i({id:p,title:g,required:x,openSections:u,setOpenSections:m},E,{children:t("div",i({className:"scope-content"},{children:[y.length>0&&t("div",i({className:"form-group"},{children:[t("div",i({style:{display:"flex",alignItems:"center",gap:"4px",marginBottom:"4px"}},{children:[o("span",i({style:{color:"#8F2C23",lineHeight:1}},{children:"*"})),o("label",i({className:(null==E?void 0:E.readOnly)?"readOnly":"form-label",style:{margin:0}},{children:C}))]})),t("div",i({style:{display:"flex",alignItems:"center",gap:"12px",flexWrap:"wrap"}},{children:[o("div",i({className:"checkbox-group",style:{display:"flex",gap:"16px"}},{children:y.map(function(e){var n,r,l=w["scope_".concat(e)],s="tier-".concat(p,"-").concat(e.replace(/\s+/g,"-").toLowerCase());return t("div",i({className:"checkbox-item",style:{display:"flex",alignItems:"center",gap:"6px",position:"relative"}},{children:[o("input",{type:"radio",name:"scope-tiers-".concat(p),id:s,checked:null===(n=v.tiers)||void 0===n?void 0:n.includes(e),onChange:function(){b("tiers",[e])},disabled:(null==E?void 0:E.readOnly)||!1,style:{position:"absolute",opacity:0,cursor:"pointer",width:"16px",height:"16px",zIndex:1}}),o("div",i({style:{width:"16px",height:"16px",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s ease",boxShadow:l?"0 0 14px 4px rgba(37, 99, 235, 0.35)":"none",borderRadius:"50%"}},{children:(null===(r=v.tiers)||void 0===r?void 0:r.includes(e))?o("div",{style:{width:"16px",height:"16px",borderRadius:"50%",border:"5px solid #2563EB",backgroundColor:"white",boxSizing:"border-box"}}):o("div",{style:{width:"16px",height:"16px",border:"1px solid #64748B",borderRadius:"50%",backgroundColor:"white",boxSizing:"border-box"}})})),o("label",i({style:{color:(null==E?void 0:E.readOnly)?"#9CA3AF":void 0,cursor:(null==E?void 0:E.readOnly)?"not-allowed":"pointer",margin:0,fontSize:"14px"},htmlFor:s},{children:e}))]}),s)})})),o("div",i({style:{width:"fit-content"}},{children:o(a,i({description:null!=D?D:""},{children:z&&t("button",i({onClick:function(e){e.preventDefault(),null==k||k()},style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"2px",padding:"2px 6px ",flexShrink:0,border:"none",backgroundColor:"transparent",borderRadius:"4px",cursor:"pointer",outline:"none",maxWidth:"fit-content",transition:"background-color 0.2s ease",marginTop:"6px",marginLeft:"6px"}},{children:[j||o(r,{}),o(I?l:s,{size:16})]}))}))}))]})),T&&o("div",i({style:{color:"#ef4444",fontSize:"12px",marginTop:"4px"}},{children:T}))]})),L&&!M&&!T&&o("div",i({style:{color:"#ef4444",fontSize:"12px",marginTop:"4px"}},{children:L}))]}))}))};export{d as ScopeSection};
//# sourceMappingURL=ScopeSection.js.map
