@ngocsangairvds/vsaf 5.7.0 → 5.9.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-33F7AVPH.js +1 -0
- package/packages/web/dist/web/browser/chunk-4R37VVI4.js +5 -0
- 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-FBCNCNPM.js +4 -0
- 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-UDCOYDXU.js +1 -0
- package/packages/web/dist/web/browser/index.html +2 -2
- package/packages/web/dist/web/browser/{main-7PKVTIG7.js → main-3UCJ3N4F.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-VA6YRKIE.js +0 -1
- 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 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};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{a as ge}from"./chunk-33F7AVPH.js";import{b as ie,d as oe,e as re}from"./chunk-N3FOQ3O5.js";import{a as ae,b as le,e as se,g as de,h as pe,i as ce,j as me,k as ue}from"./chunk-7ELOO4IC.js";import{$a as $,Ba as T,Fa as _,Ka as E,Lb as te,Mb as F,O as W,Pb as ne,Qa as m,Qb as z,Ra as o,Sa as r,T as g,Ta as B,U as f,V as Y,W as X,Xa as w,Ya as c,Za as u,_a as G,a as b,b as x,bb as I,cb as V,db as D,fb as M,gb as S,hb as J,ib as s,jb as h,kb as P,lb as A,mb as C,nb as v,ob as y,qa as d,rb as U,sb as Z,tb as ee}from"./chunk-4R37VVI4.js";var Ce={ratio:.5,leftCollapsed:!1,rightCollapsed:!1};function R(a,n=.15,e=.85){return Number.isNaN(a)?.5:Math.min(e,Math.max(n,a))}function fe(a,n=Ce){let e=x(b({},n),{rightCollapsed:n.rightCollapsed&&!n.leftCollapsed});try{let t=globalThis.localStorage?.getItem(a);if(!t)return b({},e);let i=JSON.parse(t),l=!!i.leftCollapsed;return{ratio:typeof i.ratio=="number"?R(i.ratio):e.ratio,leftCollapsed:l,rightCollapsed:!!i.rightCollapsed&&!l}}catch(t){return b({},e)}}function H(a,n){try{globalThis.localStorage?.setItem(a,JSON.stringify(n))}catch(e){}}function he(a,n){if(n==="left"){let t=!a.leftCollapsed;return x(b({},a),{leftCollapsed:t,rightCollapsed:t?!1:a.rightCollapsed})}let e=!a.rightCollapsed;return x(b({},a),{rightCollapsed:e,leftCollapsed:e?!1:a.leftCollapsed})}var Me=["host"],Se=[[["","sp-left",""]],[["","sp-right",""]]],Pe=["[sp-left]","[sp-right]"];function Oe(a,n){a&1&&(o(0,"div",8),$(1),r())}function Ee(a,n){if(a&1){let e=w();o(0,"div",9),c("mousedown",function(i){g(e);let l=u();return f(l.startDrag(i))}),r()}}function Ne(a,n){a&1&&(o(0,"div",8),$(1,1),r())}var L=class a{storageKey="split-pane";leftTitle="";rightTitle="";minPx=240;host;state={ratio:.5,leftCollapsed:!1,rightCollapsed:!1};dragging=!1;moveHandler;upHandler;ngOnInit(){this.state=fe(this.storageKey)}ngAfterViewInit(){queueMicrotask(()=>{let n=this.host?.nativeElement.getBoundingClientRect().width??0;if(n>0&&!this.state.leftCollapsed&&!this.state.rightCollapsed){let e=this.minPx/n,t=R(this.state.ratio,e,1-e);t!==this.state.ratio&&(this.state=x(b({},this.state),{ratio:t}))}})}leftBasis(){return this.state.leftCollapsed?"34px":this.state.rightCollapsed?"auto":this.state.ratio*100+"%"}toggle(n){this.state=he(this.state,n),H(this.storageKey,this.state)}startDrag(n){n.preventDefault(),this.dragging=!0,this.moveHandler=e=>{if(!this.dragging)return;let t=this.host.nativeElement.getBoundingClientRect();if(t.width<=0)return;let i=this.minPx/t.width;this.state=x(b({},this.state),{ratio:R((e.clientX-t.left)/t.width,i,1-i)})},this.upHandler=()=>this.endDrag(),document.addEventListener("mousemove",this.moveHandler),document.addEventListener("mouseup",this.upHandler),window.addEventListener("blur",this.upHandler)}endDrag(){this.dragging&&(this.dragging=!1,this.moveHandler&&document.removeEventListener("mousemove",this.moveHandler),this.upHandler&&(document.removeEventListener("mouseup",this.upHandler),window.removeEventListener("blur",this.upHandler)),this.moveHandler=this.upHandler=void 0,H(this.storageKey,this.state))}ngOnDestroy(){this.endDrag()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=T({type:a,selectors:[["app-split-pane"]],viewQuery:function(e,t){if(e&1&&I(Me,7),e&2){let i;V(i=D())&&(t.host=i.first)}},inputs:{storageKey:"storageKey",leftTitle:"leftTitle",rightTitle:"rightTitle",minPx:"minPx"},ngContentSelectors:Pe,decls:17,vars:21,consts:[["host",""],[1,"sp"],[1,"sp-pane"],[1,"sp-hd"],[1,"sp-title"],["type","button",1,"sp-min",3,"click","title"],["class","sp-bd",4,"ngIf"],["class","sp-divider",3,"mousedown",4,"ngIf"],[1,"sp-bd"],[1,"sp-divider",3,"mousedown"]],template:function(e,t){e&1&&(G(Se),o(0,"div",1,0)(2,"div",2)(3,"div",3)(4,"span",4),s(5),r(),o(6,"button",5),c("click",function(){return t.toggle("left")}),s(7),r()(),_(8,Oe,2,0,"div",6),r(),_(9,Ee,1,0,"div",7),o(10,"div",2)(11,"div",3)(12,"span",4),s(13),r(),o(14,"button",5),c("click",function(){return t.toggle("right")}),s(15),r()(),_(16,Ne,2,0,"div",6),r()()),e&2&&(d(2),M("flex-basis",t.leftBasis())("flex-grow",t.state.leftCollapsed?0:t.state.rightCollapsed?1:0),S("collapsed",t.state.leftCollapsed),d(3),h(t.leftTitle),d(),m("title",t.state.leftCollapsed?"Restore":"Minimize"),E("aria-label",(t.state.leftCollapsed?"Restore ":"Minimize ")+t.leftTitle),d(),h(t.state.leftCollapsed?"\u25A3":"\u229F"),d(),m("ngIf",!t.state.leftCollapsed),d(),m("ngIf",!t.state.leftCollapsed&&!t.state.rightCollapsed),d(),M("flex-grow",1),S("collapsed",t.state.rightCollapsed),d(3),h(t.rightTitle),d(),m("title",t.state.rightCollapsed?"Restore":"Minimize"),E("aria-label",(t.state.rightCollapsed?"Restore ":"Minimize ")+t.rightTitle),d(),h(t.state.rightCollapsed?"\u25A3":"\u229F"),d(),m("ngIf",!t.state.rightCollapsed))},dependencies:[z,F],styles:['.sp[_ngcontent-%COMP%]{display:flex;width:100%;height:100%;min-height:470px}.sp-pane[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-width:0;border:1px solid #2b2d33;border-radius:8px;background:#15161b;overflow:hidden}.sp-pane.collapsed[_ngcontent-%COMP%]{flex:0 0 34px!important}.sp-hd[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 10px;border-bottom:1px solid #2b2d33;background:#17181d;font-size:12px;color:#a1a1aa}.sp-pane.collapsed[_ngcontent-%COMP%] .sp-hd[_ngcontent-%COMP%]{writing-mode:vertical-rl;border-bottom:0;border-right:1px solid #2b2d33;height:100%;justify-content:flex-start}.sp-title[_ngcontent-%COMP%]{font-weight:700;text-transform:uppercase;letter-spacing:.06em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sp-min[_ngcontent-%COMP%]{border:0;background:transparent;color:#9ca3af;cursor:pointer;font-size:13px;line-height:1;padding:0 2px}.sp-min[_ngcontent-%COMP%]:hover{color:#e7e7ea}.sp-bd[_ngcontent-%COMP%]{flex:1;min-height:0;position:relative;overflow:auto}.sp-divider[_ngcontent-%COMP%]{flex:0 0 10px;cursor:col-resize;position:relative}.sp-divider[_ngcontent-%COMP%]:after{content:"";position:absolute;left:4px;top:0;bottom:0;width:2px;background:#2b2d33}.sp-divider[_ngcontent-%COMP%]:hover:after{background:#6366f1}@media(max-width:900px){.sp[_ngcontent-%COMP%]{flex-direction:column}.sp-divider[_ngcontent-%COMP%]{display:none}.sp-pane[_ngcontent-%COMP%]{flex:1 1 auto!important}.sp-pane.collapsed[_ngcontent-%COMP%]{flex:0 0 34px!important}.sp-pane.collapsed[_ngcontent-%COMP%] .sp-hd[_ngcontent-%COMP%]{writing-mode:horizontal-tb;border-right:0;border-bottom:1px solid #2b2d33;height:auto}}']})};var We=["canvasContent"],Te=a=>["/runs",a];function Be(a,n){if(a&1){let e=w();o(0,"button",46),c("dragstart",function(i){let l=g(e).$implicit,p=u();return f(p.onPaletteDragStart(i,l.type))})("click",function(){let i=g(e).$implicit,l=u();return f(l.addNode(i.type))}),o(1,"span",47),s(2),r(),o(3,"span")(4,"strong"),s(5),r(),o(6,"small"),s(7),r()()()}if(a&2){let e=n.$implicit,t=u();d(2),h(t.iconFor(e.type)),d(3),h(e.label),d(2),h(e.description)}}function Ie(a,n){if(a&1){let e=w();o(0,"button",48),c("click",function(){let i=g(e).$implicit,l=u();return f(l.loadWorkflow(i.id))}),o(1,"span"),s(2),r(),o(3,"small"),s(4),r()()}if(a&2){let e=n.$implicit;d(2),h(e.name),d(2),P("",e.nodeCount," nodes")}}function Ve(a,n){if(a&1&&(o(0,"a",49)(1,"span")(2,"strong"),s(3),r(),o(4,"small"),s(5),r()(),o(6,"em"),s(7),r()()),a&2){let e=n.$implicit,t=u();m("routerLink",U(6,Te,e.runId)),d(3),h(e.workflow),d(2),h(e.runId),d(),J(t.statusClass(e.status)),d(),h(e.status)}}function De(a,n){a&1&&(o(0,"p",50),s(1,"No runs yet."),r())}function Fe(a,n){if(a&1&&(o(0,"div",51),s(1),r()),a&2){let e=u();S("error",e.saveState==="error"),d(),P(" ",e.statusMessage," ")}}function ze(a,n){a&1&&(o(0,"div",52)(1,"h2"),s(2,"Drop nodes here"),r(),o(3,"p"),s(4,"Build a DAG by adding Bash, Command, and Prompt nodes."),r()())}function Re(a,n){if(a&1&&(Y(),B(0,"line")),a&2){let e=n.$implicit;E("x1",e.x1)("y1",e.y1)("x2",e.x2)("y2",e.y2)}}function Le(a,n){if(a&1){let e=w();o(0,"button",53),c("click",function(){let i=g(e).$implicit,l=u();return f(l.selectNode(i))})("dragstart",function(i){let l=g(e).$implicit,p=u();return f(p.onNodeDragStart(i,l))}),o(1,"span",54),s(2),r(),o(3,"span",55)(4,"strong"),s(5),r(),o(6,"small"),s(7),r()()()}if(a&2){let e=n.$implicit,t=u();M("left",e.x,"px")("top",e.y,"px"),S("selected",(t.selectedNode==null?null:t.selectedNode.id)===e.id),d(2),h(t.iconFor(e.type)),d(3),h(e.id),d(2),A("",e.type," \xB7 ",e.dependsOn.length||0," deps")}}function Ye(a,n){if(a&1&&(o(0,"option",80),s(1),r()),a&2){let e=n.$implicit;m("value",e.name)("disabled",!e.available),d(),A(" ",e.name,"",e.available?"":" \u2014 not available on this machine"," ")}}function $e(a,n){if(a&1&&B(0,"option",81),a&2){let e=n.$implicit;m("value",e)}}function Ae(a,n){if(a&1){let e=w();o(0,"label",82)(1,"input",83),c("change",function(i){let l=g(e).$implicit,p=u(2);return f(p.toggleDependency(l.id,i))}),r(),o(2,"span"),s(3),r()()}if(a&2){let e=n.$implicit,t=u(2);d(),m("checked",t.selectedNode.dependsOn.includes(e.id)),d(2),h(e.id)}}function He(a,n){if(a&1){let e=w();o(0,"aside",56)(1,"div",57)(2,"span",58),s(3,"Inspector"),r(),o(4,"button",59),c("click",function(){g(e);let i=u();return f(i.closeInspector())}),s(5,"\u2715"),r()(),o(6,"label",60),s(7,"Node ID"),r(),o(8,"input",61),c("ngModelChange",function(i){g(e);let l=u();return f(l.renameSelectedNode(i))}),r(),o(9,"label",62),s(10,"Type"),r(),o(11,"select",63),y("ngModelChange",function(i){g(e);let l=u();return v(l.selectedNode.type,i)||(l.selectedNode.type=i),f(i)}),c("ngModelChange",function(){g(e);let i=u();return f(i.refreshYaml())}),o(12,"option",64),s(13,"bash"),r(),o(14,"option",65),s(15,"command"),r(),o(16,"option",66),s(17,"prompt"),r()(),o(18,"label",67),s(19,"Content"),r(),o(20,"textarea",68),y("ngModelChange",function(i){g(e);let l=u();return v(l.selectedNode.content,i)||(l.selectedNode.content=i),f(i)}),c("ngModelChange",function(){g(e);let i=u();return f(i.refreshYaml())}),r(),o(21,"label",69),s(22,"Provider"),r(),o(23,"select",70),y("ngModelChange",function(i){g(e);let l=u();return v(l.selectedNode.provider,i)||(l.selectedNode.provider=i),f(i)}),c("ngModelChange",function(){g(e);let i=u();return f(i.refreshYaml())}),o(24,"option",71),s(25,"(inherit workflow)"),r(),_(26,Ye,2,4,"option",72),r(),o(27,"label",73),s(28,"Model"),r(),o(29,"input",74),y("ngModelChange",function(i){g(e);let l=u();return v(l.selectedNode.model,i)||(l.selectedNode.model=i),f(i)}),c("ngModelChange",function(){g(e);let i=u();return f(i.refreshYaml())}),r(),o(30,"datalist",75),_(31,$e,1,1,"option",76),r(),o(32,"label",77),s(33,"Depends on"),r(),_(34,Ae,4,2,"label",78),o(35,"button",79),c("click",function(){g(e);let i=u();return f(i.deleteSelectedNode())}),s(36,"Delete Node"),r()()}if(a&2){let e=u();d(8),m("ngModel",e.selectedNode.id),d(3),C("ngModel",e.selectedNode.type),d(9),C("ngModel",e.selectedNode.content),d(3),C("ngModel",e.selectedNode.provider),d(3),m("ngForOf",e.providers),d(3),C("ngModel",e.selectedNode.model),d(2),m("ngForOf",e.modelSuggestions),d(3),m("ngForOf",e.dependencyCandidates)}}var _e=class a{api=W(ue);router=W(oe);route=W(ie);palette=[{type:"bash",label:"Bash",description:"Run a shell step"},{type:"command",label:"Command",description:"Use a .vsaf command"},{type:"prompt",label:"Prompt",description:"Call an AI provider"}];workflowName="new-workflow";workflowFolder="";description="Draft workflow";nodes=[];selectedNode;workflows=[];runs=[];providers=[];yamlPreview="";saveState="idle";statusMessage="";canvasScale=1;yamlFontPx=12;canvasContent;draggingType;draggingNodeId;ngOnInit(){this.loadYamlFont(),this.workflowFolder=q(this.route.snapshot.queryParamMap.get("folder")??""),this.refreshData(),this.resetBuilder();let n=this.route.snapshot.queryParamMap.get("edit");n&&this.loadWorkflow(n)}refreshData(){this.api.getWorkflows().subscribe(n=>this.workflows=n),this.api.getRuns().subscribe(n=>this.runs=n.slice().reverse().slice(0,8)),this.api.getProviders().subscribe({next:n=>this.providers=n.providers??[],error:()=>this.providers=[]})}get modelSuggestions(){let n=this.selectedNode?.provider||xe;return this.providers.find(e=>e.name===n)?.defaultModels??[]}resetBuilder(){this.workflowName="new-workflow",this.description="Draft workflow",this.nodes=[this.makeNode("bash",80,100,"setup"),this.makeNode("command",330,170,"review")],this.nodes[1].dependsOn=[this.nodes[0].id],this.arrange(),this.selectedNode=this.nodes[0],this.setStatus(""),this.refreshYaml()}get workflowId(){let n=q(this.workflowFolder),e=O(this.workflowName);return n?`${n}/${e}`:e}onPaletteDragStart(n,e){this.draggingType=e,n.dataTransfer?.setData("application/x-vsaf-node-type",e),n.dataTransfer?.setData("text/plain",e)}onNodeDragStart(n,e){this.draggingNodeId=e.id,n.dataTransfer?.setData("application/x-vsaf-node-id",e.id)}onCanvasDragOver(n){n.preventDefault()}onCanvasDrop(n){n.preventDefault();let t=(this.canvasContent?.nativeElement??n.currentTarget).getBoundingClientRect(),i=Math.max(18,(n.clientX-t.left)/this.canvasScale-95),l=Math.max(18,(n.clientY-t.top)/this.canvasScale-24),p=n.dataTransfer?.getData("application/x-vsaf-node-id")||this.draggingNodeId;if(p){let N=this.nodes.find(we=>we.id===p);N&&(N.x=i,N.y=l,this.selectNode(N),this.refreshYaml()),this.draggingNodeId=void 0;return}let k=n.dataTransfer?.getData("application/x-vsaf-node-type")||this.draggingType;k&&this.addNode(k,i,l),this.draggingType=void 0}zoomBy(n){this.canvasScale=Math.min(2,Math.max(.3,this.canvasScale*n))}onCanvasWheel(n){n.ctrlKey&&(n.preventDefault(),this.zoomBy(n.deltaY<0?1.1:.9))}zoomFit(){if(this.nodes.length===0){this.canvasScale=1;return}let n=this.canvasContent?.nativeElement.parentElement,e=n?.clientWidth??600,t=n?.clientHeight??400,i=Math.max(...this.nodes.map(k=>k.x))+j+40,l=Math.max(...this.nodes.map(k=>k.y))+K+40;this.canvasScale=Math.min(2,Math.max(.3,Math.min(e/i,t/l))),this.canvasContent?.nativeElement.parentElement?.scrollTo({top:0,left:0})}setYamlFont(n){this.yamlFontPx=Math.min(22,Math.max(10,this.yamlFontPx+n));try{localStorage.setItem("wf-yaml-font",String(this.yamlFontPx))}catch(e){}}loadYamlFont(){try{let n=Number(localStorage.getItem("wf-yaml-font"));n>=10&&n<=22&&(this.yamlFontPx=n)}catch(n){}}addNode(n,e,t){let i=e??40,l=t??(this.nodes.length?Math.max(...this.nodes.map(k=>k.y))+K+be.gapY:20),p=this.makeNode(n,i,l);this.nodes=[...this.nodes,p],this.selectNode(p),this.refreshYaml()}arrange(){let n=ge(this.nodes.map(e=>({key:e.id,dependsOn:e.dependsOn})),be);for(let e of this.nodes){let t=n.positions.get(e.id);t&&(e.x=t.x+40,e.y=t.y+20)}}arrangeVertical(){this.arrange()}selectNode(n){this.selectedNode=n}closeInspector(){this.selectedNode=void 0}renameSelectedNode(n){if(!this.selectedNode)return;let e=O(n);if(!e)return;let t=this.selectedNode.id;if(t!==e){if(this.nodes.some(i=>i.id===e)){this.setStatus(`Node ID already exists: ${e}`,"error");return}this.selectedNode.id=e;for(let i of this.nodes)i.dependsOn=i.dependsOn.map(l=>l===t?e:l);this.refreshYaml()}}toggleDependency(n,e){if(!this.selectedNode)return;e.target.checked?this.selectedNode.dependsOn=[...new Set([...this.selectedNode.dependsOn,n])]:this.selectedNode.dependsOn=this.selectedNode.dependsOn.filter(i=>i!==n),this.refreshYaml()}deleteSelectedNode(){if(!this.selectedNode)return;let n=this.selectedNode.id;this.nodes=this.nodes.filter(e=>e.id!==n).map(e=>x(b({},e),{dependsOn:e.dependsOn.filter(t=>t!==n)})),this.selectedNode=this.nodes[0],this.refreshYaml()}loadWorkflow(n){this.api.getWorkflow(n).subscribe(e=>{let t=e.id.lastIndexOf("/");this.workflowFolder=t>=0?e.id.slice(0,t):"",this.workflowName=t>=0?e.id.slice(t+1):e.id,this.description=e.description||"Workflow loaded from disk",this.nodes=e.nodes.map(i=>({id:i.id,type:i.type,title:i.id,content:i.content,dependsOn:i.dependsOn,provider:i.provider??"",model:i.model??"",x:0,y:0})),this.arrange(),this.selectedNode=this.nodes[0],this.setStatus(`Loaded ${e.name}`),this.refreshYaml()})}saveWorkflow(){this.saveCurrentWorkflow()}runWorkflow(){this.saveCurrentWorkflow(n=>{this.api.startRun(n,"").subscribe({next:e=>this.router.navigate(["/runs",e.runId]),error:e=>this.setStatus(e?.error?.error??e?.message??"Run failed","error")})})}refreshYaml(){this.yamlPreview=Ke(this.workflowName,this.description,this.nodes),this.saveState==="saved"&&(this.saveState="idle")}get dependencyCandidates(){return this.selectedNode?this.nodes.filter(n=>n.id!==this.selectedNode.id):[]}get edges(){let n=new Map(this.nodes.map(t=>[t.id,t])),e=[];for(let t of this.nodes)for(let i of t.dependsOn){let l=n.get(i);l&&e.push({x1:l.x+j/2,y1:l.y+K,x2:t.x+j/2,y2:t.y})}return e}iconFor(n){switch(n){case"bash":return"$";case"command":return"/";case"prompt":return"AI"}}statusClass(n){switch(n){case"completed":return"status-completed";case"failed":return"status-failed";case"running":return"status-running";default:return"status-default"}}saveCurrentWorkflow(n){let e=O(this.workflowName),t=q(this.workflowFolder),i=t?`${t}/${e}`:e;if(!e||this.nodes.length===0){this.setStatus("Workflow name and at least one node are required.","error");return}this.workflowName=e,this.refreshYaml(),this.saveState="saving",this.api.saveWorkflow(i,this.yamlPreview).subscribe({next:()=>{this.saveState="saved",this.setStatus(`Saved ${i}`),this.refreshData(),n?.(i)},error:l=>{this.saveState="error",this.setStatus(l?.error?.error??l?.message??"Save failed","error")}})}makeNode(n,e,t,i=n){let l=qe(this.nodes.map(p=>p.id),`${n}-${i}`);return{id:l,type:n,title:l,content:je(n,l),dependsOn:[],provider:"",model:"",x:e,y:t}}setStatus(n,e="idle"){this.statusMessage=n,this.saveState=e}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=T({type:a,selectors:[["app-workflow-builder"]],viewQuery:function(e,t){if(e&1&&I(We,5),e&2){let i;V(i=D())&&(t.canvasContent=i.first)}},decls:78,vars:28,consts:[["canvasContent",""],[1,"builder-shell"],[1,"sidebar"],[1,"brand-row"],[1,"brand-mark"],[1,"brand-title"],[1,"brand-subtitle"],["for","workflow-folder",1,"field-label"],["id","workflow-folder","placeholder","e.g. sdlc/release",1,"text-input",3,"ngModelChange","ngModel"],["for","workflow-name",1,"field-label"],["id","workflow-name",1,"text-input",3,"ngModelChange","ngModel"],["for","workflow-description",1,"field-label"],["id","workflow-description","rows","3",1,"text-area",3,"ngModelChange","ngModel"],[1,"section-title"],["type","button","class","palette-item","draggable","true",3,"dragstart","click",4,"ngFor","ngForOf"],["type","button","class","workflow-link",3,"click",4,"ngFor","ngForOf"],["open","",1,"runs-details"],["class","run-row",3,"routerLink",4,"ngFor","ngForOf"],["class","muted",4,"ngIf"],[1,"workspace"],[1,"toolbar"],[1,"toolbar-actions"],["type","button",1,"ghost-button",3,"click"],["type","button",1,"primary-button",3,"click","disabled"],["type","button",1,"run-button",3,"click","disabled"],["class","status-row",3,"error",4,"ngIf"],[1,"workspace-split"],["storageKey","wf-builder-split","leftTitle","Canvas","rightTitle","Workflow YAML"],["sp-left","",1,"canvas-wrap"],[1,"canvas-grid"],[1,"canvas-zoom"],["type","button","aria-label","Zoom out",3,"click"],["type","button","aria-label","Zoom in",3,"click"],["type","button","aria-label","Fit to view",1,"fit",3,"click"],[1,"canvas",3,"dragover","drop","wheel"],["class","empty-state",4,"ngIf"],[1,"canvas-content"],["aria-hidden","true",1,"edges"],[4,"ngFor","ngForOf"],["type","button","class","node-card","draggable","true",3,"selected","left","top","click","dragstart",4,"ngFor","ngForOf"],["class","inspector-drawer",4,"ngIf"],["sp-right","",1,"yaml-wrap"],[1,"yaml-fontctl"],["type","button","aria-label","Decrease YAML font size","title","Smaller",3,"click"],["type","button","aria-label","Increase YAML font size","title","Larger",3,"click"],[1,"yaml-editor",3,"ngModelChange","ngModel"],["type","button","draggable","true",1,"palette-item",3,"dragstart","click"],[1,"palette-icon"],["type","button",1,"workflow-link",3,"click"],[1,"run-row",3,"routerLink"],[1,"muted"],[1,"status-row"],[1,"empty-state"],["type","button","draggable","true",1,"node-card",3,"click","dragstart"],[1,"node-kind"],[1,"node-copy"],[1,"inspector-drawer"],[1,"drawer-hd"],[1,"panel-title"],["type","button","title","Close",1,"icon-button",3,"click"],["for","node-id",1,"field-label"],["id","node-id",1,"text-input",3,"ngModelChange","ngModel"],["for","node-type",1,"field-label"],["id","node-type",1,"text-input",3,"ngModelChange","ngModel"],["value","bash"],["value","command"],["value","prompt"],["for","node-content",1,"field-label"],["id","node-content","rows","7",1,"text-area","mono",3,"ngModelChange","ngModel"],["for","node-provider",1,"field-label"],["id","node-provider",1,"text-input",3,"ngModelChange","ngModel"],["value",""],[3,"value","disabled",4,"ngFor","ngForOf"],["for","node-model",1,"field-label"],["id","node-model","list","builder-model-suggestions","placeholder","(inherit)",1,"text-input",3,"ngModelChange","ngModel"],["id","builder-model-suggestions"],[3,"value",4,"ngFor","ngForOf"],[1,"field-label"],["class","check-row",4,"ngFor","ngForOf"],["type","button",1,"danger-button",3,"click"],[3,"value","disabled"],[3,"value"],[1,"check-row"],["type","checkbox",3,"change","checked"]],template:function(e,t){if(e&1){let i=w();o(0,"section",1)(1,"aside",2)(2,"div",3)(3,"div",4),s(4,"V"),r(),o(5,"div")(6,"div",5),s(7,"VSAF Builder"),r(),o(8,"div",6),s(9,"Workflow canvas"),r()()(),o(10,"label",7),s(11,"Folder"),r(),o(12,"input",8),y("ngModelChange",function(p){return g(i),v(t.workflowFolder,p)||(t.workflowFolder=p),f(p)}),r(),o(13,"label",9),s(14,"Workflow name"),r(),o(15,"input",10),y("ngModelChange",function(p){return g(i),v(t.workflowName,p)||(t.workflowName=p),f(p)}),c("ngModelChange",function(){return t.refreshYaml()}),r(),o(16,"label",11),s(17,"Description"),r(),o(18,"textarea",12),y("ngModelChange",function(p){return g(i),v(t.description,p)||(t.description=p),f(p)}),c("ngModelChange",function(){return t.refreshYaml()}),r(),o(19,"div",13),s(20,"Node Palette"),r(),_(21,Be,8,3,"button",14),o(22,"div",13),s(23,"Existing"),r(),_(24,Ie,5,2,"button",15),o(25,"details",16)(26,"summary",13),s(27,"Recent Runs"),r(),_(28,Ve,8,8,"a",17)(29,De,2,0,"p",18),r()(),o(30,"main",19)(31,"header",20)(32,"div")(33,"h1"),s(34),r(),o(35,"p"),s(36),r()(),o(37,"div",21)(38,"button",22),c("click",function(){return t.resetBuilder()}),s(39,"New"),r(),o(40,"button",22),c("click",function(){return t.refreshData()}),s(41,"Reload"),r(),o(42,"button",22),c("click",function(){return t.arrangeVertical()}),s(43,"Arrange"),r(),o(44,"button",23),c("click",function(){return t.saveWorkflow()}),s(45),r(),o(46,"button",24),c("click",function(){return t.runWorkflow()}),s(47,"Run"),r()()(),_(48,Fe,2,3,"div",25),o(49,"div",26)(50,"app-split-pane",27)(51,"div",28),B(52,"div",29),o(53,"div",30)(54,"button",31),c("click",function(){return t.zoomBy(.8)}),s(55,"\u2212"),r(),o(56,"span"),s(57),Z(58,"number"),r(),o(59,"button",32),c("click",function(){return t.zoomBy(1.25)}),s(60,"+"),r(),o(61,"button",33),c("click",function(){return t.zoomFit()}),s(62,"fit"),r()(),o(63,"section",34),c("dragover",function(p){return t.onCanvasDragOver(p)})("drop",function(p){return t.onCanvasDrop(p)})("wheel",function(p){return t.onCanvasWheel(p)}),_(64,ze,5,0,"div",35),o(65,"div",36,0),Y(),o(67,"svg",37),_(68,Re,1,4,"line",38),r(),_(69,Le,8,10,"button",39),r()(),_(70,He,37,8,"aside",40),r(),X(),o(71,"div",41)(72,"div",42)(73,"button",43),c("click",function(){return t.setYamlFont(-1)}),s(74,"A\u2212"),r(),o(75,"button",44),c("click",function(){return t.setYamlFont(1)}),s(76,"A+"),r()(),o(77,"textarea",45),y("ngModelChange",function(p){return g(i),v(t.yamlPreview,p)||(t.yamlPreview=p),f(p)}),r()()()()()()}e&2&&(d(12),C("ngModel",t.workflowFolder),d(3),C("ngModel",t.workflowName),d(3),C("ngModel",t.description),d(3),m("ngForOf",t.palette),d(3),m("ngForOf",t.workflows),d(4),m("ngForOf",t.runs),d(),m("ngIf",t.runs.length===0),d(5),h(t.workflowId||"untitled-workflow"),d(2),P("",t.nodes.length," nodes \xB7 drag from palette or click a node to edit"),d(8),m("disabled",t.saveState==="saving"),d(),P(" ",t.saveState==="saving"?"Saving...":"Save Workflow"," "),d(),m("disabled",t.nodes.length===0),d(2),m("ngIf",t.statusMessage),d(9),P("",ee(58,25,t.canvasScale*100,"1.0-0"),"%"),d(7),m("ngIf",t.nodes.length===0),d(),M("transform","scale("+t.canvasScale+")"),d(3),m("ngForOf",t.edges),d(),m("ngForOf",t.nodes),d(),m("ngIf",t.selectedNode),d(7),M("font-size",t.yamlFontPx,"px")("line-height",1.5),C("ngModel",t.yamlPreview))},dependencies:[z,te,F,me,pe,ce,ae,de,le,se,re,L,ne],styles:["[_nghost-%COMP%]{display:block;min-height:calc(100vh - 56px);background:#101114;color:#e7e7ea}button[_ngcontent-%COMP%], input[_ngcontent-%COMP%], textarea[_ngcontent-%COMP%], select[_ngcontent-%COMP%]{font:inherit}.builder-shell[_ngcontent-%COMP%]{display:grid;grid-template-columns:280px minmax(0,1fr);min-height:calc(100vh - 56px)}.sidebar[_ngcontent-%COMP%]{border-right:1px solid #2b2d33;background:#17181d;padding:16px;overflow:auto}.brand-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;margin-bottom:22px}.brand-mark[_ngcontent-%COMP%]{display:grid;place-items:center;width:34px;height:34px;border-radius:8px;background:#6366f1;color:#fff;font-weight:700}.brand-title[_ngcontent-%COMP%]{font-size:15px;font-weight:700}.brand-subtitle[_ngcontent-%COMP%], .muted[_ngcontent-%COMP%], small[_ngcontent-%COMP%]{color:#9ca3af}.field-label[_ngcontent-%COMP%], .section-title[_ngcontent-%COMP%]{display:block;margin:14px 0 7px;color:#a1a1aa;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.08em}.text-input[_ngcontent-%COMP%], .text-area[_ngcontent-%COMP%]{width:100%;box-sizing:border-box;border:1px solid #333640;border-radius:7px;background:#101114;color:#f4f4f5;padding:9px 10px;outline:none}.text-input[_ngcontent-%COMP%]:focus, .text-area[_ngcontent-%COMP%]:focus, .yaml-editor[_ngcontent-%COMP%]:focus{border-color:#6366f1;box-shadow:0 0 0 2px #6366f12e}.text-area[_ngcontent-%COMP%]{resize:vertical}.mono[_ngcontent-%COMP%], .yaml-editor[_ngcontent-%COMP%]{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.palette-item[_ngcontent-%COMP%], .workflow-link[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;width:100%;border:1px solid #2b2d33;border-radius:8px;background:#1f2128;color:#e7e7ea;padding:10px;margin-bottom:8px;text-align:left;cursor:grab}.palette-item[_ngcontent-%COMP%]:hover, .workflow-link[_ngcontent-%COMP%]:hover{border-color:#4f46e5;background:#242633}.palette-icon[_ngcontent-%COMP%]{display:grid;place-items:center;width:28px;height:28px;border-radius:7px;background:#111827;color:#a5b4fc}.palette-item[_ngcontent-%COMP%] strong[_ngcontent-%COMP%], .workflow-link[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:block;font-size:13px}.palette-item[_ngcontent-%COMP%] small[_ngcontent-%COMP%], .workflow-link[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{display:block;font-size:11px;margin-top:2px}.workflow-link[_ngcontent-%COMP%]{justify-content:space-between;cursor:pointer}.runs-details[_ngcontent-%COMP%]{margin-top:8px}.runs-details[_ngcontent-%COMP%] > summary[_ngcontent-%COMP%]{cursor:pointer;list-style:revert}.workspace[_ngcontent-%COMP%]{min-width:0;padding:18px;display:flex;flex-direction:column;min-height:0}.toolbar[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:16px;align-items:center;margin-bottom:12px}.toolbar[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{margin:0;font-size:20px}.toolbar[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:4px 0 0;color:#9ca3af;font-size:13px}.toolbar-actions[_ngcontent-%COMP%]{display:flex;gap:8px;flex-wrap:wrap}.ghost-button[_ngcontent-%COMP%], .primary-button[_ngcontent-%COMP%], .run-button[_ngcontent-%COMP%], .danger-button[_ngcontent-%COMP%]{border:1px solid #333640;border-radius:7px;padding:8px 12px;color:#f4f4f5;background:#20222a;cursor:pointer}.primary-button[_ngcontent-%COMP%]{background:#4f46e5;border-color:#4f46e5}.run-button[_ngcontent-%COMP%]{background:#059669;border-color:#059669}.danger-button[_ngcontent-%COMP%]{width:100%;margin-top:14px;background:#3f1d24;border-color:#7f1d1d;color:#fecaca}.primary-button[_ngcontent-%COMP%]:disabled, .run-button[_ngcontent-%COMP%]:disabled{opacity:.55;cursor:not-allowed}.status-row[_ngcontent-%COMP%]{border:1px solid #1f5f45;border-radius:8px;background:#092d22;color:#a7f3d0;padding:10px 12px;margin-bottom:12px;font-size:13px}.status-row.error[_ngcontent-%COMP%]{border-color:#7f1d1d;background:#2a1217;color:#fecaca}.workspace-split[_ngcontent-%COMP%]{flex:1;min-height:470px}.canvas-wrap[_ngcontent-%COMP%]{position:relative;height:100%;min-height:470px;background:#15161b}.canvas[_ngcontent-%COMP%]{position:absolute;inset:0;overflow:auto;border:0;border-radius:0;background:transparent;z-index:1}.canvas-content[_ngcontent-%COMP%]{position:relative;width:3000px;height:2000px;transform-origin:0 0}.canvas-zoom[_ngcontent-%COMP%]{position:absolute;top:8px;left:8px;z-index:6;display:flex;align-items:center;gap:4px;background:#17181dd9;border:1px solid #2b2d33;border-radius:8px;padding:4px 6px}.canvas-zoom[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{border:1px solid #333640;background:#20222a;color:#e7e7ea;border-radius:6px;min-width:24px;height:24px;cursor:pointer;font-size:13px}.canvas-zoom[_ngcontent-%COMP%] .fit[_ngcontent-%COMP%]{width:auto;padding:0 8px;font-size:11px}.canvas-zoom[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#9ca3af;font-size:11px;min-width:34px;text-align:center;font-family:ui-monospace,monospace}.inspector-drawer[_ngcontent-%COMP%]{position:absolute;top:0;right:0;bottom:0;width:min(360px,72%);background:#17181d;border-left:1px solid #2b2d33;box-shadow:-14px 0 30px #0006;padding:14px;overflow:auto;z-index:5}.drawer-hd[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}.icon-button[_ngcontent-%COMP%]{border:0;background:transparent;color:#9ca3af;cursor:pointer;font-size:15px;line-height:1}.icon-button[_ngcontent-%COMP%]:hover{color:#e7e7ea}.canvas-grid[_ngcontent-%COMP%]{position:absolute;inset:0;z-index:0;pointer-events:none;background-image:linear-gradient(#24262e 1px,transparent 1px),linear-gradient(90deg,#24262e 1px,transparent 1px);background-size:28px 28px;opacity:.45}.empty-state[_ngcontent-%COMP%]{position:absolute;inset:0;display:grid;place-content:center;text-align:center;color:#9ca3af;pointer-events:none}.empty-state[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0 0 6px;color:#e7e7ea}.edges[_ngcontent-%COMP%]{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}.edges[_ngcontent-%COMP%] line[_ngcontent-%COMP%]{stroke:#6366f1;stroke-width:2;stroke-dasharray:5 5;opacity:.8}.node-card[_ngcontent-%COMP%]{position:absolute;z-index:2;display:flex;align-items:center;gap:10px;width:190px;border:1px solid #3f4250;border-radius:8px;background:#20222a;color:#f4f4f5;padding:11px;cursor:move;text-align:left;box-shadow:0 12px 28px #00000038}.node-card.selected[_ngcontent-%COMP%]{border-color:#818cf8;box-shadow:0 0 0 2px #6366f147,0 12px 28px #00000038}.node-kind[_ngcontent-%COMP%]{display:grid;place-items:center;width:30px;height:30px;border-radius:7px;background:#111827;color:#a5b4fc}.node-copy[_ngcontent-%COMP%] strong[_ngcontent-%COMP%], .node-copy[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.node-copy[_ngcontent-%COMP%]{min-width:0}.panel-title[_ngcontent-%COMP%]{margin-bottom:12px;font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.08em;color:#d4d4d8}.check-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;margin:8px 0;color:#d4d4d8;font-size:13px}.yaml-editor[_ngcontent-%COMP%]{width:100%;min-height:260px;box-sizing:border-box;border:1px solid #333640;border-radius:7px;background:#0f1014;color:#d4d4d8;padding:12px;resize:vertical}.yaml-wrap[_ngcontent-%COMP%]{height:100%;position:relative}.yaml-fontctl[_ngcontent-%COMP%]{position:absolute;top:6px;right:10px;z-index:6;display:flex;gap:4px}.yaml-fontctl[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{border:1px solid #333640;background:#17181dd9;color:#e7e7ea;border-radius:6px;min-width:28px;height:24px;cursor:pointer;font-size:12px}.yaml-wrap[_ngcontent-%COMP%] .yaml-editor[_ngcontent-%COMP%]{width:100%;height:100%;min-height:0;box-sizing:border-box;border:0;border-radius:0;resize:none}.run-row[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:12px;padding:10px 0;color:#e7e7ea;text-decoration:none;border-bottom:1px solid #252730}.run-row[_ngcontent-%COMP%] strong[_ngcontent-%COMP%], .run-row[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{display:block}.run-row[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:11px}.status-completed[_ngcontent-%COMP%]{color:#34d399}.status-failed[_ngcontent-%COMP%]{color:#f87171}.status-running[_ngcontent-%COMP%]{color:#60a5fa}.status-default[_ngcontent-%COMP%]{color:#a1a1aa}@media(max-width:980px){.builder-shell[_ngcontent-%COMP%]{grid-template-columns:1fr}.sidebar[_ngcontent-%COMP%]{border-right:0;border-bottom:1px solid #2b2d33}.toolbar[_ngcontent-%COMP%]{align-items:flex-start;flex-direction:column}}"]})};function je(a,n){switch(a){case"bash":return`echo "${n}"`;case"command":return n;case"prompt":return`Complete ${n} and summarize the result.`}}var be={nodeW:190,nodeH:56,gapX:40,gapY:48},j=190,K=56,xe="claude";function Ke(a,n,e){let t=[`name: ${O(a)||"new-workflow"}`,`description: ${Q(n||"Draft workflow")}`,`provider: ${xe}`,"model: sonnet","nodes:"];for(let i of e)if(t.push(` - id: ${i.id}`),i.dependsOn.length>0&&t.push(` depends_on: [${i.dependsOn.join(", ")}]`),i.provider&&t.push(` provider: ${i.provider}`),i.model&&t.push(` model: ${i.model}`),i.type==="bash")t.push(` bash: ${Q(i.content||"echo ok")}`);else if(i.type==="command")t.push(` command: ${Q(i.content||i.id)}`);else{t.push(" prompt: |");for(let l of(i.content||`Complete ${i.id}`).split(`
|
|
2
|
+
`))t.push(` ${l}`)}return`${t.join(`
|
|
3
|
+
`)}
|
|
4
|
+
`}function O(a){return a.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")}function q(a){return a.split("/").map(O).filter(Boolean).join("/")}function qe(a,n){let e=O(n)||"node";if(!a.includes(e))return e;let t=2;for(;a.includes(`${e}-${t}`);)t++;return`${e}-${t}`}function Q(a){return JSON.stringify(a)}export{_e as WorkflowBuilderComponent};
|
|
@@ -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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as A,e as R}from"./chunk-UN7U5NAR.js";import{a as B,b as j,c as q,d as $,e as D,f as Q,g as G,h as J,i as Y,j as H,k as K}from"./chunk-LPQARKUF.js";import{Ba as W,Fa as u,Jb as z,Kb as N,O as P,Ob as L,Qa as c,Ra as n,Sa as t,T as m,U as f,Ua as v,Va as M,Xa as x,Ya as _,Za as s,cb as F,db as I,eb as h,gb as o,hb as g,ib as V,jb as y,k as O,kb as w,lb as b,mb as C,pb as k,qa as l,sb as T,u as S,w as E}from"./chunk-WDOCF7IL.js";var X=a=>({folder:a}),Z=a=>({id:a});function te(a,i){a&1&&(n(0,"div",7),o(1,"Loading workflows..."),t())}function ne(a,i){if(a&1&&(n(0,"div",8),o(1),t()),a&2){let e=s();l(),g(e.loadError)}}function oe(a,i){if(a&1&&(n(0,"p"),o(1),t()),a&2){let e=s(3);l(),g(e.folderError)}}function re(a,i){if(a&1){let e=x();n(0,"form",30),_("ngSubmit",function(){m(e);let d=s(2);return f(d.createFolder())}),n(1,"span"),o(2),t(),n(3,"input",31),C("ngModelChange",function(d){m(e);let p=s(2);return b(p.newFolderName,d)||(p.newFolderName=d),f(d)}),t(),n(4,"div")(5,"button",32),o(6,"Create"),t(),n(7,"button",22),_("click",function(){m(e);let d=s(2);return f(d.cancelFolder())}),o(8,"Cancel"),t()(),u(9,oe,2,1,"p",33),t()}if(a&2){let e=s(2);l(2),g(e.selectedFolder?e.selectedFolder+"/":""),l(),w("ngModel",e.newFolderName),l(2),c("disabled",e.creatingFolder),l(4),c("ngIf",e.folderError)}}function ie(a,i){if(a&1){let e=x();n(0,"button",34),_("click",function(){let d=m(e).$implicit,p=s(2);return f(p.selectFolder(d.path))}),n(1,"span",16),o(2,"\u203A"),t(),n(3,"span"),o(4),t(),n(5,"strong"),o(6),t()()}if(a&2){let e=i.$implicit,r=s(2);I("padding-left",14+e.depth*16,"px"),h("active",r.selectedFolder===e.path),l(4),g(e.name),l(2),g(e.count)}}function le(a,i){if(a&1){let e=x();v(0),n(1,"span"),o(2,"/"),t(),n(3,"button",22),_("click",function(){let d=m(e).$implicit,p=s(2);return f(p.selectFolder(d.path))}),o(4),t(),M()}if(a&2){let e=i.$implicit,r=i.last;l(3),h("current",r),l(),g(e.name)}}function ae(a,i){if(a&1){let e=x();n(0,"article",35),_("click",function(){let d=m(e).$implicit,p=s(2);return f(p.selectWorkflow(d))}),n(1,"div",36)(2,"span",37),o(3,"Y"),t(),n(4,"div")(5,"strong"),o(6),t(),n(7,"p"),o(8),t()()(),n(9,"span",38),o(10),t(),n(11,"code"),o(12),t(),n(13,"div",39)(14,"a",40),_("click",function(d){return d.stopPropagation()}),o(15,"Details"),t(),n(16,"button",22),_("click",function(d){let p=m(e).$implicit,ee=s(2);return d.stopPropagation(),f(ee.selectWorkflow(p))}),o(17,"Run"),t()()()}if(a&2){let e=i.$implicit,r=s(2);h("selected",(r.selectedWorkflow==null?null:r.selectedWorkflow.id)===e.id),l(6),g(e.name),l(2),g(e.description||"No description provided."),l(2),g(e.nodeCount),l(2),g(e.file),l(2),c("queryParams",k(7,Z,e.id))}}function de(a,i){a&1&&(n(0,"div",41),o(1,"No workflows match this folder and search."),t())}function ce(a,i){if(a&1&&(n(0,"option",55),o(1),t()),a&2){let e=i.$implicit;c("value",e.name)("disabled",!e.available),l(),y(" ",e.name,"",e.available?"":" \u2014 not available on this machine"," ")}}function se(a,i){if(a&1&&(n(0,"option",56),o(1),t()),a&2){let e=i.$implicit;c("value",e),l(),g(e)}}function pe(a,i){if(a&1){let e=x();v(0),n(1,"label",48),o(2,"Provider"),t(),n(3,"select",49),C("ngModelChange",function(d){m(e);let p=s(3);return b(p.runProvider,d)||(p.runProvider=d),f(d)}),_("ngModelChange",function(){m(e);let d=s(3);return f(d.onRunProviderChange())}),n(4,"option",50),o(5,"(workflow default)"),t(),u(6,ce,2,4,"option",51),t(),n(7,"label",52),o(8,"Model"),t(),n(9,"select",53),C("ngModelChange",function(d){m(e);let p=s(3);return b(p.runModel,d)||(p.runModel=d),f(d)}),n(10,"option",50),o(11,"(workflow default)"),t(),u(12,se,2,2,"option",54),t(),M()}if(a&2){let e=s(3);l(3),w("ngModel",e.runProvider),c("disabled",e.running),l(3),c("ngForOf",e.providers),l(3),w("ngModel",e.runModel),c("disabled",e.running),l(3),c("ngForOf",e.runModelOptions)}}function ge(a,i){if(a&1&&(n(0,"div",57),o(1),t()),a&2){let e=s(3);l(),g(e.runError)}}function me(a,i){if(a&1){let e=x();v(0),n(1,"div",12),o(2,"Run workflow"),t(),n(3,"span",42),o(4),t(),n(5,"h2"),o(6),t(),n(7,"p"),o(8),t(),n(9,"dl")(10,"div")(11,"dt"),o(12,"Nodes"),t(),n(13,"dd"),o(14),t()(),n(15,"div")(16,"dt"),o(17,"File"),t(),n(18,"dd"),o(19),t()()(),n(20,"label",43),o(21,"Arguments"),t(),n(22,"input",44),C("ngModelChange",function(d){m(e);let p=s(2);return b(p.runArgs,d)||(p.runArgs=d),f(d)}),t(),u(23,pe,13,6,"ng-container",33),n(24,"button",45),_("click",function(){m(e);let d=s(2);return f(d.runSelected())}),o(25),t(),n(26,"a",46),o(27,"Open details"),t(),u(28,ge,2,1,"div",47),M()}if(a&2){let e=s(2);l(4),g(e.selectedWorkflow.id),l(2),g(e.selectedWorkflow.name),l(2),g(e.selectedWorkflow.description||"No description provided."),l(6),g(e.selectedWorkflow.nodeCount),l(5),g(e.selectedWorkflow.file),l(3),w("ngModel",e.runArgs),c("disabled",e.running),l(),c("ngIf",e.providers.length),l(),c("disabled",e.running),l(),V(" ",e.running?"Starting...":"Run workflow"," "),l(),c("queryParams",k(12,Z,e.selectedWorkflow.id)),l(2),c("ngIf",e.runError)}}function fe(a,i){a&1&&(n(0,"div",12),o(1,"Inspector"),t(),n(2,"p"),o(3,"Select a workflow to inspect and run it."),t())}function _e(a,i){if(a&1){let e=x();n(0,"div",9)(1,"aside",10)(2,"div",11)(3,"div",12),o(4,"Folders"),t(),n(5,"button",13),_("click",function(){m(e);let d=s();return f(d.showFolderForm=!0)}),o(6,"+"),t()(),u(7,re,10,4,"form",14),n(8,"button",15),_("click",function(){m(e);let d=s();return f(d.selectFolder(""))}),n(9,"span",16),o(10,"\u2302"),t(),n(11,"span"),o(12,".vsaf/workflows"),t(),n(13,"strong"),o(14),t()(),u(15,ie,7,6,"button",17),n(16,"a",18),o(17,"+ Workflow in this folder"),t()(),n(18,"main",19)(19,"div",20)(20,"div")(21,"nav",21)(22,"button",22),_("click",function(){m(e);let d=s();return f(d.selectFolder(""))}),o(23,"workflows"),t(),u(24,le,5,3,"ng-container",23),t(),n(25,"p"),o(26),t()(),n(27,"input",24),C("ngModelChange",function(d){m(e);let p=s();return b(p.searchQuery,d)||(p.searchQuery=d),f(d)}),t()(),n(28,"div",25)(29,"span"),o(30,"Name"),t(),n(31,"span"),o(32,"Nodes"),t(),n(33,"span"),o(34,"Location"),t(),n(35,"span"),o(36,"Actions"),t()(),u(37,ae,18,9,"article",26)(38,de,2,0,"div",27),t(),n(39,"aside",28),u(40,me,29,14,"ng-container",29)(41,fe,4,0,"ng-template",null,0,T),t()()}if(a&2){let e=F(42),r=s();l(7),c("ngIf",r.showFolderForm),l(),h("active",r.selectedFolder===""),l(6),g(r.workflows.length),l(),c("ngForOf",r.folders),l(),c("queryParams",k(15,X,r.selectedFolder||null)),l(8),c("ngForOf",r.breadcrumbs),l(2),y("",r.visibleWorkflows.length," workflow",r.visibleWorkflows.length===1?"":"s"),l(),w("ngModel",r.searchQuery),l(10),c("ngForOf",r.visibleWorkflows)("ngForTrackBy",r.trackWorkflow),l(),c("ngIf",!r.visibleWorkflows.length),l(2),c("ngIf",r.selectedWorkflow)("ngIfElse",e)}}var U=class a{api=P(K);router=P(A);workflows=[];folderPaths=[];providers=[];loading=!0;loadError="";selectedFolder="";selectedWorkflow;searchQuery="";runArgs="";runProvider="";runModel="";running=!1;runError="";showFolderForm=!1;newFolderName="";creatingFolder=!1;folderError="";ngOnInit(){S({workflows:this.api.getWorkflows(),folders:this.api.getWorkflowFolders(),providers:this.api.getProviders().pipe(E(()=>O({providers:[]})))}).subscribe({next:i=>{this.workflows=i.workflows,this.folderPaths=i.folders,this.providers=i.providers.providers??[],this.loading=!1},error:i=>{this.loadError=i?.error?.error??"Failed to load workflows.",this.loading=!1}})}get runModelOptions(){return this.runProvider?this.providers.find(i=>i.name===this.runProvider)?.defaultModels??[]:[...new Set(this.providers.flatMap(i=>i.defaultModels))]}onRunProviderChange(){this.runModel&&!this.runModelOptions.includes(this.runModel)&&(this.runModel="")}get folders(){let i=new Set(this.folderPaths);for(let e of this.workflows){let r=e.directory.split("/").filter(Boolean);r.forEach((d,p)=>i.add(r.slice(0,p+1).join("/")))}return[...i].sort().map(e=>({path:e,name:e.slice(e.lastIndexOf("/")+1),depth:e.split("/").length-1,count:this.workflows.filter(r=>r.directory===e||r.directory.startsWith(`${e}/`)).length}))}get breadcrumbs(){let i=this.selectedFolder.split("/").filter(Boolean);return i.map((e,r)=>({name:e,path:i.slice(0,r+1).join("/")}))}get visibleWorkflows(){let i=this.searchQuery.trim().toLowerCase();return this.workflows.filter(e=>{let r=!this.selectedFolder||e.directory===this.selectedFolder,d=!i||`${e.name} ${e.id} ${e.description}`.toLowerCase().includes(i);return r&&d})}selectFolder(i){this.selectedFolder=i,this.selectedWorkflow=void 0,this.runError=""}createFolder(){let i=this.newFolderName.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"");if(!i){this.folderError="Enter a valid folder name.";return}let e=this.selectedFolder?`${this.selectedFolder}/${i}`:i;this.creatingFolder=!0,this.folderError="",this.api.createWorkflowFolder(e).subscribe({next:()=>{this.creatingFolder=!1,this.folderPaths=[...new Set([...this.folderPaths,e])].sort(),this.selectFolder(e),this.cancelFolder()},error:r=>{this.creatingFolder=!1,this.folderError=r?.error?.error??"Failed to create folder."}})}cancelFolder(){this.showFolderForm=!1,this.newFolderName="",this.folderError=""}selectWorkflow(i){this.selectedWorkflow=i,this.runError=""}trackWorkflow(i,e){return e.id}runSelected(){!this.selectedWorkflow||this.running||(this.running=!0,this.api.startRun(this.selectedWorkflow.id,this.runArgs,{provider:this.runProvider||void 0,model:this.runModel||void 0}).subscribe({next:i=>this.router.navigate(["/runs",i.runId]),error:i=>{this.running=!1,this.runError=i?.error?.error??"Failed to start workflow."}}))}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=W({type:a,selectors:[["app-workflows"]],decls:14,vars:6,consts:[["noSelection",""],[1,"page"],[1,"page-header"],["routerLink","/workflows/builder",1,"primary-button",3,"queryParams"],["class","state",4,"ngIf"],["class","state error",4,"ngIf"],["class","explorer",4,"ngIf"],[1,"state"],[1,"state","error"],[1,"explorer"],[1,"folder-panel"],[1,"folder-heading"],[1,"panel-heading"],["type","button","title","Create subfolder",3,"click"],["class","folder-form",3,"ngSubmit",4,"ngIf"],["type","button",1,"folder-row","root",3,"click"],[1,"chevron"],["type","button","class","folder-row",3,"active","padding-left","click",4,"ngFor","ngForOf"],["routerLink","/workflows/builder",1,"folder-new-flow",3,"queryParams"],[1,"content-panel"],[1,"content-toolbar"],["aria-label","Workflow folder",1,"breadcrumb"],["type","button",3,"click"],[4,"ngFor","ngForOf"],["type","search","placeholder","Search this workspace",3,"ngModelChange","ngModel"],[1,"column-head"],["class","workflow-row",3,"selected","click",4,"ngFor","ngForOf","ngForTrackBy"],["class","empty",4,"ngIf"],[1,"run-panel"],[4,"ngIf","ngIfElse"],[1,"folder-form",3,"ngSubmit"],["name","folderName","placeholder","folder-name","autofocus","",3,"ngModelChange","ngModel"],["type","submit",3,"disabled"],[4,"ngIf"],["type","button",1,"folder-row",3,"click"],[1,"workflow-row",3,"click"],[1,"workflow-name"],[1,"file-icon"],[1,"node-count"],[1,"row-actions"],["routerLink","/workflows/detail",3,"click","queryParams"],[1,"empty"],[1,"namespace"],["for","run-args"],["id","run-args","placeholder","Optional run args",3,"ngModelChange","ngModel","disabled"],["type","button",1,"run-button",3,"click","disabled"],["routerLink","/workflows/detail",1,"details-button",3,"queryParams"],["class","run-error",4,"ngIf"],["for","run-provider"],["id","run-provider",1,"run-select",3,"ngModelChange","ngModel","disabled"],["value",""],[3,"value","disabled",4,"ngFor","ngForOf"],["for","run-model"],["id","run-model",1,"run-select",3,"ngModelChange","ngModel","disabled"],[3,"value",4,"ngFor","ngForOf"],[3,"value","disabled"],[3,"value"],[1,"run-error"]],template:function(e,r){e&1&&(n(0,"section",1)(1,"header",2)(2,"div")(3,"h1"),o(4,"Workflows"),t(),n(5,"p"),o(6,"Browse workflow definitions by their directory structure."),t()(),n(7,"a",3)(8,"span"),o(9,"+"),t(),o(10," New workflow"),t()(),u(11,te,2,0,"div",4)(12,ne,2,1,"div",5)(13,_e,43,17,"div",6),t()),e&2&&(l(7),c("queryParams",k(4,X,r.selectedFolder||null)),l(4),c("ngIf",r.loading),l(),c("ngIf",r.loadError),l(),c("ngIf",!r.loading&&!r.loadError))},dependencies:[L,z,N,H,Q,J,Y,B,G,j,q,D,$,R],styles:["[_nghost-%COMP%]{display:block;min-height:calc(100vh - 56px);background:#101114;color:#e7e7ea}.page[_ngcontent-%COMP%]{padding:22px;max-width:1600px;margin:auto}.page-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:18px}.page-header[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{font-size:21px;margin:0}.page-header[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .content-toolbar[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font-size:13px;color:#8f96a3;margin:4px 0 0}.primary-button[_ngcontent-%COMP%], .details-button[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:7px;background:#6366f1;color:#fff;text-decoration:none;padding:9px 12px;border-radius:6px;font-size:13px;font-weight:700}.explorer[_ngcontent-%COMP%]{display:grid;grid-template-columns:240px minmax(500px,1fr) 280px;min-height:620px;border:1px solid #292c34;border-radius:7px;overflow:hidden;background:#15161a}.folder-panel[_ngcontent-%COMP%], .run-panel[_ngcontent-%COMP%]{background:#131419}.folder-panel[_ngcontent-%COMP%]{border-right:1px solid #292c34;padding:12px 8px}.run-panel[_ngcontent-%COMP%]{border-left:1px solid #292c34;padding:14px}.panel-heading[_ngcontent-%COMP%]{font-size:11px;color:#8f96a3;text-transform:uppercase;font-weight:800;margin:3px 7px 12px}.folder-heading[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.folder-heading[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{width:24px;height:24px;border:1px solid #353842;border-radius:4px;background:#202229;color:#fff;cursor:pointer}.folder-form[_ngcontent-%COMP%]{border:1px solid #383b45;background:#191b20;padding:8px;margin-bottom:8px;border-radius:5px}.folder-form[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:block;color:#777e8b;font-size:10px;overflow-wrap:anywhere}.folder-form[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{box-sizing:border-box;width:100%;margin:5px 0;border:1px solid #3b3e49;background:#101114;color:#fff;padding:6px;border-radius:4px}.folder-form[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{display:flex;gap:5px}.folder-form[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{border:1px solid #3b3e49;background:#252731;color:#ddd;padding:4px 6px;border-radius:4px;font-size:10px}.folder-form[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{color:#fca5a5;font-size:10px;margin:6px 0 0}.folder-new-flow[_ngcontent-%COMP%]{display:block;color:#a5b4fc;text-decoration:none;font-size:11px;padding:9px 12px;border-top:1px solid #292c34;margin-top:8px}.folder-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:16px minmax(0,1fr) auto;gap:7px;align-items:center;width:100%;height:34px;border:0;border-radius:5px;background:transparent;color:#b7bbc4;text-align:left;cursor:pointer;padding-right:9px}.folder-row[_ngcontent-%COMP%]:hover, .folder-row.active[_ngcontent-%COMP%]{background:#242630;color:#fff}.folder-row[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(2){overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.folder-row[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-size:10px;color:#6f7684}.chevron[_ngcontent-%COMP%]{color:#7c83ff}.content-panel[_ngcontent-%COMP%]{min-width:0;padding:0 16px 20px}.content-toolbar[_ngcontent-%COMP%]{min-height:72px;display:flex;justify-content:space-between;align-items:center;gap:20px;border-bottom:1px solid #292c34}.breadcrumb[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px}.breadcrumb[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{border:0;background:transparent;color:#949ba8;padding:0;cursor:pointer;font-weight:600}.breadcrumb[_ngcontent-%COMP%] button.current[_ngcontent-%COMP%]{color:#fff}.breadcrumb[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#555b67}.content-toolbar[_ngcontent-%COMP%] input[_ngcontent-%COMP%], .run-panel[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{box-sizing:border-box;border:1px solid #343741;background:#101114;color:#eee;border-radius:5px;padding:8px 10px;outline:none}.content-toolbar[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{width:260px}.content-toolbar[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:focus, .run-panel[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:focus{border-color:#6366f1}.column-head[_ngcontent-%COMP%], .workflow-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(220px,1.4fr) 60px minmax(150px,.8fr) 120px;gap:12px;align-items:center}.column-head[_ngcontent-%COMP%]{height:38px;color:#707784;font-size:10px;text-transform:uppercase;font-weight:800}.workflow-row[_ngcontent-%COMP%]{min-height:68px;border-top:1px solid #25272e;padding:10px 0;cursor:pointer}.workflow-row[_ngcontent-%COMP%]:hover, .workflow-row.selected[_ngcontent-%COMP%]{background:#1b1d23}.workflow-name[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:10px;min-width:0;padding-left:8px}.workflow-name[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{min-width:0}.file-icon[_ngcontent-%COMP%]{display:grid;place-items:center;flex:0 0 28px;width:28px;height:32px;border:1px solid #4b4f5c;border-radius:4px;color:#a5b4fc;font-size:11px;font-weight:900}.workflow-name[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{display:block;font-size:13px;overflow-wrap:anywhere}.workflow-name[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:4px 0 0;color:#777e8b;font-size:11px;line-height:1.4;overflow:hidden;overflow-wrap:anywhere;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3}.node-count[_ngcontent-%COMP%]{color:#aeb4bf;font-size:12px}.workflow-row[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{font-size:10px;color:#777e8b;overflow:hidden;text-overflow:ellipsis}.row-actions[_ngcontent-%COMP%]{display:flex;gap:6px}.row-actions[_ngcontent-%COMP%] a[_ngcontent-%COMP%], .row-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{border:1px solid #383b45;background:#202229;color:#c9ccd3;border-radius:4px;padding:5px 7px;text-decoration:none;font:inherit;font-size:11px;cursor:pointer}.run-panel[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{font-size:16px;margin:7px 0}.run-panel[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{color:#9299a5;font-size:12px;line-height:1.5}.namespace[_ngcontent-%COMP%]{font:10px ui-monospace,monospace;color:#818cf8;overflow-wrap:anywhere}.run-panel[_ngcontent-%COMP%] dl[_ngcontent-%COMP%]{border-top:1px solid #292c34;border-bottom:1px solid #292c34;padding:8px 0;margin:14px 0}.run-panel[_ngcontent-%COMP%] dl[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{display:flex;justify-content:space-between;font-size:11px;padding:4px 0}.run-panel[_ngcontent-%COMP%] dt[_ngcontent-%COMP%]{color:#777e8b}.run-panel[_ngcontent-%COMP%] dd[_ngcontent-%COMP%]{margin:0;max-width:170px;overflow-wrap:anywhere;text-align:right}.run-panel[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{display:block;font-size:10px;text-transform:uppercase;color:#8f96a3;font-weight:700;margin:12px 0 6px}.run-panel[_ngcontent-%COMP%] label[_ngcontent-%COMP%]:first-of-type{margin-top:0}.run-panel[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{width:100%}.run-select[_ngcontent-%COMP%]{display:block;width:100%;box-sizing:border-box;border:1px solid #343741;background:#101114;color:#eee;border-radius:5px;padding:8px 10px;outline:none}.run-select[_ngcontent-%COMP%]:focus{border-color:#6366f1}.run-select[_ngcontent-%COMP%]:disabled{opacity:.55}.run-button[_ngcontent-%COMP%], .details-button[_ngcontent-%COMP%]{width:100%;justify-content:center;box-sizing:border-box;margin-top:9px;border:0}.run-button[_ngcontent-%COMP%]{background:#059669;color:#fff;padding:9px;border-radius:5px;font-weight:700;cursor:pointer}.run-button[_ngcontent-%COMP%]:disabled{opacity:.5}.details-button[_ngcontent-%COMP%]{background:#242630}.run-error[_ngcontent-%COMP%], .state.error[_ngcontent-%COMP%]{color:#fecaca}.run-error[_ngcontent-%COMP%]{font-size:11px;margin-top:10px}.state[_ngcontent-%COMP%], .empty[_ngcontent-%COMP%]{border:1px solid #292c34;padding:18px;color:#949ba8;border-radius:6px}.empty[_ngcontent-%COMP%]{text-align:center;margin-top:12px}.state[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{background:#0b0c0f;padding:2px 5px}@media(max-width:1100px){.explorer[_ngcontent-%COMP%]{grid-template-columns:210px 1fr}.run-panel[_ngcontent-%COMP%]{display:none}}@media(max-width:720px){.page[_ngcontent-%COMP%]{padding:14px}.page-header[_ngcontent-%COMP%]{align-items:flex-start}.explorer[_ngcontent-%COMP%]{display:block}.folder-panel[_ngcontent-%COMP%]{border-right:0;border-bottom:1px solid #292c34}.content-toolbar[_ngcontent-%COMP%]{align-items:flex-start;flex-direction:column;padding:14px 0}.content-toolbar[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{width:100%}.column-head[_ngcontent-%COMP%]{display:none}.workflow-row[_ngcontent-%COMP%]{grid-template-columns:1fr auto}.workflow-row[_ngcontent-%COMP%] > code[_ngcontent-%COMP%], .node-count[_ngcontent-%COMP%]{display:none}}"]})};export{U as WorkflowsComponent};
|
|
1
|
+
import{d as A,e as R}from"./chunk-N3FOQ3O5.js";import{a as B,b as j,c as q,d as $,e as D,f as Q,g as G,h as J,i as Y,j as H,k as K}from"./chunk-7ELOO4IC.js";import{Ba as W,Fa as u,Lb as z,Mb as N,O as P,Qa as c,Qb as L,Ra as n,Sa as t,T as m,U as f,Ua as v,Va as M,Xa as x,Ya as _,Za as s,eb as F,fb as I,gb as h,ib as o,jb as g,k as O,kb as V,lb as y,mb as w,nb as b,ob as C,qa as l,rb as k,u as S,ub as T,w as E}from"./chunk-4R37VVI4.js";var X=a=>({folder:a}),Z=a=>({id:a});function te(a,i){a&1&&(n(0,"div",7),o(1,"Loading workflows..."),t())}function ne(a,i){if(a&1&&(n(0,"div",8),o(1),t()),a&2){let e=s();l(),g(e.loadError)}}function oe(a,i){if(a&1&&(n(0,"p"),o(1),t()),a&2){let e=s(3);l(),g(e.folderError)}}function re(a,i){if(a&1){let e=x();n(0,"form",30),_("ngSubmit",function(){m(e);let d=s(2);return f(d.createFolder())}),n(1,"span"),o(2),t(),n(3,"input",31),C("ngModelChange",function(d){m(e);let p=s(2);return b(p.newFolderName,d)||(p.newFolderName=d),f(d)}),t(),n(4,"div")(5,"button",32),o(6,"Create"),t(),n(7,"button",22),_("click",function(){m(e);let d=s(2);return f(d.cancelFolder())}),o(8,"Cancel"),t()(),u(9,oe,2,1,"p",33),t()}if(a&2){let e=s(2);l(2),g(e.selectedFolder?e.selectedFolder+"/":""),l(),w("ngModel",e.newFolderName),l(2),c("disabled",e.creatingFolder),l(4),c("ngIf",e.folderError)}}function ie(a,i){if(a&1){let e=x();n(0,"button",34),_("click",function(){let d=m(e).$implicit,p=s(2);return f(p.selectFolder(d.path))}),n(1,"span",16),o(2,"\u203A"),t(),n(3,"span"),o(4),t(),n(5,"strong"),o(6),t()()}if(a&2){let e=i.$implicit,r=s(2);I("padding-left",14+e.depth*16,"px"),h("active",r.selectedFolder===e.path),l(4),g(e.name),l(2),g(e.count)}}function le(a,i){if(a&1){let e=x();v(0),n(1,"span"),o(2,"/"),t(),n(3,"button",22),_("click",function(){let d=m(e).$implicit,p=s(2);return f(p.selectFolder(d.path))}),o(4),t(),M()}if(a&2){let e=i.$implicit,r=i.last;l(3),h("current",r),l(),g(e.name)}}function ae(a,i){if(a&1){let e=x();n(0,"article",35),_("click",function(){let d=m(e).$implicit,p=s(2);return f(p.selectWorkflow(d))}),n(1,"div",36)(2,"span",37),o(3,"Y"),t(),n(4,"div")(5,"strong"),o(6),t(),n(7,"p"),o(8),t()()(),n(9,"span",38),o(10),t(),n(11,"code"),o(12),t(),n(13,"div",39)(14,"a",40),_("click",function(d){return d.stopPropagation()}),o(15,"Details"),t(),n(16,"button",22),_("click",function(d){let p=m(e).$implicit,ee=s(2);return d.stopPropagation(),f(ee.selectWorkflow(p))}),o(17,"Run"),t()()()}if(a&2){let e=i.$implicit,r=s(2);h("selected",(r.selectedWorkflow==null?null:r.selectedWorkflow.id)===e.id),l(6),g(e.name),l(2),g(e.description||"No description provided."),l(2),g(e.nodeCount),l(2),g(e.file),l(2),c("queryParams",k(7,Z,e.id))}}function de(a,i){a&1&&(n(0,"div",41),o(1,"No workflows match this folder and search."),t())}function ce(a,i){if(a&1&&(n(0,"option",55),o(1),t()),a&2){let e=i.$implicit;c("value",e.name)("disabled",!e.available),l(),y(" ",e.name,"",e.available?"":" \u2014 not available on this machine"," ")}}function se(a,i){if(a&1&&(n(0,"option",56),o(1),t()),a&2){let e=i.$implicit;c("value",e),l(),g(e)}}function pe(a,i){if(a&1){let e=x();v(0),n(1,"label",48),o(2,"Provider"),t(),n(3,"select",49),C("ngModelChange",function(d){m(e);let p=s(3);return b(p.runProvider,d)||(p.runProvider=d),f(d)}),_("ngModelChange",function(){m(e);let d=s(3);return f(d.onRunProviderChange())}),n(4,"option",50),o(5,"(workflow default)"),t(),u(6,ce,2,4,"option",51),t(),n(7,"label",52),o(8,"Model"),t(),n(9,"select",53),C("ngModelChange",function(d){m(e);let p=s(3);return b(p.runModel,d)||(p.runModel=d),f(d)}),n(10,"option",50),o(11,"(workflow default)"),t(),u(12,se,2,2,"option",54),t(),M()}if(a&2){let e=s(3);l(3),w("ngModel",e.runProvider),c("disabled",e.running),l(3),c("ngForOf",e.providers),l(3),w("ngModel",e.runModel),c("disabled",e.running),l(3),c("ngForOf",e.runModelOptions)}}function ge(a,i){if(a&1&&(n(0,"div",57),o(1),t()),a&2){let e=s(3);l(),g(e.runError)}}function me(a,i){if(a&1){let e=x();v(0),n(1,"div",12),o(2,"Run workflow"),t(),n(3,"span",42),o(4),t(),n(5,"h2"),o(6),t(),n(7,"p"),o(8),t(),n(9,"dl")(10,"div")(11,"dt"),o(12,"Nodes"),t(),n(13,"dd"),o(14),t()(),n(15,"div")(16,"dt"),o(17,"File"),t(),n(18,"dd"),o(19),t()()(),n(20,"label",43),o(21,"Arguments"),t(),n(22,"input",44),C("ngModelChange",function(d){m(e);let p=s(2);return b(p.runArgs,d)||(p.runArgs=d),f(d)}),t(),u(23,pe,13,6,"ng-container",33),n(24,"button",45),_("click",function(){m(e);let d=s(2);return f(d.runSelected())}),o(25),t(),n(26,"a",46),o(27,"Open details"),t(),u(28,ge,2,1,"div",47),M()}if(a&2){let e=s(2);l(4),g(e.selectedWorkflow.id),l(2),g(e.selectedWorkflow.name),l(2),g(e.selectedWorkflow.description||"No description provided."),l(6),g(e.selectedWorkflow.nodeCount),l(5),g(e.selectedWorkflow.file),l(3),w("ngModel",e.runArgs),c("disabled",e.running),l(),c("ngIf",e.providers.length),l(),c("disabled",e.running),l(),V(" ",e.running?"Starting...":"Run workflow"," "),l(),c("queryParams",k(12,Z,e.selectedWorkflow.id)),l(2),c("ngIf",e.runError)}}function fe(a,i){a&1&&(n(0,"div",12),o(1,"Inspector"),t(),n(2,"p"),o(3,"Select a workflow to inspect and run it."),t())}function _e(a,i){if(a&1){let e=x();n(0,"div",9)(1,"aside",10)(2,"div",11)(3,"div",12),o(4,"Folders"),t(),n(5,"button",13),_("click",function(){m(e);let d=s();return f(d.showFolderForm=!0)}),o(6,"+"),t()(),u(7,re,10,4,"form",14),n(8,"button",15),_("click",function(){m(e);let d=s();return f(d.selectFolder(""))}),n(9,"span",16),o(10,"\u2302"),t(),n(11,"span"),o(12,".vsaf/workflows"),t(),n(13,"strong"),o(14),t()(),u(15,ie,7,6,"button",17),n(16,"a",18),o(17,"+ Workflow in this folder"),t()(),n(18,"main",19)(19,"div",20)(20,"div")(21,"nav",21)(22,"button",22),_("click",function(){m(e);let d=s();return f(d.selectFolder(""))}),o(23,"workflows"),t(),u(24,le,5,3,"ng-container",23),t(),n(25,"p"),o(26),t()(),n(27,"input",24),C("ngModelChange",function(d){m(e);let p=s();return b(p.searchQuery,d)||(p.searchQuery=d),f(d)}),t()(),n(28,"div",25)(29,"span"),o(30,"Name"),t(),n(31,"span"),o(32,"Nodes"),t(),n(33,"span"),o(34,"Location"),t(),n(35,"span"),o(36,"Actions"),t()(),u(37,ae,18,9,"article",26)(38,de,2,0,"div",27),t(),n(39,"aside",28),u(40,me,29,14,"ng-container",29)(41,fe,4,0,"ng-template",null,0,T),t()()}if(a&2){let e=F(42),r=s();l(7),c("ngIf",r.showFolderForm),l(),h("active",r.selectedFolder===""),l(6),g(r.workflows.length),l(),c("ngForOf",r.folders),l(),c("queryParams",k(15,X,r.selectedFolder||null)),l(8),c("ngForOf",r.breadcrumbs),l(2),y("",r.visibleWorkflows.length," workflow",r.visibleWorkflows.length===1?"":"s"),l(),w("ngModel",r.searchQuery),l(10),c("ngForOf",r.visibleWorkflows)("ngForTrackBy",r.trackWorkflow),l(),c("ngIf",!r.visibleWorkflows.length),l(2),c("ngIf",r.selectedWorkflow)("ngIfElse",e)}}var U=class a{api=P(K);router=P(A);workflows=[];folderPaths=[];providers=[];loading=!0;loadError="";selectedFolder="";selectedWorkflow;searchQuery="";runArgs="";runProvider="";runModel="";running=!1;runError="";showFolderForm=!1;newFolderName="";creatingFolder=!1;folderError="";ngOnInit(){S({workflows:this.api.getWorkflows(),folders:this.api.getWorkflowFolders(),providers:this.api.getProviders().pipe(E(()=>O({providers:[]})))}).subscribe({next:i=>{this.workflows=i.workflows,this.folderPaths=i.folders,this.providers=i.providers.providers??[],this.loading=!1},error:i=>{this.loadError=i?.error?.error??"Failed to load workflows.",this.loading=!1}})}get runModelOptions(){return this.runProvider?this.providers.find(i=>i.name===this.runProvider)?.defaultModels??[]:[...new Set(this.providers.flatMap(i=>i.defaultModels))]}onRunProviderChange(){this.runModel&&!this.runModelOptions.includes(this.runModel)&&(this.runModel="")}get folders(){let i=new Set(this.folderPaths);for(let e of this.workflows){let r=e.directory.split("/").filter(Boolean);r.forEach((d,p)=>i.add(r.slice(0,p+1).join("/")))}return[...i].sort().map(e=>({path:e,name:e.slice(e.lastIndexOf("/")+1),depth:e.split("/").length-1,count:this.workflows.filter(r=>r.directory===e||r.directory.startsWith(`${e}/`)).length}))}get breadcrumbs(){let i=this.selectedFolder.split("/").filter(Boolean);return i.map((e,r)=>({name:e,path:i.slice(0,r+1).join("/")}))}get visibleWorkflows(){let i=this.searchQuery.trim().toLowerCase();return this.workflows.filter(e=>{let r=!this.selectedFolder||e.directory===this.selectedFolder,d=!i||`${e.name} ${e.id} ${e.description}`.toLowerCase().includes(i);return r&&d})}selectFolder(i){this.selectedFolder=i,this.selectedWorkflow=void 0,this.runError=""}createFolder(){let i=this.newFolderName.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"");if(!i){this.folderError="Enter a valid folder name.";return}let e=this.selectedFolder?`${this.selectedFolder}/${i}`:i;this.creatingFolder=!0,this.folderError="",this.api.createWorkflowFolder(e).subscribe({next:()=>{this.creatingFolder=!1,this.folderPaths=[...new Set([...this.folderPaths,e])].sort(),this.selectFolder(e),this.cancelFolder()},error:r=>{this.creatingFolder=!1,this.folderError=r?.error?.error??"Failed to create folder."}})}cancelFolder(){this.showFolderForm=!1,this.newFolderName="",this.folderError=""}selectWorkflow(i){this.selectedWorkflow=i,this.runError=""}trackWorkflow(i,e){return e.id}runSelected(){!this.selectedWorkflow||this.running||(this.running=!0,this.api.startRun(this.selectedWorkflow.id,this.runArgs,{provider:this.runProvider||void 0,model:this.runModel||void 0}).subscribe({next:i=>this.router.navigate(["/runs",i.runId]),error:i=>{this.running=!1,this.runError=i?.error?.error??"Failed to start workflow."}}))}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=W({type:a,selectors:[["app-workflows"]],decls:14,vars:6,consts:[["noSelection",""],[1,"page"],[1,"page-header"],["routerLink","/workflows/builder",1,"primary-button",3,"queryParams"],["class","state",4,"ngIf"],["class","state error",4,"ngIf"],["class","explorer",4,"ngIf"],[1,"state"],[1,"state","error"],[1,"explorer"],[1,"folder-panel"],[1,"folder-heading"],[1,"panel-heading"],["type","button","title","Create subfolder",3,"click"],["class","folder-form",3,"ngSubmit",4,"ngIf"],["type","button",1,"folder-row","root",3,"click"],[1,"chevron"],["type","button","class","folder-row",3,"active","padding-left","click",4,"ngFor","ngForOf"],["routerLink","/workflows/builder",1,"folder-new-flow",3,"queryParams"],[1,"content-panel"],[1,"content-toolbar"],["aria-label","Workflow folder",1,"breadcrumb"],["type","button",3,"click"],[4,"ngFor","ngForOf"],["type","search","placeholder","Search this workspace",3,"ngModelChange","ngModel"],[1,"column-head"],["class","workflow-row",3,"selected","click",4,"ngFor","ngForOf","ngForTrackBy"],["class","empty",4,"ngIf"],[1,"run-panel"],[4,"ngIf","ngIfElse"],[1,"folder-form",3,"ngSubmit"],["name","folderName","placeholder","folder-name","autofocus","",3,"ngModelChange","ngModel"],["type","submit",3,"disabled"],[4,"ngIf"],["type","button",1,"folder-row",3,"click"],[1,"workflow-row",3,"click"],[1,"workflow-name"],[1,"file-icon"],[1,"node-count"],[1,"row-actions"],["routerLink","/workflows/detail",3,"click","queryParams"],[1,"empty"],[1,"namespace"],["for","run-args"],["id","run-args","placeholder","Optional run args",3,"ngModelChange","ngModel","disabled"],["type","button",1,"run-button",3,"click","disabled"],["routerLink","/workflows/detail",1,"details-button",3,"queryParams"],["class","run-error",4,"ngIf"],["for","run-provider"],["id","run-provider",1,"run-select",3,"ngModelChange","ngModel","disabled"],["value",""],[3,"value","disabled",4,"ngFor","ngForOf"],["for","run-model"],["id","run-model",1,"run-select",3,"ngModelChange","ngModel","disabled"],[3,"value",4,"ngFor","ngForOf"],[3,"value","disabled"],[3,"value"],[1,"run-error"]],template:function(e,r){e&1&&(n(0,"section",1)(1,"header",2)(2,"div")(3,"h1"),o(4,"Workflows"),t(),n(5,"p"),o(6,"Browse workflow definitions by their directory structure."),t()(),n(7,"a",3)(8,"span"),o(9,"+"),t(),o(10," New workflow"),t()(),u(11,te,2,0,"div",4)(12,ne,2,1,"div",5)(13,_e,43,17,"div",6),t()),e&2&&(l(7),c("queryParams",k(4,X,r.selectedFolder||null)),l(4),c("ngIf",r.loading),l(),c("ngIf",r.loadError),l(),c("ngIf",!r.loading&&!r.loadError))},dependencies:[L,z,N,H,Q,J,Y,B,G,j,q,D,$,R],styles:["[_nghost-%COMP%]{display:block;min-height:calc(100vh - 56px);background:#101114;color:#e7e7ea}.page[_ngcontent-%COMP%]{padding:22px;max-width:1600px;margin:auto}.page-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:18px}.page-header[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{font-size:21px;margin:0}.page-header[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .content-toolbar[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font-size:13px;color:#8f96a3;margin:4px 0 0}.primary-button[_ngcontent-%COMP%], .details-button[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:7px;background:#6366f1;color:#fff;text-decoration:none;padding:9px 12px;border-radius:6px;font-size:13px;font-weight:700}.explorer[_ngcontent-%COMP%]{display:grid;grid-template-columns:240px minmax(500px,1fr) 280px;min-height:620px;border:1px solid #292c34;border-radius:7px;overflow:hidden;background:#15161a}.folder-panel[_ngcontent-%COMP%], .run-panel[_ngcontent-%COMP%]{background:#131419}.folder-panel[_ngcontent-%COMP%]{border-right:1px solid #292c34;padding:12px 8px}.run-panel[_ngcontent-%COMP%]{border-left:1px solid #292c34;padding:14px}.panel-heading[_ngcontent-%COMP%]{font-size:11px;color:#8f96a3;text-transform:uppercase;font-weight:800;margin:3px 7px 12px}.folder-heading[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.folder-heading[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{width:24px;height:24px;border:1px solid #353842;border-radius:4px;background:#202229;color:#fff;cursor:pointer}.folder-form[_ngcontent-%COMP%]{border:1px solid #383b45;background:#191b20;padding:8px;margin-bottom:8px;border-radius:5px}.folder-form[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:block;color:#777e8b;font-size:10px;overflow-wrap:anywhere}.folder-form[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{box-sizing:border-box;width:100%;margin:5px 0;border:1px solid #3b3e49;background:#101114;color:#fff;padding:6px;border-radius:4px}.folder-form[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{display:flex;gap:5px}.folder-form[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{border:1px solid #3b3e49;background:#252731;color:#ddd;padding:4px 6px;border-radius:4px;font-size:10px}.folder-form[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{color:#fca5a5;font-size:10px;margin:6px 0 0}.folder-new-flow[_ngcontent-%COMP%]{display:block;color:#a5b4fc;text-decoration:none;font-size:11px;padding:9px 12px;border-top:1px solid #292c34;margin-top:8px}.folder-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:16px minmax(0,1fr) auto;gap:7px;align-items:center;width:100%;height:34px;border:0;border-radius:5px;background:transparent;color:#b7bbc4;text-align:left;cursor:pointer;padding-right:9px}.folder-row[_ngcontent-%COMP%]:hover, .folder-row.active[_ngcontent-%COMP%]{background:#242630;color:#fff}.folder-row[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(2){overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.folder-row[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-size:10px;color:#6f7684}.chevron[_ngcontent-%COMP%]{color:#7c83ff}.content-panel[_ngcontent-%COMP%]{min-width:0;padding:0 16px 20px}.content-toolbar[_ngcontent-%COMP%]{min-height:72px;display:flex;justify-content:space-between;align-items:center;gap:20px;border-bottom:1px solid #292c34}.breadcrumb[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px}.breadcrumb[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{border:0;background:transparent;color:#949ba8;padding:0;cursor:pointer;font-weight:600}.breadcrumb[_ngcontent-%COMP%] button.current[_ngcontent-%COMP%]{color:#fff}.breadcrumb[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#555b67}.content-toolbar[_ngcontent-%COMP%] input[_ngcontent-%COMP%], .run-panel[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{box-sizing:border-box;border:1px solid #343741;background:#101114;color:#eee;border-radius:5px;padding:8px 10px;outline:none}.content-toolbar[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{width:260px}.content-toolbar[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:focus, .run-panel[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:focus{border-color:#6366f1}.column-head[_ngcontent-%COMP%], .workflow-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(220px,1.4fr) 60px minmax(150px,.8fr) 120px;gap:12px;align-items:center}.column-head[_ngcontent-%COMP%]{height:38px;color:#707784;font-size:10px;text-transform:uppercase;font-weight:800}.workflow-row[_ngcontent-%COMP%]{min-height:68px;border-top:1px solid #25272e;padding:10px 0;cursor:pointer}.workflow-row[_ngcontent-%COMP%]:hover, .workflow-row.selected[_ngcontent-%COMP%]{background:#1b1d23}.workflow-name[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:10px;min-width:0;padding-left:8px}.workflow-name[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{min-width:0}.file-icon[_ngcontent-%COMP%]{display:grid;place-items:center;flex:0 0 28px;width:28px;height:32px;border:1px solid #4b4f5c;border-radius:4px;color:#a5b4fc;font-size:11px;font-weight:900}.workflow-name[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{display:block;font-size:13px;overflow-wrap:anywhere}.workflow-name[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:4px 0 0;color:#777e8b;font-size:11px;line-height:1.4;overflow:hidden;overflow-wrap:anywhere;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3}.node-count[_ngcontent-%COMP%]{color:#aeb4bf;font-size:12px}.workflow-row[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{font-size:10px;color:#777e8b;overflow:hidden;text-overflow:ellipsis}.row-actions[_ngcontent-%COMP%]{display:flex;gap:6px}.row-actions[_ngcontent-%COMP%] a[_ngcontent-%COMP%], .row-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{border:1px solid #383b45;background:#202229;color:#c9ccd3;border-radius:4px;padding:5px 7px;text-decoration:none;font:inherit;font-size:11px;cursor:pointer}.run-panel[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{font-size:16px;margin:7px 0}.run-panel[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{color:#9299a5;font-size:12px;line-height:1.5}.namespace[_ngcontent-%COMP%]{font:10px ui-monospace,monospace;color:#818cf8;overflow-wrap:anywhere}.run-panel[_ngcontent-%COMP%] dl[_ngcontent-%COMP%]{border-top:1px solid #292c34;border-bottom:1px solid #292c34;padding:8px 0;margin:14px 0}.run-panel[_ngcontent-%COMP%] dl[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{display:flex;justify-content:space-between;font-size:11px;padding:4px 0}.run-panel[_ngcontent-%COMP%] dt[_ngcontent-%COMP%]{color:#777e8b}.run-panel[_ngcontent-%COMP%] dd[_ngcontent-%COMP%]{margin:0;max-width:170px;overflow-wrap:anywhere;text-align:right}.run-panel[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{display:block;font-size:10px;text-transform:uppercase;color:#8f96a3;font-weight:700;margin:12px 0 6px}.run-panel[_ngcontent-%COMP%] label[_ngcontent-%COMP%]:first-of-type{margin-top:0}.run-panel[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{width:100%}.run-select[_ngcontent-%COMP%]{display:block;width:100%;box-sizing:border-box;border:1px solid #343741;background:#101114;color:#eee;border-radius:5px;padding:8px 10px;outline:none}.run-select[_ngcontent-%COMP%]:focus{border-color:#6366f1}.run-select[_ngcontent-%COMP%]:disabled{opacity:.55}.run-button[_ngcontent-%COMP%], .details-button[_ngcontent-%COMP%]{width:100%;justify-content:center;box-sizing:border-box;margin-top:9px;border:0}.run-button[_ngcontent-%COMP%]{background:#059669;color:#fff;padding:9px;border-radius:5px;font-weight:700;cursor:pointer}.run-button[_ngcontent-%COMP%]:disabled{opacity:.5}.details-button[_ngcontent-%COMP%]{background:#242630}.run-error[_ngcontent-%COMP%], .state.error[_ngcontent-%COMP%]{color:#fecaca}.run-error[_ngcontent-%COMP%]{font-size:11px;margin-top:10px}.state[_ngcontent-%COMP%], .empty[_ngcontent-%COMP%]{border:1px solid #292c34;padding:18px;color:#949ba8;border-radius:6px}.empty[_ngcontent-%COMP%]{text-align:center;margin-top:12px}.state[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{background:#0b0c0f;padding:2px 5px}@media(max-width:1100px){.explorer[_ngcontent-%COMP%]{grid-template-columns:210px 1fr}.run-panel[_ngcontent-%COMP%]{display:none}}@media(max-width:720px){.page[_ngcontent-%COMP%]{padding:14px}.page-header[_ngcontent-%COMP%]{align-items:flex-start}.explorer[_ngcontent-%COMP%]{display:block}.folder-panel[_ngcontent-%COMP%]{border-right:0;border-bottom:1px solid #292c34}.content-toolbar[_ngcontent-%COMP%]{align-items:flex-start;flex-direction:column;padding:14px 0}.content-toolbar[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{width:100%}.column-head[_ngcontent-%COMP%]{display:none}.workflow-row[_ngcontent-%COMP%]{grid-template-columns:1fr auto}.workflow-row[_ngcontent-%COMP%] > code[_ngcontent-%COMP%], .node-count[_ngcontent-%COMP%]{display:none}}"]})};export{U as WorkflowsComponent};
|