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