@parallelworks/tandem-web 0.160.1 → 0.161.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,61 +1,61 @@
1
1
  import { api as e, unwrap as t } from "../api/client.js";
2
2
  import { useNavigate as n } from "../lib/router.js";
3
- import { cyclesQuery as r, issueTemplatesQuery as i, labelsQuery as a, statusesQuery as ee, teamsQuery as te } from "../api/queries.js";
4
- import { invalidateIssueViews as ne } from "../api/mutations.js";
5
- import { CalendarIcon as re, CycleIcon as ie, EstimateIcon as ae, FileTextIcon as oe, FolderIcon as se, PriorityIcon as ce, StatusIcon as le, TagIcon as ue, UserIcon as de, usePriorityNames as fe } from "./icons.js";
6
- import { useTime as pe } from "../lib/time.js";
7
- import { scalePoints as me, useEstimateLabel as he } from "./Planning.js";
8
- import { PickManyBox as ge, usePickMany as _e } from "../lib/pickMany.js";
9
- import { parseAssigneeKey as ve, useAssigneeOptions as ye } from "../lib/assignees.js";
10
- import { attachmentPrefix as be, insertPreviews as xe, readDataURL as Se, uploadAttachment as Ce } from "../lib/attachments.js";
11
- import { useCan as we } from "../lib/roles.js";
3
+ import { cyclesQuery as r, issueTemplatesQuery as i, labelsQuery as a, myTeamsQuery as ee, statusesQuery as te, teamsQuery as ne } from "../api/queries.js";
4
+ import { invalidateIssueViews as re } from "../api/mutations.js";
5
+ import { CalendarIcon as ie, CycleIcon as ae, EstimateIcon as oe, FileTextIcon as se, FolderIcon as ce, PriorityIcon as le, StatusIcon as ue, TagIcon as de, UserIcon as fe, usePriorityNames as pe } from "./icons.js";
6
+ import { useTime as me } from "../lib/time.js";
7
+ import { scalePoints as he, useEstimateLabel as ge } from "./Planning.js";
8
+ import { PickManyBox as _e, usePickMany as ve } from "../lib/pickMany.js";
9
+ import { parseAssigneeKey as ye, useAssigneeOptions as be } from "../lib/assignees.js";
10
+ import { attachmentPrefix as xe, insertPreviews as Se, readDataURL as Ce, uploadAttachment as we } from "../lib/attachments.js";
11
+ import { useCan as Te } from "../lib/roles.js";
12
12
  import { hasValue as o } from "../lib/customFields.js";
13
- import { useConfirm as Te } from "../lib/confirm.js";
14
- import { issueTypesQuery as Ee, typesFor as De } from "../lib/issueTypes.js";
15
- import { TypeIcon as Oe } from "./IssueTypes.js";
16
- import { NewIssueFields as ke } from "./CustomFields.js";
17
- import { AttachButton as Ae, useAttachmentsOn as je } from "./Attachments.js";
18
- import { Editor as Me } from "./Editor.js";
19
- import { withoutLink as Ne } from "../lib/markdownLinks.js";
20
- import { TeamForm as Pe } from "./TeamForm.js";
21
- import { Button as Fe, Combobox as s, CreateModal as Ie, DatePicker as Le, Modal as Re, buttonClasses as ze, toast as Be } from "@parallelworks/ui";
22
- import { useEffect as Ve, useRef as c, useState as l } from "react";
23
- import { useErrorMessage as He } from "@parallelworks/problem/react";
13
+ import { useConfirm as Ee } from "../lib/confirm.js";
14
+ import { issueTypesQuery as De, typesFor as Oe } from "../lib/issueTypes.js";
15
+ import { TypeIcon as ke } from "./IssueTypes.js";
16
+ import { NewIssueFields as Ae } from "./CustomFields.js";
17
+ import { AttachButton as je, useAttachmentsOn as Me } from "./Attachments.js";
18
+ import { Editor as Ne } from "./Editor.js";
19
+ import { withoutLink as Pe } from "../lib/markdownLinks.js";
20
+ import { TeamForm as Fe } from "./TeamForm.js";
21
+ import { Button as Ie, Combobox as s, CreateModal as Le, DatePicker as Re, Modal as ze, buttonClasses as Be, toast as Ve } from "@parallelworks/ui";
22
+ import { useEffect as He, useRef as c, useState as l } from "react";
23
+ import { useErrorMessage as Ue } from "@parallelworks/problem/react";
24
24
  import { useTranslations as u } from "use-intl";
25
- import { Fragment as Ue, jsx as d, jsxs as f } from "react/jsx-runtime";
26
- import { useQuery as p, useQueryClient as We, useSuspenseQuery as Ge } from "@tanstack/react-query";
25
+ import { Fragment as We, jsx as d, jsxs as f } from "react/jsx-runtime";
26
+ import { useQuery as p, useQueryClient as Ge, useSuspenseQuery as Ke } from "@tanstack/react-query";
27
27
  // src/components/NewIssueDialog.tsx
28
- function m({ workspace: m, defaultTeam: h, defaultTitle: Je = "", defaultBody: g = "", defaultArea: _, origin: v, defaults: y = {}, onCreated: Ye, onClose: b }) {
29
- let { data: Xe } = Ge(te(m)), x = Xe.filter((e) => !e.archivedAt), S = !Je && !g && !_ && !v && Object.keys(y).length === 0, [C] = l(() => S ? Ke(m) : void 0), [w, Ze] = l(h ?? x.find((e) => e.key === C?.team)?.key ?? x[0]?.key ?? ""), { data: Qe = [] } = p({
30
- ...ee(m, w),
28
+ function m({ workspace: m, defaultTeam: h, defaultTitle: Ye = "", defaultBody: g = "", defaultArea: _, origin: v, defaults: y = {}, onCreated: Xe, onClose: b }) {
29
+ let { data: Ze } = Ke(ee(m)), { data: Qe = [] } = p(ne(m)), $e = h && !Ze.some((e) => e.key === h) ? Qe.find((e) => e.key === h) : void 0, x = [...Ze, ...$e ? [$e] : []].filter((e) => !e.archivedAt), S = !Ye && !g && !_ && !v && Object.keys(y).length === 0, [C] = l(() => S ? qe(m) : void 0), [w, et] = l(h ?? x.find((e) => e.key === C?.team)?.key ?? x[0]?.key ?? ""), { data: T = [] } = p({
30
+ ...te(m, w),
31
31
  enabled: !!w
32
- }), { data: $e = [] } = p(a(m)), { data: T = [] } = p({
32
+ }), { data: tt = [] } = p(a(m)), { data: E = [] } = p({
33
33
  ...i(m, w),
34
34
  enabled: !!w
35
- }), [E, et] = l(null), tt = T.find((e) => e.id === E), [D, nt] = l(Je || C?.title || ""), O = c(D), rt = u("issueTemplates"), it = ye(m, !0), at = fe(), k = u("newIssue"), ot = He(), A = u("common"), j = we(m, "manage_teams"), [M, N] = l(g || C?.body || ""), st = c(M), [ct, lt] = l(y.statusId ?? null), [P, ut] = l(y.priority ?? 0), [F, dt] = l(0), [I, ft] = l(""), [L, pt] = l(y.cycleId ?? ""), R = u("planning"), mt = he(), ht = pe(), { data: gt = [] } = p({
35
+ }), [D, nt] = l(null), rt = E.find((e) => e.id === D), [O, it] = l(Ye || C?.title || ""), k = c(O), at = u("issueTemplates"), ot = be(m, !0), st = pe(), A = u("newIssue"), ct = Ue(), j = u("common"), M = Te(m, "manage_teams"), [N, P] = l(g || C?.body || ""), lt = c(N), [ut, dt] = l(y.statusId ?? null), [F, ft] = l(y.priority ?? 0), [I, pt] = l(0), [L, mt] = l(""), [R, ht] = l(y.cycleId ?? ""), z = u("planning"), gt = ge(), _t = me(), { data: vt = [] } = p({
36
36
  ...r(m, w),
37
37
  enabled: !!x.find((e) => e.key === w)?.cyclesEnabled
38
- }), _t = gt.find((e) => e.id === L), vt = (e) => e.name ? R("cycleNamed", {
38
+ }), yt = vt.find((e) => e.id === R), bt = (e) => e.name ? z("cycleNamed", {
39
39
  number: e.number,
40
40
  name: e.name
41
- }) : R("cycle", { number: e.number }), z = x.find((e) => e.key === w)?.estimateScale ?? "none", [B, yt] = l(y.assignees ?? []), [V, bt] = l(y.labelIds ?? []), [H, U] = l({}), [W, G] = l(null), { data: xt } = p(Ee(m)), K = De(xt, x.find((e) => e.key === w)?.id), q = K.find((e) => e.id === W), St = u("issueTypes"), [J, Y] = l(null), Ct = _e(J === "assignees", () => Y(null)), wt = _e(J === "labels", () => Y(null)), [Tt, Et] = l(null), Dt = We(), Ot = n(), { confirm: kt, dialog: At } = Te(), X = c(!1);
42
- Ve(() => {
41
+ }) : z("cycle", { number: e.number }), B = x.find((e) => e.key === w)?.estimateScale ?? "none", [V, xt] = l(y.assignees ?? []), [H, St] = l(y.labelIds ?? []), [U, W] = l({}), [G, Ct] = l(null), { data: wt } = p(De(m)), K = Oe(wt, x.find((e) => e.key === w)?.id), q = K.find((e) => e.id === G), Tt = u("issueTypes"), [J, Y] = l(null), Et = ve(J === "assignees", () => Y(null)), Dt = ve(J === "labels", () => Y(null)), [Ot, kt] = l(null), At = Ge(), jt = n(), { confirm: Mt, dialog: Nt } = Ee(), Pt = c(!1);
42
+ He(() => {
43
43
  let e = () => {
44
- S && qe(m, {
44
+ S && Je(m, {
45
45
  team: w,
46
- title: O.current,
47
- body: M
46
+ title: k.current,
47
+ body: N
48
48
  }), b();
49
49
  }, t = (t) => {
50
- if (!(t.key !== "Escape" || J !== null || X.current) && !document.querySelector("[role=\"menu\"], [role=\"listbox\"]")) {
51
- if (O.current === D && M === st.current) return e();
52
- X.current = !0, kt({
53
- title: k("closeTitle"),
54
- description: k(S ? "closeKeepsDraft" : "closeLoses"),
55
- confirmLabel: A("close"),
50
+ if (!(t.key !== "Escape" || J !== null || Pt.current) && !document.querySelector("[role=\"menu\"], [role=\"listbox\"]")) {
51
+ if (k.current === O && N === lt.current) return e();
52
+ Pt.current = !0, Mt({
53
+ title: A("closeTitle"),
54
+ description: A(S ? "closeKeepsDraft" : "closeLoses"),
55
+ confirmLabel: j("close"),
56
56
  onConfirm: async () => e()
57
57
  }).finally(() => {
58
- X.current = !1;
58
+ Pt.current = !1;
59
59
  });
60
60
  }
61
61
  };
@@ -65,13 +65,13 @@ function m({ workspace: m, defaultTeam: h, defaultTitle: Je = "", defaultBody: g
65
65
  S,
66
66
  m,
67
67
  w,
68
- M,
69
- D,
68
+ N,
69
+ O,
70
70
  b,
71
- kt,
72
- k,
73
- A
74
- ]), Ve(() => {
71
+ Mt,
72
+ A,
73
+ j
74
+ ]), He(() => {
75
75
  let e = (e) => {
76
76
  if (e.metaKey || e.ctrlKey || e.altKey || e.key.length !== 1 || document.activeElement && document.activeElement !== document.body) return;
77
77
  let t = document.querySelector("[role=\"dialog\"]");
@@ -81,32 +81,32 @@ function m({ workspace: m, defaultTeam: h, defaultTitle: Je = "", defaultBody: g
81
81
  };
82
82
  return window.addEventListener("keydown", e, !0), () => window.removeEventListener("keydown", e, !0);
83
83
  }, []);
84
- let jt = () => {
85
- S && qe(m, {
84
+ let Ft = () => {
85
+ S && Je(m, {
86
86
  team: w,
87
87
  title: "",
88
88
  body: ""
89
89
  }), b();
90
- }, Z = Qe.find((e) => e.id === ct) ?? Qe.find((e) => e.category === "unstarted"), Q = c(null), Mt = c(/* @__PURE__ */ new Map()), Nt = je(), Pt = u("issue.attachments"), Ft = async (e, t) => {
91
- if (!Nt) {
92
- Be.error(Pt("off", { name: e[0]?.name ?? "" }));
90
+ }, X = T.find((e) => e.id === ut) ?? T.find((e) => e.category === "unstarted"), Z = c(null), Q = c(/* @__PURE__ */ new Map()), It = Me(), Lt = u("issue.attachments"), Rt = async (e, t) => {
91
+ if (!It) {
92
+ Ve.error(Lt("off", { name: e[0]?.name ?? "" }));
93
93
  return;
94
94
  }
95
95
  let n = await Promise.all(e.map(async (e) => ({
96
96
  file: e,
97
- src: await Se(e)
97
+ src: await Ce(e)
98
98
  })));
99
- for (let { file: e, src: t } of n) Mt.current.set(t, e);
100
- Q.current && !Q.current.isDestroyed && xe(Q.current, n, t);
101
- }, It = async (t) => {
102
- let n = M;
103
- for (let [e, r] of Mt.current) if (M.includes(e)) try {
104
- let i = await Ce(m, t, r);
105
- n = n.replaceAll(`(${e})`, `(${be}${i.id})`);
99
+ for (let { file: e, src: t } of n) Q.current.set(t, e);
100
+ Z.current && !Z.current.isDestroyed && Se(Z.current, n, t);
101
+ }, zt = async (t) => {
102
+ let n = N;
103
+ for (let [e, r] of Q.current) if (N.includes(e)) try {
104
+ let i = await we(m, t, r);
105
+ n = n.replaceAll(`(${e})`, `(${xe}${i.id})`);
106
106
  } catch (t) {
107
- n = Ne(n, e), Be.error(k("attachFailed", {
107
+ n = Pe(n, e), Ve.error(A("attachFailed", {
108
108
  name: r.name,
109
- reason: ot(t)
109
+ reason: ct(t)
110
110
  }));
111
111
  }
112
112
  await e.PATCH("/api/v1/workspaces/{workspace}/issues/{identifier}", {
@@ -116,10 +116,10 @@ function m({ workspace: m, defaultTeam: h, defaultTitle: Je = "", defaultBody: g
116
116
  } },
117
117
  body: { body: n }
118
118
  });
119
- }, Lt = async (n, r) => {
119
+ }, Bt = async (n, r) => {
120
120
  if (!w) return !1;
121
- Et(null);
122
- let i = [...Mt.current.keys()].filter((e) => M.includes(e));
121
+ kt(null);
122
+ let i = [...Q.current.keys()].filter((e) => N.includes(e));
123
123
  try {
124
124
  let a = t(await e.POST("/api/v1/workspaces/{workspace}/teams/{key}/issues", {
125
125
  params: { path: {
@@ -128,22 +128,22 @@ function m({ workspace: m, defaultTeam: h, defaultTitle: Je = "", defaultBody: g
128
128
  } },
129
129
  body: {
130
130
  title: n,
131
- body: i.reduce(Ne, M),
132
- priority: P,
133
- ...Z && { statusId: Z.id },
134
- assignees: B.map(ve),
135
- labelIds: V,
131
+ body: i.reduce(Pe, N),
132
+ priority: F,
133
+ ...X && { statusId: X.id },
134
+ assignees: V.map(ye),
135
+ labelIds: H,
136
136
  ...q && { typeId: q.id },
137
- ...Object.values(H).some(o) && { fields: Object.fromEntries(Object.entries(H).filter(([, e]) => o(e))) },
138
- ...F && me(z).includes(F) && { estimate: F },
139
- ...I && { dueDate: I },
140
- ...L && { cycleId: L },
137
+ ...Object.values(U).some(o) && { fields: Object.fromEntries(Object.entries(U).filter(([, e]) => o(e))) },
138
+ ...I && he(B).includes(I) && { estimate: I },
139
+ ...L && { dueDate: L },
140
+ ...R && { cycleId: R },
141
141
  ...(!h || w === h) && _ && { area: _ },
142
142
  ...(!h || w === h) && v && { origin: v },
143
143
  ...(!h || w === h) && y.projectId && { projectId: y.projectId }
144
144
  }
145
145
  }));
146
- return i.length > 0 && await It(a.identifier), ne(Dt, m, a.identifier), Ye?.(a), r && Ot({
146
+ return i.length > 0 && await zt(a.identifier), re(At, m, a.identifier), Xe?.(a), r && jt({
147
147
  to: "/$workspace/issues/$identifier",
148
148
  params: {
149
149
  workspace: m,
@@ -151,95 +151,95 @@ function m({ workspace: m, defaultTeam: h, defaultTitle: Je = "", defaultBody: g
151
151
  }
152
152
  }), !0;
153
153
  } catch (e) {
154
- return Et(ot(e)), !1;
154
+ return kt(ct(e)), !1;
155
155
  }
156
- }, $ = ze({ size: "sm" });
157
- if (x.length === 0) return /* @__PURE__ */ d(Re, {
156
+ }, $ = Be({ size: "sm" });
157
+ if (x.length === 0) return /* @__PURE__ */ d(ze, {
158
158
  open: !0,
159
159
  onClose: b,
160
160
  size: "lg",
161
- title: k("noTeamTitle"),
162
- description: k(j ? "noTeamDescription" : "noTeamAskAdmin"),
163
- ...!j && { footer: /* @__PURE__ */ d(Fe, {
161
+ title: A("noTeamTitle"),
162
+ description: A(M ? "noTeamDescription" : "noTeamAskAdmin"),
163
+ ...!M && { footer: /* @__PURE__ */ d(Ie, {
164
164
  type: "button",
165
165
  onClick: b,
166
- children: A("close")
166
+ children: j("close")
167
167
  }) },
168
- children: j && /* @__PURE__ */ d(Pe, {
168
+ children: M && /* @__PURE__ */ d(Fe, {
169
169
  workspace: m,
170
170
  autoFocus: !0,
171
- onCreated: (e) => Ze(e.key)
171
+ onCreated: (e) => et(e.key)
172
172
  })
173
173
  });
174
- let Rt = x.find((e) => e.key === w);
175
- return /* @__PURE__ */ f(Ue, { children: [/* @__PURE__ */ d(Ie, {
174
+ let Vt = x.find((e) => e.key === w);
175
+ return /* @__PURE__ */ f(We, { children: [/* @__PURE__ */ d(Le, {
176
176
  open: !0,
177
- onClose: jt,
177
+ onClose: Ft,
178
178
  size: "xl",
179
- typeIcon: /* @__PURE__ */ d(se, { className: "size-3.5" }),
180
- typeLabel: Rt?.name ?? "",
179
+ typeIcon: /* @__PURE__ */ d(ce, { className: "size-3.5" }),
180
+ typeLabel: Vt?.name ?? "",
181
181
  typeMenu: x.map((e) => ({
182
182
  label: e.name,
183
183
  hint: e.key,
184
184
  checked: e.key === w,
185
185
  onClick: () => {
186
- Ze(e.key), lt(null), et(null), U({}), G(null), pt("");
186
+ et(e.key), dt(null), nt(null), W({}), Ct(null), ht("");
187
187
  }
188
188
  })),
189
189
  typeMenuSearch: {
190
- placeholder: k("moveToTeam"),
191
- empty: k("noTeamMatches")
190
+ placeholder: A("moveToTeam"),
191
+ empty: A("noTeamMatches")
192
192
  },
193
- namePlaceholder: k("issueTitle"),
194
- initialName: D,
193
+ namePlaceholder: A("issueTitle"),
194
+ initialName: O,
195
195
  onNameChange: (e) => {
196
- O.current = e;
196
+ k.current = e;
197
197
  },
198
- submitLabel: k("create"),
198
+ submitLabel: A("create"),
199
199
  descriptionField: /* @__PURE__ */ f("div", {
200
200
  className: "min-h-24 pb-2",
201
- children: [/* @__PURE__ */ d(Me, {
202
- value: M,
203
- onChange: N,
204
- onFiles: (e, t) => void Ft(e, t),
201
+ children: [/* @__PURE__ */ d(Ne, {
202
+ value: N,
203
+ onChange: P,
204
+ onFiles: (e, t) => void Rt(e, t),
205
205
  onEditor: (e) => {
206
- Q.current = e;
206
+ Z.current = e;
207
207
  },
208
208
  onSubmit: () => {},
209
- placeholder: k("descriptionPlaceholder"),
210
- label: A("description"),
209
+ placeholder: A("descriptionPlaceholder"),
210
+ label: j("description"),
211
211
  className: "min-h-24"
212
- }), /* @__PURE__ */ d(ke, {
212
+ }), /* @__PURE__ */ d(Ae, {
213
213
  workspace: m,
214
214
  teamId: x.find((e) => e.key === w)?.id,
215
- typeId: W,
216
- values: H,
217
- onChange: U
215
+ typeId: G,
216
+ values: U,
217
+ onChange: W
218
218
  })]
219
219
  }),
220
- dirty: M !== g || E !== null || ct !== null || P !== 0 || F !== 0 || I !== "" || L !== "" || B.length > 0 || V.length > 0 || W !== null || Object.values(H).some(o),
221
- footerHint: k("hint"),
222
- error: Tt,
223
- onSubmit: (e, t, n, { modifier: r }) => Lt(e, r),
224
- properties: /* @__PURE__ */ f(Ue, { children: [
225
- T.length > 0 && /* @__PURE__ */ d(s, {
220
+ dirty: N !== g || D !== null || ut !== null || F !== 0 || I !== 0 || L !== "" || R !== "" || V.length > 0 || H.length > 0 || G !== null || Object.values(U).some(o),
221
+ footerHint: A("hint"),
222
+ error: Ot,
223
+ onSubmit: (e, t, n, { modifier: r }) => Bt(e, r),
224
+ properties: /* @__PURE__ */ f(We, { children: [
225
+ E.length > 0 && /* @__PURE__ */ d(s, {
226
226
  open: J === "template",
227
227
  onOpenChange: (e) => Y(e ? "template" : null),
228
- items: T.map((e) => ({
228
+ items: E.map((e) => ({
229
229
  value: e.id,
230
230
  label: e.name,
231
- icon: /* @__PURE__ */ d(oe, { className: "size-3.5 text-muted-foreground" })
231
+ icon: /* @__PURE__ */ d(se, { className: "size-3.5 text-muted-foreground" })
232
232
  })),
233
- value: E,
233
+ value: D,
234
234
  onValueChange: (e) => {
235
- let t = T.find((t) => t.id === e);
236
- t && (et(t.id), t.title && (nt(t.title), O.current = t.title), N(t.body), ut(t.priority), bt(t.labelIds), U(t.fields), G(t.typeId ?? null));
235
+ let t = E.find((t) => t.id === e);
236
+ t && (nt(t.id), t.title && (it(t.title), k.current = t.title), P(t.body), ft(t.priority), St(t.labelIds), W(t.fields), Ct(t.typeId ?? null));
237
237
  },
238
- placeholder: rt("choose"),
238
+ placeholder: at("choose"),
239
239
  trigger: /* @__PURE__ */ f("button", {
240
240
  type: "button",
241
241
  className: $,
242
- children: [/* @__PURE__ */ d(oe, { className: "size-3.5" }), tt?.name ?? rt("choose")]
242
+ children: [/* @__PURE__ */ d(se, { className: "size-3.5" }), rt?.name ?? at("choose")]
243
243
  })
244
244
  }),
245
245
  K.length > 0 && /* @__PURE__ */ d(s, {
@@ -248,41 +248,41 @@ function m({ workspace: m, defaultTeam: h, defaultTitle: Je = "", defaultBody: g
248
248
  items: K.map((e) => ({
249
249
  value: e.id,
250
250
  label: e.name,
251
- icon: /* @__PURE__ */ d(Oe, {
251
+ icon: /* @__PURE__ */ d(ke, {
252
252
  type: e,
253
253
  className: "size-3.5"
254
254
  })
255
255
  })),
256
- value: W,
256
+ value: G,
257
257
  onValueChange: (e) => {
258
258
  let t = K.find((t) => t.id === e);
259
- G(t?.id ?? null), t?.template && !M.trim() && N(t.template);
259
+ Ct(t?.id ?? null), t?.template && !N.trim() && P(t.template);
260
260
  },
261
- placeholder: St("type"),
261
+ placeholder: Tt("type"),
262
262
  trigger: /* @__PURE__ */ f("button", {
263
263
  type: "button",
264
264
  className: $,
265
- children: [q && /* @__PURE__ */ d(Oe, {
265
+ children: [q && /* @__PURE__ */ d(ke, {
266
266
  type: q,
267
267
  className: "size-3.5"
268
- }), q?.name ?? St("type")]
268
+ }), q?.name ?? Tt("type")]
269
269
  })
270
270
  }),
271
271
  /* @__PURE__ */ d(s, {
272
272
  open: J === "status",
273
273
  onOpenChange: (e) => Y(e ? "status" : null),
274
- items: Qe.map((e) => ({
274
+ items: T.map((e) => ({
275
275
  value: e.id,
276
276
  label: e.name,
277
- icon: /* @__PURE__ */ d(le, { category: e.category })
277
+ icon: /* @__PURE__ */ d(ue, { category: e.category })
278
278
  })),
279
- value: Z?.id ?? null,
280
- onValueChange: (e) => e !== null && lt(e),
281
- placeholder: k("changeStatus"),
279
+ value: X?.id ?? null,
280
+ onValueChange: (e) => e !== null && dt(e),
281
+ placeholder: A("changeStatus"),
282
282
  trigger: /* @__PURE__ */ f("button", {
283
283
  type: "button",
284
284
  className: $,
285
- children: [Z && /* @__PURE__ */ d(le, { category: Z.category }), Z?.name ?? A("status")]
285
+ children: [X && /* @__PURE__ */ d(ue, { category: X.category }), X?.name ?? j("status")]
286
286
  })
287
287
  }),
288
288
  /* @__PURE__ */ d(s, {
@@ -296,115 +296,115 @@ function m({ workspace: m, defaultTeam: h, defaultTitle: Je = "", defaultBody: g
296
296
  0
297
297
  ].map((e) => ({
298
298
  value: String(e),
299
- label: at[e] ?? "",
300
- icon: /* @__PURE__ */ d(ce, { priority: e })
299
+ label: st[e] ?? "",
300
+ icon: /* @__PURE__ */ d(le, { priority: e })
301
301
  })),
302
- value: String(P),
303
- onValueChange: (e) => e !== null && ut(Number(e)),
304
- placeholder: k("setPriority"),
302
+ value: String(F),
303
+ onValueChange: (e) => e !== null && ft(Number(e)),
304
+ placeholder: A("setPriority"),
305
305
  trigger: /* @__PURE__ */ f("button", {
306
306
  type: "button",
307
307
  className: $,
308
- children: [/* @__PURE__ */ d(ce, { priority: P }), P ? at[P] : A("priority")]
308
+ children: [/* @__PURE__ */ d(le, { priority: F }), F ? st[F] : j("priority")]
309
309
  })
310
310
  }),
311
311
  /* @__PURE__ */ d(s, {
312
312
  multiple: !0,
313
313
  open: J === "assignees",
314
314
  onOpenChange: (e) => Y(e ? "assignees" : null),
315
- items: it,
316
- value: B,
315
+ items: ot,
316
+ value: V,
317
317
  onValueChange: (e) => {
318
- yt(e), Ct();
318
+ xt(e), Et();
319
319
  },
320
- placeholder: k("assignTo"),
320
+ placeholder: A("assignTo"),
321
321
  trigger: /* @__PURE__ */ f("button", {
322
322
  type: "button",
323
323
  className: $,
324
- children: [/* @__PURE__ */ d(de, { className: "size-3.5" }), B.length ? k("assignedCount", { count: B.length }) : A("assignee")]
324
+ children: [/* @__PURE__ */ d(fe, { className: "size-3.5" }), V.length ? A("assignedCount", { count: V.length }) : j("assignee")]
325
325
  })
326
326
  }),
327
327
  /* @__PURE__ */ d(s, {
328
328
  multiple: !0,
329
329
  open: J === "labels",
330
330
  onOpenChange: (e) => Y(e ? "labels" : null),
331
- items: $e.map((e) => ({
331
+ items: tt.map((e) => ({
332
332
  value: e.id,
333
333
  label: e.name,
334
334
  icon: /* @__PURE__ */ f("span", {
335
335
  className: "flex items-center gap-2",
336
- children: [/* @__PURE__ */ d(ge, {}), /* @__PURE__ */ d("span", {
336
+ children: [/* @__PURE__ */ d(_e, {}), /* @__PURE__ */ d("span", {
337
337
  className: "size-2.5 rounded-full",
338
338
  style: { background: e.color }
339
339
  })]
340
340
  })
341
341
  })),
342
- value: V,
342
+ value: H,
343
343
  onValueChange: (e) => {
344
- bt(e), wt();
344
+ St(e), Dt();
345
345
  },
346
- placeholder: k("addLabels"),
346
+ placeholder: A("addLabels"),
347
347
  trigger: /* @__PURE__ */ f("button", {
348
348
  type: "button",
349
349
  className: $,
350
- children: [/* @__PURE__ */ d(ue, { className: "size-3.5" }), V.length ? k("labelCount", { count: V.length }) : A("labels")]
350
+ children: [/* @__PURE__ */ d(de, { className: "size-3.5" }), H.length ? A("labelCount", { count: H.length }) : j("labels")]
351
351
  })
352
352
  }),
353
- z !== "none" && /* @__PURE__ */ d(s, {
353
+ B !== "none" && /* @__PURE__ */ d(s, {
354
354
  open: J === "estimate",
355
355
  onOpenChange: (e) => Y(e ? "estimate" : null),
356
- items: [0, ...me(z)].map((e) => ({
356
+ items: [0, ...he(B)].map((e) => ({
357
357
  value: String(e),
358
- label: e ? mt(e, z) : R("noEstimate")
358
+ label: e ? gt(e, B) : z("noEstimate")
359
359
  })),
360
- value: String(F),
361
- onValueChange: (e) => e !== null && dt(Number(e)),
362
- placeholder: R("setEstimate"),
360
+ value: String(I),
361
+ onValueChange: (e) => e !== null && pt(Number(e)),
362
+ placeholder: z("setEstimate"),
363
363
  trigger: /* @__PURE__ */ f("button", {
364
364
  type: "button",
365
365
  className: $,
366
- children: [/* @__PURE__ */ d(ae, { className: "size-3.5" }), F ? mt(F, z) : R("estimate")]
366
+ children: [/* @__PURE__ */ d(oe, { className: "size-3.5" }), I ? gt(I, B) : z("estimate")]
367
367
  })
368
368
  }),
369
- Rt?.cyclesEnabled && /* @__PURE__ */ d(s, {
369
+ Vt?.cyclesEnabled && /* @__PURE__ */ d(s, {
370
370
  open: J === "cycle",
371
371
  onOpenChange: (e) => Y(e ? "cycle" : null),
372
372
  items: [{
373
373
  value: "",
374
- label: R("noCycle")
375
- }, ...gt.filter((e) => e.state !== "past").map((e) => ({
374
+ label: z("noCycle")
375
+ }, ...vt.filter((e) => e.state !== "past").map((e) => ({
376
376
  value: e.id,
377
- label: vt(e),
378
- description: R("stateAndDates", {
379
- state: R(`states.${e.state}`),
380
- dates: ht.dayRange(e.startsOn, e.endsOn)
377
+ label: bt(e),
378
+ description: z("stateAndDates", {
379
+ state: z(`states.${e.state}`),
380
+ dates: _t.dayRange(e.startsOn, e.endsOn)
381
381
  })
382
382
  }))],
383
- value: L,
384
- onValueChange: (e) => e !== null && pt(e),
385
- placeholder: R("cycleLabel"),
383
+ value: R,
384
+ onValueChange: (e) => e !== null && ht(e),
385
+ placeholder: z("cycleLabel"),
386
386
  trigger: /* @__PURE__ */ f("button", {
387
387
  type: "button",
388
388
  className: $,
389
- children: [/* @__PURE__ */ d(ie, { className: "size-3.5" }), _t ? vt(_t) : R("cycleLabel")]
389
+ children: [/* @__PURE__ */ d(ae, { className: "size-3.5" }), yt ? bt(yt) : z("cycleLabel")]
390
390
  })
391
391
  }),
392
- /* @__PURE__ */ d(Le, {
393
- value: I,
394
- onValueChange: ft,
395
- "aria-label": R("dueDate"),
392
+ /* @__PURE__ */ d(Re, {
393
+ value: L,
394
+ onValueChange: mt,
395
+ "aria-label": z("dueDate"),
396
396
  trigger: /* @__PURE__ */ f("button", {
397
397
  type: "button",
398
398
  className: $,
399
- children: [/* @__PURE__ */ d(re, { className: "size-3.5" }), I ? R("dueOn", { date: ht.day(I) }) : R("dueDate")]
399
+ children: [/* @__PURE__ */ d(ie, { className: "size-3.5" }), L ? z("dueOn", { date: _t.day(L) }) : z("dueDate")]
400
400
  })
401
401
  }),
402
- /* @__PURE__ */ d(Ae, { onFiles: (e) => void Ft(e) })
402
+ /* @__PURE__ */ d(je, { onFiles: (e) => void Rt(e) })
403
403
  ] })
404
- }), At] });
404
+ }), Nt] });
405
405
  }
406
406
  var h = (e) => `tandem:new-issue-draft:${e}`;
407
- function Ke(e) {
407
+ function qe(e) {
408
408
  try {
409
409
  let t = JSON.parse(localStorage.getItem(h(e)) ?? "null");
410
410
  return t && typeof t.title == "string" && typeof t.body == "string" ? t : void 0;
@@ -412,7 +412,7 @@ function Ke(e) {
412
412
  return;
413
413
  }
414
414
  }
415
- function qe(e, t) {
415
+ function Je(e, t) {
416
416
  try {
417
417
  t.title.trim() || t.body.trim() ? localStorage.setItem(h(e), JSON.stringify(t)) : localStorage.removeItem(h(e));
418
418
  } catch {}