@burdenoff/microfe-timecampus 2026.820.2 → 2026.825.1

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,152 +1,221 @@
1
1
  import { useTimeCampus as e, useTimeCampusNavigate as t } from "../../providers/TimeCampusProvider.js";
2
2
  import { StatCard as n } from "../../components/StatCard.js";
3
- import { LoadingSkeleton as r } from "../../components/LoadingSkeleton.js";
4
- import { useCompletePomodoroSessionMutation as i, useCreatePomodoroGoalMutation as ee, useDeletePomodoroGoalMutation as te, useGetActivePomodoroSessionQuery as ne, useGetPomodoroStatsQuery as re, useListPomodoroGoalsQuery as ie, useStartPomodoroSessionMutation as a, useUpdatePomodoroGoalMutation as o } from "../../../generated/wspace-operations.js";
5
- import { PageLayout as s } from "../../components/PageLayout.js";
6
- import { Modal as c } from "../../components/Modal.js";
7
- import { PomodoroGoalType as l } from "../../../generated/wspace-types.js";
8
- import { useCallback as u, useEffect as d, useState as f } from "react";
9
- import { Pause as ae, Pencil as oe, Play as se, Plus as ce, RotateCcw as p, SkipForward as le, Target as ue, Trash2 as de } from "lucide-react";
10
- import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
11
- import { GlassCard as _, NextSteps as v } from "@burdenoff/fe-libs/ui";
3
+ import { LoadingSkeleton as ee } from "../../components/LoadingSkeleton.js";
4
+ import { useCompletePomodoroSessionMutation as te, useCreatePomodoroGoalMutation as ne, useDeletePomodoroGoalMutation as re, useGetActivePomodoroSessionQuery as ie, useGetPomodoroSettingsQuery as ae, useGetPomodoroStatsQuery as oe, useInterruptPomodoroSessionMutation as se, useListPomodoroGoalsQuery as ce, useListPomodoroSessionsQuery as le, useStartPomodoroSessionMutation as ue, useUpdatePomodoroGoalMutation as de } from "../../../generated/wspace-operations.js";
5
+ import { PageLayout as r } from "../../components/PageLayout.js";
6
+ import { Modal as i } from "../../components/Modal.js";
7
+ import { PomodoroGoalType as a, PomodoroSessionOrderByField as fe, PomodoroSessionType as o, TimeCampusSortDirection as pe } from "../../../generated/wspace-types.js";
8
+ import { durationForSession as me, nextSessionAfter as s } from "./pomodoroDuration.js";
9
+ import { useCallback as c, useEffect as l, useRef as he, useState as u } from "react";
10
+ import { Pause as ge, Pencil as _e, Play as ve, Plus as ye, RotateCcw as be, SkipForward as xe, Target as Se, Trash2 as Ce } from "lucide-react";
11
+ import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
12
+ import { GlassCard as m, NextSteps as we } from "@burdenoff/fe-libs/ui";
12
13
  //#region src/timecampus/pages/pomodoro/PomodoroPage.tsx
13
- var y = "mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary", b = "block text-sm font-medium text-text-primary";
14
- function x(e) {
14
+ var h = "mt-1 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary", g = "block text-sm font-medium text-text-primary";
15
+ function _(e) {
15
16
  let t = new Date(e);
16
17
  return Number.isNaN(t.getTime()) ? "" : (/* @__PURE__ */ new Date(t.getTime() - t.getTimezoneOffset() * 6e4)).toISOString().slice(0, 10);
17
18
  }
18
- function S() {
19
+ function v() {
19
20
  let e = /* @__PURE__ */ new Date();
20
21
  return (/* @__PURE__ */ new Date(e.getTime() - e.getTimezoneOffset() * 6e4)).toISOString().slice(0, 10);
21
22
  }
22
- function C(e) {
23
+ function y(e) {
23
24
  let t = /* @__PURE__ */ new Date();
24
25
  return t.setDate(t.getDate() + e), (/* @__PURE__ */ new Date(t.getTime() - t.getTimezoneOffset() * 6e4)).toISOString().slice(0, 10);
25
26
  }
26
- function w(e) {
27
+ function b(e) {
27
28
  return {
28
- type: e?.type ?? l.Daily,
29
+ type: e?.type ?? a.Daily,
29
30
  target: e?.target == null ? "8" : String(e.target),
30
31
  period: e?.period ?? "DAILY",
31
- startDate: e?.startDate ? x(e.startDate) : S(),
32
- endDate: e?.endDate ? x(e.endDate) : C(0)
32
+ startDate: e?.startDate ? _(e.startDate) : v(),
33
+ endDate: e?.endDate ? _(e.endDate) : y(0)
33
34
  };
34
35
  }
35
- function T() {
36
- let { workspaceId: x = "" } = e(), S = t(), { data: T, loading: fe, error: pe } = re({
37
- variables: { workspaceId: x },
38
- skip: !x
39
- }), { data: me, loading: he, error: ge } = ne({
40
- variables: { workspaceId: x },
41
- skip: !x
42
- }), [E] = a(), [D] = i(), { data: O, refetch: k } = ie({
43
- variables: { workspaceId: x },
44
- skip: !x
45
- }), A = O?.pomodoroGoals ?? [], [j, { loading: M, error: N }] = ee(), [P, { loading: F, error: I }] = o(), [L, { loading: R, error: _e }] = te(), [ve, z] = f(!1), [B, V] = f(null), [H, U] = f(null), [W, G] = f(w()), K = (e, t) => G((n) => ({
36
+ function x() {
37
+ let { workspaceId: _ = "" } = e(), v = t(), { data: x, loading: Te, error: Ee } = oe({
38
+ variables: { workspaceId: _ },
39
+ skip: !_
40
+ }), { data: De, loading: Oe, error: ke } = ie({
41
+ variables: { workspaceId: _ },
42
+ skip: !_
43
+ }), { data: Ae, loading: je, error: Me } = ae({
44
+ variables: { workspaceId: _ },
45
+ skip: !_
46
+ }), { data: Ne } = le({
47
+ variables: {
48
+ workspaceId: _,
49
+ orderBy: {
50
+ field: fe.StartTime,
51
+ direction: pe.Desc
52
+ },
53
+ pagination: {
54
+ limit: 1,
55
+ offset: 0
56
+ }
57
+ },
58
+ skip: !_
59
+ }), [S] = ue(), [C] = te(), [Pe] = se(), { data: w, refetch: T } = ce({
60
+ variables: { workspaceId: _ },
61
+ skip: !_
62
+ }), E = w?.pomodoroGoals ?? [], [Fe, { loading: D, error: Ie }] = ne(), [Le, { loading: O, error: Re }] = de(), [ze, { loading: k, error: Be }] = re(), [Ve, A] = u(!1), [j, M] = u(null), [N, P] = u(null), [F, I] = u(b()), L = (e, t) => I((n) => ({
46
63
  ...n,
47
64
  [e]: t
48
- })), ye = () => {
49
- V(null), G(w()), z(!0);
50
- }, be = (e) => {
51
- V(e), G(w(e)), z(!0);
52
- }, xe = async () => {
53
- if (!x) return;
54
- let e = Number(W.target);
55
- !e || e <= 0 || (B ? await P({ variables: {
56
- id: B.id,
57
- workspaceId: x,
65
+ })), He = () => {
66
+ M(null), I(b()), A(!0);
67
+ }, Ue = (e) => {
68
+ M(e), I(b(e)), A(!0);
69
+ }, We = async () => {
70
+ if (!_) return;
71
+ let e = Number(F.target);
72
+ !e || e <= 0 || (j ? await Le({ variables: {
73
+ id: j.id,
74
+ workspaceId: _,
58
75
  input: {
59
- type: W.type,
76
+ type: F.type,
60
77
  target: e,
61
- period: W.period.trim() || W.type,
62
- startDate: new Date(W.startDate).toISOString(),
63
- endDate: new Date(W.endDate).toISOString()
78
+ period: F.period.trim() || F.type,
79
+ startDate: new Date(F.startDate).toISOString(),
80
+ endDate: new Date(F.endDate).toISOString()
64
81
  }
65
- } }) : await j({ variables: { input: {
66
- workspaceId: x,
67
- type: W.type,
82
+ } }) : await Fe({ variables: { input: {
83
+ workspaceId: _,
84
+ type: F.type,
68
85
  target: e,
69
- period: W.period.trim() || W.type,
70
- startDate: new Date(W.startDate).toISOString(),
71
- endDate: new Date(W.endDate).toISOString()
72
- } } }), z(!1), await k());
73
- }, Se = async () => {
74
- !H || !x || (await L({ variables: {
75
- id: H.id,
76
- workspaceId: x
77
- } }), U(null), await k());
78
- }, q = T?.pomodoroStats, J = me?.activePomodoroSession, [Y, X] = f(1500), [Z, Q] = f(!1);
79
- d(() => {
80
- if (J && !J.completed) {
81
- let e = Math.floor((Date.now() - new Date(J.startTime).getTime()) / 1e3), t = J.duration ?? 1500, n = Math.max(0, t - e);
82
- X(n), Q(n > 0);
86
+ period: F.period.trim() || F.type,
87
+ startDate: new Date(F.startDate).toISOString(),
88
+ endDate: new Date(F.endDate).toISOString()
89
+ } } }), A(!1), await T());
90
+ }, Ge = async () => {
91
+ !N || !_ || (await ze({ variables: {
92
+ id: N.id,
93
+ workspaceId: _
94
+ } }), P(null), await T());
95
+ }, R = x?.pomodoroStats, z = De?.activePomodoroSession, B = Ae?.pomodoroSettings, V = Ne?.pomodoroSessions[0], [H, U] = u(1500), [W, G] = u(!1), [K, q] = u(o.Focus), J = he(null), Y = c((e) => me(e, B), [B]), X = c((e) => {
96
+ let t = (R?.completedSessions ?? 0) + 1;
97
+ return s(e, t, B?.sessionsBeforeLongBreak ?? 4);
98
+ }, [B?.sessionsBeforeLongBreak, R?.completedSessions]);
99
+ l(() => {
100
+ if (z || !V?.completed) return;
101
+ let e = s(V.type, R?.completedSessions ?? 0, B?.sessionsBeforeLongBreak ?? 4);
102
+ q(e), U(Y(e));
103
+ }, [
104
+ z,
105
+ Y,
106
+ V,
107
+ B,
108
+ R
109
+ ]), l(() => {
110
+ if (z && !z.completed) {
111
+ let e = Math.floor((Date.now() - new Date(z.startTime).getTime()) / 1e3), t = z.duration ?? Y(z.type), n = Math.max(0, t - e);
112
+ U(n), G(n > 0);
113
+ }
114
+ }, [z, Y]);
115
+ let Z = c(async () => {
116
+ if (!(!z || !_) && J.current !== z.id) {
117
+ J.current = z.id;
118
+ try {
119
+ await C({
120
+ variables: {
121
+ id: z.id,
122
+ workspaceId: _
123
+ },
124
+ refetchQueries: [
125
+ "GetActivePomodoroSession",
126
+ "GetPomodoroStats",
127
+ "ListPomodoroSessions"
128
+ ],
129
+ awaitRefetchQueries: !0
130
+ });
131
+ let e = X(z.type);
132
+ q(e), U(Y(e)), G(!1);
133
+ } finally {
134
+ J.current = null;
135
+ }
83
136
  }
84
- }, [J]), d(() => {
85
- if (!Z || Y <= 0) return;
86
- let e = setInterval(() => {
87
- X((e) => e <= 1 ? (Q(!1), 0) : e - 1);
88
- }, 1e3);
89
- return () => clearInterval(e);
90
- }, [Z, Y]);
91
- let Ce = (e) => {
137
+ }, [
138
+ z,
139
+ C,
140
+ Y,
141
+ X,
142
+ _
143
+ ]);
144
+ l(() => {
145
+ if (H <= 0) {
146
+ G(!1), Z();
147
+ return;
148
+ }
149
+ if (!W) return;
150
+ let e = window.setTimeout(() => U((e) => Math.max(0, e - 1)), 1e3);
151
+ return () => window.clearTimeout(e);
152
+ }, [
153
+ Z,
154
+ W,
155
+ H
156
+ ]);
157
+ let Ke = (e) => {
92
158
  let t = Math.floor(e / 60), n = e % 60;
93
159
  return `${String(t).padStart(2, "0")}:${String(n).padStart(2, "0")}`;
94
- }, $ = u(async () => {
95
- if (x) {
96
- if (J && !J.completed) {
97
- Q(!0);
98
- return;
99
- }
100
- await E({
101
- variables: { input: {
102
- workspaceId: x,
103
- type: "FOCUS"
104
- } },
105
- refetchQueries: ["GetActivePomodoroSession", "GetPomodoroStats"]
106
- }), X(1500), Q(!0);
160
+ }, Q = c(async () => {
161
+ if (!_) return;
162
+ if (z && !z.completed) {
163
+ G(!0);
164
+ return;
107
165
  }
166
+ let e = K;
167
+ await S({
168
+ variables: { input: {
169
+ workspaceId: _,
170
+ type: e
171
+ } },
172
+ refetchQueries: ["GetActivePomodoroSession", "GetPomodoroStats"],
173
+ awaitRefetchQueries: !0
174
+ }), U(Y(e)), G(!0);
108
175
  }, [
109
- x,
110
- J,
111
- E
112
- ]), we = u(async () => {
113
- !J || !x || (await D({
176
+ _,
177
+ z,
178
+ Y,
179
+ K,
180
+ S
181
+ ]), qe = async () => {
182
+ G(!1), z && _ && (await Pe({
114
183
  variables: {
115
- id: J.id,
116
- workspaceId: x
184
+ id: z.id,
185
+ workspaceId: _,
186
+ reason: "Reset by user"
117
187
  },
118
- refetchQueries: ["GetActivePomodoroSession", "GetPomodoroStats"]
119
- }), Q(!1), X(1500));
120
- }, [
121
- J,
122
- x,
123
- D
124
- ]), Te = () => {
125
- Q(!1), X(1500);
188
+ refetchQueries: [
189
+ "GetActivePomodoroSession",
190
+ "GetPomodoroStats",
191
+ "ListPomodoroSessions"
192
+ ],
193
+ awaitRefetchQueries: !0
194
+ }), q(z.type)), U(Y(z?.type ?? K));
126
195
  };
127
- if (fe || he) return /* @__PURE__ */ h(s, {
196
+ if (Te || Oe || je) return /* @__PURE__ */ f(r, {
128
197
  title: "Pomodoro Timer",
129
198
  description: "Focus with the Pomodoro Technique",
130
- children: /* @__PURE__ */ h(r, {
199
+ children: /* @__PURE__ */ f(ee, {
131
200
  variant: "card",
132
201
  count: 3
133
202
  })
134
203
  });
135
- if (pe || ge) return /* @__PURE__ */ h(s, {
204
+ if (Ee || ke || Me) return /* @__PURE__ */ f(r, {
136
205
  title: "Pomodoro Timer",
137
206
  description: "Focus with the Pomodoro Technique",
138
- children: /* @__PURE__ */ h("div", {
207
+ children: /* @__PURE__ */ f("div", {
139
208
  className: "rounded-lg border border-status-error-bg/40 bg-status-error-bg p-4 text-sm text-status-error-text",
140
209
  children: "Failed to load pomodoro data. Please try again later."
141
210
  })
142
211
  });
143
- let Ee = Math.floor((q?.totalFocusMinutes ?? 0) / 60), De = (q?.totalFocusMinutes ?? 0) % 60;
144
- return /* @__PURE__ */ g(s, {
212
+ let Je = Math.floor((R?.totalFocusMinutes ?? 0) / 60), Ye = (R?.totalFocusMinutes ?? 0) % 60, $ = z?.type ?? K, Xe = $ === o.ShortBreak ? z ? "Short Break" : "Short Break Ready" : $ === o.LongBreak ? z ? "Long Break" : "Long Break Ready" : z ? "Focus Session" : "Focus Ready", Ze = $ === o.ShortBreak ? "Start Short Break" : $ === o.LongBreak ? "Start Long Break" : "Start Focus";
213
+ return /* @__PURE__ */ p(r, {
145
214
  title: "Pomodoro Timer",
146
215
  description: "Focus with the Pomodoro Technique",
147
- purpose: "Work in focused 25-minute sprints with short breaks — the Pomodoro technique helps you beat procrastination and build a streak of deep-work sessions you can actually measure.",
216
+ purpose: "Work in focused sprints with prompted short and long breaks — configure a cadence that fits your rhythm and build a deep-work streak you can measure.",
148
217
  children: [
149
- /* @__PURE__ */ h(v, {
218
+ /* @__PURE__ */ f(we, {
150
219
  storageKey: "timecampus-pomodoro",
151
220
  className: "mb-6",
152
221
  steps: [
@@ -154,122 +223,124 @@ function T() {
154
223
  id: "start",
155
224
  label: "Start a focus session",
156
225
  description: "Begin a 25-minute sprint on one task.",
157
- onClick: () => $()
226
+ onClick: () => Q()
158
227
  },
159
228
  {
160
229
  id: "analytics",
161
230
  label: "Review your pomodoro stats",
162
231
  description: "See streaks, completion rate and focus time.",
163
- onClick: () => S("/pomodoro/analytics")
232
+ onClick: () => v("/pomodoro/analytics")
164
233
  },
165
234
  {
166
235
  id: "settings",
167
236
  label: "Tune your intervals",
168
237
  description: "Adjust focus and break lengths to fit you.",
169
- onClick: () => S("/pomodoro/settings")
238
+ onClick: () => v("/pomodoro/settings")
170
239
  }
171
240
  ]
172
241
  }),
173
- /* @__PURE__ */ g("div", {
242
+ /* @__PURE__ */ p("div", {
174
243
  className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
175
244
  children: [
176
- /* @__PURE__ */ h(n, {
245
+ /* @__PURE__ */ f(n, {
177
246
  title: "Sessions Today",
178
- value: String(q?.completedSessions ?? 0),
179
- description: `Total: ${q?.totalSessions ?? 0} sessions`
247
+ value: String(R?.completedSessions ?? 0),
248
+ description: `Total: ${R?.totalSessions ?? 0} sessions`
180
249
  }),
181
- /* @__PURE__ */ h(n, {
250
+ /* @__PURE__ */ f(n, {
182
251
  title: "Focus Time",
183
- value: `${Ee}h ${De}m`,
252
+ value: `${Je}h ${Ye}m`,
184
253
  trend: {
185
- value: q?.completionRate ?? 0,
254
+ value: R?.completionRate ?? 0,
186
255
  label: "completion rate"
187
256
  }
188
257
  }),
189
- /* @__PURE__ */ h(n, {
258
+ /* @__PURE__ */ f(n, {
190
259
  title: "Current Streak",
191
- value: `${q?.streakDays ?? 0} days`,
192
- description: `Avg: ${q?.averageSessionMinutes ?? 0}m per session`
260
+ value: `${R?.streakDays ?? 0} days`,
261
+ description: `Avg: ${R?.averageSessionMinutes ?? 0}m per session`
193
262
  })
194
263
  ]
195
264
  }),
196
- /* @__PURE__ */ h("div", {
265
+ /* @__PURE__ */ f("div", {
197
266
  className: "mx-auto max-w-md",
198
- children: /* @__PURE__ */ g(_, {
267
+ children: /* @__PURE__ */ p(m, {
199
268
  treatment: "glass",
200
269
  glow: !0,
201
270
  className: "p-8 text-center",
202
271
  children: [
203
- /* @__PURE__ */ h("div", {
272
+ /* @__PURE__ */ f("div", {
204
273
  className: "mb-2",
205
- children: /* @__PURE__ */ h("span", {
274
+ children: /* @__PURE__ */ f("span", {
275
+ "aria-live": "polite",
206
276
  className: "inline-flex rounded-full bg-action-primary-bg/10 px-3 py-1 text-xs font-medium text-primary",
207
- children: J ? "Focus Session" : "Ready"
277
+ children: Xe
208
278
  })
209
279
  }),
210
- /* @__PURE__ */ h("p", {
280
+ /* @__PURE__ */ f("p", {
211
281
  className: "text-7xl font-mono font-bold text-text-primary",
212
- children: Ce(Y)
282
+ children: Ke(H)
213
283
  }),
214
- /* @__PURE__ */ h("p", {
284
+ /* @__PURE__ */ f("p", {
215
285
  className: "mt-2 text-sm text-text-secondary",
216
- children: q ? `${q.completedSessions} of ${q.totalSessions} sessions` : "No sessions yet"
286
+ children: R ? `${R.completedSessions} of ${R.totalSessions} sessions` : "No sessions yet"
217
287
  }),
218
- /* @__PURE__ */ g("div", {
288
+ /* @__PURE__ */ p("div", {
219
289
  className: "mt-6 flex items-center justify-center gap-3",
220
290
  children: [
221
- Z ? /* @__PURE__ */ g("button", {
222
- onClick: () => Q(!1),
291
+ W ? /* @__PURE__ */ p("button", {
292
+ onClick: () => G(!1),
223
293
  className: "inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-6 py-3 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90",
224
- children: [/* @__PURE__ */ h(ae, { className: "h-4 w-4" }), "Pause"]
225
- }) : /* @__PURE__ */ g("button", {
226
- onClick: $,
294
+ children: [/* @__PURE__ */ f(ge, { className: "h-4 w-4" }), "Pause"]
295
+ }) : /* @__PURE__ */ p("button", {
296
+ onClick: Q,
227
297
  className: "inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-6 py-3 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90",
228
- children: [/* @__PURE__ */ h(se, { className: "h-4 w-4" }), "Start"]
298
+ children: [/* @__PURE__ */ f(ve, { className: "h-4 w-4" }), Ze]
229
299
  }),
230
- /* @__PURE__ */ g("button", {
231
- onClick: we,
232
- className: "inline-flex items-center gap-2 rounded-md border border-border-subtle px-4 py-3 text-sm font-medium text-text-primary hover:bg-bg-sunken/50",
233
- children: [/* @__PURE__ */ h(le, { className: "h-4 w-4" }), "Skip"]
300
+ /* @__PURE__ */ p("button", {
301
+ onClick: Z,
302
+ disabled: !z,
303
+ className: "inline-flex items-center gap-2 rounded-md border border-border-subtle px-4 py-3 text-sm font-medium text-text-primary hover:bg-bg-sunken/50 disabled:opacity-50",
304
+ children: [/* @__PURE__ */ f(xe, { className: "h-4 w-4" }), "Skip"]
234
305
  }),
235
- /* @__PURE__ */ g("button", {
236
- onClick: Te,
306
+ /* @__PURE__ */ p("button", {
307
+ onClick: () => void qe(),
237
308
  className: "inline-flex items-center gap-2 rounded-md border border-border-subtle px-4 py-3 text-sm font-medium text-text-primary hover:bg-bg-sunken/50",
238
- children: [/* @__PURE__ */ h(p, { className: "h-4 w-4" }), "Reset"]
309
+ children: [/* @__PURE__ */ f(be, { className: "h-4 w-4" }), "Reset"]
239
310
  })
240
311
  ]
241
312
  })
242
313
  ]
243
314
  })
244
315
  }),
245
- /* @__PURE__ */ g(_, {
316
+ /* @__PURE__ */ p(m, {
246
317
  treatment: "glass",
247
318
  className: "p-6",
248
- children: [/* @__PURE__ */ g("div", {
319
+ children: [/* @__PURE__ */ p("div", {
249
320
  className: "mb-4 flex items-center justify-between",
250
- children: [/* @__PURE__ */ g("h3", {
321
+ children: [/* @__PURE__ */ p("h3", {
251
322
  className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
252
- children: [/* @__PURE__ */ h(ue, { className: "h-4 w-4" }), "Focus Goals"]
253
- }), /* @__PURE__ */ g("button", {
254
- onClick: ye,
323
+ children: [/* @__PURE__ */ f(Se, { className: "h-4 w-4" }), "Focus Goals"]
324
+ }), /* @__PURE__ */ p("button", {
325
+ onClick: He,
255
326
  className: "inline-flex items-center gap-1.5 rounded-md bg-action-primary-bg px-3 py-1.5 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90",
256
- children: [/* @__PURE__ */ h(ce, { className: "h-4 w-4" }), "Add Goal"]
327
+ children: [/* @__PURE__ */ f(ye, { className: "h-4 w-4" }), "Add Goal"]
257
328
  })]
258
- }), A.length === 0 ? /* @__PURE__ */ h("p", {
329
+ }), E.length === 0 ? /* @__PURE__ */ f("p", {
259
330
  className: "py-6 text-center text-sm text-text-secondary",
260
331
  children: "No focus goals yet. Set a daily or weekly target to build a consistent focus habit."
261
- }) : /* @__PURE__ */ h("div", {
332
+ }) : /* @__PURE__ */ f("div", {
262
333
  className: "space-y-3",
263
- children: A.map((e) => {
334
+ children: E.map((e) => {
264
335
  let t = e.target ? Math.min(100, Math.round(e.current / e.target * 100)) : 0;
265
- return /* @__PURE__ */ g("div", {
336
+ return /* @__PURE__ */ p("div", {
266
337
  className: "rounded-lg border border-border-subtle p-4",
267
- children: [/* @__PURE__ */ g("div", {
338
+ children: [/* @__PURE__ */ p("div", {
268
339
  className: "flex items-center justify-between",
269
- children: [/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ g("p", {
340
+ children: [/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ p("p", {
270
341
  className: "text-sm font-medium capitalize text-text-primary",
271
342
  children: [e.type.toLowerCase(), " goal"]
272
- }), /* @__PURE__ */ g("p", {
343
+ }), /* @__PURE__ */ p("p", {
273
344
  className: "text-xs text-text-secondary",
274
345
  children: [
275
346
  e.current,
@@ -277,30 +348,30 @@ function T() {
277
348
  e.target,
278
349
  " sessions"
279
350
  ]
280
- })] }), /* @__PURE__ */ g("div", {
351
+ })] }), /* @__PURE__ */ p("div", {
281
352
  className: "flex items-center gap-2",
282
353
  children: [
283
- /* @__PURE__ */ g("span", {
354
+ /* @__PURE__ */ p("span", {
284
355
  className: "text-sm font-medium text-text-primary",
285
356
  children: [t, "%"]
286
357
  }),
287
- /* @__PURE__ */ h("button", {
288
- onClick: () => be(e),
358
+ /* @__PURE__ */ f("button", {
359
+ onClick: () => Ue(e),
289
360
  className: "rounded-md p-1.5 text-text-secondary hover:bg-bg-sunken hover:text-text-primary",
290
361
  "aria-label": "Edit goal",
291
- children: /* @__PURE__ */ h(oe, { className: "h-4 w-4" })
362
+ children: /* @__PURE__ */ f(_e, { className: "h-4 w-4" })
292
363
  }),
293
- /* @__PURE__ */ h("button", {
294
- onClick: () => U(e),
364
+ /* @__PURE__ */ f("button", {
365
+ onClick: () => P(e),
295
366
  className: "rounded-md p-1.5 text-text-secondary hover:bg-status-error-bg hover:text-status-error-text",
296
367
  "aria-label": "Delete goal",
297
- children: /* @__PURE__ */ h(de, { className: "h-4 w-4" })
368
+ children: /* @__PURE__ */ f(Ce, { className: "h-4 w-4" })
298
369
  })
299
370
  ]
300
371
  })]
301
- }), /* @__PURE__ */ h("div", {
372
+ }), /* @__PURE__ */ f("div", {
302
373
  className: "mt-3 h-2 w-full rounded-full bg-bg-sunken",
303
- children: /* @__PURE__ */ h("div", {
374
+ children: /* @__PURE__ */ f("div", {
304
375
  className: "h-2 rounded-full bg-action-primary-bg",
305
376
  style: { width: `${t}%` }
306
377
  })
@@ -309,115 +380,115 @@ function T() {
309
380
  })
310
381
  })]
311
382
  }),
312
- /* @__PURE__ */ g(c, {
313
- open: ve,
314
- onClose: () => z(!1),
315
- title: B ? "Edit Focus Goal" : "Add Focus Goal",
383
+ /* @__PURE__ */ p(i, {
384
+ open: Ve,
385
+ onClose: () => A(!1),
386
+ title: j ? "Edit Focus Goal" : "Add Focus Goal",
316
387
  description: "Set a target number of focus sessions",
317
- footer: /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("button", {
318
- onClick: () => z(!1),
388
+ footer: /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f("button", {
389
+ onClick: () => A(!1),
319
390
  className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken/50",
320
391
  children: "Cancel"
321
- }), /* @__PURE__ */ h("button", {
322
- onClick: xe,
323
- disabled: M || F || Number(W.target) <= 0,
392
+ }), /* @__PURE__ */ f("button", {
393
+ onClick: We,
394
+ disabled: D || O || Number(F.target) <= 0,
324
395
  className: "rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 disabled:opacity-50",
325
- children: M || F ? "Saving..." : B ? "Save Changes" : "Add Goal"
396
+ children: D || O ? "Saving..." : j ? "Save Changes" : "Add Goal"
326
397
  })] }),
327
- children: [(N || I) && /* @__PURE__ */ h("div", {
398
+ children: [(Ie || Re) && /* @__PURE__ */ f("div", {
328
399
  className: "mb-4 rounded-lg border border-status-error-bg/40 bg-status-error-bg p-3 text-sm text-status-error-text",
329
400
  children: "Failed to save goal. Please try again."
330
- }), /* @__PURE__ */ g("div", {
401
+ }), /* @__PURE__ */ p("div", {
331
402
  className: "space-y-4",
332
403
  children: [
333
- /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
334
- className: b,
404
+ /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
405
+ className: g,
335
406
  children: "Goal Type"
336
- }), /* @__PURE__ */ g("select", {
337
- value: W.type,
407
+ }), /* @__PURE__ */ p("select", {
408
+ value: F.type,
338
409
  onChange: (e) => {
339
410
  let t = e.target.value;
340
- G((e) => ({
411
+ I((e) => ({
341
412
  ...e,
342
413
  type: t,
343
414
  period: t,
344
- endDate: t === l.Daily ? C(0) : t === l.Weekly ? C(7) : C(30)
415
+ endDate: t === a.Daily ? y(0) : t === a.Weekly ? y(7) : y(30)
345
416
  }));
346
417
  },
347
- className: y,
418
+ className: h,
348
419
  children: [
349
- /* @__PURE__ */ h("option", {
350
- value: l.Daily,
420
+ /* @__PURE__ */ f("option", {
421
+ value: a.Daily,
351
422
  children: "Daily"
352
423
  }),
353
- /* @__PURE__ */ h("option", {
354
- value: l.Weekly,
424
+ /* @__PURE__ */ f("option", {
425
+ value: a.Weekly,
355
426
  children: "Weekly"
356
427
  }),
357
- /* @__PURE__ */ h("option", {
358
- value: l.Monthly,
428
+ /* @__PURE__ */ f("option", {
429
+ value: a.Monthly,
359
430
  children: "Monthly"
360
431
  })
361
432
  ]
362
433
  })] }),
363
- /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
364
- className: b,
434
+ /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
435
+ className: g,
365
436
  children: "Target Sessions"
366
- }), /* @__PURE__ */ h("input", {
437
+ }), /* @__PURE__ */ f("input", {
367
438
  type: "number",
368
439
  min: "1",
369
440
  placeholder: "8",
370
- value: W.target,
371
- onChange: (e) => K("target", e.target.value),
372
- className: y
441
+ value: F.target,
442
+ onChange: (e) => L("target", e.target.value),
443
+ className: h
373
444
  })] }),
374
- /* @__PURE__ */ g("div", {
445
+ /* @__PURE__ */ p("div", {
375
446
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
376
- children: [/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
377
- className: b,
447
+ children: [/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
448
+ className: g,
378
449
  children: "Start Date"
379
- }), /* @__PURE__ */ h("input", {
450
+ }), /* @__PURE__ */ f("input", {
380
451
  type: "date",
381
- value: W.startDate,
382
- onChange: (e) => K("startDate", e.target.value),
383
- className: y
384
- })] }), /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
385
- className: b,
452
+ value: F.startDate,
453
+ onChange: (e) => L("startDate", e.target.value),
454
+ className: h
455
+ })] }), /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
456
+ className: g,
386
457
  children: "End Date"
387
- }), /* @__PURE__ */ h("input", {
458
+ }), /* @__PURE__ */ f("input", {
388
459
  type: "date",
389
- value: W.endDate,
390
- onChange: (e) => K("endDate", e.target.value),
391
- className: y
460
+ value: F.endDate,
461
+ onChange: (e) => L("endDate", e.target.value),
462
+ className: h
392
463
  })] })]
393
464
  })
394
465
  ]
395
466
  })]
396
467
  }),
397
- /* @__PURE__ */ g(c, {
398
- open: H !== null,
399
- onClose: () => U(null),
468
+ /* @__PURE__ */ p(i, {
469
+ open: N !== null,
470
+ onClose: () => P(null),
400
471
  title: "Delete Focus Goal",
401
472
  size: "sm",
402
- footer: /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("button", {
403
- onClick: () => U(null),
473
+ footer: /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f("button", {
474
+ onClick: () => P(null),
404
475
  className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken/50",
405
476
  children: "Cancel"
406
- }), /* @__PURE__ */ h("button", {
407
- onClick: Se,
408
- disabled: R,
477
+ }), /* @__PURE__ */ f("button", {
478
+ onClick: Ge,
479
+ disabled: k,
409
480
  className: "rounded-md bg-status-error-bg px-4 py-2 text-sm font-medium text-status-error-text hover:bg-status-error-bg/90 disabled:opacity-50",
410
- children: R ? "Deleting..." : "Delete"
481
+ children: k ? "Deleting..." : "Delete"
411
482
  })] }),
412
- children: [_e && /* @__PURE__ */ h("div", {
483
+ children: [Be && /* @__PURE__ */ f("div", {
413
484
  className: "mb-4 rounded-lg border border-status-error-bg/40 bg-status-error-bg p-3 text-sm text-status-error-text",
414
485
  children: "Failed to delete goal. Please try again."
415
- }), /* @__PURE__ */ g("p", {
486
+ }), /* @__PURE__ */ p("p", {
416
487
  className: "text-sm text-text-secondary",
417
488
  children: [
418
489
  "Are you sure you want to delete this",
419
490
  " ",
420
- H?.type.toLowerCase(),
491
+ N?.type.toLowerCase(),
421
492
  " focus goal? This action cannot be undone."
422
493
  ]
423
494
  })]
@@ -426,6 +497,6 @@ function T() {
426
497
  });
427
498
  }
428
499
  //#endregion
429
- export { T as PomodoroPage };
500
+ export { x as PomodoroPage };
430
501
 
431
502
  //# sourceMappingURL=PomodoroPage.js.map