@notmrabhi/flowforge 0.1.21 → 0.1.23

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 (53) hide show
  1. package/dist/GatewayBranchEdge-9YF32wwN.js +1 -0
  2. package/dist/GatewayBranchEdge-Dxoy5B1A.js +1264 -0
  3. package/dist/SchemaBuilderDrawer-157p-2Vj.js +1136 -0
  4. package/dist/SchemaBuilderDrawer-Wje7pVrn.js +1 -0
  5. package/dist/bpmn-CcuE2X_Q.js +2 -0
  6. package/dist/bpmn-CtfWDaOY.js +33 -0
  7. package/dist/canvas.cjs +1 -0
  8. package/dist/canvas.d.ts +809 -0
  9. package/dist/canvas.js +28 -0
  10. package/dist/canvasTokens-CAD6G24b.js +32 -0
  11. package/dist/canvasTokens-gKNYrPl4.js +1 -0
  12. package/dist/core.cjs +1 -0
  13. package/dist/core.d.ts +374 -0
  14. package/dist/core.js +24 -0
  15. package/dist/defaultUi.cjs +1 -0
  16. package/dist/defaultUi.d.ts +83 -0
  17. package/dist/defaultUi.js +18 -0
  18. package/dist/form.cjs +1 -0
  19. package/dist/form.d.ts +857 -0
  20. package/dist/form.js +44 -0
  21. package/dist/index-B31-Y5uO.js +11 -0
  22. package/dist/index-B3aHpb84.js +13 -0
  23. package/dist/index-BU09HbVh.js +10176 -0
  24. package/dist/index-BnzttJ4w.js +13758 -0
  25. package/dist/index-BysKSEtZ.js +1 -0
  26. package/dist/index-CQ0cVcHp.js +2 -0
  27. package/dist/index-CkjEllpd.js +1 -0
  28. package/dist/index-Codx5QwP.js +41 -0
  29. package/dist/index-Cw9DC-tf.js +76 -0
  30. package/dist/index-CzPi8KQC.js +1310 -0
  31. package/dist/index-D14V8rKX.js +1 -0
  32. package/dist/index-Da5NHCS2.js +8132 -0
  33. package/dist/index-a1IOaYsW.js +9 -0
  34. package/dist/index-a3QMaedZ.js +2553 -0
  35. package/dist/index-gtgq_241.js +3 -0
  36. package/dist/index-l6kvDx-m.js +1360 -0
  37. package/dist/index-lcviy90e.js +613 -0
  38. package/dist/index-wOnYb3DO.js +567 -0
  39. package/dist/index.cjs +1 -0
  40. package/dist/index.d.ts +1409 -0
  41. package/dist/index.js +107 -0
  42. package/dist/messages-CO299wPN.js +22 -0
  43. package/dist/messages-O9Tw_XXR.js +1 -0
  44. package/dist/nodeRegistry.cjs +1 -0
  45. package/dist/nodeRegistry.d.ts +334 -0
  46. package/dist/nodeRegistry.js +555 -0
  47. package/dist/style.css +6 -0
  48. package/dist/templateRegistry.cjs +1 -0
  49. package/dist/templateRegistry.d.ts +83 -0
  50. package/dist/templateRegistry.js +43 -0
  51. package/dist/templateSkeletons-D2ecxpVH.js +2954 -0
  52. package/dist/templateSkeletons-D5dYuslG.js +1 -0
  53. package/package.json +1 -1
@@ -0,0 +1,1264 @@
1
+ import { jsxs as n, jsx as e, Fragment as R } from "react/jsx-runtime";
2
+ import { Handle as b, Position as x, getStraightPath as K, BaseEdge as _ } from "reactflow";
3
+ import { Tooltip as D, Chip as H } from "@mui/material";
4
+ import { GrTrigger as de } from "react-icons/gr";
5
+ import { createContext as ae, useContext as pe } from "react";
6
+ import { d as ge } from "./messages-CO299wPN.js";
7
+ import { MdOutlineModeEdit as T, MdInfoOutline as W, MdInput as oe, MdDeleteOutline as P, MdCheckCircle as he, MdPeople as ye, MdSchedule as ue, MdWebhook as ie, MdNotifications as M, MdSms as me, MdEmail as be, MdContentCopy as xe, MdHttp as Ne, MdCallSplit as ke, MdAccountTree as ve, MdOpenInNew as we } from "react-icons/md";
8
+ import { FaCheckCircle as le, FaTimesCircle as re } from "react-icons/fa";
9
+ import { FiFilter as Se } from "react-icons/fi";
10
+ import { a as F, H as Ee, B as U } from "./canvasTokens-CAD6G24b.js";
11
+ const Ce = ae({
12
+ onEditNode: () => {
13
+ },
14
+ onDeleteNode: () => {
15
+ },
16
+ onAddStep: () => {
17
+ },
18
+ onClickAddTrigger: () => {
19
+ },
20
+ messages: ge,
21
+ nodeRegistry: null,
22
+ nodeBody: "full"
23
+ }), E = () => pe(Ce), Te = () => /* @__PURE__ */ n("div", { style: { width: 350, display: "flex", justifyContent: "center" }, children: [
24
+ /* @__PURE__ */ e(b, { type: "source", position: x.Bottom, style: { opacity: 0, left: "50%" } }),
25
+ /* @__PURE__ */ e("div", { style: { padding: "8px 28px", borderRadius: 999, background: "#f5f5f5", border: "1.5px solid #bdbdbd", fontSize: 13, fontWeight: 500, color: "#424242", userSelect: "none" }, children: "Start" })
26
+ ] }), ze = () => /* @__PURE__ */ n("div", { style: { width: 350, display: "flex", justifyContent: "center" }, children: [
27
+ /* @__PURE__ */ e(b, { type: "target", position: x.Top, style: { opacity: 0, left: "50%" } }),
28
+ /* @__PURE__ */ e("div", { style: { padding: "8px 28px", borderRadius: 999, background: "#f5f5f5", border: "1.5px solid #bdbdbd", fontSize: 13, fontWeight: 500, color: "#424242", userSelect: "none" }, children: "End" })
29
+ ] }), Ie = () => {
30
+ const { onClickAddTrigger: t, messages: r } = E();
31
+ return /* @__PURE__ */ n("div", { style: { width: 350, display: "flex", justifyContent: "center" }, children: [
32
+ /* @__PURE__ */ e(b, { type: "target", position: x.Top, style: { opacity: 0, left: "50%" } }),
33
+ /* @__PURE__ */ e(D, { title: r.addTriggerTooltip, placement: "top", arrow: !0, children: /* @__PURE__ */ n(
34
+ "div",
35
+ {
36
+ onClick: t,
37
+ role: "button",
38
+ tabIndex: 0,
39
+ onKeyDown: (f) => {
40
+ f.key === "Enter" && t();
41
+ },
42
+ style: { padding: "10px 24px", borderRadius: 8, border: "1.5px dashed #d0d0d0", background: "#fff", cursor: "pointer", display: "flex", alignItems: "center", justifyContent: "center", gap: 8 },
43
+ children: [
44
+ /* @__PURE__ */ e(de, { size: 16 }),
45
+ /* @__PURE__ */ e("span", { className: "ff-text-black", style: { fontSize: 13 }, "data-testid": "add-trigger-btn-text", children: r.addTriggerButton })
46
+ ]
47
+ }
48
+ ) }),
49
+ /* @__PURE__ */ e(b, { type: "source", position: x.Bottom, style: { opacity: 0, left: "50%" } })
50
+ ] });
51
+ }, Pe = ({ id: t }) => {
52
+ const { onAddStep: r } = E();
53
+ return /* @__PURE__ */ n(
54
+ "div",
55
+ {
56
+ onClick: () => r(t),
57
+ role: "button",
58
+ tabIndex: 0,
59
+ onKeyDown: (f) => {
60
+ f.key === "Enter" && r(t);
61
+ },
62
+ style: { width: 28, height: 28, borderRadius: "50%", border: "1.5px solid #9e9e9e", background: "#fff", display: "flex", alignItems: "center", justifyContent: "center", cursor: "pointer", fontSize: 18, color: "#757575", lineHeight: 1, userSelect: "none" },
63
+ children: [
64
+ /* @__PURE__ */ e(b, { type: "target", position: x.Top, style: { opacity: 0 } }),
65
+ "+",
66
+ /* @__PURE__ */ e(b, { type: "source", position: x.Bottom, style: { opacity: 0 } })
67
+ ]
68
+ }
69
+ );
70
+ };
71
+ function se(t) {
72
+ return t ? t.replace(/[_-]+/g, " ").toLowerCase().replace(/\b\w/g, (r) => r.toUpperCase()) : "";
73
+ }
74
+ function De(t) {
75
+ if (typeof t != "string" && t.label) return t.label;
76
+ const r = typeof t == "string" ? t : t.value ?? "";
77
+ return se(r);
78
+ }
79
+ const Ae = ({ data: t }) => {
80
+ const { onClickAddTrigger: r } = E(), {
81
+ type: f,
82
+ eventType: a,
83
+ sources: s,
84
+ label: l,
85
+ source: g,
86
+ previewWorkflow: o,
87
+ executionStatus: i,
88
+ infoText: d = "This node decides the flow trigger type and configuration."
89
+ } = t ?? {}, y = (m) => {
90
+ m == null || m.stopPropagation(), r();
91
+ }, h = Array.isArray(s) && s.length > 0, N = !!(l || g), p = f === "scheduler" ? "Scheduler Trigger" : f === "event" || h || N ? "Event Trigger Source" : "Select Trigger", c = (() => {
92
+ if (f === "scheduler")
93
+ return /* @__PURE__ */ e("span", { children: "Scheduler to be configured" });
94
+ if (f === "event" || h) {
95
+ const m = l || se(a);
96
+ return /* @__PURE__ */ n("div", { children: [
97
+ /* @__PURE__ */ n("div", { className: "ff-d-flex ff-align-items-center", children: [
98
+ /* @__PURE__ */ e("span", { style: { fontWeight: 600 }, children: m }),
99
+ /* @__PURE__ */ e("span", { className: "ff-ms-2 ff-text-muted", style: { fontSize: 12 }, children: "via" })
100
+ ] }),
101
+ /* @__PURE__ */ e("div", { className: "ff-d-flex ff-flex-wrap ff-mt-2", style: { gap: 4 }, children: h ? s.map((w, k) => /* @__PURE__ */ e(
102
+ H,
103
+ {
104
+ label: De(w),
105
+ variant: "outlined",
106
+ size: "small",
107
+ className: "ff-text-dark"
108
+ },
109
+ k
110
+ )) : /* @__PURE__ */ e("span", { className: "ff-text-muted", style: { fontSize: 12 }, children: "No source selected" }) })
111
+ ] });
112
+ }
113
+ return N ? /* @__PURE__ */ n("div", { className: "ff-d-flex ff-flex-wrap ff-align-items-center", style: { gap: 6 }, children: [
114
+ l && /* @__PURE__ */ e("span", { style: { fontWeight: 600 }, children: l }),
115
+ g && /* @__PURE__ */ e(H, { label: g, variant: "outlined", size: "small" })
116
+ ] }) : /* @__PURE__ */ e(
117
+ "span",
118
+ {
119
+ role: "button",
120
+ tabIndex: 0,
121
+ onClick: y,
122
+ onKeyDown: (m) => {
123
+ (m.key === "Enter" || m.key === " ") && y(m);
124
+ },
125
+ style: { cursor: "pointer", color: "#1e88e5" },
126
+ children: "Click to select a trigger to start your workflow"
127
+ }
128
+ );
129
+ })(), v = i ? /* @__PURE__ */ n(R, { children: [
130
+ i.status === "success" && /* @__PURE__ */ e(le, { size: 16, color: "#1DBF60", style: { marginRight: 8 } }),
131
+ i.status === "failed" && /* @__PURE__ */ e(re, { size: 16, color: "#f44336", style: { marginRight: 8 } })
132
+ ] }) : /* @__PURE__ */ n("div", { className: "ff-d-flex ff-align-items-center", children: [
133
+ !o && /* @__PURE__ */ e(
134
+ "div",
135
+ {
136
+ role: "button",
137
+ tabIndex: 0,
138
+ onClick: y,
139
+ onKeyDown: (m) => {
140
+ (m.key === "Enter" || m.key === " ") && y(m);
141
+ },
142
+ className: "ff-me-2",
143
+ style: { cursor: "pointer", color: "#212121" },
144
+ "aria-label": "Edit trigger",
145
+ children: /* @__PURE__ */ e(T, { size: 16 })
146
+ }
147
+ ),
148
+ /* @__PURE__ */ e(D, { title: /* @__PURE__ */ e("div", { children: d }), placement: "right", arrow: !0, children: /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(W, { color: "gray", size: 16 }) }) })
149
+ ] });
150
+ return /* @__PURE__ */ n("div", { style: { width: 350 }, children: [
151
+ /* @__PURE__ */ e(b, { type: "target", position: x.Top, style: { opacity: 0 } }),
152
+ /* @__PURE__ */ n("div", { style: { border: "1.5px solid #a5d6a7", borderRadius: 8, background: "#fff", overflow: "hidden" }, children: [
153
+ /* @__PURE__ */ n("div", { className: "ff-d-flex ff-justify-content-between ff-align-items-center", style: { padding: "10px 6px" }, children: [
154
+ /* @__PURE__ */ n("div", { className: "ff-d-flex ff-align-items-center ff-gap-2", children: [
155
+ /* @__PURE__ */ e(
156
+ "div",
157
+ {
158
+ style: {
159
+ width: 28,
160
+ height: 28,
161
+ borderRadius: 6,
162
+ background: "rgba(76,175,80,0.1)",
163
+ display: "flex",
164
+ alignItems: "center",
165
+ justifyContent: "center",
166
+ flexShrink: 0
167
+ },
168
+ children: /* @__PURE__ */ e(oe, { size: 16, color: "#388e3c" })
169
+ }
170
+ ),
171
+ /* @__PURE__ */ e("span", { style: { fontSize: 14, fontWeight: 500, color: "#212121" }, children: p })
172
+ ] }),
173
+ /* @__PURE__ */ e("div", { className: "ff-d-flex ff-align-items-center", children: v })
174
+ ] }),
175
+ /* @__PURE__ */ e(
176
+ "div",
177
+ {
178
+ style: {
179
+ background: "#f5f5f5",
180
+ fontSize: 12,
181
+ color: "#212121",
182
+ padding: "10px 6px",
183
+ margin: "0 6px 10px",
184
+ borderRadius: 6
185
+ },
186
+ children: c
187
+ }
188
+ )
189
+ ] }),
190
+ /* @__PURE__ */ e(b, { type: "source", position: x.Bottom, style: { opacity: 0 }, id: "1" })
191
+ ] });
192
+ };
193
+ function Le(t) {
194
+ return t ? t === "END_USER_CREATION" ? "New User Registration" : t === "END_USER_UPDATION" ? "On User Update" : t.replace(/[_-]+/g, " ").replace(/\b\w/g, (r) => r.toUpperCase()) : "";
195
+ }
196
+ function Re(t) {
197
+ const r = typeof t == "string" ? t : t.value ?? "";
198
+ return r === "SIGNUP_FLOW" ? "User Self-Registration" : r === "ADMIN_CREATION_FLOW" ? "Create User via Admin Portal" : r === "SHEDULAR" || r === "SCHEDULER" ? "Scheduler" : typeof t != "string" && t.label ? t.label : r.replace(/[_-]+/g, " ").replace(/\b\w/g, (f) => f.toUpperCase());
199
+ }
200
+ const We = ({ data: t }) => {
201
+ const {
202
+ header: r = "Event",
203
+ title: f,
204
+ eventType: a,
205
+ sources: s,
206
+ executionStatus: l,
207
+ infoText: g = "This event is raised by the system. It cannot be configured."
208
+ } = t ?? {}, o = f ?? Le(a) ?? "—";
209
+ return /* @__PURE__ */ n("div", { style: { width: 350 }, children: [
210
+ /* @__PURE__ */ e(b, { type: "target", position: x.Top, style: { opacity: 0 } }),
211
+ /* @__PURE__ */ n("div", { style: { border: "1.5px solid #a5d6a7", borderRadius: 8, background: "#fff", overflow: "hidden" }, children: [
212
+ /* @__PURE__ */ n("div", { className: "ff-d-flex ff-justify-content-between ff-align-items-center", style: { padding: "10px 6px" }, children: [
213
+ /* @__PURE__ */ n("div", { className: "ff-d-flex ff-align-items-center ff-gap-2", children: [
214
+ /* @__PURE__ */ e(
215
+ "div",
216
+ {
217
+ style: {
218
+ width: 28,
219
+ height: 28,
220
+ borderRadius: 6,
221
+ background: "rgba(76,175,80,0.1)",
222
+ display: "flex",
223
+ alignItems: "center",
224
+ justifyContent: "center",
225
+ flexShrink: 0
226
+ },
227
+ children: /* @__PURE__ */ e(oe, { size: 16, color: "#388e3c" })
228
+ }
229
+ ),
230
+ /* @__PURE__ */ e("span", { style: { fontSize: 14, fontWeight: 500, color: "#212121" }, children: r })
231
+ ] }),
232
+ /* @__PURE__ */ n("div", { className: "ff-d-flex ff-align-items-center", children: [
233
+ (l == null ? void 0 : l.status) === "success" && /* @__PURE__ */ e(le, { size: 16, color: "#1DBF60", style: { marginRight: 8 } }),
234
+ (l == null ? void 0 : l.status) === "failed" && /* @__PURE__ */ e(re, { size: 16, color: "#f44336", style: { marginRight: 8 } }),
235
+ !l && /* @__PURE__ */ e(D, { title: /* @__PURE__ */ e("div", { children: g }), placement: "right", arrow: !0, children: /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(W, { color: "gray", size: 16 }) }) })
236
+ ] })
237
+ ] }),
238
+ /* @__PURE__ */ n(
239
+ "div",
240
+ {
241
+ style: {
242
+ background: "#f5f5f5",
243
+ fontSize: 13,
244
+ color: "#212121",
245
+ padding: "10px 12px",
246
+ margin: "0 6px 10px",
247
+ borderRadius: 6
248
+ },
249
+ children: [
250
+ /* @__PURE__ */ e("div", { style: { fontWeight: 600 }, children: o }),
251
+ Array.isArray(s) && s.length > 0 && /* @__PURE__ */ n(R, { children: [
252
+ /* @__PURE__ */ e("div", { className: "ff-text-muted", style: { fontSize: 12, marginTop: 4 }, children: "via" }),
253
+ /* @__PURE__ */ e("div", { className: "ff-d-flex ff-flex-wrap ff-mt-1", style: { gap: 4 }, children: s.map((i, d) => /* @__PURE__ */ e(
254
+ H,
255
+ {
256
+ label: Re(i),
257
+ variant: "outlined",
258
+ size: "small",
259
+ className: "ff-text-dark"
260
+ },
261
+ d
262
+ )) })
263
+ ] })
264
+ ]
265
+ }
266
+ )
267
+ ] }),
268
+ /* @__PURE__ */ e(b, { type: "source", position: x.Bottom, style: { opacity: 0 }, id: "1" })
269
+ ] });
270
+ }, fe = ({ rail: t, cardWidth: r }) => {
271
+ const f = r / 2;
272
+ r / 2 + t.indent;
273
+ const a = "var(--ff-edge-color, #b0bec5)";
274
+ return /* @__PURE__ */ n(
275
+ "svg",
276
+ {
277
+ width: r + t.indent + 200,
278
+ height: t.height,
279
+ style: { position: "absolute", left: 0, top: "100%", pointerEvents: "none", overflow: "visible" },
280
+ children: [
281
+ /* @__PURE__ */ e("line", { x1: f, y1: 0, x2: f, y2: t.height, stroke: a, strokeWidth: 1.5 }),
282
+ t.branches.map((s, l) => {
283
+ const g = s.y;
284
+ return /* @__PURE__ */ n("g", { transform: `translate(0, ${g})`, children: [
285
+ /* @__PURE__ */ e(
286
+ "rect",
287
+ {
288
+ x: f - 5,
289
+ y: -5,
290
+ width: 10,
291
+ height: 10,
292
+ fill: "#fff",
293
+ stroke: a,
294
+ strokeWidth: 1.5,
295
+ transform: `rotate(45, ${f}, 0)`
296
+ }
297
+ ),
298
+ /* @__PURE__ */ e(
299
+ "text",
300
+ {
301
+ x: f + 14,
302
+ y: 4,
303
+ fontSize: 12,
304
+ fontWeight: 500,
305
+ fill: "var(--ff-text, #212121)",
306
+ style: { fontFamily: "sans-serif" },
307
+ children: s.label
308
+ }
309
+ )
310
+ ] }, l);
311
+ })
312
+ ]
313
+ }
314
+ );
315
+ }, Fe = ({ id: t, data: r }) => {
316
+ const { onEditNode: f, onDeleteNode: a } = E(), { conditions: s = [], infoText: l = "Filter conditions applied to workflow data", _branchRail: g } = r;
317
+ return /* @__PURE__ */ n("div", { style: { width: 350, position: "relative" }, children: [
318
+ /* @__PURE__ */ e(b, { type: "target", position: x.Top, style: { opacity: 0 } }),
319
+ /* @__PURE__ */ n("div", { style: { border: "1.5px solid #ffe082", borderRadius: 8, background: "#fff" }, children: [
320
+ /* @__PURE__ */ n("div", { className: "ff-d-flex ff-justify-content-between ff-align-items-center", style: { padding: "10px 6px" }, children: [
321
+ /* @__PURE__ */ n("div", { className: "ff-d-flex ff-align-items-center", children: [
322
+ /* @__PURE__ */ e("div", { className: "ff-d-flex ff-align-items-center ff-justify-content-center ff-rounded", style: { width: 25, height: 25, background: "rgba(255,160,0,0.1)" }, children: /* @__PURE__ */ e(Se, { className: "ff-text-warning", size: 16 }) }),
323
+ /* @__PURE__ */ e("span", { className: "ff-ms-2 ff-fw-medium ff-text-dark", style: { fontSize: 14 }, children: "Filter" })
324
+ ] }),
325
+ /* @__PURE__ */ n("div", { className: "node-actions ff-d-flex ff-align-items-center", children: [
326
+ /* @__PURE__ */ e(
327
+ "div",
328
+ {
329
+ role: "button",
330
+ tabIndex: 0,
331
+ onClick: (o) => {
332
+ o.stopPropagation(), f(t);
333
+ },
334
+ onKeyDown: (o) => {
335
+ o.key === "Enter" && (o.stopPropagation(), f(t));
336
+ },
337
+ children: /* @__PURE__ */ e(T, { size: 16 })
338
+ }
339
+ ),
340
+ /* @__PURE__ */ e(
341
+ "div",
342
+ {
343
+ className: "ff-ms-2",
344
+ role: "button",
345
+ tabIndex: 0,
346
+ onClick: (o) => {
347
+ o.stopPropagation(), a(t);
348
+ },
349
+ onKeyDown: (o) => {
350
+ o.key === "Enter" && (o.stopPropagation(), a(t));
351
+ },
352
+ children: /* @__PURE__ */ e(P, { color: "red", size: 16 })
353
+ }
354
+ ),
355
+ /* @__PURE__ */ e(D, { title: l, placement: "right", arrow: !0, children: /* @__PURE__ */ e("div", { className: "ff-ms-2", children: /* @__PURE__ */ e(W, { color: "gray", size: 16 }) }) })
356
+ ] })
357
+ ] }),
358
+ /* @__PURE__ */ e("div", { style: { margin: "0 6px 10px", padding: "10px 12px", borderRadius: 6, background: "#fafafa", fontSize: 12 }, children: s.length === 0 ? /* @__PURE__ */ e("span", { className: "ff-text-muted", children: "No conditions configured" }) : s.map((o, i) => /* @__PURE__ */ n("div", { className: "ff-d-flex ff-align-items-center ff-mb-1", children: [
359
+ /* @__PURE__ */ e("p", { className: "ff-m-0 ff-fw-bold ff-me-1 ff-text-truncate", style: { maxWidth: 100 }, title: o.field, children: o.field }),
360
+ /* @__PURE__ */ e("span", { className: "ff-text-muted", children: o.operator }),
361
+ /* @__PURE__ */ e("p", { className: "ff-text-dark ff-text-truncate ff-mx-1 ff-m-0", title: o.value, children: o.value }),
362
+ i < s.length - 1 && /* @__PURE__ */ e("p", { className: "ff-bg-primary ff-text-white ff-fw-bold ff-ms-1 ff-px-1 ff-rounded-1 ff-m-0", children: o.logicalOperator })
363
+ ] }, i)) })
364
+ ] }),
365
+ /* @__PURE__ */ e(b, { type: "source", position: x.Bottom, style: { opacity: 0 } }),
366
+ g && /* @__PURE__ */ e(fe, { rail: g, cardWidth: 350 })
367
+ ] });
368
+ }, $e = ({ id: t, data: r }) => {
369
+ const { onEditNode: f, onDeleteNode: a, nodeRegistry: s, nodeBody: l = "full" } = E(), { title: g = "Task", descriptorType: o, groupBlocks: i, groups: d, roles: y, groupId: h, roleId: N, infoText: p = "" } = r, c = o ? s == null ? void 0 : s.forType(o) : void 0, v = c == null ? void 0 : c.icon, m = (u) => u == null ? "" : typeof u == "string" ? u : typeof u == "object" && "label" in u ? String(u.label) : String(u), w = (u) => Array.isArray(u) ? u.map(m).filter(Boolean) : u != null && u !== "" ? [m(u)] : [], k = (i == null ? void 0 : i.flatMap((u) => u.groups ?? [])) ?? [...w(d), ...w(y), ...w(h), ...w(N)], I = k.length > 0;
370
+ return /* @__PURE__ */ n("div", { style: { width: 350 }, children: [
371
+ /* @__PURE__ */ e(b, { type: "target", position: x.Top, style: { opacity: 0 } }),
372
+ /* @__PURE__ */ n("div", { style: { border: "1.5px solid #b0bec5", borderRadius: 8, background: "#fff" }, children: [
373
+ /* @__PURE__ */ n("div", { className: "ff-d-flex ff-justify-content-between ff-align-items-center", style: { padding: "10px 6px" }, children: [
374
+ /* @__PURE__ */ n("div", { className: "ff-d-flex ff-align-items-center ff-gap-2", children: [
375
+ v && /* @__PURE__ */ e("div", { style: { display: "flex", alignItems: "center" }, children: v }),
376
+ /* @__PURE__ */ e("span", { className: "ff-text-dark", style: { fontSize: 14, fontWeight: 500 }, children: g })
377
+ ] }),
378
+ /* @__PURE__ */ n("div", { className: "node-actions ff-d-flex ff-align-items-center", children: [
379
+ /* @__PURE__ */ e(
380
+ "div",
381
+ {
382
+ role: "button",
383
+ tabIndex: 0,
384
+ onClick: (u) => {
385
+ u.stopPropagation(), f(t);
386
+ },
387
+ onKeyDown: (u) => {
388
+ u.key === "Enter" && (u.stopPropagation(), f(t));
389
+ },
390
+ children: /* @__PURE__ */ e(T, { size: 16 })
391
+ }
392
+ ),
393
+ /* @__PURE__ */ e(
394
+ "div",
395
+ {
396
+ className: "ff-ms-2",
397
+ role: "button",
398
+ tabIndex: 0,
399
+ onClick: (u) => {
400
+ u.stopPropagation(), a(t);
401
+ },
402
+ onKeyDown: (u) => {
403
+ u.key === "Enter" && (u.stopPropagation(), a(t));
404
+ },
405
+ children: /* @__PURE__ */ e(P, { color: "red", size: 16 })
406
+ }
407
+ ),
408
+ p && /* @__PURE__ */ e(D, { title: p, placement: "right", arrow: !0, children: /* @__PURE__ */ e("div", { className: "ff-ms-2", children: /* @__PURE__ */ e(W, { color: "gray", size: 16 }) }) })
409
+ ] })
410
+ ] }),
411
+ l !== "title-only" && /* @__PURE__ */ e("div", { style: { margin: "0 6px 10px", padding: "10px 12px", borderRadius: 6, background: "#fafafa", fontSize: 12 }, children: c != null && c.renderNode ? c.renderNode(r) : I ? /* @__PURE__ */ e("div", { className: "ff-d-flex ff-flex-wrap ff-gap-1", children: k.map((u, z) => /* @__PURE__ */ e("span", { className: "ff-badge ff-bg-dark ff-text-white ff-py-1 ff-px-2 ff-rounded", style: { fontSize: 11 }, title: u, children: u }, z)) }) : /* @__PURE__ */ e("span", { className: "ff-text-muted", children: "Not configured" }) })
412
+ ] }),
413
+ /* @__PURE__ */ e(b, { type: "source", position: x.Bottom, style: { opacity: 0 } })
414
+ ] });
415
+ }, O = 5, Be = ({ id: t, data: r }) => {
416
+ const { onEditNode: f, onDeleteNode: a } = E(), { approvalData: s, isPreview: l = !1, _branchRail: g } = r, o = (s == null ? void 0 : s.policy) ?? {}, i = o.stages ?? [], d = i.length, y = i.slice(0, O), h = d - O, N = o.name ?? o.policyName ?? "Untitled Policy";
417
+ return /* @__PURE__ */ n("div", { style: { width: 350, position: "relative" }, children: [
418
+ /* @__PURE__ */ e(b, { type: "target", position: x.Top, style: { opacity: 0 } }),
419
+ /* @__PURE__ */ n("div", { style: { border: "1.5px solid #ffe082", borderRadius: 8, background: "#fff" }, children: [
420
+ /* @__PURE__ */ n("div", { className: "ff-d-flex ff-justify-content-between ff-align-items-center", style: { padding: "10px 6px" }, children: [
421
+ /* @__PURE__ */ n("div", { className: "ff-d-flex ff-align-items-center ff-gap-2", children: [
422
+ /* @__PURE__ */ e("div", { className: "ff-d-flex ff-align-items-center ff-justify-content-center ff-rounded", style: { width: 25, height: 25, background: "rgba(251,192,45,0.2)" }, children: /* @__PURE__ */ e(he, { style: { color: "#FBC02D" }, size: 16 }) }),
423
+ /* @__PURE__ */ e("span", { className: "ff-fw-medium ff-text-dark", style: { fontSize: 14 }, children: "Approval Policy" })
424
+ ] }),
425
+ /* @__PURE__ */ n("div", { className: "node-actions ff-d-flex ff-align-items-center", children: [
426
+ !l && /* @__PURE__ */ e(
427
+ "div",
428
+ {
429
+ role: "button",
430
+ tabIndex: 0,
431
+ style: { cursor: "pointer" },
432
+ onClick: (p) => {
433
+ p.stopPropagation(), f(t);
434
+ },
435
+ onKeyDown: (p) => {
436
+ p.key === "Enter" && (p.stopPropagation(), f(t));
437
+ },
438
+ children: /* @__PURE__ */ e(T, { size: 16, className: "ff-text-secondary" })
439
+ }
440
+ ),
441
+ !l && /* @__PURE__ */ e(
442
+ "div",
443
+ {
444
+ className: "ff-ms-2",
445
+ role: "button",
446
+ tabIndex: 0,
447
+ style: { cursor: "pointer" },
448
+ onClick: (p) => {
449
+ p.stopPropagation(), a(t);
450
+ },
451
+ onKeyDown: (p) => {
452
+ p.key === "Enter" && (p.stopPropagation(), a(t));
453
+ },
454
+ children: /* @__PURE__ */ e(P, { color: "red", size: 16 })
455
+ }
456
+ ),
457
+ /* @__PURE__ */ e(D, { title: "This approval policy determines who must approve a request before the workflow continues.", arrow: !0, placement: "right", children: /* @__PURE__ */ e("span", { className: "ff-ms-2 ff-d-inline-flex", children: /* @__PURE__ */ e(W, { color: "gray", size: 16 }) }) })
458
+ ] })
459
+ ] }),
460
+ /* @__PURE__ */ n("div", { style: { margin: "0 6px 10px", padding: "10px 12px", borderRadius: 6, background: "#FCFCFC" }, children: [
461
+ /* @__PURE__ */ n("div", { className: "ff-d-flex ff-justify-content-start ff-align-items-center ff-mb-2", children: [
462
+ /* @__PURE__ */ e("h6", { className: "ff-text-dark ff-mb-0 ff-text-truncate ff-flex-grow-1 ff-me-2", style: { fontSize: 13, fontWeight: 700 }, title: N, children: N }),
463
+ /* @__PURE__ */ n("span", { className: "ff-badge ff-rounded-pill ff-px-2 ff-py-1 ff-flex-shrink-0", style: { background: "#FFF9C4", color: "#616161", fontSize: 11, fontWeight: 600 }, children: [
464
+ d,
465
+ " Stage",
466
+ d !== 1 ? "s" : ""
467
+ ] })
468
+ ] }),
469
+ i.length > 0 ? /* @__PURE__ */ n("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [
470
+ y.map((p, c) => {
471
+ var z, A, C;
472
+ const v = ((z = p.stageName) == null ? void 0 : z.trim()) || `Stage ${c + 1}`, m = Array.isArray(p.userIds) ? p.userIds.length : 0, w = ((A = p.groupName) == null ? void 0 : A.trim()) ?? "", k = ((C = p.roleName) == null ? void 0 : C.trim()) ?? "", I = m > 0 || w || k;
473
+ let u = "Not configured";
474
+ return w ? u = `Group: ${w}` : k ? u = `Role: ${k}` : m > 0 && (u = `${m} approver${m !== 1 ? "s" : ""}`), /* @__PURE__ */ n("div", { className: "ff-d-flex ff-align-items-center ff-gap-2", children: [
475
+ /* @__PURE__ */ e("div", { className: "ff-rounded-circle ff-d-flex ff-align-items-center ff-justify-content-center ff-flex-shrink-0", style: { width: 28, height: 28, background: "#FFF9C4", color: "#5D4037", fontSize: 12, fontWeight: 700 }, children: c + 1 }),
476
+ /* @__PURE__ */ n("div", { className: "ff-flex-grow-1 ff-rounded ff-p-2 ff-d-flex ff-justify-content-between ff-align-items-center ff-border", style: { background: "#FFFDE7", borderColor: "#FEE79A" }, children: [
477
+ /* @__PURE__ */ e("span", { style: { fontSize: 12, fontWeight: 700, color: "#212121" }, children: v }),
478
+ /* @__PURE__ */ n("span", { className: `ff-d-flex ff-align-items-center ff-gap-1 ${I ? "ff-text-dark" : "ff-text-muted"}`, style: { fontSize: 12 }, children: [
479
+ /* @__PURE__ */ e(ye, { size: 16, className: "ff-flex-shrink-0", style: { color: I ? "#5D4037" : "#9E9E9E" } }),
480
+ u
481
+ ] })
482
+ ] })
483
+ ] }, c);
484
+ }),
485
+ h > 0 && /* @__PURE__ */ n(
486
+ "div",
487
+ {
488
+ className: "ff-text-center ff-fw-bold ff-py-2 ff-border ff-rounded",
489
+ style: { fontSize: 11, color: "#1976d2", borderColor: "#FEE79A", background: "#FFFDE7", borderStyle: "dashed", cursor: l ? "default" : "pointer" },
490
+ role: l ? void 0 : "button",
491
+ tabIndex: l ? void 0 : 0,
492
+ onClick: (p) => {
493
+ l || (p.stopPropagation(), f(t));
494
+ },
495
+ onKeyDown: (p) => {
496
+ l || p.key !== "Enter" || (p.stopPropagation(), f(t));
497
+ },
498
+ children: [
499
+ "+ ",
500
+ h,
501
+ " More Stage",
502
+ h > 1 ? "s" : ""
503
+ ]
504
+ }
505
+ )
506
+ ] }) : /* @__PURE__ */ e("div", { className: "ff-text-center ff-py-3 ff-rounded ff-border", style: { fontSize: 12, color: "#9e9e9e", background: "#FFFDE7", borderColor: "#FEE79A", borderStyle: "dashed" }, children: "No stages configured" })
507
+ ] })
508
+ ] }),
509
+ /* @__PURE__ */ e(b, { type: "source", position: x.Bottom, style: { opacity: 0 } }),
510
+ g && /* @__PURE__ */ e(fe, { rail: g, cardWidth: 350 })
511
+ ] });
512
+ }, je = ({ id: t, data: r }) => {
513
+ const { onEditNode: f, onDeleteNode: a } = E(), { duration: s, unit: l } = r, g = s != null && l, o = g ? `Wait ${s} ${l}` : "Not configured";
514
+ return /* @__PURE__ */ n("div", { style: { width: 350 }, children: [
515
+ /* @__PURE__ */ e(b, { type: "target", position: x.Top, style: { opacity: 0 } }),
516
+ /* @__PURE__ */ n("div", { style: { border: "1.5px solid #b0bec5", borderRadius: 8, background: "#fff" }, children: [
517
+ /* @__PURE__ */ n("div", { className: "ff-d-flex ff-justify-content-between ff-align-items-center ff-mx-2 ff-mt-2 ff-mb-1", children: [
518
+ /* @__PURE__ */ n("div", { className: "ff-d-flex ff-align-items-center ff-gap-2", children: [
519
+ /* @__PURE__ */ e("div", { className: "ff-d-flex ff-align-items-center ff-justify-content-center ff-rounded", style: { width: 25, height: 25, background: "rgba(33,150,243,0.1)" }, children: /* @__PURE__ */ e(ue, { size: 16, color: "#1976d2" }) }),
520
+ /* @__PURE__ */ e("span", { className: "ff-fw-medium ff-text-dark", style: { fontSize: 14 }, children: "Delay" })
521
+ ] }),
522
+ /* @__PURE__ */ n("div", { className: "node-actions ff-d-flex ff-align-items-center", children: [
523
+ /* @__PURE__ */ e(
524
+ "div",
525
+ {
526
+ role: "button",
527
+ tabIndex: 0,
528
+ onClick: (i) => {
529
+ i.stopPropagation(), f(t);
530
+ },
531
+ onKeyDown: (i) => {
532
+ i.key === "Enter" && (i.stopPropagation(), f(t));
533
+ },
534
+ children: /* @__PURE__ */ e(T, { size: 16 })
535
+ }
536
+ ),
537
+ /* @__PURE__ */ e(
538
+ "div",
539
+ {
540
+ className: "ff-ms-2",
541
+ role: "button",
542
+ tabIndex: 0,
543
+ onClick: (i) => {
544
+ i.stopPropagation(), a(t);
545
+ },
546
+ onKeyDown: (i) => {
547
+ i.key === "Enter" && (i.stopPropagation(), a(t));
548
+ },
549
+ children: /* @__PURE__ */ e(P, { color: "red", size: 16 })
550
+ }
551
+ )
552
+ ] })
553
+ ] }),
554
+ /* @__PURE__ */ e("div", { className: "ff-mx-2 ff-mb-2 ff-p-2 ff-rounded", style: { background: "#fafafa", fontSize: 12 }, children: /* @__PURE__ */ e("span", { className: g ? "ff-text-dark ff-fw-medium" : "ff-text-muted", children: o }) })
555
+ ] }),
556
+ /* @__PURE__ */ e(b, { type: "source", position: x.Bottom, style: { opacity: 0 } })
557
+ ] });
558
+ }, G = {
559
+ email: { label: "Email", bg: "#e3f2fd", color: "#1565c0", iconType: be },
560
+ slack: { label: "Slack", bg: "#e8f5e9", color: "#2e7d32", iconType: M },
561
+ teams: { label: "MS Teams", bg: "#ede7f6", color: "#4527a0", iconType: M },
562
+ sms: { label: "SMS", bg: "#fce4ec", color: "#880e4f", iconType: me },
563
+ "in-app": { label: "In-App", bg: "#fff3e0", color: "#e65100", iconType: M },
564
+ webhook: { label: "Webhook", bg: "#f3e5f5", color: "#6a1b9a", iconType: ie }
565
+ }, Me = {
566
+ label: "Notification",
567
+ bg: "rgba(156,39,176,0.1)",
568
+ color: "#7b1fa2",
569
+ iconType: M
570
+ };
571
+ function Ke(t) {
572
+ var r;
573
+ switch (t.channel) {
574
+ case "email":
575
+ return ((r = t.emailTo) == null ? void 0 : r.join(", ")) ?? t.recipient ?? null;
576
+ case "slack":
577
+ return t.slackChannel ?? null;
578
+ case "teams":
579
+ return t.teamsMessage ? "Message configured" : null;
580
+ case "sms":
581
+ return t.smsTo ?? null;
582
+ case "in-app":
583
+ return t.inAppRecipient ?? null;
584
+ case "webhook":
585
+ return t.webhookUrl ?? null;
586
+ default:
587
+ return t.recipient ?? null;
588
+ }
589
+ }
590
+ function _e(t) {
591
+ switch (t.channel) {
592
+ case "email":
593
+ return t.emailSubject ?? t.subject ?? null;
594
+ case "slack": {
595
+ const r = t.slackMessage;
596
+ return r ? r.length > 60 ? `${r.slice(0, 60)}…` : r : null;
597
+ }
598
+ case "in-app":
599
+ return t.inAppTitle ?? null;
600
+ default:
601
+ return t.subject ?? null;
602
+ }
603
+ }
604
+ const He = ({ id: t, data: r }) => {
605
+ const { onEditNode: f, onDeleteNode: a } = E(), s = r, l = s.channel && G[s.channel] ? G[s.channel] : Me, g = Ke(s), o = _e(s), i = !!(s.channel && g), d = l.iconType;
606
+ return /* @__PURE__ */ n("div", { style: { width: F }, children: [
607
+ /* @__PURE__ */ e(b, { type: "target", position: x.Top, style: { opacity: 0 } }),
608
+ /* @__PURE__ */ n("div", { style: { border: "1.5px solid #b0bec5", borderRadius: 8, background: "#fff" }, children: [
609
+ /* @__PURE__ */ n("div", { className: "ff-d-flex ff-justify-content-between ff-align-items-center", style: { padding: "10px 6px" }, children: [
610
+ /* @__PURE__ */ n("div", { className: "ff-d-flex ff-align-items-center ff-gap-2", children: [
611
+ /* @__PURE__ */ e("div", { className: "ff-d-flex ff-align-items-center ff-justify-content-center ff-rounded", style: { width: 25, height: 25, background: l.bg }, children: /* @__PURE__ */ e(d, { size: 16, color: l.color }) }),
612
+ /* @__PURE__ */ e("span", { className: "ff-fw-medium ff-text-dark", style: { fontSize: 14 }, children: s.channel ? `${l.label} Notification` : "Notification" })
613
+ ] }),
614
+ /* @__PURE__ */ n("div", { className: "node-actions ff-d-flex ff-align-items-center", children: [
615
+ /* @__PURE__ */ e(
616
+ "div",
617
+ {
618
+ role: "button",
619
+ tabIndex: 0,
620
+ onClick: (y) => {
621
+ y.stopPropagation(), f(t);
622
+ },
623
+ onKeyDown: (y) => {
624
+ (y.key === "Enter" || y.key === " ") && (y.stopPropagation(), f(t));
625
+ },
626
+ children: /* @__PURE__ */ e(T, { size: 16 })
627
+ }
628
+ ),
629
+ /* @__PURE__ */ e(
630
+ "div",
631
+ {
632
+ className: "ff-ms-2",
633
+ role: "button",
634
+ tabIndex: 0,
635
+ onClick: (y) => {
636
+ y.stopPropagation(), a(t);
637
+ },
638
+ onKeyDown: (y) => {
639
+ (y.key === "Enter" || y.key === " ") && (y.stopPropagation(), a(t));
640
+ },
641
+ children: /* @__PURE__ */ e(P, { color: "red", size: 16 })
642
+ }
643
+ )
644
+ ] })
645
+ ] }),
646
+ /* @__PURE__ */ e("div", { style: { margin: "0 6px 10px", padding: "10px 12px", borderRadius: 6, background: "#fafafa", fontSize: 12 }, children: i ? /* @__PURE__ */ n("div", { className: "ff-d-flex ff-flex-column ff-gap-1", children: [
647
+ /* @__PURE__ */ n("div", { className: "ff-d-flex ff-align-items-center ff-gap-2", children: [
648
+ /* @__PURE__ */ e("span", { className: "ff-px-2 ff-py-1 ff-rounded", style: { fontSize: 10, background: l.bg, color: l.color, fontWeight: 600, flexShrink: 0 }, children: l.label }),
649
+ /* @__PURE__ */ e("span", { className: "ff-text-dark ff-text-truncate", style: { maxWidth: 220 }, children: g })
650
+ ] }),
651
+ o && /* @__PURE__ */ e("span", { className: "ff-text-muted ff-text-truncate", style: { maxWidth: 280 }, children: o })
652
+ ] }) : /* @__PURE__ */ e("span", { className: "ff-text-muted", children: "Not configured" }) })
653
+ ] }),
654
+ /* @__PURE__ */ e(b, { type: "source", position: x.Bottom, style: { opacity: 0 } })
655
+ ] });
656
+ }, V = {
657
+ "api-key": "API Key",
658
+ hmac: "HMAC"
659
+ }, Ue = ({ data: t }) => {
660
+ const { onClickAddTrigger: r } = E(), { label: f = "Webhook Trigger", endpointUrl: a, authMethod: s, source: l } = t, g = (i) => {
661
+ i.stopPropagation(), r();
662
+ }, o = (i) => {
663
+ i.stopPropagation(), a && navigator.clipboard.writeText(a).catch(() => {
664
+ });
665
+ };
666
+ return /* @__PURE__ */ n("div", { style: { width: F }, children: [
667
+ /* @__PURE__ */ e(b, { type: "target", position: x.Top, style: { opacity: 0 } }),
668
+ /* @__PURE__ */ n("div", { style: { border: "1.5px solid #90caf9", borderRadius: 8, background: "#fff", overflow: "hidden" }, children: [
669
+ /* @__PURE__ */ n("div", { className: "ff-d-flex ff-justify-content-between ff-align-items-center", style: { padding: "10px 6px" }, children: [
670
+ /* @__PURE__ */ n("div", { className: "ff-d-flex ff-align-items-center ff-gap-2", children: [
671
+ /* @__PURE__ */ e("div", { style: { width: 28, height: 28, borderRadius: 6, background: "rgba(33,150,243,0.1)", display: "flex", alignItems: "center", justifyContent: "center", flexShrink: 0 }, children: /* @__PURE__ */ e(ie, { size: 16, color: "#1565c0" }) }),
672
+ /* @__PURE__ */ e("span", { style: { fontSize: 13, fontWeight: 600, color: "#212121" }, children: "Webhook Trigger" })
673
+ ] }),
674
+ /* @__PURE__ */ e(
675
+ "div",
676
+ {
677
+ role: "button",
678
+ tabIndex: 0,
679
+ onClick: g,
680
+ onKeyDown: (i) => {
681
+ (i.key === "Enter" || i.key === " ") && g(i);
682
+ },
683
+ className: "ff-d-flex ff-align-items-center",
684
+ style: { paddingRight: 4, cursor: "pointer" },
685
+ children: /* @__PURE__ */ e(T, { size: 16, color: "#555" })
686
+ }
687
+ )
688
+ ] }),
689
+ /* @__PURE__ */ n("div", { style: { margin: "0 6px 10px", padding: "10px 12px", borderRadius: 6, background: "#e3f2fd", border: "1px solid #90caf9" }, children: [
690
+ /* @__PURE__ */ n("div", { className: "ff-d-flex ff-align-items-center ff-flex-wrap ff-gap-2 ff-mb-1", children: [
691
+ /* @__PURE__ */ e("span", { style: { fontSize: 12, color: "#1565c0", fontWeight: 600 }, children: f }),
692
+ l && /* @__PURE__ */ e("span", { className: "ff-px-2 ff-py-1 ff-rounded", style: { fontSize: 11, background: "#fff", border: "1px solid #90caf9", color: "#1565c0" }, children: l }),
693
+ s && s !== "none" && V[s] && /* @__PURE__ */ e("span", { className: "ff-px-2 ff-py-1 ff-rounded", style: { fontSize: 10, background: "#1565c0", color: "#fff", fontWeight: 600 }, children: V[s] })
694
+ ] }),
695
+ a && /* @__PURE__ */ n("div", { className: "ff-d-flex ff-align-items-center ff-gap-1", style: { marginTop: 4 }, children: [
696
+ /* @__PURE__ */ e("span", { style: { fontSize: 10, color: "#1565c0", fontFamily: "monospace", flex: 1, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: a }),
697
+ /* @__PURE__ */ e(D, { title: "Copy URL", placement: "top", arrow: !0, children: /* @__PURE__ */ e(
698
+ "div",
699
+ {
700
+ role: "button",
701
+ tabIndex: 0,
702
+ onClick: o,
703
+ onKeyDown: (i) => {
704
+ (i.key === "Enter" || i.key === " ") && o(i);
705
+ },
706
+ style: { cursor: "pointer", flexShrink: 0 },
707
+ children: /* @__PURE__ */ e(xe, { size: 12, color: "#1565c0" })
708
+ }
709
+ ) })
710
+ ] })
711
+ ] })
712
+ ] }),
713
+ /* @__PURE__ */ e(b, { type: "source", position: x.Bottom, style: { opacity: 0 } })
714
+ ] });
715
+ }, Oe = ({ id: t, data: r }) => {
716
+ var N;
717
+ const { onEditNode: f, onDeleteNode: a, nodeRegistry: s } = E(), { method: l, url: g, descriptorType: o } = r, i = o ? (N = s == null ? void 0 : s.forType(o)) == null ? void 0 : N.icon : /* @__PURE__ */ e(Ne, { size: 16, color: "#546e7a" }), d = !!(l && g), y = (l == null ? void 0 : l.toUpperCase()) ?? "", h = Ee[y] ?? null;
718
+ return /* @__PURE__ */ n("div", { style: { width: F }, children: [
719
+ /* @__PURE__ */ e(b, { type: "target", position: x.Top, style: { opacity: 0 } }),
720
+ /* @__PURE__ */ n("div", { style: { border: "1.5px solid #b0bec5", borderRadius: 8, background: "#fff" }, children: [
721
+ /* @__PURE__ */ n("div", { className: "ff-d-flex ff-justify-content-between ff-align-items-center", style: { padding: "10px 6px" }, children: [
722
+ /* @__PURE__ */ n("div", { className: "ff-d-flex ff-align-items-center ff-gap-2", children: [
723
+ /* @__PURE__ */ e("div", { style: { width: 25, height: 25, display: "flex", alignItems: "center", justifyContent: "center" }, children: i }),
724
+ /* @__PURE__ */ e("span", { className: "ff-fw-medium ff-text-dark", style: { fontSize: 14 }, children: "REST API Call" })
725
+ ] }),
726
+ /* @__PURE__ */ n("div", { className: "node-actions ff-d-flex ff-align-items-center", children: [
727
+ /* @__PURE__ */ e(
728
+ "div",
729
+ {
730
+ role: "button",
731
+ tabIndex: 0,
732
+ onClick: (p) => {
733
+ p.stopPropagation(), f(t);
734
+ },
735
+ onKeyDown: (p) => {
736
+ (p.key === "Enter" || p.key === " ") && (p.stopPropagation(), f(t));
737
+ },
738
+ children: /* @__PURE__ */ e(T, { size: 16 })
739
+ }
740
+ ),
741
+ /* @__PURE__ */ e(
742
+ "div",
743
+ {
744
+ className: "ff-ms-2",
745
+ role: "button",
746
+ tabIndex: 0,
747
+ onClick: (p) => {
748
+ p.stopPropagation(), a(t);
749
+ },
750
+ onKeyDown: (p) => {
751
+ (p.key === "Enter" || p.key === " ") && (p.stopPropagation(), a(t));
752
+ },
753
+ children: /* @__PURE__ */ e(P, { color: "red", size: 16 })
754
+ }
755
+ )
756
+ ] })
757
+ ] }),
758
+ /* @__PURE__ */ e("div", { style: { margin: "0 6px 10px", padding: "10px 12px", borderRadius: 6, background: "#fafafa", fontSize: 12 }, children: d ? /* @__PURE__ */ n("div", { className: "ff-d-flex ff-align-items-center ff-gap-2", children: [
759
+ h && /* @__PURE__ */ e("span", { style: { fontSize: 10, fontWeight: 700, padding: "2px 6px", borderRadius: 4, background: h.bg, color: h.color, flexShrink: 0 }, children: y }),
760
+ /* @__PURE__ */ e("span", { className: "ff-text-dark ff-text-truncate", style: { fontFamily: "monospace", fontSize: 11 }, title: g, children: g })
761
+ ] }) : /* @__PURE__ */ e("span", { className: "ff-text-muted", children: "Not configured" }) })
762
+ ] }),
763
+ /* @__PURE__ */ e(b, { type: "source", position: x.Bottom, style: { opacity: 0 } })
764
+ ] });
765
+ }, Ge = {
766
+ eq: "=",
767
+ neq: "≠",
768
+ gt: ">",
769
+ gte: "≥",
770
+ lt: "<",
771
+ lte: "≤",
772
+ contains: "contains",
773
+ startsWith: "starts with",
774
+ endsWith: "ends with",
775
+ isEmpty: "is empty",
776
+ isNotEmpty: "is not empty"
777
+ }, Ve = ({ id: t, data: r }) => {
778
+ const { onEditNode: f, onDeleteNode: a } = E(), { title: s = "Condition Branch", branchConfigs: l = [], defaultBranch: g } = r, o = l.length > 0;
779
+ return /* @__PURE__ */ n("div", { style: { width: F }, children: [
780
+ /* @__PURE__ */ e(b, { type: "target", position: x.Top, style: { opacity: 0 } }),
781
+ /* @__PURE__ */ n("div", { style: { border: "1.5px solid #b39ddb", borderRadius: 8, background: "#fff" }, children: [
782
+ /* @__PURE__ */ n("div", { className: "ff-d-flex ff-justify-content-between ff-align-items-center", style: { padding: "10px 6px" }, children: [
783
+ /* @__PURE__ */ n("div", { className: "ff-d-flex ff-align-items-center ff-gap-2", children: [
784
+ /* @__PURE__ */ e("div", { style: { width: 25, height: 25, borderRadius: 6, background: "rgba(103,58,183,0.1)", display: "flex", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ e(ke, { size: 16, color: "#512da8" }) }),
785
+ /* @__PURE__ */ e("span", { className: "ff-fw-medium ff-text-dark", style: { fontSize: 14 }, children: s })
786
+ ] }),
787
+ /* @__PURE__ */ n("div", { className: "node-actions ff-d-flex ff-align-items-center", children: [
788
+ /* @__PURE__ */ e(
789
+ "div",
790
+ {
791
+ role: "button",
792
+ tabIndex: 0,
793
+ onClick: (i) => {
794
+ i.stopPropagation(), f(t);
795
+ },
796
+ onKeyDown: (i) => {
797
+ (i.key === "Enter" || i.key === " ") && (i.stopPropagation(), f(t));
798
+ },
799
+ children: /* @__PURE__ */ e(T, { size: 16 })
800
+ }
801
+ ),
802
+ /* @__PURE__ */ e(
803
+ "div",
804
+ {
805
+ className: "ff-ms-2",
806
+ role: "button",
807
+ tabIndex: 0,
808
+ onClick: (i) => {
809
+ i.stopPropagation(), a(t);
810
+ },
811
+ onKeyDown: (i) => {
812
+ (i.key === "Enter" || i.key === " ") && (i.stopPropagation(), a(t));
813
+ },
814
+ children: /* @__PURE__ */ e(P, { color: "red", size: 16 })
815
+ }
816
+ )
817
+ ] })
818
+ ] }),
819
+ /* @__PURE__ */ e("div", { style: { margin: "0 6px 10px", padding: "10px 12px", borderRadius: 6, background: "#fafafa", fontSize: 12 }, children: o ? /* @__PURE__ */ n("div", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: [
820
+ l.map((i, d) => {
821
+ var p, c;
822
+ const y = U[d % U.length], h = (p = i.conditions) == null ? void 0 : p[0], N = (((c = i.conditions) == null ? void 0 : c.length) ?? 0) - 1;
823
+ return /* @__PURE__ */ n("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
824
+ /* @__PURE__ */ e("span", { style: { fontSize: 10, fontWeight: 600, padding: "2px 7px", borderRadius: 10, background: y.bg, color: y.color, flexShrink: 0 }, children: i.label || i.key }),
825
+ h ? /* @__PURE__ */ n("span", { style: { fontSize: 11, color: "#616161", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: [
826
+ h.field,
827
+ " ",
828
+ Ge[h.operator] ?? h.operator,
829
+ h.value ? ` ${h.value}` : "",
830
+ N > 0 ? ` +${N} more` : ""
831
+ ] }) : /* @__PURE__ */ e("span", { style: { fontSize: 11, color: "#9e9e9e" }, children: "No conditions yet" })
832
+ ] }, i.key);
833
+ }),
834
+ g && /* @__PURE__ */ n("div", { style: { display: "flex", alignItems: "center", gap: 6, marginTop: 2 }, children: [
835
+ /* @__PURE__ */ e("span", { style: { fontSize: 10, fontWeight: 600, padding: "2px 7px", borderRadius: 10, background: "#f5f5f5", color: "#757575", flexShrink: 0 }, children: "Default" }),
836
+ /* @__PURE__ */ e("span", { style: { fontSize: 11, color: "#9e9e9e" }, children: "fallback path" })
837
+ ] })
838
+ ] }) : /* @__PURE__ */ e("span", { className: "ff-text-muted", children: "Not configured — click edit to add branches" }) })
839
+ ] }),
840
+ /* @__PURE__ */ e(b, { type: "source", position: x.Bottom, style: { opacity: 0 } })
841
+ ] });
842
+ }, qe = ({ id: t, data: r }) => {
843
+ var p;
844
+ const { onEditNode: f, onDeleteNode: a, nodeRegistry: s } = E(), { title: l = "Sub-Workflow", workflowId: g, workflowLabel: o, descriptorType: i, onPreview: d } = r, y = i ? (p = s == null ? void 0 : s.forType(i)) == null ? void 0 : p.icon : /* @__PURE__ */ e(ve, { size: 16, color: "#00695c" }), h = !!g, N = (c) => {
845
+ c.stopPropagation(), g && d && d(g);
846
+ };
847
+ return /* @__PURE__ */ n("div", { style: { width: F }, children: [
848
+ /* @__PURE__ */ e(b, { type: "target", position: x.Top, style: { opacity: 0 } }),
849
+ /* @__PURE__ */ n("div", { style: { border: "1.5px solid #80cbc4", borderRadius: 8, background: "#fff" }, children: [
850
+ /* @__PURE__ */ n("div", { className: "ff-d-flex ff-justify-content-between ff-align-items-center", style: { padding: "10px 6px" }, children: [
851
+ /* @__PURE__ */ n("div", { className: "ff-d-flex ff-align-items-center ff-gap-2", children: [
852
+ /* @__PURE__ */ e("div", { style: { width: 25, height: 25, borderRadius: 6, background: "rgba(0,137,123,0.1)", display: "flex", alignItems: "center", justifyContent: "center" }, children: y }),
853
+ /* @__PURE__ */ e("span", { className: "ff-fw-medium ff-text-dark", style: { fontSize: 14 }, children: l })
854
+ ] }),
855
+ /* @__PURE__ */ n("div", { className: "node-actions ff-d-flex ff-align-items-center", children: [
856
+ /* @__PURE__ */ e(
857
+ "div",
858
+ {
859
+ role: "button",
860
+ tabIndex: 0,
861
+ onClick: (c) => {
862
+ c.stopPropagation(), f(t);
863
+ },
864
+ onKeyDown: (c) => {
865
+ (c.key === "Enter" || c.key === " ") && (c.stopPropagation(), f(t));
866
+ },
867
+ children: /* @__PURE__ */ e(T, { size: 16 })
868
+ }
869
+ ),
870
+ /* @__PURE__ */ e(
871
+ "div",
872
+ {
873
+ className: "ff-ms-2",
874
+ role: "button",
875
+ tabIndex: 0,
876
+ onClick: (c) => {
877
+ c.stopPropagation(), a(t);
878
+ },
879
+ onKeyDown: (c) => {
880
+ (c.key === "Enter" || c.key === " ") && (c.stopPropagation(), a(t));
881
+ },
882
+ children: /* @__PURE__ */ e(P, { color: "red", size: 16 })
883
+ }
884
+ )
885
+ ] })
886
+ ] }),
887
+ /* @__PURE__ */ e("div", { style: { margin: "0 6px 10px", padding: "10px 12px", borderRadius: 6, background: h ? "#e0f2f1" : "#fafafa", fontSize: 12, border: h ? "1px solid #b2dfdb" : "none" }, children: h ? /* @__PURE__ */ n("div", { className: "ff-d-flex ff-align-items-center ff-justify-content-between", children: [
888
+ /* @__PURE__ */ n("div", { className: "ff-d-flex ff-flex-column ff-gap-1", children: [
889
+ /* @__PURE__ */ e("span", { style: { fontSize: 12, fontWeight: 600, color: "#00695c" }, children: o || g }),
890
+ /* @__PURE__ */ n("span", { style: { fontSize: 10, color: "#80cbc4", fontFamily: "monospace" }, children: [
891
+ "ID: ",
892
+ g
893
+ ] })
894
+ ] }),
895
+ d && /* @__PURE__ */ n(
896
+ "div",
897
+ {
898
+ role: "button",
899
+ tabIndex: 0,
900
+ onClick: N,
901
+ onKeyDown: (c) => {
902
+ (c.key === "Enter" || c.key === " ") && N(c);
903
+ },
904
+ style: { cursor: "pointer", display: "flex", alignItems: "center", gap: 3, fontSize: 11, color: "#00897b" },
905
+ children: [
906
+ /* @__PURE__ */ e(we, { size: 13 }),
907
+ "Preview"
908
+ ]
909
+ }
910
+ )
911
+ ] }) : /* @__PURE__ */ e("span", { className: "ff-text-muted", children: "Not configured — select a workflow" }) })
912
+ ] }),
913
+ /* @__PURE__ */ e(b, { type: "source", position: x.Bottom, style: { opacity: 0 } })
914
+ ] });
915
+ }, ct = {
916
+ startNode: Te,
917
+ endNode: ze,
918
+ addTriggerNode: Ie,
919
+ addStepNode: Pe,
920
+ triggerNode: Ae,
921
+ eventNode: We,
922
+ filterNode: Fe,
923
+ actionNode: $e,
924
+ approvalNode: Be,
925
+ delayNode: je,
926
+ notificationNode: He,
927
+ webhookTriggerNode: Ue,
928
+ restApiNode: Oe,
929
+ conditionBranchNode: Ve,
930
+ subWorkflowNode: qe
931
+ }, Ze = 11.5, q = 2, $ = 6, Z = 40, Y = 20, J = 4, dt = ({
932
+ id: t,
933
+ sourceX: r,
934
+ sourceY: f,
935
+ targetX: a,
936
+ targetY: s,
937
+ sourcePosition: l,
938
+ targetPosition: g,
939
+ source: o,
940
+ target: i,
941
+ data: d
942
+ }) => {
943
+ const [y, h, N] = K({
944
+ sourceX: r,
945
+ sourceY: f,
946
+ targetX: a,
947
+ targetY: s
948
+ }), p = d == null ? void 0 : d.label, c = p === "Pass", v = c || p === "Fail", m = r + (a - r) / 3, w = f + (s - f) / 3, k = r + 2 * (a - r) / 3, I = f + 2 * (s - f) / 3, u = d == null ? void 0 : d.onAddStepClick, z = (L) => {
949
+ if (L.stopPropagation(), typeof u != "function") return;
950
+ const ce = {
951
+ edgeId: t,
952
+ nodeId: o,
953
+ sourceNodeId: o,
954
+ targetNodeId: i,
955
+ position: "between",
956
+ referenceNodeId: o,
957
+ referenceNodeType: d == null ? void 0 : d.referenceNodeType,
958
+ stepVisibility: d == null ? void 0 : d.stepVisibility
959
+ };
960
+ u(o, ce);
961
+ }, A = (L) => {
962
+ (L.key === "Enter" || L.key === " ") && (L.preventDefault(), z(L));
963
+ }, C = () => /* @__PURE__ */ n(R, { children: [
964
+ /* @__PURE__ */ n("g", { className: "plus-icon-container", children: [
965
+ /* @__PURE__ */ e("circle", { r: Ze, className: "edge-plus-circle" }),
966
+ /* @__PURE__ */ e("line", { x1: 0, y1: -$, x2: 0, y2: $, strokeWidth: q, strokeLinecap: "round", className: "plus-line" }),
967
+ /* @__PURE__ */ e("line", { x1: -$, y1: 0, x2: $, y2: 0, strokeWidth: q, strokeLinecap: "round", className: "plus-line" })
968
+ ] }),
969
+ /* @__PURE__ */ n("g", { className: "edge-plus-tooltip", transform: "translate(18, 0)", children: [
970
+ /* @__PURE__ */ e("rect", { x: 0, y: -10, width: 65, height: 20, rx: 4, className: "tooltip-bg" }),
971
+ /* @__PURE__ */ e("path", { d: "M0 -4 L-4 0 L0 4 Z", className: "tooltip-bg" }),
972
+ /* @__PURE__ */ e("text", { x: 32, y: 0, textAnchor: "middle", dominantBaseline: "central", fill: "white", style: { fontSize: 10, fontWeight: 600, pointerEvents: "none" }, children: "Add Step" })
973
+ ] })
974
+ ] }), S = u ? {
975
+ onClick: z,
976
+ onKeyDown: A,
977
+ role: "button",
978
+ tabIndex: 0,
979
+ style: { cursor: "pointer", pointerEvents: "all" }
980
+ } : {
981
+ style: { cursor: "default", pointerEvents: "all" }
982
+ };
983
+ return /* @__PURE__ */ n("g", { className: "edge-with-plus-wrapper", children: [
984
+ /* @__PURE__ */ e(_, { id: t, path: y }),
985
+ v ? /* @__PURE__ */ n(R, { children: [
986
+ /* @__PURE__ */ n("g", { transform: `translate(${m}, ${w})`, children: [
987
+ /* @__PURE__ */ e("rect", { x: -Z / 2, y: -Y / 2, width: Z, height: Y, rx: J, ry: J, fill: c ? "#ADE6C5" : "#FDBFBF" }),
988
+ /* @__PURE__ */ e("text", { textAnchor: "middle", dominantBaseline: "central", fill: c ? "#1DBF60" : "#C50000", style: { fontSize: 12, fontWeight: 500 }, children: p })
989
+ ] }),
990
+ /* @__PURE__ */ e("g", { className: "nodrag nopan edge-plus-svg", transform: `translate(${k}, ${I})`, "data-testid": "plus-node-icon", ...S, children: /* @__PURE__ */ e(C, {}) })
991
+ ] }) : /* @__PURE__ */ e("g", { className: "nodrag nopan edge-plus-svg", transform: `translate(${h}, ${N})`, "data-testid": "plus-node-icon", ...S, children: /* @__PURE__ */ e(C, {}) })
992
+ ] });
993
+ }, Ye = 11.5, Q = 2, B = 6, at = ({
994
+ id: t,
995
+ sourceX: r,
996
+ sourceY: f,
997
+ targetX: a,
998
+ targetY: s,
999
+ source: l,
1000
+ target: g,
1001
+ data: o
1002
+ }) => {
1003
+ const [i, d, y] = K({
1004
+ sourceX: r,
1005
+ sourceY: f,
1006
+ targetX: a,
1007
+ targetY: s
1008
+ }), h = o == null ? void 0 : o.onAddStepClick, N = (c) => {
1009
+ c.stopPropagation(), typeof h == "function" && h(l, {
1010
+ edgeId: t,
1011
+ nodeId: l,
1012
+ sourceNodeId: l,
1013
+ targetNodeId: g,
1014
+ position: "between",
1015
+ referenceNodeId: l,
1016
+ referenceNodeType: o == null ? void 0 : o.referenceNodeType,
1017
+ stepVisibility: o == null ? void 0 : o.stepVisibility,
1018
+ filterId: o == null ? void 0 : o.filterId,
1019
+ branch: o == null ? void 0 : o.branch
1020
+ });
1021
+ }, p = (c) => {
1022
+ (c.key === "Enter" || c.key === " ") && (c.preventDefault(), N(c));
1023
+ };
1024
+ return /* @__PURE__ */ n("g", { className: "edge-with-plus-wrapper", children: [
1025
+ /* @__PURE__ */ e(_, { id: t, path: i, style: { stroke: "#b0bec5" } }),
1026
+ /* @__PURE__ */ n(
1027
+ "g",
1028
+ {
1029
+ className: "nodrag nopan edge-plus-svg",
1030
+ transform: `translate(${d}, ${y})`,
1031
+ style: {
1032
+ cursor: h ? "pointer" : "default",
1033
+ pointerEvents: "all",
1034
+ outline: "none"
1035
+ },
1036
+ onClick: h ? N : void 0,
1037
+ onKeyDown: h ? p : void 0,
1038
+ role: h ? "button" : void 0,
1039
+ tabIndex: h ? 0 : void 0,
1040
+ "data-testid": "plus-node-icon",
1041
+ children: [
1042
+ /* @__PURE__ */ e("circle", { r: Ye, className: "edge-plus-circle" }),
1043
+ /* @__PURE__ */ e(
1044
+ "line",
1045
+ {
1046
+ x1: 0,
1047
+ y1: -B,
1048
+ x2: 0,
1049
+ y2: B,
1050
+ strokeWidth: Q,
1051
+ strokeLinecap: "round",
1052
+ className: "plus-line"
1053
+ }
1054
+ ),
1055
+ /* @__PURE__ */ e(
1056
+ "line",
1057
+ {
1058
+ x1: -B,
1059
+ y1: 0,
1060
+ x2: B,
1061
+ y2: 0,
1062
+ strokeWidth: Q,
1063
+ strokeLinecap: "round",
1064
+ className: "plus-line"
1065
+ }
1066
+ ),
1067
+ /* @__PURE__ */ n("g", { className: "edge-plus-tooltip", transform: "translate(18, 0)", children: [
1068
+ /* @__PURE__ */ e(
1069
+ "rect",
1070
+ {
1071
+ x: 0,
1072
+ y: -10,
1073
+ width: 65,
1074
+ height: 20,
1075
+ rx: 4,
1076
+ className: "tooltip-bg"
1077
+ }
1078
+ ),
1079
+ /* @__PURE__ */ e("path", { d: "M0 -4 L-4 0 L0 4 Z", className: "tooltip-bg" }),
1080
+ /* @__PURE__ */ e(
1081
+ "text",
1082
+ {
1083
+ x: 32,
1084
+ y: 0,
1085
+ textAnchor: "middle",
1086
+ dominantBaseline: "central",
1087
+ fill: "white",
1088
+ style: { fontSize: 10, fontWeight: 600, pointerEvents: "none" },
1089
+ children: "Add Step"
1090
+ }
1091
+ )
1092
+ ] })
1093
+ ]
1094
+ }
1095
+ )
1096
+ ] });
1097
+ }, pt = ({ id: t, sourceX: r, sourceY: f, targetX: a, targetY: s }) => {
1098
+ const [l] = K({ sourceX: r, sourceY: f, targetX: a, targetY: s });
1099
+ return /* @__PURE__ */ e(_, { id: t, path: l, style: { stroke: "#b0bec5" } });
1100
+ }, Je = 11.5, X = 2, j = 6, Qe = -24, ee = 40, te = 20, ne = 4, gt = ({
1101
+ id: t,
1102
+ sourceX: r,
1103
+ sourceY: f,
1104
+ targetX: a,
1105
+ targetY: s,
1106
+ source: l,
1107
+ target: g,
1108
+ data: o
1109
+ }) => {
1110
+ const [i, d, y] = K({ sourceX: r, sourceY: f, targetX: a, targetY: s }), h = o == null ? void 0 : o.label, N = h === "Pass", p = N || h === "Fail", c = o == null ? void 0 : o.onAddStepClick, v = (o == null ? void 0 : o.showPlus) !== !1 && !!c, m = (k) => {
1111
+ k.stopPropagation(), typeof c == "function" && c(l, {
1112
+ edgeId: t,
1113
+ nodeId: l,
1114
+ sourceNodeId: l,
1115
+ targetNodeId: g,
1116
+ position: "between",
1117
+ referenceNodeId: l,
1118
+ referenceNodeType: o == null ? void 0 : o.referenceNodeType,
1119
+ stepVisibility: o == null ? void 0 : o.stepVisibility
1120
+ });
1121
+ }, w = (k) => {
1122
+ (k.key === "Enter" || k.key === " ") && (k.preventDefault(), m(k));
1123
+ };
1124
+ return /* @__PURE__ */ n("g", { className: "edge-with-plus-wrapper", children: [
1125
+ /* @__PURE__ */ e(_, { id: t, path: i, style: { stroke: "#b0bec5" } }),
1126
+ /* @__PURE__ */ n(
1127
+ "g",
1128
+ {
1129
+ className: "nodrag nopan edge-plus-svg",
1130
+ transform: `translate(${d}, ${y})`,
1131
+ style: { cursor: c ? "pointer" : "default", pointerEvents: "all", outline: "none" },
1132
+ onClick: c ? m : void 0,
1133
+ onKeyDown: c ? w : void 0,
1134
+ role: c ? "button" : void 0,
1135
+ tabIndex: c ? 0 : void 0,
1136
+ children: [
1137
+ p && /* @__PURE__ */ n("g", { transform: `translate(0, ${v ? Qe : 0})`, children: [
1138
+ /* @__PURE__ */ e(
1139
+ "rect",
1140
+ {
1141
+ x: -ee / 2,
1142
+ y: -te / 2,
1143
+ width: ee,
1144
+ height: te,
1145
+ rx: ne,
1146
+ ry: ne,
1147
+ fill: N ? "#ADE6C5" : "#FDBFBF"
1148
+ }
1149
+ ),
1150
+ /* @__PURE__ */ e("text", { textAnchor: "middle", dominantBaseline: "central", fill: N ? "#1DBF60" : "#C50000", style: { fontSize: 12, fontWeight: 500 }, children: h })
1151
+ ] }),
1152
+ v && /* @__PURE__ */ n("g", { className: "plus-icon-container", children: [
1153
+ /* @__PURE__ */ e("circle", { r: Je, className: "edge-plus-circle" }),
1154
+ /* @__PURE__ */ e("line", { x1: 0, y1: -j, x2: 0, y2: j, strokeWidth: X, strokeLinecap: "round", className: "plus-line" }),
1155
+ /* @__PURE__ */ e("line", { x1: -j, y1: 0, x2: j, y2: 0, strokeWidth: X, strokeLinecap: "round", className: "plus-line" })
1156
+ ] }),
1157
+ v && /* @__PURE__ */ n("g", { className: "edge-plus-tooltip", transform: "translate(22, 0)", children: [
1158
+ /* @__PURE__ */ e("rect", { x: 0, y: -10, width: 65, height: 20, rx: 4, className: "tooltip-bg" }),
1159
+ /* @__PURE__ */ e("path", { d: "M0 -4 L-4 0 L0 4 Z", className: "tooltip-bg" }),
1160
+ /* @__PURE__ */ e("text", { x: 32, y: 0, textAnchor: "middle", dominantBaseline: "central", fill: "white", style: { fontSize: 10, fontWeight: 600, pointerEvents: "none" }, children: "Add Step" })
1161
+ ] })
1162
+ ]
1163
+ }
1164
+ )
1165
+ ] });
1166
+ }, ht = ({
1167
+ id: t,
1168
+ source: r,
1169
+ target: f,
1170
+ sourceX: a,
1171
+ sourceY: s,
1172
+ targetX: l,
1173
+ targetY: g,
1174
+ style: o = {},
1175
+ markerEnd: i,
1176
+ data: d
1177
+ }) => {
1178
+ const y = (d == null ? void 0 : d.verticalRouting) ?? !1, h = 30, N = y ? (() => {
1179
+ const S = g - h;
1180
+ return `M ${a},${S} L ${l},${S} L ${l},${g}`;
1181
+ })() : (() => {
1182
+ const S = s + 30;
1183
+ return `M ${a},${s} L ${a},${S} L ${l},${S} L ${l},${g}`;
1184
+ })(), p = o.stroke || "#d1d5db", c = d == null ? void 0 : d.label, v = (d == null ? void 0 : d.isFirst) ?? !1, m = d == null ? void 0 : d.onAddStepClick, w = y ? g - h : s + 30, k = a + (l - a) * (y ? 0.25 : 0.35), I = a + (l - a) * (y ? 0.65 : 0.7), u = w, z = (S) => {
1185
+ S.stopPropagation(), m && m(r, {
1186
+ edgeId: t,
1187
+ nodeId: r,
1188
+ sourceNodeId: r,
1189
+ targetNodeId: f,
1190
+ position: "between",
1191
+ referenceNodeId: r,
1192
+ filterId: d == null ? void 0 : d.filterId,
1193
+ branch: d == null ? void 0 : d.branch
1194
+ });
1195
+ }, A = 11.5, C = 6;
1196
+ return /* @__PURE__ */ n("g", { children: [
1197
+ /* @__PURE__ */ e("path", { id: t, d: N, fill: "none", stroke: p, strokeWidth: 1.5, markerEnd: i }),
1198
+ c && !y && /* @__PURE__ */ e("g", { transform: `translate(${k}, ${u})`, children: (() => {
1199
+ const S = Math.max(44, c.length * 7 + 20);
1200
+ return /* @__PURE__ */ n(R, { children: [
1201
+ /* @__PURE__ */ e(
1202
+ "rect",
1203
+ {
1204
+ x: -S / 2,
1205
+ y: -11,
1206
+ width: S,
1207
+ height: 22,
1208
+ rx: 11,
1209
+ fill: v ? "#e8f5e9" : "#ffebee",
1210
+ stroke: v ? "#81c784" : "#e57373",
1211
+ strokeWidth: 1
1212
+ }
1213
+ ),
1214
+ /* @__PURE__ */ e(
1215
+ "text",
1216
+ {
1217
+ x: 0,
1218
+ y: 4,
1219
+ textAnchor: "middle",
1220
+ fontSize: 10,
1221
+ fontWeight: 600,
1222
+ fill: v ? "#2e7d32" : "#c62828",
1223
+ style: { fontFamily: "sans-serif", pointerEvents: "none" },
1224
+ children: c
1225
+ }
1226
+ )
1227
+ ] });
1228
+ })() }),
1229
+ m && /* @__PURE__ */ n(
1230
+ "g",
1231
+ {
1232
+ transform: `translate(${I}, ${u})`,
1233
+ onClick: z,
1234
+ style: { cursor: "pointer", pointerEvents: "all" },
1235
+ className: "nodrag nopan edge-plus-svg",
1236
+ children: [
1237
+ /* @__PURE__ */ e("circle", { r: A, className: "edge-plus-circle" }),
1238
+ /* @__PURE__ */ e("line", { x1: 0, y1: -C, x2: 0, y2: C, strokeWidth: 2, strokeLinecap: "round", className: "plus-line" }),
1239
+ /* @__PURE__ */ e("line", { x1: -C, y1: 0, x2: C, y2: 0, strokeWidth: 2, strokeLinecap: "round", className: "plus-line" })
1240
+ ]
1241
+ }
1242
+ )
1243
+ ] });
1244
+ };
1245
+ export {
1246
+ $e as A,
1247
+ je as D,
1248
+ dt as E,
1249
+ Fe as F,
1250
+ ht as G,
1251
+ gt as L,
1252
+ He as N,
1253
+ pt as P,
1254
+ Oe as R,
1255
+ Te as S,
1256
+ Ae as T,
1257
+ Ue as W,
1258
+ Ie as a,
1259
+ Be as b,
1260
+ ze as c,
1261
+ at as d,
1262
+ ct as e,
1263
+ Ce as f
1264
+ };