ezux 1.1.11 → 1.1.13

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 (103) hide show
  1. package/dist/{EzContextMenu-C3eDRS7E.cjs → EzContextMenu-B6HBUjWv.cjs} +1 -1
  2. package/dist/{EzContextMenu-BsHdOgtL.js → EzContextMenu-BSA_B6Pr.js} +1 -1
  3. package/dist/{EzEventModal-FP2rs1pp.js → EzEventModal-BUMp_BFi.js} +6 -6
  4. package/dist/{EzEventModal-DkowH9rh.cjs → EzEventModal-xzHfzi0O.cjs} +1 -1
  5. package/dist/{EzGroupingPanel-DuKrZuqq.js → EzGroupingPanel-BUsIYDRi.js} +5 -5
  6. package/dist/EzGroupingPanel-D0HdSomF.cjs +1 -0
  7. package/dist/{EzSchedulerQuickAdd-s2jtG8vH.js → EzSchedulerQuickAdd-C653LTGh.js} +5 -5
  8. package/dist/{EzSchedulerQuickAdd-BLF22CDh.cjs → EzSchedulerQuickAdd-UnOWCpJd.cjs} +1 -1
  9. package/dist/{EzSchedulerToolbar-CaVVmnjt.cjs → EzSchedulerToolbar-C-5OdRY6.cjs} +1 -1
  10. package/dist/{EzSchedulerToolbar-tz6h80GC.js → EzSchedulerToolbar-CO5jjDQg.js} +15 -15
  11. package/dist/{EzSignature-CPoQLAyS.cjs → EzSignature-BaNesxwC.cjs} +1 -1
  12. package/dist/{EzSignature-D7134EQo.js → EzSignature-D4EYwo9W.js} +2 -2
  13. package/dist/{EzTableEditDialog-3eU6i9cv.js → EzTableEditDialog-Cd948V1C.js} +3 -3
  14. package/dist/{EzTableEditDialog-ftpeOKI_.cjs → EzTableEditDialog-NiOubaMT.cjs} +1 -1
  15. package/dist/{EzTableFooter-BiyI1m1O.cjs → EzTableFooter-CWjfGCjL.cjs} +1 -1
  16. package/dist/{EzTableFooter-DuAaOcLd.js → EzTableFooter-DveD12RC.js} +1 -1
  17. package/dist/{EzTableToolbar-DmAb94U-.js → EzTableToolbar-Bz8UWv6j.js} +50 -54
  18. package/dist/EzTableToolbar-DHE7Bb1R.cjs +1 -0
  19. package/dist/{HighlightText-C0sUEoCH.js → HighlightText-8D6KEyBw.js} +9 -11
  20. package/dist/HighlightText-LtZmzCle.cjs +1 -0
  21. package/dist/{NotificationPanel-xjIHKnlE.js → NotificationPanel-D2Y-_ahk.js} +3 -3
  22. package/dist/NotificationPanel-zLxrtTGf.cjs +1 -0
  23. package/dist/{TooltipWrapper-Bv7F-Gk4.js → TooltipWrapper-BrRTi5EJ.js} +1 -1
  24. package/dist/{TooltipWrapper-CgYlx0Jq.cjs → TooltipWrapper-DWts4bAI.cjs} +1 -1
  25. package/dist/{avatar-BkA_3sri.js → avatar-BeK0E4mn.js} +1 -1
  26. package/dist/{avatar-CJH7L2Or.cjs → avatar-DZAaTK2f.cjs} +1 -1
  27. package/dist/bell-DAz8P0BR.js +14 -0
  28. package/dist/bell-DOX2y38e.cjs +1 -0
  29. package/dist/{calendar-ChRJyGvt.cjs → calendar-BMZ8ddOf.cjs} +1 -1
  30. package/dist/{calendar-CCxXqG5a.js → calendar-Dy3rVMW2.js} +4 -4
  31. package/dist/{checkbox-_Uxyw6xN.cjs → checkbox-B0lGHUyy.cjs} +1 -1
  32. package/dist/{checkbox-DTLp-Oqj.js → checkbox-boJRxICT.js} +1 -1
  33. package/dist/circle-x-Cv7bfIC_.js +9 -0
  34. package/dist/circle-x-DwVXxhXr.cjs +1 -0
  35. package/dist/{date-time-picker-BPwpIWxg.cjs → date-time-picker-DTxHdPgQ.cjs} +1 -1
  36. package/dist/{date-time-picker-B9QBboUX.js → date-time-picker-Dj2eftJI.js} +6 -6
  37. package/dist/ezux.css +1 -1
  38. package/dist/grip-vertical-CSyDKBul.js +12 -0
  39. package/dist/grip-vertical-DZNBW1Dn.cjs +1 -0
  40. package/dist/{index-BmjgUrNF.cjs → index-B3ipEEhH.cjs} +2 -2
  41. package/dist/index-BPPb7bcs.js +3220 -0
  42. package/dist/{index-pr_yrvsV.js → index-BQKw_Vho.js} +4026 -1904
  43. package/dist/{index-B7foCkRR.js → index-C5STgBSy.js} +678 -677
  44. package/dist/{index-CpEN0z3t.js → index-C6NfgycP.js} +357 -357
  45. package/dist/index-D4f2ZdrG.cjs +2 -0
  46. package/dist/index-DUY1SqMo.cjs +1 -0
  47. package/dist/index-c1Zg--dt.cjs +7 -0
  48. package/dist/index.cjs +2 -2
  49. package/dist/index.d.ts +67 -14
  50. package/dist/index.es.js +136 -135
  51. package/dist/{input-D1zXv4Kl.cjs → input-BgM_la4k.cjs} +1 -1
  52. package/dist/{input-DG8ycH6m.js → input-jYQ5VKNR.js} +1 -1
  53. package/dist/{isBefore-DdLSsf0_.js → isBefore-C3Y_wbk3.js} +1 -1
  54. package/dist/{isBefore-BAixcVtb.cjs → isBefore-Cp1ttk6q.cjs} +1 -1
  55. package/dist/kanban.cjs +1 -1
  56. package/dist/kanban.es.js +4 -4
  57. package/dist/{label-Ch1wkGGP.js → label-ClOW9UCt.js} +2 -2
  58. package/dist/{label-DrUloKDN.cjs → label-Dx6oDB-X.cjs} +1 -1
  59. package/dist/layout.cjs +1 -1
  60. package/dist/layout.d.ts +29 -1
  61. package/dist/layout.es.js +3 -3
  62. package/dist/{popover-4Ng-GmwM.cjs → popover-BJq1CKmi.cjs} +1 -1
  63. package/dist/{popover-DstiJFa3.js → popover-Cmlb7w3R.js} +1 -1
  64. package/dist/scheduler.cjs +1 -1
  65. package/dist/scheduler.es.js +5 -5
  66. package/dist/{scroll-area-mGPAChYm.js → scroll-area-9fwpVNxT.js} +1 -1
  67. package/dist/{scroll-area-B_yufXtG.cjs → scroll-area-CwwZSSA4.cjs} +1 -1
  68. package/dist/select-GxA46anr.cjs +1 -0
  69. package/dist/select-mDCun_IR.js +35 -0
  70. package/dist/{settings-HCrwja-A.js → settings-CvyjK75A.js} +14 -14
  71. package/dist/settings-DKPknrt8.cjs +1 -0
  72. package/dist/signature.cjs +1 -1
  73. package/dist/signature.es.js +1 -1
  74. package/dist/{sortable.esm-DDmDbyCC.cjs → sortable.esm-CsRPuXyD.cjs} +1 -1
  75. package/dist/{sortable.esm-eBjUK76c.js → sortable.esm-CzMCDPet.js} +1 -1
  76. package/dist/table.cjs +1 -1
  77. package/dist/table.d.ts +18 -0
  78. package/dist/table.es.js +10 -9
  79. package/dist/theme-vars.css +2 -2
  80. package/dist/{tooltip-CDLAzCi8.cjs → tooltip-B41iztKT.cjs} +1 -1
  81. package/dist/{tooltip-C216fkmP.js → tooltip-BCtrEe0z.js} +1 -1
  82. package/dist/treeview.cjs +1 -2
  83. package/dist/treeview.es.js +558 -543
  84. package/dist/{useInitCoreServices-DSudhSFo.cjs → useInitCoreServices-CwXv2p4S.cjs} +1 -1
  85. package/dist/{useInitCoreServices-BC7QMeLn.js → useInitCoreServices-D1WaWlaI.js} +4 -3
  86. package/dist/{useService-DBnjCLOu.cjs → useService-8OoezWr8.cjs} +1 -1
  87. package/dist/{useService-BKWyN7jJ.js → useService-BUi3uAqE.js} +1 -1
  88. package/dist/{useServiceState-MlrHzngO.cjs → useServiceState-BjpCjUn2.cjs} +1 -1
  89. package/dist/{useServiceState-DWb3cncq.js → useServiceState-VE-viK8b.js} +1 -1
  90. package/package.json +21 -20
  91. package/dist/EzGroupingPanel-Dw4bbefz.cjs +0 -1
  92. package/dist/EzTableToolbar-qlNVxvsL.cjs +0 -1
  93. package/dist/HighlightText-BDclEh_K.cjs +0 -1
  94. package/dist/NotificationPanel-juBrjjOY.cjs +0 -1
  95. package/dist/index-BKsqtcvu.cjs +0 -2
  96. package/dist/index-D2HX-sbl.js +0 -3092
  97. package/dist/index-DEIRrhVY.cjs +0 -1
  98. package/dist/index-DGhcUfqi.cjs +0 -7
  99. package/dist/info-BY2cfl1l.cjs +0 -1
  100. package/dist/info-BuURqzhx.js +0 -14
  101. package/dist/select-BxcAKVaB.cjs +0 -1
  102. package/dist/select-BxiFqo8j.js +0 -35
  103. package/dist/settings-BuS8Pqjb.cjs +0 -1
@@ -0,0 +1,3220 @@
1
+ import { jsx as e, jsxs as d, Fragment as Nt } from "react/jsx-runtime";
2
+ import * as te from "react";
3
+ import xe, { useMemo as ce, useRef as ze, useEffect as Ne, useCallback as L, useState as q, memo as it, forwardRef as rt, useImperativeHandle as bt } from "react";
4
+ import { u as Qe, a as se, T as St, Q as kt, b as Dt } from "./TooltipWrapper-BrRTi5EJ.js";
5
+ import { c as J, T as ot, z as It, C as Ee, N as At } from "./EzErrorBoundary-D4NBadES.js";
6
+ import { B as $, a as Ft, X as Ue } from "./tooltip-BCtrEe0z.js";
7
+ import { N as qe } from "./NotificationPanel-D2Y-_ahk.js";
8
+ import { useStore as pe } from "@tanstack/react-store";
9
+ import { Store as _t } from "@tanstack/store";
10
+ import { l as Tt, u as Se, c as P, b as Bt } from "./useInitCoreServices-D1WaWlaI.js";
11
+ import { u as Mt } from "./useServiceState-VE-viK8b.js";
12
+ import { I as Et, M as lt, C as Ae, G as Ve, f as He, h as We, x as Vt, E as $t } from "./index-C6NfgycP.js";
13
+ import { I as fe } from "./input-jYQ5VKNR.js";
14
+ import { e as zt, S as Fe, a as _e, b as Te, c as Be, d as oe } from "./select-mDCun_IR.js";
15
+ import { P as Rt, a as Kt, b as Pt, D as Lt, c as Qt, d as jt, e as Ot } from "./popover-Cmlb7w3R.js";
16
+ import { F as Ut, C as Ce, P as be } from "./checkbox-boJRxICT.js";
17
+ import { L as le } from "./label-ClOW9UCt.js";
18
+ import { S as qt } from "./scroll-area-9fwpVNxT.js";
19
+ import { L as Ht } from "./layers-BA4i1fYX.js";
20
+ import { D as Je } from "./download-panVHmk6.js";
21
+ import { useForm as Wt } from "@tanstack/react-form";
22
+ import { D as $e, P as dt } from "./date-time-picker-Dj2eftJI.js";
23
+ import { A as Re, a as Ke, b as Jt } from "./avatar-BeK0E4mn.js";
24
+ import { T as ct } from "./calendar-Dy3rVMW2.js";
25
+ import { C as mt, c as Gt, k as Yt, l as Xt, P as Zt, D as ea, J as ta } from "./EzContextMenu-BSA_B6Pr.js";
26
+ import { u as ut, S as Pe, v as aa, h as na } from "./sortable.esm-CzMCDPet.js";
27
+ import { S as sa, G as Ge } from "./settings-CvyjK75A.js";
28
+ import { C as Ie } from "./circle-x-Cv7bfIC_.js";
29
+ import { C as ia } from "./circle-alert-B2AMDd8N.js";
30
+ import { C as ra } from "./isBefore-C3Y_wbk3.js";
31
+ import { useVirtualizer as oa } from "@tanstack/react-virtual";
32
+ import { E as Ye } from "./ellipsis-CuqNthAj.js";
33
+ import { C as ht } from "./chevron-down-C3s8jU6B.js";
34
+ const la = [
35
+ [
36
+ "path",
37
+ {
38
+ d: "M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",
39
+ key: "169zse"
40
+ }
41
+ ]
42
+ ], da = J("activity", la);
43
+ const ca = [
44
+ ["rect", { width: "20", height: "5", x: "2", y: "3", rx: "1", key: "1wp1u1" }],
45
+ ["path", { d: "M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8", key: "1s80jp" }],
46
+ ["path", { d: "M10 12h4", key: "a56b0p" }]
47
+ ], ma = J("archive", ca);
48
+ const ua = [
49
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
50
+ ["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
51
+ ], ge = J("circle-check", ua);
52
+ const ha = [
53
+ [
54
+ "path",
55
+ {
56
+ d: "M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",
57
+ key: "kmsa83"
58
+ }
59
+ ],
60
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]
61
+ ], pa = J("circle-play", ha);
62
+ const ga = [
63
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
64
+ ["path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3", key: "1u773s" }],
65
+ ["path", { d: "M12 17h.01", key: "p32p05" }]
66
+ ], Xe = J("circle-question-mark", ga);
67
+ const fa = [
68
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
69
+ ["rect", { x: "9", y: "9", width: "6", height: "6", rx: "1", key: "1ssd4o" }]
70
+ ], va = J("circle-stop", fa);
71
+ const ya = [
72
+ [
73
+ "path",
74
+ {
75
+ d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
76
+ key: "1oefj6"
77
+ }
78
+ ],
79
+ ["path", { d: "M14 2v5a1 1 0 0 0 1 1h5", key: "wfsgrz" }],
80
+ ["path", { d: "M10 9H8", key: "b1mrlr" }],
81
+ ["path", { d: "M16 13H8", key: "t4e002" }],
82
+ ["path", { d: "M16 17H8", key: "z1uh3a" }]
83
+ ], Ze = J("file-text", ya);
84
+ const Ca = [
85
+ ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2", key: "1m3agn" }],
86
+ ["circle", { cx: "9", cy: "9", r: "2", key: "af1f0g" }],
87
+ ["path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21", key: "1xmnt7" }]
88
+ ], wa = J("image", Ca);
89
+ const xa = [
90
+ ["path", { d: "M3 5h.01", key: "18ugdj" }],
91
+ ["path", { d: "M3 12h.01", key: "nlz23k" }],
92
+ ["path", { d: "M3 19h.01", key: "noohij" }],
93
+ ["path", { d: "M8 5h13", key: "1pao27" }],
94
+ ["path", { d: "M8 12h13", key: "1za7za" }],
95
+ ["path", { d: "M8 19h13", key: "m83p4d" }]
96
+ ], Na = J("list", xa);
97
+ const ba = [
98
+ ["rect", { width: "18", height: "11", x: "3", y: "11", rx: "2", ry: "2", key: "1w4ew1" }],
99
+ ["path", { d: "M7 11V7a5 5 0 0 1 9.9-1", key: "1mm8w8" }]
100
+ ], Sa = J("lock-open", ba);
101
+ const ka = [
102
+ ["rect", { width: "18", height: "11", x: "3", y: "11", rx: "2", ry: "2", key: "1w4ew1" }],
103
+ ["path", { d: "M7 11V7a5 5 0 0 1 10 0v4", key: "fwvmzm" }]
104
+ ], et = J("lock", ka);
105
+ const Da = [
106
+ [
107
+ "path",
108
+ {
109
+ d: "M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",
110
+ key: "18887p"
111
+ }
112
+ ]
113
+ ], Ia = J("message-square", Da);
114
+ const Aa = [
115
+ ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
116
+ ["path", { d: "M3 9h18", key: "1pudct" }],
117
+ ["path", { d: "M9 21V9", key: "1oto5p" }]
118
+ ], tt = J("panels-top-left", Aa);
119
+ const Fa = [
120
+ [
121
+ "path",
122
+ {
123
+ d: "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",
124
+ key: "1a8usu"
125
+ }
126
+ ]
127
+ ], _a = J("pen", Fa);
128
+ const Ta = [
129
+ ["path", { d: "m15 14 5-5-5-5", key: "12vg1m" }],
130
+ ["path", { d: "M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13", key: "6uklza" }]
131
+ ], Ba = J("redo-2", Ta);
132
+ const Ma = [
133
+ ["path", { d: "M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "14sxne" }],
134
+ ["path", { d: "M3 3v5h5", key: "1xhq8a" }],
135
+ ["path", { d: "M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16", key: "1hlbsb" }],
136
+ ["path", { d: "M16 16h5v5", key: "ccwih5" }]
137
+ ], Ea = J("refresh-ccw", Ma);
138
+ const Va = [
139
+ [
140
+ "path",
141
+ {
142
+ d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",
143
+ key: "oel41y"
144
+ }
145
+ ],
146
+ ["path", { d: "M12 8v4", key: "1got3b" }],
147
+ ["path", { d: "M12 16h.01", key: "1drbdi" }]
148
+ ], $a = J("shield-alert", Va);
149
+ const za = [
150
+ [
151
+ "path",
152
+ { d: "M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344", key: "2acyp4" }
153
+ ],
154
+ ["path", { d: "m9 11 3 3L22 4", key: "1pflzl" }]
155
+ ], Ra = J("square-check-big", za);
156
+ const Ka = [
157
+ ["path", { d: "M9 14 4 9l5-5", key: "102s5s" }],
158
+ ["path", { d: "M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11", key: "f3b9sd" }]
159
+ ], Pa = J("undo-2", Ka);
160
+ const La = [
161
+ ["path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2", key: "1yyitq" }],
162
+ ["path", { d: "M16 3.128a4 4 0 0 1 0 7.744", key: "16gr8j" }],
163
+ ["path", { d: "M22 21v-2a4 4 0 0 0-3-3.87", key: "kshegd" }],
164
+ ["circle", { cx: "9", cy: "7", r: "4", key: "nufk8" }]
165
+ ], Qa = J("users", La), we = () => Tt(), ja = () => /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center h-full p-8", children: /* @__PURE__ */ d("div", { className: "flex flex-col items-center gap-4 max-w-md", children: [
166
+ /* @__PURE__ */ e("div", { className: "flex items-center justify-center w-16 h-16 rounded-full bg-destructive/10", children: /* @__PURE__ */ e(ot, { className: "w-8 h-8 text-destructive" }) }),
167
+ /* @__PURE__ */ d("div", { className: "flex flex-col items-center gap-2 text-center", children: [
168
+ /* @__PURE__ */ e("h2", { className: "text-lg font-semibold", children: "Kanban Board Error" }),
169
+ /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: "An error occurred while rendering the Kanban board. Please refresh the page or contact support if the issue persists." })
170
+ ] }),
171
+ /* @__PURE__ */ e($, { onClick: () => window.location.reload(), children: "Reload Board" })
172
+ ] }) }), Oa = (t, a = "standard") => new _t({
173
+ board: t,
174
+ selectedCards: [],
175
+ selectedColumnId: null,
176
+ view: a,
177
+ searchQuery: "",
178
+ activeFilters: {},
179
+ history: [t],
180
+ historyIndex: 0
181
+ }), Ua = (t) => ({
182
+ // Board actions
183
+ setBoard: (a) => {
184
+ t.setState((s) => {
185
+ const i = [...s.history.slice(0, s.historyIndex + 1), a];
186
+ return {
187
+ ...s,
188
+ board: a,
189
+ history: i,
190
+ historyIndex: i.length - 1
191
+ };
192
+ });
193
+ },
194
+ // Card actions
195
+ addCard: (a) => {
196
+ t.setState((s) => {
197
+ const i = {
198
+ ...s.board,
199
+ cards: [...s.board.cards, a]
200
+ }, c = [...s.history.slice(0, s.historyIndex + 1), i];
201
+ return {
202
+ ...s,
203
+ board: i,
204
+ history: c,
205
+ historyIndex: c.length - 1
206
+ };
207
+ });
208
+ },
209
+ updateCard: (a, s) => {
210
+ t.setState((i) => {
211
+ const c = {
212
+ ...i.board,
213
+ cards: i.board.cards.map(
214
+ (C) => C.id === a ? { ...C, ...s } : C
215
+ )
216
+ }, m = [...i.history.slice(0, i.historyIndex + 1), c];
217
+ return {
218
+ ...i,
219
+ board: c,
220
+ history: m,
221
+ historyIndex: m.length - 1
222
+ };
223
+ });
224
+ },
225
+ deleteCard: (a) => {
226
+ t.setState((s) => {
227
+ const i = {
228
+ ...s.board,
229
+ cards: s.board.cards.filter((m) => m.id !== a)
230
+ }, c = [...s.history.slice(0, s.historyIndex + 1), i];
231
+ return {
232
+ ...s,
233
+ board: i,
234
+ history: c,
235
+ historyIndex: c.length - 1
236
+ };
237
+ });
238
+ },
239
+ moveCard: (a, s) => {
240
+ t.setState((i) => {
241
+ const c = {
242
+ ...i.board,
243
+ cards: i.board.cards.map(
244
+ (C) => C.id === a ? { ...C, columnId: s } : C
245
+ )
246
+ }, m = [...i.history.slice(0, i.historyIndex + 1), c];
247
+ return {
248
+ ...i,
249
+ board: c,
250
+ history: m,
251
+ historyIndex: m.length - 1
252
+ };
253
+ });
254
+ },
255
+ // Column actions
256
+ addColumn: (a) => {
257
+ t.setState((s) => {
258
+ const i = {
259
+ ...s.board,
260
+ columns: [...s.board.columns, a]
261
+ }, c = [...s.history.slice(0, s.historyIndex + 1), i];
262
+ return {
263
+ ...s,
264
+ board: i,
265
+ history: c,
266
+ historyIndex: c.length - 1
267
+ };
268
+ });
269
+ },
270
+ updateColumn: (a, s) => {
271
+ t.setState((i) => {
272
+ const c = {
273
+ ...i.board,
274
+ columns: i.board.columns.map(
275
+ (C) => C.id === a ? { ...C, ...s } : C
276
+ )
277
+ }, m = [...i.history.slice(0, i.historyIndex + 1), c];
278
+ return {
279
+ ...i,
280
+ board: c,
281
+ history: m,
282
+ historyIndex: m.length - 1
283
+ };
284
+ });
285
+ },
286
+ deleteColumn: (a) => {
287
+ t.setState((s) => {
288
+ const i = {
289
+ ...s.board,
290
+ columns: s.board.columns.filter((m) => m.id !== a),
291
+ cards: s.board.cards.filter((m) => m.columnId !== a)
292
+ }, c = [...s.history.slice(0, s.historyIndex + 1), i];
293
+ return {
294
+ ...s,
295
+ board: i,
296
+ history: c,
297
+ historyIndex: c.length - 1
298
+ };
299
+ });
300
+ },
301
+ // Selection actions
302
+ setSelectedCards: (a) => {
303
+ t.setState((s) => ({ ...s, selectedCards: a }));
304
+ },
305
+ setSelectedColumnId: (a) => {
306
+ t.setState((s) => ({ ...s, selectedColumnId: a }));
307
+ },
308
+ // View action
309
+ setView: (a) => {
310
+ t.setState((s) => ({ ...s, view: a }));
311
+ },
312
+ // Search and filter actions
313
+ setSearchQuery: (a) => {
314
+ t.setState((s) => ({ ...s, searchQuery: a }));
315
+ },
316
+ setActiveFilters: (a) => {
317
+ t.setState((s) => ({ ...s, activeFilters: a }));
318
+ },
319
+ // History actions (undo/redo)
320
+ undo: () => {
321
+ t.setState((a) => a.historyIndex > 0 ? {
322
+ ...a,
323
+ board: a.history[a.historyIndex - 1],
324
+ historyIndex: a.historyIndex - 1
325
+ } : a);
326
+ },
327
+ redo: () => {
328
+ t.setState((a) => a.historyIndex < a.history.length - 1 ? {
329
+ ...a,
330
+ board: a.history[a.historyIndex + 1],
331
+ historyIndex: a.historyIndex + 1
332
+ } : a);
333
+ },
334
+ // Utility
335
+ canUndo: () => t.state.historyIndex > 0,
336
+ canRedo: () => t.state.historyIndex < t.state.history.length - 1
337
+ }), qa = (t) => {
338
+ const a = ce(() => Oa(t.board, t.view), [t.board.id, t.view]), s = ce(() => Ua(a), [a]), i = pe(a, (y) => y.board), c = pe(a, (y) => y.selectedCards), m = pe(a, (y) => y.selectedColumnId), C = pe(a, (y) => y.view), h = pe(a, (y) => y.searchQuery), f = pe(a, (y) => y.activeFilters), k = ze(JSON.stringify(t.board)), x = ze(t.view);
339
+ return Ne(() => {
340
+ const y = JSON.stringify(t.board);
341
+ y !== k.current && (k.current = y, s.setBoard(t.board)), t.view && t.view !== x.current && (x.current = t.view, s.setView(t.view));
342
+ }, [t.board, t.view, s]), {
343
+ // State
344
+ /** The current board data. @group State */
345
+ board: i,
346
+ /** Currently selected card IDs. @group State */
347
+ selectedCards: c,
348
+ /** ID of the currently selected column. @group State */
349
+ selectedColumnId: m,
350
+ /** Current view mode. @group State */
351
+ view: C,
352
+ /** Current search query. @group State */
353
+ searchQuery: h,
354
+ /** Currently active filters. @group State */
355
+ activeFilters: f,
356
+ // Actions
357
+ /** Replace the board data. @group Methods */
358
+ setBoard: s.setBoard,
359
+ /** Set selected card IDs. @group Methods */
360
+ setSelectedCards: s.setSelectedCards,
361
+ /** Set the selected column ID. @group Methods */
362
+ setSelectedColumnId: s.setSelectedColumnId,
363
+ /** Change the view mode. @group Methods */
364
+ setView: s.setView,
365
+ /** Set the search query. @group Methods */
366
+ setSearchQuery: s.setSearchQuery,
367
+ /** Set active filters. @group Methods */
368
+ setActiveFilters: s.setActiveFilters,
369
+ // Card actions
370
+ /** Add a card. @group Methods */
371
+ addCard: s.addCard,
372
+ /** Update a card. @group Methods */
373
+ updateCard: s.updateCard,
374
+ /** Delete a card. @group Methods */
375
+ deleteCard: s.deleteCard,
376
+ /** Move a card. @group Methods */
377
+ moveCard: s.moveCard,
378
+ // Column actions
379
+ /** Add a column. @group Methods */
380
+ addColumn: s.addColumn,
381
+ /** Update a column. @group Methods */
382
+ updateColumn: s.updateColumn,
383
+ /** Delete a column. @group Methods */
384
+ deleteColumn: s.deleteColumn,
385
+ // History actions
386
+ /** Undo the last action. @group Methods */
387
+ undo: s.undo,
388
+ /** Redo the previously undone action. @group Methods */
389
+ redo: s.redo,
390
+ /** Whether undo is available. @group State */
391
+ canUndo: s.canUndo(),
392
+ /** Whether redo is available. @group State */
393
+ canRedo: s.canRedo(),
394
+ // Store instance (for advanced usage)
395
+ /** The underlying store instance. @group Internal */
396
+ store: a,
397
+ /** The compiled actions for the store. @group Internal */
398
+ actions: s
399
+ };
400
+ }, Ha = (t, a) => {
401
+ const s = Se(), i = Qe(), c = () => s.get("KanbanService"), m = (n, o, u = 3e3) => {
402
+ const v = s.get("NotificationService");
403
+ v && v.add({ type: n, message: o, duration: u });
404
+ }, C = (n) => {
405
+ i.setQueryData(["board", a.id], n), t.onBoardChange?.(n);
406
+ }, h = se({
407
+ mutationFn: async (n) => {
408
+ const o = c();
409
+ return o ? await o.createCard(a.id, n) : await t.onCardCreate?.(n), n;
410
+ },
411
+ onMutate: async (n) => {
412
+ await i.cancelQueries({ queryKey: ["board", a.id] });
413
+ const o = i.getQueryData(["board", a.id]), u = {
414
+ ...a,
415
+ cards: [...a.cards, n]
416
+ };
417
+ return C(u), { previousBoard: o };
418
+ },
419
+ onError: (n, o, u) => {
420
+ u?.previousBoard && C(u.previousBoard), m("error", "Failed to create card. Please try again.", 5e3);
421
+ },
422
+ onSuccess: (n) => {
423
+ m("success", `Card "${n.title}" created successfully`);
424
+ }
425
+ }), f = L(async (n) => {
426
+ const o = {
427
+ id: `card-${Date.now()}`,
428
+ type: n.type || "standard",
429
+ title: n.title || "New Card",
430
+ description: n.description,
431
+ columnId: n.columnId || a.columns[0]?.id || "",
432
+ position: n.position ?? a.cards.filter((u) => u.columnId === n.columnId).length,
433
+ assignees: n.assignees || [],
434
+ tags: n.tags || [],
435
+ priority: n.priority,
436
+ metadata: n.metadata || {},
437
+ createdBy: "current-user",
438
+ // Should be replced by actual user info if available
439
+ createdAt: /* @__PURE__ */ new Date(),
440
+ updatedBy: "current-user",
441
+ updatedAt: /* @__PURE__ */ new Date(),
442
+ ...n
443
+ };
444
+ return h.mutateAsync(o);
445
+ }, [a, h]), k = se({
446
+ mutationFn: async ({ cardId: n, updates: o }) => {
447
+ const u = c();
448
+ if (u)
449
+ await u.updateCard(n, o);
450
+ else {
451
+ const v = a.cards.find((I) => I.id === n);
452
+ v && await t.onCardUpdate?.({ ...v, ...o }, "edit");
453
+ }
454
+ return { cardId: n, updates: o };
455
+ },
456
+ onMutate: async ({ cardId: n, updates: o }) => {
457
+ await i.cancelQueries({ queryKey: ["board", a.id] });
458
+ const u = i.getQueryData(["board", a.id]), v = a.cards.map(
459
+ (M) => M.id === n ? { ...M, ...o, updatedAt: /* @__PURE__ */ new Date() } : M
460
+ ), I = { ...a, cards: v };
461
+ return C(I), { previousBoard: u };
462
+ },
463
+ onError: (n, o, u) => {
464
+ u?.previousBoard && C(u.previousBoard), m("error", "Failed to update card", 5e3);
465
+ },
466
+ onSuccess: () => {
467
+ m("success", "Card updated successfully", 2e3);
468
+ }
469
+ }), x = L(async (n, o) => k.mutateAsync({ cardId: n, updates: o }), [k]), y = se({
470
+ mutationFn: async (n) => {
471
+ const o = c();
472
+ return o ? await o.deleteCard(n) : await t.onCardDelete?.(n), n;
473
+ },
474
+ onMutate: async (n) => {
475
+ await i.cancelQueries({ queryKey: ["board", a.id] });
476
+ const o = i.getQueryData(["board", a.id]), u = {
477
+ ...a,
478
+ cards: a.cards.filter((v) => v.id !== n)
479
+ };
480
+ return C(u), { previousBoard: o, deletedCardTitle: o?.cards.find((v) => v.id === n)?.title };
481
+ },
482
+ onError: (n, o, u) => {
483
+ u?.previousBoard && C(u.previousBoard), m("error", "Failed to delete card", 5e3);
484
+ },
485
+ onSuccess: (n, o, u) => {
486
+ const v = u?.deletedCardTitle || "Card";
487
+ m("success", `Card "${v}" deleted`);
488
+ }
489
+ }), A = L(async (n) => y.mutateAsync(n), [y]), l = se({
490
+ mutationFn: async (n) => {
491
+ const { cardId: o, targetColumnId: u, targetSwimlaneId: v, targetPosition: I } = n, M = c();
492
+ if (M)
493
+ await M.moveCard(o, u, v, I);
494
+ else {
495
+ const B = a.cards.find((T) => T.id === o);
496
+ B && await t.onCardUpdate?.({
497
+ ...B,
498
+ columnId: u,
499
+ swimlaneId: v
500
+ }, "move");
501
+ }
502
+ },
503
+ onMutate: async ({ cardId: n, targetColumnId: o, targetSwimlaneId: u, targetPosition: v }) => {
504
+ await i.cancelQueries({ queryKey: ["board", a.id] });
505
+ const I = i.getQueryData(["board", a.id]), M = a.cards.find((b) => b.id === n);
506
+ if (!M) return { previousBoard: I };
507
+ const B = a.cards.filter((b) => b.id !== n), T = B.filter((b) => b.columnId === o).sort((b, F) => (b.position ?? 0) - (F.position ?? 0)), S = v !== void 0 ? Math.min(v, T.length) : T.length, E = [
508
+ ...T.slice(0, S),
509
+ { ...M, columnId: o, swimlaneId: u, updatedAt: /* @__PURE__ */ new Date() },
510
+ ...T.slice(S)
511
+ ].map((b, F) => ({ ...b, position: F })), U = M.columnId, W = B.filter((b) => b.columnId === U).sort((b, F) => (b.position ?? 0) - (F.position ?? 0)).map((b, F) => ({ ...b, position: F })), V = [...B.filter(
512
+ (b) => b.columnId !== o && b.columnId !== U
513
+ ), ...W, ...E], H = { ...a, cards: V };
514
+ return C(H), { previousBoard: I };
515
+ },
516
+ onError: (n, o, u) => {
517
+ u?.previousBoard && C(u.previousBoard), m("error", "Failed to move card", 3e3);
518
+ }
519
+ }), w = L(async (n, o, u, v) => l.mutateAsync({ cardId: n, targetColumnId: o, targetSwimlaneId: u, targetPosition: v }), [l]), N = L(async (n) => {
520
+ const o = a.cards.find((v) => v.id === n);
521
+ if (!o) throw new Error("Card not found");
522
+ const u = {
523
+ ...o,
524
+ id: `card-${Date.now()}`,
525
+ title: `${o.title} (Copy)`,
526
+ position: (o.position ?? 0) + 1,
527
+ createdAt: /* @__PURE__ */ new Date(),
528
+ updatedAt: /* @__PURE__ */ new Date()
529
+ };
530
+ return f(u);
531
+ }, [a.cards, f]), D = L(async (n) => x(n, { isArchived: !0 }), [x]), r = L(async (n) => x(n, { isArchived: !1 }), [x]);
532
+ return {
533
+ /** Create a new card. @group Methods */
534
+ createCard: f,
535
+ /** Update an existing card. @group Methods */
536
+ updateCard: x,
537
+ /** Delete a card by ID. @group Methods */
538
+ deleteCard: A,
539
+ /** Move a card to a new column/swimlane. @group Methods */
540
+ moveCard: w,
541
+ /** Duplicate an existing card. @group Methods */
542
+ duplicateCard: N,
543
+ /** Archive a card. @group Methods */
544
+ archiveCard: D,
545
+ /** Restore an archived card. @group Methods */
546
+ restoreCard: r
547
+ };
548
+ }, Wa = (t, a) => {
549
+ const s = Se(), i = Qe(), c = () => s.get("KanbanService"), m = (r, n, o = 3e3) => {
550
+ const u = s.get("NotificationService");
551
+ u && u.add({ type: r, message: n, duration: o });
552
+ }, C = (r) => {
553
+ i.setQueryData(["board", a.id], r), t.onBoardChange?.(r);
554
+ }, h = se({
555
+ mutationFn: async (r) => {
556
+ const n = c();
557
+ return n ? await n.createColumn(a.id, r) : await t.onColumnCreate?.(r), r;
558
+ },
559
+ onMutate: async (r) => {
560
+ await i.cancelQueries({ queryKey: ["board", a.id] });
561
+ const n = i.getQueryData(["board", a.id]), o = {
562
+ ...a,
563
+ columns: [...a.columns, r]
564
+ };
565
+ return C(o), { previousBoard: n };
566
+ },
567
+ onError: (r, n, o) => {
568
+ o?.previousBoard && C(o.previousBoard), m("error", "Failed to create column", 5e3);
569
+ },
570
+ onSuccess: (r) => {
571
+ m("success", `Column "${r.name}" added`);
572
+ }
573
+ }), f = L(async (r) => {
574
+ const n = {
575
+ id: `column-${Date.now()}`,
576
+ name: r.name || "New Column",
577
+ color: r.color,
578
+ icon: r.icon,
579
+ wipLimit: r.wipLimit,
580
+ position: r.position ?? a.columns.length,
581
+ isCollapsed: !1,
582
+ ...r
583
+ };
584
+ return h.mutateAsync(n);
585
+ }, [a.columns.length, h]), k = se({
586
+ mutationFn: async ({ columnId: r, updates: n }) => {
587
+ const o = c();
588
+ if (o)
589
+ await o.updateColumn(r, n);
590
+ else {
591
+ const u = a.columns.find((v) => v.id === r);
592
+ u && await t.onColumnUpdate?.({ ...u, ...n });
593
+ }
594
+ return { columnId: r, updates: n };
595
+ },
596
+ onMutate: async ({ columnId: r, updates: n }) => {
597
+ await i.cancelQueries({ queryKey: ["board", a.id] });
598
+ const o = i.getQueryData(["board", a.id]), u = {
599
+ ...a,
600
+ columns: a.columns.map(
601
+ (v) => v.id === r ? { ...v, ...n } : v
602
+ )
603
+ };
604
+ return C(u), { previousBoard: o };
605
+ },
606
+ onError: (r, n, o) => {
607
+ o?.previousBoard && C(o.previousBoard), m("error", "Failed to update column", 5e3);
608
+ }
609
+ }), x = L(async (r, n) => k.mutateAsync({ columnId: r, updates: n }), [k]), y = se({
610
+ mutationFn: async (r) => {
611
+ const n = c();
612
+ return n ? await n.deleteColumn(r) : await t.onColumnDelete?.(r), r;
613
+ },
614
+ onMutate: async (r) => {
615
+ await i.cancelQueries({ queryKey: ["board", a.id] });
616
+ const n = i.getQueryData(["board", a.id]), o = n?.columns.find((v) => v.id === r), u = {
617
+ ...a,
618
+ columns: a.columns.filter((v) => v.id !== r),
619
+ cards: a.cards.filter((v) => v.columnId !== r)
620
+ // Naive delete cascade
621
+ };
622
+ return C(u), { previousBoard: n, deletedColumnName: o?.name };
623
+ },
624
+ onError: (r, n, o) => {
625
+ o?.previousBoard && C(o.previousBoard), m("error", "Failed to delete column", 5e3);
626
+ },
627
+ onSuccess: (r, n, o) => {
628
+ const u = o?.deletedColumnName || "Column";
629
+ m("success", `Column "${u}" deleted`);
630
+ }
631
+ }), A = L(async (r) => y.mutateAsync(r), [y]), l = se({
632
+ mutationFn: async (r) => {
633
+ const n = c();
634
+ if (n) {
635
+ const o = r.map((u, v) => n.updateColumn(u, { position: v }));
636
+ await Promise.all(o);
637
+ }
638
+ return r;
639
+ },
640
+ onMutate: async (r) => {
641
+ await i.cancelQueries({ queryKey: ["board", a.id] });
642
+ const n = i.getQueryData(["board", a.id]), o = {
643
+ ...a,
644
+ columns: r.map((u, v) => {
645
+ const I = a.columns.find((M) => M.id === u);
646
+ if (!I) throw new Error(`Column ${u} not found`);
647
+ return { ...I, position: v };
648
+ })
649
+ };
650
+ return C(o), { previousBoard: n };
651
+ },
652
+ onError: (r, n, o) => {
653
+ o?.previousBoard && C(o.previousBoard), m("error", "Failed to reorder columns", 3e3);
654
+ }
655
+ }), w = L(async (r) => l.mutateAsync(r), [l]), N = L((r) => {
656
+ x(r, { isCollapsed: !0 });
657
+ }, [x]), D = L((r) => {
658
+ x(r, { isCollapsed: !1 });
659
+ }, [x]);
660
+ return {
661
+ /** Create a new column. @group Methods */
662
+ createColumn: f,
663
+ /** Update an existing column. @group Methods */
664
+ updateColumn: x,
665
+ /** Delete a column by ID. @group Methods */
666
+ deleteColumn: A,
667
+ /** Reorder columns by providing new ordered IDs. @group Methods */
668
+ reorderColumns: w,
669
+ /** Collapse a column. @group Methods */
670
+ collapseColumn: N,
671
+ /** Expand a column. @group Methods */
672
+ expandColumn: D
673
+ };
674
+ }, Ja = (t, a) => {
675
+ const s = Se(), i = Qe(), c = () => s.get("KanbanService"), m = (r, n, o = 3e3) => {
676
+ const u = s.get("NotificationService");
677
+ u && u.add({ type: r, message: n, duration: o });
678
+ }, C = (r) => {
679
+ i.setQueryData(["board", a.id], r), t.onBoardChange?.(r);
680
+ }, h = se({
681
+ mutationFn: async (r) => {
682
+ const n = c();
683
+ return n ? await n.createSwimlane(a.id, r) : await t.onSwimlaneCreate?.(r), r;
684
+ },
685
+ onMutate: async (r) => {
686
+ await i.cancelQueries({ queryKey: ["board", a.id] });
687
+ const n = i.getQueryData(["board", a.id]), o = {
688
+ ...a,
689
+ swimlanes: [...a.swimlanes || [], r]
690
+ };
691
+ return C(o), { previousBoard: n };
692
+ },
693
+ onError: (r, n, o) => {
694
+ o?.previousBoard && C(o.previousBoard), m("error", "Failed to create swimlane", 5e3);
695
+ },
696
+ onSuccess: (r) => {
697
+ m("success", `Swimlane "${r.name}" added`);
698
+ }
699
+ }), f = L(async (r) => {
700
+ const n = {
701
+ id: `swimlane-${Date.now()}`,
702
+ name: r.name || "New Swimlane",
703
+ type: r.type || "custom",
704
+ color: r.color,
705
+ position: r.position ?? (a.swimlanes?.length || 0),
706
+ isCollapsed: !1,
707
+ ...r
708
+ };
709
+ return h.mutateAsync(n);
710
+ }, [a.swimlanes, h]), k = se({
711
+ mutationFn: async ({ swimlaneId: r, updates: n }) => {
712
+ const o = c();
713
+ if (o)
714
+ await o.updateSwimlane(r, n);
715
+ else {
716
+ const u = a.swimlanes?.find((v) => v.id === r);
717
+ u && await t.onSwimlaneUpdate?.({ ...u, ...n });
718
+ }
719
+ return { swimlaneId: r, updates: n };
720
+ },
721
+ onMutate: async ({ swimlaneId: r, updates: n }) => {
722
+ await i.cancelQueries({ queryKey: ["board", a.id] });
723
+ const o = i.getQueryData(["board", a.id]), u = {
724
+ ...a,
725
+ swimlanes: (a.swimlanes || []).map(
726
+ (v) => v.id === r ? { ...v, ...n } : v
727
+ )
728
+ };
729
+ return C(u), { previousBoard: o };
730
+ },
731
+ onError: (r, n, o) => {
732
+ o?.previousBoard && C(o.previousBoard), m("error", "Failed to update swimlane", 5e3);
733
+ }
734
+ }), x = L(async (r, n) => k.mutateAsync({ swimlaneId: r, updates: n }), [k]), y = se({
735
+ mutationFn: async (r) => {
736
+ const n = c();
737
+ return n ? await n.deleteSwimlane(r) : await t.onSwimlaneDelete?.(r), r;
738
+ },
739
+ onMutate: async (r) => {
740
+ await i.cancelQueries({ queryKey: ["board", a.id] });
741
+ const n = i.getQueryData(["board", a.id]), o = n?.swimlanes?.find((v) => v.id === r), u = {
742
+ ...a,
743
+ swimlanes: (a.swimlanes || []).filter((v) => v.id !== r),
744
+ cards: a.cards.map((v) => v.swimlaneId === r ? { ...v, swimlaneId: void 0 } : v)
745
+ };
746
+ return C(u), { previousBoard: n, deletedSwimlaneName: o?.name };
747
+ },
748
+ onError: (r, n, o) => {
749
+ o?.previousBoard && C(o.previousBoard), m("error", "Failed to delete swimlane", 5e3);
750
+ },
751
+ onSuccess: (r, n, o) => {
752
+ const u = o?.deletedSwimlaneName || "Swimlane";
753
+ m("success", `Swimlane "${u}" deleted`);
754
+ }
755
+ }), A = L(async (r) => y.mutateAsync(r), [y]), l = se({
756
+ mutationFn: async (r) => {
757
+ const n = c();
758
+ if (n) {
759
+ const o = r.map((u, v) => n.updateSwimlane(u, { position: v }));
760
+ await Promise.all(o);
761
+ }
762
+ return r;
763
+ },
764
+ onMutate: async (r) => {
765
+ await i.cancelQueries({ queryKey: ["board", a.id] });
766
+ const n = i.getQueryData(["board", a.id]), o = {
767
+ ...a,
768
+ swimlanes: r.map((u, v) => {
769
+ const I = a.swimlanes?.find((M) => M.id === u);
770
+ return I ? { ...I, position: v } : null;
771
+ }).filter(Boolean)
772
+ };
773
+ return C(o), { previousBoard: n };
774
+ },
775
+ onError: (r, n, o) => {
776
+ o?.previousBoard && C(o.previousBoard), m("error", "Failed to reorder swimlanes", 3e3);
777
+ }
778
+ }), w = L(async (r) => l.mutateAsync(r), [l]), N = L((r) => {
779
+ x(r, { isCollapsed: !0 }), t.onSwimlaneToggle?.({ swimlaneId: r, isCollapsed: !0 });
780
+ }, [x, t.onSwimlaneToggle]), D = L((r) => {
781
+ x(r, { isCollapsed: !1 }), t.onSwimlaneToggle?.({ swimlaneId: r, isCollapsed: !1 });
782
+ }, [x, t.onSwimlaneToggle]);
783
+ return {
784
+ /** Create a new swimlane. @group Methods */
785
+ createSwimlane: f,
786
+ /** Update an existing swimlane. @group Methods */
787
+ updateSwimlane: x,
788
+ /** Delete a swimlane by ID. @group Methods */
789
+ deleteSwimlane: A,
790
+ /** Reorder swimlanes by providing new ordered IDs. @group Methods */
791
+ reorderSwimlanes: w,
792
+ /** Collapse a swimlane. @group Methods */
793
+ collapseSwimlane: N,
794
+ /** Expand a swimlane. @group Methods */
795
+ expandSwimlane: D
796
+ };
797
+ }, Ga = (t) => {
798
+ const [a, s] = q(""), [i, c] = q({});
799
+ return {
800
+ /** List of cards after applying search and filters. @group State */
801
+ filteredCards: ce(() => t.cards.filter((h) => {
802
+ if (a) {
803
+ const f = a.toLowerCase();
804
+ if (!(h.title.toLowerCase().includes(f) || h.description?.toLowerCase().includes(f) || h.tags.some((x) => x.name.toLowerCase().includes(f)))) return !1;
805
+ }
806
+ return !(i.tags && i.tags.length > 0 && !h.tags.some((k) => i.tags?.includes(k.id)) || i.assignees && i.assignees.length > 0 && !h.assignees.some((k) => i.assignees?.includes(k.id)) || i.priority && i.priority.length > 0 && h.priority && !i.priority.includes(h.priority) || i.columns && i.columns.length > 0 && !i.columns.includes(h.columnId));
807
+ }), [t.cards, a, i]),
808
+ /** Current search query string. @group State */
809
+ searchQuery: a,
810
+ /** Handler to update the search query. @group Methods */
811
+ setSearchQuery: s,
812
+ /** Current active filter configuration. @group State */
813
+ activeFilters: i,
814
+ /** Handler to update active filters. @group Methods */
815
+ setActiveFilters: c,
816
+ /** Clear all active filters and search query. @group Methods */
817
+ clearFilters: () => {
818
+ s(""), c({});
819
+ }
820
+ };
821
+ }, Ya = (t, a, s = !1, i) => {
822
+ const c = Se(), [m, C] = q(null), [h, f] = q(null), [k, x] = q(null), y = L((N) => {
823
+ if (i?.onCardDragStart) {
824
+ const D = { card: N, columnId: N.columnId, cancel: !1 };
825
+ if (i.onCardDragStart(D), D.cancel) return;
826
+ }
827
+ C(N);
828
+ }, [i?.onCardDragStart]), A = L((N, D) => {
829
+ m && h !== N && (h && i?.onCardDragLeave && i.onCardDragLeave({ card: m, targetColumnId: h }), i?.onCardDragEnter && i.onCardDragEnter({ card: m, targetColumnId: N })), f(N), D && x(D);
830
+ }, [m, i, h]), l = L(() => {
831
+ m && i?.onCardDragStop && i.onCardDragStop({ card: m, columnId: m.columnId }), C(null), f(null), x(null);
832
+ }, [m, i?.onCardDragStop]), w = L((N, D, r) => {
833
+ if (!m) return;
834
+ const n = t.columns.find((o) => o.id === N);
835
+ if (n?.wipLimit && t.cards.filter((u) => u.columnId === N && !u.isArchived).length >= n.wipLimit && (m.columnId !== N || m.swimlaneId !== D)) {
836
+ const u = c.get("NotificationService");
837
+ if (u && u.add({
838
+ type: "warning",
839
+ message: `WIP limit reached for "${n.name}" (${n.wipLimit} cards)`,
840
+ duration: 4e3
841
+ }), s) {
842
+ u?.add({
843
+ type: "error",
844
+ message: `Cannot move card: "${n.name}" is full (Strict WIP)`,
845
+ duration: 4e3
846
+ }), C(null), f(null), x(null);
847
+ return;
848
+ }
849
+ }
850
+ a(m.id, N, D, r), i?.onCardDragStop && i.onCardDragStop({ card: m, columnId: N }), C(null), f(null), x(null);
851
+ }, [m, t, a, i?.onCardDragStop]);
852
+ return {
853
+ /** The card currently being dragged. @group State */
854
+ draggedCard: m,
855
+ /** ID of the column being dragged over. @group State */
856
+ dragOverColumn: h,
857
+ /** ID of the swimlane being dragged over. @group State */
858
+ dragOverSwimlane: k,
859
+ /** Handler for drag start. @group Events */
860
+ handleDragStart: y,
861
+ /** Handler for drag over. @group Events */
862
+ handleDragOver: A,
863
+ /** Handler for drag end (cancel/finish). @group Events */
864
+ handleDragEnd: l,
865
+ /** Handler for drop (commit move). @group Events */
866
+ handleDrop: w
867
+ };
868
+ }, Xa = (t, a = {}) => {
869
+ const i = Mt("I18nService")?.dir || "ltr", c = t.dir === "auto" || !t.dir ? i : t.dir, m = {
870
+ showSpinner: () => {
871
+ },
872
+ hideSpinner: () => {
873
+ }
874
+ }, C = null, {
875
+ board: h,
876
+ setBoard: f,
877
+ selectedCards: k,
878
+ setSelectedCards: x,
879
+ selectedColumnId: y,
880
+ setSelectedColumnId: A,
881
+ view: l,
882
+ setView: w,
883
+ undo: N,
884
+ redo: D,
885
+ canUndo: r,
886
+ canRedo: n
887
+ } = qa(t), [o, u] = q(null), {
888
+ createCard: v,
889
+ updateCard: I,
890
+ deleteCard: M,
891
+ moveCard: B,
892
+ duplicateCard: T,
893
+ archiveCard: S,
894
+ restoreCard: E
895
+ } = Ha(t, h), {
896
+ createColumn: U,
897
+ updateColumn: W,
898
+ deleteColumn: X,
899
+ reorderColumns: V,
900
+ collapseColumn: H,
901
+ expandColumn: b
902
+ } = Wa(t, h), {
903
+ createSwimlane: F,
904
+ updateSwimlane: Q,
905
+ deleteSwimlane: G,
906
+ reorderSwimlanes: ae,
907
+ collapseSwimlane: j,
908
+ expandSwimlane: O
909
+ } = Ja(t, h), {
910
+ draggedCard: Z,
911
+ dragOverColumn: re,
912
+ handleDragStart: Y,
913
+ handleDragOver: ne,
914
+ handleDragEnd: ke,
915
+ handleDrop: De
916
+ } = Ya(h, B, t.wipStrict, t), {
917
+ filteredCards: ie,
918
+ searchQuery: me,
919
+ setSearchQuery: ue,
920
+ activeFilters: g,
921
+ setActiveFilters: p,
922
+ clearFilters: _
923
+ } = Ga(h), { selectedIndex: K, setSelectedIndex: ee } = Et({
924
+ totalItems: ie.length,
925
+ columns: 1,
926
+ // Simplified for now, though Kanban is a grid-ish
927
+ enabled: !t.readOnly,
928
+ onSelect: (R) => {
929
+ const z = ie[R];
930
+ z && (u(z.id), (document.getElementById(z.id) || document.querySelector(`[data-card-id="${z.id}"]`))?.scrollIntoView({ behavior: "smooth", block: "nearest" }));
931
+ },
932
+ onAction: (R) => {
933
+ const z = ie[R];
934
+ z && a.onCardClick && a.onCardClick(z);
935
+ }
936
+ }), de = ce(() => ({
937
+ // Card operations
938
+ addCard: v,
939
+ updateCard: I,
940
+ deleteCard: M,
941
+ moveCard: B,
942
+ duplicateCard: T,
943
+ archiveCard: S,
944
+ restoreCard: E,
945
+ getCard: (R) => h.cards.find((z) => z.id === R),
946
+ getCards: () => h.cards,
947
+ getCardsInColumn: (R) => h.cards.filter((z) => z.columnId === R),
948
+ getOrderedCards: (R) => h.cards.filter((z) => z.columnId === R).sort((z, he) => (z.position ?? 0) - (he.position ?? 0)),
949
+ // Column operations
950
+ addColumn: U,
951
+ updateColumn: W,
952
+ deleteColumn: X,
953
+ reorderColumns: V,
954
+ collapseColumn: H,
955
+ expandColumn: b,
956
+ getColumn: (R) => h.columns.find((z) => z.id === R),
957
+ getColumns: () => h.columns,
958
+ // Swimlane operations
959
+ addSwimlane: F,
960
+ updateSwimlane: Q,
961
+ deleteSwimlane: G,
962
+ reorderSwimlanes: ae,
963
+ collapseSwimlane: j,
964
+ expandSwimlane: O,
965
+ getSwimlane: (R) => h.swimlanes?.find((z) => z.id === R),
966
+ getSwimlanes: () => h.swimlanes || [],
967
+ // Selection operations
968
+ selectCard: (R) => x([R]),
969
+ selectCards: x,
970
+ deselectCard: (R) => {
971
+ const z = k.filter((he) => he !== R);
972
+ x(z);
973
+ },
974
+ deselectAllCards: () => x([]),
975
+ getSelectedCards: () => h.cards.filter((R) => k.includes(R.id)),
976
+ // UI Operations (Enterprise)
977
+ focusCard: (R) => {
978
+ const z = document.getElementById(R) || document.querySelector(`[data-card-id="${R}"]`);
979
+ z instanceof HTMLElement && (z.focus(), z.scrollIntoView({ behavior: "smooth", block: "center" }));
980
+ },
981
+ highlightCard: (R, z = 2e3) => {
982
+ u(R), setTimeout(() => u(null), z);
983
+ },
984
+ // View operations
985
+ setView: w,
986
+ getView: () => l,
987
+ scrollToColumn: (R, z) => {
988
+ (document.getElementById(`column-${R}`) || document.querySelector(`[data-column-id="${R}"]`))?.scrollIntoView(z || { behavior: "smooth", block: "center", inline: "center" });
989
+ },
990
+ scrollToCard: (R, z) => {
991
+ (document.getElementById(R) || document.querySelector(`[data-card-id="${R}"]`))?.scrollIntoView(z || { behavior: "smooth", block: "center" });
992
+ },
993
+ // Filter & search operations
994
+ setSearchQuery: ue,
995
+ getSearchQuery: () => me,
996
+ setActiveFilters: p,
997
+ getActiveFilters: () => g,
998
+ clearFilters: _,
999
+ getFilteredCards: () => ie,
1000
+ // Board operations
1001
+ getBoard: () => h,
1002
+ setBoard: f,
1003
+ refresh: async () => {
1004
+ },
1005
+ reset: () => f(t.board),
1006
+ // Utility methods
1007
+ showSpinner: m.showSpinner,
1008
+ hideSpinner: m.hideSpinner,
1009
+ forceUpdate: () => {
1010
+ },
1011
+ getStatistics: () => ({ totalCards: h.cards.length, totalColumns: h.columns.length }),
1012
+ validate: () => ({ isValid: !0, errors: [] }),
1013
+ ...a
1014
+ }), [
1015
+ h,
1016
+ v,
1017
+ I,
1018
+ M,
1019
+ B,
1020
+ T,
1021
+ S,
1022
+ E,
1023
+ U,
1024
+ W,
1025
+ X,
1026
+ V,
1027
+ H,
1028
+ b,
1029
+ F,
1030
+ Q,
1031
+ G,
1032
+ ae,
1033
+ j,
1034
+ O,
1035
+ k,
1036
+ x,
1037
+ y,
1038
+ A,
1039
+ me,
1040
+ ue,
1041
+ g,
1042
+ p,
1043
+ _,
1044
+ ie,
1045
+ f,
1046
+ t.board,
1047
+ m,
1048
+ a,
1049
+ l,
1050
+ t.wipStrict,
1051
+ t
1052
+ ]);
1053
+ return ce(() => ({
1054
+ state: {
1055
+ board: h,
1056
+ selectedCards: k,
1057
+ highlightedCardId: o,
1058
+ selectedColumnId: y,
1059
+ view: l,
1060
+ draggedCard: Z,
1061
+ dragOverColumn: re,
1062
+ filteredCards: ie,
1063
+ searchQuery: me,
1064
+ activeFilters: g,
1065
+ selectedIndex: K,
1066
+ canUndo: r,
1067
+ canRedo: n
1068
+ },
1069
+ actions: {
1070
+ setBoard: f,
1071
+ setSelectedCards: x,
1072
+ setSelectedColumnId: A,
1073
+ setView: w,
1074
+ createCard: v,
1075
+ updateCard: I,
1076
+ deleteCard: M,
1077
+ moveCard: B,
1078
+ duplicateCard: T,
1079
+ archiveCard: S,
1080
+ restoreCard: E,
1081
+ createColumn: U,
1082
+ updateColumn: W,
1083
+ deleteColumn: X,
1084
+ reorderColumns: V,
1085
+ collapseColumn: H,
1086
+ expandColumn: b,
1087
+ createSwimlane: F,
1088
+ updateSwimlane: Q,
1089
+ deleteSwimlane: G,
1090
+ reorderSwimlanes: ae,
1091
+ collapseSwimlane: j,
1092
+ expandSwimlane: O,
1093
+ handleDragStart: Y,
1094
+ handleDragOver: ne,
1095
+ handleDragEnd: ke,
1096
+ handleDrop: De,
1097
+ setSearchQuery: ue,
1098
+ setActiveFilters: p,
1099
+ clearFilters: _,
1100
+ setSelectedIndex: ee,
1101
+ undo: N,
1102
+ redo: D
1103
+ },
1104
+ services: {
1105
+ serviceRegistry: C
1106
+ },
1107
+ imperativeAPI: de,
1108
+ dir: c,
1109
+ baseApi: m
1110
+ }), [
1111
+ m,
1112
+ de,
1113
+ h,
1114
+ f,
1115
+ k,
1116
+ x,
1117
+ o,
1118
+ y,
1119
+ A,
1120
+ l,
1121
+ w,
1122
+ c,
1123
+ v,
1124
+ I,
1125
+ M,
1126
+ B,
1127
+ T,
1128
+ S,
1129
+ E,
1130
+ U,
1131
+ W,
1132
+ X,
1133
+ V,
1134
+ H,
1135
+ b,
1136
+ F,
1137
+ Q,
1138
+ G,
1139
+ ae,
1140
+ j,
1141
+ O,
1142
+ Z,
1143
+ re,
1144
+ Y,
1145
+ ne,
1146
+ ke,
1147
+ De,
1148
+ ie,
1149
+ me,
1150
+ ue,
1151
+ g,
1152
+ p,
1153
+ _,
1154
+ C,
1155
+ K,
1156
+ ee,
1157
+ N,
1158
+ D,
1159
+ r,
1160
+ n
1161
+ ]);
1162
+ };
1163
+ function Za(t, a = 300) {
1164
+ const [s, i] = q(t);
1165
+ return Ne(() => {
1166
+ const c = setTimeout(() => {
1167
+ i(t);
1168
+ }, a);
1169
+ return () => {
1170
+ clearTimeout(c);
1171
+ };
1172
+ }, [t, a]), s;
1173
+ }
1174
+ const en = Ft(
1175
+ "inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
1176
+ {
1177
+ variants: {
1178
+ variant: {
1179
+ default: "border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",
1180
+ secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
1181
+ destructive: "border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",
1182
+ outline: "text-foreground"
1183
+ }
1184
+ },
1185
+ defaultVariants: {
1186
+ variant: "default"
1187
+ }
1188
+ }
1189
+ );
1190
+ function pt({ className: t, variant: a, ...s }) {
1191
+ return /* @__PURE__ */ e("div", { className: P(en({ variant: a }), t), ...s });
1192
+ }
1193
+ const tn = ({
1194
+ board: t,
1195
+ activeFilters: a,
1196
+ onFiltersChange: s,
1197
+ onClearFilters: i
1198
+ }) => {
1199
+ const m = Array.from(new Set(t.cards.flatMap((l) => l.tags).map((l) => JSON.stringify(l)))).map((l) => JSON.parse(l)).filter((l, w, N) => w === N.findIndex((D) => D.id === l.id)), h = Array.from(new Set(t.cards.flatMap((l) => l.assignees).map((l) => JSON.stringify(l)))).map((l) => JSON.parse(l)).filter((l, w, N) => w === N.findIndex((D) => D.id === l.id)), f = ["low", "medium", "high", "critical"], k = (l) => {
1200
+ const w = a.priority || [], N = w.includes(l) ? w.filter((D) => D !== l) : [...w, l];
1201
+ s({ ...a, priority: N.length ? N : void 0 });
1202
+ }, x = (l) => {
1203
+ const w = a.tags || [], N = w.includes(l) ? w.filter((D) => D !== l) : [...w, l];
1204
+ s({ ...a, tags: N.length ? N : void 0 });
1205
+ }, y = (l) => {
1206
+ const w = a.assignees || [], N = w.includes(l) ? w.filter((D) => D !== l) : [...w, l];
1207
+ s({ ...a, assignees: N.length ? N : void 0 });
1208
+ }, A = (a.priority?.length || 0) + (a.tags?.length || 0) + (a.assignees?.length || 0);
1209
+ return /* @__PURE__ */ d(Rt, { children: [
1210
+ /* @__PURE__ */ e(Kt, { asChild: !0, children: /* @__PURE__ */ d($, { variant: "outline", size: "sm", className: "relative", children: [
1211
+ /* @__PURE__ */ e(Ut, { className: "h-4 w-4 mr-2" }),
1212
+ "Filters",
1213
+ A > 0 && /* @__PURE__ */ e(pt, { variant: "secondary", className: "ml-2 h-5 min-w-[20px] px-1 text-[10px] flex items-center justify-center", children: A })
1214
+ ] }) }),
1215
+ /* @__PURE__ */ d(Pt, { className: "w-80 p-4", align: "start", children: [
1216
+ /* @__PURE__ */ d("div", { className: "flex items-center justify-between mb-4", children: [
1217
+ /* @__PURE__ */ e("h4", { className: "font-medium leading-none", children: "Filters" }),
1218
+ A > 0 && /* @__PURE__ */ e($, { variant: "ghost", size: "sm", className: "h-auto p-0 text-xs text-muted-foreground", onClick: i, children: "Clear all" })
1219
+ ] }),
1220
+ /* @__PURE__ */ e(qt, { className: "h-[300px] pr-4", children: /* @__PURE__ */ d("div", { className: "space-y-6", children: [
1221
+ /* @__PURE__ */ d("div", { className: "space-y-3", children: [
1222
+ /* @__PURE__ */ e("h5", { className: "text-sm font-medium text-muted-foreground", children: "Priority" }),
1223
+ /* @__PURE__ */ e("div", { className: "space-y-2", children: f.map((l) => /* @__PURE__ */ d("div", { className: "flex items-center space-x-2", children: [
1224
+ /* @__PURE__ */ e(
1225
+ Ce,
1226
+ {
1227
+ id: `priority-${l}`,
1228
+ checked: a.priority?.includes(l),
1229
+ onCheckedChange: () => k(l)
1230
+ }
1231
+ ),
1232
+ /* @__PURE__ */ e(le, { htmlFor: `priority-${l}`, className: "capitalize text-sm font-normal cursor-pointer", children: l })
1233
+ ] }, l)) })
1234
+ ] }),
1235
+ h.length > 0 && /* @__PURE__ */ d("div", { className: "space-y-3", children: [
1236
+ /* @__PURE__ */ e("h5", { className: "text-sm font-medium text-muted-foreground", children: "Assignees" }),
1237
+ /* @__PURE__ */ e("div", { className: "space-y-2", children: h.map((l) => /* @__PURE__ */ d("div", { className: "flex items-center space-x-2", children: [
1238
+ /* @__PURE__ */ e(
1239
+ Ce,
1240
+ {
1241
+ id: `assignee-${l.id}`,
1242
+ checked: a.assignees?.includes(l.id),
1243
+ onCheckedChange: () => y(l.id)
1244
+ }
1245
+ ),
1246
+ /* @__PURE__ */ d(le, { htmlFor: `assignee-${l.id}`, className: "text-sm font-normal cursor-pointer flex items-center gap-2", children: [
1247
+ l.avatarUrl && /* @__PURE__ */ e("img", { src: l.avatarUrl, alt: "", className: "w-4 h-4 rounded-full" }),
1248
+ l.name
1249
+ ] })
1250
+ ] }, l.id)) })
1251
+ ] }),
1252
+ m.length > 0 && /* @__PURE__ */ d("div", { className: "space-y-3", children: [
1253
+ /* @__PURE__ */ e("h5", { className: "text-sm font-medium text-muted-foreground", children: "Tags" }),
1254
+ /* @__PURE__ */ e("div", { className: "space-y-2", children: m.map((l) => /* @__PURE__ */ d("div", { className: "flex items-center space-x-2", children: [
1255
+ /* @__PURE__ */ e(
1256
+ Ce,
1257
+ {
1258
+ id: `tag-${l.id}`,
1259
+ checked: a.tags?.includes(l.id),
1260
+ onCheckedChange: () => x(l.id)
1261
+ }
1262
+ ),
1263
+ /* @__PURE__ */ d(le, { htmlFor: `tag-${l.id}`, className: "text-sm font-normal cursor-pointer flex items-center gap-2", children: [
1264
+ /* @__PURE__ */ e("div", { className: "w-2 h-2 rounded-full", style: { backgroundColor: l.color } }),
1265
+ l.name
1266
+ ] })
1267
+ ] }, l.id)) })
1268
+ ] })
1269
+ ] }) })
1270
+ ] })
1271
+ ] });
1272
+ }, an = ({
1273
+ searchQuery: t,
1274
+ onSearchChange: a,
1275
+ onAddCardClick: s,
1276
+ onAddColumn: i,
1277
+ board: c,
1278
+ className: m,
1279
+ view: C = "standard",
1280
+ onViewChange: h,
1281
+ onUndo: f,
1282
+ onRedo: k,
1283
+ canUndo: x,
1284
+ canRedo: y,
1285
+ activeFilters: A,
1286
+ onFiltersChange: l
1287
+ }) => {
1288
+ const w = Se(), [N, D] = q(t), { t: r } = we(), n = Za(N, 300);
1289
+ Ne(() => {
1290
+ a(n);
1291
+ }, [n, a]), Ne(() => {
1292
+ D(t);
1293
+ }, [t]);
1294
+ const o = () => {
1295
+ s?.();
1296
+ }, u = (v) => {
1297
+ if (c)
1298
+ try {
1299
+ const I = w.get("ExportService");
1300
+ if (v === "csv") {
1301
+ const B = c.cards.map((T) => ({
1302
+ id: T.id,
1303
+ title: T.title,
1304
+ description: T.description || "",
1305
+ column: c.columns.find((S) => S.id === T.columnId)?.name || "",
1306
+ priority: T.priority || "",
1307
+ assignees: T.assignees?.map((S) => S.name).join("; ") || "",
1308
+ tags: T.tags?.map((S) => S.name).join("; ") || "",
1309
+ dueDate: T.dueDate ? new Date(T.dueDate).toISOString().split("T")[0] : "",
1310
+ isArchived: T.isArchived ? "Yes" : "No"
1311
+ }));
1312
+ if (I)
1313
+ I.exportToCSV(B, [
1314
+ { header: "ID", accessorKey: "id" },
1315
+ { header: "Title", accessorKey: "title" },
1316
+ { header: "Description", accessorKey: "description" },
1317
+ { header: "Column", accessorKey: "column" },
1318
+ { header: "Priority", accessorKey: "priority" },
1319
+ { header: "Assignees", accessorKey: "assignees" },
1320
+ { header: "Tags", accessorKey: "tags" },
1321
+ { header: "Due Date", accessorKey: "dueDate" },
1322
+ { header: "Archived", accessorKey: "isArchived" }
1323
+ ], { fileName: `kanban-board-${c.id}` });
1324
+ else {
1325
+ const T = Object.keys(B[0] || {}), S = [
1326
+ T.join(","),
1327
+ ...B.map((X) => T.map((V) => `"${X[V]}"`).join(","))
1328
+ ].join(`
1329
+ `), E = new Blob([S], { type: "text/csv" }), U = URL.createObjectURL(E), W = document.createElement("a");
1330
+ W.href = U, W.download = `kanban-board-${c.id}.csv`, W.click(), URL.revokeObjectURL(U);
1331
+ }
1332
+ } else {
1333
+ const B = JSON.stringify(c, null, 2);
1334
+ if (I && I.download)
1335
+ I.download(B, `kanban-board-${c.id}.json`);
1336
+ else {
1337
+ const T = new Blob([B], { type: "application/json" }), S = URL.createObjectURL(T), E = document.createElement("a");
1338
+ E.href = S, E.download = `kanban-board-${c.id}.json`, E.click(), URL.revokeObjectURL(S);
1339
+ }
1340
+ }
1341
+ const M = w.get("NotificationService");
1342
+ M && M.add({
1343
+ type: "success",
1344
+ message: `Board exported as ${v.toUpperCase()}`,
1345
+ duration: 3e3
1346
+ });
1347
+ } catch (I) {
1348
+ const M = w.get("NotificationService");
1349
+ M && M.add({
1350
+ type: "error",
1351
+ message: `Failed to export board: ${I instanceof Error ? I.message : "Unknown error"}`,
1352
+ duration: 4e3
1353
+ });
1354
+ }
1355
+ };
1356
+ return /* @__PURE__ */ e(Nt, { children: /* @__PURE__ */ d("div", { className: `flex items-center gap-4 p-4 border-b ${m || ""}`, children: [
1357
+ /* @__PURE__ */ d("div", { className: "flex gap-1 mr-2", children: [
1358
+ /* @__PURE__ */ e(
1359
+ $,
1360
+ {
1361
+ variant: "ghost",
1362
+ size: "icon",
1363
+ onClick: f,
1364
+ disabled: !x,
1365
+ title: "Undo (Ctrl+Z)",
1366
+ children: /* @__PURE__ */ e(Pa, { className: "h-4 w-4" })
1367
+ }
1368
+ ),
1369
+ /* @__PURE__ */ e(
1370
+ $,
1371
+ {
1372
+ variant: "ghost",
1373
+ size: "icon",
1374
+ onClick: k,
1375
+ disabled: !y,
1376
+ title: "Redo (Ctrl+Shift+Z)",
1377
+ children: /* @__PURE__ */ e(Ba, { className: "h-4 w-4" })
1378
+ }
1379
+ )
1380
+ ] }),
1381
+ /* @__PURE__ */ d("div", { className: "relative flex-1 max-w-sm", children: [
1382
+ /* @__PURE__ */ e(zt, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground" }),
1383
+ /* @__PURE__ */ e(
1384
+ fe,
1385
+ {
1386
+ placeholder: r("search_placeholder"),
1387
+ value: N,
1388
+ onChange: (v) => D(v.target.value),
1389
+ className: "pl-9"
1390
+ }
1391
+ )
1392
+ ] }),
1393
+ /* @__PURE__ */ e("div", { className: "w-[180px]", children: /* @__PURE__ */ d(Fe, { value: C, onValueChange: (v) => h?.(v), children: [
1394
+ /* @__PURE__ */ e(_e, { children: /* @__PURE__ */ e(Te, { placeholder: "Select view" }) }),
1395
+ /* @__PURE__ */ d(Be, { children: [
1396
+ /* @__PURE__ */ e(oe, { value: "standard", children: /* @__PURE__ */ d("div", { className: "flex items-center", children: [
1397
+ /* @__PURE__ */ e(tt, { className: "h-4 w-4 mr-2" }),
1398
+ r("view_standard")
1399
+ ] }) }),
1400
+ /* @__PURE__ */ e(oe, { value: "swimlane", children: /* @__PURE__ */ d("div", { className: "flex items-center", children: [
1401
+ /* @__PURE__ */ e(Ht, { className: "h-4 w-4 mr-2" }),
1402
+ r("view_swimlane")
1403
+ ] }) }),
1404
+ /* @__PURE__ */ e(oe, { value: "timeline", children: /* @__PURE__ */ d("div", { className: "flex items-center", children: [
1405
+ /* @__PURE__ */ e(tt, { className: "h-4 w-4 mr-2" }),
1406
+ " ",
1407
+ r("view_timeline")
1408
+ ] }) })
1409
+ ] })
1410
+ ] }) }),
1411
+ c && /* @__PURE__ */ e(
1412
+ tn,
1413
+ {
1414
+ board: c,
1415
+ activeFilters: A || {},
1416
+ onFiltersChange: (v) => l?.(v),
1417
+ onClearFilters: () => l?.({})
1418
+ }
1419
+ ),
1420
+ c && /* @__PURE__ */ d("div", { className: "flex gap-1", children: [
1421
+ /* @__PURE__ */ d(
1422
+ $,
1423
+ {
1424
+ variant: "outline",
1425
+ size: "sm",
1426
+ onClick: () => u("csv"),
1427
+ title: "Export as CSV",
1428
+ children: [
1429
+ /* @__PURE__ */ e(Je, { className: "h-4 w-4 mr-2" }),
1430
+ "CSV"
1431
+ ]
1432
+ }
1433
+ ),
1434
+ /* @__PURE__ */ d(
1435
+ $,
1436
+ {
1437
+ variant: "outline",
1438
+ size: "sm",
1439
+ onClick: () => u("json"),
1440
+ title: "Export as JSON",
1441
+ children: [
1442
+ /* @__PURE__ */ e(Je, { className: "h-4 w-4 mr-2" }),
1443
+ "JSON"
1444
+ ]
1445
+ }
1446
+ )
1447
+ ] }),
1448
+ /* @__PURE__ */ d("div", { className: "ml-auto flex gap-2", children: [
1449
+ /* @__PURE__ */ d($, { variant: "outline", size: "sm", onClick: i, children: [
1450
+ /* @__PURE__ */ e(be, { className: "h-4 w-4 mr-2" }),
1451
+ r("add_column")
1452
+ ] }),
1453
+ /* @__PURE__ */ d($, { size: "sm", onClick: o, children: [
1454
+ /* @__PURE__ */ e(be, { className: "h-4 w-4 mr-2" }),
1455
+ r("add_card")
1456
+ ] })
1457
+ ] })
1458
+ ] }) });
1459
+ }, Me = te.forwardRef(
1460
+ ({ className: t, ...a }, s) => /* @__PURE__ */ e(
1461
+ "textarea",
1462
+ {
1463
+ className: P(
1464
+ "flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
1465
+ t
1466
+ ),
1467
+ ref: s,
1468
+ ...a
1469
+ }
1470
+ )
1471
+ );
1472
+ Me.displayName = "Textarea";
1473
+ const je = te.createContext(void 0), gt = te.forwardRef(({ className: t, defaultValue: a, value: s, onValueChange: i, children: c, ...m }, C) => {
1474
+ const [h, f] = te.useState(a || ""), k = s !== void 0, x = k ? s : h, y = te.useCallback(
1475
+ (A) => {
1476
+ k || f(A), i?.(A);
1477
+ },
1478
+ [k, i]
1479
+ );
1480
+ return /* @__PURE__ */ e(je.Provider, { value: { value: x, onValueChange: y }, children: /* @__PURE__ */ e("div", { ref: C, className: P(t), ...m, children: c }) });
1481
+ });
1482
+ gt.displayName = "Tabs";
1483
+ const ft = te.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e(
1484
+ "div",
1485
+ {
1486
+ ref: s,
1487
+ className: P(
1488
+ "inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",
1489
+ t
1490
+ ),
1491
+ ...a
1492
+ }
1493
+ ));
1494
+ ft.displayName = "TabsList";
1495
+ const ve = te.forwardRef(({ className: t, value: a, onClick: s, ...i }, c) => {
1496
+ const m = te.useContext(je);
1497
+ if (!m) throw new Error("TabsTrigger must be used within Tabs");
1498
+ const C = m.value === a;
1499
+ return /* @__PURE__ */ e(
1500
+ "button",
1501
+ {
1502
+ ref: c,
1503
+ type: "button",
1504
+ className: P(
1505
+ "inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
1506
+ C && "bg-background text-foreground shadow-sm",
1507
+ t
1508
+ ),
1509
+ onClick: (h) => {
1510
+ m.onValueChange(a), s?.(h);
1511
+ },
1512
+ ...i
1513
+ }
1514
+ );
1515
+ });
1516
+ ve.displayName = "TabsTrigger";
1517
+ const ye = te.forwardRef(({ className: t, value: a, children: s, ...i }, c) => {
1518
+ const m = te.useContext(je);
1519
+ if (!m) throw new Error("TabsContent must be used within Tabs");
1520
+ return m.value !== a ? null : /* @__PURE__ */ e(
1521
+ "div",
1522
+ {
1523
+ ref: c,
1524
+ className: P(
1525
+ "mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
1526
+ t
1527
+ ),
1528
+ ...i,
1529
+ children: s
1530
+ }
1531
+ );
1532
+ });
1533
+ ye.displayName = "TabsContent";
1534
+ const nn = ({
1535
+ isOpen: t,
1536
+ onClose: a,
1537
+ onSave: s,
1538
+ onDelete: i,
1539
+ card: c,
1540
+ columns: m = [],
1541
+ columnId: C,
1542
+ customFields: h = [],
1543
+ currentUser: f = { id: "current-user", name: "Current User" }
1544
+ }) => {
1545
+ const { t: k } = we(), x = () => typeof crypto < "u" && crypto.randomUUID ? crypto.randomUUID() : `id-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`, y = Wt({
1546
+ defaultValues: {
1547
+ title: c?.title || "",
1548
+ description: c?.description || "",
1549
+ columnId: c?.columnId || C || m[0]?.id || "",
1550
+ priority: c?.priority || "medium",
1551
+ startDate: c?.startDate ? new Date(c.startDate) : void 0,
1552
+ dueDate: c?.dueDate ? new Date(c.dueDate) : void 0,
1553
+ checklists: c?.checklists || [],
1554
+ attachments: c?.attachments || [],
1555
+ comments: c?.comments || [],
1556
+ coverImage: c?.coverImage || "",
1557
+ customFieldValues: c?.customFieldValues || {},
1558
+ subtasks: c?.subtasks || [],
1559
+ timeTracking: c?.timeTracking || { estimated: 0, actual: 0 },
1560
+ activity: c?.activity || [],
1561
+ assignees: c?.assignees || [],
1562
+ tags: c?.tags || [],
1563
+ ...c
1564
+ // Merge any other properties
1565
+ },
1566
+ onSubmit: async ({ value: g }) => {
1567
+ s(g), a();
1568
+ }
1569
+ });
1570
+ Ne(() => {
1571
+ }, [t, c]);
1572
+ const A = () => {
1573
+ c?.id && i && i(c.id);
1574
+ }, [l, w] = q({}), N = () => {
1575
+ const g = {
1576
+ id: x(),
1577
+ title: "Checklist",
1578
+ items: []
1579
+ };
1580
+ y.pushFieldValue("checklists", g);
1581
+ }, D = (g, p) => {
1582
+ w((_) => ({ ..._, [g]: p }));
1583
+ }, r = (g) => {
1584
+ const p = l[g]?.trim();
1585
+ if (!p) return;
1586
+ const K = (y.getFieldValue("checklists") || []).map((ee) => ee.id === g ? {
1587
+ ...ee,
1588
+ items: [...ee.items, { id: x(), text: p, isChecked: !1 }]
1589
+ } : ee);
1590
+ y.setFieldValue("checklists", K), w((ee) => ({ ...ee, [g]: "" }));
1591
+ }, n = (g, p) => {
1592
+ const K = (y.getFieldValue("checklists") || []).map((ee) => ee.id === g ? {
1593
+ ...ee,
1594
+ items: ee.items.map(
1595
+ (de) => de.id === p ? { ...de, isChecked: !de.isChecked } : de
1596
+ )
1597
+ } : ee);
1598
+ y.setFieldValue("checklists", K);
1599
+ }, [o, u] = q(""), [v, I] = q(null), [M, B] = q(""), [T, S] = q(null), E = () => {
1600
+ if (!o.trim()) return;
1601
+ const g = {
1602
+ id: x(),
1603
+ text: o,
1604
+ authorId: f.id,
1605
+ authorName: f.name,
1606
+ createdAt: /* @__PURE__ */ new Date()
1607
+ };
1608
+ y.pushFieldValue("comments", g), u("");
1609
+ const p = {
1610
+ id: x(),
1611
+ type: "comment",
1612
+ text: `commented "${o.slice(0, 20)}${o.length > 20 ? "..." : ""}"`,
1613
+ userId: f.id,
1614
+ userName: f.name,
1615
+ createdAt: /* @__PURE__ */ new Date()
1616
+ };
1617
+ y.pushFieldValue("activity", p);
1618
+ }, U = (g) => {
1619
+ I(g.id), B(g.text);
1620
+ }, W = () => {
1621
+ if (v && M.trim()) {
1622
+ const p = (y.getFieldValue("comments") || []).map((_) => _.id === v ? { ..._, text: M } : _);
1623
+ y.setFieldValue("comments", p), I(null), B("");
1624
+ }
1625
+ }, X = () => {
1626
+ I(null), B("");
1627
+ }, V = (g) => {
1628
+ S(g);
1629
+ }, H = () => {
1630
+ S(null);
1631
+ }, b = (g) => {
1632
+ const p = y.getFieldValue("comments") || [];
1633
+ y.setFieldValue("comments", p.filter((K) => K.id !== g)), S(null);
1634
+ const _ = {
1635
+ id: x(),
1636
+ type: "delete",
1637
+ // Using generic delete type
1638
+ text: "deleted a comment",
1639
+ userId: f.id,
1640
+ userName: f.name,
1641
+ createdAt: /* @__PURE__ */ new Date()
1642
+ };
1643
+ y.pushFieldValue("activity", _);
1644
+ }, [F, Q] = q(""), G = () => {
1645
+ if (!F.trim()) return;
1646
+ const g = {
1647
+ id: x(),
1648
+ title: F,
1649
+ isCompleted: !1
1650
+ };
1651
+ y.pushFieldValue("subtasks", g), Q("");
1652
+ }, ae = (g) => {
1653
+ const _ = (y.getFieldValue("subtasks") || []).map(
1654
+ (K) => K.id === g ? { ...K, isCompleted: !K.isCompleted } : K
1655
+ );
1656
+ y.setFieldValue("subtasks", _);
1657
+ }, j = (g) => {
1658
+ const p = y.getFieldValue("subtasks") || [];
1659
+ y.setFieldValue("subtasks", p.filter((_) => _.id !== g));
1660
+ }, O = xe.useRef(null), [Z, re] = q(!1), [Y, ne] = q(null), ke = async (g) => {
1661
+ const p = g.target.files?.[0];
1662
+ if (!p) return;
1663
+ re(!0), ne(null), await new Promise((ee) => setTimeout(ee, 1500));
1664
+ const _ = {
1665
+ id: x(),
1666
+ name: p.name,
1667
+ url: URL.createObjectURL(p),
1668
+ type: p.type.startsWith("image/") ? "image" : "file",
1669
+ size: p.size,
1670
+ uploadedAt: /* @__PURE__ */ new Date()
1671
+ };
1672
+ y.pushFieldValue("attachments", _), re(!1), O.current && (O.current.value = "");
1673
+ const K = {
1674
+ id: x(),
1675
+ type: "attachment",
1676
+ text: `attached ${p.name}`,
1677
+ userId: f.id,
1678
+ userName: f.name,
1679
+ createdAt: /* @__PURE__ */ new Date()
1680
+ };
1681
+ y.pushFieldValue("activity", K);
1682
+ }, De = (g) => {
1683
+ const p = y.getFieldValue("attachments") || [];
1684
+ y.setFieldValue("attachments", p.filter((K) => K.id !== g));
1685
+ const _ = {
1686
+ id: x(),
1687
+ type: "delete",
1688
+ text: "removed an attachment",
1689
+ userId: f.id,
1690
+ userName: f.name,
1691
+ createdAt: /* @__PURE__ */ new Date()
1692
+ };
1693
+ y.pushFieldValue("activity", _);
1694
+ }, ie = !!c?.id, me = (g) => {
1695
+ g.preventDefault(), g.stopPropagation(), y.handleSubmit();
1696
+ }, ue = /* @__PURE__ */ d("div", { className: "space-y-6", children: [
1697
+ /* @__PURE__ */ e("div", { className: "flex items-start justify-between gap-4", children: /* @__PURE__ */ d("div", { className: "flex-1 space-y-4", children: [
1698
+ /* @__PURE__ */ e(
1699
+ y.Field,
1700
+ {
1701
+ name: "title",
1702
+ children: (g) => /* @__PURE__ */ d("div", { className: "space-y-2", children: [
1703
+ /* @__PURE__ */ e(le, { htmlFor: "title", className: "text-right", children: k("common.title") }),
1704
+ /* @__PURE__ */ e(
1705
+ fe,
1706
+ {
1707
+ id: "title",
1708
+ value: g.state.value,
1709
+ onChange: (p) => g.handleChange(p.target.value),
1710
+ placeholder: k("kanban.cardTitlePlaceholder"),
1711
+ className: "text-lg font-semibold"
1712
+ }
1713
+ )
1714
+ ] })
1715
+ }
1716
+ ),
1717
+ /* @__PURE__ */ d("div", { className: "flex gap-4 items-center", children: [
1718
+ /* @__PURE__ */ e("div", { className: "w-[200px]", children: /* @__PURE__ */ e(
1719
+ y.Field,
1720
+ {
1721
+ name: "columnId",
1722
+ children: (g) => /* @__PURE__ */ d(Fe, { value: g.state.value, onValueChange: (p) => g.handleChange(p), children: [
1723
+ /* @__PURE__ */ e(_e, { children: /* @__PURE__ */ e(Te, { placeholder: "Status" }) }),
1724
+ /* @__PURE__ */ e(Be, { children: m.map((p) => /* @__PURE__ */ e(oe, { value: p.id, children: p.name }, p.id)) })
1725
+ ] })
1726
+ }
1727
+ ) }),
1728
+ ie && /* @__PURE__ */ d("span", { className: "text-sm text-muted-foreground font-mono", children: [
1729
+ "#",
1730
+ c?.id?.slice(0, 8)
1731
+ ] })
1732
+ ] })
1733
+ ] }) }),
1734
+ /* @__PURE__ */ d("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-4", children: [
1735
+ /* @__PURE__ */ e(
1736
+ y.Field,
1737
+ {
1738
+ name: "priority",
1739
+ children: (g) => /* @__PURE__ */ d("div", { className: "space-y-2", children: [
1740
+ /* @__PURE__ */ e(le, { children: "Priority" }),
1741
+ /* @__PURE__ */ d(Fe, { value: g.state.value, onValueChange: (p) => g.handleChange(p), children: [
1742
+ /* @__PURE__ */ e(_e, { children: /* @__PURE__ */ e(Te, { placeholder: "Priority" }) }),
1743
+ /* @__PURE__ */ d(Be, { children: [
1744
+ /* @__PURE__ */ e(oe, { value: "low", children: "Low" }),
1745
+ /* @__PURE__ */ e(oe, { value: "medium", children: "Medium" }),
1746
+ /* @__PURE__ */ e(oe, { value: "high", children: "High" }),
1747
+ /* @__PURE__ */ e(oe, { value: "critical", children: "Critical" })
1748
+ ] })
1749
+ ] })
1750
+ ] })
1751
+ }
1752
+ ),
1753
+ /* @__PURE__ */ e(
1754
+ y.Field,
1755
+ {
1756
+ name: "startDate",
1757
+ children: (g) => /* @__PURE__ */ d("div", { className: "space-y-2", children: [
1758
+ /* @__PURE__ */ e(le, { children: "Start Date" }),
1759
+ /* @__PURE__ */ e(
1760
+ $e,
1761
+ {
1762
+ date: g.state.value,
1763
+ setDate: (p) => g.handleChange(p),
1764
+ mode: "date"
1765
+ }
1766
+ )
1767
+ ] })
1768
+ }
1769
+ ),
1770
+ /* @__PURE__ */ e(
1771
+ y.Field,
1772
+ {
1773
+ name: "dueDate",
1774
+ children: (g) => /* @__PURE__ */ d("div", { className: "space-y-2", children: [
1775
+ /* @__PURE__ */ e(le, { children: "Due Date" }),
1776
+ /* @__PURE__ */ e(
1777
+ $e,
1778
+ {
1779
+ date: g.state.value,
1780
+ setDate: (p) => g.handleChange(p),
1781
+ mode: "date"
1782
+ }
1783
+ )
1784
+ ] })
1785
+ }
1786
+ )
1787
+ ] }),
1788
+ /* @__PURE__ */ e(
1789
+ y.Field,
1790
+ {
1791
+ name: "description",
1792
+ children: (g) => /* @__PURE__ */ d("div", { className: "space-y-2", children: [
1793
+ /* @__PURE__ */ e(le, { children: "Description" }),
1794
+ /* @__PURE__ */ e(
1795
+ Me,
1796
+ {
1797
+ value: g.state.value || "",
1798
+ onChange: (p) => g.handleChange(p.target.value),
1799
+ className: "min-h-[150px]"
1800
+ }
1801
+ )
1802
+ ] })
1803
+ }
1804
+ ),
1805
+ h.length > 0 && /* @__PURE__ */ e("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4 border-t pt-4", children: h.map((g) => /* @__PURE__ */ e(
1806
+ y.Field,
1807
+ {
1808
+ name: `customFieldValues.${g.id}`,
1809
+ children: (p) => /* @__PURE__ */ d("div", { className: "space-y-2", children: [
1810
+ /* @__PURE__ */ e(le, { children: g.name }),
1811
+ g.type === "text" && /* @__PURE__ */ e(
1812
+ fe,
1813
+ {
1814
+ value: p.state.value || "",
1815
+ onChange: (_) => p.handleChange(_.target.value)
1816
+ }
1817
+ ),
1818
+ g.type === "number" && /* @__PURE__ */ e(
1819
+ fe,
1820
+ {
1821
+ type: "number",
1822
+ value: p.state.value || "",
1823
+ onChange: (_) => p.handleChange(Number(_.target.value))
1824
+ }
1825
+ ),
1826
+ g.type === "date" && /* @__PURE__ */ e(
1827
+ $e,
1828
+ {
1829
+ date: p.state.value,
1830
+ setDate: (_) => p.handleChange(_),
1831
+ mode: "date"
1832
+ }
1833
+ ),
1834
+ g.type === "select" && /* @__PURE__ */ d(Fe, { value: p.state.value || "", onValueChange: (_) => p.handleChange(_), children: [
1835
+ /* @__PURE__ */ e(_e, { children: /* @__PURE__ */ e(Te, { placeholder: "Select..." }) }),
1836
+ /* @__PURE__ */ e(Be, { children: g.options?.map((_) => /* @__PURE__ */ e(oe, { value: _, children: _ }, _)) })
1837
+ ] }),
1838
+ g.type === "checkbox" && /* @__PURE__ */ d("div", { className: "flex items-center space-x-2", children: [
1839
+ /* @__PURE__ */ e(
1840
+ Ce,
1841
+ {
1842
+ checked: !!p.state.value,
1843
+ onCheckedChange: (_) => p.handleChange(!!_)
1844
+ }
1845
+ ),
1846
+ /* @__PURE__ */ e("span", { className: "text-sm font-medium", children: g.name })
1847
+ ] })
1848
+ ] })
1849
+ },
1850
+ g.id
1851
+ )) }),
1852
+ /* @__PURE__ */ d(gt, { defaultValue: "subtasks", className: "w-full", children: [
1853
+ /* @__PURE__ */ d(ft, { className: "grid w-full grid-cols-5", children: [
1854
+ /* @__PURE__ */ e(ve, { value: "subtasks", children: "Subtasks" }),
1855
+ /* @__PURE__ */ e(ve, { value: "checklists", children: "Checklists" }),
1856
+ /* @__PURE__ */ e(ve, { value: "attachments", children: "Attachments" }),
1857
+ /* @__PURE__ */ e(ve, { value: "comments", children: "Comments" }),
1858
+ /* @__PURE__ */ e(ve, { value: "activity", children: "Activity" })
1859
+ ] }),
1860
+ /* @__PURE__ */ d(ye, { value: "subtasks", className: "space-y-4 pt-4", children: [
1861
+ /* @__PURE__ */ e(
1862
+ y.Field,
1863
+ {
1864
+ name: "subtasks",
1865
+ children: (g) => /* @__PURE__ */ d("div", { className: "space-y-2", children: [
1866
+ g.state.value?.map((p) => /* @__PURE__ */ d("div", { className: "flex items-center gap-2 border p-3 rounded-md", children: [
1867
+ /* @__PURE__ */ e(
1868
+ Ce,
1869
+ {
1870
+ checked: p.isCompleted,
1871
+ onCheckedChange: () => ae(p.id)
1872
+ }
1873
+ ),
1874
+ /* @__PURE__ */ e("span", { className: p.isCompleted ? "line-through text-muted-foreground flex-1" : "flex-1", children: p.title }),
1875
+ /* @__PURE__ */ e($, { variant: "ghost", size: "icon", onClick: () => j(p.id), children: /* @__PURE__ */ e(Ue, { className: "w-4 h-4" }) })
1876
+ ] }, p.id)),
1877
+ (!g.state.value || g.state.value.length === 0) && /* @__PURE__ */ e("div", { className: "text-center py-8 text-muted-foreground border border-dashed rounded-lg", children: "No subtasks yet." })
1878
+ ] })
1879
+ }
1880
+ ),
1881
+ /* @__PURE__ */ d("div", { className: "flex gap-2", children: [
1882
+ /* @__PURE__ */ e(
1883
+ fe,
1884
+ {
1885
+ value: F,
1886
+ onChange: (g) => Q(g.target.value),
1887
+ placeholder: "Add a subtask...",
1888
+ onKeyDown: (g) => g.key === "Enter" && G()
1889
+ }
1890
+ ),
1891
+ /* @__PURE__ */ e($, { onClick: G, disabled: !F.trim(), children: "Add" })
1892
+ ] })
1893
+ ] }),
1894
+ /* @__PURE__ */ d(ye, { value: "checklists", className: "space-y-4 pt-4", children: [
1895
+ /* @__PURE__ */ d("div", { className: "flex justify-between items-center", children: [
1896
+ /* @__PURE__ */ e("h3", { className: "font-medium", children: "Checklists" }),
1897
+ /* @__PURE__ */ d($, { size: "sm", onClick: N, variant: "outline", children: [
1898
+ /* @__PURE__ */ e(be, { className: "w-4 h-4 mr-2" }),
1899
+ " Add Checklist"
1900
+ ] })
1901
+ ] }),
1902
+ /* @__PURE__ */ e(
1903
+ y.Field,
1904
+ {
1905
+ name: "checklists",
1906
+ children: (g) => /* @__PURE__ */ d("div", { className: "space-y-4", children: [
1907
+ g.state.value?.map((p) => {
1908
+ const _ = p.items.length > 0 ? Math.round(p.items.filter((K) => K.isChecked).length / p.items.length * 100) : 0;
1909
+ return /* @__PURE__ */ d("div", { className: "border rounded-md p-4 space-y-3", children: [
1910
+ /* @__PURE__ */ d("div", { className: "flex justify-between items-center", children: [
1911
+ /* @__PURE__ */ e("div", { className: "font-medium", children: p.title }),
1912
+ /* @__PURE__ */ d("div", { className: "text-xs text-muted-foreground", children: [
1913
+ _,
1914
+ "%"
1915
+ ] })
1916
+ ] }),
1917
+ /* @__PURE__ */ e("div", { className: "h-2 w-full bg-muted rounded-full overflow-hidden", children: /* @__PURE__ */ e("div", { className: "h-full bg-primary transition-all", style: { width: `${_}%` } }) }),
1918
+ /* @__PURE__ */ e("div", { className: "space-y-2", children: p.items.map((K) => /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
1919
+ /* @__PURE__ */ e(
1920
+ Ce,
1921
+ {
1922
+ checked: K.isChecked,
1923
+ onCheckedChange: () => n(p.id, K.id)
1924
+ }
1925
+ ),
1926
+ /* @__PURE__ */ e("span", { className: K.isChecked ? "line-through text-muted-foreground" : "", children: K.text })
1927
+ ] }, K.id)) }),
1928
+ /* @__PURE__ */ d("div", { className: "pt-2 flex gap-2", children: [
1929
+ /* @__PURE__ */ e(
1930
+ fe,
1931
+ {
1932
+ placeholder: "Add an item...",
1933
+ className: "h-8 text-sm",
1934
+ value: l[p.id] || "",
1935
+ onChange: (K) => D(p.id, K.target.value),
1936
+ onKeyDown: (K) => K.key === "Enter" && r(p.id)
1937
+ }
1938
+ ),
1939
+ /* @__PURE__ */ e($, { size: "sm", onClick: () => r(p.id), disabled: !l[p.id]?.trim(), children: "Add" })
1940
+ ] })
1941
+ ] }, p.id);
1942
+ }),
1943
+ (!g.state.value || g.state.value.length === 0) && /* @__PURE__ */ e("div", { className: "text-center py-8 text-muted-foreground border border-dashed rounded-lg", children: "No checklists yet." })
1944
+ ] })
1945
+ }
1946
+ )
1947
+ ] }),
1948
+ /* @__PURE__ */ d(ye, { value: "attachments", className: "space-y-4 pt-4", children: [
1949
+ /* @__PURE__ */ d("div", { className: "flex justify-between items-center", children: [
1950
+ /* @__PURE__ */ e("h3", { className: "font-medium", children: "Attachments" }),
1951
+ /* @__PURE__ */ e(
1952
+ "input",
1953
+ {
1954
+ type: "file",
1955
+ className: "hidden",
1956
+ ref: O,
1957
+ onChange: ke
1958
+ }
1959
+ ),
1960
+ /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
1961
+ Y && /* @__PURE__ */ e("span", { className: "text-xs text-red-500", children: Y }),
1962
+ /* @__PURE__ */ d($, { size: "sm", variant: "outline", onClick: () => O.current?.click(), disabled: Z, children: [
1963
+ Z ? /* @__PURE__ */ e(It, { className: "w-4 h-4 mr-2 animate-spin" }) : /* @__PURE__ */ e(dt, { className: "w-4 h-4 mr-2" }),
1964
+ Z ? "Uploading..." : "Upload"
1965
+ ] })
1966
+ ] })
1967
+ ] }),
1968
+ /* @__PURE__ */ e(
1969
+ y.Field,
1970
+ {
1971
+ name: "attachments",
1972
+ children: (g) => /* @__PURE__ */ d("div", { className: "grid grid-cols-2 gap-2", children: [
1973
+ g.state.value?.map((p) => /* @__PURE__ */ d("div", { className: "border p-2 rounded flex items-center gap-2", children: [
1974
+ /* @__PURE__ */ e("div", { className: "w-10 h-10 bg-muted flex items-center justify-center rounded", children: /* @__PURE__ */ e(wa, { className: "w-5 h-5 text-muted-foreground" }) }),
1975
+ /* @__PURE__ */ d("div", { className: "overflow-hidden", children: [
1976
+ /* @__PURE__ */ e("div", { className: "truncate font-medium text-sm", children: p.name }),
1977
+ /* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground", children: p.type })
1978
+ ] }),
1979
+ /* @__PURE__ */ e($, { variant: "ghost", size: "icon", className: "ml-auto", onClick: () => De(p.id), children: /* @__PURE__ */ e(Ue, { className: "w-4 h-4 text-muted-foreground" }) })
1980
+ ] }, p.id)),
1981
+ (!g.state.value || g.state.value.length === 0) && !Z && /* @__PURE__ */ e("div", { className: "text-center py-8 text-muted-foreground border border-dashed rounded-lg", children: "No attachments yet." })
1982
+ ] })
1983
+ }
1984
+ )
1985
+ ] }),
1986
+ /* @__PURE__ */ d(ye, { value: "comments", className: "space-y-4 pt-4", children: [
1987
+ /* @__PURE__ */ e(
1988
+ y.Field,
1989
+ {
1990
+ name: "comments",
1991
+ children: (g) => /* @__PURE__ */ d("div", { className: "space-y-4", children: [
1992
+ g.state.value?.map((p) => /* @__PURE__ */ d("div", { className: "flex gap-3", children: [
1993
+ /* @__PURE__ */ e(Re, { className: "w-8 h-8", children: /* @__PURE__ */ e(Ke, { children: p.authorName[0] }) }),
1994
+ /* @__PURE__ */ d("div", { className: "space-y-1 w-full", children: [
1995
+ /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
1996
+ /* @__PURE__ */ e("span", { className: "font-semibold text-sm", children: p.authorName }),
1997
+ /* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: new Date(p.createdAt).toLocaleString() })
1998
+ ] }),
1999
+ v === p.id ? /* @__PURE__ */ d("div", { className: "flex flex-col gap-2", children: [
2000
+ /* @__PURE__ */ e(
2001
+ Me,
2002
+ {
2003
+ value: M,
2004
+ onChange: (_) => B(_.target.value),
2005
+ onKeyDown: (_) => {
2006
+ _.key === "Enter" && (_.metaKey || _.ctrlKey) ? W() : _.key === "Escape" && X();
2007
+ },
2008
+ autoFocus: !0
2009
+ }
2010
+ ),
2011
+ /* @__PURE__ */ d("div", { className: "flex gap-2 justify-end", children: [
2012
+ /* @__PURE__ */ e($, { size: "sm", variant: "ghost", onClick: X, children: "Cancel" }),
2013
+ /* @__PURE__ */ e($, { size: "sm", onClick: W, children: "Save" })
2014
+ ] })
2015
+ ] }) : /* @__PURE__ */ e("div", { className: "text-sm bg-muted/50 p-2 rounded-md", children: p.text }),
2016
+ T === p.id && /* @__PURE__ */ d("div", { className: "flex items-center gap-2 p-2 bg-red-50 text-red-800 rounded-md text-sm mt-2", children: [
2017
+ /* @__PURE__ */ e(ot, { className: "w-4 h-4" }),
2018
+ /* @__PURE__ */ e("span", { className: "flex-1", children: "Delete this comment?" }),
2019
+ /* @__PURE__ */ e($, { size: "sm", variant: "ghost", className: "h-6 px-2 hover:bg-red-100 text-red-800", onClick: H, children: "No" }),
2020
+ /* @__PURE__ */ e($, { size: "sm", variant: "destructive", className: "h-6 px-2", onClick: () => b(p.id), children: "Yes" })
2021
+ ] })
2022
+ ] }),
2023
+ /* @__PURE__ */ d("div", { className: "flex flex-col gap-1", children: [
2024
+ /* @__PURE__ */ e($, { variant: "ghost", size: "icon", className: "h-6 w-6", onClick: () => U(p), disabled: !!T, children: /* @__PURE__ */ e(_a, { className: "w-3 h-3 text-muted-foreground" }) }),
2025
+ /* @__PURE__ */ e($, { variant: "ghost", size: "icon", className: "h-6 w-6", onClick: () => V(p.id), disabled: !!T, children: /* @__PURE__ */ e(ct, { className: "w-3 h-3 text-muted-foreground" }) })
2026
+ ] })
2027
+ ] }, p.id)),
2028
+ (!g.state.value || g.state.value.length === 0) && /* @__PURE__ */ e("div", { className: "text-center py-8 text-muted-foreground", children: "No comments yet." })
2029
+ ] })
2030
+ }
2031
+ ),
2032
+ /* @__PURE__ */ e("div", { className: "pt-4 border-t sticky bottom-0 bg-background", children: /* @__PURE__ */ d("div", { className: "flex gap-2", children: [
2033
+ /* @__PURE__ */ e(Re, { className: "w-8 h-8", children: /* @__PURE__ */ e(Ke, { children: f?.name?.[0] || "U" }) }),
2034
+ /* @__PURE__ */ d("div", { className: "flex-1 space-y-2", children: [
2035
+ /* @__PURE__ */ e(
2036
+ Me,
2037
+ {
2038
+ value: o,
2039
+ onChange: (g) => u(g.target.value),
2040
+ placeholder: "Write a comment...",
2041
+ rows: 2
2042
+ }
2043
+ ),
2044
+ /* @__PURE__ */ e("div", { className: "flex justify-end", children: /* @__PURE__ */ e($, { size: "sm", onClick: E, disabled: !o.trim(), children: "Send" }) })
2045
+ ] })
2046
+ ] }) })
2047
+ ] }),
2048
+ /* @__PURE__ */ e(ye, { value: "activity", className: "space-y-4 pt-4", children: /* @__PURE__ */ e(
2049
+ y.Field,
2050
+ {
2051
+ name: "activity",
2052
+ children: (g) => /* @__PURE__ */ d("div", { className: "space-y-4", children: [
2053
+ g.state.value?.map((p) => /* @__PURE__ */ d("div", { className: "flex gap-3 text-sm", children: [
2054
+ /* @__PURE__ */ e("div", { className: "mt-1", children: /* @__PURE__ */ e(da, { className: "w-4 h-4 text-muted-foreground" }) }),
2055
+ /* @__PURE__ */ d("div", { children: [
2056
+ /* @__PURE__ */ e("span", { className: "font-semibold", children: p.userName }),
2057
+ " ",
2058
+ /* @__PURE__ */ e("span", { className: "text-muted-foreground", children: p.text }),
2059
+ /* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground mt-1", children: new Date(p.createdAt).toLocaleString() })
2060
+ ] })
2061
+ ] }, p.id)),
2062
+ (!g.state.value || g.state.value.length === 0) && /* @__PURE__ */ e("div", { className: "text-center py-8 text-muted-foreground", children: "No activity yet." })
2063
+ ] })
2064
+ }
2065
+ ) })
2066
+ ] })
2067
+ ] });
2068
+ return /* @__PURE__ */ d(
2069
+ lt,
2070
+ {
2071
+ isOpen: t,
2072
+ onClose: a,
2073
+ title: ie ? "Edit Card" : "New Card",
2074
+ className: "sm:max-w-[800px] h-[85vh] flex flex-col",
2075
+ children: [
2076
+ /* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto pr-2", children: ue }),
2077
+ /* @__PURE__ */ d("div", { className: "flex justify-between pt-4 border-t mt-4", children: [
2078
+ ie && /* @__PURE__ */ e($, { variant: "destructive", onClick: A, children: "Delete Card" }),
2079
+ /* @__PURE__ */ d("div", { className: "flex gap-2 ml-auto", children: [
2080
+ /* @__PURE__ */ e($, { variant: "outline", onClick: a, children: "Cancel" }),
2081
+ /* @__PURE__ */ e($, { onClick: (g) => me(g), children: "Save" })
2082
+ ] })
2083
+ ] })
2084
+ ]
2085
+ }
2086
+ );
2087
+ }, Oe = te.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e(
2088
+ "div",
2089
+ {
2090
+ ref: s,
2091
+ className: P(
2092
+ "rounded-xl border bg-card text-card-foreground shadow",
2093
+ t
2094
+ ),
2095
+ ...a
2096
+ }
2097
+ ));
2098
+ Oe.displayName = "Card";
2099
+ const vt = te.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e(
2100
+ "div",
2101
+ {
2102
+ ref: s,
2103
+ className: P("flex flex-col space-y-1.5 p-6", t),
2104
+ ...a
2105
+ }
2106
+ ));
2107
+ vt.displayName = "CardHeader";
2108
+ const sn = te.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e(
2109
+ "div",
2110
+ {
2111
+ ref: s,
2112
+ className: P("font-semibold leading-none tracking-tight", t),
2113
+ ...a
2114
+ }
2115
+ ));
2116
+ sn.displayName = "CardTitle";
2117
+ const rn = te.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e(
2118
+ "div",
2119
+ {
2120
+ ref: s,
2121
+ className: P("text-sm text-muted-foreground", t),
2122
+ ...a
2123
+ }
2124
+ ));
2125
+ rn.displayName = "CardDescription";
2126
+ const Le = te.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e("div", { ref: s, className: P("p-6 pt-0", t), ...a }));
2127
+ Le.displayName = "CardContent";
2128
+ const on = te.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e(
2129
+ "div",
2130
+ {
2131
+ ref: s,
2132
+ className: P("flex items-center p-6 pt-0", t),
2133
+ ...a
2134
+ }
2135
+ ));
2136
+ on.displayName = "CardFooter";
2137
+ const at = {
2138
+ Active: { color: "emerald", label: "Active", icon: ge },
2139
+ Verified: { color: "emerald", label: "Verified", icon: ge },
2140
+ Approved: { color: "emerald", label: "Approved", icon: ge },
2141
+ Published: { color: "teal", label: "Published", icon: ge },
2142
+ Resolved: { color: "teal", label: "Resolved", icon: ge },
2143
+ Completed: { color: "indigo", label: "Completed", icon: ge },
2144
+ "In Progress": { color: "sky", label: "In Progress", icon: pa },
2145
+ Open: { color: "sky", label: "Open", icon: Sa },
2146
+ Pending: { color: "amber", label: "Pending", icon: Ae },
2147
+ "Under Review": { color: "amber", label: "Under Review", icon: Ze },
2148
+ Scheduled: { color: "orange", label: "Scheduled", icon: Ae },
2149
+ Returned: { color: "orange", label: "Returned", icon: Ea },
2150
+ Rejected: { color: "red", label: "Rejected", icon: Ie },
2151
+ Disapproved: { color: "red", label: "Disapproved", icon: Ie },
2152
+ Unresolved: { color: "red", label: "Unresolved", icon: ia },
2153
+ Expired: { color: "red", label: "Expired", icon: va },
2154
+ Cancelled: { color: "rose", label: "Cancelled", icon: Ie },
2155
+ Unverified: { color: "rose", label: "Unverified", icon: Xe },
2156
+ Inactive: { color: "slate", label: "Inactive", icon: Ie },
2157
+ "On Leave": { color: "blue", label: "On Leave", icon: Ae },
2158
+ Archived: { color: "gray", label: "Archived", icon: ma },
2159
+ Draft: { color: "gray", label: "Draft", icon: Ze },
2160
+ Closed: { color: "gray", label: "Closed", icon: et },
2161
+ Public: { color: "blue", label: "Public", icon: Ge },
2162
+ Private: { color: "slate", label: "Private", icon: et },
2163
+ Restricted: { color: "amber", label: "Restricted", icon: $a },
2164
+ Internal: { color: "indigo", label: "Internal", icon: Qa },
2165
+ External: { color: "blue", label: "External", icon: Ge },
2166
+ System: { color: "violet", label: "System", icon: sa },
2167
+ Default: { color: "gray", label: "Default", icon: Xe }
2168
+ }, ln = {
2169
+ none: "none",
2170
+ low: "0 0 10px -5px",
2171
+ medium: "0 0 20px -8px",
2172
+ high: "0 0 30px -4px"
2173
+ }, yt = it(({
2174
+ status: t,
2175
+ className: a,
2176
+ showDot: s = !1,
2177
+ showIcon: i = !1,
2178
+ iconPosition: c = "left",
2179
+ hideLabel: m = !1,
2180
+ showTooltip: C = !0,
2181
+ variant: h = "solid",
2182
+ customWidth: f,
2183
+ customHeight: k,
2184
+ customFontSize: x = "11px",
2185
+ customBgColor: y,
2186
+ customTextColor: A,
2187
+ showBorder: l = !1,
2188
+ borderThickness: w = "1px",
2189
+ customBorderColor: N,
2190
+ glowIntensity: D = "medium"
2191
+ }) => {
2192
+ const r = at[t] || at.Default, n = r.color, o = r.icon, u = n === "gray" || n === "slate", v = {
2193
+ width: f || void 0,
2194
+ height: k || void 0,
2195
+ fontSize: x,
2196
+ backgroundColor: y || void 0,
2197
+ color: A || void 0,
2198
+ borderWidth: l ? w : "0px",
2199
+ borderColor: N || (l ? "currentColor" : "transparent"),
2200
+ borderStyle: l ? "solid" : "none",
2201
+ boxShadow: D !== "none" && !y ? `${ln[D]} var(--tw-shadow-color)` : void 0
2202
+ };
2203
+ return /* @__PURE__ */ d(
2204
+ "div",
2205
+ {
2206
+ style: v,
2207
+ title: C ? r.label : void 0,
2208
+ className: P(
2209
+ "inline-flex items-center justify-center gap-2 transition-all duration-300 rounded-full font-bold",
2210
+ m ? "p-1.5 w-[28px] h-[28px]" : "px-3 py-1",
2211
+ !f && !m && "min-w-[120px]",
2212
+ !k && !m && "min-h-[28px]",
2213
+ !y && (h === "solid" ? `bg-${n}-100` : "bg-transparent"),
2214
+ !A && `text-${n}-950`,
2215
+ !y && `dark:bg-${n}-300`,
2216
+ !A && (u ? "dark:text-white dark:bg-gray-800" : "dark:text-black"),
2217
+ `shadow-${n}-500/40`,
2218
+ C && "cursor-help",
2219
+ a
2220
+ ),
2221
+ children: [
2222
+ c === "left" && i && /* @__PURE__ */ e(o, { className: P("shrink-0 stroke-[3px]", m ? "w-4 h-4" : "w-3.5 h-3.5") }),
2223
+ s && !i && !m && /* @__PURE__ */ e("span", { className: P(
2224
+ "w-1.5 h-1.5 rounded-full flex-shrink-0",
2225
+ `bg-${n}-700`,
2226
+ u ? "dark:bg-white" : "dark:bg-black/70"
2227
+ ) }),
2228
+ !m && /* @__PURE__ */ e("span", { className: "uppercase tracking-widest font-black leading-none", children: r.label }),
2229
+ c === "right" && i && /* @__PURE__ */ e(o, { className: P("shrink-0 stroke-[3px]", m ? "w-4 h-4" : "w-3.5 h-3.5") })
2230
+ ]
2231
+ }
2232
+ );
2233
+ });
2234
+ yt.displayName = "StatusBadge";
2235
+ const nt = {
2236
+ formatDate: (t, a = "PP") => {
2237
+ if (!t) return "";
2238
+ const s = new Date(t);
2239
+ return Ve(s) ? He(s, a) : "";
2240
+ },
2241
+ formatDateTime: (t, a = "PP p") => {
2242
+ if (!t) return "";
2243
+ const s = new Date(t);
2244
+ return Ve(s) ? He(s, a) : "";
2245
+ },
2246
+ isValidDate: (t) => {
2247
+ const a = new Date(t);
2248
+ return Ve(a);
2249
+ }
2250
+ }, Ct = ({
2251
+ card: t,
2252
+ onClick: a,
2253
+ onDoubleClick: s,
2254
+ isDragging: i,
2255
+ isHighlighted: c,
2256
+ enableTooltip: m,
2257
+ tooltipTemplate: C,
2258
+ customFields: h,
2259
+ slots: f,
2260
+ slotProps: k,
2261
+ className: x,
2262
+ dir: y
2263
+ }) => {
2264
+ const A = y === "rtl", {
2265
+ attributes: l,
2266
+ listeners: w,
2267
+ setNodeRef: N,
2268
+ transform: D,
2269
+ transition: r,
2270
+ isDragging: n
2271
+ } = ut({
2272
+ id: t.id,
2273
+ data: { type: "card", card: t }
2274
+ }), o = i || n, u = {
2275
+ transform: mt.Translate.toString(D),
2276
+ transition: r
2277
+ }, v = {
2278
+ low: "Pending",
2279
+ medium: "In Progress",
2280
+ high: "Active",
2281
+ critical: "Inactive"
2282
+ // Using red color for critical
2283
+ }, I = t.checklists?.reduce((V, H) => V + H.items.length, 0) || 0, M = t.checklists?.reduce((V, H) => V + H.items.filter((b) => b.isChecked).length, 0) || 0, B = t.subtasks?.length || 0, T = t.subtasks?.filter((V) => V.isCompleted).length || 0, S = /* @__PURE__ */ d("div", { className: "p-0 space-y-2", children: [
2284
+ t.coverImage && /* @__PURE__ */ e("div", { className: "h-32 w-full overflow-hidden rounded-t-lg", children: /* @__PURE__ */ e("img", { src: t.coverImage, alt: "Cover", className: "w-full h-full object-cover" }) }),
2285
+ /* @__PURE__ */ d("div", { className: P("p-3 space-y-2", t.coverImage ? "pt-1" : ""), children: [
2286
+ /* @__PURE__ */ d("div", { className: "flex items-start justify-between gap-2", children: [
2287
+ /* @__PURE__ */ e("h4", { className: "font-medium text-sm line-clamp-2 flex-1", children: t.title }),
2288
+ t.priority && /* @__PURE__ */ e(
2289
+ yt,
2290
+ {
2291
+ status: v[t.priority] || "Pending",
2292
+ className: "shrink-0"
2293
+ }
2294
+ )
2295
+ ] }),
2296
+ t.description && /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground line-clamp-2", children: t.description }),
2297
+ t.tags && t.tags.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1", children: t.tags.map((V) => /* @__PURE__ */ e(
2298
+ pt,
2299
+ {
2300
+ variant: "secondary",
2301
+ className: "text-xs px-2 py-0",
2302
+ style: {
2303
+ backgroundColor: V.color,
2304
+ color: "#fff"
2305
+ },
2306
+ children: V.name
2307
+ },
2308
+ V.id
2309
+ )) }),
2310
+ (I > 0 || t.attachments && t.attachments.length > 0 || t.comments && t.comments.length > 0 || B > 0 || t.timeTracking) && /* @__PURE__ */ d("div", { className: "flex items-center gap-3 text-muted-foreground pt-1 flex-wrap", children: [
2311
+ t.attachments && t.attachments.length > 0 && /* @__PURE__ */ d("div", { className: "flex items-center gap-1 text-xs", children: [
2312
+ /* @__PURE__ */ e(dt, { className: "w-3 h-3" }),
2313
+ /* @__PURE__ */ e("span", { children: t.attachments.length })
2314
+ ] }),
2315
+ t.comments && t.comments.length > 0 && /* @__PURE__ */ d("div", { className: "flex items-center gap-1 text-xs", children: [
2316
+ /* @__PURE__ */ e(Ia, { className: "w-3 h-3" }),
2317
+ /* @__PURE__ */ e("span", { children: t.comments.length })
2318
+ ] }),
2319
+ I > 0 && /* @__PURE__ */ d("div", { className: "flex items-center gap-1 text-xs", children: [
2320
+ /* @__PURE__ */ e(Ra, { className: "w-3 h-3" }),
2321
+ /* @__PURE__ */ d("span", { children: [
2322
+ M,
2323
+ "/",
2324
+ I
2325
+ ] })
2326
+ ] }),
2327
+ B > 0 && /* @__PURE__ */ d("div", { className: "flex items-center gap-1 text-xs", children: [
2328
+ /* @__PURE__ */ e(Na, { className: "w-3 h-3" }),
2329
+ /* @__PURE__ */ d("span", { children: [
2330
+ T,
2331
+ "/",
2332
+ B
2333
+ ] })
2334
+ ] }),
2335
+ t.timeTracking && (t.timeTracking.estimated > 0 || t.timeTracking.actual > 0) && /* @__PURE__ */ d("div", { className: "flex items-center gap-1 text-xs", title: `Estimated: ${t.timeTracking.estimated}h, Actual: ${t.timeTracking.actual}h`, children: [
2336
+ /* @__PURE__ */ e(Ae, { className: "w-3 h-3" }),
2337
+ /* @__PURE__ */ d("span", { children: [
2338
+ t.timeTracking.actual,
2339
+ "h / ",
2340
+ t.timeTracking.estimated,
2341
+ "h"
2342
+ ] })
2343
+ ] })
2344
+ ] }),
2345
+ /* @__PURE__ */ d("div", { className: "flex items-center justify-between pt-1", children: [
2346
+ t.assignees && t.assignees.length > 0 && /* @__PURE__ */ d("div", { className: "flex -space-x-2", children: [
2347
+ t.assignees.slice(0, 3).map((V) => /* @__PURE__ */ e(Re, { className: "w-6 h-6 border-2 border-background", children: V.avatarUrl ? /* @__PURE__ */ e(Jt, { src: V.avatarUrl, alt: V.name }) : /* @__PURE__ */ e(Ke, { className: "text-xs", children: V.name.substring(0, 2).toUpperCase() }) }, V.id)),
2348
+ t.assignees.length > 3 && /* @__PURE__ */ e("div", { className: "w-6 h-6 rounded-full bg-muted border-2 border-background flex items-center justify-center", children: /* @__PURE__ */ d("span", { className: "text-xs", children: [
2349
+ "+",
2350
+ t.assignees.length - 3
2351
+ ] }) })
2352
+ ] }),
2353
+ t.dueDate && /* @__PURE__ */ d("div", { className: P("flex items-center gap-1 text-xs text-muted-foreground", A ? "mr-auto" : "ml-auto"), children: [
2354
+ /* @__PURE__ */ e(ra, { className: "w-3 h-3" }),
2355
+ /* @__PURE__ */ e("span", { children: nt.formatDate(t.dueDate) })
2356
+ ] })
2357
+ ] })
2358
+ ] }),
2359
+ h && h.length > 0 && t.customFieldValues && /* @__PURE__ */ e("div", { className: "px-3 pb-3 gap-1 flex flex-wrap", children: h.map((V) => {
2360
+ const H = t.customFieldValues?.[V.id];
2361
+ return H == null || H === "" ? null : /* @__PURE__ */ d("div", { className: "text-xs bg-muted px-1.5 py-0.5 rounded flex items-center gap-1 max-w-full truncate", children: [
2362
+ /* @__PURE__ */ d("span", { className: "text-muted-foreground opacity-70", children: [
2363
+ V.name,
2364
+ ":"
2365
+ ] }),
2366
+ /* @__PURE__ */ e("span", { className: "font-medium truncate", children: V.type === "date" ? nt.formatDate(H) : String(H) })
2367
+ ] }, V.id);
2368
+ }) })
2369
+ ] }), E = f?.cardContent, U = E ? /* @__PURE__ */ e(E, { card: t, ...k?.cardContent }) : S, W = /* @__PURE__ */ e(
2370
+ Oe,
2371
+ {
2372
+ ref: N,
2373
+ style: u,
2374
+ ...l,
2375
+ ...w,
2376
+ onClick: () => a?.(t),
2377
+ onDoubleClick: () => s?.(t),
2378
+ id: t.id,
2379
+ "data-card-id": t.id,
2380
+ className: P(
2381
+ "cursor-pointer transition-all hover:shadow-md overflow-hidden",
2382
+ o && "opacity-50 ring-2 ring-primary/50",
2383
+ c && "ring-2 ring-primary bg-primary/5 transition-colors duration-300",
2384
+ // Highlight style
2385
+ x
2386
+ ),
2387
+ children: U
2388
+ }
2389
+ ), X = f?.card;
2390
+ return X ? /* @__PURE__ */ e(X, { card: t, defaultContent: W, ...k?.card }) : /* @__PURE__ */ e(St, { enabled: m, content: C ? C(t) : null, children: W });
2391
+ };
2392
+ Ct.displayName = "KanbanCard";
2393
+ const wt = it(Ct), dn = ({
2394
+ cards: t,
2395
+ estimateSize: a = 120,
2396
+ overscan: s = 5
2397
+ }) => {
2398
+ const i = ze(null), c = oa({
2399
+ count: t.length,
2400
+ getScrollElement: () => i.current,
2401
+ estimateSize: () => a,
2402
+ overscan: s
2403
+ });
2404
+ return {
2405
+ parentRef: i,
2406
+ virtualizer: c,
2407
+ virtualItems: c.getVirtualItems(),
2408
+ totalSize: c.getTotalSize()
2409
+ };
2410
+ }, cn = ({
2411
+ column: t,
2412
+ cards: a,
2413
+ onCardClick: s,
2414
+ onCardDoubleClick: i,
2415
+ onCardDragStart: c,
2416
+ onAddCard: m,
2417
+ onToggleCollapse: C,
2418
+ onDeleteColumn: h,
2419
+ onUpdateColumn: f,
2420
+ // Added
2421
+ onColumnClick: k,
2422
+ // Added
2423
+ selectedColumnId: x,
2424
+ // Added
2425
+ draggedCardId: y,
2426
+ highlightedCardId: A,
2427
+ // Added
2428
+ isDropTarget: l,
2429
+ customFields: w,
2430
+ className: N,
2431
+ dir: D,
2432
+ slots: r,
2433
+ slotProps: n
2434
+ }) => {
2435
+ const o = D === "rtl", { t: u } = we(), [v, I] = xe.useState(!1), M = r?.card || wt, [B, T] = xe.useState(t.name), S = xe.useRef(null);
2436
+ xe.useEffect(() => {
2437
+ v && S.current && (S.current.focus(), S.current.select());
2438
+ }, [v]);
2439
+ const E = () => {
2440
+ B.trim() && B !== t.name ? f?.(t.id, { name: B }) : T(t.name), I(!1);
2441
+ }, U = (j) => {
2442
+ j.key === "Enter" ? E() : j.key === "Escape" && (T(t.name), I(!1));
2443
+ }, W = t.wipLimit && a.length > t.wipLimit, X = t.wipLimit && a.length === t.wipLimit, {
2444
+ setNodeRef: V,
2445
+ attributes: H,
2446
+ listeners: b,
2447
+ transform: F,
2448
+ transition: Q,
2449
+ isDragging: G
2450
+ } = ut({
2451
+ id: t.id,
2452
+ data: { type: "column", column: t }
2453
+ }), ae = {
2454
+ transform: mt.Translate.toString(F),
2455
+ transition: Q
2456
+ };
2457
+ return /* @__PURE__ */ d(
2458
+ Oe,
2459
+ {
2460
+ ref: V,
2461
+ style: ae,
2462
+ className: P(
2463
+ "flex flex-col w-80 shrink-0 transition-all duration-200",
2464
+ x === t.id ? "ring-2 ring-primary border-primary" : "",
2465
+ G ? "opacity-50" : "",
2466
+ l ? "ring-2 ring-primary/70 border-primary/50 bg-primary/5" : "",
2467
+ N
2468
+ ),
2469
+ onClick: () => k?.(t.id),
2470
+ children: [
2471
+ /* @__PURE__ */ d(vt, { className: "pb-3", onDoubleClick: () => I(!0), children: [
2472
+ /* @__PURE__ */ d("div", { className: "flex items-center justify-between", children: [
2473
+ /* @__PURE__ */ d("div", { className: "flex items-center gap-2 flex-1", children: [
2474
+ /* @__PURE__ */ e("div", { ...H, ...b, className: "cursor-grab active:cursor-grabbing p-1 hover:bg-muted rounded text-muted-foreground/50 hover:text-primary transition-colors", children: /* @__PURE__ */ e(Ye, { className: "h-4 w-4" }) }),
2475
+ /* @__PURE__ */ e(
2476
+ $,
2477
+ {
2478
+ variant: "ghost",
2479
+ size: "sm",
2480
+ className: "h-6 w-6 p-0",
2481
+ onClick: () => C?.(t.id),
2482
+ children: t.isCollapsed ? o ? /* @__PURE__ */ e(Ee, { className: "h-4 w-4 rotate-180" }) : /* @__PURE__ */ e(Ee, { className: "h-4 w-4" }) : /* @__PURE__ */ e(ht, { className: "h-4 w-4" })
2483
+ }
2484
+ ),
2485
+ /* @__PURE__ */ d("div", { className: "flex items-center gap-2 flex-1 min-w-0", children: [
2486
+ v ? /* @__PURE__ */ e(
2487
+ "input",
2488
+ {
2489
+ ref: S,
2490
+ value: B,
2491
+ onChange: (j) => T(j.target.value),
2492
+ onBlur: E,
2493
+ onKeyDown: U,
2494
+ className: "h-6 w-full text-sm font-semibold border rounded px-1 bg-background",
2495
+ onClick: (j) => j.stopPropagation()
2496
+ }
2497
+ ) : /* @__PURE__ */ e("h3", { className: "font-semibold text-sm truncate", title: t.name, children: t.name }),
2498
+ /* @__PURE__ */ d("span", { className: "text-xs text-muted-foreground", children: [
2499
+ a.length,
2500
+ " ",
2501
+ u("items")
2502
+ ] })
2503
+ ] })
2504
+ ] }),
2505
+ /* @__PURE__ */ d("div", { className: "flex items-center gap-1", children: [
2506
+ /* @__PURE__ */ d(Lt, { children: [
2507
+ /* @__PURE__ */ e(Qt, { asChild: !0, children: /* @__PURE__ */ e($, { variant: "ghost", size: "sm", className: "h-6 w-6 p-0", children: /* @__PURE__ */ e(Ye, { className: "h-4 w-4" }) }) }),
2508
+ /* @__PURE__ */ e(jt, { align: "end", children: /* @__PURE__ */ d(Ot, { className: "text-red-600 focus:text-red-600 focus:bg-red-50", onClick: () => h?.(t.id), children: [
2509
+ /* @__PURE__ */ e(ct, { className: "h-4 w-4 me-2" }),
2510
+ u("delete_column") || "Delete Column"
2511
+ ] }) })
2512
+ ] }),
2513
+ /* @__PURE__ */ e(
2514
+ $,
2515
+ {
2516
+ variant: "ghost",
2517
+ size: "sm",
2518
+ className: "h-6 w-6 p-0",
2519
+ onClick: () => m?.(t.id),
2520
+ children: /* @__PURE__ */ e(be, { className: "h-4 w-4" })
2521
+ }
2522
+ )
2523
+ ] })
2524
+ ] }),
2525
+ t.wipLimit && /* @__PURE__ */ e("div", { className: "mt-2", children: /* @__PURE__ */ e("div", { className: "h-1 w-full bg-muted rounded-full overflow-hidden", children: /* @__PURE__ */ e(
2526
+ "div",
2527
+ {
2528
+ className: P(
2529
+ "h-full transition-all",
2530
+ W ? "bg-red-500" : X ? "bg-yellow-500" : "bg-green-500"
2531
+ ),
2532
+ style: { width: `${Math.min(a.length / t.wipLimit * 100, 100)}%` }
2533
+ }
2534
+ ) }) })
2535
+ ] }),
2536
+ !t.isCollapsed && (() => {
2537
+ const j = a.sort((O, Z) => O.position - Z.position);
2538
+ if (j.length > 50) {
2539
+ const { parentRef: O, virtualItems: Z, totalSize: re } = dn({
2540
+ cards: j,
2541
+ estimateSize: 120,
2542
+ overscan: 5
2543
+ });
2544
+ return /* @__PURE__ */ d(
2545
+ Le,
2546
+ {
2547
+ ref: O,
2548
+ className: "flex-1 overflow-y-auto max-h-[calc(100vh-200px)]",
2549
+ children: [
2550
+ /* @__PURE__ */ e("div", { style: { height: `${re}px`, position: "relative" }, children: Z.map((Y) => {
2551
+ const ne = j[Y.index];
2552
+ return /* @__PURE__ */ e(
2553
+ "div",
2554
+ {
2555
+ style: {
2556
+ position: "absolute",
2557
+ top: 0,
2558
+ left: 0,
2559
+ width: "100%",
2560
+ transform: `translateY(${Y.start}px)`,
2561
+ paddingBottom: "8px"
2562
+ },
2563
+ children: /* @__PURE__ */ e(
2564
+ "div",
2565
+ {
2566
+ style: {
2567
+ position: "absolute",
2568
+ top: 0,
2569
+ left: 0,
2570
+ width: "100%",
2571
+ transform: `translateY(${Y.start}px)`,
2572
+ paddingBottom: "8px"
2573
+ },
2574
+ children: /* @__PURE__ */ e(
2575
+ M,
2576
+ {
2577
+ card: ne,
2578
+ onClick: s,
2579
+ onDoubleClick: i,
2580
+ onDragStart: c,
2581
+ isDragging: y === ne.id,
2582
+ isHighlighted: A === ne.id,
2583
+ customFields: w,
2584
+ dir: D,
2585
+ ...n?.card
2586
+ }
2587
+ )
2588
+ },
2589
+ ne.id
2590
+ )
2591
+ },
2592
+ ne.id
2593
+ );
2594
+ }) }),
2595
+ j.length === 0 && /* @__PURE__ */ e("div", { className: "text-center py-8 text-sm text-muted-foreground", children: u("no_cards") })
2596
+ ]
2597
+ }
2598
+ );
2599
+ }
2600
+ return /* @__PURE__ */ d(Le, { className: "flex-1 overflow-y-auto max-h-[calc(100vh-200px)] space-y-2", children: [
2601
+ /* @__PURE__ */ e(
2602
+ Pe,
2603
+ {
2604
+ items: a.map((O) => O.id),
2605
+ strategy: aa,
2606
+ children: j.map((O) => /* @__PURE__ */ e(
2607
+ M,
2608
+ {
2609
+ card: O,
2610
+ onClick: s,
2611
+ onDoubleClick: i,
2612
+ onDragStart: c,
2613
+ isDragging: y === O.id,
2614
+ isHighlighted: A === O.id,
2615
+ customFields: w,
2616
+ dir: D,
2617
+ ...n?.card
2618
+ },
2619
+ O.id
2620
+ ))
2621
+ }
2622
+ ),
2623
+ a.length === 0 && /* @__PURE__ */ e("div", { className: P(
2624
+ "flex h-32 items-center justify-center rounded-lg border border-dashed text-sm transition-all duration-150",
2625
+ l ? "border-primary/60 bg-primary/5 text-primary/70" : "text-muted-foreground"
2626
+ ), children: l ? "✦ Drop here" : u("no_cards") })
2627
+ ] });
2628
+ })()
2629
+ ]
2630
+ }
2631
+ );
2632
+ }, mn = ({
2633
+ swimlaneId: t,
2634
+ columnId: a,
2635
+ children: s,
2636
+ className: i
2637
+ }) => {
2638
+ const { isOver: c, setNodeRef: m } = Gt({
2639
+ id: `swimlane-cell-${t}-${a}`,
2640
+ data: {
2641
+ type: "swimlane-cell",
2642
+ swimlaneId: t,
2643
+ columnId: a
2644
+ }
2645
+ });
2646
+ return /* @__PURE__ */ e(
2647
+ "div",
2648
+ {
2649
+ ref: m,
2650
+ className: P(i, c && "bg-primary/5 transition-colors"),
2651
+ children: s
2652
+ }
2653
+ );
2654
+ }, st = ({
2655
+ swimlane: t,
2656
+ columns: a,
2657
+ cards: s,
2658
+ onCardClick: i,
2659
+ onCardDoubleClick: c,
2660
+ onCardDragStart: m,
2661
+ onCardDragEnd: C,
2662
+ onToggleCollapse: h,
2663
+ draggedCardId: f,
2664
+ highlightedCardId: k,
2665
+ // Added
2666
+ customFields: x,
2667
+ className: y,
2668
+ dir: A,
2669
+ slots: l,
2670
+ slotProps: w
2671
+ }) => {
2672
+ const N = A === "rtl", { t: D } = we(), r = l?.card || wt;
2673
+ return /* @__PURE__ */ d("div", { className: P("flex flex-col border rounded-lg bg-card text-card-foreground shadow-sm mb-4", y), children: [
2674
+ /* @__PURE__ */ d("div", { className: "flex items-center gap-2 p-3 border-b bg-muted/30", children: [
2675
+ /* @__PURE__ */ e(
2676
+ $,
2677
+ {
2678
+ variant: "ghost",
2679
+ size: "sm",
2680
+ className: "h-6 w-6 p-0",
2681
+ onClick: () => h?.(t.id),
2682
+ children: t.isCollapsed ? N ? /* @__PURE__ */ e(Ee, { className: "h-4 w-4 rotate-180" }) : /* @__PURE__ */ e(Ee, { className: "h-4 w-4" }) : /* @__PURE__ */ e(ht, { className: "h-4 w-4" })
2683
+ }
2684
+ ),
2685
+ /* @__PURE__ */ e("h3", { className: "font-semibold text-sm", children: t.name }),
2686
+ /* @__PURE__ */ d("span", { className: "text-xs text-muted-foreground", children: [
2687
+ "(",
2688
+ s.length,
2689
+ " ",
2690
+ D("items"),
2691
+ ")"
2692
+ ] })
2693
+ ] }),
2694
+ !t.isCollapsed && /* @__PURE__ */ e("div", { className: P("flex divide-x", N && "divide-x-reverse"), children: a.map((n) => {
2695
+ const o = s.filter((u) => u.columnId === n.id);
2696
+ return /* @__PURE__ */ e(
2697
+ mn,
2698
+ {
2699
+ swimlaneId: t.id,
2700
+ columnId: n.id,
2701
+ className: "flex-1 min-w-[280px] p-2 min-h-[100px]",
2702
+ children: /* @__PURE__ */ e("div", { className: "space-y-2", children: o.map((u) => /* @__PURE__ */ e(
2703
+ r,
2704
+ {
2705
+ card: u,
2706
+ onClick: i,
2707
+ onDoubleClick: c,
2708
+ onDragStart: m,
2709
+ onDragEnd: C,
2710
+ isDragging: f === u.id,
2711
+ isHighlighted: k === u.id,
2712
+ customFields: x,
2713
+ dir: A,
2714
+ ...w?.card
2715
+ },
2716
+ u.id
2717
+ )) })
2718
+ },
2719
+ n.id
2720
+ );
2721
+ }) })
2722
+ ] });
2723
+ }, un = (t, a) => a.find((i) => i.id === t.columnId)?.color || "hsl(var(--primary))", hn = ({
2724
+ cards: t,
2725
+ columns: a,
2726
+ swimlanes: s,
2727
+ onCardUpdate: i,
2728
+ onCardClick: c,
2729
+ onCardCreate: m,
2730
+ className: C,
2731
+ dir: h
2732
+ }) => {
2733
+ const f = ce(() => {
2734
+ let l = [];
2735
+ return s && s.length > 0 ? (l = s.sort((w, N) => w.position - N.position).map((w) => ({
2736
+ id: w.id,
2737
+ name: w.name,
2738
+ color: w.color
2739
+ })), t.some((w) => !w.swimlaneId) && l.push({
2740
+ id: "uncategorized",
2741
+ name: "Uncategorized",
2742
+ color: "hsl(var(--muted-foreground))"
2743
+ }), l) : a.sort((w, N) => w.position - N.position).map((w) => ({
2744
+ id: w.id,
2745
+ name: w.name,
2746
+ color: w.color
2747
+ }));
2748
+ }, [s, a, t]), k = ce(() => t.map((l) => {
2749
+ const w = s && s.length > 0 ? l.swimlaneId || "uncategorized" : l.columnId || "uncategorized", N = l.startDate ? new Date(l.startDate) : l.dueDate ? We(new Date(l.dueDate)) : We(/* @__PURE__ */ new Date()), D = l.dueDate ? new Date(l.dueDate) : Vt(N, 1), r = a.find((n) => n.id === l.columnId);
2750
+ return {
2751
+ id: l.id,
2752
+ title: l.title,
2753
+ start: N,
2754
+ end: D,
2755
+ resourceId: w || "uncategorized",
2756
+ description: l.description,
2757
+ color: un(l, a),
2758
+ status: r?.name,
2759
+ // Store original card for easy access
2760
+ originalCard: l
2761
+ };
2762
+ }), [t, s, a]), x = L((l) => {
2763
+ const w = l.originalCard;
2764
+ if (!w) return;
2765
+ const N = {
2766
+ ...w,
2767
+ startDate: l.start,
2768
+ dueDate: l.end,
2769
+ // If we dragged to a different resource (swimlane/column), update that too
2770
+ ...s && s.length > 0 ? { swimlaneId: l.resourceId } : { columnId: l.resourceId || w.columnId || a[0]?.id || "" }
2771
+ };
2772
+ i?.(N, "move");
2773
+ }, [i, s, a]), y = L((l) => {
2774
+ const w = s && s.length > 0, N = {
2775
+ title: l.title || "New Card",
2776
+ startDate: l.start,
2777
+ dueDate: l.end,
2778
+ columnId: !w && l.resourceId ? l.resourceId : a[0]?.id || "",
2779
+ swimlaneId: w && l.resourceId ? l.resourceId : void 0,
2780
+ description: l.description || "",
2781
+ priority: "medium"
2782
+ };
2783
+ m?.(N);
2784
+ }, [s, a, m]), A = L((l) => {
2785
+ const w = l.originalCard;
2786
+ w && c?.(w);
2787
+ }, [c]);
2788
+ return /* @__PURE__ */ e("div", { className: C, style: { height: "100%", minHeight: "600px" }, children: /* @__PURE__ */ e(
2789
+ $t,
2790
+ {
2791
+ events: k,
2792
+ resources: f,
2793
+ selectedDate: /* @__PURE__ */ new Date(),
2794
+ view: "TimelineMonth",
2795
+ views: ["TimelineWeek", "TimelineMonth"],
2796
+ onEventChange: x,
2797
+ onEventCreate: y,
2798
+ onEventClick: A,
2799
+ showHeaderBar: !0,
2800
+ showResourceHeaders: !0,
2801
+ dir: h
2802
+ }
2803
+ ) });
2804
+ }, pn = ({
2805
+ board: t,
2806
+ onCardClick: a,
2807
+ onCardDoubleClick: s,
2808
+ onCardDragStart: i,
2809
+ onCardDragEnd: c,
2810
+ onCardDrop: m,
2811
+ onAddCard: C,
2812
+ onToggleColumnCollapse: h,
2813
+ onToggleSwimlaneCollapse: f,
2814
+ onAddColumn: k,
2815
+ onDeleteColumn: x,
2816
+ onUpdateColumn: y,
2817
+ onColumnClick: A,
2818
+ onCreateCard: l,
2819
+ selectedColumnId: w,
2820
+ draggedCardId: N,
2821
+ filteredCards: D,
2822
+ slots: r,
2823
+ slotProps: n,
2824
+ className: o,
2825
+ view: u = "standard",
2826
+ dir: v
2827
+ }) => {
2828
+ const I = D || t.cards, { t: M } = we(), [B, T] = q(null), [S, E] = q(null);
2829
+ if (u === "timeline")
2830
+ return /* @__PURE__ */ e(
2831
+ hn,
2832
+ {
2833
+ cards: I,
2834
+ columns: t.columns,
2835
+ swimlanes: t.swimlanes,
2836
+ onCardUpdate: m ? async (b, F) => {
2837
+ F === "move" && m(b.columnId, b.swimlaneId);
2838
+ } : void 0,
2839
+ onCardClick: a,
2840
+ onCardCreate: l,
2841
+ className: o,
2842
+ dir: v
2843
+ }
2844
+ );
2845
+ const U = () => !t.swimlanes || t.swimlanes.length === 0 ? null : /* @__PURE__ */ e("div", { className: P("flex flex-col p-4 overflow-y-auto h-full", o), children: /* @__PURE__ */ d(Pe, { items: I.map((b) => b.id), children: [
2846
+ t.swimlanes.sort((b, F) => b.position - F.position).map((b) => {
2847
+ const F = I.filter((Q) => Q.swimlaneId === b.id);
2848
+ return /* @__PURE__ */ e(
2849
+ st,
2850
+ {
2851
+ swimlane: b,
2852
+ columns: t.columns.sort((Q, G) => Q.position - G.position),
2853
+ cards: F,
2854
+ onCardClick: a,
2855
+ onCardDoubleClick: s,
2856
+ onCardDragStart: i,
2857
+ onCardDragEnd: c,
2858
+ onDrop: m,
2859
+ onToggleCollapse: f,
2860
+ draggedCardId: N,
2861
+ customFields: t.customFields,
2862
+ slots: r,
2863
+ slotProps: n,
2864
+ dir: v
2865
+ },
2866
+ b.id
2867
+ );
2868
+ }),
2869
+ I.some((b) => !b.swimlaneId) && /* @__PURE__ */ e(
2870
+ st,
2871
+ {
2872
+ swimlane: {
2873
+ id: "uncategorized",
2874
+ name: M("uncategorized"),
2875
+ type: "custom",
2876
+ position: 9999,
2877
+ isCollapsed: !1
2878
+ },
2879
+ columns: t.columns.sort((b, F) => b.position - F.position),
2880
+ cards: I.filter((b) => !b.swimlaneId),
2881
+ onCardClick: a,
2882
+ onCardDoubleClick: s,
2883
+ onCardDragStart: i,
2884
+ onCardDragEnd: c,
2885
+ onDrop: m,
2886
+ onToggleCollapse: () => {
2887
+ },
2888
+ draggedCardId: N,
2889
+ customFields: t.customFields,
2890
+ slots: r,
2891
+ slotProps: n,
2892
+ dir: v
2893
+ }
2894
+ )
2895
+ ] }) }), W = Yt(
2896
+ Xt(Zt, {
2897
+ activationConstraint: { distance: 5 }
2898
+ })
2899
+ );
2900
+ return /* @__PURE__ */ d(
2901
+ ea,
2902
+ {
2903
+ sensors: W,
2904
+ onDragStart: (b) => {
2905
+ const { active: F } = b;
2906
+ F.data.current?.type === "card" && (T(F.data.current.card), i?.(F.data.current.card));
2907
+ },
2908
+ onDragOver: (b) => {
2909
+ const { over: F } = b;
2910
+ if (!F) {
2911
+ E(null);
2912
+ return;
2913
+ }
2914
+ F.data.current?.type === "column" ? E(F.data.current.column.id) : F.data.current?.type === "card" ? E(F.data.current.card.columnId) : F.data.current?.type === "swimlane-cell" ? E(F.data.current.columnId) : E(null);
2915
+ },
2916
+ onDragEnd: (b) => {
2917
+ const { active: F, over: Q } = b;
2918
+ if (T(null), E(null), !Q) {
2919
+ c?.();
2920
+ return;
2921
+ }
2922
+ if (F.data.current?.type === "card") {
2923
+ let G, ae, j;
2924
+ if (Q.data.current?.type === "column")
2925
+ G = Q.data.current.column.id, ae = void 0;
2926
+ else if (Q.data.current?.type === "swimlane-cell")
2927
+ G = Q.data.current.columnId, j = Q.data.current.swimlaneId;
2928
+ else if (Q.data.current?.type === "card") {
2929
+ const O = Q.data.current.card;
2930
+ G = O.columnId, j = O.swimlaneId;
2931
+ let Z = t.cards.filter((Y) => Y.columnId === G);
2932
+ j && (Z = Z.filter((Y) => Y.swimlaneId === j)), Z.sort((Y, ne) => (Y.position ?? 0) - (ne.position ?? 0));
2933
+ const re = Z.findIndex((Y) => Y.id === O.id);
2934
+ ae = re >= 0 ? re : void 0;
2935
+ }
2936
+ G ? m?.(G, j, ae) : c?.();
2937
+ } else F.data.current?.type === "column" && Q.data.current?.type, c?.();
2938
+ },
2939
+ children: [
2940
+ u === "swimlane" ? U() : /* @__PURE__ */ d("div", { className: P("flex gap-4 overflow-x-auto p-4", o), children: [
2941
+ /* @__PURE__ */ e(
2942
+ Pe,
2943
+ {
2944
+ items: t.columns.map((b) => b.id),
2945
+ strategy: na,
2946
+ children: t.columns.sort((b, F) => b.position - F.position).map((b) => {
2947
+ const F = I.filter((Q) => Q.columnId === b.id);
2948
+ return /* @__PURE__ */ e(
2949
+ cn,
2950
+ {
2951
+ column: b,
2952
+ cards: F,
2953
+ onCardClick: a,
2954
+ onCardDoubleClick: s,
2955
+ onCardDragStart: i,
2956
+ onCardDragEnd: c,
2957
+ onDrop: m,
2958
+ onAddCard: C,
2959
+ onToggleCollapse: h,
2960
+ onDeleteColumn: x,
2961
+ onUpdateColumn: y,
2962
+ onColumnClick: A,
2963
+ selectedColumnId: w,
2964
+ draggedCardId: N,
2965
+ isDropTarget: S === b.id,
2966
+ customFields: t.customFields,
2967
+ slots: r,
2968
+ slotProps: n,
2969
+ dir: v
2970
+ },
2971
+ b.id
2972
+ );
2973
+ })
2974
+ }
2975
+ ),
2976
+ k && /* @__PURE__ */ e("div", { className: "w-80 shrink-0", children: /* @__PURE__ */ d(
2977
+ $,
2978
+ {
2979
+ variant: "outline",
2980
+ className: "w-full h-12 border-dashed",
2981
+ onClick: k,
2982
+ children: [
2983
+ /* @__PURE__ */ e(be, { className: "me-2 h-4 w-4" }),
2984
+ M("add_column") || "Add Column"
2985
+ ]
2986
+ }
2987
+ ) })
2988
+ ] }),
2989
+ /* @__PURE__ */ e(ta, { dropAnimation: { duration: 200, easing: "ease" }, children: B ? /* @__PURE__ */ e("div", { className: "rotate-2 opacity-90 shadow-2xl ring-2 ring-primary/60 rounded-lg pointer-events-none w-72", children: /* @__PURE__ */ d("div", { className: "bg-card border border-border rounded-lg p-3 space-y-1", children: [
2990
+ /* @__PURE__ */ e("p", { className: "font-medium text-sm", children: B.title }),
2991
+ B.description && /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground line-clamp-2", children: B.description })
2992
+ ] }) }) : null })
2993
+ ]
2994
+ }
2995
+ );
2996
+ }, gn = ({
2997
+ isOpen: t,
2998
+ onClose: a,
2999
+ onConfirm: s,
3000
+ title: i,
3001
+ message: c,
3002
+ description: m
3003
+ }) => {
3004
+ const { t: C } = we(), h = () => {
3005
+ s(), a();
3006
+ };
3007
+ return /* @__PURE__ */ e(
3008
+ lt,
3009
+ {
3010
+ isOpen: t,
3011
+ onClose: a,
3012
+ title: i || C("confirm_delete") || "Confirm Delete",
3013
+ size: "sm",
3014
+ footer: /* @__PURE__ */ d("div", { className: "flex justify-end gap-2", children: [
3015
+ /* @__PURE__ */ e($, { variant: "ghost", onClick: a, children: C("cancel") || "Cancel" }),
3016
+ /* @__PURE__ */ e($, { variant: "destructive", onClick: h, children: C("delete") || "Delete" })
3017
+ ] }),
3018
+ children: /* @__PURE__ */ d("div", { className: "py-2", children: [
3019
+ /* @__PURE__ */ e("p", { children: c || C("confirm_delete_message") || "Are you sure you want to delete this item?" }),
3020
+ (m || C("action_cannot_be_undone")) && /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground mt-2", children: m || C("action_cannot_be_undone") || "This action cannot be undone." })
3021
+ ] })
3022
+ }
3023
+ );
3024
+ }, fn = new kt(), vn = rt((t, a) => {
3025
+ const { className: s, readOnly: i, ...c } = t;
3026
+ return Bt(), /* @__PURE__ */ e(Dt, { client: fn, children: /* @__PURE__ */ e(At, { fallback: /* @__PURE__ */ e(ja, {}), children: /* @__PURE__ */ e(xt, { ref: a, className: s, readOnly: i, ...c }) }) });
3027
+ });
3028
+ vn.displayName = "EzKanban";
3029
+ const xt = rt((t, a) => {
3030
+ const { className: s, readOnly: i, onCardClick: c, onCardDoubleClick: m } = t, C = Xa(t, a), { state: h, actions: f, dir: k, imperativeAPI: x } = C, [y, A] = q(!1), [l, w] = q(void 0), [N, D] = q(!1), [r, n] = q(null);
3031
+ bt(a, () => x, [x]);
3032
+ const o = (S) => {
3033
+ const E = S || h.selectedColumnId || h.board.columns[0]?.id;
3034
+ w({
3035
+ columnId: E,
3036
+ title: "",
3037
+ description: "",
3038
+ priority: "medium"
3039
+ }), A(!0);
3040
+ }, u = async (S) => {
3041
+ S.id ? await f.updateCard(S.id, S) : await f.createCard(S), A(!1);
3042
+ }, v = (S) => {
3043
+ t.confirmOnDelete !== !1 ? (n(S), D(!0), A(!1)) : (f.deleteCard(S), A(!1));
3044
+ }, I = async () => {
3045
+ r && (await f.deleteCard(r), D(!1), n(null));
3046
+ }, M = (S) => {
3047
+ i || (w(S), A(!0)), c?.(S);
3048
+ }, B = (S) => {
3049
+ const E = h.board.columns.find((U) => U.id === S);
3050
+ E && (E.isCollapsed ? f.expandColumn(S) : f.collapseColumn(S));
3051
+ }, T = (S) => {
3052
+ const E = h.board.swimlanes?.find((U) => U.id === S);
3053
+ E && (E.isCollapsed ? f.expandSwimlane(S) : f.collapseSwimlane(S));
3054
+ };
3055
+ return /* @__PURE__ */ d("div", { className: P("flex flex-col h-full bg-background", s), dir: k, children: [
3056
+ /* @__PURE__ */ e(qe, {}),
3057
+ /* @__PURE__ */ e(qe, {}),
3058
+ !i && (t.slots?.toolbar ? /* @__PURE__ */ e(
3059
+ t.slots.toolbar,
3060
+ {
3061
+ searchQuery: h.searchQuery,
3062
+ onSearchChange: f.setSearchQuery,
3063
+ onAddCardClick: () => o(),
3064
+ onAddColumn: () => {
3065
+ f.createColumn({
3066
+ name: "New Column",
3067
+ position: h.board.columns.length
3068
+ }).then((S) => {
3069
+ f.setSelectedColumnId(S.id);
3070
+ });
3071
+ },
3072
+ activeFilters: h.activeFilters,
3073
+ onFiltersChange: f.setActiveFilters,
3074
+ view: h.view,
3075
+ onViewChange: f.setView,
3076
+ onUndo: f.undo,
3077
+ onRedo: f.redo,
3078
+ canUndo: h.canUndo,
3079
+ canRedo: h.canRedo,
3080
+ ...t.slotProps?.toolbar || {}
3081
+ }
3082
+ ) : /* @__PURE__ */ e(
3083
+ an,
3084
+ {
3085
+ searchQuery: h.searchQuery,
3086
+ onSearchChange: f.setSearchQuery,
3087
+ onAddCardClick: () => o(),
3088
+ onAddColumn: () => {
3089
+ f.createColumn({
3090
+ name: "New Column",
3091
+ position: h.board.columns.length
3092
+ }).then((S) => {
3093
+ f.setSelectedColumnId(S.id);
3094
+ });
3095
+ },
3096
+ activeFilters: h.activeFilters,
3097
+ onFiltersChange: f.setActiveFilters,
3098
+ view: h.view,
3099
+ onViewChange: f.setView,
3100
+ onUndo: f.undo,
3101
+ onRedo: f.redo,
3102
+ canUndo: h.canUndo,
3103
+ canRedo: h.canRedo
3104
+ }
3105
+ )),
3106
+ /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden h-full", children: t.slots?.board ? /* @__PURE__ */ e(
3107
+ t.slots.board,
3108
+ {
3109
+ board: h.board,
3110
+ onCardClick: M,
3111
+ onCardDoubleClick: m,
3112
+ onCardDragStart: f.handleDragStart,
3113
+ onCardDragEnd: f.handleDragEnd,
3114
+ onCardDrop: f.handleDrop,
3115
+ onAddCard: o,
3116
+ onToggleColumnCollapse: B,
3117
+ onToggleSwimlaneCollapse: T,
3118
+ onDeleteColumn: f.deleteColumn,
3119
+ onUpdateColumn: f.updateColumn,
3120
+ onColumnClick: f.setSelectedColumnId,
3121
+ onCreateCard: u,
3122
+ selectedColumnId: h.selectedColumnId,
3123
+ draggedCardId: h.draggedCard?.id,
3124
+ filteredCards: h.filteredCards,
3125
+ slots: t.slots,
3126
+ slotProps: t.slotProps,
3127
+ view: h.view,
3128
+ dir: k,
3129
+ className: "flex-1 h-full",
3130
+ ...t.slotProps?.board || {}
3131
+ }
3132
+ ) : /* @__PURE__ */ e(
3133
+ pn,
3134
+ {
3135
+ board: h.board,
3136
+ onCardClick: M,
3137
+ onCardDoubleClick: m,
3138
+ onCardDragStart: f.handleDragStart,
3139
+ onCardDragEnd: f.handleDragEnd,
3140
+ onCardDrop: f.handleDrop,
3141
+ onAddCard: o,
3142
+ onToggleColumnCollapse: B,
3143
+ onToggleSwimlaneCollapse: T,
3144
+ onDeleteColumn: f.deleteColumn,
3145
+ onUpdateColumn: f.updateColumn,
3146
+ onColumnClick: f.setSelectedColumnId,
3147
+ onCreateCard: u,
3148
+ selectedColumnId: h.selectedColumnId,
3149
+ draggedCardId: h.draggedCard?.id,
3150
+ filteredCards: h.filteredCards,
3151
+ slots: t.slots,
3152
+ slotProps: t.slotProps,
3153
+ view: h.view,
3154
+ dir: k,
3155
+ className: "flex-1 h-full"
3156
+ }
3157
+ ) }),
3158
+ t.slots?.cardEditor ? /* @__PURE__ */ e(
3159
+ t.slots.cardEditor,
3160
+ {
3161
+ isOpen: y,
3162
+ onClose: () => A(!1),
3163
+ onSave: u,
3164
+ onDelete: v,
3165
+ card: l,
3166
+ columns: h.board.columns,
3167
+ ...t.slotProps?.cardEditor || {}
3168
+ }
3169
+ ) : /* @__PURE__ */ e(
3170
+ nn,
3171
+ {
3172
+ isOpen: y,
3173
+ onClose: () => A(!1),
3174
+ onSave: u,
3175
+ onDelete: v,
3176
+ card: l,
3177
+ columns: h.board.columns
3178
+ }
3179
+ ),
3180
+ /* @__PURE__ */ e(
3181
+ gn,
3182
+ {
3183
+ isOpen: N,
3184
+ onClose: () => D(!1),
3185
+ onConfirm: I,
3186
+ title: "Confirm Delete",
3187
+ message: "Are you sure you want to delete this card?",
3188
+ description: "This action cannot be undone."
3189
+ }
3190
+ )
3191
+ ] });
3192
+ });
3193
+ xt.displayName = "EzKanbanInner";
3194
+ export {
3195
+ pt as B,
3196
+ Oe as C,
3197
+ vn as E,
3198
+ pn as K,
3199
+ yt as S,
3200
+ gt as T,
3201
+ Le as a,
3202
+ rn as b,
3203
+ on as c,
3204
+ vt as d,
3205
+ sn as e,
3206
+ wt as f,
3207
+ nn as g,
3208
+ cn as h,
3209
+ ye as i,
3210
+ ft as j,
3211
+ ve as k,
3212
+ Me as l,
3213
+ en as m,
3214
+ Xa as n,
3215
+ we as o,
3216
+ st as p,
3217
+ hn as q,
3218
+ an as r,
3219
+ Za as u
3220
+ };