@notmrabhi/flowforge 0.1.54 → 0.1.55

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