@khaos-systems/helm 0.1.14 → 0.2.0

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.
@@ -0,0 +1,2561 @@
1
+ import { c as V, j as t, _ as Ye, M as A, U as ve, X as P, G as K, H as B, S as Je, L as Xe, Z as X, V as he, y as Ze, Q as et, K as tt, z as st, N as nt, O as it, J as rt, B as lt, x as Ee, w as $, $ as Ie, a0 as Ve, I as ee, Y as te } from "./MtAvatar-03YpvbOy.js";
2
+ import * as Z from "react";
3
+ import v, { createContext as ot, useContext as at, useState as W, useEffect as be } from "react";
4
+ import { flushSync as ct } from "react-dom";
5
+ const ut = [
6
+ ["path", { d: "m12 19-7-7 7-7", key: "1l729n" }],
7
+ ["path", { d: "M19 12H5", key: "x3x0zl" }]
8
+ ], dt = V("arrow-left", ut);
9
+ const ht = [
10
+ [
11
+ "path",
12
+ {
13
+ d: "M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z",
14
+ key: "oz39mx"
15
+ }
16
+ ]
17
+ ], me = V("bookmark", ht);
18
+ const mt = [
19
+ ["path", { d: "M12 20v-9", key: "1qisl0" }],
20
+ ["path", { d: "M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z", key: "uouzyp" }],
21
+ ["path", { d: "M14.12 3.88 16 2", key: "qol33r" }],
22
+ ["path", { d: "M21 21a4 4 0 0 0-3.81-4", key: "1b0z45" }],
23
+ ["path", { d: "M21 5a4 4 0 0 1-3.55 3.97", key: "5cxbf6" }],
24
+ ["path", { d: "M22 13h-4", key: "1jl80f" }],
25
+ ["path", { d: "M3 21a4 4 0 0 1 3.81-4", key: "1fjd4g" }],
26
+ ["path", { d: "M3 5a4 4 0 0 0 3.55 3.97", key: "1d7oge" }],
27
+ ["path", { d: "M6 13H2", key: "82j7cp" }],
28
+ ["path", { d: "m8 2 1.88 1.88", key: "fmnt4t" }],
29
+ ["path", { d: "M9 7.13V6a3 3 0 1 1 6 0v1.13", key: "1vgav8" }]
30
+ ], fe = V("bug", mt);
31
+ const ft = [
32
+ ["path", { d: "M8 2v4", key: "1cmpym" }],
33
+ ["path", { d: "M16 2v4", key: "4m81vk" }],
34
+ ["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
35
+ ["path", { d: "M3 10h18", key: "8toen8" }],
36
+ ["path", { d: "M8 14h.01", key: "6423bh" }],
37
+ ["path", { d: "M12 14h.01", key: "1etili" }],
38
+ ["path", { d: "M16 14h.01", key: "1gbofw" }],
39
+ ["path", { d: "M8 18h.01", key: "lrp35t" }],
40
+ ["path", { d: "M12 18h.01", key: "mhygvu" }],
41
+ ["path", { d: "M16 18h.01", key: "kzsmim" }]
42
+ ], gt = V("calendar-days", ft);
43
+ const pt = [
44
+ ["path", { d: "M21.801 10A10 10 0 1 1 17 3.335", key: "yps3ct" }],
45
+ ["path", { d: "m9 11 3 3L22 4", key: "1pflzl" }]
46
+ ], xt = V("circle-check-big", pt);
47
+ const yt = [["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]], ue = V("circle", yt);
48
+ const vt = [
49
+ ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
50
+ ["path", { d: "M9 3v18", key: "fh3hqa" }],
51
+ ["path", { d: "M15 3v18", key: "14nvp0" }]
52
+ ], se = V("columns-3", vt);
53
+ const bt = [
54
+ ["path", { d: "M12 8v8", key: "napkw2" }],
55
+ [
56
+ "path",
57
+ {
58
+ d: "M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41L13.7 2.71a2.41 2.41 0 0 0-3.41 0z",
59
+ key: "1ey20j"
60
+ }
61
+ ],
62
+ ["path", { d: "M8 12h8", key: "1wcyev" }]
63
+ ], jt = V("diamond-plus", bt);
64
+ const St = [
65
+ [
66
+ "path",
67
+ {
68
+ d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
69
+ key: "1oefj6"
70
+ }
71
+ ],
72
+ ["path", { d: "M14 2v5a1 1 0 0 0 1 1h5", key: "wfsgrz" }],
73
+ ["path", { d: "M10 9H8", key: "b1mrlr" }],
74
+ ["path", { d: "M16 13H8", key: "t4e002" }],
75
+ ["path", { d: "M16 17H8", key: "z1uh3a" }]
76
+ ], ge = V("file-text", St);
77
+ const wt = [
78
+ [
79
+ "path",
80
+ {
81
+ d: "M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",
82
+ key: "zw3jo"
83
+ }
84
+ ],
85
+ [
86
+ "path",
87
+ {
88
+ d: "M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",
89
+ key: "1wduqc"
90
+ }
91
+ ],
92
+ [
93
+ "path",
94
+ {
95
+ d: "M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",
96
+ key: "kqbvx6"
97
+ }
98
+ ]
99
+ ], ne = V("layers", wt);
100
+ const kt = [
101
+ ["rect", { width: "7", height: "7", x: "3", y: "3", rx: "1", key: "1g98yp" }],
102
+ ["rect", { width: "7", height: "7", x: "14", y: "3", rx: "1", key: "6d4xhi" }],
103
+ ["rect", { width: "7", height: "7", x: "14", y: "14", rx: "1", key: "nxv5o0" }],
104
+ ["rect", { width: "7", height: "7", x: "3", y: "14", rx: "1", key: "1bb6yr" }]
105
+ ], Ct = V("layout-grid", kt);
106
+ const Mt = [
107
+ ["path", { d: "M13 5h8", key: "a7qcls" }],
108
+ ["path", { d: "M13 12h8", key: "h98zly" }],
109
+ ["path", { d: "M13 19h8", key: "c3s6r1" }],
110
+ ["path", { d: "m3 17 2 2 4-4", key: "1jhpwq" }],
111
+ ["rect", { x: "3", y: "4", width: "6", height: "6", rx: "1", key: "cif1o7" }]
112
+ ], pe = V("list-todo", Mt);
113
+ const Nt = [
114
+ ["path", { d: "M3 5h.01", key: "18ugdj" }],
115
+ ["path", { d: "M3 12h.01", key: "nlz23k" }],
116
+ ["path", { d: "M3 19h.01", key: "noohij" }],
117
+ ["path", { d: "M8 5h13", key: "1pao27" }],
118
+ ["path", { d: "M8 12h13", key: "1za7za" }],
119
+ ["path", { d: "M8 19h13", key: "m83p4d" }]
120
+ ], Et = V("list", Nt);
121
+ const It = [
122
+ [
123
+ "path",
124
+ {
125
+ d: "m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",
126
+ key: "1miecu"
127
+ }
128
+ ]
129
+ ], Vt = V("paperclip", It);
130
+ const At = [
131
+ [
132
+ "path",
133
+ {
134
+ d: "M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",
135
+ key: "1i5ecw"
136
+ }
137
+ ],
138
+ ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
139
+ ], Dt = V("settings", At);
140
+ const zt = [
141
+ ["circle", { cx: "18", cy: "5", r: "3", key: "gq8acd" }],
142
+ ["circle", { cx: "6", cy: "12", r: "3", key: "w7nqdw" }],
143
+ ["circle", { cx: "18", cy: "19", r: "3", key: "1xt0gg" }],
144
+ ["line", { x1: "8.59", x2: "15.42", y1: "13.51", y2: "17.49", key: "47mynk" }],
145
+ ["line", { x1: "15.41", x2: "8.59", y1: "6.51", y2: "10.49", key: "1n3mei" }]
146
+ ], _t = V("share-2", zt);
147
+ const Ft = [
148
+ [
149
+ "path",
150
+ {
151
+ d: "M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",
152
+ key: "1s2grr"
153
+ }
154
+ ],
155
+ ["path", { d: "M20 2v4", key: "1rf3ol" }],
156
+ ["path", { d: "M22 4h-4", key: "gwowj6" }],
157
+ ["circle", { cx: "4", cy: "20", r: "2", key: "6kqj1y" }]
158
+ ], xe = V("sparkles", Ft);
159
+ const Ot = [
160
+ ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
161
+ ["path", { d: "M8 7v7", key: "1x2jlm" }],
162
+ ["path", { d: "M12 7v4", key: "xawao1" }],
163
+ ["path", { d: "M16 7v9", key: "1hp2iy" }]
164
+ ], Tt = V("square-kanban", Ot);
165
+ const Rt = [
166
+ [
167
+ "path",
168
+ {
169
+ d: "M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",
170
+ key: "r04s7s"
171
+ }
172
+ ]
173
+ ], Lt = V("star", Rt);
174
+ const Pt = [
175
+ [
176
+ "path",
177
+ {
178
+ d: "M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",
179
+ key: "gugj83"
180
+ }
181
+ ]
182
+ ], Bt = V("table-2", Pt);
183
+ const qt = [
184
+ ["path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2", key: "1yyitq" }],
185
+ ["path", { d: "M16 3.128a4 4 0 0 1 0 7.744", key: "16gr8j" }],
186
+ ["path", { d: "M22 21v-2a4 4 0 0 0-3-3.87", key: "kshegd" }],
187
+ ["circle", { cx: "9", cy: "7", r: "4", key: "nufk8" }]
188
+ ], $t = V("users", qt), Ae = ot(null);
189
+ function Q() {
190
+ const e = at(Ae);
191
+ if (!e) throw new Error("useMtCollection must be used inside MtCollection");
192
+ return e;
193
+ }
194
+ function Wt(e) {
195
+ const i = String(e ?? "").toLowerCase();
196
+ return i.includes("list") ? "list" : i.includes("table") ? "table" : i.includes("grid") ? "grid" : i.includes("board") || i.includes("kanban") ? "board" : i.includes("gantt") || i.includes("timeline") ? "calendar" : "circle";
197
+ }
198
+ function Gt(e, i, s = 16) {
199
+ const n = { size: s }, r = e ?? Wt(i);
200
+ return {
201
+ circle: /* @__PURE__ */ t.jsx(ue, { ...n }),
202
+ list: /* @__PURE__ */ t.jsx(Et, { ...n }),
203
+ table: /* @__PURE__ */ t.jsx(Bt, { ...n }),
204
+ grid: /* @__PURE__ */ t.jsx(Ct, { ...n }),
205
+ board: /* @__PURE__ */ t.jsx(Tt, { ...n }),
206
+ columns: /* @__PURE__ */ t.jsx(se, { ...n }),
207
+ calendar: /* @__PURE__ */ t.jsx(gt, { ...n }),
208
+ star: /* @__PURE__ */ t.jsx(Lt, { ...n })
209
+ }[r] ?? /* @__PURE__ */ t.jsx(ue, { ...n });
210
+ }
211
+ function je({
212
+ iconId: e,
213
+ layoutName: i,
214
+ size: s = 16
215
+ }) {
216
+ return /* @__PURE__ */ t.jsx(t.Fragment, { children: Gt(e, i, s) });
217
+ }
218
+ function Ht() {
219
+ const {
220
+ views: e,
221
+ currentView: i,
222
+ setCurrentView: s,
223
+ entries: n,
224
+ addView: r,
225
+ deleteView: l,
226
+ openViewSettings: a,
227
+ hasCurrentViewUnsavedChanges: o,
228
+ saveCurrentViewAsDefault: u,
229
+ revertCurrentViewToDefault: m
230
+ } = Q(), [f, x] = v.useState(!1), [d, y] = v.useState(!1), [C, b] = v.useState(e[0]?.layout?.name ?? ""), N = v.useRef(null), j = v.useRef(e.length + 1), M = v.useMemo(() => {
231
+ const g = /* @__PURE__ */ new Set(), h = [];
232
+ return e.forEach((k) => {
233
+ const I = k.layout?.name ?? "Layout";
234
+ g.has(I) || (g.add(I), h.push({
235
+ id: I,
236
+ name: I,
237
+ templateView: k
238
+ }));
239
+ }), h;
240
+ }, [e]), c = i?.layout.ToolbarActions, S = Q(), w = () => {
241
+ S.setShowViewSettings(!S.showViewSettings);
242
+ }, E = (i?.settings ?? {}).quickFilters ?? {}, z = (g) => {
243
+ if (!g || typeof g != "object")
244
+ return "";
245
+ const h = g.status;
246
+ return typeof h == "string" || typeof h == "number" ? String(h) : "";
247
+ }, q = (g) => {
248
+ if (!g || typeof g != "object")
249
+ return "";
250
+ const h = g.assignee;
251
+ if (typeof h == "string" || typeof h == "number")
252
+ return String(h);
253
+ if (h && typeof h == "object" && "name" in h) {
254
+ const k = h.name;
255
+ if (typeof k == "string")
256
+ return k;
257
+ }
258
+ return "";
259
+ }, F = (g) => {
260
+ i && s({
261
+ ...i,
262
+ settings: {
263
+ ...i.settings ?? {},
264
+ quickFilters: {
265
+ ...E,
266
+ ...g
267
+ }
268
+ }
269
+ });
270
+ }, R = Array.from(new Set(n.map((g) => z(g)).filter(Boolean))).sort(), H = Array.from(new Set(n.map((g) => q(g)).filter(Boolean))).sort(), _ = (E.status?.length ?? 0) > 0, J = (E.assignee?.length ?? 0) > 0;
271
+ v.useEffect(() => {
272
+ (!C || !M.some((g) => g.id === C)) && b(M[0]?.id ?? "");
273
+ }, [C, M]);
274
+ const oe = (g) => {
275
+ const k = M.find((ce) => ce.id === g)?.templateView ?? i ?? e[0];
276
+ if (!k)
277
+ return;
278
+ const I = k.layout?.name ?? "View", O = e.filter((ce) => ce.name.startsWith(I)).length, Qe = O > 0 ? `${I} ${O + 1}` : I;
279
+ r({
280
+ id: `view-${j.current++}`,
281
+ name: Qe,
282
+ icon: k.icon,
283
+ layout: k.layout,
284
+ groupBy: null,
285
+ settings: {},
286
+ renderEntry: k.renderEntry
287
+ }), y(!1);
288
+ };
289
+ v.useEffect(() => {
290
+ f && N.current?.focus();
291
+ }, [f]);
292
+ const ae = (g) => {
293
+ const h = e.find((O) => O.id === g);
294
+ if (!h)
295
+ return;
296
+ const k = e.filter((O) => O.name.startsWith(h.name)).length, I = k > 0 ? `${h.name} ${k + 1}` : `${h.name} copy`;
297
+ r({
298
+ ...h,
299
+ id: `view-${j.current++}`,
300
+ name: I
301
+ });
302
+ };
303
+ return /* @__PURE__ */ t.jsxs("div", { className: "flex items-center border-b border-[#2A2A2A] h-11 px-4", children: [
304
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-1.5", children: [
305
+ e.length > 1 && e.map((g) => /* @__PURE__ */ t.jsx(
306
+ Ye,
307
+ {
308
+ getContextMenuItems: () => [
309
+ {
310
+ label: "Rename",
311
+ onSelect: () => {
312
+ s(g), a("root", { focusViewNameEditor: !0 });
313
+ }
314
+ },
315
+ {
316
+ label: "Edit view",
317
+ onSelect: () => {
318
+ s(g), a("root");
319
+ }
320
+ },
321
+ { label: "", separator: !0 },
322
+ {
323
+ label: "Delete view",
324
+ disabled: e.length <= 1,
325
+ onSelect: () => {
326
+ l(g.id);
327
+ }
328
+ },
329
+ {
330
+ label: "Duplicate view",
331
+ onSelect: () => ae(g.id)
332
+ },
333
+ {
334
+ label: "Copy link to view",
335
+ disabled: !0
336
+ }
337
+ ],
338
+ children: ({ openMenu: h }) => /* @__PURE__ */ t.jsxs(
339
+ A,
340
+ {
341
+ variant: "ghost",
342
+ selected: g.id === i?.id,
343
+ className: "h-auto min-h-0 items-center gap-2 border border-transparent px-2 py-1 text-sm text-text-muted hover:text-text-primary data-[selected]:border-[#8D8D8D] data-[selected]:text-text-primary",
344
+ onClick: (k) => {
345
+ if (g.id === i?.id) {
346
+ h(k);
347
+ return;
348
+ }
349
+ s(g);
350
+ },
351
+ onContextMenu: (k) => {
352
+ s(g), h(k);
353
+ },
354
+ children: [
355
+ /* @__PURE__ */ t.jsx(je, { iconId: g.icon, layoutName: g.layout?.name }),
356
+ /* @__PURE__ */ t.jsx("span", { children: g.name })
357
+ ]
358
+ }
359
+ )
360
+ },
361
+ g.id
362
+ )),
363
+ /* @__PURE__ */ t.jsx("div", { className: "border-r border-[#2A2A2A] h-6" }),
364
+ /* @__PURE__ */ t.jsx(
365
+ ve,
366
+ {
367
+ open: d,
368
+ onOpenChange: y,
369
+ content: /* @__PURE__ */ t.jsxs("div", { className: "w-80 flex flex-col gap-2", children: [
370
+ /* @__PURE__ */ t.jsx("div", { className: "text-sm text-text-primary", children: "Add view" }),
371
+ /* @__PURE__ */ t.jsx("div", { className: "flex flex-col gap-2", children: M.map((g) => /* @__PURE__ */ t.jsx(
372
+ A,
373
+ {
374
+ variant: "ghost",
375
+ selected: C === g.id,
376
+ onClick: () => {
377
+ b(g.id), oe(g.id);
378
+ },
379
+ className: "h-auto min-h-0 w-full justify-start rounded border border-[#2A2A2A] px-2 py-2 text-left transition-colors data-[selected]:border-[#8D8D8D] data-[selected]:bg-surface-popover hover:bg-surface-popover",
380
+ children: /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-3", children: [
381
+ /* @__PURE__ */ t.jsx("div", { className: "w-9 h-9 rounded border border-[#2A2A2A] bg-[#1A1A1A] flex items-center justify-center text-xs text-text-primary", children: g.templateView.icon ? /* @__PURE__ */ t.jsx(
382
+ je,
383
+ {
384
+ iconId: g.templateView.icon,
385
+ layoutName: g.templateView.layout?.name
386
+ }
387
+ ) : /* @__PURE__ */ t.jsx(ue, { size: 16 }) }),
388
+ /* @__PURE__ */ t.jsxs("div", { className: "min-w-0", children: [
389
+ /* @__PURE__ */ t.jsx("div", { className: "text-sm text-text-primary truncate", children: g.name }),
390
+ /* @__PURE__ */ t.jsx("div", { className: "text-xs text-text-muted truncate", children: "Create from layout" })
391
+ ] })
392
+ ] })
393
+ },
394
+ g.id
395
+ )) })
396
+ ] }),
397
+ children: /* @__PURE__ */ t.jsx(ve.Trigger, { children: /* @__PURE__ */ t.jsx(A, { kind: "icon", variant: "ghost", children: /* @__PURE__ */ t.jsx(jt, { size: 16, stroke: "#8D8D8D" }) }) })
398
+ }
399
+ )
400
+ ] }),
401
+ /* @__PURE__ */ t.jsx("div", { className: "flex-1" }),
402
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-1.5", children: [
403
+ o ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
404
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-1", children: [
405
+ /* @__PURE__ */ t.jsx(A, { variant: "accent", onClick: u, children: "Save view" }),
406
+ /* @__PURE__ */ t.jsx(A, { kind: "icon", variant: "ghost", onClick: m, children: /* @__PURE__ */ t.jsx(P, { size: 14, stroke: "#8D8D8D" }) })
407
+ ] }),
408
+ /* @__PURE__ */ t.jsx("div", { className: "border-r border-[#2A2A2A] h-6" })
409
+ ] }) : null,
410
+ c ? /* @__PURE__ */ t.jsx(c, {}) : null,
411
+ /* @__PURE__ */ t.jsx("div", { className: "border-r border-[#2A2A2A] h-6" }),
412
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-1", children: [
413
+ /* @__PURE__ */ t.jsx(
414
+ K,
415
+ {
416
+ title: /* @__PURE__ */ t.jsx(xt, { size: 16, stroke: "#8D8D8D" }),
417
+ kind: "icon",
418
+ variant: _ ? "accent" : "ghost",
419
+ showCaret: !1,
420
+ children: /* @__PURE__ */ t.jsxs("div", { className: "w-44 p-1", children: [
421
+ /* @__PURE__ */ t.jsx(B, { onSelect: () => F({ status: [] }), children: "All statuses" }),
422
+ R.map((g) => /* @__PURE__ */ t.jsx(
423
+ B,
424
+ {
425
+ onSelect: () => {
426
+ const h = E.status ?? [], k = h.includes(g) ? h.filter((I) => I !== g) : [...h, g];
427
+ F({ status: k });
428
+ },
429
+ children: g
430
+ },
431
+ g
432
+ ))
433
+ ] })
434
+ }
435
+ ),
436
+ _ ? /* @__PURE__ */ t.jsx(A, { kind: "icon", variant: "ghost", onClick: () => F({ status: [] }), children: /* @__PURE__ */ t.jsx(P, { size: 14, stroke: "#8D8D8D" }) }) : null
437
+ ] }),
438
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-1", children: [
439
+ /* @__PURE__ */ t.jsx(
440
+ K,
441
+ {
442
+ title: /* @__PURE__ */ t.jsx($t, { size: 16, stroke: "#8D8D8D" }),
443
+ kind: "icon",
444
+ variant: J ? "accent" : "ghost",
445
+ showCaret: !1,
446
+ children: /* @__PURE__ */ t.jsxs("div", { className: "w-44 p-1", children: [
447
+ /* @__PURE__ */ t.jsx(B, { onSelect: () => F({ assignee: [] }), children: "All assignees" }),
448
+ H.map((g) => /* @__PURE__ */ t.jsx(
449
+ B,
450
+ {
451
+ onSelect: () => {
452
+ const h = E.assignee ?? [], k = h.includes(g) ? h.filter((I) => I !== g) : [...h, g];
453
+ F({ assignee: k });
454
+ },
455
+ children: g
456
+ },
457
+ g
458
+ ))
459
+ ] })
460
+ }
461
+ ),
462
+ J ? /* @__PURE__ */ t.jsx(A, { kind: "icon", variant: "ghost", onClick: () => F({ assignee: [] }), children: /* @__PURE__ */ t.jsx(P, { size: 14, stroke: "#8D8D8D" }) }) : null
463
+ ] }),
464
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-1", children: [
465
+ /* @__PURE__ */ t.jsx(A, { kind: "icon", variant: "ghost", onClick: () => x((g) => !g), children: /* @__PURE__ */ t.jsx(Je, { size: 16, stroke: "#8D8D8D" }) }),
466
+ f ? /* @__PURE__ */ t.jsx(
467
+ "input",
468
+ {
469
+ ref: N,
470
+ value: E.search ?? "",
471
+ onChange: (g) => F({ search: g.target.value }),
472
+ onKeyDown: (g) => {
473
+ g.key === "Escape" && x(!1);
474
+ },
475
+ placeholder: "Search entries...",
476
+ className: "w-56 rounded border border-[#2A2A2A] bg-transparent px-2 py-1 text-sm outline-none transition-all"
477
+ }
478
+ ) : null
479
+ ] }),
480
+ /* @__PURE__ */ t.jsx("div", { className: "border-r border-[#2A2A2A] h-6" }),
481
+ /* @__PURE__ */ t.jsx(A, { kind: "icon", variant: "ghost", onClick: w, children: /* @__PURE__ */ t.jsx(Dt, { size: 16, stroke: "#8D8D8D" }) }),
482
+ /* @__PURE__ */ t.jsx(A, { onClick: () => {
483
+ }, variant: "accent", children: "+ Add" })
484
+ ] })
485
+ ] });
486
+ }
487
+ function Ut({ value: e, cases: i }) {
488
+ return /* @__PURE__ */ t.jsx(t.Fragment, { children: i[e] ?? null });
489
+ }
490
+ const De = v.createContext(null);
491
+ function ze(e) {
492
+ if (!v.isValidElement(e))
493
+ return !1;
494
+ const i = e.props;
495
+ return typeof i.id == "string" && typeof i.title == "string";
496
+ }
497
+ function L({ children: e }) {
498
+ return /* @__PURE__ */ t.jsx(t.Fragment, { children: e });
499
+ }
500
+ function Kt(e) {
501
+ const i = {};
502
+ return v.Children.forEach(e, (s) => {
503
+ if (!ze(s)) return;
504
+ const n = s.props;
505
+ i[n.id] = s;
506
+ }), i;
507
+ }
508
+ function _e({ children: e, initialPageId: i = "root", onClose: s }) {
509
+ const n = v.useMemo(() => Kt(e), [e]), [r, l] = v.useState([i]);
510
+ v.useEffect(() => {
511
+ l([i]);
512
+ }, [i]);
513
+ const a = r[r.length - 1] ?? i, o = n[a], u = o?.props?.title ?? "View Settings", m = v.useCallback(
514
+ (d) => {
515
+ n[d] && l((y) => [...y, d]);
516
+ },
517
+ [n]
518
+ ), f = v.useCallback(() => {
519
+ l((d) => d.length > 1 ? d.slice(0, -1) : d);
520
+ }, []), x = r.length > 1;
521
+ return /* @__PURE__ */ t.jsx(De.Provider, { value: { openPage: m, goBack: f }, children: /* @__PURE__ */ t.jsxs(X, { children: [
522
+ /* @__PURE__ */ t.jsxs(
523
+ X,
524
+ {
525
+ row: !0,
526
+ justify: "between",
527
+ className: `p-2 pr-3 gap-2 border-b text-text-primary border-[#2A2A2A] ${x ? "" : "pl-3"}`,
528
+ children: [
529
+ /* @__PURE__ */ t.jsxs(X, { row: !0, className: "text-text-primary", gap: 2, children: [
530
+ x ? /* @__PURE__ */ t.jsx(A, { kind: "icon", variant: "ghost", onClick: f, children: /* @__PURE__ */ t.jsx(dt, { size: 16, stroke: "#8D8D8D" }) }) : null,
531
+ /* @__PURE__ */ t.jsx("span", { className: "text-sm text-text-primary", children: u })
532
+ ] }),
533
+ /* @__PURE__ */ t.jsx(A, { kind: "icon", variant: "ghost", onClick: s, children: /* @__PURE__ */ t.jsx(P, { size: 16, stroke: "#8D8D8D" }) })
534
+ ]
535
+ }
536
+ ),
537
+ /* @__PURE__ */ t.jsx(Ut, { value: a, cases: { [a]: o } })
538
+ ] }) });
539
+ }
540
+ function T({ title: e, children: i }) {
541
+ return /* @__PURE__ */ t.jsxs(X, { gap: 1, className: "py-2 border-b border-border-default", children: [
542
+ e && /* @__PURE__ */ t.jsx("small", { className: "px-2", children: e }),
543
+ i
544
+ ] });
545
+ }
546
+ function D({
547
+ icon: e,
548
+ label: i,
549
+ trailing: s,
550
+ onClick: n,
551
+ disabled: r,
552
+ active: l,
553
+ submenu: a
554
+ }) {
555
+ const o = v.useContext(De);
556
+ return /* @__PURE__ */ t.jsxs(
557
+ A,
558
+ {
559
+ variant: "ghost",
560
+ className: "flex row items-center justify-between w-full",
561
+ onClick: () => {
562
+ n?.(), a && o?.openPage(a);
563
+ },
564
+ disabled: r,
565
+ selected: l,
566
+ children: [
567
+ /* @__PURE__ */ t.jsxs("div", { className: "flex flex-row items-center gap-3", children: [
568
+ e,
569
+ i
570
+ ] }),
571
+ s ? /* @__PURE__ */ t.jsx("div", { className: "flex flex-row items-center gap-3 text-text-muted", children: s }) : null
572
+ ]
573
+ }
574
+ );
575
+ }
576
+ function Qt() {
577
+ const e = Q(), i = e?.properties ?? [], s = e?.currentView ?? null, n = v.useRef(null), r = i.map((d) => d.id), l = s?.settings?.visiblePropertyIds ?? r, a = s?.layout.SettingsMenu;
578
+ v.useEffect(() => {
579
+ e?.focusViewNameEditor && (n.current?.focus(), n.current?.select());
580
+ }, [e?.focusViewNameEditor]);
581
+ const o = (d) => {
582
+ !e || !s || e.setCurrentView({
583
+ ...s,
584
+ settings: {
585
+ ...s.settings ?? {},
586
+ ...d
587
+ }
588
+ });
589
+ }, u = s && e && a ? a({
590
+ currentView: s,
591
+ properties: i,
592
+ viewSettings: {
593
+ ...s.settings ?? {},
594
+ visiblePropertyIds: l
595
+ },
596
+ setViewSettings: (d) => o(d),
597
+ setCurrentView: e.setCurrentView
598
+ }) : null, m = [], f = [], x = (d) => {
599
+ v.Children.forEach(d, (y) => {
600
+ if (ze(y)) {
601
+ f.push(y);
602
+ return;
603
+ }
604
+ if (v.isValidElement(y)) {
605
+ if (y.type === v.Fragment) {
606
+ x(y.props.children);
607
+ return;
608
+ }
609
+ m.push(y);
610
+ }
611
+ });
612
+ };
613
+ return u && x(u), /* @__PURE__ */ t.jsxs(
614
+ _e,
615
+ {
616
+ initialPageId: e?.viewSettingsPageId ?? "root",
617
+ onClose: () => {
618
+ e?.setShowViewSettings(!1), e?.setViewSettingsPageId("root"), e?.setFocusViewNameEditor(!1);
619
+ },
620
+ children: [
621
+ /* @__PURE__ */ t.jsxs(L, { id: "root", title: "View Settings", children: [
622
+ /* @__PURE__ */ t.jsx(T, { title: "View", children: /* @__PURE__ */ t.jsx("div", { className: "px-2", children: /* @__PURE__ */ t.jsx(
623
+ Xe,
624
+ {
625
+ ref: n,
626
+ value: s?.name ?? "",
627
+ onChange: (d) => {
628
+ !e || !s || e.setCurrentView({
629
+ ...s,
630
+ name: d.target.value
631
+ });
632
+ },
633
+ placeholder: "View name",
634
+ className: "w-full px-2!",
635
+ variant: "ghost"
636
+ }
637
+ ) }) }),
638
+ m,
639
+ /* @__PURE__ */ t.jsxs(T, { children: [
640
+ /* @__PURE__ */ t.jsx(D, { icon: /* @__PURE__ */ t.jsx(Vt, { size: 14 }), label: "Copy link to view", disabled: !0 }),
641
+ /* @__PURE__ */ t.jsx(D, { icon: /* @__PURE__ */ t.jsx(_t, { size: 14 }), label: "Shareing & Permissions", disabled: !0 })
642
+ ] })
643
+ ] }),
644
+ f
645
+ ]
646
+ }
647
+ );
648
+ }
649
+ _e.Page = L;
650
+ function U(e) {
651
+ return {
652
+ name: e.name,
653
+ icon: e.icon,
654
+ groupBy: e.groupBy ?? null,
655
+ settings: e.settings
656
+ };
657
+ }
658
+ function Yt(e, i) {
659
+ return !e || !i ? !1 : e.name === i.name && e.icon === i.icon && (e.groupBy ?? null) === (i.groupBy ?? null) && JSON.stringify(e.settings ?? {}) === JSON.stringify(i.settings ?? {});
660
+ }
661
+ function Ts({
662
+ entries: e,
663
+ views: i,
664
+ properties: s = [{ id: "id", label: "ID" }],
665
+ toolbar: n,
666
+ renderEntry: r,
667
+ showViewSettings: l = !1,
668
+ viewSettings: a = /* @__PURE__ */ t.jsx(Qt, {}),
669
+ className: o
670
+ }) {
671
+ const [u, m] = W(i), [f, x] = W(s), [d, y] = W(l), [C, b] = W("root"), [N, j] = W(!1), [M, c] = W(i[0]?.id ?? null), [S, w] = W(
672
+ Object.fromEntries(i.map((h) => [h.id, U(h)]))
673
+ );
674
+ be(() => {
675
+ m(i), w(Object.fromEntries(i.map((h) => [h.id, U(h)]))), c(
676
+ (h) => i.some((k) => k.id === h) ? h : i[0]?.id ?? null
677
+ );
678
+ }, [i]), be(() => {
679
+ x(s);
680
+ }, [s]);
681
+ const p = u.find((h) => h.id === M) ?? null, E = (h) => {
682
+ if (!h) {
683
+ c(null);
684
+ return;
685
+ }
686
+ m(
687
+ (k) => k.map(
688
+ (I) => I.id === h.id ? {
689
+ ...I,
690
+ ...h
691
+ } : I
692
+ )
693
+ ), c(h.id);
694
+ }, z = (h) => {
695
+ m((k) => [...k, h]), w((k) => ({
696
+ ...k,
697
+ [h.id]: U(h)
698
+ })), c(h.id);
699
+ }, q = (h, k) => {
700
+ m(
701
+ (I) => I.map(
702
+ (O) => O.id === h ? {
703
+ ...O,
704
+ ...k
705
+ } : O
706
+ )
707
+ );
708
+ }, F = (h) => {
709
+ m((k) => {
710
+ const I = k.filter((O) => O.id !== h);
711
+ return I.length === 0 ? (c(null), k) : (M === h && c(I[0]?.id ?? null), I);
712
+ }), w((k) => {
713
+ const I = { ...k };
714
+ return delete I[h], I;
715
+ });
716
+ }, R = (() => {
717
+ if (!p)
718
+ return !1;
719
+ const h = U(p), k = S[p.id];
720
+ return k ? !Yt(h, k) : !1;
721
+ })(), H = () => {
722
+ p && w((h) => ({
723
+ ...h,
724
+ [p.id]: U(p)
725
+ }));
726
+ }, _ = () => {
727
+ if (!p)
728
+ return;
729
+ const h = S[p.id];
730
+ h && q(p.id, {
731
+ name: h.name,
732
+ icon: h.icon,
733
+ groupBy: h.groupBy,
734
+ settings: h.settings
735
+ });
736
+ }, J = (h = "root", k) => {
737
+ b(h), j(!!k?.focusViewNameEditor), y(!0);
738
+ }, oe = () => s.map((h) => h.id), ae = {
739
+ visiblePropertyIds: p?.settings?.visiblePropertyIds ?? oe(),
740
+ ...p?.settings ?? {}
741
+ }, g = !!(d && p && a);
742
+ return /* @__PURE__ */ t.jsx(
743
+ Ae.Provider,
744
+ {
745
+ value: {
746
+ entries: e,
747
+ views: u,
748
+ currentView: p,
749
+ setCurrentView: E,
750
+ addView: z,
751
+ updateView: q,
752
+ deleteView: F,
753
+ hasCurrentViewUnsavedChanges: R,
754
+ saveCurrentViewAsDefault: H,
755
+ revertCurrentViewToDefault: _,
756
+ showViewSettings: d,
757
+ setShowViewSettings: y,
758
+ viewSettingsPageId: C,
759
+ setViewSettingsPageId: b,
760
+ focusViewNameEditor: N,
761
+ setFocusViewNameEditor: j,
762
+ openViewSettings: J,
763
+ properties: f,
764
+ setProperties: x
765
+ },
766
+ children: /* @__PURE__ */ t.jsxs("div", { className: `h-full min-h-0 flex flex-col border border-[#2A2A2A] bg-[#111111] rounded ${o}`, children: [
767
+ n === void 0 && /* @__PURE__ */ t.jsx(Ht, {}),
768
+ n != null && v.isValidElement(n) && v.cloneElement(n),
769
+ /* @__PURE__ */ t.jsxs("div", { className: "flex-1 min-h-0 flex flex-row overflow-hidden", children: [
770
+ /* @__PURE__ */ t.jsx("div", { className: "flex-1 min-w-0 min-h-0", children: p ? /* @__PURE__ */ t.jsx(
771
+ p.layout,
772
+ {
773
+ entries: e,
774
+ groupBy: p.groupBy,
775
+ properties: f,
776
+ viewSettings: ae,
777
+ renderEntry: p.renderEntry ?? r
778
+ }
779
+ ) : /* @__PURE__ */ t.jsx("div", { children: "No view selected" }) }),
780
+ /* @__PURE__ */ t.jsx(
781
+ "div",
782
+ {
783
+ className: `shrink-0 overflow-hidden transition-[width,opacity,transform] duration-200 ease-out ${g ? "border-l border-[#2A2A2A] opacity-100 translate-x-0" : "border-l-0 opacity-0 translate-x-1"}`,
784
+ style: { width: g ? "18.75rem" : "0rem" },
785
+ children: g ? a : null
786
+ }
787
+ )
788
+ ] })
789
+ ] })
790
+ }
791
+ );
792
+ }
793
+ function G(e, i, s) {
794
+ let n = s.initialDeps ?? [], r, l = !0;
795
+ function a() {
796
+ var o, u, m;
797
+ let f;
798
+ s.key && ((o = s.debug) != null && o.call(s)) && (f = Date.now());
799
+ const x = e();
800
+ if (!(x.length !== n.length || x.some((C, b) => n[b] !== C)))
801
+ return r;
802
+ n = x;
803
+ let y;
804
+ if (s.key && ((u = s.debug) != null && u.call(s)) && (y = Date.now()), r = i(...x), s.key && ((m = s.debug) != null && m.call(s))) {
805
+ const C = Math.round((Date.now() - f) * 100) / 100, b = Math.round((Date.now() - y) * 100) / 100, N = b / 16, j = (M, c) => {
806
+ for (M = String(M); M.length < c; )
807
+ M = " " + M;
808
+ return M;
809
+ };
810
+ console.info(
811
+ `%c⏱ ${j(b, 5)} /${j(C, 5)} ms`,
812
+ `
813
+ font-size: .6rem;
814
+ font-weight: bold;
815
+ color: hsl(${Math.max(
816
+ 0,
817
+ Math.min(120 - 120 * N, 120)
818
+ )}deg 100% 31%);`,
819
+ s?.key
820
+ );
821
+ }
822
+ return s?.onChange && !(l && s.skipInitialOnChange) && s.onChange(r), l = !1, r;
823
+ }
824
+ return a.updateDeps = (o) => {
825
+ n = o;
826
+ }, a;
827
+ }
828
+ function Se(e, i) {
829
+ if (e === void 0)
830
+ throw new Error("Unexpected undefined");
831
+ return e;
832
+ }
833
+ const Jt = (e, i) => Math.abs(e - i) < 1.01, Xt = (e, i, s) => {
834
+ let n;
835
+ return function(...r) {
836
+ e.clearTimeout(n), n = e.setTimeout(() => i.apply(this, r), s);
837
+ };
838
+ }, we = (e) => {
839
+ const { offsetWidth: i, offsetHeight: s } = e;
840
+ return { width: i, height: s };
841
+ }, Zt = (e) => e, es = (e) => {
842
+ const i = Math.max(e.startIndex - e.overscan, 0), s = Math.min(e.endIndex + e.overscan, e.count - 1), n = [];
843
+ for (let r = i; r <= s; r++)
844
+ n.push(r);
845
+ return n;
846
+ }, ts = (e, i) => {
847
+ const s = e.scrollElement;
848
+ if (!s)
849
+ return;
850
+ const n = e.targetWindow;
851
+ if (!n)
852
+ return;
853
+ const r = (a) => {
854
+ const { width: o, height: u } = a;
855
+ i({ width: Math.round(o), height: Math.round(u) });
856
+ };
857
+ if (r(we(s)), !n.ResizeObserver)
858
+ return () => {
859
+ };
860
+ const l = new n.ResizeObserver((a) => {
861
+ const o = () => {
862
+ const u = a[0];
863
+ if (u?.borderBoxSize) {
864
+ const m = u.borderBoxSize[0];
865
+ if (m) {
866
+ r({ width: m.inlineSize, height: m.blockSize });
867
+ return;
868
+ }
869
+ }
870
+ r(we(s));
871
+ };
872
+ e.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(o) : o();
873
+ });
874
+ return l.observe(s, { box: "border-box" }), () => {
875
+ l.unobserve(s);
876
+ };
877
+ }, ke = {
878
+ passive: !0
879
+ }, Ce = typeof window > "u" ? !0 : "onscrollend" in window, ss = (e, i) => {
880
+ const s = e.scrollElement;
881
+ if (!s)
882
+ return;
883
+ const n = e.targetWindow;
884
+ if (!n)
885
+ return;
886
+ let r = 0;
887
+ const l = e.options.useScrollendEvent && Ce ? () => {
888
+ } : Xt(
889
+ n,
890
+ () => {
891
+ i(r, !1);
892
+ },
893
+ e.options.isScrollingResetDelay
894
+ ), a = (f) => () => {
895
+ const { horizontal: x, isRtl: d } = e.options;
896
+ r = x ? s.scrollLeft * (d && -1 || 1) : s.scrollTop, l(), i(r, f);
897
+ }, o = a(!0), u = a(!1);
898
+ s.addEventListener("scroll", o, ke);
899
+ const m = e.options.useScrollendEvent && Ce;
900
+ return m && s.addEventListener("scrollend", u, ke), () => {
901
+ s.removeEventListener("scroll", o), m && s.removeEventListener("scrollend", u);
902
+ };
903
+ }, ns = (e, i, s) => {
904
+ if (i?.borderBoxSize) {
905
+ const n = i.borderBoxSize[0];
906
+ if (n)
907
+ return Math.round(
908
+ n[s.options.horizontal ? "inlineSize" : "blockSize"]
909
+ );
910
+ }
911
+ return e[s.options.horizontal ? "offsetWidth" : "offsetHeight"];
912
+ }, is = (e, {
913
+ adjustments: i = 0,
914
+ behavior: s
915
+ }, n) => {
916
+ var r, l;
917
+ const a = e + i;
918
+ (l = (r = n.scrollElement) == null ? void 0 : r.scrollTo) == null || l.call(r, {
919
+ [n.options.horizontal ? "left" : "top"]: a,
920
+ behavior: s
921
+ });
922
+ };
923
+ class rs {
924
+ constructor(i) {
925
+ this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.isScrolling = !1, this.scrollState = null, this.measurementsCache = [], this.itemSizeCache = /* @__PURE__ */ new Map(), this.laneAssignments = /* @__PURE__ */ new Map(), this.pendingMeasuredCacheIndexes = [], this.prevLanes = void 0, this.lanesChangedFlag = !1, this.lanesSettling = !1, this.scrollRect = null, this.scrollOffset = null, this.scrollDirection = null, this.scrollAdjustments = 0, this.elementsCache = /* @__PURE__ */ new Map(), this.now = () => {
926
+ var s, n, r;
927
+ return ((r = (n = (s = this.targetWindow) == null ? void 0 : s.performance) == null ? void 0 : n.now) == null ? void 0 : r.call(n)) ?? Date.now();
928
+ }, this.observer = /* @__PURE__ */ (() => {
929
+ let s = null;
930
+ const n = () => s || (!this.targetWindow || !this.targetWindow.ResizeObserver ? null : s = new this.targetWindow.ResizeObserver((r) => {
931
+ r.forEach((l) => {
932
+ const a = () => {
933
+ this._measureElement(l.target, l);
934
+ };
935
+ this.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(a) : a();
936
+ });
937
+ }));
938
+ return {
939
+ disconnect: () => {
940
+ var r;
941
+ (r = n()) == null || r.disconnect(), s = null;
942
+ },
943
+ observe: (r) => {
944
+ var l;
945
+ return (l = n()) == null ? void 0 : l.observe(r, { box: "border-box" });
946
+ },
947
+ unobserve: (r) => {
948
+ var l;
949
+ return (l = n()) == null ? void 0 : l.unobserve(r);
950
+ }
951
+ };
952
+ })(), this.range = null, this.setOptions = (s) => {
953
+ Object.entries(s).forEach(([n, r]) => {
954
+ typeof r > "u" && delete s[n];
955
+ }), this.options = {
956
+ debug: !1,
957
+ initialOffset: 0,
958
+ overscan: 1,
959
+ paddingStart: 0,
960
+ paddingEnd: 0,
961
+ scrollPaddingStart: 0,
962
+ scrollPaddingEnd: 0,
963
+ horizontal: !1,
964
+ getItemKey: Zt,
965
+ rangeExtractor: es,
966
+ onChange: () => {
967
+ },
968
+ measureElement: ns,
969
+ initialRect: { width: 0, height: 0 },
970
+ scrollMargin: 0,
971
+ gap: 0,
972
+ indexAttribute: "data-index",
973
+ initialMeasurementsCache: [],
974
+ lanes: 1,
975
+ isScrollingResetDelay: 150,
976
+ enabled: !0,
977
+ isRtl: !1,
978
+ useScrollendEvent: !1,
979
+ useAnimationFrameWithResizeObserver: !1,
980
+ ...s
981
+ };
982
+ }, this.notify = (s) => {
983
+ var n, r;
984
+ (r = (n = this.options).onChange) == null || r.call(n, this, s);
985
+ }, this.maybeNotify = G(
986
+ () => (this.calculateRange(), [
987
+ this.isScrolling,
988
+ this.range ? this.range.startIndex : null,
989
+ this.range ? this.range.endIndex : null
990
+ ]),
991
+ (s) => {
992
+ this.notify(s);
993
+ },
994
+ {
995
+ key: process.env.NODE_ENV !== "production" && "maybeNotify",
996
+ debug: () => this.options.debug,
997
+ initialDeps: [
998
+ this.isScrolling,
999
+ this.range ? this.range.startIndex : null,
1000
+ this.range ? this.range.endIndex : null
1001
+ ]
1002
+ }
1003
+ ), this.cleanup = () => {
1004
+ this.unsubs.filter(Boolean).forEach((s) => s()), this.unsubs = [], this.observer.disconnect(), this.rafId != null && this.targetWindow && (this.targetWindow.cancelAnimationFrame(this.rafId), this.rafId = null), this.scrollState = null, this.scrollElement = null, this.targetWindow = null;
1005
+ }, this._didMount = () => () => {
1006
+ this.cleanup();
1007
+ }, this._willUpdate = () => {
1008
+ var s;
1009
+ const n = this.options.enabled ? this.options.getScrollElement() : null;
1010
+ if (this.scrollElement !== n) {
1011
+ if (this.cleanup(), !n) {
1012
+ this.maybeNotify();
1013
+ return;
1014
+ }
1015
+ this.scrollElement = n, this.scrollElement && "ownerDocument" in this.scrollElement ? this.targetWindow = this.scrollElement.ownerDocument.defaultView : this.targetWindow = ((s = this.scrollElement) == null ? void 0 : s.window) ?? null, this.elementsCache.forEach((r) => {
1016
+ this.observer.observe(r);
1017
+ }), this.unsubs.push(
1018
+ this.options.observeElementRect(this, (r) => {
1019
+ this.scrollRect = r, this.maybeNotify();
1020
+ })
1021
+ ), this.unsubs.push(
1022
+ this.options.observeElementOffset(this, (r, l) => {
1023
+ this.scrollAdjustments = 0, this.scrollDirection = l ? this.getScrollOffset() < r ? "forward" : "backward" : null, this.scrollOffset = r, this.isScrolling = l, this.scrollState && this.scheduleScrollReconcile(), this.maybeNotify();
1024
+ })
1025
+ ), this._scrollToOffset(this.getScrollOffset(), {
1026
+ adjustments: void 0,
1027
+ behavior: void 0
1028
+ });
1029
+ }
1030
+ }, this.rafId = null, this.getSize = () => this.options.enabled ? (this.scrollRect = this.scrollRect ?? this.options.initialRect, this.scrollRect[this.options.horizontal ? "width" : "height"]) : (this.scrollRect = null, 0), this.getScrollOffset = () => this.options.enabled ? (this.scrollOffset = this.scrollOffset ?? (typeof this.options.initialOffset == "function" ? this.options.initialOffset() : this.options.initialOffset), this.scrollOffset) : (this.scrollOffset = null, 0), this.getFurthestMeasurement = (s, n) => {
1031
+ const r = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map();
1032
+ for (let a = n - 1; a >= 0; a--) {
1033
+ const o = s[a];
1034
+ if (r.has(o.lane))
1035
+ continue;
1036
+ const u = l.get(
1037
+ o.lane
1038
+ );
1039
+ if (u == null || o.end > u.end ? l.set(o.lane, o) : o.end < u.end && r.set(o.lane, !0), r.size === this.options.lanes)
1040
+ break;
1041
+ }
1042
+ return l.size === this.options.lanes ? Array.from(l.values()).sort((a, o) => a.end === o.end ? a.index - o.index : a.end - o.end)[0] : void 0;
1043
+ }, this.getMeasurementOptions = G(
1044
+ () => [
1045
+ this.options.count,
1046
+ this.options.paddingStart,
1047
+ this.options.scrollMargin,
1048
+ this.options.getItemKey,
1049
+ this.options.enabled,
1050
+ this.options.lanes
1051
+ ],
1052
+ (s, n, r, l, a, o) => (this.prevLanes !== void 0 && this.prevLanes !== o && (this.lanesChangedFlag = !0), this.prevLanes = o, this.pendingMeasuredCacheIndexes = [], {
1053
+ count: s,
1054
+ paddingStart: n,
1055
+ scrollMargin: r,
1056
+ getItemKey: l,
1057
+ enabled: a,
1058
+ lanes: o
1059
+ }),
1060
+ {
1061
+ key: !1
1062
+ }
1063
+ ), this.getMeasurements = G(
1064
+ () => [this.getMeasurementOptions(), this.itemSizeCache],
1065
+ ({ count: s, paddingStart: n, scrollMargin: r, getItemKey: l, enabled: a, lanes: o }, u) => {
1066
+ if (!a)
1067
+ return this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), [];
1068
+ if (this.laneAssignments.size > s)
1069
+ for (const d of this.laneAssignments.keys())
1070
+ d >= s && this.laneAssignments.delete(d);
1071
+ this.lanesChangedFlag && (this.lanesChangedFlag = !1, this.lanesSettling = !0, this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), this.pendingMeasuredCacheIndexes = []), this.measurementsCache.length === 0 && !this.lanesSettling && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((d) => {
1072
+ this.itemSizeCache.set(d.key, d.size);
1073
+ }));
1074
+ const m = this.lanesSettling ? 0 : this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
1075
+ this.pendingMeasuredCacheIndexes = [], this.lanesSettling && this.measurementsCache.length === s && (this.lanesSettling = !1);
1076
+ const f = this.measurementsCache.slice(0, m), x = new Array(o).fill(
1077
+ void 0
1078
+ );
1079
+ for (let d = 0; d < m; d++) {
1080
+ const y = f[d];
1081
+ y && (x[y.lane] = d);
1082
+ }
1083
+ for (let d = m; d < s; d++) {
1084
+ const y = l(d), C = this.laneAssignments.get(d);
1085
+ let b, N;
1086
+ if (C !== void 0 && this.options.lanes > 1) {
1087
+ b = C;
1088
+ const S = x[b], w = S !== void 0 ? f[S] : void 0;
1089
+ N = w ? w.end + this.options.gap : n + r;
1090
+ } else {
1091
+ const S = this.options.lanes === 1 ? f[d - 1] : this.getFurthestMeasurement(f, d);
1092
+ N = S ? S.end + this.options.gap : n + r, b = S ? S.lane : d % this.options.lanes, this.options.lanes > 1 && this.laneAssignments.set(d, b);
1093
+ }
1094
+ const j = u.get(y), M = typeof j == "number" ? j : this.options.estimateSize(d), c = N + M;
1095
+ f[d] = {
1096
+ index: d,
1097
+ start: N,
1098
+ size: M,
1099
+ end: c,
1100
+ key: y,
1101
+ lane: b
1102
+ }, x[b] = d;
1103
+ }
1104
+ return this.measurementsCache = f, f;
1105
+ },
1106
+ {
1107
+ key: process.env.NODE_ENV !== "production" && "getMeasurements",
1108
+ debug: () => this.options.debug
1109
+ }
1110
+ ), this.calculateRange = G(
1111
+ () => [
1112
+ this.getMeasurements(),
1113
+ this.getSize(),
1114
+ this.getScrollOffset(),
1115
+ this.options.lanes
1116
+ ],
1117
+ (s, n, r, l) => this.range = s.length > 0 && n > 0 ? ls({
1118
+ measurements: s,
1119
+ outerSize: n,
1120
+ scrollOffset: r,
1121
+ lanes: l
1122
+ }) : null,
1123
+ {
1124
+ key: process.env.NODE_ENV !== "production" && "calculateRange",
1125
+ debug: () => this.options.debug
1126
+ }
1127
+ ), this.getVirtualIndexes = G(
1128
+ () => {
1129
+ let s = null, n = null;
1130
+ const r = this.calculateRange();
1131
+ return r && (s = r.startIndex, n = r.endIndex), this.maybeNotify.updateDeps([this.isScrolling, s, n]), [
1132
+ this.options.rangeExtractor,
1133
+ this.options.overscan,
1134
+ this.options.count,
1135
+ s,
1136
+ n
1137
+ ];
1138
+ },
1139
+ (s, n, r, l, a) => l === null || a === null ? [] : s({
1140
+ startIndex: l,
1141
+ endIndex: a,
1142
+ overscan: n,
1143
+ count: r
1144
+ }),
1145
+ {
1146
+ key: process.env.NODE_ENV !== "production" && "getVirtualIndexes",
1147
+ debug: () => this.options.debug
1148
+ }
1149
+ ), this.indexFromElement = (s) => {
1150
+ const n = this.options.indexAttribute, r = s.getAttribute(n);
1151
+ return r ? parseInt(r, 10) : (console.warn(
1152
+ `Missing attribute name '${n}={index}' on measured element.`
1153
+ ), -1);
1154
+ }, this.shouldMeasureDuringScroll = (s) => {
1155
+ var n;
1156
+ if (!this.scrollState || this.scrollState.behavior !== "smooth")
1157
+ return !0;
1158
+ const r = this.scrollState.index ?? ((n = this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)) == null ? void 0 : n.index);
1159
+ if (r !== void 0 && this.range) {
1160
+ const l = Math.max(
1161
+ this.options.overscan,
1162
+ Math.ceil((this.range.endIndex - this.range.startIndex) / 2)
1163
+ ), a = Math.max(0, r - l), o = Math.min(
1164
+ this.options.count - 1,
1165
+ r + l
1166
+ );
1167
+ return s >= a && s <= o;
1168
+ }
1169
+ return !0;
1170
+ }, this._measureElement = (s, n) => {
1171
+ if (!s.isConnected) {
1172
+ this.observer.unobserve(s);
1173
+ return;
1174
+ }
1175
+ const r = this.indexFromElement(s), l = this.measurementsCache[r];
1176
+ if (!l)
1177
+ return;
1178
+ const a = l.key, o = this.elementsCache.get(a);
1179
+ o !== s && (o && this.observer.unobserve(o), this.observer.observe(s), this.elementsCache.set(a, s)), this.shouldMeasureDuringScroll(r) && this.resizeItem(r, this.options.measureElement(s, n, this));
1180
+ }, this.resizeItem = (s, n) => {
1181
+ var r;
1182
+ const l = this.measurementsCache[s];
1183
+ if (!l)
1184
+ return;
1185
+ const a = this.itemSizeCache.get(l.key) ?? l.size, o = n - a;
1186
+ o !== 0 && (((r = this.scrollState) == null ? void 0 : r.behavior) !== "smooth" && (this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(l, o, this) : l.start < this.getScrollOffset() + this.scrollAdjustments) && (process.env.NODE_ENV !== "production" && this.options.debug && console.info("correction", o), this._scrollToOffset(this.getScrollOffset(), {
1187
+ adjustments: this.scrollAdjustments += o,
1188
+ behavior: void 0
1189
+ })), this.pendingMeasuredCacheIndexes.push(l.index), this.itemSizeCache = new Map(this.itemSizeCache.set(l.key, n)), this.notify(!1));
1190
+ }, this.measureElement = (s) => {
1191
+ if (!s) {
1192
+ this.elementsCache.forEach((n, r) => {
1193
+ n.isConnected || (this.observer.unobserve(n), this.elementsCache.delete(r));
1194
+ });
1195
+ return;
1196
+ }
1197
+ this._measureElement(s, void 0);
1198
+ }, this.getVirtualItems = G(
1199
+ () => [this.getVirtualIndexes(), this.getMeasurements()],
1200
+ (s, n) => {
1201
+ const r = [];
1202
+ for (let l = 0, a = s.length; l < a; l++) {
1203
+ const o = s[l], u = n[o];
1204
+ r.push(u);
1205
+ }
1206
+ return r;
1207
+ },
1208
+ {
1209
+ key: process.env.NODE_ENV !== "production" && "getVirtualItems",
1210
+ debug: () => this.options.debug
1211
+ }
1212
+ ), this.getVirtualItemForOffset = (s) => {
1213
+ const n = this.getMeasurements();
1214
+ if (n.length !== 0)
1215
+ return Se(
1216
+ n[Fe(
1217
+ 0,
1218
+ n.length - 1,
1219
+ (r) => Se(n[r]).start,
1220
+ s
1221
+ )]
1222
+ );
1223
+ }, this.getMaxScrollOffset = () => {
1224
+ if (!this.scrollElement) return 0;
1225
+ if ("scrollHeight" in this.scrollElement)
1226
+ return this.options.horizontal ? this.scrollElement.scrollWidth - this.scrollElement.clientWidth : this.scrollElement.scrollHeight - this.scrollElement.clientHeight;
1227
+ {
1228
+ const s = this.scrollElement.document.documentElement;
1229
+ return this.options.horizontal ? s.scrollWidth - this.scrollElement.innerWidth : s.scrollHeight - this.scrollElement.innerHeight;
1230
+ }
1231
+ }, this.getOffsetForAlignment = (s, n, r = 0) => {
1232
+ if (!this.scrollElement) return 0;
1233
+ const l = this.getSize(), a = this.getScrollOffset();
1234
+ n === "auto" && (n = s >= a + l ? "end" : "start"), n === "center" ? s += (r - l) / 2 : n === "end" && (s -= l);
1235
+ const o = this.getMaxScrollOffset();
1236
+ return Math.max(Math.min(o, s), 0);
1237
+ }, this.getOffsetForIndex = (s, n = "auto") => {
1238
+ s = Math.max(0, Math.min(s, this.options.count - 1));
1239
+ const r = this.getSize(), l = this.getScrollOffset(), a = this.measurementsCache[s];
1240
+ if (!a) return;
1241
+ if (n === "auto")
1242
+ if (a.end >= l + r - this.options.scrollPaddingEnd)
1243
+ n = "end";
1244
+ else if (a.start <= l + this.options.scrollPaddingStart)
1245
+ n = "start";
1246
+ else
1247
+ return [l, n];
1248
+ if (n === "end" && s === this.options.count - 1)
1249
+ return [this.getMaxScrollOffset(), n];
1250
+ const o = n === "end" ? a.end + this.options.scrollPaddingEnd : a.start - this.options.scrollPaddingStart;
1251
+ return [
1252
+ this.getOffsetForAlignment(o, n, a.size),
1253
+ n
1254
+ ];
1255
+ }, this.scrollToOffset = (s, { align: n = "start", behavior: r = "auto" } = {}) => {
1256
+ const l = this.getOffsetForAlignment(s, n), a = this.now();
1257
+ this.scrollState = {
1258
+ index: null,
1259
+ align: n,
1260
+ behavior: r,
1261
+ startedAt: a,
1262
+ lastTargetOffset: l,
1263
+ stableFrames: 0
1264
+ }, this._scrollToOffset(l, { adjustments: void 0, behavior: r }), this.scheduleScrollReconcile();
1265
+ }, this.scrollToIndex = (s, {
1266
+ align: n = "auto",
1267
+ behavior: r = "auto"
1268
+ } = {}) => {
1269
+ s = Math.max(0, Math.min(s, this.options.count - 1));
1270
+ const l = this.getOffsetForIndex(s, n);
1271
+ if (!l)
1272
+ return;
1273
+ const [a, o] = l, u = this.now();
1274
+ this.scrollState = {
1275
+ index: s,
1276
+ align: o,
1277
+ behavior: r,
1278
+ startedAt: u,
1279
+ lastTargetOffset: a,
1280
+ stableFrames: 0
1281
+ }, this._scrollToOffset(a, { adjustments: void 0, behavior: r }), this.scheduleScrollReconcile();
1282
+ }, this.scrollBy = (s, { behavior: n = "auto" } = {}) => {
1283
+ const r = this.getScrollOffset() + s, l = this.now();
1284
+ this.scrollState = {
1285
+ index: null,
1286
+ align: "start",
1287
+ behavior: n,
1288
+ startedAt: l,
1289
+ lastTargetOffset: r,
1290
+ stableFrames: 0
1291
+ }, this._scrollToOffset(r, { adjustments: void 0, behavior: n }), this.scheduleScrollReconcile();
1292
+ }, this.getTotalSize = () => {
1293
+ var s;
1294
+ const n = this.getMeasurements();
1295
+ let r;
1296
+ if (n.length === 0)
1297
+ r = this.options.paddingStart;
1298
+ else if (this.options.lanes === 1)
1299
+ r = ((s = n[n.length - 1]) == null ? void 0 : s.end) ?? 0;
1300
+ else {
1301
+ const l = Array(this.options.lanes).fill(null);
1302
+ let a = n.length - 1;
1303
+ for (; a >= 0 && l.some((o) => o === null); ) {
1304
+ const o = n[a];
1305
+ l[o.lane] === null && (l[o.lane] = o.end), a--;
1306
+ }
1307
+ r = Math.max(...l.filter((o) => o !== null));
1308
+ }
1309
+ return Math.max(
1310
+ r - this.options.scrollMargin + this.options.paddingEnd,
1311
+ 0
1312
+ );
1313
+ }, this._scrollToOffset = (s, {
1314
+ adjustments: n,
1315
+ behavior: r
1316
+ }) => {
1317
+ this.options.scrollToFn(s, { behavior: r, adjustments: n }, this);
1318
+ }, this.measure = () => {
1319
+ this.itemSizeCache = /* @__PURE__ */ new Map(), this.laneAssignments = /* @__PURE__ */ new Map(), this.notify(!1);
1320
+ }, this.setOptions(i);
1321
+ }
1322
+ scheduleScrollReconcile() {
1323
+ if (!this.targetWindow) {
1324
+ this.scrollState = null;
1325
+ return;
1326
+ }
1327
+ this.rafId == null && (this.rafId = this.targetWindow.requestAnimationFrame(() => {
1328
+ this.rafId = null, this.reconcileScroll();
1329
+ }));
1330
+ }
1331
+ reconcileScroll() {
1332
+ if (!this.scrollState || !this.scrollElement) return;
1333
+ if (this.now() - this.scrollState.startedAt > 5e3) {
1334
+ this.scrollState = null;
1335
+ return;
1336
+ }
1337
+ const n = this.scrollState.index != null ? this.getOffsetForIndex(this.scrollState.index, this.scrollState.align) : void 0, r = n ? n[0] : this.scrollState.lastTargetOffset, l = 1, a = r !== this.scrollState.lastTargetOffset;
1338
+ if (!a && Jt(r, this.getScrollOffset())) {
1339
+ if (this.scrollState.stableFrames++, this.scrollState.stableFrames >= l) {
1340
+ this.scrollState = null;
1341
+ return;
1342
+ }
1343
+ } else
1344
+ this.scrollState.stableFrames = 0, a && (this.scrollState.lastTargetOffset = r, this.scrollState.behavior = "auto", this._scrollToOffset(r, {
1345
+ adjustments: void 0,
1346
+ behavior: "auto"
1347
+ }));
1348
+ this.scheduleScrollReconcile();
1349
+ }
1350
+ }
1351
+ const Fe = (e, i, s, n) => {
1352
+ for (; e <= i; ) {
1353
+ const r = (e + i) / 2 | 0, l = s(r);
1354
+ if (l < n)
1355
+ e = r + 1;
1356
+ else if (l > n)
1357
+ i = r - 1;
1358
+ else
1359
+ return r;
1360
+ }
1361
+ return e > 0 ? e - 1 : 0;
1362
+ };
1363
+ function ls({
1364
+ measurements: e,
1365
+ outerSize: i,
1366
+ scrollOffset: s,
1367
+ lanes: n
1368
+ }) {
1369
+ const r = e.length - 1, l = (u) => e[u].start;
1370
+ if (e.length <= n)
1371
+ return {
1372
+ startIndex: 0,
1373
+ endIndex: r
1374
+ };
1375
+ let a = Fe(
1376
+ 0,
1377
+ r,
1378
+ l,
1379
+ s
1380
+ ), o = a;
1381
+ if (n === 1)
1382
+ for (; o < r && e[o].end < s + i; )
1383
+ o++;
1384
+ else if (n > 1) {
1385
+ const u = Array(n).fill(0);
1386
+ for (; o < r && u.some((f) => f < s + i); ) {
1387
+ const f = e[o];
1388
+ u[f.lane] = f.end, o++;
1389
+ }
1390
+ const m = Array(n).fill(s + i);
1391
+ for (; a >= 0 && m.some((f) => f >= s); ) {
1392
+ const f = e[a];
1393
+ m[f.lane] = f.start, a--;
1394
+ }
1395
+ a = Math.max(0, a - a % n), o = Math.min(r, o + (n - 1 - o % n));
1396
+ }
1397
+ return { startIndex: a, endIndex: o };
1398
+ }
1399
+ const Me = typeof document < "u" ? Z.useLayoutEffect : Z.useEffect;
1400
+ function os({
1401
+ useFlushSync: e = !0,
1402
+ ...i
1403
+ }) {
1404
+ const s = Z.useReducer(() => ({}), {})[1], n = {
1405
+ ...i,
1406
+ onChange: (l, a) => {
1407
+ var o;
1408
+ e && a ? ct(s) : s(), (o = i.onChange) == null || o.call(i, l, a);
1409
+ }
1410
+ }, [r] = Z.useState(
1411
+ () => new rs(n)
1412
+ );
1413
+ return r.setOptions(n), Me(() => r._didMount(), []), Me(() => r._willUpdate()), r;
1414
+ }
1415
+ function as(e) {
1416
+ return os({
1417
+ observeElementRect: ts,
1418
+ observeElementOffset: ss,
1419
+ scrollToFn: is,
1420
+ ...e
1421
+ });
1422
+ }
1423
+ function ye(e) {
1424
+ return "type" in e && e.type === "group";
1425
+ }
1426
+ function Ne(e) {
1427
+ return e == null ? !1 : typeof e == "string" ? e.trim().length > 0 : typeof e == "number" || typeof e == "boolean";
1428
+ }
1429
+ function ie(e) {
1430
+ return String(e?.identifier ?? e?.key ?? e?.id ?? "");
1431
+ }
1432
+ function re(e) {
1433
+ return typeof e?.summary == "string" ? e.summary : typeof e?.title == "string" ? e.title : typeof e?.name == "string" ? e.name : "";
1434
+ }
1435
+ function cs(e) {
1436
+ return typeof e?.priority == "string" ? e.priority : "";
1437
+ }
1438
+ function us(e) {
1439
+ return typeof e?.assignee == "string" ? e.assignee : typeof e?.assignee?.name == "string" ? e.assignee.name : "";
1440
+ }
1441
+ function Oe(e, i) {
1442
+ if (!i)
1443
+ return e;
1444
+ if (ye(i))
1445
+ return e.filter((o) => ms(o, i));
1446
+ const s = i, n = String(s.query ?? "").trim().toLowerCase(), r = s.status ?? [], l = s.priority ?? [], a = s.assignee ?? [];
1447
+ return !n && r.length === 0 && l.length === 0 && a.length === 0 ? e : e.filter((o) => {
1448
+ const u = String(o?.status ?? ""), m = String(o?.priority ?? ""), f = String(o?.assignee ?? "");
1449
+ if (r.length > 0 && !r.includes(u) || l.length > 0 && !l.includes(m) || a.length > 0 && !a.includes(f))
1450
+ return !1;
1451
+ if (!n)
1452
+ return !0;
1453
+ const x = ie(o).toLowerCase(), d = re(o).toLowerCase();
1454
+ return x.includes(n) || d.includes(n);
1455
+ });
1456
+ }
1457
+ function ds(e, i) {
1458
+ if (i === "id") return ie(e);
1459
+ if (i === "summary") return re(e);
1460
+ const s = e?.[i];
1461
+ if (s != null)
1462
+ return String(s);
1463
+ }
1464
+ function hs(e, i) {
1465
+ const s = ds(e, i.field), n = String(s ?? "").toLowerCase(), r = String(i.value ?? "").toLowerCase();
1466
+ switch (i.operator) {
1467
+ case "is":
1468
+ return n === r;
1469
+ case "is_not":
1470
+ return n !== r;
1471
+ case "contains":
1472
+ return n.includes(r);
1473
+ case "is_empty":
1474
+ return !s;
1475
+ case "is_not_empty":
1476
+ return !!s;
1477
+ default:
1478
+ return !0;
1479
+ }
1480
+ }
1481
+ function Te(e, i) {
1482
+ if (i.type === "rule")
1483
+ return hs(e, i);
1484
+ if (i.children.length === 0) return !0;
1485
+ const s = i.children.map((n) => Te(e, n));
1486
+ return i.conjunction === "AND" ? s.every(Boolean) : s.some(Boolean);
1487
+ }
1488
+ function ms(e, i) {
1489
+ return Te(e, i);
1490
+ }
1491
+ function le() {
1492
+ return {
1493
+ type: "group",
1494
+ conjunction: "AND",
1495
+ children: [
1496
+ {
1497
+ type: "rule",
1498
+ field: "summary",
1499
+ operator: "contains",
1500
+ value: ""
1501
+ }
1502
+ ]
1503
+ };
1504
+ }
1505
+ function Re(e) {
1506
+ if (!e) return 0;
1507
+ if (!ye(e))
1508
+ return (e.status?.length ?? 0) + (e.priority?.length ?? 0) + (e.assignee?.length ?? 0) + (e.query ? 1 : 0);
1509
+ const i = (s) => s.type === "rule" ? 1 : s.children.reduce((n, r) => n + i(r), 0);
1510
+ return i(e);
1511
+ }
1512
+ function Le(e) {
1513
+ if (!e)
1514
+ return !1;
1515
+ if (!ye(e))
1516
+ return Ne(e.query) || (e.status?.length ?? 0) > 0 || (e.priority?.length ?? 0) > 0 || (e.assignee?.length ?? 0) > 0;
1517
+ const i = (s) => s.type === "group" ? s.children.some((n) => i(n)) : s.operator === "is_empty" || s.operator === "is_not_empty" ? !0 : Ne(s.value);
1518
+ return i(e);
1519
+ }
1520
+ function Pe(e, i, s = "updated") {
1521
+ const n = [...e], r = { high: 3, medium: 2, low: 1 }, l = { backlog: 1, open: 2, "in progress": 3, done: 4 }, a = (o, u, m) => {
1522
+ if (m === "priority") {
1523
+ const C = r[String(o?.priority ?? "").toLowerCase()] ?? 0;
1524
+ return (r[String(u?.priority ?? "").toLowerCase()] ?? 0) - C;
1525
+ }
1526
+ if (m === "status") {
1527
+ const C = l[String(o?.status ?? "").toLowerCase()] ?? 0;
1528
+ return (l[String(u?.status ?? "").toLowerCase()] ?? 0) - C;
1529
+ }
1530
+ const f = m === "updated" ? o?.updatedAt ?? o?.updated ?? o?.id : o?.[m], x = m === "updated" ? u?.updatedAt ?? u?.updated ?? u?.id : u?.[m], d = Number(f), y = Number(x);
1531
+ return !Number.isNaN(d) && !Number.isNaN(y) ? y - d : String(x ?? "").localeCompare(String(f ?? ""), void 0, {
1532
+ numeric: !0,
1533
+ sensitivity: "base"
1534
+ });
1535
+ };
1536
+ return n.sort((o, u) => {
1537
+ if (i && i.length > 0) {
1538
+ for (const m of i) {
1539
+ const f = a(o, u, m.property);
1540
+ if (f !== 0)
1541
+ return m.direction === "desc" ? f : -f;
1542
+ }
1543
+ return 0;
1544
+ }
1545
+ return a(o, u, s);
1546
+ }), n;
1547
+ }
1548
+ function Be(e, i) {
1549
+ if (!i)
1550
+ return e;
1551
+ const s = i.status ?? [], n = i.assignee ?? [], r = String(i.search ?? "").trim().toLowerCase();
1552
+ return s.length === 0 && n.length === 0 && !r ? e : e.filter((l) => {
1553
+ const a = String(l?.status ?? ""), o = String(l?.assignee ?? "");
1554
+ if (s.length > 0 && !s.includes(a) || n.length > 0 && !n.includes(o))
1555
+ return !1;
1556
+ if (!r)
1557
+ return !0;
1558
+ const u = ie(l).toLowerCase(), m = re(l).toLowerCase();
1559
+ return u.includes(r) || m.includes(r);
1560
+ });
1561
+ }
1562
+ const fs = [
1563
+ { value: "low", label: "Low", icon: /* @__PURE__ */ t.jsx(nt, {}) },
1564
+ { value: "medium", label: "Medium", icon: /* @__PURE__ */ t.jsx(it, {}) },
1565
+ { value: "high", label: "High", icon: /* @__PURE__ */ t.jsx(rt, {}) }
1566
+ ], gs = [
1567
+ { value: "backlog", label: "Backlog", icon: /* @__PURE__ */ t.jsx(Ze, {}) },
1568
+ { value: "open", label: "Open", icon: /* @__PURE__ */ t.jsx(et, {}) },
1569
+ { value: "in progress", label: "In Progress", icon: /* @__PURE__ */ t.jsx(tt, {}) },
1570
+ { value: "done", label: "Done", icon: /* @__PURE__ */ t.jsx(st, {}) }
1571
+ ], ps = [
1572
+ { value: "user story", label: "User story", icon: /* @__PURE__ */ t.jsx(me, { size: 14, stroke: "#60A5FA" }) },
1573
+ { value: "bug", label: "Bug", icon: /* @__PURE__ */ t.jsx(fe, { size: 14, stroke: "#EF4444" }) },
1574
+ { value: "docs", label: "Docs", icon: /* @__PURE__ */ t.jsx(ge, { size: 14, stroke: "#A78BFA" }) },
1575
+ { value: "feature", label: "Feature", icon: /* @__PURE__ */ t.jsx(xe, { size: 14, stroke: "#F59E0B" }) },
1576
+ { value: "task", label: "Task", icon: /* @__PURE__ */ t.jsx(pe, { size: 14, stroke: "#22C55E" }) }
1577
+ ];
1578
+ function xs({ value: e, onChange: i }) {
1579
+ return /* @__PURE__ */ t.jsx(
1580
+ he,
1581
+ {
1582
+ kind: "icon",
1583
+ variant: "ghost",
1584
+ placeholder: "?",
1585
+ value: e,
1586
+ onValueChange: i,
1587
+ options: fs
1588
+ }
1589
+ );
1590
+ }
1591
+ const qe = xs;
1592
+ function $e({ value: e, onChange: i }) {
1593
+ return /* @__PURE__ */ t.jsx(
1594
+ he,
1595
+ {
1596
+ kind: "icon",
1597
+ variant: "ghost",
1598
+ placeholder: "?",
1599
+ value: e,
1600
+ onValueChange: i,
1601
+ options: gs
1602
+ }
1603
+ );
1604
+ }
1605
+ function We({ value: e, onChange: i }) {
1606
+ return /* @__PURE__ */ t.jsx(
1607
+ he,
1608
+ {
1609
+ kind: "icon",
1610
+ variant: "ghost",
1611
+ placeholder: "?",
1612
+ value: e,
1613
+ onValueChange: i,
1614
+ options: ps
1615
+ }
1616
+ );
1617
+ }
1618
+ function Ge({
1619
+ value: e,
1620
+ onChange: i,
1621
+ placeholder: s = "Summary..."
1622
+ }) {
1623
+ return /* @__PURE__ */ t.jsx(
1624
+ "input",
1625
+ {
1626
+ value: e,
1627
+ onChange: (n) => i(n.target.value),
1628
+ placeholder: s,
1629
+ className: "w-full rounded border border-transparent bg-transparent px-1 py-0.5 text-sm text-text-primary outline-none focus:border-[#2A2A2A]"
1630
+ }
1631
+ );
1632
+ }
1633
+ function ys({
1634
+ entry: e,
1635
+ visiblePropertySet: i,
1636
+ onSummaryChange: s,
1637
+ onPriorityChange: n,
1638
+ onStatusChange: r,
1639
+ onIssueTypeChange: l
1640
+ }) {
1641
+ const a = e?.id ? String(e.id) : "", o = e?.name ? String(e.name) : e?.title ? String(e.title) : "", u = e?.status ? String(e.status) : e?.state ? String(e.state) : "", m = e?.priority ? String(e.priority) : void 0, f = e?.assignee ? String(e.assignee) : "", x = e?.summary ? String(e.summary) : "", d = String(e?.entryType ?? e?.issueType ?? e?.type ?? "user story").toLowerCase(), y = !!e?.selected, [C, b] = v.useState(x), [N, j] = v.useState(m), [M, c] = v.useState(u), [S, w] = v.useState(d);
1642
+ v.useEffect(() => {
1643
+ b(x), j(m), c(u), w(d);
1644
+ }, [x, m, u, d]);
1645
+ const p = i.has("id"), E = i.has("name") || i.has("title"), z = i.has("status") || i.has("state"), q = i.has("type") || i.has("entryType") || i.has("issueType"), F = i.has("priority"), R = i.has("assignee"), H = (() => {
1646
+ switch (d) {
1647
+ case "bug":
1648
+ return fe;
1649
+ case "docs":
1650
+ case "documentation":
1651
+ return ge;
1652
+ case "feature":
1653
+ return xe;
1654
+ case "task":
1655
+ return pe;
1656
+ default:
1657
+ return me;
1658
+ }
1659
+ })();
1660
+ return /* @__PURE__ */ t.jsxs("div", { className: "group flex items-center gap-2 px-4 border-b border-[#2A2A2A] h-[44px] bg-[#141414] text-sm", children: [
1661
+ /* @__PURE__ */ t.jsx("div", { className: `${y ? "opacity-100" : "opacity-0 group-hover:opacity-100"} transition-opacity`, children: /* @__PURE__ */ t.jsx(lt, { checked: y }) }),
1662
+ F ? /* @__PURE__ */ t.jsx(
1663
+ qe,
1664
+ {
1665
+ value: N,
1666
+ onChange: (_) => {
1667
+ j(_), n?.(_);
1668
+ }
1669
+ }
1670
+ ) : null,
1671
+ q ? /* @__PURE__ */ t.jsx(
1672
+ We,
1673
+ {
1674
+ value: S,
1675
+ onChange: (_) => {
1676
+ w(_), l?.(_);
1677
+ }
1678
+ }
1679
+ ) : null,
1680
+ p ? /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-1 text-text-primary min-w-0", children: [
1681
+ q ? null : /* @__PURE__ */ t.jsx(H, { size: 14, stroke: "#608a23" }),
1682
+ /* @__PURE__ */ t.jsx("span", { className: "truncate", children: a })
1683
+ ] }) : null,
1684
+ z ? /* @__PURE__ */ t.jsx(
1685
+ $e,
1686
+ {
1687
+ value: M,
1688
+ onChange: (_) => {
1689
+ c(_), r?.(_);
1690
+ }
1691
+ }
1692
+ ) : null,
1693
+ E ? /* @__PURE__ */ t.jsx("span", { className: "text-text-primary truncate max-w-40", children: o || "—" }) : null,
1694
+ /* @__PURE__ */ t.jsx("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ t.jsx(
1695
+ Ge,
1696
+ {
1697
+ value: C,
1698
+ onChange: (_) => {
1699
+ b(_), s?.(_);
1700
+ }
1701
+ }
1702
+ ) }),
1703
+ R ? /* @__PURE__ */ t.jsx(Ee, { name: f, size: "xs" }) : null
1704
+ ] });
1705
+ }
1706
+ const vs = ["summary"];
1707
+ function Y(e) {
1708
+ return Array.from(/* @__PURE__ */ new Set([...e, ...vs]));
1709
+ }
1710
+ function He(e) {
1711
+ const i = [...e], s = (n) => i.some((r) => r.id === n);
1712
+ return s("summary") || i.unshift({ id: "summary", label: "Summary" }), !s("type") && !s("entryType") && !s("issueType") && i.push({ id: "type", label: "Type" }), i;
1713
+ }
1714
+ function bs({ label: e, count: i }) {
1715
+ return /* @__PURE__ */ t.jsxs("div", { className: "flex items-center justify-between px-6 border-b border-border-default h-11 bg-[#111111] text-sm", children: [
1716
+ /* @__PURE__ */ t.jsx("span", { className: "text-text-primary", children: e }),
1717
+ /* @__PURE__ */ t.jsx("span", { className: "text-text-muted", children: i })
1718
+ ] });
1719
+ }
1720
+ const js = 44;
1721
+ function Ss(e, i) {
1722
+ if (!i)
1723
+ return e.map((r) => ({
1724
+ type: "entry",
1725
+ key: `entry-${r.id}`,
1726
+ entry: r
1727
+ }));
1728
+ const s = /* @__PURE__ */ new Map();
1729
+ e.forEach((r) => {
1730
+ const l = r?.[i], a = l == null || l === "" ? "Ungrouped" : String(l), o = s.get(a);
1731
+ if (o) {
1732
+ o.push(r);
1733
+ return;
1734
+ }
1735
+ s.set(a, [r]);
1736
+ });
1737
+ const n = [];
1738
+ return s.forEach((r, l) => {
1739
+ n.push({
1740
+ type: "group",
1741
+ key: `group-${i}-${l}`,
1742
+ label: l,
1743
+ count: r.length
1744
+ }), r.forEach((a) => {
1745
+ n.push({
1746
+ type: "entry",
1747
+ key: `entry-${a.id}`,
1748
+ entry: a
1749
+ });
1750
+ });
1751
+ }), n;
1752
+ }
1753
+ const Ue = (e) => {
1754
+ const i = v.useMemo(
1755
+ () => e.properties && e.properties.length > 0 ? e.properties : [{ id: "id", label: "ID" }],
1756
+ [e.properties]
1757
+ ), [s, n] = v.useState({}), r = v.useMemo(
1758
+ () => e.entries.map((M) => {
1759
+ const c = String(M?.id ?? ""), S = s[c];
1760
+ return S ? { ...M, ...S } : M;
1761
+ }),
1762
+ [e.entries, s]
1763
+ ), l = v.useMemo(
1764
+ () => Y(
1765
+ e.viewSettings?.visiblePropertyIds ?? i.map((M) => M.id)
1766
+ ),
1767
+ [e.viewSettings?.visiblePropertyIds, i]
1768
+ ), a = v.useMemo(() => new Set(l), [l]), o = e.renderEntry, u = v.useRef(null), m = v.useMemo(
1769
+ () => e.viewSettings?.filter ?? {},
1770
+ [e.viewSettings?.filter]
1771
+ ), f = v.useMemo(
1772
+ () => e.viewSettings?.quickFilters ?? {},
1773
+ [e.viewSettings?.quickFilters]
1774
+ ), x = v.useMemo(
1775
+ () => e.viewSettings?.sortRules ?? [],
1776
+ [e.viewSettings?.sortRules]
1777
+ ), d = typeof e.viewSettings?.sortBy == "string" ? e.viewSettings.sortBy : "updated", y = v.useMemo(
1778
+ () => Oe(r, m),
1779
+ [r, m]
1780
+ ), C = v.useMemo(
1781
+ () => Be(y, f),
1782
+ [y, f]
1783
+ ), b = v.useMemo(
1784
+ () => Pe(C, x, d),
1785
+ [C, x, d]
1786
+ ), N = v.useMemo(() => Ss(b, e.groupBy), [b, e.groupBy]), j = as({
1787
+ count: N.length,
1788
+ getScrollElement: () => u.current,
1789
+ // WARN: This should be equal to the actual height of list entry, otherwise there will be
1790
+ // virtualization glitches. We should ideally measure the actual height of entry and return it here.
1791
+ overscan: 5,
1792
+ estimateSize: () => js
1793
+ });
1794
+ return /* @__PURE__ */ t.jsx("div", { id: "scroll-container", ref: u, className: "h-full min-h-0 overflow-y-auto", children: /* @__PURE__ */ t.jsx("div", { className: "relative", style: { height: j.getTotalSize() }, children: j.getVirtualItems().map((M) => {
1795
+ const c = N[M.index];
1796
+ return c ? /* @__PURE__ */ t.jsx(
1797
+ "div",
1798
+ {
1799
+ className: "absolute top-0 left-0 w-full",
1800
+ style: { transform: `translateY(${M.start}px)` },
1801
+ children: c.type === "group" ? /* @__PURE__ */ t.jsx(bs, { label: c.label, count: c.count }) : o ? /* @__PURE__ */ t.jsx(o, { entry: c.entry }) : /* @__PURE__ */ t.jsx(
1802
+ ys,
1803
+ {
1804
+ entry: c.entry,
1805
+ visiblePropertySet: a,
1806
+ onSummaryChange: (S) => {
1807
+ const w = String(c.entry?.id ?? "");
1808
+ n((p) => ({
1809
+ ...p,
1810
+ [w]: {
1811
+ ...p[w] ?? {},
1812
+ summary: S
1813
+ }
1814
+ }));
1815
+ },
1816
+ onPriorityChange: (S) => {
1817
+ const w = String(c.entry?.id ?? "");
1818
+ n((p) => ({
1819
+ ...p,
1820
+ [w]: {
1821
+ ...p[w] ?? {},
1822
+ priority: S
1823
+ }
1824
+ }));
1825
+ },
1826
+ onStatusChange: (S) => {
1827
+ const w = String(c.entry?.id ?? "");
1828
+ n((p) => ({
1829
+ ...p,
1830
+ [w]: {
1831
+ ...p[w] ?? {},
1832
+ status: S,
1833
+ state: S
1834
+ }
1835
+ }));
1836
+ },
1837
+ onIssueTypeChange: (S) => {
1838
+ const w = String(c.entry?.id ?? "");
1839
+ n((p) => ({
1840
+ ...p,
1841
+ [w]: {
1842
+ ...p[w] ?? {},
1843
+ type: S,
1844
+ entryType: S,
1845
+ issueType: S
1846
+ }
1847
+ }));
1848
+ }
1849
+ }
1850
+ )
1851
+ },
1852
+ c.key
1853
+ ) : null;
1854
+ }) }) });
1855
+ };
1856
+ function ws({
1857
+ currentView: e,
1858
+ properties: i,
1859
+ viewSettings: s,
1860
+ setViewSettings: n,
1861
+ setCurrentView: r
1862
+ }) {
1863
+ const l = s.filter ?? {}, a = He(i), o = Y(
1864
+ s.visiblePropertyIds ?? a.map((c) => c.id)
1865
+ ), u = new Set(o), m = i.filter((c) => c.groupable), f = e.groupBy ?? null, x = f ? i.find((c) => c.id === f)?.label ?? f : "None", d = s.sortRules ?? [], y = [
1866
+ { value: "updated", label: "Updated" },
1867
+ { value: "priority", label: "Priority" },
1868
+ { value: "status", label: "Status" },
1869
+ { value: "assignee", label: "Assignee" },
1870
+ { value: "summary", label: "Summary" }
1871
+ ], C = d.length > 0 ? y.find((c) => c.value === d[0].property)?.label ?? d[0].property : "None", b = Re(l), N = [
1872
+ { value: "summary", label: "Summary" },
1873
+ { value: "status", label: "Status" },
1874
+ { value: "priority", label: "Priority" },
1875
+ { value: "assignee", label: "Assignee" },
1876
+ { value: "id", label: "ID" }
1877
+ ], j = [
1878
+ { value: "is", label: "is", requiresValue: !0 },
1879
+ { value: "is_not", label: "is not", requiresValue: !0 },
1880
+ { value: "contains", label: "contains", requiresValue: !0 },
1881
+ { value: "is_empty", label: "is empty", requiresValue: !1 },
1882
+ { value: "is_not_empty", label: "is not empty", requiresValue: !1 }
1883
+ ], M = "type" in l && l.type === "group" ? l : le();
1884
+ return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
1885
+ /* @__PURE__ */ t.jsxs(T, { title: "View options", children: [
1886
+ /* @__PURE__ */ t.jsx(
1887
+ D,
1888
+ {
1889
+ icon: /* @__PURE__ */ t.jsx(Ie, { size: 14 }),
1890
+ label: "Filter",
1891
+ submenu: "filter",
1892
+ trailing: /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
1893
+ b > 0 ? `${b} active` : "None",
1894
+ /* @__PURE__ */ t.jsx($, { size: 14 })
1895
+ ] })
1896
+ }
1897
+ ),
1898
+ /* @__PURE__ */ t.jsx(
1899
+ D,
1900
+ {
1901
+ icon: /* @__PURE__ */ t.jsx(se, { size: 14 }),
1902
+ label: "Properties",
1903
+ submenu: "properties",
1904
+ trailing: /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
1905
+ o.length,
1906
+ /* @__PURE__ */ t.jsx($, { size: 14 })
1907
+ ] })
1908
+ }
1909
+ ),
1910
+ /* @__PURE__ */ t.jsx(
1911
+ D,
1912
+ {
1913
+ icon: /* @__PURE__ */ t.jsx(ne, { size: 14 }),
1914
+ label: "Group",
1915
+ submenu: "group",
1916
+ trailing: /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
1917
+ x,
1918
+ /* @__PURE__ */ t.jsx($, { size: 14 })
1919
+ ] })
1920
+ }
1921
+ ),
1922
+ /* @__PURE__ */ t.jsx(
1923
+ D,
1924
+ {
1925
+ icon: /* @__PURE__ */ t.jsx(Ve, { size: 14 }),
1926
+ label: "Sort",
1927
+ submenu: "sort",
1928
+ trailing: /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
1929
+ C,
1930
+ /* @__PURE__ */ t.jsx($, { size: 14 })
1931
+ ] })
1932
+ }
1933
+ )
1934
+ ] }),
1935
+ /* @__PURE__ */ t.jsx(L, { id: "filter", title: "Filter", children: /* @__PURE__ */ t.jsx(T, { children: /* @__PURE__ */ t.jsx("div", { className: "px-2", children: /* @__PURE__ */ t.jsx(
1936
+ ee,
1937
+ {
1938
+ title: "Filter",
1939
+ value: M,
1940
+ onChange: (c) => n({ filter: c }),
1941
+ fields: N,
1942
+ operators: j,
1943
+ variant: "ghost"
1944
+ }
1945
+ ) }) }) }),
1946
+ /* @__PURE__ */ t.jsx(L, { id: "properties", title: "Properties", children: /* @__PURE__ */ t.jsx(T, { title: "Visible columns", children: a.map((c) => /* @__PURE__ */ t.jsx(
1947
+ D,
1948
+ {
1949
+ label: c.label,
1950
+ active: u.has(c.id),
1951
+ disabled: c.id === "summary",
1952
+ trailing: /* @__PURE__ */ t.jsx(t.Fragment, { children: u.has(c.id) ? "Visible" : "Hidden" }),
1953
+ onClick: () => {
1954
+ if (c.id === "summary")
1955
+ return;
1956
+ const S = u.has(c.id), w = S ? o.filter((p) => p !== c.id) : [...o, c.id];
1957
+ n({ visiblePropertyIds: Y(w) }), S && e.groupBy === c.id && r({
1958
+ ...e,
1959
+ groupBy: null
1960
+ });
1961
+ }
1962
+ },
1963
+ c.id
1964
+ )) }) }),
1965
+ /* @__PURE__ */ t.jsx(L, { id: "group", title: "Group", children: /* @__PURE__ */ t.jsxs(T, { title: "Group by", children: [
1966
+ /* @__PURE__ */ t.jsx(
1967
+ D,
1968
+ {
1969
+ label: "None",
1970
+ active: f === null,
1971
+ onClick: () => {
1972
+ r({
1973
+ ...e,
1974
+ groupBy: null
1975
+ });
1976
+ }
1977
+ }
1978
+ ),
1979
+ m.length > 0 ? m.map((c) => /* @__PURE__ */ t.jsx(
1980
+ D,
1981
+ {
1982
+ label: c.label,
1983
+ active: e.groupBy === c.id,
1984
+ onClick: () => {
1985
+ r({
1986
+ ...e,
1987
+ groupBy: c.id
1988
+ });
1989
+ }
1990
+ },
1991
+ c.id
1992
+ )) : /* @__PURE__ */ t.jsx(D, { label: "No groupable properties", disabled: !0 })
1993
+ ] }) }),
1994
+ /* @__PURE__ */ t.jsx(L, { id: "sort", title: "Sort", children: /* @__PURE__ */ t.jsx(T, { children: /* @__PURE__ */ t.jsx("div", { className: "px-2", children: /* @__PURE__ */ t.jsx(
1995
+ te,
1996
+ {
1997
+ title: "Sort",
1998
+ value: d,
1999
+ onChange: (c) => n({ sortRules: c }),
2000
+ fields: y,
2001
+ variant: "ghost"
2002
+ }
2003
+ ) }) }) })
2004
+ ] });
2005
+ }
2006
+ Ue.SettingsMenu = ws;
2007
+ function ks() {
2008
+ const e = Q(), i = e.currentView, s = e.properties;
2009
+ if (!i)
2010
+ return null;
2011
+ const n = i.settings ?? {}, r = n.sortRules ?? [], l = He(s), a = Y(
2012
+ n.visiblePropertyIds ?? l.map((j) => j.id)
2013
+ ), o = s.filter((j) => j.groupable), u = e.setCurrentView, m = (j) => {
2014
+ u({
2015
+ ...i,
2016
+ settings: {
2017
+ ...i.settings ?? {},
2018
+ ...j
2019
+ }
2020
+ });
2021
+ }, f = [
2022
+ { value: "summary", label: "Summary" },
2023
+ { value: "status", label: "Status" },
2024
+ { value: "priority", label: "Priority" },
2025
+ { value: "assignee", label: "Assignee" },
2026
+ { value: "id", label: "ID" }
2027
+ ], x = [
2028
+ { value: "is", label: "is", requiresValue: !0 },
2029
+ { value: "is_not", label: "is not", requiresValue: !0 },
2030
+ { value: "contains", label: "contains", requiresValue: !0 },
2031
+ { value: "is_empty", label: "is empty", requiresValue: !1 },
2032
+ { value: "is_not_empty", label: "is not empty", requiresValue: !1 }
2033
+ ], d = [
2034
+ { value: "updated", label: "Updated" },
2035
+ { value: "priority", label: "Priority" },
2036
+ { value: "status", label: "Status" },
2037
+ { value: "assignee", label: "Assignee" },
2038
+ { value: "summary", label: "Summary" }
2039
+ ], y = n.filter && typeof n.filter == "object" && "type" in n.filter ? n.filter : le(), C = !!i.groupBy, b = r.length > 0, N = Le(n.filter);
2040
+ return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
2041
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-1", children: [
2042
+ /* @__PURE__ */ t.jsx(
2043
+ K,
2044
+ {
2045
+ title: /* @__PURE__ */ t.jsx(ne, { size: 16, stroke: "#8D8D8D" }),
2046
+ kind: "icon",
2047
+ variant: C ? "accent" : "ghost",
2048
+ showCaret: !1,
2049
+ children: /* @__PURE__ */ t.jsxs("div", { className: "w-56 p-1", children: [
2050
+ /* @__PURE__ */ t.jsx(B, { onSelect: () => u({ ...i, groupBy: null }), children: "None" }),
2051
+ o.map((j) => /* @__PURE__ */ t.jsx(
2052
+ B,
2053
+ {
2054
+ onSelect: () => u({ ...i, groupBy: j.id }),
2055
+ children: j.label
2056
+ },
2057
+ j.id
2058
+ ))
2059
+ ] })
2060
+ }
2061
+ ),
2062
+ C ? /* @__PURE__ */ t.jsx(A, { kind: "icon", variant: "ghost", onClick: () => u({ ...i, groupBy: null }), children: /* @__PURE__ */ t.jsx(P, { size: 14, stroke: "#8D8D8D" }) }) : null
2063
+ ] }),
2064
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-1", children: [
2065
+ /* @__PURE__ */ t.jsx(
2066
+ te,
2067
+ {
2068
+ title: "Sort",
2069
+ kind: "icon",
2070
+ variant: b ? "accent" : "ghost",
2071
+ showCaret: !1,
2072
+ value: r,
2073
+ onChange: (j) => m({ sortRules: j }),
2074
+ fields: d
2075
+ }
2076
+ ),
2077
+ b ? /* @__PURE__ */ t.jsx(A, { kind: "icon", variant: "ghost", onClick: () => m({ sortRules: [] }), children: /* @__PURE__ */ t.jsx(P, { size: 14, stroke: "#8D8D8D" }) }) : null
2078
+ ] }),
2079
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-1", children: [
2080
+ /* @__PURE__ */ t.jsx(
2081
+ ee,
2082
+ {
2083
+ title: "Filter",
2084
+ kind: "icon",
2085
+ variant: N ? "accent" : "ghost",
2086
+ showCaret: !1,
2087
+ value: y,
2088
+ onChange: (j) => m({ filter: j }),
2089
+ fields: f,
2090
+ operators: x
2091
+ }
2092
+ ),
2093
+ N ? /* @__PURE__ */ t.jsx(A, { kind: "icon", variant: "ghost", onClick: () => m({ filter: void 0 }), children: /* @__PURE__ */ t.jsx(P, { size: 14, stroke: "#8D8D8D" }) }) : null
2094
+ ] }),
2095
+ /* @__PURE__ */ t.jsx(K, { title: /* @__PURE__ */ t.jsx(se, { size: 16, stroke: "#8D8D8D" }), kind: "icon", variant: "ghost", showCaret: !1, children: /* @__PURE__ */ t.jsx("div", { className: "w-56 p-1", children: l.map((j) => {
2096
+ const M = a.includes(j.id), c = M ? a.filter((S) => S !== j.id) : [...a, j.id];
2097
+ return /* @__PURE__ */ t.jsx(
2098
+ B,
2099
+ {
2100
+ disabled: j.id === "summary",
2101
+ onSelect: () => {
2102
+ j.id !== "summary" && m({ visiblePropertyIds: Y(c) });
2103
+ },
2104
+ children: /* @__PURE__ */ t.jsxs("span", { className: "flex items-center justify-between w-full", children: [
2105
+ /* @__PURE__ */ t.jsx("span", { children: j.label }),
2106
+ /* @__PURE__ */ t.jsx("span", { className: "text-text-muted text-xs", children: M ? "Visible" : "Hidden" })
2107
+ ] })
2108
+ },
2109
+ j.id
2110
+ );
2111
+ }) }) })
2112
+ ] });
2113
+ }
2114
+ Ue.ToolbarActions = ks;
2115
+ function Cs({ entry: e }) {
2116
+ return /* @__PURE__ */ t.jsx("div", { className: "flex items-center px-6 border-b border-[#2A2A2A] h-11 bg-[#141414]", children: e.id });
2117
+ }
2118
+ const Rs = (e) => {
2119
+ const i = e.renderEntry ?? Cs;
2120
+ return /* @__PURE__ */ t.jsxs("div", { children: [
2121
+ /* @__PURE__ */ t.jsx("h1", { children: "Grid Layout" }),
2122
+ e.entries.map((s) => /* @__PURE__ */ t.jsx(i, { entry: s }, s.id))
2123
+ ] });
2124
+ };
2125
+ function Ms({ entry: e }) {
2126
+ return /* @__PURE__ */ t.jsx("div", { className: "flex items-center px-6 border-b border-[#2A2A2A] h-11 bg-[#141414]", children: e.id });
2127
+ }
2128
+ const Ls = (e) => {
2129
+ const i = e.renderEntry ?? Ms;
2130
+ return /* @__PURE__ */ t.jsxs("div", { children: [
2131
+ /* @__PURE__ */ t.jsx("h1", { children: "Table Layout" }),
2132
+ e.entries.map((s) => /* @__PURE__ */ t.jsx(i, { entry: s }, s.id))
2133
+ ] });
2134
+ }, Ns = ["summary"];
2135
+ function de(e) {
2136
+ return Array.from(/* @__PURE__ */ new Set([...e, ...Ns]));
2137
+ }
2138
+ function Es(e) {
2139
+ const i = [...e], s = (n) => i.some((r) => r.id === n);
2140
+ return s("summary") || i.unshift({ id: "summary", label: "Summary" }), !s("type") && !s("entryType") && !s("issueType") && i.push({ id: "type", label: "Type" }), i;
2141
+ }
2142
+ function Is({
2143
+ entry: e,
2144
+ onSummaryChange: i,
2145
+ onPriorityChange: s,
2146
+ onStatusChange: n,
2147
+ onIssueTypeChange: r,
2148
+ visiblePropertySet: l
2149
+ }) {
2150
+ const a = ie(e), o = cs(e), u = e?.status ? String(e.status) : e?.state ? String(e.state) : "", m = us(e), f = re(e), x = String(e?.entryType ?? e?.issueType ?? e?.type ?? "user story").toLowerCase(), d = l.has("summary"), y = l.has("id"), C = l.has("status") || l.has("state"), b = l.has("type") || l.has("entryType") || l.has("issueType"), N = l.has("priority"), j = l.has("assignee"), M = y || b || C || N || j, c = (() => {
2151
+ switch (x) {
2152
+ case "bug":
2153
+ return fe;
2154
+ case "docs":
2155
+ case "documentation":
2156
+ return ge;
2157
+ case "feature":
2158
+ return xe;
2159
+ case "task":
2160
+ return pe;
2161
+ default:
2162
+ return me;
2163
+ }
2164
+ })();
2165
+ return /* @__PURE__ */ t.jsxs("div", { className: "rounded border border-[#2A2A2A] bg-[#141414] p-3 text-sm", children: [
2166
+ d ? /* @__PURE__ */ t.jsx(Ge, { value: f, onChange: i }) : null,
2167
+ M ? /* @__PURE__ */ t.jsxs("div", { className: "flex row justify-between items-center px-1", children: [
2168
+ /* @__PURE__ */ t.jsxs("div", { className: "flex row gap-2 items-center min-w-0", children: [
2169
+ b ? /* @__PURE__ */ t.jsx(We, { value: x, onChange: r }) : null,
2170
+ y ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
2171
+ b ? null : /* @__PURE__ */ t.jsx(c, { size: 14, stroke: "#608a23" }),
2172
+ /* @__PURE__ */ t.jsx("div", { className: "text-xs text-text-primary", children: a })
2173
+ ] }) : null,
2174
+ C ? /* @__PURE__ */ t.jsx($e, { value: u, onChange: n }) : null
2175
+ ] }),
2176
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2 text-xs text-text-primary", children: [
2177
+ N ? /* @__PURE__ */ t.jsx(qe, { value: o, onChange: s }) : null,
2178
+ j ? /* @__PURE__ */ t.jsx(Ee, { name: String(m ?? ""), size: "xs" }) : null
2179
+ ] })
2180
+ ] }) : null
2181
+ ] });
2182
+ }
2183
+ function Vs(e, i) {
2184
+ if (!i)
2185
+ return [{ key: "all", label: "All", entries: e }];
2186
+ const s = /* @__PURE__ */ new Map();
2187
+ return e.forEach((n) => {
2188
+ const r = n?.[i], l = r == null || r === "" ? "Ungrouped" : String(r);
2189
+ s.has(l) || s.set(l, []), s.get(l).push(n);
2190
+ }), Array.from(s.entries()).map(([n, r]) => ({
2191
+ key: `${i}-${n}`,
2192
+ label: n,
2193
+ entries: r
2194
+ }));
2195
+ }
2196
+ const Ke = (e) => {
2197
+ const i = e.renderEntry, s = v.useMemo(
2198
+ () => e.properties && e.properties.length > 0 ? e.properties : [{ id: "id", label: "ID" }],
2199
+ [e.properties]
2200
+ ), n = v.useMemo(
2201
+ () => de(
2202
+ e.viewSettings?.visiblePropertyIds ?? s.map((w) => w.id)
2203
+ ),
2204
+ [e.viewSettings?.visiblePropertyIds, s]
2205
+ ), r = v.useMemo(() => new Set(n), [n]), [l, a] = v.useState(e.entries), [o, u] = v.useState(null), [m, f] = v.useState(null);
2206
+ v.useEffect(() => {
2207
+ a(e.entries);
2208
+ }, [e.entries]);
2209
+ const x = e.groupBy ?? "status", d = typeof e.viewSettings?.sortBy == "string" ? e.viewSettings.sortBy : "updated", y = v.useMemo(
2210
+ () => e.viewSettings?.quickFilters ?? {},
2211
+ [e.viewSettings?.quickFilters]
2212
+ ), C = e.viewSettings?.sortRules ?? [], b = v.useMemo(
2213
+ () => e.viewSettings?.filter ?? {},
2214
+ [e.viewSettings?.filter]
2215
+ ), N = v.useMemo(
2216
+ () => Oe(l, b),
2217
+ [l, b]
2218
+ ), j = v.useMemo(
2219
+ () => Be(N, y),
2220
+ [N, y]
2221
+ ), M = Pe(j, C, d), c = Vs(M, x), S = (w, p) => {
2222
+ a(
2223
+ (E) => E.map(
2224
+ (z) => String(z?.id) === w ? {
2225
+ ...z,
2226
+ ...p
2227
+ } : z
2228
+ )
2229
+ );
2230
+ };
2231
+ return /* @__PURE__ */ t.jsx("div", { className: "h-full min-h-0 overflow-auto p-3", children: /* @__PURE__ */ t.jsx("div", { className: "flex min-w-max gap-3", children: c.map((w) => /* @__PURE__ */ t.jsxs(
2232
+ "div",
2233
+ {
2234
+ onDragEnter: (p) => {
2235
+ p.preventDefault(), f(w.key);
2236
+ },
2237
+ onDragOver: (p) => {
2238
+ p.preventDefault(), p.dataTransfer.dropEffect = "move";
2239
+ },
2240
+ onDragLeave: () => {
2241
+ m === w.key && f(null);
2242
+ },
2243
+ onDrop: (p) => {
2244
+ p.preventDefault();
2245
+ const E = p.dataTransfer.getData("text/plain") || o;
2246
+ E && (a((z) => {
2247
+ if (!z.find((R) => String(R?.id) === E) || !x)
2248
+ return z;
2249
+ const F = w.label === "Ungrouped" ? null : w.label;
2250
+ return z.map(
2251
+ (R) => String(R?.id) === E ? {
2252
+ ...R,
2253
+ [x]: F
2254
+ } : R
2255
+ );
2256
+ }), f(null), u(null));
2257
+ },
2258
+ className: `w-72 min-w-72 rounded border bg-[#111111] ${m === w.key ? "border-border-default" : "border-[#2A2A2A]"}`,
2259
+ children: [
2260
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center justify-between border-b border-border-default px-3 py-2 text-sm", children: [
2261
+ /* @__PURE__ */ t.jsx("span", { className: "text-text-primary", children: w.label }),
2262
+ /* @__PURE__ */ t.jsx("span", { className: "text-text-muted", children: w.entries.length })
2263
+ ] }),
2264
+ /* @__PURE__ */ t.jsx("div", { className: "flex flex-col gap-2 p-2", children: w.entries.map((p) => /* @__PURE__ */ t.jsx(
2265
+ "div",
2266
+ {
2267
+ draggable: !0,
2268
+ onDragStart: (E) => {
2269
+ const z = String(p?.id);
2270
+ u(z), E.dataTransfer.setData("text/plain", z), E.dataTransfer.effectAllowed = "move";
2271
+ },
2272
+ onDragEnd: () => {
2273
+ u(null), f(null);
2274
+ },
2275
+ className: `cursor-grab active:cursor-grabbing ${o && String(p?.id) === o ? "opacity-50" : ""}`,
2276
+ children: i ? /* @__PURE__ */ t.jsx(i, { entry: p }) : /* @__PURE__ */ t.jsx(
2277
+ Is,
2278
+ {
2279
+ entry: p,
2280
+ visiblePropertySet: r,
2281
+ onSummaryChange: (E) => {
2282
+ S(String(p?.id), { summary: E });
2283
+ },
2284
+ onPriorityChange: (E) => {
2285
+ S(String(p?.id), { priority: E });
2286
+ },
2287
+ onStatusChange: (E) => {
2288
+ S(String(p?.id), { status: E });
2289
+ },
2290
+ onIssueTypeChange: (E) => {
2291
+ S(String(p?.id), {
2292
+ entryType: E,
2293
+ type: E,
2294
+ issueType: E
2295
+ });
2296
+ }
2297
+ }
2298
+ )
2299
+ },
2300
+ p.id
2301
+ )) })
2302
+ ]
2303
+ },
2304
+ w.key
2305
+ )) }) });
2306
+ };
2307
+ function As({
2308
+ currentView: e,
2309
+ properties: i,
2310
+ viewSettings: s,
2311
+ setViewSettings: n,
2312
+ setCurrentView: r
2313
+ }) {
2314
+ const l = i.filter((c) => c.groupable), a = Es(i), o = de(
2315
+ s.visiblePropertyIds ?? a.map((c) => c.id)
2316
+ ), u = new Set(o), m = e.groupBy ?? "status", f = m ? i.find((c) => c.id === m)?.label ?? m : "None", x = s.filter ?? {}, d = Re(x), y = s.sortRules ?? [], C = [
2317
+ { value: "updated", label: "Updated" },
2318
+ { value: "priority", label: "Priority" },
2319
+ { value: "status", label: "Status" },
2320
+ { value: "assignee", label: "Assignee" },
2321
+ { value: "summary", label: "Summary" }
2322
+ ], b = y.length > 0 ? C.find((c) => c.value === y[0].property)?.label ?? y[0].property : "None", N = [
2323
+ { value: "summary", label: "Summary" },
2324
+ { value: "status", label: "Status" },
2325
+ { value: "priority", label: "Priority" },
2326
+ { value: "assignee", label: "Assignee" },
2327
+ { value: "id", label: "ID" }
2328
+ ], j = [
2329
+ { value: "is", label: "is", requiresValue: !0 },
2330
+ { value: "is_not", label: "is not", requiresValue: !0 },
2331
+ { value: "contains", label: "contains", requiresValue: !0 },
2332
+ { value: "is_empty", label: "is empty", requiresValue: !1 },
2333
+ { value: "is_not_empty", label: "is not empty", requiresValue: !1 }
2334
+ ], M = "type" in x && x.type === "group" ? x : le();
2335
+ return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
2336
+ /* @__PURE__ */ t.jsxs(T, { title: "View options", children: [
2337
+ /* @__PURE__ */ t.jsx(
2338
+ D,
2339
+ {
2340
+ icon: /* @__PURE__ */ t.jsx(Ie, { size: 14 }),
2341
+ label: "Filter",
2342
+ submenu: "filter",
2343
+ trailing: /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
2344
+ d > 0 ? `${d} active` : "None",
2345
+ /* @__PURE__ */ t.jsx($, { size: 14 })
2346
+ ] })
2347
+ }
2348
+ ),
2349
+ /* @__PURE__ */ t.jsx(
2350
+ D,
2351
+ {
2352
+ icon: /* @__PURE__ */ t.jsx(se, { size: 14 }),
2353
+ label: "Properties",
2354
+ submenu: "properties",
2355
+ trailing: /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
2356
+ o.length,
2357
+ /* @__PURE__ */ t.jsx($, { size: 14 })
2358
+ ] })
2359
+ }
2360
+ ),
2361
+ /* @__PURE__ */ t.jsx(
2362
+ D,
2363
+ {
2364
+ icon: /* @__PURE__ */ t.jsx(ne, { size: 14 }),
2365
+ label: "Group",
2366
+ submenu: "group",
2367
+ trailing: /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
2368
+ f,
2369
+ /* @__PURE__ */ t.jsx($, { size: 14 })
2370
+ ] })
2371
+ }
2372
+ ),
2373
+ /* @__PURE__ */ t.jsx(
2374
+ D,
2375
+ {
2376
+ icon: /* @__PURE__ */ t.jsx(Ve, { size: 14 }),
2377
+ label: "Sort",
2378
+ submenu: "sort",
2379
+ trailing: /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
2380
+ b,
2381
+ /* @__PURE__ */ t.jsx($, { size: 14 })
2382
+ ] })
2383
+ }
2384
+ )
2385
+ ] }),
2386
+ /* @__PURE__ */ t.jsx(L, { id: "properties", title: "Properties", children: /* @__PURE__ */ t.jsx(T, { title: "Visible columns", children: a.map((c) => /* @__PURE__ */ t.jsx(
2387
+ D,
2388
+ {
2389
+ label: c.label,
2390
+ active: u.has(c.id),
2391
+ disabled: c.id === "summary",
2392
+ trailing: /* @__PURE__ */ t.jsx(t.Fragment, { children: u.has(c.id) ? "Visible" : "Hidden" }),
2393
+ onClick: () => {
2394
+ if (c.id === "summary")
2395
+ return;
2396
+ const S = u.has(c.id), w = S ? o.filter((p) => p !== c.id) : [...o, c.id];
2397
+ n({ visiblePropertyIds: de(w) }), S && e.groupBy === c.id && r({
2398
+ ...e,
2399
+ groupBy: null
2400
+ });
2401
+ }
2402
+ },
2403
+ c.id
2404
+ )) }) }),
2405
+ /* @__PURE__ */ t.jsx(L, { id: "filter", title: "Filter", children: /* @__PURE__ */ t.jsx(T, { children: /* @__PURE__ */ t.jsx("div", { className: "px-2", children: /* @__PURE__ */ t.jsx(
2406
+ ee,
2407
+ {
2408
+ title: "Filter",
2409
+ value: M,
2410
+ onChange: (c) => {
2411
+ r({
2412
+ ...e,
2413
+ settings: {
2414
+ ...e.settings ?? {},
2415
+ filter: c
2416
+ }
2417
+ });
2418
+ },
2419
+ fields: N,
2420
+ operators: j,
2421
+ variant: "ghost"
2422
+ }
2423
+ ) }) }) }),
2424
+ /* @__PURE__ */ t.jsx(L, { id: "group", title: "Group", children: /* @__PURE__ */ t.jsx(T, { title: "Group by", children: l.length > 0 ? l.map((c) => /* @__PURE__ */ t.jsx(
2425
+ D,
2426
+ {
2427
+ label: c.label,
2428
+ active: e.groupBy === c.id,
2429
+ onClick: () => {
2430
+ r({
2431
+ ...e,
2432
+ groupBy: c.id
2433
+ });
2434
+ }
2435
+ },
2436
+ c.id
2437
+ )) : /* @__PURE__ */ t.jsx(D, { label: "No groupable properties", disabled: !0 }) }) }),
2438
+ /* @__PURE__ */ t.jsx(L, { id: "sort", title: "Sort", children: /* @__PURE__ */ t.jsx(T, { children: /* @__PURE__ */ t.jsx("div", { className: "px-2", children: /* @__PURE__ */ t.jsx(
2439
+ te,
2440
+ {
2441
+ title: "Sort",
2442
+ value: y,
2443
+ onChange: (c) => {
2444
+ n({ sortRules: c });
2445
+ },
2446
+ fields: C,
2447
+ variant: "ghost"
2448
+ }
2449
+ ) }) }) })
2450
+ ] });
2451
+ }
2452
+ Ke.SettingsMenu = As;
2453
+ function Ds() {
2454
+ const e = Q(), i = e.currentView, s = e.properties;
2455
+ if (!i)
2456
+ return null;
2457
+ const n = i.settings ?? {}, r = n.sortRules ?? [], l = s.filter((b) => b.groupable), a = [
2458
+ { value: "summary", label: "Summary" },
2459
+ { value: "status", label: "Status" },
2460
+ { value: "priority", label: "Priority" },
2461
+ { value: "assignee", label: "Assignee" },
2462
+ { value: "id", label: "ID" }
2463
+ ], o = [
2464
+ { value: "is", label: "is", requiresValue: !0 },
2465
+ { value: "is_not", label: "is not", requiresValue: !0 },
2466
+ { value: "contains", label: "contains", requiresValue: !0 },
2467
+ { value: "is_empty", label: "is empty", requiresValue: !1 },
2468
+ { value: "is_not_empty", label: "is not empty", requiresValue: !1 }
2469
+ ], u = [
2470
+ { value: "updated", label: "Updated" },
2471
+ { value: "priority", label: "Priority" },
2472
+ { value: "status", label: "Status" },
2473
+ { value: "assignee", label: "Assignee" },
2474
+ { value: "summary", label: "Summary" }
2475
+ ], m = n.filter && typeof n.filter == "object" && "type" in n.filter ? n.filter : le(), f = !!i.groupBy, x = r.length > 0, d = Le(n.filter), y = e.setCurrentView, C = (b) => {
2476
+ y({
2477
+ ...i,
2478
+ settings: {
2479
+ ...i.settings ?? {},
2480
+ ...b
2481
+ }
2482
+ });
2483
+ };
2484
+ return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
2485
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-1", children: [
2486
+ /* @__PURE__ */ t.jsx(
2487
+ K,
2488
+ {
2489
+ title: /* @__PURE__ */ t.jsx(ne, { size: 16, stroke: "#8D8D8D" }),
2490
+ kind: "icon",
2491
+ variant: f ? "accent" : "ghost",
2492
+ showCaret: !1,
2493
+ children: /* @__PURE__ */ t.jsxs("div", { className: "w-56 p-1", children: [
2494
+ /* @__PURE__ */ t.jsx(B, { onSelect: () => y({ ...i, groupBy: null }), children: "None" }),
2495
+ l.map((b) => /* @__PURE__ */ t.jsx(
2496
+ B,
2497
+ {
2498
+ onSelect: () => y({ ...i, groupBy: b.id }),
2499
+ children: b.label
2500
+ },
2501
+ b.id
2502
+ ))
2503
+ ] })
2504
+ }
2505
+ ),
2506
+ f ? /* @__PURE__ */ t.jsx(A, { kind: "icon", variant: "ghost", onClick: () => y({ ...i, groupBy: null }), children: /* @__PURE__ */ t.jsx(P, { size: 14, stroke: "#8D8D8D" }) }) : null
2507
+ ] }),
2508
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-1", children: [
2509
+ /* @__PURE__ */ t.jsx(
2510
+ te,
2511
+ {
2512
+ title: "Sort",
2513
+ kind: "icon",
2514
+ variant: x ? "accent" : "ghost",
2515
+ showCaret: !1,
2516
+ value: r,
2517
+ onChange: (b) => C({ sortRules: b }),
2518
+ fields: u
2519
+ }
2520
+ ),
2521
+ x ? /* @__PURE__ */ t.jsx(A, { kind: "icon", variant: "ghost", onClick: () => C({ sortRules: [] }), children: /* @__PURE__ */ t.jsx(P, { size: 14, stroke: "#8D8D8D" }) }) : null
2522
+ ] }),
2523
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-1", children: [
2524
+ /* @__PURE__ */ t.jsx(
2525
+ ee,
2526
+ {
2527
+ title: "Filter",
2528
+ kind: "icon",
2529
+ variant: d ? "accent" : "ghost",
2530
+ showCaret: !1,
2531
+ value: m,
2532
+ onChange: (b) => C({ filter: b }),
2533
+ fields: a,
2534
+ operators: o
2535
+ }
2536
+ ),
2537
+ d ? /* @__PURE__ */ t.jsx(A, { kind: "icon", variant: "ghost", onClick: () => C({ filter: void 0 }), children: /* @__PURE__ */ t.jsx(P, { size: 14, stroke: "#8D8D8D" }) }) : null
2538
+ ] })
2539
+ ] });
2540
+ }
2541
+ Ke.ToolbarActions = Ds;
2542
+ function zs({ entry: e }) {
2543
+ return /* @__PURE__ */ t.jsx("div", { className: "flex items-center px-6 border-b border-[#2A2A2A] h-11 bg-[#141414]", children: e.id });
2544
+ }
2545
+ const Ps = (e) => {
2546
+ const i = e.renderEntry ?? zs;
2547
+ return /* @__PURE__ */ t.jsxs("div", { children: [
2548
+ /* @__PURE__ */ t.jsx("h1", { children: "Gantt Layout" }),
2549
+ e.entries.map((s) => /* @__PURE__ */ t.jsx(i, { entry: s }, s.id))
2550
+ ] });
2551
+ };
2552
+ export {
2553
+ Ts as MtCollection,
2554
+ Ke as MtCollectionBoardLayout,
2555
+ Ps as MtCollectionGanttLayout,
2556
+ Rs as MtCollectionGridLayout,
2557
+ Ue as MtCollectionListLayout,
2558
+ Ls as MtCollectionTableLayout,
2559
+ Ht as MtCollectionToolbar,
2560
+ Qt as MtCollectionViewSettings
2561
+ };