decocms 2.285.1 → 2.286.1
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/client/assets/{AlertCircle-Ljx3VIeb.js → AlertCircle-Bgzr6uRA.js} +1 -1
- package/dist/client/assets/{ArrowNarrowLeft-B8YVT66M.js → ArrowNarrowLeft-ByrdB8Dd.js} +1 -1
- package/dist/client/assets/{CheckCircle-BFRWTTWo.js → CheckCircle-88bls7UK.js} +1 -1
- package/dist/client/assets/{ChevronDown-BqFspEzt.js → ChevronDown-Jd-cYHC-.js} +1 -1
- package/dist/client/assets/{ChevronRight-DCsBjQ-n.js → ChevronRight-71i8ke8L.js} +1 -1
- package/dist/client/assets/{ChevronUp-D7S3j_fa.js → ChevronUp-D_szSdLd.js} +1 -1
- package/dist/client/assets/{Container-SHbLkl7K.js → Container-DWaKXfYv.js} +1 -1
- package/dist/client/assets/DotsVertical-CjXyjLNU.js +1 -0
- package/dist/client/assets/{LinkExternal01-XmkIm96u.js → LinkExternal01-DB08YntP.js} +1 -1
- package/dist/client/assets/{Lock01-CXrm99F-.js → Lock01-dBhVogWg.js} +1 -1
- package/dist/client/assets/{Palette-B46VjX8F.js → Palette-DuWQiO51.js} +1 -1
- package/dist/client/assets/{Play-9pX5w5-3.js → Play-D7pqvkYq.js} +1 -1
- package/dist/client/assets/{Plus-Bmk1thjl.js → Plus-BzxOIhxj.js} +1 -1
- package/dist/client/assets/RefreshCcw01-BxULs6ec.js +1 -0
- package/dist/client/assets/SearchMd-D6tCV38D.js +1 -0
- package/dist/client/assets/{Settings02-C88OtRRq.js → Settings02-MyfUtBA4.js} +1 -1
- package/dist/client/assets/Shield01-CMw4M4Ml.js +1 -0
- package/dist/client/assets/{Star01-fuGmPeeu.js → Star01-DZHrISf9.js} +1 -1
- package/dist/client/assets/{Sun-ndN_CHuQ.js → Sun-C8X8gjZW.js} +1 -1
- package/dist/client/assets/{Tool01-DBxgF1Y_.js → Tool01-BscqkhhO.js} +1 -1
- package/dist/client/assets/{Trash01-BHBjIGXE.js → Trash01-DZpzvWVW.js} +1 -1
- package/dist/client/assets/{User01-DCiwOMBU.js → User01-VHn0SqBP.js} +1 -1
- package/dist/client/assets/{Users03-Bgfd1KM0.js → Users03-DwNyb_q2.js} +1 -1
- package/dist/client/assets/{X-BWV-b86T.js → X-BuUY-erD.js} +1 -1
- package/dist/client/assets/XCircle-BFZeumzD.js +1 -0
- package/dist/client/assets/XClose-ANREDbeo.js +1 -0
- package/dist/client/assets/{Zap-K9sQXDlC.js → Zap-BxJkZzJb.js} +1 -1
- package/dist/client/assets/{ZapSquare-CTcr_tRy.js → ZapSquare-Bz3HDhTc.js} +1 -1
- package/dist/client/assets/{accordion-COmeMo5z.js → accordion-DK_chPAh.js} +1 -1
- package/dist/client/assets/agent-icon-DKQKq---.js +1 -0
- package/dist/client/assets/agents-list-DBdCJGrz.js +1 -0
- package/dist/client/assets/ai-providers-BhNFwI7O.js +1 -0
- package/dist/client/assets/{alert-dialog-DaP8t8su.js → alert-dialog-CtGXaT-Y.js} +2 -2
- package/dist/client/assets/{auth-catchall-CerK6T4u.js → auth-catchall-B4ADnlpm.js} +1 -1
- package/dist/client/assets/automation-list-row-B_yW9vLo.js +1 -0
- package/dist/client/assets/automations-B3iEjSty.js +1 -0
- package/dist/client/assets/{avatar-gTIcZioB.js → avatar-DcLXZkYK.js} +1 -1
- package/dist/client/assets/{badge-DsWPcX1V.js → badge-BJBM0LXp.js} +1 -1
- package/dist/client/assets/brand-context-BahSISOs.js +1 -0
- package/dist/client/assets/{card-CPVRwbgl.js → card-DqrPrhd5.js} +1 -1
- package/dist/client/assets/{chat-context-CZAEwDWp.js → chat-context-DfEaB6Uj.js} +1 -1
- package/dist/client/assets/{checkbox-CPqdqI54.js → checkbox-Dplb_VaM.js} +1 -1
- package/dist/client/assets/collection-detail-KgUZfuij.js +1 -0
- package/dist/client/assets/collection-display-button-DecHBxzk.js +1 -0
- package/dist/client/assets/{collection-search-DgokupF2.js → collection-search-B_zW9IS4.js} +1 -1
- package/dist/client/assets/{collection-search-lfil19IA.js → collection-search-DF-hPm66.js} +1 -1
- package/dist/client/assets/collection-table-wrapper-DG-B8ykv.js +1 -0
- package/dist/client/assets/{collection-tabs-BRY4wHvH.js → collection-tabs-tHg8euhu.js} +1 -1
- package/dist/client/assets/{collections-lJhN2k9k.js → collections-KKlyNHih.js} +1 -1
- package/dist/client/assets/command-Cpu7RbMv.js +1 -0
- package/dist/client/assets/{connection-card-BrctpSfE.js → connection-card-CD0fnfut.js} +1 -1
- package/dist/client/assets/connection-detail-CFY9ol5g.js +1 -0
- package/dist/client/assets/{connection-form-helpers-C1FnnBdL.js → connection-form-helpers-DVewXDLo.js} +1 -1
- package/dist/client/assets/connections-B-Liq5Ll.js +1 -0
- package/dist/client/assets/{constants-D_Nupw5-.js → constants-D7DNenhk.js} +1 -1
- package/dist/client/assets/{constants-D8VkIs2c.js → constants-aD7HJ6sY.js} +1 -1
- package/dist/client/assets/{dialog-BOagZAx2.js → dialog-nGTWjCEa.js} +1 -1
- package/dist/client/assets/{drawer-BRUzFEdi.js → drawer-DyPUsgdj.js} +1 -1
- package/dist/client/assets/dropdown-menu-Cc_jn9Z7.js +1 -0
- package/dist/client/assets/{dynamic-plugin-layout-ltkevohS.js → dynamic-plugin-layout-Bun8S8Gm.js} +1 -1
- package/dist/client/assets/{empty-state-DCK4Z2GX.js → empty-state-CqQa90x5.js} +1 -1
- package/dist/client/assets/{empty-state-BokLRSGE.js → empty-state-DgThOXBB.js} +1 -1
- package/dist/client/assets/{extract-connection-data-V-eInhlP.js → extract-connection-data-Bx0uarS8.js} +1 -1
- package/dist/client/assets/{features-DIBFVG_b.js → features-ekquKatz.js} +1 -1
- package/dist/client/assets/{form-DHQjt1Tk.js → form-DB-TdsHz.js} +1 -1
- package/dist/client/assets/general-BrK_oI6y.js +1 -0
- package/dist/client/assets/{github-repo-picker-CIYxcUMn.js → github-repo-picker-CwCtQ7G3.js} +2 -2
- package/dist/client/assets/{index-DbNFtLRR.js → index-Amg25tew.js} +3 -3
- package/dist/client/assets/index-BCwsJqWc.css +1 -0
- package/dist/client/assets/{index-DvxSs9Po.js → index-BZopUfMN.js} +1 -1
- package/dist/client/assets/{index-gfedyrlZ.js → index-BfYZ2YG_.js} +16 -16
- package/dist/client/assets/{index-uSGXbgq4.js → index-CT9V-xpg.js} +1 -1
- package/dist/client/assets/{index-sYNl3b-7.js → index-CwstDhH7.js} +1 -1
- package/dist/client/assets/{index-CNolBSVE.js → index-DhJrYN5i.js} +22 -22
- package/dist/client/assets/{index-DWOvEgKr.js → index-DtMbbDUN.js} +1 -1
- package/dist/client/assets/{index-BWvVdWtP.js → index-DtdOoKdU.js} +1 -1
- package/dist/client/assets/{index-PT6VRyBL.js → index-DvgxnJsz.js} +1 -1
- package/dist/client/assets/{index-Di0ylaLI.js → index-pD6VF9-w.js} +3 -3
- package/dist/client/assets/{infiniteQueryObserver-B8q-YDXm.js → infiniteQueryObserver-B_9sKQsI.js} +1 -1
- package/dist/client/assets/{input-B8j75XZ_.js → input-COFLoOjb.js} +1 -1
- package/dist/client/assets/{integration-icon-De50Mm7k.js → integration-icon-DKrcAAs9.js} +1 -1
- package/dist/client/assets/{label-KH35YAYU.js → label-BZVcstmy.js} +1 -1
- package/dist/client/assets/{layout-E2py7rYQ.js → layout-Dp5y9gtR.js} +1 -1
- package/dist/client/assets/{login-agOBj-o2.js → login-ComGApTe.js} +1 -1
- package/dist/client/assets/members-CHnKVrrd.js +3 -0
- package/dist/client/assets/{monaco-editor-CzAT2DWn.js → monaco-editor-EL8K9shU.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-k0blCMgl.js → monitoring-stats-row-D9crys0K.js} +1 -1
- package/dist/client/assets/{oauth-callback-ViEW-3g2.js → oauth-callback-B0mEhNIK.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-cSZy9hW7.js → oauth-callback-ai-provider-Dj0EctfO.js} +1 -1
- package/dist/client/assets/{onboarding-CquRdW5q.js → onboarding-czNV0UuI.js} +1 -1
- package/dist/client/assets/{org-layout-DY9vqUg9.js → org-layout-CGtnLM_Q.js} +1 -1
- package/dist/client/assets/{org-plugin-layout-HyePbhDN.js → org-plugin-layout-Ba2ZEzcE.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-tSKwN8yW.js → plugin-empty-state-fmAUJ6xt.js} +1 -1
- package/dist/client/assets/{plugin-header-CgMEgROC.js → plugin-header-3c9kItnR.js} +1 -1
- package/dist/client/assets/{plugin-layout-B0f9qTk_.js → plugin-layout-CUFHRJeM.js} +1 -1
- package/dist/client/assets/{popover-BK6PL-XB.js → popover-Bo1-wNsY.js} +1 -1
- package/dist/client/assets/{profile-C_xBhvj7.js → profile-C4ZfFzUo.js} +1 -1
- package/dist/client/assets/project-app-view-DbITEuQv.js +1 -0
- package/dist/client/assets/registry-CrUw5Sj_.js +2 -0
- package/dist/client/assets/{registry-layout-7nSgT8Ua.js → registry-layout-q6bMBk9s.js} +3 -3
- package/dist/client/assets/{required-auth-layout-D-NWWr5P.js → required-auth-layout-CP-yDaO3.js} +1 -1
- package/dist/client/assets/{reset-password-C7m0cAdE.js → reset-password-CpFcPkI4.js} +1 -1
- package/dist/client/assets/roles-CSJcHSQ8.js +1 -0
- package/dist/client/assets/{scroll-area-Da2hNrch.js → scroll-area-CXUp8wR9.js} +1 -1
- package/dist/client/assets/{search-input-BZmdDW7A.js → search-input-ClG6niuo.js} +1 -1
- package/dist/client/assets/{select-JPYD20it.js → select-Cn3ZnqjJ.js} +1 -1
- package/dist/client/assets/{select-model-DMVU-2Gx.js → select-model-BwE-9vfJ.js} +2 -2
- package/dist/client/assets/settings-layout-dHGH4vpw.js +1 -0
- package/dist/client/assets/{shell-layout-DkN8Q_tp.js → shell-layout-BsqL_vND.js} +1 -1
- package/dist/client/assets/{skeleton-DPqifXUx.js → skeleton-DOcx8lZU.js} +1 -1
- package/dist/client/assets/{sso-BdiVJFM8.js → sso-37Vu3qt9.js} +1 -1
- package/dist/client/assets/{store-D9lb1Gph.js → store-D1kidhJ8.js} +1 -1
- package/dist/client/assets/store-registry-qx_8ffch.js +2 -0
- package/dist/client/assets/{switch-CVtXvreH.js → switch-ihM2hYRH.js} +1 -1
- package/dist/client/assets/{table-C-JSrHQJ.js → table-CAUXYO7-.js} +1 -1
- package/dist/client/assets/{tabs-DtgWLQ6i.js → tabs-DcOxSeRf.js} +1 -1
- package/dist/client/assets/{task-status-DTuLfGhm.js → task-status-CHfFeACA.js} +7 -7
- package/dist/client/assets/{textarea-p_oNKH-r.js → textarea-CsnX9Ktr.js} +1 -1
- package/dist/client/assets/{toggle-group-B6-etMEh.js → toggle-group-_HWF3GFc.js} +1 -1
- package/dist/client/assets/tools-list-A0gJUqTb.js +1 -0
- package/dist/client/assets/{types-BP7V6N8z.js → types-BGXCye_w.js} +1 -1
- package/dist/client/assets/{use-ai-providers-oN1cKhaJ.js → use-ai-providers-DSLKay0D.js} +1 -1
- package/dist/client/assets/{use-collections-BTXUmiDi.js → use-collections-DvPoAlor.js} +1 -1
- package/dist/client/assets/{use-connection-DIvNoxL5.js → use-connection-MU3rXx28.js} +1 -1
- package/dist/client/assets/{use-copy-D8L6lrfC.js → use-copy-tC0v6ypy.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DUKkySGS.js → use-create-virtual-mcp-C-LLRhrB.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-BRc3SX00.js → use-decopilot-events-fHBaJaln.js} +1 -1
- package/dist/client/assets/{use-delete-connection-IDpzSpRp.js → use-delete-connection-CowwQ4CA.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-WKRKMI2J.js → use-infinite-scroll-BUM8dH47.js} +1 -1
- package/dist/client/assets/{use-list-state-Dyh2zhb9.js → use-list-state-Ba4O0IuX.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-tZ37UBLL.js → use-mcp-tools-B5zpuics.js} +1 -1
- package/dist/client/assets/{use-members-AvAHjkiq.js → use-members-Bhu2ZnQb.js} +1 -1
- package/dist/client/assets/{use-mobile-Ctb5URy7.js → use-mobile-C4Yo3nsX.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-CLfSU3ru.js → use-navigate-to-agent-Bx0DB5DW.js} +1 -1
- package/dist/client/assets/{use-org-sso-CmuM4ieo.js → use-org-sso-BK-ft_ER.js} +1 -1
- package/dist/client/assets/use-organization-roles-uEcrMWhG.js +1 -0
- package/dist/client/assets/{use-organization-settings-dQpmtQzl.js → use-organization-settings-CMC2yyUM.js} +1 -1
- package/dist/client/assets/{use-registry-connections-CP0QI7iA.js → use-registry-connections-Biq_9qgb.js} +1 -1
- package/dist/client/assets/{use-status-sounds-CObwI0DY.js → use-status-sounds-DfhTS64d.js} +1 -1
- package/dist/client/assets/{use-tasks-7rX1bsHL.js → use-tasks-DofxyZR4.js} +1 -1
- package/dist/client/assets/{use-view-mode-BkbloGkm.js → use-view-mode-DSeYcON6.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-CDOk_IIy.js → use-virtual-mcp-WT1ZdgMM.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-Gkc0b2zi.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-YePUpUV3.js +1 -0
- package/dist/client/assets/{user-lj8QRtGG.js → user-5oBDTi_W.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-BiPtlB_S.js → view-mode-toggle-BvyYLass.js} +1 -1
- package/dist/client/assets/workflow-DoVF6xyx.js +1 -0
- package/dist/client/assets/workflow-detail-XUi-wHY3.js +1 -0
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +2 -2
- package/dist/server/node_modules/figures/index.d.ts +279 -0
- package/dist/server/node_modules/figures/index.js +292 -0
- package/dist/server/node_modules/{is-fullwidth-code-point → figures}/package.json +16 -20
- package/dist/server/node_modules/figures/readme.md +337 -0
- package/dist/server/node_modules/get-east-asian-width/index.d.ts +60 -0
- package/dist/server/node_modules/get-east-asian-width/index.js +30 -0
- package/dist/server/node_modules/get-east-asian-width/lookup-data.js +18 -0
- package/dist/server/node_modules/get-east-asian-width/lookup.js +135 -0
- package/dist/server/node_modules/get-east-asian-width/package.json +71 -0
- package/dist/server/node_modules/get-east-asian-width/readme.md +65 -0
- package/dist/server/node_modules/get-east-asian-width/utilities.js +24 -0
- package/dist/server/node_modules/ink/build/ansi-tokenizer.d.ts +38 -0
- package/dist/server/node_modules/ink/build/ansi-tokenizer.js +316 -0
- package/dist/server/node_modules/ink/build/ansi-tokenizer.js.map +1 -0
- package/dist/server/node_modules/ink/build/apply-styles.js +175 -0
- package/dist/server/node_modules/ink/build/build-layout.js +77 -0
- package/dist/server/node_modules/ink/build/calculate-wrapped-text.js +53 -0
- package/dist/server/node_modules/ink/build/colorize.d.ts +3 -0
- package/dist/server/node_modules/ink/build/colorize.js +48 -0
- package/dist/server/node_modules/ink/build/colorize.js.map +1 -0
- package/dist/server/node_modules/ink/build/components/AccessibilityContext.d.ts +3 -0
- package/dist/server/node_modules/ink/build/components/AccessibilityContext.js +5 -0
- package/dist/server/node_modules/ink/build/components/AccessibilityContext.js.map +1 -0
- package/dist/server/node_modules/ink/build/components/App.d.ts +18 -0
- package/dist/server/node_modules/ink/build/components/App.js +351 -0
- package/dist/server/node_modules/ink/build/components/App.js.map +1 -0
- package/dist/server/node_modules/ink/build/components/AppContext.d.ts +15 -0
- package/dist/server/node_modules/ink/build/components/AppContext.js +11 -0
- package/dist/server/node_modules/ink/build/components/AppContext.js.map +1 -0
- package/dist/server/node_modules/ink/build/components/BackgroundContext.d.ts +4 -0
- package/dist/server/node_modules/ink/build/components/BackgroundContext.js +3 -0
- package/dist/server/node_modules/ink/build/components/BackgroundContext.js.map +1 -0
- package/dist/server/node_modules/ink/build/components/Box.d.ts +117 -0
- package/dist/server/node_modules/ink/build/components/Box.js +34 -0
- package/dist/server/node_modules/ink/build/components/Box.js.map +1 -0
- package/dist/server/node_modules/ink/build/components/Color.js +62 -0
- package/dist/server/node_modules/ink/build/components/Cursor.d.ts +83 -0
- package/dist/server/node_modules/ink/build/components/Cursor.js +53 -0
- package/dist/server/node_modules/ink/build/components/Cursor.js.map +1 -0
- package/dist/server/node_modules/ink/build/components/CursorContext.d.ts +11 -0
- package/dist/server/node_modules/ink/build/components/CursorContext.js +8 -0
- package/dist/server/node_modules/ink/build/components/CursorContext.js.map +1 -0
- package/dist/server/node_modules/ink/build/components/ErrorBoundary.d.ts +18 -0
- package/dist/server/node_modules/ink/build/components/ErrorBoundary.js +23 -0
- package/dist/server/node_modules/ink/build/components/ErrorBoundary.js.map +1 -0
- package/dist/server/node_modules/ink/build/components/ErrorOverview.d.ts +6 -0
- package/dist/server/node_modules/ink/build/components/ErrorOverview.js +84 -0
- package/dist/server/node_modules/ink/build/components/ErrorOverview.js.map +1 -0
- package/dist/server/node_modules/ink/build/components/FocusContext.d.ts +16 -0
- package/dist/server/node_modules/ink/build/components/FocusContext.js +17 -0
- package/dist/server/node_modules/ink/build/components/FocusContext.js.map +1 -0
- package/dist/server/node_modules/ink/build/components/Newline.d.ts +13 -0
- package/dist/server/node_modules/ink/build/components/Newline.js +8 -0
- package/dist/server/node_modules/ink/build/components/Newline.js.map +1 -0
- package/dist/server/node_modules/ink/build/components/Spacer.d.ts +7 -0
- package/dist/server/node_modules/ink/build/components/Spacer.js +11 -0
- package/dist/server/node_modules/ink/build/components/Spacer.js.map +1 -0
- package/dist/server/node_modules/ink/build/components/Static.d.ts +24 -0
- package/dist/server/node_modules/ink/build/components/Static.js +28 -0
- package/dist/server/node_modules/ink/build/components/Static.js.map +1 -0
- package/dist/server/node_modules/ink/build/components/StderrContext.d.ts +15 -0
- package/dist/server/node_modules/ink/build/components/StderrContext.js +13 -0
- package/dist/server/node_modules/ink/build/components/StderrContext.js.map +1 -0
- package/dist/server/node_modules/ink/build/components/StdinContext.d.ts +22 -0
- package/dist/server/node_modules/ink/build/components/StdinContext.js +19 -0
- package/dist/server/node_modules/ink/build/components/StdinContext.js.map +1 -0
- package/dist/server/node_modules/ink/build/components/StdoutContext.d.ts +15 -0
- package/dist/server/node_modules/ink/build/components/StdoutContext.js +13 -0
- package/dist/server/node_modules/ink/build/components/StdoutContext.js.map +1 -0
- package/dist/server/node_modules/ink/build/components/Text.d.ts +55 -0
- package/dist/server/node_modules/ink/build/components/Text.js +50 -0
- package/dist/server/node_modules/ink/build/components/Text.js.map +1 -0
- package/dist/server/node_modules/ink/build/components/Transform.d.ts +16 -0
- package/dist/server/node_modules/ink/build/components/Transform.js +15 -0
- package/dist/server/node_modules/ink/build/components/Transform.js.map +1 -0
- package/dist/server/node_modules/ink/build/cursor-helpers.d.ts +38 -0
- package/dist/server/node_modules/ink/build/cursor-helpers.js +56 -0
- package/dist/server/node_modules/ink/build/cursor-helpers.js.map +1 -0
- package/dist/server/node_modules/ink/build/devtools-window-polyfill.d.ts +1 -0
- package/dist/server/node_modules/ink/build/devtools-window-polyfill.js +65 -0
- package/dist/server/node_modules/ink/build/devtools-window-polyfill.js.map +1 -0
- package/dist/server/node_modules/ink/build/devtools.d.ts +1 -0
- package/dist/server/node_modules/ink/build/devtools.js +11 -0
- package/dist/server/node_modules/ink/build/devtools.js.map +1 -0
- package/dist/server/node_modules/ink/build/dom.d.ts +56 -0
- package/dist/server/node_modules/ink/build/dom.js +124 -0
- package/dist/server/node_modules/ink/build/dom.js.map +1 -0
- package/dist/server/node_modules/ink/build/experimental/apply-style.js +140 -0
- package/dist/server/node_modules/ink/build/experimental/dom.js +123 -0
- package/dist/server/node_modules/ink/build/experimental/output.js +91 -0
- package/dist/server/node_modules/ink/build/experimental/reconciler.js +141 -0
- package/dist/server/node_modules/ink/build/experimental/renderer.js +81 -0
- package/dist/server/node_modules/ink/build/get-max-width.d.ts +3 -0
- package/dist/server/node_modules/ink/build/get-max-width.js +10 -0
- package/dist/server/node_modules/ink/build/get-max-width.js.map +1 -0
- package/dist/server/node_modules/ink/build/hooks/use-app.d.ts +5 -0
- package/dist/server/node_modules/ink/build/hooks/use-app.js +8 -0
- package/dist/server/node_modules/ink/build/hooks/use-app.js.map +1 -0
- package/dist/server/node_modules/ink/build/hooks/use-cursor.d.ts +12 -0
- package/dist/server/node_modules/ink/build/hooks/use-cursor.js +29 -0
- package/dist/server/node_modules/ink/build/hooks/use-cursor.js.map +1 -0
- package/dist/server/node_modules/ink/build/hooks/use-focus-manager.d.ts +28 -0
- package/dist/server/node_modules/ink/build/hooks/use-focus-manager.js +17 -0
- package/dist/server/node_modules/ink/build/hooks/use-focus-manager.js.map +1 -0
- package/dist/server/node_modules/ink/build/hooks/use-focus.d.ts +29 -0
- package/dist/server/node_modules/ink/build/hooks/use-focus.js +42 -0
- package/dist/server/node_modules/ink/build/hooks/use-focus.js.map +1 -0
- package/dist/server/node_modules/ink/build/hooks/use-input.d.ts +131 -0
- package/dist/server/node_modules/ink/build/hooks/use-input.js +124 -0
- package/dist/server/node_modules/ink/build/hooks/use-input.js.map +1 -0
- package/dist/server/node_modules/ink/build/hooks/use-is-screen-reader-enabled.d.ts +5 -0
- package/dist/server/node_modules/ink/build/hooks/use-is-screen-reader-enabled.js +11 -0
- package/dist/server/node_modules/ink/build/hooks/use-is-screen-reader-enabled.js.map +1 -0
- package/dist/server/node_modules/ink/build/hooks/use-stderr.d.ts +5 -0
- package/dist/server/node_modules/ink/build/hooks/use-stderr.js +8 -0
- package/dist/server/node_modules/ink/build/hooks/use-stderr.js.map +1 -0
- package/dist/server/node_modules/ink/build/hooks/use-stdin.d.ts +5 -0
- package/dist/server/node_modules/ink/build/hooks/use-stdin.js +8 -0
- package/dist/server/node_modules/ink/build/hooks/use-stdin.js.map +1 -0
- package/dist/server/node_modules/ink/build/hooks/use-stdout.d.ts +5 -0
- package/dist/server/node_modules/ink/build/hooks/use-stdout.js +8 -0
- package/dist/server/node_modules/ink/build/hooks/use-stdout.js.map +1 -0
- package/dist/server/node_modules/ink/build/hooks/useInput.js +38 -0
- package/dist/server/node_modules/ink/build/index.d.ts +34 -0
- package/dist/server/node_modules/ink/build/index.js +20 -0
- package/dist/server/node_modules/ink/build/index.js.map +1 -0
- package/dist/server/node_modules/ink/build/ink.d.ts +90 -0
- package/dist/server/node_modules/ink/build/ink.js +637 -0
- package/dist/server/node_modules/ink/build/ink.js.map +1 -0
- package/dist/server/node_modules/ink/build/input-parser.d.ts +7 -0
- package/dist/server/node_modules/ink/build/input-parser.js +154 -0
- package/dist/server/node_modules/ink/build/input-parser.js.map +1 -0
- package/dist/server/node_modules/ink/build/instance.js +205 -0
- package/dist/server/node_modules/ink/build/instances.d.ts +3 -0
- package/dist/server/node_modules/ink/build/instances.js +8 -0
- package/dist/server/node_modules/ink/build/instances.js.map +1 -0
- package/dist/server/node_modules/ink/build/kitty-keyboard.d.ts +23 -0
- package/dist/server/node_modules/ink/build/kitty-keyboard.js +32 -0
- package/dist/server/node_modules/ink/build/kitty-keyboard.js.map +1 -0
- package/dist/server/node_modules/ink/build/layout.d.ts +7 -0
- package/dist/server/node_modules/ink/build/layout.js +33 -0
- package/dist/server/node_modules/ink/build/layout.js.map +1 -0
- package/dist/server/node_modules/ink/build/log-update.d.ts +19 -0
- package/dist/server/node_modules/ink/build/log-update.js +242 -0
- package/dist/server/node_modules/ink/build/log-update.js.map +1 -0
- package/dist/server/node_modules/ink/build/measure-element.d.ts +16 -0
- package/dist/server/node_modules/ink/build/measure-element.js +9 -0
- package/dist/server/node_modules/ink/build/measure-element.js.map +1 -0
- package/dist/server/node_modules/ink/build/measure-text.d.ts +6 -0
- package/dist/server/node_modules/ink/build/measure-text.js +21 -0
- package/dist/server/node_modules/ink/build/measure-text.js.map +1 -0
- package/dist/server/node_modules/ink/build/options.d.ts +52 -0
- package/dist/server/node_modules/ink/build/options.js +2 -0
- package/dist/server/node_modules/ink/build/options.js.map +1 -0
- package/dist/server/node_modules/ink/build/output.d.ts +35 -0
- package/dist/server/node_modules/ink/build/output.js +183 -0
- package/dist/server/node_modules/ink/build/output.js.map +1 -0
- package/dist/server/node_modules/ink/build/parse-keypress.d.ts +22 -0
- package/dist/server/node_modules/ink/build/parse-keypress.js +493 -0
- package/dist/server/node_modules/ink/build/parse-keypress.js.map +1 -0
- package/dist/server/node_modules/ink/build/reconciler.d.ts +4 -0
- package/dist/server/node_modules/ink/build/reconciler.js +274 -0
- package/dist/server/node_modules/ink/build/reconciler.js.map +1 -0
- package/dist/server/node_modules/ink/build/render-background.d.ts +4 -0
- package/dist/server/node_modules/ink/build/render-background.js +25 -0
- package/dist/server/node_modules/ink/build/render-background.js.map +1 -0
- package/dist/server/node_modules/ink/build/render-border.d.ts +4 -0
- package/dist/server/node_modules/ink/build/render-border.js +73 -0
- package/dist/server/node_modules/ink/build/render-border.js.map +1 -0
- package/dist/server/node_modules/ink/build/render-node-to-output.d.ts +14 -0
- package/dist/server/node_modules/ink/build/render-node-to-output.js +147 -0
- package/dist/server/node_modules/ink/build/render-node-to-output.js.map +1 -0
- package/dist/server/node_modules/ink/build/render-to-string.d.ts +38 -0
- package/dist/server/node_modules/ink/build/render-to-string.js +115 -0
- package/dist/server/node_modules/ink/build/render-to-string.js.map +1 -0
- package/dist/server/node_modules/ink/build/render.d.ts +121 -0
- package/dist/server/node_modules/ink/build/render.js +55 -0
- package/dist/server/node_modules/ink/build/render.js.map +1 -0
- package/dist/server/node_modules/ink/build/renderer.d.ts +8 -0
- package/dist/server/node_modules/ink/build/renderer.js +55 -0
- package/dist/server/node_modules/ink/build/renderer.js.map +1 -0
- package/dist/server/node_modules/ink/build/sanitize-ansi.d.ts +2 -0
- package/dist/server/node_modules/ink/build/sanitize-ansi.js +27 -0
- package/dist/server/node_modules/ink/build/sanitize-ansi.js.map +1 -0
- package/dist/server/node_modules/ink/build/screen-reader-update.d.ts +13 -0
- package/dist/server/node_modules/ink/build/screen-reader-update.js +38 -0
- package/dist/server/node_modules/ink/build/screen-reader-update.js.map +1 -0
- package/dist/server/node_modules/ink/build/squash-text-nodes.d.ts +3 -0
- package/dist/server/node_modules/ink/build/squash-text-nodes.js +36 -0
- package/dist/server/node_modules/ink/build/squash-text-nodes.js.map +1 -0
- package/dist/server/node_modules/ink/build/styles.d.ts +240 -0
- package/dist/server/node_modules/ink/build/styles.js +232 -0
- package/dist/server/node_modules/ink/build/styles.js.map +1 -0
- package/dist/server/node_modules/ink/build/utils.d.ts +2 -0
- package/dist/server/node_modules/ink/build/utils.js +4 -0
- package/dist/server/node_modules/ink/build/utils.js.map +1 -0
- package/dist/server/node_modules/ink/build/wrap-text.d.ts +3 -0
- package/dist/server/node_modules/ink/build/wrap-text.js +31 -0
- package/dist/server/node_modules/ink/build/wrap-text.js.map +1 -0
- package/dist/server/node_modules/ink/build/write-synchronized.d.ts +4 -0
- package/dist/server/node_modules/ink/build/write-synchronized.js +7 -0
- package/dist/server/node_modules/ink/build/write-synchronized.js.map +1 -0
- package/dist/server/node_modules/{is-unicode-supported → ink}/license +1 -0
- package/dist/server/node_modules/ink/package.json +201 -0
- package/dist/server/node_modules/ink/readme.md +2636 -0
- package/dist/server/node_modules/slice-ansi/index.d.ts +19 -0
- package/dist/server/node_modules/slice-ansi/index.js +260 -0
- package/dist/server/node_modules/{is-fullwidth-code-point → slice-ansi}/license +1 -0
- package/dist/server/node_modules/slice-ansi/package.json +59 -0
- package/dist/server/node_modules/slice-ansi/readme.md +54 -0
- package/dist/server/node_modules/slice-ansi/tokenize-ansi.js +752 -0
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/SearchMd-VdXbz8fL.js +0 -1
- package/dist/client/assets/XCircle-BiHPX6_R.js +0 -1
- package/dist/client/assets/agent-icon-DCE-D-qC.js +0 -1
- package/dist/client/assets/agents-list-8_yOp3iD.js +0 -1
- package/dist/client/assets/ai-providers-DxQNSEJT.js +0 -1
- package/dist/client/assets/automation-list-row-BWjwKsQ5.js +0 -1
- package/dist/client/assets/automations-D6LOd0hH.js +0 -1
- package/dist/client/assets/brand-context-CnnwTWNT.js +0 -1
- package/dist/client/assets/collection-detail-BTibo6D3.js +0 -1
- package/dist/client/assets/collection-display-button-CfjJ9SIP.js +0 -1
- package/dist/client/assets/collection-table-wrapper-B4l_6tOy.js +0 -1
- package/dist/client/assets/command-BPSv-8-5.js +0 -1
- package/dist/client/assets/connection-detail-DgKIsKao.js +0 -1
- package/dist/client/assets/connections-rM_I7gvv.js +0 -1
- package/dist/client/assets/dropdown-menu-DO26Q0bD.js +0 -1
- package/dist/client/assets/general-VnUbEBHT.js +0 -1
- package/dist/client/assets/index-DeSgX7LP.css +0 -1
- package/dist/client/assets/members-6PieW-Nu.js +0 -3
- package/dist/client/assets/project-app-view-EMrqjiux.js +0 -1
- package/dist/client/assets/registry-CYL2cMC0.js +0 -2
- package/dist/client/assets/settings-layout-hwviWS6Q.js +0 -1
- package/dist/client/assets/store-registry-DAeO63_G.js +0 -2
- package/dist/client/assets/tools-list-C0RCBhOc.js +0 -1
- package/dist/client/assets/useInfiniteQuery-Ci00Hw-m.js +0 -1
- package/dist/client/assets/workflow-BrBlpNSn.js +0 -1
- package/dist/client/assets/workflow-detail-NqGVn5hy.js +0 -1
- package/dist/server/node_modules/ansi-regex/index.d.ts +0 -33
- package/dist/server/node_modules/ansi-regex/index.js +0 -14
- package/dist/server/node_modules/ansi-regex/package.json +0 -61
- package/dist/server/node_modules/ansi-regex/readme.md +0 -66
- package/dist/server/node_modules/emoji-regex/LICENSE-MIT.txt +0 -20
- package/dist/server/node_modules/emoji-regex/README.md +0 -107
- package/dist/server/node_modules/emoji-regex/index.d.ts +0 -3
- package/dist/server/node_modules/emoji-regex/index.js +0 -4
- package/dist/server/node_modules/emoji-regex/index.mjs +0 -4
- package/dist/server/node_modules/emoji-regex/package.json +0 -45
- package/dist/server/node_modules/environment/index.d.ts +0 -74
- package/dist/server/node_modules/environment/index.js +0 -47
- package/dist/server/node_modules/environment/package.json +0 -74
- package/dist/server/node_modules/environment/readme.md +0 -94
- package/dist/server/node_modules/escape-string-regexp/index.d.ts +0 -18
- package/dist/server/node_modules/escape-string-regexp/index.js +0 -11
- package/dist/server/node_modules/escape-string-regexp/license +0 -9
- package/dist/server/node_modules/escape-string-regexp/package.json +0 -43
- package/dist/server/node_modules/escape-string-regexp/readme.md +0 -29
- package/dist/server/node_modules/is-fullwidth-code-point/index.d.ts +0 -17
- package/dist/server/node_modules/is-fullwidth-code-point/index.js +0 -12
- package/dist/server/node_modules/is-fullwidth-code-point/readme.md +0 -31
- package/dist/server/node_modules/is-unicode-supported/index.d.ts +0 -12
- package/dist/server/node_modules/is-unicode-supported/index.js +0 -21
- package/dist/server/node_modules/is-unicode-supported/package.json +0 -47
- package/dist/server/node_modules/is-unicode-supported/readme.md +0 -35
- package/dist/server/node_modules/restore-cursor/index.d.ts +0 -11
- package/dist/server/node_modules/restore-cursor/index.js +0 -11
- package/dist/server/node_modules/restore-cursor/license +0 -9
- package/dist/server/node_modules/restore-cursor/package.json +0 -55
- package/dist/server/node_modules/restore-cursor/readme.md +0 -31
- package/dist/server/node_modules/string-width/index.d.ts +0 -39
- package/dist/server/node_modules/string-width/index.js +0 -82
- package/dist/server/node_modules/string-width/license +0 -9
- package/dist/server/node_modules/string-width/package.json +0 -64
- package/dist/server/node_modules/string-width/readme.md +0 -66
- /package/dist/server/node_modules/{ansi-regex → figures}/license +0 -0
- /package/dist/server/node_modules/{environment → get-east-asian-width}/license +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{ci as ne,e as _,j as o,B as te,l as ln,bc as ze,cj as ms,r as T,s as oe,c as O,g as ps,o as cn,c4 as xs,ah as hs,ai as fe,aW as an,c5 as gs,aT as bs,c3 as js,c6 as dn,b6 as Ss,cc as ys,cd as vs,ao as ws,ce as Ns,ck as $t,cl as un,z as ks,D as _s,cm as Cs,cn as Is}from"./index-CNolBSVE.js";import{D as Ts,F as Es,B as $s}from"./index-DWOvEgKr.js";import{b as Fe,i as Os,u as ae}from"./constants-D8VkIs2c.js";import{u as fn}from"./use-virtual-mcp-CDOk_IIy.js";import{M as Re}from"./monaco-editor-CzAT2DWn.js";import{S as Rs,A as Ms,c as Ls,a as Ps,b as As,e as zs,R as qt,d as Ws}from"./accordion-COmeMo5z.js";import{B as le}from"./badge-DsWPcX1V.js";import{S as vt,a as wt,b as nt,d as Nt,c as kt}from"./select-JPYD20it.js";import{N as Ds,j as Fs,k as Hs,m as Be,P as Vs,i as qs,R as Us,c as Ks,l as Bs,f as Ut,d as Xs,S as st,n as Js,e as Gs}from"./scroll-area-Da2hNrch.js";import{V as Qs}from"./view-mode-toggle-BiPtlB_S.js";import{af as Ys,ag as Zs,j as eo,ah as mn,ai as to,d as no,L as so,aj as pn,s as Ot,a0 as oo,Y as xn,ak as ro,al as io,W as bt,am as lo}from"./agent-icon-DCE-D-qC.js";import{i as hn}from"./Play-9pX5w5-3.js";import{b as co,a as ao,V as Qe}from"./layout-E2py7rYQ.js";import{T as gn,c as bn,a as jn,b as Sn}from"./use-mobile-Ctb5URy7.js";import{u as uo,b as fo}from"./use-connection-DIvNoxL5.js";import{u as Rt,d as Mt,b as yn}from"./use-mcp-tools-tZ37UBLL.js";import{a as mo,D as po,e as xo,b as ho,c as go,d as bo}from"./dialog-BOagZAx2.js";import"./index-DvxSs9Po.js";import{c as vn,d as wn,e as Nn,D as Ye}from"./dropdown-menu-DO26Q0bD.js";import{s as jo}from"./Plus-Bmk1thjl.js";import{b as kn}from"./Tool01-DBxgF1Y_.js";import{i as He}from"./ChevronDown-BqFspEzt.js";import{I as Lt}from"./integration-icon-De50Mm7k.js";import"./index-sYNl3b-7.js";import{i as _n}from"./X-BWV-b86T.js";import{u as Cn,a as So}from"./use-collections-BTXUmiDi.js";import{E as In}from"./empty-state-DCK4Z2GX.js";import{c as yo}from"./create-sse-subscription-CxkOgzKf.js";import{I as Kt}from"./input-B8j75XZ_.js";const Tn=ne("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const En=ne("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);const ot=ne("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const rt=ne("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const vo=ne("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const $n=ne("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const wo=ne("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const On=ne("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const Rn=ne("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);const Mn=ne("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const No=ne("OctagonAlert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]]);const Ln=ne("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const Pn=ne("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const ko=ne("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const An=ne("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);function _o(t){const e=_.c(15),{onSave:n,onUndo:s,isDirty:i,isSaving:r,saveLabel:l,undoLabel:c}=t,a=l===void 0?"Save":l,d=c===void 0?"Undo":c;if(!i)return null;let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=o.jsx(Ys,{size:14}),e[0]=u):u=e[0];let f;e[1]!==r||e[2]!==s||e[3]!==d?(f=o.jsxs(te,{variant:"outline",size:"sm",onClick:s,disabled:r,"aria-label":d,children:[u,d]}),e[1]=r,e[2]=s,e[3]=d,e[4]=f):f=e[4];let m;e[5]!==r?(m=r?o.jsx(ln,{size:14,className:"animate-spin"}):o.jsx(Zs,{size:14}),e[5]=r,e[6]=m):m=e[6];let x;e[7]!==r||e[8]!==n||e[9]!==a||e[10]!==m?(x=o.jsxs(te,{variant:"default",size:"sm",onClick:n,disabled:r,"aria-label":a,children:[m,a]}),e[7]=r,e[8]=n,e[9]=a,e[10]=m,e[11]=x):x=e[11];let p;return e[12]!==f||e[13]!==x?(p=o.jsxs(o.Fragment,{children:[f,x]}),e[12]=f,e[13]=x,e[14]=p):p=e[14],p}const Bt=t=>{let e;const n=new Set,s=(d,u)=>{const f=typeof d=="function"?d(e):d;if(!Object.is(f,e)){const m=e;e=u??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(x=>x(e,m))}},i=()=>e,c={setState:s,getState:i,getInitialState:()=>a,subscribe:d=>(n.add(d),()=>n.delete(d))},a=e=t(s,i,c);return c},Pt=(t=>t?Bt(t):Bt),Co=t=>t;function _t(t,e=Co){const n=ze.useSyncExternalStore(t.subscribe,ze.useCallback(()=>e(t.getState()),[t,e]),ze.useCallback(()=>e(t.getInitialState()),[t,e]));return ze.useDebugValue(n),n}const Io=t=>{const e=Pt(t),n=s=>_t(e,s);return Object.assign(n,e),n},To=(t=>Io);function zn(t,e){let n;try{n=t()}catch{return}return{getItem:i=>{var r;const l=a=>a===null?null:JSON.parse(a,void 0),c=(r=n.getItem(i))!=null?r:null;return c instanceof Promise?c.then(l):l(c)},setItem:(i,r)=>n.setItem(i,JSON.stringify(r,void 0)),removeItem:i=>n.removeItem(i)}}const Ct=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(s){return Ct(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return Ct(s)(n)}}}},Eo=(t,e)=>(n,s,i)=>{let r={storage:zn(()=>window.localStorage),partialize:g=>g,version:0,merge:(g,b)=>({...b,...g}),...e},l=!1,c=0;const a=new Set,d=new Set;let u=r.storage;if(!u)return t((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${r.name}', the given storage is currently unavailable.`),n(...g)},s,i);const f=()=>{const g=r.partialize({...s()});return u.setItem(r.name,{state:g,version:r.version})},m=i.setState;i.setState=(g,b)=>(m(g,b),f());const x=t((...g)=>(n(...g),f()),s,i);i.getInitialState=()=>x;let p;const h=()=>{var g,b;if(!u)return;const S=++c;l=!1,a.forEach(y=>{var j;return y((j=s())!=null?j:x)});const v=((b=r.onRehydrateStorage)==null?void 0:b.call(r,(g=s())!=null?g:x))||void 0;return Ct(u.getItem.bind(u))(r.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==r.version){if(r.migrate){const j=r.migrate(y.state,y.version);return j instanceof Promise?j.then(w=>[!0,w]):[!0,j]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,y.state];return[!1,void 0]}).then(y=>{var j;if(S!==c)return;const[w,N]=y;if(p=r.merge(N,(j=s())!=null?j:x),n(p,!0),w)return f()}).then(()=>{S===c&&(v?.(s(),void 0),p=s(),l=!0,d.forEach(y=>y(p)))}).catch(y=>{S===c&&v?.(void 0,y)})};return i.persist={setOptions:g=>{r={...r,...g},g.storage&&(u=g.storage)},clearStorage:()=>{u?.removeItem(r.name)},getOptions:()=>r,rehydrate:()=>h(),hasHydrated:()=>l,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(d.add(g),()=>{d.delete(g)})},r.skipHydration||h(),p||x},Wn=Eo,{useSyncExternalStoreWithSelector:$o}=ms,Oo=t=>t;function Ro(t,e=Oo,n){const s=$o(t.subscribe,t.getState,t.getInitialState,e,n);return ze.useDebugValue(s),s}const Xt=t=>Symbol.iterator in t,Jt=t=>"entries"in t,Gt=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),s=e instanceof Map?e:new Map(e.entries());if(n.size!==s.size)return!1;for(const[i,r]of n)if(!s.has(i)||!Object.is(r,s.get(i)))return!1;return!0},Mo=(t,e)=>{const n=t[Symbol.iterator](),s=e[Symbol.iterator]();let i=n.next(),r=s.next();for(;!i.done&&!r.done;){if(!Object.is(i.value,r.value))return!1;i=n.next(),r=s.next()}return!!i.done&&!!r.done};function Lo(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:Xt(t)&&Xt(e)?Jt(t)&&Jt(e)?Gt(t,e):Mo(t,e):Gt({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function Dn(t,e="Output"){if(!t)return`interface ${e} {}`;function n(r){if(!r||typeof r!="object")return"unknown";const l=r.type;if(Array.isArray(l))return l.map(c=>s(c)).join(" | ");switch(l){case"string":return r.enum?r.enum.map(c=>`"${c}"`).join(" | "):"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";case"array":{const c=r.items;return c?`${n(c)}[]`:"unknown[]"}case"object":return i(r);default:return r.anyOf?r.anyOf.map(n).join(" | "):r.oneOf?r.oneOf.map(n).join(" | "):r.allOf?r.allOf.map(n).join(" & "):"unknown"}}function s(r){switch(r){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";default:return"unknown"}}function i(r){const l=r.properties;if(!l)return"Record<string, unknown>";const c=new Set(r.required||[]);return`{
|
|
1
|
+
import{ci as ne,e as _,j as o,B as te,l as ln,bc as ze,cj as ms,r as T,s as oe,c as O,g as ps,o as cn,c4 as xs,ah as hs,ai as fe,aW as an,c5 as gs,aT as bs,c3 as js,c6 as dn,b6 as Ss,cc as ys,cd as vs,ao as ws,ce as Ns,ck as $t,cl as un,z as ks,D as _s,cm as Cs,cn as Is}from"./index-DhJrYN5i.js";import{D as Ts,F as Es,B as $s}from"./index-DtMbbDUN.js";import{b as Fe,i as Os,u as ae}from"./constants-aD7HJ6sY.js";import{u as fn}from"./use-virtual-mcp-WT1ZdgMM.js";import{M as Re}from"./monaco-editor-EL8K9shU.js";import{S as Rs,A as Ms,c as Ls,a as Ps,b as As,e as zs,R as qt,d as Ws}from"./accordion-DK_chPAh.js";import{B as le}from"./badge-BJBM0LXp.js";import{S as vt,a as wt,b as nt,d as Nt,c as kt}from"./select-Cn3ZnqjJ.js";import{N as Ds,j as Fs,k as Hs,m as Be,P as Vs,i as qs,R as Us,c as Ks,l as Bs,f as Ut,d as Xs,S as st,n as Js,e as Gs}from"./scroll-area-CXUp8wR9.js";import{V as Qs}from"./view-mode-toggle-BvyYLass.js";import{a7 as Ys,a8 as Zs,h as eo,a9 as mn,aa as to,d as no,I as so,ab as pn,Z as oo,V as xn,ac as ro,ad as io,T as bt,ae as lo}from"./agent-icon-DKQKq---.js";import{i as hn}from"./Play-D7pqvkYq.js";import{b as co,a as ao,V as Qe}from"./layout-Dp5y9gtR.js";import{T as gn,c as bn,a as jn,b as Sn}from"./use-mobile-C4Yo3nsX.js";import{u as uo,b as fo}from"./use-connection-MU3rXx28.js";import{u as Ot,d as Rt,b as yn}from"./use-mcp-tools-B5zpuics.js";import{a as mo,D as po,e as xo,b as ho,c as go,d as bo}from"./dialog-nGTWjCEa.js";import"./index-BZopUfMN.js";import{c as vn,d as wn,e as Nn,D as Ye}from"./dropdown-menu-Cc_jn9Z7.js";import{s as jo}from"./Plus-BzxOIhxj.js";import{b as kn}from"./Tool01-BscqkhhO.js";import{i as He}from"./ChevronDown-Jd-cYHC-.js";import{s as Mt}from"./XClose-ANREDbeo.js";import{I as Lt}from"./integration-icon-DKrcAAs9.js";import"./index-CwstDhH7.js";import{i as _n}from"./X-BuUY-erD.js";import{u as Cn,a as So}from"./use-collections-DvPoAlor.js";import{E as In}from"./empty-state-CqQa90x5.js";import{c as yo}from"./create-sse-subscription-CxkOgzKf.js";import{I as Kt}from"./input-COFLoOjb.js";const Tn=ne("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const En=ne("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);const ot=ne("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const rt=ne("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const vo=ne("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const $n=ne("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const wo=ne("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const On=ne("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const Rn=ne("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);const Mn=ne("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const No=ne("OctagonAlert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]]);const Ln=ne("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const Pn=ne("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const ko=ne("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const An=ne("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);function _o(t){const e=_.c(15),{onSave:n,onUndo:s,isDirty:i,isSaving:r,saveLabel:l,undoLabel:c}=t,a=l===void 0?"Save":l,d=c===void 0?"Undo":c;if(!i)return null;let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=o.jsx(Ys,{size:14}),e[0]=u):u=e[0];let f;e[1]!==r||e[2]!==s||e[3]!==d?(f=o.jsxs(te,{variant:"outline",size:"sm",onClick:s,disabled:r,"aria-label":d,children:[u,d]}),e[1]=r,e[2]=s,e[3]=d,e[4]=f):f=e[4];let m;e[5]!==r?(m=r?o.jsx(ln,{size:14,className:"animate-spin"}):o.jsx(Zs,{size:14}),e[5]=r,e[6]=m):m=e[6];let x;e[7]!==r||e[8]!==n||e[9]!==a||e[10]!==m?(x=o.jsxs(te,{variant:"default",size:"sm",onClick:n,disabled:r,"aria-label":a,children:[m,a]}),e[7]=r,e[8]=n,e[9]=a,e[10]=m,e[11]=x):x=e[11];let p;return e[12]!==f||e[13]!==x?(p=o.jsxs(o.Fragment,{children:[f,x]}),e[12]=f,e[13]=x,e[14]=p):p=e[14],p}const Bt=t=>{let e;const n=new Set,s=(d,u)=>{const f=typeof d=="function"?d(e):d;if(!Object.is(f,e)){const m=e;e=u??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(x=>x(e,m))}},i=()=>e,c={setState:s,getState:i,getInitialState:()=>a,subscribe:d=>(n.add(d),()=>n.delete(d))},a=e=t(s,i,c);return c},Pt=(t=>t?Bt(t):Bt),Co=t=>t;function _t(t,e=Co){const n=ze.useSyncExternalStore(t.subscribe,ze.useCallback(()=>e(t.getState()),[t,e]),ze.useCallback(()=>e(t.getInitialState()),[t,e]));return ze.useDebugValue(n),n}const Io=t=>{const e=Pt(t),n=s=>_t(e,s);return Object.assign(n,e),n},To=(t=>Io);function zn(t,e){let n;try{n=t()}catch{return}return{getItem:i=>{var r;const l=a=>a===null?null:JSON.parse(a,void 0),c=(r=n.getItem(i))!=null?r:null;return c instanceof Promise?c.then(l):l(c)},setItem:(i,r)=>n.setItem(i,JSON.stringify(r,void 0)),removeItem:i=>n.removeItem(i)}}const Ct=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(s){return Ct(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return Ct(s)(n)}}}},Eo=(t,e)=>(n,s,i)=>{let r={storage:zn(()=>window.localStorage),partialize:g=>g,version:0,merge:(g,b)=>({...b,...g}),...e},l=!1,c=0;const a=new Set,d=new Set;let u=r.storage;if(!u)return t((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${r.name}', the given storage is currently unavailable.`),n(...g)},s,i);const f=()=>{const g=r.partialize({...s()});return u.setItem(r.name,{state:g,version:r.version})},m=i.setState;i.setState=(g,b)=>(m(g,b),f());const x=t((...g)=>(n(...g),f()),s,i);i.getInitialState=()=>x;let p;const h=()=>{var g,b;if(!u)return;const S=++c;l=!1,a.forEach(y=>{var j;return y((j=s())!=null?j:x)});const v=((b=r.onRehydrateStorage)==null?void 0:b.call(r,(g=s())!=null?g:x))||void 0;return Ct(u.getItem.bind(u))(r.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==r.version){if(r.migrate){const j=r.migrate(y.state,y.version);return j instanceof Promise?j.then(w=>[!0,w]):[!0,j]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,y.state];return[!1,void 0]}).then(y=>{var j;if(S!==c)return;const[w,N]=y;if(p=r.merge(N,(j=s())!=null?j:x),n(p,!0),w)return f()}).then(()=>{S===c&&(v?.(s(),void 0),p=s(),l=!0,d.forEach(y=>y(p)))}).catch(y=>{S===c&&v?.(void 0,y)})};return i.persist={setOptions:g=>{r={...r,...g},g.storage&&(u=g.storage)},clearStorage:()=>{u?.removeItem(r.name)},getOptions:()=>r,rehydrate:()=>h(),hasHydrated:()=>l,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(d.add(g),()=>{d.delete(g)})},r.skipHydration||h(),p||x},Wn=Eo,{useSyncExternalStoreWithSelector:$o}=ms,Oo=t=>t;function Ro(t,e=Oo,n){const s=$o(t.subscribe,t.getState,t.getInitialState,e,n);return ze.useDebugValue(s),s}const Xt=t=>Symbol.iterator in t,Jt=t=>"entries"in t,Gt=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),s=e instanceof Map?e:new Map(e.entries());if(n.size!==s.size)return!1;for(const[i,r]of n)if(!s.has(i)||!Object.is(r,s.get(i)))return!1;return!0},Mo=(t,e)=>{const n=t[Symbol.iterator](),s=e[Symbol.iterator]();let i=n.next(),r=s.next();for(;!i.done&&!r.done;){if(!Object.is(i.value,r.value))return!1;i=n.next(),r=s.next()}return!!i.done&&!!r.done};function Lo(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:Xt(t)&&Xt(e)?Jt(t)&&Jt(e)?Gt(t,e):Mo(t,e):Gt({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function Dn(t,e="Output"){if(!t)return`interface ${e} {}`;function n(r){if(!r||typeof r!="object")return"unknown";const l=r.type;if(Array.isArray(l))return l.map(c=>s(c)).join(" | ");switch(l){case"string":return r.enum?r.enum.map(c=>`"${c}"`).join(" | "):"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";case"array":{const c=r.items;return c?`${n(c)}[]`:"unknown[]"}case"object":return i(r);default:return r.anyOf?r.anyOf.map(n).join(" | "):r.oneOf?r.oneOf.map(n).join(" | "):r.allOf?r.allOf.map(n).join(" & "):"unknown"}}function s(r){switch(r){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";default:return"unknown"}}function i(r){const l=r.properties;if(!l)return"Record<string, unknown>";const c=new Set(r.required||[]);return`{
|
|
2
2
|
${Object.entries(l).map(([d,u])=>{const f=c.has(d)?"":"?";return`${u.description?` /** ${u.description} */
|
|
3
3
|
`:""} ${d}${f}: ${n(u)};`}).join(`
|
|
4
4
|
`)}
|
|
5
5
|
}`}return`interface ${e} ${n(t)}`}const Ze="__workflow_input__";function Xe(t,e){const n=t.trim();return e.some(i=>i.name.toLowerCase()===n.toLowerCase())?`${n}_${Math.random().toString(36).substring(2,6)}`:n}function Fn(t,e){const n=t.match(/interface\s+Input\s*\{/);if(!n||n.index===void 0)return`${e}
|
|
6
6
|
|
|
7
|
-
${t.trimStart()}`;const s=n.index,i=s+n[0].length-1;let r=1,l=i+1;for(;l<t.length&&r>0;)t[l]==="{"?r++:t[l]==="}"&&r--,l++;return t.slice(0,s)+e+t.slice(l)}function Je(t,e){switch(t){case"tool":return{input:{},action:{toolName:""},outputSchema:{},name:`Step_${e+1}`};case"code":return{...Ts,name:`Step_${e+1}`};default:throw new Error(`Invalid step type: ${t}`)}}const Hn=T.createContext(null),Po=t=>Pt()(Wn(e=>({...t,actions:{setIsAddingStep:n=>e(s=>({...s,isAddingStep:n})),setCurrentStepTab:n=>e(s=>({...s,currentStepTab:n})),setToolAction:n=>e(s=>({workflow:{...s.workflow,steps:s.workflow.steps.map(i=>"toolName"in i.action&&i.action.toolName===n.toolName?{...i,action:n}:i)}})),appendStep:({step:n,type:s})=>e(i=>{const r=n??Je(s,i.workflow.steps.length),l=i.workflow.steps.find(a=>a.name===r.name),c=l?`${r.name} ${parseInt(l.name.split(" ").pop()??Math.random().toString(36).substring(2,15))+1}`:r.name;return{workflow:{...i.workflow,steps:[...i.workflow.steps,{...r,name:c}]}}}),deleteStep:n=>e(s=>({workflow:{...s.workflow,steps:s.workflow.steps.filter(i=>i.name!==n)}})),duplicateStep:n=>e(s=>{const i=s.workflow.steps.findIndex(a=>a.name===n);if(i===-1)return s;const r=s.workflow.steps[i];if(!r)return s;const l={...r,name:Xe(r.name,s.workflow.steps)},c=[...s.workflow.steps];return c.splice(i+1,0,l),{workflow:{...s.workflow,steps:c},currentStepName:l.name}}),setCurrentStepName:n=>e(s=>({...s,currentStepName:n})),updateStep:(n,s)=>e(i=>({...i,workflow:{...i.workflow,steps:i.workflow.steps.map(r=>r.name===n?{...r,...s}:r)}})),setTrackingExecutionId:n=>e(s=>({...s,trackingExecutionId:n})),resetToOriginalWorkflow:()=>e(n=>({...n,workflow:n.originalWorkflow})),startAddingStep:n=>e(s=>({...s,isAddingStep:!0,addingStepType:n})),cancelAddingStep:()=>e(n=>({...n,isAddingStep:!1,addingStepType:null,selectedParentSteps:[]})),toggleParentStepSelection:n=>e(s=>{const i=s.selectedParentSteps.includes(n);return{...s,selectedParentSteps:i?s.selectedParentSteps.filter(r=>r!==n):[...s.selectedParentSteps,n]}}),confirmAddCodeStep:()=>e(n=>{const{selectedParentSteps:s,addingStepType:i,workflow:r}=n;if(i!=="code"||s.length===0)return n;const l={};for(const f of s)l[f]=`@${f}`;const c={};for(const f of s){const m=r.steps.find(x=>x.name===f);m?.outputSchema&&(c[f]=m.outputSchema)}const a=Object.keys(c).length>0?{type:"object",properties:c,required:Object.keys(c)}:void 0;let d=Je("code",Number((Math.random()*1e6).toFixed(0)));if(d={...d,input:l},a){const f=Dn(a,"Input"),m=d.action,x=Fn(m.code,f);d={...d,action:{...m,code:x}}}const u=Xe(d.name,r.steps);return{...n,isAddingStep:!1,addingStepType:null,selectedParentSteps:[],workflow:{...r,steps:[...r.steps,{...d,name:u}]},currentStepName:u}}),addToolStep:()=>e(n=>{let s=Je("tool",Number((Math.random()*1e6).toFixed(0)));const i=Xe(s.name,n.workflow.steps);return{...n,isAddingStep:!1,addingStepType:null,workflow:{...n.workflow,steps:[...n.workflow.steps,{...s,name:i}]},currentStepName:i}}),addCodeStep:()=>e(n=>{const s=Je("code",Number((Math.random()*1e6).toFixed(0))),i=Xe(s.name,n.workflow.steps);return{...n,isAddingStep:!1,addingStepType:null,workflow:{...n.workflow,steps:[...n.workflow.steps,{...s,name:i}]},currentStepName:i}}),setWorkflow:n=>e(s=>({...s,workflow:n})),startReplacingTool:n=>e(s=>({...s,replacingToolInfo:{toolName:n}})),cancelReplacingTool:()=>e(n=>({...n,replacingToolInfo:null})),setSelectedVirtualMcpId:n=>e(s=>({...s,selectedVirtualMcpId:n}))}}),{name:`workflow-store-${encodeURIComponent(t.workflow.id)}`,storage:zn(()=>localStorage),version:1,partialize:e=>({trackingExecutionId:e.trackingExecutionId,currentStepName:e.currentStepName,currentStepTab:e.currentStepTab,isAddingStep:e.isAddingStep,addingStepType:e.addingStepType,selectedParentSteps:e.selectedParentSteps,replacingToolInfo:e.replacingToolInfo,selectedVirtualMcpId:e.selectedVirtualMcpId})}));function Ao(t){const e=_.c(11),{children:n,initialState:s}=t,i=fn(),{org:r}=oe();let l;e[0]!==r||e[1]!==i?.[0]?.id?(l=i?.[0]?.id??Fe(r.id),e[0]=r,e[1]=i?.[0]?.id,e[2]=l):l=e[2];const c=l;let a;e[3]!==c||e[4]!==s.currentStepTab||e[5]!==s.trackingExecutionId||e[6]!==s.workflow?(a=()=>Po({workflow:s.workflow,originalWorkflow:s.workflow,selectedVirtualMcpId:c,isAddingStep:!1,selectedParentSteps:[],trackingExecutionId:s.trackingExecutionId,currentStepName:s.workflow.steps[0]?.name,currentStepTab:s.currentStepTab??"input"}),e[3]=c,e[4]=s.currentStepTab,e[5]=s.trackingExecutionId,e[6]=s.workflow,e[7]=a):a=e[7];const[d]=T.useState(a);let u;return e[8]!==n||e[9]!==d?(u=o.jsx(Hn.Provider,{value:d,children:n}),e[8]=n,e[9]=d,e[10]=u):u=e[10],u}function Me(t,e){const n=T.useContext(Hn);if(!n)throw new Error("Missing WorkflowStoreProvider - refresh the page. If the error persists, please contact support.");return Ro(n,t,Lo)}function de(){return Me(zo)}function zo(t){return t.workflow}function se(){return Me(Wo)}function Wo(t){return t.actions}function Vn(){const t=qe();return Me(Do)??t[0]?.name}function Do(t){return t.currentStepName}function Ve(){const t=_.c(5),e=Vn(),n=qe();if(e===Ze)return;let s;if(t[0]!==e||t[1]!==n){let r;t[3]!==e?(r=l=>l.name===e,t[3]=e,t[4]=r):r=t[4],s=n.find(r),t[0]=e,t[1]=n,t[2]=s}else s=t[2];const i=s;return i||n[0]}function qn(){return Me(Fo)}function Fo(t){return t.currentStepName===Ze}function qe(){return de().steps}function It(t,e){if(t===e)return!0;if(t===null||e===null||typeof t!=typeof e)return!1;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(!It(t[n],e[n]))return!1;return!0}if(typeof t=="object"){const n=t,s=e,i=Object.keys(n),r=Object.keys(s);if(i.length!==r.length)return!1;for(const l of i)if(!(l in s)||!It(n[l],s[l]))return!1;return!0}return!1}function Un(){const t=_.c(5),e=de();let n;t[0]!==e.id?(n={itemId:e.id},t[0]=e.id,t[1]=n):n=t[1];const{item:s}=ls(n);if(!s)return!1;let i;return t[2]!==s||t[3]!==e?(i=It(e,s),t[2]=s,t[3]=e,t[4]=i):i=t[4],!i}function Y(){return Me(Ho)}function Ho(t){return t.trackingExecutionId}function Ue(){return Me(Vo)}function Vo(t){return t.selectedVirtualMcpId}function qo(t){const e=_.c(23),{selectedVirtualMcpId:n,onVirtualMcpChange:s,className:i,placeholder:r}=t,l=r===void 0?"Select Agent":r,c=fn()??[],{org:a}=oe();let d;e[0]!==a.id?(d=Fe(a.id),e[0]=a.id,e[1]=d):d=e[1];const u=d,f=c.filter(Ko),m=wt,x=n??u;let p;e[2]!==s?(p=N=>s(N===""?void 0:N),e[2]=s,e[3]=p):p=e[3];let h;e[4]!==i?(h=O("text-xs",i),e[4]=i,e[5]=h):h=e[5];let g;e[6]!==l?(g=o.jsx(Nt,{placeholder:l}),e[6]=l,e[7]=g):g=e[7];let b;e[8]!==h||e[9]!==g?(b=o.jsx(kt,{size:"sm",className:h,children:g}),e[8]=h,e[9]=g,e[10]=b):b=e[10];const S=vt;let v;e[11]!==u?(v=o.jsx(nt,{value:u,children:"All tools (Decopilot)"}),e[11]=u,e[12]=v):v=e[12];const y=f.map(Uo);let j;e[13]!==S||e[14]!==v||e[15]!==y?(j=o.jsxs(S,{children:[v,y]}),e[13]=S,e[14]=v,e[15]=y,e[16]=j):j=e[16];let w;return e[17]!==m||e[18]!==j||e[19]!==x||e[20]!==p||e[21]!==b?(w=o.jsxs(m,{value:x,onValueChange:p,children:[b,j]}),e[17]=m,e[18]=j,e[19]=x,e[20]=p,e[21]=b,e[22]=w):w=e[22],w}function Uo(t){return o.jsx(nt,{value:t.id,children:t.title},t.id)}function Ko(t){return t.id!==null&&!Os(t.id)}function Le(){const t=_.c(7);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const s=ps(e).appSlug;let i;t[1]!==s?(i={slug:s},t[1]=s,t[2]=i):i=t[2];const r=uo(i);if(!s){let c;return t[3]===Symbol.for("react.memo_cache_sentinel")?(c={id:"self"},t[3]=c):c=t[3],c}let l;return t[4]!==s||t[5]!==r[0]?(l=r[0]??{id:s},t[4]=s,t[5]=r[0],t[6]=l):l=t[6],l}function ue(t){const e=_.c(12),{org:n}=oe(),s=Le();let i;e[0]!==s.id||e[1]!==n.id?(i={connectionId:s.id,orgId:n.id},e[0]=s.id,e[1]=n.id,e[2]=i):i=e[2];const r=ae(i);let l;e[3]!==t?(l={id:t},e[3]=t,e[4]=l):l=e[4];const c=!!t;let a;e[5]!==r||e[6]!==l||e[7]!==c?(a={client:r,toolName:"COLLECTION_WORKFLOW_EXECUTION_GET",toolArguments:l,enabled:c,select:Bo},e[5]=r,e[6]=l,e[7]=c,e[8]=a):a=e[8];const{data:d,isLoading:u}=Rt(a),f=d?.item;let m;return e[9]!==u||e[10]!==f?(m={item:f,isLoading:u},e[9]=u,e[10]=f,e[11]=m):m=e[11],m}function Bo(t){return t.structuredContent??t}function Kn(t,e,n){const s=_.c(14),{org:i}=oe(),r=Le();let l;s[0]!==r.id||s[1]!==i.id?(l={connectionId:r.id,orgId:i.id},s[0]=r.id,s[1]=i.id,s[2]=l):l=s[2];const c=ae(l),a=(n?.enabled??!0)&&!!t&&!!e;let d;s[3]!==t||s[4]!==e?(d={executionId:t,stepId:e},s[3]=t,s[4]=e,s[5]=d):d=s[5];let u;s[6]!==c||s[7]!==a||s[8]!==d?(u={client:c,toolName:"COLLECTION_WORKFLOW_EXECUTION_GET_STEP_RESULT",toolArguments:d,enabled:a,select:Xo},s[6]=c,s[7]=a,s[8]=d,s[9]=u):u=s[9];const{data:f,isLoading:m}=Rt(u),x=f?.output,p=f?.error;let h;return s[10]!==m||s[11]!==x||s[12]!==p?(h={output:x,error:p,isLoading:m},s[10]=m,s[11]=x,s[12]=p,s[13]=h):h=s[13],h}function Xo(t){return t.structuredContent??t}function Jo(){const t=_.c(15),{org:e}=oe(),n=Le(),s=de();let i;t[0]!==n.id||t[1]!==e.id?(i={connectionId:n.id,orgId:e.id},t[0]=n.id,t[1]=e.id,t[2]=i):i=t[2];const r=ae(i);let l;t[3]!==s.id?(l={workflow_collection_id:s.id,limit:100},t[3]=s.id,t[4]=l):l=t[4];const c=!!s.id;let a;t[5]!==r||t[6]!==l||t[7]!==c?(a={client:r,toolName:"COLLECTION_WORKFLOW_EXECUTION_LIST",toolArguments:l,enabled:c,staleTime:5e3,select:Go},t[5]=r,t[6]=l,t[7]=c,t[8]=a):a=t[8];const{data:d,isLoading:u,refetch:f}=Rt(a);let m;t[9]!==d?.items?(m=d?.items??[],t[9]=d?.items,t[10]=m):m=t[10];let x;return t[11]!==u||t[12]!==f||t[13]!==m?(x={executions:m,isLoading:u,refetch:f},t[11]=u,t[12]=f,t[13]=m,t[14]=x):x=t[14],x}function Go(t){return t.structuredContent??t}function Bn(t){const e=[];function n(s){if(typeof s=="string"){const i=s.match(/@input(?:\.(\w+(?:\.\w+)*))?/g);if(i)for(const r of i)if(r==="@input")e.push("__entire_input__");else{const l=r.replace("@input.","");e.push(l)}}else Array.isArray(s)?s.forEach(n):typeof s=="object"&&s!==null&&Object.values(s).forEach(n)}return n(t),[...new Set(e)]}function Qo(t){const e=[];for(const n of t){const s=Bn(n.input);e.push(...s)}return[...new Set(e)].filter(n=>n!=="__entire_input__")}function Yo(t){for(const e of t)if(Bn(e.input).includes("__entire_input__"))return!0;return!1}function Zo(t){const e=Qo(t);if(e.length===0)return Yo(t)?{type:"object",additionalProperties:!0,description:"Workflow input data"}:null;const n={},s=[];for(const i of e){const r=i.split(".");if(r.length===1)n[i]={type:"string",description:`Input field: ${i}`},s.push(i);else{const l=r[0];l&&!n[l]&&(n[l]={type:"object",description:`Input object: ${l}`,additionalProperties:!0},s.push(l))}}return{type:"object",properties:n,required:s,description:"Workflow execution input"}}function er(){const t=_.c(2),e=de();if(e.input_schema)return e.input_schema;let n;return t[0]!==e.steps?(n=Zo(e.steps),t[0]=e.steps,t[1]=n):n=t[1],n}function tr(){const t=_.c(16),{org:e}=oe(),{id:n}=Le(),{setTrackingExecutionId:s}=se(),i=de(),r=Ue(),l=er();let c;t[0]!==n||t[1]!==e.id?(c={connectionId:n,orgId:e.id},t[0]=n,t[1]=e.id,t[2]=c):c=t[2];const a=ae(c);let d;t[3]!==a?(d={client:a},t[3]=a,t[4]=d):d=t[4];const{mutateAsync:u,isPending:f}=Mt(d);let m;t[5]!==e.id||t[6]!==r||t[7]!==s||t[8]!==u||t[9]!==i?(m=async g=>{const b=g===void 0?{}:g,S=r??Fe(e.id),v=Date.now(),y=await u({name:"COLLECTION_WORKFLOW_EXECUTION_CREATE",arguments:{input:b,virtual_mcp_id:S,start_at_epoch_ms:v,workflow_collection_id:i.id}}),w=(y.structuredContent??y)?.item?.id??void 0;return s(w),w},t[5]=e.id,t[6]=r,t[7]=s,t[8]=u,t[9]=i,t[10]=m):m=t[10];const x=m,p=l!==null;let h;return t[11]!==x||t[12]!==l||t[13]!==f||t[14]!==p?(h={handleRunWorkflow:x,isPending:f,requiresInput:p,inputSchema:l},t[11]=x,t[12]=l,t[13]=f,t[14]=p,t[15]=h):h=t[15],h}const nr=["COLLECTION_WORKFLOW_EXECUTION_LIST","COLLECTION_WORKFLOW_EXECUTION_GET","COLLECTION_WORKFLOW_EXECUTION_GET_STEP_RESULT"];function sr(){const t=_.c(11),{org:e}=oe(),{id:n}=Le(),s=cn();let i;t[0]!==n||t[1]!==e.id?(i={connectionId:n,orgId:e.id},t[0]=n,t[1]=e.id,t[2]=i):i=t[2];const r=ae(i);let l;t[3]!==r?(l={client:r},t[3]=r,t[4]=l):l=t[4];const{mutateAsync:c,isPending:a}=Mt(l);let d;t[5]!==c||t[6]!==s?(d=async m=>{const x=await c({name:"CANCEL_EXECUTION",arguments:{executionId:m}});return s.invalidateQueries({predicate:or}),x},t[5]=c,t[6]=s,t[7]=d):d=t[7];const u=d;let f;return t[8]!==u||t[9]!==a?(f={handleCancelWorkflow:u,isCancelling:a},t[8]=u,t[9]=a,t[10]=f):f=t[10],f}function or(t){return t.queryKey.some(rr)}function rr(t){return typeof t=="string"&&nr.includes(t)}function ir(){const t=_.c(10),{org:e}=oe(),{id:n}=Le();let s;t[0]!==n||t[1]!==e.id?(s={connectionId:n,orgId:e.id},t[0]=n,t[1]=e.id,t[2]=s):s=t[2];const i=ae(s);let r;t[3]!==i?(r={client:i},t[3]=i,t[4]=r):r=t[4];const{mutateAsync:l,isPending:c}=Mt(r);let a;t[5]!==l?(a=async f=>{const m=await l({name:"RESUME_EXECUTION",arguments:{executionId:f}});return(m.structuredContent??m)?.success??!1},t[5]=l,t[6]=a):a=t[6];const d=a;let u;return t[7]!==d||t[8]!==c?(u={handleResumeWorkflow:d,isResuming:c},t[7]=d,t[8]=c,t[9]=u):u=t[9],u}function lr(){const t=_.c(3),e=Y(),{item:n}=ue(e);let s;return t[0]!==n||t[1]!==e?(s=e&&n?(()=>{const r={};return n?.input&&(r.input=n.input),r})():void 0,t[0]=n,t[1]=e,t[2]=s):s=t[2],s}function cr(t){const e=_.c(8),n=de();let s;if(e[0]!==t||e[1]!==n.input_schema||e[2]!==n.steps){s=[];const i=n.input_schema;if(i?.properties){const r=i.properties;let l;e[4]!==r?(l=Tt("input",r),e[4]=r,e[5]=l):l=e[5];const c=l,a=c.length>0?c:void 0;let d;e[6]!==a?(d={id:"input",label:"input",children:a},e[6]=a,e[7]=d):d=e[7],s.push(d)}for(const r of n.steps){if(r.name===t)break;const l=r.outputSchema;if(!l){s.push({id:r.name,label:r.name});continue}const c=Tt(r.name,l.properties??{});s.push({id:r.name,label:r.name,children:c.length>0?c:void 0})}e[0]=t,e[1]=n.input_schema,e[2]=n.steps,e[3]=s}else s=e[3];return s}function Tt(t,e){return Object.entries(e).map(([n,s])=>{const i=`${t}.${n}`,r=s.properties,l=s.type==="object"&&r?Tt(i,r):void 0;return{id:i,label:n,children:l&&l.length>0?l:void 0}})}function ar(t,e,n,s){if(!e)return[...t].sort(s);const i=n(e);return[...t].sort((r,l)=>{const c=n(r),a=n(l);return c===i?-1:a===i?1:s?s(r,l):0})}const At=To()(Wn(t=>({viewMode:"visual",setViewMode:e=>t({viewMode:e}),showExecutionsList:!1,setShowExecutionsList:e=>t({showExecutionsList:e}),toggleExecutionsList:()=>t(e=>({showExecutionsList:!e.showExecutionsList}))}),{name:"workflow-view-mode"})),Xn=T.createContext([]);function Jn(){return T.useContext(Xn)}function dr({editor:t,overrideSuggestionOptions:e,extensionName:n,char:s="@"}){const i=new Vs;return{editor:t,char:s,pluginKey:i,command:({editor:r,range:l,props:c})=>{var a,d,u;const f=r.view.state.selection.$to.nodeAfter;(a=f?.text)!=null&&a.startsWith(" ")&&(l.to+=1),r.chain().focus().insertContentAt(l,[{type:n,attrs:{...c,mentionSuggestionChar:s}},{type:"text",text:" "}]).run(),(u=(d=r.view.dom.ownerDocument.defaultView)==null?void 0:d.getSelection())==null||u.collapseToEnd()},allow:({state:r,range:l})=>{const c=r.doc.resolve(l.from),a=r.schema.nodes[n];return!!c.parent.type.contentMatch.matchType(a)},...e}}function Gn(t){return(t.options.suggestions.length?t.options.suggestions:[t.options.suggestion]).map(e=>dr({editor:t.editor,overrideSuggestionOptions:e,extensionName:t.name,char:e.char}))}function Qt(t,e){const n=Gn(t),s=n.find(i=>i.char===e);return s||(n.length?n[0]:null)}var ur=Ds.create({name:"mention",priority:101,addOptions(){return{HTMLAttributes:{},renderText({node:t,suggestion:e}){var n,s;return`${(n=e?.char)!=null?n:"@"}${(s=t.attrs.label)!=null?s:t.attrs.id}`},deleteTriggerWithBackspace:!1,renderHTML({options:t,node:e,suggestion:n}){var s,i;return["span",Be(this.HTMLAttributes,t.HTMLAttributes),`${(s=n?.char)!=null?s:"@"}${(i=e.attrs.label)!=null?i:e.attrs.id}`]},suggestions:[],suggestion:{}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-id"),renderHTML:t=>t.id?{"data-id":t.id}:{}},label:{default:null,parseHTML:t=>t.getAttribute("data-label"),renderHTML:t=>t.label?{"data-label":t.label}:{}},mentionSuggestionChar:{default:"@",parseHTML:t=>t.getAttribute("data-mention-suggestion-char"),renderHTML:t=>({"data-mention-suggestion-char":t.mentionSuggestionChar})}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:t,HTMLAttributes:e}){const n=Qt(this,t.attrs.mentionSuggestionChar);if(this.options.renderLabel!==void 0)return console.warn("renderLabel is deprecated use renderText and renderHTML instead"),["span",Be({"data-type":this.name},this.options.HTMLAttributes,e),this.options.renderLabel({options:this.options,node:t,suggestion:n})];const s={...this.options};s.HTMLAttributes=Be({"data-type":this.name},this.options.HTMLAttributes,e);const i=this.options.renderHTML({options:s,node:t,suggestion:n});return typeof i=="string"?["span",Be({"data-type":this.name},this.options.HTMLAttributes,e),i]:i},...Hs({nodeName:"mention",name:"@",selfClosing:!0,allowedAttributes:["id","label",{name:"mentionSuggestionChar",skipIfDefault:"@"}],parseAttributes:t=>{const e={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let s=n.exec(t);for(;s!==null;){const[,i,r,l]=s,c=r??l;e[i==="char"?"mentionSuggestionChar":i]=c,s=n.exec(t)}return e},serializeAttributes:t=>Object.entries(t).filter(([,e])=>e!=null).map(([e,n])=>`${e==="mentionSuggestionChar"?"char":e}="${n}"`).join(" ")}),renderText({node:t}){const e={options:this.options,node:t,suggestion:Qt(this,t.attrs.mentionSuggestionChar)};return this.options.renderLabel!==void 0?(console.warn("renderLabel is deprecated use renderText and renderHTML instead"),this.options.renderLabel(e)):this.options.renderText(e)},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:t,state:e})=>{let n=!1;const{selection:s}=e,{empty:i,anchor:r}=s;if(!i)return!1;let l=new Fs,c=0;return e.doc.nodesBetween(r-1,r,(a,d)=>{if(a.type.name===this.name)return n=!0,l=a,c=d,!1}),n&&t.insertText(this.options.deleteTriggerWithBackspace?"":l.attrs.mentionSuggestionChar,c,c+l.nodeSize),n})}},addProseMirrorPlugins(){return Gn(this).map(Rs)}}),fr=ur,jt,it="HoverCard",[Qn]=ws(it,[dn]),lt=dn(),[mr,ct]=Qn(it),Yn=t=>{const{__scopeHoverCard:e,children:n,open:s,defaultOpen:i,onOpenChange:r,openDelay:l=700,closeDelay:c=300}=t,a=lt(e),d=T.useRef(0),u=T.useRef(0),f=T.useRef(!1),m=T.useRef(!1),[x,p]=bs({prop:s,defaultProp:i??!1,onChange:r,caller:it}),h=T.useCallback(()=>{clearTimeout(u.current),d.current=window.setTimeout(()=>p(!0),l)},[l,p]),g=T.useCallback(()=>{clearTimeout(d.current),!f.current&&!m.current&&(u.current=window.setTimeout(()=>p(!1),c))},[c,p]),b=T.useCallback(()=>p(!1),[p]);return T.useEffect(()=>()=>{clearTimeout(d.current),clearTimeout(u.current)},[]),o.jsx(mr,{scope:e,open:x,onOpenChange:p,onOpen:h,onClose:g,onDismiss:b,hasSelectionRef:f,isPointerDownOnContentRef:m,children:o.jsx(js,{...a,children:n})})};Yn.displayName=it;var Zn="HoverCardTrigger",es=T.forwardRef((t,e)=>{const{__scopeHoverCard:n,...s}=t,i=ct(Zn,n),r=lt(n);return o.jsx(xs,{asChild:!0,...r,children:o.jsx(hs.a,{"data-state":i.open?"open":"closed",...s,ref:e,onPointerEnter:fe(t.onPointerEnter,tt(i.onOpen)),onPointerLeave:fe(t.onPointerLeave,tt(i.onClose)),onFocus:fe(t.onFocus,i.onOpen),onBlur:fe(t.onBlur,i.onClose),onTouchStart:fe(t.onTouchStart,l=>l.preventDefault())})})});es.displayName=Zn;var zt="HoverCardPortal",[pr,xr]=Qn(zt,{forceMount:void 0}),ts=t=>{const{__scopeHoverCard:e,forceMount:n,children:s,container:i}=t,r=ct(zt,e);return o.jsx(pr,{scope:e,forceMount:n,children:o.jsx(an,{present:n||r.open,children:o.jsx(gs,{asChild:!0,container:i,children:s})})})};ts.displayName=zt;var et="HoverCardContent",ns=T.forwardRef((t,e)=>{const n=xr(et,t.__scopeHoverCard),{forceMount:s=n.forceMount,...i}=t,r=ct(et,t.__scopeHoverCard);return o.jsx(an,{present:s||r.open,children:o.jsx(hr,{"data-state":r.open?"open":"closed",...i,onPointerEnter:fe(t.onPointerEnter,tt(r.onOpen)),onPointerLeave:fe(t.onPointerLeave,tt(r.onClose)),ref:e})})});ns.displayName=et;var hr=T.forwardRef((t,e)=>{const{__scopeHoverCard:n,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:r,onInteractOutside:l,...c}=t,a=ct(et,n),d=lt(n),u=T.useRef(null),f=Ss(e,u),[m,x]=T.useState(!1);return T.useEffect(()=>{if(m){const p=document.body;return jt=p.style.userSelect||p.style.webkitUserSelect,p.style.userSelect="none",p.style.webkitUserSelect="none",()=>{p.style.userSelect=jt,p.style.webkitUserSelect=jt}}},[m]),T.useEffect(()=>{if(u.current){const p=()=>{x(!1),a.isPointerDownOnContentRef.current=!1,setTimeout(()=>{document.getSelection()?.toString()!==""&&(a.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",p),()=>{document.removeEventListener("pointerup",p),a.hasSelectionRef.current=!1,a.isPointerDownOnContentRef.current=!1}}},[a.isPointerDownOnContentRef,a.hasSelectionRef]),T.useEffect(()=>{u.current&&jr(u.current).forEach(h=>h.setAttribute("tabindex","-1"))}),o.jsx(ys,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:l,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:fe(r,p=>{p.preventDefault()}),onDismiss:a.onDismiss,children:o.jsx(vs,{...d,...c,onPointerDown:fe(c.onPointerDown,p=>{p.currentTarget.contains(p.target)&&x(!0),a.hasSelectionRef.current=!1,a.isPointerDownOnContentRef.current=!0}),ref:f,style:{...c.style,userSelect:m?"text":void 0,WebkitUserSelect:m?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),gr="HoverCardArrow",br=T.forwardRef((t,e)=>{const{__scopeHoverCard:n,...s}=t,i=lt(n);return o.jsx(Ns,{...i,...s,ref:e})});br.displayName=gr;function tt(t){return e=>e.pointerType==="touch"?void 0:t()}function jr(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)e.push(n.currentNode);return e}var Sr=Yn,yr=es,vr=ts,wr=ns;function Nr(t){const e=_.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==n?(s=o.jsx(Sr,{"data-slot":"hover-card",...n}),e[2]=n,e[3]=s):s=e[3],s}function kr(t){const e=_.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==n?(s=o.jsx(yr,{"data-slot":"hover-card-trigger",...n}),e[2]=n,e[3]=s):s=e[3],s}function _r(t){const e=_.c(12);let n,s,i,r;e[0]!==t?({className:n,align:i,sideOffset:r,...s}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=i,e[4]=r):(n=e[1],s=e[2],i=e[3],r=e[4]);const l=i===void 0?"center":i,c=r===void 0?4:r;let a;e[5]!==n?(a=O("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",n),e[5]=n,e[6]=a):a=e[6];let d;return e[7]!==l||e[8]!==s||e[9]!==c||e[10]!==a?(d=o.jsx(vr,{"data-slot":"hover-card-portal",children:o.jsx(wr,{"data-slot":"hover-card-content",align:l,sideOffset:c,className:a,...s})}),e[7]=l,e[8]=s,e[9]=c,e[10]=a,e[11]=d):d=e[11],d}const ss=T.createContext(void 0);function Cr(t,e){const n=e.split("."),s=n[0];if(!s)return;let i=t[s];for(let r=1;r<n.length&&i!==void 0;r++){const l=n[r];if(l)if(typeof i=="object"&&i!==null)i=i[l];else return}return i}function Ir(t){const e=_.c(20),{node:n}=t,s=T.useContext(ss),i=n.attrs.id??"",r=s!==void 0;let l;if(e[0]!==r||e[1]!==i||e[2]!==s){const h=r?Cr(s,i):void 0;l=h!==void 0?typeof h=="object"?JSON.stringify(h,null,2):String(h):void 0,e[0]=r,e[1]=i,e[2]=s,e[3]=l}else l=e[3];const c=l;let a;e[4]!==i?(a=o.jsxs("span",{className:"bg-primary/20 text-primary px-1 rounded font-medium cursor-pointer",children:["@",i]}),e[4]=i,e[5]=a):a=e[5];const d=a;if(!r||c===void 0){let h;return e[6]!==d?(h=o.jsx(Ut,{as:"span",children:d}),e[6]=d,e[7]=h):h=e[7],h}let u;e[8]!==d?(u=o.jsx(kr,{asChild:!0,children:d}),e[8]=d,e[9]=u):u=e[9];let f;e[10]!==i?(f=o.jsxs("div",{className:"text-xs font-medium text-muted-foreground",children:["@",i]}),e[10]=i,e[11]=f):f=e[11];let m;e[12]!==c?(m=o.jsx("pre",{className:"text-xs font-mono bg-muted/50 p-2 rounded overflow-auto max-h-[200px] whitespace-pre-wrap break-all",children:c}),e[12]=c,e[13]=m):m=e[13];let x;e[14]!==f||e[15]!==m?(x=o.jsx(_r,{className:"w-auto max-w-[400px] p-3",side:"top",align:"start",children:o.jsxs("div",{className:"space-y-1.5",children:[f,m]})}),e[14]=f,e[15]=m,e[16]=x):x=e[16];let p;return e[17]!==u||e[18]!==x?(p=o.jsx(Ut,{as:"span",children:o.jsxs(Nr,{openDelay:200,children:[u,x]})}),e[17]=u,e[18]=x,e[19]=p):p=e[19],p}function os(t){const e=[];function n(s){for(const i of s)i.children?.length||e.push(i),i.children&&n(i.children)}return n(t),e}let ce=rs();function rs(){return Pt(()=>({items:[],selectedIndex:0,command:null}))}function Yt(t,e){ce.setState({items:t,command:e,selectedIndex:0})}function Tr(){const{items:t,selectedIndex:e}=ce.getState();t.length&&ce.setState({selectedIndex:(e-1+t.length)%t.length})}function Er(){const{items:t,selectedIndex:e}=ce.getState();t.length&&ce.setState({selectedIndex:(e+1)%t.length})}function is(){const{items:t,selectedIndex:e,command:n}=ce.getState(),s=t[e];return s?(n?.(s),!0):!1}function Zt(){ce=rs()}function $r(){const t=_.c(7),e=_t(ce,Rr),n=_t(ce,Or);if(!e.length)return null;let s;if(t[0]!==e||t[1]!==n){let r;t[3]!==n?(r=(l,c)=>o.jsx("button",{type:"button",onClick:()=>{ce.setState({selectedIndex:c}),is()},className:O("flex items-center w-full text-left px-3 py-1.5 text-sm rounded-md transition-colors",c===n?"bg-accent text-accent-foreground":"hover:bg-muted"),children:l.label},l.id),t[3]=n,t[4]=r):r=t[4],s=e.map(r),t[0]=e,t[1]=n,t[2]=s}else s=t[2];let i;return t[5]!==s?(i=o.jsx("div",{className:"bg-popover border border-border rounded-lg shadow-lg overflow-hidden min-w-[180px]",children:o.jsx("div",{className:"p-1",children:s})}),t[5]=s,t[6]=i):i=t[6],i}function Or(t){return t.selectedIndex}function Rr(t){return t.items}function Mr(){let t=null,e=null;return{onStart:n=>{Yt(n.items,n.command),t=new Bs($r,{editor:n.editor}),e=document.createElement("div"),e.style.cssText="position:absolute;z-index:9999";const s=n.clientRect?.();s&&(e.style.top=`${s.bottom+window.scrollY+4}px`,e.style.left=`${s.left+window.scrollX}px`),e.appendChild(t.element),document.body.appendChild(e)},onUpdate:n=>{Yt(n.items,n.command);const s=n.clientRect?.();s&&e&&(e.style.top=`${s.bottom+window.scrollY+4}px`,e.style.left=`${s.left+window.scrollX}px`)},onKeyDown:({event:n})=>n.key==="Escape"?(e?.remove(),t?.destroy(),Zt(),!0):n.key==="ArrowUp"?(Tr(),!0):n.key==="ArrowDown"?(Er(),!0):n.key==="Enter"?is():!1,onExit:()=>{e?.remove(),t?.destroy(),Zt()}}}const St=/@([\w.]+)/g;function Lr(t,e){if(!t)return null;const n=os(e),s=new Map(n.map(a=>[a.id,a]));if(!St.test(t))return t;St.lastIndex=0;const r=[];let l=0,c;for(;(c=St.exec(t))!==null;){const a=c[1]??"",d=c.index;d>l&&r.push({type:"text",text:t.slice(l,d)});const u=s.get(a);u?r.push({type:"mention",attrs:{id:u.id,label:u.label}}):r.push({type:"text",text:c[0]}),l=d+c[0].length}return l<t.length&&r.push({type:"text",text:t.slice(l)}),{type:"doc",content:[{type:"paragraph",content:r.length>0?r:void 0}]}}function Wt(t){const e=_.c(31),{mentions:n,value:s,onChange:i,placeholder:r,className:l,readOnly:c}=t,a=lr();let d;e[0]!==n||e[1]!==s?(d=Lr(s,n),e[0]=n,e[1]=s,e[2]=d):d=e[2];const u=d,f=a!==void 0,m=!c;let x;e[3]===Symbol.for("react.memo_cache_sentinel")?(x=qs.configure({heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1,hardBreak:!1}),e[3]=x):x=e[3];let p;if(e[4]!==n||e[5]!==f){let C;e[7]!==n?(C=E=>{const{query:W}=E;return os(n).filter(I=>I.label.toLowerCase().includes(W.toLowerCase())||I.id.toLowerCase().includes(W.toLowerCase()))},e[7]=n,e[8]=C):C=e[8],p=fr.configure({HTMLAttributes:{class:"bg-primary/20 text-primary px-1 rounded font-medium"},renderText:Wr,renderHTML:zr,suggestion:{items:C,render:Mr,command:Ar}}).extend(f?{addNodeView(){return Us(Ir)}}:{}),e[4]=n,e[5]=f,e[6]=p}else p=e[6];let h;e[9]!==p?(h=[x,p],e[9]=p,e[10]=h):h=e[10];const g=r??"";let b;e[11]!==g?(b={attributes:{class:"prose prose-sm max-w-none focus:outline-none w-full min-h-[20px]","data-placeholder":g},handleKeyDown:Pr},e[11]=g,e[12]=b):b=e[12];let S;e[13]!==i?(S=C=>{const{editor:E}=C;return i?.(E.getText().trim())},e[13]=i,e[14]=S):S=e[14];let v;e[15]!==u||e[16]!==m||e[17]!==h||e[18]!==b||e[19]!==S?(v={content:u,editable:m,extensions:h,editorProps:b,onUpdate:S},e[15]=u,e[16]=m,e[17]=h,e[18]=b,e[19]=S,e[20]=v):v=e[20];const y=Ks(v);let j;e[21]!==l?(j=O("rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",l),e[21]=l,e[22]=j):j=e[22];let w;e[23]!==y?(w=o.jsx(Xs,{editor:y}),e[23]=y,e[24]=w):w=e[24];let N;e[25]!==j||e[26]!==w?(N=o.jsx("div",{className:j,children:w}),e[25]=j,e[26]=w,e[27]=N):N=e[27];const k=N;if(a!==void 0){let C;return e[28]!==k||e[29]!==a?(C=o.jsx(ss.Provider,{value:a,children:k}),e[28]=k,e[29]=a,e[30]=C):C=e[30],C}return k}function Pr(t,e){return e.key==="Enter"?(e.preventDefault(),!0):!1}function Ar(t){const{editor:e,range:n,props:s}=t;e.chain().focus().insertContentAt(n,[{type:"mention",attrs:s}]).run()}function zr(t){const{options:e,node:n}=t;return["span",e.HTMLAttributes,`@${n.attrs.id}`]}function Wr(t){const{node:e}=t;return`@${e.attrs.id}`}function Dr(t){const e=_.c(8),{value:n,onChange:s,placeholder:i,readonly:r}=t,l=Jn(),c=n??"";let a;e[0]!==s?(a=f=>s(f),e[0]=s,e[1]=a):a=e[1];const d=i||"Enter value...";let u;return e[2]!==l||e[3]!==r||e[4]!==c||e[5]!==a||e[6]!==d?(u=o.jsx(Wt,{mentions:l,value:c,onChange:a,placeholder:d,readOnly:r}),e[2]=l,e[3]=r,e[4]=c,e[5]=a,e[6]=d,e[7]=u):u=e[7],u}function Fr(t){const e=_.c(8),{value:n,onChange:s,placeholder:i,readonly:r}=t,l=Jn(),c=n??"";let a;e[0]!==s?(a=f=>s(f),e[0]=s,e[1]=a):a=e[1];const d=i||"Enter value...";let u;return e[2]!==l||e[3]!==r||e[4]!==c||e[5]!==a||e[6]!==d?(u=o.jsx(Wt,{mentions:l,value:c,onChange:a,placeholder:d,readOnly:r,className:"min-h-[80px]"}),e[2]=l,e[3]=r,e[4]=c,e[5]=a,e[6]=d,e[7]=u):u=e[7],u}function Hr(t){const e=_.c(8),{value:n,onChange:s,readonly:i,id:r}=t,l=n??"";let c;e[0]!==s?(c=u=>s(u.target.value===""?void 0:Number(u.target.value)),e[0]=s,e[1]=c):c=e[1];let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=O("w-full rounded-md border border-input bg-background px-3 py-2 text-sm","ring-offset-background focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50"),e[2]=a):a=e[2];let d;return e[3]!==r||e[4]!==i||e[5]!==l||e[6]!==c?(d=o.jsx("input",{id:r,type:"number",value:l,onChange:c,disabled:i,className:a}),e[3]=r,e[4]=i,e[5]=l,e[6]=c,e[7]=d):d=e[7],d}function Vr(t){const e=_.c(13),{value:n,onChange:s,readonly:i,id:r,label:l}=t,c=n??!1;let a;e[0]!==s?(a=m=>s(m.target.checked),e[0]=s,e[1]=a):a=e[1];let d;e[2]!==r||e[3]!==i||e[4]!==c||e[5]!==a?(d=o.jsx("input",{id:r,type:"checkbox",checked:c,onChange:a,disabled:i,className:"h-4 w-4 rounded border-input"}),e[2]=r,e[3]=i,e[4]=c,e[5]=a,e[6]=d):d=e[6];let u;e[7]!==l?(u=o.jsx("span",{className:"text-sm",children:l}),e[7]=l,e[8]=u):u=e[8];let f;return e[9]!==r||e[10]!==d||e[11]!==u?(f=o.jsxs("label",{htmlFor:r,className:"flex items-center gap-2 cursor-pointer",children:[d,u]}),e[9]=r,e[10]=d,e[11]=u,e[12]=f):f=e[12],f}function qr(t){const e=_.c(14),{value:n,onChange:s,readonly:i,id:r,options:l}=t;let c;e[0]!==l.enumOptions?(c=l.enumOptions??[],e[0]=l.enumOptions,e[1]=c):c=e[1];const a=c,d=n??"";let u;e[2]!==s?(u=h=>s(h.target.value),e[2]=s,e[3]=u):u=e[3];let f,m;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=O("w-full rounded-md border border-input bg-background px-3 py-2 text-sm","ring-offset-background focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50"),m=o.jsx("option",{value:"",children:"Select..."}),e[4]=f,e[5]=m):(f=e[4],m=e[5]);let x;e[6]!==a?(x=a.map(Ur),e[6]=a,e[7]=x):x=e[7];let p;return e[8]!==r||e[9]!==i||e[10]!==d||e[11]!==u||e[12]!==x?(p=o.jsxs("select",{id:r,value:d,onChange:u,disabled:i,className:f,children:[m,x]}),e[8]=r,e[9]=i,e[10]=d,e[11]=u,e[12]=x,e[13]=p):p=e[13],p}function Ur(t){return o.jsx("option",{value:String(t.value),children:String(t.label)},String(t.value))}const Kr={TextWidget:Dr,TextareaWidget:Fr,NumberWidget:Hr,CheckboxWidget:Vr,SelectWidget:qr};function Br(t){switch(Array.isArray(t)?t[0]:t??"unknown"){case"string":return{Icon:An,color:"text-blue-500"};case"number":case"integer":return{Icon:Mn,color:"text-blue-500"};case"array":return{Icon:En,color:"text-purple-500"};case"object":return{Icon:Tn,color:"text-orange-500"};case"boolean":return{Icon:Pn,color:"text-pink-500"};case"null":return{Icon:$t,color:"text-gray-500"};default:return{Icon:On,color:"text-muted-foreground"}}}function Xr(t){const e=_.c(36),{id:n,label:s,required:i,description:r,children:l,schema:c,hidden:a}=t;if(a){let j;return e[0]!==l?(j=o.jsx("div",{className:"hidden",children:l}),e[0]=l,e[1]=j):j=e[1],j}if(n==="root"){let j;return e[2]!==l?(j=o.jsx("div",{className:"space-y-4",children:l}),e[2]=l,e[3]=j):j=e[3],j}const d=Array.isArray(c.type)?c.type[0]:c.type??"string";let u,f,m,x,p,h,g;if(e[4]!==n||e[5]!==s||e[6]!==i||e[7]!==d){const{Icon:j,color:w}=Br(d);g="space-y-2",x="flex items-center gap-2",e[15]!==n||e[16]!==s?(p=o.jsx("label",{htmlFor:n,className:"text-sm font-medium leading-none",children:s}),e[15]=n,e[16]=s,e[17]=p):p=e[17],e[18]!==i?(h=i&&o.jsx("span",{className:"text-red-500 text-xs",children:"*"}),e[18]=i,e[19]=h):h=e[19],u=j,f=14,m=O(w,"ml-auto"),e[4]=n,e[5]=s,e[6]=i,e[7]=d,e[8]=u,e[9]=f,e[10]=m,e[11]=x,e[12]=p,e[13]=h,e[14]=g}else u=e[8],f=e[9],m=e[10],x=e[11],p=e[12],h=e[13],g=e[14];let b;e[20]!==u||e[21]!==f||e[22]!==m?(b=o.jsx(u,{size:f,className:m}),e[20]=u,e[21]=f,e[22]=m,e[23]=b):b=e[23];let S;e[24]!==x||e[25]!==p||e[26]!==h||e[27]!==b?(S=o.jsxs("div",{className:x,children:[p,h,b]}),e[24]=x,e[25]=p,e[26]=h,e[27]=b,e[28]=S):S=e[28];let v;e[29]!==r?(v=r&&o.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:r}),e[29]=r,e[30]=v):v=e[30];let y;return e[31]!==l||e[32]!==g||e[33]!==S||e[34]!==v?(y=o.jsxs("div",{className:g,children:[S,v,l]}),e[31]=l,e[32]=g,e[33]=S,e[34]=v,e[35]=y):y=e[35],y}function Jr(t){const e=_.c(8),{properties:n,title:s}=t;if(!s||s==="Root"){let c;e[0]!==n?(c=n.map(Qr),e[0]=n,e[1]=c):c=e[1];let a;return e[2]!==c?(a=o.jsx("div",{className:"space-y-4",children:c}),e[2]=c,e[3]=a):a=e[3],a}let r;e[4]!==n?(r=n.map(Gr),e[4]=n,e[5]=r):r=e[5];let l;return e[6]!==r?(l=o.jsx("div",{className:"pl-4 border-l-2 border-border/50 space-y-4",children:r}),e[6]=r,e[7]=l):l=e[7],l}function Gr(t){return o.jsx("div",{children:t.content},t.name)}function Qr(t){return o.jsx("div",{children:t.content},t.name)}function Yr(t){const e=_.c(11),{items:n,canAdd:s,onAddClick:i,title:r}=t;let l;e[0]!==n?(l=n.map(Zr),e[0]=n,e[1]=l):l=e[1];let c;e[2]!==l?(c=o.jsx("div",{className:"space-y-2",children:l}),e[2]=l,e[3]=c):c=e[3];let a;e[4]!==s||e[5]!==i||e[6]!==r?(a=s&&o.jsxs(te,{type:"button",variant:"outline",size:"sm",className:"h-8",onClick:i,children:["+ Add ",r||"item"]}),e[4]=s,e[5]=i,e[6]=r,e[7]=a):a=e[7];let d;return e[8]!==c||e[9]!==a?(d=o.jsxs("div",{className:"space-y-2",children:[c,a]}),e[8]=c,e[9]=a,e[10]=d):d=e[10],d}function Zr(t){return o.jsx("div",{className:"flex gap-2 items-start",children:o.jsx("div",{className:"flex-1",children:t})},t.key||t.index)}function ei(){return null}function ti(){return null}const ni={FieldTemplate:Xr,ObjectFieldTemplate:Jr,ArrayFieldTemplate:Yr,UnsupportedFieldTemplate:ei,ErrorListTemplate:ti};function si(t){const e=_.c(6),{inputSchema:n,inputParams:s,mentions:i}=t;if(!n?.properties||!s)return null;let r;e[0]!==i?(r=(a,d,u)=>{const f=typeof d=="object"&&d!==null?JSON.stringify(d,null,2):String(d??""),m=Array.isArray(u.type)?u.type.join(" | "):u.type??"string";return o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs("div",{className:"flex items-baseline gap-2",children:[o.jsx("span",{className:"text-sm font-medium text-foreground",children:a}),o.jsx("span",{className:"text-xs text-muted-foreground ml-auto",children:m})]}),u.description&&o.jsx("div",{className:"text-xs text-muted-foreground",children:u.description}),o.jsx("div",{className:"rounded-md border border-border bg-muted/30 px-3 py-2 text-sm",children:o.jsx(Wt,{mentions:i,value:f,readOnly:!0,className:"border-0 bg-transparent p-0"})})]},a)},e[0]=i,e[1]=r):r=e[1];const l=r;let c;return e[2]!==s||e[3]!==n.properties||e[4]!==l?(c=o.jsx("div",{className:"space-y-4",children:Object.entries(n.properties).map(a=>{const[d,u]=a,f=s[d];return l(d,f,u)})}),e[2]=s,e[3]=n.properties,e[4]=l,e[5]=c):c=e[5],c}function Dt({inputSchema:t,inputParams:e,setInputParams:n,handleInputChange:s,mentions:i,readOnly:r}){const l=i??[];if(!t)return o.jsx("div",{className:"text-sm text-muted-foreground italic",children:"No arguments defined in schema."});if(r)return o.jsx(si,{inputSchema:t,inputParams:e,mentions:l});const c=t,a=T.useRef(e??{}),d=u=>{const f=u.formData??{},m=a.current;if(n?.(f),s){for(const[x,p]of Object.entries(f))m[x]!==p&&s(x,p);for(const x of Object.keys(m))x in f||s(x,void 0)}a.current=f};return o.jsx(Xn.Provider,{value:l,children:o.jsx(Es,{schema:c,formData:e,onChange:d,validator:$s,widgets:Kr,templates:ni,readonly:r,uiSchema:{"ui:submitButtonOptions":{norender:!0}},liveValidate:!1,className:"rjsf-form",omitExtraData:!0,liveOmit:!0,children:o.jsx(o.Fragment,{})})})}function oi(t){const e=_.c(33),{open:n,onOpenChange:s,inputSchema:i,onSubmit:r,isPending:l}=t;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={},e[0]=c):c=e[0];const[a,d]=T.useState(c);let u;e[1]!==a||e[2]!==s||e[3]!==r?(u=async()=>{await r(a),s(!1),d({})},e[1]=a,e[2]=s,e[3]=r,e[4]=u):u=e[4];const f=u;let m;e[5]!==s?(m=k=>{k||d({}),s(k)},e[5]=s,e[6]=m):m=e[6];const x=m;let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsxs(mo,{children:[o.jsx(po,{children:"Workflow Input"}),o.jsx(xo,{children:"This workflow requires input values to run. Fill in the fields below to start the execution."})]}),e[7]=p):p=e[7];let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=[],e[8]=h):h=e[8];let g;e[9]!==a||e[10]!==i?(g=o.jsx("div",{className:"py-4",children:o.jsx(Dt,{inputSchema:i,inputParams:a,setInputParams:d,mentions:h})}),e[9]=a,e[10]=i,e[11]=g):g=e[11];let b;e[12]!==x?(b=()=>x(!1),e[12]=x,e[13]=b):b=e[13];let S;e[14]!==l||e[15]!==b?(S=o.jsx(te,{variant:"outline",onClick:b,disabled:l,children:"Cancel"}),e[14]=l,e[15]=b,e[16]=S):S=e[16];let v;e[17]!==l?(v=l?o.jsx(st,{size:"xs"}):o.jsx(hn,{size:14}),e[17]=l,e[18]=v):v=e[18];let y;e[19]!==f||e[20]!==l||e[21]!==v?(y=o.jsxs(te,{onClick:f,disabled:l,className:"gap-2",children:[v,"Run Workflow"]}),e[19]=f,e[20]=l,e[21]=v,e[22]=y):y=e[22];let j;e[23]!==y||e[24]!==S?(j=o.jsxs(ho,{children:[S,y]}),e[23]=y,e[24]=S,e[25]=j):j=e[25];let w;e[26]!==j||e[27]!==g?(w=o.jsxs(go,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[p,g,j]}),e[26]=j,e[27]=g,e[28]=w):w=e[28];let N;return e[29]!==x||e[30]!==n||e[31]!==w?(N=o.jsx(bo,{open:n,onOpenChange:x,children:w}),e[29]=x,e[30]=n,e[31]=w,e[32]=N):N=e[32],N}function ri(t){const e=_.c(25),{title:n,description:s,onSave:i,isSaving:r}=t,{viewMode:l,setViewMode:c,showExecutionsList:a,toggleExecutionsList:d}=At(),{resetToOriginalWorkflow:u,setSelectedVirtualMcpId:f}=se(),m=Un(),x=Ue(),p=Y();let h;e[0]!==n?(h=o.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:n}),e[0]=n,e[1]=h):h=e[1];let g;e[2]!==s?(g=s?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),o.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:s})]}):null,e[2]=s,e[3]=g):g=e[3];let b;e[4]!==h||e[5]!==g?(b=o.jsx(co,{children:o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[h,g]})}),e[4]=h,e[5]=g,e[6]=b):b=e[6];let S;e[7]!==m||e[8]!==r||e[9]!==i||e[10]!==u||e[11]!==x||e[12]!==f||e[13]!==c||e[14]!==a||e[15]!==d||e[16]!==p||e[17]!==l?(S=!p&&o.jsxs(o.Fragment,{children:[o.jsx(_o,{onSave:i,onUndo:u,isDirty:m,isSaving:r,saveLabel:"Save workflow",undoLabel:"Reset changes"}),o.jsx(T.Suspense,{fallback:o.jsx(st,{size:"xs"}),children:o.jsx(qo,{selectedVirtualMcpId:x,onVirtualMcpChange:f,placeholder:"Select Agent"})}),o.jsx(Qs,{value:l,onValueChange:c,size:"sm",options:[{value:"visual",icon:o.jsx(eo,{})},{value:"code",icon:o.jsx(mn,{})}]}),o.jsx(gn,{children:o.jsxs(bn,{delayDuration:0,children:[o.jsx(jn,{asChild:!0,children:o.jsx("span",{className:"inline-block",children:o.jsx(te,{variant:a?"secondary":"outline",size:"icon",className:"size-7 border border-input",onClick:d,"aria-label":a?"Hide runs":"Show runs",children:o.jsx(to,{size:14})})})}),o.jsx(Sn,{side:"bottom",children:a?"Hide runs":"Show runs"})]})})]}),e[7]=m,e[8]=r,e[9]=i,e[10]=u,e[11]=x,e[12]=f,e[13]=c,e[14]=a,e[15]=d,e[16]=p,e[17]=l,e[18]=S):S=e[18];let v;e[19]===Symbol.for("react.memo_cache_sentinel")?(v=o.jsx(ci,{}),e[19]=v):v=e[19];let y;e[20]!==S?(y=o.jsxs(ao,{children:[S,v]}),e[20]=S,e[21]=y):y=e[21];let j;return e[22]!==b||e[23]!==y?(j=o.jsxs(o.Fragment,{children:[b,y]}),e[22]=b,e[23]=y,e[24]=j):j=e[24],j}function ii(){const t=Y(),{item:e}=ue(t);return e?.completed_at_epoch_ms!=null}function li(){const t=Y(),{item:e}=ue(t);return!!(e?.status==="cancelled"||e?.status==="error"||e?.status==="failed"||e?.status==="success"&&e.completed_steps?.error&&e.completed_steps.error.length>0)}function ci(){const t=_.c(58),e=Un(),n=ii(),s=li(),i=Y(),r=Ue(),{handleRunWorkflow:l,isPending:c,requiresInput:a,inputSchema:d}=tr(),u=qe(),[f,m]=T.useState(!1),{handleCancelWorkflow:x,isCancelling:p}=sr(),{handleResumeWorkflow:h,isResuming:g}=ir(),b=i&&!n;let S;t[0]!==u?(S=u.some(ai),t[0]=u,t[1]=S):S=t[1];const v=S,y=!r,j=u.length===0,w=e||j||v||y||c||p,N=b||c;let k;t[2]!==v||t[3]!==y||t[4]!==e||t[5]!==s||t[6]!==N||t[7]!==j?(k=()=>s?"Resume will retry failed steps — succeeded steps are preserved":N?"Workflow is currently running":e?"Save your changes before running":y?"Select an Agent first":j||v?"Add at least one step to the workflow":null,t[2]=v,t[3]=y,t[4]=e,t[5]=s,t[6]=N,t[7]=j,t[8]=k):k=t[8];const E=k();let W;t[9]!==x||t[10]!==h||t[11]!==l||t[12]!==d||t[13]!==s||t[14]!==N||t[15]!==a||t[16]!==i?(W=async()=>{if(s&&i){await h(i);return}if(N&&i){await x(i);return}if(a&&d){m(!0);return}await l({})},t[9]=x,t[10]=h,t[11]=l,t[12]=d,t[13]=s,t[14]=N,t[15]=a,t[16]=i,t[17]=W):W=t[17];const z=W;let I;t[18]!==l?(I=async J=>{await l(J)},t[18]=l,t[19]=I):I=t[19];const L=I,R=s?"Resume":i?n?"Replay":"Running...":a?"Run with input...":"Run workflow",D=!b&&"bg-primary text-primary-foreground hover:bg-primary/90";let F;t[20]!==D?(F=O("gap-2 h-7 px-3",D),t[20]=D,t[21]=F):F=t[21];let P;t[22]!==p||t[23]!==s||t[24]!==c||t[25]!==g||t[26]!==b?(P=(!b&&!c&&!p&&!g||s)&&o.jsx(hn,{size:14}),t[22]=p,t[23]=s,t[24]=c,t[25]=g,t[26]=b,t[27]=P):P=t[27];let H;t[28]!==p||t[29]!==s||t[30]!==c||t[31]!==g||t[32]!==b?(H=b&&!c&&!p&&!g&&!s&&o.jsx(no,{size:14}),t[28]=p,t[29]=s,t[30]=c,t[31]=g,t[32]=b,t[33]=H):H=t[33];let U;t[34]!==p||t[35]!==c||t[36]!==g?(U=(c||p||g)&&o.jsx(st,{size:"xs"}),t[34]=p,t[35]=c,t[36]=g,t[37]=U):U=t[37];let G;t[38]!==R||t[39]!==z||t[40]!==w||t[41]!==F||t[42]!==P||t[43]!==H||t[44]!==U?(G=o.jsxs(te,{variant:"default",size:"sm",className:F,disabled:w,onClick:z,children:[P,H,U,R]}),t[38]=R,t[39]=z,t[40]=w,t[41]=F,t[42]=P,t[43]=H,t[44]=U,t[45]=G):G=t[45];const X=G;let V;t[46]!==X||t[47]!==E?(V=E?o.jsx(gn,{children:o.jsxs(bn,{delayDuration:0,children:[o.jsx(jn,{asChild:!0,children:o.jsx("span",{className:"inline-block",children:X})}),o.jsx(Sn,{side:"bottom",children:E})]})}):X,t[46]=X,t[47]=E,t[48]=V):V=t[48];const q=V;let K;t[49]!==L||t[50]!==d||t[51]!==c||t[52]!==a||t[53]!==f?(K=a&&d&&o.jsx(oi,{open:f,onOpenChange:m,inputSchema:d,onSubmit:L,isPending:c}),t[49]=L,t[50]=d,t[51]=c,t[52]=a,t[53]=f,t[54]=K):K=t[54];let M;return t[55]!==q||t[56]!==K?(M=o.jsxs(o.Fragment,{children:[q,K]}),t[55]=q,t[56]=K,t[57]=M):M=t[57],M}function ai(t){return"toolName"in t.action&&(!t.action.toolName||t.action.toolName==="")}function en(t,e){for(const n of e)if(n===t||n.startsWith(`${t}[`))return!0;return!1}function di(){const t=_.c(13),e=Y(),n=qe(),{item:s}=ue(e);if(!e||!s)return;let i;if(t[0]!==s.completed_steps?.error||t[1]!==s.completed_steps?.success||t[2]!==s.error||t[3]!==s.running_steps||t[4]!==s.status||t[5]!==n){i={};let r;t[7]!==s.completed_steps?.success?(r=new Set(s.completed_steps?.success?.map(ui)??[]),t[7]=s.completed_steps?.success,t[8]=r):r=t[8];const l=r,c=s.completed_steps?.error??[];let a;t[9]!==s.running_steps?(a=s.running_steps??[],t[9]=s.running_steps,t[10]=a):a=t[10];let d;t[11]!==a?(d=new Set(a),t[11]=a,t[12]=d):d=t[12];const u=d,f=s.status,m=s.error!=null?typeof s.error=="string"?s.error:JSON.stringify(s.error):void 0;let x=-1;n.forEach((p,h)=>{(l.has(p.name)||en(p.name,c))&&(x=h)}),n.forEach((p,h)=>{let g="pending",b;en(p.name,c)?(g="error",b=m):l.has(p.name)?g="success":(f==="error"||f==="failed")&&u.has(p.name)?(g="error",b=m):f==="running"&&h===x+1&&(g="running"),i[p.name]={status:g,output:void 0,error:b,stepIndex:h}}),t[0]=s.completed_steps?.error,t[1]=s.completed_steps?.success,t[2]=s.error,t[3]=s.running_steps,t[4]=s.status,t[5]=n,t[6]=i}else i=t[6];return i}function ui(t){return t.name}function fi(t){const e=_.c(97),{step:n,index:s,isSelected:i,executionStatus:r,isSkipped:l,isLastStep:c,onSelect:a,onDelete:d,onDuplicate:u}=t,f=Y(),{item:m}=ue(f),x=m?.completed_steps,p=x?.success,h=x?.error??[];let g;e[0]!==n.name||e[1]!==p?(g=p?.find(B=>B.name===n.name),e[0]=n.name,e[1]=p,e[2]=g):g=e[2];const b=g,S=b?.completed_at_epoch_ms,v=b!=null;let y;e[3]!==n.name?(y=B=>B===n.name||B.startsWith(`${n.name}[`),e[3]=n.name,e[4]=y):y=e[4];const j=h.some(y),w="toolName"in n.action,N=w&&"connectionId"in n.action?n.action.connectionId:null,C=!!(w&&"toolName"in n.action?n.action.toolName:null),E=wi(n),z=(m?.status==="error"||m?.status==="failed")&&m?.running_steps?.includes(n.name),I=v?"success":j||z?"error":r?.status,L=r!==void 0,R=I==="success"||I==="error";let D=E.length>0?60:12;(I==="success"||I==="error")&&(D=D+32);const F=xi(I);let P;e[5]!==I?(P=hi(I),e[5]=I,e[6]=P):P=e[6];const H=P;let U;e[7]===Symbol.for("react.memo_cache_sentinel")?(U=function(gt,us){const Vt=us.split(".").slice(1);if(Vt.length===0)return Array.isArray(gt)?gt:void 0;let me=gt;for(const fs of Vt){if(me==null)return;if(typeof me=="object")me=me[fs];else return}return Array.isArray(me)?me:void 0},e[7]=U):U=e[7];const G=U,X=n.forEach!==void 0,V=n.forEach?.ref;let q;e[8]!==V?(q=V?.replace("@","").split(".")[0],e[8]=V,e[9]=q):q=e[9];const K=q,M=m?.status==="running"||m?.status==="enqueued";let J;e[10]!==p||e[11]!==K?(J=p?.some(B=>B.name===K),e[10]=p,e[11]=K,e[12]=J):J=e[12];const Q=J,$=M?500:!1;let A;e[13]!==Q||e[14]!==$?(A={refetchInterval:$,enabled:Q},e[13]=Q,e[14]=$,e[15]=A):A=e[15];const{output:ee}=Kn(f,K,A);let re;if(e[16]!==ee||e[17]!==V){const B=V?.replace("@","");re=B?G(ee,B):void 0,e[16]=ee,e[17]=V,e[18]=re}else re=e[18];const ie=re;let Z;if(e[19]!==n.name){let B;e[21]===Symbol.for("react.memo_cache_sentinel")?(B=/[.*+?^${}()|[\]\\]/g,e[21]=B):B=e[21],Z=n.name.replace(B,"\\$&"),e[19]=n.name,e[20]=Z}else Z=e[20];const Pe=Z,Ht=new RegExp(`^${Pe}\\[\\d+\\]$`),at=m?.completed_steps?.success?.filter(B=>Ht.test(B.name)),Ae=h.filter(B=>Ht.test(B)),dt=i&&"bg-background border-1 border-border outline outline-offset-3 outline-border/25",ut=I==="running"&&"bg-accent/50",ft=l&&"opacity-50";let pe;e[22]!==dt||e[23]!==ut||e[24]!==ft?(pe=O("flex gap-2 items-start border-1 border-transparent px-4 w-full rounded-lg cursor-pointer group hover:bg-accent/30",dt,ut,ft),e[22]=dt,e[23]=ut,e[24]=ft,e[25]=pe):pe=e[25];const cs="button",as=0;let xe;e[26]!==a?(xe=B=>{(B.key==="Enter"||B.key===" ")&&(B.preventDefault(),a())},e[26]=a,e[27]=xe):xe=e[27];const mt=O("text-xs font-mono opacity-75 h-8 flex items-center",F),pt=s+1;let he;e[28]!==mt||e[29]!==pt?(he=o.jsx("div",{className:"w-5 flex flex-col items-center justify-center shrink-0 pt-3",children:o.jsxs("span",{className:mt,children:[pt,"."]})}),e[28]=mt,e[29]=pt,e[30]=he):he=e[30];let ge;e[31]!==H||e[32]!==s?(ge=s>0?o.jsx(yt,{height:12,color:H}):o.jsx("div",{className:"h-3"}),e[31]=H,e[32]=s,e[33]=ge):ge=e[33];let be;e[34]!==N||e[35]!==C||e[36]!==w||e[37]!==n.name?(be=o.jsx(yi,{connectionId:N,isToolStep:w,hasToolSelected:C,stepName:n.name}),e[34]=N,e[35]=C,e[36]=w,e[37]=n.name,e[38]=be):be=e[38];let je;e[39]!==H||e[40]!==R||e[41]!==I?(je=R&&o.jsxs(o.Fragment,{children:[o.jsx(yt,{height:8,color:H}),o.jsx(gi,{status:I})]}),e[39]=H,e[40]=R,e[41]=I,e[42]=je):je=e[42];let Se;e[43]!==H||e[44]!==D||e[45]!==c||e[46]!==f?(Se=c&&f?null:o.jsx(yt,{height:D,color:H}),e[43]=H,e[44]=D,e[45]=c,e[46]=f,e[47]=Se):Se=e[47];let ye;e[48]!==ge||e[49]!==be||e[50]!==je||e[51]!==Se?(ye=o.jsxs("div",{className:"flex flex-col items-center shrink-0",children:[ge,be,je,Se]}),e[48]=ge,e[49]=be,e[50]=je,e[51]=Se,e[52]=ye):ye=e[52];const ds="flex-1 flex flex-col gap-3 min-w-0 pt-3 pb-3",xt=C?"font-medium text-foreground":"text-foreground";let ve;e[53]!==xt?(ve=O("text-sm truncate flex-1",xt),e[53]=xt,e[54]=ve):ve=e[54];let we;e[55]!==n?(we=vi(n),e[55]=n,e[56]=we):we=e[56];let Ne;e[57]!==ve||e[58]!==we?(Ne=o.jsx("span",{className:ve,children:we}),e[57]=ve,e[58]=we,e[59]=Ne):Ne=e[59];let ke;e[60]!==at?.length||e[61]!==Ae||e[62]!==X||e[63]!==ie?(ke=X&&ie&&ie.length>0&&o.jsxs("span",{className:"text-xs font-mono opacity-75 h-8 flex items-center gap-1",children:[`${(at?.length??0)+Ae.length} / ${ie.length}`,Ae.length>0&&o.jsxs("span",{className:"text-destructive",children:["(",Ae.length," failed)"]})]}),e[60]=at?.length,e[61]=Ae,e[62]=X,e[63]=ie,e[64]=ke):ke=e[64];let _e;e[65]!==L||e[66]!==I?(_e=L&&o.jsx(bi,{status:I}),e[65]=L,e[66]=I,e[67]=_e):_e=e[67];let Ce;e[68]!==ke||e[69]!==_e?(Ce=o.jsxs("div",{className:"flex items-center gap-2",children:[ke,_e]}),e[68]=ke,e[69]=_e,e[70]=Ce):Ce=e[70];let Ie;e[71]!==L||e[72]!==d||e[73]!==u?(Ie=!L&&o.jsxs(vn,{children:[o.jsx(wn,{asChild:!0,children:o.jsx(te,{variant:"ghost",size:"icon",className:"size-7 text-muted-foreground sm:opacity-0 sm:group-hover:opacity-100 transition-opacity",onClick:pi,children:o.jsx(so,{size:14})})}),o.jsxs(Nn,{align:"end",children:[o.jsxs(Ye,{onClick:B=>{B.stopPropagation(),u()},children:[o.jsx(wo,{size:14}),"Duplicate"]}),o.jsxs(Ye,{className:"text-destructive hover:bg-destructive/10! focus:text-destructive",onClick:B=>{B.stopPropagation(),d()},children:[o.jsx(un,{size:14,className:"text-destructive"}),"Delete"]})]})]}),e[71]=L,e[72]=d,e[73]=u,e[74]=Ie):Ie=e[74];let Te;e[75]!==Ne||e[76]!==Ce||e[77]!==Ie?(Te=o.jsxs("div",{className:"flex items-center h-8",children:[Ne,Ce,Ie]}),e[75]=Ne,e[76]=Ce,e[77]=Ie,e[78]=Te):Te=e[78];const ht=E.length>0&&o.jsx("div",{className:"flex flex-wrap gap-1.5",children:E.map(mi)});let Ee;e[79]!==I||e[80]!==S?(Ee=I==="success"&&o.jsx(ji,{completedAtEpochMs:S}),e[79]=I,e[80]=S,e[81]=Ee):Ee=e[81];let $e;e[82]!==r?.error||e[83]!==I?($e=I==="error"&&o.jsx(Si,{error:r?.error}),e[82]=r?.error,e[83]=I,e[84]=$e):$e=e[84];let Oe;e[85]!==Te||e[86]!==ht||e[87]!==Ee||e[88]!==$e?(Oe=o.jsxs("div",{className:ds,children:[Te,ht,Ee,$e]}),e[85]=Te,e[86]=ht,e[87]=Ee,e[88]=$e,e[89]=Oe):Oe=e[89];let Ke;return e[90]!==a||e[91]!==pe||e[92]!==xe||e[93]!==he||e[94]!==ye||e[95]!==Oe?(Ke=o.jsxs("div",{className:pe,onClick:a,role:cs,tabIndex:as,onKeyDown:xe,children:[he,ye,Oe]}),e[90]=a,e[91]=pe,e[92]=xe,e[93]=he,e[94]=ye,e[95]=Oe,e[96]=Ke):Ke=e[96],Ke}function mi(t){return o.jsx("span",{className:"px-1.5 py-1 text-xs text-muted-foreground bg-background border border-border rounded-lg",children:t},t)}function pi(t){return t.stopPropagation()}function xi(t){switch(t){case"success":return"text-success";case"error":return"text-destructive";default:return"text-muted-foreground"}}function hi(t){switch(t){case"success":return"bg-success";case"error":return"bg-destructive";default:return"bg-border"}}function gi(t){const e=_.c(2),{status:n}=t;if(n==="success"){let s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx("div",{className:"size-4 rounded bg-success flex items-center justify-center",children:o.jsx(He,{size:8,className:"text-success-foreground"})}),e[0]=s):s=e[0],s}if(n==="error"){let s;return e[1]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx("div",{className:"size-4 rounded bg-destructive flex items-center justify-center",children:o.jsx(Ot,{size:8,className:"text-destructive-foreground"})}),e[1]=s):s=e[1],s}return null}function bi(t){const e=_.c(3),{status:n}=t;if(n==="success"){let s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx("div",{className:"size-7 flex items-center justify-center",children:o.jsx(He,{size:11,className:"text-success"})}),e[0]=s):s=e[0],s}if(n==="error"){let s;return e[1]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx("div",{className:"size-7 flex items-center justify-center",children:o.jsx(Ot,{size:11,className:"text-destructive"})}),e[1]=s):s=e[1],s}if(n==="running"){let s;return e[2]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx("div",{className:"size-7 flex items-center justify-center",children:o.jsx(ln,{size:11,className:"text-muted-foreground animate-spin"})}),e[2]=s):s=e[2],s}return null}function ji(t){const e=_.c(8),{completedAtEpochMs:n}=t;let s,i;if(e[0]!==n){const a=n!=null&&n>0?new Date(n):null,d=a&&!Number.isNaN(a.getTime());s=d?a.toISOString().split("T")[0]:null,i=d?a.toTimeString().split(" ")[0]:null,e[0]=n,e[1]=s,e[2]=i}else s=e[1],i=e[2];const r=i;let l;e[3]!==s||e[4]!==r?(l=s&&r&&o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(oo,{size:16,className:"text-success"}),o.jsx("span",{className:"text-xs text-success",children:s}),o.jsx("span",{className:"text-xs text-success",children:r})]}),e[3]=s,e[4]=r,e[5]=l):l=e[5];let c;return e[6]!==l?(c=o.jsx("div",{className:"inline-flex items-center gap-3 px-1.5 py-1 bg-success-foreground rounded-lg w-fit",children:l}),e[6]=l,e[7]=c):c=e[7],c}function Si(t){const e=_.c(3),{error:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx(pn,{size:16,className:"text-destructive"}),e[0]=s):s=e[0];const i=n||"Execution failed";let r;return e[1]!==i?(r=o.jsxs("div",{className:"inline-flex items-center gap-1.5 px-1.5 py-1 bg-destructive-foreground rounded-lg w-fit",children:[s,o.jsx("span",{className:"text-xs text-destructive",children:i})]}),e[1]=i,e[2]=r):r=e[2],r}function yi(t){const e=_.c(5),{connectionId:n,isToolStep:s,hasToolSelected:i,stepName:r}=t,l=fo(n??"");if(s&&i&&l?.icon){let a;return e[0]!==l.icon||e[1]!==r?(a=o.jsx("div",{className:"size-8 rounded-lg border border-border/10 bg-background shadow-sm flex items-center justify-center overflow-hidden",children:o.jsx(Lt,{icon:l.icon,name:r,size:"xs",className:"border-0 rounded-none"})}),e[0]=l.icon,e[1]=r,e[2]=a):a=e[2],a}let c;return e[3]!==s?(c=o.jsx("div",{className:"size-8 rounded-lg border border-border/10 bg-background shadow-sm flex items-center justify-center",children:s?o.jsx(kn,{size:16,className:"text-muted-foreground"}):o.jsx($n,{size:16,className:"text-muted-foreground"})}),e[3]=s,e[4]=c):c=e[4],c}function yt(t){const e=_.c(7),{height:n,color:s}=t,i=s===void 0?"bg-border":s;let r;e[0]!==i?(r=O("w-px",i),e[0]=i,e[1]=r):r=e[1];let l;e[2]!==n?(l={height:n},e[2]=n,e[3]=l):l=e[3];let c;return e[4]!==r||e[5]!==l?(c=o.jsx("div",{className:r,style:l}),e[4]=r,e[5]=l,e[6]=c):c=e[6],c}function vi(t){return t.name?t.name:"toolName"in t.action&&t.action.toolName?t.action.toolName:"code"in t.action?t.name||"Code Step":"Select tool..."}function wi(t){const e=t.outputSchema;if(!e||typeof e!="object")return[];const n=e.properties??e.items?.properties;return!n||typeof n!="object"?[]:Object.keys(n).slice(0,5)}function Ni(t){const e=_.c(33),{className:n}=t,s=qe(),i=Vn(),r=di(),{setCurrentStepName:l,deleteStep:c,duplicateStep:a}=se(),d=Y();let u;e[0]!==r||e[1]!==s?(u=r?s.findIndex(y=>r[y.name]?.status==="error"):-1,e[0]=r,e[1]=s,e[2]=u):u=e[2];const f=u;let m;e[3]===Symbol.for("react.memo_cache_sentinel")?(m=o.jsx("div",{children:"Loading..."}),e[3]=m):m=e[3];let x;e[4]!==n?(x=O("h-full flex flex-col p-8 overflow-auto",n),e[4]=n,e[5]=x):x=e[5];let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx(_i,{}),e[6]=p):p=e[6];let h;if(e[7]!==i||e[8]!==c||e[9]!==a||e[10]!==f||e[11]!==l||e[12]!==r||e[13]!==s){let y;e[15]!==i||e[16]!==c||e[17]!==a||e[18]!==f||e[19]!==l||e[20]!==r||e[21]!==s.length?(y=(j,w)=>{const N=r?.[j.name],k=f!==-1&&w>f&&N?.status==="pending",C=w===s.length-1;return o.jsx(fi,{step:j,index:w,isSelected:j.name===i,executionStatus:N,isSkipped:k,isLastStep:C,onSelect:()=>l(j.name),onDelete:()=>c(j.name),onDuplicate:()=>a(j.name)},j.name)},e[15]=i,e[16]=c,e[17]=a,e[18]=f,e[19]=l,e[20]=r,e[21]=s.length,e[22]=y):y=e[22],h=s.map(y),e[7]=i,e[8]=c,e[9]=a,e[10]=f,e[11]=l,e[12]=r,e[13]=s,e[14]=h}else h=e[14];let g;e[23]!==h?(g=o.jsx("div",{className:"pt-3 -space-y-1",children:h}),e[23]=h,e[24]=g):g=e[24];let b;e[25]!==d?(b=d?null:o.jsx(Ti,{}),e[25]=d,e[26]=b):b=e[26];let S;e[27]!==g||e[28]!==b?(S=o.jsxs("div",{className:"w-full -space-y-1",children:[p,g,b]}),e[27]=g,e[28]=b,e[29]=S):S=e[29];let v;return e[30]!==x||e[31]!==S?(v=o.jsx(T.Suspense,{fallback:m,children:o.jsx("div",{className:x,children:S})}),e[30]=x,e[31]=S,e[32]=v):v=e[32],v}const tn=60;function ki(t){if(t==null)return"null";if(typeof t=="string")return nn(t,tn);if(typeof t=="number"||typeof t=="boolean")return String(t);let e;try{e=JSON.stringify(t)}catch{return typeof t=="object"?"[Object]":String(t)}return nn(e,tn)}function nn(t,e){return t.length<=e?t:`${t.slice(0,e)}…`}function _i(){const t=_.c(42),e=de(),n=qn(),s=Y(),{setCurrentStepName:i}=se(),{item:r}=ue(s),l=r?.input,c=!!s,d=e.input_schema?.properties;let u;t[0]!==d?(u=d?Object.keys(d):[],t[0]=d,t[1]=u):u=t[1];const f=u;let m,x,p,h,g,b,S,v,y,j;if(t[2]!==l||t[3]!==f||t[4]!==n||t[5]!==c||t[6]!==i){const k=c?Object.entries(l??{}):[],C=n&&"bg-background border-1 border-border outline outline-offset-3 outline-border/25";t[17]!==C?(g=O("flex gap-2 items-start border-1 border-transparent px-4 w-full rounded-lg cursor-pointer group hover:bg-accent/30",C),t[17]=C,t[18]=g):g=t[18],t[19]!==i?(b=()=>i(Ze),t[19]=i,t[20]=b):b=t[20],S="button",v=0,t[21]!==i?(y=I=>{(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),i(Ze))},t[21]=i,t[22]=y):y=t[22],t[23]===Symbol.for("react.memo_cache_sentinel")?(j=o.jsx("div",{className:"w-5 shrink-0"}),t[23]=j):j=t[23];let E;t[24]===Symbol.for("react.memo_cache_sentinel")?(E=o.jsx("div",{className:"h-3"}),t[24]=E):E=t[24],t[25]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsxs("div",{className:"flex flex-col items-center shrink-0",children:[E,o.jsx("div",{className:"size-8 rounded-lg border border-border/10 bg-background shadow-sm flex items-center justify-center",children:o.jsx(xn,{size:16,className:"text-muted-foreground"})}),o.jsx("div",{className:"w-px h-3 bg-border"})]}),t[25]=x):x=t[25],m="flex-1 flex flex-col gap-2 min-w-0 pt-3 pb-3";let W;t[26]===Symbol.for("react.memo_cache_sentinel")?(W=o.jsx("span",{className:"text-sm font-medium text-foreground truncate flex-1",children:"Workflow Input"}),t[26]=W):W=t[26];const z=c?k.length>0&&o.jsxs("span",{className:"text-xs text-muted-foreground",children:[k.length," value",k.length!==1?"s":""]}):f.length>0&&o.jsxs("span",{className:"text-xs text-muted-foreground",children:[f.length," field",f.length!==1?"s":""]});t[27]!==z?(p=o.jsxs("div",{className:"flex items-center h-8",children:[W,z]}),t[27]=z,t[28]=p):p=t[28],h=c?k.length>0&&o.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[k.slice(0,5).map(Ii),k.length>5&&o.jsxs("span",{className:"text-xs text-muted-foreground",children:["+",k.length-5," more"]})]}):f.length>0&&o.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[f.slice(0,5).map(Ci),f.length>5&&o.jsxs("span",{className:"px-1.5 py-1 text-xs text-muted-foreground",children:["+",f.length-5," more"]})]}),t[2]=l,t[3]=f,t[4]=n,t[5]=c,t[6]=i,t[7]=m,t[8]=x,t[9]=p,t[10]=h,t[11]=g,t[12]=b,t[13]=S,t[14]=v,t[15]=y,t[16]=j}else m=t[7],x=t[8],p=t[9],h=t[10],g=t[11],b=t[12],S=t[13],v=t[14],y=t[15],j=t[16];let w;t[29]!==m||t[30]!==p||t[31]!==h?(w=o.jsxs("div",{className:m,children:[p,h]}),t[29]=m,t[30]=p,t[31]=h,t[32]=w):w=t[32];let N;return t[33]!==x||t[34]!==w||t[35]!==g||t[36]!==b||t[37]!==S||t[38]!==v||t[39]!==y||t[40]!==j?(N=o.jsxs("div",{className:g,onClick:b,role:S,tabIndex:v,onKeyDown:y,children:[j,x,w]}),t[33]=x,t[34]=w,t[35]=g,t[36]=b,t[37]=S,t[38]=v,t[39]=y,t[40]=j,t[41]=N):N=t[41],N}function Ci(t){return o.jsx("span",{className:"px-1.5 py-1 text-xs text-muted-foreground bg-background border border-border rounded-lg",children:t},t)}function Ii(t){const[e,n]=t;return o.jsxs("div",{className:"flex items-baseline gap-1.5 text-xs min-w-0",children:[o.jsxs("span",{className:"text-muted-foreground shrink-0 max-w-[40%] truncate",children:[e,":"]}),o.jsx("span",{className:"text-foreground truncate font-mono min-w-0",children:ki(n)})]},e)}function Ti(){const t=_.c(15),{addToolStep:e,addCodeStep:n}=se();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx("div",{className:"w-5 shrink-0"}),t[0]=s):s=t[0];let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx("div",{className:"w-px h-3 bg-border"}),t[1]=i):i=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx(wn,{asChild:!0,children:o.jsx(te,{variant:"outline",size:"icon",className:"size-8 rounded-lg",children:o.jsx(jo,{size:14})})}),t[2]=r):r=t[2];let l;t[3]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx(kn,{size:14}),t[3]=l):l=t[3];let c;t[4]!==e?(c=o.jsxs(Ye,{onClick:e,children:[l,"Tool Step"]}),t[4]=e,t[5]=c):c=t[5];let a;t[6]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx($n,{size:14}),t[6]=a):a=t[6];let d;t[7]!==n?(d=o.jsxs(Ye,{onClick:n,children:[a,"Code Step"]}),t[7]=n,t[8]=d):d=t[8];let u;t[9]!==c||t[10]!==d?(u=o.jsxs(vn,{children:[r,o.jsxs(Nn,{align:"start",children:[c,d]})]}),t[9]=c,t[10]=d,t[11]=u):u=t[11];let f;t[12]===Symbol.for("react.memo_cache_sentinel")?(f=o.jsx("div",{className:"w-px h-8",style:{backgroundImage:"repeating-linear-gradient(180deg, var(--border), var(--border) 4px, transparent 4px, transparent 8px)",backgroundPosition:"left top",backgroundRepeat:"repeat-y",backgroundSize:"2px 100%"}}),t[12]=f):f=t[12];let m;return t[13]!==u?(m=o.jsxs("div",{className:"flex gap-2 items-start px-4 pb-3",children:[s,o.jsxs("div",{className:"flex flex-col border-1 border-transparent items-center shrink-0",children:[i,u,f]})]}),t[13]=u,t[14]=m):m=t[14],m}function Ei(){const t=_.c(14),{org:e}=oe(),n=Ue();let s;t[0]!==e.id||t[1]!==n?(s=n??Fe(e.id),t[0]=e.id,t[1]=n,t[2]=s):s=t[2];const i=s;let r;t[3]!==e.id||t[4]!==i?(r={connectionId:i,orgId:e.id},t[3]=e.id,t[4]=i,t[5]=r):r=t[5];const l=ae(r);let c;t[6]!==l?(c={client:l},t[6]=l,t[7]=c):c=t[7];const a=yn(c);let d;t[8]!==a.data?.tools?(d=a.data?.tools??[],t[8]=a.data?.tools,t[9]=d):d=t[9];let u;return t[10]!==d||t[11]!==a.error||t[12]!==a.isLoading?(u={tools:d,isLoading:a.isLoading,error:a.error},t[10]=d,t[11]=a.error,t[12]=a.isLoading,t[13]=u):u=t[13],u}function $i(t){const e=_.c(2),{className:n}=t;let s;return e[0]!==n?(s=o.jsx(Oi,{className:n}),e[0]=n,e[1]=s):s=e[1],s}function Oi(t){const e=_.c(38),{className:n}=t,{tools:s,isLoading:i,error:r}=Ei(),l=Ve(),{updateStep:c}=se(),d=l&&"toolName"in l.action&&"toolName"in l.action?l.action.toolName:null;let u;if(e[0]!==d||e[1]!==s){let j;e[3]!==d?(j=w=>w.name===d,e[3]=d,e[4]=j):j=e[4],u=s.find(j),e[0]=d,e[1]=s,e[2]=u}else u=e[2];const m=ar(s,u??null,Mi,Ri);let x;e[5]!==l||e[6]!==c?(x=j=>{l&&c(l.name,{action:{...l.action,toolName:j.name},outputSchema:j.outputSchema??{}})},e[5]=l,e[6]=c,e[7]=x):x=e[7];const p=x;if(i){let j;e[8]!==n?(j=O("flex flex-col h-full bg-sidebar",n),e[8]=n,e[9]=j):j=e[9];let w;e[10]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsx(st,{size:"sm"})}),e[10]=w):w=e[10];let N;return e[11]!==j?(N=o.jsx("div",{className:j,children:w}),e[11]=j,e[12]=N):N=e[12],N}if(r){let j;e[13]!==n?(j=O("flex flex-col h-full bg-sidebar",n),e[13]=n,e[14]=j):j=e[14];let w;e[15]!==r.message?(w=o.jsxs("div",{className:"flex-1 flex items-center justify-center text-sm text-destructive p-4 text-center",children:["Failed to load tools: ",r.message]}),e[15]=r.message,e[16]=w):w=e[16];let N;return e[17]!==j||e[18]!==w?(N=o.jsx("div",{className:j,children:w}),e[17]=j,e[18]=w,e[19]=N):N=e[19],N}let h;e[20]!==n?(h=O("flex flex-col h-full bg-sidebar",n),e[20]=n,e[21]=h):h=e[21];let g;e[22]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsx("span",{className:"text-base font-medium text-foreground",children:"Select tool"}),e[22]=g):g=e[22];let b;e[23]!==s.length?(b=o.jsx("div",{className:"flex items-start border-b border-border",children:o.jsxs("div",{className:"flex-1 flex items-center h-12 px-5",children:[g,o.jsxs("span",{className:"ml-2 text-sm text-muted-foreground",children:["(",s.length,")"]})]})}),e[23]=s.length,e[24]=b):b=e[24];let S;if(e[25]!==p||e[26]!==m||e[27]!==d){let j;e[29]!==p||e[30]!==d?(j=w=>o.jsx(Li,{icon:null,title:w.name,description:w.description,isSelected:w.name===d,onClick:()=>p(w)},w.name),e[29]=p,e[30]=d,e[31]=j):j=e[31],S=m.map(j),e[25]=p,e[26]=m,e[27]=d,e[28]=S}else S=e[28];let v;e[32]!==S?(v=o.jsx("div",{className:"flex-1 overflow-auto",children:S}),e[32]=S,e[33]=v):v=e[33];let y;return e[34]!==h||e[35]!==b||e[36]!==v?(y=o.jsxs("div",{className:h,children:[b,v]}),e[34]=h,e[35]=b,e[36]=v,e[37]=y):y=e[37],y}function Ri(t,e){return t.name.localeCompare(e.name)}function Mi(t){return t.name}function Li(t){const e=_.c(20),{icon:n,title:s,description:i,isSelected:r,onClick:l}=t,c=r&&"bg-muted/50";let a;e[0]!==c?(a=O("flex items-start gap-2.5 min-h-14 px-5 py-4 cursor-pointer transition-colors","hover:bg-muted/50",c),e[0]=c,e[1]=a):a=e[1];let d;e[2]!==l?(d=h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),l())},e[2]=l,e[3]=d):d=e[3];let u;e[4]!==n||e[5]!==s?(u=o.jsx(Lt,{icon:n,name:s,size:"xs",className:"shadow-sm mt-0.5"}),e[4]=n,e[5]=s,e[6]=u):u=e[6];let f;e[7]!==s?(f=o.jsx("span",{className:"text-sm font-medium text-foreground truncate block",children:s}),e[7]=s,e[8]=f):f=e[8];let m;e[9]!==i?(m=i&&o.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:i}),e[9]=i,e[10]=m):m=e[10];let x;e[11]!==f||e[12]!==m?(x=o.jsxs("div",{className:"flex-1 min-w-0",children:[f,m]}),e[11]=f,e[12]=m,e[13]=x):x=e[13];let p;return e[14]!==l||e[15]!==a||e[16]!==d||e[17]!==u||e[18]!==x?(p=o.jsxs("div",{className:a,onClick:l,role:"button",tabIndex:0,onKeyDown:d,children:[u,x]}),e[14]=l,e[15]=a,e[16]=d,e[17]=u,e[18]=x,e[19]=p):p=e[19],p}function Pi(t){const{updateStep:e}=se(),s=t&&"toolName"in t.action&&"toolName"in t.action?t.action.toolName:null,{tool:i}=Ft(s??"");t&&s&&i?.outputSchema&&(!t.outputSchema||Object.keys(t.outputSchema).length===0)&&queueMicrotask(()=>{e(t.name,{outputSchema:i.outputSchema})})}function Ai(t){const e=_.c(41),{className:n}=t,s=Ve();Pi(s);const i=Y(),{item:r}=ue(i);if(!s){let N;e[0]!==n?(N=O("flex flex-col h-full bg-sidebar",n),e[0]=n,e[1]=N):N=e[1];let k;e[2]===Symbol.for("react.memo_cache_sentinel")?(k=o.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground gap-2 flex-col",children:"Select or create a step to configure"}),e[2]=k):k=e[2];let C;return e[3]!==N?(C=o.jsx("div",{className:N,children:k}),e[3]=N,e[4]=C):C=e[4],C}const l=s?.name;let c;e[5]!==r?.completed_steps?.error?(c=r?.completed_steps?.error??[],e[5]=r?.completed_steps?.error,e[6]=c):c=e[6];const a=c;let d;if(e[7]!==l||e[8]!==a){let N;e[10]!==l?(N=k=>k===l||k.startsWith(`${l}[`),e[10]=l,e[11]=N):N=e[11],d=a.some(N),e[7]=l,e[8]=a,e[9]=d}else d=e[9];const u=d,f=r?.status==="error"||r?.status==="failed";let m;e[12]!==l||e[13]!==f||e[14]!==r?.running_steps?(m=f&&r?.running_steps?.includes(l??""),e[12]=l,e[13]=f,e[14]=r?.running_steps,e[15]=m):m=e[15];const x=m,p=!!(r?.completed_steps?.success?.some(N=>N.name===l)||u||x),h=u||x;let g;e[16]!==n?(g=O("flex flex-col h-full bg-sidebar overflow-scroll",n),e[16]=n,e[17]=g):g=e[17];let b,S;e[18]!==s?(b=o.jsx(zi,{step:s}),S=o.jsx(Di,{step:s}),e[18]=s,e[19]=b,e[20]=S):(b=e[19],S=e[20]);let v;e[21]!==s||e[22]!==l||e[23]!==r||e[24]!==p||e[25]!==h||e[26]!==i?(v=i&&o.jsx(Vi,{step:s,defaultOpen:p,isStepErrored:h,executionError:h&&r?.error!=null?typeof r.error=="string"?r.error:JSON.stringify(r.error):void 0},`${l}-${p?"open":"closed"}`),e[21]=s,e[22]=l,e[23]=r,e[24]=p,e[25]=h,e[26]=i,e[27]=v):v=e[27];let y;e[28]!==s||e[29]!==i?(y=!i&&o.jsx(Ji,{step:s}),e[28]=s,e[29]=i,e[30]=y):y=e[30];let j;e[31]!==s||e[32]!==i?(j=!i&&o.jsx(Yi,{step:s}),e[31]=s,e[32]=i,e[33]=j):j=e[33];let w;return e[34]!==g||e[35]!==b||e[36]!==S||e[37]!==v||e[38]!==y||e[39]!==j?(w=o.jsxs("div",{className:g,children:[b,S,v,y,j]}),e[34]=g,e[35]=b,e[36]=S,e[37]=v,e[38]=y,e[39]=j,e[40]=w):w=e[40],w}function zi(t){const e=_.c(15),{step:n}=t,i="toolName"in n.action&&"toolName"in n.action?n.action.toolName:null,r=Y(),l=i??"";let c;e[0]!==l?(c=o.jsx(Lt,{icon:null,name:l,size:"xs",className:"shadow-sm"}),e[0]=l,e[1]=c):c=e[1];let a;e[2]!==i?(a=o.jsx("span",{className:"text-base font-medium text-foreground truncate flex-1",children:i}),e[2]=i,e[3]=a):a=e[3];let d;e[4]!==r?(d=r?null:o.jsx(Wi,{}),e[4]=r,e[5]=d):d=e[5];let u;e[6]!==c||e[7]!==a||e[8]!==d?(u=o.jsxs("div",{className:"flex items-center gap-2",children:[c,a,d]}),e[6]=c,e[7]=a,e[8]=d,e[9]=u):u=e[9];let f;e[10]!==n.description?(f=n.description&&o.jsx("p",{className:"text-sm text-muted-foreground",children:n.description}),e[10]=n.description,e[11]=f):f=e[11];let m;return e[12]!==u||e[13]!==f?(m=o.jsxs("div",{className:"border-b border-border p-5 shrink-0 flex flex-col gap-2",children:[u,f]}),e[12]=u,e[13]=f,e[14]=m):m=e[14],m}function Wi(){const t=_.c(9),e=Ve(),{updateStep:n,startReplacingTool:s}=se(),i=Y(),l=e&&"toolName"in e.action?e.action.toolName:null;let c;t[0]!==e||t[1]!==s||t[2]!==l||t[3]!==i||t[4]!==n?(c=()=>{if(e){if(i){ks.error("You cannot replace a tool while a workflow is executing.");return}l&&s(l),n(e.name,{action:{...e.action,toolName:""}})}},t[0]=e,t[1]=s,t[2]=l,t[3]=i,t[4]=n,t[5]=c):c=t[5];const a=c;let d;t[6]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx(io,{size:14}),t[6]=d):d=t[6];let u;return t[7]!==a?(u=o.jsx(te,{variant:"ghost",size:"icon",className:"size-7",onClick:a,title:"Replace tool",children:d}),t[7]=a,t[8]=u):u=t[8],u}function Ft(t){const e=_.c(16),{org:n}=oe(),s=Ue();let i;e[0]!==n.id||e[1]!==s?(i=s??Fe(n.id),e[0]=n.id,e[1]=s,e[2]=i):i=e[2];const r=i;let l;e[3]!==n.id||e[4]!==r?(l={connectionId:r,orgId:n.id},e[3]=n.id,e[4]=r,e[5]=l):l=e[5];const c=ae(l);let a;e[6]!==c?(a={client:c},e[6]=c,e[7]=a):a=e[7];const d=yn(a);let u;e[8]!==t||e[9]!==d.data?.tools?(u=d.data?.tools?.find(x=>x.name===t),e[8]=t,e[9]=d.data?.tools,e[10]=u):u=e[10];const f=u;let m;return e[11]!==f||e[12]!==d.error||e[13]!==d.isLoading||e[14]!==d.isSuccess?(m={tool:f,isLoading:d.isLoading,isReady:d.isSuccess,error:d.error},e[11]=f,e[12]=d.error,e[13]=d.isLoading,e[14]=d.isSuccess,e[15]=m):m=e[15],m}function Di(t){const e=_.c(21),{step:n}=t,{updateStep:s}=se(),r="toolName"in n.action&&"toolName"in n.action?n.action.toolName:null,l=Y(),{tool:c}=Ft(r??""),a=cr(n.name),d=n.input,u=c?.inputSchema??null;let f;e[0]!==d||e[1]!==u?(f=!u&&d&&Object.keys(d).length>0?Fi(d):null,e[0]=d,e[1]=u,e[2]=f):f=e[2];const x=u??f;if(!x)return null;let p;e[3]!==n.name||e[4]!==s?(p=E=>{s(n.name,{input:E})},e[3]=n.name,e[4]=s,e[5]=p):p=e[5];const h=p;let g;e[6]!==x||e[7]!==n.input||e[8]!==l?(g=l?Hi(x,n.input):x,e[6]=x,e[7]=n.input,e[8]=l,e[9]=g):g=e[9];const b=g,S=l?"output":"input";let v;e[10]===Symbol.for("react.memo_cache_sentinel")?(v=o.jsx(Ms,{className:"px-5 py-5",children:o.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"Input"})}),e[10]=v):v=e[10];const y=n.name+l,j=!!l,w=b,N=n.input;let k;e[11]!==h||e[12]!==a||e[13]!==y||e[14]!==j||e[15]!==w||e[16]!==N?(k=o.jsxs(Ls,{value:"input",className:"border-b-0",children:[v,o.jsx(Ps,{className:"px-5 pt-2",children:o.jsx(Dt,{readOnly:j,inputSchema:w,inputParams:N,setInputParams:h,mentions:a},y)})]}),e[11]=h,e[12]=a,e[13]=y,e[14]=j,e[15]=w,e[16]=N,e[17]=k):k=e[17];let C;return e[18]!==k||e[19]!==S?(C=o.jsx(As,{type:"single",collapsible:!0,defaultValue:S,className:"border-b border-border shrink-0",children:k}),e[18]=k,e[19]=S,e[20]=C):C=e[20],C}function Fi(t){const e={};for(const n of Object.keys(t))e[n]={type:"string"};return{type:"object",properties:e}}function Hi(t,e){const n=structuredClone(t),s=n.properties;return s&&Object.keys(s).forEach(i=>{e[i]||delete s[i]}),n}function Vi(t){const e=_.c(42),{step:n,defaultOpen:s,isStepErrored:i,executionError:r}=t,l=n.outputSchema,c=Y(),{item:a}=ue(c),d=a?.completed_steps?.error??[];let u;e[0]!==n.name?(u=Z=>Z===n.name||Z.startsWith(`${n.name}[`),e[0]=n.name,e[1]=u):u=e[1];const f=d.some(u),x=(a?.status==="error"||a?.status==="failed")&&a?.running_steps?.includes(n.name),p=!!(a?.completed_steps?.success?.some(Z=>Z.name===n.name)||f||x),[h,g]=T.useState(s),b=n.forEach!==void 0,[S,v]=T.useState("all"),y=b?new RegExp(`^${n.name}\\[(\\d+)\\]$`):null,j=b?(a?.completed_steps?.success??[]).filter(Z=>y.test(Z.name)).map(Z=>{const Pe=Z.name.match(y);return{index:Number(Pe[1]),status:"success"}}):[],N=(b?d.filter(Z=>y.test(Z)):[]).map(Z=>{const Pe=Z.match(y);return{index:Number(Pe[1]),status:"error"}}),k=[...j,...N].sort(Ui),C=k.length>0,E=b&&S!=="all"?`${n.name}[${S}]`:void 0,W=p?n.name:void 0,z=E??W,{output:I,error:L}=Kn(c,z);let R;e[2]!==L||e[3]!==r||e[4]!==i||e[5]!==I?(R=I||(L?{error:L}:i&&r?{error:r}:void 0),e[2]=L,e[3]=r,e[4]=i,e[5]=I,e[6]=R):R=e[6];const D=R,F=l&&typeof l=="object"?l.properties:void 0;let P;e[7]!==F?(P=F?Object.entries(F):[],e[7]=F,e[8]=P):P=e[8];const H=P,U=S!=="all"&&N.some(Z=>Z.index===S),G=S==="all"?i||f||x:U,X=h?"flex-1 min-h-0 overflow-hidden":"shrink-0";let V;e[9]!==X?(V=O("flex flex-col border-b border-border",X),e[9]=X,e[10]=V):V=e[10];let q;e[11]!==h||e[12]!==g?(q=()=>g(!h),e[11]=h,e[12]=g,e[13]=q):q=e[13];const K=G?"text-destructive":"text-muted-foreground";let M;e[14]!==K?(M=O("text-sm font-medium",K),e[14]=K,e[15]=M):M=e[15];const J=G?"Error":"Output";let Q;e[16]!==M||e[17]!==J?(Q=o.jsx("h3",{className:M,children:J}),e[16]=M,e[17]=J,e[18]=Q):Q=e[18];let $;e[19]!==h?($=h?o.jsx(rt,{size:14,className:"text-muted-foreground"}):o.jsx(ot,{size:14,className:"text-muted-foreground"}),e[19]=h,e[20]=$):$=e[20];let A;e[21]!==Q||e[22]!==$?(A=o.jsxs("div",{className:"flex items-center justify-between",children:[Q,$]}),e[21]=Q,e[22]=$,e[23]=A):A=e[23];let ee;e[24]!==A||e[25]!==q?(ee=o.jsx("div",{className:"p-5 shrink-0 cursor-pointer hover:bg-accent/50 transition-colors",onClick:q,children:A}),e[24]=A,e[25]=q,e[26]=ee):ee=e[26];let re;e[27]!==k||e[28]!==D||e[29]!==C||e[30]!==b||e[31]!==h||e[32]!==H||e[33]!==S||e[34]!==v||e[35]!==n.name||e[36]!==c?(re=h&&o.jsxs(o.Fragment,{children:[c&&b&&C&&o.jsx(Ki,{iterations:k,selectedIteration:S,onSelect:v}),c&&D?o.jsx("div",{className:"flex-1 min-h-0",children:o.jsx(Re,{code:JSON.stringify(D,null,2),language:"json",height:"100%",readOnly:!0},`output-${n.name}-${S}`)}):null,!c&&H.length>0&&o.jsx("div",{className:"flex-1 min-h-0 overflow-auto px-5",children:H.map(qi)})]}),e[27]=k,e[28]=D,e[29]=C,e[30]=b,e[31]=h,e[32]=H,e[33]=S,e[34]=v,e[35]=n.name,e[36]=c,e[37]=re):re=e[37];let ie;return e[38]!==ee||e[39]!==re||e[40]!==V?(ie=o.jsxs("div",{className:V,children:[ee,re]}),e[38]=ee,e[39]=re,e[40]=V,e[41]=ie):ie=e[41],ie}function qi(t){const[e,n]=t;return o.jsx(Xi,{name:e,schema:n},e)}function Ui(t,e){return t.index-e.index}function Ki(t){const e=_.c(21),{iterations:n,selectedIteration:s,onSelect:i}=t,r=s==="all"?"bg-accent border-border text-foreground":"bg-transparent border-transparent text-muted-foreground hover:bg-accent/50 hover:text-foreground";let l;e[0]!==r?(l=O("h-7 px-3 text-xs font-medium rounded-lg border transition-colors inline-flex gap-1.5 items-center",r),e[0]=r,e[1]=l):l=e[1];let c;e[2]!==i?(c=()=>i("all"),e[2]=i,e[3]=c):c=e[3];let a;e[4]!==l||e[5]!==c?(a=o.jsx("button",{type:"button",className:l,onClick:c,children:"All Results"}),e[4]=l,e[5]=c,e[6]=a):a=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx("div",{className:"w-px h-4 bg-border mx-1"}),e[7]=d):d=e[7];let u;if(e[8]!==n||e[9]!==i||e[10]!==s){let p;e[12]!==i||e[13]!==s?(p=h=>{const g=s===h.index;return o.jsxs("button",{type:"button",className:O("h-7 px-2.5 text-xs font-medium rounded-lg border transition-colors inline-flex gap-1.5 items-center",g?"bg-accent border-border text-foreground":"bg-transparent border-transparent text-muted-foreground hover:bg-accent/50 hover:text-foreground"),onClick:()=>i(h.index),children:[h.status==="success"?o.jsx(He,{size:12,className:"text-success"}):o.jsx(Ot,{size:12,className:"text-destructive"}),o.jsxs("span",{className:"font-mono",children:["#",h.index]})]},h.index)},e[12]=i,e[13]=s,e[14]=p):p=e[14],u=n.map(p),e[8]=n,e[9]=i,e[10]=s,e[11]=u}else u=e[11];let f;e[15]!==a||e[16]!==u?(f=o.jsxs("div",{className:"flex w-max items-center gap-2 pb-3",children:[a,d,u]}),e[15]=a,e[16]=u,e[17]=f):f=e[17];let m;e[18]===Symbol.for("react.memo_cache_sentinel")?(m=o.jsx(Js,{orientation:"horizontal"}),e[18]=m):m=e[18];let x;return e[19]!==f?(x=o.jsx("div",{className:"px-5 pb-3 shrink-0 border-b border-border/50",children:o.jsxs(Gs,{className:"w-full whitespace-nowrap",children:[f,m]})}),e[19]=f,e[20]=x):x=e[20],x}function Bi(t){switch(t){case"string":return{Icon:An,color:"text-blue-500"};case"number":case"integer":return{Icon:Mn,color:"text-blue-500"};case"array":return{Icon:En,color:"text-purple-500"};case"object":return{Icon:Tn,color:"text-orange-500"};case"boolean":return{Icon:Pn,color:"text-pink-500"};case"null":return{Icon:$t,color:"text-gray-500"};default:return{Icon:On,color:"text-muted-foreground"}}}function Xi(t){const e=_.c(28),{name:n,schema:s}=t,i=Ve(),r=s.type??"unknown";let l,c,a,d,u;if(e[0]!==r){const{Icon:y,color:j}=Bi(r);u="flex items-center gap-2",d="flex-1 flex items-center gap-2",l=y,c=14,a=O(j),e[0]=r,e[1]=l,e[2]=c,e[3]=a,e[4]=d,e[5]=u}else l=e[1],c=e[2],a=e[3],d=e[4],u=e[5];let f;e[6]!==l||e[7]!==c||e[8]!==a?(f=o.jsx(l,{size:c,className:a}),e[6]=l,e[7]=c,e[8]=a,e[9]=f):f=e[9];let m;e[10]!==n?(m=o.jsx("span",{className:"text-sm font-medium text-foreground",children:n}),e[10]=n,e[11]=m):m=e[11];let x;e[12]!==d||e[13]!==f||e[14]!==m?(x=o.jsxs("div",{className:d,children:[f,m]}),e[12]=d,e[13]=f,e[14]=m,e[15]=x):x=e[15];let p;e[16]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx(ro,{size:14,className:"opacity-50"}),e[16]=p):p=e[16];const h=i?.name;let g;e[17]!==h?(g=o.jsxs("span",{className:"text-muted-foreground",children:[h,"."]}),e[17]=h,e[18]=g):g=e[18];let b;e[19]!==n?(b=o.jsx("div",{className:"bg-blue-500/10 text-blue-500 px-1 py-0.5 rounded",children:n}),e[19]=n,e[20]=b):b=e[20];let S;e[21]!==g||e[22]!==b?(S=o.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[p,g,b]}),e[21]=g,e[22]=b,e[23]=S):S=e[23];let v;return e[24]!==S||e[25]!==u||e[26]!==x?(v=o.jsxs("div",{className:u,children:[x,S]}),e[24]=S,e[25]=u,e[26]=x,e[27]=v):v=e[27],v}function Ji(t){const e=_.c(29),{step:n}=t,{updateStep:s}=se(),i=Y(),[r,l]=T.useState(!1),c="toolName"in n.action,a=c&&"toolName"in n.action?n.action.toolName:null,{tool:d}=Ft(a??""),u=c&&"transformCode"in n.action?n.action.transformCode??null:null;let f;e[0]!==d?(f=()=>{if(!d?.outputSchema)return`interface Input {
|
|
7
|
+
${t.trimStart()}`;const s=n.index,i=s+n[0].length-1;let r=1,l=i+1;for(;l<t.length&&r>0;)t[l]==="{"?r++:t[l]==="}"&&r--,l++;return t.slice(0,s)+e+t.slice(l)}function Je(t,e){switch(t){case"tool":return{input:{},action:{toolName:""},outputSchema:{},name:`Step_${e+1}`};case"code":return{...Ts,name:`Step_${e+1}`};default:throw new Error(`Invalid step type: ${t}`)}}const Hn=T.createContext(null),Po=t=>Pt()(Wn(e=>({...t,actions:{setIsAddingStep:n=>e(s=>({...s,isAddingStep:n})),setCurrentStepTab:n=>e(s=>({...s,currentStepTab:n})),setToolAction:n=>e(s=>({workflow:{...s.workflow,steps:s.workflow.steps.map(i=>"toolName"in i.action&&i.action.toolName===n.toolName?{...i,action:n}:i)}})),appendStep:({step:n,type:s})=>e(i=>{const r=n??Je(s,i.workflow.steps.length),l=i.workflow.steps.find(a=>a.name===r.name),c=l?`${r.name} ${parseInt(l.name.split(" ").pop()??Math.random().toString(36).substring(2,15))+1}`:r.name;return{workflow:{...i.workflow,steps:[...i.workflow.steps,{...r,name:c}]}}}),deleteStep:n=>e(s=>({workflow:{...s.workflow,steps:s.workflow.steps.filter(i=>i.name!==n)}})),duplicateStep:n=>e(s=>{const i=s.workflow.steps.findIndex(a=>a.name===n);if(i===-1)return s;const r=s.workflow.steps[i];if(!r)return s;const l={...r,name:Xe(r.name,s.workflow.steps)},c=[...s.workflow.steps];return c.splice(i+1,0,l),{workflow:{...s.workflow,steps:c},currentStepName:l.name}}),setCurrentStepName:n=>e(s=>({...s,currentStepName:n})),updateStep:(n,s)=>e(i=>({...i,workflow:{...i.workflow,steps:i.workflow.steps.map(r=>r.name===n?{...r,...s}:r)}})),setTrackingExecutionId:n=>e(s=>({...s,trackingExecutionId:n})),resetToOriginalWorkflow:()=>e(n=>({...n,workflow:n.originalWorkflow})),startAddingStep:n=>e(s=>({...s,isAddingStep:!0,addingStepType:n})),cancelAddingStep:()=>e(n=>({...n,isAddingStep:!1,addingStepType:null,selectedParentSteps:[]})),toggleParentStepSelection:n=>e(s=>{const i=s.selectedParentSteps.includes(n);return{...s,selectedParentSteps:i?s.selectedParentSteps.filter(r=>r!==n):[...s.selectedParentSteps,n]}}),confirmAddCodeStep:()=>e(n=>{const{selectedParentSteps:s,addingStepType:i,workflow:r}=n;if(i!=="code"||s.length===0)return n;const l={};for(const f of s)l[f]=`@${f}`;const c={};for(const f of s){const m=r.steps.find(x=>x.name===f);m?.outputSchema&&(c[f]=m.outputSchema)}const a=Object.keys(c).length>0?{type:"object",properties:c,required:Object.keys(c)}:void 0;let d=Je("code",Number((Math.random()*1e6).toFixed(0)));if(d={...d,input:l},a){const f=Dn(a,"Input"),m=d.action,x=Fn(m.code,f);d={...d,action:{...m,code:x}}}const u=Xe(d.name,r.steps);return{...n,isAddingStep:!1,addingStepType:null,selectedParentSteps:[],workflow:{...r,steps:[...r.steps,{...d,name:u}]},currentStepName:u}}),addToolStep:()=>e(n=>{let s=Je("tool",Number((Math.random()*1e6).toFixed(0)));const i=Xe(s.name,n.workflow.steps);return{...n,isAddingStep:!1,addingStepType:null,workflow:{...n.workflow,steps:[...n.workflow.steps,{...s,name:i}]},currentStepName:i}}),addCodeStep:()=>e(n=>{const s=Je("code",Number((Math.random()*1e6).toFixed(0))),i=Xe(s.name,n.workflow.steps);return{...n,isAddingStep:!1,addingStepType:null,workflow:{...n.workflow,steps:[...n.workflow.steps,{...s,name:i}]},currentStepName:i}}),setWorkflow:n=>e(s=>({...s,workflow:n})),startReplacingTool:n=>e(s=>({...s,replacingToolInfo:{toolName:n}})),cancelReplacingTool:()=>e(n=>({...n,replacingToolInfo:null})),setSelectedVirtualMcpId:n=>e(s=>({...s,selectedVirtualMcpId:n}))}}),{name:`workflow-store-${encodeURIComponent(t.workflow.id)}`,storage:zn(()=>localStorage),version:1,partialize:e=>({trackingExecutionId:e.trackingExecutionId,currentStepName:e.currentStepName,currentStepTab:e.currentStepTab,isAddingStep:e.isAddingStep,addingStepType:e.addingStepType,selectedParentSteps:e.selectedParentSteps,replacingToolInfo:e.replacingToolInfo,selectedVirtualMcpId:e.selectedVirtualMcpId})}));function Ao(t){const e=_.c(11),{children:n,initialState:s}=t,i=fn(),{org:r}=oe();let l;e[0]!==r||e[1]!==i?.[0]?.id?(l=i?.[0]?.id??Fe(r.id),e[0]=r,e[1]=i?.[0]?.id,e[2]=l):l=e[2];const c=l;let a;e[3]!==c||e[4]!==s.currentStepTab||e[5]!==s.trackingExecutionId||e[6]!==s.workflow?(a=()=>Po({workflow:s.workflow,originalWorkflow:s.workflow,selectedVirtualMcpId:c,isAddingStep:!1,selectedParentSteps:[],trackingExecutionId:s.trackingExecutionId,currentStepName:s.workflow.steps[0]?.name,currentStepTab:s.currentStepTab??"input"}),e[3]=c,e[4]=s.currentStepTab,e[5]=s.trackingExecutionId,e[6]=s.workflow,e[7]=a):a=e[7];const[d]=T.useState(a);let u;return e[8]!==n||e[9]!==d?(u=o.jsx(Hn.Provider,{value:d,children:n}),e[8]=n,e[9]=d,e[10]=u):u=e[10],u}function Me(t,e){const n=T.useContext(Hn);if(!n)throw new Error("Missing WorkflowStoreProvider - refresh the page. If the error persists, please contact support.");return Ro(n,t,Lo)}function de(){return Me(zo)}function zo(t){return t.workflow}function se(){return Me(Wo)}function Wo(t){return t.actions}function Vn(){const t=qe();return Me(Do)??t[0]?.name}function Do(t){return t.currentStepName}function Ve(){const t=_.c(5),e=Vn(),n=qe();if(e===Ze)return;let s;if(t[0]!==e||t[1]!==n){let r;t[3]!==e?(r=l=>l.name===e,t[3]=e,t[4]=r):r=t[4],s=n.find(r),t[0]=e,t[1]=n,t[2]=s}else s=t[2];const i=s;return i||n[0]}function qn(){return Me(Fo)}function Fo(t){return t.currentStepName===Ze}function qe(){return de().steps}function It(t,e){if(t===e)return!0;if(t===null||e===null||typeof t!=typeof e)return!1;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(!It(t[n],e[n]))return!1;return!0}if(typeof t=="object"){const n=t,s=e,i=Object.keys(n),r=Object.keys(s);if(i.length!==r.length)return!1;for(const l of i)if(!(l in s)||!It(n[l],s[l]))return!1;return!0}return!1}function Un(){const t=_.c(5),e=de();let n;t[0]!==e.id?(n={itemId:e.id},t[0]=e.id,t[1]=n):n=t[1];const{item:s}=ls(n);if(!s)return!1;let i;return t[2]!==s||t[3]!==e?(i=It(e,s),t[2]=s,t[3]=e,t[4]=i):i=t[4],!i}function Y(){return Me(Ho)}function Ho(t){return t.trackingExecutionId}function Ue(){return Me(Vo)}function Vo(t){return t.selectedVirtualMcpId}function qo(t){const e=_.c(23),{selectedVirtualMcpId:n,onVirtualMcpChange:s,className:i,placeholder:r}=t,l=r===void 0?"Select Agent":r,c=fn()??[],{org:a}=oe();let d;e[0]!==a.id?(d=Fe(a.id),e[0]=a.id,e[1]=d):d=e[1];const u=d,f=c.filter(Ko),m=wt,x=n??u;let p;e[2]!==s?(p=N=>s(N===""?void 0:N),e[2]=s,e[3]=p):p=e[3];let h;e[4]!==i?(h=O("text-xs",i),e[4]=i,e[5]=h):h=e[5];let g;e[6]!==l?(g=o.jsx(Nt,{placeholder:l}),e[6]=l,e[7]=g):g=e[7];let b;e[8]!==h||e[9]!==g?(b=o.jsx(kt,{size:"sm",className:h,children:g}),e[8]=h,e[9]=g,e[10]=b):b=e[10];const S=vt;let v;e[11]!==u?(v=o.jsx(nt,{value:u,children:"All tools (Decopilot)"}),e[11]=u,e[12]=v):v=e[12];const y=f.map(Uo);let j;e[13]!==S||e[14]!==v||e[15]!==y?(j=o.jsxs(S,{children:[v,y]}),e[13]=S,e[14]=v,e[15]=y,e[16]=j):j=e[16];let w;return e[17]!==m||e[18]!==j||e[19]!==x||e[20]!==p||e[21]!==b?(w=o.jsxs(m,{value:x,onValueChange:p,children:[b,j]}),e[17]=m,e[18]=j,e[19]=x,e[20]=p,e[21]=b,e[22]=w):w=e[22],w}function Uo(t){return o.jsx(nt,{value:t.id,children:t.title},t.id)}function Ko(t){return t.id!==null&&!Os(t.id)}function Le(){const t=_.c(7);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const s=ps(e).appSlug;let i;t[1]!==s?(i={slug:s},t[1]=s,t[2]=i):i=t[2];const r=uo(i);if(!s){let c;return t[3]===Symbol.for("react.memo_cache_sentinel")?(c={id:"self"},t[3]=c):c=t[3],c}let l;return t[4]!==s||t[5]!==r[0]?(l=r[0]??{id:s},t[4]=s,t[5]=r[0],t[6]=l):l=t[6],l}function ue(t){const e=_.c(12),{org:n}=oe(),s=Le();let i;e[0]!==s.id||e[1]!==n.id?(i={connectionId:s.id,orgId:n.id},e[0]=s.id,e[1]=n.id,e[2]=i):i=e[2];const r=ae(i);let l;e[3]!==t?(l={id:t},e[3]=t,e[4]=l):l=e[4];const c=!!t;let a;e[5]!==r||e[6]!==l||e[7]!==c?(a={client:r,toolName:"COLLECTION_WORKFLOW_EXECUTION_GET",toolArguments:l,enabled:c,select:Bo},e[5]=r,e[6]=l,e[7]=c,e[8]=a):a=e[8];const{data:d,isLoading:u}=Ot(a),f=d?.item;let m;return e[9]!==u||e[10]!==f?(m={item:f,isLoading:u},e[9]=u,e[10]=f,e[11]=m):m=e[11],m}function Bo(t){return t.structuredContent??t}function Kn(t,e,n){const s=_.c(14),{org:i}=oe(),r=Le();let l;s[0]!==r.id||s[1]!==i.id?(l={connectionId:r.id,orgId:i.id},s[0]=r.id,s[1]=i.id,s[2]=l):l=s[2];const c=ae(l),a=(n?.enabled??!0)&&!!t&&!!e;let d;s[3]!==t||s[4]!==e?(d={executionId:t,stepId:e},s[3]=t,s[4]=e,s[5]=d):d=s[5];let u;s[6]!==c||s[7]!==a||s[8]!==d?(u={client:c,toolName:"COLLECTION_WORKFLOW_EXECUTION_GET_STEP_RESULT",toolArguments:d,enabled:a,select:Xo},s[6]=c,s[7]=a,s[8]=d,s[9]=u):u=s[9];const{data:f,isLoading:m}=Ot(u),x=f?.output,p=f?.error;let h;return s[10]!==m||s[11]!==x||s[12]!==p?(h={output:x,error:p,isLoading:m},s[10]=m,s[11]=x,s[12]=p,s[13]=h):h=s[13],h}function Xo(t){return t.structuredContent??t}function Jo(){const t=_.c(15),{org:e}=oe(),n=Le(),s=de();let i;t[0]!==n.id||t[1]!==e.id?(i={connectionId:n.id,orgId:e.id},t[0]=n.id,t[1]=e.id,t[2]=i):i=t[2];const r=ae(i);let l;t[3]!==s.id?(l={workflow_collection_id:s.id,limit:100},t[3]=s.id,t[4]=l):l=t[4];const c=!!s.id;let a;t[5]!==r||t[6]!==l||t[7]!==c?(a={client:r,toolName:"COLLECTION_WORKFLOW_EXECUTION_LIST",toolArguments:l,enabled:c,staleTime:5e3,select:Go},t[5]=r,t[6]=l,t[7]=c,t[8]=a):a=t[8];const{data:d,isLoading:u,refetch:f}=Ot(a);let m;t[9]!==d?.items?(m=d?.items??[],t[9]=d?.items,t[10]=m):m=t[10];let x;return t[11]!==u||t[12]!==f||t[13]!==m?(x={executions:m,isLoading:u,refetch:f},t[11]=u,t[12]=f,t[13]=m,t[14]=x):x=t[14],x}function Go(t){return t.structuredContent??t}function Bn(t){const e=[];function n(s){if(typeof s=="string"){const i=s.match(/@input(?:\.(\w+(?:\.\w+)*))?/g);if(i)for(const r of i)if(r==="@input")e.push("__entire_input__");else{const l=r.replace("@input.","");e.push(l)}}else Array.isArray(s)?s.forEach(n):typeof s=="object"&&s!==null&&Object.values(s).forEach(n)}return n(t),[...new Set(e)]}function Qo(t){const e=[];for(const n of t){const s=Bn(n.input);e.push(...s)}return[...new Set(e)].filter(n=>n!=="__entire_input__")}function Yo(t){for(const e of t)if(Bn(e.input).includes("__entire_input__"))return!0;return!1}function Zo(t){const e=Qo(t);if(e.length===0)return Yo(t)?{type:"object",additionalProperties:!0,description:"Workflow input data"}:null;const n={},s=[];for(const i of e){const r=i.split(".");if(r.length===1)n[i]={type:"string",description:`Input field: ${i}`},s.push(i);else{const l=r[0];l&&!n[l]&&(n[l]={type:"object",description:`Input object: ${l}`,additionalProperties:!0},s.push(l))}}return{type:"object",properties:n,required:s,description:"Workflow execution input"}}function er(){const t=_.c(2),e=de();if(e.input_schema)return e.input_schema;let n;return t[0]!==e.steps?(n=Zo(e.steps),t[0]=e.steps,t[1]=n):n=t[1],n}function tr(){const t=_.c(16),{org:e}=oe(),{id:n}=Le(),{setTrackingExecutionId:s}=se(),i=de(),r=Ue(),l=er();let c;t[0]!==n||t[1]!==e.id?(c={connectionId:n,orgId:e.id},t[0]=n,t[1]=e.id,t[2]=c):c=t[2];const a=ae(c);let d;t[3]!==a?(d={client:a},t[3]=a,t[4]=d):d=t[4];const{mutateAsync:u,isPending:f}=Rt(d);let m;t[5]!==e.id||t[6]!==r||t[7]!==s||t[8]!==u||t[9]!==i?(m=async g=>{const b=g===void 0?{}:g,S=r??Fe(e.id),v=Date.now(),y=await u({name:"COLLECTION_WORKFLOW_EXECUTION_CREATE",arguments:{input:b,virtual_mcp_id:S,start_at_epoch_ms:v,workflow_collection_id:i.id}}),w=(y.structuredContent??y)?.item?.id??void 0;return s(w),w},t[5]=e.id,t[6]=r,t[7]=s,t[8]=u,t[9]=i,t[10]=m):m=t[10];const x=m,p=l!==null;let h;return t[11]!==x||t[12]!==l||t[13]!==f||t[14]!==p?(h={handleRunWorkflow:x,isPending:f,requiresInput:p,inputSchema:l},t[11]=x,t[12]=l,t[13]=f,t[14]=p,t[15]=h):h=t[15],h}const nr=["COLLECTION_WORKFLOW_EXECUTION_LIST","COLLECTION_WORKFLOW_EXECUTION_GET","COLLECTION_WORKFLOW_EXECUTION_GET_STEP_RESULT"];function sr(){const t=_.c(11),{org:e}=oe(),{id:n}=Le(),s=cn();let i;t[0]!==n||t[1]!==e.id?(i={connectionId:n,orgId:e.id},t[0]=n,t[1]=e.id,t[2]=i):i=t[2];const r=ae(i);let l;t[3]!==r?(l={client:r},t[3]=r,t[4]=l):l=t[4];const{mutateAsync:c,isPending:a}=Rt(l);let d;t[5]!==c||t[6]!==s?(d=async m=>{const x=await c({name:"CANCEL_EXECUTION",arguments:{executionId:m}});return s.invalidateQueries({predicate:or}),x},t[5]=c,t[6]=s,t[7]=d):d=t[7];const u=d;let f;return t[8]!==u||t[9]!==a?(f={handleCancelWorkflow:u,isCancelling:a},t[8]=u,t[9]=a,t[10]=f):f=t[10],f}function or(t){return t.queryKey.some(rr)}function rr(t){return typeof t=="string"&&nr.includes(t)}function ir(){const t=_.c(10),{org:e}=oe(),{id:n}=Le();let s;t[0]!==n||t[1]!==e.id?(s={connectionId:n,orgId:e.id},t[0]=n,t[1]=e.id,t[2]=s):s=t[2];const i=ae(s);let r;t[3]!==i?(r={client:i},t[3]=i,t[4]=r):r=t[4];const{mutateAsync:l,isPending:c}=Rt(r);let a;t[5]!==l?(a=async f=>{const m=await l({name:"RESUME_EXECUTION",arguments:{executionId:f}});return(m.structuredContent??m)?.success??!1},t[5]=l,t[6]=a):a=t[6];const d=a;let u;return t[7]!==d||t[8]!==c?(u={handleResumeWorkflow:d,isResuming:c},t[7]=d,t[8]=c,t[9]=u):u=t[9],u}function lr(){const t=_.c(3),e=Y(),{item:n}=ue(e);let s;return t[0]!==n||t[1]!==e?(s=e&&n?(()=>{const r={};return n?.input&&(r.input=n.input),r})():void 0,t[0]=n,t[1]=e,t[2]=s):s=t[2],s}function cr(t){const e=_.c(8),n=de();let s;if(e[0]!==t||e[1]!==n.input_schema||e[2]!==n.steps){s=[];const i=n.input_schema;if(i?.properties){const r=i.properties;let l;e[4]!==r?(l=Tt("input",r),e[4]=r,e[5]=l):l=e[5];const c=l,a=c.length>0?c:void 0;let d;e[6]!==a?(d={id:"input",label:"input",children:a},e[6]=a,e[7]=d):d=e[7],s.push(d)}for(const r of n.steps){if(r.name===t)break;const l=r.outputSchema;if(!l){s.push({id:r.name,label:r.name});continue}const c=Tt(r.name,l.properties??{});s.push({id:r.name,label:r.name,children:c.length>0?c:void 0})}e[0]=t,e[1]=n.input_schema,e[2]=n.steps,e[3]=s}else s=e[3];return s}function Tt(t,e){return Object.entries(e).map(([n,s])=>{const i=`${t}.${n}`,r=s.properties,l=s.type==="object"&&r?Tt(i,r):void 0;return{id:i,label:n,children:l&&l.length>0?l:void 0}})}function ar(t,e,n,s){if(!e)return[...t].sort(s);const i=n(e);return[...t].sort((r,l)=>{const c=n(r),a=n(l);return c===i?-1:a===i?1:s?s(r,l):0})}const At=To()(Wn(t=>({viewMode:"visual",setViewMode:e=>t({viewMode:e}),showExecutionsList:!1,setShowExecutionsList:e=>t({showExecutionsList:e}),toggleExecutionsList:()=>t(e=>({showExecutionsList:!e.showExecutionsList}))}),{name:"workflow-view-mode"})),Xn=T.createContext([]);function Jn(){return T.useContext(Xn)}function dr({editor:t,overrideSuggestionOptions:e,extensionName:n,char:s="@"}){const i=new Vs;return{editor:t,char:s,pluginKey:i,command:({editor:r,range:l,props:c})=>{var a,d,u;const f=r.view.state.selection.$to.nodeAfter;(a=f?.text)!=null&&a.startsWith(" ")&&(l.to+=1),r.chain().focus().insertContentAt(l,[{type:n,attrs:{...c,mentionSuggestionChar:s}},{type:"text",text:" "}]).run(),(u=(d=r.view.dom.ownerDocument.defaultView)==null?void 0:d.getSelection())==null||u.collapseToEnd()},allow:({state:r,range:l})=>{const c=r.doc.resolve(l.from),a=r.schema.nodes[n];return!!c.parent.type.contentMatch.matchType(a)},...e}}function Gn(t){return(t.options.suggestions.length?t.options.suggestions:[t.options.suggestion]).map(e=>dr({editor:t.editor,overrideSuggestionOptions:e,extensionName:t.name,char:e.char}))}function Qt(t,e){const n=Gn(t),s=n.find(i=>i.char===e);return s||(n.length?n[0]:null)}var ur=Ds.create({name:"mention",priority:101,addOptions(){return{HTMLAttributes:{},renderText({node:t,suggestion:e}){var n,s;return`${(n=e?.char)!=null?n:"@"}${(s=t.attrs.label)!=null?s:t.attrs.id}`},deleteTriggerWithBackspace:!1,renderHTML({options:t,node:e,suggestion:n}){var s,i;return["span",Be(this.HTMLAttributes,t.HTMLAttributes),`${(s=n?.char)!=null?s:"@"}${(i=e.attrs.label)!=null?i:e.attrs.id}`]},suggestions:[],suggestion:{}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-id"),renderHTML:t=>t.id?{"data-id":t.id}:{}},label:{default:null,parseHTML:t=>t.getAttribute("data-label"),renderHTML:t=>t.label?{"data-label":t.label}:{}},mentionSuggestionChar:{default:"@",parseHTML:t=>t.getAttribute("data-mention-suggestion-char"),renderHTML:t=>({"data-mention-suggestion-char":t.mentionSuggestionChar})}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:t,HTMLAttributes:e}){const n=Qt(this,t.attrs.mentionSuggestionChar);if(this.options.renderLabel!==void 0)return console.warn("renderLabel is deprecated use renderText and renderHTML instead"),["span",Be({"data-type":this.name},this.options.HTMLAttributes,e),this.options.renderLabel({options:this.options,node:t,suggestion:n})];const s={...this.options};s.HTMLAttributes=Be({"data-type":this.name},this.options.HTMLAttributes,e);const i=this.options.renderHTML({options:s,node:t,suggestion:n});return typeof i=="string"?["span",Be({"data-type":this.name},this.options.HTMLAttributes,e),i]:i},...Hs({nodeName:"mention",name:"@",selfClosing:!0,allowedAttributes:["id","label",{name:"mentionSuggestionChar",skipIfDefault:"@"}],parseAttributes:t=>{const e={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let s=n.exec(t);for(;s!==null;){const[,i,r,l]=s,c=r??l;e[i==="char"?"mentionSuggestionChar":i]=c,s=n.exec(t)}return e},serializeAttributes:t=>Object.entries(t).filter(([,e])=>e!=null).map(([e,n])=>`${e==="mentionSuggestionChar"?"char":e}="${n}"`).join(" ")}),renderText({node:t}){const e={options:this.options,node:t,suggestion:Qt(this,t.attrs.mentionSuggestionChar)};return this.options.renderLabel!==void 0?(console.warn("renderLabel is deprecated use renderText and renderHTML instead"),this.options.renderLabel(e)):this.options.renderText(e)},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:t,state:e})=>{let n=!1;const{selection:s}=e,{empty:i,anchor:r}=s;if(!i)return!1;let l=new Fs,c=0;return e.doc.nodesBetween(r-1,r,(a,d)=>{if(a.type.name===this.name)return n=!0,l=a,c=d,!1}),n&&t.insertText(this.options.deleteTriggerWithBackspace?"":l.attrs.mentionSuggestionChar,c,c+l.nodeSize),n})}},addProseMirrorPlugins(){return Gn(this).map(Rs)}}),fr=ur,jt,it="HoverCard",[Qn]=ws(it,[dn]),lt=dn(),[mr,ct]=Qn(it),Yn=t=>{const{__scopeHoverCard:e,children:n,open:s,defaultOpen:i,onOpenChange:r,openDelay:l=700,closeDelay:c=300}=t,a=lt(e),d=T.useRef(0),u=T.useRef(0),f=T.useRef(!1),m=T.useRef(!1),[x,p]=bs({prop:s,defaultProp:i??!1,onChange:r,caller:it}),h=T.useCallback(()=>{clearTimeout(u.current),d.current=window.setTimeout(()=>p(!0),l)},[l,p]),g=T.useCallback(()=>{clearTimeout(d.current),!f.current&&!m.current&&(u.current=window.setTimeout(()=>p(!1),c))},[c,p]),b=T.useCallback(()=>p(!1),[p]);return T.useEffect(()=>()=>{clearTimeout(d.current),clearTimeout(u.current)},[]),o.jsx(mr,{scope:e,open:x,onOpenChange:p,onOpen:h,onClose:g,onDismiss:b,hasSelectionRef:f,isPointerDownOnContentRef:m,children:o.jsx(js,{...a,children:n})})};Yn.displayName=it;var Zn="HoverCardTrigger",es=T.forwardRef((t,e)=>{const{__scopeHoverCard:n,...s}=t,i=ct(Zn,n),r=lt(n);return o.jsx(xs,{asChild:!0,...r,children:o.jsx(hs.a,{"data-state":i.open?"open":"closed",...s,ref:e,onPointerEnter:fe(t.onPointerEnter,tt(i.onOpen)),onPointerLeave:fe(t.onPointerLeave,tt(i.onClose)),onFocus:fe(t.onFocus,i.onOpen),onBlur:fe(t.onBlur,i.onClose),onTouchStart:fe(t.onTouchStart,l=>l.preventDefault())})})});es.displayName=Zn;var zt="HoverCardPortal",[pr,xr]=Qn(zt,{forceMount:void 0}),ts=t=>{const{__scopeHoverCard:e,forceMount:n,children:s,container:i}=t,r=ct(zt,e);return o.jsx(pr,{scope:e,forceMount:n,children:o.jsx(an,{present:n||r.open,children:o.jsx(gs,{asChild:!0,container:i,children:s})})})};ts.displayName=zt;var et="HoverCardContent",ns=T.forwardRef((t,e)=>{const n=xr(et,t.__scopeHoverCard),{forceMount:s=n.forceMount,...i}=t,r=ct(et,t.__scopeHoverCard);return o.jsx(an,{present:s||r.open,children:o.jsx(hr,{"data-state":r.open?"open":"closed",...i,onPointerEnter:fe(t.onPointerEnter,tt(r.onOpen)),onPointerLeave:fe(t.onPointerLeave,tt(r.onClose)),ref:e})})});ns.displayName=et;var hr=T.forwardRef((t,e)=>{const{__scopeHoverCard:n,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:r,onInteractOutside:l,...c}=t,a=ct(et,n),d=lt(n),u=T.useRef(null),f=Ss(e,u),[m,x]=T.useState(!1);return T.useEffect(()=>{if(m){const p=document.body;return jt=p.style.userSelect||p.style.webkitUserSelect,p.style.userSelect="none",p.style.webkitUserSelect="none",()=>{p.style.userSelect=jt,p.style.webkitUserSelect=jt}}},[m]),T.useEffect(()=>{if(u.current){const p=()=>{x(!1),a.isPointerDownOnContentRef.current=!1,setTimeout(()=>{document.getSelection()?.toString()!==""&&(a.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",p),()=>{document.removeEventListener("pointerup",p),a.hasSelectionRef.current=!1,a.isPointerDownOnContentRef.current=!1}}},[a.isPointerDownOnContentRef,a.hasSelectionRef]),T.useEffect(()=>{u.current&&jr(u.current).forEach(h=>h.setAttribute("tabindex","-1"))}),o.jsx(ys,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:l,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:fe(r,p=>{p.preventDefault()}),onDismiss:a.onDismiss,children:o.jsx(vs,{...d,...c,onPointerDown:fe(c.onPointerDown,p=>{p.currentTarget.contains(p.target)&&x(!0),a.hasSelectionRef.current=!1,a.isPointerDownOnContentRef.current=!0}),ref:f,style:{...c.style,userSelect:m?"text":void 0,WebkitUserSelect:m?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),gr="HoverCardArrow",br=T.forwardRef((t,e)=>{const{__scopeHoverCard:n,...s}=t,i=lt(n);return o.jsx(Ns,{...i,...s,ref:e})});br.displayName=gr;function tt(t){return e=>e.pointerType==="touch"?void 0:t()}function jr(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)e.push(n.currentNode);return e}var Sr=Yn,yr=es,vr=ts,wr=ns;function Nr(t){const e=_.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==n?(s=o.jsx(Sr,{"data-slot":"hover-card",...n}),e[2]=n,e[3]=s):s=e[3],s}function kr(t){const e=_.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let s;return e[2]!==n?(s=o.jsx(yr,{"data-slot":"hover-card-trigger",...n}),e[2]=n,e[3]=s):s=e[3],s}function _r(t){const e=_.c(12);let n,s,i,r;e[0]!==t?({className:n,align:i,sideOffset:r,...s}=t,e[0]=t,e[1]=n,e[2]=s,e[3]=i,e[4]=r):(n=e[1],s=e[2],i=e[3],r=e[4]);const l=i===void 0?"center":i,c=r===void 0?4:r;let a;e[5]!==n?(a=O("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",n),e[5]=n,e[6]=a):a=e[6];let d;return e[7]!==l||e[8]!==s||e[9]!==c||e[10]!==a?(d=o.jsx(vr,{"data-slot":"hover-card-portal",children:o.jsx(wr,{"data-slot":"hover-card-content",align:l,sideOffset:c,className:a,...s})}),e[7]=l,e[8]=s,e[9]=c,e[10]=a,e[11]=d):d=e[11],d}const ss=T.createContext(void 0);function Cr(t,e){const n=e.split("."),s=n[0];if(!s)return;let i=t[s];for(let r=1;r<n.length&&i!==void 0;r++){const l=n[r];if(l)if(typeof i=="object"&&i!==null)i=i[l];else return}return i}function Ir(t){const e=_.c(20),{node:n}=t,s=T.useContext(ss),i=n.attrs.id??"",r=s!==void 0;let l;if(e[0]!==r||e[1]!==i||e[2]!==s){const h=r?Cr(s,i):void 0;l=h!==void 0?typeof h=="object"?JSON.stringify(h,null,2):String(h):void 0,e[0]=r,e[1]=i,e[2]=s,e[3]=l}else l=e[3];const c=l;let a;e[4]!==i?(a=o.jsxs("span",{className:"bg-primary/20 text-primary px-1 rounded font-medium cursor-pointer",children:["@",i]}),e[4]=i,e[5]=a):a=e[5];const d=a;if(!r||c===void 0){let h;return e[6]!==d?(h=o.jsx(Ut,{as:"span",children:d}),e[6]=d,e[7]=h):h=e[7],h}let u;e[8]!==d?(u=o.jsx(kr,{asChild:!0,children:d}),e[8]=d,e[9]=u):u=e[9];let f;e[10]!==i?(f=o.jsxs("div",{className:"text-xs font-medium text-muted-foreground",children:["@",i]}),e[10]=i,e[11]=f):f=e[11];let m;e[12]!==c?(m=o.jsx("pre",{className:"text-xs font-mono bg-muted/50 p-2 rounded overflow-auto max-h-[200px] whitespace-pre-wrap break-all",children:c}),e[12]=c,e[13]=m):m=e[13];let x;e[14]!==f||e[15]!==m?(x=o.jsx(_r,{className:"w-auto max-w-[400px] p-3",side:"top",align:"start",children:o.jsxs("div",{className:"space-y-1.5",children:[f,m]})}),e[14]=f,e[15]=m,e[16]=x):x=e[16];let p;return e[17]!==u||e[18]!==x?(p=o.jsx(Ut,{as:"span",children:o.jsxs(Nr,{openDelay:200,children:[u,x]})}),e[17]=u,e[18]=x,e[19]=p):p=e[19],p}function os(t){const e=[];function n(s){for(const i of s)i.children?.length||e.push(i),i.children&&n(i.children)}return n(t),e}let ce=rs();function rs(){return Pt(()=>({items:[],selectedIndex:0,command:null}))}function Yt(t,e){ce.setState({items:t,command:e,selectedIndex:0})}function Tr(){const{items:t,selectedIndex:e}=ce.getState();t.length&&ce.setState({selectedIndex:(e-1+t.length)%t.length})}function Er(){const{items:t,selectedIndex:e}=ce.getState();t.length&&ce.setState({selectedIndex:(e+1)%t.length})}function is(){const{items:t,selectedIndex:e,command:n}=ce.getState(),s=t[e];return s?(n?.(s),!0):!1}function Zt(){ce=rs()}function $r(){const t=_.c(7),e=_t(ce,Rr),n=_t(ce,Or);if(!e.length)return null;let s;if(t[0]!==e||t[1]!==n){let r;t[3]!==n?(r=(l,c)=>o.jsx("button",{type:"button",onClick:()=>{ce.setState({selectedIndex:c}),is()},className:O("flex items-center w-full text-left px-3 py-1.5 text-sm rounded-md transition-colors",c===n?"bg-accent text-accent-foreground":"hover:bg-muted"),children:l.label},l.id),t[3]=n,t[4]=r):r=t[4],s=e.map(r),t[0]=e,t[1]=n,t[2]=s}else s=t[2];let i;return t[5]!==s?(i=o.jsx("div",{className:"bg-popover border border-border rounded-lg shadow-lg overflow-hidden min-w-[180px]",children:o.jsx("div",{className:"p-1",children:s})}),t[5]=s,t[6]=i):i=t[6],i}function Or(t){return t.selectedIndex}function Rr(t){return t.items}function Mr(){let t=null,e=null;return{onStart:n=>{Yt(n.items,n.command),t=new Bs($r,{editor:n.editor}),e=document.createElement("div"),e.style.cssText="position:absolute;z-index:9999";const s=n.clientRect?.();s&&(e.style.top=`${s.bottom+window.scrollY+4}px`,e.style.left=`${s.left+window.scrollX}px`),e.appendChild(t.element),document.body.appendChild(e)},onUpdate:n=>{Yt(n.items,n.command);const s=n.clientRect?.();s&&e&&(e.style.top=`${s.bottom+window.scrollY+4}px`,e.style.left=`${s.left+window.scrollX}px`)},onKeyDown:({event:n})=>n.key==="Escape"?(e?.remove(),t?.destroy(),Zt(),!0):n.key==="ArrowUp"?(Tr(),!0):n.key==="ArrowDown"?(Er(),!0):n.key==="Enter"?is():!1,onExit:()=>{e?.remove(),t?.destroy(),Zt()}}}const St=/@([\w.]+)/g;function Lr(t,e){if(!t)return null;const n=os(e),s=new Map(n.map(a=>[a.id,a]));if(!St.test(t))return t;St.lastIndex=0;const r=[];let l=0,c;for(;(c=St.exec(t))!==null;){const a=c[1]??"",d=c.index;d>l&&r.push({type:"text",text:t.slice(l,d)});const u=s.get(a);u?r.push({type:"mention",attrs:{id:u.id,label:u.label}}):r.push({type:"text",text:c[0]}),l=d+c[0].length}return l<t.length&&r.push({type:"text",text:t.slice(l)}),{type:"doc",content:[{type:"paragraph",content:r.length>0?r:void 0}]}}function Wt(t){const e=_.c(31),{mentions:n,value:s,onChange:i,placeholder:r,className:l,readOnly:c}=t,a=lr();let d;e[0]!==n||e[1]!==s?(d=Lr(s,n),e[0]=n,e[1]=s,e[2]=d):d=e[2];const u=d,f=a!==void 0,m=!c;let x;e[3]===Symbol.for("react.memo_cache_sentinel")?(x=qs.configure({heading:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1,hardBreak:!1}),e[3]=x):x=e[3];let p;if(e[4]!==n||e[5]!==f){let C;e[7]!==n?(C=E=>{const{query:W}=E;return os(n).filter(I=>I.label.toLowerCase().includes(W.toLowerCase())||I.id.toLowerCase().includes(W.toLowerCase()))},e[7]=n,e[8]=C):C=e[8],p=fr.configure({HTMLAttributes:{class:"bg-primary/20 text-primary px-1 rounded font-medium"},renderText:Wr,renderHTML:zr,suggestion:{items:C,render:Mr,command:Ar}}).extend(f?{addNodeView(){return Us(Ir)}}:{}),e[4]=n,e[5]=f,e[6]=p}else p=e[6];let h;e[9]!==p?(h=[x,p],e[9]=p,e[10]=h):h=e[10];const g=r??"";let b;e[11]!==g?(b={attributes:{class:"prose prose-sm max-w-none focus:outline-none w-full min-h-[20px]","data-placeholder":g},handleKeyDown:Pr},e[11]=g,e[12]=b):b=e[12];let S;e[13]!==i?(S=C=>{const{editor:E}=C;return i?.(E.getText().trim())},e[13]=i,e[14]=S):S=e[14];let v;e[15]!==u||e[16]!==m||e[17]!==h||e[18]!==b||e[19]!==S?(v={content:u,editable:m,extensions:h,editorProps:b,onUpdate:S},e[15]=u,e[16]=m,e[17]=h,e[18]=b,e[19]=S,e[20]=v):v=e[20];const y=Ks(v);let j;e[21]!==l?(j=O("rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",l),e[21]=l,e[22]=j):j=e[22];let w;e[23]!==y?(w=o.jsx(Xs,{editor:y}),e[23]=y,e[24]=w):w=e[24];let N;e[25]!==j||e[26]!==w?(N=o.jsx("div",{className:j,children:w}),e[25]=j,e[26]=w,e[27]=N):N=e[27];const k=N;if(a!==void 0){let C;return e[28]!==k||e[29]!==a?(C=o.jsx(ss.Provider,{value:a,children:k}),e[28]=k,e[29]=a,e[30]=C):C=e[30],C}return k}function Pr(t,e){return e.key==="Enter"?(e.preventDefault(),!0):!1}function Ar(t){const{editor:e,range:n,props:s}=t;e.chain().focus().insertContentAt(n,[{type:"mention",attrs:s}]).run()}function zr(t){const{options:e,node:n}=t;return["span",e.HTMLAttributes,`@${n.attrs.id}`]}function Wr(t){const{node:e}=t;return`@${e.attrs.id}`}function Dr(t){const e=_.c(8),{value:n,onChange:s,placeholder:i,readonly:r}=t,l=Jn(),c=n??"";let a;e[0]!==s?(a=f=>s(f),e[0]=s,e[1]=a):a=e[1];const d=i||"Enter value...";let u;return e[2]!==l||e[3]!==r||e[4]!==c||e[5]!==a||e[6]!==d?(u=o.jsx(Wt,{mentions:l,value:c,onChange:a,placeholder:d,readOnly:r}),e[2]=l,e[3]=r,e[4]=c,e[5]=a,e[6]=d,e[7]=u):u=e[7],u}function Fr(t){const e=_.c(8),{value:n,onChange:s,placeholder:i,readonly:r}=t,l=Jn(),c=n??"";let a;e[0]!==s?(a=f=>s(f),e[0]=s,e[1]=a):a=e[1];const d=i||"Enter value...";let u;return e[2]!==l||e[3]!==r||e[4]!==c||e[5]!==a||e[6]!==d?(u=o.jsx(Wt,{mentions:l,value:c,onChange:a,placeholder:d,readOnly:r,className:"min-h-[80px]"}),e[2]=l,e[3]=r,e[4]=c,e[5]=a,e[6]=d,e[7]=u):u=e[7],u}function Hr(t){const e=_.c(8),{value:n,onChange:s,readonly:i,id:r}=t,l=n??"";let c;e[0]!==s?(c=u=>s(u.target.value===""?void 0:Number(u.target.value)),e[0]=s,e[1]=c):c=e[1];let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=O("w-full rounded-md border border-input bg-background px-3 py-2 text-sm","ring-offset-background focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50"),e[2]=a):a=e[2];let d;return e[3]!==r||e[4]!==i||e[5]!==l||e[6]!==c?(d=o.jsx("input",{id:r,type:"number",value:l,onChange:c,disabled:i,className:a}),e[3]=r,e[4]=i,e[5]=l,e[6]=c,e[7]=d):d=e[7],d}function Vr(t){const e=_.c(13),{value:n,onChange:s,readonly:i,id:r,label:l}=t,c=n??!1;let a;e[0]!==s?(a=m=>s(m.target.checked),e[0]=s,e[1]=a):a=e[1];let d;e[2]!==r||e[3]!==i||e[4]!==c||e[5]!==a?(d=o.jsx("input",{id:r,type:"checkbox",checked:c,onChange:a,disabled:i,className:"h-4 w-4 rounded border-input"}),e[2]=r,e[3]=i,e[4]=c,e[5]=a,e[6]=d):d=e[6];let u;e[7]!==l?(u=o.jsx("span",{className:"text-sm",children:l}),e[7]=l,e[8]=u):u=e[8];let f;return e[9]!==r||e[10]!==d||e[11]!==u?(f=o.jsxs("label",{htmlFor:r,className:"flex items-center gap-2 cursor-pointer",children:[d,u]}),e[9]=r,e[10]=d,e[11]=u,e[12]=f):f=e[12],f}function qr(t){const e=_.c(14),{value:n,onChange:s,readonly:i,id:r,options:l}=t;let c;e[0]!==l.enumOptions?(c=l.enumOptions??[],e[0]=l.enumOptions,e[1]=c):c=e[1];const a=c,d=n??"";let u;e[2]!==s?(u=h=>s(h.target.value),e[2]=s,e[3]=u):u=e[3];let f,m;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=O("w-full rounded-md border border-input bg-background px-3 py-2 text-sm","ring-offset-background focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50"),m=o.jsx("option",{value:"",children:"Select..."}),e[4]=f,e[5]=m):(f=e[4],m=e[5]);let x;e[6]!==a?(x=a.map(Ur),e[6]=a,e[7]=x):x=e[7];let p;return e[8]!==r||e[9]!==i||e[10]!==d||e[11]!==u||e[12]!==x?(p=o.jsxs("select",{id:r,value:d,onChange:u,disabled:i,className:f,children:[m,x]}),e[8]=r,e[9]=i,e[10]=d,e[11]=u,e[12]=x,e[13]=p):p=e[13],p}function Ur(t){return o.jsx("option",{value:String(t.value),children:String(t.label)},String(t.value))}const Kr={TextWidget:Dr,TextareaWidget:Fr,NumberWidget:Hr,CheckboxWidget:Vr,SelectWidget:qr};function Br(t){switch(Array.isArray(t)?t[0]:t??"unknown"){case"string":return{Icon:An,color:"text-blue-500"};case"number":case"integer":return{Icon:Mn,color:"text-blue-500"};case"array":return{Icon:En,color:"text-purple-500"};case"object":return{Icon:Tn,color:"text-orange-500"};case"boolean":return{Icon:Pn,color:"text-pink-500"};case"null":return{Icon:$t,color:"text-gray-500"};default:return{Icon:On,color:"text-muted-foreground"}}}function Xr(t){const e=_.c(36),{id:n,label:s,required:i,description:r,children:l,schema:c,hidden:a}=t;if(a){let j;return e[0]!==l?(j=o.jsx("div",{className:"hidden",children:l}),e[0]=l,e[1]=j):j=e[1],j}if(n==="root"){let j;return e[2]!==l?(j=o.jsx("div",{className:"space-y-4",children:l}),e[2]=l,e[3]=j):j=e[3],j}const d=Array.isArray(c.type)?c.type[0]:c.type??"string";let u,f,m,x,p,h,g;if(e[4]!==n||e[5]!==s||e[6]!==i||e[7]!==d){const{Icon:j,color:w}=Br(d);g="space-y-2",x="flex items-center gap-2",e[15]!==n||e[16]!==s?(p=o.jsx("label",{htmlFor:n,className:"text-sm font-medium leading-none",children:s}),e[15]=n,e[16]=s,e[17]=p):p=e[17],e[18]!==i?(h=i&&o.jsx("span",{className:"text-red-500 text-xs",children:"*"}),e[18]=i,e[19]=h):h=e[19],u=j,f=14,m=O(w,"ml-auto"),e[4]=n,e[5]=s,e[6]=i,e[7]=d,e[8]=u,e[9]=f,e[10]=m,e[11]=x,e[12]=p,e[13]=h,e[14]=g}else u=e[8],f=e[9],m=e[10],x=e[11],p=e[12],h=e[13],g=e[14];let b;e[20]!==u||e[21]!==f||e[22]!==m?(b=o.jsx(u,{size:f,className:m}),e[20]=u,e[21]=f,e[22]=m,e[23]=b):b=e[23];let S;e[24]!==x||e[25]!==p||e[26]!==h||e[27]!==b?(S=o.jsxs("div",{className:x,children:[p,h,b]}),e[24]=x,e[25]=p,e[26]=h,e[27]=b,e[28]=S):S=e[28];let v;e[29]!==r?(v=r&&o.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:r}),e[29]=r,e[30]=v):v=e[30];let y;return e[31]!==l||e[32]!==g||e[33]!==S||e[34]!==v?(y=o.jsxs("div",{className:g,children:[S,v,l]}),e[31]=l,e[32]=g,e[33]=S,e[34]=v,e[35]=y):y=e[35],y}function Jr(t){const e=_.c(8),{properties:n,title:s}=t;if(!s||s==="Root"){let c;e[0]!==n?(c=n.map(Qr),e[0]=n,e[1]=c):c=e[1];let a;return e[2]!==c?(a=o.jsx("div",{className:"space-y-4",children:c}),e[2]=c,e[3]=a):a=e[3],a}let r;e[4]!==n?(r=n.map(Gr),e[4]=n,e[5]=r):r=e[5];let l;return e[6]!==r?(l=o.jsx("div",{className:"pl-4 border-l-2 border-border/50 space-y-4",children:r}),e[6]=r,e[7]=l):l=e[7],l}function Gr(t){return o.jsx("div",{children:t.content},t.name)}function Qr(t){return o.jsx("div",{children:t.content},t.name)}function Yr(t){const e=_.c(11),{items:n,canAdd:s,onAddClick:i,title:r}=t;let l;e[0]!==n?(l=n.map(Zr),e[0]=n,e[1]=l):l=e[1];let c;e[2]!==l?(c=o.jsx("div",{className:"space-y-2",children:l}),e[2]=l,e[3]=c):c=e[3];let a;e[4]!==s||e[5]!==i||e[6]!==r?(a=s&&o.jsxs(te,{type:"button",variant:"outline",size:"sm",className:"h-8",onClick:i,children:["+ Add ",r||"item"]}),e[4]=s,e[5]=i,e[6]=r,e[7]=a):a=e[7];let d;return e[8]!==c||e[9]!==a?(d=o.jsxs("div",{className:"space-y-2",children:[c,a]}),e[8]=c,e[9]=a,e[10]=d):d=e[10],d}function Zr(t){return o.jsx("div",{className:"flex gap-2 items-start",children:o.jsx("div",{className:"flex-1",children:t})},t.key||t.index)}function ei(){return null}function ti(){return null}const ni={FieldTemplate:Xr,ObjectFieldTemplate:Jr,ArrayFieldTemplate:Yr,UnsupportedFieldTemplate:ei,ErrorListTemplate:ti};function si(t){const e=_.c(6),{inputSchema:n,inputParams:s,mentions:i}=t;if(!n?.properties||!s)return null;let r;e[0]!==i?(r=(a,d,u)=>{const f=typeof d=="object"&&d!==null?JSON.stringify(d,null,2):String(d??""),m=Array.isArray(u.type)?u.type.join(" | "):u.type??"string";return o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs("div",{className:"flex items-baseline gap-2",children:[o.jsx("span",{className:"text-sm font-medium text-foreground",children:a}),o.jsx("span",{className:"text-xs text-muted-foreground ml-auto",children:m})]}),u.description&&o.jsx("div",{className:"text-xs text-muted-foreground",children:u.description}),o.jsx("div",{className:"rounded-md border border-border bg-muted/30 px-3 py-2 text-sm",children:o.jsx(Wt,{mentions:i,value:f,readOnly:!0,className:"border-0 bg-transparent p-0"})})]},a)},e[0]=i,e[1]=r):r=e[1];const l=r;let c;return e[2]!==s||e[3]!==n.properties||e[4]!==l?(c=o.jsx("div",{className:"space-y-4",children:Object.entries(n.properties).map(a=>{const[d,u]=a,f=s[d];return l(d,f,u)})}),e[2]=s,e[3]=n.properties,e[4]=l,e[5]=c):c=e[5],c}function Dt({inputSchema:t,inputParams:e,setInputParams:n,handleInputChange:s,mentions:i,readOnly:r}){const l=i??[];if(!t)return o.jsx("div",{className:"text-sm text-muted-foreground italic",children:"No arguments defined in schema."});if(r)return o.jsx(si,{inputSchema:t,inputParams:e,mentions:l});const c=t,a=T.useRef(e??{}),d=u=>{const f=u.formData??{},m=a.current;if(n?.(f),s){for(const[x,p]of Object.entries(f))m[x]!==p&&s(x,p);for(const x of Object.keys(m))x in f||s(x,void 0)}a.current=f};return o.jsx(Xn.Provider,{value:l,children:o.jsx(Es,{schema:c,formData:e,onChange:d,validator:$s,widgets:Kr,templates:ni,readonly:r,uiSchema:{"ui:submitButtonOptions":{norender:!0}},liveValidate:!1,className:"rjsf-form",omitExtraData:!0,liveOmit:!0,children:o.jsx(o.Fragment,{})})})}function oi(t){const e=_.c(33),{open:n,onOpenChange:s,inputSchema:i,onSubmit:r,isPending:l}=t;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={},e[0]=c):c=e[0];const[a,d]=T.useState(c);let u;e[1]!==a||e[2]!==s||e[3]!==r?(u=async()=>{await r(a),s(!1),d({})},e[1]=a,e[2]=s,e[3]=r,e[4]=u):u=e[4];const f=u;let m;e[5]!==s?(m=k=>{k||d({}),s(k)},e[5]=s,e[6]=m):m=e[6];const x=m;let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsxs(mo,{children:[o.jsx(po,{children:"Workflow Input"}),o.jsx(xo,{children:"This workflow requires input values to run. Fill in the fields below to start the execution."})]}),e[7]=p):p=e[7];let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=[],e[8]=h):h=e[8];let g;e[9]!==a||e[10]!==i?(g=o.jsx("div",{className:"py-4",children:o.jsx(Dt,{inputSchema:i,inputParams:a,setInputParams:d,mentions:h})}),e[9]=a,e[10]=i,e[11]=g):g=e[11];let b;e[12]!==x?(b=()=>x(!1),e[12]=x,e[13]=b):b=e[13];let S;e[14]!==l||e[15]!==b?(S=o.jsx(te,{variant:"outline",onClick:b,disabled:l,children:"Cancel"}),e[14]=l,e[15]=b,e[16]=S):S=e[16];let v;e[17]!==l?(v=l?o.jsx(st,{size:"xs"}):o.jsx(hn,{size:14}),e[17]=l,e[18]=v):v=e[18];let y;e[19]!==f||e[20]!==l||e[21]!==v?(y=o.jsxs(te,{onClick:f,disabled:l,className:"gap-2",children:[v,"Run Workflow"]}),e[19]=f,e[20]=l,e[21]=v,e[22]=y):y=e[22];let j;e[23]!==y||e[24]!==S?(j=o.jsxs(ho,{children:[S,y]}),e[23]=y,e[24]=S,e[25]=j):j=e[25];let w;e[26]!==j||e[27]!==g?(w=o.jsxs(go,{className:"sm:max-w-lg max-h-[80vh] overflow-y-auto",children:[p,g,j]}),e[26]=j,e[27]=g,e[28]=w):w=e[28];let N;return e[29]!==x||e[30]!==n||e[31]!==w?(N=o.jsx(bo,{open:n,onOpenChange:x,children:w}),e[29]=x,e[30]=n,e[31]=w,e[32]=N):N=e[32],N}function ri(t){const e=_.c(25),{title:n,description:s,onSave:i,isSaving:r}=t,{viewMode:l,setViewMode:c,showExecutionsList:a,toggleExecutionsList:d}=At(),{resetToOriginalWorkflow:u,setSelectedVirtualMcpId:f}=se(),m=Un(),x=Ue(),p=Y();let h;e[0]!==n?(h=o.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:n}),e[0]=n,e[1]=h):h=e[1];let g;e[2]!==s?(g=s?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),o.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:s})]}):null,e[2]=s,e[3]=g):g=e[3];let b;e[4]!==h||e[5]!==g?(b=o.jsx(co,{children:o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[h,g]})}),e[4]=h,e[5]=g,e[6]=b):b=e[6];let S;e[7]!==m||e[8]!==r||e[9]!==i||e[10]!==u||e[11]!==x||e[12]!==f||e[13]!==c||e[14]!==a||e[15]!==d||e[16]!==p||e[17]!==l?(S=!p&&o.jsxs(o.Fragment,{children:[o.jsx(_o,{onSave:i,onUndo:u,isDirty:m,isSaving:r,saveLabel:"Save workflow",undoLabel:"Reset changes"}),o.jsx(T.Suspense,{fallback:o.jsx(st,{size:"xs"}),children:o.jsx(qo,{selectedVirtualMcpId:x,onVirtualMcpChange:f,placeholder:"Select Agent"})}),o.jsx(Qs,{value:l,onValueChange:c,size:"sm",options:[{value:"visual",icon:o.jsx(eo,{})},{value:"code",icon:o.jsx(mn,{})}]}),o.jsx(gn,{children:o.jsxs(bn,{delayDuration:0,children:[o.jsx(jn,{asChild:!0,children:o.jsx("span",{className:"inline-block",children:o.jsx(te,{variant:a?"secondary":"outline",size:"icon",className:"size-7 border border-input",onClick:d,"aria-label":a?"Hide runs":"Show runs",children:o.jsx(to,{size:14})})})}),o.jsx(Sn,{side:"bottom",children:a?"Hide runs":"Show runs"})]})})]}),e[7]=m,e[8]=r,e[9]=i,e[10]=u,e[11]=x,e[12]=f,e[13]=c,e[14]=a,e[15]=d,e[16]=p,e[17]=l,e[18]=S):S=e[18];let v;e[19]===Symbol.for("react.memo_cache_sentinel")?(v=o.jsx(ci,{}),e[19]=v):v=e[19];let y;e[20]!==S?(y=o.jsxs(ao,{children:[S,v]}),e[20]=S,e[21]=y):y=e[21];let j;return e[22]!==b||e[23]!==y?(j=o.jsxs(o.Fragment,{children:[b,y]}),e[22]=b,e[23]=y,e[24]=j):j=e[24],j}function ii(){const t=Y(),{item:e}=ue(t);return e?.completed_at_epoch_ms!=null}function li(){const t=Y(),{item:e}=ue(t);return!!(e?.status==="cancelled"||e?.status==="error"||e?.status==="failed"||e?.status==="success"&&e.completed_steps?.error&&e.completed_steps.error.length>0)}function ci(){const t=_.c(58),e=Un(),n=ii(),s=li(),i=Y(),r=Ue(),{handleRunWorkflow:l,isPending:c,requiresInput:a,inputSchema:d}=tr(),u=qe(),[f,m]=T.useState(!1),{handleCancelWorkflow:x,isCancelling:p}=sr(),{handleResumeWorkflow:h,isResuming:g}=ir(),b=i&&!n;let S;t[0]!==u?(S=u.some(ai),t[0]=u,t[1]=S):S=t[1];const v=S,y=!r,j=u.length===0,w=e||j||v||y||c||p,N=b||c;let k;t[2]!==v||t[3]!==y||t[4]!==e||t[5]!==s||t[6]!==N||t[7]!==j?(k=()=>s?"Resume will retry failed steps — succeeded steps are preserved":N?"Workflow is currently running":e?"Save your changes before running":y?"Select an Agent first":j||v?"Add at least one step to the workflow":null,t[2]=v,t[3]=y,t[4]=e,t[5]=s,t[6]=N,t[7]=j,t[8]=k):k=t[8];const E=k();let W;t[9]!==x||t[10]!==h||t[11]!==l||t[12]!==d||t[13]!==s||t[14]!==N||t[15]!==a||t[16]!==i?(W=async()=>{if(s&&i){await h(i);return}if(N&&i){await x(i);return}if(a&&d){m(!0);return}await l({})},t[9]=x,t[10]=h,t[11]=l,t[12]=d,t[13]=s,t[14]=N,t[15]=a,t[16]=i,t[17]=W):W=t[17];const z=W;let I;t[18]!==l?(I=async J=>{await l(J)},t[18]=l,t[19]=I):I=t[19];const L=I,R=s?"Resume":i?n?"Replay":"Running...":a?"Run with input...":"Run workflow",D=!b&&"bg-primary text-primary-foreground hover:bg-primary/90";let F;t[20]!==D?(F=O("gap-2 h-7 px-3",D),t[20]=D,t[21]=F):F=t[21];let P;t[22]!==p||t[23]!==s||t[24]!==c||t[25]!==g||t[26]!==b?(P=(!b&&!c&&!p&&!g||s)&&o.jsx(hn,{size:14}),t[22]=p,t[23]=s,t[24]=c,t[25]=g,t[26]=b,t[27]=P):P=t[27];let H;t[28]!==p||t[29]!==s||t[30]!==c||t[31]!==g||t[32]!==b?(H=b&&!c&&!p&&!g&&!s&&o.jsx(no,{size:14}),t[28]=p,t[29]=s,t[30]=c,t[31]=g,t[32]=b,t[33]=H):H=t[33];let U;t[34]!==p||t[35]!==c||t[36]!==g?(U=(c||p||g)&&o.jsx(st,{size:"xs"}),t[34]=p,t[35]=c,t[36]=g,t[37]=U):U=t[37];let G;t[38]!==R||t[39]!==z||t[40]!==w||t[41]!==F||t[42]!==P||t[43]!==H||t[44]!==U?(G=o.jsxs(te,{variant:"default",size:"sm",className:F,disabled:w,onClick:z,children:[P,H,U,R]}),t[38]=R,t[39]=z,t[40]=w,t[41]=F,t[42]=P,t[43]=H,t[44]=U,t[45]=G):G=t[45];const X=G;let V;t[46]!==X||t[47]!==E?(V=E?o.jsx(gn,{children:o.jsxs(bn,{delayDuration:0,children:[o.jsx(jn,{asChild:!0,children:o.jsx("span",{className:"inline-block",children:X})}),o.jsx(Sn,{side:"bottom",children:E})]})}):X,t[46]=X,t[47]=E,t[48]=V):V=t[48];const q=V;let K;t[49]!==L||t[50]!==d||t[51]!==c||t[52]!==a||t[53]!==f?(K=a&&d&&o.jsx(oi,{open:f,onOpenChange:m,inputSchema:d,onSubmit:L,isPending:c}),t[49]=L,t[50]=d,t[51]=c,t[52]=a,t[53]=f,t[54]=K):K=t[54];let M;return t[55]!==q||t[56]!==K?(M=o.jsxs(o.Fragment,{children:[q,K]}),t[55]=q,t[56]=K,t[57]=M):M=t[57],M}function ai(t){return"toolName"in t.action&&(!t.action.toolName||t.action.toolName==="")}function en(t,e){for(const n of e)if(n===t||n.startsWith(`${t}[`))return!0;return!1}function di(){const t=_.c(13),e=Y(),n=qe(),{item:s}=ue(e);if(!e||!s)return;let i;if(t[0]!==s.completed_steps?.error||t[1]!==s.completed_steps?.success||t[2]!==s.error||t[3]!==s.running_steps||t[4]!==s.status||t[5]!==n){i={};let r;t[7]!==s.completed_steps?.success?(r=new Set(s.completed_steps?.success?.map(ui)??[]),t[7]=s.completed_steps?.success,t[8]=r):r=t[8];const l=r,c=s.completed_steps?.error??[];let a;t[9]!==s.running_steps?(a=s.running_steps??[],t[9]=s.running_steps,t[10]=a):a=t[10];let d;t[11]!==a?(d=new Set(a),t[11]=a,t[12]=d):d=t[12];const u=d,f=s.status,m=s.error!=null?typeof s.error=="string"?s.error:JSON.stringify(s.error):void 0;let x=-1;n.forEach((p,h)=>{(l.has(p.name)||en(p.name,c))&&(x=h)}),n.forEach((p,h)=>{let g="pending",b;en(p.name,c)?(g="error",b=m):l.has(p.name)?g="success":(f==="error"||f==="failed")&&u.has(p.name)?(g="error",b=m):f==="running"&&h===x+1&&(g="running"),i[p.name]={status:g,output:void 0,error:b,stepIndex:h}}),t[0]=s.completed_steps?.error,t[1]=s.completed_steps?.success,t[2]=s.error,t[3]=s.running_steps,t[4]=s.status,t[5]=n,t[6]=i}else i=t[6];return i}function ui(t){return t.name}function fi(t){const e=_.c(97),{step:n,index:s,isSelected:i,executionStatus:r,isSkipped:l,isLastStep:c,onSelect:a,onDelete:d,onDuplicate:u}=t,f=Y(),{item:m}=ue(f),x=m?.completed_steps,p=x?.success,h=x?.error??[];let g;e[0]!==n.name||e[1]!==p?(g=p?.find(B=>B.name===n.name),e[0]=n.name,e[1]=p,e[2]=g):g=e[2];const b=g,S=b?.completed_at_epoch_ms,v=b!=null;let y;e[3]!==n.name?(y=B=>B===n.name||B.startsWith(`${n.name}[`),e[3]=n.name,e[4]=y):y=e[4];const j=h.some(y),w="toolName"in n.action,N=w&&"connectionId"in n.action?n.action.connectionId:null,C=!!(w&&"toolName"in n.action?n.action.toolName:null),E=wi(n),z=(m?.status==="error"||m?.status==="failed")&&m?.running_steps?.includes(n.name),I=v?"success":j||z?"error":r?.status,L=r!==void 0,R=I==="success"||I==="error";let D=E.length>0?60:12;(I==="success"||I==="error")&&(D=D+32);const F=xi(I);let P;e[5]!==I?(P=hi(I),e[5]=I,e[6]=P):P=e[6];const H=P;let U;e[7]===Symbol.for("react.memo_cache_sentinel")?(U=function(gt,us){const Vt=us.split(".").slice(1);if(Vt.length===0)return Array.isArray(gt)?gt:void 0;let me=gt;for(const fs of Vt){if(me==null)return;if(typeof me=="object")me=me[fs];else return}return Array.isArray(me)?me:void 0},e[7]=U):U=e[7];const G=U,X=n.forEach!==void 0,V=n.forEach?.ref;let q;e[8]!==V?(q=V?.replace("@","").split(".")[0],e[8]=V,e[9]=q):q=e[9];const K=q,M=m?.status==="running"||m?.status==="enqueued";let J;e[10]!==p||e[11]!==K?(J=p?.some(B=>B.name===K),e[10]=p,e[11]=K,e[12]=J):J=e[12];const Q=J,$=M?500:!1;let A;e[13]!==Q||e[14]!==$?(A={refetchInterval:$,enabled:Q},e[13]=Q,e[14]=$,e[15]=A):A=e[15];const{output:ee}=Kn(f,K,A);let re;if(e[16]!==ee||e[17]!==V){const B=V?.replace("@","");re=B?G(ee,B):void 0,e[16]=ee,e[17]=V,e[18]=re}else re=e[18];const ie=re;let Z;if(e[19]!==n.name){let B;e[21]===Symbol.for("react.memo_cache_sentinel")?(B=/[.*+?^${}()|[\]\\]/g,e[21]=B):B=e[21],Z=n.name.replace(B,"\\$&"),e[19]=n.name,e[20]=Z}else Z=e[20];const Pe=Z,Ht=new RegExp(`^${Pe}\\[\\d+\\]$`),at=m?.completed_steps?.success?.filter(B=>Ht.test(B.name)),Ae=h.filter(B=>Ht.test(B)),dt=i&&"bg-background border-1 border-border outline outline-offset-3 outline-border/25",ut=I==="running"&&"bg-accent/50",ft=l&&"opacity-50";let pe;e[22]!==dt||e[23]!==ut||e[24]!==ft?(pe=O("flex gap-2 items-start border-1 border-transparent px-4 w-full rounded-lg cursor-pointer group hover:bg-accent/30",dt,ut,ft),e[22]=dt,e[23]=ut,e[24]=ft,e[25]=pe):pe=e[25];const cs="button",as=0;let xe;e[26]!==a?(xe=B=>{(B.key==="Enter"||B.key===" ")&&(B.preventDefault(),a())},e[26]=a,e[27]=xe):xe=e[27];const mt=O("text-xs font-mono opacity-75 h-8 flex items-center",F),pt=s+1;let he;e[28]!==mt||e[29]!==pt?(he=o.jsx("div",{className:"w-5 flex flex-col items-center justify-center shrink-0 pt-3",children:o.jsxs("span",{className:mt,children:[pt,"."]})}),e[28]=mt,e[29]=pt,e[30]=he):he=e[30];let ge;e[31]!==H||e[32]!==s?(ge=s>0?o.jsx(yt,{height:12,color:H}):o.jsx("div",{className:"h-3"}),e[31]=H,e[32]=s,e[33]=ge):ge=e[33];let be;e[34]!==N||e[35]!==C||e[36]!==w||e[37]!==n.name?(be=o.jsx(yi,{connectionId:N,isToolStep:w,hasToolSelected:C,stepName:n.name}),e[34]=N,e[35]=C,e[36]=w,e[37]=n.name,e[38]=be):be=e[38];let je;e[39]!==H||e[40]!==R||e[41]!==I?(je=R&&o.jsxs(o.Fragment,{children:[o.jsx(yt,{height:8,color:H}),o.jsx(gi,{status:I})]}),e[39]=H,e[40]=R,e[41]=I,e[42]=je):je=e[42];let Se;e[43]!==H||e[44]!==D||e[45]!==c||e[46]!==f?(Se=c&&f?null:o.jsx(yt,{height:D,color:H}),e[43]=H,e[44]=D,e[45]=c,e[46]=f,e[47]=Se):Se=e[47];let ye;e[48]!==ge||e[49]!==be||e[50]!==je||e[51]!==Se?(ye=o.jsxs("div",{className:"flex flex-col items-center shrink-0",children:[ge,be,je,Se]}),e[48]=ge,e[49]=be,e[50]=je,e[51]=Se,e[52]=ye):ye=e[52];const ds="flex-1 flex flex-col gap-3 min-w-0 pt-3 pb-3",xt=C?"font-medium text-foreground":"text-foreground";let ve;e[53]!==xt?(ve=O("text-sm truncate flex-1",xt),e[53]=xt,e[54]=ve):ve=e[54];let we;e[55]!==n?(we=vi(n),e[55]=n,e[56]=we):we=e[56];let Ne;e[57]!==ve||e[58]!==we?(Ne=o.jsx("span",{className:ve,children:we}),e[57]=ve,e[58]=we,e[59]=Ne):Ne=e[59];let ke;e[60]!==at?.length||e[61]!==Ae||e[62]!==X||e[63]!==ie?(ke=X&&ie&&ie.length>0&&o.jsxs("span",{className:"text-xs font-mono opacity-75 h-8 flex items-center gap-1",children:[`${(at?.length??0)+Ae.length} / ${ie.length}`,Ae.length>0&&o.jsxs("span",{className:"text-destructive",children:["(",Ae.length," failed)"]})]}),e[60]=at?.length,e[61]=Ae,e[62]=X,e[63]=ie,e[64]=ke):ke=e[64];let _e;e[65]!==L||e[66]!==I?(_e=L&&o.jsx(bi,{status:I}),e[65]=L,e[66]=I,e[67]=_e):_e=e[67];let Ce;e[68]!==ke||e[69]!==_e?(Ce=o.jsxs("div",{className:"flex items-center gap-2",children:[ke,_e]}),e[68]=ke,e[69]=_e,e[70]=Ce):Ce=e[70];let Ie;e[71]!==L||e[72]!==d||e[73]!==u?(Ie=!L&&o.jsxs(vn,{children:[o.jsx(wn,{asChild:!0,children:o.jsx(te,{variant:"ghost",size:"icon",className:"size-7 text-muted-foreground sm:opacity-0 sm:group-hover:opacity-100 transition-opacity",onClick:pi,children:o.jsx(so,{size:14})})}),o.jsxs(Nn,{align:"end",children:[o.jsxs(Ye,{onClick:B=>{B.stopPropagation(),u()},children:[o.jsx(wo,{size:14}),"Duplicate"]}),o.jsxs(Ye,{className:"text-destructive hover:bg-destructive/10! focus:text-destructive",onClick:B=>{B.stopPropagation(),d()},children:[o.jsx(un,{size:14,className:"text-destructive"}),"Delete"]})]})]}),e[71]=L,e[72]=d,e[73]=u,e[74]=Ie):Ie=e[74];let Te;e[75]!==Ne||e[76]!==Ce||e[77]!==Ie?(Te=o.jsxs("div",{className:"flex items-center h-8",children:[Ne,Ce,Ie]}),e[75]=Ne,e[76]=Ce,e[77]=Ie,e[78]=Te):Te=e[78];const ht=E.length>0&&o.jsx("div",{className:"flex flex-wrap gap-1.5",children:E.map(mi)});let Ee;e[79]!==I||e[80]!==S?(Ee=I==="success"&&o.jsx(ji,{completedAtEpochMs:S}),e[79]=I,e[80]=S,e[81]=Ee):Ee=e[81];let $e;e[82]!==r?.error||e[83]!==I?($e=I==="error"&&o.jsx(Si,{error:r?.error}),e[82]=r?.error,e[83]=I,e[84]=$e):$e=e[84];let Oe;e[85]!==Te||e[86]!==ht||e[87]!==Ee||e[88]!==$e?(Oe=o.jsxs("div",{className:ds,children:[Te,ht,Ee,$e]}),e[85]=Te,e[86]=ht,e[87]=Ee,e[88]=$e,e[89]=Oe):Oe=e[89];let Ke;return e[90]!==a||e[91]!==pe||e[92]!==xe||e[93]!==he||e[94]!==ye||e[95]!==Oe?(Ke=o.jsxs("div",{className:pe,onClick:a,role:cs,tabIndex:as,onKeyDown:xe,children:[he,ye,Oe]}),e[90]=a,e[91]=pe,e[92]=xe,e[93]=he,e[94]=ye,e[95]=Oe,e[96]=Ke):Ke=e[96],Ke}function mi(t){return o.jsx("span",{className:"px-1.5 py-1 text-xs text-muted-foreground bg-background border border-border rounded-lg",children:t},t)}function pi(t){return t.stopPropagation()}function xi(t){switch(t){case"success":return"text-success";case"error":return"text-destructive";default:return"text-muted-foreground"}}function hi(t){switch(t){case"success":return"bg-success";case"error":return"bg-destructive";default:return"bg-border"}}function gi(t){const e=_.c(2),{status:n}=t;if(n==="success"){let s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx("div",{className:"size-4 rounded bg-success flex items-center justify-center",children:o.jsx(He,{size:8,className:"text-success-foreground"})}),e[0]=s):s=e[0],s}if(n==="error"){let s;return e[1]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx("div",{className:"size-4 rounded bg-destructive flex items-center justify-center",children:o.jsx(Mt,{size:8,className:"text-destructive-foreground"})}),e[1]=s):s=e[1],s}return null}function bi(t){const e=_.c(3),{status:n}=t;if(n==="success"){let s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx("div",{className:"size-7 flex items-center justify-center",children:o.jsx(He,{size:11,className:"text-success"})}),e[0]=s):s=e[0],s}if(n==="error"){let s;return e[1]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx("div",{className:"size-7 flex items-center justify-center",children:o.jsx(Mt,{size:11,className:"text-destructive"})}),e[1]=s):s=e[1],s}if(n==="running"){let s;return e[2]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx("div",{className:"size-7 flex items-center justify-center",children:o.jsx(ln,{size:11,className:"text-muted-foreground animate-spin"})}),e[2]=s):s=e[2],s}return null}function ji(t){const e=_.c(8),{completedAtEpochMs:n}=t;let s,i;if(e[0]!==n){const a=n!=null&&n>0?new Date(n):null,d=a&&!Number.isNaN(a.getTime());s=d?a.toISOString().split("T")[0]:null,i=d?a.toTimeString().split(" ")[0]:null,e[0]=n,e[1]=s,e[2]=i}else s=e[1],i=e[2];const r=i;let l;e[3]!==s||e[4]!==r?(l=s&&r&&o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(oo,{size:16,className:"text-success"}),o.jsx("span",{className:"text-xs text-success",children:s}),o.jsx("span",{className:"text-xs text-success",children:r})]}),e[3]=s,e[4]=r,e[5]=l):l=e[5];let c;return e[6]!==l?(c=o.jsx("div",{className:"inline-flex items-center gap-3 px-1.5 py-1 bg-success-foreground rounded-lg w-fit",children:l}),e[6]=l,e[7]=c):c=e[7],c}function Si(t){const e=_.c(3),{error:n}=t;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx(pn,{size:16,className:"text-destructive"}),e[0]=s):s=e[0];const i=n||"Execution failed";let r;return e[1]!==i?(r=o.jsxs("div",{className:"inline-flex items-center gap-1.5 px-1.5 py-1 bg-destructive-foreground rounded-lg w-fit",children:[s,o.jsx("span",{className:"text-xs text-destructive",children:i})]}),e[1]=i,e[2]=r):r=e[2],r}function yi(t){const e=_.c(5),{connectionId:n,isToolStep:s,hasToolSelected:i,stepName:r}=t,l=fo(n??"");if(s&&i&&l?.icon){let a;return e[0]!==l.icon||e[1]!==r?(a=o.jsx("div",{className:"size-8 rounded-lg border border-border/10 bg-background shadow-sm flex items-center justify-center overflow-hidden",children:o.jsx(Lt,{icon:l.icon,name:r,size:"xs",className:"border-0 rounded-none"})}),e[0]=l.icon,e[1]=r,e[2]=a):a=e[2],a}let c;return e[3]!==s?(c=o.jsx("div",{className:"size-8 rounded-lg border border-border/10 bg-background shadow-sm flex items-center justify-center",children:s?o.jsx(kn,{size:16,className:"text-muted-foreground"}):o.jsx($n,{size:16,className:"text-muted-foreground"})}),e[3]=s,e[4]=c):c=e[4],c}function yt(t){const e=_.c(7),{height:n,color:s}=t,i=s===void 0?"bg-border":s;let r;e[0]!==i?(r=O("w-px",i),e[0]=i,e[1]=r):r=e[1];let l;e[2]!==n?(l={height:n},e[2]=n,e[3]=l):l=e[3];let c;return e[4]!==r||e[5]!==l?(c=o.jsx("div",{className:r,style:l}),e[4]=r,e[5]=l,e[6]=c):c=e[6],c}function vi(t){return t.name?t.name:"toolName"in t.action&&t.action.toolName?t.action.toolName:"code"in t.action?t.name||"Code Step":"Select tool..."}function wi(t){const e=t.outputSchema;if(!e||typeof e!="object")return[];const n=e.properties??e.items?.properties;return!n||typeof n!="object"?[]:Object.keys(n).slice(0,5)}function Ni(t){const e=_.c(33),{className:n}=t,s=qe(),i=Vn(),r=di(),{setCurrentStepName:l,deleteStep:c,duplicateStep:a}=se(),d=Y();let u;e[0]!==r||e[1]!==s?(u=r?s.findIndex(y=>r[y.name]?.status==="error"):-1,e[0]=r,e[1]=s,e[2]=u):u=e[2];const f=u;let m;e[3]===Symbol.for("react.memo_cache_sentinel")?(m=o.jsx("div",{children:"Loading..."}),e[3]=m):m=e[3];let x;e[4]!==n?(x=O("h-full flex flex-col p-8 overflow-auto",n),e[4]=n,e[5]=x):x=e[5];let p;e[6]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx(_i,{}),e[6]=p):p=e[6];let h;if(e[7]!==i||e[8]!==c||e[9]!==a||e[10]!==f||e[11]!==l||e[12]!==r||e[13]!==s){let y;e[15]!==i||e[16]!==c||e[17]!==a||e[18]!==f||e[19]!==l||e[20]!==r||e[21]!==s.length?(y=(j,w)=>{const N=r?.[j.name],k=f!==-1&&w>f&&N?.status==="pending",C=w===s.length-1;return o.jsx(fi,{step:j,index:w,isSelected:j.name===i,executionStatus:N,isSkipped:k,isLastStep:C,onSelect:()=>l(j.name),onDelete:()=>c(j.name),onDuplicate:()=>a(j.name)},j.name)},e[15]=i,e[16]=c,e[17]=a,e[18]=f,e[19]=l,e[20]=r,e[21]=s.length,e[22]=y):y=e[22],h=s.map(y),e[7]=i,e[8]=c,e[9]=a,e[10]=f,e[11]=l,e[12]=r,e[13]=s,e[14]=h}else h=e[14];let g;e[23]!==h?(g=o.jsx("div",{className:"pt-3 -space-y-1",children:h}),e[23]=h,e[24]=g):g=e[24];let b;e[25]!==d?(b=d?null:o.jsx(Ti,{}),e[25]=d,e[26]=b):b=e[26];let S;e[27]!==g||e[28]!==b?(S=o.jsxs("div",{className:"w-full -space-y-1",children:[p,g,b]}),e[27]=g,e[28]=b,e[29]=S):S=e[29];let v;return e[30]!==x||e[31]!==S?(v=o.jsx(T.Suspense,{fallback:m,children:o.jsx("div",{className:x,children:S})}),e[30]=x,e[31]=S,e[32]=v):v=e[32],v}const tn=60;function ki(t){if(t==null)return"null";if(typeof t=="string")return nn(t,tn);if(typeof t=="number"||typeof t=="boolean")return String(t);let e;try{e=JSON.stringify(t)}catch{return typeof t=="object"?"[Object]":String(t)}return nn(e,tn)}function nn(t,e){return t.length<=e?t:`${t.slice(0,e)}…`}function _i(){const t=_.c(42),e=de(),n=qn(),s=Y(),{setCurrentStepName:i}=se(),{item:r}=ue(s),l=r?.input,c=!!s,d=e.input_schema?.properties;let u;t[0]!==d?(u=d?Object.keys(d):[],t[0]=d,t[1]=u):u=t[1];const f=u;let m,x,p,h,g,b,S,v,y,j;if(t[2]!==l||t[3]!==f||t[4]!==n||t[5]!==c||t[6]!==i){const k=c?Object.entries(l??{}):[],C=n&&"bg-background border-1 border-border outline outline-offset-3 outline-border/25";t[17]!==C?(g=O("flex gap-2 items-start border-1 border-transparent px-4 w-full rounded-lg cursor-pointer group hover:bg-accent/30",C),t[17]=C,t[18]=g):g=t[18],t[19]!==i?(b=()=>i(Ze),t[19]=i,t[20]=b):b=t[20],S="button",v=0,t[21]!==i?(y=I=>{(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),i(Ze))},t[21]=i,t[22]=y):y=t[22],t[23]===Symbol.for("react.memo_cache_sentinel")?(j=o.jsx("div",{className:"w-5 shrink-0"}),t[23]=j):j=t[23];let E;t[24]===Symbol.for("react.memo_cache_sentinel")?(E=o.jsx("div",{className:"h-3"}),t[24]=E):E=t[24],t[25]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsxs("div",{className:"flex flex-col items-center shrink-0",children:[E,o.jsx("div",{className:"size-8 rounded-lg border border-border/10 bg-background shadow-sm flex items-center justify-center",children:o.jsx(xn,{size:16,className:"text-muted-foreground"})}),o.jsx("div",{className:"w-px h-3 bg-border"})]}),t[25]=x):x=t[25],m="flex-1 flex flex-col gap-2 min-w-0 pt-3 pb-3";let W;t[26]===Symbol.for("react.memo_cache_sentinel")?(W=o.jsx("span",{className:"text-sm font-medium text-foreground truncate flex-1",children:"Workflow Input"}),t[26]=W):W=t[26];const z=c?k.length>0&&o.jsxs("span",{className:"text-xs text-muted-foreground",children:[k.length," value",k.length!==1?"s":""]}):f.length>0&&o.jsxs("span",{className:"text-xs text-muted-foreground",children:[f.length," field",f.length!==1?"s":""]});t[27]!==z?(p=o.jsxs("div",{className:"flex items-center h-8",children:[W,z]}),t[27]=z,t[28]=p):p=t[28],h=c?k.length>0&&o.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[k.slice(0,5).map(Ii),k.length>5&&o.jsxs("span",{className:"text-xs text-muted-foreground",children:["+",k.length-5," more"]})]}):f.length>0&&o.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[f.slice(0,5).map(Ci),f.length>5&&o.jsxs("span",{className:"px-1.5 py-1 text-xs text-muted-foreground",children:["+",f.length-5," more"]})]}),t[2]=l,t[3]=f,t[4]=n,t[5]=c,t[6]=i,t[7]=m,t[8]=x,t[9]=p,t[10]=h,t[11]=g,t[12]=b,t[13]=S,t[14]=v,t[15]=y,t[16]=j}else m=t[7],x=t[8],p=t[9],h=t[10],g=t[11],b=t[12],S=t[13],v=t[14],y=t[15],j=t[16];let w;t[29]!==m||t[30]!==p||t[31]!==h?(w=o.jsxs("div",{className:m,children:[p,h]}),t[29]=m,t[30]=p,t[31]=h,t[32]=w):w=t[32];let N;return t[33]!==x||t[34]!==w||t[35]!==g||t[36]!==b||t[37]!==S||t[38]!==v||t[39]!==y||t[40]!==j?(N=o.jsxs("div",{className:g,onClick:b,role:S,tabIndex:v,onKeyDown:y,children:[j,x,w]}),t[33]=x,t[34]=w,t[35]=g,t[36]=b,t[37]=S,t[38]=v,t[39]=y,t[40]=j,t[41]=N):N=t[41],N}function Ci(t){return o.jsx("span",{className:"px-1.5 py-1 text-xs text-muted-foreground bg-background border border-border rounded-lg",children:t},t)}function Ii(t){const[e,n]=t;return o.jsxs("div",{className:"flex items-baseline gap-1.5 text-xs min-w-0",children:[o.jsxs("span",{className:"text-muted-foreground shrink-0 max-w-[40%] truncate",children:[e,":"]}),o.jsx("span",{className:"text-foreground truncate font-mono min-w-0",children:ki(n)})]},e)}function Ti(){const t=_.c(15),{addToolStep:e,addCodeStep:n}=se();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx("div",{className:"w-5 shrink-0"}),t[0]=s):s=t[0];let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx("div",{className:"w-px h-3 bg-border"}),t[1]=i):i=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=o.jsx(wn,{asChild:!0,children:o.jsx(te,{variant:"outline",size:"icon",className:"size-8 rounded-lg",children:o.jsx(jo,{size:14})})}),t[2]=r):r=t[2];let l;t[3]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx(kn,{size:14}),t[3]=l):l=t[3];let c;t[4]!==e?(c=o.jsxs(Ye,{onClick:e,children:[l,"Tool Step"]}),t[4]=e,t[5]=c):c=t[5];let a;t[6]===Symbol.for("react.memo_cache_sentinel")?(a=o.jsx($n,{size:14}),t[6]=a):a=t[6];let d;t[7]!==n?(d=o.jsxs(Ye,{onClick:n,children:[a,"Code Step"]}),t[7]=n,t[8]=d):d=t[8];let u;t[9]!==c||t[10]!==d?(u=o.jsxs(vn,{children:[r,o.jsxs(Nn,{align:"start",children:[c,d]})]}),t[9]=c,t[10]=d,t[11]=u):u=t[11];let f;t[12]===Symbol.for("react.memo_cache_sentinel")?(f=o.jsx("div",{className:"w-px h-8",style:{backgroundImage:"repeating-linear-gradient(180deg, var(--border), var(--border) 4px, transparent 4px, transparent 8px)",backgroundPosition:"left top",backgroundRepeat:"repeat-y",backgroundSize:"2px 100%"}}),t[12]=f):f=t[12];let m;return t[13]!==u?(m=o.jsxs("div",{className:"flex gap-2 items-start px-4 pb-3",children:[s,o.jsxs("div",{className:"flex flex-col border-1 border-transparent items-center shrink-0",children:[i,u,f]})]}),t[13]=u,t[14]=m):m=t[14],m}function Ei(){const t=_.c(14),{org:e}=oe(),n=Ue();let s;t[0]!==e.id||t[1]!==n?(s=n??Fe(e.id),t[0]=e.id,t[1]=n,t[2]=s):s=t[2];const i=s;let r;t[3]!==e.id||t[4]!==i?(r={connectionId:i,orgId:e.id},t[3]=e.id,t[4]=i,t[5]=r):r=t[5];const l=ae(r);let c;t[6]!==l?(c={client:l},t[6]=l,t[7]=c):c=t[7];const a=yn(c);let d;t[8]!==a.data?.tools?(d=a.data?.tools??[],t[8]=a.data?.tools,t[9]=d):d=t[9];let u;return t[10]!==d||t[11]!==a.error||t[12]!==a.isLoading?(u={tools:d,isLoading:a.isLoading,error:a.error},t[10]=d,t[11]=a.error,t[12]=a.isLoading,t[13]=u):u=t[13],u}function $i(t){const e=_.c(2),{className:n}=t;let s;return e[0]!==n?(s=o.jsx(Oi,{className:n}),e[0]=n,e[1]=s):s=e[1],s}function Oi(t){const e=_.c(38),{className:n}=t,{tools:s,isLoading:i,error:r}=Ei(),l=Ve(),{updateStep:c}=se(),d=l&&"toolName"in l.action&&"toolName"in l.action?l.action.toolName:null;let u;if(e[0]!==d||e[1]!==s){let j;e[3]!==d?(j=w=>w.name===d,e[3]=d,e[4]=j):j=e[4],u=s.find(j),e[0]=d,e[1]=s,e[2]=u}else u=e[2];const m=ar(s,u??null,Mi,Ri);let x;e[5]!==l||e[6]!==c?(x=j=>{l&&c(l.name,{action:{...l.action,toolName:j.name},outputSchema:j.outputSchema??{}})},e[5]=l,e[6]=c,e[7]=x):x=e[7];const p=x;if(i){let j;e[8]!==n?(j=O("flex flex-col h-full bg-sidebar",n),e[8]=n,e[9]=j):j=e[9];let w;e[10]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx("div",{className:"flex-1 flex items-center justify-center",children:o.jsx(st,{size:"sm"})}),e[10]=w):w=e[10];let N;return e[11]!==j?(N=o.jsx("div",{className:j,children:w}),e[11]=j,e[12]=N):N=e[12],N}if(r){let j;e[13]!==n?(j=O("flex flex-col h-full bg-sidebar",n),e[13]=n,e[14]=j):j=e[14];let w;e[15]!==r.message?(w=o.jsxs("div",{className:"flex-1 flex items-center justify-center text-sm text-destructive p-4 text-center",children:["Failed to load tools: ",r.message]}),e[15]=r.message,e[16]=w):w=e[16];let N;return e[17]!==j||e[18]!==w?(N=o.jsx("div",{className:j,children:w}),e[17]=j,e[18]=w,e[19]=N):N=e[19],N}let h;e[20]!==n?(h=O("flex flex-col h-full bg-sidebar",n),e[20]=n,e[21]=h):h=e[21];let g;e[22]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsx("span",{className:"text-base font-medium text-foreground",children:"Select tool"}),e[22]=g):g=e[22];let b;e[23]!==s.length?(b=o.jsx("div",{className:"flex items-start border-b border-border",children:o.jsxs("div",{className:"flex-1 flex items-center h-12 px-5",children:[g,o.jsxs("span",{className:"ml-2 text-sm text-muted-foreground",children:["(",s.length,")"]})]})}),e[23]=s.length,e[24]=b):b=e[24];let S;if(e[25]!==p||e[26]!==m||e[27]!==d){let j;e[29]!==p||e[30]!==d?(j=w=>o.jsx(Li,{icon:null,title:w.name,description:w.description,isSelected:w.name===d,onClick:()=>p(w)},w.name),e[29]=p,e[30]=d,e[31]=j):j=e[31],S=m.map(j),e[25]=p,e[26]=m,e[27]=d,e[28]=S}else S=e[28];let v;e[32]!==S?(v=o.jsx("div",{className:"flex-1 overflow-auto",children:S}),e[32]=S,e[33]=v):v=e[33];let y;return e[34]!==h||e[35]!==b||e[36]!==v?(y=o.jsxs("div",{className:h,children:[b,v]}),e[34]=h,e[35]=b,e[36]=v,e[37]=y):y=e[37],y}function Ri(t,e){return t.name.localeCompare(e.name)}function Mi(t){return t.name}function Li(t){const e=_.c(20),{icon:n,title:s,description:i,isSelected:r,onClick:l}=t,c=r&&"bg-muted/50";let a;e[0]!==c?(a=O("flex items-start gap-2.5 min-h-14 px-5 py-4 cursor-pointer transition-colors","hover:bg-muted/50",c),e[0]=c,e[1]=a):a=e[1];let d;e[2]!==l?(d=h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),l())},e[2]=l,e[3]=d):d=e[3];let u;e[4]!==n||e[5]!==s?(u=o.jsx(Lt,{icon:n,name:s,size:"xs",className:"shadow-sm mt-0.5"}),e[4]=n,e[5]=s,e[6]=u):u=e[6];let f;e[7]!==s?(f=o.jsx("span",{className:"text-sm font-medium text-foreground truncate block",children:s}),e[7]=s,e[8]=f):f=e[8];let m;e[9]!==i?(m=i&&o.jsx("span",{className:"text-xs text-muted-foreground line-clamp-2",children:i}),e[9]=i,e[10]=m):m=e[10];let x;e[11]!==f||e[12]!==m?(x=o.jsxs("div",{className:"flex-1 min-w-0",children:[f,m]}),e[11]=f,e[12]=m,e[13]=x):x=e[13];let p;return e[14]!==l||e[15]!==a||e[16]!==d||e[17]!==u||e[18]!==x?(p=o.jsxs("div",{className:a,onClick:l,role:"button",tabIndex:0,onKeyDown:d,children:[u,x]}),e[14]=l,e[15]=a,e[16]=d,e[17]=u,e[18]=x,e[19]=p):p=e[19],p}function Pi(t){const{updateStep:e}=se(),s=t&&"toolName"in t.action&&"toolName"in t.action?t.action.toolName:null,{tool:i}=Ft(s??"");t&&s&&i?.outputSchema&&(!t.outputSchema||Object.keys(t.outputSchema).length===0)&&queueMicrotask(()=>{e(t.name,{outputSchema:i.outputSchema})})}function Ai(t){const e=_.c(41),{className:n}=t,s=Ve();Pi(s);const i=Y(),{item:r}=ue(i);if(!s){let N;e[0]!==n?(N=O("flex flex-col h-full bg-sidebar",n),e[0]=n,e[1]=N):N=e[1];let k;e[2]===Symbol.for("react.memo_cache_sentinel")?(k=o.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground gap-2 flex-col",children:"Select or create a step to configure"}),e[2]=k):k=e[2];let C;return e[3]!==N?(C=o.jsx("div",{className:N,children:k}),e[3]=N,e[4]=C):C=e[4],C}const l=s?.name;let c;e[5]!==r?.completed_steps?.error?(c=r?.completed_steps?.error??[],e[5]=r?.completed_steps?.error,e[6]=c):c=e[6];const a=c;let d;if(e[7]!==l||e[8]!==a){let N;e[10]!==l?(N=k=>k===l||k.startsWith(`${l}[`),e[10]=l,e[11]=N):N=e[11],d=a.some(N),e[7]=l,e[8]=a,e[9]=d}else d=e[9];const u=d,f=r?.status==="error"||r?.status==="failed";let m;e[12]!==l||e[13]!==f||e[14]!==r?.running_steps?(m=f&&r?.running_steps?.includes(l??""),e[12]=l,e[13]=f,e[14]=r?.running_steps,e[15]=m):m=e[15];const x=m,p=!!(r?.completed_steps?.success?.some(N=>N.name===l)||u||x),h=u||x;let g;e[16]!==n?(g=O("flex flex-col h-full bg-sidebar overflow-scroll",n),e[16]=n,e[17]=g):g=e[17];let b,S;e[18]!==s?(b=o.jsx(zi,{step:s}),S=o.jsx(Di,{step:s}),e[18]=s,e[19]=b,e[20]=S):(b=e[19],S=e[20]);let v;e[21]!==s||e[22]!==l||e[23]!==r||e[24]!==p||e[25]!==h||e[26]!==i?(v=i&&o.jsx(Vi,{step:s,defaultOpen:p,isStepErrored:h,executionError:h&&r?.error!=null?typeof r.error=="string"?r.error:JSON.stringify(r.error):void 0},`${l}-${p?"open":"closed"}`),e[21]=s,e[22]=l,e[23]=r,e[24]=p,e[25]=h,e[26]=i,e[27]=v):v=e[27];let y;e[28]!==s||e[29]!==i?(y=!i&&o.jsx(Ji,{step:s}),e[28]=s,e[29]=i,e[30]=y):y=e[30];let j;e[31]!==s||e[32]!==i?(j=!i&&o.jsx(Yi,{step:s}),e[31]=s,e[32]=i,e[33]=j):j=e[33];let w;return e[34]!==g||e[35]!==b||e[36]!==S||e[37]!==v||e[38]!==y||e[39]!==j?(w=o.jsxs("div",{className:g,children:[b,S,v,y,j]}),e[34]=g,e[35]=b,e[36]=S,e[37]=v,e[38]=y,e[39]=j,e[40]=w):w=e[40],w}function zi(t){const e=_.c(15),{step:n}=t,i="toolName"in n.action&&"toolName"in n.action?n.action.toolName:null,r=Y(),l=i??"";let c;e[0]!==l?(c=o.jsx(Lt,{icon:null,name:l,size:"xs",className:"shadow-sm"}),e[0]=l,e[1]=c):c=e[1];let a;e[2]!==i?(a=o.jsx("span",{className:"text-base font-medium text-foreground truncate flex-1",children:i}),e[2]=i,e[3]=a):a=e[3];let d;e[4]!==r?(d=r?null:o.jsx(Wi,{}),e[4]=r,e[5]=d):d=e[5];let u;e[6]!==c||e[7]!==a||e[8]!==d?(u=o.jsxs("div",{className:"flex items-center gap-2",children:[c,a,d]}),e[6]=c,e[7]=a,e[8]=d,e[9]=u):u=e[9];let f;e[10]!==n.description?(f=n.description&&o.jsx("p",{className:"text-sm text-muted-foreground",children:n.description}),e[10]=n.description,e[11]=f):f=e[11];let m;return e[12]!==u||e[13]!==f?(m=o.jsxs("div",{className:"border-b border-border p-5 shrink-0 flex flex-col gap-2",children:[u,f]}),e[12]=u,e[13]=f,e[14]=m):m=e[14],m}function Wi(){const t=_.c(9),e=Ve(),{updateStep:n,startReplacingTool:s}=se(),i=Y(),l=e&&"toolName"in e.action?e.action.toolName:null;let c;t[0]!==e||t[1]!==s||t[2]!==l||t[3]!==i||t[4]!==n?(c=()=>{if(e){if(i){ks.error("You cannot replace a tool while a workflow is executing.");return}l&&s(l),n(e.name,{action:{...e.action,toolName:""}})}},t[0]=e,t[1]=s,t[2]=l,t[3]=i,t[4]=n,t[5]=c):c=t[5];const a=c;let d;t[6]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx(io,{size:14}),t[6]=d):d=t[6];let u;return t[7]!==a?(u=o.jsx(te,{variant:"ghost",size:"icon",className:"size-7",onClick:a,title:"Replace tool",children:d}),t[7]=a,t[8]=u):u=t[8],u}function Ft(t){const e=_.c(16),{org:n}=oe(),s=Ue();let i;e[0]!==n.id||e[1]!==s?(i=s??Fe(n.id),e[0]=n.id,e[1]=s,e[2]=i):i=e[2];const r=i;let l;e[3]!==n.id||e[4]!==r?(l={connectionId:r,orgId:n.id},e[3]=n.id,e[4]=r,e[5]=l):l=e[5];const c=ae(l);let a;e[6]!==c?(a={client:c},e[6]=c,e[7]=a):a=e[7];const d=yn(a);let u;e[8]!==t||e[9]!==d.data?.tools?(u=d.data?.tools?.find(x=>x.name===t),e[8]=t,e[9]=d.data?.tools,e[10]=u):u=e[10];const f=u;let m;return e[11]!==f||e[12]!==d.error||e[13]!==d.isLoading||e[14]!==d.isSuccess?(m={tool:f,isLoading:d.isLoading,isReady:d.isSuccess,error:d.error},e[11]=f,e[12]=d.error,e[13]=d.isLoading,e[14]=d.isSuccess,e[15]=m):m=e[15],m}function Di(t){const e=_.c(21),{step:n}=t,{updateStep:s}=se(),r="toolName"in n.action&&"toolName"in n.action?n.action.toolName:null,l=Y(),{tool:c}=Ft(r??""),a=cr(n.name),d=n.input,u=c?.inputSchema??null;let f;e[0]!==d||e[1]!==u?(f=!u&&d&&Object.keys(d).length>0?Fi(d):null,e[0]=d,e[1]=u,e[2]=f):f=e[2];const x=u??f;if(!x)return null;let p;e[3]!==n.name||e[4]!==s?(p=E=>{s(n.name,{input:E})},e[3]=n.name,e[4]=s,e[5]=p):p=e[5];const h=p;let g;e[6]!==x||e[7]!==n.input||e[8]!==l?(g=l?Hi(x,n.input):x,e[6]=x,e[7]=n.input,e[8]=l,e[9]=g):g=e[9];const b=g,S=l?"output":"input";let v;e[10]===Symbol.for("react.memo_cache_sentinel")?(v=o.jsx(Ms,{className:"px-5 py-5",children:o.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"Input"})}),e[10]=v):v=e[10];const y=n.name+l,j=!!l,w=b,N=n.input;let k;e[11]!==h||e[12]!==a||e[13]!==y||e[14]!==j||e[15]!==w||e[16]!==N?(k=o.jsxs(Ls,{value:"input",className:"border-b-0",children:[v,o.jsx(Ps,{className:"px-5 pt-2",children:o.jsx(Dt,{readOnly:j,inputSchema:w,inputParams:N,setInputParams:h,mentions:a},y)})]}),e[11]=h,e[12]=a,e[13]=y,e[14]=j,e[15]=w,e[16]=N,e[17]=k):k=e[17];let C;return e[18]!==k||e[19]!==S?(C=o.jsx(As,{type:"single",collapsible:!0,defaultValue:S,className:"border-b border-border shrink-0",children:k}),e[18]=k,e[19]=S,e[20]=C):C=e[20],C}function Fi(t){const e={};for(const n of Object.keys(t))e[n]={type:"string"};return{type:"object",properties:e}}function Hi(t,e){const n=structuredClone(t),s=n.properties;return s&&Object.keys(s).forEach(i=>{e[i]||delete s[i]}),n}function Vi(t){const e=_.c(42),{step:n,defaultOpen:s,isStepErrored:i,executionError:r}=t,l=n.outputSchema,c=Y(),{item:a}=ue(c),d=a?.completed_steps?.error??[];let u;e[0]!==n.name?(u=Z=>Z===n.name||Z.startsWith(`${n.name}[`),e[0]=n.name,e[1]=u):u=e[1];const f=d.some(u),x=(a?.status==="error"||a?.status==="failed")&&a?.running_steps?.includes(n.name),p=!!(a?.completed_steps?.success?.some(Z=>Z.name===n.name)||f||x),[h,g]=T.useState(s),b=n.forEach!==void 0,[S,v]=T.useState("all"),y=b?new RegExp(`^${n.name}\\[(\\d+)\\]$`):null,j=b?(a?.completed_steps?.success??[]).filter(Z=>y.test(Z.name)).map(Z=>{const Pe=Z.name.match(y);return{index:Number(Pe[1]),status:"success"}}):[],N=(b?d.filter(Z=>y.test(Z)):[]).map(Z=>{const Pe=Z.match(y);return{index:Number(Pe[1]),status:"error"}}),k=[...j,...N].sort(Ui),C=k.length>0,E=b&&S!=="all"?`${n.name}[${S}]`:void 0,W=p?n.name:void 0,z=E??W,{output:I,error:L}=Kn(c,z);let R;e[2]!==L||e[3]!==r||e[4]!==i||e[5]!==I?(R=I||(L?{error:L}:i&&r?{error:r}:void 0),e[2]=L,e[3]=r,e[4]=i,e[5]=I,e[6]=R):R=e[6];const D=R,F=l&&typeof l=="object"?l.properties:void 0;let P;e[7]!==F?(P=F?Object.entries(F):[],e[7]=F,e[8]=P):P=e[8];const H=P,U=S!=="all"&&N.some(Z=>Z.index===S),G=S==="all"?i||f||x:U,X=h?"flex-1 min-h-0 overflow-hidden":"shrink-0";let V;e[9]!==X?(V=O("flex flex-col border-b border-border",X),e[9]=X,e[10]=V):V=e[10];let q;e[11]!==h||e[12]!==g?(q=()=>g(!h),e[11]=h,e[12]=g,e[13]=q):q=e[13];const K=G?"text-destructive":"text-muted-foreground";let M;e[14]!==K?(M=O("text-sm font-medium",K),e[14]=K,e[15]=M):M=e[15];const J=G?"Error":"Output";let Q;e[16]!==M||e[17]!==J?(Q=o.jsx("h3",{className:M,children:J}),e[16]=M,e[17]=J,e[18]=Q):Q=e[18];let $;e[19]!==h?($=h?o.jsx(rt,{size:14,className:"text-muted-foreground"}):o.jsx(ot,{size:14,className:"text-muted-foreground"}),e[19]=h,e[20]=$):$=e[20];let A;e[21]!==Q||e[22]!==$?(A=o.jsxs("div",{className:"flex items-center justify-between",children:[Q,$]}),e[21]=Q,e[22]=$,e[23]=A):A=e[23];let ee;e[24]!==A||e[25]!==q?(ee=o.jsx("div",{className:"p-5 shrink-0 cursor-pointer hover:bg-accent/50 transition-colors",onClick:q,children:A}),e[24]=A,e[25]=q,e[26]=ee):ee=e[26];let re;e[27]!==k||e[28]!==D||e[29]!==C||e[30]!==b||e[31]!==h||e[32]!==H||e[33]!==S||e[34]!==v||e[35]!==n.name||e[36]!==c?(re=h&&o.jsxs(o.Fragment,{children:[c&&b&&C&&o.jsx(Ki,{iterations:k,selectedIteration:S,onSelect:v}),c&&D?o.jsx("div",{className:"flex-1 min-h-0",children:o.jsx(Re,{code:JSON.stringify(D,null,2),language:"json",height:"100%",readOnly:!0},`output-${n.name}-${S}`)}):null,!c&&H.length>0&&o.jsx("div",{className:"flex-1 min-h-0 overflow-auto px-5",children:H.map(qi)})]}),e[27]=k,e[28]=D,e[29]=C,e[30]=b,e[31]=h,e[32]=H,e[33]=S,e[34]=v,e[35]=n.name,e[36]=c,e[37]=re):re=e[37];let ie;return e[38]!==ee||e[39]!==re||e[40]!==V?(ie=o.jsxs("div",{className:V,children:[ee,re]}),e[38]=ee,e[39]=re,e[40]=V,e[41]=ie):ie=e[41],ie}function qi(t){const[e,n]=t;return o.jsx(Xi,{name:e,schema:n},e)}function Ui(t,e){return t.index-e.index}function Ki(t){const e=_.c(21),{iterations:n,selectedIteration:s,onSelect:i}=t,r=s==="all"?"bg-accent border-border text-foreground":"bg-transparent border-transparent text-muted-foreground hover:bg-accent/50 hover:text-foreground";let l;e[0]!==r?(l=O("h-7 px-3 text-xs font-medium rounded-lg border transition-colors inline-flex gap-1.5 items-center",r),e[0]=r,e[1]=l):l=e[1];let c;e[2]!==i?(c=()=>i("all"),e[2]=i,e[3]=c):c=e[3];let a;e[4]!==l||e[5]!==c?(a=o.jsx("button",{type:"button",className:l,onClick:c,children:"All Results"}),e[4]=l,e[5]=c,e[6]=a):a=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx("div",{className:"w-px h-4 bg-border mx-1"}),e[7]=d):d=e[7];let u;if(e[8]!==n||e[9]!==i||e[10]!==s){let p;e[12]!==i||e[13]!==s?(p=h=>{const g=s===h.index;return o.jsxs("button",{type:"button",className:O("h-7 px-2.5 text-xs font-medium rounded-lg border transition-colors inline-flex gap-1.5 items-center",g?"bg-accent border-border text-foreground":"bg-transparent border-transparent text-muted-foreground hover:bg-accent/50 hover:text-foreground"),onClick:()=>i(h.index),children:[h.status==="success"?o.jsx(He,{size:12,className:"text-success"}):o.jsx(Mt,{size:12,className:"text-destructive"}),o.jsxs("span",{className:"font-mono",children:["#",h.index]})]},h.index)},e[12]=i,e[13]=s,e[14]=p):p=e[14],u=n.map(p),e[8]=n,e[9]=i,e[10]=s,e[11]=u}else u=e[11];let f;e[15]!==a||e[16]!==u?(f=o.jsxs("div",{className:"flex w-max items-center gap-2 pb-3",children:[a,d,u]}),e[15]=a,e[16]=u,e[17]=f):f=e[17];let m;e[18]===Symbol.for("react.memo_cache_sentinel")?(m=o.jsx(Js,{orientation:"horizontal"}),e[18]=m):m=e[18];let x;return e[19]!==f?(x=o.jsx("div",{className:"px-5 pb-3 shrink-0 border-b border-border/50",children:o.jsxs(Gs,{className:"w-full whitespace-nowrap",children:[f,m]})}),e[19]=f,e[20]=x):x=e[20],x}function Bi(t){switch(t){case"string":return{Icon:An,color:"text-blue-500"};case"number":case"integer":return{Icon:Mn,color:"text-blue-500"};case"array":return{Icon:En,color:"text-purple-500"};case"object":return{Icon:Tn,color:"text-orange-500"};case"boolean":return{Icon:Pn,color:"text-pink-500"};case"null":return{Icon:$t,color:"text-gray-500"};default:return{Icon:On,color:"text-muted-foreground"}}}function Xi(t){const e=_.c(28),{name:n,schema:s}=t,i=Ve(),r=s.type??"unknown";let l,c,a,d,u;if(e[0]!==r){const{Icon:y,color:j}=Bi(r);u="flex items-center gap-2",d="flex-1 flex items-center gap-2",l=y,c=14,a=O(j),e[0]=r,e[1]=l,e[2]=c,e[3]=a,e[4]=d,e[5]=u}else l=e[1],c=e[2],a=e[3],d=e[4],u=e[5];let f;e[6]!==l||e[7]!==c||e[8]!==a?(f=o.jsx(l,{size:c,className:a}),e[6]=l,e[7]=c,e[8]=a,e[9]=f):f=e[9];let m;e[10]!==n?(m=o.jsx("span",{className:"text-sm font-medium text-foreground",children:n}),e[10]=n,e[11]=m):m=e[11];let x;e[12]!==d||e[13]!==f||e[14]!==m?(x=o.jsxs("div",{className:d,children:[f,m]}),e[12]=d,e[13]=f,e[14]=m,e[15]=x):x=e[15];let p;e[16]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx(ro,{size:14,className:"opacity-50"}),e[16]=p):p=e[16];const h=i?.name;let g;e[17]!==h?(g=o.jsxs("span",{className:"text-muted-foreground",children:[h,"."]}),e[17]=h,e[18]=g):g=e[18];let b;e[19]!==n?(b=o.jsx("div",{className:"bg-blue-500/10 text-blue-500 px-1 py-0.5 rounded",children:n}),e[19]=n,e[20]=b):b=e[20];let S;e[21]!==g||e[22]!==b?(S=o.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[p,g,b]}),e[21]=g,e[22]=b,e[23]=S):S=e[23];let v;return e[24]!==S||e[25]!==u||e[26]!==x?(v=o.jsxs("div",{className:u,children:[x,S]}),e[24]=S,e[25]=u,e[26]=x,e[27]=v):v=e[27],v}function Ji(t){const e=_.c(29),{step:n}=t,{updateStep:s}=se(),i=Y(),[r,l]=T.useState(!1),c="toolName"in n.action,a=c&&"toolName"in n.action?n.action.toolName:null,{tool:d}=Ft(a??""),u=c&&"transformCode"in n.action?n.action.transformCode??null:null;let f;e[0]!==d?(f=()=>{if(!d?.outputSchema)return`interface Input {
|
|
8
8
|
// Tool output schema not available
|
|
9
9
|
}`;const k=d.outputSchema,C=k.properties;return C?`interface Input {
|
|
10
10
|
${Object.entries(C).map(W=>{const[z,I]=W,L=Ge(I),R=!k.required?.includes(z);return` ${z}${R?"?":""}: ${L};`}).join(`
|
|
@@ -23,4 +23,4 @@ export default async function(stepInput: Input): Promise<Output> {
|
|
|
23
23
|
return {
|
|
24
24
|
result: stepInput,
|
|
25
25
|
};
|
|
26
|
-
}`;s(n.name,{action:{...n.action,transformCode:C}}),l(Gi)},e[2]=m,e[3]=n.action,e[4]=n.name,e[5]=s,e[6]=x):x=e[6];const p=x;let h;e[7]!==n.action||e[8]!==n.name||e[9]!==s?(h=(k,C)=>{s(n.name,{action:{...n.action,transformCode:k},...C?{outputSchema:C}:{}})},e[7]=n.action,e[8]=n.name,e[9]=s,e[10]=h):h=e[10];const g=h;if("code"in n.action&&n.action.code)return null;const b=r?"flex-1 min-h-0 overflow-hidden":"shrink-0";let S;e[11]!==b?(S=O("flex flex-col flex-1 min-h-0 overflow-hidden border-b border-border",b),e[11]=b,e[12]=S):S=e[12];let v;e[13]===Symbol.for("react.memo_cache_sentinel")?(v=o.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:"Transform Code"}),e[13]=v):v=e[13];let y;e[14]!==r?(y=o.jsxs("div",{className:"flex items-center justify-between",children:[v,r?o.jsx(rt,{size:14,className:"text-muted-foreground"}):o.jsx(ot,{size:14,className:"text-muted-foreground"})]}),e[14]=r,e[15]=y):y=e[15];let j;e[16]!==y||e[17]!==p?(j=o.jsx("div",{className:"p-5 shrink-0 cursor-pointer hover:bg-accent/50 transition-colors",onClick:p,children:y}),e[16]=y,e[17]=p,e[18]=j):j=e[18];let w;e[19]!==g||e[20]!==r||e[21]!==n.name||e[22]!==i||e[23]!==u?(w=r&&o.jsx("div",{className:"flex-1 min-h-0",children:o.jsx(Re,{code:u,language:"typescript",readOnly:i!==void 0,onSave:g,height:"100%"},`transform-code-${n.name}-${i}`)}),e[19]=g,e[20]=r,e[21]=n.name,e[22]=i,e[23]=u,e[24]=w):w=e[24];let N;return e[25]!==S||e[26]!==j||e[27]!==w?(N=o.jsxs("div",{className:S,children:[j,w]}),e[25]=S,e[26]=j,e[27]=w,e[28]=N):N=e[28],N}function Gi(t){return!t}function Qi(t){return!t}function Yi(t){const e=_.c(25),{step:n}=t,[s,i]=T.useState(!1),{updateStep:r}=se(),l=de(),c="code"in n.action&&n.action.code?n.action.code:null,a=Y();if(!c)return null;let d;e[0]!==n.action||e[1]!==n.name||e[2]!==r?(d=(m,x)=>{r(n.name,{action:{...n.action,code:m},...x?{outputSchema:x}:{}})},e[0]=n.action,e[1]=n.name,e[2]=r,e[3]=d):d=e[3];const u=d;let f;if(e[4]!==c||e[5]!==u||e[6]!==s||e[7]!==n.action||e[8]!==n.input||e[9]!==n.name||e[10]!==a||e[11]!==r||e[12]!==l.input_schema||e[13]!==l.steps){const m=[],x=l.input_schema;x&&m.push({name:"input",label:"Workflow Input",schema:x});for(const N of l.steps){if(N.name===n.name)break;m.push({name:N.name,label:N.name,schema:N.outputSchema})}const p=n.input??{},h=new Set(Object.entries(p).filter(el).map(Zi)),g=N=>{const k={...p};if(h.has(N)){const L=Object.entries(k).find(R=>{const[,D]=R;return D===`@${N}`})?.[0];L&&delete k[L]}else k[N]=`@${N}`;const C={};for(const[L,R]of Object.entries(k)){if(typeof R!="string"||!R.startsWith("@"))continue;const D=R.slice(1),F=m.find(P=>P.name===D);F?.schema&&(C[L]=F.schema)}const E=Object.keys(C).length>0?{type:"object",properties:C,required:Object.keys(C)}:null,W=E?Dn(E,"Input"):"interface Input {}",z=n.action,I=Fn(z.code,W);r(n.name,{input:k,action:{...n.action,code:I}})},b=s?"flex-1 min-h-0 overflow-hidden":"shrink-0";let S;e[15]!==b?(S=O("flex flex-col border-b border-border",b),e[15]=b,e[16]=S):S=e[16];let v;e[17]!==s?(v=()=>i(!s),e[17]=s,e[18]=v):v=e[18];let y;e[19]===Symbol.for("react.memo_cache_sentinel")?(y=o.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:"Step Code"}),e[19]=y):y=e[19];let j;e[20]!==s?(j=o.jsxs("div",{className:"flex items-center justify-between",children:[y,s?o.jsx(rt,{size:14,className:"text-muted-foreground"}):o.jsx(ot,{size:14,className:"text-muted-foreground"})]}),e[20]=s,e[21]=j):j=e[21];let w;e[22]!==v||e[23]!==j?(w=o.jsx("div",{className:"p-5 shrink-0 cursor-pointer hover:bg-accent/50 transition-colors",onClick:v,children:j}),e[22]=v,e[23]=j,e[24]=w):w=e[24],f=o.jsxs("div",{className:S,children:[w,s&&o.jsxs(o.Fragment,{children:[!a&&m.length>0&&o.jsxs("div",{className:"px-5 pb-3 shrink-0 border-b border-border/50",children:[o.jsxs("p",{className:"text-xs text-muted-foreground mb-2",children:["Select variables available to your code as"," ",o.jsx("code",{className:"text-[11px] bg-accent px-1 py-0.5 rounded",children:"input"}),":"]}),o.jsx("div",{className:"flex flex-wrap gap-1.5",children:m.map(N=>{const k=h.has(N.name);return o.jsxs("button",{type:"button",className:O("h-7 px-2.5 text-xs font-medium rounded-lg border transition-colors inline-flex items-center gap-1.5",k?"bg-accent border-border text-foreground":"bg-transparent border-transparent text-muted-foreground hover:bg-accent/50 hover:text-foreground"),onClick:()=>g(N.name),children:[k&&o.jsx(He,{size:12,className:"text-success"}),o.jsxs("span",{className:"font-mono",children:["@",N.name]})]},N.name)})})]}),o.jsx("div",{className:"flex-1 min-h-0",children:o.jsx(Re,{onSave:(N,k)=>u(N,k),code:c,language:"typescript",height:"100%",readOnly:a!==void 0},`step-code-${n.name}-${a}`)})]})]}),e[4]=c,e[5]=u,e[6]=s,e[7]=n.action,e[8]=n.input,e[9]=n.name,e[10]=a,e[11]=r,e[12]=l.input_schema,e[13]=l.steps,e[14]=f}else f=e[14];return f}function Zi(t){const[,e]=t;return e.slice(1)}function el(t){const[,e]=t;return typeof e=="string"&&e.startsWith("@")}function Ge(t){if(Array.isArray(t.type))return t.type.map(n=>Ge({...t,type:n})).join(" | ");switch(t.type){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"array":return t.items?`${Ge(t.items)}[]`:"unknown[]";case"object":return t.properties?`{ ${Object.entries(t.properties).map(([s,i])=>{const r=Ge(i),l=!t.required?.includes(s);return`${s}${l?"?":""}: ${r}`}).join("; ")} }`:"Record<string, unknown>";case"null":return"null";default:return"unknown"}}function tl(t){const{status:e}=t,n=(t.completed_steps?.error?.length??0)>0;if(e==="success"&&n)return o.jsxs(le,{variant:"warning",className:"gap-1",children:[o.jsx(_s,{size:11}),"Partial"]});switch(e){case"success":return o.jsxs(le,{variant:"success",className:"gap-1",children:[o.jsx(He,{size:11}),"Success"]});case"error":case"failed":return o.jsxs(le,{variant:"destructive",className:"gap-1",children:[o.jsx(pn,{size:11}),"Error"]});case"running":return o.jsxs(le,{variant:"secondary",className:"gap-1",children:[o.jsx(bt,{size:11}),"Running"]});case"enqueued":return o.jsxs(le,{variant:"secondary",className:"gap-1",children:[o.jsx(bt,{size:11}),"On hold"]});case"cancelled":return o.jsxs(le,{variant:"secondary",className:"gap-1",children:[o.jsx(_n,{size:11}),"Cancelled"]});default:return o.jsxs(le,{variant:"secondary",className:"gap-1",children:[o.jsx(bt,{size:11}),e]})}}function nl(t){return`Run #${t.slice(-4).toUpperCase()}`}function sl(t){const e=_.c(21),{className:n}=t,{executions:s,isLoading:i}=Jo(),{setShowExecutionsList:r}=At(),{setTrackingExecutionId:l}=se(),c=Y();let a;e[0]!==l?(a=v=>{l(v)},e[0]=l,e[1]=a):a=e[1];const d=a;let u;e[2]!==r?(u=()=>{r(!1)},e[2]=r,e[3]=u):u=e[3];const f=u;let m;e[4]!==n?(m=O("flex flex-col h-full bg-sidebar border-l border-border",n),e[4]=n,e[5]=m):m=e[5];let x;e[6]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx("p",{className:"flex-1 text-base font-medium text-foreground",children:"Runs"}),e[6]=x):x=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx(_n,{size:11}),e[7]=p):p=e[7];let h;e[8]!==f?(h=o.jsxs("div",{className:"flex items-center h-12 px-5 border-b border-border shrink-0",children:[x,o.jsx(te,{variant:"ghost",size:"icon",className:"size-7",onClick:f,children:p})]}),e[8]=f,e[9]=h):h=e[9];let g;e[10]!==s||e[11]!==d||e[12]!==i||e[13]!==c?(g=i?o.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"Loading executions..."}):s.map((v,y)=>o.jsx(ol,{execution:v,isSelected:v.id===c,isFirst:y===0,onSelect:()=>d(v.id)},v.id)),e[10]=s,e[11]=d,e[12]=i,e[13]=c,e[14]=g):g=e[14];let b;e[15]!==g?(b=o.jsx("div",{className:"flex-1 overflow-auto",children:g}),e[15]=g,e[16]=b):b=e[16];let S;return e[17]!==m||e[18]!==h||e[19]!==b?(S=o.jsxs("div",{className:m,children:[h,b]}),e[17]=m,e[18]=h,e[19]=b,e[20]=S):S=e[20],S}function ol(t){const e=_.c(17),{execution:n,isSelected:s,isFirst:i,onSelect:r}=t,l=s&&"bg-accent/50",c=i&&s&&"bg-accent/50",a=!s&&"hover:bg-accent/30";let d;e[0]!==l||e[1]!==c||e[2]!==a?(d=O("flex flex-col justify-center h-[60px] px-4 border-b border-border cursor-pointer transition-colors",l,c,a),e[0]=l,e[1]=c,e[2]=a,e[3]=d):d=e[3];let u;e[4]!==n?(u=tl(n),e[4]=n,e[5]=u):u=e[5];let f;e[6]!==n.id?(f=nl(n.id),e[6]=n.id,e[7]=f):f=e[7];let m;e[8]!==f?(m=o.jsx("p",{className:"flex-1 text-base font-medium text-foreground",children:f}),e[8]=f,e[9]=m):m=e[9];let x;e[10]!==u||e[11]!==m?(x=o.jsxs("div",{className:"flex items-center gap-2 w-full",children:[u,m]}),e[10]=u,e[11]=m,e[12]=x):x=e[12];let p;return e[13]!==r||e[14]!==d||e[15]!==x?(p=o.jsx("div",{className:d,onClick:r,children:x}),e[13]=r,e[14]=d,e[15]=x,e[16]=p):p=e[16],p}const rl=["workflow.execution.created","workflow.execution.resumed","workflow.step.execute","workflow.step.completed"],il=yo({buildUrl:t=>`/org/${t}/watch?types=workflow.*`,eventTypes:rl}),ll=["COLLECTION_WORKFLOW_EXECUTION_LIST","COLLECTION_WORKFLOW_EXECUTION_GET","COLLECTION_WORKFLOW_EXECUTION_GET_STEP_RESULT"],cl=500,De=new Map,We=new Map;function al(t){const e=We.get(t);if(e)for(const n of e)n.invalidateQueries({predicate:s=>s.queryKey.some(i=>typeof i=="string"&&ll.includes(i))})}function dl(t){De.has(t)||De.set(t,setTimeout(()=>{De.delete(t),al(t)},cl))}const sn=()=>0;function ul(){const t=_.c(3),{org:e}=oe(),n=cn(),s=e.id;let i;t[0]!==s||t[1]!==n?(i=l=>{let c=We.get(s);c||(c=new Set,We.set(s,c)),c.add(n);const a=()=>{dl(s),l()},d=il.subscribe(s,a);return()=>{d(),c.delete(n),c.size===0&&We.delete(s);const u=De.get(s);u&&!We.has(s)&&(clearTimeout(u),De.delete(s))}},t[0]=s,t[1]=n,t[2]=i):i=t[2];const r=i;T.useSyncExternalStore(r,sn,sn)}const on=[{value:"string",label:"String"},{value:"number",label:"Number"},{value:"integer",label:"Integer"},{value:"boolean",label:"Boolean"},{value:"object",label:"Object"},{value:"array",label:"Array"}],fl={type:"object",properties:{field:{type:"string",description:"An input field"}},required:["field"]},ml=2;function pl(t){const e=_.c(66),{className:n}=t,s=de(),{setWorkflow:i}=se(),[r,l]=T.useState("visual"),[c,a]=T.useState(!1);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d={},e[0]=d):d=e[0];const[u,f]=T.useState(d),m=s.input_schema??null;let x;e[1]!==i||e[2]!==s?(x=M=>{i({...s,input_schema:M})},e[1]=i,e[2]=s,e[3]=x):x=e[3];const p=x;let h;e[4]!==p?(h=M=>{try{const J=JSON.parse(M);p(J)}catch{}},e[4]=p,e[5]=h):h=e[5];const g=h;let b;e[6]!==p?(b=()=>{p(fl)},e[6]=p,e[7]=b):b=e[7];const S=b;let v;e[8]!==p?(v=()=>{p(void 0)},e[8]=p,e[9]=v):v=e[9];const y=v;if(!m){let M;e[10]!==n?(M=O("flex flex-col h-full bg-sidebar",n),e[10]=n,e[11]=M):M=e[11];let J;e[12]===Symbol.for("react.memo_cache_sentinel")?(J=o.jsx(rn,{}),e[12]=J):J=e[12];let Q;e[13]===Symbol.for("react.memo_cache_sentinel")?(Q=o.jsx("p",{className:"text-sm text-muted-foreground",children:"No input schema defined. Add one to require structured input when running this workflow."}),e[13]=Q):Q=e[13];let $;e[14]===Symbol.for("react.memo_cache_sentinel")?($=o.jsx(Ln,{size:14}),e[14]=$):$=e[14];let A;e[15]!==S?(A=o.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 p-8 text-center",children:[Q,o.jsxs(te,{variant:"outline",size:"sm",className:"gap-2",onClick:S,children:[$,"Add input schema"]})]}),e[15]=S,e[16]=A):A=e[16];let ee;return e[17]!==A||e[18]!==M?(ee=o.jsxs("div",{className:M,children:[J,A]}),e[17]=A,e[18]=M,e[19]=ee):ee=e[19],ee}let j;e[20]!==n?(j=O("flex flex-col h-full bg-sidebar",n),e[20]=n,e[21]=j):j=e[21];const w=r==="visual"?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground";let N;e[22]!==w?(N=O("h-6 px-2 rounded text-xs font-medium transition-colors",w),e[22]=w,e[23]=N):N=e[23];let k,C;e[24]===Symbol.for("react.memo_cache_sentinel")?(C=()=>l("visual"),k=o.jsx(lo,{size:12}),e[24]=k,e[25]=C):(k=e[24],C=e[25]);let E;e[26]!==N?(E=o.jsx("button",{type:"button",className:N,onClick:C,children:k}),e[26]=N,e[27]=E):E=e[27];const W=r==="code"?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground";let z;e[28]!==W?(z=O("h-6 px-2 rounded text-xs font-medium transition-colors",W),e[28]=W,e[29]=z):z=e[29];let I,L;e[30]===Symbol.for("react.memo_cache_sentinel")?(I=()=>l("code"),L=o.jsx(mn,{size:12}),e[30]=I,e[31]=L):(I=e[30],L=e[31]);let R;e[32]!==z?(R=o.jsx("button",{type:"button",className:z,onClick:I,children:L}),e[32]=z,e[33]=R):R=e[33];let D;e[34]!==E||e[35]!==R?(D=o.jsx(rn,{children:o.jsxs("div",{className:"flex items-center gap-1 border border-border rounded-lg p-0.5",children:[E,R]})}),e[34]=E,e[35]=R,e[36]=D):D=e[36];let F;e[37]!==g||e[38]!==m||e[39]!==p||e[40]!==r||e[41]!==s.id?(F=r==="visual"?o.jsx(o.Fragment,{children:o.jsx("div",{className:"flex-1 overflow-auto",children:o.jsx(Et,{schema:m,onChange:M=>p(M),depth:0})})}):o.jsx("div",{className:"flex-1 min-h-0",children:o.jsx(Re,{code:JSON.stringify(m,null,2),language:"json",height:"100%",onSave:g},`input-schema-${s.id}`)}),e[37]=g,e[38]=m,e[39]=p,e[40]=r,e[41]=s.id,e[42]=F):F=e[42];let P;e[43]!==c?(P=()=>a(!c),e[43]=c,e[44]=P):P=e[44];let H;e[45]===Symbol.for("react.memo_cache_sentinel")?(H=o.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Preview"}),e[45]=H):H=e[45];let U;e[46]!==c?(U=c?o.jsx(rt,{size:14,className:"text-muted-foreground"}):o.jsx(ot,{size:14,className:"text-muted-foreground"}),e[46]=c,e[47]=U):U=e[47];let G;e[48]!==P||e[49]!==U?(G=o.jsxs("button",{type:"button",className:"w-full px-5 py-3 flex items-center justify-between hover:bg-accent/50 transition-colors",onClick:P,children:[H,U]}),e[48]=P,e[49]=U,e[50]=G):G=e[50];let X;e[51]!==m||e[52]!==u||e[53]!==c?(X=c&&o.jsx("div",{className:"px-5 pb-4 max-h-64 overflow-auto",children:o.jsx(Dt,{inputSchema:m,inputParams:u,setInputParams:f,mentions:[]})}),e[51]=m,e[52]=u,e[53]=c,e[54]=X):X=e[54];let V;e[55]!==G||e[56]!==X?(V=o.jsxs("div",{className:"shrink-0 border-t border-border",children:[G,X]}),e[55]=G,e[56]=X,e[57]=V):V=e[57];let q;e[58]!==y?(q=o.jsx("div",{className:"px-5 py-3 shrink-0 border-t border-border",children:o.jsx("button",{type:"button",className:"text-xs text-muted-foreground hover:text-destructive transition-colors",onClick:y,children:"Remove input schema"})}),e[58]=y,e[59]=q):q=e[59];let K;return e[60]!==D||e[61]!==F||e[62]!==V||e[63]!==q||e[64]!==j?(K=o.jsxs("div",{className:j,children:[D,F,V,q]}),e[60]=D,e[61]=F,e[62]=V,e[63]=q,e[64]=j,e[65]=K):K=e[65],K}function rn(t){const e=_.c(4),{children:n}=t;let s,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx(xn,{className:"w-4 h-4 text-muted-foreground shrink-0"}),i=o.jsx("span",{className:"text-base font-medium text-foreground flex-1",children:"Workflow Input"}),e[0]=s,e[1]=i):(s=e[0],i=e[1]);let r;return e[2]!==n?(r=o.jsxs("div",{className:"border-b border-border p-5 shrink-0 flex items-center gap-2",children:[s,i,n]}),e[2]=n,e[3]=r):r=e[3],r}function Et({schema:t,onChange:e,depth:n}){const s=t.properties??{},i=t.required??[],r=()=>{const f=Object.keys(s);let m="field",x=1;for(;f.includes(m);)m=`field_${x}`,x++;e({...t,properties:{...s,[m]:{type:"string"}},required:[...i,m]})},l=f=>{const{[f]:m,...x}=s;e({...t,properties:x,required:i.filter(p=>p!==f)})},c=(f,m)=>{e({...t,properties:{...s,[f]:m}})},a=(f,m)=>{if(!m.trim()||m===f||s[m])return;const x={};for(const[p,h]of Object.entries(s))x[p===f?m:p]=h;e({...t,properties:x,required:i.map(p=>p===f?m:p)})},d=f=>{const m=i.includes(f);e({...t,required:m?i.filter(x=>x!==f):[...i,f]})},u=Object.entries(s);return o.jsxs("div",{children:[u.length===0&&n===0&&o.jsx("div",{className:"p-5 text-sm text-muted-foreground text-center",children:"No fields defined yet."}),o.jsx("div",{className:"divide-y divide-border",children:u.map(([f,m])=>o.jsx(xl,{name:f,schema:m,isRequired:i.includes(f),depth:n,onRename:x=>a(f,x),onUpdate:x=>c(f,x),onToggleRequired:()=>d(f),onRemove:()=>l(f)},f))}),o.jsx("div",{className:O("p-3",n>0&&"pb-1"),children:o.jsxs(te,{variant:"outline",size:"sm",className:"w-full gap-2",onClick:r,children:[o.jsx(Ln,{size:14}),"Add field"]})})]})}function xl(t){const e=_.c(72),{name:n,schema:s,isRequired:i,depth:r,onRename:l,onUpdate:c,onToggleRequired:a,onRemove:d}=t,[u,f]=T.useState(!1),[m,x]=T.useState(n),p=s.type??"string",h=p==="array",g=p==="object",b=r<ml;let S;e[0]!==m||e[1]!==n||e[2]!==l?(S=()=>{f(!1),m.trim()&&m!==n?l(m.trim()):x(n)},e[0]=m,e[1]=n,e[2]=l,e[3]=S):S=e[3];const v=S;let y;e[4]!==b||e[5]!==c||e[6]!==s.description||e[7]!==s.items||e[8]!==s.properties||e[9]!==s.required?(y=$=>{const A={type:$};s.description&&(A.description=s.description),$==="array"&&(A.items=s.items??{type:"string"}),$==="object"&&b&&(A.properties=s.properties??{},A.required=s.required??[]),c(A)},e[4]=b,e[5]=c,e[6]=s.description,e[7]=s.items,e[8]=s.properties,e[9]=s.required,e[10]=y):y=e[10];const j=y;let w;e[11]!==c||e[12]!==s?(w=$=>{const A={...s};$?A.description=$:delete A.description,c(A)},e[11]=c,e[12]=s,e[13]=w):w=e[13];const N=w;let k;e[14]!==b||e[15]!==c||e[16]!==s?(k=$=>{const A={type:$};$==="object"&&b&&(A.properties=s.items?.properties??{},A.required=s.items?.required??[]),c({...s,items:A})},e[14]=b,e[15]=c,e[16]=s,e[17]=k):k=e[17];const C=k,E=r>0&&"py-3";let W;e[18]!==E?(W=O("flex flex-col gap-2 p-4",E),e[18]=E,e[19]=W):W=e[19];let z;e[20]!==v||e[21]!==m||e[22]!==u||e[23]!==n?(z=u?o.jsx(Kt,{value:m,onChange:$=>x($.target.value),onBlur:v,onKeyDown:$=>{$.key==="Enter"&&v(),$.key==="Escape"&&(x(n),f(!1))},className:"h-7 text-sm font-medium flex-1 min-w-0",autoFocus:!0}):o.jsx("button",{type:"button",className:"text-sm font-medium text-foreground flex-1 text-left truncate hover:underline cursor-text min-w-0",onClick:()=>{x(n),f(!0)},children:n}),e[20]=v,e[21]=m,e[22]=u,e[23]=n,e[24]=z):z=e[24];let I;e[25]===Symbol.for("react.memo_cache_sentinel")?(I=o.jsx(kt,{className:"h-7 w-24 text-xs shrink-0",children:o.jsx(Nt,{})}),e[25]=I):I=e[25];let L;e[26]===Symbol.for("react.memo_cache_sentinel")?(L=o.jsx(vt,{children:on.map(gl)}),e[26]=L):L=e[26];let R;e[27]!==p||e[28]!==j?(R=o.jsxs(wt,{value:p,onValueChange:j,children:[I,L]}),e[27]=p,e[28]=j,e[29]=R):R=e[29];let D;e[30]===Symbol.for("react.memo_cache_sentinel")?(D=o.jsx(un,{size:14}),e[30]=D):D=e[30];let F;e[31]!==d?(F=o.jsx(te,{variant:"ghost",size:"icon",className:"size-7 shrink-0 text-muted-foreground hover:text-destructive",onClick:d,children:D}),e[31]=d,e[32]=F):F=e[32];let P;e[33]!==R||e[34]!==F||e[35]!==z?(P=o.jsxs("div",{className:"flex items-center gap-2",children:[z,R,F]}),e[33]=R,e[34]=F,e[35]=z,e[36]=P):P=e[36];const H=s.description??"";let U;e[37]!==N?(U=$=>N($.target.value),e[37]=N,e[38]=U):U=e[38];let G;e[39]!==H||e[40]!==U?(G=o.jsx(Kt,{value:H,onChange:U,placeholder:"Description (optional)",className:"h-7 text-xs text-muted-foreground"}),e[39]=H,e[40]=U,e[41]=G):G=e[41];let X;e[42]!==i||e[43]!==a?(X=o.jsx("input",{type:"checkbox",checked:i,onChange:a,className:"rounded border-border"}),e[42]=i,e[43]=a,e[44]=X):X=e[44];let V;e[45]===Symbol.for("react.memo_cache_sentinel")?(V=o.jsx("span",{className:"text-xs text-muted-foreground",children:"Required"}),e[45]=V):V=e[45];let q;e[46]!==X?(q=o.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[X,V]}),e[46]=X,e[47]=q):q=e[47];let K;e[48]!==C||e[49]!==h||e[50]!==s.items?(K=h&&o.jsxs("div",{className:"flex items-center gap-2 pl-2 border-l-2 border-border ml-1",children:[o.jsx("span",{className:"text-xs text-muted-foreground",children:"Items:"}),o.jsxs(wt,{value:s.items?.type??"string",onValueChange:C,children:[o.jsx(kt,{className:"h-7 w-24 text-xs",children:o.jsx(Nt,{})}),o.jsx(vt,{children:on.map(hl)})]})]}),e[48]=C,e[49]=h,e[50]=s.items,e[51]=K):K=e[51];let M;e[52]!==b||e[53]!==r||e[54]!==h||e[55]!==c||e[56]!==s?(M=h&&b&&s.items?.type==="object"&&o.jsxs("div",{className:"pl-2 border-l-2 border-border ml-1",children:[o.jsx("span",{className:"text-xs text-muted-foreground mb-1 block",children:"Item properties:"}),o.jsx(Et,{schema:s.items,onChange:$=>c({...s,items:$}),depth:r+1})]}),e[52]=b,e[53]=r,e[54]=h,e[55]=c,e[56]=s,e[57]=M):M=e[57];let J;e[58]!==b||e[59]!==r||e[60]!==g||e[61]!==c||e[62]!==s?(J=g&&b&&o.jsxs("div",{className:"pl-2 border-l-2 border-border ml-1",children:[o.jsx("span",{className:"text-xs text-muted-foreground mb-1 block",children:"Properties:"}),o.jsx(Et,{schema:s,onChange:$=>c($),depth:r+1})]}),e[58]=b,e[59]=r,e[60]=g,e[61]=c,e[62]=s,e[63]=J):J=e[63];let Q;return e[64]!==P||e[65]!==G||e[66]!==q||e[67]!==K||e[68]!==M||e[69]!==J||e[70]!==W?(Q=o.jsxs("div",{className:W,children:[P,G,q,K,M,J]}),e[64]=P,e[65]=G,e[66]=q,e[67]=K,e[68]=M,e[69]=J,e[70]=W,e[71]=Q):Q=e[71],Q}function hl(t){return o.jsx(nt,{value:t.value,children:t.label},t.value)}function gl(t){return o.jsx(nt,{value:t.value,children:t.label},t.value)}function ls(t){const e=_.c(10),{itemId:n,connectionId:s}=t,[i,r]=T.useState(!1),l=s??"self",c=l??"no-connection",{org:a}=oe(),d=l??null;let u;e[0]!==a.id||e[1]!==d?(u={connectionId:d,orgId:a.id},e[0]=a.id,e[1]=d,e[2]=u):u=e[2];const f=ae(u),m=Cn(c,"WORKFLOW",n,f),x=So(c,"WORKFLOW",f);let p;e[3]!==x||e[4]!==n?(p=async b=>{r(!0),await x.update.mutateAsync({id:n,data:b}).finally(()=>{r(!1)})},e[3]=x,e[4]=n,e[5]=p):p=e[5];const h=p;let g;return e[6]!==i||e[7]!==m||e[8]!==h?(g={item:m,update:h,isUpdating:i},e[6]=i,e[7]=m,e[8]=h,e[9]=g):g=e[9],g}function bl(t){const e=_.c(19),{workflow:n,onUpdate:s}=t,{setWorkflow:i}=se();let r,l,c,a;if(e[0]!==n.description||e[1]!==n.id||e[2]!==n.input_schema||e[3]!==n.steps||e[4]!==n.title){const f={title:n.title,description:n.description,input_schema:n.input_schema,steps:n.steps};r=Re,l=`workflow-${n.id}`,c="100%",a=JSON.stringify(f,null,2),e[0]=n.description,e[1]=n.id,e[2]=n.input_schema,e[3]=n.steps,e[4]=n.title,e[5]=r,e[6]=l,e[7]=c,e[8]=a}else r=e[5],l=e[6],c=e[7],a=e[8];let d;e[9]!==s||e[10]!==i||e[11]!==n?(d=f=>{const m=JSON.parse(f);i({...n,...m}),s(m)},e[9]=s,e[10]=i,e[11]=n,e[12]=d):d=e[12];let u;return e[13]!==r||e[14]!==l||e[15]!==c||e[16]!==a||e[17]!==d?(u=o.jsx(r,{height:c,code:a,language:"json",onSave:d},l),e[13]=r,e[14]=l,e[15]=c,e[16]=a,e[17]=d,e[18]=u):u=e[18],u}function jl(){const t=_.c(9),e=Y(),{item:n}=ue(e),s=n?.start_at_epoch_ms,i=n?.completed_at_epoch_ms,r=n?.status==="running"&&s&&!i;let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=Date.now(),t[0]=l):l=t[0];const c=T.useRef(l);let a;t[1]!==r?(a=h=>{if(!r)return Sl;const g=setInterval(()=>{c.current=Date.now(),h()},50);return()=>clearInterval(g)},t[1]=r,t[2]=a):a=t[2];const d=a;let u;t[3]!==r?(u=()=>r?c.current:0,t[3]=r,t[4]=u):u=t[4];const f=u,m=T.useSyncExternalStore(d,f,f),x=i&&s?Math.max(0,i-s):null;let p=null;if(s){let h;t[5]!==s?(h=new Date(s).getTime(),t[5]=s,t[6]=h):h=t[6];const g=h;if(i){let b;t[7]!==i?(b=new Date(i).getTime(),t[7]=i,t[8]=b):b=t[8],p=Math.max(0,b-g)}else r&&(p=Math.max(0,m-g))}return p??x}function Sl(){}function yl(t){if(t<1e3)return`${t}ms`;const e=t/1e3,n=e%60,s=Math.floor(e/60),i=s%60,r=Math.floor(s/60);return r>0?`${r}h ${i}m ${n.toFixed(3)}s`:i>0?`${i}m ${n.toFixed(3)}s`:`${n.toFixed(3)}s`}function vl(){const t=_.c(29),{setTrackingExecutionId:e}=se(),n=Y(),{item:s}=ue(n),i=jl();let r;t[0]!==i?(r=i!=null?yl(i):null,t[0]=i,t[1]=r):r=t[1];const l=r,c=s?.status,a=c==="error"||c==="failed",d=(s?.completed_steps?.error?.length??0)>0,u=c==="success"&&d,f=c==="success"&&!d;let m;t[2]===Symbol.for("react.memo_cache_sentinel")?(m=o.jsx("div",{className:"flex items-center justify-center h-full w-12",children:o.jsx(Cs,{className:"w-4 h-4 text-muted-foreground"})}),t[2]=m):m=t[2];let x;t[3]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx("strong",{className:"text-base text-foreground",children:"Run"}),t[3]=x):x=t[3];let p;t[4]!==n?(p=o.jsxs("p",{className:"flex gap-3 items-center h-full",children:[x,o.jsxs("span",{className:"text-sm text-muted-foreground",children:["#",n]})]}),t[4]=n,t[5]=p):p=t[5];let h;t[6]!==f?(h=f&&o.jsxs(le,{variant:"success",className:"gap-1 ml-3",children:[o.jsx(Is,{size:11}),"Success"]}),t[6]=f,t[7]=h):h=t[7];let g;t[8]!==u?(g=u&&o.jsxs(le,{variant:"warning",className:"gap-1 ml-3",children:[o.jsx(ko,{size:11}),"Partial success"]}),t[8]=u,t[9]=g):g=t[9];let b;t[10]!==a?(b=a&&o.jsxs(le,{variant:"destructive",className:"gap-1 ml-3",children:[o.jsx(No,{size:11}),"Failed"]}),t[10]=a,t[11]=b):b=t[11];let S;t[12]===Symbol.for("react.memo_cache_sentinel")?(S=o.jsx(vo,{className:"w-4 h-4 text-muted-foreground"}),t[12]=S):S=t[12];let v;t[13]!==l?(v=o.jsxs("div",{className:"flex items-center gap-1 ml-6",children:[S,o.jsx("span",{className:"text-sm text-muted-foreground",children:l})]}),t[13]=l,t[14]=v):v=t[14];let y;t[15]!==p||t[16]!==h||t[17]!==g||t[18]!==b||t[19]!==v?(y=o.jsxs("div",{className:"flex items-center h-full",children:[m,p,h,g,b,v]}),t[15]=p,t[16]=h,t[17]=g,t[18]=b,t[19]=v,t[20]=y):y=t[20];let j;t[21]!==e?(j=()=>e(void 0),t[21]=e,t[22]=j):j=t[22];let w;t[23]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx($t,{className:"w-4 h-4 text-muted-foreground"}),t[23]=w):w=t[23];let N;t[24]!==j?(N=o.jsx(te,{variant:"ghost",size:"xs",onClick:j,children:w}),t[24]=j,t[25]=N):N=t[25];let k;return t[26]!==N||t[27]!==y?(k=o.jsx("div",{className:"flex flex-col border-b border-border",children:o.jsxs("div",{className:"h-10 bg-accent flex items-center justify-between",children:[y,N]})}),t[26]=N,t[27]=y,t[28]=k):k=t[28],k}function tc(t){const e=_.c(14),{itemId:n}=t;let s;e[0]!==n?(s={itemId:n},e[0]=n,e[1]=s):s=e[1];const{item:i,update:r,isUpdating:l}=ls(s);let c;e[2]!==i?(c=JSON.stringify(i),e[2]=i,e[3]=c):c=e[3];const a=c;if(!i){let m;return e[4]===Symbol.for("react.memo_cache_sentinel")?(m=o.jsx(Qe,{children:o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(In,{icon:o.jsx(Rn,{className:"w-10 h-10 text-muted-foreground"}),title:"Workflow not found",description:"This workflow may have been deleted or you may not have access to it."})})}),e[4]=m):m=e[4],m}let d;e[5]!==i?(d={workflow:i,trackingExecutionId:void 0,currentStepTab:"input"},e[5]=i,e[6]=d):d=e[6];let u;e[7]!==l||e[8]!==r?(u=o.jsx(wl,{onUpdate:r,isUpdating:l}),e[7]=l,e[8]=r,e[9]=u):u=e[9];let f;return e[10]!==a||e[11]!==d||e[12]!==u?(f=o.jsx(Ao,{initialState:d,children:u},a),e[10]=a,e[11]=d,e[12]=u,e[13]=f):f=e[13],f}function wl(t){const e=_.c(22),{onUpdate:n,isUpdating:s}=t;ul();const i=de(),r=Y(),{viewMode:l,showExecutionsList:c}=At(),a=Ve(),d=qn();let u;e[0]!==n||e[1]!==i?(u=async()=>{await n(i)},e[0]=n,e[1]=i,e[2]=u):u=e[2];const f=u,m=a&&"toolName"in a.action,x=m?a.action.toolName:null,p=m&&!x&&!r,h=d&&!r,g=!p&&!h&&(a||r||!c);let b;e[3]!==f||e[4]!==s||e[5]!==i.description||e[6]!==i.title?(b=o.jsx(ri,{title:i.title,description:i.description,onSave:f,isSaving:s}),e[3]=f,e[4]=s,e[5]=i.description,e[6]=i.title,e[7]=b):b=e[7];let S;e[8]!==r?(S=r&&o.jsx(vl,{}),e[8]=r,e[9]=S):S=e[9];let v;e[10]!==n||e[11]!==c||e[12]!==h||e[13]!==g||e[14]!==p||e[15]!==l||e[16]!==i?(v=o.jsx("div",{className:"flex-1 overflow-hidden",children:l==="code"?o.jsx(bl,{workflow:i,onUpdate:n}):o.jsxs(zs,{direction:"horizontal",className:"flex w-full h-full",children:[o.jsx(qt,{defaultSize:50,minSize:30,children:o.jsx(Ni,{})}),o.jsx(Ws,{}),o.jsxs(qt,{defaultSize:50,minSize:25,children:[p&&o.jsx($i,{className:"border-l border-border"}),h&&o.jsx(pl,{className:"border-l border-border"}),c&&o.jsx(sl,{}),g&&o.jsx(Ai,{className:"border-l border-border"})]})]})}),e[10]=n,e[11]=c,e[12]=h,e[13]=g,e[14]=p,e[15]=l,e[16]=i,e[17]=v):v=e[17];let y;return e[18]!==b||e[19]!==S||e[20]!==v?(y=o.jsx(Qe,{children:o.jsxs("div",{className:"flex flex-col h-full overflow-hidden bg-background",children:[b,S,v]})}),e[18]=b,e[19]=S,e[20]=v,e[21]=y):y=e[21],y}function Nl(t){const e=_.c(5),{itemId:n,connectionId:s}=t,i=s??"self",r=i??"no-connection",{org:l}=oe(),c=i??null;let a;e[0]!==l.id||e[1]!==c?(a={connectionId:c,orgId:l.id},e[0]=l.id,e[1]=c,e[2]=a):a=e[2];const d=ae(a),u=Cn(r,"WORKFLOW_EXECUTION",n,d);let f;return e[3]!==u?(f={item:u},e[3]=u,e[4]=f):f=e[4],f}function nc(t){const e=_.c(7),{itemId:n}=t;let s;e[0]!==n?(s={itemId:n},e[0]=n,e[1]=s):s=e[1];const{item:i}=Nl(s);if(!i){let c;return e[2]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx(Qe,{children:o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(In,{icon:o.jsx(Rn,{className:"w-10 h-10 text-muted-foreground"}),title:"Workflow execution not found",description:"This workflow execution may have been deleted or you may not have access to it."})})}),e[2]=c):c=e[2],c}let r;e[3]!==i?(r=JSON.stringify(i,null,2),e[3]=i,e[4]=r):r=e[4];let l;return e[5]!==r?(l=o.jsx(Qe,{children:o.jsx("div",{className:"flex flex-col h-full overflow-hidden bg-background",children:o.jsx(Re,{height:"100%",code:r,language:"json",readOnly:!0})})}),e[5]=r,e[6]=l):l=e[6],l}export{_o as S,nc as W,tc as a};
|
|
26
|
+
}`;s(n.name,{action:{...n.action,transformCode:C}}),l(Gi)},e[2]=m,e[3]=n.action,e[4]=n.name,e[5]=s,e[6]=x):x=e[6];const p=x;let h;e[7]!==n.action||e[8]!==n.name||e[9]!==s?(h=(k,C)=>{s(n.name,{action:{...n.action,transformCode:k},...C?{outputSchema:C}:{}})},e[7]=n.action,e[8]=n.name,e[9]=s,e[10]=h):h=e[10];const g=h;if("code"in n.action&&n.action.code)return null;const b=r?"flex-1 min-h-0 overflow-hidden":"shrink-0";let S;e[11]!==b?(S=O("flex flex-col flex-1 min-h-0 overflow-hidden border-b border-border",b),e[11]=b,e[12]=S):S=e[12];let v;e[13]===Symbol.for("react.memo_cache_sentinel")?(v=o.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:"Transform Code"}),e[13]=v):v=e[13];let y;e[14]!==r?(y=o.jsxs("div",{className:"flex items-center justify-between",children:[v,r?o.jsx(rt,{size:14,className:"text-muted-foreground"}):o.jsx(ot,{size:14,className:"text-muted-foreground"})]}),e[14]=r,e[15]=y):y=e[15];let j;e[16]!==y||e[17]!==p?(j=o.jsx("div",{className:"p-5 shrink-0 cursor-pointer hover:bg-accent/50 transition-colors",onClick:p,children:y}),e[16]=y,e[17]=p,e[18]=j):j=e[18];let w;e[19]!==g||e[20]!==r||e[21]!==n.name||e[22]!==i||e[23]!==u?(w=r&&o.jsx("div",{className:"flex-1 min-h-0",children:o.jsx(Re,{code:u,language:"typescript",readOnly:i!==void 0,onSave:g,height:"100%"},`transform-code-${n.name}-${i}`)}),e[19]=g,e[20]=r,e[21]=n.name,e[22]=i,e[23]=u,e[24]=w):w=e[24];let N;return e[25]!==S||e[26]!==j||e[27]!==w?(N=o.jsxs("div",{className:S,children:[j,w]}),e[25]=S,e[26]=j,e[27]=w,e[28]=N):N=e[28],N}function Gi(t){return!t}function Qi(t){return!t}function Yi(t){const e=_.c(25),{step:n}=t,[s,i]=T.useState(!1),{updateStep:r}=se(),l=de(),c="code"in n.action&&n.action.code?n.action.code:null,a=Y();if(!c)return null;let d;e[0]!==n.action||e[1]!==n.name||e[2]!==r?(d=(m,x)=>{r(n.name,{action:{...n.action,code:m},...x?{outputSchema:x}:{}})},e[0]=n.action,e[1]=n.name,e[2]=r,e[3]=d):d=e[3];const u=d;let f;if(e[4]!==c||e[5]!==u||e[6]!==s||e[7]!==n.action||e[8]!==n.input||e[9]!==n.name||e[10]!==a||e[11]!==r||e[12]!==l.input_schema||e[13]!==l.steps){const m=[],x=l.input_schema;x&&m.push({name:"input",label:"Workflow Input",schema:x});for(const N of l.steps){if(N.name===n.name)break;m.push({name:N.name,label:N.name,schema:N.outputSchema})}const p=n.input??{},h=new Set(Object.entries(p).filter(el).map(Zi)),g=N=>{const k={...p};if(h.has(N)){const L=Object.entries(k).find(R=>{const[,D]=R;return D===`@${N}`})?.[0];L&&delete k[L]}else k[N]=`@${N}`;const C={};for(const[L,R]of Object.entries(k)){if(typeof R!="string"||!R.startsWith("@"))continue;const D=R.slice(1),F=m.find(P=>P.name===D);F?.schema&&(C[L]=F.schema)}const E=Object.keys(C).length>0?{type:"object",properties:C,required:Object.keys(C)}:null,W=E?Dn(E,"Input"):"interface Input {}",z=n.action,I=Fn(z.code,W);r(n.name,{input:k,action:{...n.action,code:I}})},b=s?"flex-1 min-h-0 overflow-hidden":"shrink-0";let S;e[15]!==b?(S=O("flex flex-col border-b border-border",b),e[15]=b,e[16]=S):S=e[16];let v;e[17]!==s?(v=()=>i(!s),e[17]=s,e[18]=v):v=e[18];let y;e[19]===Symbol.for("react.memo_cache_sentinel")?(y=o.jsx("h3",{className:"text-sm font-medium text-muted-foreground",children:"Step Code"}),e[19]=y):y=e[19];let j;e[20]!==s?(j=o.jsxs("div",{className:"flex items-center justify-between",children:[y,s?o.jsx(rt,{size:14,className:"text-muted-foreground"}):o.jsx(ot,{size:14,className:"text-muted-foreground"})]}),e[20]=s,e[21]=j):j=e[21];let w;e[22]!==v||e[23]!==j?(w=o.jsx("div",{className:"p-5 shrink-0 cursor-pointer hover:bg-accent/50 transition-colors",onClick:v,children:j}),e[22]=v,e[23]=j,e[24]=w):w=e[24],f=o.jsxs("div",{className:S,children:[w,s&&o.jsxs(o.Fragment,{children:[!a&&m.length>0&&o.jsxs("div",{className:"px-5 pb-3 shrink-0 border-b border-border/50",children:[o.jsxs("p",{className:"text-xs text-muted-foreground mb-2",children:["Select variables available to your code as"," ",o.jsx("code",{className:"text-[11px] bg-accent px-1 py-0.5 rounded",children:"input"}),":"]}),o.jsx("div",{className:"flex flex-wrap gap-1.5",children:m.map(N=>{const k=h.has(N.name);return o.jsxs("button",{type:"button",className:O("h-7 px-2.5 text-xs font-medium rounded-lg border transition-colors inline-flex items-center gap-1.5",k?"bg-accent border-border text-foreground":"bg-transparent border-transparent text-muted-foreground hover:bg-accent/50 hover:text-foreground"),onClick:()=>g(N.name),children:[k&&o.jsx(He,{size:12,className:"text-success"}),o.jsxs("span",{className:"font-mono",children:["@",N.name]})]},N.name)})})]}),o.jsx("div",{className:"flex-1 min-h-0",children:o.jsx(Re,{onSave:(N,k)=>u(N,k),code:c,language:"typescript",height:"100%",readOnly:a!==void 0},`step-code-${n.name}-${a}`)})]})]}),e[4]=c,e[5]=u,e[6]=s,e[7]=n.action,e[8]=n.input,e[9]=n.name,e[10]=a,e[11]=r,e[12]=l.input_schema,e[13]=l.steps,e[14]=f}else f=e[14];return f}function Zi(t){const[,e]=t;return e.slice(1)}function el(t){const[,e]=t;return typeof e=="string"&&e.startsWith("@")}function Ge(t){if(Array.isArray(t.type))return t.type.map(n=>Ge({...t,type:n})).join(" | ");switch(t.type){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"array":return t.items?`${Ge(t.items)}[]`:"unknown[]";case"object":return t.properties?`{ ${Object.entries(t.properties).map(([s,i])=>{const r=Ge(i),l=!t.required?.includes(s);return`${s}${l?"?":""}: ${r}`}).join("; ")} }`:"Record<string, unknown>";case"null":return"null";default:return"unknown"}}function tl(t){const{status:e}=t,n=(t.completed_steps?.error?.length??0)>0;if(e==="success"&&n)return o.jsxs(le,{variant:"warning",className:"gap-1",children:[o.jsx(_s,{size:11}),"Partial"]});switch(e){case"success":return o.jsxs(le,{variant:"success",className:"gap-1",children:[o.jsx(He,{size:11}),"Success"]});case"error":case"failed":return o.jsxs(le,{variant:"destructive",className:"gap-1",children:[o.jsx(pn,{size:11}),"Error"]});case"running":return o.jsxs(le,{variant:"secondary",className:"gap-1",children:[o.jsx(bt,{size:11}),"Running"]});case"enqueued":return o.jsxs(le,{variant:"secondary",className:"gap-1",children:[o.jsx(bt,{size:11}),"On hold"]});case"cancelled":return o.jsxs(le,{variant:"secondary",className:"gap-1",children:[o.jsx(_n,{size:11}),"Cancelled"]});default:return o.jsxs(le,{variant:"secondary",className:"gap-1",children:[o.jsx(bt,{size:11}),e]})}}function nl(t){return`Run #${t.slice(-4).toUpperCase()}`}function sl(t){const e=_.c(21),{className:n}=t,{executions:s,isLoading:i}=Jo(),{setShowExecutionsList:r}=At(),{setTrackingExecutionId:l}=se(),c=Y();let a;e[0]!==l?(a=v=>{l(v)},e[0]=l,e[1]=a):a=e[1];const d=a;let u;e[2]!==r?(u=()=>{r(!1)},e[2]=r,e[3]=u):u=e[3];const f=u;let m;e[4]!==n?(m=O("flex flex-col h-full bg-sidebar border-l border-border",n),e[4]=n,e[5]=m):m=e[5];let x;e[6]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx("p",{className:"flex-1 text-base font-medium text-foreground",children:"Runs"}),e[6]=x):x=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx(_n,{size:11}),e[7]=p):p=e[7];let h;e[8]!==f?(h=o.jsxs("div",{className:"flex items-center h-12 px-5 border-b border-border shrink-0",children:[x,o.jsx(te,{variant:"ghost",size:"icon",className:"size-7",onClick:f,children:p})]}),e[8]=f,e[9]=h):h=e[9];let g;e[10]!==s||e[11]!==d||e[12]!==i||e[13]!==c?(g=i?o.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"Loading executions..."}):s.map((v,y)=>o.jsx(ol,{execution:v,isSelected:v.id===c,isFirst:y===0,onSelect:()=>d(v.id)},v.id)),e[10]=s,e[11]=d,e[12]=i,e[13]=c,e[14]=g):g=e[14];let b;e[15]!==g?(b=o.jsx("div",{className:"flex-1 overflow-auto",children:g}),e[15]=g,e[16]=b):b=e[16];let S;return e[17]!==m||e[18]!==h||e[19]!==b?(S=o.jsxs("div",{className:m,children:[h,b]}),e[17]=m,e[18]=h,e[19]=b,e[20]=S):S=e[20],S}function ol(t){const e=_.c(17),{execution:n,isSelected:s,isFirst:i,onSelect:r}=t,l=s&&"bg-accent/50",c=i&&s&&"bg-accent/50",a=!s&&"hover:bg-accent/30";let d;e[0]!==l||e[1]!==c||e[2]!==a?(d=O("flex flex-col justify-center h-[60px] px-4 border-b border-border cursor-pointer transition-colors",l,c,a),e[0]=l,e[1]=c,e[2]=a,e[3]=d):d=e[3];let u;e[4]!==n?(u=tl(n),e[4]=n,e[5]=u):u=e[5];let f;e[6]!==n.id?(f=nl(n.id),e[6]=n.id,e[7]=f):f=e[7];let m;e[8]!==f?(m=o.jsx("p",{className:"flex-1 text-base font-medium text-foreground",children:f}),e[8]=f,e[9]=m):m=e[9];let x;e[10]!==u||e[11]!==m?(x=o.jsxs("div",{className:"flex items-center gap-2 w-full",children:[u,m]}),e[10]=u,e[11]=m,e[12]=x):x=e[12];let p;return e[13]!==r||e[14]!==d||e[15]!==x?(p=o.jsx("div",{className:d,onClick:r,children:x}),e[13]=r,e[14]=d,e[15]=x,e[16]=p):p=e[16],p}const rl=["workflow.execution.created","workflow.execution.resumed","workflow.step.execute","workflow.step.completed"],il=yo({buildUrl:t=>`/org/${t}/watch?types=workflow.*`,eventTypes:rl}),ll=["COLLECTION_WORKFLOW_EXECUTION_LIST","COLLECTION_WORKFLOW_EXECUTION_GET","COLLECTION_WORKFLOW_EXECUTION_GET_STEP_RESULT"],cl=500,De=new Map,We=new Map;function al(t){const e=We.get(t);if(e)for(const n of e)n.invalidateQueries({predicate:s=>s.queryKey.some(i=>typeof i=="string"&&ll.includes(i))})}function dl(t){De.has(t)||De.set(t,setTimeout(()=>{De.delete(t),al(t)},cl))}const sn=()=>0;function ul(){const t=_.c(3),{org:e}=oe(),n=cn(),s=e.id;let i;t[0]!==s||t[1]!==n?(i=l=>{let c=We.get(s);c||(c=new Set,We.set(s,c)),c.add(n);const a=()=>{dl(s),l()},d=il.subscribe(s,a);return()=>{d(),c.delete(n),c.size===0&&We.delete(s);const u=De.get(s);u&&!We.has(s)&&(clearTimeout(u),De.delete(s))}},t[0]=s,t[1]=n,t[2]=i):i=t[2];const r=i;T.useSyncExternalStore(r,sn,sn)}const on=[{value:"string",label:"String"},{value:"number",label:"Number"},{value:"integer",label:"Integer"},{value:"boolean",label:"Boolean"},{value:"object",label:"Object"},{value:"array",label:"Array"}],fl={type:"object",properties:{field:{type:"string",description:"An input field"}},required:["field"]},ml=2;function pl(t){const e=_.c(66),{className:n}=t,s=de(),{setWorkflow:i}=se(),[r,l]=T.useState("visual"),[c,a]=T.useState(!1);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d={},e[0]=d):d=e[0];const[u,f]=T.useState(d),m=s.input_schema??null;let x;e[1]!==i||e[2]!==s?(x=M=>{i({...s,input_schema:M})},e[1]=i,e[2]=s,e[3]=x):x=e[3];const p=x;let h;e[4]!==p?(h=M=>{try{const J=JSON.parse(M);p(J)}catch{}},e[4]=p,e[5]=h):h=e[5];const g=h;let b;e[6]!==p?(b=()=>{p(fl)},e[6]=p,e[7]=b):b=e[7];const S=b;let v;e[8]!==p?(v=()=>{p(void 0)},e[8]=p,e[9]=v):v=e[9];const y=v;if(!m){let M;e[10]!==n?(M=O("flex flex-col h-full bg-sidebar",n),e[10]=n,e[11]=M):M=e[11];let J;e[12]===Symbol.for("react.memo_cache_sentinel")?(J=o.jsx(rn,{}),e[12]=J):J=e[12];let Q;e[13]===Symbol.for("react.memo_cache_sentinel")?(Q=o.jsx("p",{className:"text-sm text-muted-foreground",children:"No input schema defined. Add one to require structured input when running this workflow."}),e[13]=Q):Q=e[13];let $;e[14]===Symbol.for("react.memo_cache_sentinel")?($=o.jsx(Ln,{size:14}),e[14]=$):$=e[14];let A;e[15]!==S?(A=o.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 p-8 text-center",children:[Q,o.jsxs(te,{variant:"outline",size:"sm",className:"gap-2",onClick:S,children:[$,"Add input schema"]})]}),e[15]=S,e[16]=A):A=e[16];let ee;return e[17]!==A||e[18]!==M?(ee=o.jsxs("div",{className:M,children:[J,A]}),e[17]=A,e[18]=M,e[19]=ee):ee=e[19],ee}let j;e[20]!==n?(j=O("flex flex-col h-full bg-sidebar",n),e[20]=n,e[21]=j):j=e[21];const w=r==="visual"?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground";let N;e[22]!==w?(N=O("h-6 px-2 rounded text-xs font-medium transition-colors",w),e[22]=w,e[23]=N):N=e[23];let k,C;e[24]===Symbol.for("react.memo_cache_sentinel")?(C=()=>l("visual"),k=o.jsx(lo,{size:12}),e[24]=k,e[25]=C):(k=e[24],C=e[25]);let E;e[26]!==N?(E=o.jsx("button",{type:"button",className:N,onClick:C,children:k}),e[26]=N,e[27]=E):E=e[27];const W=r==="code"?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground";let z;e[28]!==W?(z=O("h-6 px-2 rounded text-xs font-medium transition-colors",W),e[28]=W,e[29]=z):z=e[29];let I,L;e[30]===Symbol.for("react.memo_cache_sentinel")?(I=()=>l("code"),L=o.jsx(mn,{size:12}),e[30]=I,e[31]=L):(I=e[30],L=e[31]);let R;e[32]!==z?(R=o.jsx("button",{type:"button",className:z,onClick:I,children:L}),e[32]=z,e[33]=R):R=e[33];let D;e[34]!==E||e[35]!==R?(D=o.jsx(rn,{children:o.jsxs("div",{className:"flex items-center gap-1 border border-border rounded-lg p-0.5",children:[E,R]})}),e[34]=E,e[35]=R,e[36]=D):D=e[36];let F;e[37]!==g||e[38]!==m||e[39]!==p||e[40]!==r||e[41]!==s.id?(F=r==="visual"?o.jsx(o.Fragment,{children:o.jsx("div",{className:"flex-1 overflow-auto",children:o.jsx(Et,{schema:m,onChange:M=>p(M),depth:0})})}):o.jsx("div",{className:"flex-1 min-h-0",children:o.jsx(Re,{code:JSON.stringify(m,null,2),language:"json",height:"100%",onSave:g},`input-schema-${s.id}`)}),e[37]=g,e[38]=m,e[39]=p,e[40]=r,e[41]=s.id,e[42]=F):F=e[42];let P;e[43]!==c?(P=()=>a(!c),e[43]=c,e[44]=P):P=e[44];let H;e[45]===Symbol.for("react.memo_cache_sentinel")?(H=o.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Preview"}),e[45]=H):H=e[45];let U;e[46]!==c?(U=c?o.jsx(rt,{size:14,className:"text-muted-foreground"}):o.jsx(ot,{size:14,className:"text-muted-foreground"}),e[46]=c,e[47]=U):U=e[47];let G;e[48]!==P||e[49]!==U?(G=o.jsxs("button",{type:"button",className:"w-full px-5 py-3 flex items-center justify-between hover:bg-accent/50 transition-colors",onClick:P,children:[H,U]}),e[48]=P,e[49]=U,e[50]=G):G=e[50];let X;e[51]!==m||e[52]!==u||e[53]!==c?(X=c&&o.jsx("div",{className:"px-5 pb-4 max-h-64 overflow-auto",children:o.jsx(Dt,{inputSchema:m,inputParams:u,setInputParams:f,mentions:[]})}),e[51]=m,e[52]=u,e[53]=c,e[54]=X):X=e[54];let V;e[55]!==G||e[56]!==X?(V=o.jsxs("div",{className:"shrink-0 border-t border-border",children:[G,X]}),e[55]=G,e[56]=X,e[57]=V):V=e[57];let q;e[58]!==y?(q=o.jsx("div",{className:"px-5 py-3 shrink-0 border-t border-border",children:o.jsx("button",{type:"button",className:"text-xs text-muted-foreground hover:text-destructive transition-colors",onClick:y,children:"Remove input schema"})}),e[58]=y,e[59]=q):q=e[59];let K;return e[60]!==D||e[61]!==F||e[62]!==V||e[63]!==q||e[64]!==j?(K=o.jsxs("div",{className:j,children:[D,F,V,q]}),e[60]=D,e[61]=F,e[62]=V,e[63]=q,e[64]=j,e[65]=K):K=e[65],K}function rn(t){const e=_.c(4),{children:n}=t;let s,i;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx(xn,{className:"w-4 h-4 text-muted-foreground shrink-0"}),i=o.jsx("span",{className:"text-base font-medium text-foreground flex-1",children:"Workflow Input"}),e[0]=s,e[1]=i):(s=e[0],i=e[1]);let r;return e[2]!==n?(r=o.jsxs("div",{className:"border-b border-border p-5 shrink-0 flex items-center gap-2",children:[s,i,n]}),e[2]=n,e[3]=r):r=e[3],r}function Et({schema:t,onChange:e,depth:n}){const s=t.properties??{},i=t.required??[],r=()=>{const f=Object.keys(s);let m="field",x=1;for(;f.includes(m);)m=`field_${x}`,x++;e({...t,properties:{...s,[m]:{type:"string"}},required:[...i,m]})},l=f=>{const{[f]:m,...x}=s;e({...t,properties:x,required:i.filter(p=>p!==f)})},c=(f,m)=>{e({...t,properties:{...s,[f]:m}})},a=(f,m)=>{if(!m.trim()||m===f||s[m])return;const x={};for(const[p,h]of Object.entries(s))x[p===f?m:p]=h;e({...t,properties:x,required:i.map(p=>p===f?m:p)})},d=f=>{const m=i.includes(f);e({...t,required:m?i.filter(x=>x!==f):[...i,f]})},u=Object.entries(s);return o.jsxs("div",{children:[u.length===0&&n===0&&o.jsx("div",{className:"p-5 text-sm text-muted-foreground text-center",children:"No fields defined yet."}),o.jsx("div",{className:"divide-y divide-border",children:u.map(([f,m])=>o.jsx(xl,{name:f,schema:m,isRequired:i.includes(f),depth:n,onRename:x=>a(f,x),onUpdate:x=>c(f,x),onToggleRequired:()=>d(f),onRemove:()=>l(f)},f))}),o.jsx("div",{className:O("p-3",n>0&&"pb-1"),children:o.jsxs(te,{variant:"outline",size:"sm",className:"w-full gap-2",onClick:r,children:[o.jsx(Ln,{size:14}),"Add field"]})})]})}function xl(t){const e=_.c(72),{name:n,schema:s,isRequired:i,depth:r,onRename:l,onUpdate:c,onToggleRequired:a,onRemove:d}=t,[u,f]=T.useState(!1),[m,x]=T.useState(n),p=s.type??"string",h=p==="array",g=p==="object",b=r<ml;let S;e[0]!==m||e[1]!==n||e[2]!==l?(S=()=>{f(!1),m.trim()&&m!==n?l(m.trim()):x(n)},e[0]=m,e[1]=n,e[2]=l,e[3]=S):S=e[3];const v=S;let y;e[4]!==b||e[5]!==c||e[6]!==s.description||e[7]!==s.items||e[8]!==s.properties||e[9]!==s.required?(y=$=>{const A={type:$};s.description&&(A.description=s.description),$==="array"&&(A.items=s.items??{type:"string"}),$==="object"&&b&&(A.properties=s.properties??{},A.required=s.required??[]),c(A)},e[4]=b,e[5]=c,e[6]=s.description,e[7]=s.items,e[8]=s.properties,e[9]=s.required,e[10]=y):y=e[10];const j=y;let w;e[11]!==c||e[12]!==s?(w=$=>{const A={...s};$?A.description=$:delete A.description,c(A)},e[11]=c,e[12]=s,e[13]=w):w=e[13];const N=w;let k;e[14]!==b||e[15]!==c||e[16]!==s?(k=$=>{const A={type:$};$==="object"&&b&&(A.properties=s.items?.properties??{},A.required=s.items?.required??[]),c({...s,items:A})},e[14]=b,e[15]=c,e[16]=s,e[17]=k):k=e[17];const C=k,E=r>0&&"py-3";let W;e[18]!==E?(W=O("flex flex-col gap-2 p-4",E),e[18]=E,e[19]=W):W=e[19];let z;e[20]!==v||e[21]!==m||e[22]!==u||e[23]!==n?(z=u?o.jsx(Kt,{value:m,onChange:$=>x($.target.value),onBlur:v,onKeyDown:$=>{$.key==="Enter"&&v(),$.key==="Escape"&&(x(n),f(!1))},className:"h-7 text-sm font-medium flex-1 min-w-0",autoFocus:!0}):o.jsx("button",{type:"button",className:"text-sm font-medium text-foreground flex-1 text-left truncate hover:underline cursor-text min-w-0",onClick:()=>{x(n),f(!0)},children:n}),e[20]=v,e[21]=m,e[22]=u,e[23]=n,e[24]=z):z=e[24];let I;e[25]===Symbol.for("react.memo_cache_sentinel")?(I=o.jsx(kt,{className:"h-7 w-24 text-xs shrink-0",children:o.jsx(Nt,{})}),e[25]=I):I=e[25];let L;e[26]===Symbol.for("react.memo_cache_sentinel")?(L=o.jsx(vt,{children:on.map(gl)}),e[26]=L):L=e[26];let R;e[27]!==p||e[28]!==j?(R=o.jsxs(wt,{value:p,onValueChange:j,children:[I,L]}),e[27]=p,e[28]=j,e[29]=R):R=e[29];let D;e[30]===Symbol.for("react.memo_cache_sentinel")?(D=o.jsx(un,{size:14}),e[30]=D):D=e[30];let F;e[31]!==d?(F=o.jsx(te,{variant:"ghost",size:"icon",className:"size-7 shrink-0 text-muted-foreground hover:text-destructive",onClick:d,children:D}),e[31]=d,e[32]=F):F=e[32];let P;e[33]!==R||e[34]!==F||e[35]!==z?(P=o.jsxs("div",{className:"flex items-center gap-2",children:[z,R,F]}),e[33]=R,e[34]=F,e[35]=z,e[36]=P):P=e[36];const H=s.description??"";let U;e[37]!==N?(U=$=>N($.target.value),e[37]=N,e[38]=U):U=e[38];let G;e[39]!==H||e[40]!==U?(G=o.jsx(Kt,{value:H,onChange:U,placeholder:"Description (optional)",className:"h-7 text-xs text-muted-foreground"}),e[39]=H,e[40]=U,e[41]=G):G=e[41];let X;e[42]!==i||e[43]!==a?(X=o.jsx("input",{type:"checkbox",checked:i,onChange:a,className:"rounded border-border"}),e[42]=i,e[43]=a,e[44]=X):X=e[44];let V;e[45]===Symbol.for("react.memo_cache_sentinel")?(V=o.jsx("span",{className:"text-xs text-muted-foreground",children:"Required"}),e[45]=V):V=e[45];let q;e[46]!==X?(q=o.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[X,V]}),e[46]=X,e[47]=q):q=e[47];let K;e[48]!==C||e[49]!==h||e[50]!==s.items?(K=h&&o.jsxs("div",{className:"flex items-center gap-2 pl-2 border-l-2 border-border ml-1",children:[o.jsx("span",{className:"text-xs text-muted-foreground",children:"Items:"}),o.jsxs(wt,{value:s.items?.type??"string",onValueChange:C,children:[o.jsx(kt,{className:"h-7 w-24 text-xs",children:o.jsx(Nt,{})}),o.jsx(vt,{children:on.map(hl)})]})]}),e[48]=C,e[49]=h,e[50]=s.items,e[51]=K):K=e[51];let M;e[52]!==b||e[53]!==r||e[54]!==h||e[55]!==c||e[56]!==s?(M=h&&b&&s.items?.type==="object"&&o.jsxs("div",{className:"pl-2 border-l-2 border-border ml-1",children:[o.jsx("span",{className:"text-xs text-muted-foreground mb-1 block",children:"Item properties:"}),o.jsx(Et,{schema:s.items,onChange:$=>c({...s,items:$}),depth:r+1})]}),e[52]=b,e[53]=r,e[54]=h,e[55]=c,e[56]=s,e[57]=M):M=e[57];let J;e[58]!==b||e[59]!==r||e[60]!==g||e[61]!==c||e[62]!==s?(J=g&&b&&o.jsxs("div",{className:"pl-2 border-l-2 border-border ml-1",children:[o.jsx("span",{className:"text-xs text-muted-foreground mb-1 block",children:"Properties:"}),o.jsx(Et,{schema:s,onChange:$=>c($),depth:r+1})]}),e[58]=b,e[59]=r,e[60]=g,e[61]=c,e[62]=s,e[63]=J):J=e[63];let Q;return e[64]!==P||e[65]!==G||e[66]!==q||e[67]!==K||e[68]!==M||e[69]!==J||e[70]!==W?(Q=o.jsxs("div",{className:W,children:[P,G,q,K,M,J]}),e[64]=P,e[65]=G,e[66]=q,e[67]=K,e[68]=M,e[69]=J,e[70]=W,e[71]=Q):Q=e[71],Q}function hl(t){return o.jsx(nt,{value:t.value,children:t.label},t.value)}function gl(t){return o.jsx(nt,{value:t.value,children:t.label},t.value)}function ls(t){const e=_.c(10),{itemId:n,connectionId:s}=t,[i,r]=T.useState(!1),l=s??"self",c=l??"no-connection",{org:a}=oe(),d=l??null;let u;e[0]!==a.id||e[1]!==d?(u={connectionId:d,orgId:a.id},e[0]=a.id,e[1]=d,e[2]=u):u=e[2];const f=ae(u),m=Cn(c,"WORKFLOW",n,f),x=So(c,"WORKFLOW",f);let p;e[3]!==x||e[4]!==n?(p=async b=>{r(!0),await x.update.mutateAsync({id:n,data:b}).finally(()=>{r(!1)})},e[3]=x,e[4]=n,e[5]=p):p=e[5];const h=p;let g;return e[6]!==i||e[7]!==m||e[8]!==h?(g={item:m,update:h,isUpdating:i},e[6]=i,e[7]=m,e[8]=h,e[9]=g):g=e[9],g}function bl(t){const e=_.c(19),{workflow:n,onUpdate:s}=t,{setWorkflow:i}=se();let r,l,c,a;if(e[0]!==n.description||e[1]!==n.id||e[2]!==n.input_schema||e[3]!==n.steps||e[4]!==n.title){const f={title:n.title,description:n.description,input_schema:n.input_schema,steps:n.steps};r=Re,l=`workflow-${n.id}`,c="100%",a=JSON.stringify(f,null,2),e[0]=n.description,e[1]=n.id,e[2]=n.input_schema,e[3]=n.steps,e[4]=n.title,e[5]=r,e[6]=l,e[7]=c,e[8]=a}else r=e[5],l=e[6],c=e[7],a=e[8];let d;e[9]!==s||e[10]!==i||e[11]!==n?(d=f=>{const m=JSON.parse(f);i({...n,...m}),s(m)},e[9]=s,e[10]=i,e[11]=n,e[12]=d):d=e[12];let u;return e[13]!==r||e[14]!==l||e[15]!==c||e[16]!==a||e[17]!==d?(u=o.jsx(r,{height:c,code:a,language:"json",onSave:d},l),e[13]=r,e[14]=l,e[15]=c,e[16]=a,e[17]=d,e[18]=u):u=e[18],u}function jl(){const t=_.c(9),e=Y(),{item:n}=ue(e),s=n?.start_at_epoch_ms,i=n?.completed_at_epoch_ms,r=n?.status==="running"&&s&&!i;let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=Date.now(),t[0]=l):l=t[0];const c=T.useRef(l);let a;t[1]!==r?(a=h=>{if(!r)return Sl;const g=setInterval(()=>{c.current=Date.now(),h()},50);return()=>clearInterval(g)},t[1]=r,t[2]=a):a=t[2];const d=a;let u;t[3]!==r?(u=()=>r?c.current:0,t[3]=r,t[4]=u):u=t[4];const f=u,m=T.useSyncExternalStore(d,f,f),x=i&&s?Math.max(0,i-s):null;let p=null;if(s){let h;t[5]!==s?(h=new Date(s).getTime(),t[5]=s,t[6]=h):h=t[6];const g=h;if(i){let b;t[7]!==i?(b=new Date(i).getTime(),t[7]=i,t[8]=b):b=t[8],p=Math.max(0,b-g)}else r&&(p=Math.max(0,m-g))}return p??x}function Sl(){}function yl(t){if(t<1e3)return`${t}ms`;const e=t/1e3,n=e%60,s=Math.floor(e/60),i=s%60,r=Math.floor(s/60);return r>0?`${r}h ${i}m ${n.toFixed(3)}s`:i>0?`${i}m ${n.toFixed(3)}s`:`${n.toFixed(3)}s`}function vl(){const t=_.c(29),{setTrackingExecutionId:e}=se(),n=Y(),{item:s}=ue(n),i=jl();let r;t[0]!==i?(r=i!=null?yl(i):null,t[0]=i,t[1]=r):r=t[1];const l=r,c=s?.status,a=c==="error"||c==="failed",d=(s?.completed_steps?.error?.length??0)>0,u=c==="success"&&d,f=c==="success"&&!d;let m;t[2]===Symbol.for("react.memo_cache_sentinel")?(m=o.jsx("div",{className:"flex items-center justify-center h-full w-12",children:o.jsx(Cs,{className:"w-4 h-4 text-muted-foreground"})}),t[2]=m):m=t[2];let x;t[3]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx("strong",{className:"text-base text-foreground",children:"Run"}),t[3]=x):x=t[3];let p;t[4]!==n?(p=o.jsxs("p",{className:"flex gap-3 items-center h-full",children:[x,o.jsxs("span",{className:"text-sm text-muted-foreground",children:["#",n]})]}),t[4]=n,t[5]=p):p=t[5];let h;t[6]!==f?(h=f&&o.jsxs(le,{variant:"success",className:"gap-1 ml-3",children:[o.jsx(Is,{size:11}),"Success"]}),t[6]=f,t[7]=h):h=t[7];let g;t[8]!==u?(g=u&&o.jsxs(le,{variant:"warning",className:"gap-1 ml-3",children:[o.jsx(ko,{size:11}),"Partial success"]}),t[8]=u,t[9]=g):g=t[9];let b;t[10]!==a?(b=a&&o.jsxs(le,{variant:"destructive",className:"gap-1 ml-3",children:[o.jsx(No,{size:11}),"Failed"]}),t[10]=a,t[11]=b):b=t[11];let S;t[12]===Symbol.for("react.memo_cache_sentinel")?(S=o.jsx(vo,{className:"w-4 h-4 text-muted-foreground"}),t[12]=S):S=t[12];let v;t[13]!==l?(v=o.jsxs("div",{className:"flex items-center gap-1 ml-6",children:[S,o.jsx("span",{className:"text-sm text-muted-foreground",children:l})]}),t[13]=l,t[14]=v):v=t[14];let y;t[15]!==p||t[16]!==h||t[17]!==g||t[18]!==b||t[19]!==v?(y=o.jsxs("div",{className:"flex items-center h-full",children:[m,p,h,g,b,v]}),t[15]=p,t[16]=h,t[17]=g,t[18]=b,t[19]=v,t[20]=y):y=t[20];let j;t[21]!==e?(j=()=>e(void 0),t[21]=e,t[22]=j):j=t[22];let w;t[23]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx($t,{className:"w-4 h-4 text-muted-foreground"}),t[23]=w):w=t[23];let N;t[24]!==j?(N=o.jsx(te,{variant:"ghost",size:"xs",onClick:j,children:w}),t[24]=j,t[25]=N):N=t[25];let k;return t[26]!==N||t[27]!==y?(k=o.jsx("div",{className:"flex flex-col border-b border-border",children:o.jsxs("div",{className:"h-10 bg-accent flex items-center justify-between",children:[y,N]})}),t[26]=N,t[27]=y,t[28]=k):k=t[28],k}function nc(t){const e=_.c(14),{itemId:n}=t;let s;e[0]!==n?(s={itemId:n},e[0]=n,e[1]=s):s=e[1];const{item:i,update:r,isUpdating:l}=ls(s);let c;e[2]!==i?(c=JSON.stringify(i),e[2]=i,e[3]=c):c=e[3];const a=c;if(!i){let m;return e[4]===Symbol.for("react.memo_cache_sentinel")?(m=o.jsx(Qe,{children:o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(In,{icon:o.jsx(Rn,{className:"w-10 h-10 text-muted-foreground"}),title:"Workflow not found",description:"This workflow may have been deleted or you may not have access to it."})})}),e[4]=m):m=e[4],m}let d;e[5]!==i?(d={workflow:i,trackingExecutionId:void 0,currentStepTab:"input"},e[5]=i,e[6]=d):d=e[6];let u;e[7]!==l||e[8]!==r?(u=o.jsx(wl,{onUpdate:r,isUpdating:l}),e[7]=l,e[8]=r,e[9]=u):u=e[9];let f;return e[10]!==a||e[11]!==d||e[12]!==u?(f=o.jsx(Ao,{initialState:d,children:u},a),e[10]=a,e[11]=d,e[12]=u,e[13]=f):f=e[13],f}function wl(t){const e=_.c(22),{onUpdate:n,isUpdating:s}=t;ul();const i=de(),r=Y(),{viewMode:l,showExecutionsList:c}=At(),a=Ve(),d=qn();let u;e[0]!==n||e[1]!==i?(u=async()=>{await n(i)},e[0]=n,e[1]=i,e[2]=u):u=e[2];const f=u,m=a&&"toolName"in a.action,x=m?a.action.toolName:null,p=m&&!x&&!r,h=d&&!r,g=!p&&!h&&(a||r||!c);let b;e[3]!==f||e[4]!==s||e[5]!==i.description||e[6]!==i.title?(b=o.jsx(ri,{title:i.title,description:i.description,onSave:f,isSaving:s}),e[3]=f,e[4]=s,e[5]=i.description,e[6]=i.title,e[7]=b):b=e[7];let S;e[8]!==r?(S=r&&o.jsx(vl,{}),e[8]=r,e[9]=S):S=e[9];let v;e[10]!==n||e[11]!==c||e[12]!==h||e[13]!==g||e[14]!==p||e[15]!==l||e[16]!==i?(v=o.jsx("div",{className:"flex-1 overflow-hidden",children:l==="code"?o.jsx(bl,{workflow:i,onUpdate:n}):o.jsxs(zs,{direction:"horizontal",className:"flex w-full h-full",children:[o.jsx(qt,{defaultSize:50,minSize:30,children:o.jsx(Ni,{})}),o.jsx(Ws,{}),o.jsxs(qt,{defaultSize:50,minSize:25,children:[p&&o.jsx($i,{className:"border-l border-border"}),h&&o.jsx(pl,{className:"border-l border-border"}),c&&o.jsx(sl,{}),g&&o.jsx(Ai,{className:"border-l border-border"})]})]})}),e[10]=n,e[11]=c,e[12]=h,e[13]=g,e[14]=p,e[15]=l,e[16]=i,e[17]=v):v=e[17];let y;return e[18]!==b||e[19]!==S||e[20]!==v?(y=o.jsx(Qe,{children:o.jsxs("div",{className:"flex flex-col h-full overflow-hidden bg-background",children:[b,S,v]})}),e[18]=b,e[19]=S,e[20]=v,e[21]=y):y=e[21],y}function Nl(t){const e=_.c(5),{itemId:n,connectionId:s}=t,i=s??"self",r=i??"no-connection",{org:l}=oe(),c=i??null;let a;e[0]!==l.id||e[1]!==c?(a={connectionId:c,orgId:l.id},e[0]=l.id,e[1]=c,e[2]=a):a=e[2];const d=ae(a),u=Cn(r,"WORKFLOW_EXECUTION",n,d);let f;return e[3]!==u?(f={item:u},e[3]=u,e[4]=f):f=e[4],f}function sc(t){const e=_.c(7),{itemId:n}=t;let s;e[0]!==n?(s={itemId:n},e[0]=n,e[1]=s):s=e[1];const{item:i}=Nl(s);if(!i){let c;return e[2]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx(Qe,{children:o.jsx("div",{className:"flex h-full w-full bg-background",children:o.jsx(In,{icon:o.jsx(Rn,{className:"w-10 h-10 text-muted-foreground"}),title:"Workflow execution not found",description:"This workflow execution may have been deleted or you may not have access to it."})})}),e[2]=c):c=e[2],c}let r;e[3]!==i?(r=JSON.stringify(i,null,2),e[3]=i,e[4]=r):r=e[4];let l;return e[5]!==r?(l=o.jsx(Qe,{children:o.jsx("div",{className:"flex flex-col h-full overflow-hidden bg-background",children:o.jsx(Re,{height:"100%",code:r,language:"json",readOnly:!0})})}),e[5]=r,e[6]=l):l=e[6],l}export{_o as S,sc as W,nc as a};
|