@viswa-test/test-citation 0.0.235 → 0.0.237

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 (107) hide show
  1. package/dist/cjs/features/CognitiveCompare/CognitiveCompare.js +1 -1
  2. package/dist/cjs/features/CognitiveCompare/CognitiveComparehelpers.js +1 -1
  3. package/dist/cjs/features/CognitiveCompare/components/RHSSectionRow.js +1 -1
  4. package/dist/cjs/features/CognitiveCompare/components/SectionAccordion.js +1 -1
  5. package/dist/cjs/features/CognitiveCompare/components/SubSectionAccordion.js +1 -1
  6. package/dist/cjs/features/CognitiveCompare/components/SvgConnectors.js +1 -1
  7. package/dist/cjs/features/CognitiveCompare/components/connectedLines.js +1 -1
  8. package/dist/cjs/features/CognitiveCompare/hooks/memoizedMarkdown.js +1 -1
  9. package/dist/cjs/features/GptWebCitation/GptWebCitationMarkdown.js +2 -0
  10. package/dist/cjs/features/GptWebCitation/GptWebCitationMarkdown.js.map +1 -0
  11. package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/Editor.js +1 -1
  12. package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/plugins/ManualNode.js +1 -1
  13. package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/plugins/UpdateNode.js +1 -1
  14. package/dist/cjs/features/RequirementAI/components/RichTextEditor/Editor/theme/theme.css.js +1 -1
  15. package/dist/cjs/features/RequirementAI/components/RichTextEditor/RichTextEditor.js +1 -1
  16. package/dist/cjs/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.js +1 -1
  17. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.js +1 -1
  18. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/EditBlockPopup.js +2 -0
  19. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/EditBlockPopup.js.map +1 -0
  20. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/ManualEditPopup.js +1 -1
  21. package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.js +1 -1
  22. package/dist/cjs/features/RequirementAI/components/UserStoryCard/UserStoryCard.js +1 -1
  23. package/dist/cjs/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js +1 -1
  24. package/dist/cjs/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.module.css.js +1 -1
  25. package/dist/cjs/features/RequirementAI/components/userstory-with-citation/components/InlineManualComponent.js +1 -1
  26. package/dist/cjs/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.js +1 -1
  27. package/dist/cjs/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.module.css.js +1 -1
  28. package/dist/cjs/utils/tagHelper.js +1 -1
  29. package/dist/features/CognitiveCompare/CognitiveCompare.js +1 -1
  30. package/dist/features/CognitiveCompare/CognitiveComparehelpers.js +1 -1
  31. package/dist/features/CognitiveCompare/components/RHSSectionRow.js +1 -1
  32. package/dist/features/CognitiveCompare/components/SectionAccordion.js +1 -1
  33. package/dist/features/CognitiveCompare/components/SubSectionAccordion.js +1 -1
  34. package/dist/features/CognitiveCompare/components/SvgConnectors.js +1 -1
  35. package/dist/features/CognitiveCompare/components/connectedLines.js +1 -1
  36. package/dist/features/CognitiveCompare/hooks/memoizedMarkdown.js +1 -1
  37. package/dist/features/GptWebCitation/GptWebCitationMarkdown.js +2 -0
  38. package/dist/features/GptWebCitation/GptWebCitationMarkdown.js.map +1 -0
  39. package/dist/features/RequirementAI/components/RichTextEditor/Editor/Editor.js +1 -1
  40. package/dist/features/RequirementAI/components/RichTextEditor/Editor/plugins/ManualNode.js +1 -1
  41. package/dist/features/RequirementAI/components/RichTextEditor/Editor/plugins/UpdateNode.js +1 -1
  42. package/dist/features/RequirementAI/components/RichTextEditor/Editor/theme/theme.css.js +1 -1
  43. package/dist/features/RequirementAI/components/RichTextEditor/RichTextEditor.js +1 -1
  44. package/dist/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.js +1 -1
  45. package/dist/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.js +1 -1
  46. package/dist/features/RequirementAI/components/UserStoryCard/Popups/EditBlockPopup.js +2 -0
  47. package/dist/features/RequirementAI/components/UserStoryCard/Popups/EditBlockPopup.js.map +1 -0
  48. package/dist/features/RequirementAI/components/UserStoryCard/Popups/ManualEditPopup.js +1 -1
  49. package/dist/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.js +1 -1
  50. package/dist/features/RequirementAI/components/UserStoryCard/UserStoryCard.js +1 -1
  51. package/dist/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js +1 -1
  52. package/dist/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.module.css.js +1 -1
  53. package/dist/features/RequirementAI/components/userstory-with-citation/components/InlineManualComponent.js +1 -1
  54. package/dist/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.js +1 -1
  55. package/dist/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.module.css.js +1 -1
  56. package/dist/types/src/CitationAccordionTest.d.ts +1 -0
  57. package/dist/types/src/CitationAccordionTest.d.ts.map +1 -0
  58. package/dist/types/src/DeviationSummaryTest.d.ts.map +1 -1
  59. package/dist/types/src/MockDeviationSummary.d.ts +1 -0
  60. package/dist/types/src/MockDeviationSummary.d.ts.map +1 -0
  61. package/dist/types/src/RedlineEditorTest.d.ts.map +1 -1
  62. package/dist/types/src/RequirementAiTest.d.ts.map +1 -1
  63. package/dist/types/src/features/CognitiveCompare/CognitiveCompare.d.ts.map +1 -1
  64. package/dist/types/src/features/CognitiveCompare/CognitiveComparehelpers.d.ts +9 -0
  65. package/dist/types/src/features/CognitiveCompare/CognitiveComparehelpers.d.ts.map +1 -1
  66. package/dist/types/src/features/CognitiveCompare/CompareContext.d.ts +1 -0
  67. package/dist/types/src/features/CognitiveCompare/CompareContext.d.ts.map +1 -1
  68. package/dist/types/src/features/CognitiveCompare/Guidelines/constants/guidelines.mockData.d.ts +27546 -1239
  69. package/dist/types/src/features/CognitiveCompare/Guidelines/constants/guidelines.mockData.d.ts.map +1 -1
  70. package/dist/types/src/features/CognitiveCompare/components/RHSSectionRow.d.ts.map +1 -1
  71. package/dist/types/src/features/CognitiveCompare/components/SectionAccordion.d.ts.map +1 -1
  72. package/dist/types/src/features/CognitiveCompare/components/SubSectionAccordion.d.ts +1 -0
  73. package/dist/types/src/features/CognitiveCompare/components/SubSectionAccordion.d.ts.map +1 -1
  74. package/dist/types/src/features/CognitiveCompare/components/SvgConnectors.d.ts +2 -1
  75. package/dist/types/src/features/CognitiveCompare/components/SvgConnectors.d.ts.map +1 -1
  76. package/dist/types/src/features/CognitiveCompare/components/connectedLines.d.ts +1 -0
  77. package/dist/types/src/features/CognitiveCompare/components/connectedLines.d.ts.map +1 -1
  78. package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/plugins/ManualNode.d.ts +2 -1
  79. package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/plugins/ManualNode.d.ts.map +1 -1
  80. package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/plugins/UpdateNode.d.ts +2 -1
  81. package/dist/types/src/features/RequirementAI/components/RichTextEditor/Editor/plugins/UpdateNode.d.ts.map +1 -1
  82. package/dist/types/src/features/RequirementAI/components/RichTextEditor/RichTextEditor.d.ts.map +1 -1
  83. package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.d.ts +2 -2
  84. package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.d.ts.map +1 -1
  85. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.d.ts +28 -9
  86. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.d.ts.map +1 -1
  87. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/EditBlockPopup.d.ts +7 -0
  88. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/EditBlockPopup.d.ts.map +1 -0
  89. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.d.ts +7 -1
  90. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.d.ts.map +1 -1
  91. package/dist/types/src/features/RequirementAI/components/UserStoryCard/UserStoryCard.d.ts +8 -2
  92. package/dist/types/src/features/RequirementAI/components/UserStoryCard/UserStoryCard.d.ts.map +1 -1
  93. package/dist/types/src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.d.ts.map +1 -1
  94. package/dist/types/src/features/RequirementAI/components/userstory-with-citation/components/InlineManualComponent.d.ts +1 -0
  95. package/dist/types/src/features/RequirementAI/components/userstory-with-citation/components/InlineManualComponent.d.ts.map +1 -1
  96. package/dist/types/src/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.d.ts +3 -1
  97. package/dist/types/src/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.d.ts.map +1 -1
  98. package/dist/types/src/utils/tagHelper.d.ts +1 -1
  99. package/dist/types/src/utils/tagHelper.d.ts.map +1 -1
  100. package/dist/utils/tagHelper.js +1 -1
  101. package/package.json +5 -5
  102. package/dist/types/src/constants/deviationData.d.ts +0 -887
  103. package/dist/types/src/constants/deviationData.d.ts.map +0 -1
  104. package/dist/types/src/constants/treeData.d.ts +0 -732
  105. package/dist/types/src/constants/treeData.d.ts.map +0 -1
  106. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/BlockedPopup.d.ts +0 -8
  107. package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/BlockedPopup.d.ts.map +0 -1
@@ -1,2 +1,2 @@
1
- import{__assign as n,__rest as e}from"tslib";import{jsx as t,jsxs as r,Fragment as i}from"react/jsx-runtime";import{Box as o,Typography as a}from"@mui/material";import l,{useRef as c,useMemo as d,useLayoutEffect as s}from"react";import{DEFAULT_DEVIAION_COLOR as u}from"../CognitiveCompareConstants.js";import{EllipsisVertical as h}from"lucide-react";import p from"react-markdown";import{mixHexColors as g,areMarkdownPropsEqual as f}from"../CognitiveComparehelpers.js";import v from"rehype-raw";import m from"remark-gfm";var b=function(n){return"function"==typeof n?n:(null==n?void 0:n.default)||n},x=[b(m)],y=[b(v)],E=l.memo(function(f){var v=f.content,m=f.overlayContent,b=f.sxStyles,E=f.deviationBadges,C=void 0===E?[]:E,S=f.highlights,k=void 0===S?[]:S;f.maintainRelativeOrder;var B=f.highlightBg,F=f.suppressHighlightBg,w=void 0!==F&&F,A=f.collisionKey,T=c(null),z=!!m,I=d(function(){return C.reduce(function(e,t){var r;return n(n({},e),((r={})[t.id]=t,r))},{})},[C]),O=c({badgeMap:I,highlightBg:B,hideHighlightBg:z,suppressHighlightBg:w});O.current={badgeMap:I,highlightBg:B,hideHighlightBg:z,suppressHighlightBg:w};var M=function(e,t){return l.Children.map(e,function(e){var r;if(!l.isValidElement(e))return e;var i=(null===(r=e.props)||void 0===r?void 0:r.children)?M(e.props.children,t):e.props.children,o=l.cloneElement(e,n(n({},e.props),{children:i}));return t(o)})},$=d(function(){return{mark:function(r){var i,o,a,l,c=r.children,d=e(r,["children"]),s=O.current,u=s.badgeMap,h=s.highlightBg,p=s.hideHighlightBg,g=s.suppressHighlightBg,f=d["data-badge-id"],v=f?u[f]:null,m=d["data-highlight-color"],b=null!==(l=null!==(o=null!=m?m:null===(i=null==v?void 0:v.style)||void 0===i?void 0:i.highlightBg)&&void 0!==o?o:null===(a=null==v?void 0:v.style)||void 0===a?void 0:a.badgeBg)&&void 0!==l?l:h,x="true"===d["data-is-suggested-deviation-fix"]||g;return t("span",n({style:n(n(n({},x?{}:{backgroundColor:b}),{borderRadius:"2px",display:"inline",boxDecorationBreak:"clone",WebkitBoxDecorationBreak:"clone",backgroundClip:"padding-box",padding:"0 1px"}),p?{color:"transparent"}:{})},{children:c}))},span:function(i){var a,l,c,d,s,p,g=i.children,f=e(i,["children"]),v=O.current.badgeMap,m=f["data-badge-id"];if(!m)return t("span",n({},f,{children:g}));var b=v[m];if(!b)return t("span",n({},f,{children:g}));var x="number"==typeof b.stackIndex?b.stackIndex:0,y="translateY(calc(-20% + ".concat(12*x,"px + var(--badge-nudge, 0px)))");return r(o,n({component:"span",sx:{position:"static",display:"inline"}},{children:[r(o,n({ref:b.badgeRef,className:"deviation-badge","data-side":b.side||"right",sx:n(n({fontStyle:"normal",position:"absolute",zIndex:30+x,display:"inline-flex",alignItems:"stretch",fontSize:"10px",bgcolor:(null===(a=b.style)||void 0===a?void 0:a.badgeBg)||"#EEF2FF",color:(null===(l=b.style)||void 0===l?void 0:l.badgeText)||u,border:"1px solid ".concat((null===(c=b.style)||void 0===c?void 0:c.badgeBorder)||"#C7D2FE"),borderRadius:"12px",fontWeight:600,whiteSpace:"nowrap",boxShadow:"0 1px 3px rgba(0,0,0,0.07)",overflow:"hidden",transition:"none"},"left"===b.side?{right:"-16px",transform:"".concat(y," translateX(calc(100% + 8px))")}:{left:"-16px",transform:"".concat(y," translateX(calc(-100% - 8px))")}),b.isConnected&&b.style&&{outline:"2px solid ".concat(b.style.badgeBorder),outlineOffset:"1px"})},{children:[r(o,n({onClick:function(n){n.stopPropagation(),b.onSummaryClick&&b.onSummaryClick(n)},sx:{display:"flex",alignItems:"center",px:1,py:.3,cursor:"pointer","&:hover":{bgcolor:"rgba(0,0,0,0.04)"}}},{children:[t(o,n({component:"span",sx:{fontSize:"10px",fontWeight:700}},{children:b.label})),("left"===b.side||b.isOrphan)&&t(o,n({component:"span",sx:{fontSize:"10px",pl:.5,ml:.5,borderLeft:"1px solid ".concat((null===(d=b.style)||void 0===d?void 0:d.badgeBorder)||"#C7D2FE")}},{children:null!=b.score&&"N/A"!==b.score&&"NA"!==b.score&&0!==b.score?"".concat(b.score):"N/A"===b.score||"NA"===b.score?"N/A":"Same"}))]})),("left"===b.side||b.isOrphan)&&t(o,n({onClick:function(n){n.stopPropagation(),b.onClick&&b.onClick(n)},sx:{display:"flex",alignItems:"center",px:.5,borderLeft:"1px solid ".concat((null===(s=b.style)||void 0===s?void 0:s.badgeBorder)||"#C7D2FE"),cursor:"pointer","&:hover":{bgcolor:"rgba(0,0,0,0.06)"}}},{children:t(h,{size:12,color:(null===(p=b.style)||void 0===p?void 0:p.badgeText)||"#3730A3"})}))]})),g]}))},table:function(e){var r=e.children;return t(o,n({component:"table",sx:{width:"100%",borderCollapse:"collapse",my:1,fontSize:"inherit"}},{children:r}))},thead:function(e){var r=e.children;return t(o,n({component:"thead"},{children:r}))},tbody:function(e){var r=e.children;return t(o,n({component:"tbody"},{children:r}))},tr:function(e){var r=e.children;return t(o,n({component:"tr",sx:{borderBottom:"1px solid #E5E7EB"}},{children:r}))},th:function(e){var r=e.children;return t(o,n({component:"th",sx:{border:"1px solid #E5E7EB",padding:"8px",textAlign:"left",fontWeight:600,backgroundColor:"#F9FAFB"}},{children:r}))},td:function(e){var r=e.children;return t(o,n({component:"td",sx:{border:"1px solid #E5E7EB",padding:"8px",verticalAlign:"top"}},{children:r}))},code:function(e){var r=e.children;return t("span",n({style:{fontFamily:"inherit",fontSize:"inherit"}},{children:r}))},pre:function(e){var r=e.children;return t("span",n({style:{fontFamily:"inherit",fontSize:"inherit",display:"block",whiteSpace:"pre-wrap"}},{children:r}))},updated:function(n){var e=n.children;return t(i,{children:e})},deleted:function(e){var r=e.children,i=M(r,function(n){return l.cloneElement(n,{"data-is-suggested-deviation-fix":"true"})});return t("span",n({style:{boxShadow:"inset 0 1px 0 #EF4444, inset 0 -1px 0 #EF4444",backgroundColor:"#FCCCCC",textDecoration:"line-through"}},{children:i}))},changed:function(e){var r=e.children,i=M(r,function(n){return l.cloneElement(n,{"data-is-suggested-deviation-fix":"true"})});return t("span",n({style:{boxShadow:"inset 0 1px 0 #2F59FF, inset 0 -1px 0 #2F59FF",backgroundColor:"#D5E8FF"}},{children:i}))},ul:function(r){var i=r.children,a=e(r,["children"]);return t(o,n({component:"ul",sx:{mt:1,mb:1,pl:3,listStyleType:"disc"}},a,{children:i}))},ol:function(r){var i=r.children,a=e(r,["children"]);return t(o,n({component:"ol",sx:{mt:1,mb:1,pl:3,listStyleType:"decimal"}},a,{children:i}))},li:function(r){var i=r.children,a=e(r,["children"]);return t(o,n({component:"li",sx:{mb:.5,display:"list-item"}},a,{children:i}))}}},[]),j=function(n){if(!n||"string"!=typeof n)return"";var e=n,t=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(/((?:<\/?[a-z]+[^>]*>\s*)+)([*+\-] |\d+\. )/gi,"$2$1")).replace(/\\(['"])/g,"$1").replace(/\\n/g,"\n").replace(/\\\./g,".").replace(/\r\n/g,"\n")).replace(/^(\d+\.)(\s{2,})/gm,function(n,e,t){return"".concat(e.slice(0,-1),"\\.").concat(t)})).replace(/^(\d+\.)\s*\n+(\s+)(\S)/gm,function(n,e,t,r){return"".concat(e," ").concat(r)})).replace(/([^\n])\n(#{1,6} )/g,"$1\n\n$2")).replace(/([^\n])\n([ \t]*(?:[#*+\-] |\d+\. ))/g,"$1\n\n$2")).replace(/\n{3,}/g,"\n\n")).replace(/^[ \t]+(?![ \t]*([\*\-\+] |\d+\. ))/gm,function(n){return n.replace(/ /g," ").replace(/\t/g,"    ")})).split(/(\n{2,})/);return(e=t.map(function(n){return/^\n+$/.test(n)||/\|.*\|/.test(n)&&/\|[\s:|-]+\|/.test(n)||/^#{1,6} /.test(n.trimStart())?n:n.replace(/\n(?=[^\n])/g,function(e,t){var r=n.slice(t+1);return/^[ \t]*([#>|\-*+]|\d+\.)/.test(r)?"\n":" "})}).join("")).trim()},P=function(n){return n.replace(/[\.,;:]/g," ")},D=d(function(){return C.map(function(n){return{id:n.id,connected:n.isConnected,stackIndex:n.stackIndex,size:n.size}})},[C]),H=d(function(){var e=j(v||""),t=w?P(e):e,r=(C||[]).map(function(n){var e,t;return{id:null==n?void 0:n.id,highlight:j((null==n?void 0:n.highlight)||""),highlightColor:(null===(e=null==n?void 0:n.style)||void 0===e?void 0:e.highlightBg)||(null===(t=null==n?void 0:n.style)||void 0===t?void 0:t.badgeBg)||B}}).filter(function(n){return n.id&&n.highlight}),i={};r.forEach(function(n){i[n.highlight]||(i[n.highlight]=[]),i[n.highlight].push(n)});var o=function(n,e,t,r){void 0===e&&(e=""),void 0===r&&(r=[]);var i=!1,o=function(n){var o=function(n,e,t){var r,i,o;void 0===e&&(e="");var a=n.match(/^(\s*)([\s\S]*?)(\s*)$/);if(!a)return n;var l=null!==(r=a[1])&&void 0!==r?r:"",c=null!==(i=a[2])&&void 0!==i?i:"",d=null!==(o=a[3])&&void 0!==o?o:"";return c?l+function(n,e){void 0===n&&(n="");var t=e?' data-highlight-color="'.concat(e,'"'):"",r=n?' data-badge-id="'.concat(n,'"'):"";return"<mark".concat(r).concat(t,">")}(e,t)+c+"</mark>"+d:n}(n,e,t),a=o;if(!i&&r.length>0){i=!0;var l="",c="";r.forEach(function(n){l+=function(n){return'<span data-badge-id="'.concat(n,'">')}(n.id),c="</span>"+c}),a=l+o+c}return"​"+a};return n.split(/(\n+)/).map(function(n){return/^\n+$/.test(n)?n:n.trim()?""===n.replace(/[|:\-\s]/g,"")&&n.includes("-")?n:n.includes("|")?n.split(/(\|)/).map(function(n){return"|"!==n&&n.trim()?o(n):n}).join(""):o(n):n}).join("")},a=[];Object.entries(i).forEach(function(n){var r=n[0],i=n[1],o=e.indexOf(r),l=!1;if(-1===o&&w){var c=P(r);-1!==(o=t.indexOf(c))&&(l=!0)}if(-1!==o){for(var d=i[0].highlightColor,s=1;s<i.length;s++)d=g(d,i[s].highlightColor||"");a.push({highlight:r,start:o,end:o+r.length,badges:i,color:d,usedLooseMatch:l})}});var l=new Set(Object.keys(i));(k||[]).forEach(function(n){if(n){var r=j(n);if(r&&!l.has(r)){var i=e.indexOf(r),o=!1;if(-1===i&&w){var c=P(r);-1!==(i=t.indexOf(c))&&(o=!0)}if(-1!==i){var d=e.slice(0,i);(d.match(/</g)||[]).length===(d.match(/>/g)||[]).length&&a.push({highlight:r,start:i,end:i+r.length,badges:[],color:B||"",usedLooseMatch:o})}}}}),a.sort(function(n,e){return n.start-e.start||e.end-n.end});var c=[],d={};a.forEach(function(n,e){for(var t=n.start,r=n.end,i=0,o=c;i<o.length;i++){var a=o[i],l=a.start,s=a.end,u=t<s&&r>s&&t>=l,h=t<l&&r>l&&r<=s;if(t>=l&&r<=s){n.orphaned=!0,d[e]=a.matchIdx;break}u&&(t=s),h&&(r=l)}n.trimmedStart=t,n.trimmedEnd=r,!n.orphaned&&t<r&&c.push({start:t,end:r,matchIdx:e})});var s={};Object.entries(d).forEach(function(n){var e=n[0],t=n[1],r=Number(e);s[t]||(s[t]=[]),s[t].push(r)});var u=a.map(function(e,t){return n(n({},e),{idx:t})}).filter(function(n){return!n.orphaned}).sort(function(n,e){var t,r;return(null!==(t=e.trimmedStart)&&void 0!==t?t:e.start)-(null!==(r=n.trimmedStart)&&void 0!==r?r:n.start)});return u.forEach(function(n){var t,r,i,l,c=null!==(t=n.trimmedStart)&&void 0!==t?t:n.start,d=null!==(r=n.trimmedEnd)&&void 0!==r?r:n.end;if(!(c>=d)){var u=e.slice(c,d),h=function(n,e,t,r){if(!t.length)return n;var i=t.map(function(n){return a[n]}).sort(function(n,e){return n.start-e.start}),l="",c=0;return i.forEach(function(t){var i,a,d=Math.max(c,t.start-e),s=Math.max(d,t.end-e);if(!(d>=s)){var u=g(r,t.color||"");l+=n.slice(c,d),l+=o(n.slice(d,s),(null===(a=null===(i=t.badges)||void 0===i?void 0:i[0])||void 0===a?void 0:a.id)||"",u,t.badges||[]),c=s}}),l+=n.slice(c)}(n.usedLooseMatch||c!==n.start||d!==n.end?u:n.highlight,n.start,s[n.idx]||[],n.color),p=o(h,(null===(l=null===(i=n.badges)||void 0===i?void 0:i[0])||void 0===l?void 0:l.id)||"",n.color,n.badges||[]);e=e.slice(0,c)+p+e.slice(d)}}),e},[v,C,k,B,w]),N=d(function(){return m?j(m||""):""},[m]),R=!!m,L={"& *":{fontFamily:"inherit"},"& code, & pre, & kbd, & samp":{fontFamily:"inherit !important",fontSize:"inherit",background:"none",padding:0,border:"none",whiteSpace:"pre-wrap"},"& p, & li, & ul, & ol":{position:"static",overflow:"visible",whiteSpace:"pre-wrap"}},q=n(n(n(n({},b),L),{position:"relative",overflow:"visible",whiteSpace:"normal",gridArea:"1 / 1",zIndex:2}),R?{color:"transparent",userSelect:"none",pointerEvents:"none","& .deviation-badge":{pointerEvents:"auto"},"& table":{visibility:"hidden",margin:"0 !important"},"& th, & td":{padding:"0 !important",border:"none !important",backgroundColor:"transparent !important"},"& tr":{border:"none !important"},"& p:empty":{display:"none"}}:{}),W=n(n(n({},b),L),{position:"relative",overflow:"visible",whiteSpace:"normal",gridArea:"1 / 1",zIndex:1,pointerEvents:"auto"});return s(function(){if(T.current){var n=function(){var n=Array.from(T.current.querySelectorAll(".deviation-badge"));if(0!==n.length){n.forEach(function(n){n.style.setProperty("--badge-nudge","0px")});var e=n.filter(function(n){return"left"===n.dataset.side}),t=n.filter(function(n){return"left"!==n.dataset.side}),r=T.current.getBoundingClientRect(),i=r.bottom-4,o=r.top+4,a=function(n){if(0!==n.length){var e=n.map(function(n){var e=n.getBoundingClientRect();return{el:n,naturalTop:e.top,height:e.height,currentTop:e.top}});e.sort(function(n,e){return n.naturalTop-e.naturalTop});var t=[],r=[];e.forEach(function(n){if(0===r.length)r.push(n);else{var e=r[r.length-1],i=e.currentTop+e.height;n.naturalTop<i+8?(n.currentTop=i+8,r.push(n)):(t.push(r),r=[n])}}),r.length>0&&t.push(r),t.forEach(function(n){var e=n[n.length-1],t=e.currentTop+e.height;if(t>i){var r=t-i,a=n[0].currentTop-o,l=Math.max(0,Math.min(r,a));n.forEach(function(n){n.currentTop-=l})}}),t.flat().forEach(function(n){var e=n.currentTop-n.naturalTop;n.el.style.setProperty("--badge-nudge","".concat(e,"px"))})}};a(e),a(t)}},e=requestAnimationFrame(function(){requestAnimationFrame(function(){n()})}),t=new ResizeObserver(function(){requestAnimationFrame(n)});return t.observe(T.current),function(){t.disconnect(),cancelAnimationFrame(e)}}},[H,A,D]),r(o,n({ref:T,sx:{position:"relative",display:"grid"}},{children:[t(a,n({component:"div",sx:n(n({},q),{padding:"3px"})},{children:t(p,n({components:$,remarkPlugins:x,rehypePlugins:y},{children:H.replace(/#{3}/g,"")}))})),R&&t(a,n({component:"div",sx:W},{children:t(p,n({components:$,remarkPlugins:x,rehypePlugins:y},{children:N}))}))]}))},f);export{E as MemoizedMarkdown};
1
+ import{__assign as n,__rest as e}from"tslib";import{jsx as t,jsxs as r,Fragment as i}from"react/jsx-runtime";import{Box as o,Typography as a}from"@mui/material";import l,{useRef as c,useMemo as d,useLayoutEffect as s}from"react";import{DEFAULT_DEVIAION_COLOR as u}from"../CognitiveCompareConstants.js";import{EllipsisVertical as h}from"lucide-react";import p from"react-markdown";import{mixHexColors as g,areMarkdownPropsEqual as f}from"../CognitiveComparehelpers.js";import v from"rehype-raw";var m,b=[(m=v,"function"==typeof m?m:(null==m?void 0:m.default)||m)],x=l.memo(function(f){var v=f.content,m=f.overlayContent,x=f.sxStyles,y=f.deviationBadges,E=void 0===y?[]:y,C=f.highlights,S=void 0===C?[]:C;f.maintainRelativeOrder;var B=f.highlightBg,k=f.suppressHighlightBg,F=void 0!==k&&k,w=f.collisionKey,A=c(null),T=!!m,z=d(function(){return E.reduce(function(e,t){var r;return n(n({},e),((r={})[t.id]=t,r))},{})},[E]),I=c({badgeMap:z,highlightBg:B,hideHighlightBg:T,suppressHighlightBg:F});I.current={badgeMap:z,highlightBg:B,hideHighlightBg:T,suppressHighlightBg:F};var O=function(e,t){return l.Children.map(e,function(e){var r;if(!l.isValidElement(e))return e;var i=(null===(r=e.props)||void 0===r?void 0:r.children)?O(e.props.children,t):e.props.children,o=l.cloneElement(e,n(n({},e.props),{children:i}));return t(o)})},M=d(function(){return{mark:function(r){var i,o,a,l,c=r.children,d=e(r,["children"]),s=I.current,u=s.badgeMap,h=s.highlightBg,p=s.hideHighlightBg,g=s.suppressHighlightBg,f=d["data-badge-id"],v=f?u[f]:null,m=d["data-highlight-color"],b=null!==(l=null!==(o=null!=m?m:null===(i=null==v?void 0:v.style)||void 0===i?void 0:i.highlightBg)&&void 0!==o?o:null===(a=null==v?void 0:v.style)||void 0===a?void 0:a.badgeBg)&&void 0!==l?l:h,x="true"===d["data-is-suggested-deviation-fix"]||g;return t("span",n({style:n(n(n({},x?{}:{backgroundColor:b}),{borderRadius:"2px",display:"inline",boxDecorationBreak:"clone",WebkitBoxDecorationBreak:"clone",backgroundClip:"padding-box",padding:"0 1px"}),p?{color:"transparent"}:{})},{children:c}))},span:function(i){var a,l,c,d,s,p,g=i.children,f=e(i,["children"]),v=I.current.badgeMap,m=f["data-badge-id"];if(!m)return t("span",n({},f,{children:g}));var b=v[m];if(!b)return t("span",n({},f,{children:g}));var x="number"==typeof b.stackIndex?b.stackIndex:0,y="translateY(calc(-20% + ".concat(12*x,"px + var(--badge-nudge, 0px)))");return r(o,n({component:"span",sx:{position:"static",display:"inline"}},{children:[r(o,n({ref:b.badgeRef,className:"deviation-badge","data-side":b.side||"right",sx:n(n({fontStyle:"normal",position:"absolute",zIndex:30+x,display:"inline-flex",alignItems:"stretch",fontSize:"10px",bgcolor:(null===(a=b.style)||void 0===a?void 0:a.badgeBg)||"#EEF2FF",color:(null===(l=b.style)||void 0===l?void 0:l.badgeText)||u,border:"1px solid ".concat((null===(c=b.style)||void 0===c?void 0:c.badgeBorder)||"#C7D2FE"),borderRadius:"12px",fontWeight:600,whiteSpace:"nowrap",boxShadow:"0 1px 3px rgba(0,0,0,0.07)",overflow:"hidden",transition:"none"},"left"===b.side?{right:"-16px",transform:"".concat(y," translateX(calc(100% + 8px))")}:{left:"-16px",transform:"".concat(y," translateX(calc(-100% - 8px))")}),b.isConnected&&b.style&&{outline:"2px solid ".concat(b.style.badgeBorder),outlineOffset:"1px"})},{children:[r(o,n({onClick:function(n){n.stopPropagation(),b.onSummaryClick&&b.onSummaryClick(n)},sx:{display:"flex",alignItems:"center",px:1,py:.3,cursor:"pointer","&:hover":{bgcolor:"rgba(0,0,0,0.04)"}}},{children:[t(o,n({component:"span",sx:{fontSize:"10px",fontWeight:700}},{children:b.label})),("left"===b.side||b.isOrphan)&&t(o,n({component:"span",sx:{fontSize:"10px",pl:.5,ml:.5,borderLeft:"1px solid ".concat((null===(d=b.style)||void 0===d?void 0:d.badgeBorder)||"#C7D2FE")}},{children:null!=b.score&&"N/A"!==b.score&&"NA"!==b.score&&0!==b.score?"".concat(b.score):"N/A"===b.score||"NA"===b.score?"N/A":"Same"}))]})),("left"===b.side||b.isOrphan)&&t(o,n({onClick:function(n){n.stopPropagation(),b.onClick&&b.onClick(n)},sx:{display:"flex",alignItems:"center",px:.5,borderLeft:"1px solid ".concat((null===(s=b.style)||void 0===s?void 0:s.badgeBorder)||"#C7D2FE"),cursor:"pointer","&:hover":{bgcolor:"rgba(0,0,0,0.06)"}}},{children:t(h,{size:12,color:(null===(p=b.style)||void 0===p?void 0:p.badgeText)||"#3730A3"})}))]})),g]}))},table:function(e){var r=e.children;return t(o,n({component:"table",sx:{width:"100%",borderCollapse:"collapse",my:1,fontSize:"inherit"}},{children:r}))},thead:function(e){var r=e.children;return t(o,n({component:"thead"},{children:r}))},tbody:function(e){var r=e.children;return t(o,n({component:"tbody"},{children:r}))},tr:function(e){var r=e.children;return t(o,n({component:"tr",sx:{borderBottom:"1px solid #E5E7EB"}},{children:r}))},th:function(e){var r=e.children;return t(o,n({component:"th",sx:{border:"1px solid #E5E7EB",padding:"8px",textAlign:"left",fontWeight:600,backgroundColor:"#F9FAFB"}},{children:r}))},td:function(e){var r=e.children;return t(o,n({component:"td",sx:{border:"1px solid #E5E7EB",padding:"8px",verticalAlign:"top"}},{children:r}))},code:function(e){var r=e.children;return t("span",n({style:{fontFamily:"inherit",fontSize:"inherit"}},{children:r}))},pre:function(e){var r=e.children;return t("span",n({style:{fontFamily:"inherit",fontSize:"inherit",display:"block",whiteSpace:"pre-wrap"}},{children:r}))},updated:function(n){var e=n.children;return t(i,{children:e})},deleted:function(e){var r=e.children,i=O(r,function(n){return l.cloneElement(n,{"data-is-suggested-deviation-fix":"true"})});return t("span",n({style:{boxShadow:"inset 0 1px 0 #EF4444, inset 0 -1px 0 #EF4444",backgroundColor:"#FCCCCC",textDecoration:"line-through"}},{children:i}))},changed:function(e){var r=e.children,i=O(r,function(n){return l.cloneElement(n,{"data-is-suggested-deviation-fix":"true"})});return t("span",n({style:{boxShadow:"inset 0 1px 0 #2F59FF, inset 0 -1px 0 #2F59FF",backgroundColor:"#D5E8FF"}},{children:i}))},ul:function(r){var i=r.children,a=e(r,["children"]);return t(o,n({component:"ul",sx:{mt:1,mb:1,pl:3,listStyleType:"disc"}},a,{children:i}))},ol:function(r){var i=r.children,a=e(r,["children"]);return t(o,n({component:"ol",sx:{mt:1,mb:1,pl:3,listStyleType:"decimal"}},a,{children:i}))},li:function(r){var i=r.children,a=e(r,["children"]);return t(o,n({component:"li",sx:{mb:.5,display:"list-item"}},a,{children:i}))}}},[]),$=function(n){if(!n||"string"!=typeof n)return"";var e=n,t=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(/((?:<\/?[a-z]+[^>]*>\s*)+)([*+\-] |\d+\. )/gi,"$2$1")).replace(/\\(['"])/g,"$1").replace(/\\n/g,"\n").replace(/\\\./g,".").replace(/\r\n/g,"\n")).replace(/^(\d+\.)(\s{2,})/gm,function(n,e,t){return"".concat(e.slice(0,-1),"\\.").concat(t)})).replace(/^(\d+\.)\s*\n+(\s+)(\S)/gm,function(n,e,t,r){return"".concat(e," ").concat(r)})).replace(/([^\n])\n(#{1,6} )/g,"$1\n\n$2")).replace(/([^\n])\n([ \t]*(?:[#*+\-] |\d+\. ))/g,"$1\n\n$2")).replace(/\n{3,}/g,"\n\n")).replace(/^[ \t]+(?![ \t]*([\*\-\+] |\d+\. ))/gm,function(n){return n.replace(/ /g," ").replace(/\t/g,"    ")})).split(/(\n{2,})/);return(e=t.map(function(n){return/^\n+$/.test(n)||/\|.*\|/.test(n)&&/\|[\s:|-]+\|/.test(n)||/^#{1,6} /.test(n.trimStart())?n:n.replace(/\n(?=[^\n])/g,function(e,t){var r=n.slice(t+1);return/^[ \t]*([#>|\-*+]|\d+\.)/.test(r)?"\n":" "})}).join("")).trim()},j=function(n){return n.replace(/[\.,;:]/g," ")},D=d(function(){return E.map(function(n){return{id:n.id,connected:n.isConnected,stackIndex:n.stackIndex,size:n.size}})},[E]),H=d(function(){var e=$(v||""),t=F?j(e):e,r=(E||[]).map(function(n){var e,t;return{id:null==n?void 0:n.id,highlight:$((null==n?void 0:n.highlight)||""),highlightColor:(null===(e=null==n?void 0:n.style)||void 0===e?void 0:e.highlightBg)||(null===(t=null==n?void 0:n.style)||void 0===t?void 0:t.badgeBg)||B}}).filter(function(n){return n.id&&n.highlight}),i={};r.forEach(function(n){i[n.highlight]||(i[n.highlight]=[]),i[n.highlight].push(n)});var o=function(n,e,t,r){void 0===e&&(e=""),void 0===r&&(r=[]);var i=!1,o=function(n){var o=function(n,e,t){var r,i,o;void 0===e&&(e="");var a=n.match(/^(\s*)([\s\S]*?)(\s*)$/);if(!a)return n;var l=null!==(r=a[1])&&void 0!==r?r:"",c=null!==(i=a[2])&&void 0!==i?i:"",d=null!==(o=a[3])&&void 0!==o?o:"";return c?l+function(n,e){void 0===n&&(n="");var t=e?' data-highlight-color="'.concat(e,'"'):"",r=n?' data-badge-id="'.concat(n,'"'):"";return"<mark".concat(r).concat(t,">")}(e,t)+c+"</mark>"+d:n}(n,e,t),a=o;if(!i&&r.length>0){i=!0;var l="",c="";r.forEach(function(n){l+=function(n){return'<span data-badge-id="'.concat(n,'">')}(n.id),c="</span>"+c}),a=l+o+c}return"​"+a};return n.split(/(\n+)/).map(function(n){return/^\n+$/.test(n)?n:n.trim()?""===n.replace(/[|:\-\s]/g,"")&&n.includes("-")?n:n.includes("|")?n.split(/(\|)/).map(function(n){return"|"!==n&&n.trim()?o(n):n}).join(""):o(n):n}).join("")},a=[];Object.entries(i).forEach(function(n){var r=n[0],i=n[1],o=e.indexOf(r),l=!1;if(-1===o&&F){var c=j(r);-1!==(o=t.indexOf(c))&&(l=!0)}if(-1!==o){for(var d=i[0].highlightColor,s=1;s<i.length;s++)d=g(d,i[s].highlightColor||"");a.push({highlight:r,start:o,end:o+r.length,badges:i,color:d,usedLooseMatch:l})}});var l=new Set(Object.keys(i));(S||[]).forEach(function(n){if(n){var r=$(n);if(r&&!l.has(r)){var i=e.indexOf(r),o=!1;if(-1===i&&F){var c=j(r);-1!==(i=t.indexOf(c))&&(o=!0)}if(-1!==i){var d=e.slice(0,i);(d.match(/</g)||[]).length===(d.match(/>/g)||[]).length&&a.push({highlight:r,start:i,end:i+r.length,badges:[],color:B||"",usedLooseMatch:o})}}}}),a.sort(function(n,e){return n.start-e.start||e.end-n.end});var c=[],d={};a.forEach(function(n,e){for(var t=n.start,r=n.end,i=0,o=c;i<o.length;i++){var a=o[i],l=a.start,s=a.end,u=t<s&&r>s&&t>=l,h=t<l&&r>l&&r<=s;if(t>=l&&r<=s){n.orphaned=!0,d[e]=a.matchIdx;break}u&&(t=s),h&&(r=l)}n.trimmedStart=t,n.trimmedEnd=r,!n.orphaned&&t<r&&c.push({start:t,end:r,matchIdx:e})});var s={};Object.entries(d).forEach(function(n){var e=n[0],t=n[1],r=Number(e);s[t]||(s[t]=[]),s[t].push(r)});var u=a.map(function(e,t){return n(n({},e),{idx:t})}).filter(function(n){return!n.orphaned}).sort(function(n,e){var t,r;return(null!==(t=e.trimmedStart)&&void 0!==t?t:e.start)-(null!==(r=n.trimmedStart)&&void 0!==r?r:n.start)});return u.forEach(function(n){var t,r,i,l,c=null!==(t=n.trimmedStart)&&void 0!==t?t:n.start,d=null!==(r=n.trimmedEnd)&&void 0!==r?r:n.end;if(!(c>=d)){var u=e.slice(c,d),h=function(n,e,t,r){if(!t.length)return n;var i=t.map(function(n){return a[n]}).sort(function(n,e){return n.start-e.start}),l="",c=0;return i.forEach(function(t){var i,a,d=Math.max(c,t.start-e),s=Math.max(d,t.end-e);if(!(d>=s)){var u=g(r,t.color||"");l+=n.slice(c,d),l+=o(n.slice(d,s),(null===(a=null===(i=t.badges)||void 0===i?void 0:i[0])||void 0===a?void 0:a.id)||"",u,t.badges||[]),c=s}}),l+=n.slice(c)}(n.usedLooseMatch||c!==n.start||d!==n.end?u:n.highlight,n.start,s[n.idx]||[],n.color),p=o(h,(null===(l=null===(i=n.badges)||void 0===i?void 0:i[0])||void 0===l?void 0:l.id)||"",n.color,n.badges||[]);e=e.slice(0,c)+p+e.slice(d)}}),e},[v,E,S,B,F]),N=d(function(){return m?$(m||""):""},[m]),R=!!m,P={"& *":{fontFamily:"inherit"},"& code, & pre, & kbd, & samp":{fontFamily:"inherit !important",fontSize:"inherit",background:"none",padding:0,border:"none",whiteSpace:"pre-wrap"},"& p, & li, & ul, & ol":{position:"static",overflow:"visible",whiteSpace:"pre-wrap"}},L=n(n(n(n({},x),P),{position:"relative",overflow:"visible",whiteSpace:"normal",gridArea:"1 / 1",zIndex:2}),R?{color:"transparent",userSelect:"none",pointerEvents:"none","& .deviation-badge":{pointerEvents:"auto"},"& table":{visibility:"hidden",margin:"0 !important"},"& th, & td":{padding:"0 !important",border:"none !important",backgroundColor:"transparent !important"},"& tr":{border:"none !important"},"& p:empty":{display:"none"}}:{}),q=n(n(n({},x),P),{position:"relative",overflow:"visible",whiteSpace:"normal",gridArea:"1 / 1",zIndex:1,pointerEvents:"auto"});return s(function(){if(A.current){var n=function(){var n=Array.from(A.current.querySelectorAll(".deviation-badge"));if(0!==n.length){n.forEach(function(n){n.style.setProperty("--badge-nudge","0px")});var e=n.filter(function(n){return"left"===n.dataset.side}),t=n.filter(function(n){return"left"!==n.dataset.side}),r=A.current.getBoundingClientRect(),i=r.bottom-4,o=r.top+4,a=function(n){if(0!==n.length){var e=n.map(function(n){var e=n.getBoundingClientRect();return{el:n,naturalTop:e.top,height:e.height,currentTop:e.top}});e.sort(function(n,e){return n.naturalTop-e.naturalTop});var t=[],r=[];e.forEach(function(n){if(0===r.length)r.push(n);else{var e=r[r.length-1],i=e.currentTop+e.height;n.naturalTop<i+8?(n.currentTop=i+8,r.push(n)):(t.push(r),r=[n])}}),r.length>0&&t.push(r),t.forEach(function(n){var e=n[n.length-1],t=e.currentTop+e.height;if(t>i){var r=t-i,a=n[0].currentTop-o,l=Math.max(0,Math.min(r,a));n.forEach(function(n){n.currentTop-=l})}}),t.flat().forEach(function(n){var e=n.currentTop-n.naturalTop;n.el.style.setProperty("--badge-nudge","".concat(e,"px"))})}};a(e),a(t)}},e=requestAnimationFrame(function(){requestAnimationFrame(function(){n()})}),t=new ResizeObserver(function(){requestAnimationFrame(n)});return t.observe(A.current),function(){t.disconnect(),cancelAnimationFrame(e)}}},[H,w,D]),r(o,n({ref:A,sx:{position:"relative",display:"grid"}},{children:[t(a,n({component:"div",sx:n(n({},L),{padding:"3px"})},{children:t(p,n({components:M,rehypePlugins:b},{children:H.replace(/#{3}/g,"")}))})),R&&t(a,n({component:"div",sx:q},{children:t(p,n({components:M,rehypePlugins:b},{children:N}))}))]}))},f);export{x as MemoizedMarkdown};
2
2
  //# sourceMappingURL=memoizedMarkdown.js.map
@@ -0,0 +1,2 @@
1
+ import{__rest as r,__assign as n}from"tslib";import{jsx as t,Fragment as e}from"react/jsx-runtime";import{useRef as i,useMemo as c,useEffect as l}from"react";import o from"react-markdown";import a from"rehype-raw";import{sanitizeExternalUrl as h}from"./utils/citationData.utils.js";import u from"./GptWebCitation.module.css.js";var d=function(d){var f=d.content,s=d.activeHighlightIndex,v=d.onHighlightCountChange,m=i(null),g=c(function(){var r,n=f.match(/id=["']highlighted-\d+["']/g);if(null==n?void 0:n.length)return n.length;var t=f.match(/<a\b[^>]*>/gi);return null!==(r=null==t?void 0:t.length)&&void 0!==r?r:0},[f]),p=c(function(){return/id=["']highlighted-\d+["']/.test(f)},[f]);l(function(){null==v||v(g)},[g,v]),l(function(){var r;if(m.current){var n=m.current.querySelector("#highlighted-".concat(s));if(n)n.scrollIntoView({behavior:"smooth",block:"center"});else null===(r=m.current.querySelectorAll("a[href]")[s])||void 0===r||r.scrollIntoView({behavior:"smooth",block:"center"})}},[s,f]);var b=c(function(){var i=-1;return{span:function(e){e.node;var i=r(e,["node"]),c=i.id;if(null==c?void 0:c.startsWith("highlighted-")){var l=Number(c.replace("highlighted-",""))===s;return t("span",n({},i,{id:c,className:"".concat(u.highlight).concat(l?" ".concat(u.highlightActive):"")}))}return t("span",n({},i))},a:function(r){var c,l=r.children,o=r.href,a=r.title,d=r.className;if(!o)return t(e,{children:l});i+=1;var f=!p&&i===s,v=null!==(c=h(o))&&void 0!==c?c:"#";return t("a",n({href:v,title:a,target:"_blank",rel:"noreferrer",className:"".concat(u.citationLink).concat(f?" ".concat(u.citationLinkActive):"").concat(d?" ".concat(d):"")},{children:l}))},code:function(e){var i=e.children,c=r(e,["children"]);return t("code",n({},c,{children:i}))},ol:function(e){var i=e.children,c=r(e,["children"]);return t("ol",n({},c,{children:i}))},ul:function(e){var i=e.children,c=r(e,["children"]);return t("ul",n({},c,{children:i}))},li:function(e){var i=e.children,c=r(e,["children"]);return t("li",n({},c,{children:i}))},p:function(e){var i=e.children,c=r(e,["children"]);return t("p",n({},c,{children:i}))}}},[s,p,f]);return t("div",n({ref:m,className:u.markdownBody},{children:t(o,n({rehypePlugins:[a],components:b},{children:f}))}))};export{d as default};
2
+ //# sourceMappingURL=GptWebCitationMarkdown.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GptWebCitationMarkdown.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- import{jsxs as e,Fragment as t,jsx as o}from"react/jsx-runtime";import{useRef as r,useState as i,useEffect as l}from"react";import{LexicalComposer as n}from"@lexical/react/LexicalComposer";import{HistoryPlugin as a}from"@lexical/react/LexicalHistoryPlugin";import{OnChangePlugin as s}from"@lexical/react/LexicalOnChangePlugin";import{TabIndentationPlugin as u}from"@lexical/react/LexicalTabIndentationPlugin";import{ListNode as c,ListItemNode as m}from"@lexical/list";import{ListPlugin as d}from"@lexical/react/LexicalListPlugin";import{LinkPlugin as p}from"@lexical/react/LexicalLinkPlugin";import{LinkNode as f}from"@lexical/link";import{QuoteNode as g,HeadingNode as x}from"@lexical/rich-text";import{TablePlugin as h}from"@lexical/react/LexicalTablePlugin";import{TableNode as v,TableRowNode as C,TableCellNode as y}from"@lexical/table";import{KEY_DOWN_COMMAND as b,$getSelection as S,$isRangeSelection as j,COMMAND_PRIORITY_CRITICAL as T,TextNode as E,$isTextNode as N}from"lexical";import"./components/EditorToolbar/components/ToolbarButton/ToolbarButton.css.js";import{useRequirementAI as P}from"../../RequirementAIWrapper/RequirementAIWrapper.js";import B from"./components/EditorContainer/EditorContainer.js";import L from"./components/EditorToolbar/EditorToolbar.js";import{LayoutPlugin as k}from"./plugins/LayoutPlugin.js";import I from"./theme/theme.js";import"./theme/theme.css.js";import"./Editor.css.js";import _ from"./components/Context/ContextMenu.js";import{MarkNode as H}from"@lexical/mark";import w from"./plugins/CommentPlugin/HTMLNode.js";import{DEFAULT_TOOLBAR_CONFIG as D}from"./constants/editorConfig.js";import{InitialHtml as M}from"./plugins/InitialHtml.js";import{InsertNode as R}from"./plugins/InsertNode.js";import{DeleteNode as A}from"./plugins/DeleteNode.js";import{HighlightSpanNode as F,HighlightButtonNode as W}from"./plugins/HighlightNode.js";import{useLexicalComposerContext as q}from"@lexical/react/LexicalComposerContext";import{UpdateNode as O}from"./plugins/UpdateNode.js";import{ManualNode as V}from"./plugins/ManualNode.js";import{PreservedNode as U}from"./plugins/PreservedNode.js";import{InvisibleNode as X}from"./plugins/InvisibleNode.js";function Y(e){console.log(e)}function $({onEditBlocked:e}){const[t]=q();return l(()=>{const o=e=>{let t=e;for(;t;){if(["preserved","insert","delete"].includes(t.getType()))return t;if(["update","manual"].includes(t.getType())&&t.getStatus()&&"pending"===t.getStatus())return t;t=t.getParent()}return!1};function r(e){var t;let o=e.getParent();for(;o;){if(o instanceof O||o instanceof V)return null===(t=o.getId())||void 0===t?void 0:t.replaceAll("@","<").replaceAll("#",">");o=o.getParent()}return null}return t.registerCommand(b,t=>{const i=S();if(!j(i))return!1;const l=i.getNodes().find(e=>!!o(e));if(l)return t.preventDefault(),null==e||e(r(l)||""),!0;if(i.isCollapsed()){const l=i.anchor.getNode(),n=o(l);if(n){const o=n?r(n):"";return null==e||e(o||""),t.preventDefault(),!0}if("Backspace"===t.key){const o=l.getPreviousSibling(),n=o&&(["delete","insert","preserved"].includes(o.getType())||["update","manual"].includes(o.getType())&&o.getStatus()&&"pending"===o.getStatus())?o:null;if(0===i.anchor.offset&&n)return null==e||e(r(n)||""),t.preventDefault(),!0}else if("Delete"===t.key){const o=l.getNextSibling(),n=o&&(["delete","insert","preserved"].includes(o.getType())||["update","manual"].includes(o.getType())&&o.getStatus()&&"pending"===o.getStatus())?o:null,a=l.getTextContent().length;if(i.anchor.offset===a&&n)return null==e||e(r(n)||""),t.preventDefault(),!0}}return!1},T)},[t]),null}function z({minHeight:l,height:b,placeholder:T,onFocus:q,onBlur:z,onChange:G,onToolbarButtonClick:J,toolbarConfig:K=D,editorRef:Q,editorState:Z,initialString:ee,customToolbar:te,plugins:oe,nodes:re,dynamicHeight:ie,artifactContext:le,commentsPanelState:ne,mode:ae,doNotShowBorderInViewMode:se,onEditBlocked:ue}){var ce,me,de;const pe=r(null),fe={namespace:"MyEditor",theme:I,onError:Y,nodes:[E,c,m,f,g,x,v,C,y,H,w,R,A,O,U,V,X,F,W],editorState:Z},[ge,xe]=i(null),[he,ve]=i(!1),{customStyles:Ce}=P(),ye=e=>{var t;null===(t=Q.current)||void 0===t||t.update(()=>{const t=S();j(t)&&t.getNodes().forEach(t=>{N(t)&&t.setStyle(`color: ${e}`)})})};return document.getElementById("lexical_editor_wrapper"),e(t,{children:[(null===(ce=null==Ce?void 0:Ce.textEditorStyles)||void 0===ce?void 0:ce.themeStyles)&&o("style",{children:null===(me=null==Ce?void 0:Ce.textEditorStyles)||void 0===me?void 0:me.themeStyles}),e("div",{ref:pe,className:"w-full lexical_editor_wrapper "+(se&&"readOnly"===ae?"":"lexical_editor_wrapper_box"),id:"lexical_editor_wrapper",onContextMenu:e=>{var t;e.preventDefault(),null===(t=Q.current)||void 0===t||t.update(()=>{const t=S();j(t)&&!t.isCollapsed()?(ve(!0),xe({x:e.clientX,y:e.clientY})):(ve(!1),xe(null))})},style:{minHeight:l,height:b,...null===(de=null==Ce?void 0:Ce.textEditorStyles)||void 0===de?void 0:de.textArea},children:[e(n,{initialConfig:fe,children:[" ","edit"===ae&&o($,{onEditBlocked:ue}),"edit"===ae&&o(L,{onToolbarButtonClick:J,editorWrapperRef:pe,toolbarConfig:K,customToolbar:te,editorRef:Q}),o(B,{placeholder:T}),o(u,{}),o(a,{}),o(d,{}),o(p,{}),o(h,{}),o(k,{onFocus:q,onBlur:z,editorRef:Q}),o(s,{ignoreSelectionChange:!0,ignoreHistoryMergeTagChange:!0,onChange:(e,t,o)=>{G&&G(e,t,o)}}),ee&&o(M,{initialValue:ee.value,initialFormat:ee.type,mode:ae}),oe&&oe]}),ge&&he&&"edit"===ae&&o(_,{position:ge,options:[{label:"Change Color to Red",action:()=>ye("red")},{label:"Change Color to Blue",action:()=>ye("blue")}],onClose:()=>{xe(null)}})]})]})}export{z as default};
1
+ import{jsxs as e,Fragment as t,jsx as o}from"react/jsx-runtime";import{useRef as r,useState as i,useEffect as n}from"react";import{LexicalComposer as l}from"@lexical/react/LexicalComposer";import{HistoryPlugin as a}from"@lexical/react/LexicalHistoryPlugin";import{OnChangePlugin as s}from"@lexical/react/LexicalOnChangePlugin";import{TabIndentationPlugin as u}from"@lexical/react/LexicalTabIndentationPlugin";import{ListNode as m,ListItemNode as c}from"@lexical/list";import{ListPlugin as d}from"@lexical/react/LexicalListPlugin";import{LinkPlugin as p}from"@lexical/react/LexicalLinkPlugin";import{LinkNode as f}from"@lexical/link";import{QuoteNode as g,HeadingNode as x}from"@lexical/rich-text";import{TablePlugin as h}from"@lexical/react/LexicalTablePlugin";import{TableNode as C,TableRowNode as v,TableCellNode as y}from"@lexical/table";import{KEY_DOWN_COMMAND as S,$getSelection as b,$isRangeSelection as j,COMMAND_PRIORITY_CRITICAL as T,TextNode as E,$isTextNode as N}from"lexical";import"./components/EditorToolbar/components/ToolbarButton/ToolbarButton.css.js";import{useRequirementAI as B}from"../../RequirementAIWrapper/RequirementAIWrapper.js";import P from"./components/EditorContainer/EditorContainer.js";import L from"./components/EditorToolbar/EditorToolbar.js";import{LayoutPlugin as k}from"./plugins/LayoutPlugin.js";import I from"./theme/theme.js";import"./theme/theme.css.js";import"./Editor.css.js";import _ from"./components/Context/ContextMenu.js";import{MarkNode as H}from"@lexical/mark";import w from"./plugins/CommentPlugin/HTMLNode.js";import{DEFAULT_TOOLBAR_CONFIG as D}from"./constants/editorConfig.js";import{InitialHtml as M}from"./plugins/InitialHtml.js";import{InsertNode as R}from"./plugins/InsertNode.js";import{DeleteNode as A}from"./plugins/DeleteNode.js";import{HighlightSpanNode as F,HighlightButtonNode as W}from"./plugins/HighlightNode.js";import{useLexicalComposerContext as q}from"@lexical/react/LexicalComposerContext";import{UpdateNode as O}from"./plugins/UpdateNode.js";import{ManualNode as V}from"./plugins/ManualNode.js";import{PreservedNode as U}from"./plugins/PreservedNode.js";import{InvisibleNode as X}from"./plugins/InvisibleNode.js";function Y(e){console.log(e)}function $({onEditBlocked:e}){const[t]=q();return n(()=>{const o=e=>{let t=e;for(;t;){if(["preserved","insert","delete"].includes(t.getType()))return t;if(["update","manual"].includes(t.getType())&&t.getStatus()&&"pending"===t.getStatus())return t;t=t.getParent()}return!1};function r(e){let t=e;for(;t;){if((t instanceof O||t instanceof V)&&"pending"===t.getStatus())return t.getId();t=t.getParent()}return null}return t.registerCommand(S,t=>{const i=b();if(!j(i))return!1;const n=i.getNodes().find(e=>!!o(e));if(n)return t.preventDefault(),null==e||e(r(n)||""),!0;if(i.isCollapsed()){const n=i.anchor.getNode(),l=o(n);if(l){const o=l?r(l):"";return null==e||e(o||""),t.preventDefault(),!0}if("Backspace"===t.key){const o=n.getPreviousSibling(),l=o&&(["delete","insert","preserved"].includes(o.getType())||["update","manual"].includes(o.getType())&&o.getStatus()&&"pending"===o.getStatus())?o:null;if(0===i.anchor.offset&&l)return null==e||e(r(l)||""),t.preventDefault(),!0}else if("Delete"===t.key){const o=n.getNextSibling(),l=o&&(["delete","insert","preserved"].includes(o.getType())||["update","manual"].includes(o.getType())&&o.getStatus()&&"pending"===o.getStatus())?o:null,a=n.getTextContent().length;if(i.anchor.offset===a&&l)return null==e||e(r(l)||""),t.preventDefault(),!0}}return!1},T)},[t]),null}function z({minHeight:n,height:S,placeholder:T,onFocus:q,onBlur:z,onChange:G,onToolbarButtonClick:J,toolbarConfig:K=D,editorRef:Q,editorState:Z,initialString:ee,customToolbar:te,plugins:oe,nodes:re,dynamicHeight:ie,artifactContext:ne,commentsPanelState:le,mode:ae,doNotShowBorderInViewMode:se,onEditBlocked:ue}){var me,ce,de;const pe=r(null),fe={namespace:"MyEditor",theme:I,onError:Y,nodes:[E,m,c,f,g,x,C,v,y,H,w,R,A,O,U,V,X,F,W],editorState:Z},[ge,xe]=i(null),[he,Ce]=i(!1),{customStyles:ve}=B(),ye=e=>{var t;null===(t=Q.current)||void 0===t||t.update(()=>{const t=b();j(t)&&t.getNodes().forEach(t=>{N(t)&&t.setStyle(`color: ${e}`)})})};return document.getElementById("lexical_editor_wrapper"),e(t,{children:[(null===(me=null==ve?void 0:ve.textEditorStyles)||void 0===me?void 0:me.themeStyles)&&o("style",{children:null===(ce=null==ve?void 0:ve.textEditorStyles)||void 0===ce?void 0:ce.themeStyles}),e("div",{ref:pe,className:"w-full lexical_editor_wrapper "+(se&&"readOnly"===ae?"":"lexical_editor_wrapper_box"),id:"lexical_editor_wrapper",onContextMenu:e=>{var t;e.preventDefault(),null===(t=Q.current)||void 0===t||t.update(()=>{const t=b();j(t)&&!t.isCollapsed()?(Ce(!0),xe({x:e.clientX,y:e.clientY})):(Ce(!1),xe(null))})},style:{minHeight:n,height:S,...null===(de=null==ve?void 0:ve.textEditorStyles)||void 0===de?void 0:de.textArea},children:[e(l,{initialConfig:fe,children:[" ","edit"===ae&&o($,{onEditBlocked:ue}),"edit"===ae&&o(L,{onToolbarButtonClick:J,editorWrapperRef:pe,toolbarConfig:K,customToolbar:te,editorRef:Q}),o(P,{placeholder:T}),o(u,{}),o(a,{}),o(d,{}),o(p,{}),o(h,{}),o(k,{onFocus:q,onBlur:z,editorRef:Q}),o(s,{ignoreSelectionChange:!0,ignoreHistoryMergeTagChange:!0,onChange:(e,t,o)=>{G&&G(e,t,o)}}),ee&&o(M,{initialValue:ee.value,initialFormat:ee.type,mode:ae}),oe&&oe]}),ge&&he&&"edit"===ae&&o(_,{position:ge,options:[{label:"Change Color to Red",action:()=>ye("red")},{label:"Change Color to Blue",action:()=>ye("blue")}],onClose:()=>{xe(null)}})]})]})}export{z as default};
2
2
  //# sourceMappingURL=Editor.js.map
@@ -1,2 +1,2 @@
1
- import{ElementNode as t}from"lexical";class s extends t{static getType(){return"manual"}static clone(t){return new s(t.__id,t.__status,t.__key)}constructor(t=crypto.randomUUID(),s="",e){super(e),this.__id=t,this.__status=s}getId(){return this.getLatest().__id}getStatus(){return this.getLatest().__status}setStatus(t){this.getWritable().__status=t}createDOM(){const t=document.createElement("manual");return t.dataset.id=this.__id,t.className=`PlaygroundEditorTheme__manual-node-${this.__status}`,this.__status&&(t.dataset.status=this.__status),t.contentEditable="pending"===this.__status?"false":"true",t}exportDOM(){const t=document.createElement("manual");return t.id=this.__id,{element:t}}updateDOM(t,s){return t.__id!==this.__id&&(s.dataset.id=this.__id),t.__status!==this.__status&&(this.__status?s.dataset.status=this.__status:delete s.dataset.status,s.contentEditable="pending"===this.__status?"false":"true"),!1}static importDOM(){return{manual:()=>({conversion:e,priority:1})}}static importJSON(t){var e;return new s(t.id,null!==(e=t.status)&&void 0!==e?e:"")}exportJSON(){return{...super.exportJSON(),type:"manual",version:1,id:this.__id,status:this.__status}}isInline(){return!0}}function e(t){var e;return{node:new s(t.id||crypto.randomUUID(),null!==(e=t.dataset.status)&&void 0!==e?e:"")}}export{s as ManualNode};
1
+ import{ElementNode as t}from"lexical";class s extends t{static getType(){return"manual"}static clone(t){return new s(t.__id,t.__status,t.__key)}constructor(t=crypto.randomUUID(),s="",e){super(e),this.__id=t,this.__status=s}getId(){return this.getLatest().__id}getStatus(){return this.getLatest().__status}setStatus(t){this.getWritable().__status=t}createDOM(){const t=document.createElement("manual");return t.dataset.id=this.__id,t.className=`PlaygroundEditorTheme__manual-node-${this.__status}`,this.__status&&(t.dataset.status=this.__status),t.contentEditable="pending"===this.__status?"false":"true",t}exportDOM(){const t=document.createElement("manual");return t.id=this.__id,t.dataset.status=this.__status,{element:t}}updateDOM(t,s){return t.__id!==this.__id&&(s.dataset.id=this.__id),t.__status!==this.__status&&(this.__status?s.dataset.status=this.__status:delete s.dataset.status,s.contentEditable="pending"===this.__status?"false":"true"),!1}static importDOM(){return{manual:()=>({conversion:e,priority:1})}}static importJSON(t){var e;return new s(t.id,null!==(e=t.status)&&void 0!==e?e:"")}exportJSON(){return{...super.exportJSON(),type:"manual",version:1,id:this.__id,status:this.__status}}canInsertTextBefore(){return"pending"!==this.__status}canInsertTextAfter(){return"pending"!==this.__status}}function e(t){var e;return{node:new s(t.id||crypto.randomUUID(),null!==(e=t.dataset.status)&&void 0!==e?e:"")}}export{s as ManualNode};
2
2
  //# sourceMappingURL=ManualNode.js.map
@@ -1,2 +1,2 @@
1
- import{ElementNode as t}from"lexical";class s extends t{static getType(){return"update"}static clone(t){return new s(t.__id,t.__status,t.__key)}constructor(t=crypto.randomUUID(),s="",e){super(e),this.__id=t,this.__status=s}getId(){return this.getLatest().__id}getStatus(){return this.getLatest().__status}setStatus(t){this.getWritable().__status=t}createDOM(){const t=document.createElement("upt");return t.dataset.id=this.__id,t.className=`PlaygroundEditorTheme__update-node-${this.__status}`,this.__status&&(t.dataset.status=this.__status),t.contentEditable="pending"===this.__status?"false":"true",t}exportDOM(){const t=document.createElement("upt");return t.id=this.__id,{element:t}}updateDOM(t,s){return t.__id!==this.__id&&(s.dataset.id=this.__id),t.__status!==this.__status&&(this.__status?s.dataset.status=this.__status:delete s.dataset.status,s.contentEditable="pending"===this.__status?"false":"true"),!1}static importDOM(){return{upt:()=>({conversion:e,priority:1})}}static importJSON(t){var e;return new s(t.id,null!==(e=t.status)&&void 0!==e?e:"")}exportJSON(){return{...super.exportJSON(),type:"update",version:1,id:this.__id,status:this.__status}}isInline(){return!0}}function e(t){var e;return{node:new s(t.id||crypto.randomUUID(),null!==(e=t.dataset.status)&&void 0!==e?e:"")}}export{s as UpdateNode};
1
+ import{ElementNode as t}from"lexical";class s extends t{static getType(){return"update"}static clone(t){return new s(t.__id,t.__status,t.__key)}constructor(t=crypto.randomUUID(),s="",e){super(e),this.__id=t,this.__status=s}getId(){return this.getLatest().__id}getStatus(){return this.getLatest().__status}setStatus(t){this.getWritable().__status=t}createDOM(){const t=document.createElement("upt");return t.dataset.id=this.__id,t.className=`PlaygroundEditorTheme__update-node-${this.__status}`,this.__status&&(t.dataset.status=this.__status),t.contentEditable="pending"===this.__status?"false":"true",t}exportDOM(){const t=document.createElement("upt");return t.id=this.__id,t.dataset.status=this.__status,{element:t}}updateDOM(t,s){return t.__id!==this.__id&&(s.dataset.id=this.__id),t.__status!==this.__status&&(this.__status?s.dataset.status=this.__status:delete s.dataset.status,s.contentEditable="pending"===this.__status?"false":"true"),!1}static importDOM(){return{upt:()=>({conversion:e,priority:1})}}static importJSON(t){var e;return new s(t.id,null!==(e=t.status)&&void 0!==e?e:"")}exportJSON(){return{...super.exportJSON(),type:"update",version:1,id:this.__id,status:this.__status}}canInsertTextBefore(){return"pending"!==this.__status}canInsertTextAfter(){return"pending"!==this.__status}}function e(t){var e;return{node:new s(t.id||crypto.randomUUID(),null!==(e=t.dataset.status)&&void 0!==e?e:"")}}export{s as UpdateNode};
2
2
  //# sourceMappingURL=UpdateNode.js.map
@@ -1,2 +1,2 @@
1
- var e='.PlaygroundEditorTheme__ltr{text-align:left}.PlaygroundEditorTheme__rtl{text-align:right}.PlaygroundEditorTheme__paragraph{font-family:Inter,sans-serif;line-height:28px;margin:0 0 8px;position:relative}.PlaygroundEditorTheme__paragraph:last-child{margin-bottom:0}.PlaygroundEditorTheme__quote{border-left:4px solid #ced0d4;color:#65676b;font-size:15px;margin:0 0 10px 20px;padding-left:16px}.PlaygroundEditorTheme__h1{font-family:Inter,sans-serif;font-size:24px;margin:12px 0 4px;padding:0}.PlaygroundEditorTheme__h2{font-size:20px}.PlaygroundEditorTheme__h2,.PlaygroundEditorTheme__h3{font-family:Inter,sans-serif;margin:10px 0 0;padding:0}.PlaygroundEditorTheme__h3{font-size:18px;text-transform:uppercase}.PlaygroundEditorTheme__textBold{font-family:Inter,sans-serif;font-weight:700}.PlaygroundEditorTheme__textItalic{font-style:italic}.PlaygroundEditorTheme__textUnderline{text-decoration:underline}.PlaygroundEditorTheme__textStrikethrough{text-decoration:line-through}.PlaygroundEditorTheme__textUnderlineStrikethrough{text-decoration:underline line-through}.PlaygroundEditorTheme__textSubscript{font-size:.8em;vertical-align:sub!important}.PlaygroundEditorTheme__textSuperscript{font-size:.8em;vertical-align:super}.PlaygroundEditorTheme__textCode{background-color:#f0f2f5;font-family:Menlo,Consolas,Monaco,monospace;font-size:94%;padding:1px .25rem}.PlaygroundEditorTheme__hashtag{background-color:#5890ff26;border-bottom:1px solid #5890ff4d}.PlaygroundEditorTheme__link{color:#216fdb;text-decoration:none}.PlaygroundEditorTheme__link:hover{text-decoration:underline}.PlaygroundEditorTheme__code{background-color:#f0f2f5;display:block;font-family:Menlo,Consolas,Monaco,monospace;font-size:13px;line-height:1.53;margin:8px 0;overflow-x:auto;padding:8px 8px 8px 52px;position:relative;tab-size:2}.PlaygroundEditorTheme__code:before{background-color:#eee;border-right:1px solid #ccc;color:#777;content:attr(data-gutter);left:0;min-width:25px;padding:8px;position:absolute;text-align:right;top:0;white-space:pre-wrap}.PlaygroundEditorTheme__code:after{color:#00000080;content:attr(data-highlight-language);font-size:10px;padding:3px;position:absolute;right:3px;text-transform:uppercase;top:0}.PlaygroundEditorTheme__table{border-collapse:collapse;border-spacing:0;max-width:100%;overflow-y:scroll;table-layout:fixed;width:100%}.PlaygroundEditorTheme__tableCell{border:1px solid #000;min-width:75px;padding:6px 8px;text-align:start;vertical-align:top}.PlaygroundEditorTheme__tableCellHeader{background-color:#f2f3f5;text-align:start}.PlaygroundEditorTheme__characterLimit{background-color:#fbb!important;display:inline}.PlaygroundEditorTheme__ul{list-style-type:disc}.PlaygroundEditorTheme__ol1,.PlaygroundEditorTheme__ul{list-style-position:outside;margin:0 0 0 24px;padding:0}.PlaygroundEditorTheme__ol1{list-style-type:decimal}.PlaygroundEditorTheme__ol2{list-style-position:outside;list-style-type:upper-alpha;margin:0 0 0 24px;padding:0}.PlaygroundEditorTheme__ol3{list-style-position:outside;list-style-type:lower-alpha;margin:0 0 0 24px;padding:0}.PlaygroundEditorTheme__ol4{list-style-position:outside;list-style-type:upper-roman;margin:0 0 0 24px;padding:0}.PlaygroundEditorTheme__ol5{list-style-position:outside;list-style-type:lower-roman;margin:0 0 0 24px;padding:0}.PlaygroundEditorTheme__listItem{display:list-item;margin:8px 24px 8px 8px;padding:0 8px}.PlaygroundEditorTheme__nestedListItem{list-style-type:inherit;margin-left:16px}ol .PlaygroundEditorTheme__nestedListItem{list-style-type:none}.PlaygroundEditorTheme__listItemChecked,.PlaygroundEditorTheme__listItemUnchecked{list-style-type:none;margin-left:8px;margin-right:8px;outline:none;padding-left:24px;padding-right:24px;position:relative}.PlaygroundEditorTheme__listItemChecked{text-decoration:line-through}.PlaygroundEditorTheme__listItemChecked:before,.PlaygroundEditorTheme__listItemUnchecked:before{background-size:cover;content:"";cursor:pointer;display:block;height:16px;left:0;position:absolute;top:2px;width:16px}.PlaygroundEditorTheme__listItemChecked[dir=rtl]:before,.PlaygroundEditorTheme__listItemUnchecked[dir=rtl]:before{left:auto;right:0}.PlaygroundEditorTheme__listItemChecked:focus:before,.PlaygroundEditorTheme__listItemUnchecked:focus:before{border-radius:2px;box-shadow:0 0 0 2px #a6cdfe}.PlaygroundEditorTheme__tokenComment{color:#708090}.PlaygroundEditorTheme__tokenPunctuation{color:#999}.PlaygroundEditorTheme__tokenProperty{color:#905}.PlaygroundEditorTheme__tokenSelector{color:#690}.PlaygroundEditorTheme__tokenOperator{color:#9a6e3a}.PlaygroundEditorTheme__tokenAttr{color:#07a}.PlaygroundEditorTheme__tokenVariable{color:#e90}.PlaygroundEditorTheme__tokenFunction{color:#dd4a68}.PlaygroundEditorTheme__mark{background:#ffd40024;border-bottom:2px solid #ffd4004d;padding-bottom:2px}.PlaygroundEditorTheme__markOverlap{background:#ffd4004d;border-bottom:2px solid #ffd400b3}.PlaygroundEditorTheme__mark.selected{background:#ffd40080;border-bottom:2px solid #ffd400}.PlaygroundEditorTheme__markOverlap.selected{background:#ffd400b3;border-bottom:2px solid #ffd400b3}.PlaygroundEditorTheme__embedBlock{user-select:none}.PlaygroundEditorTheme__embedBlockFocus{outline:2px solid #3c84f4}.PlaygroundEditorTheme__highlight-button{display:none}.PlaygroundEditorTheme__insert-node{background-color:#8cbeff;text-decoration:none}.PlaygroundEditorTheme__delete-node{text-decoration:line-through;text-decoration-color:#dc2626}[class^=PlaygroundEditorTheme__update-node]>.PlaygroundEditorTheme__insert-node{background-color:#f3e8ff}.PlaygroundEditorTheme__manual-node-accepted,[class^=PlaygroundEditorTheme__manual-node]>.PlaygroundEditorTheme__insert-node{background-color:#8cbeff}.PlaygroundEditorTheme__manual-node-rejected{text-decoration:underline;text-decoration-color:red}.PlaygroundEditorTheme__update-node-accepted{background-color:#f3e8ff;-webkit-box-decoration-break:clone;box-decoration-break:clone;display:inline}';!function(){if("undefined"==typeof document)return;const o=document.createElement("style");o.type="text/css";const t=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;t&&o.setAttribute("nonce",t),o.appendChild(document.createTextNode(e));const r=document.head||document.getElementsByTagName("head")[0]||document.documentElement;r&&r.appendChild(o)}();export{e as default};
1
+ var e='.PlaygroundEditorTheme__ltr{text-align:left}.PlaygroundEditorTheme__rtl{text-align:right}.PlaygroundEditorTheme__paragraph{font-family:Inter,sans-serif;line-height:28px;margin:0 0 8px;position:relative}.PlaygroundEditorTheme__paragraph:last-child{margin-bottom:0}.PlaygroundEditorTheme__quote{border-left:4px solid #ced0d4;color:#65676b;font-size:15px;margin:0 0 10px 20px;padding-left:16px}.PlaygroundEditorTheme__h1{font-family:Inter,sans-serif;font-size:24px;margin:12px 0 4px;padding:0}.PlaygroundEditorTheme__h2{font-size:20px}.PlaygroundEditorTheme__h2,.PlaygroundEditorTheme__h3{font-family:Inter,sans-serif;margin:10px 0 0;padding:0}.PlaygroundEditorTheme__h3{font-size:18px;text-transform:uppercase}.PlaygroundEditorTheme__textBold{font-family:Inter,sans-serif;font-weight:700}.PlaygroundEditorTheme__textItalic{font-style:italic}.PlaygroundEditorTheme__textUnderline{text-decoration:underline}.PlaygroundEditorTheme__textStrikethrough{text-decoration:line-through}.PlaygroundEditorTheme__textUnderlineStrikethrough{text-decoration:underline line-through}.PlaygroundEditorTheme__textSubscript{font-size:.8em;vertical-align:sub!important}.PlaygroundEditorTheme__textSuperscript{font-size:.8em;vertical-align:super}.PlaygroundEditorTheme__textCode{background-color:#f0f2f5;font-family:Menlo,Consolas,Monaco,monospace;font-size:94%;padding:1px .25rem}.PlaygroundEditorTheme__hashtag{background-color:#5890ff26;border-bottom:1px solid #5890ff4d}.PlaygroundEditorTheme__link{color:#216fdb;text-decoration:none}.PlaygroundEditorTheme__link:hover{text-decoration:underline}.PlaygroundEditorTheme__code{background-color:#f0f2f5;display:block;font-family:Menlo,Consolas,Monaco,monospace;font-size:13px;line-height:1.53;margin:8px 0;overflow-x:auto;padding:8px 8px 8px 52px;position:relative;tab-size:2}.PlaygroundEditorTheme__code:before{background-color:#eee;border-right:1px solid #ccc;color:#777;content:attr(data-gutter);left:0;min-width:25px;padding:8px;position:absolute;text-align:right;top:0;white-space:pre-wrap}.PlaygroundEditorTheme__code:after{color:#00000080;content:attr(data-highlight-language);font-size:10px;padding:3px;position:absolute;right:3px;text-transform:uppercase;top:0}.PlaygroundEditorTheme__table{border-collapse:collapse;border-spacing:0;max-width:100%;overflow-y:scroll;table-layout:fixed;width:100%}.PlaygroundEditorTheme__tableCell{border:1px solid #000;min-width:75px;padding:6px 8px;text-align:start;vertical-align:top}.PlaygroundEditorTheme__tableCellHeader{background-color:#f2f3f5;text-align:start}.PlaygroundEditorTheme__characterLimit{background-color:#fbb!important;display:inline}.PlaygroundEditorTheme__ul{list-style-type:disc}.PlaygroundEditorTheme__ol1,.PlaygroundEditorTheme__ul{list-style-position:outside;margin:0 0 0 24px;padding:0}.PlaygroundEditorTheme__ol1{list-style-type:decimal}.PlaygroundEditorTheme__ol2{list-style-position:outside;list-style-type:upper-alpha;margin:0 0 0 24px;padding:0}.PlaygroundEditorTheme__ol3{list-style-position:outside;list-style-type:lower-alpha;margin:0 0 0 24px;padding:0}.PlaygroundEditorTheme__ol4{list-style-position:outside;list-style-type:upper-roman;margin:0 0 0 24px;padding:0}.PlaygroundEditorTheme__ol5{list-style-position:outside;list-style-type:lower-roman;margin:0 0 0 24px;padding:0}.PlaygroundEditorTheme__listItem{display:list-item;margin:8px 24px 8px 8px;padding:0 8px}.PlaygroundEditorTheme__nestedListItem{list-style-type:inherit;margin-left:16px}ol .PlaygroundEditorTheme__nestedListItem{list-style-type:none}.PlaygroundEditorTheme__listItemChecked,.PlaygroundEditorTheme__listItemUnchecked{list-style-type:none;margin-left:8px;margin-right:8px;outline:none;padding-left:24px;padding-right:24px;position:relative}.PlaygroundEditorTheme__listItemChecked{text-decoration:line-through}.PlaygroundEditorTheme__listItemChecked:before,.PlaygroundEditorTheme__listItemUnchecked:before{background-size:cover;content:"";cursor:pointer;display:block;height:16px;left:0;position:absolute;top:2px;width:16px}.PlaygroundEditorTheme__listItemChecked[dir=rtl]:before,.PlaygroundEditorTheme__listItemUnchecked[dir=rtl]:before{left:auto;right:0}.PlaygroundEditorTheme__listItemChecked:focus:before,.PlaygroundEditorTheme__listItemUnchecked:focus:before{border-radius:2px;box-shadow:0 0 0 2px #a6cdfe}.PlaygroundEditorTheme__tokenComment{color:#708090}.PlaygroundEditorTheme__tokenPunctuation{color:#999}.PlaygroundEditorTheme__tokenProperty{color:#905}.PlaygroundEditorTheme__tokenSelector{color:#690}.PlaygroundEditorTheme__tokenOperator{color:#9a6e3a}.PlaygroundEditorTheme__tokenAttr{color:#07a}.PlaygroundEditorTheme__tokenVariable{color:#e90}.PlaygroundEditorTheme__tokenFunction{color:#dd4a68}.PlaygroundEditorTheme__mark{background:#ffd40024;border-bottom:2px solid #ffd4004d;padding-bottom:2px}.PlaygroundEditorTheme__markOverlap{background:#ffd4004d;border-bottom:2px solid #ffd400b3}.PlaygroundEditorTheme__mark.selected{background:#ffd40080;border-bottom:2px solid #ffd400}.PlaygroundEditorTheme__markOverlap.selected{background:#ffd400b3;border-bottom:2px solid #ffd400b3}.PlaygroundEditorTheme__embedBlock{user-select:none}.PlaygroundEditorTheme__embedBlockFocus{outline:2px solid #3c84f4}.PlaygroundEditorTheme__highlight-button{display:none}.PlaygroundEditorTheme__insert-node{background-color:#8cbeff;text-decoration:none}.PlaygroundEditorTheme__delete-node{background-color:#fff;text-decoration:line-through;text-decoration-color:#dc2626}[class^=PlaygroundEditorTheme__update-node]>.PlaygroundEditorTheme__insert-node{background-color:#f3e8ff}.PlaygroundEditorTheme__manual-node-accepted,[class^=PlaygroundEditorTheme__manual-node]>.PlaygroundEditorTheme__insert-node{background-color:#8cbeff}.PlaygroundEditorTheme__manual-node-rejected{background-color:#fff;text-decoration:underline;text-decoration-color:red}.PlaygroundEditorTheme__update-node-accepted{background-color:#f3e8ff;-webkit-box-decoration-break:clone;box-decoration-break:clone;display:inline}';!function(){if("undefined"==typeof document)return;const o=document.createElement("style");o.type="text/css";const t=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;t&&o.setAttribute("nonce",t),o.appendChild(document.createTextNode(e));const r=document.head||document.getElementsByTagName("head")[0]||document.documentElement;r&&r.appendChild(o)}();export{e as default};
2
2
  //# sourceMappingURL=theme.css.js.map
@@ -1,2 +1,2 @@
1
- import{jsxs as e,jsx as t}from"react/jsx-runtime";import{forwardRef as r,useRef as n,useState as o,useEffect as a,useImperativeHandle as i}from"react";import{DEFAULT_TOOLBAR_CONFIG as l}from"./Editor/constants/editorConfig.js";import c from"./Editor/Editor.js";import{useRefStore as s}from"../../store/ref.context.js";import{$generateHtmlFromNodes as u}from"@lexical/html";import d from"turndown";import{tables as h}from"turndown-plugin-gfm";import{UnsavedChangesPopup as p}from"../UnsavedChangesPopup/UnsavedChangesPopup.js";import{mergeTagAcrossParagraphs as m,unescapeTagIds as g}from"../../../../utils/tagHelper.js";const f=new d({headingStyle:"atx",codeBlockStyle:"fenced"});f.keep(["ins","del","mark"]),f.keep(e=>{var t,r;return"A"===e.nodeName&&null!==(r=null===(t=e.getAttribute("href"))||void 0===t?void 0:t.includes("ai_reasoning$"))&&void 0!==r&&r}),f.keep(e=>"SPAN"===e.nodeName&&e.hasAttribute("highlight-id")),f.addRule("md-table-passthrough",{filter:e=>"PRE"===e.nodeName&&"true"===e.getAttribute("data-md-table"),replacement:(e,t)=>t.textContent||""}),f.use(h);const E=e=>(e||"").replace(/\r\n/g,"\n").trim(),v=r(({type:r,value:d,handleUpdateState:h,onBlur:v,placeholder:A,minHeight:S,height:$,mode:y,doNotShowBorderInViewMode:w,onEditBlocked:b,onSaveUnsavedChanges:x,onDiscardUnsavedChanges:C,isSavingUnsavedChanges:N=!1},B)=>{const T=n(null),[L,q]=o({type:r,value:d}),[H,I]=o(0),[R,_]=o(!1),j=n(d),k=n(d),M=n(Boolean(d)),{contentRef:U,setContentRef:V}=s();a(()=>{q(e=>({...e,value:d})),j.current=d,k.current=d,M.current=Boolean(d),_(!1)},[d]),i(B,()=>({requestClose:()=>!("edit"===y&&E(j.current)!==E(k.current))||(_(!0),!1)}),[y]);return a(()=>{const e=()=>{U&&U.current&&I(U.current.clientHeight-60)};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[U]),e("div",{style:{position:"relative",width:"100%",height:$,minHeight:S},children:[R&&t(p,{isSaving:N,onSave:async()=>{await(null==x?void 0:x()),j.current=k.current,_(!1)},onDiscard:()=>{k.current=j.current,null==C||C(),_(!1)}}),t(c,{minHeight:S,height:$,placeholder:A||"Enter some text...",onChange:(e,t)=>{e.read(()=>{const e=u(t,null),r=(new DOMParser).parseFromString(e,"text/html");r.querySelectorAll("span").forEach(e=>{const t=e.getAttribute("style")||"";t.includes("background-color")&&t.includes("rgb(219, 234, 254)")&&e.setAttribute("data-review","insert"),t.includes("text-decoration")&&t.includes("line-through")&&e.setAttribute("data-review","delete")}),r.querySelectorAll("strong code").forEach(e=>{const t=e.parentElement;t&&t.replaceChild(document.createTextNode(e.textContent||""),e)}),r.querySelectorAll("code strong").forEach(e=>{const t=e.parentElement;t&&t.replaceChild(document.createTextNode(e.textContent||""),e)}),r.querySelectorAll('a[href*="ai_reasoning$"]').forEach(e=>{const t=e.getAttribute("href")||"";e.setAttribute("href",t.replace(/^https?:\/\//,""))});const n=["upt","manual","ins","del","preserved"];function o(e,t){const r=e.cloneNode(!0),a=new Map;r.querySelectorAll(n.join(",")).forEach(e=>{if(e===r)return;const n=`%%NESTED${a.size}%%`;a.set(n,o(e,t)),e.replaceWith(n)});let i=t.turndown(r.innerHTML);a.forEach((e,t)=>{i=i.replace(t,e)});const l=Array.from(e.attributes).map(e=>`${e.name}="${e.value}"`).join(" "),c=e.tagName.toLowerCase();return l?`<${c} ${l}>${i}</${c}>`:`<${c}>${i}</${c}>`}r.querySelectorAll('a[href*="ai_reasoning$"]').forEach(e=>{const t=e.getAttribute("href")||"";e.setAttribute("href",t.replace(/^https?:\/\//,""))});const a=[];r.querySelectorAll("invisible").forEach((e,t)=>{a.push(e.outerHTML),e.replaceWith(r.createTextNode(`%%INVISIBLE_${t}%%`))});const i=[];r.querySelectorAll("upt, manual").forEach((e,t)=>{i.push(o(e,f)),e.replaceWith(r.createTextNode(`%%REVIEW_${t}%%`))});const l=[];r.querySelectorAll("table").forEach((e,t)=>{l.push(e.outerHTML);const n=r.createElement("p");n.textContent=`%%TABLE_${t}%%`,e.replaceWith(n)});let c=f.turndown(r.body.innerHTML);i.forEach((e,t)=>{c=c.replace(`%%REVIEW\\_${t}%%`,` ${e} `)}),a.forEach((e,t)=>{c=c.replace(new RegExp(`%%INVISIBLE\\\\*_${t}%%`,"g"),` ${e} `)}),l.forEach((e,t)=>{c=c.replace(`%%TABLE\\_${t}%%`,`\n\n${e}\n\n`)}),c=c.replace(/\*{4}([^*]+)\*{4}/g,"**$1**");["upt","manual","del","ins","preserved"].forEach(e=>{c=m(c,e)}),c=g(c,["manual","upt"]),M.current&&(j.current=c,M.current=!1),k.current=c,((e,t)=>{h(e,t)})("prompt",c)})},toolbarConfig:l,editorRef:T,mode:y,initialString:{type:L.type,value:L.value},dynamicHeight:H,onBlur:v,doNotShowBorderInViewMode:w||!1,onEditBlocked:b})]})});v.displayName="RichTextEditor";export{v as default};
1
+ import{jsxs as e,jsx as t}from"react/jsx-runtime";import{forwardRef as r,useRef as n,useState as o,useEffect as a,useImperativeHandle as l}from"react";import{DEFAULT_TOOLBAR_CONFIG as i}from"./Editor/constants/editorConfig.js";import c from"./Editor/Editor.js";import{useRefStore as s}from"../../store/ref.context.js";import{$generateHtmlFromNodes as u}from"@lexical/html";import d from"turndown";import{tables as h}from"turndown-plugin-gfm";import{UnsavedChangesPopup as p}from"../UnsavedChangesPopup/UnsavedChangesPopup.js";import{mergeTagAcrossParagraphs as m,unescapeTagIds as g}from"../../../../utils/tagHelper.js";const f=new d({headingStyle:"atx",codeBlockStyle:"fenced"});f.keep(["ins","del","mark"]),f.keep(e=>{var t,r;return"A"===e.nodeName&&null!==(r=null===(t=e.getAttribute("href"))||void 0===t?void 0:t.includes("ai_reasoning$"))&&void 0!==r&&r}),f.keep(e=>"SPAN"===e.nodeName&&e.hasAttribute("highlight-id")),f.addRule("md-table-passthrough",{filter:e=>"PRE"===e.nodeName&&"true"===e.getAttribute("data-md-table"),replacement:(e,t)=>t.textContent||""}),f.use(h);const E=e=>(e||"").replace(/\r\n/g,"\n").trim(),v=r(({type:r,value:d,handleUpdateState:h,onBlur:v,placeholder:A,minHeight:S,height:$,mode:y,doNotShowBorderInViewMode:w,onEditBlocked:b,onSaveUnsavedChanges:x,onDiscardUnsavedChanges:C,isSavingUnsavedChanges:N=!1},B)=>{const T=n(null),[L,q]=o({type:r,value:d}),[H,I]=o(0),[R,_]=o(!1),j=n(d),k=n(d),M=n(Boolean(d)),{contentRef:U,setContentRef:V}=s();a(()=>{q(e=>({...e,value:d})),j.current=d,k.current=d,M.current=Boolean(d),_(!1)},[d]),l(B,()=>({requestClose:()=>!("edit"===y&&E(j.current)!==E(k.current))||(_(!0),!1)}),[y]);return a(()=>{const e=()=>{U&&U.current&&I(U.current.clientHeight-60)};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[U]),e("div",{style:{position:"relative",width:"100%",height:$,minHeight:S},children:[R&&t(p,{isSaving:N,onSave:async()=>{await(null==x?void 0:x()),j.current=k.current,_(!1)},onDiscard:()=>{k.current=j.current,null==C||C(),_(!1)}}),t(c,{minHeight:S,height:$,placeholder:A||"Enter some text...",onChange:(e,t)=>{e.read(()=>{const e=u(t,null),r=(new DOMParser).parseFromString(e,"text/html");r.querySelectorAll("span").forEach(e=>{const t=e.getAttribute("style")||"";t.includes("background-color")&&t.includes("rgb(219, 234, 254)")&&e.setAttribute("data-review","insert"),t.includes("text-decoration")&&t.includes("line-through")&&e.setAttribute("data-review","delete")}),r.querySelectorAll("strong code").forEach(e=>{const t=e.parentElement;t&&t.replaceChild(document.createTextNode(e.textContent||""),e)}),r.querySelectorAll("code strong").forEach(e=>{const t=e.parentElement;t&&t.replaceChild(document.createTextNode(e.textContent||""),e)}),r.querySelectorAll('a[href*="ai_reasoning$"]').forEach(e=>{const t=e.getAttribute("href")||"";e.setAttribute("href",t.replace(/^https?:\/\//,""))});const n=["upt","manual","ins","del","preserved"];function o(e,t){const r=e.cloneNode(!0),a=new Map;r.querySelectorAll(n.join(",")).forEach(e=>{if(e===r)return;const n=`%%NESTED${a.size}%%`;a.set(n,o(e,t)),e.replaceWith(n)});let l=t.turndown(r.innerHTML);a.forEach((e,t)=>{l=l.replace(t,e)});const i=Array.from(e.attributes).map(e=>`${e.name}="${e.value}"`).join(" "),c=e.tagName.toLowerCase();return i?`<${c} ${i}>${l}</${c}>`:`<${c}>${l}</${c}>`}r.querySelectorAll('a[href*="ai_reasoning$"]').forEach(e=>{const t=e.getAttribute("href")||"";e.setAttribute("href",t.replace(/^https?:\/\//,""))});const a=[];r.querySelectorAll("invisible").forEach((e,t)=>{a.push(e.outerHTML),e.replaceWith(r.createTextNode(`%%INVISIBLE_${t}%%`))});const l=[];["manual","upt"].forEach(e=>{r.querySelectorAll(e).forEach((e,t)=>{l.push(o(e,f)),e.replaceWith(r.createTextNode(`%%REVIEW_${l.length-1}%%`))})});const i=[];r.querySelectorAll("table").forEach((e,t)=>{i.push(e.outerHTML);const n=r.createElement("p");n.textContent=`%%TABLE_${t}%%`,e.replaceWith(n)});let c=f.turndown(r.body.innerHTML);for(let e=l.length-1;e>=0;e--)c=c.replace(`%%REVIEW\\_${e}%%`,` ${l[e]} `);a.forEach((e,t)=>{c=c.replace(new RegExp(`%%INVISIBLE\\\\*_${t}%%`,"g"),` ${e} `)}),i.forEach((e,t)=>{c=c.replace(`%%TABLE\\_${t}%%`,`\n\n${e}\n\n`)}),c=c.replace(/\*{4}([^*]+)\*{4}/g,"**$1**");["upt","manual","del","ins","preserved"].forEach(e=>{c=m(c,e)}),c=g(c,["manual","upt"]),M.current&&(j.current=c,M.current=!1),k.current=c,((e,t)=>{h(e,t)})("prompt",c)})},toolbarConfig:i,editorRef:T,mode:y,initialString:{type:L.type,value:L.value},dynamicHeight:H,onBlur:v,doNotShowBorderInViewMode:w||!1,onEditBlocked:b})]})});v.displayName="RichTextEditor";export{v as default};
2
2
  //# sourceMappingURL=RichTextEditor.js.map
@@ -1,2 +1,2 @@
1
- import{jsxs as e,jsx as i,Fragment as c}from"react/jsx-runtime";import a,{useMemo as t}from"react";import n from"../Popups/PopupDefaults.js";import l from"react-markdown";import r from"rehype-raw";import d from"./CitationComponent.module.css.js";import{ChevronUp as s}from"lucide-react";import{ReactComponent as o}from"../icons/cognitiveBrain.svg.js";import{ReactComponent as m}from"../icons/aiMagic.svg.js";import p from"./CitationAnchor.js";import{resolveRedline as _}from"../../../../../service/redlineService.js";import{useRequirementAI as h}from"../../RequirementAIWrapper/RequirementAIWrapper.js";const u=({text:e,item:c})=>i(l,{rehypePlugins:[r],components:{ol:({children:e})=>i("ol",{className:d["md-ol"],children:e}),ul:({children:e})=>i("ul",{className:d["md-ul"],children:e}),li:({children:e})=>i("li",{className:d["md-li"],children:e}),a:({node:e,href:a,children:t})=>i(p,{href:a,children:t,metaData:{citations:c.citations,docData:c.docData}})},children:e.replace(/<br\s*\/?>/gi,"\n")});function v({item:l,title:r="Cognitive Decisioning AI",relevanceScore:p=0,showRelevanceScore:v=!0,reason:N="No reasoning provided.",impact:b="No Impact provided.",explaination:y="No explaination provided.",gap:f="None",onClose:g=()=>{},onActionTrigger:x,showResolveBtns:C=!1,sections:I,leftIcon:k,scoreIcon:A,className:j,customStyles:B={},actions:D,disableAllActions:H=!1,actionBtnDisabledStyle:R={},onBackClick:$,isImpactNeeded:T=!0,cognitiveTitle:w="Cognitive Integrity",labels:L={},redlineId:P,aiReasonId:S}){const E=t(()=>{const e=Number(p);return Number.isNaN(e)?0:Math.max(0,Math.min(100,Math.round(e)))},[p]),M=t(()=>{const e=L&&L.noGapsText||"1. No gaps identified.";return(e=>{if(!e)return!0;const i=e.trim().toLowerCase();return"none"===i||"no gap"===i||"no gaps"===i||"n/a"===i})(f)?e:f},[f]),q=L&&L.impact||"Impact",G=L&&L.explanation||"Explaination",F=L&&L.decisionFactors||"Decision Making Factors",U=L&&L.gaps||"Gaps in Decision",W=L&&L.accept||"Accept",z=L&&L.reject||"Reject",J=L&&L.backAriaLabel||"Go back",{redlineDcoumentId:K,redlineConfig:O,updateRedlineDataParent:Q}=h(),V=async e=>{var i,c;null==x||x({status:"loading",action:e,metadata:{redlineId:P,aiReasonId:S}});try{const{updated_reqai:a}=await _({documentId:K,userEmail:null==O?void 0:O.userEmail,userName:null==O?void 0:O.userName,redlineId:null!=P?P:"",action:e,baseApiUrl:null==O?void 0:O.baseApiUrl,redlineConfigId:null!==(i=null==O?void 0:O.redlineConfigId)&&void 0!==i?i:""},null!==(c=null==O?void 0:O.token)&&void 0!==c?c:"");await(null==Q?void 0:Q(a)),null==x||x({status:"success",action:e,metadata:{redlineId:P,aiReasonId:S}})}catch(e){null==x||x({status:"failed",action:null,metadata:{redlineId:P,aiReasonId:S}})}},X=D||[{id:"reject",label:z,onClick:()=>V("reject"),className:d["btn-reject"]},{id:"accept",label:W,onClick:()=>V("accept"),className:d["btn-accept"]}];return e("div",{className:`${d["cite-acc"]} ${j||""}`,style:{...n.CitationAccordionDefaults.container,...null==B?void 0:B.container},children:[$&&e("div",{className:d["cite-acc__backHeader"],children:[i("button",{type:"button",className:d["cite-acc__backBtn"],onClick:e=>{e.stopPropagation(),$&&$()},"aria-label":J,children:"‹"}),i("span",{className:d["cite-acc__backTitle"],children:w})]}),i("div",{className:d["cite-body"],children:I&&I.length>0?I.map(c=>!1===c.show?null:e("div",{className:`${d["cite-acc__explain-body"]} ${c.bodyClassName||""}`,children:[e("div",{className:d["cite-acc__innerHeader"],style:{...n.CitationAccordionDefaults.innerHeader,...null==B?void 0:B.innerHeader},children:[i("div",{className:d["cite-acc__innerHeaderLeft"],children:i("div",{children:i("div",{className:d["cite-acc__innerTitle"],children:c.title})})}),i("button",{type:"button",onClick:e=>{e.stopPropagation(),g&&g()},children:i(s,{})})]}),i("div",{className:`${d["cite-acc__innerBody"]} text-sm text-gray-600`,style:{...n.CitationAccordionDefaults.innerBody,...null==B?void 0:B.innerBody},children:"string"==typeof c.content?i(u,{text:c.content,item:c.item||l||{}}):c.content})]},c.id||c.title)):e(c,{children:[T&&e("div",{className:d["cite-acc__explain-body"],children:[e("div",{className:d["cite-acc__innerHeader"],children:[i("div",{className:d["cite-acc__innerHeaderLeft"],children:i("div",{children:i("div",{className:d["cite-acc__innerTitle"],children:q})})}),i("button",{type:"button",onClick:e=>{e.stopPropagation(),g&&g()},children:i(s,{})})]}),i("div",{className:`${d["cite-acc__innerBody"]} text-sm text-gray-600`,children:i(u,{text:b||"",item:l||{}})})]}),e("div",{className:d["cite-acc__explain-body"],children:[i("div",{className:d["cite-acc__innerHeader"],children:i("div",{className:d["cite-acc__innerHeaderLeft"],children:i("div",{children:i("div",{className:d["cite-acc__innerTitle"],children:G})})})}),i("div",{className:`${d["cite-acc__innerBody"]} text-sm text-gray-600`,children:i(u,{text:y||"",item:{}})})]}),C&&i("div",{className:d["cite-acc__btn-container"],children:X.map(e=>{const c=H||e.disabled;return i("button",{className:e.className,onClick:c?void 0:e.onClick,disabled:c,style:{...e.style,...c?{opacity:.5,cursor:"not-allowed",...R,...e.disabledStyle}:{}},children:e.label},e.id)})}),e("div",{className:d["cite-acc__header"],children:[e("div",{className:d["cite-acc__headerLeft"],children:[i("span",{className:d["cite-acc__titleIcon"],children:k?"function"==typeof k?a.createElement(k):k:i(o,{})}),i("div",{className:d["cite-acc__title"],children:r})]}),i("div",{className:d["cite-acc__headerRight"],children:v&&e("span",{className:d["cite-acc__scoreBadge"],children:[A?"function"==typeof A?a.createElement(A):A:i(m,{}),e("span",{className:d["cite-acc__scoreText"],children:[E,"%"]})]})})]}),e("div",{className:d["cite-acc__explain-body"],children:[i("div",{className:d["cite-acc__innerHeader"],children:i("div",{className:d["cite-acc__innerHeaderLeft"],children:i("div",{children:i("div",{className:d["cite-acc__innerTitle"],children:F})})})}),i("div",{className:`${d["cite-acc__innerBody"]} text-sm text-gray-600`,children:i(u,{text:N||"",item:l||{}})})]}),e("div",{className:`${d["cite-acc__explain-body"]} ${d["cite-acc__explain-body_border"]}`,children:[i("div",{className:d["cite-acc__innerHeader"],children:i("div",{className:d["cite-acc__innerHeaderLeft"],children:i("div",{children:i("div",{className:d["cite-acc__innerTitle"],children:U})})})}),i("div",{className:`${d["cite-acc__innerBody"]} text-sm text-gray-600`,children:i(u,{text:M||"",item:l||{}})})]})]})})]})}export{v as default};
1
+ import{jsxs as e,jsx as i,Fragment as a}from"react/jsx-runtime";import c,{memo as n,useMemo as t}from"react";import l from"../Popups/PopupDefaults.js";import r from"react-markdown";import d from"rehype-raw";import s from"./CitationComponent.module.css.js";import{ChevronUp as o}from"lucide-react";import{ReactComponent as m}from"../icons/cognitiveBrain.svg.js";import{ReactComponent as p}from"../icons/aiMagic.svg.js";import _ from"./CitationAnchor.js";import{resolveRedline as h}from"../../../../../service/redlineService.js";import{useRequirementAI as v}from"../../RequirementAIWrapper/RequirementAIWrapper.js";const u=({text:e,item:a})=>i(r,{rehypePlugins:[d],components:{ol:({children:e})=>i("ol",{className:s["md-ol"],children:e}),ul:({children:e})=>i("ul",{className:s["md-ul"],children:e}),li:({children:e})=>i("li",{className:s["md-li"],children:e}),a:({node:e,href:c,children:n})=>i(_,{href:c,children:n,metaData:{citations:a.citations,docData:a.docData}})},children:e.replace(/<br\s*\/?>/gi,"\n")});var N=n(function({item:n,title:r="Cognitive Decisioning AI",relevanceScore:d=0,showRelevanceScore:_=!0,reason:N="No reasoning provided.",impact:b="No Impact provided.",explaination:y="No explaination provided.",gap:f="None",onClose:g=()=>{},onActionTrigger:x,showResolveBtns:I=!1,sections:C,leftIcon:A,scoreIcon:k,className:R,customStyles:j={},actions:B,disableAllActions:D=!1,actionBtnDisabledStyle:H={},onBackClick:$,isImpactNeeded:T=!0,cognitiveTitle:w="Cognitive Integrity",labels:L={},redlineId:S,aiReasonId:P}){const E=t(()=>{const e=Number(d);return Number.isNaN(e)?0:Math.max(0,Math.min(100,Math.round(e)))},[d]),M=t(()=>{const e=L&&L.noGapsText||"1. No gaps identified.";return(e=>{if(!e)return!0;const i=e.trim().toLowerCase();return"none"===i||"no gap"===i||"no gaps"===i||"n/a"===i})(f)?e:f},[f]),q=L&&L.impact||"Impact",G=L&&L.explanation||"Explaination",F=L&&L.decisionFactors||"Decision Making Factors",U=L&&L.gaps||"Gaps in Decision",W=L&&L.accept||"Accept",z=L&&L.reject||"Reject",J=L&&L.backAriaLabel||"Go back",{redlineDcoumentId:K,redlineConfig:O,updateRedlineDataParent:Q}=v(),V=async e=>{var i,a;null==x||x({status:"loading",action:e,metadata:{redlineId:S,aiReasonId:P}});try{const{updated_reqai:c}=await h({documentId:K,userEmail:null==O?void 0:O.userEmail,userName:null==O?void 0:O.userName,redlineId:null!=S?S:"",action:e,baseApiUrl:null==O?void 0:O.baseApiUrl,redlineConfigId:null!==(i=null==O?void 0:O.redlineConfigId)&&void 0!==i?i:""},null!==(a=null==O?void 0:O.token)&&void 0!==a?a:"");await(null==Q?void 0:Q(c)),null==x||x({status:"success",action:e,metadata:{redlineId:S,aiReasonId:P}})}catch(i){null==x||x({status:"failed",action:e,metadata:{redlineId:S,aiReasonId:P}})}},X=B||[{id:"reject",label:z,onClick:()=>V("reject"),className:s["btn-reject"]},{id:"accept",label:W,onClick:()=>V("accept"),className:s["btn-accept"]}];return e("div",{className:`${s["cite-acc"]} ${R||""}`,style:{...l.CitationAccordionDefaults.container,...null==j?void 0:j.container},children:[$&&e("div",{className:s["cite-acc__backHeader"],children:[i("button",{type:"button",className:s["cite-acc__backBtn"],onClick:e=>{e.stopPropagation(),$&&$()},"aria-label":J,children:"‹"}),i("span",{className:s["cite-acc__backTitle"],children:w})]}),i("div",{className:s["cite-body"],children:C&&C.length>0?C.map(a=>!1===a.show?null:e("div",{className:`${s["cite-acc__explain-body"]} ${a.bodyClassName||""}`,children:[e("div",{className:s["cite-acc__innerHeader"],style:{...l.CitationAccordionDefaults.innerHeader,...null==j?void 0:j.innerHeader},children:[i("div",{className:s["cite-acc__innerHeaderLeft"],children:i("div",{children:i("div",{className:s["cite-acc__innerTitle"],children:a.title})})}),i("button",{type:"button",onClick:e=>{e.stopPropagation(),g&&g()},children:i(o,{})})]}),i("div",{className:`${s["cite-acc__innerBody"]} text-sm text-gray-600`,style:{...l.CitationAccordionDefaults.innerBody,...null==j?void 0:j.innerBody},children:"string"==typeof a.content?i(u,{text:a.content,item:a.item||n||{}}):a.content})]},a.id||a.title)):e(a,{children:[T&&e("div",{className:s["cite-acc__explain-body"],children:[e("div",{className:s["cite-acc__innerHeader"],children:[i("div",{className:s["cite-acc__innerHeaderLeft"],children:i("div",{children:i("div",{className:s["cite-acc__innerTitle"],children:q})})}),i("button",{type:"button",onClick:e=>{e.stopPropagation(),g&&g()},children:i(o,{})})]}),i("div",{className:`${s["cite-acc__innerBody"]} text-sm text-gray-600`,children:i(u,{text:b||"",item:n||{}})})]}),e("div",{className:s["cite-acc__explain-body"],children:[i("div",{className:s["cite-acc__innerHeader"],children:i("div",{className:s["cite-acc__innerHeaderLeft"],children:i("div",{children:i("div",{className:s["cite-acc__innerTitle"],children:G})})})}),i("div",{className:`${s["cite-acc__innerBody"]} text-sm text-gray-600`,children:i(u,{text:y||"",item:{}})})]}),I&&i("div",{className:s["cite-acc__btn-container"],children:X.map(e=>{const a=D||e.disabled;return i("button",{className:e.className,onClick:a?void 0:e.onClick,disabled:a,style:{...e.style,...a?{opacity:.5,cursor:"not-allowed",...H,...e.disabledStyle}:{}},children:e.label},e.id)})}),e("div",{className:s["cite-acc__header"],children:[e("div",{className:s["cite-acc__headerLeft"],children:[i("span",{className:s["cite-acc__titleIcon"],children:A?"function"==typeof A?c.createElement(A):A:i(m,{})}),i("div",{className:s["cite-acc__title"],children:r})]}),i("div",{className:s["cite-acc__headerRight"],children:_&&e("span",{className:s["cite-acc__scoreBadge"],children:[k?"function"==typeof k?c.createElement(k):k:i(p,{}),e("span",{className:s["cite-acc__scoreText"],children:[E,"%"]})]})})]}),e("div",{className:s["cite-acc__explain-body"],children:[i("div",{className:s["cite-acc__innerHeader"],children:i("div",{className:s["cite-acc__innerHeaderLeft"],children:i("div",{children:i("div",{className:s["cite-acc__innerTitle"],children:F})})})}),i("div",{className:`${s["cite-acc__innerBody"]} text-sm text-gray-600`,children:i(u,{text:N||"",item:n||{}})})]}),e("div",{className:`${s["cite-acc__explain-body"]} ${s["cite-acc__explain-body_border"]}`,children:[i("div",{className:s["cite-acc__innerHeader"],children:i("div",{className:s["cite-acc__innerHeaderLeft"],children:i("div",{children:i("div",{className:s["cite-acc__innerTitle"],children:U})})})}),i("div",{className:`${s["cite-acc__innerBody"]} text-sm text-gray-600`,children:i(u,{text:M||"",item:n||{}})})]})]})})]})},(e,i)=>e.disableAllActions===i.disableAllActions&&(e.redlineId===i.redlineId&&(e.aiReasonId===i.aiReasonId&&(e.relevanceScore===i.relevanceScore&&(e.reason===i.reason&&(e.impact===i.impact&&(e.explaination===i.explaination&&e.gap===i.gap)))))));export{N as default};
2
2
  //# sourceMappingURL=CognitiveComponent.js.map
@@ -1,2 +1,2 @@
1
- import{jsx as e,jsxs as i,Fragment as n}from"react/jsx-runtime";import{PenLine as o,CheckCircle as t,XCircle as l,Info as r,ChevronDown as d,ChevronRight as a}from"lucide-react";import{useState as s}from"react";import{ToneToggle as c}from"./ToneToggle.js";import"../CognitiveComponents/CitationComponent.module.css.js";import{ReactComponent as p}from"../icons/cognitiveBrain.svg.js";import{ReactComponent as g}from"../icons/aiMagic.svg.js";import{Tooltip as u}from"@mui/material";import{useRequirementAI as v}from"../../RequirementAIWrapper/RequirementAIWrapper.js";import{resolveRedline as m}from"../../../../../service/redlineService.js";import{AiReasonMarkdownWrapper as y}from"../../ai-reasoning/AiReasonMarkdownWrapper.js";const h=[{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"}],x=({toneIndex:n,configs:o=h})=>{const t=Math.min(n,o.length-1),{color:l,angle:r,arcD:d}=o[t]||o[1]||o[0],a=(r-90)*Math.PI/180,s=11+9*Math.cos(a),c=13+9*Math.sin(a);return i("svg",{width:"22",height:"14",viewBox:"0 0 22 14",fill:"none",children:[e("path",{d:"M1 13 A10 10 0 0 1 21 13",stroke:"#e5e5e5",strokeWidth:"2.5",strokeLinecap:"round"}),e("path",{d:d,stroke:l,strokeWidth:"2.5",strokeLinecap:"round"}),e("line",{x1:"11",y1:"13",x2:s,y2:c,stroke:l,strokeWidth:"2",strokeLinecap:"round"})]})},f=({type:i,customStyles:n={}})=>{const o={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"},...n},t=o[i]||o.Medium;return e("div",{style:t,children:i})},S=["Lenient","Balanced","Aggressive"],b={Lenient:"#1D9E75",Balanced:"#BA7517",Aggressive:"#E24B4A"},C={width:"350px",background:"#fff",border:"1px solid #ddd",borderRadius:"8px",padding:"16px",maxHeight:"450px",overflow:"auto"},I={display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12,position:"relative"},k={fontSize:11,fontWeight:500,letterSpacing:"0.08em",color:"#E24B4A",textTransform:"uppercase"},w={fontSize:15,fontWeight:500,margin:"0 0 8px",color:"#111",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},B={fontSize:13,color:"#666",lineHeight:1.6,margin:"0 0 14px",maxHeight:"100px",overflow:"auto"},T={marginBottom:14,borderTop:"0.5px solid #eee",paddingTop:12},A={fontSize:13,color:"#666",lineHeight:1.6,margin:"8px 0 0",maxHeight:"100px",overflow:"auto"},D={display:"flex",alignItems:"center",gap:6,background:"none",border:"none",cursor:"pointer",padding:0,width:"100%"},E={fontSize:11,fontWeight:500,textTransform:"uppercase",letterSpacing:"0.08em",color:"#E24B4A"},R={display:"flex",gap:8,marginBottom:18},z={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},j={borderTop:"0.5px solid #eee",padding:"14px 0px"},L={display:"flex",alignItems:"center",width:"100%",background:"none",border:"none",cursor:"pointer",padding:0,marginBottom:4},M={cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"12px",borderTop:"1px solid #eee",borderBottom:"none",paddingLeft:"12px",paddingRight:"12px"},H={display:"flex",alignItems:"center",gap:"4px",minWidth:0,flex:"1 1 auto",overflow:"hidden"},_={width:"28px",height:"28px",display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 28px"},F={fontSize:"13px",color:"#101828",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},N={display:"flex",alignItems:"center",gap:"10px",flex:"0 0 auto",minWidth:0,flexWrap:"nowrap"},O={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},P={color:"var(--Primitive-Purple-600, #6938ef)",fontFamily:"Inter",fontSize:"12px",fontStyle:"normal",fontWeight:500,lineHeight:"150%"},U={padding:"4px",border:"1px solid #EBEBEB",position:"absolute",width:"100px",textAlign:"center",borderRadius:"9px",background:"#fff",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",zIndex:1e3,top:"100%",right:0};function q({onAssignClick:n,onOpenCognitive:o,cognitiveIconSmall:t,cognitiveTootipTitle:l,historyIconSmall:r,onHistoryClick:d,historyTootipTitle:a}){const s="20px";return i("div",{style:{...U,minWidth:"200px"},children:[i("div",{style:{padding:"8px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"10px"},onClick:n,children:[e("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:s,height:s,flexShrink:0},children:i("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e("path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"}),e("path",{d:"M16 3.128a4 4 0 0 1 0 7.744"}),e("path",{d:"M22 21v-2a4 4 0 0 0-3-3.87"}),e("circle",{cx:"9",cy:"7",r:"4"})]})}),e("span",{style:{fontSize:"13px",display:"flex",alignItems:"center",flex:1,textAlign:"left"},children:"Assign"})]}),o&&i("div",{style:{padding:"8px",borderTop:"1px solid #EBEBEB",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"10px"},onClick:e=>o(e),children:[t&&e("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:s,height:s,flexShrink:0},children:t}),e("span",{style:{fontSize:"13px",display:"flex",alignItems:"center",flex:1,textAlign:"left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:l})]}),d&&i("div",{style:{padding:"8px",borderTop:"1px solid #EBEBEB",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"10px"},onClick:e=>d(e),children:[r&&e("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:s,height:s,flexShrink:0},children:r}),e("span",{style:{fontSize:"13px",display:"flex",alignItems:"center",flex:1,textAlign:"left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:a})]})]})}function $({onAssignClick:n,onOpenCognitive:o,cognitiveIconSmall:t,cognitiveTootipTitle:l,historyIconSmall:r,onHistoryClick:d,historyTootipTitle:a}){const[c,p]=s(!1);return i("div",{style:{position:"relative",display:"flex"},children:[e("button",{onClick:()=>p(!c),style:{border:"none",background:"transparent",display:"flex",alignItems:"center",cursor:"pointer",fontSize:"18px",padding:0},children:i("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#64748B",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e("circle",{cx:"12",cy:"12",r:"1"}),e("circle",{cx:"12",cy:"5",r:"1"}),e("circle",{cx:"12",cy:"19",r:"1"})]})}),c&&e(q,{onAssignClick:n?()=>{p(!1),n&&n()}:void 0,onOpenCognitive:o?e=>{p(!1),o&&o(e)}:void 0,cognitiveIconSmall:t,cognitiveTootipTitle:l,historyIconSmall:r,onHistoryClick:d,historyTootipTitle:a})]})}function G({users:n,onClick:o}){const t=n.length;return i("div",{onClick:o,style:{display:"flex",padding:"2px 6px",border:"1px solid #E2E8F0",background:"#fff",cursor:"pointer",fontSize:"11px",gap:6,borderRadius:"16px",alignItems:"center"},children:[e("p",{style:{margin:"0px",display:"flex",alignItems:"center",color:"#475569",whiteSpace:"nowrap"},children:(null==n?void 0:n[0].length)>9?(null==n?void 0:n[0].slice(0,9))+"...":null==n?void 0:n[0]}),t>1&&i("p",{style:{margin:"0px",display:"flex",alignItems:"center",borderRadius:"50px",backgroundColor:"#E2E8F0",padding:"2px 6px",color:"#475569",fontWeight:500},children:["+",t-1]})]})}function V({onClose:U,aiReason:q,onActionTrigger:V,onIterate:J,initialTone:K,onRegenerate:Q,labels:X={},toneLevelsConfig:Y=S,toneColorsConfig:Z=b,dialConfigs:ee=h,actions:ie,disableAllActions:ne=!1,customStyles:oe={},severityChipStyles:te={},customIcons:le={},onOpenCognitive:re,onHistoryClick:de,historyIconSmall:ae,historyTootipTitle:se,showTone:ce=!0,cognitiveSectionStyle:pe={},cognitiveScoreBadgeStyle:ge={},cognitiveScoreTextStyle:ue={},cognitiveStyles:ve={},cognitiveClassNames:me={},cognitiveTitle:ye="Cognitive Integrity",cognitiveTootipTitle:he="Cognitive Decisioning",cognitiveLeftIcon:xe,cognitiveIconSmall:fe,showCognitiveRightArrow:Se=!0,isStreaming:be,onAssignClick:Ce,assignedUsers:Ie,onReviewUsersClick:ke,redlineId:we,aiReasonId:Be}){var Te,Ae,De,Ee,Re,ze,We,je,Le,Me,He,_e,Fe,Ne,Oe,Pe,Ue,qe,$e;let Ge=Y.findIndex(e=>e===K);-1===Ge&&(Ge=1);const[Ve,Je]=s(!0),[Ke,Qe]=s(!1),[Xe,Ye]=s(!1),[Ze,ei]=s(Ge),[ii]=s(Ge),ni=Y[Ze],oi=Z[ni]||"#BA7517",ti=Ze!==ii,li=[{id:"iterate",icon:le.iterateIcon||e(o,{size:16,color:"#64748B"}),label:X.btnIterate||"Iterate",color:"#64748B",onClick:J},{id:"accept",icon:le.acceptIcon||e(t,{size:16,color:"#10B981"}),label:X.btnAccept||"Approve",color:"#10B981",useLabel:!0},{id:"reject",icon:le.rejectIcon||e(l,{size:16,color:"#DC2626"}),label:X.btnReject||"Reject",color:"#DC2626",useLabel:!0}],{redlineDcoumentId:ri,redlineConfig:di,updateRedlineDataParent:ai}=v(),si=ie||li;return i("div",{onClick:e=>{e.stopPropagation()},style:{...C,...null===(Te=null==oe?void 0:oe.DeviationSummaryStyles)||void 0===Te?void 0:Te.root},children:[i("div",{style:{...I,...null===(Ae=null==oe?void 0:oe.DeviationSummaryStyles)||void 0===Ae?void 0:Ae.header,marginBottom:Xe?"16px":"12px"},children:[i("div",{style:{display:"flex",alignItems:"center",gap:10},children:[i("div",{style:{display:"flex",alignItems:"center",gap:6},children:[e("span",{children:le.summaryIcon||e(r,{size:16,color:"#E24B4A"})}),e("span",{style:{...k,...null===(De=null==oe?void 0:oe.DeviationSummaryStyles)||void 0===De?void 0:De.title},children:X.summaryHeader||"Summary"})]}),Ie&&Ie.length>0&&e(G,{users:Ie,onClick:e=>{e.stopPropagation(),null==ke||ke()}})]}),i("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[(Ce||re)&&e($,{onAssignClick:Ce,onOpenCognitive:re,cognitiveIconSmall:fe,cognitiveTootipTitle:he,historyIconSmall:ae,onHistoryClick:de,historyTootipTitle:se}),e("button",{onClick:U,style:{...W,...null===(Ee=null==oe?void 0:oe.DeviationSummaryStyles)||void 0===Ee?void 0:Ee.closeBtn,color:"#64748B"},children:"✕"})]})]}),e(u,{title:null===(Re=null==q?void 0:q.redlining_details)||void 0===Re?void 0:Re.redline_title,children:e("p",{style:{...w,...null===(ze=null==oe?void 0:oe.DeviationSummaryStyles)||void 0===ze?void 0:ze.bodyText},children:null===(We=null==q?void 0:q.redlining_details)||void 0===We?void 0:We.redline_title})}),e("p",{style:{...B,...null===(je=null==oe?void 0:oe.DeviationSummaryStyles)||void 0===je?void 0:je.summary},children:null===(Le=null==q?void 0:q.redlining_details)||void 0===Le?void 0:Le.redline_summary}),i("div",{style:{...T,...null===(Me=null==oe?void 0:oe.DeviationSummaryStyles)||void 0===Me?void 0:Me.impactContainer},children:[i("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[i("button",{onClick:()=>Je(!Ve),style:{...D,...null===(He=null==oe?void 0:oe.DeviationSummaryStyles)||void 0===He?void 0:He.impactToggle},children:[e("span",{style:{...E,...null===(_e=null==oe?void 0:oe.DeviationSummaryStyles)||void 0===_e?void 0:_e.impactToggleLabel},children:X.impactHeader||"Impact"}),e("span",{style:{fontSize:12,color:"#E24B4A",transition:"transform 0.2s",display:"flex",alignItems:"center",transform:Ve?"rotate(180deg)":"rotate(0deg)"},children:e(d,{size:16,color:"#E24B4A"})})]}),e(f,{type:(null==q?void 0:q.severity)||"Medium",customStyles:te})]}),Ve&&e(n,{children:e("div",{style:{...A,...null===(Fe=null==oe?void 0:oe.DeviationSummaryStyles)||void 0===Fe?void 0:Fe.impactText},children:e(y,{message:`${null!==(Oe=null===(Ne=null==q?void 0:q.redlining_details)||void 0===Ne?void 0:Ne.redline_impact)&&void 0!==Oe?Oe:X.fallbackImpact||"This change reduces compliance obligations and lowers contractual risk thresholds."} [View chat](chat_citation$all)`,customStyles:null===(Pe=null==oe?void 0:oe.DeviationSummaryStyles)||void 0===Pe?void 0:Pe.impactMarkdown})})})]}),e("div",{style:{...R,...null===(Ue=null==oe?void 0:oe.DeviationSummaryStyles)||void 0===Ue?void 0:Ue.actionContainer},children:si.map(e=>{var n,o;const t=ne||e.disabled,l=t?{cursor:"not-allowed",opacity:.5,...null===(n=null==oe?void 0:oe.DeviationSummaryStyles)||void 0===n?void 0:n.actionBtnDisabled,...e.disabledStyle}:{};return i("button",{style:{...z,...null===(o=null==oe?void 0:oe.DeviationSummaryStyles)||void 0===o?void 0:o.actionBtn,color:e.color,...e.style,...l},onClick:t?void 0:()=>{var i;e.useLabel?(async e=>{var i,n,o;null==V||V({status:"loading",action:e,metadata:{redlineId:we,aiReasonId:Be}});try{const{updated_reqai:t}=await m({documentId:ri,userEmail:null==di?void 0:di.userEmail,userName:null==di?void 0:di.userName,redlineId:null!==(i=null==q?void 0:q.redline_id)&&void 0!==i?i:"",action:e,baseApiUrl:null==di?void 0:di.baseApiUrl,redlineConfigId:null!==(n=null==di?void 0:di.redlineConfigId)&&void 0!==n?n:""},null!==(o=null==di?void 0:di.token)&&void 0!==o?o:"");await(null==ai?void 0:ai(t)),null==V||V({status:"success",action:e,metadata:{redlineId:we,aiReasonId:Be}})}catch(e){null==V||V({status:"failed",action:null,metadata:{redlineId:we,aiReasonId:Be}})}})(e.id.toLowerCase()):null===(i=e.onClick)||void 0===i||i.call(e)},disabled:t,children:[e.icon,e.label]},e.id)})}),ce&&i("div",{style:{...j,...null===(qe=null==oe?void 0:oe.DeviationSummaryStyles)||void 0===qe?void 0:qe.toneContainer},children:[i("button",{onClick:()=>Qe(!Ke),style:{...L,...null===($e=null==oe?void 0:oe.DeviationSummaryStyles)||void 0===$e?void 0:$e.toneToggleBtn},children:[i("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e(x,{toneIndex:Ze,configs:ee}),e("span",{style:{fontSize:13,fontWeight:500,color:"#111"},children:X.toneHeader||"Redline Tone"})]}),e("span",{style:{transition:"transform 0.2s",display:"flex",alignItems:"center",transform:Ke?"rotate(180deg)":"rotate(0deg)"},children:e(d,{size:16,color:"#111"})})]}),Ke&&i(n,{children:[e("p",{style:{fontSize:12,color:"#888",margin:"0 0 12px"},children:X.toneDescription||"Controls how assertively AI is redlining"}),e(c,{isDirty:ti,onToneChange:e=>{ei(e)},toneColor:oi,toneIndex:Ze,onClickRegenerate:()=>null==Q?void 0:Q(ni),toneLabels:Y,isStreaming:be,aiReason:q})]})]}),re&&i("div",{className:null==me?void 0:me.section,onClick:e=>{e.stopPropagation(),re&&re(e)},style:{...M,...null==ve?void 0:ve.section,...pe},children:[i("div",{className:null==me?void 0:me.headerLeft,style:{...H,...null==ve?void 0:ve.headerLeft},children:[e("span",{className:null==me?void 0:me.titleIcon,style:{..._,...null==ve?void 0:ve.titleIcon},children:null!=xe?xe:e(p,{})}),e("div",{className:null==me?void 0:me.cognitiveTitle,style:{...F,...null==ve?void 0:ve.cognitiveTitle},children:ye})]}),i("div",{className:null==me?void 0:me.headerRight,style:{...N,...null==ve?void 0:ve.headerRight},children:[void 0!==(null==q?void 0:q.relevance_score)&&null!==(null==q?void 0:q.relevance_score)?i("span",{className:null==me?void 0:me.scoreBadge,style:{...O,...null==ve?void 0:ve.scoreBadge,...ge},children:[e(g,{}),i("span",{className:null==me?void 0:me.scoreText,style:{...P,...null==ve?void 0:ve.scoreText,...ue},children:[Math.round(Number(q.relevance_score)),"%"]})]}):null,Se&&e("span",{style:{display:"flex",alignItems:"center"},children:e(a,{size:16,color:"#64748B"})})]})]})]})}export{q as AssignMenu,G as DisplayUsers,$ as KebabMenu,V as default};
1
+ import{jsxs as e,jsx as i,Fragment as t}from"react/jsx-runtime";import{PenLine as n,CheckCircle as o,XCircle as l,Info as r,ChevronDown as d,ChevronRight as a}from"lucide-react";import s,{memo as c,useState as p}from"react";import{ToneToggle as g}from"./ToneToggle.js";import"../CognitiveComponents/CitationComponent.module.css.js";import{ReactComponent as h}from"../icons/cognitiveBrain.svg.js";import{ReactComponent as u}from"../icons/aiMagic.svg.js";import{Tooltip as v}from"@mui/material";import{useRequirementAI as m}from"../../RequirementAIWrapper/RequirementAIWrapper.js";import{resolveRedline as x}from"../../../../../service/redlineService.js";import{AiReasonMarkdownWrapper as f}from"../../ai-reasoning/AiReasonMarkdownWrapper.js";const y=[{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"}],w=({toneIndex:t,configs:n=y})=>{const o=Math.min(t,n.length-1),{color:l,angle:r,arcD:d}=n[o]||n[1]||n[0],a=(r-90)*Math.PI/180,s=11+9*Math.cos(a),c=13+9*Math.sin(a);return e("svg",{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:d,stroke:l,strokeWidth:"2.5",strokeLinecap:"round"}),i("line",{x1:"11",y1:"13",x2:s,y2:c,stroke:l,strokeWidth:"2",strokeLinecap:"round"})]})},S=({type:e,customStyles:t={}})=>{const n={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},o=n[e]||n.Medium;return i("div",{style:o,children:e})},b=["Lenient","Balanced","Aggressive"],k={Lenient:"#1D9E75",Balanced:"#BA7517",Aggressive:"#E24B4A"},C={width:"350px",background:"#fff",border:"1px solid #ddd",borderRadius:"8px",padding:"16px",maxHeight:"450px",overflow:"auto"},I={display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12,position:"relative"},B={fontSize:11,fontWeight:500,letterSpacing:"0.08em",color:"#E24B4A",textTransform:"uppercase"},T={fontSize:15,fontWeight:500,margin:"0 0 8px",color:"#111",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},A={fontSize:13,color:"#666",lineHeight:1.6,margin:"0 0 14px",maxHeight:"100px",overflow:"auto"},E={marginBottom:14,borderTop:"0.5px solid #eee",paddingTop:12},R={fontSize:13,color:"#666",lineHeight:1.6,margin:"8px 0 0",maxHeight:"100px",overflow:"auto"},W={display:"flex",alignItems:"center",gap:6,background:"none",border:"none",cursor:"pointer",padding:0,width:"100%"},L={fontSize:11,fontWeight:500,textTransform:"uppercase",letterSpacing:"0.08em",color:"#E24B4A"},z={display:"flex",gap:8,marginBottom:18},j={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"},F={background:"none",border:"none",cursor:"pointer",fontSize:16,color:"#888",lineHeight:1,padding:0},D={borderTop:"0.5px solid #eee",padding:"14px 0px"},M={display:"flex",alignItems:"center",width:"100%",background:"none",border:"none",cursor:"pointer",padding:0,marginBottom:4},H={cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"12px",borderTop:"1px solid #eee",borderBottom:"none",paddingLeft:"12px",paddingRight:"12px"},_={display:"flex",alignItems:"center",gap:"4px",minWidth:0,flex:"1 1 auto",overflow:"hidden"},O={width:"28px",height:"28px",display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 28px"},N={fontSize:"13px",color:"#101828",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},P={display:"flex",alignItems:"center",gap:"10px",flex:"0 0 auto",minWidth:0,flexWrap:"nowrap"},$={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},V={color:"var(--Primitive-Purple-600, #6938ef)",fontFamily:"Inter",fontSize:"12px",fontStyle:"normal",fontWeight:500,lineHeight:"150%"},U={padding:"4px",border:"1px solid #EBEBEB",position:"absolute",width:"100px",textAlign:"center",borderRadius:"9px",background:"#fff",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",zIndex:1e3,top:"100%",right:0},q=c(function({onAssignClick:t,onOpenCognitive:n,cognitiveIconSmall:o,cognitiveTootipTitle:l,historyIconSmall:r,onHistoryClick:d,historyTootipTitle:a}){const s="20px";return e("div",{style:{...U,minWidth:"200px"},children:[e("div",{style:{padding:"8px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"10px"},onClick:t,children:[i("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:s,height:s,flexShrink:0},children:e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[i("path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"}),i("path",{d:"M16 3.128a4 4 0 0 1 0 7.744"}),i("path",{d:"M22 21v-2a4 4 0 0 0-3-3.87"}),i("circle",{cx:"9",cy:"7",r:"4"})]})}),i("span",{style:{fontSize:"13px",display:"flex",alignItems:"center",flex:1,textAlign:"left"},children:"Assign"})]}),n&&e("div",{style:{padding:"8px",borderTop:"1px solid #EBEBEB",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"10px"},onClick:e=>n(e),children:[o&&i("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:s,height:s,flexShrink:0},children:o}),i("span",{style:{fontSize:"13px",display:"flex",alignItems:"center",flex:1,textAlign:"left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:l})]}),d&&e("div",{style:{padding:"8px",borderTop:"1px solid #EBEBEB",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"10px"},onClick:e=>d(e),children:[r&&i("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:s,height:s,flexShrink:0},children:r}),i("span",{style:{fontSize:"13px",display:"flex",alignItems:"center",flex:1,textAlign:"left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:a})]})]})}),G=c(function({onAssignClick:t,onOpenCognitive:n,cognitiveIconSmall:o,cognitiveTootipTitle:l,historyIconSmall:r,onHistoryClick:d,historyTootipTitle:a}){const[s,c]=p(!1);return e("div",{style:{position:"relative",display:"flex"},children:[i("button",{onClick:()=>c(!s),style:{border:"none",background:"transparent",display:"flex",alignItems:"center",cursor:"pointer",fontSize:"18px",padding:0},children:e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#64748B",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[i("circle",{cx:"12",cy:"12",r:"1"}),i("circle",{cx:"12",cy:"5",r:"1"}),i("circle",{cx:"12",cy:"19",r:"1"})]})}),s&&i(q,{onAssignClick:t?()=>{c(!1),t&&t()}:void 0,onOpenCognitive:n?e=>{c(!1),n&&n(e)}:void 0,cognitiveIconSmall:o,cognitiveTootipTitle:l,historyIconSmall:r,onHistoryClick:d,historyTootipTitle:a})]})}),J=c(function({users:t,onClick:n}){const o=t.length;return e("div",{onClick:n,style:{display:"flex",padding:"2px 6px",border:"1px solid #E2E8F0",background:"#fff",cursor:"pointer",fontSize:"11px",gap:6,borderRadius:"16px",alignItems:"center"},children:[i("p",{style:{margin:"0px",display:"flex",alignItems:"center",color:"#475569",whiteSpace:"nowrap"},children:(null==t?void 0:t[0].length)>9?(null==t?void 0:t[0].slice(0,9))+"...":null==t?void 0:t[0]}),o>1&&e("p",{style:{margin:"0px",display:"flex",alignItems:"center",borderRadius:"50px",backgroundColor:"#E2E8F0",padding:"2px 6px",color:"#475569",fontWeight:500},children:["+",o-1]})]})}),K=c(function({steps:t}){if(!(null==t?void 0:t.length))return null;const n=t.length>=3;return i("div",{style:{width:"100%",maxWidth:"100%",boxSizing:"border-box",marginBottom:10,overflow:"hidden"},children:i("div",{style:{width:"100%",maxWidth:"100%",boxSizing:"border-box",display:"flex",alignItems:"center",border:"1px solid #CBD5E1",borderRadius:8,padding:n?"6px 8px":"8px 10px",background:"#F8FAFC",gap:n?4:8,overflow:"hidden"},children:t.map((o,l)=>{const r=(e=>{const i=[{bg:"#FEF08A",text:"#854D0E"},{bg:"#D1FAE5",text:"#065F46"},{bg:"#E0F2FE",text:"#0369A1"},{bg:"#F3E8FF",text:"#6B21A8"}];return i[e%i.length]})(l),d=l===t.length-1;return e(s.Fragment,{children:[e("div",{title:o.label,style:{minWidth:0,flex:"1 1 0",display:"flex",alignItems:"center",justifyContent:"center",gap:n?4:6,overflow:"hidden"},children:[(a=o.status,e("svg","approved"===a?{xmlns:"http://www.w3.org/2000/svg",width:n?"14":"16",height:n?"14":"16",viewBox:"0 0 24 24",fill:"none",stroke:"#10B981",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[i("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),i("polyline",{points:"22 4 12 14.01 9 11.01"})]}:"rejected"===a?{xmlns:"http://www.w3.org/2000/svg",width:n?"14":"16",height:n?"14":"16",viewBox:"0 0 24 24",fill:"none",stroke:"#EF4444",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[i("circle",{cx:"12",cy:"12",r:"10"}),i("path",{d:"m15 9-6 6"}),i("path",{d:"m9 9 6 6"})]}:{xmlns:"http://www.w3.org/2000/svg",width:n?"14":"16",height:n?"14":"16",viewBox:"0 0 24 24",fill:"none",stroke:"#F59E0B",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[i("path",{d:"M5 22h14"}),i("path",{d:"M5 2h14"}),i("path",{d:"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22"}),i("path",{d:"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2"})]})),i("span",{style:{minWidth:0,color:"#475569",fontSize:n?12:13,lineHeight:"16px",fontWeight:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:o.label}),o.initials&&i("span",{style:{width:n?20:22,height:n?20:22,minWidth:n?20:22,borderRadius:"50%",background:r.bg,color:r.text,display:"flex",alignItems:"center",justifyContent:"center",fontSize:n?9:10,fontWeight:700,lineHeight:1},children:o.initials})]}),!d&&e("svg",{xmlns:"http://www.w3.org/2000/svg",width:n?"14":"18",height:n?"14":"18",viewBox:"0 0 24 24",fill:"none",stroke:"#94A3B8",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",style:{flex:"0 0 auto",minWidth:n?14:18},children:[i("path",{d:"M5 12h14"}),i("path",{d:"m12 5 7 7-7 7"})]})]},o.id);var a})})})});var Q=c(function({onClose:s,aiReason:c,onActionTrigger:U,onIterate:q,initialTone:Q,onRegenerate:X,labels:Y={},toneLevelsConfig:Z=b,toneColorsConfig:ee=k,dialConfigs:ie=y,actions:te,disableAllActions:ne=!1,customStyles:oe={},severityChipStyles:le={},customIcons:re={},onOpenCognitive:de,onHistoryClick:ae,historyIconSmall:se,historyTootipTitle:ce,showTone:pe=!0,cognitiveSectionStyle:ge={},cognitiveScoreBadgeStyle:he={},cognitiveScoreTextStyle:ue={},cognitiveStyles:ve={},cognitiveClassNames:me={},cognitiveTitle:xe="Cognitive Integrity",cognitiveTootipTitle:fe="Cognitive Decisioning",cognitiveLeftIcon:ye,cognitiveIconSmall:we,showCognitiveRightArrow:Se=!0,isStreaming:be,onAssignClick:ke,assignedUsers:Ce,onReviewUsersClick:Ie,redlineId:Be,aiReasonId:Te,displayVariant:Ae="default",reviewTitle:Ee,reviewSubtitle:Re,reviewStatusIcon:We=e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",className:"lucide lucide-hourglass-icon lucide-hourglass",children:[i("path",{d:"M5 22h14"}),i("path",{d:"M5 2h14"}),i("path",{d:"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22"}),i("path",{d:"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2"})]}),reviewSteps:Le=[],showReviewProgress:ze=!1,showOriginalText:je=!1,originalText:Fe,originalTextHeader:De="Original text",hideSummaryText:Me=!1,hideSeverityChip:He=!1}){var _e,Oe,Ne,Pe,$e,Ve,Ue,qe,Ge,Je,Ke,Qe,Xe,Ye,Ze,ei,ii,ti,ni,oi;let li=Z.findIndex(e=>e===Q);-1===li&&(li=1);const[ri,di]=p(!0),[ai,si]=p(!1),[ci,pi]=p(!1),[gi,hi]=p(li),[ui]=p(li),[vi,mi]=p(!0),xi="review"===Ae,fi=Z[gi],yi=ee[fi]||"#BA7517",wi=gi!==ui,Si=[{id:"iterate",icon:re.iterateIcon||i(n,{size:16,color:"#64748B"}),label:Y.btnIterate||"Iterate",color:"#64748B",onClick:q},{id:"accept",icon:re.acceptIcon||i(o,{size:16,color:"#10B981"}),label:Y.btnAccept||"Approve",color:"#10B981",useLabel:!0},{id:"reject",icon:re.rejectIcon||i(l,{size:16,color:"#DC2626"}),label:Y.btnReject||"Reject",color:"#DC2626",useLabel:!0}],{redlineDcoumentId:bi,redlineConfig:ki,updateRedlineDataParent:Ci}=m(),Ii=async e=>{var i,t,n;null==U||U({status:"loading",action:e,metadata:{redlineId:Be,aiReasonId:Te}});try{const{updated_reqai:o}=await x({documentId:bi,userEmail:null==ki?void 0:ki.userEmail,userName:null==ki?void 0:ki.userName,redlineId:null!==(i=null==c?void 0:c.redline_id)&&void 0!==i?i:"",action:e,baseApiUrl:null==ki?void 0:ki.baseApiUrl,redlineConfigId:null!==(t=null==ki?void 0:ki.redlineConfigId)&&void 0!==t?t:""},null!==(n=null==ki?void 0:ki.token)&&void 0!==n?n:"");await(null==Ci?void 0:Ci(o)),null==U||U({status:"success",action:e,metadata:{redlineId:Be,aiReasonId:Te}})}catch(i){null==U||U({status:"failed",action:e,metadata:{redlineId:Be,aiReasonId:Te}})}},Bi=te||Si;return e("div",{onClick:e=>{e.stopPropagation()},style:{...C,...null===(_e=null==oe?void 0:oe.DeviationSummaryStyles)||void 0===_e?void 0:_e.root},children:[e("div",{style:{...I,...null===(Oe=null==oe?void 0:oe.DeviationSummaryStyles)||void 0===Oe?void 0:Oe.header,marginBottom:xi?14:ci?"16px":"12px",...xi&&{backgroundColor:"#F1F5F9",padding:"12px 16px",marginTop:"-16px",marginLeft:"-16px",marginRight:"-16px",borderTopLeftRadius:"8px",borderTopRightRadius:"8px",borderBottom:"1px solid #E2E8F0"}},children:[e("div",xi?{style:{minWidth:0,flex:"1 1 auto"},children:[e("div",{style:{display:"flex",alignItems:"center",gap:8,color:"#1E293B",fontSize:16,fontWeight:600,lineHeight:1.2},children:[i("span",{style:{display:"inline-flex",alignItems:"center",color:"#64748B"},children:We||re.summaryIcon||"⏳"}),i("span",{children:Ee||"Redline In Review"})]}),i("div",{style:{marginTop:6,paddingLeft:28,color:"#475569",fontSize:13,lineHeight:1.2,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:Re||(null===(Ne=null==c?void 0:c.redlining_details)||void 0===Ne?void 0:Ne.redline_title)})]}:{style:{display:"flex",alignItems:"center",gap:10},children:[e("div",{style:{display:"flex",alignItems:"center",gap:6},children:[i("span",{children:re.summaryIcon||i(r,{size:16,color:"#E24B4A"})}),i("span",{style:{...B,...null===(Pe=null==oe?void 0:oe.DeviationSummaryStyles)||void 0===Pe?void 0:Pe.title},children:Y.summaryHeader||"Summary"})]}),Ce&&Ce.length>0&&i(J,{users:Ce,onClick:e=>{e.stopPropagation(),null==Ie||Ie()}})]}),e("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[(ke||de||ae)&&i(G,{onAssignClick:ke,onOpenCognitive:de,cognitiveIconSmall:we,cognitiveTootipTitle:fe,historyIconSmall:se,onHistoryClick:ae,historyTootipTitle:ce}),i("button",{onClick:s,style:{...F,...null===($e=null==oe?void 0:oe.DeviationSummaryStyles)||void 0===$e?void 0:$e.closeBtn,color:"#64748B",fontSize:16},children:"✕"})]})]}),xi&&ze&&Le.length>0&&i(K,{steps:Le}),!Me&&!xi&&i(t,{children:i(v,{title:null===(Ve=null==c?void 0:c.redlining_details)||void 0===Ve?void 0:Ve.redline_title,children:i("p",{style:{...T,...null===(Ue=null==oe?void 0:oe.DeviationSummaryStyles)||void 0===Ue?void 0:Ue.bodyText},children:null===(qe=null==c?void 0:c.redlining_details)||void 0===qe?void 0:qe.redline_title})})}),i("p",{style:{...A,...null===(Ge=null==oe?void 0:oe.DeviationSummaryStyles)||void 0===Ge?void 0:Ge.summary},children:null===(Je=null==c?void 0:c.redlining_details)||void 0===Je?void 0:Je.redline_summary}),e("div",{style:{...E,...null===(Ke=null==oe?void 0:oe.DeviationSummaryStyles)||void 0===Ke?void 0:Ke.impactContainer},children:[e("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e("button",{onClick:()=>di(!ri),style:{...W,...null===(Qe=null==oe?void 0:oe.DeviationSummaryStyles)||void 0===Qe?void 0:Qe.impactToggle},children:[i("span",{style:{...L,...null===(Xe=null==oe?void 0:oe.DeviationSummaryStyles)||void 0===Xe?void 0:Xe.impactToggleLabel},children:Y.impactHeader||"Impact"}),i("span",{style:{fontSize:12,color:"#E24B4A",transition:"transform 0.2s",display:"flex",alignItems:"center",transform:ri?"rotate(180deg)":"rotate(0deg)"},children:i(d,{size:16,color:"#E24B4A"})})]}),i(S,{type:(null==c?void 0:c.severity)||"Medium",customStyles:le})]}),ri&&i(t,{children:i("div",{style:{...R,...null===(Ye=null==oe?void 0:oe.DeviationSummaryStyles)||void 0===Ye?void 0:Ye.impactText},children:i(f,{message:`${null!==(ei=null===(Ze=null==c?void 0:c.redlining_details)||void 0===Ze?void 0:Ze.redline_impact)&&void 0!==ei?ei:Y.fallbackImpact||"This change reduces compliance obligations and lowers contractual risk thresholds."} [View chat](chat_citation$all)`,customStyles:null===(ii=null==oe?void 0:oe.DeviationSummaryStyles)||void 0===ii?void 0:ii.impactMarkdown})})})]}),xi&&je&&e("div",{style:{borderTop:"1px solid #E2E8F0",paddingTop:14,marginBottom:20},children:[e("button",{onClick:()=>mi(e=>!e),style:{background:"none",border:"none",padding:0,width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",color:"#1E293B",fontSize:21,fontWeight:600},children:[i("span",{children:De}),i(d,{size:18,color:"#1E293B",style:{transform:vi?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s"}})]}),vi&&e("div",{style:{marginTop:10,border:"1px solid #CBD5E1",borderRadius:12,padding:"16px 20px",background:"#F8FAFC",color:"#475569",fontSize:20,lineHeight:1.7,fontStyle:"italic",boxShadow:"0 1px 2px rgba(15, 23, 42, 0.08)"},children:["“",Fe||"","”"]})]}),i("div",{style:{...z,...null===(ti=null==oe?void 0:oe.DeviationSummaryStyles)||void 0===ti?void 0:ti.actionContainer},children:Bi.map(i=>{var t,n;const o=ne||i.disabled,l=o?{cursor:"not-allowed",opacity:.5,...null===(t=null==oe?void 0:oe.DeviationSummaryStyles)||void 0===t?void 0:t.actionBtnDisabled,...i.disabledStyle}:{};return e("button",{style:{...j,...null===(n=null==oe?void 0:oe.DeviationSummaryStyles)||void 0===n?void 0:n.actionBtn,color:i.color,...i.style,...l},onClick:o?void 0:async()=>{if(i.onClick){return void(!0===await i.onClick()&&i.useLabel&&await Ii(i.id.toLowerCase()))}i.useLabel&&await Ii(i.id.toLowerCase())},disabled:o,children:[i.icon,i.label]},i.id)})}),pe&&e("div",{style:{...D,...null===(ni=null==oe?void 0:oe.DeviationSummaryStyles)||void 0===ni?void 0:ni.toneContainer},children:[e("button",{onClick:()=>si(!ai),style:{...M,...null===(oi=null==oe?void 0:oe.DeviationSummaryStyles)||void 0===oi?void 0:oi.toneToggleBtn},children:[e("div",{style:{display:"flex",alignItems:"center",gap:8},children:[i(w,{toneIndex:gi,configs:ie}),i("span",{style:{fontSize:13,fontWeight:500,color:"#111"},children:Y.toneHeader||"Redline Tone"})]}),i("span",{style:{transition:"transform 0.2s",display:"flex",alignItems:"center",transform:ai?"rotate(180deg)":"rotate(0deg)"},children:i(d,{size:16,color:"#111"})})]}),ai&&e(t,{children:[i("p",{style:{fontSize:12,color:"#888",margin:"0 0 12px"},children:Y.toneDescription||"Controls how assertively AI is redlining"}),i(g,{isDirty:wi,onToneChange:e=>{hi(e)},toneColor:yi,toneIndex:gi,onClickRegenerate:()=>null==X?void 0:X(fi),toneLabels:Z,isStreaming:be,aiReason:c})]})]}),de&&e("div",{className:null==me?void 0:me.section,onClick:e=>{e.stopPropagation(),de&&de(e)},style:{...H,...null==ve?void 0:ve.section,...ge},children:[e("div",{className:null==me?void 0:me.headerLeft,style:{..._,...null==ve?void 0:ve.headerLeft},children:[i("span",{className:null==me?void 0:me.titleIcon,style:{...O,...null==ve?void 0:ve.titleIcon},children:null!=ye?ye:i(h,{})}),i("div",{className:null==me?void 0:me.cognitiveTitle,style:{...N,...null==ve?void 0:ve.cognitiveTitle},children:xe})]}),e("div",{className:null==me?void 0:me.headerRight,style:{...P,...null==ve?void 0:ve.headerRight},children:[void 0!==(null==c?void 0:c.relevance_score)&&null!==(null==c?void 0:c.relevance_score)?e("span",{className:null==me?void 0:me.scoreBadge,style:{...$,...null==ve?void 0:ve.scoreBadge,...he},children:[i(u,{}),e("span",{className:null==me?void 0:me.scoreText,style:{...V,...null==ve?void 0:ve.scoreText,...ue},children:[Math.round(Number(c.relevance_score)),"%"]})]}):null,Se&&i("span",{style:{display:"flex",alignItems:"center"},children:i(a,{size:16,color:"#64748B"})})]})]})]})},(e,i)=>{var t,n,o,l;if(e.displayVariant!==i.displayVariant)return!1;if(e.reviewTitle!==i.reviewTitle)return!1;if(e.reviewSubtitle!==i.reviewSubtitle)return!1;if(e.showReviewProgress!==i.showReviewProgress)return!1;if(e.showOriginalText!==i.showOriginalText)return!1;if(e.originalText!==i.originalText)return!1;if(e.hideSummaryText!==i.hideSummaryText)return!1;if(e.hideSeverityChip!==i.hideSeverityChip)return!1;if((null!==(n=null===(t=e.reviewSteps)||void 0===t?void 0:t.length)&&void 0!==n?n:0)!==(null!==(l=null===(o=i.reviewSteps)||void 0===o?void 0:o.length)&&void 0!==l?l:0))return!1;if(e.reviewSteps&&i.reviewSteps){if(e.reviewSteps.map(e=>`${e.id}:${e.label}:${e.initials}:${e.status}`).join("|")!==i.reviewSteps.map(e=>`${e.id}:${e.label}:${e.initials}:${e.status}`).join("|"))return!1}return!0});export{q as AssignMenu,J as DisplayUsers,G as KebabMenu,Q as default};
2
2
  //# sourceMappingURL=DeviationSummary.js.map
@@ -0,0 +1,2 @@
1
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import{Lock as i,X as n}from"lucide-react";const r={popup:{width:400,background:"#fff",borderRadius:20,padding:20,boxShadow:"0 20px 60px rgba(0,0,0,0.18), 0 8px 20px rgba(0,0,0,0.08)",display:"flex",flexDirection:"column",alignItems:"center",gap:10},content:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:12,width:"100%"},icon:{width:40,height:40,borderRadius:"50%",background:"#FEF2F2",color:"#DC2626",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},message:{margin:0,color:"#6B7280",fontFamily:"Inter",fontSize:15,lineHeight:1.6,flex:1},cross:{alignSelf:"start",cursor:"pointer"}};function o({message:o,onClose:s}){return e("div",{style:r.popup,children:t("div",{style:r.content,children:[e("div",{style:r.icon,children:e(i,{size:15,strokeWidth:2.2})}),e("p",{style:r.message,children:o}),e("div",{style:r.cross,onClick:s,children:e(n,{size:20,strokeWidth:2.2})})]})})}export{o as default};
2
+ //# sourceMappingURL=EditBlockPopup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditBlockPopup.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- import{jsxs as e,jsx as i}from"react/jsx-runtime";import{UserPen as n,CheckCircle as l,XCircle as t}from"lucide-react";import{useRequirementAI as o}from"../../RequirementAIWrapper/RequirementAIWrapper.js";import{resolveRedline as d}from"../../../../../service/redlineService.js";function a({onClose:a,editorInfo:s,headerText:c,btnsConfig:u,labelText:p,onActionTrigger:v,aiReason:f=null}){var b,g;const{redlineDcoumentId:m,redlineConfig:y,updateRedlineDataParent:h}=o(),I=async e=>{var i,n,l;null==v||v({status:"loading",action:e,metadata:{redlineId:null==f?void 0:f.redline_id,aiReasonId:null==f?void 0:f.id}});try{const{updated_reqai:t}=await d({documentId:m,userEmail:null==y?void 0:y.userEmail,userName:null==y?void 0:y.userName,redlineId:null!==(i=null==f?void 0:f.redline_id)&&void 0!==i?i:"",action:e,baseApiUrl:null==y?void 0:y.baseApiUrl,redlineConfigId:null!==(n=null==y?void 0:y.redlineConfigId)&&void 0!==n?n:""},null!==(l=null==y?void 0:y.token)&&void 0!==l?l:"");await(null==h?void 0:h(t)),null==v||v({status:"success",action:e,metadata:{redlineId:null==f?void 0:f.redline_id,aiReasonId:null==f?void 0:f.id}})}catch(e){null==v||v({status:"failed",action:null,metadata:{redlineId:null==f?void 0:f.redline_id,aiReasonId:null==f?void 0:f.id}})}};return e("div",{style:r.popup,children:[e("div",{style:r.header,children:[i("span",{style:r.title,children:c||"Manually Edited"}),i("button",{onClick:a,style:r.closeButton,"aria-label":"Close",children:"✕"})]}),e("div",{style:r.content,children:[e("div",{style:r.labelRow,children:[i(n,{}),i("span",{style:r.label,children:p||"Edited By"})]}),i("div",{style:r.editorInfo,children:s}),i("div",{style:r.divider}),e("div",{style:r.actions,children:[null==u?void 0:u.map(i=>e("button",{style:{...r.actionBtn,...i.style||{}},onClick:e=>i.onClick(e,{redlineId:null==f?void 0:f.redline_id,id:null==f?void 0:f.id}),children:[i.icon," ",i.text]})),!("accepted"===(null===(b=null==f?void 0:f.redlining_details)||void 0===b?void 0:b.status)||"rejected"===(null===(g=null==f?void 0:f.redlining_details)||void 0===g?void 0:g.status))&&e("div",{style:r.resolveActions,children:[e("button",{style:{...r.actionBtn,...(null==f?void 0:f.resolving)?r.actionBtnDisabled:{}},disabled:null==f?void 0:f.resolving,onClick:()=>I("accept"),children:[i(l,{size:16,color:"#10B981"})," ","Adopt"]}),e("button",{style:{...r.actionBtn,...(null==f?void 0:f.resolving)?r.actionBtnDisabled:{}},onClick:()=>I("reject"),disabled:null==f?void 0:f.resolving,children:[i(t,{size:16,color:"#DC2626"})," ","Reject"]})]})]})]})]})}const r={popup:{width:400,background:"#fff",borderRadius:12,overflow:"hidden",boxShadow:"0 10px 30px rgba(0,0,0,0.15)",fontFamily:"Inter, sans-serif"},actionBtnDisabled:{opacity:.5,cursor:"not-allowed",pointerEvents:"none"},header:{background:"#dfe7f8",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"18px 14px"},title:{fontSize:14,fontWeight:600,color:"#313949"},closeButton:{border:"none",background:"transparent",cursor:"pointer",fontSize:14,color:"#616b7d"},content:{padding:"16px 22px"},labelRow:{display:"flex",alignItems:"center",gap:10,marginBottom:8},labelIcon:{fontSize:18},label:{fontSize:14,color:"#7b8495"},editorInfo:{fontSize:14,fontWeight:500,color:"#313949"},divider:{margin:"14px 0",height:1,background:"#e5e7eb"},actions:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:15},resolveActions:{display:"flex",justifyContent:"space-between",gap:15,alignItems:"center"},actionBtn:{border:"1px solid #d5dbe8",background:"#fff",borderRadius:10,padding:"8px",fontSize:14,cursor:"pointer",display:"flex",alignItems:"center",gap:10,color:"#596275"}};export{a as default};
1
+ import{jsxs as e,jsx as i}from"react/jsx-runtime";import{UserPen as n,CheckCircle as l,XCircle as t}from"lucide-react";import{useRequirementAI as o}from"../../RequirementAIWrapper/RequirementAIWrapper.js";import{resolveRedline as d}from"../../../../../service/redlineService.js";function a({onClose:a,editorInfo:s,headerText:c,btnsConfig:u,labelText:p,onActionTrigger:v,aiReason:f=null}){var b,g;const{redlineDcoumentId:m,redlineConfig:y,updateRedlineDataParent:h}=o(),I=async e=>{var i,n,l;null==v||v({status:"loading",action:e,metadata:{redlineId:null==f?void 0:f.redline_id,aiReasonId:null==f?void 0:f.id}});try{const{updated_reqai:t}=await d({documentId:m,userEmail:null==y?void 0:y.userEmail,userName:null==y?void 0:y.userName,redlineId:null!==(i=null==f?void 0:f.redline_id)&&void 0!==i?i:"",action:e,baseApiUrl:null==y?void 0:y.baseApiUrl,redlineConfigId:null!==(n=null==y?void 0:y.redlineConfigId)&&void 0!==n?n:""},null!==(l=null==y?void 0:y.token)&&void 0!==l?l:"");await(null==h?void 0:h(t)),null==v||v({status:"success",action:e,metadata:{redlineId:null==f?void 0:f.redline_id,aiReasonId:null==f?void 0:f.id}})}catch(i){null==v||v({status:"failed",action:e,metadata:{redlineId:null==f?void 0:f.redline_id,aiReasonId:null==f?void 0:f.id}})}};return e("div",{style:r.popup,children:[e("div",{style:r.header,children:[i("span",{style:r.title,children:c||"Manually Edited"}),i("button",{onClick:a,style:r.closeButton,"aria-label":"Close",children:"✕"})]}),e("div",{style:r.content,children:[e("div",{style:r.labelRow,children:[i(n,{}),i("span",{style:r.label,children:p||"Edited By"})]}),i("div",{style:r.editorInfo,children:s}),i("div",{style:r.divider}),e("div",{style:r.actions,children:[null==u?void 0:u.map(i=>e("button",{style:{...r.actionBtn,...i.style||{}},onClick:e=>i.onClick(e,{redlineId:null==f?void 0:f.redline_id,id:null==f?void 0:f.id}),children:[i.icon," ",i.text]})),!("accepted"===(null===(b=null==f?void 0:f.redlining_details)||void 0===b?void 0:b.status)||"rejected"===(null===(g=null==f?void 0:f.redlining_details)||void 0===g?void 0:g.status))&&e("div",{style:r.resolveActions,children:[e("button",{style:{...r.actionBtn,...(null==f?void 0:f.resolving)?r.actionBtnDisabled:{}},disabled:null==f?void 0:f.resolving,onClick:()=>I("accept"),children:[i(l,{size:16,color:"#10B981"})," ","Adopt"]}),e("button",{style:{...r.actionBtn,...(null==f?void 0:f.resolving)?r.actionBtnDisabled:{}},onClick:()=>I("reject"),disabled:null==f?void 0:f.resolving,children:[i(t,{size:16,color:"#DC2626"})," ","Reject"]})]})]})]})]})}const r={popup:{width:400,background:"#fff",borderRadius:12,overflow:"hidden",boxShadow:"0 10px 30px rgba(0,0,0,0.15)",fontFamily:"Inter, sans-serif"},actionBtnDisabled:{opacity:.5,cursor:"not-allowed",pointerEvents:"none"},header:{background:"#dfe7f8",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"18px 14px"},title:{fontSize:14,fontWeight:600,color:"#313949"},closeButton:{border:"none",background:"transparent",cursor:"pointer",fontSize:14,color:"#616b7d"},content:{padding:"16px 22px"},labelRow:{display:"flex",alignItems:"center",gap:10,marginBottom:8},labelIcon:{fontSize:18},label:{fontSize:14,color:"#7b8495"},editorInfo:{fontSize:14,fontWeight:500,color:"#313949"},divider:{margin:"14px 0",height:1,background:"#e5e7eb"},actions:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:15},resolveActions:{display:"flex",justifyContent:"space-between",gap:15,alignItems:"center"},actionBtn:{border:"1px solid #d5dbe8",background:"#fff",borderRadius:10,padding:"8px",fontSize:14,cursor:"pointer",display:"flex",alignItems:"center",gap:10,color:"#596275"}};export{a as default};
2
2
  //# sourceMappingURL=ManualEditPopup.js.map
@@ -1,2 +1,2 @@
1
- import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import{Undo2 as o}from"lucide-react";import{useState as n}from"react";import r from"./PopupDefaults.js";import{Tooltip as l}from"@mui/material";import{AiReasonMarkdownWrapper as a}from"../../ai-reasoning/AiReasonMarkdownWrapper.js";import{DisplayUsers as d}from"./DeviationSummary.js";import{resolveRedline as s}from"../../../../../service/redlineService.js";import{useRequirementAI as c}from"../../RequirementAIWrapper/RequirementAIWrapper.js";function h(e){const t=new Date(e);if(isNaN(t.getTime()))return e;return 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")}const u=()=>t("svg",{width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",children:[e("circle",{cx:"11",cy:"11",r:"10",stroke:"#22c55e",strokeWidth:"2",fill:"#f0fdf4"}),e("path",{d:"M6.5 11.5l3 3 6-6",stroke:"#22c55e",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),p=()=>t("svg",{width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",children:[e("circle",{cx:"11",cy:"11",r:"10",stroke:"#ef4444",strokeWidth:"2",fill:"#fff1f2"}),e("path",{d:"M7.5 7.5l7 7M14.5 7.5l-7 7",stroke:"#ef4444",strokeWidth:"2",strokeLinecap:"round"})]}),f=()=>e("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:e("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#94a3b8",strokeWidth:"1.8",strokeLinecap:"round"})}),k=()=>t("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[e("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),e("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"}),e("path",{d:"M11 8.5l1.5 1.5 2.5-2.5",stroke:"#22c55e",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]}),b=()=>t("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[e("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),e("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"}),e("path",{d:"M11.5 8l3 3m0-3l-3 3",stroke:"#ef4444",strokeWidth:"1.4",strokeLinecap:"round"})]}),g=({open:t})=>e("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",style:{transform:t?"rotate(0deg)":"rotate(180deg)",transition:"transform 0.25s ease"},children:e("path",{d:"M4.5 11.25L9 6.75l4.5 4.5",stroke:"#64748b",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})}),m=({color:i="#3b82f6"})=>t("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",children:[e("path",{d:"M1.5 8A6.5 6.5 0 1 0 4 3.2",stroke:i,strokeWidth:"1.5",strokeLinecap:"round"}),e("path",{d:"M1.5 3.5v4h4",stroke:i,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e("path",{d:"M8 5v3.5l2 1.5",stroke:i,strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]}),v=()=>t("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",children:[e("path",{d:"M13.5 8a5.5 5.5 0 1 0-1.6 3.9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round"}),e("path",{d:"M13.5 13v-4.5H9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),y=()=>t("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",children:[e("path",{d:"M2 8h12M10 4l4 4-4 4",stroke:"#64748b",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e("path",{d:"M4 5l-2 3 2 3",stroke:"#64748b",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]});function x({title:o,open:n,onToggle:r,children:l}){return t("div",{children:[t("div",{onClick:r,style:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",userSelect:"none",padding:"2px 0"},children:[e("span",{style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"},children:o}),e(g,{open:n})]}),e("div",{style:{maxHeight:n?100:0,opacity:n?1:0,transition:"max-height 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.25s"},children:n&&e(i,{children:l})})]})}function C({icon:e,label:i,onClick:o,customStyle:n={},disabled:r=!1,disabledStyle:l={}}){const a={display:"flex",alignItems:"center",gap:10,padding:"8px",background:"#f8fafc",border:"1.5px solid #e2e8f0",borderRadius:10,cursor:r?"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:r?.5:1,...n,...r?l:{}};return t("button",{onClick:r?void 0:o,disabled:r,style:a,onMouseEnter:e=>{r||(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:e=>{r||(e.currentTarget.style.background="#f8fafc",e.currentTarget.style.transform="",e.currentTarget.style.boxShadow="")},children:[e,i]})}function B({status:i,onClose:g,impactText:B,secondText:w,actionTakenByName:L,actionTakenAtTime:I="NA",onHistory:R,onIterate:S,onActionTrigger:W,disableAllActions:T=!1,impactTitle:M="Impact",customConfigs:D={},customStyles:j={},secondaryTitle:A,onAssignClick:z,onReviewUsersClick:N,assignedUsers:U,redlineId:E,aiReasonId:H}){const[F,P]=n(!0),[O,$]=n(!0),[q,_]=n(!1);n(!1);const{redlineDcoumentId:V,redlineConfig:Y,updateRedlineDataParent:G}=c(),J={headerBg:"#f0fdf4",headerBorder:"#dcfce7",titleColor:"#166534",label:"Redline Approved",metaLabel:"Approved By",UserIcon:e(k,{}),StatusIcon:e(u,{}),secondTitle:"Original text",secondBg:"#f8fafc",secondBorder:"#e2e8f0",impactBox:!0,actions:[{icon:e(m,{}),label:"History",onClick:R},{icon:e(o,{size:17}),label:"Revert",useLabel:!0},{icon:e(y,{}),label:"Iterate",onClick:S}],fallbackText:"No original text available"},K={headerBg:"#fff1f2",headerBorder:"#fecdd3",titleColor:"#991b1b",label:"Redline Rejected",metaLabel:"Rejected By",UserIcon:e(b,{}),StatusIcon:e(p,{}),secondTitle:"Rejected Recommendation",secondBg:"#f8fafc",secondBorder:"#e2e8f0",impactBox:!1,actions:[{icon:e(m,{color:"#3b82f6"}),label:"History",onClick:R},{icon:e(v,{}),label:"Reinstate",useLabel:!0},{icon:e(y,{}),label:"Iterate",onClick:S}],fallbackText:"No rejected recommendation available"},Q={headerBg:"#E2E8F0",headerBorder:"none",titleColor:"#1E293B",label:"Redline Reverted",metaLabel:"Reverted By",UserIcon:e(k,{}),StatusIcon:e(o,{size:17}),secondTitle:"Reverted redline",secondBg:"#F9FAFB",secondBorder:"#D0D5DD",impactBox:!1,actions:[{icon:e(m,{}),label:"History",onClick:R},{icon:e(y,{}),label:"Iterate",onClick:S}],fallbackText:"No reverted redline available"};let X;X="accepted"===i?J:"rejected"===i?K:Q;const Z={...X,...D[i]||{}};return t("div",{style:{...r.RedlineCardDefaults.root,animation:q?"slideOut 0.26s cubic-bezier(0.4,0,1,1) forwards":r.RedlineCardDefaults.root.animation,...j.root},children:[t("div",{style:{...r.RedlineCardDefaults.header,background:Z.headerBg,borderBottom:`1.5px solid ${Z.headerBorder}`,...j.header},children:[t("div",{style:{display:"flex",alignItems:"center",gap:10},children:[e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:Z.StatusIcon}),t("div",{children:[e("span",{style:{fontSize:15,fontWeight:700,color:Z.titleColor,letterSpacing:"-0.01em"},children:Z.label}),e(l,{title:A,children:e("span",{style:{display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical",overflow:"hidden",fontSize:12,color:"gray"},children:A})})]}),U&&U.length>0&&e(d,{users:U,onClick:e=>{e.stopPropagation(),null==N||N()}})]}),e("button",{onClick:()=>{_(!0),g()},style:{background:"none",border:"none",cursor:"pointer",padding:4,borderRadius:6,display:"flex",alignItems:"center"},children:e(f,{})})]}),t("div",{style:{...r.RedlineCardDefaults.body,...j.body},children:[t("div",{style:{...r.RedlineCardDefaults.meta,...j.meta},children:[t("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:5},children:[Z.UserIcon,e("span",{style:{fontSize:12.5,color:"#94a3b8",fontWeight:500},children:Z.metaLabel})]}),t("div",{style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"},children:[e(l,{title:L,children:e("span",{style:{display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical",overflow:"hidden"},children:L})}),e("span",{children:h(I)})]})]}),e("div",{style:{...r.RedlineCardDefaults.divider,...j.divider}}),e(x,{title:M,open:F,onToggle:()=>P(e=>!e),children:e("div",{style:{...r.RedlineCardDefaults.impactText,...j.impactText},children:e(a,{message:`${B||""} [View chat](chat_citation$all)`,customStyles:j.impactMarkdown})})}),e("div",{style:{...r.RedlineCardDefaults.divider,...j.divider}}),e(x,{title:Z.secondTitle,open:O,onToggle:()=>$(e=>!e),children:w?e("div",{style:{...r.RedlineCardDefaults.secondSection,background:Z.secondBg,border:`1.5px solid ${Z.secondBorder}`,...j.secondSection},children:w}):t("div",{style:{...r.RedlineCardDefaults.fallbackSectionStyle,...j.fallbackSectionStyle},children:[Z.fallbackText," "]})}),e("div",{style:{...r.RedlineCardDefaults.actionsContainer,...j.actionsContainer},children:Z.actions.map(t=>e(C,{icon:t.icon,label:t.label,onClick:()=>{var e;t.useLabel?(async e=>{var t,i;null==W||W({status:"loading",action:e,metadata:{redlineId:E,aiReasonId:H}});try{const{updated_reqai:o}=await s({documentId:V,userEmail:null==Y?void 0:Y.userEmail,userName:null==Y?void 0:Y.userName,redlineId:null!=E?E:"",action:e,baseApiUrl:null==Y?void 0:Y.baseApiUrl,redlineConfigId:null!==(t=null==Y?void 0:Y.redlineConfigId)&&void 0!==t?t:""},null!==(i=null==Y?void 0:Y.token)&&void 0!==i?i:"");await(null==G?void 0:G(o)),null==W||W({status:"success",action:e,metadata:{redlineId:E,aiReasonId:H}})}catch(e){null==W||W({status:"failed",action:null,metadata:{redlineId:E,aiReasonId:H}})}})(t.label.toLowerCase()):null===(e=t.onClick)||void 0===e||e.call(t)},customStyle:{...t.style,...j.actionBtn},disabled:T||t.disabled,disabledStyle:j.actionBtnDisabled},t.label))})]})]})}export{u as ApprovedIcon,g as ChevronIcon,f as CloseIcon,m as HistoryIcon,y as IterateIcon,B as RedlineCard,v as ReinstateIcon,p as RejectedIcon,k as UserApprovedIcon,b as UserRejectedIcon,h as formatDate};
1
+ import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import{Undo2 as o}from"lucide-react";import{useState as n}from"react";import r from"./PopupDefaults.js";import{Tooltip as l}from"@mui/material";import{AiReasonMarkdownWrapper as a}from"../../ai-reasoning/AiReasonMarkdownWrapper.js";import{DisplayUsers as d,KebabMenu as s}from"./DeviationSummary.js";import{resolveRedline as c}from"../../../../../service/redlineService.js";import{useRequirementAI as h}from"../../RequirementAIWrapper/RequirementAIWrapper.js";function p(e){const t=new Date(e);if(isNaN(t.getTime()))return e;return 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")}const u=()=>t("svg",{width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",children:[e("circle",{cx:"11",cy:"11",r:"10",stroke:"#22c55e",strokeWidth:"2",fill:"#f0fdf4"}),e("path",{d:"M6.5 11.5l3 3 6-6",stroke:"#22c55e",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),f=()=>t("svg",{width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",children:[e("circle",{cx:"11",cy:"11",r:"10",stroke:"#ef4444",strokeWidth:"2",fill:"#fff1f2"}),e("path",{d:"M7.5 7.5l7 7M14.5 7.5l-7 7",stroke:"#ef4444",strokeWidth:"2",strokeLinecap:"round"})]}),g=()=>e("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:e("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#94a3b8",strokeWidth:"1.8",strokeLinecap:"round"})}),k=()=>t("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[e("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),e("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"}),e("path",{d:"M11 8.5l1.5 1.5 2.5-2.5",stroke:"#22c55e",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]}),m=()=>t("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[e("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),e("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"}),e("path",{d:"M11.5 8l3 3m0-3l-3 3",stroke:"#ef4444",strokeWidth:"1.4",strokeLinecap:"round"})]}),b=({open:t})=>e("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",style:{transform:t?"rotate(0deg)":"rotate(180deg)",transition:"transform 0.25s ease"},children:e("path",{d:"M4.5 11.25L9 6.75l4.5 4.5",stroke:"#64748b",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})}),v=({color:i="#3b82f6"})=>t("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",children:[e("path",{d:"M1.5 8A6.5 6.5 0 1 0 4 3.2",stroke:i,strokeWidth:"1.5",strokeLinecap:"round"}),e("path",{d:"M1.5 3.5v4h4",stroke:i,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e("path",{d:"M8 5v3.5l2 1.5",stroke:i,strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]}),y=()=>t("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",children:[e("path",{d:"M13.5 8a5.5 5.5 0 1 0-1.6 3.9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round"}),e("path",{d:"M13.5 13v-4.5H9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),x=()=>t("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",children:[e("path",{d:"M2 8h12M10 4l4 4-4 4",stroke:"#64748b",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e("path",{d:"M4 5l-2 3 2 3",stroke:"#64748b",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]});function C({title:o,open:n,onToggle:r,children:l}){return t("div",{children:[t("div",{onClick:r,style:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",userSelect:"none",padding:"2px 0"},children:[e("span",{style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"},children:o}),e(b,{open:n})]}),e("div",{style:{maxHeight:n?100:0,opacity:n?1:0,transition:"max-height 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.25s"},children:n&&e(i,{children:l})})]})}function B({icon:e,label:i,onClick:o,customStyle:n={},disabled:r=!1,disabledStyle:l={}}){const a={display:"flex",alignItems:"center",gap:10,padding:"8px",background:"#f8fafc",border:"1.5px solid #e2e8f0",borderRadius:10,cursor:r?"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:r?.5:1,...n,...r?l:{}};return t("button",{onClick:r?void 0:o,disabled:r,style:a,onMouseEnter:e=>{r||(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:e=>{r||(e.currentTarget.style.background="#f8fafc",e.currentTarget.style.transform="",e.currentTarget.style.boxShadow="")},children:[e,i]})}function w({status:i,onClose:b,impactText:w,secondText:I,actionTakenByName:L,actionTakenAtTime:S="NA",onHistory:T,onIterate:R,onActionTrigger:W,disableAllActions:M=!1,impactTitle:D="Impact",customConfigs:j={},customStyles:A={},secondaryTitle:z,onAssignClick:N,onReviewUsersClick:U,assignedUsers:H,redlineId:E,aiReasonId:O,cognitiveIconSmall:F,cognitiveTootipTitle:P="Cognitive Decisioning",historyIconSmall:$,onHistoryClick:q,historyTootipTitle:_,onOpenCognitive:V}){const[Y,G]=n(!0),[J,K]=n(!0),[Q,X]=n(!1);n(!1);const{redlineDcoumentId:Z,redlineConfig:ee,updateRedlineDataParent:te}=h(),ie={headerBg:"#f0fdf4",headerBorder:"#dcfce7",titleColor:"#166534",label:"Redline Approved",metaLabel:"Approved By",UserIcon:e(k,{}),StatusIcon:e(u,{}),secondTitle:"Original text",secondBg:"#f8fafc",secondBorder:"#e2e8f0",impactBox:!0,actions:[{icon:e(v,{}),label:"History",onClick:T},{icon:e(o,{size:17}),label:"Revert",useLabel:!0},{icon:e(x,{}),label:"Iterate",onClick:R}],fallbackText:"No original text available"},oe={headerBg:"#fff1f2",headerBorder:"#fecdd3",titleColor:"#991b1b",label:"Redline Rejected",metaLabel:"Rejected By",UserIcon:e(m,{}),StatusIcon:e(f,{}),secondTitle:"Rejected Recommendation",secondBg:"#f8fafc",secondBorder:"#e2e8f0",impactBox:!1,actions:[{icon:e(v,{color:"#3b82f6"}),label:"History",onClick:T},{icon:e(y,{}),label:"Reinstate",useLabel:!0},{icon:e(x,{}),label:"Iterate",onClick:R}],fallbackText:"No rejected recommendation available"},ne={headerBg:"#E2E8F0",headerBorder:"none",titleColor:"#1E293B",label:"Redline Reverted",metaLabel:"Reverted By",UserIcon:e(k,{}),StatusIcon:e(o,{size:17}),secondTitle:"Reverted redline",secondBg:"#F9FAFB",secondBorder:"#D0D5DD",impactBox:!1,actions:[{icon:e(v,{}),label:"History",onClick:T},{icon:e(x,{}),label:"Iterate",onClick:R}],fallbackText:"No reverted redline available"};let re;re="accepted"===i?ie:"rejected"===i?oe:ne;const le={...re,...j[i]||{}};return t("div",{style:{...r.RedlineCardDefaults.root,animation:Q?"slideOut 0.26s cubic-bezier(0.4,0,1,1) forwards":r.RedlineCardDefaults.root.animation,...A.root},children:[t("div",{style:{...r.RedlineCardDefaults.header,background:le.headerBg,borderBottom:`1.5px solid ${le.headerBorder}`,...A.header},children:[t("div",{style:{display:"flex",alignItems:"center",gap:10},children:[e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:le.StatusIcon}),t("div",{children:[e("span",{style:{fontSize:15,fontWeight:700,color:le.titleColor,letterSpacing:"-0.01em"},children:le.label}),e(l,{title:z,children:e("span",{style:{display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical",overflow:"hidden",fontSize:12,color:"gray"},children:z})})]}),H&&H.length>0&&e(d,{users:H,onClick:e=>{e.stopPropagation(),null==U||U()}})]}),t("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[(N||V||q)&&e(s,{onAssignClick:N,onOpenCognitive:V,cognitiveIconSmall:F,cognitiveTootipTitle:P,historyIconSmall:$,onHistoryClick:q,historyTootipTitle:_}),e("button",{onClick:()=>{X(!0),b()},style:{background:"none",border:"none",cursor:"pointer",padding:4,borderRadius:6,display:"flex",alignItems:"center"},children:e(g,{})})]})]}),t("div",{style:{...r.RedlineCardDefaults.body,...A.body},children:[t("div",{style:{...r.RedlineCardDefaults.meta,...A.meta},children:[t("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:5},children:[le.UserIcon,e("span",{style:{fontSize:12.5,color:"#94a3b8",fontWeight:500},children:le.metaLabel})]}),t("div",{style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"},children:[e(l,{title:L,children:e("span",{style:{display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical",overflow:"hidden"},children:L})}),e("span",{children:p(S)})]})]}),e("div",{style:{...r.RedlineCardDefaults.divider,...A.divider}}),e(C,{title:D,open:Y,onToggle:()=>G(e=>!e),children:e("div",{style:{...r.RedlineCardDefaults.impactText,...A.impactText},children:e(a,{message:`${w||""} [View chat](chat_citation$all)`,customStyles:A.impactMarkdown})})}),e("div",{style:{...r.RedlineCardDefaults.divider,...A.divider}}),e(C,{title:le.secondTitle,open:J,onToggle:()=>K(e=>!e),children:I?e("div",{style:{...r.RedlineCardDefaults.secondSection,background:le.secondBg,border:`1.5px solid ${le.secondBorder}`,...A.secondSection},children:I}):t("div",{style:{...r.RedlineCardDefaults.fallbackSectionStyle,...A.fallbackSectionStyle},children:[le.fallbackText," "]})}),e("div",{style:{...r.RedlineCardDefaults.actionsContainer,...A.actionsContainer},children:le.actions.map(t=>e(B,{icon:t.icon,label:t.label,onClick:()=>{var e;t.useLabel?(async e=>{var t,i;null==W||W({status:"loading",action:e,metadata:{redlineId:E,aiReasonId:O}});try{const{updated_reqai:o}=await c({documentId:Z,userEmail:null==ee?void 0:ee.userEmail,userName:null==ee?void 0:ee.userName,redlineId:null!=E?E:"",action:e,baseApiUrl:null==ee?void 0:ee.baseApiUrl,redlineConfigId:null!==(t=null==ee?void 0:ee.redlineConfigId)&&void 0!==t?t:""},null!==(i=null==ee?void 0:ee.token)&&void 0!==i?i:"");await(null==te?void 0:te(o)),null==W||W({status:"success",action:e,metadata:{redlineId:E,aiReasonId:O}})}catch(t){null==W||W({status:"failed",action:e,metadata:{redlineId:E,aiReasonId:O}})}})(t.label.toLowerCase()):null===(e=t.onClick)||void 0===e||e.call(t)},customStyle:{...t.style,...A.actionBtn},disabled:M||t.disabled,disabledStyle:A.actionBtnDisabled},t.label))})]})]})}export{u as ApprovedIcon,b as ChevronIcon,g as CloseIcon,v as HistoryIcon,x as IterateIcon,w as RedlineCard,y as ReinstateIcon,f as RejectedIcon,k as UserApprovedIcon,m as UserRejectedIcon,p as formatDate};
2
2
  //# sourceMappingURL=RedlineStatusCard.js.map