@oomol-lab/open-flow 0.1.0-alpha.13 → 0.1.0-alpha.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/{addNodeOptions-JRHMwVOl.js → addNodeOptions-0tjmBEYS.js} +968 -959
- package/dist/browser/{createResourceDialog-CWD62rU0.js → createResourceDialog-CRRJCp8F.js} +101 -101
- package/dist/browser/{esm-C04lx1pd.js → esm-CIApMBt7.js} +1 -1
- package/dist/browser/{flowWorkspace-_qaqIyDi.js → flowWorkspace-bWrxAxMV.js} +10212 -10070
- package/dist/browser/{useOpenInteractionType-CRgOHg5M.js → useOpenInteractionType-BtV5cRut.js} +1 -1
- package/dist/browser/workbench.css +1 -1
- package/dist/browser/workbench.d.ts +1 -0
- package/dist/browser/workbench.js +841 -799
- package/package.json +1 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { a as e, f as t, i as n } from "./dist-C46JByB-.js";
|
|
2
2
|
import { a as r, i, s as a, t as o } from "./main-DmjVyuWr.js";
|
|
3
|
-
import { $ as s,
|
|
4
|
-
import { $ as we, At as Te, B as Ee, Ct as De, Dt as Oe, Et as ke, G as Ae, H as je, J as Me, K as Ne, L as Pe, Ot as Fe, P as Ie, R as Le, St as Re, Tt as ze, Y as Be, _ as K, _t as Ve, a as q, bt as He, c as Ue, d as We, f as Ge, ft as Ke, g as J, gt as qe, ht as Je, i as Ye, kt as Xe, l as Ze, m as Qe, mt as $e, n as et, nt as tt, o as nt, ot as rt, pt as it, st as at, t as ot, tt as st, u as ct, v as Y, vt as lt, xt as ut, y as dt, yt as ft, z as pt } from "./addNodeOptions-
|
|
3
|
+
import { $ as s, $n as c, An as l, B as u, Bt as d, C as f, Et as p, F as m, Ft as h, Gn as g, H as _, Ht as v, It as y, Jn as b, Kn as ee, Ln as x, Mt as S, Nt as C, P as w, Pr as T, Pt as E, Qn as D, Tr as O, V as k, Y as A, Zn as j, _t as te, a as M, ar as N, at as ne, br as P, ct as F, dr as re, dt as ie, fr as ae, ft as I, gr as oe, gt as se, hr as ce, ht as L, ir as R, it as z, mt as B, n as V, nr as le, o as ue, ot as de, p as fe, pt as pe, qn as me, r as he, rr as H, sr as U, t as ge, tr as _e, ur as W, vt as ve, wr as ye, wt as G, xn as be, xr as xe, yr as Se, zt as Ce } from "./useOpenInteractionType-BtV5cRut.js";
|
|
4
|
+
import { $ as we, At as Te, B as Ee, Ct as De, Dt as Oe, Et as ke, G as Ae, H as je, J as Me, K as Ne, L as Pe, Ot as Fe, P as Ie, R as Le, St as Re, Tt as ze, Y as Be, _ as K, _t as Ve, a as q, bt as He, c as Ue, d as We, f as Ge, ft as Ke, g as J, gt as qe, ht as Je, i as Ye, kt as Xe, l as Ze, m as Qe, mt as $e, n as et, nt as tt, o as nt, ot as rt, pt as it, st as at, t as ot, tt as st, u as ct, v as Y, vt as lt, xt as ut, y as dt, yt as ft, z as pt } from "./addNodeOptions-0tjmBEYS.js";
|
|
5
5
|
import { a as mt, i as ht, n as gt, r as _t } from "./languages-DgJehE1g.js";
|
|
6
6
|
import { n as vt, r as yt, t as bt } from "./change-BATEvjif.js";
|
|
7
7
|
import * as X from "react";
|
|
8
8
|
import { Suspense as xt, lazy as St, useEffect as Ct, useRef as wt, useState as Tt } from "react";
|
|
9
9
|
import { Fragment as Et, jsx as Z, jsxs as Q } from "react/jsx-runtime";
|
|
10
10
|
//#region ../../node_modules/.bun/lucide-react@0.468.0+f4eacebf2041cd4f/node_modules/lucide-react/dist/esm/icons/chevron-up.js
|
|
11
|
-
var Dt =
|
|
11
|
+
var Dt = L("ChevronUp", [["path", {
|
|
12
12
|
d: "m18 15-6-6-6 6",
|
|
13
13
|
key: "153udz"
|
|
14
14
|
}]]), Ot = class {
|
|
@@ -112,12 +112,12 @@ var Mt = /*#__PURE__*/ X.createContext(null);
|
|
|
112
112
|
process.env.NODE_ENV !== "production" && (Mt.displayName = "SelectFloatingContext");
|
|
113
113
|
function Nt() {
|
|
114
114
|
let e = X.useContext(jt);
|
|
115
|
-
if (e === null) throw Error(process.env.NODE_ENV === "production" ?
|
|
115
|
+
if (e === null) throw Error(process.env.NODE_ENV === "production" ? Se(60) : "Base UI: SelectRootContext is missing. Select parts must be placed within <Select.Root>.");
|
|
116
116
|
return e;
|
|
117
117
|
}
|
|
118
118
|
function Pt() {
|
|
119
119
|
let e = X.useContext(Mt);
|
|
120
|
-
if (e === null) throw Error(process.env.NODE_ENV === "production" ?
|
|
120
|
+
if (e === null) throw Error(process.env.NODE_ENV === "production" ? Se(61) : "Base UI: SelectFloatingContext is missing. Select parts must be placed within <Select.Root>.");
|
|
121
121
|
return e;
|
|
122
122
|
}
|
|
123
123
|
//#endregion
|
|
@@ -198,41 +198,41 @@ function Kt(e, t, n) {
|
|
|
198
198
|
//#endregion
|
|
199
199
|
//#region ../../node_modules/.bun/@base-ui+react@1.4.1+b87d06724be9db7a/node_modules/@base-ui/react/esm/select/store.js
|
|
200
200
|
var $ = {
|
|
201
|
-
id:
|
|
202
|
-
labelId:
|
|
203
|
-
modal:
|
|
204
|
-
multiple:
|
|
205
|
-
items:
|
|
206
|
-
itemToStringLabel:
|
|
207
|
-
itemToStringValue:
|
|
208
|
-
isItemEqualToValue:
|
|
209
|
-
value:
|
|
210
|
-
hasSelectedValue:
|
|
201
|
+
id: u((e) => e.id),
|
|
202
|
+
labelId: u((e) => e.labelId),
|
|
203
|
+
modal: u((e) => e.modal),
|
|
204
|
+
multiple: u((e) => e.multiple),
|
|
205
|
+
items: u((e) => e.items),
|
|
206
|
+
itemToStringLabel: u((e) => e.itemToStringLabel),
|
|
207
|
+
itemToStringValue: u((e) => e.itemToStringValue),
|
|
208
|
+
isItemEqualToValue: u((e) => e.isItemEqualToValue),
|
|
209
|
+
value: u((e) => e.value),
|
|
210
|
+
hasSelectedValue: u((e) => {
|
|
211
211
|
let { value: t, multiple: n, itemToStringValue: r } = e;
|
|
212
212
|
return t == null ? !1 : n && Array.isArray(t) ? t.length > 0 : Wt(t, r) !== "";
|
|
213
213
|
}),
|
|
214
|
-
hasNullItemLabel:
|
|
215
|
-
open:
|
|
216
|
-
mounted:
|
|
217
|
-
forceMount:
|
|
218
|
-
transitionStatus:
|
|
219
|
-
openMethod:
|
|
220
|
-
activeIndex:
|
|
221
|
-
selectedIndex:
|
|
222
|
-
isActive:
|
|
223
|
-
isSelected:
|
|
214
|
+
hasNullItemLabel: u((e, t) => t ? Ht(e.items) : !1),
|
|
215
|
+
open: u((e) => e.open),
|
|
216
|
+
mounted: u((e) => e.mounted),
|
|
217
|
+
forceMount: u((e) => e.forceMount),
|
|
218
|
+
transitionStatus: u((e) => e.transitionStatus),
|
|
219
|
+
openMethod: u((e) => e.openMethod),
|
|
220
|
+
activeIndex: u((e) => e.activeIndex),
|
|
221
|
+
selectedIndex: u((e) => e.selectedIndex),
|
|
222
|
+
isActive: u((e, t) => e.activeIndex === t),
|
|
223
|
+
isSelected: u((e, t, n) => {
|
|
224
224
|
let r = e.isItemEqualToValue, i = e.value;
|
|
225
225
|
return e.multiple ? Array.isArray(i) && i.some((e) => It(n, e, r)) : e.selectedIndex === t && e.selectedIndex !== null || It(n, i, r);
|
|
226
226
|
}),
|
|
227
|
-
isSelectedByFocus:
|
|
228
|
-
popupProps:
|
|
229
|
-
triggerProps:
|
|
230
|
-
triggerElement:
|
|
231
|
-
positionerElement:
|
|
232
|
-
listElement:
|
|
233
|
-
scrollUpArrowVisible:
|
|
234
|
-
scrollDownArrowVisible:
|
|
235
|
-
hasScrollArrows:
|
|
227
|
+
isSelectedByFocus: u((e, t) => e.selectedIndex === t),
|
|
228
|
+
popupProps: u((e) => e.popupProps),
|
|
229
|
+
triggerProps: u((e) => e.triggerProps),
|
|
230
|
+
triggerElement: u((e) => e.triggerElement),
|
|
231
|
+
positionerElement: u((e) => e.positionerElement),
|
|
232
|
+
listElement: u((e) => e.listElement),
|
|
233
|
+
scrollUpArrowVisible: u((e) => e.scrollUpArrowVisible),
|
|
234
|
+
scrollDownArrowVisible: u((e) => e.scrollDownArrowVisible),
|
|
235
|
+
hasScrollArrows: u((e) => e.hasScrollArrows)
|
|
236
236
|
};
|
|
237
237
|
//#endregion
|
|
238
238
|
//#region ../../node_modules/.bun/@base-ui+react@1.4.1+b87d06724be9db7a/node_modules/@base-ui/react/esm/internals/clamp.js
|
|
@@ -250,32 +250,32 @@ function Yt(e, t) {
|
|
|
250
250
|
//#endregion
|
|
251
251
|
//#region ../../node_modules/.bun/@base-ui+react@1.4.1+b87d06724be9db7a/node_modules/@base-ui/react/esm/select/root/SelectRoot.js
|
|
252
252
|
function Xt(e) {
|
|
253
|
-
let { id: t, value: n, defaultValue: r = null, onValueChange: i, open: a, defaultOpen: o = !1, onOpenChange: s, name: c, form:
|
|
253
|
+
let { id: t, value: n, defaultValue: r = null, onValueChange: i, open: a, defaultOpen: o = !1, onOpenChange: s, name: c, form: l, autoComplete: u, disabled: d = !1, readOnly: g = !1, required: _ = !1, modal: v = !0, actionsRef: b, inputRef: ee, onOpenChangeComplete: x, items: S, multiple: T = !1, itemToStringLabel: D, itemToStringValue: A, isItemEqualToValue: M = Ft, highlightItemOnHover: N = !0, children: F } = e, { clearErrors: ie } = Te(), { setDirty: I, setTouched: oe, setFocused: se, shouldValidateOnChange: L, validityData: R, setFilled: B, name: le, disabled: ue, validation: fe, validationMode: pe } = j(), H = me({ id: t }), U = ue || d, _e = le ?? c, [W, ve] = E({
|
|
254
254
|
controlled: n,
|
|
255
|
-
default:
|
|
255
|
+
default: T ? r ?? re : r,
|
|
256
256
|
name: "Select",
|
|
257
257
|
state: "value"
|
|
258
|
-
}), [G,
|
|
258
|
+
}), [G, be] = E({
|
|
259
259
|
controlled: a,
|
|
260
260
|
default: o,
|
|
261
261
|
name: "Select",
|
|
262
262
|
state: "open"
|
|
263
|
-
}),
|
|
263
|
+
}), Se = X.useRef([]), Ce = X.useRef([]), Ee = X.useRef(null), De = X.useRef(null), Oe = X.useRef(0), ke = X.useRef(null), Ae = X.useRef([]), je = X.useRef(!1), Ne = X.useRef(!1), Pe = X.useRef(null), Fe = X.useRef({
|
|
264
264
|
allowSelectedMouseUp: !1,
|
|
265
265
|
allowUnselectedMouseUp: !1
|
|
266
|
-
}), Ie = X.useRef(!1), { mounted: Le, setMounted: Re, transitionStatus: ze } =
|
|
267
|
-
id:
|
|
266
|
+
}), Ie = X.useRef(!1), { mounted: Le, setMounted: Re, transitionStatus: ze } = h(G), { openMethod: K, triggerProps: Ve } = ge(G), q = O(() => new w({
|
|
267
|
+
id: H,
|
|
268
268
|
labelId: void 0,
|
|
269
|
-
modal:
|
|
270
|
-
multiple:
|
|
271
|
-
itemToStringLabel:
|
|
272
|
-
itemToStringValue:
|
|
273
|
-
isItemEqualToValue:
|
|
269
|
+
modal: v,
|
|
270
|
+
multiple: T,
|
|
271
|
+
itemToStringLabel: D,
|
|
272
|
+
itemToStringValue: A,
|
|
273
|
+
isItemEqualToValue: M,
|
|
274
274
|
value: W,
|
|
275
275
|
open: G,
|
|
276
276
|
mounted: Le,
|
|
277
277
|
transitionStatus: ze,
|
|
278
|
-
items:
|
|
278
|
+
items: S,
|
|
279
279
|
forceMount: !1,
|
|
280
280
|
openMethod: null,
|
|
281
281
|
activeIndex: null,
|
|
@@ -288,78 +288,78 @@ function Xt(e) {
|
|
|
288
288
|
scrollUpArrowVisible: !1,
|
|
289
289
|
scrollDownArrowVisible: !1,
|
|
290
290
|
hasScrollArrows: !1
|
|
291
|
-
})).current, He =
|
|
292
|
-
|
|
291
|
+
})).current, He = m(q, $.activeIndex), Ue = m(q, $.selectedIndex), We = m(q, $.triggerElement), Ge = m(q, $.positionerElement), Ke = At(K), J = K ?? Ke, qe = X.useMemo(() => T && Array.isArray(W) && W.length === 0 ? "" : Wt(W, A), [
|
|
292
|
+
T,
|
|
293
293
|
W,
|
|
294
|
-
|
|
295
|
-
]), Je = X.useMemo(() =>
|
|
296
|
-
|
|
294
|
+
A
|
|
295
|
+
]), Je = X.useMemo(() => T && Array.isArray(W) ? W.map((e) => Wt(e, A)) : Wt(W, A), [
|
|
296
|
+
T,
|
|
297
297
|
W,
|
|
298
|
-
|
|
299
|
-
]), Ye = de(q.state.triggerElement), Xe =
|
|
300
|
-
|
|
301
|
-
id:
|
|
298
|
+
A
|
|
299
|
+
]), Ye = de(q.state.triggerElement), Xe = ye(() => Je);
|
|
300
|
+
C(Ye, {
|
|
301
|
+
id: H,
|
|
302
302
|
value: W,
|
|
303
303
|
getValue: Xe
|
|
304
304
|
});
|
|
305
305
|
let Ze = X.useRef(W);
|
|
306
|
-
|
|
306
|
+
xe(() => {
|
|
307
307
|
W !== Ze.current && q.set("forceMount", !0);
|
|
308
|
-
}, [q, W]),
|
|
309
|
-
|
|
308
|
+
}, [q, W]), xe(() => {
|
|
309
|
+
B(T ? Array.isArray(W) && W.length > 0 : W != null);
|
|
310
310
|
}, [
|
|
311
|
-
|
|
311
|
+
T,
|
|
312
312
|
W,
|
|
313
|
-
|
|
314
|
-
]),
|
|
313
|
+
B
|
|
314
|
+
]), xe(function() {
|
|
315
315
|
if (G) return;
|
|
316
316
|
let e = Ae.current;
|
|
317
|
-
if (
|
|
317
|
+
if (T) {
|
|
318
318
|
let t = Array.isArray(W) ? W : [];
|
|
319
319
|
if (t.length === 0) {
|
|
320
320
|
q.set("selectedIndex", null);
|
|
321
321
|
return;
|
|
322
322
|
}
|
|
323
|
-
let n = t[t.length - 1], r = Rt(e, n,
|
|
323
|
+
let n = t[t.length - 1], r = Rt(e, n, M);
|
|
324
324
|
q.set("selectedIndex", r === -1 ? null : r);
|
|
325
325
|
return;
|
|
326
326
|
}
|
|
327
|
-
let t = Rt(e, W,
|
|
327
|
+
let t = Rt(e, W, M);
|
|
328
328
|
q.set("selectedIndex", t === -1 ? null : t);
|
|
329
329
|
}, [
|
|
330
|
-
|
|
330
|
+
T,
|
|
331
331
|
G,
|
|
332
332
|
W,
|
|
333
333
|
Ae,
|
|
334
|
-
|
|
334
|
+
M,
|
|
335
335
|
q
|
|
336
336
|
]), V(W, () => {
|
|
337
|
-
|
|
337
|
+
ie(_e), I(W !== R.initialValue), L() ? fe.commit(W) : fe.commit(W, !0);
|
|
338
338
|
});
|
|
339
|
-
let Qe =
|
|
340
|
-
if (s?.(e, t), !t.isCanceled && (
|
|
341
|
-
let e =
|
|
339
|
+
let Qe = ye((e, t) => {
|
|
340
|
+
if (s?.(e, t), !t.isCanceled && (be(e), !e && (t.reason === "focus-out" || t.reason === "outside-press") && (oe(!0), se(!1), pe === "onBlur" && fe.commit(W)), !e && q.state.activeIndex !== null)) {
|
|
341
|
+
let e = Se.current[q.state.activeIndex];
|
|
342
342
|
queueMicrotask(() => {
|
|
343
343
|
e?.setAttribute("tabindex", "-1");
|
|
344
344
|
});
|
|
345
345
|
}
|
|
346
|
-
}), $e =
|
|
346
|
+
}), $e = ye(() => {
|
|
347
347
|
Re(!1), q.update({
|
|
348
348
|
activeIndex: null,
|
|
349
349
|
openMethod: null
|
|
350
|
-
}),
|
|
350
|
+
}), x?.(!1);
|
|
351
351
|
});
|
|
352
|
-
|
|
353
|
-
enabled: !
|
|
352
|
+
y({
|
|
353
|
+
enabled: !b,
|
|
354
354
|
open: G,
|
|
355
355
|
ref: Ee,
|
|
356
356
|
onComplete() {
|
|
357
357
|
G || $e();
|
|
358
358
|
}
|
|
359
|
-
}), X.useImperativeHandle(
|
|
360
|
-
let et =
|
|
361
|
-
i?.(e, t), !t.isCanceled &&
|
|
362
|
-
}), nt =
|
|
359
|
+
}), X.useImperativeHandle(b, () => ({ unmount: $e }), [$e]);
|
|
360
|
+
let et = ye((e, t) => {
|
|
361
|
+
i?.(e, t), !t.isCanceled && ve(e);
|
|
362
|
+
}), nt = ye(() => {
|
|
363
363
|
let e = q.state.listElement || Ee.current;
|
|
364
364
|
if (!e) return;
|
|
365
365
|
let t = Jt(e.scrollHeight, e.clientHeight), n = Yt(e.scrollTop, t), r = n > 0, i = n < t;
|
|
@@ -372,20 +372,20 @@ function Xt(e) {
|
|
|
372
372
|
floating: Ge
|
|
373
373
|
}
|
|
374
374
|
}), it = tt(rt, {
|
|
375
|
-
enabled: !
|
|
375
|
+
enabled: !g && !U,
|
|
376
376
|
event: "mousedown"
|
|
377
|
-
}), at =
|
|
378
|
-
enabled: !
|
|
379
|
-
listRef:
|
|
377
|
+
}), at = k(rt, { bubbles: !1 }), ot = Be(rt, {
|
|
378
|
+
enabled: !g && !U,
|
|
379
|
+
listRef: Se,
|
|
380
380
|
activeIndex: He,
|
|
381
381
|
selectedIndex: Ue,
|
|
382
|
-
disabledIndices:
|
|
382
|
+
disabledIndices: re,
|
|
383
383
|
onNavigate(e) {
|
|
384
384
|
e === null && !G || q.set("activeIndex", e);
|
|
385
385
|
},
|
|
386
|
-
focusItemOnHover:
|
|
386
|
+
focusItemOnHover: N
|
|
387
387
|
}), st = Me(rt, {
|
|
388
|
-
enabled: !
|
|
388
|
+
enabled: !g && !U && (G || !T),
|
|
389
389
|
listRef: Ce,
|
|
390
390
|
activeIndex: He,
|
|
391
391
|
selectedIndex: Ue,
|
|
@@ -395,66 +395,66 @@ function Xt(e) {
|
|
|
395
395
|
onTypingChange(e) {
|
|
396
396
|
je.current = e;
|
|
397
397
|
}
|
|
398
|
-
}), { getReferenceProps: ct, getFloatingProps: Y, getItemProps: lt } =
|
|
398
|
+
}), { getReferenceProps: ct, getFloatingProps: Y, getItemProps: lt } = f([
|
|
399
399
|
it,
|
|
400
400
|
at,
|
|
401
401
|
ot,
|
|
402
402
|
st
|
|
403
|
-
]), ut = X.useMemo(() =>
|
|
403
|
+
]), ut = X.useMemo(() => P(ct(), Ve, H ? { id: H } : ae), [
|
|
404
404
|
ct,
|
|
405
405
|
Ve,
|
|
406
|
-
|
|
406
|
+
H
|
|
407
407
|
]);
|
|
408
408
|
he(() => {
|
|
409
409
|
q.update({
|
|
410
410
|
popupProps: Y(),
|
|
411
411
|
triggerProps: ut
|
|
412
412
|
});
|
|
413
|
-
}),
|
|
413
|
+
}), xe(() => {
|
|
414
414
|
q.update({
|
|
415
|
-
id:
|
|
416
|
-
modal:
|
|
417
|
-
multiple:
|
|
415
|
+
id: H,
|
|
416
|
+
modal: v,
|
|
417
|
+
multiple: T,
|
|
418
418
|
value: W,
|
|
419
419
|
open: G,
|
|
420
420
|
mounted: Le,
|
|
421
421
|
transitionStatus: ze,
|
|
422
422
|
popupProps: Y(),
|
|
423
423
|
triggerProps: ut,
|
|
424
|
-
items:
|
|
425
|
-
itemToStringLabel:
|
|
426
|
-
itemToStringValue:
|
|
427
|
-
isItemEqualToValue:
|
|
424
|
+
items: S,
|
|
425
|
+
itemToStringLabel: D,
|
|
426
|
+
itemToStringValue: A,
|
|
427
|
+
isItemEqualToValue: M,
|
|
428
428
|
openMethod: J
|
|
429
429
|
});
|
|
430
430
|
}, [
|
|
431
431
|
q,
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
432
|
+
H,
|
|
433
|
+
v,
|
|
434
|
+
T,
|
|
435
435
|
W,
|
|
436
436
|
G,
|
|
437
437
|
Le,
|
|
438
438
|
ze,
|
|
439
439
|
Y,
|
|
440
440
|
ut,
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
441
|
+
S,
|
|
442
|
+
D,
|
|
443
|
+
A,
|
|
444
|
+
M,
|
|
445
445
|
J
|
|
446
446
|
]);
|
|
447
447
|
let dt = X.useMemo(() => ({
|
|
448
448
|
store: q,
|
|
449
|
-
name:
|
|
450
|
-
required:
|
|
451
|
-
disabled:
|
|
452
|
-
readOnly:
|
|
453
|
-
multiple:
|
|
454
|
-
highlightItemOnHover:
|
|
449
|
+
name: _e,
|
|
450
|
+
required: _,
|
|
451
|
+
disabled: U,
|
|
452
|
+
readOnly: g,
|
|
453
|
+
multiple: T,
|
|
454
|
+
highlightItemOnHover: N,
|
|
455
455
|
setValue: et,
|
|
456
456
|
setOpen: Qe,
|
|
457
|
-
listRef:
|
|
457
|
+
listRef: Se,
|
|
458
458
|
popupRef: Ee,
|
|
459
459
|
scrollHandlerRef: De,
|
|
460
460
|
handleScrollArrowVisibility: nt,
|
|
@@ -467,73 +467,73 @@ function Xt(e) {
|
|
|
467
467
|
typingRef: je,
|
|
468
468
|
selectionRef: Fe,
|
|
469
469
|
selectedItemTextRef: Pe,
|
|
470
|
-
validation:
|
|
471
|
-
onOpenChangeComplete:
|
|
470
|
+
validation: fe,
|
|
471
|
+
onOpenChangeComplete: x,
|
|
472
472
|
keyboardActiveRef: Ne,
|
|
473
473
|
alignItemWithTriggerActiveRef: Ie,
|
|
474
474
|
initialValueRef: Ze
|
|
475
475
|
}), [
|
|
476
476
|
q,
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
477
|
+
_e,
|
|
478
|
+
_,
|
|
479
|
+
U,
|
|
480
|
+
g,
|
|
481
|
+
T,
|
|
482
|
+
N,
|
|
483
483
|
et,
|
|
484
484
|
Qe,
|
|
485
485
|
lt,
|
|
486
486
|
rt.context.events,
|
|
487
|
-
|
|
488
|
-
|
|
487
|
+
fe,
|
|
488
|
+
x,
|
|
489
489
|
nt
|
|
490
|
-
]), ft =
|
|
491
|
-
let t = Wt(e,
|
|
490
|
+
]), ft = ce(ee, fe.inputRef), pt = T && Array.isArray(W) && W.length > 0, mt = T ? void 0 : _e, ht = X.useMemo(() => !T || !Array.isArray(W) || !_e ? null : W.map((e) => {
|
|
491
|
+
let t = Wt(e, A);
|
|
492
492
|
return /*#__PURE__*/ Z("input", {
|
|
493
493
|
type: "hidden",
|
|
494
|
-
form:
|
|
495
|
-
name:
|
|
494
|
+
form: l,
|
|
495
|
+
name: _e,
|
|
496
496
|
value: t
|
|
497
497
|
}, t);
|
|
498
498
|
}), [
|
|
499
|
-
|
|
499
|
+
T,
|
|
500
500
|
W,
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
501
|
+
l,
|
|
502
|
+
_e,
|
|
503
|
+
A
|
|
504
504
|
]);
|
|
505
505
|
return /*#__PURE__*/ Z(jt.Provider, {
|
|
506
506
|
value: dt,
|
|
507
507
|
children: /*#__PURE__*/ Q(Mt.Provider, {
|
|
508
508
|
value: rt,
|
|
509
509
|
children: [
|
|
510
|
-
|
|
510
|
+
F,
|
|
511
511
|
/*#__PURE__*/ Z("input", {
|
|
512
|
-
...
|
|
512
|
+
...fe.getInputValidationProps({
|
|
513
513
|
onFocus() {
|
|
514
514
|
q.state.triggerElement?.focus({ focusVisible: !0 });
|
|
515
515
|
},
|
|
516
516
|
onChange(e) {
|
|
517
517
|
if (e.nativeEvent.defaultPrevented) return;
|
|
518
|
-
let t = e.currentTarget.value, n = te(
|
|
518
|
+
let t = e.currentTarget.value, n = te(p, e.nativeEvent);
|
|
519
519
|
function r() {
|
|
520
|
-
if (
|
|
521
|
-
let e = Ae.current.find((e) => Wt(e,
|
|
522
|
-
e != null && (
|
|
520
|
+
if (T) return;
|
|
521
|
+
let e = Ae.current.find((e) => Wt(e, A).toLowerCase() === t.toLowerCase() || Ut(e, D).toLowerCase() === t.toLowerCase());
|
|
522
|
+
e != null && (I(e !== R.initialValue), et(e, n), L() && fe.commit(e));
|
|
523
523
|
}
|
|
524
524
|
q.set("forceMount", !0), queueMicrotask(r);
|
|
525
525
|
}
|
|
526
526
|
}),
|
|
527
|
-
id:
|
|
528
|
-
form:
|
|
527
|
+
id: H && mt == null ? `${H}-hidden-input` : void 0,
|
|
528
|
+
form: l,
|
|
529
529
|
name: mt,
|
|
530
|
-
autoComplete:
|
|
530
|
+
autoComplete: u,
|
|
531
531
|
value: qe,
|
|
532
|
-
disabled:
|
|
533
|
-
required:
|
|
534
|
-
readOnly:
|
|
532
|
+
disabled: U,
|
|
533
|
+
required: _ && !pt,
|
|
534
|
+
readOnly: g,
|
|
535
535
|
ref: ft,
|
|
536
|
-
style:
|
|
536
|
+
style: _e ? ne : z,
|
|
537
537
|
tabIndex: -1,
|
|
538
538
|
"aria-hidden": !0,
|
|
539
539
|
suppressHydrationWarning: !0
|
|
@@ -551,106 +551,106 @@ function Zt(e, t) {
|
|
|
551
551
|
//#endregion
|
|
552
552
|
//#region ../../node_modules/.bun/@base-ui+react@1.4.1+b87d06724be9db7a/node_modules/@base-ui/react/esm/select/trigger/SelectTrigger.js
|
|
553
553
|
var Qt = 2, $t = 400, en = 200, tn = {
|
|
554
|
-
...
|
|
555
|
-
...
|
|
554
|
+
...I,
|
|
555
|
+
...D,
|
|
556
556
|
value: () => null
|
|
557
557
|
}, nn = /*#__PURE__*/ X.forwardRef(function(e, t) {
|
|
558
|
-
let { render: n, className: r, id: i, disabled: a = !1, nativeButton: o = !0, style: s, ...c } = e, { setTouched:
|
|
559
|
-
|
|
560
|
-
let B = de(
|
|
561
|
-
disabled:
|
|
558
|
+
let { render: n, className: r, id: i, disabled: a = !1, nativeButton: o = !0, style: s, ...c } = e, { setTouched: u, setFocused: d, validationMode: f, state: h, disabled: g } = j(), { labelId: _ } = b(), { store: y, setOpen: S, selectionRef: C, validation: w, readOnly: T, required: E, alignItemWithTriggerActiveRef: D, disabled: O, keyboardActiveRef: k } = Nt(), A = g || O || a, M = m(y, $.open), N = m(y, $.value), ne = m(y, $.triggerProps), F = m(y, $.positionerElement), re = m(y, $.listElement), ie = m(y, $.id), ae = m(y, $.labelId), I = m(y, $.hasSelectedValue), se = !I && M, L = m(y, $.hasNullItemLabel, se), R = i ?? ie, z = Zt(_, ae);
|
|
559
|
+
me({ id: R });
|
|
560
|
+
let B = de(F), V = X.useRef(null), { getButtonProps: le, buttonRef: ue } = oe({
|
|
561
|
+
disabled: A,
|
|
562
562
|
native: o
|
|
563
|
-
}),
|
|
564
|
-
|
|
565
|
-
}),
|
|
563
|
+
}), fe = ye((e) => {
|
|
564
|
+
y.set("triggerElement", e);
|
|
565
|
+
}), pe = ce(t, V, ue, fe), he = v(), H = v(), U = v(), ge = v();
|
|
566
566
|
X.useEffect(() => {
|
|
567
|
-
if (M) return
|
|
568
|
-
|
|
569
|
-
|
|
567
|
+
if (M) return I || L ? ge.start(en, () => {
|
|
568
|
+
C.current.allowUnselectedMouseUp = !0, U.start(en, () => {
|
|
569
|
+
C.current.allowSelectedMouseUp = !0;
|
|
570
570
|
});
|
|
571
|
-
}) :
|
|
572
|
-
|
|
571
|
+
}) : U.start($t, () => {
|
|
572
|
+
C.current.allowUnselectedMouseUp = !0, C.current.allowSelectedMouseUp = !0;
|
|
573
573
|
}), () => {
|
|
574
|
-
|
|
574
|
+
U.clear(), ge.clear();
|
|
575
575
|
};
|
|
576
|
-
|
|
576
|
+
C.current = {
|
|
577
577
|
allowSelectedMouseUp: !1,
|
|
578
578
|
allowUnselectedMouseUp: !1
|
|
579
|
-
},
|
|
579
|
+
}, H.clear();
|
|
580
580
|
}, [
|
|
581
581
|
M,
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
582
|
+
I,
|
|
583
|
+
L,
|
|
584
|
+
C,
|
|
585
|
+
H,
|
|
586
|
+
U,
|
|
587
587
|
ge
|
|
588
588
|
]);
|
|
589
|
-
let _e = X.useMemo(() => re?.id ??
|
|
590
|
-
id:
|
|
589
|
+
let _e = X.useMemo(() => re?.id ?? l(F)?.id, [re, F]), G = P(ne, {
|
|
590
|
+
id: R,
|
|
591
591
|
role: "combobox",
|
|
592
592
|
"aria-expanded": M ? "true" : "false",
|
|
593
593
|
"aria-haspopup": "listbox",
|
|
594
594
|
"aria-controls": M ? _e : void 0,
|
|
595
|
-
"aria-labelledby":
|
|
596
|
-
"aria-readonly":
|
|
597
|
-
"aria-required":
|
|
598
|
-
tabIndex:
|
|
599
|
-
ref:
|
|
595
|
+
"aria-labelledby": z,
|
|
596
|
+
"aria-readonly": T || void 0,
|
|
597
|
+
"aria-required": E || void 0,
|
|
598
|
+
tabIndex: A ? -1 : 0,
|
|
599
|
+
ref: pe,
|
|
600
600
|
onFocus(e) {
|
|
601
|
-
|
|
602
|
-
|
|
601
|
+
d(!0), M && D.current && S(!1, te(p, e.nativeEvent)), he.start(0, () => {
|
|
602
|
+
y.set("forceMount", !0);
|
|
603
603
|
});
|
|
604
604
|
},
|
|
605
605
|
onBlur(e) {
|
|
606
|
-
|
|
606
|
+
x(F, e.relatedTarget) || (u(!0), d(!1), f === "onBlur" && w.commit(N));
|
|
607
607
|
},
|
|
608
608
|
onPointerMove() {
|
|
609
|
-
|
|
609
|
+
k.current = !1;
|
|
610
610
|
},
|
|
611
611
|
onKeyDown() {
|
|
612
|
-
|
|
612
|
+
k.current = !0;
|
|
613
613
|
},
|
|
614
614
|
onMouseDown(e) {
|
|
615
615
|
if (M) return;
|
|
616
|
-
let t =
|
|
616
|
+
let t = ee(e.currentTarget);
|
|
617
617
|
function n(e) {
|
|
618
618
|
if (!V.current) return;
|
|
619
619
|
let t = e.target;
|
|
620
|
-
if (
|
|
620
|
+
if (x(V.current, t) || x(B.current, t) || t === V.current) return;
|
|
621
621
|
let n = Ie(V.current);
|
|
622
|
-
e.clientX >= n.left - Qt && e.clientX <= n.right + Qt && e.clientY >= n.top - Qt && e.clientY <= n.bottom + Qt ||
|
|
622
|
+
e.clientX >= n.left - Qt && e.clientX <= n.right + Qt && e.clientY >= n.top - Qt && e.clientY <= n.bottom + Qt || S(!1, te(ve, e));
|
|
623
623
|
}
|
|
624
|
-
|
|
624
|
+
H.start(0, () => {
|
|
625
625
|
t.addEventListener("mouseup", n, { once: !0 });
|
|
626
626
|
});
|
|
627
627
|
}
|
|
628
|
-
},
|
|
629
|
-
|
|
630
|
-
let
|
|
631
|
-
...
|
|
628
|
+
}, w.getValidationProps, c, le);
|
|
629
|
+
G.role = "combobox";
|
|
630
|
+
let be = {
|
|
631
|
+
...h,
|
|
632
632
|
open: M,
|
|
633
|
-
disabled:
|
|
633
|
+
disabled: A,
|
|
634
634
|
value: N,
|
|
635
|
-
readOnly:
|
|
636
|
-
placeholder: !
|
|
635
|
+
readOnly: T,
|
|
636
|
+
placeholder: !I
|
|
637
637
|
};
|
|
638
|
-
return
|
|
638
|
+
return W("button", e, {
|
|
639
639
|
ref: [t, V],
|
|
640
|
-
state:
|
|
640
|
+
state: be,
|
|
641
641
|
stateAttributesMapping: tn,
|
|
642
|
-
props:
|
|
642
|
+
props: G
|
|
643
643
|
});
|
|
644
644
|
});
|
|
645
645
|
process.env.NODE_ENV !== "production" && (nn.displayName = "SelectTrigger");
|
|
646
646
|
//#endregion
|
|
647
647
|
//#region ../../node_modules/.bun/@base-ui+react@1.4.1+b87d06724be9db7a/node_modules/@base-ui/react/esm/select/value/SelectValue.js
|
|
648
648
|
var rn = { value: () => null }, an = /*#__PURE__*/ X.forwardRef(function(e, t) {
|
|
649
|
-
let { className: n, render: r, children: i, placeholder: a, style: o, ...s } = e, { store: c, valueRef: l } = Nt(), u =
|
|
649
|
+
let { className: n, render: r, children: i, placeholder: a, style: o, ...s } = e, { store: c, valueRef: l } = Nt(), u = m(c, $.value), d = m(c, $.items), f = m(c, $.itemToStringLabel), p = m(c, $.hasSelectedValue), h = !p && a != null && i == null, g = m(c, $.hasNullItemLabel, h), _ = {
|
|
650
650
|
value: u,
|
|
651
|
-
placeholder: !
|
|
651
|
+
placeholder: !p
|
|
652
652
|
}, v = null;
|
|
653
|
-
return v = typeof i == "function" ? i(u) : i ?? (!
|
|
653
|
+
return v = typeof i == "function" ? i(u) : i ?? (!p && a != null && !g ? a : Array.isArray(u) ? Kt(u, d, f) : Gt(u, d, f)), W("span", e, {
|
|
654
654
|
state: _,
|
|
655
655
|
ref: [t, l],
|
|
656
656
|
props: [{ children: v }, s],
|
|
@@ -661,8 +661,8 @@ process.env.NODE_ENV !== "production" && (an.displayName = "SelectValue");
|
|
|
661
661
|
//#endregion
|
|
662
662
|
//#region ../../node_modules/.bun/@base-ui+react@1.4.1+b87d06724be9db7a/node_modules/@base-ui/react/esm/select/icon/SelectIcon.js
|
|
663
663
|
var on = /*#__PURE__*/ X.forwardRef(function(e, t) {
|
|
664
|
-
let { className: n, render: r, style: i, ...a } = e, { store: o } = Nt(), s = { open:
|
|
665
|
-
return
|
|
664
|
+
let { className: n, render: r, style: i, ...a } = e, { store: o } = Nt(), s = { open: m(o, $.open) };
|
|
665
|
+
return W("span", e, {
|
|
666
666
|
state: s,
|
|
667
667
|
ref: t,
|
|
668
668
|
props: [{
|
|
@@ -680,10 +680,10 @@ process.env.NODE_ENV !== "production" && (sn.displayName = "SelectPortalContext"
|
|
|
680
680
|
//#endregion
|
|
681
681
|
//#region ../../node_modules/.bun/@base-ui+react@1.4.1+b87d06724be9db7a/node_modules/@base-ui/react/esm/select/portal/SelectPortal.js
|
|
682
682
|
var cn = /*#__PURE__*/ X.forwardRef(function(e, t) {
|
|
683
|
-
let { store: n } = Nt(), r =
|
|
683
|
+
let { store: n } = Nt(), r = m(n, $.mounted), i = m(n, $.forceMount);
|
|
684
684
|
return r || i ? /*#__PURE__*/ Z(sn.Provider, {
|
|
685
685
|
value: !0,
|
|
686
|
-
children: /*#__PURE__*/ Z(
|
|
686
|
+
children: /*#__PURE__*/ Z(A, {
|
|
687
687
|
ref: t,
|
|
688
688
|
...e
|
|
689
689
|
})
|
|
@@ -696,7 +696,7 @@ var ln = /*#__PURE__*/ X.createContext(void 0);
|
|
|
696
696
|
process.env.NODE_ENV !== "production" && (ln.displayName = "SelectPositionerContext");
|
|
697
697
|
function un() {
|
|
698
698
|
let e = X.useContext(ln);
|
|
699
|
-
if (!e) throw Error(process.env.NODE_ENV === "production" ?
|
|
699
|
+
if (!e) throw Error(process.env.NODE_ENV === "production" ? Se(59) : "Base UI: SelectPositionerContext is missing. SelectPositioner parts must be placed within <Select.Positioner>.");
|
|
700
700
|
return e;
|
|
701
701
|
}
|
|
702
702
|
//#endregion
|
|
@@ -710,83 +710,83 @@ var fn = {
|
|
|
710
710
|
overflowX: "hidden",
|
|
711
711
|
overflowY: "auto"
|
|
712
712
|
}, pn = { position: "fixed" }, mn = /*#__PURE__*/ X.forwardRef(function(e, t) {
|
|
713
|
-
let { anchor: n, positionMethod: r = "absolute", className: i, render: a, side: o = "bottom", align: c = "center", sideOffset: l = 0, alignOffset:
|
|
714
|
-
!
|
|
715
|
-
|
|
716
|
-
}, [
|
|
717
|
-
let
|
|
713
|
+
let { anchor: n, positionMethod: r = "absolute", className: i, render: a, side: o = "bottom", align: c = "center", sideOffset: l = 0, alignOffset: u = 0, collisionBoundary: d = "clipping-ancestors", collisionPadding: f, arrowPadding: h = 5, sticky: g = !1, disableAnchorTracking: _, alignItemWithTrigger: v = !0, collisionAvoidance: y = s, style: b, ...ee } = e, { store: x, listRef: S, labelsRef: C, alignItemWithTriggerActiveRef: w, selectedItemTextRef: T, valuesRef: E, initialValueRef: D, popupRef: O, setValue: k } = Nt(), A = Pt(), j = m(x, $.open), N = m(x, $.mounted), ne = m(x, $.modal), P = m(x, $.value), F = m(x, $.openMethod), re = m(x, $.positionerElement), ie = m(x, $.triggerElement), ae = m(x, $.isItemEqualToValue), I = m(x, $.transitionStatus), oe = X.useRef(null), se = X.useRef(null), [ce, L] = X.useState(v), R = N && ce && F !== "touch";
|
|
714
|
+
!N && ce !== v && L(v), xe(() => {
|
|
715
|
+
N || ($.scrollUpArrowVisible(x.state) && x.set("scrollUpArrowVisible", !1), $.scrollDownArrowVisible(x.state) && x.set("scrollDownArrowVisible", !1));
|
|
716
|
+
}, [x, N]), X.useImperativeHandle(w, () => R), Pe((R || ne) && j, F === "touch", re, ie);
|
|
717
|
+
let z = Ee({
|
|
718
718
|
anchor: n,
|
|
719
|
-
floatingRootContext:
|
|
719
|
+
floatingRootContext: A,
|
|
720
720
|
positionMethod: r,
|
|
721
|
-
mounted:
|
|
721
|
+
mounted: N,
|
|
722
722
|
side: o,
|
|
723
723
|
sideOffset: l,
|
|
724
724
|
align: c,
|
|
725
|
-
alignOffset:
|
|
726
|
-
arrowPadding:
|
|
727
|
-
collisionBoundary:
|
|
728
|
-
collisionPadding:
|
|
729
|
-
sticky:
|
|
730
|
-
disableAnchorTracking:
|
|
731
|
-
collisionAvoidance:
|
|
725
|
+
alignOffset: u,
|
|
726
|
+
arrowPadding: h,
|
|
727
|
+
collisionBoundary: d,
|
|
728
|
+
collisionPadding: f,
|
|
729
|
+
sticky: g,
|
|
730
|
+
disableAnchorTracking: _ ?? R,
|
|
731
|
+
collisionAvoidance: y,
|
|
732
732
|
keepMounted: !0
|
|
733
|
-
}),
|
|
734
|
-
open:
|
|
735
|
-
side:
|
|
736
|
-
align:
|
|
737
|
-
anchorHidden:
|
|
738
|
-
}, de =
|
|
739
|
-
|
|
740
|
-
}), fe = Le(e,
|
|
741
|
-
styles:
|
|
742
|
-
transitionStatus:
|
|
743
|
-
props:
|
|
733
|
+
}), B = R ? "none" : z.side, V = R ? pn : z.positionerStyles, le = {
|
|
734
|
+
open: j,
|
|
735
|
+
side: B,
|
|
736
|
+
align: z.align,
|
|
737
|
+
anchorHidden: z.anchorHidden
|
|
738
|
+
}, de = ye((e) => {
|
|
739
|
+
x.set("positionerElement", e);
|
|
740
|
+
}), fe = Le(e, le, {
|
|
741
|
+
styles: V,
|
|
742
|
+
transitionStatus: I,
|
|
743
|
+
props: ee,
|
|
744
744
|
refs: [t, de],
|
|
745
|
-
hidden: !
|
|
746
|
-
inert: !
|
|
747
|
-
}), pe = X.useRef(0), me =
|
|
748
|
-
if (e.size === 0 && pe.current === 0 ||
|
|
745
|
+
hidden: !N,
|
|
746
|
+
inert: !j
|
|
747
|
+
}), pe = X.useRef(0), me = ye((e) => {
|
|
748
|
+
if (e.size === 0 && pe.current === 0 || E.current.length === 0) return;
|
|
749
749
|
let t = pe.current;
|
|
750
750
|
if (pe.current = e.size, e.size === t) return;
|
|
751
|
-
let n = te(
|
|
752
|
-
if (t !== 0 && !
|
|
753
|
-
let e =
|
|
754
|
-
|
|
751
|
+
let n = te(p);
|
|
752
|
+
if (t !== 0 && !x.state.multiple && P !== null && Rt(E.current, P, ae) === -1) {
|
|
753
|
+
let e = D.current, t = e != null && Rt(E.current, e, ae) !== -1 ? e : null;
|
|
754
|
+
k(t, n), t === null && (x.set("selectedIndex", null), T.current = null);
|
|
755
755
|
}
|
|
756
|
-
if (t !== 0 &&
|
|
757
|
-
let e = (e) => Rt(
|
|
758
|
-
(t.length !==
|
|
756
|
+
if (t !== 0 && x.state.multiple && Array.isArray(P)) {
|
|
757
|
+
let e = (e) => Rt(E.current, e, ae) !== -1, t = P.filter((t) => e(t));
|
|
758
|
+
(t.length !== P.length || t.some((e) => !Lt(P, e, ae))) && (k(t, n), t.length === 0 && (x.set("selectedIndex", null), T.current = null));
|
|
759
759
|
}
|
|
760
|
-
if (
|
|
761
|
-
|
|
760
|
+
if (j && R) {
|
|
761
|
+
x.update({
|
|
762
762
|
scrollUpArrowVisible: !1,
|
|
763
763
|
scrollDownArrowVisible: !1
|
|
764
764
|
});
|
|
765
765
|
let e = { height: "" };
|
|
766
|
-
dn(
|
|
766
|
+
dn(re, e), dn(O.current, e);
|
|
767
767
|
}
|
|
768
768
|
}), he = X.useMemo(() => ({
|
|
769
|
-
...
|
|
770
|
-
side:
|
|
771
|
-
alignItemWithTriggerActive:
|
|
772
|
-
setControlledAlignItemWithTrigger:
|
|
773
|
-
scrollUpArrowRef:
|
|
774
|
-
scrollDownArrowRef:
|
|
769
|
+
...z,
|
|
770
|
+
side: B,
|
|
771
|
+
alignItemWithTriggerActive: R,
|
|
772
|
+
setControlledAlignItemWithTrigger: L,
|
|
773
|
+
scrollUpArrowRef: oe,
|
|
774
|
+
scrollDownArrowRef: se
|
|
775
775
|
}), [
|
|
776
|
-
B,
|
|
777
|
-
V,
|
|
778
776
|
z,
|
|
779
|
-
|
|
777
|
+
B,
|
|
778
|
+
R,
|
|
779
|
+
L
|
|
780
780
|
]);
|
|
781
781
|
return /*#__PURE__*/ Z(pt, {
|
|
782
|
-
elementsRef:
|
|
783
|
-
labelsRef:
|
|
782
|
+
elementsRef: S,
|
|
783
|
+
labelsRef: C,
|
|
784
784
|
onMapChange: me,
|
|
785
785
|
children: /*#__PURE__*/ Q(ln.Provider, {
|
|
786
786
|
value: he,
|
|
787
|
-
children: [
|
|
788
|
-
inert:
|
|
789
|
-
cutout:
|
|
787
|
+
children: [N && ne && /*#__PURE__*/ Z(M, {
|
|
788
|
+
inert: ue(!j),
|
|
789
|
+
cutout: ie
|
|
790
790
|
}), fe]
|
|
791
791
|
})
|
|
792
792
|
});
|
|
@@ -817,37 +817,37 @@ function yn() {
|
|
|
817
817
|
//#endregion
|
|
818
818
|
//#region ../../node_modules/.bun/@base-ui+react@1.4.1+b87d06724be9db7a/node_modules/@base-ui/react/esm/select/popup/SelectPopup.js
|
|
819
819
|
var bn = {
|
|
820
|
-
...
|
|
821
|
-
...
|
|
820
|
+
...ie,
|
|
821
|
+
...Ce
|
|
822
822
|
}, xn = /*#__PURE__*/ X.forwardRef(function(e, t) {
|
|
823
|
-
let { render: n, className: r, style: i, finalFocus: a, ...o } = e, { store: s, popupRef: c, onOpenChangeComplete: l, setOpen:
|
|
824
|
-
if (!
|
|
825
|
-
if (
|
|
826
|
-
|
|
823
|
+
let { render: n, className: r, style: i, finalFocus: a, ...o } = e, { store: s, popupRef: c, onOpenChangeComplete: l, setOpen: u, valueRef: f, selectedItemTextRef: p, keyboardActiveRef: h, multiple: v, handleScrollArrowVisibility: b, scrollHandlerRef: x, listRef: C, highlightItemOnHover: w } = Nt(), { side: E, align: D, alignItemWithTriggerActive: O, isPositioned: k, setControlledAlignItemWithTrigger: A, scrollDownArrowRef: j, scrollUpArrowRef: M } = un(), N = Ne(!0) != null, ne = Pt(), P = je(), { nonce: re, disableStyleElements: ie } = yn(), ae = m(s, $.id), I = m(s, $.open), oe = m(s, $.mounted), se = m(s, $.popupProps), ce = m(s, $.transitionStatus), L = m(s, $.triggerElement), R = m(s, $.positionerElement), z = m(s, $.listElement), B = X.useRef(!1), V = X.useRef(!1), le = X.useRef({}), ue = d(), de = ye((e) => {
|
|
824
|
+
if (!R || !c.current || !V.current) return;
|
|
825
|
+
if (B.current || !O) {
|
|
826
|
+
b();
|
|
827
827
|
return;
|
|
828
828
|
}
|
|
829
|
-
let t =
|
|
829
|
+
let t = R.style.top === "0px", n = R.style.bottom === "0px";
|
|
830
830
|
if (!t && !n) {
|
|
831
|
-
|
|
831
|
+
b();
|
|
832
832
|
return;
|
|
833
833
|
}
|
|
834
|
-
let r = wn(
|
|
835
|
-
|
|
836
|
-
},
|
|
834
|
+
let r = wn(R), i = Tn(R.getBoundingClientRect().height, "y", r), a = ee(R), o = getComputedStyle(R), s = parseFloat(o.marginTop), l = parseFloat(o.marginBottom), u = Sn(getComputedStyle(c.current)), d = Math.min(a.documentElement.clientHeight - s - l, u), f = e.scrollTop, p = Cn(e), m = 0, h = null, g = !1, _ = !1, v = (e) => {
|
|
835
|
+
R.style.height = `${e}px`;
|
|
836
|
+
}, y = (t, n) => {
|
|
837
837
|
let r = qt(t, 0, d - i);
|
|
838
|
-
r > 0 &&
|
|
839
|
-
},
|
|
840
|
-
if (
|
|
841
|
-
|
|
838
|
+
r > 0 && v(i + r), e.scrollTop = n, d - (i + r) <= 1 && (B.current = !0), b();
|
|
839
|
+
}, x = t ? p - f : f, S = Math.min(i + x, d);
|
|
840
|
+
if (m = S, x <= 1) {
|
|
841
|
+
y(x, t ? p : 0);
|
|
842
842
|
return;
|
|
843
843
|
}
|
|
844
|
-
if (d - S > 1 ? t ?
|
|
845
|
-
let t = Cn(e), n =
|
|
844
|
+
if (d - S > 1 ? t ? _ = !0 : h = 0 : (g = !0, n && f < p && (h = f - (x - (i + x - d)))), m = Math.ceil(m), m !== 0 && v(m), _ || h != null) {
|
|
845
|
+
let t = Cn(e), n = _ ? t : qt(h, 0, t);
|
|
846
846
|
Math.abs(e.scrollTop - n) > 1 && (e.scrollTop = n);
|
|
847
847
|
}
|
|
848
|
-
(
|
|
848
|
+
(g || m >= d - 1) && (B.current = !0), b();
|
|
849
849
|
});
|
|
850
|
-
X.useImperativeHandle(
|
|
850
|
+
X.useImperativeHandle(x, () => de, [de]), y({
|
|
851
851
|
open: I,
|
|
852
852
|
ref: c,
|
|
853
853
|
onComplete() {
|
|
@@ -857,134 +857,134 @@ var bn = {
|
|
|
857
857
|
let pe = {
|
|
858
858
|
open: I,
|
|
859
859
|
transitionStatus: ce,
|
|
860
|
-
side:
|
|
861
|
-
align:
|
|
860
|
+
side: E,
|
|
861
|
+
align: D
|
|
862
862
|
};
|
|
863
|
-
|
|
864
|
-
!
|
|
865
|
-
top:
|
|
866
|
-
left:
|
|
867
|
-
right:
|
|
868
|
-
height:
|
|
869
|
-
bottom:
|
|
870
|
-
minHeight:
|
|
871
|
-
maxHeight:
|
|
872
|
-
marginTop:
|
|
873
|
-
marginBottom:
|
|
863
|
+
xe(() => {
|
|
864
|
+
!R || !c.current || Object.keys(le.current).length || (le.current = {
|
|
865
|
+
top: R.style.top || "0",
|
|
866
|
+
left: R.style.left || "0",
|
|
867
|
+
right: R.style.right,
|
|
868
|
+
height: R.style.height,
|
|
869
|
+
bottom: R.style.bottom,
|
|
870
|
+
minHeight: R.style.minHeight,
|
|
871
|
+
maxHeight: R.style.maxHeight,
|
|
872
|
+
marginTop: R.style.marginTop,
|
|
873
|
+
marginBottom: R.style.marginBottom
|
|
874
874
|
});
|
|
875
|
-
}, [c,
|
|
876
|
-
I || O || (
|
|
875
|
+
}, [c, R]), xe(() => {
|
|
876
|
+
I || O || (V.current = !1, B.current = !1, dn(R, le.current));
|
|
877
877
|
}, [
|
|
878
878
|
I,
|
|
879
879
|
O,
|
|
880
|
-
|
|
880
|
+
R,
|
|
881
881
|
c
|
|
882
|
-
]),
|
|
882
|
+
]), xe(() => {
|
|
883
883
|
let e = c.current;
|
|
884
|
-
if (!I || !
|
|
884
|
+
if (!I || !L || !R || !e || O && !k || s.state.transitionStatus === "ending") return;
|
|
885
885
|
if (!O) {
|
|
886
|
-
|
|
886
|
+
V.current = !0, ue.request(b), e.style.removeProperty("--transform-origin");
|
|
887
887
|
return;
|
|
888
888
|
}
|
|
889
889
|
let t = On(e);
|
|
890
890
|
e.style.removeProperty("--transform-origin");
|
|
891
891
|
try {
|
|
892
|
-
let t =
|
|
892
|
+
let t = p.current, n = f.current, r = getComputedStyle(R), i = getComputedStyle(e), a = ee(L), o = T(R), c = wn(L), l = En(L.getBoundingClientRect(), c), u = En(R.getBoundingClientRect(), c), d = l.height, m = z || e, h = m.scrollHeight, _ = parseFloat(i.borderBottomWidth), v = parseFloat(r.marginTop) || 10, y = parseFloat(r.marginBottom) || 10, x = parseFloat(r.minHeight) || 100, S = Sn(i), E = a.documentElement.clientHeight - v - y, D = a.documentElement.clientWidth, O = E - l.bottom + d, k, j = P === "rtl" ? l.right - u.width : l.left, te = 0;
|
|
893
893
|
if (t && n) {
|
|
894
894
|
let e = En(n.getBoundingClientRect(), c);
|
|
895
|
-
k = En(t.getBoundingClientRect(), c),
|
|
895
|
+
k = En(t.getBoundingClientRect(), c), j = u.left + (P === "rtl" ? e.right - k.right : e.left - k.left);
|
|
896
896
|
let r = e.top - l.top + e.height / 2;
|
|
897
|
-
|
|
897
|
+
te = k.top - u.top + k.height / 2 - r;
|
|
898
898
|
}
|
|
899
|
-
let M = O +
|
|
900
|
-
|
|
901
|
-
let ie = Cn(
|
|
902
|
-
ae && (N = Math.min(
|
|
903
|
-
let
|
|
904
|
-
if (
|
|
905
|
-
|
|
899
|
+
let M = O + te + y + _, N = Math.min(E, M), ne = E - v - y, F = M - N, re = D - 5;
|
|
900
|
+
R.style.left = `${qt(j, 5, re - u.width)}px`, R.style.height = `${N}px`, R.style.maxHeight = "auto", R.style.marginTop = `${v}px`, R.style.marginBottom = `${y}px`, e.style.height = "100%";
|
|
901
|
+
let ie = Cn(m), ae = F >= ie - 1;
|
|
902
|
+
ae && (N = Math.min(E, u.height) - (F - ie));
|
|
903
|
+
let I = l.top < 20 || l.bottom > E - 20 || Math.ceil(N) + 1 < Math.min(h, x), oe = (o.visualViewport?.scale ?? 1) !== 1 && g;
|
|
904
|
+
if (I || oe) {
|
|
905
|
+
V.current = !0, dn(R, le.current), A(!1);
|
|
906
906
|
return;
|
|
907
907
|
}
|
|
908
|
-
let se = Math.max(
|
|
908
|
+
let se = Math.max(x, N);
|
|
909
909
|
if (ae) {
|
|
910
|
-
let e = Math.max(0,
|
|
911
|
-
|
|
912
|
-
} else
|
|
910
|
+
let e = Math.max(0, E - M);
|
|
911
|
+
R.style.top = u.height >= ne ? "0" : `${e}px`, R.style.height = `${N}px`, m.scrollTop = Cn(m);
|
|
912
|
+
} else R.style.bottom = "0", m.scrollTop = F;
|
|
913
913
|
if (k) {
|
|
914
914
|
let t = u.top, n = u.height, r = k.top + k.height / 2, i = qt(n > 0 ? (r - t) / n * 100 : 50, 0, 100);
|
|
915
915
|
e.style.setProperty("--transform-origin", `50% ${i}%`);
|
|
916
916
|
}
|
|
917
|
-
(se ===
|
|
917
|
+
(se === E || N >= S) && (B.current = !0), b(), w && s.state.selectedIndex === null && s.state.activeIndex === null && C.current[0] != null && s.set("activeIndex", 0), V.current = !0;
|
|
918
918
|
} finally {
|
|
919
919
|
t();
|
|
920
920
|
}
|
|
921
921
|
}, [
|
|
922
922
|
s,
|
|
923
923
|
I,
|
|
924
|
-
|
|
925
|
-
|
|
924
|
+
R,
|
|
925
|
+
L,
|
|
926
|
+
f,
|
|
926
927
|
p,
|
|
927
|
-
g,
|
|
928
928
|
c,
|
|
929
|
-
|
|
929
|
+
b,
|
|
930
930
|
O,
|
|
931
931
|
A,
|
|
932
|
-
|
|
932
|
+
ue,
|
|
933
933
|
j,
|
|
934
934
|
M,
|
|
935
|
-
|
|
935
|
+
z,
|
|
936
936
|
C,
|
|
937
937
|
w,
|
|
938
|
-
|
|
938
|
+
P,
|
|
939
939
|
k
|
|
940
940
|
]), X.useEffect(() => {
|
|
941
|
-
if (!O || !
|
|
942
|
-
let e =
|
|
941
|
+
if (!O || !R || !I) return;
|
|
942
|
+
let e = T(R);
|
|
943
943
|
function t(e) {
|
|
944
|
-
|
|
944
|
+
u(!1, te(S, e));
|
|
945
945
|
}
|
|
946
|
-
return
|
|
946
|
+
return F(e, "resize", t);
|
|
947
947
|
}, [
|
|
948
|
-
|
|
948
|
+
u,
|
|
949
949
|
O,
|
|
950
|
-
|
|
950
|
+
R,
|
|
951
951
|
I
|
|
952
952
|
]);
|
|
953
953
|
let me = {
|
|
954
|
-
...
|
|
954
|
+
...z ? {
|
|
955
955
|
role: "presentation",
|
|
956
956
|
"aria-orientation": void 0
|
|
957
957
|
} : {
|
|
958
958
|
role: "listbox",
|
|
959
|
-
"aria-multiselectable":
|
|
960
|
-
id: `${
|
|
959
|
+
"aria-multiselectable": v || void 0,
|
|
960
|
+
id: `${ae}-list`
|
|
961
961
|
},
|
|
962
962
|
onKeyDown(e) {
|
|
963
|
-
|
|
963
|
+
h.current = !0, N && fe.has(e.key) && e.stopPropagation();
|
|
964
964
|
},
|
|
965
965
|
onMouseMove() {
|
|
966
|
-
|
|
966
|
+
h.current = !1;
|
|
967
967
|
},
|
|
968
968
|
onScroll(e) {
|
|
969
|
-
|
|
969
|
+
z || de(e.currentTarget);
|
|
970
970
|
},
|
|
971
|
-
...O && { style:
|
|
972
|
-
}, he =
|
|
971
|
+
...O && { style: z ? { height: "100%" } : fn }
|
|
972
|
+
}, he = W("div", e, {
|
|
973
973
|
ref: [t, c],
|
|
974
974
|
state: pe,
|
|
975
975
|
stateAttributesMapping: bn,
|
|
976
976
|
props: [
|
|
977
|
-
|
|
977
|
+
se,
|
|
978
978
|
me,
|
|
979
979
|
Ae(ce),
|
|
980
|
-
{ className: !
|
|
980
|
+
{ className: !z && O ? gn.className : void 0 },
|
|
981
981
|
o
|
|
982
982
|
]
|
|
983
983
|
});
|
|
984
|
-
return /*#__PURE__*/ Q(X.Fragment, { children: [!
|
|
985
|
-
context:
|
|
984
|
+
return /*#__PURE__*/ Q(X.Fragment, { children: [!ie && gn.getElement(re), /*#__PURE__*/ Z(_, {
|
|
985
|
+
context: ne,
|
|
986
986
|
modal: !1,
|
|
987
|
-
disabled: !
|
|
987
|
+
disabled: !oe,
|
|
988
988
|
returnFocus: a,
|
|
989
989
|
restoreFocus: !0,
|
|
990
990
|
children: he
|
|
@@ -1005,7 +1005,7 @@ function Tn(e, t, n) {
|
|
|
1005
1005
|
return e / n[t];
|
|
1006
1006
|
}
|
|
1007
1007
|
function En(e, t) {
|
|
1008
|
-
return
|
|
1008
|
+
return be({
|
|
1009
1009
|
x: Tn(e.x, "x", t),
|
|
1010
1010
|
y: Tn(e.y, "y", t),
|
|
1011
1011
|
width: Tn(e.width, "x", t),
|
|
@@ -1030,21 +1030,21 @@ function On(e) {
|
|
|
1030
1030
|
//#endregion
|
|
1031
1031
|
//#region ../../node_modules/.bun/@base-ui+react@1.4.1+b87d06724be9db7a/node_modules/@base-ui/react/esm/select/list/SelectList.js
|
|
1032
1032
|
var kn = /*#__PURE__*/ X.forwardRef(function(e, t) {
|
|
1033
|
-
let { className: n, render: r, style: i, ...a } = e, { store: o, scrollHandlerRef: s } = Nt(), { alignItemWithTriggerActive: c } = un(), l =
|
|
1034
|
-
id: `${
|
|
1033
|
+
let { className: n, render: r, style: i, ...a } = e, { store: o, scrollHandlerRef: s } = Nt(), { alignItemWithTriggerActive: c } = un(), l = m(o, $.hasScrollArrows), u = m(o, $.openMethod), d = m(o, $.multiple), f = {
|
|
1034
|
+
id: `${m(o, $.id)}-list`,
|
|
1035
1035
|
role: "listbox",
|
|
1036
|
-
"aria-multiselectable":
|
|
1036
|
+
"aria-multiselectable": d || void 0,
|
|
1037
1037
|
onScroll(e) {
|
|
1038
1038
|
s.current?.(e.currentTarget);
|
|
1039
1039
|
},
|
|
1040
1040
|
...c && { style: fn },
|
|
1041
|
-
className: l &&
|
|
1042
|
-
},
|
|
1041
|
+
className: l && u !== "touch" ? gn.className : void 0
|
|
1042
|
+
}, p = ye((e) => {
|
|
1043
1043
|
o.set("listElement", e);
|
|
1044
1044
|
});
|
|
1045
|
-
return
|
|
1046
|
-
ref: [t,
|
|
1047
|
-
props: [
|
|
1045
|
+
return W("div", e, {
|
|
1046
|
+
ref: [t, p],
|
|
1047
|
+
props: [f, a]
|
|
1048
1048
|
});
|
|
1049
1049
|
});
|
|
1050
1050
|
process.env.NODE_ENV !== "production" && (kn.displayName = "SelectList");
|
|
@@ -1054,7 +1054,7 @@ var An = /*#__PURE__*/ X.createContext(void 0);
|
|
|
1054
1054
|
process.env.NODE_ENV !== "production" && (An.displayName = "SelectItemContext");
|
|
1055
1055
|
function jn() {
|
|
1056
1056
|
let e = X.useContext(An);
|
|
1057
|
-
if (!e) throw Error(process.env.NODE_ENV === "production" ?
|
|
1057
|
+
if (!e) throw Error(process.env.NODE_ENV === "production" ? Se(57) : "Base UI: SelectItemContext is missing. SelectItem parts must be placed within <Select.Item>.");
|
|
1058
1058
|
return e;
|
|
1059
1059
|
}
|
|
1060
1060
|
//#endregion
|
|
@@ -1064,8 +1064,8 @@ var Mn = /*#__PURE__*/ X.memo(/*#__PURE__*/ X.forwardRef(function(e, t) {
|
|
|
1064
1064
|
label: a,
|
|
1065
1065
|
textRef: u,
|
|
1066
1066
|
indexGuessBehavior: rt.GuessFromOrder
|
|
1067
|
-
}), { store:
|
|
1068
|
-
|
|
1067
|
+
}), { store: f, getItemProps: p, setOpen: h, setValue: g, selectionRef: _, typingRef: v, valuesRef: y, multiple: b, selectedItemTextRef: ee } = Nt(), x = m(f, $.isActive, d.index), S = m(f, $.isSelected, d.index, i), C = m(f, $.isSelectedByFocus, d.index), w = m(f, $.isItemEqualToValue), T = d.index, E = T !== -1, D = X.useRef(null), O = de(T);
|
|
1068
|
+
xe(() => {
|
|
1069
1069
|
if (!E) return;
|
|
1070
1070
|
let e = y.current;
|
|
1071
1071
|
return e[T] = i, () => {
|
|
@@ -1076,42 +1076,42 @@ var Mn = /*#__PURE__*/ X.memo(/*#__PURE__*/ X.forwardRef(function(e, t) {
|
|
|
1076
1076
|
T,
|
|
1077
1077
|
i,
|
|
1078
1078
|
y
|
|
1079
|
-
]),
|
|
1079
|
+
]), xe(() => {
|
|
1080
1080
|
if (!E) return;
|
|
1081
|
-
let e =
|
|
1082
|
-
|
|
1081
|
+
let e = f.state.value, t = e;
|
|
1082
|
+
b && Array.isArray(e) && e.length > 0 && (t = e[e.length - 1]), t !== void 0 && It(i, t, w) && (f.set("selectedIndex", T), u.current && (ee.current = u.current));
|
|
1083
1083
|
}, [
|
|
1084
1084
|
E,
|
|
1085
1085
|
T,
|
|
1086
|
-
|
|
1086
|
+
b,
|
|
1087
1087
|
w,
|
|
1088
|
-
|
|
1088
|
+
f,
|
|
1089
1089
|
i,
|
|
1090
|
-
|
|
1090
|
+
ee
|
|
1091
1091
|
]);
|
|
1092
1092
|
let k = {
|
|
1093
1093
|
disabled: o,
|
|
1094
1094
|
selected: S,
|
|
1095
1095
|
highlighted: x
|
|
1096
|
-
}, A =
|
|
1096
|
+
}, A = p({
|
|
1097
1097
|
active: x,
|
|
1098
1098
|
selected: S
|
|
1099
1099
|
});
|
|
1100
1100
|
A.id = void 0;
|
|
1101
|
-
let j = X.useRef(null), M = X.useRef("mouse"), N = X.useRef(!1), { getButtonProps:
|
|
1101
|
+
let j = X.useRef(null), M = X.useRef("mouse"), N = X.useRef(!1), { getButtonProps: ne, buttonRef: P } = oe({
|
|
1102
1102
|
disabled: o,
|
|
1103
1103
|
focusableWhenDisabled: !0,
|
|
1104
1104
|
native: s,
|
|
1105
1105
|
composite: !0
|
|
1106
1106
|
});
|
|
1107
1107
|
function F(e) {
|
|
1108
|
-
let t =
|
|
1109
|
-
if (
|
|
1108
|
+
let t = f.state.value;
|
|
1109
|
+
if (b) {
|
|
1110
1110
|
let n = Array.isArray(t) ? t : [], r = S ? zt(n, i, w) : [...n, i];
|
|
1111
|
-
g(r, te(
|
|
1112
|
-
} else g(i, te(
|
|
1111
|
+
g(r, te(G, e));
|
|
1112
|
+
} else g(i, te(G, e)), h(!1, te(G, e));
|
|
1113
1113
|
}
|
|
1114
|
-
let
|
|
1114
|
+
let re = {
|
|
1115
1115
|
role: "option",
|
|
1116
1116
|
"aria-selected": S,
|
|
1117
1117
|
tabIndex: x ? 0 : -1,
|
|
@@ -1122,7 +1122,7 @@ var Mn = /*#__PURE__*/ X.memo(/*#__PURE__*/ X.forwardRef(function(e, t) {
|
|
|
1122
1122
|
};
|
|
1123
1123
|
},
|
|
1124
1124
|
onKeyDown(e) {
|
|
1125
|
-
j.current = e.key,
|
|
1125
|
+
j.current = e.key, f.set("activeIndex", T), e.key === " " && v.current && e.preventDefault();
|
|
1126
1126
|
},
|
|
1127
1127
|
onClick(e) {
|
|
1128
1128
|
N.current = !1, (e.type !== "keydown" || j.current !== null) && (o || e.type === "keydown" && j.current === " " && v.current || M.current !== "touch" && !x || (j.current = null, F(e.nativeEvent)));
|
|
@@ -1142,9 +1142,9 @@ var Mn = /*#__PURE__*/ X.memo(/*#__PURE__*/ X.forwardRef(function(e, t) {
|
|
|
1142
1142
|
let e = !_.current.allowSelectedMouseUp && S, t = !_.current.allowUnselectedMouseUp && !S;
|
|
1143
1143
|
e || t || M.current !== "touch" && !x || D.current?.click();
|
|
1144
1144
|
}
|
|
1145
|
-
},
|
|
1145
|
+
}, ie = W("div", e, {
|
|
1146
1146
|
ref: [
|
|
1147
|
-
|
|
1147
|
+
P,
|
|
1148
1148
|
t,
|
|
1149
1149
|
d.ref,
|
|
1150
1150
|
D
|
|
@@ -1152,11 +1152,11 @@ var Mn = /*#__PURE__*/ X.memo(/*#__PURE__*/ X.forwardRef(function(e, t) {
|
|
|
1152
1152
|
state: k,
|
|
1153
1153
|
props: [
|
|
1154
1154
|
A,
|
|
1155
|
-
|
|
1155
|
+
re,
|
|
1156
1156
|
l,
|
|
1157
|
-
|
|
1157
|
+
ne
|
|
1158
1158
|
]
|
|
1159
|
-
}),
|
|
1159
|
+
}), ae = X.useMemo(() => ({
|
|
1160
1160
|
selected: S,
|
|
1161
1161
|
indexRef: O,
|
|
1162
1162
|
textRef: u,
|
|
@@ -1170,8 +1170,8 @@ var Mn = /*#__PURE__*/ X.memo(/*#__PURE__*/ X.forwardRef(function(e, t) {
|
|
|
1170
1170
|
E
|
|
1171
1171
|
]);
|
|
1172
1172
|
return /*#__PURE__*/ Z(An.Provider, {
|
|
1173
|
-
value:
|
|
1174
|
-
children:
|
|
1173
|
+
value: ae,
|
|
1174
|
+
children: ie
|
|
1175
1175
|
});
|
|
1176
1176
|
}));
|
|
1177
1177
|
process.env.NODE_ENV !== "production" && (Mn.displayName = "SelectItem");
|
|
@@ -1186,7 +1186,7 @@ var Nn = /*#__PURE__*/ X.forwardRef(function(e, t) {
|
|
|
1186
1186
|
});
|
|
1187
1187
|
process.env.NODE_ENV !== "production" && (Nn.displayName = "SelectItemIndicator");
|
|
1188
1188
|
var Pn = /*#__PURE__*/ X.memo(/*#__PURE__*/ X.forwardRef((e, t) => {
|
|
1189
|
-
let { render: n, className: r, style: i, keepMounted: a, ...o } = e, { selected: s } = jn(), c = X.useRef(null), { transitionStatus: l, setMounted: u } =
|
|
1189
|
+
let { render: n, className: r, style: i, keepMounted: a, ...o } = e, { selected: s } = jn(), c = X.useRef(null), { transitionStatus: l, setMounted: u } = h(s), d = W("span", e, {
|
|
1190
1190
|
ref: [t, c],
|
|
1191
1191
|
state: {
|
|
1192
1192
|
selected: s,
|
|
@@ -1196,9 +1196,9 @@ var Pn = /*#__PURE__*/ X.memo(/*#__PURE__*/ X.forwardRef((e, t) => {
|
|
|
1196
1196
|
"aria-hidden": !0,
|
|
1197
1197
|
children: "✔️"
|
|
1198
1198
|
}, o],
|
|
1199
|
-
stateAttributesMapping:
|
|
1199
|
+
stateAttributesMapping: Ce
|
|
1200
1200
|
});
|
|
1201
|
-
return
|
|
1201
|
+
return y({
|
|
1202
1202
|
open: s,
|
|
1203
1203
|
ref: c,
|
|
1204
1204
|
onComplete() {
|
|
@@ -1220,7 +1220,7 @@ var Fn = /*#__PURE__*/ X.memo(/*#__PURE__*/ X.forwardRef(function(e, t) {
|
|
|
1220
1220
|
i,
|
|
1221
1221
|
a
|
|
1222
1222
|
]);
|
|
1223
|
-
return
|
|
1223
|
+
return W("div", e, {
|
|
1224
1224
|
ref: [
|
|
1225
1225
|
d,
|
|
1226
1226
|
t,
|
|
@@ -1233,54 +1233,54 @@ process.env.NODE_ENV !== "production" && (Fn.displayName = "SelectItemText");
|
|
|
1233
1233
|
//#endregion
|
|
1234
1234
|
//#region ../../node_modules/.bun/@base-ui+react@1.4.1+b87d06724be9db7a/node_modules/@base-ui/react/esm/select/scroll-arrow/SelectScrollArrow.js
|
|
1235
1235
|
var In = /*#__PURE__*/ X.forwardRef(function(e, t) {
|
|
1236
|
-
let { render: n, className: r, style: i, direction: a, keepMounted: o = !1, ...s } = e, c = a === "up", { store: l, popupRef: u, listRef: d, handleScrollArrowVisibility:
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
}), [l,
|
|
1240
|
-
open:
|
|
1241
|
-
ref:
|
|
1236
|
+
let { render: n, className: r, style: i, direction: a, keepMounted: o = !1, ...s } = e, c = a === "up", { store: l, popupRef: u, listRef: d, handleScrollArrowVisibility: f, scrollArrowsMountedCountRef: p } = Nt(), { side: g, scrollDownArrowRef: _, scrollUpArrowRef: b } = un(), ee = c ? $.scrollUpArrowVisible : $.scrollDownArrowVisible, x = m(l, ee), S = m(l, $.openMethod), C = x && S !== "touch", w = v(), T = c ? b : _, { transitionStatus: E, setMounted: D } = h(C);
|
|
1237
|
+
xe(() => (p.current += 1, l.state.hasScrollArrows || l.set("hasScrollArrows", !0), () => {
|
|
1238
|
+
p.current = Math.max(0, p.current - 1), p.current === 0 && l.state.hasScrollArrows && l.set("hasScrollArrows", !1);
|
|
1239
|
+
}), [l, p]), y({
|
|
1240
|
+
open: C,
|
|
1241
|
+
ref: T,
|
|
1242
1242
|
onComplete() {
|
|
1243
|
-
|
|
1243
|
+
C || D(!1);
|
|
1244
1244
|
}
|
|
1245
1245
|
});
|
|
1246
|
-
let O =
|
|
1247
|
-
ref: [t,
|
|
1246
|
+
let O = W("div", e, {
|
|
1247
|
+
ref: [t, T],
|
|
1248
1248
|
state: {
|
|
1249
1249
|
direction: a,
|
|
1250
|
-
visible:
|
|
1250
|
+
visible: C,
|
|
1251
1251
|
side: g,
|
|
1252
|
-
transitionStatus:
|
|
1252
|
+
transitionStatus: E
|
|
1253
1253
|
},
|
|
1254
1254
|
props: [{
|
|
1255
1255
|
"aria-hidden": !0,
|
|
1256
1256
|
children: c ? "▲" : "▼",
|
|
1257
1257
|
style: { position: "absolute" },
|
|
1258
1258
|
onMouseMove(e) {
|
|
1259
|
-
if (e.movementX === 0 && e.movementY === 0 ||
|
|
1259
|
+
if (e.movementX === 0 && e.movementY === 0 || w.isStarted()) return;
|
|
1260
1260
|
l.set("activeIndex", null);
|
|
1261
1261
|
function t() {
|
|
1262
1262
|
let e = l.state.listElement ?? u.current;
|
|
1263
1263
|
if (!e) return;
|
|
1264
|
-
l.set("activeIndex", null),
|
|
1264
|
+
l.set("activeIndex", null), f();
|
|
1265
1265
|
let n = Jt(e.scrollHeight, e.clientHeight), r = Yt(e.scrollTop, n), i = r === (c ? 0 : n), a = d.current;
|
|
1266
1266
|
if (r !== e.scrollTop && (e.scrollTop = r), a.length === 0 && l.set(c ? "scrollUpArrowVisible" : "scrollDownArrowVisible", !i), i) {
|
|
1267
|
-
|
|
1267
|
+
w.clear();
|
|
1268
1268
|
return;
|
|
1269
1269
|
}
|
|
1270
1270
|
if (a.length > 0) {
|
|
1271
|
-
let t =
|
|
1271
|
+
let t = T.current?.offsetHeight || 0;
|
|
1272
1272
|
e.scrollTop = Ln(a, c, r, e.clientHeight, t, n);
|
|
1273
1273
|
}
|
|
1274
|
-
|
|
1274
|
+
w.start(40, t);
|
|
1275
1275
|
}
|
|
1276
|
-
|
|
1276
|
+
w.start(40, t);
|
|
1277
1277
|
},
|
|
1278
1278
|
onMouseLeave() {
|
|
1279
|
-
|
|
1279
|
+
w.clear();
|
|
1280
1280
|
}
|
|
1281
1281
|
}, s]
|
|
1282
1282
|
});
|
|
1283
|
-
return
|
|
1283
|
+
return C || o ? O : null;
|
|
1284
1284
|
});
|
|
1285
1285
|
process.env.NODE_ENV !== "production" && (In.displayName = "SelectScrollArrow");
|
|
1286
1286
|
function Ln(e, t, n, r, i, a) {
|
|
@@ -1337,7 +1337,7 @@ var Vn = /*#__PURE__*/ X.forwardRef(function(e, t) {
|
|
|
1337
1337
|
let { className: n, render: r, style: i, ...a } = e, [o, s] = X.useState(), c = X.useMemo(() => ({
|
|
1338
1338
|
labelId: o,
|
|
1339
1339
|
setLabelId: s
|
|
1340
|
-
}), [o, s]), l =
|
|
1340
|
+
}), [o, s]), l = W("div", e, {
|
|
1341
1341
|
ref: t,
|
|
1342
1342
|
props: [{
|
|
1343
1343
|
role: "group",
|
|
@@ -1457,7 +1457,7 @@ function Xn({ ariaLabel: e, disabled: t = !1, onValueChange: n, options: r, port
|
|
|
1457
1457
|
}
|
|
1458
1458
|
//#endregion
|
|
1459
1459
|
//#region src/workbench/browser/runtime/shell/resourceBrowser.tsx
|
|
1460
|
-
var Zn = St(() => import("./createResourceDialog-
|
|
1460
|
+
var Zn = St(() => import("./createResourceDialog-CRRJCp8F.js")), Qn = mt.map((e) => ({
|
|
1461
1461
|
label: ht[e],
|
|
1462
1462
|
value: e
|
|
1463
1463
|
}));
|
|
@@ -1491,7 +1491,7 @@ function er({ busy: e, flow: t, href: n, onSelect: a, store: o }) {
|
|
|
1491
1491
|
return /* @__PURE__ */ Q("div", {
|
|
1492
1492
|
className: "resource-item-row",
|
|
1493
1493
|
children: [
|
|
1494
|
-
/* @__PURE__ */ Q(
|
|
1494
|
+
/* @__PURE__ */ Q(N, {
|
|
1495
1495
|
"aria-disabled": t.status == "retiring",
|
|
1496
1496
|
className: "resource-list-row flow-columns",
|
|
1497
1497
|
nativeButton: !1,
|
|
@@ -1529,7 +1529,7 @@ function er({ busy: e, flow: t, href: n, onSelect: a, store: o }) {
|
|
|
1529
1529
|
})
|
|
1530
1530
|
]
|
|
1531
1531
|
}),
|
|
1532
|
-
t.status == "active" && /* @__PURE__ */ Z(
|
|
1532
|
+
t.status == "active" && /* @__PURE__ */ Z(N, {
|
|
1533
1533
|
"aria-expanded": l != "idle",
|
|
1534
1534
|
"aria-label": c("sidebar.flowActions", { name: t.name }),
|
|
1535
1535
|
className: U("resource-row-more", l != "idle" && "active"),
|
|
@@ -1541,14 +1541,14 @@ function er({ busy: e, flow: t, href: n, onSelect: a, store: o }) {
|
|
|
1541
1541
|
}),
|
|
1542
1542
|
l == "actions" && /* @__PURE__ */ Q("div", {
|
|
1543
1543
|
className: "resource-row-actions",
|
|
1544
|
-
children: [/* @__PURE__ */ Z(
|
|
1544
|
+
children: [/* @__PURE__ */ Z(N, {
|
|
1545
1545
|
onClick: () => {
|
|
1546
1546
|
f(t.name), u("rename");
|
|
1547
1547
|
},
|
|
1548
1548
|
size: "sm",
|
|
1549
1549
|
variant: "outline",
|
|
1550
1550
|
children: c("common.rename")
|
|
1551
|
-
}), /* @__PURE__ */ Z(
|
|
1551
|
+
}), /* @__PURE__ */ Z(N, {
|
|
1552
1552
|
onClick: () => u("delete"),
|
|
1553
1553
|
size: "sm",
|
|
1554
1554
|
variant: "destructive",
|
|
@@ -1559,13 +1559,13 @@ function er({ busy: e, flow: t, href: n, onSelect: a, store: o }) {
|
|
|
1559
1559
|
className: "resource-row-form",
|
|
1560
1560
|
onSubmit: (e) => void m(e),
|
|
1561
1561
|
children: [
|
|
1562
|
-
/* @__PURE__ */ Z(
|
|
1562
|
+
/* @__PURE__ */ Z(R, {
|
|
1563
1563
|
htmlFor: `rename-flow-${t.flowId}`,
|
|
1564
1564
|
children: c("sidebar.renameFlow", { name: t.name })
|
|
1565
1565
|
}),
|
|
1566
1566
|
/* @__PURE__ */ Q("span", {
|
|
1567
1567
|
className: "resource-row-field",
|
|
1568
|
-
children: [/* @__PURE__ */ Z(
|
|
1568
|
+
children: [/* @__PURE__ */ Z(se, {
|
|
1569
1569
|
autoComplete: "off",
|
|
1570
1570
|
"aria-invalid": d.length > 0 && p != null,
|
|
1571
1571
|
autoFocus: !0,
|
|
@@ -1579,12 +1579,12 @@ function er({ busy: e, flow: t, href: n, onSelect: a, store: o }) {
|
|
|
1579
1579
|
children: c(`resource.nameIssue.${p}`, { max: 80 })
|
|
1580
1580
|
})]
|
|
1581
1581
|
}),
|
|
1582
|
-
/* @__PURE__ */ Q("div", { children: [/* @__PURE__ */ Z(
|
|
1582
|
+
/* @__PURE__ */ Q("div", { children: [/* @__PURE__ */ Z(N, {
|
|
1583
1583
|
onClick: () => u("idle"),
|
|
1584
1584
|
size: "sm",
|
|
1585
1585
|
variant: "outline",
|
|
1586
1586
|
children: c("common.cancel")
|
|
1587
|
-
}), /* @__PURE__ */ Z(
|
|
1587
|
+
}), /* @__PURE__ */ Z(N, {
|
|
1588
1588
|
disabled: e != null || p != null,
|
|
1589
1589
|
size: "sm",
|
|
1590
1590
|
type: "submit",
|
|
@@ -1596,12 +1596,12 @@ function er({ busy: e, flow: t, href: n, onSelect: a, store: o }) {
|
|
|
1596
1596
|
className: "resource-row-confirm",
|
|
1597
1597
|
role: "group",
|
|
1598
1598
|
"aria-label": c("sidebar.deleteFlow", { name: t.name }),
|
|
1599
|
-
children: [/* @__PURE__ */ Z("span", { children: /* @__PURE__ */ Z("strong", { children: c("sidebar.deleteFlowConfirm", { name: t.name }) }) }), /* @__PURE__ */ Q("div", { children: [/* @__PURE__ */ Z(
|
|
1599
|
+
children: [/* @__PURE__ */ Z("span", { children: /* @__PURE__ */ Z("strong", { children: c("sidebar.deleteFlowConfirm", { name: t.name }) }) }), /* @__PURE__ */ Q("div", { children: [/* @__PURE__ */ Z(N, {
|
|
1600
1600
|
onClick: () => u("idle"),
|
|
1601
1601
|
size: "sm",
|
|
1602
1602
|
variant: "outline",
|
|
1603
1603
|
children: c("common.cancel")
|
|
1604
|
-
}), /* @__PURE__ */ Z(
|
|
1604
|
+
}), /* @__PURE__ */ Z(N, {
|
|
1605
1605
|
disabled: e != null,
|
|
1606
1606
|
onClick: () => void h(),
|
|
1607
1607
|
size: "sm",
|
|
@@ -1612,12 +1612,29 @@ function er({ busy: e, flow: t, href: n, onSelect: a, store: o }) {
|
|
|
1612
1612
|
]
|
|
1613
1613
|
});
|
|
1614
1614
|
}
|
|
1615
|
-
function tr(
|
|
1616
|
-
|
|
1615
|
+
function tr() {
|
|
1616
|
+
return /* @__PURE__ */ Q("div", {
|
|
1617
|
+
"aria-hidden": "true",
|
|
1618
|
+
className: "resource-list-row resource-skeleton-row flow-columns",
|
|
1619
|
+
children: [
|
|
1620
|
+
/* @__PURE__ */ Q("span", {
|
|
1621
|
+
className: "resource-primary-cell",
|
|
1622
|
+
children: [/* @__PURE__ */ Z(it, { className: "size-8 shrink-0" }), /* @__PURE__ */ Q("span", {
|
|
1623
|
+
className: "resource-skeleton-copy",
|
|
1624
|
+
children: [/* @__PURE__ */ Z(it, { className: "h-3.5 w-36" }), /* @__PURE__ */ Z(it, { className: "h-2.5 w-48 max-w-full" })]
|
|
1625
|
+
})]
|
|
1626
|
+
}),
|
|
1627
|
+
/* @__PURE__ */ Z(it, { className: "h-3 w-28" }),
|
|
1628
|
+
/* @__PURE__ */ Z(it, { className: "h-3 w-16" })
|
|
1629
|
+
]
|
|
1630
|
+
});
|
|
1631
|
+
}
|
|
1632
|
+
function nr({ hrefForFlow: e, hostAction: t, hostTitle: n, language: i, onCreateFlow: o, onHostAction: s, onLanguageChange: c, onSelectFlow: l, store: u }) {
|
|
1633
|
+
let d = r(), f = a(u.workspace.$.busy), p = a(u.workspace.$.flowLoadFailed), m = a(u.workspace.$.flowLoadMoreFailed), h = a(u.workspace.$.flowLoading), g = a(u.workspace.$.flowLoadingMore), _ = a(u.workspace.$.flowNextCursor), v = a(u.workspace.$.flows), y = a(u.workspace.$.flowTotal), [b, ee] = Tt(!1), [x, S] = Tt(""), [C, w] = Tt(""), T = x.trim().toLocaleLowerCase(), E = v.filter((e) => e.name.toLocaleLowerCase().includes(T));
|
|
1617
1634
|
async function D(e) {
|
|
1618
1635
|
e.preventDefault();
|
|
1619
1636
|
let t = C.trim();
|
|
1620
|
-
yt(t) != null || !await o(t) || (
|
|
1637
|
+
yt(t) != null || !await o(t) || (ee(!1), w(""));
|
|
1621
1638
|
}
|
|
1622
1639
|
return /* @__PURE__ */ Z("main", {
|
|
1623
1640
|
className: "resource-browser",
|
|
@@ -1636,9 +1653,9 @@ function tr({ hrefForFlow: e, hostAction: t, hostTitle: n, language: i, onCreate
|
|
|
1636
1653
|
language: i,
|
|
1637
1654
|
onLanguageChange: c
|
|
1638
1655
|
}),
|
|
1639
|
-
/* @__PURE__ */ Q(
|
|
1656
|
+
/* @__PURE__ */ Q(N, {
|
|
1640
1657
|
disabled: f != null,
|
|
1641
|
-
onClick: () =>
|
|
1658
|
+
onClick: () => ee(!0),
|
|
1642
1659
|
children: [/* @__PURE__ */ Z(B, {
|
|
1643
1660
|
"data-icon": "inline-start",
|
|
1644
1661
|
name: "plus"
|
|
@@ -1679,7 +1696,7 @@ function tr({ hrefForFlow: e, hostAction: t, hostTitle: n, language: i, onCreate
|
|
|
1679
1696
|
placeholder: d("resource.searchFlows"),
|
|
1680
1697
|
value: x
|
|
1681
1698
|
})]
|
|
1682
|
-
}), /* @__PURE__ */ Z(
|
|
1699
|
+
}), /* @__PURE__ */ Z(N, {
|
|
1683
1700
|
"aria-label": d("common.refresh"),
|
|
1684
1701
|
disabled: h || f != null,
|
|
1685
1702
|
onClick: () => void u.workspace.reloadFlows(),
|
|
@@ -1701,7 +1718,7 @@ function tr({ hrefForFlow: e, hostAction: t, hostTitle: n, language: i, onCreate
|
|
|
1701
1718
|
}),
|
|
1702
1719
|
/* @__PURE__ */ Z("div", {
|
|
1703
1720
|
className: "resource-list",
|
|
1704
|
-
children: h ? Array.from({ length: 5 }, (e, t) => /* @__PURE__ */ Z(
|
|
1721
|
+
children: h ? Array.from({ length: 5 }, (e, t) => /* @__PURE__ */ Z(tr, {}, t)) : p ? /* @__PURE__ */ Q(Ve, {
|
|
1705
1722
|
className: "min-h-64",
|
|
1706
1723
|
role: "alert",
|
|
1707
1724
|
children: [/* @__PURE__ */ Q(He, { children: [
|
|
@@ -1714,7 +1731,7 @@ function tr({ hrefForFlow: e, hostAction: t, hostTitle: n, language: i, onCreate
|
|
|
1714
1731
|
}),
|
|
1715
1732
|
/* @__PURE__ */ Z(Re, { children: d("resource.flowsLoadFailed") }),
|
|
1716
1733
|
/* @__PURE__ */ Z(ft, { children: d("resource.flowsLoadFailedDescription") })
|
|
1717
|
-
] }), /* @__PURE__ */ Z(lt, { children: /* @__PURE__ */ Z(
|
|
1734
|
+
] }), /* @__PURE__ */ Z(lt, { children: /* @__PURE__ */ Z(N, {
|
|
1718
1735
|
onClick: () => void u.retryFlows(),
|
|
1719
1736
|
variant: "outline",
|
|
1720
1737
|
children: d("empty.retry")
|
|
@@ -1731,8 +1748,8 @@ function tr({ hrefForFlow: e, hostAction: t, hostTitle: n, language: i, onCreate
|
|
|
1731
1748
|
}),
|
|
1732
1749
|
/* @__PURE__ */ Z(Re, { children: d(T.length == 0 ? "resource.noFlows" : "resource.noMatchingFlows") }),
|
|
1733
1750
|
/* @__PURE__ */ Z(ft, { children: d(T.length == 0 ? "resource.noFlowsDescription" : "resource.noMatchingDescription") })
|
|
1734
|
-
] }), T.length == 0 && /* @__PURE__ */ Z(lt, { children: /* @__PURE__ */ Q(
|
|
1735
|
-
onClick: () =>
|
|
1751
|
+
] }), T.length == 0 && /* @__PURE__ */ Z(lt, { children: /* @__PURE__ */ Q(N, {
|
|
1752
|
+
onClick: () => ee(!0),
|
|
1736
1753
|
variant: "outline",
|
|
1737
1754
|
children: [/* @__PURE__ */ Z(B, {
|
|
1738
1755
|
"data-icon": "inline-start",
|
|
@@ -1747,16 +1764,18 @@ function tr({ hrefForFlow: e, hostAction: t, hostTitle: n, language: i, onCreate
|
|
|
1747
1764
|
store: u
|
|
1748
1765
|
}, t.flowId))
|
|
1749
1766
|
}),
|
|
1750
|
-
_ != null && /* @__PURE__ */ Z(
|
|
1751
|
-
className: "
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1767
|
+
_ != null && /* @__PURE__ */ Z("div", {
|
|
1768
|
+
className: "resource-list-footer",
|
|
1769
|
+
children: /* @__PURE__ */ Z(N, {
|
|
1770
|
+
disabled: g,
|
|
1771
|
+
onClick: () => void u.workspace.loadMoreFlows(),
|
|
1772
|
+
variant: "outline",
|
|
1773
|
+
children: d(g ? "resource.loadingMore" : m ? "resource.retryLoadMore" : "resource.loadMore")
|
|
1774
|
+
})
|
|
1756
1775
|
})
|
|
1757
1776
|
]
|
|
1758
1777
|
}),
|
|
1759
|
-
|
|
1778
|
+
b && /* @__PURE__ */ Z(xt, {
|
|
1760
1779
|
fallback: null,
|
|
1761
1780
|
children: /* @__PURE__ */ Z(Zn, {
|
|
1762
1781
|
id: "flow-name",
|
|
@@ -1764,7 +1783,7 @@ function tr({ hrefForFlow: e, hostAction: t, hostTitle: n, language: i, onCreate
|
|
|
1764
1783
|
label: d("resource.flowName"),
|
|
1765
1784
|
name: C,
|
|
1766
1785
|
onNameChange: w,
|
|
1767
|
-
onOpenChange:
|
|
1786
|
+
onOpenChange: ee,
|
|
1768
1787
|
onSubmit: (e) => void D(e),
|
|
1769
1788
|
pending: f == "flow",
|
|
1770
1789
|
title: d("resource.newFlow")
|
|
@@ -1776,7 +1795,7 @@ function tr({ hrefForFlow: e, hostAction: t, hostTitle: n, language: i, onCreate
|
|
|
1776
1795
|
}
|
|
1777
1796
|
//#endregion
|
|
1778
1797
|
//#region ../../node_modules/.bun/nanoid@6.0.1/node_modules/nanoid/index.browser.js
|
|
1779
|
-
var
|
|
1798
|
+
var rr = (e) => crypto.getRandomValues(new Uint8Array(e)), ir = (e, t, n) => {
|
|
1780
1799
|
let r = 256 - 256 % e.length;
|
|
1781
1800
|
if (r === 256) {
|
|
1782
1801
|
let r = e.length - 1;
|
|
@@ -1798,50 +1817,50 @@ var nr = (e) => crypto.getRandomValues(new Uint8Array(e)), rr = (e, t, n) => {
|
|
|
1798
1817
|
for (; s--;) if (t[s] < r && (o += e[t[s] % e.length], o.length >= a)) return o;
|
|
1799
1818
|
}
|
|
1800
1819
|
};
|
|
1801
|
-
},
|
|
1802
|
-
function
|
|
1803
|
-
let n = e.indexOf(
|
|
1820
|
+
}, ar = (e, t = 21) => ir(e, t | 0, rr), or = "//#region generated meta", sr = "//#endregion";
|
|
1821
|
+
function cr(e, t) {
|
|
1822
|
+
let n = e.indexOf(or);
|
|
1804
1823
|
if (n < 0) return e;
|
|
1805
|
-
let r = e.indexOf(`\n${
|
|
1824
|
+
let r = e.indexOf(`\n${sr}`, n);
|
|
1806
1825
|
if (r < 0) return e;
|
|
1807
1826
|
let i = e.indexOf("\n", r + 1);
|
|
1808
|
-
return i < 0 && (i = e.length), `${e.slice(0, n)}${
|
|
1827
|
+
return i < 0 && (i = e.length), `${e.slice(0, n)}${or}\n${t}${sr}${e.slice(i)}`;
|
|
1809
1828
|
}
|
|
1810
|
-
function
|
|
1811
|
-
return e === "typescript" ?
|
|
1829
|
+
function lr(e, t, n) {
|
|
1830
|
+
return e === "typescript" ? mr(t, n) + "\n" : hr(t, n) + "\n";
|
|
1812
1831
|
}
|
|
1813
|
-
var
|
|
1814
|
-
function
|
|
1815
|
-
return !e || typeof e != "object" ? !1 : e.contentMediaType === "oomol/artifact" ? !0 : Array.isArray(e.anyOf) ? e.anyOf.some(
|
|
1832
|
+
var ur = /* @__PURE__ */ new Set(["color", "text"]), dr = (e) => e.includes(" | ") ? `(${e})` : e;
|
|
1833
|
+
function fr(e) {
|
|
1834
|
+
return !e || typeof e != "object" ? !1 : e.contentMediaType === "oomol/artifact" ? !0 : Array.isArray(e.anyOf) ? e.anyOf.some(fr) : e.type === "object" ? Object.values(e.properties || {}).some(fr) : e.type === "array" && fr(e.items);
|
|
1816
1835
|
}
|
|
1817
|
-
function
|
|
1818
|
-
return [...e, ...t].some((e) =>
|
|
1836
|
+
function pr(e, t) {
|
|
1837
|
+
return [...e, ...t].some((e) => fr(e.json_schema));
|
|
1819
1838
|
}
|
|
1820
|
-
function
|
|
1839
|
+
function mr(e = [], t = []) {
|
|
1821
1840
|
let n = ["type Inputs = {"];
|
|
1822
|
-
for (let t of e) n.push(` ${t.handle}: ${
|
|
1841
|
+
for (let t of e) n.push(` ${t.handle}: ${gr(t.json_schema, t.nullable)};`);
|
|
1823
1842
|
n.push("};"), n.push("type Outputs = {");
|
|
1824
|
-
for (let e of t) n.push(` ${e.handle}: ${
|
|
1825
|
-
return n.push("};"),
|
|
1843
|
+
for (let e of t) n.push(` ${e.handle}: ${gr(e.json_schema, e.nullable)};`);
|
|
1844
|
+
return n.push("};"), pr(e, t) && n.unshift("import type { ArtifactRef } from '@oomol-lab/open-flow'", ""), n.join("\n");
|
|
1826
1845
|
}
|
|
1827
|
-
function
|
|
1846
|
+
function hr(e = [], t = []) {
|
|
1828
1847
|
let n = ["@typedef {{"];
|
|
1829
|
-
for (let t of e) n.push(` ${t.handle}: ${
|
|
1848
|
+
for (let t of e) n.push(` ${t.handle}: ${gr(t.json_schema, t.nullable)};`);
|
|
1830
1849
|
n.push("}} Inputs;"), n.push("@typedef {{");
|
|
1831
|
-
for (let e of t) n.push(` ${e.handle}: ${
|
|
1832
|
-
n.push("}} Outputs;"),
|
|
1850
|
+
for (let e of t) n.push(` ${e.handle}: ${gr(e.json_schema, e.nullable)};`);
|
|
1851
|
+
n.push("}} Outputs;"), pr(e, t) && n.unshift("@import { ArtifactRef } from \"@oomol-lab/open-flow\"");
|
|
1833
1852
|
let r = n.map((e) => ` * ${e}`);
|
|
1834
1853
|
return r.unshift("/**"), r.push(" */"), r.join("\n");
|
|
1835
1854
|
}
|
|
1836
|
-
function
|
|
1855
|
+
function gr(e, t) {
|
|
1837
1856
|
if (!e) return "any";
|
|
1838
1857
|
switch (e.contentMediaType) {
|
|
1839
1858
|
case "oomol/bin": return t ? "Uint8Array | null" : "Uint8Array";
|
|
1840
1859
|
case "oomol/artifact": return t ? "ArtifactRef | null" : "ArtifactRef";
|
|
1841
1860
|
}
|
|
1842
|
-
if (
|
|
1843
|
-
if (Array.isArray(e.anyOf)) return
|
|
1844
|
-
if (Array.isArray(e.enum)) return
|
|
1861
|
+
if (ur.has(e["ui:widget"])) return t ? "string | null" : "string";
|
|
1862
|
+
if (Array.isArray(e.anyOf)) return _r((t ? e.anyOf.concat({ type: "null" }) : e.anyOf).map((e) => dr(gr(e, !1)))) || "any";
|
|
1863
|
+
if (Array.isArray(e.enum)) return _r((t ? e.enum.concat(null) : e.enum).map((e) => JSON.stringify(e))) || "any";
|
|
1845
1864
|
switch (e.type) {
|
|
1846
1865
|
case "null": return "null";
|
|
1847
1866
|
case "boolean": return t ? "boolean | null" : "boolean";
|
|
@@ -1851,29 +1870,29 @@ function hr(e, t) {
|
|
|
1851
1870
|
case "object": {
|
|
1852
1871
|
let n = Object.keys(e.properties || {});
|
|
1853
1872
|
if (n.length === 0) return "Record<string, any>";
|
|
1854
|
-
let r = Array.isArray(e?.required) ? new Set(e.required) : void 0, i = `{ ${n.map((t) => `${t}${r && !r.has(t) ? "?" : ""}: ${
|
|
1873
|
+
let r = Array.isArray(e?.required) ? new Set(e.required) : void 0, i = `{ ${n.map((t) => `${t}${r && !r.has(t) ? "?" : ""}: ${gr(e.properties[t], !1)}`).join("; ")} }`;
|
|
1855
1874
|
return t ? `${i} | null` : i;
|
|
1856
1875
|
}
|
|
1857
1876
|
case "array":
|
|
1858
1877
|
if (e.uniqueItems && Array.isArray(e.items?.enum)) {
|
|
1859
|
-
let n = `${
|
|
1878
|
+
let n = `${dr(gr(e.items, !1))}[]`;
|
|
1860
1879
|
return t ? `${n} | null` : n;
|
|
1861
1880
|
}
|
|
1862
1881
|
{
|
|
1863
|
-
let n = `${
|
|
1882
|
+
let n = `${dr(gr(e.items, !1))}[]`;
|
|
1864
1883
|
return t ? `${n} | null` : n;
|
|
1865
1884
|
}
|
|
1866
1885
|
default: return "any";
|
|
1867
1886
|
}
|
|
1868
1887
|
}
|
|
1869
|
-
function
|
|
1888
|
+
function _r(e) {
|
|
1870
1889
|
let t = Array.from(new Set(e.filter((e) => !!e)));
|
|
1871
1890
|
return t.length === 0 || t.includes("any") ? "any" : t.join(" | ");
|
|
1872
1891
|
}
|
|
1873
1892
|
//#endregion
|
|
1874
1893
|
//#region src/flow/common/nodeChanges.ts
|
|
1875
|
-
var
|
|
1876
|
-
function
|
|
1894
|
+
var vr = "//#region generated meta\n/**\n * @typedef {{}} Inputs\n * @typedef {{}} Outputs\n */\n//#endregion\n\n/**\n * @import { TaskContext } from \"@oomol-lab/open-flow\"\n * @param {Inputs} input\n * @param {TaskContext<Outputs>} context\n * @returns {Promise<Partial<Outputs> | undefined | void>}\n */\nexport default async function (input, context) {\n return { result: input.value }\n}\n";
|
|
1895
|
+
function yr(e, t, n, r = void 0, i = {
|
|
1877
1896
|
inputs: [{
|
|
1878
1897
|
handle: "value",
|
|
1879
1898
|
jsonSchema: {},
|
|
@@ -1891,7 +1910,7 @@ function vr(e, t, n, r = void 0, i = {
|
|
|
1891
1910
|
module: {
|
|
1892
1911
|
...r ?? {
|
|
1893
1912
|
imports: [],
|
|
1894
|
-
source:
|
|
1913
|
+
source: cr(vr, lr("javascript", i.inputs.flatMap((e) => "handle" in e ? [{
|
|
1895
1914
|
handle: e.handle,
|
|
1896
1915
|
json_schema: e.jsonSchema,
|
|
1897
1916
|
nullable: e.nullable
|
|
@@ -1908,7 +1927,7 @@ function vr(e, t, n, r = void 0, i = {
|
|
|
1908
1927
|
kind: "graph.node.create",
|
|
1909
1928
|
node: {
|
|
1910
1929
|
concurrency: 1,
|
|
1911
|
-
inputs:
|
|
1930
|
+
inputs: zr(i.inputs),
|
|
1912
1931
|
kind: "task",
|
|
1913
1932
|
name: n,
|
|
1914
1933
|
task: {
|
|
@@ -1922,7 +1941,7 @@ function vr(e, t, n, r = void 0, i = {
|
|
|
1922
1941
|
target: e
|
|
1923
1942
|
}];
|
|
1924
1943
|
}
|
|
1925
|
-
function
|
|
1944
|
+
function br(e, t, n) {
|
|
1926
1945
|
return [{
|
|
1927
1946
|
kind: "task.create",
|
|
1928
1947
|
task: n,
|
|
@@ -1931,7 +1950,7 @@ function yr(e, t, n) {
|
|
|
1931
1950
|
kind: "graph.node.create",
|
|
1932
1951
|
node: {
|
|
1933
1952
|
concurrency: 1,
|
|
1934
|
-
inputs:
|
|
1953
|
+
inputs: zr(n.inputs),
|
|
1935
1954
|
kind: "task",
|
|
1936
1955
|
name: n.name,
|
|
1937
1956
|
taskId: t.taskId
|
|
@@ -1940,9 +1959,9 @@ function yr(e, t, n) {
|
|
|
1940
1959
|
target: e
|
|
1941
1960
|
}];
|
|
1942
1961
|
}
|
|
1943
|
-
function
|
|
1962
|
+
function xr(e, t, n, r, i, a = {}) {
|
|
1944
1963
|
let o = a.inputs ?? {};
|
|
1945
|
-
return
|
|
1964
|
+
return br(e, t, {
|
|
1946
1965
|
executor: {
|
|
1947
1966
|
kind: "llm",
|
|
1948
1967
|
mode: r
|
|
@@ -1955,13 +1974,13 @@ function br(e, t, n, r, i, a = {}) {
|
|
|
1955
1974
|
type: "array"
|
|
1956
1975
|
},
|
|
1957
1976
|
nullable: !0,
|
|
1958
|
-
value:
|
|
1977
|
+
value: Br(o, "messages", null)
|
|
1959
1978
|
},
|
|
1960
1979
|
{
|
|
1961
1980
|
handle: "input",
|
|
1962
1981
|
jsonSchema: { type: "string" },
|
|
1963
1982
|
nullable: !1,
|
|
1964
|
-
value:
|
|
1983
|
+
value: Br(o, "input", "Alex")
|
|
1965
1984
|
},
|
|
1966
1985
|
{
|
|
1967
1986
|
handle: "template",
|
|
@@ -1971,7 +1990,7 @@ function br(e, t, n, r, i, a = {}) {
|
|
|
1971
1990
|
type: "array"
|
|
1972
1991
|
},
|
|
1973
1992
|
nullable: !1,
|
|
1974
|
-
value:
|
|
1993
|
+
value: Br(o, "template", [{
|
|
1975
1994
|
content: "Hello, I'm {{input}}",
|
|
1976
1995
|
role: "user"
|
|
1977
1996
|
}])
|
|
@@ -1980,7 +1999,7 @@ function br(e, t, n, r, i, a = {}) {
|
|
|
1980
1999
|
handle: "model",
|
|
1981
2000
|
jsonSchema: { type: "object" },
|
|
1982
2001
|
nullable: !1,
|
|
1983
|
-
value:
|
|
2002
|
+
value: Br(o, "model", { model: "deepseek-v4-flash" })
|
|
1984
2003
|
}
|
|
1985
2004
|
],
|
|
1986
2005
|
name: n,
|
|
@@ -1993,7 +2012,7 @@ function br(e, t, n, r, i, a = {}) {
|
|
|
1993
2012
|
}]
|
|
1994
2013
|
});
|
|
1995
2014
|
}
|
|
1996
|
-
function
|
|
2015
|
+
function Sr(e, t, n) {
|
|
1997
2016
|
return [{
|
|
1998
2017
|
kind: "graph.node.create",
|
|
1999
2018
|
node: {
|
|
@@ -2024,7 +2043,7 @@ function xr(e, t, n) {
|
|
|
2024
2043
|
target: e
|
|
2025
2044
|
}];
|
|
2026
2045
|
}
|
|
2027
|
-
function
|
|
2046
|
+
function Cr(e, t, n) {
|
|
2028
2047
|
return [{
|
|
2029
2048
|
kind: "graph.node.create",
|
|
2030
2049
|
node: {
|
|
@@ -2043,7 +2062,7 @@ function Sr(e, t, n) {
|
|
|
2043
2062
|
target: e
|
|
2044
2063
|
}];
|
|
2045
2064
|
}
|
|
2046
|
-
function
|
|
2065
|
+
function wr(e, t, n) {
|
|
2047
2066
|
return [{
|
|
2048
2067
|
kind: "graph.node.create",
|
|
2049
2068
|
node: n,
|
|
@@ -2051,7 +2070,7 @@ function Cr(e, t, n) {
|
|
|
2051
2070
|
target: e
|
|
2052
2071
|
}];
|
|
2053
2072
|
}
|
|
2054
|
-
function
|
|
2073
|
+
function Tr(e, t, n, r) {
|
|
2055
2074
|
let i = r.name ?? n.displayName, a = n.type == "poll" ? {
|
|
2056
2075
|
bindingId: t.bindingId,
|
|
2057
2076
|
config: r.config,
|
|
@@ -2084,8 +2103,8 @@ function wr(e, t, n, r) {
|
|
|
2084
2103
|
target: e
|
|
2085
2104
|
}];
|
|
2086
2105
|
}
|
|
2087
|
-
function
|
|
2088
|
-
let r =
|
|
2106
|
+
function Er(e, t, n) {
|
|
2107
|
+
let r = Rr(e, t)?.nodes;
|
|
2089
2108
|
if (r == null) return [];
|
|
2090
2109
|
let i = new Set(n), a = n.flatMap((e) => {
|
|
2091
2110
|
let n = r[e];
|
|
@@ -2098,7 +2117,7 @@ function Tr(e, t, n) {
|
|
|
2098
2117
|
moduleId: n.task.moduleId
|
|
2099
2118
|
}] : []];
|
|
2100
2119
|
});
|
|
2101
|
-
if (t.kind == "subflow") return
|
|
2120
|
+
if (t.kind == "subflow") return jr(e, a);
|
|
2102
2121
|
let o = new Set(n.flatMap((e) => {
|
|
2103
2122
|
let t = r[e];
|
|
2104
2123
|
return t?.kind == "poll" || t?.kind == "integration" ? [t.bindingId] : [];
|
|
@@ -2107,37 +2126,37 @@ function Tr(e, t, n) {
|
|
|
2107
2126
|
bindingId: t,
|
|
2108
2127
|
kind: "binding.delete"
|
|
2109
2128
|
});
|
|
2110
|
-
return
|
|
2129
|
+
return jr(e, a);
|
|
2111
2130
|
}
|
|
2112
|
-
function
|
|
2113
|
-
let i =
|
|
2131
|
+
function Dr(e, t, n, r) {
|
|
2132
|
+
let i = Rr(e, t)?.nodes[n];
|
|
2114
2133
|
if (i == null || !("inputs" in i)) return;
|
|
2115
2134
|
let { concurrency: a, name: o, timeoutMs: s, ...c } = i;
|
|
2116
|
-
return
|
|
2135
|
+
return Vr(t, n, {
|
|
2117
2136
|
...c,
|
|
2118
2137
|
...r
|
|
2119
2138
|
});
|
|
2120
2139
|
}
|
|
2121
|
-
function
|
|
2122
|
-
return
|
|
2140
|
+
function Or(e, t, n, r, i) {
|
|
2141
|
+
return kr(e, t, n, { [r]: i });
|
|
2123
2142
|
}
|
|
2124
|
-
function
|
|
2125
|
-
let i =
|
|
2143
|
+
function kr(e, t, n, r) {
|
|
2144
|
+
let i = Rr(e, t)?.nodes[n];
|
|
2126
2145
|
if (i == null || !("inputs" in i)) return;
|
|
2127
2146
|
let a = { ...i.inputs };
|
|
2128
2147
|
for (let [e, t] of Object.entries(r)) t === void 0 ? delete a[e] : a[e] = {
|
|
2129
2148
|
kind: "value",
|
|
2130
2149
|
value: t
|
|
2131
2150
|
};
|
|
2132
|
-
return
|
|
2151
|
+
return jr(e, Vr(t, n, {
|
|
2133
2152
|
...i,
|
|
2134
2153
|
inputs: a
|
|
2135
2154
|
}));
|
|
2136
2155
|
}
|
|
2137
|
-
function
|
|
2138
|
-
let o =
|
|
2156
|
+
function Ar(e, t, n, r, i, a) {
|
|
2157
|
+
let o = Rr(e, t)?.nodes[n];
|
|
2139
2158
|
if (o == null || !("inputs" in o)) return;
|
|
2140
|
-
let s = o.inputs[r], c = s?.kind == "sources" && s.sources.length == 1 && s.sources[0]?.kind == "binding" ? s.sources[0].bindingId : void 0, l = c == null ? void 0 : e.document.bindings[c], u =
|
|
2159
|
+
let s = o.inputs[r], c = s?.kind == "sources" && s.sources.length == 1 && s.sources[0]?.kind == "binding" ? s.sources[0].bindingId : void 0, l = c == null ? void 0 : e.document.bindings[c], u = Mr(e.document);
|
|
2141
2160
|
if (c != null && l?.kind == "variable" && (u.get(c) ?? 0) == 1) return l.target == i ? [] : [{
|
|
2142
2161
|
binding: {
|
|
2143
2162
|
kind: "variable",
|
|
@@ -2163,19 +2182,19 @@ function kr(e, t, n, r, i, a) {
|
|
|
2163
2182
|
},
|
|
2164
2183
|
bindingId: a,
|
|
2165
2184
|
kind: "binding.create"
|
|
2166
|
-
}, ...
|
|
2185
|
+
}, ...jr(e, Vr(t, n, {
|
|
2167
2186
|
...o,
|
|
2168
2187
|
inputs: d
|
|
2169
2188
|
}))];
|
|
2170
2189
|
}
|
|
2171
|
-
function
|
|
2172
|
-
let n =
|
|
2190
|
+
function jr(e, t) {
|
|
2191
|
+
let n = Mr(e.document), r = bt(e, t), i = Mr(r.document);
|
|
2173
2192
|
return [...t, ...[...n.keys()].flatMap((e) => i.has(e) || r.document.bindings[e]?.kind != "variable" ? [] : [{
|
|
2174
2193
|
bindingId: e,
|
|
2175
2194
|
kind: "binding.delete"
|
|
2176
2195
|
}])];
|
|
2177
2196
|
}
|
|
2178
|
-
function
|
|
2197
|
+
function Mr(e) {
|
|
2179
2198
|
let t = /* @__PURE__ */ new Map(), n = (e) => {
|
|
2180
2199
|
t.set(e, (t.get(e) ?? 0) + 1);
|
|
2181
2200
|
};
|
|
@@ -2184,7 +2203,7 @@ function jr(e) {
|
|
|
2184
2203
|
}
|
|
2185
2204
|
return t;
|
|
2186
2205
|
}
|
|
2187
|
-
function
|
|
2206
|
+
function Nr(e, t, n) {
|
|
2188
2207
|
let r = e.document.tasks[t];
|
|
2189
2208
|
if (!(r == null || !("executor" in r) || r.executor.kind != "connector")) return [{
|
|
2190
2209
|
kind: "task.replace",
|
|
@@ -2198,7 +2217,7 @@ function Mr(e, t, n) {
|
|
|
2198
2217
|
taskId: t
|
|
2199
2218
|
}];
|
|
2200
2219
|
}
|
|
2201
|
-
function
|
|
2220
|
+
function Pr(e, t, n, r) {
|
|
2202
2221
|
let i = e.document.graph.nodes[n];
|
|
2203
2222
|
if (i == null) return;
|
|
2204
2223
|
let a = {
|
|
@@ -2245,25 +2264,25 @@ function Nr(e, t, n, r) {
|
|
|
2245
2264
|
config: r.config
|
|
2246
2265
|
};
|
|
2247
2266
|
}
|
|
2248
|
-
return
|
|
2267
|
+
return Vr(t, n, o);
|
|
2249
2268
|
}
|
|
2250
|
-
function
|
|
2269
|
+
function Fr(e, t, n, r, i) {
|
|
2251
2270
|
let a = e.document.graph.nodes[n];
|
|
2252
2271
|
if (a == null || a.kind != "integration" && a.kind != "poll") return;
|
|
2253
2272
|
let o = { ...a.config };
|
|
2254
|
-
return i === void 0 ? delete o[r] : o[r] = i,
|
|
2273
|
+
return i === void 0 ? delete o[r] : o[r] = i, Vr(t, n, {
|
|
2255
2274
|
...a,
|
|
2256
2275
|
config: o
|
|
2257
2276
|
});
|
|
2258
2277
|
}
|
|
2259
|
-
function
|
|
2278
|
+
function Ir(e, t, n, r) {
|
|
2260
2279
|
let i = e.document.graph.nodes[n];
|
|
2261
2280
|
if (i != null) switch (i.kind) {
|
|
2262
|
-
case "cron": return
|
|
2281
|
+
case "cron": return Vr(t, n, {
|
|
2263
2282
|
...i,
|
|
2264
2283
|
cronTimes: r
|
|
2265
2284
|
});
|
|
2266
|
-
case "poll": return
|
|
2285
|
+
case "poll": return Vr(t, n, {
|
|
2267
2286
|
...i,
|
|
2268
2287
|
pollTimes: r
|
|
2269
2288
|
});
|
|
@@ -2272,7 +2291,7 @@ function Fr(e, t, n, r) {
|
|
|
2272
2291
|
default: return;
|
|
2273
2292
|
}
|
|
2274
2293
|
}
|
|
2275
|
-
function
|
|
2294
|
+
function Lr(e, t, n, r) {
|
|
2276
2295
|
let i = e.document.graph.nodes[n];
|
|
2277
2296
|
if (!(i == null || i.kind != "poll" && i.kind != "integration") && e.document.bindings[i.bindingId]?.kind == "connection") return [{
|
|
2278
2297
|
binding: {
|
|
@@ -2283,19 +2302,19 @@ function Ir(e, t, n, r) {
|
|
|
2283
2302
|
kind: "binding.replace"
|
|
2284
2303
|
}];
|
|
2285
2304
|
}
|
|
2286
|
-
function
|
|
2305
|
+
function Rr(e, t) {
|
|
2287
2306
|
return t.kind == "flow" ? e.document.graph : e.document.subflows[t.id]?.graph;
|
|
2288
2307
|
}
|
|
2289
|
-
function
|
|
2308
|
+
function zr(e) {
|
|
2290
2309
|
return Object.fromEntries(e.flatMap((e) => "handle" in e && Object.hasOwn(e, "value") ? [[e.handle, {
|
|
2291
2310
|
kind: "value",
|
|
2292
2311
|
value: e.value
|
|
2293
2312
|
}]] : []));
|
|
2294
2313
|
}
|
|
2295
|
-
function
|
|
2314
|
+
function Br(e, t, n) {
|
|
2296
2315
|
return e != null && Object.hasOwn(e, t) ? e[t] : n;
|
|
2297
2316
|
}
|
|
2298
|
-
function
|
|
2317
|
+
function Vr(e, t, n) {
|
|
2299
2318
|
return [{
|
|
2300
2319
|
kind: "graph.node.replace",
|
|
2301
2320
|
node: n,
|
|
@@ -2305,38 +2324,38 @@ function Br(e, t, n) {
|
|
|
2305
2324
|
}
|
|
2306
2325
|
//#endregion
|
|
2307
2326
|
//#region src/flow/common/edgeChanges.ts
|
|
2308
|
-
function
|
|
2327
|
+
function Hr(e, t, n) {
|
|
2309
2328
|
let r = {
|
|
2310
2329
|
source: n.source,
|
|
2311
2330
|
sourceHandle: n.sourceHandle,
|
|
2312
2331
|
target: n.target,
|
|
2313
2332
|
targetHandle: n.targetHandle
|
|
2314
|
-
}, i =
|
|
2315
|
-
return a?.kind == "sources" && a.sources.some((e) => e.kind == "node" && e.nodeId == n.source && e.output == n.sourceHandle) ? [] :
|
|
2333
|
+
}, i = Wr(e, t)?.nodes[n.target], a = i != null && "inputs" in i ? i.inputs[n.targetHandle] : void 0;
|
|
2334
|
+
return a?.kind == "sources" && a.sources.some((e) => e.kind == "node" && e.nodeId == n.source && e.output == n.sourceHandle) ? [] : jr(e, [{
|
|
2316
2335
|
edge: r,
|
|
2317
2336
|
kind: "graph.edge.connect",
|
|
2318
2337
|
target: t
|
|
2319
2338
|
}]);
|
|
2320
2339
|
}
|
|
2321
|
-
function
|
|
2340
|
+
function Ur(e, t, n) {
|
|
2322
2341
|
let r = {
|
|
2323
2342
|
source: n.source,
|
|
2324
2343
|
sourceHandle: n.sourceHandle,
|
|
2325
2344
|
target: n.target,
|
|
2326
2345
|
targetHandle: n.targetHandle
|
|
2327
|
-
}, i =
|
|
2346
|
+
}, i = Wr(e, t)?.nodes[n.target], a = i != null && "inputs" in i ? i.inputs[n.targetHandle] : void 0;
|
|
2328
2347
|
return a?.kind != "sources" || !a.sources.some((e) => e.kind == "node" && e.nodeId == n.source && e.output == n.sourceHandle) ? [] : [{
|
|
2329
2348
|
edge: r,
|
|
2330
2349
|
kind: "graph.edge.disconnect",
|
|
2331
2350
|
target: t
|
|
2332
2351
|
}];
|
|
2333
2352
|
}
|
|
2334
|
-
function
|
|
2353
|
+
function Wr(e, t) {
|
|
2335
2354
|
return t.kind == "flow" ? e.document.graph : e.document.subflows[t.id]?.graph;
|
|
2336
2355
|
}
|
|
2337
2356
|
//#endregion
|
|
2338
2357
|
//#region src/flow/common/moduleChanges.ts
|
|
2339
|
-
async function
|
|
2358
|
+
async function Gr(e) {
|
|
2340
2359
|
try {
|
|
2341
2360
|
let { parse: t } = await import("./lib-C5Ipyfps.js").then((e) => e.t), n = t(e, {
|
|
2342
2361
|
errorRecovery: !0,
|
|
@@ -2352,7 +2371,7 @@ async function Wr(e) {
|
|
|
2352
2371
|
return [];
|
|
2353
2372
|
}
|
|
2354
2373
|
}
|
|
2355
|
-
function
|
|
2374
|
+
function Kr(e, t, n) {
|
|
2356
2375
|
return [{
|
|
2357
2376
|
imports: n,
|
|
2358
2377
|
kind: "module.source.replace",
|
|
@@ -2360,7 +2379,7 @@ function Gr(e, t, n) {
|
|
|
2360
2379
|
source: t
|
|
2361
2380
|
}];
|
|
2362
2381
|
}
|
|
2363
|
-
var
|
|
2382
|
+
var qr = ar("23456789abcdefghjkmnpqrstuvwxyz", 10), Jr = {
|
|
2364
2383
|
activities: [],
|
|
2365
2384
|
activitiesLoadFailed: !1,
|
|
2366
2385
|
activitiesLoading: !1,
|
|
@@ -2373,11 +2392,11 @@ var Kr = ir("23456789abcdefghjkmnpqrstuvwxyz", 10), qr = {
|
|
|
2373
2392
|
loadingMore: !1,
|
|
2374
2393
|
publications: [],
|
|
2375
2394
|
publishing: !1
|
|
2376
|
-
},
|
|
2377
|
-
function
|
|
2395
|
+
}, Yr = 20, Xr = 50;
|
|
2396
|
+
function Zr(e, t) {
|
|
2378
2397
|
return e?.flowId == t.flowId;
|
|
2379
2398
|
}
|
|
2380
|
-
var
|
|
2399
|
+
var Qr = class {
|
|
2381
2400
|
#e;
|
|
2382
2401
|
#t;
|
|
2383
2402
|
#n;
|
|
@@ -2386,7 +2405,7 @@ var Zr = class {
|
|
|
2386
2405
|
#a = new Y();
|
|
2387
2406
|
#o = new Y();
|
|
2388
2407
|
#s;
|
|
2389
|
-
#c = t(
|
|
2408
|
+
#c = t(Jr);
|
|
2390
2409
|
#l;
|
|
2391
2410
|
#u;
|
|
2392
2411
|
constructor(t, n, r, i = () => crypto.randomUUID(), a = De()) {
|
|
@@ -2421,12 +2440,12 @@ var Zr = class {
|
|
|
2421
2440
|
this.#c.dispose();
|
|
2422
2441
|
}
|
|
2423
2442
|
reset() {
|
|
2424
|
-
this.#r.invalidate(), this.#i.invalidate(), this.#a.invalidate(), this.#o.invalidate(), this.#u = void 0, this.#c.set(
|
|
2443
|
+
this.#r.invalidate(), this.#i.invalidate(), this.#a.invalidate(), this.#o.invalidate(), this.#u = void 0, this.#c.set(Jr);
|
|
2425
2444
|
}
|
|
2426
2445
|
async load(e) {
|
|
2427
2446
|
let t = { flowId: e }, n = this.#r.begin();
|
|
2428
|
-
|
|
2429
|
-
...
|
|
2447
|
+
Zr(this.#c.value.target, t) || (this.#u = void 0), this.#s(void 0), this.#c.set({
|
|
2448
|
+
...Jr,
|
|
2430
2449
|
loading: !0,
|
|
2431
2450
|
target: t
|
|
2432
2451
|
});
|
|
@@ -2460,7 +2479,7 @@ var Zr = class {
|
|
|
2460
2479
|
try {
|
|
2461
2480
|
let e = await this.#e.listPublications(n.flowId, {
|
|
2462
2481
|
cursor: t,
|
|
2463
|
-
limit:
|
|
2482
|
+
limit: Xr
|
|
2464
2483
|
});
|
|
2465
2484
|
if (!r()) return;
|
|
2466
2485
|
let i = new Set(this.#c.value.publications.map((e) => e.publicationId));
|
|
@@ -2556,7 +2575,7 @@ var Zr = class {
|
|
|
2556
2575
|
testingTriggerId: void 0,
|
|
2557
2576
|
testResult: void 0
|
|
2558
2577
|
});
|
|
2559
|
-
let [r, i] = await Promise.allSettled([this.#e.getFlowTriggerBinding(t.flowId, e), this.#e.listFlowTriggerActivities(t.flowId, e, { limit:
|
|
2578
|
+
let [r, i] = await Promise.allSettled([this.#e.getFlowTriggerBinding(t.flowId, e), this.#e.listFlowTriggerActivities(t.flowId, e, { limit: Yr })]);
|
|
2560
2579
|
if (n()) {
|
|
2561
2580
|
if (r.status == "rejected") {
|
|
2562
2581
|
this.#h({
|
|
@@ -2590,7 +2609,7 @@ var Zr = class {
|
|
|
2590
2609
|
try {
|
|
2591
2610
|
let e = await this.#e.listFlowTriggerActivities(r.flowId, n, {
|
|
2592
2611
|
cursor: t,
|
|
2593
|
-
limit:
|
|
2612
|
+
limit: Yr
|
|
2594
2613
|
});
|
|
2595
2614
|
if (!i() || this.#c.value.selectedTriggerId != n) return;
|
|
2596
2615
|
let a = new Set(this.#c.value.activities.map((e) => e.activityId));
|
|
@@ -2645,7 +2664,7 @@ var Zr = class {
|
|
|
2645
2664
|
}
|
|
2646
2665
|
async #d(e) {
|
|
2647
2666
|
let [t, n, r] = await this.#p(e);
|
|
2648
|
-
this.#l.updateLive(t), await this.#l.refreshFlows(),
|
|
2667
|
+
this.#l.updateLive(t), await this.#l.refreshFlows(), Zr(this.#c.value.target, e) && this.#h({
|
|
2649
2668
|
bindings: r,
|
|
2650
2669
|
live: t,
|
|
2651
2670
|
loadFailed: !1,
|
|
@@ -2666,14 +2685,14 @@ var Zr = class {
|
|
|
2666
2685
|
this.#e.getLive(e.flowId),
|
|
2667
2686
|
this.#e.listPublications(e.flowId, {
|
|
2668
2687
|
includeTotal: !0,
|
|
2669
|
-
limit:
|
|
2688
|
+
limit: Xr
|
|
2670
2689
|
}),
|
|
2671
2690
|
this.#e.listFlowTriggerBindings(e.flowId)
|
|
2672
2691
|
]);
|
|
2673
2692
|
}
|
|
2674
2693
|
#m(e, t) {
|
|
2675
|
-
|
|
2676
|
-
...
|
|
2694
|
+
Zr(this.#c.value.target, e) ? this.#h(t) : this.#c.set({
|
|
2695
|
+
...Jr,
|
|
2677
2696
|
...t,
|
|
2678
2697
|
target: e
|
|
2679
2698
|
});
|
|
@@ -2684,8 +2703,8 @@ var Zr = class {
|
|
|
2684
2703
|
...e
|
|
2685
2704
|
});
|
|
2686
2705
|
}
|
|
2687
|
-
},
|
|
2688
|
-
function
|
|
2706
|
+
}, $r = { starting: !1 };
|
|
2707
|
+
function ei(e) {
|
|
2689
2708
|
switch (e.kind) {
|
|
2690
2709
|
case "condition": return { [e.node.input.handle]: e.node.input };
|
|
2691
2710
|
case "subflow": return vt(e.definition?.inputs ?? []);
|
|
@@ -2693,15 +2712,15 @@ function $r(e) {
|
|
|
2693
2712
|
case "value": return {};
|
|
2694
2713
|
}
|
|
2695
2714
|
}
|
|
2696
|
-
function
|
|
2715
|
+
function ti(e) {
|
|
2697
2716
|
return e.node.name == null ? e.kind == "task" || e.kind == "subflow" ? e.definition?.name ?? e.id : e.id : e.node.name;
|
|
2698
2717
|
}
|
|
2699
|
-
async function
|
|
2718
|
+
async function ni(e, t) {
|
|
2700
2719
|
let { FlowRunInputEditorStore: n } = await import("./flowRunInputEditorStore-BUwR9Vbp.js").then((e) => e.n), r = J(e), i = r.graph({ kind: "flow" });
|
|
2701
2720
|
return i == null ? [] : Object.entries(i.nodes).toSorted(([e], [t]) => e.localeCompare(t)).flatMap(([e, i]) => {
|
|
2702
2721
|
let a = r.resolveNode(e, i);
|
|
2703
2722
|
if (a.kind == "trigger") return [];
|
|
2704
|
-
let o = Object.entries(
|
|
2723
|
+
let o = Object.entries(ei(a)).filter(([e, t]) => a.node.inputs[e] == null && !Object.hasOwn(t, "value")).toSorted(([e], [t]) => e.localeCompare(t)).map(([e, t]) => Object.assign({
|
|
2705
2724
|
handle: e,
|
|
2706
2725
|
jsonSchema: t.jsonSchema,
|
|
2707
2726
|
nullable: t.nullable
|
|
@@ -2709,11 +2728,11 @@ async function ti(e, t) {
|
|
|
2709
2728
|
return o.length == 0 ? [] : [{
|
|
2710
2729
|
editor: new n(o, t),
|
|
2711
2730
|
nodeId: e,
|
|
2712
|
-
title:
|
|
2731
|
+
title: ti(a)
|
|
2713
2732
|
}];
|
|
2714
2733
|
});
|
|
2715
2734
|
}
|
|
2716
|
-
var
|
|
2735
|
+
var ri = class {
|
|
2717
2736
|
#e;
|
|
2718
2737
|
#t;
|
|
2719
2738
|
#n;
|
|
@@ -2721,7 +2740,7 @@ var ni = class {
|
|
|
2721
2740
|
#i = new Y();
|
|
2722
2741
|
#a;
|
|
2723
2742
|
#o;
|
|
2724
|
-
#s = t(
|
|
2743
|
+
#s = t($r);
|
|
2725
2744
|
#c;
|
|
2726
2745
|
constructor(t, n, r, i = De(), a = () => crypto.randomUUID()) {
|
|
2727
2746
|
this.#e = t, this.#a = n, this.#o = r, this.#n = i, this.#t = a, this.$ = {
|
|
@@ -2738,7 +2757,7 @@ var ni = class {
|
|
|
2738
2757
|
reset() {
|
|
2739
2758
|
this.#r.invalidate(), this.#i.invalidate(), this.#c = void 0;
|
|
2740
2759
|
let e = this.#s.value.inputRequest;
|
|
2741
|
-
this.#s.set(
|
|
2760
|
+
this.#s.set($r), this.#d(e);
|
|
2742
2761
|
}
|
|
2743
2762
|
async requestDraft(e, t) {
|
|
2744
2763
|
let n = this.#i.begin();
|
|
@@ -2781,7 +2800,7 @@ var ni = class {
|
|
|
2781
2800
|
}), this.#d(s);
|
|
2782
2801
|
let c;
|
|
2783
2802
|
try {
|
|
2784
|
-
c = await
|
|
2803
|
+
c = await ni(r, this.#n.lang$);
|
|
2785
2804
|
} catch (e) {
|
|
2786
2805
|
throw a() && this.#f({
|
|
2787
2806
|
starting: !1,
|
|
@@ -2857,18 +2876,18 @@ var ni = class {
|
|
|
2857
2876
|
...e
|
|
2858
2877
|
});
|
|
2859
2878
|
}
|
|
2860
|
-
},
|
|
2879
|
+
}, ii = {
|
|
2861
2880
|
actions: {},
|
|
2862
2881
|
catalogs: {}
|
|
2863
2882
|
};
|
|
2864
|
-
function
|
|
2883
|
+
function ai(e) {
|
|
2865
2884
|
return Object.entries(e).map(([e, t]) => ({
|
|
2866
2885
|
description: t.description,
|
|
2867
2886
|
handle: e,
|
|
2868
2887
|
jsonSchema: t.jsonSchema
|
|
2869
2888
|
}));
|
|
2870
2889
|
}
|
|
2871
|
-
function
|
|
2890
|
+
function oi(e, t) {
|
|
2872
2891
|
return {
|
|
2873
2892
|
connector: e,
|
|
2874
2893
|
description: e.defaultConnection == null ? t("addNode.connectorNeedsConnection", {
|
|
@@ -2878,13 +2897,13 @@ function ai(e, t) {
|
|
|
2878
2897
|
group: t("addNode.connectorActions"),
|
|
2879
2898
|
icon: e.icon ?? ":carbon:connection-signal:",
|
|
2880
2899
|
id: `connector:${e.actionId}`,
|
|
2881
|
-
inputs:
|
|
2900
|
+
inputs: ai(e.inputs),
|
|
2882
2901
|
kind: "connector",
|
|
2883
2902
|
label: e.name,
|
|
2884
|
-
outputs:
|
|
2903
|
+
outputs: ai(e.outputs)
|
|
2885
2904
|
};
|
|
2886
2905
|
}
|
|
2887
|
-
function
|
|
2906
|
+
function si(e, t) {
|
|
2888
2907
|
let n = /* @__PURE__ */ new Map();
|
|
2889
2908
|
for (let t of e) {
|
|
2890
2909
|
let e = n.get(t.serviceId) ?? [];
|
|
@@ -2892,7 +2911,7 @@ function oi(e, t) {
|
|
|
2892
2911
|
}
|
|
2893
2912
|
return [...n.values()].toSorted((e, t) => e[0].serviceName.localeCompare(t[0].serviceName)).map((e) => {
|
|
2894
2913
|
let n = e[0], r = e.map((e) => {
|
|
2895
|
-
let n =
|
|
2914
|
+
let n = oi(e, t);
|
|
2896
2915
|
return {
|
|
2897
2916
|
description: n.description,
|
|
2898
2917
|
label: n.label,
|
|
@@ -2913,7 +2932,7 @@ function oi(e, t) {
|
|
|
2913
2932
|
};
|
|
2914
2933
|
});
|
|
2915
2934
|
}
|
|
2916
|
-
function
|
|
2935
|
+
function ci(e, t) {
|
|
2917
2936
|
return {
|
|
2918
2937
|
choices: [],
|
|
2919
2938
|
description: t("addNode.connectorBrowseActions"),
|
|
@@ -2927,7 +2946,7 @@ function si(e, t) {
|
|
|
2927
2946
|
serviceId: e.serviceId
|
|
2928
2947
|
};
|
|
2929
2948
|
}
|
|
2930
|
-
function
|
|
2949
|
+
function li(e) {
|
|
2931
2950
|
if (e?.kind != "task" || e.node.task != null) return;
|
|
2932
2951
|
let t = e.definition;
|
|
2933
2952
|
if (!(t == null || !("executor" in t) || t.executor.kind != "connector")) return {
|
|
@@ -2937,7 +2956,7 @@ function ci(e) {
|
|
|
2937
2956
|
taskId: e.node.taskId
|
|
2938
2957
|
};
|
|
2939
2958
|
}
|
|
2940
|
-
var
|
|
2959
|
+
var ui = class {
|
|
2941
2960
|
#e;
|
|
2942
2961
|
#t;
|
|
2943
2962
|
#n;
|
|
@@ -2953,12 +2972,12 @@ var li = class {
|
|
|
2953
2972
|
#f;
|
|
2954
2973
|
#p;
|
|
2955
2974
|
constructor(r, i, a, o, s = De()) {
|
|
2956
|
-
this.#r = /* @__PURE__ */ new Map(), this.#i = /* @__PURE__ */ new Set(), this.#a = new Y(), this.#l = t(
|
|
2975
|
+
this.#r = /* @__PURE__ */ new Map(), this.#i = /* @__PURE__ */ new Set(), this.#a = new Y(), this.#l = t(ii), this.#p = !1, this.browseAddNodeOptions = async (e) => {
|
|
2957
2976
|
if (this.#p) return;
|
|
2958
2977
|
let t = this.#u.$.flowId.value;
|
|
2959
2978
|
if (t == null) return;
|
|
2960
2979
|
let n = this.#f ?? await this.#e.listConnectorProviders(e);
|
|
2961
|
-
if (!(e.aborted || this.#p || t != this.#u.$.flowId.value)) return this.#f = n, n.toSorted((e, t) => e.serviceName.localeCompare(t.serviceName)).map((e) =>
|
|
2980
|
+
if (!(e.aborted || this.#p || t != this.#u.$.flowId.value)) return this.#f = n, n.toSorted((e, t) => e.serviceName.localeCompare(t.serviceName)).map((e) => ci(e, this.#t.t));
|
|
2962
2981
|
}, this.provideAddNodeOptionChoices = async (e, t) => {
|
|
2963
2982
|
if (this.#p) return;
|
|
2964
2983
|
let n = this.#u.$.flowId.value, r = this.#f?.find((t) => `connector-provider:${t.serviceId}` == e);
|
|
@@ -2969,7 +2988,7 @@ var li = class {
|
|
|
2969
2988
|
return this.#r.set(r.serviceId, a), this.#v({ actions: {
|
|
2970
2989
|
...this.#l.value.actions,
|
|
2971
2990
|
...Object.fromEntries(a.map((e) => [e.actionId, e]))
|
|
2972
|
-
} }), a.map((e) =>
|
|
2991
|
+
} }), a.map((e) => oi(e, this.#t.t));
|
|
2973
2992
|
}, this.provideAddNodeOptions = async (e, t) => {
|
|
2974
2993
|
if (this.#p) return;
|
|
2975
2994
|
let n = this.#u.$.flowId.value;
|
|
@@ -2978,17 +2997,17 @@ var li = class {
|
|
|
2978
2997
|
if (t.aborted || this.#p || n != this.#u.$.flowId.value) return;
|
|
2979
2998
|
let a = { ...this.#l.value.actions };
|
|
2980
2999
|
for (let e of i) a[e.actionId] = e;
|
|
2981
|
-
if (this.#v({ actions: a }), r.length != 0) return i.map((e) =>
|
|
3000
|
+
if (this.#v({ actions: a }), r.length != 0) return i.map((e) => oi(e, this.#t.t));
|
|
2982
3001
|
let o = new Map(i.map((e) => [e.actionId, e]));
|
|
2983
3002
|
for (let e of this.#u.$.revision.value?.connectorActionIds ?? []) {
|
|
2984
3003
|
let t = a[e];
|
|
2985
3004
|
t != null && o.set(e, t);
|
|
2986
3005
|
}
|
|
2987
|
-
return
|
|
3006
|
+
return si([...o.values()], this.#t.t);
|
|
2988
3007
|
}, this.#e = r, this.#n = o, this.#u = i, this.#c = a, this.#t = s;
|
|
2989
3008
|
let c = e(this.#l, (e) => e.actions), l = e(this.#l, (e) => e.catalogs);
|
|
2990
3009
|
this.#s = n((e) => {
|
|
2991
|
-
let t =
|
|
3010
|
+
let t = li(e(i.$.selection)), n = e(this.#l);
|
|
2992
3011
|
if (t == null) return { authorizationPending: !1 };
|
|
2993
3012
|
let r = n.actions[t.actionId], a = r == null ? void 0 : n.catalogs[r.serviceId], o = t.connectionId == null ? void 0 : a?.byId.get(t.connectionId);
|
|
2994
3013
|
return o == null && r?.defaultConnection?.connectionId == t.connectionId && (o = r.defaultConnection), {
|
|
@@ -3018,11 +3037,11 @@ var li = class {
|
|
|
3018
3037
|
this.#s.dispose(), this.#l.dispose();
|
|
3019
3038
|
}
|
|
3020
3039
|
reset() {
|
|
3021
|
-
this.#p || (this.#a.invalidate(), this.#d = void 0, this.#r.clear(), this.#f = void 0, this.#i.clear(), this.#l.set(
|
|
3040
|
+
this.#p || (this.#a.invalidate(), this.#d = void 0, this.#r.clear(), this.#f = void 0, this.#i.clear(), this.#l.set(ii));
|
|
3022
3041
|
}
|
|
3023
3042
|
async refresh(e = !1) {
|
|
3024
3043
|
if (this.#p) return;
|
|
3025
|
-
let t = this.#a.begin(), n = this.#u.$.flowId.value, r =
|
|
3044
|
+
let t = this.#a.begin(), n = this.#u.$.flowId.value, r = li(this.#u.$.selection.value);
|
|
3026
3045
|
if (n == null || r == null) {
|
|
3027
3046
|
(this.#l.value.actionLoading != null || this.#l.value.connectionLoading != null) && this.#v({
|
|
3028
3047
|
actionLoading: void 0,
|
|
@@ -3149,8 +3168,8 @@ var li = class {
|
|
|
3149
3168
|
}
|
|
3150
3169
|
}
|
|
3151
3170
|
}
|
|
3152
|
-
},
|
|
3153
|
-
function
|
|
3171
|
+
}, di = { catalogs: {} }, fi = 4, pi = "trigger:";
|
|
3172
|
+
function mi(e, t) {
|
|
3154
3173
|
if (e?.kind != "trigger") return;
|
|
3155
3174
|
let n = e.trigger;
|
|
3156
3175
|
if (n.kind != "poll" && n.kind != "integration") return;
|
|
@@ -3161,7 +3180,7 @@ function pi(e, t) {
|
|
|
3161
3180
|
triggerId: e.id
|
|
3162
3181
|
};
|
|
3163
3182
|
}
|
|
3164
|
-
function
|
|
3183
|
+
function hi(e, t, n, r) {
|
|
3165
3184
|
return {
|
|
3166
3185
|
description: n,
|
|
3167
3186
|
group: r,
|
|
@@ -3180,24 +3199,24 @@ function mi(e, t, n, r) {
|
|
|
3180
3199
|
}
|
|
3181
3200
|
};
|
|
3182
3201
|
}
|
|
3183
|
-
function
|
|
3202
|
+
function gi(e, t) {
|
|
3184
3203
|
return {
|
|
3185
3204
|
choices: [],
|
|
3186
3205
|
description: t.t("addNode.triggerChooseConnection"),
|
|
3187
3206
|
group: t.t("addNode.triggers"),
|
|
3188
|
-
id: `${
|
|
3207
|
+
id: `${pi}${e.key}`,
|
|
3189
3208
|
inputs: [],
|
|
3190
3209
|
kind: "trigger",
|
|
3191
3210
|
label: e.displayName,
|
|
3192
3211
|
outputs: []
|
|
3193
3212
|
};
|
|
3194
3213
|
}
|
|
3195
|
-
function
|
|
3214
|
+
function _i(e, t, n) {
|
|
3196
3215
|
let r = n.t("addNode.triggers"), i = t.preferred;
|
|
3197
|
-
return i == null ? t.active.length > 0 ? t.active.map((t) =>
|
|
3216
|
+
return i == null ? t.active.length > 0 ? t.active.map((t) => hi(e, t.connectionId, t.displayName, r)) : [{
|
|
3198
3217
|
description: n.t("addNode.triggerNeedsConnection", { provider: e.provider }),
|
|
3199
3218
|
group: r,
|
|
3200
|
-
id: `${
|
|
3219
|
+
id: `${pi}${e.key}:connect`,
|
|
3201
3220
|
inputs: [],
|
|
3202
3221
|
kind: "trigger",
|
|
3203
3222
|
label: n.t("addNode.triggerAddConnection"),
|
|
@@ -3206,12 +3225,12 @@ function gi(e, t, n) {
|
|
|
3206
3225
|
kind: "connect",
|
|
3207
3226
|
provider: e.provider
|
|
3208
3227
|
}
|
|
3209
|
-
}] : [
|
|
3228
|
+
}] : [hi(e, i.connectionId, i.displayName, r)];
|
|
3210
3229
|
}
|
|
3211
|
-
function
|
|
3230
|
+
function vi(e, t, n) {
|
|
3212
3231
|
let r = t.preferred;
|
|
3213
|
-
if (r != null) return
|
|
3214
|
-
let i =
|
|
3232
|
+
if (r != null) return hi(e, r.connectionId, r.displayName, n.t("addNode.triggers"));
|
|
3233
|
+
let i = gi(e, n), a = _i(e, t, n);
|
|
3215
3234
|
return {
|
|
3216
3235
|
...i,
|
|
3217
3236
|
description: t.active.length == 0 ? n.t("addNode.triggerNeedsConnection", { provider: e.provider }) : i.description,
|
|
@@ -3226,7 +3245,7 @@ function _i(e, t, n) {
|
|
|
3226
3245
|
}))
|
|
3227
3246
|
};
|
|
3228
3247
|
}
|
|
3229
|
-
var
|
|
3248
|
+
var yi = class {
|
|
3230
3249
|
#e;
|
|
3231
3250
|
#t;
|
|
3232
3251
|
#n;
|
|
@@ -3239,11 +3258,11 @@ var vi = class {
|
|
|
3239
3258
|
#l;
|
|
3240
3259
|
#u;
|
|
3241
3260
|
constructor(r, i, a, o, s = De()) {
|
|
3242
|
-
this.#t = new AbortController(), this.#a = new Y(), this.#c = t(
|
|
3261
|
+
this.#t = new AbortController(), this.#a = new Y(), this.#c = t(di), this.#u = !1, this.browseAddNodeOptions = async (e) => {
|
|
3243
3262
|
let t = this.#l.$.flowId.value;
|
|
3244
3263
|
if (e.aborted || this.#u || t == null || this.#l.$.target.value?.kind != "flow") return [];
|
|
3245
3264
|
let n = await this.#d();
|
|
3246
|
-
if (!(e.aborted || this.#u || t != this.#l.$.flowId.value)) return [...n.values()].map((e) =>
|
|
3265
|
+
if (!(e.aborted || this.#u || t != this.#l.$.flowId.value)) return [...n.values()].map((e) => gi(e, this.#i));
|
|
3247
3266
|
}, this.provideAddNodeOptions = async (e, t) => {
|
|
3248
3267
|
let n = this.#l.$.flowId.value;
|
|
3249
3268
|
if (t.aborted || this.#u || n == null || this.#l.$.target.value?.kind != "flow") return [];
|
|
@@ -3259,17 +3278,17 @@ var vi = class {
|
|
|
3259
3278
|
e.provider,
|
|
3260
3279
|
e.type
|
|
3261
3280
|
].some((e) => e.toLowerCase().includes(r))), o = [...new Set(a.map((e) => e.provider))].filter((e) => this.#c.value.catalogs[e] == null);
|
|
3262
|
-
for (let e = 0; e < o.length; e +=
|
|
3263
|
-
let r = await Promise.all(o.slice(e, e +
|
|
3281
|
+
for (let e = 0; e < o.length; e += fi) {
|
|
3282
|
+
let r = await Promise.all(o.slice(e, e + fi).map(async (e) => [e, q(await this.#n.listConnectorConnections(e, t))]));
|
|
3264
3283
|
if (t.aborted || this.#u || n != this.#l.$.flowId.value) return;
|
|
3265
3284
|
this.#f({ catalogs: {
|
|
3266
3285
|
...this.#c.value.catalogs,
|
|
3267
3286
|
...Object.fromEntries(r)
|
|
3268
3287
|
} });
|
|
3269
3288
|
}
|
|
3270
|
-
return a.map((e) =>
|
|
3289
|
+
return a.map((e) => vi(e, this.#c.value.catalogs[e.provider], this.#i));
|
|
3271
3290
|
}, this.provideAddNodeOptionChoices = async (e, t) => {
|
|
3272
|
-
let n = this.#l.$.flowId.value, r = e.startsWith(
|
|
3291
|
+
let n = this.#l.$.flowId.value, r = e.startsWith(pi) ? e.slice(8) : void 0;
|
|
3273
3292
|
if (t.aborted || this.#u || n == null || r == null || this.#l.$.target.value?.kind != "flow") return;
|
|
3274
3293
|
let i = (await this.#d()).get(r);
|
|
3275
3294
|
if (t.aborted || this.#u || n != this.#l.$.flowId.value || i == null) return;
|
|
@@ -3281,9 +3300,9 @@ var vi = class {
|
|
|
3281
3300
|
[i.provider]: a
|
|
3282
3301
|
} });
|
|
3283
3302
|
}
|
|
3284
|
-
return
|
|
3303
|
+
return _i(i, a, this.#i);
|
|
3285
3304
|
}, this.#n = r, this.#r = o, this.#i = s, this.#s = a, this.#l = i, this.#o = n((e) => {
|
|
3286
|
-
let t = e(i.$.selection), n =
|
|
3305
|
+
let t = e(i.$.selection), n = mi(t, i), r = e(this.#c);
|
|
3287
3306
|
if (t?.kind != "trigger") return { authorizationPending: !1 };
|
|
3288
3307
|
let a = t.trigger;
|
|
3289
3308
|
if (a.kind != "poll" && a.kind != "integration") return { authorizationPending: !1 };
|
|
@@ -3310,10 +3329,10 @@ var vi = class {
|
|
|
3310
3329
|
this.#o.dispose(), this.#c.dispose();
|
|
3311
3330
|
}
|
|
3312
3331
|
reset() {
|
|
3313
|
-
this.#u || (this.#t.abort(), this.#t = new AbortController(), this.#e = void 0, this.#a.invalidate(), this.#c.set(
|
|
3332
|
+
this.#u || (this.#t.abort(), this.#t = new AbortController(), this.#e = void 0, this.#a.invalidate(), this.#c.set(di));
|
|
3314
3333
|
}
|
|
3315
3334
|
async refresh(e = !1) {
|
|
3316
|
-
let t = this.#a.begin(), n = this.#l.$.flowId.value, r =
|
|
3335
|
+
let t = this.#a.begin(), n = this.#l.$.flowId.value, r = mi(this.#l.$.selection.value, this.#l);
|
|
3317
3336
|
if (!this.#u) {
|
|
3318
3337
|
if (n == null || r == null) {
|
|
3319
3338
|
this.#c.value.connectionLoading != null && this.#f({ connectionLoading: void 0 });
|
|
@@ -3370,7 +3389,7 @@ var vi = class {
|
|
|
3370
3389
|
delete t[e], this.#f({
|
|
3371
3390
|
authorizationProvider: void 0,
|
|
3372
3391
|
catalogs: t
|
|
3373
|
-
}),
|
|
3392
|
+
}), mi(this.#l.$.selection.value, this.#l)?.provider == e && await this.refresh(!0);
|
|
3374
3393
|
}
|
|
3375
3394
|
#d() {
|
|
3376
3395
|
if (this.#e != null) return this.#e;
|
|
@@ -3391,13 +3410,13 @@ var vi = class {
|
|
|
3391
3410
|
};
|
|
3392
3411
|
//#endregion
|
|
3393
3412
|
//#region src/workbench/browser/runtime/designer/flowChanges.ts
|
|
3394
|
-
function
|
|
3413
|
+
function bi(e, t) {
|
|
3395
3414
|
return {
|
|
3396
3415
|
...e,
|
|
3397
3416
|
content: bt(e.content, t)
|
|
3398
3417
|
};
|
|
3399
3418
|
}
|
|
3400
|
-
function
|
|
3419
|
+
function xi(e, t) {
|
|
3401
3420
|
return [{
|
|
3402
3421
|
kind: "subflow.create",
|
|
3403
3422
|
subflow: {
|
|
@@ -3422,17 +3441,17 @@ function bi(e, t) {
|
|
|
3422
3441
|
subflowId: e
|
|
3423
3442
|
}];
|
|
3424
3443
|
}
|
|
3425
|
-
function
|
|
3444
|
+
function Si(e, t, n, r, i) {
|
|
3426
3445
|
switch (r.kind) {
|
|
3427
|
-
case "code": return
|
|
3446
|
+
case "code": return yr(t, {
|
|
3428
3447
|
moduleId: n,
|
|
3429
3448
|
nodeId: n
|
|
3430
3449
|
}, r.name);
|
|
3431
|
-
case "llm": return
|
|
3450
|
+
case "llm": return xr(t, {
|
|
3432
3451
|
nodeId: n,
|
|
3433
3452
|
taskId: i()
|
|
3434
3453
|
}, r.name, r.mode, r.outputDescription);
|
|
3435
|
-
case "connector": return
|
|
3454
|
+
case "connector": return br(t, {
|
|
3436
3455
|
nodeId: n,
|
|
3437
3456
|
taskId: i()
|
|
3438
3457
|
}, {
|
|
@@ -3445,18 +3464,18 @@ function xi(e, t, n, r, i) {
|
|
|
3445
3464
|
name: r.action.name,
|
|
3446
3465
|
outputs: Object.entries(r.action.outputs).map(([e, t]) => Object.assign({ handle: e }, t))
|
|
3447
3466
|
});
|
|
3448
|
-
case "condition": return
|
|
3449
|
-
case "value": return
|
|
3467
|
+
case "condition": return Sr(t, n, r.name);
|
|
3468
|
+
case "value": return Cr(t, n, r.name);
|
|
3450
3469
|
case "subflow": {
|
|
3451
3470
|
let i = e.subflow(r.subflowId);
|
|
3452
|
-
return i == null ? void 0 :
|
|
3471
|
+
return i == null ? void 0 : Ri(t, n, r.subflowId, i.inputs);
|
|
3453
3472
|
}
|
|
3454
|
-
case "webhook": return t.kind == "flow" ?
|
|
3473
|
+
case "webhook": return t.kind == "flow" ? wr(t, n, {
|
|
3455
3474
|
inputsDef: [],
|
|
3456
3475
|
kind: "webhook",
|
|
3457
3476
|
name: r.name
|
|
3458
3477
|
}) : void 0;
|
|
3459
|
-
case "cron": return t.kind == "flow" ?
|
|
3478
|
+
case "cron": return t.kind == "flow" ? wr(t, n, {
|
|
3460
3479
|
cronTimes: [{
|
|
3461
3480
|
type: "every",
|
|
3462
3481
|
unit: "hour",
|
|
@@ -3465,7 +3484,7 @@ function xi(e, t, n, r, i) {
|
|
|
3465
3484
|
kind: "cron",
|
|
3466
3485
|
name: r.name
|
|
3467
3486
|
}) : void 0;
|
|
3468
|
-
case "provider-trigger": return t.kind == "flow" ?
|
|
3487
|
+
case "provider-trigger": return t.kind == "flow" ? Tr(t, {
|
|
3469
3488
|
bindingId: i(),
|
|
3470
3489
|
nodeId: n
|
|
3471
3490
|
}, r.definition, {
|
|
@@ -3474,10 +3493,10 @@ function xi(e, t, n, r, i) {
|
|
|
3474
3493
|
}) : void 0;
|
|
3475
3494
|
}
|
|
3476
3495
|
}
|
|
3477
|
-
function Si(e, t, n) {
|
|
3478
|
-
return Tr(e.revision.content, t, n);
|
|
3479
|
-
}
|
|
3480
3496
|
function Ci(e, t, n) {
|
|
3497
|
+
return Er(e.revision.content, t, n);
|
|
3498
|
+
}
|
|
3499
|
+
function wi(e, t, n) {
|
|
3481
3500
|
let r = e.graph(t)?.nodes ?? {}, i = Object.fromEntries(n.flatMap((e) => r[e] == null ? [] : [[e, r[e]]]));
|
|
3482
3501
|
return {
|
|
3483
3502
|
bindings: Object.fromEntries(Object.values(i).flatMap((t) => "inputs" in t ? Object.values(t.inputs).flatMap((t) => t.kind == "sources" ? t.sources.flatMap((t) => {
|
|
@@ -3493,7 +3512,7 @@ function Ci(e, t, n) {
|
|
|
3493
3512
|
nodes: i
|
|
3494
3513
|
};
|
|
3495
3514
|
}
|
|
3496
|
-
function
|
|
3515
|
+
function Ti(e, t, n, r) {
|
|
3497
3516
|
if (e.graph(t) == null) return {
|
|
3498
3517
|
changes: [],
|
|
3499
3518
|
nodeIds: [],
|
|
@@ -3612,50 +3631,50 @@ function wi(e, t, n, r) {
|
|
|
3612
3631
|
sourceIds: a
|
|
3613
3632
|
};
|
|
3614
3633
|
}
|
|
3615
|
-
function Ti(e, t, n, r) {
|
|
3616
|
-
return Er(e.revision.content, t, n, r);
|
|
3617
|
-
}
|
|
3618
3634
|
function Ei(e, t, n, r) {
|
|
3635
|
+
return Dr(e.revision.content, t, n, r);
|
|
3636
|
+
}
|
|
3637
|
+
function Di(e, t, n, r) {
|
|
3619
3638
|
let i = e.node(t, n)?.node;
|
|
3620
3639
|
if (i == null) return;
|
|
3621
3640
|
let { description: a, ...o } = i;
|
|
3622
|
-
return
|
|
3641
|
+
return Hi(t, n, r == null ? o : {
|
|
3623
3642
|
...o,
|
|
3624
3643
|
description: r
|
|
3625
3644
|
});
|
|
3626
3645
|
}
|
|
3627
|
-
function
|
|
3646
|
+
function Oi(e, t, n, r) {
|
|
3628
3647
|
let i = e.node(t, n)?.node;
|
|
3629
3648
|
if (i == null) return;
|
|
3630
3649
|
let { icon: a, ...o } = i;
|
|
3631
|
-
return
|
|
3650
|
+
return Hi(t, n, r == null ? o : {
|
|
3632
3651
|
...o,
|
|
3633
3652
|
icon: r
|
|
3634
3653
|
});
|
|
3635
3654
|
}
|
|
3636
|
-
function
|
|
3655
|
+
function ki(e, t, n, r) {
|
|
3637
3656
|
let i = e.node(t, n)?.node;
|
|
3638
3657
|
if (i == null) return;
|
|
3639
|
-
if (!("inputs" in i)) return
|
|
3658
|
+
if (!("inputs" in i)) return Hi(t, n, {
|
|
3640
3659
|
...i,
|
|
3641
3660
|
name: r ?? i.name
|
|
3642
3661
|
});
|
|
3643
3662
|
let { name: a, ...o } = i;
|
|
3644
|
-
return
|
|
3663
|
+
return Hi(t, n, r == null ? o : {
|
|
3645
3664
|
...o,
|
|
3646
3665
|
name: r
|
|
3647
3666
|
});
|
|
3648
3667
|
}
|
|
3649
|
-
function
|
|
3650
|
-
return
|
|
3668
|
+
function Ai(e, t, n, r, i) {
|
|
3669
|
+
return Or(e.revision.content, t, n, r, i);
|
|
3651
3670
|
}
|
|
3652
|
-
function
|
|
3653
|
-
return
|
|
3671
|
+
function ji(e, t, n, r, i, a) {
|
|
3672
|
+
return Ar(e.revision.content, t, n, r, i, a);
|
|
3654
3673
|
}
|
|
3655
|
-
function
|
|
3674
|
+
function Mi(e, t, n, r) {
|
|
3656
3675
|
let i = e.graph(t), a = i?.nodes[n];
|
|
3657
3676
|
if (i == null || a?.kind != "condition") return;
|
|
3658
|
-
let o = Object.fromEntries([...a.cases.map((e) => [e.output, !0]), ...a.defaultOutput == null ? [] : [[a.defaultOutput, !0]]]), s = Object.fromEntries([...r.cases.map((e) => [e.output, !0]), ...r.defaultOutput == null ? [] : [[r.defaultOutput, !0]]]), c = a.input.handle == r.input.handle ? void 0 : [a.input.handle, r.input.handle], l =
|
|
3677
|
+
let o = Object.fromEntries([...a.cases.map((e) => [e.output, !0]), ...a.defaultOutput == null ? [] : [[a.defaultOutput, !0]]]), s = Object.fromEntries([...r.cases.map((e) => [e.output, !0]), ...r.defaultOutput == null ? [] : [[r.defaultOutput, !0]]]), c = a.input.handle == r.input.handle ? void 0 : [a.input.handle, r.input.handle], l = Bi(Object.keys(o).map((e) => ({ handle: e })), Object.keys(s).map((e) => ({ handle: e }))), u = new Set(Object.keys(s)), d = [];
|
|
3659
3678
|
for (let [e, o] of Object.entries(i.nodes)) {
|
|
3660
3679
|
if (!("inputs" in o)) continue;
|
|
3661
3680
|
let i = e == n, s = { ...o.inputs };
|
|
@@ -3698,11 +3717,11 @@ function ji(e, t, n, r) {
|
|
|
3698
3717
|
});
|
|
3699
3718
|
}
|
|
3700
3719
|
}
|
|
3701
|
-
return
|
|
3720
|
+
return jr(e.revision.content, d);
|
|
3702
3721
|
}
|
|
3703
|
-
function
|
|
3722
|
+
function Ni(e, t, n, r) {
|
|
3704
3723
|
let i = e.node(t, n)?.node;
|
|
3705
|
-
if (i?.kind == "value") return
|
|
3724
|
+
if (i?.kind == "value") return Hi(t, n, {
|
|
3706
3725
|
...i,
|
|
3707
3726
|
values: r.map((e) => ({
|
|
3708
3727
|
handle: e.handle,
|
|
@@ -3713,10 +3732,10 @@ function Mi(e, t, n, r) {
|
|
|
3713
3732
|
}))
|
|
3714
3733
|
});
|
|
3715
3734
|
}
|
|
3716
|
-
function
|
|
3735
|
+
function Pi(e, t, n, r) {
|
|
3717
3736
|
let i = e.graph(t)?.nodes[n];
|
|
3718
3737
|
if (i?.kind == "task") switch (r.kind) {
|
|
3719
|
-
case "code": return i.task == null ? void 0 :
|
|
3738
|
+
case "code": return i.task == null ? void 0 : Vi(e, t, n, {
|
|
3720
3739
|
...i.task,
|
|
3721
3740
|
name: r.name
|
|
3722
3741
|
});
|
|
@@ -3751,15 +3770,15 @@ function Ni(e, t, n, r) {
|
|
|
3751
3770
|
}
|
|
3752
3771
|
}
|
|
3753
3772
|
}
|
|
3754
|
-
function
|
|
3773
|
+
function Fi(e, t, n, r) {
|
|
3755
3774
|
let i = e.node(t, n);
|
|
3756
3775
|
if (i?.kind != "task" || i.node.task == null || i.module == null) return;
|
|
3757
|
-
let a =
|
|
3776
|
+
let a = Vi(e, t, n, {
|
|
3758
3777
|
...i.node.task,
|
|
3759
3778
|
...r
|
|
3760
3779
|
});
|
|
3761
3780
|
if (a == null) return;
|
|
3762
|
-
let o =
|
|
3781
|
+
let o = cr(i.module.source, lr("javascript", r.inputs.flatMap((e) => "handle" in e ? [{
|
|
3763
3782
|
handle: e.handle,
|
|
3764
3783
|
json_schema: e.jsonSchema,
|
|
3765
3784
|
nullable: e.nullable
|
|
@@ -3767,14 +3786,14 @@ function Pi(e, t, n, r) {
|
|
|
3767
3786
|
handle: e.handle,
|
|
3768
3787
|
json_schema: e.jsonSchema,
|
|
3769
3788
|
nullable: e.nullable
|
|
3770
|
-
}] : []))), s =
|
|
3771
|
-
return o == i.module.source ? s : [...s, ...
|
|
3789
|
+
}] : []))), s = jr(e.revision.content, a);
|
|
3790
|
+
return o == i.module.source ? s : [...s, ...Kr(i.node.task.moduleId, o, i.module.imports)];
|
|
3772
3791
|
}
|
|
3773
|
-
function
|
|
3792
|
+
function Ii(e, t, n, r) {
|
|
3774
3793
|
let i = e.trigger(n);
|
|
3775
3794
|
if (i == null || i.kind != "webhook") return;
|
|
3776
3795
|
let { options: a, ...o } = i;
|
|
3777
|
-
return
|
|
3796
|
+
return Hi(t, n, Object.keys(r.options).length == 0 ? {
|
|
3778
3797
|
...o,
|
|
3779
3798
|
inputsDef: r.inputs
|
|
3780
3799
|
} : {
|
|
@@ -3783,19 +3802,19 @@ function Fi(e, t, n, r) {
|
|
|
3783
3802
|
options: r.options
|
|
3784
3803
|
});
|
|
3785
3804
|
}
|
|
3786
|
-
function
|
|
3805
|
+
function Li(e, t, n) {
|
|
3787
3806
|
if (e.subflow(t) != null) return [{
|
|
3788
3807
|
definition: n,
|
|
3789
3808
|
kind: "subflow.definition.replace",
|
|
3790
3809
|
subflowId: t
|
|
3791
3810
|
}];
|
|
3792
3811
|
}
|
|
3793
|
-
function
|
|
3812
|
+
function Ri(e, t, n, r) {
|
|
3794
3813
|
return [{
|
|
3795
3814
|
kind: "graph.node.create",
|
|
3796
3815
|
node: {
|
|
3797
3816
|
concurrency: 1,
|
|
3798
|
-
inputs:
|
|
3817
|
+
inputs: zi(r),
|
|
3799
3818
|
kind: "subflow",
|
|
3800
3819
|
subflowId: n
|
|
3801
3820
|
},
|
|
@@ -3803,20 +3822,20 @@ function Li(e, t, n, r) {
|
|
|
3803
3822
|
target: e
|
|
3804
3823
|
}];
|
|
3805
3824
|
}
|
|
3806
|
-
function
|
|
3825
|
+
function zi(e) {
|
|
3807
3826
|
return Object.fromEntries(e.flatMap((e) => "handle" in e && Object.hasOwn(e, "value") ? [[e.handle, {
|
|
3808
3827
|
kind: "value",
|
|
3809
3828
|
value: e.value
|
|
3810
3829
|
}]] : []));
|
|
3811
3830
|
}
|
|
3812
|
-
function
|
|
3831
|
+
function Bi(e, t) {
|
|
3813
3832
|
let n = new Set(e.flatMap((e) => "handle" in e ? [e.handle] : [])), r = new Set(t.flatMap((e) => "handle" in e ? [e.handle] : [])), i = [...n].filter((e) => !r.has(e)), a = [...r].filter((e) => !n.has(e));
|
|
3814
3833
|
return i.length == 1 && a.length == 1 ? [i[0], a[0]] : void 0;
|
|
3815
3834
|
}
|
|
3816
|
-
function
|
|
3835
|
+
function Vi(e, t, n, r) {
|
|
3817
3836
|
let i = e.graph(t), a = i?.nodes[n];
|
|
3818
3837
|
if (i == null || a?.kind != "task" || a.task == null) return;
|
|
3819
|
-
let o =
|
|
3838
|
+
let o = Bi(a.task.inputs, r.inputs), s = Bi(a.task.outputs, r.outputs), c = new Set(r.inputs.flatMap((e) => "handle" in e ? [e.handle] : [])), l = new Set(r.outputs.flatMap((e) => "handle" in e ? [e.handle] : [])), u = [];
|
|
3820
3839
|
for (let [e, d] of Object.entries(i.nodes)) {
|
|
3821
3840
|
if (!("inputs" in d)) continue;
|
|
3822
3841
|
let i = e == n, f = { ...d.inputs };
|
|
@@ -3853,7 +3872,7 @@ function Bi(e, t, n, r) {
|
|
|
3853
3872
|
}
|
|
3854
3873
|
return u;
|
|
3855
3874
|
}
|
|
3856
|
-
function
|
|
3875
|
+
function Hi(e, t, n) {
|
|
3857
3876
|
return [{
|
|
3858
3877
|
kind: "graph.node.replace",
|
|
3859
3878
|
node: n,
|
|
@@ -3863,32 +3882,32 @@ function Vi(e, t, n) {
|
|
|
3863
3882
|
}
|
|
3864
3883
|
//#endregion
|
|
3865
3884
|
//#region src/workbench/browser/runtime/designer/remoteChangeTargets.ts
|
|
3866
|
-
function
|
|
3885
|
+
function Ui(e, t) {
|
|
3867
3886
|
return e.kind == t.kind && (e.kind != "subflow" || t.kind == "subflow" && e.id == t.id);
|
|
3868
3887
|
}
|
|
3869
|
-
function
|
|
3888
|
+
function Wi(e, t, n, r) {
|
|
3870
3889
|
for (let [i, a] of Object.entries(t.graph(n)?.nodes ?? {})) r(a) && e.add(i);
|
|
3871
3890
|
}
|
|
3872
|
-
function
|
|
3891
|
+
function Gi(e, t, n, r) {
|
|
3873
3892
|
let i = /* @__PURE__ */ new Set();
|
|
3874
3893
|
for (let a of r) switch (a.kind) {
|
|
3875
3894
|
case "graph.node.create":
|
|
3876
3895
|
case "graph.node.replace":
|
|
3877
|
-
|
|
3896
|
+
Ui(a.target, n) && i.add(a.nodeId);
|
|
3878
3897
|
break;
|
|
3879
3898
|
case "task.replace":
|
|
3880
|
-
|
|
3899
|
+
Wi(i, e, n, (e) => e.kind == "task" && e.task == null && e.taskId == a.taskId), Wi(i, t, n, (e) => e.kind == "task" && e.task == null && e.taskId == a.taskId);
|
|
3881
3900
|
break;
|
|
3882
3901
|
case "module.source.replace":
|
|
3883
|
-
|
|
3902
|
+
Wi(i, e, n, (e) => e.kind == "task" && e.task?.moduleId == a.moduleId), Wi(i, t, n, (e) => e.kind == "task" && e.task?.moduleId == a.moduleId);
|
|
3884
3903
|
break;
|
|
3885
|
-
case "subflow.definition.replace":
|
|
3904
|
+
case "subflow.definition.replace": Wi(i, e, n, (e) => e.kind == "subflow" && e.subflowId == a.subflowId), Wi(i, t, n, (e) => e.kind == "subflow" && e.subflowId == a.subflowId);
|
|
3886
3905
|
}
|
|
3887
3906
|
return new Set([...i].filter((e) => t.selection(n, e) != null));
|
|
3888
3907
|
}
|
|
3889
3908
|
//#endregion
|
|
3890
3909
|
//#region src/workbench/browser/runtime/stores/draftChanges.ts
|
|
3891
|
-
function
|
|
3910
|
+
function Ki(e) {
|
|
3892
3911
|
if (e.length != 1) return;
|
|
3893
3912
|
let t = e[0];
|
|
3894
3913
|
switch (t.kind) {
|
|
@@ -3901,7 +3920,7 @@ function Gi(e) {
|
|
|
3901
3920
|
default: return;
|
|
3902
3921
|
}
|
|
3903
3922
|
}
|
|
3904
|
-
var
|
|
3923
|
+
var qi = class {
|
|
3905
3924
|
#e;
|
|
3906
3925
|
#t;
|
|
3907
3926
|
#n;
|
|
@@ -3929,15 +3948,15 @@ var Ki = class {
|
|
|
3929
3948
|
this.#a = e;
|
|
3930
3949
|
}
|
|
3931
3950
|
project(e) {
|
|
3932
|
-
return this.#o.reduce((e, t) =>
|
|
3951
|
+
return this.#o.reduce((e, t) => bi(e, t.changes), e);
|
|
3933
3952
|
}
|
|
3934
3953
|
enqueue(e) {
|
|
3935
3954
|
let t = this.#s.then(e);
|
|
3936
3955
|
return this.#s = t, t;
|
|
3937
3956
|
}
|
|
3938
3957
|
async change(e, t, n, r = !0) {
|
|
3939
|
-
this.#t.beforeChange(r), this.#t.apply(
|
|
3940
|
-
let i =
|
|
3958
|
+
this.#t.beforeChange(r), this.#t.apply(bi(t, n));
|
|
3959
|
+
let i = Ki(n), a = this.#o.at(-1), o = i != null && a != null && !a.started && Ki(a.changes) == i ? a : void 0;
|
|
3941
3960
|
if (o != null) return o.changes = n, await o.result;
|
|
3942
3961
|
let s = {
|
|
3943
3962
|
...e,
|
|
@@ -3982,7 +4001,7 @@ var Ki = class {
|
|
|
3982
4001
|
#l(e, t, n) {
|
|
3983
4002
|
let r = {
|
|
3984
4003
|
...n.revision,
|
|
3985
|
-
content:
|
|
4004
|
+
content: bi(t, e.changes).content
|
|
3986
4005
|
};
|
|
3987
4006
|
this.#o = this.#o.filter((t) => t !== e), this.#a = r;
|
|
3988
4007
|
let i = this.#t.diagnostics(), a = this.#o.length == 0 && i?.revisionId == r.revisionId;
|
|
@@ -3991,19 +4010,19 @@ var Ki = class {
|
|
|
3991
4010
|
#u(e) {
|
|
3992
4011
|
this.#o = this.#o.filter((t) => t !== e), !(!this.#t.current(e) || this.#a == null) && this.#t.apply(this.project(this.#a));
|
|
3993
4012
|
}
|
|
3994
|
-
},
|
|
4013
|
+
}, Ji = 50, Yi = {
|
|
3995
4014
|
failed: !1,
|
|
3996
4015
|
loaded: !1,
|
|
3997
4016
|
loading: !0,
|
|
3998
4017
|
loadingMore: !1,
|
|
3999
4018
|
loadMoreFailed: !1,
|
|
4000
4019
|
flows: []
|
|
4001
|
-
},
|
|
4020
|
+
}, Xi = class {
|
|
4002
4021
|
#e;
|
|
4003
4022
|
#t;
|
|
4004
4023
|
#n = new Y();
|
|
4005
4024
|
#r;
|
|
4006
|
-
#i = t(
|
|
4025
|
+
#i = t(Yi);
|
|
4007
4026
|
#a = !1;
|
|
4008
4027
|
constructor(t, n, r) {
|
|
4009
4028
|
this.#e = t, this.#t = r, this.#r = n, this.$ = {
|
|
@@ -4045,7 +4064,7 @@ var Ki = class {
|
|
|
4045
4064
|
try {
|
|
4046
4065
|
let t = await this.#e.listFlows({
|
|
4047
4066
|
includeTotal: !0,
|
|
4048
|
-
limit:
|
|
4067
|
+
limit: Ji
|
|
4049
4068
|
});
|
|
4050
4069
|
if (!e()) return;
|
|
4051
4070
|
this.#o({
|
|
@@ -4074,7 +4093,7 @@ var Ki = class {
|
|
|
4074
4093
|
try {
|
|
4075
4094
|
let e = await this.#e.listFlows({
|
|
4076
4095
|
cursor: t,
|
|
4077
|
-
limit:
|
|
4096
|
+
limit: Ji
|
|
4078
4097
|
});
|
|
4079
4098
|
if (!n()) return;
|
|
4080
4099
|
let r = new Set(this.#i.value.flows.map((e) => e.flowId));
|
|
@@ -4124,7 +4143,7 @@ var Ki = class {
|
|
|
4124
4143
|
...e
|
|
4125
4144
|
});
|
|
4126
4145
|
}
|
|
4127
|
-
},
|
|
4146
|
+
}, Zi = class {
|
|
4128
4147
|
#e;
|
|
4129
4148
|
#t;
|
|
4130
4149
|
#n;
|
|
@@ -4192,29 +4211,29 @@ var Ki = class {
|
|
|
4192
4211
|
};
|
|
4193
4212
|
//#endregion
|
|
4194
4213
|
//#region src/workbench/browser/runtime/designer/diagnostics.ts
|
|
4195
|
-
function
|
|
4214
|
+
function Qi(e, t) {
|
|
4196
4215
|
return t == e || t.startsWith(`${e}/`);
|
|
4197
4216
|
}
|
|
4198
|
-
function
|
|
4217
|
+
function $i(e, t, n, r) {
|
|
4199
4218
|
if (e == null || t == null || n == null) return [];
|
|
4200
|
-
if (r != null) return
|
|
4219
|
+
if (r != null) return ia(t, r, n.diagnostics);
|
|
4201
4220
|
let i = t.kind == "flow" ? "/document/graph" : `/document/subflows/${t.id}`;
|
|
4202
|
-
return n.diagnostics.filter((e) =>
|
|
4221
|
+
return n.diagnostics.filter((e) => Qi(i, e.path));
|
|
4203
4222
|
}
|
|
4204
|
-
function
|
|
4223
|
+
function ea(e) {
|
|
4205
4224
|
return e.startsWith("/modules/") ? "code" : /\/graph\/nodes\/[^/]+\/task(?:\/|$)/.test(e) ? "task" : e.includes("/graph/nodes/") ? "node" : e.startsWith("/document/tasks/") ? "task" : "flow";
|
|
4206
4225
|
}
|
|
4207
|
-
function
|
|
4226
|
+
function ta(e, t) {
|
|
4208
4227
|
return t.startsWith("/inputs/") ? "inputs" : e.kind == "task" && t.startsWith("/task") ? "task" : e.kind == "condition" && (t.startsWith("/cases/") || t.startsWith("/input") || t.startsWith("/defaultOutput")) ? "condition" : "node";
|
|
4209
4228
|
}
|
|
4210
|
-
function
|
|
4229
|
+
function na(e, t, n) {
|
|
4211
4230
|
if (e == null || t == null) return;
|
|
4212
4231
|
let r = t.kind == "flow" ? "/document/graph/nodes/" : `/document/subflows/${t.id}/graph/nodes/`;
|
|
4213
4232
|
if (n.path.startsWith(r)) {
|
|
4214
4233
|
let i = n.path.slice(r.length), a = i.indexOf("/"), o = a < 0 ? i : i.slice(0, a), s = e.node(t, o);
|
|
4215
4234
|
return s == null ? void 0 : {
|
|
4216
4235
|
nodeId: o,
|
|
4217
|
-
section:
|
|
4236
|
+
section: ta(s.node, a < 0 ? "" : i.slice(a))
|
|
4218
4237
|
};
|
|
4219
4238
|
}
|
|
4220
4239
|
let i = /^\/document\/tasks\/([^/]+)(.*)$/.exec(n.path);
|
|
@@ -4234,39 +4253,39 @@ function ta(e, t, n) {
|
|
|
4234
4253
|
};
|
|
4235
4254
|
}
|
|
4236
4255
|
}
|
|
4237
|
-
function
|
|
4256
|
+
function ra(e, t, n) {
|
|
4238
4257
|
return n?.diagnostics.map((n) => ({
|
|
4239
4258
|
diagnostic: n,
|
|
4240
|
-
location:
|
|
4241
|
-
scope:
|
|
4259
|
+
location: na(e, t, n),
|
|
4260
|
+
scope: ea(n.path)
|
|
4242
4261
|
})) ?? [];
|
|
4243
4262
|
}
|
|
4244
|
-
function
|
|
4263
|
+
function ia(e, t, n) {
|
|
4245
4264
|
let r = e.kind == "flow" ? `/document/graph/nodes/${t.id}` : `/document/subflows/${e.id}/graph/nodes/${t.id}`, i = [r];
|
|
4246
4265
|
if (t.kind == "task") {
|
|
4247
4266
|
t.node.task == null ? i.push(`/document/tasks/${t.node.taskId}`) : i.push(`${r}/task`);
|
|
4248
4267
|
let e = t.definition != null && "moduleId" in t.definition ? t.definition.moduleId : void 0;
|
|
4249
4268
|
e != null && i.push(`/modules/${e}`);
|
|
4250
4269
|
} else t.kind == "subflow" && i.push(`/document/subflows/${t.node.subflowId}`);
|
|
4251
|
-
return n.filter((e) => i.some((t) =>
|
|
4270
|
+
return n.filter((e) => i.some((t) => Qi(t, e.path)));
|
|
4252
4271
|
}
|
|
4253
4272
|
//#endregion
|
|
4254
4273
|
//#region src/workbench/browser/runtime/stores/workspaceModel.ts
|
|
4255
|
-
var
|
|
4274
|
+
var aa = {
|
|
4256
4275
|
checkLoading: !1,
|
|
4257
4276
|
selectedNodeIds: [],
|
|
4258
4277
|
workspaceLoadFailed: !1,
|
|
4259
4278
|
workspaceLoading: !1
|
|
4260
4279
|
};
|
|
4261
|
-
function
|
|
4280
|
+
function oa(e) {
|
|
4262
4281
|
return e.workspaceLoading ? "loading" : e.busy == "designer" ? "saving" : e.draft == null ? "noDraft" : "saved";
|
|
4263
4282
|
}
|
|
4264
|
-
function
|
|
4283
|
+
function sa(e, t) {
|
|
4265
4284
|
if (t.phase != null) return t.phase;
|
|
4266
4285
|
let n = e?.content.modules[t.moduleId];
|
|
4267
4286
|
return n == null ? "failed" : t.source == n.source ? "saved" : "dirty";
|
|
4268
4287
|
}
|
|
4269
|
-
function
|
|
4288
|
+
function ca(e, t, n) {
|
|
4270
4289
|
if (e == null || t == null || n.length != 1) return;
|
|
4271
4290
|
let r = e.node(t, n[0]);
|
|
4272
4291
|
if (!(r?.kind != "task" || r.definition == null || !("moduleId" in r.definition) || r.module == null)) return {
|
|
@@ -4274,9 +4293,9 @@ function sa(e, t, n) {
|
|
|
4274
4293
|
source: r.module.source
|
|
4275
4294
|
};
|
|
4276
4295
|
}
|
|
4277
|
-
var
|
|
4296
|
+
var la = class {
|
|
4278
4297
|
#e;
|
|
4279
|
-
#t = t(
|
|
4298
|
+
#t = t(aa);
|
|
4280
4299
|
#n;
|
|
4281
4300
|
constructor(t, r) {
|
|
4282
4301
|
let i = e(this.#t, (e) => e.busy), a = e(this.#t, (e) => e.checkLoading), o = e(this.#t, (e) => e.diagnosticFocus), s = e(this.#t, (e) => e.diagnostics), c = e(this.#t, (e) => e.draft), l = e(this.#t, (e) => {
|
|
@@ -4284,7 +4303,7 @@ var ca = class {
|
|
|
4284
4303
|
let { phase: t, ...n } = e.moduleEditor;
|
|
4285
4304
|
return {
|
|
4286
4305
|
...n,
|
|
4287
|
-
status:
|
|
4306
|
+
status: sa(e.draft, e.moduleEditor)
|
|
4288
4307
|
};
|
|
4289
4308
|
}), u = e(this.#t, (e) => e.nodeFocus), d = e(this.#t, (e) => e.presentation), f = e(this.#t, (e) => e.flowId), p = e(this.#t, (e) => e.live), m = e(this.#t, (e) => e.draft == null ? void 0 : J(e.draft)), h = e(this.#t, (e) => e.selectedNodeIds), g = e(this.#t, (e) => e.target), _ = e(this.#t, (e) => e.workspaceLoadFailed), v = e(this.#t, (e) => e.workspaceLoading);
|
|
4290
4309
|
this.#e = e(this.#t, (e) => ({
|
|
@@ -4302,7 +4321,7 @@ var ca = class {
|
|
|
4302
4321
|
busy: i,
|
|
4303
4322
|
checkLoading: a,
|
|
4304
4323
|
diagnosticFocus: o,
|
|
4305
|
-
diagnosticItems: e(this.#t, (e) =>
|
|
4324
|
+
diagnosticItems: e(this.#t, (e) => ra(e.draft == null ? void 0 : J(e.draft), e.target, e.diagnostics)),
|
|
4306
4325
|
diagnostics: s,
|
|
4307
4326
|
draft: c,
|
|
4308
4327
|
flow: n((e) => {
|
|
@@ -4317,7 +4336,7 @@ var ca = class {
|
|
|
4317
4336
|
flowNextCursor: r.$.nextCursor,
|
|
4318
4337
|
flowTotal: r.$.total,
|
|
4319
4338
|
flows: r.$.flows,
|
|
4320
|
-
inspectorDiagnostics: e(this.#t, (e) =>
|
|
4339
|
+
inspectorDiagnostics: e(this.#t, (e) => $i(e.draft == null ? void 0 : J(e.draft), e.target, e.diagnostics, y.value)),
|
|
4321
4340
|
live: p,
|
|
4322
4341
|
moduleDiagnostics: e(this.#t, (e) => {
|
|
4323
4342
|
let t = e.moduleEditor?.moduleId;
|
|
@@ -4329,7 +4348,7 @@ var ca = class {
|
|
|
4329
4348
|
revision: m,
|
|
4330
4349
|
selection: y,
|
|
4331
4350
|
selectedNodeIds: h,
|
|
4332
|
-
status: e(this.#t,
|
|
4351
|
+
status: e(this.#t, oa),
|
|
4333
4352
|
target: g,
|
|
4334
4353
|
targetFlow: n((e) => e(g)?.kind == "flow" ? e(r.$.flows).find((t) => t.flowId == e(f)) : void 0),
|
|
4335
4354
|
targetName: e(this.#t, (e) => {
|
|
@@ -4352,14 +4371,14 @@ var ca = class {
|
|
|
4352
4371
|
for (let e of Object.values(this.$)) this.#n.has(e) || e.dispose();
|
|
4353
4372
|
this.#e.dispose(), this.#t.dispose();
|
|
4354
4373
|
}
|
|
4355
|
-
},
|
|
4356
|
-
function
|
|
4374
|
+
}, ua = 250;
|
|
4375
|
+
function da(e, t) {
|
|
4357
4376
|
if (t != null) return t.kind == "flow" || e.subflow(t.id) != null ? t : { kind: "flow" };
|
|
4358
4377
|
}
|
|
4359
|
-
function
|
|
4378
|
+
function fa(e, t) {
|
|
4360
4379
|
return e?.kind == t?.kind ? e?.kind != "subflow" || t?.kind == "subflow" && e.id == t.id : !1;
|
|
4361
4380
|
}
|
|
4362
|
-
var
|
|
4381
|
+
var pa = class {
|
|
4363
4382
|
#e;
|
|
4364
4383
|
#t;
|
|
4365
4384
|
#n = new Y();
|
|
@@ -4382,8 +4401,8 @@ var fa = class {
|
|
|
4382
4401
|
#y = 0;
|
|
4383
4402
|
#b;
|
|
4384
4403
|
#x;
|
|
4385
|
-
constructor(e, t, n =
|
|
4386
|
-
this.#e = e, this.#c = t, this.#i = n, this.#r = r, this.#s = i, this.#o = new
|
|
4404
|
+
constructor(e, t, n = qr, r = De(), i = () => {}) {
|
|
4405
|
+
this.#e = e, this.#c = t, this.#i = n, this.#r = r, this.#s = i, this.#o = new Xi(e, t, r), this.#l = new la(r, this.#o), this.#t = new qi(e, t, r, {
|
|
4387
4406
|
apply: (e, t) => this.#w(e, t),
|
|
4388
4407
|
beforeChange: (e) => {
|
|
4389
4408
|
this.#M(), this.#h = !1, e && (this.#B({ busy: "designer" }), this.#c(void 0));
|
|
@@ -4396,7 +4415,7 @@ var fa = class {
|
|
|
4396
4415
|
},
|
|
4397
4416
|
headChanged: (e, t) => this.#N(e, t),
|
|
4398
4417
|
recover: (e) => this.#O(e, !0)
|
|
4399
|
-
}), this.#a = new
|
|
4418
|
+
}), this.#a = new Zi(e, t, (e) => this.#B({ presentation: e }), r), this.$ = this.#l.$;
|
|
4400
4419
|
}
|
|
4401
4420
|
dispose() {
|
|
4402
4421
|
this.#M(), this.#_ = !0, this.#n.invalidate(), this.#a.dispose(), this.#b?.(), this.#x?.(), this.#l.dispose(), this.#o.dispose();
|
|
@@ -4468,7 +4487,7 @@ var fa = class {
|
|
|
4468
4487
|
selectNodes(e) {
|
|
4469
4488
|
return e.length == this.#l.value.selectedNodeIds.length && e.every((e, t) => e == this.#l.value.selectedNodeIds[t]) ? !0 : this.#F() ? (this.#M(), this.#B({
|
|
4470
4489
|
diagnosticFocus: void 0,
|
|
4471
|
-
moduleEditor:
|
|
4490
|
+
moduleEditor: ca(this.#l.value.draft == null ? void 0 : J(this.#l.value.draft), this.#l.value.target, e),
|
|
4472
4491
|
nodeFocus: void 0,
|
|
4473
4492
|
selectedNodeIds: e
|
|
4474
4493
|
}), !0) : !1;
|
|
@@ -4505,7 +4524,7 @@ var fa = class {
|
|
|
4505
4524
|
if (!this.#F() || this.#l.value.draft == null) return !1;
|
|
4506
4525
|
let t = this.#i();
|
|
4507
4526
|
this.#B({ busy: "resource" }), this.#c(void 0);
|
|
4508
|
-
let n = await this.#C(
|
|
4527
|
+
let n = await this.#C(xi(t, e), !1);
|
|
4509
4528
|
return this.#B({ busy: void 0 }), n != null && (this.selectTarget({
|
|
4510
4529
|
id: t,
|
|
4511
4530
|
kind: "subflow"
|
|
@@ -4538,9 +4557,9 @@ var fa = class {
|
|
|
4538
4557
|
if (e.kind == "comment") return await this.#S(i, a, t);
|
|
4539
4558
|
let o = J(r), s = ot(e, o, i, this.#r.t);
|
|
4540
4559
|
if (s == null) return;
|
|
4541
|
-
let c =
|
|
4560
|
+
let c = Si(o, i, a, s, this.#i);
|
|
4542
4561
|
if (c == null) return;
|
|
4543
|
-
let l = n == null ? c : [...c, ...
|
|
4562
|
+
let l = n == null ? c : [...c, ...Hr(bi(r, c).content, i, n(a))], u = this.#C(l);
|
|
4544
4563
|
this.selectNodes([a]);
|
|
4545
4564
|
let d = this.moveNodes({ [a]: t });
|
|
4546
4565
|
if (await u != null && (await d, !this.#_)) return this.#B({ nodeFocus: {
|
|
@@ -4551,20 +4570,20 @@ var fa = class {
|
|
|
4551
4570
|
async connect(e) {
|
|
4552
4571
|
let t = this.$.revision.value, n = this.#l.value.target;
|
|
4553
4572
|
if (t == null || n == null) return;
|
|
4554
|
-
let r =
|
|
4573
|
+
let r = Hr(t.revision.content, n, e);
|
|
4555
4574
|
r.length > 0 && await this.#C(r);
|
|
4556
4575
|
}
|
|
4557
4576
|
async disconnect(e) {
|
|
4558
4577
|
let t = this.$.revision.value, n = this.#l.value.target;
|
|
4559
4578
|
if (t == null || n == null) return;
|
|
4560
|
-
let r =
|
|
4579
|
+
let r = Ur(t.revision.content, n, e);
|
|
4561
4580
|
r.length > 0 && await this.#C(r);
|
|
4562
4581
|
}
|
|
4563
4582
|
async deleteSelectedNodes() {
|
|
4564
4583
|
if (!this.#F()) return;
|
|
4565
4584
|
let e = this.$.revision.value, t = this.#l.value.target;
|
|
4566
4585
|
if (e == null || t == null || this.#l.value.selectedNodeIds.length == 0) return;
|
|
4567
|
-
let n = Ye(this.#l.value.presentation?.value ?? {}, t), r = new Set(this.#l.value.selectedNodeIds.filter((e) => n.has(e))), i =
|
|
4586
|
+
let n = Ye(this.#l.value.presentation?.value ?? {}, t), r = new Set(this.#l.value.selectedNodeIds.filter((e) => n.has(e))), i = Ci(e, t, this.#l.value.selectedNodeIds), a = i.length == 0 ? void 0 : this.#C(i), o = r.size == 0 ? void 0 : this.#T((e) => Ue(e, t, r));
|
|
4568
4587
|
this.selectNodes([]), (a == null || await a != null) && await o;
|
|
4569
4588
|
}
|
|
4570
4589
|
copySelectedNodes() {
|
|
@@ -4578,14 +4597,14 @@ var fa = class {
|
|
|
4578
4597
|
sourceId: e.id,
|
|
4579
4598
|
title: e.title
|
|
4580
4599
|
}] : []),
|
|
4581
|
-
nodes:
|
|
4600
|
+
nodes: wi(e, t, this.#l.value.selectedNodeIds)
|
|
4582
4601
|
};
|
|
4583
4602
|
}
|
|
4584
4603
|
async pasteNodes(e) {
|
|
4585
4604
|
if (!this.#F()) return;
|
|
4586
4605
|
let t = this.$.revision.value, n = this.#l.value.target;
|
|
4587
4606
|
if (t == null || n == null || this.#u == null) return;
|
|
4588
|
-
let r =
|
|
4607
|
+
let r = Ti(t, n, this.#u.nodes, this.#i), i = r.changes.length == 0 ? void 0 : this.#C(r.changes), a = this.#u.comments.map((e) => ({
|
|
4589
4608
|
...e,
|
|
4590
4609
|
nodeId: this.#i()
|
|
4591
4610
|
}));
|
|
@@ -4616,49 +4635,49 @@ var fa = class {
|
|
|
4616
4635
|
async saveNodeSettings(e, t) {
|
|
4617
4636
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
4618
4637
|
if (n == null || r == null) return !1;
|
|
4619
|
-
let i =
|
|
4638
|
+
let i = Ei(n, r, e, t);
|
|
4620
4639
|
return i != null && await this.#C(i) != null;
|
|
4621
4640
|
}
|
|
4622
4641
|
async saveNodeDescription(e, t) {
|
|
4623
4642
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
4624
4643
|
if (n == null || r == null) return !1;
|
|
4625
|
-
let i =
|
|
4644
|
+
let i = Di(n, r, e, t);
|
|
4626
4645
|
return i != null && await this.#C(i) != null;
|
|
4627
4646
|
}
|
|
4628
4647
|
async saveNodeIcon(e, t) {
|
|
4629
4648
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
4630
4649
|
if (n == null || r == null) return !1;
|
|
4631
|
-
let i =
|
|
4650
|
+
let i = Oi(n, r, e, t);
|
|
4632
4651
|
return i != null && await this.#C(i) != null;
|
|
4633
4652
|
}
|
|
4634
4653
|
async saveNodeTitle(e, t) {
|
|
4635
4654
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
4636
4655
|
if (n == null || r == null) return !1;
|
|
4637
|
-
let i =
|
|
4656
|
+
let i = ki(n, r, e, t);
|
|
4638
4657
|
return i != null && await this.#C(i) != null;
|
|
4639
4658
|
}
|
|
4640
4659
|
async setInputValue(e, t, n) {
|
|
4641
4660
|
let r = this.$.revision.value, i = this.#l.value.target;
|
|
4642
4661
|
if (r == null || i == null) return !1;
|
|
4643
|
-
let a =
|
|
4662
|
+
let a = Ai(r, i, e, t, n);
|
|
4644
4663
|
return a != null && await this.#C(a) != null;
|
|
4645
4664
|
}
|
|
4646
4665
|
async setInputVariable(e, t, n) {
|
|
4647
4666
|
let r = this.$.revision.value, i = this.#l.value.target;
|
|
4648
4667
|
if (r == null || i == null) return !1;
|
|
4649
|
-
let a = n == null ?
|
|
4668
|
+
let a = n == null ? Ai(r, i, e, t, void 0) : ji(r, i, e, t, n, this.#i());
|
|
4650
4669
|
return a != null && await this.#C(a) != null;
|
|
4651
4670
|
}
|
|
4652
4671
|
async saveCondition(e, t) {
|
|
4653
4672
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
4654
4673
|
if (n == null || r == null) return !1;
|
|
4655
|
-
let i =
|
|
4674
|
+
let i = Mi(n, r, e, t);
|
|
4656
4675
|
return i != null && await this.#C(i) != null;
|
|
4657
4676
|
}
|
|
4658
4677
|
async saveValue(e, t) {
|
|
4659
4678
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
4660
4679
|
if (n == null || r == null) return !1;
|
|
4661
|
-
let i =
|
|
4680
|
+
let i = Ni(n, r, e, t);
|
|
4662
4681
|
return i != null && await this.#C(i) != null;
|
|
4663
4682
|
}
|
|
4664
4683
|
async saveComment(e, t) {
|
|
@@ -4673,13 +4692,13 @@ var fa = class {
|
|
|
4673
4692
|
async saveTaskSettings(e, t) {
|
|
4674
4693
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
4675
4694
|
if (n == null || r == null) return !1;
|
|
4676
|
-
let i =
|
|
4695
|
+
let i = Pi(n, r, e, t);
|
|
4677
4696
|
return i != null && await this.#C(i) != null;
|
|
4678
4697
|
}
|
|
4679
4698
|
async saveCodeTaskPorts(e, t) {
|
|
4680
4699
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
4681
4700
|
if (n == null || r == null) return !1;
|
|
4682
|
-
let i = n.node(r, e), a = this.#l.value.moduleEditor, o = i?.kind == "task" && i.node.task != null && a?.moduleId == i.node.task.moduleId ?
|
|
4701
|
+
let i = n.node(r, e), a = this.#l.value.moduleEditor, o = i?.kind == "task" && i.node.task != null && a?.moduleId == i.node.task.moduleId ? cr(a.source, lr("javascript", t.inputs.flatMap((e) => "handle" in e ? [{
|
|
4683
4702
|
handle: e.handle,
|
|
4684
4703
|
json_schema: e.jsonSchema,
|
|
4685
4704
|
nullable: e.nullable
|
|
@@ -4687,7 +4706,7 @@ var fa = class {
|
|
|
4687
4706
|
handle: e.handle,
|
|
4688
4707
|
json_schema: e.jsonSchema,
|
|
4689
4708
|
nullable: e.nullable
|
|
4690
|
-
}] : []))) : void 0, s =
|
|
4709
|
+
}] : []))) : void 0, s = Fi(n, r, e, t);
|
|
4691
4710
|
if (s == null || await this.#C(s) == null) return !1;
|
|
4692
4711
|
let c = this.#l.value.moduleEditor;
|
|
4693
4712
|
return o != null && c != null && a != null && c.moduleId == a.moduleId && c.source == a.source && this.#B({ moduleEditor: {
|
|
@@ -4698,43 +4717,43 @@ var fa = class {
|
|
|
4698
4717
|
async setConnectorConnection(e, t) {
|
|
4699
4718
|
let n = this.$.revision.value;
|
|
4700
4719
|
if (n == null) return !1;
|
|
4701
|
-
let r =
|
|
4720
|
+
let r = Nr(n.revision.content, e, t);
|
|
4702
4721
|
return r != null && await this.#C(r) != null;
|
|
4703
4722
|
}
|
|
4704
4723
|
async saveTriggerSettings(e, t) {
|
|
4705
4724
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
4706
4725
|
if (n == null || r?.kind != "flow") return !1;
|
|
4707
|
-
let i =
|
|
4726
|
+
let i = Pr(n.revision.content, r, e, t);
|
|
4708
4727
|
return i != null && await this.#C(i) != null;
|
|
4709
4728
|
}
|
|
4710
4729
|
async saveTriggerConfig(e, t, n) {
|
|
4711
4730
|
let r = this.$.revision.value, i = this.#l.value.target;
|
|
4712
4731
|
if (r == null || i?.kind != "flow") return !1;
|
|
4713
|
-
let a =
|
|
4732
|
+
let a = Fr(r.revision.content, i, e, t, n);
|
|
4714
4733
|
return a != null && await this.#C(a) != null;
|
|
4715
4734
|
}
|
|
4716
4735
|
async saveTriggerSchedule(e, t) {
|
|
4717
4736
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
4718
4737
|
if (n == null || r?.kind != "flow") return !1;
|
|
4719
|
-
let i =
|
|
4738
|
+
let i = Ir(n.revision.content, r, e, t);
|
|
4720
4739
|
return i != null && await this.#C(i) != null;
|
|
4721
4740
|
}
|
|
4722
4741
|
async saveWebhook(e, t) {
|
|
4723
4742
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
4724
4743
|
if (n == null || r?.kind != "flow") return !1;
|
|
4725
|
-
let i =
|
|
4744
|
+
let i = Ii(n, r, e, t);
|
|
4726
4745
|
return i != null && await this.#C(i) != null;
|
|
4727
4746
|
}
|
|
4728
4747
|
async setTriggerConnection(e, t) {
|
|
4729
4748
|
let n = this.$.revision.value, r = this.#l.value.target;
|
|
4730
4749
|
if (n == null || r?.kind != "flow") return !1;
|
|
4731
|
-
let i =
|
|
4750
|
+
let i = Lr(n.revision.content, r, e, t);
|
|
4732
4751
|
return i != null && await this.#C(i) != null;
|
|
4733
4752
|
}
|
|
4734
4753
|
async saveSubflowSettings(e, t) {
|
|
4735
4754
|
let n = this.$.revision.value;
|
|
4736
4755
|
if (n == null) return !1;
|
|
4737
|
-
let r =
|
|
4756
|
+
let r = Li(n, e, t);
|
|
4738
4757
|
return r != null && await this.#C(r) != null;
|
|
4739
4758
|
}
|
|
4740
4759
|
updateModuleSource(e) {
|
|
@@ -4765,9 +4784,9 @@ var fa = class {
|
|
|
4765
4784
|
...e,
|
|
4766
4785
|
phase: "saving"
|
|
4767
4786
|
} });
|
|
4768
|
-
let t = await
|
|
4787
|
+
let t = await Gr(e.source);
|
|
4769
4788
|
if (this.#_) return !1;
|
|
4770
|
-
let n = await this.#C(
|
|
4789
|
+
let n = await this.#C(Kr(e.moduleId, e.source, t));
|
|
4771
4790
|
return !this.#_ && this.#l.value.moduleEditor?.moduleId == e.moduleId && this.#B({ moduleEditor: {
|
|
4772
4791
|
...this.#l.value.moduleEditor,
|
|
4773
4792
|
phase: n == null ? "failed" : void 0
|
|
@@ -4830,7 +4849,7 @@ var fa = class {
|
|
|
4830
4849
|
return this.#B({
|
|
4831
4850
|
diagnostics: t ? this.#l.value.diagnostics : void 0,
|
|
4832
4851
|
draft: e,
|
|
4833
|
-
moduleEditor: o != null && n != null &&
|
|
4852
|
+
moduleEditor: o != null && n != null && sa(n, o) != "saved" ? o : ca(r, a, i),
|
|
4834
4853
|
selectedNodeIds: i,
|
|
4835
4854
|
target: a
|
|
4836
4855
|
}), r;
|
|
@@ -4896,7 +4915,7 @@ var fa = class {
|
|
|
4896
4915
|
s = this.#k(a, o);
|
|
4897
4916
|
}
|
|
4898
4917
|
if (s.revisionId == a.revisionId) return !0;
|
|
4899
|
-
let c = o.kind == "changes" && t != null ?
|
|
4918
|
+
let c = o.kind == "changes" && t != null ? Gi(J(a), J(s), t, o.revisions.flatMap((e) => e.operations)) : void 0;
|
|
4900
4919
|
o.kind == "snapshot" && this.#M();
|
|
4901
4920
|
let l = this.#L(s, !1);
|
|
4902
4921
|
return this.#N(e.flowId, s.revisionId), o.kind == "changes" && o.revisions.length > 0 && t != null && c != null && i == this.#m && this.#A(e, t, c, i), n && (this.#c({
|
|
@@ -4914,22 +4933,22 @@ var fa = class {
|
|
|
4914
4933
|
if (e.revision.parentRevisionId != n.revisionId) throw Error("Invalid Draft revision chain.");
|
|
4915
4934
|
n = {
|
|
4916
4935
|
...e.revision,
|
|
4917
|
-
content:
|
|
4936
|
+
content: bi(n, e.operations).content
|
|
4918
4937
|
};
|
|
4919
4938
|
}
|
|
4920
4939
|
return n;
|
|
4921
4940
|
}
|
|
4922
4941
|
#A(e, t, n, r) {
|
|
4923
4942
|
let i = this.#l.value;
|
|
4924
|
-
if (!this.#z(e) || r != this.#m || !
|
|
4943
|
+
if (!this.#z(e) || r != this.#m || !fa(i.target, t)) return;
|
|
4925
4944
|
let a = this.#p;
|
|
4926
4945
|
if (a != null) {
|
|
4927
|
-
if (a.flowId != e.flowId || !
|
|
4946
|
+
if (a.flowId != e.flowId || !fa(a.target, t)) {
|
|
4928
4947
|
this.#M();
|
|
4929
4948
|
return;
|
|
4930
4949
|
}
|
|
4931
4950
|
for (let e of n) a.targets.add(e);
|
|
4932
|
-
globalThis.clearTimeout(a.timer), a.timer = globalThis.setTimeout(() => this.#j(),
|
|
4951
|
+
globalThis.clearTimeout(a.timer), a.timer = globalThis.setTimeout(() => this.#j(), ua);
|
|
4933
4952
|
return;
|
|
4934
4953
|
}
|
|
4935
4954
|
n.size == 0 || i.selectedNodeIds.length > 0 || (this.#p = {
|
|
@@ -4938,7 +4957,7 @@ var fa = class {
|
|
|
4938
4957
|
flowId: e.flowId,
|
|
4939
4958
|
target: t,
|
|
4940
4959
|
targets: new Set(n),
|
|
4941
|
-
timer: globalThis.setTimeout(() => this.#j(),
|
|
4960
|
+
timer: globalThis.setTimeout(() => this.#j(), ua),
|
|
4942
4961
|
viewport: this.#P().viewport
|
|
4943
4962
|
});
|
|
4944
4963
|
}
|
|
@@ -4946,7 +4965,7 @@ var fa = class {
|
|
|
4946
4965
|
let e = this.#p;
|
|
4947
4966
|
if (this.#p = void 0, e == null || !e.current() || e.generation != this.#m) return;
|
|
4948
4967
|
let t = this.#l.value;
|
|
4949
|
-
if (t.flowId != e.flowId || !
|
|
4968
|
+
if (t.flowId != e.flowId || !fa(t.target, e.target) || t.selectedNodeIds.length > 0) return;
|
|
4950
4969
|
let n = this.#P().viewport;
|
|
4951
4970
|
if (n.x != e.viewport.x || n.y != e.viewport.y || n.zoom != e.viewport.zoom || t.draft == null) return;
|
|
4952
4971
|
let r = J(t.draft), i = [...e.targets].filter((t) => r.selection(e.target, t) != null);
|
|
@@ -4967,13 +4986,13 @@ var fa = class {
|
|
|
4967
4986
|
}
|
|
4968
4987
|
#F() {
|
|
4969
4988
|
let e = this.#l.value.moduleEditor;
|
|
4970
|
-
return e == null ||
|
|
4989
|
+
return e == null || sa(this.#l.value.draft, e) == "saved" || (this.#c({
|
|
4971
4990
|
kind: "error",
|
|
4972
4991
|
message: this.#r.t("notice.unsavedCode")
|
|
4973
4992
|
}), !1);
|
|
4974
4993
|
}
|
|
4975
4994
|
#I(e) {
|
|
4976
|
-
let t = J(e), n =
|
|
4995
|
+
let t = J(e), n = da(t, this.#l.value.target);
|
|
4977
4996
|
return {
|
|
4978
4997
|
revision: t,
|
|
4979
4998
|
selectedNodeIds: this.#l.value.selectedNodeIds.filter((e) => n != null && t.selection(n, e) != null),
|
|
@@ -4982,7 +5001,7 @@ var fa = class {
|
|
|
4982
5001
|
}
|
|
4983
5002
|
#L(e, t) {
|
|
4984
5003
|
this.#t.replaceCommitted(e);
|
|
4985
|
-
let n = this.#t.project(e), r = this.#l.value.moduleEditor, i = r != null &&
|
|
5004
|
+
let n = this.#t.project(e), r = this.#l.value.moduleEditor, i = r != null && sa(this.#l.value.draft, r) != "saved", a = this.#I(n), o = a.target;
|
|
4986
5005
|
return this.#B({
|
|
4987
5006
|
diagnostics: t ? this.#l.value.diagnostics : void 0,
|
|
4988
5007
|
draft: n,
|
|
@@ -4993,7 +5012,7 @@ var fa = class {
|
|
|
4993
5012
|
}
|
|
4994
5013
|
#R(e, t, n) {
|
|
4995
5014
|
let r = this.#l.value.moduleEditor;
|
|
4996
|
-
return r == null ||
|
|
5015
|
+
return r == null || sa(this.#l.value.draft, r) == "saved" ? ca(e, t, n) : {
|
|
4997
5016
|
...r,
|
|
4998
5017
|
phase: "failed"
|
|
4999
5018
|
};
|
|
@@ -5007,13 +5026,13 @@ var fa = class {
|
|
|
5007
5026
|
};
|
|
5008
5027
|
//#endregion
|
|
5009
5028
|
//#region src/workbench/browser/runtime/stores/workbenchStore.ts
|
|
5010
|
-
function
|
|
5029
|
+
function ma(e) {
|
|
5011
5030
|
return new Map(e.nodes.map((e) => [e.id, e]));
|
|
5012
5031
|
}
|
|
5013
|
-
function
|
|
5032
|
+
function ha(e, t) {
|
|
5014
5033
|
return e == null || t == null ? [] : J(e).designerInputs(t);
|
|
5015
5034
|
}
|
|
5016
|
-
function
|
|
5035
|
+
function ga(e, t, n, r, i) {
|
|
5017
5036
|
if (e == null || t?.kind != "flow" || n?.revisionId != e.revisionId || n.flowId != e.flowId) return /* @__PURE__ */ new Map();
|
|
5018
5037
|
let a = r.find((t) => t.kind == "run.started" && t.payload.flowId == e.flowId)?.payload.scopeId;
|
|
5019
5038
|
return typeof a == "string" ? new Map(r.flatMap((t) => {
|
|
@@ -5021,7 +5040,7 @@ function ha(e, t, n, r, i) {
|
|
|
5021
5040
|
return t.payload.scopeId == a && t.payload.flowId == e.flowId && typeof n == "string" && i.has(n) ? [[t.sequence, n]] : [];
|
|
5022
5041
|
})) : /* @__PURE__ */ new Map();
|
|
5023
5042
|
}
|
|
5024
|
-
var
|
|
5043
|
+
var _a = { openExternalPage: async () => !1 }, va = class {
|
|
5025
5044
|
#e;
|
|
5026
5045
|
#t;
|
|
5027
5046
|
#n;
|
|
@@ -5031,36 +5050,37 @@ var ga = { openExternalPage: async () => !1 }, _a = class {
|
|
|
5031
5050
|
#o;
|
|
5032
5051
|
#s;
|
|
5033
5052
|
#c;
|
|
5034
|
-
|
|
5035
|
-
|
|
5036
|
-
|
|
5037
|
-
|
|
5053
|
+
#l;
|
|
5054
|
+
constructor(r, i, a = () => crypto.randomUUID(), o = De(), s = _a, c = !0) {
|
|
5055
|
+
this.#t = new Y(), this.#r = t(), this.#a = t([]), this.#o = t(!1), this.#s = t(!1), this.#c = new Y(), this.#l = !1, this.provideAddNodeOptions = async (e, t) => await this.#u([this.triggers.provideAddNodeOptions(e, t), this.connectors.provideAddNodeOptions(e, t)], t), this.browseAddNodeOptions = async (e) => await this.#u([this.triggers.browseAddNodeOptions(e), this.connectors.browseAddNodeOptions(e)], e), this.provideAddNodeOptionChoices = async (e, t) => await (e.startsWith("trigger:") ? this.triggers.provideAddNodeOptionChoices(e, t) : this.connectors.provideAddNodeOptionChoices(e, t)), this.#e = r, this.#n = o, this.#i = c;
|
|
5056
|
+
let l = (e) => {
|
|
5057
|
+
this.#l || this.#r.set(e);
|
|
5038
5058
|
};
|
|
5039
|
-
this.runs = new Qe(r,
|
|
5040
|
-
let
|
|
5059
|
+
this.runs = new Qe(r, l, o), this.workspace = new pa(r, l, qr, o, (e) => void this.#d(r, e)), this.connectors = new ui(r, this.workspace, l, s, o), this.triggers = new yi(r, this.workspace, l, s, o), this.publications = new Qr(r, this.workspace, l, a, o), this.runRequests = new ri(r, this.runs, l, o, a);
|
|
5060
|
+
let u = /* @__PURE__ */ new Map(), d, f = n((e) => {
|
|
5041
5061
|
let t = e(this.workspace.$.draft);
|
|
5042
|
-
|
|
5043
|
-
let n = e(this.workspace.$.target), r = e(this.workspace.$.presentation)?.value, i = e(this.workspace.$.diagnostics)?.diagnostics, a = e(this.connectors.$.actions), s = e(this.connectors.$.catalogs), c = e(o.t$),
|
|
5044
|
-
...
|
|
5062
|
+
d != t?.flowId && (u.clear(), d = t?.flowId);
|
|
5063
|
+
let n = e(this.workspace.$.target), r = e(this.workspace.$.presentation)?.value, i = e(this.workspace.$.diagnostics)?.diagnostics, a = e(this.connectors.$.actions), s = e(this.connectors.$.catalogs), c = e(o.t$), l = e(this.runs.$.run), f = e(this.runs.$.events), p = e(this.#a), m = e(this.#o), h = e(this.#s), g = n == null ? "" : n.kind == "flow" ? "flow" : `subflow:${n.id}`, _ = [
|
|
5064
|
+
...ha(t, n),
|
|
5045
5065
|
r == null || n == null ? void 0 : Ge(r, n),
|
|
5046
5066
|
i,
|
|
5047
5067
|
a,
|
|
5048
5068
|
s,
|
|
5049
5069
|
c,
|
|
5050
|
-
|
|
5070
|
+
l,
|
|
5051
5071
|
f,
|
|
5052
5072
|
p,
|
|
5053
5073
|
m,
|
|
5054
5074
|
h,
|
|
5055
|
-
...
|
|
5056
|
-
], v =
|
|
5075
|
+
...l == null ? [] : [t?.revisionId]
|
|
5076
|
+
], v = u.get(g);
|
|
5057
5077
|
if (v != null && v.inputs.length == _.length && v.inputs.every((e, t) => e === _[t])) return v.graph;
|
|
5058
|
-
let y = nt(t, n, r, i, a, s, c,
|
|
5059
|
-
return
|
|
5078
|
+
let y = nt(t, n, r, i, a, s, c, l, f, p, m, h, this.#i);
|
|
5079
|
+
return u.set(g, {
|
|
5060
5080
|
graph: y,
|
|
5061
5081
|
inputs: _
|
|
5062
5082
|
}), y;
|
|
5063
|
-
}),
|
|
5083
|
+
}), p = e(f, ma);
|
|
5064
5084
|
this.$ = {
|
|
5065
5085
|
busy: n((e) => {
|
|
5066
5086
|
let t = e(this.workspace.$.busy);
|
|
@@ -5071,23 +5091,23 @@ var ga = { openExternalPage: async () => !1 }, _a = class {
|
|
|
5071
5091
|
if (e(this.publications.$.rollingBackPublicationId) != null) return "rollback";
|
|
5072
5092
|
if (e(this.publications.$.changingTriggerId) != null) return "trigger";
|
|
5073
5093
|
}),
|
|
5074
|
-
designer:
|
|
5075
|
-
designerNodeById:
|
|
5094
|
+
designer: f,
|
|
5095
|
+
designerNodeById: p,
|
|
5076
5096
|
notice: this.#r,
|
|
5077
|
-
runEventNodes: n((e) =>
|
|
5097
|
+
runEventNodes: n((e) => ga(e(this.workspace.$.draft), e(this.workspace.$.target), e(this.runs.$.run), e(this.runs.$.events), e(p))),
|
|
5078
5098
|
selectedDesignerNode: n((e) => {
|
|
5079
5099
|
let t = e(this.workspace.$.selectedNodeIds);
|
|
5080
|
-
return t.length == 1 ? e(
|
|
5100
|
+
return t.length == 1 ? e(p).get(t[0]) : void 0;
|
|
5081
5101
|
}),
|
|
5082
|
-
variableNames: this.#
|
|
5083
|
-
variableNamesLoaded: this.#
|
|
5084
|
-
variableNamesLoading: this.#
|
|
5102
|
+
variableNames: this.#a,
|
|
5103
|
+
variableNamesLoaded: this.#o,
|
|
5104
|
+
variableNamesLoading: this.#s
|
|
5085
5105
|
};
|
|
5086
5106
|
}
|
|
5087
5107
|
dispose() {
|
|
5088
|
-
this.#
|
|
5108
|
+
this.#l = !0, this.#t.invalidate(), this.#c.invalidate();
|
|
5089
5109
|
for (let e of Object.values(this.$)) e.dispose();
|
|
5090
|
-
this.connectors.dispose(), this.publications.dispose(), this.runRequests.dispose(), this.runs.dispose(), this.triggers.dispose(), this.workspace.dispose(), this.#
|
|
5110
|
+
this.connectors.dispose(), this.publications.dispose(), this.runRequests.dispose(), this.runs.dispose(), this.triggers.dispose(), this.workspace.dispose(), this.#a.dispose(), this.#o.dispose(), this.#s.dispose();
|
|
5091
5111
|
}
|
|
5092
5112
|
async start(e) {
|
|
5093
5113
|
this.#t.invalidate(), this.connectors.reset(), this.triggers.reset(), this.publications.reset(), this.runRequests.reset(), this.runs.reset(), await this.workspace.start(e);
|
|
@@ -5096,28 +5116,28 @@ var ga = { openExternalPage: async () => !1 }, _a = class {
|
|
|
5096
5116
|
await this.workspace.reloadFlows();
|
|
5097
5117
|
}
|
|
5098
5118
|
dismissNotice() {
|
|
5099
|
-
this.#
|
|
5119
|
+
this.#l || this.#r.set(void 0);
|
|
5100
5120
|
}
|
|
5101
5121
|
async refreshVariableNames() {
|
|
5102
|
-
if (this.#
|
|
5103
|
-
let e = this.#
|
|
5104
|
-
this.#
|
|
5122
|
+
if (this.#l || !this.#i) return;
|
|
5123
|
+
let e = this.#c.begin();
|
|
5124
|
+
this.#s.set(!0);
|
|
5105
5125
|
try {
|
|
5106
5126
|
let { variables: t } = await this.#e.listVariables();
|
|
5107
|
-
if (!e() || this.#
|
|
5108
|
-
this.#
|
|
5127
|
+
if (!e() || this.#l) return;
|
|
5128
|
+
this.#a.set(t.map((e) => e.name)), this.#o.set(!0);
|
|
5109
5129
|
} catch (t) {
|
|
5110
|
-
e() && !this.#
|
|
5130
|
+
e() && !this.#l && this.#r.set(K(t, this.#n.t));
|
|
5111
5131
|
} finally {
|
|
5112
|
-
e() && !this.#
|
|
5132
|
+
e() && !this.#l && this.#s.set(!1);
|
|
5113
5133
|
}
|
|
5114
5134
|
}
|
|
5115
5135
|
async selectFlow(e) {
|
|
5116
|
-
return this.#
|
|
5136
|
+
return this.#l || (this.#t.invalidate(), this.#r.set(void 0), !await this.workspace.selectFlow(e)) ? !1 : (this.connectors.reset(), this.triggers.reset(), this.publications.reset(), this.runRequests.reset(), this.runs.reset(), !0);
|
|
5117
5137
|
}
|
|
5118
5138
|
async createFlow(e) {
|
|
5119
5139
|
let t = await this.workspace.createFlow(e);
|
|
5120
|
-
return this.#
|
|
5140
|
+
return this.#l || t == null ? !1 : (await this.selectFlow(t.flowId), this.#l || this.#r.set({
|
|
5121
5141
|
kind: "success",
|
|
5122
5142
|
message: this.#n.t("notice.created", { name: t.name })
|
|
5123
5143
|
}), !0);
|
|
@@ -5141,9 +5161,9 @@ var ga = { openExternalPage: async () => !1 }, _a = class {
|
|
|
5141
5161
|
let r = await this.workspace.addNode(e, t, n);
|
|
5142
5162
|
return r != null && e.kind == "connector" && this.connectors.refresh(), r != null && e.kind == "trigger" && this.triggers.refresh(), r;
|
|
5143
5163
|
}
|
|
5144
|
-
async #
|
|
5164
|
+
async #u(e, t) {
|
|
5145
5165
|
let n = await Promise.allSettled(e);
|
|
5146
|
-
if (t.aborted || this.#
|
|
5166
|
+
if (t.aborted || this.#l) return;
|
|
5147
5167
|
let r = n.filter((e) => e.status == "rejected");
|
|
5148
5168
|
if (r.length > 0 && r.length == n.length) throw r[0].reason;
|
|
5149
5169
|
return r.length > 0 && this.#r.set(K(r[0].reason, this.#n.t)), n.flatMap((e) => e.status == "fulfilled" ? e.value ?? [] : []);
|
|
@@ -5159,61 +5179,83 @@ var ga = { openExternalPage: async () => !1 }, _a = class {
|
|
|
5159
5179
|
let e = this.workspace.$.targetFlow.value;
|
|
5160
5180
|
return e == null ? "unavailable" : await this.runRequests.requestLive(e);
|
|
5161
5181
|
}
|
|
5162
|
-
async #
|
|
5182
|
+
async #d(e, t) {
|
|
5163
5183
|
let n = this.workspace.$.target.value;
|
|
5164
|
-
if (this.#
|
|
5184
|
+
if (this.#l || this.runRequests.$.submitting.value != null || n?.kind != "flow" || this.workspace.$.flowId.value != t.flowId) return;
|
|
5165
5185
|
let r = this.#t.begin();
|
|
5166
5186
|
try {
|
|
5167
5187
|
let n = await e.getRun(t.runId), i = this.workspace.$.target.value;
|
|
5168
|
-
if (!r() || this.#
|
|
5188
|
+
if (!r() || this.#l || i?.kind != "flow" || this.workspace.$.flowId.value != t.flowId || n.flowId != t.flowId || n.runId != t.runId) return;
|
|
5169
5189
|
this.runs.followExternal(n);
|
|
5170
5190
|
} catch {
|
|
5171
5191
|
return;
|
|
5172
5192
|
}
|
|
5173
5193
|
}
|
|
5174
|
-
},
|
|
5175
|
-
function
|
|
5176
|
-
let
|
|
5194
|
+
}, ya = St(() => import("./flowWorkspace-bWrxAxMV.js").then((e) => e.t));
|
|
5195
|
+
function ba({ action: e, description: t, error: n, onSubmit: r, onTokenChange: i, pending: a = !1, title: o, token: s, tokenLabel: l }) {
|
|
5196
|
+
let u = s != null && l != null && i != null, d = s ?? "", f = /* @__PURE__ */ Q(Et, { children: [
|
|
5197
|
+
/* @__PURE__ */ Z("div", {
|
|
5198
|
+
"aria-hidden": "true",
|
|
5199
|
+
className: "flex size-10 items-center justify-center rounded-lg bg-muted text-muted-foreground",
|
|
5200
|
+
children: /* @__PURE__ */ Q("svg", {
|
|
5201
|
+
className: "size-5",
|
|
5202
|
+
fill: "none",
|
|
5203
|
+
stroke: "currentColor",
|
|
5204
|
+
strokeLinecap: "round",
|
|
5205
|
+
strokeLinejoin: "round",
|
|
5206
|
+
strokeWidth: "1.8",
|
|
5207
|
+
viewBox: "0 0 24 24",
|
|
5208
|
+
children: [/* @__PURE__ */ Z("rect", {
|
|
5209
|
+
height: "9",
|
|
5210
|
+
rx: "2",
|
|
5211
|
+
width: "14",
|
|
5212
|
+
x: "5",
|
|
5213
|
+
y: "11"
|
|
5214
|
+
}), /* @__PURE__ */ Z("path", { d: "M8 11V8a4 4 0 0 1 8 0v3" })]
|
|
5215
|
+
})
|
|
5216
|
+
}),
|
|
5177
5217
|
/* @__PURE__ */ Q("header", {
|
|
5178
|
-
className: "flex flex-col gap-
|
|
5218
|
+
className: "flex flex-col gap-2",
|
|
5179
5219
|
children: [/* @__PURE__ */ Z("h1", {
|
|
5180
|
-
className: "text-
|
|
5220
|
+
className: "text-xl font-semibold tracking-tight text-balance",
|
|
5181
5221
|
children: o
|
|
5182
5222
|
}), /* @__PURE__ */ Z("p", {
|
|
5183
|
-
className: "text-sm text-muted-foreground",
|
|
5223
|
+
className: "text-sm/relaxed text-muted-foreground text-pretty",
|
|
5184
5224
|
children: t
|
|
5185
5225
|
})]
|
|
5186
5226
|
}),
|
|
5187
|
-
|
|
5227
|
+
u && /* @__PURE__ */ Z(le, { children: /* @__PURE__ */ Q(c, {
|
|
5188
5228
|
"data-invalid": n != null,
|
|
5189
5229
|
children: [
|
|
5190
|
-
/* @__PURE__ */ Z(
|
|
5230
|
+
/* @__PURE__ */ Z(H, {
|
|
5191
5231
|
htmlFor: "session-token",
|
|
5192
|
-
children:
|
|
5232
|
+
children: l
|
|
5193
5233
|
}),
|
|
5194
|
-
/* @__PURE__ */ Z(
|
|
5234
|
+
/* @__PURE__ */ Z(se, {
|
|
5195
5235
|
autoComplete: "username",
|
|
5196
5236
|
name: "username",
|
|
5197
5237
|
type: "hidden",
|
|
5198
5238
|
value: "open-flow",
|
|
5199
5239
|
readOnly: !0
|
|
5200
5240
|
}),
|
|
5201
|
-
/* @__PURE__ */ Z(
|
|
5241
|
+
/* @__PURE__ */ Z(se, {
|
|
5202
5242
|
autoComplete: "current-password",
|
|
5203
5243
|
"aria-invalid": n != null,
|
|
5204
5244
|
autoFocus: !0,
|
|
5245
|
+
className: "h-9",
|
|
5205
5246
|
id: "session-token",
|
|
5206
5247
|
name: "session-token",
|
|
5207
5248
|
onChange: (e) => i?.(e.target.value),
|
|
5208
5249
|
spellCheck: !1,
|
|
5209
5250
|
type: "password",
|
|
5210
|
-
value:
|
|
5251
|
+
value: d
|
|
5211
5252
|
}),
|
|
5212
|
-
n != null && /* @__PURE__ */ Z(
|
|
5253
|
+
n != null && /* @__PURE__ */ Z(_e, { children: n })
|
|
5213
5254
|
]
|
|
5214
5255
|
}) }),
|
|
5215
|
-
e != null && r != null && /* @__PURE__ */ Q(
|
|
5216
|
-
disabled: a ||
|
|
5256
|
+
e != null && r != null && /* @__PURE__ */ Q(N, {
|
|
5257
|
+
disabled: a || u && d.length == 0,
|
|
5258
|
+
size: "lg",
|
|
5217
5259
|
type: "submit",
|
|
5218
5260
|
children: [a && /* @__PURE__ */ Z(Oe, {
|
|
5219
5261
|
"aria-label": e,
|
|
@@ -5221,33 +5263,33 @@ function ya({ action: e, description: t, error: n, onSubmit: r, onTokenChange: i
|
|
|
5221
5263
|
}), e]
|
|
5222
5264
|
}),
|
|
5223
5265
|
a && e == null && /* @__PURE__ */ Z(Oe, { "aria-label": t })
|
|
5224
|
-
] });
|
|
5266
|
+
] }), p = "m-auto flex w-full max-w-[420px] flex-col gap-5 rounded-xl bg-card p-6 shadow-lg shadow-black/10";
|
|
5225
5267
|
return /* @__PURE__ */ Z("main", {
|
|
5226
5268
|
className: "open-flow-workbench",
|
|
5227
5269
|
children: /* @__PURE__ */ Z("div", {
|
|
5228
|
-
className: "grid h-full
|
|
5270
|
+
className: "grid h-full overflow-auto bg-muted/20 p-4",
|
|
5229
5271
|
children: r == null ? /* @__PURE__ */ Z("section", {
|
|
5230
5272
|
"aria-busy": a,
|
|
5231
|
-
className:
|
|
5232
|
-
children:
|
|
5273
|
+
className: p,
|
|
5274
|
+
children: f
|
|
5233
5275
|
}) : /* @__PURE__ */ Z("form", {
|
|
5234
5276
|
"aria-busy": a,
|
|
5235
|
-
className:
|
|
5277
|
+
className: p,
|
|
5236
5278
|
onSubmit: r,
|
|
5237
|
-
children:
|
|
5279
|
+
children: f
|
|
5238
5280
|
})
|
|
5239
5281
|
})
|
|
5240
5282
|
});
|
|
5241
5283
|
}
|
|
5242
|
-
function
|
|
5284
|
+
function xa({ host: e, store: t }) {
|
|
5243
5285
|
let n = a(t.$.notice);
|
|
5244
5286
|
return Ct(() => e.notify(n), [e, n]), Ct(() => () => e.notify(void 0), [e]), null;
|
|
5245
5287
|
}
|
|
5246
|
-
function
|
|
5288
|
+
function Sa({ hrefFor: e, hostAction: t, hostTitle: n, language: r, navigation: i, onHostAction: o, onLanguageChange: s, store: c, theme: l }) {
|
|
5247
5289
|
let u = a(c.workspace.$.flowId);
|
|
5248
5290
|
return /* @__PURE__ */ Z("div", {
|
|
5249
5291
|
className: "app-shell",
|
|
5250
|
-
children: u == null ? /* @__PURE__ */ Z(
|
|
5292
|
+
children: u == null ? /* @__PURE__ */ Z(nr, {
|
|
5251
5293
|
hrefForFlow: (t) => e({
|
|
5252
5294
|
flowId: t.flowId,
|
|
5253
5295
|
view: "design"
|
|
@@ -5265,7 +5307,7 @@ function xa({ hrefFor: e, hostAction: t, hostTitle: n, language: r, navigation:
|
|
|
5265
5307
|
"aria-busy": "true",
|
|
5266
5308
|
className: "workspace"
|
|
5267
5309
|
}),
|
|
5268
|
-
children: /* @__PURE__ */ Z(
|
|
5310
|
+
children: /* @__PURE__ */ Z(ya, {
|
|
5269
5311
|
hostAction: t,
|
|
5270
5312
|
hostTitle: n,
|
|
5271
5313
|
hrefFor: e,
|
|
@@ -5277,55 +5319,55 @@ function xa({ hrefFor: e, hostAction: t, hostTitle: n, language: r, navigation:
|
|
|
5277
5319
|
})
|
|
5278
5320
|
});
|
|
5279
5321
|
}
|
|
5280
|
-
function
|
|
5281
|
-
let
|
|
5282
|
-
|
|
5283
|
-
let [{ i18n:
|
|
5284
|
-
let t = De(i), n = new
|
|
5322
|
+
function Ca({ host: e, hostAction: t, hostTitle: n, hrefFor: r, language: i, location: a, onHostAction: s, onLanguageChange: c, onNavigate: l, preferences: u, theme: d, variables: f = !0 }) {
|
|
5323
|
+
let p = wt(l);
|
|
5324
|
+
p.current = l;
|
|
5325
|
+
let [{ i18n: m, navigation: h, store: g }] = Tt(() => {
|
|
5326
|
+
let t = De(i), n = new va(new ze((t, n) => e.request(t, n), (t, n) => e.subscribeFlow(t, n), (t) => e.subscribeFlowCatalog(t)), u, () => crypto.randomUUID(), t, e, f);
|
|
5285
5327
|
return {
|
|
5286
5328
|
i18n: t,
|
|
5287
|
-
navigation: new Ot(n, a, (e, t) =>
|
|
5329
|
+
navigation: new Ot(n, a, (e, t) => p.current(e, t)),
|
|
5288
5330
|
store: n
|
|
5289
5331
|
};
|
|
5290
5332
|
});
|
|
5291
5333
|
return Ct(() => {
|
|
5292
|
-
|
|
5334
|
+
h.start();
|
|
5293
5335
|
let e = () => {
|
|
5294
|
-
|
|
5336
|
+
g.connectors.refreshAfterAuthorization(), g.triggers.refreshAfterAuthorization(), g.refreshVariableNames();
|
|
5295
5337
|
};
|
|
5296
5338
|
return globalThis.addEventListener("focus", e), () => {
|
|
5297
|
-
globalThis.removeEventListener("focus", e),
|
|
5339
|
+
globalThis.removeEventListener("focus", e), h.dispose(), g.dispose(), m.dispose();
|
|
5298
5340
|
};
|
|
5299
5341
|
}, [
|
|
5300
|
-
p,
|
|
5301
5342
|
m,
|
|
5302
|
-
h
|
|
5303
|
-
|
|
5304
|
-
|
|
5305
|
-
|
|
5306
|
-
|
|
5343
|
+
h,
|
|
5344
|
+
g
|
|
5345
|
+
]), Ct(() => void h.apply(a), [a, h]), Ct(() => {
|
|
5346
|
+
m.lang != i && m.switchLang(i);
|
|
5347
|
+
}, [m, i]), /* @__PURE__ */ Z(o, {
|
|
5348
|
+
i18n: m,
|
|
5307
5349
|
children: /* @__PURE__ */ Q("div", {
|
|
5308
5350
|
className: "open-flow-theme open-flow-workbench",
|
|
5309
5351
|
"data-theme": d,
|
|
5310
|
-
children: [/* @__PURE__ */ Z(
|
|
5352
|
+
children: [/* @__PURE__ */ Z(xa, {
|
|
5311
5353
|
host: e,
|
|
5312
|
-
store:
|
|
5313
|
-
}), /* @__PURE__ */ Z(
|
|
5354
|
+
store: g
|
|
5355
|
+
}), /* @__PURE__ */ Z(Sa, {
|
|
5314
5356
|
hostAction: t,
|
|
5315
5357
|
hostTitle: n,
|
|
5316
5358
|
hrefFor: r,
|
|
5317
5359
|
language: i,
|
|
5318
|
-
navigation:
|
|
5360
|
+
navigation: h,
|
|
5319
5361
|
onHostAction: s,
|
|
5320
5362
|
onLanguageChange: c,
|
|
5321
|
-
store:
|
|
5363
|
+
store: g,
|
|
5322
5364
|
theme: d
|
|
5323
5365
|
})]
|
|
5324
5366
|
})
|
|
5325
5367
|
});
|
|
5326
5368
|
}
|
|
5327
|
-
function
|
|
5328
|
-
return /* @__PURE__ */ Z(
|
|
5369
|
+
function wa({ sessionKey: e, ...t }) {
|
|
5370
|
+
return /* @__PURE__ */ Z(Ca, { ...t }, e);
|
|
5329
5371
|
}
|
|
5330
5372
|
//#endregion
|
|
5331
|
-
export {
|
|
5373
|
+
export { ba as OpenFlowSessionGate, wa as OpenFlowWorkbench, gt as isWorkbenchLanguage, _t as resolveWorkbenchLanguage, ht as workbenchLanguageNames, mt as workbenchLanguages };
|