PageSourceSearch

https://app.ustechautomations.com/assets/GenericNode-D3mYej9X.js

js ustechautomations.com collected 2026-09-26 00:53:24 UTC 60,927 bytes, 1 lines download raw bytes

1import{a as e,p as t}from"./chunk-6CSD65Y2-xYubHBmU.js";import{ax as s,dn as a,a4 as n,c as r,d as o,B as i,d0 as d,bj as l,e as c,b2 as m,dp as u,dq as p,dr as x,K as h,b8 as g,ds as f,k as N,dt as j,I as b,du as v,b4 as y,bK as w,a3 as k,aw as C,cn as _,dv as S,w as M,c6 as D,bN as E,G as A,dw as I,R as T,aj as $,ak as O,al as z,b3 as R,an as B,co as P,cp as F,cq as H,cr as L,cs as U,ct as V,dx as q,cu as J,g as X,dy as K,a7 as W,au as G,dz as Y,ca as Q,dA as Z,a0 as ee}from"./CoreLayout-V9PVLCM0.js";import{G as te,aH as se,B as ae,C as ne,V as re,aE as oe,b6 as ie,J as de}from"./voiceStore-D_K9cjIr.js";import{H as le,u as ce,g as me,i as ue,b as pe,c as xe,e as he,T as ge,s as fe,j as Ne,C as je}from"./TemplateHighlighter-Dw89iKdr.js";import{r as be,i as ve}from"./scheduleNode-DHyM5cSi.js";import{a as ye}from"./resolveIcon-DmlbH-ZS.js";import we from"./CodeModal-Drb_XsDd.js";import ke from"./UpdateComponentModal-DXXukTZn.js";import{C as Ce,b as _e}from"./collapsible-BnskTiB4.js";import{M as Se,r as Me}from"./index-exbxqtqy.js";import{X as De}from"./overlayFocus-BmDVzTk_.js";import{C as Ee}from"./index-BcwKVuK3.js";import{a as Ae,L as Ie}from"./loader-circle-Mux4UJzI.js";import{L as Te,i as $e,P as Oe}from"./ParameterComponent-DD08pvVg.js";import{g as ze}from"./dynamicOptionSources-Bm4s5YpD.js";import{i as Re,N as Be}from"./useOptionsSource-BptJV5_b.js";import{U as Pe}from"./user-BccZgP0Q.js";function Fe(e){return ve(e)}function He(e){if(!Fe(e)||!e.data||"object"!=typeof e.data)return e;const t={...e.data};delete t.nextRunAt,delete t.lastRunAt;const s=t.node&&"object"==typeof t.node?{...t.node}:t.node;return s&&"object"==typeof s&&(delete s.nextRunAt,delete s.lastRunAt,t.node=s),{...e,data:t}}function Le(e){const t="cron"===e.scheduleType?"cron":"interval";return{schedule_type:t,..."cron"===t?{cron_expression:e.cronExpression||"0 9 * * 1-5"}:{interval_minutes:e.intervalMinutes||60},timezone:e.timezone||"America/New_York",is_active:!0===e.isActive}}
1class Ue{async listForWorkflow(e){const t=await te.get(`/workflows/${e}/schedules`);return Array.isArray(t)?t:[]}async create(e,t){return te.post(`/workflows/${e}/schedules`,t)}async update(e,t){return te.patch(`/schedules/${e}`,t)}async remove(e){return te.delete(`/schedules/${e}`)}async reconcileFromFlow(e,t){const s=(t??[]).filter(Fe);if(s.length>1)throw new Error("A workflow may contain at most one Schedule node");const a=s[0]?{source_node_id:s[0].id,...Le(be(s[0]))}:null;return te.put(`/workflows/${e}/canvas-schedule`,{schedule:a})}}const Ve=new Ue,qe=Object.freeze(Object.defineProperty({__proto__:null,default:Ue,isScheduleNode:Fe,readScheduleNodeConfig:be,schedulesAPI:Ve,stripScheduleRuntimeFields:He,toScheduleInput:Le},Symbol.toStringTag,{value:"Module"})),Je=()=>{},Xe=(e,t)=>{},Ke=se(()=>({canUndo:!1,canRedo:!1,undo:Je,redo:Je,recordAdd:Xe,recordRemove:Xe,clearHistory:Je,invalidateRedo:Je,isApplyingHistory:()=>!1,takeSnapshot:Je,resetHistory:Je}));function We(e){const t=Ke.getState();(!e||t.undo===e.undo&&t.redo===e.redo&&t.resetHistory===e.resetHistory)&&Ke.setState({canUndo:!1,canRedo:!1,undo:Je,redo:Je,recordAdd:Xe,recordRemove:Xe,clearHistory:Je,invalidateRedo:Je,isApplyingHistory:()=>!1,takeSnapshot:Je,resetHistory:Je})}const Ge={x:50,y:50};function Ye(e,t=Ge){return function(e,t,s){return{...structuredClone(e),id:t,position:{x:e.position.x+s.x,y:e.position.y+s.y},selected:!0,dragging:!1}}(e,`${e.id}_copy_${Date.now()}_${Math.random().toString(36).substring(2,11)}`,t)}function Qe(t){const{getNodes:a,getEdges:n,setNodes:r,deleteElements:o}=s();return{duplicateNode:e.useCallback(()=>{const e=a(),s=e.find(e=>e.id===t);if(!s)return;const n=Ye(s),o=e.map(e=>e.id===t?{...e,selected:!1}:e);r([...o,n]),Ke.getState().recordAdd([n])},[t,a,r]),deleteNode:e.useCallback(()=>{const e=a().find(e=>e.id===t);if(!e)return;const s=n().filter(e=>e.source===t||e.target===t);Fe(e)&&ae.getState().showWarning("Deleting this Schedule node does not delete server or API-created schedules."),Ke.getState().recordRemove([e],s),o({nodes:[{id:t}]})},[t,a,n,o]),shareNode:e.useCallback(()=>{const e=new URL(window.location.href);e.searchParams.set("node",t),navigator.clipboard?.writeText?navigator.clipboard.writeText(e.toString()).then(()=>{ae.getState().showSuccess("Node link copied to clipboard")},()=>{ae.getState().showError("Failed to copy node link")}):ae.getState().showError("Clipboard is unavailable in this browser context")},[t])}}function Ze(t,s){const a=ne(e=>e.clearNodeExpansionState),n=ne(e=>e.pruneNodeExpansionState);e.useEffect(()=>{a()},[t,a]);const r=e.useMemo(()=>s.map(e=>e.id).join("\0"),[s]);e.useEffect(()=>{n(new Set(r?r.split("\0"):[]))},[r,n])}function et(){const t=ne(e=>e.nodeDensity),s=ne(e=>e.nodeExpandOverrides),a=ne(e=>e.focusExpandedNodeId),n=e.useMemo(()=>{const e=new Set(Object.keys(s||{}));return a&&e.add(a),Array.from(e)},[s,a]);return{isActive:"compact"===t&&n.length>0,overriddenIds:n}}function tt(e){const{isActive:t,overriddenIds:s}=et();return!!t&&!s.includes(e||"")}const st=({zoom:e,density:t,focusExpandedNodeId:s,previousElevatedNodeId:a})=>"compact"!==t||e<=.7?null:s??a,at=e=>"compact"!==e.density||e.zoom<=.7?null:e.selectedNodeId,nt=({nodeDensity:e,hasManualOverride:t,focusExpandedNodeId:s,nodeId:a})=>t||"compact"===e&&s===a?"compact"===e:"compact"!==e,rt=(e,t)=>0===t.size?e:e.map(e=>t.has(e.id)?(e.zIndex??0)>=1?e:{...e,zIndex:1}:e),ot=(e,t)=>{const s=new Map(t.map(e=>[e.id,e])),n=e.map(e=>{if("replace"===e.type){const t=s.get(e.id);if(!t)return e;const a={...e.item};return void 0===t.zIndex?delete a.zIndex:a.zIndex=t.zIndex,{...e,item:a}}if("add"===e.type&&1===e.item.zIndex){const t={...e.item};return delete t.zIndex,{...e,item:t}}return e});return a(n,t)},it=(e,t,s=!1,a=!1,r=!1,o=!1,i=!1,d=!1)=>{const l=((e,t=!1)=>"building"===e?"border-foreground border-[1px] ring-[0.75px] ring-foreground":"error"!==e||t?"":"border-destructive border-[1px] ring-[0.75px] ring-destructive")(t,s),c=((e,t=!1,s=!1,a=!1,r=!1,o=!1,i=!1)=>n(s?e?"border-ring-frozen":"border-frozen":"border",a&&!r&&!o&&i?"border-warning":""))(e,s,a,r,o,i,d);return n(c,l)};function dt(t){const s=ne(e=>
1e.setNode),[a,n]=e.useState(!1),[r,o]=e.useState(!1),i=a&&r,d=e.useCallback(()=>{n(e=>!e)},[]),l=e.useCallback(()=>{n(e=>!e),o(!1)},[]),c=e.useCallback(e=>{s(t,t=>({...t,data:{...t.data,node:{...t.data?.node??{},display_name:e}}}))},[s,t]),m=e.useCallback(e=>{s(t,t=>({...t,data:{...t.data,node:{...t.data?.node??{},description:e}}}))},[s,t]);return{editNameDescription:a,setEditNameDescription:n,hasChangedNodeDescription:r,setHasChangedNodeDescription:o,editedNameDescription:i,toggleEditNameDescription:d,handleEditToggle:l,handleNameChange:c,handleDescriptionChange:m}}const lt={skippedNode:"_skippedNode_198ly_9",runningNode:"_runningNode_198ly_34",completedNode:"_completedNode_198ly_50",failedNode:"_failedNode_198ly_55",errorOverlay:"_errorOverlay_198ly_73",errorOverlayContent:"_errorOverlayContent_198ly_97",errorIcon:"_errorIcon_198ly_103",errorMessage:"_errorMessage_198ly_109",errorTitle:"_errorTitle_198ly_118",errorDetails:"_errorDetails_198ly_123",errorDismiss:"_errorDismiss_198ly_131",dimmedNode:"_dimmedNode_198ly_157",collapsibleBody:"_collapsibleBody_198ly_184",isTransitioning:"_isTransitioning_198ly_172"};function ct({show:s,children:a}){const r=e.useRef(!1),o=e.useRef(s),[i,d]=e.useState(!1);return e.useEffect(()=>{r.current=!0},[]),r.current&&s!==o.current?(o.current=s,i||d(!0)):o.current=s,t.jsx(Ce,{open:s,onOpenChange:()=>{},children:t.jsx(_e,{className:n(lt.collapsibleBody,i&&lt.isTransitioning),onAnimationEnd:()=>d(!1),style:{overflow:i?"hidden":"visible"},children:a})})}const mt=e.memo(({documentationUrl:e,componentName:s="Component",variant:a="icon",className:m})=>{if(!e)return null;const u=t=>{t.stopPropagation(),window.open(e,"_blank","noopener,noreferrer")};return"button"===a?t.jsxs(r,{children:[t.jsx(o,{asChild:!0,children:t.jsxs(i,{variant:"outline",size:"sm",className:n("gap-2",m),onClick:u,children:[t.jsx(d,{className:"h-3.5 w-3.5"}),t.jsx("span",{children:"Documentation"}),t.jsx(l,{className:"h-3 w-3 opacity-50"})]})}),t.jsx(c,{side:"top",children:t.jsxs("p",{children:["Open ",s," documentation",t.jsx("kbd",{className:"ml-2 inline-flex h-5 items-center rounded border bg-muted px-1.5 font-mono text-[10px]",children:"⌘⇧D"})]})})]}):t.jsxs(r,{children:[t.jsx(o,{asChild:!0,children:t.jsx(i,{variant:"ghost",size:"sm",className:n("h-6 w-6 p-0 rounded-full hover:bg-accent/50 transition-colors",m),onClick:u,children:t.jsx(d,{className:"h-3.5 w-3.5 text-muted-foreground"})})}),t.jsx(c,{side:"top",children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{children:"Documentation"}),t.jsx("kbd",{className:"inline-flex h-5 items-center rounded border bg-muted px-1.5 font-mono text-[10px]",children:"⌘⇧D"})]})})]})});mt.displayName="DocumentationLink";const ut=e.memo(({showNode:e,editMode:s,onToggle:a})=>t.jsx("div",{className:"-z-10",children:t.jsx(i,{unstyled:!0,onClick:a,className:n("nodrag absolute left-1/2 z-50 flex h-6 w-6 cursor-pointer items-center justify-center rounded-md","transform transition-all duration-300 ease-out",e?"top-2 translate-x-[10.4rem]":"top-0 translate-x-[6.4rem]",s?"bg-accent-emerald":"bg-zinc-foreground"),"data-testid":s?"save-name-description-button":"edit-name-description-button",children:s?t.jsx(m,{className:n("icon-size text-accent-emerald-foreground"),strokeWidth:2.5}):t.jsx(u,{className:n("icon-size text-muted-foreground"),strokeWidth:2.5})})}));ut.displayName="EditNameDescriptionButton";const pt=e.memo(({showHiddenOutputs:e,onClick:s})=>t.jsx(i,{unstyled:!0,className:"group flex h-6 w-6 items-center justify-center rounded-full border border-border bg-background transition-all duration-200 hover:border-primary hover:bg-accent hover:text-foreground shadow-sm hover:shadow-md",onClick:s,"aria-label":e?"Hide additional outputs":"Show additional outputs",children:e?t.jsx(p,{className:"h-3.5 w-3.5 text-muted-foreground group-hover:text-foreground transition-colors"}):t.jsx(x,{className:"h-3.5 w-3.5 text-muted-foreground group-hover:text-foreground transition-colors"})}));pt.displayName="HiddenOutputsButton";const xt=e.memo(({description:s,selected:a,nodeId:r,charLimit:o=1e3,editNameDescription:i=!1,setEditNameDescription:d,setHasChangedNodeDescription:l,onDescriptionChange:c,emptyPlaceholder:m="",placeholderClassName:u,inputClassName:p,mdClassName:x,style:g,stickyNote:f=!1})=>{const[N,j]=e.useState(s??""),b=e.useRef(null),[v,y]=e.useState(!1);e.useEffect(()=>{j(s??"")},[s]),e.useEffect(()=>{setTimeout(()=>{b.current&&(b.current.clientHeight<b.current.scrollHeight?y(!0):y(!1))},200)},[i]);const w=e.useMemo(()=>e.memo(Se),[]),k=e.useMemo(()=>""!==s&&s?t.jsx("div",{className:n("markdown prose flex w-full flex-col leading-5 word-break-break-word","[&_pre]:whitespace-break-spaces","[&_pre]:!bg-muted","[&_pre_code]:!bg-muted",f?"text-mmd":"text-xs",x),children:t.jsx(w,{remarkPlugins:[Me],components:{a:({node:e,...s})=>t.jsx("a",{...s,target:"_blank",rel:"noopener noreferrer"})},children:String(s)})}):m,[s,m,x,f,w]);return t.jsx("div",{className:n(i?"overflow-hidden":"overflow-auto",v?"nowheel":"",o?"flex flex-col":"","w-full",i&&!f?"px-2":""),children:i?t.jsxs(t.Fragment,{children:[t.jsx(h,{maxLength:o,className:n("nowheel w-full text-xs focus:border-primary focus:ring-0",f?"overflow-auto p-0 px-2 pt-0.5 !text-mmd":"min-h-[2.5rem] !px-3 !py-2",p),style:g,onBlur:()=>{j(N),c?.(N),f&&d?.(!1)},value:N,onChange:e=>{l?.(!0),j(e.target.value)},onKeyDown:e=>{e.stopPropagation(),"Escape"===e.key&&(d?.(!1),j(s??""),f&&(j(N),c?.(N)))}}),o&&(N?.length??0)>=o-100&&t.jsxs("div",{className:n("pt-1 text-left !text-mmd",(N?.length??0)>=o?"text-error":"text-primary",u),"data-testid":"note_char_limit",children:[N?.length??0,"/",o]})]}):t.jsx("div",{"data-testid":"generic-node-desc",ref:b,className:n("nodoubleclick generic-node-desc-text h-full cursor-grab text-muted-foreground word-break-break-word","px-3 py-1",""!==s&&s?"":"font-light italic",u),onDoubleClick:()=>{f&&d?.(!0)},children:k})})});xt.displayName="NodeDescription";const ht=e.memo(({errorMessage:s,errorCode:a,nodeName:r,dismissible:o=!0,onDismiss:i,className:d})=>{const[l,c]=e.useState(!1),m=e.useCallback(()=>{c(!0),i?.()},[i]);if(l)return null;const u=(e=>{switch(e){case"AUTH_001":return"Authentication Failed";case"RATE_001":return"Rate Limited";case"EXEC_002":return"Validation Error";case"EXEC_003":return"Timeout";case"EXEC_004":return"Max Iterations";
1case"EXEC_005":return"Cycle Detected";case"PROV_002":return"Provider Error";default:return"Execution Failed"}})(a),p=(e=>"AUTH_001"===e?t.jsx(g,{className:"h-3.5 w-3.5"}):t.jsx(Ee,{className:"h-3.5 w-3.5"}))(a);return t.jsx("div",{className:n(lt.errorOverlay,d),role:"alert","aria-live":"polite","data-testid":"node-error-overlay",children:t.jsxs("div",{className:lt.errorOverlayContent,children:[t.jsx("div",{className:lt.errorIcon,children:p}),t.jsxs("div",{className:lt.errorMessage,children:[t.jsx("div",{className:lt.errorTitle,children:u}),t.jsx("div",{className:lt.errorDetails,children:s})]}),o&&t.jsx("button",{className:lt.errorDismiss,onClick:m,"aria-label":"Dismiss error",type:"button",children:t.jsx(De,{className:"h-3.5 w-3.5"})})]})})});ht.displayName="NodeErrorOverlay";const gt="_progressBarContainer_1675b_9",ft="_progressBar_1675b_9",Nt="_failedBar_1675b_30",jt={sm:{bar:"h-1",text:"text-xs",icon:"h-3 w-3",container:"gap-1"},md:{bar:"h-1.5",text:"text-xs",icon:"h-3.5 w-3.5",container:"gap-1.5"},lg:{bar:"h-2",text:"text-sm",icon:"h-4 w-4",container:"gap-2"}};function bt(e){if(e<1e3)return"less than 1s";if(e<6e4)return`${Math.ceil(e/1e3)}s`;if(e<36e5){const t=Math.floor(e/6e4),s=Math.ceil(e%6e4/1e3);return s>0?`${t}m ${s}s`:`${t}m`}const t=Math.floor(e/36e5),s=Math.ceil(e%36e5/6e4);return s>0?`${t}h ${s}m`:`${t}h`}const vt=e.memo(({progress:e,size:s="md",showDetails:a=!0,className:i})=>{const d=jt[s],l=function(e){return e.failed>0&&0===e.successful?"bg-destructive":e.failed>0?"bg-yellow-500":"bg-blue-500"}(e),m=e.failed>0,u=e.successful>0&&e.failed>0;return t.jsxs(r,{delayDuration:100,children:[t.jsx(o,{asChild:!0,children:t.jsxs("div",{className:n("flex flex-col",d.container,i),"data-testid":"batch-progress-indicator",children:[t.jsxs("div",{className:n(gt,d.bar),children:[t.jsx("div",{className:n(ft,l,d.bar),style:{transform:`scaleX(${Math.min(e.percentComplete,100)/100})`},"data-testid":"batch-progress-bar"}),m&&t.jsx("div",{className:n(Nt,"bg-destructive/50",d.bar),style:{transform:`translateX(${Math.min(e.successful/e.total*100,100)}%) scaleX(${Math.min(e.failed/e.total,1)})`},"data-testid":"batch-progress-failed-bar"})]}),a&&t.jsxs("div",{className:n("flex items-center justify-between",d.text),children:[t.jsxs("span",{className:"text-muted-foreground",children:[e.processed," / ",e.total]}),t.jsxs("span",{className:n("font-medium",u?"text-yellow-600":"text-blue-500"),children:[e.percentComplete,"%"]})]})]})}),t.jsx(c,{side:"bottom",className:"border border-border bg-popover max-w-xs",children:t.jsx(yt,{progress:e})})]})});vt.displayName="BatchProgressIndicator";const yt=e.memo(({progress:e})=>t.jsxs("div",{className:"space-y-2 p-1",children:[t.jsx("div",{className:"font-medium text-sm",children:"Batch Operation Progress"}),t.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[t.jsx(f,{className:"h-3.5 w-3.5 text-muted-foreground"}),t.jsxs("span",{children:[e.processed," of ",e.total," items processed"]})]}),t.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[e.successful>0&&t.jsxs("div",{className:"flex items-center gap-1 text-accent-emerald-foreground",children:[t.jsx(Ae,{className:"h-3.5 w-3.5"}),t.jsxs("span",{children:[e.successful," successful"]})]}),e.failed>0&&t.jsxs("div",{className:"flex items-center gap-1 text-destructive",children:[t.jsx(Ee,{className:"h-3.5 w-3.5"}),t.jsxs("span",{children:[e.failed," failed"]})]})]}),e.totalChunks>1&&t.jsxs("div",{className:"text-xs text-muted-foreground",children:["Chunk ",e.currentChunk+1," of ",e.totalChunks]}),void 0!==e.estimatedTimeRemainingMs&&e.estimatedTimeRemainingMs>0&&t.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[t.jsx(N,{className:"h-3.5 w-3.5"}),t.jsxs("span",{children:["~",bt(e.estimatedTimeRemainingMs)," remaining"]})]})]}));yt.displayName="BatchProgressTooltipContent";const wt="_runningIndicator_rkaj9_9",kt="_completedIndicator_rkaj9_26",Ct="_failedIndicator_rkaj9_44",_t="_skippedIndicator_rkaj9_61",St={"branch-inactive":"Skipped: Branch condition not met","error-upstream":"Skipped: Upstream node failed","no-trigger-data":"Skipped: Trigger returned no data"},Mt={sm:{icon:"h-3 w-3",container:"h-4 w-4",text:"text-xs"},md:{icon:"h-4 w-4",container:"h-5 w-5",text:"text-sm"},lg:{icon:"h-5 w-5",container:"h-6 w-6",text:"text-base"}},Dt=e.memo(({status:e,errorMessage:s,skipReason:a,size:i="md",showLabel:d=!1,className:l,batchProgress:m})=>{const u=Mt[i];if(!e||"pending"===e)return null;if("running"===e)return t.jsxs("div",{className:n("flex flex-col gap-1",l),"data-testid":"node-execution-status-running",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("div",{className:n(wt,u.container),children:t.jsx(Ie,{className:n(u.icon,"animate-spin text-blue-500")})}),d&&t.jsx("span",{className:n(u.text,"text-blue-500 font-medium"),children:"Running"})]}
1),m&&t.jsx(vt,{progress:m,size:i,showDetails:"sm"!==i,className:"min-w-[80px]"})]});if("completed"===e){const e=m&&m.failed>0,s=m?`${m.successful} of ${m.total} items succeeded${m.failed>0?`, ${m.failed} failed`:""}`:"Node executed successfully";return t.jsxs(r,{delayDuration:100,children:[t.jsx(o,{asChild:!0,children:t.jsxs("div",{className:n("flex flex-col gap-1 cursor-default",l),"data-testid":"node-execution-status-completed",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("div",{className:n(kt,u.container),children:t.jsx(Ae,{className:n(u.icon,e?"text-yellow-500":"text-accent-emerald-foreground")})}),d&&t.jsx("span",{className:n(u.text,"font-medium",e?"text-yellow-500":"text-accent-emerald-foreground"),children:e?"Partial":"Completed"})]}),m&&t.jsxs("div",{className:n("flex items-center gap-1",u.text,"text-muted-foreground"),children:[t.jsxs("span",{children:[m.successful,"/",m.total]}),m.failed>0&&t.jsxs("span",{className:"text-destructive",children:["(",m.failed," failed)"]})]})]})}),t.jsx(c,{side:"bottom",className:n("border bg-success-background",e?"border-yellow-500":"border-accent-emerald-foreground"),children:t.jsx("p",{className:"text-sm",children:s})})]})}if("failed"===e)return t.jsxs(r,{delayDuration:100,children:[t.jsx(o,{asChild:!0,children:t.jsxs("div",{className:n("flex items-center gap-1.5 cursor-help",l),"data-testid":"node-execution-status-failed",children:[t.jsx("div",{className:n(Ct,u.container),children:t.jsx(Ee,{className:n(u.icon,"text-destructive")}
1)}),d&&t.jsx("span",{className:n(u.text,"text-destructive font-medium"),children:"Failed"})]})}),t.jsx(c,{side:"bottom",className:"border border-destructive bg-error-background max-w-xs",children:t.jsxs("div",{className:"space-y-1",children:[t.jsx("p",{className:"text-sm font-medium text-destructive",children:"Execution Failed"}),s&&t.jsx("p",{className:"text-xs text-muted-foreground",children:s})]})})]});if("skipped"===e){const e=a?St[a]:"Node was skipped";return t.jsxs(r,{delayDuration:100,children:[t.jsx(o,{asChild:!0,children:t.jsxs("div",{className:n("flex items-center gap-1.5 cursor-help",_t,l),"data-testid":"node-execution-status-skipped",children:[t.jsx("div",{className:n(u.container),children:t.jsx(j,{className:n(u.icon,"text-muted-foreground opacity-60")})}),d&&t.jsx("span",{className:n(u.text,"text-muted-foreground opacity-60 font-medium"),children:"Skipped"})]})}),t.jsx(c,{side:"bottom",className:"border border-muted bg-muted/50",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:e})})]})}return null});Dt.displayName="NodeExecutionStatus";const Et=e.memo(({icon:e})=>e?t.jsx("div",{className:"node-icon",children:t.jsx(e,{className:"h-5 w-5",strokeWidth:1.5})}):null);Et.displayName="NodeIcon";const At=e.memo(({legacy:e,replacement:s,setDismissAll:a})=>t.jsxs("div",{className:n("flex flex-col w-full items-center gap-3 rounded-t-[0.69rem] border-b bg-muted p-2 px-4 py-2"),children:[t.jsxs("div",{className:"flex items-center gap-3 w-full",children:[t.jsx("div",{className:"h-2.5 w-2.5 rounded-full bg-warning"}),t.jsx("div",{className:"mb-px flex-1 truncate text-mmd font-medium",children:"Legacy"}),t.jsx(i,{variant:"ghost",size:"icon",className:"shrink-0 !text-mmd",onClick:e=>{e.stopPropagation(),a(!0)},"aria-label":"Dismiss warning bar","data-testid":"dismiss-warning-bar",children:"Dismiss"})]}),t.jsx("div",{className:"text-mmd text-muted-foreground w-full",children:s&&Array.isArray(s)&&s.length>0?t.jsxs("span",{className:"block items-center",children:["Use"," ",s.map((e,s)=>t.jsxs("span",{children:[s>0&&", ",t.jsx(i,{variant:"link",className:"!text-accent-pink-foreground !text-mmd !inline-block !h-auto !p-0",onClick:()=>{},children:t.jsx("span",{children:e})})]},e)),"."]}):"No direct replacement."})]}));At.displayName="NodeLegacyComponent";const It=e.memo(({displayName:s,showNode:a,beta:r=!1,legacy:o=!1,editNameDescription:i=!1,nodeId:d,selected:l,toggleEditNameDescription:c,setHasChangedNodeDescription:m,onNameChange:u})=>{const[p,x]=e.useState(s??"");e.useEffect(()=>{x(s??"")},[s]);const h=()=>{""!==p?.trim()?(x(p),u?.(p)):x(s??"")};return i?t.jsx("div",{className:"w-full",children:t.jsx(b,{onBlur:h,value:p,autoFocus:!0,onChange:e=>{x(e.target.value),m?.(!0)},"data-testid":`input-title-${s}`,onKeyDown:e=>{"Enter"===e.key&&(h(),c?.()),"Escape"===e.key&&(x(s??""),c?.())},className:"px-2.5 py-0 h-7 text-base font-medium"})}):t.jsxs("div",{className:"group my-px flex flex-1 items-center gap-2 overflow-hidden",children:[t.jsx("div",{"data-testid":`title-${s}`,className:n("nodoubleclick truncate font-medium text-foreground",a?"cursor-text":"cursor-default"),children:t.jsxs("div",{className:"flex cursor-grab items-center gap-2",children:[t.jsx("span",{className:"cursor-grab truncate text-base leading-6",children:s}),o&&t.jsx("div",{className:"shrink-0",children:t.jsx("div",{className:"flex items-center text-xxs justify-center rounded-sm border border-accent-amber text-accent-amber-foreground px-1",children:"Legacy"})})]})}),r&&t.jsx("div",{className:"shrink-0",children:t.jsx("div",{className:"flex h-4 w-4 items-center justify-center rounded-sm border border-accent-purple-foreground p-0.5 text-xxs",children:"BETA"})})]})});It.displayName="NodeName";const Tt=e.memo(({output:s,nodeId:a,colorName:r,showNode:o,lastOutput:i=!1,isToolMode:d=!1})=>{const l=v(e.useCallback(e=>e.edges.some(e=>e.source===a&&re(e.sourceHandle,s.name)),[a,s.name]));return o?t.jsxs("div",{className:n("relative flex h-11 w-full flex-wrap items-center justify-between bg-node-card-output px-5 py-2",i&&"rounded-b-[15px]",d&&"bg-primary"),children:[t.jsx("div",{className:"flex w-full items-center truncate text-sm",children:t.jsx("div",{className:"flex flex-1 items-center gap-2",children:t.jsx("span",{className:n("px-2 py-1 text-[13px] font-medium",d&&"text-secondary"),children:s.display_name||s.name})})}),t.jsx(le,{left:!1,id:s.name,nodeId:a,showNode:!0,colorName:r[0]||"gray",testId:`${s.name}-output-handle`,type:s.types,connected:l})]}):t.jsx(le,{left:!1,id:s.name,nodeId:a,showNode:!1,colorName:r[0]||"gray",testId:`${s.name}-output-handle`,type:s.types,connected:l})});function $t(e){if(!e)return"0ms";const t="string"==typeof e?parseFloat(e):e;if(isNaN(t))return"0ms";const s=t<100?1e3*t:t;if(s<1e3)return`${Math.round(s)}ms`;if(s<6e4)return`${(s/1e3).toFixed(1)}s`;if(s<36e5){return`${Math.floor(s/6e4)}m ${Math.floor(s%6e4/1e3)}s`}return`${Math.floor(s/36e5)}h ${Math.floor(s%36e5/6e4)}m`}function Ot(e){if(!e)return"Never";const t="number"==typeof e?new Date(e):e,s=(new Date).getTime()-t.getTime();if(s<6e4)return"Just now";if(s<36e5){const e=Math.floor(s/6e4);return`${e} minute${1!==e?"s":""} ago`}if(s<864e5){const e=Math.floor(s/36e5);return`${e} hour${1!==e?"s":""} ago`}if(s<6048e5){const e=Math.floor(s/864e5);return`${e} day${1!==e?"s":""} ago`}return t.toLocaleDateString()}Tt.displayName="NodeOutputField";
1const zt=e.memo(({buildStatus:e="built",validationStatus:s,validationString:a,lastRunTime:r})=>{const o="built"===e&&(s?.valid??!0),i="error"===e||s&&!s.valid,d=s?.data?.duration,l=d?$t(d):null,c=s?.data?.message||a;return t.jsxs("div",{className:"flex flex-col gap-2 p-1 min-w-[200px]",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[o?t.jsx(Ae,{className:"h-4 w-4 text-accent-emerald-foreground"}):i?t.jsx(Ee,{className:"h-4 w-4 text-destructive"}):t.jsx(N,{className:"h-4 w-4 text-muted-foreground"}),t.jsxs("span",{className:n("text-sm font-medium",o&&"text-accent-emerald-foreground",i&&"text-destructive"),children:["built"===e&&"Build Successful","building"===e&&"Building...","error"===e&&"Build Failed","to_build"===e&&"Ready to Build","inactive"===e&&"Inactive"]})]}),l&&t.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[t.jsx(N,{className:"h-3.5 w-3.5"}),t.jsxs("span",{children:["Execution time: ",t.jsx("span",{className:"font-mono",children:l})]})]}),r&&t.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[t.jsx(y,{className:"h-3.5 w-3.5"}),t.jsxs("span",{children:["Last run: ",Ot(r)]})]}),c&&t.jsx("div",{className:n("text-xs mt-1 p-2 rounded-md",i?"bg-destructive/10 text-destructive":"bg-muted text-muted-foreground"),children:c}),s?.data?.outputs&&t.jsxs("div",{className:"text-xs text-muted-foreground mt-1 p-2 rounded-md bg-muted",children:[t.jsx("span",{className:"font-medium",children:"Output:"}),t.jsxs("pre",{className:"mt-1 max-w-xs overflow-hidden text-ellipsis whitespace-nowrap",children:[JSON.stringify(s.data.outputs,null,2).substring(0,100),JSON.stringify(s.data.outputs).length>100&&"..."]})]})]})});zt.displayName="BuildStatusDisplay";const Rt=e.memo(({status:e="idle",buildStatus:s="built",showNode:a,frozen:n=!1,validationStatus:i=null,validationString:d,lastRunTime:l})=>{const m="building"===s;if(n&&"error"!==s)return t.jsxs(r,{delayDuration:100,children:[t.jsx(o,{asChild:!0,children:t.jsx("div",{className:"node-frozen-chip flex h-5 w-5 items-center justify-center rounded-md","data-testid":"node-frozen-indicator",children:t.jsx(w,{className:"h-3.5 w-3.5"})})}),t.jsx(c,{side:"bottom",className:"rounded-xl",children:"Frozen — skipped during runs"})]});const u="built"===s||"to_build"!==s&&i?.valid,p="error"===s,x=i?.data?.duration,h=x?$t(x):null;return u&&h&&a?t.jsxs(r,{delayDuration:100,children:[t.jsx(o,{asChild:!0,children:t.jsx("div",{className:"cursor-help",children:t.jsx("div",{className:"flex rounded-sm px-1 font-mono text-xs text-accent-emerald-foreground transition-colors hover:bg-accent-emerald","data-testid":"node-duration",children:t.jsx("span",{children:h})})})}),t.jsx(c,{side:"bottom",className:"border rounded-xl max-w-md border-accent-emerald-foreground bg-success-background",children:t.jsx(zt,{buildStatus:s,validationStatus:i,validationString:d,lastRunTime:l})})]}):p&&a?t.jsxs(r,{delayDuration:100,children:[t.jsx(o,{asChild:!0,children:t.jsx("div",{className:"cursor-help",children:t.jsx("div",{className:"flex items-center self-center",children:t.jsx(Ee,{className:"h-4 w-4 text-destructive"})})})}),t.jsx(c,{side:"bottom",className:"border rounded-xl max-w-md border-destructive bg-error-background",children:t.jsx(zt,{buildStatus:s,validationStatus:i,validationString:d,lastRunTime:l})})]}):m||"loading"===e?t.jsx("div",{className:"h-5 w-5",children:t.jsx(Ie,{className:"h-4 w-4 animate-spin text-status-blue"})}):"error"===s||"error"===e?t.jsx("div",{className:"h-5 w-5",children:t.jsx(Ee,{className:"h-4 w-4 text-destructive"})}):null});Rt.displayName="NodeStatus";const Bt=e.memo(({nodeId:s,nodeName:a="Node",isCollapsed:d=!1,isFrozen:l=!1,onToggleCollapse:m,onShowCode:u,onShowAdvanced:p,onDuplicate:x,onFreeze:h,onFreezePath:g,onDownload:f,onShare:N,onDelete:j,onUpdate:b,setOpenShowMoreOptions:v})=>{const[y,I]=e.useState(!1),T=e.useRef(null),$=e.useRef(null);e.useEffect(()=>{if(!y)return;const e=e=>{T.current&&!T.current.contains(e.target)&&$.current&&!$.current.contains(e.target)&&I(!1)},t=setTimeout(()=>{document.addEventListener("mousedown",e)},10);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[y]),e.useEffect(()=>{if(!y)return;const e=e=>{"Escape"===e.key&&I(!1)};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[y]),e.useEffect(()=>{v?.(y)},[y,v]);const O=e.useCallback(e=>{e(),I(!1)},[]),z=[h?{key:"freeze",label:l?"Unfreeze":"Freeze",icon:w,onClick:h,testId:"freeze-button-modal",className:l?"text-ice":""}:null,N?{key:"share",label:"Copy link to node",icon:E,onClick:N,testId:"share-button-modal",className:""}:null,j?{key:"delete",label:"Delete",icon:A,onClick:j,testId:"delete-button-modal",className:"text-destructive"}:null].filter(e=>null!==e);return t.jsx("div",{className:"noflow nopan nodelete nodrag",children:t.jsxs("div",{className:"toolbar-wrapper","data-testid":`toolbar-${s}`,children:[m&&t.jsxs(r,{children:[t.jsx(o,{asChild:!0,children:t.jsx(i,{variant:"ghost",size:"node-toolbar",className:"node-toolbar-buttons h-[2rem] w-[2rem]",onClick:e=>{e.stopPropagation(),m()},children:d?t.jsx(k,{className:"h-4 w-4"}):t.jsx(C,{className:"h-4 w-4"})})}),t.jsx(c,{children:t.jsx("p",{className:"text-xs",children:d?"Expand":"Collapse"})})]}),u&&t.jsxs(r,{children:[t.jsx(o,{asChild:!0,children:t.jsx(i,{variant:"ghost",size:"node-toolbar",className:"node-toolbar-buttons h-[2rem] w-[2rem]",onClick:e=>{e.stopPropagation(),u()},children:t.jsx(_,{className:"h-4 w-4"})})}),t.jsx(c,{children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-xs",children:"View Code"}),t.jsx("kbd",{className:"inline-flex h-5 items-center rounded border bg-muted px-1.5 font-mono text-[10px]",children:"Space"})]})})]}),p&&t.jsxs(r,{children:[t.jsx(o,{asChild:!0,children:t.jsx(i,{variant:"ghost",size:"node-toolbar",className:"node-toolbar-buttons h-[2rem] w-[2rem]",onClick:e=>{e.stopPropagation(),p()},"data-testid":"advanced-button-modal",children:t.jsx(S,{className:"h-4 w-4"})})}),t.jsx(c,{children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-xs",children:"Controls"}),t.jsx("kbd",{className:"inline-flex h-5 items-center rounded border bg-muted px-1.5 font-mono text-[10px]",children:"⌘⇧A"})]})})]}),x&&t.jsxs(r,{children:[t.jsx(o,{asChild:!0,children:t.jsx(i,{variant:"ghost",size:"node-toolbar",className:"node-toolbar-buttons h-[2rem] w-[2rem]",onClick:e=>{e.stopPropagation(),x()},"data-testid":"duplicate-button",children:t.jsx(M,{className:"h-4 w-4"})})}),t.jsx(c,{children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-xs",children:"Duplicate"}),t.jsx("kbd",{className:"inline-flex h-5 items-center rounded border bg-muted px-1.5 font-mono text-[10px]",children:"⌘D"})]})})]}),z.length>0&&t.jsxs("div",{className:"relative",children:[t.jsxs(r,{children:[t.jsx(o,{asChild:!0,children:t.jsx(i,{ref:$,variant:"ghost",size:"node-toolbar",className:"node-toolbar-buttons h-[2rem] w-[2rem]",onClick:e=>{e.stopPropagation(),I(!y)},"data-testid":"more-options-modal",children:t.jsx(D,{className:"h-4 w-4"})})}),t.jsx(c,{side:"top",children:t.jsx("p",{className:"text-xs",children:"Show More"})})]}),y&&t.jsx("div",{ref:T,className:n("absolute top-full right-0 mt-1 z-[9999] min-w-[10rem] max-h-[var(--radix-dropdown-menu-content-available-height)]","overflow-y-auto overflow-x-hidden rounded-md border p-0.5 
1shadow-md","animate-in fade-in-0 zoom-in-95"),style:{borderColor:"hsl(var(--border))",backgroundColor:"hsl(var(--popover))",color:"hsl(var(--popover-foreground))"},children:z.map(e=>t.jsxs("button",{className:n("flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-xs transition-colors","outline-none cursor-pointer",e.className),onClick:t=>{t.stopPropagation(),O(e.onClick)},onMouseEnter:t=>{t.currentTarget.style.backgroundColor="delete"===e.key?"hsl(var(--destructive) / 0.1)":"hsl(var(--accent))","delete"!==e.key&&(t.currentTarget.style.color="hsl(var(--accent-foreground))")},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="",e.currentTarget.style.color=""},"data-testid":e.testId,children:[t.jsx(e.icon,{className:"h-3 w-3"}),t.jsx("span",{children:e.label})]},e.key))})]})]})})});Bt.displayName="NodeToolbar";const Pt=e.memo(({hasBreakingChange:e,showNode:s,handleUpdateCode:a,loadingUpdate:r,setDismissAll:o})=>t.jsxs("div",{className:n("flex w-full items-center gap-3 rounded-t-[0.69rem] border-b bg-muted p-2 px-4 py-2"),children:[t.jsx("div",{className:n("h-2.5 w-2.5 rounded-full",e?"bg-warning":"bg-status-green")}),t.jsx("div",{className:"mb-px flex-1 truncate text-mmd font-medium",children:s&&(e?"Update available":"Update ready")}),t.jsx(i,{variant:"ghost",size:"icon",className:"shrink-0 !text-mmd",onClick:e=>{e.stopPropagation(),o(!0)},"aria-label":"Dismiss warning bar","data-testid":"dismiss-warning-bar",children:"Dismiss"}),t.jsx(i,{size:"sm",className:"!h-8 shrink-0 !text-mmd",onClick:e=>{e.stopPropagation(),a()},loading:r,"data-testid":e?"review-button":"update-button",children:e?"Review":"Update"})]}));Pt.displayName="NodeUpdateComponent";const Ft={inputs:"#10B981",outputs:"#AA2411",data:"#198BF6",str:"#4F46E5",Text:"#4F46E5",Message:"#4f46e5",number:"#7E22CF",Document:"#65a30d",Data:"#dc2626",models:"#ab11ab",model_specs:"#6344BE",LanguageModel:"#c026d3",BaseLanguageModel:"#c026d3",embeddings:"#42BAA7",Embeddings:"#10b981",tools:"#00fbfc",Tool:"#00fbfc",agents:"#903BBE",Agent:"#903BBE",AgentExecutor:"#903BBE",prompts:"#4367BF",Prompt:"#7c3aed",chains:"#FE7500",list:"#9AAE42",documentloaders:"#7AAE42",textsplitters:"#B47CB5",vectorstores:"#AA8742",VectorStore:"#AA8742",vectorsearch:"#AA8742",helpers:"#31A3CC",memories:"#F5B85A",toolkits:"#DB2C2C",wrappers:"#E6277A",output_parsers:"#E6A627",retrievers:"#e6b25a",langchain_utilities:"#31A3CC",chat:"#198BF6",thought:"#272541",advanced:"#000000",unknown:"#9CA3AF"},Ht={inputs:"emerald",outputs:"red",data:"sky",str:"indigo",Text:"indigo",Message:"indigo",number:"purple",Document:"lime",Data:"red",models:"fuchsia",model_specs:"violet",LanguageModel:"fuchsia",BaseLanguageModel:"fuchsia",embeddings:"teal",Embeddings:"emerald",tools:"cyan",Tool:"cyan",agents:"purple",Agent:"purple",AgentExecutor:"purple",prompts:"blue",Prompt:"violet",chains:"orange",list:"lime",documentloaders:"lime",textsplitters:"fuchsia",vectorstores:"yellow",VectorStore:"yellow",vectorsearch:"yellow",helpers:"cyan",memories:"amber",toolkits:"red",wrappers:"rose",output_parsers:"yellow",retrievers:"yellow",langchain_utilities:"sky",chat:"sky",thought:"zinc",advanced:"slate",unknown:"gray"};function Lt(e,t,s){const a=e=>Ft[e]??Ft.unknown;if(e&&e.length>0){const t=e.map(e=>Ft[e]).filter(e=>e);if(t.length>0)return t;const n=e.map(e=>a(s[e])).filter(e=>e);if(n.length>0)return n}const n=[a(t||"unknown")];return n.length>0?n:[Ft.unknown]}function Ut(e,t,s){const a=e=>Ht[e]??Ht.unknown;if(e&&e.length>0){const t=e.map(e=>Ht[e]).filter(e=>e);if(t.length>0)return t;const n=e.map(e=>a(s[e])).filter(e=>e);if(n.length>0)return n}const n=[a(t||"unknown")];return n.length>0?n:[Ht.unknown]}function Vt(t,s){const a=ne(e=>e.edges),n=ne(e=>e.nodes),r=I(),o=e.useRef(null),i=e.useMemo(()=>a.find(e=>e.target===t&&re(e.targetHandle,s))||null,[a,t,s]),d=e.useMemo(()=>i&&n.find(e=>e.id===i.source)||null,[i,n]),l=e.useMemo(()=>d?function(e){const t=e.data;return t?.node?.display_name?t.node.display_name:t?.display_name?t.display_name:t?.node?.name?t.node.name:t?.name?t.name:e.id}(d):null,[d]);return e.useEffect(()=>{const e=i?.id||null;o.current!==e&&(o.current=e,r(t))},[i?.id,t,r]),{isLocked:null!==i,connectedEdge:i,sourceNode:d,sourceNodeName:l}}const qt=e.memo(({fieldName:e,onRefresh:s,loading:a=!1})=>t.jsxs(r,{children:[t.jsx(o,{asChild:!0,children:t.jsx(i,{variant:"ghost",size:"sm",className:n("absolute left-0 top-1/2 -translate-y-1/2 h-6 w-6 p-0 rounded-full","hover:bg-accent/50 transition-colors",a&&"cursor-not-allowed opacity-50"),onClick:()=>{!a&&s&&s()},disabled:a,"data-testid":`refresh-${e}`,children:t.jsx(T,{className:n("h-3.5 w-3.5 text-muted-foreground",a&&"animate-spin")})})}),t.jsx(c,{side:"right",children:t.jsx("p",{children:a?"Refreshing...":"Refresh options"})})]}));
1qt.displayName="RefreshButton";const Jt=e.memo(({data:s,nodeId:a,fieldName:r,template:o,type:i,inputTypes:d,colors:l,colorName:c,showNode:m,lastInput:u=!1,isToolMode:p=!1,index:x,hideConnectionLabel:h=!1,textareaReplacement:g})=>{const f=e.useMemo(()=>o.display_name||o.name||r,[o.display_name,o.name,r]),N=!0===o.refresh_button,{isLocked:j,sourceNodeName:b}=Vt(a,r),y=j,w=j,{handleDynamicFieldChange:k}=ce(),C=v(e.useCallback(e=>e.edges.some(e=>e.target===a&&re(e.targetHandle,r)),[a,r])),_=e.useCallback(e=>{k({nodeId:a,fieldName:r,newValue:e})},[a,r,k]),S=e.useMemo(()=>!N&&(!p&&(!!C||(!!(d&&d.length>0)||!(!i||Te.has(i))))),[p,N,C,d,i]),M=e.useMemo(()=>$e(d,i,o.list),[d,i,o.list]),D=e.useMemo(()=>{const e=s;return e.node?.template??e.template??{}},[s]),E=e.useMemo(()=>{if("model_name"===r)return D.provider?.value||D.model_provider?.value},[r,D]),{models:A}=me(E),I=e.useMemo(()=>"model_name"===r&&E&&oe(E)?A:o.options&&o.options.length>0?o.options:void 0,[r,o.options,E,A]),T=ie(e=>e.getApiKeysByProvider),P=e.useMemo(()=>{if("api_key"!==r)return[];const e=D.provider?.value||D.model_provider?.value;if(!e)return[];const t=e.toLowerCase().replace(/ /g,"");return T(t).filter(e=>e.isActive)},[r,D,T]),F=e.useCallback(e=>{_(`usta-api-key://v1/${e}`)},[_]),H=e.useMemo(()=>I?.map(e=>"string"==typeof e?{label:e,value:e}:e),[I]),L=e.useMemo(()=>"segmented"===o.type?"segmented":I&&I.length>0?"select":o.type,[o.type,I]),U=e.useMemo(()=>p?"Used as a tool":o.placeholder,[p,o.placeholder]),V=p||w;return m?t.jsxs("div",{className:n("relative flex min-h-10 w-full flex-wrap items-center justify-between","px-5 py-2","transition-colors duration-150","hover:bg-accent/20",u&&"pb-5",p&&"bg-primary/10",y&&"bg-[hsl(var(--node-accent)/0.05)]","border-b border-border/30 last:border-b-0"),children:[N&&t.jsx(qt,{fieldName:r,onRefresh:()=>{const e=s?.node?.provider??D.provider?.value,t=ze(e,r);e&&t&&Re(e,t.sourceId)}}),S&&t.jsx(le,{left:!0,id:r,nodeId:a,showNode:!0,colorName:c[0]||"gray",testId:`${r}-input-handle`,type:d&&d.length>0?d:i,isConnectionOnly:M,connected:y||C}),!M&&t.jsxs("div",{className:"flex w-full flex-col gap-2",children:[j&&b&&t.jsx("div",{className:"flex w-fit max-w-full items-center rounded-[10px] border px-2.5 py-1 text-xs font-medium",style:{background:"hsl(var(--node-accent) / 0.10)",borderColor:"hsl(var(--node-accent) / 0.24)",color:"hsl(var(--node-accent))"},children:t.jsxs("span",{className:"truncate",children:["Connected to ",b]})}),"api_key"===r&&!j&&P.length>0&&t.jsxs($,{value:"",onValueChange:F,children:[t.jsx(O,{className:"h-7 text-xs",children:t.jsx(z,{placeholder:"Use a saved key…"})}),t.jsx(R,{children:P.map(e=>t.jsxs(B,{value:e.id,children:[e.name," (",e.keyPrefix,")"]},e.id))})]}),o.credential_provider?t.jsx(Be,{provider:o.credential_provider,operation:o.credential_operation,value:o.value||"",onChange:_,disabled:V}):t.jsx(Oe,{id:`${a}-${r}`,nodeId:a,fieldName:r,label:f,type:L,value:o.value,placeholder:j&&b?`Value from ${b}`:U,info:o.info,min:o.min,max:o.max,step:o.step,options:H,required:o.required,disabled:V,onChange:_,multiline:o.multiline,list:o.list,password:o.password,ui_only:o.ui_only,allow_global_variables:o.allow_global_variables,schema:o.schema,validation:o.validation,textareaReplacement:g})]}),M&&!h&&t.jsxs("div",{className:"flex w-full items-center justify-between",children:[t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsxs("span",{className:"text-sm font-medium text-foreground",children:[f,o.required&&t.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground/70",children:"Requires connection"})]}),t.jsx("div",{className:"text-xs text-muted-foreground",children:d?.join(" | ")})]})]}):S?t.jsx(le,{left:!0,id:r,nodeId:a,showNode:!1,colorName:c[0]||"gray",testId:`${r}-input-handle`,type:d&&d.length>0?d:i,isConnectionOnly:M,connected:y||C}):null});Jt.displayName="NodeInputField";const Xt=e.memo(({data:s,showNode:a,nodeId:n,category:r,isToolMode:o=!1,fieldReplacements:i})=>{const d=s,l=e.useMemo(()=>d.node?.template??d.template??{},[d.node?.template,d.template]),c=e.useMemo(()=>ue(l),[l]),m=e.useMemo(()=>d.node?.field_order??d.field_order??[],[d.node?.field_order,d.field_order]),[u,p]=e.useState(!1),x=e.useMemo(()=>{const e=Object.keys(c).filter(e=>!1!==c[e].show);return m&&m.length>0?e.sort((e,t)=>
1{const s=m.indexOf(e),a=m.indexOf(t);return-1!==s&&-1!==a?s-a:-1!==s?-1:-1!==a?1:0}):e},[c,m]),h=e.useMemo(()=>{let e=0;const t=new Map;for(const s of x){const a=c[s];a&&$e(a.input_types,a.type,a.list)&&(t.set(s,e),e++)}return{indexMap:t,total:e}},[x,c]),g=e.useMemo(()=>{const e=new Map,t={};return x.forEach(s=>{const a=c[s];a&&e.set(s,{colors:Lt(a.input_types,a.type,t),colorsName:Ut(a.input_types,a.type,t)})}),e},[x,c]);if(0===x.length)return null;const f=h.total-3;return t.jsxs(t.Fragment,{children:[x.map((e,r)=>((e,r,d=!1)=>{const l=c[e];if(!l||"object"!=typeof l)return null;const m=g.get(e);if(!m)return null;const p=h.indexMap.get(e),x=void 0!==p&&p>=3&&!u;return t.jsx(Jt,{data:s,nodeId:n,fieldName:e,template:l,type:l.type,inputTypes:l.input_types,colors:m.colors,colorName:m.colorsName,showNode:a,lastInput:d,isToolMode:o,index:r,hideConnectionLabel:x,textareaReplacement:i?.[e]},`${n}-${e}-${r}`)})(e,r,r===x.length-1)),a&&f>0&&!u&&t.jsxs("div",{className:"flex cursor-pointer items-center px-5 py-1.5 text-xs text-muted-foreground transition-colors hover:text-foreground",onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),onClick:()=>p(!0),children:["+",f," more connection",f>1?"s":""]})]})});function Kt(e){if(null==e)return"—";if("boolean"==typeof e)return e?"true":"false";if("number"==typeof e)return Number.isInteger(e)?e.toLocaleString():e.toLocaleString(void 0,{maximumFractionDigits:4});if("object"==typeof e)try{return JSON.stringify(e)}catch{return String(e)}return String(e)}Xt.displayName="RenderInputParameters";const Wt=e.memo(function({columns:s,data:a,index:r,maxHeight:o=300,compact:d=!1,pageSize:l=10,className:c}){const[m,u]=e.useState(0),p=a.length,x=Math.ceil(p/l),h=m*l,g=Math.min(h+l,p),f=e.useMemo(()=>a.slice(h,g),[a,h,g]),N=e.useMemo(()=>r?r.slice(h,g):Array.from({length:f.length},(e,t)=>h+t),[r,h,g,f.length]);if(0===s.length||0===a.length)return t.jsx("div",{className:n("text-sm text-muted-foreground italic p-3",c),children:"Empty DataFrame"});if(d){const e=a.slice(0,3);return t.jsxs("div",{className:n("text-xs",c),children:[t.jsxs("div",{className:"flex gap-2 text-muted-foreground mb-1",children:[s.slice(0,3).map((e,s)=>t.jsx("span",{className:"font-medium",children:e},s)),s.length>3&&t.jsxs("span",{children:["+",s.length-3," more"]})]}),t.jsxs("div",{className:"text-foreground",children:[e.length," rows × ",s.length," columns"]})]})}return t.jsxs("div",{className:n("space-y-2",c),children:[t.jsx("div",{className:"overflow-auto rounded-md border",style:{maxHeight:`${o}px`},children:t.jsxs(P,{children:[t.jsx(F,{className:"sticky top-0 bg-muted/80 backdrop-blur-sm",children:t.jsxs(H,{
1children:[t.jsx(L,{className:"w-12 text-center font-mono text-xs",children:"#"}),s.map((e,s)=>t.jsx(L,{className:"font-medium",children:e},s))]})}),t.jsx(U,{children:f.map((e,a)=>t.jsxs(H,{children:[t.jsx(V,{className:"text-center font-mono text-xs text-muted-foreground",children:N[a]}),s.map((s,a)=>t.jsx(V,{className:"font-mono text-xs",children:Kt(e[s])},a))]},a))})]})}),x>1&&t.jsxs("div",{className:"flex items-center justify-between text-xs",children:[t.jsxs("div",{className:"text-muted-foreground",children:["Showing ",h+1,"-",g," of ",p," rows"]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(i,{variant:"outline",size:"icon",className:"h-7 w-7",onClick:()=>u(0),disabled:0===m,children:t.jsx(q,{className:"h-3.5 w-3.5"})}),t.jsx(i,{variant:"outline",size:"icon",className:"h-7 w-7",onClick:()=>u(e=>Math.max(0,e-1)),disabled:0===m,children:t.jsx(J,{className:"h-3.5 w-3.5"})}),t.jsxs("span",{className:"px-2 text-muted-foreground",children:["Page ",m+1," of ",x]}),t.jsx(i,{variant:"outline",size:"icon",className:"h-7 w-7",onClick:()=>u(e=>Math.min(x-1,e+1)),disabled:m===x-1,children:t.jsx(X,{className:"h-3.5 w-3.5"})}),t.jsx(i,{variant:"outline",size:"icon",className:"h-7 w-7",onClick:()=>u(x-1),disabled:m===x-1,children:t.jsx(K,{className:"h-3.5 w-3.5"})})]})]}),x<=1&&t.jsxs("div",{className:"text-xs text-muted-foreground",children:[p," rows × ",s.length," columns"]})]})});const Gt=e.memo(function({content:s,sender:a,timestamp:r,compact:o=!1,className:i}){const d=e.useMemo(()=>function(e){if(!e)return!0;const t=e.toLowerCase();return"assistant"===t||"ai"===t||"bot"===t||"system"===t||t.includes("gpt")||t.includes("claude")||t.includes("llm")}(a),[a]),l=e.useMemo(()=>function(e){return e?e.charAt(0).toUpperCase()+e.slice(1):"Assistant"}(a),[a]),c=e.useMemo(()=>function(e){if(!e)return"";try{const t="string"==typeof e?new Date(e):e;if(isNaN(t.getTime()))return"";const s=new Date;return t.toDateString()===s.toDateString()?t.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):t.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return""}}(r),[r]);return o?t.jsx("div",{className:n("text-sm",i),children:t.jsx("p",{className:"whitespace-pre-wrap break-words",children:s})}):t.jsxs("div",{className:n("flex gap-3",i),children:[t.jsx("div",{className:n("flex-shrink-0 w-8 h-8 rounded-full flex items-center justify-center",d?"bg-primary/10 text-primary":"bg-muted text-muted-foreground"),children:d?t.jsx(W,{className:"h-4 w-4"}):t.jsx(Pe,{className:"h-4 w-4"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[t.jsx("span",{className:"text-sm font-medium text-foreground",children:l}),c&&t.jsx("span",{className:"text-xs text-muted-foreground",children:c})]}),t.jsx("div",{className:n("rounded-lg p-3",d?"bg-muted/50 border border-border/50":"bg-primary/10 border border-primary/20"),children:t.jsx("p",{className:"text-sm whitespace-pre-wrap break-words leading-relaxed",children:s})})]})]})});function Yt(e){if(null==e)return"unknown";if("string"==typeof e){try{const t=JSON.parse(e);if("object"==typeof t&&null!==t)return Yt(t)}catch{}return"text"}if("object"!=typeof e)return"text";if(Array.isArray(e)){if(e.length>0&&"object"==typeof e[0]&&null!==e[0]){const t=e[0],s=Object.keys(t);if(e.every(e=>"object"==typeof e&&null!==e&&Object.keys(e).length===s.length)&&s.length>0)return"dataframe"}return"json"}const t=e;return"content"in t&&"string"==typeof t.content?"message":"columns"in t&&"data"in t&&Array.isArray(t.columns)&&Array.isArray(t.data)?"dataframe":"text"in t&&"string"==typeof t.text?"text":"message"in t&&"string"==typeof t.message?"message":"json"}function Qt(e){if("string"==typeof e)return e;if("object"!=typeof e||null===e)return String(e);const t=e;return"text"in t&&"string"==typeof t.text?t.text:"content"in t&&"string"==typeof t.content?t.content:"message"in t&&"string"==typeof t.message?t.message:String(e)}function Zt(e){switch(e){case"message":return t.jsx(ee,{className:"h-3.5 w-3.5"});case"dataframe":return t.jsx(Z,{className:"h-3.5 w-3.5"});case"json":return t.jsx(Q,{className:"h-3.5 w-3.5"});case"text":return t.jsx(Y,{className:"h-3.5 w-3.5"});default:return t.jsx(G,{className:"h-3.5 w-3.5"})}}function es(e){switch(e){case"message":return"Message";case"dataframe":return"DataFrame";
1case"json":return"JSON";case"text":return"Text";default:return"Unknown"}}const ts=e.memo(function({data:s,maxHeight:a}){const r=e.useMemo(()=>{try{return JSON.stringify(s,null,2)}catch{return String(s)}},[s]),o=e.useMemo(()=>r.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/(&quot;[^&]*(?:&[^q][^&]*)*&quot;)\s*:/g,'<span class="text-blue-500 dark:text-blue-400">$1</span>:').replace(/:\s*(&quot;[^&]*(?:&[^q][^&]*)*&quot;)/g,': <span class="text-green-600 dark:text-green-400">$1</span>').replace(/: (\d+\.?\d*)/g,': <span class="text-amber-600 dark:text-amber-400">$1</span>').replace(/: (true|false)/g,': <span class="text-purple-600 dark:text-purple-400">$1</span>').replace(/: (null)/g,': <span class="text-gray-500 dark:text-gray-400">$1</span>'),[r]);return t.jsx("div",{className:n("overflow-auto rounded-md bg-muted/50 p-3",a&&`max-h-[${a}px]`),style:a?{maxHeight:`${a}px`}:void 0,children:t.jsx("pre",{className:"text-xs font-mono whitespace-pre-wrap break-words",dangerouslySetInnerHTML:{__html:o}})})}),ss=e.memo(function({text:e,maxHeight:s}){return t.jsx("div",{className:n("overflow-auto rounded-md bg-muted/50 p-3",s&&`max-h-[${s}px]`),style:s?{maxHeight:`${s}px`}:void 0,children:t.jsx("pre",{className:"text-sm whitespace-pre-wrap break-words font-sans",children:e})})}),as=e.memo(function({output:s,className:a,maxHeight:r=300,showTypeIndicator:o=!0,compact:i=!1}){const d=e.useMemo(()=>Yt(s),[s]);if(null==s)return t.jsx("div",{className:n("text-sm text-muted-foreground italic p-3",a),children:"No output"});return t.jsxs("div",{className:n("space-y-2",a),children:[o&&!i&&t.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[Zt(d),t.jsx("span",{children:es(d)})]}),(()=>{switch(d){case"message":{const e=s;return t.jsx(Gt,{content:e.content||Qt(s),sender:e.sender||e.role,timestamp:e.timestamp,compact:i})}case"dataframe":{let a;return a=Array.isArray(s)?0===(e=s).length?{columns:[],data:[]}:{columns:Object.keys(e[0]),data:e}:s,t.jsx(Wt,{columns:a.columns,data:a.data,maxHeight:r,compact:i})}case"json":default:return t.jsx(ts,{data:s,maxHeight:r});case"text":return t.jsx(ss,{text:Qt(s),maxHeight:r})}var e})()]})}),ns=["#9CA3AF"],rs=["gray"],os="\0",is=({data:a,selected:r,icon:o,id:i})=>{const d=a.node||{},l=o?ye(d,o):void 0,{display_name:c="",description:m="",template:u={},outputs:p=[],beta:x=!1,legacy:h=!1,replacement:g=[],documentation:f="",field_order:N=[]}=d,{setNodes:j}=s(),b=pe(d.name),y="PromptTemplate"===d.name,w=v(e.useCallback(e=>{if(!b)return"";const t=[];for(const s of e.edges)s.target===i&&null!=s.targetHandle&&t.push(s.targetHandle);return t.sort().join(os)},[b,i])),k=e.useMemo(()=>new Set(w?w.split(os):[]),[w]),C=xe(y?u.template?.value??"":"",b?u.input_variables?.value??"":"",u,k),_=b?C:u,S=e.useMemo(()=>y?Object.entries(_).filter(([,e])=>e._dynamic).map(([e])=>e).join(os):"",[y,_]),M=v(e.useCallback(e=>S?S.split(os).map(t=>{const s=e.edges.find(e=>e.target===i&&e.targetHandle===t);if(!s)return t;const a=e.nodes.find(e=>e.id===s.source),n=a?.data,r=n?.node?.display_name??n?.display_name??n?.node?.name??n?.name??a?.id??s.source;return`${t}${os}${r}`}).join("�"):"",[S,i])),D=e.useMemo(()=>y?new Set(Object.entries(_).filter(([,e])=>e._dynamic||e._custom).map(([e])=>e)):new Set,[y,_]),{customVariables:E,addCustomVariable:A,removeCustomVariable:I,renameCustomVariable:T,updateCustomVariableValue:$}=he(i||"",y?_:{},D,y,j),O=e.useMemo(()=>{if(!y)return E;const e=[],t=M?M.split("�"):[];for(const s of t){const t=s.indexOf(os),a=-1===t?s:s.slice(0,t),n=_[a];n?._dynamic&&e.push({name:a,value:String(n.value??""),isConnected:-1!==t,sourceNodeName:-1===t?null:s.slice(t+1),_isDynamic:!0})}return[...e,...E]},[y,_,E,M]),z=e.useMemo(()=>y?new Set(O.map(e=>e.name)):new Set,[y,O]),R=e.useMemo(()=>{if(y)return{template:e=>t.jsx(ge,{value:e.value,onChange:e.onChange,knownVariables:z,placeholder:e.placeholder,id:e.id,disabled:e.disabled,required:e.required,onBlur:e.onBlur,onFocus:e.onFocus})}},[y,z]),B=a.type||"helpers",P=a.status||"idle",F=a.buildStatus||"built",H=a.isOutdated||!1,L=a.isUserEdited||!1,U=a.hasBreakingChange||!1,[V,q]=e.useState(!1),J=ne(e=>e.nodeDensity),X=ne(e=>Boolean(e.nodeExpandOverrides?.[i||""])),K=ne(e=>e.toggleNodeExpandOverride),W=ne(e=>
1e.setNodeExpanded),G=ne(e=>e.focusExpandedNodeId),Y=nt({nodeDensity:J,hasManualOverride:X,focusExpandedNodeId:G,nodeId:i||""}),[Q,Z]=e.useState(Y),ee=tt(i);e.useEffect(()=>{Z(Y)},[Y]);const te=ne(e=>e.frozenNodes.has(i||"")),se=ne(e=>e.toggleNodeFreeze),[ae]=e.useState(!1),[re,oe]=e.useState(!1),{editNameDescription:ie,setEditNameDescription:le,setHasChangedNodeDescription:ce,editedNameDescription:me,toggleEditNameDescription:ue,handleEditToggle:be,handleNameChange:ve,handleDescriptionChange:Ce}=dt(i),[_e,Se]=e.useState(!1),[Me,De]=e.useState(!1),[Ee,Ae]=e.useState(!1),Ie=e.useMemo(()=>it(r,F,"building"===F,te,H,L,_e,U),[r,F,te,H,L,_e,U]),[Te,$e]=e.useState(!1),Oe=ne(e=>e.requestInspector),ze=de(e=>e.nodeStates.get(i||"")),Re=ze?.status,Be=ze?.error,Pe=ze?.skipReason,Fe=ze?.output,He=ze?.batchProgress,[Le,Ue]=e.useState(!1),Ve=null!=Fe,qe=H&&!L&&!_e&&U,Je=h&&!Me,Xe=e.useCallback(()=>{$e(!0)},[]),Ke=e.useCallback(()=>{Ae(!0),setTimeout(()=>{Ae(!1),Se(!0),$e(!1)},1500)},[i,U]),{duplicateNode:We,deleteNode:Ge,shareNode:Ye}=Qe(i),Ze=e.useCallback(()=>{We()},[We]),et=e.useCallback(()=>{Ge()},[Ge]),st=e.useCallback(()=>{Ye()},[Ye]),at=e.useCallback(()=>{i&&W(i,!Q)},[i,W,Q]),rt=e.useCallback(()=>{i&&K(i)},[i,K]),ot=e.useCallback(()=>{oe(!0)},[]),gt=e.useCallback(()=>{i&&se(i)},[i,se]),ft=e.useCallback(()=>{Oe()},[Oe]),Nt=e.useCallback(()=>{Ve&&Ue(e=>!e)},[Ve]),jt=e.useMemo(()=>"Switch"===d.name?fe(u,p):"Classifier"===d.name?Ne(u,p):p,[d.name,u,p]),bt=e.useMemo(()=>({label:c,description:m,category:B,status:P,buildStatus:F,template:u,outputs:jt,beta:x,legacy:h,replacement:g,isOutdated:H,isUserEdited:L,hasBreakingChange:U,field_order:N}),[c,m,B,P,F,u,jt,x,h,g,H,L,U,N]),vt=e.useMemo(()=>{if(!b)return a;let e=_;if(y){e={};for(const[t,s]of Object.entries(_))"input_variables"!==t&&(s._dynamic||s._custom||(e[t]=s))}return{...a,node:{...a.node,template:e}}},[a,b,y,_]),{shownOutputs:yt,hiddenOutputs:wt}=e.useMemo(()=>{const e=[],t=[];return(jt||[]).forEach(s=>{s.hidden?t.push(s):e.push(s)}),{shownOutputs:e,hiddenOutputs:t}},[jt]),kt=e.useMemo(()=>_&&"object"==typeof _?Object.values(_).filter(e=>!0===e?.advanced&&!1===e?.show).length:0,[_]),Ct=e.useMemo(()=>jt&&jt.length>0,[jt]),_t=e.useMemo(()=>n(Ie,"w-80","generic-node-div group/node relative","rounded-2xl border","transition-opacity duration-200 ease-out","bg-node-card",`node-category-${B}`,r&&"selected",te&&"border-frozen",!Ct&&"pb-4",ee&&lt.dimmedNode,"skipped"===Re&&lt.skippedNode,"running"===Re&&lt.runningNode,"completed"===Re&&lt.completedNode,"failed"===Re&&lt.failedNode),[Ie,B,r,te,Ct,ee,Re]);return t.jsxs("div",{className:qe?"relative -mt-10":"",children:[t.jsxs("div",{className:_t,onDoubleClick:rt,children:[r&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"absolute -top-12 left-1/2 z-50 -translate-x-1/2 transform transition-all duration-300 ease-out",children:t.jsx(Bt,{nodeId:i||"node",nodeName:c,isCollapsed:!Q,isFrozen:te,onToggleCollapse:at,onShowCode:ot,onShowAdvanced:ft,onDuplicate:Ze,onFreeze:gt,onShare:st,onDelete:et})}),t.jsx(ut,{showNode:Q,editMode:me,onToggle:be})]}),qe?t.jsx(Pt,{hasBreakingChange:U,showNode:Q,handleUpdateCode:Xe,loadingUpdate:Ee,setDismissAll:Se}):Je?t.jsx(At,{legacy:h,replacement:g,setDismissAll:De}):null,t.jsxs("div",{"data-testid":`${bt.label}-main-node`,className:n("grid text-wrap leading-5",Q&&"border-b border-border",!Q&&"relative"),children:[t.jsxs("div",{"data-testid":"div-generic-node",className:n("flex w-full flex-1 items-center justify-between gap-2 overflow-hidden","px-4 py-3",ae&&"bg-primary/10 rounded-t-xl"),children:[t.jsxs("div",{className:"flex-max-width items-center overflow-hidden flex",children:[t.jsx(Et,{icon:l,dataType:bt.category}),t.jsxs("div",{className:"ml-3 flex flex-1 items-center gap-2 overflow-hidden",children:[t.jsx("div",{className:"flex-1 overflow-hidden",children:t.jsx(It,{displayName:c,showNode:Q,beta:!1,legacy:h||g&&g.length>0,editNameDescription:ie,nodeId:i,selected:r,toggleEditNameDescription:ue,setHasChangedNodeDescription:ce,onNameChange:ve})}),f&&t.jsx(mt,{documentationUrl:f,componentName:c,variant:"icon"})]})]}),!Q&&t.jsxs("div",{"data-testid":(Q?"show":"hide")+"-node-content",className:"flex items-center gap-1",children:[t.jsx("div",{className:"flex items-center",children:t.jsx(Xt,{data:vt,showNode:!1,nodeId:i||"node",category:B,isToolMode:ae})}),y&&t.jsx(je,{nodeId:i||"node",customVariables:O,onAdd:A,onRemove:I,onRename:T,onValueChange:$,showNode:!1}),t.jsx("div",{className:"flex items-center",children:yt.map((e,s)=>t.jsx(Tt,{output:e,nodeId:i||"node",dataType:B,colors:ns,colorName:rs,showNode:!1,lastOutput:s===yt.length-1,isToolMode:ae},`${i}-collapsed-output-${e.name||s}`))})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Dt,{status:Re,errorMessage:Be,skipReason:Pe,size:"sm",batchProgress:He}),t.jsx(Rt,{status:P,buildStatus:F,selected:r,showNode:Q,frozen:te,isOutdated:H,isUserEdited:L,dismissAll:_e,isBreakingChange:U})]})]}),Q&&m&&t.jsx(xt,{description:m,selected:r,nodeId:i,editNameDescription:ie,setEditNameDescription:le,setHasChangedNodeDescription:ce,onDescriptionChange:Ce})]}),t.jsxs(ct,{show:Q,children:[t.jsxs("div",{className:"nopan nodelete nodrag noflow relative cursor-auto transition-opacity duration-150",onDoubleClick:e=>e.stopPropagation(),children:[t.jsx(Xt,{data:vt,showNode:Q,nodeId:i||"node",category:B,isToolMode:ae,fieldReplacements:R}),y&&t.jsx(je,{nodeId:i||"node",customVariables:O,onAdd:A,onRemove:I,onRename:T,onValueChange:$,showNode:!0})]}),kt>0&&t.jsxs("button",{onClick:ft,onDoubleClick:e=>e.stopPropagation(),className:n("w-full px-3 py-1.5 text-xs text-left flex items-center gap-1.5","text-muted-foreground hover:text-foreground hover:bg-muted/50","transition-colors cursor-pointer border-t border-border"),children:[t.jsx("span",{className:"inline-flex items-center justify-center rounded-full bg-muted px-1.5 py-0.5 text-xs font-medium leading-none",children:kt}),t.jsxs("span",{children:["more ",1===kt?"setting":"settings"]})]}),(yt.length>0||wt.length>0)&&t.jsxs("div",{className:"relative",onDoubleClick:e=>e.stopPropagation(),children:[yt.map((e,s)=>t.jsx(Tt,{output:e,nodeId:i||"node",dataType:B,colors:ns,colorName:rs,showNode:Q,lastOutput:s===yt.length-1&&0===wt.length,isToolMode:ae},`${i}-output-${e.name||s}`)),wt.length>0&&t.jsx("div",{className:"flex items-center justify-center border-t py-2",children:t.jsx(pt,{showHiddenOutputs:V,onClick:()=>q(!V)})}),V&&wt.map((e,s)=>t.jsx(Tt,{output:e,nodeId:i||"node",dataType:B,colors:ns,colorName:rs,showNode:Q,lastOutput:s===wt.length-1,isToolMode:ae},`${i}-hidden-output-${e.name||s}`))]}),Ve&&t.jsxs("div",{className:"border-t border-border",children:[t.jsxs("button",{onClick:Nt,className:n("w-full px-3 py-2 text-xs text-left flex items-center justify-between","hover:bg-muted/50 transition-colors","text-muted-foreground hover:text-foreground"),children:[t.jsx("span",{className:"font-medium",children:Le?"Hide Output":"View Output"}),t.jsx("span",{className:n("transform transition-transform",Le?"rotate-180":""),children:"▼"})]}),Le&&t.jsx("div",{className:"px-3 pb-3",children:t.jsx(as,{output:Fe,maxHeight:200,showTypeIndicator:!0,compact:!1})})]}),"failed"===Re&&Be&&t.jsx(ht,{errorMessage:Be,errorCode:ze?.errorCode,nodeName:c,dismissible:!0})]})]}),t.jsx(we,{open:re,onOpenChange:oe,nodeData:a,nodeId:i||"node"}),t.jsx(ke,{open:Te,onOpenChange:$e,componentName:c,hasBreakingChange:U,currentVersion:"1.0.0",newVersion:"2.0.0",changeDescription:"This update includes improved performance and new configuration options. Some existing parameters have been renamed or restructured.",onUpdate:Ke,isUpdating:Ee})]})};is.displayName="GenericNode";const ds=e.memo(is,(e,t)=>{if(e.selected!==t.selected)return!1;if(e.xPos!==t.xPos||e.yPos!==t.yPos)return!1;const s=e.data,a=t.data;return s?.showNode===a?.showNode&&s?.status===a?.status&&s?.buildStatus===a?.buildStatus&&s?.node?.display_name===a?.node?.display_name&&s?.node?.description===a?.node?.description&&(s?.node?.template!==a?.node?.template?JSON.stringify(s?.node?.template)===JSON.stringify(a?.node?.template):s?.node?.outputs===a?.node?.outputs||JSON.stringify(s?.node?.outputs)===JSON.stringify(a?.node?.outputs))}),ls=Object.freeze(Object.defineProperty({__proto__:null,default:ds},Symbol.toStringTag,{value:"Module"}));
1export{Fe as A,qe as B,ct as C,ls as D,ut as E,ds as G,Bt as N,qt as R,Vt as a,Lt as b,tt as c,dt as d,Qe as e,lt as f,Ut as g,Et as h,It as i,Tt as j,Dt as k,Rt as l,xt as m,ht as n,We as o,Ke as p,Ot as q,nt as r,Ve as s,Ze as t,et as u,ot as v,He as w,at as x,st as y,rt as z};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.