@viswa-test/test-citation 0.0.194 → 0.0.196
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/README.md +290 -0
- package/dist/cjs/features/CognitiveCompare/CitationRenderer.js +1 -1
- package/dist/cjs/features/CognitiveCompare/CognitiveCompare.js +1 -1
- package/dist/cjs/features/ManageRemainders/AssigneeCalendarView.js +2 -0
- package/dist/cjs/features/ManageRemainders/AssigneeCalendarView.js.map +1 -0
- package/dist/cjs/features/ManageRemainders/ManageRemainder.module.css.js +2 -0
- package/dist/cjs/features/ManageRemainders/ManageRemainder.module.css.js.map +1 -0
- package/dist/cjs/features/ManageRemainders/ManageReminders.js +2 -0
- package/dist/cjs/features/ManageRemainders/ManageReminders.js.map +1 -0
- package/dist/cjs/features/ManageRemainders/ReminderFrequencyAutocomplete.js +2 -0
- package/dist/cjs/features/ManageRemainders/ReminderFrequencyAutocomplete.js.map +1 -0
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/IterateComponent.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.js +1 -1
- package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/ToneToggle.js +1 -1
- package/dist/cjs/features/RequirementAI/components/ai-reasoning/AiReasonMarkdownWrapper.js +1 -1
- package/dist/cjs/features/RequirementAI/components/ai-reasoning/AiReasoningCitation.js +1 -1
- package/dist/cjs/features/RequirementAI/components/ai-reasoning/ScannedCitationRenderer.js +2 -0
- package/dist/cjs/features/RequirementAI/components/ai-reasoning/ScannedCitationRenderer.js.map +1 -0
- package/dist/cjs/features/RequirementAI/components/segment/Segment.js +1 -1
- package/dist/cjs/features/RequirementAI/components/segment/SegmentWrapper.js +1 -1
- package/dist/cjs/features/RequirementAI/components/segment/segment.module.css.js +1 -1
- package/dist/cjs/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js +1 -1
- package/dist/cjs/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.js +1 -1
- package/dist/cjs/features/UserStoryImport/UserStoryPicker.js +1 -1
- package/dist/cjs/features/UserStoryImport/components/TypeDropdown.js +1 -1
- package/dist/cjs/features/UserStoryImport/components/UserStoryCard.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/features/CognitiveCompare/CitationRenderer.js +1 -1
- package/dist/features/CognitiveCompare/CognitiveCompare.js +1 -1
- package/dist/features/ManageRemainders/AssigneeCalendarView.js +2 -0
- package/dist/features/ManageRemainders/AssigneeCalendarView.js.map +1 -0
- package/dist/features/ManageRemainders/ManageRemainder.module.css.js +2 -0
- package/dist/features/ManageRemainders/ManageRemainder.module.css.js.map +1 -0
- package/dist/features/ManageRemainders/ManageReminders.js +2 -0
- package/dist/features/ManageRemainders/ManageReminders.js.map +1 -0
- package/dist/features/ManageRemainders/ReminderFrequencyAutocomplete.js +2 -0
- package/dist/features/ManageRemainders/ReminderFrequencyAutocomplete.js.map +1 -0
- package/dist/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/Popups/IterateComponent.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.js +1 -1
- package/dist/features/RequirementAI/components/UserStoryCard/Popups/ToneToggle.js +1 -1
- package/dist/features/RequirementAI/components/ai-reasoning/AiReasonMarkdownWrapper.js +1 -1
- package/dist/features/RequirementAI/components/ai-reasoning/AiReasoningCitation.js +1 -1
- package/dist/features/RequirementAI/components/ai-reasoning/ScannedCitationRenderer.js +2 -0
- package/dist/features/RequirementAI/components/ai-reasoning/ScannedCitationRenderer.js.map +1 -0
- package/dist/features/RequirementAI/components/segment/Segment.js +1 -1
- package/dist/features/RequirementAI/components/segment/SegmentWrapper.js +1 -1
- package/dist/features/RequirementAI/components/segment/segment.module.css.js +1 -1
- package/dist/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.js +1 -1
- package/dist/features/RequirementAI/components/userstory-with-citation/components/InlineUpdatedComponent.js +1 -1
- package/dist/features/UserStoryImport/UserStoryPicker.js +1 -1
- package/dist/features/UserStoryImport/components/TypeDropdown.js +1 -1
- package/dist/features/UserStoryImport/components/UserStoryCard.js +1 -1
- package/dist/index.js +1 -1
- package/dist/types/src/CommonConstants/CommonConstants.d.ts +9214 -0
- package/dist/types/src/CommonConstants/CommonConstants.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CitationRenderer.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/CognitiveCompare.d.ts.map +1 -1
- package/dist/types/src/features/CognitiveCompare/hooks/useCompareLayout.d.ts +0 -1
- package/dist/types/src/features/CognitiveCompare/hooks/useCompareLayout.d.ts.map +1 -1
- package/dist/types/src/features/ManageRemainders/AssigneeCalendarView.d.ts +19 -0
- package/dist/types/src/features/ManageRemainders/AssigneeCalendarView.d.ts.map +1 -0
- package/dist/types/src/features/ManageRemainders/ManageRemainderUsage.d.ts +2 -0
- package/dist/types/src/features/ManageRemainders/ManageRemainderUsage.d.ts.map +1 -0
- package/dist/types/src/features/ManageRemainders/ManageReminders.d.ts +49 -0
- package/dist/types/src/features/ManageRemainders/ManageReminders.d.ts.map +1 -0
- package/dist/types/src/features/ManageRemainders/ReminderFrequencyAutocomplete.d.ts +17 -0
- package/dist/types/src/features/ManageRemainders/ReminderFrequencyAutocomplete.d.ts.map +1 -0
- package/dist/types/src/features/ManageRemainders/types/type.d.ts +79 -0
- package/dist/types/src/features/ManageRemainders/types/type.d.ts.map +1 -0
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.d.ts +13 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/CognitiveComponents/CognitiveComponent.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.d.ts +18 -4
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/DeviationSummary.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/IterateComponent.d.ts +6 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/IterateComponent.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.d.ts +5 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/ToneToggle.d.ts +4 -1
- package/dist/types/src/features/RequirementAI/components/UserStoryCard/Popups/ToneToggle.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/ai-reasoning/AiReasonMarkdownWrapper.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/ai-reasoning/AiReasoningCitation.d.ts +3 -1
- package/dist/types/src/features/RequirementAI/components/ai-reasoning/AiReasoningCitation.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/ai-reasoning/ScannedCitationRenderer.d.ts +11 -0
- package/dist/types/src/features/RequirementAI/components/ai-reasoning/ScannedCitationRenderer.d.ts.map +1 -0
- package/dist/types/src/features/RequirementAI/components/segment/Segment.d.ts +0 -1
- package/dist/types/src/features/RequirementAI/components/segment/Segment.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/segment/SegmentWrapper.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.d.ts +3 -1
- package/dist/types/src/features/RequirementAI/components/userstory-with-citation/UserStoryWithCitation.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/interfaces/citation.interface.d.ts +37 -0
- package/dist/types/src/features/RequirementAI/interfaces/citation.interface.d.ts.map +1 -1
- package/dist/types/src/features/RequirementAI/types/aiReasoning.type.d.ts +3 -0
- package/dist/types/src/features/RequirementAI/types/aiReasoning.type.d.ts.map +1 -1
- package/dist/types/src/features/UserStoryImport/UserStoryPicker.context.d.ts +1 -0
- package/dist/types/src/features/UserStoryImport/UserStoryPicker.context.d.ts.map +1 -1
- package/dist/types/src/features/UserStoryImport/UserStoryPicker.d.ts +1 -1
- package/dist/types/src/features/UserStoryImport/UserStoryPicker.d.ts.map +1 -1
- package/dist/types/src/features/UserStoryImport/UserStoryPicker.types.d.ts +1 -0
- package/dist/types/src/features/UserStoryImport/UserStoryPicker.types.d.ts.map +1 -1
- package/dist/types/src/features/UserStoryImport/components/TypeDropdown.d.ts.map +1 -1
- package/dist/types/src/features/UserStoryImport/components/UserStoryCard.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/package.json +15 -8
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),a=require("react/jsx-runtime"),s=require("react"),n=require("lucide-react"),i=require("@mui/material/Checkbox"),t=require("@mui/material"),r=require("framer-motion"),l=require("@mui/icons-material/DragIndicator"),d=require("@mui/x-date-pickers"),o=require("@mui/x-date-pickers/AdapterDayjs"),c=require("./ReminderFrequencyAutocomplete.js"),u=require("./AssigneeCalendarView.js"),m=require("dayjs"),f=require("./ManageRemainder.module.css.js");function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var v=_(i),h=_(l),x=_(m),g=["Assignee 1","Assignee 2","Assignee 3"],p=[{bg:"#FDF2FA",text:"#C11574"},{bg:"#EEF4FF",text:"#3538CD"},{bg:"#F1F5F9",text:"#344054"}],j=[{bg:"#FDF2FA",text:"#C93185"},{bg:"#EEF2FF",text:"#6366F1"},{bg:"#FFF4E5",text:"#FF6058"}],N=[{id:"1",name:"Assignee 1",color:"#C11574",bg:"#FDF2F8",startDate:new Date("2026-11-09"),dueDate:new Date("2026-12-01")},{id:"2",name:"Assignee 2",color:"#3538CD",bg:"#EEF4FF",startDate:new Date("2026-11-21"),dueDate:new Date("2026-12-03")},{id:"3",name:"Assignee 3",color:"#FF6058",bg:"#FFF7ED",startDate:new Date("2026-12-01"),dueDate:new Date("2026-12-03")}],b=[{bg:"#DBEAFE",text:"#1E40AF"},{bg:"#CCFBF1",text:"#0D9488"},{bg:"#DCFCE7",text:"#166534"}],y=[{initials:"OR",name:"Olivia Rhye",checked:!1,bg:"bg-blue-100",text:"text-blue-700"},{initials:"DM",name:"Daniela Mark",checked:!1,bg:"bg-cyan-100",text:"text-teal-700"},{initials:"JB",name:"Jenna Beckner",checked:!1,bg:"bg-emerald-100",text:"text-emerald-600"}],C=function(e){var a,s,n,i,t,r,l,d;return(null==e?void 0:e.is_escalation_reminder)&&(null===(a=null==e?void 0:e.days)||void 0===a?void 0:a.value)&&"undefined"!==(null===(s=null==e?void 0:e.days)||void 0===s?void 0:s.value)&&(null===(n=null==e?void 0:e.escalation_reminder_frequency)||void 0===n?void 0:n.value)&&"undefined"!==(null===(i=null==e?void 0:e.escalation_reminder_frequency)||void 0===i?void 0:i.value)?"Start notifying ".concat((null===(t=null==e?void 0:e.days)||void 0===t?void 0:t.value.includes("day"))?null===(r=null==e?void 0:e.days)||void 0===r?void 0:r.value:"".concat(null===(l=null==e?void 0:e.days)||void 0===l?void 0:l.value," ").concat(Number(null===(d=null==e?void 0:e.days)||void 0===d?void 0:d.value)>0?"days":"day")," ").concat(null==e?void 0:e.before_or_after," the due date"):"Notify until successful document upload"},k={"& .MuiInputBase-root":{height:"28px",borderRadius:"4px",fontSize:"11px"}};exports.ManageReminders=function(i){var l=i.data,m=i.schedules,_=i.setSchedules,R=i.remainderOwners,D=i.setRemainderOwners,F=i.labels,S=void 0===F?g:F,w=i.colors,I=void 0===w?p:w,E=i.chipColor,A=void 0===E?j:E,B=i.assignees,T=void 0===B?N:B,q=i.fallbackRecipients,P=void 0===q?y:q,L=i.recipientsColor,M=void 0===L?b:L,O=i.manualReminderTitle,Y=void 0===O?"Send Manual Reminder Now":O,H=i.manualReminderDescription,z=void 0===H?"Immediately notify the assignees about this document.":H;i.lastReminderText;var W=i.selectRecipientsLabel,G=void 0===W?"Select recipients:":W,U=i.previewEmailButtonLabel,V=void 0===U?"Preview Email":U,J=i.sendNowButtonLabel,Z=void 0===J?"Send Now":J,K=i.reminderSuccessTitle,Q=void 0===K?"Reminder sent successfully!":K,X=i.reminderSuccessDescription,$=void 0===X?"Email notification sent to 2 assignees.":X,ee=i.escalationTitle,ae=void 0===ee?"Escalation and Auto Reminder Setup":ee;i.escalationTitleTooltip;var se=i.escalationDescription,ne=void 0===se?"Configure Auto reminder settings for all assignees.":se;i.configureAutoReminderText;var ie=i.getDynamicStatement,te=void 0===ie?C:ie,re=i.reminderStartDateLabel,le=void 0===re?"Reminder Start Date":re,de=i.documentDueDateLabel,oe=void 0===de?"Document Due Date":de,ce=i.reminderFrequencyLabel,ue=void 0===ce?"Reminder Frequency":ce,me=i.escalationRemindersLabel,fe=void 0===me?"Escalation Reminders":me;i.escalationTooltip;var _e=i.escalationConditionText,ve=void 0===_e?"If the document is still pending, start escalation reminders":_e,he=i.daysText,xe=void 0===he?"days":he,ge=i.dueDataAndRepeatText,pe=void 0===ge?"due date and repeat every":ge,je=i.reminderFrequencyOptions,Ne=void 0===je?["12 hours","24 hours","48 hours","72 hours","Custom"]:je,be=i.escalationFrequencyOptions,ye=void 0===be?["1/2 hour","1 hour","4 hours","6 hours","12 hours","Custom"]:be,Ce=i.beforeAfterOptions,ke=void 0===Ce?["After","Before"]:Ce,Re=i.handelSendNow,De=i.showPreviewEmail,Fe=void 0===De||De,Se=s.useState(!1),we=Se[0],Ie=Se[1],Ee=s.useState(!1),Ae=Ee[0],Be=Ee[1],Te=s.useState(!1),qe=Te[0],Pe=Te[1],Le=s.useState(null);Le[0],Le[1];var Me=s.useState(!0),Oe=Me[0],Ye=Me[1],He=s.useState(P),ze=He[0],We=He[1],Ge=r.useDragControls(),Ue=function(a,s,n){D(function(i){return i.map(function(i,t){var r;return t===a?e.__assign(e.__assign({},i),((r={})[s]=n,r)):i})})},Ve=function(e){var a;if(!e)return null;if("custom"===e.type)return Number(e.value)<=0?null:60*Number(e.value)*60*1e3;return null!==(a={"1/2 hour":18e5,"1 hour":36e5,"4 hours":144e5,"6 hours":216e5,"12 hours":432e5,"24 hours":864e5,"48 hours":1728e5,"72 hours":2592e5,"96 hours":3456e5,"1/2 day":432e5,"1 day":864e5,"2 days":1728e5,"3 days":2592e5,"4 days":3456e5}[e.value])&&void 0!==a?a:null},Je=function(e,a,s){if(!e||!a||!s)return[];var n=Ve(s);if(!n)return[];for(var i=[],t=x.default(e).valueOf(),r=x.default(a).valueOf();t<=r;)i.push(x.default(t).toISOString()),t+=n;return i},Ze=function(e,a,s,n){if(!(e&&a&&n&&s))return[];var i=Ve(n);if(!i)return[];var t,r=x.default(e),l="custom"===a.type?Number(a.value):Number("1/2"===a.value.split(" ")[0]?.5:Number(a.value.split(" ")[0])),d=[];switch(s){case"Before":t=r.subtract(l,"day");break;case"After":t=r.add(l,"day");break;default:return[]}for(var o=t.valueOf(),c=0;c<1e3;c++)d.push(x.default(o).toISOString()),o+=i;return d},Ke=function(e){return e?e.split(" ").map(function(e){return e[0]}).join("").toUpperCase():""};s.useEffect(function(){var e=(null==l?void 0:l.due_at)||"",a=null==R?void 0:R.map(function(a){var s=T.find(function(e){return e.id===String(a.id)});return{ownerId:a.id,ownerName:null==s?void 0:s.name,ownerColor:null==s?void 0:s.color,reminders:Je(a.reminder_start_date,e,a.reminder_frequency),escalations:Ze(e,a.days,a.before_or_after,a.escalation_reminder_frequency)}});_(a)},[R]),s.useEffect(function(){if(null==l?void 0:l.assignee){var e=Object.values(l.assignee).filter(function(e){return e&&Object.keys(e).length>0}).map(function(e,a){return{name:e.name,checked:!1,recipientsColor:M[a]}}),a=e.length>0?e:P;We(a)}},[l]);var Qe=Object.values((null==l?void 0:l.assignee)||{}).filter(function(e){return null==e?void 0:e.name});return a.jsxs("div",e.__assign({className:f.default.mrContainer},{children:[a.jsxs("div",e.__assign({className:f.default.mrSectionBox,onClick:function(){return Ie(function(e){return!e})}},{children:[a.jsxs("div",e.__assign({className:f.default.mrSectionHeader},{children:[a.jsxs("div",e.__assign({className:f.default.mrSectionHeaderContent},{children:[a.jsxs("div",e.__assign({className:f.default.mrSectionHeaderLeft},{children:[a.jsxs("div",e.__assign({className:f.default.mrSectionTitleWrapper},{children:[a.jsx("div",e.__assign({className:f.default.mrSectionTitleIcon},{children:a.jsx(n.Send,{className:f.default.mrIconSmall})})),a.jsx("div",e.__assign({className:f.default.mrSectionTitle},{children:Y}))]})),a.jsx("div",e.__assign({className:f.default.mrSectionDescription},{children:z}))]})),a.jsx("div",e.__assign({className:f.default.mrSectionHeaderRight},{children:a.jsx("button",e.__assign({type:"button",onClick:function(e){e.stopPropagation(),Ie(function(e){return!e})},className:f.default.mrChevronButton},{children:a.jsx(n.ChevronDown,{className:"".concat(f.default.mrChevronIcon," ").concat(we?f.default.mrChevronRotated:"")})}))}))]})),a.jsx(r.AnimatePresence,{children:qe&&a.jsxs(r.motion.div,e.__assign({initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},className:f.default.mrSuccessMessage},{children:[a.jsx("div",e.__assign({className:f.default.mrSuccessIcon},{children:a.jsx("div",e.__assign({className:f.default.mrSuccessIconInner},{children:a.jsx(n.CircleCheckBigIcon,{className:f.default.mrIconSuccess})}))})),a.jsxs("div",e.__assign({className:f.default.mrSuccessText},{children:[a.jsx("div",e.__assign({className:f.default.mrSuccessTitle},{children:Q})),a.jsx("div",e.__assign({className:f.default.mrSuccessDescription},{children:$}))]}))]}))})]})),a.jsx(r.AnimatePresence,{children:we&&a.jsxs(r.motion.div,e.__assign({initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.3},className:f.default.mrHiddenSection,style:{pointerEvents:we?"auto":"none"}},{children:[a.jsxs("div",e.__assign({className:f.default.mrRecipientsSection},{children:[a.jsx("div",e.__assign({className:f.default.mrRecipientsLabel},{children:G})),a.jsx("div",e.__assign({className:f.default.mrRecipientsGrid},{children:ze.map(function(s){return a.jsxs("div",e.__assign({className:f.default.mrRecipientItem},{children:[a.jsx(v.default,{checked:s.checked,onChange:function(){return a=s.name,void We(function(s){return s.map(function(s){return s.name===a?e.__assign(e.__assign({},s),{checked:!s.checked}):s})});var a},onClick:function(e){return e.stopPropagation()},size:"small",disableRipple:!0,icon:a.jsx("div",{className:f.default.mrCheckboxUnchecked}),checkedIcon:a.jsx("div",e.__assign({className:f.default.mrCheckboxChecked},{children:a.jsx("svg",e.__assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 12 10",fill:"none",className:f.default.mrCheckboxIcon},{children:a.jsx("path",{d:"M1 5L4.2 8L11 1",stroke:"#5925DC",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})}))})),sx:{padding:0}}),a.jsxs("div",e.__assign({className:f.default.mrRecipientInfo},{children:[a.jsx("div",e.__assign({className:f.default.mrRecipientAvatar,style:{backgroundColor:s.recipientsColor.bg,color:s.recipientsColor.text}},{children:Ke(s.name)})),a.jsx("div",e.__assign({className:f.default.mrRecipientName},{children:s.name}))]}))]}),s.name)})}))]})),a.jsxs("div",e.__assign({className:f.default.mrActionsSection},{children:[Fe&&a.jsxs("button",e.__assign({onClick:function(e){e.stopPropagation()},type:"button",className:"".concat(f.default.mrActionButton," ").concat(f.default.mrActionButtonSecondary)},{children:[a.jsx(n.Mail,{className:f.default.mrIconAction}),V]})),a.jsx("button",e.__assign({type:"button",onClick:function(e){e.stopPropagation(),Pe(!0),setTimeout(function(){Pe(!1)},3e3),Re()},className:"".concat(f.default.mrActionButton," ").concat(f.default.mrActionButtonPrimary)},{children:Z}))]}))]}))})]})),a.jsxs("div",e.__assign({className:f.default.mrMainContent},{children:[a.jsxs("div",e.__assign({className:f.default.mrEscalationContainer},{children:[a.jsxs("div",e.__assign({className:f.default.mrEscalationHeaderWrapper,onClick:function(e){e.stopPropagation(),Be(function(e){return!e})}},{children:[a.jsxs("div",e.__assign({className:f.default.mrEscalationHeader},{children:[a.jsxs("div",e.__assign({className:f.default.mrEscalationTitleWrapper},{children:[a.jsx("div",e.__assign({className:f.default.mrEscalationTitleText},{children:ae})),a.jsx("div",e.__assign({className:f.default.mrTooltipIcon},{children:a.jsx(n.InfoIcon,{stroke:"#64748B",className:f.default.mrIconInfo})}))]})),a.jsxs("div",e.__assign({className:f.default.mrEscalationActions},{children:[Fe&&a.jsxs("button",e.__assign({className:f.default.mrEscalationPreviewButton},{children:[a.jsx("div",e.__assign({className:f.default.mrEscalationPreviewIcon},{children:a.jsx(n.Mail,{className:f.default.mrIconPreview})})),a.jsx("span",e.__assign({className:f.default.mrEscalationPreviewText},{children:V}))]})),a.jsx("button",e.__assign({type:"button",onClick:function(e){e.stopPropagation(),Be(function(e){return!e})},className:f.default.mrChevronButton},{children:a.jsx(n.ChevronDown,{className:"".concat(f.default.mrChevronIcon," ").concat(Ae?f.default.mrChevronRotated:"")})}))]}))]})),a.jsx("div",e.__assign({className:f.default.mrEscalationDescription},{children:ne}))]})),a.jsx(r.AnimatePresence,e.__assign({initial:!1},{children:Ae&&a.jsx(r.motion.div,e.__assign({layout:!0,initial:{opacity:0,scaleY:.96},animate:{opacity:1,scaleY:1},exit:{opacity:0,scaleY:.96},transition:{duration:.3,ease:"easeInOut"},style:{transformOrigin:"top",overflow:"hidden"}},{children:a.jsx(r.Reorder.Group,e.__assign({axis:"y",values:R||[],onReorder:function(e){D(e)},layoutScroll:!0,className:f.default.mrReorderGroup},{children:null==R?void 0:R.map(function(s,i){var u,m,_=Qe[i]||P[i];return a.jsx(r.Reorder.Item,e.__assign({value:s,dragControls:Ge,layout:"position",className:""},{children:a.jsxs("div",e.__assign({className:f.default.mrReminderItem},{children:[a.jsx("div",e.__assign({className:f.default.mrReminderLabelBox},{children:a.jsx("div",e.__assign({className:f.default.mrReminderLabelInner},{children:a.jsx(t.Chip,{label:S[i],sx:{backgroundColor:I[i].bg,minWidth:90,color:I[i].text,fontWeight:500}})}))})),a.jsxs("div",e.__assign({className:f.default.mrReminderContent},{children:[a.jsx("div",e.__assign({className:f.default.mrDragHandle},{children:a.jsx(h.default,{onPointerDown:function(e){return Ge.start(e)},sx:{color:"#9e9e9e"}})})),a.jsx(t.Box,e.__assign({display:"flex",alignItems:"center",gap:2,border:"1px solid #E5E7EB",sx:{background:"#fff"},className:f.default.mrReminderBox},{children:a.jsxs("div",e.__assign({className:f.default.mrReminderFields},{children:[a.jsxs("div",e.__assign({className:f.default.mrReminderHeader},{children:[a.jsxs("div",e.__assign({className:f.default.mrReminderAssignee},{children:[a.jsx("div",e.__assign({className:f.default.mrReminderAvatar},{children:a.jsx("span",e.__assign({className:f.default.mrReminderInitials},{children:Ke(null==_?void 0:_.name)}))})),a.jsx("span",e.__assign({className:f.default.mrReminderName},{children:null==_?void 0:_.name}))]})),a.jsx("div",e.__assign({className:f.default.mrReminderStatement,style:{backgroundColor:null===(u=A[i])||void 0===u?void 0:u.bg}},{children:a.jsx("span",e.__assign({className:f.default.mrReminderStatementText,style:{color:null===(m=A[i])||void 0===m?void 0:m.text}},{children:te(s)}))}))]})),a.jsxs("div",e.__assign({className:f.default.mrReminderDateFields},{children:[a.jsxs("div",e.__assign({className:f.default.mrReminderField},{children:[a.jsx("p",e.__assign({className:f.default.mrReminderFieldLabel},{children:le})),a.jsxs("div",e.__assign({className:f.default.mrReminderDatePicker},{children:[a.jsx(d.LocalizationProvider,e.__assign({dateAdapter:o.AdapterDayjs},{children:a.jsx(d.DatePicker,{value:s.reminder_start_date?x.default(s.reminder_start_date):null,disablePast:!0,format:"MM/DD/YYYY",onChange:function(e){if(!e||!x.default(e).isBefore(x.default(),"day")){var a=e?x.default(e).toISOString():"";!function(e,a){Ue(e,"reminder_start_date",a)}(i,e?x.default(a).toISOString():"")}},slotProps:{actionBar:{actions:["clear"]},textField:{fullWidth:!0,size:"small",sx:k,placeholder:"MM/DD/YYYY"},openPickerButton:{id:"trial-start-date-picker-icon","data-testid":"trial-start-date-picker-icon",size:"small"},openPickerIcon:{sx:{fontSize:"14px"}}}})})),a.jsx(n.ArrowRight,{className:f.default.mrIconArrow})]}))]})),a.jsxs("div",e.__assign({className:f.default.mrReminderField},{children:[a.jsx("p",e.__assign({className:f.default.mrReminderFieldLabel},{children:oe})),a.jsx("div",e.__assign({className:f.default.mrReminderDueDate},{children:(null==l?void 0:l.due_at)?x.default(l.due_at).format("MM/DD/YYYY"):""}))]})),a.jsxs("div",e.__assign({className:f.default.mrReminderField},{children:[a.jsx("p",e.__assign({className:f.default.mrReminderFieldLabel},{children:ue})),a.jsxs("div",e.__assign({className:f.default.mrReminderFrequency},{children:[a.jsx("span",e.__assign({className:f.default.mrReminderFrequencyText},{children:"Every"})),a.jsx(c.default,{value:s.reminder_frequency,onChange:function(e){return function(e,a){Ue(e,"reminder_frequency",a)}(i,e)},options:Ne,suffix:"hours"})]}))]}))]})),a.jsxs("div",e.__assign({className:f.default.mrEscalationCheckbox},{children:[a.jsxs("div",e.__assign({className:f.default.mrEscalationCheckboxHeader},{children:[a.jsx(v.default,{size:"small",disableRipple:!0,checked:s.is_escalation_reminder,onChange:function(e){!function(e,a){Ue(e,"is_escalation_reminder",a),a||(Ue(e,"days",{type:"preset",value:""}),Ue(e,"escalation_reminder_frequency",{type:"preset",value:""}),Ue(e,"before_or_after",""))}(i,e.target.checked)},icon:a.jsx("div",{className:f.default.mrCheckboxUnchecked}),checkedIcon:a.jsx("div",e.__assign({className:f.default.mrCheckboxChecked},{children:a.jsx("svg",e.__assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 12 10",fill:"none",className:f.default.mrCheckboxIcon},{children:a.jsx("path",{d:"M1 5L4.2 8L11 1",stroke:"#5925DC",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})}))})),sx:{padding:0}}),fe,a.jsx("div",e.__assign({className:f.default.mrTooltipIcon},{children:a.jsx(n.InfoIcon,{stroke:"#64748B",className:f.default.mrIconInfo})}))]})),a.jsx(r.AnimatePresence,{children:s.is_escalation_reminder&&a.jsxs(r.motion.div,e.__assign({initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.3},className:f.default.mrEscalationContent},{children:[a.jsx("div",e.__assign({className:f.default.mrEscalationCondition},{children:ve})),a.jsxs("div",e.__assign({className:f.default.mrEscalationFields},{children:[a.jsxs("div",e.__assign({className:f.default.mrEscalationFieldGroup},{children:[a.jsx(c.default,{value:s.days,onChange:function(e){return function(e,a){Ue(e,"days",a)}(i,e)}}),a.jsx("div",e.__assign({className:f.default.mrEscalationFieldText},{children:xe}))]})),a.jsxs("div",e.__assign({className:"".concat(f.default.mrEscalationFieldGroup," ").concat(f.default.mrEscalationFieldGroupLarge)},{children:[a.jsx(t.Autocomplete,{size:"small",options:ke,value:s.before_or_after,onChange:function(e,a){!function(e,a){Ue(e,"before_or_after",a)}(i,a||"")},popupIcon:a.jsx("button",e.__assign({type:"button",id:"dropdown-icon",className:f.default.mrDropdownButton},{children:a.jsx(n.ChevronDown,{className:f.default.mrIconDropdown})})),slotProps:{paper:{sx:{"& .MuiAutocomplete-option":{fontSize:"12px",minHeight:"32px"}}},clearIndicator:{sx:{"& svg":{fontSize:12}}}},renderInput:function(s){return a.jsx(t.TextField,e.__assign({},s,{placeholder:"Select value",sx:k}))},sx:{width:"100%"}}),a.jsx("div",e.__assign({className:f.default.mrEscalationFieldText},{children:pe}))]})),a.jsx("div",e.__assign({className:f.default.mrEscalationFieldGroupSmall},{children:a.jsx(c.default,{value:s.escalation_reminder_frequency,onChange:function(e){return function(e,a){Ue(e,"escalation_reminder_frequency",a)}(i,e)},options:ye,suffix:"hours"})}))]}))]}))})]}))]}))}))]}))]}))}),s.id||i)})}))}))}))]})),Ae&&a.jsxs(r.motion.div,e.__assign({initial:{width:Oe?"345px":"43px"},animate:{width:Oe?"345px":"43px"},transition:{duration:.3},className:f.default.mrCalendarPanel},{children:[Oe?a.jsx(u.default,{assignees:m}):a.jsx("div",e.__assign({className:f.default.mrCalendarCollapsed},{children:a.jsx(n.CalendarIcon,{className:f.default.mrIconCalendar})})),a.jsxs("button",e.__assign({onClick:function(){return Ye(function(e){return!e})},className:f.default.mrCalendarToggle},{children:[a.jsx("svg",e.__assign({xmlns:"http://www.w3.org/2000/svg",width:"19",height:"50",viewBox:"0 0 19 50",fill:"none"},{children:a.jsx("path",{d:"M3.94434 9.65137C1.79601 11.031 0.49707 13.4087 0.49707 15.9619V35.1436C0.49707 37.8496 1.95476 40.346 4.31152 41.6758L17.5469 49.1426V0.915039L3.94434 9.65137Z",fill:"white",stroke:"#E0E0E0"})})),Oe?a.jsx(n.ChevronRight,{className:f.default.mrIconChevronToggle}):a.jsx(n.ChevronLeft,{className:f.default.mrIconChevronToggle})]}))]}))]}))]}))};
|
|
2
|
+
//# sourceMappingURL=ManageReminders.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ManageReminders.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),o=require("@mui/material"),r=require("lucide-react"),u=["1/2","1","2","3","4","Custom"];exports.default=function(i){var s=i.value,p=i.onChange,a=i.options,l=void 0===a?u:a,c=i.placeholder,d=void 0===c?"Select frequency":c,v=i.suffix,x=n.useState(""),f=x[0],m=x[1],_=n.useState(null),g=_[0],h=_[1],y=n.useState(!1),I=y[0],j=y[1];return n.useEffect(function(){return s?"custom"===s.type?(j(!0),h(null),void m(s.value||"")):(j(!1),h(s.value),void m(s.value)):(h(null),m(""),void j(!1))},[s]),t.jsx(o.Autocomplete,{size:"small",freeSolo:I,options:l,value:g,inputValue:f,popupIcon:t.jsx("button",e.__assign({type:"button",id:"dropdown-icon",className:"cursor-pointer flex items-center justify-center"},{children:t.jsx(r.ChevronsUpDownIcon,{className:"w-3 h-3"})})),onChange:function(e,t){return t?"Custom"===t?(j(!0),h(null),m(""),void p({type:"custom",value:""})):(j(!1),h(t),m(t),void p({type:"preset",value:t})):(h(null),m(""),j(!1),void p(null))},slotProps:{paper:{sx:{"& .MuiAutocomplete-option":{fontSize:"12px",minHeight:"32px"}}},clearIndicator:{sx:{"& svg":{fontSize:12}}}},onInputChange:function(e,t,n){if(I){var o=t.replace(/[^\d]/g,"");m(o),"input"===n&&p({type:"custom",value:o})}},renderInput:function(n){return t.jsx(o.TextField,e.__assign({},n,{placeholder:I?"Enter custom value":d,inputProps:e.__assign(e.__assign({},n.inputProps),{inputMode:I?"numeric":void 0,readOnly:!I}),InputProps:e.__assign(e.__assign({},n.InputProps),{endAdornment:I&&v?t.jsxs(t.Fragment,{children:[t.jsx(o.InputAdornment,e.__assign({position:"end"},{children:t.jsx("span",e.__assign({style:{fontSize:"11px",color:"#888",whiteSpace:"nowrap"}},{children:v}))})),n.InputProps.endAdornment]}):n.InputProps.endAdornment}),sx:{"& .MuiInputBase-root":{height:"28px",borderRadius:"4px",fontSize:"11px",width:"100%",cursor:I?"text":"pointer"},"& input":{cursor:I?"text":"pointer"}},onKeyDown:function(e){I&&"Enter"===e.key&&(e.preventDefault(),e.stopPropagation())}}))},sx:{width:"100%"}})};
|
|
2
|
+
//# sourceMappingURL=ReminderFrequencyAutocomplete.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReminderFrequencyAutocomplete.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),a=require("react/jsx-runtime"),i=require("react"),s=require("../Popups/PopupDefaults.js"),n=require("react-markdown"),c=require("rehype-raw"),t=require("./CitationComponent.module.css.js"),l=require("lucide-react"),d=require("../icons/cognitiveBrain.svg.js"),r=require("../icons/aiMagic.svg.js"),o=require("./CitationAnchor.js");function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=_(i),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),a=require("react/jsx-runtime"),i=require("react"),s=require("../Popups/PopupDefaults.js"),n=require("react-markdown"),c=require("rehype-raw"),t=require("./CitationComponent.module.css.js"),l=require("lucide-react"),d=require("../icons/cognitiveBrain.svg.js"),r=require("../icons/aiMagic.svg.js"),o=require("./CitationAnchor.js");function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=_(i),f=_(n),x=_(c),m=function(i){var s=i.text,n=i.item;return a.jsx(f.default,e.__assign({rehypePlugins:[x.default],components:{ol:function(i){var s=i.children;return a.jsx("ol",e.__assign({className:t.default["md-ol"]},{children:s}))},ul:function(i){var s=i.children;return a.jsx("ul",e.__assign({className:t.default["md-ul"]},{children:s}))},li:function(i){var s=i.children;return a.jsx("li",e.__assign({className:t.default["md-li"]},{children:s}))},a:function(e){e.node;var i=e.href,s=e.children;return a.jsx(o.default,{href:i,children:s,metaData:{citations:n.citations,docData:n.docData}})}}},{children:s.replace(/<br\s*\/?>/gi,"\n")}))};exports.default=function(n){var c=n.item,o=n.title,_=void 0===o?"Cognitive Decisioning AI":o,f=n.relevanceScore,x=void 0===f?0:f,g=n.showRelevanceScore,v=void 0===g||g,h=n.reason,j=void 0===h?"No reasoning provided.":h,p=n.impact,N=void 0===p?"No Impact provided.":p,b=n.explaination,y=void 0===b?"No explaination provided.":b,C=n.gap,k=void 0===C?"None":C,B=n.onClose,H=void 0===B?function(){}:B,q=n.onAccept,D=n.onReject,A=n.showResolveBtns,T=void 0!==A&&A,I=n.sections,L=n.leftIcon,M=n.scoreIcon,w=n.className,P=n.customStyles,R=void 0===P?{}:P,S=n.actions,E=n.disableAllActions,F=void 0!==E&&E,G=n.actionBtnDisabledStyle,U=void 0===G?{}:G,O=n.onBackClick,z=n.isImpactNeeded,J=void 0===z||z,K=n.cognitiveTitle,Q=void 0===K?"Cognitive Integrity":K,V=n.labels,W=void 0===V?{}:V,X=i.useMemo(function(){var e=Number(x);return Number.isNaN(e)?0:Math.max(0,Math.min(100,Math.round(e)))},[x]),Y=i.useMemo(function(){var e=W&&W.noGapsText||"1. No gaps identified.";return function(e){if(!e)return!0;var a=e.trim().toLowerCase();return"none"===a||"no gap"===a||"no gaps"===a||"n/a"===a}(k)?e:k},[k]),Z=W&&W.impact||"Impact",$=W&&W.explanation||"Explaination",ee=W&&W.decisionFactors||"Decision Making Factors",ae=W&&W.gaps||"Gaps in Decision",ie=W&&W.accept||"Accept",se=W&&W.reject||"Reject",ne=W&&W.backAriaLabel||"Go back",ce=S||[{id:"reject",label:se,onClick:D,className:t.default["btn-reject"]},{id:"accept",label:ie,onClick:q,className:t.default["btn-accept"]}];return a.jsxs("div",e.__assign({className:"".concat(t.default["cite-acc"]," ").concat(w||""),style:e.__assign(e.__assign({},s.default.CitationAccordionDefaults.container),null==R?void 0:R.container)},{children:[O&&a.jsxs("div",e.__assign({className:t.default["cite-acc__backHeader"]},{children:[a.jsx("button",e.__assign({type:"button",className:t.default["cite-acc__backBtn"],onClick:function(e){e.stopPropagation(),O&&O()},"aria-label":ne},{children:"‹"})),a.jsx("span",e.__assign({className:t.default["cite-acc__backTitle"]},{children:Q}))]})),I&&I.length>0?I.map(function(i){return!1===i.show?null:a.jsxs("div",e.__assign({className:"".concat(t.default["cite-acc__explain-body"]," ").concat(i.bodyClassName||"")},{children:[a.jsxs("div",e.__assign({className:t.default["cite-acc__innerHeader"],style:e.__assign(e.__assign({},s.default.CitationAccordionDefaults.innerHeader),null==R?void 0:R.innerHeader)},{children:[a.jsx("div",e.__assign({className:t.default["cite-acc__innerHeaderLeft"]},{children:a.jsx("div",{children:a.jsx("div",e.__assign({className:t.default["cite-acc__innerTitle"]},{children:i.title}))})})),a.jsx("button",e.__assign({type:"button",onClick:function(e){e.stopPropagation(),H&&H()}},{children:a.jsx(l.ChevronUp,{})}))]})),a.jsx("div",e.__assign({className:"".concat(t.default["cite-acc__innerBody"]," text-sm text-gray-600"),style:e.__assign(e.__assign({},s.default.CitationAccordionDefaults.innerBody),null==R?void 0:R.innerBody)},{children:"string"==typeof i.content?a.jsx(m,{text:i.content,item:i.item||c||{}}):i.content}))]}),i.id||i.title)}):a.jsxs(a.Fragment,{children:[J&&a.jsxs("div",e.__assign({className:t.default["cite-acc__explain-body"]},{children:[a.jsxs("div",e.__assign({className:t.default["cite-acc__innerHeader"]},{children:[a.jsx("div",e.__assign({className:t.default["cite-acc__innerHeaderLeft"]},{children:a.jsx("div",{children:a.jsx("div",e.__assign({className:t.default["cite-acc__innerTitle"]},{children:Z}))})})),a.jsx("button",e.__assign({type:"button",onClick:function(e){e.stopPropagation(),H&&H()}},{children:a.jsx(l.ChevronUp,{})}))]})),a.jsx("div",e.__assign({className:"".concat(t.default["cite-acc__innerBody"]," text-sm text-gray-600")},{children:a.jsx(m,{text:N||"",item:c||{}})}))]})),a.jsxs("div",e.__assign({className:t.default["cite-acc__explain-body"]},{children:[a.jsx("div",e.__assign({className:t.default["cite-acc__innerHeader"]},{children:a.jsx("div",e.__assign({className:t.default["cite-acc__innerHeaderLeft"]},{children:a.jsx("div",{children:a.jsx("div",e.__assign({className:t.default["cite-acc__innerTitle"]},{children:$}))})}))})),a.jsx("div",e.__assign({className:"".concat(t.default["cite-acc__innerBody"]," text-sm text-gray-600")},{children:a.jsx(m,{text:y||"",item:{}})}))]})),T&&a.jsx("div",e.__assign({className:t.default["cite-acc__btn-container"]},{children:ce.map(function(i){var s=F||i.disabled;return a.jsx("button",e.__assign({className:i.className,onClick:s?void 0:i.onClick,disabled:s,style:e.__assign(e.__assign({},i.style),s?e.__assign(e.__assign({opacity:.5,cursor:"not-allowed"},U),i.disabledStyle):{})},{children:i.label}),i.id)})})),a.jsxs("div",e.__assign({className:t.default["cite-acc__header"]},{children:[a.jsxs("div",e.__assign({className:t.default["cite-acc__headerLeft"]},{children:[a.jsx("span",e.__assign({className:t.default["cite-acc__titleIcon"]},{children:L?"function"==typeof L?u.default.createElement(L):L:a.jsx(d.ReactComponent,{})})),a.jsx("div",e.__assign({className:t.default["cite-acc__title"]},{children:_}))]})),a.jsx("div",e.__assign({className:t.default["cite-acc__headerRight"]},{children:v&&a.jsxs("span",e.__assign({className:t.default["cite-acc__scoreBadge"]},{children:[M?"function"==typeof M?u.default.createElement(M):M:a.jsx(r.ReactComponent,{}),a.jsxs("span",e.__assign({className:t.default["cite-acc__scoreText"]},{children:[X,"%"]}))]}))}))]})),a.jsxs("div",e.__assign({className:t.default["cite-acc__explain-body"]},{children:[a.jsx("div",e.__assign({className:t.default["cite-acc__innerHeader"]},{children:a.jsx("div",e.__assign({className:t.default["cite-acc__innerHeaderLeft"]},{children:a.jsx("div",{children:a.jsx("div",e.__assign({className:t.default["cite-acc__innerTitle"]},{children:ee}))})}))})),a.jsx("div",e.__assign({className:"".concat(t.default["cite-acc__innerBody"]," text-sm text-gray-600")},{children:a.jsx(m,{text:j||"",item:c||{}})}))]})),a.jsxs("div",e.__assign({className:"".concat(t.default["cite-acc__explain-body"]," ").concat(t.default["cite-acc__explain-body_border"])},{children:[a.jsx("div",e.__assign({className:t.default["cite-acc__innerHeader"]},{children:a.jsx("div",e.__assign({className:t.default["cite-acc__innerHeaderLeft"]},{children:a.jsx("div",{children:a.jsx("div",e.__assign({className:t.default["cite-acc__innerTitle"]},{children:ae}))})}))})),a.jsx("div",e.__assign({className:"".concat(t.default["cite-acc__innerBody"]," text-sm text-gray-600")},{children:a.jsx(m,{text:Y||"",item:c||{}})}))]}))]})]}))};
|
|
2
2
|
//# sourceMappingURL=CognitiveComponent.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),n=require("lucide-react"),s=require("react"),o=require("./ToneToggle.js");require("../CognitiveComponents/CitationComponent.module.css.js");var t=require("../icons/cognitiveBrain.svg.js"),l=require("../icons/aiMagic.svg.js"),a=[{color:"#1D9E75",angle:-90,arcD:"M1 13 A10 10 0 0 1 1 13"},{color:"#BA7517",angle:0,arcD:"M1 13 A10 10 0 0 1 11 3"},{color:"#E24B4A",angle:90,arcD:"M1 13 A10 10 0 0 1 21 13"}],r=function(n){var s=n.toneIndex,o=n.configs,t=void 0===o?a:o,l=t[Math.min(s,t.length-1)]||t[1]||t[0],r=l.color,d=l.angle,c=l.arcD,g=(d-90)*Math.PI/180,_=11+9*Math.cos(g),v=13+9*Math.sin(g);return i.jsxs("svg",e.__assign({width:"22",height:"14",viewBox:"0 0 22 14",fill:"none"},{children:[i.jsx("path",{d:"M1 13 A10 10 0 0 1 21 13",stroke:"#e5e5e5",strokeWidth:"2.5",strokeLinecap:"round"}),i.jsx("path",{d:c,stroke:r,strokeWidth:"2.5",strokeLinecap:"round"}),i.jsx("line",{x1:"11",y1:"13",x2:_,y2:v,stroke:r,strokeWidth:"2",strokeLinecap:"round"})]}))},d=function(n){var s=n.type,o=n.customStyles,t=void 0===o?{}:o,l=e.__assign(e.__assign({},{High:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #FECACA",background:"#FEF2F2",color:"#B91C1C",fontSize:"11px",fontWeight:"500"},Medium:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #F2E5A1",background:"#FFFBEB",color:"#B45309",fontSize:"11px",fontWeight:"500"},Low:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #8098F9",background:"#DBEAFE",color:"#444CE7",fontSize:"11px",fontWeight:"500"}}),t),a=l[s]||l.Medium;return i.jsx("div",e.__assign({style:a},{children:s}))},c=["Lenient","Balanced","Aggressive"],g={Lenient:"#1D9E75",Balanced:"#BA7517",Aggressive:"#E24B4A"},_={width:"350px",background:"#fff",border:"1px solid #ddd",borderRadius:"8px",padding:"16px",maxHeight:"400px",overflow:"auto"},v={display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12},u={fontSize:11,fontWeight:500,letterSpacing:"0.08em",color:"#E24B4A",textTransform:"uppercase"},p={fontSize:15,fontWeight:500,margin:"0 0 8px",color:"#111"},x={fontSize:13,color:"#666",lineHeight:1.6,margin:"0 0 14px"},m={marginBottom:14,borderTop:"0.5px solid #eee",paddingTop:12},y={display:"flex",alignItems:"center",gap:6,background:"none",border:"none",cursor:"pointer",padding:0,width:"100%"},h={fontSize:11,fontWeight:500,textTransform:"uppercase",letterSpacing:"0.08em",color:"#E24B4A"},f={display:"flex",gap:8,marginBottom:18},j={flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:5,fontSize:12,fontWeight:500,padding:"7px 4px",borderRadius:8,border:"0.5px solid #ccc",background:"#fff",cursor:"pointer"},S={background:"none",border:"none",cursor:"pointer",fontSize:16,color:"#888",lineHeight:1,padding:0},b={borderTop:"0.5px solid #eee",paddingTop:14},C={display:"flex",alignItems:"center",width:"100%",background:"none",border:"none",cursor:"pointer",padding:0,marginBottom:4},I={cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"12px",borderTop:"1px solid #eee",borderBottom:"none",paddingLeft:"12px",paddingRight:"12px"},B={display:"flex",alignItems:"center",gap:"4px",minWidth:0,flex:"1 1 auto",overflow:"hidden"},k={width:"28px",height:"28px",display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 28px"},D={fontSize:"13px",color:"#101828",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},T={display:"flex",alignItems:"center",gap:"10px",flex:"0 0 auto",minWidth:0,flexWrap:"nowrap"},A={display:"flex",padding:"4px 8px",alignItems:"center",gap:"4px",borderRadius:"var(--chip-border-radius, 16px)",border:"1px solid var(--Primitive-Gray-300, #d0d5dd)",flex:"0 1 auto",minWidth:0},w={color:"var(--Primitive-Purple-600, #6938ef)",fontFamily:"Inter",fontSize:"12px",fontStyle:"normal",fontWeight:500,lineHeight:"150%"};exports.default=function(z){var R,W,E,L,M,F,H,N,q,P,O,G,X,J,K,Q,U,V,Y,Z=z.onClose,$=z.aiReason,ee=z.onAccept,ie=z.onReject,ne=z.onIterate,se=z.initialTone,oe=z.onRegenerate,te=z.labels,le=void 0===te?{}:te,ae=z.toneLevelsConfig,re=void 0===ae?c:ae,de=z.toneColorsConfig,ce=void 0===de?g:de,ge=z.dialConfigs,_e=void 0===ge?a:ge,ve=z.customStyles,ue=void 0===ve?{}:ve,pe=z.severityChipStyles,xe=void 0===pe?{}:pe,me=z.customIcons,ye=void 0===me?{}:me,he=z.onOpenCognitive,fe=z.showTone,je=void 0===fe||fe,Se=z.cognitiveSectionStyle,be=void 0===Se?{}:Se,Ce=z.cognitiveScoreBadgeStyle,Ie=void 0===Ce?{}:Ce,Be=z.cognitiveScoreTextStyle,ke=void 0===Be?{}:Be,De=z.cognitiveStyles,Te=void 0===De?{}:De,Ae=z.cognitiveClassNames,we=void 0===Ae?{}:Ae,ze=z.cognitiveTitle,Re=void 0===ze?"Cognitive Integrity":ze,We=z.cognitiveLeftIcon,Ee=z.showCognitiveRightArrow,Le=void 0===Ee||Ee,Me=re.findIndex(function(e){return e===se});-1===Me&&(Me=1);var Fe=s.useState(!0),He=Fe[0],Ne=Fe[1],qe=s.useState(!1),Pe=qe[0],Oe=qe[1],Ge=s.useState(Me),Xe=Ge[0],Je=Ge[1],Ke=s.useState(Me)[0],Qe=re[Xe],Ue=ce[Qe]||"#BA7517",Ve=Xe!==Ke;return i.jsxs("div",e.__assign({onClick:function(e){return e.stopPropagation()},style:e.__assign(e.__assign({},_),null===(R=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===R?void 0:R.root)},{children:[i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},v),null===(W=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===W?void 0:W.header)},{children:[i.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:6}},{children:[i.jsx("span",{children:ye.summaryIcon||i.jsx(n.Info,{size:16,color:"#E24B4A"})}),i.jsx("span",e.__assign({style:e.__assign(e.__assign({},u),null===(E=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===E?void 0:E.title)},{children:le.summaryHeader||"Summary"}))]})),i.jsx("button",e.__assign({onClick:Z,style:e.__assign(e.__assign({},S),null===(L=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===L?void 0:L.closeBtn)},{children:"✕"}))]})),i.jsx("p",e.__assign({style:e.__assign(e.__assign({},p),null===(M=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===M?void 0:M.bodyText)},{children:null===(F=null==$?void 0:$.deviation_details)||void 0===F?void 0:F.deviation_title})),i.jsx("p",e.__assign({style:e.__assign(e.__assign({},x),null===(H=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===H?void 0:H.summary)},{children:null===(N=null==$?void 0:$.deviation_details)||void 0===N?void 0:N.deviation_summary})),i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},m),null===(q=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===q?void 0:q.impactContainer)},{children:[i.jsxs("div",e.__assign({style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},{children:[i.jsxs("button",e.__assign({onClick:function(){return Ne(!He)},style:e.__assign(e.__assign({},y),null===(P=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===P?void 0:P.impactToggle)},{children:[i.jsx("span",e.__assign({style:e.__assign(e.__assign({},h),null===(O=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===O?void 0:O.impactToggleLabel)},{children:le.impactHeader||"Impact"})),i.jsx("span",e.__assign({style:{fontSize:12,color:"#E24B4A",transition:"transform 0.2s",display:"flex",alignItems:"center",transform:He?"rotate(180deg)":"rotate(0deg)"}},{children:i.jsx(n.ChevronDown,{size:16,color:"#E24B4A"})}))]})),i.jsx(d,{type:(null==$?void 0:$.severity)||"Medium",customStyles:xe})]})),He&&i.jsx("p",e.__assign({style:{fontSize:13,color:"#666",lineHeight:1.6,margin:"8px 0 0"}},{children:null!==(X=null===(G=null==$?void 0:$.deviation_details)||void 0===G?void 0:G.deviation_impact)&&void 0!==X?X:le.fallbackImpact||"This change reduces compliance obligations and lowers contractual risk thresholds."}))]})),i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},f),null===(J=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===J?void 0:J.actionContainer)},{children:[i.jsxs("button",e.__assign({style:e.__assign(e.__assign(e.__assign({},j),null===(K=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===K?void 0:K.actionBtn),{color:"#64748B"}),onClick:ne},{children:[ye.iterateIcon||i.jsx(n.PenLine,{size:16,color:"#64748B"}),le.btnIterate||"Iterate"]}),"Iterate"),i.jsxs("button",e.__assign({style:e.__assign(e.__assign(e.__assign({},j),null===(Q=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===Q?void 0:Q.actionBtn),{color:"#10B981"}),onClick:ee},{children:[ye.acceptIcon||i.jsx(n.CheckCircle,{size:16,color:"#10B981"}),le.btnAccept||"Approve"]}),"Accept"),i.jsxs("button",e.__assign({style:e.__assign(e.__assign(e.__assign({},j),null===(U=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===U?void 0:U.actionBtn),{color:"#DC2626"}),onClick:ie},{children:[ye.rejectIcon||i.jsx(n.XCircle,{size:16,color:"#DC2626"}),le.btnReject||"Reject"]}),"reject")]})),je&&i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},b),null===(V=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===V?void 0:V.toneContainer)},{children:[i.jsxs("button",e.__assign({onClick:function(){return Oe(!Pe)},style:e.__assign(e.__assign({},C),null===(Y=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===Y?void 0:Y.toneToggleBtn)},{children:[i.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:8}},{children:[i.jsx(r,{toneIndex:Xe,configs:_e}),i.jsx("span",e.__assign({style:{fontSize:13,fontWeight:500,color:"#111"}},{children:le.toneHeader||"Redline Tone"}))]})),i.jsx("span",e.__assign({style:{transition:"transform 0.2s",display:"flex",alignItems:"center",transform:Pe?"rotate(180deg)":"rotate(0deg)"}},{children:i.jsx(n.ChevronDown,{size:16,color:"#111"})}))]})),Pe&&i.jsxs(i.Fragment,{children:[i.jsx("p",e.__assign({style:{fontSize:12,color:"#888",margin:"0 0 12px"}},{children:le.toneDescription||"Controls how assertively AI is redlining"})),i.jsx(o.ToneToggle,{isDirty:Ve,onToneChange:function(e){Je(e)},toneColor:Ue,toneIndex:Xe,onClickRegenerate:function(){return null==oe?void 0:oe(Qe)},toneLabels:re})]})]})),he&&i.jsxs("div",e.__assign({className:null==we?void 0:we.section,onClick:function(e){e.stopPropagation(),he&&he(e)},style:e.__assign(e.__assign(e.__assign({},I),null==Te?void 0:Te.section),be)},{children:[i.jsxs("div",e.__assign({className:null==we?void 0:we.headerLeft,style:e.__assign(e.__assign({},B),null==Te?void 0:Te.headerLeft)},{children:[i.jsx("span",e.__assign({className:null==we?void 0:we.titleIcon,style:e.__assign(e.__assign({},k),null==Te?void 0:Te.titleIcon)},{children:null!=We?We:i.jsx(t.ReactComponent,{})})),i.jsx("div",e.__assign({className:null==we?void 0:we.cognitiveTitle,style:e.__assign(e.__assign({},D),null==Te?void 0:Te.cognitiveTitle)},{children:Re}))]})),i.jsxs("div",e.__assign({className:null==we?void 0:we.headerRight,style:e.__assign(e.__assign({},T),null==Te?void 0:Te.headerRight)},{children:[void 0!==(null==$?void 0:$.relevance_score)&&null!==(null==$?void 0:$.relevance_score)?i.jsxs("span",e.__assign({className:null==we?void 0:we.scoreBadge,style:e.__assign(e.__assign(e.__assign({},A),null==Te?void 0:Te.scoreBadge),Ie)},{children:[i.jsx(l.ReactComponent,{}),i.jsxs("span",e.__assign({className:null==we?void 0:we.scoreText,style:e.__assign(e.__assign(e.__assign({},w),null==Te?void 0:Te.scoreText),ke)},{children:[Math.round(Number($.relevance_score)),"%"]}))]})):null,Le&&i.jsx("span",e.__assign({style:{display:"flex",alignItems:"center"}},{children:i.jsx(n.ChevronRight,{size:16,color:"#64748B"})}))]}))]}))]}))};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),n=require("lucide-react"),s=require("react"),o=require("./ToneToggle.js");require("../CognitiveComponents/CitationComponent.module.css.js");var t=require("../icons/cognitiveBrain.svg.js"),l=require("../icons/aiMagic.svg.js"),a=[{color:"#1D9E75",angle:-90,arcD:"M1 13 A10 10 0 0 1 1 13"},{color:"#BA7517",angle:0,arcD:"M1 13 A10 10 0 0 1 11 3"},{color:"#E24B4A",angle:90,arcD:"M1 13 A10 10 0 0 1 21 13"}],r=function(n){var s=n.toneIndex,o=n.configs,t=void 0===o?a:o,l=t[Math.min(s,t.length-1)]||t[1]||t[0],r=l.color,d=l.angle,c=l.arcD,g=(d-90)*Math.PI/180,_=11+9*Math.cos(g),v=13+9*Math.sin(g);return i.jsxs("svg",e.__assign({width:"22",height:"14",viewBox:"0 0 22 14",fill:"none"},{children:[i.jsx("path",{d:"M1 13 A10 10 0 0 1 21 13",stroke:"#e5e5e5",strokeWidth:"2.5",strokeLinecap:"round"}),i.jsx("path",{d:c,stroke:r,strokeWidth:"2.5",strokeLinecap:"round"}),i.jsx("line",{x1:"11",y1:"13",x2:_,y2:v,stroke:r,strokeWidth:"2",strokeLinecap:"round"})]}))},d=function(n){var s=n.type,o=n.customStyles,t=void 0===o?{}:o,l=e.__assign(e.__assign({},{High:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #FECACA",background:"#FEF2F2",color:"#B91C1C",fontSize:"11px",fontWeight:"500"},Medium:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #F2E5A1",background:"#FFFBEB",color:"#B45309",fontSize:"11px",fontWeight:"500"},Low:{padding:"3.5px 7px",borderRadius:"100px",border:"1px solid #8098F9",background:"#DBEAFE",color:"#444CE7",fontSize:"11px",fontWeight:"500"}}),t),a=l[s]||l.Medium;return i.jsx("div",e.__assign({style:a},{children:s}))},c=["Lenient","Balanced","Aggressive"],g={Lenient:"#1D9E75",Balanced:"#BA7517",Aggressive:"#E24B4A"},_={width:"350px",background:"#fff",border:"1px solid #ddd",borderRadius:"8px",padding:"16px",maxHeight:"400px",overflow:"auto"},v={display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12},u={fontSize:11,fontWeight:500,letterSpacing:"0.08em",color:"#E24B4A",textTransform:"uppercase"},p={fontSize:15,fontWeight:500,margin:"0 0 8px",color:"#111"},x={fontSize:13,color:"#666",lineHeight:1.6,margin:"0 0 14px"},m={marginBottom:14,borderTop:"0.5px solid #eee",paddingTop:12},y={display:"flex",alignItems:"center",gap:6,background:"none",border:"none",cursor:"pointer",padding:0,width:"100%"},h={fontSize:11,fontWeight:500,textTransform:"uppercase",letterSpacing:"0.08em",color:"#E24B4A"},f={display:"flex",gap:8,marginBottom:18},S={flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:5,fontSize:12,fontWeight:500,padding:"7px 4px",borderRadius:8,border:"0.5px solid #ccc",background:"#fff",cursor:"pointer"},j={background:"none",border:"none",cursor:"pointer",fontSize:16,color:"#888",lineHeight:1,padding:0},b={borderTop:"0.5px solid #eee",paddingTop:14},C={display:"flex",alignItems:"center",width:"100%",background:"none",border:"none",cursor:"pointer",padding:0,marginBottom:4},I={cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"12px",borderTop:"1px solid #eee",borderBottom:"none",paddingLeft:"12px",paddingRight:"12px"},B={display:"flex",alignItems:"center",gap:"4px",minWidth:0,flex:"1 1 auto",overflow:"hidden"},k={width:"28px",height:"28px",display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 28px"},D={fontSize:"13px",color:"#101828",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},A={display:"flex",alignItems:"center",gap:"10px",flex:"0 0 auto",minWidth:0,flexWrap:"nowrap"},T={display:"flex",padding:"4px 8px",alignItems:"center",gap:"4px",borderRadius:"var(--chip-border-radius, 16px)",border:"1px solid var(--Primitive-Gray-300, #d0d5dd)",flex:"0 1 auto",minWidth:0},w={color:"var(--Primitive-Purple-600, #6938ef)",fontFamily:"Inter",fontSize:"12px",fontStyle:"normal",fontWeight:500,lineHeight:"150%"};exports.default=function(z){var R,W,E,L,M,F,H,N,q,P,O,G,X,J,K,Q,U=z.onClose,V=z.aiReason,Y=z.onAccept,Z=z.onReject,$=z.onIterate,ee=z.initialTone,ie=z.onRegenerate,ne=z.labels,se=void 0===ne?{}:ne,oe=z.toneLevelsConfig,te=void 0===oe?c:oe,le=z.toneColorsConfig,ae=void 0===le?g:le,re=z.dialConfigs,de=void 0===re?a:re,ce=z.actions,ge=z.disableAllActions,_e=void 0!==ge&&ge,ve=z.customStyles,ue=void 0===ve?{}:ve,pe=z.severityChipStyles,xe=void 0===pe?{}:pe,me=z.customIcons,ye=void 0===me?{}:me,he=z.onOpenCognitive,fe=z.showTone,Se=void 0===fe||fe,je=z.cognitiveSectionStyle,be=void 0===je?{}:je,Ce=z.cognitiveScoreBadgeStyle,Ie=void 0===Ce?{}:Ce,Be=z.cognitiveScoreTextStyle,ke=void 0===Be?{}:Be,De=z.cognitiveStyles,Ae=void 0===De?{}:De,Te=z.cognitiveClassNames,we=void 0===Te?{}:Te,ze=z.cognitiveTitle,Re=void 0===ze?"Cognitive Integrity":ze,We=z.cognitiveLeftIcon,Ee=z.showCognitiveRightArrow,Le=void 0===Ee||Ee,Me=z.isStreaming,Fe=te.findIndex(function(e){return e===ee});-1===Fe&&(Fe=1);var He=s.useState(!0),Ne=He[0],qe=He[1],Pe=s.useState(!1),Oe=Pe[0],Ge=Pe[1],Xe=s.useState(Fe),Je=Xe[0],Ke=Xe[1],Qe=s.useState(Fe)[0],Ue=te[Je],Ve=ae[Ue]||"#BA7517",Ye=Je!==Qe,Ze=[{id:"iterate",icon:ye.iterateIcon||i.jsx(n.PenLine,{size:16,color:"#64748B"}),label:se.btnIterate||"Iterate",color:"#64748B",onClick:$},{id:"accept",icon:ye.acceptIcon||i.jsx(n.CheckCircle,{size:16,color:"#10B981"}),label:se.btnAccept||"Approve",color:"#10B981",onClick:Y},{id:"reject",icon:ye.rejectIcon||i.jsx(n.XCircle,{size:16,color:"#DC2626"}),label:se.btnReject||"Reject",color:"#DC2626",onClick:Z}],$e=ce||Ze;return i.jsxs("div",e.__assign({onClick:function(e){return e.stopPropagation()},style:e.__assign(e.__assign({},_),null===(R=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===R?void 0:R.root)},{children:[i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},v),null===(W=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===W?void 0:W.header)},{children:[i.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:6}},{children:[i.jsx("span",{children:ye.summaryIcon||i.jsx(n.Info,{size:16,color:"#E24B4A"})}),i.jsx("span",e.__assign({style:e.__assign(e.__assign({},u),null===(E=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===E?void 0:E.title)},{children:se.summaryHeader||"Summary"}))]})),i.jsx("button",e.__assign({onClick:U,style:e.__assign(e.__assign({},j),null===(L=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===L?void 0:L.closeBtn)},{children:"✕"}))]})),i.jsx("p",e.__assign({style:e.__assign(e.__assign({},p),null===(M=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===M?void 0:M.bodyText)},{children:null===(F=null==V?void 0:V.deviation_details)||void 0===F?void 0:F.deviation_title})),i.jsx("p",e.__assign({style:e.__assign(e.__assign({},x),null===(H=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===H?void 0:H.summary)},{children:null===(N=null==V?void 0:V.deviation_details)||void 0===N?void 0:N.deviation_summary})),i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},m),null===(q=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===q?void 0:q.impactContainer)},{children:[i.jsxs("div",e.__assign({style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},{children:[i.jsxs("button",e.__assign({onClick:function(){return qe(!Ne)},style:e.__assign(e.__assign({},y),null===(P=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===P?void 0:P.impactToggle)},{children:[i.jsx("span",e.__assign({style:e.__assign(e.__assign({},h),null===(O=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===O?void 0:O.impactToggleLabel)},{children:se.impactHeader||"Impact"})),i.jsx("span",e.__assign({style:{fontSize:12,color:"#E24B4A",transition:"transform 0.2s",display:"flex",alignItems:"center",transform:Ne?"rotate(180deg)":"rotate(0deg)"}},{children:i.jsx(n.ChevronDown,{size:16,color:"#E24B4A"})}))]})),i.jsx(d,{type:(null==V?void 0:V.severity)||"Medium",customStyles:xe})]})),Ne&&i.jsx("p",e.__assign({style:{fontSize:13,color:"#666",lineHeight:1.6,margin:"8px 0 0"}},{children:null!==(X=null===(G=null==V?void 0:V.deviation_details)||void 0===G?void 0:G.deviation_impact)&&void 0!==X?X:se.fallbackImpact||"This change reduces compliance obligations and lowers contractual risk thresholds."}))]})),i.jsx("div",e.__assign({style:e.__assign(e.__assign({},f),null===(J=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===J?void 0:J.actionContainer)},{children:$e.map(function(n){var s,o,t=_e||n.disabled,l=t?e.__assign(e.__assign({cursor:"not-allowed",opacity:.5},null===(s=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===s?void 0:s.actionBtnDisabled),n.disabledStyle):{};return i.jsxs("button",e.__assign({style:e.__assign(e.__assign(e.__assign(e.__assign(e.__assign({},S),null===(o=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===o?void 0:o.actionBtn),{color:n.color}),n.style),l),onClick:t?void 0:n.onClick,disabled:t},{children:[n.icon,n.label]}),n.id)})})),Se&&i.jsxs("div",e.__assign({style:e.__assign(e.__assign({},b),null===(K=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===K?void 0:K.toneContainer)},{children:[i.jsxs("button",e.__assign({onClick:function(){return Ge(!Oe)},style:e.__assign(e.__assign({},C),null===(Q=null==ue?void 0:ue.DeviationSummaryStyles)||void 0===Q?void 0:Q.toneToggleBtn)},{children:[i.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:8}},{children:[i.jsx(r,{toneIndex:Je,configs:de}),i.jsx("span",e.__assign({style:{fontSize:13,fontWeight:500,color:"#111"}},{children:se.toneHeader||"Redline Tone"}))]})),i.jsx("span",e.__assign({style:{transition:"transform 0.2s",display:"flex",alignItems:"center",transform:Oe?"rotate(180deg)":"rotate(0deg)"}},{children:i.jsx(n.ChevronDown,{size:16,color:"#111"})}))]})),Oe&&i.jsxs(i.Fragment,{children:[i.jsx("p",e.__assign({style:{fontSize:12,color:"#888",margin:"0 0 12px"}},{children:se.toneDescription||"Controls how assertively AI is redlining"})),i.jsx(o.ToneToggle,{isDirty:Ye,onToneChange:function(e){Ke(e)},toneColor:Ve,toneIndex:Je,onClickRegenerate:function(){return null==ie?void 0:ie(Ue)},toneLabels:te,isStreaming:Me,aiReason:V})]})]})),he&&i.jsxs("div",e.__assign({className:null==we?void 0:we.section,onClick:function(e){e.stopPropagation(),he&&he(e)},style:e.__assign(e.__assign(e.__assign({},I),null==Ae?void 0:Ae.section),be)},{children:[i.jsxs("div",e.__assign({className:null==we?void 0:we.headerLeft,style:e.__assign(e.__assign({},B),null==Ae?void 0:Ae.headerLeft)},{children:[i.jsx("span",e.__assign({className:null==we?void 0:we.titleIcon,style:e.__assign(e.__assign({},k),null==Ae?void 0:Ae.titleIcon)},{children:null!=We?We:i.jsx(t.ReactComponent,{})})),i.jsx("div",e.__assign({className:null==we?void 0:we.cognitiveTitle,style:e.__assign(e.__assign({},D),null==Ae?void 0:Ae.cognitiveTitle)},{children:Re}))]})),i.jsxs("div",e.__assign({className:null==we?void 0:we.headerRight,style:e.__assign(e.__assign({},A),null==Ae?void 0:Ae.headerRight)},{children:[void 0!==(null==V?void 0:V.relevance_score)&&null!==(null==V?void 0:V.relevance_score)?i.jsxs("span",e.__assign({className:null==we?void 0:we.scoreBadge,style:e.__assign(e.__assign(e.__assign({},T),null==Ae?void 0:Ae.scoreBadge),Ie)},{children:[i.jsx(l.ReactComponent,{}),i.jsxs("span",e.__assign({className:null==we?void 0:we.scoreText,style:e.__assign(e.__assign(e.__assign({},w),null==Ae?void 0:Ae.scoreText),ke)},{children:[Math.round(Number(V.relevance_score)),"%"]}))]})):null,Le&&i.jsx("span",e.__assign({style:{display:"flex",alignItems:"center"}},{children:i.jsx(n.ChevronRight,{size:16,color:"#64748B"})}))]}))]}))]}))};
|
|
2
2
|
//# sourceMappingURL=DeviationSummary.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),t=require("./PopupDefaults.js"),o=require("../icons/History.svg.js"),s=require("../icons/message-chat-square.svg.js"),a=require("./ToneToggle.js"),r=[{id:"chat",icon:n.jsx(s.ReactComponent,{}),label:"Chat",description:"Type on what basis you want to iterate"},{id:"risk",icon:n.jsx(s.ReactComponent,{}),label:"Shift the risk",description:"Adjust how aggressive or lenient the language is"},{id:"history",icon:n.jsx(o.ReactComponent,{}),label:"Historical Recommendations",description:"Pull from past recommended clauses"}],l=[{id:"1",filename:"Mutual_DA2.pdf",excerpt:'"...shall protect Confidential Information using at least the same degree of care as it uses to protect its own confidential information, but no less than reasonable c..."',tab:"Balanced"},{id:"2",filename:"Tech NDA.pdf",excerpt:'"...protect confidential information using reasonable care and appropriate safeguards..."',tab:"Balanced"},{id:"3",filename:"Corp NDA.pdf",excerpt:'"...shall use best efforts to protect any disclosed confidential materials from unauthorised access or disclosure..."',tab:"Aggressive"},{id:"4",filename:"Vendor Agreement.pdf",excerpt:'"...may use disclosed information solely for the stated purpose with no special handling required..."',tab:"Lenient"}],d=["Lenient","Balanced","Aggressive"],c={Lenient:"#1D9E75",Balanced:"#BA7517",Aggressive:"#E24B4A"},g=["Grounded","Innovative"];function f(i){var t=i.chatTitle,o=i.chatBody,s=i.mergedStyles,a=void 0===s?x:s;return n.jsx("div",e.__assign({style:a.body},{children:n.jsxs("div",e.__assign({style:a.chatBanner},{children:[n.jsx("p",e.__assign({style:a.chatBannerTitle},{children:t})),n.jsx("p",e.__assign({style:a.chatBannerBody},{children:o}))]}))}))}function p(t){var o=t.initialTone,s=t.onRiskRegenerate,r=t.riskMode,l=t.toneLevelsConfig,f=void 0===l?d:l,p=t.toneColorsConfig,u=void 0===p?c:p,h=t.riskModesConfig,y=void 0===h?g:h,m=t.mergedStyles,b=void 0===m?x:m,_=f.findIndex(function(e){return e===o});-1===
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),t=require("./PopupDefaults.js"),o=require("../icons/History.svg.js"),s=require("../icons/message-chat-square.svg.js"),a=require("./ToneToggle.js"),r=[{id:"chat",icon:n.jsx(s.ReactComponent,{}),label:"Chat",description:"Type on what basis you want to iterate"},{id:"risk",icon:n.jsx(s.ReactComponent,{}),label:"Shift the risk",description:"Adjust how aggressive or lenient the language is"},{id:"history",icon:n.jsx(o.ReactComponent,{}),label:"Historical Recommendations",description:"Pull from past recommended clauses"}],l=[{id:"1",filename:"Mutual_DA2.pdf",excerpt:'"...shall protect Confidential Information using at least the same degree of care as it uses to protect its own confidential information, but no less than reasonable c..."',tab:"Balanced"},{id:"2",filename:"Tech NDA.pdf",excerpt:'"...protect confidential information using reasonable care and appropriate safeguards..."',tab:"Balanced"},{id:"3",filename:"Corp NDA.pdf",excerpt:'"...shall use best efforts to protect any disclosed confidential materials from unauthorised access or disclosure..."',tab:"Aggressive"},{id:"4",filename:"Vendor Agreement.pdf",excerpt:'"...may use disclosed information solely for the stated purpose with no special handling required..."',tab:"Lenient"}],d=["Lenient","Balanced","Aggressive"],c={Lenient:"#1D9E75",Balanced:"#BA7517",Aggressive:"#E24B4A"},g=["Grounded","Innovative"];function f(i){var t=i.chatTitle,o=i.chatBody,s=i.mergedStyles,a=void 0===s?x:s;return n.jsx("div",e.__assign({style:a.body},{children:n.jsxs("div",e.__assign({style:a.chatBanner},{children:[n.jsx("p",e.__assign({style:a.chatBannerTitle},{children:t})),n.jsx("p",e.__assign({style:a.chatBannerBody},{children:o}))]}))}))}function p(t){var o=t.initialTone,s=t.onRiskRegenerate,r=t.riskMode,l=t.toneLevelsConfig,f=void 0===l?d:l,p=t.toneColorsConfig,u=void 0===p?c:p,h=t.riskModesConfig,y=void 0===h?g:h,m=t.mergedStyles,b=void 0===m?x:m,_=t.isStreaming,v=t.aiReason,C=f.findIndex(function(e){return e===o});-1===C&&(C=1);var j=i.useState(r||y[0]||"Grounded"),k=j[0],S=j[1],B=i.useState(C),R=B[0],T=B[1],A=i.useState(C)[0],w=f[R],z=u[w]||"#BA7517",L=R!==A||r!==k;return n.jsxs("div",e.__assign({style:b.body},{children:[n.jsx("div",e.__assign({style:{display:"flex",gap:8,marginBottom:16}},{children:y.map(function(i){return n.jsxs("button",e.__assign({onClick:function(){return S(i)},style:{flex:1,display:"flex",alignItems:"center",gap:8,padding:"10px 12px",borderRadius:10,border:"1px solid ".concat(k===i?"#7c5cbf":"#e0ddd8"),background:"#fff",cursor:"pointer",fontSize:13,fontWeight:500,color:"#1a1a1a"}},{children:[n.jsx("span",e.__assign({style:{width:16,height:16,borderRadius:"50%",border:"2px solid ".concat(k===i?"#7c5cbf":"#ccc"),display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}},{children:k===i&&n.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:"#7c5cbf"}})})),i.charAt(0).toUpperCase()+i.slice(1)]}),i)})})),n.jsx(a.ToneToggle,{onToneChange:function(e){return T(e)},toneColor:z,isDirty:L,toneIndex:R,onClickRegenerate:function(){return null==s?void 0:s({tone:w,mode:k})},isStreaming:_,aiReason:v})]}))}function u(t){var o=t.onApply,s=t.historicalClausesData,a=void 0===s?l:s,r=t.toneLevelsConfig,c=void 0===r?d:r,g=t.mergedStyles,f=void 0===g?x:g,p=c.length>1?c[1]:c[0]||"Balanced",u=i.useState(p),h=u[0],y=u[1],m=a.filter(function(e){return e.tab===h});return n.jsxs("div",e.__assign({style:f.body},{children:[n.jsx("div",e.__assign({style:f.segmentedControl},{children:c.map(function(i){return n.jsx("button",e.__assign({onClick:function(){return y(i)},style:e.__assign(e.__assign({},f.segmentedBtn),h===i?f.segmentedBtnActive:{})},{children:i.charAt(0).toUpperCase()+i.slice(1)}),i)})})),n.jsxs("div",e.__assign({style:{display:"flex",flexDirection:"column",gap:10,marginTop:12}},{children:[m.map(function(i){return n.jsxs("button",e.__assign({onClick:function(){return null==o?void 0:o({type:"history",value:i.excerpt})},style:f.clauseCard},{children:[n.jsx("p",e.__assign({style:f.clauseFilename},{children:i.filename})),n.jsx("p",e.__assign({style:f.clauseExcerpt},{children:i.excerpt}))]}),i.id)}),0===m.length&&n.jsx("p",e.__assign({style:{fontSize:12,color:"#aaa",textAlign:"center",padding:"12px 0"}},{children:"No clauses for this tone"}))]}))]}))}function h(e){var i=e.type,t=e.onRiskRegenerate,o=e.initialTone,s=e.riskMode,a=e.onApply,r=e.chatTitle,l=e.chatBody,d=e.historicalClausesData,c=e.toneLevelsConfig,g=e.toneColorsConfig,h=e.riskModesConfig,y=e.mergedStyles,m=void 0===y?x:y,b=e.isStreaming,_=e.aiReason;return"chat"===i?n.jsx(f,{chatTitle:r,chatBody:l,mergedStyles:m}):"risk"===i?n.jsx(p,{onRiskRegenerate:t,initialTone:o,riskMode:s,toneLevelsConfig:c,toneColorsConfig:g,riskModesConfig:h,mergedStyles:m,isStreaming:b,aiReason:_}):"history"===i?n.jsx(u,{onApply:a,historicalClausesData:d,toneLevelsConfig:c,mergedStyles:m}):null}var x={card:{background:"#fff",border:"0.5px solid #e8e7e3",borderRadius:14,width:300,maxHeight:"350px",overflow:"auto",fontFamily:"system-ui, sans-serif"},header:{display:"flex",alignItems:"center",gap:8,padding:"14px 16px",borderBottom:"0.5px solid #e8e7e3"},backBtn:{background:"none",border:"none",cursor:"pointer",fontSize:20,color:"#888",padding:0,lineHeight:1},headerTitle:{fontSize:14,fontWeight:500,color:"#1a1a1a"},row:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 16px",cursor:"pointer",border:"none",textAlign:"left",gap:10,boxSizing:"border-box",backgroundColor:"transparent"},rowLeft:{display:"flex",alignItems:"flex-start",gap:10,flex:1},icon:{fontSize:16,color:"#666",marginTop:1,flexShrink:0},label:{margin:0,fontSize:14,fontWeight:500,color:"#1a1a1a"},desc:{margin:"2px 0 0",fontSize:12,color:"#888",lineHeight:1.4},chevron:{fontSize:18,color:"#aaa",flexShrink:0,display:"inline-block",transition:"transform 0.2s"},body:{padding:"0 16px 14px 16px"},chatBanner:{background:"#eef4fd",border:"1px solid #c5d8f7",borderRadius:10,padding:"12px 14px",marginBottom:10},chatBannerTitle:{margin:"0 0 6px",fontSize:14,fontWeight:600,color:"#3a5a8a"},chatBannerBody:{margin:0,fontSize:13,color:"#4a6080",lineHeight:1.5},applyBtn:{display:"flex",padding:"7px 10.5px",justifyContent:"center",alignItems:"center",gap:"7px",marginTop:8,fontSize:13,borderRadius:6,border:"1px solid #2563EB",background:"#2563EB",color:"#fff"},rangeLabel:{fontSize:12,color:"#888"},segmentedControl:{border:"1px solid #F2F4F7",display:"flex",background:"#F9FAFB",borderRadius:4,padding:6,gap:8},segmentedBtn:{flex:1,padding:"7px 0",fontSize:13,fontWeight:500,color:"#888",background:"transparent",border:"none",borderRadius:8,cursor:"pointer",transition:"background 0.15s, color 0.15s"},segmentedBtnActive:{background:"#dce8fa",color:"#2a4a7a",fontWeight:700},clauseCard:{background:"#fff",border:"1px solid #dde5f0",borderRadius:12,padding:"12px 14px",textAlign:"left",cursor:"pointer",width:"100%"},clauseFilename:{margin:"0 0 6px",fontSize:13,fontWeight:600,color:"#2a4a7a"},clauseExcerpt:{margin:0,fontSize:13,color:"#4a5a70",fontStyle:"italic",lineHeight:1.5}};exports.default=function(o){var s=o.onBack,a=o.onChatClick,f=o.onRiskRegenerate,p=o.initialTone,u=o.riskMode,y=o.onApply,m=o.onTabToggle,b=o.menuItemsConfig,_=void 0===b?r:b,v=o.historicalClausesConfig,C=void 0===v?l:v,j=o.chatTitle,k=void 0===j?"Chat mode active":j,S=o.chatBody,B=void 0===S?"You are now chatting about this redline, continue the conversation in the left panel to refine or update it":S,R=o.headerTitle,T=void 0===R?"How would you like to iterate?":R,A=o.customStyles,w=void 0===A?{}:A,z=o.toneLevelsConfig,L=void 0===z?d:z,M=o.toneColorsConfig,D=void 0===M?c:M,I=o.riskModesConfig,q=void 0===I?g:I,F=o.isStreaming,H=o.aiReason,W=i.useState(null),E=W[0],G=W[1],N=e.__assign(e.__assign(e.__assign({},t.default.IterateMenuDefaults.styles),x),w);return n.jsxs("div",e.__assign({style:N.card},{children:[n.jsxs("div",e.__assign({style:N.header},{children:[n.jsx("button",e.__assign({onClick:s,style:N.backBtn,"aria-label":"Go back"},{children:"‹"})),n.jsx("span",e.__assign({style:N.headerTitle},{children:T}))]})),_.map(function(i,t){var o=E===i.id;return n.jsxs("div",e.__assign({style:{borderBottom:t<_.length-1?"0.5px solid #e8e7e3":"none"}},{children:[n.jsxs("button",e.__assign({onClick:function(){return e=i.id,G(function(n){return n===e?null:("chat"===e&&(null==a||a()),m&&m(e),e)});var e},style:N.row},{children:[n.jsx("div",e.__assign({style:N.rowLeft},{children:n.jsxs("div",{children:[n.jsx("p",e.__assign({style:N.label},{children:i.label})),n.jsx("p",e.__assign({style:N.desc},{children:i.description}))]})})),n.jsx("span",e.__assign({style:e.__assign(e.__assign({},N.chevron),{transform:o?"rotate(90deg)":"rotate(0deg)"})},{children:"›"}))]})),n.jsx("div",e.__assign({style:{maxHeight:o?400:0,overflow:"hidden",transition:"max-height 0.25s ease"}},{children:n.jsx(h,{type:i.id,onRiskRegenerate:f,initialTone:p,riskMode:u,onApply:y,chatTitle:k,chatBody:B,historicalClausesData:C,toneLevelsConfig:L,toneColorsConfig:D,riskModesConfig:q,mergedStyles:N,aiReason:H,isStreaming:F})}))]}),i.id)})]}))};
|
|
2
2
|
//# sourceMappingURL=IterateComponent.js.map
|
package/dist/cjs/features/RequirementAI/components/UserStoryCard/Popups/RedlineStatusCard.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),s=require("lucide-react"),n=require("react"),i=require("./PopupDefaults.js");function o(e){var t=new Date(e);return isNaN(t.getTime())?e:new Date(e).toLocaleString("en-US",{month:"2-digit",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0}).replace(" AM","AM").replace(" PM","PM")}var r=function(){return t.jsxs("svg",e.__assign({width:"22",height:"22",viewBox:"0 0 22 22",fill:"none"},{children:[t.jsx("circle",{cx:"11",cy:"11",r:"10",stroke:"#22c55e",strokeWidth:"2",fill:"#f0fdf4"}),t.jsx("path",{d:"M6.5 11.5l3 3 6-6",stroke:"#22c55e",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}))},a=function(){return t.jsxs("svg",e.__assign({width:"22",height:"22",viewBox:"0 0 22 22",fill:"none"},{children:[t.jsx("circle",{cx:"11",cy:"11",r:"10",stroke:"#ef4444",strokeWidth:"2",fill:"#fff1f2"}),t.jsx("path",{d:"M7.5 7.5l7 7M14.5 7.5l-7 7",stroke:"#ef4444",strokeWidth:"2",strokeLinecap:"round"})]}))},d=function(){return t.jsx("svg",e.__assign({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},{children:t.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#94a3b8",strokeWidth:"1.8",strokeLinecap:"round"})}))},l=function(){return t.jsxs("svg",e.__assign({width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},{children:[t.jsx("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),t.jsx("path",{d:"M1.5 13.5c0-3.038 2.462-5.5 5-5.5s5 2.462 5 5.5",stroke:"#94a3b8",strokeWidth:"1.4",strokeLinecap:"round"}),t.jsx("path",{d:"M11 8.5l1.5 1.5 2.5-2.5",stroke:"#22c55e",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]}))},c=function(){return t.jsxs("svg",e.__assign({width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},{children:[t.jsx("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),t.jsx("path",{d:"M1.5 13.5c0-3.038 2.462-5.5 5-5.5s5 2.462 5 5.5",stroke:"#94a3b8",strokeWidth:"1.4",strokeLinecap:"round"}),t.jsx("path",{d:"M11.5 8l3 3m0-3l-3 3",stroke:"#ef4444",strokeWidth:"1.4",strokeLinecap:"round"})]}))},u=function(s){var n=s.open;return t.jsx("svg",e.__assign({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",style:{transform:n?"rotate(0deg)":"rotate(180deg)",transition:"transform 0.25s ease"}},{children:t.jsx("path",{d:"M4.5 11.25L9 6.75l4.5 4.5",stroke:"#64748b",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})}))},g=function(s){var n=s.color,i=void 0===n?"#3b82f6":n;return t.jsxs("svg",e.__assign({width:"15",height:"15",viewBox:"0 0 16 16",fill:"none"},{children:[t.jsx("path",{d:"M1.5 8A6.5 6.5 0 1 0 4 3.2",stroke:i,strokeWidth:"1.5",strokeLinecap:"round"}),t.jsx("path",{d:"M1.5 3.5v4h4",stroke:i,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M8 5v3.5l2 1.5",stroke:i,strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]}))},h=function(){return t.jsxs("svg",e.__assign({width:"15",height:"15",viewBox:"0 0 16 16",fill:"none"},{children:[t.jsx("path",{d:"M13.5 8a5.5 5.5 0 1 0-1.6 3.9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round"}),t.jsx("path",{d:"M13.5 13v-4.5H9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}))},x=function(){return t.jsxs("svg",e.__assign({width:"15",height:"15",viewBox:"0 0 16 16",fill:"none"},{children:[t.jsx("path",{d:"M2 8h12M10 4l4 4-4 4",stroke:"#64748b",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M4 5l-2 3 2 3",stroke:"#64748b",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]}))};function f(s){var n=s.title,i=s.open,o=s.onToggle,r=s.children;return t.jsxs("div",e.__assign({style:{maxHeight:"170px",overflow:"auto"}},{children:[t.jsxs("div",e.__assign({onClick:o,style:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",userSelect:"none",padding:"2px 0"}},{children:[t.jsx("span",e.__assign({style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"}},{children:n})),t.jsx(u,{open:i})]})),t.jsx("div",e.__assign({style:{maxHeight:i?300:0,opacity:i?1:0,overflow:"hidden",transition:"max-height 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.25s"}},{children:r}))]}))}function _(s){var n=s.icon,i=s.label,o=s.onClick,r=s.customStyle,a=void 0===r?{}:r,d=e.__assign({display:"flex",alignItems:"center",gap:7,padding:"8px 16px",background:"#f8fafc",border:"1.5px solid #e2e8f0",borderRadius:10,cursor:"pointer",fontSize:"12px",fontWeight:600,color:"#475569",fontFamily:"inherit",transition:"background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.12s",whiteSpace:"nowrap"},a);return t.jsxs("button",e.__assign({onClick:o,style:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),s=require("lucide-react"),n=require("react"),i=require("./PopupDefaults.js");function o(e){var t=new Date(e);return isNaN(t.getTime())?e:new Date(e).toLocaleString("en-US",{month:"2-digit",day:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0}).replace(" AM","AM").replace(" PM","PM")}var r=function(){return t.jsxs("svg",e.__assign({width:"22",height:"22",viewBox:"0 0 22 22",fill:"none"},{children:[t.jsx("circle",{cx:"11",cy:"11",r:"10",stroke:"#22c55e",strokeWidth:"2",fill:"#f0fdf4"}),t.jsx("path",{d:"M6.5 11.5l3 3 6-6",stroke:"#22c55e",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}))},a=function(){return t.jsxs("svg",e.__assign({width:"22",height:"22",viewBox:"0 0 22 22",fill:"none"},{children:[t.jsx("circle",{cx:"11",cy:"11",r:"10",stroke:"#ef4444",strokeWidth:"2",fill:"#fff1f2"}),t.jsx("path",{d:"M7.5 7.5l7 7M14.5 7.5l-7 7",stroke:"#ef4444",strokeWidth:"2",strokeLinecap:"round"})]}))},d=function(){return t.jsx("svg",e.__assign({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},{children:t.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#94a3b8",strokeWidth:"1.8",strokeLinecap:"round"})}))},l=function(){return t.jsxs("svg",e.__assign({width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},{children:[t.jsx("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),t.jsx("path",{d:"M1.5 13.5c0-3.038 2.462-5.5 5-5.5s5 2.462 5 5.5",stroke:"#94a3b8",strokeWidth:"1.4",strokeLinecap:"round"}),t.jsx("path",{d:"M11 8.5l1.5 1.5 2.5-2.5",stroke:"#22c55e",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})]}))},c=function(){return t.jsxs("svg",e.__assign({width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},{children:[t.jsx("circle",{cx:"6.5",cy:"5.5",r:"2.5",stroke:"#94a3b8",strokeWidth:"1.4"}),t.jsx("path",{d:"M1.5 13.5c0-3.038 2.462-5.5 5-5.5s5 2.462 5 5.5",stroke:"#94a3b8",strokeWidth:"1.4",strokeLinecap:"round"}),t.jsx("path",{d:"M11.5 8l3 3m0-3l-3 3",stroke:"#ef4444",strokeWidth:"1.4",strokeLinecap:"round"})]}))},u=function(s){var n=s.open;return t.jsx("svg",e.__assign({width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",style:{transform:n?"rotate(0deg)":"rotate(180deg)",transition:"transform 0.25s ease"}},{children:t.jsx("path",{d:"M4.5 11.25L9 6.75l4.5 4.5",stroke:"#64748b",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})}))},g=function(s){var n=s.color,i=void 0===n?"#3b82f6":n;return t.jsxs("svg",e.__assign({width:"15",height:"15",viewBox:"0 0 16 16",fill:"none"},{children:[t.jsx("path",{d:"M1.5 8A6.5 6.5 0 1 0 4 3.2",stroke:i,strokeWidth:"1.5",strokeLinecap:"round"}),t.jsx("path",{d:"M1.5 3.5v4h4",stroke:i,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M8 5v3.5l2 1.5",stroke:i,strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]}))},h=function(){return t.jsxs("svg",e.__assign({width:"15",height:"15",viewBox:"0 0 16 16",fill:"none"},{children:[t.jsx("path",{d:"M13.5 8a5.5 5.5 0 1 0-1.6 3.9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round"}),t.jsx("path",{d:"M13.5 13v-4.5H9",stroke:"#3b82f6",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}))},x=function(){return t.jsxs("svg",e.__assign({width:"15",height:"15",viewBox:"0 0 16 16",fill:"none"},{children:[t.jsx("path",{d:"M2 8h12M10 4l4 4-4 4",stroke:"#64748b",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t.jsx("path",{d:"M4 5l-2 3 2 3",stroke:"#64748b",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})]}))};function f(s){var n=s.title,i=s.open,o=s.onToggle,r=s.children;return t.jsxs("div",e.__assign({style:{maxHeight:"170px",overflow:"auto"}},{children:[t.jsxs("div",e.__assign({onClick:o,style:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",userSelect:"none",padding:"2px 0"}},{children:[t.jsx("span",e.__assign({style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"}},{children:n})),t.jsx(u,{open:i})]})),t.jsx("div",e.__assign({style:{maxHeight:i?300:0,opacity:i?1:0,overflow:"hidden",transition:"max-height 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.25s"}},{children:r}))]}))}function _(s){var n=s.icon,i=s.label,o=s.onClick,r=s.customStyle,a=void 0===r?{}:r,d=s.disabled,l=void 0!==d&&d,c=s.disabledStyle,u=void 0===c?{}:c,g=e.__assign(e.__assign({display:"flex",alignItems:"center",gap:7,padding:"8px 16px",background:"#f8fafc",border:"1.5px solid #e2e8f0",borderRadius:10,cursor:l?"not-allowed":"pointer",fontSize:"12px",fontWeight:600,color:"#475569",fontFamily:"inherit",transition:"background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.12s",whiteSpace:"nowrap",opacity:l?.5:1},a),l?u:{});return t.jsxs("button",e.__assign({onClick:l?void 0:o,disabled:l,style:g,onMouseEnter:function(e){l||(e.currentTarget.style.background="#f1f5f9",e.currentTarget.style.transform="translateY(-1px)",e.currentTarget.style.boxShadow="0 2px 8px rgba(0,0,0,0.07)")},onMouseLeave:function(e){l||(e.currentTarget.style.background="#f8fafc",e.currentTarget.style.transform="",e.currentTarget.style.boxShadow="")}},{children:[n,i]}))}exports.ApprovedIcon=r,exports.ChevronIcon=u,exports.CloseIcon=d,exports.HistoryIcon=g,exports.IterateIcon=x,exports.RedlineCard=function(u){var p,j=u.status,k=u.onClose,b=u.impactText,v=u.secondText,y=u.actionTakenByName,m=u.actionTakenAtTime,B=void 0===m?"NA":m,C=u.onHistory,L=u.onIterate,w=u.onReinstate,R=u.onRevert,I=u.disableAllActions,S=void 0!==I&&I,M=u.impactTitle,W=void 0===M?"Impact":M,T=u.customConfigs,D=void 0===T?{}:T,A=u.customStyles,z=void 0===A?{}:A,U=n.useState(!0),H=U[0],q=U[1],F=n.useState(!0),E=F[0],N=F[1],P=n.useState(!1),O=P[0],Y=P[1],G={headerBg:"#f0fdf4",headerBorder:"#dcfce7",titleColor:"#166534",label:"Redline Approved",metaLabel:"Approved By",UserIcon:t.jsx(l,{}),StatusIcon:t.jsx(r,{}),secondTitle:"Original text",secondBg:"#f8fafc",secondBorder:"#e2e8f0",impactBox:!0,actions:[{icon:t.jsx(g,{}),label:"History",onClick:C},{icon:t.jsx(s.Undo2,{size:17}),label:"Revert",onClick:R},{icon:t.jsx(x,{}),label:"Iterate",onClick:L}]},J={headerBg:"#fff1f2",headerBorder:"#fecdd3",titleColor:"#991b1b",label:"Redline Rejected",metaLabel:"Rejected By",UserIcon:t.jsx(c,{}),StatusIcon:t.jsx(a,{}),secondTitle:"Rejected Recommendation",secondBg:"#f8fafc",secondBorder:"#e2e8f0",impactBox:!1,actions:[{icon:t.jsx(g,{color:"#3b82f6"}),label:"History",onClick:C},{icon:t.jsx(h,{}),label:"Reinstate",onClick:w},{icon:t.jsx(x,{}),label:"Iterate",onClick:L}]},K={headerBg:"#E2E8F0",headerBorder:"none",titleColor:"#1E293B",label:"Redline Reverted",metaLabel:"Reverted By",UserIcon:t.jsx(l,{}),StatusIcon:t.jsx(s.Undo2,{size:17}),secondTitle:"Reverted redline",secondBg:"#F9FAFB",secondBorder:"#D0D5DD",impactBox:!1,actions:[{icon:t.jsx(g,{}),label:"History",onClick:C},{icon:t.jsx(x,{}),label:"Iterate",onClick:L}]};p="accepted"===j?G:"rejected"===j?J:K;var Q=e.__assign(e.__assign({},p),D[j]||{});return t.jsxs("div",e.__assign({style:e.__assign(e.__assign(e.__assign({},i.default.RedlineCardDefaults.root),{animation:O?"slideOut 0.26s cubic-bezier(0.4,0,1,1) forwards":i.default.RedlineCardDefaults.root.animation||"slideIn 0.32s cubic-bezier(0.22,1,0.36,1) both"}),z.root)},{children:[t.jsxs("div",e.__assign({style:e.__assign(e.__assign(e.__assign({},i.default.RedlineCardDefaults.header),{background:Q.headerBg,borderBottom:"1.5px solid ".concat(Q.headerBorder)}),z.header)},{children:[t.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:10}},{children:[Q.StatusIcon,t.jsx("span",e.__assign({style:{fontSize:15,fontWeight:700,color:Q.titleColor,letterSpacing:"-0.01em"}},{children:Q.label}))]})),t.jsx("button",e.__assign({onClick:function(){Y(!0),k()},style:{background:"none",border:"none",cursor:"pointer",padding:4,borderRadius:6,display:"flex",alignItems:"center"}},{children:t.jsx(d,{})}))]})),t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},i.default.RedlineCardDefaults.body),z.body)},{children:[t.jsxs("div",e.__assign({style:e.__assign(e.__assign({},i.default.RedlineCardDefaults.meta),z.meta)},{children:[t.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:6,marginBottom:5}},{children:[Q.UserIcon,t.jsx("span",e.__assign({style:{fontSize:12.5,color:"#94a3b8",fontWeight:500}},{children:Q.metaLabel}))]})),t.jsxs("div",e.__assign({style:{fontSize:14,fontWeight:700,color:"#1e293b",letterSpacing:"-0.01em"}},{children:[y,", ",o(B)]}))]})),t.jsx("div",{style:e.__assign(e.__assign({},i.default.RedlineCardDefaults.divider),z.divider)}),t.jsx(f,e.__assign({title:W,open:H,onToggle:function(){return q(function(e){return!e})}},{children:t.jsx("p",e.__assign({style:e.__assign(e.__assign({},i.default.RedlineCardDefaults.impactText),z.impactText)},{children:b||""}))})),t.jsx("div",{style:e.__assign(e.__assign({},i.default.RedlineCardDefaults.divider),z.divider)}),t.jsx(f,e.__assign({title:Q.secondTitle,open:E,onToggle:function(){return N(function(e){return!e})}},{children:t.jsx("div",e.__assign({style:e.__assign(e.__assign(e.__assign({},i.default.RedlineCardDefaults.secondSection),{background:Q.secondBg,border:"1.5px solid ".concat(Q.secondBorder)}),z.secondSection)},{children:v||""}))})),t.jsx("div",e.__assign({style:e.__assign(e.__assign({},i.default.RedlineCardDefaults.actionsContainer),z.actionsContainer)},{children:Q.actions.map(function(s){return t.jsx(_,{icon:s.icon,label:s.label,onClick:s.onClick,customStyle:e.__assign(e.__assign({},s.style),z.actionBtn),disabled:S||s.disabled,disabledStyle:z.actionBtnDisabled},s.label)})}))]}))]}))},exports.ReinstateIcon=h,exports.RejectedIcon=a,exports.UserApprovedIcon=l,exports.UserRejectedIcon=c,exports.formatDate=o;
|
|
2
2
|
//# sourceMappingURL=RedlineStatusCard.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("lucide-react");exports.ToneToggle=function(i){var o=i.toneColor,r=i.toneIndex,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),n=require("lucide-react");exports.ToneToggle=function(i){var o=i.toneColor,r=i.toneIndex,a=i.isDirty,s=i.onToneChange,l=i.onClickRegenerate,d=i.toneLabels,g=void 0===d?["Lenient","Balanced","Aggressive"]:d,c=i.gradientColors,u=void 0===c?["#1D9E75","#BA7517","#E24B4A"]:c,p=i.buttonText,h=void 0===p?"Regenerate":p,f=i.customStyles,x=void 0===f?{}:f,b=i.isStreaming,m=i.aiReason,_="linear-gradient(to right, ".concat(u.join(", "),")"),v=Math.max(g.length-1,1),y=r/v*100,j=Boolean(b||(null==m?void 0:m.resolving));return t.jsxs(t.Fragment,{children:[t.jsx("div",e.__assign({style:e.__assign({width:"100%",height:8,borderRadius:"999px",background:_,marginBottom:8,position:"relative"},x.track)},{children:t.jsx("div",{style:e.__assign({position:"absolute",top:"50%",transform:"translate(-50%, -50%)",left:"".concat(y,"%"),width:12,height:12,borderRadius:"50%",border:"2px solid #fff",boxShadow:"0 0 0 1.5px "+o,transition:"left 0.2s, background 0.2s",cursor:j?"not-allowed":"pointer",opacity:j?.7:1,background:j?"#9CA3AF":o},x.thumb)})})),t.jsx("input",{type:"range",min:0,max:v,step:1,value:r,onChange:function(e){return s(Number(e.target.value))},style:{width:"100%",cursor:"pointer",marginBottom:4,accentColor:o,opacity:0,marginTop:-20,display:"block",position:"relative",zIndex:1}}),t.jsx("div",e.__assign({style:e.__assign({display:"flex",justifyContent:"space-between",marginBottom:10,marginTop:-4},x.labelsContainer)},{children:g.map(function(n){return t.jsx("span",e.__assign({style:{fontSize:11,color:"#aaa"}},{children:n}),n)})})),t.jsx("div",e.__assign({style:e.__assign({maxHeight:a?60:0,overflow:"hidden",transition:"max-height 0.25s ease"},x.buttonContainer)},{children:t.jsxs("button",e.__assign({disabled:j,style:e.__assign({display:"flex",float:"right",alignItems:"center",justifyContent:"center",gap:6,fontSize:13,fontWeight:500,padding:9,borderRadius:8,border:"none",color:"#fff",cursor:j?"not-allowed":"pointer",opacity:j?.7:1,background:j?"#9CA3AF":o},x.button),onClick:l},{children:[t.jsx(n.RefreshCw,{size:16,color:"#fff"}),h]}))}))]})};
|
|
2
2
|
//# sourceMappingURL=ToneToggle.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("tslib"),t=require("react/jsx-runtime"),e=require("react"),n=require("react-markdown"),o=require("rehype-raw"),a=require("lucide-react"),l=require("@mui/material"),s=require("./AiReasonMarkdownWrapper.module.css.js"),d=require("../../shared/ExpandableOl.js"),c=require("../citations/web-citation/WebCitationWithImageRenderer.js"),r=require("../citations/web-citation/WebCitationRenderer.js"),u=require("../citations/image-citation/ImageCitationRenderer.js"),_=require("../citations/file-citation/FileCitationRender.js"),v=require("../RequirementAIWrapper/RequirementAIWrapper.js"),m=require("../citations/stormee-citation/StormeeCitationRenderer.js"),p=require("../citations/audio-citation/WaveformCitationRenderer.js"),g=require("../citations/appmod-citation/AppmodCitationRenderer.js"),f=require("../citations/rca-citation/RCACitationRenderer.js"),h=require("../citations/readfile-citation/ReadFileCitationRenderer.js"),j=require("../citations/chat-citation/ChatCitationRenderer.js"),C=require("@e-llm-studio/citation"),x=require("../citations/big-enough/BigEnoughCitationRenderer.js");function b(i){return i&&"object"==typeof i&&"default"in i?i:{default:i}}var y=b(n),S=b(o),I=["appmode_citation","appmode_citations","appmod_citation","appmod_citations","image_citation","image_citations","audio_citation","audio_citations","document_citation","document_citations","rca_citation","rca_citations","web_citation","web_citations","code_generated","chat_citation","readfile_citation","readfile_citations","gpt_citation","gpt_citations","big_enough_block"],q=function(t,e,n){return i.__spreadArray([],t.map(function(t,o){var a=o>=e&&o<=n;return i.__assign(i.__assign({},t),{highlighted_text:a?t.message:""})}),!0)};exports.AiReasonMarkdownWrapper=function(n){var o=n.label,b=n.message,k=n.isExpandableOrderedListEnabled,M=n.customStyles,R=n.citationStyles,w=n.customIcons,N=n.onSelectProceed,F=n.isDisableProceedButton,W=n.big_enough_block,P=e.useRef(null),A=v.useRequirementAI(),L=A.citations,T=A.citationConfig,D=A.chatHistory,E=A.chatCitationConfigs,O=A.gptCitationConfigs,z=e.useMemo(function(){return{h1:function(e){e.node;var n=i.__rest(e,["node"]);return t.jsx("h1",i.__assign({className:s.default.h1,style:null==M?void 0:M.h1},{children:null==n?void 0:n.children}))},h2:function(e){e.node;var n=i.__rest(e,["node"]);return t.jsx("h2",i.__assign({className:s.default.h2,style:null==M?void 0:M.h2},{children:null==n?void 0:n.children}))},h3:function(e){e.node;var n=i.__rest(e,["node"]);return t.jsx("h2",i.__assign({className:s.default.h3,style:null==M?void 0:M.h3},{children:null==n?void 0:n.children}))},b:function(e){return e.node,i.__rest(e,["node"]),t.jsx("b",{className:s.default.bold,style:null==M?void 0:M.b})},p:function(e){e.node;var n=i.__rest(e,["node"]);return t.jsx("p",i.__assign({},n,{className:s.default.paragraph,style:null==M?void 0:M.p},{children:null==n?void 0:n.children}))},ol:function(e){e.node;var n=i.__rest(e,["node"]);return k?t.jsx(d.default,i.__assign({label:o,customStyles:null==M?void 0:M.expandOlStyle,onProceed:N,isProceedDisabled:F,aiReasoningCitation:L,citationStyles:R,customIcons:w},{children:null==n?void 0:n.children})):t.jsx("ol",i.__assign({className:s.default.orderedList,style:null==M?void 0:M.ol},{children:null==n?void 0:n.children}))},ul:function(e){e.node;var n=i.__rest(e,["node"]);return t.jsx("ul",i.__assign({className:s.default.unorderedList},{children:null==n?void 0:n.children}))},a:function(n){var o,d,v,b,y,S,k,N,F,P,A,z,U,B,G,H,$,X,J,K,Q,V,Y,Z,ii,ti;n.inline;var ei=n.children;n.node;var ni=i.__rest(n,["inline","children","node"]),oi="true"===(null==ni?void 0:ni.table),ai="".concat(null==ni?void 0:ni.href),li=null===(o=ai.split("$"))||void 0===o?void 0:o[0],si=null===(d=ai.split("$"))||void 0===d?void 0:d[1],di=("appmode_citation"===li||"appmode_citations"===li?(null==L?void 0:L.appmod_citations)||[]:"image_citation"===li||"image_citations"===li?(null==L?void 0:L.image_citations)||[]:"audio_citation"===li||"audio_citations"===li?(null==L?void 0:L.audio_citations)||[]:"document_citation"===li||"document_citations"===li?(null==L?void 0:L.file_citations)||[]:"rca_citation"===li||"rca_citations"===li?(null==L?void 0:L.rca_citations)||[]:"web_citation"===li||"web_citations"===li?(null==L?void 0:L.web_citations)||[]:"code_generated"===li?(null==L?void 0:L.code_generated)||[]:"readfile_citation"===li||"readfile_citations"===li?(null==L?void 0:L.readfile_citations)||[]:"gpt_citation"===li||"gpt_citations"===li?L.gpt_citations||[]:"big_enough_block"===li&&W||[]).find(function(i){return i.citation_number===decodeURIComponent(si)}),ci=I.includes(li);if("big_enough_block"===li&&di)return console.log("Rendering big enough block with citation:",R),t.jsx(x.default,{title:ei,citation:di,customStyles:null==R?void 0:R.bigEnoughCitation,customIcons:w});if("chat_citation"===li){if(!D||0===D.length)return null;var ri=si.split("-").map(Number),ui=ri[0],_i=ri[1];return ui=ui>0?ui-1:ui,_i=_i<D.length-1?_i+1:_i,t.jsx(j.default,{customIcon:null==w?void 0:w.chatCitationIcon,title:ei,chatHistory:q(D,ui,_i),isTable:oi,chatCitationProps:null==E?void 0:E.chatCitationProps,onCitationClick:null==E?void 0:E.handleCitationClicked,customStyles:null==R?void 0:R.chatCitation})}if("gpt_citation"===li&&di)return t.jsx(C.NonWebReasoningComponent,i.__assign({item:{text:"",dataSource:null===(b=null===(v=di.customMetadata)||void 0===v?void 0:v.data_sources)||void 0===b?void 0:b[0],trainingDataTitle:null===(S=null===(y=di.customMetadata)||void 0===y?void 0:y.training_data_title)||void 0===S?void 0:S[0],paraphrase:null===(N=null===(k=di.customMetadata)||void 0===k?void 0:k.paraphrase)||void 0===N?void 0:N[0]},headerTitle:(null==O?void 0:O.title)||"GPT - Gemini 2.5 Flash",iconsConfig:{ChevronDownIcon:a.ChevronDown,ChevronUpIcon:a.ChevronUp,MaximizeIcon:a.Maximize2,CloseIcon:a.X}},null==O?void 0:O.gptCitationProps));if("image_citation"===li&&!di)return null;if("web_citation"===(null===(F=null==di?void 0:di.customMetadata)||void 0===F?void 0:F.type))return(null===(P=di.customMetadata)||void 0===P?void 0:P.screenshot_url)?t.jsx(c.default,{title:ei,citation:di,customStyles:null==R?void 0:R.webCitation,customIcons:w}):t.jsx(r.default,{label:ei,url:null===(A=di.customMetadata)||void 0===A?void 0:A.link,customStyles:null==R?void 0:R.webCitation,customIcons:w});if("audio_transcript"===(null===(z=null==di?void 0:di.customMetadata)||void 0===z?void 0:z.type))return"stormee"===(null==di?void 0:di.customMetadata.audio_citation_mode)?t.jsx(e.Suspense,i.__assign({fallback:t.jsx(t.Fragment,{})},{children:t.jsx(m.default,{title:"".concat(ei),citation:di,customStyles:null==R?void 0:R.stormeeCitation,customIcons:w})})):t.jsx(e.Suspense,i.__assign({fallback:t.jsx(t.Fragment,{})},{children:t.jsx(p.default,{title:"".concat(ei),citation:di,customStyles:null==R?void 0:R.waveformCitation,customIcons:w})}));if("image_citation"===(null==di?void 0:di.customMetadata.type))return t.jsx(e.Suspense,i.__assign({fallback:t.jsx(t.Fragment,{})},{children:t.jsx(u.default,{title:"".concat(ei),citation:di,customIcons:w,customStyles:null==R?void 0:R.imageCitation})}));if("book_citation_doc"===(null===(U=null==di?void 0:di.customMetadata)||void 0===U?void 0:U.type)||"book_citation_pdf"===(null==di?void 0:di.customMetadata.type))return t.jsx(e.Suspense,i.__assign({fallback:t.jsx(t.Fragment,{})},{children:t.jsx(_.default,{title:"".concat(ei),citation:di,customIcons:w,customStyles:null==R?void 0:R.fileCitation})}));if("app_mod_rag_question"===(null===(B=null==di?void 0:di.customMetadata)||void 0===B?void 0:B.type))return t.jsx(e.Suspense,i.__assign({fallback:t.jsx(t.Fragment,{})},{children:t.jsx(g.default,{title:"".concat(ei),citation:di,customIcons:w,customStyles:null==R?void 0:R.appModCitation,codeLinkConfig:null===(G=null==T?void 0:T.appMod)||void 0===G?void 0:G.codeLinkConfig,isLoading:null===(H=null==T?void 0:T.appMod)||void 0===H?void 0:H.isLoading})}));if("rca_citation"===(null===($=null==di?void 0:di.customMetadata)||void 0===$?void 0:$.type))return t.jsx(e.Suspense,i.__assign({fallback:t.jsx(t.Fragment,{})},{children:t.jsx(f.default,{title:"".concat(ei),citation:di,customIcons:w,customStyles:null==R?void 0:R.rcaCitation})}));if("readfile_citation"===(null===(X=null==di?void 0:di.customMetadata)||void 0===X?void 0:X.type))return t.jsx(e.Suspense,i.__assign({fallback:t.jsx(t.Fragment,{})},{children:t.jsx(h.default,{title:"".concat(ei),citation:di,customIcons:w,customStyles:null==R?void 0:R.readFileCitation,fileCallback:null===(J=null==T?void 0:T.readFile)||void 0===J?void 0:J.fileCallback,editorConfig:null===(K=null==T?void 0:T.readFile)||void 0===K?void 0:K.editorConfig,customColors:null===(Q=null==T?void 0:T.readFile)||void 0===Q?void 0:Q.customColors})}));if(ci&&!di){var vi=null!==(V=null==w?void 0:w.citationLoadingIcon)&&void 0!==V?V:t.jsx("span",{className:s.default.citationSpinner,style:null===(Y=null==R?void 0:R.loadingCitations)||void 0===Y?void 0:Y.citationSpinner});return t.jsx(l.Tooltip,i.__assign({title:null!==(ii=null===(Z=null==R?void 0:R.loadingCitations)||void 0===Z?void 0:Z.tooltipTitle)&&void 0!==ii?ii:"source ".concat(li.split("_")[0]," citations"),arrow:!0},{children:t.jsxs("span",i.__assign({className:s.default.citationSpinnerWrapper,style:null===(ti=null==R?void 0:R.loadingCitations)||void 0===ti?void 0:ti.citationSpinnerWrapper},{children:[ei,vi]}))}))}return t.jsx("span",i.__assign({},ni,{className:s.default.paragraph,style:null==M?void 0:M.p},{children:null==ni?void 0:ni.children}))},code:function(e){e.inline;var n=e.children,o=e.className;return e.node,i.__rest(e,["inline","children","className","node"]),/language-(\w+)/.exec(o||"")||(null==o?void 0:o.includes("language-"))?t.jsx("div",{children:t.jsx("code",i.__assign({className:s.default.blockCode},{children:n}))}):t.jsx("code",i.__assign({className:s.default.inlineCode,style:null==M?void 0:M.code},{children:n}))},learned:function(e){var n=e.children;return t.jsx(t.Fragment,{children:t.jsx(l.Tooltip,i.__assign({title:n,placement:"top"},{children:t.jsx(a.Info,{size:16,className:s.default.learnedIcon})}))})}}},[L,k,T,D,W]);return t.jsx("div",i.__assign({ref:P,className:"w-full"},{children:t.jsx(y.default,i.__assign({components:z,rehypePlugins:[S.default]},{children:b}))}))},exports.formatChatData=q;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("tslib"),t=require("react/jsx-runtime"),n=require("react"),e=require("react-markdown"),o=require("rehype-raw"),a=require("lucide-react"),l=require("@mui/material"),s=require("./AiReasonMarkdownWrapper.module.css.js"),d=require("../../shared/ExpandableOl.js"),c=require("../citations/web-citation/WebCitationWithImageRenderer.js"),r=require("../citations/web-citation/WebCitationRenderer.js"),u=require("../citations/image-citation/ImageCitationRenderer.js"),_=require("../citations/file-citation/FileCitationRender.js"),v=require("../RequirementAIWrapper/RequirementAIWrapper.js"),m=require("../citations/stormee-citation/StormeeCitationRenderer.js"),p=require("../citations/audio-citation/WaveformCitationRenderer.js"),g=require("../citations/appmod-citation/AppmodCitationRenderer.js"),f=require("../citations/rca-citation/RCACitationRenderer.js"),h=require("../citations/readfile-citation/ReadFileCitationRenderer.js"),j=require("../citations/chat-citation/ChatCitationRenderer.js"),C=require("@e-llm-studio/citation"),x=require("../citations/big-enough/BigEnoughCitationRenderer.js"),b=require("./ScannedCitationRenderer.js");function y(i){return i&&"object"==typeof i&&"default"in i?i:{default:i}}var S=y(e),I=y(o),q=["appmode_citation","appmode_citations","appmod_citation","appmod_citations","image_citation","image_citations","audio_citation","audio_citations","document_citation","document_citations","rca_citation","rca_citations","web_citation","web_citations","code_generated","chat_citation","readfile_citation","readfile_citations","gpt_citation","gpt_citations","big_enough_block","scanned_doc_citation","scanned_doc_citations"],k=function(t,n,e){return i.__spreadArray([],t.map(function(t,o){var a=o>=n&&o<=e;return i.__assign(i.__assign({},t),{highlighted_text:a?t.message:""})}),!0)};exports.AiReasonMarkdownWrapper=function(e){var o=e.label,y=e.message,M=e.isExpandableOrderedListEnabled,R=e.customStyles,w=e.citationStyles,N=e.customIcons,F=e.onSelectProceed,W=e.isDisableProceedButton,P=e.big_enough_block,A=n.useRef(null),L=v.useRequirementAI(),D=L.citations,T=L.citationConfig,E=L.chatHistory,O=L.chatCitationConfigs,z=L.gptCitationConfigs,U=n.useMemo(function(){return{h1:function(n){n.node;var e=i.__rest(n,["node"]);return t.jsx("h1",i.__assign({className:s.default.h1,style:null==R?void 0:R.h1},{children:null==e?void 0:e.children}))},h2:function(n){n.node;var e=i.__rest(n,["node"]);return t.jsx("h2",i.__assign({className:s.default.h2,style:null==R?void 0:R.h2},{children:null==e?void 0:e.children}))},h3:function(n){n.node;var e=i.__rest(n,["node"]);return t.jsx("h2",i.__assign({className:s.default.h3,style:null==R?void 0:R.h3},{children:null==e?void 0:e.children}))},b:function(n){return n.node,i.__rest(n,["node"]),t.jsx("b",{className:s.default.bold,style:null==R?void 0:R.b})},p:function(n){n.node;var e=i.__rest(n,["node"]);return t.jsx("p",i.__assign({},e,{className:s.default.paragraph,style:null==R?void 0:R.p},{children:null==e?void 0:e.children}))},ol:function(n){n.node;var e=i.__rest(n,["node"]);return M?t.jsx(d.default,i.__assign({label:o,customStyles:null==R?void 0:R.expandOlStyle,onProceed:F,isProceedDisabled:W,aiReasoningCitation:D,citationStyles:w,customIcons:N},{children:null==e?void 0:e.children})):t.jsx("ol",i.__assign({className:s.default.orderedList,style:null==R?void 0:R.ol},{children:null==e?void 0:e.children}))},ul:function(n){n.node;var e=i.__rest(n,["node"]);return t.jsx("ul",i.__assign({className:s.default.unorderedList},{children:null==e?void 0:e.children}))},a:function(e){var o,d,v,y,S,I,M,F,W,A,L,U,B,G,H,$,X,J,K,Q,V,Y,Z,ii,ti,ni,ei,oi;e.inline;var ai=e.children;e.node;var li=i.__rest(e,["inline","children","node"]),si="true"===(null==li?void 0:li.table),di="".concat(null==li?void 0:li.href),ci=null===(o=di.split("$"))||void 0===o?void 0:o[0],ri=null===(d=di.split("$"))||void 0===d?void 0:d[1],ui=("appmode_citation"===ci||"appmode_citations"===ci?(null==D?void 0:D.appmod_citations)||[]:"image_citation"===ci||"image_citations"===ci?(null==D?void 0:D.image_citations)||[]:"audio_citation"===ci||"audio_citations"===ci?(null==D?void 0:D.audio_citations)||[]:"document_citation"===ci||"document_citations"===ci?(null==D?void 0:D.file_citations)||[]:"rca_citation"===ci||"rca_citations"===ci?(null==D?void 0:D.rca_citations)||[]:"web_citation"===ci||"web_citations"===ci?(null==D?void 0:D.web_citations)||[]:"code_generated"===ci?(null==D?void 0:D.code_generated)||[]:"readfile_citation"===ci||"readfile_citations"===ci?(null==D?void 0:D.readfile_citations)||[]:"gpt_citation"===ci||"gpt_citations"===ci?(null==D?void 0:D.gpt_citations)||[]:"scanned_doc_citation"===ci||"scanned_doc_citations"===ci?(null==D?void 0:D.scanned_doc_citations)||[]:"big_enough_block"===ci&&P||[]).find(function(i){return i.citation_number===decodeURIComponent(ri)}),_i=q.includes(ci);if("big_enough_block"===ci&&ui)return console.log("Rendering big enough block with citation:",w),t.jsx(x.default,{title:ai,citation:ui,customStyles:null==w?void 0:w.bigEnoughCitation,customIcons:N});if("chat_citation"===ci){if(!E||0===E.length)return null;var vi=ri.split("-").map(Number),mi=vi[0],pi=vi[1];return mi=mi>0?mi-1:mi,pi=pi<E.length-1?pi+1:pi,t.jsx(j.default,{customIcon:null==N?void 0:N.chatCitationIcon,title:ai,chatHistory:k(E,mi,pi),isTable:si,chatCitationProps:null==O?void 0:O.chatCitationProps,onCitationClick:null==O?void 0:O.handleCitationClicked,customStyles:null==w?void 0:w.chatCitation})}if("gpt_citation"===ci&&ui)return t.jsx(C.NonWebReasoningComponent,i.__assign({item:{text:"",dataSource:null===(y=null===(v=ui.customMetadata)||void 0===v?void 0:v.data_sources)||void 0===y?void 0:y[0],trainingDataTitle:null===(I=null===(S=ui.customMetadata)||void 0===S?void 0:S.training_data_title)||void 0===I?void 0:I[0],paraphrase:null===(F=null===(M=ui.customMetadata)||void 0===M?void 0:M.paraphrase)||void 0===F?void 0:F[0]},headerTitle:(null==z?void 0:z.title)||"GPT - Gemini 2.5 Flash",iconsConfig:{ChevronDownIcon:a.ChevronDown,ChevronUpIcon:a.ChevronUp,MaximizeIcon:a.Maximize2,CloseIcon:a.X}},null==z?void 0:z.gptCitationProps));if("image_citation"===ci&&!ui)return null;if("web_citation"===(null===(W=null==ui?void 0:ui.customMetadata)||void 0===W?void 0:W.type))return(null===(A=ui.customMetadata)||void 0===A?void 0:A.screenshot_url)?t.jsx(c.default,{title:ai,citation:ui,customStyles:null==w?void 0:w.webCitation,customIcons:N}):t.jsx(r.default,{label:ai,url:null===(L=ui.customMetadata)||void 0===L?void 0:L.link,customStyles:null==w?void 0:w.webCitation,customIcons:N});if("audio_transcript"===(null===(U=null==ui?void 0:ui.customMetadata)||void 0===U?void 0:U.type))return"stormee"===(null==ui?void 0:ui.customMetadata.audio_citation_mode)?t.jsx(n.Suspense,i.__assign({fallback:t.jsx(t.Fragment,{})},{children:t.jsx(m.default,{title:"".concat(ai),citation:ui,customStyles:null==w?void 0:w.stormeeCitation,customIcons:N})})):t.jsx(n.Suspense,i.__assign({fallback:t.jsx(t.Fragment,{})},{children:t.jsx(p.default,{title:"".concat(ai),citation:ui,customStyles:null==w?void 0:w.waveformCitation,customIcons:N})}));if("scanned_doc_citations"===(null===(B=null==ui?void 0:ui.customMetadata)||void 0===B?void 0:B.type)||"scanned_doc_citation"===(null===(G=null==ui?void 0:ui.customMetadata)||void 0===G?void 0:G.type))return t.jsx(n.Suspense,i.__assign({fallback:t.jsx(t.Fragment,{})},{children:t.jsx(b.default,{title:ai,citation:ui,customIcons:N,customStyles:null==w?void 0:w.scannedDocumentCitation})}));if("image_citation"===(null==ui?void 0:ui.customMetadata.type))return t.jsx(n.Suspense,i.__assign({fallback:t.jsx(t.Fragment,{})},{children:t.jsx(u.default,{title:"".concat(ai),citation:ui,customIcons:N,customStyles:null==w?void 0:w.imageCitation})}));if("book_citation_doc"===(null===(H=null==ui?void 0:ui.customMetadata)||void 0===H?void 0:H.type)||"book_citation_pdf"===(null==ui?void 0:ui.customMetadata.type))return t.jsx(n.Suspense,i.__assign({fallback:t.jsx(t.Fragment,{})},{children:t.jsx(_.default,{title:"".concat(ai),citation:ui,customIcons:N,customStyles:null==w?void 0:w.fileCitation})}));if("app_mod_rag_question"===(null===($=null==ui?void 0:ui.customMetadata)||void 0===$?void 0:$.type))return t.jsx(n.Suspense,i.__assign({fallback:t.jsx(t.Fragment,{})},{children:t.jsx(g.default,{title:"".concat(ai),citation:ui,customIcons:N,customStyles:null==w?void 0:w.appModCitation,codeLinkConfig:null===(X=null==T?void 0:T.appMod)||void 0===X?void 0:X.codeLinkConfig,isLoading:null===(J=null==T?void 0:T.appMod)||void 0===J?void 0:J.isLoading})}));if("rca_citation"===(null===(K=null==ui?void 0:ui.customMetadata)||void 0===K?void 0:K.type))return t.jsx(n.Suspense,i.__assign({fallback:t.jsx(t.Fragment,{})},{children:t.jsx(f.default,{title:"".concat(ai),citation:ui,customIcons:N,customStyles:null==w?void 0:w.rcaCitation})}));if("readfile_citation"===(null===(Q=null==ui?void 0:ui.customMetadata)||void 0===Q?void 0:Q.type))return t.jsx(n.Suspense,i.__assign({fallback:t.jsx(t.Fragment,{})},{children:t.jsx(h.default,{title:"".concat(ai),citation:ui,customIcons:N,customStyles:null==w?void 0:w.readFileCitation,fileCallback:null===(V=null==T?void 0:T.readFile)||void 0===V?void 0:V.fileCallback,editorConfig:null===(Y=null==T?void 0:T.readFile)||void 0===Y?void 0:Y.editorConfig,customColors:null===(Z=null==T?void 0:T.readFile)||void 0===Z?void 0:Z.customColors})}));if(_i&&!ui){var gi=null!==(ii=null==N?void 0:N.citationLoadingIcon)&&void 0!==ii?ii:t.jsx("span",{className:s.default.citationSpinner,style:null===(ti=null==w?void 0:w.loadingCitations)||void 0===ti?void 0:ti.citationSpinner});return t.jsx(l.Tooltip,i.__assign({title:null!==(ei=null===(ni=null==w?void 0:w.loadingCitations)||void 0===ni?void 0:ni.tooltipTitle)&&void 0!==ei?ei:"source ".concat(ci.split("_")[0]," citations"),arrow:!0},{children:t.jsxs("span",i.__assign({className:s.default.citationSpinnerWrapper,style:null===(oi=null==w?void 0:w.loadingCitations)||void 0===oi?void 0:oi.citationSpinnerWrapper},{children:[ai,gi]}))}))}return t.jsx("span",i.__assign({},li,{className:s.default.paragraph,style:null==R?void 0:R.p},{children:null==li?void 0:li.children}))},code:function(n){n.inline;var e=n.children,o=n.className;return n.node,i.__rest(n,["inline","children","className","node"]),/language-(\w+)/.exec(o||"")||(null==o?void 0:o.includes("language-"))?t.jsx("div",{children:t.jsx("code",i.__assign({className:s.default.blockCode},{children:e}))}):t.jsx("code",i.__assign({className:s.default.inlineCode,style:null==R?void 0:R.code},{children:e}))},learned:function(n){var e=n.children;return t.jsx(t.Fragment,{children:t.jsx(l.Tooltip,i.__assign({title:e,placement:"top"},{children:t.jsx(a.Info,{size:16,className:s.default.learnedIcon})}))})}}},[D,M,T,E,P]);return t.jsx("div",i.__assign({ref:A,className:"w-full"},{children:t.jsx(S.default,i.__assign({components:U,rehypePlugins:[I.default]},{children:y}))}))},exports.formatChatData=k;
|
|
2
2
|
//# sourceMappingURL=AiReasonMarkdownWrapper.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),n=require("./AiReasoningCitationContent.js"),t=require("../../icons/CognitiveDecision.js"),o=require("../../../CitationRenderer/CitationRenderer.js"),s=function(){return i.jsx("svg",e.__assign({width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"#4B5563",strokeWidth:"2.5",style:{verticalAlign:"bottom",marginLeft:"1px"}},{children:i.jsx("polyline",{points:"18 15 12 9 6 15"})}))},r=function(){return i.jsx("svg",e.__assign({width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"#4B5563",strokeWidth:"2.5",style:{verticalAlign:"bottom",marginLeft:"1px"}},{children:i.jsx("polyline",{points:"6 9 12 15 18 9"})}))};exports.SHOW_CONFIDENCE_SCORE_THRESHOLD_IN_AI_REASONING=75,exports.default=function(l){var a=l.isSourceHasHighlight,c=l.aiReason,d=l.citationTitle,u=void 0===d?"":d,p=l.customStyles,f=l.customIcons,g=l.onSelectProceed,x=l.isDisableProceedButton,h=(c.relevance_score>=75?null==f?void 0:f.highConfidence:null==f?void 0:f.lowConfidence)||i.jsx(t.default,{});return i.jsx("span",{children:i.jsx(o.default,{inLineCitation:!0,citationId:"ai-reasoning-".concat(c.id),citationTitle:u,citationIcon:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),n=require("./AiReasoningCitationContent.js"),t=require("../../icons/CognitiveDecision.js"),o=require("../../../CitationRenderer/CitationRenderer.js"),s=function(){return i.jsx("svg",e.__assign({width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"#4B5563",strokeWidth:"2.5",style:{verticalAlign:"bottom",marginLeft:"1px"}},{children:i.jsx("polyline",{points:"18 15 12 9 6 15"})}))},r=function(){return i.jsx("svg",e.__assign({width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"#4B5563",strokeWidth:"2.5",style:{verticalAlign:"bottom",marginLeft:"1px"}},{children:i.jsx("polyline",{points:"6 9 12 15 18 9"})}))};exports.SHOW_CONFIDENCE_SCORE_THRESHOLD_IN_AI_REASONING=75,exports.default=function(l){var a=l.isSourceHasHighlight,c=l.aiReason,d=l.citationTitle,u=void 0===d?"":d,p=l.customStyles,f=l.customIcons,g=l.onSelectProceed,x=l.isDisableProceedButton,h=l.inlineLabel,v=l.isInlineCitation,m=(c.relevance_score>=75?null==f?void 0:f.highConfidence:null==f?void 0:f.lowConfidence)||i.jsx(t.default,{});return i.jsx("span",{children:i.jsx(o.default,{inLineCitation:!0,citationId:"ai-reasoning-".concat(c.id),citationTitle:v?h||"":u||"",citationIcon:v?null:m,defaultExpanded:(null==c?void 0:c.isOpen)||a||!1,citationComponent:i.jsx(n.default,{aiReason:c,customStyles:p,customIcons:f,onSelectProceed:g,isDisableProceedButton:x}),chevronDownComponent:i.jsx(r,{}),chevronUpComponent:i.jsx(s,{}),styles:{pillButton:e.__assign({margin:"0px",padding:"4px 8px",fontSize:"15px",color:"#526eff",cursor:"pointer",verticalAlign:"middle",whiteSpace:"nowrap",display:"inline-flex",alignItems:v?"center":"flex-end",background:"#ffffffff",fontWeight:"700",gap:"1.5px",border:"none"},null==p?void 0:p.aiReasoningPill),citationContent:{width:"100%",background:"transparent",minHeight:"10px",height:"fit-content"}}})})};
|
|
2
2
|
//# sourceMappingURL=AiReasoningCitation.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("tslib"),n=require("react/jsx-runtime"),e=require("@e-llm-studio/citation"),i=require("../../../RequirementAiCitations/AiReasoning/components/icons/DocumentCitationIcon.js"),o=require("../../../CitationRenderer/CitationRenderer.js");exports.default=function(a){var r,c=a.title,l=a.citation,s=a.customIcons,u=a.customStyles,d=l.customMetadata,p=null!==(r=null==s?void 0:s.ScannedDocumentIcon)&&void 0!==r?r:n.jsx(i.default,{});return n.jsx(o.default,{inLineCitation:!0,citationTitle:c,citationId:"scanned-doc-".concat(l.citation_number),citationComponent:n.jsx(e.ScannedDocCitation,{pages:null==d?void 0:d.value,subHeadingText:null==d?void 0:d.artifact_title,height:"400px"}),chevronDownComponent:p,chevronUpComponent:p,styles:{pillButton:t.__assign({fontSize:"14px",margin:"0px",background:"#ffffff",color:"#526eff",cursor:"pointer",verticalAlign:"middle",whiteSpace:"nowrap",display:"inline-flex",alignItems:"center",border:"none"},null==u?void 0:u.pill),citationContent:t.__assign({width:"100%",background:"transparent",minHeight:"10px",height:"fit-content"},null==u?void 0:u.content)}})};
|
|
2
|
+
//# sourceMappingURL=ScannedCitationRenderer.js.map
|
package/dist/cjs/features/RequirementAI/components/ai-reasoning/ScannedCitationRenderer.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScannedCitationRenderer.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("react"),a=require("lucide-react"),s=require("../../../UserStoryImport/lib/cn.js"),o=require("./segment.module.css.js"),i=require("./ExampleComponentWrapper.js"),r=require("../ai-reasoning/AiReasoningCitationContent.js"),l=require("./SegmentLoader.js");require("./segment-common.css.js");var u=require("../../store/markdown-context.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=c(t);exports.default=function(c){var m=c.id,g=void 0===m?"Segment":m,p=c.label,f=c.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("react"),a=require("lucide-react"),s=require("../../../UserStoryImport/lib/cn.js"),o=require("./segment.module.css.js"),i=require("./ExampleComponentWrapper.js"),r=require("../ai-reasoning/AiReasoningCitationContent.js"),l=require("./SegmentLoader.js");require("./segment-common.css.js");var u=require("../../store/markdown-context.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=c(t);exports.default=function(c){var m=c.id,g=void 0===m?"Segment":m,p=c.label,f=c.children,v=c.segmentUUID;c.decisionStrength;var _=c.aiReason,x=c.customStyles,j=c.customIcons,y=c.aiReasoningCitationCustomStyles,h=c.segmentExampleComponent,C=c.handleViewGlossary,S=c.isUpdatedSegment,b=c.onOpen,q=t.useContext(u.MarkdownStateContext),w=q.citationsMetadata,E=q.updateCitationsMetadata;console.log("citation metadata ",w);var I=d.default.useState(!1),N=I[0],M=I[1],k=t.useMemo(function(){return w.get(v)},[w,v]),R=t.useMemo(function(){return(null==k?void 0:k.open)||!1},[k]),U=t.useMemo(function(){return k&&"loading"===k.state},[k]);return n.jsxs("div",e.__assign({className:"".concat(o.default.segmentWrapper),style:e.__assign(e.__assign({},null==x?void 0:x.segmentWrapper),{display:"inline-flex",verticalAlign:"middle"})},{children:[n.jsxs("div",e.__assign({className:"segment-".concat(g,"-container segmentContainer ").concat(S?"updatedSegmentContainer":""),style:e.__assign({},null==x?void 0:x.container)},{children:[n.jsx("span",e.__assign({className:"segment-".concat(g," segmentLabel ").concat(S?"updatedSegmentLabel":""),style:e.__assign({},null==x?void 0:x.label)},{children:S?f:p})),n.jsx("button",e.__assign({className:"".concat(o.default.segmentExplanationButtonContainer),style:e.__assign({},null==x?void 0:x.buttonContainer),onClick:function(){return e.__awaiter(void 0,void 0,void 0,function(){var n;return e.__generator(this,function(t){switch(t.label){case 0:if(n=!R,M(!1),console.log("citation metadata::",n,_),!n||(null==_?void 0:_.reason))return[3,5];E(v,function(t){if(t){var a=e.__assign({},t);return a.state="loading",a}return{open:n,state:"loading"}}),t.label=1;case 1:return t.trys.push([1,,3,4]),console.log("citation metadata:: onopen"),[4,null==b?void 0:b()];case 2:return t.sent(),[3,4];case 3:return E(v,function(t){if(t){var a=e.__assign({},t);return a.state="ready",a.open=n,a}return{open:n,state:"ready"}}),[7];case 4:return[3,6];case 5:console.log("citation metadata:: else block"),E(v,function(t){if(t){var a=e.__assign({},t);return a.open=n,a}return{open:n,state:U?"loading":"ready"}}),t.label=6;case 6:return[2]}})})}},{children:U?n.jsx(a.Loader2,{size:16,className:o.default.spinner}):n.jsx(a.ChevronDown,{className:s.cn(S&&o.default.updatedChevronIcon,o.default.cheveronIcon,R&&o.default.cheveronIconRotated),style:e.__assign({},null==x?void 0:x.cheveronIcon)})}))]})),N&&!S?n.jsx("div",e.__assign({className:o.default.explanationPanel},{children:n.jsx(i.default,{label:null!=p?p:"",segmentExampleComponent:h,customStyles:null==x?void 0:x.segmentExample,handleCancelExample:function(){M(!1)}})})):R&&(U?n.jsx(l.default,{customStyles:null==x?void 0:x.loadingSkeleton}):n.jsx("div",e.__assign({className:o.default.explanationPanel},{children:n.jsx(r.default,{aiReason:_,customStyles:y,customIcons:j,isSegmentExplanation:!0,handleViewGlossary:C?function(){E(v,function(n){if(n){var t=e.__assign({},n);return t.open=!1,t}return{open:!1,state:U?"loading":"ready"}}),null==C||C(g)}:void 0,handleViewExample:h?function(){M(!0)}:void 0,isUpdatedSegment:S})})))]}))};
|
|
2
2
|
//# sourceMappingURL=Segment.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("./Segment.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=o(require("dompurify"));exports.default=function(o){var i,d,a,r,s,u,v,g,m,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),n=require("react/jsx-runtime"),t=require("./Segment.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=o(require("dompurify"));exports.default=function(o){var i,d,a,r,s,u,v,g,c,m,p,S,f,h=o.id,_=o.children,b=o.props,x=o.segmentComponentConfig,y=o.customStyles,C=o.customIcons,j=o.extractText,I=o.isUpdatedSegment,U=void 0!==I&&I,D=(null==b?void 0:b.id)||"Segment",w=(null==b?void 0:b.decisionstrength)||"80",q=x||{},E=q.segmentDataList,F=q.getSegmentExampleComponent,L=q.handleViewGlossary,k=q.upadatedSegmentDataList,O=q.handleFetchUpdatedSegmentDetails,R=q.handleFetchSegmentDetails,G=U?null==k?void 0:k.find(function(e){return String(e.segment_id)===String(D)}):null==E?void 0:E.find(function(e){return String(e.segment_id)===String(D)});console.log("meee work",G,U,E,k);var M={id:D,reason:null!==(i=null==G?void 0:G.reason)&&void 0!==i?i:"",gap:null!==(d=null==G?void 0:G.gap)&&void 0!==d?d:"",explanation:null!==(a=null==G?void 0:G.explanation)&&void 0!==a?a:"",relevance_score:null!==(r=null==G?void 0:G.relevance_score)&&void 0!==r?r:0,isOpen:!1},T=void 0,V=j(_),W=b["data-table"],z="";if(W&&!U)try{z=decodeURIComponent(atob(W))}catch(e){console.error("Failed to decode data-table for segment",D,e)}var H=l.default.sanitize(z);return G||!R||U||null==R||R(D),D&&G&&F&&!U&&(T=W?n.jsx(function(){return n.jsx("div",{dangerouslySetInnerHTML:{__html:H}})},{}):F(D,V,G.segment_type)),n.jsx(t.default,e.__assign({id:D,segmentUUID:h,label:null!==(s=null==G?void 0:G.label)&&void 0!==s?s:null==G?void 0:G.segment_name,decisionStrength:w,aiReason:M,customIcons:C,aiReasoningCitationCustomStyles:y,segmentExampleComponent:T,handleViewGlossary:L,customStyles:{segmentWrapper:null===(u=null==y?void 0:y.segment)||void 0===u?void 0:u.segmentWrapper,container:null===(v=null==y?void 0:y.segment)||void 0===v?void 0:v.container,label:null===(g=null==y?void 0:y.segment)||void 0===g?void 0:g.label,decisionStrength:null===(c=null==y?void 0:y.segment)||void 0===c?void 0:c.decisionStrength,buttonContainer:null===(m=null==y?void 0:y.segment)||void 0===m?void 0:m.buttonContainer,cheveronIcon:null===(p=null==y?void 0:y.segment)||void 0===p?void 0:p.cheveronIcon,segmentExample:null===(S=null==y?void 0:y.segment)||void 0===S?void 0:S.segmentExample,loadingSkeleton:null===(f=null==y?void 0:y.segment)||void 0===f?void 0:f.SegmentLoadingSkeletonStyles},isUpdatedSegment:U,onOpen:function(){return e.__awaiter(void 0,void 0,void 0,function(){return e.__generator(this,function(e){switch(e.label){case 0:return G||!U?[3,2]:(console.log("citation metadata:: handleFetchUpdatedSegmentDetails"),[4,null==O?void 0:O(D)]);case 1:e.sent(),e.label=2;case 2:return[2]}})})}},{children:_}),D)};
|
|
2
2
|
//# sourceMappingURL=SegmentWrapper.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});!function(){if("undefined"==typeof document)return;const e=document.createElement("style");e.type="text/css";const n=window.__CSP_NONCE__||document.querySelector('meta[name="csp-nonce"]')?.content;n&&e.setAttribute("nonce",n),e.appendChild(document.createTextNode(".segment-module_segmentWrapper__PVOuq{display:inline-flex;gap:8px;position:relative;vertical-align:middle}.segment-module_segmentButtonContainer__X76sx{background-color:initial;border:none;cursor:pointer;padding:0}.segment-module_cheveronIcon__1njFy{color:#3b82f6;height:16px;transition:all .2s ease-in-out;width:16px}.segment-module_updatedChevronIcon__8vN-t{color:#16a34a}.segment-module_cheveronIconRotated__qDYj7{transform:rotate(180deg)}.segment-module_segmentPopup__YcHor{left:0;min-width:500px;position:absolute;top:calc(100% + 8px);z-index:1000}.segment-module_explanationPanel__7YlpU{background:#fff;left:0;position:absolute;top:100%;width:600px;z-index:100}.segment-module_exampleWrapper__ptZzj{align-items:flex-start;display:flex;flex-direction:column;gap:12px}.segment-module_uppercase__hjgxG{text-transform:uppercase}.segment-module_exampleContainer__9tMXx{align-items:flex-start;border:2px dashed #e2e8f0;border-radius:8px;display:flex;flex-direction:column;gap:8px;padding:16px;width:100%}.segment-module_exampleHeader__9P11O{align-items:center;align-self:stretch;display:flex;justify-content:space-between}.segment-module_loaderContainer__5Mhyz,.segment-module_loaderWrapper__SwIof{border:1px solid #e5e7eb;border-radius:8px;padding:12px}.segment-module_loaderHeader__J2JnY{align-items:center;display:flex;justify-content:space-between;margin-bottom:16px}.segment-module_skeleton__2uZEf{animation:segment-module_pulse__A17cR 1.5s ease-in-out infinite;background:#e5e7eb;border-radius:6px}.segment-module_title__fW93U{height:18px;width:100px}.segment-module_icon__Dvee3{height:18px;width:18px}.segment-module_lineFull__MMmOD{height:14px;margin-bottom:10px;width:100%}.segment-module_line90__OFStl{height:14px;margin-bottom:10px;width:90%}.segment-module_line75__9r6Xp{height:14px;margin-bottom:10px;width:75%}.segment-module_line60__bLRec{height:14px;width:60%}@keyframes segment-module_pulse__A17cR{0%{opacity:1}50%{opacity:.5}to{opacity:1}}.segment-module_exampleHeaderText__MWMG0{color:#334155;font-size:14px;font-weight:600;line-height:21px;margin:0}.segment-module_cancelButton__-F5aZ{align-items:center;align-self:stretch;background-color:initial;border:none;color:#334155;cursor:pointer;display:flex;height:fit-content;justify-content:space-between;padding:4px;transition:all .2s ease-in-out}.segment-module_cancelButton__-F5aZ:hover{background-color:#eff6ff}.segment-module_spinner__kRnWD{animation:segment-module_spin__MV6y5 1s linear infinite}@keyframes segment-module_spin__MV6y5{to{transform:rotate(1turn)}}"));const t=document.head||document.getElementsByTagName("head")[0]||document.documentElement;t&&t.appendChild(e)}(),exports.default={segmentWrapper:"segment-module_segmentWrapper__PVOuq",segmentButtonContainer:"segment-module_segmentButtonContainer__X76sx",cheveronIcon:"segment-module_cheveronIcon__1njFy",updatedChevronIcon:"segment-module_updatedChevronIcon__8vN-t",cheveronIconRotated:"segment-module_cheveronIconRotated__qDYj7",segmentPopup:"segment-module_segmentPopup__YcHor",explanationPanel:"segment-module_explanationPanel__7YlpU",exampleWrapper:"segment-module_exampleWrapper__ptZzj",uppercase:"segment-module_uppercase__hjgxG",exampleContainer:"segment-module_exampleContainer__9tMXx",exampleHeader:"segment-module_exampleHeader__9P11O",loaderWrapper:"segment-module_loaderWrapper__SwIof",loaderContainer:"segment-module_loaderContainer__5Mhyz",loaderHeader:"segment-module_loaderHeader__J2JnY",skeleton:"segment-module_skeleton__2uZEf",pulse:"segment-module_pulse__A17cR",title:"segment-module_title__fW93U",icon:"segment-module_icon__Dvee3",lineFull:"segment-module_lineFull__MMmOD",line90:"segment-module_line90__OFStl",line75:"segment-module_line75__9r6Xp",line60:"segment-module_line60__bLRec",exampleHeaderText:"segment-module_exampleHeaderText__MWMG0",cancelButton:"segment-module_cancelButton__-F5aZ",spinner:"segment-module_spinner__kRnWD",spin:"segment-module_spin__MV6y5"};
|
|
2
2
|
//# sourceMappingURL=segment.module.css.js.map
|