@nice2dev/templates 1.2.2 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,11 +1,11 @@
1
- var te = Object.defineProperty;
2
- var ne = (s, e, t) => e in s ? te(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
3
- var k = (s, e, t) => ne(s, typeof e != "symbol" ? e + "" : e, t);
1
+ var ne = Object.defineProperty;
2
+ var re = (s, e, t) => e in s ? ne(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
3
+ var k = (s, e, t) => re(s, typeof e != "symbol" ? e + "" : e, t);
4
4
  import { jsx as a, jsxs as l } from "react/jsx-runtime";
5
- import { useNiceTranslation as w } from "@nice2dev/ui-core";
6
- import { useContext as W, useState as D, useCallback as L, createContext as N, useMemo as z, useEffect as re } from "react";
7
- import { NtdArrowUp as $, NtdArrowDown as j, NtdDownload as ae, NtdUpload as oe } from "@nice2dev/icons";
8
- const ie = [
5
+ import { useNiceTranslation as w, clickOnActivationKey as A } from "@nice2dev/ui-core";
6
+ import { useContext as L, useState as T, useCallback as N, createContext as H, useMemo as W, useEffect as ae } from "react";
7
+ import { NtdArrowUp as j, NtdArrowDown as E, NtdDownload as oe, NtdUpload as ie } from "@nice2dev/icons";
8
+ const se = [
9
9
  {
10
10
  id: "apple",
11
11
  name: "Apple",
@@ -113,7 +113,7 @@ const ie = [
113
113
  fiber: 3.5
114
114
  }
115
115
  ];
116
- class se {
116
+ class le {
117
117
  constructor() {
118
118
  k(this, "workouts", /* @__PURE__ */ new Map());
119
119
  k(this, "meals", /* @__PURE__ */ new Map());
@@ -123,7 +123,7 @@ class se {
123
123
  k(this, "medicationLogs", []);
124
124
  k(this, "vitals", []);
125
125
  k(this, "goals", []);
126
- k(this, "foodDatabase", [...ie]);
126
+ k(this, "foodDatabase", [...se]);
127
127
  }
128
128
  /* ─────────────────────────────────────────────────────────────
129
129
  WORKOUTS
@@ -384,11 +384,11 @@ class se {
384
384
  }
385
385
  }
386
386
  function qe() {
387
- return new se();
387
+ return new le();
388
388
  }
389
- const G = /* @__PURE__ */ N(null);
390
- function Ke() {
391
- const s = W(G);
389
+ const K = /* @__PURE__ */ H(null);
390
+ function Qe() {
391
+ const s = L(K);
392
392
  if (!s)
393
393
  throw new Error("useHealth must be used within HealthProvider");
394
394
  return s;
@@ -464,8 +464,8 @@ const f = {
464
464
  borderBottom: "1px solid #f0f0f0"
465
465
  }
466
466
  };
467
- function Qe({ service: s, className: e, style: t }) {
468
- const { t: n } = w(), [, o] = D(0), [r, i] = D("overview"), d = L(() => o((u) => u + 1), []), c = { service: s, refresh: d }, g = [
467
+ function Ye({ service: s, className: e, style: t }) {
468
+ const { t: n } = w(), [, o] = T(0), [r, i] = T("overview"), d = N(() => o((u) => u + 1), []), c = { service: s, refresh: d }, g = [
469
469
  { id: "overview", label: n("health.overview", "Overview") },
470
470
  { id: "workouts", label: n("health.workouts", "Workouts") },
471
471
  { id: "nutrition", label: n("health.nutrition", "Nutrition") },
@@ -473,10 +473,13 @@ function Qe({ service: s, className: e, style: t }) {
473
473
  { id: "medical", label: n("health.medical", "Medical") },
474
474
  { id: "medications", label: n("health.medications", "Medications") }
475
475
  ];
476
- return /* @__PURE__ */ a(G.Provider, { value: c, children: /* @__PURE__ */ l("div", { className: e, style: { ...f.container, ...t }, children: [
476
+ return /* @__PURE__ */ a(K.Provider, { value: c, children: /* @__PURE__ */ l("div", { className: e, style: { ...f.container, ...t }, children: [
477
477
  /* @__PURE__ */ a("div", { style: f.sidebar, children: g.map((u) => /* @__PURE__ */ a(
478
478
  "div",
479
479
  {
480
+ role: "button",
481
+ tabIndex: 0,
482
+ onKeyDown: A,
480
483
  onClick: () => i(u.id),
481
484
  style: {
482
485
  ...f.navItem,
@@ -489,16 +492,16 @@ function Qe({ service: s, className: e, style: t }) {
489
492
  u.id
490
493
  )) }),
491
494
  /* @__PURE__ */ l("div", { style: f.main, children: [
492
- r === "overview" && /* @__PURE__ */ a(le, { service: s }),
493
- r === "workouts" && /* @__PURE__ */ a(de, { service: s, refresh: d }),
494
- r === "nutrition" && /* @__PURE__ */ a(ce, { service: s }),
495
- r === "sleep" && /* @__PURE__ */ a(he, { service: s }),
496
- r === "medical" && /* @__PURE__ */ a(ue, { service: s }),
497
- r === "medications" && /* @__PURE__ */ a(ge, { service: s, refresh: d })
495
+ r === "overview" && /* @__PURE__ */ a(de, { service: s }),
496
+ r === "workouts" && /* @__PURE__ */ a(ce, { service: s, refresh: d }),
497
+ r === "nutrition" && /* @__PURE__ */ a(he, { service: s }),
498
+ r === "sleep" && /* @__PURE__ */ a(ue, { service: s }),
499
+ r === "medical" && /* @__PURE__ */ a(ge, { service: s }),
500
+ r === "medications" && /* @__PURE__ */ a(pe, { service: s, refresh: d })
498
501
  ] })
499
502
  ] }) });
500
503
  }
501
- function le({ service: s }) {
504
+ function de({ service: s }) {
502
505
  const { t: e } = w(), t = s.getWorkoutStats(7), n = s.getSleepStats(7), o = s.getDailyNutrition(/* @__PURE__ */ new Date()), r = s.getLatestVitals(), i = s.getTodayMedicationSchedule();
503
506
  return /* @__PURE__ */ l("div", { children: [
504
507
  /* @__PURE__ */ a("h2", { style: { marginBottom: "20px" }, children: e("health.healthOverview", "Health Overview") }),
@@ -605,7 +608,7 @@ function le({ service: s }) {
605
608
  ] })
606
609
  ] });
607
610
  }
608
- function de({
611
+ function ce({
609
612
  service: s,
610
613
  refresh: e
611
614
  }) {
@@ -650,7 +653,7 @@ function de({
650
653
  ] })
651
654
  ] });
652
655
  }
653
- function ce({ service: s }) {
656
+ function he({ service: s }) {
654
657
  const { t: e } = w(), t = s.getDailyNutrition(/* @__PURE__ */ new Date()), n = s.getMealsForDate(/* @__PURE__ */ new Date()), o = { calories: 2e3, protein: 150, carbs: 250, fat: 65 };
655
658
  return /* @__PURE__ */ l("div", { children: [
656
659
  /* @__PURE__ */ a("h2", { style: { marginBottom: "20px" }, children: e("health.nutrition", "Nutrition") }),
@@ -717,7 +720,7 @@ function ce({ service: s }) {
717
720
  ] })
718
721
  ] });
719
722
  }
720
- function he({ service: s }) {
723
+ function ue({ service: s }) {
721
724
  const { t: e } = w(), t = s.getSleepStats(7), n = s.getAllSleepEntries(), o = {
722
725
  poor: "#f44336",
723
726
  fair: "#ff9800",
@@ -767,7 +770,7 @@ function he({ service: s }) {
767
770
  ] })
768
771
  ] });
769
772
  }
770
- function ue({ service: s }) {
773
+ function ge({ service: s }) {
771
774
  const { t: e } = w(), t = s.getAllMedicalRecords(), n = s.getUpcomingFollowUps(), o = {
772
775
  appointment: e("health.appt", "Appt"),
773
776
  "lab-result": e("health.lab", "Lab"),
@@ -808,7 +811,7 @@ function ue({ service: s }) {
808
811
  ] })
809
812
  ] });
810
813
  }
811
- function ge({
814
+ function pe({
812
815
  service: s,
813
816
  refresh: e
814
817
  }) {
@@ -866,7 +869,7 @@ function ge({
866
869
  ] })
867
870
  ] });
868
871
  }
869
- const pe = [
872
+ const fe = [
870
873
  { id: "income", name: "Income", icon: "dollar", color: "#4caf50" },
871
874
  { id: "salary", name: "Salary", icon: "briefcase", color: "#4caf50", parent: "income" },
872
875
  { id: "interest", name: "Interest", icon: "building", color: "#4caf50", parent: "income" },
@@ -889,14 +892,14 @@ const pe = [
889
892
  { id: "transfer", name: "Transfer", icon: "shuffle", color: "#9e9e9e" },
890
893
  { id: "other", name: "Other", icon: "box", color: "#9e9e9e" }
891
894
  ];
892
- class fe {
895
+ class me {
893
896
  constructor() {
894
897
  k(this, "accounts", /* @__PURE__ */ new Map());
895
898
  k(this, "transactions", /* @__PURE__ */ new Map());
896
899
  k(this, "budgets", /* @__PURE__ */ new Map());
897
900
  k(this, "bills", /* @__PURE__ */ new Map());
898
901
  k(this, "investments", /* @__PURE__ */ new Map());
899
- k(this, "categories", [...pe]);
902
+ k(this, "categories", [...fe]);
900
903
  k(this, "netWorthHistory", []);
901
904
  }
902
905
  /* ─────────────────────────────────────────────────────────────
@@ -1184,12 +1187,12 @@ class fe {
1184
1187
  );
1185
1188
  }
1186
1189
  }
1187
- function Ye() {
1188
- return new fe();
1189
- }
1190
- const q = /* @__PURE__ */ N(null);
1191
1190
  function _e() {
1192
- const s = W(q);
1191
+ return new me();
1192
+ }
1193
+ const q = /* @__PURE__ */ H(null);
1194
+ function Xe() {
1195
+ const s = L(q);
1193
1196
  if (!s)
1194
1197
  throw new Error("usePersonalFinance must be used within PersonalFinanceProvider");
1195
1198
  return s;
@@ -1276,12 +1279,12 @@ const y = {
1276
1279
  marginTop: "8px"
1277
1280
  }
1278
1281
  };
1279
- function Xe({
1282
+ function Je({
1280
1283
  service: s,
1281
1284
  className: e,
1282
1285
  style: t
1283
1286
  }) {
1284
- const { t: n } = w(), [, o] = D(0), [r, i] = D("overview"), d = L(() => o((p) => p + 1), []), c = { service: s, refresh: d }, g = (p) => new Intl.NumberFormat("en-US", { style: "currency", currency: "USD" }).format(p), u = s.getAllAccounts(), h = s.calculateNetWorth();
1287
+ const { t: n } = w(), [, o] = T(0), [r, i] = T("overview"), d = N(() => o((p) => p + 1), []), c = { service: s, refresh: d }, g = (p) => new Intl.NumberFormat("en-US", { style: "currency", currency: "USD" }).format(p), u = s.getAllAccounts(), h = s.calculateNetWorth();
1285
1288
  return /* @__PURE__ */ a(q.Provider, { value: c, children: /* @__PURE__ */ l("div", { className: e, style: { ...y.container, ...t }, children: [
1286
1289
  /* @__PURE__ */ l("div", { style: y.sidebar, children: [
1287
1290
  /* @__PURE__ */ l("div", { style: y.netWorth, children: [
@@ -1298,6 +1301,9 @@ function Xe({
1298
1301
  ].map((p) => /* @__PURE__ */ a(
1299
1302
  "div",
1300
1303
  {
1304
+ role: "button",
1305
+ tabIndex: 0,
1306
+ onKeyDown: A,
1301
1307
  onClick: () => i(p),
1302
1308
  style: {
1303
1309
  padding: "12px 16px",
@@ -1330,16 +1336,16 @@ function Xe({
1330
1336
  ] })
1331
1337
  ] }),
1332
1338
  /* @__PURE__ */ l("div", { style: y.main, children: [
1333
- r === "overview" && /* @__PURE__ */ a(me, { service: s }),
1334
- r === "accounts" && /* @__PURE__ */ a(ye, { service: s, refresh: d }),
1335
- r === "transactions" && /* @__PURE__ */ a(xe, { service: s }),
1336
- r === "budgets" && /* @__PURE__ */ a(be, { service: s }),
1337
- r === "bills" && /* @__PURE__ */ a(ve, { service: s }),
1338
- r === "investments" && /* @__PURE__ */ a(we, { service: s })
1339
+ r === "overview" && /* @__PURE__ */ a(ye, { service: s }),
1340
+ r === "accounts" && /* @__PURE__ */ a(xe, { service: s, refresh: d }),
1341
+ r === "transactions" && /* @__PURE__ */ a(be, { service: s }),
1342
+ r === "budgets" && /* @__PURE__ */ a(ve, { service: s }),
1343
+ r === "bills" && /* @__PURE__ */ a(we, { service: s }),
1344
+ r === "investments" && /* @__PURE__ */ a(ke, { service: s })
1339
1345
  ] })
1340
1346
  ] }) });
1341
1347
  }
1342
- function me({ service: s }) {
1348
+ function ye({ service: s }) {
1343
1349
  const { t: e, lang: t } = w(), n = (h) => new Intl.NumberFormat("en-US", { style: "currency", currency: "USD" }).format(h), o = s.getMonthlyIncome(), r = s.getMonthlyExpenses(), i = s.getSavingsRate(), d = s.calculateBudgetStatus(), c = s.getUpcomingBills(14), g = /* @__PURE__ */ new Date(), u = s.getSpendingSummary(new Date(g.getFullYear(), g.getMonth(), 1), g);
1344
1350
  return /* @__PURE__ */ l("div", { children: [
1345
1351
  /* @__PURE__ */ a("h2", { style: { marginBottom: "20px" }, children: e("personalFinance.financialOverview", "Financial Overview") }),
@@ -1415,7 +1421,7 @@ function me({ service: s }) {
1415
1421
  /* @__PURE__ */ a("div", { style: { fontWeight: 500 }, children: h.name }),
1416
1422
  /* @__PURE__ */ a("div", { style: { fontSize: "12px", color: "#666" }, children: e("personalFinance.dueOn", "Due: {day}").replace(
1417
1423
  "{day}",
1418
- K(h.dueDate, t)
1424
+ Q(h.dueDate, t)
1419
1425
  ) })
1420
1426
  ] }),
1421
1427
  /* @__PURE__ */ a("span", { style: { fontWeight: 600 }, children: n(h.amount) })
@@ -1458,7 +1464,7 @@ function me({ service: s }) {
1458
1464
  ] })
1459
1465
  ] });
1460
1466
  }
1461
- function ye({
1467
+ function xe({
1462
1468
  service: s,
1463
1469
  refresh: e
1464
1470
  }) {
@@ -1499,7 +1505,7 @@ function ye({
1499
1505
  })
1500
1506
  ] });
1501
1507
  }
1502
- function xe({ service: s }) {
1508
+ function be({ service: s }) {
1503
1509
  const { t: e } = w(), t = (i) => new Intl.NumberFormat("en-US", { style: "currency", currency: "USD" }).format(i), n = s.getAllTransactions(), o = s.getAllCategories(), r = (i) => {
1504
1510
  var d;
1505
1511
  return ((d = o.find((c) => c.id === i)) == null ? void 0 : d.name) || "Uncategorized";
@@ -1528,7 +1534,7 @@ function xe({ service: s }) {
1528
1534
  ] }, i.id)) })
1529
1535
  ] });
1530
1536
  }
1531
- function be({ service: s }) {
1537
+ function ve({ service: s }) {
1532
1538
  const { t: e } = w(), t = (i) => new Intl.NumberFormat("en-US", { style: "currency", currency: "USD" }).format(i), n = s.getAllBudgets(), o = s.getAllCategories(), r = (i) => {
1533
1539
  var d;
1534
1540
  return ((d = o.find((c) => c.id === i)) == null ? void 0 : d.name) || "Unknown";
@@ -1591,10 +1597,10 @@ function be({ service: s }) {
1591
1597
  }) })
1592
1598
  ] });
1593
1599
  }
1594
- function K(s, e) {
1600
+ function Q(s, e) {
1595
1601
  return e !== "en" ? String(s) : `${s}${{ one: "st", two: "nd", few: "rd", other: "th" }[new Intl.PluralRules("en", { type: "ordinal" }).select(s)] ?? "th"}`;
1596
1602
  }
1597
- function ve({ service: s }) {
1603
+ function we({ service: s }) {
1598
1604
  const { t: e, lang: t } = w(), n = (i) => new Intl.NumberFormat("en-US", { style: "currency", currency: "USD" }).format(i), o = s.getAllBills(), r = s.calculateMonthlyBillTotal();
1599
1605
  return /* @__PURE__ */ l("div", { children: [
1600
1606
  /* @__PURE__ */ a("h2", { style: { marginBottom: "20px" }, children: e("personalFinance.billsSubscriptions", "Bills & Subscriptions") }),
@@ -1608,7 +1614,7 @@ function ve({ service: s }) {
1608
1614
  /* @__PURE__ */ l("div", { style: { fontSize: "12px", color: "#666" }, children: [
1609
1615
  e("personalFinance.dueOn", "Due: {day}").replace(
1610
1616
  "{day}",
1611
- K(i.dueDate, t)
1617
+ Q(i.dueDate, t)
1612
1618
  ),
1613
1619
  " • ",
1614
1620
  e(`personalFinance.frequency.${i.frequency}`, i.frequency),
@@ -1619,7 +1625,7 @@ function ve({ service: s }) {
1619
1625
  ] }, i.id)) })
1620
1626
  ] });
1621
1627
  }
1622
- function we({ service: s }) {
1628
+ function ke({ service: s }) {
1623
1629
  const { t: e } = w(), t = (d) => new Intl.NumberFormat("en-US", { style: "currency", currency: "USD" }).format(d), n = s.getAllInvestments(), o = s.calculateTotalInvestmentValue(), r = s.calculateTotalGain(), i = s.getPortfolioAllocation();
1624
1630
  return /* @__PURE__ */ l("div", { children: [
1625
1631
  /* @__PURE__ */ a("h2", { style: { marginBottom: "20px" }, children: e("personalFinance.investments", "Investments") }),
@@ -1690,14 +1696,14 @@ function we({ service: s }) {
1690
1696
  ] })
1691
1697
  ] });
1692
1698
  }
1693
- const E = {
1699
+ const V = {
1694
1700
  urgent: 0,
1695
1701
  high: 1,
1696
1702
  medium: 2,
1697
1703
  low: 3,
1698
1704
  none: 4
1699
1705
  };
1700
- class ke {
1706
+ class Se {
1701
1707
  constructor() {
1702
1708
  k(this, "tasks", /* @__PURE__ */ new Map());
1703
1709
  k(this, "projects", /* @__PURE__ */ new Map());
@@ -1890,7 +1896,7 @@ class ke {
1890
1896
  break;
1891
1897
  }
1892
1898
  case "priority":
1893
- d = E[r.priority] - E[i.priority];
1899
+ d = V[r.priority] - V[i.priority];
1894
1900
  break;
1895
1901
  case "createdAt":
1896
1902
  d = new Date(r.createdAt).getTime() - new Date(i.createdAt).getTime();
@@ -2073,12 +2079,12 @@ class ke {
2073
2079
  this.tasks.clear(), this.projects.clear(), this.tags.clear(), this.timeBlocks.clear();
2074
2080
  }
2075
2081
  }
2076
- function Je() {
2077
- return new ke();
2078
- }
2079
- const Q = /* @__PURE__ */ N(null);
2080
2082
  function Ze() {
2081
- const s = W(Q);
2083
+ return new Se();
2084
+ }
2085
+ const Y = /* @__PURE__ */ H(null);
2086
+ function et() {
2087
+ const s = L(Y);
2082
2088
  if (!s)
2083
2089
  throw new Error("useTaskManager must be used within TaskManagerProvider");
2084
2090
  return s;
@@ -2147,8 +2153,7 @@ const S = {
2147
2153
  border: "1px solid #e0e0e0",
2148
2154
  borderRadius: "8px",
2149
2155
  fontSize: "14px",
2150
- marginBottom: "20px",
2151
- outline: "none"
2156
+ marginBottom: "20px"
2152
2157
  },
2153
2158
  taskItem: {
2154
2159
  display: "flex",
@@ -2205,29 +2210,32 @@ const S = {
2205
2210
  padding: "16px",
2206
2211
  overflow: "auto"
2207
2212
  }
2208
- }, V = {
2213
+ }, O = {
2209
2214
  urgent: "#f44336",
2210
2215
  high: "#ff9800",
2211
2216
  medium: "#2196f3",
2212
2217
  low: "#4caf50",
2213
2218
  none: "#e0e0e0"
2214
2219
  };
2215
- function et({
2220
+ function tt({
2216
2221
  service: s,
2217
2222
  className: e,
2218
2223
  style: t
2219
2224
  }) {
2220
- var P;
2221
- const { t: n } = w(), [, o] = D(0), [r, i] = D("inbox"), [d, c] = D(null), [g, u] = D(""), h = L(() => o((I) => I + 1), []), p = { service: s, refresh: h }, T = s.getStatistics(), m = s.getAllProjects(), b = () => {
2225
+ var U;
2226
+ const { t: n } = w(), [, o] = T(0), [r, i] = T("inbox"), [d, c] = T(null), [g, u] = T(""), h = N(() => o((I) => I + 1), []), p = { service: s, refresh: h }, D = s.getStatistics(), m = s.getAllProjects(), b = () => {
2222
2227
  g.trim() && (s.quickAddTask(g), u(""), h());
2223
- }, C = (I, U) => {
2224
- i(I), c(U ?? null);
2228
+ }, C = (I, z) => {
2229
+ i(I), c(z ?? null);
2225
2230
  };
2226
- return /* @__PURE__ */ a(Q.Provider, { value: p, children: /* @__PURE__ */ l("div", { className: e, style: { ...S.container, ...t }, children: [
2231
+ return /* @__PURE__ */ a(Y.Provider, { value: p, children: /* @__PURE__ */ l("div", { className: e, style: { ...S.container, ...t }, children: [
2227
2232
  /* @__PURE__ */ l("div", { style: S.sidebar, children: [
2228
2233
  /* @__PURE__ */ l(
2229
2234
  "div",
2230
2235
  {
2236
+ role: "button",
2237
+ tabIndex: 0,
2238
+ onKeyDown: A,
2231
2239
  onClick: () => C("inbox"),
2232
2240
  style: {
2233
2241
  ...S.menuItem,
@@ -2235,13 +2243,16 @@ function et({
2235
2243
  },
2236
2244
  children: [
2237
2245
  /* @__PURE__ */ a("span", { children: n("taskManager.inbox", "Inbox") }),
2238
- T.total - T.completed > 0 && /* @__PURE__ */ a("span", { style: S.badge, children: s.getInbox().length })
2246
+ D.total - D.completed > 0 && /* @__PURE__ */ a("span", { style: S.badge, children: s.getInbox().length })
2239
2247
  ]
2240
2248
  }
2241
2249
  ),
2242
2250
  /* @__PURE__ */ l(
2243
2251
  "div",
2244
2252
  {
2253
+ role: "button",
2254
+ tabIndex: 0,
2255
+ onKeyDown: A,
2245
2256
  onClick: () => C("today"),
2246
2257
  style: {
2247
2258
  ...S.menuItem,
@@ -2249,13 +2260,16 @@ function et({
2249
2260
  },
2250
2261
  children: [
2251
2262
  /* @__PURE__ */ a("span", { children: n("taskManager.today", "Today") }),
2252
- T.dueToday > 0 && /* @__PURE__ */ a("span", { style: S.badge, children: T.dueToday })
2263
+ D.dueToday > 0 && /* @__PURE__ */ a("span", { style: S.badge, children: D.dueToday })
2253
2264
  ]
2254
2265
  }
2255
2266
  ),
2256
2267
  /* @__PURE__ */ a(
2257
2268
  "div",
2258
2269
  {
2270
+ role: "button",
2271
+ tabIndex: 0,
2272
+ onKeyDown: A,
2259
2273
  onClick: () => C("upcoming"),
2260
2274
  style: {
2261
2275
  ...S.menuItem,
@@ -2267,6 +2281,9 @@ function et({
2267
2281
  /* @__PURE__ */ a(
2268
2282
  "div",
2269
2283
  {
2284
+ role: "button",
2285
+ tabIndex: 0,
2286
+ onKeyDown: A,
2270
2287
  onClick: () => C("matrix"),
2271
2288
  style: {
2272
2289
  ...S.menuItem,
@@ -2278,6 +2295,9 @@ function et({
2278
2295
  /* @__PURE__ */ a(
2279
2296
  "div",
2280
2297
  {
2298
+ role: "button",
2299
+ tabIndex: 0,
2300
+ onKeyDown: A,
2281
2301
  onClick: () => C("all"),
2282
2302
  style: {
2283
2303
  ...S.menuItem,
@@ -2286,16 +2306,19 @@ function et({
2286
2306
  children: /* @__PURE__ */ a("span", { children: n("taskManager.allTasks", "All Tasks") })
2287
2307
  }
2288
2308
  ),
2289
- T.overdue > 0 && /* @__PURE__ */ l("div", { style: { ...S.menuItem, color: "#f44336" }, children: [
2309
+ D.overdue > 0 && /* @__PURE__ */ l("div", { style: { ...S.menuItem, color: "#f44336" }, children: [
2290
2310
  /* @__PURE__ */ a("span", { children: n("taskManager.overdue", "Overdue") }),
2291
- /* @__PURE__ */ a("span", { style: { ...S.badge, backgroundColor: "#f44336" }, children: T.overdue })
2311
+ /* @__PURE__ */ a("span", { style: { ...S.badge, backgroundColor: "#f44336" }, children: D.overdue })
2292
2312
  ] }),
2293
2313
  /* @__PURE__ */ a("div", { style: S.sectionTitle, children: n("taskManager.projects", "Projects") }),
2294
2314
  m.map((I) => {
2295
- const U = s.getProjectProgress(I.id);
2315
+ const z = s.getProjectProgress(I.id);
2296
2316
  return /* @__PURE__ */ l(
2297
2317
  "div",
2298
2318
  {
2319
+ role: "button",
2320
+ tabIndex: 0,
2321
+ onKeyDown: A,
2299
2322
  onClick: () => C("project", I.id),
2300
2323
  style: {
2301
2324
  ...S.menuItem,
@@ -2315,7 +2338,7 @@ function et({
2315
2338
  ),
2316
2339
  /* @__PURE__ */ a("span", { style: { flex: 1 }, children: I.name }),
2317
2340
  /* @__PURE__ */ l("span", { style: { fontSize: "12px", color: "#999" }, children: [
2318
- U.percentage,
2341
+ z.percentage,
2319
2342
  "%"
2320
2343
  ] })
2321
2344
  ]
@@ -2332,9 +2355,9 @@ function et({
2332
2355
  r === "upcoming" && n("taskManager.upcoming", "Upcoming"),
2333
2356
  r === "matrix" && n("taskManager.priorityMatrix", "Priority Matrix"),
2334
2357
  r === "all" && n("taskManager.allTasks", "All Tasks"),
2335
- r === "project" && ((P = m.find((I) => I.id === d)) == null ? void 0 : P.name)
2358
+ r === "project" && ((U = m.find((I) => I.id === d)) == null ? void 0 : U.name)
2336
2359
  ] }),
2337
- /* @__PURE__ */ a("div", { style: { fontSize: "14px", color: "#666" }, children: n("taskManager.completed", "{completed}/{total} completed").replace("{completed}", String(T.completed)).replace("{total}", String(T.total)) })
2360
+ /* @__PURE__ */ a("div", { style: { fontSize: "14px", color: "#666" }, children: n("taskManager.completed", "{completed}/{total} completed").replace("{completed}", String(D.completed)).replace("{total}", String(D.total)) })
2338
2361
  ] }),
2339
2362
  r !== "matrix" && /* @__PURE__ */ a(
2340
2363
  "input",
@@ -2351,7 +2374,7 @@ function et({
2351
2374
  }
2352
2375
  ),
2353
2376
  r === "matrix" ? /* @__PURE__ */ a(Te, { service: s, onComplete: h }) : /* @__PURE__ */ a(
2354
- Se,
2377
+ De,
2355
2378
  {
2356
2379
  service: s,
2357
2380
  view: r,
@@ -2362,13 +2385,13 @@ function et({
2362
2385
  ] })
2363
2386
  ] }) });
2364
2387
  }
2365
- function Se({
2388
+ function De({
2366
2389
  service: s,
2367
2390
  view: e,
2368
2391
  projectId: t,
2369
2392
  onComplete: n
2370
2393
  }) {
2371
- const { t: o } = w(), r = z(() => {
2394
+ const { t: o } = w(), r = W(() => {
2372
2395
  switch (e) {
2373
2396
  case "inbox":
2374
2397
  return s.getInbox();
@@ -2387,9 +2410,9 @@ function Se({
2387
2410
  return [];
2388
2411
  }
2389
2412
  }, [s, e, t]);
2390
- return r.length === 0 ? /* @__PURE__ */ a("div", { style: { textAlign: "center", padding: "60px", color: "#999" }, children: /* @__PURE__ */ a("div", { children: o("taskManager.noTasksHere", "No tasks here!") }) }) : /* @__PURE__ */ a("div", { children: r.map((i) => /* @__PURE__ */ a(Y, { task: i, service: s, onComplete: n }, i.id)) });
2413
+ return r.length === 0 ? /* @__PURE__ */ a("div", { style: { textAlign: "center", padding: "60px", color: "#999" }, children: /* @__PURE__ */ a("div", { children: o("taskManager.noTasksHere", "No tasks here!") }) }) : /* @__PURE__ */ a("div", { children: r.map((i) => /* @__PURE__ */ a(_, { task: i, service: s, onComplete: n }, i.id)) });
2391
2414
  }
2392
- function Y({
2415
+ function _({
2393
2416
  task: s,
2394
2417
  service: e,
2395
2418
  onComplete: t
@@ -2406,16 +2429,21 @@ function Y({
2406
2429
  /* @__PURE__ */ a(
2407
2430
  "div",
2408
2431
  {
2409
- style: { ...S.priorityIndicator, backgroundColor: V[s.priority] }
2432
+ style: { ...S.priorityIndicator, backgroundColor: O[s.priority] }
2410
2433
  }
2411
2434
  ),
2412
2435
  /* @__PURE__ */ a(
2413
2436
  "div",
2414
2437
  {
2438
+ role: "checkbox",
2439
+ "aria-checked": s.status === "done",
2440
+ "aria-label": s.title,
2441
+ tabIndex: 0,
2442
+ onKeyDown: A,
2415
2443
  onClick: o,
2416
2444
  style: {
2417
2445
  ...S.checkbox,
2418
- borderColor: V[s.priority]
2446
+ borderColor: O[s.priority]
2419
2447
  }
2420
2448
  }
2421
2449
  ),
@@ -2455,7 +2483,7 @@ function Te({
2455
2483
  children: [
2456
2484
  /* @__PURE__ */ a("div", { style: { fontWeight: 600, marginBottom: "8px" }, children: t(`taskManager.quadrant.${r}.name`, i.name) }),
2457
2485
  /* @__PURE__ */ a("div", { style: { fontSize: "12px", color: "#666", marginBottom: "12px" }, children: t(`taskManager.quadrant.${r}.description`, i.description) }),
2458
- i.tasks.map((c) => /* @__PURE__ */ a(Y, { task: c, service: s, onComplete: e }, c.id)),
2486
+ i.tasks.map((c) => /* @__PURE__ */ a(_, { task: c, service: s, onComplete: e }, c.id)),
2459
2487
  i.tasks.length === 0 && /* @__PURE__ */ a("div", { style: { color: "#999", textAlign: "center", padding: "20px" }, children: t("taskManager.empty", "Empty") })
2460
2488
  ]
2461
2489
  },
@@ -2463,7 +2491,7 @@ function Te({
2463
2491
  );
2464
2492
  }) });
2465
2493
  }
2466
- class De {
2494
+ class Ie {
2467
2495
  constructor() {
2468
2496
  k(this, "kpis", /* @__PURE__ */ new Map());
2469
2497
  k(this, "goals", /* @__PURE__ */ new Map());
@@ -2663,7 +2691,7 @@ class De {
2663
2691
  const n = e.length;
2664
2692
  if (n === 0)
2665
2693
  return 0;
2666
- const o = e.reduce((h, p) => h + p, 0), r = t.reduce((h, p) => h + p, 0), i = e.reduce((h, p, T) => h + p * t[T], 0), d = e.reduce((h, p) => h + p * p, 0), c = t.reduce((h, p) => h + p * p, 0), g = n * i - o * r, u = Math.sqrt((n * d - o ** 2) * (n * c - r ** 2));
2694
+ const o = e.reduce((h, p) => h + p, 0), r = t.reduce((h, p) => h + p, 0), i = e.reduce((h, p, D) => h + p * t[D], 0), d = e.reduce((h, p) => h + p * p, 0), c = t.reduce((h, p) => h + p * p, 0), g = n * i - o * r, u = Math.sqrt((n * d - o ** 2) * (n * c - r ** 2));
2667
2695
  return u === 0 ? 0 : g / u;
2668
2696
  }
2669
2697
  /* ─────────────────────────────────────────────────────────────
@@ -2715,12 +2743,12 @@ class De {
2715
2743
  this.kpis.clear(), this.goals.clear(), this.habits.clear(), this.moodEntries.clear();
2716
2744
  }
2717
2745
  }
2718
- function tt() {
2719
- return new De();
2720
- }
2721
- const _ = /* @__PURE__ */ N(null);
2722
2746
  function nt() {
2723
- const s = W(_);
2747
+ return new Ie();
2748
+ }
2749
+ const X = /* @__PURE__ */ H(null);
2750
+ function rt() {
2751
+ const s = L(X);
2724
2752
  if (!s)
2725
2753
  throw new Error("useLifeDashboard must be used within LifeDashboardProvider");
2726
2754
  return s;
@@ -2815,15 +2843,15 @@ const v = {
2815
2843
  color: "#1565c0"
2816
2844
  }
2817
2845
  };
2818
- function rt({
2846
+ function at({
2819
2847
  service: s,
2820
2848
  className: e,
2821
2849
  style: t
2822
2850
  }) {
2823
- const { t: n } = w(), [, o] = D(0), r = L(() => {
2851
+ const { t: n } = w(), [, o] = T(0), r = N(() => {
2824
2852
  o((m) => m + 1);
2825
- }, []), i = { service: s, refresh: r }, d = s.generateDailyInsights(), c = s.getAllKPIs(), g = s.getTodayHabitStatus(), u = s.getActiveGoals(), h = s.getFinanceSummary(), p = s.calculateFinanceHealth(), T = (m) => new Intl.NumberFormat("en-US", { style: "currency", currency: "USD" }).format(m);
2826
- return /* @__PURE__ */ a(_.Provider, { value: i, children: /* @__PURE__ */ l("div", { className: e, style: { ...v.dashboard, ...t }, children: [
2853
+ }, []), i = { service: s, refresh: r }, d = s.generateDailyInsights(), c = s.getAllKPIs(), g = s.getTodayHabitStatus(), u = s.getActiveGoals(), h = s.getFinanceSummary(), p = s.calculateFinanceHealth(), D = (m) => new Intl.NumberFormat("en-US", { style: "currency", currency: "USD" }).format(m);
2854
+ return /* @__PURE__ */ a(X.Provider, { value: i, children: /* @__PURE__ */ l("div", { className: e, style: { ...v.dashboard, ...t }, children: [
2827
2855
  /* @__PURE__ */ l("div", { style: v.header, children: [
2828
2856
  /* @__PURE__ */ a("div", { style: v.title, children: n("lifeDashboard.lifeDashboard", "Life Dashboard") }),
2829
2857
  /* @__PURE__ */ a("div", { style: { color: "#666" }, children: (/* @__PURE__ */ new Date()).toLocaleDateString("en-US", {
@@ -2855,9 +2883,9 @@ function rt({
2855
2883
  m.unit ? ` ${m.unit}` : "",
2856
2884
  " / ",
2857
2885
  m.targetValue,
2858
- m.trend === "up" && /* @__PURE__ */ a($, { size: 12, style: { marginLeft: 4, verticalAlign: "-1px" } }),
2886
+ m.trend === "up" && /* @__PURE__ */ a(j, { size: 12, style: { marginLeft: 4, verticalAlign: "-1px" } }),
2859
2887
  m.trend === "down" && /* @__PURE__ */ a(
2860
- j,
2888
+ E,
2861
2889
  {
2862
2890
  size: 12,
2863
2891
  style: { marginLeft: 4, verticalAlign: "-1px" }
@@ -2922,6 +2950,11 @@ function rt({
2922
2950
  /* @__PURE__ */ a(
2923
2951
  "div",
2924
2952
  {
2953
+ role: "checkbox",
2954
+ "aria-checked": b,
2955
+ "aria-label": m.name,
2956
+ tabIndex: 0,
2957
+ onKeyDown: A,
2925
2958
  style: {
2926
2959
  ...v.habitCheck,
2927
2960
  backgroundColor: b ? "#4caf50" : "transparent",
@@ -2959,15 +2992,15 @@ function rt({
2959
2992
  /* @__PURE__ */ a("div", { style: v.cardTitle, children: n("lifeDashboard.financeOverview", "Finance Overview") }),
2960
2993
  /* @__PURE__ */ l("div", { style: v.statRow, children: [
2961
2994
  /* @__PURE__ */ a("span", { children: n("lifeDashboard.netWorth", "Net Worth") }),
2962
- /* @__PURE__ */ a("span", { style: { fontWeight: 600 }, children: T(h.netWorth) })
2995
+ /* @__PURE__ */ a("span", { style: { fontWeight: 600 }, children: D(h.netWorth) })
2963
2996
  ] }),
2964
2997
  /* @__PURE__ */ l("div", { style: v.statRow, children: [
2965
2998
  /* @__PURE__ */ a("span", { children: n("lifeDashboard.monthlyIncome", "Monthly Income") }),
2966
- /* @__PURE__ */ a("span", { style: { color: "#4caf50" }, children: T(h.monthlyIncome) })
2999
+ /* @__PURE__ */ a("span", { style: { color: "#4caf50" }, children: D(h.monthlyIncome) })
2967
3000
  ] }),
2968
3001
  /* @__PURE__ */ l("div", { style: v.statRow, children: [
2969
3002
  /* @__PURE__ */ a("span", { children: n("lifeDashboard.monthlyExpenses", "Monthly Expenses") }),
2970
- /* @__PURE__ */ a("span", { style: { color: "#f44336" }, children: T(h.monthlyExpenses) })
3003
+ /* @__PURE__ */ a("span", { style: { color: "#f44336" }, children: D(h.monthlyExpenses) })
2971
3004
  ] }),
2972
3005
  /* @__PURE__ */ l("div", { style: v.statRow, children: [
2973
3006
  /* @__PURE__ */ a("span", { children: n("lifeDashboard.savingsRate", "Savings Rate") }),
@@ -3008,7 +3041,7 @@ function rt({
3008
3041
  /* @__PURE__ */ l("div", { style: { textAlign: "center" }, children: [
3009
3042
  /* @__PURE__ */ a("div", { style: v.moodEmoji, children: n(
3010
3043
  `lifeDashboard.mood.${Math.round(s.getAverageMood(7))}`,
3011
- Ie(Math.round(s.getAverageMood(7)))
3044
+ Ce(Math.round(s.getAverageMood(7)))
3012
3045
  ) }),
3013
3046
  /* @__PURE__ */ a("div", { style: { fontSize: "12px", color: "#666" }, children: n("lifeDashboard.avgMood7d", "Avg Mood (7d)") })
3014
3047
  ] }),
@@ -3023,7 +3056,7 @@ function rt({
3023
3056
  s.getMoodCorrelations().slice(0, 2).map((m) => /* @__PURE__ */ l("div", { style: v.statRow, children: [
3024
3057
  /* @__PURE__ */ a("span", { children: m.factor }),
3025
3058
  /* @__PURE__ */ l("span", { style: { color: m.correlation > 0 ? "#4caf50" : "#f44336" }, children: [
3026
- m.correlation > 0 ? /* @__PURE__ */ a($, { size: 12, style: { verticalAlign: "-1px" } }) : /* @__PURE__ */ a(j, { size: 12, style: { verticalAlign: "-1px" } }),
3059
+ m.correlation > 0 ? /* @__PURE__ */ a(j, { size: 12, style: { verticalAlign: "-1px" } }) : /* @__PURE__ */ a(E, { size: 12, style: { verticalAlign: "-1px" } }),
3027
3060
  " ",
3028
3061
  Math.abs(m.correlation * 100).toFixed(0),
3029
3062
  "%"
@@ -3033,7 +3066,7 @@ function rt({
3033
3066
  ] })
3034
3067
  ] }) });
3035
3068
  }
3036
- function Ie(s) {
3069
+ function Ce(s) {
3037
3070
  return {
3038
3071
  1: "Very low",
3039
3072
  2: "Low",
@@ -3042,7 +3075,7 @@ function Ie(s) {
3042
3075
  5: "Great"
3043
3076
  }[s] || "Neutral";
3044
3077
  }
3045
- const Ce = {
3078
+ const Ae = {
3046
3079
  colors: {
3047
3080
  background: "#1a1a2e",
3048
3081
  surface: "#16213e",
@@ -3064,7 +3097,7 @@ const Ce = {
3064
3097
  },
3065
3098
  borderRadius: "8px",
3066
3099
  fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"
3067
- }, O = [
3100
+ }, G = [
3068
3101
  { id: "name", label: "Name", sortable: !0, visible: !0 },
3069
3102
  { id: "size", label: "Size", width: "100px", sortable: !0, visible: !0 },
3070
3103
  { id: "progress", label: "Progress", width: "150px", sortable: !0, visible: !0 },
@@ -3075,23 +3108,23 @@ const Ce = {
3075
3108
  { id: "uploadSpeed", label: "Up", width: "100px", sortable: !0, visible: !0 },
3076
3109
  { id: "eta", label: "ETA", width: "100px", sortable: !0, visible: !0 },
3077
3110
  { id: "ratio", label: "Ratio", width: "80px", sortable: !0, visible: !0 }
3078
- ], X = /* @__PURE__ */ N(null);
3079
- function A() {
3080
- const s = W(X);
3111
+ ], J = /* @__PURE__ */ H(null);
3112
+ function M() {
3113
+ const s = L(J);
3081
3114
  if (!s)
3082
3115
  throw new Error("useTorrentUI must be used within TorrentUIProvider");
3083
3116
  return s;
3084
3117
  }
3085
- function R(s, e = 2) {
3118
+ function P(s, e = 2) {
3086
3119
  if (s === 0)
3087
3120
  return "0 B";
3088
3121
  const t = 1024, n = ["B", "KB", "MB", "GB", "TB", "PB"], o = Math.floor(Math.log(s) / Math.log(t));
3089
3122
  return `${parseFloat((s / Math.pow(t, o)).toFixed(e))} ${n[o]}`;
3090
3123
  }
3091
- function H(s) {
3092
- return `${R(s)}/s`;
3124
+ function $(s) {
3125
+ return `${P(s)}/s`;
3093
3126
  }
3094
- function Ae(s) {
3127
+ function Me(s) {
3095
3128
  if (!s || s <= 0)
3096
3129
  return "∞";
3097
3130
  if (s < 60)
@@ -3105,10 +3138,10 @@ function Ae(s) {
3105
3138
  const e = Math.floor(s / 86400), t = Math.floor(s % 86400 / 3600);
3106
3139
  return `${e}d ${t}h`;
3107
3140
  }
3108
- function J(s) {
3141
+ function Z(s) {
3109
3142
  return s.toFixed(2);
3110
3143
  }
3111
- function Z(s, e) {
3144
+ function ee(s, e) {
3112
3145
  switch (s) {
3113
3146
  case "downloading":
3114
3147
  return e.colors.primary;
@@ -3126,25 +3159,25 @@ function Z(s, e) {
3126
3159
  return e.colors.text;
3127
3160
  }
3128
3161
  }
3129
- function Me({
3162
+ function Be({
3130
3163
  client: s,
3131
3164
  config: e = {},
3132
3165
  children: t
3133
3166
  }) {
3134
- const n = z(
3135
- () => ({ ...Ce, ...e.theme }),
3167
+ const n = W(
3168
+ () => ({ ...Ae, ...e.theme }),
3136
3169
  [e.theme]
3137
- ), [o, r] = D([]), [i, d] = D(null), [c, g] = D("all"), [u, h] = D(""), p = L(() => {
3170
+ ), [o, r] = T([]), [i, d] = T(null), [c, g] = T("all"), [u, h] = T(""), p = N(() => {
3138
3171
  r(s.getAllTorrents());
3139
3172
  }, [s]);
3140
- re(() => {
3173
+ ae(() => {
3141
3174
  p();
3142
3175
  const m = setInterval(p, e.refreshInterval || 1e3), b = () => p(), C = () => p();
3143
3176
  return s.on("torrent_added", b), s.on("torrent_removed", C), () => {
3144
3177
  clearInterval(m), s.off("torrent_added", b), s.off("torrent_removed", C);
3145
3178
  };
3146
3179
  }, [s, e.refreshInterval, p]);
3147
- const T = {
3180
+ const D = {
3148
3181
  client: s,
3149
3182
  config: e,
3150
3183
  theme: n,
@@ -3157,9 +3190,9 @@ function Me({
3157
3190
  setSearchQuery: h,
3158
3191
  refresh: p
3159
3192
  };
3160
- return /* @__PURE__ */ a(X.Provider, { value: T, children: /* @__PURE__ */ a("div", { style: { fontFamily: n.fontFamily, color: n.colors.text }, children: t }) });
3193
+ return /* @__PURE__ */ a(J.Provider, { value: D, children: /* @__PURE__ */ a("div", { style: { fontFamily: n.fontFamily, color: n.colors.text }, children: t }) });
3161
3194
  }
3162
- function Be({
3195
+ function Fe({
3163
3196
  progress: s,
3164
3197
  status: e,
3165
3198
  showLabel: t = !0,
@@ -3167,7 +3200,7 @@ function Be({
3167
3200
  className: o,
3168
3201
  style: r
3169
3202
  }) {
3170
- const { theme: i } = A(), d = Math.min(100, Math.max(0, s * 100)), c = Z(e, i);
3203
+ const { theme: i } = M(), d = Math.min(100, Math.max(0, s * 100)), c = ee(e, i);
3171
3204
  return /* @__PURE__ */ l(
3172
3205
  "div",
3173
3206
  {
@@ -3210,8 +3243,8 @@ function Be({
3210
3243
  }
3211
3244
  );
3212
3245
  }
3213
- function Fe({ status: s, className: e, style: t }) {
3214
- const { t: n } = w(), { theme: o } = A(), r = Z(s, o), i = {
3246
+ function Re({ status: s, className: e, style: t }) {
3247
+ const { t: n } = w(), { theme: o } = M(), r = ee(s, o), i = {
3215
3248
  downloading: n("torrentUI.downloading", "Downloading"),
3216
3249
  seeding: n("torrentUI.seeding", "Seeding"),
3217
3250
  paused: n("torrentUI.paused", "Paused"),
@@ -3253,13 +3286,13 @@ function Fe({ status: s, className: e, style: t }) {
3253
3286
  }
3254
3287
  );
3255
3288
  }
3256
- function Re({
3289
+ function Pe({
3257
3290
  onTorrentSelect: s,
3258
3291
  onTorrentDoubleClick: e,
3259
3292
  className: t,
3260
3293
  style: n
3261
3294
  }) {
3262
- const { t: o } = w(), { theme: r, torrents: i, filter: d, searchQuery: c, selectedTorrent: g, setSelectedTorrent: u, config: h } = A(), [p, T] = D(h.defaultSortBy || "name"), [m, b] = D(h.defaultSortOrder || "asc"), C = h.columns || O, P = z(() => i.filter((x) => {
3295
+ const { t: o } = w(), { theme: r, torrents: i, filter: d, searchQuery: c, selectedTorrent: g, setSelectedTorrent: u, config: h } = M(), [p, D] = T(h.defaultSortBy || "name"), [m, b] = T(h.defaultSortOrder || "asc"), C = h.columns || G, U = W(() => i.filter((x) => {
3263
3296
  if (d !== "all") {
3264
3297
  if (d === "completed") {
3265
3298
  if (x.stats.progress < 1)
@@ -3271,42 +3304,42 @@ function Re({
3271
3304
  return !1;
3272
3305
  }
3273
3306
  if (c) {
3274
- const M = c.toLowerCase();
3275
- if (!x.metadata.name.toLowerCase().includes(M))
3307
+ const B = c.toLowerCase();
3308
+ if (!x.metadata.name.toLowerCase().includes(B))
3276
3309
  return !1;
3277
3310
  }
3278
3311
  return !0;
3279
- }), [i, d, c]), I = z(() => [...P].sort((x, M) => {
3280
- let B, F;
3312
+ }), [i, d, c]), I = W(() => [...U].sort((x, B) => {
3313
+ let F, R;
3281
3314
  switch (p) {
3282
3315
  case "name":
3283
- B = x.metadata.name.toLowerCase(), F = M.metadata.name.toLowerCase();
3316
+ F = x.metadata.name.toLowerCase(), R = B.metadata.name.toLowerCase();
3284
3317
  break;
3285
3318
  case "size":
3286
- B = x.metadata.size, F = M.metadata.size;
3319
+ F = x.metadata.size, R = B.metadata.size;
3287
3320
  break;
3288
3321
  case "progress":
3289
- B = x.stats.progress, F = M.stats.progress;
3322
+ F = x.stats.progress, R = B.stats.progress;
3290
3323
  break;
3291
3324
  case "status":
3292
- B = x.status, F = M.status;
3325
+ F = x.status, R = B.status;
3293
3326
  break;
3294
3327
  case "downloadSpeed":
3295
- B = x.stats.downloadSpeed, F = M.stats.downloadSpeed;
3328
+ F = x.stats.downloadSpeed, R = B.stats.downloadSpeed;
3296
3329
  break;
3297
3330
  case "uploadSpeed":
3298
- B = x.stats.uploadSpeed, F = M.stats.uploadSpeed;
3331
+ F = x.stats.uploadSpeed, R = B.stats.uploadSpeed;
3299
3332
  break;
3300
3333
  case "ratio":
3301
- B = x.stats.ratio, F = M.stats.ratio;
3334
+ F = x.stats.ratio, R = B.stats.ratio;
3302
3335
  break;
3303
3336
  default:
3304
- B = x.metadata.name, F = M.metadata.name;
3337
+ F = x.metadata.name, R = B.metadata.name;
3305
3338
  }
3306
- return B < F ? m === "asc" ? -1 : 1 : B > F ? m === "asc" ? 1 : -1 : 0;
3307
- }), [P, p, m]), U = (x) => {
3308
- p === x ? b(m === "asc" ? "desc" : "asc") : (T(x), b("asc"));
3309
- }, ee = (x) => {
3339
+ return F < R ? m === "asc" ? -1 : 1 : F > R ? m === "asc" ? 1 : -1 : 0;
3340
+ }), [U, p, m]), z = (x) => {
3341
+ p === x ? b(m === "asc" ? "desc" : "asc") : (D(x), b("asc"));
3342
+ }, te = (x) => {
3310
3343
  u(x), s == null || s(x);
3311
3344
  };
3312
3345
  return /* @__PURE__ */ l(
@@ -3336,7 +3369,10 @@ function Re({
3336
3369
  children: C.filter((x) => x.visible !== !1).map((x) => /* @__PURE__ */ l(
3337
3370
  "div",
3338
3371
  {
3339
- onClick: () => x.sortable && U(x.id),
3372
+ role: x.sortable ? "button" : void 0,
3373
+ tabIndex: x.sortable ? 0 : void 0,
3374
+ onKeyDown: x.sortable ? A : void 0,
3375
+ onClick: () => x.sortable && z(x.id),
3340
3376
  style: {
3341
3377
  cursor: x.sortable ? "pointer" : "default",
3342
3378
  display: "flex",
@@ -3344,8 +3380,8 @@ function Re({
3344
3380
  gap: r.spacing.xs
3345
3381
  },
3346
3382
  children: [
3347
- O.includes(x) ? o(`torrentUI.column.${x.id}`, x.label) : x.label,
3348
- p === x.id && (m === "asc" ? /* @__PURE__ */ a($, { size: 12 }) : /* @__PURE__ */ a(j, { size: 12 }))
3383
+ G.includes(x) ? o(`torrentUI.column.${x.id}`, x.label) : x.label,
3384
+ p === x.id && (m === "asc" ? /* @__PURE__ */ a(j, { size: 12 }) : /* @__PURE__ */ a(E, { size: 12 }))
3349
3385
  ]
3350
3386
  },
3351
3387
  x.id
@@ -3363,12 +3399,12 @@ function Re({
3363
3399
  children: o("torrentUI.noTorrentsFound", "No torrents found")
3364
3400
  }
3365
3401
  ) : I.map((x) => /* @__PURE__ */ a(
3366
- Pe,
3402
+ Ue,
3367
3403
  {
3368
3404
  torrent: x,
3369
3405
  columns: C,
3370
3406
  isSelected: g === x.metadata.infoHash,
3371
- onClick: () => ee(x.metadata.infoHash),
3407
+ onClick: () => te(x.metadata.infoHash),
3372
3408
  onDoubleClick: () => e == null ? void 0 : e(x.metadata.infoHash)
3373
3409
  },
3374
3410
  x.metadata.infoHash
@@ -3377,14 +3413,14 @@ function Re({
3377
3413
  }
3378
3414
  );
3379
3415
  }
3380
- function Pe({
3416
+ function Ue({
3381
3417
  torrent: s,
3382
3418
  columns: e,
3383
3419
  isSelected: t,
3384
3420
  onClick: n,
3385
3421
  onDoubleClick: o
3386
3422
  }) {
3387
- const { theme: r } = A(), { metadata: i, stats: d, status: c } = s, g = (u) => {
3423
+ const { theme: r } = M(), { metadata: i, stats: d, status: c } = s, g = (u) => {
3388
3424
  switch (u) {
3389
3425
  case "name":
3390
3426
  return /* @__PURE__ */ l("div", { style: { display: "flex", flexDirection: "column" }, children: [
@@ -3395,23 +3431,23 @@ function Pe({
3395
3431
  ] })
3396
3432
  ] });
3397
3433
  case "size":
3398
- return R(i.size);
3434
+ return P(i.size);
3399
3435
  case "progress":
3400
- return /* @__PURE__ */ a(Be, { progress: d.progress, status: c, height: "16px" });
3436
+ return /* @__PURE__ */ a(Fe, { progress: d.progress, status: c, height: "16px" });
3401
3437
  case "status":
3402
- return /* @__PURE__ */ a(Fe, { status: c });
3438
+ return /* @__PURE__ */ a(Re, { status: c });
3403
3439
  case "seeds":
3404
3440
  return d.seeds;
3405
3441
  case "peers":
3406
3442
  return d.peers;
3407
3443
  case "downloadSpeed":
3408
- return d.downloadSpeed > 0 ? H(d.downloadSpeed) : "-";
3444
+ return d.downloadSpeed > 0 ? $(d.downloadSpeed) : "-";
3409
3445
  case "uploadSpeed":
3410
- return d.uploadSpeed > 0 ? H(d.uploadSpeed) : "-";
3446
+ return d.uploadSpeed > 0 ? $(d.uploadSpeed) : "-";
3411
3447
  case "eta":
3412
- return c === "downloading" ? Ae(d.eta) : "-";
3448
+ return c === "downloading" ? Me(d.eta) : "-";
3413
3449
  case "ratio":
3414
- return J(d.ratio);
3450
+ return Z(d.ratio);
3415
3451
  default:
3416
3452
  return "-";
3417
3453
  }
@@ -3419,6 +3455,9 @@ function Pe({
3419
3455
  return /* @__PURE__ */ a(
3420
3456
  "div",
3421
3457
  {
3458
+ role: "button",
3459
+ tabIndex: 0,
3460
+ onKeyDown: A,
3422
3461
  onClick: n,
3423
3462
  onDoubleClick: o,
3424
3463
  style: {
@@ -3448,8 +3487,8 @@ function Pe({
3448
3487
  }
3449
3488
  );
3450
3489
  }
3451
- function Ue({ className: s, style: e }) {
3452
- const { t } = w(), { theme: n, filter: o, setFilter: r, searchQuery: i, setSearchQuery: d, torrents: c } = A(), g = z(() => {
3490
+ function ze({ className: s, style: e }) {
3491
+ const { t } = w(), { theme: n, filter: o, setFilter: r, searchQuery: i, setSearchQuery: d, torrents: c } = M(), g = W(() => {
3453
3492
  const h = {
3454
3493
  all: c.length,
3455
3494
  downloading: 0,
@@ -3523,7 +3562,6 @@ function Ue({ className: s, style: e }) {
3523
3562
  color: n.colors.text,
3524
3563
  border: `1px solid ${n.colors.border}`,
3525
3564
  borderRadius: n.borderRadius,
3526
- outline: "none",
3527
3565
  fontSize: "13px",
3528
3566
  width: "250px"
3529
3567
  }
@@ -3533,15 +3571,15 @@ function Ue({ className: s, style: e }) {
3533
3571
  }
3534
3572
  );
3535
3573
  }
3536
- function ze({
3574
+ function We({
3537
3575
  infoHash: s,
3538
3576
  className: e,
3539
3577
  style: t
3540
3578
  }) {
3541
- const { t: n } = w(), { theme: o, client: r } = A(), [i, d] = D("files"), c = r == null ? void 0 : r.getTorrent(s);
3579
+ const { t: n } = w(), { theme: o, client: r } = M(), [i, d] = T("files"), c = r == null ? void 0 : r.getTorrent(s);
3542
3580
  if (!c)
3543
3581
  return null;
3544
- const { metadata: g, stats: u, files: h, peers: p, trackers: T } = c, m = [
3582
+ const { metadata: g, stats: u, files: h, peers: p, trackers: D } = c, m = [
3545
3583
  {
3546
3584
  id: "files",
3547
3585
  label: n("torrentUI.files", "Files ({files})").replace("{files}", String(h.length))
@@ -3554,7 +3592,7 @@ function ze({
3554
3592
  id: "trackers",
3555
3593
  label: n("torrentUI.trackers", "Trackers ({trackers})").replace(
3556
3594
  "{trackers}",
3557
- String(T.length)
3595
+ String(D.length)
3558
3596
  )
3559
3597
  },
3560
3598
  { id: "info", label: n("torrentUI.info", "Info") }
@@ -3597,17 +3635,17 @@ function ze({
3597
3635
  }
3598
3636
  ),
3599
3637
  /* @__PURE__ */ l("div", { style: { padding: o.spacing.md, maxHeight: "300px", overflowY: "auto" }, children: [
3600
- i === "files" && /* @__PURE__ */ a(We, { files: h }),
3601
- i === "peers" && /* @__PURE__ */ a(Le, { peers: p }),
3602
- i === "trackers" && /* @__PURE__ */ a(Ne, { trackers: T }),
3603
- i === "info" && /* @__PURE__ */ a(He, { metadata: g, stats: u, addedAt: c.addedAt })
3638
+ i === "files" && /* @__PURE__ */ a(Le, { files: h }),
3639
+ i === "peers" && /* @__PURE__ */ a(Ne, { peers: p }),
3640
+ i === "trackers" && /* @__PURE__ */ a(He, { trackers: D }),
3641
+ i === "info" && /* @__PURE__ */ a($e, { metadata: g, stats: u, addedAt: c.addedAt })
3604
3642
  ] })
3605
3643
  ]
3606
3644
  }
3607
3645
  );
3608
3646
  }
3609
- function We({ files: s }) {
3610
- const { theme: e } = A();
3647
+ function Le({ files: s }) {
3648
+ const { theme: e } = M();
3611
3649
  return /* @__PURE__ */ a("div", { style: { display: "flex", flexDirection: "column", gap: e.spacing.xs }, children: s.map((t, n) => /* @__PURE__ */ l(
3612
3650
  "div",
3613
3651
  {
@@ -3622,7 +3660,7 @@ function We({ files: s }) {
3622
3660
  },
3623
3661
  children: [
3624
3662
  /* @__PURE__ */ a("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis" }, children: t.path }),
3625
- /* @__PURE__ */ a("span", { style: { color: e.colors.textSecondary }, children: R(t.size) }),
3663
+ /* @__PURE__ */ a("span", { style: { color: e.colors.textSecondary }, children: P(t.size) }),
3626
3664
  /* @__PURE__ */ l("span", { style: { width: "50px", textAlign: "right" }, children: [
3627
3665
  (t.progress * 100).toFixed(0),
3628
3666
  "%"
@@ -3632,8 +3670,8 @@ function We({ files: s }) {
3632
3670
  n
3633
3671
  )) });
3634
3672
  }
3635
- function Le({ peers: s }) {
3636
- const { t: e } = w(), { theme: t } = A();
3673
+ function Ne({ peers: s }) {
3674
+ const { t: e } = w(), { theme: t } = M();
3637
3675
  return /* @__PURE__ */ a("div", { style: { display: "flex", flexDirection: "column", gap: t.spacing.xs }, children: s.length === 0 ? /* @__PURE__ */ a("div", { style: { color: t.colors.textSecondary }, children: e("torrentUI.noPeersConnected", "No peers connected") }) : s.map((n) => /* @__PURE__ */ l(
3638
3676
  "div",
3639
3677
  {
@@ -3656,14 +3694,14 @@ function Le({ peers: s }) {
3656
3694
  ] }),
3657
3695
  /* @__PURE__ */ a("span", { style: { color: t.colors.textSecondary }, children: n.client || e("torrentUI.unknown", "Unknown") }),
3658
3696
  /* @__PURE__ */ l("span", { style: { color: t.colors.success }, children: [
3659
- /* @__PURE__ */ a(ae, { size: 12, style: { verticalAlign: "-1px" } }),
3697
+ /* @__PURE__ */ a(oe, { size: 12, style: { verticalAlign: "-1px" } }),
3660
3698
  " ",
3661
- H(n.downloadSpeed)
3699
+ $(n.downloadSpeed)
3662
3700
  ] }),
3663
3701
  /* @__PURE__ */ l("span", { style: { color: t.colors.warning }, children: [
3664
- /* @__PURE__ */ a(oe, { size: 12, style: { verticalAlign: "-1px" } }),
3702
+ /* @__PURE__ */ a(ie, { size: 12, style: { verticalAlign: "-1px" } }),
3665
3703
  " ",
3666
- H(n.uploadSpeed)
3704
+ $(n.uploadSpeed)
3667
3705
  ] }),
3668
3706
  /* @__PURE__ */ l("span", { children: [
3669
3707
  (n.progress * 100).toFixed(0),
@@ -3674,8 +3712,8 @@ function Le({ peers: s }) {
3674
3712
  n.id
3675
3713
  )) });
3676
3714
  }
3677
- function Ne({ trackers: s }) {
3678
- const { theme: e } = A();
3715
+ function He({ trackers: s }) {
3716
+ const { theme: e } = M();
3679
3717
  return /* @__PURE__ */ a("div", { style: { display: "flex", flexDirection: "column", gap: e.spacing.xs }, children: s.map((t, n) => /* @__PURE__ */ l(
3680
3718
  "div",
3681
3719
  {
@@ -3712,24 +3750,24 @@ function Ne({ trackers: s }) {
3712
3750
  n
3713
3751
  )) });
3714
3752
  }
3715
- function He({
3753
+ function $e({
3716
3754
  metadata: s,
3717
3755
  stats: e,
3718
3756
  addedAt: t
3719
3757
  }) {
3720
- const { t: n } = w(), { theme: o } = A(), r = [
3758
+ const { t: n } = w(), { theme: o } = M(), r = [
3721
3759
  { label: n("torrentUI.name", "Name"), value: s.name },
3722
3760
  { label: n("torrentUI.infoHash", "Info Hash"), value: s.infoHash },
3723
- { label: n("torrentUI.size", "Size"), value: R(s.size) },
3761
+ { label: n("torrentUI.size", "Size"), value: P(s.size) },
3724
3762
  {
3725
3763
  label: n("torrentUI.pieces", "Pieces"),
3726
3764
  value: `${e.piecesComplete} / ${e.piecesTotal}`
3727
3765
  },
3728
- { label: n("torrentUI.downloads", "Downloads"), value: R(e.downloaded) },
3729
- { label: n("torrentUI.uploaded", "Uploaded"), value: R(e.uploaded) },
3730
- { label: n("torrentUI.ratio", "Ratio"), value: J(e.ratio) },
3766
+ { label: n("torrentUI.downloads", "Downloads"), value: P(e.downloaded) },
3767
+ { label: n("torrentUI.uploaded", "Uploaded"), value: P(e.uploaded) },
3768
+ { label: n("torrentUI.ratio", "Ratio"), value: Z(e.ratio) },
3731
3769
  { label: n("torrentUI.availability", "Availability"), value: e.availability.toFixed(2) },
3732
- { label: n("torrentUI.wasted", "Wasted"), value: R(e.wastedBytes) },
3770
+ { label: n("torrentUI.wasted", "Wasted"), value: P(e.wastedBytes) },
3733
3771
  { label: n("torrentUI.hashFails", "Hash Fails"), value: e.hashFailures },
3734
3772
  { label: n("torrentUI.added", "Added"), value: t.toLocaleString() },
3735
3773
  { label: n("torrentUI.comment", "Comment"), value: s.comment || "-" },
@@ -3752,21 +3790,22 @@ function He({
3752
3790
  i.label
3753
3791
  )) });
3754
3792
  }
3755
- function $e({
3793
+ function je({
3756
3794
  isOpen: s,
3757
3795
  onClose: e,
3758
3796
  onAdd: t,
3759
3797
  className: n
3760
3798
  }) {
3761
- const { t: o } = w(), { theme: r, config: i, client: d } = A(), [c, g] = D(""), [u, h] = D(""), [p, T] = D(!1);
3799
+ const { t: o } = w(), { theme: r, config: i, client: d } = M(), [c, g] = T(""), [u, h] = T(""), [p, D] = T(!1);
3762
3800
  if (!s)
3763
3801
  return null;
3764
3802
  const m = (b) => {
3765
- b.preventDefault(), c.trim() && (t(c.trim(), { path: u || void 0, paused: p }), g(""), h(""), T(!1), e());
3803
+ b.preventDefault(), c.trim() && (t(c.trim(), { path: u || void 0, paused: p }), g(""), h(""), D(!1), e());
3766
3804
  };
3767
3805
  return /* @__PURE__ */ a(
3768
3806
  "div",
3769
3807
  {
3808
+ role: "presentation",
3770
3809
  className: n,
3771
3810
  style: {
3772
3811
  position: "fixed",
@@ -3781,6 +3820,7 @@ function $e({
3781
3820
  children: /* @__PURE__ */ l(
3782
3821
  "div",
3783
3822
  {
3823
+ role: "presentation",
3784
3824
  style: {
3785
3825
  backgroundColor: r.colors.surface,
3786
3826
  borderRadius: r.borderRadius,
@@ -3816,7 +3856,6 @@ function $e({
3816
3856
  color: r.colors.text,
3817
3857
  border: `1px solid ${r.colors.border}`,
3818
3858
  borderRadius: r.borderRadius,
3819
- outline: "none",
3820
3859
  fontSize: "13px"
3821
3860
  }
3822
3861
  }
@@ -3838,7 +3877,6 @@ function $e({
3838
3877
  color: r.colors.text,
3839
3878
  border: `1px solid ${r.colors.border}`,
3840
3879
  borderRadius: r.borderRadius,
3841
- outline: "none",
3842
3880
  fontSize: "13px"
3843
3881
  }
3844
3882
  }
@@ -3859,7 +3897,7 @@ function $e({
3859
3897
  {
3860
3898
  type: "checkbox",
3861
3899
  checked: p,
3862
- onChange: (b) => T(b.target.checked)
3900
+ onChange: (b) => D(b.target.checked)
3863
3901
  }
3864
3902
  ),
3865
3903
  o("torrentUI.startPaused", "Start paused")
@@ -3908,14 +3946,14 @@ function $e({
3908
3946
  }
3909
3947
  );
3910
3948
  }
3911
- function at({
3949
+ function ot({
3912
3950
  client: s,
3913
3951
  config: e,
3914
3952
  className: t,
3915
3953
  style: n
3916
3954
  }) {
3917
- const { t: o } = w(), [r, i] = D(!1), [d, c] = D(null);
3918
- return /* @__PURE__ */ a(Me, { client: s, config: e, children: /* @__PURE__ */ l(
3955
+ const { t: o } = w(), [r, i] = T(!1), [d, c] = T(null);
3956
+ return /* @__PURE__ */ a(Be, { client: s, config: e, children: /* @__PURE__ */ l(
3919
3957
  "div",
3920
3958
  {
3921
3959
  className: t,
@@ -3942,11 +3980,11 @@ function at({
3942
3980
  children: o("torrentUI.addTorrent2", "+ Add Torrent")
3943
3981
  }
3944
3982
  ) }),
3945
- /* @__PURE__ */ a(Ue, {}),
3946
- /* @__PURE__ */ a(Re, { onTorrentSelect: c, style: { flex: 1 } }),
3947
- d && /* @__PURE__ */ a(ze, { infoHash: d }),
3983
+ /* @__PURE__ */ a(ze, {}),
3984
+ /* @__PURE__ */ a(Pe, { onTorrentSelect: c, style: { flex: 1 } }),
3985
+ d && /* @__PURE__ */ a(We, { infoHash: d }),
3948
3986
  /* @__PURE__ */ a(
3949
- $e,
3987
+ je,
3950
3988
  {
3951
3989
  isOpen: r,
3952
3990
  onClose: () => i(!1),
@@ -3958,34 +3996,34 @@ function at({
3958
3996
  ) });
3959
3997
  }
3960
3998
  export {
3961
- $e as AddTorrentDialog,
3962
- Ue as FilterBar,
3963
- se as HealthService,
3964
- De as LifeDashboardService,
3965
- Qe as NiceHealth,
3966
- rt as NiceLifeDashboard,
3967
- Xe as NicePersonalFinance,
3968
- et as NiceTaskManager,
3969
- at as NiceTorrentUI,
3970
- fe as PersonalFinanceService,
3971
- Be as ProgressBar,
3972
- Fe as StatusBadge,
3973
- ke as TaskManagerService,
3974
- ze as TorrentDetails,
3975
- Re as TorrentList,
3976
- Me as TorrentUIProvider,
3999
+ je as AddTorrentDialog,
4000
+ ze as FilterBar,
4001
+ le as HealthService,
4002
+ Ie as LifeDashboardService,
4003
+ Ye as NiceHealth,
4004
+ at as NiceLifeDashboard,
4005
+ Je as NicePersonalFinance,
4006
+ tt as NiceTaskManager,
4007
+ ot as NiceTorrentUI,
4008
+ me as PersonalFinanceService,
4009
+ Fe as ProgressBar,
4010
+ Re as StatusBadge,
4011
+ Se as TaskManagerService,
4012
+ We as TorrentDetails,
4013
+ Pe as TorrentList,
4014
+ Be as TorrentUIProvider,
3977
4015
  qe as createHealthService,
3978
- tt as createLifeDashboardService,
3979
- Ye as createPersonalFinanceService,
3980
- Je as createTaskManagerService,
3981
- R as formatBytes,
3982
- Ae as formatETA,
3983
- J as formatRatio,
3984
- H as formatSpeed,
3985
- Z as getStatusColor,
3986
- Ke as useHealth,
3987
- nt as useLifeDashboard,
3988
- _e as usePersonalFinance,
3989
- Ze as useTaskManager,
3990
- A as useTorrentUI
4016
+ nt as createLifeDashboardService,
4017
+ _e as createPersonalFinanceService,
4018
+ Ze as createTaskManagerService,
4019
+ P as formatBytes,
4020
+ Me as formatETA,
4021
+ Z as formatRatio,
4022
+ $ as formatSpeed,
4023
+ ee as getStatusColor,
4024
+ Qe as useHealth,
4025
+ rt as useLifeDashboard,
4026
+ Xe as usePersonalFinance,
4027
+ et as useTaskManager,
4028
+ M as useTorrentUI
3991
4029
  };