@parallelworks/tandem-web 0.149.0 → 0.150.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.
@@ -1,642 +1,493 @@
1
1
  import { api as e } from "../api/client.js";
2
2
  import { useHost as t } from "../lib/host.js";
3
3
  import { Route as n } from "./_workspace.js";
4
- import { Link as r, useLocation as i, useNavigate as a } from "../lib/router.js";
5
- import { inboxQuery as o, issuesQuery as s, meQuery as c, notificationsQuery as l, teamsQuery as ee, workspaceQuery as te } from "../api/queries.js";
6
- import { AddIcon as u, AgentIcon as ne, AreaIcon as re, ChevronDownIcon as ie, CycleIcon as ae, InboxIcon as oe, LibraryIcon as se, ListViewIcon as ce, NotificationIcon as le, ProjectIcon as ue, SearchIcon as d, TriageIcon as de, UserIcon as fe, UsersIcon as f } from "../components/icons.js";
7
- import { isViewAt as p } from "../lib/refs.js";
8
- import { teamPageOf as m, teamPath as h } from "../lib/teamPaths.js";
9
- import { AppLauncher as pe } from "../components/AppLauncher.js";
10
- import { useFavorites as me } from "../lib/favorites.js";
11
- import { copyItem as he, useLinkItems as ge } from "../lib/menus.js";
12
- import { docKey as g } from "../lib/docs.js";
13
- import { usePeople as _ } from "../lib/people.js";
14
- import { NewIssueContext as _e } from "../lib/newIssue.js";
15
- import { PaletteSelectionContext as ve } from "../lib/palette.js";
16
- import { isBuiltIn as ye, useCan as be } from "../lib/roles.js";
17
- import { SettingsNav as xe, navItem as Se, navOn as v } from "../components/SettingsNav.js";
18
- import { useSavedViews as y, useViewMenu as Ce, viewSearch as we } from "../lib/views.js";
19
- import { EntityIcon as Te } from "../components/EntityIcon.js";
20
- import { CommandPalette as Ee } from "../components/CommandPalette.js";
21
- import { DocsTree as De } from "../components/DocsTree.js";
22
- import { FavoritesNav as Oe } from "../components/FavoritesNav.js";
23
- import { HostPanelProvider as ke, useHostPanel as b } from "../lib/hostPanel.js";
24
- import { HostActions as x } from "../components/HostActions.js";
25
- import { HostPanel as S } from "../components/HostPanel.js";
26
- import { PersonHoverCard as Ae } from "../components/PersonHoverCard.js";
27
- import { HoverCards as je } from "../components/HoverCards.js";
28
- import { Logo as Me } from "../components/Logo.js";
29
- import { CreateTeamDialog as Ne } from "../components/TeamForm.js";
30
- import { NewIssueDialog as Pe } from "../components/NewIssueDialog.js";
31
- import { ShareDialogHost as Fe } from "../components/ShareDialog.js";
32
- import { hostSignOut as Ie } from "../lib/hostSignOut.js";
33
- import { useInstall as Le } from "../lib/install.js";
34
- import { LiveProvider as Re, useLive as ze } from "../lib/live.js";
35
- import { usePushSync as Be } from "../lib/notifications.js";
36
- import { useShortcuts as Ve } from "../lib/shortcuts.js";
37
- import { teamTree as He } from "../lib/teamTree.js";
38
- import { ActionMenu as Ue, Avatar as We, AvatarGroup as C, Combobox as Ge, CountBadge as w, IconButton as T, Kbd as Ke, Tooltip as E, menuDivider as D, useOpenMenu as qe } from "@parallelworks/ui";
39
- import { Outlet as Je, useParams as Ye } from "@tanstack/react-router";
40
- import { Fragment as Xe, Suspense as Ze, useCallback as Qe, useEffect as O, useMemo as $e, useState as k } from "react";
41
- import { useLocale as et, useTranslations as A } from "use-intl";
42
- import { Fragment as j, jsx as M, jsxs as N } from "react/jsx-runtime";
43
- import { useQuery as P, useQueryClient as tt, useSuspenseQuery as F } from "@tanstack/react-query";
44
- import { MoreButton as nt } from "@parallelworks/ui/list";
45
- import { AppFrame as rt, AppFrameToggle as I, useAppFrame as it } from "@parallelworks/ui/app-frame";
46
- import { createPortal as L } from "react-dom";
4
+ import { useLocation as r, useNavigate as i } from "../lib/router.js";
5
+ import { inboxQuery as a, issuesQuery as o, meQuery as s, notificationsQuery as c, teamsQuery as l, workspaceQuery as u } from "../api/queries.js";
6
+ import { AddIcon as d, AgentIcon as ee, AreaIcon as te, ChevronDownIcon as f, CycleIcon as ne, InboxIcon as re, LibraryIcon as ie, ListViewIcon as ae, NotificationIcon as oe, ProjectIcon as se, SearchIcon as p, TriageIcon as ce, UserIcon as le, UsersIcon as m } from "../components/icons.js";
7
+ import { isViewAt as h } from "../lib/refs.js";
8
+ import { teamPageOf as g, teamPath as ue } from "../lib/teamPaths.js";
9
+ import { AppLauncher as _ } from "../components/AppLauncher.js";
10
+ import { useFavorites as de } from "../lib/favorites.js";
11
+ import { copyItem as fe, useLinkItems as pe } from "../lib/menus.js";
12
+ import { docKey as v } from "../lib/docs.js";
13
+ import { usePeople as y } from "../lib/people.js";
14
+ import { NewIssueContext as me } from "../lib/newIssue.js";
15
+ import { PaletteSelectionContext as he } from "../lib/palette.js";
16
+ import { isBuiltIn as ge, useCan as _e } from "../lib/roles.js";
17
+ import { SettingsNav as ve } from "../components/SettingsNav.js";
18
+ import { useSavedViews as b, useViewMenu as x, viewHref as S } from "../lib/views.js";
19
+ import { EntityIcon as ye } from "../components/EntityIcon.js";
20
+ import { CommandPalette as be } from "../components/CommandPalette.js";
21
+ import { DocsTree as xe } from "../components/DocsTree.js";
22
+ import { FavoritesNav as Se } from "../components/FavoritesNav.js";
23
+ import { HostPanelProvider as Ce, useHostPanel as we } from "../lib/hostPanel.js";
24
+ import { HostActions as C } from "../components/HostActions.js";
25
+ import { HostPanel as w } from "../components/HostPanel.js";
26
+ import { PersonHoverCard as T } from "../components/PersonHoverCard.js";
27
+ import { HoverCards as Te } from "../components/HoverCards.js";
28
+ import { Logo as Ee } from "../components/Logo.js";
29
+ import { CreateTeamDialog as De } from "../components/TeamForm.js";
30
+ import { NewIssueDialog as Oe } from "../components/NewIssueDialog.js";
31
+ import { ShareDialogHost as ke } from "../components/ShareDialog.js";
32
+ import { hostSignOut as Ae } from "../lib/hostSignOut.js";
33
+ import { useInstall as je } from "../lib/install.js";
34
+ import { LiveProvider as Me, useLive as Ne } from "../lib/live.js";
35
+ import { usePushSync as Pe } from "../lib/notifications.js";
36
+ import { useShortcuts as Fe } from "../lib/shortcuts.js";
37
+ import { ActionMenu as Ie, Avatar as Le, AvatarGroup as Re, Combobox as ze, CountBadge as E, IconButton as D, Kbd as Be, Tooltip as O, menuDivider as k, useOpenMenu as Ve } from "@parallelworks/ui";
38
+ import { Outlet as He, useParams as Ue } from "@tanstack/react-router";
39
+ import { Suspense as We, useCallback as Ge, useEffect as A, useMemo as Ke, useState as j } from "react";
40
+ import { useLocale as qe, useTranslations as M } from "use-intl";
41
+ import { Fragment as N, jsx as P, jsxs as F } from "react/jsx-runtime";
42
+ import { useQuery as I, useQueryClient as Je, useSuspenseQuery as L } from "@tanstack/react-query";
43
+ import { MoreButton as Ye } from "@parallelworks/ui/list";
44
+ import { AppFrame as Xe, AppFrameNavGroup as R, AppFrameNavItem as z, AppFrameToggle as B, useAppFrame as V } from "@parallelworks/ui/app-frame";
45
+ import { createPortal as Ze } from "react-dom";
47
46
  // src/routes/$workspace.tsx?tsr-split=component
48
- function at(e, t) {
47
+ function Qe(e, t) {
49
48
  let [n, r] = e.slice(`/${t}/docs/`.length).split("/");
50
- return e.startsWith(`/${t}/docs/`) && n && r === void 0 ? g(n) : void 0;
49
+ return e.startsWith(`/${t}/docs/`) && n && r === void 0 ? v(n) : void 0;
51
50
  }
52
- var R = { className: v }, z = "inline-flex h-8 min-w-8 items-center justify-center rounded-md border border-[color-mix(in_oklab,currentColor_20%,transparent)] bg-[color-mix(in_oklab,currentColor_6%,transparent)] text-sm font-medium hover:bg-[color-mix(in_oklab,currentColor_12%,transparent)]", ot = "absolute top-1.5 right-3 size-2 rounded-full bg-primary", B = (...e) => e.filter(Boolean).join(" ");
53
- function V() {
54
- let { workspace: f } = n.useParams(), { data: p } = F(c), { data: g } = F(te(f)), { data: _ } = F(ee(f)), v = t(), [y, Ce] = k(null), [we, b] = k(!1), S = be(f, "manage_teams"), { canInstall: Ae, install: ze } = Le(), C = a(), it = tt(), L = qe(), V = me(f), U = A("workspace"), W = A("common"), yt = et(), G = A("favorites"), bt = A("roles"), K = ge(), xt = (e) => [
51
+ var H = "inline-flex h-8 min-w-8 items-center justify-center rounded-md border border-[color-mix(in_oklab,currentColor_20%,transparent)] bg-[color-mix(in_oklab,currentColor_6%,transparent)] text-sm font-medium hover:bg-[color-mix(in_oklab,currentColor_12%,transparent)]", $e = "absolute top-1.5 right-3 size-2 rounded-full bg-primary", U = (...e) => e.filter(Boolean).join(" ");
52
+ function W() {
53
+ let { workspace: m } = n.useParams(), { data: h } = L(s), { data: v } = L(u(m)), { data: y } = L(l(m)), b = t(), [x, S] = j(null), [we, w] = j(!1), T = _e(m, "manage_teams"), { canInstall: Ne, install: Re } = je(), V = i(), Ze = Je(), W = Ve(), G = de(m), K = M("workspace"), q = M("common"), ft = qe(), J = M("favorites"), pt = M("roles"), mt = pe(), ht = (e) => [
55
54
  {
56
- label: W("open"),
57
- onClick: () => C({
55
+ label: q("open"),
56
+ onClick: () => V({
58
57
  to: "/$workspace/teams/$key/issues",
59
58
  params: {
60
- workspace: f,
59
+ workspace: m,
61
60
  key: e.key
62
61
  }
63
62
  })
64
63
  },
65
64
  {
66
- label: U("newIssueInTeam"),
65
+ label: K("newIssueInTeam"),
67
66
  shortcut: "C",
68
67
  onClick: () => Q({ team: e.key })
69
68
  },
70
69
  ...e.cyclesEnabled ? [{
71
- label: U("cycles"),
72
- onClick: () => C({
70
+ label: K("cycles"),
71
+ onClick: () => V({
73
72
  to: "/$workspace/teams/$key/cycles",
74
73
  params: {
75
- workspace: f,
74
+ workspace: m,
76
75
  key: e.key
77
76
  }
78
77
  })
79
78
  }] : [],
80
79
  {
81
- label: U("teamSettings"),
82
- onClick: () => C({
80
+ label: K("teamSettings"),
81
+ onClick: () => V({
83
82
  to: "/$workspace/teams/$key/settings",
84
83
  params: {
85
- workspace: f,
84
+ workspace: m,
86
85
  key: e.key
87
86
  }
88
87
  })
89
88
  },
90
89
  {
91
- label: V.find("team", e.id) ? G("remove") : G("add"),
92
- onClick: () => V.toggle("team", e.id)
90
+ label: G.find("team", e.id) ? J("remove") : J("add"),
91
+ onClick: () => G.toggle("team", e.id)
93
92
  },
94
- D,
95
- ...K(h(f, e.key, "issues")),
96
- he(W("copyKey"), e.key)
97
- ], q = (e) => ({
98
- label: V.find("page", e) ? G("remove") : G("add"),
99
- onClick: () => V.toggle("page", e)
100
- }), J = i(), [St, Ct] = k(() => mt().expanded), [wt, Tt] = k(() => mt().width), Et = $e(() => {
101
- let e = m(J.pathname, f), t = e?.page === "issues" ? e.team : void 0, n = J.pathname === `/${f}/issues` || t !== void 0, r = J.search, i = n && !r.saved;
93
+ k,
94
+ ...mt(ue(m, e.key, "issues")),
95
+ fe(q("copyKey"), e.key)
96
+ ], gt = (e) => ({
97
+ label: G.find("page", e) ? J("remove") : J("add"),
98
+ onClick: () => G.toggle("page", e)
99
+ }), Y = r(), [_t, vt] = j(() => st().expanded), [yt, bt] = j(() => st().width), xt = Ke(() => {
100
+ let e = g(Y.pathname, m), t = e?.page === "issues" ? e.team : void 0, n = Y.pathname === `/${m}/issues` || t !== void 0, r = Y.search, i = n && !r.saved;
102
101
  return {
103
- mine: i && !t && (r.assignee === p?.user.username || r.creator === p?.user.username),
102
+ mine: i && !t && (r.assignee === h?.user.username || r.creator === h?.user.username),
104
103
  team: i && !r.assignee ? t : void 0,
105
104
  saved: n ? r.saved : void 0
106
105
  };
107
106
  }, [
108
- J.pathname,
109
- J.search,
110
- f,
111
- p?.user.username
112
- ]), Y = (e, t) => {
113
- let n = m(J.pathname, f);
107
+ Y.pathname,
108
+ Y.search,
109
+ m,
110
+ h?.user.username
111
+ ]), X = (e, t) => {
112
+ let n = g(Y.pathname, m);
114
113
  return n?.page === e && n.team === t;
115
- }, [Dt, Ot] = k(() => pt(f)), kt = (e) => Ot((t) => {
116
- let n = new Set(t);
117
- return n.delete(e) || n.add(e), gt(f, n), n;
118
- }), X = J.pathname.startsWith(`/${f}/settings`), { data: At = [] } = P(o(f)), jt = _.some((e) => e.triageEnabled && !e.archivedAt), { data: Mt } = P({
119
- ...s(f, { triage: "only" }),
120
- enabled: jt
121
- }), Nt = (e) => Mt?.issues.filter((t) => t.teamId === e).length ?? 0, { data: Pt } = P(l(f)), Ft = Pt?.unread ?? 0;
122
- Be();
123
- let { key: Z } = Ye({ strict: !1 }), Q = Qe((e) => Ce({
124
- ...Z && { team: Z },
114
+ }, [St, Ct] = j(() => ot(m)), wt = (e, t) => Ct((n) => {
115
+ let r = new Set(n);
116
+ return t ? r.delete(e) : r.add(e), lt(m, r), r;
117
+ }), Z = Y.pathname.startsWith(`/${m}/settings`), { data: Tt = [] } = I(a(m)), Et = y.some((e) => e.triageEnabled && !e.archivedAt), { data: Dt } = I({
118
+ ...o(m, { triage: "only" }),
119
+ enabled: Et
120
+ }), Ot = (e) => Dt?.issues.filter((t) => t.teamId === e).length ?? 0, { data: kt } = I(c(m)), At = kt?.unread ?? 0;
121
+ Pe();
122
+ let { key: jt } = Ue({ strict: !1 }), Q = Ge((e) => S({
123
+ ...jt && { team: jt },
125
124
  ...e
126
- }), [Z]);
127
- Ve({ c: () => Q() }, y === null);
128
- let [It, $] = k(!1), [Lt, Rt] = k([]);
129
- if (O(() => {
125
+ }), [jt]);
126
+ Fe({ c: () => Q() }, x === null);
127
+ let [Mt, $] = j(!1), [Nt, Pt] = j([]);
128
+ if (A(() => {
130
129
  let e = (e) => {
131
- !e.metaKey && !e.ctrlKey || e.altKey || e.shiftKey || e.key.toLowerCase() !== "k" || e.defaultPrevented || (e.preventDefault(), $((e) => !e)), !e.metaKey && !e.ctrlKey || e.altKey || e.shiftKey || e.key.toLowerCase() !== "f" || e.defaultPrevented || _t() || (e.preventDefault(), $(!0));
130
+ !e.metaKey && !e.ctrlKey || e.altKey || e.shiftKey || e.key.toLowerCase() !== "k" || e.defaultPrevented || (e.preventDefault(), $((e) => !e)), !e.metaKey && !e.ctrlKey || e.altKey || e.shiftKey || e.key.toLowerCase() !== "f" || e.defaultPrevented || ut() || (e.preventDefault(), $(!0));
132
131
  };
133
132
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
134
- }, []), !p) return null;
135
- let zt = p.mode === "platform", Bt = Ae && !zt, Vt = p.signOutUrl, Ht = !v && (!zt || Vt !== void 0), Ut = async () => {
136
- Vt === void 0 ? (await e.POST("/api/v1/auth/logout"), it.clear(), C({ to: "/login" })) : await Ie(Vt);
137
- }, Wt = X ? void 0 : ({ expanded: e }) => {
138
- let t = /* @__PURE__ */ M(Ge, {
139
- items: [...p.workspaces.map((e) => ({
133
+ }, []), !h) return null;
134
+ let Ft = h.mode === "platform", It = Ne && !Ft, Lt = h.signOutUrl, Rt = !b && (!Ft || Lt !== void 0), zt = async () => {
135
+ Lt === void 0 ? (await e.POST("/api/v1/auth/logout"), Ze.clear(), V({ to: "/login" })) : await Ae(Lt);
136
+ }, Bt = Z ? void 0 : ({ expanded: e }) => {
137
+ let t = /* @__PURE__ */ P(ze, {
138
+ items: [...h.workspaces.map((e) => ({
140
139
  value: e.slug,
141
140
  label: e.name,
142
- hint: ye(e.role) ? bt(`${e.role}.name`) : bt("custom")
143
- })), ...p.canCreateWorkspace ? [{
141
+ hint: ge(e.role) ? pt(`${e.role}.name`) : pt("custom")
142
+ })), ...h.canCreateWorkspace ? [{
144
143
  value: "__new",
145
- label: U("createWorkspace")
144
+ label: K("createWorkspace")
146
145
  }] : []],
147
- value: f,
148
- onValueChange: (e) => C(e === "__new" ? { to: "/new" } : {
146
+ value: m,
147
+ onValueChange: (e) => V(e === "__new" ? { to: "/new" } : {
149
148
  to: "/$workspace/issues",
150
- params: { workspace: e ?? f }
149
+ params: { workspace: e ?? m }
151
150
  }),
152
- placeholder: U("switchWorkspacePlaceholder"),
153
- "aria-label": U("switchWorkspace"),
154
- trigger: /* @__PURE__ */ N("button", {
151
+ placeholder: K("switchWorkspacePlaceholder"),
152
+ "aria-label": K("switchWorkspace"),
153
+ trigger: /* @__PURE__ */ F("button", {
155
154
  type: "button",
156
- "aria-label": e ? void 0 : g.name,
157
- onContextMenu: (e) => L(e, [
155
+ "aria-label": e ? void 0 : v.name,
156
+ onContextMenu: (e) => W(e, [
158
157
  {
159
- label: U("workspaceSettings"),
160
- onClick: () => C({
158
+ label: K("workspaceSettings"),
159
+ onClick: () => V({
161
160
  to: "/$workspace/settings",
162
- params: { workspace: f }
161
+ params: { workspace: m }
163
162
  })
164
163
  },
165
164
  {
166
- label: U("switchWorkspace"),
167
- items: [...p.workspaces.map((e) => ({
165
+ label: K("switchWorkspace"),
166
+ items: [...h.workspaces.map((e) => ({
168
167
  label: e.name,
169
- checked: e.slug === f,
170
- onClick: () => C({
168
+ checked: e.slug === m,
169
+ onClick: () => V({
171
170
  to: "/$workspace/issues",
172
171
  params: { workspace: e.slug }
173
172
  })
174
- })), ...p.canCreateWorkspace ? [D, {
175
- label: U("createWorkspace"),
176
- onClick: () => C({ to: "/new" })
173
+ })), ...h.canCreateWorkspace ? [k, {
174
+ label: K("createWorkspace"),
175
+ onClick: () => V({ to: "/new" })
177
176
  }] : []]
178
177
  },
179
- D,
180
- he(U("copyWorkspaceSlug"), f),
181
- ...Ht ? [D, {
182
- label: U("signOut"),
183
- onClick: Ut
178
+ k,
179
+ fe(K("copyWorkspaceSlug"), m),
180
+ ...Rt ? [k, {
181
+ label: K("signOut"),
182
+ onClick: zt
184
183
  }] : []
185
184
  ]),
186
- className: B("flex h-9 items-center gap-2 rounded-md text-left hover:bg-muted", e ? "w-full px-2" : "w-9 justify-center"),
187
- children: [g.icon ? /* @__PURE__ */ M(Te, {
188
- icon: g.icon,
189
- color: g.color,
190
- name: g.name,
185
+ className: U("flex h-9 items-center gap-2 rounded-md text-left hover:bg-muted", e ? "w-full px-2" : "w-9 justify-center"),
186
+ children: [v.icon ? /* @__PURE__ */ P(ye, {
187
+ icon: v.icon,
188
+ color: v.color,
189
+ name: v.name,
191
190
  className: "size-6 text-base"
192
- }) : /* @__PURE__ */ M(Me, { withName: !1 }), e && /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M("span", {
191
+ }) : /* @__PURE__ */ P(Ee, { withName: !1 }), e && /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P("span", {
193
192
  className: "min-w-0 flex-1 truncate text-sm font-semibold",
194
- children: g.name
195
- }), /* @__PURE__ */ M(ie, { className: "size-3.5 text-muted-foreground" })] })]
193
+ children: v.name
194
+ }), /* @__PURE__ */ P(f, { className: "size-3.5 text-muted-foreground" })] })]
196
195
  })
197
196
  });
198
- return e ? /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ N("div", {
197
+ return e ? /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ F("div", {
199
198
  className: "flex items-center gap-1",
200
199
  children: [
201
- /* @__PURE__ */ M("div", {
200
+ /* @__PURE__ */ P("div", {
202
201
  className: "min-w-0 flex-1",
203
202
  children: t
204
203
  }),
205
- !v && /* @__PURE__ */ M(x, { className: "hidden md:flex" }),
206
- !v && /* @__PURE__ */ M(pe, {
207
- apps: p.apps ?? [],
204
+ !b && /* @__PURE__ */ P(C, { className: "hidden md:flex" }),
205
+ !b && /* @__PURE__ */ P(_, {
206
+ apps: h.apps ?? [],
208
207
  className: "hidden md:block"
209
208
  })
210
209
  ]
211
- }), /* @__PURE__ */ N("div", {
210
+ }), /* @__PURE__ */ F("div", {
212
211
  className: "mt-3 flex gap-1.5",
213
- children: [/* @__PURE__ */ N("button", {
212
+ children: [/* @__PURE__ */ F("button", {
214
213
  type: "button",
215
214
  onClick: () => Q(),
216
- className: B(z, "min-w-0 flex-1 gap-2 px-2"),
215
+ className: U(H, "min-w-0 flex-1 gap-2 px-2"),
217
216
  children: [
218
- /* @__PURE__ */ M(u, { className: "size-3.5" }),
219
- /* @__PURE__ */ M("span", {
217
+ /* @__PURE__ */ P(d, { className: "size-3.5" }),
218
+ /* @__PURE__ */ P("span", {
220
219
  className: "flex-1 text-left",
221
- children: U("newIssue")
220
+ children: K("newIssue")
222
221
  }),
223
- /* @__PURE__ */ M(Ke, {
222
+ /* @__PURE__ */ P(Be, {
224
223
  keys: "C",
225
224
  size: "xs",
226
225
  variant: "plain"
227
226
  })
228
227
  ]
229
- }), /* @__PURE__ */ M(E, {
230
- content: U("openPalette"),
228
+ }), /* @__PURE__ */ P(O, {
229
+ content: K("openPalette"),
231
230
  shortcut: "Mod+K",
232
- children: /* @__PURE__ */ M("button", {
231
+ children: /* @__PURE__ */ P("button", {
233
232
  type: "button",
234
233
  onClick: () => $(!0),
235
- "aria-label": U("openPalette"),
234
+ "aria-label": K("openPalette"),
236
235
  "aria-keyshortcuts": "Meta+K Control+K",
237
- className: z,
238
- children: /* @__PURE__ */ M(d, { className: "size-3.5" })
236
+ className: H,
237
+ children: /* @__PURE__ */ P(p, { className: "size-3.5" })
239
238
  })
240
239
  })]
241
- })] }) : /* @__PURE__ */ N("div", {
240
+ })] }) : /* @__PURE__ */ F("div", {
242
241
  className: "flex flex-col items-center gap-1.5",
243
242
  children: [
244
243
  t,
245
- !v && /* @__PURE__ */ M(pe, { apps: p.apps ?? [] }),
246
- !v && /* @__PURE__ */ M(x, { className: "flex-col" }),
247
- /* @__PURE__ */ M(E, {
248
- content: U("newIssue"),
244
+ !b && /* @__PURE__ */ P(_, { apps: h.apps ?? [] }),
245
+ !b && /* @__PURE__ */ P(C, { className: "flex-col" }),
246
+ /* @__PURE__ */ P(O, {
247
+ content: K("newIssue"),
249
248
  shortcut: "C",
250
249
  side: "right",
251
- children: /* @__PURE__ */ M("button", {
250
+ children: /* @__PURE__ */ P("button", {
252
251
  type: "button",
253
252
  onClick: () => Q(),
254
- "aria-label": U("newIssue"),
255
- className: z,
256
- children: /* @__PURE__ */ M(u, { className: "size-3.5" })
253
+ "aria-label": K("newIssue"),
254
+ className: H,
255
+ children: /* @__PURE__ */ P(d, { className: "size-3.5" })
257
256
  })
258
257
  }),
259
- /* @__PURE__ */ M(E, {
260
- content: U("openPalette"),
258
+ /* @__PURE__ */ P(O, {
259
+ content: K("openPalette"),
261
260
  shortcut: "Mod+K",
262
261
  side: "right",
263
- children: /* @__PURE__ */ M("button", {
262
+ children: /* @__PURE__ */ P("button", {
264
263
  type: "button",
265
264
  onClick: () => $(!0),
266
- "aria-label": U("openPalette"),
265
+ "aria-label": K("openPalette"),
267
266
  "aria-keyshortcuts": "Meta+K Control+K",
268
- className: z,
269
- children: /* @__PURE__ */ M(d, { className: "size-3.5" })
267
+ className: H,
268
+ children: /* @__PURE__ */ P(p, { className: "size-3.5" })
270
269
  })
271
270
  })
272
271
  ]
273
272
  });
274
- }, Gt = ({ expanded: e, mobileOpen: t }) => {
275
- if (X) return /* @__PURE__ */ M(xe, { workspace: f });
276
- let n = !e, i = B(Se, n && "relative justify-center px-0"), a = (e) => n ? /* @__PURE__ */ M("span", {
277
- className: "sr-only",
278
- children: e
279
- }) : e;
280
- return /* @__PURE__ */ N(j, { children: [
281
- t && /* @__PURE__ */ M(st, {}),
282
- /* @__PURE__ */ N("nav", {
283
- className: "space-y-0.5",
284
- "aria-label": U("workspaceNav"),
273
+ }, Vt = ({ expanded: e, mobileOpen: t }) => {
274
+ if (Z) return /* @__PURE__ */ P(ve, { workspace: m });
275
+ let n = !e, r = (e) => Y.pathname === e || Y.pathname.startsWith(`${e}/`), i = (e, t) => (n) => W(n, [
276
+ gt(e),
277
+ k,
278
+ ...mt(t)
279
+ ]), a = (e) => (t) => W(t, mt(e)), o = (e, t) => /* @__PURE__ */ F("span", {
280
+ className: "relative flex",
281
+ children: [e, n && t && /* @__PURE__ */ P("span", { className: $e })]
282
+ }), s = y.filter((e) => !e.archivedAt), c = new Set(s.map((e) => e.id)), l = (e) => s.filter((t) => (t.parentId && c.has(t.parentId) ? t.parentId : "") === e), u = (e) => {
283
+ let t = (t) => ue(m, e.key, t), r = Tt.filter((t) => t.identifier.startsWith(`${e.key}-`)).length;
284
+ return /* @__PURE__ */ F(R, {
285
+ label: e.name,
286
+ icon: o(/* @__PURE__ */ P(ye, {
287
+ icon: e.icon,
288
+ color: e.color,
289
+ name: e.name
290
+ }), Ot(e.id) > 0),
291
+ selected: g(Y.pathname, m)?.team === e.key,
292
+ open: !St.has(e.key),
293
+ onOpenChange: (t) => wt(e.key, t),
294
+ onContextMenu: (t) => W(t, ht(e)),
295
+ action: /* @__PURE__ */ P(Ye, {
296
+ items: () => ht(e),
297
+ label: q("moreActionsFor", { name: e.name })
298
+ }),
285
299
  children: [
286
- /* @__PURE__ */ M(H, {
287
- rail: n,
288
- label: U("notifications"),
289
- children: /* @__PURE__ */ N(r, {
290
- to: "/$workspace/notifications",
291
- params: { workspace: f },
292
- onContextMenu: (e) => L(e, K(`/${f}/notifications`)),
293
- className: i,
294
- activeProps: R,
295
- children: [/* @__PURE__ */ M(le, { className: "size-4" }), n ? /* @__PURE__ */ N(j, { children: [a(U("notifications")), Ft > 0 && /* @__PURE__ */ M("span", { className: ot })] }) : /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M("span", {
296
- className: "flex-1",
297
- children: U("notifications")
298
- }), /* @__PURE__ */ M(w, {
299
- count: Ft,
300
- locale: yt,
301
- label: U("unreadCount")
302
- })] })]
300
+ e.triageEnabled && /* @__PURE__ */ P(z, {
301
+ label: K("triage"),
302
+ icon: /* @__PURE__ */ P(ce, { className: "size-4" }),
303
+ href: t("triage"),
304
+ selected: X("triage", e.key),
305
+ onContextMenu: a(t("triage")),
306
+ badge: /* @__PURE__ */ P(E, {
307
+ count: Ot(e.id),
308
+ locale: ft,
309
+ label: K("triageCount")
303
310
  })
304
311
  }),
305
- /* @__PURE__ */ M(H, {
306
- rail: n,
307
- label: U("myIssues"),
308
- children: /* @__PURE__ */ N(r, {
309
- to: "/$workspace/issues",
310
- params: { workspace: f },
311
- search: { assignee: p.user.username },
312
- onContextMenu: (e) => L(e, [
313
- q("my-issues"),
314
- D,
315
- ...K(`/${f}/issues?assignee=${p.user.username}`)
316
- ]),
317
- className: B(i, Et.mine && "bg-[var(--theme-sidebar-active-bg,var(--theme-hover))] hover:bg-[var(--theme-sidebar-active-bg,var(--theme-hover))] !text-[var(--theme-sidebar-active-text,var(--theme-app))] font-medium"),
318
- children: [
319
- /* @__PURE__ */ M(fe, { className: "size-4" }),
320
- " ",
321
- a(U("myIssues"))
322
- ]
323
- })
312
+ /* @__PURE__ */ P(z, {
313
+ label: K("issues"),
314
+ icon: /* @__PURE__ */ P(ae, { className: "size-4" }),
315
+ href: t("issues"),
316
+ selected: xt.team === e.key,
317
+ onContextMenu: a(t("issues"))
324
318
  }),
325
- /* @__PURE__ */ M(H, {
326
- rail: n,
327
- label: U("projects"),
328
- children: /* @__PURE__ */ N(r, {
329
- to: "/$workspace/projects",
330
- params: { workspace: f },
331
- onContextMenu: (e) => L(e, [
332
- q("projects"),
333
- D,
334
- ...K(`/${f}/projects`)
335
- ]),
336
- className: i,
337
- activeProps: R,
338
- children: [
339
- /* @__PURE__ */ M(ue, { className: "size-4" }),
340
- " ",
341
- a(U("projects"))
342
- ]
343
- })
319
+ /* @__PURE__ */ P(z, {
320
+ label: K("projects"),
321
+ icon: /* @__PURE__ */ P(se, { className: "size-4" }),
322
+ href: t("projects"),
323
+ selected: X("projects", e.key),
324
+ onContextMenu: a(t("projects"))
344
325
  }),
345
- /* @__PURE__ */ M(H, {
346
- rail: n,
347
- label: U("knowledge"),
348
- children: /* @__PURE__ */ N(r, {
349
- to: "/$workspace/knowledge",
350
- params: { workspace: f },
351
- onContextMenu: (e) => L(e, [
352
- q("knowledge"),
353
- D,
354
- ...K(`/${f}/knowledge`)
355
- ]),
356
- className: i,
357
- activeProps: R,
358
- children: [
359
- /* @__PURE__ */ M(se, { className: "size-4" }),
360
- " ",
361
- a(U("knowledge"))
362
- ]
363
- })
326
+ /* @__PURE__ */ P(z, {
327
+ label: K("areas"),
328
+ icon: /* @__PURE__ */ P(te, { className: "size-4" }),
329
+ href: t("areas"),
330
+ selected: X("areas", e.key),
331
+ onContextMenu: a(t("areas"))
364
332
  }),
365
- /* @__PURE__ */ M(H, {
366
- rail: n,
367
- label: U("agents"),
368
- children: /* @__PURE__ */ N(r, {
369
- to: "/$workspace/agents",
370
- params: { workspace: f },
371
- onContextMenu: (e) => L(e, [
372
- q("agents"),
373
- D,
374
- ...K(`/${f}/agents`)
375
- ]),
376
- className: i,
377
- activeProps: R,
378
- children: [
379
- /* @__PURE__ */ M(ne, { className: "size-4" }),
380
- " ",
381
- a(U("agents"))
382
- ]
333
+ /* @__PURE__ */ P(z, {
334
+ label: K("decisions"),
335
+ icon: /* @__PURE__ */ P(re, { className: "size-4" }),
336
+ href: t("decisions"),
337
+ selected: X("decisions", e.key),
338
+ onContextMenu: a(t("decisions")),
339
+ badge: /* @__PURE__ */ P(E, {
340
+ count: r,
341
+ locale: ft,
342
+ label: K("waitingCount"),
343
+ className: "bg-agent! text-agent-foreground!"
383
344
  })
384
- })
345
+ }),
346
+ !n && /* @__PURE__ */ P(xe, {
347
+ workspace: m,
348
+ team: e,
349
+ current: Qe(Y.pathname, m)
350
+ }),
351
+ e.cyclesEnabled && /* @__PURE__ */ P(z, {
352
+ label: K("cycles"),
353
+ icon: /* @__PURE__ */ P(ne, { className: "size-4" }),
354
+ href: t("cycles"),
355
+ selected: X("cycles", e.key)
356
+ }),
357
+ l(e.id).map(u)
385
358
  ]
359
+ }, e.id);
360
+ }, f = l("").map(u), p = `/${m}/issues?assignee=${encodeURIComponent(h.user.username)}`;
361
+ return /* @__PURE__ */ F(N, { children: [
362
+ t && /* @__PURE__ */ P(et, {}),
363
+ /* @__PURE__ */ P(z, {
364
+ label: K("notifications"),
365
+ icon: o(/* @__PURE__ */ P(oe, { className: "size-4" }), At > 0),
366
+ href: `/${m}/notifications`,
367
+ selected: r(`/${m}/notifications`),
368
+ onContextMenu: a(`/${m}/notifications`),
369
+ badge: /* @__PURE__ */ P(E, {
370
+ count: At,
371
+ locale: ft,
372
+ label: K("unreadCount")
373
+ })
386
374
  }),
387
- n ? /* @__PURE__ */ M("nav", {
388
- className: "mt-4 space-y-0.5 border-t border-border pt-4",
389
- "aria-label": U("teams"),
390
- children: _.filter((e) => !e.archivedAt).map((e) => /* @__PURE__ */ M(H, {
391
- rail: !0,
392
- label: e.name,
393
- children: /* @__PURE__ */ N(r, {
394
- to: "/$workspace/teams/$key/issues",
395
- params: {
396
- workspace: f,
397
- key: e.key
398
- },
399
- onContextMenu: (t) => L(t, xt(e)),
400
- className: B(i, m(J.pathname, f)?.team === e.key && "bg-[var(--theme-sidebar-active-bg,var(--theme-hover))] hover:bg-[var(--theme-sidebar-active-bg,var(--theme-hover))] !text-[var(--theme-sidebar-active-text,var(--theme-app))] font-medium"),
401
- children: [
402
- /* @__PURE__ */ M(Te, {
403
- icon: e.icon,
404
- color: e.color,
405
- name: e.name
406
- }),
407
- a(e.name),
408
- Nt(e.id) > 0 && /* @__PURE__ */ M("span", { className: ot })
409
- ]
410
- })
411
- }, e.id))
412
- }) : /* @__PURE__ */ N(j, { children: [
413
- /* @__PURE__ */ M(ft, {
414
- workspace: f,
415
- current: Et.saved
375
+ /* @__PURE__ */ P(z, {
376
+ label: K("myIssues"),
377
+ icon: /* @__PURE__ */ P(le, { className: "size-4" }),
378
+ href: p,
379
+ selected: xt.mine,
380
+ onContextMenu: i("my-issues", p)
381
+ }),
382
+ /* @__PURE__ */ P(z, {
383
+ label: K("projects"),
384
+ icon: /* @__PURE__ */ P(se, { className: "size-4" }),
385
+ href: `/${m}/projects`,
386
+ selected: r(`/${m}/projects`),
387
+ onContextMenu: i("projects", `/${m}/projects`)
388
+ }),
389
+ /* @__PURE__ */ P(z, {
390
+ label: K("knowledge"),
391
+ icon: /* @__PURE__ */ P(ie, { className: "size-4" }),
392
+ href: `/${m}/knowledge`,
393
+ selected: r(`/${m}/knowledge`),
394
+ onContextMenu: i("knowledge", `/${m}/knowledge`)
395
+ }),
396
+ /* @__PURE__ */ P(z, {
397
+ label: K("agents"),
398
+ icon: /* @__PURE__ */ P(ee, { className: "size-4" }),
399
+ href: `/${m}/agents`,
400
+ selected: r(`/${m}/agents`),
401
+ onContextMenu: i("agents", `/${m}/agents`)
402
+ }),
403
+ n ? /* @__PURE__ */ P("div", {
404
+ className: "mt-4 border-t border-border pt-4",
405
+ children: f
406
+ }) : /* @__PURE__ */ F(N, { children: [
407
+ /* @__PURE__ */ P(at, {
408
+ workspace: m,
409
+ current: xt.saved
416
410
  }),
417
- /* @__PURE__ */ M(Oe, {
418
- workspace: f,
419
- myUsername: p.user.username,
420
- currentHref: J.pathname + J.searchStr
411
+ /* @__PURE__ */ P(Se, {
412
+ workspace: m,
413
+ myUsername: h.user.username,
414
+ currentHref: Y.pathname + Y.searchStr
421
415
  }),
422
- /* @__PURE__ */ N("div", {
423
- className: "group mt-6 flex h-6 items-center pr-1 pl-2",
424
- children: [/* @__PURE__ */ M("p", {
425
- className: "flex-1 text-xs font-medium text-muted-foreground",
426
- children: U("teams")
427
- }), S && /* @__PURE__ */ M(T, {
416
+ /* @__PURE__ */ F(R, {
417
+ label: K("teams"),
418
+ collapsible: !1,
419
+ action: T && /* @__PURE__ */ P(D, {
428
420
  variant: "ghost",
429
421
  size: "xs",
430
- icon: /* @__PURE__ */ M(u, {}),
431
- label: U("createTeam"),
432
- onClick: () => b(!0),
433
- className: "opacity-0 group-hover:opacity-100 focus-visible:opacity-100"
434
- })]
435
- }),
436
- /* @__PURE__ */ N("nav", {
437
- className: "mt-1 space-y-0.5",
438
- "aria-label": U("teams"),
439
- children: [He(_.filter((e) => !e.archivedAt)).map(({ team: e, depth: t }) => /* @__PURE__ */ N(Xe, { children: [/* @__PURE__ */ N("div", {
440
- className: B(Se, "group gap-0 pr-1 pl-0"),
441
- style: t ? { marginLeft: `${t * .75}rem` } : void 0,
442
- children: [/* @__PURE__ */ N("button", {
443
- type: "button",
444
- onClick: () => kt(e.key),
445
- onContextMenu: (t) => L(t, xt(e)),
446
- "aria-expanded": !Dt.has(e.key),
447
- className: "flex h-full min-w-0 flex-1 items-center gap-2.5 pl-2 text-left",
448
- children: [
449
- /* @__PURE__ */ M(Te, {
450
- icon: e.icon,
451
- color: e.color,
452
- name: e.name
453
- }),
454
- /* @__PURE__ */ M("span", {
455
- className: "truncate",
456
- children: e.name
457
- }),
458
- /* @__PURE__ */ M(ie, { className: B("size-3 shrink-0 text-muted-foreground transition-transform", Dt.has(e.key) && "-rotate-90") })
459
- ]
460
- }), /* @__PURE__ */ M(nt, {
461
- items: () => xt(e),
462
- label: W("moreActionsFor", { name: e.name })
463
- })]
464
- }), !Dt.has(e.key) && /* @__PURE__ */ N(j, { children: [
465
- e.triageEnabled && /* @__PURE__ */ N(r, {
466
- to: "/$workspace/teams/$key/triage",
467
- params: {
468
- workspace: f,
469
- key: e.key
470
- },
471
- onContextMenu: (t) => L(t, K(h(f, e.key, "triage"))),
472
- className: B("flex h-8 items-center gap-2.5 rounded-md px-2 text-sm text-muted-foreground hover:bg-muted hover:text-foreground", "pl-8", Y("triage", e.key) && "bg-[var(--theme-sidebar-active-bg,var(--theme-hover))] hover:bg-[var(--theme-sidebar-active-bg,var(--theme-hover))] !text-[var(--theme-sidebar-active-text,var(--theme-app))] font-medium"),
473
- children: [
474
- /* @__PURE__ */ M(de, { className: "size-4" }),
475
- /* @__PURE__ */ M("span", {
476
- className: "flex-1",
477
- children: U("triage")
478
- }),
479
- /* @__PURE__ */ M(w, {
480
- count: Nt(e.id),
481
- locale: yt,
482
- label: U("triageCount")
483
- })
484
- ]
485
- }),
486
- /* @__PURE__ */ N(r, {
487
- to: "/$workspace/teams/$key/issues",
488
- params: {
489
- workspace: f,
490
- key: e.key
491
- },
492
- onContextMenu: (t) => L(t, K(h(f, e.key, "issues"))),
493
- className: B("flex h-8 items-center gap-2.5 rounded-md px-2 text-sm text-muted-foreground hover:bg-muted hover:text-foreground", "pl-8", Et.team === e.key && "bg-[var(--theme-sidebar-active-bg,var(--theme-hover))] hover:bg-[var(--theme-sidebar-active-bg,var(--theme-hover))] !text-[var(--theme-sidebar-active-text,var(--theme-app))] font-medium"),
494
- children: [
495
- /* @__PURE__ */ M(ce, { className: "size-4" }),
496
- " ",
497
- U("issues")
498
- ]
499
- }),
500
- /* @__PURE__ */ N(r, {
501
- to: "/$workspace/teams/$key/projects",
502
- params: {
503
- workspace: f,
504
- key: e.key
505
- },
506
- onContextMenu: (t) => L(t, K(h(f, e.key, "projects"))),
507
- className: B("flex h-8 items-center gap-2.5 rounded-md px-2 text-sm text-muted-foreground hover:bg-muted hover:text-foreground", "pl-8", Y("projects", e.key) && "bg-[var(--theme-sidebar-active-bg,var(--theme-hover))] hover:bg-[var(--theme-sidebar-active-bg,var(--theme-hover))] !text-[var(--theme-sidebar-active-text,var(--theme-app))] font-medium"),
508
- children: [
509
- /* @__PURE__ */ M(ue, { className: "size-4" }),
510
- " ",
511
- U("projects")
512
- ]
513
- }),
514
- /* @__PURE__ */ N(r, {
515
- to: "/$workspace/teams/$key/areas",
516
- params: {
517
- workspace: f,
518
- key: e.key
519
- },
520
- onContextMenu: (t) => L(t, K(h(f, e.key, "areas"))),
521
- className: B("flex h-8 items-center gap-2.5 rounded-md px-2 text-sm text-muted-foreground hover:bg-muted hover:text-foreground", "pl-8", Y("areas", e.key) && "bg-[var(--theme-sidebar-active-bg,var(--theme-hover))] hover:bg-[var(--theme-sidebar-active-bg,var(--theme-hover))] !text-[var(--theme-sidebar-active-text,var(--theme-app))] font-medium"),
522
- children: [
523
- /* @__PURE__ */ M(re, { className: "size-4" }),
524
- " ",
525
- U("areas")
526
- ]
527
- }),
528
- /* @__PURE__ */ N(r, {
529
- to: "/$workspace/teams/$key/decisions",
530
- params: {
531
- workspace: f,
532
- key: e.key
533
- },
534
- onContextMenu: (t) => L(t, K(h(f, e.key, "decisions"))),
535
- className: B("flex h-8 items-center gap-2.5 rounded-md px-2 text-sm text-muted-foreground hover:bg-muted hover:text-foreground", "pl-8", Y("decisions", e.key) && "bg-[var(--theme-sidebar-active-bg,var(--theme-hover))] hover:bg-[var(--theme-sidebar-active-bg,var(--theme-hover))] !text-[var(--theme-sidebar-active-text,var(--theme-app))] font-medium"),
536
- children: [
537
- /* @__PURE__ */ M(oe, { className: "size-4" }),
538
- /* @__PURE__ */ M("span", {
539
- className: "flex-1",
540
- children: U("decisions")
541
- }),
542
- /* @__PURE__ */ M(w, {
543
- count: At.filter((t) => t.identifier.startsWith(`${e.key}-`)).length,
544
- locale: yt,
545
- label: U("waitingCount"),
546
- className: "bg-agent! text-agent-foreground!"
547
- })
548
- ]
549
- }),
550
- /* @__PURE__ */ M(De, {
551
- workspace: f,
552
- team: e,
553
- current: at(J.pathname, f)
554
- }),
555
- e.cyclesEnabled && /* @__PURE__ */ N(r, {
556
- to: "/$workspace/teams/$key/cycles",
557
- params: {
558
- workspace: f,
559
- key: e.key
560
- },
561
- className: B("flex h-8 items-center gap-2.5 rounded-md px-2 text-sm text-muted-foreground hover:bg-muted hover:text-foreground", "pl-8"),
562
- activeProps: R,
563
- activeOptions: { includeSearch: !1 },
564
- children: [
565
- /* @__PURE__ */ M(ae, { className: "size-4" }),
566
- " ",
567
- U("cycles")
568
- ]
569
- })
570
- ] })] }, e.id)), _.length === 0 && (S ? /* @__PURE__ */ N("button", {
571
- type: "button",
572
- onClick: () => b(!0),
573
- className: B("flex h-8 items-center gap-2.5 rounded-md px-2 text-sm text-muted-foreground hover:bg-muted hover:text-foreground", "w-full"),
574
- children: [
575
- /* @__PURE__ */ M(u, { className: "size-4" }),
576
- " ",
577
- U("createFirstTeam")
578
- ]
579
- }) : /* @__PURE__ */ M("p", {
422
+ icon: /* @__PURE__ */ P(d, {}),
423
+ label: K("createTeam"),
424
+ onClick: () => w(!0)
425
+ }),
426
+ children: [f, y.length === 0 && (T ? /* @__PURE__ */ P(z, {
427
+ label: K("createFirstTeam"),
428
+ icon: /* @__PURE__ */ P(d, { className: "size-4" }),
429
+ onClick: () => w(!0)
430
+ }) : /* @__PURE__ */ P("p", {
580
431
  className: "px-2 text-sm text-muted-foreground",
581
- children: U("noTeams")
432
+ children: K("noTeams")
582
433
  }))]
583
434
  })
584
435
  ] })
585
436
  ] });
586
- }, Kt = X ? void 0 : ({ expanded: e, isMobile: t }) => {
437
+ }, Ht = Z ? void 0 : ({ expanded: e, isMobile: t }) => {
587
438
  let n = [
588
439
  {
589
- label: U("myAccount"),
590
- onClick: () => C({
440
+ label: K("myAccount"),
441
+ onClick: () => V({
591
442
  to: "/$workspace/settings/account",
592
- params: { workspace: f }
443
+ params: { workspace: m }
593
444
  })
594
445
  },
595
446
  {
596
- label: U("settings"),
597
- onClick: () => C({
447
+ label: K("settings"),
448
+ onClick: () => V({
598
449
  to: "/$workspace/settings",
599
- params: { workspace: f }
450
+ params: { workspace: m }
600
451
  })
601
452
  },
602
- ...Bt ? [{
603
- label: U("installApp"),
604
- onClick: ze
453
+ ...It ? [{
454
+ label: K("installApp"),
455
+ onClick: Re
605
456
  }] : [],
606
- ...Ht ? [D, {
607
- label: U("signOut"),
608
- onClick: Ut
457
+ ...Rt ? [k, {
458
+ label: K("signOut"),
459
+ onClick: zt
609
460
  }] : []
610
- ], r = /* @__PURE__ */ M(We, {
611
- name: p.user.name,
612
- src: p.user.avatarUrl,
461
+ ], r = /* @__PURE__ */ P(Le, {
462
+ name: h.user.name,
463
+ src: h.user.avatarUrl,
613
464
  size: "sm",
614
465
  decorative: !0
615
466
  });
616
- return e ? /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M(dt, {
617
- myUsername: p.user.username,
618
- workspace: f
619
- }), /* @__PURE__ */ N("div", {
467
+ return e ? /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(it, {
468
+ myUsername: h.user.username,
469
+ workspace: m
470
+ }), /* @__PURE__ */ F("div", {
620
471
  className: "flex items-center gap-1",
621
- children: [/* @__PURE__ */ M(Ue, {
622
- label: U("accountMenu", { name: p.user.name }),
472
+ children: [/* @__PURE__ */ P(Ie, {
473
+ label: K("accountMenu", { name: h.user.name }),
623
474
  side: "top",
624
475
  align: "start",
625
476
  matchTriggerWidth: !0,
626
477
  items: n,
627
- trigger: /* @__PURE__ */ N("button", {
478
+ trigger: /* @__PURE__ */ F("button", {
628
479
  type: "button",
629
480
  className: "flex h-9 min-w-0 flex-1 items-center gap-2 rounded-md px-1.5 text-left hover:bg-muted",
630
- children: [r, /* @__PURE__ */ M("span", {
481
+ children: [r, /* @__PURE__ */ P("span", {
631
482
  className: "min-w-0 flex-1 truncate text-sm",
632
- children: p.user.name
483
+ children: h.user.name
633
484
  })]
634
485
  })
635
- }), !t && /* @__PURE__ */ M(I, {})]
636
- })] }) : /* @__PURE__ */ N("div", {
486
+ }), !t && /* @__PURE__ */ P(B, {})]
487
+ })] }) : /* @__PURE__ */ F("div", {
637
488
  className: "flex flex-col items-center gap-2",
638
- children: [/* @__PURE__ */ M(I, {}), /* @__PURE__ */ M(Ue, {
639
- label: U("accountMenu", { name: p.user.name }),
489
+ children: [/* @__PURE__ */ P(B, {}), /* @__PURE__ */ P(Ie, {
490
+ label: K("accountMenu", { name: h.user.name }),
640
491
  side: "right",
641
492
  align: "end",
642
493
  items: n,
@@ -645,89 +496,89 @@ function V() {
645
496
  children: r
646
497
  })]
647
498
  });
648
- }, qt = /* @__PURE__ */ M(ct, {
649
- workspace: f,
650
- name: g.name,
651
- apps: p.apps ?? [],
652
- unread: Ft,
499
+ }, Ut = /* @__PURE__ */ P(tt, {
500
+ workspace: m,
501
+ name: v.name,
502
+ apps: h.apps ?? [],
503
+ unread: At,
653
504
  onSearch: () => $(!0),
654
505
  onNewIssue: () => Q()
655
506
  });
656
- return /* @__PURE__ */ M(Re, {
657
- workspace: f,
658
- children: /* @__PURE__ */ M(ke, {
659
- actions: p.actions ?? [],
660
- children: /* @__PURE__ */ M(_e.Provider, {
507
+ return /* @__PURE__ */ P(Me, {
508
+ workspace: m,
509
+ children: /* @__PURE__ */ P(Ce, {
510
+ actions: h.actions ?? [],
511
+ children: /* @__PURE__ */ P(me.Provider, {
661
512
  value: Q,
662
- children: /* @__PURE__ */ N(ve.Provider, {
663
- value: Rt,
513
+ children: /* @__PURE__ */ F(he.Provider, {
514
+ value: Pt,
664
515
  children: [
665
- v ? /* @__PURE__ */ M(lt, {
666
- sidebar: v.sidebar,
667
- brand: Wt,
668
- navigation: Gt,
669
- header: qt,
670
- presence: /* @__PURE__ */ M(dt, {
671
- myUsername: p.user.username,
672
- workspace: f
516
+ b ? /* @__PURE__ */ P(nt, {
517
+ sidebar: b.sidebar,
518
+ brand: Bt,
519
+ navigation: Vt,
520
+ header: Ut,
521
+ presence: /* @__PURE__ */ P(it, {
522
+ myUsername: h.user.username,
523
+ workspace: m
673
524
  }),
674
- children: /* @__PURE__ */ M(ut, { children: /* @__PURE__ */ M(Je, {}) })
675
- }) : /* @__PURE__ */ M(rt, {
676
- expanded: St || X,
525
+ children: /* @__PURE__ */ P(rt, { children: /* @__PURE__ */ P(He, {}) })
526
+ }) : /* @__PURE__ */ P(Xe, {
527
+ expanded: _t || Z,
677
528
  onExpandedChange: (e) => {
678
- Ct(e), ht({
529
+ vt(e), ct({
679
530
  expanded: e,
680
- width: wt
531
+ width: yt
681
532
  });
682
533
  },
683
- width: wt,
534
+ width: yt,
684
535
  onWidthChange: (e) => {
685
- Tt(e), ht({
686
- expanded: St,
536
+ bt(e), ct({
537
+ expanded: _t,
687
538
  width: e
688
539
  });
689
540
  },
690
- navigationKey: J.pathname + J.searchStr,
691
- navigationResetKey: X ? "settings" : "workspace",
541
+ navigationKey: Y.pathname + Y.searchStr,
542
+ navigationResetKey: Z ? "settings" : "workspace",
692
543
  mainClassName: "flex flex-col overflow-hidden",
693
544
  labels: {
694
- navigation: U("navigation"),
695
- skipToContent: U("skipToContent"),
696
- openNavigation: U("openNav"),
697
- closeNavigation: U("closeNav"),
698
- expandSidebar: U("expandSidebar"),
699
- collapseSidebar: U("collapseSidebar"),
700
- resizeSidebar: U("resizeSidebar")
545
+ navigation: K("navigation"),
546
+ skipToContent: K("skipToContent"),
547
+ openNavigation: K("openNav"),
548
+ closeNavigation: K("closeNav"),
549
+ expandSidebar: K("expandSidebar"),
550
+ collapseSidebar: K("collapseSidebar"),
551
+ resizeSidebar: K("resizeSidebar")
701
552
  },
702
- header: qt,
703
- brand: Wt,
704
- navigation: Gt,
705
- footer: Kt,
706
- children: /* @__PURE__ */ M(ut, { children: /* @__PURE__ */ M(Je, {}) })
553
+ header: Ut,
554
+ brand: Bt,
555
+ navigation: Vt,
556
+ footer: Ht,
557
+ children: /* @__PURE__ */ P(rt, { children: /* @__PURE__ */ P(He, {}) })
707
558
  }),
708
- /* @__PURE__ */ M(je, { workspace: f }),
709
- !zt && /* @__PURE__ */ M(vt, {}),
710
- /* @__PURE__ */ M(Ee, {
711
- workspace: f,
712
- open: It,
559
+ /* @__PURE__ */ P(Te, { workspace: m }),
560
+ !Ft && /* @__PURE__ */ P(dt, {}),
561
+ /* @__PURE__ */ P(be, {
562
+ workspace: m,
563
+ open: Mt,
713
564
  onClose: () => $(!1),
714
- selection: Lt
565
+ selection: Nt
715
566
  }),
716
- /* @__PURE__ */ M(Fe, { workspace: f }),
717
- we && /* @__PURE__ */ M(Ne, {
718
- workspace: f,
719
- onClose: () => b(!1)
567
+ /* @__PURE__ */ P(ke, { workspace: m }),
568
+ we && /* @__PURE__ */ P(De, {
569
+ workspace: m,
570
+ onClose: () => w(!1)
720
571
  }),
721
- y && /* @__PURE__ */ M(Ze, { children: /* @__PURE__ */ M(Pe, {
722
- workspace: f,
723
- ...y.team && { defaultTeam: y.team },
724
- ...y.title && { defaultTitle: y.title },
725
- ...y.body && { defaultBody: y.body },
726
- ...y.area && { defaultArea: y.area },
727
- ...y.origin && { origin: y.origin },
728
- ...y.fields && { defaults: y.fields },
729
- ...y.onCreated && { onCreated: y.onCreated },
730
- onClose: () => Ce(null)
572
+ x && /* @__PURE__ */ P(We, { children: /* @__PURE__ */ P(Oe, {
573
+ workspace: m,
574
+ ...x.team && { defaultTeam: x.team },
575
+ ...x.title && { defaultTitle: x.title },
576
+ ...x.body && { defaultBody: x.body },
577
+ ...x.area && { defaultArea: x.area },
578
+ ...x.origin && { origin: x.origin },
579
+ ...x.fields && { defaults: x.fields },
580
+ ...x.onCreated && { onCreated: x.onCreated },
581
+ onClose: () => S(null)
731
582
  }) })
732
583
  ]
733
584
  })
@@ -735,98 +586,90 @@ function V() {
735
586
  })
736
587
  });
737
588
  }
738
- function H({ rail: e, label: t, children: n }) {
739
- return /* @__PURE__ */ M(E, {
740
- content: t,
741
- side: "right",
742
- disabled: !e,
743
- children: n
744
- });
745
- }
746
- function st() {
747
- return O(() => {
589
+ function et() {
590
+ return A(() => {
748
591
  document.querySelector(".pw-frame-drawer [aria-current=\"page\"]")?.scrollIntoView({ block: "nearest" });
749
592
  }, []), null;
750
593
  }
751
- function ct({ workspace: e, name: n, apps: r, unread: i, onSearch: a, onNewIssue: o }) {
752
- let { isMobile: s } = it(), c = t(), l = A("workspace");
753
- return s ? /* @__PURE__ */ N("div", {
594
+ function tt({ workspace: e, name: n, apps: r, unread: i, onSearch: a, onNewIssue: o }) {
595
+ let { isMobile: s } = V(), c = t(), l = M("workspace");
596
+ return s ? /* @__PURE__ */ F("div", {
754
597
  className: "flex h-12 items-center gap-1 border-b border-border px-1",
755
598
  children: [
756
- /* @__PURE__ */ M(I, {}),
757
- /* @__PURE__ */ M("span", {
599
+ /* @__PURE__ */ P(B, {}),
600
+ /* @__PURE__ */ P("span", {
758
601
  className: "min-w-0 flex-1 truncate text-sm font-semibold",
759
602
  children: n
760
603
  }),
761
- !c && /* @__PURE__ */ M(x, {}),
762
- !c && /* @__PURE__ */ M(pe, { apps: r }),
763
- /* @__PURE__ */ M(T, {
604
+ !c && /* @__PURE__ */ P(C, {}),
605
+ !c && /* @__PURE__ */ P(_, { apps: r }),
606
+ /* @__PURE__ */ P(D, {
764
607
  variant: "ghost",
765
608
  size: "lg",
766
- icon: /* @__PURE__ */ M(d, {}),
609
+ icon: /* @__PURE__ */ P(p, {}),
767
610
  label: l("openPalette"),
768
611
  onClick: a
769
612
  }),
770
- /* @__PURE__ */ M(T, {
613
+ /* @__PURE__ */ P(D, {
771
614
  variant: "ghost",
772
615
  size: "lg",
773
- icon: /* @__PURE__ */ M(le, {}),
616
+ icon: /* @__PURE__ */ P(oe, {}),
774
617
  label: l("notifications"),
775
618
  href: `/${e}/notifications`,
776
619
  dot: i > 0
777
620
  }),
778
- /* @__PURE__ */ M(T, {
621
+ /* @__PURE__ */ P(D, {
779
622
  variant: "ghost",
780
623
  size: "lg",
781
- icon: /* @__PURE__ */ M(u, {}),
624
+ icon: /* @__PURE__ */ P(d, {}),
782
625
  label: l("newIssue"),
783
626
  onClick: o
784
627
  })
785
628
  ]
786
629
  }) : null;
787
630
  }
788
- function lt({ sidebar: e, brand: t, navigation: n, header: r, presence: i, children: a }) {
789
- let o = it();
790
- return /* @__PURE__ */ N(j, { children: [e && L(/* @__PURE__ */ N("div", {
631
+ function nt({ sidebar: e, brand: t, navigation: n, header: r, presence: i, children: a }) {
632
+ let o = V();
633
+ return /* @__PURE__ */ F(N, { children: [e && Ze(/* @__PURE__ */ F("div", {
791
634
  className: "tandem-hosted-sidebar flex flex-col gap-3",
792
635
  children: [
793
636
  t?.(o),
794
637
  n(o),
795
638
  o.expanded && i
796
639
  ]
797
- }), e), /* @__PURE__ */ N("div", {
640
+ }), e), /* @__PURE__ */ F("div", {
798
641
  className: "flex h-full min-h-0 flex-col",
799
642
  children: [r, a]
800
643
  })] });
801
644
  }
802
- function ut({ children: e }) {
803
- let { state: t } = b(), n = t?.open && t.maximized;
804
- return /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M("div", {
805
- className: B("min-h-0 min-w-0 flex-1 overflow-y-auto bg-card", n && "hidden"),
645
+ function rt({ children: e }) {
646
+ let { state: t } = we(), n = t?.open && t.maximized;
647
+ return /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P("div", {
648
+ className: U("min-h-0 min-w-0 flex-1 overflow-y-auto bg-card", n && "hidden"),
806
649
  children: e
807
- }), /* @__PURE__ */ M(S, {})] });
650
+ }), /* @__PURE__ */ P(w, {})] });
808
651
  }
809
- function dt({ myUsername: e, workspace: t }) {
810
- let { people: n, page: r } = ze(), { person: i } = _(t), a = A("workspace"), o = new Set(n.map((e) => e.username).filter((t) => t !== e));
652
+ function it({ myUsername: e, workspace: t }) {
653
+ let { people: n, page: r } = Ne(), { person: i } = y(t), a = M("workspace"), o = new Set(n.map((e) => e.username).filter((t) => t !== e));
811
654
  if (o.size === 0) return null;
812
655
  let s = [...new Set(n.filter((t) => t.username !== e && t.page === r).map((e) => e.username))];
813
- return /* @__PURE__ */ N("div", {
656
+ return /* @__PURE__ */ F("div", {
814
657
  className: "flex items-center gap-2 px-2 pb-2 text-xs text-muted-foreground",
815
- children: [s.length > 0 && /* @__PURE__ */ M(C, {
658
+ children: [s.length > 0 && /* @__PURE__ */ P(Re, {
816
659
  size: "xs",
817
660
  max: 5,
818
661
  showOverflow: !1,
819
662
  ringColor: "var(--theme-sidebar-bg, var(--theme-muted-panel-bg))",
820
663
  label: a("onThisPage", { count: s.length }),
821
- children: s.map((e) => /* @__PURE__ */ M(Ae, {
664
+ children: s.map((e) => /* @__PURE__ */ P(T, {
822
665
  workspace: t,
823
666
  handle: e,
824
- children: /* @__PURE__ */ M(We, {
667
+ children: /* @__PURE__ */ P(Le, {
825
668
  name: i(e).name,
826
669
  src: i(e).avatarUrl
827
670
  })
828
671
  }, e))
829
- }), /* @__PURE__ */ M("span", { children: s.length === 1 ? a("oneOnThisPage", {
672
+ }), /* @__PURE__ */ P("span", { children: s.length === 1 ? a("oneOnThisPage", {
830
673
  name: i(s[0] ?? "").name,
831
674
  count: o.size
832
675
  }) : s.length > 1 ? a("othersOnThisPage", {
@@ -835,55 +678,38 @@ function dt({ myUsername: e, workspace: t }) {
835
678
  }) : a("online", { count: o.size }) })]
836
679
  });
837
680
  }
838
- function ft({ workspace: e, current: t }) {
839
- let n = A("savedViews"), i = A("common"), a = qe(), { views: o } = y(e), { menu: s, dialogs: c } = Ce(e);
840
- return o.length === 0 ? c : /* @__PURE__ */ N(j, { children: [
841
- /* @__PURE__ */ M("p", {
842
- className: "mt-6 flex h-6 items-center px-2 text-xs font-medium text-muted-foreground",
843
- children: n("title")
844
- }),
845
- /* @__PURE__ */ M("nav", {
846
- className: "mt-1 space-y-0.5",
847
- "aria-label": n("title"),
848
- children: o.map((o) => /* @__PURE__ */ N("div", {
849
- className: B(Se, "group gap-0 pr-1 pl-0", p(o, t) && "bg-[var(--theme-sidebar-active-bg,var(--theme-hover))] hover:bg-[var(--theme-sidebar-active-bg,var(--theme-hover))] !text-[var(--theme-sidebar-active-text,var(--theme-app))] font-medium"),
850
- children: [/* @__PURE__ */ M(E, {
851
- content: o.shared ? n("sharedBy", { owner: o.owner }) : n("onlyYou"),
852
- side: "right",
853
- describesAnchor: !0,
854
- children: /* @__PURE__ */ N(r, {
855
- to: "/$workspace/issues",
856
- params: { workspace: e },
857
- search: we(o),
858
- onContextMenu: (e) => a(e, s(o)),
859
- className: "flex h-full min-w-0 flex-1 items-center gap-2.5 pl-2",
860
- children: [o.shared ? /* @__PURE__ */ M(f, { className: "size-4" }) : /* @__PURE__ */ M(ce, { className: "size-4" }), /* @__PURE__ */ M("span", {
861
- className: "truncate",
862
- children: o.name
863
- })]
864
- })
865
- }), /* @__PURE__ */ M(nt, {
866
- items: () => s(o),
867
- label: i("moreActionsFor", { name: o.name })
868
- })]
869
- }, o.id))
870
- }),
871
- c
872
- ] });
681
+ function at({ workspace: e, current: t }) {
682
+ let n = M("savedViews"), r = M("common"), i = Ve(), { views: a } = b(e), { menu: o, dialogs: s } = x(e);
683
+ return a.length === 0 ? s : /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(R, {
684
+ label: n("title"),
685
+ collapsible: !1,
686
+ children: a.map((a) => /* @__PURE__ */ P(z, {
687
+ label: a.name,
688
+ icon: a.shared ? /* @__PURE__ */ P(m, { className: "size-4" }) : /* @__PURE__ */ P(ae, { className: "size-4" }),
689
+ href: S(e, a),
690
+ selected: h(a, t),
691
+ title: a.shared ? n("sharedBy", { owner: a.owner }) : n("onlyYou"),
692
+ onContextMenu: (e) => i(e, o(a)),
693
+ action: /* @__PURE__ */ P(Ye, {
694
+ items: () => o(a),
695
+ label: r("moreActionsFor", { name: a.name })
696
+ })
697
+ }, a.id))
698
+ }), s] });
873
699
  }
874
- var U = (e) => `tandem:collapsed-teams:${e}`;
875
- function pt(e) {
700
+ var G = (e) => `tandem:collapsed-teams:${e}`;
701
+ function ot(e) {
876
702
  try {
877
- let t = JSON.parse(localStorage.getItem(U(e)) ?? "[]");
703
+ let t = JSON.parse(localStorage.getItem(G(e)) ?? "[]");
878
704
  return new Set(Array.isArray(t) ? t.filter((e) => typeof e == "string") : []);
879
705
  } catch {
880
706
  return /* @__PURE__ */ new Set();
881
707
  }
882
708
  }
883
- var W = "tandem:sidebar";
884
- function mt() {
709
+ var K = "tandem:sidebar";
710
+ function st() {
885
711
  try {
886
- let e = JSON.parse(localStorage.getItem(W) ?? "{}");
712
+ let e = JSON.parse(localStorage.getItem(K) ?? "{}");
887
713
  return {
888
714
  expanded: e?.expanded !== !1,
889
715
  width: typeof e?.width == "number" ? e.width : 240
@@ -895,21 +721,21 @@ function mt() {
895
721
  };
896
722
  }
897
723
  }
898
- function ht(e) {
724
+ function ct(e) {
899
725
  try {
900
- localStorage.setItem(W, JSON.stringify(e));
726
+ localStorage.setItem(K, JSON.stringify(e));
901
727
  } catch {}
902
728
  }
903
- function gt(e, t) {
729
+ function lt(e, t) {
904
730
  try {
905
- localStorage.setItem(U(e), JSON.stringify([...t]));
731
+ localStorage.setItem(G(e), JSON.stringify([...t]));
906
732
  } catch {}
907
733
  }
908
- function _t() {
734
+ function ut() {
909
735
  return Array.from(document.querySelectorAll("[aria-keyshortcuts]")).some((e) => /\b(Meta|Control)\+F\b/.test(e.getAttribute("aria-keyshortcuts") ?? "") && e.getClientRects().length > 0);
910
736
  }
911
- function vt() {
912
- return O(() => {
737
+ function dt() {
738
+ return A(() => {
913
739
  let t = Intl.DateTimeFormat().resolvedOptions().timeZone;
914
740
  try {
915
741
  if (!t || sessionStorage.getItem("tandem:time-zone") === t) return;
@@ -918,4 +744,4 @@ function vt() {
918
744
  e.PATCH("/api/v1/me", { body: { timeZone: t } }).catch(() => {});
919
745
  }, []), null;
920
746
  }
921
- export { V as component };
747
+ export { W as component };