"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),r=require("lucide-react"),s=require("@e-llm-studio/citation"),o=require("./_svg/ButtonCognitiveIcon.js");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=t(i);exports.ViewIdentifiedFieldsCard=function(i){var t=i.data,l=i.cardMdComponents,d=a.default.useState(!0),p=d[0],g=d[1],c=a.default.useState({}),x=c[0],u=c[1];return n.jsxs("span",e.__assign({style:{display:"inline",verticalAlign:"middle",marginLeft:"4px"}},{children:[n.jsxs("button",e.__assign({onClick:function(){return g(!p)},style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"6px 4px",borderRadius:"8px",border:"none",backgroundColor:"#F5F3FF",color:"#6D28D9",fontWeight:500,fontSize:"14px",cursor:"pointer"}},{children:[n.jsx(r.FileText,{size:15}),n.jsx("span",{children:"View Identified Details"}),p?n.jsx(r.ChevronUp,{size:16}):n.jsx(r.ChevronDown,{size:16})]})),p&&n.jsxs("div",e.__assign({style:{position:"relative",zIndex:10,marginTop:"8px",marginBottom:"8px",width:"100%",minWidth:"300px",border:"1px solid #F1F5F9",borderRadius:"8px",backgroundColor:"#FFFFFF",padding:"12px",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1)"}},{children:[n.jsx("div",e.__assign({style:{fontSize:"14px",fontWeight:600,color:"#475569",marginBottom:"4px"}},{children:t.title})),n.jsx("div",e.__assign({style:{backgroundColor:"#F8FAFC",borderRadius:"8px",padding:"12px",display:"flex",flexDirection:"column",gap:"12px"}},{children:t.fields.map(function(i,t){var a=x[t];return n.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:"6px"}},{children:[n.jsxs("div",e.__assign({style:{fontSize:"14px",color:"#1E293B",lineHeight:"1.6",fontWeight:400}},{children:[n.jsxs("span",{children:[t+1,". ",i.label]}),i.reasoning&&n.jsxs("span",e.__assign({onClick:function(n){n.stopPropagation(),u(function(n){var i;return e.__assign(e.__assign({},n),((i={})[t]=!n[t],i))})},style:{display:"inline-flex",alignItems:"center",gap:"2px",marginLeft:"6px",cursor:"pointer",verticalAlign:"middle"}},{children:[n.jsx(o.ButtonCognitiveIcon,{size:18}),a?n.jsx(r.ChevronUp,{size:12,color:"#667085"}):n.jsx(r.ChevronDown,{size:12,color:"#667085"})]}))]})),i.reasoning&&a&&n.jsx("div",e.__assign({style:{width:"100%"}},{children:n.jsx(s.CognitiveDecisioningCard,{headerIcon:n.jsx(o.ButtonCognitiveIcon,{}),reasoning:i.reasoning.reason.replace(/\\n/g,"\n"),gap:i.reasoning.gap,score:i.reasoning.score,isOpen:!0,onToggle:function(){return u(function(n){var i;return e.__assign(e.__assign({},n),((i={})[t]=!1,i))})},hideTrigger:!0,mdComponents:l,styles:{pill:{gap:"2px",border:"none",backgroundColor:"transparent"}}})}))]}),t)})}))]}))]}))};
//# sourceMappingURL=ViewIdentifiedFieldsCard.js.map
