@e-llm-studio/requirement-ai 0.0.243 → 0.0.246
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/UserStoryCard.js +1 -1
- package/dist/cjs/features/RequirementAI/components/lsc-reason-gap/CustomChatCrRedirection.js +1 -1
- package/dist/cjs/features/RequirementAI/components/lsc-reason-gap/GapFilterBlock.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/UserStoryCard.js +1 -1
- package/dist/features/RequirementAI/components/lsc-reason-gap/CustomChatCrRedirection.js +1 -1
- package/dist/features/RequirementAI/components/lsc-reason-gap/GapFilterBlock.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/UserStoryCard.d.ts +5 -2
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/UserStoryCard.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/lsc-reason-gap/CustomChatCrRedirection.d.ts +3 -2
- package/dist/types/src/features/RequirementAI/components/lsc-reason-gap/CustomChatCrRedirection.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/lsc-reason-gap/GapFilterBlock.d.ts +1 -1
- package/dist/types/src/features/RequirementAI/components/lsc-reason-gap/GapFilterBlock.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/segment/SegmentWrapper.d.ts +2 -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 +2 -1
- package/dist/types/src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/interfaces/userstory.interface.d.ts +1 -0
- package/dist/types/src/features/RequirementAI/interfaces/userstory.interface.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/types/segment.type.d.ts +1 -1
- package/dist/types/src/features/RequirementAI/types/segment.type.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),l=require("lucide-react"),n=require("showdown"),o=require("@mui/material"),i=require("../../icons/Illustration.svg.js"),s=require("uuid"),a=require("./UserStoryCard.module.css.js"),r=require("../../utils/helpers.js"),d=require("../../utils/user-story.utils.js"),u=require("../../shared/AtomicButton.js"),c=require("../RichTextEditor/RichTextEditor.js"),v=require("../userstory-with-citation/UserStoryWithCitation.js"),p=require("../RequirementAIWrapper/RequirementAIWrapper.js"),f=require("../story-screen/BigEnoughPanel.js"),m=require("./TitleEditor/TitleEditor.js"),y=require("../../../../service/redlineService.js"),h=require("./ClinicalTrialSection.js"),S=require("../story-screen/CompletionPanel.js"),g=require("../../icons/CDIcon.js");function C(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var x=C(n);const I={[p.SectionStatus.WAITING]:"WAITING TO GENERATE",[p.SectionStatus.IN_PROGRESS]:"IN PROGRESS",[p.SectionStatus.GENERATED]:"GENERATED",[p.SectionStatus.FAILED]:"FAILED",[p.SectionStatus.GENERATE]:"GENERATE",[p.SectionStatus.APPROVED]:"APPROVED"};function j(t){const n=[],i=/<learned>(.*?)<\/learned>/g;let a,r=0,d=0;for(;null!==(a=i.exec(t));){const[,u]=a,c=a.index;c>r&&n.push(e.jsx("span",{children:t.slice(r,c)},"text-pre-"+d++)),n.push(e.jsx(o.Tooltip,{title:u,placement:"top",children:e.jsx(l.Info,{size:16,className:"inline-block mx-1 text-blue-500 hover:text-blue-700 cursor"})},`tooltip-${s.v4()}`)),r=i.lastIndex}return r<(null==t?void 0:t.length)&&n.push(e.jsx("span",{children:t.slice(r)},"text-post-"+d++)),n}function b(e,t,l){var n;if(!e)return{};if(t)return{...e.parentConfig};const o={...e.childConfig};return l&&(null===(n=e.subFeatureOverrides)||void 0===n?void 0:n[l])?{...o,...e.subFeatureOverrides[l]}:o}const w=({displayName:t})=>{var n;const{customStyles:o}=p.useRequirementAI(),i=null===(n=null==o?void 0:o.userStoryCardStyles)||void 0===n?void 0:n.showDisplayName;return e.jsxs("div",{className:a.default.displayName,style:null==i?void 0:i.wrapper,children:[e.jsx(l.Bookmark,{className:a.default.displayNameIcon,style:null==i?void 0:i.displayNameIcon}),e.jsxs("span",{style:null==i?void 0:i.label,children:[t,":"]})]})},N=({isUserStoryCurrentlyUpdated:n,artifactId:C,artifactTitleId:E,parentUserStory:D,currentUserStory:B,onUserStoryChange:A,parentIndex:T,currentIndex:k,enableDownload:U,isDiffEditReviewMode:P,showUserStoryDiff:R,handleDownloadUserStory:M,handleOpenSendDialog:_,updateUserStoryArtifact:q,selectedArtifactId:L,isDisplayHighlightControl:F,elementDisplayConfig:O,_resolvedConfig:z,showWrapper:V=!1,defaultExpanded:W,actionItemsConfig:G,onDelete:$,contextVariant:H,expandedSubFeatures:Q,showDisplayName:Y=!0,allowTitleEdit:X=!0,showConfidenceScore:Z=!0,showBorderTop:J=!0,sectionStatusConfig:K,showCompletionPanel:ee=!1,completionPanelConfig:te,showAddSectionButton:le=!1,disableEditPlan:ne=!1,useMuiTooltip:oe=!1,approveButtonConfig:ie,editButtonConfig:se,CDNeededInChip:ae,blockNumber:re,showAssignSection:de=!1,disableAssignSection:ue=!1,onAssignSectionClick:ce,onSave:ve})=>{var pe,fe,me,ye,he,Se,ge,Ce,xe,Ie,je,be,we,Ne,Ee,De,Be,Ae,Te,ke,Ue,Pe,Re,Me;const{isLoadingSectionData:_e=!1,onLoadSectionData:qe,status:Le,onStatusClick:Fe,completedCount:Oe,totalCount:ze,isNoDataAvailable:Ve=!1}=null!=K?K:{},{searchQueryList:We,citations:Ge,customStyles:$e,onEditBlocked:He,redlineDcoumentId:Qe,redlineConfig:Ye,customSectionConfig:Xe,updateRedlineDataParent:Ze,aiReasoning:Je}=p.useRequirementAI(),Ke=null==$e?void 0:$e.userStoryCardStyles,et=null==Ke?void 0:Ke.customSectionEditButton,tt=null==Ke?void 0:Ke.statusStyles,lt=null===(pe=null==$e?void 0:$e.userStoryCardStyles)||void 0===pe?void 0:pe.userStoryEditStyles,nt=null===(fe=null==$e?void 0:$e.userStoryScreenStyles)||void 0===fe?void 0:fe.userStoryContentStyles,ot=null==Ke?void 0:Ke.progressHeaderStyles,it=null==Ke?void 0:Ke.clinicalTrialSectionStyles,st=null==Ke?void 0:Ke.CompletionStyles,at=null==Ke?void 0:Ke.noDataStyles,rt=null==Ke?void 0:Ke.approveButtonStyles,dt=null!==(ye=null===(me=null==Xe?void 0:Xe.shouldRender)||void 0===me?void 0:me.call(Xe,B))&&void 0!==ye&&ye,ut=null===(he=null==Xe?void 0:Xe.getValue)||void 0===he?void 0:he.call(Xe,B),ct=null!==(ge=null===(Se=null==Xe?void 0:Xe.getFields)||void 0===Se?void 0:Se.call(Xe,B))&&void 0!==ge?ge:[],vt=null!==(Ce=null==Xe?void 0:Xe.isEditDisabled)&&void 0!==Ce&&Ce,pt=null!==(Ie=null===(xe=null==Xe?void 0:Xe.isSaving)||void 0===xe?void 0:xe.call(Xe,B))&&void 0!==Ie&&Ie,ft=(mt=null!==(je=B.completion_percentage)&&void 0!==je?je:0,yt=st,mt>=80?null==yt?void 0:yt.highCompletion:mt>=50?null==yt?void 0:yt.mediumCompletion:null==yt?void 0:yt.lowCompletion);var mt,yt;const ht={[p.SectionStatus.WAITING]:null==tt?void 0:tt.waiting,[p.SectionStatus.IN_PROGRESS]:null==tt?void 0:tt.inProgress,[p.SectionStatus.GENERATED]:null==tt?void 0:tt.generated,[p.SectionStatus.FAILED]:null==tt?void 0:tt.failed,[p.SectionStatus.GENERATE]:null==tt?void 0:tt.generate,[p.SectionStatus.APPROVED]:null==tt?void 0:tt.approved},[St,gt]=t.useState({...structuredClone(B),value:r.formatMarkdown(B.value)||""}),[Ct,xt]=t.useState({userStory:!!B.isDefaultEdit}),[It,jt]=t.useState(!1),[bt,wt]=t.useState(!1),[Nt,Et]=t.useState(null),[Dt,Bt]=t.useState(null),{userStory:At,customIcons:Tt}=p.useRequirementAI(),[kt,Ut]=t.useState(null!=W?W:""===T||L===B.artifactId||!!B.isDefaultOpen),[Pt,Rt]=t.useState(!1),[Mt,_t]=t.useState(null),[qt,Lt]=t.useState(null),[Ft,Ot]=t.useState(!1),zt=t.useRef(null),Vt=t.useRef(null),[Wt,Gt]=t.useState(!1),[$t,Ht]=t.useState(!1),Qt=t.useRef(null),[Yt,Xt]=t.useState(!1),[Zt,Jt]=t.useState(B.value);t.useEffect(()=>{n&&Ut(n)},[n]),t.useEffect(()=>{gt({...structuredClone(B),value:r.formatMarkdown(B.value)||""})},[B]),t.useEffect(()=>{We.length>0?Ut(!0):void 0===W&&L&&Ut(L===B.artifactId)},[We,L,B.artifactId]),t.useEffect(()=>{Q&&Q.length>0&&Ut(Q.includes(B.artifactId)||""===T||L===B.artifactId||!!B.isDefaultOpen)},[Q]);const Kt=()=>{_t(null)},el=()=>{Lt(null)},tl=()=>{kt&&Ct.userStory&&Vt.current&&!Vt.current.requestClose()||Ut(e=>!e)},ll=async()=>{var e,t;try{"userStory"==="userStory"&&(A(St),console.log("I am changing RTE editor values",St)),await(null===(e=null==se?void 0:se.onSaveEditedSection)||void 0===e?void 0:e.call(se,St)),await q(Ge,At,C,null===(t=Qt.current)||void 0===t?void 0:t.signal)}finally{}};const nl=null!=(null==B?void 0:B.big_enough)&&!Number.isNaN(B.big_enough)&&!!(null==B?void 0:B.big_enough_decision_factors),ol=null!==(be=null==B?void 0:B.completion_percentage)&&void 0!==be?be:0,il=!!(null==B?void 0:B.completion_decision_factors),sl=""===T,al=null!=z?z:b(O,sl),rl=!P&&!R;t.useEffect(()=>{if(!Dt)return;const e=setTimeout(()=>{const e=document.getElementById(`story-card-${Dt}`);null==e||e.scrollIntoView({behavior:"smooth",block:"start"})},100);return()=>clearTimeout(e)},[Dt]),t.useEffect(()=>{B.isDefaultEdit&&xt(e=>({...e,userStory:!0}))},[B.isDefaultEdit]),console.log("block number in userstory card ",re),console.log("[TESTING-CURRENT-USER-STORY] \n",B,"\n[TESTING-USER-STORY] \n",At);return t.useEffect(()=>Jt(B.value),[B.value]),e.jsxs("div",{className:a.default.card,"data-block-id":"user-story-card-wrapper-"+re,style:null==Ke?void 0:Ke.cardStyle,id:`story-card-${B.title}`,"data-expanded":kt,children:[e.jsxs("div",{className:a.default.titleSection,style:null==Ke?void 0:Ke.titleSection,children:[e.jsxs("div",{className:a.default.titleRow,style:null==Ke?void 0:Ke.titleRow,onClick:tl,children:[e.jsxs("div",{className:a.default.titleLeft,style:null==Ke?void 0:Ke.titleLeft,onMouseEnter:()=>Gt(!0),onMouseLeave:()=>Gt(!1),children:[Y&&e.jsx(w,{displayName:E}),It&&rl?e.jsx(m.InlineTitleEditor,{title:B.title,onSave:e=>(async(e,t)=>{var l;try{let n={...B};B.artifactId===t?n.title=e:n.sub_features=(null===(l=B.sub_features)||void 0===l?void 0:l.map(l=>l.artifactId===t?{...l,title:e}:l))||[],gt(n),A(n),jt(!1)}catch(e){console.error("Failed to save title",e)}})(e,B.artifactId),onCancel:()=>{jt(!1)},inputStyle:null==lt?void 0:lt.inlineTitleInput,confirmButtonStyle:null==lt?void 0:lt.inlineTitleConfirm,cancelButtonStyle:null==lt?void 0:lt.inlineTitleCancel},"inline-title-editor"):e.jsxs("div",{className:a.default.storyTitleWrapper,children:[e.jsx(o.Tooltip,{title:j(B.title),arrow:!0,children:e.jsx("h2",{title:oe?void 0:B.title,className:a.default.storyTitle,style:null==Ke?void 0:Ke.storyTitle,children:j(B.title)},B.artifactId)}),ee&&(il?e.jsx(S.CompletionPanel,{customIcons:null==Tt?void 0:Tt.userStoryIcons,customStyles:null==Ke?void 0:Ke.aiReasoningCitaionStyles,currentUserStory:B,panelStyles:null==Ke?void 0:Ke.CompletionStyles,onToggleStateChange:Ht,completionPanelConfig:te,children:e.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:"4px",...null==st?void 0:st.badge,...ft},children:[e.jsxs("span",{children:[ol,"% Completed"]}),e.jsx("span",{style:{display:"flex",alignItems:"center"},children:e.jsx(g.default,{color:"currentColor"})}),$t?e.jsx(l.ChevronUp,{size:14,style:null==st?void 0:st.chevronStyle}):e.jsx(l.ChevronDown,{size:14,style:null==st?void 0:st.chevronStyle})]})}):e.jsx("div",{style:{display:"inline-flex",alignItems:"center",gap:"4px",...null==st?void 0:st.badge,...ft},children:e.jsxs("span",{children:[ol,"% Completed"]})})),X&&e.jsx("button",{type:"button",className:a.default.titleEditButton,style:null==lt?void 0:lt.titleEditButton,onClick:e=>{e.stopPropagation(),jt(!0),kt||Ut(!0)},"aria-label":"Edit title",title:"Edit title",children:e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M8.99998 14.9992H15.75M2.25 14.9992H3.50591C3.87279 14.9992 4.05624 14.9992 4.22887 14.9577C4.38192 14.921 4.52824 14.8604 4.66245 14.7782C4.81382 14.6854 4.94354 14.5557 5.20296 14.2962L14.625 4.87419C15.2463 4.25287 15.2463 3.24551 14.625 2.62419C14.0037 2.00287 12.9963 2.00287 12.375 2.62419L2.95295 12.0462C2.69352 12.3057 2.5638 12.4354 2.47104 12.5868C2.3888 12.721 2.32819 12.8673 2.29145 13.0203C2.25 13.193 2.25 13.3764 2.25 13.7433V14.9992Z",stroke:"#94A3B8","stroke-width":"1.54286","stroke-linecap":"round","stroke-linejoin":"round"})})})]})]}),(Le||void 0!==Oe&&void 0!==ze)&&e.jsxs("div",{className:a.default.statusContainer,children:[void 0!==Oe&&void 0!==ze&&e.jsxs("div",{className:a.default.completedBadge,children:["Completed: ",Oe,"/",ze]}),Le&&e.jsx("button",{type:"button",onClick:e=>{e.stopPropagation(),null==Fe||Fe()},onMouseEnter:()=>Xt(!0),onMouseLeave:()=>Xt(!1),className:a.default.statusButton,style:{...null===(we=ht[Le])||void 0===we?void 0:we.default,...Yt&&(null===(Ne=ht[Le])||void 0===Ne?void 0:Ne.hover)},children:I[Le]})]}),e.jsxs("div",{className:a.default.titleActions,style:null==Ke?void 0:Ke.titleActions,onClick:e=>e.stopPropagation(),children:[(al.showProgressPercentage||al.showGapBox)&&V&&e.jsxs("div",{className:a.default.progressHeader,style:null==ot?void 0:ot.wrapper,children:[al.showProgressPercentage&&e.jsxs("div",{className:a.default.progressPercentage,style:null==ot?void 0:ot.percentage,children:[null!==(De=null!==(Ee=null==B?void 0:B.confidenceScore)&&void 0!==Ee?Ee:null==al?void 0:al.confidenceValue)&&void 0!==De?De:"0","%"]}),al.showGapBox&&e.jsxs("div",{className:a.default.gapBox,style:null==ot?void 0:ot.gapBox,children:[null!==(Ae=null!==(Be=null==B?void 0:B.gapValue)&&void 0!==Be?Be:null==al?void 0:al.gapBoxValue)&&void 0!==Ae?Ae:"2"," ","Gaps"]})]}),nl&&e.jsx(f.BigEnoughPanel,{customIcons:null==Tt?void 0:Tt.userStoryIcons,customStyles:null==Ke?void 0:Ke.aiReasoningCitaionStyles,currentUserStory:B,panelStyles:null==Ke?void 0:Ke.BigEnoughStyles}),de&&e.jsx("button",{type:"button",className:a.default.iconButton,style:null==Ke?void 0:Ke.iconButton,disabled:ue,onClick:e=>{e.stopPropagation(),null==ce||ce(B)},"aria-label":"Assign section users",title:"Assign section users",children:e.jsx(l.Users,{size:16})}),!Ct.userStory&&e.jsxs(e.Fragment,{children:[!1!==(null==al?void 0:al.showShareButton)&&e.jsx("button",{className:a.default.iconButton,style:null==Ke?void 0:Ke.iconButton,onClick:e=>{_t(e.currentTarget)},children:e.jsx(l.ExternalLink,{size:16})}),e.jsxs(o.Menu,{id:"user-story-share-menu",anchorEl:Mt,open:!!Mt,onClose:()=>_t(null),style:null==Ke?void 0:Ke.userStoryShareMenu,children:[U&&e.jsx(o.MenuItem,{style:null==Ke?void 0:Ke.userStoryMenuItem,onClick:async()=>{Rt(!0),M&&(await Promise.all([M("pdf"),M("doc")]),Rt(!1))},children:e.jsxs("div",{ref:zt,className:a.default.menuItemContent,style:null==Ke?void 0:Ke.menuItemContent,children:[e.jsx(l.Download,{size:16,color:null==Ke?void 0:Ke.menuIconColor}),e.jsx("p",{style:null==Ke?void 0:Ke.menuLabel,children:"Download"})]})}),e.jsx(o.MenuItem,{style:null==Ke?void 0:Ke.userStoryMenuItem,onClick:async()=>{let e=B;D&&(e={...B,value:`${d.replaceTitleSection(null==D?void 0:D.value,B.title)} \n${B.value}`}),null==_||_(!0,[e],B.artifactId),Kt()},children:e.jsxs("div",{style:null==Ke?void 0:Ke.menuItemContent,className:a.default.menuItemContentPadded,children:[e.jsx(l.Share2,{size:16,color:null==Ke?void 0:Ke.menuIconColor}),e.jsx("p",{style:null==Ke?void 0:Ke.menuLabel,children:"Send"})]})}),e.jsx(o.MenuItem,{style:null==Ke?void 0:Ke.userStoryMenuItem,onClick:async()=>{const e=(new x.default.Converter).makeHtml(r.formatMarkdown(B.value)||B.value),t=function(e){const t=(new x.default.Converter).makeHtml(e),l=document.createElement("div");return l.innerHTML=t,l.textContent||l.innerText||""}(r.formatMarkdown(B.value)||B.value),l=new ClipboardItem({"text/plain":new Blob([t],{type:"text/plain"}),"text/html":new Blob([e],{type:"text/html"})});try{await navigator.clipboard.write([l]),console.log("Copied User Story")}catch(e){console.error("Failed to copy user story:",e)}finally{Kt()}},children:e.jsxs("div",{style:null==Ke?void 0:Ke.menuItemContent,className:a.default.menuItemContentPadded,children:[e.jsx(l.Copy,{size:16,color:null==Ke?void 0:Ke.menuIconColor}),e.jsx("p",{style:null==Ke?void 0:Ke.menuLabel,children:"Copy"})]})})]})]}),!Ft&&Ct.userStory&&kt?e.jsx(u.default,{type:"outline",children:"Cancel",style:null==Ke?void 0:Ke.cancelButton,onClick:()=>{var e;null===(e=Qt.current)||void 0===e||e.abort(),xt(e=>({...e,userStory:!1}))}}):e.jsx(e.Fragment,{}),Ct.userStory&&kt?e.jsx(u.default,{type:"fill",children:Ft?e.jsxs("span",{className:a.default.savingSpinner,style:null==Ke?void 0:Ke.savingSpinner,children:[e.jsx(l.LoaderCircle,{className:a.default.spinAnimation,style:null==Ke?void 0:Ke.spinAnimation}),e.jsx("span",{children:"Saving..."})]}):"Save",isDisable:Ft,style:Ft?null==Ke?void 0:Ke.savingButton:null==Ke?void 0:Ke.saveButton,onClick:async()=>{Ot(!0),await ll();let e=await(async()=>{var e,t,l,n,o;let i=St.value;console.log("[V] valueToUpdate before",i),i=i.replace(/<invisible\s+id="([^"]+)"\s*><\/invisible>/gi,"\x3c!-- $1 --\x3e"),console.log("[V] valueToUpdate after",i);try{await(null==ve?void 0:ve(i,B.artifactId))}catch(e){}try{if(null==Ye?void 0:Ye.callUpdateDocument){const{updated_reqai:s}=await y.updateRedlineDocument({documentId:Qe,sectionId:B.artifactId,baseApiUrl:null==Ye?void 0:Ye.baseApiUrl,updatedContent:i,userEmail:Ye.userEmail,userName:Ye.userName,redlineConfigId:null!==(e=Ye.redlineConfigId)&&void 0!==e?e:""},null!==(t=null==Ye?void 0:Ye.token)&&void 0!==t?t:"");i=null===(o=null===(n=null===(l=null==s?void 0:s.artifactData)||void 0===l?void 0:l.userStorySnapshot)||void 0===n?void 0:n[0])||void 0===o?void 0:o.value,await(null==Ze?void 0:Ze(s))}}catch(e){console.error("failed to update redline document",e),i=Zt}return i=i.replace(/<!--\s*([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\s*-->/gi,'<invisible id="$1"></invisible>'),i})();const t={...St,value:e};A({...t,isDefaultEdit:!1}),Jt(t.value),xt(e=>({...e,userStory:!1})),Ot(!1)}}):!P&&!R&&!ne&&kt&&!1!==(null==al?void 0:al.showEditButton)&&e.jsx("button",{className:a.default.iconButton,style:null==Ke?void 0:Ke.editButton,onClick:()=>xt(e=>({...e,userStory:!0})),children:e.jsx(l.PencilIcon,{color:null==Ke?void 0:Ke.pencilIconColor,size:16})}),le&&sl&&kt&&!P&&!R&&!1!==(null==al?void 0:al.showEditButton)&&e.jsxs("button",{type:"button",className:a.default.addSectionButton,style:null==lt?void 0:lt.addSectionButton,onClick:e=>{var t,l,n;e.stopPropagation();const o=(null!==(l=null===(t=B.sub_features)||void 0===t?void 0:t.length)&&void 0!==l?l:0)+1,i={artifactId:s.v4(),title:`New Section ${o}`,value:"Please add details for this section.",section:"subfeature",isDefaultOpen:!0},a={...B,sub_features:[...null!==(n=B.sub_features)&&void 0!==n?n:[],i]};gt(a),A(a),Ut(!0),Bt(i.title)},"aria-label":"Add section",title:"Add section",children:[e.jsx(l.Plus,{size:14}),e.jsx("span",{className:a.default.addSectionLabel,children:"Add Section"})]}),!sl&&!P&&!ne&&!R&&e.jsx("button",{type:"button",onClick:e=>{e.stopPropagation(),null==$||$()},className:a.default.iconButton,style:null==lt?void 0:lt.deleteButton,"aria-label":"Delete section",title:"Delete section",children:e.jsx(l.Trash2,{size:16})}),dt&&e.jsx("button",{type:"button",className:a.default.iconButton,style:null==et?void 0:et.button,disabled:vt,onClick:e=>{if(e.stopPropagation(),bt)return Et(null),void wt(!1);Et(structuredClone(null!=ut?ut:{})),Ut(!0),wt(!0)},children:bt?e.jsx(l.X,{size:16,color:null==Ke?void 0:Ke.pencilIconColor,style:null==et?void 0:et.cancelIcon}):e.jsx(l.PencilIcon,{size:16,color:null==Ke?void 0:Ke.pencilIconColor,style:null==et?void 0:et.editIcon})}),(null==al?void 0:al.actionItemsButton)&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:a.default.actionItemBtn,style:null==Ke?void 0:Ke.actionItemBtn,onClick:e=>{e.stopPropagation(),Lt(e.currentTarget)},children:e.jsx(l.Ellipsis,{})}),e.jsx(o.Menu,{id:"user-story-action-menu",anchorEl:qt,open:!!qt,onClose:el,style:null==Ke?void 0:Ke.userStoryShareMenu,children:null==G?void 0:G.items.map((t,l)=>e.jsx(o.MenuItem,{style:null==Ke?void 0:Ke.userStoryMenuItem,onClick:()=>{t.onclick(B),el()},children:e.jsxs("div",{className:a.default.menuItemContent,style:{...null==Ke?void 0:Ke.menuItemContent,...!t.isActive&&{cursor:"not-allowed",opacity:.5}},children:[e.jsx("span",{className:a.default.menuItemIcon,style:null==Ke?void 0:Ke.menuItemIcon,children:t.icon}),e.jsx("p",{style:null==Ke?void 0:Ke.menuLabel,children:t.name}),e.jsx("span",{className:a.default.menuItemRight,style:null==Ke?void 0:Ke.menuItemRight})]})},`action-item-${l}-${t.name}`))})]}),e.jsx("button",{type:"button",onClick:e=>{e.stopPropagation(),tl()},style:null==Ke?void 0:Ke.chevronButton,className:a.default.chevronButton,children:kt?e.jsx(l.ChevronUp,{className:a.default.chevronIcon,color:null==Ke?void 0:Ke.chevronIconColor}):e.jsx(l.ChevronDown,{className:a.default.chevronIcon,color:null==Ke?void 0:Ke.chevronIconColor})})]})]}),e.jsx("div",{className:a.default.divider,style:null==Ke?void 0:Ke.dividerStyle})]}),kt&&e.jsx("div",{className:a.default.cardContent,style:{...null==Ke?void 0:Ke.cardContentStyle,borderTop:J?"1px solid #E5E5E5":"none"},children:_e?e.jsxs("div",{className:a.default.loadingContainer,children:[e.jsx("div",{className:a.default.loadingIconWrapper,children:e.jsx(l.Hourglass,{size:28,color:"#5B3DF5",className:a.default.spinAnimation})}),e.jsxs("div",{children:[e.jsx("h3",{className:a.default.loadingTitle,children:"Section generation in progress.."}),e.jsx("p",{className:a.default.loadingSubtitle,children:"This may take a few minutes"})]}),e.jsx("button",{type:"button",onClick:()=>null==qe?void 0:qe(),className:a.default.viewStatusButton,children:"View Status"})]}):Ve?e.jsxs("div",{className:a.default.noDataContainer,style:null==at?void 0:at.container,children:[e.jsx("img",{src:i.default,alt:"No data available",className:a.default.noDataIllustration,style:null==at?void 0:at.illustration}),e.jsx("h3",{className:a.default.noDataTitle,style:null==at?void 0:at.title,children:"No Data Available for This Section"}),e.jsx("p",{className:a.default.noDataSubtitle,style:null==at?void 0:at.subtitle,children:"We couldn't find data for this section yet. Upload the required document from the Documents tab to generate content."})]}):e.jsxs("div",{className:a.default.contentInner,style:null==Ke?void 0:Ke.contentInner,children:[e.jsxs("div",{className:a.default.descriptionSection,style:null==Ke?void 0:Ke.descriptionSection,children:[e.jsx("div",{className:a.default.justifyBetween,style:null==Ke?void 0:Ke.justifyBetween}),Ct.userStory?e.jsx(c.default,{ref:Vt,minHeight:"100%",height:"100%",type:"string",value:r.formatMarkdown(Zt)||"",handleUpdateState:(e,t)=>{const l=d.postprocessUserStoryAfterEdit(r.indentMarkdown(t));gt(e=>({...e,value:l||""}))},doNotShowBorderInViewMode:!1,onBlur:()=>{},mode:Ct.userStory?"edit":"readOnly",onEditBlocked:He,onSaveUnsavedChanges:async()=>{await ll(),Ut(!1)},onDiscardUnsavedChanges:()=>{gt({...structuredClone(B),value:r.formatMarkdown(B.value)||""}),xt(e=>({...e,userStory:!1})),Ut(!1)},isSavingUnsavedChanges:Ft}):dt?e.jsx(h.default,{styles:it,fields:ct,readonly:!bt,isSaving:pt,value:null!==(Te=null!=Nt?Nt:ut)&&void 0!==Te?Te:{},onChange:Et,onSave:async()=>{var e;Nt&&(await(null===(e=null==Xe?void 0:Xe.onSave)||void 0===e?void 0:e.call(Xe,B,Nt)),Et(null),wt(!1))},onCancel:()=>{Et(null),wt(!1)}}):e.jsxs(e.Fragment,{children:[e.jsx(v.default,{showUserStoryDiff:R,isParent:""===T,message:r.formatMarkdown(B.value)||"",artifactId:B.artifactId,customStyles:nt,isDisplayHighlightControl:F,contextVariant:H,showConfidenceScore:Z,CDNeededInChip:ae,blockId:re}),(ie||se)&&e.jsxs("div",{className:a.default.actionButtonsContainer,style:null==rt?void 0:rt.container,children:[se&&!Ct.userStory&&e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:a.default.actionButton,style:null==rt?void 0:rt.button,disabled:se.disabled||se.isLoading,onClick:e=>{var t;e.stopPropagation(),null===(t=se.onClick)||void 0===t||t.call(se),xt(e=>({...e,userStory:!0})),Ut(!0)},children:se.isLoading?e.jsxs(e.Fragment,{children:[e.jsx(l.LoaderCircle,{size:16,className:a.default.actionButtonSpinner,style:null==rt?void 0:rt.icon}),e.jsx("span",{style:null==rt?void 0:rt.text,children:null!==(ke=se.label)&&void 0!==ke?ke:"Edit"})]}):e.jsxs(e.Fragment,{children:[e.jsx(l.PencilIcon,{size:16,style:null==rt?void 0:rt.icon}),e.jsx("span",{style:null==rt?void 0:rt.text,children:null!==(Ue=se.label)&&void 0!==Ue?Ue:"Edit"})]})}),ie&&e.jsx("span",{className:a.default.actionButtonDivider})]}),ie&&e.jsx("button",{type:"button",className:a.default.actionButton,style:null==rt?void 0:rt.button,disabled:ie.disabled||ie.isLoading,onClick:e=>{var t;e.stopPropagation(),null===(t=ie.onClick)||void 0===t||t.call(ie)},children:ie.isLoading?e.jsxs(e.Fragment,{children:[e.jsx(l.LoaderCircle,{size:16,className:a.default.actionButtonSpinner,style:null==rt?void 0:rt.icon}),e.jsx("span",{style:null==rt?void 0:rt.text,children:null!==(Pe=ie.label)&&void 0!==Pe?Pe:"Approve"})]}):e.jsxs(e.Fragment,{children:[e.jsx(l.Check,{size:16,style:null==rt?void 0:rt.icon}),e.jsx("span",{style:null==rt?void 0:rt.text,children:null!==(Re=ie.label)&&void 0!==Re?Re:"Approve"})]})})]})]})]}),null===(Me=St.sub_features)||void 0===Me?void 0:Me.map((t,l)=>{console.log("UserStoryCardWrapper: sub",t);const o=b(O,!1,t.artifactId);return e.jsx(N,{artifactId:C,isUserStoryCurrentlyUpdated:n,artifactTitleId:`${E}-${String.fromCharCode(65+l)}`,parentUserStory:B,parentIndex:`${T}${T&&"."}${k}`,currentIndex:`${l+1}`,doNotShowBorderInViewMode:!1,currentUserStory:t,onUserStoryChange:e=>((e,t)=>{const l=[...B.sub_features||[]];l[e]=t,A({...B,sub_features:l})})(l,e),enableDownload:!0,isDiffEditReviewMode:P,showUserStoryDiff:R,updateUserStoryArtifact:q,handleDownloadUserStory:M,handleOpenSendDialog:_,isDisplayHighlightControl:F,elementDisplayConfig:O,_resolvedConfig:o,actionItemsConfig:G,onDelete:()=>(e=>{const t=(B.sub_features||[]).filter((t,l)=>l!==e),l={...B,sub_features:t};gt(l),A(l)})(l),expandedSubFeatures:Q,disableEditPlan:ne,useMuiTooltip:oe,blockNumber:t.blockNumber,showAssignSection:de,onAssignSectionClick:ce,onSave:ve},t.artifactId)})]})})]})};exports.StoryCard=N,exports.UserStoryCardWrapper=({artifactTitleIDs:n,expandedSubFeatures:o,isDiffEditReviewMode:i,showUserStoryDiff:s,updateUserStoryArtifact:r,isUserStoryCurrentlyUpdated:d,artifactId:u,handleOpenSendDialog:c,handleDownloadUserStory:v,selectedArtifactId:f,isDisplayHighlightControl:m,elementDisplayConfig:h,showWrapper:S,actionItemsConfig:g,contextVariant:C,showDisplayName:x,allowTitleEdit:I,showConfidenceScore:j,showBorderTop:w,defaultExpanded:E,showCompletionPanel:D=!1,completionPanelConfig:B,showAddSectionButton:A=!1,disableEditPlan:T=!1,useMuiTooltip:k=!1,approveButtonConfig:U,editButtonConfig:P,CDNeededInChip:R,setRedlineDocumentIdParent:M,showAssignSection:_,onAssignSectionClick:q,disableAssignSection:L,onSave:F})=>{const{userStory:O,setUserStory:z,customStyles:V,searchQueryList:W,currentHighlightIndex:G,setCurrentHighlightIndex:$,segmentComponentConfig:H,sectionStatusConfig:Q,redlineConfig:Y,setRedlineDocumentId:X}=p.useRequirementAI(),Z=null==V?void 0:V.userStoryCardStyles,J=0===G,K=G===W.length-1;return t.useEffect(()=>{if(!(null==Y?void 0:Y.callCreateDocumentOnInit))return;(async()=>{var e;const{redline_document_id:t}=await y.getRedlineDocumentId({baseApiUrl:Y.documentBaseApiUrl||"",comparisonId:Y.documentComparisonId||""});if(t)X(t);else{const{document_id:t}=await y.createRedlineDocument({baseApiUrl:Y.baseApiUrl,changelogConfigId:Y.changelogConfigId,comparisonId:Y.documentComparisonId,artifactId:Y.artifactId,inputData:Y.inputData,redlineConfigId:Y.redlineConfigId,userEmail:Y.userEmail,userName:Y.userName},null!==(e=null==Y?void 0:Y.token)&&void 0!==e?e:"");t&&(X(t),null==M||M(t))}})()},[]),e.jsxs("div",{className:a.default.userStoryCardWrapper,style:m?{...null==Z?void 0:Z.userStoryCardWrapper,position:"relative"}:null==Z?void 0:Z.userStoryCardWrapper,children:[m&&e.jsx(e.Fragment,{children:W.length>0&&e.jsx("div",{className:a.default.wrapper,children:e.jsx("div",{className:a.default.highlightNavigation,children:e.jsxs("div",{className:a.default.navigationContainer,children:[e.jsxs("span",{className:a.default.navCounter,children:[G+1," of ",W.length]}),e.jsxs("div",{className:a.default.navButtons,children:[e.jsx("button",{onClick:()=>{G>0&&$(e=>e-1)},className:a.default.navButton,disabled:J,children:e.jsx(l.ChevronUpIcon,{size:20,className:a.default.navIcon})}),e.jsx("button",{onClick:()=>{G<W.length-1&&$(e=>e+1)},className:a.default.navButton,disabled:K,children:e.jsx(l.ChevronDownIcon,{size:20,className:a.default.navIcon})})]})]})})})}),O.map((t,l)=>{console.log("UserStoryCardWrapper: userstory",t);const a=b(h,!0);return e.jsx(N,{isUserStoryCurrentlyUpdated:d,artifactId:u,artifactTitleId:n[l]||"",expandedSubFeatures:o,currentUserStory:t,onUserStoryChange:e=>{z(t=>(t[l]=e,[...t]))},parentIndex:"",currentIndex:`${l+1}`,doNotShowBorderInViewMode:!0,enableDownload:!0,isDiffEditReviewMode:i,showUserStoryDiff:s,updateUserStoryArtifact:r,handleOpenSendDialog:c,handleDownloadUserStory:v,selectedArtifactId:f,isDisplayHighlightControl:m,elementDisplayConfig:h,_resolvedConfig:a,showWrapper:S,defaultExpanded:E,actionItemsConfig:g,contextVariant:C,showDisplayName:x,allowTitleEdit:I,showConfidenceScore:j,showBorderTop:w,sectionStatusConfig:Q,showCompletionPanel:D,completionPanelConfig:B,showAddSectionButton:A,disableEditPlan:T,useMuiTooltip:k,approveButtonConfig:U,CDNeededInChip:R,editButtonConfig:P,showAssignSection:_,disableAssignSection:L,onAssignSectionClick:q,onSave:F},t.artifactId)})]})},exports.default=N,exports.replaceLearnedTagsWithInfo=j;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),l=require("lucide-react"),n=require("showdown"),o=require("@mui/material"),i=require("../../icons/Illustration.svg.js"),s=require("uuid"),a=require("./UserStoryCard.module.css.js"),r=require("../../utils/helpers.js"),d=require("../../utils/user-story.utils.js"),u=require("../../shared/AtomicButton.js"),c=require("../RichTextEditor/RichTextEditor.js"),v=require("../userstory-with-citation/UserStoryWithCitation.js"),p=require("../RequirementAIWrapper/RequirementAIWrapper.js"),m=require("../story-screen/BigEnoughPanel.js"),f=require("./TitleEditor/TitleEditor.js"),y=require("../../../../service/redlineService.js"),h=require("./ClinicalTrialSection.js"),S=require("../story-screen/CompletionPanel.js"),g=require("../../icons/CDIcon.js");function C(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var x=C(n);const I={[p.SectionStatus.WAITING]:"WAITING TO GENERATE",[p.SectionStatus.IN_PROGRESS]:"IN PROGRESS",[p.SectionStatus.GENERATED]:"GENERATED",[p.SectionStatus.FAILED]:"FAILED",[p.SectionStatus.GENERATE]:"GENERATE",[p.SectionStatus.APPROVED]:"APPROVED"};function j(t){const n=[],i=/<learned>(.*?)<\/learned>/g;let a,r=0,d=0;for(;null!==(a=i.exec(t));){const[,u]=a,c=a.index;c>r&&n.push(e.jsx("span",{children:t.slice(r,c)},"text-pre-"+d++)),n.push(e.jsx(o.Tooltip,{title:u,placement:"top",children:e.jsx(l.Info,{size:16,className:"inline-block mx-1 text-blue-500 hover:text-blue-700 cursor"})},`tooltip-${s.v4()}`)),r=i.lastIndex}return r<(null==t?void 0:t.length)&&n.push(e.jsx("span",{children:t.slice(r)},"text-post-"+d++)),n}function b(e,t,l){var n;if(!e)return{};if(t)return{...e.parentConfig};const o={...e.childConfig};return l&&(null===(n=e.subFeatureOverrides)||void 0===n?void 0:n[l])?{...o,...e.subFeatureOverrides[l]}:o}const N=({displayName:t})=>{var n;const{customStyles:o}=p.useRequirementAI(),i=null===(n=null==o?void 0:o.userStoryCardStyles)||void 0===n?void 0:n.showDisplayName;return e.jsxs("div",{className:a.default.displayName,style:null==i?void 0:i.wrapper,children:[e.jsx(l.Bookmark,{className:a.default.displayNameIcon,style:null==i?void 0:i.displayNameIcon}),e.jsxs("span",{style:null==i?void 0:i.label,children:[t,":"]})]})},w=({isUserStoryCurrentlyUpdated:n,artifactId:C,artifactTitleId:E,parentUserStory:D,currentUserStory:B,onUserStoryChange:A,parentIndex:T,currentIndex:k,enableDownload:U,isDiffEditReviewMode:P,showUserStoryDiff:R,handleDownloadUserStory:M,handleOpenSendDialog:_,updateUserStoryArtifact:q,selectedArtifactId:L,isDisplayHighlightControl:F,elementDisplayConfig:O,_resolvedConfig:$,showWrapper:z=!1,defaultExpanded:V,actionItemsConfig:W,onDelete:G,contextVariant:H,expandedSubFeatures:Q,showDisplayName:Y=!0,allowTitleEdit:X=!0,showConfidenceScore:Z=!0,showBorderTop:J=!0,sectionStatusConfig:K,showCompletionPanel:ee=!1,completionPanelConfig:te,showAddSectionButton:le=!1,disableEditPlan:ne=!1,useMuiTooltip:oe=!1,approveButtonConfig:ie,editButtonConfig:se,CDNeededInChip:ae,blockNumber:re,storyNumber:de,showAssignSection:ue=!1,disableAssignSection:ce=!1,onAssignSectionClick:ve,onSave:pe,onUserStoryAccordionStateChange:me})=>{var fe,ye,he,Se,ge,Ce,xe,Ie,je,be,Ne,we,Ee,De,Be,Ae,Te,ke,Ue,Pe,Re,Me,_e,qe;const{isLoadingSectionData:Le=!1,onLoadSectionData:Fe,status:Oe,onStatusClick:$e,completedCount:ze,totalCount:Ve,isNoDataAvailable:We=!1}=null!=K?K:{},{searchQueryList:Ge,citations:He,customStyles:Qe,onEditBlocked:Ye,redlineDcoumentId:Xe,redlineConfig:Ze,customSectionConfig:Je,updateRedlineDataParent:Ke,aiReasoning:et}=p.useRequirementAI(),tt=null==Qe?void 0:Qe.userStoryCardStyles,lt=null==tt?void 0:tt.customSectionEditButton,nt=null==tt?void 0:tt.statusStyles,ot=null===(fe=null==Qe?void 0:Qe.userStoryCardStyles)||void 0===fe?void 0:fe.userStoryEditStyles,it=null===(ye=null==Qe?void 0:Qe.userStoryScreenStyles)||void 0===ye?void 0:ye.userStoryContentStyles,st=null==tt?void 0:tt.progressHeaderStyles,at=null==tt?void 0:tt.clinicalTrialSectionStyles,rt=null==tt?void 0:tt.CompletionStyles,dt=null==tt?void 0:tt.noDataStyles,ut=null==tt?void 0:tt.approveButtonStyles,ct=null!==(Se=null===(he=null==Je?void 0:Je.shouldRender)||void 0===he?void 0:he.call(Je,B))&&void 0!==Se&&Se,vt=null===(ge=null==Je?void 0:Je.getValue)||void 0===ge?void 0:ge.call(Je,B),pt=null!==(xe=null===(Ce=null==Je?void 0:Je.getFields)||void 0===Ce?void 0:Ce.call(Je,B))&&void 0!==xe?xe:[],mt=null!==(Ie=null==Je?void 0:Je.isEditDisabled)&&void 0!==Ie&&Ie,ft=null!==(be=null===(je=null==Je?void 0:Je.isSaving)||void 0===je?void 0:je.call(Je,B))&&void 0!==be&&be,yt=(ht=null!==(Ne=B.completion_percentage)&&void 0!==Ne?Ne:0,St=rt,ht>=80?null==St?void 0:St.highCompletion:ht>=50?null==St?void 0:St.mediumCompletion:null==St?void 0:St.lowCompletion);var ht,St;const gt={[p.SectionStatus.WAITING]:null==nt?void 0:nt.waiting,[p.SectionStatus.IN_PROGRESS]:null==nt?void 0:nt.inProgress,[p.SectionStatus.GENERATED]:null==nt?void 0:nt.generated,[p.SectionStatus.FAILED]:null==nt?void 0:nt.failed,[p.SectionStatus.GENERATE]:null==nt?void 0:nt.generate,[p.SectionStatus.APPROVED]:null==nt?void 0:nt.approved},[Ct,xt]=t.useState({...structuredClone(B),value:r.formatMarkdown(B.value)||""}),[It,jt]=t.useState({userStory:!!B.isDefaultEdit}),[bt,Nt]=t.useState(!1),[wt,Et]=t.useState(!1),[Dt,Bt]=t.useState(null),[At,Tt]=t.useState(null),{userStory:kt,customIcons:Ut}=p.useRequirementAI(),[Pt,Rt]=t.useState(null!=V?V:""===T||L===B.artifactId||!!B.isDefaultOpen),[Mt,_t]=t.useState(!1),[qt,Lt]=t.useState(null),[Ft,Ot]=t.useState(null),[$t,zt]=t.useState(!1),Vt=t.useRef(null),Wt=t.useRef(null),[Gt,Ht]=t.useState(!1),[Qt,Yt]=t.useState(!1),Xt=t.useRef(null),[Zt,Jt]=t.useState(!1),[Kt,el]=t.useState(B.value);t.useEffect(()=>{n&&Rt(n)},[n]),t.useEffect(()=>{xt({...structuredClone(B),value:r.formatMarkdown(B.value)||""})},[B]),t.useEffect(()=>{Ge.length>0?Rt(!0):void 0===V&&L&&Rt(L===B.artifactId)},[Ge,L,B.artifactId]),t.useEffect(()=>{Q&&Q.length>0&&de&&re&&Rt(Q.includes(`${de}-${re}`)||""===T||L===B.artifactId||!!B.isDefaultOpen)},[Q,de,re]);const tl=()=>{Lt(null)},ll=()=>{Ot(null)},nl=()=>{if(Pt&&It.userStory&&Wt.current&&!Wt.current.requestClose())return;const e=!Pt;Rt(e),null==me||me(B,e)},ol=async()=>{var e,t;try{"userStory"==="userStory"&&(A(Ct),console.log("I am changing RTE editor values",Ct)),await(null===(e=null==se?void 0:se.onSaveEditedSection)||void 0===e?void 0:e.call(se,Ct)),await q(He,kt,C,null===(t=Xt.current)||void 0===t?void 0:t.signal)}finally{}};const il=null!=(null==B?void 0:B.big_enough)&&!Number.isNaN(B.big_enough)&&!!(null==B?void 0:B.big_enough_decision_factors),sl=null!==(we=null==B?void 0:B.completion_percentage)&&void 0!==we?we:0,al=!!(null==B?void 0:B.completion_decision_factors),rl=""===T,dl=null!=$?$:b(O,rl),ul=!P&&!R;t.useEffect(()=>{if(!At)return;const e=setTimeout(()=>{const e=document.getElementById(`story-card-${At}`);null==e||e.scrollIntoView({behavior:"smooth",block:"start"})},100);return()=>clearTimeout(e)},[At]),t.useEffect(()=>{B.isDefaultEdit&&jt(e=>({...e,userStory:!0}))},[B.isDefaultEdit]),console.log("block number in userstory card ",re),console.log("[TESTING-CURRENT-USER-STORY] \n",B,"\n[TESTING-USER-STORY] \n",kt);return t.useEffect(()=>el(B.value),[B.value]),e.jsxs("div",{className:a.default.card,"data-block-id":`user-story-card-wrapper-${de}-${re}`,style:null==tt?void 0:tt.cardStyle,id:`story-card-${B.title}`,"data-expanded":Pt,children:[e.jsxs("div",{className:a.default.titleSection,style:null==tt?void 0:tt.titleSection,children:[e.jsxs("div",{className:a.default.titleRow,style:null==tt?void 0:tt.titleRow,onClick:nl,children:[e.jsxs("div",{className:a.default.titleLeft,style:null==tt?void 0:tt.titleLeft,onMouseEnter:()=>Ht(!0),onMouseLeave:()=>Ht(!1),children:[Y&&e.jsx(N,{displayName:E}),bt&&ul?e.jsx(f.InlineTitleEditor,{title:B.title,onSave:e=>(async(e,t)=>{var l;try{let n={...B};B.artifactId===t?n.title=e:n.sub_features=(null===(l=B.sub_features)||void 0===l?void 0:l.map(l=>l.artifactId===t?{...l,title:e}:l))||[],xt(n),A(n),Nt(!1)}catch(e){console.error("Failed to save title",e)}})(e,B.artifactId),onCancel:()=>{Nt(!1)},inputStyle:null==ot?void 0:ot.inlineTitleInput,confirmButtonStyle:null==ot?void 0:ot.inlineTitleConfirm,cancelButtonStyle:null==ot?void 0:ot.inlineTitleCancel},"inline-title-editor"):e.jsxs("div",{className:a.default.storyTitleWrapper,children:[e.jsx(o.Tooltip,{title:j(B.title),arrow:!0,children:e.jsx("h2",{title:oe?void 0:B.title,className:a.default.storyTitle,style:null==tt?void 0:tt.storyTitle,children:j(B.title)},B.artifactId)}),ee&&(al?e.jsx(S.CompletionPanel,{customIcons:null==Ut?void 0:Ut.userStoryIcons,customStyles:null==tt?void 0:tt.aiReasoningCitaionStyles,currentUserStory:B,panelStyles:null==tt?void 0:tt.CompletionStyles,onToggleStateChange:Yt,completionPanelConfig:te,children:e.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:"4px",...null==rt?void 0:rt.badge,...yt},children:[e.jsxs("span",{children:[sl,"% Completed"]}),e.jsx("span",{style:{display:"flex",alignItems:"center"},children:e.jsx(g.default,{color:"currentColor"})}),Qt?e.jsx(l.ChevronUp,{size:14,style:null==rt?void 0:rt.chevronStyle}):e.jsx(l.ChevronDown,{size:14,style:null==rt?void 0:rt.chevronStyle})]})}):e.jsx("div",{style:{display:"inline-flex",alignItems:"center",gap:"4px",...null==rt?void 0:rt.badge,...yt},children:e.jsxs("span",{children:[sl,"% Completed"]})})),X&&e.jsx("button",{type:"button",className:a.default.titleEditButton,style:null==ot?void 0:ot.titleEditButton,onClick:e=>{e.stopPropagation(),Nt(!0),Pt||Rt(!0)},"aria-label":"Edit title",title:"Edit title",children:e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M8.99998 14.9992H15.75M2.25 14.9992H3.50591C3.87279 14.9992 4.05624 14.9992 4.22887 14.9577C4.38192 14.921 4.52824 14.8604 4.66245 14.7782C4.81382 14.6854 4.94354 14.5557 5.20296 14.2962L14.625 4.87419C15.2463 4.25287 15.2463 3.24551 14.625 2.62419C14.0037 2.00287 12.9963 2.00287 12.375 2.62419L2.95295 12.0462C2.69352 12.3057 2.5638 12.4354 2.47104 12.5868C2.3888 12.721 2.32819 12.8673 2.29145 13.0203C2.25 13.193 2.25 13.3764 2.25 13.7433V14.9992Z",stroke:"#94A3B8","stroke-width":"1.54286","stroke-linecap":"round","stroke-linejoin":"round"})})})]})]}),(Oe||void 0!==ze&&void 0!==Ve)&&e.jsxs("div",{className:a.default.statusContainer,children:[void 0!==ze&&void 0!==Ve&&e.jsxs("div",{className:a.default.completedBadge,children:["Completed: ",ze,"/",Ve]}),Oe&&e.jsx("button",{type:"button",onClick:e=>{e.stopPropagation(),null==$e||$e()},onMouseEnter:()=>Jt(!0),onMouseLeave:()=>Jt(!1),className:a.default.statusButton,style:{...null===(Ee=gt[Oe])||void 0===Ee?void 0:Ee.default,...Zt&&(null===(De=gt[Oe])||void 0===De?void 0:De.hover)},children:I[Oe]})]}),e.jsxs("div",{className:a.default.titleActions,style:null==tt?void 0:tt.titleActions,onClick:e=>e.stopPropagation(),children:[(dl.showProgressPercentage||dl.showGapBox)&&z&&e.jsxs("div",{className:a.default.progressHeader,style:null==st?void 0:st.wrapper,children:[dl.showProgressPercentage&&e.jsxs("div",{className:a.default.progressPercentage,style:null==st?void 0:st.percentage,children:[null!==(Ae=null!==(Be=null==B?void 0:B.confidenceScore)&&void 0!==Be?Be:null==dl?void 0:dl.confidenceValue)&&void 0!==Ae?Ae:"0","%"]}),dl.showGapBox&&e.jsxs("div",{className:a.default.gapBox,style:null==st?void 0:st.gapBox,children:[null!==(ke=null!==(Te=null==B?void 0:B.gapValue)&&void 0!==Te?Te:null==dl?void 0:dl.gapBoxValue)&&void 0!==ke?ke:"2"," ","Gaps"]})]}),il&&e.jsx(m.BigEnoughPanel,{customIcons:null==Ut?void 0:Ut.userStoryIcons,customStyles:null==tt?void 0:tt.aiReasoningCitaionStyles,currentUserStory:B,panelStyles:null==tt?void 0:tt.BigEnoughStyles}),ue&&e.jsx("button",{type:"button",className:a.default.iconButton,style:null==tt?void 0:tt.iconButton,disabled:ce,onClick:e=>{e.stopPropagation(),null==ve||ve(B)},"aria-label":"Assign section users",title:"Assign section users",children:e.jsx(l.Users,{size:16})}),!It.userStory&&e.jsxs(e.Fragment,{children:[!1!==(null==dl?void 0:dl.showShareButton)&&e.jsx("button",{className:a.default.iconButton,style:null==tt?void 0:tt.iconButton,onClick:e=>{Lt(e.currentTarget)},children:e.jsx(l.ExternalLink,{size:16})}),e.jsxs(o.Menu,{id:"user-story-share-menu",anchorEl:qt,open:!!qt,onClose:()=>Lt(null),style:null==tt?void 0:tt.userStoryShareMenu,children:[U&&e.jsx(o.MenuItem,{style:null==tt?void 0:tt.userStoryMenuItem,onClick:async()=>{_t(!0),M&&(await Promise.all([M("pdf"),M("doc")]),_t(!1))},children:e.jsxs("div",{ref:Vt,className:a.default.menuItemContent,style:null==tt?void 0:tt.menuItemContent,children:[e.jsx(l.Download,{size:16,color:null==tt?void 0:tt.menuIconColor}),e.jsx("p",{style:null==tt?void 0:tt.menuLabel,children:"Download"})]})}),e.jsx(o.MenuItem,{style:null==tt?void 0:tt.userStoryMenuItem,onClick:async()=>{let e=B;D&&(e={...B,value:`${d.replaceTitleSection(null==D?void 0:D.value,B.title)} \n${B.value}`}),null==_||_(!0,[e],B.artifactId),tl()},children:e.jsxs("div",{style:null==tt?void 0:tt.menuItemContent,className:a.default.menuItemContentPadded,children:[e.jsx(l.Share2,{size:16,color:null==tt?void 0:tt.menuIconColor}),e.jsx("p",{style:null==tt?void 0:tt.menuLabel,children:"Send"})]})}),e.jsx(o.MenuItem,{style:null==tt?void 0:tt.userStoryMenuItem,onClick:async()=>{const e=(new x.default.Converter).makeHtml(r.formatMarkdown(B.value)||B.value),t=function(e){const t=(new x.default.Converter).makeHtml(e),l=document.createElement("div");return l.innerHTML=t,l.textContent||l.innerText||""}(r.formatMarkdown(B.value)||B.value),l=new ClipboardItem({"text/plain":new Blob([t],{type:"text/plain"}),"text/html":new Blob([e],{type:"text/html"})});try{await navigator.clipboard.write([l]),console.log("Copied User Story")}catch(e){console.error("Failed to copy user story:",e)}finally{tl()}},children:e.jsxs("div",{style:null==tt?void 0:tt.menuItemContent,className:a.default.menuItemContentPadded,children:[e.jsx(l.Copy,{size:16,color:null==tt?void 0:tt.menuIconColor}),e.jsx("p",{style:null==tt?void 0:tt.menuLabel,children:"Copy"})]})})]})]}),!$t&&It.userStory&&Pt?e.jsx(u.default,{type:"outline",children:"Cancel",style:null==tt?void 0:tt.cancelButton,onClick:()=>{var e;null===(e=Xt.current)||void 0===e||e.abort(),jt(e=>({...e,userStory:!1}))}}):e.jsx(e.Fragment,{}),It.userStory&&Pt?e.jsx(u.default,{type:"fill",children:$t?e.jsxs("span",{className:a.default.savingSpinner,style:null==tt?void 0:tt.savingSpinner,children:[e.jsx(l.LoaderCircle,{className:a.default.spinAnimation,style:null==tt?void 0:tt.spinAnimation}),e.jsx("span",{children:"Saving..."})]}):"Save",isDisable:$t,style:$t?null==tt?void 0:tt.savingButton:null==tt?void 0:tt.saveButton,onClick:async()=>{zt(!0),await ol();let e=await(async()=>{var e,t,l,n,o;let i=Ct.value;console.log("[V] valueToUpdate before",i),i=i.replace(/<invisible\s+id="([^"]+)"\s*><\/invisible>/gi,"\x3c!-- $1 --\x3e"),console.log("[V] valueToUpdate after",i);try{await(null==pe?void 0:pe(i,B.artifactId))}catch(e){}try{if(null==Ze?void 0:Ze.callUpdateDocument){const{updated_reqai:s}=await y.updateRedlineDocument({documentId:Xe,sectionId:B.artifactId,baseApiUrl:null==Ze?void 0:Ze.baseApiUrl,updatedContent:i,userEmail:Ze.userEmail,userName:Ze.userName,redlineConfigId:null!==(e=Ze.redlineConfigId)&&void 0!==e?e:""},null!==(t=null==Ze?void 0:Ze.token)&&void 0!==t?t:"");i=null===(o=null===(n=null===(l=null==s?void 0:s.artifactData)||void 0===l?void 0:l.userStorySnapshot)||void 0===n?void 0:n[0])||void 0===o?void 0:o.value,await(null==Ke?void 0:Ke(s))}}catch(e){console.error("failed to update redline document",e),i=Kt}return i=i.replace(/<!--\s*([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\s*-->/gi,'<invisible id="$1"></invisible>'),i})();const t={...Ct,value:e};A({...t,isDefaultEdit:!1}),el(t.value),jt(e=>({...e,userStory:!1})),zt(!1)}}):!P&&!R&&!ne&&Pt&&!1!==(null==dl?void 0:dl.showEditButton)&&e.jsx("button",{className:a.default.iconButton,style:null==tt?void 0:tt.editButton,onClick:()=>jt(e=>({...e,userStory:!0})),children:e.jsx(l.PencilIcon,{color:null==tt?void 0:tt.pencilIconColor,size:16})}),le&&rl&&Pt&&!P&&!R&&!1!==(null==dl?void 0:dl.showEditButton)&&e.jsxs("button",{type:"button",className:a.default.addSectionButton,style:null==ot?void 0:ot.addSectionButton,onClick:e=>{var t,l,n;e.stopPropagation();const o=(null!==(l=null===(t=B.sub_features)||void 0===t?void 0:t.length)&&void 0!==l?l:0)+1,i={artifactId:s.v4(),title:`New Section ${o}`,value:"Please add details for this section.",section:"subfeature",isDefaultOpen:!0},a={...B,sub_features:[...null!==(n=B.sub_features)&&void 0!==n?n:[],i]};xt(a),A(a),Rt(!0),Tt(i.title)},"aria-label":"Add section",title:"Add section",children:[e.jsx(l.Plus,{size:14}),e.jsx("span",{className:a.default.addSectionLabel,children:"Add Section"})]}),!rl&&!P&&!ne&&!R&&e.jsx("button",{type:"button",onClick:e=>{e.stopPropagation(),null==G||G()},className:a.default.iconButton,style:null==ot?void 0:ot.deleteButton,"aria-label":"Delete section",title:"Delete section",children:e.jsx(l.Trash2,{size:16})}),ct&&e.jsx("button",{type:"button",className:a.default.iconButton,style:null==lt?void 0:lt.button,disabled:mt,onClick:e=>{if(e.stopPropagation(),wt)return Bt(null),void Et(!1);Bt(structuredClone(null!=vt?vt:{})),Rt(!0),Et(!0)},children:wt?e.jsx(l.X,{size:16,color:null==tt?void 0:tt.pencilIconColor,style:null==lt?void 0:lt.cancelIcon}):e.jsx(l.PencilIcon,{size:16,color:null==tt?void 0:tt.pencilIconColor,style:null==lt?void 0:lt.editIcon})}),(null==dl?void 0:dl.actionItemsButton)&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:a.default.actionItemBtn,style:null==tt?void 0:tt.actionItemBtn,onClick:e=>{e.stopPropagation(),Ot(e.currentTarget)},children:e.jsx(l.Ellipsis,{})}),e.jsx(o.Menu,{id:"user-story-action-menu",anchorEl:Ft,open:!!Ft,onClose:ll,style:null==tt?void 0:tt.userStoryShareMenu,children:null==W?void 0:W.items.map((t,l)=>e.jsx(o.MenuItem,{style:null==tt?void 0:tt.userStoryMenuItem,onClick:()=>{t.onclick(B),ll()},children:e.jsxs("div",{className:a.default.menuItemContent,style:{...null==tt?void 0:tt.menuItemContent,...!t.isActive&&{cursor:"not-allowed",opacity:.5}},children:[e.jsx("span",{className:a.default.menuItemIcon,style:null==tt?void 0:tt.menuItemIcon,children:t.icon}),e.jsx("p",{style:null==tt?void 0:tt.menuLabel,children:t.name}),e.jsx("span",{className:a.default.menuItemRight,style:null==tt?void 0:tt.menuItemRight})]})},`action-item-${l}-${t.name}`))})]}),e.jsx("button",{type:"button",onClick:e=>{e.stopPropagation(),nl()},style:null==tt?void 0:tt.chevronButton,className:a.default.chevronButton,children:Pt?e.jsx(l.ChevronUp,{className:a.default.chevronIcon,color:null==tt?void 0:tt.chevronIconColor}):e.jsx(l.ChevronDown,{className:a.default.chevronIcon,color:null==tt?void 0:tt.chevronIconColor})})]})]}),e.jsx("div",{className:a.default.divider,style:null==tt?void 0:tt.dividerStyle})]}),Pt&&e.jsx("div",{className:a.default.cardContent,style:{...null==tt?void 0:tt.cardContentStyle,borderTop:J?"1px solid #E5E5E5":"none"},children:Le?e.jsxs("div",{className:a.default.loadingContainer,children:[e.jsx("div",{className:a.default.loadingIconWrapper,children:e.jsx(l.Hourglass,{size:28,color:"#5B3DF5",className:a.default.spinAnimation})}),e.jsxs("div",{children:[e.jsx("h3",{className:a.default.loadingTitle,children:"Section generation in progress.."}),e.jsx("p",{className:a.default.loadingSubtitle,children:"This may take a few minutes"})]}),e.jsx("button",{type:"button",onClick:()=>null==Fe?void 0:Fe(),className:a.default.viewStatusButton,children:"View Status"})]}):We?e.jsxs("div",{className:a.default.noDataContainer,style:null==dt?void 0:dt.container,children:[e.jsx("img",{src:i.default,alt:"No data available",className:a.default.noDataIllustration,style:null==dt?void 0:dt.illustration}),e.jsx("h3",{className:a.default.noDataTitle,style:null==dt?void 0:dt.title,children:"No Data Available for This Section"}),e.jsx("p",{className:a.default.noDataSubtitle,style:null==dt?void 0:dt.subtitle,children:"We couldn't find data for this section yet. Upload the required document from the Documents tab to generate content."})]}):e.jsxs("div",{className:a.default.contentInner,style:null==tt?void 0:tt.contentInner,children:[e.jsxs("div",{className:a.default.descriptionSection,style:null==tt?void 0:tt.descriptionSection,children:[e.jsx("div",{className:a.default.justifyBetween,style:null==tt?void 0:tt.justifyBetween}),It.userStory?e.jsx(c.default,{ref:Wt,minHeight:"100%",height:"100%",type:"string",value:r.formatMarkdown(Kt)||"",handleUpdateState:(e,t)=>{const l=d.postprocessUserStoryAfterEdit(r.indentMarkdown(t));xt(e=>({...e,value:l||""}))},doNotShowBorderInViewMode:!1,onBlur:()=>{},mode:It.userStory?"edit":"readOnly",onEditBlocked:Ye,onSaveUnsavedChanges:async()=>{await ol(),Rt(!1)},onDiscardUnsavedChanges:()=>{xt({...structuredClone(B),value:r.formatMarkdown(B.value)||""}),jt(e=>({...e,userStory:!1})),Rt(!1)},isSavingUnsavedChanges:$t}):ct?e.jsx(h.default,{styles:at,fields:pt,readonly:!wt,isSaving:ft,value:null!==(Ue=null!=Dt?Dt:vt)&&void 0!==Ue?Ue:{},onChange:Bt,onSave:async()=>{var e;Dt&&(await(null===(e=null==Je?void 0:Je.onSave)||void 0===e?void 0:e.call(Je,B,Dt)),Bt(null),Et(!1))},onCancel:()=>{Bt(null),Et(!1)}}):e.jsxs(e.Fragment,{children:[e.jsx(v.default,{showUserStoryDiff:R,isParent:""===T,message:r.formatMarkdown(B.value)||"",artifactId:B.artifactId,customStyles:it,isDisplayHighlightControl:F,contextVariant:H,showConfidenceScore:Z,CDNeededInChip:ae,blockId:re,storyId:de}),(ie||se)&&e.jsxs("div",{className:a.default.actionButtonsContainer,style:null==ut?void 0:ut.container,children:[se&&!It.userStory&&e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:a.default.actionButton,style:null==ut?void 0:ut.button,disabled:se.disabled||se.isLoading,onClick:e=>{var t;e.stopPropagation(),null===(t=se.onClick)||void 0===t||t.call(se),jt(e=>({...e,userStory:!0})),Rt(!0)},children:se.isLoading?e.jsxs(e.Fragment,{children:[e.jsx(l.LoaderCircle,{size:16,className:a.default.actionButtonSpinner,style:null==ut?void 0:ut.icon}),e.jsx("span",{style:null==ut?void 0:ut.text,children:null!==(Pe=se.label)&&void 0!==Pe?Pe:"Edit"})]}):e.jsxs(e.Fragment,{children:[e.jsx(l.PencilIcon,{size:16,style:null==ut?void 0:ut.icon}),e.jsx("span",{style:null==ut?void 0:ut.text,children:null!==(Re=se.label)&&void 0!==Re?Re:"Edit"})]})}),ie&&e.jsx("span",{className:a.default.actionButtonDivider})]}),ie&&e.jsx("button",{type:"button",className:a.default.actionButton,style:null==ut?void 0:ut.button,disabled:ie.disabled||ie.isLoading,onClick:e=>{var t;e.stopPropagation(),null===(t=ie.onClick)||void 0===t||t.call(ie)},children:ie.isLoading?e.jsxs(e.Fragment,{children:[e.jsx(l.LoaderCircle,{size:16,className:a.default.actionButtonSpinner,style:null==ut?void 0:ut.icon}),e.jsx("span",{style:null==ut?void 0:ut.text,children:null!==(Me=ie.label)&&void 0!==Me?Me:"Approve"})]}):e.jsxs(e.Fragment,{children:[e.jsx(l.Check,{size:16,style:null==ut?void 0:ut.icon}),e.jsx("span",{style:null==ut?void 0:ut.text,children:null!==(_e=ie.label)&&void 0!==_e?_e:"Approve"})]})})]})]})]}),null===(qe=Ct.sub_features)||void 0===qe?void 0:qe.map((t,l)=>{console.log("UserStoryCardWrapper: sub",t);const o=b(O,!1,t.artifactId);return e.jsx(w,{artifactId:C,isUserStoryCurrentlyUpdated:n,artifactTitleId:`${E}-${String.fromCharCode(65+l)}`,parentUserStory:B,parentIndex:`${T}${T&&"."}${k}`,currentIndex:`${l+1}`,doNotShowBorderInViewMode:!1,currentUserStory:t,onUserStoryChange:e=>((e,t)=>{const l=[...B.sub_features||[]];l[e]=t,A({...B,sub_features:l})})(l,e),enableDownload:!0,isDiffEditReviewMode:P,showUserStoryDiff:R,updateUserStoryArtifact:q,handleDownloadUserStory:M,handleOpenSendDialog:_,isDisplayHighlightControl:F,elementDisplayConfig:O,_resolvedConfig:o,actionItemsConfig:W,onDelete:()=>(e=>{const t=(B.sub_features||[]).filter((t,l)=>l!==e),l={...B,sub_features:t};xt(l),A(l)})(l),expandedSubFeatures:Q,disableEditPlan:ne,useMuiTooltip:oe,storyNumber:t.storyNumber,blockNumber:t.blockNumber,onUserStoryAccordionStateChange:me,showAssignSection:ue,onAssignSectionClick:ve,onSave:pe},t.artifactId)})]})})]})};exports.StoryCard=w,exports.UserStoryCardWrapper=({artifactTitleIDs:n,expandedSubFeatures:o,isDiffEditReviewMode:i,showUserStoryDiff:s,updateUserStoryArtifact:r,isUserStoryCurrentlyUpdated:d,artifactId:u,handleOpenSendDialog:c,handleDownloadUserStory:v,selectedArtifactId:m,isDisplayHighlightControl:f,elementDisplayConfig:h,showWrapper:S,actionItemsConfig:g,contextVariant:C,showDisplayName:x,allowTitleEdit:I,showConfidenceScore:j,showBorderTop:N,defaultExpanded:E,showCompletionPanel:D=!1,completionPanelConfig:B,showAddSectionButton:A=!1,disableEditPlan:T=!1,useMuiTooltip:k=!1,approveButtonConfig:U,editButtonConfig:P,CDNeededInChip:R,setRedlineDocumentIdParent:M,showAssignSection:_,onAssignSectionClick:q,disableAssignSection:L,onSave:F,onUserStoryAccordionStateChange:O})=>{const{userStory:$,setUserStory:z,customStyles:V,searchQueryList:W,currentHighlightIndex:G,setCurrentHighlightIndex:H,segmentComponentConfig:Q,sectionStatusConfig:Y,redlineConfig:X,setRedlineDocumentId:Z}=p.useRequirementAI(),J=null==V?void 0:V.userStoryCardStyles,K=0===G,ee=G===W.length-1;return t.useEffect(()=>{if(!(null==X?void 0:X.callCreateDocumentOnInit))return;(async()=>{var e;const{redline_document_id:t}=await y.getRedlineDocumentId({baseApiUrl:X.documentBaseApiUrl||"",comparisonId:X.documentComparisonId||""});if(t)Z(t);else{const{document_id:t}=await y.createRedlineDocument({baseApiUrl:X.baseApiUrl,changelogConfigId:X.changelogConfigId,comparisonId:X.documentComparisonId,artifactId:X.artifactId,inputData:X.inputData,redlineConfigId:X.redlineConfigId,userEmail:X.userEmail,userName:X.userName},null!==(e=null==X?void 0:X.token)&&void 0!==e?e:"");t&&(Z(t),null==M||M(t))}})()},[]),e.jsxs("div",{className:a.default.userStoryCardWrapper,style:f?{...null==J?void 0:J.userStoryCardWrapper,position:"relative"}:null==J?void 0:J.userStoryCardWrapper,children:[f&&e.jsx(e.Fragment,{children:W.length>0&&e.jsx("div",{className:a.default.wrapper,children:e.jsx("div",{className:a.default.highlightNavigation,children:e.jsxs("div",{className:a.default.navigationContainer,children:[e.jsxs("span",{className:a.default.navCounter,children:[G+1," of ",W.length]}),e.jsxs("div",{className:a.default.navButtons,children:[e.jsx("button",{onClick:()=>{G>0&&H(e=>e-1)},className:a.default.navButton,disabled:K,children:e.jsx(l.ChevronUpIcon,{size:20,className:a.default.navIcon})}),e.jsx("button",{onClick:()=>{G<W.length-1&&H(e=>e+1)},className:a.default.navButton,disabled:ee,children:e.jsx(l.ChevronDownIcon,{size:20,className:a.default.navIcon})})]})]})})})}),$.map((t,l)=>{console.log("UserStoryCardWrapper: userstory",t);const a=b(h,!0);return e.jsx(w,{isUserStoryCurrentlyUpdated:d,artifactId:u,artifactTitleId:n[l]||"",expandedSubFeatures:o,currentUserStory:t,onUserStoryChange:e=>{z(t=>(t[l]=e,[...t]))},parentIndex:"",currentIndex:`${l+1}`,doNotShowBorderInViewMode:!0,enableDownload:!0,isDiffEditReviewMode:i,showUserStoryDiff:s,updateUserStoryArtifact:r,handleOpenSendDialog:c,handleDownloadUserStory:v,selectedArtifactId:m,isDisplayHighlightControl:f,elementDisplayConfig:h,_resolvedConfig:a,showWrapper:S,defaultExpanded:E,actionItemsConfig:g,contextVariant:C,showDisplayName:x,allowTitleEdit:I,showConfidenceScore:j,showBorderTop:N,sectionStatusConfig:Y,showCompletionPanel:D,completionPanelConfig:B,showAddSectionButton:A,disableEditPlan:T,useMuiTooltip:k,approveButtonConfig:U,CDNeededInChip:R,editButtonConfig:P,storyNumber:t.storyNumber,blockNumber:t.blockNumber,onUserStoryAccordionStateChange:O,showAssignSection:_,disableAssignSection:L,onAssignSectionClick:q,onSave:F},t.artifactId)})]})},exports.default=w,exports.replaceLearnedTagsWithInfo=j;
|
|
2
2
|
//# sourceMappingURL=UserStoryCard.js.map
|
package/dist/cjs/features/RequirementAI/components/lsc-reason-gap/CustomChatCrRedirection.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("react"),l=require("lucide-react"),o=require("./CustomChatCrRedirection.module.css.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("react"),l=require("lucide-react"),o=require("./CustomChatCrRedirection.module.css.js"),t=require("../ai-reasoning/AiReasoningCitationContent.js"),n=require("../../icons/CognitiveDecision.js"),a=require("@mui/material");exports.CustomChatCrRedirection=function({isDefaultOpen:r,processItemId:s,isCompleted:d,mode:c,msg:u,type:v,id:p,aiReason:g,text:f,headerText:m,decisionStrength:x,statusUi:h,panelRef:j,onHandleSend:y,onRedirectClick:C,gapType:D,isGenerating:b=!1,customStyles:N,customIcons:I,cognitiveDecisionHeaders:S,metaData:T}){const[R,k]=i.useState(r),q=(null==I?void 0:I.highConfidence)||e.jsx(n.default,{}),B=()=>{"cra"===c?null==y||y(`Discuss ambiguities on ${f}`,p,T):null==y||y(`Deep Dive into ${D} ${m}: ${f}`,p,T)};return e.jsxs("div",{className:[o.default.outerWrapper,b?o.default.outerWrapperDisabled:""].join(" "),style:{...null==N?void 0:N.redirectionOuterWrapper,...b?null==N?void 0:N.redirectionOuterWrapperDisabled:{}},children:[e.jsxs("div",{className:[o.default.card,b?o.default.cardDisabled:o.default.cardInteractive].join(" "),style:{...null==N?void 0:N.redirectionCard,...b?null==N?void 0:N.redirectionCardDisabled:null==N?void 0:N.redirectionCardInteractive},children:[e.jsxs("div",{className:o.default.leftSide,style:null==N?void 0:N.redirectionLeftSide,children:[e.jsx(a.Tooltip,{title:m+" "+f,placement:"top",slotProps:{tooltip:{sx:{...null==N?void 0:N.headerTooltip}}},children:e.jsxs("span",{className:o.default.textBlock,style:null==N?void 0:N.redirectionTextBlock,children:[m&&e.jsxs("span",{className:o.default.headerText,style:null==N?void 0:N.redirectionHeaderText,children:[m,f?" ":""]}),f]})}),e.jsxs("span",{onClick:e=>{e.stopPropagation(),b||k(!R)},className:[o.default.reasoningToggle,b?o.default.reasoningToggleDisabled:o.default.reasoningToggleActive].join(" "),style:{...null==N?void 0:N.reasoningToggle,...b?null==N?void 0:N.reasoningToggleDisabled:null==N?void 0:N.reasoningToggleActive},children:[q,R?e.jsx(l.ChevronUp,{className:o.default.chevronIcon,style:null==N?void 0:N.chevronIcon}):e.jsx(l.ChevronDown,{className:o.default.chevronIcon,style:null==N?void 0:N.chevronIcon})]})]}),d?e.jsx("div",{className:o.default.completeTickWrapper,style:null==N?void 0:N.completeTickWrapper,children:e.jsx(l.Check,{color:(null==N?void 0:N.checkColor)||"green"})}):e.jsxs(e.Fragment,{children:["risk-gap"===c&&e.jsxs("div",{className:o.default.rightSide,style:null==N?void 0:N.redirectionRightSide,children:[e.jsx("button",{disabled:b,className:[o.default.fixButton,b?o.default.fixButtonDisabled:""].join(" "),style:{...null==N?void 0:N.redirectionFixButton,...b?null==N?void 0:N.fixButtonDisabled:{}},onClick:e=>{e.stopPropagation(),b||B()},children:"Fix"}),e.jsx(l.SquareArrowOutUpRight,{onClick:b?void 0:()=>{b||null==C||C({type:v,id:p,aiReason:g,msg:u,meta:{headerText:m,decisionStrength:x,text:f}})},size:18,className:[b?o.default.redirectIconDisabled:o.default.redirectIcon].join(" "),style:{...b?null==N?void 0:N.redirectIconDisabled:null==N?void 0:N.redirectIcon}})]}),"cra"===c&&!r&&e.jsx("div",{className:o.default.rightSide,style:null==N?void 0:N.redirectionRightSide,children:s===p?e.jsx("div",{className:o.default.loaderWrapper,style:null==N?void 0:N.loaderWrapper,children:e.jsx(l.Loader2,{size:16,className:o.default.loaderIcon,color:"grey",style:{animation:"spin 1s linear infinite",...null==N?void 0:N.loaderIcon}})}):e.jsx("button",{className:[o.default.clarifyButton].join(" "),style:{color:b?"grey":"",...null==N?void 0:N.redirectionClarifyButton},disabled:b,onClick:e=>{e.stopPropagation(),B()},children:"Clarify"})})]})]}),R&&e.jsx(t.default,{label:"cra"===c?"Clarify":"Select this option",aiReason:{id:"1",reason:(null==g?void 0:g.Reasoning)||"",gap:(null==g?void 0:g.Gap)||"",relevance_score:Number(null==g?void 0:g.Confidence_score),explanation:(null==g?void 0:g.explanation)||""},onSelectProceed:B,customStyles:null==N?void 0:N.aiReasoningStyles,customIcons:I,cognitiveDecisionHeaders:S})]})};
|
|
2
2
|
//# sourceMappingURL=CustomChatCrRedirection.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("lodash"),o=require("./GapFilterContentWrapper.js"),i=require("./GapFilterItem.js"),n=require("./CustomChatCrRedirection.js"),a=require("./gapFilterSvgs.js"),l=require("./GapFilterBlock.module.css.js");require("react-markdown"),require("rehype-raw"),require("../RequirementAIWrapper/RequirementAIWrapper.js");const
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("lodash"),o=require("./GapFilterContentWrapper.js"),i=require("./GapFilterItem.js"),n=require("./CustomChatCrRedirection.js"),a=require("./gapFilterSvgs.js"),l=require("./GapFilterBlock.module.css.js");require("react-markdown"),require("rehype-raw"),require("../RequirementAIWrapper/RequirementAIWrapper.js");const c=["critical","recommendation","warning"];function d(e){return(null==e?void 0:e.trim())?e.includes("%")?e:e.replace(/([0-9]+(?:\.[0-9]+)?)/g,"$1%"):""}function s(e){return t.Children.toArray(e).filter(e=>t.isValidElement(e)).filter(e=>{var t;return"gapfilteritem"===e.type||"crredirection"===e.type||"function"==typeof e.type&&"crredirection"===e.type.name||(null===(t=e.key)||void 0===t?void 0:t.includes("crredirection"))}).map(e=>{var t,r;const{children:o,...i}=e.props,n={};Object.keys(i).forEach(e=>{e.startsWith("data-")||(n[e]=i[e])});const a=function(e){const t={};return Object.keys(e).forEach(r=>{r.startsWith("data-")&&(t[r.replace(/^data-/,"")]=e[r])}),t}(i),l=function(e){const t={};return Object.keys(e).forEach(r=>{r.startsWith("meta-")&&(t[r.replace(/^meta-/,"")]=e[r])}),t}(i),c=i["decision-strength"],d=i["data-is-completed"];return{text:o,headerText:i.headertext,tags:i.tags,dataAttrs:a,decisionStrength:c,attrs:n,type:"gapfilteritem"===e.type?"gapfilteritem":"crredirection",score:i.score,isCompleted:d,pendingCount:i.pendingcount,question:i.question,components:i.components,showFix:null!==(t=i.showfix)&&void 0!==t&&t,showRedirect:null!==(r=i.showredirect)&&void 0!==r&&r,metaDataAttrs:l}})}const u={critical:{labelColor:"text-gray-900",badgeBg:"bg-[#FEE4E2]",badgeText:"text-[#B42318]",iconColor:"text-[#D92D20]"},warning:{labelColor:"text-gray-900",badgeBg:"bg-[#FEF0C7]",badgeText:"text-[#B54708]",iconColor:"text-[#DC6803]"},recommendation:{labelColor:"text-gray-900",badgeBg:"bg-[#D1FADF]",badgeText:"text-[#027A48]",iconColor:"text-[#039855]"}};exports.GapFilterBlock=({isDefaultOpen:g,processItemId:p,mode:m,node:C,children:b,type:f,supportedmodes:h="","decision-strength":y="",pendingdata:x="",isGeneratingGap:v=!1,selectedGapItemId:S="",onItemSelect:I,onHandleSend:k,onModeAction:j,msg:R,panelRef:F,getAccordionState:A,setAccordionState:B,registerGapFilterBlockCount:D,getShowGapReviewButtonType:G,customStyles:T,customIcons:q,cognitiveDecisionHeaders:w,onRedirectClick:N})=>{const E=f,W=d(y),[O,$]=t.useState(()=>{var e;const t=null!==(e=null==A?void 0:A(E))&&void 0!==e?e:"";return"true"!==g||t?t:E}),H=e=>{$(e),null==B||B(E,e)},z=s(b),M=t.useMemo(()=>z.reduce((e,t)=>{var r,o,i;const n=null!==(r=t.tags)&&void 0!==r?r:"Uncategorized",a=null!==(i=null===(o=t.dataAttrs)||void 0===o?void 0:o.categoryid)&&void 0!==i?i:"1";let l=e.find(e=>e.categoryName===n);return l||(l={categoryName:n,categoryId:a,type:t.type,items:[]},e.push(l)),l.items.push(t),e},[]),[z]),U={critical:{labelColor:"#d92d20",badgeBackgroundColor:"#fee4e2",badgeTextColor:"#b42318",icon:e.jsx(a.SirenIcon,{}),label:"risk-gap"===m?"Critical":"Must Clarify",decisionStrength:"< 70%"},warning:{labelColor:"#dc6803",badgeBackgroundColor:"#fef0c7",badgeTextColor:"#b54708",icon:e.jsx(a.WarningIcon,{}),label:"risk-gap"===m?"Warning":"Should Clarify",decisionStrength:"70–90%"},recommendation:{labelColor:"#039855",badgeBackgroundColor:"#d1fadf",badgeTextColor:"#027a48",icon:e.jsx(a.SupportIcon,{}),label:"risk-gap"===m?"Just a Suggestion":"Nice to Clarify",decisionStrength:"> 90%"},default:{labelColor:"#4b5563",badgeBackgroundColor:"#f3f4f6",badgeTextColor:"#4b5563",icon:e.jsx(a.SupportIcon,{}),label:"",decisionStrength:""}},_=t.useMemo(()=>{return e=E,c.includes(e)?{labelColor:U[E].labelColor,badgeBackgroundColor:U[E].badgeBackgroundColor,badgeTextColor:U[E].badgeTextColor,label:U[E].label,decisionStrength:W||U[E].decisionStrength}:{labelColor:U.default.labelColor,badgeBackgroundColor:U.default.badgeBackgroundColor,badgeTextColor:U.default.badgeTextColor,label:r.capitalize(E),decisionStrength:W||""};var e},[E,W]);t.useEffect(()=>{null==D||D(E,z.length)},[E,z.length,D]);const L=(e,t,r={})=>{if(v)return;const o=`${M[e].categoryId}-${t}`;null==I||I(o);const i={...M[e].items[t].dataAttrs,...r};null==j||j(h,i)};return G&&G(),e.jsx(o.GapFilterContentWrapper,{mode:m,type:E,config:_,count:z.length,handleReviewClick:()=>{z.length>0&&H(E)},openAccordion:O,onAccordionChange:e=>{H(O===e?"":e)},shouldShowReviewButton:!1,pendingData:x,customStyles:T,children:M.map((t,r)=>e.jsxs("div",{className:l.default.categoryGroup,style:null==T?void 0:T.categoryGroup,children:["gapfilteritem"===t.type&&"Uncategorized"!==t.categoryName&&e.jsx("p",{className:l.default.categoryLabel,style:null==T?void 0:T.categoryLabel,children:t.categoryName}),t.items.map((o,a)=>{var c,d,s,g;const C=o.attrs||{},b=null===(c=o.dataAttrs)||void 0===c?void 0:c["cognitive-reasoning"],f=C.id||(null===(d=o.dataAttrs)||void 0===d?void 0:d.id)||"",h="I"===f[0]?"UI_REF":"CHAT_REF",y=null===(s=null==R?void 0:R.contextAwareAgentReasoning)||void 0===s?void 0:s[b],x=o.isCompleted,I="true"===C.isDefaultOpen||"true"===C.isdefaultopen;return"gapfilteritem"===o.type?e.jsx("div",{className:[l.default.gapFilterItemWrapper,"Uncategorized"!==t.categoryName?l.default.gapFilterItemWrapperIndented:""].join(" "),style:null==T?void 0:T.blockContainer,children:e.jsx(i.GapFilterItem,{isDefaultOpen:I,isCompleted:x,mode:m,index:a,isSelected:S===`${t.categoryId}-${a}`,onClick:()=>L(r,a),onFixClick:()=>L(r,a,{triggerFrom:"fix"}),onRedirect:()=>L(r,a,{triggerFrom:"redirect"}),item:o,isGenerating:v,aiReason:y,panelRef:null!=F?F:{current:null},id:b,customStyles:T,customIcons:q,cognitiveDecisionHeaders:w})},a):e.jsx("div",{className:l.default.crRedirectionGroup,style:null==T?void 0:T.crRedirectionGroup,children:e.jsx("div",{className:l.default.crRedirectionInner,style:null==T?void 0:T.crRedirectionInner,children:e.jsx(n.CustomChatCrRedirection,{isDefaultOpen:I,processItemId:p,isCompleted:x,mode:m,msg:R,type:h,text:o.text,headerText:o.headerText,decisionStrength:o.decisionStrength,id:f,gapType:E,onHandleSend:k,isGenerating:v,aiReason:y,onRedirectClick:N,statusUi:null!==(g=u[E])&&void 0!==g?g:u.recommendation,panelRef:null!=F?F:{current:null},customStyles:T,customIcons:q,cognitiveDecisionHeaders:w,metaData:o.metaDataAttrs})})},a)})]},`${t.categoryName}-${r}`))})},exports.normalizeDecisionStrength=d;
|
|
2
2
|
//# sourceMappingURL=GapFilterBlock.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("./Segment.js");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=t(require("dompurify"));exports.default=({id:t,children:l,props:i,segmentComponentConfig:d,customStyles:s,customIcons:a,extractText:u,isUpdatedSegment:r=!1,blockId:v,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("./Segment.js");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=t(require("dompurify"));exports.default=({id:t,children:l,props:i,segmentComponentConfig:d,customStyles:s,customIcons:a,extractText:u,isUpdatedSegment:r=!1,blockId:v,storyId:m,customDeleteStyles:c,customDeleteIcons:g})=>{var p,S,h,I,f,y,C,b,x,D,_,j,E,U,W,k,w,L,A;const F=(null==i?void 0:i.id)||"Segment",q=(null==i?void 0:i.decisionstrength)||"80",{segmentDataList:O,getSegmentExampleComponent:R,handleViewGlossary:B,upadatedSegmentDataList:G,handleFetchUpdatedSegmentDetails:M,handleFetchSegmentDetails:N,handleDeleteSegment:T,handleEditSegment:V,enabledSegmentActions:z,onShowNotification:H}=d||{},P=r?null==G?void 0:G.find(e=>{var n;return String(e.segment_id)===String(null===(n=null==F?void 0:F.split("-"))||void 0===n?void 0:n[0])}):null==O?void 0:O.find(e=>{var n;return String(e.segment_id)===String(null===(n=null==F?void 0:F.split("-"))||void 0===n?void 0:n[0])}),J={id:F,reason:null!==(p=null==P?void 0:P.reason)&&void 0!==p?p:"",gap:null!==(S=null==P?void 0:P.gap)&&void 0!==S?S:"",explanation:null!==(h=null==P?void 0:P.explanation)&&void 0!==h?h:"",relevance_score:null!==(I=null==P?void 0:P.relevance_score)&&void 0!==I?I:0,isOpen:!1};let K;const Q=u(l),X=i["data-table"];let Y="";if(X&&!r)try{Y=decodeURIComponent(atob(X))}catch(e){console.error("Failed to decode data-table for segment",F,e)}const Z=o.default.sanitize(Y),$=()=>e.jsx("div",{dangerouslySetInnerHTML:{__html:Z}});return P||!N||r||null==N||N(F),F&&P&&R&&!r&&(K=X?e.jsx($,{}):R(F,Q,P.segment_type)),e.jsx(n.default,{id:F,segmentUUID:t,label:null!==(f=null==P?void 0:P.label)&&void 0!==f?f:null==P?void 0:P.segment_name,decisionStrength:q,aiReason:J,customIcons:a,aiReasoningCitationCustomStyles:s,segmentExampleComponent:K,handleViewGlossary:B,customStyles:{segmentWrapper:null===(y=null==s?void 0:s.segment)||void 0===y?void 0:y.segmentWrapper,container:null===(C=null==s?void 0:s.segment)||void 0===C?void 0:C.container,label:null===(b=null==s?void 0:s.segment)||void 0===b?void 0:b.label,decisionStrength:null===(x=null==s?void 0:s.segment)||void 0===x?void 0:x.decisionStrength,buttonContainer:null===(D=null==s?void 0:s.segment)||void 0===D?void 0:D.buttonContainer,cheveronIcon:null===(_=null==s?void 0:s.segment)||void 0===_?void 0:_.cheveronIcon,segmentExample:null===(j=null==s?void 0:s.segment)||void 0===j?void 0:j.segmentExample,loadingSkeleton:null===(E=null==s?void 0:s.segment)||void 0===E?void 0:E.SegmentLoadingSkeletonStyles,editInputWrapper:null===(U=null==s?void 0:s.segment)||void 0===U?void 0:U.editInputWrapper,editInput:null===(W=null==s?void 0:s.segment)||void 0===W?void 0:W.editInput,editCheckIcon:null===(k=null==s?void 0:s.segment)||void 0===k?void 0:k.editCheckIcon,editCrossIcon:null===(w=null==s?void 0:s.segment)||void 0===w?void 0:w.editCrossIcon,headerActionsContainer:null===(L=null==s?void 0:s.segment)||void 0===L?void 0:L.headerActionsContainer,editIconButton:null===(A=null==s?void 0:s.segment)||void 0===A?void 0:A.editIconButton},isUpdatedSegment:r,onOpen:async()=>{!P&&r&&(console.log("citation metadata:: handleFetchUpdatedSegmentDetails"),await(null==M?void 0:M(F)))},onDelete:e=>{if(console.log("SegmentWrapper: onDelete",e,{...P,segment_uuid:F},m,v),P)return null==T?void 0:T(e,{...P,segment_uuid:F},m,v)},onEdit:e=>{if(console.log("SegmentWrapper: onEdit",P,e),P&&V)return null==V?void 0:V(P,e)},customDeleteStyles:c,customDeleteIcons:g,enabledSegmentActions:z,segmentDataList:O,onShowNotification:(e,n,t)=>{H&&H(e,n,t)},children:l},F)};
|
|
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("react/jsx-runtime"),n=require("react"),i=require("react-markdown"),t=require("rehype-raw"),o=require("./UserStoryWithCitation.module.css.js"),l=require("../../shared/useMarkdownSearch.js"),d=require("lucide-react"),a=require("@mui/material"),r=require("dompurify"),s=require("../../shared/UpdatedAnimationContent.js"),c=require("../../shared/GeneratedCodeCitation.js"),u=require("../../shared/CitationLoadingIndicator.js"),g=require("../RequirementAIWrapper/RequirementAIWrapper.js"),p=require("../../icons/CognitiveDecision.js"),h=require("../../icons/BrainRed.js"),v=require("../ai-reasoning/AiReasoningCitation.js"),m=require("../../icons/RelevanceScoreIcon.js"),f=require("../RecommendationBlock/RecommendationBlock.js"),C=require("../UserStoryCard/AttachedContext.js"),x=require("../ai-reasoning/AiReasoningCitationContent.js"),j=require("./components/InlineUpdatedComponent.js"),y=require("../segment/SegmentWrapper.js"),S=require("../../store/markdown-context.js"),w=require("./components/InlineManualComponent.js"),b=require("./components/HighlightButtonComponent.js"),I=require("../../../../utils/tagHelper.js");function R(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var N=R(n),$=R(i),k=R(t),A=R(r);const q=n.createContext(!1),E=n.createContext({expandedInfo:null,setExpanded:()=>{},reasonToRow:{current:new Map}}),M=n.createContext({rowId:""}),T=({aiReason:i,isHighConfidence:t,customStyle:l,customIcons:d})=>{var a;const{expandedInfo:r,setExpanded:s,reasonToRow:c}=n.useContext(E),{rowId:u}=n.useContext(M),g=String(i.id);u&&c.current.set(g,u);const v=(null===(a=null==r?void 0:r.aiReason)||void 0===a?void 0:a.id)===i.id,m=t?(null==d?void 0:d.highConfidence)||e.jsx(p.default,{}):(null==d?void 0:d.lowConfidence)||e.jsx(h.default,{});return e.jsxs("button",{className:o.default.aiReasoningButton,style:l,onClick:e=>{e.stopPropagation(),e.preventDefault(),s(v?null:u,v?null:i)},children:[m,v?e.jsx("i",{className:`pi pi-angle-up ${t?o.default.aiReasoningIconHighConfidence:o.default.aiReasoningIconLowConfidence}`}):e.jsx("i",{className:`pi pi-angle-down ${t?o.default.aiReasoningIconHighConfidence:o.default.aiReasoningIconLowConfidence}`})]})},_=({children:i,node:t,customStyles:l,customIcons:d})=>{var a,r;const s=n.useRef(Math.random().toString(36).slice(2)).current,{expandedInfo:c}=n.useContext(E),u=(null==c?void 0:c.rowId)===s,g=Array.isArray(null==t?void 0:t.children)?t.children.filter(e=>"element"===e.type).length:1,p=null!==(r=null===(a=null==t?void 0:t.properties)||void 0===a?void 0:a.style)&&void 0!==r?r:void 0;return e.jsxs(M.Provider,{value:{rowId:s},children:[e.jsx("tr",{style:p?{cssText:p}:void 0,children:i}),u&&(null==c?void 0:c.aiReason)&&e.jsx("tr",{style:{width:"100%"},children:e.jsx("td",{colSpan:g||1,className:o.default.tableExpandedCell,children:e.jsx("div",{className:o.default.tableExpandedCellInner,children:e.jsx("div",{className:o.default.tableExpandedCellContent,children:e.jsx(x.default,{aiReason:c.aiReason,customIcons:d,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}})})})})})]})};const U=["del","ins"];function L(e){return function(e,n,i){const t=n.join("|");return e.replace(new RegExp(`<(${t})>([\\s\\S]*?)<\\/\\1>`,"gi"),(e,n,t)=>`<${n}>${i(t)}</${n}>`)}(e,U,e=>e.split(/(<[^>]+>)/g).map(e=>!e||/^<[^>]+>$/.test(e)?e:function(e){if(!e)return e;const n=[];return e.replace(/`([^`\n]+)`/g,(e,i)=>`@@CODE_SPAN_${n.push(i)-1}@@`).replace(/\*\*([\s\S]+?)\*\*/g,"<strong>$1</strong>").replace(/__([\s\S]+?)__/g,"<strong>$1</strong>").replace(/@@CODE_SPAN_(\d+)@@/g,(e,i)=>{var t;return`<code>${o=null!==(t=n[Number(i)])&&void 0!==t?t:"",o.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}</code>`;var o})}(e)).join(""))}const F=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function P(e,n){const i=[],t=new Set(n.map(e=>e.toLowerCase())),o=e=>{var n,l;try{if(null==e||"boolean"==typeof e)return null;if("string"==typeof e||"number"==typeof e)return e;if(Array.isArray(e))return e.map(e=>o(e)).flat().filter(e=>null!=e);if(!N.default.isValidElement(e))return e;const d="string"==typeof e.type?e.type.toLowerCase():"";if(t.has(d))return i.push(e),null;if(F.has(d))return e;const a=null===(l=N.default.Children.map(null===(n=e.props)||void 0===n?void 0:n.children,o))||void 0===l?void 0:l.flat().filter(e=>null!=e);return a&&0!==a.length?N.default.cloneElement(e,void 0,a):null}catch(n){return console.error("splitNestedDiffNodes failed while processing node:",n),e}};try{return{cleanedChildren:o(e),extractedNodes:i}}catch(n){return console.error("splitNestedDiffNodes failed:",n),{cleanedChildren:e,extractedNodes:[]}}}exports.default=({message:i,noMarkdownContent:t,useMarkdown:r=!0,isParent:p,scenario:h,showUserStoryDiff:x=!1,aiReasoningsForBlock:R,isCitationLoadingDisplay:M=!1,className:U,highConfidenceIcon:F,lowConfidenceIcon:D,customStyles:H,customIcons:O,contextVariant:B,aiReasoningDiffView:V,userStoryCitations:W,artifactId:z,isCraflow:G,onCraAccept:Q,onCraReject:J,craFlowConfig:K,isDisplayHighlightControl:X=!1,showConfidenceScore:Y=!0,CDNeededInChip:Z,blockId:ee})=>{var ne;console.log("userstorywithcitation blockid ",ee);const ie=n.useRef(null),{userStory:te,inlineUpdateComponentConfig:oe,getAvgScoreForStory:le,setUserStory:de,aiReasoning:ae,setAiReasoning:re,customIcons:se,searchQueryList:ce,searchQueryReasoningIdList:ue,currentHighlightIndex:ge,segmentComponentConfig:pe,inlineManualComponentConfig:he,diffEditConfig:ve}=g.useRequirementAI(),me=null!=O?O:null==se?void 0:se.userStoryIcons;null==H||H.searchHighlight;const{search:fe,clear:Ce}=l.useMarkdownSearch(ie),[xe,je]=n.useState("1"),[ye,Se]=n.useState(null),we=n.useRef(new Map),[be,Ie]=n.useState(new Set),Re=n.useCallback((e,n)=>{Se(e&&n?{rowId:e,aiReason:n}:null)},[]),Ne=z?le(z):0,[$e,ke]=n.useState([]),Ae=n.useCallback(e=>{Ie(n=>{const i=new Set(n);return i.has(e)?i.delete(e):i.add(e),i})},[]),qe=e=>null==e?"":"string"==typeof e?e:"number"==typeof e?String(e):Array.isArray(e)?e.map(qe).join(""):N.default.isValidElement(e)?qe(e.props.children):"",Ee=e=>{let n=e;return n=n.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,(e,n)=>`<deleted>${n.replace(/ai_reasoning\$(\d+)/g,(e,n)=>`ai_reasoning$${n}-legacy`)}</deleted>`),n=n.replace(/<generatedCode([^>]*)>([\s\S]*?)<\/generatedCode>/gi,(e,n,i)=>`\n\n<generatedCode${n} data-raw="${btoa(encodeURIComponent(i.trim()))}"></generatedCode>\n\n`),n=n.replace(/^(\s*[-*]|\s*\d+\.)\s*\n?\s*(<updated\b)/gm,"$1 $2"),n=n.replace(/(<segment\b([^>]*)>)([\s\S]*?)(<\/segment>)/gi,(e,n,i,t,o)=>{const l=t.match(/<table[\s\S]*?<\/table>/i);if(l){return`<segment${i} data-table="${btoa(encodeURIComponent(l[0]))}"></segment>`}return e}),n=n.replace(/<updatedsegment([^>]*)>([\s\S]*?)<\/updatedsegment>/gi,(e,n,i)=>{if(/<table[\s>]/i.test(i)){return`<updatedsegment${n} data-raw="${btoa(encodeURIComponent(i))}"></updatedsegment>`}return e}),n=n.replace(/<updated([^>]*)>([\s\S]*?)<\/updated>/gi,(e,i,t,o)=>{const l=n.substring(0,o),d=l.lastIndexOf("\n"),a=/^\s+[-*]\s/.test(l.substring(d+1))||/^\s+\d+\.\s/.test(l.substring(d+1)),r=/^\s*(\d+\.|\s*[-*])\s+$/.test(l.substring(d+1));if(a||r){let e=t;return e=e.replace(/(<deleted>)\s*\n?\s*[-*]\s+/gi,"$1\n"),e=e.replace(/(<changed>)\s*\n?\s*[-*]\s+/gi,"$1\n"),e=e.replace(/(<deleted>)\s*\n?\s*\d+\.\s+/gi,"$1\n"),e=e.replace(/(<changed>)\s*\n?\s*\d+\.\s+/gi,"$1\n"),`<updated${i}>${e}</updated>`}return e}),n=function(e){const n=/<updated[^>]*>[\s\S]*?<\/updated>/gi,i=[];let t;const o=new RegExp(n.source,n.flags);for(;null!==(t=o.exec(e));){const e=t[0],n=e.match(/<deleted>([\s\S]*?)<\/deleted>/i),o=e.match(/<changed>([\s\S]*?)<\/changed>/i),l=e=>(e.match(/^\s*\d+\.\s/gm)||[]).length;i.push({index:t.index,endIndex:t.index+t[0].length,deletedItemCount:l((null==n?void 0:n[1])||""),changedItemCount:l((null==o?void 0:o[1])||"")})}if(0===i.length)return e;let l=e;for(let e=i.length-1;e>=0;e--){const n=i[e],t=n.changedItemCount-n.deletedItemCount;if(0===t)continue;const o=l.substring(0,n.index).split("\n").reverse();let d=!1;for(const e of o){const n=e.trim();if(""!==n){/^\d+\.\s/.test(n)&&(d=!0);break}}if(!d)continue;const a=n.endIndex,r=e+1<i.length?i[e+1].index:l.length;let s=l.substring(a,r);s=s.replace(/^(\s*)(\d+)\.\s/gm,(e,n,i)=>`${n}${parseInt(i,10)+t}. `),l=l.substring(0,a)+s+l.substring(r)}return l}(n),n=function(e){let n=e.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,(e,n)=>{const i=n.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <deleted>",{hadChange:i!==n}),`<deleted>${i}</deleted>`});return n=n.replace(/<changed>([\s\S]*?)<\/changed>/gi,(e,n)=>{const i=n.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <changed>",{hadChange:i!==n,preview:n.substring(0,120)}),`<changed>${i}</changed>`}),n}(n),n=L(n),n},Me=n.useMemo(()=>i?Ee(i):i,[i]);n.useEffect(()=>{ke(R||ae)},[R,ae]);const Te=n.useMemo(()=>({span:({node:n,children:i,...t})=>{var o,l,d,a,r;const s=null!==(l=null===(o=null==n?void 0:n.properties)||void 0===o?void 0:o["highlight-id"])&&void 0!==l?l:null==t?void 0:t["highlight-id"],c="string"==typeof s&&be.has(s),u=null!==(a=null===(d=null==n?void 0:n.properties)||void 0===d?void 0:d["highlight-color"])&&void 0!==a?a:null==t?void 0:t["highlight-color"];return e.jsx("span",{style:{...null!==(r=null==H?void 0:H.span)&&void 0!==r?r:{},...c?{backgroundColor:u||"#fef08a"}:{}},children:i})},button:({node:n,children:i,...t})=>{var o,l,d,a,r,s;const c=null!==(l=null===(o=null==n?void 0:n.properties)||void 0===o?void 0:o.action)&&void 0!==l?l:null==t?void 0:t.action,u=null!==(a=null===(d=null==n?void 0:n.properties)||void 0===d?void 0:d["highlight-id"])&&void 0!==a?a:null==t?void 0:t["highlight-id"],g=null!==(s=null===(r=null==n?void 0:n.properties)||void 0===r?void 0:r["highlight-type"])&&void 0!==s?s:null==t?void 0:t["highlight-type"];return"highlight"===c?e.jsx(b.default,{highlightId:u,handleHighlightSpan:Ae,icon:"web"===g?null==me?void 0:me.webCitationIcon:"doc"===g?null==me?void 0:me.fileCitationIcon:e.jsx(e.Fragment,{}),customStyles:"web"===g?null==H?void 0:H.webButton:"doc"===g?null==H?void 0:H.docButton:{}}):null},upt:({node:n,children:i,...t})=>{var o,l;const d=null==t?void 0:t.id,a=d?null===(l=null===(o=d.split("$"))||void 0===o?void 0:o[1])||void 0===l?void 0:l.replaceAll("@","<").replaceAll("#",">"):null,r=ae.find(e=>e.id.toString()===a);if(!r)return i||e.jsx(e.Fragment,{});const s="data-main"in t,c=t["data-status"];return e.jsx(e.Fragment,{children:e.jsx(j.default,{aiReason:r,customStyles:null==H?void 0:H.inlineUpdatedComponent,handleClickCognitiveDecision:null==oe?void 0:oe.handleClickCognitiveDecision,handleClickUpdatedPill:null==oe?void 0:oe.handleClickUpdatedPill,handleClickOutputValue:null==oe?void 0:oe.handleClickOutputValue,customIcons:null==oe?void 0:oe.customIcons,CDNeededInChip:Z,showChip:s,status:c,children:i||e.jsx(e.Fragment,{})})})},del:({node:n,children:i,...t})=>{var l;const{cleanedChildren:d,extractedNodes:a}=P(i,["ins"]);return e.jsxs(e.Fragment,{children:[e.jsx("span",{className:o.default.deleted,style:null!==(l=null==H?void 0:H.deleted)&&void 0!==l?l:{},...t,onClick:()=>{t.onclick&&t.onclick()},children:d}),a]})},ins:({children:n,...i})=>{var t;const{cleanedChildren:l,extractedNodes:d}=P(n,["del"]);return e.jsxs(e.Fragment,{children:[e.jsx("span",{className:o.default.inserted,style:null!==(t=null==H?void 0:H.inserted)&&void 0!==t?t:{},...i,onClick:()=>{i.onclick&&i.onclick()},children:l}),d]})},preserved:({children:n,...i})=>e.jsx("span",{className:o.default.preserved,style:null==H?void 0:H.preserved,...i,children:n}),manual:({children:n,...i})=>{var t;const o=null===(t=null==i?void 0:i.id)||void 0===t?void 0:t.replaceAll("@","<").replaceAll("#",">"),l=ae.find(e=>e.id.toString()===o),d=i["data-status"];return l?e.jsx(w.default,{aiReason:l,handleClick:null==he?void 0:he.handleClick,status:d,children:n}):n||e.jsx(e.Fragment,{})},invisible:({children:n,...i})=>e.jsx(e.Fragment,{}),h1:({node:n,...i})=>e.jsx("h1",{className:o.default.heading1,style:null==H?void 0:H.heading1,children:i.children}),h2:({node:n,...i})=>e.jsx("h2",{className:o.default.heading2,style:null==H?void 0:H.heading2,children:i.children}),h3:({node:n,...i})=>e.jsx("h3",{className:o.default.heading3,style:null==H?void 0:H.heading3,children:i.children}),b:({node:n,...i})=>e.jsx("b",{className:o.default.bold,style:null==H?void 0:H.bold,children:null==i?void 0:i.children}),p:({node:n,...i})=>e.jsx("p",{...i,className:o.default.paragraph,style:null==H?void 0:H.paragraph,children:i.children}),updated:({node:n,...i})=>e.jsx(s.default,{...i,showUserStoryDiff:x,currentUpdatedTagId:xe,setCurrentUpdatedTagId:je,userStory:te,setUserStory:de,setAiReasoning:re,node:n,isCraflow:G,onCraAccept:Q,onCraReject:J,diffEditConfig:ve,customStyles:null==H?void 0:H.updatedContent,craFlowConfig:K}),ol:({node:n,...i})=>{var t,l,d;const a=null!==(d=null!==(l=null===(t=null==n?void 0:n.properties)||void 0===t?void 0:t.start)&&void 0!==l?l:null==i?void 0:i.start)&&void 0!==d?d:void 0;return e.jsx("ol",{className:o.default.orderedList,style:null==H?void 0:H.olist,...a?{start:Number(a)}:{},children:null==i?void 0:i.children})},ul:({node:n,...i})=>e.jsx("ul",{className:o.default.unorderedList,style:null==H?void 0:H.ulist,children:null==i?void 0:i.children}),table:({children:n})=>e.jsx("div",{className:o.default.tableWrapper,children:e.jsx("table",{className:o.default.table,style:null==H?void 0:H.table,children:n})}),tr:({node:n,children:i})=>e.jsx(_,{node:n,children:i,customStyles:H}),td:({node:n,children:i})=>{var t;const{style:o,...l}=null!==(t=null==n?void 0:n.properties)&&void 0!==t?t:{};return e.jsx(q.Provider,{value:!0,children:e.jsx("td",{...l,style:o?{cssText:o}:void 0,children:i})})},th:({node:n,children:i})=>{var t;const{style:o,...l}=null!==(t=null==n?void 0:n.properties)&&void 0!==t?t:{};return e.jsx(q.Provider,{value:!0,children:e.jsx("th",{...l,style:o?{cssText:o}:void 0,children:i})})},recommendation:({node:n,...i})=>{var t;const o=`The AI has selected this content based on: ${(null===(t=null==i?void 0:i.children)||void 0===t?void 0:t[0])||""}`;return e.jsx(f.default,{...i,customStyles:null==H?void 0:H.recommendationBlock,label:o})},a:({inline:i,children:t,node:o,...l})=>{var d,a,r;const s=n.useContext(q)||"true"==(null==l?void 0:l.table),c=`${null==l?void 0:l.href}`,u=null===(d=c.split("$"))||void 0===d?void 0:d[0],g=null===(a=c.split("$"))||void 0===a?void 0:a[1];if("ai_reasoning"===u){const n=(null!==(r=x?V:ae)&&void 0!==r?r:[]).find(e=>e.id.toString()===decodeURIComponent(g)),i=ue.includes(g);if(n){if(s)return e.jsx(T,{aiReason:n,customStyle:null==H?void 0:H.tableAiReasoning,customIcons:me,isHighConfidence:n.relevance_score>=v.SHOW_CONFIDENCE_SCORE_THRESHOLD_IN_AI_REASONING});const o=qe(t),l="source"!==o.trim().toLowerCase();return e.jsx(v.default,{aiReason:n,isSourceHasHighlight:i,inlineLabel:o,isInlineCitation:l,customIcons:me,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:({inline:n,children:i,className:t,node:l,...d})=>/language-(\w+)/.exec(t||"")||(null==t?void 0:t.includes("language-"))?e.jsx("div",{children:e.jsx("code",{className:o.default.blockCode,style:null==H?void 0:H.code,children:i})}):e.jsx("code",{className:o.default.inlineCode,style:null==H?void 0:H.code,children:i}),learned:({children:n})=>e.jsx(a.Tooltip,{title:n,placement:"top",children:e.jsx(d.Info,{size:16,className:o.default.learned})}),generatedcode:({node:n,...i})=>{const t=(null==i?void 0:i.language)||"python",o=(e=>{let n="";try{if(e["data-raw"])n=decodeURIComponent(atob(e["data-raw"]));else{const i=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})(i);return e.jsx(c.default,{title:"Generated Code",code:o,language:t,customStyles:{pill:null==H?void 0:H.generatedCodePill,content:null==H?void 0:H.generatedCodeContent}})},updatedsegment:({node:n,children:i,...t})=>{var o,l,d,a;const r=`${null===(o=n.position)||void 0===o?void 0:o.start.line}-${null===(l=n.position)||void 0===l?void 0:l.start.column}-${null===(d=n.position)||void 0===d?void 0:d.end.line}-${null===(a=n.position)||void 0===a?void 0:a.end.column}`,s=(e=>{if(!e["data-raw"])return null;try{return decodeURIComponent(atob(e["data-raw"]))}catch(e){return console.error("Error decoding segment raw content:",e),null}})(t),c=s?e.jsx("div",{dangerouslySetInnerHTML:{__html:A.default.sanitize(s)}}):e.jsx("div",{children:i});return e.jsx(y.default,{id:r,node:n,children:c,props:t,segmentComponentConfig:pe,customStyles:H,customIcons:O,extractText:qe,isUpdatedSegment:!0})},segment:({node:n,children:i,...t})=>{var o,l,d,a;const r=`${null===(o=n.position)||void 0===o?void 0:o.start.line}-${null===(l=n.position)||void 0===l?void 0:l.start.column}-${null===(d=n.position)||void 0===d?void 0:d.end.line}-${null===(a=n.position)||void 0===a?void 0:a.end.column}`;return e.jsx(y.default,{id:r,node:n,children:i,props:t,segmentComponentConfig:pe,customStyles:H,customIcons:O,extractText:qe,blockId:ee})}}),[$e,K,ae,W,xe,x,i,O,ce,ue,H,pe,be,Ae,ee]),_e=n.useMemo(()=>{let e=I.escapeTagIds(Me,["manual","upt"]);return["del","ins","preserved","manual","upt"].forEach(n=>{e=I.splitTagAcrossParagraphs(e,n,"upt"===n)}),e},[Me]);return n.useEffect(()=>{if(!ie.current)return;if(!ce.length)return void Ce();let e;if(0===ue.length||X)requestAnimationFrame(()=>{fe([ce[ge].replace(/\*/g,"")])});else{const n=ie.current,i=new MutationObserver(()=>{clearTimeout(e),e=setTimeout(()=>{i.disconnect(),requestAnimationFrame(()=>{fe([ce[ge].replace(/\*/g,"")])})},50)});i.observe(n,{childList:!0,subtree:!0})}return()=>{clearTimeout(e)}},[ce,ue,ge,X]),e.jsx(E.Provider,{value:{expandedInfo:ye,setExpanded:Re,reasonToRow:we},children:e.jsxs("div",{ref:ie,className:`${o.default.container} ${"approving"!==h?o.default.wrapper:""} ${U||""}`,style:null==H?void 0:H.container,children:[r?e.jsx(S.MarkdownContextProvider,{children:e.jsx($.default,{components:Te,rehypePlugins:[k.default],children:_e})}):t,Ne>0&&Y&&e.jsx("div",{className:o.default.confidenceScoreContainer,style:null==H?void 0:H.confidenceScoreContainer,children:e.jsxs("span",{className:o.default.confidenceScore,style:null==H?void 0:H.confidenceScore,children:[e.jsx(m.default,{size:14,color:(null==H?void 0:H.confidenceScoreIconColor)||"#166534"}),Ne,"%"]})}),M&&e.jsx("div",{className:o.default.citationLoader,style:null==H?void 0:H.citationLoaderContainer,children:e.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}})}),p&&e.jsx("div",{style:{...null===(ne=null==H?void 0:H.attachedContext)||void 0===ne?void 0:ne.wrapper},className:"flex mt-5",children:e.jsx(C.default,{customStyles:null==H?void 0:H.attachedContext,variant:B})})]})})},exports.splitNestedDiffNodes=P;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react"),i=require("react-markdown"),t=require("rehype-raw"),o=require("./UserStoryWithCitation.module.css.js"),l=require("../../shared/useMarkdownSearch.js"),d=require("lucide-react"),a=require("@mui/material"),r=require("dompurify"),s=require("../../shared/UpdatedAnimationContent.js"),c=require("../../shared/GeneratedCodeCitation.js"),u=require("../../shared/CitationLoadingIndicator.js"),g=require("../RequirementAIWrapper/RequirementAIWrapper.js"),p=require("../../icons/CognitiveDecision.js"),h=require("../../icons/BrainRed.js"),v=require("../ai-reasoning/AiReasoningCitation.js"),m=require("../../icons/RelevanceScoreIcon.js"),f=require("../RecommendationBlock/RecommendationBlock.js"),C=require("../UserStoryCard/AttachedContext.js"),x=require("../ai-reasoning/AiReasoningCitationContent.js"),j=require("./components/InlineUpdatedComponent.js"),y=require("../segment/SegmentWrapper.js"),S=require("../../store/markdown-context.js"),w=require("./components/InlineManualComponent.js"),I=require("./components/HighlightButtonComponent.js"),b=require("../../../../utils/tagHelper.js");function R(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var N=R(n),$=R(i),k=R(t),A=R(r);const q=n.createContext(!1),E=n.createContext({expandedInfo:null,setExpanded:()=>{},reasonToRow:{current:new Map}}),M=n.createContext({rowId:""}),T=({aiReason:i,isHighConfidence:t,customStyle:l,customIcons:d})=>{var a;const{expandedInfo:r,setExpanded:s,reasonToRow:c}=n.useContext(E),{rowId:u}=n.useContext(M),g=String(i.id);u&&c.current.set(g,u);const v=(null===(a=null==r?void 0:r.aiReason)||void 0===a?void 0:a.id)===i.id,m=t?(null==d?void 0:d.highConfidence)||e.jsx(p.default,{}):(null==d?void 0:d.lowConfidence)||e.jsx(h.default,{});return e.jsxs("button",{className:o.default.aiReasoningButton,style:l,onClick:e=>{e.stopPropagation(),e.preventDefault(),s(v?null:u,v?null:i)},children:[m,v?e.jsx("i",{className:`pi pi-angle-up ${t?o.default.aiReasoningIconHighConfidence:o.default.aiReasoningIconLowConfidence}`}):e.jsx("i",{className:`pi pi-angle-down ${t?o.default.aiReasoningIconHighConfidence:o.default.aiReasoningIconLowConfidence}`})]})},_=({children:i,node:t,customStyles:l,customIcons:d})=>{var a,r;const s=n.useRef(Math.random().toString(36).slice(2)).current,{expandedInfo:c}=n.useContext(E),u=(null==c?void 0:c.rowId)===s,g=Array.isArray(null==t?void 0:t.children)?t.children.filter(e=>"element"===e.type).length:1,p=null!==(r=null===(a=null==t?void 0:t.properties)||void 0===a?void 0:a.style)&&void 0!==r?r:void 0;return e.jsxs(M.Provider,{value:{rowId:s},children:[e.jsx("tr",{style:p?{cssText:p}:void 0,children:i}),u&&(null==c?void 0:c.aiReason)&&e.jsx("tr",{style:{width:"100%"},children:e.jsx("td",{colSpan:g||1,className:o.default.tableExpandedCell,children:e.jsx("div",{className:o.default.tableExpandedCellInner,children:e.jsx("div",{className:o.default.tableExpandedCellContent,children:e.jsx(x.default,{aiReason:c.aiReason,customIcons:d,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}})})})})})]})};const U=["del","ins"];function L(e){return function(e,n,i){const t=n.join("|");return e.replace(new RegExp(`<(${t})>([\\s\\S]*?)<\\/\\1>`,"gi"),(e,n,t)=>`<${n}>${i(t)}</${n}>`)}(e,U,e=>e.split(/(<[^>]+>)/g).map(e=>!e||/^<[^>]+>$/.test(e)?e:function(e){if(!e)return e;const n=[];return e.replace(/`([^`\n]+)`/g,(e,i)=>`@@CODE_SPAN_${n.push(i)-1}@@`).replace(/\*\*([\s\S]+?)\*\*/g,"<strong>$1</strong>").replace(/__([\s\S]+?)__/g,"<strong>$1</strong>").replace(/@@CODE_SPAN_(\d+)@@/g,(e,i)=>{var t;return`<code>${o=null!==(t=n[Number(i)])&&void 0!==t?t:"",o.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}</code>`;var o})}(e)).join(""))}const F=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function P(e,n){const i=[],t=new Set(n.map(e=>e.toLowerCase())),o=e=>{var n,l;try{if(null==e||"boolean"==typeof e)return null;if("string"==typeof e||"number"==typeof e)return e;if(Array.isArray(e))return e.map(e=>o(e)).flat().filter(e=>null!=e);if(!N.default.isValidElement(e))return e;const d="string"==typeof e.type?e.type.toLowerCase():"";if(t.has(d))return i.push(e),null;if(F.has(d))return e;const a=null===(l=N.default.Children.map(null===(n=e.props)||void 0===n?void 0:n.children,o))||void 0===l?void 0:l.flat().filter(e=>null!=e);return a&&0!==a.length?N.default.cloneElement(e,void 0,a):null}catch(n){return console.error("splitNestedDiffNodes failed while processing node:",n),e}};try{return{cleanedChildren:o(e),extractedNodes:i}}catch(n){return console.error("splitNestedDiffNodes failed:",n),{cleanedChildren:e,extractedNodes:[]}}}exports.default=({message:i,noMarkdownContent:t,useMarkdown:r=!0,isParent:p,scenario:h,showUserStoryDiff:x=!1,aiReasoningsForBlock:R,isCitationLoadingDisplay:M=!1,className:U,highConfidenceIcon:F,lowConfidenceIcon:D,customStyles:H,customIcons:O,contextVariant:B,aiReasoningDiffView:V,userStoryCitations:W,artifactId:z,isCraflow:G,onCraAccept:Q,onCraReject:J,craFlowConfig:K,isDisplayHighlightControl:X=!1,showConfidenceScore:Y=!0,CDNeededInChip:Z,blockId:ee,storyId:ne})=>{var ie;console.log("userstorywithcitation blockid ",ee);const te=n.useRef(null),{userStory:oe,inlineUpdateComponentConfig:le,getAvgScoreForStory:de,setUserStory:ae,aiReasoning:re,setAiReasoning:se,customIcons:ce,searchQueryList:ue,searchQueryReasoningIdList:ge,currentHighlightIndex:pe,segmentComponentConfig:he,inlineManualComponentConfig:ve,diffEditConfig:me}=g.useRequirementAI(),fe=null!=O?O:null==ce?void 0:ce.userStoryIcons;null==H||H.searchHighlight;const{search:Ce,clear:xe}=l.useMarkdownSearch(te),[je,ye]=n.useState("1"),[Se,we]=n.useState(null),Ie=n.useRef(new Map),[be,Re]=n.useState(new Set),Ne=n.useCallback((e,n)=>{we(e&&n?{rowId:e,aiReason:n}:null)},[]),$e=z?de(z):0,[ke,Ae]=n.useState([]),qe=n.useCallback(e=>{Re(n=>{const i=new Set(n);return i.has(e)?i.delete(e):i.add(e),i})},[]),Ee=e=>null==e?"":"string"==typeof e?e:"number"==typeof e?String(e):Array.isArray(e)?e.map(Ee).join(""):N.default.isValidElement(e)?Ee(e.props.children):"",Me=e=>{let n=e;return n=n.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,(e,n)=>`<deleted>${n.replace(/ai_reasoning\$(\d+)/g,(e,n)=>`ai_reasoning$${n}-legacy`)}</deleted>`),n=n.replace(/<generatedCode([^>]*)>([\s\S]*?)<\/generatedCode>/gi,(e,n,i)=>`\n\n<generatedCode${n} data-raw="${btoa(encodeURIComponent(i.trim()))}"></generatedCode>\n\n`),n=n.replace(/^(\s*[-*]|\s*\d+\.)\s*\n?\s*(<updated\b)/gm,"$1 $2"),n=n.replace(/(<segment\b([^>]*)>)([\s\S]*?)(<\/segment>)/gi,(e,n,i,t,o)=>{const l=t.match(/<table[\s\S]*?<\/table>/i);if(l){return`<segment${i} data-table="${btoa(encodeURIComponent(l[0]))}"></segment>`}return e}),n=n.replace(/<updatedsegment([^>]*)>([\s\S]*?)<\/updatedsegment>/gi,(e,n,i)=>{if(/<table[\s>]/i.test(i)){return`<updatedsegment${n} data-raw="${btoa(encodeURIComponent(i))}"></updatedsegment>`}return e}),n=n.replace(/<updated([^>]*)>([\s\S]*?)<\/updated>/gi,(e,i,t,o)=>{const l=n.substring(0,o),d=l.lastIndexOf("\n"),a=/^\s+[-*]\s/.test(l.substring(d+1))||/^\s+\d+\.\s/.test(l.substring(d+1)),r=/^\s*(\d+\.|\s*[-*])\s+$/.test(l.substring(d+1));if(a||r){let e=t;return e=e.replace(/(<deleted>)\s*\n?\s*[-*]\s+/gi,"$1\n"),e=e.replace(/(<changed>)\s*\n?\s*[-*]\s+/gi,"$1\n"),e=e.replace(/(<deleted>)\s*\n?\s*\d+\.\s+/gi,"$1\n"),e=e.replace(/(<changed>)\s*\n?\s*\d+\.\s+/gi,"$1\n"),`<updated${i}>${e}</updated>`}return e}),n=function(e){const n=/<updated[^>]*>[\s\S]*?<\/updated>/gi,i=[];let t;const o=new RegExp(n.source,n.flags);for(;null!==(t=o.exec(e));){const e=t[0],n=e.match(/<deleted>([\s\S]*?)<\/deleted>/i),o=e.match(/<changed>([\s\S]*?)<\/changed>/i),l=e=>(e.match(/^\s*\d+\.\s/gm)||[]).length;i.push({index:t.index,endIndex:t.index+t[0].length,deletedItemCount:l((null==n?void 0:n[1])||""),changedItemCount:l((null==o?void 0:o[1])||"")})}if(0===i.length)return e;let l=e;for(let e=i.length-1;e>=0;e--){const n=i[e],t=n.changedItemCount-n.deletedItemCount;if(0===t)continue;const o=l.substring(0,n.index).split("\n").reverse();let d=!1;for(const e of o){const n=e.trim();if(""!==n){/^\d+\.\s/.test(n)&&(d=!0);break}}if(!d)continue;const a=n.endIndex,r=e+1<i.length?i[e+1].index:l.length;let s=l.substring(a,r);s=s.replace(/^(\s*)(\d+)\.\s/gm,(e,n,i)=>`${n}${parseInt(i,10)+t}. `),l=l.substring(0,a)+s+l.substring(r)}return l}(n),n=function(e){let n=e.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,(e,n)=>{const i=n.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <deleted>",{hadChange:i!==n}),`<deleted>${i}</deleted>`});return n=n.replace(/<changed>([\s\S]*?)<\/changed>/gi,(e,n)=>{const i=n.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <changed>",{hadChange:i!==n,preview:n.substring(0,120)}),`<changed>${i}</changed>`}),n}(n),n=L(n),n},Te=n.useMemo(()=>i?Me(i):i,[i]);n.useEffect(()=>{Ae(R||re)},[R,re]);const _e=n.useMemo(()=>({span:({node:n,children:i,...t})=>{var o,l,d,a,r;const s=null!==(l=null===(o=null==n?void 0:n.properties)||void 0===o?void 0:o["highlight-id"])&&void 0!==l?l:null==t?void 0:t["highlight-id"],c="string"==typeof s&&be.has(s),u=null!==(a=null===(d=null==n?void 0:n.properties)||void 0===d?void 0:d["highlight-color"])&&void 0!==a?a:null==t?void 0:t["highlight-color"];return e.jsx("span",{style:{...null!==(r=null==H?void 0:H.span)&&void 0!==r?r:{},...c?{backgroundColor:u||"#fef08a"}:{}},children:i})},button:({node:n,children:i,...t})=>{var o,l,d,a,r,s;const c=null!==(l=null===(o=null==n?void 0:n.properties)||void 0===o?void 0:o.action)&&void 0!==l?l:null==t?void 0:t.action,u=null!==(a=null===(d=null==n?void 0:n.properties)||void 0===d?void 0:d["highlight-id"])&&void 0!==a?a:null==t?void 0:t["highlight-id"],g=null!==(s=null===(r=null==n?void 0:n.properties)||void 0===r?void 0:r["highlight-type"])&&void 0!==s?s:null==t?void 0:t["highlight-type"];return"highlight"===c?e.jsx(I.default,{highlightId:u,handleHighlightSpan:qe,icon:"web"===g?null==fe?void 0:fe.webCitationIcon:"doc"===g?null==fe?void 0:fe.fileCitationIcon:e.jsx(e.Fragment,{}),customStyles:"web"===g?null==H?void 0:H.webButton:"doc"===g?null==H?void 0:H.docButton:{}}):null},upt:({node:n,children:i,...t})=>{var o,l;const d=null==t?void 0:t.id,a=d?null===(l=null===(o=d.split("$"))||void 0===o?void 0:o[1])||void 0===l?void 0:l.replaceAll("@","<").replaceAll("#",">"):null,r=re.find(e=>e.id.toString()===a);if(!r)return i||e.jsx(e.Fragment,{});const s="data-main"in t,c=t["data-status"];return e.jsx(e.Fragment,{children:e.jsx(j.default,{aiReason:r,customStyles:null==H?void 0:H.inlineUpdatedComponent,handleClickCognitiveDecision:null==le?void 0:le.handleClickCognitiveDecision,handleClickUpdatedPill:null==le?void 0:le.handleClickUpdatedPill,handleClickOutputValue:null==le?void 0:le.handleClickOutputValue,customIcons:null==le?void 0:le.customIcons,CDNeededInChip:Z,showChip:s,status:c,children:i||e.jsx(e.Fragment,{})})})},del:({node:n,children:i,...t})=>{var l;const{cleanedChildren:d,extractedNodes:a}=P(i,["ins"]);return e.jsxs(e.Fragment,{children:[e.jsx("span",{className:o.default.deleted,style:null!==(l=null==H?void 0:H.deleted)&&void 0!==l?l:{},...t,onClick:()=>{t.onclick&&t.onclick()},children:d}),a]})},ins:({children:n,...i})=>{var t;const{cleanedChildren:l,extractedNodes:d}=P(n,["del"]);return e.jsxs(e.Fragment,{children:[e.jsx("span",{className:o.default.inserted,style:null!==(t=null==H?void 0:H.inserted)&&void 0!==t?t:{},...i,onClick:()=>{i.onclick&&i.onclick()},children:l}),d]})},preserved:({children:n,...i})=>e.jsx("span",{className:o.default.preserved,style:null==H?void 0:H.preserved,...i,children:n}),manual:({children:n,...i})=>{var t;const o=null===(t=null==i?void 0:i.id)||void 0===t?void 0:t.replaceAll("@","<").replaceAll("#",">"),l=re.find(e=>e.id.toString()===o),d=i["data-status"];return l?e.jsx(w.default,{aiReason:l,handleClick:null==ve?void 0:ve.handleClick,status:d,children:n}):n||e.jsx(e.Fragment,{})},invisible:({children:n,...i})=>e.jsx(e.Fragment,{}),h1:({node:n,...i})=>e.jsx("h1",{className:o.default.heading1,style:null==H?void 0:H.heading1,children:i.children}),h2:({node:n,...i})=>e.jsx("h2",{className:o.default.heading2,style:null==H?void 0:H.heading2,children:i.children}),h3:({node:n,...i})=>e.jsx("h3",{className:o.default.heading3,style:null==H?void 0:H.heading3,children:i.children}),b:({node:n,...i})=>e.jsx("b",{className:o.default.bold,style:null==H?void 0:H.bold,children:null==i?void 0:i.children}),p:({node:n,...i})=>e.jsx("p",{...i,className:o.default.paragraph,style:null==H?void 0:H.paragraph,children:i.children}),updated:({node:n,...i})=>e.jsx(s.default,{...i,showUserStoryDiff:x,currentUpdatedTagId:je,setCurrentUpdatedTagId:ye,userStory:oe,setUserStory:ae,setAiReasoning:se,node:n,isCraflow:G,onCraAccept:Q,onCraReject:J,diffEditConfig:me,customStyles:null==H?void 0:H.updatedContent,craFlowConfig:K}),ol:({node:n,...i})=>{var t,l,d;const a=null!==(d=null!==(l=null===(t=null==n?void 0:n.properties)||void 0===t?void 0:t.start)&&void 0!==l?l:null==i?void 0:i.start)&&void 0!==d?d:void 0;return e.jsx("ol",{className:o.default.orderedList,style:null==H?void 0:H.olist,...a?{start:Number(a)}:{},children:null==i?void 0:i.children})},ul:({node:n,...i})=>e.jsx("ul",{className:o.default.unorderedList,style:null==H?void 0:H.ulist,children:null==i?void 0:i.children}),table:({children:n})=>e.jsx("div",{className:o.default.tableWrapper,children:e.jsx("table",{className:o.default.table,style:null==H?void 0:H.table,children:n})}),tr:({node:n,children:i})=>e.jsx(_,{node:n,children:i,customStyles:H}),td:({node:n,children:i})=>{var t;const{style:o,...l}=null!==(t=null==n?void 0:n.properties)&&void 0!==t?t:{};return e.jsx(q.Provider,{value:!0,children:e.jsx("td",{...l,style:o?{cssText:o}:void 0,children:i})})},th:({node:n,children:i})=>{var t;const{style:o,...l}=null!==(t=null==n?void 0:n.properties)&&void 0!==t?t:{};return e.jsx(q.Provider,{value:!0,children:e.jsx("th",{...l,style:o?{cssText:o}:void 0,children:i})})},recommendation:({node:n,...i})=>{var t;const o=`The AI has selected this content based on: ${(null===(t=null==i?void 0:i.children)||void 0===t?void 0:t[0])||""}`;return e.jsx(f.default,{...i,customStyles:null==H?void 0:H.recommendationBlock,label:o})},a:({inline:i,children:t,node:o,...l})=>{var d,a,r;const s=n.useContext(q)||"true"==(null==l?void 0:l.table),c=`${null==l?void 0:l.href}`,u=null===(d=c.split("$"))||void 0===d?void 0:d[0],g=null===(a=c.split("$"))||void 0===a?void 0:a[1];if("ai_reasoning"===u){const n=(null!==(r=x?V:re)&&void 0!==r?r:[]).find(e=>e.id.toString()===decodeURIComponent(g)),i=ge.includes(g);if(n){if(s)return e.jsx(T,{aiReason:n,customStyle:null==H?void 0:H.tableAiReasoning,customIcons:fe,isHighConfidence:n.relevance_score>=v.SHOW_CONFIDENCE_SCORE_THRESHOLD_IN_AI_REASONING});const o=Ee(t),l="source"!==o.trim().toLowerCase();return e.jsx(v.default,{aiReason:n,isSourceHasHighlight:i,inlineLabel:o,isInlineCitation:l,customIcons:fe,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:({inline:n,children:i,className:t,node:l,...d})=>/language-(\w+)/.exec(t||"")||(null==t?void 0:t.includes("language-"))?e.jsx("div",{children:e.jsx("code",{className:o.default.blockCode,style:null==H?void 0:H.code,children:i})}):e.jsx("code",{className:o.default.inlineCode,style:null==H?void 0:H.code,children:i}),learned:({children:n})=>e.jsx(a.Tooltip,{title:n,placement:"top",children:e.jsx(d.Info,{size:16,className:o.default.learned})}),generatedcode:({node:n,...i})=>{const t=(null==i?void 0:i.language)||"python",o=(e=>{let n="";try{if(e["data-raw"])n=decodeURIComponent(atob(e["data-raw"]));else{const i=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})(i);return e.jsx(c.default,{title:"Generated Code",code:o,language:t,customStyles:{pill:null==H?void 0:H.generatedCodePill,content:null==H?void 0:H.generatedCodeContent}})},updatedsegment:({node:n,children:i,...t})=>{var o,l,d,a;const r=`${null===(o=n.position)||void 0===o?void 0:o.start.line}-${null===(l=n.position)||void 0===l?void 0:l.start.column}-${null===(d=n.position)||void 0===d?void 0:d.end.line}-${null===(a=n.position)||void 0===a?void 0:a.end.column}`,s=(e=>{if(!e["data-raw"])return null;try{return decodeURIComponent(atob(e["data-raw"]))}catch(e){return console.error("Error decoding segment raw content:",e),null}})(t),c=s?e.jsx("div",{dangerouslySetInnerHTML:{__html:A.default.sanitize(s)}}):e.jsx("div",{children:i});return e.jsx(y.default,{id:r,node:n,children:c,props:t,segmentComponentConfig:he,customStyles:H,customIcons:O,extractText:Ee,isUpdatedSegment:!0})},segment:({node:n,children:i,...t})=>{var o,l,d,a;const r=`${null===(o=n.position)||void 0===o?void 0:o.start.line}-${null===(l=n.position)||void 0===l?void 0:l.start.column}-${null===(d=n.position)||void 0===d?void 0:d.end.line}-${null===(a=n.position)||void 0===a?void 0:a.end.column}`;return e.jsx(y.default,{id:r,node:n,children:i,props:t,segmentComponentConfig:he,customStyles:H,customIcons:O,extractText:Ee,blockId:ee,storyId:ne})}}),[ke,K,re,W,je,x,i,O,ue,ge,H,he,be,qe,ee,ne]),Ue=n.useMemo(()=>{let e=b.escapeTagIds(Te,["manual","upt"]);return["del","ins","preserved","manual","upt"].forEach(n=>{e=b.splitTagAcrossParagraphs(e,n,"upt"===n)}),e},[Te]);return n.useEffect(()=>{if(!te.current)return;if(!ue.length)return void xe();let e;if(0===ge.length||X)requestAnimationFrame(()=>{Ce([ue[pe].replace(/\*/g,"")])});else{const n=te.current,i=new MutationObserver(()=>{clearTimeout(e),e=setTimeout(()=>{i.disconnect(),requestAnimationFrame(()=>{Ce([ue[pe].replace(/\*/g,"")])})},50)});i.observe(n,{childList:!0,subtree:!0})}return()=>{clearTimeout(e)}},[ue,ge,pe,X]),e.jsx(E.Provider,{value:{expandedInfo:Se,setExpanded:Ne,reasonToRow:Ie},children:e.jsxs("div",{ref:te,className:`${o.default.container} ${"approving"!==h?o.default.wrapper:""} ${U||""}`,style:null==H?void 0:H.container,children:[r?e.jsx(S.MarkdownContextProvider,{children:e.jsx($.default,{components:_e,rehypePlugins:[k.default],children:Ue})}):t,$e>0&&Y&&e.jsx("div",{className:o.default.confidenceScoreContainer,style:null==H?void 0:H.confidenceScoreContainer,children:e.jsxs("span",{className:o.default.confidenceScore,style:null==H?void 0:H.confidenceScore,children:[e.jsx(m.default,{size:14,color:(null==H?void 0:H.confidenceScoreIconColor)||"#166534"}),$e,"%"]})}),M&&e.jsx("div",{className:o.default.citationLoader,style:null==H?void 0:H.citationLoaderContainer,children:e.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}})}),p&&e.jsx("div",{style:{...null===(ie=null==H?void 0:H.attachedContext)||void 0===ie?void 0:ie.wrapper},className:"flex mt-5",children:e.jsx(C.default,{customStyles:null==H?void 0:H.attachedContext,variant:B})})]})})},exports.splitNestedDiffNodes=P;
|
|
2
2
|
//# sourceMappingURL=UserStoryWithCitation.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as l}from"react/jsx-runtime";import{useState as n,useRef as o,useEffect as i}from"react";import{ChevronUp as a,ChevronDown as s,Users as r,ExternalLink as d,Download as u,Share2 as c,Copy as v,LoaderCircle as p,PencilIcon as m,Plus as y,Trash2 as h,X as g,Ellipsis as S,Hourglass as f,Check as C,ChevronUpIcon as I,ChevronDownIcon as b,Info as N,Bookmark as w}from"lucide-react";import E from"showdown";import{Tooltip as D,Menu as B,MenuItem as A}from"@mui/material";import T from"../../icons/Illustration.svg.js";import{v4 as x}from"uuid";import U from"./UserStoryCard.module.css.js";import{formatMarkdown as k,indentMarkdown as P}from"../../utils/helpers.js";import{replaceTitleSection as R,postprocessUserStoryAfterEdit as _}from"../../utils/user-story.utils.js";import M from"../../shared/AtomicButton.js";import L from"../RichTextEditor/RichTextEditor.js";import O from"../userstory-with-citation/UserStoryWithCitation.js";import{SectionStatus as z,useRequirementAI as V}from"../RequirementAIWrapper/RequirementAIWrapper.js";import{BigEnoughPanel as j}from"../story-screen/BigEnoughPanel.js";import{InlineTitleEditor as G}from"./TitleEditor/TitleEditor.js";import{updateRedlineDocument as W,getRedlineDocumentId as $,createRedlineDocument as H}from"../../../../service/redlineService.js";import F from"./ClinicalTrialSection.js";import{CompletionPanel as q}from"../story-screen/CompletionPanel.js";import Q from"../../icons/CDIcon.js";const Y={[z.WAITING]:"WAITING TO GENERATE",[z.IN_PROGRESS]:"IN PROGRESS",[z.GENERATED]:"GENERATED",[z.FAILED]:"FAILED",[z.GENERATE]:"GENERATE",[z.APPROVED]:"APPROVED"};function Z(e){const l=[],n=/<learned>(.*?)<\/learned>/g;let o,i=0,a=0;for(;null!==(o=n.exec(e));){const[,s]=o,r=o.index;r>i&&l.push(t("span",{children:e.slice(i,r)},"text-pre-"+a++)),l.push(t(D,{title:s,placement:"top",children:t(N,{size:16,className:"inline-block mx-1 text-blue-500 hover:text-blue-700 cursor"})},`tooltip-${x()}`)),i=n.lastIndex}return i<(null==e?void 0:e.length)&&l.push(t("span",{children:e.slice(i)},"text-post-"+a++)),l}function J(e,t,l){var n;if(!e)return{};if(t)return{...e.parentConfig};const o={...e.childConfig};return l&&(null===(n=e.subFeatureOverrides)||void 0===n?void 0:n[l])?{...o,...e.subFeatureOverrides[l]}:o}const K=({displayName:l})=>{var n;const{customStyles:o}=V(),i=null===(n=null==o?void 0:o.userStoryCardStyles)||void 0===n?void 0:n.showDisplayName;return e("div",{className:U.displayName,style:null==i?void 0:i.wrapper,children:[t(w,{className:U.displayNameIcon,style:null==i?void 0:i.displayNameIcon}),e("span",{style:null==i?void 0:i.label,children:[l,":"]})]})},X=({isUserStoryCurrentlyUpdated:I,artifactId:b,artifactTitleId:N,parentUserStory:w,currentUserStory:$,onUserStoryChange:H,parentIndex:ee,currentIndex:te,enableDownload:le,isDiffEditReviewMode:ne,showUserStoryDiff:oe,handleDownloadUserStory:ie,handleOpenSendDialog:ae,updateUserStoryArtifact:se,selectedArtifactId:re,isDisplayHighlightControl:de,elementDisplayConfig:ue,_resolvedConfig:ce,showWrapper:ve=!1,defaultExpanded:pe,actionItemsConfig:me,onDelete:ye,contextVariant:he,expandedSubFeatures:ge,showDisplayName:Se=!0,allowTitleEdit:fe=!0,showConfidenceScore:Ce=!0,showBorderTop:Ie=!0,sectionStatusConfig:be,showCompletionPanel:Ne=!1,completionPanelConfig:we,showAddSectionButton:Ee=!1,disableEditPlan:De=!1,useMuiTooltip:Be=!1,approveButtonConfig:Ae,editButtonConfig:Te,CDNeededInChip:xe,blockNumber:Ue,showAssignSection:ke=!1,disableAssignSection:Pe=!1,onAssignSectionClick:Re,onSave:_e})=>{var Me,Le,Oe,ze,Ve,je,Ge,We,$e,He,Fe,qe,Qe,Ye,Ze,Je,Ke,Xe,et,tt,lt,nt,ot,it;const{isLoadingSectionData:at=!1,onLoadSectionData:st,status:rt,onStatusClick:dt,completedCount:ut,totalCount:ct,isNoDataAvailable:vt=!1}=null!=be?be:{},{searchQueryList:pt,citations:mt,customStyles:yt,onEditBlocked:ht,redlineDcoumentId:gt,redlineConfig:St,customSectionConfig:ft,updateRedlineDataParent:Ct,aiReasoning:It}=V(),bt=null==yt?void 0:yt.userStoryCardStyles,Nt=null==bt?void 0:bt.customSectionEditButton,wt=null==bt?void 0:bt.statusStyles,Et=null===(Me=null==yt?void 0:yt.userStoryCardStyles)||void 0===Me?void 0:Me.userStoryEditStyles,Dt=null===(Le=null==yt?void 0:yt.userStoryScreenStyles)||void 0===Le?void 0:Le.userStoryContentStyles,Bt=null==bt?void 0:bt.progressHeaderStyles,At=null==bt?void 0:bt.clinicalTrialSectionStyles,Tt=null==bt?void 0:bt.CompletionStyles,xt=null==bt?void 0:bt.noDataStyles,Ut=null==bt?void 0:bt.approveButtonStyles,kt=null!==(ze=null===(Oe=null==ft?void 0:ft.shouldRender)||void 0===Oe?void 0:Oe.call(ft,$))&&void 0!==ze&&ze,Pt=null===(Ve=null==ft?void 0:ft.getValue)||void 0===Ve?void 0:Ve.call(ft,$),Rt=null!==(Ge=null===(je=null==ft?void 0:ft.getFields)||void 0===je?void 0:je.call(ft,$))&&void 0!==Ge?Ge:[],_t=null!==(We=null==ft?void 0:ft.isEditDisabled)&&void 0!==We&&We,Mt=null!==(He=null===($e=null==ft?void 0:ft.isSaving)||void 0===$e?void 0:$e.call(ft,$))&&void 0!==He&&He,Lt=((e,t)=>e>=80?null==t?void 0:t.highCompletion:e>=50?null==t?void 0:t.mediumCompletion:null==t?void 0:t.lowCompletion)(null!==(Fe=$.completion_percentage)&&void 0!==Fe?Fe:0,Tt),Ot={[z.WAITING]:null==wt?void 0:wt.waiting,[z.IN_PROGRESS]:null==wt?void 0:wt.inProgress,[z.GENERATED]:null==wt?void 0:wt.generated,[z.FAILED]:null==wt?void 0:wt.failed,[z.GENERATE]:null==wt?void 0:wt.generate,[z.APPROVED]:null==wt?void 0:wt.approved},[zt,Vt]=n({...structuredClone($),value:k($.value)||""}),[jt,Gt]=n({userStory:!!$.isDefaultEdit}),[Wt,$t]=n(!1),[Ht,Ft]=n(!1),[qt,Qt]=n(null),[Yt,Zt]=n(null),{userStory:Jt,customIcons:Kt}=V(),[Xt,el]=n(null!=pe?pe:""===ee||re===$.artifactId||!!$.isDefaultOpen),[tl,ll]=n(!1),[nl,ol]=n(null),[il,al]=n(null),[sl,rl]=n(!1),dl=o(null),ul=o(null),[cl,vl]=n(!1),[pl,ml]=n(!1),yl=o(null),[hl,gl]=n(!1),[Sl,fl]=n($.value);i(()=>{I&&el(I)},[I]),i(()=>{Vt({...structuredClone($),value:k($.value)||""})},[$]),i(()=>{pt.length>0?el(!0):void 0===pe&&re&&el(re===$.artifactId)},[pt,re,$.artifactId]),i(()=>{ge&&ge.length>0&&el(ge.includes($.artifactId)||""===ee||re===$.artifactId||!!$.isDefaultOpen)},[ge]);const Cl=()=>{ol(null)},Il=()=>{al(null)},bl=()=>{Xt&&jt.userStory&&ul.current&&!ul.current.requestClose()||el(e=>!e)},Nl=async()=>{var e,t;try{"userStory"==="userStory"&&(H(zt),console.log("I am changing RTE editor values",zt)),await(null===(e=null==Te?void 0:Te.onSaveEditedSection)||void 0===e?void 0:e.call(Te,zt)),await se(mt,Jt,b,null===(t=yl.current)||void 0===t?void 0:t.signal)}finally{}};const wl=null!=(null==$?void 0:$.big_enough)&&!Number.isNaN($.big_enough)&&!!(null==$?void 0:$.big_enough_decision_factors),El=null!==(qe=null==$?void 0:$.completion_percentage)&&void 0!==qe?qe:0,Dl=!!(null==$?void 0:$.completion_decision_factors),Bl=""===ee,Al=null!=ce?ce:J(ue,Bl),Tl=!ne&&!oe;i(()=>{if(!Yt)return;const e=setTimeout(()=>{const e=document.getElementById(`story-card-${Yt}`);null==e||e.scrollIntoView({behavior:"smooth",block:"start"})},100);return()=>clearTimeout(e)},[Yt]),i(()=>{$.isDefaultEdit&&Gt(e=>({...e,userStory:!0}))},[$.isDefaultEdit]),console.log("block number in userstory card ",Ue),console.log("[TESTING-CURRENT-USER-STORY] \n",$,"\n[TESTING-USER-STORY] \n",Jt);return i(()=>fl($.value),[$.value]),e("div",{className:U.card,"data-block-id":"user-story-card-wrapper-"+Ue,style:null==bt?void 0:bt.cardStyle,id:`story-card-${$.title}`,"data-expanded":Xt,children:[e("div",{className:U.titleSection,style:null==bt?void 0:bt.titleSection,children:[e("div",{className:U.titleRow,style:null==bt?void 0:bt.titleRow,onClick:bl,children:[e("div",{className:U.titleLeft,style:null==bt?void 0:bt.titleLeft,onMouseEnter:()=>vl(!0),onMouseLeave:()=>vl(!1),children:[Se&&t(K,{displayName:N}),Wt&&Tl?t(G,{title:$.title,onSave:e=>(async(e,t)=>{var l;try{let n={...$};$.artifactId===t?n.title=e:n.sub_features=(null===(l=$.sub_features)||void 0===l?void 0:l.map(l=>l.artifactId===t?{...l,title:e}:l))||[],Vt(n),H(n),$t(!1)}catch(e){console.error("Failed to save title",e)}})(e,$.artifactId),onCancel:()=>{$t(!1)},inputStyle:null==Et?void 0:Et.inlineTitleInput,confirmButtonStyle:null==Et?void 0:Et.inlineTitleConfirm,cancelButtonStyle:null==Et?void 0:Et.inlineTitleCancel},"inline-title-editor"):e("div",{className:U.storyTitleWrapper,children:[t(D,{title:Z($.title),arrow:!0,children:t("h2",{title:Be?void 0:$.title,className:U.storyTitle,style:null==bt?void 0:bt.storyTitle,children:Z($.title)},$.artifactId)}),Ne&&(Dl?t(q,{customIcons:null==Kt?void 0:Kt.userStoryIcons,customStyles:null==bt?void 0:bt.aiReasoningCitaionStyles,currentUserStory:$,panelStyles:null==bt?void 0:bt.CompletionStyles,onToggleStateChange:ml,completionPanelConfig:we,children:e("div",{style:{display:"inline-flex",alignItems:"center",gap:"4px",...null==Tt?void 0:Tt.badge,...Lt},children:[e("span",{children:[El,"% Completed"]}),t("span",{style:{display:"flex",alignItems:"center"},children:t(Q,{color:"currentColor"})}),t(pl?a:s,{size:14,style:null==Tt?void 0:Tt.chevronStyle})]})}):t("div",{style:{display:"inline-flex",alignItems:"center",gap:"4px",...null==Tt?void 0:Tt.badge,...Lt},children:e("span",{children:[El,"% Completed"]})})),fe&&t("button",{type:"button",className:U.titleEditButton,style:null==Et?void 0:Et.titleEditButton,onClick:e=>{e.stopPropagation(),$t(!0),Xt||el(!0)},"aria-label":"Edit title",title:"Edit title",children:t("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M8.99998 14.9992H15.75M2.25 14.9992H3.50591C3.87279 14.9992 4.05624 14.9992 4.22887 14.9577C4.38192 14.921 4.52824 14.8604 4.66245 14.7782C4.81382 14.6854 4.94354 14.5557 5.20296 14.2962L14.625 4.87419C15.2463 4.25287 15.2463 3.24551 14.625 2.62419C14.0037 2.00287 12.9963 2.00287 12.375 2.62419L2.95295 12.0462C2.69352 12.3057 2.5638 12.4354 2.47104 12.5868C2.3888 12.721 2.32819 12.8673 2.29145 13.0203C2.25 13.193 2.25 13.3764 2.25 13.7433V14.9992Z",stroke:"#94A3B8","stroke-width":"1.54286","stroke-linecap":"round","stroke-linejoin":"round"})})})]})]}),(rt||void 0!==ut&&void 0!==ct)&&e("div",{className:U.statusContainer,children:[void 0!==ut&&void 0!==ct&&e("div",{className:U.completedBadge,children:["Completed: ",ut,"/",ct]}),rt&&t("button",{type:"button",onClick:e=>{e.stopPropagation(),null==dt||dt()},onMouseEnter:()=>gl(!0),onMouseLeave:()=>gl(!1),className:U.statusButton,style:{...null===(Qe=Ot[rt])||void 0===Qe?void 0:Qe.default,...hl&&(null===(Ye=Ot[rt])||void 0===Ye?void 0:Ye.hover)},children:Y[rt]})]}),e("div",{className:U.titleActions,style:null==bt?void 0:bt.titleActions,onClick:e=>e.stopPropagation(),children:[(Al.showProgressPercentage||Al.showGapBox)&&ve&&e("div",{className:U.progressHeader,style:null==Bt?void 0:Bt.wrapper,children:[Al.showProgressPercentage&&e("div",{className:U.progressPercentage,style:null==Bt?void 0:Bt.percentage,children:[null!==(Je=null!==(Ze=null==$?void 0:$.confidenceScore)&&void 0!==Ze?Ze:null==Al?void 0:Al.confidenceValue)&&void 0!==Je?Je:"0","%"]}),Al.showGapBox&&e("div",{className:U.gapBox,style:null==Bt?void 0:Bt.gapBox,children:[null!==(Xe=null!==(Ke=null==$?void 0:$.gapValue)&&void 0!==Ke?Ke:null==Al?void 0:Al.gapBoxValue)&&void 0!==Xe?Xe:"2"," ","Gaps"]})]}),wl&&t(j,{customIcons:null==Kt?void 0:Kt.userStoryIcons,customStyles:null==bt?void 0:bt.aiReasoningCitaionStyles,currentUserStory:$,panelStyles:null==bt?void 0:bt.BigEnoughStyles}),ke&&t("button",{type:"button",className:U.iconButton,style:null==bt?void 0:bt.iconButton,disabled:Pe,onClick:e=>{e.stopPropagation(),null==Re||Re($)},"aria-label":"Assign section users",title:"Assign section users",children:t(r,{size:16})}),!jt.userStory&&e(l,{children:[!1!==(null==Al?void 0:Al.showShareButton)&&t("button",{className:U.iconButton,style:null==bt?void 0:bt.iconButton,onClick:e=>{ol(e.currentTarget)},children:t(d,{size:16})}),e(B,{id:"user-story-share-menu",anchorEl:nl,open:!!nl,onClose:()=>ol(null),style:null==bt?void 0:bt.userStoryShareMenu,children:[le&&t(A,{style:null==bt?void 0:bt.userStoryMenuItem,onClick:async()=>{ll(!0),ie&&(await Promise.all([ie("pdf"),ie("doc")]),ll(!1))},children:e("div",{ref:dl,className:U.menuItemContent,style:null==bt?void 0:bt.menuItemContent,children:[t(u,{size:16,color:null==bt?void 0:bt.menuIconColor}),t("p",{style:null==bt?void 0:bt.menuLabel,children:"Download"})]})}),t(A,{style:null==bt?void 0:bt.userStoryMenuItem,onClick:async()=>{let e=$;w&&(e={...$,value:`${R(null==w?void 0:w.value,$.title)} \n${$.value}`}),null==ae||ae(!0,[e],$.artifactId),Cl()},children:e("div",{style:null==bt?void 0:bt.menuItemContent,className:U.menuItemContentPadded,children:[t(c,{size:16,color:null==bt?void 0:bt.menuIconColor}),t("p",{style:null==bt?void 0:bt.menuLabel,children:"Send"})]})}),t(A,{style:null==bt?void 0:bt.userStoryMenuItem,onClick:async()=>{const e=(new E.Converter).makeHtml(k($.value)||$.value),t=function(e){const t=(new E.Converter).makeHtml(e),l=document.createElement("div");return l.innerHTML=t,l.textContent||l.innerText||""}(k($.value)||$.value),l=new ClipboardItem({"text/plain":new Blob([t],{type:"text/plain"}),"text/html":new Blob([e],{type:"text/html"})});try{await navigator.clipboard.write([l]),console.log("Copied User Story")}catch(e){console.error("Failed to copy user story:",e)}finally{Cl()}},children:e("div",{style:null==bt?void 0:bt.menuItemContent,className:U.menuItemContentPadded,children:[t(v,{size:16,color:null==bt?void 0:bt.menuIconColor}),t("p",{style:null==bt?void 0:bt.menuLabel,children:"Copy"})]})})]})]}),!sl&&jt.userStory&&Xt?t(M,{type:"outline",children:"Cancel",style:null==bt?void 0:bt.cancelButton,onClick:()=>{var e;null===(e=yl.current)||void 0===e||e.abort(),Gt(e=>({...e,userStory:!1}))}}):t(l,{}),jt.userStory&&Xt?t(M,{type:"fill",children:sl?e("span",{className:U.savingSpinner,style:null==bt?void 0:bt.savingSpinner,children:[t(p,{className:U.spinAnimation,style:null==bt?void 0:bt.spinAnimation}),t("span",{children:"Saving..."})]}):"Save",isDisable:sl,style:sl?null==bt?void 0:bt.savingButton:null==bt?void 0:bt.saveButton,onClick:async()=>{rl(!0),await Nl();let e=await(async()=>{var e,t,l,n,o;let i=zt.value;console.log("[V] valueToUpdate before",i),i=i.replace(/<invisible\s+id="([^"]+)"\s*><\/invisible>/gi,"\x3c!-- $1 --\x3e"),console.log("[V] valueToUpdate after",i);try{await(null==_e?void 0:_e(i,$.artifactId))}catch(e){}try{if(null==St?void 0:St.callUpdateDocument){const{updated_reqai:a}=await W({documentId:gt,sectionId:$.artifactId,baseApiUrl:null==St?void 0:St.baseApiUrl,updatedContent:i,userEmail:St.userEmail,userName:St.userName,redlineConfigId:null!==(e=St.redlineConfigId)&&void 0!==e?e:""},null!==(t=null==St?void 0:St.token)&&void 0!==t?t:"");i=null===(o=null===(n=null===(l=null==a?void 0:a.artifactData)||void 0===l?void 0:l.userStorySnapshot)||void 0===n?void 0:n[0])||void 0===o?void 0:o.value,await(null==Ct?void 0:Ct(a))}}catch(e){console.error("failed to update redline document",e),i=Sl}return i=i.replace(/<!--\s*([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\s*-->/gi,'<invisible id="$1"></invisible>'),i})();const t={...zt,value:e};H({...t,isDefaultEdit:!1}),fl(t.value),Gt(e=>({...e,userStory:!1})),rl(!1)}}):!ne&&!oe&&!De&&Xt&&!1!==(null==Al?void 0:Al.showEditButton)&&t("button",{className:U.iconButton,style:null==bt?void 0:bt.editButton,onClick:()=>Gt(e=>({...e,userStory:!0})),children:t(m,{color:null==bt?void 0:bt.pencilIconColor,size:16})}),Ee&&Bl&&Xt&&!ne&&!oe&&!1!==(null==Al?void 0:Al.showEditButton)&&e("button",{type:"button",className:U.addSectionButton,style:null==Et?void 0:Et.addSectionButton,onClick:e=>{var t,l,n;e.stopPropagation();const o=(null!==(l=null===(t=$.sub_features)||void 0===t?void 0:t.length)&&void 0!==l?l:0)+1,i={artifactId:x(),title:`New Section ${o}`,value:"Please add details for this section.",section:"subfeature",isDefaultOpen:!0},a={...$,sub_features:[...null!==(n=$.sub_features)&&void 0!==n?n:[],i]};Vt(a),H(a),el(!0),Zt(i.title)},"aria-label":"Add section",title:"Add section",children:[t(y,{size:14}),t("span",{className:U.addSectionLabel,children:"Add Section"})]}),!Bl&&!ne&&!De&&!oe&&t("button",{type:"button",onClick:e=>{e.stopPropagation(),null==ye||ye()},className:U.iconButton,style:null==Et?void 0:Et.deleteButton,"aria-label":"Delete section",title:"Delete section",children:t(h,{size:16})}),kt&&t("button",{type:"button",className:U.iconButton,style:null==Nt?void 0:Nt.button,disabled:_t,onClick:e=>{if(e.stopPropagation(),Ht)return Qt(null),void Ft(!1);Qt(structuredClone(null!=Pt?Pt:{})),el(!0),Ft(!0)},children:Ht?t(g,{size:16,color:null==bt?void 0:bt.pencilIconColor,style:null==Nt?void 0:Nt.cancelIcon}):t(m,{size:16,color:null==bt?void 0:bt.pencilIconColor,style:null==Nt?void 0:Nt.editIcon})}),(null==Al?void 0:Al.actionItemsButton)&&e(l,{children:[t("span",{className:U.actionItemBtn,style:null==bt?void 0:bt.actionItemBtn,onClick:e=>{e.stopPropagation(),al(e.currentTarget)},children:t(S,{})}),t(B,{id:"user-story-action-menu",anchorEl:il,open:!!il,onClose:Il,style:null==bt?void 0:bt.userStoryShareMenu,children:null==me?void 0:me.items.map((l,n)=>t(A,{style:null==bt?void 0:bt.userStoryMenuItem,onClick:()=>{l.onclick($),Il()},children:e("div",{className:U.menuItemContent,style:{...null==bt?void 0:bt.menuItemContent,...!l.isActive&&{cursor:"not-allowed",opacity:.5}},children:[t("span",{className:U.menuItemIcon,style:null==bt?void 0:bt.menuItemIcon,children:l.icon}),t("p",{style:null==bt?void 0:bt.menuLabel,children:l.name}),t("span",{className:U.menuItemRight,style:null==bt?void 0:bt.menuItemRight})]})},`action-item-${n}-${l.name}`))})]}),t("button",{type:"button",onClick:e=>{e.stopPropagation(),bl()},style:null==bt?void 0:bt.chevronButton,className:U.chevronButton,children:t(Xt?a:s,{className:U.chevronIcon,color:null==bt?void 0:bt.chevronIconColor})})]})]}),t("div",{className:U.divider,style:null==bt?void 0:bt.dividerStyle})]}),Xt&&t("div",{className:U.cardContent,style:{...null==bt?void 0:bt.cardContentStyle,borderTop:Ie?"1px solid #E5E5E5":"none"},children:e("div",at?{className:U.loadingContainer,children:[t("div",{className:U.loadingIconWrapper,children:t(f,{size:28,color:"#5B3DF5",className:U.spinAnimation})}),e("div",{children:[t("h3",{className:U.loadingTitle,children:"Section generation in progress.."}),t("p",{className:U.loadingSubtitle,children:"This may take a few minutes"})]}),t("button",{type:"button",onClick:()=>null==st?void 0:st(),className:U.viewStatusButton,children:"View Status"})]}:vt?{className:U.noDataContainer,style:null==xt?void 0:xt.container,children:[t("img",{src:T,alt:"No data available",className:U.noDataIllustration,style:null==xt?void 0:xt.illustration}),t("h3",{className:U.noDataTitle,style:null==xt?void 0:xt.title,children:"No Data Available for This Section"}),t("p",{className:U.noDataSubtitle,style:null==xt?void 0:xt.subtitle,children:"We couldn't find data for this section yet. Upload the required document from the Documents tab to generate content."})]}:{className:U.contentInner,style:null==bt?void 0:bt.contentInner,children:[e("div",{className:U.descriptionSection,style:null==bt?void 0:bt.descriptionSection,children:[t("div",{className:U.justifyBetween,style:null==bt?void 0:bt.justifyBetween}),jt.userStory?t(L,{ref:ul,minHeight:"100%",height:"100%",type:"string",value:k(Sl)||"",handleUpdateState:(e,t)=>{const l=_(P(t));Vt(e=>({...e,value:l||""}))},doNotShowBorderInViewMode:!1,onBlur:()=>{},mode:jt.userStory?"edit":"readOnly",onEditBlocked:ht,onSaveUnsavedChanges:async()=>{await Nl(),el(!1)},onDiscardUnsavedChanges:()=>{Vt({...structuredClone($),value:k($.value)||""}),Gt(e=>({...e,userStory:!1})),el(!1)},isSavingUnsavedChanges:sl}):kt?t(F,{styles:At,fields:Rt,readonly:!Ht,isSaving:Mt,value:null!==(et=null!=qt?qt:Pt)&&void 0!==et?et:{},onChange:Qt,onSave:async()=>{var e;qt&&(await(null===(e=null==ft?void 0:ft.onSave)||void 0===e?void 0:e.call(ft,$,qt)),Qt(null),Ft(!1))},onCancel:()=>{Qt(null),Ft(!1)}}):e(l,{children:[t(O,{showUserStoryDiff:oe,isParent:""===ee,message:k($.value)||"",artifactId:$.artifactId,customStyles:Dt,isDisplayHighlightControl:de,contextVariant:he,showConfidenceScore:Ce,CDNeededInChip:xe,blockId:Ue}),(Ae||Te)&&e("div",{className:U.actionButtonsContainer,style:null==Ut?void 0:Ut.container,children:[Te&&!jt.userStory&&e(l,{children:[t("button",{type:"button",className:U.actionButton,style:null==Ut?void 0:Ut.button,disabled:Te.disabled||Te.isLoading,onClick:e=>{var t;e.stopPropagation(),null===(t=Te.onClick)||void 0===t||t.call(Te),Gt(e=>({...e,userStory:!0})),el(!0)},children:Te.isLoading?e(l,{children:[t(p,{size:16,className:U.actionButtonSpinner,style:null==Ut?void 0:Ut.icon}),t("span",{style:null==Ut?void 0:Ut.text,children:null!==(tt=Te.label)&&void 0!==tt?tt:"Edit"})]}):e(l,{children:[t(m,{size:16,style:null==Ut?void 0:Ut.icon}),t("span",{style:null==Ut?void 0:Ut.text,children:null!==(lt=Te.label)&&void 0!==lt?lt:"Edit"})]})}),Ae&&t("span",{className:U.actionButtonDivider})]}),Ae&&t("button",{type:"button",className:U.actionButton,style:null==Ut?void 0:Ut.button,disabled:Ae.disabled||Ae.isLoading,onClick:e=>{var t;e.stopPropagation(),null===(t=Ae.onClick)||void 0===t||t.call(Ae)},children:Ae.isLoading?e(l,{children:[t(p,{size:16,className:U.actionButtonSpinner,style:null==Ut?void 0:Ut.icon}),t("span",{style:null==Ut?void 0:Ut.text,children:null!==(nt=Ae.label)&&void 0!==nt?nt:"Approve"})]}):e(l,{children:[t(C,{size:16,style:null==Ut?void 0:Ut.icon}),t("span",{style:null==Ut?void 0:Ut.text,children:null!==(ot=Ae.label)&&void 0!==ot?ot:"Approve"})]})})]})]})]}),null===(it=zt.sub_features)||void 0===it?void 0:it.map((e,l)=>{console.log("UserStoryCardWrapper: sub",e);const n=J(ue,!1,e.artifactId);return t(X,{artifactId:b,isUserStoryCurrentlyUpdated:I,artifactTitleId:`${N}-${String.fromCharCode(65+l)}`,parentUserStory:$,parentIndex:`${ee}${ee&&"."}${te}`,currentIndex:`${l+1}`,doNotShowBorderInViewMode:!1,currentUserStory:e,onUserStoryChange:e=>((e,t)=>{const l=[...$.sub_features||[]];l[e]=t,H({...$,sub_features:l})})(l,e),enableDownload:!0,isDiffEditReviewMode:ne,showUserStoryDiff:oe,updateUserStoryArtifact:se,handleDownloadUserStory:ie,handleOpenSendDialog:ae,isDisplayHighlightControl:de,elementDisplayConfig:ue,_resolvedConfig:n,actionItemsConfig:me,onDelete:()=>(e=>{const t=($.sub_features||[]).filter((t,l)=>l!==e),l={...$,sub_features:t};Vt(l),H(l)})(l),expandedSubFeatures:ge,disableEditPlan:De,useMuiTooltip:Be,blockNumber:e.blockNumber,showAssignSection:ke,onAssignSectionClick:Re,onSave:_e},e.artifactId)})]})})]})},ee=({artifactTitleIDs:n,expandedSubFeatures:o,isDiffEditReviewMode:a,showUserStoryDiff:s,updateUserStoryArtifact:r,isUserStoryCurrentlyUpdated:d,artifactId:u,handleOpenSendDialog:c,handleDownloadUserStory:v,selectedArtifactId:p,isDisplayHighlightControl:m,elementDisplayConfig:y,showWrapper:h,actionItemsConfig:g,contextVariant:S,showDisplayName:f,allowTitleEdit:C,showConfidenceScore:N,showBorderTop:w,defaultExpanded:E,showCompletionPanel:D=!1,completionPanelConfig:B,showAddSectionButton:A=!1,disableEditPlan:T=!1,useMuiTooltip:x=!1,approveButtonConfig:k,editButtonConfig:P,CDNeededInChip:R,setRedlineDocumentIdParent:_,showAssignSection:M,onAssignSectionClick:L,disableAssignSection:O,onSave:z})=>{const{userStory:j,setUserStory:G,customStyles:W,searchQueryList:F,currentHighlightIndex:q,setCurrentHighlightIndex:Q,segmentComponentConfig:Y,sectionStatusConfig:Z,redlineConfig:K,setRedlineDocumentId:ee}=V(),te=null==W?void 0:W.userStoryCardStyles,le=0===q,ne=q===F.length-1;return i(()=>{if(!(null==K?void 0:K.callCreateDocumentOnInit))return;(async()=>{var e;const{redline_document_id:t}=await $({baseApiUrl:K.documentBaseApiUrl||"",comparisonId:K.documentComparisonId||""});if(t)ee(t);else{const{document_id:t}=await H({baseApiUrl:K.baseApiUrl,changelogConfigId:K.changelogConfigId,comparisonId:K.documentComparisonId,artifactId:K.artifactId,inputData:K.inputData,redlineConfigId:K.redlineConfigId,userEmail:K.userEmail,userName:K.userName},null!==(e=null==K?void 0:K.token)&&void 0!==e?e:"");t&&(ee(t),null==_||_(t))}})()},[]),e("div",{className:U.userStoryCardWrapper,style:m?{...null==te?void 0:te.userStoryCardWrapper,position:"relative"}:null==te?void 0:te.userStoryCardWrapper,children:[m&&t(l,{children:F.length>0&&t("div",{className:U.wrapper,children:t("div",{className:U.highlightNavigation,children:e("div",{className:U.navigationContainer,children:[e("span",{className:U.navCounter,children:[q+1," of ",F.length]}),e("div",{className:U.navButtons,children:[t("button",{onClick:()=>{q>0&&Q(e=>e-1)},className:U.navButton,disabled:le,children:t(I,{size:20,className:U.navIcon})}),t("button",{onClick:()=>{q<F.length-1&&Q(e=>e+1)},className:U.navButton,disabled:ne,children:t(b,{size:20,className:U.navIcon})})]})]})})})}),j.map((e,l)=>{console.log("UserStoryCardWrapper: userstory",e);const i=J(y,!0);return t(X,{isUserStoryCurrentlyUpdated:d,artifactId:u,artifactTitleId:n[l]||"",expandedSubFeatures:o,currentUserStory:e,onUserStoryChange:e=>{G(t=>(t[l]=e,[...t]))},parentIndex:"",currentIndex:`${l+1}`,doNotShowBorderInViewMode:!0,enableDownload:!0,isDiffEditReviewMode:a,showUserStoryDiff:s,updateUserStoryArtifact:r,handleOpenSendDialog:c,handleDownloadUserStory:v,selectedArtifactId:p,isDisplayHighlightControl:m,elementDisplayConfig:y,_resolvedConfig:i,showWrapper:h,defaultExpanded:E,actionItemsConfig:g,contextVariant:S,showDisplayName:f,allowTitleEdit:C,showConfidenceScore:N,showBorderTop:w,sectionStatusConfig:Z,showCompletionPanel:D,completionPanelConfig:B,showAddSectionButton:A,disableEditPlan:T,useMuiTooltip:x,approveButtonConfig:k,CDNeededInChip:R,editButtonConfig:P,showAssignSection:M,disableAssignSection:O,onAssignSectionClick:L,onSave:z},e.artifactId)})]})};export{X as StoryCard,ee as UserStoryCardWrapper,X as default,Z as replaceLearnedTagsWithInfo};
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as l}from"react/jsx-runtime";import{useState as n,useRef as o,useEffect as i}from"react";import{ChevronUp as a,ChevronDown as s,Users as r,ExternalLink as d,Download as u,Share2 as c,Copy as v,LoaderCircle as p,PencilIcon as m,Plus as y,Trash2 as h,X as S,Ellipsis as g,Hourglass as C,Check as f,ChevronUpIcon as I,ChevronDownIcon as b,Info as N,Bookmark as w}from"lucide-react";import E from"showdown";import{Tooltip as D,Menu as B,MenuItem as A}from"@mui/material";import T from"../../icons/Illustration.svg.js";import{v4 as U}from"uuid";import x from"./UserStoryCard.module.css.js";import{formatMarkdown as k,indentMarkdown as P}from"../../utils/helpers.js";import{replaceTitleSection as R,postprocessUserStoryAfterEdit as _}from"../../utils/user-story.utils.js";import M from"../../shared/AtomicButton.js";import L from"../RichTextEditor/RichTextEditor.js";import $ from"../userstory-with-citation/UserStoryWithCitation.js";import{SectionStatus as O,useRequirementAI as z}from"../RequirementAIWrapper/RequirementAIWrapper.js";import{BigEnoughPanel as V}from"../story-screen/BigEnoughPanel.js";import{InlineTitleEditor as j}from"./TitleEditor/TitleEditor.js";import{updateRedlineDocument as G,getRedlineDocumentId as W,createRedlineDocument as H}from"../../../../service/redlineService.js";import F from"./ClinicalTrialSection.js";import{CompletionPanel as q}from"../story-screen/CompletionPanel.js";import Q from"../../icons/CDIcon.js";const Y={[O.WAITING]:"WAITING TO GENERATE",[O.IN_PROGRESS]:"IN PROGRESS",[O.GENERATED]:"GENERATED",[O.FAILED]:"FAILED",[O.GENERATE]:"GENERATE",[O.APPROVED]:"APPROVED"};function Z(e){const l=[],n=/<learned>(.*?)<\/learned>/g;let o,i=0,a=0;for(;null!==(o=n.exec(e));){const[,s]=o,r=o.index;r>i&&l.push(t("span",{children:e.slice(i,r)},"text-pre-"+a++)),l.push(t(D,{title:s,placement:"top",children:t(N,{size:16,className:"inline-block mx-1 text-blue-500 hover:text-blue-700 cursor"})},`tooltip-${U()}`)),i=n.lastIndex}return i<(null==e?void 0:e.length)&&l.push(t("span",{children:e.slice(i)},"text-post-"+a++)),l}function J(e,t,l){var n;if(!e)return{};if(t)return{...e.parentConfig};const o={...e.childConfig};return l&&(null===(n=e.subFeatureOverrides)||void 0===n?void 0:n[l])?{...o,...e.subFeatureOverrides[l]}:o}const K=({displayName:l})=>{var n;const{customStyles:o}=z(),i=null===(n=null==o?void 0:o.userStoryCardStyles)||void 0===n?void 0:n.showDisplayName;return e("div",{className:x.displayName,style:null==i?void 0:i.wrapper,children:[t(w,{className:x.displayNameIcon,style:null==i?void 0:i.displayNameIcon}),e("span",{style:null==i?void 0:i.label,children:[l,":"]})]})},X=({isUserStoryCurrentlyUpdated:I,artifactId:b,artifactTitleId:N,parentUserStory:w,currentUserStory:W,onUserStoryChange:H,parentIndex:ee,currentIndex:te,enableDownload:le,isDiffEditReviewMode:ne,showUserStoryDiff:oe,handleDownloadUserStory:ie,handleOpenSendDialog:ae,updateUserStoryArtifact:se,selectedArtifactId:re,isDisplayHighlightControl:de,elementDisplayConfig:ue,_resolvedConfig:ce,showWrapper:ve=!1,defaultExpanded:pe,actionItemsConfig:me,onDelete:ye,contextVariant:he,expandedSubFeatures:Se,showDisplayName:ge=!0,allowTitleEdit:Ce=!0,showConfidenceScore:fe=!0,showBorderTop:Ie=!0,sectionStatusConfig:be,showCompletionPanel:Ne=!1,completionPanelConfig:we,showAddSectionButton:Ee=!1,disableEditPlan:De=!1,useMuiTooltip:Be=!1,approveButtonConfig:Ae,editButtonConfig:Te,CDNeededInChip:Ue,blockNumber:xe,storyNumber:ke,showAssignSection:Pe=!1,disableAssignSection:Re=!1,onAssignSectionClick:_e,onSave:Me,onUserStoryAccordionStateChange:Le})=>{var $e,Oe,ze,Ve,je,Ge,We,He,Fe,qe,Qe,Ye,Ze,Je,Ke,Xe,et,tt,lt,nt,ot,it,at,st;const{isLoadingSectionData:rt=!1,onLoadSectionData:dt,status:ut,onStatusClick:ct,completedCount:vt,totalCount:pt,isNoDataAvailable:mt=!1}=null!=be?be:{},{searchQueryList:yt,citations:ht,customStyles:St,onEditBlocked:gt,redlineDcoumentId:Ct,redlineConfig:ft,customSectionConfig:It,updateRedlineDataParent:bt,aiReasoning:Nt}=z(),wt=null==St?void 0:St.userStoryCardStyles,Et=null==wt?void 0:wt.customSectionEditButton,Dt=null==wt?void 0:wt.statusStyles,Bt=null===($e=null==St?void 0:St.userStoryCardStyles)||void 0===$e?void 0:$e.userStoryEditStyles,At=null===(Oe=null==St?void 0:St.userStoryScreenStyles)||void 0===Oe?void 0:Oe.userStoryContentStyles,Tt=null==wt?void 0:wt.progressHeaderStyles,Ut=null==wt?void 0:wt.clinicalTrialSectionStyles,xt=null==wt?void 0:wt.CompletionStyles,kt=null==wt?void 0:wt.noDataStyles,Pt=null==wt?void 0:wt.approveButtonStyles,Rt=null!==(Ve=null===(ze=null==It?void 0:It.shouldRender)||void 0===ze?void 0:ze.call(It,W))&&void 0!==Ve&&Ve,_t=null===(je=null==It?void 0:It.getValue)||void 0===je?void 0:je.call(It,W),Mt=null!==(We=null===(Ge=null==It?void 0:It.getFields)||void 0===Ge?void 0:Ge.call(It,W))&&void 0!==We?We:[],Lt=null!==(He=null==It?void 0:It.isEditDisabled)&&void 0!==He&&He,$t=null!==(qe=null===(Fe=null==It?void 0:It.isSaving)||void 0===Fe?void 0:Fe.call(It,W))&&void 0!==qe&&qe,Ot=((e,t)=>e>=80?null==t?void 0:t.highCompletion:e>=50?null==t?void 0:t.mediumCompletion:null==t?void 0:t.lowCompletion)(null!==(Qe=W.completion_percentage)&&void 0!==Qe?Qe:0,xt),zt={[O.WAITING]:null==Dt?void 0:Dt.waiting,[O.IN_PROGRESS]:null==Dt?void 0:Dt.inProgress,[O.GENERATED]:null==Dt?void 0:Dt.generated,[O.FAILED]:null==Dt?void 0:Dt.failed,[O.GENERATE]:null==Dt?void 0:Dt.generate,[O.APPROVED]:null==Dt?void 0:Dt.approved},[Vt,jt]=n({...structuredClone(W),value:k(W.value)||""}),[Gt,Wt]=n({userStory:!!W.isDefaultEdit}),[Ht,Ft]=n(!1),[qt,Qt]=n(!1),[Yt,Zt]=n(null),[Jt,Kt]=n(null),{userStory:Xt,customIcons:el}=z(),[tl,ll]=n(null!=pe?pe:""===ee||re===W.artifactId||!!W.isDefaultOpen),[nl,ol]=n(!1),[il,al]=n(null),[sl,rl]=n(null),[dl,ul]=n(!1),cl=o(null),vl=o(null),[pl,ml]=n(!1),[yl,hl]=n(!1),Sl=o(null),[gl,Cl]=n(!1),[fl,Il]=n(W.value);i(()=>{I&&ll(I)},[I]),i(()=>{jt({...structuredClone(W),value:k(W.value)||""})},[W]),i(()=>{yt.length>0?ll(!0):void 0===pe&&re&&ll(re===W.artifactId)},[yt,re,W.artifactId]),i(()=>{Se&&Se.length>0&&ke&&xe&&ll(Se.includes(`${ke}-${xe}`)||""===ee||re===W.artifactId||!!W.isDefaultOpen)},[Se,ke,xe]);const bl=()=>{al(null)},Nl=()=>{rl(null)},wl=()=>{if(tl&&Gt.userStory&&vl.current&&!vl.current.requestClose())return;const e=!tl;ll(e),null==Le||Le(W,e)},El=async()=>{var e,t;try{"userStory"==="userStory"&&(H(Vt),console.log("I am changing RTE editor values",Vt)),await(null===(e=null==Te?void 0:Te.onSaveEditedSection)||void 0===e?void 0:e.call(Te,Vt)),await se(ht,Xt,b,null===(t=Sl.current)||void 0===t?void 0:t.signal)}finally{}};const Dl=null!=(null==W?void 0:W.big_enough)&&!Number.isNaN(W.big_enough)&&!!(null==W?void 0:W.big_enough_decision_factors),Bl=null!==(Ye=null==W?void 0:W.completion_percentage)&&void 0!==Ye?Ye:0,Al=!!(null==W?void 0:W.completion_decision_factors),Tl=""===ee,Ul=null!=ce?ce:J(ue,Tl),xl=!ne&&!oe;i(()=>{if(!Jt)return;const e=setTimeout(()=>{const e=document.getElementById(`story-card-${Jt}`);null==e||e.scrollIntoView({behavior:"smooth",block:"start"})},100);return()=>clearTimeout(e)},[Jt]),i(()=>{W.isDefaultEdit&&Wt(e=>({...e,userStory:!0}))},[W.isDefaultEdit]),console.log("block number in userstory card ",xe),console.log("[TESTING-CURRENT-USER-STORY] \n",W,"\n[TESTING-USER-STORY] \n",Xt);return i(()=>Il(W.value),[W.value]),e("div",{className:x.card,"data-block-id":`user-story-card-wrapper-${ke}-${xe}`,style:null==wt?void 0:wt.cardStyle,id:`story-card-${W.title}`,"data-expanded":tl,children:[e("div",{className:x.titleSection,style:null==wt?void 0:wt.titleSection,children:[e("div",{className:x.titleRow,style:null==wt?void 0:wt.titleRow,onClick:wl,children:[e("div",{className:x.titleLeft,style:null==wt?void 0:wt.titleLeft,onMouseEnter:()=>ml(!0),onMouseLeave:()=>ml(!1),children:[ge&&t(K,{displayName:N}),Ht&&xl?t(j,{title:W.title,onSave:e=>(async(e,t)=>{var l;try{let n={...W};W.artifactId===t?n.title=e:n.sub_features=(null===(l=W.sub_features)||void 0===l?void 0:l.map(l=>l.artifactId===t?{...l,title:e}:l))||[],jt(n),H(n),Ft(!1)}catch(e){console.error("Failed to save title",e)}})(e,W.artifactId),onCancel:()=>{Ft(!1)},inputStyle:null==Bt?void 0:Bt.inlineTitleInput,confirmButtonStyle:null==Bt?void 0:Bt.inlineTitleConfirm,cancelButtonStyle:null==Bt?void 0:Bt.inlineTitleCancel},"inline-title-editor"):e("div",{className:x.storyTitleWrapper,children:[t(D,{title:Z(W.title),arrow:!0,children:t("h2",{title:Be?void 0:W.title,className:x.storyTitle,style:null==wt?void 0:wt.storyTitle,children:Z(W.title)},W.artifactId)}),Ne&&(Al?t(q,{customIcons:null==el?void 0:el.userStoryIcons,customStyles:null==wt?void 0:wt.aiReasoningCitaionStyles,currentUserStory:W,panelStyles:null==wt?void 0:wt.CompletionStyles,onToggleStateChange:hl,completionPanelConfig:we,children:e("div",{style:{display:"inline-flex",alignItems:"center",gap:"4px",...null==xt?void 0:xt.badge,...Ot},children:[e("span",{children:[Bl,"% Completed"]}),t("span",{style:{display:"flex",alignItems:"center"},children:t(Q,{color:"currentColor"})}),t(yl?a:s,{size:14,style:null==xt?void 0:xt.chevronStyle})]})}):t("div",{style:{display:"inline-flex",alignItems:"center",gap:"4px",...null==xt?void 0:xt.badge,...Ot},children:e("span",{children:[Bl,"% Completed"]})})),Ce&&t("button",{type:"button",className:x.titleEditButton,style:null==Bt?void 0:Bt.titleEditButton,onClick:e=>{e.stopPropagation(),Ft(!0),tl||ll(!0)},"aria-label":"Edit title",title:"Edit title",children:t("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M8.99998 14.9992H15.75M2.25 14.9992H3.50591C3.87279 14.9992 4.05624 14.9992 4.22887 14.9577C4.38192 14.921 4.52824 14.8604 4.66245 14.7782C4.81382 14.6854 4.94354 14.5557 5.20296 14.2962L14.625 4.87419C15.2463 4.25287 15.2463 3.24551 14.625 2.62419C14.0037 2.00287 12.9963 2.00287 12.375 2.62419L2.95295 12.0462C2.69352 12.3057 2.5638 12.4354 2.47104 12.5868C2.3888 12.721 2.32819 12.8673 2.29145 13.0203C2.25 13.193 2.25 13.3764 2.25 13.7433V14.9992Z",stroke:"#94A3B8","stroke-width":"1.54286","stroke-linecap":"round","stroke-linejoin":"round"})})})]})]}),(ut||void 0!==vt&&void 0!==pt)&&e("div",{className:x.statusContainer,children:[void 0!==vt&&void 0!==pt&&e("div",{className:x.completedBadge,children:["Completed: ",vt,"/",pt]}),ut&&t("button",{type:"button",onClick:e=>{e.stopPropagation(),null==ct||ct()},onMouseEnter:()=>Cl(!0),onMouseLeave:()=>Cl(!1),className:x.statusButton,style:{...null===(Ze=zt[ut])||void 0===Ze?void 0:Ze.default,...gl&&(null===(Je=zt[ut])||void 0===Je?void 0:Je.hover)},children:Y[ut]})]}),e("div",{className:x.titleActions,style:null==wt?void 0:wt.titleActions,onClick:e=>e.stopPropagation(),children:[(Ul.showProgressPercentage||Ul.showGapBox)&&ve&&e("div",{className:x.progressHeader,style:null==Tt?void 0:Tt.wrapper,children:[Ul.showProgressPercentage&&e("div",{className:x.progressPercentage,style:null==Tt?void 0:Tt.percentage,children:[null!==(Xe=null!==(Ke=null==W?void 0:W.confidenceScore)&&void 0!==Ke?Ke:null==Ul?void 0:Ul.confidenceValue)&&void 0!==Xe?Xe:"0","%"]}),Ul.showGapBox&&e("div",{className:x.gapBox,style:null==Tt?void 0:Tt.gapBox,children:[null!==(tt=null!==(et=null==W?void 0:W.gapValue)&&void 0!==et?et:null==Ul?void 0:Ul.gapBoxValue)&&void 0!==tt?tt:"2"," ","Gaps"]})]}),Dl&&t(V,{customIcons:null==el?void 0:el.userStoryIcons,customStyles:null==wt?void 0:wt.aiReasoningCitaionStyles,currentUserStory:W,panelStyles:null==wt?void 0:wt.BigEnoughStyles}),Pe&&t("button",{type:"button",className:x.iconButton,style:null==wt?void 0:wt.iconButton,disabled:Re,onClick:e=>{e.stopPropagation(),null==_e||_e(W)},"aria-label":"Assign section users",title:"Assign section users",children:t(r,{size:16})}),!Gt.userStory&&e(l,{children:[!1!==(null==Ul?void 0:Ul.showShareButton)&&t("button",{className:x.iconButton,style:null==wt?void 0:wt.iconButton,onClick:e=>{al(e.currentTarget)},children:t(d,{size:16})}),e(B,{id:"user-story-share-menu",anchorEl:il,open:!!il,onClose:()=>al(null),style:null==wt?void 0:wt.userStoryShareMenu,children:[le&&t(A,{style:null==wt?void 0:wt.userStoryMenuItem,onClick:async()=>{ol(!0),ie&&(await Promise.all([ie("pdf"),ie("doc")]),ol(!1))},children:e("div",{ref:cl,className:x.menuItemContent,style:null==wt?void 0:wt.menuItemContent,children:[t(u,{size:16,color:null==wt?void 0:wt.menuIconColor}),t("p",{style:null==wt?void 0:wt.menuLabel,children:"Download"})]})}),t(A,{style:null==wt?void 0:wt.userStoryMenuItem,onClick:async()=>{let e=W;w&&(e={...W,value:`${R(null==w?void 0:w.value,W.title)} \n${W.value}`}),null==ae||ae(!0,[e],W.artifactId),bl()},children:e("div",{style:null==wt?void 0:wt.menuItemContent,className:x.menuItemContentPadded,children:[t(c,{size:16,color:null==wt?void 0:wt.menuIconColor}),t("p",{style:null==wt?void 0:wt.menuLabel,children:"Send"})]})}),t(A,{style:null==wt?void 0:wt.userStoryMenuItem,onClick:async()=>{const e=(new E.Converter).makeHtml(k(W.value)||W.value),t=function(e){const t=(new E.Converter).makeHtml(e),l=document.createElement("div");return l.innerHTML=t,l.textContent||l.innerText||""}(k(W.value)||W.value),l=new ClipboardItem({"text/plain":new Blob([t],{type:"text/plain"}),"text/html":new Blob([e],{type:"text/html"})});try{await navigator.clipboard.write([l]),console.log("Copied User Story")}catch(e){console.error("Failed to copy user story:",e)}finally{bl()}},children:e("div",{style:null==wt?void 0:wt.menuItemContent,className:x.menuItemContentPadded,children:[t(v,{size:16,color:null==wt?void 0:wt.menuIconColor}),t("p",{style:null==wt?void 0:wt.menuLabel,children:"Copy"})]})})]})]}),!dl&&Gt.userStory&&tl?t(M,{type:"outline",children:"Cancel",style:null==wt?void 0:wt.cancelButton,onClick:()=>{var e;null===(e=Sl.current)||void 0===e||e.abort(),Wt(e=>({...e,userStory:!1}))}}):t(l,{}),Gt.userStory&&tl?t(M,{type:"fill",children:dl?e("span",{className:x.savingSpinner,style:null==wt?void 0:wt.savingSpinner,children:[t(p,{className:x.spinAnimation,style:null==wt?void 0:wt.spinAnimation}),t("span",{children:"Saving..."})]}):"Save",isDisable:dl,style:dl?null==wt?void 0:wt.savingButton:null==wt?void 0:wt.saveButton,onClick:async()=>{ul(!0),await El();let e=await(async()=>{var e,t,l,n,o;let i=Vt.value;console.log("[V] valueToUpdate before",i),i=i.replace(/<invisible\s+id="([^"]+)"\s*><\/invisible>/gi,"\x3c!-- $1 --\x3e"),console.log("[V] valueToUpdate after",i);try{await(null==Me?void 0:Me(i,W.artifactId))}catch(e){}try{if(null==ft?void 0:ft.callUpdateDocument){const{updated_reqai:a}=await G({documentId:Ct,sectionId:W.artifactId,baseApiUrl:null==ft?void 0:ft.baseApiUrl,updatedContent:i,userEmail:ft.userEmail,userName:ft.userName,redlineConfigId:null!==(e=ft.redlineConfigId)&&void 0!==e?e:""},null!==(t=null==ft?void 0:ft.token)&&void 0!==t?t:"");i=null===(o=null===(n=null===(l=null==a?void 0:a.artifactData)||void 0===l?void 0:l.userStorySnapshot)||void 0===n?void 0:n[0])||void 0===o?void 0:o.value,await(null==bt?void 0:bt(a))}}catch(e){console.error("failed to update redline document",e),i=fl}return i=i.replace(/<!--\s*([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\s*-->/gi,'<invisible id="$1"></invisible>'),i})();const t={...Vt,value:e};H({...t,isDefaultEdit:!1}),Il(t.value),Wt(e=>({...e,userStory:!1})),ul(!1)}}):!ne&&!oe&&!De&&tl&&!1!==(null==Ul?void 0:Ul.showEditButton)&&t("button",{className:x.iconButton,style:null==wt?void 0:wt.editButton,onClick:()=>Wt(e=>({...e,userStory:!0})),children:t(m,{color:null==wt?void 0:wt.pencilIconColor,size:16})}),Ee&&Tl&&tl&&!ne&&!oe&&!1!==(null==Ul?void 0:Ul.showEditButton)&&e("button",{type:"button",className:x.addSectionButton,style:null==Bt?void 0:Bt.addSectionButton,onClick:e=>{var t,l,n;e.stopPropagation();const o=(null!==(l=null===(t=W.sub_features)||void 0===t?void 0:t.length)&&void 0!==l?l:0)+1,i={artifactId:U(),title:`New Section ${o}`,value:"Please add details for this section.",section:"subfeature",isDefaultOpen:!0},a={...W,sub_features:[...null!==(n=W.sub_features)&&void 0!==n?n:[],i]};jt(a),H(a),ll(!0),Kt(i.title)},"aria-label":"Add section",title:"Add section",children:[t(y,{size:14}),t("span",{className:x.addSectionLabel,children:"Add Section"})]}),!Tl&&!ne&&!De&&!oe&&t("button",{type:"button",onClick:e=>{e.stopPropagation(),null==ye||ye()},className:x.iconButton,style:null==Bt?void 0:Bt.deleteButton,"aria-label":"Delete section",title:"Delete section",children:t(h,{size:16})}),Rt&&t("button",{type:"button",className:x.iconButton,style:null==Et?void 0:Et.button,disabled:Lt,onClick:e=>{if(e.stopPropagation(),qt)return Zt(null),void Qt(!1);Zt(structuredClone(null!=_t?_t:{})),ll(!0),Qt(!0)},children:qt?t(S,{size:16,color:null==wt?void 0:wt.pencilIconColor,style:null==Et?void 0:Et.cancelIcon}):t(m,{size:16,color:null==wt?void 0:wt.pencilIconColor,style:null==Et?void 0:Et.editIcon})}),(null==Ul?void 0:Ul.actionItemsButton)&&e(l,{children:[t("span",{className:x.actionItemBtn,style:null==wt?void 0:wt.actionItemBtn,onClick:e=>{e.stopPropagation(),rl(e.currentTarget)},children:t(g,{})}),t(B,{id:"user-story-action-menu",anchorEl:sl,open:!!sl,onClose:Nl,style:null==wt?void 0:wt.userStoryShareMenu,children:null==me?void 0:me.items.map((l,n)=>t(A,{style:null==wt?void 0:wt.userStoryMenuItem,onClick:()=>{l.onclick(W),Nl()},children:e("div",{className:x.menuItemContent,style:{...null==wt?void 0:wt.menuItemContent,...!l.isActive&&{cursor:"not-allowed",opacity:.5}},children:[t("span",{className:x.menuItemIcon,style:null==wt?void 0:wt.menuItemIcon,children:l.icon}),t("p",{style:null==wt?void 0:wt.menuLabel,children:l.name}),t("span",{className:x.menuItemRight,style:null==wt?void 0:wt.menuItemRight})]})},`action-item-${n}-${l.name}`))})]}),t("button",{type:"button",onClick:e=>{e.stopPropagation(),wl()},style:null==wt?void 0:wt.chevronButton,className:x.chevronButton,children:t(tl?a:s,{className:x.chevronIcon,color:null==wt?void 0:wt.chevronIconColor})})]})]}),t("div",{className:x.divider,style:null==wt?void 0:wt.dividerStyle})]}),tl&&t("div",{className:x.cardContent,style:{...null==wt?void 0:wt.cardContentStyle,borderTop:Ie?"1px solid #E5E5E5":"none"},children:e("div",rt?{className:x.loadingContainer,children:[t("div",{className:x.loadingIconWrapper,children:t(C,{size:28,color:"#5B3DF5",className:x.spinAnimation})}),e("div",{children:[t("h3",{className:x.loadingTitle,children:"Section generation in progress.."}),t("p",{className:x.loadingSubtitle,children:"This may take a few minutes"})]}),t("button",{type:"button",onClick:()=>null==dt?void 0:dt(),className:x.viewStatusButton,children:"View Status"})]}:mt?{className:x.noDataContainer,style:null==kt?void 0:kt.container,children:[t("img",{src:T,alt:"No data available",className:x.noDataIllustration,style:null==kt?void 0:kt.illustration}),t("h3",{className:x.noDataTitle,style:null==kt?void 0:kt.title,children:"No Data Available for This Section"}),t("p",{className:x.noDataSubtitle,style:null==kt?void 0:kt.subtitle,children:"We couldn't find data for this section yet. Upload the required document from the Documents tab to generate content."})]}:{className:x.contentInner,style:null==wt?void 0:wt.contentInner,children:[e("div",{className:x.descriptionSection,style:null==wt?void 0:wt.descriptionSection,children:[t("div",{className:x.justifyBetween,style:null==wt?void 0:wt.justifyBetween}),Gt.userStory?t(L,{ref:vl,minHeight:"100%",height:"100%",type:"string",value:k(fl)||"",handleUpdateState:(e,t)=>{const l=_(P(t));jt(e=>({...e,value:l||""}))},doNotShowBorderInViewMode:!1,onBlur:()=>{},mode:Gt.userStory?"edit":"readOnly",onEditBlocked:gt,onSaveUnsavedChanges:async()=>{await El(),ll(!1)},onDiscardUnsavedChanges:()=>{jt({...structuredClone(W),value:k(W.value)||""}),Wt(e=>({...e,userStory:!1})),ll(!1)},isSavingUnsavedChanges:dl}):Rt?t(F,{styles:Ut,fields:Mt,readonly:!qt,isSaving:$t,value:null!==(lt=null!=Yt?Yt:_t)&&void 0!==lt?lt:{},onChange:Zt,onSave:async()=>{var e;Yt&&(await(null===(e=null==It?void 0:It.onSave)||void 0===e?void 0:e.call(It,W,Yt)),Zt(null),Qt(!1))},onCancel:()=>{Zt(null),Qt(!1)}}):e(l,{children:[t($,{showUserStoryDiff:oe,isParent:""===ee,message:k(W.value)||"",artifactId:W.artifactId,customStyles:At,isDisplayHighlightControl:de,contextVariant:he,showConfidenceScore:fe,CDNeededInChip:Ue,blockId:xe,storyId:ke}),(Ae||Te)&&e("div",{className:x.actionButtonsContainer,style:null==Pt?void 0:Pt.container,children:[Te&&!Gt.userStory&&e(l,{children:[t("button",{type:"button",className:x.actionButton,style:null==Pt?void 0:Pt.button,disabled:Te.disabled||Te.isLoading,onClick:e=>{var t;e.stopPropagation(),null===(t=Te.onClick)||void 0===t||t.call(Te),Wt(e=>({...e,userStory:!0})),ll(!0)},children:Te.isLoading?e(l,{children:[t(p,{size:16,className:x.actionButtonSpinner,style:null==Pt?void 0:Pt.icon}),t("span",{style:null==Pt?void 0:Pt.text,children:null!==(nt=Te.label)&&void 0!==nt?nt:"Edit"})]}):e(l,{children:[t(m,{size:16,style:null==Pt?void 0:Pt.icon}),t("span",{style:null==Pt?void 0:Pt.text,children:null!==(ot=Te.label)&&void 0!==ot?ot:"Edit"})]})}),Ae&&t("span",{className:x.actionButtonDivider})]}),Ae&&t("button",{type:"button",className:x.actionButton,style:null==Pt?void 0:Pt.button,disabled:Ae.disabled||Ae.isLoading,onClick:e=>{var t;e.stopPropagation(),null===(t=Ae.onClick)||void 0===t||t.call(Ae)},children:Ae.isLoading?e(l,{children:[t(p,{size:16,className:x.actionButtonSpinner,style:null==Pt?void 0:Pt.icon}),t("span",{style:null==Pt?void 0:Pt.text,children:null!==(it=Ae.label)&&void 0!==it?it:"Approve"})]}):e(l,{children:[t(f,{size:16,style:null==Pt?void 0:Pt.icon}),t("span",{style:null==Pt?void 0:Pt.text,children:null!==(at=Ae.label)&&void 0!==at?at:"Approve"})]})})]})]})]}),null===(st=Vt.sub_features)||void 0===st?void 0:st.map((e,l)=>{console.log("UserStoryCardWrapper: sub",e);const n=J(ue,!1,e.artifactId);return t(X,{artifactId:b,isUserStoryCurrentlyUpdated:I,artifactTitleId:`${N}-${String.fromCharCode(65+l)}`,parentUserStory:W,parentIndex:`${ee}${ee&&"."}${te}`,currentIndex:`${l+1}`,doNotShowBorderInViewMode:!1,currentUserStory:e,onUserStoryChange:e=>((e,t)=>{const l=[...W.sub_features||[]];l[e]=t,H({...W,sub_features:l})})(l,e),enableDownload:!0,isDiffEditReviewMode:ne,showUserStoryDiff:oe,updateUserStoryArtifact:se,handleDownloadUserStory:ie,handleOpenSendDialog:ae,isDisplayHighlightControl:de,elementDisplayConfig:ue,_resolvedConfig:n,actionItemsConfig:me,onDelete:()=>(e=>{const t=(W.sub_features||[]).filter((t,l)=>l!==e),l={...W,sub_features:t};jt(l),H(l)})(l),expandedSubFeatures:Se,disableEditPlan:De,useMuiTooltip:Be,storyNumber:e.storyNumber,blockNumber:e.blockNumber,onUserStoryAccordionStateChange:Le,showAssignSection:Pe,onAssignSectionClick:_e,onSave:Me},e.artifactId)})]})})]})},ee=({artifactTitleIDs:n,expandedSubFeatures:o,isDiffEditReviewMode:a,showUserStoryDiff:s,updateUserStoryArtifact:r,isUserStoryCurrentlyUpdated:d,artifactId:u,handleOpenSendDialog:c,handleDownloadUserStory:v,selectedArtifactId:p,isDisplayHighlightControl:m,elementDisplayConfig:y,showWrapper:h,actionItemsConfig:S,contextVariant:g,showDisplayName:C,allowTitleEdit:f,showConfidenceScore:N,showBorderTop:w,defaultExpanded:E,showCompletionPanel:D=!1,completionPanelConfig:B,showAddSectionButton:A=!1,disableEditPlan:T=!1,useMuiTooltip:U=!1,approveButtonConfig:k,editButtonConfig:P,CDNeededInChip:R,setRedlineDocumentIdParent:_,showAssignSection:M,onAssignSectionClick:L,disableAssignSection:$,onSave:O,onUserStoryAccordionStateChange:V})=>{const{userStory:j,setUserStory:G,customStyles:F,searchQueryList:q,currentHighlightIndex:Q,setCurrentHighlightIndex:Y,segmentComponentConfig:Z,sectionStatusConfig:K,redlineConfig:ee,setRedlineDocumentId:te}=z(),le=null==F?void 0:F.userStoryCardStyles,ne=0===Q,oe=Q===q.length-1;return i(()=>{if(!(null==ee?void 0:ee.callCreateDocumentOnInit))return;(async()=>{var e;const{redline_document_id:t}=await W({baseApiUrl:ee.documentBaseApiUrl||"",comparisonId:ee.documentComparisonId||""});if(t)te(t);else{const{document_id:t}=await H({baseApiUrl:ee.baseApiUrl,changelogConfigId:ee.changelogConfigId,comparisonId:ee.documentComparisonId,artifactId:ee.artifactId,inputData:ee.inputData,redlineConfigId:ee.redlineConfigId,userEmail:ee.userEmail,userName:ee.userName},null!==(e=null==ee?void 0:ee.token)&&void 0!==e?e:"");t&&(te(t),null==_||_(t))}})()},[]),e("div",{className:x.userStoryCardWrapper,style:m?{...null==le?void 0:le.userStoryCardWrapper,position:"relative"}:null==le?void 0:le.userStoryCardWrapper,children:[m&&t(l,{children:q.length>0&&t("div",{className:x.wrapper,children:t("div",{className:x.highlightNavigation,children:e("div",{className:x.navigationContainer,children:[e("span",{className:x.navCounter,children:[Q+1," of ",q.length]}),e("div",{className:x.navButtons,children:[t("button",{onClick:()=>{Q>0&&Y(e=>e-1)},className:x.navButton,disabled:ne,children:t(I,{size:20,className:x.navIcon})}),t("button",{onClick:()=>{Q<q.length-1&&Y(e=>e+1)},className:x.navButton,disabled:oe,children:t(b,{size:20,className:x.navIcon})})]})]})})})}),j.map((e,l)=>{console.log("UserStoryCardWrapper: userstory",e);const i=J(y,!0);return t(X,{isUserStoryCurrentlyUpdated:d,artifactId:u,artifactTitleId:n[l]||"",expandedSubFeatures:o,currentUserStory:e,onUserStoryChange:e=>{G(t=>(t[l]=e,[...t]))},parentIndex:"",currentIndex:`${l+1}`,doNotShowBorderInViewMode:!0,enableDownload:!0,isDiffEditReviewMode:a,showUserStoryDiff:s,updateUserStoryArtifact:r,handleOpenSendDialog:c,handleDownloadUserStory:v,selectedArtifactId:p,isDisplayHighlightControl:m,elementDisplayConfig:y,_resolvedConfig:i,showWrapper:h,defaultExpanded:E,actionItemsConfig:S,contextVariant:g,showDisplayName:C,allowTitleEdit:f,showConfidenceScore:N,showBorderTop:w,sectionStatusConfig:K,showCompletionPanel:D,completionPanelConfig:B,showAddSectionButton:A,disableEditPlan:T,useMuiTooltip:U,approveButtonConfig:k,CDNeededInChip:R,editButtonConfig:P,storyNumber:e.storyNumber,blockNumber:e.blockNumber,onUserStoryAccordionStateChange:V,showAssignSection:M,disableAssignSection:$,onAssignSectionClick:L,onSave:O},e.artifactId)})]})};export{X as StoryCard,ee as UserStoryCardWrapper,X as default,Z as replaceLearnedTagsWithInfo};
|
|
2
2
|
//# sourceMappingURL=UserStoryCard.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e,jsxs as i,Fragment as o}from"react/jsx-runtime";import{useState as l}from"react";import{ChevronUp as n,ChevronDown as r,Check as t,SquareArrowOutUpRight as a,Loader2 as s}from"lucide-react";import d from"./CustomChatCrRedirection.module.css.js";import c from"../ai-reasoning/AiReasoningCitationContent.js";import u from"../../icons/CognitiveDecision.js";import{Tooltip as p}from"@mui/material";function m({isDefaultOpen:m,processItemId:v,isCompleted:g,mode:h,msg:y,type:f,id:C,aiReason:x,text:
|
|
1
|
+
import{jsx as e,jsxs as i,Fragment as o}from"react/jsx-runtime";import{useState as l}from"react";import{ChevronUp as n,ChevronDown as r,Check as t,SquareArrowOutUpRight as a,Loader2 as s}from"lucide-react";import d from"./CustomChatCrRedirection.module.css.js";import c from"../ai-reasoning/AiReasoningCitationContent.js";import u from"../../icons/CognitiveDecision.js";import{Tooltip as p}from"@mui/material";function m({isDefaultOpen:m,processItemId:v,isCompleted:g,mode:h,msg:y,type:f,id:C,aiReason:x,text:D,headerText:b,decisionStrength:N,statusUi:T,panelRef:I,onHandleSend:S,onRedirectClick:k,gapType:R,isGenerating:j=!1,customStyles:B,customIcons:W,cognitiveDecisionHeaders:P,metaData:H}){const[$,A]=l(m),O=(null==W?void 0:W.highConfidence)||e(u,{}),z=()=>{"cra"===h?null==S||S(`Discuss ambiguities on ${D}`,C,H):null==S||S(`Deep Dive into ${R} ${b}: ${D}`,C,H)};return i("div",{className:[d.outerWrapper,j?d.outerWrapperDisabled:""].join(" "),style:{...null==B?void 0:B.redirectionOuterWrapper,...j?null==B?void 0:B.redirectionOuterWrapperDisabled:{}},children:[i("div",{className:[d.card,j?d.cardDisabled:d.cardInteractive].join(" "),style:{...null==B?void 0:B.redirectionCard,...j?null==B?void 0:B.redirectionCardDisabled:null==B?void 0:B.redirectionCardInteractive},children:[i("div",{className:d.leftSide,style:null==B?void 0:B.redirectionLeftSide,children:[e(p,{title:b+" "+D,placement:"top",slotProps:{tooltip:{sx:{...null==B?void 0:B.headerTooltip}}},children:i("span",{className:d.textBlock,style:null==B?void 0:B.redirectionTextBlock,children:[b&&i("span",{className:d.headerText,style:null==B?void 0:B.redirectionHeaderText,children:[b,D?" ":""]}),D]})}),i("span",{onClick:e=>{e.stopPropagation(),j||A(!$)},className:[d.reasoningToggle,j?d.reasoningToggleDisabled:d.reasoningToggleActive].join(" "),style:{...null==B?void 0:B.reasoningToggle,...j?null==B?void 0:B.reasoningToggleDisabled:null==B?void 0:B.reasoningToggleActive},children:[O,e($?n:r,{className:d.chevronIcon,style:null==B?void 0:B.chevronIcon})]})]}),g?e("div",{className:d.completeTickWrapper,style:null==B?void 0:B.completeTickWrapper,children:e(t,{color:(null==B?void 0:B.checkColor)||"green"})}):i(o,{children:["risk-gap"===h&&i("div",{className:d.rightSide,style:null==B?void 0:B.redirectionRightSide,children:[e("button",{disabled:j,className:[d.fixButton,j?d.fixButtonDisabled:""].join(" "),style:{...null==B?void 0:B.redirectionFixButton,...j?null==B?void 0:B.fixButtonDisabled:{}},onClick:e=>{e.stopPropagation(),j||z()},children:"Fix"}),e(a,{onClick:j?void 0:()=>{j||null==k||k({type:f,id:C,aiReason:x,msg:y,meta:{headerText:b,decisionStrength:N,text:D}})},size:18,className:[j?d.redirectIconDisabled:d.redirectIcon].join(" "),style:{...j?null==B?void 0:B.redirectIconDisabled:null==B?void 0:B.redirectIcon}})]}),"cra"===h&&!m&&e("div",{className:d.rightSide,style:null==B?void 0:B.redirectionRightSide,children:v===C?e("div",{className:d.loaderWrapper,style:null==B?void 0:B.loaderWrapper,children:e(s,{size:16,className:d.loaderIcon,color:"grey",style:{animation:"spin 1s linear infinite",...null==B?void 0:B.loaderIcon}})}):e("button",{className:[d.clarifyButton].join(" "),style:{color:j?"grey":"",...null==B?void 0:B.redirectionClarifyButton},disabled:j,onClick:e=>{e.stopPropagation(),z()},children:"Clarify"})})]})]}),$&&e(c,{label:"cra"===h?"Clarify":"Select this option",aiReason:{id:"1",reason:(null==x?void 0:x.Reasoning)||"",gap:(null==x?void 0:x.Gap)||"",relevance_score:Number(null==x?void 0:x.Confidence_score),explanation:(null==x?void 0:x.explanation)||""},onSelectProceed:z,customStyles:null==B?void 0:B.aiReasoningStyles,customIcons:W,cognitiveDecisionHeaders:P})]})}export{m as CustomChatCrRedirection};
|
|
2
2
|
//# sourceMappingURL=CustomChatCrRedirection.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useState as o,useMemo as r,useEffect as i,Children as n,isValidElement as a}from"react";import{capitalize as l}from"lodash";import{GapFilterContentWrapper as
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useState as o,useMemo as r,useEffect as i,Children as n,isValidElement as a}from"react";import{capitalize as l}from"lodash";import{GapFilterContentWrapper as c}from"./GapFilterContentWrapper.js";import{GapFilterItem as d}from"./GapFilterItem.js";import{CustomChatCrRedirection as s}from"./CustomChatCrRedirection.js";import{SirenIcon as g,WarningIcon as u,SupportIcon as p}from"./gapFilterSvgs.js";import m from"./GapFilterBlock.module.css.js";import"react-markdown";import"rehype-raw";import"../RequirementAIWrapper/RequirementAIWrapper.js";const C=["critical","recommendation","warning"];function b(e){return(null==e?void 0:e.trim())?e.includes("%")?e:e.replace(/([0-9]+(?:\.[0-9]+)?)/g,"$1%"):""}function f(e){return n.toArray(e).filter(e=>a(e)).filter(e=>{var t;return"gapfilteritem"===e.type||"crredirection"===e.type||"function"==typeof e.type&&"crredirection"===e.type.name||(null===(t=e.key)||void 0===t?void 0:t.includes("crredirection"))}).map(e=>{var t,o;const{children:r,...i}=e.props,n={};Object.keys(i).forEach(e=>{e.startsWith("data-")||(n[e]=i[e])});const a=function(e){const t={};return Object.keys(e).forEach(o=>{o.startsWith("data-")&&(t[o.replace(/^data-/,"")]=e[o])}),t}(i),l=function(e){const t={};return Object.keys(e).forEach(o=>{o.startsWith("meta-")&&(t[o.replace(/^meta-/,"")]=e[o])}),t}(i),c=i["decision-strength"],d=i["data-is-completed"];return{text:r,headerText:i.headertext,tags:i.tags,dataAttrs:a,decisionStrength:c,attrs:n,type:"gapfilteritem"===e.type?"gapfilteritem":"crredirection",score:i.score,isCompleted:d,pendingCount:i.pendingcount,question:i.question,components:i.components,showFix:null!==(t=i.showfix)&&void 0!==t&&t,showRedirect:null!==(o=i.showredirect)&&void 0!==o&&o,metaDataAttrs:l}})}const y={critical:{labelColor:"text-gray-900",badgeBg:"bg-[#FEE4E2]",badgeText:"text-[#B42318]",iconColor:"text-[#D92D20]"},warning:{labelColor:"text-gray-900",badgeBg:"bg-[#FEF0C7]",badgeText:"text-[#B54708]",iconColor:"text-[#DC6803]"},recommendation:{labelColor:"text-gray-900",badgeBg:"bg-[#D1FADF]",badgeText:"text-[#027A48]",iconColor:"text-[#039855]"}},h=({isDefaultOpen:n,processItemId:a,mode:h,node:v,children:x,type:S,supportedmodes:k="","decision-strength":I="",pendingdata:R="",isGeneratingGap:A=!1,selectedGapItemId:F="",onItemSelect:B,onHandleSend:T,onModeAction:D,msg:w,panelRef:G,getAccordionState:N,setAccordionState:j,registerGapFilterBlockCount:E,getShowGapReviewButtonType:W,customStyles:O,customIcons:$,cognitiveDecisionHeaders:H,onRedirectClick:U})=>{const q=S,z=b(I),[L,M]=o(()=>{var e;const t=null!==(e=null==N?void 0:N(q))&&void 0!==e?e:"";return"true"!==n||t?t:q}),_=e=>{M(e),null==j||j(q,e)},J=f(x),K=r(()=>J.reduce((e,t)=>{var o,r,i;const n=null!==(o=t.tags)&&void 0!==o?o:"Uncategorized",a=null!==(i=null===(r=t.dataAttrs)||void 0===r?void 0:r.categoryid)&&void 0!==i?i:"1";let l=e.find(e=>e.categoryName===n);return l||(l={categoryName:n,categoryId:a,type:t.type,items:[]},e.push(l)),l.items.push(t),e},[]),[J]),P={critical:{labelColor:"#d92d20",badgeBackgroundColor:"#fee4e2",badgeTextColor:"#b42318",icon:e(g,{}),label:"risk-gap"===h?"Critical":"Must Clarify",decisionStrength:"< 70%"},warning:{labelColor:"#dc6803",badgeBackgroundColor:"#fef0c7",badgeTextColor:"#b54708",icon:e(u,{}),label:"risk-gap"===h?"Warning":"Should Clarify",decisionStrength:"70–90%"},recommendation:{labelColor:"#039855",badgeBackgroundColor:"#d1fadf",badgeTextColor:"#027a48",icon:e(p,{}),label:"risk-gap"===h?"Just a Suggestion":"Nice to Clarify",decisionStrength:"> 90%"},default:{labelColor:"#4b5563",badgeBackgroundColor:"#f3f4f6",badgeTextColor:"#4b5563",icon:e(p,{}),label:"",decisionStrength:""}},Q=r(()=>{return e=q,C.includes(e)?{labelColor:P[q].labelColor,badgeBackgroundColor:P[q].badgeBackgroundColor,badgeTextColor:P[q].badgeTextColor,label:P[q].label,decisionStrength:z||P[q].decisionStrength}:{labelColor:P.default.labelColor,badgeBackgroundColor:P.default.badgeBackgroundColor,badgeTextColor:P.default.badgeTextColor,label:l(q),decisionStrength:z||""};var e},[q,z]);i(()=>{null==E||E(q,J.length)},[q,J.length,E]);const V=(e,t,o={})=>{if(A)return;const r=`${K[e].categoryId}-${t}`;null==B||B(r);const i={...K[e].items[t].dataAttrs,...o};null==D||D(k,i)};return W&&W(),e(c,{mode:h,type:q,config:Q,count:J.length,handleReviewClick:()=>{J.length>0&&_(q)},openAccordion:L,onAccordionChange:e=>{_(L===e?"":e)},shouldShowReviewButton:!1,pendingData:R,customStyles:O,children:K.map((o,r)=>t("div",{className:m.categoryGroup,style:null==O?void 0:O.categoryGroup,children:["gapfilteritem"===o.type&&"Uncategorized"!==o.categoryName&&e("p",{className:m.categoryLabel,style:null==O?void 0:O.categoryLabel,children:o.categoryName}),o.items.map((t,i)=>{var n,l,c,g;const u=t.attrs||{},p=null===(n=t.dataAttrs)||void 0===n?void 0:n["cognitive-reasoning"],C=u.id||(null===(l=t.dataAttrs)||void 0===l?void 0:l.id)||"",b="I"===C[0]?"UI_REF":"CHAT_REF",f=null===(c=null==w?void 0:w.contextAwareAgentReasoning)||void 0===c?void 0:c[p],v=t.isCompleted,x="true"===u.isDefaultOpen||"true"===u.isdefaultopen;return"gapfilteritem"===t.type?e("div",{className:[m.gapFilterItemWrapper,"Uncategorized"!==o.categoryName?m.gapFilterItemWrapperIndented:""].join(" "),style:null==O?void 0:O.blockContainer,children:e(d,{isDefaultOpen:x,isCompleted:v,mode:h,index:i,isSelected:F===`${o.categoryId}-${i}`,onClick:()=>V(r,i),onFixClick:()=>V(r,i,{triggerFrom:"fix"}),onRedirect:()=>V(r,i,{triggerFrom:"redirect"}),item:t,isGenerating:A,aiReason:f,panelRef:null!=G?G:{current:null},id:p,customStyles:O,customIcons:$,cognitiveDecisionHeaders:H})},i):e("div",{className:m.crRedirectionGroup,style:null==O?void 0:O.crRedirectionGroup,children:e("div",{className:m.crRedirectionInner,style:null==O?void 0:O.crRedirectionInner,children:e(s,{isDefaultOpen:x,processItemId:a,isCompleted:v,mode:h,msg:w,type:b,text:t.text,headerText:t.headerText,decisionStrength:t.decisionStrength,id:C,gapType:q,onHandleSend:T,isGenerating:A,aiReason:f,onRedirectClick:U,statusUi:null!==(g=y[q])&&void 0!==g?g:y.recommendation,panelRef:null!=G?G:{current:null},customStyles:O,customIcons:$,cognitiveDecisionHeaders:H,metaData:t.metaDataAttrs})})},i)})]},`${o.categoryName}-${r}`))})};export{h as GapFilterBlock,b as normalizeDecisionStrength};
|
|
2
2
|
//# sourceMappingURL=GapFilterBlock.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import n from"./Segment.js";import t from"dompurify";const o=({id:o,children:l,props:i,segmentComponentConfig:d,customStyles:s,customIcons:a,extractText:u,isUpdatedSegment:
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import n from"./Segment.js";import t from"dompurify";const o=({id:o,children:l,props:i,segmentComponentConfig:d,customStyles:s,customIcons:a,extractText:u,isUpdatedSegment:r=!1,blockId:m,storyId:v,customDeleteStyles:g,customDeleteIcons:c})=>{var p,S,h,I,C,f,y,D,b,x,_,E,U,W,k,w,L,A,F;const R=(null==i?void 0:i.id)||"Segment",j=(null==i?void 0:i.decisionstrength)||"80",{segmentDataList:B,getSegmentExampleComponent:G,handleViewGlossary:N,upadatedSegmentDataList:O,handleFetchUpdatedSegmentDetails:T,handleFetchSegmentDetails:V,handleDeleteSegment:z,handleEditSegment:H,enabledSegmentActions:M,onShowNotification:q}=d||{},J=r?null==O?void 0:O.find(e=>{var n;return String(e.segment_id)===String(null===(n=null==R?void 0:R.split("-"))||void 0===n?void 0:n[0])}):null==B?void 0:B.find(e=>{var n;return String(e.segment_id)===String(null===(n=null==R?void 0:R.split("-"))||void 0===n?void 0:n[0])}),K={id:R,reason:null!==(p=null==J?void 0:J.reason)&&void 0!==p?p:"",gap:null!==(S=null==J?void 0:J.gap)&&void 0!==S?S:"",explanation:null!==(h=null==J?void 0:J.explanation)&&void 0!==h?h:"",relevance_score:null!==(I=null==J?void 0:J.relevance_score)&&void 0!==I?I:0,isOpen:!1};let P;const Q=u(l),X=i["data-table"];let Y="";if(X&&!r)try{Y=decodeURIComponent(atob(X))}catch(e){console.error("Failed to decode data-table for segment",R,e)}const Z=t.sanitize(Y),$=()=>e("div",{dangerouslySetInnerHTML:{__html:Z}});return J||!V||r||null==V||V(R),R&&J&&G&&!r&&(P=X?e($,{}):G(R,Q,J.segment_type)),e(n,{id:R,segmentUUID:o,label:null!==(C=null==J?void 0:J.label)&&void 0!==C?C:null==J?void 0:J.segment_name,decisionStrength:j,aiReason:K,customIcons:a,aiReasoningCitationCustomStyles:s,segmentExampleComponent:P,handleViewGlossary:N,customStyles:{segmentWrapper:null===(f=null==s?void 0:s.segment)||void 0===f?void 0:f.segmentWrapper,container:null===(y=null==s?void 0:s.segment)||void 0===y?void 0:y.container,label:null===(D=null==s?void 0:s.segment)||void 0===D?void 0:D.label,decisionStrength:null===(b=null==s?void 0:s.segment)||void 0===b?void 0:b.decisionStrength,buttonContainer:null===(x=null==s?void 0:s.segment)||void 0===x?void 0:x.buttonContainer,cheveronIcon:null===(_=null==s?void 0:s.segment)||void 0===_?void 0:_.cheveronIcon,segmentExample:null===(E=null==s?void 0:s.segment)||void 0===E?void 0:E.segmentExample,loadingSkeleton:null===(U=null==s?void 0:s.segment)||void 0===U?void 0:U.SegmentLoadingSkeletonStyles,editInputWrapper:null===(W=null==s?void 0:s.segment)||void 0===W?void 0:W.editInputWrapper,editInput:null===(k=null==s?void 0:s.segment)||void 0===k?void 0:k.editInput,editCheckIcon:null===(w=null==s?void 0:s.segment)||void 0===w?void 0:w.editCheckIcon,editCrossIcon:null===(L=null==s?void 0:s.segment)||void 0===L?void 0:L.editCrossIcon,headerActionsContainer:null===(A=null==s?void 0:s.segment)||void 0===A?void 0:A.headerActionsContainer,editIconButton:null===(F=null==s?void 0:s.segment)||void 0===F?void 0:F.editIconButton},isUpdatedSegment:r,onOpen:async()=>{!J&&r&&(console.log("citation metadata:: handleFetchUpdatedSegmentDetails"),await(null==T?void 0:T(R)))},onDelete:e=>{if(console.log("SegmentWrapper: onDelete",e,{...J,segment_uuid:R},v,m),J)return null==z?void 0:z(e,{...J,segment_uuid:R},v,m)},onEdit:e=>{if(console.log("SegmentWrapper: onEdit",J,e),J&&H)return null==H?void 0:H(J,e)},customDeleteStyles:g,customDeleteIcons:c,enabledSegmentActions:M,segmentDataList:B,onShowNotification:(e,n,t)=>{q&&q(e,n,t)},children:l},R)};export{o 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{jsx as e,Fragment as n,jsxs as i}from"react/jsx-runtime";import o,{createContext as t,useRef as l,useState as r,useCallback as d,useMemo as a,useEffect as s,useContext as c}from"react";import u from"react-markdown";import p from"rehype-raw";import g from"./UserStoryWithCitation.module.css.js";import{useMarkdownSearch as h}from"../../shared/useMarkdownSearch.js";import{Info as v}from"lucide-react";import{Tooltip as m}from"@mui/material";import C from"dompurify";import f from"../../shared/UpdatedAnimationContent.js";import y from"../../shared/GeneratedCodeCitation.js";import w from"../../shared/CitationLoadingIndicator.js";import{useRequirementAI as S}from"../RequirementAIWrapper/RequirementAIWrapper.js";import b from"../../icons/CognitiveDecision.js";import I from"../../icons/BrainRed.js";import R,{SHOW_CONFIDENCE_SCORE_THRESHOLD_IN_AI_REASONING as $}from"../ai-reasoning/AiReasoningCitation.js";import x from"../../icons/RelevanceScoreIcon.js";import N from"../RecommendationBlock/RecommendationBlock.js";import k from"../UserStoryCard/AttachedContext.js";import A from"../ai-reasoning/AiReasoningCitationContent.js";import j from"./components/InlineUpdatedComponent.js";import U from"../segment/SegmentWrapper.js";import{MarkdownContextProvider as E}from"../../store/markdown-context.js";import L from"./components/InlineManualComponent.js";import M from"./components/HighlightButtonComponent.js";import{escapeTagIds as T,splitTagAcrossParagraphs as P}from"../../../../utils/tagHelper.js";const D=t(!1),_=t({expandedInfo:null,setExpanded:()=>{},reasonToRow:{current:new Map}}),H=t({rowId:""}),F=({aiReason:n,isHighConfidence:o,customStyle:t,customIcons:l})=>{var r;const{expandedInfo:d,setExpanded:a,reasonToRow:s}=c(_),{rowId:u}=c(H),p=String(n.id);u&&s.current.set(p,u);const h=(null===(r=null==d?void 0:d.aiReason)||void 0===r?void 0:r.id)===n.id,v=o?(null==l?void 0:l.highConfidence)||e(b,{}):(null==l?void 0:l.lowConfidence)||e(I,{});return i("button",{className:g.aiReasoningButton,style:t,onClick:e=>{e.stopPropagation(),e.preventDefault(),a(h?null:u,h?null:n)},children:[v,e("i",h?{className:`pi pi-angle-up ${o?g.aiReasoningIconHighConfidence:g.aiReasoningIconLowConfidence}`}:{className:`pi pi-angle-down ${o?g.aiReasoningIconHighConfidence:g.aiReasoningIconLowConfidence}`})]})},B=({children:n,node:o,customStyles:t,customIcons:r})=>{var d,a;const s=l(Math.random().toString(36).slice(2)).current,{expandedInfo:u}=c(_),p=(null==u?void 0:u.rowId)===s,h=Array.isArray(null==o?void 0:o.children)?o.children.filter(e=>"element"===e.type).length:1,v=null!==(a=null===(d=null==o?void 0:o.properties)||void 0===d?void 0:d.style)&&void 0!==a?a:void 0;return i(H.Provider,{value:{rowId:s},children:[e("tr",{style:v?{cssText:v}:void 0,children:n}),p&&(null==u?void 0:u.aiReason)&&e("tr",{style:{width:"100%"},children:e("td",{colSpan:h||1,className:g.tableExpandedCell,children:e("div",{className:g.tableExpandedCellInner,children:e("div",{className:g.tableExpandedCellContent,children:e(A,{aiReason:u.aiReason,customIcons:r,customStyles:{aiReasoningContent:null==t?void 0:t.aiReasoningContent,aiReasoningAccordion:null==t?void 0:t.aiReasoningAccordion,aiReasoningMarkdown:null==t?void 0:t.aiReasoningMarkdown,aiReasoningPill:null==t?void 0:t.aiReasoningPill,webCitation:null==t?void 0:t.webCitation,stormeeCitation:null==t?void 0:t.stormeeCitation,waveformCitation:null==t?void 0:t.waveformCitation,imageCitation:null==t?void 0:t.imageCitation,fileCitation:null==t?void 0:t.fileCitation,appModCitation:null==t?void 0:t.appModCitation,rcaCitation:null==t?void 0:t.rcaCitation,readFileCitation:null==t?void 0:t.readFileCitation,loadingCitations:null==t?void 0:t.loadingCitations,chatCitation:null==t?void 0:t.chatCitation}})})})})})]})};const O=["del","ins"];function V(e){return function(e,n,i){const o=n.join("|");return e.replace(new RegExp(`<(${o})>([\\s\\S]*?)<\\/\\1>`,"gi"),(e,n,o)=>`<${n}>${i(o)}</${n}>`)}(e,O,e=>e.split(/(<[^>]+>)/g).map(e=>!e||/^<[^>]+>$/.test(e)?e:function(e){if(!e)return e;const n=[];return e.replace(/`([^`\n]+)`/g,(e,i)=>`@@CODE_SPAN_${n.push(i)-1}@@`).replace(/\*\*([\s\S]+?)\*\*/g,"<strong>$1</strong>").replace(/__([\s\S]+?)__/g,"<strong>$1</strong>").replace(/@@CODE_SPAN_(\d+)@@/g,(e,i)=>{var o;return`<code>${t=null!==(o=n[Number(i)])&&void 0!==o?o:"",t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}</code>`;var t})}(e)).join(""))}const q=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function z(e,n){const i=[],t=new Set(n.map(e=>e.toLowerCase())),l=e=>{var n,r;try{if(null==e||"boolean"==typeof e)return null;if("string"==typeof e||"number"==typeof e)return e;if(Array.isArray(e))return e.map(e=>l(e)).flat().filter(e=>null!=e);if(!o.isValidElement(e))return e;const d="string"==typeof e.type?e.type.toLowerCase():"";if(t.has(d))return i.push(e),null;if(q.has(d))return e;const a=null===(r=o.Children.map(null===(n=e.props)||void 0===n?void 0:n.children,l))||void 0===r?void 0:r.flat().filter(e=>null!=e);return a&&0!==a.length?o.cloneElement(e,void 0,a):null}catch(n){return console.error("splitNestedDiffNodes failed while processing node:",n),e}};try{return{cleanedChildren:l(e),extractedNodes:i}}catch(n){return console.error("splitNestedDiffNodes failed:",n),{cleanedChildren:e,extractedNodes:[]}}}const W=({message:t,noMarkdownContent:b,useMarkdown:I=!0,isParent:A,scenario:H,showUserStoryDiff:O=!1,aiReasoningsForBlock:q,isCitationLoadingDisplay:W=!1,className:G,highConfidenceIcon:Q,lowConfidenceIcon:J,customStyles:K,customIcons:X,contextVariant:Y,aiReasoningDiffView:Z,userStoryCitations:ee,artifactId:ne,isCraflow:ie,onCraAccept:oe,onCraReject:te,craFlowConfig:le,isDisplayHighlightControl:re=!1,showConfidenceScore:de=!0,CDNeededInChip:ae,blockId:se})=>{var ce;console.log("userstorywithcitation blockid ",se);const ue=l(null),{userStory:pe,inlineUpdateComponentConfig:ge,getAvgScoreForStory:he,setUserStory:ve,aiReasoning:me,setAiReasoning:Ce,customIcons:fe,searchQueryList:ye,searchQueryReasoningIdList:we,currentHighlightIndex:Se,segmentComponentConfig:be,inlineManualComponentConfig:Ie,diffEditConfig:Re}=S(),$e=null!=X?X:null==fe?void 0:fe.userStoryIcons;null==K||K.searchHighlight;const{search:xe,clear:Ne}=h(ue),[ke,Ae]=r("1"),[je,Ue]=r(null),Ee=l(new Map),[Le,Me]=r(new Set),Te=d((e,n)=>{Ue(e&&n?{rowId:e,aiReason:n}:null)},[]),Pe=ne?he(ne):0,[De,_e]=r([]),He=d(e=>{Me(n=>{const i=new Set(n);return i.has(e)?i.delete(e):i.add(e),i})},[]),Fe=e=>null==e?"":"string"==typeof e?e:"number"==typeof e?String(e):Array.isArray(e)?e.map(Fe).join(""):o.isValidElement(e)?Fe(e.props.children):"",Be=e=>{let n=e;return n=n.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,(e,n)=>`<deleted>${n.replace(/ai_reasoning\$(\d+)/g,(e,n)=>`ai_reasoning$${n}-legacy`)}</deleted>`),n=n.replace(/<generatedCode([^>]*)>([\s\S]*?)<\/generatedCode>/gi,(e,n,i)=>`\n\n<generatedCode${n} data-raw="${btoa(encodeURIComponent(i.trim()))}"></generatedCode>\n\n`),n=n.replace(/^(\s*[-*]|\s*\d+\.)\s*\n?\s*(<updated\b)/gm,"$1 $2"),n=n.replace(/(<segment\b([^>]*)>)([\s\S]*?)(<\/segment>)/gi,(e,n,i,o,t)=>{const l=o.match(/<table[\s\S]*?<\/table>/i);if(l){return`<segment${i} data-table="${btoa(encodeURIComponent(l[0]))}"></segment>`}return e}),n=n.replace(/<updatedsegment([^>]*)>([\s\S]*?)<\/updatedsegment>/gi,(e,n,i)=>{if(/<table[\s>]/i.test(i)){return`<updatedsegment${n} data-raw="${btoa(encodeURIComponent(i))}"></updatedsegment>`}return e}),n=n.replace(/<updated([^>]*)>([\s\S]*?)<\/updated>/gi,(e,i,o,t)=>{const l=n.substring(0,t),r=l.lastIndexOf("\n"),d=/^\s+[-*]\s/.test(l.substring(r+1))||/^\s+\d+\.\s/.test(l.substring(r+1)),a=/^\s*(\d+\.|\s*[-*])\s+$/.test(l.substring(r+1));if(d||a){let e=o;return e=e.replace(/(<deleted>)\s*\n?\s*[-*]\s+/gi,"$1\n"),e=e.replace(/(<changed>)\s*\n?\s*[-*]\s+/gi,"$1\n"),e=e.replace(/(<deleted>)\s*\n?\s*\d+\.\s+/gi,"$1\n"),e=e.replace(/(<changed>)\s*\n?\s*\d+\.\s+/gi,"$1\n"),`<updated${i}>${e}</updated>`}return e}),n=function(e){const n=/<updated[^>]*>[\s\S]*?<\/updated>/gi,i=[];let o;const t=new RegExp(n.source,n.flags);for(;null!==(o=t.exec(e));){const e=o[0],n=e.match(/<deleted>([\s\S]*?)<\/deleted>/i),t=e.match(/<changed>([\s\S]*?)<\/changed>/i),l=e=>(e.match(/^\s*\d+\.\s/gm)||[]).length;i.push({index:o.index,endIndex:o.index+o[0].length,deletedItemCount:l((null==n?void 0:n[1])||""),changedItemCount:l((null==t?void 0:t[1])||"")})}if(0===i.length)return e;let l=e;for(let e=i.length-1;e>=0;e--){const n=i[e],o=n.changedItemCount-n.deletedItemCount;if(0===o)continue;const t=l.substring(0,n.index).split("\n").reverse();let r=!1;for(const e of t){const n=e.trim();if(""!==n){/^\d+\.\s/.test(n)&&(r=!0);break}}if(!r)continue;const d=n.endIndex,a=e+1<i.length?i[e+1].index:l.length;let s=l.substring(d,a);s=s.replace(/^(\s*)(\d+)\.\s/gm,(e,n,i)=>`${n}${parseInt(i,10)+o}. `),l=l.substring(0,d)+s+l.substring(a)}return l}(n),n=function(e){let n=e.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,(e,n)=>{const i=n.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <deleted>",{hadChange:i!==n}),`<deleted>${i}</deleted>`});return n=n.replace(/<changed>([\s\S]*?)<\/changed>/gi,(e,n)=>{const i=n.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <changed>",{hadChange:i!==n,preview:n.substring(0,120)}),`<changed>${i}</changed>`}),n}(n),n=V(n),n},Oe=a(()=>t?Be(t):t,[t]);s(()=>{_e(q||me)},[q,me]);const Ve=a(()=>({span:({node:n,children:i,...o})=>{var t,l,r,d,a;const s=null!==(l=null===(t=null==n?void 0:n.properties)||void 0===t?void 0:t["highlight-id"])&&void 0!==l?l:null==o?void 0:o["highlight-id"],c="string"==typeof s&&Le.has(s),u=null!==(d=null===(r=null==n?void 0:n.properties)||void 0===r?void 0:r["highlight-color"])&&void 0!==d?d:null==o?void 0:o["highlight-color"];return e("span",{style:{...null!==(a=null==K?void 0:K.span)&&void 0!==a?a:{},...c?{backgroundColor:u||"#fef08a"}:{}},children:i})},button:({node:i,children:o,...t})=>{var l,r,d,a,s,c;const u=null!==(r=null===(l=null==i?void 0:i.properties)||void 0===l?void 0:l.action)&&void 0!==r?r:null==t?void 0:t.action,p=null!==(a=null===(d=null==i?void 0:i.properties)||void 0===d?void 0:d["highlight-id"])&&void 0!==a?a:null==t?void 0:t["highlight-id"],g=null!==(c=null===(s=null==i?void 0:i.properties)||void 0===s?void 0:s["highlight-type"])&&void 0!==c?c:null==t?void 0:t["highlight-type"];return"highlight"===u?e(M,{highlightId:p,handleHighlightSpan:He,icon:"web"===g?null==$e?void 0:$e.webCitationIcon:"doc"===g?null==$e?void 0:$e.fileCitationIcon:e(n,{}),customStyles:"web"===g?null==K?void 0:K.webButton:"doc"===g?null==K?void 0:K.docButton:{}}):null},upt:({node:i,children:o,...t})=>{var l,r;const d=null==t?void 0:t.id,a=d?null===(r=null===(l=d.split("$"))||void 0===l?void 0:l[1])||void 0===r?void 0:r.replaceAll("@","<").replaceAll("#",">"):null,s=me.find(e=>e.id.toString()===a);if(!s)return o||e(n,{});const c="data-main"in t,u=t["data-status"];return e(n,{children:e(j,{aiReason:s,customStyles:null==K?void 0:K.inlineUpdatedComponent,handleClickCognitiveDecision:null==ge?void 0:ge.handleClickCognitiveDecision,handleClickUpdatedPill:null==ge?void 0:ge.handleClickUpdatedPill,handleClickOutputValue:null==ge?void 0:ge.handleClickOutputValue,customIcons:null==ge?void 0:ge.customIcons,CDNeededInChip:ae,showChip:c,status:u,children:o||e(n,{})})})},del:({node:o,children:t,...l})=>{var r;const{cleanedChildren:d,extractedNodes:a}=z(t,["ins"]);return i(n,{children:[e("span",{className:g.deleted,style:null!==(r=null==K?void 0:K.deleted)&&void 0!==r?r:{},...l,onClick:()=>{l.onclick&&l.onclick()},children:d}),a]})},ins:({children:o,...t})=>{var l;const{cleanedChildren:r,extractedNodes:d}=z(o,["del"]);return i(n,{children:[e("span",{className:g.inserted,style:null!==(l=null==K?void 0:K.inserted)&&void 0!==l?l:{},...t,onClick:()=>{t.onclick&&t.onclick()},children:r}),d]})},preserved:({children:n,...i})=>e("span",{className:g.preserved,style:null==K?void 0:K.preserved,...i,children:n}),manual:({children:i,...o})=>{var t;const l=null===(t=null==o?void 0:o.id)||void 0===t?void 0:t.replaceAll("@","<").replaceAll("#",">"),r=me.find(e=>e.id.toString()===l),d=o["data-status"];return r?e(L,{aiReason:r,handleClick:null==Ie?void 0:Ie.handleClick,status:d,children:i}):i||e(n,{})},invisible:({children:i,...o})=>e(n,{}),h1:({node:n,...i})=>e("h1",{className:g.heading1,style:null==K?void 0:K.heading1,children:i.children}),h2:({node:n,...i})=>e("h2",{className:g.heading2,style:null==K?void 0:K.heading2,children:i.children}),h3:({node:n,...i})=>e("h3",{className:g.heading3,style:null==K?void 0:K.heading3,children:i.children}),b:({node:n,...i})=>e("b",{className:g.bold,style:null==K?void 0:K.bold,children:null==i?void 0:i.children}),p:({node:n,...i})=>e("p",{...i,className:g.paragraph,style:null==K?void 0:K.paragraph,children:i.children}),updated:({node:n,...i})=>e(f,{...i,showUserStoryDiff:O,currentUpdatedTagId:ke,setCurrentUpdatedTagId:Ae,userStory:pe,setUserStory:ve,setAiReasoning:Ce,node:n,isCraflow:ie,onCraAccept:oe,onCraReject:te,diffEditConfig:Re,customStyles:null==K?void 0:K.updatedContent,craFlowConfig:le}),ol:({node:n,...i})=>{var o,t,l;const r=null!==(l=null!==(t=null===(o=null==n?void 0:n.properties)||void 0===o?void 0:o.start)&&void 0!==t?t:null==i?void 0:i.start)&&void 0!==l?l:void 0;return e("ol",{className:g.orderedList,style:null==K?void 0:K.olist,...r?{start:Number(r)}:{},children:null==i?void 0:i.children})},ul:({node:n,...i})=>e("ul",{className:g.unorderedList,style:null==K?void 0:K.ulist,children:null==i?void 0:i.children}),table:({children:n})=>e("div",{className:g.tableWrapper,children:e("table",{className:g.table,style:null==K?void 0:K.table,children:n})}),tr:({node:n,children:i})=>e(B,{node:n,children:i,customStyles:K}),td:({node:n,children:i})=>{var o;const{style:t,...l}=null!==(o=null==n?void 0:n.properties)&&void 0!==o?o:{};return e(D.Provider,{value:!0,children:e("td",{...l,style:t?{cssText:t}:void 0,children:i})})},th:({node:n,children:i})=>{var o;const{style:t,...l}=null!==(o=null==n?void 0:n.properties)&&void 0!==o?o:{};return e(D.Provider,{value:!0,children:e("th",{...l,style:t?{cssText:t}:void 0,children:i})})},recommendation:({node:n,...i})=>{var o;const t=`The AI has selected this content based on: ${(null===(o=null==i?void 0:i.children)||void 0===o?void 0:o[0])||""}`;return e(N,{...i,customStyles:null==K?void 0:K.recommendationBlock,label:t})},a:({inline:n,children:i,node:o,...t})=>{var l,r,d;const a=c(D)||"true"==(null==t?void 0:t.table),s=`${null==t?void 0:t.href}`,u=null===(l=s.split("$"))||void 0===l?void 0:l[0],p=null===(r=s.split("$"))||void 0===r?void 0:r[1];if("ai_reasoning"===u){const n=(null!==(d=O?Z:me)&&void 0!==d?d:[]).find(e=>e.id.toString()===decodeURIComponent(p)),o=we.includes(p);if(n){if(a)return e(F,{aiReason:n,customStyle:null==K?void 0:K.tableAiReasoning,customIcons:$e,isHighConfidence:n.relevance_score>=$});const t=Fe(i),l="source"!==t.trim().toLowerCase();return e(R,{aiReason:n,isSourceHasHighlight:o,inlineLabel:t,isInlineCitation:l,customIcons:$e,customStyles:{aiReasoningContent:null==K?void 0:K.aiReasoningContent,aiReasoningAccordion:null==K?void 0:K.aiReasoningAccordion,aiReasoningMarkdown:null==K?void 0:K.aiReasoningMarkdown,aiReasoningPill:null==K?void 0:K.aiReasoningPill,webCitation:null==K?void 0:K.webCitation,stormeeCitation:null==K?void 0:K.stormeeCitation,waveformCitation:null==K?void 0:K.waveformCitation,imageCitation:null==K?void 0:K.imageCitation,fileCitation:null==K?void 0:K.fileCitation,appModCitation:null==K?void 0:K.appModCitation,rcaCitation:null==K?void 0:K.rcaCitation,readFileCitation:null==K?void 0:K.readFileCitation,loadingCitations:null==K?void 0:K.loadingCitations,chatCitation:null==K?void 0:K.chatCitation,bigEnoughCitation:null==K?void 0:K.bigEnoughCitation}})}}return null},code:({inline:n,children:i,className:o,node:t,...l})=>/language-(\w+)/.exec(o||"")||(null==o?void 0:o.includes("language-"))?e("div",{children:e("code",{className:g.blockCode,style:null==K?void 0:K.code,children:i})}):e("code",{className:g.inlineCode,style:null==K?void 0:K.code,children:i}),learned:({children:n})=>e(m,{title:n,placement:"top",children:e(v,{size:16,className:g.learned})}),generatedcode:({node:n,...i})=>{const o=(null==i?void 0:i.language)||"python",t=(e=>{let n="";try{if(e["data-raw"])n=decodeURIComponent(atob(e["data-raw"]));else{const i=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})(i);return e(y,{title:"Generated Code",code:t,language:o,customStyles:{pill:null==K?void 0:K.generatedCodePill,content:null==K?void 0:K.generatedCodeContent}})},updatedsegment:({node:n,children:i,...o})=>{var t,l,r,d;const a=`${null===(t=n.position)||void 0===t?void 0:t.start.line}-${null===(l=n.position)||void 0===l?void 0:l.start.column}-${null===(r=n.position)||void 0===r?void 0:r.end.line}-${null===(d=n.position)||void 0===d?void 0:d.end.column}`,s=(e=>{if(!e["data-raw"])return null;try{return decodeURIComponent(atob(e["data-raw"]))}catch(e){return console.error("Error decoding segment raw content:",e),null}})(o),c=e("div",s?{dangerouslySetInnerHTML:{__html:C.sanitize(s)}}:{children:i});return e(U,{id:a,node:n,children:c,props:o,segmentComponentConfig:be,customStyles:K,customIcons:X,extractText:Fe,isUpdatedSegment:!0})},segment:({node:n,children:i,...o})=>{var t,l,r,d;const a=`${null===(t=n.position)||void 0===t?void 0:t.start.line}-${null===(l=n.position)||void 0===l?void 0:l.start.column}-${null===(r=n.position)||void 0===r?void 0:r.end.line}-${null===(d=n.position)||void 0===d?void 0:d.end.column}`;return e(U,{id:a,node:n,children:i,props:o,segmentComponentConfig:be,customStyles:K,customIcons:X,extractText:Fe,blockId:se})}}),[De,le,me,ee,ke,O,t,X,ye,we,K,be,Le,He,se]),qe=a(()=>{let e=T(Oe,["manual","upt"]);return["del","ins","preserved","manual","upt"].forEach(n=>{e=P(e,n,"upt"===n)}),e},[Oe]);return s(()=>{if(!ue.current)return;if(!ye.length)return void Ne();let e;if(0===we.length||re)requestAnimationFrame(()=>{xe([ye[Se].replace(/\*/g,"")])});else{const n=ue.current,i=new MutationObserver(()=>{clearTimeout(e),e=setTimeout(()=>{i.disconnect(),requestAnimationFrame(()=>{xe([ye[Se].replace(/\*/g,"")])})},50)});i.observe(n,{childList:!0,subtree:!0})}return()=>{clearTimeout(e)}},[ye,we,Se,re]),e(_.Provider,{value:{expandedInfo:je,setExpanded:Te,reasonToRow:Ee},children:i("div",{ref:ue,className:`${g.container} ${"approving"!==H?g.wrapper:""} ${G||""}`,style:null==K?void 0:K.container,children:[I?e(E,{children:e(u,{components:Ve,rehypePlugins:[p],children:qe})}):b,Pe>0&&de&&e("div",{className:g.confidenceScoreContainer,style:null==K?void 0:K.confidenceScoreContainer,children:i("span",{className:g.confidenceScore,style:null==K?void 0:K.confidenceScore,children:[e(x,{size:14,color:(null==K?void 0:K.confidenceScoreIconColor)||"#166534"}),Pe,"%"]})}),W&&e("div",{className:g.citationLoader,style:null==K?void 0:K.citationLoaderContainer,children:e(w,{customStyles:{container:null==K?void 0:K.citationLoadingContainer,icon:null==K?void 0:K.citationLoadingIcon,text:null==K?void 0:K.citationLoadingText}})}),A&&e("div",{style:{...null===(ce=null==K?void 0:K.attachedContext)||void 0===ce?void 0:ce.wrapper},className:"flex mt-5",children:e(k,{customStyles:null==K?void 0:K.attachedContext,variant:Y})})]})})};export{W as default,z as splitNestedDiffNodes};
|
|
1
|
+
import{jsx as e,Fragment as n,jsxs as i}from"react/jsx-runtime";import o,{createContext as t,useRef as l,useState as r,useCallback as d,useMemo as a,useEffect as s,useContext as c}from"react";import u from"react-markdown";import p from"rehype-raw";import g from"./UserStoryWithCitation.module.css.js";import{useMarkdownSearch as h}from"../../shared/useMarkdownSearch.js";import{Info as v}from"lucide-react";import{Tooltip as m}from"@mui/material";import C from"dompurify";import f from"../../shared/UpdatedAnimationContent.js";import y from"../../shared/GeneratedCodeCitation.js";import w from"../../shared/CitationLoadingIndicator.js";import{useRequirementAI as S}from"../RequirementAIWrapper/RequirementAIWrapper.js";import b from"../../icons/CognitiveDecision.js";import I from"../../icons/BrainRed.js";import R,{SHOW_CONFIDENCE_SCORE_THRESHOLD_IN_AI_REASONING as $}from"../ai-reasoning/AiReasoningCitation.js";import x from"../../icons/RelevanceScoreIcon.js";import N from"../RecommendationBlock/RecommendationBlock.js";import k from"../UserStoryCard/AttachedContext.js";import A from"../ai-reasoning/AiReasoningCitationContent.js";import j from"./components/InlineUpdatedComponent.js";import U from"../segment/SegmentWrapper.js";import{MarkdownContextProvider as E}from"../../store/markdown-context.js";import L from"./components/InlineManualComponent.js";import M from"./components/HighlightButtonComponent.js";import{escapeTagIds as T,splitTagAcrossParagraphs as P}from"../../../../utils/tagHelper.js";const D=t(!1),_=t({expandedInfo:null,setExpanded:()=>{},reasonToRow:{current:new Map}}),H=t({rowId:""}),F=({aiReason:n,isHighConfidence:o,customStyle:t,customIcons:l})=>{var r;const{expandedInfo:d,setExpanded:a,reasonToRow:s}=c(_),{rowId:u}=c(H),p=String(n.id);u&&s.current.set(p,u);const h=(null===(r=null==d?void 0:d.aiReason)||void 0===r?void 0:r.id)===n.id,v=o?(null==l?void 0:l.highConfidence)||e(b,{}):(null==l?void 0:l.lowConfidence)||e(I,{});return i("button",{className:g.aiReasoningButton,style:t,onClick:e=>{e.stopPropagation(),e.preventDefault(),a(h?null:u,h?null:n)},children:[v,e("i",h?{className:`pi pi-angle-up ${o?g.aiReasoningIconHighConfidence:g.aiReasoningIconLowConfidence}`}:{className:`pi pi-angle-down ${o?g.aiReasoningIconHighConfidence:g.aiReasoningIconLowConfidence}`})]})},B=({children:n,node:o,customStyles:t,customIcons:r})=>{var d,a;const s=l(Math.random().toString(36).slice(2)).current,{expandedInfo:u}=c(_),p=(null==u?void 0:u.rowId)===s,h=Array.isArray(null==o?void 0:o.children)?o.children.filter(e=>"element"===e.type).length:1,v=null!==(a=null===(d=null==o?void 0:o.properties)||void 0===d?void 0:d.style)&&void 0!==a?a:void 0;return i(H.Provider,{value:{rowId:s},children:[e("tr",{style:v?{cssText:v}:void 0,children:n}),p&&(null==u?void 0:u.aiReason)&&e("tr",{style:{width:"100%"},children:e("td",{colSpan:h||1,className:g.tableExpandedCell,children:e("div",{className:g.tableExpandedCellInner,children:e("div",{className:g.tableExpandedCellContent,children:e(A,{aiReason:u.aiReason,customIcons:r,customStyles:{aiReasoningContent:null==t?void 0:t.aiReasoningContent,aiReasoningAccordion:null==t?void 0:t.aiReasoningAccordion,aiReasoningMarkdown:null==t?void 0:t.aiReasoningMarkdown,aiReasoningPill:null==t?void 0:t.aiReasoningPill,webCitation:null==t?void 0:t.webCitation,stormeeCitation:null==t?void 0:t.stormeeCitation,waveformCitation:null==t?void 0:t.waveformCitation,imageCitation:null==t?void 0:t.imageCitation,fileCitation:null==t?void 0:t.fileCitation,appModCitation:null==t?void 0:t.appModCitation,rcaCitation:null==t?void 0:t.rcaCitation,readFileCitation:null==t?void 0:t.readFileCitation,loadingCitations:null==t?void 0:t.loadingCitations,chatCitation:null==t?void 0:t.chatCitation}})})})})})]})};const O=["del","ins"];function V(e){return function(e,n,i){const o=n.join("|");return e.replace(new RegExp(`<(${o})>([\\s\\S]*?)<\\/\\1>`,"gi"),(e,n,o)=>`<${n}>${i(o)}</${n}>`)}(e,O,e=>e.split(/(<[^>]+>)/g).map(e=>!e||/^<[^>]+>$/.test(e)?e:function(e){if(!e)return e;const n=[];return e.replace(/`([^`\n]+)`/g,(e,i)=>`@@CODE_SPAN_${n.push(i)-1}@@`).replace(/\*\*([\s\S]+?)\*\*/g,"<strong>$1</strong>").replace(/__([\s\S]+?)__/g,"<strong>$1</strong>").replace(/@@CODE_SPAN_(\d+)@@/g,(e,i)=>{var o;return`<code>${t=null!==(o=n[Number(i)])&&void 0!==o?o:"",t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}</code>`;var t})}(e)).join(""))}const q=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function z(e,n){const i=[],t=new Set(n.map(e=>e.toLowerCase())),l=e=>{var n,r;try{if(null==e||"boolean"==typeof e)return null;if("string"==typeof e||"number"==typeof e)return e;if(Array.isArray(e))return e.map(e=>l(e)).flat().filter(e=>null!=e);if(!o.isValidElement(e))return e;const d="string"==typeof e.type?e.type.toLowerCase():"";if(t.has(d))return i.push(e),null;if(q.has(d))return e;const a=null===(r=o.Children.map(null===(n=e.props)||void 0===n?void 0:n.children,l))||void 0===r?void 0:r.flat().filter(e=>null!=e);return a&&0!==a.length?o.cloneElement(e,void 0,a):null}catch(n){return console.error("splitNestedDiffNodes failed while processing node:",n),e}};try{return{cleanedChildren:l(e),extractedNodes:i}}catch(n){return console.error("splitNestedDiffNodes failed:",n),{cleanedChildren:e,extractedNodes:[]}}}const W=({message:t,noMarkdownContent:b,useMarkdown:I=!0,isParent:A,scenario:H,showUserStoryDiff:O=!1,aiReasoningsForBlock:q,isCitationLoadingDisplay:W=!1,className:G,highConfidenceIcon:Q,lowConfidenceIcon:J,customStyles:K,customIcons:X,contextVariant:Y,aiReasoningDiffView:Z,userStoryCitations:ee,artifactId:ne,isCraflow:ie,onCraAccept:oe,onCraReject:te,craFlowConfig:le,isDisplayHighlightControl:re=!1,showConfidenceScore:de=!0,CDNeededInChip:ae,blockId:se,storyId:ce})=>{var ue;console.log("userstorywithcitation blockid ",se);const pe=l(null),{userStory:ge,inlineUpdateComponentConfig:he,getAvgScoreForStory:ve,setUserStory:me,aiReasoning:Ce,setAiReasoning:fe,customIcons:ye,searchQueryList:we,searchQueryReasoningIdList:Se,currentHighlightIndex:be,segmentComponentConfig:Ie,inlineManualComponentConfig:Re,diffEditConfig:$e}=S(),xe=null!=X?X:null==ye?void 0:ye.userStoryIcons;null==K||K.searchHighlight;const{search:Ne,clear:ke}=h(pe),[Ae,je]=r("1"),[Ue,Ee]=r(null),Le=l(new Map),[Me,Te]=r(new Set),Pe=d((e,n)=>{Ee(e&&n?{rowId:e,aiReason:n}:null)},[]),De=ne?ve(ne):0,[_e,He]=r([]),Fe=d(e=>{Te(n=>{const i=new Set(n);return i.has(e)?i.delete(e):i.add(e),i})},[]),Be=e=>null==e?"":"string"==typeof e?e:"number"==typeof e?String(e):Array.isArray(e)?e.map(Be).join(""):o.isValidElement(e)?Be(e.props.children):"",Oe=e=>{let n=e;return n=n.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,(e,n)=>`<deleted>${n.replace(/ai_reasoning\$(\d+)/g,(e,n)=>`ai_reasoning$${n}-legacy`)}</deleted>`),n=n.replace(/<generatedCode([^>]*)>([\s\S]*?)<\/generatedCode>/gi,(e,n,i)=>`\n\n<generatedCode${n} data-raw="${btoa(encodeURIComponent(i.trim()))}"></generatedCode>\n\n`),n=n.replace(/^(\s*[-*]|\s*\d+\.)\s*\n?\s*(<updated\b)/gm,"$1 $2"),n=n.replace(/(<segment\b([^>]*)>)([\s\S]*?)(<\/segment>)/gi,(e,n,i,o,t)=>{const l=o.match(/<table[\s\S]*?<\/table>/i);if(l){return`<segment${i} data-table="${btoa(encodeURIComponent(l[0]))}"></segment>`}return e}),n=n.replace(/<updatedsegment([^>]*)>([\s\S]*?)<\/updatedsegment>/gi,(e,n,i)=>{if(/<table[\s>]/i.test(i)){return`<updatedsegment${n} data-raw="${btoa(encodeURIComponent(i))}"></updatedsegment>`}return e}),n=n.replace(/<updated([^>]*)>([\s\S]*?)<\/updated>/gi,(e,i,o,t)=>{const l=n.substring(0,t),r=l.lastIndexOf("\n"),d=/^\s+[-*]\s/.test(l.substring(r+1))||/^\s+\d+\.\s/.test(l.substring(r+1)),a=/^\s*(\d+\.|\s*[-*])\s+$/.test(l.substring(r+1));if(d||a){let e=o;return e=e.replace(/(<deleted>)\s*\n?\s*[-*]\s+/gi,"$1\n"),e=e.replace(/(<changed>)\s*\n?\s*[-*]\s+/gi,"$1\n"),e=e.replace(/(<deleted>)\s*\n?\s*\d+\.\s+/gi,"$1\n"),e=e.replace(/(<changed>)\s*\n?\s*\d+\.\s+/gi,"$1\n"),`<updated${i}>${e}</updated>`}return e}),n=function(e){const n=/<updated[^>]*>[\s\S]*?<\/updated>/gi,i=[];let o;const t=new RegExp(n.source,n.flags);for(;null!==(o=t.exec(e));){const e=o[0],n=e.match(/<deleted>([\s\S]*?)<\/deleted>/i),t=e.match(/<changed>([\s\S]*?)<\/changed>/i),l=e=>(e.match(/^\s*\d+\.\s/gm)||[]).length;i.push({index:o.index,endIndex:o.index+o[0].length,deletedItemCount:l((null==n?void 0:n[1])||""),changedItemCount:l((null==t?void 0:t[1])||"")})}if(0===i.length)return e;let l=e;for(let e=i.length-1;e>=0;e--){const n=i[e],o=n.changedItemCount-n.deletedItemCount;if(0===o)continue;const t=l.substring(0,n.index).split("\n").reverse();let r=!1;for(const e of t){const n=e.trim();if(""!==n){/^\d+\.\s/.test(n)&&(r=!0);break}}if(!r)continue;const d=n.endIndex,a=e+1<i.length?i[e+1].index:l.length;let s=l.substring(d,a);s=s.replace(/^(\s*)(\d+)\.\s/gm,(e,n,i)=>`${n}${parseInt(i,10)+o}. `),l=l.substring(0,d)+s+l.substring(a)}return l}(n),n=function(e){let n=e.replace(/<deleted>([\s\S]*?)<\/deleted>/gi,(e,n)=>{const i=n.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <deleted>",{hadChange:i!==n}),`<deleted>${i}</deleted>`});return n=n.replace(/<changed>([\s\S]*?)<\/changed>/gi,(e,n)=>{const i=n.replace(/\n{2,}/g,"\n");return console.log("[normalizeCustomTags] collapseNewlines in <changed>",{hadChange:i!==n,preview:n.substring(0,120)}),`<changed>${i}</changed>`}),n}(n),n=V(n),n},Ve=a(()=>t?Oe(t):t,[t]);s(()=>{He(q||Ce)},[q,Ce]);const qe=a(()=>({span:({node:n,children:i,...o})=>{var t,l,r,d,a;const s=null!==(l=null===(t=null==n?void 0:n.properties)||void 0===t?void 0:t["highlight-id"])&&void 0!==l?l:null==o?void 0:o["highlight-id"],c="string"==typeof s&&Me.has(s),u=null!==(d=null===(r=null==n?void 0:n.properties)||void 0===r?void 0:r["highlight-color"])&&void 0!==d?d:null==o?void 0:o["highlight-color"];return e("span",{style:{...null!==(a=null==K?void 0:K.span)&&void 0!==a?a:{},...c?{backgroundColor:u||"#fef08a"}:{}},children:i})},button:({node:i,children:o,...t})=>{var l,r,d,a,s,c;const u=null!==(r=null===(l=null==i?void 0:i.properties)||void 0===l?void 0:l.action)&&void 0!==r?r:null==t?void 0:t.action,p=null!==(a=null===(d=null==i?void 0:i.properties)||void 0===d?void 0:d["highlight-id"])&&void 0!==a?a:null==t?void 0:t["highlight-id"],g=null!==(c=null===(s=null==i?void 0:i.properties)||void 0===s?void 0:s["highlight-type"])&&void 0!==c?c:null==t?void 0:t["highlight-type"];return"highlight"===u?e(M,{highlightId:p,handleHighlightSpan:Fe,icon:"web"===g?null==xe?void 0:xe.webCitationIcon:"doc"===g?null==xe?void 0:xe.fileCitationIcon:e(n,{}),customStyles:"web"===g?null==K?void 0:K.webButton:"doc"===g?null==K?void 0:K.docButton:{}}):null},upt:({node:i,children:o,...t})=>{var l,r;const d=null==t?void 0:t.id,a=d?null===(r=null===(l=d.split("$"))||void 0===l?void 0:l[1])||void 0===r?void 0:r.replaceAll("@","<").replaceAll("#",">"):null,s=Ce.find(e=>e.id.toString()===a);if(!s)return o||e(n,{});const c="data-main"in t,u=t["data-status"];return e(n,{children:e(j,{aiReason:s,customStyles:null==K?void 0:K.inlineUpdatedComponent,handleClickCognitiveDecision:null==he?void 0:he.handleClickCognitiveDecision,handleClickUpdatedPill:null==he?void 0:he.handleClickUpdatedPill,handleClickOutputValue:null==he?void 0:he.handleClickOutputValue,customIcons:null==he?void 0:he.customIcons,CDNeededInChip:ae,showChip:c,status:u,children:o||e(n,{})})})},del:({node:o,children:t,...l})=>{var r;const{cleanedChildren:d,extractedNodes:a}=z(t,["ins"]);return i(n,{children:[e("span",{className:g.deleted,style:null!==(r=null==K?void 0:K.deleted)&&void 0!==r?r:{},...l,onClick:()=>{l.onclick&&l.onclick()},children:d}),a]})},ins:({children:o,...t})=>{var l;const{cleanedChildren:r,extractedNodes:d}=z(o,["del"]);return i(n,{children:[e("span",{className:g.inserted,style:null!==(l=null==K?void 0:K.inserted)&&void 0!==l?l:{},...t,onClick:()=>{t.onclick&&t.onclick()},children:r}),d]})},preserved:({children:n,...i})=>e("span",{className:g.preserved,style:null==K?void 0:K.preserved,...i,children:n}),manual:({children:i,...o})=>{var t;const l=null===(t=null==o?void 0:o.id)||void 0===t?void 0:t.replaceAll("@","<").replaceAll("#",">"),r=Ce.find(e=>e.id.toString()===l),d=o["data-status"];return r?e(L,{aiReason:r,handleClick:null==Re?void 0:Re.handleClick,status:d,children:i}):i||e(n,{})},invisible:({children:i,...o})=>e(n,{}),h1:({node:n,...i})=>e("h1",{className:g.heading1,style:null==K?void 0:K.heading1,children:i.children}),h2:({node:n,...i})=>e("h2",{className:g.heading2,style:null==K?void 0:K.heading2,children:i.children}),h3:({node:n,...i})=>e("h3",{className:g.heading3,style:null==K?void 0:K.heading3,children:i.children}),b:({node:n,...i})=>e("b",{className:g.bold,style:null==K?void 0:K.bold,children:null==i?void 0:i.children}),p:({node:n,...i})=>e("p",{...i,className:g.paragraph,style:null==K?void 0:K.paragraph,children:i.children}),updated:({node:n,...i})=>e(f,{...i,showUserStoryDiff:O,currentUpdatedTagId:Ae,setCurrentUpdatedTagId:je,userStory:ge,setUserStory:me,setAiReasoning:fe,node:n,isCraflow:ie,onCraAccept:oe,onCraReject:te,diffEditConfig:$e,customStyles:null==K?void 0:K.updatedContent,craFlowConfig:le}),ol:({node:n,...i})=>{var o,t,l;const r=null!==(l=null!==(t=null===(o=null==n?void 0:n.properties)||void 0===o?void 0:o.start)&&void 0!==t?t:null==i?void 0:i.start)&&void 0!==l?l:void 0;return e("ol",{className:g.orderedList,style:null==K?void 0:K.olist,...r?{start:Number(r)}:{},children:null==i?void 0:i.children})},ul:({node:n,...i})=>e("ul",{className:g.unorderedList,style:null==K?void 0:K.ulist,children:null==i?void 0:i.children}),table:({children:n})=>e("div",{className:g.tableWrapper,children:e("table",{className:g.table,style:null==K?void 0:K.table,children:n})}),tr:({node:n,children:i})=>e(B,{node:n,children:i,customStyles:K}),td:({node:n,children:i})=>{var o;const{style:t,...l}=null!==(o=null==n?void 0:n.properties)&&void 0!==o?o:{};return e(D.Provider,{value:!0,children:e("td",{...l,style:t?{cssText:t}:void 0,children:i})})},th:({node:n,children:i})=>{var o;const{style:t,...l}=null!==(o=null==n?void 0:n.properties)&&void 0!==o?o:{};return e(D.Provider,{value:!0,children:e("th",{...l,style:t?{cssText:t}:void 0,children:i})})},recommendation:({node:n,...i})=>{var o;const t=`The AI has selected this content based on: ${(null===(o=null==i?void 0:i.children)||void 0===o?void 0:o[0])||""}`;return e(N,{...i,customStyles:null==K?void 0:K.recommendationBlock,label:t})},a:({inline:n,children:i,node:o,...t})=>{var l,r,d;const a=c(D)||"true"==(null==t?void 0:t.table),s=`${null==t?void 0:t.href}`,u=null===(l=s.split("$"))||void 0===l?void 0:l[0],p=null===(r=s.split("$"))||void 0===r?void 0:r[1];if("ai_reasoning"===u){const n=(null!==(d=O?Z:Ce)&&void 0!==d?d:[]).find(e=>e.id.toString()===decodeURIComponent(p)),o=Se.includes(p);if(n){if(a)return e(F,{aiReason:n,customStyle:null==K?void 0:K.tableAiReasoning,customIcons:xe,isHighConfidence:n.relevance_score>=$});const t=Be(i),l="source"!==t.trim().toLowerCase();return e(R,{aiReason:n,isSourceHasHighlight:o,inlineLabel:t,isInlineCitation:l,customIcons:xe,customStyles:{aiReasoningContent:null==K?void 0:K.aiReasoningContent,aiReasoningAccordion:null==K?void 0:K.aiReasoningAccordion,aiReasoningMarkdown:null==K?void 0:K.aiReasoningMarkdown,aiReasoningPill:null==K?void 0:K.aiReasoningPill,webCitation:null==K?void 0:K.webCitation,stormeeCitation:null==K?void 0:K.stormeeCitation,waveformCitation:null==K?void 0:K.waveformCitation,imageCitation:null==K?void 0:K.imageCitation,fileCitation:null==K?void 0:K.fileCitation,appModCitation:null==K?void 0:K.appModCitation,rcaCitation:null==K?void 0:K.rcaCitation,readFileCitation:null==K?void 0:K.readFileCitation,loadingCitations:null==K?void 0:K.loadingCitations,chatCitation:null==K?void 0:K.chatCitation,bigEnoughCitation:null==K?void 0:K.bigEnoughCitation}})}}return null},code:({inline:n,children:i,className:o,node:t,...l})=>/language-(\w+)/.exec(o||"")||(null==o?void 0:o.includes("language-"))?e("div",{children:e("code",{className:g.blockCode,style:null==K?void 0:K.code,children:i})}):e("code",{className:g.inlineCode,style:null==K?void 0:K.code,children:i}),learned:({children:n})=>e(m,{title:n,placement:"top",children:e(v,{size:16,className:g.learned})}),generatedcode:({node:n,...i})=>{const o=(null==i?void 0:i.language)||"python",t=(e=>{let n="";try{if(e["data-raw"])n=decodeURIComponent(atob(e["data-raw"]));else{const i=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})(i);return e(y,{title:"Generated Code",code:t,language:o,customStyles:{pill:null==K?void 0:K.generatedCodePill,content:null==K?void 0:K.generatedCodeContent}})},updatedsegment:({node:n,children:i,...o})=>{var t,l,r,d;const a=`${null===(t=n.position)||void 0===t?void 0:t.start.line}-${null===(l=n.position)||void 0===l?void 0:l.start.column}-${null===(r=n.position)||void 0===r?void 0:r.end.line}-${null===(d=n.position)||void 0===d?void 0:d.end.column}`,s=(e=>{if(!e["data-raw"])return null;try{return decodeURIComponent(atob(e["data-raw"]))}catch(e){return console.error("Error decoding segment raw content:",e),null}})(o),c=e("div",s?{dangerouslySetInnerHTML:{__html:C.sanitize(s)}}:{children:i});return e(U,{id:a,node:n,children:c,props:o,segmentComponentConfig:Ie,customStyles:K,customIcons:X,extractText:Be,isUpdatedSegment:!0})},segment:({node:n,children:i,...o})=>{var t,l,r,d;const a=`${null===(t=n.position)||void 0===t?void 0:t.start.line}-${null===(l=n.position)||void 0===l?void 0:l.start.column}-${null===(r=n.position)||void 0===r?void 0:r.end.line}-${null===(d=n.position)||void 0===d?void 0:d.end.column}`;return e(U,{id:a,node:n,children:i,props:o,segmentComponentConfig:Ie,customStyles:K,customIcons:X,extractText:Be,blockId:se,storyId:ce})}}),[_e,le,Ce,ee,Ae,O,t,X,we,Se,K,Ie,Me,Fe,se,ce]),ze=a(()=>{let e=T(Ve,["manual","upt"]);return["del","ins","preserved","manual","upt"].forEach(n=>{e=P(e,n,"upt"===n)}),e},[Ve]);return s(()=>{if(!pe.current)return;if(!we.length)return void ke();let e;if(0===Se.length||re)requestAnimationFrame(()=>{Ne([we[be].replace(/\*/g,"")])});else{const n=pe.current,i=new MutationObserver(()=>{clearTimeout(e),e=setTimeout(()=>{i.disconnect(),requestAnimationFrame(()=>{Ne([we[be].replace(/\*/g,"")])})},50)});i.observe(n,{childList:!0,subtree:!0})}return()=>{clearTimeout(e)}},[we,Se,be,re]),e(_.Provider,{value:{expandedInfo:Ue,setExpanded:Pe,reasonToRow:Le},children:i("div",{ref:pe,className:`${g.container} ${"approving"!==H?g.wrapper:""} ${G||""}`,style:null==K?void 0:K.container,children:[I?e(E,{children:e(u,{components:qe,rehypePlugins:[p],children:ze})}):b,De>0&&de&&e("div",{className:g.confidenceScoreContainer,style:null==K?void 0:K.confidenceScoreContainer,children:i("span",{className:g.confidenceScore,style:null==K?void 0:K.confidenceScore,children:[e(x,{size:14,color:(null==K?void 0:K.confidenceScoreIconColor)||"#166534"}),De,"%"]})}),W&&e("div",{className:g.citationLoader,style:null==K?void 0:K.citationLoaderContainer,children:e(w,{customStyles:{container:null==K?void 0:K.citationLoadingContainer,icon:null==K?void 0:K.citationLoadingIcon,text:null==K?void 0:K.citationLoadingText}})}),A&&e("div",{style:{...null===(ue=null==K?void 0:K.attachedContext)||void 0===ue?void 0:ue.wrapper},className:"flex mt-5",children:e(k,{customStyles:null==K?void 0:K.attachedContext,variant:Y})})]})})};export{W as default,z as splitNestedDiffNodes};
|
|
2
2
|
//# sourceMappingURL=UserStoryWithCitation.js.map
|
|
@@ -84,14 +84,16 @@ interface StoryCardProps {
|
|
|
84
84
|
editButtonConfig?: EditButtonConfig;
|
|
85
85
|
CDNeededInChip?: boolean;
|
|
86
86
|
blockNumber?: string;
|
|
87
|
+
storyNumber?: string;
|
|
87
88
|
showAssignSection?: boolean;
|
|
88
89
|
disableAssignSection?: boolean;
|
|
89
90
|
onAssignSectionClick?: (section: IUserStory) => void;
|
|
90
91
|
onSave?: UserStoryOnSave;
|
|
92
|
+
onUserStoryAccordionStateChange?: (userStoryItem: IUserStory, updatedState: boolean) => void;
|
|
91
93
|
}
|
|
92
94
|
export declare function replaceLearnedTagsWithInfo(content: string): React.ReactNode[];
|
|
93
95
|
type UserStoryOnSave = (content: string, storyId: string) => Promise<void>;
|
|
94
|
-
export declare const StoryCard: ({ isUserStoryCurrentlyUpdated, artifactId, artifactTitleId, parentUserStory, currentUserStory, onUserStoryChange, parentIndex, currentIndex, enableDownload, isDiffEditReviewMode, showUserStoryDiff, handleDownloadUserStory, handleOpenSendDialog, updateUserStoryArtifact, selectedArtifactId, isDisplayHighlightControl, elementDisplayConfig, _resolvedConfig, showWrapper, defaultExpanded, actionItemsConfig, onDelete, contextVariant, expandedSubFeatures, showDisplayName, allowTitleEdit, showConfidenceScore, showBorderTop, sectionStatusConfig, showCompletionPanel, completionPanelConfig, showAddSectionButton, disableEditPlan, useMuiTooltip, approveButtonConfig, editButtonConfig, CDNeededInChip, blockNumber, showAssignSection, disableAssignSection, onAssignSectionClick, onSave, }: StoryCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
96
|
+
export declare const StoryCard: ({ isUserStoryCurrentlyUpdated, artifactId, artifactTitleId, parentUserStory, currentUserStory, onUserStoryChange, parentIndex, currentIndex, enableDownload, isDiffEditReviewMode, showUserStoryDiff, handleDownloadUserStory, handleOpenSendDialog, updateUserStoryArtifact, selectedArtifactId, isDisplayHighlightControl, elementDisplayConfig, _resolvedConfig, showWrapper, defaultExpanded, actionItemsConfig, onDelete, contextVariant, expandedSubFeatures, showDisplayName, allowTitleEdit, showConfidenceScore, showBorderTop, sectionStatusConfig, showCompletionPanel, completionPanelConfig, showAddSectionButton, disableEditPlan, useMuiTooltip, approveButtonConfig, editButtonConfig, CDNeededInChip, blockNumber, storyNumber, showAssignSection, disableAssignSection, onAssignSectionClick, onSave, onUserStoryAccordionStateChange }: StoryCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
95
97
|
interface IProps {
|
|
96
98
|
isUserStoryCurrentlyUpdated?: boolean;
|
|
97
99
|
artifactId: string;
|
|
@@ -126,7 +128,8 @@ interface IProps {
|
|
|
126
128
|
disableAssignSection?: boolean;
|
|
127
129
|
onAssignSectionClick?: (section: IUserStory) => void;
|
|
128
130
|
onSave?: UserStoryOnSave;
|
|
131
|
+
onUserStoryAccordionStateChange?: (userStoryItem: IUserStory, isExpanded: boolean) => void;
|
|
129
132
|
}
|
|
130
|
-
export declare const UserStoryCardWrapper: ({ artifactTitleIDs, expandedSubFeatures, isDiffEditReviewMode, showUserStoryDiff, updateUserStoryArtifact, isUserStoryCurrentlyUpdated, artifactId, handleOpenSendDialog, handleDownloadUserStory, selectedArtifactId, isDisplayHighlightControl, elementDisplayConfig, showWrapper, actionItemsConfig, contextVariant, showDisplayName, allowTitleEdit, showConfidenceScore, showBorderTop, defaultExpanded, showCompletionPanel, completionPanelConfig, showAddSectionButton, disableEditPlan, useMuiTooltip, approveButtonConfig, editButtonConfig, CDNeededInChip, setRedlineDocumentIdParent, showAssignSection, onAssignSectionClick, disableAssignSection, onSave }: IProps) => import("react/jsx-runtime").JSX.Element;
|
|
133
|
+
export declare const UserStoryCardWrapper: ({ artifactTitleIDs, expandedSubFeatures, isDiffEditReviewMode, showUserStoryDiff, updateUserStoryArtifact, isUserStoryCurrentlyUpdated, artifactId, handleOpenSendDialog, handleDownloadUserStory, selectedArtifactId, isDisplayHighlightControl, elementDisplayConfig, showWrapper, actionItemsConfig, contextVariant, showDisplayName, allowTitleEdit, showConfidenceScore, showBorderTop, defaultExpanded, showCompletionPanel, completionPanelConfig, showAddSectionButton, disableEditPlan, useMuiTooltip, approveButtonConfig, editButtonConfig, CDNeededInChip, setRedlineDocumentIdParent, showAssignSection, onAssignSectionClick, disableAssignSection, onSave, onUserStoryAccordionStateChange }: IProps) => import("react/jsx-runtime").JSX.Element;
|
|
131
134
|
export default StoryCard;
|
|
132
135
|
//# sourceMappingURL=UserStoryCard.d.ts.map
|
package/dist/types/src/features/RequirementAI/components/UserStoryCard/UserStoryCard.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserStoryCard.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/UserStoryCard/UserStoryCard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+B,SAAS,EAAE,MAAM,OAAO,CAAC;AA2B/D,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAMlE,OAAQ,EAA8C,mBAAmB,EAAoB,MAAM,8CAA8C,CAAC;AAClJ,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAazE,UAAU,iBAAiB;IACvB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,eAAe,CAAC,EAAE,MAAM,GAAG,MA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;IACzB,cAAc,CAAC,EAAC,OAAO,CAAC;IACxB,mBAAmB,CAAC,EAAC,OAAO,CAAC;IAC7B,aAAa,CAAC,EAAC,OAAO,CAAC;IACvB,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC9B,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;IAC9C,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"UserStoryCard.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/UserStoryCard/UserStoryCard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+B,SAAS,EAAE,MAAM,OAAO,CAAC;AA2B/D,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAMlE,OAAQ,EAA8C,mBAAmB,EAAoB,MAAM,8CAA8C,CAAC;AAClJ,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAazE,UAAU,iBAAiB;IACvB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAElC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACjC;AAED,MAAM,WAAW,mBAAmB;IAClC,SAAS,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,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAElD,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,oBAAoB,CAAC,EAAE,CAAC,OAAO,EAAE,UAAU,KAAK,IAAI,CAAC;IACrD,MAAM,CAAC,EAAE,eAAe,CAAA;IACxB,+BAA+B,CAAC,EAAC,CAAC,aAAa,EAAC,UAAU,EAAC,UAAU,EAAC,OAAO,KAAG,IAAI,CAAA;CACvF;AAED,eAAO,MAAM,oBAAoB,grBAA6sB,MAAM,4CAuJnvB,CAAA;AAED,eAAe,SAAS,CAAC"}
|
package/dist/types/src/features/RequirementAI/components/lsc-reason-gap/CustomChatCrRedirection.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ interface CustomChatCrRedirectionProps extends InlineRefIconProps {
|
|
|
28
28
|
badgeBg: string;
|
|
29
29
|
badgeText: string;
|
|
30
30
|
};
|
|
31
|
-
onHandleSend?: (userMessage: string, id?: string) => void;
|
|
31
|
+
onHandleSend?: (userMessage: string, id?: string, metaData?: Record<string, string>) => void;
|
|
32
32
|
gapType?: string;
|
|
33
33
|
isGenerating?: boolean;
|
|
34
34
|
customStyles?: GapFilterStyles;
|
|
@@ -50,7 +50,8 @@ interface CustomChatCrRedirectionProps extends InlineRefIconProps {
|
|
|
50
50
|
text: string;
|
|
51
51
|
};
|
|
52
52
|
}) => void;
|
|
53
|
+
metaData: Record<string, string>;
|
|
53
54
|
}
|
|
54
|
-
export declare function CustomChatCrRedirection({ isDefaultOpen, processItemId, isCompleted, mode, msg, type, id, aiReason, text, headerText, decisionStrength, statusUi, panelRef, onHandleSend, onRedirectClick, gapType, isGenerating, customStyles, customIcons, cognitiveDecisionHeaders, }: CustomChatCrRedirectionProps): import("react/jsx-runtime").JSX.Element;
|
|
55
|
+
export declare function CustomChatCrRedirection({ isDefaultOpen, processItemId, isCompleted, mode, msg, type, id, aiReason, text, headerText, decisionStrength, statusUi, panelRef, onHandleSend, onRedirectClick, gapType, isGenerating, customStyles, customIcons, cognitiveDecisionHeaders, metaData }: CustomChatCrRedirectionProps): import("react/jsx-runtime").JSX.Element;
|
|
55
56
|
export {};
|
|
56
57
|
//# sourceMappingURL=CustomChatCrRedirection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomChatCrRedirection.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/lsc-reason-gap/CustomChatCrRedirection.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAEzE,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAKnE,MAAM,MAAM,OAAO,GAAG,UAAU,GAAG,QAAQ,CAAC;AAE5C,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,GAAG,CAAC;IACT,IAAI,EAAE,OAAO,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,eAAe,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAC/B,IAAI,EAAE,KAAK,GAAG,UAAU,CAAA;CACzB;AAED,UAAU,4BAA6B,SAAQ,kBAAkB;IAC/D,aAAa,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE;QACR,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,YAAY,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,KAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"CustomChatCrRedirection.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/lsc-reason-gap/CustomChatCrRedirection.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAEzE,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAKnE,MAAM,MAAM,OAAO,GAAG,UAAU,GAAG,QAAQ,CAAC;AAE5C,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,GAAG,CAAC;IACT,IAAI,EAAE,OAAO,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,eAAe,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAC/B,IAAI,EAAE,KAAK,GAAG,UAAU,CAAA;CACzB;AAED,UAAU,4BAA6B,SAAQ,kBAAkB;IAC/D,aAAa,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE;QACR,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,YAAY,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAM,IAAI,CAAC;IAC9F,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,eAAe,CAAA;IAC9B,WAAW,CAAC,EAAE,cAAc,CAAA;IAC5B,wBAAwB,CAAC,EAAE,SAAS,CAAA;IACpC;;;;OAIG;IACH,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE;QAC1B,IAAI,EAAE,OAAO,CAAC;QACd,EAAE,EAAE,MAAM,CAAC;QACX,QAAQ,EAAE,eAAe,CAAC;QAC1B,GAAG,EAAE,GAAG,CAAC;QACT,IAAI,EAAE;YAAE,UAAU,CAAC,EAAE,MAAM,CAAC;YAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC;KACxE,KAAK,IAAI,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACjC;AAID,wBAAgB,uBAAuB,CAAC,EACtC,aAAa,EACb,aAAa,EACb,WAAW,EACX,IAAI,EACJ,GAAG,EACH,IAAI,EACJ,EAAE,EACF,QAAQ,EACR,IAAI,EACJ,UAAU,EACV,gBAAgB,EAChB,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,eAAe,EACf,OAAO,EACP,YAAoB,EACpB,YAAY,EACZ,WAAW,EACX,wBAAwB,EACxB,QAAQ,EACT,EAAE,4BAA4B,2CAyM9B"}
|
|
@@ -26,7 +26,7 @@ export interface GapFilterBlockProps {
|
|
|
26
26
|
isGeneratingGap?: boolean;
|
|
27
27
|
selectedGapItemId?: string;
|
|
28
28
|
onItemSelect?: (id: string) => void;
|
|
29
|
-
onHandleSend?: (
|
|
29
|
+
onHandleSend?: (userMessage: string, id?: string, metaData?: Record<string, string>) => void;
|
|
30
30
|
onModeAction?: (supportedmodes: string, payload: Record<string, any>) => void;
|
|
31
31
|
msg: any;
|
|
32
32
|
panelRef?: React.RefObject<any>;
|
package/dist/types/src/features/RequirementAI/components/lsc-reason-gap/GapFilterBlock.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GapFilterBlock.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/lsc-reason-gap/GapFilterBlock.tsx"],"names":[],"mappings":"AACA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAajF,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,SAAS,EAAgB,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAOvF,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,SAAS,GAAG,gBAAgB,CAAC;AACtE,MAAM,MAAM,OAAO,GAAG,UAAU,GAAG,QAAQ,CAAC;AAQ5C,MAAM,WAAW,eAAe;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACrC,qBAAqB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC5C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;
|
|
1
|
+
{"version":3,"file":"GapFilterBlock.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/lsc-reason-gap/GapFilterBlock.tsx"],"names":[],"mappings":"AACA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAajF,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,SAAS,EA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AAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAChC,YAAY,CAAC,EAAE,eAAe,CAAC;IAC/B,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wBAAwB,CAAC,EAAE,SAAS,CAAA;CACrC;AAED,eAAO,MAAM,yBAAyB,EAAE,KAAK,CAAC,EAAE,CAAC,8BAA8B,CA6H9E,CAAC"}
|
|
@@ -12,9 +12,10 @@ interface SegmentWrapperProps {
|
|
|
12
12
|
extractText: (node: React.ReactNode) => string;
|
|
13
13
|
isUpdatedSegment?: boolean;
|
|
14
14
|
blockId?: string;
|
|
15
|
+
storyId?: string;
|
|
15
16
|
customDeleteStyles?: SegmentStyles;
|
|
16
17
|
customDeleteIcons?: DeleteDialogIcons;
|
|
17
18
|
}
|
|
18
|
-
declare const SegmentWrapper: ({ id, children, props, segmentComponentConfig, customStyles, customIcons, extractText, isUpdatedSegment, blockId, customDeleteStyles, customDeleteIcons }: SegmentWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
declare const SegmentWrapper: ({ id, children, props, segmentComponentConfig, customStyles, customIcons, extractText, isUpdatedSegment, blockId, storyId, customDeleteStyles, customDeleteIcons }: SegmentWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
20
|
export default SegmentWrapper;
|
|
20
21
|
//# sourceMappingURL=SegmentWrapper.d.ts.map
|
|
@@ -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;AAExC,OAAO,EAAY,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAE7E,OAAO,EAAE,aAAa,EAAgB,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAI9F,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,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kBAAkB,CAAC,EAAE,aAAa,CAAC;IACnC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;CACzC;AAGD,QAAA,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"SegmentWrapper.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/segment/SegmentWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAA;AAExC,OAAO,EAAY,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAE7E,OAAO,EAAE,aAAa,EAAgB,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAI9F,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,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAC,MAAM,CAAC;IAChB,kBAAkB,CAAC,EAAE,aAAa,CAAC;IACnC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;CACzC;AAGD,QAAA,MAAM,cAAc,uKAajB,mBAAmB,4CAkHrB,CAAA;AAED,eAAe,cAAc,CAAA"}
|
|
@@ -120,11 +120,12 @@ interface UserStoryWithCitationsProps {
|
|
|
120
120
|
};
|
|
121
121
|
CDNeededInChip?: boolean;
|
|
122
122
|
blockId?: string;
|
|
123
|
+
storyId?: string;
|
|
123
124
|
}
|
|
124
125
|
export declare function splitNestedDiffNodes(children: React.ReactNode, nestedTagNames: string[]): {
|
|
125
126
|
cleanedChildren: React.ReactNode;
|
|
126
127
|
extractedNodes: React.ReactNode[];
|
|
127
128
|
};
|
|
128
|
-
declare const UserStoryWithCitations: ({ message, noMarkdownContent, useMarkdown, isParent, scenario, showUserStoryDiff, aiReasoningsForBlock, isCitationLoadingDisplay, className, highConfidenceIcon, lowConfidenceIcon, customStyles, customIcons, contextVariant, aiReasoningDiffView, userStoryCitations, artifactId, isCraflow, onCraAccept, onCraReject, craFlowConfig, isDisplayHighlightControl, showConfidenceScore, CDNeededInChip, blockId }: UserStoryWithCitationsProps) => import("react/jsx-runtime").JSX.Element;
|
|
129
|
+
declare const UserStoryWithCitations: ({ message, noMarkdownContent, useMarkdown, isParent, scenario, showUserStoryDiff, aiReasoningsForBlock, isCitationLoadingDisplay, className, highConfidenceIcon, lowConfidenceIcon, customStyles, customIcons, contextVariant, aiReasoningDiffView, userStoryCitations, artifactId, isCraflow, onCraAccept, onCraReject, craFlowConfig, isDisplayHighlightControl, showConfidenceScore, CDNeededInChip, blockId, storyId, }: UserStoryWithCitationsProps) => import("react/jsx-runtime").JSX.Element;
|
|
129
130
|
export default UserStoryWithCitations;
|
|
130
131
|
//# sourceMappingURL=UserStoryWithCitation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserStoryWithCitation.d.ts","sourceRoot":"","sources":["../../../../../../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,EAAE,OAAO,CAAC;IAEpC,aAAa,CAAC,EAAE;QACd,SAAS,EAAE,OAAO,CAAC;QACnB,YAAY,EAAE,UAAU,EAAE,CAAC;QAC3B,eAAe,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;QACpE,wBAAwB,CAAC,EAAE,CAAC,MAAM,EAAE,QAAQ,GAAG,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,KAAK,IAAI,CAAC;QAC5F,oBAAoB,EAAE,OAAO,CAAC;KAC/B,CAAC;IACF,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,OAAO,CAAC,EAAC,MAAM,CAAA;CAChB;AAkWD,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,KAAK,CAAC,SAAS,EACzB,cAAc,EAAE,MAAM,EAAE;;;EAoEzB;AAED,QAAA,MAAM,sBAAsB,
|
|
1
|
+
{"version":3,"file":"UserStoryWithCitation.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuF,MAAM,OAAO,CAAC;AAW5G,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,aAAa,EAAE,qBAAqB,EAAE,YAAY,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAC7Y,OAA+B,EAAE,2BAA2B,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AASzI,OAAwB,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACvF,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AA6BlE,MAAM,WAAW,iCAAiC;IAChD,eAAe,CAAC,EAAE,KA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,MAAM,sBAAsB,gaAkCzB,2BAA2B,4CA8tB7B,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userstory.interface.d.ts","sourceRoot":"","sources":["../../../../../../src/features/RequirementAI/interfaces/userstory.interface.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,qBAAqB,EAAe,aAAa,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAChK,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAElG,MAAM,WAAW,UAAU;IAEzB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,UAAU,EAAE,CAAC;IAG5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,GAAG,YAAY,CAAC;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B,WAAW,CAAC,EAAE,YAAY,EAAE,CAAC;IAC7B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,2BAA2B,CAAC,EAAE,wBAAwB,CAAC;IACvD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,2BAA2B,CAAC,EAAE,yBAAyB,CAAC;IAExD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB,QAAQ,CAAC,EAAC,MAAM,CAAC,MAAM,EAAC,OAAO,CAAC,CAAC;IAEjC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB,QAAQ,CAAC,EAAE,GAAG,CAAC;
|
|
1
|
+
{"version":3,"file":"userstory.interface.d.ts","sourceRoot":"","sources":["../../../../../../src/features/RequirementAI/interfaces/userstory.interface.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,qBAAqB,EAAe,aAAa,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAChK,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAElG,MAAM,WAAW,UAAU;IAEzB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,UAAU,EAAE,CAAC;IAG5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,GAAG,YAAY,CAAC;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B,WAAW,CAAC,EAAE,YAAY,EAAE,CAAC;IAC7B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,2BAA2B,CAAC,EAAE,wBAAwB,CAAC;IACvD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,2BAA2B,CAAC,EAAE,yBAAyB,CAAC;IAExD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB,QAAQ,CAAC,EAAC,MAAM,CAAC,MAAM,EAAC,OAAO,CAAC,CAAC;IAEjC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,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ACN,MAAM,EAAE,KAAK,GAAG,QAAQ,CAAC;QACzB,KAAK,EAAE,MAAM,CAAA;KACd,CAAC;IACF,GAAG,EAAE;QACH,MAAM,EAAE,KAAK,GAAG,QAAQ,CAAC;QACzB,KAAK,EAAE,MAAM,CAAA;KACd,CAAC;IACF,eAAe,EAAE,MAAM,CAAA;CACxB,CAAA;AAGD,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;CACpB;AACD,MAAM,WAAW,qBAAqB;IACpC,gBAAgB,EAAE,YAAY,CAAC;IAC/B,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,MAAM,MAAM,kBAAkB,GAC1B,OAAO,GACP,kBAAkB,GAClB,UAAU,CAAC;AAEf,MAAM,MAAM,eAAe,GAAG,MAAM,CAClC,kBAAkB,EAClB,qBAAqB,EAAE,CACxB,CAAC;AAEF,MAAM,WAAW,wBAAwB;IACvC,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,eAAe,EAAE,MAAM,CAAC;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,gBAAgB,EAAE,eAAe,EAAE,CAAC;CACrC;AAED,MAAM,WAAW,yBAAyB;IACxC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,GAAG,EAAE,MAAM,CAAC;CACb"}
|
|
@@ -23,7 +23,7 @@ export type TSegmentComponentConfig = {
|
|
|
23
23
|
handleFetchSegmentDetails?: (segmentId: string) => Promise<void>;
|
|
24
24
|
handleFetchUpdatedSegmentDetails?: (segmentId: string) => Promise<void>;
|
|
25
25
|
getSegmentExampleComponent?: (segmentId: string, originalValue: string, segmentType: TSegmentType) => JSX.Element;
|
|
26
|
-
handleDeleteSegment?: (scope: DeleteScope, segment: TUniqueSegment, blockId?: string) => Promise<void>;
|
|
26
|
+
handleDeleteSegment?: (scope: DeleteScope, segment: TUniqueSegment, storyId?: string, blockId?: string) => Promise<void>;
|
|
27
27
|
handleEditSegment?: (segment: TSegment, newLabel: string) => Promise<void>;
|
|
28
28
|
enabledSegmentActions?: TSegmentActions[];
|
|
29
29
|
onShowNotification?: (type: 'error' | 'success' | 'info', title: string, message: string) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segment.type.d.ts","sourceRoot":"","sources":["../../../../../../src/features/RequirementAI/types/segment.type.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,4CAA4C,CAAC;AACzE,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE9C,MAAM,MAAM,QAAQ,GAAG;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,YAAY,CAAC;IAC3B,KAAK,EAAC,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG;IACpC,YAAY,EAAE,MAAM,CAAC;CACxB,CAAC;AAGF,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,QAAQ,CAAC;AAChD,MAAM,MAAM,uBAAuB,GAAG;IAClC,eAAe,CAAC,EAAE,QAAQ,EAAE,CAAC;IAC7B,uBAAuB,CAAC,EAAE,QAAQ,EAAE,CAAC;IACrC,kBAAkB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAA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