@e-llm-studio/citation 0.0.223-beta.1 → 0.0.224
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/features/ChatCitation/InternalChatCitationRenderer.js +1 -1
- package/dist/cjs/features/ChatCitation/components/ChatCitation.js +1 -1
- package/dist/cjs/features/IngestionStatus/useIngestionStatus.js +1 -1
- package/dist/features/ChatCitation/InternalChatCitationRenderer.js +1 -1
- package/dist/features/ChatCitation/components/ChatCitation.js +1 -1
- package/dist/features/IngestionStatus/useIngestionStatus.js +1 -1
- package/dist/types/src/features/ChatCitation/InternalChatCitationRenderer.d.ts.map +1 -1
- package/dist/types/src/features/ChatCitation/components/ChatCitation.d.ts +1 -0
- package/dist/types/src/features/ChatCitation/components/ChatCitation.d.ts.map +1 -1
- package/dist/types/src/features/ChatCitation/types/citations.types.d.ts +3 -0
- package/dist/types/src/features/ChatCitation/types/citations.types.d.ts.map +1 -1
- package/dist/types/src/features/IngestionStatus/useIngestionStatus.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),l=require("react/jsx-runtime"),o=require("./components/ChatCitation.js"),i=require("./utils/helpers.js"),n=require("./components/Chip.js"),t=require("./assets/message-chat-square.svg.js");require("@mui/icons-material/KeyboardArrowDown"),require("@mui/icons-material/KeyboardArrowUp"),require("@mui/icons-material/Clear");var r=require("./components/InViewNavigation.js"),d=require("./components/DetailedView.js"),s=require("./components/SummarizedView.js"),a=require("./components/RuleBook.js"),u=require("react"),v=require("./constants/renderer.js"),c=require("./components/IconContainer.js"),h=require("lucide-react"),f=require("./BigQueryTable.js");function g(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var b=g(require("@mui/icons-material/CloseOutlined"));exports.default=function(g){var p,x,m,y,_,w,C,k,j,S,q,A,D,T,R,I,V,F,z,P,B,E,H,M,N,W,Y,O,K,Q,U,G,J,L,X,Z,$,ee,le,oe,ie,ne,te,re,de,se=g.rootContainer,ae=g.chatContainer,ue=void 0===ae?{chatData:[]}:ae,ve=g.ruleBookContainer,ce=g.renderer,he=g.additionalData,fe=g.tableComponent,ge=g.closePreview,be=g.isRenderedCustomComponent,pe=void 0!==be&&be,xe=g.showRootContainer,me=void 0===xe||xe,ye=g.reversePanels,_e=void 0!==ye&&ye,we=u.useState(0),Ce=we[0],ke=we[1],je=u.useState(0),Se=je[0],qe=je[1],Ae=u.useState(0),De=Ae[0],Te=Ae[1],Re=u.useState(0),Ie=Re[0],Ve=Re[1],Fe=u.useRef(null),ze=u.useRef(null),Pe=u.useMemo(function(){return e.__assign(e.__assign({},v.defaultRenderer),ce)},[ce]),Be=u.useMemo(function(){return!!((null==fe?void 0:fe.rows)&&Object.keys(fe.rows).length>0)},[fe]),Ee=u.useMemo(function(){var e;return null!==(e=null==he?void 0:he.RuleBookDetailedViewVerticallyStacked)&&void 0!==e&&e},[null==he?void 0:he.RuleBookDetailedViewVerticallyStacked]);u.useEffect(function(){var e,l;if((null==ve?void 0:ve.show)&&Fe.current){var o=null===(e=Fe.current)||void 0===e?void 0:e.querySelectorAll(".rule-book-highlight");if(ke((null==o?void 0:o.length)||0),qe(0),o&&o.length>0)(i=o[0]).style.backgroundColor="#ffff5c",i.scrollIntoView({behavior:"smooth",block:"center"})}if((null==ue?void 0:ue.show)&&(null==ze?void 0:ze.current)){var i,n=null===(l=ze.current)||void 0===l?void 0:l.querySelectorAll(".user-chat-highlight");if(Te((null==n?void 0:n.length)||0),Ve(0),n&&n.length>0)(i=n[0]).style.backgroundColor="#ffff5c",i.scrollIntoView({behavior:"smooth",block:"center"})}},[null==ue?void 0:ue.show,null==ve?void 0:ve.show,null==ve?void 0:ve.data,null==ue?void 0:ue.chatData]);var He=u.useCallback(function(){var e;if(Se+1<Ce){var l=null===(e=Fe.current)||void 0===e?void 0:e.querySelectorAll(".rule-book-highlight");if(!l)return;l[Se].style.backgroundColor="#ffffb8";var o=Se+1;qe(o);var i=l[o];i.style.backgroundColor="#ffff5c",null==i||i.scrollIntoView({behavior:"smooth",block:"center"})}},[Se,Ce]),Me=u.useCallback(function(){var e;if(!(Se-1<0)){var l=null===(e=Fe.current)||void 0===e?void 0:e.querySelectorAll(".rule-book-highlight");if(l){l[Se].style.backgroundColor="#ffffb8";var o=Se-1,i=l[o];i.style.backgroundColor="#ffff5c",qe(o),null==i||i.scrollIntoView({behavior:"smooth",block:"center"})}}},[Se]),Ne=u.useCallback(function(){var e;if(Ie+1<De){var l=null===(e=ze.current)||void 0===e?void 0:e.querySelectorAll(".user-chat-highlight");if(!l)return;l[Ie].style.backgroundColor="#ffffb8";var o=Ie+1,i=l[o];i.style.backgroundColor="#ffff5c",Ve(o),null==i||i.scrollIntoView({behavior:"smooth",block:"center"})}},[Ie,De]),We=u.useCallback(function(){var e;if(!(Ie-1<0)){var l=null===(e=ze.current)||void 0===e?void 0:e.querySelectorAll(".user-chat-highlight");if(l){l[Ie].style.backgroundColor="#ffffb8";var o=Ie-1,i=l[o];i.style.backgroundColor="#ffff5c",Ve(o),null==i||i.scrollIntoView({behavior:"smooth",block:"center"})}}},[Ie]),Ye=i.getColorCode((null==se?void 0:se.relevanceScore)||0),Oe=u.useMemo(function(){var o,i=l.jsxs("span",e.__assign({style:e.__assign({display:"flex",border:"1px solid",alignItems:"center",gap:"4px",borderRadius:"6px",padding:"2px 8px",fontSize:"12px",borderColor:Ye.border,backgroundColor:Ye.background,color:Ye.text},null===(o=null==se?void 0:se.slotStyles)||void 0===o?void 0:o.relevanceScore)},{children:[(null==se?void 0:se.relevanceTitle)||"Decision Strength",":"," ",(null==se?void 0:se.relevanceScore)||0,"%"]}),"relevance-score"),n=l.jsx("span",e.__assign({style:{display:"flex",alignItems:"center",gap:"4px",borderRadius:"6px",padding:"2px 8px",fontSize:"12px",backgroundColor:"white",color:"black",cursor:"pointer"},onClick:ge},{children:l.jsx(b.default,{})}),"close-preview");return pe&&!(null==he?void 0:he.isExpanded)?[i,n]:[i]},[pe,Ye.background,Ye.border,Ye.text,null==se?void 0:se.relevanceScore,null===(p=null==se?void 0:se.slotStyles)||void 0===p?void 0:p.relevanceScore,null==se?void 0:se.relevanceTitle]),Ke=u.useMemo(function(){return[Ce>0&&l.jsx(r.default,{currentItemNumber:Se+1,totalItems:Ce,disableNext:Se+1>=Ce,onNext:He,onPrevious:Me,disablePrevious:Se<=0},"rulebook-nav")]},[Se,He,Me,Ce]),Qe=u.useMemo(function(){return(null==he?void 0:he.RuleBookContainerHeight)?he.RuleBookContainerHeight:!(!Ee||(null==he?void 0:he.isExpanded))&&"600px"},[null==he?void 0:he.RuleBookContainerHeight,Ee]),Ue=u.useMemo(function(){var e,o;return[(null===(o=null===(e=null==ue?void 0:ue.detailedTab)||void 0===e?void 0:e.chip)||void 0===o?void 0:o.isActive)&&De>0&&l.jsx(r.default,{currentItemNumber:Ie+1,totalItems:De,onNext:Ne,onPrevious:We,disableNext:Ie+1>=De,disablePrevious:Ie<=0},"chat-nav")]},[null===(m=null===(x=null==ue?void 0:ue.detailedTab)||void 0===x?void 0:x.chip)||void 0===m?void 0:m.isActive,Ie,Ne,We,De]),Ge=l.jsxs("div",e.__assign({style:e.__assign({display:"flex",flexDirection:_e?Ee?"column-reverse":"row-reverse":Ee?"column":"row",gap:[(null==ue?void 0:ue.chatData)&&ue.chatData.length>0&&(ue.show||void 0===ue.show),(null==ve?void 0:ve.data)&&(ve.show||void 0===ve.show),Be].filter(Boolean).length>1?"12px":"0",height:Qe||"100%",minHeight:0},null===(y=null==se?void 0:se.slotStyles)||void 0===y?void 0:y.container)},{children:[Be&&l.jsx("span",e.__assign({style:e.__assign({flex:"1 1 0%",minWidth:0},null===(_=null==ue?void 0:ue.slotStyles)||void 0===_?void 0:_.outerContainer)},{children:l.jsx(o.default,e.__assign({title:"Invoice Data Preview",icon:l.jsx(c.default,{children:l.jsx(h.Table,{size:16})}),slotStyles:{title:{color:"#475569",fontWeight:500}},secondaryActions:[]},{children:l.jsx("div",e.__assign({style:{height:"100%",maxHeight:(null==he?void 0:he.isExpanded)?"none":"275px",border:"2px solid #E2E8F0",borderRadius:"8px",display:"flex",flexDirection:"column",backgroundColor:"#FFFFFF",position:"relative",overflow:"hidden"}},{children:(null==fe?void 0:fe.rows)&&l.jsx(f.BigQueryTable,{rows:fe.rows,columns:fe.columns||[]})}))}))})),(null==ve?void 0:ve.data)&&(ve.show||void 0===ve.show)&&l.jsx("span",e.__assign({style:e.__assign({flex:"1 1 0%",minWidth:0},null===(w=null==ve?void 0:ve.slotStyles)||void 0===w?void 0:w.outerContainer)},{children:l.jsx(o.default,e.__assign({title:null!==(C=null==ve?void 0:ve.title)&&void 0!==C?C:"Rule book",icon:null==ve?void 0:ve.ruleBookIcon,slotStyles:{title:e.__assign({color:"#475569",fontWeight:500},null===(k=null==ve?void 0:ve.slotStyles)||void 0===k?void 0:k.title)},secondaryActions:(null==ve?void 0:ve.secondaryActions)?ve.secondaryActions(Ke):Ke},{children:l.jsx("div",e.__assign({style:e.__assign({height:"100%",maxHeight:"275px",minHeight:0,border:"2px solid #E2E8F0",borderRadius:"8px",display:"flex",flexDirection:"column",gap:"12px",backgroundColor:"#F8FAFC",position:"relative",overflowY:"auto"},null===(j=null==ve?void 0:ve.slotStyles)||void 0===j?void 0:j.dataContainer)},{children:l.jsx("div",e.__assign({style:{padding:"12px",height:"100%",overflowY:"auto"},ref:Fe},{children:l.jsx(a.default,{data:ve.data,renderers:null!==(S=null==ve?void 0:ve.renderer)&&void 0!==S?S:Pe})}))}))}))})),(null==ue?void 0:ue.chatData)&&ue.chatData.length>0&&(ue.show||void 0===ue.show)&&l.jsx("span",e.__assign({style:e.__assign({flex:"1 1 0%",minWidth:0},null===(q=null==ue?void 0:ue.slotStyles)||void 0===q?void 0:q.outerContainer)},{children:l.jsx(o.default,e.__assign({title:null!==(A=null==ue?void 0:ue.title)&&void 0!==A?A:"Chat",icon:null==ue?void 0:ue.chatIcon,containerStyles:null===(D=null==ue?void 0:ue.slotStyles)||void 0===D?void 0:D.container,slotStyles:{title:e.__assign({color:"#475569",fontWeight:500},null===(T=null==ue?void 0:ue.slotStyles)||void 0===T?void 0:T.title)},primaryActions:[((null===(I=null===(R=null==ue?void 0:ue.summarizedTab)||void 0===R?void 0:R.chip)||void 0===I?void 0:I.show)||void 0===(null===(F=null===(V=null==ue?void 0:ue.summarizedTab)||void 0===V?void 0:V.chip)||void 0===F?void 0:F.show))&&l.jsx(n.default,e.__assign({label:"Summarized"},null===(z=null==ue?void 0:ue.summarizedTab)||void 0===z?void 0:z.chip)),l.jsx(n.default,e.__assign({label:"Detailed"},null===(P=null==ue?void 0:ue.detailedTab)||void 0===P?void 0:P.chip))],secondaryActions:ue.secondaryActions?null==ue?void 0:ue.secondaryActions(Ue):Ue},{children:l.jsxs("div",e.__assign({style:e.__assign({height:"100%",maxHeight:"275px",border:"2px solid #E2E8F0",borderRadius:"8px",display:"flex",flexDirection:"column",gap:"12px",backgroundColor:"#F8FAFC",position:"relative",overflowY:"auto"},null===(B=null==ue?void 0:ue.slotStyles)||void 0===B?void 0:B.chatDataContainer)},{children:[(null===(H=null===(E=null==ue?void 0:ue.detailedTab)||void 0===E?void 0:E.chip)||void 0===H?void 0:H.isActive)&&l.jsx("div",e.__assign({ref:ze,style:{position:(null==he?void 0:he.isExpanded)?"absolute":"relative",inset:0,padding:"12px",overflowY:"auto"}},{children:l.jsx(d.default,{chatData:null!==(M=ue.chatData)&&void 0!==M?M:[],assistantChatProps:e.__assign(e.__assign({},null===(W=null===(N=null==ue?void 0:ue.detailedTab)||void 0===N?void 0:N.view)||void 0===W?void 0:W.assistantChatProps),{renderers:null!==(K=null===(O=null===(Y=null==ue?void 0:ue.detailedTab)||void 0===Y?void 0:Y.detailedViewRenderer)||void 0===O?void 0:O.assistantText)&&void 0!==K?K:Pe}),userChatItemProps:e.__assign(e.__assign({},null===(U=null===(Q=null==ue?void 0:ue.detailedTab)||void 0===Q?void 0:Q.view)||void 0===U?void 0:U.userChatItemProps),{renderers:null!==(L=null===(J=null===(G=null==ue?void 0:ue.detailedTab)||void 0===G?void 0:G.detailedViewRenderer)||void 0===J?void 0:J.userText)&&void 0!==L?L:Pe})})})),(null===(Z=null===(X=null==ue?void 0:ue.summarizedTab)||void 0===X?void 0:X.chip)||void 0===Z?void 0:Z.show)&&(null===(ee=null===($=null==ue?void 0:ue.summarizedTab)||void 0===$?void 0:$.chip)||void 0===ee?void 0:ee.isActive)&&l.jsx(s.default,e.__assign({chatData:null!==(le=ue.chatData)&&void 0!==le?le:[]},null===(oe=null==ue?void 0:ue.summarizedTab)||void 0===oe?void 0:oe.view,{renderer:null!==(ne=null===(ie=null==ue?void 0:ue.summarizedTab)||void 0===ie?void 0:ie.summarizedViewRenderer)&&void 0!==ne?ne:Pe}))]}))}))}))]}));return me?l.jsx(o.default,e.__assign({title:null==se?void 0:se.title,slotStyles:{title:null===(te=null==se?void 0:se.slotStyles)||void 0===te?void 0:te.title},containerStyles:null===(re=null==se?void 0:se.slotStyles)||void 0===re?void 0:re.container,icon:null!==(de=null==se?void 0:se.icon)&&void 0!==de?de:l.jsx(c.default,{children:l.jsx("img",{src:t.default,alt:"chat icon",style:{width:16,height:16}})}),secondaryActions:(null==se?void 0:se.secondaryActions)?se.secondaryActions(Oe):Oe},{children:Ge})):Ge};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),l=require("react/jsx-runtime"),i=require("./components/ChatCitation.js"),o=require("./utils/helpers.js"),n=require("./components/Chip.js"),t=require("./assets/message-chat-square.svg.js");require("@mui/icons-material/KeyboardArrowDown"),require("@mui/icons-material/KeyboardArrowUp"),require("@mui/icons-material/Clear");var r=require("./components/InViewNavigation.js"),d=require("./components/DetailedView.js"),s=require("./components/SummarizedView.js"),a=require("./components/RuleBook.js"),u=require("react"),v=require("./constants/renderer.js"),c=require("./components/IconContainer.js"),h=require("lucide-react"),f=require("./BigQueryTable.js");function g(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=g(require("@mui/icons-material/CloseOutlined")),b=function(e,l,i){if(void 0===i&&(i="smooth"),l){for(var o=e.parentElement;o;){var n=window.getComputedStyle(o).overflowY;if(("auto"===n||"scroll"===n)&&o.scrollHeight>o.clientHeight)break;if(o===l){o=null;break}o=o.parentElement}var t=null!=o?o:l,r=e.getBoundingClientRect(),d=t.getBoundingClientRect(),s=t.scrollTop+r.top-d.top-(t.clientHeight-r.height)/2;t.scrollTo({top:Math.max(0,s),behavior:i})}};exports.default=function(g){var x,m,y,_,C,w,S,j,k,q,A,T,D,R,F,z,B,E,I,P,H,V,M,N,W,Y,O,K,Q,U,G,J,L,X,Z,$,ee,le,ie,oe,ne,te,re,de,se,ae,ue,ve,ce=g.rootContainer,he=g.chatContainer,fe=void 0===he?{chatData:[]}:he,ge=g.ruleBookContainer,pe=g.renderer,be=g.additionalData,xe=g.tableComponent,me=g.closePreview,ye=g.isRenderedCustomComponent,_e=void 0!==ye&&ye,Ce=g.showRootContainer,we=void 0===Ce||Ce,Se=g.reversePanels,je=void 0!==Se&&Se,ke=u.useState(0),qe=ke[0],Ae=ke[1],Te=u.useState(0),De=Te[0],Re=Te[1],Fe=u.useState(0),ze=Fe[0],Be=Fe[1],Ee=u.useState(0),Ie=Ee[0],Pe=Ee[1],He=u.useRef(null),Ve=u.useRef(null),Me=u.useRef(null),Ne=u.useMemo(function(){return e.__assign(e.__assign({},v.defaultRenderer),pe)},[pe]),We=u.useMemo(function(){return!!((null==xe?void 0:xe.rows)&&Object.keys(xe.rows).length>0)},[xe]),Ye=u.useMemo(function(){var e;return null!==(e=null==be?void 0:be.RuleBookDetailedViewVerticallyStacked)&&void 0!==e&&e},[null==be?void 0:be.RuleBookDetailedViewVerticallyStacked]);u.useEffect(function(){var e,l;if((null==ge?void 0:ge.show)&&He.current){var i=null===(e=He.current)||void 0===e?void 0:e.querySelectorAll(".rule-book-highlight");if(Ae((null==i?void 0:i.length)||0),Re(0),i&&i.length>0){var o=i[0];o.style.backgroundColor="#ffff5c",b(o,He.current)}}if((null==fe?void 0:fe.show)&&(null==Ve?void 0:Ve.current)){var n=null===(l=Ve.current)||void 0===l?void 0:l.querySelectorAll(".user-chat-highlight");if(Be((null==n?void 0:n.length)||0),Pe(0),n&&n.length>0){var t=n[0];t.style.backgroundColor="#ffff5c";var r=requestAnimationFrame(function(){b(t,Me.current)});return function(){return cancelAnimationFrame(r)}}}},[null==fe?void 0:fe.show,null==ge?void 0:ge.show,null==ge?void 0:ge.data,null==fe?void 0:fe.chatData]);var Oe=u.useCallback(function(){var e;if(De+1<qe){var l=null===(e=He.current)||void 0===e?void 0:e.querySelectorAll(".rule-book-highlight");if(!l)return;l[De].style.backgroundColor="#ffffb8";var i=De+1;Re(i);var o=l[i];o.style.backgroundColor="#ffff5c",b(o,He.current)}},[De,qe]),Ke=u.useCallback(function(){var e;if(!(De-1<0)){var l=null===(e=He.current)||void 0===e?void 0:e.querySelectorAll(".rule-book-highlight");if(l){l[De].style.backgroundColor="#ffffb8";var i=De-1,o=l[i];o.style.backgroundColor="#ffff5c",Re(i),b(o,He.current)}}},[De]),Qe=u.useCallback(function(){var e;if(Ie+1<ze){var l=null===(e=Ve.current)||void 0===e?void 0:e.querySelectorAll(".user-chat-highlight");if(!l)return;l[Ie].style.backgroundColor="#ffffb8";var i=Ie+1,o=l[i];o.style.backgroundColor="#ffff5c",Pe(i),b(o,Me.current)}},[Ie,ze]),Ue=u.useCallback(function(){var e;if(!(Ie-1<0)){var l=null===(e=Ve.current)||void 0===e?void 0:e.querySelectorAll(".user-chat-highlight");if(l){l[Ie].style.backgroundColor="#ffffb8";var i=Ie-1,o=l[i];o.style.backgroundColor="#ffff5c",Pe(i),b(o,Me.current)}}},[Ie]),Ge=o.getColorCode((null==ce?void 0:ce.relevanceScore)||0),Je=u.useMemo(function(){var i,o=l.jsxs("span",e.__assign({style:e.__assign({display:"flex",border:"1px solid",alignItems:"center",gap:"4px",borderRadius:"6px",padding:"2px 8px",fontSize:"12px",borderColor:Ge.border,backgroundColor:Ge.background,color:Ge.text},null===(i=null==ce?void 0:ce.slotStyles)||void 0===i?void 0:i.relevanceScore)},{children:[(null==ce?void 0:ce.relevanceTitle)||"Decision Strength",":"," ",(null==ce?void 0:ce.relevanceScore)||0,"%"]}),"relevance-score"),n=l.jsx("span",e.__assign({style:{display:"flex",alignItems:"center",gap:"4px",borderRadius:"6px",padding:"2px 8px",fontSize:"12px",backgroundColor:"white",color:"black",cursor:"pointer"},onClick:me},{children:l.jsx(p.default,{})}),"close-preview");return _e&&!(null==be?void 0:be.isExpanded)?[o,n]:[o]},[_e,Ge.background,Ge.border,Ge.text,null==ce?void 0:ce.relevanceScore,null===(x=null==ce?void 0:ce.slotStyles)||void 0===x?void 0:x.relevanceScore,null==ce?void 0:ce.relevanceTitle]),Le=u.useMemo(function(){return[qe>0&&l.jsx(r.default,{currentItemNumber:De+1,totalItems:qe,disableNext:De+1>=qe,onNext:Oe,onPrevious:Ke,disablePrevious:De<=0},"rulebook-nav")]},[De,Oe,Ke,qe]),Xe=u.useMemo(function(){return(null==be?void 0:be.RuleBookContainerHeight)?be.RuleBookContainerHeight:!(!Ye||(null==be?void 0:be.isExpanded))&&"600px"},[null==be?void 0:be.RuleBookContainerHeight,Ye]),Ze=u.useMemo(function(){var e,i;return[(null===(i=null===(e=null==fe?void 0:fe.detailedTab)||void 0===e?void 0:e.chip)||void 0===i?void 0:i.isActive)&&ze>0&&l.jsx(r.default,{currentItemNumber:Ie+1,totalItems:ze,onNext:Qe,onPrevious:Ue,disableNext:Ie+1>=ze,disablePrevious:Ie<=0},"chat-nav")]},[null===(y=null===(m=null==fe?void 0:fe.detailedTab)||void 0===m?void 0:m.chip)||void 0===y?void 0:y.isActive,Ie,Qe,Ue,ze]),$e=l.jsxs("div",e.__assign({style:e.__assign({display:"flex",flexDirection:je?Ye?"column-reverse":"row-reverse":Ye?"column":"row",gap:[(null==fe?void 0:fe.chatData)&&fe.chatData.length>0&&(fe.show||void 0===fe.show),(null==ge?void 0:ge.data)&&(ge.show||void 0===ge.show),We].filter(Boolean).length>1?"12px":"0",height:Xe||"100%",minHeight:0},null===(_=null==ce?void 0:ce.slotStyles)||void 0===_?void 0:_.container)},{children:[We&&l.jsx("span",e.__assign({style:e.__assign({flex:"1 1 0%",minWidth:0},null===(C=null==fe?void 0:fe.slotStyles)||void 0===C?void 0:C.outerContainer)},{children:l.jsx(i.default,e.__assign({title:"Invoice Data Preview",icon:l.jsx(c.default,{children:l.jsx(h.Table,{size:16})}),slotStyles:{title:{color:"#475569",fontWeight:500}},secondaryActions:[]},{children:l.jsx("div",e.__assign({style:{height:"100%",maxHeight:(null==be?void 0:be.isExpanded)?"none":"275px",border:"2px solid #E2E8F0",borderRadius:"8px",display:"flex",flexDirection:"column",backgroundColor:"#FFFFFF",position:"relative",overflow:"hidden"}},{children:(null==xe?void 0:xe.rows)&&l.jsx(f.BigQueryTable,{rows:xe.rows,columns:xe.columns||[]})}))}))})),(null==ge?void 0:ge.data)&&(ge.show||void 0===ge.show)&&l.jsx("span",e.__assign({style:e.__assign({flex:"1 1 0%",minWidth:0},null===(w=null==ge?void 0:ge.slotStyles)||void 0===w?void 0:w.outerContainer)},{children:l.jsx(i.default,e.__assign({title:null!==(S=null==ge?void 0:ge.title)&&void 0!==S?S:"Rule book",icon:null==ge?void 0:ge.ruleBookIcon,slotStyles:{title:e.__assign({color:"#475569",fontWeight:500},null===(j=null==ge?void 0:ge.slotStyles)||void 0===j?void 0:j.title),body:null===(k=null==ge?void 0:ge.slotStyles)||void 0===k?void 0:k.body},secondaryActions:(null==ge?void 0:ge.secondaryActions)?ge.secondaryActions(Le):Le},{children:l.jsx("div",e.__assign({style:e.__assign({height:"100%",maxHeight:"275px",minHeight:0,border:"2px solid #E2E8F0",borderRadius:"8px",display:"flex",flexDirection:"column",gap:"12px",backgroundColor:"#F8FAFC",position:"relative",overflowY:"auto"},null===(q=null==ge?void 0:ge.slotStyles)||void 0===q?void 0:q.dataContainer)},{children:l.jsx("div",e.__assign({style:{padding:"12px",height:"100%",overflowY:"auto"},ref:He},{children:l.jsx(a.default,{data:ge.data,renderers:null!==(A=null==ge?void 0:ge.renderer)&&void 0!==A?A:Ne})}))}))}))})),(null==fe?void 0:fe.chatData)&&fe.chatData.length>0&&(fe.show||void 0===fe.show)&&l.jsx("span",e.__assign({style:e.__assign({flex:"1 1 0%",minWidth:0},null===(T=null==fe?void 0:fe.slotStyles)||void 0===T?void 0:T.outerContainer)},{children:l.jsx(i.default,e.__assign({title:null!==(D=null==fe?void 0:fe.title)&&void 0!==D?D:"Chat",icon:null==fe?void 0:fe.chatIcon,containerStyles:null===(R=null==fe?void 0:fe.slotStyles)||void 0===R?void 0:R.container,slotStyles:{title:e.__assign({color:"#475569",fontWeight:500},null===(F=null==fe?void 0:fe.slotStyles)||void 0===F?void 0:F.title),body:null===(z=null==fe?void 0:fe.slotStyles)||void 0===z?void 0:z.body},primaryActions:[((null===(E=null===(B=null==fe?void 0:fe.summarizedTab)||void 0===B?void 0:B.chip)||void 0===E?void 0:E.show)||void 0===(null===(P=null===(I=null==fe?void 0:fe.summarizedTab)||void 0===I?void 0:I.chip)||void 0===P?void 0:P.show))&&l.jsx(n.default,e.__assign({label:"Summarized"},null===(H=null==fe?void 0:fe.summarizedTab)||void 0===H?void 0:H.chip)),l.jsx(n.default,e.__assign({label:"Detailed"},null===(V=null==fe?void 0:fe.detailedTab)||void 0===V?void 0:V.chip))],secondaryActions:fe.secondaryActions?null==fe?void 0:fe.secondaryActions(Ze):Ze},{children:l.jsxs("div",e.__assign({ref:Me,style:e.__assign({height:"100%",maxHeight:"275px",border:"2px solid #E2E8F0",borderRadius:"8px",display:"flex",flexDirection:"column",gap:"12px",backgroundColor:"#F8FAFC",position:"relative",overflowY:"auto"},null===(M=null==fe?void 0:fe.slotStyles)||void 0===M?void 0:M.chatDataContainer)},{children:[(null===(W=null===(N=null==fe?void 0:fe.detailedTab)||void 0===N?void 0:N.chip)||void 0===W?void 0:W.isActive)&&l.jsx("div",e.__assign({ref:Ve,style:{position:(null==be?void 0:be.isExpanded)?"absolute":"relative",inset:0,padding:"12px",overflowY:"auto"}},{children:l.jsx(d.default,{chatData:null!==(Y=fe.chatData)&&void 0!==Y?Y:[],assistantChatProps:e.__assign(e.__assign({},null===(K=null===(O=null==fe?void 0:fe.detailedTab)||void 0===O?void 0:O.view)||void 0===K?void 0:K.assistantChatProps),{renderers:null!==(G=null===(U=null===(Q=null==fe?void 0:fe.detailedTab)||void 0===Q?void 0:Q.detailedViewRenderer)||void 0===U?void 0:U.assistantText)&&void 0!==G?G:Ne}),userChatItemProps:e.__assign(e.__assign({},null===(L=null===(J=null==fe?void 0:fe.detailedTab)||void 0===J?void 0:J.view)||void 0===L?void 0:L.userChatItemProps),{renderers:null!==($=null===(Z=null===(X=null==fe?void 0:fe.detailedTab)||void 0===X?void 0:X.detailedViewRenderer)||void 0===Z?void 0:Z.userText)&&void 0!==$?$:Ne})})})),(null===(le=null===(ee=null==fe?void 0:fe.summarizedTab)||void 0===ee?void 0:ee.chip)||void 0===le?void 0:le.show)&&(null===(oe=null===(ie=null==fe?void 0:fe.summarizedTab)||void 0===ie?void 0:ie.chip)||void 0===oe?void 0:oe.isActive)&&l.jsx(s.default,e.__assign({chatData:null!==(ne=fe.chatData)&&void 0!==ne?ne:[]},null===(te=null==fe?void 0:fe.summarizedTab)||void 0===te?void 0:te.view,{renderer:null!==(de=null===(re=null==fe?void 0:fe.summarizedTab)||void 0===re?void 0:re.summarizedViewRenderer)&&void 0!==de?de:Ne}))]}))}))}))]}));return we?l.jsx(i.default,e.__assign({title:null==ce?void 0:ce.title,slotStyles:{title:null===(se=null==ce?void 0:ce.slotStyles)||void 0===se?void 0:se.title,body:null===(ae=null==ce?void 0:ce.slotStyles)||void 0===ae?void 0:ae.body},containerStyles:null===(ue=null==ce?void 0:ce.slotStyles)||void 0===ue?void 0:ue.container,icon:null!==(ve=null==ce?void 0:ce.icon)&&void 0!==ve?ve:l.jsx(c.default,{children:l.jsx("img",{src:t.default,alt:"chat icon",style:{width:16,height:16}})}),secondaryActions:(null==ce?void 0:ce.secondaryActions)?ce.secondaryActions(Je):Je},{children:$e})):$e};
|
|
2
2
|
//# sourceMappingURL=InternalChatCitationRenderer.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("tslib"),e=require("react/jsx-runtime"),n={container:{border:"1px solid #E2E8F0",padding:12,paddingBottom:0,borderRadius:8,height:"100%",boxSizing:"border-box",display:"flex",flexDirection:"column"},headerRow:{display:"flex",flexDirection:"row",gap:16,justifyContent:"space-between",alignItems:"center",height:18},leftRow:{display:"flex",flexDirection:"row",gap:12,alignItems:"center"},iconTitleRow:{display:"flex",flexDirection:"row",gap:4,alignItems:"center"},titleText:{fontSize:14,fontWeight:700,color:"#5928ED"},actionsRow:{display:"flex",flexDirection:"row",gap:6,alignItems:"center"},body:{paddingTop:12,paddingBottom:12,flex:1}};exports.default=function(s){var t=s.title,o=void 0===t?"User Chat":t,l=s.icon,r=s.slotStyles,a=s.primaryActions,d=s.secondaryActions,c=s.children,_=s.containerStyles;return e.jsxs("div",i.__assign({style:i.__assign(i.__assign({},n.container),_)},{children:[e.jsxs("div",i.__assign({style:i.__assign(i.__assign({},n.headerRow),{overflowX:"auto",minHeight:"2.18rem",overflowY:"hidden",scrollbarWidth:"thin"})},{children:[e.jsxs("div",i.__assign({style:n.leftRow},{children:[e.jsxs("div",i.__assign({style:n.iconTitleRow},{children:[e.jsx("span",{children:l}),e.jsx("span",i.__assign({style:i.__assign(i.__assign({},n.titleText),null==r?void 0:r.title)},{children:o}))]})),e.jsx("div",i.__assign({style:n.actionsRow},{children:null==a?void 0:a.filter(function(i){return void 0!==i}).map(function(i,n){return e.jsx("span",{children:i},n)})}))]})),e.jsx("div",i.__assign({style:i.__assign(i.__assign({},n.actionsRow),{gap:16,alignItems:"center"})},{children:null==d?void 0:d.filter(function(i){return void 0!==i}).map(function(i,n){return e.jsx("span",{children:i},n)})}))]})),e.jsx("div",i.__assign({style:i.__assign(i.__assign({},n.body),null==r?void 0:r.body),id:"body"},{children:c}))]}))};
|
|
2
2
|
//# sourceMappingURL=ChatCitation.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=new Set(["DONE","COMPLETED","FAILED"])
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=new Set(["DONE","COMPLETED","FAILED"]);var n=new Map;function r(e,t,r){t.listeners.delete(r),0===t.listeners.size&&n.get(e)===t&&(clearInterval(t.keepAliveInterval),t.ws.readyState!==WebSocket.OPEN&&t.ws.readyState!==WebSocket.CONNECTING||t.ws.close(),n.delete(e))}exports.useIngestionWebSocket=function(s,a){var o=e.useState(null),i=o[0],c=o[1],l=e.useState(!1),u=l[0],f=l[1],v=e.useState(null),d=v[0],S=v[1],p=e.useRef(null),E=e.useRef(null),g=e.useRef(s);e.useEffect(function(){g.current=s},[s]);var k=e.useCallback(function(){var e=g.current;e&&p.current&&E.current&&r(e,p.current,E.current),p.current=null,E.current=null,f(!1)},[]);return e.useEffect(function(){if(s){S(null);var e=function(e,r){if(!r||"string"!=typeof r||!r.trim())return console.error("useIngestionWebSocket: wsBaseUrl is missing or invalid; skipping connection."),null;var s=n.get(e);if(s&&s.ws.readyState!==WebSocket.CLOSED)return s;var a=new WebSocket("".concat(r.trim(),"/").concat(e)),o={ws:a,listeners:new Set,lastData:null,keepAliveInterval:setInterval(function(){a.readyState===WebSocket.OPEN&&a.send(JSON.stringify({type:"ping"}))},5e3)};return a.onmessage=function(r){var s;try{s=JSON.parse(r.data)}catch(e){return void o.listeners.forEach(function(e){return e(null,"Failed to parse WebSocket message")})}if(function(e){if(!e||"object"!=typeof e)return!1;var t=e;return"string"==typeof t.ingestionStatus&&"string"==typeof t.ingestionId}(s)){var i=s;o.lastData=i,o.listeners.forEach(function(e){return e(i,null)}),t.has(i.ingestionStatus.toUpperCase())&&(clearInterval(o.keepAliveInterval),a.close(),n.delete(e))}else o.listeners.forEach(function(e){return e(null,"Received malformed WebSocket payload")})},a.onerror=function(){o.listeners.forEach(function(e){return e(null,"WebSocket connection error")})},a.onclose=function(){clearInterval(o.keepAliveInterval),n.get(e)===o&&n.delete(e)},n.set(e,o),o}(s,a);if(!e)return S("Missing or invalid WebSocket base URL"),void f(!1);e.lastData&&c(e.lastData),f(e.ws.readyState===WebSocket.OPEN);var o=function(e,t){t?S(t):c(e)};e.listeners.add(o),p.current=e,E.current=o;var i=function(){return f(!0)},l=function(){return f(!1)};return e.ws.addEventListener("open",i),e.ws.addEventListener("close",l),function(){e.ws.removeEventListener("open",i),e.ws.removeEventListener("close",l),r(s,e,o),p.current=null,E.current=null}}},[s,a]),{data:i,connected:u,error:d,disconnect:k}};
|
|
2
2
|
//# sourceMappingURL=useIngestionStatus.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as o}from"tslib";import{jsxs as l,jsx as i}from"react/jsx-runtime";import e from"./components/ChatCitation.js";import{getColorCode as n}from"./utils/helpers.js";import t from"./components/Chip.js";import r from"./assets/message-chat-square.svg.js";import"@mui/icons-material/KeyboardArrowDown";import"@mui/icons-material/KeyboardArrowUp";import"@mui/icons-material/Clear";import d from"./components/InViewNavigation.js";import a from"./components/DetailedView.js";import u from"./components/SummarizedView.js";import v from"./components/RuleBook.js";import{useState as s,useRef as c,useMemo as h,useEffect as f,useCallback as m}from"react";import{defaultRenderer as p}from"./constants/renderer.js";import b from"./components/IconContainer.js";import{Table as g}from"lucide-react";import{BigQueryTable as y}from"./BigQueryTable.js";import x from"@mui/icons-material/CloseOutlined";function w(w){var C,k,S,A,D,T,I,R,V,F,j,z,P,B,E,H,q,N,W,Y,K,O,Q,U,G,J,L,M,X,Z,$,_,oo,lo,io,eo,no,to,ro,ao,uo,vo,so,co,ho,fo=w.rootContainer,mo=w.chatContainer,po=void 0===mo?{chatData:[]}:mo,bo=w.ruleBookContainer,go=w.renderer,yo=w.additionalData,xo=w.tableComponent,wo=w.closePreview,Co=w.isRenderedCustomComponent,ko=void 0!==Co&&Co,So=w.showRootContainer,Ao=void 0===So||So,Do=w.reversePanels,To=void 0!==Do&&Do,Io=s(0),Ro=Io[0],Vo=Io[1],Fo=s(0),jo=Fo[0],zo=Fo[1],Po=s(0),Bo=Po[0],Eo=Po[1],Ho=s(0),qo=Ho[0],No=Ho[1],Wo=c(null),Yo=c(null),Ko=h(function(){return o(o({},p),go)},[go]),Oo=h(function(){return!!((null==xo?void 0:xo.rows)&&Object.keys(xo.rows).length>0)},[xo]),Qo=h(function(){var o;return null!==(o=null==yo?void 0:yo.RuleBookDetailedViewVerticallyStacked)&&void 0!==o&&o},[null==yo?void 0:yo.RuleBookDetailedViewVerticallyStacked]);f(function(){var o,l;if((null==bo?void 0:bo.show)&&Wo.current){var i=null===(o=Wo.current)||void 0===o?void 0:o.querySelectorAll(".rule-book-highlight");if(Vo((null==i?void 0:i.length)||0),zo(0),i&&i.length>0)(e=i[0]).style.backgroundColor="#ffff5c",e.scrollIntoView({behavior:"smooth",block:"center"})}if((null==po?void 0:po.show)&&(null==Yo?void 0:Yo.current)){var e,n=null===(l=Yo.current)||void 0===l?void 0:l.querySelectorAll(".user-chat-highlight");if(Eo((null==n?void 0:n.length)||0),No(0),n&&n.length>0)(e=n[0]).style.backgroundColor="#ffff5c",e.scrollIntoView({behavior:"smooth",block:"center"})}},[null==po?void 0:po.show,null==bo?void 0:bo.show,null==bo?void 0:bo.data,null==po?void 0:po.chatData]);var Uo=m(function(){var o;if(jo+1<Ro){var l=null===(o=Wo.current)||void 0===o?void 0:o.querySelectorAll(".rule-book-highlight");if(!l)return;l[jo].style.backgroundColor="#ffffb8";var i=jo+1;zo(i);var e=l[i];e.style.backgroundColor="#ffff5c",null==e||e.scrollIntoView({behavior:"smooth",block:"center"})}},[jo,Ro]),Go=m(function(){var o;if(!(jo-1<0)){var l=null===(o=Wo.current)||void 0===o?void 0:o.querySelectorAll(".rule-book-highlight");if(l){l[jo].style.backgroundColor="#ffffb8";var i=jo-1,e=l[i];e.style.backgroundColor="#ffff5c",zo(i),null==e||e.scrollIntoView({behavior:"smooth",block:"center"})}}},[jo]),Jo=m(function(){var o;if(qo+1<Bo){var l=null===(o=Yo.current)||void 0===o?void 0:o.querySelectorAll(".user-chat-highlight");if(!l)return;l[qo].style.backgroundColor="#ffffb8";var i=qo+1,e=l[i];e.style.backgroundColor="#ffff5c",No(i),null==e||e.scrollIntoView({behavior:"smooth",block:"center"})}},[qo,Bo]),Lo=m(function(){var o;if(!(qo-1<0)){var l=null===(o=Yo.current)||void 0===o?void 0:o.querySelectorAll(".user-chat-highlight");if(l){l[qo].style.backgroundColor="#ffffb8";var i=qo-1,e=l[i];e.style.backgroundColor="#ffff5c",No(i),null==e||e.scrollIntoView({behavior:"smooth",block:"center"})}}},[qo]),Mo=n((null==fo?void 0:fo.relevanceScore)||0),Xo=h(function(){var e,n=l("span",o({style:o({display:"flex",border:"1px solid",alignItems:"center",gap:"4px",borderRadius:"6px",padding:"2px 8px",fontSize:"12px",borderColor:Mo.border,backgroundColor:Mo.background,color:Mo.text},null===(e=null==fo?void 0:fo.slotStyles)||void 0===e?void 0:e.relevanceScore)},{children:[(null==fo?void 0:fo.relevanceTitle)||"Decision Strength",":"," ",(null==fo?void 0:fo.relevanceScore)||0,"%"]}),"relevance-score"),t=i("span",o({style:{display:"flex",alignItems:"center",gap:"4px",borderRadius:"6px",padding:"2px 8px",fontSize:"12px",backgroundColor:"white",color:"black",cursor:"pointer"},onClick:wo},{children:i(x,{})}),"close-preview");return ko&&!(null==yo?void 0:yo.isExpanded)?[n,t]:[n]},[ko,Mo.background,Mo.border,Mo.text,null==fo?void 0:fo.relevanceScore,null===(C=null==fo?void 0:fo.slotStyles)||void 0===C?void 0:C.relevanceScore,null==fo?void 0:fo.relevanceTitle]),Zo=h(function(){return[Ro>0&&i(d,{currentItemNumber:jo+1,totalItems:Ro,disableNext:jo+1>=Ro,onNext:Uo,onPrevious:Go,disablePrevious:jo<=0},"rulebook-nav")]},[jo,Uo,Go,Ro]),$o=h(function(){return(null==yo?void 0:yo.RuleBookContainerHeight)?yo.RuleBookContainerHeight:!(!Qo||(null==yo?void 0:yo.isExpanded))&&"600px"},[null==yo?void 0:yo.RuleBookContainerHeight,Qo]),_o=h(function(){var o,l;return[(null===(l=null===(o=null==po?void 0:po.detailedTab)||void 0===o?void 0:o.chip)||void 0===l?void 0:l.isActive)&&Bo>0&&i(d,{currentItemNumber:qo+1,totalItems:Bo,onNext:Jo,onPrevious:Lo,disableNext:qo+1>=Bo,disablePrevious:qo<=0},"chat-nav")]},[null===(S=null===(k=null==po?void 0:po.detailedTab)||void 0===k?void 0:k.chip)||void 0===S?void 0:S.isActive,qo,Jo,Lo,Bo]),ol=l("div",o({style:o({display:"flex",flexDirection:To?Qo?"column-reverse":"row-reverse":Qo?"column":"row",gap:[(null==po?void 0:po.chatData)&&po.chatData.length>0&&(po.show||void 0===po.show),(null==bo?void 0:bo.data)&&(bo.show||void 0===bo.show),Oo].filter(Boolean).length>1?"12px":"0",height:$o||"100%",minHeight:0},null===(A=null==fo?void 0:fo.slotStyles)||void 0===A?void 0:A.container)},{children:[Oo&&i("span",o({style:o({flex:"1 1 0%",minWidth:0},null===(D=null==po?void 0:po.slotStyles)||void 0===D?void 0:D.outerContainer)},{children:i(e,o({title:"Invoice Data Preview",icon:i(b,{children:i(g,{size:16})}),slotStyles:{title:{color:"#475569",fontWeight:500}},secondaryActions:[]},{children:i("div",o({style:{height:"100%",maxHeight:(null==yo?void 0:yo.isExpanded)?"none":"275px",border:"2px solid #E2E8F0",borderRadius:"8px",display:"flex",flexDirection:"column",backgroundColor:"#FFFFFF",position:"relative",overflow:"hidden"}},{children:(null==xo?void 0:xo.rows)&&i(y,{rows:xo.rows,columns:xo.columns||[]})}))}))})),(null==bo?void 0:bo.data)&&(bo.show||void 0===bo.show)&&i("span",o({style:o({flex:"1 1 0%",minWidth:0},null===(T=null==bo?void 0:bo.slotStyles)||void 0===T?void 0:T.outerContainer)},{children:i(e,o({title:null!==(I=null==bo?void 0:bo.title)&&void 0!==I?I:"Rule book",icon:null==bo?void 0:bo.ruleBookIcon,slotStyles:{title:o({color:"#475569",fontWeight:500},null===(R=null==bo?void 0:bo.slotStyles)||void 0===R?void 0:R.title)},secondaryActions:(null==bo?void 0:bo.secondaryActions)?bo.secondaryActions(Zo):Zo},{children:i("div",o({style:o({height:"100%",maxHeight:"275px",minHeight:0,border:"2px solid #E2E8F0",borderRadius:"8px",display:"flex",flexDirection:"column",gap:"12px",backgroundColor:"#F8FAFC",position:"relative",overflowY:"auto"},null===(V=null==bo?void 0:bo.slotStyles)||void 0===V?void 0:V.dataContainer)},{children:i("div",o({style:{padding:"12px",height:"100%",overflowY:"auto"},ref:Wo},{children:i(v,{data:bo.data,renderers:null!==(F=null==bo?void 0:bo.renderer)&&void 0!==F?F:Ko})}))}))}))})),(null==po?void 0:po.chatData)&&po.chatData.length>0&&(po.show||void 0===po.show)&&i("span",o({style:o({flex:"1 1 0%",minWidth:0},null===(j=null==po?void 0:po.slotStyles)||void 0===j?void 0:j.outerContainer)},{children:i(e,o({title:null!==(z=null==po?void 0:po.title)&&void 0!==z?z:"Chat",icon:null==po?void 0:po.chatIcon,containerStyles:null===(P=null==po?void 0:po.slotStyles)||void 0===P?void 0:P.container,slotStyles:{title:o({color:"#475569",fontWeight:500},null===(B=null==po?void 0:po.slotStyles)||void 0===B?void 0:B.title)},primaryActions:[((null===(H=null===(E=null==po?void 0:po.summarizedTab)||void 0===E?void 0:E.chip)||void 0===H?void 0:H.show)||void 0===(null===(N=null===(q=null==po?void 0:po.summarizedTab)||void 0===q?void 0:q.chip)||void 0===N?void 0:N.show))&&i(t,o({label:"Summarized"},null===(W=null==po?void 0:po.summarizedTab)||void 0===W?void 0:W.chip)),i(t,o({label:"Detailed"},null===(Y=null==po?void 0:po.detailedTab)||void 0===Y?void 0:Y.chip))],secondaryActions:po.secondaryActions?null==po?void 0:po.secondaryActions(_o):_o},{children:l("div",o({style:o({height:"100%",maxHeight:"275px",border:"2px solid #E2E8F0",borderRadius:"8px",display:"flex",flexDirection:"column",gap:"12px",backgroundColor:"#F8FAFC",position:"relative",overflowY:"auto"},null===(K=null==po?void 0:po.slotStyles)||void 0===K?void 0:K.chatDataContainer)},{children:[(null===(Q=null===(O=null==po?void 0:po.detailedTab)||void 0===O?void 0:O.chip)||void 0===Q?void 0:Q.isActive)&&i("div",o({ref:Yo,style:{position:(null==yo?void 0:yo.isExpanded)?"absolute":"relative",inset:0,padding:"12px",overflowY:"auto"}},{children:i(a,{chatData:null!==(U=po.chatData)&&void 0!==U?U:[],assistantChatProps:o(o({},null===(J=null===(G=null==po?void 0:po.detailedTab)||void 0===G?void 0:G.view)||void 0===J?void 0:J.assistantChatProps),{renderers:null!==(X=null===(M=null===(L=null==po?void 0:po.detailedTab)||void 0===L?void 0:L.detailedViewRenderer)||void 0===M?void 0:M.assistantText)&&void 0!==X?X:Ko}),userChatItemProps:o(o({},null===($=null===(Z=null==po?void 0:po.detailedTab)||void 0===Z?void 0:Z.view)||void 0===$?void 0:$.userChatItemProps),{renderers:null!==(lo=null===(oo=null===(_=null==po?void 0:po.detailedTab)||void 0===_?void 0:_.detailedViewRenderer)||void 0===oo?void 0:oo.userText)&&void 0!==lo?lo:Ko})})})),(null===(eo=null===(io=null==po?void 0:po.summarizedTab)||void 0===io?void 0:io.chip)||void 0===eo?void 0:eo.show)&&(null===(to=null===(no=null==po?void 0:po.summarizedTab)||void 0===no?void 0:no.chip)||void 0===to?void 0:to.isActive)&&i(u,o({chatData:null!==(ro=po.chatData)&&void 0!==ro?ro:[]},null===(ao=null==po?void 0:po.summarizedTab)||void 0===ao?void 0:ao.view,{renderer:null!==(vo=null===(uo=null==po?void 0:po.summarizedTab)||void 0===uo?void 0:uo.summarizedViewRenderer)&&void 0!==vo?vo:Ko}))]}))}))}))]}));return Ao?i(e,o({title:null==fo?void 0:fo.title,slotStyles:{title:null===(so=null==fo?void 0:fo.slotStyles)||void 0===so?void 0:so.title},containerStyles:null===(co=null==fo?void 0:fo.slotStyles)||void 0===co?void 0:co.container,icon:null!==(ho=null==fo?void 0:fo.icon)&&void 0!==ho?ho:i(b,{children:i("img",{src:r,alt:"chat icon",style:{width:16,height:16}})}),secondaryActions:(null==fo?void 0:fo.secondaryActions)?fo.secondaryActions(Xo):Xo},{children:ol})):ol}export{w as default};
|
|
1
|
+
import{__assign as o}from"tslib";import{jsxs as l,jsx as i}from"react/jsx-runtime";import e from"./components/ChatCitation.js";import{getColorCode as n}from"./utils/helpers.js";import t from"./components/Chip.js";import r from"./assets/message-chat-square.svg.js";import"@mui/icons-material/KeyboardArrowDown";import"@mui/icons-material/KeyboardArrowUp";import"@mui/icons-material/Clear";import d from"./components/InViewNavigation.js";import a from"./components/DetailedView.js";import u from"./components/SummarizedView.js";import v from"./components/RuleBook.js";import{useState as s,useRef as c,useMemo as h,useEffect as f,useCallback as m}from"react";import{defaultRenderer as p}from"./constants/renderer.js";import g from"./components/IconContainer.js";import{Table as y}from"lucide-react";import{BigQueryTable as b}from"./BigQueryTable.js";import x from"@mui/icons-material/CloseOutlined";var w=function(o,l,i){if(void 0===i&&(i="smooth"),l){for(var e=o.parentElement;e;){var n=window.getComputedStyle(e).overflowY;if(("auto"===n||"scroll"===n)&&e.scrollHeight>e.clientHeight)break;if(e===l){e=null;break}e=e.parentElement}var t=null!=e?e:l,r=o.getBoundingClientRect(),d=t.getBoundingClientRect(),a=t.scrollTop+r.top-d.top-(t.clientHeight-r.height)/2;t.scrollTo({top:Math.max(0,a),behavior:i})}};function C(C){var S,k,A,D,T,R,F,j,z,I,B,E,H,P,V,q,N,W,Y,K,O,M,Q,U,G,J,L,X,Z,$,_,oo,lo,io,eo,no,to,ro,ao,uo,vo,so,co,ho,fo,mo,po,go,yo=C.rootContainer,bo=C.chatContainer,xo=void 0===bo?{chatData:[]}:bo,wo=C.ruleBookContainer,Co=C.renderer,So=C.additionalData,ko=C.tableComponent,Ao=C.closePreview,Do=C.isRenderedCustomComponent,To=void 0!==Do&&Do,Ro=C.showRootContainer,Fo=void 0===Ro||Ro,jo=C.reversePanels,zo=void 0!==jo&&jo,Io=s(0),Bo=Io[0],Eo=Io[1],Ho=s(0),Po=Ho[0],Vo=Ho[1],qo=s(0),No=qo[0],Wo=qo[1],Yo=s(0),Ko=Yo[0],Oo=Yo[1],Mo=c(null),Qo=c(null),Uo=c(null),Go=h(function(){return o(o({},p),Co)},[Co]),Jo=h(function(){return!!((null==ko?void 0:ko.rows)&&Object.keys(ko.rows).length>0)},[ko]),Lo=h(function(){var o;return null!==(o=null==So?void 0:So.RuleBookDetailedViewVerticallyStacked)&&void 0!==o&&o},[null==So?void 0:So.RuleBookDetailedViewVerticallyStacked]);f(function(){var o,l;if((null==wo?void 0:wo.show)&&Mo.current){var i=null===(o=Mo.current)||void 0===o?void 0:o.querySelectorAll(".rule-book-highlight");if(Eo((null==i?void 0:i.length)||0),Vo(0),i&&i.length>0){var e=i[0];e.style.backgroundColor="#ffff5c",w(e,Mo.current)}}if((null==xo?void 0:xo.show)&&(null==Qo?void 0:Qo.current)){var n=null===(l=Qo.current)||void 0===l?void 0:l.querySelectorAll(".user-chat-highlight");if(Wo((null==n?void 0:n.length)||0),Oo(0),n&&n.length>0){var t=n[0];t.style.backgroundColor="#ffff5c";var r=requestAnimationFrame(function(){w(t,Uo.current)});return function(){return cancelAnimationFrame(r)}}}},[null==xo?void 0:xo.show,null==wo?void 0:wo.show,null==wo?void 0:wo.data,null==xo?void 0:xo.chatData]);var Xo=m(function(){var o;if(Po+1<Bo){var l=null===(o=Mo.current)||void 0===o?void 0:o.querySelectorAll(".rule-book-highlight");if(!l)return;l[Po].style.backgroundColor="#ffffb8";var i=Po+1;Vo(i);var e=l[i];e.style.backgroundColor="#ffff5c",w(e,Mo.current)}},[Po,Bo]),Zo=m(function(){var o;if(!(Po-1<0)){var l=null===(o=Mo.current)||void 0===o?void 0:o.querySelectorAll(".rule-book-highlight");if(l){l[Po].style.backgroundColor="#ffffb8";var i=Po-1,e=l[i];e.style.backgroundColor="#ffff5c",Vo(i),w(e,Mo.current)}}},[Po]),$o=m(function(){var o;if(Ko+1<No){var l=null===(o=Qo.current)||void 0===o?void 0:o.querySelectorAll(".user-chat-highlight");if(!l)return;l[Ko].style.backgroundColor="#ffffb8";var i=Ko+1,e=l[i];e.style.backgroundColor="#ffff5c",Oo(i),w(e,Uo.current)}},[Ko,No]),_o=m(function(){var o;if(!(Ko-1<0)){var l=null===(o=Qo.current)||void 0===o?void 0:o.querySelectorAll(".user-chat-highlight");if(l){l[Ko].style.backgroundColor="#ffffb8";var i=Ko-1,e=l[i];e.style.backgroundColor="#ffff5c",Oo(i),w(e,Uo.current)}}},[Ko]),ol=n((null==yo?void 0:yo.relevanceScore)||0),ll=h(function(){var e,n=l("span",o({style:o({display:"flex",border:"1px solid",alignItems:"center",gap:"4px",borderRadius:"6px",padding:"2px 8px",fontSize:"12px",borderColor:ol.border,backgroundColor:ol.background,color:ol.text},null===(e=null==yo?void 0:yo.slotStyles)||void 0===e?void 0:e.relevanceScore)},{children:[(null==yo?void 0:yo.relevanceTitle)||"Decision Strength",":"," ",(null==yo?void 0:yo.relevanceScore)||0,"%"]}),"relevance-score"),t=i("span",o({style:{display:"flex",alignItems:"center",gap:"4px",borderRadius:"6px",padding:"2px 8px",fontSize:"12px",backgroundColor:"white",color:"black",cursor:"pointer"},onClick:Ao},{children:i(x,{})}),"close-preview");return To&&!(null==So?void 0:So.isExpanded)?[n,t]:[n]},[To,ol.background,ol.border,ol.text,null==yo?void 0:yo.relevanceScore,null===(S=null==yo?void 0:yo.slotStyles)||void 0===S?void 0:S.relevanceScore,null==yo?void 0:yo.relevanceTitle]),il=h(function(){return[Bo>0&&i(d,{currentItemNumber:Po+1,totalItems:Bo,disableNext:Po+1>=Bo,onNext:Xo,onPrevious:Zo,disablePrevious:Po<=0},"rulebook-nav")]},[Po,Xo,Zo,Bo]),el=h(function(){return(null==So?void 0:So.RuleBookContainerHeight)?So.RuleBookContainerHeight:!(!Lo||(null==So?void 0:So.isExpanded))&&"600px"},[null==So?void 0:So.RuleBookContainerHeight,Lo]),nl=h(function(){var o,l;return[(null===(l=null===(o=null==xo?void 0:xo.detailedTab)||void 0===o?void 0:o.chip)||void 0===l?void 0:l.isActive)&&No>0&&i(d,{currentItemNumber:Ko+1,totalItems:No,onNext:$o,onPrevious:_o,disableNext:Ko+1>=No,disablePrevious:Ko<=0},"chat-nav")]},[null===(A=null===(k=null==xo?void 0:xo.detailedTab)||void 0===k?void 0:k.chip)||void 0===A?void 0:A.isActive,Ko,$o,_o,No]),tl=l("div",o({style:o({display:"flex",flexDirection:zo?Lo?"column-reverse":"row-reverse":Lo?"column":"row",gap:[(null==xo?void 0:xo.chatData)&&xo.chatData.length>0&&(xo.show||void 0===xo.show),(null==wo?void 0:wo.data)&&(wo.show||void 0===wo.show),Jo].filter(Boolean).length>1?"12px":"0",height:el||"100%",minHeight:0},null===(D=null==yo?void 0:yo.slotStyles)||void 0===D?void 0:D.container)},{children:[Jo&&i("span",o({style:o({flex:"1 1 0%",minWidth:0},null===(T=null==xo?void 0:xo.slotStyles)||void 0===T?void 0:T.outerContainer)},{children:i(e,o({title:"Invoice Data Preview",icon:i(g,{children:i(y,{size:16})}),slotStyles:{title:{color:"#475569",fontWeight:500}},secondaryActions:[]},{children:i("div",o({style:{height:"100%",maxHeight:(null==So?void 0:So.isExpanded)?"none":"275px",border:"2px solid #E2E8F0",borderRadius:"8px",display:"flex",flexDirection:"column",backgroundColor:"#FFFFFF",position:"relative",overflow:"hidden"}},{children:(null==ko?void 0:ko.rows)&&i(b,{rows:ko.rows,columns:ko.columns||[]})}))}))})),(null==wo?void 0:wo.data)&&(wo.show||void 0===wo.show)&&i("span",o({style:o({flex:"1 1 0%",minWidth:0},null===(R=null==wo?void 0:wo.slotStyles)||void 0===R?void 0:R.outerContainer)},{children:i(e,o({title:null!==(F=null==wo?void 0:wo.title)&&void 0!==F?F:"Rule book",icon:null==wo?void 0:wo.ruleBookIcon,slotStyles:{title:o({color:"#475569",fontWeight:500},null===(j=null==wo?void 0:wo.slotStyles)||void 0===j?void 0:j.title),body:null===(z=null==wo?void 0:wo.slotStyles)||void 0===z?void 0:z.body},secondaryActions:(null==wo?void 0:wo.secondaryActions)?wo.secondaryActions(il):il},{children:i("div",o({style:o({height:"100%",maxHeight:"275px",minHeight:0,border:"2px solid #E2E8F0",borderRadius:"8px",display:"flex",flexDirection:"column",gap:"12px",backgroundColor:"#F8FAFC",position:"relative",overflowY:"auto"},null===(I=null==wo?void 0:wo.slotStyles)||void 0===I?void 0:I.dataContainer)},{children:i("div",o({style:{padding:"12px",height:"100%",overflowY:"auto"},ref:Mo},{children:i(v,{data:wo.data,renderers:null!==(B=null==wo?void 0:wo.renderer)&&void 0!==B?B:Go})}))}))}))})),(null==xo?void 0:xo.chatData)&&xo.chatData.length>0&&(xo.show||void 0===xo.show)&&i("span",o({style:o({flex:"1 1 0%",minWidth:0},null===(E=null==xo?void 0:xo.slotStyles)||void 0===E?void 0:E.outerContainer)},{children:i(e,o({title:null!==(H=null==xo?void 0:xo.title)&&void 0!==H?H:"Chat",icon:null==xo?void 0:xo.chatIcon,containerStyles:null===(P=null==xo?void 0:xo.slotStyles)||void 0===P?void 0:P.container,slotStyles:{title:o({color:"#475569",fontWeight:500},null===(V=null==xo?void 0:xo.slotStyles)||void 0===V?void 0:V.title),body:null===(q=null==xo?void 0:xo.slotStyles)||void 0===q?void 0:q.body},primaryActions:[((null===(W=null===(N=null==xo?void 0:xo.summarizedTab)||void 0===N?void 0:N.chip)||void 0===W?void 0:W.show)||void 0===(null===(K=null===(Y=null==xo?void 0:xo.summarizedTab)||void 0===Y?void 0:Y.chip)||void 0===K?void 0:K.show))&&i(t,o({label:"Summarized"},null===(O=null==xo?void 0:xo.summarizedTab)||void 0===O?void 0:O.chip)),i(t,o({label:"Detailed"},null===(M=null==xo?void 0:xo.detailedTab)||void 0===M?void 0:M.chip))],secondaryActions:xo.secondaryActions?null==xo?void 0:xo.secondaryActions(nl):nl},{children:l("div",o({ref:Uo,style:o({height:"100%",maxHeight:"275px",border:"2px solid #E2E8F0",borderRadius:"8px",display:"flex",flexDirection:"column",gap:"12px",backgroundColor:"#F8FAFC",position:"relative",overflowY:"auto"},null===(Q=null==xo?void 0:xo.slotStyles)||void 0===Q?void 0:Q.chatDataContainer)},{children:[(null===(G=null===(U=null==xo?void 0:xo.detailedTab)||void 0===U?void 0:U.chip)||void 0===G?void 0:G.isActive)&&i("div",o({ref:Qo,style:{position:(null==So?void 0:So.isExpanded)?"absolute":"relative",inset:0,padding:"12px",overflowY:"auto"}},{children:i(a,{chatData:null!==(J=xo.chatData)&&void 0!==J?J:[],assistantChatProps:o(o({},null===(X=null===(L=null==xo?void 0:xo.detailedTab)||void 0===L?void 0:L.view)||void 0===X?void 0:X.assistantChatProps),{renderers:null!==(_=null===($=null===(Z=null==xo?void 0:xo.detailedTab)||void 0===Z?void 0:Z.detailedViewRenderer)||void 0===$?void 0:$.assistantText)&&void 0!==_?_:Go}),userChatItemProps:o(o({},null===(lo=null===(oo=null==xo?void 0:xo.detailedTab)||void 0===oo?void 0:oo.view)||void 0===lo?void 0:lo.userChatItemProps),{renderers:null!==(no=null===(eo=null===(io=null==xo?void 0:xo.detailedTab)||void 0===io?void 0:io.detailedViewRenderer)||void 0===eo?void 0:eo.userText)&&void 0!==no?no:Go})})})),(null===(ro=null===(to=null==xo?void 0:xo.summarizedTab)||void 0===to?void 0:to.chip)||void 0===ro?void 0:ro.show)&&(null===(uo=null===(ao=null==xo?void 0:xo.summarizedTab)||void 0===ao?void 0:ao.chip)||void 0===uo?void 0:uo.isActive)&&i(u,o({chatData:null!==(vo=xo.chatData)&&void 0!==vo?vo:[]},null===(so=null==xo?void 0:xo.summarizedTab)||void 0===so?void 0:so.view,{renderer:null!==(ho=null===(co=null==xo?void 0:xo.summarizedTab)||void 0===co?void 0:co.summarizedViewRenderer)&&void 0!==ho?ho:Go}))]}))}))}))]}));return Fo?i(e,o({title:null==yo?void 0:yo.title,slotStyles:{title:null===(fo=null==yo?void 0:yo.slotStyles)||void 0===fo?void 0:fo.title,body:null===(mo=null==yo?void 0:yo.slotStyles)||void 0===mo?void 0:mo.body},containerStyles:null===(po=null==yo?void 0:yo.slotStyles)||void 0===po?void 0:po.container,icon:null!==(go=null==yo?void 0:yo.icon)&&void 0!==go?go:i(g,{children:i("img",{src:r,alt:"chat icon",style:{width:16,height:16}})}),secondaryActions:(null==yo?void 0:yo.secondaryActions)?yo.secondaryActions(ll):ll},{children:tl})):tl}export{C as default};
|
|
2
2
|
//# sourceMappingURL=InternalChatCitationRenderer.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsxs as i,jsx as t}from"react/jsx-runtime";var n={container:{border:"1px solid #E2E8F0",padding:12,paddingBottom:0,borderRadius:8,height:"100%",boxSizing:"border-box",display:"flex",flexDirection:"column"},headerRow:{display:"flex",flexDirection:"row",gap:16,justifyContent:"space-between",alignItems:"center",height:18},leftRow:{display:"flex",flexDirection:"row",gap:12,alignItems:"center"},iconTitleRow:{display:"flex",flexDirection:"row",gap:4,alignItems:"center"},titleText:{fontSize:14,fontWeight:700,color:"#5928ED"},actionsRow:{display:"flex",flexDirection:"row",gap:6,alignItems:"center"},body:{paddingTop:12,paddingBottom:12,flex:1}};function o(o){var l=o.title,r=void 0===l?"User Chat":l,d=o.icon,a=o.slotStyles,c=o.primaryActions,s=o.secondaryActions,f=o.children,p=o.containerStyles;return i("div",e({style:e(e({},n.container),p)},{children:[i("div",e({style:e(e({},n.headerRow),{overflowX:"auto",minHeight:"2.18rem",overflowY:"hidden",scrollbarWidth:"thin"})},{children:[i("div",e({style:n.leftRow},{children:[i("div",e({style:n.iconTitleRow},{children:[t("span",{children:d}),t("span",e({style:e(e({},n.titleText),null==a?void 0:a.title)},{children:r}))]})),t("div",e({style:n.actionsRow},{children:null==c?void 0:c.filter(function(e){return void 0!==e}).map(function(e,i){return t("span",{children:e},i)})}))]})),t("div",e({style:e(e({},n.actionsRow),{gap:16,alignItems:"center"})},{children:null==s?void 0:s.filter(function(e){return void 0!==e}).map(function(e,i){return t("span",{children:e},i)})}))]})),t("div",e({style:n.body,id:"body"},{children:f}))]}))}export{o as default};
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as i,jsx as t}from"react/jsx-runtime";var n={container:{border:"1px solid #E2E8F0",padding:12,paddingBottom:0,borderRadius:8,height:"100%",boxSizing:"border-box",display:"flex",flexDirection:"column"},headerRow:{display:"flex",flexDirection:"row",gap:16,justifyContent:"space-between",alignItems:"center",height:18},leftRow:{display:"flex",flexDirection:"row",gap:12,alignItems:"center"},iconTitleRow:{display:"flex",flexDirection:"row",gap:4,alignItems:"center"},titleText:{fontSize:14,fontWeight:700,color:"#5928ED"},actionsRow:{display:"flex",flexDirection:"row",gap:6,alignItems:"center"},body:{paddingTop:12,paddingBottom:12,flex:1}};function o(o){var l=o.title,r=void 0===l?"User Chat":l,d=o.icon,a=o.slotStyles,c=o.primaryActions,s=o.secondaryActions,f=o.children,p=o.containerStyles;return i("div",e({style:e(e({},n.container),p)},{children:[i("div",e({style:e(e({},n.headerRow),{overflowX:"auto",minHeight:"2.18rem",overflowY:"hidden",scrollbarWidth:"thin"})},{children:[i("div",e({style:n.leftRow},{children:[i("div",e({style:n.iconTitleRow},{children:[t("span",{children:d}),t("span",e({style:e(e({},n.titleText),null==a?void 0:a.title)},{children:r}))]})),t("div",e({style:n.actionsRow},{children:null==c?void 0:c.filter(function(e){return void 0!==e}).map(function(e,i){return t("span",{children:e},i)})}))]})),t("div",e({style:e(e({},n.actionsRow),{gap:16,alignItems:"center"})},{children:null==s?void 0:s.filter(function(e){return void 0!==e}).map(function(e,i){return t("span",{children:e},i)})}))]})),t("div",e({style:e(e({},n.body),null==a?void 0:a.body),id:"body"},{children:f}))]}))}export{o as default};
|
|
2
2
|
//# sourceMappingURL=ChatCitation.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{useState as e,useRef as n,
|
|
1
|
+
import{useState as e,useRef as n,useEffect as t,useCallback as r}from"react";var o=new Set(["DONE","COMPLETED","FAILED"]);var a=new Map;function i(e,n,t){n.listeners.delete(t),0===n.listeners.size&&a.get(e)===n&&(clearInterval(n.keepAliveInterval),n.ws.readyState!==WebSocket.OPEN&&n.ws.readyState!==WebSocket.CONNECTING||n.ws.close(),a.delete(e))}function l(l,s){var c=e(null),u=c[0],f=c[1],v=e(!1),d=v[0],S=v[1],p=e(null),g=p[0],E=p[1],k=n(null),w=n(null),b=n(l);t(function(){b.current=l},[l]);var y=r(function(){var e=b.current;e&&k.current&&w.current&&i(e,k.current,w.current),k.current=null,w.current=null,S(!1)},[]);return t(function(){if(l){E(null);var e=function(e,n){if(!n||"string"!=typeof n||!n.trim())return console.error("useIngestionWebSocket: wsBaseUrl is missing or invalid; skipping connection."),null;var t=a.get(e);if(t&&t.ws.readyState!==WebSocket.CLOSED)return t;var r=new WebSocket("".concat(n.trim(),"/").concat(e)),i={ws:r,listeners:new Set,lastData:null,keepAliveInterval:setInterval(function(){r.readyState===WebSocket.OPEN&&r.send(JSON.stringify({type:"ping"}))},5e3)};return r.onmessage=function(n){var t;try{t=JSON.parse(n.data)}catch(e){return void i.listeners.forEach(function(e){return e(null,"Failed to parse WebSocket message")})}if(function(e){if(!e||"object"!=typeof e)return!1;var n=e;return"string"==typeof n.ingestionStatus&&"string"==typeof n.ingestionId}(t)){var l=t;i.lastData=l,i.listeners.forEach(function(e){return e(l,null)}),o.has(l.ingestionStatus.toUpperCase())&&(clearInterval(i.keepAliveInterval),r.close(),a.delete(e))}else i.listeners.forEach(function(e){return e(null,"Received malformed WebSocket payload")})},r.onerror=function(){i.listeners.forEach(function(e){return e(null,"WebSocket connection error")})},r.onclose=function(){clearInterval(i.keepAliveInterval),a.get(e)===i&&a.delete(e)},a.set(e,i),i}(l,s);if(!e)return E("Missing or invalid WebSocket base URL"),void S(!1);e.lastData&&f(e.lastData),S(e.ws.readyState===WebSocket.OPEN);var n=function(e,n){n?E(n):f(e)};e.listeners.add(n),k.current=e,w.current=n;var t=function(){return S(!0)},r=function(){return S(!1)};return e.ws.addEventListener("open",t),e.ws.addEventListener("close",r),function(){e.ws.removeEventListener("open",t),e.ws.removeEventListener("close",r),i(l,e,n),k.current=null,w.current=null}}},[l,s]),{data:u,connected:d,error:g,disconnect:y}}export{l as useIngestionWebSocket};
|
|
2
2
|
//# sourceMappingURL=useIngestionStatus.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InternalChatCitationRenderer.d.ts","sourceRoot":"","sources":["../../../../../src/features/ChatCitation/InternalChatCitationRenderer.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAU5D,OAAO,qBAAqB,CAAC;AAM7B,UAAU,iBAAiB;IACzB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;
|
|
1
|
+
{"version":3,"file":"InternalChatCitationRenderer.d.ts","sourceRoot":"","sources":["../../../../../src/features/ChatCitation/InternalChatCitationRenderer.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAU5D,OAAO,qBAAqB,CAAC;AAM7B,UAAU,iBAAiB;IACzB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AA8CD,KAAK,iCAAiC,GAAG,iBAAiB,GAAG;IAC3D,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,cAAc,CAAC,EAAE,iBAAiB,CAAC;CACpC,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,4BAA4B,CAAC,EACnD,aAAa,EACb,aAAgC,EAChC,iBAAiB,EACjB,QAAQ,EACR,cAAc,EACd,cAAc,EACd,YAAY,EACZ,yBAAiC,EACjC,iBAAwB,EACxB,aAAmB,EACpB,EAAE,iCAAiC,2CAsgBnC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatCitation.d.ts","sourceRoot":"","sources":["../../../../../../src/features/ChatCitation/components/ChatCitation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,KAAK,iBAAiB,GAAG;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,UAAU,CAAC,EAAE;QACX,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"ChatCitation.d.ts","sourceRoot":"","sources":["../../../../../../src/features/ChatCitation/components/ChatCitation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,KAAK,iBAAiB,GAAG;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,UAAU,CAAC,EAAE;QACX,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAC5B,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;KAC5B,CAAC;IACF,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC;IACnC,gBAAgB,CAAC,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC;IACrC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CACvC,CAAC;AAmDF,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,KAAmB,EACnB,IAAI,EACJ,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,QAAQ,EACR,eAAe,GAChB,EAAE,iBAAiB,2CA0CnB"}
|
|
@@ -42,6 +42,7 @@ export type ChatCitationProps = {
|
|
|
42
42
|
title?: React.CSSProperties;
|
|
43
43
|
relevanceScore?: React.CSSProperties;
|
|
44
44
|
container?: React.CSSProperties;
|
|
45
|
+
body?: React.CSSProperties;
|
|
45
46
|
};
|
|
46
47
|
secondaryActions?: (alreadyPresentSecondaryActions: React.ReactNode[]) => React.ReactNode[];
|
|
47
48
|
};
|
|
@@ -74,6 +75,7 @@ export type ChatCitationProps = {
|
|
|
74
75
|
chatDataContainer?: React.CSSProperties;
|
|
75
76
|
outerContainer?: React.CSSProperties;
|
|
76
77
|
container?: React.CSSProperties;
|
|
78
|
+
body?: React.CSSProperties;
|
|
77
79
|
};
|
|
78
80
|
secondaryActions?: (alreadyPresentSecondaryActions: React.ReactNode[]) => React.ReactNode[];
|
|
79
81
|
};
|
|
@@ -87,6 +89,7 @@ export type ChatCitationProps = {
|
|
|
87
89
|
title?: React.CSSProperties;
|
|
88
90
|
dataContainer?: React.CSSProperties;
|
|
89
91
|
outerContainer?: React.CSSProperties;
|
|
92
|
+
body?: React.CSSProperties;
|
|
90
93
|
};
|
|
91
94
|
secondaryActions?: (alreadyPresentSecondaryActions: React.ReactNode[]) => React.ReactNode[];
|
|
92
95
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"citations.types.d.ts","sourceRoot":"","sources":["../../../../../../src/features/ChatCitation/types/citations.types.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,KAAK,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,MAAM,EAAE,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,WAAW,EAAE,gBAAgB,CAAC;IAC9B,SAAS,CAAC,EAAE,uBAAuB,CAAC,WAAW,CAAC,CAAC;IACjD,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,UAAU,CAAC,EAAE;QACX,OAAO,EAAE,KAAK,CAAC,aAAa,CAAC;QAC7B,UAAU,EAAE,KAAK,CAAC,aAAa,CAAC;KACjC,CAAC;IACF,aAAa,CAAC,EAAE;QACd,OAAO,EAAE,MAAM,CAAC;QAChB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,SAAS,CAAC,EAAE;QACV,OAAO,EAAE,KAAK,CAAC,iBAAiB,CAC9B,KAAK,CAAC,cAAc,CAAC,oBAAoB,CAAC,EAC1C,oBAAoB,CACrB,CAAC;QACF,UAAU,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAClC,KAAK,CAAC,cAAc,CAAC,oBAAoB,CAAC,EAC1C,oBAAoB,CACrB,CAAC;KACH,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,aAAa,CAAC,EAAE;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;QACvB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,UAAU,CAAC,EAAE;YACX,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;YAC5B,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;YACrC,SAAS,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"citations.types.d.ts","sourceRoot":"","sources":["../../../../../../src/features/ChatCitation/types/citations.types.ts"],"names":[],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIngestionStatus.d.ts","sourceRoot":"","sources":["../../../../../src/features/IngestionStatus/useIngestionStatus.tsx"],"names":[],"mappings":"AAEA,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CAC9D;AAED,MAAM,WAAW,QAAQ;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,aAAa,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,sBAAsB;IACrC,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,cAAc,CAAC,EAAE;QACf,aAAa,EAAE,MAAM,CAAC;QACtB,SAAS,EAAE,MAAM,CAAC;QAClB,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH;
|
|
1
|
+
{"version":3,"file":"useIngestionStatus.d.ts","sourceRoot":"","sources":["../../../../../src/features/IngestionStatus/useIngestionStatus.tsx"],"names":[],"mappings":"AAEA,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CAC9D;AAED,MAAM,WAAW,QAAQ;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,aAAa,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,sBAAsB;IACrC,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,cAAc,CAAC,EAAE;QACf,aAAa,EAAE,MAAM,CAAC;QACtB,SAAS,EAAE,MAAM,CAAC;QAClB,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH;AA+GD,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,EAAE,SAAS,CAAC,EAAE,MAAM;;;;;EAqEnF"}
|