or3-workflow-vue 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +86 -192
- package/dist/index.js +2641 -2734
- package/dist/index.umd.cjs +7 -7
- package/dist/or3-workflow-vue.css +1 -0
- package/package.json +4 -4
- package/dist/style.css +0 -1
package/dist/index.umd.cjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
(function(T,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("or3-workflow-core"),require("@vue-flow/core"),require("@vue-flow/background"),require("@vue-flow/controls"),require("@vue-flow/minimap")):typeof define=="function"&&define.amd?define(["exports","vue","or3-workflow-core","@vue-flow/core","@vue-flow/background","@vue-flow/controls","@vue-flow/minimap"],e):(T=typeof globalThis<"u"?globalThis:T||self,e(T.Or3WorkflowVue={},T.Vue,T.Or3WorkflowCore,T.VueFlow,T.VueFlowBackground,T.VueFlowControls,T.VueFlowMinimap))})(this,function(T,e,Y,I,lt,De,at){"use strict";function $e(l={}){const r=e.shallowRef(null),s=Y.createWorkflowEditor(l);r.value=e.markRaw(s);const i=s.on("update",()=>{e.triggerRef(r)});return e.onBeforeUnmount(()=>{var a;i(),(a=r.value)==null||a.destroy(),r.value=null}),r}const st=$e,ce=e.ref(new Map);function Ie(){const l=(i,a)=>{ce.value.set(i,a)},r=i=>ce.value.get(i),s=()=>{ce.value.clear()};return{outputs:e.readonly(ce),setOutput:l,getOutput:r,clear:s}}function rt(){const{setOutput:l,clear:r}=Ie(),s=e.ref(!1),i=e.ref(null),a=e.ref({}),y=e.ref({}),n=e.ref(null),c=e.ref(null),w=()=>{s.value=!1,i.value=null,a.value={},y.value={},n.value=null,c.value=null,r()};return{isRunning:s,currentNodeId:i,nodeStatuses:a,nodeOutputs:y,error:n,result:c,execute:async(p,k,D,u)=>{w(),s.value=!0;const P={onNodeStart:f=>{var b;i.value=f,a.value[f]="active",(b=u==null?void 0:u.onNodeStart)==null||b.call(u,f)},onNodeFinish:(f,b)=>{var N;a.value[f]="completed",y.value[f]=b,l(f,b),i.value===f&&(i.value=null),(N=u==null?void 0:u.onNodeFinish)==null||N.call(u,f,b)},onNodeError:(f,b)=>{var N;a.value[f]="error",n.value=b,(N=u==null?void 0:u.onNodeError)==null||N.call(u,f,b)},onToken:(f,b)=>{var N;(N=u==null?void 0:u.onToken)==null||N.call(u,f,b)},onReasoning:(f,b)=>{var N;(N=u==null?void 0:u.onReasoning)==null||N.call(u,f,b)},onRouteSelected:(f,b)=>{var N;(N=u==null?void 0:u.onRouteSelected)==null||N.call(u,f,b)},onTokenUsage:(f,b)=>{var N;(N=u==null?void 0:u.onTokenUsage)==null||N.call(u,f,b)},onContextCompacted:f=>{var b;(b=u==null?void 0:u.onContextCompacted)==null||b.call(u,f)},onBranchStart:(f,b,N)=>{var g;(g=u==null?void 0:u.onBranchStart)==null||g.call(u,f,b,N)},onBranchToken:(f,b,N,g)=>{var d;(d=u==null?void 0:u.onBranchToken)==null||d.call(u,f,b,N,g)},onBranchReasoning:(f,b,N,g)=>{var d;(d=u==null?void 0:u.onBranchReasoning)==null||d.call(u,f,b,N,g)},onBranchComplete:(f,b,N,g)=>{var d;(d=u==null?void 0:u.onBranchComplete)==null||d.call(u,f,b,N,g),l(`${f}:${b}`,g)}};try{const f=await p.execute(k,D,P);return c.value=f,f}catch(f){const b=f instanceof Error?f:new Error(String(f));throw n.value=b,b}finally{s.value=!1,i.value=null}},stop:p=>{s.value&&(p.stop(),s.value=!1)},reset:w}}function it(l){const r=e.ref(!1),s=e.ref(null),i=e.ref([]),a=e.ref(null),y=async()=>{r.value=!0,s.value=null;try{const E=await l.list();return i.value=E,E}catch(E){const V=E instanceof Error?E:new Error(String(E));throw s.value=V,V}finally{r.value=!1}};return{isLoading:r,error:s,workflows:i,currentWorkflow:a,loadList:y,load:async E=>{r.value=!0,s.value=null;try{const V=await l.load(E);return a.value=V,V}catch(V){const p=V instanceof Error?V:new Error(String(V));throw s.value=p,p}finally{r.value=!1}},save:async E=>{r.value=!0,s.value=null;try{const V=JSON.parse(JSON.stringify(E)),p=await l.save(V);return await y(),p}catch(V){const p=V instanceof Error?V:new Error(String(V));throw s.value=p,p}finally{r.value=!1}},remove:async E=>{r.value=!0,s.value=null;try{await l.delete(E),await y(),a.value=null}catch(V){const p=V instanceof Error?V:new Error(String(V));throw s.value=p,p}finally{r.value=!1}}}}function Me(){const l=e.ref({isRunning:!1,streamingContent:"",nodeStatuses:{},currentNodeId:null,error:null}),r=w=>{l.value.isRunning=w},s=w=>{l.value.streamingContent=w},i=w=>{l.value.streamingContent+=w},a=(w,E)=>{l.value.nodeStatuses[w]=E},y=w=>{l.value.currentNodeId=w},n=w=>{l.value.error=w},c=()=>{l.value={isRunning:!1,streamingContent:"",nodeStatuses:{},currentNodeId:null,error:null}};return{state:e.readonly(l),setRunning:r,setStreamingContent:s,appendStreamingContent:i,setNodeStatus:a,setCurrentNodeId:y,setError:n,reset:c}}function Te(){return Me()}function dt(l,r){const s=e.ref(l.getNodes().find(c=>c.id===r)),i=()=>{s.value=l.getNodes().find(c=>c.id===r)},a=l.on("update",i),y=l.on("nodeUpdate",i);return e.onBeforeUnmount(()=>{a(),y()}),{node:s,updateData:c=>{s.value&&l.commands.updateNodeData(s.value.id,c)}}}function Le(){const l=e.shallowRef(new Map);return{components:l,register(r,s){if(!r||typeof r!="string"){console.warn("Node type must be a non-empty string");return}const i=new Map(l.value);i.set(r,s),l.value=i},unregister(r){if(!l.value.has(r))return;const s=new Map(l.value);s.delete(r),l.value=s},get(r){return l.value.get(r)},has(r){return l.value.has(r)},getTypes(){return Array.from(l.value.keys())},clear(){l.value=new Map}}}const Oe=Le();function ct(l){Promise.resolve().then(()=>ut).then(r=>l.register("start",r.default)),Promise.resolve().then(()=>$t).then(r=>l.register("agent",r.default)),Promise.resolve().then(()=>At).then(r=>l.register("router",r.default)),Promise.resolve().then(()=>Xt).then(r=>l.register("parallel",r.default)),Promise.resolve().then(()=>io).then(r=>l.register("whileLoop",r.default)),Promise.resolve().then(()=>Vo).then(r=>l.register("subflow",r.default)),Promise.resolve().then(()=>Oo).then(r=>l.register("output",r.default))}ct(Oe);const mt={class:"start-content"},pt=e.defineComponent({__name:"StartNode",props:{id:{},data:{},selected:{type:Boolean}},setup(l){const r=l,s=e.computed(()=>r.data.label||"Start"),i=e.computed(()=>r.data.status||"idle");return(a,y)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["start-node",[`status-${i.value}`,{selected:l.selected}]])},[e.createElementVNode("div",mt,[y[0]||(y[0]=e.createElementVNode("svg",{class:"play-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polygon",{points:"5 3 19 12 5 21 5 3"})],-1)),e.createElementVNode("span",null,e.toDisplayString(s.value),1)]),e.createVNode(e.unref(I.Handle),{type:"source",position:e.unref(I.Position).Bottom,class:"handle"},null,8,["position"])],2))}}),H=(l,r)=>{const s=l.__vccOpts||l;for(const[i,a]of r)s[i]=a;return s},Pe=H(pt,[["__scopeId","data-v-740a3c44"]]),ut=Object.freeze(Object.defineProperty({__proto__:null,default:Pe},Symbol.toStringTag,{value:"Module"})),ft={},gt={xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24"};function ht(l,r){return e.openBlock(),e.createElementBlock("svg",gt,[...r[0]||(r[0]=[e.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[e.createElementVNode("path",{d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 0 0-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 0 0-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 0 0-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 0 0-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 0 0 1.066-2.573c-.94-1.543.826-3.31 2.37-2.37c1 .608 2.296.07 2.572-1.065"}),e.createElementVNode("path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0-6 0"})],-1)])])}const Nt=H(ft,[["render",ht]]),Et={class:"node-meta-container"},kt={class:"node-id"},le=H(e.defineComponent({__name:"NodeWrapper",props:{id:{},selected:{type:Boolean},status:{default:"idle"},variant:{default:"default"}},emits:["inspect"],setup(l,{emit:r}){const s=l,i=r,a=e.computed(()=>["node-wrapper",`status-${s.status}`,`variant-${s.variant}`,{selected:s.selected}]);function y(n){n.stopPropagation(),i("inspect")}return(n,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(a.value)},[e.createElementVNode("div",Et,[e.createElementVNode("div",kt,e.toDisplayString(l.id.slice(0,6)),1),e.createElementVNode("button",{class:"inspect-btn",title:"Open inspector","aria-label":"Open node inspector",onClick:y},[e.createVNode(Nt)])]),e.renderSlot(n.$slots,"default",{},void 0,!0)],2))}}),[["__scopeId","data-v-aac8cd21"]]),yt={},Vt={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function wt(l,r){return e.openBlock(),e.createElementBlock("svg",Vt,[...r[0]||(r[0]=[e.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 6a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2zm6-4v2m-3 8v9m6-9v9M5 16l4-2m6 0l4 2M9 18h6M10 8v.01M14 8v.01"},null,-1)])])}const Re=H(yt,[["render",wt]]),bt={class:"agent-node"},Bt={class:"node-header"},_t={class:"icon-wrapper"},xt={class:"node-label"},Ct={key:0,class:"status-spinner"},St={class:"model-badge"},Dt={class:"model-name"},ze=H(e.defineComponent({__name:"AgentNode",props:{id:{},data:{},selected:{type:Boolean}},emits:["inspect"],setup(l,{emit:r}){const s=l,i=e.computed(()=>s.data.label||"Agent"),a=e.computed(()=>s.data.model||"z-ai/glm-4.6:exacto"),y=e.computed(()=>s.data.status||"idle"),n=e.computed(()=>{const w=a.value.split("/");return w[w.length-1]}),c=r;return(w,E)=>(e.openBlock(),e.createBlock(le,{id:l.id,selected:l.selected,status:y.value,variant:"accent",onInspect:E[0]||(E[0]=V=>c("inspect"))},{default:e.withCtx(()=>[e.createVNode(e.unref(I.Handle),{type:"target",position:e.unref(I.Position).Top,class:"handle"},null,8,["position"]),e.createElementVNode("div",bt,[e.createElementVNode("div",Bt,[e.createElementVNode("div",_t,[e.createVNode(Re,{class:"bot-icon"})]),e.createElementVNode("span",xt,e.toDisplayString(i.value),1),y.value==="active"?(e.openBlock(),e.createElementBlock("div",Ct)):e.createCommentVNode("",!0)]),e.createElementVNode("div",St,[e.createElementVNode("span",Dt,e.toDisplayString(n.value),1)])]),e.createVNode(e.unref(I.Handle),{type:"source",position:e.unref(I.Position).Bottom,class:"handle"},null,8,["position"]),e.createVNode(e.unref(I.Handle),{type:"source",position:e.unref(I.Position).Right,id:"error",class:"handle error-handle"},null,8,["position"])]),_:1},8,["id","selected","status"]))}}),[["__scopeId","data-v-47d0bb13"]]),$t=Object.freeze(Object.defineProperty({__proto__:null,default:ze},Symbol.toStringTag,{value:"Module"})),It={},Mt={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function Tt(l,r){return e.openBlock(),e.createElementBlock("svg",Mt,[...r[0]||(r[0]=[e.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 17a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2zm12 0a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2zM9 5a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2zM6 15v-1a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v1m-6-6v3"},null,-1)])])}const He=H(It,[["render",Tt]]),Lt={class:"router-node"},Ot={class:"node-header"},Pt={class:"icon-wrapper"},Rt={class:"node-label"},zt={key:0,class:"status-spinner"},Ht={class:"router-badge"},Ae=H(e.defineComponent({__name:"RouterNode",props:{id:{},data:{},selected:{type:Boolean}},emits:["inspect"],setup(l,{emit:r}){const s=l,i=e.computed(()=>s.data.label||"Router"),a=e.computed(()=>s.data.status||"idle"),y=[{id:"route-1",label:"Route 1"},{id:"route-2",label:"Route 2"}],n=e.computed(()=>{const E=s.data.routes||y;return E.length>0?E:y}),c=e.computed(()=>{const E=n.value.length;return E===1?[50]:n.value.map((V,p)=>(p+1)/(E+1)*100)}),w=r;return(E,V)=>(e.openBlock(),e.createBlock(le,{id:l.id,selected:l.selected,status:a.value,variant:"warning",onInspect:V[0]||(V[0]=p=>w("inspect"))},{default:e.withCtx(()=>[e.createVNode(e.unref(I.Handle),{type:"target",position:e.unref(I.Position).Top,class:"handle"},null,8,["position"]),e.createElementVNode("div",Lt,[e.createElementVNode("div",Ot,[e.createElementVNode("div",Pt,[e.createVNode(He,{class:"branch-icon"})]),e.createElementVNode("span",Rt,e.toDisplayString(i.value),1),a.value==="active"?(e.openBlock(),e.createElementBlock("div",zt)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ht,[e.createElementVNode("span",null,"Router · "+e.toDisplayString(n.value.length)+" routes",1)])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(p,k)=>(e.openBlock(),e.createBlock(e.unref(I.Handle),{key:p.id,type:"source",position:e.unref(I.Position).Bottom,id:p.id,class:"handle route-handle","data-route-label":p.label||p.id,title:p.label||p.id,style:e.normalizeStyle({left:`${c.value[k]}%`})},null,8,["position","id","data-route-label","title","style"]))),128)),e.createVNode(e.unref(I.Handle),{type:"source",position:e.unref(I.Position).Right,id:"error",class:"handle error-handle"},null,8,["position"])]),_:1},8,["id","selected","status"]))}}),[["__scopeId","data-v-36dffe57"]]),At=Object.freeze(Object.defineProperty({__proto__:null,default:Ae},Symbol.toStringTag,{value:"Module"})),vt={},Ft={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function jt(l,r){return e.openBlock(),e.createElementBlock("svg",Ft,[...r[0]||(r[0]=[e.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[e.createElementVNode("path",{d:"M21 17h-5.397a5 5 0 0 1-4.096-2.133l-.514-.734A5 5 0 0 0 6.897 12H3m18-5h-5.395a5 5 0 0 0-4.098 2.135l-.51.73A5 5 0 0 1 6.9 12H3"}),e.createElementVNode("path",{d:"m18 10l3-3l-3-3m0 16l3-3l-3-3"})],-1)])])}const ve=H(vt,[["render",jt]]),Ut={class:"parallel-node"},Wt={class:"node-header"},Kt={class:"icon-wrapper"},qt={class:"node-label"},Gt={key:0,class:"status-spinner"},Yt={class:"parallel-badge"},Fe=H(e.defineComponent({__name:"ParallelNode",props:{id:{},data:{},selected:{type:Boolean}},emits:["inspect"],setup(l,{emit:r}){const s=l,i=e.computed(()=>s.data.label||"Parallel"),a=e.computed(()=>s.data.status||"idle"),y=e.computed(()=>s.data.mergeEnabled!==!1),n=e.computed(()=>s.data.branches||[]),c=e.computed(()=>{const E=n.value.length;return E===0?[]:E===1?[50]:n.value.map((V,p)=>(p+1)/(E+1)*100)}),w=r;return(E,V)=>(e.openBlock(),e.createBlock(le,{id:l.id,selected:l.selected,status:a.value,variant:"info",onInspect:V[0]||(V[0]=p=>w("inspect"))},{default:e.withCtx(()=>[e.createVNode(e.unref(I.Handle),{type:"target",position:e.unref(I.Position).Top,class:"handle"},null,8,["position"]),e.createElementVNode("div",Ut,[e.createElementVNode("div",Wt,[e.createElementVNode("div",Kt,[e.createVNode(ve,{class:"merge-icon"})]),e.createElementVNode("span",qt,e.toDisplayString(i.value),1),a.value==="active"?(e.openBlock(),e.createElementBlock("div",Gt)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Yt,[e.createElementVNode("span",null,e.toDisplayString(y.value?"Parallel Merge":"Parallel Split")+" · "+e.toDisplayString(n.value.length)+" branches",1)])]),y.value?(e.openBlock(),e.createBlock(e.unref(I.Handle),{key:0,type:"source",position:e.unref(I.Position).Bottom,id:"merged",class:"handle merged-output"},null,8,["position"])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(n.value,(p,k)=>(e.openBlock(),e.createBlock(e.unref(I.Handle),{key:p.id,type:"source",position:e.unref(I.Position).Bottom,id:p.id,class:"handle branch-handle",style:e.normalizeStyle({left:`${c.value[k]}%`})},null,8,["position","id","style"]))),128))]),_:1},8,["id","selected","status"]))}}),[["__scopeId","data-v-fe2a1cc4"]]),Xt=Object.freeze(Object.defineProperty({__proto__:null,default:Fe},Symbol.toStringTag,{value:"Module"})),Jt={},Qt={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function Zt(l,r){return e.openBlock(),e.createElementBlock("svg",Qt,[...r[0]||(r[0]=[e.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 6a3 3 0 1 0 6 0a3 3 0 0 0-6 0m18 5V8a2 2 0 0 0-2-2h-6l3 3m0-6l-3 3M3 13v3a2 2 0 0 0 2 2h6l-3-3m0 6l3-3m4 0a3 3 0 1 0 6 0a3 3 0 0 0-6 0"},null,-1)])])}const je=H(Jt,[["render",Zt]]),eo={class:"while-node"},to={class:"node-header"},oo={class:"icon-wrapper"},no={class:"node-label"},lo={class:"meta"},ao={class:"meta-item"},so={class:"meta-item"},ro={key:0,class:"meta-item accumulate-badge",title:"Collects all outputs"},Ue=H(e.defineComponent({__name:"WhileLoopNode",props:{id:{},data:{},selected:{type:Boolean}},emits:["inspect"],setup(l,{emit:r}){const s=l,i=e.computed(()=>s.data.label||"While Loop"),a=e.computed(()=>s.data.status||"idle"),y=e.computed(()=>s.data.maxIterations??10),n=e.computed(()=>s.data.loopMode??"condition"),c=e.computed(()=>s.data.outputMode??"last"),w=e.computed(()=>typeof s.data.iteration=="number"?s.data.iteration:null),E=e.computed(()=>n.value==="fixed"?"Fixed":"While"),V=r;return(p,k)=>(e.openBlock(),e.createBlock(le,{id:l.id,selected:l.selected,status:a.value,variant:"info",onInspect:k[0]||(k[0]=D=>V("inspect"))},{default:e.withCtx(()=>[e.createVNode(e.unref(I.Handle),{type:"target",position:e.unref(I.Position).Top,class:"handle"},null,8,["position"]),e.createElementVNode("div",eo,[e.createElementVNode("div",to,[e.createElementVNode("div",oo,[e.createVNode(je,{class:"loop-icon"})]),e.createElementVNode("span",no,e.toDisplayString(i.value),1),e.createElementVNode("span",{class:e.normalizeClass(["pill",{fixed:n.value==="fixed"}])},e.toDisplayString(E.value),3)]),e.createElementVNode("div",lo,[e.createElementVNode("span",ao,[k[1]||(k[1]=e.createElementVNode("strong",null,"Max:",-1)),e.createTextVNode(" "+e.toDisplayString(y.value),1)]),e.createElementVNode("span",so,[k[2]||(k[2]=e.createElementVNode("strong",null,"Iter:",-1)),e.createTextVNode(" "+e.toDisplayString(w.value??"—"),1)]),c.value==="accumulate"?(e.openBlock(),e.createElementBlock("span",ro," 📦 ")):e.createCommentVNode("",!0)])]),k[3]||(k[3]=e.createElementVNode("div",{class:"port-labels"},[e.createElementVNode("span",{class:"port-label body-label"},"↻ Loop"),e.createElementVNode("span",{class:"port-label done-label"},"✓ Exit")],-1)),e.createVNode(e.unref(I.Handle),{type:"source",position:e.unref(I.Position).Bottom,id:"body",class:"handle body-handle",style:{left:"30%"}},null,8,["position"]),e.createVNode(e.unref(I.Handle),{type:"source",position:e.unref(I.Position).Bottom,id:"done",class:"handle done-handle",style:{left:"70%"}},null,8,["position"])]),_:1},8,["id","selected","status"]))}}),[["__scopeId","data-v-e439cd33"]]),io=Object.freeze(Object.defineProperty({__proto__:null,default:Ue},Symbol.toStringTag,{value:"Module"})),co={},mo={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function po(l,r){return e.openBlock(),e.createElementBlock("svg",mo,[...r[0]||(r[0]=[e.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[e.createElementVNode("path",{d:"m14 12l6-3l-8-4l-8 4l6 3"}),e.createElementVNode("path",{fill:"currentColor",d:"m10 12l-6 3l8 4l8-4l-6-3l-2 1z"})],-1)])])}const We=H(co,[["render",po]]),uo={class:"subflow-node"},fo={class:"node-header"},go={class:"icon-wrapper"},ho={class:"node-label"},No={key:0,class:"status-spinner"},Eo={class:"subflow-info"},ko={class:"meta-row"},yo={key:0,class:"meta-item"},Ke=H(e.defineComponent({__name:"SubflowNode",props:{id:{},data:{},selected:{type:Boolean}},emits:["inspect"],setup(l,{emit:r}){const s=l,i=e.computed(()=>s.data.label||"Subflow"),a=e.computed(()=>s.data.subflowId||""),y=e.computed(()=>s.data.shareSession!==!1),n=e.computed(()=>s.data.status||"idle"),c=e.computed(()=>a.value?a.value:"No subflow selected"),w=e.computed(()=>{const V=s.data.inputMappings||{};return Object.keys(V).length}),E=r;return(V,p)=>(e.openBlock(),e.createBlock(le,{id:l.id,selected:l.selected,status:n.value,variant:"secondary",onInspect:p[0]||(p[0]=k=>E("inspect"))},{default:e.withCtx(()=>[e.createVNode(e.unref(I.Handle),{type:"target",position:e.unref(I.Position).Top,class:"handle"},null,8,["position"]),e.createElementVNode("div",uo,[e.createElementVNode("div",fo,[e.createElementVNode("div",go,[e.createVNode(We,{class:"subflow-icon"})]),e.createElementVNode("span",ho,e.toDisplayString(i.value),1),n.value==="active"?(e.openBlock(),e.createElementBlock("div",No)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Eo,[e.createElementVNode("div",{class:e.normalizeClass(["subflow-badge",{empty:!a.value}])},[p[1]||(p[1]=e.createElementVNode("svg",{class:"link-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{d:"M10 13a5 5 0 007.54.54l3-3a5 5 0 00-7.07-7.07l-1.72 1.71"}),e.createElementVNode("path",{d:"M14 11a5 5 0 00-7.54-.54l-3 3a5 5 0 007.07 7.07l1.71-1.71"})],-1)),e.createElementVNode("span",null,e.toDisplayString(c.value),1)],2),e.createElementVNode("div",ko,[w.value>0?(e.openBlock(),e.createElementBlock("span",yo,[p[2]||(p[2]=e.createElementVNode("svg",{class:"meta-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{d:"M9 21H5a2 2 0 01-2-2V5a2 2 0 012-2h4"}),e.createElementVNode("polyline",{points:"16 17 21 12 16 7"}),e.createElementVNode("line",{x1:"21",y1:"12",x2:"9",y2:"12"})],-1)),e.createTextVNode(" "+e.toDisplayString(w.value)+" input"+e.toDisplayString(w.value!==1?"s":""),1)])):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(["meta-item",{muted:!y.value}])},[p[3]||(p[3]=e.createElementVNode("svg",{class:"meta-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{d:"M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2"}),e.createElementVNode("circle",{cx:"9",cy:"7",r:"4"}),e.createElementVNode("path",{d:"M23 21v-2a4 4 0 00-3-3.87"}),e.createElementVNode("path",{d:"M16 3.13a4 4 0 010 7.75"})],-1)),e.createTextVNode(" "+e.toDisplayString(y.value?"Shared":"Isolated"),1)],2)])])]),e.createVNode(e.unref(I.Handle),{type:"source",position:e.unref(I.Position).Bottom,class:"handle"},null,8,["position"]),e.createVNode(e.unref(I.Handle),{type:"source",position:e.unref(I.Position).Right,id:"error",class:"handle error-handle"},null,8,["position"])]),_:1},8,["id","selected","status"]))}}),[["__scopeId","data-v-d5994547"]]),Vo=Object.freeze(Object.defineProperty({__proto__:null,default:Ke},Symbol.toStringTag,{value:"Module"})),wo={},bo={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function Bo(l,r){return e.openBlock(),e.createElementBlock("svg",bo,[...r[0]||(r[0]=[e.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M11.042 19.933A9.8 9.8 0 0 1 7.7 19L3 20l1.3-3.9C1.976 12.663 2.874 8.228 6.4 5.726c3.526-2.501 8.59-2.296 11.845.48c2.127 1.814 3.052 4.36 2.694 6.808M15 19l2 2l4-4"},null,-1)])])}const qe=H(wo,[["render",Bo]]),_o={class:"output-node"},xo={class:"node-header"},Co={class:"icon-wrapper"},So={class:"node-label"},Do={key:0,class:"status-spinner"},$o={class:"output-info"},Io={class:"format-badge"},Mo={class:"meta-row"},To={key:0,class:"meta-item"},Lo={key:1,class:"meta-item"},Ge=H(e.defineComponent({__name:"OutputNode",props:{id:{},data:{},selected:{type:Boolean}},emits:["inspect"],setup(l,{emit:r}){const s=l,i=e.computed(()=>s.data.label||"Output"),a=e.computed(()=>s.data.format||"text"),y=e.computed(()=>!!s.data.template),n=e.computed(()=>s.data.includeMetadata??!1),c=e.computed(()=>s.data.status||"idle"),w=e.computed(()=>{switch(a.value){case"json":return"JSON";case"markdown":return"MD";case"text":default:return"TXT"}}),E=r;return(V,p)=>(e.openBlock(),e.createBlock(le,{id:l.id,selected:l.selected,status:c.value,variant:"info",onInspect:p[0]||(p[0]=k=>E("inspect"))},{default:e.withCtx(()=>[e.createVNode(e.unref(I.Handle),{type:"target",position:e.unref(I.Position).Top,class:"handle"},null,8,["position"]),e.createElementVNode("div",_o,[e.createElementVNode("div",xo,[e.createElementVNode("div",Co,[e.createVNode(qe,{class:"output-icon"})]),e.createElementVNode("span",So,e.toDisplayString(i.value),1),c.value==="active"?(e.openBlock(),e.createElementBlock("div",Do)):e.createCommentVNode("",!0)]),e.createElementVNode("div",$o,[e.createElementVNode("div",Io,[p[1]||(p[1]=e.createElementVNode("svg",{class:"format-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{d:"M4 7V4h16v3"}),e.createElementVNode("path",{d:"M9 20h6"}),e.createElementVNode("path",{d:"M12 4v16"})],-1)),e.createElementVNode("span",null,e.toDisplayString(w.value),1)]),e.createElementVNode("div",Mo,[y.value?(e.openBlock(),e.createElementBlock("span",To,[...p[2]||(p[2]=[e.createElementVNode("svg",{class:"meta-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"})],-1),e.createTextVNode(" Template ",-1)])])):e.createCommentVNode("",!0),n.value?(e.openBlock(),e.createElementBlock("span",Lo,[...p[3]||(p[3]=[e.createElementVNode("svg",{class:"meta-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("circle",{cx:"12",cy:"12",r:"10"}),e.createElementVNode("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),e.createElementVNode("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})],-1),e.createTextVNode(" Metadata ",-1)])])):e.createCommentVNode("",!0)])]),p[4]||(p[4]=e.createElementVNode("div",{class:"terminal-indicator"},[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),e.createElementVNode("line",{x1:"9",y1:"9",x2:"15",y2:"15"}),e.createElementVNode("line",{x1:"15",y1:"9",x2:"9",y2:"15"})]),e.createElementVNode("span",null,"Terminal")],-1))])]),_:1},8,["id","selected","status"]))}}),[["__scopeId","data-v-94e60a57"]]),Oo=Object.freeze(Object.defineProperty({__proto__:null,default:Ge},Symbol.toStringTag,{value:"Module"})),Po=["data-workflow-canvas"],Ro={key:0,class:"edge-label"},zo=H(e.defineComponent({__name:"WorkflowCanvas",props:{editor:{},nodeStatuses:{},panOnDrag:{type:[Boolean,Array]},selectionKeyCode:{type:[Boolean,String,Array,Function,null]},selectionMode:{},canvasId:{}},emits:["nodeClick","edgeClick","paneClick","drop","nodeInspect"],setup(l,{expose:r,emit:s}){const i=l,a=s;function y(h){if(!d())return;i.editor.commands.selectNode(h.id);const S=N.value.find(x=>x.id===h.id);S&&a("nodeInspect",S)}const{onConnect:n,onNodeDragStop:c,screenToFlowCoordinate:w,fitView:E,nodes:V,edges:p,panOnDrag:k,selectionKeyCode:D,selectionMode:u}=I.useVueFlow(),P=k.value,f=D.value,b=u.value;e.watch(()=>i.panOnDrag,h=>{k.value=h??P},{immediate:!0}),e.watch(()=>i.selectionKeyCode,h=>{D.value=h??f},{immediate:!0}),e.watch(()=>i.selectionMode,h=>{u.value=h??b},{immediate:!0});const N=e.ref([]),g=e.ref([]),d=()=>!i.editor.isDestroyed();let _=new Map,B=new Map,M=-1;const O=(h,S)=>`${i.editor.getNodeVersion(h)}:${S}`,A=(h,S)=>`${i.editor.getEdgeVersion(h)}:${S}`,R=()=>{var fe,ge,he,ne,Ne,Ee;const h=i.editor.getNodes(),S=i.editor.getEdges(),x=i.editor.getGlobalVersion();if(M===x&&!i.nodeStatuses)return;const W=new Map,F=new Map;let K=!1;const U=new Set(N.value.map(C=>C.id)),ae=new Set(h.map(C=>C.id));if(U.size!==ae.size)K=!0;else for(const C of ae)if(!U.has(C)){K=!0;break}if(!K)for(const C of h){const q=((fe=i.nodeStatuses)==null?void 0:fe[C.id])||"idle",G=O(C.id,q);W.set(C.id,G),_.get(C.id)!==G&&(K=!0)}if(K){N.value=h.map(C=>{var q;return{id:C.id,type:C.type,position:C.position,data:{...C.data,status:((q=i.nodeStatuses)==null?void 0:q[C.id])||"idle"},selected:C.selected}}),_=new Map;for(const C of h){const q=((ge=i.nodeStatuses)==null?void 0:ge[C.id])||"idle";_.set(C.id,O(C.id,q))}}let Z=!1;const J=new Set(g.value.map(C=>C.id)),ue=new Set(S.map(C=>C.id));if(J.size!==ue.size)Z=!0;else for(const C of ue)if(!J.has(C)){Z=!0;break}if(!Z)for(const C of S){const q=((he=i.nodeStatuses)==null?void 0:he[C.source])==="active"||((ne=i.nodeStatuses)==null?void 0:ne[C.target])==="active",G=A(C.id,q);F.set(C.id,G),B.get(C.id)!==G&&(Z=!0)}if(Z){g.value=S.map(C=>{var q,G;return{id:C.id,source:C.source,target:C.target,sourceHandle:C.sourceHandle,targetHandle:C.targetHandle,label:C.label,data:C.data,animated:((q=i.nodeStatuses)==null?void 0:q[C.source])==="active"||((G=i.nodeStatuses)==null?void 0:G[C.target])==="active"}}),B=new Map;for(const C of S){const q=((Ne=i.nodeStatuses)==null?void 0:Ne[C.source])==="active"||((Ee=i.nodeStatuses)==null?void 0:Ee[C.target])==="active";B.set(C.id,A(C.id,q))}}M=x};e.watch(()=>i.nodeStatuses,()=>{R()},{deep:!0});let X=null,v=null,oe=!1;const ke=e.computed(()=>V.value.filter(h=>h.selected).map(h=>h.id).sort().join(","));e.watch(ke,(h,S)=>{if(!d()||oe||h===S)return;const x=h?h.split(","):[];i.editor.commands.setSelection(x)}),e.onMounted(()=>{d()&&(R(),X=i.editor.on("update",R),v=i.editor.on("selectionUpdate",()=>{oe=!0,R(),e.nextTick(()=>{oe=!1})}),setTimeout(()=>E({padding:.2}),100))}),e.onUnmounted(()=>{X==null||X(),v==null||v()}),n(h=>{d()&&i.editor.commands.createEdge(h.source,h.target,h.sourceHandle??void 0,h.targetHandle??void 0)}),c(()=>{if(!d())return;const h=V.value.filter(S=>S.selected);for(const S of h)i.editor.commands.setNodePosition(S.id,S.position)});const ye=h=>{d()&&(i.editor.commands.selectNode(h.node.id),a("nodeClick",h.node))},Ve=h=>{d()&&i.editor.commands.deselectAll(),a("edgeClick",h.edge)},we=()=>{d()&&(i.editor.commands.deselectAll(),a("paneClick"))},be=h=>{var ae,Z;if(!d())return;const S=(ae=h.dataTransfer)==null?void 0:ae.getData("application/vueflow"),x=(Z=h.dataTransfer)==null?void 0:Z.getData("application/json");if(!S||!x)return;let W;try{W=JSON.parse(x)}catch(J){console.warn("Failed to parse dropped node data",J);return}if(!(J=>typeof J=="object"&&J!==null&&"label"in J&&typeof J.label=="string")(W)){console.warn('Dropped node data is missing required "label" field');return}const K=W,U=w({x:h.clientX,y:h.clientY});i.editor.commands.createNode(S,K,U),a("drop",h)},Be=h=>{h.preventDefault(),h.dataTransfer&&(h.dataTransfer.dropEffect="move")},_e=h=>{var S;(S=h.currentTarget)==null||S.focus()},me=h=>{if(!d())return;const S=h,{nodeType:x,defaultData:W,x:F,y:K}=S.detail,U=w({x:F,y:K});i.editor.commands.createNode(x,W,U)},pe=()=>{const h=i.canvasId?`[data-workflow-canvas="${i.canvasId}"] .vue-flow`:".vue-flow";return document.querySelector(h)};e.onMounted(()=>{const h=pe();h&&h.addEventListener("mobileNodeDrop",me)}),e.onUnmounted(()=>{const h=pe();h&&h.removeEventListener("mobileNodeDrop",me)});const xe=h=>{if(!d())return;const S=h.target;if(!(S.tagName==="INPUT"||S.tagName==="TEXTAREA")){if(h.key==="Delete"||h.key==="Backspace"){h.preventDefault();const x=p.value.filter(F=>F.selected).map(F=>F.id),W=V.value.filter(F=>F.selected&&F.type!=="start").map(F=>F.id);if(x.length){x.forEach(F=>i.editor.commands.deleteEdge(F));return}W.forEach(F=>i.editor.commands.deleteNode(F))}(h.metaKey||h.ctrlKey)&&h.key==="z"&&!h.shiftKey&&(h.preventDefault(),i.editor.commands.undo()),(h.metaKey||h.ctrlKey)&&(h.key==="y"||h.key==="z"&&h.shiftKey)&&(h.preventDefault(),i.editor.commands.redo()),(h.metaKey||h.ctrlKey)&&h.key==="d"&&(h.preventDefault(),i.editor.getSelected().nodes.forEach(x=>i.editor.commands.duplicateNode(x)))}};return r({fitView:()=>E({padding:.2})}),(h,S)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["workflow-canvas",{"workflow-canvas-select":l.selectionKeyCode===!0}]),"data-workflow-canvas":l.canvasId||void 0,onDrop:be,onDragover:Be,onKeydown:xe,onMousedown:_e,tabindex:"0"},[e.createVNode(e.unref(I.VueFlow),{nodes:N.value,"onUpdate:nodes":S[0]||(S[0]=x=>N.value=x),edges:g.value,"onUpdate:edges":S[1]||(S[1]=x=>g.value=x),"default-viewport":{x:50,y:50,zoom:1},"min-zoom":.5,"max-zoom":2,"fit-view-on-init":"","pan-on-drag":l.panOnDrag,"selection-key-code":l.selectionKeyCode,"selection-mode":l.selectionMode,"delete-key-code":null,onNodeClick:ye,onEdgeClick:Ve,onPaneClick:we},{"node-start":e.withCtx(x=>[e.createVNode(Pe,{id:x.id,data:x.data,selected:x.selected},null,8,["id","data","selected"])]),"node-agent":e.withCtx(x=>[e.createVNode(ze,e.mergeProps(x,{onInspect:W=>y(x)}),null,16,["onInspect"])]),"node-router":e.withCtx(x=>[e.createVNode(Ae,e.mergeProps(x,{onInspect:W=>y(x)}),null,16,["onInspect"])]),"node-parallel":e.withCtx(x=>[e.createVNode(Fe,e.mergeProps(x,{onInspect:W=>y(x)}),null,16,["onInspect"])]),"node-whileLoop":e.withCtx(x=>[e.createVNode(Ue,e.mergeProps(x,{onInspect:W=>y(x)}),null,16,["onInspect"])]),"node-subflow":e.withCtx(x=>[e.createVNode(Ke,e.mergeProps(x,{onInspect:W=>y(x)}),null,16,["onInspect"])]),"node-output":e.withCtx(x=>[e.createVNode(Ge,e.mergeProps(x,{onInspect:W=>y(x)}),null,16,["onInspect"])]),"edge-label":e.withCtx(({label:x})=>[x?(e.openBlock(),e.createElementBlock("div",Ro,e.toDisplayString(x),1)):e.createCommentVNode("",!0)]),default:e.withCtx(()=>[e.createVNode(e.unref(lt.Background),{gap:20,size:1,"pattern-color":"rgba(255, 255, 255, 0.03)"}),e.createVNode(e.unref(De.Controls),{position:"bottom-left"})]),_:1},8,["nodes","edges","pan-on-drag","selection-key-code","selection-mode"])],42,Po))}}),[["__scopeId","data-v-149e9faf"]]),Ho={},Ao={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function vo(l,r){return e.openBlock(),e.createElementBlock("svg",Ao,[...r[0]||(r[0]=[e.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),e.createElementVNode("line",{x1:"5",y1:"12",x2:"19",y2:"12"})],-1)])])}const Fo=H(Ho,[["render",vo]]),jo={},Uo={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"};function Wo(l,r){return e.openBlock(),e.createElementBlock("svg",Uo,[...r[0]||(r[0]=[e.createStaticVNode('<circle cx="9" cy="5" r="1"></circle><circle cx="9" cy="12" r="1"></circle><circle cx="9" cy="19" r="1"></circle><circle cx="15" cy="5" r="1"></circle><circle cx="15" cy="12" r="1"></circle><circle cx="15" cy="19" r="1"></circle>',6)])])}const Ko=H(jo,[["render",Wo]]),qo={},Go={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function Yo(l,r){return e.openBlock(),e.createElementBlock("svg",Go,[...r[0]||(r[0]=[e.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[e.createElementVNode("path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0-18 0m9-3h.01"}),e.createElementVNode("path",{d:"M11 12h1v4h1"})],-1)])])}const Xo=H(qo,[["render",Yo]]),Jo={class:"node-palette"},Qo={class:"palette-header"},Zo={class:"palette-nodes"},en=["onDragstart","onTouchstart","onClick"],tn={class:"node-info"},on={class:"node-name"},nn={class:"node-desc"},ln={class:"palette-hint"},an=6,sn=H(e.defineComponent({__name:"NodePalette",props:{editor:{},canvasId:{}},emits:["quick-add"],setup(l,{emit:r}){const s=l,i=r,a=e.ref(!1),y=()=>{a.value=window.innerWidth<=768};e.onMounted(()=>{y(),window.addEventListener("resize",y)}),e.onUnmounted(()=>{window.removeEventListener("resize",y)});const n=[{type:"agent",label:"AI Agent",description:"Connect to an AI model to process and respond to messages",colorVar:"--or3-color-accent",icon:Re,defaultData:{label:"New Agent",model:"z-ai/glm-4.6:exacto",prompt:""}},{type:"router",label:"Decision",description:"Route messages to different paths based on intent",colorVar:"--or3-color-warning",icon:He,defaultData:{label:"Decision"}},{type:"parallel",label:"Parallel",description:"Run multiple tasks at once and combine results",colorVar:"--or3-color-info",icon:ve,defaultData:{label:"Parallel",model:"z-ai/glm-4.6:exacto",prompt:"Combine the outputs into a coherent response.",branches:[]}},{type:"whileLoop",label:"Loop",description:"Repeat a sequence until a condition is met",colorVar:"--or3-color-info",icon:je,defaultData:{label:"Loop",conditionPrompt:'Should we continue iterating? Respond with "continue" or "done".',maxIterations:10,onMaxIterations:"warning"}},{type:"subflow",label:"Sub-workflow",description:"Embed another workflow as a single node",colorVar:"--or3-color-secondary",icon:We,defaultData:{label:"Sub-workflow",subflowId:"",inputMappings:{},shareSession:!0}},{type:"output",label:"Output",description:"Define the final output format",colorVar:"--or3-color-success",icon:qe,defaultData:{label:"Output",format:"text",template:"",includeMetadata:!1}}],c=()=>{const g=s.canvasId?`[data-workflow-canvas="${s.canvasId}"] .vue-flow`:".vue-flow";return document.querySelector(g)},w=(g,d,_)=>{g.dataTransfer&&(g.dataTransfer.setData("application/vueflow",d),g.dataTransfer.setData("application/json",JSON.stringify(_)),g.dataTransfer.effectAllowed="move")};let E=null,V=!1,p=!1,k=0,D=0;const u=(g,d,_)=>{E={nodeType:d,defaultData:_},p=!1;const B=g.touches[0];B&&(k=B.clientX,D=B.clientY)},P=g=>{if(!E||p)return;const d=g.touches[0];if(!d)return;const _=Math.abs(d.clientX-k),B=Math.abs(d.clientY-D);if(_+B<an)return;p=!0,g.currentTarget.classList.add("dragging-touch")},f=g=>{if(g.currentTarget.classList.remove("dragging-touch"),!E)return;const _=g.changedTouches[0],B=document.elementFromPoint(_.clientX,_.clientY),M=c();if(M&&(M===B||M.contains(B))){const O=new CustomEvent("mobileNodeDrop",{detail:{nodeType:E.nodeType,defaultData:E.defaultData,x:_.clientX,y:_.clientY}});M.dispatchEvent(O),V=!0,setTimeout(()=>{V=!1},0)}E=null,p=!1},b=(g,d)=>{const _=c();if(!_)return;const B=_.getBoundingClientRect(),M=B.left+B.width/2,O=B.top+B.height/2,A=new CustomEvent("mobileNodeDrop",{detail:{nodeType:g,defaultData:d,x:M,y:O}});_.dispatchEvent(A)},N=(g,d,_)=>{if(V){V=!1;return}a.value&&(g.preventDefault(),b(d,_),i("quick-add"))};return(g,d)=>(e.openBlock(),e.createElementBlock("div",Jo,[e.createElementVNode("div",Qo,[e.createVNode(Fo,{class:"plus-icon"}),d[1]||(d[1]=e.createElementVNode("span",null,"Add Nodes",-1))]),e.createElementVNode("div",Zo,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(n,_=>e.createElementVNode("div",{key:_.type,class:"palette-node",draggable:"true",onDragstart:B=>w(B,_.type,_.defaultData),onTouchstart:B=>u(B,_.type,_.defaultData),onTouchmove:P,onTouchend:d[0]||(d[0]=B=>f(B)),onClick:B=>N(B,_.type,_.defaultData)},[e.createElementVNode("div",{class:"node-icon",style:e.normalizeStyle({"--node-color":`var(${_.colorVar}, #8b5cf6)`})},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(_.icon)))],4),e.createElementVNode("div",tn,[e.createElementVNode("span",on,e.toDisplayString(_.label),1),e.createElementVNode("span",nn,e.toDisplayString(_.description),1)]),e.createVNode(Ko,{class:"drag-handle"})],40,en)),64))]),e.createElementVNode("div",ln,[e.createVNode(Xo,{class:"hint-icon"}),d[2]||(d[2]=e.createElementVNode("p",null," Drag nodes onto the canvas to build your workflow. Connect nodes by dragging from output to input handles. ",-1))])]))}}),[["__scopeId","data-v-958e336f"]]),rn={class:"mode-selector"},dn=["onClick","title"],cn=["innerHTML"],mn=H(e.defineComponent({__name:"OutputModeSelector",props:{modelValue:{}},emits:["update:modelValue"],setup(l,{emit:r}){const s=r,i=[{value:"combine",label:"Combine",description:"Concatenate outputs without AI processing",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M13 2L3 14h9l-1 8 10-12h-9l1-8z"/></svg>'},{value:"synthesis",label:"AI Synthesis",description:"Use AI to synthesize a new output",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 2a2 2 0 0 1 2 2c0 .74-.4 1.39-1 1.73V7h1a7 7 0 0 1 7 7h1a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1h-1v1a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-1H2a1 1 0 0 1-1-1v-3a1 1 0 0 1 1-1h1a7 7 0 0 1 7-7h1V5.73c-.6-.34-1-.99-1-1.73a2 2 0 0 1 2-2z"/><path d="M2 12h20"/><path d="M12 12v10"/><path d="M8 17h8"/></svg>'}];return(a,y)=>(e.openBlock(),e.createElementBlock("div",rn,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(i,n=>e.createElementVNode("button",{key:n.value,onClick:c=>s("update:modelValue",n.value),class:e.normalizeClass(["mode-btn",{active:l.modelValue===n.value}]),title:n.description},[e.createElementVNode("span",{innerHTML:n.icon,class:"mode-icon"},null,8,cn),e.createTextVNode(" "+e.toDisplayString(n.label),1)],10,dn)),64))]))}}),[["__scopeId","data-v-080a00d4"]]),pn={class:"space-y-3 source-picker"},un={class:"flex items-center justify-between"},fn={class:"relative"},gn=["disabled"],hn={key:0,class:"absolute right-0 top-full mt-1 w-64 bg-white dark:bg-gray-800 rounded-lg shadow-lg border border-gray-200 dark:border-gray-700 z-50 max-h-60 overflow-y-auto"},Nn={key:0,class:"p-3 text-xs text-gray-500 text-center"},En={key:1,class:"py-1"},kn={key:0,class:"px-3 py-1 text-xs font-semibold text-gray-500 bg-gray-50 dark:bg-gray-700/50"},yn=["onClick"],Vn={class:"truncate"},wn={class:"text-xs text-gray-400"},bn=["onDragstart","onDragover"],Bn={key:0,class:"drop-indicator before"},_n={key:1,class:"drop-indicator after"},xn={class:"flex-1 min-w-0 pointer-events-none"},Cn={class:"text-sm font-semibold truncate"},Sn={key:0,class:"text-xs source-subtext truncate"},Dn=["onClick"],$n={key:1,class:"empty-state"},In=H(e.defineComponent({__name:"OutputSourcePicker",props:{modelValue:{},availableGroups:{},disabled:{type:Boolean}},emits:["update:modelValue"],setup(l,{emit:r}){const s=l,i=r,a=e.computed(()=>s.availableGroups.flatMap(g=>g.sources)),y=e.computed(()=>s.modelValue.map(g=>a.value.find(d=>d.id===g)).filter(g=>!!g)),n=e.computed(()=>s.availableGroups.map(g=>({...g,sources:g.sources.filter(d=>!s.modelValue.includes(d.id))})).filter(g=>g.sources.length>0)),c=e.ref(!1);function w(g){i("update:modelValue",[...s.modelValue,g]),c.value=!1}function E(g){i("update:modelValue",s.modelValue.filter(d=>d!==g))}const V=e.ref(null),p=e.ref(null);function k(g,d){V.value=d,g.dataTransfer&&(g.dataTransfer.effectAllowed="move",g.dataTransfer.dropEffect="move")}function D(g,d){var A,R;if(g.preventDefault(),V.value===null)return;if(V.value===d){p.value=null;return}const B=g.currentTarget.getBoundingClientRect(),M=B.top+B.height/2,O=g.clientY<M?"before":"after";(((A=p.value)==null?void 0:A.index)!==d||((R=p.value)==null?void 0:R.position)!==O)&&(p.value={index:d,position:O})}function u(g){const d=g.relatedTarget;g.currentTarget.contains(d)}function P(g){const d=g.relatedTarget;g.currentTarget.contains(d)||(p.value=null)}function f(g){if(g.preventDefault(),V.value===null||!p.value){N();return}const d=y.value[V.value],_=y.value[p.value.index];if(!d||!_||d.id===_.id){N();return}const B=[...s.modelValue],M=B.indexOf(d.id);if(M===-1){N();return}const[O]=B.splice(M,1);let A=B.indexOf(_.id);if(A===-1){N();return}p.value.position==="after"&&A++,B.splice(A,0,O),i("update:modelValue",B),N()}function b(){N()}function N(){V.value=null,p.value=null}return(g,d)=>(e.openBlock(),e.createElementBlock("div",pn,[e.createElementVNode("div",un,[d[3]||(d[3]=e.createElementVNode("label",{class:"sources-label"},"Sources",-1)),e.createElementVNode("div",fn,[e.createElementVNode("button",{onClick:d[0]||(d[0]=_=>c.value=!c.value),disabled:l.disabled||n.value.length===0,class:"add-source-btn"},[...d[2]||(d[2]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),e.createElementVNode("line",{x1:"5",y1:"12",x2:"19",y2:"12"})],-1),e.createTextVNode(" Add Source ",-1)])],8,gn),c.value?(e.openBlock(),e.createElementBlock("div",hn,[n.value.length===0?(e.openBlock(),e.createElementBlock("div",Nn," No more sources available ")):(e.openBlock(),e.createElementBlock("div",En,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(_,B)=>(e.openBlock(),e.createElementBlock("div",{key:B},[_.type==="parallel"?(e.openBlock(),e.createElementBlock("div",kn,e.toDisplayString(_.label),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.sources,M=>(e.openBlock(),e.createElementBlock("button",{key:M.id,onClick:O=>w(M.id),class:"w-full text-left px-3 py-2 text-sm hover:bg-gray-100 dark:hover:bg-gray-700 flex items-center justify-between group"},[e.createElementVNode("span",Vn,e.toDisplayString(M.branchLabel||M.label),1),e.createElementVNode("span",wn,e.toDisplayString(M.type),1)],8,yn))),128))]))),128))]))])):e.createCommentVNode("",!0),c.value?(e.openBlock(),e.createElementBlock("div",{key:1,onClick:d[1]||(d[1]=_=>c.value=!1),class:"fixed inset-0 z-40"})):e.createCommentVNode("",!0)])]),y.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:"space-y-2 relative",onDragleave:P},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(_,B)=>{var M,O;return e.openBlock(),e.createElementBlock("div",{key:_.id,draggable:"true",onDragstart:A=>k(A,B),onDragover:A=>D(A,B),onDragleave:u,onDrop:f,onDragend:b,class:e.normalizeClass(["source-card group",{"is-dragging":V.value===B}])},[((M=p.value)==null?void 0:M.index)===B&&p.value.position==="before"?(e.openBlock(),e.createElementBlock("div",Bn)):e.createCommentVNode("",!0),((O=p.value)==null?void 0:O.index)===B&&p.value.position==="after"?(e.openBlock(),e.createElementBlock("div",_n)):e.createCommentVNode("",!0),d[5]||(d[5]=e.createStaticVNode('<div class="drag-handle" title="Drag to reorder" data-v-82c6b2ea><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" data-v-82c6b2ea><line x1="8" y1="6" x2="21" y2="6" data-v-82c6b2ea></line><line x1="8" y1="12" x2="21" y2="12" data-v-82c6b2ea></line><line x1="8" y1="18" x2="21" y2="18" data-v-82c6b2ea></line><line x1="3" y1="6" x2="3.01" y2="6" data-v-82c6b2ea></line><line x1="3" y1="12" x2="3.01" y2="12" data-v-82c6b2ea></line><line x1="3" y1="18" x2="3.01" y2="18" data-v-82c6b2ea></line></svg></div>',1)),e.createElementVNode("div",xn,[e.createElementVNode("div",Cn,e.toDisplayString(_.branchLabel||_.label),1),_.parallelParentId?(e.openBlock(),e.createElementBlock("div",Sn," from "+e.toDisplayString(_.label),1)):e.createCommentVNode("",!0)]),e.createElementVNode("button",{onClick:A=>E(_.id),class:"remove-btn",title:"Remove source"},[...d[4]||(d[4]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])],8,Dn)],42,bn)}),128))],32)):(e.openBlock(),e.createElementBlock("div",$n,[...d[6]||(d[6]=[e.createTextVNode(" No sources selected. ",-1),e.createElementVNode("br",null,null,-1),e.createElementVNode("span",{class:"text-xs"},"Output will be empty.",-1)])]))]))}}),[["__scopeId","data-v-82c6b2ea"]]),Mn={class:"preview-card"},Tn={class:"preview-header"},Ln={key:0,class:"preview-status"},On={key:1,class:"preview-empty"},Pn={key:0,class:"preview-footer"},Rn=H(e.defineComponent({__name:"OutputPreview",props:{previewData:{},maxHeight:{}},setup(l){const r=l,s=e.computed(()=>({maxHeight:r.maxHeight?`${r.maxHeight}px`:"200px"}));return(i,a)=>(e.openBlock(),e.createElementBlock("div",Mn,[e.createElementVNode("div",Tn,[a[1]||(a[1]=e.createElementVNode("span",{class:"preview-label"},"Preview",-1)),l.previewData.isComplete?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Ln,[...a[0]||(a[0]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"12",cy:"12",r:"10"}),e.createElementVNode("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),e.createElementVNode("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})],-1),e.createTextVNode(" Incomplete ",-1)])]))]),e.createElementVNode("div",{class:"preview-body",style:e.normalizeStyle(s.value)},[l.previewData.assembledPreview?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(l.previewData.assembledPreview),1)],64)):(e.openBlock(),e.createElementBlock("div",On,"(Empty output)"))],4),l.previewData.modeHint?(e.openBlock(),e.createElementBlock("div",Pn,[a[2]||(a[2]=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"12",cy:"12",r:"10"}),e.createElementVNode("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),e.createElementVNode("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})],-1)),e.createTextVNode(" "+e.toDisplayString(l.previewData.modeHint),1)])):e.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-a248a951"]]);function Ye(l,r){const s=()=>typeof r=="string"?r:r.value,i=e.ref(0);let a=null;const y=n=>{if(a&&(a(),a=null),n){const c=n.on;if(typeof c=="function"){const w=c.call(n,"update",()=>{i.value++});a=typeof w=="function"?w:null}}};return e.watch(()=>l.value,n=>{y(n),i.value++},{immediate:!0}),e.onScopeDispose(()=>{a&&(a(),a=null)}),e.computed(()=>{var P,f,b;if(i.value,!l.value)return[];const n=s();if(!n)return[];const c=l.value.nodes,w=l.value.edges;if(!c.find(N=>N.id===n))return[];const p=[...w.filter(N=>N.target===n)].sort((N,g)=>{const d=c.find(B=>B.id===N.source),_=c.find(B=>B.id===g.source);return((d==null?void 0:d.position.y)||0)-((_==null?void 0:_.position.y)||0)}),k=[];for(let N=0;N<p.length;N++){const g=p[N],d=c.find(B=>B.id===g.source);if(!d)continue;if(d.type==="parallel"&&d.data.mergeEnabled===!1&&g.sourceHandle){const M=(P=d.data.branches)==null?void 0:P.find(O=>O.id===g.sourceHandle);k.push({id:`${d.id}:${g.sourceHandle}`,label:d.data.label||d.id,type:"parallel-branch",parallelParentId:d.id,branchLabel:(M==null?void 0:M.label)||g.sourceHandle,executionIndex:N})}else{const B=zn(d,c,w);k.push({id:d.id,label:d.data.label||d.id,type:d.type,parallelParentId:B==null?void 0:B.parentId,branchLabel:B==null?void 0:B.branchLabel,executionIndex:N})}}const D=[],u=new Set;for(const N of k)if(!u.has(N.id))if(N.parallelParentId){const g=k.filter(O=>O.parallelParentId===N.parallelParentId),d=c.find(O=>O.id===N.parallelParentId),_=(d==null?void 0:d.data.label)||"Parallel Group",B=((b=(f=d==null?void 0:d.data)==null?void 0:f.branches)==null?void 0:b.map(O=>O.id))||[],M=[...g].sort((O,A)=>{const R=O.id.includes(":")?O.id.split(":")[1]:O.id,X=A.id.includes(":")?A.id.split(":")[1]:A.id,v=B.indexOf(R),oe=B.indexOf(X);return(v===-1?1/0:v)-(oe===-1?1/0:oe)});D.push({type:"parallel",label:_,sources:M}),g.forEach(O=>u.add(O.id))}else D.push({type:"single",sources:[N]}),u.add(N.id);return D})}function zn(l,r,s){var y;const i=[l.id],a=new Set;for(;i.length>0;){const n=i.shift();if(a.has(n))continue;a.add(n);const c=r.find(E=>E.id===n);if(!c)continue;if(c.type==="parallel"){const E=s.filter(p=>p.source===c.id),V=c.data;for(const p of E)if(Hn(p.target,l.id,s)){const k=p.sourceHandle,D=(y=V.branches)==null?void 0:y.find(u=>u.id===k);return{parentId:c.id,branchLabel:(D==null?void 0:D.label)||k||"Unknown Branch"}}}const w=s.filter(E=>E.target===n);for(const E of w)i.push(E.source)}return null}function Hn(l,r,s){if(l===r)return!0;const i=[l],a=new Set;for(;i.length>0;){const y=i.shift();if(a.has(y))continue;if(a.add(y),y===r)return!0;const n=s.filter(c=>c.source===y);for(const c of n)i.push(c.target)}return!1}function An(l,r,s){const{getOutput:i}=Ie(),a=Ye(l,s),y=e.computed(()=>{const w=e.unref(r),V=e.unref(a).flatMap(f=>f.sources);let p=V;w.sources&&w.sources.length>0&&(p=w.sources.map(f=>V.find(b=>b.id===f)).filter(f=>!!f));const k=new Map;let D=!0;for(const f of p){const b=i(f.id);k.set(f.id,b||null),b||(D=!1)}let u="",P="";if(w.mode==="synthesis"){P="AI will synthesize these inputs into a final document";const f=p.map(b=>{const N=k.get(b.id),g=b.branchLabel||b.label,d=N?N.length>100?N.slice(0,100)+"...":N:"(Waiting for output...)";return`• ${g}: ${d}`});f.length>0?u=`Inputs to AI:
|
|
1
|
+
(function(T,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("or3-workflow-core"),require("@vue-flow/core"),require("@vue-flow/background"),require("@vue-flow/controls"),require("@vue-flow/minimap")):typeof define=="function"&&define.amd?define(["exports","vue","or3-workflow-core","@vue-flow/core","@vue-flow/background","@vue-flow/controls","@vue-flow/minimap"],e):(T=typeof globalThis<"u"?globalThis:T||self,e(T.Or3WorkflowVue={},T.Vue,T.Or3WorkflowCore,T.VueFlow,T.VueFlowBackground,T.VueFlowControls,T.VueFlowMinimap))})(this,(function(T,e,W,I,Je,be,Qe){"use strict";function we(l={}){const i=e.shallowRef(null),s=W.createWorkflowEditor(l);i.value=e.markRaw(s);const d=s.on("update",()=>{e.triggerRef(i)});return e.onBeforeUnmount(()=>{d(),i.value?.destroy(),i.value=null}),i}const Ze=we,re=e.ref(new Map);function xe(){const l=(d,a)=>{re.value.set(d,a)},i=d=>re.value.get(d),s=()=>{re.value.clear()};return{outputs:e.readonly(re),setOutput:l,getOutput:i,clear:s}}function et(){const{setOutput:l,clear:i}=xe(),s=e.ref(!1),d=e.ref(null),a=e.ref({}),N=e.ref({}),o=e.ref(null),m=e.ref(null),E=()=>{s.value=!1,d.value=null,a.value={},N.value={},o.value=null,m.value=null,i()};return{isRunning:s,currentNodeId:d,nodeStatuses:a,nodeOutputs:N,error:o,result:m,execute:async(p,y,M,B)=>{E(),s.value=!0;const S={onNodeStart:c=>{d.value=c,a.value[c]="active",B?.onNodeStart?.(c)},onNodeFinish:(c,u)=>{a.value[c]="completed",N.value[c]=u,l(c,u),d.value===c&&(d.value=null),B?.onNodeFinish?.(c,u)},onNodeError:(c,u)=>{a.value[c]="error",o.value=u,B?.onNodeError?.(c,u)},onToken:(c,u)=>{B?.onToken?.(c,u)},onReasoning:(c,u)=>{B?.onReasoning?.(c,u)},onRouteSelected:(c,u)=>{B?.onRouteSelected?.(c,u)},onTokenUsage:(c,u)=>{B?.onTokenUsage?.(c,u)},onContextCompacted:c=>{B?.onContextCompacted?.(c)},onBranchStart:(c,u,$)=>{B?.onBranchStart?.(c,u,$)},onBranchToken:(c,u,$,f)=>{B?.onBranchToken?.(c,u,$,f)},onBranchReasoning:(c,u,$,f)=>{B?.onBranchReasoning?.(c,u,$,f)},onBranchComplete:(c,u,$,f)=>{B?.onBranchComplete?.(c,u,$,f),l(`${c}:${u}`,f)}};try{const c=await p.execute(y,M,S);return m.value=c,c}catch(c){const u=c instanceof Error?c:new Error(String(c));throw o.value=u,u}finally{s.value=!1,d.value=null}},stop:p=>{s.value&&(p.stop(),s.value=!1)},reset:E}}function tt(l){const i=e.ref(!1),s=e.ref(null),d=e.ref([]),a=e.ref(null),N=async()=>{i.value=!0,s.value=null;try{const V=await l.list();return d.value=V,V}catch(V){const k=V instanceof Error?V:new Error(String(V));throw s.value=k,k}finally{i.value=!1}};return{isLoading:i,error:s,workflows:d,currentWorkflow:a,loadList:N,load:async V=>{i.value=!0,s.value=null;try{const k=await l.load(V);return a.value=k,k}catch(k){const p=k instanceof Error?k:new Error(String(k));throw s.value=p,p}finally{i.value=!1}},save:async V=>{i.value=!0,s.value=null;try{const k=JSON.parse(JSON.stringify(V)),p=await l.save(k);return await N(),p}catch(k){const p=k instanceof Error?k:new Error(String(k));throw s.value=p,p}finally{i.value=!1}},remove:async V=>{i.value=!0,s.value=null;try{await l.delete(V),await N(),a.value=null}catch(k){const p=k instanceof Error?k:new Error(String(k));throw s.value=p,p}finally{i.value=!1}}}}function Be(){const l=e.ref({isRunning:!1,streamingContent:"",nodeStatuses:{},currentNodeId:null,error:null}),i=E=>{l.value.isRunning=E},s=E=>{l.value.streamingContent=E},d=E=>{l.value.streamingContent+=E},a=(E,V)=>{l.value.nodeStatuses[E]=V},N=E=>{l.value.currentNodeId=E},o=E=>{l.value.error=E},m=()=>{l.value={isRunning:!1,streamingContent:"",nodeStatuses:{},currentNodeId:null,error:null}};return{state:e.readonly(l),setRunning:i,setStreamingContent:s,appendStreamingContent:d,setNodeStatus:a,setCurrentNodeId:N,setError:o,reset:m}}function _e(){return Be()}function ot(l,i){const s=e.ref(l.getNodes().find(m=>m.id===i)),d=()=>{s.value=l.getNodes().find(m=>m.id===i)},a=l.on("update",d),N=l.on("nodeUpdate",d);return e.onBeforeUnmount(()=>{a(),N()}),{node:s,updateData:m=>{s.value&&l.commands.updateNodeData(s.value.id,m)}}}function Ce(){const l=e.shallowRef(new Map);return{components:l,register(i,s){if(!i||typeof i!="string"){console.warn("Node type must be a non-empty string");return}const d=new Map(l.value);d.set(i,s),l.value=d},unregister(i){if(!l.value.has(i))return;const s=new Map(l.value);s.delete(i),l.value=s},get(i){return l.value.get(i)},has(i){return l.value.has(i)},getTypes(){return Array.from(l.value.keys())},clear(){l.value=new Map}}}const Se=Ce();function nt(l){Promise.resolve().then(()=>st).then(i=>l.register("start",i.default)),Promise.resolve().then(()=>wt).then(i=>l.register("agent",i.default)),Promise.resolve().then(()=>Tt).then(i=>l.register("router",i.default)),Promise.resolve().then(()=>jt).then(i=>l.register("parallel",i.default)),Promise.resolve().then(()=>to).then(i=>l.register("whileLoop",i.default)),Promise.resolve().then(()=>fo).then(i=>l.register("subflow",i.default)),Promise.resolve().then(()=>So).then(i=>l.register("output",i.default))}nt(Se);const lt={class:"start-content"},at=e.defineComponent({__name:"StartNode",props:{id:{},data:{},selected:{type:Boolean}},setup(l){const i=l,s=e.computed(()=>i.data.label||"Start"),d=e.computed(()=>i.data.status||"idle");return(a,N)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["start-node",[`status-${d.value}`,{selected:l.selected}]])},[e.createElementVNode("div",lt,[N[0]||(N[0]=e.createElementVNode("svg",{class:"play-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polygon",{points:"5 3 19 12 5 21 5 3"})],-1)),e.createElementVNode("span",null,e.toDisplayString(s.value),1)]),e.createVNode(e.unref(I.Handle),{type:"source",position:e.unref(I.Position).Bottom,class:"handle"},null,8,["position"])],2))}}),P=(l,i)=>{const s=l.__vccOpts||l;for(const[d,a]of i)s[d]=a;return s},De=P(at,[["__scopeId","data-v-740a3c44"]]),st=Object.freeze(Object.defineProperty({__proto__:null,default:De},Symbol.toStringTag,{value:"Module"})),rt={},it={xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24"};function dt(l,i){return e.openBlock(),e.createElementBlock("svg",it,[...i[0]||(i[0]=[e.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[e.createElementVNode("path",{d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 0 0-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 0 0-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 0 0-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 0 0-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 0 0 1.066-2.573c-.94-1.543.826-3.31 2.37-2.37c1 .608 2.296.07 2.572-1.065"}),e.createElementVNode("path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0-6 0"})],-1)])])}const ct=P(rt,[["render",dt]]),mt={class:"node-meta-container"},pt={class:"node-id"},J=P(e.defineComponent({__name:"NodeWrapper",props:{id:{},selected:{type:Boolean},status:{default:"idle"},variant:{default:"default"}},emits:["inspect"],setup(l,{emit:i}){const s=l,d=i,a=e.computed(()=>["node-wrapper",`status-${s.status}`,`variant-${s.variant}`,{selected:s.selected}]);function N(o){o.stopPropagation(),d("inspect")}return(o,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(a.value)},[e.createElementVNode("div",mt,[e.createElementVNode("div",pt,e.toDisplayString(l.id.slice(0,6)),1),e.createElementVNode("button",{class:"inspect-btn",title:"Open inspector","aria-label":"Open node inspector",onClick:N},[e.createVNode(ct)])]),e.renderSlot(o.$slots,"default",{},void 0,!0)],2))}}),[["__scopeId","data-v-aac8cd21"]]),ut={},ft={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function gt(l,i){return e.openBlock(),e.createElementBlock("svg",ft,[...i[0]||(i[0]=[e.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 6a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2zm6-4v2m-3 8v9m6-9v9M5 16l4-2m6 0l4 2M9 18h6M10 8v.01M14 8v.01"},null,-1)])])}const $e=P(ut,[["render",gt]]),ht={class:"agent-node"},kt={class:"node-header"},Nt={class:"icon-wrapper"},Et={class:"node-label"},yt={key:0,class:"status-spinner"},Vt={class:"model-badge"},bt={class:"model-name"},Ie=P(e.defineComponent({__name:"AgentNode",props:{id:{},data:{},selected:{type:Boolean}},emits:["inspect"],setup(l,{emit:i}){const s=l,d=e.computed(()=>s.data.label||"Agent"),a=e.computed(()=>s.data.model||"z-ai/glm-4.6:exacto"),N=e.computed(()=>s.data.status||"idle"),o=e.computed(()=>{const E=a.value.split("/");return E[E.length-1]}),m=i;return(E,V)=>(e.openBlock(),e.createBlock(J,{id:l.id,selected:l.selected,status:N.value,variant:"accent",onInspect:V[0]||(V[0]=k=>m("inspect"))},{default:e.withCtx(()=>[e.createVNode(e.unref(I.Handle),{type:"target",position:e.unref(I.Position).Top,class:"handle"},null,8,["position"]),e.createElementVNode("div",ht,[e.createElementVNode("div",kt,[e.createElementVNode("div",Nt,[e.createVNode($e,{class:"bot-icon"})]),e.createElementVNode("span",Et,e.toDisplayString(d.value),1),N.value==="active"?(e.openBlock(),e.createElementBlock("div",yt)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Vt,[e.createElementVNode("span",bt,e.toDisplayString(o.value),1)])]),e.createVNode(e.unref(I.Handle),{type:"source",position:e.unref(I.Position).Bottom,class:"handle"},null,8,["position"]),e.createVNode(e.unref(I.Handle),{type:"source",position:e.unref(I.Position).Right,id:"error",class:"handle error-handle"},null,8,["position"])]),_:1},8,["id","selected","status"]))}}),[["__scopeId","data-v-47d0bb13"]]),wt=Object.freeze(Object.defineProperty({__proto__:null,default:Ie},Symbol.toStringTag,{value:"Module"})),xt={},Bt={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function _t(l,i){return e.openBlock(),e.createElementBlock("svg",Bt,[...i[0]||(i[0]=[e.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 17a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2zm12 0a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2zM9 5a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2zM6 15v-1a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v1m-6-6v3"},null,-1)])])}const Me=P(xt,[["render",_t]]),Ct={class:"router-node"},St={class:"node-header"},Dt={class:"icon-wrapper"},$t={class:"node-label"},It={key:0,class:"status-spinner"},Mt={class:"router-badge"},Te=P(e.defineComponent({__name:"RouterNode",props:{id:{},data:{},selected:{type:Boolean}},emits:["inspect"],setup(l,{emit:i}){const s=l,d=e.computed(()=>s.data.label||"Router"),a=e.computed(()=>s.data.status||"idle"),N=[{id:"route-1",label:"Route 1"},{id:"route-2",label:"Route 2"}],o=e.computed(()=>{const V=s.data.routes||N;return V.length>0?V:N}),m=e.computed(()=>{const V=o.value.length;return V===1?[50]:o.value.map((k,p)=>(p+1)/(V+1)*100)}),E=i;return(V,k)=>(e.openBlock(),e.createBlock(J,{id:l.id,selected:l.selected,status:a.value,variant:"warning",onInspect:k[0]||(k[0]=p=>E("inspect"))},{default:e.withCtx(()=>[e.createVNode(e.unref(I.Handle),{type:"target",position:e.unref(I.Position).Top,class:"handle"},null,8,["position"]),e.createElementVNode("div",Ct,[e.createElementVNode("div",St,[e.createElementVNode("div",Dt,[e.createVNode(Me,{class:"branch-icon"})]),e.createElementVNode("span",$t,e.toDisplayString(d.value),1),a.value==="active"?(e.openBlock(),e.createElementBlock("div",It)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Mt,[e.createElementVNode("span",null,"Router · "+e.toDisplayString(o.value.length)+" routes",1)])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(p,y)=>(e.openBlock(),e.createBlock(e.unref(I.Handle),{key:p.id,type:"source",position:e.unref(I.Position).Bottom,id:p.id,class:"handle route-handle","data-route-label":p.label||p.id,title:p.label||p.id,style:e.normalizeStyle({left:`${m.value[y]}%`})},null,8,["position","id","data-route-label","title","style"]))),128)),e.createVNode(e.unref(I.Handle),{type:"source",position:e.unref(I.Position).Right,id:"error",class:"handle error-handle"},null,8,["position"])]),_:1},8,["id","selected","status"]))}}),[["__scopeId","data-v-36dffe57"]]),Tt=Object.freeze(Object.defineProperty({__proto__:null,default:Te},Symbol.toStringTag,{value:"Module"})),Lt={},Ot={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function Pt(l,i){return e.openBlock(),e.createElementBlock("svg",Ot,[...i[0]||(i[0]=[e.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[e.createElementVNode("path",{d:"M21 17h-5.397a5 5 0 0 1-4.096-2.133l-.514-.734A5 5 0 0 0 6.897 12H3m18-5h-5.395a5 5 0 0 0-4.098 2.135l-.51.73A5 5 0 0 1 6.9 12H3"}),e.createElementVNode("path",{d:"m18 10l3-3l-3-3m0 16l3-3l-3-3"})],-1)])])}const Le=P(Lt,[["render",Pt]]),Rt={class:"parallel-node"},zt={class:"node-header"},Ht={class:"icon-wrapper"},At={class:"node-label"},vt={key:0,class:"status-spinner"},Ft={class:"parallel-badge"},Oe=P(e.defineComponent({__name:"ParallelNode",props:{id:{},data:{},selected:{type:Boolean}},emits:["inspect"],setup(l,{emit:i}){const s=l,d=e.computed(()=>s.data.label||"Parallel"),a=e.computed(()=>s.data.status||"idle"),N=e.computed(()=>s.data.mergeEnabled!==!1),o=e.computed(()=>s.data.branches||[]),m=e.computed(()=>{const V=o.value.length;return V===0?[]:V===1?[50]:o.value.map((k,p)=>(p+1)/(V+1)*100)}),E=i;return(V,k)=>(e.openBlock(),e.createBlock(J,{id:l.id,selected:l.selected,status:a.value,variant:"info",onInspect:k[0]||(k[0]=p=>E("inspect"))},{default:e.withCtx(()=>[e.createVNode(e.unref(I.Handle),{type:"target",position:e.unref(I.Position).Top,class:"handle"},null,8,["position"]),e.createElementVNode("div",Rt,[e.createElementVNode("div",zt,[e.createElementVNode("div",Ht,[e.createVNode(Le,{class:"merge-icon"})]),e.createElementVNode("span",At,e.toDisplayString(d.value),1),a.value==="active"?(e.openBlock(),e.createElementBlock("div",vt)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ft,[e.createElementVNode("span",null,e.toDisplayString(N.value?"Parallel Merge":"Parallel Split")+" · "+e.toDisplayString(o.value.length)+" branches",1)])]),N.value?(e.openBlock(),e.createBlock(e.unref(I.Handle),{key:0,type:"source",position:e.unref(I.Position).Bottom,id:"merged",class:"handle merged-output"},null,8,["position"])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(o.value,(p,y)=>(e.openBlock(),e.createBlock(e.unref(I.Handle),{key:p.id,type:"source",position:e.unref(I.Position).Bottom,id:p.id,class:"handle branch-handle",style:e.normalizeStyle({left:`${m.value[y]}%`})},null,8,["position","id","style"]))),128))]),_:1},8,["id","selected","status"]))}}),[["__scopeId","data-v-fe2a1cc4"]]),jt=Object.freeze(Object.defineProperty({__proto__:null,default:Oe},Symbol.toStringTag,{value:"Module"})),Ut={},Wt={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function Kt(l,i){return e.openBlock(),e.createElementBlock("svg",Wt,[...i[0]||(i[0]=[e.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 6a3 3 0 1 0 6 0a3 3 0 0 0-6 0m18 5V8a2 2 0 0 0-2-2h-6l3 3m0-6l-3 3M3 13v3a2 2 0 0 0 2 2h6l-3-3m0 6l3-3m4 0a3 3 0 1 0 6 0a3 3 0 0 0-6 0"},null,-1)])])}const Pe=P(Ut,[["render",Kt]]),qt={class:"while-node"},Gt={class:"node-header"},Yt={class:"icon-wrapper"},Xt={class:"node-label"},Jt={class:"meta"},Qt={class:"meta-item"},Zt={class:"meta-item"},eo={key:0,class:"meta-item accumulate-badge",title:"Collects all outputs"},Re=P(e.defineComponent({__name:"WhileLoopNode",props:{id:{},data:{},selected:{type:Boolean}},emits:["inspect"],setup(l,{emit:i}){const s=l,d=e.computed(()=>s.data.label||"While Loop"),a=e.computed(()=>s.data.status||"idle"),N=e.computed(()=>s.data.maxIterations??10),o=e.computed(()=>s.data.loopMode??"condition"),m=e.computed(()=>s.data.outputMode??"last"),E=e.computed(()=>typeof s.data.iteration=="number"?s.data.iteration:null),V=e.computed(()=>o.value==="fixed"?"Fixed":"While"),k=i;return(p,y)=>(e.openBlock(),e.createBlock(J,{id:l.id,selected:l.selected,status:a.value,variant:"info",onInspect:y[0]||(y[0]=M=>k("inspect"))},{default:e.withCtx(()=>[e.createVNode(e.unref(I.Handle),{type:"target",position:e.unref(I.Position).Top,class:"handle"},null,8,["position"]),e.createElementVNode("div",qt,[e.createElementVNode("div",Gt,[e.createElementVNode("div",Yt,[e.createVNode(Pe,{class:"loop-icon"})]),e.createElementVNode("span",Xt,e.toDisplayString(d.value),1),e.createElementVNode("span",{class:e.normalizeClass(["pill",{fixed:o.value==="fixed"}])},e.toDisplayString(V.value),3)]),e.createElementVNode("div",Jt,[e.createElementVNode("span",Qt,[y[1]||(y[1]=e.createElementVNode("strong",null,"Max:",-1)),e.createTextVNode(" "+e.toDisplayString(N.value),1)]),e.createElementVNode("span",Zt,[y[2]||(y[2]=e.createElementVNode("strong",null,"Iter:",-1)),e.createTextVNode(" "+e.toDisplayString(E.value??"—"),1)]),m.value==="accumulate"?(e.openBlock(),e.createElementBlock("span",eo," 📦 ")):e.createCommentVNode("",!0)])]),y[3]||(y[3]=e.createElementVNode("div",{class:"port-labels"},[e.createElementVNode("span",{class:"port-label body-label"},"↻ Loop"),e.createElementVNode("span",{class:"port-label done-label"},"✓ Exit")],-1)),e.createVNode(e.unref(I.Handle),{type:"source",position:e.unref(I.Position).Bottom,id:"body",class:"handle body-handle",style:{left:"30%"}},null,8,["position"]),e.createVNode(e.unref(I.Handle),{type:"source",position:e.unref(I.Position).Bottom,id:"done",class:"handle done-handle",style:{left:"70%"}},null,8,["position"])]),_:1},8,["id","selected","status"]))}}),[["__scopeId","data-v-e439cd33"]]),to=Object.freeze(Object.defineProperty({__proto__:null,default:Re},Symbol.toStringTag,{value:"Module"})),oo={},no={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function lo(l,i){return e.openBlock(),e.createElementBlock("svg",no,[...i[0]||(i[0]=[e.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[e.createElementVNode("path",{d:"m14 12l6-3l-8-4l-8 4l6 3"}),e.createElementVNode("path",{fill:"currentColor",d:"m10 12l-6 3l8 4l8-4l-6-3l-2 1z"})],-1)])])}const ze=P(oo,[["render",lo]]),ao={class:"subflow-node"},so={class:"node-header"},ro={class:"icon-wrapper"},io={class:"node-label"},co={key:0,class:"status-spinner"},mo={class:"subflow-info"},po={class:"meta-row"},uo={key:0,class:"meta-item"},He=P(e.defineComponent({__name:"SubflowNode",props:{id:{},data:{},selected:{type:Boolean}},emits:["inspect"],setup(l,{emit:i}){const s=l,d=e.computed(()=>s.data.label||"Subflow"),a=e.computed(()=>s.data.subflowId||""),N=e.computed(()=>s.data.shareSession!==!1),o=e.computed(()=>s.data.status||"idle"),m=e.computed(()=>a.value?a.value:"No subflow selected"),E=e.computed(()=>{const k=s.data.inputMappings||{};return Object.keys(k).length}),V=i;return(k,p)=>(e.openBlock(),e.createBlock(J,{id:l.id,selected:l.selected,status:o.value,variant:"secondary",onInspect:p[0]||(p[0]=y=>V("inspect"))},{default:e.withCtx(()=>[e.createVNode(e.unref(I.Handle),{type:"target",position:e.unref(I.Position).Top,class:"handle"},null,8,["position"]),e.createElementVNode("div",ao,[e.createElementVNode("div",so,[e.createElementVNode("div",ro,[e.createVNode(ze,{class:"subflow-icon"})]),e.createElementVNode("span",io,e.toDisplayString(d.value),1),o.value==="active"?(e.openBlock(),e.createElementBlock("div",co)):e.createCommentVNode("",!0)]),e.createElementVNode("div",mo,[e.createElementVNode("div",{class:e.normalizeClass(["subflow-badge",{empty:!a.value}])},[p[1]||(p[1]=e.createElementVNode("svg",{class:"link-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{d:"M10 13a5 5 0 007.54.54l3-3a5 5 0 00-7.07-7.07l-1.72 1.71"}),e.createElementVNode("path",{d:"M14 11a5 5 0 00-7.54-.54l-3 3a5 5 0 007.07 7.07l1.71-1.71"})],-1)),e.createElementVNode("span",null,e.toDisplayString(m.value),1)],2),e.createElementVNode("div",po,[E.value>0?(e.openBlock(),e.createElementBlock("span",uo,[p[2]||(p[2]=e.createElementVNode("svg",{class:"meta-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{d:"M9 21H5a2 2 0 01-2-2V5a2 2 0 012-2h4"}),e.createElementVNode("polyline",{points:"16 17 21 12 16 7"}),e.createElementVNode("line",{x1:"21",y1:"12",x2:"9",y2:"12"})],-1)),e.createTextVNode(" "+e.toDisplayString(E.value)+" input"+e.toDisplayString(E.value!==1?"s":""),1)])):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(["meta-item",{muted:!N.value}])},[p[3]||(p[3]=e.createElementVNode("svg",{class:"meta-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{d:"M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2"}),e.createElementVNode("circle",{cx:"9",cy:"7",r:"4"}),e.createElementVNode("path",{d:"M23 21v-2a4 4 0 00-3-3.87"}),e.createElementVNode("path",{d:"M16 3.13a4 4 0 010 7.75"})],-1)),e.createTextVNode(" "+e.toDisplayString(N.value?"Shared":"Isolated"),1)],2)])])]),e.createVNode(e.unref(I.Handle),{type:"source",position:e.unref(I.Position).Bottom,class:"handle"},null,8,["position"]),e.createVNode(e.unref(I.Handle),{type:"source",position:e.unref(I.Position).Right,id:"error",class:"handle error-handle"},null,8,["position"])]),_:1},8,["id","selected","status"]))}}),[["__scopeId","data-v-d5994547"]]),fo=Object.freeze(Object.defineProperty({__proto__:null,default:He},Symbol.toStringTag,{value:"Module"})),go={},ho={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function ko(l,i){return e.openBlock(),e.createElementBlock("svg",ho,[...i[0]||(i[0]=[e.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M11.042 19.933A9.8 9.8 0 0 1 7.7 19L3 20l1.3-3.9C1.976 12.663 2.874 8.228 6.4 5.726c3.526-2.501 8.59-2.296 11.845.48c2.127 1.814 3.052 4.36 2.694 6.808M15 19l2 2l4-4"},null,-1)])])}const Ae=P(go,[["render",ko]]),No={class:"output-node"},Eo={class:"node-header"},yo={class:"icon-wrapper"},Vo={class:"node-label"},bo={key:0,class:"status-spinner"},wo={class:"output-info"},xo={class:"format-badge"},Bo={class:"meta-row"},_o={key:0,class:"meta-item"},Co={key:1,class:"meta-item"},ve=P(e.defineComponent({__name:"OutputNode",props:{id:{},data:{},selected:{type:Boolean}},emits:["inspect"],setup(l,{emit:i}){const s=l,d=e.computed(()=>s.data.label||"Output"),a=e.computed(()=>s.data.format||"text"),N=e.computed(()=>!!s.data.template),o=e.computed(()=>s.data.includeMetadata??!1),m=e.computed(()=>s.data.status||"idle"),E=e.computed(()=>{switch(a.value){case"json":return"JSON";case"markdown":return"MD";default:return"TXT"}}),V=i;return(k,p)=>(e.openBlock(),e.createBlock(J,{id:l.id,selected:l.selected,status:m.value,variant:"info",onInspect:p[0]||(p[0]=y=>V("inspect"))},{default:e.withCtx(()=>[e.createVNode(e.unref(I.Handle),{type:"target",position:e.unref(I.Position).Top,class:"handle"},null,8,["position"]),e.createElementVNode("div",No,[e.createElementVNode("div",Eo,[e.createElementVNode("div",yo,[e.createVNode(Ae,{class:"output-icon"})]),e.createElementVNode("span",Vo,e.toDisplayString(d.value),1),m.value==="active"?(e.openBlock(),e.createElementBlock("div",bo)):e.createCommentVNode("",!0)]),e.createElementVNode("div",wo,[e.createElementVNode("div",xo,[p[1]||(p[1]=e.createElementVNode("svg",{class:"format-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{d:"M4 7V4h16v3"}),e.createElementVNode("path",{d:"M9 20h6"}),e.createElementVNode("path",{d:"M12 4v16"})],-1)),e.createElementVNode("span",null,e.toDisplayString(E.value),1)]),e.createElementVNode("div",Bo,[N.value?(e.openBlock(),e.createElementBlock("span",_o,[...p[2]||(p[2]=[e.createElementVNode("svg",{class:"meta-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"})],-1),e.createTextVNode(" Template ",-1)])])):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createElementBlock("span",Co,[...p[3]||(p[3]=[e.createElementVNode("svg",{class:"meta-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("circle",{cx:"12",cy:"12",r:"10"}),e.createElementVNode("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),e.createElementVNode("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})],-1),e.createTextVNode(" Metadata ",-1)])])):e.createCommentVNode("",!0)])]),p[4]||(p[4]=e.createElementVNode("div",{class:"terminal-indicator"},[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),e.createElementVNode("line",{x1:"9",y1:"9",x2:"15",y2:"15"}),e.createElementVNode("line",{x1:"15",y1:"9",x2:"9",y2:"15"})]),e.createElementVNode("span",null,"Terminal")],-1))])]),_:1},8,["id","selected","status"]))}}),[["__scopeId","data-v-94e60a57"]]),So=Object.freeze(Object.defineProperty({__proto__:null,default:ve},Symbol.toStringTag,{value:"Module"})),Do=["data-workflow-canvas"],$o={key:0,class:"edge-label"},Io=P(e.defineComponent({__name:"WorkflowCanvas",props:{editor:{},nodeStatuses:{},panOnDrag:{type:[Boolean,Array]},selectionKeyCode:{type:[Boolean,String,Array,Function,null]},selectionMode:{},canvasId:{}},emits:["nodeClick","edgeClick","paneClick","drop","nodeInspect"],setup(l,{expose:i,emit:s}){const d=l,a=s;function N(h){if(!g())return;d.editor.commands.selectNode(h.id);const D=$.value.find(_=>_.id===h.id);D&&a("nodeInspect",D)}const{onConnect:o,onNodeDragStop:m,screenToFlowCoordinate:E,fitView:V,nodes:k,edges:p,panOnDrag:y,selectionKeyCode:M,selectionMode:B}=I.useVueFlow(),S=y.value,c=M.value,u=B.value;e.watch(()=>d.panOnDrag,h=>{y.value=h??S},{immediate:!0}),e.watch(()=>d.selectionKeyCode,h=>{M.value=h??c},{immediate:!0}),e.watch(()=>d.selectionMode,h=>{B.value=h??u},{immediate:!0});const $=e.ref([]),f=e.ref([]),g=()=>!d.editor.isDestroyed();let b=new Map,x=new Map,L=-1;const A=(h,D)=>`${d.editor.getNodeVersion(h)}:${D}`,v=(h,D)=>`${d.editor.getEdgeVersion(h)}:${D}`,O=()=>{const h=d.editor.getNodes(),D=d.editor.getEdges(),_=d.editor.getGlobalVersion();if(L===_&&!d.nodeStatuses)return;const j=new Map,R=new Map;let U=!1;const H=new Set($.value.map(C=>C.id)),K=new Set(h.map(C=>C.id));if(H.size!==K.size)U=!0;else for(const C of K)if(!H.has(C)){U=!0;break}if(!U)for(const C of h){const X=d.nodeStatuses?.[C.id]||"idle",ee=A(C.id,X);j.set(C.id,ee),b.get(C.id)!==ee&&(U=!0)}if(U){$.value=h.map(C=>({id:C.id,type:C.type,position:C.position,data:{...C.data,status:d.nodeStatuses?.[C.id]||"idle"},selected:C.selected})),b=new Map;for(const C of h){const X=d.nodeStatuses?.[C.id]||"idle";b.set(C.id,A(C.id,X))}}let Z=!1;const ce=new Set(f.value.map(C=>C.id)),me=new Set(D.map(C=>C.id));if(ce.size!==me.size)Z=!0;else for(const C of me)if(!ce.has(C)){Z=!0;break}if(!Z)for(const C of D){const X=d.nodeStatuses?.[C.source]==="active"||d.nodeStatuses?.[C.target]==="active",ee=v(C.id,X);R.set(C.id,ee),x.get(C.id)!==ee&&(Z=!0)}if(Z){f.value=D.map(C=>({id:C.id,source:C.source,target:C.target,sourceHandle:C.sourceHandle,targetHandle:C.targetHandle,label:C.label,data:C.data,animated:d.nodeStatuses?.[C.source]==="active"||d.nodeStatuses?.[C.target]==="active"})),x=new Map;for(const C of D){const X=d.nodeStatuses?.[C.source]==="active"||d.nodeStatuses?.[C.target]==="active";x.set(C.id,v(C.id,X))}}L=_};e.watch(()=>d.nodeStatuses,()=>{O()},{deep:!0});let Q=null,z=null,te=!1;const pe=e.computed(()=>k.value.filter(h=>h.selected).map(h=>h.id).sort().join(","));e.watch(pe,(h,D)=>{if(!g()||te||h===D)return;const _=h?h.split(","):[];d.editor.commands.setSelection(_)}),e.onMounted(()=>{g()&&(O(),Q=d.editor.on("update",O),z=d.editor.on("selectionUpdate",()=>{te=!0,O(),e.nextTick(()=>{te=!1})}),setTimeout(()=>V({padding:.2}),100))}),e.onUnmounted(()=>{Q?.(),z?.()}),o(h=>{g()&&d.editor.commands.createEdge(h.source,h.target,h.sourceHandle??void 0,h.targetHandle??void 0)}),m(()=>{if(!g())return;const h=k.value.filter(D=>D.selected);for(const D of h)d.editor.commands.setNodePosition(D.id,D.position)});const ue=h=>{g()&&(d.editor.commands.selectNode(h.node.id),a("nodeClick",h.node))},fe=h=>{g()&&d.editor.commands.deselectAll(),a("edgeClick",h.edge)},ge=()=>{g()&&(d.editor.commands.deselectAll(),a("paneClick"))},he=h=>{if(!g())return;const D=h.dataTransfer?.getData("application/vueflow"),_=h.dataTransfer?.getData("application/json");if(!D||!_)return;let j;try{j=JSON.parse(_)}catch(K){console.warn("Failed to parse dropped node data",K);return}if(!(K=>typeof K=="object"&&K!==null&&"label"in K&&typeof K.label=="string")(j)){console.warn('Dropped node data is missing required "label" field');return}const U=j,H=E({x:h.clientX,y:h.clientY});d.editor.commands.createNode(D,U,H),a("drop",h)},ke=h=>{h.preventDefault(),h.dataTransfer&&(h.dataTransfer.dropEffect="move")},Ne=h=>{h.currentTarget?.focus()},ie=h=>{if(!g())return;const D=h,{nodeType:_,defaultData:j,x:R,y:U}=D.detail,H=E({x:R,y:U});d.editor.commands.createNode(_,j,H)},de=()=>{const h=d.canvasId?`[data-workflow-canvas="${d.canvasId}"] .vue-flow`:".vue-flow";return document.querySelector(h)};e.onMounted(()=>{const h=de();h&&h.addEventListener("mobileNodeDrop",ie)}),e.onUnmounted(()=>{const h=de();h&&h.removeEventListener("mobileNodeDrop",ie)});const Ee=h=>{if(!g())return;const D=h.target;if(!(D.tagName==="INPUT"||D.tagName==="TEXTAREA")){if(h.key==="Delete"||h.key==="Backspace"){h.preventDefault();const _=p.value.filter(R=>R.selected).map(R=>R.id),j=k.value.filter(R=>R.selected&&R.type!=="start").map(R=>R.id);if(_.length){_.forEach(R=>d.editor.commands.deleteEdge(R));return}j.forEach(R=>d.editor.commands.deleteNode(R))}(h.metaKey||h.ctrlKey)&&h.key==="z"&&!h.shiftKey&&(h.preventDefault(),d.editor.commands.undo()),(h.metaKey||h.ctrlKey)&&(h.key==="y"||h.key==="z"&&h.shiftKey)&&(h.preventDefault(),d.editor.commands.redo()),(h.metaKey||h.ctrlKey)&&h.key==="d"&&(h.preventDefault(),d.editor.getSelected().nodes.forEach(_=>d.editor.commands.duplicateNode(_)))}};return i({fitView:()=>V({padding:.2})}),(h,D)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["workflow-canvas",{"workflow-canvas-select":l.selectionKeyCode===!0}]),"data-workflow-canvas":l.canvasId||void 0,onDrop:he,onDragover:ke,onKeydown:Ee,onMousedown:Ne,tabindex:"0"},[e.createVNode(e.unref(I.VueFlow),{nodes:$.value,"onUpdate:nodes":D[0]||(D[0]=_=>$.value=_),edges:f.value,"onUpdate:edges":D[1]||(D[1]=_=>f.value=_),"default-viewport":{x:50,y:50,zoom:1},"min-zoom":.5,"max-zoom":2,"fit-view-on-init":"","pan-on-drag":l.panOnDrag,"selection-key-code":l.selectionKeyCode,"selection-mode":l.selectionMode,"delete-key-code":null,onNodeClick:ue,onEdgeClick:fe,onPaneClick:ge},{"node-start":e.withCtx(_=>[e.createVNode(De,{id:_.id,data:_.data,selected:_.selected},null,8,["id","data","selected"])]),"node-agent":e.withCtx(_=>[e.createVNode(Ie,e.mergeProps(_,{onInspect:j=>N(_)}),null,16,["onInspect"])]),"node-router":e.withCtx(_=>[e.createVNode(Te,e.mergeProps(_,{onInspect:j=>N(_)}),null,16,["onInspect"])]),"node-parallel":e.withCtx(_=>[e.createVNode(Oe,e.mergeProps(_,{onInspect:j=>N(_)}),null,16,["onInspect"])]),"node-whileLoop":e.withCtx(_=>[e.createVNode(Re,e.mergeProps(_,{onInspect:j=>N(_)}),null,16,["onInspect"])]),"node-subflow":e.withCtx(_=>[e.createVNode(He,e.mergeProps(_,{onInspect:j=>N(_)}),null,16,["onInspect"])]),"node-output":e.withCtx(_=>[e.createVNode(ve,e.mergeProps(_,{onInspect:j=>N(_)}),null,16,["onInspect"])]),"edge-label":e.withCtx(({label:_})=>[_?(e.openBlock(),e.createElementBlock("div",$o,e.toDisplayString(_),1)):e.createCommentVNode("",!0)]),default:e.withCtx(()=>[e.createVNode(e.unref(Je.Background),{gap:20,size:1,"pattern-color":"rgba(255, 255, 255, 0.03)"}),e.createVNode(e.unref(be.Controls),{position:"bottom-left"})]),_:1},8,["nodes","edges","pan-on-drag","selection-key-code","selection-mode"])],42,Do))}}),[["__scopeId","data-v-149e9faf"]]),Mo={},To={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function Lo(l,i){return e.openBlock(),e.createElementBlock("svg",To,[...i[0]||(i[0]=[e.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),e.createElementVNode("line",{x1:"5",y1:"12",x2:"19",y2:"12"})],-1)])])}const Oo=P(Mo,[["render",Lo]]),Po={},Ro={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"};function zo(l,i){return e.openBlock(),e.createElementBlock("svg",Ro,[...i[0]||(i[0]=[e.createStaticVNode('<circle cx="9" cy="5" r="1"></circle><circle cx="9" cy="12" r="1"></circle><circle cx="9" cy="19" r="1"></circle><circle cx="15" cy="5" r="1"></circle><circle cx="15" cy="12" r="1"></circle><circle cx="15" cy="19" r="1"></circle>',6)])])}const Ho=P(Po,[["render",zo]]),Ao={},vo={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"};function Fo(l,i){return e.openBlock(),e.createElementBlock("svg",vo,[...i[0]||(i[0]=[e.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[e.createElementVNode("path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0-18 0m9-3h.01"}),e.createElementVNode("path",{d:"M11 12h1v4h1"})],-1)])])}const jo=P(Ao,[["render",Fo]]),Uo={class:"node-palette"},Wo={class:"palette-header"},Ko={class:"palette-nodes"},qo=["onDragstart","onTouchstart","onClick"],Go={class:"node-info"},Yo={class:"node-name"},Xo={class:"node-desc"},Jo={class:"palette-hint"},Qo=6,Zo=P(e.defineComponent({__name:"NodePalette",props:{editor:{},canvasId:{}},emits:["quick-add"],setup(l,{emit:i}){const s=l,d=i,a=e.ref(!1),N=()=>{a.value=window.innerWidth<=768};e.onMounted(()=>{N(),window.addEventListener("resize",N)}),e.onUnmounted(()=>{window.removeEventListener("resize",N)});const o=[{type:"agent",label:"AI Agent",description:"Connect to an AI model to process and respond to messages",colorVar:"--or3-color-accent",icon:$e,defaultData:{label:"New Agent",model:"z-ai/glm-4.6:exacto",prompt:""}},{type:"router",label:"Decision",description:"Route messages to different paths based on intent",colorVar:"--or3-color-warning",icon:Me,defaultData:{label:"Decision"}},{type:"parallel",label:"Parallel",description:"Run multiple tasks at once and combine results",colorVar:"--or3-color-info",icon:Le,defaultData:{label:"Parallel",model:"z-ai/glm-4.6:exacto",prompt:"Combine the outputs into a coherent response.",branches:[]}},{type:"whileLoop",label:"Loop",description:"Repeat a sequence until a condition is met",colorVar:"--or3-color-info",icon:Pe,defaultData:{label:"Loop",conditionPrompt:'Should we continue iterating? Respond with "continue" or "done".',maxIterations:10,onMaxIterations:"warning"}},{type:"subflow",label:"Sub-workflow",description:"Embed another workflow as a single node",colorVar:"--or3-color-secondary",icon:ze,defaultData:{label:"Sub-workflow",subflowId:"",inputMappings:{},shareSession:!0}},{type:"output",label:"Output",description:"Define the final output format",colorVar:"--or3-color-success",icon:Ae,defaultData:{label:"Output",format:"text",template:"",includeMetadata:!1}}],m=()=>{const f=s.canvasId?`[data-workflow-canvas="${s.canvasId}"] .vue-flow`:".vue-flow";return document.querySelector(f)},E=(f,g,b)=>{f.dataTransfer&&(f.dataTransfer.setData("application/vueflow",g),f.dataTransfer.setData("application/json",JSON.stringify(b)),f.dataTransfer.effectAllowed="move")};let V=null,k=!1,p=!1,y=0,M=0;const B=(f,g,b)=>{V={nodeType:g,defaultData:b},p=!1;const x=f.touches[0];x&&(y=x.clientX,M=x.clientY)},S=f=>{if(!V||p)return;const g=f.touches[0];if(!g)return;const b=Math.abs(g.clientX-y),x=Math.abs(g.clientY-M);if(b+x<Qo)return;p=!0,f.currentTarget.classList.add("dragging-touch")},c=f=>{if(f.currentTarget.classList.remove("dragging-touch"),!V)return;const b=f.changedTouches[0],x=document.elementFromPoint(b.clientX,b.clientY),L=m();if(L&&(L===x||L.contains(x))){const A=new CustomEvent("mobileNodeDrop",{detail:{nodeType:V.nodeType,defaultData:V.defaultData,x:b.clientX,y:b.clientY}});L.dispatchEvent(A),k=!0,setTimeout(()=>{k=!1},0)}V=null,p=!1},u=(f,g)=>{const b=m();if(!b)return;const x=b.getBoundingClientRect(),L=x.left+x.width/2,A=x.top+x.height/2,v=new CustomEvent("mobileNodeDrop",{detail:{nodeType:f,defaultData:g,x:L,y:A}});b.dispatchEvent(v)},$=(f,g,b)=>{if(k){k=!1;return}a.value&&(f.preventDefault(),u(g,b),d("quick-add"))};return(f,g)=>(e.openBlock(),e.createElementBlock("div",Uo,[e.createElementVNode("div",Wo,[e.createVNode(Oo,{class:"plus-icon"}),g[1]||(g[1]=e.createElementVNode("span",null,"Add Nodes",-1))]),e.createElementVNode("div",Ko,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(o,b=>e.createElementVNode("div",{key:b.type,class:"palette-node",draggable:"true",onDragstart:x=>E(x,b.type,b.defaultData),onTouchstart:x=>B(x,b.type,b.defaultData),onTouchmove:S,onTouchend:g[0]||(g[0]=x=>c(x)),onClick:x=>$(x,b.type,b.defaultData)},[e.createElementVNode("div",{class:"node-icon",style:e.normalizeStyle({"--node-color":`var(${b.colorVar}, #8b5cf6)`})},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(b.icon)))],4),e.createElementVNode("div",Go,[e.createElementVNode("span",Yo,e.toDisplayString(b.label),1),e.createElementVNode("span",Xo,e.toDisplayString(b.description),1)]),e.createVNode(Ho,{class:"drag-handle"})],40,qo)),64))]),e.createElementVNode("div",Jo,[e.createVNode(jo,{class:"hint-icon"}),g[2]||(g[2]=e.createElementVNode("p",null," Drag nodes onto the canvas to build your workflow. Connect nodes by dragging from output to input handles. ",-1))])]))}}),[["__scopeId","data-v-958e336f"]]),en={class:"mode-selector"},tn=["onClick","title"],on=["innerHTML"],nn=P(e.defineComponent({__name:"OutputModeSelector",props:{modelValue:{}},emits:["update:modelValue"],setup(l,{emit:i}){const s=i,d=[{value:"combine",label:"Combine",description:"Concatenate outputs without AI processing",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M13 2L3 14h9l-1 8 10-12h-9l1-8z"/></svg>'},{value:"synthesis",label:"AI Synthesis",description:"Use AI to synthesize a new output",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 2a2 2 0 0 1 2 2c0 .74-.4 1.39-1 1.73V7h1a7 7 0 0 1 7 7h1a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1h-1v1a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-1H2a1 1 0 0 1-1-1v-3a1 1 0 0 1 1-1h1a7 7 0 0 1 7-7h1V5.73c-.6-.34-1-.99-1-1.73a2 2 0 0 1 2-2z"/><path d="M2 12h20"/><path d="M12 12v10"/><path d="M8 17h8"/></svg>'}];return(a,N)=>(e.openBlock(),e.createElementBlock("div",en,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(d,o=>e.createElementVNode("button",{key:o.value,onClick:m=>s("update:modelValue",o.value),class:e.normalizeClass(["mode-btn",{active:l.modelValue===o.value}]),title:o.description},[e.createElementVNode("span",{innerHTML:o.icon,class:"mode-icon"},null,8,on),e.createTextVNode(" "+e.toDisplayString(o.label),1)],10,tn)),64))]))}}),[["__scopeId","data-v-080a00d4"]]),ln={class:"space-y-3 source-picker"},an={class:"flex items-center justify-between"},sn={class:"relative"},rn=["disabled"],dn={key:0,class:"absolute right-0 top-full mt-1 w-64 bg-white dark:bg-gray-800 rounded-lg shadow-lg border border-gray-200 dark:border-gray-700 z-50 max-h-60 overflow-y-auto"},cn={key:0,class:"p-3 text-xs text-gray-500 text-center"},mn={key:1,class:"py-1"},pn={key:0,class:"px-3 py-1 text-xs font-semibold text-gray-500 bg-gray-50 dark:bg-gray-700/50"},un=["onClick"],fn={class:"truncate"},gn={class:"text-xs text-gray-400"},hn=["onDragstart","onDragover"],kn={key:0,class:"drop-indicator before"},Nn={key:1,class:"drop-indicator after"},En={class:"flex-1 min-w-0 pointer-events-none"},yn={class:"text-sm font-semibold truncate"},Vn={key:0,class:"text-xs source-subtext truncate"},bn=["onClick"],wn={key:1,class:"empty-state"},xn=P(e.defineComponent({__name:"OutputSourcePicker",props:{modelValue:{},availableGroups:{},disabled:{type:Boolean}},emits:["update:modelValue"],setup(l,{emit:i}){const s=l,d=i,a=e.computed(()=>s.availableGroups.flatMap(f=>f.sources)),N=e.computed(()=>s.modelValue.map(f=>a.value.find(g=>g.id===f)).filter(f=>!!f)),o=e.computed(()=>s.availableGroups.map(f=>({...f,sources:f.sources.filter(g=>!s.modelValue.includes(g.id))})).filter(f=>f.sources.length>0)),m=e.ref(!1);function E(f){d("update:modelValue",[...s.modelValue,f]),m.value=!1}function V(f){d("update:modelValue",s.modelValue.filter(g=>g!==f))}const k=e.ref(null),p=e.ref(null);function y(f,g){k.value=g,f.dataTransfer&&(f.dataTransfer.effectAllowed="move",f.dataTransfer.dropEffect="move")}function M(f,g){if(f.preventDefault(),k.value===null)return;if(k.value===g){p.value=null;return}const x=f.currentTarget.getBoundingClientRect(),L=x.top+x.height/2,A=f.clientY<L?"before":"after";(p.value?.index!==g||p.value?.position!==A)&&(p.value={index:g,position:A})}function B(f){const g=f.relatedTarget;f.currentTarget.contains(g)}function S(f){const g=f.relatedTarget;f.currentTarget.contains(g)||(p.value=null)}function c(f){if(f.preventDefault(),k.value===null||!p.value){$();return}const g=N.value[k.value],b=N.value[p.value.index];if(!g||!b||g.id===b.id){$();return}const x=[...s.modelValue],L=x.indexOf(g.id);if(L===-1){$();return}const[A]=x.splice(L,1);let v=x.indexOf(b.id);if(v===-1){$();return}p.value.position==="after"&&v++,x.splice(v,0,A),d("update:modelValue",x),$()}function u(){$()}function $(){k.value=null,p.value=null}return(f,g)=>(e.openBlock(),e.createElementBlock("div",ln,[e.createElementVNode("div",an,[g[3]||(g[3]=e.createElementVNode("label",{class:"sources-label"},"Sources",-1)),e.createElementVNode("div",sn,[e.createElementVNode("button",{onClick:g[0]||(g[0]=b=>m.value=!m.value),disabled:l.disabled||o.value.length===0,class:"add-source-btn"},[...g[2]||(g[2]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),e.createElementVNode("line",{x1:"5",y1:"12",x2:"19",y2:"12"})],-1),e.createTextVNode(" Add Source ",-1)])],8,rn),m.value?(e.openBlock(),e.createElementBlock("div",dn,[o.value.length===0?(e.openBlock(),e.createElementBlock("div",cn," No more sources available ")):(e.openBlock(),e.createElementBlock("div",mn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(b,x)=>(e.openBlock(),e.createElementBlock("div",{key:x},[b.type==="parallel"?(e.openBlock(),e.createElementBlock("div",pn,e.toDisplayString(b.label),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.sources,L=>(e.openBlock(),e.createElementBlock("button",{key:L.id,onClick:A=>E(L.id),class:"w-full text-left px-3 py-2 text-sm hover:bg-gray-100 dark:hover:bg-gray-700 flex items-center justify-between group"},[e.createElementVNode("span",fn,e.toDisplayString(L.branchLabel||L.label),1),e.createElementVNode("span",gn,e.toDisplayString(L.type),1)],8,un))),128))]))),128))]))])):e.createCommentVNode("",!0),m.value?(e.openBlock(),e.createElementBlock("div",{key:1,onClick:g[1]||(g[1]=b=>m.value=!1),class:"fixed inset-0 z-40"})):e.createCommentVNode("",!0)])]),N.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:"space-y-2 relative",onDragleave:S},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,(b,x)=>(e.openBlock(),e.createElementBlock("div",{key:b.id,draggable:"true",onDragstart:L=>y(L,x),onDragover:L=>M(L,x),onDragleave:B,onDrop:c,onDragend:u,class:e.normalizeClass(["source-card group",{"is-dragging":k.value===x}])},[p.value?.index===x&&p.value.position==="before"?(e.openBlock(),e.createElementBlock("div",kn)):e.createCommentVNode("",!0),p.value?.index===x&&p.value.position==="after"?(e.openBlock(),e.createElementBlock("div",Nn)):e.createCommentVNode("",!0),g[5]||(g[5]=e.createStaticVNode('<div class="drag-handle" title="Drag to reorder" data-v-82c6b2ea><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" data-v-82c6b2ea><line x1="8" y1="6" x2="21" y2="6" data-v-82c6b2ea></line><line x1="8" y1="12" x2="21" y2="12" data-v-82c6b2ea></line><line x1="8" y1="18" x2="21" y2="18" data-v-82c6b2ea></line><line x1="3" y1="6" x2="3.01" y2="6" data-v-82c6b2ea></line><line x1="3" y1="12" x2="3.01" y2="12" data-v-82c6b2ea></line><line x1="3" y1="18" x2="3.01" y2="18" data-v-82c6b2ea></line></svg></div>',1)),e.createElementVNode("div",En,[e.createElementVNode("div",yn,e.toDisplayString(b.branchLabel||b.label),1),b.parallelParentId?(e.openBlock(),e.createElementBlock("div",Vn," from "+e.toDisplayString(b.label),1)):e.createCommentVNode("",!0)]),e.createElementVNode("button",{onClick:L=>V(b.id),class:"remove-btn",title:"Remove source"},[...g[4]||(g[4]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])],8,bn)],42,hn))),128))],32)):(e.openBlock(),e.createElementBlock("div",wn,[...g[6]||(g[6]=[e.createTextVNode(" No sources selected. ",-1),e.createElementVNode("br",null,null,-1),e.createElementVNode("span",{class:"text-xs"},"Output will be empty.",-1)])]))]))}}),[["__scopeId","data-v-82c6b2ea"]]),Bn={class:"preview-card"},_n={class:"preview-header"},Cn={key:0,class:"preview-status"},Sn={key:1,class:"preview-empty"},Dn={key:0,class:"preview-footer"},$n=P(e.defineComponent({__name:"OutputPreview",props:{previewData:{},maxHeight:{}},setup(l){const i=l,s=e.computed(()=>({maxHeight:i.maxHeight?`${i.maxHeight}px`:"200px"}));return(d,a)=>(e.openBlock(),e.createElementBlock("div",Bn,[e.createElementVNode("div",_n,[a[1]||(a[1]=e.createElementVNode("span",{class:"preview-label"},"Preview",-1)),l.previewData.isComplete?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Cn,[...a[0]||(a[0]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"12",cy:"12",r:"10"}),e.createElementVNode("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),e.createElementVNode("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})],-1),e.createTextVNode(" Incomplete ",-1)])]))]),e.createElementVNode("div",{class:"preview-body",style:e.normalizeStyle(s.value)},[l.previewData.assembledPreview?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(l.previewData.assembledPreview),1)],64)):(e.openBlock(),e.createElementBlock("div",Sn,"(Empty output)"))],4),l.previewData.modeHint?(e.openBlock(),e.createElementBlock("div",Dn,[a[2]||(a[2]=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"12",cy:"12",r:"10"}),e.createElementVNode("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),e.createElementVNode("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})],-1)),e.createTextVNode(" "+e.toDisplayString(l.previewData.modeHint),1)])):e.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-a248a951"]]);function Fe(l,i){const s=()=>typeof i=="string"?i:i.value,d=e.ref(0);let a=null;const N=o=>{if(a&&(a(),a=null),o){const m=o.on;if(typeof m=="function"){const E=m.call(o,"update",()=>{d.value++});a=typeof E=="function"?E:null}}};return e.watch(()=>l.value,o=>{N(o),d.value++},{immediate:!0}),e.onScopeDispose(()=>{a&&(a(),a=null)}),e.computed(()=>{if(d.value,!l.value)return[];const o=s();if(!o)return[];const m=l.value.nodes,E=l.value.edges;if(!m.find(S=>S.id===o))return[];const p=[...E.filter(S=>S.target===o)].sort((S,c)=>{const u=m.find(f=>f.id===S.source),$=m.find(f=>f.id===c.source);return(u?.position.y||0)-($?.position.y||0)}),y=[];for(let S=0;S<p.length;S++){const c=p[S],u=m.find(f=>f.id===c.source);if(!u)continue;if(u.type==="parallel"&&u.data.mergeEnabled===!1&&c.sourceHandle){const g=u.data.branches?.find(b=>b.id===c.sourceHandle);y.push({id:`${u.id}:${c.sourceHandle}`,label:u.data.label||u.id,type:"parallel-branch",parallelParentId:u.id,branchLabel:g?.label||c.sourceHandle,executionIndex:S})}else{const f=In(u,m,E);y.push({id:u.id,label:u.data.label||u.id,type:u.type,parallelParentId:f?.parentId,branchLabel:f?.branchLabel,executionIndex:S})}}const M=[],B=new Set;for(const S of y)if(!B.has(S.id))if(S.parallelParentId){const c=y.filter(b=>b.parallelParentId===S.parallelParentId),u=m.find(b=>b.id===S.parallelParentId),$=u?.data.label||"Parallel Group",f=u?.data?.branches?.map(b=>b.id)||[],g=[...c].sort((b,x)=>{const L=b.id.includes(":")?b.id.split(":")[1]:b.id,A=x.id.includes(":")?x.id.split(":")[1]:x.id,v=f.indexOf(L),O=f.indexOf(A);return(v===-1?1/0:v)-(O===-1?1/0:O)});M.push({type:"parallel",label:$,sources:g}),c.forEach(b=>B.add(b.id))}else M.push({type:"single",sources:[S]}),B.add(S.id);return M})}function In(l,i,s){const d=[l.id],a=new Set;for(;d.length>0;){const N=d.shift();if(a.has(N))continue;a.add(N);const o=i.find(E=>E.id===N);if(!o)continue;if(o.type==="parallel"){const E=s.filter(k=>k.source===o.id),V=o.data;for(const k of E)if(Mn(k.target,l.id,s)){const p=k.sourceHandle,y=V.branches?.find(M=>M.id===p);return{parentId:o.id,branchLabel:y?.label||p||"Unknown Branch"}}}const m=s.filter(E=>E.target===N);for(const E of m)d.push(E.source)}return null}function Mn(l,i,s){if(l===i)return!0;const d=[l],a=new Set;for(;d.length>0;){const N=d.shift();if(a.has(N))continue;if(a.add(N),N===i)return!0;const o=s.filter(m=>m.source===N);for(const m of o)d.push(m.target)}return!1}function Tn(l,i,s){const{getOutput:d}=xe(),a=Fe(l,s),N=e.computed(()=>{const E=e.unref(i),k=e.unref(a).flatMap(c=>c.sources);let p=k;E.sources&&E.sources.length>0&&(p=E.sources.map(c=>k.find(u=>u.id===c)).filter(c=>!!c));const y=new Map;let M=!0;for(const c of p){const u=d(c.id);y.set(c.id,u||null),u||(M=!1)}let B="",S="";if(E.mode==="synthesis"){S="AI will synthesize these inputs into a final document";const c=p.map(u=>{const $=y.get(u.id),f=u.branchLabel||u.label,g=$?$.length>100?$.slice(0,100)+"...":$:"(Waiting for output...)";return`• ${f}: ${g}`});c.length>0?B=`Inputs to AI:
|
|
2
2
|
|
|
3
|
-
`+
|
|
4
|
-
`):
|
|
3
|
+
`+c.join(`
|
|
4
|
+
`):B="(No inputs selected)"}else{const c=[];if(E.introText&&c.push(E.introText),p.length>0)for(const u of p){const $=y.get(u.id);$?c.push($):c.push(`[Output from ${u.branchLabel||u.label} will appear here]`)}else c.push("[No sources selected]");E.outroText&&c.push(E.outroText),B=c.join(`
|
|
5
5
|
|
|
6
|
-
`)}return{assembledPreview:u,isComplete:D,modeHint:P}}),n=e.ref(y.value);let c=null;return e.watch(y,w=>{c&&clearTimeout(c),c=setTimeout(()=>{n.value=w},50)},{immediate:!0}),e.onScopeDispose(()=>{c&&clearTimeout(c)}),e.computed(()=>n.value)}const vn={key:0,class:"node-inspector"},Fn={class:"inspector-header"},jn={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},Un={key:1,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},Wn={key:2,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},Kn={key:3,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},qn=["value"],Gn={key:0,class:"description-section"},Yn=["value"],Xn={key:1,class:"tabs"},Jn={class:"tool-count"},Qn={class:"tool-count"},Zn={key:0,class:"tool-count"},el={key:0,class:"hitl-badge"},tl={key:2,class:"tab-content"},ol={key:0,class:"prompt-tab"},nl={class:"field-group"},ll={class:"mode-buttons"},al={class:"field-hint"},sl={key:0,class:"field-group"},rl=["value"],il={class:"grid loop-grid"},dl={class:"field-group"},cl={class:"field-label"},ml=["value"],pl={class:"field-group"},ul=["value"],fl={class:"field-group",style:{"margin-top":"var(--or3-spacing-md)"}},gl=["value"],hl={class:"field-group",style:{"margin-top":"var(--or3-spacing-lg)"}},Nl={class:"mode-buttons"},El={class:"toggle-group"},kl=["checked"],yl=["checked"],Vl={class:"advanced-section"},wl={class:"advanced-content"},bl={class:"field-group"},Bl=["value"],_l={class:"field-label"},xl=["value","placeholder"],Cl={class:"field-hint"},Sl={key:1,class:"model-tab"},Dl={class:"field-label"},$l=["value"],Il=["value"],Ml={class:"model-id"},Tl={key:2,class:"routes-tab"},Ll={class:"routes-list"},Ol={class:"route-inputs"},Pl=["value","onInput"],Rl={class:"route-id"},zl=["onClick"],Hl={key:3,class:"branches-tab"},Al={class:"branches-list"},vl=["onClick"],Fl={class:"branch-inputs"},jl=["value","onInput"],Ul={class:"branch-badges"},Wl={key:0,class:"branch-badge model"},Kl={class:"branch-actions"},ql=["onClick"],Gl={key:0,class:"branch-config"},Yl={class:"branch-field"},Xl=["value","onChange"],Jl=["value"],Ql={class:"branch-field"},Zl=["value","onInput"],ea={key:0,class:"branch-field"},ta={class:"branch-tools"},oa=["checked","onChange"],na={class:"tool-name-sm"},la={class:"merge-section"},aa={class:"merge-header"},sa={class:"toggle-label"},ra=["checked"],ia={class:"merge-field"},da=["value"],ca=["value"],ma={class:"merge-field"},pa=["value"],ua={key:4,class:"tools-tab"},fa={class:"tools-list"},ga=["checked","onChange"],ha={class:"tool-info"},Na={class:"tool-name"},Ea={class:"tool-description"},ka={key:0,class:"selected-tools"},ya={class:"field-label"},Va={class:"tool-chips"},wa=["onClick"],ba={key:1,class:"tools-empty"},Ba={key:5,class:"errors-tab"},_a={class:"mode-buttons"},xa={class:"retry-grid"},Ca={class:"field-group"},Sa=["value"],Da={class:"field-group"},$a=["value"],Ia={class:"field-group"},Ma=["value"],Ta={class:"checkbox-group"},La={class:"checkboxes"},Oa=["checked","onChange"],Pa={key:6,class:"hitl-tab"},Ra={class:"hitl-toggle"},za={class:"toggle-label"},Ha=["checked"],Aa={class:"hitl-section"},va={class:"mode-buttons"},Fa=["onClick","title"],ja={class:"field-hint"},Ua={class:"hitl-section"},Wa=["value"],Ka={class:"hitl-grid"},qa={class:"field-group"},Ga=["value"],Ya={class:"field-group"},Xa=["value"],Ja=["value"],Qa={key:7,class:"subflow-tab"},Za={class:"field-group"},es=["value","disabled"],ts={value:""},os=["value"],ns={key:0,class:"field-hint"},ls={key:1,class:"field-hint"},as={key:2,class:"field-hint"},ss={key:3,class:"field-hint"},rs={key:4,class:"model-id"},is={key:0,class:"field-group"},ds=["value"],cs={class:"subflow-toggle"},ms={class:"toggle-label"},ps=["checked"],us={key:1,class:"input-mappings-section"},fs={class:"mappings-list"},gs={class:"mapping-key"},hs=["value","onInput"],Ns=["onClick"],Es={key:8,class:"output-tab"},ks={key:0,class:"synthesis-config"},ys={class:"field-group"},Vs=["value"],ws=["value"],bs={class:"field-group"},Bs=["value"],_s={class:"field-group"},xs=["value"],Cs={class:"field-group"},Ss=["value"],Ds={class:"advanced-settings"},$s={key:0,class:"advanced-content"},Is={class:"toggle-group"},Ms={class:"tool-item"},Ts=["checked"],Ls={class:"tool-item"},Os=["checked"],Ps={key:0,class:"field-group"},Rs=["value"],zs={key:3,class:"inspector-content"},Hs={key:1,class:"node-inspector empty"},As=H(e.defineComponent({__name:"NodeInspector",props:{editor:{},availableTools:{},availableSubflows:{},subflowListLoading:{type:Boolean},subflowListError:{}},emits:["delete","close"],setup(l,{emit:r}){function s(o){return typeof o=="object"&&o!==null&&"label"in o&&typeof o.label=="string"}function i(o){return s(o)?Array.isArray(o.tools)?o.tools:[]:[]}const a=l,y=r,n=e.ref(null),c=e.ref("prompt"),w=e.computed(()=>a.availableTools??p),E=e.computed(()=>a.availableSubflows??[]);Y.modelRegistry.size===0&&Y.registerDefaultModels();const V=e.computed(()=>Y.modelRegistry.getAllInfo().map(o=>({id:o.id,name:o.name,provider:o.provider}))),p=[{id:"web_search",name:"Web Search",description:"Search the web for information"},{id:"calculator",name:"Calculator",description:"Perform mathematical calculations"},{id:"code_interpreter",name:"Code Interpreter",description:"Execute Python code"},{id:"file_reader",name:"File Reader",description:"Read file contents"},{id:"api_call",name:"API Call",description:"Make HTTP API requests"},{id:"database_query",name:"Database Query",description:"Query a database"}],k=e.ref([]),D=()=>{var t;const o=a.editor.getSelected().nodes;if(o.length===1){const $=a.editor.getNodes().find(Q=>Q.id===o[0])||null,L=(t=n.value)==null?void 0:t.id;n.value=$,$&&(k.value=i($.data),L!==$.id&&(c.value=$.type==="output"?"output":$.type==="parallel"?"branches":"prompt"))}else n.value=null,k.value=[]};e.watch(()=>{var o;return(o=n.value)==null?void 0:o.data},o=>{o&&(k.value=i(o))},{deep:!0}),e.watchEffect(o=>{if(a.editor.isDestroyed()){n.value=null,k.value=[];return}D();const t=a.editor.on("selectionUpdate",D),$=a.editor.on("update",D);o(()=>{t(),$()})});const u=e.computed(()=>{var o;return((o=n.value)==null?void 0:o.type)==="agent"}),P=e.computed(()=>{var o;return((o=n.value)==null?void 0:o.type)==="router"}),f=e.computed(()=>{var o;return((o=n.value)==null?void 0:o.type)==="parallel"}),b=e.computed(()=>{var o;return((o=n.value)==null?void 0:o.type)==="whileLoop"}),N=e.computed(()=>{var o;return((o=n.value)==null?void 0:o.type)==="start"}),g=e.computed(()=>{var o;return((o=n.value)==null?void 0:o.type)==="subflow"}),d=e.computed(()=>{var o;return((o=n.value)==null?void 0:o.type)==="output"}),_=e.computed(()=>n.value&&n.value.type!=="start"),B=e.computed(()=>u.value||P.value||f.value||b.value||g.value||d.value),M=e.computed(()=>u.value||P.value),O=e.computed(()=>u.value||P.value),A=e.computed(()=>{var t;const o=(t=n.value)==null?void 0:t.data;return s(o)?o:{label:"Unknown"}}),R=e.computed(()=>{var t;return((t=n.value)==null?void 0:t.data)||{}}),X=e.ref(!1),v=e.computed(()=>{var t;const o=(t=n.value)==null?void 0:t.data;return o?Y.migrateOutputNodeData(o):{}}),oe=e.computed(()=>{var o;return((o=n.value)==null?void 0:o.id)||""}),ke=Ye(e.computed(()=>a.editor),oe),ye=An(e.computed(()=>a.editor),v,oe),Ve=o=>{n.value&&a.editor.commands.updateNodeData(n.value.id,{mode:o})},we=o=>{n.value&&a.editor.commands.updateNodeData(n.value.id,{sources:o})},be=o=>{if(!n.value)return;const t=o.target.value;a.editor.commands.updateNodeData(n.value.id,{introText:t})},Be=o=>{if(!n.value)return;const t=o.target.value;a.editor.commands.updateNodeData(n.value.id,{outroText:t})},_e=o=>{if(!n.value)return;const t=o.target.value;a.editor.commands.updateNodeData(n.value.id,{synthesis:{...v.value.synthesis,prompt:t}})},me=o=>{if(!n.value)return;const t=o.target.value;a.editor.commands.updateNodeData(n.value.id,{synthesis:{...v.value.synthesis,model:t}})},pe=()=>{n.value&&a.editor.commands.updateNodeData(n.value.id,{useRawTemplate:!v.value.useRawTemplate})},xe=()=>{n.value&&a.editor.commands.updateNodeData(n.value.id,{includeMetadata:!v.value.includeMetadata})},h=o=>{if(!n.value)return;const t=o.target.value;a.editor.commands.updateNodeData(n.value.id,{template:t})};e.watch(()=>{var o;return{fmt:v.value.format,nodeId:(o=n.value)==null?void 0:o.id}},({fmt:o,nodeId:t})=>{t&&o&&o!=="markdown"&&a.editor.commands.updateNodeData(t,{format:"markdown",schema:void 0})},{immediate:!0});const S=e.computed(()=>{var t;const o=(t=n.value)==null?void 0:t.data;return{subflowId:(o==null?void 0:o.subflowId)??"",inputMappings:(o==null?void 0:o.inputMappings)??{},shareSession:(o==null?void 0:o.shareSession)??!0}}),x=e.computed(()=>{const o=[...E.value],t=S.value.subflowId;return t&&!o.some($=>$.id===t)&&o.unshift({id:t,name:"Custom ID",description:"Not in your workflow list."}),o}),W=e.computed(()=>{const o=S.value.subflowId;return o&&x.value.find(t=>t.id===o)||null}),F=e.ref(!1);e.watch(()=>[S.value.subflowId,E.value.length],([o])=>{o&&(E.value.some(t=>t.id===o)||(F.value=!0))},{immediate:!0});const K=e.computed(()=>{var t;const o=(t=n.value)==null?void 0:t.data;return{routes:Array.isArray(o==null?void 0:o.routes)?o.routes:[]}}),U=e.computed(()=>{var t;const o=(t=n.value)==null?void 0:t.data;return{branches:Array.isArray(o==null?void 0:o.branches)?o.branches:[],mergeModel:(o==null?void 0:o.model)||"",mergePrompt:(o==null?void 0:o.prompt)||"",mergeEnabled:o==null?void 0:o.mergeEnabled}}),ae=()=>{if(!n.value)return;const o=[...U.value.branches],t=`branch-${Date.now()}`;o.push({id:t,label:`Branch ${o.length+1}`}),a.editor.commands.updateNodeData(n.value.id,{branches:o})},Z=o=>{if(!n.value)return;const t=n.value.id,L=a.editor.getEdges().filter(j=>j.source===t&&j.sourceHandle===o);for(const j of L)a.editor.commands.deleteEdge(j.id);const Q=U.value.branches.filter(j=>j.id!==o);a.editor.commands.updateNodeData(t,{branches:Q})},J=(o,t)=>{if(!n.value)return;const $=U.value.branches.map(L=>L.id===o?{...L,label:t}:L);a.editor.commands.updateNodeData(n.value.id,{branches:$})},ue=(o,t)=>{if(!n.value)return;const $=U.value.branches.map(L=>L.id===o?{...L,model:t||void 0}:L);a.editor.commands.updateNodeData(n.value.id,{branches:$})},fe=(o,t)=>{if(!n.value)return;const $=U.value.branches.map(L=>L.id===o?{...L,prompt:t||void 0}:L);a.editor.commands.updateNodeData(n.value.id,{branches:$})},ge=(o,t)=>{if(!n.value)return;const $=U.value.branches.map(L=>L.id===o?{...L,tools:t}:L);a.editor.commands.updateNodeData(n.value.id,{branches:$})},he=(o,t)=>{const $=U.value.branches.find(m=>m.id===o);if(!$)return;const L=$.tools||[],Q=L.indexOf(t);let j;Q===-1?j=[...L,t]:(j=[...L],j.splice(Q,1)),ge(o,j)},ne=e.ref(null),Ne=o=>{ne.value=ne.value===o?null:o},Ee=()=>{if(!n.value)return;const o=[...K.value.routes],t=`route-${Date.now()}`;o.push({id:t,label:`Route ${o.length+1}`}),a.editor.commands.updateNodeData(n.value.id,{routes:o})},C=o=>{if(!n.value)return;const t=n.value.id,L=a.editor.getEdges().filter(j=>j.source===t&&j.sourceHandle===o);for(const j of L)a.editor.commands.deleteEdge(j.id);const Q=K.value.routes.filter(j=>j.id!==o);a.editor.commands.updateNodeData(t,{routes:Q})},q=(o,t)=>{if(!n.value)return;const $=K.value.routes.map(L=>L.id===o?{...L,label:t}:L);a.editor.commands.updateNodeData(n.value.id,{routes:$})},G=e.computed(()=>{var t;const o=(t=n.value)==null?void 0:t.data;return(o==null?void 0:o.errorHandling)??{mode:"stop"}}),se=e.computed(()=>{const o=G.value.retry;return{maxRetries:(o==null?void 0:o.maxRetries)??0,baseDelay:(o==null?void 0:o.baseDelay)??1e3,maxDelay:o==null?void 0:o.maxDelay,retryOn:(o==null?void 0:o.retryOn)??[],skipOn:o==null?void 0:o.skipOn}}),ee=e.computed(()=>{var t;const o=(t=n.value)==null?void 0:t.data;return(o==null?void 0:o.hitl)??{enabled:!1,mode:"approval"}}),Xe=[{id:"approval",label:"Approval",description:"Pause before execution for approve/reject"},{id:"input",label:"Input",description:"Collect human input before execution"},{id:"review",label:"Review",description:"Pause after execution to review output"}],Ir=[{id:"approve",label:"Approve"},{id:"reject",label:"Reject"},{id:"skip",label:"Skip"}],Mr=[{id:"RATE_LIMIT",label:"Rate Limit"},{id:"TIMEOUT",label:"Timeout"},{id:"NETWORK",label:"Network"},{id:"LLM_ERROR",label:"LLM Error"},{id:"VALIDATION",label:"Validation"}];let re=null;const te=(o,t)=>{n.value&&(re&&clearTimeout(re),re=setTimeout(()=>{a.editor.commands.updateNodeData(n.value.id,{[o]:t})},200))},Tr=o=>{te("label",o.target.value)},Lr=o=>{te("description",o.target.value)},Or=o=>{const t=o.target.value;a.editor.commands.updateNodeData(n.value.id,{...b.value?{conditionModel:t}:{model:t}})},Je=o=>{const t=o.target.value,$=b.value?"conditionPrompt":"prompt";te($,t)},Qe=o=>{if(!n.value)return;const t=k.value.indexOf(o);t===-1?k.value.push(o):k.value.splice(t,1),a.editor.commands.updateNodeData(n.value.id,{tools:[...k.value]})},Ze=o=>{if(!n.value)return;const t=G.value;a.editor.commands.updateNodeData(n.value.id,{errorHandling:{...t,...o}})},et=o=>{Ze({retry:{...se.value,...o}})},Ce=o=>{Ze({mode:o})},Pr=o=>{const t=se.value.retryOn||[],$=t.includes(o)?t.filter(L=>L!==o):[...t,o];et({retryOn:$})},Se=(o,t)=>{const $=Number(t.target.value);et({[o]:Number.isFinite($)?$:void 0})},Rr=o=>{const t=Number(o.target.value);te("maxIterations",Number.isFinite(t)?t:1)},zr=o=>{te("onMaxIterations",o.target.value)},Hr=o=>{te("customEvaluator",o.target.value)},tt=o=>{te("loopMode",o.target.value)},ot=o=>{n.value&&a.editor.commands.updateNodeData(n.value.id,{outputMode:o})},Ar=()=>{if(!n.value)return;const o=R.value.includePreviousOutputs!==!1;a.editor.commands.updateNodeData(n.value.id,{includePreviousOutputs:!o})},vr=()=>{if(!n.value)return;const o=R.value.includeIterationContext!==!1;a.editor.commands.updateNodeData(n.value.id,{includeIterationContext:!o})},Fr=o=>{te("loopPrompt",o.target.value)},de=o=>{if(!n.value)return;const t=ee.value;a.editor.commands.updateNodeData(n.value.id,{hitl:{...t,...o}})},jr=()=>{de({enabled:!ee.value.enabled})},Ur=o=>{de({mode:o})},Wr=o=>{if(!n.value)return;const t=o.target.value;re&&clearTimeout(re),re=setTimeout(()=>{de({prompt:t})},200)},Kr=o=>{const t=Number(o.target.value);de({timeout:Number.isFinite(t)&&t>0?t:void 0})},qr=o=>{const t=o.target.value;de({defaultAction:t})},nt=o=>{te("subflowId",o)},Gr=o=>{nt(o.target.value)},Yr=o=>{const t=o.target.value;nt(t),t&&E.value.some($=>$.id===t)&&(F.value=!1)},Xr=()=>{F.value=!F.value},Jr=()=>{n.value&&a.editor.commands.updateNodeData(n.value.id,{shareSession:!S.value.shareSession})},Qr=(o,t)=>{if(!n.value)return;const $=S.value.inputMappings||{};a.editor.commands.updateNodeData(n.value.id,{inputMappings:{...$,[o]:t}})},Zr=o=>{if(!n.value)return;const t={...S.value.inputMappings};delete t[o],a.editor.commands.updateNodeData(n.value.id,{inputMappings:t})},ei=()=>{if(!n.value||!_.value)return;const o=n.value.id,t=A.value.label;confirm(`Delete "${t}"?`)&&(n.value=null,a.editor.commands.deleteNode(o),y("delete",o))};return(o,t)=>{var $,L,Q,j;return n.value?(e.openBlock(),e.createElementBlock("div",vn,[e.createElementVNode("div",Fn,[e.createElementVNode("div",{class:e.normalizeClass(["header-icon",n.value.type])},[u.value?(e.openBlock(),e.createElementBlock("svg",jn,[...t[25]||(t[25]=[e.createElementVNode("rect",{x:"3",y:"11",width:"18",height:"10",rx:"2"},null,-1),e.createElementVNode("circle",{cx:"12",cy:"5",r:"2"},null,-1),e.createElementVNode("path",{d:"M12 7v4"},null,-1)])])):P.value?(e.openBlock(),e.createElementBlock("svg",Un,[...t[26]||(t[26]=[e.createElementVNode("line",{x1:"6",y1:"3",x2:"6",y2:"15"},null,-1),e.createElementVNode("circle",{cx:"18",cy:"6",r:"3"},null,-1),e.createElementVNode("circle",{cx:"6",cy:"18",r:"3"},null,-1),e.createElementVNode("path",{d:"M18 9a9 9 0 0 1-9 9"},null,-1)])])):f.value?(e.openBlock(),e.createElementBlock("svg",Wn,[...t[27]||(t[27]=[e.createElementVNode("circle",{cx:"18",cy:"18",r:"3"},null,-1),e.createElementVNode("circle",{cx:"6",cy:"6",r:"3"},null,-1),e.createElementVNode("path",{d:"M6 21V9a9 9 0 0 0 9 9"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",Kn,[...t[28]||(t[28]=[e.createElementVNode("polygon",{points:"5 3 19 12 5 21 5 3"},null,-1)])]))],2),e.createElementVNode("input",{class:"label-input",value:A.value.label,onInput:Tr,placeholder:"Node name"},null,40,qn),_.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"delete-btn",onClick:ei,title:"Delete node"},[...t[29]||(t[29]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"3 6 5 6 21 6"}),e.createElementVNode("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"close-btn",onClick:t[0]||(t[0]=m=>y("close")),title:"Close inspector"},[...t[30]||(t[30]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])])]),B.value?(e.openBlock(),e.createElementBlock("div",Gn,[t[31]||(t[31]=e.createStaticVNode('<label class="description-label" data-v-2de5c749><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-2de5c749><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" data-v-2de5c749></path><polyline points="14 2 14 8 20 8" data-v-2de5c749></polyline><line x1="16" y1="13" x2="8" y2="13" data-v-2de5c749></line><line x1="16" y1="17" x2="8" y2="17" data-v-2de5c749></line><polyline points="10 9 9 9 8 9" data-v-2de5c749></polyline></svg> Description <span class="description-hint" data-v-2de5c749>(used by router for decisions)</span></label>',1)),e.createElementVNode("textarea",{class:"description-textarea",value:A.value.description||"",placeholder:"Describe what this node does... e.g., 'Handles complex math problems and coding questions'",onInput:Lr},null,40,Yn)])):e.createCommentVNode("",!0),B.value||M.value?(e.openBlock(),e.createElementBlock("div",Xn,[B.value&&!d.value&&!f.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["tab",{active:c.value==="prompt"}]),onClick:t[1]||(t[1]=m=>c.value="prompt")},[t[32]||(t[32]=e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("rect",{x:"3",y:"11",width:"18",height:"10",rx:"2"}),e.createElementVNode("circle",{cx:"12",cy:"5",r:"2"}),e.createElementVNode("path",{d:"M12 7v4"})],-1)),e.createTextVNode(" "+e.toDisplayString(P.value?"Instructions":b.value?"Condition":"Instructions"),1)],2)):e.createCommentVNode("",!0),B.value&&!d.value&&!f.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:e.normalizeClass(["tab",{active:c.value==="model"}]),onClick:t[2]||(t[2]=m=>c.value="model")},[...t[33]||(t[33]=[e.createStaticVNode('<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-2de5c749><rect x="4" y="4" width="16" height="16" rx="2" ry="2" data-v-2de5c749></rect><rect x="9" y="9" width="6" height="6" data-v-2de5c749></rect><line x1="9" y1="1" x2="9" y2="4" data-v-2de5c749></line><line x1="15" y1="1" x2="15" y2="4" data-v-2de5c749></line><line x1="9" y1="20" x2="9" y2="23" data-v-2de5c749></line><line x1="15" y1="20" x2="15" y2="23" data-v-2de5c749></line><line x1="20" y1="9" x2="23" y2="9" data-v-2de5c749></line><line x1="20" y1="14" x2="23" y2="14" data-v-2de5c749></line><line x1="1" y1="9" x2="4" y2="9" data-v-2de5c749></line><line x1="1" y1="14" x2="4" y2="14" data-v-2de5c749></line></svg> Model ',2)])],2)):e.createCommentVNode("",!0),P.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:e.normalizeClass(["tab",{active:c.value==="routes"}]),onClick:t[3]||(t[3]=m=>c.value="routes")},[t[34]||(t[34]=e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{d:"M9 18l6-6-6-6"})],-1)),t[35]||(t[35]=e.createTextVNode(" Routes ",-1)),e.createElementVNode("span",Jn,e.toDisplayString(K.value.routes.length),1)],2)):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createElementBlock("button",{key:3,class:e.normalizeClass(["tab",{active:c.value==="branches"}]),onClick:t[4]||(t[4]=m=>c.value="branches")},[t[36]||(t[36]=e.createStaticVNode('<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-2de5c749><circle cx="18" cy="18" r="3" data-v-2de5c749></circle><circle cx="6" cy="6" r="3" data-v-2de5c749></circle><circle cx="18" cy="6" r="3" data-v-2de5c749></circle><path d="M6 9v12" data-v-2de5c749></path><path d="M18 9v6" data-v-2de5c749></path></svg> Branches ',2)),e.createElementVNode("span",Qn,e.toDisplayString(U.value.branches.length),1)],2)):e.createCommentVNode("",!0),u.value?(e.openBlock(),e.createElementBlock("button",{key:4,class:e.normalizeClass(["tab",{active:c.value==="tools"}]),onClick:t[5]||(t[5]=m=>c.value="tools")},[t[37]||(t[37]=e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"})],-1)),t[38]||(t[38]=e.createTextVNode(" Tools ",-1)),k.value.length?(e.openBlock(),e.createElementBlock("span",Zn,e.toDisplayString(k.value.length),1)):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),M.value?(e.openBlock(),e.createElementBlock("button",{key:5,class:e.normalizeClass(["tab",{active:c.value==="errors"}]),onClick:t[6]||(t[6]=m=>c.value="errors")},[...t[39]||(t[39]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),e.createElementVNode("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),e.createElementVNode("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})],-1),e.createTextVNode(" Errors ",-1)])],2)):e.createCommentVNode("",!0),O.value?(e.openBlock(),e.createElementBlock("button",{key:6,class:e.normalizeClass(["tab",{active:c.value==="hitl"}]),onClick:t[7]||(t[7]=m=>c.value="hitl")},[t[40]||(t[40]=e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),e.createElementVNode("circle",{cx:"12",cy:"7",r:"4"})],-1)),t[41]||(t[41]=e.createTextVNode(" HITL ",-1)),ee.value.enabled?(e.openBlock(),e.createElementBlock("span",el,"ON")):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),g.value?(e.openBlock(),e.createElementBlock("button",{key:7,class:e.normalizeClass(["tab",{active:c.value==="subflow"}]),onClick:t[8]||(t[8]=m=>c.value="subflow")},[...t[42]||(t[42]=[e.createStaticVNode('<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-2de5c749><rect x="3" y="3" width="7" height="7" rx="1" data-v-2de5c749></rect><rect x="14" y="3" width="7" height="7" rx="1" data-v-2de5c749></rect><rect x="8.5" y="14" width="7" height="7" rx="1" data-v-2de5c749></rect><path d="M6.5 10v2a2 2 0 002 2h1" data-v-2de5c749></path><path d="M17.5 10v2a2 2 0 01-2 2h-1" data-v-2de5c749></path></svg> Subflow ',2)])],2)):e.createCommentVNode("",!0),d.value?(e.openBlock(),e.createElementBlock("button",{key:8,class:e.normalizeClass(["tab",{active:c.value==="output"}]),onClick:t[9]||(t[9]=m=>c.value="output")},[...t[43]||(t[43]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{d:"M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z"}),e.createElementVNode("line",{x1:"4",y1:"22",x2:"4",y2:"15"})],-1),e.createTextVNode(" Output ",-1)])],2)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),B.value||M.value||O.value||g.value||d.value?(e.openBlock(),e.createElementBlock("div",tl,[c.value==="prompt"&&B.value&&!d.value&&!f.value?(e.openBlock(),e.createElementBlock("div",ol,[b.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",nl,[t[44]||(t[44]=e.createElementVNode("label",{class:"field-label"},"Loop Strategy",-1)),e.createElementVNode("div",ll,[e.createElementVNode("button",{class:e.normalizeClass(["mode-button",{active:R.value.loopMode!=="fixed"}]),onClick:t[10]||(t[10]=m=>tt({target:{value:"while"}}))}," Smart Loop (AI) ",2),e.createElementVNode("button",{class:e.normalizeClass(["mode-button",{active:R.value.loopMode==="fixed"}]),onClick:t[11]||(t[11]=m=>tt({target:{value:"fixed"}}))}," Fixed Count ",2)]),e.createElementVNode("p",al,e.toDisplayString(R.value.loopMode==="fixed"?"Runs exactly N times. Good for batch processing.":"AI evaluates results to decide when to stop."),1)]),R.value.loopMode!=="fixed"?(e.openBlock(),e.createElementBlock("div",sl,[t[45]||(t[45]=e.createElementVNode("label",{class:"field-label"},"Stop Condition",-1)),e.createElementVNode("textarea",{value:R.value.conditionPrompt||"",class:"prompt-textarea condition-prompt",placeholder:'Example: "If the summary is concise and covers all points, respond DONE. Otherwise respond CONTINUE."',onInput:Je,rows:"4"},null,40,rl)])):e.createCommentVNode("",!0),e.createElementVNode("div",il,[e.createElementVNode("div",dl,[e.createElementVNode("label",cl,e.toDisplayString(R.value.loopMode==="fixed"?"Run Count":"Max Limit"),1),e.createElementVNode("input",{type:"number",min:"1",class:"text-input",value:R.value.maxIterations??10,onInput:Rr},null,40,ml)]),e.createElementVNode("div",pl,[t[47]||(t[47]=e.createElementVNode("label",{class:"field-label"},"On Limit Reached",-1)),e.createElementVNode("select",{class:"model-select",value:R.value.onMaxIterations||"warning",onChange:zr},[...t[46]||(t[46]=[e.createElementVNode("option",{value:"warning"}," Warn & Continue ",-1),e.createElementVNode("option",{value:"continue"}," Silent Continue ",-1),e.createElementVNode("option",{value:"error"},"Stop with Error",-1)])],40,ul)])]),e.createElementVNode("div",fl,[t[48]||(t[48]=e.createElementVNode("label",{class:"field-label"},"Loop Instructions",-1)),e.createElementVNode("textarea",{value:R.value.loopPrompt||"",class:"prompt-textarea loop-prompt",placeholder:`Tell the AI what to do each time.
|
|
6
|
+
`)}return{assembledPreview:B,isComplete:M,modeHint:S}}),o=e.ref(N.value);let m=null;return e.watch(N,E=>{m&&clearTimeout(m),m=setTimeout(()=>{o.value=E},50)},{immediate:!0}),e.onScopeDispose(()=>{m&&clearTimeout(m)}),e.computed(()=>o.value)}const Ln={key:0,class:"node-inspector"},On={class:"inspector-header"},Pn={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},Rn={key:1,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},zn={key:2,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},Hn={key:3,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},An=["value"],vn={key:0,class:"description-section"},Fn=["value"],jn={key:1,class:"tabs"},Un={class:"tool-count"},Wn={class:"tool-count"},Kn={key:0,class:"tool-count"},qn={key:0,class:"hitl-badge"},Gn={key:2,class:"tab-content"},Yn={key:0,class:"prompt-tab"},Xn={class:"field-group"},Jn={class:"mode-buttons"},Qn={class:"field-hint"},Zn={key:0,class:"field-group"},el=["value"],tl={class:"grid loop-grid"},ol={class:"field-group"},nl={class:"field-label"},ll=["value"],al={class:"field-group"},sl=["value"],rl={class:"field-group",style:{"margin-top":"var(--or3-spacing-md)"}},il=["value"],dl={class:"field-group",style:{"margin-top":"var(--or3-spacing-lg)"}},cl={class:"mode-buttons"},ml={class:"toggle-group"},pl=["checked"],ul=["checked"],fl={class:"advanced-section"},gl={class:"advanced-content"},hl={class:"field-group"},kl=["value"],Nl={class:"field-label"},El=["value","placeholder"],yl={class:"field-hint"},Vl={key:1,class:"model-tab"},bl={class:"field-label"},wl=["value"],xl=["value"],Bl={class:"model-id"},_l={key:2,class:"routes-tab"},Cl={class:"routes-list"},Sl={class:"route-inputs"},Dl=["value","onInput"],$l={class:"route-id"},Il=["onClick"],Ml={key:3,class:"branches-tab"},Tl={class:"branches-list"},Ll=["onClick"],Ol={class:"branch-inputs"},Pl=["value","onInput"],Rl={class:"branch-badges"},zl={key:0,class:"branch-badge model"},Hl={class:"branch-actions"},Al=["onClick"],vl={key:0,class:"branch-config"},Fl={class:"branch-field"},jl=["value","onChange"],Ul=["value"],Wl={class:"branch-field"},Kl=["value","onInput"],ql={key:0,class:"branch-field"},Gl={class:"branch-tools"},Yl=["checked","onChange"],Xl={class:"tool-name-sm"},Jl={class:"merge-section"},Ql={class:"merge-header"},Zl={class:"toggle-label"},ea=["checked"],ta={class:"merge-field"},oa=["value"],na=["value"],la={class:"merge-field"},aa=["value"],sa={key:4,class:"tools-tab"},ra={class:"tools-list"},ia=["checked","onChange"],da={class:"tool-info"},ca={class:"tool-name"},ma={class:"tool-description"},pa={key:0,class:"selected-tools"},ua={class:"field-label"},fa={class:"tool-chips"},ga=["onClick"],ha={key:1,class:"tools-empty"},ka={key:5,class:"errors-tab"},Na={class:"mode-buttons"},Ea={class:"retry-grid"},ya={class:"field-group"},Va=["value"],ba={class:"field-group"},wa=["value"],xa={class:"field-group"},Ba=["value"],_a={class:"checkbox-group"},Ca={class:"checkboxes"},Sa=["checked","onChange"],Da={key:6,class:"hitl-tab"},$a={class:"hitl-toggle"},Ia={class:"toggle-label"},Ma=["checked"],Ta={class:"hitl-section"},La={class:"mode-buttons"},Oa=["onClick","title"],Pa={class:"field-hint"},Ra={class:"hitl-section"},za=["value"],Ha={class:"hitl-grid"},Aa={class:"field-group"},va=["value"],Fa={class:"field-group"},ja=["value"],Ua=["value"],Wa={key:7,class:"subflow-tab"},Ka={class:"field-group"},qa=["value","disabled"],Ga={value:""},Ya=["value"],Xa={key:0,class:"field-hint"},Ja={key:1,class:"field-hint"},Qa={key:2,class:"field-hint"},Za={key:3,class:"field-hint"},es={key:4,class:"model-id"},ts={key:0,class:"field-group"},os=["value"],ns={class:"subflow-toggle"},ls={class:"toggle-label"},as=["checked"],ss={key:1,class:"input-mappings-section"},rs={class:"mappings-list"},is={class:"mapping-key"},ds=["value","onInput"],cs=["onClick"],ms={key:8,class:"output-tab"},ps={key:0,class:"synthesis-config"},us={class:"field-group"},fs=["value"],gs=["value"],hs={class:"field-group"},ks=["value"],Ns={class:"field-group"},Es=["value"],ys={class:"field-group"},Vs=["value"],bs={class:"advanced-settings"},ws={key:0,class:"advanced-content"},xs={class:"toggle-group"},Bs={class:"tool-item"},_s=["checked"],Cs={class:"tool-item"},Ss=["checked"],Ds={key:0,class:"field-group"},$s=["value"],Is={key:3,class:"inspector-content"},Ms={key:1,class:"node-inspector empty"},Ts=P(e.defineComponent({__name:"NodeInspector",props:{editor:{},availableTools:{},availableSubflows:{},subflowListLoading:{type:Boolean},subflowListError:{}},emits:["delete","close"],setup(l,{emit:i}){function s(n){return typeof n=="object"&&n!==null&&"label"in n&&typeof n.label=="string"}function d(n){return s(n)?Array.isArray(n.tools)?n.tools:[]:[]}const a=l,N=i,o=e.ref(null),m=e.ref("prompt"),E=e.computed(()=>a.availableTools??p),V=e.computed(()=>a.availableSubflows??[]);W.modelRegistry.size===0&&W.registerDefaultModels();const k=e.computed(()=>W.modelRegistry.getAllInfo().map(n=>({id:n.id,name:n.name,provider:n.provider}))),p=[{id:"web_search",name:"Web Search",description:"Search the web for information"},{id:"calculator",name:"Calculator",description:"Perform mathematical calculations"},{id:"code_interpreter",name:"Code Interpreter",description:"Execute Python code"},{id:"file_reader",name:"File Reader",description:"Read file contents"},{id:"api_call",name:"API Call",description:"Make HTTP API requests"},{id:"database_query",name:"Database Query",description:"Query a database"}],y=e.ref([]),M=()=>{const n=a.editor.getSelected().nodes;if(n.length===1){const t=a.editor.getNodes().find(w=>w.id===n[0])||null,r=o.value?.id;o.value=t,t&&(y.value=d(t.data),r!==t.id&&(m.value=t.type==="output"?"output":t.type==="parallel"?"branches":"prompt"))}else o.value=null,y.value=[]};e.watch(()=>o.value?.data,n=>{n&&(y.value=d(n))},{deep:!0}),e.watchEffect(n=>{if(a.editor.isDestroyed()){o.value=null,y.value=[];return}M();const t=a.editor.on("selectionUpdate",M),r=a.editor.on("update",M);n(()=>{t(),r()})});const B=e.computed(()=>o.value?.type==="agent"),S=e.computed(()=>o.value?.type==="router"),c=e.computed(()=>o.value?.type==="parallel"),u=e.computed(()=>o.value?.type==="whileLoop"),$=e.computed(()=>o.value?.type==="start"),f=e.computed(()=>o.value?.type==="subflow"),g=e.computed(()=>o.value?.type==="output"),b=e.computed(()=>o.value&&o.value.type!=="start"),x=e.computed(()=>B.value||S.value||c.value||u.value||f.value||g.value),L=e.computed(()=>B.value||S.value),A=e.computed(()=>B.value||S.value),v=e.computed(()=>{const n=o.value?.data;return s(n)?n:{label:"Unknown"}}),O=e.computed(()=>o.value?.data||{}),Q=e.ref(!1),z=e.computed(()=>{const n=o.value?.data;return n?W.migrateOutputNodeData(n):{}}),te=e.computed(()=>o.value?.id||""),pe=Fe(e.computed(()=>a.editor),te),ue=Tn(e.computed(()=>a.editor),z,te),fe=n=>{o.value&&a.editor.commands.updateNodeData(o.value.id,{mode:n})},ge=n=>{o.value&&a.editor.commands.updateNodeData(o.value.id,{sources:n})},he=n=>{if(!o.value)return;const t=n.target.value;a.editor.commands.updateNodeData(o.value.id,{introText:t})},ke=n=>{if(!o.value)return;const t=n.target.value;a.editor.commands.updateNodeData(o.value.id,{outroText:t})},Ne=n=>{if(!o.value)return;const t=n.target.value;a.editor.commands.updateNodeData(o.value.id,{synthesis:{...z.value.synthesis,prompt:t}})},ie=n=>{if(!o.value)return;const t=n.target.value;a.editor.commands.updateNodeData(o.value.id,{synthesis:{...z.value.synthesis,model:t}})},de=()=>{o.value&&a.editor.commands.updateNodeData(o.value.id,{useRawTemplate:!z.value.useRawTemplate})},Ee=()=>{o.value&&a.editor.commands.updateNodeData(o.value.id,{includeMetadata:!z.value.includeMetadata})},h=n=>{if(!o.value)return;const t=n.target.value;a.editor.commands.updateNodeData(o.value.id,{template:t})};e.watch(()=>({fmt:z.value.format,nodeId:o.value?.id}),({fmt:n,nodeId:t})=>{t&&n&&n!=="markdown"&&a.editor.commands.updateNodeData(t,{format:"markdown",schema:void 0})},{immediate:!0});const D=e.computed(()=>{const n=o.value?.data;return{subflowId:n?.subflowId??"",inputMappings:n?.inputMappings??{},shareSession:n?.shareSession??!0}}),_=e.computed(()=>{const n=[...V.value],t=D.value.subflowId;return t&&!n.some(r=>r.id===t)&&n.unshift({id:t,name:"Custom ID",description:"Not in your workflow list."}),n}),j=e.computed(()=>{const n=D.value.subflowId;return n&&_.value.find(t=>t.id===n)||null}),R=e.ref(!1);e.watch(()=>[D.value.subflowId,V.value.length],([n])=>{n&&(V.value.some(t=>t.id===n)||(R.value=!0))},{immediate:!0});const U=e.computed(()=>{const n=o.value?.data;return{routes:Array.isArray(n?.routes)?n.routes:[]}}),H=e.computed(()=>{const n=o.value?.data;return{branches:Array.isArray(n?.branches)?n.branches:[],mergeModel:n?.model||"",mergePrompt:n?.prompt||"",mergeEnabled:n?.mergeEnabled}}),K=()=>{if(!o.value)return;const n=[...H.value.branches],t=`branch-${Date.now()}`;n.push({id:t,label:`Branch ${n.length+1}`}),a.editor.commands.updateNodeData(o.value.id,{branches:n})},Z=n=>{if(!o.value)return;const t=o.value.id,w=a.editor.getEdges().filter(F=>F.source===t&&F.sourceHandle===n);for(const F of w)a.editor.commands.deleteEdge(F.id);const Y=H.value.branches.filter(F=>F.id!==n);a.editor.commands.updateNodeData(t,{branches:Y})},ce=(n,t)=>{if(!o.value)return;const r=H.value.branches.map(w=>w.id===n?{...w,label:t}:w);a.editor.commands.updateNodeData(o.value.id,{branches:r})},me=(n,t)=>{if(!o.value)return;const r=H.value.branches.map(w=>w.id===n?{...w,model:t||void 0}:w);a.editor.commands.updateNodeData(o.value.id,{branches:r})},C=(n,t)=>{if(!o.value)return;const r=H.value.branches.map(w=>w.id===n?{...w,prompt:t||void 0}:w);a.editor.commands.updateNodeData(o.value.id,{branches:r})},X=(n,t)=>{if(!o.value)return;const r=H.value.branches.map(w=>w.id===n?{...w,tools:t}:w);a.editor.commands.updateNodeData(o.value.id,{branches:r})},ee=(n,t)=>{const r=H.value.branches.find(Qr=>Qr.id===n);if(!r)return;const w=r.tools||[],Y=w.indexOf(t);let F;Y===-1?F=[...w,t]:(F=[...w],F.splice(Y,1)),X(n,F)},le=e.ref(null),xr=n=>{le.value=le.value===n?null:n},Br=()=>{if(!o.value)return;const n=[...U.value.routes],t=`route-${Date.now()}`;n.push({id:t,label:`Route ${n.length+1}`}),a.editor.commands.updateNodeData(o.value.id,{routes:n})},_r=n=>{if(!o.value)return;const t=o.value.id,w=a.editor.getEdges().filter(F=>F.source===t&&F.sourceHandle===n);for(const F of w)a.editor.commands.deleteEdge(F.id);const Y=U.value.routes.filter(F=>F.id!==n);a.editor.commands.updateNodeData(t,{routes:Y})},Cr=(n,t)=>{if(!o.value)return;const r=U.value.routes.map(w=>w.id===n?{...w,label:t}:w);a.editor.commands.updateNodeData(o.value.id,{routes:r})},ae=e.computed(()=>o.value?.data?.errorHandling??{mode:"stop"}),oe=e.computed(()=>{const n=ae.value.retry;return{maxRetries:n?.maxRetries??0,baseDelay:n?.baseDelay??1e3,maxDelay:n?.maxDelay,retryOn:n?.retryOn??[],skipOn:n?.skipOn}}),q=e.computed(()=>o.value?.data?.hitl??{enabled:!1,mode:"approval"}),je=[{id:"approval",label:"Approval",description:"Pause before execution for approve/reject"},{id:"input",label:"Input",description:"Collect human input before execution"},{id:"review",label:"Review",description:"Pause after execution to review output"}],Sr=[{id:"approve",label:"Approve"},{id:"reject",label:"Reject"},{id:"skip",label:"Skip"}],Dr=[{id:"RATE_LIMIT",label:"Rate Limit"},{id:"TIMEOUT",label:"Timeout"},{id:"NETWORK",label:"Network"},{id:"LLM_ERROR",label:"LLM Error"},{id:"VALIDATION",label:"Validation"}];let ne=null;const G=(n,t)=>{o.value&&(ne&&clearTimeout(ne),ne=setTimeout(()=>{a.editor.commands.updateNodeData(o.value.id,{[n]:t})},200))},$r=n=>{G("label",n.target.value)},Ir=n=>{G("description",n.target.value)},Mr=n=>{const t=n.target.value;a.editor.commands.updateNodeData(o.value.id,{...u.value?{conditionModel:t}:{model:t}})},Ue=n=>{const t=n.target.value,r=u.value?"conditionPrompt":"prompt";G(r,t)},We=n=>{if(!o.value)return;const t=y.value.indexOf(n);t===-1?y.value.push(n):y.value.splice(t,1),a.editor.commands.updateNodeData(o.value.id,{tools:[...y.value]})},Ke=n=>{if(!o.value)return;const t=ae.value;a.editor.commands.updateNodeData(o.value.id,{errorHandling:{...t,...n}})},qe=n=>{Ke({retry:{...oe.value,...n}})},ye=n=>{Ke({mode:n})},Tr=n=>{const t=oe.value.retryOn||[],r=t.includes(n)?t.filter(w=>w!==n):[...t,n];qe({retryOn:r})},Ve=(n,t)=>{const r=Number(t.target.value);qe({[n]:Number.isFinite(r)?r:void 0})},Lr=n=>{const t=Number(n.target.value);G("maxIterations",Number.isFinite(t)?t:1)},Or=n=>{G("onMaxIterations",n.target.value)},Pr=n=>{G("customEvaluator",n.target.value)},Ge=n=>{G("loopMode",n.target.value)},Ye=n=>{o.value&&a.editor.commands.updateNodeData(o.value.id,{outputMode:n})},Rr=()=>{if(!o.value)return;const n=O.value.includePreviousOutputs!==!1;a.editor.commands.updateNodeData(o.value.id,{includePreviousOutputs:!n})},zr=()=>{if(!o.value)return;const n=O.value.includeIterationContext!==!1;a.editor.commands.updateNodeData(o.value.id,{includeIterationContext:!n})},Hr=n=>{G("loopPrompt",n.target.value)},se=n=>{if(!o.value)return;const t=q.value;a.editor.commands.updateNodeData(o.value.id,{hitl:{...t,...n}})},Ar=()=>{se({enabled:!q.value.enabled})},vr=n=>{se({mode:n})},Fr=n=>{if(!o.value)return;const t=n.target.value;ne&&clearTimeout(ne),ne=setTimeout(()=>{se({prompt:t})},200)},jr=n=>{const t=Number(n.target.value);se({timeout:Number.isFinite(t)&&t>0?t:void 0})},Ur=n=>{const t=n.target.value;se({defaultAction:t})},Xe=n=>{G("subflowId",n)},Wr=n=>{Xe(n.target.value)},Kr=n=>{const t=n.target.value;Xe(t),t&&V.value.some(r=>r.id===t)&&(R.value=!1)},qr=()=>{R.value=!R.value},Gr=()=>{o.value&&a.editor.commands.updateNodeData(o.value.id,{shareSession:!D.value.shareSession})},Yr=(n,t)=>{if(!o.value)return;const r=D.value.inputMappings||{};a.editor.commands.updateNodeData(o.value.id,{inputMappings:{...r,[n]:t}})},Xr=n=>{if(!o.value)return;const t={...D.value.inputMappings};delete t[n],a.editor.commands.updateNodeData(o.value.id,{inputMappings:t})},Jr=()=>{if(!o.value||!b.value)return;const n=o.value.id,t=v.value.label;confirm(`Delete "${t}"?`)&&(o.value=null,a.editor.commands.deleteNode(n),N("delete",n))};return(n,t)=>o.value?(e.openBlock(),e.createElementBlock("div",Ln,[e.createElementVNode("div",On,[e.createElementVNode("div",{class:e.normalizeClass(["header-icon",o.value.type])},[B.value?(e.openBlock(),e.createElementBlock("svg",Pn,[...t[25]||(t[25]=[e.createElementVNode("rect",{x:"3",y:"11",width:"18",height:"10",rx:"2"},null,-1),e.createElementVNode("circle",{cx:"12",cy:"5",r:"2"},null,-1),e.createElementVNode("path",{d:"M12 7v4"},null,-1)])])):S.value?(e.openBlock(),e.createElementBlock("svg",Rn,[...t[26]||(t[26]=[e.createElementVNode("line",{x1:"6",y1:"3",x2:"6",y2:"15"},null,-1),e.createElementVNode("circle",{cx:"18",cy:"6",r:"3"},null,-1),e.createElementVNode("circle",{cx:"6",cy:"18",r:"3"},null,-1),e.createElementVNode("path",{d:"M18 9a9 9 0 0 1-9 9"},null,-1)])])):c.value?(e.openBlock(),e.createElementBlock("svg",zn,[...t[27]||(t[27]=[e.createElementVNode("circle",{cx:"18",cy:"18",r:"3"},null,-1),e.createElementVNode("circle",{cx:"6",cy:"6",r:"3"},null,-1),e.createElementVNode("path",{d:"M6 21V9a9 9 0 0 0 9 9"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",Hn,[...t[28]||(t[28]=[e.createElementVNode("polygon",{points:"5 3 19 12 5 21 5 3"},null,-1)])]))],2),e.createElementVNode("input",{class:"label-input",value:v.value.label,onInput:$r,placeholder:"Node name"},null,40,An),b.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"delete-btn",onClick:Jr,title:"Delete node"},[...t[29]||(t[29]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"3 6 5 6 21 6"}),e.createElementVNode("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"close-btn",onClick:t[0]||(t[0]=r=>N("close")),title:"Close inspector"},[...t[30]||(t[30]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])])]),x.value?(e.openBlock(),e.createElementBlock("div",vn,[t[31]||(t[31]=e.createStaticVNode('<label class="description-label" data-v-2de5c749><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-2de5c749><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" data-v-2de5c749></path><polyline points="14 2 14 8 20 8" data-v-2de5c749></polyline><line x1="16" y1="13" x2="8" y2="13" data-v-2de5c749></line><line x1="16" y1="17" x2="8" y2="17" data-v-2de5c749></line><polyline points="10 9 9 9 8 9" data-v-2de5c749></polyline></svg> Description <span class="description-hint" data-v-2de5c749>(used by router for decisions)</span></label>',1)),e.createElementVNode("textarea",{class:"description-textarea",value:v.value.description||"",placeholder:"Describe what this node does... e.g., 'Handles complex math problems and coding questions'",onInput:Ir},null,40,Fn)])):e.createCommentVNode("",!0),x.value||L.value?(e.openBlock(),e.createElementBlock("div",jn,[x.value&&!g.value&&!c.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["tab",{active:m.value==="prompt"}]),onClick:t[1]||(t[1]=r=>m.value="prompt")},[t[32]||(t[32]=e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("rect",{x:"3",y:"11",width:"18",height:"10",rx:"2"}),e.createElementVNode("circle",{cx:"12",cy:"5",r:"2"}),e.createElementVNode("path",{d:"M12 7v4"})],-1)),e.createTextVNode(" "+e.toDisplayString(S.value?"Instructions":u.value?"Condition":"Instructions"),1)],2)):e.createCommentVNode("",!0),x.value&&!g.value&&!c.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:e.normalizeClass(["tab",{active:m.value==="model"}]),onClick:t[2]||(t[2]=r=>m.value="model")},[...t[33]||(t[33]=[e.createStaticVNode('<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-2de5c749><rect x="4" y="4" width="16" height="16" rx="2" ry="2" data-v-2de5c749></rect><rect x="9" y="9" width="6" height="6" data-v-2de5c749></rect><line x1="9" y1="1" x2="9" y2="4" data-v-2de5c749></line><line x1="15" y1="1" x2="15" y2="4" data-v-2de5c749></line><line x1="9" y1="20" x2="9" y2="23" data-v-2de5c749></line><line x1="15" y1="20" x2="15" y2="23" data-v-2de5c749></line><line x1="20" y1="9" x2="23" y2="9" data-v-2de5c749></line><line x1="20" y1="14" x2="23" y2="14" data-v-2de5c749></line><line x1="1" y1="9" x2="4" y2="9" data-v-2de5c749></line><line x1="1" y1="14" x2="4" y2="14" data-v-2de5c749></line></svg> Model ',2)])],2)):e.createCommentVNode("",!0),S.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:e.normalizeClass(["tab",{active:m.value==="routes"}]),onClick:t[3]||(t[3]=r=>m.value="routes")},[t[34]||(t[34]=e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{d:"M9 18l6-6-6-6"})],-1)),t[35]||(t[35]=e.createTextVNode(" Routes ",-1)),e.createElementVNode("span",Un,e.toDisplayString(U.value.routes.length),1)],2)):e.createCommentVNode("",!0),c.value?(e.openBlock(),e.createElementBlock("button",{key:3,class:e.normalizeClass(["tab",{active:m.value==="branches"}]),onClick:t[4]||(t[4]=r=>m.value="branches")},[t[36]||(t[36]=e.createStaticVNode('<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-2de5c749><circle cx="18" cy="18" r="3" data-v-2de5c749></circle><circle cx="6" cy="6" r="3" data-v-2de5c749></circle><circle cx="18" cy="6" r="3" data-v-2de5c749></circle><path d="M6 9v12" data-v-2de5c749></path><path d="M18 9v6" data-v-2de5c749></path></svg> Branches ',2)),e.createElementVNode("span",Wn,e.toDisplayString(H.value.branches.length),1)],2)):e.createCommentVNode("",!0),B.value?(e.openBlock(),e.createElementBlock("button",{key:4,class:e.normalizeClass(["tab",{active:m.value==="tools"}]),onClick:t[5]||(t[5]=r=>m.value="tools")},[t[37]||(t[37]=e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"})],-1)),t[38]||(t[38]=e.createTextVNode(" Tools ",-1)),y.value.length?(e.openBlock(),e.createElementBlock("span",Kn,e.toDisplayString(y.value.length),1)):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),L.value?(e.openBlock(),e.createElementBlock("button",{key:5,class:e.normalizeClass(["tab",{active:m.value==="errors"}]),onClick:t[6]||(t[6]=r=>m.value="errors")},[...t[39]||(t[39]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),e.createElementVNode("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),e.createElementVNode("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})],-1),e.createTextVNode(" Errors ",-1)])],2)):e.createCommentVNode("",!0),A.value?(e.openBlock(),e.createElementBlock("button",{key:6,class:e.normalizeClass(["tab",{active:m.value==="hitl"}]),onClick:t[7]||(t[7]=r=>m.value="hitl")},[t[40]||(t[40]=e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),e.createElementVNode("circle",{cx:"12",cy:"7",r:"4"})],-1)),t[41]||(t[41]=e.createTextVNode(" HITL ",-1)),q.value.enabled?(e.openBlock(),e.createElementBlock("span",qn,"ON")):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createElementBlock("button",{key:7,class:e.normalizeClass(["tab",{active:m.value==="subflow"}]),onClick:t[8]||(t[8]=r=>m.value="subflow")},[...t[42]||(t[42]=[e.createStaticVNode('<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-2de5c749><rect x="3" y="3" width="7" height="7" rx="1" data-v-2de5c749></rect><rect x="14" y="3" width="7" height="7" rx="1" data-v-2de5c749></rect><rect x="8.5" y="14" width="7" height="7" rx="1" data-v-2de5c749></rect><path d="M6.5 10v2a2 2 0 002 2h1" data-v-2de5c749></path><path d="M17.5 10v2a2 2 0 01-2 2h-1" data-v-2de5c749></path></svg> Subflow ',2)])],2)):e.createCommentVNode("",!0),g.value?(e.openBlock(),e.createElementBlock("button",{key:8,class:e.normalizeClass(["tab",{active:m.value==="output"}]),onClick:t[9]||(t[9]=r=>m.value="output")},[...t[43]||(t[43]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{d:"M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z"}),e.createElementVNode("line",{x1:"4",y1:"22",x2:"4",y2:"15"})],-1),e.createTextVNode(" Output ",-1)])],2)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),x.value||L.value||A.value||f.value||g.value?(e.openBlock(),e.createElementBlock("div",Gn,[m.value==="prompt"&&x.value&&!g.value&&!c.value?(e.openBlock(),e.createElementBlock("div",Yn,[u.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",Xn,[t[44]||(t[44]=e.createElementVNode("label",{class:"field-label"},"Loop Strategy",-1)),e.createElementVNode("div",Jn,[e.createElementVNode("button",{class:e.normalizeClass(["mode-button",{active:O.value.loopMode!=="fixed"}]),onClick:t[10]||(t[10]=r=>Ge({target:{value:"while"}}))}," Smart Loop (AI) ",2),e.createElementVNode("button",{class:e.normalizeClass(["mode-button",{active:O.value.loopMode==="fixed"}]),onClick:t[11]||(t[11]=r=>Ge({target:{value:"fixed"}}))}," Fixed Count ",2)]),e.createElementVNode("p",Qn,e.toDisplayString(O.value.loopMode==="fixed"?"Runs exactly N times. Good for batch processing.":"AI evaluates results to decide when to stop."),1)]),O.value.loopMode!=="fixed"?(e.openBlock(),e.createElementBlock("div",Zn,[t[45]||(t[45]=e.createElementVNode("label",{class:"field-label"},"Stop Condition",-1)),e.createElementVNode("textarea",{value:O.value.conditionPrompt||"",class:"prompt-textarea condition-prompt",placeholder:'Example: "If the summary is concise and covers all points, respond DONE. Otherwise respond CONTINUE."',onInput:Ue,rows:"4"},null,40,el)])):e.createCommentVNode("",!0),e.createElementVNode("div",tl,[e.createElementVNode("div",ol,[e.createElementVNode("label",nl,e.toDisplayString(O.value.loopMode==="fixed"?"Run Count":"Max Limit"),1),e.createElementVNode("input",{type:"number",min:"1",class:"text-input",value:O.value.maxIterations??10,onInput:Lr},null,40,ll)]),e.createElementVNode("div",al,[t[47]||(t[47]=e.createElementVNode("label",{class:"field-label"},"On Limit Reached",-1)),e.createElementVNode("select",{class:"model-select",value:O.value.onMaxIterations||"warning",onChange:Or},[...t[46]||(t[46]=[e.createElementVNode("option",{value:"warning"}," Warn & Continue ",-1),e.createElementVNode("option",{value:"continue"}," Silent Continue ",-1),e.createElementVNode("option",{value:"error"},"Stop with Error",-1)])],40,sl)])]),e.createElementVNode("div",rl,[t[48]||(t[48]=e.createElementVNode("label",{class:"field-label"},"Loop Instructions",-1)),e.createElementVNode("textarea",{value:O.value.loopPrompt||"",class:"prompt-textarea loop-prompt",placeholder:`Tell the AI what to do each time.
|
|
7
7
|
|
|
8
|
-
Example: "Improve this text, making it clearer and more engaging."`,onInput:
|
|
8
|
+
Example: "Improve this text, making it clearer and more engaging."`,onInput:Hr,rows:"3"},null,40,il),t[49]||(t[49]=e.createElementVNode("p",{class:"field-hint"}," These instructions are added to the input at the start of each run. ",-1))]),e.createElementVNode("div",dl,[t[50]||(t[50]=e.createElementVNode("label",{class:"field-label"},"Output Handling",-1)),e.createElementVNode("div",cl,[e.createElementVNode("button",{class:e.normalizeClass(["mode-button",{active:(O.value.outputMode||"last")==="last"}]),onClick:t[12]||(t[12]=r=>Ye("last"))}," Last Result Only ",2),e.createElementVNode("button",{class:e.normalizeClass(["mode-button",{active:O.value.outputMode==="accumulate"}]),onClick:t[13]||(t[13]=r=>Ye("accumulate"))}," Collect All ",2)])]),t[57]||(t[57]=e.createElementVNode("div",{class:"section-divider"},null,-1)),t[58]||(t[58]=e.createElementVNode("label",{class:"field-label section-title"},"Context Visibility",-1)),t[59]||(t[59]=e.createElementVNode("p",{class:"section-subtitle"}," Choose what information is available to nodes inside the loop. ",-1)),e.createElementVNode("div",ml,[e.createElementVNode("label",{class:e.normalizeClass(["tool-item",{enabled:O.value.includePreviousOutputs!==!1}])},[e.createElementVNode("input",{type:"checkbox",checked:O.value.includePreviousOutputs!==!1,onChange:Rr},null,40,pl),t[51]||(t[51]=e.createElementVNode("div",{class:"tool-info"},[e.createElementVNode("span",{class:"tool-name"},"Previous Iterations"),e.createElementVNode("span",{class:"tool-description"},"Let the AI see results from earlier runs")],-1))],2),e.createElementVNode("label",{class:e.normalizeClass(["tool-item",{enabled:O.value.includeIterationContext!==!1}])},[e.createElementVNode("input",{type:"checkbox",checked:O.value.includeIterationContext!==!1,onChange:zr},null,40,ul),t[52]||(t[52]=e.createElementVNode("div",{class:"tool-info"},[e.createElementVNode("span",{class:"tool-name"},"Loop Counter"),e.createElementVNode("span",{class:"tool-description"},"Show current iteration number (1/10)")],-1))],2)]),O.value.loopMode!=="fixed"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t[56]||(t[56]=e.createElementVNode("div",{class:"section-divider"},null,-1)),e.createElementVNode("details",fl,[t[55]||(t[55]=e.createElementVNode("summary",{class:"advanced-toggle"}," Advanced: Custom Evaluator ",-1)),e.createElementVNode("div",gl,[e.createElementVNode("div",hl,[t[53]||(t[53]=e.createElementVNode("label",{class:"field-label"},"Function Name",-1)),e.createElementVNode("input",{type:"text",class:"text-input",value:O.value.customEvaluator||"",placeholder:"e.g. checkQualityScore",onInput:Pr},null,40,kl),t[54]||(t[54]=e.createElementVNode("p",{class:"field-hint"}," Bypass AI evaluation and use a registered function to decide when to stop. ",-1))])])])],64)):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("label",Nl,e.toDisplayString(S.value?"Routing Instructions":c.value?"Merge Instructions":"Instructions"),1),e.createElementVNode("textarea",{value:v.value.prompt||"",class:"prompt-textarea",placeholder:S.value?`Instructions for routing decisions...
|
|
9
9
|
|
|
10
10
|
Example:
|
|
11
11
|
Route to Technical if the user mentions bugs, errors, or technical issues.
|
|
12
|
-
Route to Sales for pricing or product inquiries.`:
|
|
12
|
+
Route to Sales for pricing or product inquiries.`:c.value?"Instructions for merging parallel outputs...":`Enter the system prompt for this agent...
|
|
13
13
|
|
|
14
14
|
Example:
|
|
15
|
-
You are a helpful technical support specialist. Help users troubleshoot issues with their software.`,onInput:Je},null,40,xl),e.createElementVNode("p",Cl,e.toDisplayString(P.value?"These instructions help the router decide which branch to take. Edge labels are used to make decisions.":f.value?"This prompt is used to merge/summarize outputs from all parallel branches.":"This prompt defines the agent's behavior and personality."),1)],64))])):e.createCommentVNode("",!0),c.value==="model"&&!f.value?(e.openBlock(),e.createElementBlock("div",Sl,[e.createElementVNode("label",Dl,e.toDisplayString(b.value?"Condition Model":"Select Model"),1),e.createElementVNode("select",{class:"model-select",value:b.value?R.value.conditionModel||"z-ai/glm-4.6:exacto":A.value.model||"z-ai/glm-4.6:exacto",onChange:Or},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.value,m=>(e.openBlock(),e.createElementBlock("option",{key:m.id,value:m.id},e.toDisplayString(m.name)+" ("+e.toDisplayString(m.provider)+") ",9,Il))),128))],40,$l),e.createElementVNode("div",Ml,[t[60]||(t[60]=e.createElementVNode("span",{class:"model-id-label"},"Model ID:",-1)),e.createElementVNode("code",null,e.toDisplayString(b.value?R.value.conditionModel||"z-ai/glm-4.6:exacto":A.value.model||"z-ai/glm-4.6:exacto"),1)])])):e.createCommentVNode("",!0),c.value==="routes"&&P.value?(e.openBlock(),e.createElementBlock("div",Tl,[e.createElementVNode("div",{class:"routes-header"},[t[62]||(t[62]=e.createElementVNode("label",{class:"field-label"},"Defined Routes",-1)),e.createElementVNode("button",{class:"add-btn with-label",onClick:Ee},[...t[61]||(t[61]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),e.createElementVNode("line",{x1:"5",y1:"12",x2:"19",y2:"12"})],-1),e.createTextVNode(" Add Route ",-1)])])]),t[64]||(t[64]=e.createElementVNode("p",{class:"field-hint"}," Define the possible routes for this node. Each route creates an output handle. ",-1)),e.createElementVNode("div",Ll,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(K.value.routes,m=>(e.openBlock(),e.createElementBlock("div",{key:m.id,class:"route-item"},[e.createElementVNode("div",Ol,[e.createElementVNode("input",{type:"text",class:"text-input route-label",value:m.label,onInput:z=>q(m.id,z.target.value),placeholder:"Route Label"},null,40,Pl),e.createElementVNode("code",Rl,e.toDisplayString(m.id),1)]),e.createElementVNode("button",{class:"delete-btn",onClick:z=>C(m.id),title:"Remove route"},[...t[63]||(t[63]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])],8,zl)]))),128))])])):e.createCommentVNode("",!0),c.value==="branches"&&f.value?(e.openBlock(),e.createElementBlock("div",Hl,[e.createElementVNode("div",{class:"branches-header"},[t[66]||(t[66]=e.createElementVNode("label",{class:"field-label"},"Parallel Branches",-1)),e.createElementVNode("button",{class:"add-btn",onClick:ae,"aria-label":"Add Branch"},[...t[65]||(t[65]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),e.createElementVNode("line",{x1:"5",y1:"12",x2:"19",y2:"12"})],-1)])])]),t[78]||(t[78]=e.createElementVNode("p",{class:"field-hint"}," Each branch runs in parallel. Connect nodes to each branch's output handle. Optionally set a model and system prompt per branch. ",-1)),e.createElementVNode("div",Al,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value.branches,m=>(e.openBlock(),e.createElementBlock("div",{key:m.id,class:e.normalizeClass(["branch-item",{expanded:ne.value===m.id}])},[e.createElementVNode("div",{class:"branch-header",onClick:z=>Ne(m.id)},[e.createElementVNode("div",Fl,[e.createElementVNode("input",{type:"text",class:"text-input branch-label",value:m.label,onInput:z=>J(m.id,z.target.value),onClick:t[14]||(t[14]=e.withModifiers(()=>{},["stop"])),placeholder:"Branch Label"},null,40,jl),e.createElementVNode("div",Ul,[m.model?(e.openBlock(),e.createElementBlock("span",Wl,e.toDisplayString(m.model.split("/").pop()),1)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",Kl,[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["expand-icon",{rotated:ne.value===m.id}]),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[...t[67]||(t[67]=[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"},null,-1)])],2)),e.createElementVNode("button",{class:"delete-btn",onClick:e.withModifiers(z=>Z(m.id),["stop"]),title:"Remove branch"},[...t[68]||(t[68]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])],8,ql)])],8,vl),ne.value===m.id?(e.openBlock(),e.createElementBlock("div",Gl,[e.createElementVNode("div",Yl,[t[70]||(t[70]=e.createElementVNode("label",{class:"field-label-sm"},"Model (optional)",-1)),e.createElementVNode("select",{class:"model-select-sm",value:m.model||"",onChange:z=>ue(m.id,z.target.value)},[t[69]||(t[69]=e.createElementVNode("option",{value:""},"Use default",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.value,z=>(e.openBlock(),e.createElementBlock("option",{key:z.id,value:z.id},e.toDisplayString(z.name),9,Jl))),128))],40,Xl)]),e.createElementVNode("div",Ql,[t[71]||(t[71]=e.createElementVNode("label",{class:"field-label-sm"},"System Prompt (optional)",-1)),e.createElementVNode("textarea",{class:"prompt-textarea-sm",value:m.prompt||"",onInput:z=>fe(m.id,z.target.value),placeholder:"Override system prompt for this branch...",rows:"3"},null,40,Zl)]),w.value.length>0?(e.openBlock(),e.createElementBlock("div",ea,[t[72]||(t[72]=e.createElementVNode("label",{class:"field-label-sm"},"Tools (optional)",-1)),e.createElementVNode("div",ta,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,z=>(e.openBlock(),e.createElementBlock("label",{key:z.id,class:e.normalizeClass(["branch-tool-item",{enabled:(m.tools||[]).includes(z.id)}])},[e.createElementVNode("input",{type:"checkbox",checked:(m.tools||[]).includes(z.id),onChange:ie=>he(m.id,z.id)},null,40,oa),e.createElementVNode("span",na,e.toDisplayString(z.name),1)],2))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],2))),128))]),e.createElementVNode("div",la,[e.createElementVNode("div",aa,[t[74]||(t[74]=e.createElementVNode("label",{class:"field-label"},"Merge Configuration",-1)),e.createElementVNode("div",sa,[e.createElementVNode("input",{type:"checkbox",checked:U.value.mergeEnabled!==!1,onChange:t[15]||(t[15]=m=>a.editor.commands.updateNodeData(n.value.id,{mergeEnabled:m.target.checked}))},null,40,ra),t[73]||(t[73]=e.createElementVNode("span",{class:"toggle-text"},"Enable Merge",-1))])]),U.value.mergeEnabled!==!1?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t[77]||(t[77]=e.createElementVNode("p",{class:"field-hint"}," After all branches complete, results are merged using this prompt. ",-1)),e.createElementVNode("div",ia,[t[75]||(t[75]=e.createElementVNode("label",{class:"field-label-sm"},"Merge Model",-1)),e.createElementVNode("select",{class:"model-select",value:U.value.mergeModel||"z-ai/glm-4.6:exacto",onChange:t[16]||(t[16]=m=>a.editor.commands.updateNodeData(n.value.id,{model:m.target.value}))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.value,m=>(e.openBlock(),e.createElementBlock("option",{key:m.id,value:m.id},e.toDisplayString(m.name)+" ("+e.toDisplayString(m.provider)+") ",9,ca))),128))],40,da)]),e.createElementVNode("div",ma,[t[76]||(t[76]=e.createElementVNode("label",{class:"field-label-sm"},"Merge Prompt",-1)),e.createElementVNode("textarea",{class:"prompt-textarea",value:U.value.mergePrompt,onInput:t[17]||(t[17]=m=>te("prompt",m.target.value)),placeholder:"Instructions for merging branch outputs...",rows:"4"},null,40,pa)])],64)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),c.value==="tools"&&u.value?(e.openBlock(),e.createElementBlock("div",ua,[w.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t[80]||(t[80]=e.createElementVNode("label",{class:"field-label"},"Available Tools",-1)),t[81]||(t[81]=e.createElementVNode("p",{class:"field-hint"}," Select which tools this agent can use during execution. ",-1)),e.createElementVNode("div",fa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,m=>(e.openBlock(),e.createElementBlock("label",{key:m.id,class:e.normalizeClass(["tool-item",{enabled:k.value.includes(m.id)}])},[e.createElementVNode("input",{type:"checkbox",checked:k.value.includes(m.id),onChange:z=>Qe(m.id)},null,40,ga),e.createElementVNode("div",ha,[e.createElementVNode("span",Na,e.toDisplayString(m.name),1),e.createElementVNode("span",Ea,e.toDisplayString(m.description),1)])],2))),128))]),k.value.length>0?(e.openBlock(),e.createElementBlock("div",ka,[e.createElementVNode("label",ya,"Enabled Tools ("+e.toDisplayString(k.value.length)+")",1),e.createElementVNode("div",Va,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,m=>{var z;return e.openBlock(),e.createElementBlock("span",{key:m,class:"tool-chip"},[e.createTextVNode(e.toDisplayString((z=w.value.find(ie=>ie.id===m))==null?void 0:z.name)+" ",1),e.createElementVNode("button",{class:"chip-remove",onClick:ie=>Qe(m)},[...t[79]||(t[79]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])],8,wa)])}),128))])])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock("div",ba,[...t[82]||(t[82]=[e.createElementVNode("label",{class:"field-label"},"Available Tools",-1),e.createElementVNode("p",{class:"field-hint"}," No tools are registered. Add tools in or3-chat to enable selections here. ",-1)])]))])):e.createCommentVNode("",!0),c.value==="errors"&&M.value?(e.openBlock(),e.createElementBlock("div",Ba,[t[87]||(t[87]=e.createElementVNode("label",{class:"field-label"},"Error handling mode",-1)),e.createElementVNode("div",_a,[e.createElementVNode("button",{class:e.normalizeClass(["mode-button",{active:G.value.mode==="stop"}]),onClick:t[18]||(t[18]=m=>Ce("stop"))}," Stop on error ",2),e.createElementVNode("button",{class:e.normalizeClass(["mode-button",{active:G.value.mode==="continue"}]),onClick:t[19]||(t[19]=m=>Ce("continue"))}," Continue ",2),e.createElementVNode("button",{class:e.normalizeClass(["mode-button",{active:G.value.mode==="branch"}]),onClick:t[20]||(t[20]=m=>Ce("branch"))}," Branch to error ",2)]),e.createElementVNode("div",xa,[e.createElementVNode("div",Ca,[t[83]||(t[83]=e.createElementVNode("label",{class:"field-label"},"Max retries",-1)),e.createElementVNode("input",{type:"number",min:"0",class:"text-input",value:se.value.maxRetries,onInput:t[21]||(t[21]=m=>Se("maxRetries",m))},null,40,Sa)]),e.createElementVNode("div",Da,[t[84]||(t[84]=e.createElementVNode("label",{class:"field-label"},"Base delay (ms)",-1)),e.createElementVNode("input",{type:"number",min:"0",class:"text-input",value:se.value.baseDelay,onInput:t[22]||(t[22]=m=>Se("baseDelay",m))},null,40,$a)]),e.createElementVNode("div",Ia,[t[85]||(t[85]=e.createElementVNode("label",{class:"field-label"},"Max delay (ms)",-1)),e.createElementVNode("input",{type:"number",min:"0",class:"text-input",value:se.value.maxDelay??"",onInput:t[23]||(t[23]=m=>Se("maxDelay",m))},null,40,Ma)])]),e.createElementVNode("div",Ta,[t[86]||(t[86]=e.createElementVNode("label",{class:"field-label"},"Retry on codes",-1)),e.createElementVNode("div",La,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(Mr,m=>e.createElementVNode("label",{key:m.id,class:"checkbox-item"},[e.createElementVNode("input",{type:"checkbox",checked:(se.value.retryOn||[]).includes(m.id),onChange:z=>Pr(m.id)},null,40,Oa),e.createElementVNode("span",null,e.toDisplayString(m.label),1)])),64))])]),t[88]||(t[88]=e.createElementVNode("p",{class:"field-hint"},' Branch mode sends errors to the "error" handle if connected. Continue mode logs the error and moves forward. ',-1))])):e.createCommentVNode("",!0),c.value==="hitl"&&O.value?(e.openBlock(),e.createElementBlock("div",Pa,[e.createElementVNode("div",Ra,[e.createElementVNode("label",za,[e.createElementVNode("input",{type:"checkbox",checked:ee.value.enabled,onChange:jr},null,40,Ha),t[89]||(t[89]=e.createElementVNode("span",{class:"toggle-text"},"Enable Human Review",-1))]),t[90]||(t[90]=e.createElementVNode("p",{class:"field-hint",style:{"margin-top":"4px"}}," Pause execution for human approval, input, or review. ",-1))]),ee.value.enabled?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",Aa,[t[91]||(t[91]=e.createElementVNode("label",{class:"field-label"},"Review Mode",-1)),e.createElementVNode("div",va,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(Xe,m=>e.createElementVNode("button",{key:m.id,class:e.normalizeClass(["mode-button hitl-mode",{active:ee.value.mode===m.id}]),onClick:z=>Ur(m.id),title:m.description},e.toDisplayString(m.label),11,Fa)),64))]),e.createElementVNode("p",ja,e.toDisplayString(($=Xe.find(m=>m.id===ee.value.mode))==null?void 0:$.description),1)]),e.createElementVNode("div",Ua,[t[92]||(t[92]=e.createElementVNode("label",{class:"field-label"},"Prompt",-1)),e.createElementVNode("textarea",{value:ee.value.prompt||"",class:"prompt-textarea hitl-prompt",placeholder:"Message to show the reviewer...",onInput:Wr},null,40,Wa)]),e.createElementVNode("div",Ka,[e.createElementVNode("div",qa,[t[93]||(t[93]=e.createElementVNode("label",{class:"field-label"},"Timeout (ms)",-1)),e.createElementVNode("input",{type:"number",min:"0",class:"text-input",value:ee.value.timeout||"",placeholder:"No timeout",onInput:Kr},null,40,Ga)]),e.createElementVNode("div",Ya,[t[94]||(t[94]=e.createElementVNode("label",{class:"field-label"},"Default Action",-1)),e.createElementVNode("select",{class:"model-select",value:ee.value.defaultAction||"reject",onChange:qr},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(Ir,m=>e.createElementVNode("option",{key:m.id,value:m.id},e.toDisplayString(m.label),9,Ja)),64))],40,Xa)])]),t[95]||(t[95]=e.createElementVNode("p",{class:"field-hint"},' When timeout is set, the default action is taken automatically. Connect the "Rejected" handle to route rejected items. ',-1))],64)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),c.value==="subflow"&&g.value?(e.openBlock(),e.createElementBlock("div",Qa,[e.createElementVNode("div",Za,[t[97]||(t[97]=e.createElementVNode("label",{class:"field-label"},"Subflow",-1)),e.createElementVNode("select",{class:"model-select",value:S.value.subflowId,disabled:l.subflowListLoading,onChange:Yr},[e.createElementVNode("option",ts,e.toDisplayString(l.subflowListLoading?"Loading workflows...":"Select a workflow..."),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,m=>(e.openBlock(),e.createElementBlock("option",{key:m.id,value:m.id},e.toDisplayString(m.name)+" ("+e.toDisplayString(m.id)+") ",9,os))),128))],40,es),l.subflowListLoading?(e.openBlock(),e.createElementBlock("p",ns," Loading available workflows... ")):l.subflowListError?(e.openBlock(),e.createElementBlock("p",ls," Unable to load workflows. You can still enter a subflow ID manually. ")):E.value.length===0?(e.openBlock(),e.createElementBlock("p",as," No workflows found yet. Create one in the Workflows tab or enter an ID manually. ")):(e.openBlock(),e.createElementBlock("p",ss,e.toDisplayString(((L=W.value)==null?void 0:L.description)||"Choose a workflow to run inside this node."),1)),S.value.subflowId?(e.openBlock(),e.createElementBlock("div",rs,[t[96]||(t[96]=e.createElementVNode("span",{class:"model-id-label"},"Workflow ID:",-1)),e.createElementVNode("code",null,e.toDisplayString(S.value.subflowId),1)])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"subflow-manual-toggle",type:"button",onClick:Xr},e.toDisplayString(F.value?"Hide manual entry":"Enter ID manually"),1)]),F.value?(e.openBlock(),e.createElementBlock("div",is,[t[98]||(t[98]=e.createElementVNode("label",{class:"field-label"},"Subflow ID",-1)),e.createElementVNode("input",{type:"text",class:"text-input",value:S.value.subflowId,placeholder:"e.g., email-composer",onInput:Gr},null,40,ds),t[99]||(t[99]=e.createElementVNode("p",{class:"field-hint"}," Use this only if the workflow isn't listed. ",-1))])):e.createCommentVNode("",!0),e.createElementVNode("div",cs,[e.createElementVNode("label",ms,[e.createElementVNode("input",{type:"checkbox",checked:S.value.shareSession,onChange:Jr},null,40,ps),t[100]||(t[100]=e.createElementVNode("span",{class:"toggle-text"},"Share Session",-1))]),t[101]||(t[101]=e.createElementVNode("p",{class:"field-hint",style:{"margin-top":"4px"}}," When enabled, the subflow shares conversation history with the parent workflow. ",-1))]),Object.keys(S.value.inputMappings).length>0?(e.openBlock(),e.createElementBlock("div",us,[t[102]||(t[102]=e.createElementVNode("label",{class:"field-label"},"Input Mappings",-1)),e.createElementVNode("div",fs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.value.inputMappings,(m,z)=>(e.openBlock(),e.createElementBlock("div",{key:z,class:"mapping-item"},[e.createElementVNode("span",gs,e.toDisplayString(z),1),e.createElementVNode("input",{type:"text",class:"text-input mapping-value",value:String(m),onInput:ie=>Qr(String(z),ie.target.value)},null,40,hs),e.createElementVNode("button",{class:"remove-mapping-btn",onClick:ie=>Zr(String(z)),title:"Remove mapping"}," × ",8,Ns)]))),128))])])):e.createCommentVNode("",!0),t[103]||(t[103]=e.createElementVNode("div",{class:"info-box"},[e.createElementVNode("p",null,[e.createElementVNode("strong",null,"Expressions:")]),e.createElementVNode("ul",{class:"expression-hints"},[e.createElementVNode("li",null,[e.createElementVNode("code",null,"{{ output }}"),e.createTextVNode(" - Current input/output ")]),e.createElementVNode("li",null,[e.createElementVNode("code",null,"{{ outputs.nodeId }}"),e.createTextVNode(" - Output from a specific node ")]),e.createElementVNode("li",null,[e.createElementVNode("code",null,'"literal"'),e.createTextVNode(" - Static value")])])],-1))])):e.createCommentVNode("",!0),c.value==="output"&&d.value?(e.openBlock(),e.createElementBlock("div",Es,[e.createVNode(mn,{modelValue:v.value.mode||"combine","onUpdate:modelValue":Ve},null,8,["modelValue"]),e.createVNode(In,{modelValue:v.value.sources||[],availableGroups:e.unref(ke),"onUpdate:modelValue":we},null,8,["modelValue","availableGroups"]),v.value.mode==="synthesis"?(e.openBlock(),e.createElementBlock("div",ks,[e.createElementVNode("div",ys,[t[104]||(t[104]=e.createElementVNode("label",{class:"field-label"},"Synthesis Model",-1)),e.createElementVNode("select",{class:"model-select",value:((Q=v.value.synthesis)==null?void 0:Q.model)||"z-ai/glm-4.6:exacto",onChange:me},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.value,m=>(e.openBlock(),e.createElementBlock("option",{key:m.id,value:m.id},e.toDisplayString(m.name)+" ("+e.toDisplayString(m.provider)+") ",9,ws))),128))],40,Vs)]),e.createElementVNode("div",bs,[t[105]||(t[105]=e.createElementVNode("label",{class:"field-label"},"Synthesis Prompt",-1)),e.createElementVNode("textarea",{class:"prompt-textarea",value:((j=v.value.synthesis)==null?void 0:j.prompt)||"",placeholder:"Instructions for synthesizing the final output...",rows:"4",onInput:_e},null,40,Bs)])])):e.createCommentVNode("",!0),e.createElementVNode("div",_s,[t[106]||(t[106]=e.createElementVNode("label",{class:"field-label"},"Introduction",-1)),e.createElementVNode("textarea",{class:"text-input",value:v.value.introText||"",placeholder:"Optional text to prepend...",rows:"2",onInput:be},null,40,xs)]),e.createElementVNode("div",Cs,[t[107]||(t[107]=e.createElementVNode("label",{class:"field-label"},"Conclusion",-1)),e.createElementVNode("textarea",{class:"text-input",value:v.value.outroText||"",placeholder:"Optional text to append...",rows:"2",onInput:Be},null,40,Ss)]),e.createVNode(Rn,{previewData:e.unref(ye)},null,8,["previewData"]),e.createElementVNode("div",Ds,[e.createElementVNode("button",{class:"advanced-toggle",onClick:t[24]||(t[24]=m=>X.value=!X.value)},[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["expand-icon",{rotated:X.value}]),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[...t[108]||(t[108]=[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"},null,-1)])],2)),t[109]||(t[109]=e.createTextVNode(" Advanced Settings ",-1))]),X.value?(e.openBlock(),e.createElementBlock("div",$s,[e.createElementVNode("div",Is,[e.createElementVNode("label",Ms,[e.createElementVNode("input",{type:"checkbox",checked:v.value.useRawTemplate,onChange:pe},null,40,Ts),t[110]||(t[110]=e.createElementVNode("div",{class:"tool-info"},[e.createElementVNode("span",{class:"tool-name"},"Use Raw Template"),e.createElementVNode("span",{class:"tool-description"},"Override all settings with a custom template")],-1))]),e.createElementVNode("label",Ls,[e.createElementVNode("input",{type:"checkbox",checked:v.value.includeMetadata,onChange:xe},null,40,Os),t[111]||(t[111]=e.createElementVNode("div",{class:"tool-info"},[e.createElementVNode("span",{class:"tool-name"},"Include Metadata"),e.createElementVNode("span",{class:"tool-description"},"Add execution stats to output")],-1))])]),v.value.useRawTemplate?(e.openBlock(),e.createElementBlock("div",Ps,[t[112]||(t[112]=e.createElementVNode("label",{class:"field-label"},"Raw Template",-1)),e.createElementVNode("textarea",{class:"textarea-input",value:v.value.template,placeholder:"e.g., Final result: {{outputs.nodeId}}",onInput:h,rows:"4"},null,40,Rs)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),N.value?(e.openBlock(),e.createElementBlock("div",zs,[...t[113]||(t[113]=[e.createElementVNode("div",{class:"info-box"}," The Start node is the entry point for workflow execution. Connect it to other nodes to define your workflow. ",-1)])])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",Hs,[...t[114]||(t[114]=[e.createElementVNode("div",{class:"empty-icon"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"},[e.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m12 18l-2-4l-7-3.5a.55.55 0 0 1 0-1L21 3l-3.14 8.697M17.001 19a2 2 0 1 0 4 0a2 2 0 1 0-4 0m2-3.5V17m0 4v1.5m3.031-5.25l-1.299.75m-3.463 2l-1.3.75m0-3.5l1.3.75m3.463 2l1.3.75"})])],-1),e.createElementVNode("p",null,"Select a node to edit its properties",-1)])]))}}}),[["__scopeId","data-v-2de5c749"]]),vs={class:"chat-panel"},Fs={key:0,class:"empty-state"},js={class:"message-avatar"},Us={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},Ws={key:1,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},Ks={class:"message-body"},qs={key:0,class:"tool-calls"},Gs={class:"tool-name"},Ys={key:1,class:"message-content"},Xs={key:2,class:"message-meta"},Js={key:1,class:"message assistant streaming"},Qs={class:"message-body"},Zs={class:"message-content"},er={class:"input-area"},tr=["disabled"],or=["disabled"],nr={key:0,class:"spinner",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},lr={key:1,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},ar=H(e.defineComponent({__name:"ChatPanel",props:{messages:{},streamingContent:{},executionState:{}},emits:["send","clear"],setup(l,{emit:r}){const s=l,i=r;let a=null;const y=()=>s.executionState?s.executionState:(a||(a=Te()),a),n=e.computed(()=>y()),c=e.computed(()=>n.value.state),w=()=>n.value.reset(),E=e.ref(""),V=e.ref(null);e.watch(()=>{var P;return(P=s.messages)==null?void 0:P.length},async()=>{await e.nextTick(),p()}),e.watch(()=>s.streamingContent,async()=>{await e.nextTick(),p()});const p=()=>{V.value&&(V.value.scrollTop=V.value.scrollHeight)},k=()=>{!E.value.trim()||c.value.value.isRunning||(i("send",E.value.trim()),E.value="")},D=()=>{w(),i("clear")},u=P=>{P.key==="Enter"&&!P.shiftKey&&(P.preventDefault(),k())};return(P,f)=>{var b;return e.openBlock(),e.createElementBlock("div",vs,[e.createElementVNode("div",{class:"chat-header"},[f[1]||(f[1]=e.createElementVNode("div",{class:"header-title"},[e.createElementVNode("svg",{class:"sparkle-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{d:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707"}),e.createElementVNode("circle",{cx:"12",cy:"12",r:"4"})]),e.createElementVNode("span",null,"Workflow Chat")],-1)),e.createElementVNode("button",{onClick:D,class:"clear-btn"},"Clear")]),e.createElementVNode("div",{class:"messages",ref_key:"messagesContainer",ref:V},[(b=l.messages)!=null&&b.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Fs,[...f[2]||(f[2]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[e.createElementVNode("rect",{x:"3",y:"11",width:"18",height:"10",rx:"2"}),e.createElementVNode("circle",{cx:"12",cy:"5",r:"2"}),e.createElementVNode("path",{d:"M12 7v4"})],-1),e.createElementVNode("p",null,"Send a message to start the workflow",-1)])])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.messages,(N,g)=>(e.openBlock(),e.createElementBlock("div",{key:g,class:e.normalizeClass(["message",N.role])},[e.createElementVNode("div",js,[N.role==="user"?(e.openBlock(),e.createElementBlock("svg",Us,[...f[3]||(f[3]=[e.createElementVNode("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"},null,-1),e.createElementVNode("circle",{cx:"12",cy:"7",r:"4"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",Ws,[...f[4]||(f[4]=[e.createElementVNode("rect",{x:"3",y:"11",width:"18",height:"10",rx:"2"},null,-1),e.createElementVNode("circle",{cx:"12",cy:"5",r:"2"},null,-1),e.createElementVNode("path",{d:"M12 7v4"},null,-1)])]))]),e.createElementVNode("div",Ks,[N.toolCalls&&N.toolCalls.length>0?(e.openBlock(),e.createElementBlock("div",qs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.toolCalls,(d,_)=>(e.openBlock(),e.createElementBlock("div",{key:_,class:"tool-call"},[f[5]||(f[5]=e.createElementVNode("span",{class:"tool-icon"},"🛠️",-1)),e.createElementVNode("span",Gs,"Used "+e.toDisplayString(d.function.name),1)]))),128))])):e.createCommentVNode("",!0),N.content?(e.openBlock(),e.createElementBlock("div",Ys,e.toDisplayString(N.content),1)):e.createCommentVNode("",!0),N.nodeId?(e.openBlock(),e.createElementBlock("div",Xs,"via "+e.toDisplayString(N.nodeId),1)):e.createCommentVNode("",!0)])],2))),128)),l.streamingContent||c.value.value.streamingContent?(e.openBlock(),e.createElementBlock("div",Js,[f[7]||(f[7]=e.createStaticVNode('<div class="message-avatar" data-v-c2838e84><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-c2838e84><rect x="3" y="11" width="18" height="10" rx="2" data-v-c2838e84></rect><circle cx="12" cy="5" r="2" data-v-c2838e84></circle><path d="M12 7v4" data-v-c2838e84></path></svg></div>',1)),e.createElementVNode("div",Qs,[e.createElementVNode("div",Zs,[e.createTextVNode(e.toDisplayString(l.streamingContent||c.value.value.streamingContent),1),f[6]||(f[6]=e.createElementVNode("span",{class:"cursor"},"|",-1))])])])):e.createCommentVNode("",!0)],512),e.createElementVNode("div",er,[e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":f[0]||(f[0]=N=>E.value=N),onKeydown:u,placeholder:"Type a message...",disabled:c.value.value.isRunning,rows:"1"},null,40,tr),[[e.vModelText,E.value]]),e.createElementVNode("button",{class:"send-btn",onClick:k,disabled:!E.value.trim()||c.value.value.isRunning},[c.value.value.isRunning?(e.openBlock(),e.createElementBlock("svg",nr,[...f[8]||(f[8]=[e.createElementVNode("path",{d:"M21 12a9 9 0 11-6.219-8.56"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",lr,[...f[9]||(f[9]=[e.createElementVNode("line",{x1:"22",y1:"2",x2:"11",y2:"13"},null,-1),e.createElementVNode("polygon",{points:"22 2 15 22 11 13 2 9 22 2"},null,-1)])]))],8,or)])])}}}),[["__scopeId","data-v-c2838e84"]]),sr=e.defineComponent({__name:"Controls",setup(l){return(r,s)=>(e.openBlock(),e.createBlock(e.unref(De.Controls)))}}),rr=e.defineComponent({__name:"MiniMap",setup(l){return(r,s)=>(e.openBlock(),e.createBlock(e.unref(at.MiniMap)))}}),ir={class:"edge-editor"},dr={class:"editor-header"},cr={class:"editor-content"},mr={key:0,class:"delete-confirm"},pr=H(e.defineComponent({__name:"EdgeLabelEditor",props:{edge:{},show:{type:Boolean}},emits:["close","update","delete"],setup(l,{emit:r}){const s=l,i=r,a=e.ref(""),y=e.ref(null),n=e.ref(!1);e.watch(()=>s.edge,p=>{p&&(a.value=p.label||"")},{immediate:!0}),e.watch(()=>s.show,p=>{p&&(n.value=!1,e.nextTick(()=>{var k,D;(k=y.value)==null||k.focus(),(D=y.value)==null||D.select()}))});function c(){s.edge&&i("update",s.edge.id,a.value)}function w(p){p.key==="Enter"?(c(),i("close")):p.key==="Escape"&&i("close")}function E(){s.edge&&(n.value?(i("delete",s.edge.id),n.value=!1):n.value=!0)}function V(){n.value=!1}return(p,k)=>(e.openBlock(),e.createBlock(e.Transition,{name:"modal"},{default:e.withCtx(()=>[l.show&&l.edge?(e.openBlock(),e.createElementBlock("div",{key:0,class:"edge-editor-overlay",onClick:k[2]||(k[2]=e.withModifiers(D=>i("close"),["self"]))},[e.createElementVNode("div",ir,[e.createElementVNode("div",dr,[k[4]||(k[4]=e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",class:"header-icon"},[e.createElementVNode("path",{d:"M12 2H2v10l9.29 9.29c.94.94 2.48.94 3.42 0l6.58-6.58c.94-.94.94-2.48 0-3.42L12 2Z"}),e.createElementVNode("path",{d:"M7 7h.01"})],-1)),k[5]||(k[5]=e.createElementVNode("span",null,"Edge Label",-1)),e.createElementVNode("button",{class:"close-btn",onClick:k[0]||(k[0]=D=>i("close"))},[...k[3]||(k[3]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])])]),e.createElementVNode("div",cr,[e.withDirectives(e.createElementVNode("input",{ref_key:"inputRef",ref:y,"onUpdate:modelValue":k[1]||(k[1]=D=>a.value=D),type:"text",class:"label-input",placeholder:"Enter edge label (e.g., 'Technical', 'Sales')",onInput:c,onKeydown:w},null,544),[[e.vModelText,a.value]]),k[8]||(k[8]=e.createElementVNode("p",{class:"hint"}," This label is shown on the connection line and helps the router make decisions. ",-1)),n.value?(e.openBlock(),e.createElementBlock("div",mr,[k[6]||(k[6]=e.createElementVNode("span",null,"Delete this connection?",-1)),e.createElementVNode("div",{class:"confirm-actions"},[e.createElementVNode("button",{class:"confirm-btn confirm-yes",onClick:E}," Yes, delete "),e.createElementVNode("button",{class:"confirm-btn confirm-no",onClick:V}," Cancel ")])])):(e.openBlock(),e.createElementBlock("button",{key:1,class:"delete-btn",onClick:E},[...k[7]||(k[7]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"3 6 5 6 21 6"}),e.createElementVNode("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})],-1),e.createTextVNode(" Delete Connection ",-1)])]))])])])):e.createCommentVNode("",!0)]),_:1}))}}),[["__scopeId","data-v-ad20c837"]]),ur={class:"title"},fr={class:"header-actions"},gr={key:1,class:"header-count error"},hr={key:2,class:"header-count warning"},Nr={key:3,class:"header-count ok"},Er={class:"collapsible-inner"},kr={class:"summary"},yr={key:0,class:"count error"},Vr={key:1,class:"count warning"},wr={key:2,class:"count ok"},br={key:3,class:"timestamp"},Br={key:0,class:"issue-list"},_r={class:"badge"},xr={class:"details"},Cr={class:"message"},Sr={key:0,class:"meta"},Dr={key:1,class:"meta"},$r=H(e.defineComponent({__name:"ValidationOverlay",props:{editor:{}},setup(l){const r=l,s=e.ref({isValid:!0,errors:[],warnings:[]}),i=e.ref(null),a=e.ref(!0);let y=null,n=null;const c=()=>{s.value=Y.validateWorkflow([...r.editor.getNodes()],[...r.editor.getEdges()]),i.value=Date.now()},w=()=>{n&&clearTimeout(n),n=setTimeout(c,120)};e.onMounted(()=>{c(),y=r.editor.on("update",w)}),e.onUnmounted(()=>{y==null||y(),n&&clearTimeout(n)});const E=e.computed(()=>[...s.value.errors,...s.value.warnings]),V=e.computed(()=>E.value.length===0),p=e.computed(()=>i.value?new Date(i.value).toLocaleTimeString():"");return(k,D)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["validation-overlay",{"has-issues":!V.value}])},[e.createElementVNode("div",{class:"overlay-header",onClick:D[0]||(D[0]=u=>a.value=!a.value)},[e.createElementVNode("div",ur,[e.createElementVNode("span",{class:e.normalizeClass(["status-dot",V.value?"ok":"warn"])},null,2),D[1]||(D[1]=e.createElementVNode("span",null,"Validation",-1))]),e.createElementVNode("div",fr,[a.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"refresh",onClick:e.withModifiers(c,["stop"])}," Re-run ")),a.value&&s.value.errors.length?(e.openBlock(),e.createElementBlock("span",gr,e.toDisplayString(s.value.errors.length)+" error"+e.toDisplayString(s.value.errors.length===1?"":"s"),1)):e.createCommentVNode("",!0),a.value&&s.value.warnings.length?(e.openBlock(),e.createElementBlock("span",hr,e.toDisplayString(s.value.warnings.length)+" warning"+e.toDisplayString(s.value.warnings.length===1?"":"s"),1)):e.createCommentVNode("",!0),a.value&&V.value?(e.openBlock(),e.createElementBlock("span",Nr,"All clear")):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["collapse-chevron",{expanded:!a.value}]),width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},[...D[2]||(D[2]=[e.createElementVNode("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],2))])]),e.createElementVNode("div",{class:e.normalizeClass(["collapsible-content",{collapsed:a.value}])},[e.createElementVNode("div",Er,[e.createElementVNode("div",kr,[s.value.errors.length?(e.openBlock(),e.createElementBlock("span",yr,e.toDisplayString(s.value.errors.length)+" error"+e.toDisplayString(s.value.errors.length===1?"":"s"),1)):e.createCommentVNode("",!0),s.value.warnings.length?(e.openBlock(),e.createElementBlock("span",Vr,e.toDisplayString(s.value.warnings.length)+" warning"+e.toDisplayString(s.value.warnings.length===1?"":"s"),1)):e.createCommentVNode("",!0),V.value?(e.openBlock(),e.createElementBlock("span",wr,"All clear")):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("span",br," Updated "+e.toDisplayString(p.value),1)):e.createCommentVNode("",!0)]),E.value.length?(e.openBlock(),e.createElementBlock("div",Br,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.value,u=>(e.openBlock(),e.createElementBlock("div",{key:u.code+(u.nodeId||"")+(u.edgeId||"")+u.message,class:e.normalizeClass(["issue",u.type])},[e.createElementVNode("span",_r,e.toDisplayString(u.type==="error"?"Error":"Warning"),1),e.createElementVNode("div",xr,[e.createElementVNode("div",Cr,e.toDisplayString(u.message),1),u.nodeId?(e.openBlock(),e.createElementBlock("div",Sr," Node: "+e.toDisplayString(u.nodeId),1)):u.edgeId?(e.openBlock(),e.createElementBlock("div",Dr," Edge: "+e.toDisplayString(u.edgeId),1)):e.createCommentVNode("",!0)])],2))),128))])):e.createCommentVNode("",!0)])],2)],2))}}),[["__scopeId","data-v-849827fb"]]);Object.defineProperty(T,"isAgentNodeData",{enumerable:!0,get:()=>Y.isAgentNodeData}),Object.defineProperty(T,"isOutputNodeData",{enumerable:!0,get:()=>Y.isOutputNodeData}),Object.defineProperty(T,"isParallelNodeData",{enumerable:!0,get:()=>Y.isParallelNodeData}),Object.defineProperty(T,"isRouterNodeData",{enumerable:!0,get:()=>Y.isRouterNodeData}),Object.defineProperty(T,"isStartNodeData",{enumerable:!0,get:()=>Y.isStartNodeData}),T.ChatPanel=ar,T.Controls=sr,T.EdgeLabelEditor=pr,T.MiniMap=rr,T.NodeInspector=As,T.NodePalette=sn,T.NodeWrapper=le,T.ValidationOverlay=$r,T.WorkflowCanvas=zo,T.createExecutionState=Me,T.createNodeRegistry=Le,T.defaultNodeRegistry=Oe,T.useEditor=st,T.useExecutionState=Te,T.useNodeState=dt,T.useWorkflowEditor=$e,T.useWorkflowExecution=rt,T.useWorkflowStorage=it,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})});
|
|
15
|
+
You are a helpful technical support specialist. Help users troubleshoot issues with their software.`,onInput:Ue},null,40,El),e.createElementVNode("p",yl,e.toDisplayString(S.value?"These instructions help the router decide which branch to take. Edge labels are used to make decisions.":c.value?"This prompt is used to merge/summarize outputs from all parallel branches.":"This prompt defines the agent's behavior and personality."),1)],64))])):e.createCommentVNode("",!0),m.value==="model"&&!c.value?(e.openBlock(),e.createElementBlock("div",Vl,[e.createElementVNode("label",bl,e.toDisplayString(u.value?"Condition Model":"Select Model"),1),e.createElementVNode("select",{class:"model-select",value:u.value?O.value.conditionModel||"z-ai/glm-4.6:exacto":v.value.model||"z-ai/glm-4.6:exacto",onChange:Mr},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,r=>(e.openBlock(),e.createElementBlock("option",{key:r.id,value:r.id},e.toDisplayString(r.name)+" ("+e.toDisplayString(r.provider)+") ",9,xl))),128))],40,wl),e.createElementVNode("div",Bl,[t[60]||(t[60]=e.createElementVNode("span",{class:"model-id-label"},"Model ID:",-1)),e.createElementVNode("code",null,e.toDisplayString(u.value?O.value.conditionModel||"z-ai/glm-4.6:exacto":v.value.model||"z-ai/glm-4.6:exacto"),1)])])):e.createCommentVNode("",!0),m.value==="routes"&&S.value?(e.openBlock(),e.createElementBlock("div",_l,[e.createElementVNode("div",{class:"routes-header"},[t[62]||(t[62]=e.createElementVNode("label",{class:"field-label"},"Defined Routes",-1)),e.createElementVNode("button",{class:"add-btn with-label",onClick:Br},[...t[61]||(t[61]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),e.createElementVNode("line",{x1:"5",y1:"12",x2:"19",y2:"12"})],-1),e.createTextVNode(" Add Route ",-1)])])]),t[64]||(t[64]=e.createElementVNode("p",{class:"field-hint"}," Define the possible routes for this node. Each route creates an output handle. ",-1)),e.createElementVNode("div",Cl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value.routes,r=>(e.openBlock(),e.createElementBlock("div",{key:r.id,class:"route-item"},[e.createElementVNode("div",Sl,[e.createElementVNode("input",{type:"text",class:"text-input route-label",value:r.label,onInput:w=>Cr(r.id,w.target.value),placeholder:"Route Label"},null,40,Dl),e.createElementVNode("code",$l,e.toDisplayString(r.id),1)]),e.createElementVNode("button",{class:"delete-btn",onClick:w=>_r(r.id),title:"Remove route"},[...t[63]||(t[63]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])],8,Il)]))),128))])])):e.createCommentVNode("",!0),m.value==="branches"&&c.value?(e.openBlock(),e.createElementBlock("div",Ml,[e.createElementVNode("div",{class:"branches-header"},[t[66]||(t[66]=e.createElementVNode("label",{class:"field-label"},"Parallel Branches",-1)),e.createElementVNode("button",{class:"add-btn",onClick:K,"aria-label":"Add Branch"},[...t[65]||(t[65]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),e.createElementVNode("line",{x1:"5",y1:"12",x2:"19",y2:"12"})],-1)])])]),t[78]||(t[78]=e.createElementVNode("p",{class:"field-hint"}," Each branch runs in parallel. Connect nodes to each branch's output handle. Optionally set a model and system prompt per branch. ",-1)),e.createElementVNode("div",Tl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.value.branches,r=>(e.openBlock(),e.createElementBlock("div",{key:r.id,class:e.normalizeClass(["branch-item",{expanded:le.value===r.id}])},[e.createElementVNode("div",{class:"branch-header",onClick:w=>xr(r.id)},[e.createElementVNode("div",Ol,[e.createElementVNode("input",{type:"text",class:"text-input branch-label",value:r.label,onInput:w=>ce(r.id,w.target.value),onClick:t[14]||(t[14]=e.withModifiers(()=>{},["stop"])),placeholder:"Branch Label"},null,40,Pl),e.createElementVNode("div",Rl,[r.model?(e.openBlock(),e.createElementBlock("span",zl,e.toDisplayString(r.model.split("/").pop()),1)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",Hl,[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["expand-icon",{rotated:le.value===r.id}]),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[...t[67]||(t[67]=[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"},null,-1)])],2)),e.createElementVNode("button",{class:"delete-btn",onClick:e.withModifiers(w=>Z(r.id),["stop"]),title:"Remove branch"},[...t[68]||(t[68]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])],8,Al)])],8,Ll),le.value===r.id?(e.openBlock(),e.createElementBlock("div",vl,[e.createElementVNode("div",Fl,[t[70]||(t[70]=e.createElementVNode("label",{class:"field-label-sm"},"Model (optional)",-1)),e.createElementVNode("select",{class:"model-select-sm",value:r.model||"",onChange:w=>me(r.id,w.target.value)},[t[69]||(t[69]=e.createElementVNode("option",{value:""},"Use default",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,w=>(e.openBlock(),e.createElementBlock("option",{key:w.id,value:w.id},e.toDisplayString(w.name),9,Ul))),128))],40,jl)]),e.createElementVNode("div",Wl,[t[71]||(t[71]=e.createElementVNode("label",{class:"field-label-sm"},"System Prompt (optional)",-1)),e.createElementVNode("textarea",{class:"prompt-textarea-sm",value:r.prompt||"",onInput:w=>C(r.id,w.target.value),placeholder:"Override system prompt for this branch...",rows:"3"},null,40,Kl)]),E.value.length>0?(e.openBlock(),e.createElementBlock("div",ql,[t[72]||(t[72]=e.createElementVNode("label",{class:"field-label-sm"},"Tools (optional)",-1)),e.createElementVNode("div",Gl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.value,w=>(e.openBlock(),e.createElementBlock("label",{key:w.id,class:e.normalizeClass(["branch-tool-item",{enabled:(r.tools||[]).includes(w.id)}])},[e.createElementVNode("input",{type:"checkbox",checked:(r.tools||[]).includes(w.id),onChange:Y=>ee(r.id,w.id)},null,40,Yl),e.createElementVNode("span",Xl,e.toDisplayString(w.name),1)],2))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],2))),128))]),e.createElementVNode("div",Jl,[e.createElementVNode("div",Ql,[t[74]||(t[74]=e.createElementVNode("label",{class:"field-label"},"Merge Configuration",-1)),e.createElementVNode("div",Zl,[e.createElementVNode("input",{type:"checkbox",checked:H.value.mergeEnabled!==!1,onChange:t[15]||(t[15]=r=>a.editor.commands.updateNodeData(o.value.id,{mergeEnabled:r.target.checked}))},null,40,ea),t[73]||(t[73]=e.createElementVNode("span",{class:"toggle-text"},"Enable Merge",-1))])]),H.value.mergeEnabled!==!1?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t[77]||(t[77]=e.createElementVNode("p",{class:"field-hint"}," After all branches complete, results are merged using this prompt. ",-1)),e.createElementVNode("div",ta,[t[75]||(t[75]=e.createElementVNode("label",{class:"field-label-sm"},"Merge Model",-1)),e.createElementVNode("select",{class:"model-select",value:H.value.mergeModel||"z-ai/glm-4.6:exacto",onChange:t[16]||(t[16]=r=>a.editor.commands.updateNodeData(o.value.id,{model:r.target.value}))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,r=>(e.openBlock(),e.createElementBlock("option",{key:r.id,value:r.id},e.toDisplayString(r.name)+" ("+e.toDisplayString(r.provider)+") ",9,na))),128))],40,oa)]),e.createElementVNode("div",la,[t[76]||(t[76]=e.createElementVNode("label",{class:"field-label-sm"},"Merge Prompt",-1)),e.createElementVNode("textarea",{class:"prompt-textarea",value:H.value.mergePrompt,onInput:t[17]||(t[17]=r=>G("prompt",r.target.value)),placeholder:"Instructions for merging branch outputs...",rows:"4"},null,40,aa)])],64)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),m.value==="tools"&&B.value?(e.openBlock(),e.createElementBlock("div",sa,[E.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t[80]||(t[80]=e.createElementVNode("label",{class:"field-label"},"Available Tools",-1)),t[81]||(t[81]=e.createElementVNode("p",{class:"field-hint"}," Select which tools this agent can use during execution. ",-1)),e.createElementVNode("div",ra,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.value,r=>(e.openBlock(),e.createElementBlock("label",{key:r.id,class:e.normalizeClass(["tool-item",{enabled:y.value.includes(r.id)}])},[e.createElementVNode("input",{type:"checkbox",checked:y.value.includes(r.id),onChange:w=>We(r.id)},null,40,ia),e.createElementVNode("div",da,[e.createElementVNode("span",ca,e.toDisplayString(r.name),1),e.createElementVNode("span",ma,e.toDisplayString(r.description),1)])],2))),128))]),y.value.length>0?(e.openBlock(),e.createElementBlock("div",pa,[e.createElementVNode("label",ua,"Enabled Tools ("+e.toDisplayString(y.value.length)+")",1),e.createElementVNode("div",fa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,r=>(e.openBlock(),e.createElementBlock("span",{key:r,class:"tool-chip"},[e.createTextVNode(e.toDisplayString(E.value.find(w=>w.id===r)?.name)+" ",1),e.createElementVNode("button",{class:"chip-remove",onClick:w=>We(r)},[...t[79]||(t[79]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])],8,ga)]))),128))])])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock("div",ha,[...t[82]||(t[82]=[e.createElementVNode("label",{class:"field-label"},"Available Tools",-1),e.createElementVNode("p",{class:"field-hint"}," No tools are registered. Add tools in or3-chat to enable selections here. ",-1)])]))])):e.createCommentVNode("",!0),m.value==="errors"&&L.value?(e.openBlock(),e.createElementBlock("div",ka,[t[87]||(t[87]=e.createElementVNode("label",{class:"field-label"},"Error handling mode",-1)),e.createElementVNode("div",Na,[e.createElementVNode("button",{class:e.normalizeClass(["mode-button",{active:ae.value.mode==="stop"}]),onClick:t[18]||(t[18]=r=>ye("stop"))}," Stop on error ",2),e.createElementVNode("button",{class:e.normalizeClass(["mode-button",{active:ae.value.mode==="continue"}]),onClick:t[19]||(t[19]=r=>ye("continue"))}," Continue ",2),e.createElementVNode("button",{class:e.normalizeClass(["mode-button",{active:ae.value.mode==="branch"}]),onClick:t[20]||(t[20]=r=>ye("branch"))}," Branch to error ",2)]),e.createElementVNode("div",Ea,[e.createElementVNode("div",ya,[t[83]||(t[83]=e.createElementVNode("label",{class:"field-label"},"Max retries",-1)),e.createElementVNode("input",{type:"number",min:"0",class:"text-input",value:oe.value.maxRetries,onInput:t[21]||(t[21]=r=>Ve("maxRetries",r))},null,40,Va)]),e.createElementVNode("div",ba,[t[84]||(t[84]=e.createElementVNode("label",{class:"field-label"},"Base delay (ms)",-1)),e.createElementVNode("input",{type:"number",min:"0",class:"text-input",value:oe.value.baseDelay,onInput:t[22]||(t[22]=r=>Ve("baseDelay",r))},null,40,wa)]),e.createElementVNode("div",xa,[t[85]||(t[85]=e.createElementVNode("label",{class:"field-label"},"Max delay (ms)",-1)),e.createElementVNode("input",{type:"number",min:"0",class:"text-input",value:oe.value.maxDelay??"",onInput:t[23]||(t[23]=r=>Ve("maxDelay",r))},null,40,Ba)])]),e.createElementVNode("div",_a,[t[86]||(t[86]=e.createElementVNode("label",{class:"field-label"},"Retry on codes",-1)),e.createElementVNode("div",Ca,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(Dr,r=>e.createElementVNode("label",{key:r.id,class:"checkbox-item"},[e.createElementVNode("input",{type:"checkbox",checked:(oe.value.retryOn||[]).includes(r.id),onChange:w=>Tr(r.id)},null,40,Sa),e.createElementVNode("span",null,e.toDisplayString(r.label),1)])),64))])]),t[88]||(t[88]=e.createElementVNode("p",{class:"field-hint"},' Branch mode sends errors to the "error" handle if connected. Continue mode logs the error and moves forward. ',-1))])):e.createCommentVNode("",!0),m.value==="hitl"&&A.value?(e.openBlock(),e.createElementBlock("div",Da,[e.createElementVNode("div",$a,[e.createElementVNode("label",Ia,[e.createElementVNode("input",{type:"checkbox",checked:q.value.enabled,onChange:Ar},null,40,Ma),t[89]||(t[89]=e.createElementVNode("span",{class:"toggle-text"},"Enable Human Review",-1))]),t[90]||(t[90]=e.createElementVNode("p",{class:"field-hint",style:{"margin-top":"4px"}}," Pause execution for human approval, input, or review. ",-1))]),q.value.enabled?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",Ta,[t[91]||(t[91]=e.createElementVNode("label",{class:"field-label"},"Review Mode",-1)),e.createElementVNode("div",La,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(je,r=>e.createElementVNode("button",{key:r.id,class:e.normalizeClass(["mode-button hitl-mode",{active:q.value.mode===r.id}]),onClick:w=>vr(r.id),title:r.description},e.toDisplayString(r.label),11,Oa)),64))]),e.createElementVNode("p",Pa,e.toDisplayString(je.find(r=>r.id===q.value.mode)?.description),1)]),e.createElementVNode("div",Ra,[t[92]||(t[92]=e.createElementVNode("label",{class:"field-label"},"Prompt",-1)),e.createElementVNode("textarea",{value:q.value.prompt||"",class:"prompt-textarea hitl-prompt",placeholder:"Message to show the reviewer...",onInput:Fr},null,40,za)]),e.createElementVNode("div",Ha,[e.createElementVNode("div",Aa,[t[93]||(t[93]=e.createElementVNode("label",{class:"field-label"},"Timeout (ms)",-1)),e.createElementVNode("input",{type:"number",min:"0",class:"text-input",value:q.value.timeout||"",placeholder:"No timeout",onInput:jr},null,40,va)]),e.createElementVNode("div",Fa,[t[94]||(t[94]=e.createElementVNode("label",{class:"field-label"},"Default Action",-1)),e.createElementVNode("select",{class:"model-select",value:q.value.defaultAction||"reject",onChange:Ur},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(Sr,r=>e.createElementVNode("option",{key:r.id,value:r.id},e.toDisplayString(r.label),9,Ua)),64))],40,ja)])]),t[95]||(t[95]=e.createElementVNode("p",{class:"field-hint"},' When timeout is set, the default action is taken automatically. Connect the "Rejected" handle to route rejected items. ',-1))],64)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),m.value==="subflow"&&f.value?(e.openBlock(),e.createElementBlock("div",Wa,[e.createElementVNode("div",Ka,[t[97]||(t[97]=e.createElementVNode("label",{class:"field-label"},"Subflow",-1)),e.createElementVNode("select",{class:"model-select",value:D.value.subflowId,disabled:l.subflowListLoading,onChange:Kr},[e.createElementVNode("option",Ga,e.toDisplayString(l.subflowListLoading?"Loading workflows...":"Select a workflow..."),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,r=>(e.openBlock(),e.createElementBlock("option",{key:r.id,value:r.id},e.toDisplayString(r.name)+" ("+e.toDisplayString(r.id)+") ",9,Ya))),128))],40,qa),l.subflowListLoading?(e.openBlock(),e.createElementBlock("p",Xa," Loading available workflows... ")):l.subflowListError?(e.openBlock(),e.createElementBlock("p",Ja," Unable to load workflows. You can still enter a subflow ID manually. ")):V.value.length===0?(e.openBlock(),e.createElementBlock("p",Qa," No workflows found yet. Create one in the Workflows tab or enter an ID manually. ")):(e.openBlock(),e.createElementBlock("p",Za,e.toDisplayString(j.value?.description||"Choose a workflow to run inside this node."),1)),D.value.subflowId?(e.openBlock(),e.createElementBlock("div",es,[t[96]||(t[96]=e.createElementVNode("span",{class:"model-id-label"},"Workflow ID:",-1)),e.createElementVNode("code",null,e.toDisplayString(D.value.subflowId),1)])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"subflow-manual-toggle",type:"button",onClick:qr},e.toDisplayString(R.value?"Hide manual entry":"Enter ID manually"),1)]),R.value?(e.openBlock(),e.createElementBlock("div",ts,[t[98]||(t[98]=e.createElementVNode("label",{class:"field-label"},"Subflow ID",-1)),e.createElementVNode("input",{type:"text",class:"text-input",value:D.value.subflowId,placeholder:"e.g., email-composer",onInput:Wr},null,40,os),t[99]||(t[99]=e.createElementVNode("p",{class:"field-hint"}," Use this only if the workflow isn't listed. ",-1))])):e.createCommentVNode("",!0),e.createElementVNode("div",ns,[e.createElementVNode("label",ls,[e.createElementVNode("input",{type:"checkbox",checked:D.value.shareSession,onChange:Gr},null,40,as),t[100]||(t[100]=e.createElementVNode("span",{class:"toggle-text"},"Share Session",-1))]),t[101]||(t[101]=e.createElementVNode("p",{class:"field-hint",style:{"margin-top":"4px"}}," When enabled, the subflow shares conversation history with the parent workflow. ",-1))]),Object.keys(D.value.inputMappings).length>0?(e.openBlock(),e.createElementBlock("div",ss,[t[102]||(t[102]=e.createElementVNode("label",{class:"field-label"},"Input Mappings",-1)),e.createElementVNode("div",rs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.value.inputMappings,(r,w)=>(e.openBlock(),e.createElementBlock("div",{key:w,class:"mapping-item"},[e.createElementVNode("span",is,e.toDisplayString(w),1),e.createElementVNode("input",{type:"text",class:"text-input mapping-value",value:String(r),onInput:Y=>Yr(String(w),Y.target.value)},null,40,ds),e.createElementVNode("button",{class:"remove-mapping-btn",onClick:Y=>Xr(String(w)),title:"Remove mapping"}," × ",8,cs)]))),128))])])):e.createCommentVNode("",!0),t[103]||(t[103]=e.createElementVNode("div",{class:"info-box"},[e.createElementVNode("p",null,[e.createElementVNode("strong",null,"Expressions:")]),e.createElementVNode("ul",{class:"expression-hints"},[e.createElementVNode("li",null,[e.createElementVNode("code",null,"{{ output }}"),e.createTextVNode(" - Current input/output ")]),e.createElementVNode("li",null,[e.createElementVNode("code",null,"{{ outputs.nodeId }}"),e.createTextVNode(" - Output from a specific node ")]),e.createElementVNode("li",null,[e.createElementVNode("code",null,'"literal"'),e.createTextVNode(" - Static value")])])],-1))])):e.createCommentVNode("",!0),m.value==="output"&&g.value?(e.openBlock(),e.createElementBlock("div",ms,[e.createVNode(nn,{modelValue:z.value.mode||"combine","onUpdate:modelValue":fe},null,8,["modelValue"]),e.createVNode(xn,{modelValue:z.value.sources||[],availableGroups:e.unref(pe),"onUpdate:modelValue":ge},null,8,["modelValue","availableGroups"]),z.value.mode==="synthesis"?(e.openBlock(),e.createElementBlock("div",ps,[e.createElementVNode("div",us,[t[104]||(t[104]=e.createElementVNode("label",{class:"field-label"},"Synthesis Model",-1)),e.createElementVNode("select",{class:"model-select",value:z.value.synthesis?.model||"z-ai/glm-4.6:exacto",onChange:ie},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,r=>(e.openBlock(),e.createElementBlock("option",{key:r.id,value:r.id},e.toDisplayString(r.name)+" ("+e.toDisplayString(r.provider)+") ",9,gs))),128))],40,fs)]),e.createElementVNode("div",hs,[t[105]||(t[105]=e.createElementVNode("label",{class:"field-label"},"Synthesis Prompt",-1)),e.createElementVNode("textarea",{class:"prompt-textarea",value:z.value.synthesis?.prompt||"",placeholder:"Instructions for synthesizing the final output...",rows:"4",onInput:Ne},null,40,ks)])])):e.createCommentVNode("",!0),e.createElementVNode("div",Ns,[t[106]||(t[106]=e.createElementVNode("label",{class:"field-label"},"Introduction",-1)),e.createElementVNode("textarea",{class:"text-input",value:z.value.introText||"",placeholder:"Optional text to prepend...",rows:"2",onInput:he},null,40,Es)]),e.createElementVNode("div",ys,[t[107]||(t[107]=e.createElementVNode("label",{class:"field-label"},"Conclusion",-1)),e.createElementVNode("textarea",{class:"text-input",value:z.value.outroText||"",placeholder:"Optional text to append...",rows:"2",onInput:ke},null,40,Vs)]),e.createVNode($n,{previewData:e.unref(ue)},null,8,["previewData"]),e.createElementVNode("div",bs,[e.createElementVNode("button",{class:"advanced-toggle",onClick:t[24]||(t[24]=r=>Q.value=!Q.value)},[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["expand-icon",{rotated:Q.value}]),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[...t[108]||(t[108]=[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"},null,-1)])],2)),t[109]||(t[109]=e.createTextVNode(" Advanced Settings ",-1))]),Q.value?(e.openBlock(),e.createElementBlock("div",ws,[e.createElementVNode("div",xs,[e.createElementVNode("label",Bs,[e.createElementVNode("input",{type:"checkbox",checked:z.value.useRawTemplate,onChange:de},null,40,_s),t[110]||(t[110]=e.createElementVNode("div",{class:"tool-info"},[e.createElementVNode("span",{class:"tool-name"},"Use Raw Template"),e.createElementVNode("span",{class:"tool-description"},"Override all settings with a custom template")],-1))]),e.createElementVNode("label",Cs,[e.createElementVNode("input",{type:"checkbox",checked:z.value.includeMetadata,onChange:Ee},null,40,Ss),t[111]||(t[111]=e.createElementVNode("div",{class:"tool-info"},[e.createElementVNode("span",{class:"tool-name"},"Include Metadata"),e.createElementVNode("span",{class:"tool-description"},"Add execution stats to output")],-1))])]),z.value.useRawTemplate?(e.openBlock(),e.createElementBlock("div",Ds,[t[112]||(t[112]=e.createElementVNode("label",{class:"field-label"},"Raw Template",-1)),e.createElementVNode("textarea",{class:"textarea-input",value:z.value.template,placeholder:"e.g., Final result: {{outputs.nodeId}}",onInput:h,rows:"4"},null,40,$s)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),$.value?(e.openBlock(),e.createElementBlock("div",Is,[...t[113]||(t[113]=[e.createElementVNode("div",{class:"info-box"}," The Start node is the entry point for workflow execution. Connect it to other nodes to define your workflow. ",-1)])])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",Ms,[...t[114]||(t[114]=[e.createElementVNode("div",{class:"empty-icon"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"},[e.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m12 18l-2-4l-7-3.5a.55.55 0 0 1 0-1L21 3l-3.14 8.697M17.001 19a2 2 0 1 0 4 0a2 2 0 1 0-4 0m2-3.5V17m0 4v1.5m3.031-5.25l-1.299.75m-3.463 2l-1.3.75m0-3.5l1.3.75m3.463 2l1.3.75"})])],-1),e.createElementVNode("p",null,"Select a node to edit its properties",-1)])]))}}),[["__scopeId","data-v-2de5c749"]]),Ls={class:"chat-panel"},Os={key:0,class:"empty-state"},Ps={class:"message-avatar"},Rs={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},zs={key:1,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},Hs={class:"message-body"},As={key:0,class:"tool-calls"},vs={class:"tool-name"},Fs={key:1,class:"message-content"},js={key:2,class:"message-meta"},Us={key:1,class:"message assistant streaming"},Ws={class:"message-body"},Ks={class:"message-content"},qs={class:"input-area"},Gs=["disabled"],Ys=["disabled"],Xs={key:0,class:"spinner",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},Js={key:1,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},Qs=P(e.defineComponent({__name:"ChatPanel",props:{messages:{},streamingContent:{},executionState:{}},emits:["send","clear"],setup(l,{emit:i}){const s=l,d=i;let a=null;const N=()=>s.executionState?s.executionState:(a||(a=_e()),a),o=e.computed(()=>N()),m=e.computed(()=>o.value.state),E=()=>o.value.reset(),V=e.ref(""),k=e.ref(null);e.watch(()=>s.messages?.length,async()=>{await e.nextTick(),p()}),e.watch(()=>s.streamingContent,async()=>{await e.nextTick(),p()});const p=()=>{k.value&&(k.value.scrollTop=k.value.scrollHeight)},y=()=>{!V.value.trim()||m.value.value.isRunning||(d("send",V.value.trim()),V.value="")},M=()=>{E(),d("clear")},B=S=>{S.key==="Enter"&&!S.shiftKey&&(S.preventDefault(),y())};return(S,c)=>(e.openBlock(),e.createElementBlock("div",Ls,[e.createElementVNode("div",{class:"chat-header"},[c[1]||(c[1]=e.createElementVNode("div",{class:"header-title"},[e.createElementVNode("svg",{class:"sparkle-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{d:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707"}),e.createElementVNode("circle",{cx:"12",cy:"12",r:"4"})]),e.createElementVNode("span",null,"Workflow Chat")],-1)),e.createElementVNode("button",{onClick:M,class:"clear-btn"},"Clear")]),e.createElementVNode("div",{class:"messages",ref_key:"messagesContainer",ref:k},[l.messages?.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Os,[...c[2]||(c[2]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[e.createElementVNode("rect",{x:"3",y:"11",width:"18",height:"10",rx:"2"}),e.createElementVNode("circle",{cx:"12",cy:"5",r:"2"}),e.createElementVNode("path",{d:"M12 7v4"})],-1),e.createElementVNode("p",null,"Send a message to start the workflow",-1)])])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.messages,(u,$)=>(e.openBlock(),e.createElementBlock("div",{key:$,class:e.normalizeClass(["message",u.role])},[e.createElementVNode("div",Ps,[u.role==="user"?(e.openBlock(),e.createElementBlock("svg",Rs,[...c[3]||(c[3]=[e.createElementVNode("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"},null,-1),e.createElementVNode("circle",{cx:"12",cy:"7",r:"4"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",zs,[...c[4]||(c[4]=[e.createElementVNode("rect",{x:"3",y:"11",width:"18",height:"10",rx:"2"},null,-1),e.createElementVNode("circle",{cx:"12",cy:"5",r:"2"},null,-1),e.createElementVNode("path",{d:"M12 7v4"},null,-1)])]))]),e.createElementVNode("div",Hs,[u.toolCalls&&u.toolCalls.length>0?(e.openBlock(),e.createElementBlock("div",As,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.toolCalls,(f,g)=>(e.openBlock(),e.createElementBlock("div",{key:g,class:"tool-call"},[c[5]||(c[5]=e.createElementVNode("span",{class:"tool-icon"},"🛠️",-1)),e.createElementVNode("span",vs,"Used "+e.toDisplayString(f.function.name),1)]))),128))])):e.createCommentVNode("",!0),u.content?(e.openBlock(),e.createElementBlock("div",Fs,e.toDisplayString(u.content),1)):e.createCommentVNode("",!0),u.nodeId?(e.openBlock(),e.createElementBlock("div",js,"via "+e.toDisplayString(u.nodeId),1)):e.createCommentVNode("",!0)])],2))),128)),l.streamingContent||m.value.value.streamingContent?(e.openBlock(),e.createElementBlock("div",Us,[c[7]||(c[7]=e.createStaticVNode('<div class="message-avatar" data-v-c2838e84><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-c2838e84><rect x="3" y="11" width="18" height="10" rx="2" data-v-c2838e84></rect><circle cx="12" cy="5" r="2" data-v-c2838e84></circle><path d="M12 7v4" data-v-c2838e84></path></svg></div>',1)),e.createElementVNode("div",Ws,[e.createElementVNode("div",Ks,[e.createTextVNode(e.toDisplayString(l.streamingContent||m.value.value.streamingContent),1),c[6]||(c[6]=e.createElementVNode("span",{class:"cursor"},"|",-1))])])])):e.createCommentVNode("",!0)],512),e.createElementVNode("div",qs,[e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":c[0]||(c[0]=u=>V.value=u),onKeydown:B,placeholder:"Type a message...",disabled:m.value.value.isRunning,rows:"1"},null,40,Gs),[[e.vModelText,V.value]]),e.createElementVNode("button",{class:"send-btn",onClick:y,disabled:!V.value.trim()||m.value.value.isRunning},[m.value.value.isRunning?(e.openBlock(),e.createElementBlock("svg",Xs,[...c[8]||(c[8]=[e.createElementVNode("path",{d:"M21 12a9 9 0 11-6.219-8.56"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",Js,[...c[9]||(c[9]=[e.createElementVNode("line",{x1:"22",y1:"2",x2:"11",y2:"13"},null,-1),e.createElementVNode("polygon",{points:"22 2 15 22 11 13 2 9 22 2"},null,-1)])]))],8,Ys)])]))}}),[["__scopeId","data-v-c2838e84"]]),Zs=e.defineComponent({__name:"Controls",setup(l){return(i,s)=>(e.openBlock(),e.createBlock(e.unref(be.Controls)))}}),er=e.defineComponent({__name:"MiniMap",setup(l){return(i,s)=>(e.openBlock(),e.createBlock(e.unref(Qe.MiniMap)))}}),tr={class:"edge-editor"},or={class:"editor-header"},nr={class:"editor-content"},lr={key:0,class:"delete-confirm"},ar=P(e.defineComponent({__name:"EdgeLabelEditor",props:{edge:{},show:{type:Boolean}},emits:["close","update","delete"],setup(l,{emit:i}){const s=l,d=i,a=e.ref(""),N=e.ref(null),o=e.ref(!1);e.watch(()=>s.edge,p=>{p&&(a.value=p.label||"")},{immediate:!0}),e.watch(()=>s.show,p=>{p&&(o.value=!1,e.nextTick(()=>{N.value?.focus(),N.value?.select()}))});function m(){s.edge&&d("update",s.edge.id,a.value)}function E(p){p.key==="Enter"?(m(),d("close")):p.key==="Escape"&&d("close")}function V(){s.edge&&(o.value?(d("delete",s.edge.id),o.value=!1):o.value=!0)}function k(){o.value=!1}return(p,y)=>(e.openBlock(),e.createBlock(e.Transition,{name:"modal"},{default:e.withCtx(()=>[l.show&&l.edge?(e.openBlock(),e.createElementBlock("div",{key:0,class:"edge-editor-overlay",onClick:y[2]||(y[2]=e.withModifiers(M=>d("close"),["self"]))},[e.createElementVNode("div",tr,[e.createElementVNode("div",or,[y[4]||(y[4]=e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",class:"header-icon"},[e.createElementVNode("path",{d:"M12 2H2v10l9.29 9.29c.94.94 2.48.94 3.42 0l6.58-6.58c.94-.94.94-2.48 0-3.42L12 2Z"}),e.createElementVNode("path",{d:"M7 7h.01"})],-1)),y[5]||(y[5]=e.createElementVNode("span",null,"Edge Label",-1)),e.createElementVNode("button",{class:"close-btn",onClick:y[0]||(y[0]=M=>d("close"))},[...y[3]||(y[3]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])])]),e.createElementVNode("div",nr,[e.withDirectives(e.createElementVNode("input",{ref_key:"inputRef",ref:N,"onUpdate:modelValue":y[1]||(y[1]=M=>a.value=M),type:"text",class:"label-input",placeholder:"Enter edge label (e.g., 'Technical', 'Sales')",onInput:m,onKeydown:E},null,544),[[e.vModelText,a.value]]),y[8]||(y[8]=e.createElementVNode("p",{class:"hint"}," This label is shown on the connection line and helps the router make decisions. ",-1)),o.value?(e.openBlock(),e.createElementBlock("div",lr,[y[6]||(y[6]=e.createElementVNode("span",null,"Delete this connection?",-1)),e.createElementVNode("div",{class:"confirm-actions"},[e.createElementVNode("button",{class:"confirm-btn confirm-yes",onClick:V}," Yes, delete "),e.createElementVNode("button",{class:"confirm-btn confirm-no",onClick:k}," Cancel ")])])):(e.openBlock(),e.createElementBlock("button",{key:1,class:"delete-btn",onClick:V},[...y[7]||(y[7]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"3 6 5 6 21 6"}),e.createElementVNode("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})],-1),e.createTextVNode(" Delete Connection ",-1)])]))])])])):e.createCommentVNode("",!0)]),_:1}))}}),[["__scopeId","data-v-ad20c837"]]),sr={class:"title"},rr={class:"header-actions"},ir={key:1,class:"header-count error"},dr={key:2,class:"header-count warning"},cr={key:3,class:"header-count ok"},mr={class:"collapsible-inner"},pr={class:"summary"},ur={key:0,class:"count error"},fr={key:1,class:"count warning"},gr={key:2,class:"count ok"},hr={key:3,class:"timestamp"},kr={key:0,class:"issue-list"},Nr={class:"badge"},Er={class:"details"},yr={class:"message"},Vr={key:0,class:"meta"},br={key:1,class:"meta"},wr=P(e.defineComponent({__name:"ValidationOverlay",props:{editor:{}},setup(l){const i=l,s=e.ref({isValid:!0,errors:[],warnings:[]}),d=e.ref(null),a=e.ref(!0);let N=null,o=null;const m=()=>{s.value=W.validateWorkflow([...i.editor.getNodes()],[...i.editor.getEdges()]),d.value=Date.now()},E=()=>{o&&clearTimeout(o),o=setTimeout(m,120)};e.onMounted(()=>{m(),N=i.editor.on("update",E)}),e.onUnmounted(()=>{N?.(),o&&clearTimeout(o)});const V=e.computed(()=>[...s.value.errors,...s.value.warnings]),k=e.computed(()=>V.value.length===0),p=e.computed(()=>d.value?new Date(d.value).toLocaleTimeString():"");return(y,M)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["validation-overlay",{"has-issues":!k.value}])},[e.createElementVNode("div",{class:"overlay-header",onClick:M[0]||(M[0]=B=>a.value=!a.value)},[e.createElementVNode("div",sr,[e.createElementVNode("span",{class:e.normalizeClass(["status-dot",k.value?"ok":"warn"])},null,2),M[1]||(M[1]=e.createElementVNode("span",null,"Validation",-1))]),e.createElementVNode("div",rr,[a.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"refresh",onClick:e.withModifiers(m,["stop"])}," Re-run ")),a.value&&s.value.errors.length?(e.openBlock(),e.createElementBlock("span",ir,e.toDisplayString(s.value.errors.length)+" error"+e.toDisplayString(s.value.errors.length===1?"":"s"),1)):e.createCommentVNode("",!0),a.value&&s.value.warnings.length?(e.openBlock(),e.createElementBlock("span",dr,e.toDisplayString(s.value.warnings.length)+" warning"+e.toDisplayString(s.value.warnings.length===1?"":"s"),1)):e.createCommentVNode("",!0),a.value&&k.value?(e.openBlock(),e.createElementBlock("span",cr,"All clear")):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["collapse-chevron",{expanded:!a.value}]),width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},[...M[2]||(M[2]=[e.createElementVNode("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],2))])]),e.createElementVNode("div",{class:e.normalizeClass(["collapsible-content",{collapsed:a.value}])},[e.createElementVNode("div",mr,[e.createElementVNode("div",pr,[s.value.errors.length?(e.openBlock(),e.createElementBlock("span",ur,e.toDisplayString(s.value.errors.length)+" error"+e.toDisplayString(s.value.errors.length===1?"":"s"),1)):e.createCommentVNode("",!0),s.value.warnings.length?(e.openBlock(),e.createElementBlock("span",fr,e.toDisplayString(s.value.warnings.length)+" warning"+e.toDisplayString(s.value.warnings.length===1?"":"s"),1)):e.createCommentVNode("",!0),k.value?(e.openBlock(),e.createElementBlock("span",gr,"All clear")):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("span",hr," Updated "+e.toDisplayString(p.value),1)):e.createCommentVNode("",!0)]),V.value.length?(e.openBlock(),e.createElementBlock("div",kr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.value,B=>(e.openBlock(),e.createElementBlock("div",{key:B.code+(B.nodeId||"")+(B.edgeId||"")+B.message,class:e.normalizeClass(["issue",B.type])},[e.createElementVNode("span",Nr,e.toDisplayString(B.type==="error"?"Error":"Warning"),1),e.createElementVNode("div",Er,[e.createElementVNode("div",yr,e.toDisplayString(B.message),1),B.nodeId?(e.openBlock(),e.createElementBlock("div",Vr," Node: "+e.toDisplayString(B.nodeId),1)):B.edgeId?(e.openBlock(),e.createElementBlock("div",br," Edge: "+e.toDisplayString(B.edgeId),1)):e.createCommentVNode("",!0)])],2))),128))])):e.createCommentVNode("",!0)])],2)],2))}}),[["__scopeId","data-v-849827fb"]]);Object.defineProperty(T,"isAgentNodeData",{enumerable:!0,get:()=>W.isAgentNodeData}),Object.defineProperty(T,"isOutputNodeData",{enumerable:!0,get:()=>W.isOutputNodeData}),Object.defineProperty(T,"isParallelNodeData",{enumerable:!0,get:()=>W.isParallelNodeData}),Object.defineProperty(T,"isRouterNodeData",{enumerable:!0,get:()=>W.isRouterNodeData}),Object.defineProperty(T,"isStartNodeData",{enumerable:!0,get:()=>W.isStartNodeData}),T.ChatPanel=Qs,T.Controls=Zs,T.EdgeLabelEditor=ar,T.MiniMap=er,T.NodeInspector=Ts,T.NodePalette=Zo,T.NodeWrapper=J,T.ValidationOverlay=wr,T.WorkflowCanvas=Io,T.createExecutionState=Be,T.createNodeRegistry=Ce,T.defaultNodeRegistry=Se,T.useEditor=Ze,T.useExecutionState=_e,T.useNodeState=ot,T.useWorkflowEditor=we,T.useWorkflowExecution=et,T.useWorkflowStorage=tt,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})}));
|