@motiadev/workbench 0.14.0-beta.165-285707 → 0.15.0-beta.165

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.
Files changed (236) hide show
  1. package/dist/index.d.ts +189 -10
  2. package/dist/index.html +1 -1
  3. package/dist/index.js +1065 -7
  4. package/dist/middleware.d.ts +66 -8
  5. package/dist/middleware.js +694 -86
  6. package/dist/motia-plugin/__tests__/generator.test.ts +129 -0
  7. package/dist/motia-plugin/__tests__/resolver.test.ts +82 -0
  8. package/dist/motia-plugin/__tests__/validator.test.ts +71 -0
  9. package/dist/motia-plugin/{generator.js → generator.ts} +37 -35
  10. package/dist/motia-plugin/hmr.ts +123 -0
  11. package/dist/motia-plugin/index.ts +183 -0
  12. package/dist/motia-plugin/{resolver.d.ts → resolver.ts} +38 -5
  13. package/dist/motia-plugin/types.ts +198 -0
  14. package/dist/motia-plugin/{utils.d.ts → utils.ts} +17 -4
  15. package/dist/motia-plugin/validator.ts +197 -0
  16. package/dist/src/App.tsx +41 -0
  17. package/dist/src/components/NotFoundPage.tsx +11 -0
  18. package/dist/src/components/bottom-panel.tsx +39 -0
  19. package/dist/src/components/flow/base-edge.tsx +61 -0
  20. package/dist/src/components/flow/flow-loader.tsx +3 -0
  21. package/dist/src/components/flow/flow-page.tsx +75 -0
  22. package/dist/src/components/flow/flow-tab-menu-item.tsx +52 -0
  23. package/dist/src/components/flow/flow-view.tsx +66 -0
  24. package/dist/src/components/flow/hooks/use-get-flow-state.tsx +171 -0
  25. package/dist/src/components/flow/hooks/use-save-workflow-config.ts +25 -0
  26. package/dist/src/components/flow/node-organizer.tsx +103 -0
  27. package/dist/src/components/flow/nodes/api-flow-node.tsx +6 -0
  28. package/dist/src/components/flow/nodes/cron-flow-node.tsx +6 -0
  29. package/dist/src/components/flow/nodes/event-flow-node.tsx +6 -0
  30. package/dist/src/components/flow/nodes/noop-flow-node.tsx +6 -0
  31. package/dist/src/components/header/deploy-button.tsx +110 -0
  32. package/dist/src/components/header/header.tsx +39 -0
  33. package/dist/src/components/root-motia.tsx +10 -0
  34. package/dist/src/components/top-panel.tsx +40 -0
  35. package/dist/src/components/tutorial/engine/tutorial-engine.ts +26 -0
  36. package/dist/src/components/tutorial/engine/tutorial-types.ts +26 -0
  37. package/dist/src/components/tutorial/engine/workbench-xpath.ts +53 -0
  38. package/dist/src/components/tutorial/hooks/tutorial-utils.ts +26 -0
  39. package/dist/src/components/tutorial/hooks/use-tutorial-engine.ts +213 -0
  40. package/dist/src/components/tutorial/hooks/use-tutorial.ts +14 -0
  41. package/dist/src/components/tutorial/tutorial-button.tsx +46 -0
  42. package/dist/src/components/tutorial/tutorial-step.tsx +82 -0
  43. package/dist/src/components/tutorial/tutorial.tsx +59 -0
  44. package/dist/src/components/ui/json-editor.tsx +68 -0
  45. package/dist/src/components/ui/table.tsx +75 -0
  46. package/dist/src/components/ui/theme-toggle.tsx +54 -0
  47. package/dist/src/components/ui/tooltip.tsx +26 -0
  48. package/dist/src/hooks/use-debounced.ts +22 -0
  49. package/dist/src/hooks/use-fetch-flows.ts +33 -0
  50. package/dist/src/hooks/use-mobile.ts +19 -0
  51. package/dist/src/hooks/use-update-handle-positions.ts +42 -0
  52. package/dist/src/index.css +5 -5
  53. package/dist/src/lib/__tests__/utils.test.ts +110 -0
  54. package/dist/src/lib/motia-analytics.ts +140 -0
  55. package/dist/src/lib/plugins.tsx +132 -0
  56. package/dist/src/lib/utils.ts +37 -0
  57. package/dist/src/main.tsx +30 -0
  58. package/dist/src/project-view-mode.tsx +32 -0
  59. package/dist/src/publicComponents/api-node.tsx +26 -0
  60. package/dist/src/publicComponents/base-node/base-handle.tsx +50 -0
  61. package/dist/src/publicComponents/base-node/base-node.tsx +114 -0
  62. package/dist/src/publicComponents/base-node/code-display.tsx +119 -0
  63. package/dist/src/publicComponents/base-node/emits.tsx +17 -0
  64. package/dist/src/publicComponents/base-node/feature-card.tsx +32 -0
  65. package/dist/src/publicComponents/base-node/language-indicator.tsx +131 -0
  66. package/dist/src/publicComponents/base-node/node-header.tsx +49 -0
  67. package/dist/src/publicComponents/base-node/node-sidebar.tsx +41 -0
  68. package/dist/src/publicComponents/base-node/subscribe.tsx +13 -0
  69. package/dist/src/publicComponents/cron-node.tsx +24 -0
  70. package/dist/src/publicComponents/event-node.tsx +20 -0
  71. package/dist/src/publicComponents/node-props.tsx +15 -0
  72. package/dist/src/publicComponents/noop-node.tsx +19 -0
  73. package/dist/src/setupTests.ts +1 -0
  74. package/dist/src/stores/use-app-tabs-store.ts +49 -0
  75. package/dist/src/stores/use-flow-store.ts +31 -0
  76. package/dist/src/stores/use-global-store.ts +24 -0
  77. package/dist/src/stores/use-motia-config-store.ts +36 -0
  78. package/dist/src/stores/use-tabs-store.ts +34 -0
  79. package/dist/src/system-view-mode.tsx +28 -0
  80. package/dist/src/types/endpoint.ts +12 -0
  81. package/dist/src/types/file.ts +7 -0
  82. package/dist/src/types/flow.ts +103 -0
  83. package/eslint.config.cjs +22 -0
  84. package/jest.config.cjs +68 -0
  85. package/package.json +53 -51
  86. package/dist/motia-plugin/__tests__/generator.test.d.ts +0 -1
  87. package/dist/motia-plugin/__tests__/generator.test.js +0 -97
  88. package/dist/motia-plugin/__tests__/resolver.test.d.ts +0 -1
  89. package/dist/motia-plugin/__tests__/resolver.test.js +0 -64
  90. package/dist/motia-plugin/__tests__/validator.test.d.ts +0 -1
  91. package/dist/motia-plugin/__tests__/validator.test.js +0 -59
  92. package/dist/motia-plugin/generator.d.ts +0 -78
  93. package/dist/motia-plugin/hmr.d.ts +0 -22
  94. package/dist/motia-plugin/hmr.js +0 -100
  95. package/dist/motia-plugin/index.d.ts +0 -3
  96. package/dist/motia-plugin/index.js +0 -153
  97. package/dist/motia-plugin/resolver.js +0 -92
  98. package/dist/motia-plugin/types.d.ts +0 -169
  99. package/dist/motia-plugin/types.js +0 -36
  100. package/dist/motia-plugin/utils.js +0 -75
  101. package/dist/motia-plugin/validator.d.ts +0 -19
  102. package/dist/motia-plugin/validator.js +0 -163
  103. package/dist/src/App.d.ts +0 -2
  104. package/dist/src/App.js +0 -35
  105. package/dist/src/components/NotFoundPage.d.ts +0 -1
  106. package/dist/src/components/NotFoundPage.js +0 -3
  107. package/dist/src/components/bottom-panel.d.ts +0 -1
  108. package/dist/src/components/bottom-panel.js +0 -15
  109. package/dist/src/components/flow/base-edge.d.ts +0 -3
  110. package/dist/src/components/flow/base-edge.js +0 -39
  111. package/dist/src/components/flow/flow-loader.d.ts +0 -1
  112. package/dist/src/components/flow/flow-loader.js +0 -4
  113. package/dist/src/components/flow/flow-page.d.ts +0 -1
  114. package/dist/src/components/flow/flow-page.js +0 -25
  115. package/dist/src/components/flow/flow-tab-menu-item.d.ts +0 -1
  116. package/dist/src/components/flow/flow-tab-menu-item.js +0 -18
  117. package/dist/src/components/flow/flow-view.d.ts +0 -12
  118. package/dist/src/components/flow/flow-view.js +0 -22
  119. package/dist/src/components/flow/hooks/use-get-flow-state.d.ts +0 -10
  120. package/dist/src/components/flow/hooks/use-get-flow-state.js +0 -133
  121. package/dist/src/components/flow/hooks/use-save-workflow-config.d.ts +0 -2
  122. package/dist/src/components/flow/hooks/use-save-workflow-config.js +0 -22
  123. package/dist/src/components/flow/node-organizer.d.ts +0 -10
  124. package/dist/src/components/flow/node-organizer.js +0 -82
  125. package/dist/src/components/flow/nodes/api-flow-node.d.ts +0 -2
  126. package/dist/src/components/flow/nodes/api-flow-node.js +0 -5
  127. package/dist/src/components/flow/nodes/cron-flow-node.d.ts +0 -2
  128. package/dist/src/components/flow/nodes/cron-flow-node.js +0 -5
  129. package/dist/src/components/flow/nodes/event-flow-node.d.ts +0 -2
  130. package/dist/src/components/flow/nodes/event-flow-node.js +0 -5
  131. package/dist/src/components/flow/nodes/noop-flow-node.d.ts +0 -2
  132. package/dist/src/components/flow/nodes/noop-flow-node.js +0 -5
  133. package/dist/src/components/header/deploy-button.d.ts +0 -1
  134. package/dist/src/components/header/deploy-button.js +0 -28
  135. package/dist/src/components/header/header.d.ts +0 -2
  136. package/dist/src/components/header/header.js +0 -23
  137. package/dist/src/components/root-motia.d.ts +0 -2
  138. package/dist/src/components/root-motia.js +0 -7
  139. package/dist/src/components/top-panel.d.ts +0 -1
  140. package/dist/src/components/top-panel.js +0 -15
  141. package/dist/src/components/tutorial/engine/tutorial-engine.d.ts +0 -12
  142. package/dist/src/components/tutorial/engine/tutorial-engine.js +0 -36
  143. package/dist/src/components/tutorial/engine/tutorial-types.d.ts +0 -22
  144. package/dist/src/components/tutorial/engine/tutorial-types.js +0 -1
  145. package/dist/src/components/tutorial/engine/workbench-xpath.d.ts +0 -45
  146. package/dist/src/components/tutorial/engine/workbench-xpath.js +0 -45
  147. package/dist/src/components/tutorial/hooks/tutorial-utils.d.ts +0 -1
  148. package/dist/src/components/tutorial/hooks/tutorial-utils.js +0 -17
  149. package/dist/src/components/tutorial/hooks/use-tutorial-engine.d.ts +0 -15
  150. package/dist/src/components/tutorial/hooks/use-tutorial-engine.js +0 -183
  151. package/dist/src/components/tutorial/hooks/use-tutorial.d.ts +0 -5
  152. package/dist/src/components/tutorial/hooks/use-tutorial.js +0 -10
  153. package/dist/src/components/tutorial/tutorial-button.d.ts +0 -2
  154. package/dist/src/components/tutorial/tutorial-button.js +0 -21
  155. package/dist/src/components/tutorial/tutorial-step.d.ts +0 -14
  156. package/dist/src/components/tutorial/tutorial-step.js +0 -19
  157. package/dist/src/components/tutorial/tutorial.d.ts +0 -2
  158. package/dist/src/components/tutorial/tutorial.js +0 -32
  159. package/dist/src/components/ui/json-editor.d.ts +0 -12
  160. package/dist/src/components/ui/json-editor.js +0 -35
  161. package/dist/src/components/ui/table.d.ts +0 -10
  162. package/dist/src/components/ui/table.js +0 -20
  163. package/dist/src/components/ui/theme-toggle.d.ts +0 -2
  164. package/dist/src/components/ui/theme-toggle.js +0 -19
  165. package/dist/src/components/ui/tooltip.d.ts +0 -6
  166. package/dist/src/components/ui/tooltip.js +0 -3
  167. package/dist/src/hooks/use-debounced.d.ts +0 -1
  168. package/dist/src/hooks/use-debounced.js +0 -18
  169. package/dist/src/hooks/use-fetch-flows.d.ts +0 -1
  170. package/dist/src/hooks/use-fetch-flows.js +0 -26
  171. package/dist/src/hooks/use-mobile.d.ts +0 -1
  172. package/dist/src/hooks/use-mobile.js +0 -15
  173. package/dist/src/hooks/use-update-handle-positions.d.ts +0 -10
  174. package/dist/src/hooks/use-update-handle-positions.js +0 -35
  175. package/dist/src/lib/__tests__/utils.test.d.ts +0 -1
  176. package/dist/src/lib/__tests__/utils.test.js +0 -94
  177. package/dist/src/lib/motia-analytics.d.ts +0 -38
  178. package/dist/src/lib/motia-analytics.js +0 -132
  179. package/dist/src/lib/plugins.d.ts +0 -2
  180. package/dist/src/lib/plugins.js +0 -105
  181. package/dist/src/lib/utils.d.ts +0 -7
  182. package/dist/src/lib/utils.js +0 -34
  183. package/dist/src/main.d.ts +0 -2
  184. package/dist/src/main.js +0 -17
  185. package/dist/src/project-view-mode.d.ts +0 -1
  186. package/dist/src/project-view-mode.js +0 -20
  187. package/dist/src/publicComponents/api-node.d.ts +0 -5
  188. package/dist/src/publicComponents/api-node.js +0 -5
  189. package/dist/src/publicComponents/base-node/base-handle.d.ts +0 -9
  190. package/dist/src/publicComponents/base-node/base-handle.js +0 -8
  191. package/dist/src/publicComponents/base-node/base-node.d.ts +0 -15
  192. package/dist/src/publicComponents/base-node/base-node.js +0 -30
  193. package/dist/src/publicComponents/base-node/code-display.d.ts +0 -9
  194. package/dist/src/publicComponents/base-node/code-display.js +0 -64
  195. package/dist/src/publicComponents/base-node/emits.d.ts +0 -5
  196. package/dist/src/publicComponents/base-node/emits.js +0 -5
  197. package/dist/src/publicComponents/base-node/feature-card.d.ts +0 -10
  198. package/dist/src/publicComponents/base-node/feature-card.js +0 -5
  199. package/dist/src/publicComponents/base-node/language-indicator.d.ts +0 -10
  200. package/dist/src/publicComponents/base-node/language-indicator.js +0 -29
  201. package/dist/src/publicComponents/base-node/node-header.d.ts +0 -13
  202. package/dist/src/publicComponents/base-node/node-header.js +0 -30
  203. package/dist/src/publicComponents/base-node/node-sidebar.d.ts +0 -14
  204. package/dist/src/publicComponents/base-node/node-sidebar.js +0 -9
  205. package/dist/src/publicComponents/base-node/subscribe.d.ts +0 -4
  206. package/dist/src/publicComponents/base-node/subscribe.js +0 -4
  207. package/dist/src/publicComponents/cron-node.d.ts +0 -4
  208. package/dist/src/publicComponents/cron-node.js +0 -6
  209. package/dist/src/publicComponents/event-node.d.ts +0 -4
  210. package/dist/src/publicComponents/event-node.js +0 -5
  211. package/dist/src/publicComponents/node-props.d.ts +0 -21
  212. package/dist/src/publicComponents/node-props.js +0 -1
  213. package/dist/src/publicComponents/noop-node.d.ts +0 -4
  214. package/dist/src/publicComponents/noop-node.js +0 -5
  215. package/dist/src/setupTests.d.ts +0 -1
  216. package/dist/src/setupTests.js +0 -1
  217. package/dist/src/stores/use-app-tabs-store.d.ts +0 -16
  218. package/dist/src/stores/use-app-tabs-store.js +0 -31
  219. package/dist/src/stores/use-flow-store.d.ts +0 -21
  220. package/dist/src/stores/use-flow-store.js +0 -16
  221. package/dist/src/stores/use-global-store.d.ts +0 -18
  222. package/dist/src/stores/use-global-store.js +0 -12
  223. package/dist/src/stores/use-motia-config-store.d.ts +0 -12
  224. package/dist/src/stores/use-motia-config-store.js +0 -24
  225. package/dist/src/stores/use-tabs-store.d.ts +0 -19
  226. package/dist/src/stores/use-tabs-store.js +0 -22
  227. package/dist/src/system-view-mode.d.ts +0 -1
  228. package/dist/src/system-view-mode.js +0 -10
  229. package/dist/src/types/endpoint.d.ts +0 -14
  230. package/dist/src/types/endpoint.js +0 -1
  231. package/dist/src/types/file.d.ts +0 -7
  232. package/dist/src/types/file.js +0 -1
  233. package/dist/src/types/flow.d.ts +0 -115
  234. package/dist/src/types/flow.js +0 -1
  235. package/dist/tsconfig.app.tsbuildinfo +0 -1
  236. package/dist/tsconfig.node.tsbuildinfo +0 -1
package/dist/index.js CHANGED
@@ -1,7 +1,1065 @@
1
- export { Position } from '@xyflow/react';
2
- export { workbenchXPath } from './src/components/tutorial/engine/workbench-xpath';
3
- export { ApiNode } from './src/publicComponents/api-node';
4
- export { BaseHandle } from './src/publicComponents/base-node/base-handle';
5
- export { BaseNode } from './src/publicComponents/base-node/base-node';
6
- export { EventNode } from './src/publicComponents/event-node';
7
- export { NoopNode } from './src/publicComponents/noop-node';
1
+ import { Handle, Position, Position as Position$1, useReactFlow, useUpdateNodeInternals } from "@xyflow/react";
2
+ import { c } from "react/compiler-runtime";
3
+ import { Button, Sidebar, cn, useThemeStore } from "@motiadev/ui";
4
+ import { CalendarClock, CircleOff, Link2, ScanSearch, Waypoints, X } from "lucide-react";
5
+ import { useEffect, useRef, useState } from "react";
6
+ import clsx from "clsx";
7
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
+ import { cva } from "class-variance-authority";
9
+ import { Prism } from "react-syntax-highlighter";
10
+ import { oneDark, oneLight } from "react-syntax-highlighter/dist/esm/styles/prism";
11
+
12
+ //#region src/components/tutorial/engine/workbench-xpath.ts
13
+ const workbenchXPath = {
14
+ sidebarContainer: "//div[@data-testid=\"sidebar-panel\"]",
15
+ closePanelButton: "//div[@id=\"app-sidebar-container\"]//button[@data-testid=\"close-panel\"]",
16
+ bottomPanel: "//div[@id=\"bottom-panel\"]",
17
+ flows: {
18
+ dropdownFlow: (flowId) => `//div[@data-testid="dropdown-${flowId}"]`,
19
+ feature: (featureId) => `//div[@data-feature-id="${featureId}"]`,
20
+ previewButton: (stepId) => `//button[@data-testid="open-code-preview-button-${stepId}"]`,
21
+ node: (stepId) => `//div[@data-testid="node-${stepId}"]`
22
+ },
23
+ endpoints: {
24
+ endpointsList: "//div[@data-testid=\"endpoints-list\"]",
25
+ endpoint: (method, path) => `//div[@data-testid="endpoint-${method}-${path}"]`,
26
+ callPanel: "//div[@data-testid=\"endpoint-details-panel\"]",
27
+ specButton: "//button[@data-testid=\"endpoint-spec-button\"]",
28
+ bodyTab: "//button[@data-testid=\"endpoint-body-tab\"]",
29
+ headersTab: "//button[@data-testid=\"endpoint-headers-tab\"]",
30
+ paramsTab: "//button[@data-testid=\"endpoint-params-tab\"]",
31
+ callTab: "//button[@data-testid=\"endpoint-body-tab\"]",
32
+ response: "//div[@data-testid=\"endpoint-response-container\"]",
33
+ playButton: "//button[@data-testid=\"endpoint-play-button\"]"
34
+ },
35
+ tracing: {
36
+ trace: (index) => `(//button[contains(@class, 'motia-trace-group')])[${index}]`,
37
+ details: "//div[@data-testid=\"trace-details\"]",
38
+ timeline: (index) => `(//div[@data-testid="trace-timeline-item"])[${index}]`
39
+ },
40
+ logs: {
41
+ container: "//div[@data-testid=\"logs-container\"]",
42
+ searchContainer: "//div[@data-testid=\"logs-search-container\"]",
43
+ traceColumn: (index) => `(//td[starts-with(@data-testid, 'trace')])[${index}]`,
44
+ row: "//div[@data-testid=\"log-row\"]"
45
+ },
46
+ states: {
47
+ container: "//div[@data-testid=\"states-container\"]",
48
+ row: (index) => `(//tr[starts-with(@data-testid, 'item-')])[${index}]`
49
+ },
50
+ links: {
51
+ flows: "//div[@data-testid=\"flows-dropdown-trigger\"]",
52
+ endpoints: "//button[@data-testid=\"endpoints-link\"]",
53
+ tracing: "//button[@data-testid=\"tracing-link\"]",
54
+ logs: "//button[@data-testid=\"logs-link\"]",
55
+ states: "//button[@data-testid=\"states-link\"]"
56
+ }
57
+ };
58
+
59
+ //#endregion
60
+ //#region src/hooks/use-update-handle-positions.ts
61
+ const useHandlePositions = (data) => {
62
+ const $ = c(21);
63
+ const reactFlow = useReactFlow();
64
+ const updateNodeInternals = useUpdateNodeInternals();
65
+ const sourcePosition = data.nodeConfig?.sourceHandlePosition === "bottom" ? Position$1.Bottom : Position$1.Right;
66
+ const targetPosition = data.nodeConfig?.targetHandlePosition === "top" ? Position$1.Top : Position$1.Left;
67
+ let t0;
68
+ if ($[0] !== data || $[1] !== reactFlow || $[2] !== updateNodeInternals) {
69
+ t0 = (position) => {
70
+ reactFlow.updateNode(data.id, { data: {
71
+ ...data,
72
+ nodeConfig: {
73
+ ...data.nodeConfig,
74
+ sourceHandlePosition: position
75
+ }
76
+ } });
77
+ updateNodeInternals(data.id);
78
+ };
79
+ $[0] = data;
80
+ $[1] = reactFlow;
81
+ $[2] = updateNodeInternals;
82
+ $[3] = t0;
83
+ } else t0 = $[3];
84
+ const updateSourcePosition = t0;
85
+ let t1;
86
+ if ($[4] !== data || $[5] !== reactFlow || $[6] !== updateNodeInternals) {
87
+ t1 = (position_0) => {
88
+ reactFlow.updateNode(data.id, { data: {
89
+ ...data,
90
+ nodeConfig: {
91
+ ...data.nodeConfig,
92
+ targetHandlePosition: position_0
93
+ }
94
+ } });
95
+ updateNodeInternals(data.id);
96
+ };
97
+ $[4] = data;
98
+ $[5] = reactFlow;
99
+ $[6] = updateNodeInternals;
100
+ $[7] = t1;
101
+ } else t1 = $[7];
102
+ const updateTargetPosition = t1;
103
+ let t2;
104
+ if ($[8] !== targetPosition || $[9] !== updateTargetPosition) {
105
+ t2 = () => {
106
+ updateTargetPosition(targetPosition === Position$1.Top ? Position$1.Left : Position$1.Top);
107
+ };
108
+ $[8] = targetPosition;
109
+ $[9] = updateTargetPosition;
110
+ $[10] = t2;
111
+ } else t2 = $[10];
112
+ const toggleTargetPosition = t2;
113
+ let t3;
114
+ if ($[11] !== sourcePosition || $[12] !== updateSourcePosition) {
115
+ t3 = () => {
116
+ updateSourcePosition(sourcePosition === Position$1.Bottom ? Position$1.Right : Position$1.Bottom);
117
+ };
118
+ $[11] = sourcePosition;
119
+ $[12] = updateSourcePosition;
120
+ $[13] = t3;
121
+ } else t3 = $[13];
122
+ const toggleSourcePosition = t3;
123
+ let t4;
124
+ if ($[14] !== sourcePosition || $[15] !== targetPosition || $[16] !== toggleSourcePosition || $[17] !== toggleTargetPosition || $[18] !== updateSourcePosition || $[19] !== updateTargetPosition) {
125
+ t4 = {
126
+ sourcePosition,
127
+ targetPosition,
128
+ updateSourcePosition,
129
+ updateTargetPosition,
130
+ toggleTargetPosition,
131
+ toggleSourcePosition
132
+ };
133
+ $[14] = sourcePosition;
134
+ $[15] = targetPosition;
135
+ $[16] = toggleSourcePosition;
136
+ $[17] = toggleTargetPosition;
137
+ $[18] = updateSourcePosition;
138
+ $[19] = updateTargetPosition;
139
+ $[20] = t4;
140
+ } else t4 = $[20];
141
+ return t4;
142
+ };
143
+
144
+ //#endregion
145
+ //#region src/publicComponents/base-node/base-handle.tsx
146
+ const BaseHandle = (props) => {
147
+ const $ = c(20);
148
+ let isHidden;
149
+ let onTogglePosition;
150
+ let position;
151
+ let rest;
152
+ if ($[0] !== props) {
153
+ ({isHidden, position, onTogglePosition, ...rest} = props);
154
+ $[0] = props;
155
+ $[1] = isHidden;
156
+ $[2] = onTogglePosition;
157
+ $[3] = position;
158
+ $[4] = rest;
159
+ } else {
160
+ isHidden = $[1];
161
+ onTogglePosition = $[2];
162
+ position = $[3];
163
+ rest = $[4];
164
+ }
165
+ const isHorizontal = position === Position$1.Left || position === Position$1.Right;
166
+ const t0 = position === Position$1.Top && "-top-[4px]";
167
+ const t1 = position === Position$1.Bottom && "-bottom-[4px]";
168
+ const t2 = position === Position$1.Left && "-left-[4px]";
169
+ const t3 = position === Position$1.Right && "-right-[4px]";
170
+ const t4 = isHorizontal ? "top-1/2 -mt-[2px]" : "left-1/2 -ml-[2px]";
171
+ const t5 = isHidden && "hidden";
172
+ let t6;
173
+ if ($[5] !== t0 || $[6] !== t1 || $[7] !== t2 || $[8] !== t3 || $[9] !== t4 || $[10] !== t5) {
174
+ t6 = clsx("absolute w-[6px] h-[6px]", t0, t1, t2, t3, t4, t5);
175
+ $[5] = t0;
176
+ $[6] = t1;
177
+ $[7] = t2;
178
+ $[8] = t3;
179
+ $[9] = t4;
180
+ $[10] = t5;
181
+ $[11] = t6;
182
+ } else t6 = $[11];
183
+ let t7;
184
+ if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
185
+ t7 = { background: "rgb(30,118,231)" };
186
+ $[12] = t7;
187
+ } else t7 = $[12];
188
+ let t8;
189
+ if ($[13] !== position || $[14] !== rest) {
190
+ t8 = /* @__PURE__ */ jsx(Handle, {
191
+ ...rest,
192
+ position,
193
+ style: t7,
194
+ className: "\n bg-white/50\n !static\n !w-[6px]\n !h-[6px]\n !min-w-[6px]\n !min-h-[6px]\n !p-0\n !border-none\n !transform-none\n !rounded-full\n !outline-none\n !shadow-none\n "
195
+ });
196
+ $[13] = position;
197
+ $[14] = rest;
198
+ $[15] = t8;
199
+ } else t8 = $[15];
200
+ let t9;
201
+ if ($[16] !== onTogglePosition || $[17] !== t6 || $[18] !== t8) {
202
+ t9 = /* @__PURE__ */ jsx("div", {
203
+ className: t6,
204
+ onClick: onTogglePosition,
205
+ children: t8
206
+ });
207
+ $[16] = onTogglePosition;
208
+ $[17] = t6;
209
+ $[18] = t8;
210
+ $[19] = t9;
211
+ } else t9 = $[19];
212
+ return t9;
213
+ };
214
+
215
+ //#endregion
216
+ //#region src/publicComponents/base-node/node-header.tsx
217
+ const baseIcon = cva("rounded-md p-2", { variants: { variant: {
218
+ event: "bg-[rgba(30,118,231,0.2)] text-[rgb(30,118,231)]",
219
+ api: "dark:bg-[rgba(192,255,17,0.2)] dark:text-[rgb(192,255,17)] bg-[rgb(231,255,166)] text-[rgb(94,125,11)]",
220
+ noop: "bg-[rgba(239,18,229,0.2)] text-[rgb(239,18,229)]",
221
+ cron: "bg-[rgba(241,105,15,0.2)] text-[rgb(241,105,15)]"
222
+ } } });
223
+ const NodeIcon = (t0) => {
224
+ const $ = c(8);
225
+ const { variant } = t0;
226
+ if (variant === "cron") {
227
+ let t1$1;
228
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
229
+ t1$1 = /* @__PURE__ */ jsx(CalendarClock, { className: "w-5 h-5" });
230
+ $[0] = t1$1;
231
+ } else t1$1 = $[0];
232
+ return t1$1;
233
+ } else if (variant === "api") {
234
+ let t1$1;
235
+ if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
236
+ t1$1 = /* @__PURE__ */ jsx(Link2, { className: "w-5 h-5" });
237
+ $[1] = t1$1;
238
+ } else t1$1 = $[1];
239
+ return t1$1;
240
+ } else if (variant === "noop") {
241
+ let t1$1;
242
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
243
+ t1$1 = /* @__PURE__ */ jsx(CircleOff, { className: "w-5 h-5" });
244
+ $[2] = t1$1;
245
+ } else t1$1 = $[2];
246
+ return t1$1;
247
+ } else if (variant === "event") {
248
+ let t1$1;
249
+ if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
250
+ t1$1 = /* @__PURE__ */ jsx(Waypoints, { className: "w-5 h-5" });
251
+ $[3] = t1$1;
252
+ } else t1$1 = $[3];
253
+ return t1$1;
254
+ }
255
+ let t1;
256
+ if ($[4] !== variant) {
257
+ t1 = cn(baseIcon({ variant }));
258
+ $[4] = variant;
259
+ $[5] = t1;
260
+ } else t1 = $[5];
261
+ let t2;
262
+ if ($[6] !== t1) {
263
+ t2 = /* @__PURE__ */ jsx("div", {
264
+ className: t1,
265
+ children: "Icon"
266
+ });
267
+ $[6] = t1;
268
+ $[7] = t2;
269
+ } else t2 = $[7];
270
+ return t2;
271
+ };
272
+ const NodeHeader = (t0) => {
273
+ const $ = c(18);
274
+ const { text, variant, children, className } = t0;
275
+ let t1;
276
+ if ($[0] !== className) {
277
+ t1 = cn("flex items-center gap-2 p-2", className);
278
+ $[0] = className;
279
+ $[1] = t1;
280
+ } else t1 = $[1];
281
+ let t2;
282
+ if ($[2] !== variant) {
283
+ t2 = baseIcon({ variant });
284
+ $[2] = variant;
285
+ $[3] = t2;
286
+ } else t2 = $[3];
287
+ let t3;
288
+ if ($[4] !== variant) {
289
+ t3 = /* @__PURE__ */ jsx(NodeIcon, { variant });
290
+ $[4] = variant;
291
+ $[5] = t3;
292
+ } else t3 = $[5];
293
+ let t4;
294
+ if ($[6] !== t2 || $[7] !== t3) {
295
+ t4 = /* @__PURE__ */ jsx("div", {
296
+ className: t2,
297
+ children: t3
298
+ });
299
+ $[6] = t2;
300
+ $[7] = t3;
301
+ $[8] = t4;
302
+ } else t4 = $[8];
303
+ let t5;
304
+ if ($[9] !== text) {
305
+ t5 = /* @__PURE__ */ jsx("div", {
306
+ className: "flex flex-col",
307
+ children: /* @__PURE__ */ jsx("div", {
308
+ className: "text-sm font-semibold leading-[1.25] tracking-[-0.25px]",
309
+ children: text
310
+ })
311
+ });
312
+ $[9] = text;
313
+ $[10] = t5;
314
+ } else t5 = $[10];
315
+ let t6;
316
+ if ($[11] !== children || $[12] !== t5) {
317
+ t6 = /* @__PURE__ */ jsxs("div", {
318
+ className: "flex flex-1 justify-between items-start gap-4",
319
+ children: [t5, children]
320
+ });
321
+ $[11] = children;
322
+ $[12] = t5;
323
+ $[13] = t6;
324
+ } else t6 = $[13];
325
+ let t7;
326
+ if ($[14] !== t1 || $[15] !== t4 || $[16] !== t6) {
327
+ t7 = /* @__PURE__ */ jsxs("div", {
328
+ className: t1,
329
+ children: [t4, t6]
330
+ });
331
+ $[14] = t1;
332
+ $[15] = t4;
333
+ $[16] = t6;
334
+ $[17] = t7;
335
+ } else t7 = $[17];
336
+ return t7;
337
+ };
338
+
339
+ //#endregion
340
+ //#region src/publicComponents/base-node/feature-card.tsx
341
+ const FeatureCard = (t0) => {
342
+ const $ = c(16);
343
+ const { feature, highlighted, onClick, onHover } = t0;
344
+ const t1 = feature.id;
345
+ const t2 = highlighted && "border-2 border-accent-1000 bg-accent-100";
346
+ let t3;
347
+ if ($[0] !== t2) {
348
+ t3 = cn("p-4 rounded-lg bg-card shadow-sm cursor-pointer hover:bg-card/50 border-2 border-transparent", t2);
349
+ $[0] = t2;
350
+ $[1] = t3;
351
+ } else t3 = $[1];
352
+ let t4;
353
+ if ($[2] !== feature.title) {
354
+ t4 = /* @__PURE__ */ jsx("div", {
355
+ className: "text-md font-semibold text-foreground leading-tight whitespace-nowrap mb-2",
356
+ children: feature.title
357
+ });
358
+ $[2] = feature.title;
359
+ $[3] = t4;
360
+ } else t4 = $[3];
361
+ let t5;
362
+ if ($[4] !== feature.description) {
363
+ t5 = /* @__PURE__ */ jsx("div", {
364
+ className: "text-sm font-medium text-muted-foreground leading-tight",
365
+ children: feature.description
366
+ });
367
+ $[4] = feature.description;
368
+ $[5] = t5;
369
+ } else t5 = $[5];
370
+ let t6;
371
+ if ($[6] !== feature.link) {
372
+ t6 = feature.link && /* @__PURE__ */ jsx("div", {
373
+ className: "text-sm font-medium text-muted-foreground leading-tight",
374
+ children: /* @__PURE__ */ jsx("a", {
375
+ href: feature.link,
376
+ children: "Learn more"
377
+ })
378
+ });
379
+ $[6] = feature.link;
380
+ $[7] = t6;
381
+ } else t6 = $[7];
382
+ let t7;
383
+ if ($[8] !== feature.id || $[9] !== onClick || $[10] !== onHover || $[11] !== t3 || $[12] !== t4 || $[13] !== t5 || $[14] !== t6) {
384
+ t7 = /* @__PURE__ */ jsxs("div", {
385
+ "data-feature-id": t1,
386
+ className: t3,
387
+ onClick,
388
+ onMouseEnter: onHover,
389
+ children: [
390
+ t4,
391
+ t5,
392
+ t6
393
+ ]
394
+ });
395
+ $[8] = feature.id;
396
+ $[9] = onClick;
397
+ $[10] = onHover;
398
+ $[11] = t3;
399
+ $[12] = t4;
400
+ $[13] = t5;
401
+ $[14] = t6;
402
+ $[15] = t7;
403
+ } else t7 = $[15];
404
+ return t7;
405
+ };
406
+
407
+ //#endregion
408
+ //#region src/publicComponents/base-node/language-indicator.tsx
409
+ const LanguageIndicator = (t0) => {
410
+ const $ = c(13);
411
+ const { language, className, size: t1, showLabel: t2 } = t0;
412
+ const size = t1 === void 0 ? 18 : t1;
413
+ const showLabel = t2 === void 0 ? false : t2;
414
+ let t3;
415
+ if ($[0] !== className || $[1] !== showLabel || $[2] !== size) {
416
+ t3 = (language_0) => {
417
+ if (language_0 === "typescript") return /* @__PURE__ */ jsxs(Fragment, { children: [showLabel ? /* @__PURE__ */ jsx(Fragment, { children: "TypeScript" }) : null, /* @__PURE__ */ jsx("svg", {
418
+ xmlns: "http://www.w3.org/2000/svg",
419
+ width: size,
420
+ height: size,
421
+ viewBox: "0 0 24 24",
422
+ fill: "none",
423
+ children: /* @__PURE__ */ jsx("path", {
424
+ d: "M3 3V21H21V3H3ZM9 12H13.5V13.5H12V19.5H10.5V13.5H9V12ZM16.5 12H19.5V13.5H16.5V15H18C18.3975 15.0012 18.7783 15.1596 19.0593 15.4407C19.3404 15.7217 19.4988 16.1025 19.5 16.5V18C19.4988 18.3975 19.3404 18.7783 19.0593 19.0593C18.7783 19.3404 18.3975 19.4988 18 19.5H15V18H18V16.5H16.5C16.1025 16.4988 15.7217 16.3404 15.4407 16.0593C15.1596 15.7783 15.0012 15.3975 15 15V13.5C15.0012 13.1025 15.1596 12.7217 15.4407 12.4407C15.7217 12.1596 16.1025 12.0012 16.5 12Z",
425
+ fill: "#0288D1"
426
+ })
427
+ })] });
428
+ if (language_0 === "javascript") return /* @__PURE__ */ jsxs(Fragment, { children: [showLabel ? /* @__PURE__ */ jsx(Fragment, { children: "JavaScript" }) : null, /* @__PURE__ */ jsxs("svg", {
429
+ width: size,
430
+ height: size,
431
+ viewBox: "0 0 20 20",
432
+ fill: "none",
433
+ xmlns: "http://www.w3.org/2000/svg",
434
+ className,
435
+ children: [/* @__PURE__ */ jsx("g", {
436
+ clipPath: "url(#clip0_42_2938)",
437
+ children: /* @__PURE__ */ jsx("path", {
438
+ d: "M0 0H20V20H0V0ZM18.3617 15.23C18.2158 14.3175 17.6217 13.5508 15.8592 12.8358C15.2458 12.5483 14.5642 12.3483 14.3617 11.8858C14.2858 11.6108 14.2742 11.4608 14.3233 11.2983C14.4483 10.76 15.0858 10.5983 15.5858 10.7483C15.9108 10.8483 16.2108 11.0983 16.3992 11.4983C17.2608 10.935 17.2608 10.935 17.8617 10.5608C17.6367 10.2108 17.525 10.06 17.3733 9.91083C16.8483 9.32333 16.1492 9.02333 15.0117 9.04917L14.4242 9.12333C13.8608 9.26083 13.3242 9.56083 12.9992 9.96083C12.0492 11.0367 12.3233 12.9117 13.4733 13.6867C14.6108 14.5367 16.2742 14.7233 16.4867 15.5242C16.6867 16.4992 15.7617 16.8117 14.8483 16.6992C14.1725 16.5492 13.7983 16.2108 13.3858 15.5858L11.8608 16.4617C12.0358 16.8617 12.2358 17.0358 12.5358 17.3858C13.9858 18.8492 17.6108 18.7742 18.2617 16.5492C18.2858 16.4742 18.4617 15.9617 18.3233 15.1742L18.3617 15.23ZM10.8758 9.1925H9.0025C9.0025 10.8075 8.995 12.4125 8.995 14.03C8.995 15.0567 9.0475 15.9992 8.88 16.2892C8.605 16.8633 7.89667 16.79 7.575 16.6892C7.245 16.5258 7.0775 16.3008 6.88333 15.9767C6.83083 15.8892 6.79167 15.8133 6.7775 15.8133L5.25667 16.7508C5.51083 17.2758 5.88167 17.7275 6.36 18.015C7.0725 18.44 8.03 18.5775 9.0325 18.3525C9.685 18.1642 10.2475 17.7767 10.5417 17.1767C10.9667 16.4017 10.8767 15.4517 10.8725 14.3883C10.8825 12.6767 10.8725 10.9642 10.8725 9.23917L10.8758 9.1925Z",
439
+ fill: "white"
440
+ })
441
+ }), /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("clipPath", {
442
+ id: "clip0_42_2938",
443
+ children: /* @__PURE__ */ jsx("rect", {
444
+ width: "20",
445
+ height: "20",
446
+ fill: "white"
447
+ })
448
+ }) })]
449
+ })] });
450
+ if (language_0 === "python") return /* @__PURE__ */ jsxs(Fragment, { children: [showLabel ? /* @__PURE__ */ jsx(Fragment, { children: "Python" }) : null, /* @__PURE__ */ jsxs("svg", {
451
+ xmlns: "http://www.w3.org/2000/svg",
452
+ width: size,
453
+ height: size,
454
+ viewBox: "0 0 24 24",
455
+ fill: "none",
456
+ children: [/* @__PURE__ */ jsx("path", {
457
+ d: "M9.86 2C9.10148 2 8.37403 2.30132 7.83767 2.83767C7.30132 3.37403 7 4.10148 7 4.86V6.54H11.29C11.68 6.54 12 7.11 12 7.5H4.86C4.10148 7.5 3.37403 7.80132 2.83767 8.33767C2.30132 8.87403 2 9.60148 2 10.36V14.141C2 14.8995 2.30132 15.627 2.83767 16.1633C3.37403 16.6997 4.10148 17.001 4.86 17.001H6.04V14.321C6.03868 13.9459 6.11143 13.5742 6.25407 13.2273C6.3967 12.8803 6.60642 12.565 6.8712 12.2993C7.13598 12.0336 7.45061 11.8227 7.79704 11.6789C8.14347 11.535 8.51489 11.461 8.89 11.461H14.14C15.72 11.461 17 10.19 17 8.61V4.86C17 4.10148 16.6987 3.37403 16.1623 2.83767C15.626 2.30132 14.8985 2 14.14 2H9.86ZM9.14 3.61C9.54 3.61 9.86 3.73 9.86 4.32C9.86 4.91 9.54 5.211 9.14 5.211C8.75 5.211 8.43 4.911 8.43 4.321C8.43 3.731 8.75 3.61 9.14 3.61Z",
458
+ fill: "#0288D1"
459
+ }), /* @__PURE__ */ jsx("path", {
460
+ d: "M17.959 7V9.68C17.9602 10.055 17.8873 10.4266 17.7446 10.7734C17.602 11.1202 17.3922 11.4355 17.1274 11.7011C16.8627 11.9667 16.5481 12.1774 16.2017 12.3212C15.8554 12.465 15.484 12.539 15.109 12.539H9.86C9.48489 12.5377 9.11321 12.6104 8.76628 12.7531C8.41935 12.8957 8.10399 13.1054 7.83828 13.3702C7.57257 13.635 7.36175 13.9496 7.2179 14.296C7.07405 14.6425 7 15.0139 7 15.389V19.139C7 19.8975 7.30132 20.625 7.83767 21.1613C8.37403 21.6977 9.10148 21.999 9.86 21.999H14.14C14.8983 21.999 15.6256 21.6978 16.162 21.1617C16.6983 20.6255 16.9997 19.8983 17 19.14V17.46H12.709C12.319 17.46 12 16.89 12 16.5H19.14C19.8985 16.5 20.626 16.1987 21.1623 15.6623C21.6987 15.126 22 14.3985 22 13.64V9.86C22 9.10148 21.6987 8.37403 21.1623 7.83767C20.626 7.30132 19.8985 7 19.14 7H17.959ZM8.32 11.513L8.316 11.517L8.354 11.513H8.32ZM14.86 18.789C15.25 18.789 15.57 19.089 15.57 19.679C15.57 19.7722 15.5516 19.8646 15.516 19.9507C15.4803 20.0368 15.428 20.1151 15.362 20.181C15.2961 20.247 15.2178 20.2993 15.1317 20.335C15.0456 20.3706 14.9532 20.389 14.86 20.389C14.46 20.389 14.14 20.269 14.14 19.679C14.14 19.089 14.46 18.789 14.86 18.789Z",
461
+ fill: "#FDD835"
462
+ })]
463
+ })] });
464
+ if (language_0 === "go") return /* @__PURE__ */ jsxs(Fragment, { children: [showLabel ? /* @__PURE__ */ jsx(Fragment, { children: "Go" }) : null, /* @__PURE__ */ jsx("svg", {
465
+ viewBox: "0 0 128 128",
466
+ width: size,
467
+ height: size,
468
+ className,
469
+ children: /* @__PURE__ */ jsx("path", { d: "M108.7 64.4c-1.6-1.2-3.8-1.9-6-1.9-.1-3.6-.2-7.2-.2-10.7-.1-9.5-.1-19.3-2.6-28.6 6.5-2.5 6.2-7.6 5.9-9.2-.7-3.8-4-7.9-9-7.9-1.9 0-3.9.6-5.8 1.9C83.4 1.6 73 .5 62.5.5 53 1.3 46.4 2.8 41 5.4c-2.3 1.1-4.2 2.4-6 3.9-1.8-1.1-3.7-1.7-5.5-1.7-5.1 0-8.8 4.1-9.4 8.1-.6 4 1.6 7.3 6 8.9-2.2 8.9-1.5 18.1-.7 27 .3 3.7.6 7.6.7 11.4h-.5c-2.3 0-4.6.7-6.3 1.9-.7.5-2.1 2-2 3.3 0 .4.2.9.9 1.3.2 2.1 1.5 2.4 2.3 2.4 1.6 0 3.4-1.1 3.9-1.5.5-.3.9-.5 1.2-.6l.5-.2c-.1 2.2-.3 4.5-.5 7-.9 11.7-2 25 3.9 34.6 1.2 1.9 2.6 3.6 4.3 5.1l-.9.6c-2.7 1.9-6.7 4.7-4.3 8.5v.1c.4.4.6.5.9.5h.1c.3.5.9 1.6 2.4 1.6.6 0 1.3-.2 2-.6 1.1-.6 2.1-1.4 3-2.2 1.5-1.3 3-2.6 5-2.9l.6-.1.7.3c6.4 2.6 12.9 3.3 17.3 3.4h2.6c7.7 0 14.8-1.2 20.5-3.5 1.2-.5 2.4-1.1 3.5-1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1.4.2.9.2 1.5zm4.1-2.7c-.6.7-1.3 1-2 1-.6 0-1.1-.2-1.7-.4-.3-.1-.6-.2-.9-.4-1.1-.4-2.2-.9-3.4-.9h-1.3l-.4.1c-.1 0-.2 0-.3.1-.2 0-.3.1-.5.2-.1 0-.2 0-.2.1l-.8.3c-.1.1-.3.1-.4.1l-.3.1-.3.1c-.2.1-.3.1-.5.1-.1 0-.2 0-.3.1l-.5.1h-.2l-.6.1c-1 0-1.7-.4-2.2-1.3-.6-1-.6-2.3.1-3.5.7-1.2 1.9-2.1 3.1-2.3 1.2 2.5 8.1 2.2 9.9-.2 2 .9 4.2 2.5 4.5 4.2.2.7-.1 1.5-.8 2.3zM58 29.4z" })
470
+ })] });
471
+ if (language_0 === "ruby") return /* @__PURE__ */ jsxs(Fragment, { children: [showLabel ? /* @__PURE__ */ jsx(Fragment, { children: "Ruby" }) : null, /* @__PURE__ */ jsxs("svg", {
472
+ width: size,
473
+ height: size,
474
+ viewBox: "0 0 20 20",
475
+ fill: "none",
476
+ xmlns: "http://www.w3.org/2000/svg",
477
+ className,
478
+ children: [/* @__PURE__ */ jsx("g", {
479
+ clipPath: "url(#clip0_42_2969)",
480
+ children: /* @__PURE__ */ jsx("path", {
481
+ d: "M16.7967 0.0691243C19.3242 0.506624 20.0408 2.23412 19.9875 4.04412L20 4.01829L18.8625 18.925L4.075 19.9383H4.08833C2.86083 19.8866 0.125 19.7741 0 15.9491L1.37083 13.4491L3.72 18.9375L4.13917 19.9141L6.47667 12.2941L6.45167 12.3L6.465 12.275L14.1775 14.7383L13.0142 10.2125L12.1892 6.96246L19.5392 6.48829L19.0267 6.06329L13.75 1.76162L16.7992 0.060791L16.7967 0.0691243ZM4.275 4.22746C7.2425 1.28329 11.0725 -0.456709 12.5433 1.02746C14.0117 2.50829 12.4558 6.11496 9.4825 9.05746C6.51333 12.0008 2.73 13.8358 1.2625 12.355C-0.209167 10.8741 1.3 7.17412 4.2725 4.22996L4.275 4.22746Z",
482
+ fill: "white"
483
+ })
484
+ }), /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("clipPath", {
485
+ id: "clip0_42_2969",
486
+ children: /* @__PURE__ */ jsx("rect", {
487
+ width: "20",
488
+ height: "20",
489
+ fill: "white"
490
+ })
491
+ }) })]
492
+ })] });
493
+ if (language_0 === "php") return /* @__PURE__ */ jsxs(Fragment, { children: [showLabel ? /* @__PURE__ */ jsx(Fragment, { children: "PHP" }) : null, /* @__PURE__ */ jsx("svg", {
494
+ viewBox: "0 0 128 128",
495
+ width: size,
496
+ height: size,
497
+ className,
498
+ children: /* @__PURE__ */ jsx("path", { d: "M64 30.332C28.654 30.332 0 45.407 0 64s28.654 33.668 64 33.668c35.345 0 64-15.075 64-33.668S99.346 30.332 64 30.332zm-5.982 9.81h7.293v.003l-1.745 8.968h6.496c4.087 0 6.908.714 8.458 2.139 1.553 1.427 2.017 2.017 3.737 3.737 5.946 1.719 2.209-2.209 2.209-5.928 0-8.137zm-51.051 51.372c0-3.757-1.072-5.686-3.214-5.791a6.03 6.03 0 00-2.495.409c-.646.231-1.082.461-1.311.692v8.968c1.371.86 2.588 1.26 3.649 1.197 2.247-.148 3.371-1.971 3.371-5.475zm2.643.157c0 1.909-.447 3.493-1.348 4.753-1.003 1.427-2.394 2.16-4.172 2.201-1.34.043-2.721-.378-4.142-1.258v8.151l-2.298-.82V107.14c.377-.462.862-.859 1.451-1.196 1.368-.798 3.031-1.207 4.987-1.228l.033.032c1.788-.022 3.166.712 4.134 2.201.902 1.366 1.355 3.117 1.355 5.257zm14.049 5.349c0 2.56-.257 4.333-.77 5.318-.516.986-1.497 1.773-2.945 2.359-1.174.463-2.444.714-3.808.757l-.38-1.448c1.386-.188 2.362-.378 2.928-.566 1.114-.377 1.878-.955 2.298-1.73.337-.631.503-1.835.503-3.618v-.599a11.809 11.809 0 01-4.941 1.068c-1.132 0-2.13-.354-2.99-1.068-.966-.777-1.449-1.764-1.449-2.958v-9.566l2.299-.787v9.63c0 1.028.332 1.82.996 2.376s1.524.822 2.578.803c1.054-.022 2.183-.431 3.382-1.228v-11.234h2.299v12.491zm8.973 1.479a9.457 9.457 0 01-.757.032c-1.3 0-2.314-.309-3.038-.93-.722-.622-1.084-1.479-1.084-2.573v-9.054h-1.574v-1.446h1.574v-3.84l2.296-.817v4.657h2.583v1.446h-2.583v8.991c0 .862.231 1.474.694 1.83.397.295 1.029.463 1.889.506v1.198zm13.917-.189h-2.298v-8.873c0-.902-.211-1.68-.631-2.329-.485-.734-1.159-1.102-2.024-1.102-1.054 0-2.372.556-3.954 1.668v10.636h-2.298V97.637l2.298-.725v9.659c1.469-1.068 3.073-1.604 4.816-1.604 1.218 0 2.203.41 2.958 1.228.757.817 1.134 1.836 1.134 3.053v9.597h-.001zm12.218-7.157c0-1.444-.274-2.636-.82-3.579-.649-1.149-1.657-1.756-3.021-1.818-2.52.146-3.778 1.951-3.778 5.412 0 1.587.262 2.912.79 3.976.674 1.356 1.685 2.024 3.033 2.002 2.531-.02 3.796-2.017 3.796-5.993zm2.518.015c0 2.055-.526 3.765-1.575 5.131-1.154 1.528-2.749 2.296-4.783 2.296-2.017 0-3.589-.768-4.723-2.296-1.028-1.366-1.542-3.076-1.542-5.131 0-1.932.556-3.556 1.668-4.879 1.174-1.403 2.718-2.107 4.627-2.107 1.909 0 3.463.704 4.66 2.107 1.111 1.323 1.668 2.947 1.668 4.879zm13.178 7.142h-2.299v-9.376c0-1.028-.31-1.831-.928-2.409-.619-.576-1.443-.855-2.472-.833-1.091.021-2.13.378-3.116 1.069v11.549h-2.299v-11.833c1.323-.963 2.54-1.592 3.652-1.886 1.049-.274 1.974-.41 2.771-.41.545 0 1.059.053 1.542.158.903.209 1.637.596 2.203 1.164.631.629.946 1.384.946 2.267v10.54z" })
499
+ })] });
500
+ };
501
+ $[0] = className;
502
+ $[1] = showLabel;
503
+ $[2] = size;
504
+ $[3] = t3;
505
+ } else t3 = $[3];
506
+ const renderIcon = t3;
507
+ const t4 = !showLabel;
508
+ let t5;
509
+ if ($[4] !== showLabel || $[5] !== t4) {
510
+ t5 = cn("text-muted-foreground", {
511
+ "text-sm flex items-center justify-center flex-row gap-2": showLabel,
512
+ "font-mono text-xs": t4
513
+ });
514
+ $[4] = showLabel;
515
+ $[5] = t4;
516
+ $[6] = t5;
517
+ } else t5 = $[6];
518
+ let t6;
519
+ if ($[7] !== language || $[8] !== renderIcon) {
520
+ t6 = renderIcon(language);
521
+ $[7] = language;
522
+ $[8] = renderIcon;
523
+ $[9] = t6;
524
+ } else t6 = $[9];
525
+ let t7;
526
+ if ($[10] !== t5 || $[11] !== t6) {
527
+ t7 = /* @__PURE__ */ jsx("div", {
528
+ className: t5,
529
+ children: t6
530
+ });
531
+ $[10] = t5;
532
+ $[11] = t6;
533
+ $[12] = t7;
534
+ } else t7 = $[12];
535
+ return t7;
536
+ };
537
+
538
+ //#endregion
539
+ //#region src/publicComponents/base-node/code-display.tsx
540
+ const codeTagProps = { style: {
541
+ fontFamily: "DM Mono, monospace",
542
+ fontSize: "16px"
543
+ } };
544
+ const customStyle = {
545
+ margin: 0,
546
+ borderRadius: 0,
547
+ padding: 0
548
+ };
549
+ const isHighlighted = (lines, lineNumber) => {
550
+ return lines.some((line) => {
551
+ const [start, end] = line.split("-").map((num) => parseInt(num, 10));
552
+ if (end !== void 0) return lineNumber >= start && lineNumber <= end;
553
+ return lineNumber == start;
554
+ });
555
+ };
556
+ const getFirstLineNumber = (line) => {
557
+ const [start] = line.split("-").map((num) => parseInt(num, 10));
558
+ return start;
559
+ };
560
+ const CodeDisplay = (t0) => {
561
+ const $ = c(21);
562
+ const { code, language, features } = t0;
563
+ const themeStyle = useThemeStore(_temp) === "dark" ? oneDark : oneLight;
564
+ let t1;
565
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
566
+ t1 = [];
567
+ $[0] = t1;
568
+ } else t1 = $[0];
569
+ const [highlightedLines, setHighlightedLines] = useState(t1);
570
+ const [selectedFeature, setSelectedFeature] = useState(null);
571
+ const ref = useRef(null);
572
+ const handleFeatureClick = (feature) => {
573
+ setSelectedFeature(feature);
574
+ setHighlightedLines(feature.lines);
575
+ const lineNumber = getFirstLineNumber(feature.lines[0]);
576
+ const line = ref.current?.querySelector(`[data-line-number="${lineNumber}"]`);
577
+ if (line) line.scrollIntoView({
578
+ behavior: "smooth",
579
+ block: "center"
580
+ });
581
+ };
582
+ const t2 = "flex flex-col h-full overflow-hidden";
583
+ let t3;
584
+ let t4;
585
+ if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
586
+ t3 = /* @__PURE__ */ jsx("div", {
587
+ className: "text-sm text-muted-foreground",
588
+ children: "Read only"
589
+ });
590
+ t4 = /* @__PURE__ */ jsx("div", { className: "flex-1" });
591
+ $[1] = t3;
592
+ $[2] = t4;
593
+ } else {
594
+ t3 = $[1];
595
+ t4 = $[2];
596
+ }
597
+ let t5;
598
+ if ($[3] !== language) {
599
+ t5 = /* @__PURE__ */ jsxs("div", {
600
+ className: "flex items-center py-2 px-5 dark:bg-[#1e1e1e] gap-2 justify-center",
601
+ children: [
602
+ t3,
603
+ t4,
604
+ /* @__PURE__ */ jsx(LanguageIndicator, {
605
+ language,
606
+ className: "w-4 h-4",
607
+ size: 16,
608
+ showLabel: true
609
+ })
610
+ ]
611
+ });
612
+ $[3] = language;
613
+ $[4] = t5;
614
+ } else t5 = $[4];
615
+ const t6 = "flex flex-row h-[calc(100%-36px)]";
616
+ const t7 = features && features.length > 0 && /* @__PURE__ */ jsx("div", {
617
+ className: "flex flex-col gap-2 p-2 bg-card overflow-y-auto min-w-[200px] w-[300px]",
618
+ children: features.map((feature_0, index) => /* @__PURE__ */ jsx(FeatureCard, {
619
+ feature: feature_0,
620
+ highlighted: selectedFeature === feature_0,
621
+ onClick: () => handleFeatureClick(feature_0),
622
+ onHover: () => handleFeatureClick(feature_0)
623
+ }, index))
624
+ });
625
+ let t8;
626
+ if ($[5] !== highlightedLines) {
627
+ t8 = (lineNumber_0) => {
628
+ if (isHighlighted(highlightedLines, lineNumber_0)) return {
629
+ "data-line-number": lineNumber_0,
630
+ style: {
631
+ borderLeft: "2px solid var(--accent-1000)",
632
+ backgroundColor: "rgb(from var(--accent-1000) r g b / 0.2)"
633
+ }
634
+ };
635
+ return {
636
+ "data-line-number": lineNumber_0,
637
+ style: { borderLeft: "2px solid transparent" }
638
+ };
639
+ };
640
+ $[5] = highlightedLines;
641
+ $[6] = t8;
642
+ } else t8 = $[6];
643
+ let t9;
644
+ if ($[7] !== code || $[8] !== language || $[9] !== t8 || $[10] !== themeStyle) {
645
+ t9 = /* @__PURE__ */ jsx(Prism, {
646
+ showLineNumbers: true,
647
+ language,
648
+ style: themeStyle,
649
+ codeTagProps,
650
+ customStyle,
651
+ wrapLines: true,
652
+ lineProps: t8,
653
+ children: code
654
+ });
655
+ $[7] = code;
656
+ $[8] = language;
657
+ $[9] = t8;
658
+ $[10] = themeStyle;
659
+ $[11] = t9;
660
+ } else t9 = $[11];
661
+ let t10;
662
+ if ($[12] !== ref || $[13] !== t9) {
663
+ t10 = /* @__PURE__ */ jsx("div", {
664
+ className: "overflow-y-auto",
665
+ ref,
666
+ children: t9
667
+ });
668
+ $[12] = ref;
669
+ $[13] = t9;
670
+ $[14] = t10;
671
+ } else t10 = $[14];
672
+ let t11;
673
+ if ($[15] !== t10 || $[16] !== t7) {
674
+ t11 = /* @__PURE__ */ jsxs("div", {
675
+ className: t6,
676
+ children: [t7, t10]
677
+ });
678
+ $[15] = t10;
679
+ $[16] = t7;
680
+ $[17] = t11;
681
+ } else t11 = $[17];
682
+ let t12;
683
+ if ($[18] !== t11 || $[19] !== t5) {
684
+ t12 = /* @__PURE__ */ jsxs("div", {
685
+ className: t2,
686
+ children: [t5, t11]
687
+ });
688
+ $[18] = t11;
689
+ $[19] = t5;
690
+ $[20] = t12;
691
+ } else t12 = $[20];
692
+ return t12;
693
+ };
694
+ function _temp(state) {
695
+ return state.theme;
696
+ }
697
+
698
+ //#endregion
699
+ //#region src/publicComponents/base-node/node-sidebar.tsx
700
+ const NodeSidebar = (t0) => {
701
+ const $ = c(13);
702
+ const { content, title, subtitle, language, isOpen, onClose, features } = t0;
703
+ if (!isOpen) return null;
704
+ let t1;
705
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
706
+ t1 = /* @__PURE__ */ jsx(X, {});
707
+ $[0] = t1;
708
+ } else t1 = $[0];
709
+ let t2;
710
+ if ($[1] !== onClose) {
711
+ t2 = [{
712
+ icon: t1,
713
+ onClick: onClose,
714
+ label: "Close"
715
+ }];
716
+ $[1] = onClose;
717
+ $[2] = t2;
718
+ } else t2 = $[2];
719
+ let t3;
720
+ if ($[3] !== content || $[4] !== features || $[5] !== language) {
721
+ t3 = /* @__PURE__ */ jsx(CodeDisplay, {
722
+ code: content,
723
+ language,
724
+ features
725
+ });
726
+ $[3] = content;
727
+ $[4] = features;
728
+ $[5] = language;
729
+ $[6] = t3;
730
+ } else t3 = $[6];
731
+ let t4;
732
+ if ($[7] !== onClose || $[8] !== subtitle || $[9] !== t2 || $[10] !== t3 || $[11] !== title) {
733
+ t4 = /* @__PURE__ */ jsx(Sidebar, {
734
+ title,
735
+ subtitle,
736
+ initialWidth: 900,
737
+ contentClassName: "p-0 h-full gap-0",
738
+ onClose,
739
+ actions: t2,
740
+ children: t3
741
+ });
742
+ $[7] = onClose;
743
+ $[8] = subtitle;
744
+ $[9] = t2;
745
+ $[10] = t3;
746
+ $[11] = title;
747
+ $[12] = t4;
748
+ } else t4 = $[12];
749
+ return t4;
750
+ };
751
+
752
+ //#endregion
753
+ //#region src/publicComponents/base-node/base-node.tsx
754
+ const BaseNode = (t0) => {
755
+ const $ = c(56);
756
+ const { title, variant, children, disableSourceHandle, disableTargetHandle, language, subtitle, data } = t0;
757
+ const [isOpen, setIsOpen] = useState(false);
758
+ const { sourcePosition, targetPosition, toggleTargetPosition, toggleSourcePosition } = useHandlePositions(data);
759
+ const [content, setContent] = useState(null);
760
+ let t1;
761
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
762
+ t1 = [];
763
+ $[0] = t1;
764
+ } else t1 = $[0];
765
+ const [features, setFeatures] = useState(t1);
766
+ let t2;
767
+ if ($[1] !== data.id) {
768
+ t2 = async () => {
769
+ const responseData = await (await fetch(`/__motia/step/${data.id}`)).json();
770
+ setContent(responseData.content);
771
+ setFeatures(responseData.features);
772
+ };
773
+ $[1] = data.id;
774
+ $[2] = t2;
775
+ } else t2 = $[2];
776
+ const fetchContent = t2;
777
+ let t3;
778
+ let t4;
779
+ if ($[3] !== data.id || $[4] !== fetchContent || $[5] !== isOpen) {
780
+ t3 = () => {
781
+ if (data.id && isOpen) fetchContent();
782
+ };
783
+ t4 = [
784
+ data.id,
785
+ isOpen,
786
+ fetchContent
787
+ ];
788
+ $[3] = data.id;
789
+ $[4] = fetchContent;
790
+ $[5] = isOpen;
791
+ $[6] = t3;
792
+ $[7] = t4;
793
+ } else {
794
+ t3 = $[6];
795
+ t4 = $[7];
796
+ }
797
+ useEffect(t3, t4);
798
+ let t5;
799
+ if ($[8] !== isOpen) {
800
+ t5 = cn("p-1 rounded-lg max-w-[350px]", { "bg-muted-foreground/20": isOpen });
801
+ $[8] = isOpen;
802
+ $[9] = t5;
803
+ } else t5 = $[9];
804
+ let t6;
805
+ if ($[10] !== title) {
806
+ t6 = title?.toLowerCase().replace(/ /g, "-");
807
+ $[10] = title;
808
+ $[11] = t6;
809
+ } else t6 = $[11];
810
+ const t7 = `node-${t6}`;
811
+ let t8;
812
+ if ($[12] !== title) {
813
+ t8 = title?.toLowerCase();
814
+ $[12] = title;
815
+ $[13] = t8;
816
+ } else t8 = $[13];
817
+ const t9 = `open-code-preview-button-${t8}`;
818
+ let t10;
819
+ let t11;
820
+ if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
821
+ t10 = () => setIsOpen(true);
822
+ t11 = /* @__PURE__ */ jsx(ScanSearch, { className: "w-4 h-4" });
823
+ $[14] = t10;
824
+ $[15] = t11;
825
+ } else {
826
+ t10 = $[14];
827
+ t11 = $[15];
828
+ }
829
+ let t12;
830
+ if ($[16] !== t9) {
831
+ t12 = /* @__PURE__ */ jsx("div", {
832
+ className: "flex justify-end",
833
+ children: /* @__PURE__ */ jsx(Button, {
834
+ "data-testid": t9,
835
+ variant: "ghost",
836
+ className: "h-5 p-0.5",
837
+ onClick: t10,
838
+ children: t11
839
+ })
840
+ });
841
+ $[16] = t9;
842
+ $[17] = t12;
843
+ } else t12 = $[17];
844
+ let t13;
845
+ if ($[18] !== t12 || $[19] !== title || $[20] !== variant) {
846
+ t13 = /* @__PURE__ */ jsx(NodeHeader, {
847
+ text: title,
848
+ variant,
849
+ className: "border-b-2 border-muted-foreground/10",
850
+ children: t12
851
+ });
852
+ $[18] = t12;
853
+ $[19] = title;
854
+ $[20] = variant;
855
+ $[21] = t13;
856
+ } else t13 = $[21];
857
+ let t14;
858
+ if ($[22] !== subtitle) {
859
+ t14 = subtitle && /* @__PURE__ */ jsx("div", {
860
+ className: "py-4 px-6 text-sm text-muted-foreground",
861
+ children: subtitle
862
+ });
863
+ $[22] = subtitle;
864
+ $[23] = t14;
865
+ } else t14 = $[23];
866
+ let t15;
867
+ if ($[24] !== children || $[25] !== variant) {
868
+ t15 = children && /* @__PURE__ */ jsx("div", {
869
+ className: "p-2",
870
+ children: /* @__PURE__ */ jsx("div", {
871
+ className: cn("space-y-3 p-4 text-sm text-muted-foreground", { "bg-card": variant !== "noop" }),
872
+ children
873
+ })
874
+ });
875
+ $[24] = children;
876
+ $[25] = variant;
877
+ $[26] = t15;
878
+ } else t15 = $[26];
879
+ let t16;
880
+ if ($[27] !== disableTargetHandle || $[28] !== targetPosition || $[29] !== toggleTargetPosition) {
881
+ t16 = !disableTargetHandle && /* @__PURE__ */ jsx(BaseHandle, {
882
+ type: "target",
883
+ position: targetPosition,
884
+ onTogglePosition: toggleTargetPosition
885
+ });
886
+ $[27] = disableTargetHandle;
887
+ $[28] = targetPosition;
888
+ $[29] = toggleTargetPosition;
889
+ $[30] = t16;
890
+ } else t16 = $[30];
891
+ let t17;
892
+ if ($[31] !== disableSourceHandle || $[32] !== sourcePosition || $[33] !== toggleSourcePosition) {
893
+ t17 = !disableSourceHandle && /* @__PURE__ */ jsx(BaseHandle, {
894
+ type: "source",
895
+ position: sourcePosition,
896
+ onTogglePosition: toggleSourcePosition
897
+ });
898
+ $[31] = disableSourceHandle;
899
+ $[32] = sourcePosition;
900
+ $[33] = toggleSourcePosition;
901
+ $[34] = t17;
902
+ } else t17 = $[34];
903
+ let t18;
904
+ if ($[35] !== t13 || $[36] !== t14 || $[37] !== t15 || $[38] !== t16 || $[39] !== t17) {
905
+ t18 = /* @__PURE__ */ jsxs("div", {
906
+ className: "group relative",
907
+ children: [
908
+ t13,
909
+ t14,
910
+ t15,
911
+ t16,
912
+ t17
913
+ ]
914
+ });
915
+ $[35] = t13;
916
+ $[36] = t14;
917
+ $[37] = t15;
918
+ $[38] = t16;
919
+ $[39] = t17;
920
+ $[40] = t18;
921
+ } else t18 = $[40];
922
+ let t19;
923
+ if ($[41] !== t18 || $[42] !== t7) {
924
+ t19 = /* @__PURE__ */ jsx("div", {
925
+ className: "rounded-lg dark:bg-[#101010] bg-background border-1 border-muted-foreground/30 border-solid",
926
+ "data-testid": t7,
927
+ children: t18
928
+ });
929
+ $[41] = t18;
930
+ $[42] = t7;
931
+ $[43] = t19;
932
+ } else t19 = $[43];
933
+ let t20;
934
+ if ($[44] !== content || $[45] !== features || $[46] !== isOpen || $[47] !== language || $[48] !== subtitle || $[49] !== title || $[50] !== variant) {
935
+ t20 = content && /* @__PURE__ */ jsx(NodeSidebar, {
936
+ features,
937
+ content,
938
+ title,
939
+ subtitle,
940
+ variant,
941
+ language,
942
+ isOpen,
943
+ onClose: () => setIsOpen(false)
944
+ });
945
+ $[44] = content;
946
+ $[45] = features;
947
+ $[46] = isOpen;
948
+ $[47] = language;
949
+ $[48] = subtitle;
950
+ $[49] = title;
951
+ $[50] = variant;
952
+ $[51] = t20;
953
+ } else t20 = $[51];
954
+ let t21;
955
+ if ($[52] !== t19 || $[53] !== t20 || $[54] !== t5) {
956
+ t21 = /* @__PURE__ */ jsxs("div", {
957
+ className: t5,
958
+ children: [t19, t20]
959
+ });
960
+ $[52] = t19;
961
+ $[53] = t20;
962
+ $[54] = t5;
963
+ $[55] = t21;
964
+ } else t21 = $[55];
965
+ return t21;
966
+ };
967
+
968
+ //#endregion
969
+ //#region src/publicComponents/api-node.tsx
970
+ const ApiNode = (t0) => {
971
+ const $ = c(8);
972
+ const { data, children } = t0;
973
+ const t1 = !data.emits?.length && !data.virtualEmits?.length;
974
+ const t2 = !data.subscribes?.length && !data.virtualSubscribes?.length;
975
+ let t3;
976
+ if ($[0] !== data.webhookUrl) {
977
+ t3 = data.webhookUrl && /* @__PURE__ */ jsx("div", {
978
+ className: "flex gap-1 items-center text-muted-foreground",
979
+ children: /* @__PURE__ */ jsx("div", {
980
+ className: "font-mono",
981
+ children: data.webhookUrl
982
+ })
983
+ });
984
+ $[0] = data.webhookUrl;
985
+ $[1] = t3;
986
+ } else t3 = $[1];
987
+ let t4;
988
+ if ($[2] !== children || $[3] !== data || $[4] !== t1 || $[5] !== t2 || $[6] !== t3) {
989
+ t4 = /* @__PURE__ */ jsxs(BaseNode, {
990
+ data,
991
+ variant: "api",
992
+ title: data.name,
993
+ language: data.language,
994
+ subtitle: data.description,
995
+ disableSourceHandle: t1,
996
+ disableTargetHandle: t2,
997
+ children: [t3, children]
998
+ });
999
+ $[2] = children;
1000
+ $[3] = data;
1001
+ $[4] = t1;
1002
+ $[5] = t2;
1003
+ $[6] = t3;
1004
+ $[7] = t4;
1005
+ } else t4 = $[7];
1006
+ return t4;
1007
+ };
1008
+
1009
+ //#endregion
1010
+ //#region src/publicComponents/event-node.tsx
1011
+ const EventNode = (t0) => {
1012
+ const $ = c(5);
1013
+ const { data, children } = t0;
1014
+ const t1 = !data.emits?.length && !data.virtualEmits?.length;
1015
+ const t2 = !data.subscribes?.length && !data.virtualSubscribes?.length;
1016
+ let t3;
1017
+ if ($[0] !== children || $[1] !== data || $[2] !== t1 || $[3] !== t2) {
1018
+ t3 = /* @__PURE__ */ jsx(BaseNode, {
1019
+ data,
1020
+ variant: "event",
1021
+ title: data.name,
1022
+ subtitle: data.description,
1023
+ language: data.language,
1024
+ disableSourceHandle: t1,
1025
+ disableTargetHandle: t2,
1026
+ children
1027
+ });
1028
+ $[0] = children;
1029
+ $[1] = data;
1030
+ $[2] = t1;
1031
+ $[3] = t2;
1032
+ $[4] = t3;
1033
+ } else t3 = $[4];
1034
+ return t3;
1035
+ };
1036
+
1037
+ //#endregion
1038
+ //#region src/publicComponents/noop-node.tsx
1039
+ const NoopNode = (t0) => {
1040
+ const $ = c(5);
1041
+ const { data, children } = t0;
1042
+ const t1 = !data.virtualEmits.length;
1043
+ const t2 = !data.subscribes?.length;
1044
+ let t3;
1045
+ if ($[0] !== children || $[1] !== data || $[2] !== t1 || $[3] !== t2) {
1046
+ t3 = /* @__PURE__ */ jsx(BaseNode, {
1047
+ data,
1048
+ variant: "noop",
1049
+ title: data.name,
1050
+ subtitle: data.description,
1051
+ disableSourceHandle: t1,
1052
+ disableTargetHandle: t2,
1053
+ children
1054
+ });
1055
+ $[0] = children;
1056
+ $[1] = data;
1057
+ $[2] = t1;
1058
+ $[3] = t2;
1059
+ $[4] = t3;
1060
+ } else t3 = $[4];
1061
+ return t3;
1062
+ };
1063
+
1064
+ //#endregion
1065
+ export { ApiNode, BaseHandle, BaseNode, EventNode, NoopNode, Position, workbenchXPath };