import{__assign as n}from"tslib";import{jsxs as e,jsx as r}from"react/jsx-runtime";import i from"react";import{FileText as t,ChevronUp as o,ChevronDown as l}from"lucide-react";import{CognitiveDecisioningCard as a}from"@e-llm-studio/citation";import{ButtonCognitiveIcon as p}from"./_svg/ButtonCognitiveIcon.js";var d=function(d){var s=d.data,c=d.cardMdComponents,g=i.useState(!0),u=g[0],x=g[1],m=i.useState({}),f=m[0],h=m[1];return s&&s.fields&&Array.isArray(s.fields)?e("span",n({style:{display:"inline",verticalAlign:"middle",marginLeft:"4px"}},{children:[e("button",n({onClick:function(){return x(!u)},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:[r(t,{size:15}),r("span",{children:"View Updated Details"}),r(u?o:l,{size:16})]})),u&&e("div",n({style:{position:"relative",zIndex:10,marginTop:"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:[r("div",n({style:{fontSize:"14px",fontWeight:600,color:"#475569",marginBottom:"4px"}},{children:s.title})),r("div",n({style:{backgroundColor:"#F8FAFC",borderRadius:"8px",padding:"12px",display:"flex",flexDirection:"column",gap:"12px"}},{children:s.fields.map(function(i,t){var d=i.segments&&i.segments.length>0?i.segments:[{type:"text",content:i.label}];return e("div",n({style:{display:"flex",flexDirection:"column",gap:"6px"}},{children:[e("div",n({style:{fontSize:"14px",color:"#1E293B",lineHeight:"1.6",fontWeight:400}},{children:[e("span",{children:[t+1,"."]}),d.map(function(i,a){if("text"===i.type)return r("span",n({style:{whiteSpace:"pre-wrap"}},{children:i.content}),a);if("reasoning"===i.type){var d="".concat(t,"-").concat(a),s=f[d];return e("span",n({onClick:function(e){e.stopPropagation(),h(function(e){var r;return n(n({},e),((r={})[d]=!e[d],r))})},style:{display:"inline-flex",alignItems:"center",gap:"2px",margin:"0 4px",cursor:"pointer",verticalAlign:"middle"}},{children:[r(p,{size:18}),r(s?o:l,{size:12,color:"#667085"})]}),a)}return null})]})),d.map(function(e,i){var o,l="".concat(t,"-").concat(i);return"reasoning"===e.type&&f[l]?r("div",n({style:{width:"100%",marginTop:"4px"}},{children:r(a,{headerIcon:r(p,{}),reasoning:null===(o=e.reasoning.reason)||void 0===o?void 0:o.replace(/\\n/g,"\n"),gap:e.reasoning.gap,score:e.reasoning.score,isOpen:!0,onToggle:function(){return h(function(e){var r;return n(n({},e),((r={})[l]=!1,r))})},hideTrigger:!0,mdComponents:c,styles:{pill:{gap:"2px",border:"none",backgroundColor:"transparent"}}})}),"card-".concat(i)):null})]}),t)})}))]}))]})):null};export{d as ViewFormUpdateCard};
//# sourceMappingURL=ViewFormUpdateCard.js.map
