@parallelworks/tandem-web 0.166.0 → 0.167.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.
package/pages/issues.js CHANGED
@@ -2,480 +2,521 @@ import { basePath as e } from "../lib/base.js";
2
2
  import { ErrorMessage as t } from "../components/status.js";
3
3
  import { usePageTitle as n } from "../lib/pageTitle.js";
4
4
  import { useNavigate as r } from "../lib/router.js";
5
- import { cyclesQuery as i, issueCountsQuery as a, issuePagesQuery as ee, labelsQuery as te, meQuery as ne, projectsQuery as o, statusesQuery as re, teamsQuery as ie } from "../api/queries.js";
6
- import { BoardIcon as ae, ChartIcon as oe, CloseIcon as se, DownloadIcon as ce, ListViewIcon as le, SidePanelIcon as ue, UploadIcon as de, usePriorityNames as fe } from "../components/icons.js";
7
- import { useNewIssue as pe } from "../lib/newIssue.js";
8
- import { usePeople as me } from "../lib/people.js";
9
- import { useIssueMenu as he } from "../lib/issueMenu.js";
10
- import { projectRef as ge } from "../lib/projects.js";
11
- import { useCan as _e } from "../lib/roles.js";
12
- import { customFieldsQuery as ve, fieldRef as ye, fieldsForTeams as be, groupableKinds as xe, sortableKinds as Se } from "../lib/customFields.js";
13
- import { useBoardMove as Ce } from "../lib/boardMove.js";
14
- import { issueTypesQuery as we } from "../lib/issueTypes.js";
15
- import { isViewAt as Te, viewRef as Ee } from "../lib/refs.js";
16
- import { groupIssues as De, groupings as Oe, isGrouping as ke, isOrder as Ae, issueFilterOf as je, orders as Me, sortIssues as Ne, views as Pe } from "../lib/issueList.js";
17
- import { issuesHref as Fe } from "../lib/teamPaths.js";
18
- import { ViewDialog as Ie } from "../components/ViewDialog.js";
19
- import { filtersOf as Le, sameFilters as Re, useSavedViews as ze, viewSearch as Be } from "../lib/views.js";
20
- import { IssueBoard as Ve } from "../components/IssueBoard.js";
21
- import { useIssueFilters as He, withIssueFilters as Ue } from "../components/IssueFilters.js";
5
+ import { cyclesQuery as i, issueCountsQuery as a, issueOrders as ee, issuePagesQuery as te, labelsQuery as ne, meQuery as o, projectsQuery as re, statusesQuery as ie, teamsQuery as ae } from "../api/queries.js";
6
+ import { BoardIcon as oe, ChartIcon as se, CloseIcon as ce, DownloadIcon as le, ListViewIcon as ue, SidePanelIcon as de, UploadIcon as fe, usePriorityNames as pe } from "../components/icons.js";
7
+ import { useNewIssue as me } from "../lib/newIssue.js";
8
+ import { usePeople as he } from "../lib/people.js";
9
+ import { useIssueMenu as ge } from "../lib/issueMenu.js";
10
+ import { projectRef as _e } from "../lib/projects.js";
11
+ import { useCan as ve } from "../lib/roles.js";
12
+ import { customFieldsQuery as ye, fieldRef as be, fieldsForTeams as xe, groupableKinds as Se, sortableKinds as Ce } from "../lib/customFields.js";
13
+ import { useBoardMove as we } from "../lib/boardMove.js";
14
+ import { issueTypesQuery as Te } from "../lib/issueTypes.js";
15
+ import { isViewAt as Ee, viewRef as De } from "../lib/refs.js";
16
+ import { groupIssues as Oe, groupings as ke, isGrouping as Ae, isOrder as je, issueFilterOf as Me, orders as Ne, sortIssues as Pe, views as Fe } from "../lib/issueList.js";
17
+ import { issuesHref as Ie } from "../lib/teamPaths.js";
18
+ import { ViewDialog as Le } from "../components/ViewDialog.js";
19
+ import { filtersOf as Re, sameFilters as ze, useSavedViews as Be, viewSearch as Ve } from "../lib/views.js";
20
+ import { IssueBoard as He } from "../components/IssueBoard.js";
21
+ import { useIssueFilters as Ue, withIssueFilters as We } from "../components/IssueFilters.js";
22
22
  import { IssueRow as s } from "../components/IssueRow.js";
23
- import { useShortcuts as We } from "../lib/shortcuts.js";
24
- import { usePaletteSelection as Ge } from "../lib/palette.js";
25
- import { useLive as Ke } from "../lib/live.js";
26
- import { FavoriteStar as qe } from "../components/FavoriteStar.js";
27
- import { DisplayMenu as Je } from "../components/DisplayMenu.js";
28
- import { IssueBreakdown as Ye, breakdownKeys as Xe } from "../components/IssueBreakdown.js";
29
- import { IssueGroupList as Ze } from "../components/IssueGroupList.js";
30
- import { IssueImport as Qe, pickCsv as $e } from "../components/IssueImport.js";
31
- import { IssueInsights as et } from "../components/IssueInsights.js";
32
- import { insightsKey as tt, listTabs as nt, panelKey as rt, shownFields as it, storeDisplay as at, storeShownFields as ot, storedDisplay as st, withParam as c } from "../lib/issueDisplay.js";
33
- import { ActionMenu as ct, Button as l, ConfirmModal as lt, Field as ut, IconButton as u, SearchInput as dt, Select as ft, Tabs as pt, useOpenMenu as mt } from "@parallelworks/ui";
34
- import { useParams as ht, useSearch as gt } from "@tanstack/react-router";
35
- import { memo as d, useCallback as _t, useEffect as f, useMemo as p, useRef as m, useState as h } from "react";
36
- import { useTranslations as g } from "use-intl";
37
- import { Fragment as vt, jsx as _, jsxs as v } from "react/jsx-runtime";
38
- import { keepPreviousData as yt, useInfiniteQuery as bt, useQuery as y, useSuspenseQuery as xt } from "@tanstack/react-query";
39
- import { ListFilterBar as St, ListFilterMenu as Ct, ListSkeleton as wt } from "@parallelworks/ui/list";
23
+ import { useShortcuts as Ge } from "../lib/shortcuts.js";
24
+ import { usePaletteSelection as Ke } from "../lib/palette.js";
25
+ import { useLive as qe } from "../lib/live.js";
26
+ import { FavoriteStar as Je } from "../components/FavoriteStar.js";
27
+ import { DisplayMenu as Ye } from "../components/DisplayMenu.js";
28
+ import { IssueBreakdown as Xe, breakdownKeys as Ze } from "../components/IssueBreakdown.js";
29
+ import { IssueGroupList as Qe } from "../components/IssueGroupList.js";
30
+ import { IssueImport as $e, pickCsv as et } from "../components/IssueImport.js";
31
+ import { IssueInsights as tt } from "../components/IssueInsights.js";
32
+ import { insightsKey as nt, listTabs as rt, panelKey as it, shownFields as at, storeDisplay as ot, storeShownFields as st, storedDisplay as ct, withParam as c } from "../lib/issueDisplay.js";
33
+ import { pagedGroupings as lt, usePagedGroups as ut } from "../lib/pagedGroups.js";
34
+ import { ActionMenu as dt, Button as l, ConfirmModal as ft, Field as pt, IconButton as u, SearchInput as mt, Select as ht, Tabs as gt, useOpenMenu as _t } from "@parallelworks/ui";
35
+ import { useParams as vt, useSearch as yt } from "@tanstack/react-router";
36
+ import { memo as bt, useCallback as xt, useEffect as d, useMemo as f, useRef as p, useState as m } from "react";
37
+ import { useTranslations as h } from "use-intl";
38
+ import { Fragment as St, jsx as g, jsxs as _ } from "react/jsx-runtime";
39
+ import { keepPreviousData as Ct, useInfiniteQuery as wt, useQuery as v, useSuspenseQuery as Tt } from "@tanstack/react-query";
40
+ import { ListFilterBar as Et, ListFilterMenu as Dt, ListSkeleton as Ot } from "@parallelworks/ui/list";
40
41
  // src/pages/issues.tsx
41
- var Tt = {
42
+ var kt = {
42
43
  status: "status",
43
44
  priority: "priority",
44
45
  project: "project",
45
46
  type: "type"
46
- }, Et = [];
47
- function Dt(e) {
47
+ }, At = [];
48
+ function jt(e) {
48
49
  let { assignee: t, creator: n, ...r } = e;
49
50
  return n ? {
50
51
  ...r,
51
52
  creator: n
52
53
  } : r;
53
54
  }
54
- function b({ person: e } = {}) {
55
- let s = g("issues"), d = g("planning"), { workspace: b, key: jt } = ht({ strict: !1 }), x = gt({ strict: !1 }), S = jt ? {
56
- ...x,
57
- team: jt
58
- } : e ? x.creator ? {
59
- ...Dt(x),
55
+ function Mt({ person: e } = {}) {
56
+ let s = h("issues"), bt = h("planning"), Mt = h("common"), { workspace: y, key: It } = vt({ strict: !1 }), b = yt({ strict: !1 }), x = It ? {
57
+ ...b,
58
+ team: It
59
+ } : e ? b.creator ? {
60
+ ...jt(b),
60
61
  creator: e
61
62
  } : {
62
- ...x,
63
+ ...b,
63
64
  assignee: e
64
- } : x, Mt = r(), Nt = (t) => e ? Fe(b, { ...Dt(t) }).replace(`/${b}/issues`, `/${b}/people/${encodeURIComponent(e)}`) : Fe(b, { ...t }), C = (t, n) => {
65
+ } : b, Lt = r(), Rt = (t) => e ? Ie(y, { ...jt(t) }).replace(`/${y}/issues`, `/${y}/people/${encodeURIComponent(e)}`) : Ie(y, { ...t }), S = (t, n) => {
65
66
  let { team: r, ...i } = t;
66
- return Mt(e ? {
67
+ return Lt(e ? {
67
68
  to: "/$workspace/people/$username",
68
69
  params: {
69
- workspace: b,
70
+ workspace: y,
70
71
  username: e
71
72
  },
72
- search: Dt(i),
73
+ search: jt(i),
73
74
  ...n && { replace: n }
74
75
  } : r ? {
75
76
  to: "/$workspace/teams/$key/issues",
76
77
  params: {
77
- workspace: b,
78
+ workspace: y,
78
79
  key: r
79
80
  },
80
81
  search: i,
81
82
  ...n && { replace: n }
82
83
  } : {
83
84
  to: "/$workspace/issues",
84
- params: { workspace: b },
85
+ params: { workspace: y },
85
86
  search: i,
86
87
  ...n && { replace: n }
87
88
  });
88
- }, Pt = m((e) => C(e, !0));
89
- Pt.current = (e) => C(e, !0);
90
- let Ft = m((e) => C(c(S, "q", e), !0));
91
- Ft.current = (e) => C(c(S, "q", e), !0);
92
- let { data: It } = xt(ne), { data: w } = xt(ie(b)), Lt = pe(), T = S.view ?? "active", [E, Rt] = h(S.q ?? ""), zt = m(null);
93
- f(() => {
89
+ }, zt = p((e) => S(e, !0));
90
+ zt.current = (e) => S(e, !0);
91
+ let Bt = p((e) => S(c(x, "q", e), !0));
92
+ Bt.current = (e) => S(c(x, "q", e), !0);
93
+ let { data: Vt } = Tt(o), { data: C } = Tt(ae(y)), Ht = me(), w = x.view ?? "active", [T, Ut] = m(x.q ?? ""), Wt = p(null);
94
+ d(() => {
94
95
  let e = setTimeout(() => {
95
- (S.q ?? "") !== E && Ft.current(E);
96
+ (x.q ?? "") !== T && Bt.current(T);
96
97
  }, 250);
97
98
  return () => clearTimeout(e);
98
- }, [E, S.q]);
99
- let { data: Bt } = y({
100
- ...re(b, S.team ?? ""),
101
- enabled: !!S.status && !!S.team
102
- }), Vt = je(S, Bt), { data: D, error: O, isFetching: Ht, hasNextPage: Ut, isFetchingNextPage: Wt, fetchNextPage: Gt } = bt({
103
- ...ee(b, Vt),
104
- placeholderData: yt,
105
- enabled: !S.status || !S.team || !!Bt
106
- });
107
- f(() => {
108
- Ut && !Wt && !O && Gt();
109
- }, [
110
- Ut,
111
- Wt,
112
- O,
113
- Gt
114
- ]);
115
- let k = !!Ut, A = p(() => D?.pages.flatMap((e) => e.issues) ?? [], [D]), Kt = fe(), { nameOf: qt, avatarOf: Jt } = me(b), j = S.saved ? {} : st(), { data: Yt } = y(ve(b)), M = w.find((e) => e.key === S.team), N = p(() => be(Yt, M ? [M.id] : w.map((e) => e.id)), [
116
- Yt,
117
- M,
118
- w
119
- ]), P = g("customFields"), Xt = g("issueTypes"), { data: Zt } = y(we(b)), Qt = p(() => (Zt ?? []).filter((e) => !e.archivedAt && (!M || e.teamIds.length === 0 || e.teamIds.includes(M.id))), [Zt, M]), F = Ae(S.order, N) ? S.order : Ae(j.order, N) ? j.order : "updated", I = ke(S.group, N) ? S.group : ke(j.group, N) ? j.group : "status", $t = N.find((e) => e.id === ye(I)), [en, tn] = h(() => it(b)), nn = p(() => N.filter((e) => en.includes(e.id)), [N, en]), L = S.layout === "board" || !S.layout && j.layout === "board", [rn, an] = h(() => {
99
+ }, [T, x.q]);
100
+ let { data: Gt } = v({
101
+ ...ie(y, x.team ?? ""),
102
+ enabled: !!x.status && !!x.team
103
+ }), Kt = Me(x, Gt), qt = !x.status || !x.team || !!Gt, Jt = pe(), { nameOf: Yt, avatarOf: Xt } = he(y), E = x.saved ? {} : ct(), { data: Zt } = v(ye(y)), D = C.find((e) => e.key === x.team), O = f(() => xe(Zt, D ? [D.id] : C.map((e) => e.id)), [
104
+ Zt,
105
+ D,
106
+ C
107
+ ]), k = h("customFields"), Qt = h("issueTypes"), { data: $t } = v(Te(y)), en = f(() => ($t ?? []).filter((e) => !e.archivedAt && (!D || e.teamIds.length === 0 || e.teamIds.includes(D.id))), [$t, D]), A = je(x.order, O) ? x.order : je(E.order, O) ? E.order : "updated", j = Ae(x.group, O) ? x.group : Ae(E.group, O) ? E.group : "status", tn = O.find((e) => e.id === be(j)), [nn, rn] = m(() => at(y)), an = f(() => O.filter((e) => nn.includes(e.id)), [O, nn]), M = x.layout === "board" || !x.layout && E.layout === "board", [on, sn] = m(() => {
120
108
  try {
121
- return localStorage.getItem(rt) !== "hidden";
109
+ return localStorage.getItem(it) !== "hidden";
122
110
  } catch {
123
111
  return !0;
124
112
  }
125
- }), on = () => an((e) => {
113
+ }), cn = () => sn((e) => {
126
114
  try {
127
- localStorage.setItem(rt, e ? "hidden" : "shown");
115
+ localStorage.setItem(it, e ? "hidden" : "shown");
128
116
  } catch {}
129
117
  return !e;
130
- }), [sn, cn] = h(() => {
118
+ }), [ln, un] = m(() => {
131
119
  try {
132
- return localStorage.getItem(tt) === "shown";
120
+ return localStorage.getItem(nt) === "shown";
133
121
  } catch {
134
122
  return !1;
135
123
  }
136
- }), ln = () => cn((e) => {
124
+ }), dn = () => un((e) => {
137
125
  try {
138
- localStorage.setItem(tt, e ? "hidden" : "shown");
126
+ localStorage.setItem(nt, e ? "hidden" : "shown");
139
127
  } catch {}
140
128
  return !e;
141
- }), [un, dn] = h("assignees"), [R, fn] = h(null), z = R ? A.filter((e) => Xe(e, R.tab).includes(R.key)) : A, B = p(() => De(Ne(z, F, N), I, {
129
+ }), [fn, pn] = m("assignees"), [N, mn] = m(null), P = !M && !N && !x.status && lt.includes(j) && ee.includes(A) ? j : void 0, F = wt({
130
+ ...te(y, Kt),
131
+ placeholderData: Ct,
132
+ enabled: qt && !P
133
+ }), { hasNextPage: hn, isFetchingNextPage: gn, fetchNextPage: _n } = F;
134
+ d(() => {
135
+ !P && hn && !gn && !F.error && _n();
136
+ }, [
137
+ P,
138
+ hn,
139
+ gn,
140
+ F.error,
141
+ _n
142
+ ]);
143
+ let I = v({
144
+ ...a(y, Re(x), P ?? "status"),
145
+ placeholderData: Ct,
146
+ enabled: qt && !!P
147
+ }), L = ut(y, Kt, P ?? "status", A, I.data?.byKey, qt && !!P), R = P ? I.data : F.data, vn = P ? I.error ?? L.error : F.error, yn = P ? I.isFetching : F.isFetching, z = P ? L.fetching : !!hn, B = P ? L.complete : !hn, V = f(() => P ? [...L.issues.values()].flat() : F.data?.pages.flatMap((e) => e.issues) ?? [], [
148
+ P,
149
+ L.issues,
150
+ F.data
151
+ ]), { data: bn } = v({
152
+ ...re(y),
153
+ enabled: P === "project"
154
+ }), xn = N ? V.filter((e) => Ze(e, N.tab).includes(N.key)) : V, Sn = f(() => Oe(Pe(xn, A, O), j, {
142
155
  status: (e) => s(`groups.${e}`),
143
- priority: (e) => Kt[e] ?? "",
144
- person: qt,
145
- avatar: Jt,
156
+ priority: (e) => Jt[e] ?? "",
157
+ person: Yt,
158
+ avatar: Xt,
146
159
  none: {
147
160
  assignee: s("noAssignee"),
148
161
  project: s("noProject"),
149
162
  label: s("noLabel"),
150
163
  all: s("all")
151
164
  },
152
- noField: (e) => P("noField", { name: e }),
153
- yes: P("yes"),
154
- noType: Xt("noType")
155
- }, L, N, Qt), [
156
- z,
157
- F,
158
- I,
159
- s,
165
+ noField: (e) => k("noField", { name: e }),
166
+ yes: k("yes"),
167
+ noType: Qt("noType")
168
+ }, M || !!P, O, en), [
160
169
  P,
161
- Xt,
162
- Kt,
163
- qt,
170
+ xn,
171
+ A,
172
+ j,
173
+ s,
174
+ k,
175
+ Qt,
164
176
  Jt,
165
- L,
166
- N,
167
- Qt
168
- ]), V = p(() => B.flatMap((e) => e.issues), [B]), pn = p(() => new Map(V.map((e, t) => [e.id, t])), [V]), mn = !R && !S.status ? Tt[I] : void 0, { data: hn } = y({
169
- ...a(b, Le(S), mn ?? "status"),
170
- enabled: k && !!mn
171
- }), gn = _t((e) => k && hn?.byKey.get(e.key) || e.issues.length, [k, hn]), _n = p(() => new Map(w.map((e) => [e.id, e])), [w]), [vn, yn] = h(0), H = V[Math.min(vn, V.length - 1)], [U, W] = h(/* @__PURE__ */ new Set()), bn = m(null), xn = he(b), Sn = Ce(b, w), { people: Cn } = Ke(), wn = p(() => {
177
+ Yt,
178
+ Xt,
179
+ M,
180
+ O,
181
+ en
182
+ ]), H = f(() => {
183
+ if (!P) return Sn;
184
+ let e = I.data?.byKey, t = Sn;
185
+ if (P === "project") {
186
+ let n = new Set(t.map((e) => e.key));
187
+ t = [...[...t.filter((e) => e.key !== "none"), ...[...e?.keys() ?? []].filter((e) => e !== "none" && !n.has(e)).map((e) => ({
188
+ key: e,
189
+ label: bn?.find((t) => t.id === e)?.name ?? "",
190
+ issues: []
191
+ }))].sort((e, t) => e.label.localeCompare(t.label)), ...t.filter((e) => e.key === "none")];
192
+ }
193
+ return t.filter((t) => (e?.get(t.key) ?? 0) > 0).map((e) => ({
194
+ ...e,
195
+ more: L.more(e.key)
196
+ }));
197
+ }, [
198
+ P,
199
+ Sn,
200
+ I.data,
201
+ bn,
202
+ L.more
203
+ ]), U = f(() => H.flatMap((e) => e.issues), [H]), Cn = f(() => new Map(U.map((e, t) => [e.id, t])), [U]), wn = !N && !x.status ? kt[j] : void 0, { data: Tn } = v({
204
+ ...a(y, Re(x), wn ?? "status"),
205
+ enabled: z && !!wn
206
+ }), En = xt((e) => P ? I.data?.byKey.get(e.key) ?? e.issues.length : z && Tn?.byKey.get(e.key) || e.issues.length, [
207
+ P,
208
+ I.data,
209
+ z,
210
+ Tn
211
+ ]), Dn = f(() => new Map(C.map((e) => [e.id, e])), [C]), [On, kn] = m(0), W = U[Math.min(On, U.length - 1)], [G, K] = m(/* @__PURE__ */ new Set()), An = p(null), jn = ge(y), Mn = we(y, C), { people: Nn } = qe(), Pn = f(() => {
172
212
  let e = /* @__PURE__ */ new Map();
173
- for (let t of Cn) {
174
- if (!t.identifier || t.username === It?.user.username) continue;
213
+ for (let t of Nn) {
214
+ if (!t.identifier || t.username === Vt?.user.username) continue;
175
215
  let n = e.get(t.identifier) ?? /* @__PURE__ */ new Set();
176
216
  n.add(t.username), e.set(t.identifier, n);
177
217
  }
178
218
  return new Map([...e].map(([e, t]) => [e, [...t]]));
179
- }, [Cn, It?.user.username]), Tn = mt(), En = p(() => V.filter((e) => U.has(e.id)), [V, U]);
180
- Ge(En);
181
- let Dn = (e) => W((t) => {
219
+ }, [Nn, Vt?.user.username]), Fn = _t(), In = f(() => U.filter((e) => G.has(e.id)), [U, G]);
220
+ Ke(In);
221
+ let Ln = (e) => K((t) => {
182
222
  let n = new Set(t);
183
223
  return n.has(e) ? n.delete(e) : n.add(e), n;
184
- }), On = (e) => {
185
- (bn.current === null || U.size === 0) && (bn.current = Math.max(vn, 0));
186
- let t = bn.current, [n, r] = t < e ? [t, e] : [e, t];
187
- W(new Set(V.slice(n, r + 1).map((e) => e.id)));
188
- }, G = (e, t) => {
189
- let n = V[e];
224
+ }), Rn = (e) => {
225
+ (An.current === null || G.size === 0) && (An.current = Math.max(On, 0));
226
+ let t = An.current, [n, r] = t < e ? [t, e] : [e, t];
227
+ K(new Set(U.slice(n, r + 1).map((e) => e.id)));
228
+ }, q = (e, t) => {
229
+ let n = U[e];
190
230
  if (n) {
191
- if (t) return On(e);
192
- Dn(n.id), bn.current = e;
231
+ if (t) return Rn(e);
232
+ Ln(n.id), An.current = e;
193
233
  }
194
- }, kn = (e, t) => {
195
- (e.metaKey || e.ctrlKey || e.shiftKey) && (e.preventDefault(), G(t, e.shiftKey));
196
- }, K = (e, t) => {
197
- let n = Math.min(Math.max(vn + e, 0), V.length - 1);
198
- t && On(n), yn(n);
199
- }, An = (e, t) => {
200
- let n = U.has(t.id) ? V.filter((e) => U.has(e.id)) : [t];
201
- U.has(t.id) || W(/* @__PURE__ */ new Set()), Tn(e, xn(n));
202
- }, jn = m({
203
- pick: G,
204
- select: yn,
205
- click: kn,
206
- menu: An
234
+ }, zn = (e, t) => {
235
+ (e.metaKey || e.ctrlKey || e.shiftKey) && (e.preventDefault(), q(t, e.shiftKey));
236
+ }, J = (e, t) => {
237
+ let n = Math.min(Math.max(On + e, 0), U.length - 1);
238
+ t && Rn(n), kn(n);
239
+ }, Bn = (e, t) => {
240
+ let n = G.has(t.id) ? U.filter((e) => G.has(e.id)) : [t];
241
+ G.has(t.id) || K(/* @__PURE__ */ new Set()), Fn(e, jn(n));
242
+ }, Vn = p({
243
+ pick: q,
244
+ select: kn,
245
+ click: zn,
246
+ menu: Bn
207
247
  });
208
- jn.current = {
209
- pick: G,
210
- select: yn,
211
- click: kn,
212
- menu: An
248
+ Vn.current = {
249
+ pick: q,
250
+ select: kn,
251
+ click: zn,
252
+ menu: Bn
213
253
  };
214
- let [q, Mn] = h(!1);
215
- f(() => {
216
- q && !k && (W(new Set(V.map((e) => e.id))), Mn(!1));
254
+ let [Y, Hn] = m(!1);
255
+ d(() => {
256
+ Y && (B || vn) && (K(new Set(U.map((e) => e.id))), Hn(!1));
217
257
  }, [
218
- q,
219
- k,
220
- V
258
+ Y,
259
+ B,
260
+ vn,
261
+ U
221
262
  ]);
222
- let { data: Nn } = y({
223
- ...a(b, Le(S), "status"),
224
- enabled: q
225
- }), Pn = () => {
226
- W(new Set(V.map((e) => e.id))), Mn(k);
227
- }, Fn = () => {
228
- W(/* @__PURE__ */ new Set()), Mn(!1);
229
- }, In = m(null), Ln = (e) => {
230
- if (q) return;
231
- let t = U.size > 0 ? En : H ? [H] : [];
263
+ let { data: Un } = v({
264
+ ...a(y, Re(x), "status"),
265
+ enabled: Y
266
+ }), Wn = () => {
267
+ K(new Set(U.map((e) => e.id))), P && L.loadAll(), Hn(!B);
268
+ }, Gn = () => {
269
+ K(/* @__PURE__ */ new Set()), Hn(!1);
270
+ }, Kn = p(null), qn = (e) => {
271
+ if (Y) return;
272
+ let t = G.size > 0 ? In : W ? [W] : [];
232
273
  if (t.length === 0) return;
233
- let n = xn(t).find((t) => "shortcut" in t && t.shortcut === e);
274
+ let n = jn(t).find((t) => "shortcut" in t && t.shortcut === e);
234
275
  return n && "label" in n && !n.disabled ? n : void 0;
235
- }, J = (e) => () => {
236
- let t = Ln(e), n = U.size > 0 && In.current || H && document.getElementById(`row-${H.id}`);
237
- t && "items" in t && t.items && n && Tn(n, t.items);
238
- }, [Rn, zn] = h(null), Bn = () => {
239
- let e = Ln("⌫");
240
- e && "onClick" in e && zn(() => e.onClick);
276
+ }, X = (e) => () => {
277
+ let t = qn(e), n = G.size > 0 && Kn.current || W && document.getElementById(`row-${W.id}`);
278
+ t && "items" in t && t.items && n && Fn(n, t.items);
279
+ }, [Jn, Yn] = m(null), Xn = () => {
280
+ let e = qn("⌫");
281
+ e && "onClick" in e && Yn(() => e.onClick);
241
282
  };
242
- We({
243
- ...!L && {
244
- j: () => K(1, !1),
245
- k: () => K(-1, !1),
246
- J: () => K(1, !0),
247
- K: () => K(-1, !0),
248
- ArrowDown: (e) => K(1, e.shiftKey),
249
- ArrowUp: (e) => K(-1, e.shiftKey),
250
- x: () => H && G(V.indexOf(H), !1),
251
- X: () => H && G(V.indexOf(H), !0),
252
- "Mod+a": Pn,
253
- "Shift+Mod+a": Fn,
254
- s: J("S"),
255
- p: J("P"),
256
- a: J("A"),
257
- l: J("L"),
258
- m: J("M"),
259
- d: J("D"),
260
- Backspace: Bn,
261
- Delete: Bn,
262
- Enter: () => H && Mt({
283
+ Ge({
284
+ ...!M && {
285
+ j: () => J(1, !1),
286
+ k: () => J(-1, !1),
287
+ J: () => J(1, !0),
288
+ K: () => J(-1, !0),
289
+ ArrowDown: (e) => J(1, e.shiftKey),
290
+ ArrowUp: (e) => J(-1, e.shiftKey),
291
+ x: () => W && q(U.indexOf(W), !1),
292
+ X: () => W && q(U.indexOf(W), !0),
293
+ "Mod+a": Wn,
294
+ "Shift+Mod+a": Gn,
295
+ s: X("S"),
296
+ p: X("P"),
297
+ a: X("A"),
298
+ l: X("L"),
299
+ m: X("M"),
300
+ d: X("D"),
301
+ Backspace: Xn,
302
+ Delete: Xn,
303
+ Enter: () => W && Lt({
263
304
  to: "/$workspace/issues/$identifier",
264
305
  params: {
265
- workspace: b,
266
- identifier: H.identifier
306
+ workspace: y,
307
+ identifier: W.identifier
267
308
  }
268
309
  })
269
310
  },
270
- Escape: Fn,
271
- "/": () => zt.current?.focus()
272
- }), f(() => {
311
+ Escape: Gn,
312
+ "/": () => Wt.current?.focus()
313
+ }), d(() => {
273
314
  let e = (e) => {
274
- (e.metaKey || e.ctrlKey) && !e.altKey && !e.shiftKey && e.key.toLowerCase() === "f" && (e.preventDefault(), zt.current?.focus(), zt.current?.select());
315
+ (e.metaKey || e.ctrlKey) && !e.altKey && !e.shiftKey && e.key.toLowerCase() === "f" && (e.preventDefault(), Wt.current?.focus(), Wt.current?.select());
275
316
  };
276
317
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
277
318
  }, []);
278
- let Vn = m(null), Y = w.find((e) => e.key === S.team), X = He(b, S, (e) => C(Ue(S, e), !0), !!jt && !S.assignee && !S.creator && !S.saved && !S.scope), Hn = Fe(b, { ...c(S, "q", void 0) }), { views: Un, create: Wn, update: Gn } = ze(b), Z = Un.find((e) => Te(e, S.saved)), { data: Kn } = y(te(b)), { data: qn } = y(o(b)), { data: Jn } = y({
279
- ...i(b, Y?.key ?? ""),
280
- enabled: !!Y
319
+ let Zn = p(null), Z = C.find((e) => e.key === x.team), Qn = Ue(y, x, (e) => S(We(x, e), !0), !!It && !x.assignee && !x.creator && !x.saved && !x.scope), $n = Ie(y, { ...c(x, "q", void 0) }), { views: er, create: tr, update: nr } = Be(y), Q = er.find((e) => Ee(e, x.saved)), { data: rr } = v(ne(y)), { data: ir } = v(re(y)), { data: ar } = v({
320
+ ...i(y, Z?.key ?? ""),
321
+ enabled: !!Z
281
322
  });
282
- f(() => {
283
- let e = /^[0-9a-f]{8}-[0-9a-f]{4}-/i, t = { ...S }, n = Kn?.find((e) => e.id === S.label);
284
- S.label && e.test(S.label) && n && (t.label = n.name);
285
- let r = qn?.find((e) => e.id === S.project);
286
- S.project && e.test(S.project) && r && (t.project = ge(r));
287
- let i = Jn?.find((e) => e.id === S.cycle);
288
- S.cycle && e.test(S.cycle) && i && (t.cycle = String(i.number)), S.saved && e.test(S.saved) && Z && (t.saved = Ee(Z)), JSON.stringify(t) !== JSON.stringify(S) && Pt.current(t);
323
+ d(() => {
324
+ let e = /^[0-9a-f]{8}-[0-9a-f]{4}-/i, t = { ...x }, n = rr?.find((e) => e.id === x.label);
325
+ x.label && e.test(x.label) && n && (t.label = n.name);
326
+ let r = ir?.find((e) => e.id === x.project);
327
+ x.project && e.test(x.project) && r && (t.project = _e(r));
328
+ let i = ar?.find((e) => e.id === x.cycle);
329
+ x.cycle && e.test(x.cycle) && i && (t.cycle = String(i.number)), x.saved && e.test(x.saved) && Q && (t.saved = De(Q)), JSON.stringify(t) !== JSON.stringify(x) && zt.current(t);
289
330
  }, [
290
- S,
291
- Kn,
292
- qn,
293
- Jn,
294
- Z
331
+ x,
332
+ rr,
333
+ ir,
334
+ ar,
335
+ Q
295
336
  ]);
296
- let Yn = Le({
297
- ...S,
298
- ...F !== "updated" && { order: F },
299
- ...I !== "status" && { group: I },
300
- ...L && { layout: "board" }
301
- }), Xn = Z ? !Re(Z.filters, Yn) : Object.keys(Yn).length > 0, Zn = _e(b, "create_issues", S.team ? { team: S.team } : void 0), Qn = _e(b, "save_views"), [$n, er] = h(!1), [tr, nr] = h(null), rr = g("savedViews"), Q = It?.user.username, ir = !Z && !Y && (!S.assigneeKind && S.assignee === Q && !S.creator || S.creator === Q && !S.assignee), ar = e ?? (ir ? Q : void 0), $ = Z?.name ?? Y?.name ?? (e && e !== Q ? s("personIssues", { name: qt("user", e) }) : !S.assigneeKind && S.assignee === Q || S.creator === Q ? s("mine") : s("all")), or = g("workspace");
302
- n(...Y && !Z ? [or("issues"), Y.name] : [$]);
303
- let sr = Xn && /* @__PURE__ */ v(vt, { children: [Z?.canEdit && /* @__PURE__ */ _(l, {
337
+ let or = Re({
338
+ ...x,
339
+ ...A !== "updated" && { order: A },
340
+ ...j !== "status" && { group: j },
341
+ ...M && { layout: "board" }
342
+ }), sr = Q ? !ze(Q.filters, or) : Object.keys(or).length > 0, cr = ve(y, "create_issues", x.team ? { team: x.team } : void 0), lr = ve(y, "save_views"), [ur, dr] = m(!1), [fr, pr] = m(null), mr = h("savedViews"), $ = Vt?.user.username, hr = !Q && !Z && (!x.assigneeKind && x.assignee === $ && !x.creator || x.creator === $ && !x.assignee), gr = e ?? (hr ? $ : void 0), _r = Q?.name ?? Z?.name ?? (e && e !== $ ? s("personIssues", { name: Yt("user", e) }) : !x.assigneeKind && x.assignee === $ || x.creator === $ ? s("mine") : s("all")), vr = h("workspace");
343
+ n(...Z && !Q ? [vr("issues"), Z.name] : [_r]);
344
+ let yr = sr && /* @__PURE__ */ _(St, { children: [Q?.canEdit && /* @__PURE__ */ g(l, {
304
345
  type: "button",
305
346
  size: "sm",
306
- loading: Gn.isPending,
307
- onClick: () => Gn.mutate({
308
- id: Z.id,
309
- filters: Yn
347
+ loading: nr.isPending,
348
+ onClick: () => nr.mutate({
349
+ id: Q.id,
350
+ filters: or
310
351
  }),
311
- children: rr("update")
312
- }), /* @__PURE__ */ _(l, {
352
+ children: mr("update")
353
+ }), /* @__PURE__ */ g(l, {
313
354
  type: "button",
314
355
  size: "sm",
315
- onClick: () => er(!0),
316
- children: rr(Z ? "saveAsNew" : "save")
356
+ onClick: () => dr(!0),
357
+ children: mr(Q ? "saveAsNew" : "save")
317
358
  })] });
318
- return /* @__PURE__ */ v("div", {
359
+ return /* @__PURE__ */ _("div", {
319
360
  className: "flex h-full flex-col",
320
361
  children: [
321
- /* @__PURE__ */ v("header", {
362
+ /* @__PURE__ */ _("header", {
322
363
  className: "flex min-h-12 shrink-0 flex-wrap items-center gap-x-3 gap-y-2 border-b border-border px-4 py-2 md:px-5",
323
364
  children: [
324
- /* @__PURE__ */ _("h1", {
365
+ /* @__PURE__ */ g("h1", {
325
366
  className: "text-sm font-semibold whitespace-nowrap",
326
- children: $
367
+ children: _r
327
368
  }),
328
- /* @__PURE__ */ _(qe, {
329
- workspace: b,
369
+ /* @__PURE__ */ g(Je, {
370
+ workspace: y,
330
371
  kind: "view",
331
- target: Hn,
332
- label: T === "active" ? $ : s("favoriteLabel", {
333
- title: $,
334
- view: s(`views.${T}`)
372
+ target: $n,
373
+ label: w === "active" ? _r : s("favoriteLabel", {
374
+ title: _r,
375
+ view: s(`views.${w}`)
335
376
  })
336
377
  }),
337
- ar && /* @__PURE__ */ _(pt, {
378
+ gr && /* @__PURE__ */ g(gt, {
338
379
  variant: "segmented",
339
380
  size: "sm",
340
381
  label: s("mineScope"),
341
382
  items: ["assigned", "created"].map((e) => ({
342
383
  value: e,
343
384
  label: s(`mineScopes.${e}`),
344
- href: Nt({
345
- ...S.view && { view: S.view },
346
- ...e === "assigned" ? { assignee: ar } : { creator: ar }
385
+ href: Rt({
386
+ ...x.view && { view: x.view },
387
+ ...e === "assigned" ? { assignee: gr } : { creator: gr }
347
388
  })
348
389
  })),
349
- value: S.creator ? "created" : "assigned"
390
+ value: x.creator ? "created" : "assigned"
350
391
  }),
351
- /* @__PURE__ */ _(pt, {
392
+ /* @__PURE__ */ g(gt, {
352
393
  variant: "segmented",
353
394
  size: "sm",
354
395
  label: s("view"),
355
- items: Object.keys(Pe).map((e) => ({
396
+ items: Object.keys(Fe).map((e) => ({
356
397
  value: e,
357
398
  label: s(`views.${e}`),
358
- href: Nt(c(S, "view", e === "active" ? void 0 : e))
399
+ href: Rt(c(x, "view", e === "active" ? void 0 : e))
359
400
  })),
360
- value: T
401
+ value: w
361
402
  }),
362
- /* @__PURE__ */ v("div", {
403
+ /* @__PURE__ */ _("div", {
363
404
  className: "flex w-full min-w-0 flex-wrap items-center gap-2 md:ml-auto md:w-auto md:flex-nowrap",
364
405
  children: [
365
- X.count === 0 && sr,
366
- /* @__PURE__ */ _(dt, {
367
- ref: zt,
368
- value: E,
369
- onValueChange: Rt,
370
- onKeyDown: (e) => e.key === "Escape" && !E && e.currentTarget.blur(),
406
+ Qn.count === 0 && yr,
407
+ /* @__PURE__ */ g(mt, {
408
+ ref: Wt,
409
+ value: T,
410
+ onValueChange: Ut,
411
+ onKeyDown: (e) => e.key === "Escape" && !T && e.currentTarget.blur(),
371
412
  placeholder: s("search"),
372
413
  label: s("search"),
373
414
  "aria-keyshortcuts": "/ Meta+F Control+F",
374
415
  size: "sm",
375
416
  className: "min-w-0 flex-1 max-md:order-first max-md:basis-full md:w-56 md:flex-initial"
376
417
  }),
377
- /* @__PURE__ */ _(Ct, { filters: X }),
378
- /* @__PURE__ */ v(Je, {
418
+ /* @__PURE__ */ g(Dt, { filters: Qn }),
419
+ /* @__PURE__ */ _(Ye, {
379
420
  layouts: [{
380
421
  value: "list",
381
422
  label: s("layouts.list"),
382
- icon: /* @__PURE__ */ _(le, {})
423
+ icon: /* @__PURE__ */ g(ue, {})
383
424
  }, {
384
425
  value: "board",
385
426
  label: s("layouts.board"),
386
- icon: /* @__PURE__ */ _(ae, {})
427
+ icon: /* @__PURE__ */ g(oe, {})
387
428
  }],
388
- layout: L ? "board" : "list",
429
+ layout: M ? "board" : "list",
389
430
  onLayoutChange: (e) => {
390
- at({ layout: e }), C(c(S, "layout", e === "board" ? "board" : void 0));
431
+ ot({ layout: e }), S(c(x, "layout", e === "board" ? "board" : void 0));
391
432
  },
392
- changed: F !== "updated" || I !== "status" || L,
433
+ changed: A !== "updated" || j !== "status" || M,
393
434
  children: [
394
- /* @__PURE__ */ _(ut, {
435
+ /* @__PURE__ */ g(pt, {
395
436
  label: s("orderBy"),
396
- children: /* @__PURE__ */ _(ft, {
397
- value: F,
398
- items: [...Me.map((e) => ({
437
+ children: /* @__PURE__ */ g(ht, {
438
+ value: A,
439
+ items: [...Ne.map((e) => ({
399
440
  value: e,
400
441
  label: s(`order.${e}`)
401
- })), ...N.filter((e) => Se.includes(e.kind)).map((e) => ({
442
+ })), ...O.filter((e) => Ce.includes(e.kind)).map((e) => ({
402
443
  value: `field:${e.id}`,
403
444
  label: e.name
404
445
  }))],
405
446
  onValueChange: (e) => {
406
- at({ order: e }), C(c(S, "order", e === "updated" ? void 0 : e));
447
+ ot({ order: e }), S(c(x, "order", e === "updated" ? void 0 : e));
407
448
  },
408
449
  "aria-label": s("orderBy"),
409
450
  size: "sm"
410
451
  })
411
452
  }),
412
- /* @__PURE__ */ _(ut, {
453
+ /* @__PURE__ */ g(pt, {
413
454
  label: s("groupBy"),
414
- children: /* @__PURE__ */ _(ft, {
415
- value: I,
416
- items: [...Oe.map((e) => ({
455
+ children: /* @__PURE__ */ g(ht, {
456
+ value: j,
457
+ items: [...ke.map((e) => ({
417
458
  value: e,
418
459
  label: s(`grouping.${e}`)
419
- })), ...N.filter((e) => xe.includes(e.kind)).map((e) => ({
460
+ })), ...O.filter((e) => Se.includes(e.kind)).map((e) => ({
420
461
  value: `field:${e.id}`,
421
462
  label: e.name
422
463
  }))],
423
464
  onValueChange: (e) => {
424
- at({ group: e }), C(c(S, "group", e === "status" ? void 0 : e));
465
+ ot({ group: e }), S(c(x, "group", e === "status" ? void 0 : e));
425
466
  },
426
467
  "aria-label": s("groupBy"),
427
468
  size: "sm"
428
469
  })
429
470
  }),
430
- N.length > 0 && /* @__PURE__ */ _(ut, {
431
- label: P("onRows"),
432
- children: /* @__PURE__ */ _(ft, {
471
+ O.length > 0 && /* @__PURE__ */ g(pt, {
472
+ label: k("onRows"),
473
+ children: /* @__PURE__ */ g(ht, {
433
474
  multiple: !0,
434
- value: en.filter((e) => N.some((t) => t.id === e)),
435
- items: N.map((e) => ({
475
+ value: nn.filter((e) => O.some((t) => t.id === e)),
476
+ items: O.map((e) => ({
436
477
  value: e.id,
437
478
  label: e.name
438
479
  })),
439
480
  onValueChange: (e) => {
440
- ot(b, e), tn(e);
481
+ st(y, e), rn(e);
441
482
  },
442
- placeholder: P("noneOnRows"),
443
- "aria-label": P("onRows"),
483
+ placeholder: k("noneOnRows"),
484
+ "aria-label": k("onRows"),
444
485
  size: "sm"
445
486
  })
446
487
  })
447
488
  ]
448
489
  }),
449
- /* @__PURE__ */ _(u, {
490
+ /* @__PURE__ */ g(u, {
450
491
  variant: "secondary",
451
492
  size: "sm",
452
- icon: /* @__PURE__ */ _(ue, { className: "size-3.5" }),
453
- label: s(rn ? "hidePanel" : "showPanel"),
454
- "aria-pressed": rn,
455
- onClick: on,
493
+ icon: /* @__PURE__ */ g(de, { className: "size-3.5" }),
494
+ label: s(on ? "hidePanel" : "showPanel"),
495
+ "aria-pressed": on,
496
+ onClick: cn,
456
497
  className: "max-xl:hidden"
457
498
  }),
458
- /* @__PURE__ */ _(u, {
499
+ /* @__PURE__ */ g(u, {
459
500
  variant: "secondary",
460
501
  size: "sm",
461
- icon: /* @__PURE__ */ _(oe, { className: "size-3.5" }),
462
- label: s(sn ? "hideInsights" : "showInsights"),
463
- "aria-pressed": sn,
464
- onClick: ln
502
+ icon: /* @__PURE__ */ g(se, { className: "size-3.5" }),
503
+ label: s(ln ? "hideInsights" : "showInsights"),
504
+ "aria-pressed": ln,
505
+ onClick: dn
465
506
  }),
466
- /* @__PURE__ */ _(u, {
507
+ /* @__PURE__ */ g(u, {
467
508
  variant: "secondary",
468
509
  size: "sm",
469
- icon: /* @__PURE__ */ _(ce, { className: "size-3.5" }),
510
+ icon: /* @__PURE__ */ g(le, { className: "size-3.5" }),
470
511
  label: s("exportCsv"),
471
- onClick: () => At(b, Vt)
512
+ onClick: () => Ft(y, Kt)
472
513
  }),
473
- S.team && Zn && /* @__PURE__ */ _(u, {
514
+ x.team && cr && /* @__PURE__ */ g(u, {
474
515
  variant: "secondary",
475
516
  size: "sm",
476
- icon: /* @__PURE__ */ _(de, { className: "size-3.5" }),
517
+ icon: /* @__PURE__ */ g(fe, { className: "size-3.5" }),
477
518
  label: s("importCsv"),
478
- onClick: () => $e((e, t) => nr({
519
+ onClick: () => et((e, t) => pr({
479
520
  name: e,
480
521
  text: t
481
522
  }))
@@ -484,151 +525,153 @@ function b({ person: e } = {}) {
484
525
  })
485
526
  ]
486
527
  }),
487
- /* @__PURE__ */ _(St, {
488
- filters: X,
489
- trailing: sr,
528
+ /* @__PURE__ */ g(Et, {
529
+ filters: Qn,
530
+ trailing: yr,
490
531
  className: "shrink-0 border-b border-border px-4 py-2 md:px-5"
491
532
  }),
492
- sn && /* @__PURE__ */ _(et, {
493
- workspace: b,
494
- issues: z
533
+ ln && /* @__PURE__ */ g(tt, {
534
+ workspace: y,
535
+ issues: xn
495
536
  }),
496
- tr && S.team && /* @__PURE__ */ _(Qe, {
497
- workspace: b,
498
- team: S.team,
499
- file: tr,
500
- onClose: () => nr(null)
537
+ fr && x.team && /* @__PURE__ */ g($e, {
538
+ workspace: y,
539
+ team: x.team,
540
+ file: fr,
541
+ onClose: () => pr(null)
501
542
  }),
502
- $n && /* @__PURE__ */ _(Ie, {
503
- title: rr("saveTitle"),
504
- submitLabel: rr("save"),
505
- share: { allowed: Qn },
506
- onClose: () => er(!1),
543
+ ur && /* @__PURE__ */ g(Le, {
544
+ title: mr("saveTitle"),
545
+ submitLabel: mr("save"),
546
+ share: { allowed: lr },
547
+ onClose: () => dr(!1),
507
548
  onSubmit: async ({ name: e, shared: t }) => {
508
- let n = await Wn.mutateAsync({
549
+ let n = await tr.mutateAsync({
509
550
  name: e,
510
551
  shared: t,
511
- filters: Yn
552
+ filters: or
512
553
  });
513
- C(Be(n), !0);
554
+ S(Ve(n), !0);
514
555
  }
515
556
  }),
516
- /* @__PURE__ */ _(lt, {
517
- open: !!Rn,
518
- onClose: () => zn(null),
557
+ /* @__PURE__ */ g(ft, {
558
+ open: !!Jn,
559
+ onClose: () => Yn(null),
519
560
  onConfirm: () => {
520
- Rn?.(), zn(null), Fn();
561
+ Jn?.(), Yn(null), Gn();
521
562
  },
522
- title: s("archiveTitle", { count: U.size || 1 }),
563
+ title: s("archiveTitle", { count: G.size || 1 }),
523
564
  description: s("archiveDescription"),
524
565
  confirmLabel: s("archiveConfirm"),
525
566
  destructive: !0
526
567
  }),
527
- /* @__PURE__ */ v("div", {
568
+ /* @__PURE__ */ _("div", {
528
569
  className: "relative flex min-h-0 flex-1",
529
570
  children: [
530
- U.size > 0 && /* @__PURE__ */ v("div", {
531
- ref: In,
571
+ G.size > 0 && /* @__PURE__ */ _("div", {
572
+ ref: Kn,
532
573
  role: "toolbar",
533
- "aria-label": s("selected", { count: U.size }),
574
+ "aria-label": s("selected", { count: G.size }),
534
575
  className: "absolute bottom-4 left-1/2 z-10 flex max-w-[calc(100%-2rem)] -translate-x-1/2 items-center gap-1 rounded-xl border border-border bg-popover py-1 pr-1 pl-3 text-sm shadow-md",
535
576
  children: [
536
- /* @__PURE__ */ _("span", {
577
+ /* @__PURE__ */ g("span", {
537
578
  className: "whitespace-nowrap tabular-nums",
538
- children: q ? s("selectingAll", { count: Nn?.total ?? U.size }) : s("selected", { count: U.size })
579
+ children: Y ? s("selectingAll", { count: Un?.total ?? G.size }) : s("selected", { count: G.size })
539
580
  }),
540
- !q && (U.size < V.length || k) && /* @__PURE__ */ _(l, {
581
+ !Y && (G.size < U.length || !B) && /* @__PURE__ */ g(l, {
541
582
  size: "sm",
542
583
  variant: "ghost",
543
584
  className: "shrink-0",
544
- onClick: Pn,
545
- children: k ? s("selectAllMatching") : s("selectAll", { count: V.length })
585
+ onClick: Wn,
586
+ children: B ? s("selectAll", { count: U.length }) : s("selectAllMatching")
546
587
  }),
547
- /* @__PURE__ */ _(ct, {
588
+ /* @__PURE__ */ g(dt, {
548
589
  label: s("actions"),
549
- items: xn(En),
590
+ items: jn(In),
550
591
  side: "top",
551
- trigger: /* @__PURE__ */ _(l, {
592
+ trigger: /* @__PURE__ */ g(l, {
552
593
  size: "sm",
553
594
  variant: "outline",
554
595
  className: "shrink-0",
555
596
  children: s("actions")
556
597
  })
557
598
  }),
558
- /* @__PURE__ */ _(u, {
599
+ /* @__PURE__ */ g(u, {
559
600
  size: "sm",
560
601
  variant: "ghost",
561
- icon: /* @__PURE__ */ _(se, {}),
602
+ icon: /* @__PURE__ */ g(ce, {}),
562
603
  label: s("clear"),
563
- onClick: Fn
604
+ onClick: Gn
564
605
  })
565
606
  ]
566
607
  }),
567
- /* @__PURE__ */ v("div", {
568
- ref: Vn,
569
- className: `min-h-0 min-w-0 flex-1 ${L ? "overflow-hidden" : "overflow-y-auto"} ${U.size > 0 ? "pb-16" : ""} transition-opacity ${Ht && !D ? "opacity-50" : ""}`,
608
+ /* @__PURE__ */ _("div", {
609
+ ref: Zn,
610
+ className: `min-h-0 min-w-0 flex-1 ${M ? "overflow-hidden" : "overflow-y-auto"} ${G.size > 0 ? "pb-16" : ""} transition-opacity ${yn && !R ? "opacity-50" : ""}`,
570
611
  children: [
571
- R && /* @__PURE__ */ v("div", {
612
+ N && /* @__PURE__ */ _("div", {
572
613
  className: "flex h-8 items-center gap-2 border-b border-border px-5 text-xs text-muted-foreground",
573
614
  role: "status",
574
- children: [d("issueBreakdown.showing", { count: z.length }), /* @__PURE__ */ _("button", {
615
+ children: [bt("issueBreakdown.showing", { count: xn.length }), /* @__PURE__ */ g("button", {
575
616
  type: "button",
576
- onClick: () => fn(null),
617
+ onClick: () => mn(null),
577
618
  className: "text-primary hover:underline",
578
- children: d("issueBreakdown.showAll")
619
+ children: bt("issueBreakdown.showAll")
579
620
  })]
580
621
  }),
581
- L && D && /* @__PURE__ */ _(Ve, {
582
- workspace: b,
583
- columns: I === "status" && Pe[T].categories.length > 0 ? B.filter((e) => e.issues.length > 0 || e.key === "completed" || Pe[T].categories.includes(e.key)) : B,
584
- onMove: I === "none" ? void 0 : (e, t, n) => Sn(e, I, t, n, B.find((e) => e.key === n)?.issues[0], $t),
585
- onContextMenu: An
622
+ M && R && /* @__PURE__ */ g(He, {
623
+ workspace: y,
624
+ columns: j === "status" && Fe[w].categories.length > 0 ? H.filter((e) => e.issues.length > 0 || e.key === "completed" || Fe[w].categories.includes(e.key)) : H,
625
+ onMove: j === "none" ? void 0 : (e, t, n) => Mn(e, j, t, n, H.find((e) => e.key === n)?.issues[0], tn),
626
+ onContextMenu: Bn
586
627
  }),
587
- !L && /* @__PURE__ */ _(Ze, {
588
- groups: B,
589
- count: gn,
590
- scrollRef: Vn,
591
- keepInView: H?.id,
592
- renderRow: (e, t) => /* @__PURE__ */ _(Ot, {
628
+ !M && /* @__PURE__ */ g(Qe, {
629
+ groups: H,
630
+ count: En,
631
+ scrollRef: Zn,
632
+ keepInView: W?.id,
633
+ onMore: L.loadMore,
634
+ moreLabel: Mt("loading"),
635
+ renderRow: (e, t) => /* @__PURE__ */ g(Nt, {
593
636
  issue: e,
594
- index: pn.get(e.id) ?? -1,
637
+ index: Cn.get(e.id) ?? -1,
595
638
  place: t,
596
- team: _n.get(e.teamId),
597
- workspace: b,
598
- selected: e.id === H?.id,
599
- picked: U.has(e.id),
600
- viewers: wn.get(e.identifier) ?? Et,
601
- fields: nn,
602
- actions: jn
639
+ team: Dn.get(e.teamId),
640
+ workspace: y,
641
+ selected: e.id === W?.id,
642
+ picked: G.has(e.id),
643
+ viewers: Pn.get(e.identifier) ?? At,
644
+ fields: an,
645
+ actions: Vn
603
646
  }, e.id)
604
647
  }),
605
- D && k && /* @__PURE__ */ _("p", {
648
+ R && z && /* @__PURE__ */ g("p", {
606
649
  className: "flex h-10 items-center gap-2 px-5 text-xs text-muted-foreground",
607
650
  role: "status",
608
- children: hn ? s("loadingCount", {
609
- loaded: A.length,
610
- total: hn.total
611
- }) : s("loadingMore", { loaded: A.length })
651
+ children: Tn ? s("loadingCount", {
652
+ loaded: V.length,
653
+ total: Tn.total
654
+ }) : s("loadingMore", { loaded: V.length })
612
655
  }),
613
- !D && (O ? /* @__PURE__ */ _(t, { error: O }) : /* @__PURE__ */ _(wt, { rows: 8 })),
614
- D && !k && A.length === 0 && /* @__PURE__ */ _(kt, {
615
- workspace: b,
616
- filtered: !!S.q || T !== "active" || X.count > +!!jt,
617
- onCreate: () => Lt(S.team ? { team: S.team } : void 0)
656
+ !R && (vn ? /* @__PURE__ */ g(t, { error: vn }) : /* @__PURE__ */ g(Ot, { rows: 8 })),
657
+ R && !z && V.length === 0 && /* @__PURE__ */ g(Pt, {
658
+ workspace: y,
659
+ filtered: !!x.q || w !== "active" || Qn.count > +!!It,
660
+ onCreate: () => Ht(x.team ? { team: x.team } : void 0)
618
661
  })
619
662
  ]
620
663
  }),
621
- rn && D && /* @__PURE__ */ _("aside", {
622
- "aria-label": d("issueBreakdown.label"),
664
+ on && R && /* @__PURE__ */ g("aside", {
665
+ "aria-label": bt("issueBreakdown.label"),
623
666
  className: "hidden w-80 shrink-0 overflow-y-auto border-l border-border px-4 py-4 xl:block",
624
- children: /* @__PURE__ */ _(Ye, {
625
- workspace: b,
626
- issues: A,
627
- tabs: nt,
628
- tab: un,
629
- onTabChange: dn,
630
- focus: R,
631
- onFocus: fn
667
+ children: /* @__PURE__ */ g(Xe, {
668
+ workspace: y,
669
+ issues: V,
670
+ tabs: rt,
671
+ tab: fn,
672
+ onTabChange: pn,
673
+ focus: N,
674
+ onFocus: mn
632
675
  })
633
676
  })
634
677
  ]
@@ -636,8 +679,8 @@ function b({ person: e } = {}) {
636
679
  ]
637
680
  });
638
681
  }
639
- var Ot = d(function({ issue: e, index: t, place: n, team: r, workspace: i, selected: a, picked: ee, viewers: te, fields: ne, actions: o }) {
640
- return /* @__PURE__ */ _(s, {
682
+ var Nt = bt(function({ issue: e, index: t, place: n, team: r, workspace: i, selected: a, picked: ee, viewers: te, fields: ne, actions: o }) {
683
+ return /* @__PURE__ */ g(s, {
641
684
  ref: n.ref,
642
685
  style: n.style,
643
686
  index: n.index,
@@ -654,20 +697,20 @@ var Ot = d(function({ issue: e, index: t, place: n, team: r, workspace: i, selec
654
697
  onContextMenu: (t) => o.current.menu(t, e)
655
698
  });
656
699
  });
657
- function kt({ workspace: e, filtered: t, onCreate: n }) {
658
- let r = g("issues.empty"), { data: i = [] } = y(ie(e)), a = _e(e, "manage_teams");
659
- return i.some((e) => !e.archivedAt) ? /* @__PURE__ */ v("div", {
700
+ function Pt({ workspace: e, filtered: t, onCreate: n }) {
701
+ let r = h("issues.empty"), { data: i = [] } = v(ae(e)), a = ve(e, "manage_teams");
702
+ return i.some((e) => !e.archivedAt) ? /* @__PURE__ */ _("div", {
660
703
  className: "mx-auto max-w-sm px-4 py-24 text-center",
661
704
  children: [
662
- /* @__PURE__ */ _("p", {
705
+ /* @__PURE__ */ g("p", {
663
706
  className: "text-sm font-medium",
664
707
  children: r(t ? "noMatch" : "nothingInProgress")
665
708
  }),
666
- /* @__PURE__ */ _("p", {
709
+ /* @__PURE__ */ g("p", {
667
710
  className: "mt-1 text-sm text-muted-foreground",
668
711
  children: r(t ? "tryAnother" : "pressC")
669
712
  }),
670
- !t && /* @__PURE__ */ _(l, {
713
+ !t && /* @__PURE__ */ g(l, {
671
714
  type: "button",
672
715
  variant: "primary",
673
716
  onClick: n,
@@ -675,18 +718,18 @@ function kt({ workspace: e, filtered: t, onCreate: n }) {
675
718
  children: r("create")
676
719
  })
677
720
  ]
678
- }) : /* @__PURE__ */ v("div", {
721
+ }) : /* @__PURE__ */ _("div", {
679
722
  className: "mx-auto max-w-sm px-4 py-24 text-center",
680
723
  children: [
681
- /* @__PURE__ */ _("p", {
724
+ /* @__PURE__ */ g("p", {
682
725
  className: "text-sm font-medium",
683
726
  children: r("noTeamsTitle")
684
727
  }),
685
- /* @__PURE__ */ _("p", {
728
+ /* @__PURE__ */ g("p", {
686
729
  className: "mt-1 text-sm text-muted-foreground",
687
730
  children: r(a ? "noTeamsDescription" : "noTeamsAskAdmin")
688
731
  }),
689
- a && /* @__PURE__ */ _(l, {
732
+ a && /* @__PURE__ */ g(l, {
690
733
  type: "button",
691
734
  variant: "primary",
692
735
  onClick: n,
@@ -696,7 +739,7 @@ function kt({ workspace: e, filtered: t, onCreate: n }) {
696
739
  ]
697
740
  });
698
741
  }
699
- function At(t, n) {
742
+ function Ft(t, n) {
700
743
  let r = new URLSearchParams({
701
744
  triage: "exclude",
702
745
  archived: "exclude"
@@ -705,4 +748,4 @@ function At(t, n) {
705
748
  let i = document.createElement("a");
706
749
  i.href = `${e}/api/v1/workspaces/${encodeURIComponent(t)}/exports/issues.csv?${r}`, i.download = "", i.click();
707
750
  }
708
- export { b as IssueList };
751
+ export { Mt as IssueList };