@ngocsangairvds/vsaf 5.7.0 → 5.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/packages/web/dist/web/browser/chunk-4R37VVI4.js +5 -0
- package/packages/web/dist/web/browser/{chunk-VA6YRKIE.js → chunk-67SQ7ZNG.js} +1 -1
- package/packages/web/dist/web/browser/{chunk-TTPORHEG.js → chunk-6H3AYIT3.js} +1 -1
- package/packages/web/dist/web/browser/{chunk-LPQARKUF.js → chunk-7ELOO4IC.js} +1 -1
- package/packages/web/dist/web/browser/{chunk-S76O6O57.js → chunk-FE2VGLSN.js} +1 -1
- package/packages/web/dist/web/browser/{chunk-FFYMNCCZ.js → chunk-GR7SKUVU.js} +1 -1
- package/packages/web/dist/web/browser/{chunk-IBSRIWBK.js → chunk-L7B3BT5E.js} +1 -1
- package/packages/web/dist/web/browser/{chunk-YBYKUHHQ.js → chunk-MCW5ACIZ.js} +1 -1
- package/packages/web/dist/web/browser/{chunk-UN7U5NAR.js → chunk-N3FOQ3O5.js} +1 -1
- package/packages/web/dist/web/browser/chunk-WNFSSUWZ.js +4 -0
- package/packages/web/dist/web/browser/index.html +2 -2
- package/packages/web/dist/web/browser/{main-7PKVTIG7.js → main-NH3DOZDL.js} +1 -1
- package/packages/web/dist/web/browser/styles-5MTP4CCO.css +1 -0
- package/packages/web/dist/web/browser/chunk-NSKD5KW7.js +0 -4
- package/packages/web/dist/web/browser/chunk-WDOCF7IL.js +0 -5
- package/packages/web/dist/web/browser/styles-MG7ITKTI.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as we,e as Ie}from"./chunk-UN7U5NAR.js";import{a as Se,b as De,e as ke,j as Ne,k as B}from"./chunk-LPQARKUF.js";import{$ as z,$a as ce,Ba as F,Fa as ee,Ib as xe,J as de,Jb as ye,Ka as D,Kb as Ce,La as C,Ma as E,Na as pe,Nb as Ee,O as S,Oa as P,Ob as A,Pa as H,Qa as g,Ra as d,Sa as o,T as M,Ta as k,U as T,Ub as Me,V as G,Xa as R,Ya as h,Za as m,a as oe,aa as ue,ab as me,b as se,bb as ge,ea as le,eb as K,f as ae,gb as l,hb as w,ib as q,jb as j,kb as he,lb as fe,mb as be,oa as Z,qa as a,qb as ve,rb as _e}from"./chunk-WDOCF7IL.js";var X=class i{zone=S(ue);projectService=S(Me);connect(t){return new ae(e=>{let n=this.projectService.currentId,r=n?`?project=${encodeURIComponent(n)}`:"",s=new EventSource(`/api/runs/${t}/events${r}`),_=["node:start","node:complete","node:skip","node:fail","run:complete","run:state","run:pause","run:cancel"];for(let p of _)s.addEventListener(p,u=>{this.zone.run(()=>{e.next({type:p,data:JSON.parse(u.data)})})});return s.onerror=()=>{this.zone.run(()=>{e.complete()}),s.close()},()=>{s.close()}})}static \u0275fac=function(e){return new(e||i)};static \u0275prov=de({token:i,factory:i.\u0275fac,providedIn:"root"})};var qe=new Set(["completed","failed","cancelled"]);function ne(i){return i!==void 0&&qe.has(i)}function Te(i,t=new Date().toISOString()){ne(i.status)&&!i.completedAt&&(i.completedAt=t)}var Be="Approval required",Xe="Run paused \u2014 input required to continue.";function W(i){return`${i.nodeId}\0${i.iteration??""}\0${i.message}`}function Re(i){let t=Oe(i);if(t)return t;let e=i.approval;if(e&&typeof e=="object")return Oe(e)}function Oe(i){let t=V(i.approvalNodeId)??V(i.nodeId);if(!t)return;let e=V(i.approvalMessage)??V(i.message),n=V(i.approvalType)??V(i.type),r=i.iteration;return{nodeId:t,message:e||Be,type:n==="interactive_loop"?"interactive_loop":"approval",iteration:typeof r=="number"?r:void 0}}function V(i){return typeof i=="string"&&i!==""?i:void 0}var Y=class{current;state="hidden";error;answeredKey;pauseReceived(t){this.current=Re(t)??Ge(),this.state="ready",this.error=void 0}runStateChanged(t,e){if(t!=="paused"){this.current=void 0,this.state="hidden",this.error=void 0,this.answeredKey=void 0;return}if(this.state==="submitting")return;let n=e?Re(e):void 0,r=n?W(n):void 0;r!==void 0&&r===this.answeredKey||this.current&&r!==void 0&&r===W(this.current)||this.current&&n===void 0||(this.current=n??Ge(),this.state="ready",this.error=void 0)}submitStarted(){this.state!=="hidden"&&(this.state="submitting",this.error=void 0)}submitFailed(t){this.state!=="hidden"&&(this.state="error",this.error=t)}submitSucceeded(){this.current&&(this.answeredKey=W(this.current)),this.current=void 0,this.state="hidden",this.error=void 0}visible(){return this.state!=="hidden"}phase(){return this.state}request(){return this.current}errorMessage(){return this.error}submitAction(){return this.current?.type==="interactive_loop"?"resume":"approve"}};function Ge(){return{nodeId:"",message:Xe,type:"approval"}}function Fe(i,t,e=new Date().toISOString()){let n=`gate:${W(t)}`;return i.some(r=>r.key===n)?i:[...i,{key:n,role:"gate",text:t.message,at:e,nodeId:t.nodeId,iteration:t.iteration}]}function ie(i,t,e,n=new Date().toISOString()){return[...i,{key:`user:${i.length}:${n}`,role:"user",kind:t,text:Ye(t,e),at:n}]}function Ye(i,t){let e=t.trim();switch(i){case"answer":return e;case"approve":return e?`Approved: ${e}`:"Approved";case"reject":return e?`Rejected: ${e}`:"Rejected"}}function Ae(i){return Ue(i).split(/`([^`]*)`/).map((n,r)=>r%2===1?`<code>${n}</code>`:n.replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>")).join("").replace(/\n/g,"<br>")}function Ue(i){return i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Ve(i){let t=new Map(i.map(c=>[c.key,c])),e=new Map,n=new Set,r=c=>{let b=e.get(c);if(b!==void 0)return b;if(n.has(c))return 0;n.add(c);let N=(t.get(c)?.dependsOn??[]).filter(y=>t.has(y)),x=N.length===0?0:Math.max(...N.map(r))+1;return n.delete(c),e.set(c,x),x};for(let c of i)r(c.key);let s=new Map;for(let c of i){let b=e.get(c.key);(s.get(b)??s.set(b,[]).get(b)).push(c.key)}let _=196,p=84,u=[...s.keys()].sort((c,b)=>c-b),f=new Map;for(let c of u){let b=s.get(c);if(c===0){b.forEach((x,y)=>f.set(x,y));continue}let N=x=>{let y=(t.get(x)?.dependsOn??[]).filter(L=>f.has(L));return y.length===0?f.get(x)??0:y.reduce((L,ze)=>L+f.get(ze),0)/y.length};b.sort((x,y)=>N(x)-N(y)),b.forEach((x,y)=>f.set(x,y))}let I=Math.max(1,...u.map(c=>s.get(c).length))*_,O=new Map;for(let c of u){let b=s.get(c),N=b.length*_,x=(I-N)/2;b.forEach((y,L)=>O.set(y,{x:x+L*_,y:c*p}))}let We=((u.length?u[u.length-1]:0)+1)*p;return{positions:O,layerOf:e,width:I,height:We}}var Je=["host"];function Ze(i,t){if(i&1&&(G(),k(0,"path",9)),i&2){let e=t.$implicit;D("d",e)}}function et(i,t){if(i&1&&(G(),d(0,"text",16),l(1),o()),i&2){let e=m().$implicit,n=m();D("x",n.NODE_W-12)("y",n.NODE_H/2+5),a(),j("",e.progress.done,"/",e.progress.total)}}function tt(i,t){if(i&1&&(G(),d(0,"text",17),l(1,"\u29C9"),o()),i&2){let e=m(2);D("x",e.NODE_W-12)("y",14)}}function nt(i,t){if(i&1){let e=R();G(),d(0,"g",10),h("click",function(){let r=M(e).$implicit,s=m();return T(s.nodeClick.emit(r.key))}),k(1,"rect",11),d(2,"text",12),l(3),o(),d(4,"text",13),l(5),o(),ee(6,et,2,4,"text",14)(7,tt,2,2,"text",15),o()}if(i&2){let e=t.$implicit,n=m();D("transform","translate("+e.x+","+e.y+")"),a(),K("dag-pulse",e.status==="running"),D("width",n.NODE_W)("height",n.NODE_H)("fill",n.fillFor(e.status))("stroke",n.strokeFor(e.status)),a(),D("y",n.NODE_H/2+5)("fill",n.strokeFor(e.status)),a(),w(n.icon(e.status)),a(),D("y",n.NODE_H/2+5),a(),w(n.clip(e.label)),a(),g("ngIf",e.progress),a(),g("ngIf",e.isGroup)}}var $=class i{NODE_W=168;NODE_H=44;nodes=[];edges=[];width=0;height=0;nodeClick=new z;hostRef;scale=1;panX=16;panY=40;dragging=!1;lastX=0;lastY=0;get edgePaths(){let t=new Map(this.nodes.map(n=>[n.key,n])),e=[];for(let n of this.edges){let r=t.get(n.from),s=t.get(n.to);if(!r||!s)continue;let _=r.x+168/2,p=r.y+44,u=s.x+168/2,f=s.y,v=(p+f)/2;e.push(`M${_} ${p} C${_} ${v}, ${u} ${v}, ${u} ${f}`)}return e}onWheel(t){t.preventDefault(),this.zoomBy(t.deltaY<0?1.1:.9)}zoomBy(t,e){e?.stopPropagation(),this.scale=Math.min(2.5,Math.max(.2,this.scale*t))}onDown(t){this.dragging=!0,this.lastX=t.clientX,this.lastY=t.clientY}onMove(t){this.dragging&&(this.panX+=t.clientX-this.lastX,this.panY+=t.clientY-this.lastY,this.lastX=t.clientX,this.lastY=t.clientY)}onUp(){this.dragging=!1}fit(){if(!this.width||!this.height){this.scale=1,this.panX=16,this.panY=40;return}let t=this.hostRef?.nativeElement,e=t?.clientWidth??600,n=t?.clientHeight??400;this.scale=Math.min(2,Math.max(.2,Math.min((e-32)/this.width,(n-48)/this.height))),this.panX=Math.max(16,(e-this.width*this.scale)/2),this.panY=44}clip(t){return t.length>20?t.slice(0,19)+"\u2026":t}icon(t){return{completed:"\u2713",running:"\u25CF",failed:"\u2717",skipped:"\u2298"}[t]??"\u25CB"}fillFor(t){return{completed:"rgba(34,197,94,.14)",running:"rgba(59,130,246,.16)",failed:"rgba(239,68,68,.14)"}[t]??"rgba(30,41,59,.9)"}strokeFor(t){return{completed:"#22c55e",running:"#3b82f6",failed:"#ef4444",skipped:"#64748b"}[t]??"#475569"}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=F({type:i,selectors:[["app-dag-graph"]],viewQuery:function(e,n){if(e&1&&ce(Je,5),e&2){let r;me(r=ge())&&(n.hostRef=r.first)}},inputs:{nodes:"nodes",edges:"edges",width:"width",height:"height"},outputs:{nodeClick:"nodeClick"},decls:16,vars:7,consts:[["host",""],[1,"relative","w-full","h-full","overflow-hidden","select-none","bg-slate-950/40",3,"wheel","mousedown","mousemove","mouseup","mouseleave"],[1,"absolute","top-2","left-2","z-10","flex","gap-1","items-center"],["type","button",1,"dag-btn",3,"click"],[1,"text-xs","text-slate-400","w-10","text-center","font-mono"],["type","button",1,"dag-btn","px-2","w-auto",3,"click"],[1,"absolute","inset-0","w-full","h-full"],["fill","none","stroke","#475569","stroke-width","2","opacity","0.8",4,"ngFor","ngForOf"],["class","cursor-pointer",3,"click",4,"ngFor","ngForOf"],["fill","none","stroke","#475569","stroke-width","2","opacity","0.8"],[1,"cursor-pointer",3,"click"],["rx","9","stroke-width","2"],["x","16","font-size","15"],["x","34","font-size","13","fill","#e2e8f0"],["text-anchor","end","font-size","10","fill","#94a3b8",4,"ngIf"],["text-anchor","end","font-size","11","fill","#94a3b8",4,"ngIf"],["text-anchor","end","font-size","10","fill","#94a3b8"],["text-anchor","end","font-size","11","fill","#94a3b8"]],template:function(e,n){e&1&&(d(0,"div",1,0),h("wheel",function(s){return n.onWheel(s)})("mousedown",function(s){return n.onDown(s)})("mousemove",function(s){return n.onMove(s)})("mouseup",function(){return n.onUp()})("mouseleave",function(){return n.onUp()}),d(2,"div",2)(3,"button",3),h("click",function(s){return n.zoomBy(.8,s)}),l(4,"\u2212"),o(),d(5,"span",4),l(6),ve(7,"number"),o(),d(8,"button",3),h("click",function(s){return n.zoomBy(1.25,s)}),l(9,"+"),o(),d(10,"button",5),h("click",function(){return n.fit()}),l(11,"fit"),o()(),G(),d(12,"svg",6)(13,"g"),ee(14,Ze,1,1,"path",7)(15,nt,8,14,"g",8),o()()()),e&2&&(a(6),q("",_e(7,4,n.scale*100,"1.0-0"),"%"),a(7),D("transform","translate("+n.panX+","+n.panY+") scale("+n.scale+")"),a(),g("ngForOf",n.edgePaths),a(),g("ngForOf",n.nodes))},dependencies:[A,ye,Ce,Ee],styles:[".dag-btn[_ngcontent-%COMP%]{width:24px;height:24px;border:1px solid #334155;border-radius:6px;background:#1e293b;color:#94a3b8;font-size:13px;line-height:1}.dag-btn[_ngcontent-%COMP%]:hover{color:#e2e8f0}.dag-pulse[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_dagpulse 1.3s ease-in-out infinite}@keyframes _ngcontent-%COMP%_dagpulse{0%,to{opacity:1}50%{opacity:.45}}"]})};function U(i,t=""){let e=t===""?"":t+".",n=i.filter(u=>t===""||u.id===t||u.id.startsWith(e)),r=new Map(i.map(u=>[u.id,u])),s=new Map;for(let u of n){let f=t===""?u.id:u.id.slice(e.length),v=f.split(".")[0];if(!v)continue;let I=s.get(v);I||(I={key:e+v,label:v,leafIds:[],deeper:!1},s.set(v,I)),I.leafIds.push(u.id),f.includes(".")&&(I.deeper=!0)}let _=u=>{if(t!==""&&u!==t&&!u.startsWith(e))return;let v=(t===""?u:u.slice(e.length)).split(".")[0];return s.has(v)?e+v:void 0},p=[];for(let u of s.values()){let f=new Set;for(let v of u.leafIds)for(let I of r.get(v)?.dependsOn??[]){let O=_(I);O&&O!==u.key&&f.add(O)}p.push({key:u.key,label:u.label,isGroup:u.deeper,leafIds:u.leafIds,dependsOn:[...f]})}return p}var Pe=new Set(["completed","skipped"]);function He(i,t){let e=i.map(t);return e.some(n=>n==="failed")?"failed":e.some(n=>n==="running")?"running":e.length>0&&e.every(n=>n==="skipped")?"skipped":e.length>0&&e.every(n=>Pe.has(n))?"completed":e.some(n=>n==="completed")?"running":"pending"}function Ke(i,t){let e=i.map(t);return{done:e.filter(n=>Pe.has(n)).length,total:e.length}}function Q(i,t,e=""){let n=U(i,e),r=Ve(n.map(p=>({key:p.key,dependsOn:p.dependsOn}))),s=n.map(p=>{let u=r.positions.get(p.key)??{x:0,y:0};return{key:p.key,label:p.label,isGroup:p.isGroup,status:p.isGroup?He(p.leafIds,t):t(p.leafIds[0]),progress:p.isGroup?Ke(p.leafIds,t):void 0,x:u.x,y:u.y}}),_=[];for(let p of n)for(let u of p.dependsOn)_.push({from:u,to:p.key});return{vms:s,edges:_,width:r.width,height:r.height}}function it(i,t){i&1&&(d(0,"span"),l(1," \u203A "),o())}function rt(i,t){if(i&1){let e=R();d(0,"button",10),h("click",function(){let r=M(e).$implicit,s=m();return T(s.goTo(r))}),l(1),o(),C(2,it,2,0,"span")}if(i&2){let e=t.$implicit,n=t.$index,r=t.$count,s=m();a(),w(s.label(e)),a(),E(n!==r-1?2:-1)}}function ot(i,t){i&1&&(d(0,"div",11),l(1,"\u0110ang t\u1EA3i output\u2026"),o())}function st(i,t){if(i&1&&(d(0,"div",12),l(1),o()),i&2){let e=m(2);a(),w(e.leafError)}}function at(i,t){if(i&1&&(d(0,"pre",13),l(1),o()),i&2){let e=m(3);a(),w(e.leafData==null?null:e.leafData.error)}}function dt(i,t){if(i&1&&(d(0,"pre",14),l(1),o()),i&2){let e=m(3);a(),w(e.leafData==null?null:e.leafData.output)}}function ut(i,t){i&1&&(d(0,"div",15),l(1,"Kh\xF4ng c\xF3 output"),o())}function lt(i,t){if(i&1&&(C(0,at,2,1,"pre",13),C(1,dt,2,1,"pre",14)(2,ut,2,0,"div",15)),i&2){let e=m(2);E(e.leafData!=null&&e.leafData.error?0:-1),a(),E(e.leafData!=null&&e.leafData.output?1:e.leafData!=null&&e.leafData.error?-1:2)}}function pt(i,t){if(i&1&&(d(0,"div",8),C(1,ot,2,0,"div",11)(2,st,2,1,"div",12)(3,lt,3,2),o()),i&2){let e,n=m();a(),E((e=n.leafPhase)==="loading"?1:e==="error"?2:e==="loaded"?3:-1)}}function ct(i,t){if(i&1){let e=R();d(0,"app-dag-graph",16),h("nodeClick",function(r){M(e);let s=m();return T(s.onSubClick(r))}),o()}if(i&2){let e=m();g("nodes",e.subNodes)("edges",e.subEdges)("width",e.subWidth)("height",e.subHeight)}}var J=class i{api=S(B);runId="";nodes=[];statusOf=()=>"pending";rootKey="";close=new z;breadcrumb=[];isLeaf=!1;subNodes=[];subEdges=[];subWidth=0;subHeight=0;leafPhase="loading";leafData;leafError="";ngOnChanges(t){if(t.rootKey){this.breadcrumb=[],this.goTo(this.rootKey);return}(t.nodes||t.statusOf)&&!this.isLeaf&&this.breadcrumb.length&&this.buildSubView(this.breadcrumb[this.breadcrumb.length-1])}goTo(t){let e=this.breadcrumb.indexOf(t);this.breadcrumb=e>=0?this.breadcrumb.slice(0,e+1):[...this.breadcrumb,t];let n=U(this.nodes,t);if(this.isLeaf=n.length===0,this.isLeaf){this.loadLeaf(t);return}this.buildSubView(t)}buildSubView(t){let e=Q(this.nodes,this.statusOf,t);this.subNodes=e.vms,this.subEdges=e.edges,this.subWidth=e.width,this.subHeight=e.height}onSubClick(t){this.goTo(t)}loadLeaf(t){this.leafPhase="loading",this.api.getNodeOutput(this.runId,t).subscribe({next:e=>{this.leafData={output:e.output,error:e.error},this.leafPhase="loaded"},error:e=>{this.leafError=e?.error?.error??"Kh\xF4ng t\u1EA3i \u0111\u01B0\u1EE3c output.",this.leafPhase="error"}})}label(t){return t.split(".").pop()??t}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=F({type:i,selectors:[["app-node-inspector"]],inputs:{runId:"runId",nodes:"nodes",statusOf:"statusOf",rootKey:"rootKey"},outputs:{close:"close"},features:[le],decls:13,vars:1,consts:[[1,"absolute","inset-0","z-20","flex"],[1,"absolute","inset-0","bg-black/40",3,"click"],[1,"relative","m-3","flex-1","max-w-[78%]","bg-slate-900","border","border-slate-700","rounded-xl","shadow-2xl","flex","flex-col","overflow-hidden"],[1,"flex","items-center","gap-2","px-4","py-2.5","border-b","border-slate-800","text-sm"],[1,"text-slate-500"],[1,"flex-1"],["type","button",1,"text-slate-400","hover:text-slate-100",3,"click"],[1,"flex-1","min-h-0","relative"],[1,"absolute","inset-0","overflow-auto","p-4","text-xs"],[3,"nodes","edges","width","height"],["type","button",1,"hover:text-slate-200",3,"click"],[1,"text-slate-500","animate-pulse"],[1,"text-red-400"],[1,"font-mono","text-red-300","bg-red-500/10","border","border-red-500/30","rounded","p-3","mb-2","whitespace-pre-wrap","break-words"],[1,"font-mono","text-slate-300","bg-slate-950","border","border-slate-800","rounded","p-3","whitespace-pre-wrap","break-words"],[1,"text-slate-500","italic"],[3,"nodeClick","nodes","edges","width","height"]],template:function(e,n){e&1&&(d(0,"div",0)(1,"div",1),h("click",function(){return n.close.emit()}),o(),d(2,"div",2)(3,"div",3)(4,"span",4),P(5,rt,3,2,null,null,pe),o(),k(7,"span",5),d(8,"button",6),h("click",function(){return n.close.emit()}),l(9,"\u2715"),o()(),d(10,"div",7),C(11,pt,4,1,"div",8)(12,ct,1,4,"app-dag-graph",9),o()()()),e&2&&(a(5),H(n.breadcrumb),a(6),E(n.isLeaf?11:12))},dependencies:[A,$],encapsulation:2})};var mt=(i,t)=>t.id,gt=(i,t)=>t.key;function ht(i,t){if(i&1&&(d(0,"span",6),l(1),o()),i&2){let e=m();g("ngClass",e.statusClass(e.run.status)),a(),j(" ",e.statusIcon(e.run.status)," ",e.run.status," ")}}function ft(i,t){i&1&&(d(0,"div",10),l(1,"Kh\xF4ng d\u1EF1ng \u0111\u01B0\u1EE3c s\u01A1 \u0111\u1ED3 ph\u1EE5 thu\u1ED9c \u2014 hi\u1EC3n th\u1ECB theo th\u1EE9 t\u1EF1 ch\u1EA1y."),o())}function bt(i,t){if(i&1){let e=R();d(0,"app-node-inspector",23),h("close",function(){M(e);let r=m();return T(r.closeInspector())}),o()}if(i&2){let e=m();g("runId",e.run.runId)("nodes",e.dagInputNodes)("statusOf",e.statusOf)("rootKey",e.inspectorKey)}}function vt(i,t){if(i&1&&(d(0,"div",24)(1,"div",25),k(2,"div",26),o()()),i&2){let e=t.$implicit,n=m();K("justify-end",e.role==="user"),a(),g("ngClass",e.role==="user"?"bg-indigo-500/15 text-indigo-100":"bg-slate-800 text-slate-200"),a(),g("innerHTML",n.render(e.content),Z)}}function _t(i,t){i&1&&(d(0,"div",16),l(1,"\u2014 phi\xEAn hi\u1EC7n t\u1EA1i \u2014"),o())}function xt(i,t){if(i&1&&(d(0,"div",27),l(1),o()),i&2){let e=m().$implicit;a(),j(" \u23F8 ",e.nodeId||"gate","",e.iteration!==void 0?" \xB7 iteration "+e.iteration:""," ")}}function yt(i,t){if(i&1&&(d(0,"div",24)(1,"div",25),C(2,xt,2,2,"div",27),k(3,"div",26),o()()),i&2){let e=t.$implicit,n=m();K("justify-end",e.role==="user"),a(),g("ngClass",e.role==="user"?"bg-indigo-500/15 text-indigo-100":"bg-slate-800 text-slate-200"),a(),E(e.role==="gate"?2:-1),a(),g("innerHTML",n.render(e.text),Z)}}function Ct(i,t){if(i&1&&(d(0,"div",19),l(1),o()),i&2){let e=m();a(),w(e.gate.errorMessage())}}var je=class i{route=S(we);api=S(B);sse=S(X);run;gate=new Y;feed=[];messages=[];draft="";runId="";sseSub;timerInterval;focusAnswerOnShow=!1;dagNodes=[];dagEdges=[];dagWidth=0;dagHeight=0;dagInputNodes=[];statusMap=new Map;ngOnInit(){this.runId=this.route.snapshot.paramMap.get("runId"),this.focusAnswerOnShow=this.route.snapshot.fragment==="answer",this.api.getRun(this.runId).subscribe(t=>{this.run=t,t.conversationId&&this.api.getConversationMessages(t.conversationId).subscribe({next:e=>{this.messages=e.messages},error:()=>{this.messages=[]}}),this.rebuildDag(),this.stopTimerIfFinished(),this.syncGateFromRun()}),this.sseSub=this.sse.connect(this.runId).subscribe(t=>{this.handleSseEvent(t)}),this.timerInterval=setInterval(()=>{},1e3)}ngOnDestroy(){this.sseSub?.unsubscribe(),this.timerInterval&&clearInterval(this.timerInterval)}inspectorKey=null;onNodeClick(t){this.inspectorKey=t}closeInspector(){this.inspectorKey=null}hierInput(){let t=this.run?.graph?.nodes;if(t&&t.length)return t.map(n=>({id:n.id,dependsOn:n.dependsOn}));let e=this.run?Object.keys(this.run.nodes):[];return e.map((n,r)=>({id:n,dependsOn:r===0?[]:[e[r-1]]}))}statusOf=t=>this.statusMap.get(t)??"pending";syncStatusMap(){if(this.run)for(let[t,e]of Object.entries(this.run.nodes))this.statusMap.has(t)||this.statusMap.set(t,e.status)}rebuildDag(){if(!this.run)return;this.syncStatusMap(),this.dagInputNodes=this.hierInput();let t=Q(this.dagInputNodes,this.statusOf,"");this.dagNodes=t.vms,this.dagEdges=t.edges,this.dagWidth=t.width,this.dagHeight=t.height}handleSseEvent(t){let e=t.data,n=e.nodeId;switch(t.type){case"run:state":{let r=e;this.run=se(oe({},r),{graph:r.graph??this.run?.graph,conversationId:r.conversationId??this.run?.conversationId}),this.rebuildDag(),this.stopTimerIfFinished(),this.syncGateFromRun();break}case"run:pause":this.run&&(this.run.status="paused"),this.gate.pauseReceived(e),this.noteGateInFeed(),this.maybeFocusAnswer();break;case"run:cancel":this.run&&(this.run.status="cancelled"),this.gate.runStateChanged("cancelled"),this.stopTimerIfFinished();break;case"node:start":this.updateNodeStatus(n,"running",void 0,{provider:e.provider,model:e.model});break;case"node:complete":this.updateNodeStatus(n,"completed",e.durationMs);break;case"node:skip":this.updateNodeStatus(n,"skipped");break;case"node:fail":this.updateNodeStatus(n,"failed");break;case"run:complete":this.run&&(this.run.status=e.success?"completed":"failed",this.gate.runStateChanged(this.run.status)),this.stopTimerIfFinished();break}}updateNodeStatus(t,e,n,r){this.statusMap.set(t,e),this.rebuildDag()}syncGateFromRun(){this.run&&(this.gate.runStateChanged(this.run.status,this.run),this.noteGateInFeed(),this.maybeFocusAnswer())}noteGateInFeed(){let t=this.gate.request();this.gate.visible()&&t&&(this.feed=Fe(this.feed,t))}sendAnswer(){if(!this.gate.visible()||this.gate.phase()==="submitting")return;let t=this.draft.trim(),e=this.gate.submitAction();if(e==="resume"&&!t)return;this.gate.submitStarted(),(e==="resume"?this.api.resumeRun(this.runId,t):this.api.approveRun(this.runId,t||void 0)).subscribe({next:()=>{this.feed=ie(this.feed,e==="resume"?"answer":"approve",t),this.draft="",this.gate.submitSucceeded()},error:r=>this.gate.submitFailed(r?.error?.error??"Failed to send the answer.")})}rejectGate(){if(!this.gate.visible()||this.gate.phase()==="submitting")return;let t=prompt("Rejection reason","Rejected by operator");t!==null&&(this.gate.submitStarted(),this.api.rejectRun(this.runId,t||void 0).subscribe({next:()=>{this.feed=ie(this.feed,"reject",t),this.gate.submitSucceeded()},error:e=>this.gate.submitFailed(e?.error?.error??"Failed to reject the run.")}))}render(t){return Ae(t)}maybeFocusAnswer(){!this.focusAnswerOnShow||!this.gate.visible()||(this.focusAnswerOnShow=!1,setTimeout(()=>{document.getElementById("gate-answer-panel")?.scrollIntoView({behavior:"smooth",block:"center"}),document.getElementById("gate-answer-input")?.focus()}))}stopTimerIfFinished(){!this.run||!ne(this.run.status)||(Te(this.run),this.timerInterval&&(clearInterval(this.timerInterval),this.timerInterval=void 0))}statusClass(t){switch(t){case"completed":return"bg-green-500/10 text-green-400";case"failed":return"bg-red-500/10 text-red-400";case"running":return"bg-blue-500/10 text-blue-400";default:return"bg-slate-700 text-slate-400"}}statusIcon(t){switch(t){case"completed":return"\u2713";case"failed":return"\u2717";case"running":return"\u25CF";default:return"\u25CB"}}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=F({type:i,selectors:[["app-run-execution"]],decls:35,vars:17,consts:[[1,"flex","flex-col","h-[calc(100vh-6rem)]"],[1,"flex","items-center","mb-3","gap-2","text-sm","shrink-0"],["routerLink","/",1,"text-slate-500","hover:text-slate-300"],[1,"text-slate-600"],[1,"text-slate-300"],[1,"font-mono","text-slate-100"],[1,"text-xs","px-2","py-0.5","rounded","ml-2",3,"ngClass"],[1,"flex-1","flex","min-h-0","gap-3"],[1,"flex-[1.6]","min-w-0","border","border-slate-800","rounded-lg","overflow-hidden","relative"],[3,"nodeClick","nodes","edges","width","height"],[1,"absolute","bottom-2","left-2","text-[10px]","text-slate-500"],[3,"runId","nodes","statusOf","rootKey"],[1,"flex-1","min-w-0","flex","flex-col","border","border-slate-800","rounded-lg","overflow-hidden"],[1,"px-3","py-2","border-b","border-slate-800","text-sm","text-slate-200","shrink-0"],[1,"flex-1","overflow-auto","p-3","space-y-2"],[1,"flex",3,"justify-end"],[1,"text-[10px]","text-slate-600","text-center"],["id","gate-answer-panel",1,"border-t","border-slate-800","p-3","shrink-0","bg-slate-900/40"],["id","gate-answer-input","rows","2",1,"w-full","rounded","border","border-slate-700","bg-slate-950","p-2","text-sm","text-slate-100","focus:border-amber-500","focus:outline-none",3,"ngModelChange","ngModel","disabled","placeholder"],[1,"text-xs","text-red-400","mt-1"],[1,"flex","gap-2","mt-2"],["type","button",1,"rounded","bg-amber-500","px-3","py-1.5","text-sm","font-semibold","text-slate-950","hover:bg-amber-400","disabled:opacity-40","disabled:cursor-not-allowed",3,"click","disabled"],["type","button",1,"rounded","border","border-red-500/50","px-3","py-1.5","text-sm","text-red-300","hover:bg-red-500/10","disabled:opacity-40",3,"click","disabled"],[3,"close","runId","nodes","statusOf","rootKey"],[1,"flex"],[1,"max-w-[90%]","rounded-lg","px-3","py-2","text-sm",3,"ngClass"],[3,"innerHTML"],[1,"text-[10px]","uppercase","tracking-wide","text-amber-400","mb-1"]],template:function(e,n){e&1&&(d(0,"div",0)(1,"div",1)(2,"a",2),l(3,"Dashboard"),o(),d(4,"span",3),l(5,"\u203A"),o(),d(6,"span",4),l(7),o(),d(8,"span",3),l(9,"\u203A"),o(),d(10,"span",5),l(11),o(),C(12,ht,2,3,"span",6),o(),d(13,"div",7)(14,"div",8)(15,"app-dag-graph",9),h("nodeClick",function(s){return n.onNodeClick(s)}),o(),C(16,ft,2,0,"div",10),C(17,bt,1,4,"app-node-inspector",11),o(),d(18,"div",12)(19,"div",13),l(20,"\u{1F4AC} H\u1ED9i tho\u1EA1i"),o(),d(21,"div",14),P(22,vt,3,4,"div",15,mt),C(24,_t,2,0,"div",16),P(25,yt,4,5,"div",15,gt),o(),d(27,"div",17)(28,"textarea",18),be("ngModelChange",function(s){return fe(n.draft,s)||(n.draft=s),s}),o(),C(29,Ct,2,1,"div",19),d(30,"div",20)(31,"button",21),h("click",function(){return n.sendAnswer()}),l(32),o(),d(33,"button",22),h("click",function(){return n.rejectGate()}),l(34," T\u1EEB ch\u1ED1i "),o()()()()()()),e&2&&(a(7),w(n.run==null?null:n.run.workflow),a(4),w(n.run==null?null:n.run.runId),a(),E(n.run?12:-1),a(3),g("nodes",n.dagNodes)("edges",n.dagEdges)("width",n.dagWidth)("height",n.dagHeight),a(),E(!(n.run==null||n.run.graph==null||n.run.graph.nodes==null)&&n.run.graph.nodes.length?-1:16),a(),E(n.inspectorKey?17:-1),a(5),H(n.messages),a(2),E(n.messages.length&&n.feed.length?24:-1),a(),H(n.feed),a(3),he("ngModel",n.draft),g("disabled",n.gate.phase()==="submitting")("placeholder",n.gate.visible()?n.gate.submitAction()==="resume"?"Nh\u1EADp c\xE2u tr\u1EA3 l\u1EDDi\u2026":"Ph\u1EA3n h\u1ED3i (tu\u1EF3 ch\u1ECDn)\u2026":"Ch\u1EC9 tr\u1EA3 l\u1EDDi \u0111\u01B0\u1EE3c khi run \u0111ang t\u1EA1m d\u1EEBng."),a(),E(n.gate.errorMessage()?29:-1),a(2),g("disabled",!n.gate.visible()||n.gate.phase()==="submitting"||n.gate.submitAction()==="resume"&&!n.draft.trim()),a(),q(" ",n.gate.phase()==="submitting"?"\u0110ang g\u1EEDi\u2026":"G\u1EEDi"," "),a(),g("disabled",!n.gate.visible()||n.gate.phase()==="submitting"))},dependencies:[A,xe,Ne,Se,De,ke,Ie,$,J],encapsulation:2})};export{je as RunExecutionComponent};
|
|
1
|
+
import{b as we,e as Ie}from"./chunk-N3FOQ3O5.js";import{a as Se,b as De,e as ke,j as Ne,k as B}from"./chunk-7ELOO4IC.js";import{$ as z,Ba as F,Fa as ee,J as de,Ka as D,Kb as xe,La as C,Lb as ye,Ma as E,Mb as Ce,Na as pe,O as S,Oa as P,Pa as H,Pb as Ee,Qa as g,Qb as A,Ra as d,Sa as o,T as M,Ta as k,U as T,V as G,Wb as Me,Xa as R,Ya as h,Za as m,a as oe,aa as ue,b as se,bb as ce,cb as me,db as ge,ea as le,f as ae,gb as K,ib as l,jb as w,kb as q,lb as j,mb as he,nb as fe,oa as Z,ob as be,qa as a,sb as ve,tb as _e}from"./chunk-4R37VVI4.js";var X=class i{zone=S(ue);projectService=S(Me);connect(t){return new ae(e=>{let n=this.projectService.currentId,r=n?`?project=${encodeURIComponent(n)}`:"",s=new EventSource(`/api/runs/${t}/events${r}`),_=["node:start","node:complete","node:skip","node:fail","run:complete","run:state","run:pause","run:cancel"];for(let p of _)s.addEventListener(p,u=>{this.zone.run(()=>{e.next({type:p,data:JSON.parse(u.data)})})});return s.onerror=()=>{this.zone.run(()=>{e.complete()}),s.close()},()=>{s.close()}})}static \u0275fac=function(e){return new(e||i)};static \u0275prov=de({token:i,factory:i.\u0275fac,providedIn:"root"})};var qe=new Set(["completed","failed","cancelled"]);function ne(i){return i!==void 0&&qe.has(i)}function Te(i,t=new Date().toISOString()){ne(i.status)&&!i.completedAt&&(i.completedAt=t)}var Be="Approval required",Xe="Run paused \u2014 input required to continue.";function W(i){return`${i.nodeId}\0${i.iteration??""}\0${i.message}`}function Re(i){let t=Oe(i);if(t)return t;let e=i.approval;if(e&&typeof e=="object")return Oe(e)}function Oe(i){let t=V(i.approvalNodeId)??V(i.nodeId);if(!t)return;let e=V(i.approvalMessage)??V(i.message),n=V(i.approvalType)??V(i.type),r=i.iteration;return{nodeId:t,message:e||Be,type:n==="interactive_loop"?"interactive_loop":"approval",iteration:typeof r=="number"?r:void 0}}function V(i){return typeof i=="string"&&i!==""?i:void 0}var Y=class{current;state="hidden";error;answeredKey;pauseReceived(t){this.current=Re(t)??Ge(),this.state="ready",this.error=void 0}runStateChanged(t,e){if(t!=="paused"){this.current=void 0,this.state="hidden",this.error=void 0,this.answeredKey=void 0;return}if(this.state==="submitting")return;let n=e?Re(e):void 0,r=n?W(n):void 0;r!==void 0&&r===this.answeredKey||this.current&&r!==void 0&&r===W(this.current)||this.current&&n===void 0||(this.current=n??Ge(),this.state="ready",this.error=void 0)}submitStarted(){this.state!=="hidden"&&(this.state="submitting",this.error=void 0)}submitFailed(t){this.state!=="hidden"&&(this.state="error",this.error=t)}submitSucceeded(){this.current&&(this.answeredKey=W(this.current)),this.current=void 0,this.state="hidden",this.error=void 0}visible(){return this.state!=="hidden"}phase(){return this.state}request(){return this.current}errorMessage(){return this.error}submitAction(){return this.current?.type==="interactive_loop"?"resume":"approve"}};function Ge(){return{nodeId:"",message:Xe,type:"approval"}}function Fe(i,t,e=new Date().toISOString()){let n=`gate:${W(t)}`;return i.some(r=>r.key===n)?i:[...i,{key:n,role:"gate",text:t.message,at:e,nodeId:t.nodeId,iteration:t.iteration}]}function ie(i,t,e,n=new Date().toISOString()){return[...i,{key:`user:${i.length}:${n}`,role:"user",kind:t,text:Ye(t,e),at:n}]}function Ye(i,t){let e=t.trim();switch(i){case"answer":return e;case"approve":return e?`Approved: ${e}`:"Approved";case"reject":return e?`Rejected: ${e}`:"Rejected"}}function Ae(i){return Ue(i).split(/`([^`]*)`/).map((n,r)=>r%2===1?`<code>${n}</code>`:n.replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>")).join("").replace(/\n/g,"<br>")}function Ue(i){return i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Ve(i){let t=new Map(i.map(c=>[c.key,c])),e=new Map,n=new Set,r=c=>{let b=e.get(c);if(b!==void 0)return b;if(n.has(c))return 0;n.add(c);let N=(t.get(c)?.dependsOn??[]).filter(y=>t.has(y)),x=N.length===0?0:Math.max(...N.map(r))+1;return n.delete(c),e.set(c,x),x};for(let c of i)r(c.key);let s=new Map;for(let c of i){let b=e.get(c.key);(s.get(b)??s.set(b,[]).get(b)).push(c.key)}let _=196,p=84,u=[...s.keys()].sort((c,b)=>c-b),f=new Map;for(let c of u){let b=s.get(c);if(c===0){b.forEach((x,y)=>f.set(x,y));continue}let N=x=>{let y=(t.get(x)?.dependsOn??[]).filter(L=>f.has(L));return y.length===0?f.get(x)??0:y.reduce((L,ze)=>L+f.get(ze),0)/y.length};b.sort((x,y)=>N(x)-N(y)),b.forEach((x,y)=>f.set(x,y))}let I=Math.max(1,...u.map(c=>s.get(c).length))*_,O=new Map;for(let c of u){let b=s.get(c),N=b.length*_,x=(I-N)/2;b.forEach((y,L)=>O.set(y,{x:x+L*_,y:c*p}))}let We=((u.length?u[u.length-1]:0)+1)*p;return{positions:O,layerOf:e,width:I,height:We}}var Je=["host"];function Ze(i,t){if(i&1&&(G(),k(0,"path",9)),i&2){let e=t.$implicit;D("d",e)}}function et(i,t){if(i&1&&(G(),d(0,"text",16),l(1),o()),i&2){let e=m().$implicit,n=m();D("x",n.NODE_W-12)("y",n.NODE_H/2+5),a(),j("",e.progress.done,"/",e.progress.total)}}function tt(i,t){if(i&1&&(G(),d(0,"text",17),l(1,"\u29C9"),o()),i&2){let e=m(2);D("x",e.NODE_W-12)("y",14)}}function nt(i,t){if(i&1){let e=R();G(),d(0,"g",10),h("click",function(){let r=M(e).$implicit,s=m();return T(s.nodeClick.emit(r.key))}),k(1,"rect",11),d(2,"text",12),l(3),o(),d(4,"text",13),l(5),o(),ee(6,et,2,4,"text",14)(7,tt,2,2,"text",15),o()}if(i&2){let e=t.$implicit,n=m();D("transform","translate("+e.x+","+e.y+")"),a(),K("dag-pulse",e.status==="running"),D("width",n.NODE_W)("height",n.NODE_H)("fill",n.fillFor(e.status))("stroke",n.strokeFor(e.status)),a(),D("y",n.NODE_H/2+5)("fill",n.strokeFor(e.status)),a(),w(n.icon(e.status)),a(),D("y",n.NODE_H/2+5),a(),w(n.clip(e.label)),a(),g("ngIf",e.progress),a(),g("ngIf",e.isGroup)}}var $=class i{NODE_W=168;NODE_H=44;nodes=[];edges=[];width=0;height=0;nodeClick=new z;hostRef;scale=1;panX=16;panY=40;dragging=!1;lastX=0;lastY=0;get edgePaths(){let t=new Map(this.nodes.map(n=>[n.key,n])),e=[];for(let n of this.edges){let r=t.get(n.from),s=t.get(n.to);if(!r||!s)continue;let _=r.x+168/2,p=r.y+44,u=s.x+168/2,f=s.y,v=(p+f)/2;e.push(`M${_} ${p} C${_} ${v}, ${u} ${v}, ${u} ${f}`)}return e}onWheel(t){t.preventDefault(),this.zoomBy(t.deltaY<0?1.1:.9)}zoomBy(t,e){e?.stopPropagation(),this.scale=Math.min(2.5,Math.max(.2,this.scale*t))}onDown(t){this.dragging=!0,this.lastX=t.clientX,this.lastY=t.clientY}onMove(t){this.dragging&&(this.panX+=t.clientX-this.lastX,this.panY+=t.clientY-this.lastY,this.lastX=t.clientX,this.lastY=t.clientY)}onUp(){this.dragging=!1}fit(){if(!this.width||!this.height){this.scale=1,this.panX=16,this.panY=40;return}let t=this.hostRef?.nativeElement,e=t?.clientWidth??600,n=t?.clientHeight??400;this.scale=Math.min(2,Math.max(.2,Math.min((e-32)/this.width,(n-48)/this.height))),this.panX=Math.max(16,(e-this.width*this.scale)/2),this.panY=44}clip(t){return t.length>20?t.slice(0,19)+"\u2026":t}icon(t){return{completed:"\u2713",running:"\u25CF",failed:"\u2717",skipped:"\u2298"}[t]??"\u25CB"}fillFor(t){return{completed:"rgba(34,197,94,.14)",running:"rgba(59,130,246,.16)",failed:"rgba(239,68,68,.14)"}[t]??"rgba(30,41,59,.9)"}strokeFor(t){return{completed:"#22c55e",running:"#3b82f6",failed:"#ef4444",skipped:"#64748b"}[t]??"#475569"}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=F({type:i,selectors:[["app-dag-graph"]],viewQuery:function(e,n){if(e&1&&ce(Je,5),e&2){let r;me(r=ge())&&(n.hostRef=r.first)}},inputs:{nodes:"nodes",edges:"edges",width:"width",height:"height"},outputs:{nodeClick:"nodeClick"},decls:16,vars:7,consts:[["host",""],[1,"relative","w-full","h-full","overflow-hidden","select-none","bg-slate-950/40",3,"wheel","mousedown","mousemove","mouseup","mouseleave"],[1,"absolute","top-2","left-2","z-10","flex","gap-1","items-center"],["type","button",1,"dag-btn",3,"click"],[1,"text-xs","text-slate-400","w-10","text-center","font-mono"],["type","button",1,"dag-btn","px-2","w-auto",3,"click"],[1,"absolute","inset-0","w-full","h-full"],["fill","none","stroke","#475569","stroke-width","2","opacity","0.8",4,"ngFor","ngForOf"],["class","cursor-pointer",3,"click",4,"ngFor","ngForOf"],["fill","none","stroke","#475569","stroke-width","2","opacity","0.8"],[1,"cursor-pointer",3,"click"],["rx","9","stroke-width","2"],["x","16","font-size","15"],["x","34","font-size","13","fill","#e2e8f0"],["text-anchor","end","font-size","10","fill","#94a3b8",4,"ngIf"],["text-anchor","end","font-size","11","fill","#94a3b8",4,"ngIf"],["text-anchor","end","font-size","10","fill","#94a3b8"],["text-anchor","end","font-size","11","fill","#94a3b8"]],template:function(e,n){e&1&&(d(0,"div",1,0),h("wheel",function(s){return n.onWheel(s)})("mousedown",function(s){return n.onDown(s)})("mousemove",function(s){return n.onMove(s)})("mouseup",function(){return n.onUp()})("mouseleave",function(){return n.onUp()}),d(2,"div",2)(3,"button",3),h("click",function(s){return n.zoomBy(.8,s)}),l(4,"\u2212"),o(),d(5,"span",4),l(6),ve(7,"number"),o(),d(8,"button",3),h("click",function(s){return n.zoomBy(1.25,s)}),l(9,"+"),o(),d(10,"button",5),h("click",function(){return n.fit()}),l(11,"fit"),o()(),G(),d(12,"svg",6)(13,"g"),ee(14,Ze,1,1,"path",7)(15,nt,8,14,"g",8),o()()()),e&2&&(a(6),q("",_e(7,4,n.scale*100,"1.0-0"),"%"),a(7),D("transform","translate("+n.panX+","+n.panY+") scale("+n.scale+")"),a(),g("ngForOf",n.edgePaths),a(),g("ngForOf",n.nodes))},dependencies:[A,ye,Ce,Ee],styles:[".dag-btn[_ngcontent-%COMP%]{width:24px;height:24px;border:1px solid #334155;border-radius:6px;background:#1e293b;color:#94a3b8;font-size:13px;line-height:1}.dag-btn[_ngcontent-%COMP%]:hover{color:#e2e8f0}.dag-pulse[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_dagpulse 1.3s ease-in-out infinite}@keyframes _ngcontent-%COMP%_dagpulse{0%,to{opacity:1}50%{opacity:.45}}"]})};function U(i,t=""){let e=t===""?"":t+".",n=i.filter(u=>t===""||u.id===t||u.id.startsWith(e)),r=new Map(i.map(u=>[u.id,u])),s=new Map;for(let u of n){let f=t===""?u.id:u.id.slice(e.length),v=f.split(".")[0];if(!v)continue;let I=s.get(v);I||(I={key:e+v,label:v,leafIds:[],deeper:!1},s.set(v,I)),I.leafIds.push(u.id),f.includes(".")&&(I.deeper=!0)}let _=u=>{if(t!==""&&u!==t&&!u.startsWith(e))return;let v=(t===""?u:u.slice(e.length)).split(".")[0];return s.has(v)?e+v:void 0},p=[];for(let u of s.values()){let f=new Set;for(let v of u.leafIds)for(let I of r.get(v)?.dependsOn??[]){let O=_(I);O&&O!==u.key&&f.add(O)}p.push({key:u.key,label:u.label,isGroup:u.deeper,leafIds:u.leafIds,dependsOn:[...f]})}return p}var Pe=new Set(["completed","skipped"]);function He(i,t){let e=i.map(t);return e.some(n=>n==="failed")?"failed":e.some(n=>n==="running")?"running":e.length>0&&e.every(n=>n==="skipped")?"skipped":e.length>0&&e.every(n=>Pe.has(n))?"completed":e.some(n=>n==="completed")?"running":"pending"}function Ke(i,t){let e=i.map(t);return{done:e.filter(n=>Pe.has(n)).length,total:e.length}}function Q(i,t,e=""){let n=U(i,e),r=Ve(n.map(p=>({key:p.key,dependsOn:p.dependsOn}))),s=n.map(p=>{let u=r.positions.get(p.key)??{x:0,y:0};return{key:p.key,label:p.label,isGroup:p.isGroup,status:p.isGroup?He(p.leafIds,t):t(p.leafIds[0]),progress:p.isGroup?Ke(p.leafIds,t):void 0,x:u.x,y:u.y}}),_=[];for(let p of n)for(let u of p.dependsOn)_.push({from:u,to:p.key});return{vms:s,edges:_,width:r.width,height:r.height}}function it(i,t){i&1&&(d(0,"span"),l(1," \u203A "),o())}function rt(i,t){if(i&1){let e=R();d(0,"button",10),h("click",function(){let r=M(e).$implicit,s=m();return T(s.goTo(r))}),l(1),o(),C(2,it,2,0,"span")}if(i&2){let e=t.$implicit,n=t.$index,r=t.$count,s=m();a(),w(s.label(e)),a(),E(n!==r-1?2:-1)}}function ot(i,t){i&1&&(d(0,"div",11),l(1,"\u0110ang t\u1EA3i output\u2026"),o())}function st(i,t){if(i&1&&(d(0,"div",12),l(1),o()),i&2){let e=m(2);a(),w(e.leafError)}}function at(i,t){if(i&1&&(d(0,"pre",13),l(1),o()),i&2){let e=m(3);a(),w(e.leafData==null?null:e.leafData.error)}}function dt(i,t){if(i&1&&(d(0,"pre",14),l(1),o()),i&2){let e=m(3);a(),w(e.leafData==null?null:e.leafData.output)}}function ut(i,t){i&1&&(d(0,"div",15),l(1,"Kh\xF4ng c\xF3 output"),o())}function lt(i,t){if(i&1&&(C(0,at,2,1,"pre",13),C(1,dt,2,1,"pre",14)(2,ut,2,0,"div",15)),i&2){let e=m(2);E(e.leafData!=null&&e.leafData.error?0:-1),a(),E(e.leafData!=null&&e.leafData.output?1:e.leafData!=null&&e.leafData.error?-1:2)}}function pt(i,t){if(i&1&&(d(0,"div",8),C(1,ot,2,0,"div",11)(2,st,2,1,"div",12)(3,lt,3,2),o()),i&2){let e,n=m();a(),E((e=n.leafPhase)==="loading"?1:e==="error"?2:e==="loaded"?3:-1)}}function ct(i,t){if(i&1){let e=R();d(0,"app-dag-graph",16),h("nodeClick",function(r){M(e);let s=m();return T(s.onSubClick(r))}),o()}if(i&2){let e=m();g("nodes",e.subNodes)("edges",e.subEdges)("width",e.subWidth)("height",e.subHeight)}}var J=class i{api=S(B);runId="";nodes=[];statusOf=()=>"pending";rootKey="";close=new z;breadcrumb=[];isLeaf=!1;subNodes=[];subEdges=[];subWidth=0;subHeight=0;leafPhase="loading";leafData;leafError="";ngOnChanges(t){if(t.rootKey){this.breadcrumb=[],this.goTo(this.rootKey);return}(t.nodes||t.statusOf)&&!this.isLeaf&&this.breadcrumb.length&&this.buildSubView(this.breadcrumb[this.breadcrumb.length-1])}goTo(t){let e=this.breadcrumb.indexOf(t);this.breadcrumb=e>=0?this.breadcrumb.slice(0,e+1):[...this.breadcrumb,t];let n=U(this.nodes,t);if(this.isLeaf=n.length===0,this.isLeaf){this.loadLeaf(t);return}this.buildSubView(t)}buildSubView(t){let e=Q(this.nodes,this.statusOf,t);this.subNodes=e.vms,this.subEdges=e.edges,this.subWidth=e.width,this.subHeight=e.height}onSubClick(t){this.goTo(t)}loadLeaf(t){this.leafPhase="loading",this.api.getNodeOutput(this.runId,t).subscribe({next:e=>{this.leafData={output:e.output,error:e.error},this.leafPhase="loaded"},error:e=>{this.leafError=e?.error?.error??"Kh\xF4ng t\u1EA3i \u0111\u01B0\u1EE3c output.",this.leafPhase="error"}})}label(t){return t.split(".").pop()??t}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=F({type:i,selectors:[["app-node-inspector"]],inputs:{runId:"runId",nodes:"nodes",statusOf:"statusOf",rootKey:"rootKey"},outputs:{close:"close"},features:[le],decls:13,vars:1,consts:[[1,"absolute","inset-0","z-20","flex"],[1,"absolute","inset-0","bg-black/40",3,"click"],[1,"relative","m-3","flex-1","max-w-[78%]","bg-slate-900","border","border-slate-700","rounded-xl","shadow-2xl","flex","flex-col","overflow-hidden"],[1,"flex","items-center","gap-2","px-4","py-2.5","border-b","border-slate-800","text-sm"],[1,"text-slate-500"],[1,"flex-1"],["type","button",1,"text-slate-400","hover:text-slate-100",3,"click"],[1,"flex-1","min-h-0","relative"],[1,"absolute","inset-0","overflow-auto","p-4","text-xs"],[3,"nodes","edges","width","height"],["type","button",1,"hover:text-slate-200",3,"click"],[1,"text-slate-500","animate-pulse"],[1,"text-red-400"],[1,"font-mono","text-red-300","bg-red-500/10","border","border-red-500/30","rounded","p-3","mb-2","whitespace-pre-wrap","break-words"],[1,"font-mono","text-slate-300","bg-slate-950","border","border-slate-800","rounded","p-3","whitespace-pre-wrap","break-words"],[1,"text-slate-500","italic"],[3,"nodeClick","nodes","edges","width","height"]],template:function(e,n){e&1&&(d(0,"div",0)(1,"div",1),h("click",function(){return n.close.emit()}),o(),d(2,"div",2)(3,"div",3)(4,"span",4),P(5,rt,3,2,null,null,pe),o(),k(7,"span",5),d(8,"button",6),h("click",function(){return n.close.emit()}),l(9,"\u2715"),o()(),d(10,"div",7),C(11,pt,4,1,"div",8)(12,ct,1,4,"app-dag-graph",9),o()()()),e&2&&(a(5),H(n.breadcrumb),a(6),E(n.isLeaf?11:12))},dependencies:[A,$],encapsulation:2})};var mt=(i,t)=>t.id,gt=(i,t)=>t.key;function ht(i,t){if(i&1&&(d(0,"span",6),l(1),o()),i&2){let e=m();g("ngClass",e.statusClass(e.run.status)),a(),j(" ",e.statusIcon(e.run.status)," ",e.run.status," ")}}function ft(i,t){i&1&&(d(0,"div",10),l(1,"Kh\xF4ng d\u1EF1ng \u0111\u01B0\u1EE3c s\u01A1 \u0111\u1ED3 ph\u1EE5 thu\u1ED9c \u2014 hi\u1EC3n th\u1ECB theo th\u1EE9 t\u1EF1 ch\u1EA1y."),o())}function bt(i,t){if(i&1){let e=R();d(0,"app-node-inspector",23),h("close",function(){M(e);let r=m();return T(r.closeInspector())}),o()}if(i&2){let e=m();g("runId",e.run.runId)("nodes",e.dagInputNodes)("statusOf",e.statusOf)("rootKey",e.inspectorKey)}}function vt(i,t){if(i&1&&(d(0,"div",24)(1,"div",25),k(2,"div",26),o()()),i&2){let e=t.$implicit,n=m();K("justify-end",e.role==="user"),a(),g("ngClass",e.role==="user"?"bg-indigo-500/15 text-indigo-100":"bg-slate-800 text-slate-200"),a(),g("innerHTML",n.render(e.content),Z)}}function _t(i,t){i&1&&(d(0,"div",16),l(1,"\u2014 phi\xEAn hi\u1EC7n t\u1EA1i \u2014"),o())}function xt(i,t){if(i&1&&(d(0,"div",27),l(1),o()),i&2){let e=m().$implicit;a(),j(" \u23F8 ",e.nodeId||"gate","",e.iteration!==void 0?" \xB7 iteration "+e.iteration:""," ")}}function yt(i,t){if(i&1&&(d(0,"div",24)(1,"div",25),C(2,xt,2,2,"div",27),k(3,"div",26),o()()),i&2){let e=t.$implicit,n=m();K("justify-end",e.role==="user"),a(),g("ngClass",e.role==="user"?"bg-indigo-500/15 text-indigo-100":"bg-slate-800 text-slate-200"),a(),E(e.role==="gate"?2:-1),a(),g("innerHTML",n.render(e.text),Z)}}function Ct(i,t){if(i&1&&(d(0,"div",19),l(1),o()),i&2){let e=m();a(),w(e.gate.errorMessage())}}var je=class i{route=S(we);api=S(B);sse=S(X);run;gate=new Y;feed=[];messages=[];draft="";runId="";sseSub;timerInterval;focusAnswerOnShow=!1;dagNodes=[];dagEdges=[];dagWidth=0;dagHeight=0;dagInputNodes=[];statusMap=new Map;ngOnInit(){this.runId=this.route.snapshot.paramMap.get("runId"),this.focusAnswerOnShow=this.route.snapshot.fragment==="answer",this.api.getRun(this.runId).subscribe(t=>{this.run=t,t.conversationId&&this.api.getConversationMessages(t.conversationId).subscribe({next:e=>{this.messages=e.messages},error:()=>{this.messages=[]}}),this.rebuildDag(),this.stopTimerIfFinished(),this.syncGateFromRun()}),this.sseSub=this.sse.connect(this.runId).subscribe(t=>{this.handleSseEvent(t)}),this.timerInterval=setInterval(()=>{},1e3)}ngOnDestroy(){this.sseSub?.unsubscribe(),this.timerInterval&&clearInterval(this.timerInterval)}inspectorKey=null;onNodeClick(t){this.inspectorKey=t}closeInspector(){this.inspectorKey=null}hierInput(){let t=this.run?.graph?.nodes;if(t&&t.length)return t.map(n=>({id:n.id,dependsOn:n.dependsOn}));let e=this.run?Object.keys(this.run.nodes):[];return e.map((n,r)=>({id:n,dependsOn:r===0?[]:[e[r-1]]}))}statusOf=t=>this.statusMap.get(t)??"pending";syncStatusMap(){if(this.run)for(let[t,e]of Object.entries(this.run.nodes))this.statusMap.has(t)||this.statusMap.set(t,e.status)}rebuildDag(){if(!this.run)return;this.syncStatusMap(),this.dagInputNodes=this.hierInput();let t=Q(this.dagInputNodes,this.statusOf,"");this.dagNodes=t.vms,this.dagEdges=t.edges,this.dagWidth=t.width,this.dagHeight=t.height}handleSseEvent(t){let e=t.data,n=e.nodeId;switch(t.type){case"run:state":{let r=e;this.run=se(oe({},r),{graph:r.graph??this.run?.graph,conversationId:r.conversationId??this.run?.conversationId}),this.rebuildDag(),this.stopTimerIfFinished(),this.syncGateFromRun();break}case"run:pause":this.run&&(this.run.status="paused"),this.gate.pauseReceived(e),this.noteGateInFeed(),this.maybeFocusAnswer();break;case"run:cancel":this.run&&(this.run.status="cancelled"),this.gate.runStateChanged("cancelled"),this.stopTimerIfFinished();break;case"node:start":this.updateNodeStatus(n,"running",void 0,{provider:e.provider,model:e.model});break;case"node:complete":this.updateNodeStatus(n,"completed",e.durationMs);break;case"node:skip":this.updateNodeStatus(n,"skipped");break;case"node:fail":this.updateNodeStatus(n,"failed");break;case"run:complete":this.run&&(this.run.status=e.success?"completed":"failed",this.gate.runStateChanged(this.run.status)),this.stopTimerIfFinished();break}}updateNodeStatus(t,e,n,r){this.statusMap.set(t,e),this.rebuildDag()}syncGateFromRun(){this.run&&(this.gate.runStateChanged(this.run.status,this.run),this.noteGateInFeed(),this.maybeFocusAnswer())}noteGateInFeed(){let t=this.gate.request();this.gate.visible()&&t&&(this.feed=Fe(this.feed,t))}sendAnswer(){if(!this.gate.visible()||this.gate.phase()==="submitting")return;let t=this.draft.trim(),e=this.gate.submitAction();if(e==="resume"&&!t)return;this.gate.submitStarted(),(e==="resume"?this.api.resumeRun(this.runId,t):this.api.approveRun(this.runId,t||void 0)).subscribe({next:()=>{this.feed=ie(this.feed,e==="resume"?"answer":"approve",t),this.draft="",this.gate.submitSucceeded()},error:r=>this.gate.submitFailed(r?.error?.error??"Failed to send the answer.")})}rejectGate(){if(!this.gate.visible()||this.gate.phase()==="submitting")return;let t=prompt("Rejection reason","Rejected by operator");t!==null&&(this.gate.submitStarted(),this.api.rejectRun(this.runId,t||void 0).subscribe({next:()=>{this.feed=ie(this.feed,"reject",t),this.gate.submitSucceeded()},error:e=>this.gate.submitFailed(e?.error?.error??"Failed to reject the run.")}))}render(t){return Ae(t)}maybeFocusAnswer(){!this.focusAnswerOnShow||!this.gate.visible()||(this.focusAnswerOnShow=!1,setTimeout(()=>{document.getElementById("gate-answer-panel")?.scrollIntoView({behavior:"smooth",block:"center"}),document.getElementById("gate-answer-input")?.focus()}))}stopTimerIfFinished(){!this.run||!ne(this.run.status)||(Te(this.run),this.timerInterval&&(clearInterval(this.timerInterval),this.timerInterval=void 0))}statusClass(t){switch(t){case"completed":return"bg-green-500/10 text-green-400";case"failed":return"bg-red-500/10 text-red-400";case"running":return"bg-blue-500/10 text-blue-400";default:return"bg-slate-700 text-slate-400"}}statusIcon(t){switch(t){case"completed":return"\u2713";case"failed":return"\u2717";case"running":return"\u25CF";default:return"\u25CB"}}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=F({type:i,selectors:[["app-run-execution"]],decls:35,vars:17,consts:[[1,"flex","flex-col","h-[calc(100vh-6rem)]"],[1,"flex","items-center","mb-3","gap-2","text-sm","shrink-0"],["routerLink","/",1,"text-slate-500","hover:text-slate-300"],[1,"text-slate-600"],[1,"text-slate-300"],[1,"font-mono","text-slate-100"],[1,"text-xs","px-2","py-0.5","rounded","ml-2",3,"ngClass"],[1,"flex-1","flex","min-h-0","gap-3"],[1,"flex-[1.6]","min-w-0","border","border-slate-800","rounded-lg","overflow-hidden","relative"],[3,"nodeClick","nodes","edges","width","height"],[1,"absolute","bottom-2","left-2","text-[10px]","text-slate-500"],[3,"runId","nodes","statusOf","rootKey"],[1,"flex-1","min-w-0","flex","flex-col","border","border-slate-800","rounded-lg","overflow-hidden"],[1,"px-3","py-2","border-b","border-slate-800","text-sm","text-slate-200","shrink-0"],[1,"flex-1","overflow-auto","p-3","space-y-2"],[1,"flex",3,"justify-end"],[1,"text-[10px]","text-slate-600","text-center"],["id","gate-answer-panel",1,"border-t","border-slate-800","p-3","shrink-0","bg-slate-900/40"],["id","gate-answer-input","rows","2",1,"w-full","rounded","border","border-slate-700","bg-slate-950","p-2","text-sm","text-slate-100","focus:border-amber-500","focus:outline-none",3,"ngModelChange","ngModel","disabled","placeholder"],[1,"text-xs","text-red-400","mt-1"],[1,"flex","gap-2","mt-2"],["type","button",1,"rounded","bg-amber-500","px-3","py-1.5","text-sm","font-semibold","text-slate-950","hover:bg-amber-400","disabled:opacity-40","disabled:cursor-not-allowed",3,"click","disabled"],["type","button",1,"rounded","border","border-red-500/50","px-3","py-1.5","text-sm","text-red-300","hover:bg-red-500/10","disabled:opacity-40",3,"click","disabled"],[3,"close","runId","nodes","statusOf","rootKey"],[1,"flex"],[1,"max-w-[90%]","rounded-lg","px-3","py-2","text-sm",3,"ngClass"],[3,"innerHTML"],[1,"text-[10px]","uppercase","tracking-wide","text-amber-400","mb-1"]],template:function(e,n){e&1&&(d(0,"div",0)(1,"div",1)(2,"a",2),l(3,"Dashboard"),o(),d(4,"span",3),l(5,"\u203A"),o(),d(6,"span",4),l(7),o(),d(8,"span",3),l(9,"\u203A"),o(),d(10,"span",5),l(11),o(),C(12,ht,2,3,"span",6),o(),d(13,"div",7)(14,"div",8)(15,"app-dag-graph",9),h("nodeClick",function(s){return n.onNodeClick(s)}),o(),C(16,ft,2,0,"div",10),C(17,bt,1,4,"app-node-inspector",11),o(),d(18,"div",12)(19,"div",13),l(20,"\u{1F4AC} H\u1ED9i tho\u1EA1i"),o(),d(21,"div",14),P(22,vt,3,4,"div",15,mt),C(24,_t,2,0,"div",16),P(25,yt,4,5,"div",15,gt),o(),d(27,"div",17)(28,"textarea",18),be("ngModelChange",function(s){return fe(n.draft,s)||(n.draft=s),s}),o(),C(29,Ct,2,1,"div",19),d(30,"div",20)(31,"button",21),h("click",function(){return n.sendAnswer()}),l(32),o(),d(33,"button",22),h("click",function(){return n.rejectGate()}),l(34," T\u1EEB ch\u1ED1i "),o()()()()()()),e&2&&(a(7),w(n.run==null?null:n.run.workflow),a(4),w(n.run==null?null:n.run.runId),a(),E(n.run?12:-1),a(3),g("nodes",n.dagNodes)("edges",n.dagEdges)("width",n.dagWidth)("height",n.dagHeight),a(),E(!(n.run==null||n.run.graph==null||n.run.graph.nodes==null)&&n.run.graph.nodes.length?-1:16),a(),E(n.inspectorKey?17:-1),a(5),H(n.messages),a(2),E(n.messages.length&&n.feed.length?24:-1),a(),H(n.feed),a(3),he("ngModel",n.draft),g("disabled",n.gate.phase()==="submitting")("placeholder",n.gate.visible()?n.gate.submitAction()==="resume"?"Nh\u1EADp c\xE2u tr\u1EA3 l\u1EDDi\u2026":"Ph\u1EA3n h\u1ED3i (tu\u1EF3 ch\u1ECDn)\u2026":"Ch\u1EC9 tr\u1EA3 l\u1EDDi \u0111\u01B0\u1EE3c khi run \u0111ang t\u1EA1m d\u1EEBng."),a(),E(n.gate.errorMessage()?29:-1),a(2),g("disabled",!n.gate.visible()||n.gate.phase()==="submitting"||n.gate.submitAction()==="resume"&&!n.draft.trim()),a(),q(" ",n.gate.phase()==="submitting"?"\u0110ang g\u1EEDi\u2026":"G\u1EEDi"," "),a(),g("disabled",!n.gate.visible()||n.gate.phase()==="submitting"))},dependencies:[A,xe,Ne,Se,De,ke,Ie,$,J],encapsulation:2})};export{je as RunExecutionComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as K,d as Q,e as U}from"./chunk-UN7U5NAR.js";import{a as X,b as Z,e as ee,g as te,h as ne,i as ie,j as oe,k as re}from"./chunk-LPQARKUF.js";import{$ as k,Ba as w,Fa as f,Jb as q,Ka as y,Kb as G,La as F,Ma as L,Mb as H,Na as A,O as C,Oa as S,Ob as J,Pa as E,Qa as s,Ra as n,Sa as t,T as g,Ta as B,U as x,Ua as j,Va as $,Xa as b,Ya as _,Za as p,eb as v,gb as i,hb as c,ib as u,jb as Y,k as N,kb as h,lb as M,mb as P,pb as I,qa as o,qb as D,rb as R,u as V,w as z}from"./chunk-WDOCF7IL.js";var me=(r,a)=>a.name;function ge(r,a){if(r&1&&(n(0,"option",9),i(1),t()),r&2){let e=a.$implicit;s("value",e.name)("disabled",!e.available),o(),Y(" ",e.name,"",e.available?"":" \u2014 not available on this machine"," ")}}function xe(r,a){if(r&1&&(n(0,"option",10),i(1),t()),r&2){let e=a.$implicit;s("value",e),o(),c(e)}}function _e(r,a){if(r&1){let e=b();n(0,"div",1),_("click",function(){g(e);let l=p();return x(l.close())}),n(1,"div",2),_("click",function(l){return l.stopPropagation()}),n(2,"h3",3),i(3),t(),n(4,"label",4),i(5,"Arguments"),t(),n(6,"input",5),P("ngModelChange",function(l){g(e);let m=p();return M(m.args,l)||(m.args=l),x(l)}),_("keydown.enter",function(){g(e);let l=p();return x(l.submit())}),t(),n(7,"div",6)(8,"div")(9,"label",4),i(10,"Provider"),t(),n(11,"select",7),P("ngModelChange",function(l){g(e);let m=p();return M(m.provider,l)||(m.provider=l),x(l)}),_("ngModelChange",function(){g(e);let l=p();return x(l.onProviderChange())}),n(12,"option",8),i(13,"(workflow default)"),t(),S(14,ge,2,4,"option",9,me),t()(),n(16,"div")(17,"label",4),i(18,"Model"),t(),n(19,"select",7),P("ngModelChange",function(l){g(e);let m=p();return M(m.model,l)||(m.model=l),x(l)}),n(20,"option",8),i(21,"(workflow default)"),t(),S(22,xe,2,2,"option",10,A),t()()(),n(24,"div",11)(25,"button",12),_("click",function(){g(e);let l=p();return x(l.close())}),i(26,"Cancel"),t(),n(27,"button",13),_("click",function(){g(e);let l=p();return x(l.submit())}),i(28,"Start \u25B6"),t()()()()}if(r&2){let e=p();o(3),u("Run ",e.workflowName),o(3),h("ngModel",e.args),o(5),h("ngModel",e.provider),o(3),E(e.providers),o(5),h("ngModel",e.model),o(3),E(e.modelOptions)}}var O=class r{visible=!1;workflowName="";providers=[];run=new k;closed=new k;args="";provider="";model="";get modelOptions(){return this.provider?this.providers.find(a=>a.name===this.provider)?.defaultModels??[]:[...new Set(this.providers.flatMap(a=>a.defaultModels))]}onProviderChange(){this.model&&!this.modelOptions.includes(this.model)&&(this.model="")}submit(){this.run.emit({args:this.args,provider:this.provider||void 0,model:this.model||void 0}),this.reset()}close(){this.visible=!1,this.reset(),this.closed.emit()}reset(){this.args="",this.provider="",this.model=""}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=w({type:r,selectors:[["app-run-dialog"]],inputs:{visible:"visible",workflowName:"workflowName",providers:"providers"},outputs:{run:"run",closed:"closed"},decls:1,vars:1,consts:[[1,"fixed","inset-0","bg-black/60","flex","items-center","justify-center","z-50"],[1,"fixed","inset-0","bg-black/60","flex","items-center","justify-center","z-50",3,"click"],[1,"bg-slate-800","rounded-lg","p-6","w-full","max-w-md","border","border-slate-700",3,"click"],[1,"text-lg","font-semibold","text-slate-100","mb-4"],[1,"block","text-sm","text-slate-400","mb-1"],["placeholder",'e.g. "fix #42"',1,"w-full","bg-slate-900","border","border-slate-600","rounded","px-3","py-2","text-slate-100","text-sm","focus:outline-none","focus:border-blue-500","mb-4",3,"ngModelChange","keydown.enter","ngModel"],[1,"grid","grid-cols-2","gap-3","mb-4"],[1,"w-full","bg-slate-900","border","border-slate-600","rounded","px-3","py-2","text-slate-100","text-sm","focus:outline-none","focus:border-blue-500",3,"ngModelChange","ngModel"],["value",""],[3,"value","disabled"],[3,"value"],[1,"flex","justify-end","gap-3"],[1,"px-4","py-2","text-sm","text-slate-400","hover:text-slate-200",3,"click"],[1,"px-4","py-2","text-sm","bg-blue-600","text-white","rounded","hover:bg-blue-500",3,"click"]],template:function(e,d){e&1&&F(0,_e,29,4,"div",0),e&2&&L(d.visible?0:-1)},dependencies:[oe,ne,ie,X,te,Z,ee],encapsulation:2})};function ae(r,a,e={}){let d=r.provider||a.provider||e.provider||"default",l=r.model||a.model||e.model||"";return{name:l?`${d}/${l}`:d,inherited:!r.provider&&!r.model}}var fe=r=>({edit:r}),ue=r=>["/runs",r];function be(r,a){if(r&1&&(n(0,"div",4),i(1),t()),r&2){let e=p();o(),c(e.error)}}function ve(r,a){r&1&&(n(0,"div",5),i(1,"Loading workflow definition..."),t())}function Ce(r,a){if(r&1&&(n(0,"span"),i(1),t()),r&2){let e=p(3);o(),c(e.runs.length)}}function we(r,a){if(r&1){let e=b();n(0,"button",24),_("click",function(){let l=g(e).$implicit,m=p(2);return x(m.tab=l.id)}),i(1),f(2,Ce,2,1,"span",3),t()}if(r&2){let e=a.$implicit,d=p(2);v("active",d.tab===e.id),o(),u(" ",e.label," "),o(),s("ngIf",e.id==="runs")}}function ye(r,a){if(r&1){let e=b();n(0,"button",30),_("click",function(){let l=g(e).$implicit,m=p(3);return x(m.selectedNode=l)}),n(1,"span",31),i(2),t(),n(3,"span",32),i(4),t(),n(5,"span",33)(6,"strong"),i(7),n(8,"span",34),i(9),t()(),n(10,"small"),i(11),t()(),n(12,"span",35),i(13),t()()}if(r&2){let e=a.$implicit,d=a.index,l=p(3);v("selected",(l.selectedNode==null?null:l.selectedNode.id)===e.id),o(2),c(d+1),o(),y("data-type",e.type),o(),c(l.typeLabel(e.type)),o(3),u("",e.id," "),o(),v("inherited",l.nodeProvider(e).inherited),o(),c(l.providerBadgeLabel(e)),o(2),c(e.content),o(2),c(e.dependsOn.length?"After "+e.dependsOn.join(", "):"Entry point")}}function he(r,a){if(r&1&&(n(0,"aside",36)(1,"div",37),i(2,"Node inspector"),t(),n(3,"h3"),i(4),t(),n(5,"span",38),i(6),t(),n(7,"dl")(8,"div")(9,"dt"),i(10,"Depends on"),t(),n(11,"dd"),i(12),t()(),n(13,"div")(14,"dt"),i(15,"Trigger"),t(),n(16,"dd"),i(17),t()(),n(18,"div")(19,"dt"),i(20,"Context"),t(),n(21,"dd"),i(22),t()(),n(23,"div")(24,"dt"),i(25,"Condition"),t(),n(26,"dd"),i(27),t()(),n(28,"div")(29,"dt"),i(30,"Provider"),t(),n(31,"dd"),i(32),t()(),n(33,"div")(34,"dt"),i(35,"Model"),t(),n(36,"dd"),i(37),t()()(),n(38,"label"),i(39,"Content"),t(),n(40,"pre"),i(41),t()()),r&2){let e=p(3);o(4),c(e.selectedNode.id),o(2),c(e.selectedNode.type),o(6),c(e.selectedNode.dependsOn.join(", ")||"None"),o(5),c(e.selectedNode.triggerRule),o(5),c(e.selectedNode.context),o(5),c(e.selectedNode.when||"Always"),o(5),c(e.selectedNode.provider||e.workflow.defaultProvider||"Default"),o(5),c(e.selectedNode.model||e.workflow.defaultModel||"Default"),o(4),c(e.selectedNode.content)}}function Me(r,a){if(r&1&&(n(0,"div",25)(1,"main",26)(2,"div",27)(3,"div")(4,"h2"),i(5,"Workflow steps"),t(),n(6,"p"),i(7,"Execution order and node configuration."),t()()(),f(8,ye,14,11,"button",28),t(),f(9,he,42,9,"aside",29),t()),r&2){let e=p(2);o(8),s("ngForOf",e.workflow.nodes),o(),s("ngIf",e.selectedNode)}}function Pe(r,a){if(r&1&&(n(0,"article")(1,"div")(2,"span",32),i(3),t(),n(4,"strong"),i(5),t()(),n(6,"span",34),i(7),t()()),r&2){let e=a.$implicit,d=p(4);o(2),y("data-type",e.type),o(),c(d.typeLabel(e.type)),o(2),c(e.id),o(),v("inherited",d.nodeProvider(e).inherited),o(),c(d.providerBadgeLabel(e))}}function Oe(r,a){if(r&1&&(n(0,"div",44)(1,"span",45),i(2),t(),f(3,Pe,8,6,"article",46),t()),r&2){let e=a.$implicit,d=a.index;o(2),u("Stage ",d+1),o(),s("ngForOf",e)}}function ke(r,a){if(r&1&&(n(0,"div",39)(1,"div",40)(2,"div")(3,"h2"),i(4,"DAG topology"),t(),n(5,"p"),i(6,"Dependencies flow from left to right."),t()(),n(7,"span"),i(8),t()(),n(9,"div",41)(10,"div",42),f(11,Oe,4,2,"div",43),t()()()),r&2){let e=p(2);o(8),u("",e.dagLayers.length," stages"),o(3),s("ngForOf",e.dagLayers)}}function Se(r,a){if(r&1){let e=b();n(0,"div",47)(1,"div",48)(2,"span"),i(3,"Read-only YAML definition"),t(),n(4,"button",24),_("click",function(){g(e);let l=p(2);return x(l.copyYaml())}),i(5),t()(),n(6,"pre"),i(7),t()()}if(r&2){let e=p(2);o(5),c(e.copied?"Copied":"Copy"),o(2),c(e.workflow.yaml)}}function Ee(r,a){r&1&&(n(0,"span",53),i(1,"history"),t())}function Ie(r,a){if(r&1&&(n(0,"a",54),i(1,"Open"),t()),r&2){let e=p().$implicit;s("routerLink",I(1,ue,e.runId))}}function De(r,a){if(r&1&&(n(0,"tr")(1,"td")(2,"code"),i(3),t()(),n(4,"td")(5,"span",50),i(6),t(),f(7,Ee,2,0,"span",51),t(),n(8,"td"),i(9),D(10,"date"),t(),n(11,"td"),i(12),D(13,"date"),t(),n(14,"td"),f(15,Ie,2,3,"a",52),t()()),r&2){let e=a.$implicit;o(3),c(e.runId),o(2),y("data-status",e.status),o(),c(e.status),o(),s("ngIf",e.source==="history"),o(2),c(R(10,7,e.startedAt,"medium")),o(3),c(e.completedAt?R(13,10,e.completedAt,"medium"):"In progress"),o(3),s("ngIf",e.source!=="history")}}function Re(r,a){r&1&&(n(0,"tr")(1,"td",55),i(2,"This workflow has not been run yet."),t()())}function We(r,a){if(r&1&&(n(0,"div",49)(1,"table")(2,"thead")(3,"tr")(4,"th"),i(5,"Run ID"),t(),n(6,"th"),i(7,"Status"),t(),n(8,"th"),i(9,"Started"),t(),n(10,"th"),i(11,"Completed"),t(),B(12,"th"),t()(),n(13,"tbody"),f(14,De,16,13,"tr",46)(15,Re,3,0,"tr",3),t()()()),r&2){let e=p(2);o(14),s("ngForOf",e.runs),o(),s("ngIf",!e.runs.length)}}function Te(r,a){if(r&1){let e=b();j(0),n(1,"nav",6)(2,"a",7),i(3,"Workflows"),t(),n(4,"span"),i(5,"/"),t(),n(6,"span"),i(7),t()(),n(8,"header",8)(9,"div",9),i(10,"Y"),t(),n(11,"div",10)(12,"span",11),i(13),t(),n(14,"h1"),i(15),t(),n(16,"p"),i(17),t()(),n(18,"div",12)(19,"a",13),i(20,"Edit"),t(),n(21,"button",14),_("click",function(){g(e);let l=p();return x(l.showRunDialog=!0)}),i(22,"Run workflow"),t()()(),n(23,"div",15)(24,"div")(25,"span"),i(26,"Nodes"),t(),n(27,"strong"),i(28),t()(),n(29,"div")(30,"span"),i(31,"Dependencies"),t(),n(32,"strong"),i(33),t()(),n(34,"div")(35,"span"),i(36,"Provider"),t(),n(37,"strong"),i(38),t()(),n(39,"div")(40,"span"),i(41,"Model"),t(),n(42,"strong"),i(43),t()(),n(44,"div")(45,"span"),i(46,"Runs"),t(),n(47,"strong"),i(48),t()()(),n(49,"div",16)(50,"span"),i(51,"Definition"),t(),n(52,"code"),i(53),t()(),n(54,"nav",17),f(55,we,3,4,"button",18),t(),f(56,Me,10,2,"div",19)(57,ke,12,2,"div",20)(58,Se,8,2,"div",21)(59,We,16,2,"div",22),n(60,"app-run-dialog",23),_("run",function(l){g(e);let m=p();return x(m.onStartRun(l))})("closed",function(){g(e);let l=p();return x(l.showRunDialog=!1)}),t(),$()}if(r&2){let e=p();o(7),c(e.workflow.id),o(6),c(e.workflow.id),o(2),c(e.workflow.name),o(2),c(e.workflow.description||"No description provided."),o(2),s("queryParams",I(19,fe,e.workflow.id)),o(9),c(e.workflow.nodeCount),o(5),c(e.dependencyCount),o(5),c(e.workflow.defaultProvider||"default"),o(5),c(e.workflow.defaultModel||"default"),o(5),c(e.runs.length),o(5),u(".vsaf/workflows/",e.workflow.file),o(2),s("ngForOf",e.tabs),o(),s("ngIf",e.tab==="overview"),o(),s("ngIf",e.tab==="dag"),o(),s("ngIf",e.tab==="yaml"),o(),s("ngIf",e.tab==="runs"),o(),s("visible",e.showRunDialog)("workflowName",e.workflow.id)("providers",e.providers)}}var le=class r{route=C(K);api=C(re);router=C(Q);workflow;runs=[];providers=[];selectedNode;tab="overview";showRunDialog=!1;loading=!0;error="";copied=!1;tabs=[{id:"overview",label:"Overview"},{id:"dag",label:"DAG"},{id:"yaml",label:"YAML"},{id:"runs",label:"Runs"}];ngOnInit(){let a=this.route.snapshot.queryParamMap.get("id");if(!a){this.loading=!1,this.error="Missing workflow id.";return}V({workflow:this.api.getWorkflow(a),runs:this.api.getRuns(),providers:this.api.getProviders().pipe(z(()=>N({providers:[]})))}).subscribe({next:e=>{this.workflow=e.workflow,this.selectedNode=e.workflow.nodes[0],this.runs=e.runs.filter(d=>d.workflow===a).reverse(),this.providers=e.providers.providers??[],this.loading=!1},error:e=>{this.loading=!1,this.error=e?.error?.error??"Failed to load workflow."}})}nodeProvider(a){return ae(a,{provider:this.workflow?.defaultProvider,model:this.workflow?.defaultModel})}providerBadgeLabel(a){let e=this.nodeProvider(a);return e.inherited?`\u2192 ${e.name}`:e.name}get dependencyCount(){return this.workflow?.nodes.reduce((a,e)=>a+e.dependsOn.length,0)??0}get dagLayers(){if(!this.workflow)return[];let a=new Map,e=(l,m=new Set)=>{if(a.has(l.id))return a.get(l.id);if(m.has(l.id)||!l.dependsOn.length)return 0;m.add(l.id);let W=1+Math.max(...l.dependsOn.map(de=>{let T=this.workflow.nodes.find(ce=>ce.id===de);return T?e(T,m):0}));return m.delete(l.id),a.set(l.id,W),W};for(let l of this.workflow.nodes)a.set(l.id,e(l));let d=[];for(let l of this.workflow.nodes)(d[a.get(l.id)??0]??=[]).push(l);return d}typeLabel(a){return a==="command"?"CMD":a==="prompt"?"AI":"SH"}onStartRun(a){this.showRunDialog=!1,this.api.startRun(this.workflow.id,a.args,{provider:a.provider,model:a.model}).subscribe(e=>this.router.navigate(["/runs",e.runId]))}copyYaml(){this.workflow&&navigator.clipboard.writeText(this.workflow.yaml).then(()=>{this.copied=!0,setTimeout(()=>this.copied=!1,1500)})}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=w({type:r,selectors:[["app-workflow-detail"]],decls:4,vars:3,consts:[[1,"detail-page"],["class","state error",4,"ngIf"],["class","state",4,"ngIf"],[4,"ngIf"],[1,"state","error"],[1,"state"],[1,"breadcrumb"],["routerLink","/workflows"],[1,"hero"],[1,"workflow-icon"],[1,"hero-copy"],[1,"namespace"],[1,"hero-actions"],["routerLink","/workflows/builder",1,"button","secondary",3,"queryParams"],["type","button",1,"button","primary",3,"click"],[1,"stats"],[1,"file-strip"],["aria-label","Workflow detail sections",1,"tabs"],["type","button",3,"active","click",4,"ngFor","ngForOf"],["class","tab-content",4,"ngIf"],["class","dag-panel",4,"ngIf"],["class","yaml-panel",4,"ngIf"],["class","runs-panel",4,"ngIf"],[3,"run","closed","visible","workflowName","providers"],["type","button",3,"click"],[1,"tab-content"],[1,"node-list"],[1,"section-heading"],["type","button","class","node-row",3,"selected","click",4,"ngFor","ngForOf"],["class","inspector",4,"ngIf"],["type","button",1,"node-row",3,"click"],[1,"step-index"],[1,"type-icon"],[1,"node-main"],[1,"provider-badge"],[1,"dependency"],[1,"inspector"],[1,"inspector-title"],[1,"badge"],[1,"dag-panel"],[1,"dag-toolbar"],[1,"dag-scroll"],[1,"dag-canvas"],["class","dag-layer",4,"ngFor","ngForOf"],[1,"dag-layer"],[1,"layer-label"],[4,"ngFor","ngForOf"],[1,"yaml-panel"],[1,"yaml-toolbar"],[1,"runs-panel"],[1,"status"],["class","history-tag",4,"ngIf"],[3,"routerLink",4,"ngIf"],[1,"history-tag"],[3,"routerLink"],["colspan","5",1,"empty"]],template:function(e,d){e&1&&(n(0,"section",0),f(1,be,2,1,"div",1)(2,ve,2,0,"div",2)(3,Te,61,21,"ng-container",3),t()),e&2&&(o(),s("ngIf",d.error),o(),s("ngIf",d.loading),o(),s("ngIf",d.workflow))},dependencies:[J,q,G,U,O,H],styles:["[_nghost-%COMP%]{display:block;min-height:calc(100vh - 56px);background:#101114;color:#e7e7ea}.detail-page[_ngcontent-%COMP%]{max-width:1320px;margin:auto;padding:24px 28px 60px}.breadcrumb[_ngcontent-%COMP%]{display:flex;gap:7px;color:#737a87;font-size:12px;margin-bottom:18px}.breadcrumb[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:#9ca3af;text-decoration:none}.hero[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:15px}.workflow-icon[_ngcontent-%COMP%]{display:grid;place-items:center;flex:0 0 46px;height:52px;border:1px solid #454957;border-radius:6px;color:#a5b4fc;font-weight:900}.hero-copy[_ngcontent-%COMP%]{min-width:0}.namespace[_ngcontent-%COMP%]{font:11px ui-monospace,monospace;color:#818cf8}.hero[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{font-size:26px;margin:4px 0}.hero[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{color:#9ba1ad;margin:5px 0;line-height:1.5;max-width:800px}.hero-actions[_ngcontent-%COMP%]{display:flex;gap:8px;margin-left:auto}.button[_ngcontent-%COMP%]{padding:9px 13px;border-radius:5px;text-decoration:none;font:inherit;font-size:12px;font-weight:700;cursor:pointer}.button.secondary[_ngcontent-%COMP%]{border:1px solid #3b3e48;background:#1c1e24;color:#e5e7eb}.button.primary[_ngcontent-%COMP%]{border:1px solid #6366f1;background:#6366f1;color:#fff}.stats[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(5,1fr);border:1px solid #2d3038;border-radius:7px;margin-top:24px;background:#16171c}.stats[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{padding:13px 16px;border-right:1px solid #2d3038}.stats[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:last-child{border:0}.stats[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .file-strip[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:block;color:#777e8b;font-size:10px;text-transform:uppercase;font-weight:700}.stats[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{display:block;margin-top:5px;font-size:14px}.file-strip[_ngcontent-%COMP%]{display:flex;align-items:center;gap:14px;padding:10px 14px;border:1px solid #2d3038;border-top:0;background:#131419}.file-strip[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{color:#aab0bb;font-size:11px}.tabs[_ngcontent-%COMP%]{display:flex;border-bottom:1px solid #2d3038;margin-top:24px}.tabs[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{border:0;background:transparent;color:#858c98;padding:10px 14px;font-weight:700;cursor:pointer}.tabs[_ngcontent-%COMP%] button.active[_ngcontent-%COMP%]{color:#fff;box-shadow:inset 0 -2px #6366f1}.tabs[_ngcontent-%COMP%] button[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{background:#292c34;padding:1px 5px;border-radius:8px;font-size:10px}.tab-content[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:16px;margin-top:18px}.section-heading[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], .dag-toolbar[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{font-size:15px;margin:0}.section-heading[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .dag-toolbar[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font-size:12px;color:#7f8692;margin:4px 0 12px}.node-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:28px 38px minmax(180px,1fr) minmax(120px,.5fr);align-items:center;gap:11px;width:100%;border:1px solid #292c34;border-bottom:0;background:#16171c;color:#e5e7eb;padding:11px;text-align:left;cursor:pointer}.node-row[_ngcontent-%COMP%]:first-of-type{border-radius:6px 6px 0 0}.node-row[_ngcontent-%COMP%]:last-child{border-bottom:1px solid #292c34;border-radius:0 0 6px 6px}.node-row[_ngcontent-%COMP%]:hover, .node-row.selected[_ngcontent-%COMP%]{background:#1e2027;border-color:#494d5a}.step-index[_ngcontent-%COMP%]{color:#676e7a;font-size:11px;text-align:center}.type-icon[_ngcontent-%COMP%]{display:grid;place-items:center;width:34px;height:28px;border-radius:4px;background:#242630;color:#c4b5fd;font-size:9px;font-weight:900;text-transform:uppercase}.type-icon[data-type=bash][_ngcontent-%COMP%]{color:#fbbf24}.type-icon[data-type=command][_ngcontent-%COMP%]{color:#67e8f9}.node-main[_ngcontent-%COMP%]{min-width:0}.node-main[_ngcontent-%COMP%] strong[_ngcontent-%COMP%], .node-main[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{display:block}.node-main[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{color:#777e8b;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:4px}.dependency[_ngcontent-%COMP%]{color:#858c98;font-size:11px;overflow-wrap:anywhere}.inspector[_ngcontent-%COMP%]{border:1px solid #2d3038;background:#16171c;border-radius:6px;padding:15px}.inspector-title[_ngcontent-%COMP%]{color:#777e8b;text-transform:uppercase;font-size:10px;font-weight:800}.inspector[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:8px 0;font-size:16px}.badge[_ngcontent-%COMP%]{display:inline-block;border:1px solid #4b4f5c;padding:2px 6px;border-radius:4px;font-size:10px;color:#a5b4fc}.inspector[_ngcontent-%COMP%] dl[_ngcontent-%COMP%]{margin:14px 0}.inspector[_ngcontent-%COMP%] dl[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:12px;padding:7px 0;border-bottom:1px solid #282a31;font-size:11px}.inspector[_ngcontent-%COMP%] dt[_ngcontent-%COMP%]{color:#777e8b}.inspector[_ngcontent-%COMP%] dd[_ngcontent-%COMP%]{margin:0;text-align:right;overflow-wrap:anywhere}.inspector[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{font-size:10px;color:#777e8b;text-transform:uppercase}.inspector[_ngcontent-%COMP%] pre[_ngcontent-%COMP%]{white-space:pre-wrap;overflow-wrap:anywhere;background:#0d0e11;padding:10px;border-radius:5px;font-size:11px;max-height:240px;overflow:auto}.dag-panel[_ngcontent-%COMP%], .yaml-panel[_ngcontent-%COMP%], .runs-panel[_ngcontent-%COMP%]{margin-top:18px;border:1px solid #2d3038;border-radius:7px;overflow:hidden}.dag-toolbar[_ngcontent-%COMP%], .yaml-toolbar[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:12px 14px;border-bottom:1px solid #2d3038;background:#16171c}.dag-toolbar[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin-bottom:0}.dag-toolbar[_ngcontent-%COMP%] > span[_ngcontent-%COMP%], .yaml-toolbar[_ngcontent-%COMP%]{font-size:11px;color:#858c98}.dag-scroll[_ngcontent-%COMP%]{overflow-x:auto;background-color:var(--background)}.dag-canvas[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:20px;width:max-content;min-width:100%;box-sizing:border-box;padding:14px 16px;background-image:radial-gradient(#30333b 1px,transparent 1px);background-size:16px 16px}.dag-layer[_ngcontent-%COMP%]{display:flex;flex:0 0 auto;min-width:200px;flex-direction:column;gap:8px}.layer-label[_ngcontent-%COMP%]{font-size:10px;color:var(--text-tertiary);text-transform:uppercase}.dag-layer[_ngcontent-%COMP%] article[_ngcontent-%COMP%]{border:1px solid var(--border-bright);background:var(--surface);border-radius:6px;padding:8px 10px}.dag-layer[_ngcontent-%COMP%] article[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;min-width:0}.dag-layer[_ngcontent-%COMP%] article[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-size:12px;overflow-wrap:anywhere}.dag-layer[_ngcontent-%COMP%] article[_ngcontent-%COMP%] .provider-badge[_ngcontent-%COMP%]{margin:7px 0 0}.yaml-toolbar[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{border:1px solid #3a3d47;background:#22242b;color:#ddd;border-radius:4px;padding:5px 9px}.yaml-panel[_ngcontent-%COMP%] > pre[_ngcontent-%COMP%]{margin:0;padding:18px;min-height:420px;max-height:65vh;overflow:auto;background:#0d0e11;color:#cdd6f4;font:12px/1.6 ui-monospace,monospace;white-space:pre-wrap}.runs-panel[_ngcontent-%COMP%] table[_ngcontent-%COMP%]{width:100%;border-collapse:collapse;background:#16171c;font-size:12px}.runs-panel[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .runs-panel[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:12px;text-align:left;border-bottom:1px solid #292c34}.runs-panel[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{color:#777e8b;text-transform:uppercase;font-size:10px}.runs-panel[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:#a5b4fc}.status[_ngcontent-%COMP%]{font-size:10px;text-transform:uppercase}.status[data-status=completed][_ngcontent-%COMP%]{color:#34d399}.status[data-status=failed][_ngcontent-%COMP%], .status[data-status=cancelled][_ngcontent-%COMP%]{color:#f87171}.status[data-status=running][_ngcontent-%COMP%]{color:#60a5fa}.provider-badge[_ngcontent-%COMP%]{display:inline-block;border:1px solid var(--border-bright);border-radius:4px;background:var(--surface-elevated);color:#c4b5fd;font:10px ui-monospace,monospace;padding:1px 6px;margin-left:8px;vertical-align:1px}.provider-badge.inherited[_ngcontent-%COMP%]{color:var(--text-tertiary);border-style:dashed;background:transparent}.history-tag[_ngcontent-%COMP%]{border:1px dashed var(--border-bright);color:var(--text-tertiary);padding:1px 5px;border-radius:4px;font-size:9px;text-transform:uppercase;margin-left:6px}.empty[_ngcontent-%COMP%], .state[_ngcontent-%COMP%]{padding:24px;text-align:center;color:#858c98}.state.error[_ngcontent-%COMP%]{color:#fca5a5}@media(max-width:900px){.detail-page[_ngcontent-%COMP%]{padding:18px 14px}.hero[_ngcontent-%COMP%]{flex-wrap:wrap}.hero-actions[_ngcontent-%COMP%]{width:100%;margin-left:61px}.stats[_ngcontent-%COMP%]{grid-template-columns:repeat(2,1fr)}.stats[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{border-bottom:1px solid #2d3038}.tab-content[_ngcontent-%COMP%]{grid-template-columns:1fr}.node-row[_ngcontent-%COMP%]{grid-template-columns:28px 38px 1fr}.dependency[_ngcontent-%COMP%]{grid-column:3}.inspector[_ngcontent-%COMP%]{position:static}}@media(max-width:600px){.stats[_ngcontent-%COMP%]{grid-template-columns:1fr}.hero-actions[_ngcontent-%COMP%]{margin-left:0}.tabs[_ngcontent-%COMP%]{overflow:auto}.node-row[_ngcontent-%COMP%]{grid-template-columns:28px 1fr}.type-icon[_ngcontent-%COMP%]{display:none}.node-main[_ngcontent-%COMP%], .dependency[_ngcontent-%COMP%]{grid-column:2}.dag-canvas[_ngcontent-%COMP%]{padding:18px}}"]})};export{le as WorkflowDetailComponent};
|
|
1
|
+
import{b as K,d as Q,e as U}from"./chunk-N3FOQ3O5.js";import{a as X,b as Z,e as ee,g as te,h as ne,i as ie,j as oe,k as re}from"./chunk-7ELOO4IC.js";import{$ as k,Ba as w,Fa as f,Ka as y,La as F,Lb as q,Ma as L,Mb as G,Na as A,O as C,Oa as S,Ob as H,Pa as E,Qa as s,Qb as J,Ra as n,Sa as t,T as g,Ta as B,U as x,Ua as j,Va as $,Xa as b,Ya as _,Za as p,gb as v,ib as i,jb as c,k as N,kb as u,lb as Y,mb as h,nb as M,ob as P,qa as o,rb as I,sb as D,tb as R,u as V,w as z}from"./chunk-4R37VVI4.js";var me=(r,a)=>a.name;function ge(r,a){if(r&1&&(n(0,"option",9),i(1),t()),r&2){let e=a.$implicit;s("value",e.name)("disabled",!e.available),o(),Y(" ",e.name,"",e.available?"":" \u2014 not available on this machine"," ")}}function xe(r,a){if(r&1&&(n(0,"option",10),i(1),t()),r&2){let e=a.$implicit;s("value",e),o(),c(e)}}function _e(r,a){if(r&1){let e=b();n(0,"div",1),_("click",function(){g(e);let l=p();return x(l.close())}),n(1,"div",2),_("click",function(l){return l.stopPropagation()}),n(2,"h3",3),i(3),t(),n(4,"label",4),i(5,"Arguments"),t(),n(6,"input",5),P("ngModelChange",function(l){g(e);let m=p();return M(m.args,l)||(m.args=l),x(l)}),_("keydown.enter",function(){g(e);let l=p();return x(l.submit())}),t(),n(7,"div",6)(8,"div")(9,"label",4),i(10,"Provider"),t(),n(11,"select",7),P("ngModelChange",function(l){g(e);let m=p();return M(m.provider,l)||(m.provider=l),x(l)}),_("ngModelChange",function(){g(e);let l=p();return x(l.onProviderChange())}),n(12,"option",8),i(13,"(workflow default)"),t(),S(14,ge,2,4,"option",9,me),t()(),n(16,"div")(17,"label",4),i(18,"Model"),t(),n(19,"select",7),P("ngModelChange",function(l){g(e);let m=p();return M(m.model,l)||(m.model=l),x(l)}),n(20,"option",8),i(21,"(workflow default)"),t(),S(22,xe,2,2,"option",10,A),t()()(),n(24,"div",11)(25,"button",12),_("click",function(){g(e);let l=p();return x(l.close())}),i(26,"Cancel"),t(),n(27,"button",13),_("click",function(){g(e);let l=p();return x(l.submit())}),i(28,"Start \u25B6"),t()()()()}if(r&2){let e=p();o(3),u("Run ",e.workflowName),o(3),h("ngModel",e.args),o(5),h("ngModel",e.provider),o(3),E(e.providers),o(5),h("ngModel",e.model),o(3),E(e.modelOptions)}}var O=class r{visible=!1;workflowName="";providers=[];run=new k;closed=new k;args="";provider="";model="";get modelOptions(){return this.provider?this.providers.find(a=>a.name===this.provider)?.defaultModels??[]:[...new Set(this.providers.flatMap(a=>a.defaultModels))]}onProviderChange(){this.model&&!this.modelOptions.includes(this.model)&&(this.model="")}submit(){this.run.emit({args:this.args,provider:this.provider||void 0,model:this.model||void 0}),this.reset()}close(){this.visible=!1,this.reset(),this.closed.emit()}reset(){this.args="",this.provider="",this.model=""}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=w({type:r,selectors:[["app-run-dialog"]],inputs:{visible:"visible",workflowName:"workflowName",providers:"providers"},outputs:{run:"run",closed:"closed"},decls:1,vars:1,consts:[[1,"fixed","inset-0","bg-black/60","flex","items-center","justify-center","z-50"],[1,"fixed","inset-0","bg-black/60","flex","items-center","justify-center","z-50",3,"click"],[1,"bg-slate-800","rounded-lg","p-6","w-full","max-w-md","border","border-slate-700",3,"click"],[1,"text-lg","font-semibold","text-slate-100","mb-4"],[1,"block","text-sm","text-slate-400","mb-1"],["placeholder",'e.g. "fix #42"',1,"w-full","bg-slate-900","border","border-slate-600","rounded","px-3","py-2","text-slate-100","text-sm","focus:outline-none","focus:border-blue-500","mb-4",3,"ngModelChange","keydown.enter","ngModel"],[1,"grid","grid-cols-2","gap-3","mb-4"],[1,"w-full","bg-slate-900","border","border-slate-600","rounded","px-3","py-2","text-slate-100","text-sm","focus:outline-none","focus:border-blue-500",3,"ngModelChange","ngModel"],["value",""],[3,"value","disabled"],[3,"value"],[1,"flex","justify-end","gap-3"],[1,"px-4","py-2","text-sm","text-slate-400","hover:text-slate-200",3,"click"],[1,"px-4","py-2","text-sm","bg-blue-600","text-white","rounded","hover:bg-blue-500",3,"click"]],template:function(e,d){e&1&&F(0,_e,29,4,"div",0),e&2&&L(d.visible?0:-1)},dependencies:[oe,ne,ie,X,te,Z,ee],encapsulation:2})};function ae(r,a,e={}){let d=r.provider||a.provider||e.provider||"default",l=r.model||a.model||e.model||"";return{name:l?`${d}/${l}`:d,inherited:!r.provider&&!r.model}}var fe=r=>({edit:r}),ue=r=>["/runs",r];function be(r,a){if(r&1&&(n(0,"div",4),i(1),t()),r&2){let e=p();o(),c(e.error)}}function ve(r,a){r&1&&(n(0,"div",5),i(1,"Loading workflow definition..."),t())}function Ce(r,a){if(r&1&&(n(0,"span"),i(1),t()),r&2){let e=p(3);o(),c(e.runs.length)}}function we(r,a){if(r&1){let e=b();n(0,"button",24),_("click",function(){let l=g(e).$implicit,m=p(2);return x(m.tab=l.id)}),i(1),f(2,Ce,2,1,"span",3),t()}if(r&2){let e=a.$implicit,d=p(2);v("active",d.tab===e.id),o(),u(" ",e.label," "),o(),s("ngIf",e.id==="runs")}}function ye(r,a){if(r&1){let e=b();n(0,"button",30),_("click",function(){let l=g(e).$implicit,m=p(3);return x(m.selectedNode=l)}),n(1,"span",31),i(2),t(),n(3,"span",32),i(4),t(),n(5,"span",33)(6,"strong"),i(7),n(8,"span",34),i(9),t()(),n(10,"small"),i(11),t()(),n(12,"span",35),i(13),t()()}if(r&2){let e=a.$implicit,d=a.index,l=p(3);v("selected",(l.selectedNode==null?null:l.selectedNode.id)===e.id),o(2),c(d+1),o(),y("data-type",e.type),o(),c(l.typeLabel(e.type)),o(3),u("",e.id," "),o(),v("inherited",l.nodeProvider(e).inherited),o(),c(l.providerBadgeLabel(e)),o(2),c(e.content),o(2),c(e.dependsOn.length?"After "+e.dependsOn.join(", "):"Entry point")}}function he(r,a){if(r&1&&(n(0,"aside",36)(1,"div",37),i(2,"Node inspector"),t(),n(3,"h3"),i(4),t(),n(5,"span",38),i(6),t(),n(7,"dl")(8,"div")(9,"dt"),i(10,"Depends on"),t(),n(11,"dd"),i(12),t()(),n(13,"div")(14,"dt"),i(15,"Trigger"),t(),n(16,"dd"),i(17),t()(),n(18,"div")(19,"dt"),i(20,"Context"),t(),n(21,"dd"),i(22),t()(),n(23,"div")(24,"dt"),i(25,"Condition"),t(),n(26,"dd"),i(27),t()(),n(28,"div")(29,"dt"),i(30,"Provider"),t(),n(31,"dd"),i(32),t()(),n(33,"div")(34,"dt"),i(35,"Model"),t(),n(36,"dd"),i(37),t()()(),n(38,"label"),i(39,"Content"),t(),n(40,"pre"),i(41),t()()),r&2){let e=p(3);o(4),c(e.selectedNode.id),o(2),c(e.selectedNode.type),o(6),c(e.selectedNode.dependsOn.join(", ")||"None"),o(5),c(e.selectedNode.triggerRule),o(5),c(e.selectedNode.context),o(5),c(e.selectedNode.when||"Always"),o(5),c(e.selectedNode.provider||e.workflow.defaultProvider||"Default"),o(5),c(e.selectedNode.model||e.workflow.defaultModel||"Default"),o(4),c(e.selectedNode.content)}}function Me(r,a){if(r&1&&(n(0,"div",25)(1,"main",26)(2,"div",27)(3,"div")(4,"h2"),i(5,"Workflow steps"),t(),n(6,"p"),i(7,"Execution order and node configuration."),t()()(),f(8,ye,14,11,"button",28),t(),f(9,he,42,9,"aside",29),t()),r&2){let e=p(2);o(8),s("ngForOf",e.workflow.nodes),o(),s("ngIf",e.selectedNode)}}function Pe(r,a){if(r&1&&(n(0,"article")(1,"div")(2,"span",32),i(3),t(),n(4,"strong"),i(5),t()(),n(6,"span",34),i(7),t()()),r&2){let e=a.$implicit,d=p(4);o(2),y("data-type",e.type),o(),c(d.typeLabel(e.type)),o(2),c(e.id),o(),v("inherited",d.nodeProvider(e).inherited),o(),c(d.providerBadgeLabel(e))}}function Oe(r,a){if(r&1&&(n(0,"div",44)(1,"span",45),i(2),t(),f(3,Pe,8,6,"article",46),t()),r&2){let e=a.$implicit,d=a.index;o(2),u("Stage ",d+1),o(),s("ngForOf",e)}}function ke(r,a){if(r&1&&(n(0,"div",39)(1,"div",40)(2,"div")(3,"h2"),i(4,"DAG topology"),t(),n(5,"p"),i(6,"Dependencies flow from left to right."),t()(),n(7,"span"),i(8),t()(),n(9,"div",41)(10,"div",42),f(11,Oe,4,2,"div",43),t()()()),r&2){let e=p(2);o(8),u("",e.dagLayers.length," stages"),o(3),s("ngForOf",e.dagLayers)}}function Se(r,a){if(r&1){let e=b();n(0,"div",47)(1,"div",48)(2,"span"),i(3,"Read-only YAML definition"),t(),n(4,"button",24),_("click",function(){g(e);let l=p(2);return x(l.copyYaml())}),i(5),t()(),n(6,"pre"),i(7),t()()}if(r&2){let e=p(2);o(5),c(e.copied?"Copied":"Copy"),o(2),c(e.workflow.yaml)}}function Ee(r,a){r&1&&(n(0,"span",53),i(1,"history"),t())}function Ie(r,a){if(r&1&&(n(0,"a",54),i(1,"Open"),t()),r&2){let e=p().$implicit;s("routerLink",I(1,ue,e.runId))}}function De(r,a){if(r&1&&(n(0,"tr")(1,"td")(2,"code"),i(3),t()(),n(4,"td")(5,"span",50),i(6),t(),f(7,Ee,2,0,"span",51),t(),n(8,"td"),i(9),D(10,"date"),t(),n(11,"td"),i(12),D(13,"date"),t(),n(14,"td"),f(15,Ie,2,3,"a",52),t()()),r&2){let e=a.$implicit;o(3),c(e.runId),o(2),y("data-status",e.status),o(),c(e.status),o(),s("ngIf",e.source==="history"),o(2),c(R(10,7,e.startedAt,"medium")),o(3),c(e.completedAt?R(13,10,e.completedAt,"medium"):"In progress"),o(3),s("ngIf",e.source!=="history")}}function Re(r,a){r&1&&(n(0,"tr")(1,"td",55),i(2,"This workflow has not been run yet."),t()())}function We(r,a){if(r&1&&(n(0,"div",49)(1,"table")(2,"thead")(3,"tr")(4,"th"),i(5,"Run ID"),t(),n(6,"th"),i(7,"Status"),t(),n(8,"th"),i(9,"Started"),t(),n(10,"th"),i(11,"Completed"),t(),B(12,"th"),t()(),n(13,"tbody"),f(14,De,16,13,"tr",46)(15,Re,3,0,"tr",3),t()()()),r&2){let e=p(2);o(14),s("ngForOf",e.runs),o(),s("ngIf",!e.runs.length)}}function Te(r,a){if(r&1){let e=b();j(0),n(1,"nav",6)(2,"a",7),i(3,"Workflows"),t(),n(4,"span"),i(5,"/"),t(),n(6,"span"),i(7),t()(),n(8,"header",8)(9,"div",9),i(10,"Y"),t(),n(11,"div",10)(12,"span",11),i(13),t(),n(14,"h1"),i(15),t(),n(16,"p"),i(17),t()(),n(18,"div",12)(19,"a",13),i(20,"Edit"),t(),n(21,"button",14),_("click",function(){g(e);let l=p();return x(l.showRunDialog=!0)}),i(22,"Run workflow"),t()()(),n(23,"div",15)(24,"div")(25,"span"),i(26,"Nodes"),t(),n(27,"strong"),i(28),t()(),n(29,"div")(30,"span"),i(31,"Dependencies"),t(),n(32,"strong"),i(33),t()(),n(34,"div")(35,"span"),i(36,"Provider"),t(),n(37,"strong"),i(38),t()(),n(39,"div")(40,"span"),i(41,"Model"),t(),n(42,"strong"),i(43),t()(),n(44,"div")(45,"span"),i(46,"Runs"),t(),n(47,"strong"),i(48),t()()(),n(49,"div",16)(50,"span"),i(51,"Definition"),t(),n(52,"code"),i(53),t()(),n(54,"nav",17),f(55,we,3,4,"button",18),t(),f(56,Me,10,2,"div",19)(57,ke,12,2,"div",20)(58,Se,8,2,"div",21)(59,We,16,2,"div",22),n(60,"app-run-dialog",23),_("run",function(l){g(e);let m=p();return x(m.onStartRun(l))})("closed",function(){g(e);let l=p();return x(l.showRunDialog=!1)}),t(),$()}if(r&2){let e=p();o(7),c(e.workflow.id),o(6),c(e.workflow.id),o(2),c(e.workflow.name),o(2),c(e.workflow.description||"No description provided."),o(2),s("queryParams",I(19,fe,e.workflow.id)),o(9),c(e.workflow.nodeCount),o(5),c(e.dependencyCount),o(5),c(e.workflow.defaultProvider||"default"),o(5),c(e.workflow.defaultModel||"default"),o(5),c(e.runs.length),o(5),u(".vsaf/workflows/",e.workflow.file),o(2),s("ngForOf",e.tabs),o(),s("ngIf",e.tab==="overview"),o(),s("ngIf",e.tab==="dag"),o(),s("ngIf",e.tab==="yaml"),o(),s("ngIf",e.tab==="runs"),o(),s("visible",e.showRunDialog)("workflowName",e.workflow.id)("providers",e.providers)}}var le=class r{route=C(K);api=C(re);router=C(Q);workflow;runs=[];providers=[];selectedNode;tab="overview";showRunDialog=!1;loading=!0;error="";copied=!1;tabs=[{id:"overview",label:"Overview"},{id:"dag",label:"DAG"},{id:"yaml",label:"YAML"},{id:"runs",label:"Runs"}];ngOnInit(){let a=this.route.snapshot.queryParamMap.get("id");if(!a){this.loading=!1,this.error="Missing workflow id.";return}V({workflow:this.api.getWorkflow(a),runs:this.api.getRuns(),providers:this.api.getProviders().pipe(z(()=>N({providers:[]})))}).subscribe({next:e=>{this.workflow=e.workflow,this.selectedNode=e.workflow.nodes[0],this.runs=e.runs.filter(d=>d.workflow===a).reverse(),this.providers=e.providers.providers??[],this.loading=!1},error:e=>{this.loading=!1,this.error=e?.error?.error??"Failed to load workflow."}})}nodeProvider(a){return ae(a,{provider:this.workflow?.defaultProvider,model:this.workflow?.defaultModel})}providerBadgeLabel(a){let e=this.nodeProvider(a);return e.inherited?`\u2192 ${e.name}`:e.name}get dependencyCount(){return this.workflow?.nodes.reduce((a,e)=>a+e.dependsOn.length,0)??0}get dagLayers(){if(!this.workflow)return[];let a=new Map,e=(l,m=new Set)=>{if(a.has(l.id))return a.get(l.id);if(m.has(l.id)||!l.dependsOn.length)return 0;m.add(l.id);let W=1+Math.max(...l.dependsOn.map(de=>{let T=this.workflow.nodes.find(ce=>ce.id===de);return T?e(T,m):0}));return m.delete(l.id),a.set(l.id,W),W};for(let l of this.workflow.nodes)a.set(l.id,e(l));let d=[];for(let l of this.workflow.nodes)(d[a.get(l.id)??0]??=[]).push(l);return d}typeLabel(a){return a==="command"?"CMD":a==="prompt"?"AI":"SH"}onStartRun(a){this.showRunDialog=!1,this.api.startRun(this.workflow.id,a.args,{provider:a.provider,model:a.model}).subscribe(e=>this.router.navigate(["/runs",e.runId]))}copyYaml(){this.workflow&&navigator.clipboard.writeText(this.workflow.yaml).then(()=>{this.copied=!0,setTimeout(()=>this.copied=!1,1500)})}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=w({type:r,selectors:[["app-workflow-detail"]],decls:4,vars:3,consts:[[1,"detail-page"],["class","state error",4,"ngIf"],["class","state",4,"ngIf"],[4,"ngIf"],[1,"state","error"],[1,"state"],[1,"breadcrumb"],["routerLink","/workflows"],[1,"hero"],[1,"workflow-icon"],[1,"hero-copy"],[1,"namespace"],[1,"hero-actions"],["routerLink","/workflows/builder",1,"button","secondary",3,"queryParams"],["type","button",1,"button","primary",3,"click"],[1,"stats"],[1,"file-strip"],["aria-label","Workflow detail sections",1,"tabs"],["type","button",3,"active","click",4,"ngFor","ngForOf"],["class","tab-content",4,"ngIf"],["class","dag-panel",4,"ngIf"],["class","yaml-panel",4,"ngIf"],["class","runs-panel",4,"ngIf"],[3,"run","closed","visible","workflowName","providers"],["type","button",3,"click"],[1,"tab-content"],[1,"node-list"],[1,"section-heading"],["type","button","class","node-row",3,"selected","click",4,"ngFor","ngForOf"],["class","inspector",4,"ngIf"],["type","button",1,"node-row",3,"click"],[1,"step-index"],[1,"type-icon"],[1,"node-main"],[1,"provider-badge"],[1,"dependency"],[1,"inspector"],[1,"inspector-title"],[1,"badge"],[1,"dag-panel"],[1,"dag-toolbar"],[1,"dag-scroll"],[1,"dag-canvas"],["class","dag-layer",4,"ngFor","ngForOf"],[1,"dag-layer"],[1,"layer-label"],[4,"ngFor","ngForOf"],[1,"yaml-panel"],[1,"yaml-toolbar"],[1,"runs-panel"],[1,"status"],["class","history-tag",4,"ngIf"],[3,"routerLink",4,"ngIf"],[1,"history-tag"],[3,"routerLink"],["colspan","5",1,"empty"]],template:function(e,d){e&1&&(n(0,"section",0),f(1,be,2,1,"div",1)(2,ve,2,0,"div",2)(3,Te,61,21,"ng-container",3),t()),e&2&&(o(),s("ngIf",d.error),o(),s("ngIf",d.loading),o(),s("ngIf",d.workflow))},dependencies:[J,q,G,U,O,H],styles:["[_nghost-%COMP%]{display:block;min-height:calc(100vh - 56px);background:#101114;color:#e7e7ea}.detail-page[_ngcontent-%COMP%]{max-width:1320px;margin:auto;padding:24px 28px 60px}.breadcrumb[_ngcontent-%COMP%]{display:flex;gap:7px;color:#737a87;font-size:12px;margin-bottom:18px}.breadcrumb[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:#9ca3af;text-decoration:none}.hero[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:15px}.workflow-icon[_ngcontent-%COMP%]{display:grid;place-items:center;flex:0 0 46px;height:52px;border:1px solid #454957;border-radius:6px;color:#a5b4fc;font-weight:900}.hero-copy[_ngcontent-%COMP%]{min-width:0}.namespace[_ngcontent-%COMP%]{font:11px ui-monospace,monospace;color:#818cf8}.hero[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{font-size:26px;margin:4px 0}.hero[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{color:#9ba1ad;margin:5px 0;line-height:1.5;max-width:800px}.hero-actions[_ngcontent-%COMP%]{display:flex;gap:8px;margin-left:auto}.button[_ngcontent-%COMP%]{padding:9px 13px;border-radius:5px;text-decoration:none;font:inherit;font-size:12px;font-weight:700;cursor:pointer}.button.secondary[_ngcontent-%COMP%]{border:1px solid #3b3e48;background:#1c1e24;color:#e5e7eb}.button.primary[_ngcontent-%COMP%]{border:1px solid #6366f1;background:#6366f1;color:#fff}.stats[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(5,1fr);border:1px solid #2d3038;border-radius:7px;margin-top:24px;background:#16171c}.stats[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{padding:13px 16px;border-right:1px solid #2d3038}.stats[_ngcontent-%COMP%] div[_ngcontent-%COMP%]:last-child{border:0}.stats[_ngcontent-%COMP%] span[_ngcontent-%COMP%], .file-strip[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:block;color:#777e8b;font-size:10px;text-transform:uppercase;font-weight:700}.stats[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{display:block;margin-top:5px;font-size:14px}.file-strip[_ngcontent-%COMP%]{display:flex;align-items:center;gap:14px;padding:10px 14px;border:1px solid #2d3038;border-top:0;background:#131419}.file-strip[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{color:#aab0bb;font-size:11px}.tabs[_ngcontent-%COMP%]{display:flex;border-bottom:1px solid #2d3038;margin-top:24px}.tabs[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{border:0;background:transparent;color:#858c98;padding:10px 14px;font-weight:700;cursor:pointer}.tabs[_ngcontent-%COMP%] button.active[_ngcontent-%COMP%]{color:#fff;box-shadow:inset 0 -2px #6366f1}.tabs[_ngcontent-%COMP%] button[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{background:#292c34;padding:1px 5px;border-radius:8px;font-size:10px}.tab-content[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:16px;margin-top:18px}.section-heading[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], .dag-toolbar[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{font-size:15px;margin:0}.section-heading[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .dag-toolbar[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font-size:12px;color:#7f8692;margin:4px 0 12px}.node-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:28px 38px minmax(180px,1fr) minmax(120px,.5fr);align-items:center;gap:11px;width:100%;border:1px solid #292c34;border-bottom:0;background:#16171c;color:#e5e7eb;padding:11px;text-align:left;cursor:pointer}.node-row[_ngcontent-%COMP%]:first-of-type{border-radius:6px 6px 0 0}.node-row[_ngcontent-%COMP%]:last-child{border-bottom:1px solid #292c34;border-radius:0 0 6px 6px}.node-row[_ngcontent-%COMP%]:hover, .node-row.selected[_ngcontent-%COMP%]{background:#1e2027;border-color:#494d5a}.step-index[_ngcontent-%COMP%]{color:#676e7a;font-size:11px;text-align:center}.type-icon[_ngcontent-%COMP%]{display:grid;place-items:center;width:34px;height:28px;border-radius:4px;background:#242630;color:#c4b5fd;font-size:9px;font-weight:900;text-transform:uppercase}.type-icon[data-type=bash][_ngcontent-%COMP%]{color:#fbbf24}.type-icon[data-type=command][_ngcontent-%COMP%]{color:#67e8f9}.node-main[_ngcontent-%COMP%]{min-width:0}.node-main[_ngcontent-%COMP%] strong[_ngcontent-%COMP%], .node-main[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{display:block}.node-main[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{color:#777e8b;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:4px}.dependency[_ngcontent-%COMP%]{color:#858c98;font-size:11px;overflow-wrap:anywhere}.inspector[_ngcontent-%COMP%]{border:1px solid #2d3038;background:#16171c;border-radius:6px;padding:15px}.inspector-title[_ngcontent-%COMP%]{color:#777e8b;text-transform:uppercase;font-size:10px;font-weight:800}.inspector[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:8px 0;font-size:16px}.badge[_ngcontent-%COMP%]{display:inline-block;border:1px solid #4b4f5c;padding:2px 6px;border-radius:4px;font-size:10px;color:#a5b4fc}.inspector[_ngcontent-%COMP%] dl[_ngcontent-%COMP%]{margin:14px 0}.inspector[_ngcontent-%COMP%] dl[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:12px;padding:7px 0;border-bottom:1px solid #282a31;font-size:11px}.inspector[_ngcontent-%COMP%] dt[_ngcontent-%COMP%]{color:#777e8b}.inspector[_ngcontent-%COMP%] dd[_ngcontent-%COMP%]{margin:0;text-align:right;overflow-wrap:anywhere}.inspector[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{font-size:10px;color:#777e8b;text-transform:uppercase}.inspector[_ngcontent-%COMP%] pre[_ngcontent-%COMP%]{white-space:pre-wrap;overflow-wrap:anywhere;background:#0d0e11;padding:10px;border-radius:5px;font-size:11px;max-height:240px;overflow:auto}.dag-panel[_ngcontent-%COMP%], .yaml-panel[_ngcontent-%COMP%], .runs-panel[_ngcontent-%COMP%]{margin-top:18px;border:1px solid #2d3038;border-radius:7px;overflow:hidden}.dag-toolbar[_ngcontent-%COMP%], .yaml-toolbar[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:12px 14px;border-bottom:1px solid #2d3038;background:#16171c}.dag-toolbar[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin-bottom:0}.dag-toolbar[_ngcontent-%COMP%] > span[_ngcontent-%COMP%], .yaml-toolbar[_ngcontent-%COMP%]{font-size:11px;color:#858c98}.dag-scroll[_ngcontent-%COMP%]{overflow-x:auto;background-color:var(--background)}.dag-canvas[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:20px;width:max-content;min-width:100%;box-sizing:border-box;padding:14px 16px;background-image:radial-gradient(#30333b 1px,transparent 1px);background-size:16px 16px}.dag-layer[_ngcontent-%COMP%]{display:flex;flex:0 0 auto;min-width:200px;flex-direction:column;gap:8px}.layer-label[_ngcontent-%COMP%]{font-size:10px;color:var(--text-tertiary);text-transform:uppercase}.dag-layer[_ngcontent-%COMP%] article[_ngcontent-%COMP%]{border:1px solid var(--border-bright);background:var(--surface);border-radius:6px;padding:8px 10px}.dag-layer[_ngcontent-%COMP%] article[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;min-width:0}.dag-layer[_ngcontent-%COMP%] article[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-size:12px;overflow-wrap:anywhere}.dag-layer[_ngcontent-%COMP%] article[_ngcontent-%COMP%] .provider-badge[_ngcontent-%COMP%]{margin:7px 0 0}.yaml-toolbar[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{border:1px solid #3a3d47;background:#22242b;color:#ddd;border-radius:4px;padding:5px 9px}.yaml-panel[_ngcontent-%COMP%] > pre[_ngcontent-%COMP%]{margin:0;padding:18px;min-height:420px;max-height:65vh;overflow:auto;background:#0d0e11;color:#cdd6f4;font:12px/1.6 ui-monospace,monospace;white-space:pre-wrap}.runs-panel[_ngcontent-%COMP%] table[_ngcontent-%COMP%]{width:100%;border-collapse:collapse;background:#16171c;font-size:12px}.runs-panel[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .runs-panel[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:12px;text-align:left;border-bottom:1px solid #292c34}.runs-panel[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{color:#777e8b;text-transform:uppercase;font-size:10px}.runs-panel[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:#a5b4fc}.status[_ngcontent-%COMP%]{font-size:10px;text-transform:uppercase}.status[data-status=completed][_ngcontent-%COMP%]{color:#34d399}.status[data-status=failed][_ngcontent-%COMP%], .status[data-status=cancelled][_ngcontent-%COMP%]{color:#f87171}.status[data-status=running][_ngcontent-%COMP%]{color:#60a5fa}.provider-badge[_ngcontent-%COMP%]{display:inline-block;border:1px solid var(--border-bright);border-radius:4px;background:var(--surface-elevated);color:#c4b5fd;font:10px ui-monospace,monospace;padding:1px 6px;margin-left:8px;vertical-align:1px}.provider-badge.inherited[_ngcontent-%COMP%]{color:var(--text-tertiary);border-style:dashed;background:transparent}.history-tag[_ngcontent-%COMP%]{border:1px dashed var(--border-bright);color:var(--text-tertiary);padding:1px 5px;border-radius:4px;font-size:9px;text-transform:uppercase;margin-left:6px}.empty[_ngcontent-%COMP%], .state[_ngcontent-%COMP%]{padding:24px;text-align:center;color:#858c98}.state.error[_ngcontent-%COMP%]{color:#fca5a5}@media(max-width:900px){.detail-page[_ngcontent-%COMP%]{padding:18px 14px}.hero[_ngcontent-%COMP%]{flex-wrap:wrap}.hero-actions[_ngcontent-%COMP%]{width:100%;margin-left:61px}.stats[_ngcontent-%COMP%]{grid-template-columns:repeat(2,1fr)}.stats[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{border-bottom:1px solid #2d3038}.tab-content[_ngcontent-%COMP%]{grid-template-columns:1fr}.node-row[_ngcontent-%COMP%]{grid-template-columns:28px 38px 1fr}.dependency[_ngcontent-%COMP%]{grid-column:3}.inspector[_ngcontent-%COMP%]{position:static}}@media(max-width:600px){.stats[_ngcontent-%COMP%]{grid-template-columns:1fr}.hero-actions[_ngcontent-%COMP%]{margin-left:0}.tabs[_ngcontent-%COMP%]{overflow:auto}.node-row[_ngcontent-%COMP%]{grid-template-columns:28px 1fr}.type-icon[_ngcontent-%COMP%]{display:none}.node-main[_ngcontent-%COMP%], .dependency[_ngcontent-%COMP%]{grid-column:2}.dag-canvas[_ngcontent-%COMP%]{padding:18px}}"]})};export{le as WorkflowDetailComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$ as D,Ab as J,Ca as Y,Cb as me,Da as u,Db as Q,Ea as h,G as k,Ha as pe,I as m,J as Z,Ja as ge,K as X,M as v,O as g,Sb as ve,Ub as _e,Ya as w,Z as ce,a as l,b as d,da as b,ea as he,eb as K,fa as P,g as ae,ha as A,j as le,nb as _,o as ue,u as de,ua as fe,ub as f,vb as F,wa as M,xa as o}from"./chunk-WDOCF7IL.js";var Fe=(()=>{class n{_renderer;_elementRef;onChange=t=>{};onTouched=()=>{};constructor(t,i){this._renderer=t,this._elementRef=i}setProperty(t,i){this._renderer.setProperty(this._elementRef.nativeElement,t,i)}registerOnTouched(t){this.onTouched=t}registerOnChange(t){this.onChange=t}setDisabledState(t){this.setProperty("disabled",t)}static \u0275fac=function(i){return new(i||n)(o(M),o(A))};static \u0275dir=u({type:n})}return n})(),ne=(()=>{class n extends Fe{static \u0275fac=(()=>{let t;return function(r){return(t||(t=P(n)))(r||n)}})();static \u0275dir=u({type:n,features:[h]})}return n})(),L=new v("");var qe={provide:L,useExisting:m(()=>Ee),multi:!0};function ze(){let n=Q()?Q().getUserAgent():"";return/android (\d+)/.test(n.toLowerCase())}var Ze=new v(""),Ee=(()=>{class n extends Fe{_compositionMode;_composing=!1;constructor(t,i,r){super(t,i),this._compositionMode=r,this._compositionMode==null&&(this._compositionMode=!ze())}writeValue(t){let i=t??"";this.setProperty("value",i)}_handleInput(t){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(t)}_compositionStart(){this._composing=!0}_compositionEnd(t){this._composing=!1,this._compositionMode&&this.onChange(t)}static \u0275fac=function(i){return new(i||n)(o(M),o(A),o(Ze,8))};static \u0275dir=u({type:n,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(i,r){i&1&&w("input",function(a){return r._handleInput(a.target.value)})("blur",function(){return r.onTouched()})("compositionstart",function(){return r._compositionStart()})("compositionend",function(a){return r._compositionEnd(a.target.value)})},standalone:!1,features:[_([qe]),h]})}return n})();var Se=new v(""),Ie=new v("");function Oe(n){return n!=null}function Ne(n){return pe(n)?le(n):n}function Re(n){let e={};return n.forEach(t=>{e=t!=null?l(l({},e),t):e}),Object.keys(e).length===0?null:e}function xe(n,e){return e.map(t=>t(n))}function Xe(n){return!n.validate}function ke(n){return n.map(e=>Xe(e)?e:t=>e.validate(t))}function Ye(n){if(!n)return null;let e=n.filter(Oe);return e.length==0?null:function(t){return Re(xe(t,e))}}function ie(n){return n!=null?Ye(ke(n)):null}function Ke(n){if(!n)return null;let e=n.filter(Oe);return e.length==0?null:function(t){let i=xe(t,e).map(Ne);return de(i).pipe(ue(Re))}}function re(n){return n!=null?Ke(ke(n)):null}function ye(n,e){return n===null?[e]:Array.isArray(n)?[...n,e]:[n,e]}function Je(n){return n._rawValidators}function Qe(n){return n._rawAsyncValidators}function ee(n){return n?Array.isArray(n)?n:[n]:[]}function G(n,e){return Array.isArray(n)?n.includes(e):n===e}function Ce(n,e){let t=ee(e);return ee(n).forEach(r=>{G(t,r)||t.push(r)}),t}function Ve(n,e){return ee(e).filter(t=>!G(n,t))}var T=class{get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators=[];_rawAsyncValidators=[];_setValidators(e){this._rawValidators=e||[],this._composedValidatorFn=ie(this._rawValidators)}_setAsyncValidators(e){this._rawAsyncValidators=e||[],this._composedAsyncValidatorFn=re(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_onDestroyCallbacks=[];_registerOnDestroy(e){this._onDestroyCallbacks.push(e)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(e=>e()),this._onDestroyCallbacks=[]}reset(e=void 0){this.control?.reset(e)}hasError(e,t){return this.control?this.control.hasError(e,t):!1}getError(e,t){return this.control?this.control.getError(e,t):null}},V=class extends T{name;get formDirective(){return null}get path(){return null}},R=class extends T{_parent=null;name=null;valueAccessor=null},B=class{_cd;constructor(e){this._cd=e}get isTouched(){return this._cd?.control?._touched?.(),!!this._cd?.control?.touched}get isUntouched(){return!!this._cd?.control?.untouched}get isPristine(){return this._cd?.control?._pristine?.(),!!this._cd?.control?.pristine}get isDirty(){return!!this._cd?.control?.dirty}get isValid(){return this._cd?.control?._status?.(),!!this._cd?.control?.valid}get isInvalid(){return!!this._cd?.control?.invalid}get isPending(){return!!this._cd?.control?.pending}get isSubmitted(){return this._cd?._submitted?.(),!!this._cd?.submitted}};var Ht=(()=>{class n extends B{constructor(t){super(t)}static \u0275fac=function(i){return new(i||n)(o(R,2))};static \u0275dir=u({type:n,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(i,r){i&2&&K("ng-untouched",r.isUntouched)("ng-touched",r.isTouched)("ng-pristine",r.isPristine)("ng-dirty",r.isDirty)("ng-valid",r.isValid)("ng-invalid",r.isInvalid)("ng-pending",r.isPending)},standalone:!1,features:[h]})}return n})(),Wt=(()=>{class n extends B{constructor(t){super(t)}static \u0275fac=function(i){return new(i||n)(o(V,10))};static \u0275dir=u({type:n,selectors:[["","formGroupName",""],["","formArrayName",""],["","ngModelGroup",""],["","formGroup",""],["","formArray",""],["form",3,"ngNoForm",""],["","ngForm",""]],hostVars:16,hostBindings:function(i,r){i&2&&K("ng-untouched",r.isUntouched)("ng-touched",r.isTouched)("ng-pristine",r.isPristine)("ng-dirty",r.isDirty)("ng-valid",r.isValid)("ng-invalid",r.isInvalid)("ng-pending",r.isPending)("ng-submitted",r.isSubmitted)},standalone:!1,features:[h]})}return n})();var E="VALID",j="INVALID",y="PENDING",S="DISABLED",p=class{},U=class extends p{value;source;constructor(e,t){super(),this.value=e,this.source=t}},O=class extends p{pristine;source;constructor(e,t){super(),this.pristine=e,this.source=t}},N=class extends p{touched;source;constructor(e,t){super(),this.touched=e,this.source=t}},C=class extends p{status;source;constructor(e,t){super(),this.status=e,this.source=t}},te=class extends p{source;constructor(e){super(),this.source=e}},H=class extends p{source;constructor(e){super(),this.source=e}};function Pe(n){return(q(n)?n.validators:n)||null}function et(n){return Array.isArray(n)?ie(n):n||null}function je(n,e){return(q(e)?e.asyncValidators:n)||null}function tt(n){return Array.isArray(n)?re(n):n||null}function q(n){return n!=null&&!Array.isArray(n)&&typeof n=="object"}function nt(n,e,t){let i=n.controls;if(!(e?Object.keys(i):i).length)throw new k(1e3,"");if(!i[t])throw new k(1001,"")}function it(n,e,t){n._forEachChild((i,r)=>{if(t[r]===void 0)throw new k(-1002,"")})}var W=class{_pendingDirty=!1;_hasOwnPendingAsyncValidator=null;_pendingTouched=!1;_onCollectionChange=()=>{};_updateOn;_parent=null;_asyncValidationSubscription;_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators;_rawAsyncValidators;value;constructor(e,t){this._assignValidators(e),this._assignAsyncValidators(t)}get validator(){return this._composedValidatorFn}set validator(e){this._rawValidators=this._composedValidatorFn=e}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(e){this._rawAsyncValidators=this._composedAsyncValidatorFn=e}get parent(){return this._parent}get status(){return f(this.statusReactive)}set status(e){f(()=>this.statusReactive.set(e))}_status=F(()=>this.statusReactive());statusReactive=b(void 0);get valid(){return this.status===E}get invalid(){return this.status===j}get pending(){return this.status===y}get disabled(){return this.status===S}get enabled(){return this.status!==S}errors;get pristine(){return f(this.pristineReactive)}set pristine(e){f(()=>this.pristineReactive.set(e))}_pristine=F(()=>this.pristineReactive());pristineReactive=b(!0);get dirty(){return!this.pristine}get touched(){return f(this.touchedReactive)}set touched(e){f(()=>this.touchedReactive.set(e))}_touched=F(()=>this.touchedReactive());touchedReactive=b(!1);get untouched(){return!this.touched}_events=new ae;events=this._events.asObservable();valueChanges;statusChanges;get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(e){this._assignValidators(e)}setAsyncValidators(e){this._assignAsyncValidators(e)}addValidators(e){this.setValidators(Ce(e,this._rawValidators))}addAsyncValidators(e){this.setAsyncValidators(Ce(e,this._rawAsyncValidators))}removeValidators(e){this.setValidators(Ve(e,this._rawValidators))}removeAsyncValidators(e){this.setAsyncValidators(Ve(e,this._rawAsyncValidators))}hasValidator(e){return G(this._rawValidators,e)}hasAsyncValidator(e){return G(this._rawAsyncValidators,e)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(e={}){let t=this.touched===!1;this.touched=!0;let i=e.sourceControl??this;e.onlySelf||this._parent?.markAsTouched(d(l({},e),{sourceControl:i})),t&&e.emitEvent!==!1&&this._events.next(new N(!0,i))}markAllAsDirty(e={}){this.markAsDirty({onlySelf:!0,emitEvent:e.emitEvent,sourceControl:this}),this._forEachChild(t=>t.markAllAsDirty(e))}markAllAsTouched(e={}){this.markAsTouched({onlySelf:!0,emitEvent:e.emitEvent,sourceControl:this}),this._forEachChild(t=>t.markAllAsTouched(e))}markAsUntouched(e={}){let t=this.touched===!0;this.touched=!1,this._pendingTouched=!1;let i=e.sourceControl??this;this._forEachChild(r=>{r.markAsUntouched({onlySelf:!0,emitEvent:e.emitEvent,sourceControl:i})}),e.onlySelf||this._parent?._updateTouched(e,i),t&&e.emitEvent!==!1&&this._events.next(new N(!1,i))}markAsDirty(e={}){let t=this.pristine===!0;this.pristine=!1;let i=e.sourceControl??this;e.onlySelf||this._parent?.markAsDirty(d(l({},e),{sourceControl:i})),t&&e.emitEvent!==!1&&this._events.next(new O(!1,i))}markAsPristine(e={}){let t=this.pristine===!1;this.pristine=!0,this._pendingDirty=!1;let i=e.sourceControl??this;this._forEachChild(r=>{r.markAsPristine({onlySelf:!0,emitEvent:e.emitEvent})}),e.onlySelf||this._parent?._updatePristine(e,i),t&&e.emitEvent!==!1&&this._events.next(new O(!0,i))}markAsPending(e={}){this.status=y;let t=e.sourceControl??this;e.emitEvent!==!1&&(this._events.next(new C(this.status,t)),this.statusChanges.emit(this.status)),e.onlySelf||this._parent?.markAsPending(d(l({},e),{sourceControl:t}))}disable(e={}){let t=this._parentMarkedDirty(e.onlySelf);this.status=S,this.errors=null,this._forEachChild(r=>{r.disable(d(l({},e),{onlySelf:!0}))}),this._updateValue();let i=e.sourceControl??this;e.emitEvent!==!1&&(this._events.next(new U(this.value,i)),this._events.next(new C(this.status,i)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(d(l({},e),{skipPristineCheck:t}),this),this._onDisabledChange.forEach(r=>r(!0))}enable(e={}){let t=this._parentMarkedDirty(e.onlySelf);this.status=E,this._forEachChild(i=>{i.enable(d(l({},e),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent}),this._updateAncestors(d(l({},e),{skipPristineCheck:t}),this),this._onDisabledChange.forEach(i=>i(!1))}_updateAncestors(e,t){e.onlySelf||(this._parent?.updateValueAndValidity(e),e.skipPristineCheck||this._parent?._updatePristine({},t),this._parent?._updateTouched({},t))}setParent(e){this._parent=e}getRawValue(){return this.value}updateValueAndValidity(e={}){if(this._setInitialStatus(),this._updateValue(),this.enabled){let i=this._cancelExistingSubscription();this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===E||this.status===y)&&this._runAsyncValidator(i,e.emitEvent)}let t=e.sourceControl??this;e.emitEvent!==!1&&(this._events.next(new U(this.value,t)),this._events.next(new C(this.status,t)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),e.onlySelf||this._parent?.updateValueAndValidity(d(l({},e),{sourceControl:t}))}_updateTreeValidity(e={emitEvent:!0}){this._forEachChild(t=>t._updateTreeValidity(e)),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?S:E}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(e,t){if(this.asyncValidator){this.status=y,this._hasOwnPendingAsyncValidator={emitEvent:t!==!1,shouldHaveEmitted:e!==!1};let i=Ne(this.asyncValidator(this));this._asyncValidationSubscription=i.subscribe(r=>{this._hasOwnPendingAsyncValidator=null,this.setErrors(r,{emitEvent:t,shouldHaveEmitted:e})})}}_cancelExistingSubscription(){if(this._asyncValidationSubscription){this._asyncValidationSubscription.unsubscribe();let e=(this._hasOwnPendingAsyncValidator?.emitEvent||this._hasOwnPendingAsyncValidator?.shouldHaveEmitted)??!1;return this._hasOwnPendingAsyncValidator=null,e}return!1}setErrors(e,t={}){this.errors=e,this._updateControlsErrors(t.emitEvent!==!1,this,t.shouldHaveEmitted)}get(e){let t=e;return t==null||(Array.isArray(t)||(t=t.split(".")),t.length===0)?null:t.reduce((i,r)=>i&&i._find(r),this)}getError(e,t){let i=t?this.get(t):this;return i?.errors?i.errors[e]:null}hasError(e,t){return!!this.getError(e,t)}get root(){let e=this;for(;e._parent;)e=e._parent;return e}_updateControlsErrors(e,t,i){this.status=this._calculateStatus(),e&&this.statusChanges.emit(this.status),(e||i)&&this._events.next(new C(this.status,t)),this._parent&&this._parent._updateControlsErrors(e,t,i)}_initObservables(){this.valueChanges=new D,this.statusChanges=new D}_calculateStatus(){return this._allControlsDisabled()?S:this.errors?j:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(y)?y:this._anyControlsHaveStatus(j)?j:E}_anyControlsHaveStatus(e){return this._anyControls(t=>t.status===e)}_anyControlsDirty(){return this._anyControls(e=>e.dirty)}_anyControlsTouched(){return this._anyControls(e=>e.touched)}_updatePristine(e,t){let i=!this._anyControlsDirty(),r=this.pristine!==i;this.pristine=i,e.onlySelf||this._parent?._updatePristine(e,t),r&&this._events.next(new O(this.pristine,t))}_updateTouched(e={},t){this.touched=this._anyControlsTouched(),this._events.next(new N(this.touched,t)),e.onlySelf||this._parent?._updateTouched(e,t)}_onDisabledChange=[];_registerOnCollectionChange(e){this._onCollectionChange=e}_setUpdateStrategy(e){q(e)&&e.updateOn!=null&&(this._updateOn=e.updateOn)}_parentMarkedDirty(e){return!e&&!!this._parent?.dirty&&!this._parent._anyControlsDirty()}_find(e){return null}_assignValidators(e){this._rawValidators=Array.isArray(e)?e.slice():e,this._composedValidatorFn=et(this._rawValidators)}_assignAsyncValidators(e){this._rawAsyncValidators=Array.isArray(e)?e.slice():e,this._composedAsyncValidatorFn=tt(this._rawAsyncValidators)}},$=class extends W{constructor(e,t,i){super(Pe(t),je(i,t)),this.controls=e,this._initObservables(),this._setUpdateStrategy(t),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}controls;registerControl(e,t){return this.controls[e]?this.controls[e]:(this.controls[e]=t,t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange),t)}addControl(e,t,i={}){this.registerControl(e,t),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}removeControl(e,t={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],this.updateValueAndValidity({emitEvent:t.emitEvent}),this._onCollectionChange()}setControl(e,t,i={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],t&&this.registerControl(e,t),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}contains(e){return this.controls.hasOwnProperty(e)&&this.controls[e].enabled}setValue(e,t={}){it(this,!0,e),Object.keys(e).forEach(i=>{nt(this,!0,i),this.controls[i].setValue(e[i],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}patchValue(e,t={}){e!=null&&(Object.keys(e).forEach(i=>{let r=this.controls[i];r&&r.patchValue(e[i],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t))}reset(e={},t={}){this._forEachChild((i,r)=>{i.reset(e?e[r]:null,d(l({},t),{onlySelf:!0}))}),this._updatePristine(t,this),this._updateTouched(t,this),this.updateValueAndValidity(t),t?.emitEvent!==!1&&this._events.next(new H(this))}getRawValue(){return this._reduceChildren({},(e,t,i)=>(e[i]=t.getRawValue(),e))}_syncPendingControls(){let e=this._reduceChildren(!1,(t,i)=>i._syncPendingControls()?!0:t);return e&&this.updateValueAndValidity({onlySelf:!0}),e}_forEachChild(e){Object.keys(this.controls).forEach(t=>{let i=this.controls[t];i&&e(i,t)})}_setUpControls(){this._forEachChild(e=>{e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(e){for(let[t,i]of Object.entries(this.controls))if(this.contains(t)&&e(i))return!0;return!1}_reduceValue(){let e={};return this._reduceChildren(e,(t,i,r)=>((i.enabled||this.disabled)&&(t[r]=i.value),t))}_reduceChildren(e,t){let i=e;return this._forEachChild((r,s)=>{i=t(i,r,s)}),i}_allControlsDisabled(){for(let e of Object.keys(this.controls))if(this.controls[e].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_find(e){return this.controls.hasOwnProperty(e)?this.controls[e]:null}};var se=new v("",{factory:()=>oe}),oe="always";function rt(n,e){return[...e.path,n]}function Ge(n,e,t=oe){Te(n,e),e.valueAccessor.writeValue(n.value),(n.disabled||t==="always")&&e.valueAccessor.setDisabledState?.(n.disabled),ot(n,e),lt(n,e),at(n,e),st(n,e)}function De(n,e){n.forEach(t=>{t.registerOnValidatorChange&&t.registerOnValidatorChange(e)})}function st(n,e){if(e.valueAccessor.setDisabledState){let t=i=>{e.valueAccessor.setDisabledState(i)};n.registerOnDisabledChange(t),e._registerOnDestroy(()=>{n._unregisterOnDisabledChange(t)})}}function Te(n,e){let t=Je(n);e.validator!==null?n.setValidators(ye(t,e.validator)):typeof t=="function"&&n.setValidators([t]);let i=Qe(n);e.asyncValidator!==null?n.setAsyncValidators(ye(i,e.asyncValidator)):typeof i=="function"&&n.setAsyncValidators([i]);let r=()=>n.updateValueAndValidity();De(e._rawValidators,r),De(e._rawAsyncValidators,r)}function ot(n,e){e.valueAccessor.registerOnChange(t=>{n._pendingValue=t,n._pendingChange=!0,n._pendingDirty=!0,n.updateOn==="change"&&Be(n,e)})}function at(n,e){e.valueAccessor.registerOnTouched(()=>{n._pendingTouched=!0,n.updateOn==="blur"&&n._pendingChange&&Be(n,e),n.updateOn!=="submit"&&n.markAsTouched()})}function Be(n,e){n._pendingDirty&&n.markAsDirty(),n.setValue(n._pendingValue,{emitModelToViewChange:!1}),e.viewToModelUpdate(n._pendingValue),n._pendingChange=!1}function lt(n,e){let t=(i,r)=>{e.valueAccessor.writeValue(i),r&&e.viewToModelUpdate(i)};n.registerOnChange(t),e._registerOnDestroy(()=>{n._unregisterOnChange(t)})}function ut(n,e){n==null,Te(n,e)}function dt(n,e){if(!n.hasOwnProperty("model"))return!1;let t=n.model;return t.isFirstChange()?!0:!Object.is(e,t.currentValue)}function ct(n){return Object.getPrototypeOf(n.constructor)===ne}function ht(n,e){n._syncPendingControls(),e.forEach(t=>{let i=t.control;i.updateOn==="submit"&&i._pendingChange&&(t.viewToModelUpdate(i._pendingValue),i._pendingChange=!1)})}function ft(n,e){if(!e)return null;Array.isArray(e);let t,i,r;return e.forEach(s=>{s.constructor===Ee?t=s:ct(s)?i=s:r=s}),r||i||t||null}var pt={provide:V,useExisting:m(()=>gt)},I=Promise.resolve(),gt=(()=>{class n extends V{callSetDisabledState;get submitted(){return f(this.submittedReactive)}_submitted=F(()=>this.submittedReactive());submittedReactive=b(!1);_directives=new Set;form;ngSubmit=new D;options;constructor(t,i,r){super(),this.callSetDisabledState=r,this.form=new $({},ie(t),re(i))}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(t){I.then(()=>{let i=this._findContainer(t.path);t.control=i.registerControl(t.name,t.control),Ge(t.control,t,this.callSetDisabledState),t.control.updateValueAndValidity({emitEvent:!1}),this._directives.add(t)})}getControl(t){return this.form.get(t.path)}removeControl(t){I.then(()=>{this._findContainer(t.path)?.removeControl(t.name),this._directives.delete(t)})}addFormGroup(t){I.then(()=>{let i=this._findContainer(t.path),r=new $({});ut(r,t),i.registerControl(t.name,r),r.updateValueAndValidity({emitEvent:!1})})}removeFormGroup(t){I.then(()=>{this._findContainer(t.path)?.removeControl?.(t.name)})}getFormGroup(t){return this.form.get(t.path)}updateModel(t,i){I.then(()=>{this.form.get(t.path).setValue(i)})}setValue(t){this.control.setValue(t)}onSubmit(t){return this.submittedReactive.set(!0),ht(this.form,this._directives),this.ngSubmit.emit(t),this.form._events.next(new te(this.control)),t?.target?.method==="dialog"}onReset(){this.resetForm()}resetForm(t=void 0){this.form.reset(t),this.submittedReactive.set(!1)}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.form._updateOn=this.options.updateOn)}_findContainer(t){return t.pop(),t.length?this.form.get(t):this.form}static \u0275fac=function(i){return new(i||n)(o(Se,10),o(Ie,10),o(se,8))};static \u0275dir=u({type:n,selectors:[["form",3,"ngNoForm","",3,"formGroup","",3,"formArray",""],["ng-form"],["","ngForm",""]],hostBindings:function(i,r){i&1&&w("submit",function(a){return r.onSubmit(a)})("reset",function(){return r.onReset()})},inputs:{options:[0,"ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],standalone:!1,features:[_([pt]),h]})}return n})();function be(n,e){let t=n.indexOf(e);t>-1&&n.splice(t,1)}function Ae(n){return typeof n=="object"&&n!==null&&Object.keys(n).length===2&&"value"in n&&"disabled"in n}var mt=class extends W{defaultValue=null;_onChange=[];_pendingValue;_pendingChange=!1;constructor(e=null,t,i){super(Pe(t),je(i,t)),this._applyFormState(e),this._setUpdateStrategy(t),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator}),q(t)&&(t.nonNullable||t.initialValueIsDefault)&&(Ae(e)?this.defaultValue=e.value:this.defaultValue=e)}setValue(e,t={}){this.value=this._pendingValue=e,this._onChange.length&&t.emitModelToViewChange!==!1&&this._onChange.forEach(i=>i(this.value,t.emitViewToModelChange!==!1)),this.updateValueAndValidity(t)}patchValue(e,t={}){this.setValue(e,t)}reset(e=this.defaultValue,t={}){this._applyFormState(e),this.markAsPristine(t),this.markAsUntouched(t),this.setValue(this.value,t),t.overwriteDefaultValue&&(this.defaultValue=this.value),this._pendingChange=!1,t?.emitEvent!==!1&&this._events.next(new H(this))}_updateValue(){}_anyControls(e){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(e){this._onChange.push(e)}_unregisterOnChange(e){be(this._onChange,e)}registerOnDisabledChange(e){this._onDisabledChange.push(e)}_unregisterOnDisabledChange(e){be(this._onDisabledChange,e)}_forEachChild(e){}_syncPendingControls(){return this.updateOn==="submit"&&(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),this._pendingChange)?(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),!0):!1}_applyFormState(e){Ae(e)?(this.value=this._pendingValue=e.value,e.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=e}};var vt={provide:R,useExisting:m(()=>_t)},Me=Promise.resolve(),_t=(()=>{class n extends R{_changeDetectorRef;callSetDisabledState;control=new mt;static ngAcceptInputType_isDisabled;_registered=!1;viewModel;name="";isDisabled;model;options;update=new D;constructor(t,i,r,s,a,c){super(),this._changeDetectorRef=a,this.callSetDisabledState=c,this._parent=t,this._setValidators(i),this._setAsyncValidators(r),this.valueAccessor=ft(this,s)}ngOnChanges(t){if(this._checkForErrors(),!this._registered||"name"in t){if(this._registered&&(this._checkName(),this.formDirective)){let i=t.name.previousValue;this.formDirective.removeControl({name:i,path:this._getPath(i)})}this._setUpControl()}"isDisabled"in t&&this._updateDisabled(t),dt(t,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective?.removeControl(this)}get path(){return this._getPath(this.name)}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(t){this.viewModel=t,this.update.emit(t)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!!(this.options&&this.options.standalone)}_setUpStandalone(){Ge(this.control,this,this.callSetDisabledState),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._checkName()}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),!this._isStandalone()&&this.name}_updateValue(t){Me.then(()=>{this.control.setValue(t,{emitViewToModelChange:!1}),this._changeDetectorRef?.markForCheck()})}_updateDisabled(t){let i=t.isDisabled.currentValue,r=i!==0&&me(i);Me.then(()=>{r&&!this.control.disabled?this.control.disable():!r&&this.control.disabled&&this.control.enable(),this._changeDetectorRef?.markForCheck()})}_getPath(t){return this._parent?rt(t,this._parent):[t]}static \u0275fac=function(i){return new(i||n)(o(V,9),o(Se,10),o(Ie,10),o(L,10),o(J,8),o(se,8))};static \u0275dir=u({type:n,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:[0,"disabled","isDisabled"],model:[0,"ngModel","model"],options:[0,"ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],standalone:!1,features:[_([vt]),h,he]})}return n})();var Lt=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275dir=u({type:n,selectors:[["form",3,"ngNoForm","",3,"ngNativeValidate",""]],hostAttrs:["novalidate",""],standalone:!1})}return n})();var yt={provide:L,useExisting:m(()=>He),multi:!0};function Ue(n,e){return n==null?`${e}`:(e&&typeof e=="object"&&(e="Object"),`${n}: ${e}`.slice(0,50))}function Ct(n){return n.split(":")[0]}var He=(()=>{class n extends ne{value;_optionMap=new Map;_idCounter=0;set compareWith(t){this._compareWith=t}_compareWith=Object.is;appRefInjector=g(ge).injector;destroyRef=g(ce);cdr=g(J);_queuedWrite=!1;_writeValueAfterRender(){this._queuedWrite||this.appRefInjector.destroyed||(this._queuedWrite=!0,fe({write:()=>{this.destroyRef.destroyed||(this._queuedWrite=!1,this.writeValue(this.value))}},{injector:this.appRefInjector}))}writeValue(t){this.cdr.markForCheck(),this.value=t;let i=this._getOptionId(t),r=Ue(i,t);this.setProperty("value",r)}registerOnChange(t){this.onChange=i=>{this.value=this._getOptionValue(i),t(this.value)}}_registerOption(){return(this._idCounter++).toString()}_getOptionId(t){for(let i of this._optionMap.keys())if(this._compareWith(this._optionMap.get(i),t))return i;return null}_getOptionValue(t){let i=Ct(t);return this._optionMap.has(i)?this._optionMap.get(i):t}static \u0275fac=(()=>{let t;return function(r){return(t||(t=P(n)))(r||n)}})();static \u0275dir=u({type:n,selectors:[["select","formControlName","",3,"multiple",""],["select","formControl","",3,"multiple",""],["select","ngModel","",3,"multiple",""]],hostBindings:function(i,r){i&1&&w("change",function(a){return r.onChange(a.target.value)})("blur",function(){return r.onTouched()})},inputs:{compareWith:"compareWith"},standalone:!1,features:[_([yt]),h]})}return n})(),qt=(()=>{class n{_element;_renderer;_select;id;constructor(t,i,r){this._element=t,this._renderer=i,this._select=r,this._select&&(this.id=this._select._registerOption())}set ngValue(t){this._select!=null&&(this._select._optionMap.set(this.id,t),this._setElementValue(Ue(this.id,t)),this._select._writeValueAfterRender())}set value(t){this._setElementValue(t),this._select?._writeValueAfterRender()}_setElementValue(t){this._renderer.setProperty(this._element.nativeElement,"value",t)}ngOnDestroy(){this._select?._optionMap.delete(this.id),this._select?._writeValueAfterRender()}static \u0275fac=function(i){return new(i||n)(o(A),o(M),o(He,9))};static \u0275dir=u({type:n,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"},standalone:!1})}return n})(),Vt={provide:L,useExisting:m(()=>We),multi:!0};function we(n,e){return n==null?`${e}`:(typeof e=="string"&&(e=`'${e}'`),e&&typeof e=="object"&&(e="Object"),`${n}: ${e}`.slice(0,50))}function Dt(n){return n.split(":")[0]}var We=(()=>{class n extends ne{value;_optionMap=new Map;_idCounter=0;set compareWith(t){this._compareWith=t}_compareWith=Object.is;writeValue(t){this.value=t;let i;if(Array.isArray(t)){let r=t.map(s=>this._getOptionId(s));i=(s,a)=>{s._setSelected(r.indexOf(a)>-1)}}else i=r=>{r._setSelected(!1)};this._optionMap.forEach(i)}registerOnChange(t){this.onChange=i=>{let r=[],s=i.selectedOptions;if(s!==void 0){let a=s;for(let c=0;c<a.length;c++){let x=a[c],z=this._getOptionValue(x.value);r.push(z)}}else{let a=i.options;for(let c=0;c<a.length;c++){let x=a[c];if(x.selected){let z=this._getOptionValue(x.value);r.push(z)}}}this.value=r,t(r)}}_registerOption(t){let i=(this._idCounter++).toString();return this._optionMap.set(i,t),i}_getOptionId(t){for(let i of this._optionMap.keys())if(this._compareWith(this._optionMap.get(i)._value,t))return i;return null}_getOptionValue(t){let i=Dt(t);return this._optionMap.has(i)?this._optionMap.get(i)._value:t}static \u0275fac=(()=>{let t;return function(r){return(t||(t=P(n)))(r||n)}})();static \u0275dir=u({type:n,selectors:[["select","multiple","","formControlName",""],["select","multiple","","formControl",""],["select","multiple","","ngModel",""]],hostBindings:function(i,r){i&1&&w("change",function(a){return r.onChange(a.target)})("blur",function(){return r.onTouched()})},inputs:{compareWith:"compareWith"},standalone:!1,features:[_([Vt]),h]})}return n})(),zt=(()=>{class n{_element;_renderer;_select;id;_value;constructor(t,i,r){this._element=t,this._renderer=i,this._select=r,this._select&&(this.id=this._select._registerOption(this))}set ngValue(t){this._select!=null&&(this._value=t,this._setElementValue(we(this.id,t)),this._select.writeValue(this._select.value))}set value(t){this._select?(this._value=t,this._setElementValue(we(this.id,t)),this._select.writeValue(this._select.value)):this._setElementValue(t)}_setElementValue(t){this._renderer.setProperty(this._element.nativeElement,"value",t)}_setSelected(t){this._renderer.setProperty(this._element.nativeElement,"selected",t)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))}static \u0275fac=function(i){return new(i||n)(o(A),o(M),o(We,9))};static \u0275dir=u({type:n,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"},standalone:!1})}return n})();var bt=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=Y({type:n});static \u0275inj=X({})}return n})();var Zt=(()=>{class n{static withConfig(t){return{ngModule:n,providers:[{provide:se,useValue:t.callSetDisabledState??oe}]}}static \u0275fac=function(i){return new(i||n)};static \u0275mod=Y({type:n});static \u0275inj=X({imports:[bt]})}return n})();var $e=class n{http=g(ve);projectService=g(_e);params(e={}){let t=this.projectService.currentId;return t?d(l({},e),{project:t}):e}getProjects(){return this.http.get("/api/projects")}getProviders(){return this.http.get("/api/providers",{params:this.params()})}getWorkflows(){return this.http.get("/api/workflows",{params:this.params()})}getWorkflowFolders(){return this.http.get("/api/workflows/folders",{params:this.params()})}createWorkflowFolder(e){return this.http.post("/api/workflows/folders",{path:e},{params:this.params()})}getWorkflow(e){return this.http.get("/api/workflows/detail",{params:this.params({id:e})})}getRuns(){return this.http.get("/api/runs",{params:this.params()})}getRun(e){return this.http.get(`/api/runs/${e}`,{params:this.params()})}getNodeOutput(e,t){return this.http.get(`/api/runs/${e}/nodes/${t}/output`,{params:this.params()})}startRun(e,t,i={}){let r={workflow:e,args:t};i.provider&&(r.provider=i.provider),i.model&&(r.model=i.model);let s=this.projectService.currentId;return s&&(r.project=s),this.http.post("/api/runs",r)}saveWorkflow(e,t){return this.http.put("/api/workflows",{id:e,content:t},{params:this.params()})}resumeRun(e,t){return this.http.post(`/api/runs/${e}/resume`,{message:t},{params:this.params()})}approveRun(e,t){let i=t?{response:t}:{};return this.http.post(`/api/runs/${e}/approve`,i,{params:this.params()})}rejectRun(e,t){return this.http.post(`/api/runs/${e}/reject`,{reason:t},{params:this.params()})}runAction(e,t,i){let r=`/api/runs/${e}${t==="delete"?"":`/${t}`}`;return t==="delete"?this.http.delete(r,{params:this.params()}):this.http.post(r,t==="reject"?{reason:i}:{},{params:this.params()})}listConversations(){return this.http.get("/api/conversations",{params:this.params()})}getConversationMessages(e){return this.http.get(`/api/conversations/${encodeURIComponent(e)}/messages`,{params:this.params()})}sendConversationMessage(e,t){return this.http.post(`/api/conversations/${encodeURIComponent(e)}/messages`,{message:t},{params:this.params()})}getConfig(){return this.http.get("/api/config",{params:this.params()})}updateConfig(e){return this.http.put("/api/config",e,{params:this.params()})}static \u0275fac=function(t){return new(t||n)};static \u0275prov=Z({token:n,factory:n.\u0275fac,providedIn:"root"})};export{Ee as a,Ht as b,Wt as c,gt as d,_t as e,Lt as f,He as g,qt as h,zt as i,Zt as j,$e as k};
|
|
1
|
+
import{$ as D,Ca as Y,Cb as J,Da as u,Ea as h,Eb as me,Fb as Q,G as k,Ha as pe,I as m,J as Z,Ja as ge,K as X,M as v,O as g,Ub as ve,Wb as _e,Ya as w,Z as ce,a as l,b as d,da as b,ea as he,fa as P,g as ae,gb as K,ha as A,j as le,o as ue,pb as _,u as de,ua as fe,wa as M,wb as f,xa as o,xb as F}from"./chunk-4R37VVI4.js";var Fe=(()=>{class n{_renderer;_elementRef;onChange=t=>{};onTouched=()=>{};constructor(t,i){this._renderer=t,this._elementRef=i}setProperty(t,i){this._renderer.setProperty(this._elementRef.nativeElement,t,i)}registerOnTouched(t){this.onTouched=t}registerOnChange(t){this.onChange=t}setDisabledState(t){this.setProperty("disabled",t)}static \u0275fac=function(i){return new(i||n)(o(M),o(A))};static \u0275dir=u({type:n})}return n})(),ne=(()=>{class n extends Fe{static \u0275fac=(()=>{let t;return function(r){return(t||(t=P(n)))(r||n)}})();static \u0275dir=u({type:n,features:[h]})}return n})(),L=new v("");var qe={provide:L,useExisting:m(()=>Ee),multi:!0};function ze(){let n=Q()?Q().getUserAgent():"";return/android (\d+)/.test(n.toLowerCase())}var Ze=new v(""),Ee=(()=>{class n extends Fe{_compositionMode;_composing=!1;constructor(t,i,r){super(t,i),this._compositionMode=r,this._compositionMode==null&&(this._compositionMode=!ze())}writeValue(t){let i=t??"";this.setProperty("value",i)}_handleInput(t){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(t)}_compositionStart(){this._composing=!0}_compositionEnd(t){this._composing=!1,this._compositionMode&&this.onChange(t)}static \u0275fac=function(i){return new(i||n)(o(M),o(A),o(Ze,8))};static \u0275dir=u({type:n,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(i,r){i&1&&w("input",function(a){return r._handleInput(a.target.value)})("blur",function(){return r.onTouched()})("compositionstart",function(){return r._compositionStart()})("compositionend",function(a){return r._compositionEnd(a.target.value)})},standalone:!1,features:[_([qe]),h]})}return n})();var Se=new v(""),Ie=new v("");function Oe(n){return n!=null}function Ne(n){return pe(n)?le(n):n}function Re(n){let e={};return n.forEach(t=>{e=t!=null?l(l({},e),t):e}),Object.keys(e).length===0?null:e}function xe(n,e){return e.map(t=>t(n))}function Xe(n){return!n.validate}function ke(n){return n.map(e=>Xe(e)?e:t=>e.validate(t))}function Ye(n){if(!n)return null;let e=n.filter(Oe);return e.length==0?null:function(t){return Re(xe(t,e))}}function ie(n){return n!=null?Ye(ke(n)):null}function Ke(n){if(!n)return null;let e=n.filter(Oe);return e.length==0?null:function(t){let i=xe(t,e).map(Ne);return de(i).pipe(ue(Re))}}function re(n){return n!=null?Ke(ke(n)):null}function ye(n,e){return n===null?[e]:Array.isArray(n)?[...n,e]:[n,e]}function Je(n){return n._rawValidators}function Qe(n){return n._rawAsyncValidators}function ee(n){return n?Array.isArray(n)?n:[n]:[]}function G(n,e){return Array.isArray(n)?n.includes(e):n===e}function Ce(n,e){let t=ee(e);return ee(n).forEach(r=>{G(t,r)||t.push(r)}),t}function Ve(n,e){return ee(e).filter(t=>!G(n,t))}var T=class{get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators=[];_rawAsyncValidators=[];_setValidators(e){this._rawValidators=e||[],this._composedValidatorFn=ie(this._rawValidators)}_setAsyncValidators(e){this._rawAsyncValidators=e||[],this._composedAsyncValidatorFn=re(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_onDestroyCallbacks=[];_registerOnDestroy(e){this._onDestroyCallbacks.push(e)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(e=>e()),this._onDestroyCallbacks=[]}reset(e=void 0){this.control?.reset(e)}hasError(e,t){return this.control?this.control.hasError(e,t):!1}getError(e,t){return this.control?this.control.getError(e,t):null}},V=class extends T{name;get formDirective(){return null}get path(){return null}},R=class extends T{_parent=null;name=null;valueAccessor=null},B=class{_cd;constructor(e){this._cd=e}get isTouched(){return this._cd?.control?._touched?.(),!!this._cd?.control?.touched}get isUntouched(){return!!this._cd?.control?.untouched}get isPristine(){return this._cd?.control?._pristine?.(),!!this._cd?.control?.pristine}get isDirty(){return!!this._cd?.control?.dirty}get isValid(){return this._cd?.control?._status?.(),!!this._cd?.control?.valid}get isInvalid(){return!!this._cd?.control?.invalid}get isPending(){return!!this._cd?.control?.pending}get isSubmitted(){return this._cd?._submitted?.(),!!this._cd?.submitted}};var Ht=(()=>{class n extends B{constructor(t){super(t)}static \u0275fac=function(i){return new(i||n)(o(R,2))};static \u0275dir=u({type:n,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(i,r){i&2&&K("ng-untouched",r.isUntouched)("ng-touched",r.isTouched)("ng-pristine",r.isPristine)("ng-dirty",r.isDirty)("ng-valid",r.isValid)("ng-invalid",r.isInvalid)("ng-pending",r.isPending)},standalone:!1,features:[h]})}return n})(),Wt=(()=>{class n extends B{constructor(t){super(t)}static \u0275fac=function(i){return new(i||n)(o(V,10))};static \u0275dir=u({type:n,selectors:[["","formGroupName",""],["","formArrayName",""],["","ngModelGroup",""],["","formGroup",""],["","formArray",""],["form",3,"ngNoForm",""],["","ngForm",""]],hostVars:16,hostBindings:function(i,r){i&2&&K("ng-untouched",r.isUntouched)("ng-touched",r.isTouched)("ng-pristine",r.isPristine)("ng-dirty",r.isDirty)("ng-valid",r.isValid)("ng-invalid",r.isInvalid)("ng-pending",r.isPending)("ng-submitted",r.isSubmitted)},standalone:!1,features:[h]})}return n})();var E="VALID",j="INVALID",y="PENDING",S="DISABLED",p=class{},U=class extends p{value;source;constructor(e,t){super(),this.value=e,this.source=t}},O=class extends p{pristine;source;constructor(e,t){super(),this.pristine=e,this.source=t}},N=class extends p{touched;source;constructor(e,t){super(),this.touched=e,this.source=t}},C=class extends p{status;source;constructor(e,t){super(),this.status=e,this.source=t}},te=class extends p{source;constructor(e){super(),this.source=e}},H=class extends p{source;constructor(e){super(),this.source=e}};function Pe(n){return(q(n)?n.validators:n)||null}function et(n){return Array.isArray(n)?ie(n):n||null}function je(n,e){return(q(e)?e.asyncValidators:n)||null}function tt(n){return Array.isArray(n)?re(n):n||null}function q(n){return n!=null&&!Array.isArray(n)&&typeof n=="object"}function nt(n,e,t){let i=n.controls;if(!(e?Object.keys(i):i).length)throw new k(1e3,"");if(!i[t])throw new k(1001,"")}function it(n,e,t){n._forEachChild((i,r)=>{if(t[r]===void 0)throw new k(-1002,"")})}var W=class{_pendingDirty=!1;_hasOwnPendingAsyncValidator=null;_pendingTouched=!1;_onCollectionChange=()=>{};_updateOn;_parent=null;_asyncValidationSubscription;_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators;_rawAsyncValidators;value;constructor(e,t){this._assignValidators(e),this._assignAsyncValidators(t)}get validator(){return this._composedValidatorFn}set validator(e){this._rawValidators=this._composedValidatorFn=e}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(e){this._rawAsyncValidators=this._composedAsyncValidatorFn=e}get parent(){return this._parent}get status(){return f(this.statusReactive)}set status(e){f(()=>this.statusReactive.set(e))}_status=F(()=>this.statusReactive());statusReactive=b(void 0);get valid(){return this.status===E}get invalid(){return this.status===j}get pending(){return this.status===y}get disabled(){return this.status===S}get enabled(){return this.status!==S}errors;get pristine(){return f(this.pristineReactive)}set pristine(e){f(()=>this.pristineReactive.set(e))}_pristine=F(()=>this.pristineReactive());pristineReactive=b(!0);get dirty(){return!this.pristine}get touched(){return f(this.touchedReactive)}set touched(e){f(()=>this.touchedReactive.set(e))}_touched=F(()=>this.touchedReactive());touchedReactive=b(!1);get untouched(){return!this.touched}_events=new ae;events=this._events.asObservable();valueChanges;statusChanges;get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(e){this._assignValidators(e)}setAsyncValidators(e){this._assignAsyncValidators(e)}addValidators(e){this.setValidators(Ce(e,this._rawValidators))}addAsyncValidators(e){this.setAsyncValidators(Ce(e,this._rawAsyncValidators))}removeValidators(e){this.setValidators(Ve(e,this._rawValidators))}removeAsyncValidators(e){this.setAsyncValidators(Ve(e,this._rawAsyncValidators))}hasValidator(e){return G(this._rawValidators,e)}hasAsyncValidator(e){return G(this._rawAsyncValidators,e)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(e={}){let t=this.touched===!1;this.touched=!0;let i=e.sourceControl??this;e.onlySelf||this._parent?.markAsTouched(d(l({},e),{sourceControl:i})),t&&e.emitEvent!==!1&&this._events.next(new N(!0,i))}markAllAsDirty(e={}){this.markAsDirty({onlySelf:!0,emitEvent:e.emitEvent,sourceControl:this}),this._forEachChild(t=>t.markAllAsDirty(e))}markAllAsTouched(e={}){this.markAsTouched({onlySelf:!0,emitEvent:e.emitEvent,sourceControl:this}),this._forEachChild(t=>t.markAllAsTouched(e))}markAsUntouched(e={}){let t=this.touched===!0;this.touched=!1,this._pendingTouched=!1;let i=e.sourceControl??this;this._forEachChild(r=>{r.markAsUntouched({onlySelf:!0,emitEvent:e.emitEvent,sourceControl:i})}),e.onlySelf||this._parent?._updateTouched(e,i),t&&e.emitEvent!==!1&&this._events.next(new N(!1,i))}markAsDirty(e={}){let t=this.pristine===!0;this.pristine=!1;let i=e.sourceControl??this;e.onlySelf||this._parent?.markAsDirty(d(l({},e),{sourceControl:i})),t&&e.emitEvent!==!1&&this._events.next(new O(!1,i))}markAsPristine(e={}){let t=this.pristine===!1;this.pristine=!0,this._pendingDirty=!1;let i=e.sourceControl??this;this._forEachChild(r=>{r.markAsPristine({onlySelf:!0,emitEvent:e.emitEvent})}),e.onlySelf||this._parent?._updatePristine(e,i),t&&e.emitEvent!==!1&&this._events.next(new O(!0,i))}markAsPending(e={}){this.status=y;let t=e.sourceControl??this;e.emitEvent!==!1&&(this._events.next(new C(this.status,t)),this.statusChanges.emit(this.status)),e.onlySelf||this._parent?.markAsPending(d(l({},e),{sourceControl:t}))}disable(e={}){let t=this._parentMarkedDirty(e.onlySelf);this.status=S,this.errors=null,this._forEachChild(r=>{r.disable(d(l({},e),{onlySelf:!0}))}),this._updateValue();let i=e.sourceControl??this;e.emitEvent!==!1&&(this._events.next(new U(this.value,i)),this._events.next(new C(this.status,i)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(d(l({},e),{skipPristineCheck:t}),this),this._onDisabledChange.forEach(r=>r(!0))}enable(e={}){let t=this._parentMarkedDirty(e.onlySelf);this.status=E,this._forEachChild(i=>{i.enable(d(l({},e),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent}),this._updateAncestors(d(l({},e),{skipPristineCheck:t}),this),this._onDisabledChange.forEach(i=>i(!1))}_updateAncestors(e,t){e.onlySelf||(this._parent?.updateValueAndValidity(e),e.skipPristineCheck||this._parent?._updatePristine({},t),this._parent?._updateTouched({},t))}setParent(e){this._parent=e}getRawValue(){return this.value}updateValueAndValidity(e={}){if(this._setInitialStatus(),this._updateValue(),this.enabled){let i=this._cancelExistingSubscription();this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===E||this.status===y)&&this._runAsyncValidator(i,e.emitEvent)}let t=e.sourceControl??this;e.emitEvent!==!1&&(this._events.next(new U(this.value,t)),this._events.next(new C(this.status,t)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),e.onlySelf||this._parent?.updateValueAndValidity(d(l({},e),{sourceControl:t}))}_updateTreeValidity(e={emitEvent:!0}){this._forEachChild(t=>t._updateTreeValidity(e)),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?S:E}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(e,t){if(this.asyncValidator){this.status=y,this._hasOwnPendingAsyncValidator={emitEvent:t!==!1,shouldHaveEmitted:e!==!1};let i=Ne(this.asyncValidator(this));this._asyncValidationSubscription=i.subscribe(r=>{this._hasOwnPendingAsyncValidator=null,this.setErrors(r,{emitEvent:t,shouldHaveEmitted:e})})}}_cancelExistingSubscription(){if(this._asyncValidationSubscription){this._asyncValidationSubscription.unsubscribe();let e=(this._hasOwnPendingAsyncValidator?.emitEvent||this._hasOwnPendingAsyncValidator?.shouldHaveEmitted)??!1;return this._hasOwnPendingAsyncValidator=null,e}return!1}setErrors(e,t={}){this.errors=e,this._updateControlsErrors(t.emitEvent!==!1,this,t.shouldHaveEmitted)}get(e){let t=e;return t==null||(Array.isArray(t)||(t=t.split(".")),t.length===0)?null:t.reduce((i,r)=>i&&i._find(r),this)}getError(e,t){let i=t?this.get(t):this;return i?.errors?i.errors[e]:null}hasError(e,t){return!!this.getError(e,t)}get root(){let e=this;for(;e._parent;)e=e._parent;return e}_updateControlsErrors(e,t,i){this.status=this._calculateStatus(),e&&this.statusChanges.emit(this.status),(e||i)&&this._events.next(new C(this.status,t)),this._parent&&this._parent._updateControlsErrors(e,t,i)}_initObservables(){this.valueChanges=new D,this.statusChanges=new D}_calculateStatus(){return this._allControlsDisabled()?S:this.errors?j:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(y)?y:this._anyControlsHaveStatus(j)?j:E}_anyControlsHaveStatus(e){return this._anyControls(t=>t.status===e)}_anyControlsDirty(){return this._anyControls(e=>e.dirty)}_anyControlsTouched(){return this._anyControls(e=>e.touched)}_updatePristine(e,t){let i=!this._anyControlsDirty(),r=this.pristine!==i;this.pristine=i,e.onlySelf||this._parent?._updatePristine(e,t),r&&this._events.next(new O(this.pristine,t))}_updateTouched(e={},t){this.touched=this._anyControlsTouched(),this._events.next(new N(this.touched,t)),e.onlySelf||this._parent?._updateTouched(e,t)}_onDisabledChange=[];_registerOnCollectionChange(e){this._onCollectionChange=e}_setUpdateStrategy(e){q(e)&&e.updateOn!=null&&(this._updateOn=e.updateOn)}_parentMarkedDirty(e){return!e&&!!this._parent?.dirty&&!this._parent._anyControlsDirty()}_find(e){return null}_assignValidators(e){this._rawValidators=Array.isArray(e)?e.slice():e,this._composedValidatorFn=et(this._rawValidators)}_assignAsyncValidators(e){this._rawAsyncValidators=Array.isArray(e)?e.slice():e,this._composedAsyncValidatorFn=tt(this._rawAsyncValidators)}},$=class extends W{constructor(e,t,i){super(Pe(t),je(i,t)),this.controls=e,this._initObservables(),this._setUpdateStrategy(t),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}controls;registerControl(e,t){return this.controls[e]?this.controls[e]:(this.controls[e]=t,t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange),t)}addControl(e,t,i={}){this.registerControl(e,t),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}removeControl(e,t={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],this.updateValueAndValidity({emitEvent:t.emitEvent}),this._onCollectionChange()}setControl(e,t,i={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],t&&this.registerControl(e,t),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}contains(e){return this.controls.hasOwnProperty(e)&&this.controls[e].enabled}setValue(e,t={}){it(this,!0,e),Object.keys(e).forEach(i=>{nt(this,!0,i),this.controls[i].setValue(e[i],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}patchValue(e,t={}){e!=null&&(Object.keys(e).forEach(i=>{let r=this.controls[i];r&&r.patchValue(e[i],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t))}reset(e={},t={}){this._forEachChild((i,r)=>{i.reset(e?e[r]:null,d(l({},t),{onlySelf:!0}))}),this._updatePristine(t,this),this._updateTouched(t,this),this.updateValueAndValidity(t),t?.emitEvent!==!1&&this._events.next(new H(this))}getRawValue(){return this._reduceChildren({},(e,t,i)=>(e[i]=t.getRawValue(),e))}_syncPendingControls(){let e=this._reduceChildren(!1,(t,i)=>i._syncPendingControls()?!0:t);return e&&this.updateValueAndValidity({onlySelf:!0}),e}_forEachChild(e){Object.keys(this.controls).forEach(t=>{let i=this.controls[t];i&&e(i,t)})}_setUpControls(){this._forEachChild(e=>{e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(e){for(let[t,i]of Object.entries(this.controls))if(this.contains(t)&&e(i))return!0;return!1}_reduceValue(){let e={};return this._reduceChildren(e,(t,i,r)=>((i.enabled||this.disabled)&&(t[r]=i.value),t))}_reduceChildren(e,t){let i=e;return this._forEachChild((r,s)=>{i=t(i,r,s)}),i}_allControlsDisabled(){for(let e of Object.keys(this.controls))if(this.controls[e].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_find(e){return this.controls.hasOwnProperty(e)?this.controls[e]:null}};var se=new v("",{factory:()=>oe}),oe="always";function rt(n,e){return[...e.path,n]}function Ge(n,e,t=oe){Te(n,e),e.valueAccessor.writeValue(n.value),(n.disabled||t==="always")&&e.valueAccessor.setDisabledState?.(n.disabled),ot(n,e),lt(n,e),at(n,e),st(n,e)}function De(n,e){n.forEach(t=>{t.registerOnValidatorChange&&t.registerOnValidatorChange(e)})}function st(n,e){if(e.valueAccessor.setDisabledState){let t=i=>{e.valueAccessor.setDisabledState(i)};n.registerOnDisabledChange(t),e._registerOnDestroy(()=>{n._unregisterOnDisabledChange(t)})}}function Te(n,e){let t=Je(n);e.validator!==null?n.setValidators(ye(t,e.validator)):typeof t=="function"&&n.setValidators([t]);let i=Qe(n);e.asyncValidator!==null?n.setAsyncValidators(ye(i,e.asyncValidator)):typeof i=="function"&&n.setAsyncValidators([i]);let r=()=>n.updateValueAndValidity();De(e._rawValidators,r),De(e._rawAsyncValidators,r)}function ot(n,e){e.valueAccessor.registerOnChange(t=>{n._pendingValue=t,n._pendingChange=!0,n._pendingDirty=!0,n.updateOn==="change"&&Be(n,e)})}function at(n,e){e.valueAccessor.registerOnTouched(()=>{n._pendingTouched=!0,n.updateOn==="blur"&&n._pendingChange&&Be(n,e),n.updateOn!=="submit"&&n.markAsTouched()})}function Be(n,e){n._pendingDirty&&n.markAsDirty(),n.setValue(n._pendingValue,{emitModelToViewChange:!1}),e.viewToModelUpdate(n._pendingValue),n._pendingChange=!1}function lt(n,e){let t=(i,r)=>{e.valueAccessor.writeValue(i),r&&e.viewToModelUpdate(i)};n.registerOnChange(t),e._registerOnDestroy(()=>{n._unregisterOnChange(t)})}function ut(n,e){n==null,Te(n,e)}function dt(n,e){if(!n.hasOwnProperty("model"))return!1;let t=n.model;return t.isFirstChange()?!0:!Object.is(e,t.currentValue)}function ct(n){return Object.getPrototypeOf(n.constructor)===ne}function ht(n,e){n._syncPendingControls(),e.forEach(t=>{let i=t.control;i.updateOn==="submit"&&i._pendingChange&&(t.viewToModelUpdate(i._pendingValue),i._pendingChange=!1)})}function ft(n,e){if(!e)return null;Array.isArray(e);let t,i,r;return e.forEach(s=>{s.constructor===Ee?t=s:ct(s)?i=s:r=s}),r||i||t||null}var pt={provide:V,useExisting:m(()=>gt)},I=Promise.resolve(),gt=(()=>{class n extends V{callSetDisabledState;get submitted(){return f(this.submittedReactive)}_submitted=F(()=>this.submittedReactive());submittedReactive=b(!1);_directives=new Set;form;ngSubmit=new D;options;constructor(t,i,r){super(),this.callSetDisabledState=r,this.form=new $({},ie(t),re(i))}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(t){I.then(()=>{let i=this._findContainer(t.path);t.control=i.registerControl(t.name,t.control),Ge(t.control,t,this.callSetDisabledState),t.control.updateValueAndValidity({emitEvent:!1}),this._directives.add(t)})}getControl(t){return this.form.get(t.path)}removeControl(t){I.then(()=>{this._findContainer(t.path)?.removeControl(t.name),this._directives.delete(t)})}addFormGroup(t){I.then(()=>{let i=this._findContainer(t.path),r=new $({});ut(r,t),i.registerControl(t.name,r),r.updateValueAndValidity({emitEvent:!1})})}removeFormGroup(t){I.then(()=>{this._findContainer(t.path)?.removeControl?.(t.name)})}getFormGroup(t){return this.form.get(t.path)}updateModel(t,i){I.then(()=>{this.form.get(t.path).setValue(i)})}setValue(t){this.control.setValue(t)}onSubmit(t){return this.submittedReactive.set(!0),ht(this.form,this._directives),this.ngSubmit.emit(t),this.form._events.next(new te(this.control)),t?.target?.method==="dialog"}onReset(){this.resetForm()}resetForm(t=void 0){this.form.reset(t),this.submittedReactive.set(!1)}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.form._updateOn=this.options.updateOn)}_findContainer(t){return t.pop(),t.length?this.form.get(t):this.form}static \u0275fac=function(i){return new(i||n)(o(Se,10),o(Ie,10),o(se,8))};static \u0275dir=u({type:n,selectors:[["form",3,"ngNoForm","",3,"formGroup","",3,"formArray",""],["ng-form"],["","ngForm",""]],hostBindings:function(i,r){i&1&&w("submit",function(a){return r.onSubmit(a)})("reset",function(){return r.onReset()})},inputs:{options:[0,"ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],standalone:!1,features:[_([pt]),h]})}return n})();function be(n,e){let t=n.indexOf(e);t>-1&&n.splice(t,1)}function Ae(n){return typeof n=="object"&&n!==null&&Object.keys(n).length===2&&"value"in n&&"disabled"in n}var mt=class extends W{defaultValue=null;_onChange=[];_pendingValue;_pendingChange=!1;constructor(e=null,t,i){super(Pe(t),je(i,t)),this._applyFormState(e),this._setUpdateStrategy(t),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator}),q(t)&&(t.nonNullable||t.initialValueIsDefault)&&(Ae(e)?this.defaultValue=e.value:this.defaultValue=e)}setValue(e,t={}){this.value=this._pendingValue=e,this._onChange.length&&t.emitModelToViewChange!==!1&&this._onChange.forEach(i=>i(this.value,t.emitViewToModelChange!==!1)),this.updateValueAndValidity(t)}patchValue(e,t={}){this.setValue(e,t)}reset(e=this.defaultValue,t={}){this._applyFormState(e),this.markAsPristine(t),this.markAsUntouched(t),this.setValue(this.value,t),t.overwriteDefaultValue&&(this.defaultValue=this.value),this._pendingChange=!1,t?.emitEvent!==!1&&this._events.next(new H(this))}_updateValue(){}_anyControls(e){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(e){this._onChange.push(e)}_unregisterOnChange(e){be(this._onChange,e)}registerOnDisabledChange(e){this._onDisabledChange.push(e)}_unregisterOnDisabledChange(e){be(this._onDisabledChange,e)}_forEachChild(e){}_syncPendingControls(){return this.updateOn==="submit"&&(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),this._pendingChange)?(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),!0):!1}_applyFormState(e){Ae(e)?(this.value=this._pendingValue=e.value,e.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=e}};var vt={provide:R,useExisting:m(()=>_t)},Me=Promise.resolve(),_t=(()=>{class n extends R{_changeDetectorRef;callSetDisabledState;control=new mt;static ngAcceptInputType_isDisabled;_registered=!1;viewModel;name="";isDisabled;model;options;update=new D;constructor(t,i,r,s,a,c){super(),this._changeDetectorRef=a,this.callSetDisabledState=c,this._parent=t,this._setValidators(i),this._setAsyncValidators(r),this.valueAccessor=ft(this,s)}ngOnChanges(t){if(this._checkForErrors(),!this._registered||"name"in t){if(this._registered&&(this._checkName(),this.formDirective)){let i=t.name.previousValue;this.formDirective.removeControl({name:i,path:this._getPath(i)})}this._setUpControl()}"isDisabled"in t&&this._updateDisabled(t),dt(t,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective?.removeControl(this)}get path(){return this._getPath(this.name)}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(t){this.viewModel=t,this.update.emit(t)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!!(this.options&&this.options.standalone)}_setUpStandalone(){Ge(this.control,this,this.callSetDisabledState),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._checkName()}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),!this._isStandalone()&&this.name}_updateValue(t){Me.then(()=>{this.control.setValue(t,{emitViewToModelChange:!1}),this._changeDetectorRef?.markForCheck()})}_updateDisabled(t){let i=t.isDisabled.currentValue,r=i!==0&&me(i);Me.then(()=>{r&&!this.control.disabled?this.control.disable():!r&&this.control.disabled&&this.control.enable(),this._changeDetectorRef?.markForCheck()})}_getPath(t){return this._parent?rt(t,this._parent):[t]}static \u0275fac=function(i){return new(i||n)(o(V,9),o(Se,10),o(Ie,10),o(L,10),o(J,8),o(se,8))};static \u0275dir=u({type:n,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:[0,"disabled","isDisabled"],model:[0,"ngModel","model"],options:[0,"ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],standalone:!1,features:[_([vt]),h,he]})}return n})();var Lt=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275dir=u({type:n,selectors:[["form",3,"ngNoForm","",3,"ngNativeValidate",""]],hostAttrs:["novalidate",""],standalone:!1})}return n})();var yt={provide:L,useExisting:m(()=>He),multi:!0};function Ue(n,e){return n==null?`${e}`:(e&&typeof e=="object"&&(e="Object"),`${n}: ${e}`.slice(0,50))}function Ct(n){return n.split(":")[0]}var He=(()=>{class n extends ne{value;_optionMap=new Map;_idCounter=0;set compareWith(t){this._compareWith=t}_compareWith=Object.is;appRefInjector=g(ge).injector;destroyRef=g(ce);cdr=g(J);_queuedWrite=!1;_writeValueAfterRender(){this._queuedWrite||this.appRefInjector.destroyed||(this._queuedWrite=!0,fe({write:()=>{this.destroyRef.destroyed||(this._queuedWrite=!1,this.writeValue(this.value))}},{injector:this.appRefInjector}))}writeValue(t){this.cdr.markForCheck(),this.value=t;let i=this._getOptionId(t),r=Ue(i,t);this.setProperty("value",r)}registerOnChange(t){this.onChange=i=>{this.value=this._getOptionValue(i),t(this.value)}}_registerOption(){return(this._idCounter++).toString()}_getOptionId(t){for(let i of this._optionMap.keys())if(this._compareWith(this._optionMap.get(i),t))return i;return null}_getOptionValue(t){let i=Ct(t);return this._optionMap.has(i)?this._optionMap.get(i):t}static \u0275fac=(()=>{let t;return function(r){return(t||(t=P(n)))(r||n)}})();static \u0275dir=u({type:n,selectors:[["select","formControlName","",3,"multiple",""],["select","formControl","",3,"multiple",""],["select","ngModel","",3,"multiple",""]],hostBindings:function(i,r){i&1&&w("change",function(a){return r.onChange(a.target.value)})("blur",function(){return r.onTouched()})},inputs:{compareWith:"compareWith"},standalone:!1,features:[_([yt]),h]})}return n})(),qt=(()=>{class n{_element;_renderer;_select;id;constructor(t,i,r){this._element=t,this._renderer=i,this._select=r,this._select&&(this.id=this._select._registerOption())}set ngValue(t){this._select!=null&&(this._select._optionMap.set(this.id,t),this._setElementValue(Ue(this.id,t)),this._select._writeValueAfterRender())}set value(t){this._setElementValue(t),this._select?._writeValueAfterRender()}_setElementValue(t){this._renderer.setProperty(this._element.nativeElement,"value",t)}ngOnDestroy(){this._select?._optionMap.delete(this.id),this._select?._writeValueAfterRender()}static \u0275fac=function(i){return new(i||n)(o(A),o(M),o(He,9))};static \u0275dir=u({type:n,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"},standalone:!1})}return n})(),Vt={provide:L,useExisting:m(()=>We),multi:!0};function we(n,e){return n==null?`${e}`:(typeof e=="string"&&(e=`'${e}'`),e&&typeof e=="object"&&(e="Object"),`${n}: ${e}`.slice(0,50))}function Dt(n){return n.split(":")[0]}var We=(()=>{class n extends ne{value;_optionMap=new Map;_idCounter=0;set compareWith(t){this._compareWith=t}_compareWith=Object.is;writeValue(t){this.value=t;let i;if(Array.isArray(t)){let r=t.map(s=>this._getOptionId(s));i=(s,a)=>{s._setSelected(r.indexOf(a)>-1)}}else i=r=>{r._setSelected(!1)};this._optionMap.forEach(i)}registerOnChange(t){this.onChange=i=>{let r=[],s=i.selectedOptions;if(s!==void 0){let a=s;for(let c=0;c<a.length;c++){let x=a[c],z=this._getOptionValue(x.value);r.push(z)}}else{let a=i.options;for(let c=0;c<a.length;c++){let x=a[c];if(x.selected){let z=this._getOptionValue(x.value);r.push(z)}}}this.value=r,t(r)}}_registerOption(t){let i=(this._idCounter++).toString();return this._optionMap.set(i,t),i}_getOptionId(t){for(let i of this._optionMap.keys())if(this._compareWith(this._optionMap.get(i)._value,t))return i;return null}_getOptionValue(t){let i=Dt(t);return this._optionMap.has(i)?this._optionMap.get(i)._value:t}static \u0275fac=(()=>{let t;return function(r){return(t||(t=P(n)))(r||n)}})();static \u0275dir=u({type:n,selectors:[["select","multiple","","formControlName",""],["select","multiple","","formControl",""],["select","multiple","","ngModel",""]],hostBindings:function(i,r){i&1&&w("change",function(a){return r.onChange(a.target)})("blur",function(){return r.onTouched()})},inputs:{compareWith:"compareWith"},standalone:!1,features:[_([Vt]),h]})}return n})(),zt=(()=>{class n{_element;_renderer;_select;id;_value;constructor(t,i,r){this._element=t,this._renderer=i,this._select=r,this._select&&(this.id=this._select._registerOption(this))}set ngValue(t){this._select!=null&&(this._value=t,this._setElementValue(we(this.id,t)),this._select.writeValue(this._select.value))}set value(t){this._select?(this._value=t,this._setElementValue(we(this.id,t)),this._select.writeValue(this._select.value)):this._setElementValue(t)}_setElementValue(t){this._renderer.setProperty(this._element.nativeElement,"value",t)}_setSelected(t){this._renderer.setProperty(this._element.nativeElement,"selected",t)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))}static \u0275fac=function(i){return new(i||n)(o(A),o(M),o(We,9))};static \u0275dir=u({type:n,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"},standalone:!1})}return n})();var bt=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=Y({type:n});static \u0275inj=X({})}return n})();var Zt=(()=>{class n{static withConfig(t){return{ngModule:n,providers:[{provide:se,useValue:t.callSetDisabledState??oe}]}}static \u0275fac=function(i){return new(i||n)};static \u0275mod=Y({type:n});static \u0275inj=X({imports:[bt]})}return n})();var $e=class n{http=g(ve);projectService=g(_e);params(e={}){let t=this.projectService.currentId;return t?d(l({},e),{project:t}):e}getProjects(){return this.http.get("/api/projects")}getProviders(){return this.http.get("/api/providers",{params:this.params()})}getWorkflows(){return this.http.get("/api/workflows",{params:this.params()})}getWorkflowFolders(){return this.http.get("/api/workflows/folders",{params:this.params()})}createWorkflowFolder(e){return this.http.post("/api/workflows/folders",{path:e},{params:this.params()})}getWorkflow(e){return this.http.get("/api/workflows/detail",{params:this.params({id:e})})}getRuns(){return this.http.get("/api/runs",{params:this.params()})}getRun(e){return this.http.get(`/api/runs/${e}`,{params:this.params()})}getNodeOutput(e,t){return this.http.get(`/api/runs/${e}/nodes/${t}/output`,{params:this.params()})}startRun(e,t,i={}){let r={workflow:e,args:t};i.provider&&(r.provider=i.provider),i.model&&(r.model=i.model);let s=this.projectService.currentId;return s&&(r.project=s),this.http.post("/api/runs",r)}saveWorkflow(e,t){return this.http.put("/api/workflows",{id:e,content:t},{params:this.params()})}resumeRun(e,t){return this.http.post(`/api/runs/${e}/resume`,{message:t},{params:this.params()})}approveRun(e,t){let i=t?{response:t}:{};return this.http.post(`/api/runs/${e}/approve`,i,{params:this.params()})}rejectRun(e,t){return this.http.post(`/api/runs/${e}/reject`,{reason:t},{params:this.params()})}runAction(e,t,i){let r=`/api/runs/${e}${t==="delete"?"":`/${t}`}`;return t==="delete"?this.http.delete(r,{params:this.params()}):this.http.post(r,t==="reject"?{reason:i}:{},{params:this.params()})}listConversations(){return this.http.get("/api/conversations",{params:this.params()})}getConversationMessages(e){return this.http.get(`/api/conversations/${encodeURIComponent(e)}/messages`,{params:this.params()})}sendConversationMessage(e,t){return this.http.post(`/api/conversations/${encodeURIComponent(e)}/messages`,{message:t},{params:this.params()})}getConfig(){return this.http.get("/api/config",{params:this.params()})}updateConfig(e){return this.http.put("/api/config",e,{params:this.params()})}static \u0275fac=function(t){return new(t||n)};static \u0275prov=Z({token:n,factory:n.\u0275fac,providedIn:"root"})};export{Ee as a,Ht as b,Wt as c,gt as d,_t as e,Lt as f,He as g,qt as h,zt as i,Zt as j,$e as k};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as D,d as T,e as L}from"./chunk-
|
|
1
|
+
import{b as D,d as T,e as L}from"./chunk-N3FOQ3O5.js";import{a as F,b as V,c as A,d as H,e as K,f as z,j as W,k as B}from"./chunk-7ELOO4IC.js";import{Ba as S,Ka as x,La as g,Ma as f,O as u,Oa as v,Pa as C,Qa as _,Qb as R,Ra as o,Sa as a,T as y,U as h,Xa as k,Ya as w,Za as d,da as m,gb as O,ib as r,jb as p,lb as P,mb as I,nb as E,ob as N,qa as s}from"./chunk-4R37VVI4.js";function $(t){let n=t.metadata?.category;return n==="gate"?"gate":n==="workflow_status"?"status":"text"}function j(t){return t.title?t.title:t.runs.length>0?t.runs[0].workflow_name:t.id}function b(t){return t.runs.length?t.runs[t.runs.length-1].id:void 0}var M=(t,n)=>n.id;function q(t,n){t&1&&(o(0,"p",2),r(1,"No conversations yet. Start a run or send a message."),a())}function J(t,n){if(t&1&&(o(0,"span",8),r(1),a()),t&2){let e=n.$implicit;x("data-status",e.status),s(),P("",e.workflow_name," \xB7 ",e.status)}}function Q(t,n){if(t&1&&(o(0,"a",5)(1,"span",6),r(2),a(),o(3,"span",7),v(4,J,2,3,"span",8,M),a()()),t&2){let e=n.$implicit,i=d();O("active",e.id===i.selectedId()),_("routerLink",i.linkFor(e)),s(2),p(i.label(e)),s(2),C(e.runs)}}function X(t,n){t&1&&(o(0,"p",2),r(1,"Select a conversation to view its messages."),a())}function Y(t,n){if(t&1&&(o(0,"div",10)(1,"span",15),r(2),a(),o(3,"p",16),r(4),a()()),t&2){let e=n.$implicit,i=d(2);x("data-role",e.role)("data-kind",i.kind(e)),s(2),p(e.role),s(2),p(e.content)}}function Z(t,n){if(t&1&&(o(0,"p",14),r(1),a()),t&2){let e=d(2);s(),p(e.lastReply())}}function ee(t,n){if(t&1){let e=k();o(0,"div",9),v(1,Y,5,4,"div",10,M),a(),o(3,"form",11),w("ngSubmit",function(){y(e);let l=d();return h(l.send())}),o(4,"input",12),N("ngModelChange",function(l){y(e);let c=d();return E(c.draft,l)||(c.draft=l),h(l)}),a(),o(5,"button",13),r(6,"Send"),a()(),g(7,Z,2,1,"p",14)}if(t&2){let e=d();s(),C(e.messages()),s(3),I("ngModel",e.draft),_("disabled",e.sending()),s(),_("disabled",e.sending()||!e.draft.trim()),s(2),f(e.lastReply()?7:-1)}}var G=class t{api=u(B);route=u(D);router=u(T);pollHandle;paramSub;conversations=m([]);messages=m([]);selectedId=m(null);sending=m(!1);lastReply=m("");draft="";ngOnInit(){this.paramSub=this.route.paramMap.subscribe(n=>{let e=n.get("conversationId");this.selectedId.set(e),this.refresh(),e&&this.api.listConversations().subscribe(i=>{let l=i.conversations.find(U=>U.id===e),c=l?b(l):void 0;c&&this.router.navigate(["/runs",c],{replaceUrl:!0})})}),this.pollHandle=setInterval(()=>this.refreshMessages(),4e3)}ngOnDestroy(){this.pollHandle&&clearInterval(this.pollHandle),this.paramSub?.unsubscribe()}label=j;kind=$;linkFor(n){let e=b(n);return e?["/runs",e]:["/conversations",n.id]}refresh(){this.api.listConversations().subscribe(n=>this.conversations.set(n.conversations)),this.refreshMessages()}refreshMessages(){let n=this.selectedId();n&&this.api.getConversationMessages(n).subscribe({next:e=>this.messages.set(e.messages),error:()=>this.messages.set([])})}send(){let n=this.selectedId(),e=this.draft.trim();!n||!e||(this.sending.set(!0),this.api.sendConversationMessage(n,e).subscribe({next:i=>{this.lastReply.set(i.reply),this.draft="",this.sending.set(!1),this.refresh()},error:()=>this.sending.set(!1)}))}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=S({type:t,selectors:[["app-conversations"]],decls:10,vars:2,consts:[[1,"conversations-layout"],[1,"conversations-sidebar"],[1,"empty"],[1,"conversation-item",3,"active","routerLink"],[1,"chat-panel"],[1,"conversation-item",3,"routerLink"],[1,"conversation-title"],[1,"conversation-meta"],[1,"run-chip"],[1,"message-list"],[1,"message"],[1,"message-input",3,"ngSubmit"],["type","text","name","draft","placeholder","Reply to the paused run or leave a note\u2026","aria-label","Message",3,"ngModelChange","ngModel","disabled"],["type","submit",3,"disabled"],[1,"chat-hint"],[1,"message-role"],[1,"message-content"]],template:function(e,i){e&1&&(o(0,"div",0)(1,"aside",1)(2,"h2"),r(3,"Conversations"),a(),g(4,q,2,0,"p",2),v(5,Q,6,4,"a",3,M),a(),o(7,"section",4),g(8,X,2,0,"p",2)(9,ee,8,4),a()()),e&2&&(s(4),f(i.conversations().length===0?4:-1),s(),C(i.conversations()),s(3),f(i.selectedId()?9:8))},dependencies:[R,W,z,F,V,A,K,H,L],styles:[".conversations-layout[_ngcontent-%COMP%]{display:flex;gap:1rem;min-height:70vh}.conversations-sidebar[_ngcontent-%COMP%]{width:280px;border-right:1px solid var(--border-color, #333);padding-right:1rem}.conversation-item[_ngcontent-%COMP%]{display:block;padding:.5rem;border-radius:6px;text-decoration:none;color:inherit}.conversation-item.active[_ngcontent-%COMP%]{background:#8080ff1f}.conversation-title[_ngcontent-%COMP%]{display:block;font-weight:600}.run-chip[_ngcontent-%COMP%]{font-size:.75rem;opacity:.75;margin-right:.5rem}.chat-panel[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column}.message-list[_ngcontent-%COMP%]{flex:1;overflow-y:auto;display:flex;flex-direction:column;gap:.5rem}.message[_ngcontent-%COMP%]{max-width:70%;padding:.5rem .75rem;border-radius:8px;background:#8080801f}.message[data-role=user][_ngcontent-%COMP%]{align-self:flex-end;background:#5078ff2e}.message[data-kind=gate][_ngcontent-%COMP%]{border-left:3px solid orange}.message[data-kind=status][_ngcontent-%COMP%]{opacity:.8;font-style:italic}.message-role[_ngcontent-%COMP%]{font-size:.7rem;text-transform:uppercase;opacity:.6}.message-content[_ngcontent-%COMP%]{margin:.25rem 0 0;white-space:pre-wrap}.message-input[_ngcontent-%COMP%]{display:flex;gap:.5rem;margin-top:1rem}.message-input[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{flex:1}.empty[_ngcontent-%COMP%]{opacity:.7;padding:1rem 0}.chat-hint[_ngcontent-%COMP%]{opacity:.7;font-size:.85rem}"]})};export{G as ConversationsComponent};
|