@e-llm-studio/requirement-ai 0.0.183 → 0.0.185

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (18) hide show
  1. package/dist/cjs/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.js +1 -1
  2. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.js +1 -1
  3. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.js +1 -1
  4. package/dist/cjs/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js +1 -1
  5. package/dist/cjs/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.js +1 -1
  6. package/dist/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.js +1 -1
  7. package/dist/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.js +1 -1
  8. package/dist/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.js +1 -1
  9. package/dist/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js +1 -1
  10. package/dist/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.js +1 -1
  11. package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.d.ts +13 -1
  12. package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.d.ts.map +1 -1
  13. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.d.ts +17 -4
  14. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.d.ts.map +1 -1
  15. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.d.ts +5 -1
  16. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.d.ts.map +1 -1
  17. package/dist/types/src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.d.ts.map +1 -1
  18. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),a=require("react/jsx-runtime"),i=require("react"),s=require("../Popups/PopupDefaults.js"),n=require("react-markdown"),c=require("rehype-raw"),t=require("./CitationComponent.module.css.js"),l=require("lucide-react"),d=require("../icons/cognitiveBrain.svg.js"),r=require("../icons/aiMagic.svg.js"),o=require("./CitationAnchor.js");function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=_(i),x=_(n),f=_(c),m=function(i){var s=i.text,n=i.item;return a.jsx(x.default,e.__assign({rehypePlugins:[f.default],components:{ol:function(i){var s=i.children;return a.jsx("ol",e.__assign({className:t.default["md-ol"]},{children:s}))},ul:function(i){var s=i.children;return a.jsx("ul",e.__assign({className:t.default["md-ul"]},{children:s}))},li:function(i){var s=i.children;return a.jsx("li",e.__assign({className:t.default["md-li"]},{children:s}))},a:function(e){e.node;var i=e.href,s=e.children;return a.jsx(o.default,{href:i,children:s,metaData:{citations:n.citations,docData:n.docData}})}}},{children:s.replace(/<br\s*\/?>/gi,"\n")}))};exports.default=function(n){var c=n.item,o=n.title,_=void 0===o?"Cognitive Decisioning AI":o,x=n.relevanceScore,f=void 0===x?0:x,g=n.showRelevanceScore,v=void 0===g||g,h=n.reason,j=void 0===h?"No reasoning provided.":h,p=n.impact,N=void 0===p?"No Impact provided.":p,y=n.explaination,b=void 0===y?"No explaination provided.":y,C=n.gap,k=void 0===C?"None":C,H=n.onClose,B=void 0===H?function(){}:H,q=n.onAccept,D=n.onReject,T=n.showResolveBtns,A=void 0!==T&&T,I=n.sections,L=n.leftIcon,M=n.scoreIcon,P=n.className,R=n.customStyles,w=void 0===R?{}:R,E=n.onBackClick,F=n.isImpactNeeded,G=void 0===F||F,S=n.cognitiveTitle,U=void 0===S?"Cognitive Integrity":S,O=n.labels,z=void 0===O?{}:O,J=i.useMemo(function(){var e=Number(f);return Number.isNaN(e)?0:Math.max(0,Math.min(100,Math.round(e)))},[f]),K=i.useMemo(function(){var e=z&&z.noGapsText||"1. No gaps identified.";return function(e){if(!e)return!0;var a=e.trim().toLowerCase();return"none"===a||"no gap"===a||"no gaps"===a||"n/a"===a}(k)?e:k},[k]),Q=z&&z.impact||"Impact",V=z&&z.explanation||"Explaination",W=z&&z.decisionFactors||"Decision Making Factors",X=z&&z.gaps||"Gaps in Decision",Y=z&&z.accept||"Accept",Z=z&&z.reject||"Reject",$=z&&z.backAriaLabel||"Go back";return a.jsxs("div",e.__assign({className:"".concat(t.default["cite-acc"]," ").concat(P||""),style:e.__assign(e.__assign({},s.default.CitationAccordionDefaults.container),null==w?void 0:w.container)},{children:[E&&a.jsxs("div",e.__assign({className:t.default["cite-acc__backHeader"]},{children:[a.jsx("button",e.__assign({type:"button",className:t.default["cite-acc__backBtn"],onClick:function(e){e.stopPropagation(),E&&E()},"aria-label":$},{children:"‹"})),a.jsx("span",e.__assign({className:t.default["cite-acc__backTitle"]},{children:U}))]})),I&&I.length>0?I.map(function(i){return!1===i.show?null:a.jsxs("div",e.__assign({className:"".concat(t.default["cite-acc__explain-body"]," ").concat(i.bodyClassName||"")},{children:[a.jsxs("div",e.__assign({className:t.default["cite-acc__innerHeader"],style:e.__assign(e.__assign({},s.default.CitationAccordionDefaults.innerHeader),null==w?void 0:w.innerHeader)},{children:[a.jsx("div",e.__assign({className:t.default["cite-acc__innerHeaderLeft"]},{children:a.jsx("div",{children:a.jsx("div",e.__assign({className:t.default["cite-acc__innerTitle"]},{children:i.title}))})})),a.jsx("button",e.__assign({type:"button",onClick:function(e){e.stopPropagation(),B&&B()}},{children:a.jsx(l.ChevronUp,{})}))]})),a.jsx("div",e.__assign({className:"".concat(t.default["cite-acc__innerBody"]," text-sm text-gray-600"),style:e.__assign(e.__assign({},s.default.CitationAccordionDefaults.innerBody),null==w?void 0:w.innerBody)},{children:"string"==typeof i.content?a.jsx(m,{text:i.content,item:i.item||c||{}}):i.content}))]}),i.id||i.title)}):a.jsxs(a.Fragment,{children:[G&&a.jsxs("div",e.__assign({className:t.default["cite-acc__explain-body"]},{children:[a.jsxs("div",e.__assign({className:t.default["cite-acc__innerHeader"]},{children:[a.jsx("div",e.__assign({className:t.default["cite-acc__innerHeaderLeft"]},{children:a.jsx("div",{children:a.jsx("div",e.__assign({className:t.default["cite-acc__innerTitle"]},{children:Q}))})})),a.jsx("button",e.__assign({type:"button",onClick:function(e){e.stopPropagation(),B&&B()}},{children:a.jsx(l.ChevronUp,{})}))]})),a.jsx("div",e.__assign({className:"".concat(t.default["cite-acc__innerBody"]," text-sm text-gray-600")},{children:a.jsx(m,{text:N||"",item:c||{}})}))]})),a.jsxs("div",e.__assign({className:t.default["cite-acc__explain-body"]},{children:[a.jsx("div",e.__assign({className:t.default["cite-acc__innerHeader"]},{children:a.jsx("div",e.__assign({className:t.default["cite-acc__innerHeaderLeft"]},{children:a.jsx("div",{children:a.jsx("div",e.__assign({className:t.default["cite-acc__innerTitle"]},{children:V}))})}))})),a.jsx("div",e.__assign({className:"".concat(t.default["cite-acc__innerBody"]," text-sm text-gray-600")},{children:a.jsx(m,{text:b||"",item:{}})}))]})),A&&a.jsxs("div",e.__assign({className:t.default["cite-acc__btn-container"]},{children:[a.jsx("button",e.__assign({className:t.default["btn-reject"],onClick:D},{children:Z})),a.jsx("button",e.__assign({className:t.default["btn-accept"],onClick:q},{children:Y}))]})),a.jsxs("div",e.__assign({className:t.default["cite-acc__header"]},{children:[a.jsxs("div",e.__assign({className:t.default["cite-acc__headerLeft"]},{children:[a.jsx("span",e.__assign({className:t.default["cite-acc__titleIcon"]},{children:L?"function"==typeof L?u.default.createElement(L):L:a.jsx(d.ReactComponent,{})})),a.jsx("div",e.__assign({className:t.default["cite-acc__title"]},{children:_}))]})),a.jsx("div",e.__assign({className:t.default["cite-acc__headerRight"]},{children:v&&a.jsxs("span",e.__assign({className:t.default["cite-acc__scoreBadge"]},{children:[M?"function"==typeof M?u.default.createElement(M):M:a.jsx(r.ReactComponent,{}),a.jsxs("span",e.__assign({className:t.default["cite-acc__scoreText"]},{children:[J,"%"]}))]}))}))]})),a.jsxs("div",e.__assign({className:t.default["cite-acc__explain-body"]},{children:[a.jsx("div",e.__assign({className:t.default["cite-acc__innerHeader"]},{children:a.jsx("div",e.__assign({className:t.default["cite-acc__innerHeaderLeft"]},{children:a.jsx("div",{children:a.jsx("div",e.__assign({className:t.default["cite-acc__innerTitle"]},{children:W}))})}))})),a.jsx("div",e.__assign({className:"".concat(t.default["cite-acc__innerBody"]," text-sm text-gray-600")},{children:a.jsx(m,{text:j||"",item:c||{}})}))]})),a.jsxs("div",e.__assign({className:"".concat(t.default["cite-acc__explain-body"]," ").concat(t.default["cite-acc__explain-body_border"])},{children:[a.jsx("div",e.__assign({className:t.default["cite-acc__innerHeader"]},{children:a.jsx("div",e.__assign({className:t.default["cite-acc__innerHeaderLeft"]},{children:a.jsx("div",{children:a.jsx("div",e.__assign({className:t.default["cite-acc__innerTitle"]},{children:X}))})}))})),a.jsx("div",e.__assign({className:"".concat(t.default["cite-acc__innerBody"]," text-sm text-gray-600")},{children:a.jsx(m,{text:K||"",item:c||{}})}))]}))]})]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),a=require("react/jsx-runtime"),i=require("react"),s=require("../Popups/PopupDefaults.js"),n=require("react-markdown"),c=require("rehype-raw"),t=require("./CitationComponent.module.css.js"),l=require("lucide-react"),d=require("../icons/cognitiveBrain.svg.js"),r=require("../icons/aiMagic.svg.js"),o=require("./CitationAnchor.js");function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=_(i),f=_(n),x=_(c),m=function(i){var s=i.text,n=i.item;return a.jsx(f.default,e.__assign({rehypePlugins:[x.default],components:{ol:function(i){var s=i.children;return a.jsx("ol",e.__assign({className:t.default["md-ol"]},{children:s}))},ul:function(i){var s=i.children;return a.jsx("ul",e.__assign({className:t.default["md-ul"]},{children:s}))},li:function(i){var s=i.children;return a.jsx("li",e.__assign({className:t.default["md-li"]},{children:s}))},a:function(e){e.node;var i=e.href,s=e.children;return a.jsx(o.default,{href:i,children:s,metaData:{citations:n.citations,docData:n.docData}})}}},{children:s.replace(/<br\s*\/?>/gi,"\n")}))};exports.default=function(n){var c=n.item,o=n.title,_=void 0===o?"Cognitive Decisioning AI":o,f=n.relevanceScore,x=void 0===f?0:f,g=n.showRelevanceScore,v=void 0===g||g,h=n.reason,j=void 0===h?"No reasoning provided.":h,p=n.impact,N=void 0===p?"No Impact provided.":p,b=n.explaination,y=void 0===b?"No explaination provided.":b,C=n.gap,k=void 0===C?"None":C,B=n.onClose,H=void 0===B?function(){}:B,q=n.onAccept,D=n.onReject,A=n.showResolveBtns,T=void 0!==A&&A,I=n.sections,L=n.leftIcon,M=n.scoreIcon,w=n.className,P=n.customStyles,R=void 0===P?{}:P,S=n.actions,E=n.disableAllActions,F=void 0!==E&&E,G=n.actionBtnDisabledStyle,U=void 0===G?{}:G,O=n.onBackClick,z=n.isImpactNeeded,J=void 0===z||z,K=n.cognitiveTitle,Q=void 0===K?"Cognitive Integrity":K,V=n.labels,W=void 0===V?{}:V,X=i.useMemo(function(){var e=Number(x);return Number.isNaN(e)?0:Math.max(0,Math.min(100,Math.round(e)))},[x]),Y=i.useMemo(function(){var e=W&&W.noGapsText||"1. No gaps identified.";return function(e){if(!e)return!0;var a=e.trim().toLowerCase();return"none"===a||"no gap"===a||"no gaps"===a||"n/a"===a}(k)?e:k},[k]),Z=W&&W.impact||"Impact",$=W&&W.explanation||"Explaination",ee=W&&W.decisionFactors||"Decision Making Factors",ae=W&&W.gaps||"Gaps in Decision",ie=W&&W.accept||"Accept",se=W&&W.reject||"Reject",ne=W&&W.backAriaLabel||"Go back",ce=S||[{id:"reject",label:se,onClick:D,className:t.default["btn-reject"]},{id:"accept",label:ie,onClick:q,className:t.default["btn-accept"]}];return a.jsxs("div",e.__assign({className:"".concat(t.default["cite-acc"]," ").concat(w||""),style:e.__assign(e.__assign({},s.default.CitationAccordionDefaults.container),null==R?void 0:R.container)},{children:[O&&a.jsxs("div",e.__assign({className:t.default["cite-acc__backHeader"]},{children:[a.jsx("button",e.__assign({type:"button",className:t.default["cite-acc__backBtn"],onClick:function(e){e.stopPropagation(),O&&O()},"aria-label":ne},{children:"‹"})),a.jsx("span",e.__assign({className:t.default["cite-acc__backTitle"]},{children:Q}))]})),I&&I.length>0?I.map(function(i){return!1===i.show?null:a.jsxs("div",e.__assign({className:"".concat(t.default["cite-acc__explain-body"]," ").concat(i.bodyClassName||"")},{children:[a.jsxs("div",e.__assign({className:t.default["cite-acc__innerHeader"],style:e.__assign(e.__assign({},s.default.CitationAccordionDefaults.innerHeader),null==R?void 0:R.innerHeader)},{children:[a.jsx("div",e.__assign({className:t.default["cite-acc__innerHeaderLeft"]},{children:a.jsx("div",{children:a.jsx("div",e.__assign({className:t.default["cite-acc__innerTitle"]},{children:i.title}))})})),a.jsx("button",e.__assign({type:"button",onClick:function(e){e.stopPropagation(),H&&H()}},{children:a.jsx(l.ChevronUp,{})}))]})),a.jsx("div",e.__assign({className:"".concat(t.default["cite-acc__innerBody"]," text-sm text-gray-600"),style:e.__assign(e.__assign({},s.default.CitationAccordionDefaults.innerBody),null==R?void 0:R.innerBody)},{children:"string"==typeof i.content?a.jsx(m,{text:i.content,item:i.item||c||{}}):i.content}))]}),i.id||i.title)}):a.jsxs(a.Fragment,{children:[J&&a.jsxs("div",e.__assign({className:t.default["cite-acc__explain-body"]},{children:[a.jsxs("div",e.__assign({className:t.default["cite-acc__innerHeader"]},{children:[a.jsx("div",e.__assign({className:t.default["cite-acc__innerHeaderLeft"]},{children:a.jsx("div",{children:a.jsx("div",e.__assign({className:t.default["cite-acc__innerTitle"]},{children:Z}))})})),a.jsx("button",e.__assign({type:"button",onClick:function(e){e.stopPropagation(),H&&H()}},{children:a.jsx(l.ChevronUp,{})}))]})),a.jsx("div",e.__assign({className:"".concat(t.default["cite-acc__innerBody"]," text-sm text-gray-600")},{children:a.jsx(m,{text:N||"",item:c||{}})}))]})),a.jsxs("div",e.__assign({className:t.default["cite-acc__explain-body"]},{children:[a.jsx("div",e.__assign({className:t.default["cite-acc__innerHeader"]},{children:a.jsx("div",e.__assign({className:t.default["cite-acc__innerHeaderLeft"]},{children:a.jsx("div",{children:a.jsx("div",e.__assign({className:t.default["cite-acc__innerTitle"]},{children:$}))})}))})),a.jsx("div",e.__assign({className:"".concat(t.default["cite-acc__innerBody"]," text-sm text-gray-600")},{children:a.jsx(m,{text:y||"",item:{}})}))]})),T&&a.jsx("div",e.__assign({className:t.default["cite-acc__btn-container"]},{children:ce.map(function(i){var s=F||i.disabled;return a.jsx("button",e.__assign({className:i.className,onClick:s?void 0:i.onClick,disabled:s,style:e.__assign(e.__assign({},i.style),s?e.__assign(e.__assign({opacity:.5,cursor:"not-allowed"},U),i.disabledStyle):{})},{children:i.label}),i.id)})})),a.jsxs("div",e.__assign({className:t.default["cite-acc__header"]},{children:[a.jsxs("div",e.__assign({className:t.default["cite-acc__headerLeft"]},{children:[a.jsx("span",e.__assign({className:t.default["cite-acc__titleIcon"]},{children:L?"function"==typeof L?u.default.createElement(L):L:a.jsx(d.ReactComponent,{})})),a.jsx("div",e.__assign({className:t.default["cite-acc__title"]},{children:_}))]})),a.jsx("div",e.__assign({className:t.default["cite-acc__headerRight"]},{children:v&&a.jsxs("span",e.__assign({className:t.default["cite-acc__scoreBadge"]},{children:[M?"function"==typeof M?u.default.createElement(M):M:a.jsx(r.ReactComponent,{}),a.jsxs("span",e.__assign({className:t.default["cite-acc__scoreText"]},{children:[X,"%"]}))]}))}))]})),a.jsxs("div",e.__assign({className:t.default["cite-acc__explain-body"]},{children:[a.jsx("div",e.__assign({className:t.default["cite-acc__innerHeader"]},{children:a.jsx("div",e.__assign({className:t.default["cite-acc__innerHeaderLeft"]},{children:a.jsx("div",{children:a.jsx("div",e.__assign({className:t.default["cite-acc__innerTitle"]},{children:ee}))})}))})),a.jsx("div",e.__assign({className:"".concat(t.default["cite-acc__innerBody"]," text-sm text-gray-600")},{children:a.jsx(m,{text:j||"",item:c||{}})}))]})),a.jsxs("div",e.__assign({className:"".concat(t.default["cite-acc__explain-body"]," ").concat(t.default["cite-acc__explain-body_border"])},{children:[a.jsx("div",e.__assign({className:t.default["cite-acc__innerHeader"]},{children:a.jsx("div",e.__assign({className:t.default["cite-acc__innerHeaderLeft"]},{children:a.jsx("div",{children:a.jsx("div",e.__assign({className:t.default["cite-acc__innerTitle"]},{children:ae}))})}))})),a.jsx("div",e.__assign({className:"".concat(t.default["cite-acc__innerBody"]," text-sm text-gray-600")},{children:a.jsx(m,{text:Y||"",item:c||{}})}))]}))]})]}))};
2
2
  //# sourceMappingURL=CognitiveComponent.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),n=require("lucide-react"),s=require("react"),o=require("./ToneToggle.js");require("../CognitiveComponents/CitationComponent.module.css.js");var t=require("../icons/cognitiveBrain.svg.js"),l=require("../icons/aiMagic.svg.js"),a=[{color:"#1D9E75",angle:-90,arcD:"M1 13 A10 10 0 0 1 1 13"},{color:"#BA7517",angle:0,arcD:"M1 13 A10 10 0 0 1 11 3"},{color:"#E24B4A",angle:90,arcD:"M1 13 A10 10 0 0 1 21 13"}],r=function(n){var s=n.toneIndex,o=n.configs,t=void 0===o?a:o,l=t[Math.min(s,t.length-1)]||t[1]||t[0],r=l.color,d=l.angle,c=l.arcD,g=(d-90)*Math.PI/180,_=11+9*Math.cos(g),v=13+9*Math.sin(g);return i.jsxs("svg",e.__assign({width:"22",height:"14",viewBox:"0 0 22 14",fill:"none"},{children:[i.jsx("path",{d:"M1 13 A10 10 0 0 1 21 13",stroke:"#e5e5e5",strokeWidth:"2.5",strokeLinecap:"round"}),i.jsx("path",{d:c,stroke:r,strokeWidth:"2.5",strokeLinecap:"round"}),i.jsx("line",{x1:"11",y1:"13",x2:_,y2:v,stroke:r,strokeWidth:"2",strokeLinecap:"round"})]}))},d=function(n){var s=n.type,o=n.customStyles,t=void 0===o?{}:o,l=e.__assign(e.__assign({},{High:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #FECACA",background:"#FEF2F2",color:"#B91C1C",fontSize:"11px",fontWeight:"500"},Medium:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #F2E5A1",background:"#FFFBEB",color:"#B45309",fontSize:"11px",fontWeight:"500"},Low:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #8098F9",background:"#DBEAFE",color:"#444CE7",fontSize:"11px",fontWeight:"500"}}),t),a=l[s]||l.Medium;return i.jsx("div",e.__assign({style:a},{children:s}))},c=["Lenient","Balanced","Aggressive"],g={Lenient:"#1D9E75",Balanced:"#BA7517",Aggressive:"#E24B4A"},_={width:"350px",background:"#fff",border:"1px solid #ddd",borderRadius:"8px",padding:"16px",maxHeight:"400px",overflow:"auto"},v={display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12},u={fontSize:11,fontWeight:500,letterSpacing:"0.08em",color:"#E24B4A",textTransform:"uppercase"},p={fontSize:15,fontWeight:500,margin:"0 0 8px",color:"#111"},x={fontSize:13,color:"#666",lineHeight:1.6,margin:"0 0 14px"},m={marginBottom:14,borderTop:"0.5px solid #eee",paddingTop:12},y={display:"flex",alignItems:"center",gap:6,background:"none",border:"none",cursor:"pointer",padding:0,width:"100%"},h={fontSize:11,fontWeight:500,textTransform:"uppercase",letterSpacing:"0.08em",color:"#E24B4A"},f={display:"flex",gap:8,marginBottom:18},S={flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:5,fontSize:12,fontWeight:500,padding:"7px 4px",borderRadius:8,border:"0.5px solid #ccc",background:"#fff",cursor:"pointer"},j={background:"none",border:"none",cursor:"pointer",fontSize:16,color:"#888",lineHeight:1,padding:0},b={borderTop:"0.5px solid #eee",paddingTop:14},C={display:"flex",alignItems:"center",width:"100%",background:"none",border:"none",cursor:"pointer",padding:0,marginBottom:4},I={cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"12px",borderTop:"1px solid #eee",borderBottom:"none",paddingLeft:"12px",paddingRight:"12px"},B={display:"flex",alignItems:"center",gap:"4px",minWidth:0,flex:"1 1 auto",overflow:"hidden"},k={width:"28px",height:"28px",display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 28px"},D={fontSize:"13px",color:"#101828",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},T={display:"flex",alignItems:"center",gap:"10px",flex:"0 0 auto",minWidth:0,flexWrap:"nowrap"},A={display:"flex",padding:"4px 8px",alignItems:"center",gap:"4px",borderRadius:"var(--chip-border-radius, 16px)",border:"1px solid var(--Primitive-Gray-300, #d0d5dd)",flex:"0 1 auto",minWidth:0},w={color:"var(--Primitive-Purple-600, #6938ef)",fontFamily:"Inter",fontSize:"12px",fontStyle:"normal",fontWeight:500,lineHeight:"150%"};exports.default=function(z){var R,W,E,L,M,F,H,N,q,P,O,G,X,J,K,Q,U,V,Y,Z=z.onClose,$=z.aiReason,ee=z.onAccept,ie=z.onReject,ne=z.onIterate,se=z.initialTone,oe=z.onRegenerate,te=z.labels,le=void 0===te?{}:te,ae=z.toneLevelsConfig,re=void 0===ae?c:ae,de=z.toneColorsConfig,ce=void 0===de?g:de,ge=z.dialConfigs,_e=void 0===ge?a:ge,ve=z.customStyles,ue=void 0===ve?{}:ve,pe=z.severityChipStyles,xe=void 0===pe?{}:pe,me=z.customIcons,ye=void 0===me?{}:me,he=z.onOpenCognitive,fe=z.showTone,Se=void 0===fe||fe,je=z.cognitiveSectionStyle,be=void 0===je?{}:je,Ce=z.cognitiveScoreBadgeStyle,Ie=void 0===Ce?{}:Ce,Be=z.cognitiveScoreTextStyle,ke=void 0===Be?{}:Be,De=z.cognitiveStyles,Te=void 0===De?{}:De,Ae=z.cognitiveClassNames,we=void 0===Ae?{}:Ae,ze=z.cognitiveTitle,Re=void 0===ze?"Cognitive Integrity":ze,We=z.cognitiveLeftIcon,Ee=z.showCognitiveRightArrow,Le=void 0===Ee||Ee,Me=z.isStreaming,Fe=re.findIndex(function(e){return e===se});-1===Fe&&(Fe=1);var He=s.useState(!0),Ne=He[0],qe=He[1],Pe=s.useState(!1),Oe=Pe[0],Ge=Pe[1],Xe=s.useState(Fe),Je=Xe[0],Ke=Xe[1],Qe=s.useState(Fe)[0],Ue=re[Je],Ve=ce[Ue]||"#BA7517",Ye=Je!==Qe;return i.jsxs("div",e.__assign({onClick:function(e){return e.stopPropagation()},style:e.__assign(e.__assign({},_),null===(R=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===R?void 0:R.root)},{children:[i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},v),null===(W=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===W?void 0:W.header)},{children:[i.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:6}},{children:[i.jsx("span",{children:ye.summaryIcon||i.jsx(n.Info,{size:16,color:"#E24B4A"})}),i.jsx("span",e.__assign({style:e.__assign(e.__assign({},u),null===(E=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===E?void 0:E.title)},{children:le.summaryHeader||"Summary"}))]})),i.jsx("button",e.__assign({onClick:Z,style:e.__assign(e.__assign({},j),null===(L=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===L?void 0:L.closeBtn)},{children:"✕"}))]})),i.jsx("p",e.__assign({style:e.__assign(e.__assign({},p),null===(M=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===M?void 0:M.bodyText)},{children:null===(F=null==$?void 0:$.deviation_details)||void 0===F?void 0:F.deviation_title})),i.jsx("p",e.__assign({style:e.__assign(e.__assign({},x),null===(H=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===H?void 0:H.summary)},{children:null===(N=null==$?void 0:$.deviation_details)||void 0===N?void 0:N.deviation_summary})),i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},m),null===(q=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===q?void 0:q.impactContainer)},{children:[i.jsxs("div",e.__assign({style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},{children:[i.jsxs("button",e.__assign({onClick:function(){return qe(!Ne)},style:e.__assign(e.__assign({},y),null===(P=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===P?void 0:P.impactToggle)},{children:[i.jsx("span",e.__assign({style:e.__assign(e.__assign({},h),null===(O=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===O?void 0:O.impactToggleLabel)},{children:le.impactHeader||"Impact"})),i.jsx("span",e.__assign({style:{fontSize:12,color:"#E24B4A",transition:"transform 0.2s",display:"flex",alignItems:"center",transform:Ne?"rotate(180deg)":"rotate(0deg)"}},{children:i.jsx(n.ChevronDown,{size:16,color:"#E24B4A"})}))]})),i.jsx(d,{type:(null==$?void 0:$.severity)||"Medium",customStyles:xe})]})),Ne&&i.jsx("p",e.__assign({style:{fontSize:13,color:"#666",lineHeight:1.6,margin:"8px 0 0"}},{children:null!==(X=null===(G=null==$?void 0:$.deviation_details)||void 0===G?void 0:G.deviation_impact)&&void 0!==X?X:le.fallbackImpact||"This change reduces compliance obligations and lowers contractual risk thresholds."}))]})),i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},f),null===(J=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===J?void 0:J.actionContainer)},{children:[i.jsxs("button",e.__assign({style:e.__assign(e.__assign(e.__assign({},S),null===(K=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===K?void 0:K.actionBtn),{color:"#64748B"}),onClick:ne},{children:[ye.iterateIcon||i.jsx(n.PenLine,{size:16,color:"#64748B"}),le.btnIterate||"Iterate"]}),"Iterate"),i.jsxs("button",e.__assign({style:e.__assign(e.__assign(e.__assign({},S),null===(Q=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===Q?void 0:Q.actionBtn),{color:"#10B981"}),onClick:ee},{children:[ye.acceptIcon||i.jsx(n.CheckCircle,{size:16,color:"#10B981"}),le.btnAccept||"Approve"]}),"Accept"),i.jsxs("button",e.__assign({style:e.__assign(e.__assign(e.__assign({},S),null===(U=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===U?void 0:U.actionBtn),{color:"#DC2626"}),onClick:ie},{children:[ye.rejectIcon||i.jsx(n.XCircle,{size:16,color:"#DC2626"}),le.btnReject||"Reject"]}),"reject")]})),Se&&i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},b),null===(V=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===V?void 0:V.toneContainer)},{children:[i.jsxs("button",e.__assign({onClick:function(){return Ge(!Oe)},style:e.__assign(e.__assign({},C),null===(Y=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===Y?void 0:Y.toneToggleBtn)},{children:[i.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:8}},{children:[i.jsx(r,{toneIndex:Je,configs:_e}),i.jsx("span",e.__assign({style:{fontSize:13,fontWeight:500,color:"#111"}},{children:le.toneHeader||"Redline Tone"}))]})),i.jsx("span",e.__assign({style:{transition:"transform 0.2s",display:"flex",alignItems:"center",transform:Oe?"rotate(180deg)":"rotate(0deg)"}},{children:i.jsx(n.ChevronDown,{size:16,color:"#111"})}))]})),Oe&&i.jsxs(i.Fragment,{children:[i.jsx("p",e.__assign({style:{fontSize:12,color:"#888",margin:"0 0 12px"}},{children:le.toneDescription||"Controls how assertively AI is redlining"})),i.jsx(o.ToneToggle,{isDirty:Ye,onToneChange:function(e){Ke(e)},toneColor:Ve,toneIndex:Je,onClickRegenerate:function(){return null==oe?void 0:oe(Ue)},toneLabels:re,isStreaming:Me,aiReason:$})]})]})),he&&i.jsxs("div",e.__assign({className:null==we?void 0:we.section,onClick:function(e){e.stopPropagation(),he&&he(e)},style:e.__assign(e.__assign(e.__assign({},I),null==Te?void 0:Te.section),be)},{children:[i.jsxs("div",e.__assign({className:null==we?void 0:we.headerLeft,style:e.__assign(e.__assign({},B),null==Te?void 0:Te.headerLeft)},{children:[i.jsx("span",e.__assign({className:null==we?void 0:we.titleIcon,style:e.__assign(e.__assign({},k),null==Te?void 0:Te.titleIcon)},{children:null!=We?We:i.jsx(t.ReactComponent,{})})),i.jsx("div",e.__assign({className:null==we?void 0:we.cognitiveTitle,style:e.__assign(e.__assign({},D),null==Te?void 0:Te.cognitiveTitle)},{children:Re}))]})),i.jsxs("div",e.__assign({className:null==we?void 0:we.headerRight,style:e.__assign(e.__assign({},T),null==Te?void 0:Te.headerRight)},{children:[void 0!==(null==$?void 0:$.relevance_score)&&null!==(null==$?void 0:$.relevance_score)?i.jsxs("span",e.__assign({className:null==we?void 0:we.scoreBadge,style:e.__assign(e.__assign(e.__assign({},A),null==Te?void 0:Te.scoreBadge),Ie)},{children:[i.jsx(l.ReactComponent,{}),i.jsxs("span",e.__assign({className:null==we?void 0:we.scoreText,style:e.__assign(e.__assign(e.__assign({},w),null==Te?void 0:Te.scoreText),ke)},{children:[Math.round(Number($.relevance_score)),"%"]}))]})):null,Le&&i.jsx("span",e.__assign({style:{display:"flex",alignItems:"center"}},{children:i.jsx(n.ChevronRight,{size:16,color:"#64748B"})}))]}))]}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),n=require("lucide-react"),s=require("react"),o=require("./ToneToggle.js");require("../CognitiveComponents/CitationComponent.module.css.js");var t=require("../icons/cognitiveBrain.svg.js"),l=require("../icons/aiMagic.svg.js"),a=[{color:"#1D9E75",angle:-90,arcD:"M1 13 A10 10 0 0 1 1 13"},{color:"#BA7517",angle:0,arcD:"M1 13 A10 10 0 0 1 11 3"},{color:"#E24B4A",angle:90,arcD:"M1 13 A10 10 0 0 1 21 13"}],r=function(n){var s=n.toneIndex,o=n.configs,t=void 0===o?a:o,l=t[Math.min(s,t.length-1)]||t[1]||t[0],r=l.color,d=l.angle,c=l.arcD,g=(d-90)*Math.PI/180,_=11+9*Math.cos(g),v=13+9*Math.sin(g);return i.jsxs("svg",e.__assign({width:"22",height:"14",viewBox:"0 0 22 14",fill:"none"},{children:[i.jsx("path",{d:"M1 13 A10 10 0 0 1 21 13",stroke:"#e5e5e5",strokeWidth:"2.5",strokeLinecap:"round"}),i.jsx("path",{d:c,stroke:r,strokeWidth:"2.5",strokeLinecap:"round"}),i.jsx("line",{x1:"11",y1:"13",x2:_,y2:v,stroke:r,strokeWidth:"2",strokeLinecap:"round"})]}))},d=function(n){var s=n.type,o=n.customStyles,t=void 0===o?{}:o,l=e.__assign(e.__assign({},{High:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #FECACA",background:"#FEF2F2",color:"#B91C1C",fontSize:"11px",fontWeight:"500"},Medium:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #F2E5A1",background:"#FFFBEB",color:"#B45309",fontSize:"11px",fontWeight:"500"},Low:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #8098F9",background:"#DBEAFE",color:"#444CE7",fontSize:"11px",fontWeight:"500"}}),t),a=l[s]||l.Medium;return i.jsx("div",e.__assign({style:a},{children:s}))},c=["Lenient","Balanced","Aggressive"],g={Lenient:"#1D9E75",Balanced:"#BA7517",Aggressive:"#E24B4A"},_={width:"350px",background:"#fff",border:"1px solid #ddd",borderRadius:"8px",padding:"16px",maxHeight:"400px",overflow:"auto"},v={display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12},u={fontSize:11,fontWeight:500,letterSpacing:"0.08em",color:"#E24B4A",textTransform:"uppercase"},p={fontSize:15,fontWeight:500,margin:"0 0 8px",color:"#111"},x={fontSize:13,color:"#666",lineHeight:1.6,margin:"0 0 14px"},m={marginBottom:14,borderTop:"0.5px solid #eee",paddingTop:12},y={display:"flex",alignItems:"center",gap:6,background:"none",border:"none",cursor:"pointer",padding:0,width:"100%"},h={fontSize:11,fontWeight:500,textTransform:"uppercase",letterSpacing:"0.08em",color:"#E24B4A"},f={display:"flex",gap:8,marginBottom:18},S={flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:5,fontSize:12,fontWeight:500,padding:"7px 4px",borderRadius:8,border:"0.5px solid #ccc",background:"#fff",cursor:"pointer"},j={background:"none",border:"none",cursor:"pointer",fontSize:16,color:"#888",lineHeight:1,padding:0},b={borderTop:"0.5px solid #eee",paddingTop:14},C={display:"flex",alignItems:"center",width:"100%",background:"none",border:"none",cursor:"pointer",padding:0,marginBottom:4},I={cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"12px",borderTop:"1px solid #eee",borderBottom:"none",paddingLeft:"12px",paddingRight:"12px"},B={display:"flex",alignItems:"center",gap:"4px",minWidth:0,flex:"1 1 auto",overflow:"hidden"},k={width:"28px",height:"28px",display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 28px"},D={fontSize:"13px",color:"#101828",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},A={display:"flex",alignItems:"center",gap:"10px",flex:"0 0 auto",minWidth:0,flexWrap:"nowrap"},T={display:"flex",padding:"4px 8px",alignItems:"center",gap:"4px",borderRadius:"var(--chip-border-radius, 16px)",border:"1px solid var(--Primitive-Gray-300, #d0d5dd)",flex:"0 1 auto",minWidth:0},w={color:"var(--Primitive-Purple-600, #6938ef)",fontFamily:"Inter",fontSize:"12px",fontStyle:"normal",fontWeight:500,lineHeight:"150%"};exports.default=function(z){var R,W,E,L,M,F,H,N,q,P,O,G,X,J,K,Q,U=z.onClose,V=z.aiReason,Y=z.onAccept,Z=z.onReject,$=z.onIterate,ee=z.initialTone,ie=z.onRegenerate,ne=z.labels,se=void 0===ne?{}:ne,oe=z.toneLevelsConfig,te=void 0===oe?c:oe,le=z.toneColorsConfig,ae=void 0===le?g:le,re=z.dialConfigs,de=void 0===re?a:re,ce=z.actions,ge=z.disableAllActions,_e=void 0!==ge&&ge,ve=z.customStyles,ue=void 0===ve?{}:ve,pe=z.severityChipStyles,xe=void 0===pe?{}:pe,me=z.customIcons,ye=void 0===me?{}:me,he=z.onOpenCognitive,fe=z.showTone,Se=void 0===fe||fe,je=z.cognitiveSectionStyle,be=void 0===je?{}:je,Ce=z.cognitiveScoreBadgeStyle,Ie=void 0===Ce?{}:Ce,Be=z.cognitiveScoreTextStyle,ke=void 0===Be?{}:Be,De=z.cognitiveStyles,Ae=void 0===De?{}:De,Te=z.cognitiveClassNames,we=void 0===Te?{}:Te,ze=z.cognitiveTitle,Re=void 0===ze?"Cognitive Integrity":ze,We=z.cognitiveLeftIcon,Ee=z.showCognitiveRightArrow,Le=void 0===Ee||Ee,Me=z.isStreaming,Fe=te.findIndex(function(e){return e===ee});-1===Fe&&(Fe=1);var He=s.useState(!0),Ne=He[0],qe=He[1],Pe=s.useState(!1),Oe=Pe[0],Ge=Pe[1],Xe=s.useState(Fe),Je=Xe[0],Ke=Xe[1],Qe=s.useState(Fe)[0],Ue=te[Je],Ve=ae[Ue]||"#BA7517",Ye=Je!==Qe,Ze=[{id:"iterate",icon:ye.iterateIcon||i.jsx(n.PenLine,{size:16,color:"#64748B"}),label:se.btnIterate||"Iterate",color:"#64748B",onClick:$},{id:"accept",icon:ye.acceptIcon||i.jsx(n.CheckCircle,{size:16,color:"#10B981"}),label:se.btnAccept||"Approve",color:"#10B981",onClick:Y},{id:"reject",icon:ye.rejectIcon||i.jsx(n.XCircle,{size:16,color:"#DC2626"}),label:se.btnReject||"Reject",color:"#DC2626",onClick:Z}],$e=ce||Ze;return i.jsxs("div",e.__assign({onClick:function(e){return e.stopPropagation()},style:e.__assign(e.__assign({},_),null===(R=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===R?void 0:R.root)},{children:[i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},v),null===(W=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===W?void 0:W.header)},{children:[i.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:6}},{children:[i.jsx("span",{children:ye.summaryIcon||i.jsx(n.Info,{size:16,color:"#E24B4A"})}),i.jsx("span",e.__assign({style:e.__assign(e.__assign({},u),null===(E=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===E?void 0:E.title)},{children:se.summaryHeader||"Summary"}))]})),i.jsx("button",e.__assign({onClick:U,style:e.__assign(e.__assign({},j),null===(L=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===L?void 0:L.closeBtn)},{children:"✕"}))]})),i.jsx("p",e.__assign({style:e.__assign(e.__assign({},p),null===(M=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===M?void 0:M.bodyText)},{children:null===(F=null==V?void 0:V.deviation_details)||void 0===F?void 0:F.deviation_title})),i.jsx("p",e.__assign({style:e.__assign(e.__assign({},x),null===(H=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===H?void 0:H.summary)},{children:null===(N=null==V?void 0:V.deviation_details)||void 0===N?void 0:N.deviation_summary})),i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},m),null===(q=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===q?void 0:q.impactContainer)},{children:[i.jsxs("div",e.__assign({style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},{children:[i.jsxs("button",e.__assign({onClick:function(){return qe(!Ne)},style:e.__assign(e.__assign({},y),null===(P=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===P?void 0:P.impactToggle)},{children:[i.jsx("span",e.__assign({style:e.__assign(e.__assign({},h),null===(O=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===O?void 0:O.impactToggleLabel)},{children:se.impactHeader||"Impact"})),i.jsx("span",e.__assign({style:{fontSize:12,color:"#E24B4A",transition:"transform 0.2s",display:"flex",alignItems:"center",transform:Ne?"rotate(180deg)":"rotate(0deg)"}},{children:i.jsx(n.ChevronDown,{size:16,color:"#E24B4A"})}))]})),i.jsx(d,{type:(null==V?void 0:V.severity)||"Medium",customStyles:xe})]})),Ne&&i.jsx("p",e.__assign({style:{fontSize:13,color:"#666",lineHeight:1.6,margin:"8px 0 0"}},{children:null!==(X=null===(G=null==V?void 0:V.deviation_details)||void 0===G?void 0:G.deviation_impact)&&void 0!==X?X:se.fallbackImpact||"This change reduces compliance obligations and lowers contractual risk thresholds."}))]})),i.jsx("div",e.__assign({style:e.__assign(e.__assign({},f),null===(J=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===J?void 0:J.actionContainer)},{children:$e.map(function(n){var s,o,t=_e||n.disabled,l=t?e.__assign(e.__assign({cursor:"not-allowed",opacity:.5},null===(s=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===s?void 0:s.actionBtnDisabled),n.disabledStyle):{};return i.jsxs("button",e.__assign({style:e.__assign(e.__assign(e.__assign(e.__assign(e.__assign({},S),null===(o=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===o?void 0:o.actionBtn),{color:n.color}),n.style),l),onClick:t?void 0:n.onClick,disabled:t},{children:[n.icon,n.label]}),n.id)})})),Se&&i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},b),null===(K=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===K?void 0:K.toneContainer)},{children:[i.jsxs("button",e.__assign({onClick:function(){return Ge(!Oe)},style:e.__assign(e.__assign({},C),null===(Q=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===Q?void 0:Q.toneToggleBtn)},{children:[i.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:8}},{children:[i.jsx(r,{toneIndex:Je,configs:de}),i.jsx("span",e.__assign({style:{fontSize:13,fontWeight:500,color:"#111"}},{children:se.toneHeader||"Redline Tone"}))]})),i.jsx("span",e.__assign({style:{transition:"transform 0.2s",display:"flex",alignItems:"center",transform:Oe?"rotate(180deg)":"rotate(0deg)"}},{children:i.jsx(n.ChevronDown,{size:16,color:"#111"})}))]})),Oe&&i.jsxs(i.Fragment,{children:[i.jsx("p",e.__assign({style:{fontSize:12,color:"#888",margin:"0 0 12px"}},{children:se.toneDescription||"Controls how assertively AI is redlining"})),i.jsx(o.ToneToggle,{isDirty:Ye,onToneChange:function(e){Ke(e)},toneColor:Ve,toneIndex:Je,onClickRegenerate:function(){return null==ie?void 0:ie(Ue)},toneLabels:te,isStreaming:Me,aiReason:V})]})]})),he&&i.jsxs("div",e.__assign({className:null==we?void 0:we.section,onClick:function(e){e.stopPropagation(),he&&he(e)},style:e.__assign(e.__assign(e.__assign({},I),null==Ae?void 0:Ae.section),be)},{children:[i.jsxs("div",e.__assign({className:null==we?void 0:we.headerLeft,style:e.__assign(e.__assign({},B),null==Ae?void 0:Ae.headerLeft)},{children:[i.jsx("span",e.__assign({className:null==we?void 0:we.titleIcon,style:e.__assign(e.__assign({},k),null==Ae?void 0:Ae.titleIcon)},{children:null!=We?We:i.jsx(t.ReactComponent,{})})),i.jsx("div",e.__assign({className:null==we?void 0:we.cognitiveTitle,style:e.__assign(e.__assign({},D),null==Ae?void 0:Ae.cognitiveTitle)},{children:Re}))]})),i.jsxs("div",e.__assign({className:null==we?void 0:we.headerRight,style:e.__assign(e.__assign({},A),null==Ae?void 0:Ae.headerRight)},{children:[void 0!==(null==V?void 0:V.relevance_score)&&null!==(null==V?void 0:V.relevance_score)?i.jsxs("span",e.__assign({className:null==we?void 0:we.scoreBadge,style:e.__assign(e.__assign(e.__assign({},T),null==Ae?void 0:Ae.scoreBadge),Ie)},{children:[i.jsx(l.ReactComponent,{}),i.jsxs("span",e.__assign({className:null==we?void 0:we.scoreText,style:e.__assign(e.__assign(e.__assign({},w),null==Ae?void 0:Ae.scoreText),ke)},{children:[Math.round(Number(V.relevance_score)),"%"]}))]})):null,Le&&i.jsx("span",e.__assign({style:{display:"flex",alignItems:"center"}},{children:i.jsx(n.ChevronRight,{size:16,color:"#64748B"})}))]}))]}))]}))};
2
2
  //# sourceMappingURL=DeviationSummary.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),s=require("lucide-react"),n=require("react"),i=require("./PopupDefaults.js");function o(e){var t=new Date(e);return isNaN(t.getTime())?e:new Date(e).toLocaleString("en-US",{month:"2-digit",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0}).replace(" AM","AM").replace(" PM","PM")}var r=function(){return t.jsxs("svg",e.__assign({width:"22",height:"22",viewBox:"0 0 22 22",fill:"none"},{children:[t.jsx("circle",{cx:"11",cy:"11",r:"10",stroke:"#22c55e",strokeWidth:"2",fill:"#f0fdf4"}),t.jsx("path",{d:"M6.5 11.5l3 3 6-6",stroke:"#22c55e",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}))},a=function(){return t.jsxs("svg",e.__assign({width:"22",height:"22",viewBox:"0 0 22 22",fill:"none"},{children:[t.jsx("circle",{cx:"11",cy:"11",r:"10",stroke:"#ef4444",strokeWidth:"2",fill:"#fff1f2"}),t.jsx("path",{d:"M7.5 7.5l7 7M14.5 7.5l-7 7",stroke:"#ef4444",strokeWidth:"2",strokeLinecap:"round"})]}))},d=function(){return t.jsx("svg",e.__assign({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},{children:t.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#94a3b8",strokeWidth:"1.8",strokeLinecap:"round"})}))},l=function(){return t.jsxs("svg",e.__assign({width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},{children:[t.jsx("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),t.jsx("path",{d:"M1.5 13.5c0-3.038 2.462-5.5 5-5.5s5 2.462 5 5.5",stroke:"#94a3b8",strokeWidth:"1.4",strokeLinecap:"round"}),t.jsx("path",{d:"M11 8.5l1.5 1.5 2.5-2.5",stroke:"#22c55e",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]}))},c=function(){return t.jsxs("svg",e.__assign({width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},{children:[t.jsx("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),t.jsx("path",{d:"M1.5 13.5c0-3.038 2.462-5.5 5-5.5s5 2.462 5 5.5",stroke:"#94a3b8",strokeWidth:"1.4",strokeLinecap:"round"}),t.jsx("path",{d:"M11.5 8l3 3m0-3l-3 3",stroke:"#ef4444",strokeWidth:"1.4",strokeLinecap:"round"})]}))},u=function(s){var n=s.open;return t.jsx("svg",e.__assign({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",style:{transform:n?"rotate(0deg)":"rotate(180deg)",transition:"transform 0.25s ease"}},{children:t.jsx("path",{d:"M4.5 11.25L9 6.75l4.5 4.5",stroke:"#64748b",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})}))},g=function(s){var n=s.color,i=void 0===n?"#3b82f6":n;return t.jsxs("svg",e.__assign({width:"15",height:"15",viewBox:"0 0 16 16",fill:"none"},{children:[t.jsx("path",{d:"M1.5 8A6.5 6.5 0 1 0 4 3.2",stroke:i,strokeWidth:"1.5",strokeLinecap:"round"}),t.jsx("path",{d:"M1.5 3.5v4h4",stroke:i,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M8 5v3.5l2 1.5",stroke:i,strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]}))},h=function(){return t.jsxs("svg",e.__assign({width:"15",height:"15",viewBox:"0 0 16 16",fill:"none"},{children:[t.jsx("path",{d:"M13.5 8a5.5 5.5 0 1 0-1.6 3.9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round"}),t.jsx("path",{d:"M13.5 13v-4.5H9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}))},x=function(){return t.jsxs("svg",e.__assign({width:"15",height:"15",viewBox:"0 0 16 16",fill:"none"},{children:[t.jsx("path",{d:"M2 8h12M10 4l4 4-4 4",stroke:"#64748b",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M4 5l-2 3 2 3",stroke:"#64748b",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]}))};function f(s){var n=s.title,i=s.open,o=s.onToggle,r=s.children;return t.jsxs("div",e.__assign({style:{maxHeight:"170px",overflow:"auto"}},{children:[t.jsxs("div",e.__assign({onClick:o,style:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",userSelect:"none",padding:"2px 0"}},{children:[t.jsx("span",e.__assign({style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"}},{children:n})),t.jsx(u,{open:i})]})),t.jsx("div",e.__assign({style:{maxHeight:i?300:0,opacity:i?1:0,overflow:"hidden",transition:"max-height 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.25s"}},{children:r}))]}))}function _(s){var n=s.icon,i=s.label,o=s.onClick,r=s.customStyle,a=void 0===r?{}:r,d=e.__assign({display:"flex",alignItems:"center",gap:7,padding:"8px 16px",background:"#f8fafc",border:"1.5px solid #e2e8f0",borderRadius:10,cursor:"pointer",fontSize:"12px",fontWeight:600,color:"#475569",fontFamily:"inherit",transition:"background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.12s",whiteSpace:"nowrap"},a);return t.jsxs("button",e.__assign({onClick:o,style:d,onMouseEnter:function(e){e.currentTarget.style.background="#f1f5f9",e.currentTarget.style.transform="translateY(-1px)",e.currentTarget.style.boxShadow="0 2px 8px rgba(0,0,0,0.07)"},onMouseLeave:function(e){e.currentTarget.style.background="#f8fafc",e.currentTarget.style.transform="",e.currentTarget.style.boxShadow=""}},{children:[n,i]}))}exports.ApprovedIcon=r,exports.ChevronIcon=u,exports.CloseIcon=d,exports.HistoryIcon=g,exports.IterateIcon=x,exports.RedlineCard=function(u){var p,j=u.status,k=u.onClose,b=u.impactText,v=u.secondText,y=u.actionTakenByName,m=u.actionTakenAtTime,B=void 0===m?"NA":m,C=u.onHistory,L=u.onIterate,R=u.onReinstate,w=u.onRevert,I=u.impactTitle,S=void 0===I?"Impact":I,M=u.customConfigs,W=void 0===M?{}:M,T=u.customStyles,D=void 0===T?{}:T,z=n.useState(!0),A=z[0],U=z[1],H=n.useState(!0),q=H[0],F=H[1],E=n.useState(!1),N=E[0],P=E[1],O={headerBg:"#f0fdf4",headerBorder:"#dcfce7",titleColor:"#166534",label:"Redline Approved",metaLabel:"Approved By",UserIcon:t.jsx(l,{}),StatusIcon:t.jsx(r,{}),secondTitle:"Original text",secondBg:"#f8fafc",secondBorder:"#e2e8f0",impactBox:!0,actions:[{icon:t.jsx(g,{}),label:"History",onClick:C},{icon:t.jsx(s.Undo2,{size:17}),label:"Revert",onClick:w},{icon:t.jsx(x,{}),label:"Iterate",onClick:L}]},Y={headerBg:"#fff1f2",headerBorder:"#fecdd3",titleColor:"#991b1b",label:"Redline Rejected",metaLabel:"Rejected By",UserIcon:t.jsx(c,{}),StatusIcon:t.jsx(a,{}),secondTitle:"Rejected Recommendation",secondBg:"#f8fafc",secondBorder:"#e2e8f0",impactBox:!1,actions:[{icon:t.jsx(g,{color:"#3b82f6"}),label:"History",onClick:C},{icon:t.jsx(h,{}),label:"Reinstate",onClick:R},{icon:t.jsx(x,{}),label:"Iterate",onClick:L}]},G={headerBg:"#E2E8F0",headerBorder:"none",titleColor:"#1E293B",label:"Redline Reverted",metaLabel:"Reverted By",UserIcon:t.jsx(l,{}),StatusIcon:t.jsx(s.Undo2,{size:17}),secondTitle:"Reverted redline",secondBg:"#F9FAFB",secondBorder:"#D0D5DD",impactBox:!1,actions:[{icon:t.jsx(g,{}),label:"History",onClick:C},{icon:t.jsx(x,{}),label:"Iterate",onClick:L}]};p="accepted"===j?O:"rejected"===j?Y:G;var J=e.__assign(e.__assign({},p),W[j]||{});return t.jsxs("div",e.__assign({style:e.__assign(e.__assign(e.__assign({},i.default.RedlineCardDefaults.root),{animation:N?"slideOut 0.26s cubic-bezier(0.4,0,1,1) forwards":i.default.RedlineCardDefaults.root.animation||"slideIn 0.32s cubic-bezier(0.22,1,0.36,1) both"}),D.root)},{children:[t.jsxs("div",e.__assign({style:e.__assign(e.__assign(e.__assign({},i.default.RedlineCardDefaults.header),{background:J.headerBg,borderBottom:"1.5px solid ".concat(J.headerBorder)}),D.header)},{children:[t.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:10}},{children:[J.StatusIcon,t.jsx("span",e.__assign({style:{fontSize:15,fontWeight:700,color:J.titleColor,letterSpacing:"-0.01em"}},{children:J.label}))]})),t.jsx("button",e.__assign({onClick:function(){P(!0),k()},style:{background:"none",border:"none",cursor:"pointer",padding:4,borderRadius:6,display:"flex",alignItems:"center"}},{children:t.jsx(d,{})}))]})),t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},i.default.RedlineCardDefaults.body),D.body)},{children:[t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},i.default.RedlineCardDefaults.meta),D.meta)},{children:[t.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:6,marginBottom:5}},{children:[J.UserIcon,t.jsx("span",e.__assign({style:{fontSize:12.5,color:"#94a3b8",fontWeight:500}},{children:J.metaLabel}))]})),t.jsxs("div",e.__assign({style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"}},{children:[y,", ",o(B)]}))]})),t.jsx("div",{style:e.__assign(e.__assign({},i.default.RedlineCardDefaults.divider),D.divider)}),t.jsx(f,e.__assign({title:S,open:A,onToggle:function(){return U(function(e){return!e})}},{children:t.jsx("p",e.__assign({style:e.__assign(e.__assign({},i.default.RedlineCardDefaults.impactText),D.impactText)},{children:b||""}))})),t.jsx("div",{style:e.__assign(e.__assign({},i.default.RedlineCardDefaults.divider),D.divider)}),t.jsx(f,e.__assign({title:J.secondTitle,open:q,onToggle:function(){return F(function(e){return!e})}},{children:t.jsx("div",e.__assign({style:e.__assign(e.__assign(e.__assign({},i.default.RedlineCardDefaults.secondSection),{background:J.secondBg,border:"1.5px solid ".concat(J.secondBorder)}),D.secondSection)},{children:v||""}))})),t.jsx("div",e.__assign({style:e.__assign(e.__assign({},i.default.RedlineCardDefaults.actionsContainer),D.actionsContainer)},{children:J.actions.map(function(e){return t.jsx(_,{icon:e.icon,label:e.label,onClick:e.onClick,customStyle:e.style},e.label)})}))]}))]}))},exports.ReinstateIcon=h,exports.RejectedIcon=a,exports.UserApprovedIcon=l,exports.UserRejectedIcon=c,exports.formatDate=o;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),s=require("lucide-react"),n=require("react"),i=require("./PopupDefaults.js");function o(e){var t=new Date(e);return isNaN(t.getTime())?e:new Date(e).toLocaleString("en-US",{month:"2-digit",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0}).replace(" AM","AM").replace(" PM","PM")}var r=function(){return t.jsxs("svg",e.__assign({width:"22",height:"22",viewBox:"0 0 22 22",fill:"none"},{children:[t.jsx("circle",{cx:"11",cy:"11",r:"10",stroke:"#22c55e",strokeWidth:"2",fill:"#f0fdf4"}),t.jsx("path",{d:"M6.5 11.5l3 3 6-6",stroke:"#22c55e",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}))},a=function(){return t.jsxs("svg",e.__assign({width:"22",height:"22",viewBox:"0 0 22 22",fill:"none"},{children:[t.jsx("circle",{cx:"11",cy:"11",r:"10",stroke:"#ef4444",strokeWidth:"2",fill:"#fff1f2"}),t.jsx("path",{d:"M7.5 7.5l7 7M14.5 7.5l-7 7",stroke:"#ef4444",strokeWidth:"2",strokeLinecap:"round"})]}))},d=function(){return t.jsx("svg",e.__assign({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},{children:t.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#94a3b8",strokeWidth:"1.8",strokeLinecap:"round"})}))},l=function(){return t.jsxs("svg",e.__assign({width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},{children:[t.jsx("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),t.jsx("path",{d:"M1.5 13.5c0-3.038 2.462-5.5 5-5.5s5 2.462 5 5.5",stroke:"#94a3b8",strokeWidth:"1.4",strokeLinecap:"round"}),t.jsx("path",{d:"M11 8.5l1.5 1.5 2.5-2.5",stroke:"#22c55e",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]}))},c=function(){return t.jsxs("svg",e.__assign({width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},{children:[t.jsx("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),t.jsx("path",{d:"M1.5 13.5c0-3.038 2.462-5.5 5-5.5s5 2.462 5 5.5",stroke:"#94a3b8",strokeWidth:"1.4",strokeLinecap:"round"}),t.jsx("path",{d:"M11.5 8l3 3m0-3l-3 3",stroke:"#ef4444",strokeWidth:"1.4",strokeLinecap:"round"})]}))},u=function(s){var n=s.open;return t.jsx("svg",e.__assign({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",style:{transform:n?"rotate(0deg)":"rotate(180deg)",transition:"transform 0.25s ease"}},{children:t.jsx("path",{d:"M4.5 11.25L9 6.75l4.5 4.5",stroke:"#64748b",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})}))},g=function(s){var n=s.color,i=void 0===n?"#3b82f6":n;return t.jsxs("svg",e.__assign({width:"15",height:"15",viewBox:"0 0 16 16",fill:"none"},{children:[t.jsx("path",{d:"M1.5 8A6.5 6.5 0 1 0 4 3.2",stroke:i,strokeWidth:"1.5",strokeLinecap:"round"}),t.jsx("path",{d:"M1.5 3.5v4h4",stroke:i,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M8 5v3.5l2 1.5",stroke:i,strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]}))},h=function(){return t.jsxs("svg",e.__assign({width:"15",height:"15",viewBox:"0 0 16 16",fill:"none"},{children:[t.jsx("path",{d:"M13.5 8a5.5 5.5 0 1 0-1.6 3.9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round"}),t.jsx("path",{d:"M13.5 13v-4.5H9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}))},x=function(){return t.jsxs("svg",e.__assign({width:"15",height:"15",viewBox:"0 0 16 16",fill:"none"},{children:[t.jsx("path",{d:"M2 8h12M10 4l4 4-4 4",stroke:"#64748b",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M4 5l-2 3 2 3",stroke:"#64748b",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]}))};function f(s){var n=s.title,i=s.open,o=s.onToggle,r=s.children;return t.jsxs("div",e.__assign({style:{maxHeight:"170px",overflow:"auto"}},{children:[t.jsxs("div",e.__assign({onClick:o,style:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",userSelect:"none",padding:"2px 0"}},{children:[t.jsx("span",e.__assign({style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"}},{children:n})),t.jsx(u,{open:i})]})),t.jsx("div",e.__assign({style:{maxHeight:i?300:0,opacity:i?1:0,overflow:"hidden",transition:"max-height 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.25s"}},{children:r}))]}))}function _(s){var n=s.icon,i=s.label,o=s.onClick,r=s.customStyle,a=void 0===r?{}:r,d=s.disabled,l=void 0!==d&&d,c=s.disabledStyle,u=void 0===c?{}:c,g=e.__assign(e.__assign({display:"flex",alignItems:"center",gap:7,padding:"8px 16px",background:"#f8fafc",border:"1.5px solid #e2e8f0",borderRadius:10,cursor:l?"not-allowed":"pointer",fontSize:"12px",fontWeight:600,color:"#475569",fontFamily:"inherit",transition:"background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.12s",whiteSpace:"nowrap",opacity:l?.5:1},a),l?u:{});return t.jsxs("button",e.__assign({onClick:l?void 0:o,disabled:l,style:g,onMouseEnter:function(e){l||(e.currentTarget.style.background="#f1f5f9",e.currentTarget.style.transform="translateY(-1px)",e.currentTarget.style.boxShadow="0 2px 8px rgba(0,0,0,0.07)")},onMouseLeave:function(e){l||(e.currentTarget.style.background="#f8fafc",e.currentTarget.style.transform="",e.currentTarget.style.boxShadow="")}},{children:[n,i]}))}exports.ApprovedIcon=r,exports.ChevronIcon=u,exports.CloseIcon=d,exports.HistoryIcon=g,exports.IterateIcon=x,exports.RedlineCard=function(u){var p,j=u.status,k=u.onClose,b=u.impactText,v=u.secondText,y=u.actionTakenByName,m=u.actionTakenAtTime,B=void 0===m?"NA":m,C=u.onHistory,L=u.onIterate,w=u.onReinstate,R=u.onRevert,I=u.disableAllActions,S=void 0!==I&&I,M=u.impactTitle,W=void 0===M?"Impact":M,T=u.customConfigs,D=void 0===T?{}:T,A=u.customStyles,z=void 0===A?{}:A,U=n.useState(!0),H=U[0],q=U[1],F=n.useState(!0),E=F[0],N=F[1],P=n.useState(!1),O=P[0],Y=P[1],G={headerBg:"#f0fdf4",headerBorder:"#dcfce7",titleColor:"#166534",label:"Redline Approved",metaLabel:"Approved By",UserIcon:t.jsx(l,{}),StatusIcon:t.jsx(r,{}),secondTitle:"Original text",secondBg:"#f8fafc",secondBorder:"#e2e8f0",impactBox:!0,actions:[{icon:t.jsx(g,{}),label:"History",onClick:C},{icon:t.jsx(s.Undo2,{size:17}),label:"Revert",onClick:R},{icon:t.jsx(x,{}),label:"Iterate",onClick:L}]},J={headerBg:"#fff1f2",headerBorder:"#fecdd3",titleColor:"#991b1b",label:"Redline Rejected",metaLabel:"Rejected By",UserIcon:t.jsx(c,{}),StatusIcon:t.jsx(a,{}),secondTitle:"Rejected Recommendation",secondBg:"#f8fafc",secondBorder:"#e2e8f0",impactBox:!1,actions:[{icon:t.jsx(g,{color:"#3b82f6"}),label:"History",onClick:C},{icon:t.jsx(h,{}),label:"Reinstate",onClick:w},{icon:t.jsx(x,{}),label:"Iterate",onClick:L}]},K={headerBg:"#E2E8F0",headerBorder:"none",titleColor:"#1E293B",label:"Redline Reverted",metaLabel:"Reverted By",UserIcon:t.jsx(l,{}),StatusIcon:t.jsx(s.Undo2,{size:17}),secondTitle:"Reverted redline",secondBg:"#F9FAFB",secondBorder:"#D0D5DD",impactBox:!1,actions:[{icon:t.jsx(g,{}),label:"History",onClick:C},{icon:t.jsx(x,{}),label:"Iterate",onClick:L}]};p="accepted"===j?G:"rejected"===j?J:K;var Q=e.__assign(e.__assign({},p),D[j]||{});return t.jsxs("div",e.__assign({style:e.__assign(e.__assign(e.__assign({},i.default.RedlineCardDefaults.root),{animation:O?"slideOut 0.26s cubic-bezier(0.4,0,1,1) forwards":i.default.RedlineCardDefaults.root.animation||"slideIn 0.32s cubic-bezier(0.22,1,0.36,1) both"}),z.root)},{children:[t.jsxs("div",e.__assign({style:e.__assign(e.__assign(e.__assign({},i.default.RedlineCardDefaults.header),{background:Q.headerBg,borderBottom:"1.5px solid ".concat(Q.headerBorder)}),z.header)},{children:[t.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:10}},{children:[Q.StatusIcon,t.jsx("span",e.__assign({style:{fontSize:15,fontWeight:700,color:Q.titleColor,letterSpacing:"-0.01em"}},{children:Q.label}))]})),t.jsx("button",e.__assign({onClick:function(){Y(!0),k()},style:{background:"none",border:"none",cursor:"pointer",padding:4,borderRadius:6,display:"flex",alignItems:"center"}},{children:t.jsx(d,{})}))]})),t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},i.default.RedlineCardDefaults.body),z.body)},{children:[t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},i.default.RedlineCardDefaults.meta),z.meta)},{children:[t.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:6,marginBottom:5}},{children:[Q.UserIcon,t.jsx("span",e.__assign({style:{fontSize:12.5,color:"#94a3b8",fontWeight:500}},{children:Q.metaLabel}))]})),t.jsxs("div",e.__assign({style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"}},{children:[y,", ",o(B)]}))]})),t.jsx("div",{style:e.__assign(e.__assign({},i.default.RedlineCardDefaults.divider),z.divider)}),t.jsx(f,e.__assign({title:W,open:H,onToggle:function(){return q(function(e){return!e})}},{children:t.jsx("p",e.__assign({style:e.__assign(e.__assign({},i.default.RedlineCardDefaults.impactText),z.impactText)},{children:b||""}))})),t.jsx("div",{style:e.__assign(e.__assign({},i.default.RedlineCardDefaults.divider),z.divider)}),t.jsx(f,e.__assign({title:Q.secondTitle,open:E,onToggle:function(){return N(function(e){return!e})}},{children:t.jsx("div",e.__assign({style:e.__assign(e.__assign(e.__assign({},i.default.RedlineCardDefaults.secondSection),{background:Q.secondBg,border:"1.5px solid ".concat(Q.secondBorder)}),z.secondSection)},{children:v||""}))})),t.jsx("div",e.__assign({style:e.__assign(e.__assign({},i.default.RedlineCardDefaults.actionsContainer),z.actionsContainer)},{children:Q.actions.map(function(s){return t.jsx(_,{icon:s.icon,label:s.label,onClick:s.onClick,customStyle:e.__assign(e.__assign({},s.style),z.actionBtn),disabled:S||s.disabled,disabledStyle:z.actionBtnDisabled},s.label)})}))]}))]}))},exports.ReinstateIcon=h,exports.RejectedIcon=a,exports.UserApprovedIcon=l,exports.UserRejectedIcon=c,exports.formatDate=o;
2
2
  //# sourceMappingURL=RedlineStatusCard.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),t=require("react-markdown"),o=require("rehype-raw"),a=require("./UserStoryWithCitation.module.css.js"),l=require("../../shared/useMarkdownSearch.js"),r=require("lucide-react"),s=require("@mui/material"),d=require("../../shared/UpdatedAnimationContent.js"),c=require("../../shared/GeneratedCodeCitation.js"),u=require("../../shared/CitationLoadingIndicator.js"),g=require("../RequirementAIWrapper/RequirementAIWrapper.js"),v=require("../../icons/CognitiveDecision.js"),f=require("../../icons/BrainRed.js"),h=require("../ai-reasoning/AiReasoningCitation.js"),p=require("../../icons/RelevanceScoreIcon.js"),m=require("../RecommendationBlock/RecommendationBlock.js"),C=require("../UserStoryCard/AttachedContext.js"),_=require("../ai-reasoning/AiReasoningCitationContent.js"),x=require("./components/InlineUpdatedComponent.js"),j=require("../segment/SegmentWrapper.js"),y=require("../../store/markdown-context.js");function S(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var R=S(i),I=S(t),w=S(o),b=i.createContext(!1),N=i.createContext({expandedInfo:null,setExpanded:function(){},reasonToRow:{current:new Map}}),k=i.createContext({rowId:""}),A=function(t){var o,l=t.aiReason,r=t.isHighConfidence,s=t.customStyle,d=t.customIcons,c=i.useContext(N),u=c.expandedInfo,g=c.setExpanded,h=c.reasonToRow,p=i.useContext(k).rowId,m=String(l.id);p&&h.current.set(m,p);var C=(null===(o=null==u?void 0:u.aiReason)||void 0===o?void 0:o.id)===l.id,_=r?(null==d?void 0:d.highConfidence)||n.jsx(v.default,{}):(null==d?void 0:d.lowConfidence)||n.jsx(f.default,{});return n.jsxs("button",e.__assign({className:a.default.aiReasoningButton,style:s,onClick:function(e){e.stopPropagation(),e.preventDefault(),g(C?null:p,C?null:l)}},{children:[_,C?n.jsx("i",{className:"pi pi-angle-up ".concat(r?a.default.aiReasoningIconHighConfidence:a.default.aiReasoningIconLowConfidence)}):n.jsx("i",{className:"pi pi-angle-down ".concat(r?a.default.aiReasoningIconHighConfidence:a.default.aiReasoningIconLowConfidence)})]}))},q=function(t){var o,l,r=t.children,s=t.node,d=t.customStyles,c=t.customIcons,u=i.useRef(Math.random().toString(36).slice(2)).current,g=i.useContext(N).expandedInfo,v=(null==g?void 0:g.rowId)===u,f=Array.isArray(null==s?void 0:s.children)?s.children.filter(function(e){return"element"===e.type}).length:1,h=null!==(l=null===(o=null==s?void 0:s.properties)||void 0===o?void 0:o.style)&&void 0!==l?l:void 0;return n.jsxs(k.Provider,e.__assign({value:{rowId:u}},{children:[n.jsx("tr",e.__assign({style:h?{cssText:h}:void 0},{children:r})),v&&(null==g?void 0:g.aiReason)&&n.jsx("tr",e.__assign({style:{width:"100%"}},{children:n.jsx("td",e.__assign({colSpan:f||1,className:a.default.tableExpandedCell},{children:n.jsx("div",e.__assign({className:a.default.tableExpandedCellInner},{children:n.jsx("div",e.__assign({className:a.default.tableExpandedCellContent},{children:n.jsx(_.default,{aiReason:g.aiReason,customIcons:c,customStyles:{aiReasoningContent:null==d?void 0:d.aiReasoningContent,aiReasoningAccordion:null==d?void 0:d.aiReasoningAccordion,aiReasoningMarkdown:null==d?void 0:d.aiReasoningMarkdown,aiReasoningPill:null==d?void 0:d.aiReasoningPill,webCitation:null==d?void 0:d.webCitation,stormeeCitation:null==d?void 0:d.stormeeCitation,waveformCitation:null==d?void 0:d.waveformCitation,imageCitation:null==d?void 0:d.imageCitation,fileCitation:null==d?void 0:d.fileCitation,appModCitation:null==d?void 0:d.appModCitation,rcaCitation:null==d?void 0:d.rcaCitation,readFileCitation:null==d?void 0:d.readFileCitation,loadingCitations:null==d?void 0:d.loadingCitations,chatCitation:null==d?void 0:d.chatCitation}})}))}))}))}))]}))};var E=["del","ins"];function M(e){return function(e,n,i){var t=n.join("|");return e.replace(new RegExp("<(".concat(t,")>([\\s\\S]*?)<\\/\\1>"),"gi"),function(e,n,t){return"<".concat(n,">").concat(i(t),"</").concat(n,">")})}(e,E,function(e){return e.split(/(<[^>]+>)/g).map(function(e){return!e||/^<[^>]+>$/.test(e)?e:function(e){if(!e)return e;var n=[];return e.replace(/`([^`\n]+)`/g,function(e,i){var t=n.push(i)-1;return"@@CODE_SPAN_".concat(t,"@@")}).replace(/\*\*([\s\S]+?)\*\*/g,"<strong>$1</strong>").replace(/__([\s\S]+?)__/g,"<strong>$1</strong>").replace(/@@CODE_SPAN_(\d+)@@/g,function(e,i){var t,o=null!==(t=n[Number(i)])&&void 0!==t?t:"";return"<code>".concat(o.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"),"</code>")})}(e)}).join("")})}exports.default=function(t){var o,v=t.message,f=t.noMarkdownContent,_=t.useMarkdown,S=void 0===_||_,k=t.isParent,E=t.scenario,T=t.showUserStoryDiff,U=void 0!==T&&T,P=t.aiReasoningsForBlock,L=t.isCitationLoadingDisplay,$=void 0!==L&&L,D=t.className;t.highConfidenceIcon,t.lowConfidenceIcon;var H=t.customStyles,O=t.customIcons,F=t.aiReasoningDiffView,B=t.userStoryCitations,W=t.artifactId,z=t.isCraflow,V=t.onCraAccept,G=t.onCraReject,Q=t.craFlowConfig,J=t.isDisplayHighlightControl,K=void 0!==J&&J,X=i.useRef(null),Y=g.useRequirementAI(),Z=Y.userStory,ee=Y.inlineUpdateComponentConfig,ne=Y.getAvgScoreForStory,ie=Y.setUserStory,te=Y.aiReasoning,oe=Y.setAiReasoning,ae=Y.customIcons,le=Y.searchQueryList,re=Y.searchQueryReasoningIdList,se=Y.currentHighlightIndex,de=Y.segmentComponentConfig,ce=null!=O?O:null==ae?void 0:ae.userStoryIcons;null==H||H.searchHighlight;var ue=l.useMarkdownSearch(X),ge=ue.search,ve=ue.clear,fe=i.useState("1"),he=fe[0],pe=fe[1],me=i.useState(null),Ce=me[0],_e=me[1],xe=i.useRef(new Map),je=i.useCallback(function(e,n){_e(e&&n?{rowId:e,aiReason:n}:null)},[]),ye=W?ne(W):0,Se=i.useState([]),Re=Se[0],Ie=Se[1],we=function(e){return null==e?"":"string"==typeof e?e:"number"==typeof e?String(e):Array.isArray(e)?e.map(we).join(""):R.default.isValidElement(e)?we(e.props.children):""},be=function(e){var n=e;return n=function(e){for(var n,i=/<updated[^>]*>[\s\S]*?<\/updated>/gi,t=[],o=new RegExp(i.source,i.flags);null!==(n=o.exec(e));){var a=n[0],l=a.match(/<deleted>([\s\S]*?)<\/deleted>/i),r=a.match(/<changed>([\s\S]*?)<\/changed>/i),s=function(e){return(e.match(/^\s*\d+\.\s/gm)||[]).length};t.push({index:n.index,endIndex:n.index+n[0].length,deletedItemCount:s((null==l?void 0:l[1])||""),changedItemCount:s((null==r?void 0:r[1])||"")})}if(0===t.length)return e;for(var d=e,c=function(e){var n=t[e],i=n.changedItemCount-n.deletedItemCount;if(0===i)return"continue";for(var o=!1,a=0,l=d.substring(0,n.index).split("\n").reverse();a<l.length;a++){var r=l[a].trim();if(""!==r){/^\d+\.\s/.test(r)&&(o=!0);break}}if(!o)return"continue";var s=n.endIndex,c=e+1<t.length?t[e+1].index:d.length,u=d.substring(s,c);u=u.replace(/^(\s*)(\d+)\.\s/gm,function(e,n,t){return"".concat(n).concat(parseInt(t,10)+i,". ")}),d=d.substring(0,s)+u+d.substring(c)},u=t.length-1;u>=0;u--)c(u);return d}(n=(n=(n=(n=(n=n.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,function(e,n){var i=n.replace(/ai_reasoning\$(\d+)/g,function(e,n){return"ai_reasoning$".concat(n,"-legacy")});return"<deleted>".concat(i,"</deleted>")})).replace(/<generatedCode([^>]*)>([\s\S]*?)<\/generatedCode>/gi,function(e,n,i){var t=btoa(encodeURIComponent(i.trim()));return"\n\n<generatedCode".concat(n,' data-raw="').concat(t,'"></generatedCode>\n\n')})).replace(/^(\s*[-*]|\s*\d+\.)\s*\n?\s*(<updated\b)/gm,"$1 $2")).replace(/(<segment\b([^>]*)>)([\s\S]*?)(<\/segment>)/gi,function(e,n,i,t,o){var a=t.match(/<table[\s\S]*?<\/table>/i);if(a){var l=btoa(encodeURIComponent(a[0]));return"<segment".concat(i,' data-table="').concat(l,'"></segment>')}return e})).replace(/<updated([^>]*)>([\s\S]*?)<\/updated>/gi,function(e,i,t,o){var a=n.substring(0,o),l=a.lastIndexOf("\n"),r=/^\s+[-*]\s/.test(a.substring(l+1))||/^\s+\d+\.\s/.test(a.substring(l+1)),s=/^\s*(\d+\.|\s*[-*])\s+$/.test(a.substring(l+1));if(r||s){var d=t;return d=(d=(d=(d=d.replace(/(<deleted>)\s*\n?\s*[-*]\s+/gi,"$1\n")).replace(/(<changed>)\s*\n?\s*[-*]\s+/gi,"$1\n")).replace(/(<deleted>)\s*\n?\s*\d+\.\s+/gi,"$1\n")).replace(/(<changed>)\s*\n?\s*\d+\.\s+/gi,"$1\n"),"<updated".concat(i,">").concat(d,"</updated>")}return e})),n=function(e){var n=e.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,function(e,n){var i=n.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <deleted>",{hadChange:i!==n}),"<deleted>".concat(i,"</deleted>")});return n.replace(/<changed>([\s\S]*?)<\/changed>/gi,function(e,n){var i=n.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <changed>",{hadChange:i!==n,preview:n.substring(0,120)}),"<changed>".concat(i,"</changed>")})}(n),n=M(n)},Ne=i.useMemo(function(){return v?be(v):v},[v]);i.useEffect(function(){Ie(P||te)},[P,te]);var ke=i.useMemo(function(){return{upt:function(i){var t;i.node;var o=i.children,a=e.__rest(i,["node","children"]),l=null==a?void 0:a.id,r=l?null===(t=l.split("$"))||void 0===t?void 0:t[1]:null,s=te.find(function(e){return e.id.toString()===r});return s?n.jsx(x.default,e.__assign({aiReason:s,customStyles:null==H?void 0:H.inlineUpdatedComponent,handleClickCognitiveDecision:null==ee?void 0:ee.handleClickCognitiveDecision,handleClickUpdatedPill:null==ee?void 0:ee.handleClickUpdatedPill,handleClickOutputValue:null==ee?void 0:ee.handleClickOutputValue,customIcons:null==ee?void 0:ee.customIcons},{children:o})):o},del:function(i){i.node;var t=i.children,o=e.__rest(i,["node","children"]);return n.jsx("span",e.__assign({className:a.default.deleted,style:null==H?void 0:H.deleted},o,{onClick:o.onclick},{children:t}))},ins:function(i){var t=i.children,o=e.__rest(i,["children"]);return n.jsx("span",e.__assign({className:a.default.inserted,style:null==H?void 0:H.inserted},o,{onClick:o.onclick},{children:t}))},preserved:function(i){var t=i.children,o=e.__rest(i,["children"]);return n.jsx("span",e.__assign({className:a.default.preserved,style:null==H?void 0:H.preserved},o,{onClick:o.onclick},{children:t}))},h1:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("h1",e.__assign({className:a.default.heading1,style:null==H?void 0:H.heading1},{children:t.children}))},h2:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("h2",e.__assign({className:a.default.heading2,style:null==H?void 0:H.heading2},{children:t.children}))},h3:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("h3",e.__assign({className:a.default.heading3,style:null==H?void 0:H.heading3},{children:t.children}))},b:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("b",e.__assign({className:a.default.bold,style:null==H?void 0:H.bold},{children:null==t?void 0:t.children}))},p:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("p",e.__assign({},t,{className:a.default.paragraph,style:null==H?void 0:H.paragraph},{children:t.children}))},updated:function(i){var t=i.node,o=e.__rest(i,["node"]);return n.jsx(d.default,e.__assign({},o,{showUserStoryDiff:U,currentUpdatedTagId:he,setCurrentUpdatedTagId:pe,userStory:Z,setUserStory:ie,setAiReasoning:oe,node:t,isCraflow:z,onCraAccept:V,onCraReject:G,customStyles:null==H?void 0:H.updatedContent,craFlowConfig:Q}))},ol:function(i){var t,o,l,r=i.node,s=e.__rest(i,["node"]),d=null!==(l=null!==(o=null===(t=null==r?void 0:r.properties)||void 0===t?void 0:t.start)&&void 0!==o?o:null==s?void 0:s.start)&&void 0!==l?l:void 0;return n.jsx("ol",e.__assign({className:a.default.orderedList,style:null==H?void 0:H.olist},d?{start:Number(d)}:{},{children:null==s?void 0:s.children}))},ul:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("ul",e.__assign({className:a.default.unorderedList,style:null==H?void 0:H.ulist},{children:null==t?void 0:t.children}))},table:function(i){var t=i.children;return n.jsx("div",e.__assign({className:a.default.tableWrapper},{children:n.jsx("table",e.__assign({className:a.default.table,style:null==H?void 0:H.table},{children:t}))}))},tr:function(e){var i=e.node,t=e.children;return n.jsx(q,{node:i,children:t,customStyles:H})},td:function(i){var t,o=i.node,a=i.children,l=null!==(t=null==o?void 0:o.properties)&&void 0!==t?t:{},r=l.style,s=e.__rest(l,["style"]);return n.jsx(b.Provider,e.__assign({value:!0},{children:n.jsx("td",e.__assign({},s,{style:r?{cssText:r}:void 0},{children:a}))}))},th:function(i){var t,o=i.node,a=i.children,l=null!==(t=null==o?void 0:o.properties)&&void 0!==t?t:{},r=l.style,s=e.__rest(l,["style"]);return n.jsx(b.Provider,e.__assign({value:!0},{children:n.jsx("th",e.__assign({},s,{style:r?{cssText:r}:void 0},{children:a}))}))},recommendation:function(i){var t;i.node;var o=e.__rest(i,["node"]),a="The AI has selected this content based on: ".concat((null===(t=null==o?void 0:o.children)||void 0===t?void 0:t[0])||"");return n.jsx(m.default,e.__assign({},o,{customStyles:null==H?void 0:H.recommendationBlock,label:a}))},a:function(t){var o,a,l;t.inline;var r=t.children;t.node;var s=e.__rest(t,["inline","children","node"]),d=i.useContext(b)||"true"==(null==s?void 0:s.table),c="".concat(null==s?void 0:s.href),u=null===(o=c.split("$"))||void 0===o?void 0:o[0],g=null===(a=c.split("$"))||void 0===a?void 0:a[1];if("ai_reasoning"===u){var v=(null!==(l=U?F:te)&&void 0!==l?l:[]).find(function(e){return e.id.toString()===decodeURIComponent(g)}),f=re.includes(g);if(v){if(d)return n.jsx(A,{aiReason:v,customStyle:null==H?void 0:H.tableAiReasoning,customIcons:ce,isHighConfidence:v.relevance_score>=h.SHOW_CONFIDENCE_SCORE_THRESHOLD_IN_AI_REASONING});var p="source"!==R.default.Children.toArray(r).join("").trim().toLowerCase();return n.jsx(h.default,{aiReason:v,isSourceHasHighlight:f,inlineLabel:r,isInlineCitation:p,customIcons:ce,customStyles:{aiReasoningContent:null==H?void 0:H.aiReasoningContent,aiReasoningAccordion:null==H?void 0:H.aiReasoningAccordion,aiReasoningMarkdown:null==H?void 0:H.aiReasoningMarkdown,aiReasoningPill:null==H?void 0:H.aiReasoningPill,webCitation:null==H?void 0:H.webCitation,stormeeCitation:null==H?void 0:H.stormeeCitation,waveformCitation:null==H?void 0:H.waveformCitation,imageCitation:null==H?void 0:H.imageCitation,fileCitation:null==H?void 0:H.fileCitation,appModCitation:null==H?void 0:H.appModCitation,rcaCitation:null==H?void 0:H.rcaCitation,readFileCitation:null==H?void 0:H.readFileCitation,loadingCitations:null==H?void 0:H.loadingCitations,chatCitation:null==H?void 0:H.chatCitation,bigEnoughCitation:null==H?void 0:H.bigEnoughCitation}})}}return null},code:function(i){i.inline;var t=i.children,o=i.className;return i.node,e.__rest(i,["inline","children","className","node"]),/language-(\w+)/.exec(o||"")||(null==o?void 0:o.includes("language-"))?n.jsx("div",{children:n.jsx("code",e.__assign({className:a.default.blockCode,style:null==H?void 0:H.code},{children:t}))}):n.jsx("code",e.__assign({className:a.default.inlineCode,style:null==H?void 0:H.code},{children:t}))},learned:function(i){var t=i.children;return n.jsx(s.Tooltip,e.__assign({title:t,placement:"top"},{children:n.jsx(r.Info,{size:16,className:a.default.learned})}))},generatedcode:function(i){i.node;var t=e.__rest(i,["node"]),o=(null==t?void 0:t.language)||"python",a=function(e){var n="";try{if(e["data-raw"])n=decodeURIComponent(atob(e["data-raw"]));else{var i=function(e){var n;return"string"==typeof e?e:Array.isArray(e)?e.map(i).join(""):(null===(n=null==e?void 0:e.props)||void 0===n?void 0:n.children)?i(e.props.children):""};n=i(e.children)}}catch(i){console.error("Error decoding generated code:",i),n=String(e.children)}return n}(t);return n.jsx(c.default,{title:"Generated Code",code:a,language:o,customStyles:{pill:null==H?void 0:H.generatedCodePill,content:null==H?void 0:H.generatedCodeContent}})},updatedsegment:function(i){var t,o,a,l,r=i.node,s=i.children,d=e.__rest(i,["node","children"]),c="".concat(null===(t=r.position)||void 0===t?void 0:t.start.line,"-").concat(null===(o=r.position)||void 0===o?void 0:o.start.column,"-").concat(null===(a=r.position)||void 0===a?void 0:a.end.line,"-").concat(null===(l=r.position)||void 0===l?void 0:l.end.column);return n.jsx(j.default,{id:c,node:r,children:s,props:d,segmentComponentConfig:de,customStyles:H,customIcons:O,extractText:we,isUpdatedSegment:!0})},segment:function(i){var t,o,a,l,r=i.node,s=i.children,d=e.__rest(i,["node","children"]),c="".concat(null===(t=r.position)||void 0===t?void 0:t.start.line,"-").concat(null===(o=r.position)||void 0===o?void 0:o.start.column,"-").concat(null===(a=r.position)||void 0===a?void 0:a.end.line,"-").concat(null===(l=r.position)||void 0===l?void 0:l.end.column);return n.jsx(j.default,{id:c,node:r,children:s,props:d,segmentComponentConfig:de,customStyles:H,customIcons:O,extractText:we})}}},[Re,Q,te,B,he,U,v,O,le,re,H,de]);return i.useEffect(function(){if(X.current){if(le.length){var e;if(0===re.length||K)requestAnimationFrame(function(){ge([le[se].replace(/\*/g,"")])});else{var n=X.current,i=new MutationObserver(function(){clearTimeout(e),e=setTimeout(function(){i.disconnect(),requestAnimationFrame(function(){ge([le[se].replace(/\*/g,"")])})},50)});i.observe(n,{childList:!0,subtree:!0})}return function(){clearTimeout(e)}}ve()}},[le,re,se,K]),n.jsx(N.Provider,e.__assign({value:{expandedInfo:Ce,setExpanded:je,reasonToRow:xe}},{children:n.jsxs("div",e.__assign({ref:X,className:"".concat(a.default.container," ").concat("approving"!==E?a.default.wrapper:""," ").concat(D||""),style:null==H?void 0:H.container},{children:[S?n.jsx(y.MarkdownContextProvider,{children:n.jsx(I.default,e.__assign({components:ke,rehypePlugins:[w.default]},{children:Ne}))}):f,ye>0&&n.jsx("div",e.__assign({className:a.default.confidenceScoreContainer,style:null==H?void 0:H.confidenceScoreContainer},{children:n.jsxs("span",e.__assign({className:a.default.confidenceScore,style:null==H?void 0:H.confidenceScore},{children:[n.jsx(p.default,{size:14,color:(null==H?void 0:H.confidenceScoreIconColor)||"#166534"}),ye,"%"]}))})),$&&n.jsx("div",e.__assign({className:a.default.citationLoader,style:null==H?void 0:H.citationLoaderContainer},{children:n.jsx(u.default,{customStyles:{container:null==H?void 0:H.citationLoadingContainer,icon:null==H?void 0:H.citationLoadingIcon,text:null==H?void 0:H.citationLoadingText}})})),k&&n.jsx("div",e.__assign({style:e.__assign({},null===(o=null==H?void 0:H.attachedContext)||void 0===o?void 0:o.wrapper),className:"flex mt-5"},{children:n.jsx(C.default,{customStyles:null==H?void 0:H.attachedContext})}))]}))}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),t=require("react-markdown"),o=require("rehype-raw"),a=require("./UserStoryWithCitation.module.css.js"),r=require("../../shared/useMarkdownSearch.js"),l=require("lucide-react"),d=require("@mui/material"),s=require("dompurify"),c=require("../../shared/UpdatedAnimationContent.js"),u=require("../../shared/GeneratedCodeCitation.js"),g=require("../../shared/CitationLoadingIndicator.js"),v=require("../RequirementAIWrapper/RequirementAIWrapper.js"),f=require("../../icons/CognitiveDecision.js"),p=require("../../icons/BrainRed.js"),h=require("../ai-reasoning/AiReasoningCitation.js"),m=require("../../icons/RelevanceScoreIcon.js"),C=require("../RecommendationBlock/RecommendationBlock.js"),_=require("../UserStoryCard/AttachedContext.js"),x=require("../ai-reasoning/AiReasoningCitationContent.js"),j=require("./components/InlineUpdatedComponent.js"),y=require("../segment/SegmentWrapper.js"),S=require("../../store/markdown-context.js");function R(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var I=R(i),w=R(t),b=R(o),N=R(s),k=i.createContext(!1),A=i.createContext({expandedInfo:null,setExpanded:function(){},reasonToRow:{current:new Map}}),q=i.createContext({rowId:""}),E=function(t){var o,r=t.aiReason,l=t.isHighConfidence,d=t.customStyle,s=t.customIcons,c=i.useContext(A),u=c.expandedInfo,g=c.setExpanded,v=c.reasonToRow,h=i.useContext(q).rowId,m=String(r.id);h&&v.current.set(m,h);var C=(null===(o=null==u?void 0:u.aiReason)||void 0===o?void 0:o.id)===r.id,_=l?(null==s?void 0:s.highConfidence)||n.jsx(f.default,{}):(null==s?void 0:s.lowConfidence)||n.jsx(p.default,{});return n.jsxs("button",e.__assign({className:a.default.aiReasoningButton,style:d,onClick:function(e){e.stopPropagation(),e.preventDefault(),g(C?null:h,C?null:r)}},{children:[_,C?n.jsx("i",{className:"pi pi-angle-up ".concat(l?a.default.aiReasoningIconHighConfidence:a.default.aiReasoningIconLowConfidence)}):n.jsx("i",{className:"pi pi-angle-down ".concat(l?a.default.aiReasoningIconHighConfidence:a.default.aiReasoningIconLowConfidence)})]}))},M=function(t){var o,r,l=t.children,d=t.node,s=t.customStyles,c=t.customIcons,u=i.useRef(Math.random().toString(36).slice(2)).current,g=i.useContext(A).expandedInfo,v=(null==g?void 0:g.rowId)===u,f=Array.isArray(null==d?void 0:d.children)?d.children.filter(function(e){return"element"===e.type}).length:1,p=null!==(r=null===(o=null==d?void 0:d.properties)||void 0===o?void 0:o.style)&&void 0!==r?r:void 0;return n.jsxs(q.Provider,e.__assign({value:{rowId:u}},{children:[n.jsx("tr",e.__assign({style:p?{cssText:p}:void 0},{children:l})),v&&(null==g?void 0:g.aiReason)&&n.jsx("tr",e.__assign({style:{width:"100%"}},{children:n.jsx("td",e.__assign({colSpan:f||1,className:a.default.tableExpandedCell},{children:n.jsx("div",e.__assign({className:a.default.tableExpandedCellInner},{children:n.jsx("div",e.__assign({className:a.default.tableExpandedCellContent},{children:n.jsx(x.default,{aiReason:g.aiReason,customIcons:c,customStyles:{aiReasoningContent:null==s?void 0:s.aiReasoningContent,aiReasoningAccordion:null==s?void 0:s.aiReasoningAccordion,aiReasoningMarkdown:null==s?void 0:s.aiReasoningMarkdown,aiReasoningPill:null==s?void 0:s.aiReasoningPill,webCitation:null==s?void 0:s.webCitation,stormeeCitation:null==s?void 0:s.stormeeCitation,waveformCitation:null==s?void 0:s.waveformCitation,imageCitation:null==s?void 0:s.imageCitation,fileCitation:null==s?void 0:s.fileCitation,appModCitation:null==s?void 0:s.appModCitation,rcaCitation:null==s?void 0:s.rcaCitation,readFileCitation:null==s?void 0:s.readFileCitation,loadingCitations:null==s?void 0:s.loadingCitations,chatCitation:null==s?void 0:s.chatCitation}})}))}))}))}))]}))};var U=["del","ins"];function T(e){return function(e,n,i){var t=n.join("|");return e.replace(new RegExp("<(".concat(t,")>([\\s\\S]*?)<\\/\\1>"),"gi"),function(e,n,t){return"<".concat(n,">").concat(i(t),"</").concat(n,">")})}(e,U,function(e){return e.split(/(<[^>]+>)/g).map(function(e){return!e||/^<[^>]+>$/.test(e)?e:function(e){if(!e)return e;var n=[];return e.replace(/`([^`\n]+)`/g,function(e,i){var t=n.push(i)-1;return"@@CODE_SPAN_".concat(t,"@@")}).replace(/\*\*([\s\S]+?)\*\*/g,"<strong>$1</strong>").replace(/__([\s\S]+?)__/g,"<strong>$1</strong>").replace(/@@CODE_SPAN_(\d+)@@/g,function(e,i){var t,o=null!==(t=n[Number(i)])&&void 0!==t?t:"";return"<code>".concat(o.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"),"</code>")})}(e)}).join("")})}exports.default=function(t){var o,s=t.message,f=t.noMarkdownContent,p=t.useMarkdown,x=void 0===p||p,R=t.isParent,q=t.scenario,U=t.showUserStoryDiff,L=void 0!==U&&U,P=t.aiReasoningsForBlock,$=t.isCitationLoadingDisplay,D=void 0!==$&&$,H=t.className;t.highConfidenceIcon,t.lowConfidenceIcon;var O=t.customStyles,F=t.customIcons,z=t.aiReasoningDiffView,B=t.userStoryCitations,W=t.artifactId,V=t.isCraflow,G=t.onCraAccept,Q=t.onCraReject,J=t.craFlowConfig,K=t.isDisplayHighlightControl,X=void 0!==K&&K,Y=i.useRef(null),Z=v.useRequirementAI(),ee=Z.userStory,ne=Z.inlineUpdateComponentConfig,ie=Z.getAvgScoreForStory,te=Z.setUserStory,oe=Z.aiReasoning,ae=Z.setAiReasoning,re=Z.customIcons,le=Z.searchQueryList,de=Z.searchQueryReasoningIdList,se=Z.currentHighlightIndex,ce=Z.segmentComponentConfig,ue=null!=F?F:null==re?void 0:re.userStoryIcons;null==O||O.searchHighlight;var ge=r.useMarkdownSearch(Y),ve=ge.search,fe=ge.clear,pe=i.useState("1"),he=pe[0],me=pe[1],Ce=i.useState(null),_e=Ce[0],xe=Ce[1],je=i.useRef(new Map),ye=i.useCallback(function(e,n){xe(e&&n?{rowId:e,aiReason:n}:null)},[]),Se=W?ie(W):0,Re=i.useState([]),Ie=Re[0],we=Re[1],be=function(e){return null==e?"":"string"==typeof e?e:"number"==typeof e?String(e):Array.isArray(e)?e.map(be).join(""):I.default.isValidElement(e)?be(e.props.children):""},Ne=function(e){var n=e;return n=function(e){for(var n,i=/<updated[^>]*>[\s\S]*?<\/updated>/gi,t=[],o=new RegExp(i.source,i.flags);null!==(n=o.exec(e));){var a=n[0],r=a.match(/<deleted>([\s\S]*?)<\/deleted>/i),l=a.match(/<changed>([\s\S]*?)<\/changed>/i),d=function(e){return(e.match(/^\s*\d+\.\s/gm)||[]).length};t.push({index:n.index,endIndex:n.index+n[0].length,deletedItemCount:d((null==r?void 0:r[1])||""),changedItemCount:d((null==l?void 0:l[1])||"")})}if(0===t.length)return e;for(var s=e,c=function(e){var n=t[e],i=n.changedItemCount-n.deletedItemCount;if(0===i)return"continue";for(var o=!1,a=0,r=s.substring(0,n.index).split("\n").reverse();a<r.length;a++){var l=r[a].trim();if(""!==l){/^\d+\.\s/.test(l)&&(o=!0);break}}if(!o)return"continue";var d=n.endIndex,c=e+1<t.length?t[e+1].index:s.length,u=s.substring(d,c);u=u.replace(/^(\s*)(\d+)\.\s/gm,function(e,n,t){return"".concat(n).concat(parseInt(t,10)+i,". ")}),s=s.substring(0,d)+u+s.substring(c)},u=t.length-1;u>=0;u--)c(u);return s}(n=(n=(n=(n=(n=(n=n.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,function(e,n){var i=n.replace(/ai_reasoning\$(\d+)/g,function(e,n){return"ai_reasoning$".concat(n,"-legacy")});return"<deleted>".concat(i,"</deleted>")})).replace(/<generatedCode([^>]*)>([\s\S]*?)<\/generatedCode>/gi,function(e,n,i){var t=btoa(encodeURIComponent(i.trim()));return"\n\n<generatedCode".concat(n,' data-raw="').concat(t,'"></generatedCode>\n\n')})).replace(/^(\s*[-*]|\s*\d+\.)\s*\n?\s*(<updated\b)/gm,"$1 $2")).replace(/(<segment\b([^>]*)>)([\s\S]*?)(<\/segment>)/gi,function(e,n,i,t,o){var a=t.match(/<table[\s\S]*?<\/table>/i);if(a){var r=btoa(encodeURIComponent(a[0]));return"<segment".concat(i,' data-table="').concat(r,'"></segment>')}return e})).replace(/<updatedsegment([^>]*)>([\s\S]*?)<\/updatedsegment>/gi,function(e,n,i){if(/<table[\s>]/i.test(i)){var t=btoa(encodeURIComponent(i));return"<updatedsegment".concat(n,' data-raw="').concat(t,'"></updatedsegment>')}return e})).replace(/<updated([^>]*)>([\s\S]*?)<\/updated>/gi,function(e,i,t,o){var a=n.substring(0,o),r=a.lastIndexOf("\n"),l=/^\s+[-*]\s/.test(a.substring(r+1))||/^\s+\d+\.\s/.test(a.substring(r+1)),d=/^\s*(\d+\.|\s*[-*])\s+$/.test(a.substring(r+1));if(l||d){var s=t;return s=(s=(s=(s=s.replace(/(<deleted>)\s*\n?\s*[-*]\s+/gi,"$1\n")).replace(/(<changed>)\s*\n?\s*[-*]\s+/gi,"$1\n")).replace(/(<deleted>)\s*\n?\s*\d+\.\s+/gi,"$1\n")).replace(/(<changed>)\s*\n?\s*\d+\.\s+/gi,"$1\n"),"<updated".concat(i,">").concat(s,"</updated>")}return e})),n=function(e){var n=e.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,function(e,n){var i=n.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <deleted>",{hadChange:i!==n}),"<deleted>".concat(i,"</deleted>")});return n.replace(/<changed>([\s\S]*?)<\/changed>/gi,function(e,n){var i=n.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <changed>",{hadChange:i!==n,preview:n.substring(0,120)}),"<changed>".concat(i,"</changed>")})}(n),n=T(n)},ke=i.useMemo(function(){return s?Ne(s):s},[s]);i.useEffect(function(){we(P||oe)},[P,oe]);var Ae=i.useMemo(function(){return{upt:function(i){var t;i.node;var o=i.children,a=e.__rest(i,["node","children"]),r=null==a?void 0:a.id,l=r?null===(t=r.split("$"))||void 0===t?void 0:t[1]:null,d=oe.find(function(e){return e.id.toString()===l});return d?n.jsx(j.default,e.__assign({aiReason:d,customStyles:null==O?void 0:O.inlineUpdatedComponent,handleClickCognitiveDecision:null==ne?void 0:ne.handleClickCognitiveDecision,handleClickUpdatedPill:null==ne?void 0:ne.handleClickUpdatedPill,handleClickOutputValue:null==ne?void 0:ne.handleClickOutputValue,customIcons:null==ne?void 0:ne.customIcons},{children:o})):o},del:function(i){var t,o,r;i.node;var l=i.children,d=e.__rest(i,["node","children"]),s=d.aireason,c=s&&(null===(t=s.deviation_details)||void 0===t?void 0:t.resolved)&&"rejected"===(null===(o=s.deviation_details)||void 0===o?void 0:o.resolved);return n.jsx("span",e.__assign({className:a.default.deleted,style:e.__assign(e.__assign({},null!==(r=null==O?void 0:O.deleted)&&void 0!==r?r:{}),{textDecoration:c?"none":"line-through"})},d,{onClick:d.onclick},{children:l}))},ins:function(i){var t=i.children,o=e.__rest(i,["children"]);return n.jsx("span",e.__assign({className:a.default.inserted,style:null==O?void 0:O.inserted},o,{onClick:o.onclick},{children:t}))},preserved:function(i){var t=i.children,o=e.__rest(i,["children"]);return n.jsx("span",e.__assign({className:a.default.preserved,style:null==O?void 0:O.preserved},o,{onClick:o.onclick},{children:t}))},h1:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("h1",e.__assign({className:a.default.heading1,style:null==O?void 0:O.heading1},{children:t.children}))},h2:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("h2",e.__assign({className:a.default.heading2,style:null==O?void 0:O.heading2},{children:t.children}))},h3:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("h3",e.__assign({className:a.default.heading3,style:null==O?void 0:O.heading3},{children:t.children}))},b:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("b",e.__assign({className:a.default.bold,style:null==O?void 0:O.bold},{children:null==t?void 0:t.children}))},p:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("p",e.__assign({},t,{className:a.default.paragraph,style:null==O?void 0:O.paragraph},{children:t.children}))},updated:function(i){var t=i.node,o=e.__rest(i,["node"]);return n.jsx(c.default,e.__assign({},o,{showUserStoryDiff:L,currentUpdatedTagId:he,setCurrentUpdatedTagId:me,userStory:ee,setUserStory:te,setAiReasoning:ae,node:t,isCraflow:V,onCraAccept:G,onCraReject:Q,customStyles:null==O?void 0:O.updatedContent,craFlowConfig:J}))},ol:function(i){var t,o,r,l=i.node,d=e.__rest(i,["node"]),s=null!==(r=null!==(o=null===(t=null==l?void 0:l.properties)||void 0===t?void 0:t.start)&&void 0!==o?o:null==d?void 0:d.start)&&void 0!==r?r:void 0;return n.jsx("ol",e.__assign({className:a.default.orderedList,style:null==O?void 0:O.olist},s?{start:Number(s)}:{},{children:null==d?void 0:d.children}))},ul:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("ul",e.__assign({className:a.default.unorderedList,style:null==O?void 0:O.ulist},{children:null==t?void 0:t.children}))},table:function(i){var t=i.children;return n.jsx("div",e.__assign({className:a.default.tableWrapper},{children:n.jsx("table",e.__assign({className:a.default.table,style:null==O?void 0:O.table},{children:t}))}))},tr:function(e){var i=e.node,t=e.children;return n.jsx(M,{node:i,children:t,customStyles:O})},td:function(i){var t,o=i.node,a=i.children,r=null!==(t=null==o?void 0:o.properties)&&void 0!==t?t:{},l=r.style,d=e.__rest(r,["style"]);return n.jsx(k.Provider,e.__assign({value:!0},{children:n.jsx("td",e.__assign({},d,{style:l?{cssText:l}:void 0},{children:a}))}))},th:function(i){var t,o=i.node,a=i.children,r=null!==(t=null==o?void 0:o.properties)&&void 0!==t?t:{},l=r.style,d=e.__rest(r,["style"]);return n.jsx(k.Provider,e.__assign({value:!0},{children:n.jsx("th",e.__assign({},d,{style:l?{cssText:l}:void 0},{children:a}))}))},recommendation:function(i){var t;i.node;var o=e.__rest(i,["node"]),a="The AI has selected this content based on: ".concat((null===(t=null==o?void 0:o.children)||void 0===t?void 0:t[0])||"");return n.jsx(C.default,e.__assign({},o,{customStyles:null==O?void 0:O.recommendationBlock,label:a}))},a:function(t){var o,a,r;t.inline;var l=t.children;t.node;var d=e.__rest(t,["inline","children","node"]),s=i.useContext(k)||"true"==(null==d?void 0:d.table),c="".concat(null==d?void 0:d.href),u=null===(o=c.split("$"))||void 0===o?void 0:o[0],g=null===(a=c.split("$"))||void 0===a?void 0:a[1];if("ai_reasoning"===u){var v=(null!==(r=L?z:oe)&&void 0!==r?r:[]).find(function(e){return e.id.toString()===decodeURIComponent(g)}),f=de.includes(g);if(v){if(s)return n.jsx(E,{aiReason:v,customStyle:null==O?void 0:O.tableAiReasoning,customIcons:ue,isHighConfidence:v.relevance_score>=h.SHOW_CONFIDENCE_SCORE_THRESHOLD_IN_AI_REASONING});var p="source"!==I.default.Children.toArray(l).join("").trim().toLowerCase();return n.jsx(h.default,{aiReason:v,isSourceHasHighlight:f,inlineLabel:l,isInlineCitation:p,customIcons:ue,customStyles:{aiReasoningContent:null==O?void 0:O.aiReasoningContent,aiReasoningAccordion:null==O?void 0:O.aiReasoningAccordion,aiReasoningMarkdown:null==O?void 0:O.aiReasoningMarkdown,aiReasoningPill:null==O?void 0:O.aiReasoningPill,webCitation:null==O?void 0:O.webCitation,stormeeCitation:null==O?void 0:O.stormeeCitation,waveformCitation:null==O?void 0:O.waveformCitation,imageCitation:null==O?void 0:O.imageCitation,fileCitation:null==O?void 0:O.fileCitation,appModCitation:null==O?void 0:O.appModCitation,rcaCitation:null==O?void 0:O.rcaCitation,readFileCitation:null==O?void 0:O.readFileCitation,loadingCitations:null==O?void 0:O.loadingCitations,chatCitation:null==O?void 0:O.chatCitation,bigEnoughCitation:null==O?void 0:O.bigEnoughCitation}})}}return null},code:function(i){i.inline;var t=i.children,o=i.className;return i.node,e.__rest(i,["inline","children","className","node"]),/language-(\w+)/.exec(o||"")||(null==o?void 0:o.includes("language-"))?n.jsx("div",{children:n.jsx("code",e.__assign({className:a.default.blockCode,style:null==O?void 0:O.code},{children:t}))}):n.jsx("code",e.__assign({className:a.default.inlineCode,style:null==O?void 0:O.code},{children:t}))},learned:function(i){var t=i.children;return n.jsx(d.Tooltip,e.__assign({title:t,placement:"top"},{children:n.jsx(l.Info,{size:16,className:a.default.learned})}))},generatedcode:function(i){i.node;var t=e.__rest(i,["node"]),o=(null==t?void 0:t.language)||"python",a=function(e){var n="";try{if(e["data-raw"])n=decodeURIComponent(atob(e["data-raw"]));else{var i=function(e){var n;return"string"==typeof e?e:Array.isArray(e)?e.map(i).join(""):(null===(n=null==e?void 0:e.props)||void 0===n?void 0:n.children)?i(e.props.children):""};n=i(e.children)}}catch(i){console.error("Error decoding generated code:",i),n=String(e.children)}return n}(t);return n.jsx(u.default,{title:"Generated Code",code:a,language:o,customStyles:{pill:null==O?void 0:O.generatedCodePill,content:null==O?void 0:O.generatedCodeContent}})},updatedsegment:function(i){var t,o,a,r,l=i.node,d=i.children,s=e.__rest(i,["node","children"]),c="".concat(null===(t=l.position)||void 0===t?void 0:t.start.line,"-").concat(null===(o=l.position)||void 0===o?void 0:o.start.column,"-").concat(null===(a=l.position)||void 0===a?void 0:a.end.line,"-").concat(null===(r=l.position)||void 0===r?void 0:r.end.column),u=function(e){if(!e["data-raw"])return null;try{return decodeURIComponent(atob(e["data-raw"]))}catch(e){return console.error("Error decoding segment raw content:",e),null}}(s),g=u?n.jsx("div",{dangerouslySetInnerHTML:{__html:N.default.sanitize(u)}}):n.jsx("div",{children:d});return n.jsx(y.default,{id:c,node:l,children:g,props:s,segmentComponentConfig:ce,customStyles:O,customIcons:F,extractText:be,isUpdatedSegment:!0})},segment:function(i){var t,o,a,r,l=i.node,d=i.children,s=e.__rest(i,["node","children"]),c="".concat(null===(t=l.position)||void 0===t?void 0:t.start.line,"-").concat(null===(o=l.position)||void 0===o?void 0:o.start.column,"-").concat(null===(a=l.position)||void 0===a?void 0:a.end.line,"-").concat(null===(r=l.position)||void 0===r?void 0:r.end.column);return n.jsx(y.default,{id:c,node:l,children:d,props:s,segmentComponentConfig:ce,customStyles:O,customIcons:F,extractText:be})}}},[Ie,J,oe,B,he,L,s,F,le,de,O,ce]);return console.log("normalized markdown ",ke),i.useEffect(function(){if(Y.current){if(le.length){var e;if(0===de.length||X)requestAnimationFrame(function(){ve([le[se].replace(/\*/g,"")])});else{var n=Y.current,i=new MutationObserver(function(){clearTimeout(e),e=setTimeout(function(){i.disconnect(),requestAnimationFrame(function(){ve([le[se].replace(/\*/g,"")])})},50)});i.observe(n,{childList:!0,subtree:!0})}return function(){clearTimeout(e)}}fe()}},[le,de,se,X]),n.jsx(A.Provider,e.__assign({value:{expandedInfo:_e,setExpanded:ye,reasonToRow:je}},{children:n.jsxs("div",e.__assign({ref:Y,className:"".concat(a.default.container," ").concat("approving"!==q?a.default.wrapper:""," ").concat(H||""),style:null==O?void 0:O.container},{children:[x?n.jsx(S.MarkdownContextProvider,{children:n.jsx(w.default,e.__assign({components:Ae,rehypePlugins:[b.default]},{children:ke}))}):f,Se>0&&n.jsx("div",e.__assign({className:a.default.confidenceScoreContainer,style:null==O?void 0:O.confidenceScoreContainer},{children:n.jsxs("span",e.__assign({className:a.default.confidenceScore,style:null==O?void 0:O.confidenceScore},{children:[n.jsx(m.default,{size:14,color:(null==O?void 0:O.confidenceScoreIconColor)||"#166534"}),Se,"%"]}))})),D&&n.jsx("div",e.__assign({className:a.default.citationLoader,style:null==O?void 0:O.citationLoaderContainer},{children:n.jsx(g.default,{customStyles:{container:null==O?void 0:O.citationLoadingContainer,icon:null==O?void 0:O.citationLoadingIcon,text:null==O?void 0:O.citationLoadingText}})})),R&&n.jsx("div",e.__assign({style:e.__assign({},null===(o=null==O?void 0:O.attachedContext)||void 0===o?void 0:o.wrapper),className:"flex mt-5"},{children:n.jsx(_.default,{customStyles:null==O?void 0:O.attachedContext})}))]}))}))};
2
2
  //# sourceMappingURL=UserStoryWithCitation.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),l=require("react/jsx-runtime"),i=require("@mui/material"),o=require("../../../utils/css.utils.js"),n=require("./InlineUpdatedComponent.module.css.js"),t=require("../../../icons/CognitiveDecision.js"),d=require("lucide-react"),r=require("react");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=a(r);exports.default=function(a){var u,c,v,p,_,f,g,h,m,x,j,y,C,k,b,D,q,S,N,T,I=a.aiReason,O=a.children,P=a.customStyles,W=a.handleClickCognitiveDecision,w=a.handleClickUpdatedPill,E=a.handleClickOutputValue,R=a.customIcons,U=r.useRef(),A=r.useRef(function(){null==w||w(U.current,I)}),M=r.useMemo(function(){var l=function(i,o){return s.default.Children.map(i,function(i){var n;if(!s.default.isValidElement(i))return i;var t=(null===(n=i.props)||void 0===n?void 0:n.children)?l(i.props.children,o):i.props.children,d=s.default.cloneElement(i,e.__assign(e.__assign({},i.props),{children:t}));return o(d)})};return l(O,function(e){return s.default.cloneElement(e,{onclick:A.current})})},[O]),V=(null===(u=I.deviation_details)||void 0===u?void 0:u.resolved)?"#303030":null===(p=null===(v=null===(c=I.deviation_details)||void 0===c?void 0:c.evaluation_outputs)||void 0===v?void 0:v.metadata)||void 0===p?void 0:p.label_color,F={color:V||"#000000",background:o.hexToOpacity(V||"#000000",25),border:"1px solid ".concat(o.hexToOpacity(V||"#000000",75))},X=V||"#000000",z=o.hexToOpacity(V||"#000000",25),B=e.__assign({background:o.hexToOpacity(V||"#000000",75)},null==P?void 0:P.dividerStyle),G=null,H=null===(_=I.deviation_details)||void 0===_?void 0:_.resolved;return"accepted"===H?G=null!==(f=null==R?void 0:R.accepted)&&void 0!==f?f:l.jsx(d.Check,{color:"#16A34A"}):"rejected"===H?G=null!==(g=null==R?void 0:R.rejected)&&void 0!==g?g:l.jsx(d.X,{color:"#DC2626"}):"reverted"===H&&(G=null!==(h=null==R?void 0:R.reverted)&&void 0!==h?h:l.jsx(d.Undo2,{color:"#475569"})),l.jsxs(l.Fragment,{children:[l.jsx("div",e.__assign({className:n.default.resolvedStatus,style:null==P?void 0:P.resolvedIcon},{children:G})),l.jsx("div",e.__assign({ref:U,id:I.id.toString(),onClick:function(e){e.stopPropagation(),null==w||w(e.currentTarget,I)},className:n.default.pillWrapper,style:null==P?void 0:P.pillStyleWrapper},{children:l.jsxs("div",e.__assign({className:"".concat(n.default.pillComponent),style:e.__assign(e.__assign({},F),null===(m=null==P?void 0:P.pillComponent)||void 0===m?void 0:m.commonStyle)},{children:[l.jsx("span",{children:(null===(y=null===(j=null===(x=I.deviation_details)||void 0===x?void 0:x.evaluation_outputs)||void 0===j?void 0:j.metadata)||void 0===y?void 0:y.label_text)||""}),l.jsx(i.Divider,{className:n.default.dividerStyle,style:B}),l.jsx("span",e.__assign({onClick:function(e){E&&(e.stopPropagation(),null==E||E(e.currentTarget,I))}},{children:(null===(C=I.deviation_details)||void 0===C?void 0:C.resolved)?G:null===(b=null===(k=null==I?void 0:I.deviation_details)||void 0===k?void 0:k.evaluation_outputs)||void 0===b?void 0:b.output_value})),l.jsx(i.Divider,{className:n.default.dividerStyle,style:B}),l.jsx("span",e.__assign({onClick:function(e){e.stopPropagation(),null==W||W(e.currentTarget,I)},className:n.default.cognitiveDecisionWrapper,style:null===(D=null==P?void 0:P.cognitiveDecisionIcon)||void 0===D?void 0:D.wrapper},{children:l.jsx(t.default,{color:(null===(q=null==P?void 0:P.cognitiveDecisionIcon)||void 0===q?void 0:q.color)||X,backgroundColor:(null===(S=null==P?void 0:P.cognitiveDecisionIcon)||void 0===S?void 0:S.backgroundColor)||z})})),l.jsx("span",e.__assign({className:n.default.chevronWrapper,style:null===(N=null==P?void 0:P.Chevron)||void 0===N?void 0:N.wrapper},{children:l.jsx(d.ChevronDown,{color:(null===(T=null==P?void 0:P.Chevron)||void 0===T?void 0:T.color)||V})}))]}))})),M]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),l=require("react/jsx-runtime"),i=require("@mui/material"),o=require("../../../utils/css.utils.js"),n=require("./InlineUpdatedComponent.module.css.js"),t=require("../../../icons/CognitiveDecision.js"),d=require("lucide-react"),r=require("react");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=a(r);exports.default=function(a){var u,c,v,p,_,f,g,h,m,x,j,y,C,k,b,D,q,S,N,T,I=a.aiReason,O=a.children,P=a.customStyles,W=a.handleClickCognitiveDecision,w=a.handleClickUpdatedPill,E=a.handleClickOutputValue,R=a.customIcons,U=r.useRef(),A=r.useRef(function(){null==w||w(U.current,I)}),M=r.useMemo(function(){var l=function(i,o){return s.default.Children.map(i,function(i){var n;if(!s.default.isValidElement(i))return i;var t=(null===(n=i.props)||void 0===n?void 0:n.children)?l(i.props.children,o):i.props.children,d=s.default.cloneElement(i,e.__assign(e.__assign({},i.props),{children:t}));return o(d)})};return l(O,function(e){return s.default.cloneElement(e,{onclick:A.current,aireason:I})})},[O]),V=(null===(u=I.deviation_details)||void 0===u?void 0:u.resolved)?"#303030":null===(p=null===(v=null===(c=I.deviation_details)||void 0===c?void 0:c.evaluation_outputs)||void 0===v?void 0:v.metadata)||void 0===p?void 0:p.label_color,F={color:V||"#000000",background:o.hexToOpacity(V||"#000000",25),border:"1px solid ".concat(o.hexToOpacity(V||"#000000",75))},X=V||"#000000",z=o.hexToOpacity(V||"#000000",25),B=e.__assign({background:o.hexToOpacity(V||"#000000",75)},null==P?void 0:P.dividerStyle),G=null,H=null===(_=I.deviation_details)||void 0===_?void 0:_.resolved;return"accepted"===H?G=null!==(f=null==R?void 0:R.accepted)&&void 0!==f?f:l.jsx(d.Check,{color:"#16A34A"}):"rejected"===H?G=null!==(g=null==R?void 0:R.rejected)&&void 0!==g?g:l.jsx(d.X,{color:"#DC2626"}):"reverted"===H&&(G=null!==(h=null==R?void 0:R.reverted)&&void 0!==h?h:l.jsx(d.Undo2,{color:"#475569"})),l.jsxs(l.Fragment,{children:[l.jsx("div",e.__assign({className:n.default.resolvedStatus,style:null==P?void 0:P.resolvedIcon},{children:G})),l.jsx("div",e.__assign({ref:U,id:I.id.toString(),onClick:function(e){e.stopPropagation(),null==w||w(e.currentTarget,I)},className:n.default.pillWrapper,style:null==P?void 0:P.pillStyleWrapper},{children:l.jsxs("div",e.__assign({className:"".concat(n.default.pillComponent),style:e.__assign(e.__assign({},F),null===(m=null==P?void 0:P.pillComponent)||void 0===m?void 0:m.commonStyle)},{children:[l.jsx("span",{children:(null===(y=null===(j=null===(x=I.deviation_details)||void 0===x?void 0:x.evaluation_outputs)||void 0===j?void 0:j.metadata)||void 0===y?void 0:y.label_text)||""}),l.jsx(i.Divider,{className:n.default.dividerStyle,style:B}),l.jsx("span",e.__assign({onClick:function(e){E&&(e.stopPropagation(),null==E||E(e.currentTarget,I))}},{children:(null===(C=I.deviation_details)||void 0===C?void 0:C.resolved)?G:null===(b=null===(k=null==I?void 0:I.deviation_details)||void 0===k?void 0:k.evaluation_outputs)||void 0===b?void 0:b.output_value})),l.jsx(i.Divider,{className:n.default.dividerStyle,style:B}),l.jsx("span",e.__assign({onClick:function(e){e.stopPropagation(),null==W||W(e.currentTarget,I)},className:n.default.cognitiveDecisionWrapper,style:null===(D=null==P?void 0:P.cognitiveDecisionIcon)||void 0===D?void 0:D.wrapper},{children:l.jsx(t.default,{color:(null===(q=null==P?void 0:P.cognitiveDecisionIcon)||void 0===q?void 0:q.color)||X,backgroundColor:(null===(S=null==P?void 0:P.cognitiveDecisionIcon)||void 0===S?void 0:S.backgroundColor)||z})})),l.jsx("span",e.__assign({className:n.default.chevronWrapper,style:null===(N=null==P?void 0:P.Chevron)||void 0===N?void 0:N.wrapper},{children:l.jsx(d.ChevronDown,{color:(null===(T=null==P?void 0:P.Chevron)||void 0===T?void 0:T.color)||V})}))]}))})),M]})};
2
2
  //# sourceMappingURL=InlineUpdatedComponent.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"tslib";import{jsxs as c,jsx as i,Fragment as n}from"react/jsx-runtime";import t,{useMemo as a}from"react";import r from"../Popups/PopupDefaults.js";import o from"react-markdown";import l from"rehype-raw";import d from"./CitationComponent.module.css.js";import{ChevronUp as s}from"lucide-react";import{ReactComponent as m}from"../icons/cognitiveBrain.svg.js";import{ReactComponent as v}from"../icons/aiMagic.svg.js";import _ from"./CitationAnchor.js";var h=function(c){var n=c.text,t=c.item;return i(o,e({rehypePlugins:[l],components:{ol:function(c){var n=c.children;return i("ol",e({className:d["md-ol"]},{children:n}))},ul:function(c){var n=c.children;return i("ul",e({className:d["md-ul"]},{children:n}))},li:function(c){var n=c.children;return i("li",e({className:d["md-li"]},{children:n}))},a:function(e){e.node;var c=e.href,n=e.children;return i(_,{href:c,children:n,metaData:{citations:t.citations,docData:t.docData}})}}},{children:n.replace(/<br\s*\/?>/gi,"\n")}))};function p(o){var l=o.item,_=o.title,p=void 0===_?"Cognitive Decisioning AI":_,u=o.relevanceScore,N=void 0===u?0:u,f=o.showRelevanceScore,y=void 0===f||f,b=o.reason,x=void 0===b?"No reasoning provided.":b,g=o.impact,C=void 0===g?"No Impact provided.":g,k=o.explaination,H=void 0===k?"No explaination provided.":k,B=o.gap,j=void 0===B?"None":B,D=o.onClose,T=void 0===D?function(){}:D,A=o.onAccept,I=o.onReject,L=o.showResolveBtns,R=void 0!==L&&L,w=o.sections,P=o.leftIcon,M=o.scoreIcon,E=o.className,G=o.customStyles,S=void 0===G?{}:G,F=o.onBackClick,q=o.isImpactNeeded,z=void 0===q||q,J=o.cognitiveTitle,K=void 0===J?"Cognitive Integrity":J,O=o.labels,Q=void 0===O?{}:O,U=a(function(){var e=Number(N);return Number.isNaN(e)?0:Math.max(0,Math.min(100,Math.round(e)))},[N]),V=a(function(){var e=Q&&Q.noGapsText||"1. No gaps identified.";return function(e){if(!e)return!0;var c=e.trim().toLowerCase();return"none"===c||"no gap"===c||"no gaps"===c||"n/a"===c}(j)?e:j},[j]),W=Q&&Q.impact||"Impact",X=Q&&Q.explanation||"Explaination",Y=Q&&Q.decisionFactors||"Decision Making Factors",Z=Q&&Q.gaps||"Gaps in Decision",$=Q&&Q.accept||"Accept",ee=Q&&Q.reject||"Reject",ce=Q&&Q.backAriaLabel||"Go back";return c("div",e({className:"".concat(d["cite-acc"]," ").concat(E||""),style:e(e({},r.CitationAccordionDefaults.container),null==S?void 0:S.container)},{children:[F&&c("div",e({className:d["cite-acc__backHeader"]},{children:[i("button",e({type:"button",className:d["cite-acc__backBtn"],onClick:function(e){e.stopPropagation(),F&&F()},"aria-label":ce},{children:"‹"})),i("span",e({className:d["cite-acc__backTitle"]},{children:K}))]})),w&&w.length>0?w.map(function(n){return!1===n.show?null:c("div",e({className:"".concat(d["cite-acc__explain-body"]," ").concat(n.bodyClassName||"")},{children:[c("div",e({className:d["cite-acc__innerHeader"],style:e(e({},r.CitationAccordionDefaults.innerHeader),null==S?void 0:S.innerHeader)},{children:[i("div",e({className:d["cite-acc__innerHeaderLeft"]},{children:i("div",{children:i("div",e({className:d["cite-acc__innerTitle"]},{children:n.title}))})})),i("button",e({type:"button",onClick:function(e){e.stopPropagation(),T&&T()}},{children:i(s,{})}))]})),i("div",e({className:"".concat(d["cite-acc__innerBody"]," text-sm text-gray-600"),style:e(e({},r.CitationAccordionDefaults.innerBody),null==S?void 0:S.innerBody)},{children:"string"==typeof n.content?i(h,{text:n.content,item:n.item||l||{}}):n.content}))]}),n.id||n.title)}):c(n,{children:[z&&c("div",e({className:d["cite-acc__explain-body"]},{children:[c("div",e({className:d["cite-acc__innerHeader"]},{children:[i("div",e({className:d["cite-acc__innerHeaderLeft"]},{children:i("div",{children:i("div",e({className:d["cite-acc__innerTitle"]},{children:W}))})})),i("button",e({type:"button",onClick:function(e){e.stopPropagation(),T&&T()}},{children:i(s,{})}))]})),i("div",e({className:"".concat(d["cite-acc__innerBody"]," text-sm text-gray-600")},{children:i(h,{text:C||"",item:l||{}})}))]})),c("div",e({className:d["cite-acc__explain-body"]},{children:[i("div",e({className:d["cite-acc__innerHeader"]},{children:i("div",e({className:d["cite-acc__innerHeaderLeft"]},{children:i("div",{children:i("div",e({className:d["cite-acc__innerTitle"]},{children:X}))})}))})),i("div",e({className:"".concat(d["cite-acc__innerBody"]," text-sm text-gray-600")},{children:i(h,{text:H||"",item:{}})}))]})),R&&c("div",e({className:d["cite-acc__btn-container"]},{children:[i("button",e({className:d["btn-reject"],onClick:I},{children:ee})),i("button",e({className:d["btn-accept"],onClick:A},{children:$}))]})),c("div",e({className:d["cite-acc__header"]},{children:[c("div",e({className:d["cite-acc__headerLeft"]},{children:[i("span",e({className:d["cite-acc__titleIcon"]},{children:P?"function"==typeof P?t.createElement(P):P:i(m,{})})),i("div",e({className:d["cite-acc__title"]},{children:p}))]})),i("div",e({className:d["cite-acc__headerRight"]},{children:y&&c("span",e({className:d["cite-acc__scoreBadge"]},{children:[M?"function"==typeof M?t.createElement(M):M:i(v,{}),c("span",e({className:d["cite-acc__scoreText"]},{children:[U,"%"]}))]}))}))]})),c("div",e({className:d["cite-acc__explain-body"]},{children:[i("div",e({className:d["cite-acc__innerHeader"]},{children:i("div",e({className:d["cite-acc__innerHeaderLeft"]},{children:i("div",{children:i("div",e({className:d["cite-acc__innerTitle"]},{children:Y}))})}))})),i("div",e({className:"".concat(d["cite-acc__innerBody"]," text-sm text-gray-600")},{children:i(h,{text:x||"",item:l||{}})}))]})),c("div",e({className:"".concat(d["cite-acc__explain-body"]," ").concat(d["cite-acc__explain-body_border"])},{children:[i("div",e({className:d["cite-acc__innerHeader"]},{children:i("div",e({className:d["cite-acc__innerHeaderLeft"]},{children:i("div",{children:i("div",e({className:d["cite-acc__innerTitle"]},{children:Z}))})}))})),i("div",e({className:"".concat(d["cite-acc__innerBody"]," text-sm text-gray-600")},{children:i(h,{text:V||"",item:l||{}})}))]}))]})]}))}export{p as default};
1
+ import{__assign as e}from"tslib";import{jsxs as c,jsx as i,Fragment as a}from"react/jsx-runtime";import n,{useMemo as t}from"react";import r from"../Popups/PopupDefaults.js";import o from"react-markdown";import l from"rehype-raw";import d from"./CitationComponent.module.css.js";import{ChevronUp as s}from"lucide-react";import{ReactComponent as m}from"../icons/cognitiveBrain.svg.js";import{ReactComponent as v}from"../icons/aiMagic.svg.js";import _ from"./CitationAnchor.js";var p=function(c){var a=c.text,n=c.item;return i(o,e({rehypePlugins:[l],components:{ol:function(c){var a=c.children;return i("ol",e({className:d["md-ol"]},{children:a}))},ul:function(c){var a=c.children;return i("ul",e({className:d["md-ul"]},{children:a}))},li:function(c){var a=c.children;return i("li",e({className:d["md-li"]},{children:a}))},a:function(e){e.node;var c=e.href,a=e.children;return i(_,{href:c,children:a,metaData:{citations:n.citations,docData:n.docData}})}}},{children:a.replace(/<br\s*\/?>/gi,"\n")}))};function h(o){var l=o.item,_=o.title,h=void 0===_?"Cognitive Decisioning AI":_,u=o.relevanceScore,N=void 0===u?0:u,f=o.showRelevanceScore,b=void 0===f||f,y=o.reason,x=void 0===y?"No reasoning provided.":y,g=o.impact,C=void 0===g?"No Impact provided.":g,k=o.explaination,B=void 0===k?"No explaination provided.":k,H=o.gap,j=void 0===H?"None":H,D=o.onClose,A=void 0===D?function(){}:D,T=o.onAccept,I=o.onReject,L=o.showResolveBtns,w=void 0!==L&&L,R=o.sections,P=o.leftIcon,M=o.scoreIcon,S=o.className,E=o.customStyles,G=void 0===E?{}:E,F=o.actions,q=o.disableAllActions,z=void 0!==q&&q,J=o.actionBtnDisabledStyle,K=void 0===J?{}:J,O=o.onBackClick,Q=o.isImpactNeeded,U=void 0===Q||Q,V=o.cognitiveTitle,W=void 0===V?"Cognitive Integrity":V,X=o.labels,Y=void 0===X?{}:X,Z=t(function(){var e=Number(N);return Number.isNaN(e)?0:Math.max(0,Math.min(100,Math.round(e)))},[N]),$=t(function(){var e=Y&&Y.noGapsText||"1. No gaps identified.";return function(e){if(!e)return!0;var c=e.trim().toLowerCase();return"none"===c||"no gap"===c||"no gaps"===c||"n/a"===c}(j)?e:j},[j]),ee=Y&&Y.impact||"Impact",ce=Y&&Y.explanation||"Explaination",ie=Y&&Y.decisionFactors||"Decision Making Factors",ae=Y&&Y.gaps||"Gaps in Decision",ne=Y&&Y.accept||"Accept",te=Y&&Y.reject||"Reject",re=Y&&Y.backAriaLabel||"Go back",oe=F||[{id:"reject",label:te,onClick:I,className:d["btn-reject"]},{id:"accept",label:ne,onClick:T,className:d["btn-accept"]}];return c("div",e({className:"".concat(d["cite-acc"]," ").concat(S||""),style:e(e({},r.CitationAccordionDefaults.container),null==G?void 0:G.container)},{children:[O&&c("div",e({className:d["cite-acc__backHeader"]},{children:[i("button",e({type:"button",className:d["cite-acc__backBtn"],onClick:function(e){e.stopPropagation(),O&&O()},"aria-label":re},{children:"‹"})),i("span",e({className:d["cite-acc__backTitle"]},{children:W}))]})),R&&R.length>0?R.map(function(a){return!1===a.show?null:c("div",e({className:"".concat(d["cite-acc__explain-body"]," ").concat(a.bodyClassName||"")},{children:[c("div",e({className:d["cite-acc__innerHeader"],style:e(e({},r.CitationAccordionDefaults.innerHeader),null==G?void 0:G.innerHeader)},{children:[i("div",e({className:d["cite-acc__innerHeaderLeft"]},{children:i("div",{children:i("div",e({className:d["cite-acc__innerTitle"]},{children:a.title}))})})),i("button",e({type:"button",onClick:function(e){e.stopPropagation(),A&&A()}},{children:i(s,{})}))]})),i("div",e({className:"".concat(d["cite-acc__innerBody"]," text-sm text-gray-600"),style:e(e({},r.CitationAccordionDefaults.innerBody),null==G?void 0:G.innerBody)},{children:"string"==typeof a.content?i(p,{text:a.content,item:a.item||l||{}}):a.content}))]}),a.id||a.title)}):c(a,{children:[U&&c("div",e({className:d["cite-acc__explain-body"]},{children:[c("div",e({className:d["cite-acc__innerHeader"]},{children:[i("div",e({className:d["cite-acc__innerHeaderLeft"]},{children:i("div",{children:i("div",e({className:d["cite-acc__innerTitle"]},{children:ee}))})})),i("button",e({type:"button",onClick:function(e){e.stopPropagation(),A&&A()}},{children:i(s,{})}))]})),i("div",e({className:"".concat(d["cite-acc__innerBody"]," text-sm text-gray-600")},{children:i(p,{text:C||"",item:l||{}})}))]})),c("div",e({className:d["cite-acc__explain-body"]},{children:[i("div",e({className:d["cite-acc__innerHeader"]},{children:i("div",e({className:d["cite-acc__innerHeaderLeft"]},{children:i("div",{children:i("div",e({className:d["cite-acc__innerTitle"]},{children:ce}))})}))})),i("div",e({className:"".concat(d["cite-acc__innerBody"]," text-sm text-gray-600")},{children:i(p,{text:B||"",item:{}})}))]})),w&&i("div",e({className:d["cite-acc__btn-container"]},{children:oe.map(function(c){var a=z||c.disabled;return i("button",e({className:c.className,onClick:a?void 0:c.onClick,disabled:a,style:e(e({},c.style),a?e(e({opacity:.5,cursor:"not-allowed"},K),c.disabledStyle):{})},{children:c.label}),c.id)})})),c("div",e({className:d["cite-acc__header"]},{children:[c("div",e({className:d["cite-acc__headerLeft"]},{children:[i("span",e({className:d["cite-acc__titleIcon"]},{children:P?"function"==typeof P?n.createElement(P):P:i(m,{})})),i("div",e({className:d["cite-acc__title"]},{children:h}))]})),i("div",e({className:d["cite-acc__headerRight"]},{children:b&&c("span",e({className:d["cite-acc__scoreBadge"]},{children:[M?"function"==typeof M?n.createElement(M):M:i(v,{}),c("span",e({className:d["cite-acc__scoreText"]},{children:[Z,"%"]}))]}))}))]})),c("div",e({className:d["cite-acc__explain-body"]},{children:[i("div",e({className:d["cite-acc__innerHeader"]},{children:i("div",e({className:d["cite-acc__innerHeaderLeft"]},{children:i("div",{children:i("div",e({className:d["cite-acc__innerTitle"]},{children:ie}))})}))})),i("div",e({className:"".concat(d["cite-acc__innerBody"]," text-sm text-gray-600")},{children:i(p,{text:x||"",item:l||{}})}))]})),c("div",e({className:"".concat(d["cite-acc__explain-body"]," ").concat(d["cite-acc__explain-body_border"])},{children:[i("div",e({className:d["cite-acc__innerHeader"]},{children:i("div",e({className:d["cite-acc__innerHeaderLeft"]},{children:i("div",{children:i("div",e({className:d["cite-acc__innerTitle"]},{children:ae}))})}))})),i("div",e({className:"".concat(d["cite-acc__innerBody"]," text-sm text-gray-600")},{children:i(p,{text:$||"",item:l||{}})}))]}))]})]}))}export{h as default};
2
2
  //# sourceMappingURL=CognitiveComponent.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"tslib";import{jsxs as i,jsx as o,Fragment as n}from"react/jsx-runtime";import{Info as t,ChevronDown as l,PenLine as r,CheckCircle as d,XCircle as a,ChevronRight as s}from"lucide-react";import{useState as c}from"react";import{ToneToggle as v}from"./ToneToggle.js";import"../CognitiveComponents/CitationComponent.module.css.js";import{ReactComponent as p}from"../icons/cognitiveBrain.svg.js";import{ReactComponent as u}from"../icons/aiMagic.svg.js";var g=[{color:"#1D9E75",angle:-90,arcD:"M1 13 A10 10 0 0 1 1 13"},{color:"#BA7517",angle:0,arcD:"M1 13 A10 10 0 0 1 11 3"},{color:"#E24B4A",angle:90,arcD:"M1 13 A10 10 0 0 1 21 13"}],m=function(n){var t=n.toneIndex,l=n.configs,r=void 0===l?g:l,d=r[Math.min(t,r.length-1)]||r[1]||r[0],a=d.color,s=d.angle,c=d.arcD,v=(s-90)*Math.PI/180,p=11+9*Math.cos(v),u=13+9*Math.sin(v);return i("svg",e({width:"22",height:"14",viewBox:"0 0 22 14",fill:"none"},{children:[o("path",{d:"M1 13 A10 10 0 0 1 21 13",stroke:"#e5e5e5",strokeWidth:"2.5",strokeLinecap:"round"}),o("path",{d:c,stroke:a,strokeWidth:"2.5",strokeLinecap:"round"}),o("line",{x1:"11",y1:"13",x2:p,y2:u,stroke:a,strokeWidth:"2",strokeLinecap:"round"})]}))},y=function(i){var n=i.type,t=i.customStyles,l=void 0===t?{}:t,r=e(e({},{High:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #FECACA",background:"#FEF2F2",color:"#B91C1C",fontSize:"11px",fontWeight:"500"},Medium:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #F2E5A1",background:"#FFFBEB",color:"#B45309",fontSize:"11px",fontWeight:"500"},Low:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #8098F9",background:"#DBEAFE",color:"#444CE7",fontSize:"11px",fontWeight:"500"}}),l),d=r[n]||r.Medium;return o("div",e({style:d},{children:n}))},f=["Lenient","Balanced","Aggressive"],h={Lenient:"#1D9E75",Balanced:"#BA7517",Aggressive:"#E24B4A"},x={width:"350px",background:"#fff",border:"1px solid #ddd",borderRadius:"8px",padding:"16px",maxHeight:"400px",overflow:"auto"},S={display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12},b={fontSize:11,fontWeight:500,letterSpacing:"0.08em",color:"#E24B4A",textTransform:"uppercase"},C={fontSize:15,fontWeight:500,margin:"0 0 8px",color:"#111"},B={fontSize:13,color:"#666",lineHeight:1.6,margin:"0 0 14px"},I={marginBottom:14,borderTop:"0.5px solid #eee",paddingTop:12},k={display:"flex",alignItems:"center",gap:6,background:"none",border:"none",cursor:"pointer",padding:0,width:"100%"},A={fontSize:11,fontWeight:500,textTransform:"uppercase",letterSpacing:"0.08em",color:"#E24B4A"},D={display:"flex",gap:8,marginBottom:18},T={flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:5,fontSize:12,fontWeight:500,padding:"7px 4px",borderRadius:8,border:"0.5px solid #ccc",background:"#fff",cursor:"pointer"},w={background:"none",border:"none",cursor:"pointer",fontSize:16,color:"#888",lineHeight:1,padding:0},z={borderTop:"0.5px solid #eee",paddingTop:14},R={display:"flex",alignItems:"center",width:"100%",background:"none",border:"none",cursor:"pointer",padding:0,marginBottom:4},W={cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"12px",borderTop:"1px solid #eee",borderBottom:"none",paddingLeft:"12px",paddingRight:"12px"},E={display:"flex",alignItems:"center",gap:"4px",minWidth:0,flex:"1 1 auto",overflow:"hidden"},j={width:"28px",height:"28px",display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 28px"},L={fontSize:"13px",color:"#101828",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},M={display:"flex",alignItems:"center",gap:"10px",flex:"0 0 auto",minWidth:0,flexWrap:"nowrap"},F={display:"flex",padding:"4px 8px",alignItems:"center",gap:"4px",borderRadius:"var(--chip-border-radius, 16px)",border:"1px solid var(--Primitive-Gray-300, #d0d5dd)",flex:"0 1 auto",minWidth:0},H={color:"var(--Primitive-Purple-600, #6938ef)",fontFamily:"Inter",fontSize:"12px",fontStyle:"normal",fontWeight:500,lineHeight:"150%"};function N(N){var _,P,O,G,q,J,K,Q,U,V,X,Y,Z,$,ee,ie,oe,ne,te,le=N.onClose,re=N.aiReason,de=N.onAccept,ae=N.onReject,se=N.onIterate,ce=N.initialTone,ve=N.onRegenerate,pe=N.labels,ue=void 0===pe?{}:pe,ge=N.toneLevelsConfig,me=void 0===ge?f:ge,ye=N.toneColorsConfig,fe=void 0===ye?h:ye,he=N.dialConfigs,xe=void 0===he?g:he,Se=N.customStyles,be=void 0===Se?{}:Se,Ce=N.severityChipStyles,Be=void 0===Ce?{}:Ce,Ie=N.customIcons,ke=void 0===Ie?{}:Ie,Ae=N.onOpenCognitive,De=N.showTone,Te=void 0===De||De,we=N.cognitiveSectionStyle,ze=void 0===we?{}:we,Re=N.cognitiveScoreBadgeStyle,We=void 0===Re?{}:Re,Ee=N.cognitiveScoreTextStyle,je=void 0===Ee?{}:Ee,Le=N.cognitiveStyles,Me=void 0===Le?{}:Le,Fe=N.cognitiveClassNames,He=void 0===Fe?{}:Fe,Ne=N.cognitiveTitle,_e=void 0===Ne?"Cognitive Integrity":Ne,Pe=N.cognitiveLeftIcon,Oe=N.showCognitiveRightArrow,Ge=void 0===Oe||Oe,qe=N.isStreaming,Je=me.findIndex(function(e){return e===ce});-1===Je&&(Je=1);var Ke=c(!0),Qe=Ke[0],Ue=Ke[1],Ve=c(!1),Xe=Ve[0],Ye=Ve[1],Ze=c(Je),$e=Ze[0],ei=Ze[1],ii=c(Je)[0],oi=me[$e],ni=fe[oi]||"#BA7517",ti=$e!==ii;return i("div",e({onClick:function(e){return e.stopPropagation()},style:e(e({},x),null===(_=null==be?void 0:be.DeviationSummaryStyles)||void 0===_?void 0:_.root)},{children:[i("div",e({style:e(e({},S),null===(P=null==be?void 0:be.DeviationSummaryStyles)||void 0===P?void 0:P.header)},{children:[i("div",e({style:{display:"flex",alignItems:"center",gap:6}},{children:[o("span",{children:ke.summaryIcon||o(t,{size:16,color:"#E24B4A"})}),o("span",e({style:e(e({},b),null===(O=null==be?void 0:be.DeviationSummaryStyles)||void 0===O?void 0:O.title)},{children:ue.summaryHeader||"Summary"}))]})),o("button",e({onClick:le,style:e(e({},w),null===(G=null==be?void 0:be.DeviationSummaryStyles)||void 0===G?void 0:G.closeBtn)},{children:"✕"}))]})),o("p",e({style:e(e({},C),null===(q=null==be?void 0:be.DeviationSummaryStyles)||void 0===q?void 0:q.bodyText)},{children:null===(J=null==re?void 0:re.deviation_details)||void 0===J?void 0:J.deviation_title})),o("p",e({style:e(e({},B),null===(K=null==be?void 0:be.DeviationSummaryStyles)||void 0===K?void 0:K.summary)},{children:null===(Q=null==re?void 0:re.deviation_details)||void 0===Q?void 0:Q.deviation_summary})),i("div",e({style:e(e({},I),null===(U=null==be?void 0:be.DeviationSummaryStyles)||void 0===U?void 0:U.impactContainer)},{children:[i("div",e({style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},{children:[i("button",e({onClick:function(){return Ue(!Qe)},style:e(e({},k),null===(V=null==be?void 0:be.DeviationSummaryStyles)||void 0===V?void 0:V.impactToggle)},{children:[o("span",e({style:e(e({},A),null===(X=null==be?void 0:be.DeviationSummaryStyles)||void 0===X?void 0:X.impactToggleLabel)},{children:ue.impactHeader||"Impact"})),o("span",e({style:{fontSize:12,color:"#E24B4A",transition:"transform 0.2s",display:"flex",alignItems:"center",transform:Qe?"rotate(180deg)":"rotate(0deg)"}},{children:o(l,{size:16,color:"#E24B4A"})}))]})),o(y,{type:(null==re?void 0:re.severity)||"Medium",customStyles:Be})]})),Qe&&o("p",e({style:{fontSize:13,color:"#666",lineHeight:1.6,margin:"8px 0 0"}},{children:null!==(Z=null===(Y=null==re?void 0:re.deviation_details)||void 0===Y?void 0:Y.deviation_impact)&&void 0!==Z?Z:ue.fallbackImpact||"This change reduces compliance obligations and lowers contractual risk thresholds."}))]})),i("div",e({style:e(e({},D),null===($=null==be?void 0:be.DeviationSummaryStyles)||void 0===$?void 0:$.actionContainer)},{children:[i("button",e({style:e(e(e({},T),null===(ee=null==be?void 0:be.DeviationSummaryStyles)||void 0===ee?void 0:ee.actionBtn),{color:"#64748B"}),onClick:se},{children:[ke.iterateIcon||o(r,{size:16,color:"#64748B"}),ue.btnIterate||"Iterate"]}),"Iterate"),i("button",e({style:e(e(e({},T),null===(ie=null==be?void 0:be.DeviationSummaryStyles)||void 0===ie?void 0:ie.actionBtn),{color:"#10B981"}),onClick:de},{children:[ke.acceptIcon||o(d,{size:16,color:"#10B981"}),ue.btnAccept||"Approve"]}),"Accept"),i("button",e({style:e(e(e({},T),null===(oe=null==be?void 0:be.DeviationSummaryStyles)||void 0===oe?void 0:oe.actionBtn),{color:"#DC2626"}),onClick:ae},{children:[ke.rejectIcon||o(a,{size:16,color:"#DC2626"}),ue.btnReject||"Reject"]}),"reject")]})),Te&&i("div",e({style:e(e({},z),null===(ne=null==be?void 0:be.DeviationSummaryStyles)||void 0===ne?void 0:ne.toneContainer)},{children:[i("button",e({onClick:function(){return Ye(!Xe)},style:e(e({},R),null===(te=null==be?void 0:be.DeviationSummaryStyles)||void 0===te?void 0:te.toneToggleBtn)},{children:[i("div",e({style:{display:"flex",alignItems:"center",gap:8}},{children:[o(m,{toneIndex:$e,configs:xe}),o("span",e({style:{fontSize:13,fontWeight:500,color:"#111"}},{children:ue.toneHeader||"Redline Tone"}))]})),o("span",e({style:{transition:"transform 0.2s",display:"flex",alignItems:"center",transform:Xe?"rotate(180deg)":"rotate(0deg)"}},{children:o(l,{size:16,color:"#111"})}))]})),Xe&&i(n,{children:[o("p",e({style:{fontSize:12,color:"#888",margin:"0 0 12px"}},{children:ue.toneDescription||"Controls how assertively AI is redlining"})),o(v,{isDirty:ti,onToneChange:function(e){ei(e)},toneColor:ni,toneIndex:$e,onClickRegenerate:function(){return null==ve?void 0:ve(oi)},toneLabels:me,isStreaming:qe,aiReason:re})]})]})),Ae&&i("div",e({className:null==He?void 0:He.section,onClick:function(e){e.stopPropagation(),Ae&&Ae(e)},style:e(e(e({},W),null==Me?void 0:Me.section),ze)},{children:[i("div",e({className:null==He?void 0:He.headerLeft,style:e(e({},E),null==Me?void 0:Me.headerLeft)},{children:[o("span",e({className:null==He?void 0:He.titleIcon,style:e(e({},j),null==Me?void 0:Me.titleIcon)},{children:null!=Pe?Pe:o(p,{})})),o("div",e({className:null==He?void 0:He.cognitiveTitle,style:e(e({},L),null==Me?void 0:Me.cognitiveTitle)},{children:_e}))]})),i("div",e({className:null==He?void 0:He.headerRight,style:e(e({},M),null==Me?void 0:Me.headerRight)},{children:[void 0!==(null==re?void 0:re.relevance_score)&&null!==(null==re?void 0:re.relevance_score)?i("span",e({className:null==He?void 0:He.scoreBadge,style:e(e(e({},F),null==Me?void 0:Me.scoreBadge),We)},{children:[o(u,{}),i("span",e({className:null==He?void 0:He.scoreText,style:e(e(e({},H),null==Me?void 0:Me.scoreText),je)},{children:[Math.round(Number(re.relevance_score)),"%"]}))]})):null,Ge&&o("span",e({style:{display:"flex",alignItems:"center"}},{children:o(s,{size:16,color:"#64748B"})}))]}))]}))]}))}export{N as default};
1
+ import{__assign as e}from"tslib";import{jsx as i,jsxs as o,Fragment as n}from"react/jsx-runtime";import{PenLine as t,CheckCircle as l,XCircle as r,Info as d,ChevronDown as a,ChevronRight as s}from"lucide-react";import{useState as c}from"react";import{ToneToggle as p}from"./ToneToggle.js";import"../CognitiveComponents/CitationComponent.module.css.js";import{ReactComponent as v}from"../icons/cognitiveBrain.svg.js";import{ReactComponent as u}from"../icons/aiMagic.svg.js";var g=[{color:"#1D9E75",angle:-90,arcD:"M1 13 A10 10 0 0 1 1 13"},{color:"#BA7517",angle:0,arcD:"M1 13 A10 10 0 0 1 11 3"},{color:"#E24B4A",angle:90,arcD:"M1 13 A10 10 0 0 1 21 13"}],m=function(n){var t=n.toneIndex,l=n.configs,r=void 0===l?g:l,d=r[Math.min(t,r.length-1)]||r[1]||r[0],a=d.color,s=d.angle,c=d.arcD,p=(s-90)*Math.PI/180,v=11+9*Math.cos(p),u=13+9*Math.sin(p);return o("svg",e({width:"22",height:"14",viewBox:"0 0 22 14",fill:"none"},{children:[i("path",{d:"M1 13 A10 10 0 0 1 21 13",stroke:"#e5e5e5",strokeWidth:"2.5",strokeLinecap:"round"}),i("path",{d:c,stroke:a,strokeWidth:"2.5",strokeLinecap:"round"}),i("line",{x1:"11",y1:"13",x2:v,y2:u,stroke:a,strokeWidth:"2",strokeLinecap:"round"})]}))},y=function(o){var n=o.type,t=o.customStyles,l=void 0===t?{}:t,r=e(e({},{High:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #FECACA",background:"#FEF2F2",color:"#B91C1C",fontSize:"11px",fontWeight:"500"},Medium:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #F2E5A1",background:"#FFFBEB",color:"#B45309",fontSize:"11px",fontWeight:"500"},Low:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #8098F9",background:"#DBEAFE",color:"#444CE7",fontSize:"11px",fontWeight:"500"}}),l),d=r[n]||r.Medium;return i("div",e({style:d},{children:n}))},f=["Lenient","Balanced","Aggressive"],h={Lenient:"#1D9E75",Balanced:"#BA7517",Aggressive:"#E24B4A"},x={width:"350px",background:"#fff",border:"1px solid #ddd",borderRadius:"8px",padding:"16px",maxHeight:"400px",overflow:"auto"},S={display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12},b={fontSize:11,fontWeight:500,letterSpacing:"0.08em",color:"#E24B4A",textTransform:"uppercase"},C={fontSize:15,fontWeight:500,margin:"0 0 8px",color:"#111"},B={fontSize:13,color:"#666",lineHeight:1.6,margin:"0 0 14px"},I={marginBottom:14,borderTop:"0.5px solid #eee",paddingTop:12},k={display:"flex",alignItems:"center",gap:6,background:"none",border:"none",cursor:"pointer",padding:0,width:"100%"},A={fontSize:11,fontWeight:500,textTransform:"uppercase",letterSpacing:"0.08em",color:"#E24B4A"},D={display:"flex",gap:8,marginBottom:18},T={flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:5,fontSize:12,fontWeight:500,padding:"7px 4px",borderRadius:8,border:"0.5px solid #ccc",background:"#fff",cursor:"pointer"},w={background:"none",border:"none",cursor:"pointer",fontSize:16,color:"#888",lineHeight:1,padding:0},z={borderTop:"0.5px solid #eee",paddingTop:14},R={display:"flex",alignItems:"center",width:"100%",background:"none",border:"none",cursor:"pointer",padding:0,marginBottom:4},W={cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"12px",borderTop:"1px solid #eee",borderBottom:"none",paddingLeft:"12px",paddingRight:"12px"},E={display:"flex",alignItems:"center",gap:"4px",minWidth:0,flex:"1 1 auto",overflow:"hidden"},j={width:"28px",height:"28px",display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 28px"},L={fontSize:"13px",color:"#101828",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},M={display:"flex",alignItems:"center",gap:"10px",flex:"0 0 auto",minWidth:0,flexWrap:"nowrap"},F={display:"flex",padding:"4px 8px",alignItems:"center",gap:"4px",borderRadius:"var(--chip-border-radius, 16px)",border:"1px solid var(--Primitive-Gray-300, #d0d5dd)",flex:"0 1 auto",minWidth:0},H={color:"var(--Primitive-Purple-600, #6938ef)",fontFamily:"Inter",fontSize:"12px",fontStyle:"normal",fontWeight:500,lineHeight:"150%"};function N(N){var _,P,O,G,q,J,K,Q,U,V,X,Y,Z,$,ee,ie,oe=N.onClose,ne=N.aiReason,te=N.onAccept,le=N.onReject,re=N.onIterate,de=N.initialTone,ae=N.onRegenerate,se=N.labels,ce=void 0===se?{}:se,pe=N.toneLevelsConfig,ve=void 0===pe?f:pe,ue=N.toneColorsConfig,ge=void 0===ue?h:ue,me=N.dialConfigs,ye=void 0===me?g:me,fe=N.actions,he=N.disableAllActions,xe=void 0!==he&&he,Se=N.customStyles,be=void 0===Se?{}:Se,Ce=N.severityChipStyles,Be=void 0===Ce?{}:Ce,Ie=N.customIcons,ke=void 0===Ie?{}:Ie,Ae=N.onOpenCognitive,De=N.showTone,Te=void 0===De||De,we=N.cognitiveSectionStyle,ze=void 0===we?{}:we,Re=N.cognitiveScoreBadgeStyle,We=void 0===Re?{}:Re,Ee=N.cognitiveScoreTextStyle,je=void 0===Ee?{}:Ee,Le=N.cognitiveStyles,Me=void 0===Le?{}:Le,Fe=N.cognitiveClassNames,He=void 0===Fe?{}:Fe,Ne=N.cognitiveTitle,_e=void 0===Ne?"Cognitive Integrity":Ne,Pe=N.cognitiveLeftIcon,Oe=N.showCognitiveRightArrow,Ge=void 0===Oe||Oe,qe=N.isStreaming,Je=ve.findIndex(function(e){return e===de});-1===Je&&(Je=1);var Ke=c(!0),Qe=Ke[0],Ue=Ke[1],Ve=c(!1),Xe=Ve[0],Ye=Ve[1],Ze=c(Je),$e=Ze[0],ei=Ze[1],ii=c(Je)[0],oi=ve[$e],ni=ge[oi]||"#BA7517",ti=$e!==ii,li=[{id:"iterate",icon:ke.iterateIcon||i(t,{size:16,color:"#64748B"}),label:ce.btnIterate||"Iterate",color:"#64748B",onClick:re},{id:"accept",icon:ke.acceptIcon||i(l,{size:16,color:"#10B981"}),label:ce.btnAccept||"Approve",color:"#10B981",onClick:te},{id:"reject",icon:ke.rejectIcon||i(r,{size:16,color:"#DC2626"}),label:ce.btnReject||"Reject",color:"#DC2626",onClick:le}],ri=fe||li;return o("div",e({onClick:function(e){return e.stopPropagation()},style:e(e({},x),null===(_=null==be?void 0:be.DeviationSummaryStyles)||void 0===_?void 0:_.root)},{children:[o("div",e({style:e(e({},S),null===(P=null==be?void 0:be.DeviationSummaryStyles)||void 0===P?void 0:P.header)},{children:[o("div",e({style:{display:"flex",alignItems:"center",gap:6}},{children:[i("span",{children:ke.summaryIcon||i(d,{size:16,color:"#E24B4A"})}),i("span",e({style:e(e({},b),null===(O=null==be?void 0:be.DeviationSummaryStyles)||void 0===O?void 0:O.title)},{children:ce.summaryHeader||"Summary"}))]})),i("button",e({onClick:oe,style:e(e({},w),null===(G=null==be?void 0:be.DeviationSummaryStyles)||void 0===G?void 0:G.closeBtn)},{children:"✕"}))]})),i("p",e({style:e(e({},C),null===(q=null==be?void 0:be.DeviationSummaryStyles)||void 0===q?void 0:q.bodyText)},{children:null===(J=null==ne?void 0:ne.deviation_details)||void 0===J?void 0:J.deviation_title})),i("p",e({style:e(e({},B),null===(K=null==be?void 0:be.DeviationSummaryStyles)||void 0===K?void 0:K.summary)},{children:null===(Q=null==ne?void 0:ne.deviation_details)||void 0===Q?void 0:Q.deviation_summary})),o("div",e({style:e(e({},I),null===(U=null==be?void 0:be.DeviationSummaryStyles)||void 0===U?void 0:U.impactContainer)},{children:[o("div",e({style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},{children:[o("button",e({onClick:function(){return Ue(!Qe)},style:e(e({},k),null===(V=null==be?void 0:be.DeviationSummaryStyles)||void 0===V?void 0:V.impactToggle)},{children:[i("span",e({style:e(e({},A),null===(X=null==be?void 0:be.DeviationSummaryStyles)||void 0===X?void 0:X.impactToggleLabel)},{children:ce.impactHeader||"Impact"})),i("span",e({style:{fontSize:12,color:"#E24B4A",transition:"transform 0.2s",display:"flex",alignItems:"center",transform:Qe?"rotate(180deg)":"rotate(0deg)"}},{children:i(a,{size:16,color:"#E24B4A"})}))]})),i(y,{type:(null==ne?void 0:ne.severity)||"Medium",customStyles:Be})]})),Qe&&i("p",e({style:{fontSize:13,color:"#666",lineHeight:1.6,margin:"8px 0 0"}},{children:null!==(Z=null===(Y=null==ne?void 0:ne.deviation_details)||void 0===Y?void 0:Y.deviation_impact)&&void 0!==Z?Z:ce.fallbackImpact||"This change reduces compliance obligations and lowers contractual risk thresholds."}))]})),i("div",e({style:e(e({},D),null===($=null==be?void 0:be.DeviationSummaryStyles)||void 0===$?void 0:$.actionContainer)},{children:ri.map(function(i){var n,t,l=xe||i.disabled,r=l?e(e({cursor:"not-allowed",opacity:.5},null===(n=null==be?void 0:be.DeviationSummaryStyles)||void 0===n?void 0:n.actionBtnDisabled),i.disabledStyle):{};return o("button",e({style:e(e(e(e(e({},T),null===(t=null==be?void 0:be.DeviationSummaryStyles)||void 0===t?void 0:t.actionBtn),{color:i.color}),i.style),r),onClick:l?void 0:i.onClick,disabled:l},{children:[i.icon,i.label]}),i.id)})})),Te&&o("div",e({style:e(e({},z),null===(ee=null==be?void 0:be.DeviationSummaryStyles)||void 0===ee?void 0:ee.toneContainer)},{children:[o("button",e({onClick:function(){return Ye(!Xe)},style:e(e({},R),null===(ie=null==be?void 0:be.DeviationSummaryStyles)||void 0===ie?void 0:ie.toneToggleBtn)},{children:[o("div",e({style:{display:"flex",alignItems:"center",gap:8}},{children:[i(m,{toneIndex:$e,configs:ye}),i("span",e({style:{fontSize:13,fontWeight:500,color:"#111"}},{children:ce.toneHeader||"Redline Tone"}))]})),i("span",e({style:{transition:"transform 0.2s",display:"flex",alignItems:"center",transform:Xe?"rotate(180deg)":"rotate(0deg)"}},{children:i(a,{size:16,color:"#111"})}))]})),Xe&&o(n,{children:[i("p",e({style:{fontSize:12,color:"#888",margin:"0 0 12px"}},{children:ce.toneDescription||"Controls how assertively AI is redlining"})),i(p,{isDirty:ti,onToneChange:function(e){ei(e)},toneColor:ni,toneIndex:$e,onClickRegenerate:function(){return null==ae?void 0:ae(oi)},toneLabels:ve,isStreaming:qe,aiReason:ne})]})]})),Ae&&o("div",e({className:null==He?void 0:He.section,onClick:function(e){e.stopPropagation(),Ae&&Ae(e)},style:e(e(e({},W),null==Me?void 0:Me.section),ze)},{children:[o("div",e({className:null==He?void 0:He.headerLeft,style:e(e({},E),null==Me?void 0:Me.headerLeft)},{children:[i("span",e({className:null==He?void 0:He.titleIcon,style:e(e({},j),null==Me?void 0:Me.titleIcon)},{children:null!=Pe?Pe:i(v,{})})),i("div",e({className:null==He?void 0:He.cognitiveTitle,style:e(e({},L),null==Me?void 0:Me.cognitiveTitle)},{children:_e}))]})),o("div",e({className:null==He?void 0:He.headerRight,style:e(e({},M),null==Me?void 0:Me.headerRight)},{children:[void 0!==(null==ne?void 0:ne.relevance_score)&&null!==(null==ne?void 0:ne.relevance_score)?o("span",e({className:null==He?void 0:He.scoreBadge,style:e(e(e({},F),null==Me?void 0:Me.scoreBadge),We)},{children:[i(u,{}),o("span",e({className:null==He?void 0:He.scoreText,style:e(e(e({},H),null==Me?void 0:Me.scoreText),je)},{children:[Math.round(Number(ne.relevance_score)),"%"]}))]})):null,Ge&&i("span",e({style:{display:"flex",alignItems:"center"}},{children:i(s,{size:16,color:"#64748B"})}))]}))]}))]}))}export{N as default};
2
2
  //# sourceMappingURL=DeviationSummary.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as e}from"tslib";import{jsx as t,jsxs as o}from"react/jsx-runtime";import{Undo2 as n}from"lucide-react";import{useState as r}from"react";import i from"./PopupDefaults.js";function d(e){var t=new Date(e);return isNaN(t.getTime())?e:new Date(e).toLocaleString("en-US",{month:"2-digit",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0}).replace(" AM","AM").replace(" PM","PM")}var l=function(){return o("svg",e({width:"22",height:"22",viewBox:"0 0 22 22",fill:"none"},{children:[t("circle",{cx:"11",cy:"11",r:"10",stroke:"#22c55e",strokeWidth:"2",fill:"#f0fdf4"}),t("path",{d:"M6.5 11.5l3 3 6-6",stroke:"#22c55e",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}))},c=function(){return o("svg",e({width:"22",height:"22",viewBox:"0 0 22 22",fill:"none"},{children:[t("circle",{cx:"11",cy:"11",r:"10",stroke:"#ef4444",strokeWidth:"2",fill:"#fff1f2"}),t("path",{d:"M7.5 7.5l7 7M14.5 7.5l-7 7",stroke:"#ef4444",strokeWidth:"2",strokeLinecap:"round"})]}))},a=function(){return t("svg",e({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},{children:t("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#94a3b8",strokeWidth:"1.8",strokeLinecap:"round"})}))},s=function(){return o("svg",e({width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},{children:[t("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),t("path",{d:"M1.5 13.5c0-3.038 2.462-5.5 5-5.5s5 2.462 5 5.5",stroke:"#94a3b8",strokeWidth:"1.4",strokeLinecap:"round"}),t("path",{d:"M11 8.5l1.5 1.5 2.5-2.5",stroke:"#22c55e",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]}))},h=function(){return o("svg",e({width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},{children:[t("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),t("path",{d:"M1.5 13.5c0-3.038 2.462-5.5 5-5.5s5 2.462 5 5.5",stroke:"#94a3b8",strokeWidth:"1.4",strokeLinecap:"round"}),t("path",{d:"M11.5 8l3 3m0-3l-3 3",stroke:"#ef4444",strokeWidth:"1.4",strokeLinecap:"round"})]}))},u=function(o){var n=o.open;return t("svg",e({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",style:{transform:n?"rotate(0deg)":"rotate(180deg)",transition:"transform 0.25s ease"}},{children:t("path",{d:"M4.5 11.25L9 6.75l4.5 4.5",stroke:"#64748b",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})}))},f=function(n){var r=n.color,i=void 0===r?"#3b82f6":r;return o("svg",e({width:"15",height:"15",viewBox:"0 0 16 16",fill:"none"},{children:[t("path",{d:"M1.5 8A6.5 6.5 0 1 0 4 3.2",stroke:i,strokeWidth:"1.5",strokeLinecap:"round"}),t("path",{d:"M1.5 3.5v4h4",stroke:i,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M8 5v3.5l2 1.5",stroke:i,strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]}))},p=function(){return o("svg",e({width:"15",height:"15",viewBox:"0 0 16 16",fill:"none"},{children:[t("path",{d:"M13.5 8a5.5 5.5 0 1 0-1.6 3.9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round"}),t("path",{d:"M13.5 13v-4.5H9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}))},k=function(){return o("svg",e({width:"15",height:"15",viewBox:"0 0 16 16",fill:"none"},{children:[t("path",{d:"M2 8h12M10 4l4 4-4 4",stroke:"#64748b",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M4 5l-2 3 2 3",stroke:"#64748b",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]}))};function g(n){var r=n.title,i=n.open,d=n.onToggle,l=n.children;return o("div",e({style:{maxHeight:"170px",overflow:"auto"}},{children:[o("div",e({onClick:d,style:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",userSelect:"none",padding:"2px 0"}},{children:[t("span",e({style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"}},{children:r})),t(u,{open:i})]})),t("div",e({style:{maxHeight:i?300:0,opacity:i?1:0,overflow:"hidden",transition:"max-height 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.25s"}},{children:l}))]}))}function b(t){var n=t.icon,r=t.label,i=t.onClick,d=t.customStyle,l=e({display:"flex",alignItems:"center",gap:7,padding:"8px 16px",background:"#f8fafc",border:"1.5px solid #e2e8f0",borderRadius:10,cursor:"pointer",fontSize:"12px",fontWeight:600,color:"#475569",fontFamily:"inherit",transition:"background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.12s",whiteSpace:"nowrap"},void 0===d?{}:d);return o("button",e({onClick:i,style:l,onMouseEnter:function(e){e.currentTarget.style.background="#f1f5f9",e.currentTarget.style.transform="translateY(-1px)",e.currentTarget.style.boxShadow="0 2px 8px rgba(0,0,0,0.07)"},onMouseLeave:function(e){e.currentTarget.style.background="#f8fafc",e.currentTarget.style.transform="",e.currentTarget.style.boxShadow=""}},{children:[n,r]}))}function v(u){var v=u.status,m=u.onClose,y=u.impactText,x=u.secondText,B=u.actionTakenByName,C=u.actionTakenAtTime,L=void 0===C?"NA":C,w=u.onHistory,R=u.onIterate,M=u.onReinstate,W=u.onRevert,S=u.impactTitle,T=void 0===S?"Impact":S,I=u.customConfigs,D=void 0===I?{}:I,j=u.customStyles,z=void 0===j?{}:j,A=r(!0),H=A[0],F=A[1],U=r(!0),E=U[0],N=U[1],P=r(!1),O=P[0],Y=P[1],q={headerBg:"#f0fdf4",headerBorder:"#dcfce7",titleColor:"#166534",label:"Redline Approved",metaLabel:"Approved By",UserIcon:t(s,{}),StatusIcon:t(l,{}),secondTitle:"Original text",secondBg:"#f8fafc",secondBorder:"#e2e8f0",impactBox:!0,actions:[{icon:t(f,{}),label:"History",onClick:w},{icon:t(n,{size:17}),label:"Revert",onClick:W},{icon:t(k,{}),label:"Iterate",onClick:R}]},G={headerBg:"#fff1f2",headerBorder:"#fecdd3",titleColor:"#991b1b",label:"Redline Rejected",metaLabel:"Rejected By",UserIcon:t(h,{}),StatusIcon:t(c,{}),secondTitle:"Rejected Recommendation",secondBg:"#f8fafc",secondBorder:"#e2e8f0",impactBox:!1,actions:[{icon:t(f,{color:"#3b82f6"}),label:"History",onClick:w},{icon:t(p,{}),label:"Reinstate",onClick:M},{icon:t(k,{}),label:"Iterate",onClick:R}]},J={headerBg:"#E2E8F0",headerBorder:"none",titleColor:"#1E293B",label:"Redline Reverted",metaLabel:"Reverted By",UserIcon:t(s,{}),StatusIcon:t(n,{size:17}),secondTitle:"Reverted redline",secondBg:"#F9FAFB",secondBorder:"#D0D5DD",impactBox:!1,actions:[{icon:t(f,{}),label:"History",onClick:w},{icon:t(k,{}),label:"Iterate",onClick:R}]},K=e(e({},"accepted"===v?q:"rejected"===v?G:J),D[v]||{});return o("div",e({style:e(e(e({},i.RedlineCardDefaults.root),{animation:O?"slideOut 0.26s cubic-bezier(0.4,0,1,1) forwards":i.RedlineCardDefaults.root.animation||"slideIn 0.32s cubic-bezier(0.22,1,0.36,1) both"}),z.root)},{children:[o("div",e({style:e(e(e({},i.RedlineCardDefaults.header),{background:K.headerBg,borderBottom:"1.5px solid ".concat(K.headerBorder)}),z.header)},{children:[o("div",e({style:{display:"flex",alignItems:"center",gap:10}},{children:[K.StatusIcon,t("span",e({style:{fontSize:15,fontWeight:700,color:K.titleColor,letterSpacing:"-0.01em"}},{children:K.label}))]})),t("button",e({onClick:function(){Y(!0),m()},style:{background:"none",border:"none",cursor:"pointer",padding:4,borderRadius:6,display:"flex",alignItems:"center"}},{children:t(a,{})}))]})),o("div",e({style:e(e({},i.RedlineCardDefaults.body),z.body)},{children:[o("div",e({style:e(e({},i.RedlineCardDefaults.meta),z.meta)},{children:[o("div",e({style:{display:"flex",alignItems:"center",gap:6,marginBottom:5}},{children:[K.UserIcon,t("span",e({style:{fontSize:12.5,color:"#94a3b8",fontWeight:500}},{children:K.metaLabel}))]})),o("div",e({style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"}},{children:[B,", ",d(L)]}))]})),t("div",{style:e(e({},i.RedlineCardDefaults.divider),z.divider)}),t(g,e({title:T,open:H,onToggle:function(){return F(function(e){return!e})}},{children:t("p",e({style:e(e({},i.RedlineCardDefaults.impactText),z.impactText)},{children:y||""}))})),t("div",{style:e(e({},i.RedlineCardDefaults.divider),z.divider)}),t(g,e({title:K.secondTitle,open:E,onToggle:function(){return N(function(e){return!e})}},{children:t("div",e({style:e(e(e({},i.RedlineCardDefaults.secondSection),{background:K.secondBg,border:"1.5px solid ".concat(K.secondBorder)}),z.secondSection)},{children:x||""}))})),t("div",e({style:e(e({},i.RedlineCardDefaults.actionsContainer),z.actionsContainer)},{children:K.actions.map(function(e){return t(b,{icon:e.icon,label:e.label,onClick:e.onClick,customStyle:e.style},e.label)})}))]}))]}))}export{l as ApprovedIcon,u as ChevronIcon,a as CloseIcon,f as HistoryIcon,k as IterateIcon,v as RedlineCard,p as ReinstateIcon,c as RejectedIcon,s as UserApprovedIcon,h as UserRejectedIcon,d as formatDate};
1
+ import{__assign as e}from"tslib";import{jsx as t,jsxs as o}from"react/jsx-runtime";import{Undo2 as n}from"lucide-react";import{useState as i}from"react";import r from"./PopupDefaults.js";function d(e){var t=new Date(e);return isNaN(t.getTime())?e:new Date(e).toLocaleString("en-US",{month:"2-digit",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0}).replace(" AM","AM").replace(" PM","PM")}var l=function(){return o("svg",e({width:"22",height:"22",viewBox:"0 0 22 22",fill:"none"},{children:[t("circle",{cx:"11",cy:"11",r:"10",stroke:"#22c55e",strokeWidth:"2",fill:"#f0fdf4"}),t("path",{d:"M6.5 11.5l3 3 6-6",stroke:"#22c55e",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}))},a=function(){return o("svg",e({width:"22",height:"22",viewBox:"0 0 22 22",fill:"none"},{children:[t("circle",{cx:"11",cy:"11",r:"10",stroke:"#ef4444",strokeWidth:"2",fill:"#fff1f2"}),t("path",{d:"M7.5 7.5l7 7M14.5 7.5l-7 7",stroke:"#ef4444",strokeWidth:"2",strokeLinecap:"round"})]}))},c=function(){return t("svg",e({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},{children:t("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#94a3b8",strokeWidth:"1.8",strokeLinecap:"round"})}))},s=function(){return o("svg",e({width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},{children:[t("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),t("path",{d:"M1.5 13.5c0-3.038 2.462-5.5 5-5.5s5 2.462 5 5.5",stroke:"#94a3b8",strokeWidth:"1.4",strokeLinecap:"round"}),t("path",{d:"M11 8.5l1.5 1.5 2.5-2.5",stroke:"#22c55e",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]}))},h=function(){return o("svg",e({width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},{children:[t("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),t("path",{d:"M1.5 13.5c0-3.038 2.462-5.5 5-5.5s5 2.462 5 5.5",stroke:"#94a3b8",strokeWidth:"1.4",strokeLinecap:"round"}),t("path",{d:"M11.5 8l3 3m0-3l-3 3",stroke:"#ef4444",strokeWidth:"1.4",strokeLinecap:"round"})]}))},u=function(o){var n=o.open;return t("svg",e({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",style:{transform:n?"rotate(0deg)":"rotate(180deg)",transition:"transform 0.25s ease"}},{children:t("path",{d:"M4.5 11.25L9 6.75l4.5 4.5",stroke:"#64748b",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})}))},f=function(n){var i=n.color,r=void 0===i?"#3b82f6":i;return o("svg",e({width:"15",height:"15",viewBox:"0 0 16 16",fill:"none"},{children:[t("path",{d:"M1.5 8A6.5 6.5 0 1 0 4 3.2",stroke:r,strokeWidth:"1.5",strokeLinecap:"round"}),t("path",{d:"M1.5 3.5v4h4",stroke:r,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M8 5v3.5l2 1.5",stroke:r,strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]}))},p=function(){return o("svg",e({width:"15",height:"15",viewBox:"0 0 16 16",fill:"none"},{children:[t("path",{d:"M13.5 8a5.5 5.5 0 1 0-1.6 3.9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round"}),t("path",{d:"M13.5 13v-4.5H9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}))},k=function(){return o("svg",e({width:"15",height:"15",viewBox:"0 0 16 16",fill:"none"},{children:[t("path",{d:"M2 8h12M10 4l4 4-4 4",stroke:"#64748b",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M4 5l-2 3 2 3",stroke:"#64748b",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]}))};function g(n){var i=n.title,r=n.open,d=n.onToggle,l=n.children;return o("div",e({style:{maxHeight:"170px",overflow:"auto"}},{children:[o("div",e({onClick:d,style:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",userSelect:"none",padding:"2px 0"}},{children:[t("span",e({style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"}},{children:i})),t(u,{open:r})]})),t("div",e({style:{maxHeight:r?300:0,opacity:r?1:0,overflow:"hidden",transition:"max-height 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.25s"}},{children:l}))]}))}function b(t){var n=t.icon,i=t.label,r=t.onClick,d=t.customStyle,l=void 0===d?{}:d,a=t.disabled,c=void 0!==a&&a,s=t.disabledStyle,h=void 0===s?{}:s,u=e(e({display:"flex",alignItems:"center",gap:7,padding:"8px 16px",background:"#f8fafc",border:"1.5px solid #e2e8f0",borderRadius:10,cursor:c?"not-allowed":"pointer",fontSize:"12px",fontWeight:600,color:"#475569",fontFamily:"inherit",transition:"background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.12s",whiteSpace:"nowrap",opacity:c?.5:1},l),c?h:{});return o("button",e({onClick:c?void 0:r,disabled:c,style:u,onMouseEnter:function(e){c||(e.currentTarget.style.background="#f1f5f9",e.currentTarget.style.transform="translateY(-1px)",e.currentTarget.style.boxShadow="0 2px 8px rgba(0,0,0,0.07)")},onMouseLeave:function(e){c||(e.currentTarget.style.background="#f8fafc",e.currentTarget.style.transform="",e.currentTarget.style.boxShadow="")}},{children:[n,i]}))}function v(u){var v=u.status,m=u.onClose,y=u.impactText,x=u.secondText,B=u.actionTakenByName,C=u.actionTakenAtTime,L=void 0===C?"NA":C,w=u.onHistory,R=u.onIterate,S=u.onReinstate,M=u.onRevert,W=u.disableAllActions,T=void 0!==W&&W,I=u.impactTitle,D=void 0===I?"Impact":I,j=u.customConfigs,z=void 0===j?{}:j,A=u.customStyles,H=void 0===A?{}:A,F=i(!0),U=F[0],E=F[1],N=i(!0),P=N[0],O=N[1],Y=i(!1),q=Y[0],G=Y[1],J={headerBg:"#f0fdf4",headerBorder:"#dcfce7",titleColor:"#166534",label:"Redline Approved",metaLabel:"Approved By",UserIcon:t(s,{}),StatusIcon:t(l,{}),secondTitle:"Original text",secondBg:"#f8fafc",secondBorder:"#e2e8f0",impactBox:!0,actions:[{icon:t(f,{}),label:"History",onClick:w},{icon:t(n,{size:17}),label:"Revert",onClick:M},{icon:t(k,{}),label:"Iterate",onClick:R}]},K={headerBg:"#fff1f2",headerBorder:"#fecdd3",titleColor:"#991b1b",label:"Redline Rejected",metaLabel:"Rejected By",UserIcon:t(h,{}),StatusIcon:t(a,{}),secondTitle:"Rejected Recommendation",secondBg:"#f8fafc",secondBorder:"#e2e8f0",impactBox:!1,actions:[{icon:t(f,{color:"#3b82f6"}),label:"History",onClick:w},{icon:t(p,{}),label:"Reinstate",onClick:S},{icon:t(k,{}),label:"Iterate",onClick:R}]},Q={headerBg:"#E2E8F0",headerBorder:"none",titleColor:"#1E293B",label:"Redline Reverted",metaLabel:"Reverted By",UserIcon:t(s,{}),StatusIcon:t(n,{size:17}),secondTitle:"Reverted redline",secondBg:"#F9FAFB",secondBorder:"#D0D5DD",impactBox:!1,actions:[{icon:t(f,{}),label:"History",onClick:w},{icon:t(k,{}),label:"Iterate",onClick:R}]},V=e(e({},"accepted"===v?J:"rejected"===v?K:Q),z[v]||{});return o("div",e({style:e(e(e({},r.RedlineCardDefaults.root),{animation:q?"slideOut 0.26s cubic-bezier(0.4,0,1,1) forwards":r.RedlineCardDefaults.root.animation||"slideIn 0.32s cubic-bezier(0.22,1,0.36,1) both"}),H.root)},{children:[o("div",e({style:e(e(e({},r.RedlineCardDefaults.header),{background:V.headerBg,borderBottom:"1.5px solid ".concat(V.headerBorder)}),H.header)},{children:[o("div",e({style:{display:"flex",alignItems:"center",gap:10}},{children:[V.StatusIcon,t("span",e({style:{fontSize:15,fontWeight:700,color:V.titleColor,letterSpacing:"-0.01em"}},{children:V.label}))]})),t("button",e({onClick:function(){G(!0),m()},style:{background:"none",border:"none",cursor:"pointer",padding:4,borderRadius:6,display:"flex",alignItems:"center"}},{children:t(c,{})}))]})),o("div",e({style:e(e({},r.RedlineCardDefaults.body),H.body)},{children:[o("div",e({style:e(e({},r.RedlineCardDefaults.meta),H.meta)},{children:[o("div",e({style:{display:"flex",alignItems:"center",gap:6,marginBottom:5}},{children:[V.UserIcon,t("span",e({style:{fontSize:12.5,color:"#94a3b8",fontWeight:500}},{children:V.metaLabel}))]})),o("div",e({style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"}},{children:[B,", ",d(L)]}))]})),t("div",{style:e(e({},r.RedlineCardDefaults.divider),H.divider)}),t(g,e({title:D,open:U,onToggle:function(){return E(function(e){return!e})}},{children:t("p",e({style:e(e({},r.RedlineCardDefaults.impactText),H.impactText)},{children:y||""}))})),t("div",{style:e(e({},r.RedlineCardDefaults.divider),H.divider)}),t(g,e({title:V.secondTitle,open:P,onToggle:function(){return O(function(e){return!e})}},{children:t("div",e({style:e(e(e({},r.RedlineCardDefaults.secondSection),{background:V.secondBg,border:"1.5px solid ".concat(V.secondBorder)}),H.secondSection)},{children:x||""}))})),t("div",e({style:e(e({},r.RedlineCardDefaults.actionsContainer),H.actionsContainer)},{children:V.actions.map(function(o){return t(b,{icon:o.icon,label:o.label,onClick:o.onClick,customStyle:e(e({},o.style),H.actionBtn),disabled:T||o.disabled,disabledStyle:H.actionBtnDisabled},o.label)})}))]}))]}))}export{l as ApprovedIcon,u as ChevronIcon,c as CloseIcon,f as HistoryIcon,k as IterateIcon,v as RedlineCard,p as ReinstateIcon,a as RejectedIcon,s as UserApprovedIcon,h as UserRejectedIcon,d as formatDate};
2
2
  //# sourceMappingURL=RedlineStatusCard.js.map
@@ -1,2 +1,2 @@
1
- import{__rest as n,__assign as e}from"tslib";import{jsx as i,jsxs as o}from"react/jsx-runtime";import t,{createContext as r,useRef as l,useState as a,useCallback as d,useMemo as c,useEffect as s,useContext as u}from"react";import v from"react-markdown";import g from"rehype-raw";import p from"./UserStoryWithCitation.module.css.js";import{useMarkdownSearch as m}from"../../shared/useMarkdownSearch.js";import{Info as h}from"lucide-react";import{Tooltip as f}from"@mui/material";import C from"../../shared/UpdatedAnimationContent.js";import y from"../../shared/GeneratedCodeCitation.js";import S from"../../shared/CitationLoadingIndicator.js";import{useRequirementAI as R}from"../RequirementAIWrapper/RequirementAIWrapper.js";import w from"../../icons/CognitiveDecision.js";import I from"../../icons/BrainRed.js";import b,{SHOW_CONFIDENCE_SCORE_THRESHOLD_IN_AI_REASONING as x}from"../ai-reasoning/AiReasoningCitation.js";import N from"../../icons/RelevanceScoreIcon.js";import k from"../RecommendationBlock/RecommendationBlock.js";import A from"../UserStoryCard/AttachedContext.js";import j from"../ai-reasoning/AiReasoningCitationContent.js";import U from"./components/InlineUpdatedComponent.js";import T from"../segment/SegmentWrapper.js";import{MarkdownContextProvider as L}from"../../store/markdown-context.js";var P=r(!1),M=r({expandedInfo:null,setExpanded:function(){},reasonToRow:{current:new Map}}),$=r({rowId:""}),E=function(n){var t,r=n.aiReason,l=n.isHighConfidence,a=n.customStyle,d=n.customIcons,c=u(M),s=c.expandedInfo,v=c.setExpanded,g=c.reasonToRow,m=u($).rowId,h=String(r.id);m&&g.current.set(h,m);var f=(null===(t=null==s?void 0:s.aiReason)||void 0===t?void 0:t.id)===r.id,C=l?(null==d?void 0:d.highConfidence)||i(w,{}):(null==d?void 0:d.lowConfidence)||i(I,{});return o("button",e({className:p.aiReasoningButton,style:a,onClick:function(n){n.stopPropagation(),n.preventDefault(),v(f?null:m,f?null:r)}},{children:[C,i("i",f?{className:"pi pi-angle-up ".concat(l?p.aiReasoningIconHighConfidence:p.aiReasoningIconLowConfidence)}:{className:"pi pi-angle-down ".concat(l?p.aiReasoningIconHighConfidence:p.aiReasoningIconLowConfidence)})]}))},_=function(n){var t,r,a=n.children,d=n.node,c=n.customStyles,s=n.customIcons,v=l(Math.random().toString(36).slice(2)).current,g=u(M).expandedInfo,m=(null==g?void 0:g.rowId)===v,h=Array.isArray(null==d?void 0:d.children)?d.children.filter(function(n){return"element"===n.type}).length:1,f=null!==(r=null===(t=null==d?void 0:d.properties)||void 0===t?void 0:t.style)&&void 0!==r?r:void 0;return o($.Provider,e({value:{rowId:v}},{children:[i("tr",e({style:f?{cssText:f}:void 0},{children:a})),m&&(null==g?void 0:g.aiReason)&&i("tr",e({style:{width:"100%"}},{children:i("td",e({colSpan:h||1,className:p.tableExpandedCell},{children:i("div",e({className:p.tableExpandedCellInner},{children:i("div",e({className:p.tableExpandedCellContent},{children:i(j,{aiReason:g.aiReason,customIcons:s,customStyles:{aiReasoningContent:null==c?void 0:c.aiReasoningContent,aiReasoningAccordion:null==c?void 0:c.aiReasoningAccordion,aiReasoningMarkdown:null==c?void 0:c.aiReasoningMarkdown,aiReasoningPill:null==c?void 0:c.aiReasoningPill,webCitation:null==c?void 0:c.webCitation,stormeeCitation:null==c?void 0:c.stormeeCitation,waveformCitation:null==c?void 0:c.waveformCitation,imageCitation:null==c?void 0:c.imageCitation,fileCitation:null==c?void 0:c.fileCitation,appModCitation:null==c?void 0:c.appModCitation,rcaCitation:null==c?void 0:c.rcaCitation,readFileCitation:null==c?void 0:c.readFileCitation,loadingCitations:null==c?void 0:c.loadingCitations,chatCitation:null==c?void 0:c.chatCitation}})}))}))}))}))]}))};var D=["del","ins"];function F(n){return function(n,e,i){var o=e.join("|");return n.replace(new RegExp("<(".concat(o,")>([\\s\\S]*?)<\\/\\1>"),"gi"),function(n,e,o){return"<".concat(e,">").concat(i(o),"</").concat(e,">")})}(n,D,function(n){return n.split(/(<[^>]+>)/g).map(function(n){return!n||/^<[^>]+>$/.test(n)?n:function(n){if(!n)return n;var e=[];return n.replace(/`([^`\n]+)`/g,function(n,i){var o=e.push(i)-1;return"@@CODE_SPAN_".concat(o,"@@")}).replace(/\*\*([\s\S]+?)\*\*/g,"<strong>$1</strong>").replace(/__([\s\S]+?)__/g,"<strong>$1</strong>").replace(/@@CODE_SPAN_(\d+)@@/g,function(n,i){var o,t=null!==(o=e[Number(i)])&&void 0!==o?o:"";return"<code>".concat(t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"),"</code>")})}(n)}).join("")})}var H=function(r){var w,I=r.message,j=r.noMarkdownContent,$=r.useMarkdown,D=void 0===$||$,H=r.isParent,B=r.scenario,O=r.showUserStoryDiff,q=void 0!==O&&O,W=r.aiReasoningsForBlock,z=r.isCitationLoadingDisplay,V=void 0!==z&&z,G=r.className;r.highConfidenceIcon,r.lowConfidenceIcon;var Q=r.customStyles,J=r.customIcons,K=r.aiReasoningDiffView,X=r.userStoryCitations,Y=r.artifactId,Z=r.isCraflow,nn=r.onCraAccept,en=r.onCraReject,on=r.craFlowConfig,tn=r.isDisplayHighlightControl,rn=void 0!==tn&&tn,ln=l(null),an=R(),dn=an.userStory,cn=an.inlineUpdateComponentConfig,sn=an.getAvgScoreForStory,un=an.setUserStory,vn=an.aiReasoning,gn=an.setAiReasoning,pn=an.customIcons,mn=an.searchQueryList,hn=an.searchQueryReasoningIdList,fn=an.currentHighlightIndex,Cn=an.segmentComponentConfig,yn=null!=J?J:null==pn?void 0:pn.userStoryIcons;null==Q||Q.searchHighlight;var Sn=m(ln),Rn=Sn.search,wn=Sn.clear,In=a("1"),bn=In[0],xn=In[1],Nn=a(null),kn=Nn[0],An=Nn[1],jn=l(new Map),Un=d(function(n,e){An(n&&e?{rowId:n,aiReason:e}:null)},[]),Tn=Y?sn(Y):0,Ln=a([]),Pn=Ln[0],Mn=Ln[1],$n=function(n){return null==n?"":"string"==typeof n?n:"number"==typeof n?String(n):Array.isArray(n)?n.map($n).join(""):t.isValidElement(n)?$n(n.props.children):""},En=function(n){var e=n;return e=function(n){for(var e,i=/<updated[^>]*>[\s\S]*?<\/updated>/gi,o=[],t=new RegExp(i.source,i.flags);null!==(e=t.exec(n));){var r=e[0],l=r.match(/<deleted>([\s\S]*?)<\/deleted>/i),a=r.match(/<changed>([\s\S]*?)<\/changed>/i),d=function(n){return(n.match(/^\s*\d+\.\s/gm)||[]).length};o.push({index:e.index,endIndex:e.index+e[0].length,deletedItemCount:d((null==l?void 0:l[1])||""),changedItemCount:d((null==a?void 0:a[1])||"")})}if(0===o.length)return n;for(var c=n,s=function(n){var e=o[n],i=e.changedItemCount-e.deletedItemCount;if(0===i)return"continue";for(var t=!1,r=0,l=c.substring(0,e.index).split("\n").reverse();r<l.length;r++){var a=l[r].trim();if(""!==a){/^\d+\.\s/.test(a)&&(t=!0);break}}if(!t)return"continue";var d=e.endIndex,s=n+1<o.length?o[n+1].index:c.length,u=c.substring(d,s);u=u.replace(/^(\s*)(\d+)\.\s/gm,function(n,e,o){return"".concat(e).concat(parseInt(o,10)+i,". ")}),c=c.substring(0,d)+u+c.substring(s)},u=o.length-1;u>=0;u--)s(u);return c}(e=(e=(e=(e=(e=e.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,function(n,e){var i=e.replace(/ai_reasoning\$(\d+)/g,function(n,e){return"ai_reasoning$".concat(e,"-legacy")});return"<deleted>".concat(i,"</deleted>")})).replace(/<generatedCode([^>]*)>([\s\S]*?)<\/generatedCode>/gi,function(n,e,i){var o=btoa(encodeURIComponent(i.trim()));return"\n\n<generatedCode".concat(e,' data-raw="').concat(o,'"></generatedCode>\n\n')})).replace(/^(\s*[-*]|\s*\d+\.)\s*\n?\s*(<updated\b)/gm,"$1 $2")).replace(/(<segment\b([^>]*)>)([\s\S]*?)(<\/segment>)/gi,function(n,e,i,o,t){var r=o.match(/<table[\s\S]*?<\/table>/i);if(r){var l=btoa(encodeURIComponent(r[0]));return"<segment".concat(i,' data-table="').concat(l,'"></segment>')}return n})).replace(/<updated([^>]*)>([\s\S]*?)<\/updated>/gi,function(n,i,o,t){var r=e.substring(0,t),l=r.lastIndexOf("\n"),a=/^\s+[-*]\s/.test(r.substring(l+1))||/^\s+\d+\.\s/.test(r.substring(l+1)),d=/^\s*(\d+\.|\s*[-*])\s+$/.test(r.substring(l+1));if(a||d){var c=o;return c=(c=(c=(c=c.replace(/(<deleted>)\s*\n?\s*[-*]\s+/gi,"$1\n")).replace(/(<changed>)\s*\n?\s*[-*]\s+/gi,"$1\n")).replace(/(<deleted>)\s*\n?\s*\d+\.\s+/gi,"$1\n")).replace(/(<changed>)\s*\n?\s*\d+\.\s+/gi,"$1\n"),"<updated".concat(i,">").concat(c,"</updated>")}return n})),e=function(n){var e=n.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,function(n,e){var i=e.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <deleted>",{hadChange:i!==e}),"<deleted>".concat(i,"</deleted>")});return e.replace(/<changed>([\s\S]*?)<\/changed>/gi,function(n,e){var i=e.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <changed>",{hadChange:i!==e,preview:e.substring(0,120)}),"<changed>".concat(i,"</changed>")})}(e),e=F(e)},_n=c(function(){return I?En(I):I},[I]);s(function(){Mn(W||vn)},[W,vn]);var Dn=c(function(){return{upt:function(o){var t;o.node;var r=o.children,l=n(o,["node","children"]),a=null==l?void 0:l.id,d=a?null===(t=a.split("$"))||void 0===t?void 0:t[1]:null,c=vn.find(function(n){return n.id.toString()===d});return c?i(U,e({aiReason:c,customStyles:null==Q?void 0:Q.inlineUpdatedComponent,handleClickCognitiveDecision:null==cn?void 0:cn.handleClickCognitiveDecision,handleClickUpdatedPill:null==cn?void 0:cn.handleClickUpdatedPill,handleClickOutputValue:null==cn?void 0:cn.handleClickOutputValue,customIcons:null==cn?void 0:cn.customIcons},{children:r})):r},del:function(o){o.node;var t=o.children,r=n(o,["node","children"]);return i("span",e({className:p.deleted,style:null==Q?void 0:Q.deleted},r,{onClick:r.onclick},{children:t}))},ins:function(o){var t=o.children,r=n(o,["children"]);return i("span",e({className:p.inserted,style:null==Q?void 0:Q.inserted},r,{onClick:r.onclick},{children:t}))},preserved:function(o){var t=o.children,r=n(o,["children"]);return i("span",e({className:p.preserved,style:null==Q?void 0:Q.preserved},r,{onClick:r.onclick},{children:t}))},h1:function(o){o.node;var t=n(o,["node"]);return i("h1",e({className:p.heading1,style:null==Q?void 0:Q.heading1},{children:t.children}))},h2:function(o){o.node;var t=n(o,["node"]);return i("h2",e({className:p.heading2,style:null==Q?void 0:Q.heading2},{children:t.children}))},h3:function(o){o.node;var t=n(o,["node"]);return i("h3",e({className:p.heading3,style:null==Q?void 0:Q.heading3},{children:t.children}))},b:function(o){o.node;var t=n(o,["node"]);return i("b",e({className:p.bold,style:null==Q?void 0:Q.bold},{children:null==t?void 0:t.children}))},p:function(o){o.node;var t=n(o,["node"]);return i("p",e({},t,{className:p.paragraph,style:null==Q?void 0:Q.paragraph},{children:t.children}))},updated:function(o){var t=o.node,r=n(o,["node"]);return i(C,e({},r,{showUserStoryDiff:q,currentUpdatedTagId:bn,setCurrentUpdatedTagId:xn,userStory:dn,setUserStory:un,setAiReasoning:gn,node:t,isCraflow:Z,onCraAccept:nn,onCraReject:en,customStyles:null==Q?void 0:Q.updatedContent,craFlowConfig:on}))},ol:function(o){var t,r,l,a=o.node,d=n(o,["node"]),c=null!==(l=null!==(r=null===(t=null==a?void 0:a.properties)||void 0===t?void 0:t.start)&&void 0!==r?r:null==d?void 0:d.start)&&void 0!==l?l:void 0;return i("ol",e({className:p.orderedList,style:null==Q?void 0:Q.olist},c?{start:Number(c)}:{},{children:null==d?void 0:d.children}))},ul:function(o){o.node;var t=n(o,["node"]);return i("ul",e({className:p.unorderedList,style:null==Q?void 0:Q.ulist},{children:null==t?void 0:t.children}))},table:function(n){var o=n.children;return i("div",e({className:p.tableWrapper},{children:i("table",e({className:p.table,style:null==Q?void 0:Q.table},{children:o}))}))},tr:function(n){var e=n.node,o=n.children;return i(_,{node:e,children:o,customStyles:Q})},td:function(o){var t,r=o.node,l=o.children,a=null!==(t=null==r?void 0:r.properties)&&void 0!==t?t:{},d=a.style,c=n(a,["style"]);return i(P.Provider,e({value:!0},{children:i("td",e({},c,{style:d?{cssText:d}:void 0},{children:l}))}))},th:function(o){var t,r=o.node,l=o.children,a=null!==(t=null==r?void 0:r.properties)&&void 0!==t?t:{},d=a.style,c=n(a,["style"]);return i(P.Provider,e({value:!0},{children:i("th",e({},c,{style:d?{cssText:d}:void 0},{children:l}))}))},recommendation:function(o){var t;o.node;var r=n(o,["node"]),l="The AI has selected this content based on: ".concat((null===(t=null==r?void 0:r.children)||void 0===t?void 0:t[0])||"");return i(k,e({},r,{customStyles:null==Q?void 0:Q.recommendationBlock,label:l}))},a:function(e){var o,r,l;e.inline;var a=e.children;e.node;var d=n(e,["inline","children","node"]),c=u(P)||"true"==(null==d?void 0:d.table),s="".concat(null==d?void 0:d.href),v=null===(o=s.split("$"))||void 0===o?void 0:o[0],g=null===(r=s.split("$"))||void 0===r?void 0:r[1];if("ai_reasoning"===v){var p=(null!==(l=q?K:vn)&&void 0!==l?l:[]).find(function(n){return n.id.toString()===decodeURIComponent(g)}),m=hn.includes(g);if(p){if(c)return i(E,{aiReason:p,customStyle:null==Q?void 0:Q.tableAiReasoning,customIcons:yn,isHighConfidence:p.relevance_score>=x});var h="source"!==t.Children.toArray(a).join("").trim().toLowerCase();return i(b,{aiReason:p,isSourceHasHighlight:m,inlineLabel:a,isInlineCitation:h,customIcons:yn,customStyles:{aiReasoningContent:null==Q?void 0:Q.aiReasoningContent,aiReasoningAccordion:null==Q?void 0:Q.aiReasoningAccordion,aiReasoningMarkdown:null==Q?void 0:Q.aiReasoningMarkdown,aiReasoningPill:null==Q?void 0:Q.aiReasoningPill,webCitation:null==Q?void 0:Q.webCitation,stormeeCitation:null==Q?void 0:Q.stormeeCitation,waveformCitation:null==Q?void 0:Q.waveformCitation,imageCitation:null==Q?void 0:Q.imageCitation,fileCitation:null==Q?void 0:Q.fileCitation,appModCitation:null==Q?void 0:Q.appModCitation,rcaCitation:null==Q?void 0:Q.rcaCitation,readFileCitation:null==Q?void 0:Q.readFileCitation,loadingCitations:null==Q?void 0:Q.loadingCitations,chatCitation:null==Q?void 0:Q.chatCitation,bigEnoughCitation:null==Q?void 0:Q.bigEnoughCitation}})}}return null},code:function(o){o.inline;var t=o.children,r=o.className;return o.node,n(o,["inline","children","className","node"]),/language-(\w+)/.exec(r||"")||(null==r?void 0:r.includes("language-"))?i("div",{children:i("code",e({className:p.blockCode,style:null==Q?void 0:Q.code},{children:t}))}):i("code",e({className:p.inlineCode,style:null==Q?void 0:Q.code},{children:t}))},learned:function(n){var o=n.children;return i(f,e({title:o,placement:"top"},{children:i(h,{size:16,className:p.learned})}))},generatedcode:function(e){e.node;var o=n(e,["node"]),t=(null==o?void 0:o.language)||"python",r=function(n){var e="";try{if(n["data-raw"])e=decodeURIComponent(atob(n["data-raw"]));else{var i=function(n){var e;return"string"==typeof n?n:Array.isArray(n)?n.map(i).join(""):(null===(e=null==n?void 0:n.props)||void 0===e?void 0:e.children)?i(n.props.children):""};e=i(n.children)}}catch(i){console.error("Error decoding generated code:",i),e=String(n.children)}return e}(o);return i(y,{title:"Generated Code",code:r,language:t,customStyles:{pill:null==Q?void 0:Q.generatedCodePill,content:null==Q?void 0:Q.generatedCodeContent}})},updatedsegment:function(e){var o,t,r,l,a=e.node,d=e.children,c=n(e,["node","children"]),s="".concat(null===(o=a.position)||void 0===o?void 0:o.start.line,"-").concat(null===(t=a.position)||void 0===t?void 0:t.start.column,"-").concat(null===(r=a.position)||void 0===r?void 0:r.end.line,"-").concat(null===(l=a.position)||void 0===l?void 0:l.end.column);return i(T,{id:s,node:a,children:d,props:c,segmentComponentConfig:Cn,customStyles:Q,customIcons:J,extractText:$n,isUpdatedSegment:!0})},segment:function(e){var o,t,r,l,a=e.node,d=e.children,c=n(e,["node","children"]),s="".concat(null===(o=a.position)||void 0===o?void 0:o.start.line,"-").concat(null===(t=a.position)||void 0===t?void 0:t.start.column,"-").concat(null===(r=a.position)||void 0===r?void 0:r.end.line,"-").concat(null===(l=a.position)||void 0===l?void 0:l.end.column);return i(T,{id:s,node:a,children:d,props:c,segmentComponentConfig:Cn,customStyles:Q,customIcons:J,extractText:$n})}}},[Pn,on,vn,X,bn,q,I,J,mn,hn,Q,Cn]);return s(function(){if(ln.current){if(mn.length){var n;if(0===hn.length||rn)requestAnimationFrame(function(){Rn([mn[fn].replace(/\*/g,"")])});else{var e=ln.current,i=new MutationObserver(function(){clearTimeout(n),n=setTimeout(function(){i.disconnect(),requestAnimationFrame(function(){Rn([mn[fn].replace(/\*/g,"")])})},50)});i.observe(e,{childList:!0,subtree:!0})}return function(){clearTimeout(n)}}wn()}},[mn,hn,fn,rn]),i(M.Provider,e({value:{expandedInfo:kn,setExpanded:Un,reasonToRow:jn}},{children:o("div",e({ref:ln,className:"".concat(p.container," ").concat("approving"!==B?p.wrapper:""," ").concat(G||""),style:null==Q?void 0:Q.container},{children:[D?i(L,{children:i(v,e({components:Dn,rehypePlugins:[g]},{children:_n}))}):j,Tn>0&&i("div",e({className:p.confidenceScoreContainer,style:null==Q?void 0:Q.confidenceScoreContainer},{children:o("span",e({className:p.confidenceScore,style:null==Q?void 0:Q.confidenceScore},{children:[i(N,{size:14,color:(null==Q?void 0:Q.confidenceScoreIconColor)||"#166534"}),Tn,"%"]}))})),V&&i("div",e({className:p.citationLoader,style:null==Q?void 0:Q.citationLoaderContainer},{children:i(S,{customStyles:{container:null==Q?void 0:Q.citationLoadingContainer,icon:null==Q?void 0:Q.citationLoadingIcon,text:null==Q?void 0:Q.citationLoadingText}})})),H&&i("div",e({style:e({},null===(w=null==Q?void 0:Q.attachedContext)||void 0===w?void 0:w.wrapper),className:"flex mt-5"},{children:i(A,{customStyles:null==Q?void 0:Q.attachedContext})}))]}))}))};export{H as default};
1
+ import{__rest as n,__assign as e}from"tslib";import{jsx as o,jsxs as i}from"react/jsx-runtime";import t,{createContext as r,useRef as l,useState as a,useCallback as d,useMemo as c,useEffect as s,useContext as u}from"react";import v from"react-markdown";import g from"rehype-raw";import m from"./UserStoryWithCitation.module.css.js";import{useMarkdownSearch as p}from"../../shared/useMarkdownSearch.js";import{Info as h}from"lucide-react";import{Tooltip as f}from"@mui/material";import C from"dompurify";import y from"../../shared/UpdatedAnimationContent.js";import S from"../../shared/GeneratedCodeCitation.js";import w from"../../shared/CitationLoadingIndicator.js";import{useRequirementAI as R}from"../RequirementAIWrapper/RequirementAIWrapper.js";import I from"../../icons/CognitiveDecision.js";import b from"../../icons/BrainRed.js";import x,{SHOW_CONFIDENCE_SCORE_THRESHOLD_IN_AI_REASONING as N}from"../ai-reasoning/AiReasoningCitation.js";import k from"../../icons/RelevanceScoreIcon.js";import A from"../RecommendationBlock/RecommendationBlock.js";import j from"../UserStoryCard/AttachedContext.js";import U from"../ai-reasoning/AiReasoningCitationContent.js";import T from"./components/InlineUpdatedComponent.js";import L from"../segment/SegmentWrapper.js";import{MarkdownContextProvider as M}from"../../store/markdown-context.js";var P=r(!1),_=r({expandedInfo:null,setExpanded:function(){},reasonToRow:{current:new Map}}),E=r({rowId:""}),$=function(n){var t,r=n.aiReason,l=n.isHighConfidence,a=n.customStyle,d=n.customIcons,c=u(_),s=c.expandedInfo,v=c.setExpanded,g=c.reasonToRow,p=u(E).rowId,h=String(r.id);p&&g.current.set(h,p);var f=(null===(t=null==s?void 0:s.aiReason)||void 0===t?void 0:t.id)===r.id,C=l?(null==d?void 0:d.highConfidence)||o(I,{}):(null==d?void 0:d.lowConfidence)||o(b,{});return i("button",e({className:m.aiReasoningButton,style:a,onClick:function(n){n.stopPropagation(),n.preventDefault(),v(f?null:p,f?null:r)}},{children:[C,o("i",f?{className:"pi pi-angle-up ".concat(l?m.aiReasoningIconHighConfidence:m.aiReasoningIconLowConfidence)}:{className:"pi pi-angle-down ".concat(l?m.aiReasoningIconHighConfidence:m.aiReasoningIconLowConfidence)})]}))},D=function(n){var t,r,a=n.children,d=n.node,c=n.customStyles,s=n.customIcons,v=l(Math.random().toString(36).slice(2)).current,g=u(_).expandedInfo,p=(null==g?void 0:g.rowId)===v,h=Array.isArray(null==d?void 0:d.children)?d.children.filter(function(n){return"element"===n.type}).length:1,f=null!==(r=null===(t=null==d?void 0:d.properties)||void 0===t?void 0:t.style)&&void 0!==r?r:void 0;return i(E.Provider,e({value:{rowId:v}},{children:[o("tr",e({style:f?{cssText:f}:void 0},{children:a})),p&&(null==g?void 0:g.aiReason)&&o("tr",e({style:{width:"100%"}},{children:o("td",e({colSpan:h||1,className:m.tableExpandedCell},{children:o("div",e({className:m.tableExpandedCellInner},{children:o("div",e({className:m.tableExpandedCellContent},{children:o(U,{aiReason:g.aiReason,customIcons:s,customStyles:{aiReasoningContent:null==c?void 0:c.aiReasoningContent,aiReasoningAccordion:null==c?void 0:c.aiReasoningAccordion,aiReasoningMarkdown:null==c?void 0:c.aiReasoningMarkdown,aiReasoningPill:null==c?void 0:c.aiReasoningPill,webCitation:null==c?void 0:c.webCitation,stormeeCitation:null==c?void 0:c.stormeeCitation,waveformCitation:null==c?void 0:c.waveformCitation,imageCitation:null==c?void 0:c.imageCitation,fileCitation:null==c?void 0:c.fileCitation,appModCitation:null==c?void 0:c.appModCitation,rcaCitation:null==c?void 0:c.rcaCitation,readFileCitation:null==c?void 0:c.readFileCitation,loadingCitations:null==c?void 0:c.loadingCitations,chatCitation:null==c?void 0:c.chatCitation}})}))}))}))}))]}))};var F=["del","ins"];function H(n){return function(n,e,o){var i=e.join("|");return n.replace(new RegExp("<(".concat(i,")>([\\s\\S]*?)<\\/\\1>"),"gi"),function(n,e,i){return"<".concat(e,">").concat(o(i),"</").concat(e,">")})}(n,F,function(n){return n.split(/(<[^>]+>)/g).map(function(n){return!n||/^<[^>]+>$/.test(n)?n:function(n){if(!n)return n;var e=[];return n.replace(/`([^`\n]+)`/g,function(n,o){var i=e.push(o)-1;return"@@CODE_SPAN_".concat(i,"@@")}).replace(/\*\*([\s\S]+?)\*\*/g,"<strong>$1</strong>").replace(/__([\s\S]+?)__/g,"<strong>$1</strong>").replace(/@@CODE_SPAN_(\d+)@@/g,function(n,o){var i,t=null!==(i=e[Number(o)])&&void 0!==i?i:"";return"<code>".concat(t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"),"</code>")})}(n)}).join("")})}var z=function(r){var I,b=r.message,U=r.noMarkdownContent,E=r.useMarkdown,F=void 0===E||E,z=r.isParent,B=r.scenario,O=r.showUserStoryDiff,q=void 0!==O&&O,W=r.aiReasoningsForBlock,V=r.isCitationLoadingDisplay,G=void 0!==V&&V,Q=r.className;r.highConfidenceIcon,r.lowConfidenceIcon;var J=r.customStyles,K=r.customIcons,X=r.aiReasoningDiffView,Y=r.userStoryCitations,Z=r.artifactId,nn=r.isCraflow,en=r.onCraAccept,on=r.onCraReject,tn=r.craFlowConfig,rn=r.isDisplayHighlightControl,ln=void 0!==rn&&rn,an=l(null),dn=R(),cn=dn.userStory,sn=dn.inlineUpdateComponentConfig,un=dn.getAvgScoreForStory,vn=dn.setUserStory,gn=dn.aiReasoning,mn=dn.setAiReasoning,pn=dn.customIcons,hn=dn.searchQueryList,fn=dn.searchQueryReasoningIdList,Cn=dn.currentHighlightIndex,yn=dn.segmentComponentConfig,Sn=null!=K?K:null==pn?void 0:pn.userStoryIcons;null==J||J.searchHighlight;var wn=p(an),Rn=wn.search,In=wn.clear,bn=a("1"),xn=bn[0],Nn=bn[1],kn=a(null),An=kn[0],jn=kn[1],Un=l(new Map),Tn=d(function(n,e){jn(n&&e?{rowId:n,aiReason:e}:null)},[]),Ln=Z?un(Z):0,Mn=a([]),Pn=Mn[0],_n=Mn[1],En=function(n){return null==n?"":"string"==typeof n?n:"number"==typeof n?String(n):Array.isArray(n)?n.map(En).join(""):t.isValidElement(n)?En(n.props.children):""},$n=function(n){var e=n;return e=function(n){for(var e,o=/<updated[^>]*>[\s\S]*?<\/updated>/gi,i=[],t=new RegExp(o.source,o.flags);null!==(e=t.exec(n));){var r=e[0],l=r.match(/<deleted>([\s\S]*?)<\/deleted>/i),a=r.match(/<changed>([\s\S]*?)<\/changed>/i),d=function(n){return(n.match(/^\s*\d+\.\s/gm)||[]).length};i.push({index:e.index,endIndex:e.index+e[0].length,deletedItemCount:d((null==l?void 0:l[1])||""),changedItemCount:d((null==a?void 0:a[1])||"")})}if(0===i.length)return n;for(var c=n,s=function(n){var e=i[n],o=e.changedItemCount-e.deletedItemCount;if(0===o)return"continue";for(var t=!1,r=0,l=c.substring(0,e.index).split("\n").reverse();r<l.length;r++){var a=l[r].trim();if(""!==a){/^\d+\.\s/.test(a)&&(t=!0);break}}if(!t)return"continue";var d=e.endIndex,s=n+1<i.length?i[n+1].index:c.length,u=c.substring(d,s);u=u.replace(/^(\s*)(\d+)\.\s/gm,function(n,e,i){return"".concat(e).concat(parseInt(i,10)+o,". ")}),c=c.substring(0,d)+u+c.substring(s)},u=i.length-1;u>=0;u--)s(u);return c}(e=(e=(e=(e=(e=(e=e.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,function(n,e){var o=e.replace(/ai_reasoning\$(\d+)/g,function(n,e){return"ai_reasoning$".concat(e,"-legacy")});return"<deleted>".concat(o,"</deleted>")})).replace(/<generatedCode([^>]*)>([\s\S]*?)<\/generatedCode>/gi,function(n,e,o){var i=btoa(encodeURIComponent(o.trim()));return"\n\n<generatedCode".concat(e,' data-raw="').concat(i,'"></generatedCode>\n\n')})).replace(/^(\s*[-*]|\s*\d+\.)\s*\n?\s*(<updated\b)/gm,"$1 $2")).replace(/(<segment\b([^>]*)>)([\s\S]*?)(<\/segment>)/gi,function(n,e,o,i,t){var r=i.match(/<table[\s\S]*?<\/table>/i);if(r){var l=btoa(encodeURIComponent(r[0]));return"<segment".concat(o,' data-table="').concat(l,'"></segment>')}return n})).replace(/<updatedsegment([^>]*)>([\s\S]*?)<\/updatedsegment>/gi,function(n,e,o){if(/<table[\s>]/i.test(o)){var i=btoa(encodeURIComponent(o));return"<updatedsegment".concat(e,' data-raw="').concat(i,'"></updatedsegment>')}return n})).replace(/<updated([^>]*)>([\s\S]*?)<\/updated>/gi,function(n,o,i,t){var r=e.substring(0,t),l=r.lastIndexOf("\n"),a=/^\s+[-*]\s/.test(r.substring(l+1))||/^\s+\d+\.\s/.test(r.substring(l+1)),d=/^\s*(\d+\.|\s*[-*])\s+$/.test(r.substring(l+1));if(a||d){var c=i;return c=(c=(c=(c=c.replace(/(<deleted>)\s*\n?\s*[-*]\s+/gi,"$1\n")).replace(/(<changed>)\s*\n?\s*[-*]\s+/gi,"$1\n")).replace(/(<deleted>)\s*\n?\s*\d+\.\s+/gi,"$1\n")).replace(/(<changed>)\s*\n?\s*\d+\.\s+/gi,"$1\n"),"<updated".concat(o,">").concat(c,"</updated>")}return n})),e=function(n){var e=n.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,function(n,e){var o=e.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <deleted>",{hadChange:o!==e}),"<deleted>".concat(o,"</deleted>")});return e.replace(/<changed>([\s\S]*?)<\/changed>/gi,function(n,e){var o=e.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <changed>",{hadChange:o!==e,preview:e.substring(0,120)}),"<changed>".concat(o,"</changed>")})}(e),e=H(e)},Dn=c(function(){return b?$n(b):b},[b]);s(function(){_n(W||gn)},[W,gn]);var Fn=c(function(){return{upt:function(i){var t;i.node;var r=i.children,l=n(i,["node","children"]),a=null==l?void 0:l.id,d=a?null===(t=a.split("$"))||void 0===t?void 0:t[1]:null,c=gn.find(function(n){return n.id.toString()===d});return c?o(T,e({aiReason:c,customStyles:null==J?void 0:J.inlineUpdatedComponent,handleClickCognitiveDecision:null==sn?void 0:sn.handleClickCognitiveDecision,handleClickUpdatedPill:null==sn?void 0:sn.handleClickUpdatedPill,handleClickOutputValue:null==sn?void 0:sn.handleClickOutputValue,customIcons:null==sn?void 0:sn.customIcons},{children:r})):r},del:function(i){var t,r,l;i.node;var a=i.children,d=n(i,["node","children"]),c=d.aireason,s=c&&(null===(t=c.deviation_details)||void 0===t?void 0:t.resolved)&&"rejected"===(null===(r=c.deviation_details)||void 0===r?void 0:r.resolved);return o("span",e({className:m.deleted,style:e(e({},null!==(l=null==J?void 0:J.deleted)&&void 0!==l?l:{}),{textDecoration:s?"none":"line-through"})},d,{onClick:d.onclick},{children:a}))},ins:function(i){var t=i.children,r=n(i,["children"]);return o("span",e({className:m.inserted,style:null==J?void 0:J.inserted},r,{onClick:r.onclick},{children:t}))},preserved:function(i){var t=i.children,r=n(i,["children"]);return o("span",e({className:m.preserved,style:null==J?void 0:J.preserved},r,{onClick:r.onclick},{children:t}))},h1:function(i){i.node;var t=n(i,["node"]);return o("h1",e({className:m.heading1,style:null==J?void 0:J.heading1},{children:t.children}))},h2:function(i){i.node;var t=n(i,["node"]);return o("h2",e({className:m.heading2,style:null==J?void 0:J.heading2},{children:t.children}))},h3:function(i){i.node;var t=n(i,["node"]);return o("h3",e({className:m.heading3,style:null==J?void 0:J.heading3},{children:t.children}))},b:function(i){i.node;var t=n(i,["node"]);return o("b",e({className:m.bold,style:null==J?void 0:J.bold},{children:null==t?void 0:t.children}))},p:function(i){i.node;var t=n(i,["node"]);return o("p",e({},t,{className:m.paragraph,style:null==J?void 0:J.paragraph},{children:t.children}))},updated:function(i){var t=i.node,r=n(i,["node"]);return o(y,e({},r,{showUserStoryDiff:q,currentUpdatedTagId:xn,setCurrentUpdatedTagId:Nn,userStory:cn,setUserStory:vn,setAiReasoning:mn,node:t,isCraflow:nn,onCraAccept:en,onCraReject:on,customStyles:null==J?void 0:J.updatedContent,craFlowConfig:tn}))},ol:function(i){var t,r,l,a=i.node,d=n(i,["node"]),c=null!==(l=null!==(r=null===(t=null==a?void 0:a.properties)||void 0===t?void 0:t.start)&&void 0!==r?r:null==d?void 0:d.start)&&void 0!==l?l:void 0;return o("ol",e({className:m.orderedList,style:null==J?void 0:J.olist},c?{start:Number(c)}:{},{children:null==d?void 0:d.children}))},ul:function(i){i.node;var t=n(i,["node"]);return o("ul",e({className:m.unorderedList,style:null==J?void 0:J.ulist},{children:null==t?void 0:t.children}))},table:function(n){var i=n.children;return o("div",e({className:m.tableWrapper},{children:o("table",e({className:m.table,style:null==J?void 0:J.table},{children:i}))}))},tr:function(n){var e=n.node,i=n.children;return o(D,{node:e,children:i,customStyles:J})},td:function(i){var t,r=i.node,l=i.children,a=null!==(t=null==r?void 0:r.properties)&&void 0!==t?t:{},d=a.style,c=n(a,["style"]);return o(P.Provider,e({value:!0},{children:o("td",e({},c,{style:d?{cssText:d}:void 0},{children:l}))}))},th:function(i){var t,r=i.node,l=i.children,a=null!==(t=null==r?void 0:r.properties)&&void 0!==t?t:{},d=a.style,c=n(a,["style"]);return o(P.Provider,e({value:!0},{children:o("th",e({},c,{style:d?{cssText:d}:void 0},{children:l}))}))},recommendation:function(i){var t;i.node;var r=n(i,["node"]),l="The AI has selected this content based on: ".concat((null===(t=null==r?void 0:r.children)||void 0===t?void 0:t[0])||"");return o(A,e({},r,{customStyles:null==J?void 0:J.recommendationBlock,label:l}))},a:function(e){var i,r,l;e.inline;var a=e.children;e.node;var d=n(e,["inline","children","node"]),c=u(P)||"true"==(null==d?void 0:d.table),s="".concat(null==d?void 0:d.href),v=null===(i=s.split("$"))||void 0===i?void 0:i[0],g=null===(r=s.split("$"))||void 0===r?void 0:r[1];if("ai_reasoning"===v){var m=(null!==(l=q?X:gn)&&void 0!==l?l:[]).find(function(n){return n.id.toString()===decodeURIComponent(g)}),p=fn.includes(g);if(m){if(c)return o($,{aiReason:m,customStyle:null==J?void 0:J.tableAiReasoning,customIcons:Sn,isHighConfidence:m.relevance_score>=N});var h="source"!==t.Children.toArray(a).join("").trim().toLowerCase();return o(x,{aiReason:m,isSourceHasHighlight:p,inlineLabel:a,isInlineCitation:h,customIcons:Sn,customStyles:{aiReasoningContent:null==J?void 0:J.aiReasoningContent,aiReasoningAccordion:null==J?void 0:J.aiReasoningAccordion,aiReasoningMarkdown:null==J?void 0:J.aiReasoningMarkdown,aiReasoningPill:null==J?void 0:J.aiReasoningPill,webCitation:null==J?void 0:J.webCitation,stormeeCitation:null==J?void 0:J.stormeeCitation,waveformCitation:null==J?void 0:J.waveformCitation,imageCitation:null==J?void 0:J.imageCitation,fileCitation:null==J?void 0:J.fileCitation,appModCitation:null==J?void 0:J.appModCitation,rcaCitation:null==J?void 0:J.rcaCitation,readFileCitation:null==J?void 0:J.readFileCitation,loadingCitations:null==J?void 0:J.loadingCitations,chatCitation:null==J?void 0:J.chatCitation,bigEnoughCitation:null==J?void 0:J.bigEnoughCitation}})}}return null},code:function(i){i.inline;var t=i.children,r=i.className;return i.node,n(i,["inline","children","className","node"]),/language-(\w+)/.exec(r||"")||(null==r?void 0:r.includes("language-"))?o("div",{children:o("code",e({className:m.blockCode,style:null==J?void 0:J.code},{children:t}))}):o("code",e({className:m.inlineCode,style:null==J?void 0:J.code},{children:t}))},learned:function(n){var i=n.children;return o(f,e({title:i,placement:"top"},{children:o(h,{size:16,className:m.learned})}))},generatedcode:function(e){e.node;var i=n(e,["node"]),t=(null==i?void 0:i.language)||"python",r=function(n){var e="";try{if(n["data-raw"])e=decodeURIComponent(atob(n["data-raw"]));else{var o=function(n){var e;return"string"==typeof n?n:Array.isArray(n)?n.map(o).join(""):(null===(e=null==n?void 0:n.props)||void 0===e?void 0:e.children)?o(n.props.children):""};e=o(n.children)}}catch(o){console.error("Error decoding generated code:",o),e=String(n.children)}return e}(i);return o(S,{title:"Generated Code",code:r,language:t,customStyles:{pill:null==J?void 0:J.generatedCodePill,content:null==J?void 0:J.generatedCodeContent}})},updatedsegment:function(e){var i,t,r,l,a=e.node,d=e.children,c=n(e,["node","children"]),s="".concat(null===(i=a.position)||void 0===i?void 0:i.start.line,"-").concat(null===(t=a.position)||void 0===t?void 0:t.start.column,"-").concat(null===(r=a.position)||void 0===r?void 0:r.end.line,"-").concat(null===(l=a.position)||void 0===l?void 0:l.end.column),u=function(n){if(!n["data-raw"])return null;try{return decodeURIComponent(atob(n["data-raw"]))}catch(n){return console.error("Error decoding segment raw content:",n),null}}(c),v=o("div",u?{dangerouslySetInnerHTML:{__html:C.sanitize(u)}}:{children:d});return o(L,{id:s,node:a,children:v,props:c,segmentComponentConfig:yn,customStyles:J,customIcons:K,extractText:En,isUpdatedSegment:!0})},segment:function(e){var i,t,r,l,a=e.node,d=e.children,c=n(e,["node","children"]),s="".concat(null===(i=a.position)||void 0===i?void 0:i.start.line,"-").concat(null===(t=a.position)||void 0===t?void 0:t.start.column,"-").concat(null===(r=a.position)||void 0===r?void 0:r.end.line,"-").concat(null===(l=a.position)||void 0===l?void 0:l.end.column);return o(L,{id:s,node:a,children:d,props:c,segmentComponentConfig:yn,customStyles:J,customIcons:K,extractText:En})}}},[Pn,tn,gn,Y,xn,q,b,K,hn,fn,J,yn]);return console.log("normalized markdown ",Dn),s(function(){if(an.current){if(hn.length){var n;if(0===fn.length||ln)requestAnimationFrame(function(){Rn([hn[Cn].replace(/\*/g,"")])});else{var e=an.current,o=new MutationObserver(function(){clearTimeout(n),n=setTimeout(function(){o.disconnect(),requestAnimationFrame(function(){Rn([hn[Cn].replace(/\*/g,"")])})},50)});o.observe(e,{childList:!0,subtree:!0})}return function(){clearTimeout(n)}}In()}},[hn,fn,Cn,ln]),o(_.Provider,e({value:{expandedInfo:An,setExpanded:Tn,reasonToRow:Un}},{children:i("div",e({ref:an,className:"".concat(m.container," ").concat("approving"!==B?m.wrapper:""," ").concat(Q||""),style:null==J?void 0:J.container},{children:[F?o(M,{children:o(v,e({components:Fn,rehypePlugins:[g]},{children:Dn}))}):U,Ln>0&&o("div",e({className:m.confidenceScoreContainer,style:null==J?void 0:J.confidenceScoreContainer},{children:i("span",e({className:m.confidenceScore,style:null==J?void 0:J.confidenceScore},{children:[o(k,{size:14,color:(null==J?void 0:J.confidenceScoreIconColor)||"#166534"}),Ln,"%"]}))})),G&&o("div",e({className:m.citationLoader,style:null==J?void 0:J.citationLoaderContainer},{children:o(w,{customStyles:{container:null==J?void 0:J.citationLoadingContainer,icon:null==J?void 0:J.citationLoadingIcon,text:null==J?void 0:J.citationLoadingText}})})),z&&o("div",e({style:e({},null===(I=null==J?void 0:J.attachedContext)||void 0===I?void 0:I.wrapper),className:"flex mt-5"},{children:o(j,{customStyles:null==J?void 0:J.attachedContext})}))]}))}))};export{z as default};
2
2
  //# sourceMappingURL=UserStoryWithCitation.js.map
@@ -1,2 +1,2 @@
1
- import{__assign as o}from"tslib";import{jsx as l,jsxs as i,Fragment as e}from"react/jsx-runtime";import{Divider as n}from"@mui/material";import{hexToOpacity as r}from"../../../utils/css.utils.js";import d from"./InlineUpdatedComponent.module.css.js";import t from"../../../icons/CognitiveDecision.js";import{Check as c,X as a,Undo2 as v,ChevronDown as u}from"lucide-react";import s,{useRef as p,useMemo as m}from"react";var f=function(f){var h,g,C,y,_,k,b,S,D,N,j,I,x,P,W,E,T,w,A,U,V=f.aiReason,O=f.children,R=f.customStyles,q=f.handleClickCognitiveDecision,z=f.handleClickUpdatedPill,B=f.handleClickOutputValue,F=f.customIcons,G=p(),H=p(function(){null==z||z(G.current,V)}),J=m(function(){var l=function(i,e){return s.Children.map(i,function(i){var n;if(!s.isValidElement(i))return i;var r=(null===(n=i.props)||void 0===n?void 0:n.children)?l(i.props.children,e):i.props.children,d=s.cloneElement(i,o(o({},i.props),{children:r}));return e(d)})};return l(O,function(o){return s.cloneElement(o,{onclick:H.current})})},[O]),K=(null===(h=V.deviation_details)||void 0===h?void 0:h.resolved)?"#303030":null===(y=null===(C=null===(g=V.deviation_details)||void 0===g?void 0:g.evaluation_outputs)||void 0===C?void 0:C.metadata)||void 0===y?void 0:y.label_color,L={color:K||"#000000",background:r(K||"#000000",25),border:"1px solid ".concat(r(K||"#000000",75))},M=K||"#000000",Q=r(K||"#000000",25),X=o({background:r(K||"#000000",75)},null==R?void 0:R.dividerStyle),Y=null,Z=null===(_=V.deviation_details)||void 0===_?void 0:_.resolved;return"accepted"===Z?Y=null!==(k=null==F?void 0:F.accepted)&&void 0!==k?k:l(c,{color:"#16A34A"}):"rejected"===Z?Y=null!==(b=null==F?void 0:F.rejected)&&void 0!==b?b:l(a,{color:"#DC2626"}):"reverted"===Z&&(Y=null!==(S=null==F?void 0:F.reverted)&&void 0!==S?S:l(v,{color:"#475569"})),i(e,{children:[l("div",o({className:d.resolvedStatus,style:null==R?void 0:R.resolvedIcon},{children:Y})),l("div",o({ref:G,id:V.id.toString(),onClick:function(o){o.stopPropagation(),null==z||z(o.currentTarget,V)},className:d.pillWrapper,style:null==R?void 0:R.pillStyleWrapper},{children:i("div",o({className:"".concat(d.pillComponent),style:o(o({},L),null===(D=null==R?void 0:R.pillComponent)||void 0===D?void 0:D.commonStyle)},{children:[l("span",{children:(null===(I=null===(j=null===(N=V.deviation_details)||void 0===N?void 0:N.evaluation_outputs)||void 0===j?void 0:j.metadata)||void 0===I?void 0:I.label_text)||""}),l(n,{className:d.dividerStyle,style:X}),l("span",o({onClick:function(o){B&&(o.stopPropagation(),null==B||B(o.currentTarget,V))}},{children:(null===(x=V.deviation_details)||void 0===x?void 0:x.resolved)?Y:null===(W=null===(P=null==V?void 0:V.deviation_details)||void 0===P?void 0:P.evaluation_outputs)||void 0===W?void 0:W.output_value})),l(n,{className:d.dividerStyle,style:X}),l("span",o({onClick:function(o){o.stopPropagation(),null==q||q(o.currentTarget,V)},className:d.cognitiveDecisionWrapper,style:null===(E=null==R?void 0:R.cognitiveDecisionIcon)||void 0===E?void 0:E.wrapper},{children:l(t,{color:(null===(T=null==R?void 0:R.cognitiveDecisionIcon)||void 0===T?void 0:T.color)||M,backgroundColor:(null===(w=null==R?void 0:R.cognitiveDecisionIcon)||void 0===w?void 0:w.backgroundColor)||Q})})),l("span",o({className:d.chevronWrapper,style:null===(A=null==R?void 0:R.Chevron)||void 0===A?void 0:A.wrapper},{children:l(u,{color:(null===(U=null==R?void 0:R.Chevron)||void 0===U?void 0:U.color)||K})}))]}))})),J]})};export{f as default};
1
+ import{__assign as o}from"tslib";import{jsx as l,jsxs as i,Fragment as e}from"react/jsx-runtime";import{Divider as n}from"@mui/material";import{hexToOpacity as r}from"../../../utils/css.utils.js";import d from"./InlineUpdatedComponent.module.css.js";import t from"../../../icons/CognitiveDecision.js";import{Check as a,X as c,Undo2 as v,ChevronDown as u}from"lucide-react";import s,{useRef as p,useMemo as m}from"react";var f=function(f){var h,g,C,y,_,k,b,S,D,N,j,I,x,P,W,E,T,w,A,U,V=f.aiReason,O=f.children,R=f.customStyles,q=f.handleClickCognitiveDecision,z=f.handleClickUpdatedPill,B=f.handleClickOutputValue,F=f.customIcons,G=p(),H=p(function(){null==z||z(G.current,V)}),J=m(function(){var l=function(i,e){return s.Children.map(i,function(i){var n;if(!s.isValidElement(i))return i;var r=(null===(n=i.props)||void 0===n?void 0:n.children)?l(i.props.children,e):i.props.children,d=s.cloneElement(i,o(o({},i.props),{children:r}));return e(d)})};return l(O,function(o){return s.cloneElement(o,{onclick:H.current,aireason:V})})},[O]),K=(null===(h=V.deviation_details)||void 0===h?void 0:h.resolved)?"#303030":null===(y=null===(C=null===(g=V.deviation_details)||void 0===g?void 0:g.evaluation_outputs)||void 0===C?void 0:C.metadata)||void 0===y?void 0:y.label_color,L={color:K||"#000000",background:r(K||"#000000",25),border:"1px solid ".concat(r(K||"#000000",75))},M=K||"#000000",Q=r(K||"#000000",25),X=o({background:r(K||"#000000",75)},null==R?void 0:R.dividerStyle),Y=null,Z=null===(_=V.deviation_details)||void 0===_?void 0:_.resolved;return"accepted"===Z?Y=null!==(k=null==F?void 0:F.accepted)&&void 0!==k?k:l(a,{color:"#16A34A"}):"rejected"===Z?Y=null!==(b=null==F?void 0:F.rejected)&&void 0!==b?b:l(c,{color:"#DC2626"}):"reverted"===Z&&(Y=null!==(S=null==F?void 0:F.reverted)&&void 0!==S?S:l(v,{color:"#475569"})),i(e,{children:[l("div",o({className:d.resolvedStatus,style:null==R?void 0:R.resolvedIcon},{children:Y})),l("div",o({ref:G,id:V.id.toString(),onClick:function(o){o.stopPropagation(),null==z||z(o.currentTarget,V)},className:d.pillWrapper,style:null==R?void 0:R.pillStyleWrapper},{children:i("div",o({className:"".concat(d.pillComponent),style:o(o({},L),null===(D=null==R?void 0:R.pillComponent)||void 0===D?void 0:D.commonStyle)},{children:[l("span",{children:(null===(I=null===(j=null===(N=V.deviation_details)||void 0===N?void 0:N.evaluation_outputs)||void 0===j?void 0:j.metadata)||void 0===I?void 0:I.label_text)||""}),l(n,{className:d.dividerStyle,style:X}),l("span",o({onClick:function(o){B&&(o.stopPropagation(),null==B||B(o.currentTarget,V))}},{children:(null===(x=V.deviation_details)||void 0===x?void 0:x.resolved)?Y:null===(W=null===(P=null==V?void 0:V.deviation_details)||void 0===P?void 0:P.evaluation_outputs)||void 0===W?void 0:W.output_value})),l(n,{className:d.dividerStyle,style:X}),l("span",o({onClick:function(o){o.stopPropagation(),null==q||q(o.currentTarget,V)},className:d.cognitiveDecisionWrapper,style:null===(E=null==R?void 0:R.cognitiveDecisionIcon)||void 0===E?void 0:E.wrapper},{children:l(t,{color:(null===(T=null==R?void 0:R.cognitiveDecisionIcon)||void 0===T?void 0:T.color)||M,backgroundColor:(null===(w=null==R?void 0:R.cognitiveDecisionIcon)||void 0===w?void 0:w.backgroundColor)||Q})})),l("span",o({className:d.chevronWrapper,style:null===(A=null==R?void 0:R.Chevron)||void 0===A?void 0:A.wrapper},{children:l(u,{color:(null===(U=null==R?void 0:R.Chevron)||void 0===U?void 0:U.color)||K})}))]}))})),J]})};export{f as default};
2
2
  //# sourceMappingURL=InlineUpdatedComponent.js.map
@@ -7,6 +7,15 @@ type Section = {
7
7
  show?: boolean;
8
8
  bodyClassName?: string;
9
9
  };
10
+ export interface CitationActionConfig {
11
+ id: string;
12
+ label: string;
13
+ onClick?: () => void;
14
+ className?: string;
15
+ style?: React.CSSProperties;
16
+ disabled?: boolean;
17
+ disabledStyle?: React.CSSProperties;
18
+ }
10
19
  type Props = {
11
20
  item?: any;
12
21
  title?: string;
@@ -27,6 +36,9 @@ type Props = {
27
36
  scoreIcon?: React.ElementType | React.ReactNode;
28
37
  className?: string;
29
38
  customStyles?: Record<string, React.CSSProperties>;
39
+ actions?: CitationActionConfig[];
40
+ disableAllActions?: boolean;
41
+ actionBtnDisabledStyle?: React.CSSProperties;
30
42
  onBackClick?: () => void;
31
43
  isImpactNeeded?: boolean;
32
44
  cognitiveTitle?: string;
@@ -41,6 +53,6 @@ type Props = {
41
53
  backAriaLabel?: string;
42
54
  };
43
55
  };
44
- export default function CitationAccordion({ item, title, relevanceScore, showRelevanceScore, reason, impact, explaination, gap, onClose, onAccept, onReject, showResolveBtns, sections, leftIcon, scoreIcon, className, customStyles, onBackClick, isImpactNeeded, cognitiveTitle, labels }: Props): import("react/jsx-runtime").JSX.Element;
56
+ export default function CitationAccordion({ item, title, relevanceScore, showRelevanceScore, reason, impact, explaination, gap, onClose, onAccept, onReject, showResolveBtns, sections, leftIcon, scoreIcon, className, customStyles, actions, disableAllActions, actionBtnDisabledStyle, onBackClick, isImpactNeeded, cognitiveTitle, labels }: Props): import("react/jsx-runtime").JSX.Element;
45
57
  export {};
46
58
  //# sourceMappingURL=CognitiveComponent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CognitiveComponent.d.ts","sourceRoot":"","sources":["../../../../../../../../src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAYvC,KAAK,OAAO,GAAG;IACX,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IAClC,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,KAAK,KAAK,GAAG;IAET,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,Q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QAAQ,EACR,QAAQ,EACR,SAAS,EACT,SAAS,EACT,YAAiB,EACjB,WAAW,EACX,cAAqB,EACrB,cAAsC,EACpC,MAAW,EAChB,EAAE,KAAK,2CAiLP"}
1
+ {"version":3,"file":"CognitiveComponent.d.ts","sourceRoot":"","sources":["../../../../../../../../src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAYvC,KAAK,OAAO,GAAG;IACX,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IAClC,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAGF,MAAM,WAAW,oBAAoB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CACvC;AAED,KAAK,KAAK,GAAG;IAET,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,M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,EAClB,QAAQ,EACR,QAAQ,EACR,eAAuB,EACvB,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,SAAS,EACT,YAAiB,EACjB,OAAO,EACP,iBAAyB,EACzB,sBAA2B,EAC3B,WAAW,EACX,cAAqB,EACrB,cAAsC,EACpC,MAAW,EAChB,EAAE,KAAK,2CAgNP"}
@@ -17,12 +17,22 @@ export interface DeviationSummaryLabels {
17
17
  btnAccept?: string;
18
18
  btnReject?: string;
19
19
  }
20
+ export interface SummaryActionConfig {
21
+ id: string;
22
+ icon?: ReactNode;
23
+ label: string;
24
+ onClick?: () => void;
25
+ color?: string;
26
+ style?: React.CSSProperties;
27
+ disabled?: boolean;
28
+ disabledStyle?: React.CSSProperties;
29
+ }
20
30
  export interface DeviationSummaryProps {
21
31
  onClose: () => void;
22
32
  aiReason: TAIReasoning | null;
23
- onAccept: () => void;
24
- onReject: () => void;
25
- onIterate: () => void;
33
+ onAccept?: () => void;
34
+ onReject?: () => void;
35
+ onIterate?: () => void;
26
36
  initialTone?: ToneType;
27
37
  onRegenerate?: (tone: string) => void;
28
38
  onOpenCognitive?: (e?: React.MouseEvent) => void;
@@ -32,6 +42,8 @@ export interface DeviationSummaryProps {
32
42
  toneLevelsConfig?: ToneType[];
33
43
  toneColorsConfig?: Record<string, string>;
34
44
  dialConfigs?: DialIconConfig[];
45
+ actions?: SummaryActionConfig[];
46
+ disableAllActions?: boolean;
35
47
  customStyles?: {
36
48
  DeviationSummaryStyles?: {
37
49
  root?: React.CSSProperties;
@@ -45,6 +57,7 @@ export interface DeviationSummaryProps {
45
57
  impactToggle?: React.CSSProperties;
46
58
  impactToggleLabel?: React.CSSProperties;
47
59
  actionBtn?: React.CSSProperties;
60
+ actionBtnDisabled?: React.CSSProperties;
48
61
  closeBtn?: React.CSSProperties;
49
62
  toneToggleBtn?: React.CSSProperties;
50
63
  };
@@ -81,6 +94,6 @@ export interface DeviationSummaryProps {
81
94
  cognitiveLeftIcon?: React.ReactNode;
82
95
  showCognitiveRightArrow?: boolean;
83
96
  }
84
- declare function DeviationSummary({ onClose, aiReason, onAccept, onReject, onIterate, initialTone, onRegenerate, labels, toneLevelsConfig, toneColorsConfig, dialConfigs, customStyles, severityChipStyles, customIcons, onOpenCognitive, showTone, cognitiveSectionStyle, cognitiveScoreBadgeStyle, cognitiveScoreTextStyle, cognitiveStyles, cognitiveClassNames, cognitiveTitle, cognitiveLeftIcon, showCognitiveRightArrow, isStreaming }: DeviationSummaryProps): import("react/jsx-runtime").JSX.Element;
97
+ declare function DeviationSummary({ onClose, aiReason, onAccept, onReject, onIterate, initialTone, onRegenerate, labels, toneLevelsConfig, toneColorsConfig, dialConfigs, actions, disableAllActions, customStyles, severityChipStyles, customIcons, onOpenCognitive, showTone, cognitiveSectionStyle, cognitiveScoreBadgeStyle, cognitiveScoreTextStyle, cognitiveStyles, cognitiveClassNames, cognitiveTitle, cognitiveLeftIcon, showCognitiveRightArrow, isStreaming }: DeviationSummaryProps): import("react/jsx-runtime").JSX.Element;
85
98
  export default DeviationSummary;
86
99
  //# sourceMappingURL=DeviationSummary.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DeviationSummary.d.ts","sourceRoot":"","sources":["../../../../../../../../src/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.tsx"],"names":[],"mappings":"AACA,OAAO,EAAY,SAAS,EAAE,MAAM,OAAO,CAAA;AAE3C,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,qDAAqD,CAAC;AAM7D,KAAK,QAAQ,GAAG,SAAS,GAAG,UAAU,GAAG,YAAY,GAAG,MAAM,CAAC;AAE/D,MAAM,WAAW,cAAc;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,sBAAsB;IACnC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACt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UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iBAAiB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACpC,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACrC;AAmPD,iBAAS,gBAAgB,CAAC,EACtB,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,WAAW,EACX,YAAY,EACZ,MAAW,EACX,gBAAsC,EACtC,gBAAsC,EACtC,WAAkC,EAClC,YAAiB,EACjB,kBAAuB,EACvB,WAAgB,EAChB,eAAe,EACf,QAAe,EACf,qBAA0B,EAC1B,wBAA6B,EAC7B,uBAA4B,EAC5B,eAAoB,EACpB,mBAAwB,EACxB,cAAsC,EACtC,iBAAiB,EACjB,uBAA8B,EAC9B,WAAW,EACd,EAAE,qBAAqB,2CAoNvB;AAED,eAAe,gBAAgB,CAAA"}
1
+ {"version":3,"file":"DeviationSummary.d.ts","sourceRoot":"","sources":["../../../../../../../../src/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.tsx"],"names":[],"mappings":"AACA,OAAO,EAAY,SAAS,EAAE,MAAM,OAAO,CAAA;AAE3C,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,qDAAqD,CAAC;AAM7D,KAAK,QAAQ,GAAG,SAAS,GAAG,UAAU,GAAG,YAAY,GAAG,MAAM,CAAC;AAE/D,MAAM,WAAW,cAAc;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,sBAAsB;IACnC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AAwB,EACxB,cAAsC,EACtC,iBAAiB,EACjB,uBAA8B,EAC9B,WAAW,EACd,EAAE,qBAAqB,2CAqOvB;AAED,eAAe,gBAAgB,CAAA"}
@@ -5,6 +5,7 @@ export interface ActionConfig {
5
5
  label: string;
6
6
  onClick?: () => void;
7
7
  style?: CSSProperties;
8
+ disabled?: boolean;
8
9
  }
9
10
  export interface CardConfig {
10
11
  headerBg: string;
@@ -48,6 +49,7 @@ interface RedlineCardProps {
48
49
  onIterate?: () => void;
49
50
  onRevert?: () => void;
50
51
  onReinstate?: () => void;
52
+ disableAllActions?: boolean;
51
53
  impactTitle?: string;
52
54
  customConfigs?: Partial<Record<Status, Partial<CardConfig>>>;
53
55
  customStyles?: {
@@ -59,8 +61,10 @@ interface RedlineCardProps {
59
61
  impactText?: CSSProperties;
60
62
  secondSection?: CSSProperties;
61
63
  actionsContainer?: CSSProperties;
64
+ actionBtn?: CSSProperties;
65
+ actionBtnDisabled?: CSSProperties;
62
66
  };
63
67
  }
64
- export declare function RedlineCard({ status, onClose, impactText, secondText, actionTakenByName, actionTakenAtTime, onHistory, onIterate, onReinstate, onRevert, impactTitle, customConfigs, customStyles }: RedlineCardProps): import("react/jsx-runtime").JSX.Element;
68
+ export declare function RedlineCard({ status, onClose, impactText, secondText, actionTakenByName, actionTakenAtTime, onHistory, onIterate, onReinstate, onRevert, disableAllActions, impactTitle, customConfigs, customStyles }: RedlineCardProps): import("react/jsx-runtime").JSX.Element;
65
69
  export {};
66
70
  //# sourceMappingURL=RedlineStatusCard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RedlineStatusCard.d.ts","sourceRoot":"","sources":["../../../../../../../../src/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.tsx"],"names":[],"mappings":"AACA,OAAO,EAAY,SAAS,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAK3D,KAAK,MAAM,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,MAAM,CAAC;AAE5D,M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IAAI,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAC,MAAI,IAAI,CAAA;IACnB,SAAS,CAAC,EAAC,MAAI,IAAI,CAAA;IACnB,QAAQ,CAAC,EAAC,MAAI,IAAI,CAAA;IAClB,WAAW,CAAC,EAAC,MAAI,IAAI,CAAA;IAGrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAC7D,YAAY,CAAC,EAAE;QACX,IAAI,CAAC,EAAE,aAAa,CAAC;QACrB,MAAM,CAAC,EAAE,aAAa,CAAC;QACvB,IAAI,CAAC,EAAE,aAAa,CAAC;QACrB,IAAI,CAAC,EAAE,aAAa,CAAC;QACrB,OAAO,CAAC,EAAE,aAAa,CAAC;QACxB,UAAU,CAAC,EAAE,aAAa,CAAC;QAC3B,aAAa,CAAC,EAAE,aAAa,CAAC;QAC9B,gBAAgB,CAAC,EAAE,aAAa,CAAC;KACpC,CAAC;CACL;AAED,wBAAgB,WAAW,CAAC,EACxB,MAAM,EACN,OAAO,EACP,UAAU,EACV,UAAU,EACV,iBAAiB,EACjB,iBAAwB,EACxB,SAAS,EACT,SAAS,EACT,WAAW,EACX,QAAQ,EACR,WAAsB,EACtB,aAAkB,EAClB,YAAiB,EACpB,EAAE,gBAAgB,2CAgKlB"}
1
+ {"version":3,"file":"RedlineStatusCard.d.ts","sourceRoot":"","sources":["../../../../../../../../src/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.tsx"],"names":[],"mappings":"AACA,OAAO,EAAY,SAAS,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAK3D,KAAK,MAAM,GAAG,UAAU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KlB"}
@@ -1 +1 @@
1
- {"version":3,"file":"UserStoryWithCitation.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqG,MAAM,OAAO,CAAC;AAY1H,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,aAAa,EAAE,qBAAqB,EAAE,YAAY,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAC7Y,OAA+B,EAAE,2BAA2B,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AASzI,OAAwB,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACvF,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAwBlE,MAAM,WAAW,iCAAiC;IAChD,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACtC,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAChC,eAAe,CAAC,EAAE;QAChB,OAAO,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAC9B,gBAAgB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QACvC,iBAAiB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QACxC,aAAa,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QACpC,WAAW,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAClC,YAAY,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QACnC,aAAa,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QACpC,YAAY,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QACnC,YAAY,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QACnC,WAAW,CAAC,EAAE,kBA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GAAG,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,KAAK,IAAI,CAAC;QAC5F,oBAAoB,EAAE,OAAO,CAAC;KAC/B,CAAC;CAEH;AAiVD,QAAA,MAAM,sBAAsB,yVA6BzB,2BAA2B,4CA6jB7B,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
1
+ {"version":3,"file":"UserStoryWithCitation.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqG,MAAM,OAAO,CAAC;AAY1H,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,aAAa,EAAE,qBAAqB,EAAE,YAAY,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAC7Y,OAA+B,EAAE,2BAA2B,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AASzI,OAAwB,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACvF,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAwBlE,MAAM,WAAW,iCAAiC;IAChD,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACtC,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAChC,eAAe,CAAC,EAAE;QAChB,OAAO,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAC9B,gBAAgB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QACvC,iBAAiB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QACxC,aAAa,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QACpC,WAAW,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAClC,YAAY,CAAC,EAAE,KAAK,CAAC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ACnB,YAAY,EAAE,UAAU,EAAE,CAAC;QAC3B,eAAe,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;QACpE,wBAAwB,CAAC,EAAE,CAAC,MAAM,EAAE,QAAQ,GAAG,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,KAAK,IAAI,CAAC;QAC5F,oBAAoB,EAAE,OAAO,CAAC;KAC/B,CAAC;CAEH;AAiVD,QAAA,MAAM,sBAAsB,yVA6BzB,2BAA2B,4CA0lB7B,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-llm-studio/requirement-ai",
3
- "version": "0.0.183",
3
+ "version": "0.0.185",
4
4
  "author": "Saptyadeep Bhattacharjee",
5
5
  "description": "",
6
6
  "license": "MIT",