| 4153 | `],changeDetection:0})};var $5A=(i,e)=>({"eval-pass":i,"eval-fail":e}),ER=i=>({hidden:i}),QR=(i,e)=>e.id;function AyA(i,e){if(i&1){let A=aA();I(0,"app-content-bubble",11),U("userEditEvalCaseMessageChange",function(n){L(A);let o=p();return G(o.userEditEvalCaseMessageChange.emit(n))})("handleKeydown",function(n){L(A);let o=p();return G(o.handleKeydown.emit(n))})("cancelEditMessage",function(n){L(A);let o=p();return G(o.cancelEditMessage.emit(n))})("saveEditMessage",function(n){L(A);let o=p();return G(o.saveEditMessage.emit(n))})("openViewImageDialog",function(n){L(A);let o=p();return G(o.onImageClick(n))})("openBase64InNewTab",function(n){L(A);let o=p();return G(o.openBase64InNewTab.emit(n))}),h()}if(i&2){let A=p();H("type",A.uiEvent.thought?"thought":"message")("role",A.uiEvent.role)("evalStatus",A.uiEvent.evalStatus)("uiEvent",A.uiEvent)("userEditEvalCaseMessage",A.userEditEvalCaseMessage)}}function eyA(i,e){if(i&1&&lA(0,"app-content-bubble",2),i&2){let A=p();H("uiEvent",A.uiEvent)}}function tyA(i,e){if(i&1&&lA(0,"app-content-bubble",3),i&2){let A=p();H("role","user")("uiEvent",A.uiEvent)}}function iyA(i,e){if(i&1&&lA(0,"app-content-bubble",3),i&2){let A=p();H("role","bot")("uiEvent",A.uiEvent)}}function nyA(i,e){if(i&1){let A=aA();I(0,"app-hover-info-button",12),U("buttonClick",function(n){L(A);let o=p();return G(o.openSystemInstructionDiffDialog(n))}),h()}i&2&&H("icon","warning")("text","Performance")("tooltipContent","System instructions modified between turns, causing a context cache miss and increasing latency. Click to compare changes and view the diff.")("tooltipTitle","Performance Warning")}function oyA(i,e){i&1&&lA(0,"app-hover-info-button",6),i&2&&H("icon","stop_circle")("text","Turn Complete")("tooltipContent","The agent has completed this turn")("tooltipTitle","Turn Complete")}function ayA(i,e){i&1&&lA(0,"app-hover-info-button",6),i&2&&H("icon","report")("text","Interrupted")("tooltipContent","The stream was interrupted")("tooltipTitle","Interrupted")}function ryA(i,e){if(i&1&&lA(0,"app-hover-info-button",6),i&2){let A=e.$implicit,t=p(2);H("icon","bolt")("text",t.getFunctionCallButtonText(A))("tooltipContent",A.args||"")("tooltipTitle","Function Call")}}function syA(i,e){if(i&1){let A=aA();I(0,"app-computer-action",16),U("clickEvent",function(n){L(A);let o=p(3);return G(o.clickEvent.emit(n))})("openImage",function(n){L(A);let o=p(3);return G(o.openViewImageDialog.emit(n))}),h()}if(i&2){let A=p().$implicit,t=p(2);H("functionCall",A)("allMessages",t.uiEvents)("index",t.index)}}function lyA(i,e){if(i&1&&T(0,syA,1,3,"app-computer-action",15),i&2){let A=e.$implicit,t=p(2);O(t.isComputerUseClick(A)?0:-1)}}function gyA(i,e){if(i&1&&(I(0,"div",13),ke(1,ryA,1,4,"app-hover-info-button",6,QR),h(),I(3,"div",14),ke(4,lyA,1,1,null,null,QR),h()),i&2){let A=p();Q(),_e(A.uiEvent.functionCalls),Q(3),_e(A.uiEvent.functionCalls)}}function cyA(i,e){if(i&1){let A=aA();I(0,"app-computer-action",19),U("clickEvent",function(n){L(A);let o=p(3);return G(o.clickEvent.emit(n))}),h()}if(i&2){let A=p().$implicit,t=p(2);H("functionResponse",A)("allMessages",t.uiEvents)("index",t.index)}}function CyA(i,e){if(i&1){let A=aA();I(0,"div",18),lA(1,"app-hover-info-button",6),I(2,"button",20),U("click",function(n){return n.stopPropagation()}),I(3,"mat-icon",21),D(4,"more_vert"),h()(),I(5,"mat-menu",null,0)(7,"button",22),U("click",function(){L(A);let n=p().$implicit,o=p(2);return G(o.openSendAnotherResponseDialog(n))}),I(8,"span"),D(9,"Send another response"),h()()()()}if(i&2){let A=Bi(6),t=p().$implicit;Q(),H("icon","check")("text",t.name)("tooltipContent",t.response||"")("tooltipTitle","Function Response"),Q(),H("matMenuTriggerFor",A)}}function dyA(i,e){if(i&1&&T(0,cyA,1,3,"app-computer-action",17)(1,CyA,10,5,"div",18),i&2){let A=e.$implicit,t=p(2);O(t.isComputerUseResponse(A)?0:1)}}function IyA(i,e){if(i&1&&ke(0,dyA,2,1,null,null,ni),i&2){let A=p();_e(A.uiEvent.functionResponses)}}function ByA(i,e){if(i&1&&lA(0,"app-hover-info-button",6),i&2){let A=p(),t=Ki(10);H("icon","data_object")("text","State: "+t.join(", "))("tooltipContent",A.getFilteredStateDelta(A.uiEvent.stateDelta))("tooltipTitle","State Update")}}function hyA(i,e){if(i&1&&lA(0,"app-hover-info-button",6),i&2){p();let A=Ki(0),t=p();H("icon","attachment")("text","Artifact: "+A.join(", "))("tooltipContent",t.uiEvent.artifactDelta)("tooltipTitle","Artifact")}}function EyA(i,e){if(i&1&&(ro(0),T(1,hyA,1,4,"app-hover-info-button",6)),i&2){let A=p(),t=so(A.Object.keys(A.uiEvent.artifactDelta));Q(),O(t.length>0?1:-1)}}function QyA(i,e){if(i&1&&lA(0,"app-content-bubble",7),i&2){let A=p();H("uiEvent",A.uiEvent)}}function uyA(i,e){if(i&1&&lA(0,"app-hover-info-button",6),i&2){let A=p();H("icon","route")("text","route: "+A.String(A.uiEvent.route))("tooltipContent",A.uiEvent.route)("tooltipTitle","Route")}}function pyA(i,e){if(i&1&&lA(0,"app-hover-info-button",6),i&2){let A=p();H("icon","swap_horiz")("text",A.uiEvent.author+" \u2192 "+A.getTransferTargetName())("tooltipContent",A.uiEvent.transferToAgent)("tooltipTitle","Transfer to Agent")}}function fyA(i,e){if(i&1){let A=aA();I(0,"button",23),U("click",function(n){L(A);let o=p();return G(o.agentStateClick.emit({event:n,index:o.index}))}),I(1,"mat-icon"),D(2,"account_tree"),h(),D(3," Agent State "),h()}if(i&2){let A=p();H("appWorkflowGraphTooltip",A.getWorkflowNodes())("agentGraphData",A.agentGraphData)("nodePath",A.uiEvent.nodePath)("allNodes",A.allWorkflowNodes)}}function myA(i,e){if(i&1&&lA(0,"app-hover-info-button",9),i&2){let A=p();H("icon","check_circle")("text",A.getEndOfAgentAuthor()+" completed!")}}function wyA(i,e){if(i&1){let A=aA();I(0,"app-long-running-response",25),U("responseComplete",function(n){L(A);let o=p(3);return G(o.longRunningResponseComplete.emit(n))}),h()}if(i&2){let A=p().$implicit,t=p(2);H("functionCall",A)("appName",t.appName)("userId",t.userId)("sessionId",t.sessionId)}}function yyA(i,e){if(i&1&&T(0,wyA,1,4,"app-long-running-response",24),i&2){let A=e.$implicit,t=p(2);O(A.needsResponse&&!t.hasFunctionResponse(A.id)?0:-1)}}function DyA(i,e){if(i&1&&ke(0,yyA,1,1,null,null,QR),i&2){let A=p();_e(A.uiEvent.functionCalls)}}function vyA(i,e){if(i&1&&(I(0,"div",10)(1,"span",26),D(2),h()()),i&2){let A=p();H("ngClass",L0(2,$5A,A.uiEvent.evalStatus===1,A.uiEvent.evalStatus===2)),Q(2),nA(A.uiEvent.evalStatus===1?A.i18n.evalPassLabel:A.uiEvent.evalStatus===2?A.i18n.evalFailLabel:"")}}function byA(i,e){if(i&1){let A=aA();I(0,"div")(1,"span",27),U("click",function(){L(A);let n=p(2);return G(n.editEvalCaseMessage.emit(n.uiEvent))}),D(2," edit "),h(),I(3,"span",27),U("click",function(){L(A);let n=p(2);return G(n.deleteEvalCaseMessage.emit({message:n.uiEvent,index:n.index}))}),D(4," delete "),h()()}if(i&2){let A=p(2);Q(),H("ngClass",jl(4,ER,A.isEvalCaseEditing))("matTooltip",A.i18n.editEvalMessageTooltip),Q(2),H("ngClass",jl(6,ER,A.isEvalCaseEditing))("matTooltip",A.i18n.deleteEvalMessageTooltip)}}function MyA(i,e){if(i&1){let A=aA();I(0,"div")(1,"span",27),U("click",function(){L(A);let n=p(2);return G(n.editFunctionArgs.emit(n.uiEvent))}),D(2," edit "),h()()}if(i&2){let A=p(2);Q(),H("ngClass",jl(2,ER,A.isEvalCaseEditing))("matTooltip",A.i18n.editFunctionArgsTooltip)}}function SyA(i,e){if(i&1&&T(0,byA,5,8,"div")(1,MyA,3,4,"div"),i&2){let A=p();O(A.uiEvent.text?0:A.isEditFunctionArgsEnabled&&A.uiEvent.functionCalls&&A.uiEvent.functionCalls.length>0?1:-1)}}var bE=class i{uiEvent;index;uiEvents=[];appName="";userId="";sessionId="";sessionName="";evalCase=null;isEvalEditMode=!1;isEvalCaseEditing=!1;isEditFunctionArgsEnabled=!1;userEditEvalCaseMessage="";agentGraphData=null;allWorkflowNodes=null;handleKeydown=new FA;cancelEditMessage=new FA;saveEditMessage=new FA;userEditEvalCaseMessageChange=new FA;openViewImageDialog=new FA;openBase64InNewTab=new FA;editEvalCaseMessage=new FA;deleteEvalCaseMessage=new FA;editFunctionArgs=new FA;clickEvent=new FA;longRunningResponseComplete=new FA;agentStateClick=new FA;i18n=w(C1);dialog=w(Xa);Object=Object;String=String;getFunctionCallButtonText(e){let A=e.args;if(A&&typeof A=="string")try{A=JSON.parse(A)}catch(t){}if(A&&typeof A=="object"){let t={EditFile:"path",WriteFile:"path"};if(e.name in t){let o=t[e.name];if(o in A){let a=this.formatPythonValue(A[o]),r=Object.keys(A).length>1;return`${e.name}(${a}${r?", \u2026":""})`}}let n=Object.keys(A);if(n.length===1){let o=A[n[0]],a=this.formatPythonValue(o);return`${e.name}(${a})`}else if(n.length===0)return`${e.name}()`}else if(!A)return`${e.name}()`;return e.name}formatPythonValue(e){return e==null?"None":typeof e=="boolean"?e?"True":"False":typeof e=="string"?`"${e}"`:typeof e=="object"?JSON.stringify(e).replace(/\btrue\b/g,"True").replace(/\bfalse\b/g,"False").replace(/\bnull\b/g,"None"):String(e)}shouldShowMessageCard(e){return!!(e.text||e.attachments||e.inlineData||e.executableCode||e.codeExecutionResult||e.a2uiData||e.renderedContent||e.isLoading||e.failedMetric&&e.evalStatus===2||e.event?.content?.parts?.some(A=>A.fileData))}isComputerUseClick(e){return vE(e)}isComputerUseResponse(e){return k0(e)}getFilteredStateKeys(e){return e?Object.keys(e).filter(A=>A!=="__llm_request_key__"):[]}getFilteredStateDelta(e){if(!e)return null;let A=P({},e);return delete A.__llm_request_key__,A}hasWorkflowNodes(){let e=this.uiEvent.event?.actions?.agentState?.nodes;return!!e&&Object.keys(e).length>0}getWorkflowNodes(){return this.uiEvent.event?.actions?.agentState?.nodes||null}hasEndOfAgent(){return this.uiEvent.event?.actions?.endOfAgent===!0}getEndOfAgentAuthor(){return this.uiEvent.event?.author||"Agent"}getTransferTargetName(){let e=this.uiEvent.transferToAgent;return e?typeof e=="string"?e:e.agentName||e.name||e.targetAgent||JSON.stringify(e):""}hasFunctionResponse(e){return e?this.uiEvents.some(A=>A.functionResponses?.some(t=>t.id===e&&t.response?.status!=="pending")):!1}openSendAnotherResponseDialog(e){let A="",t=e.id;if(t){for(let o of this.uiEvents)if(o.functionCalls){let a=o.functionCalls.find(r=>r.id===t);if(a){A=a.functionCallEventId||o.event?.id||"";break}}}this.dialog.open(CI,{data:{dialogHeader:"Send Another Response",functionName:e.name,jsonContent:e.response},width:"600px"}).afterClosed().subscribe(o=>{if(o){let a={role:"user",parts:[{functionResponse:{id:t,name:e.name,response:o}}],functionCallEventId:A};this.longRunningResponseComplete.emit(a)}})}getAllImages(){let e=[],A=new Set,t=n=>{A.has(n)||(A.add(n),e.push(n))};for(let n of this.uiEvents){if(n.attachments)for(let a of n.attachments)a.file.type.startsWith("image/")&&a.url&&t(a.url);n.inlineData?.mimeType?.startsWith("image/")&&n.inlineData.data&&t(n.inlineData.data);let o=n.event?.content?.parts;if(Array.isArray(o)){for(let a of o)if(a.inlineData?.mimeType?.startsWith("image/")&&a.inlineData.data){let r=a.inlineData.mimeType,s=a.inlineData.data.replace(/-/g,"+").replace(/_/g,"/");t(`data:${r};base64,${s}`)}}if(n.functionResponses){for(let a of n.functionResponses)if(this.isComputerUseResponse(a)){let s=a.response?.image;if(s?.data){let l=s.data,g=s.mimetype||"image/png",C=l.startsWith("data:")?l:`data:${g};base64,${l}`;t(C)}}}}return e}onImageClick(e){let A=this.getAllImages(),t=A.indexOf(e);this.openViewImageDialog.emit({images:A,currentIndex:t})}openSystemInstructionDiffDialog(e){e.stopPropagation();let A=this.uiEvent.event.precedingSystemInstruction||"",t=this.uiEvent.event.currentSystemInstruction||"";this.dialog.open(dy,{data:{precedingInstruction:A,currentInstruction:t},maxWidth:"95vw",maxHeight:"95vh",width:"85vw",height:"90vh",panelClass:"system-instruction-diff-dialog-panel"})}static \u0275fac=function(A){return new(A||i)};static \u0275cmp=vA({type:i,selectors:[["app-event-content"]],inputs:{uiEvent:"uiEvent",index:"index",uiEvents:"uiEvents",appName:"appName",userId:"userId",sessionId:"sessionId",sessionName:"sessionName",evalCase:"evalCase",isEvalEditMode:"isEvalEditMode",isEvalCaseEditing:"isEvalCaseEditing",isEditFunctionArgsEnabled:"isEditFunctionArgsEnabled",userEditEvalCaseMessage:"userEditEvalCaseMessage",agentGraphData:"agentGraphData",allWorkflowNodes:"allWorkflowNodes"},outputs:{handleKeydown:"handleKeydown",cancelEditMessage:"cancelEditMessage",saveEditMessage:"saveEditMessage",userEditEvalCaseMessageChange:"userEditEvalCaseMessageChange",openViewImageDialog:"openViewImageDialog",openBase64InNewTab:"openBase64InNewTab",editEvalCaseMessage:"editEvalCaseMessage",deleteEvalCaseMessage:"deleteEvalCaseMessage",editFunctionArgs:"editFunctionArgs",clickEvent:"clickEvent",longRunningResponseComplete:"longRunningResponseComplete",agentStateClick:"agentStateClick"},decls:21,vars:20,consts:[["responseMenu","matMenu"],[3,"type","role","evalStatus","uiEvent","userEditEvalCaseMessage"],["type","output",3,"uiEvent"],["type","transcription",3,"role","uiEvent"],[1,"event-chips-container"],[1,"performance-warning-btn",3,"icon","text","tooltipContent","tooltipTitle"],[3,"icon","text","tooltipContent","tooltipTitle"],["type","error",3,"uiEvent"],["mat-stroked-button","",1,"event-action-button",3,"appWorkflowGraphTooltip","agentGraphData","nodePath","allNodes"],[3,"icon","text"],[3,"ngClass"],[3,"userEditEvalCaseMessageChange","handleKeydown","cancelEditMessage","saveEditMessage","openViewImageDialog","openBase64InNewTab","type","role","evalStatus","uiEvent","userEditEvalCaseMessage"],[1,"performance-warning-btn",3,"buttonClick","icon","text","tooltipContent","tooltipTitle"],[1,"function-calls-buttons"],[1,"function-calls-previews"],[3,"functionCall","allMessages","index"],[3,"clickEvent","openImage","functionCall","allMessages","index"],[3,"functionResponse","allMessages","index"],[1,"function-response-chip-container"],[3,"clickEvent","functionResponse","allMessages","index"],["mat-icon-button","",1,"menu-trigger-btn",3,"click","matMenuTriggerFor"],[1,"more-icon"],["mat-menu-item","",3,"click"],["mat-stroked-button","",1,"event-action-button",3,"click","appWorkflowGraphTooltip","agentGraphData","nodePath","allNodes"],[3,"functionCall","appName","userId","sessionId"],[3,"responseComplete","functionCall","appName","userId","sessionId"],[2,"font-family","monospace"],[1,"material-symbols-outlined","eval-case-edit-button",3,"click","ngClass","matTooltip"]],template:function(A,t){if(A&1&&(T(0,AyA,1,5,"app-content-bubble",1),T(1,eyA,1,1,"app-content-bubble",2),T(2,tyA,1,2,"app-content-bubble",3),T(3,iyA,1,2,"app-content-bubble",3),I(4,"div",4),T(5,nyA,1,4,"app-hover-info-button",5),T(6,oyA,1,4,"app-hover-info-button",6),T(7,ayA,1,4,"app-hover-info-button",6),T(8,gyA,6,0),T(9,IyA,2,0),ro(10),T(11,ByA,1,4,"app-hover-info-button",6),T(12,EyA,2,2),T(13,QyA,1,1,"app-content-bubble",7),T(14,uyA,1,4,"app-hover-info-button",6),T(15,pyA,1,4,"app-hover-info-button",6),T(16,fyA,4,4,"button",8),T(17,myA,1,2,"app-hover-info-button",9),h(),T(18,DyA,2,0),T(19,vyA,3,5,"div",10),T(20,SyA,2,1)),A&2){O(t.shouldShowMessageCard(t.uiEvent)?0:-1),Q(),O(t.uiEvent.event.output?1:-1),Q(),O(t.uiEvent.event.inputTranscription?2:-1),Q(),O(t.uiEvent.event.outputTranscription?3:-1),Q(2),O(t.uiEvent.event.systemInstructionChanged?5:-1),Q(),O(t.uiEvent.event.turnComplete?6:-1),Q(),O(t.uiEvent.event.interrupted?7:-1),Q(),O(t.uiEvent.functionCalls&&t.uiEvent.functionCalls.length>0?8:-1),Q(),O(t.uiEvent.functionResponses&&t.uiEvent.functionResponses.length>0?9:-1),Q();let n=so(t.getFilteredStateKeys(t.uiEvent.stateDelta));Q(),O(n.length>0?11:-1),Q(),O(t.uiEvent.artifactDelta?12:-1),Q(),O(t.uiEvent.error?13:-1),Q(),O(t.uiEvent.route?14:-1),Q(),O(t.uiEvent.transferToAgent?15:-1),Q(),O(t.hasWorkflowNodes()?16:-1),Q(),O(t.hasEndOfAgent()?17:-1),Q(),O(t.uiEvent.functionCalls&&t.uiEvent.functionCalls.length>0?18:-1),Q(),O(t.uiEvent.evalStatus===1||t.uiEvent.evalStatus===2?19:-1),Q(),O(t.evalCase&&t.isEvalEditMode?20:-1)}},dependencies:[li,Vl,Un,zt,qi,ki,yi,Ha,rn,ay,ry,ly,sy,cy,s2,hs,Gs,tg],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;width:100%}app-content-bubble[_ngcontent-%COMP%] + app-content-bubble[_ngcontent-%COMP%]{margin-top:5px}.event-chips-container[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;width:100%}.user[_nghost-%COMP%] .event-chips-container[_ngcontent-%COMP%], .user [_nghost-%COMP%] .event-chips-container[_ngcontent-%COMP%]{justify-content:flex-end}.eval-case-edit-button[_ngcontent-%COMP%]{cursor:pointer;margin-left:4px;margin-right:4px}.eval-pass[_ngcontent-%COMP%]{display:flex;color:#2e7d32}.eval-fail[_ngcontent-%COMP%]{display:flex;color:var(--mat-sys-error)}.hidden[_ngcontent-%COMP%]{visibility:hidden}.event-action-button[_ngcontent-%COMP%]{margin:5px}.function-calls-previews[_ngcontent-%COMP%]{width:100%}.function-response-chip-container[_ngcontent-%COMP%]{display:inline-flex;align-items:center;position:relative}.function-response-chip-container[_ngcontent-%COMP%] .menu-trigger-btn[_ngcontent-%COMP%]{visibility:hidden;width:20px;height:20px;display:inline-flex;align-items:center;justify-content:center;padding:0;position:absolute;right:10px;top:50%;transform:translateY(-50%);background-color:var(--mat-sys-surface-container-high);border-radius:50%;z-index:2}.function-response-chip-container[_ngcontent-%COMP%] .menu-trigger-btn[_ngcontent-%COMP%] .more-icon[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px;line-height:16px}.function-response-chip-container[_ngcontent-%COMP%]:hover .menu-trigger-btn[_ngcontent-%COMP%]{visibility:visible} .performance-warning-btn.hover-info-button, .performance-warning-btn .hover-info-button{background-color:#ffb3001a!important;border:1px solid rgba(255,179,0,.3)!important} .performance-warning-btn.hover-info-button mat-icon, .performance-warning-btn .hover-info-button mat-icon{color:#ffb300!important} .performance-warning-btn.hover-info-button:hover, .performance-warning-btn .hover-info-button:hover{background-color:#ffb30033!important;box-shadow:0 2px 6px #ffb30026}html.light-theme[_ngcontent-%COMP%] .performance-warning-btn.hover-info-button, html.light-theme[_ngcontent-%COMP%] .performance-warning-btn .hover-info-button{background-color:#e6510014!important;border:1px solid rgba(230,81,0,.3)!important}html.light-theme[_ngcontent-%COMP%] .performance-warning-btn.hover-info-button mat-icon, html.light-theme[_ngcontent-%COMP%] .performance-warning-btn .hover-info-button mat-icon{color:#e65100!important}html.light-theme[_ngcontent-%COMP%] .performance-warning-btn.hover-info-button:hover, html.light-theme[_ngcontent-%COMP%] .performance-warning-btn .hover-info-button:hover{background-color:#e6510026!important;box-shadow:0 2px 6px #e6510026}"]})};function kyA(i,e){if(i&1&&lA(0,"app-chat-avatar",1),i&2){let A=p();H("role",A.uiEvent.event.content?"bot":"node")("author",A.uiEvent.author)("nodePath",A.uiEvent.nodePath)}}function _yA(i,e){i&1&&lA(0,"div",4)}function xyA(i,e){if(i&1&&ke(0,_yA,1,0,"div",4,ni),i&2){let A=p();_e(A.indentationArray)}}function RyA(i,e){i&1&&lA(0,"app-chat-avatar")}function NyA(i,e){if(i&1&&lA(0,"app-message-feedback",3),i&2){let A=p();H("sessionName",A.sessionName)("eventId",A.uiEvent.event.id||"")}}var Iy=class i{uiEvent;index;uiEvents=[];isSelected=!1;isSelectable=!0;appName="";userId="";sessionId="";sessionName="";evalCase=null;isEvalEditMode=!1;isEvalCaseEditing=!1;isEditFunctionArgsEnabled=!1;userEditEvalCaseMessage="";agentGraphData=null;allWorkflowNodes=null;isUserFeedbackEnabled=!1;isLoadingAgentResponse=!1;rowClick=new FA;handleKeydown=new FA;cancelEditMessage=new FA;saveEditMessage=new FA;userEditEvalCaseMessageChange=new FA;openViewImageDialog=new FA;openBase64InNewTab=new FA;editEvalCaseMessage=new FA;deleteEvalCaseMessage=new FA;editFunctionArgs=new FA;clickEvent=new FA;longRunningResponseComplete=new FA;agentStateClick=new FA;onRowClick(e){this.isSelectable&&this.rowClick.emit({event:e,uiEvent:this.uiEvent,index:this.index})}get indentationDepth(){if(!this.uiEvent.nodePath)return 0;let A=this.uiEvent.nodePath.split("/").filter(Boolean).length;return A>2?A-2:0}get indentationArray(){let e=this.indentationDepth;return e>0?Array.from({length:e},(A,t)=>t):[]}static \u0275fac=function(A){return new(A||i)};static \u0275cmp=vA({type:i,selectors:[["app-event-row"]],hostAttrs:[1,"message-row-container"],hostVars:8,hostBindings:function(A,t){A&1&&U("click",function(o){return t.onRowClick(o)}),A&2&&_A("selected",t.isSelected)("user",t.uiEvent.role==="user")("bot",t.uiEvent.role==="bot")("selectable",t.isSelectable)},inputs:{uiEvent:"uiEvent",index:"index",uiEvents:"uiEvents",isSelected:"isSelected",isSelectable:"isSelectable",appName:"appName",userId:"userId",sessionId:"sessionId",sessionName:"sessionName",evalCase:"evalCase",isEvalEditMode:"isEvalEditMode",isEvalCaseEditing:"isEvalCaseEditing",isEditFunctionArgsEnabled:"isEditFunctionArgsEnabled",userEditEvalCaseMessage:"userEditEvalCaseMessage",agentGraphData:"agentGraphData",allWorkflowNodes:"allWorkflowNodes",isUserFeedbackEnabled:"isUserFeedbackEnabled",isLoadingAgentResponse:"isLoadingAgentResponse"},outputs:{rowClick:"rowClick",handleKeydown:"handleKeydown",cancelEditMessage:"cancelEditMessage",saveEditMessage:"saveEditMessage",userEditEvalCaseMessageChange:"userEditEvalCaseMessageChange",openViewImageDialog:"openViewImageDialog",openBase64InNewTab:"openBase64InNewTab",editEvalCaseMessage:"editEvalCaseMessage",deleteEvalCaseMessage:"deleteEvalCaseMessage",editFunctionArgs:"editFunctionArgs",clickEvent:"clickEvent",longRunningResponseComplete:"longRunningResponseComplete",agentStateClick:"agentStateClick"},decls:7,vars:21,consts:[[1,"event-number-container"],[3,"role","author","nodePath"],[1,"message-content",3,"userEditEvalCaseMessageChange","handleKeydown","cancelEditMessage","saveEditMessage","openViewImageDialog","openBase64InNewTab","editEvalCaseMessage","deleteEvalCaseMessage","editFunctionArgs","clickEvent","longRunningResponseComplete","agentStateClick","uiEvent","index","uiEvents","appName","userId","sessionId","sessionName","evalCase","isEvalEditMode","isEvalCaseEditing","isEditFunctionArgsEnabled","userEditEvalCaseMessage","agentGraphData","allWorkflowNodes"],[3,"sessionName","eventId"],[1,"indentation-line"]],template:function(A,t){A&1&&(I(0,"div",0),D(1),h(),T(2,kyA,1,3,"app-chat-avatar",1),T(3,xyA,2,0),I(4,"app-event-content",2),U("userEditEvalCaseMessageChange",function(o){return t.userEditEvalCaseMessageChange.emit(o)})("handleKeydown",function(o){return t.handleKeydown.emit(o)})("cancelEditMessage",function(o){return t.cancelEditMessage.emit(o)})("saveEditMessage",function(o){return t.saveEditMessage.emit(o)})("openViewImageDialog",function(o){return t.openViewImageDialog.emit(o)})("openBase64InNewTab",function(o){return t.openBase64InNewTab.emit(o)})("editEvalCaseMessage",function(o){return t.editEvalCaseMessage.emit(o)})("deleteEvalCaseMessage",function(o){return t.deleteEvalCaseMessage.emit(o)})("editFunctionArgs",function(o){return t.editFunctionArgs.emit(o)})("clickEvent",function(o){return t.clickEvent.emit(o)})("longRunningResponseComplete",function(o){return t.longRunningResponseComplete.emit(o)})("agentStateClick",function(o){return t.agentStateClick.emit(o)}),h(),T(5,RyA,1,0,"app-chat-avatar"),T(6,NyA,1,2,"app-message-feedback",3)),A&2&&(_A("hidden",!t.isSelectable),Q(),Ee(" #",t.index+1," "),Q(),O(t.uiEvent.role==="bot"&&!t.uiEvent.isLoading?2:-1),Q(),O(t.uiEvent.role==="bot"?3:-1),Q(),H("uiEvent",t.uiEvent)("index",t.index)("uiEvents",t.uiEvents)("appName",t.appName)("userId",t.userId)("sessionId",t.sessionId)("sessionName",t.sessionName)("evalCase",t.evalCase)("isEvalEditMode",t.isEvalEditMode)("isEvalCaseEditing",t.isEvalCaseEditing)("isEditFunctionArgsEnabled",t.isEditFunctionArgsEnabled)("userEditEvalCaseMessage",t.userEditEvalCaseMessage)("agentGraphData",t.agentGraphData)("allWorkflowNodes",t.allWorkflowNodes),Q(),O(t.uiEvent.role==="user"?5:-1),Q(),O(t.isUserFeedbackEnabled&&!t.isLoadingAgentResponse&&t.uiEvent.role==="bot"?6:-1))},dependencies:[li,ny,ty,bE],styles:[".generated-image-container[_ngcontent-%COMP%]{max-width:400px;margin-left:20px}.generated-image[_ngcontent-%COMP%]{max-width:100%;min-width:40px;border-radius:8px}.html-artifact-container[_ngcontent-%COMP%]{width:100%;display:flex;justify-content:flex-start;align-items:center}app-content-bubble[_ngcontent-%COMP%] + app-content-bubble[_ngcontent-%COMP%]{margin-top:5px}.event-chips-container[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;width:100%}[_nghost-%COMP%]{display:flex;flex-direction:row;flex-wrap:nowrap;margin-left:-20px;margin-right:-20px;padding:4px 20px;border-radius:4px;transition:all .2s ease}.selectable[_nghost-%COMP%]:hover{box-shadow:inset 0 0 0 2px var(--mat-sys-outline-variant, rgba(0, 0, 0, .12))}.selected[_nghost-%COMP%]{background-color:var(--mat-sys-secondary-container, rgba(0, 0, 0, .08))!important}app-message-feedback[_ngcontent-%COMP%]{width:100%}.user[_nghost-%COMP%]{justify-content:flex-end;align-items:flex-start;gap:15px}.bot[_nghost-%COMP%]{align-items:flex-start;padding-right:48px}.bot[_nghost-%COMP%] app-chat-avatar[_ngcontent-%COMP%]{align-self:flex-start}.message-content[_ngcontent-%COMP%]{display:contents}.bot[_nghost-%COMP%] > .message-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1;min-width:0;align-items:flex-start}.user[_nghost-%COMP%] > .message-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1;min-width:0;align-items:flex-end}.bot[_nghost-%COMP%]:focus-within app-content-bubble[_ngcontent-%COMP%] .content-bubble{border:1px solid var(--mat-sys-outline)}.message-textarea[_ngcontent-%COMP%]{max-width:100%;border:none;background-color:transparent;font-family:Google Sans,Helvetica Neue,sans-serif}.message-textarea[_ngcontent-%COMP%]:focus{outline:none}.edit-message-buttons-container[_ngcontent-%COMP%]{display:flex;justify-content:flex-end}app-content-bubble[_ngcontent-%COMP%] .eval-compare-container[_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:10px;overflow:hidden;border-radius:20px;padding:5px 20px;margin-bottom:10px;font-size:16px}app-content-bubble[_ngcontent-%COMP%] .eval-compare-container[_ngcontent-%COMP%] .actual-result[_ngcontent-%COMP%]{border-right:2px solid var(--mat-sys-outline-variant);padding-right:8px;min-width:350px;max-width:350px}app-content-bubble[_ngcontent-%COMP%] .eval-compare-container[_ngcontent-%COMP%] .expected-result[_ngcontent-%COMP%]{padding-left:12px;min-width:350px;max-width:350px}app-content-bubble[_ngcontent-%COMP%]:hover .eval-compare-container[_ngcontent-%COMP%]{visibility:visible}.actual-expected-compare-container[_ngcontent-%COMP%]{display:flex}.score-threshold-container[_ngcontent-%COMP%]{display:flex;justify-content:center;gap:10px;align-items:center;margin-top:15px;font-size:14px;font-weight:600}.eval-response-header[_ngcontent-%COMP%]{padding-bottom:5px;border-bottom:2px solid var(--mat-sys-outline-variant);font-style:italic;font-weight:700}.header-expected[_ngcontent-%COMP%]{color:var(--mat-sys-tertiary)}.header-actual[_ngcontent-%COMP%]{color:var(--mat-sys-primary)}.eval-case-edit-button[_ngcontent-%COMP%]{cursor:pointer;margin-left:4px;margin-right:4px}.eval-pass[_ngcontent-%COMP%]{display:flex;color:#2e7d32}.eval-fail[_ngcontent-%COMP%]{display:flex;color:var(--mat-sys-error)}.hidden[_ngcontent-%COMP%]{visibility:hidden}.image-preview-chat[_ngcontent-%COMP%]{max-width:90%;max-height:70vh;width:auto;height:auto;border-radius:8px;cursor:pointer;transition:transform .2s ease-in-out}.attachment[_ngcontent-%COMP%]{display:flex;align-items:center}[_nghost-%COMP%] .message-text p{white-space:pre-line;word-break:break-word;overflow-wrap:break-word}.event-number-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-self:flex-start;min-width:30px;margin-top:10px;margin-right:8px;font-size:12px;font-weight:600;text-align:center;color:var(--mat-sys-on-surface-variant)}[_nghost-%COMP%] pre{white-space:pre-wrap;word-break:break-word;overflow-x:auto;max-width:100%}.link-style-button[_ngcontent-%COMP%]{border:none;padding:0;font:inherit;color:var(--mat-sys-primary)!important;text-decoration:underline;cursor:pointer;outline:none;font-size:14px}.cancel-edit-button[_ngcontent-%COMP%]{width:24px;height:24px;color:var(--mat-sys-outline-variant);cursor:pointer;margin-right:16px}.save-edit-button[_ngcontent-%COMP%]{width:24px;height:24px;color:var(--mat-sys-primary);cursor:pointer;margin-right:16px}.indentation-line[_ngcontent-%COMP%]{width:20px;border-left:1px solid var(--mat-sys-outline-variant);align-self:stretch;opacity:.5;margin-top:-4px;margin-bottom:-4px}@media(max-width:768px){[_nghost-%COMP%]{margin-left:-12px!important;margin-right:-12px!important;padding:4px 12px!important}.bot[_nghost-%COMP%]{padding-right:12px!important}.indentation-line[_ngcontent-%COMP%]{width:12px!important}.event-number-container[_ngcontent-%COMP%]{min-width:20px!important;margin-right:4px!important}}"]})};function FyA(i,e){if(i&1){let A=aA();I(0,"button",3),U("click",function(){L(A);let n=p();return G(n.toggleVideoRecording.emit())}),I(1,"mat-icon"),D(2,"videocam"),h()(),I(3,"div",4),lA(4,"div",5)(5,"div",5)(6,"div",5)(7,"div",5),h()}if(i&2){let A=p();_A("recording",A.isVideoRecording),H("matTooltip",A.isVideoRecording?A.i18n.turnOffCamTooltip:A.i18n.useCamTooltip)("disabled",A.disabled||!A.isBidiStreamingEnabled),Q(4),ft("height",4+A.micVolume*16,"px"),Q(),ft("height",4+A.micVolume*24,"px"),Q(),ft("height",4+A.micVolume*18,"px"),Q(),ft("height",4+A.micVolume*14,"px")}}function LyA(i,e){if(i&1){let A=aA();I(0,"div",2)(1,"div",6),D(2,"Live Flags"),h(),I(3,"div",7)(4,"mat-checkbox",8),U("change",function(n){L(A);let o=p();return G(o.flags.proactiveAudio=n.checked)}),D(5,"Proactive Audio"),h()(),I(6,"div",7)(7,"mat-checkbox",8),U("change",function(n){L(A);let o=p();return G(o.flags.enableAffectiveDialog=n.checked)}),D(8,"Affective Dialog"),h()(),I(9,"div",7)(10,"mat-checkbox",8),U("change",function(n){L(A);let o=p();return G(o.flags.enableSessionResumption=n.checked)}),D(11,"Session Resumption"),h()(),I(12,"div",7)(13,"mat-checkbox",8),U("change",function(n){L(A);let o=p();return G(o.flags.saveLiveBlob=n.checked)}),D(14,"Save Live Blob"),h()()()}if(i&2){let A=p();Q(4),H("checked",A.flags.proactiveAudio)("matTooltip",A.i18n.proactiveAudioTooltip)("disabled",A.disabled),Q(3),H("checked",A.flags.enableAffectiveDialog)("matTooltip",A.i18n.affectiveDialogTooltip)("disabled",A.disabled),Q(3),H("checked",A.flags.enableSessionResumption)("matTooltip",A.i18n.sessionResumptionTooltip)("disabled",A.disabled),Q(3),H("checked",A.flags.saveLiveBlob)("matTooltip",A.i18n.saveLiveBlobTooltip)("disabled",A.disabled)}}var By=class i{get inCall(){return this.isAudioRecording}isAudioRecording=!1;isVideoRecording=!1;micVolume=0;isBidiStreamingEnabled=!1;disabled=!1;toggleAudioRecording=new FA;toggleVideoRecording=new FA;i18n=w(C1);showFlags=!1;flags={proactiveAudio:!1,enableAffectiveDialog:!1,enableSessionResumption:!1,saveLiveBlob:!1};onCallClick(){this.showFlags=!1,this.toggleAudioRecording.emit(this.flags)}static \u0275fac=function(A){return new(A||i)};static \u0275cmp=vA({type:i,selectors:[["app-call-controls"]],hostVars:2,hostBindings:function(A,t){A&2&&_A("in-call",t.inCall)},inputs:{isAudioRecording:"isAudioRecording",isVideoRecording:"isVideoRecording",micVolume:"micVolume",isBidiStreamingEnabled:"isBidiStreamingEnabled",disabled:"disabled"},outputs:{toggleAudioRecording:"toggleAudioRecording",toggleVideoRecording:"toggleVideoRecording"},decls:6,vars:6,consts:[[1,"call-btn-container",3,"mouseenter","mouseleave"],["mat-icon-button","",1,"audio-rec-btn",3,"click","disabled"],[1,"flags-panel"],["mat-icon-button","",1,"video-rec-btn",3,"click","matTooltip","disabled"],[1,"mic-visualizer"],[1,"bar"],[1,"flags-title"],[1,"flag-item"],["matTooltipPosition","left",3,"change","checked","matTooltip","disabled"]],template:function(A,t){A&1&&(T(0,FyA,8,12),I(1,"div",0),U("mouseenter",function(){return t.showFlags=!0})("mouseleave",function(){return t.showFlags=!1}),I(2,"button",1),U("click",function(){return t.onCallClick()}),I(3,"mat-icon"),D(4),h()(),T(5,LyA,15,12,"div",2),h()),A&2&&(O(t.isAudioRecording?0:-1),Q(2),_A("recording",t.isAudioRecording),H("disabled",t.disabled||!t.isBidiStreamingEnabled),Q(2),nA(t.isAudioRecording?"call_end":"call"),Q(),O(t.showFlags&&!t.isAudioRecording&&!t.disabled?5:-1))},dependencies:[li,qi,yi,Un,zt,Ha,rn,uO,ic],styles:['[_nghost-%COMP%]{display:flex;align-items:center;gap:4px;border-radius:28px;transition:all .2s ease}.in-call[_nghost-%COMP%]{background-color:var(--mat-sys-surface-variant)}button[_ngcontent-%COMP%]:not(:disabled){color:var(--mat-sys-on-surface-variant)!important}button[_ngcontent-%COMP%]:not(:disabled).recording{background-color:var(--mat-sys-error)!important;color:var(--mat-sys-on-error, #ffffff)!important}button.audio-rec-btn[_ngcontent-%COMP%]:not(.recording):not(:disabled){color:#34a853!important}button[_ngcontent-%COMP%]:disabled{color:var(--mat-sys-on-surface-variant)!important;opacity:.38!important;cursor:not-allowed}.mic-visualizer[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;gap:3px;height:24px;margin-right:8px;width:24px}.mic-visualizer[_ngcontent-%COMP%] .bar[_ngcontent-%COMP%]{width:4px;background-color:#34a853;border-radius:2px;transition:height .1s ease-out}.call-btn-container[_ngcontent-%COMP%]{position:relative;display:inline-block}.flags-panel[_ngcontent-%COMP%]{position:absolute;bottom:100%;left:50%;transform:translate(-50%);margin-bottom:8px;background:var(--mat-sys-surface-container-highest);border:1px solid var(--mat-sys-outline-variant);border-radius:12px;padding:12px;box-shadow:0 4px 20px #00000026;z-index:100;width:250px;display:flex;flex-direction:column;gap:8px;animation:_ngcontent-%COMP%_fadeIn .2s ease-out}.flags-panel[_ngcontent-%COMP%]:before{content:"";position:absolute;bottom:-8px;left:0;right:0;height:8px;background:transparent}.flags-panel[_ngcontent-%COMP%] .flags-title[_ngcontent-%COMP%]{font-weight:600;font-size:14px;color:var(--mat-sys-on-surface);margin-bottom:4px}.flags-panel[_ngcontent-%COMP%] .flag-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--mat-sys-on-surface-variant)}.flags-panel[_ngcontent-%COMP%] .flag-item[_ngcontent-%COMP%] .flag-label[_ngcontent-%COMP%]{font-weight:500}.flags-panel[_ngcontent-%COMP%] .flag-item[_ngcontent-%COMP%] mat-checkbox[_ngcontent-%COMP%]{--mdc-checkbox-state-layer-size: 30px}@keyframes _ngcontent-%COMP%_fadeIn{0%{opacity:0;transform:translate(-50%) translateY(10px)}to{opacity:1;transform:translate(-50%) translateY(0)}}']})};var GyA=i=>({$implicit:i});function KyA(i,e){i&1&&lA(0,"div",9)}function UyA(i,e){if(i&1&&(I(0,"span",15),D(1),h()),i&2){let A=p(2).$implicit,t=p();ft("right",100-t.getRelativeStart(A.span),"%"),Q(),nA(t.formatDuration(A.span.end_time-A.span.start_time))}}function TyA(i,e){if(i&1){let A=aA();I(0,"div",6),U("click",function(){L(A);let n=p().$implicit,o=p();return G(o.selectRow(n))}),I(1,"div",7)(2,"div",8),ke(3,KyA,1,0,"div",9,Ja),h(),I(5,"span",10),D(6),h(),I(7,"div",11),D(8),h()(),I(9,"div",12)(10,"div",13),D(11),h(),T(12,UyA,2,3,"span",14),h()()}if(i&2){let A=p().$implicit,t=p(),n=Bi(12);_A("selected",t.rowSelected(A)),H("id",ZE("trace-node-",A.span.span_id))("appHtmlTooltip",n)("appHtmlTooltipContext",jl(19,GyA,t.getUiEvent(A)))("appHtmlTooltipDisabled",!t.getUiEvent(A)),Q(3),_e(t.getArray(A.level)),Q(2),_A("is-event-row",t.isEventRow(A)),Q(),Ee(" ",t.getSpanIcon(A.span.name)," "),Q(),_A("is-event-row",t.isEventRow(A)),Q(),Ee(" ",t.formatSpanName(A.span.name)," "),Q(2),ft("left",t.getRelativeStart(A.span),"%")("width",t.getRelativeWidth(A.span),"%"),Q(),Ee(" ",t.formatDuration(A.span.end_time-A.span.start_time)," "),Q(),O(t.getRelativeWidth(A.span)<10?12:-1)}}function OyA(i,e){if(i&1&&T(0,TyA,13,21,"div",5),i&2){let A=e.$implicit,t=p();O(t.shouldShowNode(A)?0:-1)}}function JyA(i,e){if(i&1&&(I(0,"div",16),lA(1,"app-event-content",17),h()),i&2){let A=p().$implicit;Q(),H("uiEvent",A)("index",0)}}function YyA(i,e){if(i&1&&T(0,JyA,2,2,"div",16),i&2){let A=e.$implicit;O(A?0:-1)}}var hy=class i{spans=[];invocationId="";uiEvents=[];shouldShowEvent;tree=[];baseStartTimeMs=0;totalDurationMs=1;rootLatencyNanos=0;flatTree=[];shouldShowNode(e){let A=this.getUiEvent(e);return A&&this.shouldShowEvent?this.shouldShowEvent(A):!0}traceLabelIconMap=new Map([["Invocation","start"],["agent_run","robot"],["invoke_agent","robot_2"],["tool","build"],["execute_tool","build"],["call_llm","chat"]]);selectedRow=void 0;traceService=w(ng);constructor(){}selectRootSpan(){if(this.tree&&this.tree.length>0){if(this.selectedRow&&this.selectedRow.span_id===this.tree[0].span_id)return;this.traceService.selectedRow(this.tree[0])}}isRootSpanSelected(){return!this.selectedRow||!this.tree||this.tree.length===0?!1:String(this.selectedRow.span_id)===String(this.tree[0].span_id)}ngOnInit(){this.rebuildTree(),this.traceService.selectedTraceRow$.subscribe(e=>{this.selectedRow=e,e&&setTimeout(()=>{let A=document.getElementById("trace-node-"+e.span_id);A&&A.scrollIntoView({behavior:"smooth",block:"nearest"})},50)})}ngOnChanges(e){e.spans&&!e.spans.isFirstChange()&&this.rebuildTree()}rebuildTree(){if(!this.spans||this.spans.length===0){this.tree=[],this.flatTree=[],this.rootLatencyNanos=0;return}this.tree=this.buildSpanTree(this.spans),this.flatTree=[],this.tree.forEach(A=>{A.children&&this.flatTree.push(...this.flattenTree(A.children,0))});let e=this.getGlobalTimes(this.spans);this.baseStartTimeMs=e.start,this.totalDurationMs=e.duration,this.tree&&this.tree.length>0?this.rootLatencyNanos=this.tree[0].end_time-this.tree[0].start_time:this.rootLatencyNanos=0}buildSpanTree(e){let A=e.map(o=>P({},o)),t=new Map,n=[];return A.forEach(o=>t.set(String(o.span_id),o)),A.forEach(o=>{if(o.parent_span_id&&t.has(String(o.parent_span_id))){let a=t.get(String(o.parent_span_id));a.children=a.children||[],a.children.push(o)}else n.push(o)}),n}getGlobalTimes(e){let A=Math.min(...e.map(n=>this.toMs(n.start_time))),t=Math.max(...e.map(n=>this.toMs(n.end_time)));return{start:A,duration:t-A}}toMs(e){return e/1e6}formatDuration(e){if(e===0)return"0us";if(e<1e3)return`${e}ns`;if(e<1e6)return`${(e/1e3).toFixed(2)}us`;if(e<1e9)return`${(e/1e6).toFixed(2)}ms`;if(e<6e10)return`${(e/1e9).toFixed(2)}s`;let A=Math.floor(e/6e10),t=(e%6e10/1e9).toFixed(2);return`${A}m ${t}s`}getRelativeStart(e){return(this.toMs(e.start_time)-this.baseStartTimeMs)/this.totalDurationMs*100}getRelativeWidth(e){return(this.toMs(e.end_time)-this.toMs(e.start_time))/this.totalDurationMs*100}flattenTree(e,A=0){return e.flatMap(n=>[{span:n,level:A},...n.children?this.flattenTree(n.children,A+1):[]])}getSpanIcon(e){for(let[A,t]of this.traceLabelIconMap.entries())if(e.startsWith(A))return t;return"start"}formatSpanName(e){return e.startsWith("invoke_agent ")||e.startsWith("execute_tool ")?e.substring(13):e.startsWith("invoke_node ")?e.substring(12):e}getArray(e){return Array.from({length:e})}selectRow(e){this.selectedRow&&this.selectedRow.span_id==e.span.span_id||this.traceService.selectedRow(e.span)}rowSelected(e){return!this.selectedRow||!e?.span?!1:String(this.selectedRow.span_id)===String(e.span.span_id)}isEventRow(e){let A=this.getEventId(e);return A&&this.uiEvents&&this.uiEvents.length>0?this.uiEvents.some(t=>t.event?.id===A):!1}getEventId(e){return e?.span?.attrEventId??""}getUiEvent(e){let A=this.getEventId(e);return A&&this.uiEvents&&this.uiEvents.length>0&&this.uiEvents.find(t=>t.event?.id===A)||null}static \u0275fac=function(A){return new(A||i)};static \u0275cmp=vA({type:i,selectors:[["app-trace-tree"]],inputs:{spans:"spans",invocationId:"invocationId",uiEvents:"uiEvents",shouldShowEvent:"shouldShowEvent"},features:[ii],decls:13,vars:6,consts:[["eventTooltip",""],[1,"invocation-id-container",3,"click"],[1,"invocation-id",3,"matTooltip"],[1,"total-latency"],[1,"trace-container"],[1,"trace-row",3,"selected","id","appHtmlTooltip","appHtmlTooltipContext","appHtmlTooltipDisabled"],[1,"trace-row",3,"click","id","appHtmlTooltip","appHtmlTooltipContext","appHtmlTooltipDisabled"],[1,"trace-row-left"],[1,"trace-indent"],[1,"indent-connector"],[1,"material-symbols-outlined",2,"margin-right","8px"],[1,"trace-label"],[1,"trace-bar-container"],[1,"trace-bar"],[1,"short-trace-bar-duration",3,"right"],[1,"short-trace-bar-duration"],[1,"event-tooltip-container"],[3,"uiEvent","index"]],template:function(A,t){A&1&&(I(0,"div")(1,"div",1),U("click",function(){return t.selectRootSpan()}),I(2,"span"),D(3,"Invocation ID: "),h(),I(4,"div",2),D(5),h(),I(6,"span",3),D(7),h()(),I(8,"div",4),ke(9,OyA,1,1,null,null,ni),h()(),kt(11,YyA,1,1,"ng-template",null,0,PC)),A&2&&(Q(),_A("selected",t.isRootSpanSelected()),ie("id",t.tree&&t.tree.length>0?"trace-node-"+t.tree[0].span_id:null),Q(3),H("matTooltip",t.invocationId),Q(),nA(t.invocationId),Q(2),Ee("Total latency: ",t.formatDuration(t.rootLatencyNanos)),Q(2),_e(t.flatTree))},dependencies:[qi,Un,Ha,rn,ey,bE],styles:[".trace-container[_ngcontent-%COMP%]{white-space:nowrap;font-size:12px;overflow-x:auto;padding:8px}.trace-label[_ngcontent-%COMP%]{color:var(--trace-label-color, #e3e3e3);font-family:Google Sans Mono,monospace;font-style:normal;font-weight:500;line-height:20px;letter-spacing:0px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;font-size:12px}.trace-bar-container[_ngcontent-%COMP%]{position:relative;height:18px}.trace-bar[_ngcontent-%COMP%]{position:absolute;height:18px;background-color:var(--mat-sys-primary);border-radius:4px;padding-left:6px;box-sizing:border-box;overflow:hidden;font-size:11px;line-height:18px;color:var(--mat-sys-on-primary);font-family:Google Sans;transition:background-color .2s,color .2s}.trace-duration[_ngcontent-%COMP%]{color:var(--trace-duration-color, #888);font-weight:400;margin-left:4px}.trace-row[_ngcontent-%COMP%]{display:flex;position:relative;height:32px}.trace-indent[_ngcontent-%COMP%]{display:flex;flex-shrink:0;height:100%}.indent-connector[_ngcontent-%COMP%]{width:20px;position:relative;height:100%}.vertical-line[_ngcontent-%COMP%]{position:absolute;top:0;bottom:0;left:9px;width:1px;background-color:#ccc}.horizontal-line[_ngcontent-%COMP%]{position:absolute;top:50%;left:9px;width:10px;height:1px;background-color:#ccc}.trace-label[_ngcontent-%COMP%]{flex:1;min-width:0;font-size:13px}.trace-bar-container[_ngcontent-%COMP%]{flex:1;min-width:0}.short-trace-bar-duration[_ngcontent-%COMP%]{position:absolute;color:var(--trace-tree-short-trace-bar-duration-color);padding-right:6px}.trace-row[_ngcontent-%COMP%]{align-items:center;cursor:pointer;scroll-margin-top:40px}.trace-row[_ngcontent-%COMP%]:hover{background-color:var(--mat-sys-surface-variant, rgba(0, 0, 0, .04))}.trace-row.selected[_ngcontent-%COMP%]{background-color:var(--mat-sys-secondary-container, rgba(0, 0, 0, .08))}.trace-row-left[_ngcontent-%COMP%]{display:flex;min-width:250px;width:20%;max-width:350px}.invocation-id-container[_ngcontent-%COMP%]{color:var(--mat-sys-on-surface-variant);font-size:11px;font-weight:600;letter-spacing:.3px;margin-bottom:6px;padding:8px 12px;border-radius:12px 12px 0 0;background-color:var(--mat-sys-surface);display:flex;width:100%;box-sizing:border-box;align-items:center;position:sticky;top:-20px;z-index:10;box-shadow:0 2px 4px #0000000d;cursor:pointer}.invocation-id-container[_ngcontent-%COMP%]:hover{background-color:var(--mat-sys-surface-variant)}.invocation-id-container.selected[_ngcontent-%COMP%]{background-color:var(--mat-sys-secondary-container, rgba(0, 0, 0, .08))}.invocation-id-container[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]:first-child{opacity:.8;margin-right:6px;text-transform:uppercase}.invocation-id[_ngcontent-%COMP%]{font-family:Google Sans Mono,Roboto Mono,monospace;padding:2px 6px;border-radius:4px;color:var(--mat-sys-on-surface)}.total-latency[_ngcontent-%COMP%]{margin-left:auto;background:transparent;color:var(--mat-sys-on-surface);padding:2px 8px;font-size:11px;font-weight:600;letter-spacing:.2px}.trace-row-left[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .trace-row-left[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{color:var(--trace-tree-trace-row-left-span-div-color)}.trace-row-left[_ngcontent-%COMP%] .is-event-row[_ngcontent-%COMP%]{color:var(--trace-tree-trace-row-left-is-event-row-color)}.event-tooltip-container[_ngcontent-%COMP%]{max-width:800px;max-height:200px;overflow:auto;padding:8px;background:var(--mat-sys-surface-container-low, #202124);color:var(--mat-sys-on-surface, #e8eaed);border-radius:8px;box-shadow:0 4px 16px #00000080;border:1px solid var(--mat-sys-outline-variant, rgba(255, 255, 255, .1))}.event-tooltip-container[_ngcontent-%COMP%] app-content-bubble{max-height:160px;overflow-y:auto;display:block}"]})};var HyA=["videoContainer"],zyA=["autoScroll"],PyA=["messageTextarea"],jyA=i=>({text:i,thought:!1,isReadme:!0}),VyA=()=>[],qyA=(i,e)=>e.metricName,WyA=(i,e)=>e.branchId,ZyA=(i,e)=>e.event;function XyA(i,e){i&1&&(I(0,"span",14),D(1,"PASS"),h())}function $yA(i,e){i&1&&(I(0,"span",15),D(1,"FAIL"),h())}function ADA(i,e){if(i&1&&(I(0,"span",21),D(1),h()),i&2){let A=e.$implicit;ft("color",A.evalStatus==1?"var(--app-color-success)":"var(--app-color-error)"),Q(),Ya(" ",A.metricName,": ",A.score," ")}}function eDA(i,e){if(i&1&&(I(0,"div")(1,"span",17),D(2,"Metrics"),h(),I(3,"div",19),ke(4,ADA,2,4,"span",20,qyA),h()()),i&2){p();let A=Ki(0);Q(4),_e(A.overallEvalMetricResults)}}function tDA(i,e){if(i&1&&(ro(0),I(1,"div",8)(2,"div",11)(3,"h3",12),D(4,"Evaluation Result"),h(),I(5,"div",13),T(6,XyA,2,0,"span",14)(7,$yA,2,0,"span",15),h()(),I(8,"div",16)(9,"div")(10,"span",17),D(11,"Case ID"),h(),I(12,"div",18),D(13),h()(),I(14,"div")(15,"span",17),D(16,"Set ID"),h(),I(17,"div",18),D(18),h()(),T(19,eDA,6,0,"div"),h()()),i&2){let A=so(p(2).evalCaseResult());Q(6),O(A.finalEvalStatus==1?6:7),Q(7),nA(A.evalId),Q(5),nA(A.setId),Q(),O(A.overallEvalMetricResults!=null&&A.overallEvalMetricResults.length?19:-1)}}function iDA(i,e){if(i&1&&(I(0,"div",9),dn(1,22),h()),i&2){let A=p(2);Q(),H("ngComponentOutlet",A.markdownComponent)("ngComponentOutletInputs",jl(2,jyA,A.agentReadme))}}function nDA(i,e){if(i&1&&(I(0,"div",26),lA(1,"app-trace-tree",27),h()),i&2){p();let A=Ki(0),t=p(3);ft("display",t.viewMode==="traces"?"":"none"),Q(),H("spans",t.spansByInvocationId.get(A.event.id)||t.spansByInvocationId.get(A.event.invocationId)||Lc(6,VyA))("invocationId",A.event.invocationId||A.event.id||"")("uiEvents",t.uiEvents)("shouldShowEvent",t.shouldShowEvent)}}function oDA(i,e){if(i&1){let A=aA();ro(0),I(1,"app-event-row",24),U("rowClick",function(n){L(A);let o=p(3);return G(o.handleRowClick(n.event,n.uiEvent,n.index))})("handleKeydown",function(n){L(A);let o=p(3);return G(o.handleKeydown.emit(n))})("cancelEditMessage",function(n){L(A);let o=p(3);return G(o.cancelEditMessage.emit(n))})("saveEditMessage",function(n){L(A);let o=p(3);return G(o.saveEditMessage.emit(n))})("userEditEvalCaseMessageChange",function(n){L(A);let o=p(3);return G(o.userEditEvalCaseMessageChange.emit(n))})("openViewImageDialog",function(n){L(A);let o=p(3);return G(o.openViewImageDialog.emit(n))})("openBase64InNewTab",function(n){L(A);let o=p(3);return G(o.openBase64InNewTab.emit(n))})("editEvalCaseMessage",function(n){L(A);let o=p(3);return G(o.editEvalCaseMessage.emit(n))})("deleteEvalCaseMessage",function(n){L(A);let o=p(3);return G(o.deleteEvalCaseMessage.emit(n))})("editFunctionArgs",function(n){L(A);let o=p(3);return G(o.editFunctionArgs.emit(n))})("clickEvent",function(n){L(A);let o=p(3);return G(o.clickEvent.emit(n))})("longRunningResponseComplete",function(n){L(A);let o=p(3);return G(o.longRunningResponseComplete.emit(n))})("agentStateClick",function(n){L(A);let o=p(3);return G(o.handleAgentStateClick(n.event,n.index))}),h(),T(2,nDA,2,7,"div",25)}if(i&2){let A=p().$implicit,t=p(2),n=so(A.event),o=t.shouldShowEvent?t.shouldShowEvent(n):!0;Q(),ft("display",t.viewMode==="events"&&o||t.viewMode==="traces"&&n.role==="user"&&o?"":"none"),H("isSelectable",t.viewMode!=="traces")("uiEvent",n)("index",A.index)("uiEvents",t.uiEvents)("isSelected",t.isMessageEventSelected(A.index))("appName",t.appName)("userId",t.userId)("sessionId",t.sessionId)("sessionName",t.sessionName())("evalCase",t.evalCase)("isEvalEditMode",t.isEvalEditMode)("isEvalCaseEditing",t.isEvalCaseEditing)("isEditFunctionArgsEnabled",t.isEditFunctionArgsEnabled)("userEditEvalCaseMessage",t.userEditEvalCaseMessage)("agentGraphData",t.agentGraphData)("allWorkflowNodes",t.getAllWorkflowNodes(A.index))("isUserFeedbackEnabled",t.isUserFeedbackEnabled()??!1)("isLoadingAgentResponse",t.isLoadingAgentResponse()??!1),Q(),O(n.role==="bot"&&t.isFirstEventForInvocation(n,A.index)?2:-1)}}function aDA(i,e){if(i&1&&(I(0,"span",32),D(1),h()),i&2){let A=p().$implicit;H("matTooltip","Branch "+A.branchId),Q(),nA(A.branchId)}}function rDA(i,e){if(i&1){let A=aA();I(0,"app-event-row",24),U("rowClick",function(n){L(A);let o=p(5);return G(o.handleRowClick(n.event,n.uiEvent,n.index))})("handleKeydown",function(n){L(A);let o=p(5);return G(o.handleKeydown.emit(n))})("cancelEditMessage",function(n){L(A);let o=p(5);return G(o.cancelEditMessage.emit(n))})("saveEditMessage",function(n){L(A);let o=p(5);return G(o.saveEditMessage.emit(n))})("userEditEvalCaseMessageChange",function(n){L(A);let o=p(5);return G(o.userEditEvalCaseMessageChange.emit(n))})("openViewImageDialog",function(n){L(A);let o=p(5);return G(o.openViewImageDialog.emit(n))})("openBase64InNewTab",function(n){L(A);let o=p(5);return G(o.openBase64InNewTab.emit(n))})("editEvalCaseMessage",function(n){L(A);let o=p(5);return G(o.editEvalCaseMessage.emit(n))})("deleteEvalCaseMessage",function(n){L(A);let o=p(5);return G(o.deleteEvalCaseMessage.emit(n))})("editFunctionArgs",function(n){L(A);let o=p(5);return G(o.editFunctionArgs.emit(n))})("clickEvent",function(n){L(A);let o=p(5);return G(o.clickEvent.emit(n))})("longRunningResponseComplete",function(n){L(A);let o=p(5);return G(o.longRunningResponseComplete.emit(n))})("agentStateClick",function(n){L(A);let o=p(5);return G(o.handleAgentStateClick(n.event,n.index))}),h()}if(i&2){let A=e.$implicit,t=p(5),n=A.event,o=t.shouldShowEvent?t.shouldShowEvent(n):!0;ft("display",t.viewMode==="events"&&o||t.viewMode==="traces"&&n.role==="user"&&o?"":"none"),H("isSelectable",t.viewMode!=="traces")("uiEvent",n)("index",A.globalIndex)("uiEvents",t.uiEvents)("isSelected",t.isMessageEventSelected(A.globalIndex))("appName",t.appName)("userId",t.userId)("sessionId",t.sessionId)("sessionName",t.sessionName())("evalCase",t.evalCase)("isEvalEditMode",t.isEvalEditMode)("isEvalCaseEditing",t.isEvalCaseEditing)("isEditFunctionArgsEnabled",t.isEditFunctionArgsEnabled)("userEditEvalCaseMessage",t.userEditEvalCaseMessage)("agentGraphData",t.agentGraphData)("allWorkflowNodes",t.getAllWorkflowNodes(A.globalIndex))("isUserFeedbackEnabled",t.isUserFeedbackEnabled()??!1)("isLoadingAgentResponse",t.isLoadingAgentResponse()??!1)}}function sDA(i,e){if(i&1&&(I(0,"mat-tab"),kt(1,aDA,2,2,"ng-template",29),I(2,"div",30),ke(3,rDA,1,20,"app-event-row",31,ZyA),h()()),i&2){let A=e.$implicit;Q(3),_e(A.events)}}function lDA(i,e){if(i&1&&(I(0,"div",23)(1,"mat-tab-group",28),ke(2,sDA,5,0,"mat-tab",null,WyA),h()()),i&2){let A=p().$implicit;Q(2),_e(A.branches)}}function gDA(i,e){if(i&1&&T(0,oDA,3,22)(1,lDA,4,0,"div",23),i&2){let A=e.$implicit;O(A.type==="event"?0:A.type==="branches"?1:-1)}}function cDA(i,e){i&1&&(I(0,"div",10),lA(1,"mat-progress-bar",33),h())}function CDA(i,e){if(i&1){let A=aA();I(0,"div",7,0),U("scroll",function(n){L(A);let o=p();return G(o.onScroll.next(n))})("wheel",function(){L(A);let n=p();return G(n.onManualScroll())})("touchmove",function(){L(A);let n=p();return G(n.onManualScroll())})("mousedown",function(){L(A);let n=p();return G(n.onManualScroll())})("keydown",function(){L(A);let n=p();return G(n.onManualScroll())}),T(2,tDA,20,5,"div",8),T(3,iDA,2,4,"div",9),ke(4,gDA,2,1,null,null,ni),T(6,cDA,2,0,"div",10),h()}if(i&2){let A=p();Q(2),O(A.showEvalSummary()&&A.evalCaseResult()?2:-1),Q(),O(A.uiEvents.length===0&&A.agentReadme?3:-1),Q(),_e(A.displayItems),Q(2),O(A.isLoadingAgentResponse()?6:-1)}}function dDA(i,e){if(i&1){let A=aA();I(0,"div",51),lA(1,"img",52),I(2,"button",53),U("click",function(){L(A);let n=p().$index,o=p(4);return G(o.removeFile.emit(n))}),I(3,"mat-icon",54),D(4,"close"),h()()()}if(i&2){let A=p().$implicit;Q(),H("src",A.url,mo)}}function IDA(i,e){if(i&1){let A=aA();I(0,"div",50)(1,"button",53),U("click",function(){L(A);let n=p().$index,o=p(4);return G(o.removeFile.emit(n))}),I(2,"mat-icon",54),D(3,"close"),h()(),I(4,"div",55)(5,"mat-icon"),D(6,"insert_drive_file"),h(),I(7,"span"),D(8),h()()()}if(i&2){let A=p().$implicit;Q(8),nA(A.file.name)}}function BDA(i,e){if(i&1&&(I(0,"div"),T(1,dDA,5,1,"div",51)(2,IDA,9,1,"div",50),h()),i&2){let A=e.$implicit;Q(),O(A.file.type.startsWith("image/")?1:A.file.type.startsWith("image/")?-1:2)}}function hDA(i,e){if(i&1){let A=aA();I(0,"div",50)(1,"button",53),U("click",function(){L(A);let n=p(4);return G(n.removeStateUpdate.emit())}),I(2,"mat-icon",54),D(3,"close"),h()(),I(4,"div",55)(5,"span"),D(6),h()()()}if(i&2){let A=p(4);Q(6),nA(A.i18n.updatedSessionStateChipLabel)}}function EDA(i,e){if(i&1&&(I(0,"div",39),ke(1,BDA,3,1,"div",null,ni),T(3,hDA,7,1,"div",50),h()),i&2){let A=p(3);Q(),_e(A.selectedFiles),Q(2),O(A.updatedSessionState?3:-1)}}function QDA(i,e){if(i&1){let A=aA();I(0,"button",42),mt(1,"async"),U("click",function(){L(A);let n=p(3);return G(n.updateState.emit())}),I(2,"mat-icon"),D(3,"tune"),h(),I(4,"span"),D(5),h()()}if(i&2){let A=p(3);H("disabled",(A.isLoadingAgentResponse()??!1)||!Ft(1,2,A.isManualStateUpdateEnabledObs)),Q(5),nA(A.i18n.updateStateMenuLabel)}}function uDA(i,e){if(i&1){let A=aA();I(0,"button",56),U("click",function(n){L(A);let o=p(3);return G(o.stopMessage.emit(n))}),I(1,"mat-icon"),D(2,"stop"),h()()}if(i&2){let A=p(3);H("matTooltip",A.i18n.stopMessageTooltip)}}function pDA(i,e){if(i&1){let A=aA();I(0,"button",57),U("click",function(n){L(A);let o=p(3);return G(o.sendMessage.emit(n))}),I(1,"mat-icon"),D(2,"send"),h()()}if(i&2){let A=p(3);H("matTooltip",A.i18n.sendMessageTooltip)}}function fDA(i,e){if(i&1){let A=aA();I(0,"div",35)(1,"input",36,1),U("change",function(n){L(A);let o=p(2);return G(o.fileSelect.emit(n))}),h(),I(3,"div",37)(4,"mat-form-field",38),T(5,EDA,4,1,"div",39),I(6,"button",40)(7,"mat-icon"),D(8,"add"),h()(),I(9,"mat-menu",41,2)(11,"button",42),mt(12,"async"),U("click",function(){L(A);let n=Bi(2);return G(n.click())}),I(13,"mat-icon"),D(14,"attach_file"),h(),I(15,"span"),D(16),h()(),T(17,QDA,6,4,"button",43),h(),I(18,"textarea",44,3),U("ngModelChange",function(n){L(A);let o=p(2);return G(o.userInputChange.emit(n))})("keydown.enter",function(n){L(A);let o=p(2);return G(!o.isLoadingAgentResponse()&&o.sendMessage.emit(n))}),h(),I(20,"div",45)(21,"app-call-controls",46),mt(22,"async"),U("toggleAudioRecording",function(n){L(A);let o=p(2);return G(o.toggleAudioRecording.emit(n))})("toggleVideoRecording",function(){L(A);let n=p(2);return G(n.toggleVideoRecording.emit())}),h(),T(23,uDA,3,1,"button",47)(24,pDA,3,1,"button",48),h()(),lA(25,"div",49,4),h()()}if(i&2){let A=Bi(10),t=p(2);_A("video-streaming",t.isVideoRecording),Q(5),O(t.selectedFiles.length&&t.appName!=""||t.updatedSessionState?5:-1),Q(),H("matMenuTriggerFor",A)("disabled",t.isLoadingAgentResponse()??!1)("matTooltip","Actions"),Q(5),H("disabled",(t.isLoadingAgentResponse()??!1)||!Ft(12,20,t.isMessageFileUploadEnabledObs)),Q(5),nA(t.i18n.uploadFileTooltip),Q(),O(t.hideMoreOptionsButton()?-1:17),Q(),H("ngModel",t.userInput)("placeholder",t.i18n.typeMessagePlaceholder)("disabled",t.isLoadingAgentResponse()??!1),Q(3),H("isAudioRecording",t.isAudioRecording)("isVideoRecording",t.isVideoRecording)("micVolume",t.micVolume)("isBidiStreamingEnabled",Ft(22,22,t.isBidiStreamingEnabledObs)??!1)("disabled",t.isLoadingAgentResponse()??!1),Q(2),O(t.isLoadingAgentResponse()?23:24),Q(2),_A("visible",t.isVideoRecording)}}function mDA(i,e){if(i&1&&T(0,fDA,27,24,"div",34),i&2){let A=p();O(A.canEditSession()?0:-1)}}function wDA(i,e){i&1&&(I(0,"div",6),lA(1,"mat-progress-spinner",58),h())}var h1=class i{appName="";agentReadme="";sessionName=ve("");uiEvents=[];showBranches=!1;traceData=[];isChatMode=!0;evalCase=null;isEvalEditMode=!1;isEvalCaseEditing=!1;agentGraphData=null;isEditFunctionArgsEnabled=!1;isTokenStreamingEnabled=!1;useSse=!1;userInput="";userEditEvalCaseMessage="";selectedFiles=[];updatedSessionState=null;selectedMessageIndex=void 0;isAudioRecording=!1;micVolume=0;isVideoRecording=!1;userId="";sessionId="";viewMode="events";shouldShowEvent;spansByInvocationId=new Map;displayItems=[];eventsScrollTop=-1;tracesScrollTop=-1;userInputChange=new FA;userEditEvalCaseMessageChange=new FA;clickEvent=new FA;handleKeydown=new FA;cancelEditMessage=new FA;saveEditMessage=new FA;openViewImageDialog=new FA;openBase64InNewTab=new FA;editEvalCaseMessage=new FA;deleteEvalCaseMessage=new FA;editFunctionArgs=new FA;fileSelect=new FA;removeFile=new FA;removeStateUpdate=new FA;sendMessage=new FA;stopMessage=new FA;updateState=new FA;toggleAudioRecording=new FA;toggleVideoRecording=new FA;longRunningResponseComplete=new FA;toggleHideIntermediateEvents=new FA;toggleSse=new FA;manualScroll=new FA;videoContainer;scrollContainer;textarea;scrollInterrupted=!1;scrollHeight=0;lastMessageRef=null;nextPageToken="";scrollTimeout=null;mutationObserver=null;i18n=w(C1);uiStateService=w(ag);themeService=w(og);stringToColorService=w(g2);markdownComponent=w(g1);featureFlagService=w(Nr);agentService=w(el);sessionService=w(tl);destroyRef=w(Er);MediaType=iC;JSON=JSON;Object=Object;String=String;isMessageFileUploadEnabledObs=this.featureFlagService.isMessageFileUploadEnabled();isManualStateUpdateEnabledObs=this.featureFlagService.isManualStateUpdateEnabled();isBidiStreamingEnabledObs=this.featureFlagService.isBidiStreamingEnabled();canEditSession=mA(!0);isUserFeedbackEnabled=sr(this.featureFlagService.isFeedbackServiceEnabled());isLoadingAgentResponse=sr(this.agentService.getLoadingState());hideMoreOptionsButton=sr(this.featureFlagService.isMoreOptionsButtonHidden());onScroll=new ne;sanitizer=w(Qs);onManualScroll(){this.scrollInterrupted=!0,this.manualScroll.emit()}hideIntermediateEvents=ve(!1);invocationDisplayMap=ve(new Map);evalCaseResult=ve(null);showEvalSummary=ve(!1);constructor(){Fn(()=>{let e=this.sessionName();e&&(this.nextPageToken="",this.featureFlagService.isInfinityMessageScrollingEnabled().pipe(oo(),Bt(A=>A)).subscribe(()=>{this.uiStateService.lazyLoadMessages(e,{pageSize:100,pageToken:this.nextPageToken}).pipe(oo()).subscribe()}))}),Fn(()=>{this.isLoadingAgentResponse()||this.focusInput()})}ngOnInit(){this.uiStateService.isSessionLoading().pipe(xr(this.destroyRef)).subscribe(e=>{e||this.focusInput()}),this.featureFlagService.isInfinityMessageScrollingEnabled().pipe(oo(),Bt(e=>e),Mi(()=>Vi(this.uiStateService.onNewMessagesLoaded().pipe(mi(e=>{this.nextPageToken=e.nextPageToken??"",e.isBackground||this.restoreScrollPosition()})),this.onScroll.pipe(Mi(e=>{let A=e.target;return A.scrollTop!==0?Br:this.nextPageToken?(this.scrollHeight=A.scrollHeight,this.uiStateService.lazyLoadMessages(this.sessionName(),{pageSize:100,pageToken:this.nextPageToken}).pipe(oo(),aa(()=>EN))):Br})))),xr(this.destroyRef)).subscribe()}ngAfterViewInit(){if(this.scrollContainer?.nativeElement){let e=this.scrollContainer.nativeElement;e.addEventListener("scroll",()=>{let A=Math.abs(e.scrollHeight-e.scrollTop-e.clientHeight)<50;this.scrollInterrupted=!A}),this.mutationObserver=new MutationObserver(()=>{this.scrollInterrupted||this.scrollToBottom()}),this.mutationObserver.observe(e,{childList:!0,subtree:!0,characterData:!0}),this.destroyRef.onDestroy(()=>{this.mutationObserver?.disconnect()})}}ngOnChanges(e){if(e.viewMode){let A=e.viewMode.previousValue,t=e.viewMode.currentValue;this.scrollContainer?.nativeElement&&(A==="events"?this.eventsScrollTop=this.scrollContainer.nativeElement.scrollTop:A==="traces"&&(this.tracesScrollTop=this.scrollContainer.nativeElement.scrollTop)),setTimeout(()=>{this.scrollContainer?.nativeElement&&(t==="events"&&this.eventsScrollTop!==-1?this.scrollContainer.nativeElement.scrollTop=this.eventsScrollTop:t==="traces"&&this.tracesScrollTop!==-1?this.scrollContainer.nativeElement.scrollTop=this.tracesScrollTop:this.scrollToBottom())})}if(e.appName&&this.focusInput(),(e.appName||e.uiEvents)&&this.uiEvents.length===0&&this.agentReadme&&setTimeout(()=>this.scrollToTop(),0),e.uiEvents){let A=this.uiEvents[this.uiEvents.length-1];A!==this.lastMessageRef&&((A?.role==="user"||A?.isLoading===!0)&&(this.scrollInterrupted=!1),this.scrollToBottom()),this.lastMessageRef=A}e.traceData&&this.traceData&&this.rebuildTrace(),(e.uiEvents||e.showBranches||e.viewMode)&&this.computeDisplayItems()}computeDisplayItems(){if(!this.showBranches||this.viewMode==="traces"){this.displayItems=this.uiEvents.map((t,n)=>({type:"event",event:t,index:n}));return}let e=[],A=null;this.uiEvents.forEach((t,n)=>{let o=t.event?.branch;if(o){A||(A={type:"branches",branchesMap:new Map,startIndex:n});let a=A.branchesMap.get(o)||[];a.push({event:t,globalIndex:n}),A.branchesMap.set(o,a)}else A&&(e.push(this.finalizeGroup(A)),A=null),e.push({type:"event",event:t,index:n})}),A&&e.push(this.finalizeGroup(A)),this.displayItems=e}finalizeGroup(e){let A=[];return e.branchesMap.forEach((t,n)=>{A.push({branchId:n,events:t})}),{type:"branches",branches:A,startIndex:e.startIndex}}rebuildTrace(){let e=this.traceData.reduce((A,t)=>{let n=String(t.trace_id),o=A.get(n);return o?(o.push(t),o.sort((a,r)=>a.start_time-r.start_time)):A.set(n,[t]),A},new Map);this.spansByInvocationId=new Map;for(let[A,t]of e){let n=t.find(o=>o.attrInvocationId!==void 0)?.attrInvocationId;if(!n){let o=t.find(a=>a.attrAssociatedEventIds!==void 0)?.attrAssociatedEventIds;o&&o.length>0&&(n=o[0])}n||(n=A),n&&this.spansByInvocationId.set(String(n),t)}}isFirstEventForInvocation(e,A){let t=e.event?.invocationId||e.event?.id;if(!t)return!1;for(let n=A-1;n>=0;n--){let o=this.uiEvents[n],a=o.event?.invocationId||o.event?.id;if(o.role==="bot"&&a===t)return!1}return!0}scrollToBottom(){this.sessionId&&(this.scrollInterrupted||(this.scrollTimeout&&clearTimeout(this.scrollTimeout),this.scrollTimeout=setTimeout(()=>{this.scrollContainer?.nativeElement.scrollTo({top:this.scrollContainer.nativeElement.scrollHeight,behavior:"auto"}),this.scrollTimeout=null},50)))}scrollToTop(){setTimeout(()=>{this.scrollContainer?.nativeElement.scrollTo({top:0,behavior:"smooth"})},50)}focusInput(){setTimeout(()=>{this.textarea?.nativeElement?.focus()},50)}isMessageEventSelected(e){return e===this.selectedMessageIndex}restoreScrollPosition(){if(!this.scrollHeight){this.scrollInterrupted=!1,this.scrollToBottom();return}let e=this.scrollContainer?.nativeElement;e&&(e.scrollTop=e.scrollHeight-this.scrollHeight,this.scrollHeight=0)}getAllWorkflowNodes(e){let A={};for(let t=0;t<=e;t++){let o=this.uiEvents[t].event,a=o?.actions?.agentState?.nodes,r=o?.nodeInfo?.path;a&&r&&(A[r]||(A[r]={}),Object.assign(A[r],a))}return Object.keys(A).length>0?A:null}handleAgentStateClick(e,A){e.stopPropagation(),A===this.selectedMessageIndex||this.clickEvent.emit(A)}handleRowClick(e,A,t){let n=window.getSelection();n&&n.toString().length>0||this.clickEvent.emit(t)}handleKeyboardNavigation(e){if(this.selectedMessageIndex===void 0)return;let A=document.activeElement;if(A&&(A.tagName==="INPUT"||A.tagName==="TEXTAREA"||A.isContentEditable)||e.key!=="ArrowUp"&&e.key!=="ArrowDown")return;e.preventDefault();let t;e.key==="ArrowDown"?t=this.selectedMessageIndex+1>=this.uiEvents.length?0:this.selectedMessageIndex+1:t=this.selectedMessageIndex-1<0?this.uiEvents.length-1:this.selectedMessageIndex-1,this.clickEvent.emit(t),this.scrollToSelectedMessage(t)}scrollToSelectedMessage(e){let A=e!==void 0?e:this.selectedMessageIndex;A!==void 0&&setTimeout(()=>{if(!this.scrollContainer?.nativeElement)return;let t=this.scrollContainer.nativeElement.querySelectorAll(".message-row-container");t&&t[A]&&t[A].scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},50)}static \u0275fac=function(A){return new(A||i)};static \u0275cmp=vA({type:i,selectors:[["app-chat-panel"]],viewQuery:function(A,t){if(A&1&&Wt(HyA,5,ce)(zyA,5)(PyA,5),A&2){let n;se(n=le())&&(t.videoContainer=n.first),se(n=le())&&(t.scrollContainer=n.first),se(n=le())&&(t.textarea=n.first)}},hostBindings:function(A,t){A&1&&U("keydown",function(o){return t.handleKeyboardNavigation(o)},Fg)},inputs:{appName:"appName",agentReadme:"agentReadme",sessionName:[1,"sessionName"],uiEvents:"uiEvents",showBranches:"showBranches",traceData:"traceData",isChatMode:"isChatMode",evalCase:"evalCase",isEvalEditMode:"isEvalEditMode",isEvalCaseEditing:"isEvalCaseEditing",agentGraphData:"agentGraphData",isEditFunctionArgsEnabled:"isEditFunctionArgsEnabled",isTokenStreamingEnabled:"isTokenStreamingEnabled",useSse:"useSse",userInput:"userInput",userEditEvalCaseMessage:"userEditEvalCaseMessage",selectedFiles:"selectedFiles",updatedSessionState:"updatedSessionState",selectedMessageIndex:"selectedMessageIndex",isAudioRecording:"isAudioRecording",micVolume:"micVolume",isVideoRecording:"isVideoRecording",userId:"userId",sessionId:"sessionId",viewMode:"viewMode",shouldShowEvent:"shouldShowEvent",hideIntermediateEvents:[1,"hideIntermediateEvents"],invocationDisplayMap:[1,"invocationDisplayMap"],evalCaseResult:[1,"evalCaseResult"],showEvalSummary:[1,"showEvalSummary"]},outputs:{userInputChange:"userInputChange",userEditEvalCaseMessageChange:"userEditEvalCaseMessageChange",clickEvent:"clickEvent",handleKeydown:"handleKeydown",cancelEditMessage:"cancelEditMessage",saveEditMessage:"saveEditMessage",openViewImageDialog:"openViewImageDialog",openBase64InNewTab:"openBase64InNewTab",editEvalCaseMessage:"editEvalCaseMessage",deleteEvalCaseMessage:"deleteEvalCaseMessage",editFunctionArgs:"editFunctionArgs",fileSelect:"fileSelect",removeFile:"removeFile",removeStateUpdate:"removeStateUpdate",sendMessage:"sendMessage",stopMessage:"stopMessage",updateState:"updateState",toggleAudioRecording:"toggleAudioRecording",toggleVideoRecording:"toggleVideoRecording",longRunningResponseComplete:"longRunningResponseComplete",toggleHideIntermediateEvents:"toggleHideIntermediateEvents",toggleSse:"toggleSse",manualScroll:"manualScroll"},features:[ii],decls:5,vars:5,consts:[["autoScroll",""],["fileInput",""],["inputActionsMenu","matMenu"],["messageTextarea",""],["videoContainer",""],[1,"chat-messages"],[1,"loading-spinner-container"],[1,"chat-messages",3,"scroll","wheel","touchmove","mousedown","keydown"],[1,"eval-result-summary",2,"margin","16px","padding","16px","border-radius","8px","background","var(--mat-sys-surface-container)","border","1px solid var(--mat-sys-outline-variant)"],[1,"readme-content"],[1,"agent-loading-indicator"],[2,"display","flex","justify-content","space-between","align-items","center"],[2,"margin","0","color","var(--mat-sys-primary)"],[1,"status-card__summary"],[1,"status-card__passed",2,"font-size","16px","font-weight","600","font-family","monospace"],[1,"status-card__failed",2,"font-size","16px","font-weight","600","font-family","monospace"],[2,"margin-top","12px","display","flex","gap","24px"],[2,"color","var(--mat-sys-on-surface-variant)","font-size","13px"],[2,"font-weight","500"],[2,"display","flex","gap","8px","margin-top","4px"],[2,"font-size","13px","font-weight","500",3,"color"],[2,"font-size","13px","font-weight","500"],[3,"ngComponentOutlet","ngComponentOutletInputs"],[1,"branches-container"],[3,"rowClick","handleKeydown","cancelEditMessage","saveEditMessage","userEditEvalCaseMessageChange","openViewImageDialog","openBase64InNewTab","editEvalCaseMessage","deleteEvalCaseMessage","editFunctionArgs","clickEvent","longRunningResponseComplete","agentStateClick","isSelectable","uiEvent","index","uiEvents","isSelected","appName","userId","sessionId","sessionName","evalCase","isEvalEditMode","isEvalCaseEditing","isEditFunctionArgsEnabled","userEditEvalCaseMessage","agentGraphData","allWorkflowNodes","isUserFeedbackEnabled","isLoadingAgentResponse"],[1,"trace-tree-container",3,"display"],[1,"trace-tree-container"],[3,"spans","invocationId","uiEvents","shouldShowEvent"],["animationDuration","0ms"],["mat-tab-label",""],[1,"branch-events-content"],[3,"display","isSelectable","uiEvent","index","uiEvents","isSelected","appName","userId","sessionId","sessionName","evalCase","isEvalEditMode","isEvalCaseEditing","isEditFunctionArgsEnabled","userEditEvalCaseMessage","agentGraphData","allWorkflowNodes","isUserFeedbackEnabled","isLoadingAgentResponse"],["matTooltipPosition","above",1,"tab-name",3,"matTooltip"],["mode","indeterminate"],[1,"chat-input",3,"video-streaming"],[1,"chat-input"],["type","file","multiple","","hidden","",3,"change"],[1,"chat-input-content-row"],["appearance","outline","subscriptSizing","dynamic",1,"input-field"],[1,"file-preview"],["mat-icon-button","","matPrefix","",1,"input-prefix-menu-btn",3,"matMenuTriggerFor","disabled","matTooltip"],["xPosition","after"],["mat-menu-item","",3,"click","disabled"],["mat-menu-item","",3,"disabled"],["matInput","","cdkTextareaAutosize","","cdkAutosizeMinRows","1","cdkAutosizeMaxRows","10",1,"chat-input-box",3,"ngModelChange","keydown.enter","ngModel","placeholder","disabled"],["matSuffix","",1,"input-suffix-container"],[3,"toggleAudioRecording","toggleVideoRecording","isAudioRecording","isVideoRecording","micVolume","isBidiStreamingEnabled","disabled"],["mat-icon-button","",1,"stop-message-btn",3,"matTooltip"],["mat-icon-button","",1,"send-message-btn",3,"matTooltip"],[1,"video-container"],[1,"file-container"],[1,"image-container"],["alt","preview",1,"image-preview",3,"src"],["mat-icon-button","",1,"delete-button",3,"click"],["color","warn"],[1,"file-info"],["mat-icon-button","",1,"stop-message-btn",3,"click","matTooltip"],["mat-icon-button","",1,"send-message-btn",3,"click","matTooltip"],["mode","indeterminate","diameter","50"]],template:function(A,t){if(A&1&&(ro(0),mt(1,"async"),T(2,CDA,7,3,"div",5),T(3,mDA,1,1),T(4,wDA,2,0,"div",6)),A&2){let n=Ft(1,3,t.uiStateService.isSessionLoading());Q(2),O(t.appName!=""&&!n?2:-1),Q(),O(t.appName!=""&&t.isChatMode&&!n?3:-1),Q(),O(n?4:-1)}},dependencies:[li,Kc,fn,Gn,Kn,Ho,Un,zt,kU,pE,uE,qi,yi,Ws,ka,Zo,mQ,Rv,P3,YI,Za,s2,hs,Gs,tg,l2,Es,mZ,Ha,rn,RU,SZ,vp,bp,fE,W0,Iy,By,hy,gs],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%}.generated-image-container[_ngcontent-%COMP%]{max-width:400px;margin-left:20px}.generated-image[_ngcontent-%COMP%]{max-width:100%;min-width:40px;border-radius:8px}.html-artifact-container[_ngcontent-%COMP%]{width:100%;display:flex;justify-content:flex-start;align-items:center}.loading-bar[_ngcontent-%COMP%]{width:100px;margin:15px}.chat-messages[_ngcontent-%COMP%]{flex-grow:1;overflow-y:auto;padding:20px;position:relative}.chat-sub-toolbar[_ngcontent-%COMP%]{display:flex;justify-content:flex-start;align-items:center;height:48px;flex-shrink:0;padding:0 20px;background-color:var(--mat-sys-surface-container);border-bottom:1px solid var(--mat-sys-outline-variant)}.chat-sub-toolbar[_ngcontent-%COMP%] mat-button-toggle-group[_ngcontent-%COMP%]{border-radius:16px;height:28px;align-items:center}.chat-sub-toolbar[_ngcontent-%COMP%] mat-button-toggle-group[_ngcontent-%COMP%] .mat-button-toggle-label-content{line-height:28px;padding:0 12px;font-size:13px}.chat-sub-toolbar[_ngcontent-%COMP%] .filter-bar-container[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;background-color:transparent;border:none;margin-left:16px}.chat-sub-toolbar[_ngcontent-%COMP%] .filter-chip[_ngcontent-%COMP%]{display:flex;align-items:center;background-color:var(--mat-sys-surface-container-highest);border:1px solid var(--mat-sys-outline-variant);border-radius:14px;padding:0 10px;font-size:13px;height:28px;cursor:pointer;transition:background-color .2s ease}.chat-sub-toolbar[_ngcontent-%COMP%] .filter-chip[_ngcontent-%COMP%]:hover{background-color:var(--mat-sys-surface-variant)}.chat-sub-toolbar[_ngcontent-%COMP%] .filter-chip[_ngcontent-%COMP%] .chip-label[_ngcontent-%COMP%]{font-weight:500;color:var(--mat-sys-on-surface-variant)}.chat-sub-toolbar[_ngcontent-%COMP%] .filter-chip[_ngcontent-%COMP%] .chip-remove[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;background:none;border:none;cursor:pointer;color:var(--mat-sys-on-surface-variant);padding:0;margin-left:4px}.chat-sub-toolbar[_ngcontent-%COMP%] .filter-chip[_ngcontent-%COMP%] .chip-remove[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:14px;width:14px;height:14px}.chat-sub-toolbar[_ngcontent-%COMP%] .filter-chip[_ngcontent-%COMP%] .chip-remove[_ngcontent-%COMP%]:hover{color:var(--mat-sys-on-surface)}.chat-sub-toolbar[_ngcontent-%COMP%] .add-filter-btn[_ngcontent-%COMP%]{display:flex;align-items:center;background-color:transparent;border:1px dashed var(--mat-sys-outline-variant);border-radius:14px;padding:0 10px;font-size:13px;font-weight:500;height:28px;cursor:pointer;transition:all .2s ease;color:var(--mat-sys-on-surface-variant)}.chat-sub-toolbar[_ngcontent-%COMP%] .add-filter-btn[_ngcontent-%COMP%]:hover{background-color:var(--mat-sys-surface-variant);border-color:var(--mat-sys-outline);color:var(--mat-sys-on-surface)}.chat-sub-toolbar[_ngcontent-%COMP%] .add-filter-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:14px;width:14px;height:14px;margin-right:4px} .filter-panel{min-width:max-content!important;max-width:50vw} .filter-panel .mat-mdc-menu-item{min-height:32px!important;font-size:12px!important} .filter-panel .mat-mdc-menu-item .mat-mdc-menu-item-text, .filter-panel .mat-mdc-menu-item .mdc-list-item__primary-text{font-size:12px!important;line-height:normal}.trace-tree-container[_ngcontent-%COMP%]{margin:12px 48px 12px 12px;border-radius:12px;border:none;background:var(--mat-sys-surface-container-lowest, #fff);box-shadow:0 4px 20px #0000000d,0 1px 3px #0000000a}.chat-input[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:10px;width:min(960px,88%);margin:0 auto;position:relative;transition:all .3s ease;box-sizing:border-box}.chat-input[_ngcontent-%COMP%] .chat-input-content-row[_ngcontent-%COMP%]{display:flex;gap:16px;align-items:flex-end;width:100%}.video-container[_ngcontent-%COMP%]{display:none;border-radius:12px;overflow:hidden;background:var(--mat-sys-surface-variant);border:1px solid var(--mat-sys-outline-variant);width:200px}.video-container.visible[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;flex-shrink:0;box-shadow:0 8px 24px #00000026}.video-container[_ngcontent-%COMP%] video{width:100%!important;height:auto!important;max-height:280px;object-fit:cover;border-radius:12px;transform:scaleX(-1)}.input-field[_ngcontent-%COMP%]{flex-grow:1;position:relative}.input-field[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{color:var(--mat-sys-on-surface);border:none;box-sizing:content-box;caret-color:var(--mat-sys-primary)}.input-field[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::placeholder{color:var(--mat-sys-on-surface-variant)}.input-field[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:not(:disabled):not(.stop-message-btn){color:var(--mat-sys-primary)!important}.input-field[_ngcontent-%COMP%] .mat-mdc-form-field-flex{align-items:flex-end!important}.input-field[_ngcontent-%COMP%] .mat-mdc-form-field-icon-prefix, .input-field[_ngcontent-%COMP%] .mat-mdc-form-field-icon-suffix{align-self:flex-end!important;margin-bottom:8px!important}button.stop-message-btn[_ngcontent-%COMP%]:not(:disabled){color:#ea4335!important}button.stop-message-btn[_ngcontent-%COMP%]:not(:disabled):hover{background-color:#ea433514!important}button[_ngcontent-%COMP%]:disabled{color:var(--mat-sys-on-surface-variant)!important;opacity:.38!important;cursor:not-allowed}button.input-prefix-menu-btn[_ngcontent-%COMP%]{margin-left:12px!important}button.input-prefix-menu-btn[_ngcontent-%COMP%]:not(:disabled){color:var(--mat-sys-on-surface-variant)!important}.input-suffix-container[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:8px;margin-right:12px!important}.file-preview[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:5px;margin-top:2px;margin-bottom:8px}.image-container[_ngcontent-%COMP%]{position:relative;display:inline-block;border-radius:12px;overflow:hidden}.image-preview[_ngcontent-%COMP%]{display:block;width:100%;height:auto;border-radius:12px;width:80px;height:80px}.delete-button[_ngcontent-%COMP%]{position:absolute;top:1px;right:1px;border:none;border-radius:50%;padding:8px;cursor:pointer;color:var(--mat-sys-error);display:flex;align-items:center;justify-content:center;scale:.7}.delete-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px}.file-container[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;gap:8px;height:80px;border-radius:12px}.file-info[_ngcontent-%COMP%]{margin-right:60px;padding-top:20px;padding-left:16px}.chat-input-box[_ngcontent-%COMP%]{caret-color:#fff}.loading-spinner-container[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;height:100%}.messages-loading-container[_ngcontent-%COMP%]{margin-top:1em;margin-bottom:1em}.agent-loading-indicator[_ngcontent-%COMP%]{margin-top:16px;margin-bottom:8px;padding:0 20px;width:240px}.readme-content[_ngcontent-%COMP%]{padding:0 20px;font-size:14px;line-height:1.8;color:var(--mat-sys-on-surface)}.readme-content[_ngcontent-%COMP%] pre code{font-size:12px!important}.branches-container[_ngcontent-%COMP%]{margin:8px -20px;border-radius:8px;overflow:hidden}.light-theme[_nghost-%COMP%] .branches-container[_ngcontent-%COMP%] .mat-mdc-tab-header, .light-theme [_nghost-%COMP%] .branches-container[_ngcontent-%COMP%] .mat-mdc-tab-header{background:transparent!important}.light-theme[_nghost-%COMP%] .branches-container[_ngcontent-%COMP%] .mat-mdc-tab, .light-theme [_nghost-%COMP%] .branches-container[_ngcontent-%COMP%] .mat-mdc-tab{background:var(--mat-sys-surface-container-highest)!important}.light-theme[_nghost-%COMP%] .branches-container[_ngcontent-%COMP%] .mat-mdc-tab.mdc-tab--active, .light-theme [_nghost-%COMP%] .branches-container[_ngcontent-%COMP%] .mat-mdc-tab.mdc-tab--active{background:#e8f5e9!important}.light-theme[_nghost-%COMP%] .branches-container[_ngcontent-%COMP%] .mdc-tab-indicator__content--underline, .light-theme [_nghost-%COMP%] .branches-container[_ngcontent-%COMP%] .mdc-tab-indicator__content--underline{border-color:#2e7d32!important}.branches-container[_ngcontent-%COMP%] .mat-mdc-tab-header{height:32px!important;background:transparent!important;justify-content:flex-start!important}.branches-container[_ngcontent-%COMP%] .mat-mdc-tab-label-container{border-bottom:none!important}.branches-container[_ngcontent-%COMP%] .mdc-tab-indicator__content--underline{border-color:#4caf50!important}.branches-container[_ngcontent-%COMP%] .mat-mdc-tab{height:32px!important;font-size:12px!important;min-width:auto!important;padding:0 16px!important;flex:0 0 auto!important;border-top-left-radius:8px!important;border-top-right-radius:8px!important;background:var(--mat-sys-surface-container-highest)!important;margin-right:2px;overflow:hidden!important}.branches-container[_ngcontent-%COMP%] .mat-mdc-tab .mdc-tab__text-label{color:var(--mat-sys-on-surface-variant)!important;opacity:.6}.branches-container[_ngcontent-%COMP%] .mat-mdc-tab.mdc-tab--active{background:#1b4d24!important}.branches-container[_ngcontent-%COMP%] .mat-mdc-tab.mdc-tab--active .mdc-tab__text-label{color:var(--mat-sys-on-surface)!important;opacity:1!important}.branches-container[_ngcontent-%COMP%] .mat-mdc-tab-body-content{padding:0!important}.branches-container[_ngcontent-%COMP%] .mdc-tab__text-label{font-size:12px!important}.branches-container[_ngcontent-%COMP%] .tab-name{max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block}.branches-container[_ngcontent-%COMP%] .branch-events-content[_ngcontent-%COMP%]{padding:8px 20px;background:#1b4d24}.light-theme[_nghost-%COMP%] .branches-container[_ngcontent-%COMP%] .branch-events-content[_ngcontent-%COMP%], .light-theme [_nghost-%COMP%] .branches-container[_ngcontent-%COMP%] .branch-events-content[_ngcontent-%COMP%]{background:#e8f5e9}@media(max-width:768px){.chat-messages[_ngcontent-%COMP%]{padding:12px!important}.chat-input[_ngcontent-%COMP%]{width:100%!important;padding:8px!important}.chat-input-content-row[_ngcontent-%COMP%]{gap:8px!important}.input-suffix-container[_ngcontent-%COMP%]{gap:4px!important;margin-right:4px!important}button.input-prefix-menu-btn[_ngcontent-%COMP%]{margin-left:4px!important}}"]})};var yDA=[[["caption"]],[["colgroup"],["col"]],"*"],DDA=["caption","colgroup, col","*"];function vDA(i,e){i&1&&Ze(0,2)}function bDA(i,e){i&1&&(I(0,"thead",0),dn(1,1),h(),I(2,"tbody",0),dn(3,2)(4,3),h(),I(5,"tfoot",0),dn(6,4),h())}function MDA(i,e){i&1&&dn(0,1)(1,2)(2,3)(3,4)}var bc=new MA("CDK_TABLE");var uy=(()=>{class i{template=w(wo);constructor(){}static \u0275fac=function(t){return new(t||i)};static \u0275dir=VA({type:i,selectors:[["","cdkCellDef",""]]})}return i})(),py=(()=>{class i{template=w(wo);constructor(){}static \u0275fac=function(t){return new(t||i)};static \u0275dir=VA({type:i,selectors:[["","cdkHeaderCellDef",""]]})}return i})(),qX=(()=>{class i{template=w(wo);constructor(){}static \u0275fac=function(t){return new(t||i)};static \u0275dir=VA({type:i,selectors:[["","cdkFooterCellDef",""]]})}return i})(),ME=(()=>{class i{_table=w(bc,{optional:!0});_hasStickyChanged=!1;get name(){return this._name}set name(A){this._setNameInput(A)}_name;get sticky(){return this._sticky}set sticky(A){A!==this._sticky&&(this._sticky=A,this._hasStickyChanged=!0)}_sticky=!1;get stickyEnd(){return this._stickyEnd}set stickyEnd(A){A!==this._stickyEnd&&(this._stickyEnd=A,this._hasStickyChanged=!0)}_stickyEnd=!1;cell;headerCell;footerCell;cssClassFriendlyName;_columnCssClassName;constructor(){}hasStickyChanged(){let A=this._hasStickyChanged;return this.resetStickyChanged(),A}resetStickyChanged(){this._hasStickyChanged=!1}_updateColumnCssClassName(){this._columnCssClassName=[`cdk-column-${this.cssClassFriendlyName}`]}_setNameInput(A){A&&(this._name=A,this.cssClassFriendlyName=A.replace(/[^a-z0-9_-]/gi,"-"),this._updateColumnCssClassName())}static \u0275fac=function(t){return new(t||i)};static \u0275dir=VA({type:i,selectors:[["","cdkColumnDef",""]],contentQueries:function(t,n,o){if(t&1&&ra(o,uy,5)(o,py,5)(o,qX,5),t&2){let a;se(a=le())&&(n.cell=a.first),se(a=le())&&(n.headerCell=a.first),se(a=le())&&(n.footerCell=a.first)}},inputs:{name:[0,"cdkColumnDef","name"],sticky:[2,"sticky","sticky",Qe],stickyEnd:[2,"stickyEnd","stickyEnd",Qe]}})}return i})(),Qy=class{constructor(e,A){A.nativeElement.classList.add(...e._columnCssClassName)}},WX=(()=>{class i extends Qy{constructor(){super(w(ME),w(ce))}static \u0275fac=function(t){return new(t||i)};static \u0275dir=VA({type:i,selectors:[["cdk-header-cell"],["th","cdk-header-cell",""]],hostAttrs:["role","columnheader",1,"cdk-header-cell"],features:[bt]})}return i})();var ZX=(()=>{class i extends Qy{constructor(){let A=w(ME),t=w(ce);super(A,t);let n=A._table?._getCellRole();n&&t.nativeElement.setAttribute("role",n)}static \u0275fac=function(t){return new(t||i)};static \u0275dir=VA({type:i,selectors:[["cdk-cell"],["td","cdk-cell",""]],hostAttrs:[1,"cdk-cell"],features:[bt]})}return i})();var pR=(()=>{class i{template=w(wo);_differs=w(k1);columns;_columnsDiffer;constructor(){}ngOnChanges(A){if(!this._columnsDiffer){let t=A.columns&&A.columns.currentValue||[];this._columnsDiffer=this._differs.find(t).create(),this._columnsDiffer.diff(t)}}getColumnsDiff(){return this._columnsDiffer.diff(this.columns)}extractCellTemplate(A){return this instanceof fR?A.headerCell.template:this instanceof mR?A.footerCell.template:A.cell.template}static \u0275fac=function(t){return new(t||i)};static \u0275dir=VA({type:i,features:[ii]})}return i})(),fR=(()=>{class i extends pR{_table=w(bc,{optional:!0});_hasStickyChanged=!1;get sticky(){return this._sticky}set sticky(A){A!==this._sticky&&(this._sticky=A,this._hasStickyChanged=!0)}_sticky=!1;constructor(){super(w(wo),w(k1))}ngOnChanges(A){super.ngOnChanges(A)}hasStickyChanged(){let A=this._hasStickyChanged;return this.resetStickyChanged(),A}resetStickyChanged(){this._hasStickyChanged=!1}static \u0275fac=function(t){return new(t||i)};static \u0275dir=VA({type:i,selectors:[["","cdkHeaderRowDef",""]],inputs:{columns:[0,"cdkHeaderRowDef","columns"],sticky:[2,"cdkHeaderRowDefSticky","sticky",Qe]},features:[bt,ii]})}return i})(),mR=(()=>{class i extends pR{_table=w(bc,{optional:!0});_hasStickyChanged=!1;get sticky(){return this._sticky}set sticky(A){A!==this._sticky&&(this._sticky=A,this._hasStickyChanged=!0)}_sticky=!1;constructor(){super(w(wo),w(k1))}ngOnChanges(A){super.ngOnChanges(A)}hasStickyChanged(){let A=this._hasStickyChanged;return this.resetStickyChanged(),A}resetStickyChanged(){this._hasStickyChanged=!1}static \u0275fac=function(t){return new(t||i)};static \u0275dir=VA({type:i,selectors:[["","cdkFooterRowDef",""]],inputs:{columns:[0,"cdkFooterRowDef","columns"],sticky:[2,"cdkFooterRowDefSticky","sticky",Qe]},features:[bt,ii]})}return i})(),fy=(()=>{class i extends pR{_table=w(bc,{optional:!0});when;constructor(){super(w(wo),w(k1))}static \u0275fac=function(t){return new(t||i)};static \u0275dir=VA({type:i,selectors:[["","cdkRowDef",""]],inputs:{columns:[0,"cdkRowDefColumns","columns"],when:[0,"cdkRowDefWhen","when"]},features:[bt]})}return i})(),xp=(()=>{class i{_viewContainer=w(Jo);cells;context;static mostRecentCellOutlet=null;constructor(){i.mostRecentCellOutlet=this}ngOnDestroy(){i.mostRecentCellOutlet===this&&(i.mostRecentCellOutlet=null)}static \u0275fac=function(t){return new(t||i)};static \u0275dir=VA({type:i,selectors:[["","cdkCellOutlet",""]]})}return i})();var wR=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275cmp=vA({type:i,selectors:[["cdk-row"],["tr","cdk-row",""]],hostAttrs:["role","row",1,"cdk-row"],decls:1,vars:0,consts:[["cdkCellOutlet",""]],template:function(t,n){t&1&&dn(0,0)},dependencies:[xp],encapsulation:2})}return i})(),XX=(()=>{class i{templateRef=w(wo);_contentClassNames=["cdk-no-data-row","cdk-row"];_cellClassNames=["cdk-cell","cdk-no-data-cell"];_cellSelector="td, cdk-cell, [cdk-cell], .cdk-cell";constructor(){}static \u0275fac=function(t){return new(t||i)};static \u0275dir=VA({type:i,selectors:[["ng-template","cdkNoDataRow",""]]})}return i})(),jX=["top","bottom","left","right"],uR=class{_isNativeHtmlTable;_stickCellCss;_isBrowser;_needsPositionStickyOnElement;direction;_positionListener;_tableInjector;_elemSizeCache=new WeakMap;_resizeObserver=globalThis?.ResizeObserver?new globalThis.ResizeObserver(e=>this._updateCachedSizes(e)):null;_updatedStickyColumnsParamsToReplay=[];_stickyColumnsReplayTimeout=null;_cachedCellWidths=[];_borderCellCss;_destroyed=!1;constructor(e,A,t=!0,n=!0,o,a,r){this._isNativeHtmlTable=e,this._stickCellCss=A,this._isBrowser=t,this._needsPositionStickyOnElement=n,this.direction=o,this._positionListener=a,this._tableInjector=r,this._borderCellCss={top:`${A}-border-elem-top`,bottom:`${A}-border-elem-bottom`,left:`${A}-border-elem-left`,right:`${A}-border-elem-right`}}clearStickyPositioning(e,A){(A.includes("left")||A.includes("right"))&&this._removeFromStickyColumnReplayQueue(e);let t=[];for(let n of e)n.nodeType===n.ELEMENT_NODE&&t.push(n,...Array.from(n.children));ao({write:()=>{for(let n of t)this._removeStickyStyle(n,A)}},{injector:this._tableInjector})}updateStickyColumns(e,A,t,n=!0,o=!0){if(!e.length||!this._isBrowser||!(A.some(f=>f)||t.some(f=>f))){this._positionListener?.stickyColumnsUpdated({sizes:[]}),this._positionListener?.stickyEndColumnsUpdated({sizes:[]});return}let a=e[0],r=a.children.length,s=this.direction==="rtl",l=s?"right":"left",g=s?"left":"right",C=A.lastIndexOf(!0),d=t.indexOf(!0),B,u,E;o&&this._updateStickyColumnReplayQueue({rows:[...e],stickyStartStates:[...A],stickyEndStates:[...t]}),ao({earlyRead:()=>{B=this._getCellWidths(a,n),u=this._getStickyStartColumnPositions(B,A),E=this._getStickyEndColumnPositions(B,t)},write:()=>{for(let f of e)for(let m=0;m<r;m++){let v=f.children[m];A[m]&&this._addStickyStyle(v,l,u[m],m===C),t[m]&&this._addStickyStyle(v,g,E[m],m===d)}this._positionListener&&B.some(f=>!!f)&&(this._positionListener.stickyColumnsUpdated({sizes:C===-1?[]:B.slice(0,C+1).map((f,m)=>A[m]?f:null)}),this._positionListener.stickyEndColumnsUpdated({sizes:d===-1?[]:B.slice(d).map((f,m)=>t[m+d]?f:null).reverse()}))}},{injector:this._tableInjector})}stickRows(e,A,t){if(!this._isBrowser)return;let n=t==="bottom"?e.slice().reverse():e,o=t==="bottom"?A.slice().reverse():A,a=[],r=[],s=[];ao({earlyRead:()=>{for(let l=0,g=0;l<n.length;l++){if(!o[l])continue;a[l]=g;let C=n[l];s[l]=this._isNativeHtmlTable?Array.from(C.children):[C];let d=this._retrieveElementSize(C).height;g+=d,r[l]=d}},write:()=>{let l=o.lastIndexOf(!0);for(let g=0;g<n.length;g++){if(!o[g])continue;let C=a[g],d=g===l;for(let B of s[g])this._addStickyStyle(B,t,C,d)}t==="top"?this._positionListener?.stickyHeaderRowsUpdated({sizes:r,offsets:a,elements:s}):this._positionListener?.stickyFooterRowsUpdated({sizes:r,offsets:a,elements:s})}},{injector:this._tableInjector})}updateStickyFooterContainer(e,A){this._isNativeHtmlTable&&ao({write:()=>{let t=e.querySelector("tfoot");t&&(A.some(n=>!n)?this._removeStickyStyle(t,["bottom"]):this._addStickyStyle(t,"bottom",0,!1))}},{injector:this._tableInjector})}destroy(){this._stickyColumnsReplayTimeout&&clearTimeout(this._stickyColumnsReplayTimeout),this._resizeObserver?.disconnect(),this._destroyed=!0}_removeStickyStyle(e,A){if(!e.classList.contains(this._stickCellCss))return;for(let n of A)e.style[n]="",e.classList.remove(this._borderCellCss[n]);jX.some(n=>A.indexOf(n)===-1&&e.style[n])?e.style.zIndex=this._getCalculatedZIndex(e):(e.style.zIndex="",this._needsPositionStickyOnElement&&(e.style.position=""),e.classList.remove(this._stickCellCss))}_addStickyStyle(e,A,t,n){e.classList.add(this._stickCellCss),n&&e.classList.add(this._borderCellCss[A]),e.style[A]=`${t}px`,e.style.zIndex=this._getCalculatedZIndex(e),this._needsPositionStickyOnElement&&(e.style.cssText+="position: -webkit-sticky; position: sticky; ")}_getCalculatedZIndex(e){let A={top:100,bottom:10,left:1,right:1},t=0;for(let n of jX)e.style[n]&&(t+=A[n]);return t?`${t}`:""}_getCellWidths(e,A=!0){if(!A&&this._cachedCellWidths.length)return this._cachedCellWidths;let t=[],n=e.children;for(let o=0;o<n.length;o++){let a=n[o];t.push(this._retrieveElementSize(a).width)}return this._cachedCellWidths=t,t}_getStickyStartColumnPositions(e,A){let t=[],n=0;for(let o=0;o<e.length;o++)A[o]&&(t[o]=n,n+=e[o]);return t}_getStickyEndColumnPositions(e,A){let t=[],n=0;for(let o=e.length;o>0;o--)A[o]&&(t[o]=n,n+=e[o]);return t}_retrieveElementSize(e){let A=this._elemSizeCache.get(e);if(A)return A;let t=e.getBoundingClientRect(),n={width:t.width,height:t.height};return this._resizeObserver&&(this._elemSizeCache.set(e,n),this._resizeObserver.observe(e,{box:"border-box"})),n}_updateStickyColumnReplayQueue(e){this._removeFromStickyColumnReplayQueue(e.rows),this._stickyColumnsReplayTimeout||this._updatedStickyColumnsParamsToReplay.push(e)}_removeFromStickyColumnReplayQueue(e){let A=new Set(e);for(let t of this._updatedStickyColumnsParamsToReplay)t.rows=t.rows.filter(n=>!A.has(n));this._updatedStickyColumnsParamsToReplay=this._updatedStickyColumnsParamsToReplay.filter(t=>!!t.rows.length)}_updateCachedSizes(e){let A=!1;for(let t of e){let n=t.borderBoxSize?.length?{width:t.borderBoxSize[0].inlineSize,height:t.borderBoxSize[0].blockSize}:{width:t.contentRect.width,height:t.contentRect.height};n.width!==this._elemSizeCache.get(t.target)?.width&&SDA(t.target)&&(A=!0),this._elemSizeCache.set(t.target,n)}A&&this._updatedStickyColumnsParamsToReplay.length&&(this._stickyColumnsReplayTimeout&&clearTimeout(this._stickyColumnsReplayTimeout),this._stickyColumnsReplayTimeout=setTimeout(()=>{if(!this._destroyed){for(let t of this._updatedStickyColumnsParamsToReplay)this.updateStickyColumns(t.rows,t.stickyStartStates,t.stickyEndStates,!0,!1);this._updatedStickyColumnsParamsToReplay=[],this._stickyColumnsReplayTimeout=null}},0))}};function SDA(i){return["cdk-cell","cdk-header-cell","cdk-footer-cell"].some(e=>i.classList.contains(e))}var _p=new MA("STICKY_POSITIONING_LISTENER");var yR=(()=>{class i{viewContainer=w(Jo);elementRef=w(ce);constructor(){let A=w(bc);A._rowOutlet=this,A._outletAssigned()}static \u0275fac=function(t){return new(t||i)};static \u0275dir=VA({type:i,selectors:[["","rowOutlet",""]]})}return i})(),DR=(()=>{class i{viewContainer=w(Jo);elementRef=w(ce);constructor(){let A=w(bc);A._headerRowOutlet=this,A._outletAssigned()}static \u0275fac=function(t){return new(t||i)};static \u0275dir=VA({type:i,selectors:[["","headerRowOutlet",""]]})}return i})(),vR=(()=>{class i{viewContainer=w(Jo);elementRef=w(ce);constructor(){let A=w(bc);A._footerRowOutlet=this,A._outletAssigned()}static \u0275fac=function(t){return new(t||i)};static \u0275dir=VA({type:i,selectors:[["","footerRowOutlet",""]]})}return i})(),bR=(()=>{class i{viewContainer=w(Jo);elementRef=w(ce);constructor(){let A=w(bc);A._noDataRowOutlet=this,A._outletAssigned()}static \u0275fac=function(t){return new(t||i)};static \u0275dir=VA({type:i,selectors:[["","noDataRowOutlet",""]]})}return i})(),MR=(()=>{class i{_differs=w(k1);_changeDetectorRef=w(Mt);_elementRef=w(ce);_dir=w(No,{optional:!0});_platform=w(Qi);_viewRepeater;_viewportRuler=w(Ns);_injector=w(St);_virtualScrollViewport=w(NU,{optional:!0,host:!0});_positionListener=w(_p,{optional:!0})||w(_p,{optional:!0,skipSelf:!0});_document=w(ci);_data;_renderedRange;_onDestroy=new ne;_renderRows;_renderChangeSubscription=null;_columnDefsByName=new Map;_rowDefs;_headerRowDefs;_footerRowDefs;_dataDiffer;_defaultRowDef=null;_customColumnDefs=new Set;_customRowDefs=new Set;_customHeaderRowDefs=new Set;_customFooterRowDefs=new Set;_customNoDataRow=null;_headerRowDefChanged=!0;_footerRowDefChanged=!0;_stickyColumnStylesNeedReset=!0;_forceRecalculateCellWidths=!0;_cachedRenderRowsMap=new Map;_isNativeHtmlTable;_stickyStyler;stickyCssClass="cdk-table-sticky";needsPositionStickyOnElement=!0;_isServer;_isShowingNoDataRow=!1;_hasAllOutlets=!1;_hasInitialized=!1;_headerRowStickyUpdates=new ne;_footerRowStickyUpdates=new ne;_disableVirtualScrolling=!1;_getCellRole(){if(this._cellRoleInternal===void 0){let A=this._elementRef.nativeElement.getAttribute("role");return A==="grid"||A==="treegrid"?"gridcell":"cell"}return this._cellRoleInternal}_cellRoleInternal=void 0;get trackBy(){return this._trackByFn}set trackBy(A){this._trackByFn=A}_trackByFn;get dataSource(){return this._dataSource}set dataSource(A){this._dataSource!==A&&(this._switchDataSource(A),this._changeDetectorRef.markForCheck())}_dataSource;_dataSourceChanges=new ne;_dataStream=new ne;get multiTemplateDataRows(){return this._multiTemplateDataRows}set multiTemplateDataRows(A){this._multiTemplateDataRows=A,this._rowOutlet&&this._rowOutlet.viewContainer.length&&(this._forceRenderDataRows(),this.updateStickyColumnStyles())}_multiTemplateDataRows=!1;get fixedLayout(){return this._virtualScrollEnabled()?!0:this._fixedLayout}set fixedLayout(A){this._fixedLayout=A,this._forceRecalculateCellWidths=!0,this._stickyColumnStylesNeedReset=!0}_fixedLayout=!1;recycleRows=!1;contentChanged=new FA;viewChange=new gi({start:0,end:Number.MAX_VALUE});_rowOutlet;_headerRowOutlet;_footerRowOutlet;_noDataRowOutlet;_contentColumnDefs;_contentRowDefs;_contentHeaderRowDefs;_contentFooterRowDefs;_noDataRow;constructor(){w(new Ys("role"),{optional:!0})||this._elementRef.nativeElement.setAttribute("role","table"),this._isServer=!this._platform.isBrowser,this._isNativeHtmlTable=this._elementRef.nativeElement.nodeName==="TABLE",this._dataDiffer=this._differs.find([]).create((t,n)=>this.trackBy?this.trackBy(n.dataIndex,n.data):n)}ngOnInit(){this._setupStickyStyler(),this._viewportRuler.change().pipe(yt(this._onDestroy)).subscribe(()=>{this._forceRecalculateCellWidths=!0})}ngAfterContentInit(){this._viewRepeater=this.recycleRows||this._virtualScrollEnabled()?new Wf:new Zf,this._virtualScrollEnabled()&&this._setupVirtualScrolling(this._virtualScrollViewport),this._hasInitialized=!0}ngAfterContentChecked(){this._canRender()&&this._render()}ngOnDestroy(){this._stickyStyler?.destroy(),[this._rowOutlet?.viewContainer,this._headerRowOutlet?.viewContainer,this._footerRowOutlet?.viewContainer,this._cachedRenderRowsMap,this._customColumnDefs,this._customRowDefs,this._customHeaderRowDefs,this._customFooterRowDefs,this._columnDefsByName].forEach(A=>{A?.clear()}),this._headerRowDefs=[],this._footerRowDefs=[],this._defaultRowDef=null,this._headerRowStickyUpdates.complete(),this._footerRowStickyUpdates.complete(),this._onDestroy.next(),this._onDestroy.complete(),eu(this.dataSource)&&this.dataSource.disconnect(this)}renderRows(){this._renderRows=this._getAllRenderRows();let A=this._dataDiffer.diff(this._renderRows);if(!A){this._updateNoDataRow(),this.contentChanged.next();return}let t=this._rowOutlet.viewContainer;this._viewRepeater.applyChanges(A,t,(n,o,a)=>this._getEmbeddedViewArgs(n.item,a),n=>n.item.data,n=>{n.operation===Yg.INSERTED&&n.context&&this._renderCellTemplateForItem(n.record.item.rowDef,n.context)}),this._updateRowIndexContext(),A.forEachIdentityChange(n=>{let o=t.get(n.currentIndex);o.context.$implicit=n.item.data}),this._updateNoDataRow(),this.contentChanged.next(),this.updateStickyColumnStyles()}addColumnDef(A){this._customColumnDefs.add(A)}removeColumnDef(A){this._customColumnDefs.delete(A)}addRowDef(A){this._customRowDefs.add(A)}removeRowDef(A){this._customRowDefs.delete(A)}addHeaderRowDef(A){this._customHeaderRowDefs.add(A),this._headerRowDefChanged=!0}removeHeaderRowDef(A){this._customHeaderRowDefs.delete(A),this._headerRowDefChanged=!0}addFooterRowDef(A){this._customFooterRowDefs.add(A),this._footerRowDefChanged=!0}removeFooterRowDef(A){this._customFooterRowDefs.delete(A),this._footerRowDefChanged=!0}setNoDataRow(A){this._customNoDataRow=A}updateStickyHeaderRowStyles(){let A=this._getRenderedRows(this._headerRowOutlet);if(this._isNativeHtmlTable){let n=VX(this._headerRowOutlet,"thead");n&&(n.style.display=A.length?"":"none")}let t=this._headerRowDefs.map(n=>n.sticky);this._stickyStyler.clearStickyPositioning(A,["top"]),this._stickyStyler.stickRows(A,t,"top"),this._headerRowDefs.forEach(n=>n.resetStickyChanged())}updateStickyFooterRowStyles(){let A=this._getRenderedRows(this._footerRowOutlet);if(this._isNativeHtmlTable){let n=VX(this._footerRowOutlet,"tfoot");n&&(n.style.display=A.length?"":"none")}let t=this._footerRowDefs.map(n=>n.sticky);this._stickyStyler.clearStickyPositioning(A,["bottom"]),this._stickyStyler.stickRows(A,t,"bottom"),this._stickyStyler.updateStickyFooterContainer(this._elementRef.nativeElement,t),this._footerRowDefs.forEach(n=>n.resetStickyChanged())}updateStickyColumnStyles(){let A=this._getRenderedRows(this._headerRowOutlet),t=this._getRenderedRows(this._rowOutlet),n=this._getRenderedRows(this._footerRowOutlet);(this._isNativeHtmlTable&&!this.fixedLayout||this._stickyColumnStylesNeedReset)&&(this._stickyStyler.clearStickyPositioning([...A,...t,...n],["left","right"]),this._stickyColumnStylesNeedReset=!1),A.forEach((o,a)=>{this._addStickyColumnStyles([o],this._headerRowDefs[a])}),this._rowDefs.forEach(o=>{let a=[];for(let r=0;r<t.length;r++)this._renderRows[r].rowDef===o&&a.push(t[r]);this._addStickyColumnStyles(a,o)}),n.forEach((o,a)=>{this._addStickyColumnStyles([o],this._footerRowDefs[a])}),Array.from(this._columnDefsByName.values()).forEach(o=>o.resetStickyChanged())}stickyColumnsUpdated(A){this._positionListener?.stickyColumnsUpdated(A)}stickyEndColumnsUpdated(A){this._positionListener?.stickyEndColumnsUpdated(A)}stickyHeaderRowsUpdated(A){this._headerRowStickyUpdates.next(A),this._positionListener?.stickyHeaderRowsUpdated(A)}stickyFooterRowsUpdated(A){this._footerRowStickyUpdates.next(A),this._positionListener?.stickyFooterRowsUpdated(A)}_outletAssigned(){!this._hasAllOutlets&&this._rowOutlet&&this._headerRowOutlet&&this._footerRowOutlet&&this._noDataRowOutlet&&(this._hasAllOutlets=!0,this._canRender()&&this._render())}_canRender(){return this._hasAllOutlets&&this._hasInitialized}_render(){this._cacheRowDefs(),this._cacheColumnDefs(),!this._headerRowDefs.length&&!this._footerRowDefs.length&&this._rowDefs.length;let t=this._renderUpdatedColumns()||this._headerRowDefChanged||this._footerRowDefChanged;this._stickyColumnStylesNeedReset=this._stickyColumnStylesNeedReset||t,this._forceRecalculateCellWidths=t,this._headerRowDefChanged&&(this._forceRenderHeaderRows(),this._headerRowDefChanged=!1),this._footerRowDefChanged&&(this._forceRenderFooterRows(),this._footerRowDefChanged=!1),this.dataSource&&this._rowDefs.length>0&&!this._renderChangeSubscription?this._observeRenderChanges():this._stickyColumnStylesNeedReset&&this.updateStickyColumnStyles(),this._checkStickyStates()}_getAllRenderRows(){if(!Array.isArray(this._data)||!this._renderedRange)return[];let A=[],t=Math.min(this._data.length,this._renderedRange.end),n=this._cachedRenderRowsMap;this._cachedRenderRowsMap=new Map;for(let o=this._renderedRange.start;o<t;o++){let a=this._data[o],r=this._getRenderRowsForData(a,o,n.get(a));this._cachedRenderRowsMap.has(a)||this._cachedRenderRowsMap.set(a,new WeakMap);for(let s=0;s<r.length;s++){let l=r[s],g=this._cachedRenderRowsMap.get(l.data);g.has(l.rowDef)?g.get(l.rowDef).push(l):g.set(l.rowDef,[l]),A.push(l)}}return A}_getRenderRowsForData(A,t,n){return this._getRowDefs(A,t).map(a=>{let r=n&&n.has(a)?n.get(a):[];if(r.length){let s=r.shift();return s.dataIndex=t,s}else return{data:A,rowDef:a,dataIndex:t}})}_cacheColumnDefs(){this._columnDefsByName.clear(),Ey(this._getOwnDefs(this._contentColumnDefs),this._customColumnDefs).forEach(t=>{this._columnDefsByName.has(t.name),this._columnDefsByName.set(t.name,t)})}_cacheRowDefs(){this._headerRowDefs=Ey(this._getOwnDefs(this._contentHeaderRowDefs),this._customHeaderRowDefs),this._footerRowDefs=Ey(this._getOwnDefs(this._contentFooterRowDefs),this._customFooterRowDefs),this._rowDefs=Ey(this._getOwnDefs(this._contentRowDefs),this._customRowDefs);let A=this._rowDefs.filter(t=>!t.when);this._defaultRowDef=A[0]}_renderUpdatedColumns(){let A=(a,r)=>{let s=!!r.getColumnsDiff();return a||s},t=this._rowDefs.reduce(A,!1);t&&this._forceRenderDataRows();let n=this._headerRowDefs.reduce(A,!1);n&&this._forceRenderHeaderRows();let o=this._footerRowDefs.reduce(A,!1);return o&&this._forceRenderFooterRows(),t||n||o}_switchDataSource(A){this._data=[],eu(this.dataSource)&&this.dataSource.disconnect(this),this._renderChangeSubscription&&(this._renderChangeSubscription.unsubscribe(),this._renderChangeSubscription=null),A||(this._dataDiffer&&this._dataDiffer.diff([]),this._rowOutlet&&this._rowOutlet.viewContainer.clear()),this._dataSource=A}_observeRenderChanges(){if(!this.dataSource)return;let A;eu(this.dataSource)?A=this.dataSource.connect(this):fI(this.dataSource)?A=this.dataSource:Array.isArray(this.dataSource)&&(A=oe(this.dataSource)),this._renderChangeSubscription=Dr([A,this.viewChange]).pipe(yt(this._onDestroy)).subscribe(([t,n])=>{this._data=t||[],this._renderedRange=n,this._dataStream.next(t),this.renderRows()})}_forceRenderHeaderRows(){this._headerRowOutlet.viewContainer.length>0&&this._headerRowOutlet.viewContainer.clear(),this._headerRowDefs.forEach((A,t)=>this._renderRow(this._headerRowOutlet,A,t)),this.updateStickyHeaderRowStyles()}_forceRenderFooterRows(){this._footerRowOutlet.viewContainer.length>0&&this._footerRowOutlet.viewContainer.clear(),this._footerRowDefs.forEach((A,t)=>this._renderRow(this._footerRowOutlet,A,t)),this.updateStickyFooterRowStyles()}_addStickyColumnStyles(A,t){let n=Array.from(t?.columns||[]).map(r=>{let s=this._columnDefsByName.get(r);return s}),o=n.map(r=>r.sticky),a=n.map(r=>r.stickyEnd);this._stickyStyler.updateStickyColumns(A,o,a,!this.fixedLayout||this._forceRecalculateCellWidths)}_getRenderedRows(A){let t=[];for(let n=0;n<A.viewContainer.length;n++){let o=A.viewContainer.get(n);t.push(o.rootNodes[0])}return t}_getRowDefs(A,t){if(this._rowDefs.length===1)return[this._rowDefs[0]];let n=[];if(this.multiTemplateDataRows)n=this._rowDefs.filter(o=>!o.when||o.when(t,A));else{let o=this._rowDefs.find(a=>a.when&&a.when(t,A))||this._defaultRowDef;o&&n.push(o)}return n.length,n}_getEmbeddedViewArgs(A,t){let n=A.rowDef,o={$implicit:A.data};return{templateRef:n.template,context:o,index:t}}_renderRow(A,t,n,o={}){let a=A.viewContainer.createEmbeddedView(t.template,o,n);return this._renderCellTemplateForItem(t,o),a}_renderCellTemplateForItem(A,t){for(let n of this._getCellTemplates(A))xp.mostRecentCellOutlet&&xp.mostRecentCellOutlet._viewContainer.createEmbeddedView(n,t);this._changeDetectorRef.markForCheck()}_updateRowIndexContext(){let A=this._rowOutlet.viewContainer;for(let t=0,n=A.length;t<n;t++){let a=A.get(t).context;a.count=n,a.first=t===0,a.last=t===n-1,a.even=t%2===0,a.odd=!a.even,this.multiTemplateDataRows?(a.dataIndex=this._renderRows[t].dataIndex,a.renderIndex=t):a.index=this._renderRows[t].dataIndex}}_getCellTemplates(A){return!A||!A.columns?[]:Array.from(A.columns,t=>{let n=this._columnDefsByName.get(t);return A.extractCellTemplate(n)})}_forceRenderDataRows(){this._dataDiffer.diff([]),this._rowOutlet.viewContainer.clear(),this.renderRows()}_checkStickyStates(){let A=(t,n)=>t||n.hasStickyChanged();this._headerRowDefs.reduce(A,!1)&&this.updateStickyHeaderRowStyles(),this._footerRowDefs.reduce(A,!1)&&this.updateStickyFooterRowStyles(),Array.from(this._columnDefsByName.values()).reduce(A,!1)&&(this._stickyColumnStylesNeedReset=!0,this.updateStickyColumnStyles())}_setupStickyStyler(){let A=this._dir?this._dir.value:"ltr",t=this._injector;this._stickyStyler=new uR(this._isNativeHtmlTable,this.stickyCssClass,this._platform.isBrowser,this.needsPositionStickyOnElement,A,this,t),(this._dir?this._dir.change:oe()).pipe(yt(this._onDestroy)).subscribe(n=>{this._stickyStyler.direction=n,this.updateStickyColumnStyles()})}_setupVirtualScrolling(A){let t=typeof requestAnimationFrame<"u"?uI:RD;this.viewChange.next({start:0,end:0}),A.renderedRangeStream.pipe(v1(0,t),yt(this._onDestroy)).subscribe(this.viewChange),A.attach({dataStream:this._dataStream,measureRangeSize:(n,o)=>this._measureRangeSize(n,o)}),Dr([A.renderedContentOffset,this._headerRowStickyUpdates]).pipe(yt(this._onDestroy)).subscribe(([n,o])=>{if(!(!o.sizes||!o.offsets||!o.elements))for(let a=0;a<o.elements.length;a++){let r=o.elements[a];if(r){let s=o.offsets[a],l=n!==0?Math.max(n-s,s):-s;for(let g of r)g.style.top=`${-l}px`}}}),Dr([A.renderedContentOffset,this._footerRowStickyUpdates]).pipe(yt(this._onDestroy)).subscribe(([n,o])=>{if(!(!o.sizes||!o.offsets||!o.elements))for(let a=0;a<o.elements.length;a++){let r=o.elements[a];if(r)for(let s of r)s.style.bottom=`${n+o.offsets[a]}px`}})}_getOwnDefs(A){return A.filter(t=>!t._table||t._table===this)}_updateNoDataRow(){let A=this._customNoDataRow||this._noDataRow;if(!A)return;let t=this._rowOutlet.viewContainer.length===0;if(t===this._isShowingNoDataRow)return;let n=this._noDataRowOutlet.viewContainer;if(t){let o=n.createEmbeddedView(A.templateRef),a=o.rootNodes[0];if(o.rootNodes.length===1&&a?.nodeType===this._document.ELEMENT_NODE){a.setAttribute("role","row"),a.classList.add(...A._contentClassNames);let r=a.querySelectorAll(A._cellSelector);for(let s=0;s<r.length;s++)r[s].classList.add(...A._cellClassNames)}}else n.clear();this._isShowingNoDataRow=t,this._changeDetectorRef.markForCheck()}_measureRangeSize(A,t){if(A.start>=A.end||t!=="vertical")return 0;let n=this.viewChange.value,o=this._rowOutlet.viewContainer;A.start<n.start||A.end>n.end;let a=A.start-n.start,r=A.end-A.start,s,l;for(let d=0;d<r;d++){let B=o.get(d+a);if(B&&B.rootNodes.length){s=l=B.rootNodes[0];break}}for(let d=r-1;d>-1;d--){let B=o.get(d+a);if(B&&B.rootNodes.length){l=B.rootNodes[B.rootNodes.length-1];break}}let g=s?.getBoundingClientRect?.(),C=l?.getBoundingClientRect?.();return g&&C?C.bottom-g.top:0}_virtualScrollEnabled(){return!this._disableVirtualScrolling&&this._virtualScrollViewport!=null}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=vA({type:i,selectors:[["cdk-table"],["table","cdk-table",""]],contentQueries:function(t,n,o){if(t&1&&ra(o,XX,5)(o,ME,5)(o,fy,5)(o,fR,5)(o,mR,5),t&2){let a;se(a=le())&&(n._noDataRow=a.first),se(a=le())&&(n._contentColumnDefs=a),se(a=le())&&(n._contentRowDefs=a),se(a=le())&&(n._contentHeaderRowDefs=a),se(a=le())&&(n._contentFooterRowDefs=a)}},hostAttrs:[1,"cdk-table"],hostVars:2,hostBindings:function(t,n){t&2&&_A("cdk-table-fixed-layout",n.fixedLayout)},inputs:{trackBy:"trackBy",dataSource:"dataSource",multiTemplateDataRows:[2,"multiTemplateDataRows","multiTemplateDataRows",Qe],fixedLayout:[2,"fixedLayout","fixedLayout",Qe],recycleRows:[2,"recycleRows","recycleRows",Qe]},outputs:{contentChanged:"contentChanged"},exportAs:["cdkTable"],features:[pt([{provide:bc,useExisting:i},{provide:_p,useValue:null}])],ngContentSelectors:DDA,decls:5,vars:2,consts:[["role","rowgroup"],["headerRowOutlet",""],["rowOutlet",""],["noDataRowOutlet",""],["footerRowOutlet",""]],template:function(t,n){t&1&&(Ot(yDA),Ze(0),Ze(1,1),T(2,vDA,1,0),T(3,bDA,7,0)(4,MDA,4,0)),t&2&&(Q(2),O(n._isServer?2:-1),Q(),O(n._isNativeHtmlTable?3:4))},dependencies:[DR,yR,bR,vR],styles:[`.cdk-table-fixed-layout{table-layout:fixed} |