@e-llm-studio/requirement-ai 0.0.176 → 0.0.179
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.
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CitationComponent.module.css.js +2 -0
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CitationComponent.module.css.js.map +1 -0
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.js +1 -1
- package/dist/cjs/features/RequirementAI/components/segment/Segment.js +1 -1
- package/dist/cjs/features/RequirementAI/components/segment/SegmentWrapper.js +1 -1
- package/dist/cjs/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CitationComponent.module.css.js +2 -0
- package/dist/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CitationComponent.module.css.js.map +1 -0
- package/dist/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.js +1 -1
- package/dist/features/RequirementAI/components/segment/Segment.js +1 -1
- package/dist/features/RequirementAI/components/segment/SegmentWrapper.js +1 -1
- package/dist/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.d.ts +14 -2
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.d.ts +28 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.d.ts +18 -2
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/segment/Segment.d.ts +0 -1
- package/dist/types/src/features/RequirementAI/components/segment/Segment.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/segment/SegmentWrapper.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.d.ts +3 -1
- package/dist/types/src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const t=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;t&&e.setAttribute("nonce",t),e.appendChild(document.createTextNode('.CitationComponent-module_cite-acc__2XusN{background:#fff;border:1px solid #eaecf0;border-radius:12px;box-sizing:border-box;container-type:inline-size;max-height:500px;overflow:auto;width:400px}.CitationComponent-module_cite-acc__header__Ek-ou{align-items:center;border-bottom:1px solid #eaecf0;border-top:1px solid #eaecf0;display:flex;flex-wrap:nowrap;gap:12px;justify-content:space-between;min-width:0;padding:12px}.CitationComponent-module_cite-acc__headerLeft__K6ItR{align-items:center;display:flex;flex:1 1 auto;gap:4px;min-width:0;overflow:hidden}.CitationComponent-module_cite-acc__titleIcon__ssoL-{align-items:center;display:inline-flex;flex:0 0 28px;height:28px;justify-content:center;width:28px}.CitationComponent-module_cite-acc__title__3ibjn{color:#101828;font-size:14px;font-weight:500;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.CitationComponent-module_cite-acc__headerRight__OhMqH{align-items:center;display:flex;flex:0 0 auto;flex-wrap:nowrap;gap:10px;min-width:0}.CitationComponent-module_cite-acc__gapBadge__VkuKQ{background:#fef3f2;border-radius:999px;color:#b42318;font-size:12px;font-weight:500;padding:4px 10px;white-space:nowrap}.CitationComponent-module_cite-acc__scoreBadge__uVDRv{align-items:center;border:1px solid var(--Primitive-Gray-300,#d0d5dd);border-radius:var(--chip-border-radius,16px);display:flex;gap:4px;padding:4px 8px}.CitationComponent-module_cite-acc__scoreIcon__-MUli{display:none}.CitationComponent-module_cite-acc__scoreText__42VsL{color:var(--Primitive-Purple-600,#6938ef);font-family:Inter;font-size:12px;font-style:normal;font-weight:500;line-height:150%}.CitationComponent-module_cite-acc__gapBadge__VkuKQ,.CitationComponent-module_cite-acc__scoreBadge__uVDRv{flex:0 1 auto;min-width:0}.CitationComponent-module_cite-acc__toggleBtn__RcZmg{align-items:center;background:#0000;border:none;cursor:pointer;display:inline-flex;flex:0 0 auto;justify-content:center;padding:4px}.CitationComponent-module_cite-acc__toggleBtn__RcZmg i{color:#667085;font-size:18px}.CitationComponent-module_cite-acc__body__YQDAm{display:flex;flex-direction:column;gap:12px;min-width:0;padding:20px}.CitationComponent-module_cite-acc__explain-body__1v7hb{display:flex;flex-direction:column;gap:"14px";min-width:0;padding:15px}.CitationComponent-module_cite-acc__explain-body_border__QQnDb{border-top:1px solid #eaecf0}.CitationComponent-module_cite-acc__innerHeader__BFwFr{align-items:center;background:#0000;display:flex;gap:12px;justify-content:space-between;min-width:0}.CitationComponent-module_cite-acc__backHeader__aFHVT{align-items:center;border-bottom:.5px solid #e8e7e3;display:flex;gap:8px;padding:14px 16px}.CitationComponent-module_cite-acc__backBtn__d91ol{background:none;border:none;color:#888;cursor:pointer;font-size:20px;line-height:1;padding:0}.CitationComponent-module_cite-acc__backTitle__Jwdr9{color:#1a1a1a;font-size:14px;font-weight:500}.CitationComponent-module_cite-acc__cognitiveSection__eVNry{align-items:center;border-bottom:none;border-top:1px solid #eee;cursor:pointer;display:flex;justify-content:space-between;padding-left:12px;padding-right:12px;padding-top:12px}.CitationComponent-module_cite-acc__cognitiveTitle__LXmhU{color:#101828;font-size:13px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.CitationComponent-module_cite-acc__innerHeaderLeft__uY1Et{align-items:flex-start;display:flex;flex:1 1 auto;gap:10px;min-width:0}.CitationComponent-module_cite-acc__innerIcon__UvlXX{align-items:center;background:#f4f3ff;border-radius:999px;display:inline-flex;flex:0 0 28px;height:28px;justify-content:center;width:28px}.CitationComponent-module_cite-acc__innerTitle__Lv8vo{color:#101828;font-size:14px;font-weight:500;line-height:22px}.CitationComponent-module_cite-acc__innerSub__XG7ad{color:#101828;font-size:12px;line-height:18px;margin-top:2px}.CitationComponent-module_cite-acc__innerToggle__3YHI5{align-items:center;background:#fff;border:1px solid #eaecf0;border-radius:999px;cursor:pointer;display:inline-flex;flex:0 0 28px;height:28px;justify-content:center;width:28px}.CitationComponent-module_cite-acc__innerToggle__3YHI5 i{color:#667085;font-size:18px}.CitationComponent-module_cite-acc__innerBody__Bzkt4{border-top:none;min-width:0;overflow-wrap:anywhere;word-break:break-word}.CitationComponent-module_cite-text__mark__Xh6wV{background-color:#fef3c7;border-radius:4px;padding-left:4px;padding-right:4px}.CitationComponent-module_cite-text__a__9HVV6{display:inline}.CitationComponent-module_cite-text__a-btn__9XyA1{color:#7a5af8;cursor:pointer;display:inline;font-weight:500}.CitationComponent-module_cite-text__a-btn_chevron__DXtkI,.CitationComponent-module_cite-text__a-btn_circle__SI-j3{display:inline-block;margin-left:4px;vertical-align:middle}.CitationComponent-module_cite-text__a-btn_open__2NfoX{border:1px solid #7a5af8;border-radius:4px;padding-left:4px;padding-right:4px}.CitationComponent-module_cite-text__a-btn_circle__SI-j3{animation:CitationComponent-module_spin__W-F7a 1.5s linear infinite;color:#7a5af8;height:16px;margin-left:auto;margin-right:auto;width:16px}.CitationComponent-module_cite-text__a-btn_chevron__DXtkI{height:16px;width:16px}.CitationComponent-module_cite-text__a-container__G-ier{margin-bottom:8px;margin-top:8px;max-height:250px;overflow:scroll}.CitationComponent-module_cite-text__a-container-docs__n8qlA{margin-bottom:8px;margin-top:8px;max-height:620px;overflow:scroll}.CitationComponent-module_cite-text__a-container-loader__f0Exm{animation:CitationComponent-module_spin__W-F7a 1.5s linear infinite;color:#000;height:32px;margin-left:auto;margin-right:auto;width:32px}.CitationComponent-module_md-ol__TO-dB{list-style:decimal;list-style-position:outside;padding-left:20px}.CitationComponent-module_md-ul__LfZPA{list-style:disc;list-style-position:outside;margin:10px 0 12px;padding-left:20px}.CitationComponent-module_md-li__ZEscN{margin:6px 0}.CitationComponent-module_cite-acc__btn-container__RUjvL{align-items:center;display:flex;font-family:Inter;font-size:14px;font-style:normal;font-weight:500;gap:5px;line-height:normal;padding:0 30px 15px;.CitationComponent-module_btn-accept__F5s10{border:1px solid #8098f9;border-radius:6px;color:#444ce7;padding:7px 10.5px}.CitationComponent-module_btn-reject__ziZa-{border:1px solid #fecaca;border-radius:6px;color:#ef4444;padding:7px 10.5px}}@keyframes CitationComponent-module_spin__W-F7a{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@container (max-width: 420px){.CitationComponent-module_cite-acc__scoreIcon__-MUli{align-items:center;display:inline-flex}.CitationComponent-module_cite-acc__scoreBadge__uVDRv{gap:6px;padding:6px 8px}.CitationComponent-module_cite-acc__gapBadge__VkuKQ{padding:4px 8px}}'));const o=document.head||document.getElementsByTagName("head")[0]||document.documentElement;o&&o.appendChild(e)}(),exports.default={"cite-acc":"CitationComponent-module_cite-acc__2XusN","cite-acc__header":"CitationComponent-module_cite-acc__header__Ek-ou","cite-acc__headerLeft":"CitationComponent-module_cite-acc__headerLeft__K6ItR","cite-acc__titleIcon":"CitationComponent-module_cite-acc__titleIcon__ssoL-","cite-acc__title":"CitationComponent-module_cite-acc__title__3ibjn","cite-acc__headerRight":"CitationComponent-module_cite-acc__headerRight__OhMqH","cite-acc__gapBadge":"CitationComponent-module_cite-acc__gapBadge__VkuKQ","cite-acc__scoreBadge":"CitationComponent-module_cite-acc__scoreBadge__uVDRv","cite-acc__scoreIcon":"CitationComponent-module_cite-acc__scoreIcon__-MUli","cite-acc__scoreText":"CitationComponent-module_cite-acc__scoreText__42VsL","cite-acc__toggleBtn":"CitationComponent-module_cite-acc__toggleBtn__RcZmg","cite-acc__body":"CitationComponent-module_cite-acc__body__YQDAm","cite-acc__explain-body":"CitationComponent-module_cite-acc__explain-body__1v7hb","cite-acc__explain-body_border":"CitationComponent-module_cite-acc__explain-body_border__QQnDb","cite-acc__innerHeader":"CitationComponent-module_cite-acc__innerHeader__BFwFr","cite-acc__backHeader":"CitationComponent-module_cite-acc__backHeader__aFHVT","cite-acc__backBtn":"CitationComponent-module_cite-acc__backBtn__d91ol","cite-acc__backTitle":"CitationComponent-module_cite-acc__backTitle__Jwdr9","cite-acc__cognitiveSection":"CitationComponent-module_cite-acc__cognitiveSection__eVNry","cite-acc__cognitiveTitle":"CitationComponent-module_cite-acc__cognitiveTitle__LXmhU","cite-acc__innerHeaderLeft":"CitationComponent-module_cite-acc__innerHeaderLeft__uY1Et","cite-acc__innerIcon":"CitationComponent-module_cite-acc__innerIcon__UvlXX","cite-acc__innerTitle":"CitationComponent-module_cite-acc__innerTitle__Lv8vo","cite-acc__innerSub":"CitationComponent-module_cite-acc__innerSub__XG7ad","cite-acc__innerToggle":"CitationComponent-module_cite-acc__innerToggle__3YHI5","cite-acc__innerBody":"CitationComponent-module_cite-acc__innerBody__Bzkt4","cite-text__mark":"CitationComponent-module_cite-text__mark__Xh6wV","cite-text__a":"CitationComponent-module_cite-text__a__9HVV6","cite-text__a-btn":"CitationComponent-module_cite-text__a-btn__9XyA1","cite-text__a-btn_circle":"CitationComponent-module_cite-text__a-btn_circle__SI-j3","cite-text__a-btn_chevron":"CitationComponent-module_cite-text__a-btn_chevron__DXtkI","cite-text__a-btn_open":"CitationComponent-module_cite-text__a-btn_open__2NfoX",spin:"CitationComponent-module_spin__W-F7a","cite-text__a-container":"CitationComponent-module_cite-text__a-container__G-ier","cite-text__a-container-docs":"CitationComponent-module_cite-text__a-container-docs__n8qlA","cite-text__a-container-loader":"CitationComponent-module_cite-text__a-container-loader__f0Exm","md-ol":"CitationComponent-module_md-ol__TO-dB","md-ul":"CitationComponent-module_md-ul__LfZPA","md-li":"CitationComponent-module_md-li__ZEscN","cite-acc__btn-container":"CitationComponent-module_cite-acc__btn-container__RUjvL","btn-accept":"CitationComponent-module_btn-accept__F5s10","btn-reject":"CitationComponent-module_btn-reject__ziZa-"};
|
|
2
|
+
//# sourceMappingURL=CitationComponent.module.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CitationComponent.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),a=require("react/jsx-runtime"),i=require("react"),s=require("../Popups/PopupDefaults.js"),n=require("react-markdown"),c=require("rehype-raw"),t=require("./CitationComponent.module.css.js"),l=require("lucide-react"),d=require("../icons/cognitiveBrain.svg.js"),r=require("../icons/aiMagic.svg.js"),o=require("./CitationAnchor.js");function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=_(i),x=_(n),f=_(c),m=function(i){var s=i.text,n=i.item;return a.jsx(x.default,e.__assign({rehypePlugins:[f.default],components:{ol:function(i){var s=i.children;return a.jsx("ol",e.__assign({className:t.default["md-ol"]},{children:s}))},ul:function(i){var s=i.children;return a.jsx("ul",e.__assign({className:t.default["md-ul"]},{children:s}))},li:function(i){var s=i.children;return a.jsx("li",e.__assign({className:t.default["md-li"]},{children:s}))},a:function(e){e.node;var i=e.href,s=e.children;return a.jsx(o.default,{href:i,children:s,metaData:{citations:n.citations,docData:n.docData}})}}},{children:s.replace(/<br\s*\/?>/gi,"\n")}))};exports.default=function(n){var c=n.item,o=n.title,_=void 0===o?"Cognitive Decisioning AI":o,x=n.relevanceScore,f=void 0===x?0:x,g=n.showRelevanceScore,v=void 0===g||g,h=n.reason,j=void 0===h?"No reasoning provided.":h,p=n.impact,N=void 0===p?"No Impact provided.":p,y=n.explaination,b=void 0===y?"No explaination provided.":y,C=n.gap,k=void 0===C?"None":C,H=n.onClose,B=void 0===H?function(){}:H,q=n.onAccept,D=n.onReject,T=n.showResolveBtns,A=void 0!==T&&T,I=n.sections,L=n.leftIcon,M=n.scoreIcon,P=n.className,R=n.customStyles,w=void 0===R?{}:R,E=n.onBackClick,F=n.isImpactNeeded,G=void 0===F||F,S=n.cognitiveTitle,U=void 0===S?"Cognitive Integrity":S,O=n.labels,z=void 0===O?{}:O,J=i.useMemo(function(){var e=Number(f);return Number.isNaN(e)?0:Math.max(0,Math.min(100,Math.round(e)))},[f]),K=i.useMemo(function(){var e=z&&z.noGapsText||"1. No gaps identified.";return function(e){if(!e)return!0;var a=e.trim().toLowerCase();return"none"===a||"no gap"===a||"no gaps"===a||"n/a"===a}(k)?e:k},[k]),Q=z&&z.impact||"Impact",V=z&&z.explanation||"Explaination",W=z&&z.decisionFactors||"Decision Making Factors",X=z&&z.gaps||"Gaps in Decision",Y=z&&z.accept||"Accept",Z=z&&z.reject||"Reject",$=z&&z.backAriaLabel||"Go back";return a.jsxs("div",e.__assign({className:"".concat(t.default["cite-acc"]," ").concat(P||""),style:e.__assign(e.__assign({},s.default.CitationAccordionDefaults.container),null==w?void 0:w.container)},{children:[E&&a.jsxs("div",e.__assign({className:t.default["cite-acc__backHeader"]},{children:[a.jsx("button",e.__assign({type:"button",className:t.default["cite-acc__backBtn"],onClick:function(e){e.stopPropagation(),E&&E()},"aria-label":$},{children:"‹"})),a.jsx("span",e.__assign({className:t.default["cite-acc__backTitle"]},{children:U}))]})),I&&I.length>0?I.map(function(i){return!1===i.show?null:a.jsxs("div",e.__assign({className:"".concat(t.default["cite-acc__explain-body"]," ").concat(i.bodyClassName||"")},{children:[a.jsxs("div",e.__assign({className:t.default["cite-acc__innerHeader"],style:e.__assign(e.__assign({},s.default.CitationAccordionDefaults.innerHeader),null==w?void 0:w.innerHeader)},{children:[a.jsx("div",e.__assign({className:t.default["cite-acc__innerHeaderLeft"]},{children:a.jsx("div",{children:a.jsx("div",e.__assign({className:t.default["cite-acc__innerTitle"]},{children:i.title}))})})),a.jsx("button",e.__assign({type:"button",onClick:function(e){e.stopPropagation(),B&&B()}},{children:a.jsx(l.ChevronUp,{})}))]})),a.jsx("div",e.__assign({className:"".concat(t.default["cite-acc__innerBody"]," text-sm text-gray-600"),style:e.__assign(e.__assign({},s.default.CitationAccordionDefaults.innerBody),null==w?void 0:w.innerBody)},{children:"string"==typeof i.content?a.jsx(m,{text:i.content,item:i.item||c||{}}):i.content}))]}),i.id||i.title)}):a.jsxs(a.Fragment,{children:[G&&a.jsxs("div",e.__assign({className:t.default["cite-acc__explain-body"]},{children:[a.jsxs("div",e.__assign({className:t.default["cite-acc__innerHeader"]},{children:[a.jsx("div",e.__assign({className:t.default["cite-acc__innerHeaderLeft"]},{children:a.jsx("div",{children:a.jsx("div",e.__assign({className:t.default["cite-acc__innerTitle"]},{children:Q}))})})),a.jsx("button",e.__assign({type:"button",onClick:function(e){e.stopPropagation(),B&&B()}},{children:a.jsx(l.ChevronUp,{})}))]})),a.jsx("div",e.__assign({className:"".concat(t.default["cite-acc__innerBody"]," text-sm text-gray-600")},{children:a.jsx(m,{text:N||"",item:c||{}})}))]})),a.jsxs("div",e.__assign({className:t.default["cite-acc__explain-body"]},{children:[a.jsx("div",e.__assign({className:t.default["cite-acc__innerHeader"]},{children:a.jsx("div",e.__assign({className:t.default["cite-acc__innerHeaderLeft"]},{children:a.jsx("div",{children:a.jsx("div",e.__assign({className:t.default["cite-acc__innerTitle"]},{children:V}))})}))})),a.jsx("div",e.__assign({className:"".concat(t.default["cite-acc__innerBody"]," text-sm text-gray-600")},{children:a.jsx(m,{text:b||"",item:{}})}))]})),A&&a.jsxs("div",e.__assign({className:t.default["cite-acc__btn-container"]},{children:[a.jsx("button",e.__assign({className:t.default["btn-reject"],onClick:D},{children:Z})),a.jsx("button",e.__assign({className:t.default["btn-accept"],onClick:q},{children:Y}))]})),a.jsxs("div",e.__assign({className:t.default["cite-acc__header"]},{children:[a.jsxs("div",e.__assign({className:t.default["cite-acc__headerLeft"]},{children:[a.jsx("span",e.__assign({className:t.default["cite-acc__titleIcon"]},{children:L?"function"==typeof L?u.default.createElement(L):L:a.jsx(d.ReactComponent,{})})),a.jsx("div",e.__assign({className:t.default["cite-acc__title"]},{children:_}))]})),a.jsx("div",e.__assign({className:t.default["cite-acc__headerRight"]},{children:v&&a.jsxs("span",e.__assign({className:t.default["cite-acc__scoreBadge"]},{children:[M?"function"==typeof M?u.default.createElement(M):M:a.jsx(r.ReactComponent,{}),a.jsxs("span",e.__assign({className:t.default["cite-acc__scoreText"]},{children:[J,"%"]}))]}))}))]})),a.jsxs("div",e.__assign({className:t.default["cite-acc__explain-body"]},{children:[a.jsx("div",e.__assign({className:t.default["cite-acc__innerHeader"]},{children:a.jsx("div",e.__assign({className:t.default["cite-acc__innerHeaderLeft"]},{children:a.jsx("div",{children:a.jsx("div",e.__assign({className:t.default["cite-acc__innerTitle"]},{children:W}))})}))})),a.jsx("div",e.__assign({className:"".concat(t.default["cite-acc__innerBody"]," text-sm text-gray-600")},{children:a.jsx(m,{text:j||"",item:c||{}})}))]})),a.jsxs("div",e.__assign({className:"".concat(t.default["cite-acc__explain-body"]," ").concat(t.default["cite-acc__explain-body_border"])},{children:[a.jsx("div",e.__assign({className:t.default["cite-acc__innerHeader"]},{children:a.jsx("div",e.__assign({className:t.default["cite-acc__innerHeaderLeft"]},{children:a.jsx("div",{children:a.jsx("div",e.__assign({className:t.default["cite-acc__innerTitle"]},{children:X}))})}))})),a.jsx("div",e.__assign({className:"".concat(t.default["cite-acc__innerBody"]," text-sm text-gray-600")},{children:a.jsx(m,{text:K||"",item:c||{}})}))]}))]})]}))};
|
|
2
2
|
//# sourceMappingURL=CognitiveComponent.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),n=require("lucide-react"),o=require("react"),s=require("./ToneToggle.js"),t=[{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"}],l=function(n){var o=n.toneIndex,s=n.configs,l=void 0===s?t:s,a=l[Math.min(o,l.length-1)]||l[1]||l[0],r=a.color,d=a.angle,c=a.arcD,g=(d-90)*Math.PI/180,u=11+9*Math.cos(g),_=13+9*Math.sin(g);return i.jsxs("svg",e.__assign({width:"22",height:"14",viewBox:"0 0 22 14",fill:"none"},{children:[i.jsx("path",{d:"M1 13 A10 10 0 0 1 21 13",stroke:"#e5e5e5",strokeWidth:"2.5",strokeLinecap:"round"}),i.jsx("path",{d:c,stroke:r,strokeWidth:"2.5",strokeLinecap:"round"}),i.jsx("line",{x1:"11",y1:"13",x2:u,y2:_,stroke:r,strokeWidth:"2",strokeLinecap:"round"})]}))},a=function(n){var o=n.type,s=n.customStyles,t=void 0===s?{}:s,l=e.__assign(e.__assign({},{High:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #FECACA",background:"#FEF2F2",color:"#B91C1C",fontSize:"11px",fontWeight:"500"},Medium:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #F2E5A1",background:"#FFFBEB",color:"#B45309",fontSize:"11px",fontWeight:"500"},Low:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #8098F9",background:"#DBEAFE",color:"#444CE7",fontSize:"11px",fontWeight:"500"}}),t),a=l[o]||l.Medium;return i.jsx("div",e.__assign({style:a},{children:o}))},r=["Lenient","Balanced","Aggressive"],d={Lenient:"#1D9E75",Balanced:"#BA7517",Aggressive:"#E24B4A"},c={width:"350px",background:"#fff",border:"1px solid #ddd",borderRadius:"8px",padding:"16px",maxHeight:"400px",overflow:"auto"},g={display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12},u={fontSize:11,fontWeight:500,letterSpacing:"0.08em",color:"#E24B4A",textTransform:"uppercase"},_={fontSize:15,fontWeight:500,margin:"0 0 8px",color:"#111"},v={fontSize:13,color:"#666",lineHeight:1.6,margin:"0 0 14px"},p={marginBottom:14,borderTop:"0.5px solid #eee",paddingTop:12},x={display:"flex",alignItems:"center",gap:6,background:"none",border:"none",cursor:"pointer",padding:0,width:"100%"},m={fontSize:11,fontWeight:500,textTransform:"uppercase",letterSpacing:"0.08em",color:"#E24B4A"},y={display:"flex",gap:8,marginBottom:18},f={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"},h={background:"none",border:"none",cursor:"pointer",fontSize:16,color:"#888",lineHeight:1,padding:0},S={borderTop:"0.5px solid #eee",paddingTop:14},j={display:"flex",alignItems:"center",width:"100%",background:"none",border:"none",cursor:"pointer",padding:0,marginBottom:4};exports.default=function(b){var C,B,k,D,I,A,z,T,E,w,M,R,F,W,L,H,q,P,O,X=b.onClose,G=b.aiReason,J=b.onAccept,K=b.onReject,N=b.onIterate,Q=b.initialTone,U=b.onRegenerate,V=b.labels,Y=void 0===V?{}:V,Z=b.toneLevelsConfig,$=void 0===Z?r:Z,ee=b.toneColorsConfig,ie=void 0===ee?d:ee,ne=b.dialConfigs,oe=void 0===ne?t:ne,se=b.customStyles,te=void 0===se?{}:se,le=b.severityChipStyles,ae=void 0===le?{}:le,re=b.customIcons,de=void 0===re?{}:re,ce=$.findIndex(function(e){return e===Q});-1===ce&&(ce=1);var ge=o.useState(!0),ue=ge[0],_e=ge[1],ve=o.useState(!1),pe=ve[0],xe=ve[1],me=o.useState(ce),ye=me[0],fe=me[1],he=o.useState(ce)[0],Se=$[ye],je=ie[Se]||"#BA7517",be=ye!==he;return i.jsxs("div",e.__assign({onClick:function(e){return e.stopPropagation()},style:e.__assign(e.__assign({},c),null===(C=null==te?void 0:te.DeviationSummaryStyles)||void 0===C?void 0:C.root)},{children:[i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},g),null===(B=null==te?void 0:te.DeviationSummaryStyles)||void 0===B?void 0:B.header)},{children:[i.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:6}},{children:[i.jsx("span",{children:de.summaryIcon||i.jsx(n.Info,{size:16,color:"#E24B4A"})}),i.jsx("span",e.__assign({style:e.__assign(e.__assign({},u),null===(k=null==te?void 0:te.DeviationSummaryStyles)||void 0===k?void 0:k.title)},{children:Y.summaryHeader||"Summary"}))]})),i.jsx("button",e.__assign({onClick:X,style:e.__assign(e.__assign({},h),null===(D=null==te?void 0:te.DeviationSummaryStyles)||void 0===D?void 0:D.closeBtn)},{children:"✕"}))]})),i.jsx("p",e.__assign({style:e.__assign(e.__assign({},_),null===(I=null==te?void 0:te.DeviationSummaryStyles)||void 0===I?void 0:I.bodyText)},{children:null===(A=null==G?void 0:G.deviation_details)||void 0===A?void 0:A.deviation_title})),i.jsx("p",e.__assign({style:e.__assign(e.__assign({},v),null===(z=null==te?void 0:te.DeviationSummaryStyles)||void 0===z?void 0:z.summary)},{children:null===(T=null==G?void 0:G.deviation_details)||void 0===T?void 0:T.deviation_summary})),i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},p),null===(E=null==te?void 0:te.DeviationSummaryStyles)||void 0===E?void 0:E.impactContainer)},{children:[i.jsxs("div",e.__assign({style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},{children:[i.jsxs("button",e.__assign({onClick:function(){return _e(!ue)},style:e.__assign(e.__assign({},x),null===(w=null==te?void 0:te.DeviationSummaryStyles)||void 0===w?void 0:w.impactToggle)},{children:[i.jsx("span",e.__assign({style:e.__assign(e.__assign({},m),null===(M=null==te?void 0:te.DeviationSummaryStyles)||void 0===M?void 0:M.impactToggleLabel)},{children:Y.impactHeader||"Impact"})),i.jsx("span",e.__assign({style:{fontSize:12,color:"#E24B4A",transition:"transform 0.2s",display:"flex",alignItems:"center",transform:ue?"rotate(180deg)":"rotate(0deg)"}},{children:i.jsx(n.ChevronDown,{size:16,color:"#E24B4A"})}))]})),i.jsx(a,{type:(null==G?void 0:G.severity)||"Medium",customStyles:ae})]})),ue&&i.jsx("p",e.__assign({style:{fontSize:13,color:"#666",lineHeight:1.6,margin:"8px 0 0"}},{children:null!==(F=null===(R=null==G?void 0:G.deviation_details)||void 0===R?void 0:R.deviation_impact)&&void 0!==F?F:Y.fallbackImpact||"This change reduces compliance obligations and lowers contractual risk thresholds."}))]})),i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},y),null===(W=null==te?void 0:te.DeviationSummaryStyles)||void 0===W?void 0:W.actionContainer)},{children:[i.jsxs("button",e.__assign({style:e.__assign(e.__assign(e.__assign({},f),null===(L=null==te?void 0:te.DeviationSummaryStyles)||void 0===L?void 0:L.actionBtn),{color:"#64748B"}),onClick:N},{children:[de.iterateIcon||i.jsx(n.PenLine,{size:16,color:"#64748B"}),Y.btnIterate||"Iterate"]}),"Iterate"),i.jsxs("button",e.__assign({style:e.__assign(e.__assign(e.__assign({},f),null===(H=null==te?void 0:te.DeviationSummaryStyles)||void 0===H?void 0:H.actionBtn),{color:"#10B981"}),onClick:J},{children:[de.acceptIcon||i.jsx(n.CheckCircle,{size:16,color:"#10B981"}),Y.btnAccept||"Approve"]}),"Accept"),i.jsxs("button",e.__assign({style:e.__assign(e.__assign(e.__assign({},f),null===(q=null==te?void 0:te.DeviationSummaryStyles)||void 0===q?void 0:q.actionBtn),{color:"#DC2626"}),onClick:K},{children:[de.rejectIcon||i.jsx(n.XCircle,{size:16,color:"#DC2626"}),Y.btnReject||"Reject"]}),"reject")]})),i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},S),null===(P=null==te?void 0:te.DeviationSummaryStyles)||void 0===P?void 0:P.toneContainer)},{children:[i.jsxs("button",e.__assign({onClick:function(){return xe(!pe)},style:e.__assign(e.__assign({},j),null===(O=null==te?void 0:te.DeviationSummaryStyles)||void 0===O?void 0:O.toneToggleBtn)},{children:[i.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:8}},{children:[i.jsx(l,{toneIndex:ye,configs:oe}),i.jsx("span",e.__assign({style:{fontSize:13,fontWeight:500,color:"#111"}},{children:Y.toneHeader||"Redline Tone"}))]})),i.jsx("span",e.__assign({style:{transition:"transform 0.2s",display:"flex",alignItems:"center",transform:pe?"rotate(180deg)":"rotate(0deg)"}},{children:i.jsx(n.ChevronDown,{size:16,color:"#111"})}))]})),pe&&i.jsxs(i.Fragment,{children:[i.jsx("p",e.__assign({style:{fontSize:12,color:"#888",margin:"0 0 12px"}},{children:Y.toneDescription||"Controls how assertively AI is redlining"})),i.jsx(s.ToneToggle,{isDirty:be,onToneChange:function(e){fe(e)},toneColor:je,toneIndex:ye,onClickRegenerate:function(){return null==U?void 0:U(Se)},toneLabels:$})]})]}))]}))};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),n=require("lucide-react"),s=require("react"),o=require("./ToneToggle.js");require("../CognitiveComponents/CitationComponent.module.css.js");var t=require("../icons/cognitiveBrain.svg.js"),l=require("../icons/aiMagic.svg.js"),a=[{color:"#1D9E75",angle:-90,arcD:"M1 13 A10 10 0 0 1 1 13"},{color:"#BA7517",angle:0,arcD:"M1 13 A10 10 0 0 1 11 3"},{color:"#E24B4A",angle:90,arcD:"M1 13 A10 10 0 0 1 21 13"}],r=function(n){var s=n.toneIndex,o=n.configs,t=void 0===o?a:o,l=t[Math.min(s,t.length-1)]||t[1]||t[0],r=l.color,d=l.angle,c=l.arcD,g=(d-90)*Math.PI/180,_=11+9*Math.cos(g),v=13+9*Math.sin(g);return i.jsxs("svg",e.__assign({width:"22",height:"14",viewBox:"0 0 22 14",fill:"none"},{children:[i.jsx("path",{d:"M1 13 A10 10 0 0 1 21 13",stroke:"#e5e5e5",strokeWidth:"2.5",strokeLinecap:"round"}),i.jsx("path",{d:c,stroke:r,strokeWidth:"2.5",strokeLinecap:"round"}),i.jsx("line",{x1:"11",y1:"13",x2:_,y2:v,stroke:r,strokeWidth:"2",strokeLinecap:"round"})]}))},d=function(n){var s=n.type,o=n.customStyles,t=void 0===o?{}:o,l=e.__assign(e.__assign({},{High:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #FECACA",background:"#FEF2F2",color:"#B91C1C",fontSize:"11px",fontWeight:"500"},Medium:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #F2E5A1",background:"#FFFBEB",color:"#B45309",fontSize:"11px",fontWeight:"500"},Low:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #8098F9",background:"#DBEAFE",color:"#444CE7",fontSize:"11px",fontWeight:"500"}}),t),a=l[s]||l.Medium;return i.jsx("div",e.__assign({style:a},{children:s}))},c=["Lenient","Balanced","Aggressive"],g={Lenient:"#1D9E75",Balanced:"#BA7517",Aggressive:"#E24B4A"},_={width:"350px",background:"#fff",border:"1px solid #ddd",borderRadius:"8px",padding:"16px",maxHeight:"400px",overflow:"auto"},v={display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12},u={fontSize:11,fontWeight:500,letterSpacing:"0.08em",color:"#E24B4A",textTransform:"uppercase"},p={fontSize:15,fontWeight:500,margin:"0 0 8px",color:"#111"},x={fontSize:13,color:"#666",lineHeight:1.6,margin:"0 0 14px"},m={marginBottom:14,borderTop:"0.5px solid #eee",paddingTop:12},y={display:"flex",alignItems:"center",gap:6,background:"none",border:"none",cursor:"pointer",padding:0,width:"100%"},h={fontSize:11,fontWeight:500,textTransform:"uppercase",letterSpacing:"0.08em",color:"#E24B4A"},f={display:"flex",gap:8,marginBottom:18},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"},S={background:"none",border:"none",cursor:"pointer",fontSize:16,color:"#888",lineHeight:1,padding:0},b={borderTop:"0.5px solid #eee",paddingTop:14},C={display:"flex",alignItems:"center",width:"100%",background:"none",border:"none",cursor:"pointer",padding:0,marginBottom:4},I={cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"12px",borderTop:"1px solid #eee",borderBottom:"none",paddingLeft:"12px",paddingRight:"12px"},B={display:"flex",alignItems:"center",gap:"4px",minWidth:0,flex:"1 1 auto",overflow:"hidden"},k={width:"28px",height:"28px",display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 28px"},D={fontSize:"13px",color:"#101828",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},T={display:"flex",alignItems:"center",gap:"10px",flex:"0 0 auto",minWidth:0,flexWrap:"nowrap"},A={display:"flex",padding:"4px 8px",alignItems:"center",gap:"4px",borderRadius:"var(--chip-border-radius, 16px)",border:"1px solid var(--Primitive-Gray-300, #d0d5dd)",flex:"0 1 auto",minWidth:0},w={color:"var(--Primitive-Purple-600, #6938ef)",fontFamily:"Inter",fontSize:"12px",fontStyle:"normal",fontWeight:500,lineHeight:"150%"};exports.default=function(z){var R,W,E,L,M,F,H,N,q,P,O,G,X,J,K,Q,U,V,Y,Z=z.onClose,$=z.aiReason,ee=z.onAccept,ie=z.onReject,ne=z.onIterate,se=z.initialTone,oe=z.onRegenerate,te=z.labels,le=void 0===te?{}:te,ae=z.toneLevelsConfig,re=void 0===ae?c:ae,de=z.toneColorsConfig,ce=void 0===de?g:de,ge=z.dialConfigs,_e=void 0===ge?a:ge,ve=z.customStyles,ue=void 0===ve?{}:ve,pe=z.severityChipStyles,xe=void 0===pe?{}:pe,me=z.customIcons,ye=void 0===me?{}:me,he=z.onOpenCognitive,fe=z.showTone,je=void 0===fe||fe,Se=z.cognitiveSectionStyle,be=void 0===Se?{}:Se,Ce=z.cognitiveScoreBadgeStyle,Ie=void 0===Ce?{}:Ce,Be=z.cognitiveScoreTextStyle,ke=void 0===Be?{}:Be,De=z.cognitiveStyles,Te=void 0===De?{}:De,Ae=z.cognitiveClassNames,we=void 0===Ae?{}:Ae,ze=z.cognitiveTitle,Re=void 0===ze?"Cognitive Integrity":ze,We=z.cognitiveLeftIcon,Ee=z.showCognitiveRightArrow,Le=void 0===Ee||Ee,Me=re.findIndex(function(e){return e===se});-1===Me&&(Me=1);var Fe=s.useState(!0),He=Fe[0],Ne=Fe[1],qe=s.useState(!1),Pe=qe[0],Oe=qe[1],Ge=s.useState(Me),Xe=Ge[0],Je=Ge[1],Ke=s.useState(Me)[0],Qe=re[Xe],Ue=ce[Qe]||"#BA7517",Ve=Xe!==Ke;return i.jsxs("div",e.__assign({onClick:function(e){return e.stopPropagation()},style:e.__assign(e.__assign({},_),null===(R=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===R?void 0:R.root)},{children:[i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},v),null===(W=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===W?void 0:W.header)},{children:[i.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:6}},{children:[i.jsx("span",{children:ye.summaryIcon||i.jsx(n.Info,{size:16,color:"#E24B4A"})}),i.jsx("span",e.__assign({style:e.__assign(e.__assign({},u),null===(E=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===E?void 0:E.title)},{children:le.summaryHeader||"Summary"}))]})),i.jsx("button",e.__assign({onClick:Z,style:e.__assign(e.__assign({},S),null===(L=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===L?void 0:L.closeBtn)},{children:"✕"}))]})),i.jsx("p",e.__assign({style:e.__assign(e.__assign({},p),null===(M=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===M?void 0:M.bodyText)},{children:null===(F=null==$?void 0:$.deviation_details)||void 0===F?void 0:F.deviation_title})),i.jsx("p",e.__assign({style:e.__assign(e.__assign({},x),null===(H=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===H?void 0:H.summary)},{children:null===(N=null==$?void 0:$.deviation_details)||void 0===N?void 0:N.deviation_summary})),i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},m),null===(q=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===q?void 0:q.impactContainer)},{children:[i.jsxs("div",e.__assign({style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},{children:[i.jsxs("button",e.__assign({onClick:function(){return Ne(!He)},style:e.__assign(e.__assign({},y),null===(P=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===P?void 0:P.impactToggle)},{children:[i.jsx("span",e.__assign({style:e.__assign(e.__assign({},h),null===(O=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===O?void 0:O.impactToggleLabel)},{children:le.impactHeader||"Impact"})),i.jsx("span",e.__assign({style:{fontSize:12,color:"#E24B4A",transition:"transform 0.2s",display:"flex",alignItems:"center",transform:He?"rotate(180deg)":"rotate(0deg)"}},{children:i.jsx(n.ChevronDown,{size:16,color:"#E24B4A"})}))]})),i.jsx(d,{type:(null==$?void 0:$.severity)||"Medium",customStyles:xe})]})),He&&i.jsx("p",e.__assign({style:{fontSize:13,color:"#666",lineHeight:1.6,margin:"8px 0 0"}},{children:null!==(X=null===(G=null==$?void 0:$.deviation_details)||void 0===G?void 0:G.deviation_impact)&&void 0!==X?X:le.fallbackImpact||"This change reduces compliance obligations and lowers contractual risk thresholds."}))]})),i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},f),null===(J=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===J?void 0:J.actionContainer)},{children:[i.jsxs("button",e.__assign({style:e.__assign(e.__assign(e.__assign({},j),null===(K=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===K?void 0:K.actionBtn),{color:"#64748B"}),onClick:ne},{children:[ye.iterateIcon||i.jsx(n.PenLine,{size:16,color:"#64748B"}),le.btnIterate||"Iterate"]}),"Iterate"),i.jsxs("button",e.__assign({style:e.__assign(e.__assign(e.__assign({},j),null===(Q=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===Q?void 0:Q.actionBtn),{color:"#10B981"}),onClick:ee},{children:[ye.acceptIcon||i.jsx(n.CheckCircle,{size:16,color:"#10B981"}),le.btnAccept||"Approve"]}),"Accept"),i.jsxs("button",e.__assign({style:e.__assign(e.__assign(e.__assign({},j),null===(U=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===U?void 0:U.actionBtn),{color:"#DC2626"}),onClick:ie},{children:[ye.rejectIcon||i.jsx(n.XCircle,{size:16,color:"#DC2626"}),le.btnReject||"Reject"]}),"reject")]})),je&&i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},b),null===(V=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===V?void 0:V.toneContainer)},{children:[i.jsxs("button",e.__assign({onClick:function(){return Oe(!Pe)},style:e.__assign(e.__assign({},C),null===(Y=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===Y?void 0:Y.toneToggleBtn)},{children:[i.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:8}},{children:[i.jsx(r,{toneIndex:Xe,configs:_e}),i.jsx("span",e.__assign({style:{fontSize:13,fontWeight:500,color:"#111"}},{children:le.toneHeader||"Redline Tone"}))]})),i.jsx("span",e.__assign({style:{transition:"transform 0.2s",display:"flex",alignItems:"center",transform:Pe?"rotate(180deg)":"rotate(0deg)"}},{children:i.jsx(n.ChevronDown,{size:16,color:"#111"})}))]})),Pe&&i.jsxs(i.Fragment,{children:[i.jsx("p",e.__assign({style:{fontSize:12,color:"#888",margin:"0 0 12px"}},{children:le.toneDescription||"Controls how assertively AI is redlining"})),i.jsx(o.ToneToggle,{isDirty:Ve,onToneChange:function(e){Je(e)},toneColor:Ue,toneIndex:Xe,onClickRegenerate:function(){return null==oe?void 0:oe(Qe)},toneLabels:re})]})]})),he&&i.jsxs("div",e.__assign({className:null==we?void 0:we.section,onClick:function(e){e.stopPropagation(),he&&he(e)},style:e.__assign(e.__assign(e.__assign({},I),null==Te?void 0:Te.section),be)},{children:[i.jsxs("div",e.__assign({className:null==we?void 0:we.headerLeft,style:e.__assign(e.__assign({},B),null==Te?void 0:Te.headerLeft)},{children:[i.jsx("span",e.__assign({className:null==we?void 0:we.titleIcon,style:e.__assign(e.__assign({},k),null==Te?void 0:Te.titleIcon)},{children:null!=We?We:i.jsx(t.ReactComponent,{})})),i.jsx("div",e.__assign({className:null==we?void 0:we.cognitiveTitle,style:e.__assign(e.__assign({},D),null==Te?void 0:Te.cognitiveTitle)},{children:Re}))]})),i.jsxs("div",e.__assign({className:null==we?void 0:we.headerRight,style:e.__assign(e.__assign({},T),null==Te?void 0:Te.headerRight)},{children:[void 0!==(null==$?void 0:$.relevance_score)&&null!==(null==$?void 0:$.relevance_score)?i.jsxs("span",e.__assign({className:null==we?void 0:we.scoreBadge,style:e.__assign(e.__assign(e.__assign({},A),null==Te?void 0:Te.scoreBadge),Ie)},{children:[i.jsx(l.ReactComponent,{}),i.jsxs("span",e.__assign({className:null==we?void 0:we.scoreText,style:e.__assign(e.__assign(e.__assign({},w),null==Te?void 0:Te.scoreText),ke)},{children:[Math.round(Number($.relevance_score)),"%"]}))]})):null,Le&&i.jsx("span",e.__assign({style:{display:"flex",alignItems:"center"}},{children:i.jsx(n.ChevronRight,{size:16,color:"#64748B"})}))]}))]}))]}))};
|
|
2
2
|
//# sourceMappingURL=DeviationSummary.js.map
|
package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),s=require("lucide-react"),n=require("react"),i=require("./PopupDefaults.js");function o(e){var t=new Date(e);return isNaN(t.getTime())?e:new Date(e).toLocaleString("en-US",{month:"2-digit",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0}).replace(" AM","AM").replace(" PM","PM")}var r=function(){return t.jsxs("svg",e.__assign({width:"22",height:"22",viewBox:"0 0 22 22",fill:"none"},{children:[t.jsx("circle",{cx:"11",cy:"11",r:"10",stroke:"#22c55e",strokeWidth:"2",fill:"#f0fdf4"}),t.jsx("path",{d:"M6.5 11.5l3 3 6-6",stroke:"#22c55e",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}))},a=function(){return t.jsxs("svg",e.__assign({width:"22",height:"22",viewBox:"0 0 22 22",fill:"none"},{children:[t.jsx("circle",{cx:"11",cy:"11",r:"10",stroke:"#ef4444",strokeWidth:"2",fill:"#fff1f2"}),t.jsx("path",{d:"M7.5 7.5l7 7M14.5 7.5l-7 7",stroke:"#ef4444",strokeWidth:"2",strokeLinecap:"round"})]}))},d=function(){return t.jsx("svg",e.__assign({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},{children:t.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#94a3b8",strokeWidth:"1.8",strokeLinecap:"round"})}))},l=function(){return t.jsxs("svg",e.__assign({width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},{children:[t.jsx("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),t.jsx("path",{d:"M1.5 13.5c0-3.038 2.462-5.5 5-5.5s5 2.462 5 5.5",stroke:"#94a3b8",strokeWidth:"1.4",strokeLinecap:"round"}),t.jsx("path",{d:"M11 8.5l1.5 1.5 2.5-2.5",stroke:"#22c55e",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]}))},c=function(){return t.jsxs("svg",e.__assign({width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},{children:[t.jsx("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),t.jsx("path",{d:"M1.5 13.5c0-3.038 2.462-5.5 5-5.5s5 2.462 5 5.5",stroke:"#94a3b8",strokeWidth:"1.4",strokeLinecap:"round"}),t.jsx("path",{d:"M11.5 8l3 3m0-3l-3 3",stroke:"#ef4444",strokeWidth:"1.4",strokeLinecap:"round"})]}))},u=function(s){var n=s.open;return t.jsx("svg",e.__assign({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",style:{transform:n?"rotate(0deg)":"rotate(180deg)",transition:"transform 0.25s ease"}},{children:t.jsx("path",{d:"M4.5 11.25L9 6.75l4.5 4.5",stroke:"#64748b",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})}))},g=function(s){var n=s.color,i=void 0===n?"#3b82f6":n;return t.jsxs("svg",e.__assign({width:"15",height:"15",viewBox:"0 0 16 16",fill:"none"},{children:[t.jsx("path",{d:"M1.5 8A6.5 6.5 0 1 0 4 3.2",stroke:i,strokeWidth:"1.5",strokeLinecap:"round"}),t.jsx("path",{d:"M1.5 3.5v4h4",stroke:i,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M8 5v3.5l2 1.5",stroke:i,strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]}))},h=function(){return t.jsxs("svg",e.__assign({width:"15",height:"15",viewBox:"0 0 16 16",fill:"none"},{children:[t.jsx("path",{d:"M13.5 8a5.5 5.5 0 1 0-1.6 3.9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round"}),t.jsx("path",{d:"M13.5 13v-4.5H9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}))},x=function(){return t.jsxs("svg",e.__assign({width:"15",height:"15",viewBox:"0 0 16 16",fill:"none"},{children:[t.jsx("path",{d:"M2 8h12M10 4l4 4-4 4",stroke:"#64748b",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M4 5l-2 3 2 3",stroke:"#64748b",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]}))};function f(s){var n=s.title,i=s.open,o=s.onToggle,r=s.children;return t.jsxs("div",e.__assign({style:{maxHeight:"170px",overflow:"auto"}},{children:[t.jsxs("div",e.__assign({onClick:o,style:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",userSelect:"none",padding:"2px 0"}},{children:[t.jsx("span",e.__assign({style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"}},{children:n})),t.jsx(u,{open:i})]})),t.jsx("div",e.__assign({style:{maxHeight:i?300:0,opacity:i?1:0,overflow:"hidden",transition:"max-height 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.25s"}},{children:r}))]}))}function _(s){var n=s.icon,i=s.label,o=s.onClick,r=s.customStyle,a=void 0===r?{}:r,d=e.__assign({display:"flex",alignItems:"center",gap:7,padding:"8px 16px",background:"#f8fafc",border:"1.5px solid #e2e8f0",borderRadius:10,cursor:"pointer",fontSize:"12px",fontWeight:600,color:"#475569",fontFamily:"inherit",transition:"background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.12s",whiteSpace:"nowrap"},a);return t.jsxs("button",e.__assign({onClick:o,style:d,onMouseEnter:function(e){e.currentTarget.style.background="#f1f5f9",e.currentTarget.style.transform="translateY(-1px)",e.currentTarget.style.boxShadow="0 2px 8px rgba(0,0,0,0.07)"},onMouseLeave:function(e){e.currentTarget.style.background="#f8fafc",e.currentTarget.style.transform="",e.currentTarget.style.boxShadow=""}},{children:[n,i]}))}exports.ApprovedIcon=r,exports.ChevronIcon=u,exports.CloseIcon=d,exports.HistoryIcon=g,exports.IterateIcon=x,exports.RedlineCard=function(u){var p,j=u.status,k=u.onClose,b=u.impactText,v=u.secondText,y=u.actionTakenByName,m=u.actionTakenAtTime,B=void 0===m?"NA":m,C=u.onHistory,L=u.onIterate,R=u.onReinstate,w=u.onRevert,I=u.impactTitle,S=void 0===I?"Impact":I,M=u.customConfigs,W=void 0===M?{}:M,T=u.customStyles,D=void 0===T?{}:T,z=n.useState(!0),A=z[0],U=z[1],H=n.useState(!0),q=H[0],F=H[1],E=n.useState(!1),N=E[0],P=E[1],O={headerBg:"#f0fdf4",headerBorder:"#dcfce7",titleColor:"#166534",label:"Redline Approved",metaLabel:"Approved By",UserIcon:t.jsx(l,{}),StatusIcon:t.jsx(r,{}),secondTitle:"Original text",secondBg:"#f8fafc",secondBorder:"#e2e8f0",impactBox:!0,actions:[{icon:t.jsx(g,{}),label:"History",onClick:C},{icon:t.jsx(s.Undo2,{size:17}),label:"Revert",onClick:w},{icon:t.jsx(x,{}),label:"Iterate",onClick:L}]},Y={headerBg:"#fff1f2",headerBorder:"#fecdd3",titleColor:"#991b1b",label:"Redline Rejected",metaLabel:"Rejected By",UserIcon:t.jsx(c,{}),StatusIcon:t.jsx(a,{}),secondTitle:"Rejected Recommendation",secondBg:"#f8fafc",secondBorder:"#e2e8f0",impactBox:!1,actions:[{icon:t.jsx(g,{color:"#3b82f6"}),label:"History",onClick:C},{icon:t.jsx(h,{}),label:"Reinstate",onClick:R},{icon:t.jsx(x,{}),label:"Iterate",onClick:L}]},G={headerBg:"#E2E8F0",headerBorder:"none",titleColor:"#1E293B",label:"Redline Reverted",metaLabel:"Reverted By",UserIcon:t.jsx(l,{}),StatusIcon:t.jsx(s.Undo2,{size:17}),secondTitle:"Reverted redline",secondBg:"#F9FAFB",secondBorder:"#D0D5DD",impactBox:!1,actions:[{icon:t.jsx(g,{}),label:"History",onClick:C},{icon:t.jsx(x,{}),label:"Iterate",onClick:L}]};p="accepted"===j?O:"rejected"===j?Y:G;var J=e.__assign(e.__assign({},p),W[j]||{});return t.jsxs("div",e.__assign({style:e.__assign(e.__assign(e.__assign({},i.default.RedlineCardDefaults.root),{animation:N?"slideOut 0.26s cubic-bezier(0.4,0,1,1) forwards":i.default.RedlineCardDefaults.root.animation||"slideIn 0.32s cubic-bezier(0.22,1,0.36,1) both"}),D.root)},{children:[t.jsxs("div",e.__assign({style:e.__assign(e.__assign(e.__assign({},i.default.RedlineCardDefaults.header),{background:J.headerBg,borderBottom:"1.5px solid ".concat(J.headerBorder)}),D.header)},{children:[t.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:10}},{children:[J.StatusIcon,t.jsx("span",e.__assign({style:{fontSize:15,fontWeight:700,color:J.titleColor,letterSpacing:"-0.01em"}},{children:J.label}))]})),t.jsx("button",e.__assign({onClick:function(){P(!0),k()},style:{background:"none",border:"none",cursor:"pointer",padding:4,borderRadius:6,display:"flex",alignItems:"center"}},{children:t.jsx(d,{})}))]})),t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},i.default.RedlineCardDefaults.body),D.body)},{children:[t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},i.default.RedlineCardDefaults.meta),D.meta)},{children:[t.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:6,marginBottom:5}},{children:[J.UserIcon,t.jsx("span",e.__assign({style:{fontSize:12.5,color:"#94a3b8",fontWeight:500}},{children:J.metaLabel}))]})),t.jsxs("div",e.__assign({style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"}},{children:[y,", ",o(B)]}))]})),t.jsx("div",{style:e.__assign(e.__assign({},i.default.RedlineCardDefaults.divider),D.divider)}),t.jsx(f,e.__assign({title:S,open:A,onToggle:function(){return U(function(e){return!e})}},{children:t.jsx("p",e.__assign({style:e.__assign(e.__assign({},i.default.RedlineCardDefaults.impactText),D.impactText)},{children:b||""}))})),t.jsx("div",{style:e.__assign(e.__assign({},i.default.RedlineCardDefaults.divider),D.divider)}),t.jsx(f,e.__assign({title:J.secondTitle,open:q,onToggle:function(){return F(function(e){return!e})}},{children:t.jsx("div",e.__assign({style:e.__assign(e.__assign(e.__assign({},i.default.RedlineCardDefaults.secondSection),{background:J.secondBg,border:"1.5px solid ".concat(J.secondBorder)}),D.secondSection)},{children:v||""}))})),t.jsx("div",e.__assign({style:e.__assign(e.__assign({},i.default.RedlineCardDefaults.actionsContainer),D.actionsContainer)},{children:J.actions.map(function(e){return t.jsx(_,{icon:e.icon,label:e.label,onClick:e.onClick,customStyle:e.style},e.label)})}))]}))]}))},exports.ReinstateIcon=h,exports.RejectedIcon=a,exports.UserApprovedIcon=l,exports.UserRejectedIcon=c,exports.formatDate=o;
|
|
2
2
|
//# sourceMappingURL=RedlineStatusCard.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("react"),a=require("lucide-react"),s=require("../../../UserStoryImport/lib/cn.js"),o=require("./segment.module.css.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("react"),a=require("lucide-react"),s=require("../../../UserStoryImport/lib/cn.js"),o=require("./segment.module.css.js"),r=require("./ExampleComponentWrapper.js"),i=require("../ai-reasoning/AiReasoningCitationContent.js"),l=require("./SegmentLoader.js");require("./segment-common.css.js");var u=require("../../store/markdown-context.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=c(t);exports.default=function(c){var m=c.id,g=void 0===m?"Segment":m,p=c.label,f=c.children,v=c.segmentUUID;c.decisionStrength;var _=c.aiReason,x=c.customStyles,y=c.customIcons,j=c.aiReasoningCitationCustomStyles,h=c.segmentExampleComponent,C=c.handleViewGlossary,S=c.isUpdatedSegment,b=c.onOpen,q=t.useContext(u.MarkdownStateContext),w=q.citationsMetadata,E=q.updateCitationsMetadata;console.log("citation metadata ",w);var I=d.default.useState(!1),M=I[0],N=I[1],k=t.useMemo(function(){return w.get(v)},[w,v]),R=t.useMemo(function(){return(null==k?void 0:k.open)||!1},[k]),U=t.useMemo(function(){return k&&"loading"===k.state},[k]);return n.jsxs("div",e.__assign({className:"".concat(o.default.segmentWrapper),style:e.__assign({},null==x?void 0:x.segmentWrapper)},{children:[n.jsxs("div",e.__assign({className:"segment-".concat(g,"-container segmentContainer ").concat(S?"updatedSegmentContainer":""),style:e.__assign({},null==x?void 0:x.container)},{children:[n.jsx("span",e.__assign({className:"segment-".concat(g," segmentLabel ").concat(S?"updatedSegmentLabel":""),style:e.__assign({},null==x?void 0:x.label)},{children:S?f:p})),n.jsx("button",e.__assign({className:"".concat(o.default.segmentExplanationButtonContainer),style:e.__assign({},null==x?void 0:x.buttonContainer),onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(t){switch(t.label){case 0:if(n=!R,N(!1),console.log("citation metadata::",n,_),!n||(null==_?void 0:_.reason))return[3,5];E(v,function(t){if(t){var a=e.__assign({},t);return a.state="loading",a}return{open:n,state:"loading"}}),t.label=1;case 1:return t.trys.push([1,,3,4]),console.log("citation metadata:: onopen"),[4,null==b?void 0:b()];case 2:return t.sent(),[3,4];case 3:return E(v,function(t){if(t){var a=e.__assign({},t);return a.state="ready",a.open=n,a}return{open:n,state:"ready"}}),[7];case 4:return[3,6];case 5:console.log("citation metadata:: else block"),E(v,function(t){if(t){var a=e.__assign({},t);return a.open=n,a}return{open:n,state:U?"loading":"ready"}}),t.label=6;case 6:return[2]}})})}},{children:U?n.jsx(a.Loader2,{size:16,className:o.default.spinner}):n.jsx(a.ChevronDown,{className:s.cn(S&&o.default.updatedChevronIcon,o.default.cheveronIcon,R&&o.default.cheveronIconRotated),style:e.__assign({},null==x?void 0:x.cheveronIcon)})}))]})),M&&!S?n.jsx(r.default,{label:null!=p?p:"",segmentExampleComponent:h,customStyles:null==x?void 0:x.segmentExample,handleCancelExample:function(){N(!1)}}):R&&(U?n.jsx(l.default,{customStyles:null==x?void 0:x.loadingSkeleton}):n.jsx(i.default,{aiReason:_,customStyles:j,customIcons:y,isSegmentExplanation:!0,handleViewGlossary:C?function(){E(v,function(n){if(n){var t=e.__assign({},n);return t.open=!1,t}return{open:!1,state:U?"loading":"ready"}}),null==C||C(g)}:void 0,handleViewExample:h?function(){N(!0)}:void 0,isUpdatedSegment:S}))]}))};
|
|
2
2
|
//# sourceMappingURL=Segment.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("./Segment.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=o(require("dompurify"));exports.default=function(o){var i,d,a,r,s,u,v,g,m,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("./Segment.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=o(require("dompurify"));exports.default=function(o){var i,d,a,r,s,u,v,g,c,m,p,S,f,h=o.id,_=o.children,b=o.props,x=o.segmentComponentConfig,y=o.customStyles,C=o.customIcons,j=o.extractText,I=o.isUpdatedSegment,U=void 0!==I&&I,D=(null==b?void 0:b.id)||"Segment",w=(null==b?void 0:b.decisionstrength)||"80",q=x||{},E=q.segmentDataList,F=q.getSegmentExampleComponent,L=q.handleViewGlossary,k=q.upadatedSegmentDataList,O=q.handleFetchUpdatedSegmentDetails,R=q.handleFetchSegmentDetails,G=U?null==k?void 0:k.find(function(e){return String(e.segment_id)===String(D)}):null==E?void 0:E.find(function(e){return String(e.segment_id)===String(D)});console.log("meee work",G,U,E,k);var M={id:D,reason:null!==(i=null==G?void 0:G.reason)&&void 0!==i?i:"",gap:null!==(d=null==G?void 0:G.gap)&&void 0!==d?d:"",explanation:null!==(a=null==G?void 0:G.explanation)&&void 0!==a?a:"",relevance_score:null!==(r=null==G?void 0:G.relevance_score)&&void 0!==r?r:0,isOpen:!1},T=void 0,V=j(_),W=b["data-table"],z="";if(W&&!U)try{z=decodeURIComponent(atob(W))}catch(e){console.error("Failed to decode data-table for segment",D,e)}var H=l.default.sanitize(z);return G||!R||U||null==R||R(D),D&&G&&F&&!U&&(T=W?n.jsx(function(){return n.jsx("div",{dangerouslySetInnerHTML:{__html:H}})},{}):F(D,V,G.segment_type)),n.jsx(t.default,e.__assign({id:D,segmentUUID:h,label:null!==(s=null==G?void 0:G.label)&&void 0!==s?s:null==G?void 0:G.segment_name,decisionStrength:w,aiReason:M,customIcons:C,aiReasoningCitationCustomStyles:y,segmentExampleComponent:T,handleViewGlossary:L,customStyles:{segmentWrapper:null===(u=null==y?void 0:y.segment)||void 0===u?void 0:u.segmentWrapper,container:null===(v=null==y?void 0:y.segment)||void 0===v?void 0:v.container,label:null===(g=null==y?void 0:y.segment)||void 0===g?void 0:g.label,decisionStrength:null===(c=null==y?void 0:y.segment)||void 0===c?void 0:c.decisionStrength,buttonContainer:null===(m=null==y?void 0:y.segment)||void 0===m?void 0:m.buttonContainer,cheveronIcon:null===(p=null==y?void 0:y.segment)||void 0===p?void 0:p.cheveronIcon,segmentExample:null===(S=null==y?void 0:y.segment)||void 0===S?void 0:S.segmentExample,loadingSkeleton:null===(f=null==y?void 0:y.segment)||void 0===f?void 0:f.SegmentLoadingSkeletonStyles},isUpdatedSegment:U,onOpen:function(){return e.__awaiter(void 0,void 0,void 0,function(){return e.__generator(this,function(e){switch(e.label){case 0:return G||!U?[3,2]:(console.log("citation metadata:: handleFetchUpdatedSegmentDetails"),[4,null==O?void 0:O(D)]);case 1:e.sent(),e.label=2;case 2:return[2]}})})}},{children:_}),D)};
|
|
2
2
|
//# sourceMappingURL=SegmentWrapper.js.map
|
package/dist/cjs/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),t=require("react-markdown"),o=require("rehype-raw"),a=require("./UserStoryWithCitation.module.css.js"),l=require("../../shared/useMarkdownSearch.js"),r=require("lucide-react"),s=require("@mui/material"),d=require("../../shared/UpdatedAnimationContent.js"),c=require("../../shared/GeneratedCodeCitation.js"),u=require("../../shared/CitationLoadingIndicator.js"),g=require("../RequirementAIWrapper/RequirementAIWrapper.js"),v=require("../../icons/CognitiveDecision.js"),f=require("../../icons/BrainRed.js"),h=require("../ai-reasoning/AiReasoningCitation.js"),p=require("../../icons/RelevanceScoreIcon.js"),m=require("../RecommendationBlock/RecommendationBlock.js"),C=require("../UserStoryCard/AttachedContext.js"),_=require("../ai-reasoning/AiReasoningCitationContent.js"),x=require("./components/InlineUpdatedComponent.js"),j=require("../segment/SegmentWrapper.js"),y=require("../../store/markdown-context.js");function S(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var R=S(i),I=S(t),w=S(o),b=i.createContext(!1),N=i.createContext({expandedInfo:null,setExpanded:function(){},reasonToRow:{current:new Map}}),A=i.createContext({rowId:""}),k=function(t){var o,l=t.aiReason,r=t.isHighConfidence,s=t.customStyle,d=t.customIcons,c=i.useContext(N),u=c.expandedInfo,g=c.setExpanded,h=c.reasonToRow,p=i.useContext(A).rowId,m=String(l.id);p&&h.current.set(m,p);var C=(null===(o=null==u?void 0:u.aiReason)||void 0===o?void 0:o.id)===l.id,_=r?(null==d?void 0:d.highConfidence)||n.jsx(v.default,{}):(null==d?void 0:d.lowConfidence)||n.jsx(f.default,{});return n.jsxs("button",e.__assign({className:a.default.aiReasoningButton,style:s,onClick:function(e){e.stopPropagation(),e.preventDefault(),g(C?null:p,C?null:l)}},{children:[_,C?n.jsx("i",{className:"pi pi-angle-up ".concat(r?a.default.aiReasoningIconHighConfidence:a.default.aiReasoningIconLowConfidence)}):n.jsx("i",{className:"pi pi-angle-down ".concat(r?a.default.aiReasoningIconHighConfidence:a.default.aiReasoningIconLowConfidence)})]}))},q=function(t){var o,l,r=t.children,s=t.node,d=t.customStyles,c=t.customIcons,u=i.useRef(Math.random().toString(36).slice(2)).current,g=i.useContext(N).expandedInfo,v=(null==g?void 0:g.rowId)===u,f=Array.isArray(null==s?void 0:s.children)?s.children.filter(function(e){return"element"===e.type}).length:1,h=null!==(l=null===(o=null==s?void 0:s.properties)||void 0===o?void 0:o.style)&&void 0!==l?l:void 0;return n.jsxs(A.Provider,e.__assign({value:{rowId:u}},{children:[n.jsx("tr",e.__assign({style:h?{cssText:h}:void 0},{children:r})),v&&(null==g?void 0:g.aiReason)&&n.jsx("tr",e.__assign({style:{width:"100%"}},{children:n.jsx("td",e.__assign({colSpan:f||1,className:a.default.tableExpandedCell},{children:n.jsx("div",e.__assign({className:a.default.tableExpandedCellInner},{children:n.jsx("div",e.__assign({className:a.default.tableExpandedCellContent},{children:n.jsx(_.default,{aiReason:g.aiReason,customIcons:c,customStyles:{aiReasoningContent:null==d?void 0:d.aiReasoningContent,aiReasoningAccordion:null==d?void 0:d.aiReasoningAccordion,aiReasoningMarkdown:null==d?void 0:d.aiReasoningMarkdown,aiReasoningPill:null==d?void 0:d.aiReasoningPill,webCitation:null==d?void 0:d.webCitation,stormeeCitation:null==d?void 0:d.stormeeCitation,waveformCitation:null==d?void 0:d.waveformCitation,imageCitation:null==d?void 0:d.imageCitation,fileCitation:null==d?void 0:d.fileCitation,appModCitation:null==d?void 0:d.appModCitation,rcaCitation:null==d?void 0:d.rcaCitation,readFileCitation:null==d?void 0:d.readFileCitation,loadingCitations:null==d?void 0:d.loadingCitations,chatCitation:null==d?void 0:d.chatCitation}})}))}))}))}))]}))};var E=["del","ins"];function T(e){return function(e,n,i){var t=n.join("|");return e.replace(new RegExp("<(".concat(t,")>([\\s\\S]*?)<\\/\\1>"),"gi"),function(e,n,t){return"<".concat(n,">").concat(i(t),"</").concat(n,">")})}(e,E,function(e){return e.split(/(<[^>]+>)/g).map(function(e){return!e||/^<[^>]+>$/.test(e)?e:function(e){if(!e)return e;var n=[];return e.replace(/`([^`\n]+)`/g,function(e,i){var t=n.push(i)-1;return"@@CODE_SPAN_".concat(t,"@@")}).replace(/\*\*([\s\S]+?)\*\*/g,"<strong>$1</strong>").replace(/__([\s\S]+?)__/g,"<strong>$1</strong>").replace(/@@CODE_SPAN_(\d+)@@/g,function(e,i){var t,o=null!==(t=n[Number(i)])&&void 0!==t?t:"";return"<code>".concat(o.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),"</code>")})}(e)}).join("")})}exports.default=function(t){var o,v=t.message,f=t.isParent,_=t.scenario,S=t.showUserStoryDiff,A=void 0!==S&&S,E=t.aiReasoningsForBlock,U=t.isCitationLoadingDisplay,M=void 0!==U&&U,P=t.className;t.highConfidenceIcon,t.lowConfidenceIcon;var L=t.customStyles,$=t.customIcons,D=t.aiReasoningDiffView,H=t.userStoryCitations,O=t.artifactId,F=t.isCraflow,B=t.onCraAccept,W=t.onCraReject,z=t.craFlowConfig,V=t.isDisplayHighlightControl,G=void 0!==V&&V,Q=i.useRef(null),J=g.useRequirementAI(),K=J.userStory,X=J.inlineUpdateComponentConfig,Y=J.getAvgScoreForStory,Z=J.setUserStory,ee=J.aiReasoning,ne=J.setAiReasoning,ie=J.customIcons,te=J.searchQueryList,oe=J.searchQueryReasoningIdList,ae=J.currentHighlightIndex,le=J.segmentComponentConfig,re=null!=$?$:null==ie?void 0:ie.userStoryIcons;null==L||L.searchHighlight;var se=l.useMarkdownSearch(Q),de=se.search,ce=se.clear,ue=i.useState("1"),ge=ue[0],ve=ue[1],fe=i.useState(null),he=fe[0],pe=fe[1],me=i.useRef(new Map),Ce=i.useCallback(function(e,n){pe(e&&n?{rowId:e,aiReason:n}:null)},[]),_e=O?Y(O):0,xe=i.useState([]),je=xe[0],ye=xe[1],Se=function(e){return null==e?"":"string"==typeof e?e:"number"==typeof e?String(e):Array.isArray(e)?e.map(Se).join(""):R.default.isValidElement(e)?Se(e.props.children):""},Re=function(e){var n=e;return n=function(e){for(var n,i=/<updated[^>]*>[\s\S]*?<\/updated>/gi,t=[],o=new RegExp(i.source,i.flags);null!==(n=o.exec(e));){var a=n[0],l=a.match(/<deleted>([\s\S]*?)<\/deleted>/i),r=a.match(/<changed>([\s\S]*?)<\/changed>/i),s=function(e){return(e.match(/^\s*\d+\.\s/gm)||[]).length};t.push({index:n.index,endIndex:n.index+n[0].length,deletedItemCount:s((null==l?void 0:l[1])||""),changedItemCount:s((null==r?void 0:r[1])||"")})}if(0===t.length)return e;for(var d=e,c=function(e){var n=t[e],i=n.changedItemCount-n.deletedItemCount;if(0===i)return"continue";for(var o=!1,a=0,l=d.substring(0,n.index).split("\n").reverse();a<l.length;a++){var r=l[a].trim();if(""!==r){/^\d+\.\s/.test(r)&&(o=!0);break}}if(!o)return"continue";var s=n.endIndex,c=e+1<t.length?t[e+1].index:d.length,u=d.substring(s,c);u=u.replace(/^(\s*)(\d+)\.\s/gm,function(e,n,t){return"".concat(n).concat(parseInt(t,10)+i,". ")}),d=d.substring(0,s)+u+d.substring(c)},u=t.length-1;u>=0;u--)c(u);return d}(n=(n=(n=(n=(n=n.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,function(e,n){var i=n.replace(/ai_reasoning\$(\d+)/g,function(e,n){return"ai_reasoning$".concat(n,"-legacy")});return"<deleted>".concat(i,"</deleted>")})).replace(/<generatedCode([^>]*)>([\s\S]*?)<\/generatedCode>/gi,function(e,n,i){var t=btoa(encodeURIComponent(i.trim()));return"\n\n<generatedCode".concat(n,' data-raw="').concat(t,'"></generatedCode>\n\n')})).replace(/^(\s*[-*]|\s*\d+\.)\s*\n?\s*(<updated\b)/gm,"$1 $2")).replace(/(<segment\b([^>]*)>)([\s\S]*?)(<\/segment>)/gi,function(e,n,i,t,o){var a=t.match(/<table[\s\S]*?<\/table>/i);if(a){var l=btoa(encodeURIComponent(a[0]));return"<segment".concat(i,' data-table="').concat(l,'"></segment>')}return e})).replace(/<updated([^>]*)>([\s\S]*?)<\/updated>/gi,function(e,i,t,o){var a=n.substring(0,o),l=a.lastIndexOf("\n"),r=/^\s+[-*]\s/.test(a.substring(l+1))||/^\s+\d+\.\s/.test(a.substring(l+1)),s=/^\s*(\d+\.|\s*[-*])\s+$/.test(a.substring(l+1));if(r||s){var d=t;return d=(d=(d=(d=d.replace(/(<deleted>)\s*\n?\s*[-*]\s+/gi,"$1\n")).replace(/(<changed>)\s*\n?\s*[-*]\s+/gi,"$1\n")).replace(/(<deleted>)\s*\n?\s*\d+\.\s+/gi,"$1\n")).replace(/(<changed>)\s*\n?\s*\d+\.\s+/gi,"$1\n"),"<updated".concat(i,">").concat(d,"</updated>")}return e})),n=function(e){var n=e.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,function(e,n){var i=n.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <deleted>",{hadChange:i!==n}),"<deleted>".concat(i,"</deleted>")});return n.replace(/<changed>([\s\S]*?)<\/changed>/gi,function(e,n){var i=n.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <changed>",{hadChange:i!==n,preview:n.substring(0,120)}),"<changed>".concat(i,"</changed>")})}(n),n=T(n)},Ie=i.useMemo(function(){return v?Re(v):v},[v]);i.useEffect(function(){ye(E||ee)},[E,ee]);var we=i.useMemo(function(){return{upt:function(i){var t;i.node;var o=i.children,a=e.__rest(i,["node","children"]),l=null==a?void 0:a.id,r=l?null===(t=l.split("$"))||void 0===t?void 0:t[1]:null,s=ee.find(function(e){return e.id.toString()===r});return s?n.jsx(x.default,e.__assign({aiReason:s,customStyles:null==L?void 0:L.inlineUpdatedComponent,handleClickCognitiveDecision:null==X?void 0:X.handleClickCognitiveDecision,handleClickUpdatedPill:null==X?void 0:X.handleClickUpdatedPill,handleClickOutputValue:null==X?void 0:X.handleClickOutputValue,customIcons:null==X?void 0:X.customIcons},{children:o})):o},del:function(i){i.node;var t=i.children,o=e.__rest(i,["node","children"]);return n.jsx("span",e.__assign({className:a.default.deleted,style:null==L?void 0:L.deleted},o,{onClick:o.onclick},{children:t}))},ins:function(i){var t=i.children,o=e.__rest(i,["children"]);return n.jsx("span",e.__assign({className:a.default.inserted,style:null==L?void 0:L.inserted},o,{onClick:o.onclick},{children:t}))},preserved:function(i){var t=i.children,o=e.__rest(i,["children"]);return n.jsx("span",e.__assign({className:a.default.preserved,style:null==L?void 0:L.preserved},o,{onClick:o.onclick},{children:t}))},h1:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("h1",e.__assign({className:a.default.heading1,style:null==L?void 0:L.heading1},{children:t.children}))},h2:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("h2",e.__assign({className:a.default.heading2,style:null==L?void 0:L.heading2},{children:t.children}))},h3:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("h3",e.__assign({className:a.default.heading3,style:null==L?void 0:L.heading3},{children:t.children}))},b:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("b",e.__assign({className:a.default.bold,style:null==L?void 0:L.bold},{children:null==t?void 0:t.children}))},p:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("p",e.__assign({},t,{className:a.default.paragraph,style:null==L?void 0:L.paragraph},{children:t.children}))},updated:function(i){var t=i.node,o=e.__rest(i,["node"]);return n.jsx(d.default,e.__assign({},o,{showUserStoryDiff:A,currentUpdatedTagId:ge,setCurrentUpdatedTagId:ve,userStory:K,setUserStory:Z,setAiReasoning:ne,node:t,isCraflow:F,onCraAccept:B,onCraReject:W,customStyles:null==L?void 0:L.updatedContent,craFlowConfig:z}))},ol:function(i){var t,o,l,r=i.node,s=e.__rest(i,["node"]),d=null!==(l=null!==(o=null===(t=null==r?void 0:r.properties)||void 0===t?void 0:t.start)&&void 0!==o?o:null==s?void 0:s.start)&&void 0!==l?l:void 0;return n.jsx("ol",e.__assign({className:a.default.orderedList,style:null==L?void 0:L.olist},d?{start:Number(d)}:{},{children:null==s?void 0:s.children}))},ul:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("ul",e.__assign({className:a.default.unorderedList,style:null==L?void 0:L.ulist},{children:null==t?void 0:t.children}))},table:function(i){var t=i.children;return n.jsx("div",e.__assign({className:a.default.tableWrapper},{children:n.jsx("table",e.__assign({className:a.default.table,style:null==L?void 0:L.table},{children:t}))}))},tr:function(e){var i=e.node,t=e.children;return n.jsx(q,{node:i,children:t,customStyles:L})},td:function(i){var t,o=i.node,a=i.children,l=null!==(t=null==o?void 0:o.properties)&&void 0!==t?t:{},r=l.style,s=e.__rest(l,["style"]);return n.jsx(b.Provider,e.__assign({value:!0},{children:n.jsx("td",e.__assign({},s,{style:r?{cssText:r}:void 0},{children:a}))}))},th:function(i){var t,o=i.node,a=i.children,l=null!==(t=null==o?void 0:o.properties)&&void 0!==t?t:{},r=l.style,s=e.__rest(l,["style"]);return n.jsx(b.Provider,e.__assign({value:!0},{children:n.jsx("th",e.__assign({},s,{style:r?{cssText:r}:void 0},{children:a}))}))},recommendation:function(i){var t;i.node;var o=e.__rest(i,["node"]),a="The AI has selected this content based on: ".concat((null===(t=null==o?void 0:o.children)||void 0===t?void 0:t[0])||"");return n.jsx(m.default,e.__assign({},o,{customStyles:null==L?void 0:L.recommendationBlock,label:a}))},a:function(t){var o,a,l;t.inline,t.children,t.node;var r=e.__rest(t,["inline","children","node"]),s=i.useContext(b)||"true"==(null==r?void 0:r.table),d="".concat(null==r?void 0:r.href),c=null===(o=d.split("$"))||void 0===o?void 0:o[0],u=null===(a=d.split("$"))||void 0===a?void 0:a[1];if("ai_reasoning"===c){var g=(null!==(l=A?D:ee)&&void 0!==l?l:[]).find(function(e){return e.id.toString()===decodeURIComponent(u)}),v=oe.includes(u);if(g)return s?n.jsx(k,{aiReason:g,customStyle:null==L?void 0:L.tableAiReasoning,customIcons:re,isHighConfidence:g.relevance_score>=h.SHOW_CONFIDENCE_SCORE_THRESHOLD_IN_AI_REASONING}):n.jsx(h.default,{aiReason:g,isSourceHasHighlight:v,customIcons:re,customStyles:{aiReasoningContent:null==L?void 0:L.aiReasoningContent,aiReasoningAccordion:null==L?void 0:L.aiReasoningAccordion,aiReasoningMarkdown:null==L?void 0:L.aiReasoningMarkdown,aiReasoningPill:null==L?void 0:L.aiReasoningPill,webCitation:null==L?void 0:L.webCitation,stormeeCitation:null==L?void 0:L.stormeeCitation,waveformCitation:null==L?void 0:L.waveformCitation,imageCitation:null==L?void 0:L.imageCitation,fileCitation:null==L?void 0:L.fileCitation,appModCitation:null==L?void 0:L.appModCitation,rcaCitation:null==L?void 0:L.rcaCitation,readFileCitation:null==L?void 0:L.readFileCitation,loadingCitations:null==L?void 0:L.loadingCitations,chatCitation:null==L?void 0:L.chatCitation,bigEnoughCitation:null==L?void 0:L.bigEnoughCitation}})}return null},code:function(i){i.inline;var t=i.children,o=i.className;return i.node,e.__rest(i,["inline","children","className","node"]),/language-(\w+)/.exec(o||"")||(null==o?void 0:o.includes("language-"))?n.jsx("div",{children:n.jsx("code",e.__assign({className:a.default.blockCode,style:null==L?void 0:L.code},{children:t}))}):n.jsx("code",e.__assign({className:a.default.inlineCode,style:null==L?void 0:L.code},{children:t}))},learned:function(i){var t=i.children;return n.jsx(s.Tooltip,e.__assign({title:t,placement:"top"},{children:n.jsx(r.Info,{size:16,className:a.default.learned})}))},generatedcode:function(i){i.node;var t=e.__rest(i,["node"]),o=(null==t?void 0:t.language)||"python",a=function(e){var n="";try{if(e["data-raw"])n=decodeURIComponent(atob(e["data-raw"]));else{var i=function(e){var n;return"string"==typeof e?e:Array.isArray(e)?e.map(i).join(""):(null===(n=null==e?void 0:e.props)||void 0===n?void 0:n.children)?i(e.props.children):""};n=i(e.children)}}catch(i){console.error("Error decoding generated code:",i),n=String(e.children)}return n}(t);return n.jsx(c.default,{title:"Generated Code",code:a,language:o,customStyles:{pill:null==L?void 0:L.generatedCodePill,content:null==L?void 0:L.generatedCodeContent}})},updatedsegment:function(i){var t,o,a,l,r=i.node,s=i.children,d=e.__rest(i,["node","children"]),c="".concat(null===(t=r.position)||void 0===t?void 0:t.start.line,"-").concat(null===(o=r.position)||void 0===o?void 0:o.start.column,"-").concat(null===(a=r.position)||void 0===a?void 0:a.end.line,"-").concat(null===(l=r.position)||void 0===l?void 0:l.end.column);return n.jsx(j.default,{id:c,node:r,children:s,props:d,segmentComponentConfig:le,customStyles:L,customIcons:$,extractText:Se,isUpdatedSegment:!0})},segment:function(i){var t,o,a,l,r=i.node,s=i.children,d=e.__rest(i,["node","children"]),c="".concat(null===(t=r.position)||void 0===t?void 0:t.start.line,"-").concat(null===(o=r.position)||void 0===o?void 0:o.start.column,"-").concat(null===(a=r.position)||void 0===a?void 0:a.end.line,"-").concat(null===(l=r.position)||void 0===l?void 0:l.end.column);return n.jsx(j.default,{id:c,node:r,children:s,props:d,segmentComponentConfig:le,customStyles:L,customIcons:$,extractText:Se})}}},[je,z,ee,H,ge,A,v,$,te,oe,L,le]);return i.useEffect(function(){if(Q.current){if(te.length){var e;if(0===oe.length||G)requestAnimationFrame(function(){de([te[ae].replace(/\*/g,"")])});else{var n=Q.current,i=new MutationObserver(function(){clearTimeout(e),e=setTimeout(function(){i.disconnect(),requestAnimationFrame(function(){de([te[ae].replace(/\*/g,"")])})},50)});i.observe(n,{childList:!0,subtree:!0})}return function(){clearTimeout(e)}}ce()}},[te,oe,ae,G]),i.useEffect(function(){return console.log("mounting userstorywithcitation"),function(){console.log("unmounting userstorywithcitation")}},[]),n.jsx(N.Provider,e.__assign({value:{expandedInfo:he,setExpanded:Ce,reasonToRow:me}},{children:n.jsxs("div",e.__assign({ref:Q,className:"".concat(a.default.container," ").concat("approving"!==_?a.default.wrapper:""," ").concat(P||""),style:null==L?void 0:L.container},{children:[n.jsx(y.MarkdownContextProvider,{children:n.jsx(I.default,e.__assign({components:we,rehypePlugins:[w.default]},{children:Ie}))}),_e>0&&n.jsx("div",e.__assign({className:a.default.confidenceScoreContainer,style:null==L?void 0:L.confidenceScoreContainer},{children:n.jsxs("span",e.__assign({className:a.default.confidenceScore,style:null==L?void 0:L.confidenceScore},{children:[n.jsx(p.default,{size:14,color:(null==L?void 0:L.confidenceScoreIconColor)||"#166534"}),_e,"%"]}))})),M&&n.jsx("div",e.__assign({className:a.default.citationLoader,style:null==L?void 0:L.citationLoaderContainer},{children:n.jsx(u.default,{customStyles:{container:null==L?void 0:L.citationLoadingContainer,icon:null==L?void 0:L.citationLoadingIcon,text:null==L?void 0:L.citationLoadingText}})})),f&&n.jsx("div",e.__assign({style:e.__assign({},null===(o=null==L?void 0:L.attachedContext)||void 0===o?void 0:o.wrapper),className:"flex mt-5"},{children:n.jsx(C.default,{customStyles:null==L?void 0:L.attachedContext})}))]}))}))};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),t=require("react-markdown"),o=require("rehype-raw"),a=require("./UserStoryWithCitation.module.css.js"),l=require("../../shared/useMarkdownSearch.js"),r=require("lucide-react"),s=require("@mui/material"),d=require("../../shared/UpdatedAnimationContent.js"),c=require("../../shared/GeneratedCodeCitation.js"),u=require("../../shared/CitationLoadingIndicator.js"),g=require("../RequirementAIWrapper/RequirementAIWrapper.js"),v=require("../../icons/CognitiveDecision.js"),f=require("../../icons/BrainRed.js"),p=require("../ai-reasoning/AiReasoningCitation.js"),h=require("../../icons/RelevanceScoreIcon.js"),m=require("../RecommendationBlock/RecommendationBlock.js"),C=require("../UserStoryCard/AttachedContext.js"),_=require("../ai-reasoning/AiReasoningCitationContent.js"),x=require("./components/InlineUpdatedComponent.js"),j=require("../segment/SegmentWrapper.js"),y=require("../../store/markdown-context.js");function S(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var R=S(i),I=S(t),w=S(o),b=i.createContext(!1),N=i.createContext({expandedInfo:null,setExpanded:function(){},reasonToRow:{current:new Map}}),k=i.createContext({rowId:""}),A=function(t){var o,l=t.aiReason,r=t.isHighConfidence,s=t.customStyle,d=t.customIcons,c=i.useContext(N),u=c.expandedInfo,g=c.setExpanded,p=c.reasonToRow,h=i.useContext(k).rowId,m=String(l.id);h&&p.current.set(m,h);var C=(null===(o=null==u?void 0:u.aiReason)||void 0===o?void 0:o.id)===l.id,_=r?(null==d?void 0:d.highConfidence)||n.jsx(v.default,{}):(null==d?void 0:d.lowConfidence)||n.jsx(f.default,{});return n.jsxs("button",e.__assign({className:a.default.aiReasoningButton,style:s,onClick:function(e){e.stopPropagation(),e.preventDefault(),g(C?null:h,C?null:l)}},{children:[_,C?n.jsx("i",{className:"pi pi-angle-up ".concat(r?a.default.aiReasoningIconHighConfidence:a.default.aiReasoningIconLowConfidence)}):n.jsx("i",{className:"pi pi-angle-down ".concat(r?a.default.aiReasoningIconHighConfidence:a.default.aiReasoningIconLowConfidence)})]}))},q=function(t){var o,l,r=t.children,s=t.node,d=t.customStyles,c=t.customIcons,u=i.useRef(Math.random().toString(36).slice(2)).current,g=i.useContext(N).expandedInfo,v=(null==g?void 0:g.rowId)===u,f=Array.isArray(null==s?void 0:s.children)?s.children.filter(function(e){return"element"===e.type}).length:1,p=null!==(l=null===(o=null==s?void 0:s.properties)||void 0===o?void 0:o.style)&&void 0!==l?l:void 0;return n.jsxs(k.Provider,e.__assign({value:{rowId:u}},{children:[n.jsx("tr",e.__assign({style:p?{cssText:p}:void 0},{children:r})),v&&(null==g?void 0:g.aiReason)&&n.jsx("tr",e.__assign({style:{width:"100%"}},{children:n.jsx("td",e.__assign({colSpan:f||1,className:a.default.tableExpandedCell},{children:n.jsx("div",e.__assign({className:a.default.tableExpandedCellInner},{children:n.jsx("div",e.__assign({className:a.default.tableExpandedCellContent},{children:n.jsx(_.default,{aiReason:g.aiReason,customIcons:c,customStyles:{aiReasoningContent:null==d?void 0:d.aiReasoningContent,aiReasoningAccordion:null==d?void 0:d.aiReasoningAccordion,aiReasoningMarkdown:null==d?void 0:d.aiReasoningMarkdown,aiReasoningPill:null==d?void 0:d.aiReasoningPill,webCitation:null==d?void 0:d.webCitation,stormeeCitation:null==d?void 0:d.stormeeCitation,waveformCitation:null==d?void 0:d.waveformCitation,imageCitation:null==d?void 0:d.imageCitation,fileCitation:null==d?void 0:d.fileCitation,appModCitation:null==d?void 0:d.appModCitation,rcaCitation:null==d?void 0:d.rcaCitation,readFileCitation:null==d?void 0:d.readFileCitation,loadingCitations:null==d?void 0:d.loadingCitations,chatCitation:null==d?void 0:d.chatCitation}})}))}))}))}))]}))};var E=["del","ins"];function M(e){return function(e,n,i){var t=n.join("|");return e.replace(new RegExp("<(".concat(t,")>([\\s\\S]*?)<\\/\\1>"),"gi"),function(e,n,t){return"<".concat(n,">").concat(i(t),"</").concat(n,">")})}(e,E,function(e){return e.split(/(<[^>]+>)/g).map(function(e){return!e||/^<[^>]+>$/.test(e)?e:function(e){if(!e)return e;var n=[];return e.replace(/`([^`\n]+)`/g,function(e,i){var t=n.push(i)-1;return"@@CODE_SPAN_".concat(t,"@@")}).replace(/\*\*([\s\S]+?)\*\*/g,"<strong>$1</strong>").replace(/__([\s\S]+?)__/g,"<strong>$1</strong>").replace(/@@CODE_SPAN_(\d+)@@/g,function(e,i){var t,o=null!==(t=n[Number(i)])&&void 0!==t?t:"";return"<code>".concat(o.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),"</code>")})}(e)}).join("")})}exports.default=function(t){var o,v=t.message,f=t.noMarkdownContent,_=t.useMarkdown,S=void 0===_||_,k=t.isParent,E=t.scenario,T=t.showUserStoryDiff,U=void 0!==T&&T,P=t.aiReasoningsForBlock,L=t.isCitationLoadingDisplay,$=void 0!==L&&L,D=t.className;t.highConfidenceIcon,t.lowConfidenceIcon;var H=t.customStyles,O=t.customIcons,F=t.aiReasoningDiffView,B=t.userStoryCitations,W=t.artifactId,z=t.isCraflow,V=t.onCraAccept,G=t.onCraReject,Q=t.craFlowConfig,J=t.isDisplayHighlightControl,K=void 0!==J&&J,X=i.useRef(null),Y=g.useRequirementAI(),Z=Y.userStory,ee=Y.inlineUpdateComponentConfig,ne=Y.getAvgScoreForStory,ie=Y.setUserStory,te=Y.aiReasoning,oe=Y.setAiReasoning,ae=Y.customIcons,le=Y.searchQueryList,re=Y.searchQueryReasoningIdList,se=Y.currentHighlightIndex,de=Y.segmentComponentConfig,ce=null!=O?O:null==ae?void 0:ae.userStoryIcons;null==H||H.searchHighlight;var ue=l.useMarkdownSearch(X),ge=ue.search,ve=ue.clear,fe=i.useState("1"),pe=fe[0],he=fe[1],me=i.useState(null),Ce=me[0],_e=me[1],xe=i.useRef(new Map),je=i.useCallback(function(e,n){_e(e&&n?{rowId:e,aiReason:n}:null)},[]),ye=W?ne(W):0,Se=i.useState([]),Re=Se[0],Ie=Se[1],we=function(e){return null==e?"":"string"==typeof e?e:"number"==typeof e?String(e):Array.isArray(e)?e.map(we).join(""):R.default.isValidElement(e)?we(e.props.children):""},be=function(e){var n=e;return n=function(e){for(var n,i=/<updated[^>]*>[\s\S]*?<\/updated>/gi,t=[],o=new RegExp(i.source,i.flags);null!==(n=o.exec(e));){var a=n[0],l=a.match(/<deleted>([\s\S]*?)<\/deleted>/i),r=a.match(/<changed>([\s\S]*?)<\/changed>/i),s=function(e){return(e.match(/^\s*\d+\.\s/gm)||[]).length};t.push({index:n.index,endIndex:n.index+n[0].length,deletedItemCount:s((null==l?void 0:l[1])||""),changedItemCount:s((null==r?void 0:r[1])||"")})}if(0===t.length)return e;for(var d=e,c=function(e){var n=t[e],i=n.changedItemCount-n.deletedItemCount;if(0===i)return"continue";for(var o=!1,a=0,l=d.substring(0,n.index).split("\n").reverse();a<l.length;a++){var r=l[a].trim();if(""!==r){/^\d+\.\s/.test(r)&&(o=!0);break}}if(!o)return"continue";var s=n.endIndex,c=e+1<t.length?t[e+1].index:d.length,u=d.substring(s,c);u=u.replace(/^(\s*)(\d+)\.\s/gm,function(e,n,t){return"".concat(n).concat(parseInt(t,10)+i,". ")}),d=d.substring(0,s)+u+d.substring(c)},u=t.length-1;u>=0;u--)c(u);return d}(n=(n=(n=(n=(n=n.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,function(e,n){var i=n.replace(/ai_reasoning\$(\d+)/g,function(e,n){return"ai_reasoning$".concat(n,"-legacy")});return"<deleted>".concat(i,"</deleted>")})).replace(/<generatedCode([^>]*)>([\s\S]*?)<\/generatedCode>/gi,function(e,n,i){var t=btoa(encodeURIComponent(i.trim()));return"\n\n<generatedCode".concat(n,' data-raw="').concat(t,'"></generatedCode>\n\n')})).replace(/^(\s*[-*]|\s*\d+\.)\s*\n?\s*(<updated\b)/gm,"$1 $2")).replace(/(<segment\b([^>]*)>)([\s\S]*?)(<\/segment>)/gi,function(e,n,i,t,o){var a=t.match(/<table[\s\S]*?<\/table>/i);if(a){var l=btoa(encodeURIComponent(a[0]));return"<segment".concat(i,' data-table="').concat(l,'"></segment>')}return e})).replace(/<updated([^>]*)>([\s\S]*?)<\/updated>/gi,function(e,i,t,o){var a=n.substring(0,o),l=a.lastIndexOf("\n"),r=/^\s+[-*]\s/.test(a.substring(l+1))||/^\s+\d+\.\s/.test(a.substring(l+1)),s=/^\s*(\d+\.|\s*[-*])\s+$/.test(a.substring(l+1));if(r||s){var d=t;return d=(d=(d=(d=d.replace(/(<deleted>)\s*\n?\s*[-*]\s+/gi,"$1\n")).replace(/(<changed>)\s*\n?\s*[-*]\s+/gi,"$1\n")).replace(/(<deleted>)\s*\n?\s*\d+\.\s+/gi,"$1\n")).replace(/(<changed>)\s*\n?\s*\d+\.\s+/gi,"$1\n"),"<updated".concat(i,">").concat(d,"</updated>")}return e})),n=function(e){var n=e.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,function(e,n){var i=n.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <deleted>",{hadChange:i!==n}),"<deleted>".concat(i,"</deleted>")});return n.replace(/<changed>([\s\S]*?)<\/changed>/gi,function(e,n){var i=n.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <changed>",{hadChange:i!==n,preview:n.substring(0,120)}),"<changed>".concat(i,"</changed>")})}(n),n=M(n)},Ne=i.useMemo(function(){return v?be(v):v},[v]);i.useEffect(function(){Ie(P||te)},[P,te]);var ke=i.useMemo(function(){return{upt:function(i){var t;i.node;var o=i.children,a=e.__rest(i,["node","children"]),l=null==a?void 0:a.id,r=l?null===(t=l.split("$"))||void 0===t?void 0:t[1]:null,s=te.find(function(e){return e.id.toString()===r});return s?n.jsx(x.default,e.__assign({aiReason:s,customStyles:null==H?void 0:H.inlineUpdatedComponent,handleClickCognitiveDecision:null==ee?void 0:ee.handleClickCognitiveDecision,handleClickUpdatedPill:null==ee?void 0:ee.handleClickUpdatedPill,handleClickOutputValue:null==ee?void 0:ee.handleClickOutputValue,customIcons:null==ee?void 0:ee.customIcons},{children:o})):o},del:function(i){i.node;var t=i.children,o=e.__rest(i,["node","children"]);return n.jsx("span",e.__assign({className:a.default.deleted,style:null==H?void 0:H.deleted},o,{onClick:o.onclick},{children:t}))},ins:function(i){var t=i.children,o=e.__rest(i,["children"]);return n.jsx("span",e.__assign({className:a.default.inserted,style:null==H?void 0:H.inserted},o,{onClick:o.onclick},{children:t}))},preserved:function(i){var t=i.children,o=e.__rest(i,["children"]);return n.jsx("span",e.__assign({className:a.default.preserved,style:null==H?void 0:H.preserved},o,{onClick:o.onclick},{children:t}))},h1:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("h1",e.__assign({className:a.default.heading1,style:null==H?void 0:H.heading1},{children:t.children}))},h2:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("h2",e.__assign({className:a.default.heading2,style:null==H?void 0:H.heading2},{children:t.children}))},h3:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("h3",e.__assign({className:a.default.heading3,style:null==H?void 0:H.heading3},{children:t.children}))},b:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("b",e.__assign({className:a.default.bold,style:null==H?void 0:H.bold},{children:null==t?void 0:t.children}))},p:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("p",e.__assign({},t,{className:a.default.paragraph,style:null==H?void 0:H.paragraph},{children:t.children}))},updated:function(i){var t=i.node,o=e.__rest(i,["node"]);return n.jsx(d.default,e.__assign({},o,{showUserStoryDiff:U,currentUpdatedTagId:pe,setCurrentUpdatedTagId:he,userStory:Z,setUserStory:ie,setAiReasoning:oe,node:t,isCraflow:z,onCraAccept:V,onCraReject:G,customStyles:null==H?void 0:H.updatedContent,craFlowConfig:Q}))},ol:function(i){var t,o,l,r=i.node,s=e.__rest(i,["node"]),d=null!==(l=null!==(o=null===(t=null==r?void 0:r.properties)||void 0===t?void 0:t.start)&&void 0!==o?o:null==s?void 0:s.start)&&void 0!==l?l:void 0;return n.jsx("ol",e.__assign({className:a.default.orderedList,style:null==H?void 0:H.olist},d?{start:Number(d)}:{},{children:null==s?void 0:s.children}))},ul:function(i){i.node;var t=e.__rest(i,["node"]);return n.jsx("ul",e.__assign({className:a.default.unorderedList,style:null==H?void 0:H.ulist},{children:null==t?void 0:t.children}))},table:function(i){var t=i.children;return n.jsx("div",e.__assign({className:a.default.tableWrapper},{children:n.jsx("table",e.__assign({className:a.default.table,style:null==H?void 0:H.table},{children:t}))}))},tr:function(e){var i=e.node,t=e.children;return n.jsx(q,{node:i,children:t,customStyles:H})},td:function(i){var t,o=i.node,a=i.children,l=null!==(t=null==o?void 0:o.properties)&&void 0!==t?t:{},r=l.style,s=e.__rest(l,["style"]);return n.jsx(b.Provider,e.__assign({value:!0},{children:n.jsx("td",e.__assign({},s,{style:r?{cssText:r}:void 0},{children:a}))}))},th:function(i){var t,o=i.node,a=i.children,l=null!==(t=null==o?void 0:o.properties)&&void 0!==t?t:{},r=l.style,s=e.__rest(l,["style"]);return n.jsx(b.Provider,e.__assign({value:!0},{children:n.jsx("th",e.__assign({},s,{style:r?{cssText:r}:void 0},{children:a}))}))},recommendation:function(i){var t;i.node;var o=e.__rest(i,["node"]),a="The AI has selected this content based on: ".concat((null===(t=null==o?void 0:o.children)||void 0===t?void 0:t[0])||"");return n.jsx(m.default,e.__assign({},o,{customStyles:null==H?void 0:H.recommendationBlock,label:a}))},a:function(t){var o,a,l;t.inline,t.children,t.node;var r=e.__rest(t,["inline","children","node"]),s=i.useContext(b)||"true"==(null==r?void 0:r.table),d="".concat(null==r?void 0:r.href),c=null===(o=d.split("$"))||void 0===o?void 0:o[0],u=null===(a=d.split("$"))||void 0===a?void 0:a[1];if("ai_reasoning"===c){var g=(null!==(l=U?F:te)&&void 0!==l?l:[]).find(function(e){return e.id.toString()===decodeURIComponent(u)}),v=re.includes(u);if(g)return s?n.jsx(A,{aiReason:g,customStyle:null==H?void 0:H.tableAiReasoning,customIcons:ce,isHighConfidence:g.relevance_score>=p.SHOW_CONFIDENCE_SCORE_THRESHOLD_IN_AI_REASONING}):n.jsx(p.default,{aiReason:g,isSourceHasHighlight:v,customIcons:ce,customStyles:{aiReasoningContent:null==H?void 0:H.aiReasoningContent,aiReasoningAccordion:null==H?void 0:H.aiReasoningAccordion,aiReasoningMarkdown:null==H?void 0:H.aiReasoningMarkdown,aiReasoningPill:null==H?void 0:H.aiReasoningPill,webCitation:null==H?void 0:H.webCitation,stormeeCitation:null==H?void 0:H.stormeeCitation,waveformCitation:null==H?void 0:H.waveformCitation,imageCitation:null==H?void 0:H.imageCitation,fileCitation:null==H?void 0:H.fileCitation,appModCitation:null==H?void 0:H.appModCitation,rcaCitation:null==H?void 0:H.rcaCitation,readFileCitation:null==H?void 0:H.readFileCitation,loadingCitations:null==H?void 0:H.loadingCitations,chatCitation:null==H?void 0:H.chatCitation,bigEnoughCitation:null==H?void 0:H.bigEnoughCitation}})}return null},code:function(i){i.inline;var t=i.children,o=i.className;return i.node,e.__rest(i,["inline","children","className","node"]),/language-(\w+)/.exec(o||"")||(null==o?void 0:o.includes("language-"))?n.jsx("div",{children:n.jsx("code",e.__assign({className:a.default.blockCode,style:null==H?void 0:H.code},{children:t}))}):n.jsx("code",e.__assign({className:a.default.inlineCode,style:null==H?void 0:H.code},{children:t}))},learned:function(i){var t=i.children;return n.jsx(s.Tooltip,e.__assign({title:t,placement:"top"},{children:n.jsx(r.Info,{size:16,className:a.default.learned})}))},generatedcode:function(i){i.node;var t=e.__rest(i,["node"]),o=(null==t?void 0:t.language)||"python",a=function(e){var n="";try{if(e["data-raw"])n=decodeURIComponent(atob(e["data-raw"]));else{var i=function(e){var n;return"string"==typeof e?e:Array.isArray(e)?e.map(i).join(""):(null===(n=null==e?void 0:e.props)||void 0===n?void 0:n.children)?i(e.props.children):""};n=i(e.children)}}catch(i){console.error("Error decoding generated code:",i),n=String(e.children)}return n}(t);return n.jsx(c.default,{title:"Generated Code",code:a,language:o,customStyles:{pill:null==H?void 0:H.generatedCodePill,content:null==H?void 0:H.generatedCodeContent}})},updatedsegment:function(i){var t,o,a,l,r=i.node,s=i.children,d=e.__rest(i,["node","children"]),c="".concat(null===(t=r.position)||void 0===t?void 0:t.start.line,"-").concat(null===(o=r.position)||void 0===o?void 0:o.start.column,"-").concat(null===(a=r.position)||void 0===a?void 0:a.end.line,"-").concat(null===(l=r.position)||void 0===l?void 0:l.end.column);return n.jsx(j.default,{id:c,node:r,children:s,props:d,segmentComponentConfig:de,customStyles:H,customIcons:O,extractText:we,isUpdatedSegment:!0})},segment:function(i){var t,o,a,l,r=i.node,s=i.children,d=e.__rest(i,["node","children"]),c="".concat(null===(t=r.position)||void 0===t?void 0:t.start.line,"-").concat(null===(o=r.position)||void 0===o?void 0:o.start.column,"-").concat(null===(a=r.position)||void 0===a?void 0:a.end.line,"-").concat(null===(l=r.position)||void 0===l?void 0:l.end.column);return n.jsx(j.default,{id:c,node:r,children:s,props:d,segmentComponentConfig:de,customStyles:H,customIcons:O,extractText:we})}}},[Re,Q,te,B,pe,U,v,O,le,re,H,de]);return i.useEffect(function(){if(X.current){if(le.length){var e;if(0===re.length||K)requestAnimationFrame(function(){ge([le[se].replace(/\*/g,"")])});else{var n=X.current,i=new MutationObserver(function(){clearTimeout(e),e=setTimeout(function(){i.disconnect(),requestAnimationFrame(function(){ge([le[se].replace(/\*/g,"")])})},50)});i.observe(n,{childList:!0,subtree:!0})}return function(){clearTimeout(e)}}ve()}},[le,re,se,K]),n.jsx(N.Provider,e.__assign({value:{expandedInfo:Ce,setExpanded:je,reasonToRow:xe}},{children:n.jsxs("div",e.__assign({ref:X,className:"".concat(a.default.container," ").concat("approving"!==E?a.default.wrapper:""," ").concat(D||""),style:null==H?void 0:H.container},{children:[S?n.jsx(y.MarkdownContextProvider,{children:n.jsx(I.default,e.__assign({components:ke,rehypePlugins:[w.default]},{children:Ne}))}):f,ye>0&&n.jsx("div",e.__assign({className:a.default.confidenceScoreContainer,style:null==H?void 0:H.confidenceScoreContainer},{children:n.jsxs("span",e.__assign({className:a.default.confidenceScore,style:null==H?void 0:H.confidenceScore},{children:[n.jsx(h.default,{size:14,color:(null==H?void 0:H.confidenceScoreIconColor)||"#166534"}),ye,"%"]}))})),$&&n.jsx("div",e.__assign({className:a.default.citationLoader,style:null==H?void 0:H.citationLoaderContainer},{children:n.jsx(u.default,{customStyles:{container:null==H?void 0:H.citationLoadingContainer,icon:null==H?void 0:H.citationLoadingIcon,text:null==H?void 0:H.citationLoadingText}})})),k&&n.jsx("div",e.__assign({style:e.__assign({},null===(o=null==H?void 0:H.attachedContext)||void 0===o?void 0:o.wrapper),className:"flex mt-5"},{children:n.jsx(C.default,{customStyles:null==H?void 0:H.attachedContext})}))]}))}))};
|
|
2
2
|
//# sourceMappingURL=UserStoryWithCitation.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e={"cite-acc":"CitationComponent-module_cite-acc__2XusN","cite-acc__header":"CitationComponent-module_cite-acc__header__Ek-ou","cite-acc__headerLeft":"CitationComponent-module_cite-acc__headerLeft__K6ItR","cite-acc__titleIcon":"CitationComponent-module_cite-acc__titleIcon__ssoL-","cite-acc__title":"CitationComponent-module_cite-acc__title__3ibjn","cite-acc__headerRight":"CitationComponent-module_cite-acc__headerRight__OhMqH","cite-acc__gapBadge":"CitationComponent-module_cite-acc__gapBadge__VkuKQ","cite-acc__scoreBadge":"CitationComponent-module_cite-acc__scoreBadge__uVDRv","cite-acc__scoreIcon":"CitationComponent-module_cite-acc__scoreIcon__-MUli","cite-acc__scoreText":"CitationComponent-module_cite-acc__scoreText__42VsL","cite-acc__toggleBtn":"CitationComponent-module_cite-acc__toggleBtn__RcZmg","cite-acc__body":"CitationComponent-module_cite-acc__body__YQDAm","cite-acc__explain-body":"CitationComponent-module_cite-acc__explain-body__1v7hb","cite-acc__explain-body_border":"CitationComponent-module_cite-acc__explain-body_border__QQnDb","cite-acc__innerHeader":"CitationComponent-module_cite-acc__innerHeader__BFwFr","cite-acc__backHeader":"CitationComponent-module_cite-acc__backHeader__aFHVT","cite-acc__backBtn":"CitationComponent-module_cite-acc__backBtn__d91ol","cite-acc__backTitle":"CitationComponent-module_cite-acc__backTitle__Jwdr9","cite-acc__cognitiveSection":"CitationComponent-module_cite-acc__cognitiveSection__eVNry","cite-acc__cognitiveTitle":"CitationComponent-module_cite-acc__cognitiveTitle__LXmhU","cite-acc__innerHeaderLeft":"CitationComponent-module_cite-acc__innerHeaderLeft__uY1Et","cite-acc__innerIcon":"CitationComponent-module_cite-acc__innerIcon__UvlXX","cite-acc__innerTitle":"CitationComponent-module_cite-acc__innerTitle__Lv8vo","cite-acc__innerSub":"CitationComponent-module_cite-acc__innerSub__XG7ad","cite-acc__innerToggle":"CitationComponent-module_cite-acc__innerToggle__3YHI5","cite-acc__innerBody":"CitationComponent-module_cite-acc__innerBody__Bzkt4","cite-text__mark":"CitationComponent-module_cite-text__mark__Xh6wV","cite-text__a":"CitationComponent-module_cite-text__a__9HVV6","cite-text__a-btn":"CitationComponent-module_cite-text__a-btn__9XyA1","cite-text__a-btn_circle":"CitationComponent-module_cite-text__a-btn_circle__SI-j3","cite-text__a-btn_chevron":"CitationComponent-module_cite-text__a-btn_chevron__DXtkI","cite-text__a-btn_open":"CitationComponent-module_cite-text__a-btn_open__2NfoX",spin:"CitationComponent-module_spin__W-F7a","cite-text__a-container":"CitationComponent-module_cite-text__a-container__G-ier","cite-text__a-container-docs":"CitationComponent-module_cite-text__a-container-docs__n8qlA","cite-text__a-container-loader":"CitationComponent-module_cite-text__a-container-loader__f0Exm","md-ol":"CitationComponent-module_md-ol__TO-dB","md-ul":"CitationComponent-module_md-ul__LfZPA","md-li":"CitationComponent-module_md-li__ZEscN","cite-acc__btn-container":"CitationComponent-module_cite-acc__btn-container__RUjvL","btn-accept":"CitationComponent-module_btn-accept__F5s10","btn-reject":"CitationComponent-module_btn-reject__ziZa-"};!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const t=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;t&&e.setAttribute("nonce",t),e.appendChild(document.createTextNode('.CitationComponent-module_cite-acc__2XusN{background:#fff;border:1px solid #eaecf0;border-radius:12px;box-sizing:border-box;container-type:inline-size;max-height:500px;overflow:auto;width:400px}.CitationComponent-module_cite-acc__header__Ek-ou{align-items:center;border-bottom:1px solid #eaecf0;border-top:1px solid #eaecf0;display:flex;flex-wrap:nowrap;gap:12px;justify-content:space-between;min-width:0;padding:12px}.CitationComponent-module_cite-acc__headerLeft__K6ItR{align-items:center;display:flex;flex:1 1 auto;gap:4px;min-width:0;overflow:hidden}.CitationComponent-module_cite-acc__titleIcon__ssoL-{align-items:center;display:inline-flex;flex:0 0 28px;height:28px;justify-content:center;width:28px}.CitationComponent-module_cite-acc__title__3ibjn{color:#101828;font-size:14px;font-weight:500;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.CitationComponent-module_cite-acc__headerRight__OhMqH{align-items:center;display:flex;flex:0 0 auto;flex-wrap:nowrap;gap:10px;min-width:0}.CitationComponent-module_cite-acc__gapBadge__VkuKQ{background:#fef3f2;border-radius:999px;color:#b42318;font-size:12px;font-weight:500;padding:4px 10px;white-space:nowrap}.CitationComponent-module_cite-acc__scoreBadge__uVDRv{align-items:center;border:1px solid var(--Primitive-Gray-300,#d0d5dd);border-radius:var(--chip-border-radius,16px);display:flex;gap:4px;padding:4px 8px}.CitationComponent-module_cite-acc__scoreIcon__-MUli{display:none}.CitationComponent-module_cite-acc__scoreText__42VsL{color:var(--Primitive-Purple-600,#6938ef);font-family:Inter;font-size:12px;font-style:normal;font-weight:500;line-height:150%}.CitationComponent-module_cite-acc__gapBadge__VkuKQ,.CitationComponent-module_cite-acc__scoreBadge__uVDRv{flex:0 1 auto;min-width:0}.CitationComponent-module_cite-acc__toggleBtn__RcZmg{align-items:center;background:#0000;border:none;cursor:pointer;display:inline-flex;flex:0 0 auto;justify-content:center;padding:4px}.CitationComponent-module_cite-acc__toggleBtn__RcZmg i{color:#667085;font-size:18px}.CitationComponent-module_cite-acc__body__YQDAm{display:flex;flex-direction:column;gap:12px;min-width:0;padding:20px}.CitationComponent-module_cite-acc__explain-body__1v7hb{display:flex;flex-direction:column;gap:"14px";min-width:0;padding:15px}.CitationComponent-module_cite-acc__explain-body_border__QQnDb{border-top:1px solid #eaecf0}.CitationComponent-module_cite-acc__innerHeader__BFwFr{align-items:center;background:#0000;display:flex;gap:12px;justify-content:space-between;min-width:0}.CitationComponent-module_cite-acc__backHeader__aFHVT{align-items:center;border-bottom:.5px solid #e8e7e3;display:flex;gap:8px;padding:14px 16px}.CitationComponent-module_cite-acc__backBtn__d91ol{background:none;border:none;color:#888;cursor:pointer;font-size:20px;line-height:1;padding:0}.CitationComponent-module_cite-acc__backTitle__Jwdr9{color:#1a1a1a;font-size:14px;font-weight:500}.CitationComponent-module_cite-acc__cognitiveSection__eVNry{align-items:center;border-bottom:none;border-top:1px solid #eee;cursor:pointer;display:flex;justify-content:space-between;padding-left:12px;padding-right:12px;padding-top:12px}.CitationComponent-module_cite-acc__cognitiveTitle__LXmhU{color:#101828;font-size:13px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.CitationComponent-module_cite-acc__innerHeaderLeft__uY1Et{align-items:flex-start;display:flex;flex:1 1 auto;gap:10px;min-width:0}.CitationComponent-module_cite-acc__innerIcon__UvlXX{align-items:center;background:#f4f3ff;border-radius:999px;display:inline-flex;flex:0 0 28px;height:28px;justify-content:center;width:28px}.CitationComponent-module_cite-acc__innerTitle__Lv8vo{color:#101828;font-size:14px;font-weight:500;line-height:22px}.CitationComponent-module_cite-acc__innerSub__XG7ad{color:#101828;font-size:12px;line-height:18px;margin-top:2px}.CitationComponent-module_cite-acc__innerToggle__3YHI5{align-items:center;background:#fff;border:1px solid #eaecf0;border-radius:999px;cursor:pointer;display:inline-flex;flex:0 0 28px;height:28px;justify-content:center;width:28px}.CitationComponent-module_cite-acc__innerToggle__3YHI5 i{color:#667085;font-size:18px}.CitationComponent-module_cite-acc__innerBody__Bzkt4{border-top:none;min-width:0;overflow-wrap:anywhere;word-break:break-word}.CitationComponent-module_cite-text__mark__Xh6wV{background-color:#fef3c7;border-radius:4px;padding-left:4px;padding-right:4px}.CitationComponent-module_cite-text__a__9HVV6{display:inline}.CitationComponent-module_cite-text__a-btn__9XyA1{color:#7a5af8;cursor:pointer;display:inline;font-weight:500}.CitationComponent-module_cite-text__a-btn_chevron__DXtkI,.CitationComponent-module_cite-text__a-btn_circle__SI-j3{display:inline-block;margin-left:4px;vertical-align:middle}.CitationComponent-module_cite-text__a-btn_open__2NfoX{border:1px solid #7a5af8;border-radius:4px;padding-left:4px;padding-right:4px}.CitationComponent-module_cite-text__a-btn_circle__SI-j3{animation:CitationComponent-module_spin__W-F7a 1.5s linear infinite;color:#7a5af8;height:16px;margin-left:auto;margin-right:auto;width:16px}.CitationComponent-module_cite-text__a-btn_chevron__DXtkI{height:16px;width:16px}.CitationComponent-module_cite-text__a-container__G-ier{margin-bottom:8px;margin-top:8px;max-height:250px;overflow:scroll}.CitationComponent-module_cite-text__a-container-docs__n8qlA{margin-bottom:8px;margin-top:8px;max-height:620px;overflow:scroll}.CitationComponent-module_cite-text__a-container-loader__f0Exm{animation:CitationComponent-module_spin__W-F7a 1.5s linear infinite;color:#000;height:32px;margin-left:auto;margin-right:auto;width:32px}.CitationComponent-module_md-ol__TO-dB{list-style:decimal;list-style-position:outside;padding-left:20px}.CitationComponent-module_md-ul__LfZPA{list-style:disc;list-style-position:outside;margin:10px 0 12px;padding-left:20px}.CitationComponent-module_md-li__ZEscN{margin:6px 0}.CitationComponent-module_cite-acc__btn-container__RUjvL{align-items:center;display:flex;font-family:Inter;font-size:14px;font-style:normal;font-weight:500;gap:5px;line-height:normal;padding:0 30px 15px;.CitationComponent-module_btn-accept__F5s10{border:1px solid #8098f9;border-radius:6px;color:#444ce7;padding:7px 10.5px}.CitationComponent-module_btn-reject__ziZa-{border:1px solid #fecaca;border-radius:6px;color:#ef4444;padding:7px 10.5px}}@keyframes CitationComponent-module_spin__W-F7a{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@container (max-width: 420px){.CitationComponent-module_cite-acc__scoreIcon__-MUli{align-items:center;display:inline-flex}.CitationComponent-module_cite-acc__scoreBadge__uVDRv{gap:6px;padding:6px 8px}.CitationComponent-module_cite-acc__gapBadge__VkuKQ{padding:4px 8px}}'));const o=document.head||document.getElementsByTagName("head")[0]||document.documentElement;o&&o.appendChild(e)}();export{e as default};
|
|
2
|
+
//# sourceMappingURL=CitationComponent.module.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CitationComponent.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as c,jsx as i,Fragment as n}from"react/jsx-runtime";import t,{useMemo as a}from"react";import r from"../Popups/PopupDefaults.js";import o from"react-markdown";import l from"rehype-raw";import d from"./CitationComponent.module.css.js";import{ChevronUp as s}from"lucide-react";import{ReactComponent as m}from"../icons/cognitiveBrain.svg.js";import{ReactComponent as v}from"../icons/aiMagic.svg.js";import _ from"./CitationAnchor.js";var h=function(c){var n=c.text,t=c.item;return i(o,e({rehypePlugins:[l],components:{ol:function(c){var n=c.children;return i("ol",e({className:d["md-ol"]},{children:n}))},ul:function(c){var n=c.children;return i("ul",e({className:d["md-ul"]},{children:n}))},li:function(c){var n=c.children;return i("li",e({className:d["md-li"]},{children:n}))},a:function(e){e.node;var c=e.href,n=e.children;return i(_,{href:c,children:n,metaData:{citations:t.citations,docData:t.docData}})}}},{children:n.replace(/<br\s*\/?>/gi,"\n")}))};function p(o){var l=o.item,_=o.title,p=void 0===_?"Cognitive Decisioning AI":_,u=o.relevanceScore,N=void 0===u?0:u,f=o.showRelevanceScore,y=void 0===f||f,b=o.reason,x=void 0===b?"No reasoning provided.":b,g=o.impact,C=void 0===g?"No Impact provided.":g,k=o.explaination,H=void 0===k?"No explaination provided.":k,B=o.gap,j=void 0===B?"None":B,D=o.onClose,T=void 0===D?function(){}:D,A=o.onAccept,I=o.onReject,L=o.showResolveBtns,R=void 0!==L&&L,w=o.sections,P=o.leftIcon,M=o.scoreIcon,E=o.className,G=o.customStyles,S=void 0===G?{}:G,F=o.onBackClick,q=o.isImpactNeeded,z=void 0===q||q,J=o.cognitiveTitle,K=void 0===J?"Cognitive Integrity":J,O=o.labels,Q=void 0===O?{}:O,U=a(function(){var e=Number(N);return Number.isNaN(e)?0:Math.max(0,Math.min(100,Math.round(e)))},[N]),V=a(function(){var e=Q&&Q.noGapsText||"1. No gaps identified.";return function(e){if(!e)return!0;var c=e.trim().toLowerCase();return"none"===c||"no gap"===c||"no gaps"===c||"n/a"===c}(j)?e:j},[j]),W=Q&&Q.impact||"Impact",X=Q&&Q.explanation||"Explaination",Y=Q&&Q.decisionFactors||"Decision Making Factors",Z=Q&&Q.gaps||"Gaps in Decision",$=Q&&Q.accept||"Accept",ee=Q&&Q.reject||"Reject",ce=Q&&Q.backAriaLabel||"Go back";return c("div",e({className:"".concat(d["cite-acc"]," ").concat(E||""),style:e(e({},r.CitationAccordionDefaults.container),null==S?void 0:S.container)},{children:[F&&c("div",e({className:d["cite-acc__backHeader"]},{children:[i("button",e({type:"button",className:d["cite-acc__backBtn"],onClick:function(e){e.stopPropagation(),F&&F()},"aria-label":ce},{children:"‹"})),i("span",e({className:d["cite-acc__backTitle"]},{children:K}))]})),w&&w.length>0?w.map(function(n){return!1===n.show?null:c("div",e({className:"".concat(d["cite-acc__explain-body"]," ").concat(n.bodyClassName||"")},{children:[c("div",e({className:d["cite-acc__innerHeader"],style:e(e({},r.CitationAccordionDefaults.innerHeader),null==S?void 0:S.innerHeader)},{children:[i("div",e({className:d["cite-acc__innerHeaderLeft"]},{children:i("div",{children:i("div",e({className:d["cite-acc__innerTitle"]},{children:n.title}))})})),i("button",e({type:"button",onClick:function(e){e.stopPropagation(),T&&T()}},{children:i(s,{})}))]})),i("div",e({className:"".concat(d["cite-acc__innerBody"]," text-sm text-gray-600"),style:e(e({},r.CitationAccordionDefaults.innerBody),null==S?void 0:S.innerBody)},{children:"string"==typeof n.content?i(h,{text:n.content,item:n.item||l||{}}):n.content}))]}),n.id||n.title)}):c(n,{children:[z&&c("div",e({className:d["cite-acc__explain-body"]},{children:[c("div",e({className:d["cite-acc__innerHeader"]},{children:[i("div",e({className:d["cite-acc__innerHeaderLeft"]},{children:i("div",{children:i("div",e({className:d["cite-acc__innerTitle"]},{children:W}))})})),i("button",e({type:"button",onClick:function(e){e.stopPropagation(),T&&T()}},{children:i(s,{})}))]})),i("div",e({className:"".concat(d["cite-acc__innerBody"]," text-sm text-gray-600")},{children:i(h,{text:C||"",item:l||{}})}))]})),c("div",e({className:d["cite-acc__explain-body"]},{children:[i("div",e({className:d["cite-acc__innerHeader"]},{children:i("div",e({className:d["cite-acc__innerHeaderLeft"]},{children:i("div",{children:i("div",e({className:d["cite-acc__innerTitle"]},{children:X}))})}))})),i("div",e({className:"".concat(d["cite-acc__innerBody"]," text-sm text-gray-600")},{children:i(h,{text:H||"",item:{}})}))]})),R&&c("div",e({className:d["cite-acc__btn-container"]},{children:[i("button",e({className:d["btn-reject"],onClick:I},{children:ee})),i("button",e({className:d["btn-accept"],onClick:A},{children:$}))]})),c("div",e({className:d["cite-acc__header"]},{children:[c("div",e({className:d["cite-acc__headerLeft"]},{children:[i("span",e({className:d["cite-acc__titleIcon"]},{children:P?"function"==typeof P?t.createElement(P):P:i(m,{})})),i("div",e({className:d["cite-acc__title"]},{children:p}))]})),i("div",e({className:d["cite-acc__headerRight"]},{children:y&&c("span",e({className:d["cite-acc__scoreBadge"]},{children:[M?"function"==typeof M?t.createElement(M):M:i(v,{}),c("span",e({className:d["cite-acc__scoreText"]},{children:[U,"%"]}))]}))}))]})),c("div",e({className:d["cite-acc__explain-body"]},{children:[i("div",e({className:d["cite-acc__innerHeader"]},{children:i("div",e({className:d["cite-acc__innerHeaderLeft"]},{children:i("div",{children:i("div",e({className:d["cite-acc__innerTitle"]},{children:Y}))})}))})),i("div",e({className:"".concat(d["cite-acc__innerBody"]," text-sm text-gray-600")},{children:i(h,{text:x||"",item:l||{}})}))]})),c("div",e({className:"".concat(d["cite-acc__explain-body"]," ").concat(d["cite-acc__explain-body_border"])},{children:[i("div",e({className:d["cite-acc__innerHeader"]},{children:i("div",e({className:d["cite-acc__innerHeaderLeft"]},{children:i("div",{children:i("div",e({className:d["cite-acc__innerTitle"]},{children:Z}))})}))})),i("div",e({className:"".concat(d["cite-acc__innerBody"]," text-sm text-gray-600")},{children:i(h,{text:V||"",item:l||{}})}))]}))]})]}))}export{p as default};
|
|
2
2
|
//# sourceMappingURL=CognitiveComponent.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsxs as o,jsx as i,Fragment as n}from"react/jsx-runtime";import{Info as t,ChevronDown as l,PenLine as r,CheckCircle as d,XCircle as a}from"lucide-react";import{useState as s}from"react";import{ToneToggle as c}from"./ToneToggle.js";var u=[{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"}],p=function(n){var t=n.toneIndex,l=n.configs,r=void 0===l?u:l,d=r[Math.min(t,r.length-1)]||r[1]||r[0],a=d.color,s=d.angle,c=d.arcD,p=(s-90)*Math.PI/180,v=11+9*Math.cos(p),m=13+9*Math.sin(p);return o("svg",e({width:"22",height:"14",viewBox:"0 0 22 14",fill:"none"},{children:[i("path",{d:"M1 13 A10 10 0 0 1 21 13",stroke:"#e5e5e5",strokeWidth:"2.5",strokeLinecap:"round"}),i("path",{d:c,stroke:a,strokeWidth:"2.5",strokeLinecap:"round"}),i("line",{x1:"11",y1:"13",x2:v,y2:m,stroke:a,strokeWidth:"2",strokeLinecap:"round"})]}))},v=function(o){var n=o.type,t=o.customStyles,l=void 0===t?{}:t,r=e(e({},{High:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #FECACA",background:"#FEF2F2",color:"#B91C1C",fontSize:"11px",fontWeight:"500"},Medium:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #F2E5A1",background:"#FFFBEB",color:"#B45309",fontSize:"11px",fontWeight:"500"},Low:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #8098F9",background:"#DBEAFE",color:"#444CE7",fontSize:"11px",fontWeight:"500"}}),l),d=r[n]||r.Medium;return i("div",e({style:d},{children:n}))},m=["Lenient","Balanced","Aggressive"],g={Lenient:"#1D9E75",Balanced:"#BA7517",Aggressive:"#E24B4A"},y={width:"350px",background:"#fff",border:"1px solid #ddd",borderRadius:"8px",padding:"16px",maxHeight:"400px",overflow:"auto"},f={display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12},h={fontSize:11,fontWeight:500,letterSpacing:"0.08em",color:"#E24B4A",textTransform:"uppercase"},x={fontSize:15,fontWeight:500,margin:"0 0 8px",color:"#111"},S={fontSize:13,color:"#666",lineHeight:1.6,margin:"0 0 14px"},b={marginBottom:14,borderTop:"0.5px solid #eee",paddingTop:12},B={display:"flex",alignItems:"center",gap:6,background:"none",border:"none",cursor:"pointer",padding:0,width:"100%"},C={fontSize:11,fontWeight:500,textTransform:"uppercase",letterSpacing:"0.08em",color:"#E24B4A"},k={display:"flex",gap:8,marginBottom:18},D={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"},I={background:"none",border:"none",cursor:"pointer",fontSize:16,color:"#888",lineHeight:1,padding:0},A={borderTop:"0.5px solid #eee",paddingTop:14},z={display:"flex",alignItems:"center",width:"100%",background:"none",border:"none",cursor:"pointer",padding:0,marginBottom:4};function E(E){var T,R,w,M,W,j,F,L,H,_,P,q,G,J,K,N,O,Q,U,V=E.onClose,X=E.aiReason,Y=E.onAccept,Z=E.onReject,$=E.onIterate,ee=E.initialTone,oe=E.onRegenerate,ie=E.labels,ne=void 0===ie?{}:ie,te=E.toneLevelsConfig,le=void 0===te?m:te,re=E.toneColorsConfig,de=void 0===re?g:re,ae=E.dialConfigs,se=void 0===ae?u:ae,ce=E.customStyles,ue=void 0===ce?{}:ce,pe=E.severityChipStyles,ve=void 0===pe?{}:pe,me=E.customIcons,ge=void 0===me?{}:me,ye=le.findIndex(function(e){return e===ee});-1===ye&&(ye=1);var fe=s(!0),he=fe[0],xe=fe[1],Se=s(!1),be=Se[0],Be=Se[1],Ce=s(ye),ke=Ce[0],De=Ce[1],Ie=s(ye)[0],Ae=le[ke],ze=de[Ae]||"#BA7517",Ee=ke!==Ie;return o("div",e({onClick:function(e){return e.stopPropagation()},style:e(e({},y),null===(T=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===T?void 0:T.root)},{children:[o("div",e({style:e(e({},f),null===(R=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===R?void 0:R.header)},{children:[o("div",e({style:{display:"flex",alignItems:"center",gap:6}},{children:[i("span",{children:ge.summaryIcon||i(t,{size:16,color:"#E24B4A"})}),i("span",e({style:e(e({},h),null===(w=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===w?void 0:w.title)},{children:ne.summaryHeader||"Summary"}))]})),i("button",e({onClick:V,style:e(e({},I),null===(M=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===M?void 0:M.closeBtn)},{children:"✕"}))]})),i("p",e({style:e(e({},x),null===(W=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===W?void 0:W.bodyText)},{children:null===(j=null==X?void 0:X.deviation_details)||void 0===j?void 0:j.deviation_title})),i("p",e({style:e(e({},S),null===(F=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===F?void 0:F.summary)},{children:null===(L=null==X?void 0:X.deviation_details)||void 0===L?void 0:L.deviation_summary})),o("div",e({style:e(e({},b),null===(H=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===H?void 0:H.impactContainer)},{children:[o("div",e({style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},{children:[o("button",e({onClick:function(){return xe(!he)},style:e(e({},B),null===(_=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===_?void 0:_.impactToggle)},{children:[i("span",e({style:e(e({},C),null===(P=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===P?void 0:P.impactToggleLabel)},{children:ne.impactHeader||"Impact"})),i("span",e({style:{fontSize:12,color:"#E24B4A",transition:"transform 0.2s",display:"flex",alignItems:"center",transform:he?"rotate(180deg)":"rotate(0deg)"}},{children:i(l,{size:16,color:"#E24B4A"})}))]})),i(v,{type:(null==X?void 0:X.severity)||"Medium",customStyles:ve})]})),he&&i("p",e({style:{fontSize:13,color:"#666",lineHeight:1.6,margin:"8px 0 0"}},{children:null!==(G=null===(q=null==X?void 0:X.deviation_details)||void 0===q?void 0:q.deviation_impact)&&void 0!==G?G:ne.fallbackImpact||"This change reduces compliance obligations and lowers contractual risk thresholds."}))]})),o("div",e({style:e(e({},k),null===(J=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===J?void 0:J.actionContainer)},{children:[o("button",e({style:e(e(e({},D),null===(K=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===K?void 0:K.actionBtn),{color:"#64748B"}),onClick:$},{children:[ge.iterateIcon||i(r,{size:16,color:"#64748B"}),ne.btnIterate||"Iterate"]}),"Iterate"),o("button",e({style:e(e(e({},D),null===(N=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===N?void 0:N.actionBtn),{color:"#10B981"}),onClick:Y},{children:[ge.acceptIcon||i(d,{size:16,color:"#10B981"}),ne.btnAccept||"Approve"]}),"Accept"),o("button",e({style:e(e(e({},D),null===(O=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===O?void 0:O.actionBtn),{color:"#DC2626"}),onClick:Z},{children:[ge.rejectIcon||i(a,{size:16,color:"#DC2626"}),ne.btnReject||"Reject"]}),"reject")]})),o("div",e({style:e(e({},A),null===(Q=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===Q?void 0:Q.toneContainer)},{children:[o("button",e({onClick:function(){return Be(!be)},style:e(e({},z),null===(U=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===U?void 0:U.toneToggleBtn)},{children:[o("div",e({style:{display:"flex",alignItems:"center",gap:8}},{children:[i(p,{toneIndex:ke,configs:se}),i("span",e({style:{fontSize:13,fontWeight:500,color:"#111"}},{children:ne.toneHeader||"Redline Tone"}))]})),i("span",e({style:{transition:"transform 0.2s",display:"flex",alignItems:"center",transform:be?"rotate(180deg)":"rotate(0deg)"}},{children:i(l,{size:16,color:"#111"})}))]})),be&&o(n,{children:[i("p",e({style:{fontSize:12,color:"#888",margin:"0 0 12px"}},{children:ne.toneDescription||"Controls how assertively AI is redlining"})),i(c,{isDirty:Ee,onToneChange:function(e){De(e)},toneColor:ze,toneIndex:ke,onClickRegenerate:function(){return null==oe?void 0:oe(Ae)},toneLabels:le})]})]}))]}))}export{E as default};
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as i,jsx as o,Fragment as n}from"react/jsx-runtime";import{Info as t,ChevronDown as l,PenLine as r,CheckCircle as d,XCircle as a,ChevronRight as s}from"lucide-react";import{useState as c}from"react";import{ToneToggle as v}from"./ToneToggle.js";import"../CognitiveComponents/CitationComponent.module.css.js";import{ReactComponent as p}from"../icons/cognitiveBrain.svg.js";import{ReactComponent as u}from"../icons/aiMagic.svg.js";var g=[{color:"#1D9E75",angle:-90,arcD:"M1 13 A10 10 0 0 1 1 13"},{color:"#BA7517",angle:0,arcD:"M1 13 A10 10 0 0 1 11 3"},{color:"#E24B4A",angle:90,arcD:"M1 13 A10 10 0 0 1 21 13"}],m=function(n){var t=n.toneIndex,l=n.configs,r=void 0===l?g:l,d=r[Math.min(t,r.length-1)]||r[1]||r[0],a=d.color,s=d.angle,c=d.arcD,v=(s-90)*Math.PI/180,p=11+9*Math.cos(v),u=13+9*Math.sin(v);return i("svg",e({width:"22",height:"14",viewBox:"0 0 22 14",fill:"none"},{children:[o("path",{d:"M1 13 A10 10 0 0 1 21 13",stroke:"#e5e5e5",strokeWidth:"2.5",strokeLinecap:"round"}),o("path",{d:c,stroke:a,strokeWidth:"2.5",strokeLinecap:"round"}),o("line",{x1:"11",y1:"13",x2:p,y2:u,stroke:a,strokeWidth:"2",strokeLinecap:"round"})]}))},y=function(i){var n=i.type,t=i.customStyles,l=void 0===t?{}:t,r=e(e({},{High:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #FECACA",background:"#FEF2F2",color:"#B91C1C",fontSize:"11px",fontWeight:"500"},Medium:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #F2E5A1",background:"#FFFBEB",color:"#B45309",fontSize:"11px",fontWeight:"500"},Low:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #8098F9",background:"#DBEAFE",color:"#444CE7",fontSize:"11px",fontWeight:"500"}}),l),d=r[n]||r.Medium;return o("div",e({style:d},{children:n}))},f=["Lenient","Balanced","Aggressive"],h={Lenient:"#1D9E75",Balanced:"#BA7517",Aggressive:"#E24B4A"},x={width:"350px",background:"#fff",border:"1px solid #ddd",borderRadius:"8px",padding:"16px",maxHeight:"400px",overflow:"auto"},S={display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12},b={fontSize:11,fontWeight:500,letterSpacing:"0.08em",color:"#E24B4A",textTransform:"uppercase"},C={fontSize:15,fontWeight:500,margin:"0 0 8px",color:"#111"},B={fontSize:13,color:"#666",lineHeight:1.6,margin:"0 0 14px"},I={marginBottom:14,borderTop:"0.5px solid #eee",paddingTop:12},k={display:"flex",alignItems:"center",gap:6,background:"none",border:"none",cursor:"pointer",padding:0,width:"100%"},A={fontSize:11,fontWeight:500,textTransform:"uppercase",letterSpacing:"0.08em",color:"#E24B4A"},D={display:"flex",gap:8,marginBottom:18},T={flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:5,fontSize:12,fontWeight:500,padding:"7px 4px",borderRadius:8,border:"0.5px solid #ccc",background:"#fff",cursor:"pointer"},w={background:"none",border:"none",cursor:"pointer",fontSize:16,color:"#888",lineHeight:1,padding:0},z={borderTop:"0.5px solid #eee",paddingTop:14},R={display:"flex",alignItems:"center",width:"100%",background:"none",border:"none",cursor:"pointer",padding:0,marginBottom:4},W={cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"12px",borderTop:"1px solid #eee",borderBottom:"none",paddingLeft:"12px",paddingRight:"12px"},E={display:"flex",alignItems:"center",gap:"4px",minWidth:0,flex:"1 1 auto",overflow:"hidden"},j={width:"28px",height:"28px",display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 28px"},L={fontSize:"13px",color:"#101828",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},M={display:"flex",alignItems:"center",gap:"10px",flex:"0 0 auto",minWidth:0,flexWrap:"nowrap"},F={display:"flex",padding:"4px 8px",alignItems:"center",gap:"4px",borderRadius:"var(--chip-border-radius, 16px)",border:"1px solid var(--Primitive-Gray-300, #d0d5dd)",flex:"0 1 auto",minWidth:0},H={color:"var(--Primitive-Purple-600, #6938ef)",fontFamily:"Inter",fontSize:"12px",fontStyle:"normal",fontWeight:500,lineHeight:"150%"};function N(N){var _,P,O,G,q,J,K,Q,U,V,X,Y,Z,$,ee,ie,oe,ne,te,le=N.onClose,re=N.aiReason,de=N.onAccept,ae=N.onReject,se=N.onIterate,ce=N.initialTone,ve=N.onRegenerate,pe=N.labels,ue=void 0===pe?{}:pe,ge=N.toneLevelsConfig,me=void 0===ge?f:ge,ye=N.toneColorsConfig,fe=void 0===ye?h:ye,he=N.dialConfigs,xe=void 0===he?g:he,Se=N.customStyles,be=void 0===Se?{}:Se,Ce=N.severityChipStyles,Be=void 0===Ce?{}:Ce,Ie=N.customIcons,ke=void 0===Ie?{}:Ie,Ae=N.onOpenCognitive,De=N.showTone,Te=void 0===De||De,we=N.cognitiveSectionStyle,ze=void 0===we?{}:we,Re=N.cognitiveScoreBadgeStyle,We=void 0===Re?{}:Re,Ee=N.cognitiveScoreTextStyle,je=void 0===Ee?{}:Ee,Le=N.cognitiveStyles,Me=void 0===Le?{}:Le,Fe=N.cognitiveClassNames,He=void 0===Fe?{}:Fe,Ne=N.cognitiveTitle,_e=void 0===Ne?"Cognitive Integrity":Ne,Pe=N.cognitiveLeftIcon,Oe=N.showCognitiveRightArrow,Ge=void 0===Oe||Oe,qe=me.findIndex(function(e){return e===ce});-1===qe&&(qe=1);var Je=c(!0),Ke=Je[0],Qe=Je[1],Ue=c(!1),Ve=Ue[0],Xe=Ue[1],Ye=c(qe),Ze=Ye[0],$e=Ye[1],ei=c(qe)[0],ii=me[Ze],oi=fe[ii]||"#BA7517",ni=Ze!==ei;return i("div",e({onClick:function(e){return e.stopPropagation()},style:e(e({},x),null===(_=null==be?void 0:be.DeviationSummaryStyles)||void 0===_?void 0:_.root)},{children:[i("div",e({style:e(e({},S),null===(P=null==be?void 0:be.DeviationSummaryStyles)||void 0===P?void 0:P.header)},{children:[i("div",e({style:{display:"flex",alignItems:"center",gap:6}},{children:[o("span",{children:ke.summaryIcon||o(t,{size:16,color:"#E24B4A"})}),o("span",e({style:e(e({},b),null===(O=null==be?void 0:be.DeviationSummaryStyles)||void 0===O?void 0:O.title)},{children:ue.summaryHeader||"Summary"}))]})),o("button",e({onClick:le,style:e(e({},w),null===(G=null==be?void 0:be.DeviationSummaryStyles)||void 0===G?void 0:G.closeBtn)},{children:"✕"}))]})),o("p",e({style:e(e({},C),null===(q=null==be?void 0:be.DeviationSummaryStyles)||void 0===q?void 0:q.bodyText)},{children:null===(J=null==re?void 0:re.deviation_details)||void 0===J?void 0:J.deviation_title})),o("p",e({style:e(e({},B),null===(K=null==be?void 0:be.DeviationSummaryStyles)||void 0===K?void 0:K.summary)},{children:null===(Q=null==re?void 0:re.deviation_details)||void 0===Q?void 0:Q.deviation_summary})),i("div",e({style:e(e({},I),null===(U=null==be?void 0:be.DeviationSummaryStyles)||void 0===U?void 0:U.impactContainer)},{children:[i("div",e({style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},{children:[i("button",e({onClick:function(){return Qe(!Ke)},style:e(e({},k),null===(V=null==be?void 0:be.DeviationSummaryStyles)||void 0===V?void 0:V.impactToggle)},{children:[o("span",e({style:e(e({},A),null===(X=null==be?void 0:be.DeviationSummaryStyles)||void 0===X?void 0:X.impactToggleLabel)},{children:ue.impactHeader||"Impact"})),o("span",e({style:{fontSize:12,color:"#E24B4A",transition:"transform 0.2s",display:"flex",alignItems:"center",transform:Ke?"rotate(180deg)":"rotate(0deg)"}},{children:o(l,{size:16,color:"#E24B4A"})}))]})),o(y,{type:(null==re?void 0:re.severity)||"Medium",customStyles:Be})]})),Ke&&o("p",e({style:{fontSize:13,color:"#666",lineHeight:1.6,margin:"8px 0 0"}},{children:null!==(Z=null===(Y=null==re?void 0:re.deviation_details)||void 0===Y?void 0:Y.deviation_impact)&&void 0!==Z?Z:ue.fallbackImpact||"This change reduces compliance obligations and lowers contractual risk thresholds."}))]})),i("div",e({style:e(e({},D),null===($=null==be?void 0:be.DeviationSummaryStyles)||void 0===$?void 0:$.actionContainer)},{children:[i("button",e({style:e(e(e({},T),null===(ee=null==be?void 0:be.DeviationSummaryStyles)||void 0===ee?void 0:ee.actionBtn),{color:"#64748B"}),onClick:se},{children:[ke.iterateIcon||o(r,{size:16,color:"#64748B"}),ue.btnIterate||"Iterate"]}),"Iterate"),i("button",e({style:e(e(e({},T),null===(ie=null==be?void 0:be.DeviationSummaryStyles)||void 0===ie?void 0:ie.actionBtn),{color:"#10B981"}),onClick:de},{children:[ke.acceptIcon||o(d,{size:16,color:"#10B981"}),ue.btnAccept||"Approve"]}),"Accept"),i("button",e({style:e(e(e({},T),null===(oe=null==be?void 0:be.DeviationSummaryStyles)||void 0===oe?void 0:oe.actionBtn),{color:"#DC2626"}),onClick:ae},{children:[ke.rejectIcon||o(a,{size:16,color:"#DC2626"}),ue.btnReject||"Reject"]}),"reject")]})),Te&&i("div",e({style:e(e({},z),null===(ne=null==be?void 0:be.DeviationSummaryStyles)||void 0===ne?void 0:ne.toneContainer)},{children:[i("button",e({onClick:function(){return Xe(!Ve)},style:e(e({},R),null===(te=null==be?void 0:be.DeviationSummaryStyles)||void 0===te?void 0:te.toneToggleBtn)},{children:[i("div",e({style:{display:"flex",alignItems:"center",gap:8}},{children:[o(m,{toneIndex:Ze,configs:xe}),o("span",e({style:{fontSize:13,fontWeight:500,color:"#111"}},{children:ue.toneHeader||"Redline Tone"}))]})),o("span",e({style:{transition:"transform 0.2s",display:"flex",alignItems:"center",transform:Ve?"rotate(180deg)":"rotate(0deg)"}},{children:o(l,{size:16,color:"#111"})}))]})),Ve&&i(n,{children:[o("p",e({style:{fontSize:12,color:"#888",margin:"0 0 12px"}},{children:ue.toneDescription||"Controls how assertively AI is redlining"})),o(v,{isDirty:ni,onToneChange:function(e){$e(e)},toneColor:oi,toneIndex:Ze,onClickRegenerate:function(){return null==ve?void 0:ve(ii)},toneLabels:me})]})]})),Ae&&i("div",e({className:null==He?void 0:He.section,onClick:function(e){e.stopPropagation(),Ae&&Ae(e)},style:e(e(e({},W),null==Me?void 0:Me.section),ze)},{children:[i("div",e({className:null==He?void 0:He.headerLeft,style:e(e({},E),null==Me?void 0:Me.headerLeft)},{children:[o("span",e({className:null==He?void 0:He.titleIcon,style:e(e({},j),null==Me?void 0:Me.titleIcon)},{children:null!=Pe?Pe:o(p,{})})),o("div",e({className:null==He?void 0:He.cognitiveTitle,style:e(e({},L),null==Me?void 0:Me.cognitiveTitle)},{children:_e}))]})),i("div",e({className:null==He?void 0:He.headerRight,style:e(e({},M),null==Me?void 0:Me.headerRight)},{children:[void 0!==(null==re?void 0:re.relevance_score)&&null!==(null==re?void 0:re.relevance_score)?i("span",e({className:null==He?void 0:He.scoreBadge,style:e(e(e({},F),null==Me?void 0:Me.scoreBadge),We)},{children:[o(u,{}),i("span",e({className:null==He?void 0:He.scoreText,style:e(e(e({},H),null==Me?void 0:Me.scoreText),je)},{children:[Math.round(Number(re.relevance_score)),"%"]}))]})):null,Ge&&o("span",e({style:{display:"flex",alignItems:"center"}},{children:o(s,{size:16,color:"#64748B"})}))]}))]}))]}))}export{N as default};
|
|
2
2
|
//# sourceMappingURL=DeviationSummary.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsx as t,jsxs as o}from"react/jsx-runtime";import{Undo2 as n}from"lucide-react";import{useState as r}from"react";import i from"./PopupDefaults.js";function d(e){var t=new Date(e);return isNaN(t.getTime())?e:new Date(e).toLocaleString("en-US",{month:"2-digit",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0}).replace(" AM","AM").replace(" PM","PM")}var l=function(){return o("svg",e({width:"22",height:"22",viewBox:"0 0 22 22",fill:"none"},{children:[t("circle",{cx:"11",cy:"11",r:"10",stroke:"#22c55e",strokeWidth:"2",fill:"#f0fdf4"}),t("path",{d:"M6.5 11.5l3 3 6-6",stroke:"#22c55e",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}))},c=function(){return o("svg",e({width:"22",height:"22",viewBox:"0 0 22 22",fill:"none"},{children:[t("circle",{cx:"11",cy:"11",r:"10",stroke:"#ef4444",strokeWidth:"2",fill:"#fff1f2"}),t("path",{d:"M7.5 7.5l7 7M14.5 7.5l-7 7",stroke:"#ef4444",strokeWidth:"2",strokeLinecap:"round"})]}))},a=function(){return t("svg",e({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},{children:t("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#94a3b8",strokeWidth:"1.8",strokeLinecap:"round"})}))},s=function(){return o("svg",e({width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},{children:[t("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),t("path",{d:"M1.5 13.5c0-3.038 2.462-5.5 5-5.5s5 2.462 5 5.5",stroke:"#94a3b8",strokeWidth:"1.4",strokeLinecap:"round"}),t("path",{d:"M11 8.5l1.5 1.5 2.5-2.5",stroke:"#22c55e",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]}))},h=function(){return o("svg",e({width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},{children:[t("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),t("path",{d:"M1.5 13.5c0-3.038 2.462-5.5 5-5.5s5 2.462 5 5.5",stroke:"#94a3b8",strokeWidth:"1.4",strokeLinecap:"round"}),t("path",{d:"M11.5 8l3 3m0-3l-3 3",stroke:"#ef4444",strokeWidth:"1.4",strokeLinecap:"round"})]}))},u=function(o){var n=o.open;return t("svg",e({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",style:{transform:n?"rotate(0deg)":"rotate(180deg)",transition:"transform 0.25s ease"}},{children:t("path",{d:"M4.5 11.25L9 6.75l4.5 4.5",stroke:"#64748b",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})}))},f=function(n){var r=n.color,i=void 0===r?"#3b82f6":r;return o("svg",e({width:"15",height:"15",viewBox:"0 0 16 16",fill:"none"},{children:[t("path",{d:"M1.5 8A6.5 6.5 0 1 0 4 3.2",stroke:i,strokeWidth:"1.5",strokeLinecap:"round"}),t("path",{d:"M1.5 3.5v4h4",stroke:i,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M8 5v3.5l2 1.5",stroke:i,strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]}))},p=function(){return o("svg",e({width:"15",height:"15",viewBox:"0 0 16 16",fill:"none"},{children:[t("path",{d:"M13.5 8a5.5 5.5 0 1 0-1.6 3.9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round"}),t("path",{d:"M13.5 13v-4.5H9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}))},k=function(){return o("svg",e({width:"15",height:"15",viewBox:"0 0 16 16",fill:"none"},{children:[t("path",{d:"M2 8h12M10 4l4 4-4 4",stroke:"#64748b",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M4 5l-2 3 2 3",stroke:"#64748b",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]}))};function g(n){var r=n.title,i=n.open,d=n.onToggle,l=n.children;return o("div",e({style:{maxHeight:"170px",overflow:"auto"}},{children:[o("div",e({onClick:d,style:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",userSelect:"none",padding:"2px 0"}},{children:[t("span",e({style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"}},{children:r})),t(u,{open:i})]})),t("div",e({style:{maxHeight:i?300:0,opacity:i?1:0,overflow:"hidden",transition:"max-height 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.25s"}},{children:l}))]}))}function b(t){var n=t.icon,r=t.label,i=t.onClick,d=t.customStyle,l=e({display:"flex",alignItems:"center",gap:7,padding:"8px 16px",background:"#f8fafc",border:"1.5px solid #e2e8f0",borderRadius:10,cursor:"pointer",fontSize:"12px",fontWeight:600,color:"#475569",fontFamily:"inherit",transition:"background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.12s",whiteSpace:"nowrap"},void 0===d?{}:d);return o("button",e({onClick:i,style:l,onMouseEnter:function(e){e.currentTarget.style.background="#f1f5f9",e.currentTarget.style.transform="translateY(-1px)",e.currentTarget.style.boxShadow="0 2px 8px rgba(0,0,0,0.07)"},onMouseLeave:function(e){e.currentTarget.style.background="#f8fafc",e.currentTarget.style.transform="",e.currentTarget.style.boxShadow=""}},{children:[n,r]}))}function v(u){var v=u.status,m=u.onClose,y=u.impactText,x=u.secondText,B=u.actionTakenByName,C=u.actionTakenAtTime,L=void 0===C?"NA":C,w=u.onHistory,R=u.onIterate,M=u.onReinstate,W=u.onRevert,S=u.impactTitle,T=void 0===S?"Impact":S,I=u.customConfigs,D=void 0===I?{}:I,j=u.customStyles,z=void 0===j?{}:j,A=r(!0),H=A[0],F=A[1],U=r(!0),E=U[0],N=U[1],P=r(!1),O=P[0],Y=P[1],q={headerBg:"#f0fdf4",headerBorder:"#dcfce7",titleColor:"#166534",label:"Redline Approved",metaLabel:"Approved By",UserIcon:t(s,{}),StatusIcon:t(l,{}),secondTitle:"Original text",secondBg:"#f8fafc",secondBorder:"#e2e8f0",impactBox:!0,actions:[{icon:t(f,{}),label:"History",onClick:w},{icon:t(n,{size:17}),label:"Revert",onClick:W},{icon:t(k,{}),label:"Iterate",onClick:R}]},G={headerBg:"#fff1f2",headerBorder:"#fecdd3",titleColor:"#991b1b",label:"Redline Rejected",metaLabel:"Rejected By",UserIcon:t(h,{}),StatusIcon:t(c,{}),secondTitle:"Rejected Recommendation",secondBg:"#f8fafc",secondBorder:"#e2e8f0",impactBox:!1,actions:[{icon:t(f,{color:"#3b82f6"}),label:"History",onClick:w},{icon:t(p,{}),label:"Reinstate",onClick:M},{icon:t(k,{}),label:"Iterate",onClick:R}]},J={headerBg:"#E2E8F0",headerBorder:"none",titleColor:"#1E293B",label:"Redline Reverted",metaLabel:"Reverted By",UserIcon:t(s,{}),StatusIcon:t(n,{size:17}),secondTitle:"Reverted redline",secondBg:"#F9FAFB",secondBorder:"#D0D5DD",impactBox:!1,actions:[{icon:t(f,{}),label:"History",onClick:w},{icon:t(k,{}),label:"Iterate",onClick:R}]},K=e(e({},"accepted"===v?q:"rejected"===v?G:J),D[v]||{});return o("div",e({style:e(e(e({},i.RedlineCardDefaults.root),{animation:O?"slideOut 0.26s cubic-bezier(0.4,0,1,1) forwards":i.RedlineCardDefaults.root.animation||"slideIn 0.32s cubic-bezier(0.22,1,0.36,1) both"}),z.root)},{children:[o("div",e({style:e(e(e({},i.RedlineCardDefaults.header),{background:K.headerBg,borderBottom:"1.5px solid ".concat(K.headerBorder)}),z.header)},{children:[o("div",e({style:{display:"flex",alignItems:"center",gap:10}},{children:[K.StatusIcon,t("span",e({style:{fontSize:15,fontWeight:700,color:K.titleColor,letterSpacing:"-0.01em"}},{children:K.label}))]})),t("button",e({onClick:function(){Y(!0),m()},style:{background:"none",border:"none",cursor:"pointer",padding:4,borderRadius:6,display:"flex",alignItems:"center"}},{children:t(a,{})}))]})),o("div",e({style:e(e({},i.RedlineCardDefaults.body),z.body)},{children:[o("div",e({style:e(e({},i.RedlineCardDefaults.meta),z.meta)},{children:[o("div",e({style:{display:"flex",alignItems:"center",gap:6,marginBottom:5}},{children:[K.UserIcon,t("span",e({style:{fontSize:12.5,color:"#94a3b8",fontWeight:500}},{children:K.metaLabel}))]})),o("div",e({style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"}},{children:[B,", ",d(L)]}))]})),t("div",{style:e(e({},i.RedlineCardDefaults.divider),z.divider)}),t(g,e({title:T,open:H,onToggle:function(){return F(function(e){return!e})}},{children:t("p",e({style:e(e({},i.RedlineCardDefaults.impactText),z.impactText)},{children:y||""}))})),t("div",{style:e(e({},i.RedlineCardDefaults.divider),z.divider)}),t(g,e({title:K.secondTitle,open:E,onToggle:function(){return N(function(e){return!e})}},{children:t("div",e({style:e(e(e({},i.RedlineCardDefaults.secondSection),{background:K.secondBg,border:"1.5px solid ".concat(K.secondBorder)}),z.secondSection)},{children:x||""}))})),t("div",e({style:e(e({},i.RedlineCardDefaults.actionsContainer),z.actionsContainer)},{children:K.actions.map(function(e){return t(b,{icon:e.icon,label:e.label,onClick:e.onClick,customStyle:e.style},e.label)})}))]}))]}))}export{v as RedlineCard,d as formatDate};
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as t,jsxs as o}from"react/jsx-runtime";import{Undo2 as n}from"lucide-react";import{useState as r}from"react";import i from"./PopupDefaults.js";function d(e){var t=new Date(e);return isNaN(t.getTime())?e:new Date(e).toLocaleString("en-US",{month:"2-digit",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0}).replace(" AM","AM").replace(" PM","PM")}var l=function(){return o("svg",e({width:"22",height:"22",viewBox:"0 0 22 22",fill:"none"},{children:[t("circle",{cx:"11",cy:"11",r:"10",stroke:"#22c55e",strokeWidth:"2",fill:"#f0fdf4"}),t("path",{d:"M6.5 11.5l3 3 6-6",stroke:"#22c55e",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}))},c=function(){return o("svg",e({width:"22",height:"22",viewBox:"0 0 22 22",fill:"none"},{children:[t("circle",{cx:"11",cy:"11",r:"10",stroke:"#ef4444",strokeWidth:"2",fill:"#fff1f2"}),t("path",{d:"M7.5 7.5l7 7M14.5 7.5l-7 7",stroke:"#ef4444",strokeWidth:"2",strokeLinecap:"round"})]}))},a=function(){return t("svg",e({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},{children:t("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#94a3b8",strokeWidth:"1.8",strokeLinecap:"round"})}))},s=function(){return o("svg",e({width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},{children:[t("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),t("path",{d:"M1.5 13.5c0-3.038 2.462-5.5 5-5.5s5 2.462 5 5.5",stroke:"#94a3b8",strokeWidth:"1.4",strokeLinecap:"round"}),t("path",{d:"M11 8.5l1.5 1.5 2.5-2.5",stroke:"#22c55e",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]}))},h=function(){return o("svg",e({width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},{children:[t("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),t("path",{d:"M1.5 13.5c0-3.038 2.462-5.5 5-5.5s5 2.462 5 5.5",stroke:"#94a3b8",strokeWidth:"1.4",strokeLinecap:"round"}),t("path",{d:"M11.5 8l3 3m0-3l-3 3",stroke:"#ef4444",strokeWidth:"1.4",strokeLinecap:"round"})]}))},u=function(o){var n=o.open;return t("svg",e({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",style:{transform:n?"rotate(0deg)":"rotate(180deg)",transition:"transform 0.25s ease"}},{children:t("path",{d:"M4.5 11.25L9 6.75l4.5 4.5",stroke:"#64748b",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})}))},f=function(n){var r=n.color,i=void 0===r?"#3b82f6":r;return o("svg",e({width:"15",height:"15",viewBox:"0 0 16 16",fill:"none"},{children:[t("path",{d:"M1.5 8A6.5 6.5 0 1 0 4 3.2",stroke:i,strokeWidth:"1.5",strokeLinecap:"round"}),t("path",{d:"M1.5 3.5v4h4",stroke:i,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M8 5v3.5l2 1.5",stroke:i,strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]}))},p=function(){return o("svg",e({width:"15",height:"15",viewBox:"0 0 16 16",fill:"none"},{children:[t("path",{d:"M13.5 8a5.5 5.5 0 1 0-1.6 3.9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round"}),t("path",{d:"M13.5 13v-4.5H9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}))},k=function(){return o("svg",e({width:"15",height:"15",viewBox:"0 0 16 16",fill:"none"},{children:[t("path",{d:"M2 8h12M10 4l4 4-4 4",stroke:"#64748b",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M4 5l-2 3 2 3",stroke:"#64748b",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]}))};function g(n){var r=n.title,i=n.open,d=n.onToggle,l=n.children;return o("div",e({style:{maxHeight:"170px",overflow:"auto"}},{children:[o("div",e({onClick:d,style:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",userSelect:"none",padding:"2px 0"}},{children:[t("span",e({style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"}},{children:r})),t(u,{open:i})]})),t("div",e({style:{maxHeight:i?300:0,opacity:i?1:0,overflow:"hidden",transition:"max-height 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.25s"}},{children:l}))]}))}function b(t){var n=t.icon,r=t.label,i=t.onClick,d=t.customStyle,l=e({display:"flex",alignItems:"center",gap:7,padding:"8px 16px",background:"#f8fafc",border:"1.5px solid #e2e8f0",borderRadius:10,cursor:"pointer",fontSize:"12px",fontWeight:600,color:"#475569",fontFamily:"inherit",transition:"background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.12s",whiteSpace:"nowrap"},void 0===d?{}:d);return o("button",e({onClick:i,style:l,onMouseEnter:function(e){e.currentTarget.style.background="#f1f5f9",e.currentTarget.style.transform="translateY(-1px)",e.currentTarget.style.boxShadow="0 2px 8px rgba(0,0,0,0.07)"},onMouseLeave:function(e){e.currentTarget.style.background="#f8fafc",e.currentTarget.style.transform="",e.currentTarget.style.boxShadow=""}},{children:[n,r]}))}function v(u){var v=u.status,m=u.onClose,y=u.impactText,x=u.secondText,B=u.actionTakenByName,C=u.actionTakenAtTime,L=void 0===C?"NA":C,w=u.onHistory,R=u.onIterate,M=u.onReinstate,W=u.onRevert,S=u.impactTitle,T=void 0===S?"Impact":S,I=u.customConfigs,D=void 0===I?{}:I,j=u.customStyles,z=void 0===j?{}:j,A=r(!0),H=A[0],F=A[1],U=r(!0),E=U[0],N=U[1],P=r(!1),O=P[0],Y=P[1],q={headerBg:"#f0fdf4",headerBorder:"#dcfce7",titleColor:"#166534",label:"Redline Approved",metaLabel:"Approved By",UserIcon:t(s,{}),StatusIcon:t(l,{}),secondTitle:"Original text",secondBg:"#f8fafc",secondBorder:"#e2e8f0",impactBox:!0,actions:[{icon:t(f,{}),label:"History",onClick:w},{icon:t(n,{size:17}),label:"Revert",onClick:W},{icon:t(k,{}),label:"Iterate",onClick:R}]},G={headerBg:"#fff1f2",headerBorder:"#fecdd3",titleColor:"#991b1b",label:"Redline Rejected",metaLabel:"Rejected By",UserIcon:t(h,{}),StatusIcon:t(c,{}),secondTitle:"Rejected Recommendation",secondBg:"#f8fafc",secondBorder:"#e2e8f0",impactBox:!1,actions:[{icon:t(f,{color:"#3b82f6"}),label:"History",onClick:w},{icon:t(p,{}),label:"Reinstate",onClick:M},{icon:t(k,{}),label:"Iterate",onClick:R}]},J={headerBg:"#E2E8F0",headerBorder:"none",titleColor:"#1E293B",label:"Redline Reverted",metaLabel:"Reverted By",UserIcon:t(s,{}),StatusIcon:t(n,{size:17}),secondTitle:"Reverted redline",secondBg:"#F9FAFB",secondBorder:"#D0D5DD",impactBox:!1,actions:[{icon:t(f,{}),label:"History",onClick:w},{icon:t(k,{}),label:"Iterate",onClick:R}]},K=e(e({},"accepted"===v?q:"rejected"===v?G:J),D[v]||{});return o("div",e({style:e(e(e({},i.RedlineCardDefaults.root),{animation:O?"slideOut 0.26s cubic-bezier(0.4,0,1,1) forwards":i.RedlineCardDefaults.root.animation||"slideIn 0.32s cubic-bezier(0.22,1,0.36,1) both"}),z.root)},{children:[o("div",e({style:e(e(e({},i.RedlineCardDefaults.header),{background:K.headerBg,borderBottom:"1.5px solid ".concat(K.headerBorder)}),z.header)},{children:[o("div",e({style:{display:"flex",alignItems:"center",gap:10}},{children:[K.StatusIcon,t("span",e({style:{fontSize:15,fontWeight:700,color:K.titleColor,letterSpacing:"-0.01em"}},{children:K.label}))]})),t("button",e({onClick:function(){Y(!0),m()},style:{background:"none",border:"none",cursor:"pointer",padding:4,borderRadius:6,display:"flex",alignItems:"center"}},{children:t(a,{})}))]})),o("div",e({style:e(e({},i.RedlineCardDefaults.body),z.body)},{children:[o("div",e({style:e(e({},i.RedlineCardDefaults.meta),z.meta)},{children:[o("div",e({style:{display:"flex",alignItems:"center",gap:6,marginBottom:5}},{children:[K.UserIcon,t("span",e({style:{fontSize:12.5,color:"#94a3b8",fontWeight:500}},{children:K.metaLabel}))]})),o("div",e({style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"}},{children:[B,", ",d(L)]}))]})),t("div",{style:e(e({},i.RedlineCardDefaults.divider),z.divider)}),t(g,e({title:T,open:H,onToggle:function(){return F(function(e){return!e})}},{children:t("p",e({style:e(e({},i.RedlineCardDefaults.impactText),z.impactText)},{children:y||""}))})),t("div",{style:e(e({},i.RedlineCardDefaults.divider),z.divider)}),t(g,e({title:K.secondTitle,open:E,onToggle:function(){return N(function(e){return!e})}},{children:t("div",e({style:e(e(e({},i.RedlineCardDefaults.secondSection),{background:K.secondBg,border:"1.5px solid ".concat(K.secondBorder)}),z.secondSection)},{children:x||""}))})),t("div",e({style:e(e({},i.RedlineCardDefaults.actionsContainer),z.actionsContainer)},{children:K.actions.map(function(e){return t(b,{icon:e.icon,label:e.label,onClick:e.onClick,customStyle:e.style},e.label)})}))]}))]}))}export{l as ApprovedIcon,u as ChevronIcon,a as CloseIcon,f as HistoryIcon,k as IterateIcon,v as RedlineCard,p as ReinstateIcon,c as RejectedIcon,s as UserApprovedIcon,h as UserRejectedIcon,d as formatDate};
|
|
2
2
|
//# sourceMappingURL=RedlineStatusCard.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e,__awaiter as n,__generator as t}from"tslib";import{jsxs as o,jsx as a}from"react/jsx-runtime";import r,{useContext as i,useMemo as s}from"react";import{Loader2 as l,ChevronDown as c}from"lucide-react";import{cn as m}from"../../../UserStoryImport/lib/cn.js";import u from"./segment.module.css.js";import d from"./ExampleComponentWrapper.js";import p from"../ai-reasoning/AiReasoningCitationContent.js";import g from"./SegmentLoader.js";import"./segment-common.css.js";import{MarkdownStateContext as v}from"../../store/markdown-context.js";var f=function(f){var y=f.id,h=void 0===y?"Segment":y,S=f.label,C=f.
|
|
1
|
+
import{__assign as e,__awaiter as n,__generator as t}from"tslib";import{jsxs as o,jsx as a}from"react/jsx-runtime";import r,{useContext as i,useMemo as s}from"react";import{Loader2 as l,ChevronDown as c}from"lucide-react";import{cn as m}from"../../../UserStoryImport/lib/cn.js";import u from"./segment.module.css.js";import d from"./ExampleComponentWrapper.js";import p from"../ai-reasoning/AiReasoningCitationContent.js";import g from"./SegmentLoader.js";import"./segment-common.css.js";import{MarkdownStateContext as v}from"../../store/markdown-context.js";var f=function(f){var y=f.id,h=void 0===y?"Segment":y,S=f.label,C=f.children,b=f.segmentUUID;f.decisionStrength;var x=f.aiReason,j=f.customStyles,E=f.customIcons,I=f.aiReasoningCitationCustomStyles,N=f.segmentExampleComponent,w=f.handleViewGlossary,R=f.isUpdatedSegment,U=f.onOpen,k=i(v),L=k.citationsMetadata,V=k.updateCitationsMetadata;console.log("citation metadata ",L);var W=r.useState(!1),G=W[0],M=W[1],z=s(function(){return L.get(b)},[L,b]),A=s(function(){return(null==z?void 0:z.open)||!1},[z]),B=s(function(){return z&&"loading"===z.state},[z]);return o("div",e({className:"".concat(u.segmentWrapper),style:e({},null==j?void 0:j.segmentWrapper)},{children:[o("div",e({className:"segment-".concat(h,"-container segmentContainer ").concat(R?"updatedSegmentContainer":""),style:e({},null==j?void 0:j.container)},{children:[a("span",e({className:"segment-".concat(h," segmentLabel ").concat(R?"updatedSegmentLabel":""),style:e({},null==j?void 0:j.label)},{children:R?C:S})),a("button",e({className:"".concat(u.segmentExplanationButtonContainer),style:e({},null==j?void 0:j.buttonContainer),onClick:function(){return n(void 0,void 0,void 0,function(){var n;return t(this,function(t){switch(t.label){case 0:if(n=!A,M(!1),console.log("citation metadata::",n,x),!n||(null==x?void 0:x.reason))return[3,5];V(b,function(t){if(t){var o=e({},t);return o.state="loading",o}return{open:n,state:"loading"}}),t.label=1;case 1:return t.trys.push([1,,3,4]),console.log("citation metadata:: onopen"),[4,null==U?void 0:U()];case 2:return t.sent(),[3,4];case 3:return V(b,function(t){if(t){var o=e({},t);return o.state="ready",o.open=n,o}return{open:n,state:"ready"}}),[7];case 4:return[3,6];case 5:console.log("citation metadata:: else block"),V(b,function(t){if(t){var o=e({},t);return o.open=n,o}return{open:n,state:B?"loading":"ready"}}),t.label=6;case 6:return[2]}})})}},{children:B?a(l,{size:16,className:u.spinner}):a(c,{className:m(R&&u.updatedChevronIcon,u.cheveronIcon,A&&u.cheveronIconRotated),style:e({},null==j?void 0:j.cheveronIcon)})}))]})),G&&!R?a(d,{label:null!=S?S:"",segmentExampleComponent:N,customStyles:null==j?void 0:j.segmentExample,handleCancelExample:function(){M(!1)}}):A&&(B?a(g,{customStyles:null==j?void 0:j.loadingSkeleton}):a(p,{aiReason:x,customStyles:I,customIcons:E,isSegmentExplanation:!0,handleViewGlossary:w?function(){V(b,function(n){if(n){var t=e({},n);return t.open=!1,t}return{open:!1,state:B?"loading":"ready"}}),null==w||w(h)}:void 0,handleViewExample:N?function(){M(!0)}:void 0,isUpdatedSegment:R}))]}))};export{f as default};
|
|
2
2
|
//# sourceMappingURL=Segment.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{__assign as e,__awaiter as n,__generator as t}from"tslib";import{jsx as o}from"react/jsx-runtime";import l from"./Segment.js";import i from"dompurify";var d=function(d){var a,s,r,u,m,v,g,c,p,S,h,f,b,x=d.id,y=d.children,C=d.props,_=d.segmentComponentConfig,I=d.customStyles,U=d.customIcons,D=d.extractText,w=d.isUpdatedSegment,E=void 0!==w&&w,F=(null==C?void 0:C.id)||"Segment",L=(null==C?void 0:C.decisionstrength)||"80",k=_||{},R=k.segmentDataList,j=k.getSegmentExampleComponent,G=k.handleViewGlossary,O=k.upadatedSegmentDataList,T=k.handleFetchUpdatedSegmentDetails,V=k.handleFetchSegmentDetails,W=E?null==O?void 0:O.find(function(e){return String(e.segment_id)===String(F)}):null==R?void 0:R.find(function(e){return String(e.segment_id)===String(F)});console.log("meee work",W,E,R,O);var z={id:F,reason:null!==(a=null==W?void 0:W.reason)&&void 0!==a?a:"",gap:null!==(s=null==W?void 0:W.gap)&&void 0!==s?s:"",explanation:null!==(r=null==W?void 0:W.explanation)&&void 0!==r?r:"",relevance_score:null!==(u=null==W?void 0:W.relevance_score)&&void 0!==u?u:0,isOpen:!1},H=void 0,M=D(y),q=C["data-table"],A="";if(q&&!E)try{A=decodeURIComponent(atob(q))}catch(e){console.error("Failed to decode data-table for segment",F,e)}var B=i.sanitize(A);return W||!V||E||null==V||V(F),F&&W&&j&&!E&&(H=q?o(function(){return o("div",{dangerouslySetInnerHTML:{__html:B}})},{}):j(F,M,W.segment_type)),o(l,e({id:F,segmentUUID:x,label:null!==(m=null==W?void 0:W.label)&&void 0!==m?m:null==W?void 0:W.segment_name,decisionStrength:L,aiReason:z,customIcons:U,aiReasoningCitationCustomStyles:I,segmentExampleComponent:H,handleViewGlossary:G,customStyles:{segmentWrapper:null===(v=null==I?void 0:I.segment)||void 0===v?void 0:v.segmentWrapper,container:null===(g=null==I?void 0:I.segment)||void 0===g?void 0:g.container,label:null===(c=null==I?void 0:I.segment)||void 0===c?void 0:c.label,decisionStrength:null===(p=null==I?void 0:I.segment)||void 0===p?void 0:p.decisionStrength,buttonContainer:null===(S=null==I?void 0:I.segment)||void 0===S?void 0:S.buttonContainer,cheveronIcon:null===(h=null==I?void 0:I.segment)||void 0===h?void 0:h.cheveronIcon,segmentExample:null===(f=null==I?void 0:I.segment)||void 0===f?void 0:f.segmentExample,loadingSkeleton:null===(b=null==I?void 0:I.segment)||void 0===b?void 0:b.SegmentLoadingSkeletonStyles},isUpdatedSegment:E,onOpen:function(){return n(void 0,void 0,void 0,function(){return t(this,function(e){switch(e.label){case 0:return W||!E?[3,2]:(console.log("citation metadata:: handleFetchUpdatedSegmentDetails"),[4,null==T?void 0:T(F)]);case 1:e.sent(),e.label=2;case 2:return[2]}})})}},{children:y}),F)};export{d as default};
|
|
2
2
|
//# sourceMappingURL=SegmentWrapper.js.map
|
package/dist/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__rest as n,__assign as e}from"tslib";import{jsx as i,jsxs as o}from"react/jsx-runtime";import t,{createContext as r,useRef as l,useState as a,useCallback as d,useMemo as c,useEffect as s,useContext as u}from"react";import v from"react-markdown";import g from"rehype-raw";import p from"./UserStoryWithCitation.module.css.js";import{useMarkdownSearch as m}from"../../shared/useMarkdownSearch.js";import{Info as h}from"lucide-react";import{Tooltip as f}from"@mui/material";import C from"../../shared/UpdatedAnimationContent.js";import y from"../../shared/GeneratedCodeCitation.js";import S from"../../shared/CitationLoadingIndicator.js";import{useRequirementAI as R}from"../RequirementAIWrapper/RequirementAIWrapper.js";import w from"../../icons/CognitiveDecision.js";import I from"../../icons/BrainRed.js";import b,{SHOW_CONFIDENCE_SCORE_THRESHOLD_IN_AI_REASONING as x}from"../ai-reasoning/AiReasoningCitation.js";import N from"../../icons/RelevanceScoreIcon.js";import A from"../RecommendationBlock/RecommendationBlock.js";import k from"../UserStoryCard/AttachedContext.js";import j from"../ai-reasoning/AiReasoningCitationContent.js";import U from"./components/InlineUpdatedComponent.js";import T from"../segment/SegmentWrapper.js";import{MarkdownContextProvider as P}from"../../store/markdown-context.js";var $=r(!1),E=r({expandedInfo:null,setExpanded:function(){},reasonToRow:{current:new Map}}),L=r({rowId:""}),M=function(n){var t,r=n.aiReason,l=n.isHighConfidence,a=n.customStyle,d=n.customIcons,c=u(E),s=c.expandedInfo,v=c.setExpanded,g=c.reasonToRow,m=u(L).rowId,h=String(r.id);m&&g.current.set(h,m);var f=(null===(t=null==s?void 0:s.aiReason)||void 0===t?void 0:t.id)===r.id,C=l?(null==d?void 0:d.highConfidence)||i(w,{}):(null==d?void 0:d.lowConfidence)||i(I,{});return o("button",e({className:p.aiReasoningButton,style:a,onClick:function(n){n.stopPropagation(),n.preventDefault(),v(f?null:m,f?null:r)}},{children:[C,i("i",f?{className:"pi pi-angle-up ".concat(l?p.aiReasoningIconHighConfidence:p.aiReasoningIconLowConfidence)}:{className:"pi pi-angle-down ".concat(l?p.aiReasoningIconHighConfidence:p.aiReasoningIconLowConfidence)})]}))},_=function(n){var t,r,a=n.children,d=n.node,c=n.customStyles,s=n.customIcons,v=l(Math.random().toString(36).slice(2)).current,g=u(E).expandedInfo,m=(null==g?void 0:g.rowId)===v,h=Array.isArray(null==d?void 0:d.children)?d.children.filter(function(n){return"element"===n.type}).length:1,f=null!==(r=null===(t=null==d?void 0:d.properties)||void 0===t?void 0:t.style)&&void 0!==r?r:void 0;return o(L.Provider,e({value:{rowId:v}},{children:[i("tr",e({style:f?{cssText:f}:void 0},{children:a})),m&&(null==g?void 0:g.aiReason)&&i("tr",e({style:{width:"100%"}},{children:i("td",e({colSpan:h||1,className:p.tableExpandedCell},{children:i("div",e({className:p.tableExpandedCellInner},{children:i("div",e({className:p.tableExpandedCellContent},{children:i(j,{aiReason:g.aiReason,customIcons:s,customStyles:{aiReasoningContent:null==c?void 0:c.aiReasoningContent,aiReasoningAccordion:null==c?void 0:c.aiReasoningAccordion,aiReasoningMarkdown:null==c?void 0:c.aiReasoningMarkdown,aiReasoningPill:null==c?void 0:c.aiReasoningPill,webCitation:null==c?void 0:c.webCitation,stormeeCitation:null==c?void 0:c.stormeeCitation,waveformCitation:null==c?void 0:c.waveformCitation,imageCitation:null==c?void 0:c.imageCitation,fileCitation:null==c?void 0:c.fileCitation,appModCitation:null==c?void 0:c.appModCitation,rcaCitation:null==c?void 0:c.rcaCitation,readFileCitation:null==c?void 0:c.readFileCitation,loadingCitations:null==c?void 0:c.loadingCitations,chatCitation:null==c?void 0:c.chatCitation}})}))}))}))}))]}))};var D=["del","ins"];function F(n){return function(n,e,i){var o=e.join("|");return n.replace(new RegExp("<(".concat(o,")>([\\s\\S]*?)<\\/\\1>"),"gi"),function(n,e,o){return"<".concat(e,">").concat(i(o),"</").concat(e,">")})}(n,D,function(n){return n.split(/(<[^>]+>)/g).map(function(n){return!n||/^<[^>]+>$/.test(n)?n:function(n){if(!n)return n;var e=[];return n.replace(/`([^`\n]+)`/g,function(n,i){var o=e.push(i)-1;return"@@CODE_SPAN_".concat(o,"@@")}).replace(/\*\*([\s\S]+?)\*\*/g,"<strong>$1</strong>").replace(/__([\s\S]+?)__/g,"<strong>$1</strong>").replace(/@@CODE_SPAN_(\d+)@@/g,function(n,i){var o,t=null!==(o=e[Number(i)])&&void 0!==o?o:"";return"<code>".concat(t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),"</code>")})}(n)}).join("")})}var H=function(r){var w,I=r.message,j=r.isParent,L=r.scenario,D=r.showUserStoryDiff,H=void 0!==D&&D,B=r.aiReasoningsForBlock,O=r.isCitationLoadingDisplay,q=void 0!==O&&O,W=r.className;r.highConfidenceIcon,r.lowConfidenceIcon;var z=r.customStyles,V=r.customIcons,G=r.aiReasoningDiffView,Q=r.userStoryCitations,J=r.artifactId,K=r.isCraflow,X=r.onCraAccept,Y=r.onCraReject,Z=r.craFlowConfig,nn=r.isDisplayHighlightControl,en=void 0!==nn&&nn,on=l(null),tn=R(),rn=tn.userStory,ln=tn.inlineUpdateComponentConfig,an=tn.getAvgScoreForStory,dn=tn.setUserStory,cn=tn.aiReasoning,sn=tn.setAiReasoning,un=tn.customIcons,vn=tn.searchQueryList,gn=tn.searchQueryReasoningIdList,pn=tn.currentHighlightIndex,mn=tn.segmentComponentConfig,hn=null!=V?V:null==un?void 0:un.userStoryIcons;null==z||z.searchHighlight;var fn=m(on),Cn=fn.search,yn=fn.clear,Sn=a("1"),Rn=Sn[0],wn=Sn[1],In=a(null),bn=In[0],xn=In[1],Nn=l(new Map),An=d(function(n,e){xn(n&&e?{rowId:n,aiReason:e}:null)},[]),kn=J?an(J):0,jn=a([]),Un=jn[0],Tn=jn[1],Pn=function(n){return null==n?"":"string"==typeof n?n:"number"==typeof n?String(n):Array.isArray(n)?n.map(Pn).join(""):t.isValidElement(n)?Pn(n.props.children):""},$n=function(n){var e=n;return e=function(n){for(var e,i=/<updated[^>]*>[\s\S]*?<\/updated>/gi,o=[],t=new RegExp(i.source,i.flags);null!==(e=t.exec(n));){var r=e[0],l=r.match(/<deleted>([\s\S]*?)<\/deleted>/i),a=r.match(/<changed>([\s\S]*?)<\/changed>/i),d=function(n){return(n.match(/^\s*\d+\.\s/gm)||[]).length};o.push({index:e.index,endIndex:e.index+e[0].length,deletedItemCount:d((null==l?void 0:l[1])||""),changedItemCount:d((null==a?void 0:a[1])||"")})}if(0===o.length)return n;for(var c=n,s=function(n){var e=o[n],i=e.changedItemCount-e.deletedItemCount;if(0===i)return"continue";for(var t=!1,r=0,l=c.substring(0,e.index).split("\n").reverse();r<l.length;r++){var a=l[r].trim();if(""!==a){/^\d+\.\s/.test(a)&&(t=!0);break}}if(!t)return"continue";var d=e.endIndex,s=n+1<o.length?o[n+1].index:c.length,u=c.substring(d,s);u=u.replace(/^(\s*)(\d+)\.\s/gm,function(n,e,o){return"".concat(e).concat(parseInt(o,10)+i,". ")}),c=c.substring(0,d)+u+c.substring(s)},u=o.length-1;u>=0;u--)s(u);return c}(e=(e=(e=(e=(e=e.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,function(n,e){var i=e.replace(/ai_reasoning\$(\d+)/g,function(n,e){return"ai_reasoning$".concat(e,"-legacy")});return"<deleted>".concat(i,"</deleted>")})).replace(/<generatedCode([^>]*)>([\s\S]*?)<\/generatedCode>/gi,function(n,e,i){var o=btoa(encodeURIComponent(i.trim()));return"\n\n<generatedCode".concat(e,' data-raw="').concat(o,'"></generatedCode>\n\n')})).replace(/^(\s*[-*]|\s*\d+\.)\s*\n?\s*(<updated\b)/gm,"$1 $2")).replace(/(<segment\b([^>]*)>)([\s\S]*?)(<\/segment>)/gi,function(n,e,i,o,t){var r=o.match(/<table[\s\S]*?<\/table>/i);if(r){var l=btoa(encodeURIComponent(r[0]));return"<segment".concat(i,' data-table="').concat(l,'"></segment>')}return n})).replace(/<updated([^>]*)>([\s\S]*?)<\/updated>/gi,function(n,i,o,t){var r=e.substring(0,t),l=r.lastIndexOf("\n"),a=/^\s+[-*]\s/.test(r.substring(l+1))||/^\s+\d+\.\s/.test(r.substring(l+1)),d=/^\s*(\d+\.|\s*[-*])\s+$/.test(r.substring(l+1));if(a||d){var c=o;return c=(c=(c=(c=c.replace(/(<deleted>)\s*\n?\s*[-*]\s+/gi,"$1\n")).replace(/(<changed>)\s*\n?\s*[-*]\s+/gi,"$1\n")).replace(/(<deleted>)\s*\n?\s*\d+\.\s+/gi,"$1\n")).replace(/(<changed>)\s*\n?\s*\d+\.\s+/gi,"$1\n"),"<updated".concat(i,">").concat(c,"</updated>")}return n})),e=function(n){var e=n.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,function(n,e){var i=e.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <deleted>",{hadChange:i!==e}),"<deleted>".concat(i,"</deleted>")});return e.replace(/<changed>([\s\S]*?)<\/changed>/gi,function(n,e){var i=e.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <changed>",{hadChange:i!==e,preview:e.substring(0,120)}),"<changed>".concat(i,"</changed>")})}(e),e=F(e)},En=c(function(){return I?$n(I):I},[I]);s(function(){Tn(B||cn)},[B,cn]);var Ln=c(function(){return{upt:function(o){var t;o.node;var r=o.children,l=n(o,["node","children"]),a=null==l?void 0:l.id,d=a?null===(t=a.split("$"))||void 0===t?void 0:t[1]:null,c=cn.find(function(n){return n.id.toString()===d});return c?i(U,e({aiReason:c,customStyles:null==z?void 0:z.inlineUpdatedComponent,handleClickCognitiveDecision:null==ln?void 0:ln.handleClickCognitiveDecision,handleClickUpdatedPill:null==ln?void 0:ln.handleClickUpdatedPill,handleClickOutputValue:null==ln?void 0:ln.handleClickOutputValue,customIcons:null==ln?void 0:ln.customIcons},{children:r})):r},del:function(o){o.node;var t=o.children,r=n(o,["node","children"]);return i("span",e({className:p.deleted,style:null==z?void 0:z.deleted},r,{onClick:r.onclick},{children:t}))},ins:function(o){var t=o.children,r=n(o,["children"]);return i("span",e({className:p.inserted,style:null==z?void 0:z.inserted},r,{onClick:r.onclick},{children:t}))},preserved:function(o){var t=o.children,r=n(o,["children"]);return i("span",e({className:p.preserved,style:null==z?void 0:z.preserved},r,{onClick:r.onclick},{children:t}))},h1:function(o){o.node;var t=n(o,["node"]);return i("h1",e({className:p.heading1,style:null==z?void 0:z.heading1},{children:t.children}))},h2:function(o){o.node;var t=n(o,["node"]);return i("h2",e({className:p.heading2,style:null==z?void 0:z.heading2},{children:t.children}))},h3:function(o){o.node;var t=n(o,["node"]);return i("h3",e({className:p.heading3,style:null==z?void 0:z.heading3},{children:t.children}))},b:function(o){o.node;var t=n(o,["node"]);return i("b",e({className:p.bold,style:null==z?void 0:z.bold},{children:null==t?void 0:t.children}))},p:function(o){o.node;var t=n(o,["node"]);return i("p",e({},t,{className:p.paragraph,style:null==z?void 0:z.paragraph},{children:t.children}))},updated:function(o){var t=o.node,r=n(o,["node"]);return i(C,e({},r,{showUserStoryDiff:H,currentUpdatedTagId:Rn,setCurrentUpdatedTagId:wn,userStory:rn,setUserStory:dn,setAiReasoning:sn,node:t,isCraflow:K,onCraAccept:X,onCraReject:Y,customStyles:null==z?void 0:z.updatedContent,craFlowConfig:Z}))},ol:function(o){var t,r,l,a=o.node,d=n(o,["node"]),c=null!==(l=null!==(r=null===(t=null==a?void 0:a.properties)||void 0===t?void 0:t.start)&&void 0!==r?r:null==d?void 0:d.start)&&void 0!==l?l:void 0;return i("ol",e({className:p.orderedList,style:null==z?void 0:z.olist},c?{start:Number(c)}:{},{children:null==d?void 0:d.children}))},ul:function(o){o.node;var t=n(o,["node"]);return i("ul",e({className:p.unorderedList,style:null==z?void 0:z.ulist},{children:null==t?void 0:t.children}))},table:function(n){var o=n.children;return i("div",e({className:p.tableWrapper},{children:i("table",e({className:p.table,style:null==z?void 0:z.table},{children:o}))}))},tr:function(n){var e=n.node,o=n.children;return i(_,{node:e,children:o,customStyles:z})},td:function(o){var t,r=o.node,l=o.children,a=null!==(t=null==r?void 0:r.properties)&&void 0!==t?t:{},d=a.style,c=n(a,["style"]);return i($.Provider,e({value:!0},{children:i("td",e({},c,{style:d?{cssText:d}:void 0},{children:l}))}))},th:function(o){var t,r=o.node,l=o.children,a=null!==(t=null==r?void 0:r.properties)&&void 0!==t?t:{},d=a.style,c=n(a,["style"]);return i($.Provider,e({value:!0},{children:i("th",e({},c,{style:d?{cssText:d}:void 0},{children:l}))}))},recommendation:function(o){var t;o.node;var r=n(o,["node"]),l="The AI has selected this content based on: ".concat((null===(t=null==r?void 0:r.children)||void 0===t?void 0:t[0])||"");return i(A,e({},r,{customStyles:null==z?void 0:z.recommendationBlock,label:l}))},a:function(e){var o,t,r;e.inline,e.children,e.node;var l=n(e,["inline","children","node"]),a=u($)||"true"==(null==l?void 0:l.table),d="".concat(null==l?void 0:l.href),c=null===(o=d.split("$"))||void 0===o?void 0:o[0],s=null===(t=d.split("$"))||void 0===t?void 0:t[1];if("ai_reasoning"===c){var v=(null!==(r=H?G:cn)&&void 0!==r?r:[]).find(function(n){return n.id.toString()===decodeURIComponent(s)}),g=gn.includes(s);if(v)return a?i(M,{aiReason:v,customStyle:null==z?void 0:z.tableAiReasoning,customIcons:hn,isHighConfidence:v.relevance_score>=x}):i(b,{aiReason:v,isSourceHasHighlight:g,customIcons:hn,customStyles:{aiReasoningContent:null==z?void 0:z.aiReasoningContent,aiReasoningAccordion:null==z?void 0:z.aiReasoningAccordion,aiReasoningMarkdown:null==z?void 0:z.aiReasoningMarkdown,aiReasoningPill:null==z?void 0:z.aiReasoningPill,webCitation:null==z?void 0:z.webCitation,stormeeCitation:null==z?void 0:z.stormeeCitation,waveformCitation:null==z?void 0:z.waveformCitation,imageCitation:null==z?void 0:z.imageCitation,fileCitation:null==z?void 0:z.fileCitation,appModCitation:null==z?void 0:z.appModCitation,rcaCitation:null==z?void 0:z.rcaCitation,readFileCitation:null==z?void 0:z.readFileCitation,loadingCitations:null==z?void 0:z.loadingCitations,chatCitation:null==z?void 0:z.chatCitation,bigEnoughCitation:null==z?void 0:z.bigEnoughCitation}})}return null},code:function(o){o.inline;var t=o.children,r=o.className;return o.node,n(o,["inline","children","className","node"]),/language-(\w+)/.exec(r||"")||(null==r?void 0:r.includes("language-"))?i("div",{children:i("code",e({className:p.blockCode,style:null==z?void 0:z.code},{children:t}))}):i("code",e({className:p.inlineCode,style:null==z?void 0:z.code},{children:t}))},learned:function(n){var o=n.children;return i(f,e({title:o,placement:"top"},{children:i(h,{size:16,className:p.learned})}))},generatedcode:function(e){e.node;var o=n(e,["node"]),t=(null==o?void 0:o.language)||"python",r=function(n){var e="";try{if(n["data-raw"])e=decodeURIComponent(atob(n["data-raw"]));else{var i=function(n){var e;return"string"==typeof n?n:Array.isArray(n)?n.map(i).join(""):(null===(e=null==n?void 0:n.props)||void 0===e?void 0:e.children)?i(n.props.children):""};e=i(n.children)}}catch(i){console.error("Error decoding generated code:",i),e=String(n.children)}return e}(o);return i(y,{title:"Generated Code",code:r,language:t,customStyles:{pill:null==z?void 0:z.generatedCodePill,content:null==z?void 0:z.generatedCodeContent}})},updatedsegment:function(e){var o,t,r,l,a=e.node,d=e.children,c=n(e,["node","children"]),s="".concat(null===(o=a.position)||void 0===o?void 0:o.start.line,"-").concat(null===(t=a.position)||void 0===t?void 0:t.start.column,"-").concat(null===(r=a.position)||void 0===r?void 0:r.end.line,"-").concat(null===(l=a.position)||void 0===l?void 0:l.end.column);return i(T,{id:s,node:a,children:d,props:c,segmentComponentConfig:mn,customStyles:z,customIcons:V,extractText:Pn,isUpdatedSegment:!0})},segment:function(e){var o,t,r,l,a=e.node,d=e.children,c=n(e,["node","children"]),s="".concat(null===(o=a.position)||void 0===o?void 0:o.start.line,"-").concat(null===(t=a.position)||void 0===t?void 0:t.start.column,"-").concat(null===(r=a.position)||void 0===r?void 0:r.end.line,"-").concat(null===(l=a.position)||void 0===l?void 0:l.end.column);return i(T,{id:s,node:a,children:d,props:c,segmentComponentConfig:mn,customStyles:z,customIcons:V,extractText:Pn})}}},[Un,Z,cn,Q,Rn,H,I,V,vn,gn,z,mn]);return s(function(){if(on.current){if(vn.length){var n;if(0===gn.length||en)requestAnimationFrame(function(){Cn([vn[pn].replace(/\*/g,"")])});else{var e=on.current,i=new MutationObserver(function(){clearTimeout(n),n=setTimeout(function(){i.disconnect(),requestAnimationFrame(function(){Cn([vn[pn].replace(/\*/g,"")])})},50)});i.observe(e,{childList:!0,subtree:!0})}return function(){clearTimeout(n)}}yn()}},[vn,gn,pn,en]),s(function(){return console.log("mounting userstorywithcitation"),function(){console.log("unmounting userstorywithcitation")}},[]),i(E.Provider,e({value:{expandedInfo:bn,setExpanded:An,reasonToRow:Nn}},{children:o("div",e({ref:on,className:"".concat(p.container," ").concat("approving"!==L?p.wrapper:""," ").concat(W||""),style:null==z?void 0:z.container},{children:[i(P,{children:i(v,e({components:Ln,rehypePlugins:[g]},{children:En}))}),kn>0&&i("div",e({className:p.confidenceScoreContainer,style:null==z?void 0:z.confidenceScoreContainer},{children:o("span",e({className:p.confidenceScore,style:null==z?void 0:z.confidenceScore},{children:[i(N,{size:14,color:(null==z?void 0:z.confidenceScoreIconColor)||"#166534"}),kn,"%"]}))})),q&&i("div",e({className:p.citationLoader,style:null==z?void 0:z.citationLoaderContainer},{children:i(S,{customStyles:{container:null==z?void 0:z.citationLoadingContainer,icon:null==z?void 0:z.citationLoadingIcon,text:null==z?void 0:z.citationLoadingText}})})),j&&i("div",e({style:e({},null===(w=null==z?void 0:z.attachedContext)||void 0===w?void 0:w.wrapper),className:"flex mt-5"},{children:i(k,{customStyles:null==z?void 0:z.attachedContext})}))]}))}))};export{H as default};
|
|
1
|
+
import{__rest as n,__assign as e}from"tslib";import{jsx as i,jsxs as o}from"react/jsx-runtime";import t,{createContext as r,useRef as l,useState as a,useCallback as d,useMemo as c,useEffect as s,useContext as u}from"react";import v from"react-markdown";import g from"rehype-raw";import p from"./UserStoryWithCitation.module.css.js";import{useMarkdownSearch as m}from"../../shared/useMarkdownSearch.js";import{Info as h}from"lucide-react";import{Tooltip as f}from"@mui/material";import C from"../../shared/UpdatedAnimationContent.js";import y from"../../shared/GeneratedCodeCitation.js";import S from"../../shared/CitationLoadingIndicator.js";import{useRequirementAI as R}from"../RequirementAIWrapper/RequirementAIWrapper.js";import w from"../../icons/CognitiveDecision.js";import I from"../../icons/BrainRed.js";import b,{SHOW_CONFIDENCE_SCORE_THRESHOLD_IN_AI_REASONING as x}from"../ai-reasoning/AiReasoningCitation.js";import N from"../../icons/RelevanceScoreIcon.js";import k from"../RecommendationBlock/RecommendationBlock.js";import A from"../UserStoryCard/AttachedContext.js";import j from"../ai-reasoning/AiReasoningCitationContent.js";import U from"./components/InlineUpdatedComponent.js";import T from"../segment/SegmentWrapper.js";import{MarkdownContextProvider as P}from"../../store/markdown-context.js";var M=r(!1),$=r({expandedInfo:null,setExpanded:function(){},reasonToRow:{current:new Map}}),E=r({rowId:""}),L=function(n){var t,r=n.aiReason,l=n.isHighConfidence,a=n.customStyle,d=n.customIcons,c=u($),s=c.expandedInfo,v=c.setExpanded,g=c.reasonToRow,m=u(E).rowId,h=String(r.id);m&&g.current.set(h,m);var f=(null===(t=null==s?void 0:s.aiReason)||void 0===t?void 0:t.id)===r.id,C=l?(null==d?void 0:d.highConfidence)||i(w,{}):(null==d?void 0:d.lowConfidence)||i(I,{});return o("button",e({className:p.aiReasoningButton,style:a,onClick:function(n){n.stopPropagation(),n.preventDefault(),v(f?null:m,f?null:r)}},{children:[C,i("i",f?{className:"pi pi-angle-up ".concat(l?p.aiReasoningIconHighConfidence:p.aiReasoningIconLowConfidence)}:{className:"pi pi-angle-down ".concat(l?p.aiReasoningIconHighConfidence:p.aiReasoningIconLowConfidence)})]}))},_=function(n){var t,r,a=n.children,d=n.node,c=n.customStyles,s=n.customIcons,v=l(Math.random().toString(36).slice(2)).current,g=u($).expandedInfo,m=(null==g?void 0:g.rowId)===v,h=Array.isArray(null==d?void 0:d.children)?d.children.filter(function(n){return"element"===n.type}).length:1,f=null!==(r=null===(t=null==d?void 0:d.properties)||void 0===t?void 0:t.style)&&void 0!==r?r:void 0;return o(E.Provider,e({value:{rowId:v}},{children:[i("tr",e({style:f?{cssText:f}:void 0},{children:a})),m&&(null==g?void 0:g.aiReason)&&i("tr",e({style:{width:"100%"}},{children:i("td",e({colSpan:h||1,className:p.tableExpandedCell},{children:i("div",e({className:p.tableExpandedCellInner},{children:i("div",e({className:p.tableExpandedCellContent},{children:i(j,{aiReason:g.aiReason,customIcons:s,customStyles:{aiReasoningContent:null==c?void 0:c.aiReasoningContent,aiReasoningAccordion:null==c?void 0:c.aiReasoningAccordion,aiReasoningMarkdown:null==c?void 0:c.aiReasoningMarkdown,aiReasoningPill:null==c?void 0:c.aiReasoningPill,webCitation:null==c?void 0:c.webCitation,stormeeCitation:null==c?void 0:c.stormeeCitation,waveformCitation:null==c?void 0:c.waveformCitation,imageCitation:null==c?void 0:c.imageCitation,fileCitation:null==c?void 0:c.fileCitation,appModCitation:null==c?void 0:c.appModCitation,rcaCitation:null==c?void 0:c.rcaCitation,readFileCitation:null==c?void 0:c.readFileCitation,loadingCitations:null==c?void 0:c.loadingCitations,chatCitation:null==c?void 0:c.chatCitation}})}))}))}))}))]}))};var D=["del","ins"];function F(n){return function(n,e,i){var o=e.join("|");return n.replace(new RegExp("<(".concat(o,")>([\\s\\S]*?)<\\/\\1>"),"gi"),function(n,e,o){return"<".concat(e,">").concat(i(o),"</").concat(e,">")})}(n,D,function(n){return n.split(/(<[^>]+>)/g).map(function(n){return!n||/^<[^>]+>$/.test(n)?n:function(n){if(!n)return n;var e=[];return n.replace(/`([^`\n]+)`/g,function(n,i){var o=e.push(i)-1;return"@@CODE_SPAN_".concat(o,"@@")}).replace(/\*\*([\s\S]+?)\*\*/g,"<strong>$1</strong>").replace(/__([\s\S]+?)__/g,"<strong>$1</strong>").replace(/@@CODE_SPAN_(\d+)@@/g,function(n,i){var o,t=null!==(o=e[Number(i)])&&void 0!==o?o:"";return"<code>".concat(t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),"</code>")})}(n)}).join("")})}var H=function(r){var w,I=r.message,j=r.noMarkdownContent,E=r.useMarkdown,D=void 0===E||E,H=r.isParent,B=r.scenario,O=r.showUserStoryDiff,q=void 0!==O&&O,W=r.aiReasoningsForBlock,z=r.isCitationLoadingDisplay,V=void 0!==z&&z,G=r.className;r.highConfidenceIcon,r.lowConfidenceIcon;var Q=r.customStyles,J=r.customIcons,K=r.aiReasoningDiffView,X=r.userStoryCitations,Y=r.artifactId,Z=r.isCraflow,nn=r.onCraAccept,en=r.onCraReject,on=r.craFlowConfig,tn=r.isDisplayHighlightControl,rn=void 0!==tn&&tn,ln=l(null),an=R(),dn=an.userStory,cn=an.inlineUpdateComponentConfig,sn=an.getAvgScoreForStory,un=an.setUserStory,vn=an.aiReasoning,gn=an.setAiReasoning,pn=an.customIcons,mn=an.searchQueryList,hn=an.searchQueryReasoningIdList,fn=an.currentHighlightIndex,Cn=an.segmentComponentConfig,yn=null!=J?J:null==pn?void 0:pn.userStoryIcons;null==Q||Q.searchHighlight;var Sn=m(ln),Rn=Sn.search,wn=Sn.clear,In=a("1"),bn=In[0],xn=In[1],Nn=a(null),kn=Nn[0],An=Nn[1],jn=l(new Map),Un=d(function(n,e){An(n&&e?{rowId:n,aiReason:e}:null)},[]),Tn=Y?sn(Y):0,Pn=a([]),Mn=Pn[0],$n=Pn[1],En=function(n){return null==n?"":"string"==typeof n?n:"number"==typeof n?String(n):Array.isArray(n)?n.map(En).join(""):t.isValidElement(n)?En(n.props.children):""},Ln=function(n){var e=n;return e=function(n){for(var e,i=/<updated[^>]*>[\s\S]*?<\/updated>/gi,o=[],t=new RegExp(i.source,i.flags);null!==(e=t.exec(n));){var r=e[0],l=r.match(/<deleted>([\s\S]*?)<\/deleted>/i),a=r.match(/<changed>([\s\S]*?)<\/changed>/i),d=function(n){return(n.match(/^\s*\d+\.\s/gm)||[]).length};o.push({index:e.index,endIndex:e.index+e[0].length,deletedItemCount:d((null==l?void 0:l[1])||""),changedItemCount:d((null==a?void 0:a[1])||"")})}if(0===o.length)return n;for(var c=n,s=function(n){var e=o[n],i=e.changedItemCount-e.deletedItemCount;if(0===i)return"continue";for(var t=!1,r=0,l=c.substring(0,e.index).split("\n").reverse();r<l.length;r++){var a=l[r].trim();if(""!==a){/^\d+\.\s/.test(a)&&(t=!0);break}}if(!t)return"continue";var d=e.endIndex,s=n+1<o.length?o[n+1].index:c.length,u=c.substring(d,s);u=u.replace(/^(\s*)(\d+)\.\s/gm,function(n,e,o){return"".concat(e).concat(parseInt(o,10)+i,". ")}),c=c.substring(0,d)+u+c.substring(s)},u=o.length-1;u>=0;u--)s(u);return c}(e=(e=(e=(e=(e=e.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,function(n,e){var i=e.replace(/ai_reasoning\$(\d+)/g,function(n,e){return"ai_reasoning$".concat(e,"-legacy")});return"<deleted>".concat(i,"</deleted>")})).replace(/<generatedCode([^>]*)>([\s\S]*?)<\/generatedCode>/gi,function(n,e,i){var o=btoa(encodeURIComponent(i.trim()));return"\n\n<generatedCode".concat(e,' data-raw="').concat(o,'"></generatedCode>\n\n')})).replace(/^(\s*[-*]|\s*\d+\.)\s*\n?\s*(<updated\b)/gm,"$1 $2")).replace(/(<segment\b([^>]*)>)([\s\S]*?)(<\/segment>)/gi,function(n,e,i,o,t){var r=o.match(/<table[\s\S]*?<\/table>/i);if(r){var l=btoa(encodeURIComponent(r[0]));return"<segment".concat(i,' data-table="').concat(l,'"></segment>')}return n})).replace(/<updated([^>]*)>([\s\S]*?)<\/updated>/gi,function(n,i,o,t){var r=e.substring(0,t),l=r.lastIndexOf("\n"),a=/^\s+[-*]\s/.test(r.substring(l+1))||/^\s+\d+\.\s/.test(r.substring(l+1)),d=/^\s*(\d+\.|\s*[-*])\s+$/.test(r.substring(l+1));if(a||d){var c=o;return c=(c=(c=(c=c.replace(/(<deleted>)\s*\n?\s*[-*]\s+/gi,"$1\n")).replace(/(<changed>)\s*\n?\s*[-*]\s+/gi,"$1\n")).replace(/(<deleted>)\s*\n?\s*\d+\.\s+/gi,"$1\n")).replace(/(<changed>)\s*\n?\s*\d+\.\s+/gi,"$1\n"),"<updated".concat(i,">").concat(c,"</updated>")}return n})),e=function(n){var e=n.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,function(n,e){var i=e.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <deleted>",{hadChange:i!==e}),"<deleted>".concat(i,"</deleted>")});return e.replace(/<changed>([\s\S]*?)<\/changed>/gi,function(n,e){var i=e.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <changed>",{hadChange:i!==e,preview:e.substring(0,120)}),"<changed>".concat(i,"</changed>")})}(e),e=F(e)},_n=c(function(){return I?Ln(I):I},[I]);s(function(){$n(W||vn)},[W,vn]);var Dn=c(function(){return{upt:function(o){var t;o.node;var r=o.children,l=n(o,["node","children"]),a=null==l?void 0:l.id,d=a?null===(t=a.split("$"))||void 0===t?void 0:t[1]:null,c=vn.find(function(n){return n.id.toString()===d});return c?i(U,e({aiReason:c,customStyles:null==Q?void 0:Q.inlineUpdatedComponent,handleClickCognitiveDecision:null==cn?void 0:cn.handleClickCognitiveDecision,handleClickUpdatedPill:null==cn?void 0:cn.handleClickUpdatedPill,handleClickOutputValue:null==cn?void 0:cn.handleClickOutputValue,customIcons:null==cn?void 0:cn.customIcons},{children:r})):r},del:function(o){o.node;var t=o.children,r=n(o,["node","children"]);return i("span",e({className:p.deleted,style:null==Q?void 0:Q.deleted},r,{onClick:r.onclick},{children:t}))},ins:function(o){var t=o.children,r=n(o,["children"]);return i("span",e({className:p.inserted,style:null==Q?void 0:Q.inserted},r,{onClick:r.onclick},{children:t}))},preserved:function(o){var t=o.children,r=n(o,["children"]);return i("span",e({className:p.preserved,style:null==Q?void 0:Q.preserved},r,{onClick:r.onclick},{children:t}))},h1:function(o){o.node;var t=n(o,["node"]);return i("h1",e({className:p.heading1,style:null==Q?void 0:Q.heading1},{children:t.children}))},h2:function(o){o.node;var t=n(o,["node"]);return i("h2",e({className:p.heading2,style:null==Q?void 0:Q.heading2},{children:t.children}))},h3:function(o){o.node;var t=n(o,["node"]);return i("h3",e({className:p.heading3,style:null==Q?void 0:Q.heading3},{children:t.children}))},b:function(o){o.node;var t=n(o,["node"]);return i("b",e({className:p.bold,style:null==Q?void 0:Q.bold},{children:null==t?void 0:t.children}))},p:function(o){o.node;var t=n(o,["node"]);return i("p",e({},t,{className:p.paragraph,style:null==Q?void 0:Q.paragraph},{children:t.children}))},updated:function(o){var t=o.node,r=n(o,["node"]);return i(C,e({},r,{showUserStoryDiff:q,currentUpdatedTagId:bn,setCurrentUpdatedTagId:xn,userStory:dn,setUserStory:un,setAiReasoning:gn,node:t,isCraflow:Z,onCraAccept:nn,onCraReject:en,customStyles:null==Q?void 0:Q.updatedContent,craFlowConfig:on}))},ol:function(o){var t,r,l,a=o.node,d=n(o,["node"]),c=null!==(l=null!==(r=null===(t=null==a?void 0:a.properties)||void 0===t?void 0:t.start)&&void 0!==r?r:null==d?void 0:d.start)&&void 0!==l?l:void 0;return i("ol",e({className:p.orderedList,style:null==Q?void 0:Q.olist},c?{start:Number(c)}:{},{children:null==d?void 0:d.children}))},ul:function(o){o.node;var t=n(o,["node"]);return i("ul",e({className:p.unorderedList,style:null==Q?void 0:Q.ulist},{children:null==t?void 0:t.children}))},table:function(n){var o=n.children;return i("div",e({className:p.tableWrapper},{children:i("table",e({className:p.table,style:null==Q?void 0:Q.table},{children:o}))}))},tr:function(n){var e=n.node,o=n.children;return i(_,{node:e,children:o,customStyles:Q})},td:function(o){var t,r=o.node,l=o.children,a=null!==(t=null==r?void 0:r.properties)&&void 0!==t?t:{},d=a.style,c=n(a,["style"]);return i(M.Provider,e({value:!0},{children:i("td",e({},c,{style:d?{cssText:d}:void 0},{children:l}))}))},th:function(o){var t,r=o.node,l=o.children,a=null!==(t=null==r?void 0:r.properties)&&void 0!==t?t:{},d=a.style,c=n(a,["style"]);return i(M.Provider,e({value:!0},{children:i("th",e({},c,{style:d?{cssText:d}:void 0},{children:l}))}))},recommendation:function(o){var t;o.node;var r=n(o,["node"]),l="The AI has selected this content based on: ".concat((null===(t=null==r?void 0:r.children)||void 0===t?void 0:t[0])||"");return i(k,e({},r,{customStyles:null==Q?void 0:Q.recommendationBlock,label:l}))},a:function(e){var o,t,r;e.inline,e.children,e.node;var l=n(e,["inline","children","node"]),a=u(M)||"true"==(null==l?void 0:l.table),d="".concat(null==l?void 0:l.href),c=null===(o=d.split("$"))||void 0===o?void 0:o[0],s=null===(t=d.split("$"))||void 0===t?void 0:t[1];if("ai_reasoning"===c){var v=(null!==(r=q?K:vn)&&void 0!==r?r:[]).find(function(n){return n.id.toString()===decodeURIComponent(s)}),g=hn.includes(s);if(v)return a?i(L,{aiReason:v,customStyle:null==Q?void 0:Q.tableAiReasoning,customIcons:yn,isHighConfidence:v.relevance_score>=x}):i(b,{aiReason:v,isSourceHasHighlight:g,customIcons:yn,customStyles:{aiReasoningContent:null==Q?void 0:Q.aiReasoningContent,aiReasoningAccordion:null==Q?void 0:Q.aiReasoningAccordion,aiReasoningMarkdown:null==Q?void 0:Q.aiReasoningMarkdown,aiReasoningPill:null==Q?void 0:Q.aiReasoningPill,webCitation:null==Q?void 0:Q.webCitation,stormeeCitation:null==Q?void 0:Q.stormeeCitation,waveformCitation:null==Q?void 0:Q.waveformCitation,imageCitation:null==Q?void 0:Q.imageCitation,fileCitation:null==Q?void 0:Q.fileCitation,appModCitation:null==Q?void 0:Q.appModCitation,rcaCitation:null==Q?void 0:Q.rcaCitation,readFileCitation:null==Q?void 0:Q.readFileCitation,loadingCitations:null==Q?void 0:Q.loadingCitations,chatCitation:null==Q?void 0:Q.chatCitation,bigEnoughCitation:null==Q?void 0:Q.bigEnoughCitation}})}return null},code:function(o){o.inline;var t=o.children,r=o.className;return o.node,n(o,["inline","children","className","node"]),/language-(\w+)/.exec(r||"")||(null==r?void 0:r.includes("language-"))?i("div",{children:i("code",e({className:p.blockCode,style:null==Q?void 0:Q.code},{children:t}))}):i("code",e({className:p.inlineCode,style:null==Q?void 0:Q.code},{children:t}))},learned:function(n){var o=n.children;return i(f,e({title:o,placement:"top"},{children:i(h,{size:16,className:p.learned})}))},generatedcode:function(e){e.node;var o=n(e,["node"]),t=(null==o?void 0:o.language)||"python",r=function(n){var e="";try{if(n["data-raw"])e=decodeURIComponent(atob(n["data-raw"]));else{var i=function(n){var e;return"string"==typeof n?n:Array.isArray(n)?n.map(i).join(""):(null===(e=null==n?void 0:n.props)||void 0===e?void 0:e.children)?i(n.props.children):""};e=i(n.children)}}catch(i){console.error("Error decoding generated code:",i),e=String(n.children)}return e}(o);return i(y,{title:"Generated Code",code:r,language:t,customStyles:{pill:null==Q?void 0:Q.generatedCodePill,content:null==Q?void 0:Q.generatedCodeContent}})},updatedsegment:function(e){var o,t,r,l,a=e.node,d=e.children,c=n(e,["node","children"]),s="".concat(null===(o=a.position)||void 0===o?void 0:o.start.line,"-").concat(null===(t=a.position)||void 0===t?void 0:t.start.column,"-").concat(null===(r=a.position)||void 0===r?void 0:r.end.line,"-").concat(null===(l=a.position)||void 0===l?void 0:l.end.column);return i(T,{id:s,node:a,children:d,props:c,segmentComponentConfig:Cn,customStyles:Q,customIcons:J,extractText:En,isUpdatedSegment:!0})},segment:function(e){var o,t,r,l,a=e.node,d=e.children,c=n(e,["node","children"]),s="".concat(null===(o=a.position)||void 0===o?void 0:o.start.line,"-").concat(null===(t=a.position)||void 0===t?void 0:t.start.column,"-").concat(null===(r=a.position)||void 0===r?void 0:r.end.line,"-").concat(null===(l=a.position)||void 0===l?void 0:l.end.column);return i(T,{id:s,node:a,children:d,props:c,segmentComponentConfig:Cn,customStyles:Q,customIcons:J,extractText:En})}}},[Mn,on,vn,X,bn,q,I,J,mn,hn,Q,Cn]);return s(function(){if(ln.current){if(mn.length){var n;if(0===hn.length||rn)requestAnimationFrame(function(){Rn([mn[fn].replace(/\*/g,"")])});else{var e=ln.current,i=new MutationObserver(function(){clearTimeout(n),n=setTimeout(function(){i.disconnect(),requestAnimationFrame(function(){Rn([mn[fn].replace(/\*/g,"")])})},50)});i.observe(e,{childList:!0,subtree:!0})}return function(){clearTimeout(n)}}wn()}},[mn,hn,fn,rn]),i($.Provider,e({value:{expandedInfo:kn,setExpanded:Un,reasonToRow:jn}},{children:o("div",e({ref:ln,className:"".concat(p.container," ").concat("approving"!==B?p.wrapper:""," ").concat(G||""),style:null==Q?void 0:Q.container},{children:[D?i(P,{children:i(v,e({components:Dn,rehypePlugins:[g]},{children:_n}))}):j,Tn>0&&i("div",e({className:p.confidenceScoreContainer,style:null==Q?void 0:Q.confidenceScoreContainer},{children:o("span",e({className:p.confidenceScore,style:null==Q?void 0:Q.confidenceScore},{children:[i(N,{size:14,color:(null==Q?void 0:Q.confidenceScoreIconColor)||"#166534"}),Tn,"%"]}))})),V&&i("div",e({className:p.citationLoader,style:null==Q?void 0:Q.citationLoaderContainer},{children:i(S,{customStyles:{container:null==Q?void 0:Q.citationLoadingContainer,icon:null==Q?void 0:Q.citationLoadingIcon,text:null==Q?void 0:Q.citationLoadingText}})})),H&&i("div",e({style:e({},null===(w=null==Q?void 0:Q.attachedContext)||void 0===w?void 0:w.wrapper),className:"flex mt-5"},{children:i(A,{customStyles:null==Q?void 0:Q.attachedContext})}))]}))}))};export{H as default};
|
|
2
2
|
//# sourceMappingURL=UserStoryWithCitation.js.map
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import "./CitationComponent.css";
|
|
3
2
|
type Section = {
|
|
4
3
|
id?: string;
|
|
5
4
|
title: string;
|
|
@@ -28,7 +27,20 @@ type Props = {
|
|
|
28
27
|
scoreIcon?: React.ElementType | React.ReactNode;
|
|
29
28
|
className?: string;
|
|
30
29
|
customStyles?: Record<string, React.CSSProperties>;
|
|
30
|
+
onBackClick?: () => void;
|
|
31
|
+
isImpactNeeded?: boolean;
|
|
32
|
+
cognitiveTitle?: string;
|
|
33
|
+
labels?: {
|
|
34
|
+
impact?: string;
|
|
35
|
+
explanation?: string;
|
|
36
|
+
decisionFactors?: string;
|
|
37
|
+
gaps?: string;
|
|
38
|
+
noGapsText?: string;
|
|
39
|
+
accept?: string;
|
|
40
|
+
reject?: string;
|
|
41
|
+
backAriaLabel?: string;
|
|
42
|
+
};
|
|
31
43
|
};
|
|
32
|
-
export default function CitationAccordion({ item, title, relevanceScore, showRelevanceScore, reason, impact, explaination, gap, onClose, onAccept, onReject, showResolveBtns, sections, leftIcon, scoreIcon, className, customStyles, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
export default function CitationAccordion({ item, title, relevanceScore, showRelevanceScore, reason, impact, explaination, gap, onClose, onAccept, onReject, showResolveBtns, sections, leftIcon, scoreIcon, className, customStyles, onBackClick, isImpactNeeded, cognitiveTitle, labels }: Props): import("react/jsx-runtime").JSX.Element;
|
|
33
45
|
export {};
|
|
34
46
|
//# sourceMappingURL=CognitiveComponent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CognitiveComponent.d.ts","sourceRoot":"","sources":["../../../../../../../../src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"CognitiveComponent.d.ts","sourceRoot":"","sources":["../../../../../../../../src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAYvC,KAAK,OAAO,GAAG;IACX,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IAClC,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,KAAK,KAAK,GAAG;IAET,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,eAAe,CAAC,EAAE,OAAO,CAAC;IAG1B,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;IACrB,QAAQ,CAAC,EAAE,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,SAAS,CAAC;IAC/C,SAAS,CAAC,EAAE,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,SAAS,CAAC;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;IAEnD,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,MAAM,CAAC,EAAE;QACL,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,aAAa,CAAC,EAAE,MAAM,CAAC;KAC1B,CAAC;CACL,CAAC;AAyCF,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,EACtC,IAAI,EACJ,KAAkC,EAClC,cAAkB,EAClB,kBAAyB,EACzB,MAAiC,EACjC,MAA8B,EAC9B,YAA0C,EAC1C,GAAY,EACZ,OAAkB,EAClB,QAAQ,EACR,QAAQ,EACR,eAAuB,EACvB,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,SAAS,EACT,YAAiB,EACjB,WAAW,EACX,cAAqB,EACrB,cAAsC,EACpC,MAAW,EAChB,EAAE,KAAK,2CAiLP"}
|
package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { TAIReasoning } from '../../../types/aiReasoning.type';
|
|
3
|
+
import '../CognitiveComponents/CitationComponent.module.css';
|
|
3
4
|
type ToneType = 'Lenient' | 'Balanced' | 'Aggressive' | string;
|
|
4
5
|
export interface DialIconConfig {
|
|
5
6
|
color: string;
|
|
@@ -24,6 +25,8 @@ export interface DeviationSummaryProps {
|
|
|
24
25
|
onIterate: () => void;
|
|
25
26
|
initialTone?: ToneType;
|
|
26
27
|
onRegenerate?: (tone: string) => void;
|
|
28
|
+
onOpenCognitive?: (e?: React.MouseEvent) => void;
|
|
29
|
+
showTone?: boolean;
|
|
27
30
|
labels?: DeviationSummaryLabels;
|
|
28
31
|
toneLevelsConfig?: ToneType[];
|
|
29
32
|
toneColorsConfig?: Record<string, string>;
|
|
@@ -52,7 +55,31 @@ export interface DeviationSummaryProps {
|
|
|
52
55
|
acceptIcon?: ReactNode;
|
|
53
56
|
rejectIcon?: ReactNode;
|
|
54
57
|
};
|
|
58
|
+
cognitiveSectionStyle?: React.CSSProperties;
|
|
59
|
+
cognitiveScoreBadgeStyle?: React.CSSProperties;
|
|
60
|
+
cognitiveScoreTextStyle?: React.CSSProperties;
|
|
61
|
+
cognitiveStyles?: {
|
|
62
|
+
section?: React.CSSProperties;
|
|
63
|
+
headerLeft?: React.CSSProperties;
|
|
64
|
+
titleIcon?: React.CSSProperties;
|
|
65
|
+
cognitiveTitle?: React.CSSProperties;
|
|
66
|
+
headerRight?: React.CSSProperties;
|
|
67
|
+
scoreBadge?: React.CSSProperties;
|
|
68
|
+
scoreText?: React.CSSProperties;
|
|
69
|
+
};
|
|
70
|
+
cognitiveClassNames?: {
|
|
71
|
+
section?: string;
|
|
72
|
+
headerLeft?: string;
|
|
73
|
+
titleIcon?: string;
|
|
74
|
+
cognitiveTitle?: string;
|
|
75
|
+
headerRight?: string;
|
|
76
|
+
scoreBadge?: string;
|
|
77
|
+
scoreText?: string;
|
|
78
|
+
};
|
|
79
|
+
cognitiveTitle?: string;
|
|
80
|
+
cognitiveLeftIcon?: React.ReactNode;
|
|
81
|
+
showCognitiveRightArrow?: boolean;
|
|
55
82
|
}
|
|
56
|
-
declare function DeviationSummary({ onClose, aiReason, onAccept, onReject, onIterate, initialTone, onRegenerate, labels, toneLevelsConfig, toneColorsConfig, dialConfigs, customStyles, severityChipStyles, customIcons }: DeviationSummaryProps): import("react/jsx-runtime").JSX.Element;
|
|
83
|
+
declare function DeviationSummary({ onClose, aiReason, onAccept, onReject, onIterate, initialTone, onRegenerate, labels, toneLevelsConfig, toneColorsConfig, dialConfigs, customStyles, severityChipStyles, customIcons, onOpenCognitive, showTone, cognitiveSectionStyle, cognitiveScoreBadgeStyle, cognitiveScoreTextStyle, cognitiveStyles, cognitiveClassNames, cognitiveTitle, cognitiveLeftIcon, showCognitiveRightArrow, }: DeviationSummaryProps): import("react/jsx-runtime").JSX.Element;
|
|
57
84
|
export default DeviationSummary;
|
|
58
85
|
//# sourceMappingURL=DeviationSummary.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeviationSummary.d.ts","sourceRoot":"","sources":["../../../../../../../../src/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DeviationSummary.d.ts","sourceRoot":"","sources":["../../../../../../../../src/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.tsx"],"names":[],"mappings":"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"}
|
package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ReactNode, CSSProperties } from "react";
|
|
2
2
|
type Status = "accepted" | "rejected" | "reverted" | string;
|
|
3
|
-
interface ActionConfig {
|
|
3
|
+
export interface ActionConfig {
|
|
4
4
|
icon: ReactNode;
|
|
5
5
|
label: string;
|
|
6
6
|
onClick?: () => void;
|
|
7
7
|
style?: CSSProperties;
|
|
8
8
|
}
|
|
9
|
-
interface CardConfig {
|
|
9
|
+
export interface CardConfig {
|
|
10
10
|
headerBg: string;
|
|
11
11
|
headerBorder: string;
|
|
12
12
|
titleColor: string;
|
|
@@ -21,6 +21,22 @@ interface CardConfig {
|
|
|
21
21
|
actions: ActionConfig[];
|
|
22
22
|
}
|
|
23
23
|
export declare function formatDate(date: string): string;
|
|
24
|
+
export declare const ApprovedIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export declare const RejectedIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export declare const CloseIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare const UserApprovedIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export declare const UserRejectedIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export interface ChevronIconProps {
|
|
30
|
+
open: boolean;
|
|
31
|
+
}
|
|
32
|
+
export declare const ChevronIcon: ({ open }: ChevronIconProps) => import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export interface HistoryIconProps {
|
|
34
|
+
color?: string;
|
|
35
|
+
}
|
|
36
|
+
export declare const HistoryIcon: ({ color }: HistoryIconProps) => import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
export declare const RevertIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
export declare const ReinstateIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
export declare const IterateIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
24
40
|
interface RedlineCardProps {
|
|
25
41
|
status: Status;
|
|
26
42
|
onClose: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RedlineStatusCard.d.ts","sourceRoot":"","sources":["../../../../../../../../src/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.tsx"],"names":[],"mappings":"AACA,OAAO,EAAY,SAAS,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAK3D,KAAK,MAAM,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,MAAM,CAAC;AAE5D,
|
|
1
|
+
{"version":3,"file":"RedlineStatusCard.d.ts","sourceRoot":"","sources":["../../../../../../../../src/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.tsx"],"names":[],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Segment.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/segment/Segment.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAA;AAClD,OAAO,EAAE,uBAAuB,EAAE,aAAa,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAOpH,OAAO,sBAAsB,CAAA;AAG7B,UAAU,YAAY;IAClB,EAAE,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,EAAC,MAAM,CAAC;IACnB,
|
|
1
|
+
{"version":3,"file":"Segment.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/segment/Segment.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAA;AAClD,OAAO,EAAE,uBAAuB,EAAE,aAAa,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAOpH,OAAO,sBAAsB,CAAA;AAG7B,UAAU,YAAY;IAClB,EAAE,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,EAAC,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,+BAA+B,CAAC,EAAE,uBAAuB,CAAC;IAC1D,uBAAuB,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACtC,kBAAkB,CAAC,EAAC,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,gBAAgB,CAAC,EAAC,OAAO,CAAA;IACzB,MAAM,CAAC,EAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAC5B;AAED,QAAA,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAyLnC,CAAA;AAED,eAAe,OAAO,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentWrapper.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/segment/SegmentWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAA;AAGxC,OAAO,EAAY,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAI7E,UAAU,mBAAmB;IACzB,EAAE,EAAC,MAAM,CAAC;IACV,IAAI,EAAE,GAAG,CAAC;IACV,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,EAAE,GAAG,CAAC;IACX,sBAAsB,CAAC,EAAE,uBAAuB,CAAC;IACjD,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB,WAAW,CAAC,EAAE,GAAG,CAAC;IAClB,WAAW,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,KAAK,MAAM,CAAC;IAC/C,gBAAgB,CAAC,EAAC,OAAO,CAAA;CAC5B;AAGD,QAAA,MAAM,cAAc,8GASjB,mBAAmB,
|
|
1
|
+
{"version":3,"file":"SegmentWrapper.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/segment/SegmentWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAA;AAGxC,OAAO,EAAY,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAI7E,UAAU,mBAAmB;IACzB,EAAE,EAAC,MAAM,CAAC;IACV,IAAI,EAAE,GAAG,CAAC;IACV,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,EAAE,GAAG,CAAC;IACX,sBAAsB,CAAC,EAAE,uBAAuB,CAAC;IACjD,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB,WAAW,CAAC,EAAE,GAAG,CAAC;IAClB,WAAW,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,KAAK,MAAM,CAAC;IAC/C,gBAAgB,CAAC,EAAC,OAAO,CAAA;CAC5B;AAGD,QAAA,MAAM,cAAc,8GASjB,mBAAmB,4CAuFrB,CAAA;AAED,eAAe,cAAc,CAAA"}
|
|
@@ -83,6 +83,8 @@ export interface UserStoryWithCitationCustomStyles {
|
|
|
83
83
|
}
|
|
84
84
|
interface UserStoryWithCitationsProps {
|
|
85
85
|
message: string;
|
|
86
|
+
noMarkdownContent?: React.ReactNode;
|
|
87
|
+
useMarkdown?: boolean;
|
|
86
88
|
scenario?: "approving";
|
|
87
89
|
showUserStoryDiff?: boolean;
|
|
88
90
|
aiReasoningsForBlock?: TAIReasoning[];
|
|
@@ -108,6 +110,6 @@ interface UserStoryWithCitationsProps {
|
|
|
108
110
|
displayActionButtons: boolean;
|
|
109
111
|
};
|
|
110
112
|
}
|
|
111
|
-
declare const UserStoryWithCitations: ({ message, isParent, scenario, showUserStoryDiff, aiReasoningsForBlock, isCitationLoadingDisplay, className, highConfidenceIcon, lowConfidenceIcon, customStyles, customIcons, aiReasoningDiffView, userStoryCitations, artifactId, isCraflow, onCraAccept, onCraReject, craFlowConfig, isDisplayHighlightControl, }: UserStoryWithCitationsProps) => import("react/jsx-runtime").JSX.Element;
|
|
113
|
+
declare const UserStoryWithCitations: ({ message, noMarkdownContent, useMarkdown, isParent, scenario, showUserStoryDiff, aiReasoningsForBlock, isCitationLoadingDisplay, className, highConfidenceIcon, lowConfidenceIcon, customStyles, customIcons, aiReasoningDiffView, userStoryCitations, artifactId, isCraflow, onCraAccept, onCraReject, craFlowConfig, isDisplayHighlightControl, }: UserStoryWithCitationsProps) => import("react/jsx-runtime").JSX.Element;
|
|
112
114
|
export default UserStoryWithCitations;
|
|
113
115
|
//# sourceMappingURL=UserStoryWithCitation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserStoryWithCitation.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.tsx"],"names":[],"mappings":"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
|
|
1
|
+
{"version":3,"file":"UserStoryWithCitation.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.tsx"],"names":[],"mappings":"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"}
|