@parallelworks/tandem-web 0.150.3 → 0.152.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.
Files changed (110) hide show
  1. package/_virtual/_virtual_i18n/en/common.js +36 -4
  2. package/_virtual/_virtual_i18n/es/common.js +36 -4
  3. package/_virtual/_virtual_i18n/ja/common.js +36 -4
  4. package/_virtual/_virtual_i18n/ko/common.js +36 -4
  5. package/_virtual/_virtual_i18n/zh/common.js +36 -4
  6. package/api/queries.js +88 -77
  7. package/components/AccessGrants.js +6 -6
  8. package/components/ActivityTimeline.js +4 -4
  9. package/components/AgentWork.js +111 -111
  10. package/components/AreaLink.js +32 -0
  11. package/components/AreaTiles.js +10 -13
  12. package/components/AreaWork.js +25 -1
  13. package/components/BugRotation.js +3 -3
  14. package/components/CodeHostSettings.js +30 -30
  15. package/components/CommandPalette.js +53 -53
  16. package/components/CustomFields.js +116 -116
  17. package/components/DateChip.js +11 -11
  18. package/components/DocButton.js +6 -6
  19. package/components/DocHistory.js +4 -4
  20. package/components/DocLinkPicker.js +8 -8
  21. package/components/DocProperties.js +15 -15
  22. package/components/DocTable.js +15 -15
  23. package/components/DocsTree.js +80 -80
  24. package/components/Editor.js +35 -35
  25. package/components/FavoritesNav.js +53 -53
  26. package/components/GitHub.js +18 -18
  27. package/components/Graph.js +15 -15
  28. package/components/HostActions.js +21 -21
  29. package/components/HostPanel.js +6 -6
  30. package/components/HoverCards.js +38 -38
  31. package/components/IssueBoard.js +4 -4
  32. package/components/IssueCode.js +14 -14
  33. package/components/IssueEvent.js +3 -3
  34. package/components/IssueFilters.js +71 -71
  35. package/components/IssueListBlock.js +32 -32
  36. package/components/IssueRow.js +21 -21
  37. package/components/IssueTemplates.js +118 -118
  38. package/components/IssueTypes.js +40 -40
  39. package/components/NewIssueDialog.js +76 -76
  40. package/components/NewProjectDialog.js +145 -145
  41. package/components/PersonActivity.js +4 -4
  42. package/components/SharedViewer.js +5 -5
  43. package/components/SlashMenu.js +29 -29
  44. package/components/TeamRepositories.js +51 -51
  45. package/components/TeamWorkflow.js +6 -6
  46. package/components/UnlinkedMentions.js +20 -20
  47. package/components/Updates.js +3 -3
  48. package/components/Widgets.js +20 -20
  49. package/components/columns.js +17 -17
  50. package/components/editorPlugins.js +80 -80
  51. package/components/mathDiagrams.js +17 -17
  52. package/lib/boardMove.js +5 -5
  53. package/lib/issueList.js +58 -58
  54. package/lib/issueMenu.js +27 -27
  55. package/lib/knowledge.js +106 -106
  56. package/lib/views.js +9 -9
  57. package/package.json +1 -1
  58. package/pages/area.js +291 -0
  59. package/pages/areas.js +258 -287
  60. package/pages/decisions.js +21 -21
  61. package/pages/issues.js +52 -52
  62. package/pages/projects.js +125 -125
  63. package/pages/triage.js +12 -12
  64. package/routeTree.gen.js +186 -180
  65. package/routes/_workspace/agents/_slug2.js +11 -11
  66. package/routes/_workspace/agents/index2.js +10 -10
  67. package/routes/_workspace/areas/_area.js +7 -8
  68. package/routes/_workspace/areas/_area2.js +3 -290
  69. package/routes/_workspace/areas/_area3.js +7 -8
  70. package/routes/_workspace/docs/_doc2.js +230 -230
  71. package/routes/_workspace/docs/space2._space.js +27 -27
  72. package/routes/_workspace/issues/_identifier2.js +222 -224
  73. package/routes/_workspace/knowledge/_term2.js +43 -43
  74. package/routes/_workspace/knowledge/index.js +6 -6
  75. package/routes/_workspace/knowledge/index2.js +15 -15
  76. package/routes/_workspace/measures3.js +70 -72
  77. package/routes/_workspace/notifications2.js +150 -150
  78. package/routes/_workspace/people/_username2.js +10 -10
  79. package/routes/_workspace/projects/_projectId3.js +276 -276
  80. package/routes/_workspace/settings/audit-log3.js +136 -138
  81. package/routes/_workspace/settings/fields2.js +11 -11
  82. package/routes/_workspace/settings/github2.js +6 -6
  83. package/routes/_workspace/settings/groups2.js +26 -26
  84. package/routes/_workspace/settings/import2.js +414 -151
  85. package/routes/_workspace/settings/import3.js +7 -3
  86. package/routes/_workspace/settings/index2.js +6 -6
  87. package/routes/_workspace/settings/labels2.js +21 -21
  88. package/routes/_workspace/settings/members2.js +27 -27
  89. package/routes/_workspace/settings/notifications2.js +8 -8
  90. package/routes/_workspace/settings/parallelworks2.js +32 -32
  91. package/routes/_workspace/settings/roles2.js +24 -24
  92. package/routes/_workspace/settings/runners2.js +15 -15
  93. package/routes/_workspace/settings/sessions2.js +17 -17
  94. package/routes/_workspace/settings/slack2.js +7 -7
  95. package/routes/_workspace/settings/sso2.js +31 -31
  96. package/routes/_workspace/settings/teams2.js +25 -25
  97. package/routes/_workspace/settings/tokens2.js +12 -12
  98. package/routes/_workspace/settings/webhooks2.js +13 -13
  99. package/routes/_workspace/teams/_key/areas/_area.js +8 -0
  100. package/routes/_workspace/teams/_key/areas/_area2.js +4 -0
  101. package/routes/_workspace/teams/_key/areas/_area3.js +9 -0
  102. package/routes/_workspace/teams/_key/areas/index.js +6 -0
  103. package/routes/_workspace/teams/_key/areas/index2.js +4 -0
  104. package/routes/_workspace/teams/_key/{areas3.js → areas/index3.js} +2 -2
  105. package/routes/_workspace/teams/_key/cycles/_number2.js +27 -27
  106. package/routes/_workspace/teams/_key/cycles/index2.js +24 -24
  107. package/routes/_workspace/teams/_key/settings2.js +29 -29
  108. package/routes/_workspace2.js +368 -368
  109. package/routes/_workspace/teams/_key/areas.js +0 -6
  110. package/routes/_workspace/teams/_key/areas2.js +0 -4
package/pages/areas.js CHANGED
@@ -1,233 +1,210 @@
1
1
  import { usePageTitle as e } from "../lib/pageTitle.js";
2
2
  import { Link as t } from "../lib/router.js";
3
3
  import { areasQuery as n, countsQuery as r, docsQuery as i, inboxQuery as a, teamsQuery as o, unfiledQuery as s, workspaceQuery as c } from "../api/queries.js";
4
- import { AddIcon as l, AreaIcon as u, ChevronRightIcon as d, FileTextIcon as f, GridIcon as p, ListViewIcon as m } from "../components/icons.js";
5
- import { docRef as h } from "../lib/docs.js";
4
+ import { docRef as l } from "../lib/docs.js";
5
+ import { AddIcon as u, AreaIcon as d, ChevronRightIcon as f, FileTextIcon as p, GridIcon as m, ListViewIcon as h } from "../components/icons.js";
6
6
  import { usePeople as g } from "../lib/people.js";
7
7
  import { EntityIcon as _ } from "../components/EntityIcon.js";
8
8
  import { DocIcon as v } from "../components/DocIcon.js";
9
9
  import { actorAvatar as y } from "../lib/avatar.js";
10
- import { FoldedAnswer as b, KnowledgeRow as x } from "../components/AreaWork.js";
11
- import { WorkCounts as S } from "../components/WorkCounts.js";
12
- import { useAreaActions as C } from "../lib/areas.js";
13
- import { AreaTile as w, AreaTiles as T, PlaceTile as E } from "../components/AreaTiles.js";
14
- import { Avatar as D, Breadcrumbs as O, Button as k, Combobox as A, EmptyState as j, ErrorText as M, IconButton as N, Input as P, Modal as F, ModalTitle as I, SegmentedControl as ee, Select as L, Tooltip as R, buttonClasses as te, menuDivider as z, useOpenMenu as B } from "@parallelworks/ui";
15
- import { useParams as V, useSearch as H } from "@tanstack/react-router";
16
- import { Fragment as U, useMemo as W, useState as G } from "react";
17
- import { useErrorMessage as K } from "@parallelworks/problem/react";
18
- import { useTranslations as q } from "use-intl";
19
- import { Fragment as J, jsx as Y, jsxs as X } from "react/jsx-runtime";
20
- import { useQuery as Z, useSuspenseQuery as Q } from "@tanstack/react-query";
21
- import { MoreButton as ne } from "@parallelworks/ui/list";
10
+ import { AreaLink as b } from "../components/AreaLink.js";
11
+ import { useAreaActions as x } from "../lib/areas.js";
12
+ import { AreaTile as S, AreaTiles as C, PlaceTile as w } from "../components/AreaTiles.js";
13
+ import { AreaGroup as T, FoldedAnswer as E, KnowledgeRow as D } from "../components/AreaWork.js";
14
+ import { WorkCounts as O } from "../components/WorkCounts.js";
15
+ import { Avatar as k, Breadcrumbs as A, Button as j, Combobox as ee, EmptyState as M, ErrorText as N, IconButton as P, Input as F, Modal as I, ModalTitle as L, SegmentedControl as R, Select as z, Tooltip as B, buttonClasses as V, menuDivider as H, useOpenMenu as U } from "@parallelworks/ui";
16
+ import { useParams as W, useSearch as te } from "@tanstack/react-router";
17
+ import { Fragment as G, useMemo as K, useState as q } from "react";
18
+ import { useErrorMessage as ne } from "@parallelworks/problem/react";
19
+ import { useTranslations as J } from "use-intl";
20
+ import { Fragment as Y, jsx as X, jsxs as Z } from "react/jsx-runtime";
21
+ import { useQuery as Q, useSuspenseQuery as $ } from "@tanstack/react-query";
22
+ import { MoreButton as re } from "@parallelworks/ui/list";
22
23
  // src/pages/areas.tsx
23
- var re = (...e) => e.filter(Boolean).join(" ");
24
- function ie() {
25
- let t = q("areas"), { workspace: i, key: a } = V({ strict: !1 }), { team: d = a } = H({ strict: !1 }), { data: f } = Q(n(i)), { data: h } = Q(o(i)), g = h.find((e) => e.key === d);
24
+ var ie = (...e) => e.filter(Boolean).join(" ");
25
+ function ae() {
26
+ let t = J("areas"), { workspace: i, key: a } = W({ strict: !1 }), { team: l = a } = te({ strict: !1 }), { data: f } = $(n(i)), { data: p } = $(o(i)), g = p.find((e) => e.key === l);
26
27
  e(t("title"), g?.name);
27
- let v = g ? f.filter((e) => e.teamId === g.id) : f, { data: y } = Q(c(i)), { data: C } = Q(r(i)), [w, T] = G(null), { data: E } = Z(s(i, g?.key)), D = (E?.proposed.length ?? 0) + (E?.notInDocs.length ?? 0), O = v.filter((e) => e.status === "proposed"), A = [...!g && f.some((e) => !e.teamId) ? [{
28
+ let v = g ? f.filter((e) => e.teamId === g.id) : f, { data: y } = $(c(i)), { data: b } = $(r(i)), [x, S] = q(null), { data: C } = Q(s(i, g?.key)), w = (C?.proposed.length ?? 0) + (C?.notInDocs.length ?? 0), k = v.filter((e) => e.status === "proposed"), A = [...!g && f.some((e) => !e.teamId) ? [{
28
29
  id: "",
29
30
  key: "workspace",
30
31
  name: y.name,
31
32
  icon: y.icon,
32
33
  color: y.color
33
- }] : [], ...h.filter((e) => !e.archivedAt && (!g || e.id === g.id)).map((e) => ({
34
+ }] : [], ...p.filter((e) => !e.archivedAt && (!g || e.id === g.id)).map((e) => ({
34
35
  id: e.id,
35
36
  key: e.key,
36
37
  name: e.name,
37
38
  icon: e.icon,
38
39
  color: e.color,
39
40
  team: e
40
- }))], M = (e) => A.find((t) => t.id === (e.teamId ?? "")), P = () => T({
41
+ }))], ee = (e) => A.find((t) => t.id === (e.teamId ?? "")), N = () => S({
41
42
  kind: "create",
42
43
  ...g && { space: g.key }
43
- }), F = de(i, (e) => T({
44
+ }), F = fe(i, (e) => S({
44
45
  kind: "edit",
45
46
  area: e
46
- }), (e) => T({
47
+ }), (e) => S({
47
48
  kind: "create",
48
49
  parent: e
49
- })), [I, L] = G(se), R = E && /* @__PURE__ */ X(J, { children: [E.proposed.map((e) => /* @__PURE__ */ Y(x, {
50
+ })), [I, L] = q(ce), z = C && /* @__PURE__ */ Z(Y, { children: [C.proposed.map((e) => /* @__PURE__ */ X(D, {
50
51
  workspace: i,
51
52
  entry: e,
52
53
  isNew: !1
53
- }, e.id)), E.notInDocs.map((e) => /* @__PURE__ */ Y(b, {
54
+ }, e.id)), C.notInDocs.map((e) => /* @__PURE__ */ X(E, {
54
55
  workspace: i,
55
56
  decision: e,
56
57
  isNew: !1,
57
58
  notInDocs: !0
58
59
  }, e.id))] });
59
- return /* @__PURE__ */ X("div", {
60
+ return /* @__PURE__ */ Z("div", {
60
61
  className: "flex h-full flex-col",
61
62
  children: [
62
- /* @__PURE__ */ X("header", {
63
+ /* @__PURE__ */ Z("header", {
63
64
  className: "flex h-12 shrink-0 items-center gap-3 border-b border-border px-4 md:px-5",
64
65
  children: [
65
- /* @__PURE__ */ Y("h1", {
66
+ /* @__PURE__ */ X("h1", {
66
67
  className: "text-sm font-semibold",
67
68
  children: g ? t("teamTitle", { team: g.name }) : t("title")
68
69
  }),
69
- /* @__PURE__ */ Y("span", {
70
+ /* @__PURE__ */ X("span", {
70
71
  className: "text-xs text-muted-foreground tabular-nums",
71
72
  children: t("count", { count: v.length })
72
73
  }),
73
- /* @__PURE__ */ Y(S, {
74
- counts: g ? C.teams[g.id] : C.workspace,
74
+ /* @__PURE__ */ X(O, {
75
+ counts: g ? b.teams[g.id] : b.workspace,
75
76
  teamId: g?.id,
76
77
  className: "max-sm:hidden"
77
78
  }),
78
- /* @__PURE__ */ Y("div", {
79
+ /* @__PURE__ */ X("div", {
79
80
  className: "ml-auto",
80
- children: /* @__PURE__ */ Y(ee, {
81
+ children: /* @__PURE__ */ X(R, {
81
82
  label: t("view"),
82
83
  size: "sm",
83
84
  value: I,
84
85
  onValueChange: (e) => {
85
- L(e), ce(e);
86
+ L(e), le(e);
86
87
  },
87
88
  options: [{
88
89
  value: "icons",
89
90
  label: t("icons"),
90
- icon: /* @__PURE__ */ Y(p, {})
91
+ icon: /* @__PURE__ */ X(m, {})
91
92
  }, {
92
93
  value: "list",
93
94
  label: t("list"),
94
- icon: /* @__PURE__ */ Y(m, {})
95
+ icon: /* @__PURE__ */ X(h, {})
95
96
  }]
96
97
  })
97
98
  }),
98
- /* @__PURE__ */ Y(k, {
99
+ /* @__PURE__ */ X(j, {
99
100
  variant: "primary",
100
101
  size: "sm",
101
- icon: /* @__PURE__ */ Y(l, { className: "size-3.5" }),
102
- onClick: P,
102
+ icon: /* @__PURE__ */ X(u, { className: "size-3.5" }),
103
+ onClick: N,
103
104
  children: t("new")
104
105
  })
105
106
  ]
106
107
  }),
107
- /* @__PURE__ */ X("div", {
108
+ /* @__PURE__ */ Z("div", {
108
109
  className: "min-h-0 flex-1 overflow-y-auto",
109
110
  children: [
110
- v.length === 0 ? /* @__PURE__ */ Y("div", {
111
+ v.length === 0 ? /* @__PURE__ */ X("div", {
111
112
  className: "p-6",
112
- children: /* @__PURE__ */ Y(j, {
113
- icon: /* @__PURE__ */ Y(u, {}),
113
+ children: /* @__PURE__ */ X(M, {
114
+ icon: /* @__PURE__ */ X(d, {}),
114
115
  title: t("none"),
115
116
  description: t("description"),
116
- action: /* @__PURE__ */ Y(k, {
117
+ action: /* @__PURE__ */ X(j, {
117
118
  variant: "primary",
118
119
  size: "sm",
119
- onClick: P,
120
+ onClick: N,
120
121
  children: t("new")
121
122
  })
122
123
  })
123
- }) : /* @__PURE__ */ X(J, { children: [O.length > 0 && /* @__PURE__ */ Y($, {
124
+ }) : /* @__PURE__ */ Z(Y, { children: [k.length > 0 && /* @__PURE__ */ X(T, {
124
125
  title: t("toReview"),
125
- count: O.length,
126
- icon: /* @__PURE__ */ Y(u, { className: "size-4 text-warning" }),
127
- children: O.map((e) => /* @__PURE__ */ Y(pe, {
126
+ count: k.length,
127
+ icon: /* @__PURE__ */ X(d, { className: "size-4 text-warning" }),
128
+ children: k.map((e) => /* @__PURE__ */ X(me, {
128
129
  workspace: i,
129
130
  area: e,
130
- counts: C.areas[e.id],
131
+ counts: b.areas[e.id],
131
132
  siblings: v.filter((t) => (t.teamId ?? "") === (e.teamId ?? "")),
132
133
  depth: 0,
133
- review: M(e)?.name,
134
+ review: ee(e)?.name,
134
135
  areaMenu: F
135
136
  }, e.id))
136
- }), I === "icons" ? /* @__PURE__ */ Y(ue, {
137
+ }), I === "icons" ? /* @__PURE__ */ X(de, {
137
138
  workspace: i,
138
139
  spaces: A,
139
140
  areas: v,
140
- unfiledCount: D,
141
- unfiledRows: R,
141
+ unfiledCount: w,
142
+ unfiledRows: z,
142
143
  areaMenu: F,
143
- onCreate: T
144
+ onCreate: S
144
145
  }, g?.id ?? "") : A.map((e) => {
145
146
  let n = v.filter((t) => (t.teamId ?? "") === e.id);
146
- return /* @__PURE__ */ Y($, {
147
+ return /* @__PURE__ */ X(T, {
147
148
  title: e.name,
148
149
  count: n.length,
149
- icon: /* @__PURE__ */ Y(_, {
150
+ icon: /* @__PURE__ */ X(_, {
150
151
  icon: e.icon,
151
152
  color: e.color,
152
153
  name: e.name
153
154
  }),
154
- extra: e.team && /* @__PURE__ */ Y(S, {
155
- counts: C.teams[e.team.id],
155
+ extra: e.team && /* @__PURE__ */ X(O, {
156
+ counts: b.teams[e.team.id],
156
157
  teamId: e.team.id,
157
158
  className: "max-sm:hidden"
158
159
  }),
159
- action: e.team && /* @__PURE__ */ Y(N, {
160
+ action: e.team && /* @__PURE__ */ X(P, {
160
161
  variant: "ghost",
161
162
  size: "xs",
162
- icon: /* @__PURE__ */ Y(l, { className: "size-3.5" }),
163
+ icon: /* @__PURE__ */ X(u, { className: "size-3.5" }),
163
164
  label: t("newIn", { space: e.name }),
164
- onClick: () => T({
165
+ onClick: () => S({
165
166
  kind: "create",
166
167
  space: e.key
167
168
  })
168
169
  }),
169
- children: /* @__PURE__ */ Y(ae, {
170
+ children: /* @__PURE__ */ X(oe, {
170
171
  workspace: i,
171
172
  areas: n,
172
- counts: C.areas,
173
+ counts: b.areas,
173
174
  parent: void 0,
174
175
  depth: 0,
175
176
  areaMenu: F
176
177
  })
177
178
  }, e.key);
178
179
  })] }),
179
- I === "list" && D > 0 && /* @__PURE__ */ Y($, {
180
+ I === "list" && w > 0 && /* @__PURE__ */ X(T, {
180
181
  title: t("unfiled"),
181
- count: D,
182
- icon: /* @__PURE__ */ Y(u, { className: "size-4 text-muted-foreground" }),
183
- children: R
182
+ count: w,
183
+ icon: /* @__PURE__ */ X(d, { className: "size-4 text-muted-foreground" }),
184
+ children: z
184
185
  }),
185
- /* @__PURE__ */ Y(me, { workspace: i })
186
+ /* @__PURE__ */ X(he, { workspace: i })
186
187
  ]
187
188
  }),
188
- w && /* @__PURE__ */ Y(ge, {
189
+ x && /* @__PURE__ */ X(_e, {
189
190
  workspace: i,
190
- editing: w,
191
+ editing: x,
191
192
  spaces: A.filter((e) => e.team),
192
193
  areas: f,
193
- onClose: () => T(null)
194
+ onClose: () => S(null)
194
195
  })
195
196
  ]
196
197
  });
197
198
  }
198
- function $({ title: e, count: t, icon: n, extra: r, action: i, bare: a = !1, children: o }) {
199
- return /* @__PURE__ */ X("section", {
200
- "aria-label": e,
201
- children: [/* @__PURE__ */ X("h2", {
202
- className: "sticky top-0 z-10 flex h-9 items-center gap-2 border-b border-border bg-background px-4 text-xs font-medium md:px-5",
203
- children: [
204
- n,
205
- /* @__PURE__ */ Y("span", {
206
- className: "truncate",
207
- children: e
208
- }),
209
- /* @__PURE__ */ Y("span", {
210
- className: "text-muted-foreground tabular-nums",
211
- children: t
212
- }),
213
- r,
214
- i && /* @__PURE__ */ Y("span", {
215
- className: "ml-auto flex",
216
- children: i
217
- })
218
- ]
219
- }), t > 0 && (a ? o : /* @__PURE__ */ Y("ul", { children: o }))]
220
- });
221
- }
222
- function ae({ workspace: e, areas: t, counts: n, parent: r, depth: i, areaMenu: a }) {
223
- return t.filter((e) => e.parentId === r).map((r) => /* @__PURE__ */ X(U, { children: [/* @__PURE__ */ Y(pe, {
199
+ function oe({ workspace: e, areas: t, counts: n, parent: r, depth: i, areaMenu: a }) {
200
+ return t.filter((e) => e.parentId === r).map((r) => /* @__PURE__ */ Z(G, { children: [/* @__PURE__ */ X(me, {
224
201
  workspace: e,
225
202
  area: r,
226
203
  counts: n[r.id],
227
204
  siblings: t,
228
205
  depth: i,
229
206
  areaMenu: a
230
- }), /* @__PURE__ */ Y(ae, {
207
+ }), /* @__PURE__ */ X(oe, {
231
208
  workspace: e,
232
209
  areas: t,
233
210
  counts: n,
@@ -236,112 +213,109 @@ function ae({ workspace: e, areas: t, counts: n, parent: r, depth: i, areaMenu:
236
213
  areaMenu: a
237
214
  })] }, r.id));
238
215
  }
239
- var oe = "tandem.areas.view";
240
- function se() {
216
+ var se = "tandem.areas.view";
217
+ function ce() {
241
218
  try {
242
- return globalThis.localStorage?.getItem(oe) === "list" ? "list" : "icons";
219
+ return globalThis.localStorage?.getItem(se) === "list" ? "list" : "icons";
243
220
  } catch {
244
221
  return "icons";
245
222
  }
246
223
  }
247
- function ce(e) {
224
+ function le(e) {
248
225
  try {
249
- globalThis.localStorage?.setItem(oe, e);
226
+ globalThis.localStorage?.setItem(se, e);
250
227
  } catch {}
251
228
  }
252
- var le = /* @__PURE__ */ new Map();
253
- function ue({ workspace: e, spaces: n, areas: r, unfiledCount: i, unfiledRows: o, areaMenu: s, onCreate: c }) {
254
- let d = q("areas"), { data: f = [] } = Z(a(e)), p = `${e}/${n.map((e) => e.id).join(",")}`, [m, h] = G(() => le.get(p) ?? null), g = (e) => {
255
- le.set(p, e), h(e);
256
- }, v = W(() => {
229
+ var ue = /* @__PURE__ */ new Map();
230
+ function de({ workspace: e, spaces: t, areas: n, unfiledCount: r, unfiledRows: i, areaMenu: o, onCreate: s }) {
231
+ let c = J("areas"), { data: l = [] } = Q(a(e)), f = `${e}/${t.map((e) => e.id).join(",")}`, [p, m] = q(() => ue.get(f) ?? null), h = (e) => {
232
+ ue.set(f, e), m(e);
233
+ }, g = K(() => {
257
234
  let e = /* @__PURE__ */ new Map();
258
- for (let t of f) t.area && e.set(t.area.id, (e.get(t.area.id) ?? 0) + 1);
259
- let t = (n) => (e.get(n) ?? 0) + r.filter((e) => e.parentId === n).reduce((e, n) => e + t(n.id), 0);
235
+ for (let t of l) t.area && e.set(t.area.id, (e.get(t.area.id) ?? 0) + 1);
236
+ let t = (r) => (e.get(r) ?? 0) + n.filter((e) => e.parentId === r).reduce((e, n) => e + t(n.id), 0);
260
237
  return t;
261
- }, [f, r]), y = (e) => r.filter((t) => t.parentId === e), b = (t, n) => t.map((t) => /* @__PURE__ */ Y(w, {
238
+ }, [l, n]), v = (e) => n.filter((t) => t.parentId === e), y = (t, n) => t.map((t) => /* @__PURE__ */ X(S, {
262
239
  workspace: e,
263
240
  area: t,
264
- inside: y(t.id).length,
265
- decisions: v(t.id),
266
- menu: () => s(t, n),
267
- onOpen: (e) => g({
241
+ inside: v(t.id).length,
242
+ decisions: g(t.id),
243
+ menu: () => o(t, n),
244
+ onOpen: (e) => h({
268
245
  kind: "area",
269
- trail: [...m?.kind === "area" ? m.trail : [], e]
246
+ trail: [...p?.kind === "area" ? p.trail : [], e]
270
247
  })
271
- }, t.id)), x = i > 0 && /* @__PURE__ */ Y(E, {
272
- name: d("unfiled"),
273
- icon: /* @__PURE__ */ Y(u, { className: "size-7 opacity-60" }),
274
- hint: i,
275
- onOpen: () => g({ kind: "unfiled" })
248
+ }, t.id)), x = r > 0 && /* @__PURE__ */ X(w, {
249
+ name: c("unfiled"),
250
+ icon: /* @__PURE__ */ X(d, { className: "size-7 opacity-60" }),
251
+ hint: r,
252
+ onOpen: () => h({ kind: "unfiled" })
276
253
  });
277
- if (!m) return n.map((e, t) => {
278
- let i = r.filter((t) => (t.teamId ?? "") === e.id);
279
- return /* @__PURE__ */ Y($, {
254
+ if (!p) return t.map((e, r) => {
255
+ let i = n.filter((t) => (t.teamId ?? "") === e.id);
256
+ return /* @__PURE__ */ X(T, {
280
257
  title: e.name,
281
- count: i.length + (t === n.length - 1 && x ? 1 : 0),
282
- icon: /* @__PURE__ */ Y(_, {
258
+ count: i.length + (r === t.length - 1 && x ? 1 : 0),
259
+ icon: /* @__PURE__ */ X(_, {
283
260
  icon: e.icon,
284
261
  color: e.color,
285
262
  name: e.name
286
263
  }),
287
264
  bare: !0,
288
- children: /* @__PURE__ */ X(T, {
265
+ children: /* @__PURE__ */ Z(C, {
289
266
  label: e.name,
290
- children: [b(i.filter((e) => !e.parentId), i), t === n.length - 1 && x]
267
+ children: [y(i.filter((e) => !e.parentId), i), r === t.length - 1 && x]
291
268
  })
292
269
  }, e.key);
293
270
  });
294
- let S = m.kind === "area" ? m.trail.at(-1) : void 0, C = S && r.find((e) => e.id === S.id), D = C ? y(C.id) : [], k = [{
295
- label: d("title"),
296
- icon: /* @__PURE__ */ Y(u, { className: "size-4" })
297
- }, ...m.kind === "area" ? m.trail.map((e) => ({ label: r.find((t) => t.id === e.id)?.title ?? e.title })) : [{ label: d("unfiled") }]];
298
- return /* @__PURE__ */ X("section", {
271
+ let E = p.kind === "area" ? p.trail.at(-1) : void 0, D = E && n.find((e) => e.id === E.id), O = D ? v(D.id) : [], k = [{
272
+ label: c("title"),
273
+ icon: /* @__PURE__ */ X(d, { className: "size-4" })
274
+ }, ...p.kind === "area" ? p.trail.map((e) => ({ label: n.find((t) => t.id === e.id)?.title ?? e.title })) : [{ label: c("unfiled") }]];
275
+ return /* @__PURE__ */ Z("section", {
299
276
  "aria-label": k.at(-1)?.label,
300
- children: [/* @__PURE__ */ X("div", {
277
+ children: [/* @__PURE__ */ Z("div", {
301
278
  className: "sticky top-0 z-10 flex h-10 items-center gap-2 border-b border-border bg-background px-4 md:px-5",
302
- children: [/* @__PURE__ */ Y(O, {
279
+ children: [/* @__PURE__ */ X(A, {
303
280
  crumbs: k,
304
281
  current: "location",
305
- onSelect: (e, t) => g(t === 0 || m.kind !== "area" ? null : {
306
- ...m,
307
- trail: m.trail.slice(0, t)
282
+ onSelect: (e, t) => h(t === 0 || p.kind !== "area" ? null : {
283
+ ...p,
284
+ trail: p.trail.slice(0, t)
308
285
  }),
309
286
  className: "min-w-0 flex-1"
310
- }), C && /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(t, {
311
- to: "/$workspace/areas/$area",
312
- params: {
313
- workspace: e,
314
- area: C.key
315
- },
316
- className: te({
287
+ }), D && /* @__PURE__ */ Z(Y, { children: [/* @__PURE__ */ X(b, {
288
+ workspace: e,
289
+ area: D,
290
+ className: V({
317
291
  variant: "ghost",
318
292
  size: "xs"
319
293
  }),
320
- children: d("openArea")
321
- }), /* @__PURE__ */ Y(N, {
294
+ children: c("openArea")
295
+ }), /* @__PURE__ */ X(P, {
322
296
  variant: "ghost",
323
297
  size: "xs",
324
- icon: /* @__PURE__ */ Y(l, { className: "size-3.5" }),
325
- label: d("addInside"),
326
- onClick: () => c({
298
+ icon: /* @__PURE__ */ X(u, { className: "size-3.5" }),
299
+ label: c("addInside"),
300
+ onClick: () => s({
327
301
  kind: "create",
328
- parent: C
302
+ parent: D
329
303
  })
330
304
  })] })]
331
- }), m.kind === "unfiled" ? /* @__PURE__ */ Y("ul", { children: o }) : D.length === 0 ? /* @__PURE__ */ Y("div", {
305
+ }), p.kind === "unfiled" ? /* @__PURE__ */ X("ul", { children: i }) : O.length === 0 ? /* @__PURE__ */ X("div", {
332
306
  className: "p-6",
333
- children: /* @__PURE__ */ Y(j, {
334
- icon: /* @__PURE__ */ Y(u, {}),
335
- title: d("emptyArea")
307
+ children: /* @__PURE__ */ X(M, {
308
+ icon: /* @__PURE__ */ X(d, {}),
309
+ title: c("emptyArea")
336
310
  })
337
- }) : /* @__PURE__ */ Y(T, {
311
+ }) : /* @__PURE__ */ X(C, {
338
312
  label: k.at(-1)?.label ?? "",
339
- children: b(D, D)
313
+ children: y(O, O)
340
314
  })]
341
315
  });
342
316
  }
343
- function de(e, t, n) {
344
- let r = q("areas"), i = C(e);
317
+ function fe(e, t, n) {
318
+ let r = J("areas"), i = x(e);
345
319
  return (e, a) => {
346
320
  let o = a.filter((t) => t.id !== e.id);
347
321
  return [
@@ -367,7 +341,7 @@ function de(e, t, n) {
367
341
  })
368
342
  }))
369
343
  }] : [],
370
- z,
344
+ H,
371
345
  {
372
346
  label: r("archive"),
373
347
  destructive: !0,
@@ -376,133 +350,130 @@ function de(e, t, n) {
376
350
  ];
377
351
  };
378
352
  }
379
- var fe = 20;
380
- function pe({ workspace: e, area: n, counts: r, siblings: i, depth: a, review: o, areaMenu: s }) {
381
- let c = q("areas"), l = q("common"), d = B(), p = C(e), m = K(), { nameOf: h, avatarOf: _ } = g(e), b = n.status === "proposed", x = () => s(n, i), w = p.accept.error ?? p.merge.error ?? p.archive.error, T = n.creator;
382
- return /* @__PURE__ */ X("li", {
353
+ var pe = 20;
354
+ function me({ workspace: e, area: t, counts: n, siblings: r, depth: i, review: a, areaMenu: o }) {
355
+ let s = J("areas"), c = J("common"), l = U(), u = x(e), f = ne(), { nameOf: m, avatarOf: h } = g(e), _ = t.status === "proposed", S = () => o(t, r), C = u.accept.error ?? u.merge.error ?? u.archive.error, w = t.creator;
356
+ return /* @__PURE__ */ Z("li", {
383
357
  className: "group flex min-h-10 items-center gap-2 border-b border-border/60 pr-2 hover:bg-muted/60",
384
358
  children: [
385
- /* @__PURE__ */ X(t, {
386
- to: "/$workspace/areas/$area",
387
- params: {
388
- workspace: e,
389
- area: n.key
390
- },
391
- onContextMenu: (e) => d(e, x()),
392
- style: { paddingLeft: `calc(var(--row-start) + ${a * fe}px)` },
359
+ /* @__PURE__ */ Z(b, {
360
+ workspace: e,
361
+ area: t,
362
+ onContextMenu: (e) => l(e, S()),
363
+ style: { paddingLeft: `calc(var(--row-start) + ${i * pe}px)` },
393
364
  className: "flex min-w-0 flex-1 items-center gap-2 self-stretch py-2 [--row-start:1rem] md:[--row-start:1.25rem]",
394
365
  children: [
395
- n.icon ? /* @__PURE__ */ Y(v, { icon: n.icon }) : /* @__PURE__ */ Y(u, { className: "size-4 shrink-0 text-muted-foreground" }),
396
- /* @__PURE__ */ Y("span", {
366
+ t.icon ? /* @__PURE__ */ X(v, { icon: t.icon }) : /* @__PURE__ */ X(d, { className: "size-4 shrink-0 text-muted-foreground" }),
367
+ /* @__PURE__ */ X("span", {
397
368
  className: "min-w-0 truncate text-sm font-medium",
398
- children: n.title
369
+ children: t.title
399
370
  }),
400
- n.homeDocId && /* @__PURE__ */ Y(f, {
371
+ t.homeDocId && /* @__PURE__ */ X(p, {
401
372
  className: "size-3.5 shrink-0 text-muted-foreground",
402
- "aria-label": c("hasHomeDoc")
373
+ "aria-label": s("hasHomeDoc")
403
374
  }),
404
- n.aliases.length > 0 && /* @__PURE__ */ Y("span", {
375
+ t.aliases.length > 0 && /* @__PURE__ */ X("span", {
405
376
  className: "min-w-0 truncate text-xs text-muted-foreground max-sm:hidden",
406
- children: c("alsoCalled", { names: n.aliases.join(", ") })
377
+ children: s("alsoCalled", { names: t.aliases.join(", ") })
407
378
  }),
408
- o && /* @__PURE__ */ Y("span", {
379
+ a && /* @__PURE__ */ X("span", {
409
380
  className: "min-w-0 truncate text-xs text-muted-foreground max-sm:hidden",
410
- children: c("inSpace", { space: o })
381
+ children: s("inSpace", { space: a })
411
382
  })
412
383
  ]
413
384
  }),
414
- w && /* @__PURE__ */ Y(M, {
385
+ C && /* @__PURE__ */ X(N, {
415
386
  inline: !0,
416
387
  className: "shrink-0 text-xs",
417
- children: m(w)
388
+ children: f(C)
418
389
  }),
419
- /* @__PURE__ */ Y(S, {
420
- counts: r,
421
- teamId: n.teamId,
390
+ /* @__PURE__ */ X(O, {
391
+ counts: n,
392
+ teamId: t.teamId,
422
393
  className: "max-sm:hidden"
423
394
  }),
424
- b && !o && /* @__PURE__ */ Y("span", {
395
+ _ && !a && /* @__PURE__ */ X("span", {
425
396
  className: "shrink-0 rounded border border-warning/60 px-1.5 py-0.5 text-[11px] leading-none text-warning",
426
- children: c("proposed")
397
+ children: s("proposed")
427
398
  }),
428
- o && T && /* @__PURE__ */ Y(R, {
429
- content: c("proposedBy", { name: h(T.kind, T.handle) }),
399
+ a && w && /* @__PURE__ */ X(B, {
400
+ content: s("proposedBy", { name: m(w.kind, w.handle) }),
430
401
  describesAnchor: !0,
431
- children: /* @__PURE__ */ X("span", {
402
+ children: /* @__PURE__ */ Z("span", {
432
403
  className: "flex shrink-0 items-center gap-1.5 text-xs text-muted-foreground max-sm:hidden",
433
- children: [/* @__PURE__ */ Y(D, {
434
- ...y(T.kind),
435
- name: h(T.kind, T.handle),
436
- src: _(T.kind, T.handle),
404
+ children: [/* @__PURE__ */ X(k, {
405
+ ...y(w.kind),
406
+ name: m(w.kind, w.handle),
407
+ src: h(w.kind, w.handle),
437
408
  size: "xs",
438
409
  decorative: !0
439
- }), h(T.kind, T.handle)]
410
+ }), m(w.kind, w.handle)]
440
411
  })
441
412
  }),
442
- /* @__PURE__ */ Y("span", {
413
+ /* @__PURE__ */ X("span", {
443
414
  className: "w-28 shrink-0 truncate text-right font-mono text-xs text-muted-foreground max-md:hidden",
444
- children: n.key
415
+ children: t.key
445
416
  }),
446
- o && /* @__PURE__ */ Y(k, {
417
+ a && /* @__PURE__ */ X(j, {
447
418
  variant: "outline",
448
419
  size: "xs",
449
- loading: p.accept.isPending,
450
- onClick: () => p.accept.mutate(n.key),
451
- children: c("accept")
420
+ loading: u.accept.isPending,
421
+ onClick: () => u.accept.mutate(t.key),
422
+ children: s("accept")
452
423
  }),
453
- /* @__PURE__ */ Y(ne, {
454
- items: x,
455
- label: l("moreActionsFor", { name: n.title })
424
+ /* @__PURE__ */ X(re, {
425
+ items: S,
426
+ label: c("moreActionsFor", { name: t.title })
456
427
  })
457
428
  ]
458
429
  });
459
430
  }
460
- function me({ workspace: e }) {
461
- let t = q("areas"), r = C(e), [i, a] = G(!1), { data: o = [], isPending: s } = Z({
431
+ function he({ workspace: e }) {
432
+ let t = J("areas"), r = x(e), [i, a] = q(!1), { data: o = [], isPending: s } = Q({
462
433
  ...n(e, !0),
463
434
  enabled: i
464
435
  });
465
- return /* @__PURE__ */ X("section", {
436
+ return /* @__PURE__ */ Z("section", {
466
437
  "aria-label": t("archived"),
467
- children: [/* @__PURE__ */ Y("h2", {
438
+ children: [/* @__PURE__ */ X("h2", {
468
439
  className: "border-b border-border",
469
- children: /* @__PURE__ */ X("button", {
440
+ children: /* @__PURE__ */ Z("button", {
470
441
  type: "button",
471
442
  onClick: () => a((e) => !e),
472
443
  "aria-expanded": i,
473
444
  className: "flex h-9 w-full items-center gap-2 px-4 text-xs font-medium text-muted-foreground hover:bg-muted/60 hover:text-foreground md:px-5",
474
445
  children: [
475
- /* @__PURE__ */ Y(d, { className: re("size-3.5 transition-transform", i && "rotate-90") }),
446
+ /* @__PURE__ */ X(f, { className: ie("size-3.5 transition-transform", i && "rotate-90") }),
476
447
  t("archived"),
477
- i && !s && /* @__PURE__ */ Y("span", {
448
+ i && !s && /* @__PURE__ */ X("span", {
478
449
  className: "tabular-nums",
479
450
  children: o.length
480
451
  })
481
452
  ]
482
453
  })
483
- }), i && !s && (o.length === 0 ? /* @__PURE__ */ Y("p", {
454
+ }), i && !s && (o.length === 0 ? /* @__PURE__ */ X("p", {
484
455
  className: "border-b border-border/60 px-4 py-2.5 pl-10 text-xs text-muted-foreground md:pl-11",
485
456
  children: t("noArchived")
486
- }) : /* @__PURE__ */ Y("ul", { children: o.map((e) => /* @__PURE__ */ X("li", {
457
+ }) : /* @__PURE__ */ X("ul", { children: o.map((e) => /* @__PURE__ */ Z("li", {
487
458
  className: "flex min-h-10 items-center gap-2 border-b border-border/60 py-1.5 pr-2 pl-4 text-muted-foreground md:pl-5",
488
459
  children: [
489
- /* @__PURE__ */ Y(u, { className: "size-4 shrink-0" }),
490
- /* @__PURE__ */ Y("span", {
460
+ /* @__PURE__ */ X(d, { className: "size-4 shrink-0" }),
461
+ /* @__PURE__ */ X("span", {
491
462
  className: "min-w-0 truncate text-sm",
492
463
  children: e.title
493
464
  }),
494
- /* @__PURE__ */ Y("span", {
465
+ /* @__PURE__ */ X("span", {
495
466
  className: "ml-auto w-28 shrink-0 truncate text-right font-mono text-xs max-md:hidden",
496
467
  children: e.key
497
468
  }),
498
- /* @__PURE__ */ Y(k, {
469
+ /* @__PURE__ */ X(j, {
499
470
  variant: "outline",
500
471
  size: "xs",
501
472
  loading: r.restore.isPending && r.restore.variables === e.key,
502
473
  onClick: () => r.restore.mutate(e.key),
503
474
  children: t("restore")
504
475
  }),
505
- /* @__PURE__ */ Y("span", {
476
+ /* @__PURE__ */ X("span", {
506
477
  "aria-hidden": !0,
507
478
  className: "size-7 shrink-0"
508
479
  })
@@ -510,51 +481,51 @@ function me({ workspace: e }) {
510
481
  }, e.id)) }))]
511
482
  });
512
483
  }
513
- var he = (e) => e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 63);
514
- function ge({ workspace: e, editing: n, spaces: r, areas: a, onClose: o }) {
515
- let s = q("areas"), c = q("common"), l = K(), u = C(e), d = n.kind === "edit" ? n.area : void 0, p = n.kind === "create" ? n.parent : void 0, [m, g] = G(d?.title ?? ""), [_, v] = G(d?.key ?? ""), [y, b] = G(!!d), [x, S] = G((d?.aliases ?? []).join(", ")), w = n.kind === "create" && n.space || r.find((e) => e.id === (d?.teamId ?? p?.teamId ?? ""))?.key || r[0]?.key || "", [T, E] = G(w), D = r.find((e) => e.key === T)?.id ?? "", [O, j] = G(p?.key ?? a.find((e) => e.id === d?.parentId)?.key ?? ""), [N, ee] = G(""), [R, te] = G(!1), { data: z = [] } = Z({
484
+ var ge = (e) => e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 63);
485
+ function _e({ workspace: e, editing: n, spaces: r, areas: a, onClose: o }) {
486
+ let s = J("areas"), c = J("common"), u = ne(), d = x(e), f = n.kind === "edit" ? n.area : void 0, m = n.kind === "create" ? n.parent : void 0, [h, g] = q(f?.title ?? ""), [_, v] = q(f?.key ?? ""), [y, b] = q(!!f), [S, C] = q((f?.aliases ?? []).join(", ")), w = n.kind === "create" && n.space || r.find((e) => e.id === (f?.teamId ?? m?.teamId ?? ""))?.key || r[0]?.key || "", [T, E] = q(w), D = r.find((e) => e.key === T)?.id ?? "", [O, k] = q(m?.key ?? a.find((e) => e.id === f?.parentId)?.key ?? ""), [A, M] = q(""), [P, R] = q(!1), { data: B = [] } = Q({
516
487
  ...i(e),
517
- enabled: R || !!d?.homeDocId
518
- }), B = N ? z.find((e) => e.key === N) : z.find((e) => e.id === d?.homeDocId), V = !d || d.status === "proposed", H = u.create.isPending || u.update.isPending, U = u.create.error ?? u.update.error, J = W(() => a.filter((e) => (e.teamId ?? "") === D && e.id !== d?.id), [
488
+ enabled: P || !!f?.homeDocId
489
+ }), V = A ? B.find((e) => e.key === A) : B.find((e) => e.id === f?.homeDocId), H = !f || f.status === "proposed", U = d.create.isPending || d.update.isPending, W = d.create.error ?? d.update.error, te = K(() => a.filter((e) => (e.teamId ?? "") === D && e.id !== f?.id), [
519
490
  a,
520
491
  D,
521
- d?.id
522
- ]), Q = x.split(",").map((e) => e.trim()).filter(Boolean);
523
- return /* @__PURE__ */ Y(F, {
492
+ f?.id
493
+ ]), G = S.split(",").map((e) => e.trim()).filter(Boolean);
494
+ return /* @__PURE__ */ X(I, {
524
495
  open: !0,
525
496
  onClose: o,
526
497
  className: "max-h-[85vh] w-full max-w-md overflow-y-auto p-5",
527
- children: /* @__PURE__ */ X("form", {
498
+ children: /* @__PURE__ */ Z("form", {
528
499
  onSubmit: (e) => {
529
- e.preventDefault(), d ? u.update.mutate({
530
- area: d.key,
500
+ e.preventDefault(), f ? d.update.mutate({
501
+ area: f.key,
531
502
  body: {
532
- title: m,
533
- aliases: Q,
534
- ...V && _ !== d.key && { key: _ },
535
- ...O !== (a.find((e) => e.id === d.parentId)?.key ?? "") && { parent: O },
536
- ...N && { homeDoc: N }
503
+ title: h,
504
+ aliases: G,
505
+ ...H && _ !== f.key && { key: _ },
506
+ ...O !== (a.find((e) => e.id === f.parentId)?.key ?? "") && { parent: O },
507
+ ...A && { homeDoc: A }
537
508
  }
538
- }, { onSuccess: o }) : u.create.mutate({
509
+ }, { onSuccess: o }) : d.create.mutate({
539
510
  key: _,
540
- title: m,
541
- aliases: Q,
511
+ title: h,
512
+ aliases: G,
542
513
  space: T,
543
514
  ...O && { parent: O },
544
- ...N && { homeDoc: N }
515
+ ...A && { homeDoc: A }
545
516
  }, { onSuccess: o });
546
517
  },
547
518
  children: [
548
- /* @__PURE__ */ Y(I, {
519
+ /* @__PURE__ */ X(L, {
549
520
  className: "text-sm font-semibold",
550
- children: s(d ? "editTitle" : "newTitle")
521
+ children: s(f ? "editTitle" : "newTitle")
551
522
  }),
552
- /* @__PURE__ */ X("label", {
523
+ /* @__PURE__ */ Z("label", {
553
524
  className: "mt-4 block text-xs font-medium text-muted-foreground",
554
- children: [s("fieldTitle"), /* @__PURE__ */ Y(P, {
555
- value: m,
525
+ children: [s("fieldTitle"), /* @__PURE__ */ X(F, {
526
+ value: h,
556
527
  onChange: (e) => {
557
- g(e.target.value), y || v(he(e.target.value));
528
+ g(e.target.value), y || v(ge(e.target.value));
558
529
  },
559
530
  required: !0,
560
531
  maxLength: 100,
@@ -562,131 +533,131 @@ function ge({ workspace: e, editing: n, spaces: r, areas: a, onClose: o }) {
562
533
  className: "mt-1"
563
534
  })]
564
535
  }),
565
- /* @__PURE__ */ X("label", {
536
+ /* @__PURE__ */ Z("label", {
566
537
  className: "mt-3 block text-xs font-medium text-muted-foreground",
567
538
  children: [
568
539
  s("fieldKey"),
569
- /* @__PURE__ */ Y(P, {
540
+ /* @__PURE__ */ X(F, {
570
541
  value: _,
571
542
  onChange: (e) => {
572
543
  b(!0), v(e.target.value.toLowerCase());
573
544
  },
574
- disabled: !V,
545
+ disabled: !H,
575
546
  required: !0,
576
547
  pattern: "[a-z0-9][a-z0-9-]{0,62}",
577
548
  mono: !0,
578
549
  className: "mt-1"
579
550
  }),
580
- /* @__PURE__ */ Y("span", {
551
+ /* @__PURE__ */ X("span", {
581
552
  className: "mt-1 block font-normal",
582
- children: s(V ? "keyHint" : "keyFixed")
553
+ children: s(H ? "keyHint" : "keyFixed")
583
554
  })
584
555
  ]
585
556
  }),
586
- /* @__PURE__ */ X("label", {
557
+ /* @__PURE__ */ Z("label", {
587
558
  className: "mt-3 block text-xs font-medium text-muted-foreground",
588
- children: [s("fieldAliases"), /* @__PURE__ */ Y(P, {
589
- value: x,
590
- onChange: (e) => S(e.target.value),
559
+ children: [s("fieldAliases"), /* @__PURE__ */ X(F, {
560
+ value: S,
561
+ onChange: (e) => C(e.target.value),
591
562
  placeholder: s("aliasesPlaceholder"),
592
563
  className: "mt-1"
593
564
  })]
594
565
  }),
595
- /* @__PURE__ */ X("div", {
566
+ /* @__PURE__ */ Z("div", {
596
567
  className: "mt-3 flex flex-wrap gap-3",
597
- children: [!d && !p && /* @__PURE__ */ X("div", {
568
+ children: [!f && !m && /* @__PURE__ */ Z("div", {
598
569
  className: "text-xs font-medium text-muted-foreground",
599
- children: [s("fieldSpace"), /* @__PURE__ */ Y("div", {
570
+ children: [s("fieldSpace"), /* @__PURE__ */ X("div", {
600
571
  className: "mt-1",
601
- children: /* @__PURE__ */ Y(L, {
572
+ children: /* @__PURE__ */ X(z, {
602
573
  value: T,
603
574
  items: r.map((e) => ({
604
575
  value: e.key,
605
576
  label: e.name
606
577
  })),
607
578
  onValueChange: (e) => {
608
- E(e), j("");
579
+ E(e), k("");
609
580
  },
610
581
  "aria-label": s("fieldSpace"),
611
582
  width: "content"
612
583
  })
613
584
  })]
614
- }), /* @__PURE__ */ X("div", {
585
+ }), /* @__PURE__ */ Z("div", {
615
586
  className: "text-xs font-medium text-muted-foreground",
616
- children: [s("fieldParent"), /* @__PURE__ */ Y("div", {
587
+ children: [s("fieldParent"), /* @__PURE__ */ X("div", {
617
588
  className: "mt-1",
618
- children: /* @__PURE__ */ Y(L, {
589
+ children: /* @__PURE__ */ X(z, {
619
590
  value: O,
620
591
  items: [{
621
592
  value: "",
622
593
  label: s("top")
623
- }, ...J.map((e) => ({
594
+ }, ...te.map((e) => ({
624
595
  value: e.key,
625
596
  label: e.title
626
597
  }))],
627
- onValueChange: (e) => j(e),
598
+ onValueChange: (e) => k(e),
628
599
  "aria-label": s("fieldParent"),
629
600
  width: "content"
630
601
  })
631
602
  })]
632
603
  })]
633
604
  }),
634
- /* @__PURE__ */ X("div", {
605
+ /* @__PURE__ */ Z("div", {
635
606
  className: "mt-3 text-xs font-medium text-muted-foreground",
636
- children: [s("fieldHomeDoc"), /* @__PURE__ */ X("div", {
607
+ children: [s("fieldHomeDoc"), /* @__PURE__ */ Z("div", {
637
608
  className: "mt-1",
638
- children: [/* @__PURE__ */ Y(A, {
639
- open: R,
640
- onOpenChange: te,
641
- items: z.map((e) => ({
609
+ children: [/* @__PURE__ */ X(ee, {
610
+ open: P,
611
+ onOpenChange: R,
612
+ items: B.map((e) => ({
642
613
  value: e.key,
643
614
  label: e.title,
644
- icon: /* @__PURE__ */ Y(f, { className: "size-3.5" })
615
+ icon: /* @__PURE__ */ X(p, { className: "size-3.5" })
645
616
  })),
646
- value: B?.key ?? null,
647
- onValueChange: (e) => e !== null && ee(e),
617
+ value: V?.key ?? null,
618
+ onValueChange: (e) => e !== null && M(e),
648
619
  placeholder: s("chooseDoc"),
649
620
  "aria-label": s("fieldHomeDoc"),
650
- trigger: /* @__PURE__ */ X(k, {
621
+ trigger: /* @__PURE__ */ Z(j, {
651
622
  type: "button",
652
623
  className: "max-w-full font-normal",
653
- children: [/* @__PURE__ */ Y(f, { className: "size-3.5 text-muted-foreground" }), /* @__PURE__ */ Y("span", {
624
+ children: [/* @__PURE__ */ X(p, { className: "size-3.5 text-muted-foreground" }), /* @__PURE__ */ X("span", {
654
625
  className: "truncate",
655
- children: B?.title ?? s("noDoc")
626
+ children: V?.title ?? s("noDoc")
656
627
  })]
657
628
  })
658
- }), B && /* @__PURE__ */ Y(t, {
629
+ }), V && /* @__PURE__ */ X(t, {
659
630
  to: "/$workspace/docs/$doc",
660
631
  params: {
661
632
  workspace: e,
662
- doc: h(B)
633
+ doc: l(V)
663
634
  },
664
635
  className: "ml-2 text-xs font-normal text-primary hover:underline",
665
636
  children: s("openDoc")
666
637
  })]
667
638
  })]
668
639
  }),
669
- U && /* @__PURE__ */ Y(M, {
640
+ W && /* @__PURE__ */ X(N, {
670
641
  size: "md",
671
642
  className: "mt-3",
672
- children: l(U)
643
+ children: u(W)
673
644
  }),
674
- /* @__PURE__ */ X("div", {
645
+ /* @__PURE__ */ Z("div", {
675
646
  className: "mt-5 flex justify-end gap-2",
676
- children: [/* @__PURE__ */ Y(k, {
647
+ children: [/* @__PURE__ */ X(j, {
677
648
  type: "button",
678
649
  onClick: o,
679
650
  children: c("cancel")
680
- }), /* @__PURE__ */ Y(k, {
651
+ }), /* @__PURE__ */ X(j, {
681
652
  type: "submit",
682
653
  variant: "primary",
683
- disabled: !m.trim() || !_,
684
- loading: H,
685
- children: d ? c("save") : s("create")
654
+ disabled: !h.trim() || !_,
655
+ loading: U,
656
+ children: f ? c("save") : s("create")
686
657
  })]
687
658
  })
688
659
  ]
689
660
  })
690
661
  });
691
662
  }
692
- export { ie as AreasPage };
663
+ export { ae as AreasPage };